[MITgcm-support] How to open and read '.bin' file?

michael schaferkotter schaferk at bellsouth.net
Wed Jul 23 12:26:07 EDT 2014


in fortran90 code 

real, dimension(nx,ny) :: data

topoFile = "topoFile.bin"
iunit         = 99

WORDLENGTH    = 4 
nnn                          = size(data)
length_of_rec        = nnn*WORDLENGTH
irec                           = 1 

open(unit=iunit,file=topoFile, status="old", access="direct", recl=length_of_rec ,action="read")
read(unit=iunit,rec=irec) data


i use this routine as a method in a generic subroutine to handle various array sizes and data types.

the assumption here is the data is real*4.

michael

On Jul 22, 2014, at 9:41 AM, Xiaohui Yan wrote:

> Hi,
> 
> I'm a new learner of MITgcm, I'm studying example 3.12 <Global Ocean Simulation at 4 Resolution> now, but how can I open and have a look at the ".bin" file (such the "bathymetry.bin" file)?
> 
> Thank you!
> 
> Yan
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20140723/441f1c2d/attachment.htm>


More information about the MITgcm-support mailing list