hello!<br><br>I woud like regrid a gfs file (es. gfs.t00z.pgrbf60.grib2) from 1 degree of spatial resolution to 0.1 degree.<br><br>but if I check the output I have a file were data are all time the same :(<br><br>I have this message:<br>
<br> GFS_2008112400.ctl<br>Default file number is: 1 <br>X is varying Lon = 0 to 360 X = 1 to 361<br>Y is varying Lat = -90 to 90 Y = 1 to 181<br>Z is fixed Lev = 850 Z = 1<br>T is fixed Time = 00Z24NOV2008 T = 1<br>
<br>File 1 : GFS_2008112400.grb<br> Descriptor: GFS_2008112400.ctl<br> Binary: GFS_2008112400.grb<br> Type = Gridded<br> Xsize = 360 Ysize = 181 Zsize = 2 Tsize = 31<br> Number of Variables = 10<br> apcpsfc 0 61 ** surface Total precipitation [kg/m^2]<br>
cpratsfc 0 214 ** surface Convective precip. rate [kg/m^2/s]<br> prmslmsl 0 2 ** Pressure reduced to MSL [Pa]<br> rhprs 0 52 ** Relative humidity [%]<br> tmpsfc 0 11 ** surface Temp. [K]<br> tmpprs 2 11 ** Temp. [K]<br>
ugrdprs 2 33 ** u wind [m/s]<br> ugrd10m 0 33 ** 10 m u wind [m/s]<br> vgrdprs 2 34 ** v wind [m/s]<br> vgrd10m 0 34 ** 10 m v wind [m/s]<br><br>tmax 32<br><br>1->Time values set: 2008:11:24:0 2008:11:24:0 <br>
<br>vento Contouring: 3 to 27 interval 3 <br><br>Error from regrid2: Invalid transfer file format<br> File name: udf.regrid.gfo<br>Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>DISPLAY error: Invalid expression <br>
Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br>vento Error from regrid2: Invalid transfer file format<br> File name: udf.regrid.gfo<br>Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>
DISPLAY error: Invalid expression <br> Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br><br>variabile wv 1000<br>define tempv=regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br>Error from regrid2: Invalid transfer file format<br>
File name: udf.regrid.gfo<br>Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>DEFINE error: Invalid expression. <br>Syntax Error: Invalid Operand <br> 'tempv' not a variable or function name<br>
Error ocurred at column 1<br>DISPLAY error: Invalid expression <br> Expression = tempv<br>variabile wv850 850<br>define tempv=regrid2(wv850,0.10,0.10,bl_p1,6.0,36.0)<br>variabile wv700 700<br>define tempv=regrid2(wv700,0.10,0.10,bl_p1,6.0,36.0)<br>
Most GrADS attributes have been reset<br><br>2->Time values set: 2008:11:24:6 2008:11:24:6 <br><br>vento Contouring: 3 to 27 interval 3 <br><br>Error from regrid2: Invalid transfer file format<br> File name: udf.regrid.gfo<br>
Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>DISPLAY error: Invalid expression <br> Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br>vento Error from regrid2: Invalid transfer file format<br>
File name: udf.regrid.gfo<br>Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>DISPLAY error: Invalid expression <br> Expression = regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br><br>variabile wv 1000<br>
define tempv=regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)<br>Error from regrid2: Invalid transfer file format<br> File name: udf.regrid.gfo<br>Operation Error: Error from regrid2 function<br> Error ocurred at column 1<br>DEFINE error: Invalid expression. <br>
variabile wv850 850<br>define tempv=regrid2(wv850,0.10,0.10,bl_p1,6.0,36.0)<br>variabile wv700 700<br>define tempv=regrid2(wv700,0.10,0.10,bl_p1,6.0,36.0)<br>Most GrA <br>the output grid is UNIFORM lat/lon:<br>dx = 0.10 deg and dy = 0.10 deg<br>
# points in i(lon) = 141 # points j(lat) = 121<br>lon extent = 6.00 to 20.00 lat extend = 36.00 to 48.00<br>regrid method is: bilinear interpolation <br><br><br>... and so on!<br><br>--------------------------------------------------------------<br>
--------------------------------------------------------------<br><br>where my main code is in bash:<br><br>GSCRIPT5=$DIR'<a href="http://gfsprova.gs">gfsprova.gs</a>'<br><br>res='0.10'<br><br>LONMIN='6.0';LATMIN='36.0'<br>
LONMAX='20.0';LATMAX='48.0'<br><br>MOD5='GFS'<br>if [ $RUN -eq 06 ]; then<br> RUN5='00'<br>else<br> RUN5=$RUN<br>fi <br>DT5='06'<br>TMIN5='1'<br>TMAX5='33'<br><br>CTL5=$MOD5'_'$DATA$RUN5'.ctl'<br>
###############################<br><br>MOD5=${MOD5:0:3}<br><br>echo $MOD1 $MOD3<br><br>cd $WRKDIR5<br>eval grads -cbl \"run $GSCRIPT5 $CTL5 $DT5 $RUN5 $res $TMIN5 $TMAX5 $LONMIN $LATMIN $LONMAX $LATMAX\"<br>--------------------------------------------------------------<br>
<br>and <a href="http://script.gs">script.gs</a> code is in grads:<br><br>function main(args)<br><br> file_ctl= subwrd(args,1)<br> _dt= subwrd(args,2)<br> _run= subwrd(args,3)<br> _dx=subwrd(args,4)<br> _model= substr(file_ctl,1,3)<br>
_tstart= subwrd(args,5)<br> _tend= subwrd(args,6)<br> _lonmin=subwrd(args,7)<br> _latmin=subwrd(args,8)<br> _lonmax=subwrd(args,9)<br> _latmax=subwrd(args,10)<br><br> say _model" dt:"_dt" dx:"_dx<br> 'reinit'<br>
<br>'open 'file_ctl<br>say file_ctl<br>if (_model='GFS')<br> 'define u10=ugrd10m'<br> 'define v10=vgrd10m'<br> 'define u=ugrdprs'<br> 'define v=vgrdprs'<br>endif<br>'q dims'<br>
say result<br>*****************************************************<br>'q file'<br>say result<br>line5=sublin(result,5)<br>tmax=_tend-1<br> say _it'->'result<br><br>*******************************************************<br>
* velocita vento<br> 'define wv=mag(u10,v10)'<br> 'd wv'<br> say 'vento 'result<br> 'd regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)'<br> say 'vento 'result<br>******************************************************<br>
_it=_tstart-1;<br>while(_it<tmax);<br>*while(_it<3);<br>'reset'<br> _it=_it+1;<br> 'set t '_it<br> say _it'->'result<br><br>*******************************************************<br>* velocita vento<br>
'define wv=mag(u10,v10)'<br> 'd wv'<br> say 'vento 'result<br> 'd regrid2(wv,0.10,0.10,bl_p1,6.0,36.0)'<br> say 'vento 'result<br><br>* velocita vento 850<br> 'set lev 850'<br>
'define wv850=mag(u,v)'<br><br> reg('wv',1000)<br> '!cat wv'_model'.dat >> marieventi'_model'.dat'<br> reg('wv850',850)<br> '!cat wv'_model'.dat >> marieventi'_model'.dat'<br>
<br>endwhile<br>'quit'<br>*******************************************************<br><br>*******************************************************<br>function reg(var,liv)<br>say 'variabile 'var' 'liv<br>
'set gxout fwrite'<br>*fout=var'.'%_model'.dat'<br>fout='wv'_model'.dat'<br>* scelgo metodo interpolazione<br>_intmet=bl_p1<br>'set fwrite 'fout<br>'!touch 'fout<br>
say 'define tempv=regrid2('var','_dx','_dx','_intmet','_lonmin','_latmin')'<br>'define tempv=regrid2('var','_dx','_dx','_intmet','_lonmin','_latmin')'<br>
* imposto lat e lon<br>'set lat '_latmin' '_latmax<br>'set lon '_lonmin' '_lonmax<br>'d 'tempv<br>'disable fwrite'<br>return<br>--------------------------------------------------------------<br>
<br>could someone help me?<br>thanks in advance<br><br>Teresa<br>