regrid2 and gfs

teresa tiberi crancyfera at GMAIL.COM
Tue Nov 25 13:00:39 EST 2008


hello!

I woud like regrid a gfs file (es. gfs.t00z.pgrbf60.grib2) from 1 degree of
spatial resolution to 0.1 degree.

but if I check the output I have a file were data are all time the same :(

I have this message:

 GFS_2008112400.ctl
Default file number is: 1
X is varying   Lon = 0 to 360   X = 1 to 361
Y is varying   Lat = -90 to 90   Y = 1 to 181
Z is fixed     Lev = 850  Z = 1
T is fixed     Time = 00Z24NOV2008  T = 1

File 1 : GFS_2008112400.grb
  Descriptor: GFS_2008112400.ctl
  Binary: GFS_2008112400.grb
  Type = Gridded
  Xsize = 360  Ysize = 181  Zsize = 2  Tsize = 31
  Number of Variables = 10
    apcpsfc 0 61 ** surface Total precipitation [kg/m^2]
    cpratsfc 0 214 ** surface Convective precip. rate [kg/m^2/s]
    prmslmsl 0 2 ** Pressure reduced to MSL [Pa]
    rhprs 0 52 ** Relative humidity [%]
    tmpsfc 0 11 ** surface Temp. [K]
    tmpprs 2 11 ** Temp. [K]
    ugrdprs 2 33 ** u wind [m/s]
    ugrd10m 0 33 ** 10 m u wind [m/s]
    vgrdprs 2 34 ** v wind [m/s]
    vgrd10m 0 34 ** 10 m v wind [m/s]

tmax 32

1->Time values set: 2008:11:24:0 2008:11:24:0

vento Contouring: 3 to 27 interval 3

Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)
vento Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)

variabile wv 1000
define tempv=regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)
Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DEFINE error:  Invalid expression.
Syntax Error:  Invalid Operand
  'tempv' not a variable or function name
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = tempv
variabile wv850 850
define tempv=regrid2(wv850,0.10,0.10,bl_p1,6.0,36.0)
variabile wv700 700
define tempv=regrid2(wv700,0.10,0.10,bl_p1,6.0,36.0)
Most GrADS attributes have been reset

2->Time values set: 2008:11:24:6 2008:11:24:6

vento Contouring: 3 to 27 interval 3

Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)
vento Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DISPLAY error:  Invalid expression
  Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)

variabile wv 1000
define tempv=regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)
Error from regrid2: Invalid transfer file format
  File name: udf.regrid.gfo
Operation Error:  Error from regrid2 function
  Error ocurred at column 1
DEFINE error:  Invalid expression.
variabile wv850 850
define tempv=regrid2(wv850,0.10,0.10,bl_p1,6.0,36.0)
variabile wv700 700
define tempv=regrid2(wv700,0.10,0.10,bl_p1,6.0,36.0)
Most GrA
the output grid is UNIFORM lat/lon:
dx =  0.10 deg and dy =  0.10 deg
# points in i(lon) = 141  # points j(lat) = 121
lon extent =    6.00 to   20.00 lat extend =  36.00 to  48.00
regrid method is: bilinear interpolation


... and so on!

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

where my main code is in bash:

GSCRIPT5=$DIR'gfsprova.gs'

res='0.10'

LONMIN='6.0';LATMIN='36.0'
LONMAX='20.0';LATMAX='48.0'

MOD5='GFS'
if [ $RUN -eq 06 ]; then
 RUN5='00'
else
 RUN5=$RUN
fi
DT5='06'
TMIN5='1'
TMAX5='33'

CTL5=$MOD5'_'$DATA$RUN5'.ctl'
###############################

MOD5=${MOD5:0:3}

echo $MOD1 $MOD3

cd $WRKDIR5
eval grads  -cbl \"run $GSCRIPT5  $CTL5 $DT5 $RUN5 $res $TMIN5 $TMAX5
$LONMIN $LATMIN $LONMAX $LATMAX\"
--------------------------------------------------------------

and script.gs code is in grads:

function main(args)

 file_ctl= subwrd(args,1)
 _dt= subwrd(args,2)
 _run= subwrd(args,3)
 _dx=subwrd(args,4)
 _model= substr(file_ctl,1,3)
 _tstart= subwrd(args,5)
 _tend= subwrd(args,6)
 _lonmin=subwrd(args,7)
 _latmin=subwrd(args,8)
 _lonmax=subwrd(args,9)
 _latmax=subwrd(args,10)

 say _model" dt:"_dt" dx:"_dx
 'reinit'

'open 'file_ctl
say file_ctl
if (_model='GFS')
 'define u10=ugrd10m'
 'define v10=vgrd10m'
 'define u=ugrdprs'
 'define v=vgrdprs'
endif
'q dims'
say result
*****************************************************
'q file'
say result
line5=sublin(result,5)
tmax=_tend-1
 say _it'->'result

*******************************************************
* velocita vento
 'define wv=mag(u10,v10)'
 'd wv'
 say 'vento 'result
 'd regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)'
 say 'vento 'result
******************************************************
_it=_tstart-1;
while(_it<tmax);
*while(_it<3);
'reset'
  _it=_it+1;
 'set t '_it
 say _it'->'result

*******************************************************
* velocita vento
 'define wv=mag(u10,v10)'
 'd wv'
 say 'vento 'result
 'd regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)'
 say 'vento 'result

* velocita vento 850
 'set lev 850'
 'define wv850=mag(u,v)'

 reg('wv',1000)
 '!cat wv'_model'.dat >> marieventi'_model'.dat'
 reg('wv850',850)
 '!cat wv'_model'.dat >> marieventi'_model'.dat'

endwhile
'quit'
*******************************************************

*******************************************************
function reg(var,liv)
say 'variabile 'var' 'liv
'set gxout fwrite'
*fout=var'.'%_model'.dat'
fout='wv'_model'.dat'
* scelgo metodo interpolazione
_intmet=bl_p1
'set fwrite 'fout
'!touch 'fout
say 'define tempv=regrid2('var','_dx','_dx','_intmet','_lonmin','_latmin')'
'define tempv=regrid2('var','_dx','_dx','_intmet','_lonmin','_latmin')'
* imposto lat e lon
'set lat '_latmin' '_latmax
'set lon '_lonmin' '_lonmax
'd 'tempv
'disable fwrite'
return
--------------------------------------------------------------

could someone help me?
thanks in advance

Teresa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20081125/841510a2/attachment.html 


More information about the gradsusr mailing list