grads

Save Data to text in grads After the print command


In the grads software After importing the geopotential data, we use the print command to display the data on the page. Is there a way to save this displayed data as text?

set gxout print

Output Taking Geopotential Values to Text File

sdfopen c:/Data/hgt.nc
set lon 0 120
set lat 0 80
set gxout print
d hgt

Solution

  • in script write:


    'reinit'
    'sdfopen C:\Data\hgt.nc'
    'set lon 10 80'
    'set lat 0 80'
    'set gxout print'
    'd hgt'
    dummy=write('c:/Data/output.txt',result)