Dear Chuck,<div><br></div><div>I couldn't run the <a href="http://prec_accum.gs">prec_accum.gs</a> in GrADS, i got this message:</div><div><div><br></div><div>"Open Error: Can't open binary data file</div><div>
File name = ifamean.grt</div><div>SET Error: No files open yet</div><div>SET Error: No files open yet</div><div>SET Error: No files open yet</div><div>SET Error: No files open yet</div><div>DEFINE error: no file open yet</div>
<div>DISPLAY error: no file open yet</div><div>Hardcopy output file is closed </div><div>Number of frames = 1"</div><div><br></div><div>I'm not sure what to do, I tried unziping the prec_accum.ps.gz but it didn't work either. I don't really know much about it but is .ctl supposed to be ifamean.ctlt or ifamean.ctl? it maybe the reason it didn't work,</div>
<div><br></div><div>thanks for your help,</div><div>Gabriel Gavinho</div><div><br></div><div class="gmail_quote">2011/6/22 Charles Seman <span dir="ltr"><<a href="mailto:Charles.Seman@noaa.gov">Charles.Seman@noaa.gov</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Gabriel,<br>
<br>
Please find attached a GrADS script <a href="http://prec_accum.gs" target="_blank">prec_accum.gs</a> in which a technique of Vaughan Phillips has been adapted for plotting the observed TOGA accumulated precipitation (mm) from the precipitation rate (mm/h) defined at 3-hourly intervals for the time period 00Z20DEC1992 to 21Z25DEC1992. The GrADS ctl file ifamean.ctlt and resulting plot file prec_accum.ps.gz are also attached.<br>
<br>
I hope this helps, and please let me know if you have any questions.<br>
<br>
Thanks,<br>
Chuck<br>
<br>
gabriel gavinho wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Dear Serge,<br>
<br>
The solution you proposed did solve the problem envolving the plot of both variables, but it displays a straight line with the final result for accumulated precipitation instead of the increasing line presenting the gradual accumulation. Do you know how can I sort this out?<br>
still, thank you very much for your help,<br>
<br>
regards<br>
<br>
Gabriel Gavinho<br>
Federal University of Rio de Janeiro<br>
<br></div>
2011/6/21 Rafanoharana Serge Claudio <<a href="mailto:rafanoharana@gmail.com" target="_blank">rafanoharana@gmail.com</a> <mailto:<a href="mailto:rafanoharana@gmail.com" target="_blank">rafanoharana@gmail.com</a><u></u>>><div class="im">
<br>
<br>
Dear Gabriel,<br>
<br>
In order to obtain the total precipitation within a month, you can<br>
just 'define acc=sum(pcp, t=1, t=31)'.<br>
If I really understand what you want is that you would like to<br>
display both daily and accumulation within one graphic. If so, it's<br>
a little bit tricky but what I can suggest is that if you want to<br>
display both within one graphic, try to set gxout linefill since<br>
linefill can deal with 2 variables, then go back to set gxout line<br>
so it will be something like:<br>
<br></div>
'sdfopen <a href="http://file.nc" target="_blank">file.nc</a> <<a href="http://file.nc" target="_blank">http://file.nc</a>>'<div class="im"><br>
'set lat -23'<br>
'set lon -45'<br>
'set t 1 31'<br>
<br>
'define acc=sum(pcp, t=1, t=31)'<br>
'set gxout linefill'<br>
'set lfcols 0 0' (----> this is black color and you can refer to<br>
<a href="http://www.iges.org/grads/gadoc/colorcontrol.html" target="_blank">http://www.iges.org/grads/<u></u>gadoc/colorcontrol.html</a>)<br>
'd pcp;acc' (up til here, you have only the x and y value,<br>
without the graphs, so you need to plot the graph)<br>
'set gxout line'<br>
'set ccolor 3'<br>
'd pcp'<br>
'set ccolor 5'<br>
'd acc'<br>
<br>
Hope this can help,<br>
<br>
<br>
Regards,<br>
<br>
Serge<br>
<br>
2011/6/21 gabriel gavinho <<a href="mailto:gavinho.gabriel@gmail.com" target="_blank">gavinho.gabriel@gmail.com</a><br></div>
<mailto:<a href="mailto:gavinho.gabriel@gmail.com" target="_blank">gavinho.gabriel@gmail.<u></u>com</a>>><div class="im"><br>
<br>
Dear Serge,<br>
<br>
I belive I did not make myself clear about the graphic I need.<br>
suppose I select a single point, let's say lat -23 lon -45, and<br>
set the time to a month period, I will have the values of<br>
precipitation for each day as it is in any meteogram.<br>
My problem is that I need to continually sum the daily valeus so<br>
I can achive the total precipitation within a month but in a way<br>
I can present an increasing line in over the daily values.<br>
I hope I could make it clear and I really appreciate your help<br>
<br>
Regars,<br>
Gabriel Gavinho<br>
Federal University of Rio de Janeiro.<br>
<br>
<br>
2011/6/21 Rafanoharana Serge Claudio <<a href="mailto:rafanoharana@gmail.com" target="_blank">rafanoharana@gmail.com</a><br></div>
<mailto:<a href="mailto:rafanoharana@gmail.com" target="_blank">rafanoharana@gmail.com</a><u></u>>><div class="im"><br>
<br>
Dear Gabriel,<br>
<br>
What do you mean by "in the same graphic"? because I think<br>
it will depends on that. For your precipitation data, if you<br>
set your gxout to shaded, I think you won't see both values,<br>
but if you set your gxout, for example to contour, you'll be<br>
able to see both.<br>
<br>
Let's say your precipitaion variable is "pcp". It will be<br>
something like:<br></div>
'sdfopen <a href="http://file.nc" target="_blank">file.nc</a> <<a href="http://file.nc" target="_blank">http://file.nc</a>>'<div class="im"><br>
'set gxout contour'<br>
'define acc=sum(pcp, t=1, t=31)'<br>
'd pcp'<br>
'd acc'<br>
<br>
So if you need for the day 17, just set t to 17 by adding<br>
'set t 17' right after 'sdfopen...'<br>
In addition, you can write your accumulation variable to<br></div>
your file using 'set sdfwrite <a href="http://file.nc" target="_blank">file.nc</a> <<a href="http://file.nc" target="_blank">http://file.nc</a>>'<div class="im"><br>
followed by 'sdfwrite acc'.<br>
Maybe the following will give you more info.<br>
<br>
I quote from Bob Kuligowski:<br>
<br>
"GrADS can produce numerous types of file displays using<br>
gridded data using set gxout:<br>
<br>
bar (bar chart) line (line graph)<br>
barb (wind barbs) linefill (color fill between two lines)<br>
contour (contour plot) scatter (scatter plot)<br>
errbar (error bars) shaded (shaded contour plot)<br>
grfill (shaded grid boxes) stream (wind streamlines)<br>
fgrid (grid boxes shaded for specified values) vector (wind vector arrows)<br>
grid (grid boxes with printed values)"<br>
<br>
Hope it can help,<br>
<br>
Regards,<br>
<br>
Serge<br>
<br>
<br>
<br>
2011/6/21 gabriel gavinho <<a href="mailto:gavinho.gabriel@gmail.com" target="_blank">gavinho.gabriel@gmail.com</a><br></div>
<mailto:<a href="mailto:gavinho.gabriel@gmail.com" target="_blank">gavinho.gabriel@gmail.<u></u>com</a>>><div class="im"><br>
<br>
Dear Users<br>
<br>
I am having a hard time trying to sum the values for<br>
daily precipitation during a month, in order put<br>
together both daily values and the accumulative sum in<br>
the same graphic <br>
Can you help me?<br>
<br>
regards!<br>
<br>
Gabriel Gavinho<br>
Federal University of Rio de Janeiro<br>
<br>
______________________________<u></u>_________________<br>
gradsusr mailing list<br></div>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><div class="im"><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<u></u>listinfo/gradsusr</a><br>
<br>
<br>
<br>
<br>
-- Serge<br>
<br>
______________________________<u></u>_________________<br>
gradsusr mailing list<br></div>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a> <mailto:<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>><div class="im"><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<u></u>listinfo/gradsusr</a><br>
<br>
<br>
<br>
<br>
<br>
-- Serge<br>
<br>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>------------<br>
<br>
______________________________<u></u>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/<u></u>listinfo/gradsusr</a><br>
</div></blockquote>
<br>
-- <br>
<br>
Please note that <a href="mailto:Charles.Seman@noaa.gov" target="_blank">Charles.Seman@noaa.gov</a> should be considered my NOAA<br>
email address, not <a href="mailto:cjs@gfdl.noaa.gov" target="_blank">cjs@gfdl.noaa.gov</a>.<br>
<br>
******************************<u></u>******************************<u></u>********<br>
Charles Seman <a href="mailto:Charles.Seman@noaa.gov" target="_blank">Charles.Seman@noaa.gov</a><br>
U.S. Department of Commerce / NOAA / OAR<br>
Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547<br>
201 Forrestal Road fax: (609) 987-5063<br>
Princeton, NJ 08540-6649 <a href="http://www.gfdl.noaa.gov/~cjs/" target="_blank">http://www.gfdl.noaa.gov/~cjs/</a><br>
******************************<u></u>******************************<u></u>********<br>
<br>
"The contents of this message are mine personally and do not reflect any<br>
official or unofficial position of the United States Federal Government,<br>
the United States Department of Commerce, or NOAA."<br>
<br>*<br>
* credit for technique: Vaughan Phillips<br>
*<br>
'reinit'<br>
'open ifamean.ctlt'<br>
'set x 1'<br>
'set y 1'<br>
'set z 1'<br>
'set t 393 440'<br>
*<br>
* note: prec in units of (mm/h), dt = 3 hours, paccum in units of (mm)<br>
*<br>
dt=3<br>
'paccum = 'dt'*tloop(sum(prec,t=393,t+0))'<br>
'enable print prec_accum.gx'<br>
'set vrange 0. 200.'<br>
'd paccum'<br>
'draw title TOGA Accumulated Precipitation'<br>
'draw ylab (mm)'<br>
'print'<br>
'disable print'<br>
'!gxps -c -d -i prec_accum.gx -o <a href="http://prec_accum.ps" target="_blank">prec_accum.ps</a>'<br>
'!gzip -f <a href="http://prec_accum.ps" target="_blank">prec_accum.ps</a>'<br>
'!rm prec_accum.gx'<br>
<br>DSET ^ifamean.grt<br>
UNDEF -9.99e22<br>
TITLE gcss 2 observed IFA Mean data<br>
OPTIONS big_endian<br>
*<br>
XDEF 1 LINEAR 1 1<br>
*<br>
YDEF 1 LINEAR 1 1<br>
*<br>
ZDEF 1 LINEAR 1 1<br>
*<br>
TDEF 960 LINEAR 01Nov1992 3hr<br>
*<br>
VARS 11<br>
ws 0 99 960 Wind Speed (m/s)<br>
sst 0 99 960 Sea Surface Temperature (C)<br>
airt 0 99 960 Surface Air Temperature (C)<br>
qa 0 99 960 Mixing Ratio (g/kg)<br>
prec 0 99 960 Precipitation Rate (mm/h)<br>
shf 0 99 960 Sensible Heat Flux (w/m^2)<br>
lhf 0 99 960 Latent Heat Flux (w/m^2)<br>
swr_d 0 99 960 Downward Solar Radiative Flux (w/m^2)<br>
swr_u 0 99 960 Upward Solar Radiative Flux (w/m^2)<br>
lwr_d 0 99 960 Downward Infrared Radiative Flux (w/m^2)<br>
lwr_u 0 99 960 Upward Solar Radiative Flux (w/m^2)<br>
ENDVARS<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>
<br></blockquote></div><br></div>