NOAA-CEFI-Regional-Ocean-Modeling / ocean_BGC

3 stars 4 forks source link

Anomalous namelist usage early in the code to set parameters #20

Open charliestock opened 3 months ago

charliestock commented 3 months ago

There are a small number of parameters being defined in a name list at the beginning of the code:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/bfa02118f1bda46cc230d18074401e6d782a8e74/generic_tracers/generic_COBALT.F90#L197-L227

Many of these are a legacy from Fabien Paulot's development of dynamic ammonia exchanges across the air-sea interface and can likely be either removed and/or set as the other parameters are set. I can put together a pull request to remove these once we agree on the best approach for handling the setting of parameter values.

yichengt900 commented 3 months ago

@charliestock , thanks for bringing this up. I also noticed that during my code cleanup & inline doc process (#17). At this moment I simply commented out those lines in branch feature/inline_documentation:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/9fceed8e0cf033f2f09e7030fb2748ce05594af7/generic_tracers/generic_COBALT.F90#L204-L212

But we definitely should remove them if they are not used anymore.

Regarding how to handle the setting of parameter values, I like the g_tracer_add_param way because we can always overwrite default values through field_table, but I am open to any ideas.

yichengt900 commented 2 months ago

Some of the unused parameters defined in a namelist have been removed in PR #23. The remaining parameters have now been moved to cobalt_types.F90:

  character(len=10), public ::  co2_calc = 'mocsy'           !< carbonate formalation options. Default is 'mocsy'
  logical, public :: do_14c             = .false.            !< If true, then simulate radiocarbon 
  logical, public :: do_nh3_atm_ocean_exchange = .false.     ! If true, then do NH3 air-sea exchange 
  !
  logical, public :: do_vertfill_pre = .false.             !< Returns tracer arrays with sensible values
  logical, public :: debug           = .false.             !< not use   
  real, public    :: o2_min_nit= 0.01e-6                   !< Oxygen threshold for nitrification (mol O2 kg-1)
  real, public    :: k_o2_nit  = 3.9e-6                    !< Oxygen half saturation constant for nitrification
  real, public    :: irr_inhibit = 10.                     !< Irradiance inhibition term for nitrification (W m-2)
  real, public    :: gamma_nitrif= 3.5e6                   !< Rate constant for nitrification (month-1)
  real, public    :: k_nh3_nitrif= 3.1e-9                  !< NH3 half-saturation for nitrification (mol NH3 kg-1)  
  real, public    :: imbalance_tolerance=1.0e-10           !< the tolerance for non-conservation in C,N,P,Sc,Fe

  integer, public :: scheme_no3_nh4_lim = 2 !< Nitrate and ammonia limitation scheme options
                                            !! 1-Frost and Franzen (1992)
                                            !! 2-O'Neill

  integer, public :: scheme_nitrif = 3      !< nitrification scheme options:
                                            !! 1-default COBALT
                                            !! 2-update with no temperature dependence
                                            !! 3-update with temperature dependence

@charliestock we may consider move some of them to g_tracer_add_param.