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

removed double declaration and assignment #111

Merged
merged 6 commits into from
Aug 21, 2024
Merged
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
11 changes: 3 additions & 8 deletions src/nitrification.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module ersem_nitrification
type (type_state_variable_id) :: id_O2o,id_TA
type (type_state_variable_id) :: id_N3n,id_N4n,id_O5n
type (type_dependency_id) :: id_ETW,id_phx
type (type_diagnostic_variable_id) :: id_nitrification, id_fN4O5n, id_fN4N3n
type (type_diagnostic_variable_id) :: id_fN4N3n, id_fN4O5n

! Parameters
real(rk) :: q10
Expand Down Expand Up @@ -56,8 +56,7 @@ subroutine initialize(self,configunit)
call self%get_parameter(self%chN4nX,'chN4n','(mmol N/m^3)^3','Michaelis-Menten constant for cubic ammonium dependence of nitrification', default=0.0_rk)

! Register diagnostic variables
call self%register_diagnostic_variable(self%id_nitrification,"rate","mmol/m3/d","rate")
call self%register_diagnostic_variable(self%id_fN4N3n,'fN4N3n','mmol N/m^3/d','nitrification',output=output_time_step_averaged)
call self%register_diagnostic_variable(self%id_fN4N3n,"fN4N3n","mmol N/m^3/d","nitrification rate")
if (self%ISWn2o) call self%register_diagnostic_variable(self%id_fN4O5n,'fN4O5n','mmol N/m^3/d','N2O production',output=output_time_step_averaged)

! Register links to nutrient and oxygen pools.
Expand Down Expand Up @@ -120,18 +119,14 @@ subroutine do(self,_ARGUMENTS_DO_)
_SET_DIAGNOSTIC_(self%id_fN4O5n,fN4O5n)
end if

_SET_DIAGNOSTIC_(self%id_fN4N3n,fN4N3n)



_SET_ODE_(self%id_N3n, + fN4N3n)
_SET_ODE_(self%id_N4n, - fN4N3n)
_SET_ODE_(self%id_TA, -2*fN4N3n) ! Alkalinity contributions: +1 for NH4, -1 for nitrate

! Legacy ERSEM did not account for oxygen removal by nitrification
if (.not.legacy_ersem_compatibility) _SET_ODE_(self%id_O2o,-2*fN4N3n)

_SET_DIAGNOSTIC_(self%id_nitrification,fN4N3n)
_SET_DIAGNOSTIC_(self%id_fN4N3n,fN4N3n)

! Leave spatial loops (if any)
_LOOP_END_
Expand Down
Loading