Dear Muhammad,<div><br></div><div>The problem with the nc file is now solved thank you. I will contact the RegCNET to understand better the process that produces the nc files so that I can understand the problem with that file.</div>

<div>The processing that I was doing was from the ESRL web site, to obtain a select region and time frame. But that I can do with GrADS so it is not a problem.</div><div><br></div><div>Regarding the fprintf. I need to </div>

<div>sdfopen <a href="http://input.nc">input.nc</a></div><div>set lon x</div><div>set lon y</div><div>set lev z   #so one value for each, one point in the map</div><div>set t 1 150 #so basically I am setting a time line</div>

<div>d prmsl # this gives me a graph of pressure v time</div><div>#Then from fprintf I need to get the values for both pressure and time</div><div>I use &#39;frpintf prmsl data.txt&#39; to get the pressure values</div><div>

But then I need to get the corresponding time values, even in a separate text document, it doesn&#39;t matter, as long as I can get it.</div><div><br></div><div>DO you think it&#39;s possible?</div><div><br></div><div>James</div>

<div><br><div class="gmail_quote">On 15 December 2010 16:16, Muhammad Rahiz <span dir="ltr">&lt;<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk">muhammad.rahiz@ouce.ox.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im"><br>
<br>
-- <br>
Muhammad Rahiz<br>
Researcher &amp; DPhil Candidate (Climate Systems &amp; Policy)<br>
School of Geography &amp; the Environment<br>
University of Oxford<br>
<br>
On Wed, 15 Dec 2010, James Ciarlo` wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear Muhammad,<div class="im"><br>
A) I have sent you the nc file for file3.jpg, but I cannot send you the nc file for file1.jpg<br>
and file2.jpg as it is 35 GB large. Perhaps we can figure it out through this one?<br>
</div></blockquote>
<br>
The attached ESRL_SLP.nc file has undergone some processing. You can look at the history of commands on the file by<br>
<br>
 $ ncdump -h ESRL_SLP.nc<br>
<br>
I went the source of the data at <a href="http://www.esrl.noaa.gov/psd/data/gridded/data.20thC_ReanV2.monolevel.mm.html" target="_blank">www.esrl.noaa.gov/psd/data/gridded/data.20thC_ReanV2.monolevel.mm.html</a> and downloaded the file <a href="http://prmsl.mon.mean.nc" target="_blank">prmsl.mon.mean.nc</a> (it is the same file you have judging from the file history). I then made a test plot in GrADs (see prmsl.png). Plots fine.<br>


<br>
As I said, some processing was done on the file you have. I don&#39;t know exactly what language (I suspect NCL) and what it&#39;s trying to do. Perhaps you can tell what is it that you&#39;re trying to do with the file, I could possibly help.<div class="im">

<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
B) I have set up the script <a href="http://fprintf.gs" target="_blank">fprintf.gs</a> and have managed to get it operational. It works well<br>
and I thank you for it. I haven&#39;t been able to produce the text for time and elevation though.<br>
I tried the same procedure as you mentioned for lon.txt and lat.txt for time, but it didn&#39;t<br>
work? does it require another script or maybe a different way to define time?<br>
</blockquote>
<br></div>
I&#39;m not sure what you mean by wanting to get the ascii grid for time. Each ascii that you generate corresponds to a particular time. Hence if you want to get ascii grids for all time steps, just do something like<br>


<br>
&#39;sdfopen <a href="http://input.nc" target="_blank">input.nc</a>&#39;<br>
&#39;set t 1&#39;<br>
&#39;d prmsl&#39;<br>
&#39;fprintf prmsl prmsl.t1.txt&#39;<br>
<br>
&#39;set t 2&#39;<br>
&#39;d prmsl&#39;<br>
&#39;fprintf prmsl prmsl.t2.txt&#39;<br>
<br>
Of course, you can do this in a loop for all time steps.<br>
<br>
I&#39;m not sure if elevation (topography) is a variable of climate data (I&#39;ve not come across any). Do you mean pressure levels like 500mb, 100mb etc? If yes, then you can do;<br>
<br>
&#39;set lev 500&#39;<br>
&#39;set t 1&#39;<br>
&#39;d prmsl&#39;<br>
&#39;fprintf prmsl prmsl.time1.lev500.txt&#39;<br>
<br>
This gives you the data for 500mb pressure level at time, t=1.<div><div></div><div class="h5"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
<br>
James<br>
<br>
On 15 December 2010 10:46, Muhammad Rahiz &lt;<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk" target="_blank">muhammad.rahiz@ouce.ox.ac.uk</a>&gt; wrote:<br>
      Hi James,<br>
<br>
      I suspect a corrupted data file. Could you attach the original datafile, if it&#39;s<br>
      not too big? And attach the commands that you use to plot as well.<br>
<br>
      --<br>
      Muhammad Rahiz<br>
      Researcher &amp; DPhil Candidate (Climate Systems &amp; Policy)<br>
      School of Geography &amp; the Environment<br>
      University of Oxford<br>
<br>
On Wed, 15 Dec 2010, James Ciarlo` wrote:<br>
<br>
Dear Muhammad,<br>
I am sorry it took me so long to answer. Thank you for your<br>
answer on point 2. <br>
<br>
Regarding point 1, opening .nc files. I have attached some<br>
files. <br>
The images from file1.jpg and file2.jpg are grads images<br>
(printim) from nc files produced with RegCM4, one is gxout<br>
contour and the other is gxout shaded.<br>
The image from file3.jpg is a grads image (printim) gxout shaded<br>
for an nc file from the ESRL database. <br>
The last image was produced with the PANOPLY data viewer from<br>
the same file that produced file3.jpg<br>
<br>
As you can see the data is not being plotted with grads as with<br>
normal .ctl files (which are working properly).<br>
I cannot seem to understand why it is not reading it properly.<br>
Maybe there are some definitions that I have to set? How should<br>
I check if all the settings are correct?<br>
<br>
Regarding point 3, I think I can do them as a normal<br>
mathematical expression, but I&#39;ll be trying that later on. <br>
<br>
Regards,<br>
<br>
James<br>
<br>
On 11 December 2010 12:24, James Ciarlo`<br>
&lt;<a href="mailto:james.ciarlo@physics.org" target="_blank">james.ciarlo@physics.org</a>&gt; wrote:<br>
     Dear Muhammad,<br>
I just had a look at it this morning. Unfortunately I<br>
haven&#39;t yet had the time to put it to use. Thank you very<br>
much for your help. I will get back to you about it for<br>
sure. Thanks again<br>
<br>
Regards,<br>
<br>
James<br>
<br>
<br>
On 11 December 2010 09:59, Muhammad Rahiz<br>
&lt;<a href="mailto:muhammad.rahiz@ouce.ox.ac.uk" target="_blank">muhammad.rahiz@ouce.ox.ac.uk</a>&gt; wrote:<br>
     Hi James,<br>
     I was wondering if you got my reply to the<br>
     query you posted because I&#39;m not sure if it<br>
     gets delivered successfully.<br>
<br>
     Anyway, if you did not, these are what I<br>
     suggested<br>
<br>
     1. display error<br>
     - Try set gxout to something other than the<br>
     default e.g. set gxout grfill<br>
     - set clevs<br>
     - check units<br>
<br>
     2. print to ascii<br>
     what you need is the <a href="http://fprintf.gs" target="_blank">fprintf.gs</a> script<br>
     available athttp://<a href="http://cookbooks.opengrads.org/index.php?title=Recipe-002:_Savi" target="_blank">cookbooks.opengrads.org/index.php?title=Recipe-002:_Savi</a><br>
<br>
     ng_GrADS_variable_data_to_a_text_file<br>
<br>
     Copy the code and name the file as <a href="http://fprintf.gs" target="_blank">fprintf.gs</a>.<br>
     Then do the following,<br>
<br>
     sdfopen <a href="http://input.nc" target="_blank">input.nc</a><br>
     d var                   # where var = variable<br>
     fprintf var dat.txt      # prints data of var<br>
     fprintf lon lon.txt     # prints corresponding<br>
     lon<br>
     fprintf lat lat.txt     # prints corresponding<br>
     lat<br>
<br>
     3. statistical analysis<br>
     I know how to do so in R. If you&#39;re interested<br>
     in using R for this purpose, I can help.<br>
<br>
     HTH,<br>
<br>
     --<br>
     Muhammad Rahiz<br>
     Researcher &amp; DPhil Candidate (Climate Systems<br>
     &amp; Policy)<br>
     School of Geography &amp; the Environment<br>
     University of Oxford<br>
<br>
     On Fri, 10 Dec 2010, James Ciarlo` wrote:<br>
<br>
     Dear all,<br>
     I am using GrADS 2.0.a9 on LINUX. I am<br>
     trying to compare measured and modelled<br>
     data by using GrADS. However since I am<br>
     new with the program, there are<br>
     some issues that I cannot seem to figure<br>
     out, or find a solution to understand.<br>
     I am experiencing:<br>
<br>
     1) Difficulty with displaying data from<br>
     NetCDF files<br>
     I have opened the file with the command<br>
     &#39;sdfopen&#39;<br>
     When I tried &#39;d prmsl&#39; I got the<br>
     following error:<br>
     Operation error:  Invalid dimension<br>
     environment<br>
       Min longitude &gt; max longitude: 320 144<br>
     So I used &#39; set lon -40 145&#39; and tried<br>
     the display command again<br>
     I got the following line and the image<br>
     attached (ncimage.jpg):<br>
     Contouring: 99000 to 102300 interval 300<br>
     And I am getting similar results with<br>
     other nc files<br>
<br>
     2) Difficulty with finding a command to<br>
     output text files, or dat, or anything<br>
     similar.<br>
     I have used set lat, set lon, and set<br>
     lev to obtain one value, and set t to<br>
     get a long time interval, I have used d<br>
     psa to display the time series, I<br>
     can use printim file.jpg to get an<br>
     image, but I cannot find a command to<br>
     produce a file.txt so that I can make<br>
     use of the actual numbers for<br>
     statistical purposes.<br>
<br>
     3) Difficulty with finding a command to<br>
     work out comparative statistics,<br>
     particularly correlation and<br>
     significance.<br>
<br>
     Regards,<br>
<br>
     James Ciarlo`<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br></div>