Dear Sravan and Roger,<br><br>Roger is correct. I assumed you were writing interpolated data from GrADS, after opening the .ctl file (which would take the projected dimensions) and then using Fortran - you are clearly not doing that. My misunderstanding.<br>
<br>matei<br><br><div class="gmail_quote">On Thu, Oct 28, 2010 at 8:32 AM, Roger Shi <span dir="ltr">&lt;<a href="mailto:shi@agnes.gsfc.nasa.gov">shi@agnes.gsfc.nasa.gov</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



  

<div bgcolor="#ffffff" text="#000000">
<tt><br>
Dear Sravan,<br>
<br>
Yes, the xy array size in your grads file should be 129 x 144 (not 331
x 306) based on your ctl file created by ARWpost. There are a few
coding errors in your fortran code. Your main problem is that you are
trying to use the fortran read statement for the &quot;sequential access&quot;
format to read a file with the &quot;direct access&quot; format. Try to modify
the code like the following<br>
<br>
<span lang="EN"><span lang="EN">
<p>irec=0</p>
<p></p><div class="im">do 5  it = 1,nt<br>
do 10 iz = 1,nz<br></div>
     irec=irec+1<br>
     read (12,rec=irec) dum<div class="im"><br>
do 15 ix = 1,nx<br>
do 16 iy = 1,ny<br>
   x(ix,iy,iz) = dum(ix,iy)<br>
16 continue<br>
15 continue<br>
<tt><span lang="EN"><span lang="EN">10 continue</span></span></tt><br>
</div>
<p>   : <br>
   :<br>
   :  <br>
</p>
<p>5  continue<br>
<span lang="EN"><span lang="EN"></span></span></p>
</span></span><br>
Good luck,<br>
Roger</tt><br>
<pre cols="100">================================================
Dr. Jainn Jong Shi (aka Roger)
Bldg 33 Rm C425
Code 613.1
NASA/Goddard Space Flight Center
Greenbelt, MD 20771
email: <a href="mailto:shi@agnes.gsfc.nasa.gov" target="_blank">shi@agnes.gsfc.nasa.gov</a>
</pre>
<br>
<br>
Matei Georgescu wrote:
<blockquote type="cite"><div><div></div><div class="h5">Dear Sravan,<br>
  <br>
It makes sense that the record length matches.  You are (via your
Fortran declaration) only writing arrays of size (129,144) (these are
smaller than the 331 X 306 sized arrays you should be writing, so
executing your Fortran code will not produce an error). That does not
mean you are reading/writing the &#39;correct&#39; output - this is why you are
not &#39;picking the right output&#39;. <br>
  <br>
Your Fortran declaration needs to have the number of x- and y-points
that correspond to your control file (i.e., 331 and 306 points,
respectively). When you open Grads and &#39;open .ctl&#39;, your pdef line
automatically tells Grads, &quot;I&#39;m using xdef = 331 and ydef = 306&quot; -
otherwise, what is the point of having pdef?<br>
  <br>
good luck,<br>
matei<br>
  <br>
  <div class="gmail_quote">On Thu, Oct 28, 2010 at 2:29 AM, Sravan <span dir="ltr">&lt;<a href="mailto:sravan_sase@yahoo.in" target="_blank">sravan_sase@yahoo.in</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div>
    <div style="font-family: times new roman,new york,times,serif; font-size: 8pt;">
    <div><font size="3">Dear Matei,</font></div>
    <div><font size="3">I want to inform you that the no. of points in
x and y directions are as per the pdef in the ctl file.</font></div>
    <div><font size="3">Even the record length and all are perfectly
matching. I have computed the no of levels also as per the control file.</font></div>
    <div><font size="3">One more thing is if I compute the same
parameters from the WRF2GrADS output it is picking up the values very
fine.</font></div>
    <div><font size="3">The problem is with the ARW post only. Even I
have fixed the lat and lon values fix and picked up the </font></div>
    <div><font size="3">24hr accumulated (rainc+rainnc) values. It is
giving some exponentional values for some time steps. </font></div>
    <div><font size="3">What can be done in </font><font size="3">this
regard.</font></div>
    <p> </p>
    <p><font size="3">Thanks</font></p>
    <p><font size="3">Sravan</font></p>
    <div><br>
 </div>
############################<br>
M.SRAVAN KUMAR<br>
SCIENTIST<br>
RDC SASE<br>
CHANDIGARH - 160036<br>
INDIA<br>
############################
    <div><br>
    </div>
    <div style="font-family: times new roman,new york,times,serif; font-size: 8pt;"><br>
    <div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2">
    <hr size="1"><b><span style="font-weight: bold;">From:</span></b>
Matei Georgescu &lt;<a href="mailto:Matei.Georgescu@asu.edu" target="_blank">Matei.Georgescu@asu.edu</a>&gt;<br>
    <b><span style="font-weight: bold;">To:</span></b> GrADS Users
Forum &lt;<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>&gt;<br>
    <b><span style="font-weight: bold;">Sent:</span></b> Wed, 27
October, 2010 8:25:18 PM<br>
    <b><span style="font-weight: bold;">Subject:</span></b> Re:
[gradsusr] ARW Post for Grads<br>
    </font><br>
Dear Sravan,<br>
    <br>
It appears that there is a mismatch between your .ctl file and fortran
declarations. <br>
    <br>
    <span lang="EN">You have this as a fortran declaration:
parameter(nx=129,ny=144,nz=171,ns=30,nt=41,nd=5)</span><br>
    <br>
but your .ctl file contains 331 x-points and 306 y-points (check your
z-levels as well). In using pdef, ARWPost is regridding to a new
resolution, which will be reflected in your .ctl file.<br>
    <br>
matei<br>
    <br>
    <b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>

    <b>Matei Georgescu, Ph.D.</b><br>
    <i style="color: rgb(255, 102, 0);">School of Mathematical and
Statistical Sciences and<br>
Center for Environmental Fluid Dynamics</i><br>
    <i><span style="color: rgb(255, 102, 0);">Arizona State University</span></i><br>
    <b>Phone</b>: (480) 965-3770<br>
    <b>Fax</b>: (480) 965-8119<br>
    <b>E-mail</b>: <a href="mailto:Matei.Georgescu@asu.edu" rel="nofollow" target="_blank">Matei.Georgescu@asu.edu</a><br>
    <b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>

    <br>
    <div class="gmail_quote">On Tue, Oct 26, 2010 at 10:08 PM, Sravan <span dir="ltr">&lt;<a href="mailto:sravan_sase@yahoo.in" rel="nofollow" target="_blank">sravan_sase@yahoo.in</a>&gt;</span>
wrote:<br>
    <blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">
      <div>
      <div style="font-family: times new roman,new york,times,serif; color: rgb(0, 0, 0); font-size: 12pt;">
      <div>Dear Users</div>
      <div>I am using ARW post to reate .ctl and .dat files for the
GrADS.</div>
      <div>Now I want to extract some perameters from the .dat file for
some particular locations.</div>
      <div>I have used a fortran script to extract the perameters. But
it is not picking the one which I want.</div>
      <div>I am giving the .ctl file for your reference.</div>
      <span lang="EN">
      <p><font color="#ff0000">dset ^dom3.dat</font></p>
      <p><font color="#0000ff">options byteswapped</font></p>
      <p><font color="#ff0000">undef 1.e30</font></p>
      <p><font color="#ff0000">title OUTPUT FROM WRF V3.2.1 MODEL</font></p>
      <p><font color="#ff0000">pdef 129 144 lcc 31.672 78.135 65.000
72.500 30.00000 10.00000 77.00000 9000.000 9000.000</font></p>
      <p><font color="#ff0000">xdef 331 linear 71.47070 0.04054054</font></p>
      <p><font color="#ff0000">ydef 306 linear 25.33539 0.04054054</font></p>
      <p><font color="#ff0000">zdef 19 levels </font></p>
      <p><font color="#ff0000" size="1">1000.00000</font></p>
      <p><font color="#ff0000" size="1">950.00000</font></p>
      <p><font color="#ff0000" size="1">900.00000</font></p>
      <p><font color="#ff0000" size="1">850.00000</font></p>
      <p><font color="#ff0000" size="1">800.00000</font></p>
      <p><font color="#ff0000" size="1">750.00000</font></p>
      <p><font color="#ff0000" size="1">700.00000</font></p>
      <p><font color="#ff0000" size="1">650.00000</font></p>
      <p><font color="#ff0000" size="1">600.00000</font></p>
      <p><font color="#ff0000" size="1">550.00000</font></p>
      <p><font color="#ff0000" size="1">500.00000</font></p>
      <p><font color="#ff0000" size="1">450.00000</font></p>
      <p><font color="#ff0000" size="1">400.00000</font></p>
      <p><font color="#ff0000" size="1">350.00000</font></p>
      <p><font color="#ff0000" size="1">300.00000</font></p>
      <p><font color="#ff0000" size="1">250.00000</font></p>
      <p><font color="#ff0000" size="1">200.00000</font></p>
      <p><font color="#ff0000" size="1">150.00000</font></p>
      <p><font color="#ff0000" size="1">100.00000</font></p>
      <p><font color="#ff0000">tdef 41 linear 00Z26OCT2010 180MN </font></p>
      <p><font color="#ff0000">VARS 27</font></p>
      <p><font color="#ff0000" size="1">LU_INDEX 1 0 LAND USE CATEGORY
(-)</font></p>
      <p><font color="#ff0000" size="1">U 19 0 x-wind component (m s-1)</font></p>
      <p><font color="#ff0000" size="1">V 19 0 y-wind component (m s-1)</font></p>
      <p><font color="#ff0000" size="1">W 19 0 z-wind component (m s-1)</font></p>
      <p><font color="#ff0000" size="1">PH 19 0 perturbation
geopotential (m2 s-2)</font></p>
      <p><font color="#ff0000" size="1">PHB 19 0 base-state
geopotential (m2 s-2)</font></p>
      <p><font color="#ff0000" size="1">T 19 0 perturbation potential
temperature (theta-t0) (K)</font></p>
      <p><font color="#ff0000" size="1">MU 1 0 perturbation dry air
mass in column (Pa)</font></p>
      <p><font color="#ff0000" size="1">MUB 1 0 base state dry air mass
in column (Pa)</font></p>
      <p><font color="#ff0000" size="1">P 19 0 perturbation pressure
(Pa)</font></p>
      <p><font color="#ff0000" size="1">PB 19 0 BASE STATE PRESSURE (Pa)</font></p>
      <p><font color="#ff0000" size="1">T2 1 0 TEMP at 2 M (K)</font></p>
      <p><font color="#ff0000" size="1">TH2 1 0 POT TEMP at 2 M (K)</font></p>
      <p><font color="#ff0000" size="1">PSFC 1 0 SFC PRESSURE (Pa)</font></p>
      <p><font color="#ff0000" size="1">U10 1 0 U at 10 M (m s-1)</font></p>
      <p><font color="#ff0000" size="1">V10 1 0 V at 10 M (m s-1)</font></p>
      <p><font color="#ff0000" size="1">LANDMASK 1 0 LAND MASK (1 FOR
LAND, 0 FOR WATER) (-)</font></p>
      <p><font color="#ff0000" size="1">VEGFRA 1 0 VEGETATION FRACTION
(-)</font></p>
      <p><font color="#ff0000" size="1">SST 1 0 SEA SURFACE TEMPERATURE
(K)</font></p>
      <p><font color="#ff0000" size="1">HGT 1 0 Terrain Height (m)</font></p>
      <p><font color="#ff0000" size="1">TSK 1 0 SURFACE SKIN
TEMPERATURE (K)</font></p>
      <p><font color="#ff0000" size="1">RAINC 1 0 ACCUMULATED TOTAL
CUMULUS PRECIPITATION (mm)</font></p>
      <p><font color="#ff0000" size="1">RAINNC 1 0 ACCUMULATED TOTAL
GRID SCALE PRECIPITATION (mm)</font></p>
      <p><font color="#ff0000" size="1">XLAT 1 0 LATITUDE, SOUTH IS
NEGATIVE (degree_north)</font></p>
      <p><font color="#ff0000" size="1">XLONG 1 0 LONGITUDE, WEST IS
