<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Arlindo - thanks for the info!<div>Steve</div><div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>Dr. Stephen C. Piper</div><div>Carbon Dioxide Research Group</div><div>Scripps Institution of Oceanography</div><div>La Jolla, CA 92093-0244</div><div>tel: 858-534-4230 ext 15</div><div>fax: 858-534-8814</div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br><div><div>On Sep 26, 2008, at 5:22 PM, Arlindo da Silva wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">On Fri, Sep 26, 2008 at 5:43 PM, Steve Piper <span dir="ltr">&lt;<a href="mailto:scpiper@ucsd.edu">scpiper@ucsd.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Hi,<br> <br> I just started using Grads. &nbsp;Great program!<br> <br> I would like to write out in ascii, the annual average vertical<br> profile at<br> all 9 levels at a specified location (lat and lon) in<br> the grid for variable bioa.<br> </blockquote><div><br>Let's say your specific location is (45N,90W), then<br><br><b>ga-></b> set lon -90<br><b>ga-></b> set lat 45<br><br>Next let's select all vertical levels<br><br><b>ga-></b> set z 1 9<br> <br>To get ASCII output for the annual mean of variable bio:<br><br><b>ga-></b> set gxout print<br><b>ga-></b> d ave(bioa,t=1,t=12)<br><br>To have this saved to a file see this recipe:<br><br>&nbsp;&nbsp; <a href="http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file">http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Saving_GrADS_variable_data_to_a_text_file</a><br> <br>&nbsp;Good Luck,<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Arlindo<br><br><br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> I am reading a gridded data file that was written with Fortran<br> statement declaration<br> <br> &nbsp; &nbsp;real x(72,44,9,12,26) &nbsp; &nbsp; ! lon, lat, levels, months, variables<br> <br> My ctl file is:<br> <br> &nbsp; &nbsp; DSET &nbsp; &nbsp; &nbsp;/Users/piper/Grads-test/CSU.gurney.L1.mmean.le.3D<br> &nbsp; * &nbsp; &nbsp;fortran sequential file &nbsp;c(72,44,9,12,26)<br> &nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lon lat lev month tracer<br> &nbsp; * &nbsp; &nbsp; sequential means fortran binary with record length integers<br> in record<br> &nbsp; * &nbsp; &nbsp; otherwise would use stream or direct access<br> &nbsp; * &nbsp; &nbsp; SUN is big-endian (had to swap to make it so with zz.f)<br> &nbsp;* &nbsp; OPTIONS big_endian for SUN, mac powerpc?<br> &nbsp; &nbsp; OPTIONS sequential<br> &nbsp;* &nbsp;input file is from little_endian machine<br> &nbsp; &nbsp; OPTIONS little_endian<br> &nbsp; &nbsp; TITLE &nbsp; &nbsp; CSU Gurney 3D monthly output for T3L1<br> &nbsp; &nbsp; UNDEF &nbsp; &nbsp;1.e36<br> &nbsp; &nbsp; XDEF &nbsp; &nbsp; 72 linear &nbsp; -180 5<br> &nbsp; &nbsp; YDEF &nbsp; &nbsp; 44 linear -86 4<br> &nbsp; &nbsp; ZDEF &nbsp; &nbsp; &nbsp; 9 levels 1000 925 850 700 500 400 300 200 100<br> &nbsp; &nbsp;* would like to use middle of every 365 calendar month - this is<br> close<br> &nbsp; &nbsp; TDEF &nbsp; &nbsp; &nbsp; 12 linear 16jan94 1mo<br> &nbsp; &nbsp; VARS &nbsp; &nbsp; &nbsp;26<br> &nbsp; &nbsp; &nbsp; &nbsp; fos90 &nbsp;9 &nbsp;-1,20 &nbsp;fos90<br> &nbsp;* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-1 = non-standard binary, 20 = var and time reordered<br> &nbsp; &nbsp; &nbsp; &nbsp; fos95 &nbsp;9 &nbsp;-1,20 &nbsp;fos95<br> &nbsp; &nbsp; &nbsp; &nbsp; bioa &nbsp; 9 &nbsp;-1,20 &nbsp;bioa<br> &nbsp; &nbsp; &nbsp; &nbsp; dum &nbsp; &nbsp;9 -1,20 &nbsp; dum<br> &nbsp; &nbsp; &nbsp; &nbsp; bio1 &nbsp; 9 &nbsp;-1,20 &nbsp;bio1<br> &nbsp; &nbsp; &nbsp; &nbsp; bio2 &nbsp; 9 &nbsp;-1,20 &nbsp;bio2<br> &nbsp; &nbsp; &nbsp; &nbsp; bio3 &nbsp; 9 &nbsp;-1,20 &nbsp;bio3<br> &nbsp; &nbsp; &nbsp; &nbsp; bio4 &nbsp; 9 -1,20 &nbsp; bio4<br> &nbsp; &nbsp; &nbsp; &nbsp; bio5 &nbsp; 9 -1,20 &nbsp; bio5<br> &nbsp; &nbsp; &nbsp; &nbsp; bio6 &nbsp; 9 -1,20 &nbsp; bio6<br> &nbsp; &nbsp; &nbsp; &nbsp; bio7 &nbsp; 9 -1,20 &nbsp; bio7<br> &nbsp; &nbsp; &nbsp; &nbsp; bio8 &nbsp; 9 -1,20 &nbsp; bio8<br> &nbsp; &nbsp; &nbsp; &nbsp; bio9 &nbsp; 9 -1,20 &nbsp; bio9<br> &nbsp; &nbsp; &nbsp; &nbsp; bio10 &nbsp; 9 -1,20 &nbsp;bio10<br> &nbsp; &nbsp; &nbsp; &nbsp; bio11 &nbsp; 9 -1,20 &nbsp;bio11<br> &nbsp; &nbsp; &nbsp; &nbsp; oce1 &nbsp; 9 -1,20 &nbsp; oce1<br> &nbsp; &nbsp; &nbsp; &nbsp; oce2 &nbsp; 9 -1,20 &nbsp; oce2<br> &nbsp; &nbsp; &nbsp; &nbsp; oce3 &nbsp; 9 -1,20 &nbsp; oce3<br> &nbsp; &nbsp; &nbsp; &nbsp; oce4 &nbsp; 9 -1,20 &nbsp; oce4<br> &nbsp; &nbsp; &nbsp; &nbsp; oce5 &nbsp; 9 -1,20 &nbsp; oce5<br> &nbsp; &nbsp; &nbsp; &nbsp; oce6 &nbsp; 9 -1,20 &nbsp; oce6<br> &nbsp; &nbsp; &nbsp; &nbsp; oce7 &nbsp; 9 -1,20 &nbsp; oce7<br> &nbsp; &nbsp; &nbsp; &nbsp; oce8 &nbsp; 9 -1,20 &nbsp; oce8<br> &nbsp; &nbsp; &nbsp; &nbsp; oce9 &nbsp; 9 -1,20 &nbsp; oce9<br> &nbsp; &nbsp; &nbsp; &nbsp; oce10 &nbsp; 9 -1,20 &nbsp;oce10<br> &nbsp; &nbsp; &nbsp; &nbsp; oce11 &nbsp; 9 -1,20 &nbsp;oce11<br> &nbsp; &nbsp; ENDVARS<br> <br> <br> set lon -180 180 &nbsp; &nbsp;# default is 0 360 when I issue q dim<br> set lat -86 86 &nbsp; &nbsp;# this was the default<br> set lev 1000 100 &nbsp; # default was 1000<br> set t 1 12 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# default was t 1<br> <br> q dim<br> <br> Default file number is: 1<br> X is varying &nbsp; Lon = -180 to 180 &nbsp; X = 1 to 73<br> Y is varying &nbsp; Lat = -86 to 86 &nbsp; Y = 1 to 44<br> Z is varying &nbsp; Lev = 1000 to 100 &nbsp; Z = 1 to 9<br> T is varying &nbsp; Time = 00Z16JAN1994 to 00Z16DEC1994 &nbsp;T = 1 to 12<br> E is fixed &nbsp; &nbsp; Ens = 1 &nbsp;E = 1<br> <br> Not sure how to produce annual average array newbioa(72,44,9) from<br> bioa(72,44,9,12)<br> <br> Tried this:<br> <br> define newbioa = &nbsp;ave(bioa,t=1,t=12)<br> <br> It gives 108 lines (=9 x 12) of output stating<br> Averaging. &nbsp;dim = 3, start = 1, end =12<br> <br> ga-> q dim<br> Default file number is: 1<br> X is varying &nbsp; Lon = -180 to 180 &nbsp; X = 1 to 73<br> Y is varying &nbsp; Lat = -86 to 86 &nbsp; Y = 1 to 44<br> Z is varying &nbsp; Lev = 1000 to 100 &nbsp; Z = 1 to 9<br> T is varying &nbsp; Time = 00Z16JAN1994 to 00Z16DEC1994 &nbsp;T = 1 to 12<br> E is fixed &nbsp; &nbsp; Ens = 1 &nbsp;E = 1<br> <br> d gr2stn(newbioa,60.75,89.38)<br> Operation error: Invalid dimension environment<br> Too many varying dimensions<br> <br> set t 1<br> <br> ga-> q dim<br> Default file number is: 1<br> X is varying &nbsp; Lon = -180 to 180 &nbsp; X = 1 to 73<br> Y is varying &nbsp; Lat = -86 to 86 &nbsp; Y = 1 to 44<br> Z is varying &nbsp; Lev = 1000 to 100 &nbsp; Z = 1 to 9<br> T is fixed &nbsp; &nbsp; Time = 00Z16JAN1994 &nbsp;T = 1<br> E is fixed &nbsp; &nbsp; Ens = 1 &nbsp;E = 1<br> <br> d gr2stn(newbioa,60.75,89.38)<br> Operation error: Invalid dimension environment<br> Looping dimension does not vary<br> <br> Not sure why the gr2stn statements do not work. &nbsp;Help?<br> Am I on the right track?<br> <br> Thanks!<br><font color="#888888"> <br> Steve<br> </font></blockquote></div><br><br clear="all"><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br> </div></blockquote></div><br></div></body></html>