set gxout fwrite, print, line, shaded, etc

Charles Seman Charles.Seman at NOAA.GOV
Wed Nov 8 14:28:28 EST 2006


Here are some results from a GrADS session in which a script called
"radon_sd.gs" was run, in which a "set gxout fwrite" command was used in
the script to write out data, followed by code as follows:
-------------------------------------------------------------------------
  'disable fwrite'
  m=1
  while ( m <= nmods )
*
*  make local ctl file for June from the first year with scaled vertical
levels
*  to define dimensions...
*
    mod_file = ''mod_dir.m'/'y1'/'mod_ctl.m
    mod_file_scale = 'radon_mod.'y1'.scale.ctl'
    scale_zdef_zlevs(mod_file,m_to_km,mod_file_scale)

    say 'open GrADS file for Jun, 'y1
    say '...'mod_file_scale
    'open 'mod_file_scale ; check_dims(1)
    say 'GrADS file ready'
    l=1
    while ( l <= nlocs )
      say
      say 'Model 'm', Location 'l
      say 'level  radon_mean  radon_sd'
      zz=1
      while ( zz <= nz )
        'set x 1' ; 'set y 1' ; 'set t 1'
        'set z 'zz
        'set gxout line'
        'd 'radon_mod.m.l ; radon_mean = subwrd(result,4)
        'd 'radon_s_mod.m.l ; radon_sd = subwrd(result,4)
        say zz' 'radon_mean' 'radon_sd
pause()
-------------------------------------------------------------------------

which printed out:

-------------------------------------------------------------------------

open GrADS file for Jun, 1983
...radon_mod.1983.scale.ctl
function check_dims...
...leave function check_dims
GrADS file ready

Model 1, Location 1
level  radon_mean  radon_sd
1 1 1

-------------------------------------------------------------------------

after this, the script was stopped with a "Ctrl-c", and some interactive
commands were issued...  the following results were quite surprising:

ga-> q file
File 1 :
  Descriptor: radon_mod.1983.scale.ctl
  Binary:
/net2/cjs/ljd/lima/ch3i1/history/atmos_month/Jun/1983/radon222.o_zl.ieee
  Type = Gridded
  Xsize = 144  Ysize = 90  Zsize = 181  Tsize = 1
  Number of Variables = 2
    zl 181 99 zl
    radon222 181 99 radon222
ga-> q dims
Default file number is: 1
X is fixed     Lon = 1.25  X = 1
Y is fixed     Lat = -89.4944  Y = 1
Z is fixed     Lev = 0  Z = 1
T is fixed     Time = 00Z16JUN1983  T = 1
ga-> q define
radon222obs 17.9667
radon222obsmin 4.7
radon222obsmax 37.7
radon222obserr 2.46268
zlmod1e 0
radon222mod1e 56.7963
zlmod1w 0
radon222mod1w 15.125
radon222sdmod1e 3.75739
radon222sdmod1w 2.34234
zlmod2e 0
radon222mod2e 55.8237
zlmod2w 0
radon222mod2w 19.3895
radon222sdmod2e 4.68805
radon222sdmod2w 4.02229
ga-> q gxout
General = Stat
1D Graphic, 1 expr = Line
1D Graphic, 2 expr = 0
2D Graphic, 1 expr = Fwrite
2D Graphic, 2 expr = Vector
Station data = Value
ga-> q fwrite
FWrite file is open
FWrite file name is: grads.fwrite
FWrite byte order is little_endian ; machine byte order is little_endian
ga-> disable fwrite
ga-> q fwrite
FWrite file is closed
FWrite file name is: grads.fwrite
FWrite byte order is little_endian ; machine byte order is little_endian
ga-> set gxout line
ga-> d radon222mod1e
Wrote 1 of 1 elements to grads.fwrite as Stream Little_Endian
ga-> q fwrite
FWrite file is open
FWrite file name is: grads.fwrite
FWrite byte order is little_endian ; machine byte order is little_endian
ga-> disable fwrite
ga-> set gxout line
ga-> d radon222mod1e
Wrote 1 of 1 elements to grads.fwrite as Stream Little_Endian
ga-> set gxout print
ga-> d radon222mod1e
Printing Grid -- 1 Values -- Undef = -9.99e+33
56.7963
ga-> set gxout line
ga-> d radon222mod1e
Wrote 1 of 1 elements to grads.fwrite as Stream Little_Endian
ga-> set gxout line
ga-> d radon222mod1e
Wrote 1 of 1 elements to grads.fwrite as Stream Little_Endian
ga-> disable fwrite
ga-> set gxout line
ga-> d radon222mod1e
Wrote 1 of 1 elements to grads.fwrite as Stream Little_Endian
ga-> set gxout shaded
ga-> d radon222mod1e
Result value = 56.7963
ga-> q fwrite
FWrite file is open
FWrite file name is: grads.fwrite
FWrite byte order is little_endian ; machine byte order is little_endian
ga-> set gxout line
ga-> d radon222mod1e
Result value = 56.7963
ga-> q fwrite
FWrite file is open
FWrite file name is: grads.fwrite
FWrite byte order is little_endian ; machine byte order is little_endian

-------------------------------------------------------------------------

It appears that if a "set gxout line" is used following a 'set gxout
fwrite' command the output is sent to a GrADS fwrite file, even though a
'disable fwrite' was issued... and the expected results were obtained
only after a "set gxout shaded' command was issued... any ideas about
what is happening here?

If the script or more explanation is needed, please let me know...

Thanks for all help in this,
Chuck

--

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect
any position of the Government or NOAA."



More information about the gradsusr mailing list