NEGATIVE (degree_east)</font></p>
      <p><font color="#ff0000" size="1">TMN 1 0 SOIL TEMPERATURE AT
LOWER BOUNDARY (K)</font></p>
      <p><font color="#ff0000" size="1">PBLH 1 0 PBL HEIGHT (m)</font></p>
      <p><font color="#ff0000" size="1">ENDVARS</font></p>
      </span>And the fortran code which I have used to extract the
variables is given below.</div>
      <span lang="EN">
      <p>parameter(nx=129,ny=144,nz=171,ns=30,nt=41,nd=5)</p>
      <p>dimension x(nx,ny,nz),dum(nx,ny)</p>
      </span><span lang="EN">
      <p>open(12,file=&#39;./dom3.dat&#39;,form=&#39;unformatted&#39;,access=&#39;direct&#39;,recl=nx*ny*4)</p>
      <span lang="EN">
      <p>do 5 it = 1,nt</p>
      <p>do 10 iz = 1,nz</p>
      <p>read (12) dum</p>
      <p>do 15 ix = 1,nx</p>
      <p>do 16 iy = 1,ny</p>
      <p>x(ix,iy,iz) = dum(ix,iy)</p>
      <p>16 continue</p>
      <p>15 continue</p>
      <p>10 continue</p>
      <span lang="EN">
      <p>do 99 k=1,10</p>
      <p>p1(k,it) = x(ix,iy,166)+x(ix,iy,167)</p>
      </span></span></span>write (*,*) p1(k,it)</div>
      <div>99 continue</div>
      <div>stop</div>
      <div>end</div>
      <div> </div>
      <div>I am using a 64 bit Linux Machine with pgf77 compiler.</div>
      <div>Can any one clarify what <font color="#0000ff">options
byteswapped means?</font></div>
      <div>Kindly Help Me</div>
      <div> </div>
      <div>Regards</div>
      <div>Sravan<br>
 </div>
############################<br>
M.SRAVAN KUMAR<br>
SCIENTIST<br>
RDC SASE<br>
CHANDIGARH - 160036<br>
INDIA<br>
############################ <br>
      <br>
_______________________________________________<br>
gradsusr mailing list<br>
      <a href="mailto:gradsusr@gradsusr.org" rel="nofollow" target="_blank">gradsusr@gradsusr.org</a><br>
      <a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="nofollow" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
    </blockquote>
    </div>
    </div>
    </div>
    </div>
    <br>
    </div>
    <br>
_______________________________________________<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/listinfo/gradsusr</a><br>
    <br>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
  <b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>

  <b>Matei Georgescu, Ph.D.</b><br>
  <i style="color: rgb(255, 102, 0);">School of Mathematical and
Statistical Sciences and<br>
Center for Environmental Fluid Dynamics</i><br>
  <i><span style="color: rgb(255, 102, 0);">Arizona State University</span></i><br>
  <b>Phone</b>: (480) 965-3770<br>
  <b>Fax</b>: (480) 965-8119<br>
  <b>E-mail</b>: <a href="mailto:Matei.Georgescu@asu.edu" target="_blank">Matei.Georgescu@asu.edu</a><br>
  <b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>

  </div></div><pre><hr width="90%" size="4"><div class="im">
_______________________________________________
gradsusr mailing list
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a>
  </div></pre>
</blockquote>
</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" target="_blank">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>
<b>Matei Georgescu, Ph.D.</b><br><i style="color: rgb(255, 102, 0);">School of Mathematical and Statistical Sciences and<br>Center for Environmental Fluid Dynamics</i><br><i><span style="color: rgb(255, 102, 0);">Arizona State University</span></i><br>
<b>Phone</b>: 
                (480) 965-3770<br><b>Fax</b>: (480) 965-8119<br><b>E-mail</b>: <a href="mailto:Matei.Georgescu@asu.edu" target="_blank">Matei.Georgescu@asu.edu</a><br><b><font style="color: rgb(255, 102, 0);" color="#888888">==============================</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font><font style="color: rgb(255, 102, 0);" color="#888888">====</font></b><br>