Aloha Eric, <br><br>Thank you for your input. The issue I seem to be having is with meridional wrap around also. Does GrADS have the same behavior for the y coordinate and will something similar (ie 'set y 1 YSIZE') work as well? Should I not use set lat and set lon, but use 'set y 1 YSIZE' and 'set x 1 XSIZE' instead when I do my fwrite?<br>
<br>This takes about four and a half days to run, so if I have to rerun it I want to make sure I have everything set correctly. <br><br>-Tom<br><br><div class="gmail_quote">On Wed, May 9, 2012 at 6:58 PM, Eric Altshuler <span dir="ltr"><<a href="mailto:ela@cola.iges.org" target="_blank">ela@cola.iges.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tom,<br>
<br>
There are several possible causes for the problem you're describing, but I suspect it is due to the wraparound behavior in grads when you have global data and your longitude range is 0-360 (or -180 to 180, etc.) In this situation, if the number of longitudes in your dataset is XSIZE, fwrite will write XSIZE+1 columns (longitudes) of data to the output file, with the last column being a duplicate of the first one (X=1). To get around this behavior, replace your 'set lon 0 360' command with the following:<br>
<br>
'set x 1 XSIZE'<br>
<br>
where XSIZE is the number of longitudes specified in the xdef line of your ctl file. Now, fwrite will write XSIZE columns of data instead of XSIZE+1.<br>
<br>
If this change doesn't fix your problem, there may be a bug in your fortran code. Also, if your fortran code writes the output file using sequential access, your ctl file for the output data needs to include 'options sequential'.<br>
<br>
Best regards,<br>
<br>
Eric L. Altshuler<br>
Assistant Research Scientist<br>
Center for Ocean-Land-Atmosphere Studies<br>
4041 Powder Mill Road, Suite 302<br>
Calverton, MD 20705-3106<br>
USA<br>
<br>
E-mail: <a href="mailto:ela@cola.iges.org">ela@cola.iges.org</a><br>
Phone: <a href="tel:%28301%29%20902-1257" value="+13019021257">(301) 902-1257</a><br>
Fax: <a href="tel:%28301%29%20595-9793" value="+13015959793">(301) 595-9793</a><br>
<div><div class="h5"><br>
----- Original Message -----<br>
From: "Thomas Robinson" <<a href="mailto:ter@hawaii.edu">ter@hawaii.edu</a>><br>
To: "GrADS Users Forum" <<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>><br>
Sent: Wednesday, May 9, 2012 11:35:59 PM<br>
Subject: [gradsusr] fwrite gridding issue<br>
<br>
<br>
Aloha,<br>
<br>
I used fwrite to write out to a binary file in order to create a large file with about 48000 time steps for global data (because I am crazy). I noticed that when I use fortran to create a new data file that has all 48000, it doesn't match with what the original data plotted, instead it seems skewed. No manipulations were done to the data, it was just read it all in and write it out. When I tried to loop the data, I further noticed that the northern border looped around the south and then moved upwards back to the north. It just keeps looping around and it's odd because the top boundary of the map isn't continuous with the bottom boundary (unlike the side boundaries which are continuous). Anyways, I am wondering why this happened and what I can do to make it work out correctly.<br>
<br>
Here is my fwrite code. it is the first time step, nt is the last time step, chi is the velocity potential that was calculated using 'define chi = fish_chi(UGRDprs,VGRDprs)' :<br>
*# set up global domain<br>
'set lev 200 '<br>
'set lat -90 90'<br>
'set lon 0 360'<br>
*#**************************************************************<br>
say 'write data out to binary file called CHI.200hPa'filenum'.dat'<br>
'set fwrite -le -sq -cl CHI_200hPa_'filenum'.dat'<br>
'set gxout fwrite'<br>
while (it <= nt)<br>
'set t 'it<br>
'display chi'<br>
it=it+1<br>
endwhile<br>
'disable fwrite'<br>
<br>
Mahalo for your help!<br>
-Tom<br>
<br>
--<br>
Tom Robinson<br>
President Graduate Student Organization<br>
Student Caucus Representative for the Graduate Student Organization<br>
Graduate Student - Department of Meteorology<br>
<a href="tel:732-718-2323" value="+17327182323">732-718-2323</a><br>
<br>
<br>
</div></div>_______________________________________________<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>
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>
</blockquote></div><br><br clear="all"><br>-- <br>Tom Robinson<br>President Graduate Student Organization <br>Student Caucus Representative for the Graduate Student Organization<br>Graduate Student - Department of Meteorology<br>
732-718-2323<br><br>