[gradsusr] Files for polar stereographic plotting

sim.aberson sim.aberson at noaa.gov
Fri Jan 3 12:58:29 EST 2014


On 1/3/14, 3:35 AM, Davide Sacchetti wrote:
> On Thu, 2014-01-02 at 15:02 -0500, sim.aberson wrote:
>> On 1/2/14, 8:05 AM, Davide Sacchetti wrote:
>>> if you are not using PDEF then grads expects your data are on a regular
>>> grid, that is, in your ex., 360x360 points.
>>> If xdef is 360 grads expects that at latitude -90 you still have 360
>>> longitude points.
>>> The shift could arise from fortran: grads expects no extra bytes used
>>> for record control, fortran uses these extra bytes, unless you specify
>>> form='unformatted', recordtype='fiexed', recordsize=... in your open
>>> statement.
>>> Check file dimensions against xdef*ydef*nlevs*ntime*nvars*4: the size
>>> should match perfectly this number, otherwise use 'options sequential'
>>> in your ctl
>>> it could solve
>>
>> xdef*ydef*nlevs*ntime*nvars*4 is 2 bytes off from what I have.  When I
>> added sequential to the options, it did not solve the problem.
>
> for what I remember, using form='unformatted' fortran adds 2 or 4 bytes
> for each record. Option sequential should solve: it works if your
> fortran writing is like this:
>
> do jlat=1,nlat
>   write(nunit) (record(ilon),ilon=1,nlon)
> enddo
> (then NLAT records)
>
> aren't you using something like:
>
> write(nunit) ((record(ilon,jlat),ilon=1,nlon),jlat=1,nlat)
> (then just ONE record?)

Thanks.  Got it, and it seems to work now.

Sim

>
> bye bye
> Davide
>
>>
>> In addition, I removed the polar point
>>
>>    YDEF    299   LINEAR   -89.9909909 0.009009
>>
>> and got the same result.
>>
>> Fortran no longer supports recordtype='fixed.'  I have it writing
>> sequential files.
>
>>
>> Thanks,
>> Sim
>>
>>>
>>> bye bye
>>> Davide
>>>
>>> On Tue, 2013-12-31 at 14:45 -0500, sim.aberson wrote:
>>>> I have written fortran code to output fields on a south polar
>>>> stereographic grid.  When I plot, the values seem to drift from their
>>>> correct location as I get further into my file, so I am doing something
>>>> wrong.  My control file has:
>>>>
>>>>     XDEF    360   LINEAR  -180.000     1.000000
>>>>     YDEF    300   LINEAR   -90.000     0.009009
>>>>
>>>> When I write the file, do I write the 360 points at -90 latitude (even
>>>> though they are all the same value), or is GrADS just expecting one
>>>> value there, followed by the 360 points for the next latitude.  I am
>>>> doing the former, but if GrADS is expecting the latter, that could
>>>> account for the drift.
>>>>
>>>> I could not find this information in the online documentation.
>>>>
>>>> Thanks
>>>
>>
>>
>


-- 
Sim Aberson         AOML/Hurricane Research Division          Miami, FL
     "Hurricane states erect statues in my honor." -- David Sedaris


More information about the gradsusr mailing list