Commit 9cc189c0 authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

model clean-up

parent 50317b5f
module bb_model_library
use fabm_types, only: type_base_model_factory,type_base_model
use fabm_types, only: type_base_model_factory, type_base_model
implicit none
private
type,extends(type_base_model_factory) :: type_factory
contains
type, extends(type_base_model_factory) :: type_factory
contains
procedure :: create
end type
type (type_factory),save,target,public :: bb_model_factory
type (type_factory), save, target, public :: bb_model_factory
contains
subroutine create(self,name,model)
subroutine create(self, name, model)
use bb_filter_feeder
use bb_lorenz63
use bb_passive
! Add new BB models here
class (type_factory),intent(in) :: self
character(*), intent(in) :: name
class (type_base_model),pointer :: model
class (type_factory), intent(in) :: self
character(*), intent(in) :: name
class (type_base_model), pointer :: model
select case (name)
case ('passive'); allocate(type_bb_passive::model)
......
module examples_model_library
use fabm_types, only: type_base_model_factory,type_base_model
use fabm_types, only: type_base_model_factory, type_base_model
use examples_benthic_predator
use examples_duplicator
......@@ -14,13 +14,13 @@ module examples_model_library
private
type,extends(type_base_model_factory) :: type_factory
type, extends(type_base_model_factory) :: type_factory
contains
procedure :: initialize
procedure :: create
end type
type (type_factory),save,target,public :: examples_model_factory
type (type_factory), save, target, public :: examples_model_factory
contains
......@@ -34,10 +34,10 @@ contains
call self%type_base_model_factory%initialize()
end subroutine initialize
subroutine create(self,name,model)
class (type_factory),intent(in) :: self
character(*), intent(in) :: name
class (type_base_model),pointer :: model
subroutine create(self, name, model)
class (type_factory), intent(in) :: self
character(*), intent(in) :: name
class (type_base_model), pointer :: model
select case (name)
case ('benthic_predator'); allocate(type_examples_benthic_predator::model)
......@@ -48,7 +48,7 @@ contains
case ('light_cycle'); allocate(type_examples_light_cycle::model)
! Add individual example models here
case default
call self%type_base_model_factory%create(name,model)
call self%type_base_model_factory%create(name, model)
end select
end subroutine
......
......@@ -13,18 +13,18 @@ module examples_npzd_model_library
private
type,extends(type_base_model_factory) :: type_factory
contains
contains
procedure :: create
end type
type (type_factory),save,target,public :: examples_npzd_model_factory
type (type_factory), save, target, public :: examples_npzd_model_factory
contains
subroutine create(self,name,model)
class (type_factory),intent(in) :: self
character(*), intent(in) :: name
class (type_base_model),pointer :: model
subroutine create(self, name, model)
class (type_factory), intent(in) :: self
character(*), intent(in) :: name
class (type_base_model), pointer :: model
select case (name)
case ('nut'); allocate(type_examples_npzd_nut::model)
......
This diff is collapsed.
This diff is collapsed.
module gotm_model_library
use fabm_types, only: type_base_model_factory,type_base_model
use fabm_types, only: type_base_model_factory, type_base_model
implicit none
private
type,extends(type_base_model_factory) :: type_factory
contains
type, extends(type_base_model_factory) :: type_factory
contains
procedure :: create
end type
type (type_factory),save,target,public :: gotm_model_factory
type (type_factory), save, target, public :: gotm_model_factory
contains
subroutine create(self,name,model)
subroutine create(self, name, model)
use gotm_npzd
use gotm_fasham
......@@ -23,9 +23,9 @@ contains
use gotm_light
! Add new GOTM models here
class (type_factory),intent(in) :: self
character(*), intent(in) :: name
class (type_base_model),pointer :: model
class (type_factory), intent(in) :: self
character(*), intent(in) :: name
class (type_base_model), pointer :: model
select case (name)
case ('npzd'); allocate(type_gotm_npzd::model)
......
#include "fabm_driver.h"
! This is a FABM implementation of the original two-band light model used in GOTM
! (the General Ocean Turbulence Model)
!
! It distinguishes two wavebands:
! * visible (equivalent to photosynthetically activate radation, PAR, 400 - 700 nm)
! * non-visible, which combines ultraviolet (< 400 nm) and infrared (> 700 nm)
! The non-visible fraction is generally absorbed close to the surface.
! The visible fraction typically penetrates deeper into the water.
! Attenuation of the visible band is influenced by FABM variables that contibute to
! standard_variables%attenuation_coefficient_of_photosynthetic_radiative_flux
! (as well as by the background attenuation set by parameter g2)
!
! The model is driven by downwelling shortwave radiation just below the water surface,
! which in FABM is denoted with standard_variables%surface_downwelling_shortwave_flux
! This is the radiation left after reflection by the surface [albedo] is accounted for.
module gotm_light
use fabm_types
......
......@@ -152,13 +152,13 @@ contains
call self%add_to_aggregate_variable(standard_variables%attenuation_coefficient_of_photosynthetic_radiative_flux, self%p0 * self%kc)
end subroutine initialize
subroutine do(self,_ARGUMENTS_DO_)
subroutine do(self, _ARGUMENTS_DO_)
class (type_gotm_npzd),intent(in) :: self
_DECLARE_ARGUMENTS_DO_
real(rk) :: n,p,z,d,par,I_0
real(rk) :: iopt,rpd,primprod,g,dn
real(rk), parameter :: secs_pr_day = 86400.
real(rk) :: n, p, z, d, par, I_0
real(rk) :: iopt, rpd, primprod, g, dn
real(rk), parameter :: secs_pr_day = 86400.0_rk
! Enter spatial loops (if any)
_LOOP_BEGIN_
......@@ -177,7 +177,7 @@ contains
iopt = max(0.25*I_0,self%I_min)
! Loss rate of phytoplankton to detritus depends on local light intensity.
if (par .ge. self%I_min) then
if (par >= self%I_min) then
rpd = self%rpdu
else
rpd = self%rpdl
......@@ -207,13 +207,13 @@ contains
_LOOP_END_
end subroutine do
subroutine do_ppdd(self,_ARGUMENTS_DO_PPDD_)
subroutine do_ppdd(self, _ARGUMENTS_DO_PPDD_)
class (type_gotm_npzd), intent(in) :: self
_DECLARE_ARGUMENTS_DO_PPDD_
real(rk) :: n,p,z,d,par,I_0
real(rk) :: iopt,rpd,dn,primprod
real(rk), parameter :: secs_pr_day = 86400.
real(rk) :: n, p, z, d, par, I_0
real(rk) :: iopt, rpd, dn, primprod
real(rk), parameter :: secs_pr_day = 86400.0_rk
! Enter spatial loops (if any)
_LOOP_BEGIN_
......@@ -232,7 +232,7 @@ contains
iopt = max(0.25*I_0,self%I_min)
! Loss rate of phytoplankton to detritus depends on local light intensity.
if (par .ge. self%I_min) then
if (par >= self%I_min) then
rpd = self%rpdu
else
rpd = self%rpdl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment