ROMS
Loading...
Searching...
No Matches
ecosim_mod.h
Go to the documentation of this file.
2!
3!git $Id$
4!================================================== Hernan G. Arango ===
5! Copyright (c) 2002-2025 The ROMS Group !
6! Licensed under a MIT/X style license !
7! See License_ROMS.md !
8!=======================================================================
9! !
10! Ecosim tracer parameters: !
11! !
12! NBands Number of spectral irradiance bands. !
13! NDbands Number of spectral irrandiance bands to process for !
14! the diagnostics terms. It is possible to reduce !
15! its number for the analysis of few selected !
16! spectral bands (TODO). !
17! Nbac Number of bacteria constituents. !
18! Ndom Number of dissolved matter constituents. !
19! Nfec Number of fecal matter constituents. !
20! Nphy Number of phytoplankton constituents. !
21! Npig Number of pigment constituents. !
22! PHY Indices of phytoplankton species considered. !
23! PIG Phytoplankton-pigment matrix. !
24! !
25! EcoSim Model Phytoplaknton Parameters: !
26! !
27! HsNO3 Half-saturation for phytoplankton NO3 uptake !
28! (micromole_NO3/liter). !
29! HsNH4 Half-saturation for phytoplankton NH4 uptake !
30! (micromole_NH4/liter). !
31! HsSiO Half-saturation for phytoplankton SiO uptake !
32! (micromole_SiO/liter). !
33! HsPO4 Half-saturation for phytoplankton PO4 uptake !
34! (micromole_PO4/liter). !
35! HsFe Half-saturation for phytoplankton Fe uptake !
36! (micromole_Fe/liter). !
37! GtALG_max Maximum 24 hour growth rate (1/day). !
38! PhyTbase Phytoplankton temperature base for exponential !
39! response to temperature (Celsius). !
40! PhyTfac Phytoplankton exponential temperature factor !
41! (1/Celsius). !
42! BET_ Nitrate uptake inhibition for NH4 (l/micromole). !
43! maxC2nALG Maximum phytoplankton C:N ratio !
44! (micromole_C/micromole_N). !
45! minC2nALG Balanced phytoplankton C:N ratio !
46! (micromole_C/micromole_N). !
47! C2nALGminABS Absolute minimum phytoplankton C:N ratio !
48! (micromole_C/micromole_N). !
49! maxC2SiALG Maximum phytoplankton C:Si ratio !
50! (micromole_C/micromole_Si). !
51! minC2SiALG Balanced phytoplankton C:Si ratio !
52! (micromole_C/micromole_Si). !
53! C2SiALGminABS Absolute minimum phytoplankton C:Si ratio !
54! (micromole_C/micromole_Si). !
55! maxC2pALG Maximum phytoplankton C:P ratio !
56! (micromole_C/micromole_P). !
57! minC2pALG Balanced phytoplankton C:P ratio !
58! (micromole_C/micromole_P). !
59! C2pALGminABS Absolute minimum phytoplankton C:P ratio !
60! (micromole_C/micromole_P). !
61! maxC2FeALG Maximum phytoplankton C:Fe ratio !
62! (micromole_C/micromole_Fe). !
63! minC2FeALG Balanced phytoplankton C:Fe ratio !
64! (micromole_C/micromole_Fe). !
65! C2FeALGminABS Absolute minimum phytoplankton C:Fe ratio !
66! (micromole_C/micromole_Fe). !
67! qu_yld Maximum quantum yield !
68! (micromole_C/micromole_quanta). !
69! E0_comp Compensation light level (micromole_quanta). !
70! E0_inhib Light level for onset of photoinhibition !
71! (micromole_quanta). !
72! inhib_fac Exponential decay factor for light limited growth !
73! (1/micromole_quanta). !
74! C2Chl_max Maximum lighted limited (nutrient replete) C:Chl !
75! ratio (microgram_C/microgram_Chl). !
76! mxC2Cl Rate of change in the lighted limited C:Chl ratio !
77! (microgram_C/microgram_Chl/micromole_quanta). !
78! b_C2Cl Minimum lighted limited (nutrient replete) C:Chl !
79! ratio (microgram_C/microgram_Chl). !
80! mxC2Cn Rate of change in the nutrient limited C:Chl ratio !
81! [(ug_C/ug_Chl)/(umole_C/umole_N)]. !
82! b_C2Cn Minimum nutrient limited C:Chl ratio !
83! (microgram_C/microgram_Chl). !
84! mxPacEff Rate of change in package effect !
85! [1/(microgram_C/microgram_Chl)]. !
86! b_PacEff Maximum package effect !
87! [1/(microgram_C/microgram_Chl)]. !
88! mxChlB Rate of change in the Chl_b:Chl_a ratio !
89! [(ug_Chl_b/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
90! b_ChlB Maximum Chl_b:Chl_a ratio !
91! (microgram_Chl_b/microgram_Chl_a). !
92! mxChlC Rate of change in the Chl_c:Chl_a ratio !
93! [(ug_Chl_c/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
94! b_ChlC Maximum Chl_c:Chl_a ratio !
95! (microgram_Chl_c/microgram_Chl_a). !
96! mxPSC Rate of change in the PSC:Chl_a ratio !
97! [(ug_PSC/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
98! b_PSC Maximum PSC:Chl_a ratio !
99! (microgram_Chl_c/microgram_Chl_a). !
100! mxPPC Rate of change in the PPC:Chl_a ratio !
101! [(ug_PPC/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
102! b_PPC Maximum PPC:Chl_a ratio !
103! (microgram_Chl_c/microgram_Chl_a). !
104! mxLPUb Rate of change in the LPUb:Chl_a ratio !
105! [(ug_LPUb/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
106! b_LPUb Maximum LPUb:Chl_a ratio !
107! (microgram_HPUb/microgram_Chl_a). !
108! mxHPUb Rate of change in the HPUb:Chl_a ratio !
109! [(ug_HPUb/ug_Chl_a)/(ug_C/ug_Chl_a)]. !
110! b_HPUb Maximum HPUb:Chl_a ratio !
111! (microgram_HPUb/microgram_Chl_a). !
112! FecDOC Proportion of grazing stress which is apportioned !
113! to DOM (nondimensional). !
114! FecPEL Proportion of grazing stress which is apportioned !
115! to fecal pellets (nondimesional). !
116! FecCYC Proportion of grazing stress which is apportioned !
117! to direct remineralization (nondimensional). !
118! ExALG Proportion of daily production that is lost to !
119! excretion (nondimensional). !
120! WS Phytoplankton sinking speed (meters/day). !
121! HsGRZ Phytoplankton grazing parameter (nondimensional). !
122! MinRefuge Refuge Phytoplankton population (micromole_C/liter). !
123! RefugeDep Maximum Refuge Phytoplankton depth (meters). !
124! Norm_Vol Normalized Volume factor (nondimensional). !
125! Norm_Surf Normalized surface area factor (nondimensional). !
126! HsDOP Half Saturation Constant for DOP uptake !
127! (micromole_DOP/liter). !
128! C2pALKPHOS C:P ratio where DOP uptake begins !
129! (micromole_C/micromole_P). !
130! HsDON Half Saturation Constant for DON uptake !
131! (micromole_DON/liter). !
132! C2nNupDON C:N ratio where DON uptake begins !
133! (micromole_C/micromole_N). !
134! !
135! Bacteria Parameters: !
136! !
137! HsDOC_ba Half saturation constant for bacteria DOC uptake !
138! (micromole_DOC/liter). !
139! GtBAC_max Maximum 24 hour bacterial growth rate (1/day). !
140! BacTbase Phytoplankton temperature base for exponential !
141! response to temperature, (Celsius). !
142! BacTfac Phytoplankton exponential temperature factor !
143! (1/Celsius). !
144! C2nBAC Carbon to Nitrogen ratio of Bacteria !
145! (micromole_C/micromole_N). !
146! C2pBAC Carbon to Phosphorus ratio of Bacteria !
147! (micromole_C/micromole_P). !
148! C2FeBAC Carbon to Iron ratio of Bacteria !
149! (micromole_C/micromole_Fe) !
150! BacDOC Proportion of bacterial grazing stress which is !
151! apportioned to DOM (nondimensional). !
152! BacPEL Proportion of bacterial grazing stress which is !
153! apportioned to fecal pellets (nondimensional). !
154! BacCYC Proportion of bacterial grazing stress which is !
155! apportioned to direct remineralization !
156! (nondimensional). !
157! ExBAC_c Bacterial recalcitrant carbon excretion as a !
158! proportion of uptake (nondimensional) !
159! ExBacC2N Bacterial recalcitrant excretion carbon to nitrogen !
160! ratio (micromole_C/micromole_N). !
161! Bac_Ceff Bacterial gross growth carbon efficiency !
162! (nondimensional). !
163! RtNIT Maximum bacterial nitrification rate (1/day). !
164! HsNIT Half saturation constant for bacterial nitrification !
165! (micromole NH4/liter) !
166! !
167! Dissolved Organic Matter Parameters: !
168! !
169! cDOCfrac_c Colored fraction of DOC production from !
170! phytoplankton and bacterial losses !
171! (nondimensional). !
172! RtUVR_DIC UV degradation of DOC into DIC at 410 nanometers !
173! (micromole/meter/liter/hour). !
174! RtUVR_DIC UV degradation of DOC into colorless labile DOC at !
175! 410 nanometers (micromole/meter/liter/hour). !
176! !
177! Fecal and detritus Parameters: !
178! !
179! WF Fecal sinking flux (meters/day). !
180! RegTbase Fecal regeneration temperature base for exponential !
181! response to temperature (Celsius). !
182! RegTfac Fecal regeneration exponential temperature factor !
183! (1/Celsius). !
184! RegCR Fecal carbon regeneration rate (1/day). !
185! RegNR Fecal nitrogen regeneration rate (1/day). !
186! RegSR Fecal silica regeneration rate (1/day). !
187! RegPR Fecal phosphorus regeneration rate (1/day). !
188! RegFR Fecal iron regeneration rate (1/day). !
189! !
190!======================================================================!
191!
192 USE mod_param
193 USE mod_scalars
194!
195 implicit none
196!
197!-----------------------------------------------------------------------
198! Bio-optical EcoSim parameters.
199!-----------------------------------------------------------------------
200!
201 integer, parameter :: nbands = 60 ! spectral bands
202 integer, parameter :: nbac = 1 ! bacteria constituents
203 integer, parameter :: ndom = 2 ! DOM constituents
204 integer, parameter :: nfec = 2 ! Fecal constituents
205 integer, parameter :: nphy = 4 ! Phytoplankton groups
206 integer, parameter :: npig = 7 ! Pigments
207!
208! Set number of spectral irrandiance bands to process for the
209! diagnostics terms. It is possible to reduce its number for the
210! analysis of few selected spectral bands (TODO).
211!
212 integer :: ndbands = nbands
213!
214! Determine number of EcoSim biological tracer. Currently, there is a
215! maximum of seven phytoplankton species and seven different pigments:
216!
217! [1] small diatom [1] chlorophyll-a
218! [2] large diatom [2] chlorophyll-b
219! [3] small dinoflagellate [3] chlorophyll-c
220! [4] large dinoflagellate [4] photosythetic carotenoids
221! [5] synechococcus [5] photoprotective carotenoids
222! [6] small prochlorococcus [6] low urobilin phycoeurythin carotenoids
223! [7] large prochlorococcus [7] high urobilin phycoeurythin carotenoids
224!
225! The phytoplankton/pigment matrix is as follows:
226!
227! P h y t o p l a n k t o n
228! [1] [2] [3] [4] [5] [6] [7]
229!
230! t [7] 0 0 0 0 1 0 0
231! n [6] 0 0 0 0 0 0 0
232! e [5] 1 1 1 1 1 1 1
233! m [4] 1 1 1 1 0 0 0
234! g [3] 1 1 1 1 0 0 0
235! i [2] 0 0 0 0 0 1 1
236! P [1] 1 1 1 1 1 1 1
237!
238 integer, parameter, dimension(7,7) :: pig = reshape ( &
239 & (/ 1, 1, 1, 1, 1, 1, 1, &
240 & 0, 0, 0, 0, 0, 1, 1, &
241 & 1, 1, 1, 1, 0, 0, 0, &
242 & 1, 1, 1, 1, 0, 0, 0, &
243 & 1, 1, 1, 1, 1, 1, 1, &
244 & 0, 0, 0, 0, 0, 0, 0, &
245 & 0, 0, 0, 0, 1, 0, 0 /), &
246 & (/ 7, 7 /) )
247!
248! Set phytoplankton species to consider (see above classification):
249!
250 integer, parameter, dimension(Nphy) :: phy = (/ 1, 2, 4, 5 /)
251!
252!-----------------------------------------------------------------------
253! Set biological tracer identification indices.
254!-----------------------------------------------------------------------
255!
256 integer, allocatable :: idbio(:) ! Biological tracers
257
258 integer :: ibacc(nbac) ! Bacteria, Carbon group
259 integer :: ibacn(nbac) ! Bacteria, Nitrogen group
260 integer :: ibacp(nbac) ! Bacteria, Phosphorous group
261 integer :: ibacf(nbac) ! Bacteria, Iron group
262 integer :: icdmc(ndom) ! Color degradational matter
263 integer :: idomc(ndom) ! DOM, Carbon group
264 integer :: idomn(ndom) ! DOM, Nitrogen group
265 integer :: idomp(ndom) ! DOM, Phosphorous group
266 integer :: ifecc(nfec) ! Fecal matter, Carbon group
267 integer :: ifecn(nfec) ! Fecal matter, Nitrogen group
268 integer :: ifecp(nfec) ! Fecal matter, Phosphorous group
269 integer :: ifecf(nfec) ! Fecal matter, Iron group
270 integer :: ifecs(nfec) ! Fecal matter, Silica group
271 integer :: iphyc(nphy) ! Phytoplankton, Carbon group
272 integer :: iphyn(nphy) ! Phytoplankton, Nitrogen group
273 integer :: iphyp(nphy) ! Phytoplankton, Phosphorous group
274 integer :: iphyf(nphy) ! Phytoplankton, Iron group
275 integer :: iphys(nphy) ! Phytoplankton, Silica group
276 integer :: ipigs(nphy,npig) ! Phytoplankton, pigment group
277 integer :: ino3_ ! Nitrate concentration
278 integer :: inh4_ ! Ammonium concentration
279 integer :: ipo4_ ! Phosphate concentration
280 integer :: ifeo_ ! Iron concentration
281 integer :: isio_ ! Silica concentration
282 integer :: idic_ ! Dissolved inorganic Carbon
283 integer :: firstpig ! Index of first tracer pigment
284
285#if defined DIAGNOSTICS && defined DIAGNOSTICS_BIO
286!
287!-----------------------------------------------------------------------
288! Set biological diagnostic identification indices.
289!-----------------------------------------------------------------------
290!
291! Center wavelenght of spectral irradiance bands for diagnostic
292! terms.
293!
294 real(r8), allocatable :: dia_light(:)
295!
296! 3D diagnostic variable IDs.
297!
298 integer, allocatable :: idbio3(:)
299!
300 integer :: idspir = 1 ! surface spectral irradiance
301!
302! 4D diagnostic variable IDs.
303!
304 integer, allocatable :: idbio4(:)
305!
306 integer :: iddirr = 1 ! downward irradiance (Ed)
307 integer :: idsirr = 2 ! scalar irradiance (E0)
308 integer :: idlatt = 3 ! light attenuation (Kd)
309 integer :: idaphy = 4 ! PHY absorption (aPHYN_at)
310 integer :: idadet = 5 ! detrital absorption (aDET)
311 integer :: idacdc = 6 ! CDC absorption (aCDC)
312 integer :: idacos = 7 ! avg cosine zenith angle (avgcos)
313 integer :: idbphy = 8 ! PHY backscattering (bb_phy)
314 integer :: idsphy = 9 ! PHY scattering (b_phy)
315 integer :: idbtot = 10 ! total backscattering (bb_tot)
316 integer :: idstot = 11 ! total scattering (b_tot)
317#endif
318!
319!-----------------------------------------------------------------------
320! EcoSim group names used on standard output.
321!-----------------------------------------------------------------------
322!
323 character (len=16), dimension(Nbac) :: bacname
324 character (len=11), dimension(Ndom) :: domname
325 character (len=13), dimension(Nfec) :: fecname
326 character (len=21), dimension(Nphy) :: phyname
327
328 character (len=39), dimension(7) :: pigname = &
329 & (/ 'chlorophyll-a ', &
330 & 'chlorophyll-b ', &
331 & 'chlorophyll-c ', &
332 & 'photosynthetic carotenoids ', &
333 & 'photoprotective carotenoids ', &
334 & 'low urobilin phycoeurythin carotenoids ', &
335 & 'high urobilin phycoeurythin carotenoids' /)
336!
337!-----------------------------------------------------------------------
338! Standard input parameters.
339!-----------------------------------------------------------------------
340!
341! Number of biological iterations.
342!
343 integer, allocatable :: bioiter(:)
344!
345! Control flags.
346!
347 logical, allocatable :: rtuvr_flag(:)
348 logical, allocatable :: nfix_flag(:)
349 logical, allocatable :: regen_flag(:)
350!
351! Phytoplankton parameters.
352!
353 real(r8), allocatable :: hsno3(:,:)
354 real(r8), allocatable :: hsnh4(:,:)
355 real(r8), allocatable :: hssio(:,:)
356 real(r8), allocatable :: hspo4(:,:)
357 real(r8), allocatable :: hsfe(:,:)
358 real(r8), allocatable :: gtalg_max(:,:)
359 real(r8), allocatable :: phytbase(:,:)
360 real(r8), allocatable :: phytfac(:,:)
361 real(r8), allocatable :: bet_(:,:)
362 real(r8), allocatable :: maxc2nalg(:,:)
363 real(r8), allocatable :: minc2nalg(:,:)
364 real(r8), allocatable :: c2nalgminabs(:,:)
365 real(r8), allocatable :: maxc2sialg(:,:)
366 real(r8), allocatable :: minc2sialg(:,:)
367 real(r8), allocatable :: c2sialgminabs(:,:)
368 real(r8), allocatable :: maxc2palg(:,:)
369 real(r8), allocatable :: minc2palg(:,:)
370 real(r8), allocatable :: c2palgminabs(:,:)
371 real(r8), allocatable :: maxc2fealg(:,:)
372 real(r8), allocatable :: minc2fealg(:,:)
373 real(r8), allocatable :: c2fealgminabs(:,:)
374 real(r8), allocatable :: qu_yld(:,:)
375 real(r8), allocatable :: e0_comp(:,:)
376 real(r8), allocatable :: e0_inhib(:,:)
377 real(r8), allocatable :: inhib_fac(:,:)
378 real(r8), allocatable :: c2chl_max(:,:)
379 real(r8), allocatable :: mxc2cl(:,:)
380 real(r8), allocatable :: b_c2cl(:,:)
381 real(r8), allocatable :: mxc2cn(:,:)
382 real(r8), allocatable :: b_c2cn(:,:)
383 real(r8), allocatable :: mxpaceff(:,:)
384 real(r8), allocatable :: b_paceff(:,:)
385 real(r8), allocatable :: mxchlb(:,:)
386 real(r8), allocatable :: b_chlb(:,:)
387 real(r8), allocatable :: mxchlc(:,:)
388 real(r8), allocatable :: b_chlc(:,:)
389 real(r8), allocatable :: mxpsc(:,:)
390 real(r8), allocatable :: b_psc(:,:)
391 real(r8), allocatable :: mxppc(:,:)
392 real(r8), allocatable :: b_ppc(:,:)
393 real(r8), allocatable :: mxlpub(:,:)
394 real(r8), allocatable :: b_lpub(:,:)
395 real(r8), allocatable :: mxhpub(:,:)
396 real(r8), allocatable :: b_hpub(:,:)
397 real(r8), allocatable :: fecdoc(:,:)
398 real(r8), allocatable :: fecpel(:,:,:)
399 real(r8), allocatable :: feccyc(:,:)
400 real(r8), allocatable :: exalg(:,:)
401 real(r8), allocatable :: ws(:,:)
402 real(r8), allocatable :: hsgrz(:,:)
403 real(r8), allocatable :: minrefuge(:,:)
404 real(r8), allocatable :: refugedep(:,:)
405 real(r8), allocatable :: norm_vol(:,:)
406 real(r8), allocatable :: norm_surf(:,:)
407 real(r8), allocatable :: hsdop(:,:)
408 real(r8), allocatable :: c2palkphos(:,:)
409 real(r8), allocatable :: hsdon(:,:)
410 real(r8), allocatable :: c2nnupdon(:,:)
411!
412! Bacteria parameters.
413!
414 real(r8), allocatable :: hsdoc_ba(:,:)
415 real(r8), allocatable :: gtbac_max(:,:)
416 real(r8), allocatable :: bactbase(:,:)
417 real(r8), allocatable :: bactfac(:,:)
418 real(r8), allocatable :: c2nbac(:)
419 real(r8), allocatable :: c2pbac(:)
420 real(r8), allocatable :: c2febac(:)
421 real(r8), allocatable :: bacdoc(:)
422 real(r8), allocatable :: bacpel(:)
423 real(r8), allocatable :: baccyc(:)
424 real(r8), allocatable :: exbac_c(:)
425 real(r8), allocatable :: exbacc2n(:)
426 real(r8), allocatable :: bac_ceff(:)
427 real(r8), allocatable :: rtnit(:)
428 real(r8), allocatable :: hsnit(:)
429!
430! DOM parameters.
431!
432 real(r8), allocatable :: cdocfrac_c(:,:)
433 real(r8), allocatable :: rtuvr_dic(:)
434 real(r8), allocatable :: rtuvr_doc(:)
435!
436! Fecal parameters.
437!
438 real(r8), allocatable :: wf(:,:)
439 real(r8), allocatable :: regtbase(:,:)
440 real(r8), allocatable :: regtfac(:,:)
441 real(r8), allocatable :: regcr(:,:)
442 real(r8), allocatable :: regnr(:,:)
443 real(r8), allocatable :: regsr(:,:)
444 real(r8), allocatable :: regpr(:,:)
445 real(r8), allocatable :: regfr(:,:)
446!
447!-----------------------------------------------------------------------
448! Internal parameters.
449!-----------------------------------------------------------------------
450!
451! Spectral band width used in light calculations.
452!
453 real(r8), parameter :: dlam = 5.0_r8
454!
455! Flags used for testing purposes.
456!
457 real(r8), parameter :: small = 1.0e-6_r8
458 real(r8), parameter :: vsmall = 1.0e-14_r8
459 real(r8), parameter :: larger = 1.0e+10_r8
460 real(r8), parameter :: vlarge = 1.0e+50_r8
461!
462! Array indexes for frequently used constituents.
463!
464 integer, parameter :: ilab=1 ! labile index for DOC.
465 integer, parameter :: irct=2 ! relict index for DOC.
466 integer, parameter :: ichl=1 ! pigment index for chlorophyll-a
467 integer, parameter :: isfc=1 ! slow fecal pellet index
468 integer, parameter :: iffc=2 ! fast fecal pellet index
469!
470! Phytoplankton calculated paramters.
471!
472 real(r8), allocatable :: imaxc2nalg(:,:) ! inverse C2nALG
473 real(r8), allocatable :: imaxc2sialg(:,:) ! inverse C2SiALG
474 real(r8), allocatable :: imaxc2palg(:,:) ! inverse C2pALG
475 real(r8), allocatable :: imaxc2fealg(:,:) ! inverse C2FeALG
476!
477! Bacteria calculated parameters.
478!
479 real(r8), allocatable :: n2cbac(:)
480 real(r8), allocatable :: p2cbac(:)
481 real(r8), allocatable :: fe2cbac(:)
482 real(r8), allocatable :: hsnh4_ba(:,:)
483 real(r8), allocatable :: hspo4_ba(:,:)
484 real(r8), allocatable :: hsfe_ba(:,:)
485 real(r8), allocatable :: r_exbac_c(:)
486 real(r8), allocatable :: exbac_n(:)
487 real(r8), allocatable :: frac_exbac_n(:)
488 real(r8), allocatable :: i_bac_ceff(:)
489!
490! Absorption parameters.
491!
492 real(r8), dimension(NBands) :: wavedp ! a and b factor
493 real(r8), dimension(Ndom) :: adoc410 ! CDM absorption at 410
494 real(r8), dimension(Ndom) :: adoc300 ! CDM absorption at 300
495!
496 CONTAINS
497!
499!
500!=======================================================================
501! !
502! This routine sets several variables needed by the biology model. !
503! It allocates and assigns biological tracers indices. !
504! !
505!=======================================================================
506!
507! Local variable declarations
508!
509 integer :: i, ic, j, ng
510
511 character (len=21), dimension(7) :: PhyGroups = &
512 & (/ 'small diatom ', &
513 & 'large diatom ', &
514 & 'small dinoflagellate ', &
515 & 'large dinoflagellate ', &
516 & 'synechococcus ', &
517 & 'small prochlorococcus', &
518 & 'large prochlorococcus' /)
519!
520!-----------------------------------------------------------------------
521! Determine number of biological tracers.
522!-----------------------------------------------------------------------
523!
524! Nutrients: NO3, NO4, PO4, FeO, SiO, DIC (6)
525! Bacteria: C, Fe, N, P (Nbac*4)
526! DOM: CDM, C, N, P (Ndom*4)
527! Fecal: C, Fe, N, P, Si (Nfec*5)
528! Phytoplakton: C, Fe, N, P (Nphy*4 + Si)
529! Pigments: look table
530!
531 nbt=6+(nbac*4)+(ndom*4)+(nfec*5)+(nphy*4)
532!
533! Add phytoplankton silica constituents.
534!
535 DO i=1,nphy
536 IF (phy(i).le.2) nbt=nbt+1
537 END DO
538!
539! Add pigments. Check phytoplankton-pigment table for values greater
540! than zero.
541!
542 DO j=1,npig
543 DO i=1,nphy
544 IF (pig(phy(i),j).eq.1) nbt=nbt+1
545 END DO
546 END DO
547
548#if defined DIAGNOSTICS && defined DIAGNOSTICS_BIO
549!
550!-----------------------------------------------------------------------
551! Set sources and sinks biology number of diagnostic terms.
552!-----------------------------------------------------------------------
553!
554 ndbio3d=1
555 ndbio4d=11
556#endif
557!
558!-----------------------------------------------------------------------
559! Allocate various module variables.
560!-----------------------------------------------------------------------
561!
562 IF (.not.allocated(bioiter)) THEN
563 allocate ( bioiter(ngrids) )
564 dmem(1)=dmem(1)+real(ngrids,r8)
565 END IF
566
567 IF (.not.allocated(rtuvr_flag)) THEN
568 allocate ( rtuvr_flag(ngrids) )
569 dmem(1)=dmem(1)+real(ngrids,r8)
570 END IF
571
572 IF (.not.allocated(nfix_flag)) THEN
573 allocate ( nfix_flag(ngrids) )
574 dmem(1)=dmem(1)+real(ngrids,r8)
575 END IF
576
577 IF (.not.allocated(regen_flag)) THEN
578 allocate ( regen_flag(ngrids) )
579 dmem(1)=dmem(1)+real(ngrids,r8)
580 END IF
581!
582 IF (.not.allocated(hsno3)) THEN
583 allocate ( hsno3(nphy,ngrids) )
584 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
585 END IF
586
587 IF (.not.allocated(hsnh4)) THEN
588 allocate ( hsnh4(nphy,ngrids) )
589 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
590 END IF
591
592 IF (.not.allocated(hssio)) THEN
593 allocate ( hssio(nphy,ngrids) )
594 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
595 END IF
596
597 IF (.not.allocated(hspo4)) THEN
598 allocate ( hspo4(nphy,ngrids) )
599 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
600 END IF
601
602 IF (.not.allocated(hsfe)) THEN
603 allocate ( hsfe(nphy,ngrids) )
604 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
605 END IF
606
607 IF (.not.allocated(gtalg_max)) THEN
608 allocate ( gtalg_max(nphy,ngrids) )
609 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
610 END IF
611
612 IF (.not.allocated(phytbase)) THEN
613 allocate ( phytbase(nphy,ngrids) )
614 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
615 END IF
616
617 IF (.not.allocated(phytfac)) THEN
618 allocate ( phytfac(nphy,ngrids) )
619 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
620 END IF
621
622 IF (.not.allocated(bet_)) THEN
623 allocate ( bet_(nphy,ngrids) )
624 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
625 END IF
626
627 IF (.not.allocated(maxc2nalg)) THEN
628 allocate ( maxc2nalg(nphy,ngrids) )
629 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
630 END IF
631
632 IF (.not.allocated(minc2nalg)) THEN
633 allocate ( minc2nalg(nphy,ngrids) )
634 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
635 END IF
636
637 IF (.not.allocated(c2nalgminabs)) THEN
638 allocate ( c2nalgminabs(nphy,ngrids) )
639 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
640 END IF
641
642 IF (.not.allocated(maxc2sialg)) THEN
643 allocate ( maxc2sialg(nphy,ngrids) )
644 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
645 END IF
646
647 IF (.not.allocated(minc2sialg)) THEN
648 allocate ( minc2sialg(nphy,ngrids) )
649 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
650 END IF
651
652 IF (.not.allocated(c2sialgminabs)) THEN
653 allocate ( c2sialgminabs(nphy,ngrids) )
654 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
655 END IF
656
657 IF (.not.allocated(maxc2palg)) THEN
658 allocate ( maxc2palg(nphy,ngrids) )
659 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
660 END IF
661
662 IF (.not.allocated(minc2palg)) THEN
663 allocate ( minc2palg(nphy,ngrids) )
664 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
665 END IF
666
667 IF (.not.allocated(c2palgminabs)) THEN
668 allocate ( c2palgminabs(nphy,ngrids) )
669 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
670 END IF
671
672 IF (.not.allocated(maxc2fealg)) THEN
673 allocate ( maxc2fealg(nphy,ngrids) )
674 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
675 END IF
676
677 IF (.not.allocated(minc2fealg)) THEN
678 allocate ( minc2fealg(nphy,ngrids) )
679 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
680 END IF
681
682 IF (.not.allocated(c2fealgminabs)) THEN
683 allocate ( c2fealgminabs(nphy,ngrids) )
684 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
685 END IF
686
687 IF (.not.allocated(qu_yld)) THEN
688 allocate ( qu_yld(nphy,ngrids) )
689 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
690 END IF
691
692 IF (.not.allocated(e0_comp)) THEN
693 allocate ( e0_comp(nphy,ngrids) )
694 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
695 END IF
696
697 IF (.not.allocated(e0_inhib)) THEN
698 allocate ( e0_inhib(nphy,ngrids) )
699 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
700 END IF
701
702 IF (.not.allocated(inhib_fac)) THEN
703 allocate ( inhib_fac(nphy,ngrids) )
704 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
705 END IF
706
707 IF (.not.allocated(c2chl_max)) THEN
708 allocate ( c2chl_max(nphy,ngrids) )
709 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
710 END IF
711
712 IF (.not.allocated(mxc2cl)) THEN
713 allocate ( mxc2cl(nphy,ngrids) )
714 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
715 END IF
716
717 IF (.not.allocated(b_c2cl)) THEN
718 allocate ( b_c2cl(nphy,ngrids) )
719 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
720 END IF
721
722 IF (.not.allocated(mxc2cn)) THEN
723 allocate ( mxc2cn(nphy,ngrids) )
724 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
725 END IF
726
727 IF (.not.allocated(b_c2cn)) THEN
728 allocate ( b_c2cn(nphy,ngrids) )
729 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
730 END IF
731
732 IF (.not.allocated(mxpaceff)) THEN
733 allocate ( mxpaceff(nphy,ngrids) )
734 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
735 END IF
736
737 IF (.not.allocated(b_paceff)) THEN
738 allocate ( b_paceff(nphy,ngrids) )
739 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
740 END IF
741
742 IF (.not.allocated(mxchlb)) THEN
743 allocate ( mxchlb(nphy,ngrids) )
744 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
745 END IF
746
747 IF (.not.allocated(b_chlb)) THEN
748 allocate ( b_chlb(nphy,ngrids) )
749 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
750 END IF
751
752 IF (.not.allocated(mxchlc)) THEN
753 allocate ( mxchlc(nphy,ngrids) )
754 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
755 END IF
756
757 IF (.not.allocated(b_chlc)) THEN
758 allocate ( b_chlc(nphy,ngrids) )
759 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
760 END IF
761
762 IF (.not.allocated(mxpsc)) THEN
763 allocate ( mxpsc(nphy,ngrids) )
764 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
765 END IF
766
767 IF (.not.allocated(b_psc)) THEN
768 allocate ( b_psc(nphy,ngrids) )
769 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
770 END IF
771
772 IF (.not.allocated(mxppc)) THEN
773 allocate ( mxppc(nphy,ngrids) )
774 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
775 END IF
776
777 IF (.not.allocated(b_ppc)) THEN
778 allocate ( b_ppc(nphy,ngrids) )
779 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
780 END IF
781
782 IF (.not.allocated(mxlpub)) THEN
783 allocate ( mxlpub(nphy,ngrids) )
784 dmem(1)=dmem(1)+real(ngrids,r8)
785 END IF
786
787 IF (.not.allocated(b_lpub)) THEN
788 allocate ( b_lpub(nphy,ngrids) )
789 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
790 END IF
791
792 IF (.not.allocated(mxhpub)) THEN
793 allocate ( mxhpub(nphy,ngrids) )
794 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
795 END IF
796
797 IF (.not.allocated(b_hpub)) THEN
798 allocate ( b_hpub(nphy,ngrids) )
799 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
800 END IF
801
802 IF (.not.allocated(fecdoc)) THEN
803 allocate ( fecdoc(nphy,ngrids) )
804 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
805 END IF
806
807 IF (.not.allocated(fecpel)) THEN
808 allocate ( fecpel(nphy,nfec,ngrids) )
809 dmem(1)=dmem(1)+real(nphy*nfec*ngrids,r8)
810 END IF
811
812 IF (.not.allocated(feccyc)) THEN
813 allocate ( feccyc(nphy,ngrids) )
814 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
815 END IF
816
817 IF (.not.allocated(exalg)) THEN
818 allocate ( exalg(nphy,ngrids) )
819 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
820 END IF
821
822 IF (.not.allocated(ws)) THEN
823 allocate ( ws(nphy,ngrids) )
824 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
825 END IF
826
827 IF (.not.allocated(hsgrz)) THEN
828 allocate ( hsgrz(nphy,ngrids) )
829 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
830 END IF
831
832 IF (.not.allocated(minrefuge)) THEN
833 allocate ( minrefuge(nphy,ngrids) )
834 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
835 END IF
836
837 IF (.not.allocated(refugedep)) THEN
838 allocate ( refugedep(nphy,ngrids) )
839 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
840 END IF
841
842 IF (.not.allocated(norm_vol)) THEN
843 allocate ( norm_vol(nphy,ngrids) )
844 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
845 END IF
846
847 IF (.not.allocated(norm_surf)) THEN
848 allocate ( norm_surf(nphy,ngrids) )
849 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
850 END IF
851
852 IF (.not.allocated(hsdop)) THEN
853 allocate ( hsdop(nphy,ngrids) )
854 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
855 END IF
856
857 IF (.not.allocated(c2palkphos)) THEN
858 allocate ( c2palkphos(nphy,ngrids) )
859 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
860 END IF
861
862 IF (.not.allocated(hsdon)) THEN
863 allocate ( hsdon(nphy,ngrids) )
864 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
865 END IF
866
867 IF (.not.allocated(c2nnupdon)) THEN
868 allocate ( c2nnupdon(nphy,ngrids) )
869 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
870 END IF
871!
872 IF (.not.allocated(hsdoc_ba)) THEN
873 allocate ( hsdoc_ba(nbac,ngrids) )
874 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
875 END IF
876
877 IF (.not.allocated(gtbac_max)) THEN
878 allocate ( gtbac_max(nbac,ngrids) )
879 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
880 END IF
881
882 IF (.not.allocated(bactbase)) THEN
883 allocate ( bactbase(nbac,ngrids) )
884 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
885 END IF
886
887 IF (.not.allocated(bactfac)) THEN
888 allocate ( bactfac(nbac,ngrids) )
889 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
890 END IF
891
892 IF (.not.allocated(c2nbac)) THEN
893 allocate ( c2nbac(ngrids) )
894 dmem(1)=dmem(1)+real(ngrids,r8)
895 END IF
896
897 IF (.not.allocated(c2pbac)) THEN
898 allocate ( c2pbac(ngrids) )
899 dmem(1)=dmem(1)+real(ngrids,r8)
900 END IF
901
902 IF (.not.allocated(c2febac)) THEN
903 allocate ( c2febac(ngrids) )
904 dmem(1)=dmem(1)+real(ngrids,r8)
905 END IF
906
907 IF (.not.allocated(bacdoc)) THEN
908 allocate ( bacdoc(ngrids) )
909 dmem(1)=dmem(1)+real(ngrids,r8)
910 END IF
911
912 IF (.not.allocated(bacpel)) THEN
913 allocate ( bacpel(ngrids) )
914 dmem(1)=dmem(1)+real(ngrids,r8)
915 END IF
916
917 IF (.not.allocated(baccyc)) THEN
918 allocate ( baccyc(ngrids) )
919 dmem(1)=dmem(1)+real(ngrids,r8)
920 END IF
921
922 IF (.not.allocated(exbac_c)) THEN
923 allocate ( exbac_c(ngrids) )
924 dmem(1)=dmem(1)+real(ngrids,r8)
925 END IF
926
927 IF (.not.allocated(exbacc2n)) THEN
928 allocate ( exbacc2n(ngrids) )
929 dmem(1)=dmem(1)+real(ngrids,r8)
930 END IF
931
932 IF (.not.allocated(bac_ceff)) THEN
933 allocate ( bac_ceff(ngrids) )
934 dmem(1)=dmem(1)+real(ngrids,r8)
935 END IF
936
937 IF (.not.allocated(rtnit)) THEN
938 allocate ( rtnit(ngrids) )
939 dmem(1)=dmem(1)+real(ngrids,r8)
940 END IF
941
942 IF (.not.allocated(hsnit)) THEN
943 allocate ( hsnit(ngrids) )
944 dmem(1)=dmem(1)+real(ngrids,r8)
945 END IF
946!
947 IF (.not.allocated(cdocfrac_c)) THEN
948 allocate ( cdocfrac_c(ndom,ngrids) )
949 dmem(1)=dmem(1)+real(ndom*ngrids,r8)
950 END IF
951
952 IF (.not.allocated(rtuvr_dic)) THEN
953 allocate ( rtuvr_dic(ngrids) )
954 dmem(1)=dmem(1)+real(ngrids,r8)
955 END IF
956
957 IF (.not.allocated(rtuvr_doc)) THEN
958 allocate ( rtuvr_doc(ngrids) )
959 dmem(1)=dmem(1)+real(ngrids,r8)
960 END IF
961!
962 IF (.not.allocated(wf)) THEN
963 allocate ( wf(nfec,ngrids) )
964 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
965 END IF
966
967 IF (.not.allocated(regtbase)) THEN
968 allocate ( regtbase(nfec,ngrids) )
969 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
970 END IF
971
972 IF (.not.allocated(regtfac)) THEN
973 allocate ( regtfac(nfec,ngrids) )
974 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
975 END IF
976
977 IF (.not.allocated(regcr)) THEN
978 allocate ( regcr(nfec,ngrids) )
979 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
980 END IF
981
982 IF (.not.allocated(regnr)) THEN
983 allocate ( regnr(nfec,ngrids) )
984 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
985 END IF
986
987 IF (.not.allocated(regsr)) THEN
988 allocate ( regsr(nfec,ngrids) )
989 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
990 END IF
991
992 IF (.not.allocated(regpr)) THEN
993 allocate ( regpr(nfec,ngrids) )
994 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
995 END IF
996
997 IF (.not.allocated(regfr)) THEN
998 allocate ( regfr(nfec,ngrids) )
999 dmem(1)=dmem(1)+real(nfec*ngrids,r8)
1000 END IF
1001!
1002 IF (.not.allocated(imaxc2nalg)) THEN
1003 allocate ( imaxc2nalg(nphy,ngrids) )
1004 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
1005 END IF
1006
1007 IF (.not.allocated(imaxc2sialg)) THEN
1008 allocate ( imaxc2sialg(nphy,ngrids) )
1009 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
1010 END IF
1011
1012 IF (.not.allocated(imaxc2palg)) THEN
1013 allocate ( imaxc2palg(nphy,ngrids) )
1014 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
1015 END IF
1016
1017 IF (.not.allocated(imaxc2fealg)) THEN
1018 allocate ( imaxc2fealg(nphy,ngrids) )
1019 dmem(1)=dmem(1)+real(nphy*ngrids,r8)
1020 END IF
1021!
1022 IF (.not.allocated(n2cbac)) THEN
1023 allocate ( n2cbac(ngrids) )
1024 dmem(1)=dmem(1)+real(ngrids,r8)
1025 END IF
1026
1027 IF (.not.allocated(p2cbac)) THEN
1028 allocate ( p2cbac(ngrids) )
1029 dmem(1)=dmem(1)+real(ngrids,r8)
1030 END IF
1031
1032 IF (.not.allocated(fe2cbac)) THEN
1033 allocate ( fe2cbac(ngrids) )
1034 dmem(1)=dmem(1)+real(ngrids,r8)
1035 END IF
1036
1037 IF (.not.allocated(hsnh4_ba)) THEN
1038 allocate ( hsnh4_ba(nbac,ngrids) )
1039 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
1040 END IF
1041
1042 IF (.not.allocated(hspo4_ba)) THEN
1043 allocate ( hspo4_ba(nbac,ngrids) )
1044 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
1045 END IF
1046
1047 IF (.not.allocated(hsfe_ba)) THEN
1048 allocate ( hsfe_ba(nbac,ngrids) )
1049 dmem(1)=dmem(1)+real(nbac*ngrids,r8)
1050 END IF
1051
1052 IF (.not.allocated(r_exbac_c)) THEN
1053 allocate ( r_exbac_c(ngrids) )
1054 dmem(1)=dmem(1)+real(ngrids,r8)
1055 END IF
1056
1057 IF (.not.allocated(exbac_n)) THEN
1058 allocate ( exbac_n(ngrids) )
1059 dmem(1)=dmem(1)+real(ngrids,r8)
1060 END IF
1061
1062 IF (.not.allocated(frac_exbac_n)) THEN
1063 allocate ( frac_exbac_n(ngrids) )
1064 dmem(1)=dmem(1)+real(ngrids,r8)
1065 END IF
1066
1067 IF (.not.allocated(i_bac_ceff)) THEN
1068 allocate ( i_bac_ceff(ngrids) )
1069 dmem(1)=dmem(1)+real(ngrids,r8)
1070 END IF
1071!
1072! Allocate biological tracer vector.
1073!
1074 IF (.not.allocated(idbio)) THEN
1075 allocate ( idbio(nbt) )
1076 dmem(1)=dmem(1)+real(nbt,r8)
1077 END IF
1078
1079#if defined DIAGNOSTICS && defined DIAGNOSTICS_BIO
1080!
1081! Allocate biological diagnostics vectors
1082!
1083 IF (.not.allocated(idbio3)) THEN
1084 allocate ( idbio3(ndbio3d) )
1085 dmem(1)=dmem(1)+real(ndbio3d,r8)
1086 END IF
1087
1088 IF (.not.allocated(idbio4)) THEN
1089 allocate ( idbio4(ndbio4d) )
1090 dmem(1)=dmem(1)+real(ndbio4d,r8)
1091 END IF
1092#endif
1093!
1094!-----------------------------------------------------------------------
1095! Initialize tracer identification indices.
1096!-----------------------------------------------------------------------
1097!
1098 ic=nat+npt+ncs+nns
1099 DO i=1,nbt
1100 idbio(i)=ic+i
1101 END DO
1102 idic_=ic+1
1103 ifeo_=ic+2
1104 inh4_=ic+3
1105 ino3_=ic+4
1106 ipo4_=ic+5
1107 isio_=ic+6
1108 ic=ic+6
1109 DO i=1,nbac
1110 ibacc(i)=ic+1
1111 ibacf(i)=ic+2
1112 ibacn(i)=ic+3
1113 ibacp(i)=ic+4
1114 ic=ic+4
1115 END DO
1116 DO i=1,ndom
1117 icdmc(i)=ic+1
1118 idomc(i)=ic+2
1119 idomn(i)=ic+3
1120 idomp(i)=ic+4
1121 ic=ic+4
1122 END DO
1123 DO i=1,nfec
1124 ifecc(i)=ic+1
1125 ifecf(i)=ic+2
1126 ifecn(i)=ic+3
1127 ifecp(i)=ic+4
1128 ifecs(i)=ic+5
1129 ic=ic+5
1130 END DO
1131 DO i=1,nphy
1132 iphyc(i)=ic+1
1133 iphyf(i)=ic+2
1134 iphyn(i)=ic+3
1135 iphyp(i)=ic+4
1136 ic=ic+4
1137 END DO
1138 DO i=1,nphy
1139 IF (phy(i).le.2) THEN
1140 ic=ic+1
1141 iphys(i)=ic
1142 ELSE
1143 iphys(i)=0
1144 END IF
1145 END DO
1146 firstpig=ic+1
1147 DO j=1,npig
1148 DO i=1,nphy
1149 ipigs(i,j)=0
1150 IF (pig(phy(i),j).eq.1) THEN
1151 ic=ic+1
1152 ipigs(i,j)=ic
1153 END IF
1154 END DO
1155 END DO
1156!
1157!-----------------------------------------------------------------------
1158! Set EcoSim group variable names.
1159!-----------------------------------------------------------------------
1160!
1161 DO i=1,nphy
1162 phyname(i)=phygroups(phy(i))
1163 END DO
1164 DO i=1,nbac
1165 WRITE (bacname(i),'(a,1x,i1)') 'Bacteria Group', i
1166 END DO
1167 DO i=1,ndom
1168 WRITE (domname(i),'(a,1x,i1)') 'DOM Group', i
1169 END DO
1170 DO i=1,nfec
1171 WRITE (fecname(i),'(a,1x,i1)') 'Fecal Group', i
1172 END DO
1173!
1174 RETURN
1175 END SUBROUTINE initialize_biology
1176
1177 END MODULE mod_biology
logical, dimension(:), allocatable rtuvr_flag
Definition ecosim_mod.h:347
real(r8), dimension(:), allocatable rtnit
Definition ecosim_mod.h:427
integer, dimension(nphy) iphyn
Definition ecosim_mod.h:272
real(r8), dimension(:,:), allocatable b_c2cl
Definition ecosim_mod.h:380
real(r8), dimension(:,:), allocatable e0_comp
Definition ecosim_mod.h:375
real(r8), dimension(:,:), allocatable inhib_fac
Definition ecosim_mod.h:377
real(r8), dimension(:,:), allocatable mxpaceff
Definition ecosim_mod.h:383
real(r8), dimension(:,:), allocatable mxppc
Definition ecosim_mod.h:391
real(r8), dimension(:,:), allocatable hspo4
Definition ecosim_mod.h:356
integer idstot
Definition ecosim_mod.h:316
real(r8), parameter vlarge
Definition ecosim_mod.h:460
real(r8), dimension(:,:), allocatable regcr
Definition ecosim_mod.h:441
integer idspir
Definition ecosim_mod.h:300
real(r8), dimension(:), allocatable frac_exbac_n
Definition ecosim_mod.h:487
real(r8), dimension(:,:), allocatable mxchlc
Definition ecosim_mod.h:387
integer, parameter nfec
Definition ecosim_mod.h:204
integer, dimension(:), allocatable idbio4
Definition ecosim_mod.h:304
real(r8), dimension(:), allocatable bacpel
Definition ecosim_mod.h:422
real(r8), dimension(:,:), allocatable mxpsc
Definition ecosim_mod.h:389
real(r8), dimension(:,:), allocatable mxc2cl
Definition ecosim_mod.h:379
integer, parameter nbac
Definition ecosim_mod.h:202
real(r8), dimension(:,:), allocatable b_chlc
Definition ecosim_mod.h:388
real(r8), dimension(:,:), allocatable hsfe
Definition ecosim_mod.h:357
real(r8), dimension(:,:), allocatable maxc2sialg
Definition ecosim_mod.h:365
integer, dimension(nbac) ibacc
Definition ecosim_mod.h:258
real(r8), dimension(:), allocatable r_exbac_c
Definition ecosim_mod.h:485
integer idacdc
Definition ecosim_mod.h:311
logical, dimension(:), allocatable nfix_flag
Definition ecosim_mod.h:348
real(r8), dimension(:,:), allocatable bactbase
Definition ecosim_mod.h:416
real(r8), dimension(:,:), allocatable hspo4_ba
Definition ecosim_mod.h:483
real(r8), dimension(nbands) wavedp
Definition ecosim_mod.h:492
real(r8), dimension(:,:), allocatable hsfe_ba
Definition ecosim_mod.h:484
real(r8), dimension(:,:), allocatable hsdon
Definition ecosim_mod.h:409
real(r8), dimension(:,:), allocatable mxchlb
Definition ecosim_mod.h:385
integer, dimension(7, 7), parameter pig
Definition ecosim_mod.h:238
real(r8), dimension(:,:), allocatable regpr
Definition ecosim_mod.h:444
real(r8), dimension(:,:), allocatable b_psc
Definition ecosim_mod.h:390
integer, dimension(nfec) ifecf
Definition ecosim_mod.h:269
integer, dimension(ndom) idomn
Definition ecosim_mod.h:264
integer, dimension(:), allocatable bioiter
Definition ecosim_mod.h:343
integer, parameter iffc
Definition ecosim_mod.h:468
integer, parameter ndom
Definition ecosim_mod.h:203
integer idadet
Definition ecosim_mod.h:310
real(r8), dimension(:,:), allocatable regtbase
Definition ecosim_mod.h:439
real(r8), dimension(:,:,:), allocatable fecpel
Definition ecosim_mod.h:398
real(r8), dimension(:), allocatable bac_ceff
Definition ecosim_mod.h:426
integer, dimension(nbac) ibacp
Definition ecosim_mod.h:260
integer, dimension(nfec) ifecp
Definition ecosim_mod.h:268
real(r8), dimension(:,:), allocatable hsnh4_ba
Definition ecosim_mod.h:482
real(r8), dimension(:,:), allocatable qu_yld
Definition ecosim_mod.h:374
integer, dimension(nfec) ifecc
Definition ecosim_mod.h:266
real(r8), dimension(:,:), allocatable hsno3
Definition ecosim_mod.h:353
integer ino3_
Definition ecosim_mod.h:277
integer, dimension(nphy) iphyp
Definition ecosim_mod.h:273
real(r8), dimension(:), allocatable rtuvr_dic
Definition ecosim_mod.h:433
real(r8), dimension(:,:), allocatable exalg
Definition ecosim_mod.h:400
real(r8), dimension(:,:), allocatable b_c2cn
Definition ecosim_mod.h:382
real(r8), dimension(:,:), allocatable mxc2cn
Definition ecosim_mod.h:381
integer ipo4_
Definition ecosim_mod.h:279
real(r8), dimension(:), allocatable p2cbac
Definition ecosim_mod.h:480
integer, parameter nbands
Definition ecosim_mod.h:201
real(r8), dimension(:,:), allocatable maxc2fealg
Definition ecosim_mod.h:371
real(r8), dimension(:,:), allocatable minc2sialg
Definition ecosim_mod.h:366
real(r8), dimension(:,:), allocatable hsdoc_ba
Definition ecosim_mod.h:414
integer, dimension(nfec) ifecs
Definition ecosim_mod.h:270
real(r8), dimension(:,:), allocatable regsr
Definition ecosim_mod.h:443
integer, parameter npig
Definition ecosim_mod.h:206
integer, dimension(ndom) icdmc
Definition ecosim_mod.h:262
real(r8), dimension(:,:), allocatable phytbase
Definition ecosim_mod.h:359
real(r8), dimension(:,:), allocatable fecdoc
Definition ecosim_mod.h:397
real(r8), dimension(:,:), allocatable imaxc2palg
Definition ecosim_mod.h:474
real(r8), dimension(:,:), allocatable b_hpub
Definition ecosim_mod.h:396
real(r8), dimension(:,:), allocatable bet_
Definition ecosim_mod.h:361
integer, parameter isfc
Definition ecosim_mod.h:467
real(r8), dimension(:), allocatable n2cbac
Definition ecosim_mod.h:479
real(r8), parameter larger
Definition ecosim_mod.h:459
integer ndbands
Definition ecosim_mod.h:212
real(r8), dimension(:,:), allocatable imaxc2sialg
Definition ecosim_mod.h:473
real(r8), dimension(:,:), allocatable mxlpub
Definition ecosim_mod.h:393
real(r8), dimension(:,:), allocatable b_chlb
Definition ecosim_mod.h:386
integer, parameter ichl
Definition ecosim_mod.h:466
real(r8), dimension(:), allocatable baccyc
Definition ecosim_mod.h:423
real(r8), parameter dlam
Definition ecosim_mod.h:453
real(r8), dimension(:,:), allocatable maxc2nalg
Definition ecosim_mod.h:362
integer, dimension(nphy) iphyc
Definition ecosim_mod.h:271
real(r8), dimension(:,:), allocatable wf
Definition ecosim_mod.h:438
real(r8), dimension(:,:), allocatable mxhpub
Definition ecosim_mod.h:395
integer, dimension(nbac) ibacf
Definition ecosim_mod.h:261
real(r8), dimension(:,:), allocatable c2nalgminabs
Definition ecosim_mod.h:364
logical, dimension(:), allocatable regen_flag
Definition ecosim_mod.h:349
real(r8), dimension(:,:), allocatable hsnh4
Definition ecosim_mod.h:354
integer idacos
Definition ecosim_mod.h:312
real(r8), dimension(:,:), allocatable feccyc
Definition ecosim_mod.h:399
real(r8), dimension(:,:), allocatable b_ppc
Definition ecosim_mod.h:392
real(r8), dimension(:), allocatable bacdoc
Definition ecosim_mod.h:421
real(r8), dimension(:,:), allocatable b_paceff
Definition ecosim_mod.h:384
real(r8), dimension(:,:), allocatable minrefuge
Definition ecosim_mod.h:403
real(r8), dimension(:,:), allocatable c2nnupdon
Definition ecosim_mod.h:410
integer, dimension(nphy, npig) ipigs
Definition ecosim_mod.h:276
real(r8), dimension(:,:), allocatable minc2nalg
Definition ecosim_mod.h:363
real(r8), dimension(:), allocatable c2febac
Definition ecosim_mod.h:420
real(r8), dimension(:,:), allocatable refugedep
Definition ecosim_mod.h:404
integer idlatt
Definition ecosim_mod.h:308
integer, dimension(:), allocatable idbio3
Definition ecosim_mod.h:298
integer idsphy
Definition ecosim_mod.h:314
real(r8), parameter vsmall
Definition ecosim_mod.h:458
real(r8), dimension(:,:), allocatable imaxc2fealg
Definition ecosim_mod.h:475
real(r8), dimension(:,:), allocatable norm_vol
Definition ecosim_mod.h:405
real(r8), dimension(:,:), allocatable maxc2palg
Definition ecosim_mod.h:368
real(r8), dimension(:,:), allocatable regtfac
Definition ecosim_mod.h:440
real(r8), dimension(:,:), allocatable c2fealgminabs
Definition ecosim_mod.h:373
real(r8), dimension(:), allocatable c2pbac
Definition ecosim_mod.h:419
integer inh4_
Definition ecosim_mod.h:278
character(len=13), dimension(nfec) fecname
Definition ecosim_mod.h:325
real(r8), dimension(:,:), allocatable phytfac
Definition ecosim_mod.h:360
integer, dimension(:), allocatable idbio
Definition ecosim_mod.h:256
integer, dimension(ndom) idomp
Definition ecosim_mod.h:265
integer, parameter nphy
Definition ecosim_mod.h:205
real(r8), dimension(:,:), allocatable ws
Definition ecosim_mod.h:401
character(len=11), dimension(ndom) domname
Definition ecosim_mod.h:324
real(r8), dimension(:,:), allocatable cdocfrac_c
Definition ecosim_mod.h:432
integer, dimension(nbac) ibacn
Definition ecosim_mod.h:259
real(r8), dimension(:,:), allocatable hsdop
Definition ecosim_mod.h:407
real(r8), dimension(:,:), allocatable regnr
Definition ecosim_mod.h:442
real(r8), parameter small
Definition ecosim_mod.h:457
integer idic_
Definition ecosim_mod.h:282
real(r8), dimension(:,:), allocatable imaxc2nalg
Definition ecosim_mod.h:472
real(r8), dimension(:), allocatable exbac_c
Definition ecosim_mod.h:424
integer, dimension(ndom) idomc
Definition ecosim_mod.h:263
real(r8), dimension(:,:), allocatable hssio
Definition ecosim_mod.h:355
real(r8), dimension(ndom) adoc410
Definition ecosim_mod.h:493
integer, dimension(nphy), parameter phy
Definition ecosim_mod.h:250
real(r8), dimension(:,:), allocatable b_lpub
Definition ecosim_mod.h:394
real(r8), dimension(:), allocatable rtuvr_doc
Definition ecosim_mod.h:434
real(r8), dimension(:,:), allocatable gtbac_max
Definition ecosim_mod.h:415
character(len=39), dimension(7) pigname
Definition ecosim_mod.h:328
integer iddirr
Definition ecosim_mod.h:306
character(len=21), dimension(nphy) phyname
Definition ecosim_mod.h:326
character(len=16), dimension(nbac) bacname
Definition ecosim_mod.h:323
real(r8), dimension(:,:), allocatable c2sialgminabs
Definition ecosim_mod.h:367
real(r8), dimension(:), allocatable exbacc2n
Definition ecosim_mod.h:425
integer, dimension(nphy) iphyf
Definition ecosim_mod.h:274
integer idsirr
Definition ecosim_mod.h:307
integer, parameter ilab
Definition ecosim_mod.h:464
real(r8), dimension(:), allocatable exbac_n
Definition ecosim_mod.h:486
real(r8), dimension(:), allocatable i_bac_ceff
Definition ecosim_mod.h:488
integer ifeo_
Definition ecosim_mod.h:280
real(r8), dimension(:,:), allocatable norm_surf
Definition ecosim_mod.h:406
subroutine initialize_biology
Definition ecosim_mod.h:499
real(r8), dimension(:,:), allocatable minc2palg
Definition ecosim_mod.h:369
integer, dimension(nphy) iphys
Definition ecosim_mod.h:275
integer idbtot
Definition ecosim_mod.h:315
real(r8), dimension(:,:), allocatable minc2fealg
Definition ecosim_mod.h:372
real(r8), dimension(:), allocatable c2nbac
Definition ecosim_mod.h:418
real(r8), dimension(:,:), allocatable hsgrz
Definition ecosim_mod.h:402
integer, dimension(nfec) ifecn
Definition ecosim_mod.h:267
real(r8), dimension(:,:), allocatable gtalg_max
Definition ecosim_mod.h:358
integer firstpig
Definition ecosim_mod.h:283
real(r8), dimension(:,:), allocatable bactfac
Definition ecosim_mod.h:417
real(r8), dimension(:), allocatable fe2cbac
Definition ecosim_mod.h:481
real(r8), dimension(:,:), allocatable c2chl_max
Definition ecosim_mod.h:378
real(r8), dimension(ndom) adoc300
Definition ecosim_mod.h:494
real(r8), dimension(:,:), allocatable e0_inhib
Definition ecosim_mod.h:376
real(r8), dimension(:), allocatable dia_light
Definition ecosim_mod.h:294
integer idbphy
Definition ecosim_mod.h:313
integer, parameter irct
Definition ecosim_mod.h:465
real(r8), dimension(:), allocatable hsnit
Definition ecosim_mod.h:428
real(r8), dimension(:,:), allocatable regfr
Definition ecosim_mod.h:445
real(r8), dimension(:,:), allocatable c2palkphos
Definition ecosim_mod.h:408
real(r8), dimension(:,:), allocatable c2palgminabs
Definition ecosim_mod.h:370
integer isio_
Definition ecosim_mod.h:281
integer idaphy
Definition ecosim_mod.h:309
integer nat
Definition mod_param.F:499
real(r8), dimension(:), allocatable dmem
Definition mod_param.F:137
integer ndbio4d
Definition mod_param.F:586
integer ncs
Definition mod_param.F:525
integer nbt
Definition mod_param.F:509
integer ngrids
Definition mod_param.F:113
integer ndbio3d
Definition mod_param.F:585
integer nns
Definition mod_param.F:529
integer npt
Definition mod_param.F:505