On Mon, Nov 28, 2011 at 1:38 PM, Muyin Wang <span dir="ltr"><<a href="mailto:Muyin.Wang@noaa.gov">Muyin.Wang@noaa.gov</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Dear Grads Users:<br>
I have a 40 year daily file from model outputs. Now I need to extract<br>
variables for limited domain from the file, and connect them into a<br>
single 40 year NetCDF file.<br>
Does any one know the trick to do this? T<br>
Thank you very much!<br></blockquote><div><br></div><div>You can use lats4d and have this accomplished with a single command line. The syntax is something like this:</div><div><br></div><div>% lats4d.sh -i yourfile.ctl -o singlefile -lat 30 40 -lon -120 -60 -v</div>
<div><br></div><div>or from inside grads</div><div><br></div><div>ga-> lats4d -i yourfile.ctl -o singlefile -lat 30 40 -lon -120 -60 -v</div><div><br></div><div><br></div><div>This will create a file called "<a href="http://singlefile.nc">singlefile.nc</a>". There are also other options to select variables, levels, etc. For a full list of options:</div>
<div><br></div><div>% lats4d.sh -h</div><div><br></div><div>Now, you can use lats4d with v1.9b4 (there is an older version version of <a href="http://lats4d.gs">lats4d.gs</a> in the <a href="http://grads.iges.org/grads/gadoc/gadocindex.html">script library</a> that you can call from inside grads 1.9), but I'd strongly recommend that you grab the latest opengrads bundle which includes lats4d.sh:</div>
<div><br></div><div> <a href="http://opengrads.org/wiki/index.php?title=Installing_the_OpenGrADS_Bundle">http://opengrads.org/wiki/index.php?title=Installing_the_OpenGrADS_Bundle</a></div><div><br></div><div> Arlindo</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Muyin<br>
<br>
<br>
Here is what it looks like in the .ctl file :<br>
<br>
DSET ^Data/2001/1dy.grd<br>
TITLE 20C3M+A1B<br>
OPTIONS big_endian template yrev<br>
UNDEF -999<br>
XDEF 128 LINEAR 0 2.8125<br>
YDEF 64 LEVELS<br>
-87.864 -85.097 -82.313 -79.526 -76.737 -73.948 -71.158 -68.368 -65.578<br>
-62.787 -59.997 -57.207 -54.416 -51.626 -48.835 -46.045 -43.254 -40.464<br>
-37.673 -34.883 -32.092 -29.301 -26.511 -23.720 -20.930 -18.139 -15.348<br>
-12.558 -9.7671 -6.9765 -4.1859 -1.3953 1.3953 4.1859 6.9765 9.7671 12.558<br>
15.348 18.139 20.930 23.720 26.511 29.301 32.092 34.883 37.673 40.464 43.254<br>
46.045 48.835 51.626 54.416 57.207 59.997 62.787 65.578 68.368 71.158 73.948<br>
76.737 79.526 82.313 85.097 87.864<br>
ZDEF 1 LINEAR 1 1<br>
TDEF 14976 LINEAR 12:00Z01JAN2000 1dy<br>
VARS 8<br>
T2 0 99 2m temperature [K]<br>
q2 0 99 2m specific humidity [kg/kg]<br>
slp 0 99 sea level pressure [hPa]<br>
u10 0 99 10m zonal wind [m/s]<br>
v10 0 99 10m meridional wind [m/s]<br>
ssrd 0 99 surf.short.down [W/m**2]<br>
<br>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>