<div dir="ltr"><div><div>Justin,<br></div>Build up a string variable and write the string to your data file. You'll have to pull each value after issuing the display command, then add each piece to the full string variable.<br><br></div>Jeff Duda<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 29, 2016 at 1:48 PM, Justin Hicks <span dir="ltr"><<a href="mailto:jhicks2014@gmail.com" target="_blank">jhicks2014@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">GrADS users,<div><br></div><div>I want to output data to a text file; I have a variety of masks that I am using to get data from specific regions. I am running an area average of monthly data from 1980-2016 using the 'maskout' function. </div><div><br></div><div>I want my data to output into 5 columns: 'Region' 'Month/Year(Date)' 'Precip(Data)' 'Max Value' 'Min Value'. I want these all to be in the same row with their results underneath. So far, I only have part of a script:</div><div><br></div><div><div>'reinit'</div><div>'open Region00_WLD_mask_TEST.nc'</div><div>'set t 13 last'</div><div>'set dfile 1'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'open /data2/control/MERRA2_PRECIP</div><div>'set dfile 2'</div><div>'set lon -179.5 179.5'</div><div>'set lat -89.5 89.5'</div><div>'set time 00Z01JAN1980 00Z01APR2016'</div><div>'set dfile 1'</div><div>'d aave(maskout(VAR.2,mask.1(time=00Z01JAN1980)),lon=-179.5,lon=179.5,lat=-89.5,lat=89.5)'</div><div>'set gxout print'</div><div>'set prnopts %6.2f 1 1'</div><div>write('MERRA2_MASK_DATA.txt', 'WLD Mon/Yr Precip Max Min')</div></div><div><br></div><div><br></div><div>I assume that there is no way to display the region unless you put it in lat/lon coordinates, but how could I go about outputting the date, the precipitation data, and the max/min data for each month? Also, this text file will be added to with other masked variables, and I know I must use the command 'apprend' somewhere.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Justin</div></font></span></div>
<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" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research associate<br>University of Oklahoma School of Meteorology<br></div></div></div>
</div>