[MITgcm-support] bathymetry-read help

Martin Losch Martin.Losch at awi.de
Wed May 28 05:29:39 EDT 2008


Hi Maxiaohui,

all input/output files (that are not netCDF) are ieee-big_endian  
files, there are plenty of examples in the verification directory  
(all of the idealized topography examples) to do it in matlab, look  
for files "gendata.m":
nx=90;
ny=40;
h=ones(nx,ny); % here you need to put "your" topography
fid=fopen('yourbathymetry.bin','w','b'); % open a big-endian file for  
writing
fwrite(fid,h,prec); % prec='real*4' if you use readBinaryPrec=32 and  
'real*8' if readBinaryPrec=64 (to be set in data, namelist PARM01)
fclose(fid); % close the file

That's it. In Fortran you'd need to open a file with  
form='unformatted', access='direct', and then you have to be careful  
about the record length, depends on the default word length the  
compiler uses etc, see pkg/mdsio how it's done within model.

Martin

On 28 May 2008, at 10:33, Maxiaohui wrote:

> hi,
> sorry to trouble you! I want to know how to read the bathymetry.bin  
> file in the tutorial_global_oce_latlon\input, since it is a binary  
> file ,I cannot see it,how to transform it into a decimal file, if I  
> want to make a similar topography file, how should I write the  
> topography file? thank you very  much!
>
>
> 雅虎邮箱,您的终生邮箱!
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support





More information about the MITgcm-support mailing list