1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
2 | % |
---|
3 | % Build a ROMS initial file from Levitus Data |
---|
4 | % |
---|
5 | % Extrapole and interpole temperature and salinity from a |
---|
6 | % Climatology to get initial conditions for |
---|
7 | % ROMS (initial netcdf files) . |
---|
8 | % Get the velocities and sea surface elevation via a |
---|
9 | % geostrophic computation. |
---|
10 | % |
---|
11 | % Data input format (netcdf): |
---|
12 | % temperature(T, Z, Y, X) |
---|
13 | % T : time [Months] |
---|
14 | % Z : Depth [m] |
---|
15 | % Y : Latitude [degree north] |
---|
16 | % X : Longitude [degree east] |
---|
17 | % |
---|
18 | % Data source : IRI/LDEO Climate Data Library (World Ocean Atlas 1998) |
---|
19 | % http://ingrid.ldgo.columbia.edu/ |
---|
20 | % http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA98/ |
---|
21 | % |
---|
22 | % P. Marchesiello & P. Penven - IRD 2005 |
---|
23 | % |
---|
24 | % Version of 21-Sep-2005 |
---|
25 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
26 | clear all |
---|
27 | close all |
---|
28 | %%%%%%%%%%%%%%%%%%%%% USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%%% |
---|
29 | % |
---|
30 | % Title |
---|
31 | % |
---|
32 | title='Climatology'; |
---|
33 | % |
---|
34 | % Common parameters |
---|
35 | % |
---|
36 | romstools_param |
---|
37 | |
---|
38 | % Data climatologies file names: |
---|
39 | % |
---|
40 | % temp_month_data : monthly temperature climatology |
---|
41 | % temp_ann_data : annual temperature climatology |
---|
42 | % salt_month_data : monthly salinity climatology |
---|
43 | % salt_ann_data : annual salinity climatology |
---|
44 | % |
---|
45 | temp_month_data = [woa_dir,'temp_month.cdf']; |
---|
46 | temp_ann_data = [woa_dir,'temp_ann.cdf']; |
---|
47 | insitu2pot = 1; %1: transform in-situ temperature to potential temperature |
---|
48 | salt_month_data = [woa_dir,'salt_month.cdf']; |
---|
49 | salt_ann_data = [woa_dir,'salt_ann.cdf']; |
---|
50 | % |
---|
51 | % |
---|
52 | %%%%%%%%%%%%%%%%%%% END USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%% |
---|
53 | % |
---|
54 | % Title |
---|
55 | % |
---|
56 | disp(' ') |
---|
57 | disp([' Making initial file: ',ininame]) |
---|
58 | disp(' ') |
---|
59 | disp([' Title: ',title]) |
---|
60 | % |
---|
61 | % Initial file |
---|
62 | % |
---|
63 | create_inifile(ininame,grdname,title,... |
---|
64 | theta_s,theta_b,hc,N,... |
---|
65 | tini,'clobber'); |
---|
66 | % |
---|
67 | % Horizontal and vertical interp/extrapolations |
---|
68 | % |
---|
69 | disp(' ') |
---|
70 | disp(' Interpolations / extrapolations') |
---|
71 | disp(' ') |
---|
72 | disp(' Temperature...') |
---|
73 | ext_tracers_ini(ininame,grdname,temp_month_data,temp_ann_data,... |
---|
74 | 'temperature','temp','r',tini); |
---|
75 | disp(' ') |
---|
76 | disp(' Salinity...') |
---|
77 | ext_tracers_ini(ininame,grdname,salt_month_data,salt_ann_data,... |
---|
78 | 'salinity','salt','r',tini); |
---|
79 | % |
---|
80 | % Geostrophy |
---|
81 | % |
---|
82 | % disp(' ') |
---|
83 | % disp(' Compute geostrophic currents') |
---|
84 | % geost_currents(ininame,grdname,oaname,frcname,zref,obc,0) |
---|
85 | % |
---|
86 | % Initial file |
---|
87 | % |
---|
88 | if (insitu2pot) |
---|
89 | disp(' ') |
---|
90 | disp(' Compute potential temperature from in-situ...') |
---|
91 | getpot(ininame,grdname) |
---|
92 | end |
---|
93 | % |
---|
94 | % Make a few plots |
---|
95 | % |
---|
96 | disp(' ') |
---|
97 | disp(' Make a few plots...') |
---|
98 | test_clim(ininame,grdname,'temp',1,coastfileplot) |
---|
99 | figure |
---|
100 | test_clim(ininame,grdname,'salt',1,coastfileplot) |
---|
101 | % |
---|
102 | % End |
---|
103 | % |
---|
104 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|