/[MITgcm]/MITgcm_contrib/mlosch/interp_llc/gen_masks.m
ViewVC logotype

Contents of /MITgcm_contrib/mlosch/interp_llc/gen_masks.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Thu May 3 21:07:21 2007 UTC (18 years, 2 months ago) by mlosch
Branch: MAIN
CVS Tags: HEAD
initial checkin of topography and hydrography interpolation scripts for
the llc-grid, based on old matlab scripts by Alistair Adcroft
Let's hope, they are useful.

1 % This is a script that executes the commands for
2 % creating a "PMASK" file (notation of MITgcm Classic)
3 % which is a 3D field containing 1 for ocean and 0 for
4 % land. This mask is *NOT* necessarily the mask used
5 % in the model but is representative of the largest
6 % possible mask that the model might use (cf. hFacMin).
7 % We need it here in order to guarantee that there
8 % is valid data in the climatological input data files.
9 %
10 % Uses data files: bathymetry.bin HGRID.mat VGRID.mat
11 % Creates data files: pmask.bin
12 % Creates arrays: n/a
13 % Uses m-scripts: hfac
14 %
15 % Created 11/11/99 by adcroft@mit.edu
16 % Modified by
17 % Maintained by adcroft@mit.edu, abiastoch@ucsd.edu
18
19 clear all
20 format compact
21 more off
22
23 load FMT.mat
24 load HGRID.mat nxc nyc
25 load VGRID.mat dz
26
27 load HN
28 %Hn=rdda('bathymetry.bin',size(hn),1,fmt,Ieee);
29 %if max(abs(hn(:)-Hn(:)))
30 % error('HN.mat and bathymetry.bin don''t match');
31 %end
32
33 % Generate mask and store in pmask.bin
34 [msk] = hfac(dz,hn,0,0);
35 msk(find(msk~=0))=1;
36
37 save MASKS msk
38 %wrda('pmask.bin',msk,1,fmt,Ieee);

  ViewVC Help
Powered by ViewVC 1.1.22