1 | clear all |
---|
2 | close all |
---|
3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
4 | % |
---|
5 | % Add biological parameters to a ROMS climatology file |
---|
6 | % |
---|
7 | % Data source : IRI/LDEO Climate Data Library (World Ocean Atlas 1998) |
---|
8 | % http://ingrid.ldgo.columbia.edu/ |
---|
9 | % http://iridl.ldeo.columbia.edu/SOURCES/.NOAA/.NODC/.WOA2001/ |
---|
10 | % |
---|
11 | % Further Information: |
---|
12 | % http://www.brest.ird.fr/Roms_tools/ |
---|
13 | % |
---|
14 | % This file is part of ROMSTOOLS |
---|
15 | % |
---|
16 | % ROMSTOOLS is free software; you can redistribute it and/or modify |
---|
17 | % it under the terms of the GNU General Public License as published |
---|
18 | % by the Free Software Foundation; either version 2 of the License, |
---|
19 | % or (at your option) any later version. |
---|
20 | % |
---|
21 | % ROMSTOOLS is distributed in the hope that it will be useful, but |
---|
22 | % WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
23 | % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
24 | % GNU General Public License for more details. |
---|
25 | % |
---|
26 | % You should have received a copy of the GNU General Public License |
---|
27 | % along with this program; if not, write to the Free Software |
---|
28 | % Foundation, Inc., 59 Temple Place, Suite 330, Boston, |
---|
29 | % MA 02111-1307 USA |
---|
30 | % |
---|
31 | % Copyright (c) 2003-2006 by Pierrick Penven |
---|
32 | % e-mail:Pierrick.Penven@ird.fr |
---|
33 | % |
---|
34 | % Contributions of P. Marchesiello (IRD) |
---|
35 | % |
---|
36 | % Updated 1-Sep-2006 by Pierrick Penven |
---|
37 | % |
---|
38 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
39 | clear all |
---|
40 | close all |
---|
41 | %%%%%%%%%%%%%%%%%%%%% USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%%% |
---|
42 | % |
---|
43 | % Common parameters |
---|
44 | % |
---|
45 | romstools_param |
---|
46 | % |
---|
47 | % Data climatologies file names: |
---|
48 | % |
---|
49 | % no3_seas_data : seasonal NO3 climatology |
---|
50 | % no3_ann_data : annual NO3 climatology |
---|
51 | % chla_seas_data : seasonal Chlorophylle climatology |
---|
52 | % |
---|
53 | no3_seas_data=[woa_dir,'no3_seas.cdf']; |
---|
54 | no3_ann_data=[woa_dir,'no3_ann.cdf']; |
---|
55 | chla_seas_data=[chla_dir,'chla_seas.cdf']; |
---|
56 | NO3min=1; |
---|
57 | % |
---|
58 | % |
---|
59 | %%%%%%%%%%%%%%%%%%% END USERS DEFINED VARIABLES %%%%%%%%%%%%%%%%%%%%%%% |
---|
60 | % |
---|
61 | % Add variables in the files |
---|
62 | % |
---|
63 | add_no3(oaname,clmname,ininame,grdname,no3_seas_data,... |
---|
64 | no3_ann_data,woa_cycle,makeoa,makeclim) |
---|
65 | % |
---|
66 | % Horizontal extrapolation of NO3 |
---|
67 | % |
---|
68 | if (makeoa) |
---|
69 | ext_tracers(oaname,no3_seas_data,no3_ann_data,... |
---|
70 | 'nitrate','NO3','no3_time','Zno3',Roa); |
---|
71 | end |
---|
72 | % |
---|
73 | % Vertical interpolations |
---|
74 | % |
---|
75 | if (makeclim) |
---|
76 | disp(' ') |
---|
77 | disp(' Vertical interpolations') |
---|
78 | disp(' ') |
---|
79 | disp(' NO3...') |
---|
80 | vinterp_clm(clmname,grdname,oaname,'NO3','no3_time','Zno3',0,'r'); |
---|
81 | % |
---|
82 | % Remove low values for oligotrophic areas |
---|
83 | % |
---|
84 | nc=netcdf(clmname,'write'); |
---|
85 | tlen=length(nc('no3_time')); |
---|
86 | for l=1:tlen |
---|
87 | NO3=nc{'NO3'}(l,:,:,:); |
---|
88 | NO3(NO3<NO3min)=0; |
---|
89 | nc{'NO3'}(l,:,:,:)=NO3; |
---|
90 | end |
---|
91 | close(nc) |
---|
92 | % |
---|
93 | % CHla |
---|
94 | % |
---|
95 | disp(' ') |
---|
96 | disp(' CHla...') |
---|
97 | add_chla(clmname,grdname,chla_seas_data,woa_cycle,Roa); |
---|
98 | % |
---|
99 | % Phyto |
---|
100 | % |
---|
101 | disp(' ') |
---|
102 | disp(' Phyto...') |
---|
103 | add_phyto(clmname); |
---|
104 | % |
---|
105 | % Phyto |
---|
106 | % |
---|
107 | disp(' ') |
---|
108 | disp(' Zoo...') |
---|
109 | add_zoo(clmname); |
---|
110 | end |
---|
111 | % |
---|
112 | % Initial file |
---|
113 | % |
---|
114 | if (makeini) |
---|
115 | disp(' ') |
---|
116 | disp(' Initial') |
---|
117 | disp(' ') |
---|
118 | disp(' NO3...') |
---|
119 | add_ini_no3(ininame,grdname,oaname,woa_cycle,NO3min); |
---|
120 | % |
---|
121 | % CHla |
---|
122 | % |
---|
123 | disp(' ') |
---|
124 | disp(' CHla...') |
---|
125 | add_ini_chla(ininame,grdname,chla_seas_data,woa_cycle,Roa); |
---|
126 | % |
---|
127 | % Phyto |
---|
128 | % |
---|
129 | disp(' ') |
---|
130 | disp(' Phyto...') |
---|
131 | add_ini_phyto(ininame); |
---|
132 | % |
---|
133 | % Zoo |
---|
134 | % |
---|
135 | disp(' ') |
---|
136 | disp(' Zoo...') |
---|
137 | add_ini_zoo(ininame); |
---|
138 | end |
---|
139 | % |
---|
140 | % Make a few plots |
---|
141 | % |
---|
142 | disp(' ') |
---|
143 | disp(' Make a few plots...') |
---|
144 | test_clim(clmname,grdname,'NO3',1,coastfileplot) |
---|
145 | figure |
---|
146 | test_clim(clmname,grdname,'CHLA',1,coastfileplot) |
---|
147 | figure |
---|
148 | test_clim(clmname,grdname,'PHYTO',1,coastfileplot) |
---|
149 | % |
---|
150 | % End |
---|
151 | % |
---|
152 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
153 | |
---|
154 | |
---|
155 | |
---|
156 | |
---|
157 | |
---|
158 | |
---|
159 | |
---|
160 | |
---|
161 | |
---|
162 | |
---|
163 | |
---|