Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/benthic_base.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ subroutine do_bottom(self,_ARGUMENTS_DO_BOTTOM_)
if (self%resuspension) then
! The resuspension rate (1/d) is a linear function of shear stress (Pa)
! Prefactor "er" (1/d) can be interpreted as c*M/rho_sed*v_crit^2, with:
! - c (1/m) = ratio between tracer concentration at the sediment surface and sediemnt-column-integrated tracer
! - c (1/m) = ratio between tracer concentration at the sediment surface and sediment-column-integrated tracer
! (e.g., c=100 for an exponential profile with penetration depth of 1 cm)
! - M = the erosion rate in g*s/m4 (Puls & Suendermann 1990: M=100)
! - rho_sed = dry mass of sediment per total volume at the sediment surface. This is grain density (2650 kg/m3 for quartz) multiplied by (1-porosity)
Expand Down
4 changes: 2 additions & 2 deletions src/benthic_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ subroutine initialize(self,configunit)
! Create bioturbation submodel and provide it with parameters
! Currently the bioturbation logic must be separate from type_ersem_benthic_column to avoid circular dependencies.
! This is because type_ersem_benthic_column provides the max column depth, which is used to compute food for
! benthic fauna, which in turn results in the aggrege biturbation/bioirrigation activity.
! benthic fauna, which in turn results in the aggrege bioturbation/bioirrigation activity.
allocate(bioturbation)

! Bioturbation
call self%get_parameter(bioturbation%Etur,'Etur','m^2/d','basal bioturbation rate')
call self%get_parameter(bioturbation%mtur,'mtur','-','maximum relative turbation enhancement')
call self%get_parameter(bioturbation%mtur,'mtur','-','maximum relative bioturbation enhancement')
call self%get_parameter(bioturbation%htur,'htur','mg C/m^2/d','Michaelis-Menten constant for bioturbation')
call self%get_parameter(bioturbation%dtur,'dtur','m','bioturbation depth')

