[gradsusr] plotting problem

Charles Seman Charles.Seman at noaa.gov
Fri Dec 3 15:16:03 EST 2010


Frankq,

Don't know if you've found a solution yet? One idea is to try 
ftp://grads.iges.org/grads/examples/xyplot.gs which does a plot of "y" 
vs. "x"

Chuck

frankq wrote:
> Greetings All,
>
> I would be very grateful if anyone could assist with the following 
> problem. It essentially boils down to plotting a list of (user 
> generated) values on a line graph. The background to the problem is as 
> follows:
>
> * We use WRF to generate forecasts (6 days ahead) of temp, wind speed, 
> rel. hum ...
> * We calculate a heat load index (as well an "integrated" heat load - if 
> you could call it that) on an hourly basis. The expressions include 
> sqrt's, logs, exp's, consequently situations like sqrt(Temp) where Temp 
> < 0 have to be handled.
>
> The approach we have taken is as follows:
>
> * Extract a time series of all required variables
> * Import some initialisations/coefficients from a file
> * Perform all calculations
> * Write results to an ascii output file
> * Plot results on a graph.
>
> It all works except for the plotting bit. Below is the skeleton of the 
> GrADS script:
>
> /***********************************/
>
> 'open easthl.ctl'
> 'set t 1 144'
> 'set z 1 1'
> etc... etc... etc...
>
> 'set gxout print'
>
> 'display ' rh
> if(rc != 0); return -1; endif
> relhum_timeseries = result <<<<<<<  THIS IS WHERE I GET HOURLY VALUES
>
> REPEAT ABOVE BLOCK FOR u, v, tc, swdown.
>
> * init counters etc
>
> file = "h_output.txt"
> tcount = 1
> i = 10
>
> * loop to calculate hourly values
>
> while(tcount < 144)
>
> relhum = subwrd(relhum_timeseries, i) <<<<<< get hourly rh value
> repeat above code for u, v, tc, swdown.
> hlx = calc_htload(relhum, temp, u_comp, v_comp, solarrad)  <<<<< 
> calculate ht load for this hour
> line = temp % " " % relhum % " " % solarrad " " etc etc
> write(file, line)
>
> endwhile
>
> close(file)
>
> /*****************************************/
>
> The above script works. The output file contains all the correct results.
>
> BUT
>
> When it comes to plotting it, I can't find a "clean" way to do it. 
> Ideally I would like something like
>
> ///////
>
> while(tcount < 144)
> ......
> ......
> hlx.tcount = calc_htload(relhum, temp, u_comp, v_comp, solarrad)  <<<<< 
> CALCULATE HEAT LOAD INDEX FOR THIS HOUR
> ......
> endwhile
>
> 'display ' hlx
>
> ///////
>
> where "hli" is an array of sorts.
>
> I've tried lots of approaches, but it is now degenerating into a 
> Monte-Carlo exercise - ie let's try this and see if it works.
>
> Any help would be greatly appreciated - even if it means "no - it can't 
> be done"
>
> Cheers
> FrankQ
>
>
>
>   

-- 

Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.

********************************************************************
 Charles Seman                                Charles.Seman at noaa.gov
 U.S. Department of Commerce / NOAA / OAR
 Geophysical Fluid Dynamics Laboratory         voice: (609) 452-6547
 201 Forrestal Road                              fax: (609) 987-5063
 Princeton, NJ  08540-6649            http://www.gfdl.noaa.gov/~cjs/
********************************************************************

"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."




More information about the gradsusr mailing list