-
Notifications
You must be signed in to change notification settings - Fork 26
/
marbl_settings_mod.F90
3210 lines (2745 loc) · 153 KB
/
marbl_settings_mod.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
module marbl_settings_mod
!-----------------------------------------------------------------------------
! This module manages BGC-specific parameters.
!
! Most of the variables are not parameters in the Fortran sense. In the
! the Fortran sense, they are vanilla module variables that can be set
! by marbl_instance%put_setting() calls from the GCM.
!
! In addition to containing all the parameters, this module also handles
! initializing the variables to default values and then applying any
! changes made via put_setting().
!
! This module also writes parameter values to the status log.
!-----------------------------------------------------------------------------
use marbl_kinds_mod, only : r8
use marbl_kinds_mod, only : int_kind
use marbl_kinds_mod, only : log_kind
use marbl_kinds_mod, only : char_len
use marbl_constants_mod, only : c0
use marbl_constants_mod, only : c1
use marbl_constants_mod, only : c2
use marbl_constants_mod, only : c1000
use marbl_constants_mod, only : dps
use marbl_constants_mod, only : molw_Fe
use marbl_pft_mod, only : autotroph_settings_type
use marbl_pft_mod, only : zooplankton_settings_type
use marbl_pft_mod, only : grazing_relationship_settings_type
use marbl_logging, only: marbl_log_type
implicit none
!-----------------------------------------------------------------------------
! public/private declarations
! all module variables are public and should have their values preserved
!-----------------------------------------------------------------------------
public
save
!---------------------------------------------------------------------------
! Derived type for tracking unit system
!---------------------------------------------------------------------------
type, public :: unit_system_type
character(len=3) :: unit_system ! Name of unit system ('cgs' or 'mks')
character(len=2) :: L ! Standard unit of length ('cm' or 'm')
character(len=2) :: M ! Standard unit of mass ('g' or 'kg')
character(len=12) :: conc_units ! Standard unit of concentration
character(len=12) :: conc_flux_units ! Standard unit of concentration flux
character(len=12) :: conc_tend_units ! Standard unit of concentration tendency
character(len=12) :: alk_conc_units ! Standard unit of concentration for alkalinity
character(len=12) :: alk_conc_flux_units ! Standard unit of concentration flux for alkalinity
character(len=12) :: alk_conc_tend_units ! Standard unit of concentration tendency for alkalinity
real(r8) :: mass2g ! g / M (converts from model mass M -> grams)
real(r8) :: g2mass ! M / g (converts from grams -> model mass M)
real(r8) :: mass2kg ! kg / M (converts from model mass M -> kilograms)
real(r8) :: cm2len ! L / cm (converts from cm -> model length L)
real(r8) :: len2cm ! cm / L (converts from model length L -> cm)
real(r8) :: m2len ! L / m (converts from m -> model length L)
real(r8) :: len2m ! m / L (converts from model length L -> m)
real(r8) :: mol_prefix ! convert mol -> nmol, mmol, etc (get correct metric prefix)
real(r8) :: nmol2mol_prefix ! convert nmol -> nmol, mmol, etc
real(r8) :: conc_flux2nmol_cm2s ! L^2/cm^2 * nano[]/mol_prefix[] (converts from mol_prefix/L^2/s -> nmol/cm^2/s)
real(r8) :: conc_flux2mmol_m2s ! L^2/m^2 * milli[]/mol_prefix[] (converts from mol_prefix/L^2/s -> mmol/m^2/s)
contains
procedure :: set => set_unit_system
end type unit_system_type
!---------------------------------------------------------------------------
! Datatypes for marbl_instance%settings
!---------------------------------------------------------------------------
type, private :: marbl_single_setting_ll_type
! Metadata
character(len=char_len) :: long_name
character(len=char_len) :: short_name
character(len=char_len) :: units
character(len=char_len) :: datatype
integer :: category_ind ! used for sorting output list
character(len=char_len) :: comment ! used to add comment in log
type(marbl_single_setting_ll_type), pointer :: next => NULL()
! Actual parameter data
real(r8), pointer :: rptr => NULL()
integer(int_kind), pointer :: iptr => NULL()
logical(log_kind), pointer :: lptr => NULL()
character(len=char_len), pointer :: sptr => NULL()
end type marbl_single_setting_ll_type
type, private :: marbl_setting_ptr
type(marbl_single_setting_ll_type), pointer :: ptr => NULL()
end type marbl_setting_ptr
type, public :: marbl_settings_type
logical, private :: init_called = .false.
integer, private :: cnt = 0
character(len=char_len), dimension(:), private, pointer :: categories
type(marbl_single_setting_ll_type), private, pointer :: vars => NULL()
type(marbl_single_setting_ll_type), private, pointer :: VarsFromPut => NULL()
type(marbl_single_setting_ll_type), private, pointer :: LastVarFromPut => NULL()
type(marbl_setting_ptr), dimension(:), private, allocatable :: varArray
contains
procedure :: add_var
procedure :: add_var_1d_r8
procedure :: add_var_1d_int
procedure :: add_var_1d_str
procedure :: finalize_vars
procedure :: inquire_id
procedure :: inquire_metadata
procedure :: get_cnt
procedure :: put
procedure :: get
procedure :: destruct
end type marbl_settings_type
!---------------------------------------------------------------------
! BGC parameters that are currently hard-coded
!---------------------------------------------------------------------
real(r8), parameter :: &
Q_10 = 1.7_r8, & ! factor for temperature dependence (non-dim)
parm_Red_D_C_P = 117.0_r8, & ! carbon:phosphorus
parm_Red_D_N_P = 16.0_r8, & ! nitrogen:phosphorus
parm_Red_D_O2_P = 170.0_r8, & ! oxygen:phosphorus
parm_Remin_D_O2_P = 138.0_r8, & ! oxygen:phosphorus
parm_Red_P_C_P = parm_Red_D_C_P, & ! carbon:phosphorus
parm_Red_D_C_N = parm_Red_D_C_P/parm_Red_D_N_P, & ! carbon:nitrogen
parm_Red_P_C_N = parm_Red_D_C_N, & ! carbon:nitrogen
parm_Red_D_C_O2 = parm_Red_D_C_P/parm_Red_D_O2_P, & ! carbon:oxygen
parm_Remin_D_C_O2 = parm_Red_D_C_P/parm_Remin_D_O2_P, & ! carbon:oxygen
parm_Red_P_C_O2 = parm_Red_D_C_O2, & ! carbon:oxygen
parm_Red_Fe_C = 3.0e-6_r8, & ! iron:carbon
parm_Red_D_C_O2_diaz = parm_Red_D_C_P/150.0_r8 ! carbon:oxygen
! for diazotrophs
! parameters related to Iron binding ligands
integer (int_kind), parameter :: Lig_cnt = 1 ! valid values are 1 or 2
real(r8), parameter :: remin_to_Lig = 0.0001_r8
! Partitioning of phytoplankton growth, grazing and losses
! All f_* variables are fractions and are non-dimensional
real(r8), parameter :: &
caco3_poc_min = 0.40_r8, & ! minimum proportionality between
! QCaCO3 and grazing losses to POC
! (mmol C/mmol CaCO3)
spc_poc_fac = 0.13_r8, & ! small phyto grazing factor (1/mmolC)
f_graze_sp_poc_lim = 0.36_r8, &
f_photosp_CaCO3 = 0.40_r8, & ! proportionality between small phyto
! production and CaCO3 production
f_graze_si_remin = 0.50_r8, & ! fraction of diatom Si grazing which is remin
f_toDON = 0.70_r8, & ! fraction DON relative to DOC
f_toDOP = 0.15_r8 ! fraction of remaining_P to DOP
! fixed ratios
real(r8), parameter :: r_Nfix_photo=1.25_r8 ! N fix relative to C fix (non-dim)
! SET parameters and RATIOS for N/C, P/C, SiO3/C, Fe/C, etc...
real(r8), parameter :: &
Q = 16.0_r8 / 117.0_r8, & ! N/C ratio (mmol/mmol) of phyto & zoo
Qfe_zoo = 3.0e-6_r8, & ! zooplankton Fe/C ratio
! parameters in GalbraithMartiny Pquota Model
PquotaSlope = 7.0_r8, &
PquotaIntercept = 5.571_r8, &
PquotaMinNP = 0.00854701_r8, &
! carbon:nitrogen ratio for denitrification
denitrif_C_N = parm_Red_D_C_P/136.0_r8
! loss term threshold parameters, chl:c ratios
real(r8), parameter :: &
CaCO3_temp_thres1 = 4.0_r8, & ! upper temp threshold for CaCO3 prod
CaCO3_temp_thres2 = -2.0_r8, & ! lower temp threshold
CaCO3_sp_thres = 2.5_r8 ! bloom condition thres (mmolC/m3)
! fraction of incoming shortwave assumed to be PAR
real(r8), parameter :: f_qsw_par = 0.45_r8 ! PAR fraction
! DOM parameters for refractory components and DOP uptake
real(r8), parameter :: &
DOC_reminR_light = (c1/(365.0_r8*15.0_r8)) * dps, & ! remin rate for semi-labile DOC, 1/15yr
DON_reminR_light = (c1/(365.0_r8*15.0_r8)) * dps, & ! remin rate for semi-labile DON, 1/15yr
DOP_reminR_light = (c1/(365.0_r8*60.0_r8)) * dps, & ! remin rate for semi-labile DOP, 1/60yr
DOC_reminR_dark = (c1/(365.0_r8*6.0_r8)) * dps, & ! remin rate in the dark, 1/6yr
DON_reminR_dark = (c1/(365.0_r8*5.5_r8)) * dps, & ! remin rate in the dark, 1/5.5yr
DOP_reminR_dark = (c1/(365.0_r8*4.5_r8)) * dps ! remin rate in the dark, 1/4.5yr
real(r8), parameter :: &
DOCr_reminR0 = (c1/(365.0_r8*16000.0_r8)) * dps, & ! remin rate for refractory DOC, 1/16000yr
DONr_reminR0 = (c1/(365.0_r8*9500.0_r8)) * dps, & ! remin rate for refractory DON, 1/9500yr
DOPr_reminR0 = (c1/(365.0_r8*5500.0_r8)) * dps, & ! remin rate for refractory DOP, 1/5500yr
DOMr_reminR_photo = (c1/(365.0_r8*18.0_r8)) * dps ! additional remin from photochemistry, 1/18yrs over top 10m
real(r8), parameter :: &
DOCprod_refract = 0.01_r8, & ! fraction of DOCprod to refractory pool
DONprod_refract = 0.0115_r8, & ! fraction of DONprod to refractory pool
DOPprod_refract = 0.003_r8, & ! fraction of DOPprod to refractory pool
POCremin_refract = DOCprod_refract * 0.06_r8, & ! fraction of POCremin to refractory pool
PONremin_refract = DONprod_refract * 0.03_r8, & ! fraction of POCremin to refractory pool
POPremin_refract = DOPprod_refract * 0.06_r8 ! fraction of POCremin to refractory pool
! pH parameters
real (r8), parameter :: phlo_surf_init = 7.0_r8 ! low bound for surface ph for no prev soln
real (r8), parameter :: phhi_surf_init = 9.0_r8 ! high bound for surface ph for no prev soln
real (r8), parameter :: phlo_3d_init = 6.0_r8 ! low bound for subsurface ph for no prev soln
real (r8), parameter :: phhi_3d_init = 9.0_r8 ! high bound for subsurface ph for no prev soln
real (r8), parameter :: del_ph = 0.20_r8 ! delta-ph for prev soln
!---------------------------------------------------------------------
! BGC parameters that are currently hard-coded but can not be
! fortran parameters because they depend on unit system
! Values are determined in set_unit_system()
!---------------------------------------------------------------------
real(r8) :: xkw_coeff, & ! correct value from Wannikhof 2014 is 0.251 cm/hr s^2/m^2 (s/L)
thres_z1_auto, & ! autotroph threshold = C_loss_thres for z shallower than this (L)
thres_z2_auto, & ! autotroph threshold = 0 for z deeper than this (L)
thres_z1_zoo, & ! zooplankton threshold = C_loss_thres for z shallower than this (L)
thres_z2_zoo, & ! zooplankton threshold = 0 for z deeper than this (L)
dust_Fe_scavenge_scale, & !dust scavenging scale factor
dust_to_Fe
!---------------------------------------------------------------------------------------------
! Variables defined in marbl_settings_define_general_parms, marbl_settings_define_PFT_counts,
! marbl_settings_define_PFT_derived_types, or marbl_settings_define_tracer_dependent
!
! CESM NOTE: defaults values are set in the corresponding marbl_settings_set_defaults routines
! but may be overridden at run time through a put_setting() call (use user_nl_pop
! to change parameter value)
!---------------------------------------------------------------------------------------------
! marbl_settings_mod_general_parms
! parameters with no dependencies on other parameter values
!-------------------------------------------------------------
character(len=char_len), target :: PFT_defaults ! Set up PFT parameters based on known classes, e.g. 'CESM2'
! (or set to 'user-specified' and use put_setting())
logical(log_kind), target :: base_bio_on ! control whether base tracer module is active
logical(log_kind), target :: abio_dic_on ! control whether abio tracer module is active
logical(log_kind), target :: ciso_on ! control whether ciso tracer module is active
logical(log_kind), target :: lsource_sink ! control which portion of code is executed, useful for debugging
logical(log_kind), target :: ciso_lsource_sink ! control which portion of carbon isotope code is executed, useful for debugging
logical(log_kind), target :: lcheck_forcing ! control whether consistency checks are performed on forcing input
logical(log_kind), target :: lecovars_full_depth_tavg ! If .false., MARBL will recommend truncating the column for some diagnostics
logical(log_kind), target :: lflux_gas_o2 ! controls which portion of code are executed useful for debugging
logical(log_kind), target :: lflux_gas_co2 ! controls which portion of code are executed useful for debugging
logical(log_kind), target :: lcompute_nhx_surface_emis ! control if NHx emissions are computed
logical(log_kind), target :: lvariable_PtoC ! control if PtoC ratios in autotroph_settings vary
logical(log_kind), target :: ladjust_bury_coeff ! control if bury coefficients are adjusted (rather than constant)
! bury coefficients (POC_bury_coeff, POP_bury_coeff, bSi_bury_coeff)
! reside in marbl_particulate_share_type; when ladjust_bury_coeff is
! .true., bury coefficients are adjusted to preserve C, P, Si
! inventories on timescales exceeding bury_coeff_rmean_timescale_years
! (this is done primarily in spinup runs)
logical(log_kind), target :: lo2_consumption_scalef ! Apply o2_consumption_scalef to o2 consumption (and request it as a forcing)
logical(log_kind), target :: lp_remin_scalef ! Apply p_remin_scalef to particulate remin (and request it as a forcing)
logical(log_kind), target :: labio_derivative_diags ! Compute derivative diagnostic terms in abiotic surface flux module
character(len=char_len), target :: init_bury_coeff_opt
real(r8), target :: &
particulate_flux_ref_depth, & ! reference depth for particulate flux diagnostics (L)
bftt_dz_sum_thres, & ! MARBL will abort if abs(1 - sum(bot_flux_to_tend)) exceeds this threshold
Jint_Ctot_thres_molpm2pyr, & ! MARBL will abort if abs(Jint_Ctot) exceeds this threshold
Jint_Ctot_thres, & ! MARBL will abort if abs(Jint_Ctot) exceeds this threshold (derived from Jint_Ctot_thres_molpm2pyr)
Jint_Ntot_thres, & ! MARBL will abort if abs(Jint_Ntot) exceeds this threshold (derived from Jint_Ctot_thres)
Jint_Ptot_thres, & ! MARBL will abort if abs(Jint_Ptot) exceeds this threshold (derived from Jint_Ctot_thres)
Jint_Sitot_thres, & ! MARBL will abort if abs(Jint_Sitot) exceeds this threshold (derived from Jint_Ctot_thres)
Jint_Fetot_thres, & ! MARBL will abort if abs(Jint_Fetot) exceeds this threshold (derived from Jint_Ctot_thres)
CISO_Jint_13Ctot_thres, & ! MARBL will abort if abs(CISO_Jint_13Ctot) exceeds this threshold (derived from Jint_Ctot_thres)
CISO_Jint_14Ctot_thres, & ! MARBL will abort if abs(CISO_Jint_14Ctot) exceeds this threshold (derived from Jint_Ctot_thres)
gQsi_0, & ! initial Si/C ratio for growth
gQsi_max, & ! max Si/C ratio for growth
gQsi_min, & ! min Si/C ratio for growth
gQ_Fe_kFe_thres, & ! Fe:kFe ratio threshold in uptake ratio computations
gQ_Si_kSi_thres, & ! Si:kSi ratio threshold in uptake ratio computations
parm_Fe_bioavail, & ! fraction of Fe flux that is bioavailable
parm_o2_min, & ! min O2 needed for prod & consump. (nmol/cm^3)
parm_o2_min_delta, & ! width of min O2 range (nmol/cm^3)
parm_kappa_nitrif_per_day, & ! nitrification inverse time constant (1/day)
parm_kappa_nitrif, & ! nitrification inverse time constant (1/sec) (derived from parm_kappa_nitrif_per_day)
parm_nitrif_par_lim, & ! PAR limit for nitrif. (W/m^2)
parm_labile_ratio, & ! fraction of loss to DOC that routed directly to DIC (non-dimensional)
parm_init_POC_bury_coeff, & ! initial scale factor for burial of POC, PON
parm_init_POP_bury_coeff, & ! initial scale factor for burial of POP
parm_init_bSi_bury_coeff, & ! initial scale factor burial of bSi
parm_Fe_scavenge_rate0, & ! scavenging base rate for Fe (cm^2/ng s/yr)
parm_Lig_scavenge_rate0, & ! scavenging base rate for bound ligand (cm^2/ng s/yr)
parm_FeLig_scavenge_rate0, & ! scavenging base rate for bound iron (cm^2/ng s/yr)
parm_Fe_scavenge_rate0_yps, & ! parm_Fe_scavenge_rate0 * yps (cm^2/ng)
parm_Lig_scavenge_rate0_yps, & ! parm_Lig_scavenge_rate0 * yps (cm^2/ng)
parm_FeLig_scavenge_rate0_yps, & ! parm_FeLig_scavenge_rate0 * yps (cm^2/ng)
parm_Lig_degrade_rate0, & ! Fe-binding ligand bacterial degradation base rate coefficient
parm_Fe_desorption_rate0, & ! desorption rate for scavenged Fe from particles
parm_f_prod_sp_CaCO3, & ! fraction of sp prod. as CaCO3 prod.
parm_POC_diss, & ! base POC diss len scale
parm_SiO2_diss, & ! base SiO2 diss len scale
parm_SiO2_gamma, & ! SiO2 gamma (fraction of production -> hard subclass)
parm_hPOC_SiO2_ratio, & ! hPOC to SiO2 ratio
parm_CaCO3_diss, & ! base CaCO3 diss len scale
parm_CaCO3_gamma, & ! CaCO3 gamma (fraction of production -> hard subclass)
parm_hPOC_CaCO3_ratio, & ! hPOC to CaCO3 ratio
parm_hPOC_dust_ratio, & ! hPOC to dust ratio
o2_sf_o2_range_hi, & ! o2_scalefactor is applied to diss length scales for O2 less than this
o2_sf_o2_range_lo, & ! o2_scalefactor is constant for O2 less than this
o2_sf_val_lo_o2, & ! o2_scalefactor constant for O2 less than o2_sf_o2_range_lo
parm_sed_denitrif_coeff, & ! global scaling factor for sed_denitrif
auto_mort2_exp, & ! Value of power loss exponent for autotrophs
zoo_mort2_exp, & ! Value of power loss exponent for zooplankton
QCaCO3_max, & ! Max CaCO3/C ratio for calcifiers
f_graze_CaCO3_remin, & ! Fraction of spCaCO3 grazing which is remineralized in zooplankton guts
bury_coeff_rmean_timescale_years
real(r8), dimension(4), target :: &
parm_scalelen_z, & ! depths of prescribed scalelen values
parm_scalelen_vals ! prescribed scalelen values
character(len=char_len), target :: caco3_bury_thres_opt ! option of threshold of caco3 burial ['fixed_depth', 'omega_calc']
real(r8), target :: caco3_bury_thres_depth ! threshold depth for caco3_bury_thres_opt='fixed_depth'
real(r8), target :: caco3_bury_thres_omega_calc ! omega calcite threshold for caco3_bury_thres_opt='omega_calc'
! -----------
! PON_sed_loss = PON_bury_coeff * Q * POC_sed_loss
! factor is used to avoid overburying PON like POC
! is when total C burial is matched to C riverine input
! -----------
real(r8), target :: PON_bury_coeff
real(r8), target :: POM_bury_frac_max
real(r8), target :: bSi_bury_frac_max
character(len=char_len), target :: ciso_fract_factors ! option for which biological fractionation calculation to use
! marbl_settings_define_PFT_counts
! Parameters determining array size for PFT derived types
! (can not be set until PFT_defaults is set)
!-------------------------------------------------------------
integer(int_kind), target :: autotroph_cnt ! number of autotroph classes
integer(int_kind), target :: zooplankton_cnt ! number of zooplankton classes
integer(int_kind), target :: max_grazer_prey_cnt ! max number of biomass aggregates grazed by a zooplankton class
! marbl_settings_define_PFT_derived_types
! Parameters associated with the PFT classes
! (can not be set until autotroph_cnt, zooplankton_cnt
! are max_grazer_prey_cnt are known)
!-------------------------------------------------------------
type(autotroph_settings_type), allocatable, target :: autotroph_settings(:)
type(zooplankton_settings_type), allocatable, target :: zooplankton_settings(:)
type(grazing_relationship_settings_type), allocatable, target :: grazing_relationship_settings(:,:)
! marbl_settings_define_tracer_dependent
! parameters that can not be set until MARBL knows what tracers
! have been enabled.
! Currently just tracer_restore_vars (which has dimension of
! tracer_cnt; also, only valid values are tracer short names)
!-----------------------------------------------------------------
! FIXME #69: this array is allocated in marbl_init_mod:marbl_init_tracers()
! and that allocation is not ideal for threaded runs
character(len=char_len), allocatable, target, dimension(:) :: tracer_restore_vars
!---------------------------------------------------------------------
! Auxiliary variables (str -> int conversions, indices, etc)
!---------------------------------------------------------------------
integer (int_kind) :: caco3_bury_thres_iopt
integer (int_kind), parameter :: caco3_bury_thres_iopt_fixed_depth = 1
integer (int_kind), parameter :: caco3_bury_thres_iopt_omega_calc = 2
integer (int_kind), parameter :: temp_func_form_iopt_q10 = 1
integer (int_kind), parameter :: temp_func_form_iopt_arrhenius = 2
integer (int_kind), parameter :: temp_func_form_iopt_power = 3
!*****************************************************************************
interface print_single_derived_parm
module procedure print_single_derived_parm_r8
module procedure print_single_derived_parm_int
end interface print_single_derived_parm
! Functions only used in this module
private :: add_var
private :: add_var_1d_r8
private :: add_var_1d_int
private :: add_var_1d_str
private :: finalize_vars
private :: put
private :: get
private :: get_cnt
private :: inquire_id
private :: inquire_metadata
private :: check_and_log_add_var_error
private :: case_insensitive_eq
private :: print_single_derived_parm
private :: print_single_derived_parm_r8
private :: print_single_derived_parm_int
contains
!*****************************************************************************
subroutine marbl_settings_set_defaults_tracer_modules()
base_bio_on = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
abio_dic_on = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
ciso_on = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
end subroutine marbl_settings_set_defaults_tracer_modules
!*****************************************************************************
subroutine marbl_settings_set_defaults_general_parms(unit_system)
type(unit_system_type), intent(in) :: unit_system
PFT_defaults = 'CESM2' ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lsource_sink = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
ciso_lsource_sink = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lcheck_forcing = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lecovars_full_depth_tavg = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lflux_gas_o2 = base_bio_on ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lflux_gas_co2 = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lcompute_nhx_surface_emis = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lvariable_PtoC = .true. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
init_bury_coeff_opt = 'settings_file' ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
ladjust_bury_coeff = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lo2_consumption_scalef = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
lp_remin_scalef = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
labio_derivative_diags = .false. ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
particulate_flux_ref_depth = 100._r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
bftt_dz_sum_thres = 1.0e-14_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
Jint_Ctot_thres_molpm2pyr = 1.0e-9_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
gQsi_0 = 0.137_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
gQsi_max = 0.822_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
gQsi_min = 0.0457_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
gQ_Fe_kFe_thres = 10.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
gQ_Si_kSi_thres = 6.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_Fe_bioavail = 1.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_o2_min = 5.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_o2_min_delta = 5.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_kappa_nitrif_per_day = 0.06_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_nitrif_par_lim = 1.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_labile_ratio = 0.94_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_init_POC_bury_coeff = 2.54_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_init_POP_bury_coeff = 0.36_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_init_bSi_bury_coeff = 1.53_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_Fe_scavenge_rate0 = 22.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_Lig_scavenge_rate0 = 0.015_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_FeLig_scavenge_rate0 = 1.2_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_Lig_degrade_rate0 = 0.000094_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_Fe_desorption_rate0 = 1.0e-6_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_f_prod_sp_CaCO3 = 0.070_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_POC_diss = 100.0e2_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_SiO2_diss = 650.0e2_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_SiO2_gamma = 0.00_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_hPOC_SiO2_ratio = 0.01_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_CaCO3_diss = 500.0e2_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_CaCO3_gamma = 0.02_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_hPOC_CaCO3_ratio = 0.01_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_hPOC_dust_ratio = 0.01_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
o2_sf_o2_range_hi = 45.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
o2_sf_o2_range_lo = 5.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
o2_sf_val_lo_o2 = 2.6_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_sed_denitrif_coeff = 1.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
bury_coeff_rmean_timescale_years = 10.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_scalelen_z = (/ 100.0e2_r8, 250.0e2_r8, 500.0e2_r8, 1000.0e2_r8 /) ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
parm_scalelen_vals = (/ 1.0_r8, 3.6_r8, 4.7_r8, 4.8_r8 /) ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
caco3_bury_thres_opt = 'omega_calc' ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
caco3_bury_thres_depth = 3000.0e2_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
caco3_bury_thres_omega_calc = 0.89_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
PON_bury_coeff = 0.5_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
POM_bury_frac_max = 0.8_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
bSi_bury_frac_max = 1.0_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
ciso_fract_factors = 'Laws' ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
auto_mort2_exp = 1.75_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
zoo_mort2_exp = 1.5_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
QCaCO3_max = 0.40_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
f_graze_CaCO3_remin = 0.33_r8 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
! Variables that change depending on unit system
parm_POC_diss = parm_POC_diss * unit_system%cm2len ! cm -> m in mks
parm_SiO2_diss = parm_SiO2_diss * unit_system%cm2len ! cm -> m in mks
parm_CaCO3_diss = parm_CaCO3_diss * unit_system%cm2len ! cm -> m in mks
parm_scalelen_z(:) = parm_scalelen_z(:) * unit_system%cm2len ! cm -> m in mks
caco3_bury_thres_depth = caco3_bury_thres_depth * unit_system%cm2len ! cm -> m in mks
parm_Fe_desorption_rate0 = parm_Fe_desorption_rate0 * unit_system%len2cm ! 1/cm -> 1/m in mks
particulate_flux_ref_depth = particulate_flux_ref_depth * unit_system%m2len ! in m because it used to be integer used to define FLUX_100m
parm_Fe_scavenge_rate0 = parm_Fe_scavenge_rate0 * unit_system%conc_flux2nmol_cm2s ! cm^2/ng s/yr -> m^2/mg s/yr in mks
parm_Lig_scavenge_rate0 = parm_Lig_scavenge_rate0 * unit_system%conc_flux2nmol_cm2s ! cm^2/ng s/yr -> m^2/mg s/yr in mks
parm_FeLig_scavenge_rate0 = parm_FeLig_scavenge_rate0 * unit_system%conc_flux2nmol_cm2s ! cm^2/ng s/yr -> m^2/mg s/yr in mks
end subroutine marbl_settings_set_defaults_general_parms
!*****************************************************************************
subroutine marbl_settings_set_defaults_PFT_counts(marbl_status_log)
type(marbl_log_type), intent(inout) :: marbl_status_log
character(len=*), parameter :: subname = 'marbl_settings_mod:marbl_settings_set_defaults_PFT_counts'
character(len=char_len) :: log_message
if ((trim(PFT_defaults) .eq. 'CESM2+cocco') .or. (trim(PFT_defaults) .eq. '4p2z')) then
write(log_message, '(3A)') 'PFT_defaults = "', trim(PFT_defaults), &
'" in input file, but being treated as "user-specified"'
call marbl_status_log%log_noerror(log_message, subname)
PFT_defaults = 'user-specified'
end if
if (.not. base_bio_on) then
PFT_defaults = 'None'
autotroph_cnt = 0
zooplankton_cnt = 0
max_grazer_prey_cnt = 0
else
select case (trim(PFT_defaults))
case ('CESM2')
autotroph_cnt = 3
zooplankton_cnt = 1
max_grazer_prey_cnt = 3
case ('user-specified')
! User must change these with put_setting()
autotroph_cnt = -1 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
zooplankton_cnt = -1 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
max_grazer_prey_cnt = -1 ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
case DEFAULT
write(log_message, "(3A)") "'", trim(PFT_defaults), "' is not a valid value for PFT_defaults"
call marbl_status_log%log_error(log_message, subname)
end select
end if
end subroutine marbl_settings_set_defaults_PFT_counts
!*****************************************************************************
subroutine marbl_settings_set_defaults_PFT_derived_types(marbl_status_log)
type(marbl_log_type), intent(inout) :: marbl_status_log
character(len=*), parameter :: subname = 'marbl_settings_mod:marbl_settings_set_defaults_PFT_derived_types'
character(len=char_len) :: log_message
integer :: m, n
if (.not. all((/allocated(autotroph_settings), &
allocated(zooplankton_settings), &
allocated(grazing_relationship_settings)/))) then
write(log_message, '(A)') 'One of {autotroph,zooplankton,grazing_relationship}_settings has not been allocated!'
call marbl_status_log%log_error(log_message, subname)
return
end if
select case (trim(PFT_defaults))
case ('CESM2')
call autotroph_settings(1)%set_to_default('sp', marbl_status_log)
call autotroph_settings(2)%set_to_default('diat', marbl_status_log)
call autotroph_settings(3)%set_to_default('diaz', marbl_status_log)
call zooplankton_settings(1)%set_to_default('zoo', marbl_status_log)
call grazing_relationship_settings(1,1)%set_to_default('sp_zoo', marbl_status_log)
call grazing_relationship_settings(2,1)%set_to_default('diat_zoo', marbl_status_log)
call grazing_relationship_settings(3,1)%set_to_default('diaz_zoo', marbl_status_log)
case ('None')
case ('user-specified')
do m=1,autotroph_cnt
call autotroph_settings(m)%set_to_default('unset', marbl_status_log)
end do
do n=1,zooplankton_cnt
call zooplankton_settings(n)%set_to_default('unset', marbl_status_log)
end do
do n=1,zooplankton_cnt
do m=1,max_grazer_prey_cnt
call grazing_relationship_settings(m,n)%set_to_default('unset', marbl_status_log)
end do
end do
case DEFAULT
write(log_message, "(3A)") "'", trim(PFT_defaults), "' is not a valid value for PFT_defaults"
call marbl_status_log%log_error(log_message, subname)
return
end select
if (marbl_status_log%labort_marbl) then
call marbl_status_log%log_error_trace('PFT set_to_default()', subname)
return
end if
end subroutine marbl_settings_set_defaults_PFT_derived_types
!*****************************************************************************
subroutine marbl_settings_set_defaults_tracer_dependent(marbl_status_log)
type(marbl_log_type), intent(inout) :: marbl_status_log
character(len=*), parameter :: subname = 'marbl_settings_mod:marbl_settings_set_defaults_tracer_dependent'
if (.not. allocated(tracer_restore_vars)) then
call marbl_status_log%log_error('tracer_restore_vars has not been allocated!', subname)
return
end if
! initialize namelist variables to default values
tracer_restore_vars = '' ! CESM USERS - DO NOT CHANGE HERE! POP calls put_setting() for this var, see CESM NOTE above
end subroutine marbl_settings_set_defaults_tracer_dependent
!*****************************************************************************
subroutine marbl_settings_define_tracer_modules(this, marbl_status_log)
class(marbl_settings_type), intent(inout) :: this
type(marbl_log_type), intent(inout) :: marbl_status_log
character(len=*), parameter :: subname = 'marbl_settings_mod:marbl_settings_define_general_parms'
character(len=char_len) :: log_message
character(len=char_len) :: sname, lname, units, datatype, category
logical(log_kind), pointer :: lptr => NULL()
logical :: labort_marbl_loc
if (associated(this%vars)) then
write(log_message, "(A)") "this%settings has been constructed already"
call marbl_status_log%log_error(log_message, subname)
return
end if
allocate(this%categories(0))
labort_marbl_loc = .false.
! -----------------------
category = 'tracer modules'
! -----------------------
sname = 'base_bio_on'
lname = 'Control whether base tracer module is active'
units = 'unitless'
datatype = 'logical'
lptr => base_bio_on
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'abio_dic_on'
lname = 'Control whether abiotic tracer module is active'
units = 'unitless'
datatype = 'logical'
lptr => abio_dic_on
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'ciso_on'
lname = 'Control whether CISO tracer module is active'
units = 'unitless'
datatype = 'logical'
lptr => ciso_on
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
end subroutine marbl_settings_define_tracer_modules
!*****************************************************************************
subroutine marbl_settings_define_general_parms(this, marbl_status_log)
class(marbl_settings_type), intent(inout) :: this
type(marbl_log_type), intent(inout) :: marbl_status_log
character(len=*), parameter :: subname = 'marbl_settings_mod:marbl_settings_define_general_parms'
character(len=char_len) :: sname, lname, units, datatype, category
real(r8), pointer :: rptr => NULL()
logical(log_kind), pointer :: lptr => NULL()
character(len=char_len), pointer :: sptr => NULL()
logical :: labort_marbl_loc
labort_marbl_loc = .false.
if (base_bio_on) then
! ----------------------
category = 'config PFTs'
! ----------------------
sname = 'PFT_defaults'
lname = 'Define how PFTs are initialized'
units = 'unitless'
datatype = 'string'
sptr => PFT_defaults
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, sptr=sptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
end if
! -----------------------
category = 'config flags'
! -----------------------
sname = 'lsource_sink'
lname = 'Control which portions of code are executed (useful for debugging)'
units = 'unitless'
datatype = 'logical'
lptr => lsource_sink
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lecovars_full_depth_tavg'
lname = 'If .false., MARBL will recommend truncating the column for some diagnostics'
units = 'unitless'
datatype = 'logical'
lptr => lecovars_full_depth_tavg
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lflux_gas_co2'
lname = 'Run CO2 gas flux portion of the code'
units = 'unitless'
datatype = 'logical'
lptr => lflux_gas_co2
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
if (ciso_on) then
sname = 'ciso_lsource_sink'
lname = 'Control which portions of carbon isotope code are executed (useful for debugging)'
units = 'unitless'
datatype = 'logical'
lptr => ciso_lsource_sink
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
end if
if (abio_dic_on) then
sname = 'labio_derivative_diags'
lname = 'Control whether derivative diagnostics are computed in abiotic surface flux (useful for Newton-Krylov)'
units = 'unitless'
datatype = 'logical'
lptr => labio_derivative_diags
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
end if
sname = 'lcheck_forcing'
lname = 'Control whether consistency checks are performed on forcing input (useful for debugging)'
units = 'unitless'
datatype = 'logical'
lptr => lcheck_forcing
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
if (base_bio_on) then
sname = 'lflux_gas_o2'
lname = 'Run O2 gas flux portion of the code'
units = 'unitless'
datatype = 'logical'
lptr => lflux_gas_o2
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lcompute_nhx_surface_emis'
lname = 'control if NHx emissions are computed'
units = 'unitless'
datatype = 'logical'
lptr => lcompute_nhx_surface_emis
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lvariable_PtoC'
lname = 'control if PtoC ratios in autotrophs vary'
units = 'unitless'
datatype = 'logical'
lptr => lvariable_PtoC
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'ladjust_bury_coeff'
lname = 'Adjust the bury coefficient to maintain equilibrium'
units = 'unitless'
datatype = 'logical'
lptr => ladjust_bury_coeff
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lo2_consumption_scalef'
lname = 'Apply o2_consumption_scalef to o2 consumption (and request it as a forcing)'
units = 'unitless'
datatype = 'logical'
lptr => lo2_consumption_scalef
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'lp_remin_scalef'
lname = 'Apply p_remin_scalef to particulate remin (and request it as a forcing)'
units = 'unitless'
datatype = 'logical'
lptr => lp_remin_scalef
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, lptr=lptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
! --------------------------
category = 'config strings'
! --------------------------
sname = 'init_bury_coeff_opt'
lname = 'How to set initial bury coefficients'
units = 'unitless'
datatype = 'string'
sptr => init_bury_coeff_opt
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, sptr=sptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
! -----------------------------
category = 'general parmeters'
! -----------------------------
sname = 'particulate_flux_ref_depth'
lname = 'reference depth for particulate flux diagnostics'
units = 'm'
datatype = 'real'
rptr => particulate_flux_ref_depth
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'bftt_dz_sum_thres'
lname = 'MARBL will abort if abs(1 - sum(bot_flux_to_tend)) exceeds this threshold'
units = 'unitless'
datatype = 'real'
rptr => bftt_dz_sum_thres
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'Jint_Ctot_thres_molpm2pyr'
lname = 'MARBL will abort if abs(Jint_Ctot) exceeds this threshold'
units = 'mol m-2 yr-1'
datatype = 'real'
rptr => Jint_Ctot_thres_molpm2pyr
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'gQsi_0'
lname = 'initial Si/C ratio for growth'
units = '1'
datatype = 'real'
rptr => gQsi_0
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'gQsi_max'
lname = 'max Si/C ratio for growth'
units = '1'
datatype = 'real'
rptr => gQsi_max
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'gQsi_min'
lname = 'min Si/C ratio for growth'
units = '1'
datatype = 'real'
rptr => gQsi_min
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'gQ_Fe_kFe_thres'
lname = 'Fe:kFe ratio threshold in uptake ratio computations'
units = '1'
datatype = 'real'
rptr => gQ_Fe_kFe_thres
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'gQ_Si_kSi_thres'
lname = 'Si:kSi ratio threshold in uptake ratio computations'
units = '1'
datatype = 'real'
rptr => gQ_Si_kSi_thres
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_Fe_bioavail'
lname = 'Fraction of Fe flux that is bioavailable'
units = 'unitless'
datatype = 'real'
rptr => parm_Fe_bioavail
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_o2_min'
lname = 'Minimum O2 needed for production and consumption'
units = 'nmol/cm^3'
datatype = 'real'
rptr => parm_o2_min
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_o2_min_delta'
lname = 'Width of minimum O2 range'
units = 'nmol/cm^3'
datatype = 'real'
rptr => parm_o2_min_delta
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_kappa_nitrif_per_day'
lname = 'Nitrification inverse time constant'
units = '1/day'
datatype = 'real'
rptr => parm_kappa_nitrif_per_day
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_nitrif_par_lim'
lname = 'PAR limit for nitrification'
units = 'W/m^2'
datatype = 'real'
rptr => parm_nitrif_par_lim
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_labile_ratio'
lname = 'Fraction of loss to DOC that is routed directly to DIC'
units = 'unitless'
datatype = 'real'
rptr => parm_labile_ratio
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_init_POC_bury_coeff'
lname = 'initial scale factor for burial of POC, PON'
units = 'unitless'
datatype = 'real'
rptr => parm_init_POC_bury_coeff
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_init_POP_bury_coeff'
lname = 'initial scale factor for burial of POP'
units = 'unitless'
datatype = 'real'
rptr => parm_init_POP_bury_coeff
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_init_bSi_bury_coeff'
lname = 'initial scale factor for burial of bSi'
units = 'unitless'
datatype = 'real'
rptr => parm_init_bSi_bury_coeff
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_Fe_scavenge_rate0'
lname = 'scavenging base rate for Fe'
units = 'cm^2/ng s/yr'
datatype = 'real'
rptr => parm_Fe_scavenge_rate0
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_Lig_scavenge_rate0'
lname = 'scavenging base rate for bound ligand'
units = 'cm^2/ng s/yr'
datatype = 'real'
rptr => parm_Lig_scavenge_rate0
call this%add_var(sname, lname, units, datatype, category, &
marbl_status_log, rptr=rptr)
call check_and_log_add_var_error(marbl_status_log, sname, subname, labort_marbl_loc)
sname = 'parm_FeLig_scavenge_rate0'
lname = 'scavenging base rate for bound iron'
units = 'cm^2/ng s/yr'
datatype = 'real'
rptr => parm_FeLig_scavenge_rate0
call this%add_var(sname, lname, units, datatype, category, &