<div dir="ltr">Dear Doug,<br><br>Thanks a lot. Your idea works.<br><br>Regards,<br><br>Mubashar<br><br>Message: 3<br>
Date: Tue, 31 Aug 2010 16:34:41 +0100<br>
From: "Clark, Douglas B" <<a href="mailto:dbcl@ceh.ac.uk">dbcl@ceh.ac.uk</a>><br>
Subject: Re: [gradsusr] Problem with fwrite and CTL file<br>
To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
Message-ID:<br>
<<a href="mailto:40829B0E077C1145A6DE44D39B3830A91B31A6EFC1@nerckwmb1.ad.nerc.ac.uk">40829B0E077C1145A6DE44D39B3830A91B31A6EFC1@nerckwmb1.ad.nerc.ac.uk</a>><br>
Content-Type: text/plain; charset="us-ascii"<br>
<br>Mubashar,<br>
<br>
Is the file you wrote the correct size? (e.g. use 'ls -l' on unix)<br>
I think you might find that it is slightly larger than expected because,
I think, GrADS might repeat data around 0degE because of the way it
sets the dimensions for a default global plot.<br>
Use 'q dims' to see what the x grid cords are before the fwrite step.
You might get something like "0 to 144" rather than the "1 to 144" you
might expect. Then either explicitly add 'set x 1 144' in your script,
or rewrite your final ctl file to have (say) 145 x points.<br>
<br>
I'm guessing all this because I have made similar mistakes in the past!<br>
<br>
Doug<br>
<br>
<br>
From: <a href="mailto:gradsusr-bounces@gradsusr.org">gradsusr-bounces@gradsusr.org</a>
[mailto:<a href="mailto:gradsusr-bounces@gradsusr.org">gradsusr-bounces@gradsusr.org</a>]
On Behalf Of Mubashar Dogar<br>
Sent: 31 August 2010 16:19<br>
To: <a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
Subject: [gradsusr] Problem with fwrite and CTL file<br>
<br>
Dear GrADS Users,<br>
<br>
I have downloaded ECMWF (ERA40) data for surface temperature at 2.5 by
2.5 resolution for years 1958-2001. My intention was to see the trend
for the month of January only. So I extracted all the Januaries between
1958-2001 in a binary/dat file by using the following commands in GrADS.
When I tried to open this file by making a CTL (choosing the same x
& y dimentions) and display January of any one year, the spatial
picture is not the same as if I display the same January in original
data file. Could you please help me?<br>
<br>
Here is the script to create a binary/dat file<br>
'reinit'<br>
'open EraT2M.ctl'<br>
'set gxout fwrite'<br>
'set fwrite January.dat'<br>
t=5<br>
*tmax=6<br>
tmax=532<br>
while(t<=tmax)<br>
'set t 't<br>
'd no2tsfc-273.15'<br>
t=t+12<br>
endwhile<br>
'disable fwrite'<br>
'reinit'<br>
<br>
Here is the control file to open the above January.dat file<br>
DSET january.dat<br>
TITLE Sample Data Set<br>
UNDEF -9.999E33<br>
*OPTIONS big_endian<br>
OPTIONS little_endian<br>
*OPTIONS template<br>
xdef 144 linear 0 2.5<br>
ydef 73 linear -90 2.5<br>
ZDEF 1 LINEAR 1 1<br>
TDEF 44 LINEAR 1JAN1958 1mon<br>
VARS 1<br>
no2tsfc 0 99 Surface Temperature_2m<br>
ENDVARS<br>
<br>
<br>
Regards,<br>
<br>
Mubashar<br>
--<br>
This message (and any attachments) is for the recipient only NERC<br>
is subject to the Freedom of Information Act 2000 and the contents<br>
of this email and any reply you make may be disclosed by NERC unless<br>
it is exempt from release under the Act. Any material supplied to<br>
NERC may be stored in an electronic records management system.<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://gradsusr.org/pipermail/gradsusr/attachments/20100831/9a2723c0/attachment-0001.html" target="_blank">http://gradsusr.org/pipermail/gradsusr/attachments/20100831/9a2723c0/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 31 Aug 2010 12:03:19 -0400<br>
From: Stephen McMillan <<a href="mailto:smcmillan@planalytics.com">smcmillan@planalytics.com</a>><br>
Subject: Re: [gradsusr] Problem with fwrite and CTL file<br>
To: GrADS Users Forum <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTik9O0TcX0gb88GjZidL8k6MNQ7q3WRsUAVS%2B%2BAt@mail.gmail.com">AANLkTik9O0TcX0gb88GjZidL8k6MNQ7q3WRsUAVS++At@mail.gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1<br>
<br>
Mubashar,<br>
Adding to Doug's comments, I noticed you initialized t at 5. Does<br>
that correspond to your initial January timestep?<br>
Stephen Mc<br>
<br>
On Tue, Aug 31, 2010 at 11:18 AM, Mubashar Dogar<br>
<<a href="mailto:mubashardogar@gmail.com">mubashardogar@gmail.com</a>>
wrote:<br>
> Dear GrADS Users,<br>
><br>
> I have downloaded ECMWF (ERA40) data for surface temperature at 2.5
by 2.5<br>
> resolution for years 1958-2001. My intention was to see the trend
for the<br>
> month of January only. So I extracted all the Januaries between
1958-2001 in<br>
> a binary/dat file by using the following commands in GrADS. When I
tried to<br>
> open this file by making a CTL (choosing the same x & y
dimentions) and<br>
> display January of any one year, the spatial picture is not the
same as if I<br>
> display the same January in original data file. Could you please
help me?<br>
><br>
> Here is the script to create a binary/dat file<br>
> 'reinit'<br>
> 'open EraT2M.ctl'<br>
> 'set gxout fwrite'<br>
> 'set fwrite January.dat'<br>
> t=5<br>
> *tmax=6<br>
> tmax=532<br>
> while(t<=tmax)<br>
> 'set t 't<br>
> 'd no2tsfc-273.15'<br>
> t=t+12<br>
> endwhile<br>
> 'disable fwrite'<br>
> 'reinit'<br>
><br>
> Here is the control file to open the above January.dat file<br>
> DSET??? january.dat<br>
> TITLE???? Sample Data Set<br>
> UNDEF??? -9.999E33<br>
> *OPTIONS??? big_endian<br>
> OPTIONS?? little_endian<br>
> *OPTIONS?? template<br>
> xdef 144 linear 0 2.5<br>
> ydef 73 linear -90 2.5<br>
> ZDEF????? 1 LINEAR 1 1<br>
> TDEF???? 44 LINEAR 1JAN1958 1mon<br>
> VARS????? 1<br>
> no2tsfc 0? 99? Surface Temperature_2m<br>
> ENDVARS<br>
><br>
><br>
> Regards,<br>
><br>
> Mubashar
</div>