Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/benthic_column_dissolved_matter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ module ersem_benthic_column_dissolved_matter
type (type_bottom_state_variable_id) :: id_layer ! depth of bottom interface of own layer (where own concentration drops to zero)
type (type_horizontal_diagnostic_variable_id) :: id_conc_eq(nlayers) ! mean equilibrium pore water concentration in individual layers
type (type_horizontal_diagnostic_variable_id) :: id_conc_tot(nlayers) ! mean pore water concentration in individual layers
type (type_state_variable_id) :: id_TA

real(rk) :: ads(nlayers)
real(rk) :: relax, minD
real(rk) :: relax, minD, TA_factor
integer :: last_layer
logical :: correction
type (type_single_constituent),allocatable :: constituents(:)
Expand Down Expand Up @@ -102,7 +104,11 @@ subroutine benthic_dissolved_matter_initialize(self,configunit)
write (index,'(i0)') ilayer
call self%get_parameter(self%ads(ilayer),'ads'//trim(index),'-','adsorption in layer '//trim(index)//' (total:dissolved)',default=1.0_rk)
end do

call self%get_parameter(self%correction,'correction','','move losses in oxygenic layer to deeper layers if pelagic concentration is limiting',default=.false.)

call self%get_parameter(self%TA_factor,'TA_factor','','contribution to TA',default=0._rk)


! Create model that computes concentrations per benthic layer.
allocate(profile)
Expand Down Expand Up @@ -146,6 +152,7 @@ subroutine benthic_dissolved_matter_initialize(self,configunit)
end do
call self%request_coupling (self%id_Dm(nlayers), depth_of_sediment_column)
call profile%request_coupling(profile%id_Dm(nlayers),depth_of_sediment_column)
call self%register_state_dependency(self%id_TA,standard_variables%alkalinity_expressed_as_mole_equivalent)

end subroutine benthic_dissolved_matter_initialize

Expand Down Expand Up @@ -367,6 +374,9 @@ subroutine process_constituent(self,_ARGUMENTS_DO_BOTTOM_,info)
! Net change in column-integrated mass must equal column-integrated production - surface exchange.
! Thus, surface exchange = column-integrated production - net change (net change = relaxation)
_SET_BOTTOM_EXCHANGE_(info%id_pel,sms-(c_int_eq-(c_int+c_int_deep))/self%relax)

_SET_BOTTOM_EXCHANGE_(self%id_TA,(sms-(c_int_eq-(c_int+c_int_deep))/self%relax)*self%TA_factor)

_SET_HORIZONTAL_DIAGNOSTIC_(info%id_pbf,sms-(c_int_eq-(c_int+c_int_deep))/self%relax)
else
! Apply a "technical correction" in case flux from the oxygenated
Expand Down Expand Up @@ -426,6 +436,8 @@ subroutine process_constituent(self,_ARGUMENTS_DO_BOTTOM_,info)
norm_res_int = poro*sum(self%ads*residual_per_layer)
P_res_int = (c_int-c_int_eq)/norm_res_int*Dm(nlayers)
_SET_BOTTOM_EXCHANGE_(info%id_pel,sms+P_res_int) ! Equilibrium flux = depth-integrated production sms + residual flux P_res_int
_SET_BOTTOM_EXCHANGE_(self%id_TA,(sms+P_res_int)*self%TA_factor)

_SET_HORIZONTAL_DIAGNOSTIC_(info%id_pbf,sms+P_res_int)
_SET_BOTTOM_ODE_(info%id_int,-P_res_int-sms)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -765,6 +766,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -779,6 +781,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -758,6 +759,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -772,6 +774,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
3 changes: 3 additions & 0 deletions testcases/ersem-15.06/fabm-ersem-15.06-L4-ben-docdyn-iop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -748,6 +749,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -762,6 +764,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -731,6 +732,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -745,6 +747,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
3 changes: 3 additions & 0 deletions testcases/fabm-ersem-26.02-dvm-n2o.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -764,6 +765,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -778,6 +780,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
3 changes: 3 additions & 0 deletions testcases/fabm-ersem-26.02-dvm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,7 @@ instances:
ads1: 100.0 # adsorption in layer 1 (total:dissolved) (-), default = 1.0
ads2: 100.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 2.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
p: 6.8 # phosphorus (mmol/m^2)
coupling:
Expand All @@ -754,6 +755,7 @@ instances:
last_layer: 2 # sediment layer where concentration drops to zero, default = 3
relax: 5.0 # rate of relaxation towards equilibrium concentration profile (1/d)
minD: 0.0001 # minimum depth of zero-concentration isocline (m)
TA_factor: -1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 0.584 # nitrogen (mmol/m^2)
coupling:
Expand All @@ -768,6 +770,7 @@ instances:
ads2: 3.0 # adsorption in layer 2 (total:dissolved) (-), default = 1.0
ads3: 3.0 # adsorption in layer 3 (total:dissolved) (-), default = 1.0
correction: true # move losses in oxygenic layer to deeper layers if pelagic concentration is limiting, default = false
TA_factor: 1. # scaling factor (sign) of the effect of benthic-pelagic fluxes on TA
initialization:
n: 25.0 # nitrogen (mmol/m^2)
coupling:
Expand Down
Loading