Skip to content

Commit

Permalink
removed double declaration and assignment (#111)
Browse files Browse the repository at this point in the history
* removed double declaration and assignment

* renamed diagnostic to keep consistency to nomenclature

---------

Co-authored-by: Michael Wathen <[email protected]>
Co-authored-by: Gennadi Lessin <[email protected]>
  • Loading branch information
3 people authored Aug 21, 2024
1 parent 6a80806 commit 9dcbee9
Showing 1 changed file with 3 additions and 8 deletions.
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

0 comments on commit 9dcbee9

Please sign in to comment.