<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-GB link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Mubashar,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Is the file you wrote the correct size? (e.g. use ‘ls –l’
on unix)<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>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.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I’m guessing all this because I have made similar mistakes
in the past!<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Doug<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> gradsusr-bounces@gradsusr.org
[mailto:gradsusr-bounces@gradsusr.org] <b>On Behalf Of </b>Mubashar Dogar<br>
<b>Sent:</b> 31 August 2010 16:19<br>
<b>To:</b> gradsusr@gradsusr.org<br>
<b>Subject:</b> [gradsusr] Problem with fwrite and CTL file<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<div>
<p class=MsoNormal>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>
<b>Here is the script to create a binary/dat file</b><br clear=all>
'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>
<b>Here is the control file to open the above January.dat file</b><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<o:p></o:p></p>
</div>
</div>
</div>
<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.</body>
</html>