[MITgcm-support] Preparing the input to the model
aslavin at mun.ca
aslavin at mun.ca
Thu Feb 10 11:24:26 EST 2011
Hello,
You can use MATLAB writebin.m script (you can find it in MITgcm). Or made it:
function writebin(fnam,fld,typ,prec)
% Function writebin(fnam,fld,typ,prec)
% write N-D binary field
%
% INPUTS
% fnam input path and file name
% fld input array
% typ 0: sequential FORTRAN (default); 1: plain binary
% prec numeric precision (default 'real*4')
%
% SEE ALSO
% readbin
if nargin < 4, prec='real*4'; end
if nargin < 3, typ=0; end
if nargin < 2, error('please specify array and output file name'); end
fid=fopen(fnam,'w','ieee-be');
switch typ
case 0
write_record(fid,fld,prec);
case 1
fwrite(fid,fld,prec);
end
fid=fclose(fid);
After that just made your own script like this example:
T = zeros(100, 100, 100); - your X,Y,Z
for k = 1:100
for i = 1:100
for j = 1:100
T(i,j,k)=20;
end
end
end
writebin('Temp.bin', T, 1, 'real*4');
Good luck,
Alexander Slavin.
Memorial University Of Newfoundland.
Quoting himansu pradhan <oceancalling at gmail.com>:
> Hello
>
> I am a new to MITGCM model and have run the test cases. Please guide me
> regarding preparing the input to the model. I mean any scripts for preparing
> the bathymetry, wind, temperature, salinity, etc to the model.
>
> Himansu kesari Pradhan
> PhD student,
> Indian Institute of Technology-Delhi
> New Delhi,India
> email: oceancalling at gmail.com
>
More information about the MITgcm-support
mailing list