Expand Down
4 changes: 2 additions & 2 deletions src/benthic_column_dissolved_matter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ subroutine process_constituent(self,_ARGUMENTS_DO_BOTTOM_,info)
! Constraints: diffusion of the residual across bottom of benthic column must be zero (i.e., zero gradient), and at the surface of the benthic
! column the concentration of the residual must equal zero (i.e., equilibrium holds at the very surface of the column).
! Since we do not know anything about the processes responsible for the residual, let's assume their contribution
! in the past was a constant production or destruction per unit sediment volume thoughout the entire column.
! in the past was a constant production or destruction per unit sediment volume throughout the entire column.
! That is, production (#/m^2/d) in the three layers was P_int*d1/d3, P_int(d2-d1)/d3, P_int(d3-d2)/d3.
! If we would know P_int, we could supply those rates along with zero surface concentration to "compute_equilibrium_profile"
! to derive the residual profile. By checking the equations in compute_equilibrium_profile, we can verify that the resulting bottom concentration
! and layer integral are both proportional to P_int. Thus, can can simply supply d1, d2-d1, d3-d2 to
! "compute_equilibrium_profile", and find the additional scale factor P_int/d3 by demanding that the sum of layer integrals is
! equal to the known residual mass. That is, P_int/d3 equals the ratio of residual mass to the sum of normalized layer integrals
! equal to the known residual mass. That is, P_int/d3 equals the ratio of residual mass to the sum of normalised layer integrals
! computed for layer production terms d1, d2-d1, d3-d2. As we are assuming the residual profile was previously an equilibrium
! profile, the necessary depth-integrated production rate P_int must equal the exchange across the surface, i.e., diffusivity*gradient.
! Thus, we can now simply add the P_int as a additional surface exchange term, accounting for the move towards equilibrium.
Expand Down
8 changes: 4 additions & 4 deletions src/benthic_column_particulate_matter.F90
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ module ersem_benthic_column_particulate_matter
! = D C0/z_mean
!
! However, we KNOW that diffusion witin the column should not affect the mass integral. Why is this then non-zero?
! The reason for this is that we have not accounted for the no-flux boundary conditions. As a result, we are implicity
! The reason for this is that we have not accounted for the no-flux boundary conditions. As a result, we are implicitly
! using a non-zero inward flux at the surface that is determined by the gradient:
!
! -D d/dz C(0) = D C0/z_mean exp(-z/z_mean) = D C0/z_mean
Expand Down Expand Up @@ -650,7 +650,7 @@ subroutine layer_initialize_constituent(self,info,name,units,long_name,remin,q10

! Register the only diagnostic for this constituent: mass integrated over desired depth interval.
! This diagnostic acts like a state variable, so that other models can provides sinks and sources.
! These are converted by the "change_processor" submodel into appropriate changes in colmn-integrated mass and penetration depth.
! These are converted by the "change_processor" submodel into appropriate changes in column-integrated mass and penetration depth.
call self%register_diagnostic_variable(info%id_local,name,units//'/m^2',long_name, &
act_as_state_variable=.true.,domain=domain_bottom,output=output_none,source=source_do_bottom)
call self%add_to_aggregate_variable(aggregate_target,info%id_local,aggregate_scale_factor)
Expand Down Expand Up @@ -958,11 +958,11 @@ real(rk) function partQ( d_pen, d_top, d_bot, d_max )
if ( d_pen>0._rk ) then
! Penetration depth > 0: integrate idealized [exponential] distribution over desired depth interval.

! Compute normalization factor: integral of exponential distribution from surface to bottom of column.
! Compute normalisation factor: integral of exponential distribution from surface to bottom of column.
! This interval must by definition contain 100 % of the modelled mass.
norm = 1._rk - exp(-d_max/d_pen)

! Compute integral of exponential over desired depth interval and normalize to obtain fraction between 0 and 1.
! Compute integral of exponential over desired depth interval and normalise to obtain fraction between 0 and 1.
partQ = (exp(-d_top1/d_pen) - exp(-d_bot1/d_pen)) / norm
else
! Penetration depth = 0 (or < 0, but that's an artefact): all mass in surface layer of zero thickness.
Expand Down
2 changes: 1 addition & 1 deletion src/benthic_fauna.F90
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ subroutine initialize(self,configunit)
end do

! Set food-source-specific assimilation inefficiency.
! (fraction of ingested frood going to faeces)
! (fraction of ingested food going to faeces)
do ifood=1,self%nfood
write (index,'(i0)') ifood
call self%get_parameter(foodispom,'food'//trim(index)//'ispom','','food source '//trim(index)//' is detritus',default=.false.)
Expand Down
4 changes: 2 additions & 2 deletions src/benthic_nitrogen_cycle.F90
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ subroutine initialize(self,configunit)
call self%get_parameter(self%xn2, 'xn2','mol O_2/mol N','oxygen demand fulfilled by reduction of nitrate to dinitrogen gas')
call self%get_parameter(self%hM3G4,'hM3G4','mmol N/m^3','Michaelis-Menten constant for nitrate limitation of denitrification')

! Create our own state avriable for dinitrogen gas
! Create our own state variable for dinitrogen gas
! (only to track its total production, which can then be considered in nitrogen mass balance)
call self%register_state_variable(self%id_G4n,'G4n','mmol N/m^2','dinitrogen gas')
call self%add_to_aggregate_variable(standard_variables%total_nitrogen,self%id_G4n)
Expand All @@ -80,7 +80,7 @@ subroutine initialize(self,configunit)
call self%register_diagnostic_variable(self%id_jM3G4n,'jM3G4n','mmol N/m^2/d','layer 2 de-nitrification flux',source=source_do_bottom)

! Create a child model that provides a K6 diagnostic. Other models (e.g., anaerobic bacteria) can attach to that to provide it with sink/source terms.
! In turn, these are then picked up by this model (type_ersem_benthic_nitrogen_cycle) and translated into chnages in NO3 and O2.
! In turn, these are then picked up by this model (type_ersem_benthic_nitrogen_cycle) and translated into changes in NO3 and O2.
allocate(child)
call self%add_child(child,'K6_calculator',configunit=configunit)
call child%register_diagnostic_variable(child%id_K6,'K6','mmol O_2/m^2','oxygen debt due to anaerobic respiration',act_as_state_variable=.true.,output=output_none,domain=domain_bottom,source=source_none)
Expand Down
16 changes: 8 additions & 8 deletions src/carbonate.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ subroutine initialize(self,configunit)
call self%register_state_variable(self%id_TA,'TA','mmol/m^3','total alkalinity',2300._rk,minimum=1.e-4_rk, &
standard_variable=standard_variables%alkalinity_expressed_as_mole_equivalent)
else
! Total alkalinity is a diagnostic variable, parameterized as function of salinity and temperature.
! Total alkalinity is a diagnostic variable, parameterised as function of salinity and temperature.
! since ERSEM22.11 Total alkalinity is expressed in mmol/m3 instead of umol/kg
call self%register_diagnostic_variable(self%id_TA_diag,'TA','mmol/m^3','total alkalinity', act_as_state_variable=.true., &
standard_variable=standard_variables%alkalinity_expressed_as_mole_equivalent)

call self%get_parameter(iswbioalk,'iswbioalk','','use bioalkalinity (0: off, 1: on)',default=1,minimum=0,maximum=1)
if (iswbioalk==1) then
! Register state variable to track "bioalkalinity", i.e., the difference between parameterized
! Register state variable to track "bioalkalinity", i.e., the difference between parameterised
! and actual alkalinity that is created by biogeochemical processes modifying alkalinity.
! since ERSEM22.11 bioalkalinity is expressed in mmol/m3 instead of umol/kg
call self%register_state_variable(self%id_bioalk,'bioalk','mmol/m^3','bioalkalinity')
Expand Down Expand Up @@ -171,7 +171,7 @@ subroutine do(self,_ARGUMENTS_DO_)

! Calculate total alkalinity
if (self%iswtalk/=5) then
! Alkalinity is parameterized as function of salinity and temperature.
! Alkalinity is parameterised as function of salinity and temperature.
TA = approximate_alkalinity(self%iswtalk,ETW,X1X)
! Approximate alkalinity is still in umol kg-1 due to empirical regression
! therefore now need to be converted in mmol m-3
Expand Down Expand Up @@ -248,7 +248,7 @@ subroutine do_surface(self,_ARGUMENTS_DO_SURFACE_)
wnd = max(wnd, 0.0_rk)

if (self%iswtalk/=5) then
! Alkalinity is parameterized as function of salinity and temperature.
! Alkalinity is parameterised as function of salinity and temperature.
TA = approximate_alkalinity(self%iswtalk,T,S)
! Approximate alkalinity is still in umol kg-1 due to empirical regression
! therefore now need to be converted in mmol m-3
Expand Down Expand Up @@ -563,7 +563,7 @@ END SUBROUTINE CO2SET
! !DESCRIPTION:
! TODO - check this.
!
! ROUTINE TO CARRY OUT CO2 CALCULATIONS WITH 2 FIXED PARAMETERS ACCORDI
! ROUTINE TO CARRY OUT CO2 CALCULATIONS WITH 2 FIXED PARAMETERS ACCORDING TO
! THE EQUATIONS GIVEN BY PARKS(1969) AND SKIRROW (1975)
! WITH ADDITIONS FOR INCLUDING BORON IF BORON=.TRUE.
!\\
Expand Down Expand Up @@ -600,7 +600,7 @@ SUBROUTINE CO2CLC(k0co2,k1co2,k2co2,kb,ICALC,BORON,BTOT,ctot,TA,pH,PCO2,H2CO3,HC
! CONDITIONS DO NOT ALLOW FOR CONVERGENCE (IN 3D MODEL THIS IS
! LIKELY TO OCCUR NEAR LOW SALINITY REGIONS) THE MODEL WILL
! BE STUCK IN THE LOOP. TO AVOID THIS A CONVERGENCE CONDITION
! IS PUT IN PLACE TO SET A FLAGG OF -99 IN THE PH VAR FOR NON CONVEGENCE.
! IS PUT IN PLACE TO SET A FLAG OF -99 IN THE PH VAR FOR NON CONVERGENCE.
! THE MODEL IS THEN ALLOWED TO CONTINUE. 'COUNTER, C_SW,C_CHECK' ARE
! THE LOCAL VARS USED.
! C_SW = condition of convergence 0=yes, 1= no
Expand Down Expand Up @@ -654,8 +654,8 @@ SUBROUTINE CO2CLC(k0co2,k1co2,k2co2,kb,ICALC,BORON,BTOT,ctot,TA,pH,PCO2,H2CO3,HC
! SET COUNTER UPDATE.
COUNTER=COUNTER+1

! CHECK IF CONVERGENCE HAS OCCURED IN THE NUMBER OF
! ACCEPTABLE ITTERATIONS.
! CHECK IF CONVERGENCE HAS OCCURRED IN THE NUMBER OF
! ACCEPTABLE ITERATIONS.
if(counter.ge.c_check)then
!! IF(MASTER)THEN
!!! LOG FILE TO SHOW WHEN AND WHERE NON CONVERGENCE OCCURS.
Expand Down
4 changes: 2 additions & 2 deletions src/dvm_upper_lower_boundaries.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
! For diel vertical migration of migrating plankton. Calculates an upper and
! lower boundary in the water column, between which the migrator is able to
! be present. Boundaries depend on light levels which can be set by the user
! or defaul to a maximum light level of -6.5 log W m-2 and a minimum light
! or default to a maximum light level of -6.5 log W m-2 and a minimum light
! level of -15 log W m-2
!
! Adapted from code written by Caglar Yumruktepe (NERSC), available at:
Expand Down Expand Up @@ -56,7 +56,7 @@ subroutine initialize(self, configunit)
call self%get_parameter( self%lower_light,'lower_light','log W m-2','light level for lower isolume',default=-15._rk)

call self%get_parameter(self%nprey,'nprey','','number of prey types',default=1)
call self%get_parameter(self%divide_food_by,'divide_food_by','','a likely concentration (e.g. half saturation constant) to normalize food',default=40.0_rk)
call self%get_parameter(self%divide_food_by,'divide_food_by','','a likely concentration (e.g. half saturation constant) to normalise food',default=40.0_rk)
call self%register_diagnostic_variable(self%id_migrator_food,'migrator_food','mmol C/m^3','food availability for the migrators', act_as_state_variable=.true., missing_value=0.0_rk, source=source_do)
! Get prey-specific coupling links.
allocate(self%id_prey(self%nprey))
Expand Down
2 changes: 1 addition & 1 deletion src/mesozooplankton.F90
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ subroutine do(self,_ARGUMENTS_DO_)
! Specific mortality (1/d): background mortality + mortality due to oxygen limitation.
sd = self%sd + (1._rk - eO2)*self%sdo

! Compute abolute mortality (mg C/m3/d) from specific mortality and biomass.
! Compute absolute mortality (mg C/m3/d) from specific mortality and biomass.
rd = sd*cP

! Assimilation inefficiency (dimensionless):
Expand Down
2 changes: 1 addition & 1 deletion src/oxygen.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module ersem_oxygen
! exchange of oxygen across the water surface.

! Note: negative oxygen concentrations are permitted.
! These reflect an oygen debt (e.g., presence of H2S)
! These reflect an oxygen debt (e.g., presence of H2S)
! In this case, oxygen saturation will be zero (not negative!),
! while apparent oxygen utilization will still be the difference
! between saturation concentration and [negative] oxygen concentration.
Expand Down
6 changes: 3 additions & 3 deletions src/primary_producer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module ersem_primary_producer
type (type_diagnostic_variable_id) :: id_lD ! Cell-bound calcite - used by calcifiers only
type (type_diagnostic_variable_id) :: id_O3L2c ! Calcification
type (type_diagnostic_variable_id) :: id_fPIRPc,id_fPIRPn,id_fPIRPp,id_fPIRPs ! Total loss to Particulate detritus
type (type_diagnostic_variable_id) :: id_fPIR1c,id_fPIR1n,id_fPIR1p ! Total loss to labile dissovled detritus
type (type_diagnostic_variable_id) :: id_fPIR1c,id_fPIR1n,id_fPIR1p ! Total loss to labile dissolved detritus
type (type_diagnostic_variable_id) :: id_fPIR2c ! Total loss to non-labile dissovled detritus
type (type_diagnostic_variable_id) :: id_iNI

Expand Down Expand Up @@ -437,7 +437,7 @@ subroutine do(self,_ARGUMENTS_DO_)

! Calculate nutrient limitation impact on rain ratio:
t=max(0._rk,ETW) ! this is to avoid funny values of rain ratio when ETW ~ -2 degrees
RainR = RainR * min((1._rk-iNp),iNn) * (t/(2._rk+t)) !* max(1.,P2c(I)/2.) removd as P2 is a broad class not just calicifiers
RainR = RainR * min((1._rk-iNp),iNn) * (t/(2._rk+t)) !* max(1.,P2c(I)/2.) removed as P2 is a broad class not just calicifiers
RainR = max(RainR,0.005_rk)

! Compute virtual calcite attached to live cells. It is virtual in the sense that it has not been subtracted
Expand Down Expand Up @@ -539,7 +539,7 @@ subroutine do(self,_ARGUMENTS_DO_)

! Net nitrogen uptake

! maximum acheivable uptake of nitrate (mmol N m-3 d-1)
! maximum achievable uptake of nitrate (mmol N m-3 d-1)
rumn3 = self%qun3 * N3nP * c

! Maximum achievable uptake of ammonium (mmol N m-3 d-1)
Expand Down
Loading