Skip to content

Commit

Permalink
More clean-up in marbl_parms.F90
Browse files Browse the repository at this point in the history
Moved more parameters to marbl_constants_mod.F90
  • Loading branch information
mnlevy1981 committed May 24, 2016
1 parent 51d3aea commit ef98625
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 53 deletions.
11 changes: 4 additions & 7 deletions src/marbl_ciso_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ module marbl_ciso_mod
real (r8) :: Ca14CO3 ! local copy of model autotroph Ca14CO3
end type autotroph_local_type

! Using scaled isotopic carbon pools, so Rstd =1
real(r8), parameter :: R13C_std = 1.0_r8 ! actual 13C/12C PDB standard ratio (Craig, 1957) = 1123.72e-5_r8
real(r8), parameter :: R14C_std = 1.0_r8 ! actual 14C/12C NOSAMS standard ratio = 11.76e-13_r8

! Module variables
real(r8) :: pi

Expand Down Expand Up @@ -355,7 +351,8 @@ subroutine marbl_ciso_set_interior_forcing( &
use marbl_share_mod , only : ciso_lsource_sink
use marbl_share_mod , only : ciso_fract_factors
use marbl_parms , only : f_graze_CaCO3_REMIN
use marbl_parms , only : R13c_std, R14c_std
use marbl_constants_mod , only : R13c_std
use marbl_constants_mod , only : R14c_std
use marbl_constants_mod , only : spd
use marbl_diagnostics_mod , only : store_diagnostics_ciso_interior

Expand Down Expand Up @@ -1845,8 +1842,8 @@ subroutine marbl_ciso_set_surface_forcing( &
marbl_surface_forcing_share , &
marbl_surface_forcing_diags)

use marbl_parms , only : R13c_std
use marbl_parms , only : R14c_std
use marbl_constants_mod , only : R13c_std
use marbl_constants_mod , only : R14c_std
use marbl_constants_mod , only : p5
use marbl_diagnostics_mod , only : store_diagnostics_ciso_surface_forcing

Expand Down
16 changes: 13 additions & 3 deletions src/marbl_constants_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module marbl_constants_mod
public
save

! General constants
real(kind=r8), parameter, public :: &
c0 = 0.0_r8 , &
c1 = 1.0_r8 , &
Expand All @@ -15,13 +16,22 @@ module marbl_constants_mod
c1000 = 1000.0_r8 , &
p001 = 0.001_r8 , &
p5 = 0.5_r8


! Unit Conversion
real(kind=r8), parameter, public :: &
T0_Kelvin = 273.15_R8, & ! freezing T of fresh water (deg K)
rho_sw = 1.026_R8, & ! density of salt water (g/cm^3)
spd = 86400.0_r8, & ! number of seconds in a day
dps = c1 / spd, & ! number of days in a second
yps = c1 / (365.0_r8*spd), & ! number of years in a second
mpercm = .01_r8 ! meters per cm

! Physical Constants
real(kind=r8), parameter, public :: &
T0_Kelvin = 273.15_r8, & ! freezing T of fresh water (deg K)
rho_sw = 1.026_r8, & ! density of salt water (g/cm^3)
epsC = 1.00e-8, & ! small C concentration (mmol C/m^3)
epsTinv = 3.17e-8, & ! small inverse time scale (1/year) (1/sec)
molw_Fe = 55.845_r8, & ! molecular weight of iron
R13C_std = 1.0_r8, & ! actual 13C/12C PDB standard ratio (Craig, 1957) = 1123.72e-5_r8
R14C_std = 1.0_r8 ! actual 14C/12C NOSAMS standard ratio = 11.76e-13_r8

end module marbl_constants_mod
3 changes: 1 addition & 2 deletions src/marbl_diagnostics_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5419,8 +5419,7 @@ subroutine store_diagnostics_ciso_surface_forcing( &
! !DESCRIPTION:
! Compute surface fluxes for ecosys tracer module.

use marbl_parms , only : R13c_std, R14c_std
use marbl_constants_mod, only : c1000
use marbl_constants_mod, only : R13c_std, R14c_std, c1000

implicit none

Expand Down
23 changes: 10 additions & 13 deletions src/marbl_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ module marbl_mod
use marbl_kinds_mod, only : r8
use marbl_kinds_mod, only : char_len

use marbl_parms, only : blank_fmt
use marbl_parms, only : delim_fmt
use marbl_parms, only : ndelim_fmt
use marbl_parms, only : marbl_params_init, marbl_params_print
use marbl_parms, only : grz_fnc_michaelis_menten
use marbl_parms, only : grz_fnc_sigmoidal
Expand Down Expand Up @@ -2649,7 +2646,7 @@ subroutine marbl_set_surface_forcing( &
use marbl_co2calc_mod , only : marbl_co2calc_surf
use marbl_co2calc_mod , only : thermodynamic_coefficients_type
use marbl_oxygen , only : o2sat_surf
use marbl_parms , only : molw_Fe
use marbl_constants_mod , only : molw_Fe
use marbl_share_mod , only : lflux_gas_o2
use marbl_share_mod , only : lflux_gas_co2
use marbl_share_mod , only : ndep_data_type
Expand Down Expand Up @@ -3618,10 +3615,10 @@ subroutine marbl_compute_autotroph_elemental_ratios(auto_cnt, auto_meta, &
autotroph_local, tracer_local, marbl_tracer_indices, &
autotroph_secondary_species)

use marbl_parms , only : epsC
use marbl_parms , only : gQsi_0
use marbl_parms , only : gQsi_max
use marbl_parms , only : gQsi_min
use marbl_constants_mod, only : epsC
use marbl_parms , only : gQsi_0
use marbl_parms , only : gQsi_max
use marbl_parms , only : gQsi_min

implicit none

Expand Down Expand Up @@ -4182,7 +4179,7 @@ subroutine marbl_compute_autotroph_photosynthesis (auto_cnt, PAR_nsubcols, &
! get photosynth. rate, phyto C biomass change, photoadapt
!-----------------------------------------------------------------------

use marbl_parms , only : epsTinv
use marbl_constants_mod, only : epsTinv

integer(int_kind) , intent(in) :: auto_cnt
integer(int_kind) , intent(in) :: PAR_nsubcols
Expand Down Expand Up @@ -4515,10 +4512,10 @@ subroutine marbl_compute_grazing (auto_cnt, zoo_cnt, grazer_prey_cnt, auto_meta,
! NOTE: if autotrophs(diat_ind)%graze_zoo is changed, coeff.s for poc, doc and dic must change!
!-----------------------------------------------------------------------

use marbl_parms , only : epsC
use marbl_parms , only : epsTinv
use marbl_parms , only : grz_fnc_michaelis_menten
use marbl_parms , only : grz_fnc_sigmoidal
use marbl_constants_mod, only : epsC
use marbl_constants_mod, only : epsTinv
use marbl_parms , only : grz_fnc_michaelis_menten
use marbl_parms , only : grz_fnc_sigmoidal

integer(int_kind) , intent(in) :: auto_cnt
integer(int_kind) , intent(in) :: zoo_cnt
Expand Down
34 changes: 6 additions & 28 deletions src/marbl_parms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,6 @@ module marbl_parms
type(autotroph_type) :: autotrophs(autotroph_cnt)
type(grazing_type) :: grazing(grazer_prey_cnt, zooplankton_cnt)

!---------------------------------------------------------------------
! molecular weights and isotope standards
!---------------------------------------------------------------------

real(r8), parameter :: molw_Fe = 55.845_r8

! Using scaled isotopic carbon pools, so Rstd =1
real(r8), parameter :: R13C_std = 1.0_r8 ! actual 13C/12C PDB standard ratio (Craig, 1957) = 1123.72e-5_r8
real(r8), parameter :: R14C_std = 1.0_r8 ! actual 14C/12C NOSAMS standard ratio = 11.76e-13_r8

!-----------------------------------------------------------------------
! common formats for formatted output
!-----------------------------------------------------------------------

character (1), parameter :: char_delim = ','
character (9), parameter :: delim_fmt = "(72('-'))"
character (9), parameter :: ndelim_fmt = "(72('='))"
character (5), parameter :: blank_fmt = "(' ')"

!-----------------------------------------------------------------------------
! epsilon values
!-----------------------------------------------------------------------------

real(kind=r8), parameter :: &
epsC = 1.00e-8, & ! small C concentration (mmol C/m^3)
epsTinv = 3.17e-8 ! small inverse time scale (1/year) (1/sec)

!-----------------------------------------------------------------------------
! Redfield Ratios, dissolved & particulate
!-----------------------------------------------------------------------------
Expand Down Expand Up @@ -253,8 +226,13 @@ module marbl_parms

private :: &
marbl_params_set_defaults


! Variables used from other modules should be private
! (So we don't accidentally use them from this module)
private :: r8, int_kind, log_kind
private :: c1, dps
private :: zooplankton_type, autotroph_type, grazing_type
private :: autotroph_cnt, zooplankton_cnt, grazer_prey_cnt

contains

Expand Down

0 comments on commit ef98625

Please sign in to comment.