/[MITgcm]/MITgcm_contrib/ecco_darwin/v4_3deg/matlab/gen_init.m
ViewVC logotype

Contents of /MITgcm_contrib/ecco_darwin/v4_3deg/matlab/gen_init.m

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


Revision 1.5 - (show annotations) (download)
Mon Jan 27 06:31:51 2020 UTC (6 years, 9 months ago) by dimitri
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
where possible, using code and input files from va_llc270

1 % Generate initial condition files
2 pin='../../../../MITgcm/verification/tutorial_global_oce_biogeo/input/';
3
4 % Uvel, Vvel, Theta, Salt, Eta
5 fin=[pin 'pickup.0005184000.data'];
6 tmp=readbin(fin,[128,64,123],1,'real*8');
7 writebin('../data/Uvel.0005184000',tmp(:,:,1:15));
8 writebin('../data/Vvel.0005184000',tmp(:,:,16:30));
9 writebin('../data/Theta.0005184000',tmp(:,:,31:45));
10 writebin('../data/Salt.0005184000',tmp(:,:,46:60));
11 writebin('../data/Eta.0005184000',tmp(:,:,121));
12
13 % Area, Heff
14 Ice=tmp(:,:,31);
15 Ice(find(Ice>-1.8))=0;
16 Ice(find(Ice))=1;
17 writebin('../data/Area.0005184000',Ice);
18 writebin('../data/Heff.0005184000',Ice);
19
20 % DIC, Alk, PO4, DOP, O2
21 fin=[pin 'pickup_ptracers.0005184000.data'];
22 tmp=readbin(fin,[128,64,75],1,'real*8');
23 writebin('../data/DIC.0005184000',tmp(:,:,1:15));
24 writebin('../data/Alk.0005184000',tmp(:,:,16:30));
25 writebin('../data/PO4.0005184000',tmp(:,:,31:45));
26 writebin('../data/DOP.0005184000',tmp(:,:,46:60));
27 writebin('../data/O2.0005184000',tmp(:,:,61:75));
28
29 % individual ptracers extracted from
30 % /nobackup/dcarrol2/v4_3deg/pickup/v4_3deg_pickup_ptracers_optimized.0000000001.data
31 % Type is real*4, dimensions are [128 64 15 40]
32 % Use xpolate to fill in some suprious zeros
33 fn1='v4_3deg_pickup_ptracers_optimized.0000000001.data';
34 for k=1:15
35 tmp=readbin(fn1,[128 64],1,'real*4',31*15+k-1);
36 in=find(tmp==0);
37 for t=1:39
38 tmp=readbin(fn1,[128 64],1,'real*4',(t-1)*15+k-1);
39 tmp(in)=nan;
40 tmp=xpolate(tmp);
41 fn2=['../data/ptracers_optimized_' myint2str(i) '.0000000001'];
42 writebin(fn2,tmp,1,'real*4',k-1)
43 end
44 end
45
46 % convert Dustin's iron file from 3x3 grid to 2.8125x2.8125 grid
47 lat1=[-90 -88.5:3:90 90];
48 lon1=-178.5:3:(180+360);
49 dx=2.8125;
50 lat2=(-90+dx/2):dx:90;
51 lon2=(dx/2):dx:360;
52 fnm1='../data/llc270_Mahowald_2009_soluble_iron_dust.bin';
53 fnm2='../data/3deg_Mahowald_2009_soluble_iron_dust.bin';
54 for m=1:12
55 tmp=readbin(fnm1,[120 60],1,'real*4',m-1);
56 tmp=[tmp(:,end) tmp tmp(:,1)];
57 tmp1=[tmp;tmp];
58 tmp2=interp2(lat1',lon1,tmp1,lat2',lon2);
59 writebin(fnm2,tmp2,1,'real*4',m-1);
60 end

  ViewVC Help
Powered by ViewVC 1.1.22