Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
charliestock opened this issue Mar 26, 2024 · 2 comments
Open

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

charliestock opened this issue Mar 26, 2024 · 2 comments
Assignees

Comments

@charliestock
Copy link
Contributor

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

! Namelist Options
character(len=10) :: co2_calc = 'ocmip2' ! other option is 'mocsy'
logical :: do_14c = .false.
logical :: debug = .false.
logical :: do_nh3_atm_ocean_exchange = .false.
! namelist capabilities for half-sats not used in this run
logical :: do_vertfill_pre = .false.
real :: k_nh4_small = 1.e-8
real :: k_nh4_diazo = 1.e-7
real :: k_nh4_large = 5.e-8
real :: k_no3_small = 5.e-7
real :: k_no3_diazo = 5.0e-6
real :: k_no3_large = 2.5e-6
real :: o2_min_nit= 0.01e-6
real :: k_o2_nit = 3.9e-6
real :: irr_inhibit = 10.
real :: gamma_nitrif= 3.5e6 !month(-1)
real :: k_nh3_nitrif= 3.1e-9 !mol/kg
real :: imbalance_tolerance=1.0e-10 !the tolerance for non-conservation in C,N,P,Sc,Fe
integer :: scheme_no3_nh4_lim = 2 !1-Frost and Franzen (1992)
!2-O'Neill
integer :: scheme_nitrif = 3 !1-default COBALT
!2-update with no temperature dependence
!3-update with temperature dependence
namelist /generic_COBALT_nml/ do_14c, co2_calc, debug, do_nh3_atm_ocean_exchange, scheme_nitrif, &
k_nh4_small,k_nh4_large,k_nh4_diazo,scheme_no3_nh4_lim,k_no3_small,k_no3_large,k_no3_diazo, &
o2_min_nit,k_o2_nit,irr_inhibit,k_nh3_nitrif,gamma_nitrif,do_vertfill_pre,imbalance_tolerance

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
Copy link
Collaborator

yichengt900 commented Mar 26, 2024

@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:

! namelist capabilities for half-sats not used in this run
! YC TODO: I commented out the following unused namelists now, but should we consider to remove them?
!real :: k_nh4_small = 1.e-8
!real :: k_nh4_diazo = 1.e-7
!real :: k_nh4_large = 5.e-8
!real :: k_no3_small = 5.e-7
!real :: k_no3_diazo = 5.0e-6
!real :: k_no3_large = 2.5e-6
!logical :: debug = .false.

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
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants