Skip to content

Commit

Permalink
Module Benthos : added 3 options to compute oxygen limitation as in M…
Browse files Browse the repository at this point in the history
…odule CEQUAL. default one is the old

Module MacroAlgae : added carrying capacity limitation. by default disconnected

ModuleWaterProperties : fixed bug in MacroAlgae occupation

ModuleInterfaceSedimentWater: commented hdf output of cell area (it was crashing MOHID, did not investigated why)
  • Loading branch information
odavidbrito committed Jun 10, 2017
1 parent d6373cb commit bc362eb
Show file tree
Hide file tree
Showing 11 changed files with 445 additions and 157 deletions.
102 changes: 92 additions & 10 deletions Software/MOHIDBase1/ModuleBenthos.F90
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ Module ModuleBenthos
private :: LocateObjBenthos

!Interfaces----------------------------------------------------------------

!Parameters----------------------------------------------------------------
! Oxygen limitation type
integer, parameter :: Default_ = 1
integer, parameter :: Monod_ = 2
integer, parameter :: Exponential_ = 3

!Types---------------------------------------------------------------------
type T_External
Expand Down Expand Up @@ -156,6 +162,10 @@ Module ModuleBenthos

type T_Oxygen
real :: Minimum = null_real
real :: O2Lim = null_real
real :: O2K1 = null_real
real :: O2K2 = null_real
integer :: O2Method = null_int
end type T_Oxygen

type T_Silica
Expand Down Expand Up @@ -959,7 +969,48 @@ subroutine ReadOxygenParameters
Default = 1e-5, &
ClientModule = 'ModuleBenthos', &
STAT = STAT_CALL)
if(STAT_CALL .NE. SUCCESS_) stop 'ReadOxygenParameters - ModuleBenthos - ERR01'
if(STAT_CALL .NE. SUCCESS_) stop 'ReadOxygenParameters - ModuleBenthos - ERR00'

!O2LIM - Dissolved oxygen concentration at which anaerobic processes begin [g m^-3]
call GetData(Me%Oxygen%O2LIM, &
Me%ObjEnterData, iflag, &
SearchType = FromFile, &
keyword = 'O2LIM', &
default = 0.1000, &
ClientModule = MohidModules(mCEQUALW2_)%Name, &
STAT = STAT_CALL)
if(STAT_CALL .ne. SUCCESS_) stop "ReadOxygenParameters - ModuleBenthos - ERR01"

call GetData(Me%Oxygen%O2Method, &
Me%ObjEnterData, iflag, &
SearchType = FromFile, &
keyword = 'O2_METHOD', &
default = Default_, &
ClientModule = MohidModules(mCEQUALW2_)%Name, &
STAT = STAT_CALL)
if(STAT_CALL .ne. SUCCESS_) stop "ReadOxygenParameters - ModuleBenthos - ERR02"

!Oxygen rate multiplier for oxygen consuming processes

call GetData(Me%Oxygen%O2K1, &
Me%ObjEnterData, iflag, &
SearchType = FromFile, &
keyword = 'O2_K1', &
default = 2.5, &
ClientModule = MohidModules(mCEQUALW2_)%Name, &
STAT = STAT_CALL)
if(STAT_CALL .ne. SUCCESS_) stop "ReadOxygenParameters - ModuleBenthos - ERR03"

call GetData(Me%Oxygen%O2K2, &
Me%ObjEnterData, iflag, &
SearchType = FromFile, &
keyword = 'O2_K2', &
default = 7.0, &
ClientModule = MohidModules(mCEQUALW2_)%Name, &
STAT = STAT_CALL)
if(STAT_CALL .ne. SUCCESS_) stop "ReadOxygenParameters - ModuleBenthos - ERR04"




end subroutine ReadOxygenParameters
Expand Down Expand Up @@ -1568,12 +1619,30 @@ subroutine ComputeBenthicNitrogen(Index)
PON5 = Me%PropIndex%PON5
end if

if (Me%Oxygen%O2Method == Default_) then
!Multiplication by 1000 because oxygen units are given in g/l
OxygenLimitation = max(Me%ExternalVar%Oxygen(Index)*1000., Me%Oxygen%Minimum)
!OxygenLimitation = max(Me%ExternalVar%Oxygen(Index)*1000., Me%Oxygen%Minimum)
!all other modules have this in mg/L keep it consistent
OxygenLimitation = max(Me%ExternalVar%Oxygen(Index), Me%Oxygen%Minimum)

!OxygenLimitation = 1 when Oxygen levels are high
!OxygenLimitation = 0 when Oxygen levels are low
OxygenLimitation = OxygenLimitation / (OxygenLimitation + 0.5)

else if (Me%Oxygen%O2Method == Monod_) then

!all other modules have this in mg/L keep it consistent
OxygenLimitation = max(Me%ExternalVar%Oxygen(Index), Me%Oxygen%Minimum)

OxygenLimitation = OxygenLimitation / ( OxygenLimitation + Me%Oxygen%O2Lim)

else if (Me%Oxygen%O2Method == Exponential_) then

OxygenLimitation = 1./(1.0 + (Me%Oxygen%O2K1/(Me%ExternalVar%Oxygen(index)))**Me%Oxygen%O2K2)

endif


!OxygenLimitation = 1 when Oxygen levels are high
!OxygenLimitation = 0 when Oxygen levels are low
OxygenLimitation = OxygenLimitation / (OxygenLimitation + 0.5)

if(Me%ComputeOptions%Mineralization) then
!day-1
Expand Down Expand Up @@ -1691,12 +1760,25 @@ subroutine ComputeBenthicPhosphorus(Index)
end if


if (Me%Oxygen%O2Method == Default_) then
!Multiplication by 1000 because oxygen units are given in g/l
OxygenLimitation = max(Me%ExternalVar%Oxygen(Index)*1000., Me%Oxygen%Minimum)

!OxygenLimitation = 1 when Oxygen levels are high
!OxygenLimitation = 0 when Oxygen levels are low
OxygenLimitation = OxygenLimitation / (OxygenLimitation + 0.5)
!OxygenLimitation = max(Me%ExternalVar%Oxygen(Index)*1000., Me%Oxygen%Minimum)
!all other modules have this in mg/L keep it consistent
OxygenLimitation = max(Me%ExternalVar%Oxygen(Index), Me%Oxygen%Minimum)

!OxygenLimitation = 1 when Oxygen levels are high
!OxygenLimitation = 0 when Oxygen levels are low
OxygenLimitation = OxygenLimitation / (OxygenLimitation + 0.5)

else if (Me%Oxygen%O2Method == Monod_) then

OxygenLimitation = Me%ExternalVar%Oxygen(Index) / ( Me%ExternalVar%Oxygen(Index) + Me%Oxygen%Minimum)

else if (Me%Oxygen%O2Method == Exponential_) then

OxygenLimitation = 1./(1.0 + (Me%Oxygen%O2K1/(Me%ExternalVar%Oxygen(index)))**Me%Oxygen%O2K2)

endif

if(Me%ComputeOptions%Mineralization) then
!day-1
Expand Down
Loading

0 comments on commit bc362eb

Please sign in to comment.