-
Notifications
You must be signed in to change notification settings - Fork 93
/
generic_COBALT.F90
7966 lines (7218 loc) · 426 KB
/
generic_COBALT.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
! <CONTACT EMAIL="GFDL.Climate.Model.Info@noaa.gov"> Charles Stock
! </CONTACT>
!
! <OVERVIEW>
! This module contains the generic version of the COBALT 1.0 model: "Carbon Ocean
! Biogeochemistry and Lower Trophics". COBALT augments the foodweb dynamics
! in TOPAZ to enable anaylisis of the energy flow through the planktonic
! foodweb and improve the mechanistic resolution of foodweb dynamics that
! influence biogeochemical processes.
! </OVERVIEW>
!<DESCRIPTION>
! COBALT simulates the biogeochemical cycling of carbon, nitrogen,
! phosphorous, iron, silica, calcium carbonate, and lithogenic
! material in the ocean. The code is built upon the TOPAZ code
! developed by John Dunne. The primary changes to TOPAZ are:
!
! 1) the addition of three zooplankton groups
! 2) The addition of bacteria
! 3) The expansion of the dissolved organic nitrogen and
! phosphorous groups to include three types each: labile,
! semi-labile, and refractory
! 4) The division of small phytoplankton into low- and high-
! light adapted varieties
! 5) The 1.0 version of the model is coded for constant P:N. Code
! related to the variable P:N formulation used in TOPAZ has
! been retained, but phytoplankton phosphorous state variables
! have been removed (commented out) for computational savings.
!
! Numerous other adjustments to TOPAZ have been made and are detailed in
! the COBALT manual, which can be found at:
!
!
! This manual provides the rationale and justification for the various
! parameterizations used herein, as well as definitions for all variables
! and parameters. The 35 model state variables are:
!
! alk: alkalinity
! cadet_arag: calcium carbonate detritus (aragonite)
! cadet_calc: calcium carbonate detritus (calcite)
! dic: dissolved inorganic carbon
! fed: dissolved iron
! fedi: diazotroph iron
! felg: large phytoplankton iron
! fedet: iron detritus
! fesm: small phytoplankton iron
! ldon: labile dissolved organic nitrogen
! ldop: labile dissolved organic phosphorous
! lith: lithogenic aluminosilicate particles
! lithdet: lithogenic detritus
! nbact: bacteria
! ndet: nitrogen detritus
! ndi: diazotroph nitrogen
! nlg: large phyto nitrogen
! nsm: high-light adapted small phyto nitrogen
! nh4: ammonia
! no3: nitrate
! o2: oxygen
! pdet: phosphorous detritus
! po4: phosphate
! srdon: semi-refractory dissolved organic nitrogen
! (decays over years to decades)
! srdop: semi-refractory dissolved organic phosphorous
! (decays over years to decades)
! sldon: semi-labile dissolved organic nitrogen
! (decays on monthly time scales)
! sldop: semi-labile dissolved organic phosphorous
! (decays on monthly time scales)
! sidet: silica detritus
! silg: large phyto silica
! sio4: silicate
! nsmz: small zooplankton nitrogen
! nmdz: medium zooplankton nitrogen
! nlgz: large zooplankton nitrogen
!
!</DESCRIPTION>
!
! <INFO>
! <REFERENCE>
! </REFERENCE>
! <DEVELOPER_NOTES>
! </DEVELOPER_NOTES>
! </INFO>
!----------------------------------------------------------------
module generic_COBALT
use coupler_types_mod, only: coupler_2d_bc_type
use field_manager_mod, only: fm_string_len, fm_path_name_len
use mpp_mod, only: mpp_clock_id, mpp_clock_begin, mpp_clock_end
use mpp_mod, only: CLOCK_COMPONENT, CLOCK_SUBCOMPONENT, CLOCK_MODULE
use time_manager_mod, only: time_type
use fm_util_mod, only: fm_util_start_namelist, fm_util_end_namelist
use diag_manager_mod, only: register_diag_field, send_data
use constants_mod, only: WTMCO2, WTMO2
use fms_mod, only: write_version_number, FATAL, WARNING, stdout, stdlog
use g_tracer_utils, only : g_tracer_type,g_tracer_start_param_list,g_tracer_end_param_list
use g_tracer_utils, only : g_tracer_add,g_tracer_add_param, g_tracer_set_files
use g_tracer_utils, only : g_tracer_set_values,g_tracer_get_pointer
use g_tracer_utils, only : g_tracer_get_common,g_tracer_set_common
use g_tracer_utils, only : g_tracer_coupler_set,g_tracer_coupler_get
use g_tracer_utils, only : g_tracer_send_diag, g_tracer_get_values
use g_tracer_utils, only : g_diag_type, g_diag_field_add
use FMS_ocmip2_co2calc_mod, only : FMS_ocmip2_co2calc, CO2_dope_vector
implicit none ; private
!-----------------------------------------------------------------------
character(len=128) :: version = '$Id: generic_COBALT.F90,v 20.0 2013/12/14 00:18:04 fms Exp $'
character(len=128) :: tag = '$Name: tikal $'
!-----------------------------------------------------------------------
character(len=fm_string_len), parameter :: mod_name = 'generic_COBALT'
character(len=fm_string_len), parameter :: package_name = 'generic_cobalt'
public do_generic_COBALT
public generic_COBALT_register
public generic_COBALT_init
public generic_COBALT_register_diag
public generic_COBALT_update_from_coupler
public generic_COBALT_update_from_source
public generic_COBALT_update_from_bottom
public generic_COBALT_set_boundary_values
public generic_COBALT_end
!The following logical for using this module is overwritten
logical, save :: do_generic_COBALT = .false.
real, parameter :: sperd = 24.0 * 3600.0
real, parameter :: spery = 365.25 * sperd
real, parameter :: epsln=1.0e-30
real,parameter :: missing_value1=-1.0e+10
real, parameter :: missing_value_diag=-1.0e+10
! Declare phytoplankton, zooplankton and cobalt variable types, which contain
! the vast majority of all variables used in this module.
type phytoplankton
real :: alpha, &
fe_2_n_max, &
p_2_n_static, &
k_fe_2_n, &
k_fed, &
k_nh4, &
k_no3, &
k_po4, &
k_sio4, &
P_C_max, &
si_2_n_max, &
si_2_n_static, &
thetamax, &
bresp, &
agg, &
vir, &
exu
real, ALLOCATABLE, dimension(:,:) :: &
jprod_n_100, &
jprod_n_new_100, &
jprod_n_n2_100, &
jzloss_n_100, &
jaggloss_n_100, &
jvirloss_n_100, &
jexuloss_n_100, &
f_n_100
real, ALLOCATABLE, dimension(:,:,:) :: &
def_fe , &
def_p , &
f_fe , &
f_n , &
felim , &
irrlim , &
jzloss_fe , &
jzloss_n , &
jzloss_p , &
jzloss_sio2 , &
jaggloss_fe , &
jaggloss_n , &
jaggloss_p , &
jaggloss_sio2,&
jvirloss_fe , &
jvirloss_n , &
jvirloss_p , &
jvirloss_sio2,&
jexuloss_fe , &
jexuloss_n , &
jexuloss_p , &
jhploss_fe , &
jhploss_n , &
jhploss_p , &
jhploss_sio2, &
juptake_n2 , &
juptake_fe , &
juptake_nh4 , &
juptake_no3 , &
juptake_po4 , &
juptake_sio4, &
jprod_n , &
liebig_lim , &
mu , &
nh4lim , &
no3lim , &
po4lim , &
o2lim , &
q_fe_2_n , &
q_p_2_n , &
silim , &
q_si_2_n , &
theta
integer :: &
id_def_fe = -1, &
id_def_p = -1, &
id_felim = -1, &
id_irrlim = -1, &
id_jzloss_fe = -1, &
id_jzloss_n = -1, &
id_jzloss_p = -1, &
id_jzloss_sio2 = -1, &
id_jaggloss_fe = -1, &
id_jaggloss_n = -1, &
id_jaggloss_p = -1, &
id_jaggloss_sio2= -1, &
id_jvirloss_fe = -1, &
id_jvirloss_n = -1, &
id_jvirloss_p = -1, &
id_jvirloss_sio2= -1, &
id_jexuloss_n = -1, &
id_jexuloss_p = -1, &
id_jexuloss_fe = -1, &
id_jhploss_fe = -1, &
id_jhploss_n = -1, &
id_jhploss_p = -1, &
id_jhploss_sio2 = -1, &
id_juptake_n2 = -1, &
id_juptake_fe = -1, &
id_juptake_nh4 = -1, &
id_juptake_no3 = -1, &
id_juptake_po4 = -1, &
id_juptake_sio4 = -1, &
id_jprod_n = -1, &
id_liebig_lim = -1, &
id_mu = -1, &
id_nh4lim = -1, &
id_no3lim = -1, &
id_po4lim = -1, &
id_o2lim = -1, &
id_q_fe_2_n = -1, &
id_q_p_2_n = -1, &
id_silim = -1, &
id_q_si_2_n = -1, &
id_theta = -1, &
id_jprod_n_100 = -1, &
id_jprod_n_new_100 = -1, &
id_jprod_n_n2_100 = -1, &
id_jzloss_n_100 = -1, &
id_jaggloss_n_100 = -1, &
id_jvirloss_n_100 = -1, &
id_jexuloss_n_100 = -1, &
id_f_n_100 = -1, &
id_sfc_f_n = -1, &
id_sfc_chl = -1, &
id_sfc_def_fe = -1, &
id_sfc_felim = -1, &
id_sfc_q_fe_2_n = -1, &
id_sfc_nh4lim = -1, &
id_sfc_no3lim = -1, &
id_sfc_po4lim = -1, &
id_sfc_irrlim = -1, &
id_sfc_theta = -1, &
id_sfc_mu = -1
end type phytoplankton
type zooplankton
real :: &
imax, & ! maximum ingestion rate (sec-1)
ki, & ! half-sat for ingestion (moles N m-3)
gge_max, & ! max gross growth efficiciency (approached as i >> bresp, dimensionless)
nswitch, & ! switching parameter (dimensionless)
mswitch, & ! switching parameter (dimensionless)
bresp, & ! basal respiration rate (sec-1)
ktemp, & ! temperature dependence of zooplankton rates (C-1)
phi_det, & ! fraction of ingested N to detritus
phi_ldon, & ! fraction of ingested N/P to labile don
phi_sldon, & ! fraction of ingested N/P to semi-labile don
phi_srdon, & ! fraction of ingested N/P to semi-refractory don
phi_ldop, & ! fraction of ingested N/P to labile dop
phi_sldop, & ! fraction of ingested N/P to semi-labile dop
phi_srdop, & ! fraction of ingested N/P to semi-refractory dop
phi_nh4, & ! fraction of ingested N to nh4 due to ingestion-related metabolism
phi_po4, & ! fraction of ingested N to po4 due to ingestion-related metabolism
q_p_2_n, & ! p:n ratio of zooplankton
ipa_smp, & ! innate prey availability of low-light adapt. small phytos
ipa_lgp, & ! innate prey availability of large phytoplankton
ipa_diaz, & ! innate prey availability of diazotrophs
ipa_smz, & ! innate prey availability of small zooplankton
ipa_mdz, & ! innate prey availability of large zooplankton
ipa_lgz, & ! innate prey availability of x-large zooplankton
ipa_det, & ! innate prey availability of detritus
ipa_bact ! innate prey availability for bacteria
real, ALLOCATABLE, dimension(:,:) :: &
jprod_n_100, &
jingest_n_100, &
jzloss_n_100, &
jhploss_n_100, &
jprod_ndet_100, &
jprod_don_100, &
jremin_n_100, &
f_n_100
real, ALLOCATABLE, dimension(:,:,:) :: &
f_n, & ! zooplankton biomass
jzloss_n, & ! Losses of n due to consumption by other zooplankton groups
jzloss_p, & ! Losses of p due to consumption by other zooplankton groups
jhploss_n, & ! Losses of n due to consumption by unresolved higher preds
jhploss_p, & ! Losses of p due to consumption by unresolved higher preds
jingest_n, & ! Total ingestion of n
jingest_p, & ! Total ingestion of p
jingest_sio2, & ! Total ingestion of silicate
jingest_fe, & ! Total ingestion of iron
jprod_ndet, & ! production of nitrogen detritus by zooplankton group
jprod_pdet, & ! production of phosphorous detritus by zooplankton group
jprod_ldon, & ! production of labile dissolved organic N by zooplankton group
jprod_ldop, & ! production of labile dissolved organic P by zooplankton group
jprod_srdon, & ! production of semi-refractory dissolved organic N by zooplankton group
jprod_srdop, & ! production of semi-refractory dissolved organic P by zooplankton group
jprod_sldon, & ! production of semi-labile dissolved organic N by zooplankton group
jprod_sldop, & ! production of semi-labile dissolved organic P by zooplankton group
jprod_fedet, & ! production of iron detritus
jprod_fed, & ! production of dissolved iron
jprod_sidet, & ! production of silica detritus
jprod_sio4, & ! production of silicate via rapid dissolution at surface
jprod_po4, & ! phosphate production by zooplankton
jprod_nh4, & ! ammonia production by zooplankton
jprod_n, & ! zooplankton production
temp_lim ! Temperature limitation
integer :: &
id_jzloss_n = -1, &
id_jzloss_p = -1, &
id_jhploss_n = -1, &
id_jhploss_p = -1, &
id_jingest_n = -1, &
id_jingest_p = -1, &
id_jingest_sio2 = -1, &
id_jingest_fe = -1, &
id_jprod_ndet = -1, &
id_jprod_pdet = -1, &
id_jprod_ldon = -1, &
id_jprod_ldop = -1, &
id_jprod_srdon = -1, &
id_jprod_srdop = -1, &
id_jprod_sldon = -1, &
id_jprod_sldop = -1, &
id_jprod_fedet = -1, &
id_jprod_fed = -1, &
id_jprod_sidet = -1, &
id_jprod_sio4 = -1, &
id_jprod_po4 = -1, &
id_jprod_nh4 = -1, &
id_jprod_n = -1, &
id_temp_lim = -1, &
id_jprod_n_100 = -1, &
id_jingest_n_100 = -1, &
id_jzloss_n_100 = -1, &
id_jhploss_n_100 = -1, &
id_jprod_ndet_100 = -1, &
id_jprod_don_100 = -1, &
id_jremin_n_100 = -1, &
id_f_n_100 = -1
end type zooplankton
type bacteria
real :: &
mu_max, & ! maximum bacterial growth rate (sec-1)
k_ldon, & ! half-sat for nitrogen-limited growth (mmoles N m-3)
gge_max, & ! max gross growth efficiciency (dimensionless)
bresp, & ! basal respiration rate (sec-1)
ktemp, & ! temperature dependence of bacterial rates (C-1)
vir, & ! virus-driven loss rate for bacteria (sec-1 mmole N m-3)
q_p_2_n ! p:n ratio for bacteria
real, ALLOCATABLE, dimension(:,:) :: &
jprod_n_100, &
jzloss_n_100, &
jvirloss_n_100, &
jremin_n_100, &
juptake_ldon_100, &
f_n_100
real, ALLOCATABLE, dimension(:,:,:) :: &
f_n, & ! bacteria biomass
jzloss_n, & ! Losses of n due to consumption by zooplankton
jzloss_p, & ! Losses of p due to consumption by zooplankton
jhploss_n, & ! Losses of n due to consumption by unresolved higher preds
jhploss_p, & ! Losses of p due to consumption by unresolved higher preds
jvirloss_n , & ! nitrogen losses via viruses
jvirloss_p , & ! phosphorous losses via viruses
juptake_ldon, & ! Total uptake of ldon
juptake_ldop, & ! Total uptake of sldon
jprod_nh4, & ! production of ammonia bacteria
jprod_po4, & ! production of phosphate by bacteria
jprod_n, & ! bacterial production
temp_lim ! Temperature limitation
integer :: &
id_jzloss_n = -1, &
id_jzloss_p = -1, &
id_jhploss_n = -1, &
id_jhploss_p = -1, &
id_jvirloss_n = -1, &
id_jvirloss_p = -1, &
id_juptake_ldon = -1, &
id_juptake_ldop = -1, &
id_jprod_nh4 = -1, &
id_jprod_po4 = -1, &
id_jprod_n = -1, &
id_temp_lim = -1, &
id_jprod_n_100 = -1, &
id_jzloss_n_100 = -1, &
id_jvirloss_n_100 = -1, &
id_jremin_n_100 = -1, &
id_juptake_ldon_100 = -1, &
id_f_n_100
end type bacteria
integer, parameter :: NUM_PHYTO = 3
!
! Array allocations and flux calculations assume that phyto(1) is the
! only phytoplankton group cabable of nitrogen uptake by N2 fixation while phyto(2:NUM_PHYTO)
! are only cabable of nitrgen uptake by NH4 and NO3 uptake
!
integer, parameter :: DIAZO = 1
integer, parameter :: LARGE = 2
integer, parameter :: SMALL = 3
type(phytoplankton), dimension(NUM_PHYTO) :: phyto
! define three zooplankton types
integer, parameter :: NUM_ZOO = 3
type(zooplankton), dimension(NUM_ZOO) :: zoo
type(bacteria), dimension(1) :: bact
integer, parameter :: NUM_PREY = 8
type generic_COBALT_type
logical :: &
init, & ! If tracers should be initializated
p_2_n_static, & ! If P:N is fixed in phytoplankton
tracer_debug
real :: &
atm_co2_flux, &
c_2_n, &
ca_2_n_arag, &
ca_2_n_calc, &
caco3_sat_max, &
fe_2_n_upt_fac, &
fe_2_n_sed, &
fe_coast, &
felig_2_don, &
felig_bkg , &
gamma_cadet_arag, &
gamma_cadet_calc, &
gamma_irr_mem, &
gamma_ndet, &
gamma_nitrif, &
gamma_sidet, &
gamma_srdon, &
gamma_srdop, &
gamma_sldon, &
gamma_sldop, &
irr_inhibit, &
k_n_inhib_di, &
k_o2, &
kappa_eppley, &
kappa_remin, &
kfe_eq_lig_hl, &
kfe_eq_lig_ll, &
alpha_fescav, &
beta_fescav, &
gamma_fescav, &
ki_fescav, &
io_fescav, &
remin_eff_fedet, &
k_lith, &
phi_lith, &
mass_2_n, &
alk_2_n_denit, &
n_2_n_denit, &
k_no3_denit, &
o2_min, &
o2_2_c, &
o2_2_nfix, &
o2_2_nh4, &
o2_2_no3, &
o2_2_nitrif, &
o2_inhib_di_pow, &
o2_inhib_di_sat, &
P_C_max_assem, &
rpcaco3, &
rplith, &
rpsio2, &
thetamin, &
thetamin_nolim, &
vir_ktemp, &
lysis_phi_ldon, &
lysis_phi_srdon, &
lysis_phi_sldon, &
lysis_phi_ldop, &
lysis_phi_srdop, &
lysis_phi_sldop, &
wsink, &
z_sed, &
zeta, &
imax_hp, & ! unresolved higher pred. max ingestion rate
ki_hp, & ! unresolved higher pred. half-sat
ktemp_hp, & ! temperature dependence for higher predators
coef_hp, & ! scaling between unresolved preds and available prey
nswitch_hp, & ! higher predator switching behavior
mswitch_hp, & ! higher predator switching behavior
hp_ipa_smp, & ! innate prey availability of small phytos to hp's
hp_ipa_lgp, & ! " " " " " " " " " large phytos to hp's
hp_ipa_diaz, & ! " " " " " " " " " diazotrophs to hp's
hp_ipa_bact, & ! " " " " " " " " " bacteria to hp's
hp_ipa_smz, & ! " " " " " " " " " small zooplankton to hp's
hp_ipa_mdz, & ! " " " " " " " " " medium zooplankton to hp's
hp_ipa_lgz, & ! " " " " " " " " " large zooplankton to hp's
hp_ipa_det, & ! " " " " " " " " " detritus to hp's
hp_phi_det, & ! fraction of ingested N to detritus
hp_phi_ldon, & ! fraction of ingested N to labile don
hp_phi_sldon, & ! fraction of ingested N to semi-labile don
hp_phi_srdon, & ! fraction of ingested N to semi-refractory don
hp_phi_ldop, & ! fraction of ingested N to labile dop
hp_phi_sldop, & ! fraction of ingested N to semi-labile dop
hp_phi_srdop, & ! fraction of ingested N to semi-refractory dop
hp_phi_nh4, & ! fraction of ingested N to nh4 due to ingestion-related metabolism
hp_phi_po4 ! fraction of ingested N to po4 due to ingestion-related metabolism
real, dimension(3) :: total_atm_co2
real :: htotal_scale_lo, htotal_scale_hi, htotal_in
real :: Rho_0, a_0, a_1, a_2, a_3, a_4, a_5, b_0, b_1, b_2, b_3, c_0
real :: a1_co2, a2_co2, a3_co2, a4_co2, a1_o2, a2_o2, a3_o2, a4_o2
logical, dimension(:,:), ALLOCATABLE :: &
mask_z_sat_arag,&
mask_z_sat_calc
real, dimension(:,:,:), ALLOCATABLE :: &
f_alk,& ! Other prognostic variables
f_cadet_arag,&
f_cadet_calc,&
f_dic,&
f_fed,&
f_fedet,&
f_ldon,&
f_ldop,&
f_lith,&
f_lithdet,&
f_ndet,&
f_nh4,&
f_no3,&
f_o2,&
f_pdet,&
f_po4,&
f_srdon,&
f_srdop,&
f_sldon,&
f_sldop,&
f_sidet,&
f_silg,&
f_sio4,&
co3_sol_arag,&
co3_sol_calc,&
f_chl,&
f_co3_ion,&
f_htotal,&
f_irr_mem,&
f_cased,&
f_cadet_arag_btf,&
f_cadet_calc_btf,&
f_fedet_btf, &
f_lithdet_btf, &
f_ndet_btf,&
f_pdet_btf,&
f_sidet_btf,&
jnbact,&
jndi,&
jnsm,&
jnlg,&
jnsmz,&
jnmdz,&
jnlgz,&
jalk,&
jcadet_arag,&
jcadet_calc,&
jdic,&
jfed,&
jfedi,&
jfelg,&
jfesm,&
jfedet,&
jldon,&
jldop,&
jlith,&
jlithdet,&
jndet,&
jnh4,&
jno3,&
jo2,&
jpdet,&
jpo4,&
jsrdon,&
jsrdop,&
jsldon,&
jsldop,&
jsidet,&
jsilg,&
jsio4,&
jprod_ndet,&
jprod_pdet,&
jprod_ldon,&
jprod_ldop,&
jprod_sldon,&
jprod_sldop,&
jprod_srdon,&
jprod_srdop,&
jprod_fedet,&
jprod_fed,&
jprod_sidet,&
jprod_sio4, &
jprod_lithdet,&
jprod_cadet_arag,&
jprod_cadet_calc,&
jprod_nh4,&
jprod_po4,&
det_jzloss_n,&
det_jzloss_p,&
det_jzloss_fe,&
det_jzloss_si,&
det_jhploss_n,&
det_jhploss_p,&
det_jhploss_fe,&
det_jhploss_si,&
jdiss_cadet_arag,&
jdiss_cadet_calc,&
jdiss_sidet,&
jremin_ndet,&
jremin_pdet,&
jremin_fedet,&
jfe_ads,&
jfe_coast,&
kfe_eq_lig,&
expkT,&
hp_temp_lim,&
hp_jingest_n,&
hp_jingest_p,&
hp_jingest_fe,&
hp_jingest_sio2,&
irr_inst,&
irr_mix,&
jno3denit_wc,&
jnitrif,&
omega_arag,&
omega_calc,&
tot_layer_int_c,&
tot_layer_int_fe,&
tot_layer_int_n,&
tot_layer_int_p,&
tot_layer_int_si,&
total_filter_feeding,&
net_prim_prod,&
gross_prim_prod,&
nlg_diatoms,&
q_si_2_n_lg_diatoms,&
zt, &
zm
real, dimension(:,:), ALLOCATABLE :: &
b_alk,b_dic,b_fed,b_nh4,b_no3,b_o2,b_po4,b_sio4,& ! bottom flux terms
co2_csurf,pco2_csurf,co2_alpha,&
fcadet_arag_btm,&
fcadet_calc_btm,&
ffedet_btm,&
flithdet_btm,&
fpdet_btm,&
fndet_btm,&
fsidet_btm,&
fcased_burial,&
fcased_input,&
fcased_redis,&
ffe_sed,&
fnfeso4red_sed,&
fno3denit_sed,&
fnoxic_sed,&
frac_burial,&
fndet_burial,&
fpdet_burial,&
jprod_allphytos_100,&
htotallo, htotalhi,&
hp_jingest_n_100,&
hp_jremin_n_100,&
hp_jprod_ndet_100,&
jprod_lithdet_100,&
jprod_sidet_100,&
jprod_cadet_calc_100,&
jprod_cadet_arag_100,&
jprod_mesozoo_200, &
jremin_ndet_100, &
f_ndet_100, &
f_don_100, &
f_silg_100, &
f_mesozoo_200, &
fndet_100, &
fpdet_100, &
fsidet_100, &
fcadet_calc_100, &
fcadet_arag_100, &
ffedet_100, &
flithdet_100, &
btm_temp, &
btm_o2, &
o2min, &
z_o2min, &
z_sat_arag,&
z_sat_calc
real, dimension(:,:,:,:), pointer :: &
p_alk,&
p_cadet_arag,&
p_cadet_calc,&
p_dic,&
p_fed,&
p_fedi,&
p_felg,&
p_fedet,&
p_fesm,&
p_ldon,&
p_ldop,&
p_lith,&
p_lithdet,&
p_nbact,&
p_ndet,&
p_ndi,&
p_nlg,&
p_nsm,&
p_nh4,&
p_no3,&
p_o2,&
p_pdet,&
p_po4,&
p_srdon,&
p_srdop,&
p_sldon,&
p_sldop,&
p_sidet,&
p_silg,&
p_sio4,&
p_nsmz,&
p_nmdz,&
p_nlgz
real, dimension (:,:), pointer :: &
runoff_flux_alk,&
runoff_flux_dic,&
runoff_flux_lith,&
runoff_flux_fed,&
runoff_flux_no3,&
runoff_flux_ldon,&
runoff_flux_sldon,&
runoff_flux_srdon,&
runoff_flux_ndet,&
runoff_flux_po4,&
runoff_flux_ldop,&
runoff_flux_sldop,&
runoff_flux_srdop,&
dry_fed, wet_fed,&
dry_lith, wet_lith,&
dry_no3, wet_no3,&
dry_nh4, wet_nh4,&
dry_po4, wet_po4
integer :: nkml
character(len=fm_string_len) :: file
character(len=fm_string_len) :: ice_restart_file
character(len=fm_string_len) :: ocean_restart_file,IC_file
integer :: &
id_ndi = -1, &
id_nlg = -1, &
id_nsm = -1, &
id_nsmz = -1, &
id_nmdz = -1, &
id_nlgz = -1, &
id_nbact = -1, &
id_alk = -1, &
id_cadet_arag = -1, &
id_cadet_calc = -1, &
id_dic = -1, &
id_fed = -1, &
id_fedi = -1, &
id_felg = -1, &
id_fesm = -1, &
id_fedet = -1, &
id_ldon = -1, &
id_ldop = -1, &
id_lith = -1, &
id_lithdet = -1, &
id_ndet = -1, &
id_nh4 = -1, &
id_no3 = -1, &
id_o2 = -1, &
id_pdet = -1, &
id_po4 = -1, &
id_srdop = -1, &
id_srdon = -1, &
id_sldon = -1, &
id_sldop = -1, &
id_sidet = -1, &
id_silg = -1, &
id_sio4 = -1, &
id_co3_sol_arag = -1, &
id_co3_sol_calc = -1, &
id_dep_dry_fed = -1, &
id_dep_dry_nh4 = -1, &
id_dep_dry_no3 = -1, &
id_dep_dry_po4 = -1, &
id_dep_wet_fed = -1, &
id_dep_wet_nh4 = -1, &
id_dep_wet_no3 = -1, &
id_dep_wet_po4 = -1, &
id_dep_wet_lith = -1, &
id_dep_dry_lith = -1, &
id_omega_arag = -1, &
id_omega_calc = -1, &
id_chl = -1, &
id_co3_ion = -1, &
id_htotal = -1, &
id_irr_mem = -1, &
id_cased = -1, &
id_cadet_arag_btf = -1, &
id_cadet_calc_btf = -1, &
id_fedet_btf = -1, &
id_lithdet_btf = -1, &
id_ndet_btf = -1, &
id_pdet_btf = -1, &
id_sidet_btf = -1, &
id_jprod_ndet = -1, &
id_jprod_pdet = -1, &
id_jprod_sldon = -1, &
id_jprod_ldon = -1, &
id_jprod_srdon = -1, &
id_jprod_sldop = -1, &
id_jprod_ldop = -1, &
id_jprod_srdop = -1, &
id_jprod_fedet = -1, &
id_jprod_fed = -1, &
id_jprod_sidet = -1, &
id_jprod_sio4 = -1, &
id_jprod_lithdet = -1, &
id_jprod_cadet_arag = -1, &
id_jprod_cadet_calc = -1, &
id_jprod_po4 = -1, &
id_jprod_nh4 = -1, &
id_det_jzloss_n = -1, &
id_det_jzloss_p = -1, &
id_det_jzloss_fe = -1, &
id_det_jzloss_si = -1, &
id_det_jhploss_n = -1, &
id_det_jhploss_p = -1, &
id_det_jhploss_fe = -1, &
id_det_jhploss_si = -1, &
id_jdiss_sidet = -1, &
id_jdiss_cadet_arag = -1, &
id_jdiss_cadet_calc = -1, &
id_jremin_ndet = -1, &
id_jremin_pdet = -1, &
id_jremin_fedet = -1, &
id_jfe_ads = -1, &
id_jfe_coast = -1, &
id_kfe_eq_lig = -1, &
id_expkT = -1, &
id_hp_temp_lim = -1, &
id_hp_jingest_n = -1, &
id_hp_jingest_p = -1, &
id_hp_jingest_fe = -1, &
id_hp_jingest_sio2 = -1, &
id_irr_inst = -1, &
id_irr_mix = -1, &
id_jno3denit_wc = -1, &
id_jnitrif = -1, &
id_co2_csurf = -1, &
id_pco2_csurf = -1, &
id_co2_alpha = -1, &
id_fcadet_arag = -1, &
id_fcadet_calc = -1, &
id_ffedet = -1, &
id_fndet = -1, &
id_fpdet = -1, &
id_fsidet = -1, &
id_flithdet = -1, &
id_fcadet_arag_btm = -1, &
id_fcadet_calc_btm = -1, &
id_ffedet_btm = -1, &
id_flithdet_btm = -1, &
id_fndet_btm = -1, &
id_fpdet_btm = -1, &
id_fsidet_btm = -1, &
id_fcased_burial = -1, &
id_fcased_input = -1, &
id_fcased_redis = -1, &
id_ffe_sed = -1, &
id_fnfeso4red_sed= -1, &
id_fno3denit_sed = -1, &
id_fnoxic_sed = -1, &
id_frac_burial = -1, &
id_fndet_burial = -1, &
id_fpdet_burial = -1, &
id_nphyto_tot = -1, &
id_no3_in_source = -1, &
id_pco2surf = -1, &
id_sfc_alk = -1, &
id_sfc_cadet_arag= -1, &
id_sfc_cadet_calc= -1, &
id_sfc_dic = -1, &
id_sfc_fed = -1, &
id_sfc_ldon = -1, &
id_sfc_sldon = -1, &
id_sfc_srdon = -1, &
id_sfc_no3 = -1, &
id_sfc_nh4 = -1, &
id_sfc_po4 = -1, &
id_sfc_sio4 = -1, &
id_sfc_htotal = -1, &
id_sfc_o2 = -1, &
id_sfc_chl = -1, &
id_sfc_irr = -1, &
id_sfc_irr_mem = -1, &
id_sfc_temp = -1, &
id_btm_temp = -1, &
id_btm_o2 = -1, &
id_sfc_co3_ion = -1, &
id_sfc_co3_sol_arag = -1, &
id_sfc_co3_sol_calc = -1, &
id_runoff_flux_alk = -1, &
id_runoff_flux_dic = -1, &
id_runoff_flux_fed = -1, &
id_runoff_flux_lith = -1, &
id_runoff_flux_no3 = -1, &
id_runoff_flux_ldon = -1, &
id_runoff_flux_sldon = -1, &
id_runoff_flux_srdon = -1, &
id_runoff_flux_ndet = -1, &
id_runoff_flux_po4 = -1, &
id_runoff_flux_ldop = -1, &
id_runoff_flux_sldop = -1, &
id_runoff_flux_srdop = -1, &
id_tot_layer_int_c = -1, &
id_tot_layer_int_fe = -1, &
id_tot_layer_int_n = -1, &
id_tot_layer_int_p = -1, &
id_tot_layer_int_si = -1, &
id_total_filter_feeding = -1,&
id_net_prim_prod = -1, &
id_gross_prim_prod = -1, &
id_nlg_diatoms = -1, &
id_jprod_allphytos_100 = -1, &
id_q_si_2_n_lg_diatoms = -1, &
id_hp_jingest_n_100 = -1, &
id_hp_jremin_n_100 = -1, &
id_hp_jprod_ndet_100 = -1, &
id_jprod_lithdet_100 = -1, &
id_jprod_sidet_100 = -1, &
id_jprod_cadet_calc_100 = -1, &
id_jprod_cadet_arag_100 = -1, &
id_jprod_mesozoo_200 = -1, &
id_jremin_ndet_100 = -1, &
id_f_ndet_100 = -1, &
id_f_don_100 = -1, &
id_f_silg_100 = -1, &
id_f_mesozoo_200 = -1, &
id_fndet_100 = -1, &
id_fpdet_100 = -1, &
id_ffedet_100 = -1, &
id_fcadet_calc_100 = -1, &
id_fcadet_arag_100 = -1, &
id_flithdet_100 = -1, &
id_fsidet_100 = -1, &
id_o2min = -1, &
id_z_o2min = -1, &
id_z_sat_arag = -1, & ! Depth of Aragonite saturation
id_z_sat_calc = -1 ! Depth of Calcite saturation
end type generic_COBALT_type
!An auxiliary type for storing varible names
type, public :: vardesc
character(len=fm_string_len) :: name ! The variable name in a NetCDF file.
character(len=fm_string_len) :: longname ! The long name of that variable.
character(len=1) :: hor_grid ! The hor. grid: u, v, h, q, or 1.
character(len=1) :: z_grid ! The vert. grid: L, i, or 1.
character(len=1) :: t_grid ! The time description: s, a, m, or 1.
character(len=fm_string_len) :: units ! The dimensions of the variable.
character(len=1) :: mem_size ! The size in memory: d or f.