[MITgcm-support] Error in reading the input files

David Hebert david.hebert at nrlssc.navy.mil
Mon Mar 1 17:17:41 EST 2010


Akur,

I believe most (if not all) MITgcm build scripts default to big endian. 
Thus, usually when MITgcm is compiled on a little-endian machine some 
form of byteswapio flag is used (i.e., pgf90 -byteswapio ... for 
Portland group compilers). When you build MITgcm is this flag in your 
build script? If so than it will not read your little endian file 
correctly. Also, it will write a big endian file regardless of what the 
input file endian type.

Also, along those lines, your external Fortran code to test your binary 
file will not read big endian correctly unless you have a byteswapio 
compiler flag.  Are you using byteswapio flag for your external Fortran 
code? If not give that a try with big endian binary file and see if it 
works.

David



On 03/01/10 16:03, ankur gupta wrote:
> Hello,
>
> I am trying to use Large&Yeager bulk formulation EXF package for 
> computing heat and momentum fluxes at the surface of a 1X1 resolution 
> ocean model. I have written my input files using matlab in single 
> precision and little-endian.
>
> To check if the written data is in correct format, I used a simple 
> fortran code to read the input files before providing it to MITgcm. 
> Using unformatted, direct access, recl=N*4 (N is number of data 
> points=nx_in*ny_in) I was able to read the input files correctly. 
> Please note if I use big-endian to write my files the fortran code 
> doesn't read it properly. I am using a linux machine and initially 
> thought that big-endian should have worked.
>
> However when I run MITgcm and write the data (read by subroutine 
> exf_interp_read) to a separate file I again get incorrectly formatted 
> data. The exf_iprec is set to 32 in data.exf.
>
> Can anyone see where is the error, let me know if I should specify 
> more of the configuration parameters I am using to help you trace the 
> error.
>
> Regards,
> Ankur
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>    

-- 
David A. Hebert
Naval Research Lab
Stennis Space Center, MS 39529
david.hebert at nrlssc.navy.mil
Phone: (228) 688-5846
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20100301/636d2940/attachment.htm>


More information about the MITgcm-support mailing list