BUG? [was Re: MM5toGrADS]
Charles Seman
Charles.Seman at NOAA.GOV
Tue Jun 6 11:09:25 EDT 2006
Eric,
I've also experienced something similar for small grid spacings...
Try:
set x 1
set y 1
set z 1
set t 1
d t(x=...,y=...,z=...,t=...)
Here is a section of code used to take differences between variables
from two GrADS files (scripts "compare_zetac.gs" and "pause.gsf" attached):
if( do_check_diffs = 'yes' )
say
say '- - - - - - - - - - - - - - - - - - -'
say 'Check difference field for: 'var
say '- - - - - - - - - - - - - - - - - - -'
say
n=1
while ( n <= nt )
tt = tt.n
say '----------'
say ' tt = 'tt
say '----------'
*** pause()
zz=1
while ( zz <= zsiz )
say ' zz = 'zz
*** pause()
yy=1
while ( yy <= ysiz )
xx=1
while ( xx <= xsiz )
* say ' yy, xx = 'yy', 'xx
'set x 1'
'set y 1'
'set z 1'
'set t 1'
'd 'var'.1(x='xx',y='yy',z='zz',t='tt')'
rec = sublin(result,1); var1_value = subwrd(rec,4)
'd 'var'.2(x='xx',y='yy',z='zz',t='tt')'
rec = sublin(result,1); var2_value = subwrd(rec,4)
diff = var2_value - var1_value
if( diff != 0 )
say ' Non-zero difference = 'diff
say ' xx = 'xx
say ' "var1" value = 'var1_value
say ' "var2" value = 'var2_value
* say ' Exiting script.'
* exit
endif
'c events'
xx = xx+xinc
endwhile
yy = yy+yinc
endwhile
zz = zz+zinc
endwhile
n = n+1
endwhile
endif
I hope this helps,
Chuck
Eric Salathé wrote:
> On May 26, 2006, at 10:40 AM, Hristina Kirova wrote:
>> I am trying to run MM5 with 5 domains and I have problem with the
>> finest one.But when I tried to vizualize DOMAIN5 with GrADS, using
>> MM5toGrADS there is something strange with specific longitudes around -
>> 112.For example
>>
>> ga-> set lon -112.2
>> LON set to -112.202 -112.202
>> ga-> d t
>> Data Request Error: Invalid grid coordinates
>> World coordinates convert to non-integer grid coordinates
>> Variable = t Dimension = 0
>> Error ocurred at column 1
>> DISPLAY error: Invalid expression
>> Expression = t
>
> It appears that GrADs has a lower limit to the grid size it can handle,
> which would be a bug. Can anyone confirm this? Hristina's CTL file has
> the following:
>
> dset ^MMOUT.dat
> byteswapped
> title MM5 data
> undef -9999.
> pdef 120 120 lcc 32.91 -112.76 1.00 1.00 30.00 60.00
> -110.00 1000. 1000.
> xdef 297 linear -112.80 0.0045
> ydef 249 linear 32.91 0.0045
> zdef 23 levels
> <ETC>
>
> It is easy to test this in isolation with a generic real*4 array in the
> .dat file and varying the grid spacing in the CTL file.
>
> Make a data file like this:
>
> program test_file
> integer, parameter :: nx=297, ny=249
> real :: data(nx,ny)
>
> do ix = 1, nx
> do jy=1,ny
> data(ix,jy) = ix*jy
> end do
> end do
>
> open (unit=1,file='test_data.dat',access='direct', recl=nx*ny*4)
> write(1,rec=1) data
> close (1)
> end program test_file
>
> And this ctl file:
>
> dset ^test_data.dat
> undef -9999.
> xdef 297 linear -112.80 0.0045
> ydef 249 linear 32.91 0.0045
> zdef 1 levels 0
> tdef 1 linear 00:00Z11JAN2006 1hr
> vars 1
> t 0 99 temerature
> endvars
>
> open in grads and "set x 134" followed by "d t" I get
>
> Data Request Error: Invalid grid coordinates
> World coordinates convert to non-integer grid coordinates
> Variable = t Dimension = 0
> Error ocurred at column 1
> DISPLAY error: Invalid expression
> Expression = t
>
> Simply change 0.0045 to 0.045 in xdef and ydef, and it works as
> expected.
>
> -Eric
>
> On May 26, 2006, at 10:40 AM, Hristina Kirova wrote:
>
>> Hi,
>>
>> I am trying to run MM5 with 5 domains and I have problem with the
>> finest one.But when I tried to vizualize DOMAIN5 with GrADS, using
>> MM5toGrADS there is something strange with specific longitudes around -
>> 112.For example
>>
>> ga-> set lon -112.2
>> LON set to -112.202 -112.202
>> ga-> d t
>> Data Request Error: Invalid grid coordinates
>> World coordinates convert to non-integer grid coordinates
>> Variable = t Dimension = 0
>> Error ocurred at column 1
>> DISPLAY error: Invalid expression
>> Expression = t
>>
>> The same is situation with longitudes -112 and -112.1.These longitudes
>> are in the middle of the domain5 and there are not inside of
>> particular
>> grid cell.All other data for different from these lon are OK.
>> I sent my problem to mm5 users list but they wrote to me that there is
>> nothing wrong with my MMOUT_DOMAIN5 file and it is may be a problem
>> which have to be send to the grads users list.
>> In MM5toGrads there is a possibility to prepare a GrADS file only for 1
>> point.So I used
>> ga-> query w2gr -112 33
>> Xdim = 178.778 Ydim = 21.0001
>>
>> and put this values in mm5_to_gradsc.csh:
>> ............................
>> IFSKEW=1
>> ! IFSKEW=0 will write fully 3-D data
>> ! IFSKEW=1 will write out data at 1 grid point only.
>> ISKW=178.778 ! the i point (in N-S direction)
>> JSKW=21.0001 ! the j point (in E-W direction)
>>
>> ..............
>>
>> and with so created file it is possible to be ploted different
>> variables.
>>
>> I put my MMOUT_DOMAIN5.gz on ftp://ftp.meteo.bg/incoming/
>>
>> Can someone help me to solve this problem?
>>
>> Thank you very much
>>
>> Hristina
>>
>>
>> --
>> National Institute of Meteorology and Hydrology (http://www.meteo.bg/)
>>
>>
> --
> Eric Salathé
> Climate Impacts Group <salathe at washington.edu>
> University of Washington
> <http://www.atmos.washington.edu/~salathe>
--
********************************************************************
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."
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: compare_zetac.gs
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20060606/9546b54f/attachment.pl
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pause.gsf
Url: http://gradsusr.org/pipermail/gradsusr/attachments/20060606/9546b54f/attachment-0001.pl
More information about the gradsusr
mailing list