The AHA Model  Revision: 12809
Reference implementation 04 (HEDG02_04)
the_environment::light_surface Interface Reference

Calculate surface light intensity (that is subject to diel variation) for specific time step of the model. Irradiance can be stochastic if an optionallogical stochastic flag is set to TRUE. More...

Collaboration diagram for the_environment::light_surface:

Public Member Functions

elemental real(srp) function light_surface_deterministic (tstep)
 Calculate deterministic surface light at specific time step of the model. Light (surlig) is calculated from a sine function. Light intensity just beneath the surface is modelled by assuming a 50 % loss by scattering at the surface: More...
 
real(srp) function light_surface_stochastic_scalar (tstep, is_stochastic)
 Calculate stochastic surface light at specific time step of the model. Light (surlig) is calculated from a sine function. Light intensity just beneath the surface is modelled by assuming a 50 % loss by scattering at the surface: More...
 
real(srp) function, dimension(size(tstep)) light_surface_stochastic_vector (tstep, is_stochastic)
 Calculate stochastic surface light at specific time step of the model. More...
 

Detailed Description

Calculate surface light intensity (that is subject to diel variation) for specific time step of the model. Irradiance can be stochastic if an optionallogical stochastic flag is set to TRUE.

Light (surlig) is calculated from a sine function. Light intensity just beneath the surface is modelled by assuming a 50 % loss by scattering at the surface:

\[ L_{t} = L_{max} 0.5 sin(\pi dt / \Omega ) . \]

Usage:

  • deterministic:
    surface_light(1)
  • stochastic:
    surface_light(1,yes)
Note
Note that it is impossible to do a simple single whole-elemental implementation for this function as random_number is never pure but elemental can only work with all pure functions.

Definition at line 702 of file m_env.f90.

Member Function/Subroutine Documentation

◆ light_surface_deterministic()

elemental real(srp) function the_environment::light_surface::light_surface_deterministic ( integer, intent(in), optional  tstep)

Calculate deterministic surface light at specific time step of the model. Light (surlig) is calculated from a sine function. Light intensity just beneath the surface is modelled by assuming a 50 % loss by scattering at the surface:

\[ L_{t} = L_{max} 0.5 sin(\pi dt / \Omega ) \]

.

Returns
surface light intensity.
Parameters
tsteptime step of the model, limited by maximum commondata::lifespan.
Note
This is a deterministic version. Code for wxMaxima for quickcalc:
surlig(a, span) := 500*0.5*(1.01+sin(3.14*2.*50*a/(1.*span)));
surlig(a, span) := 500*0.5*(1.01+sin(3.14*2.*50*a/span));
wxplot2d(surlig(a, 14000), [a,0, 1400]);
Note that this is an elemental function that accepts both scalar and array parameter.

Definition at line 5359 of file m_env.f90.

◆ light_surface_stochastic_scalar()

real(srp) function the_environment::light_surface::light_surface_stochastic_scalar ( integer, intent(in), optional  tstep,
logical, intent(in)  is_stochastic 
)

Calculate stochastic surface light at specific time step of the model. Light (surlig) is calculated from a sine function. Light intensity just beneath the surface is modelled by assuming a 50 % loss by scattering at the surface:

\[ L_{t} = L_{max} 0.5 sin(\pi dt / \Omega ) \]

. This deterministic value sets the mean for the stochastic final value, which is Gaussian with CV equal to DAYLIGHT_CV.

Returns
surface light intensity
Parameters
tsteptime step of the model, limited by maximum commondata::lifespan.
is_stochasticlogical indicator for stochastic light intensity if TRUE, then Gaussian stochastic version is used, if FALSE, deterministic is used. Code for wxMaxima for quickcalc:
surlig(a, span) := 500*0.5*(1.01+sin(3.14*2.*50*a/(1.*span)));
wxplot2d(surlig(a, 14000), [a,0, 1400]);

Definition at line 5399 of file m_env.f90.

Here is the call graph for this function:

◆ light_surface_stochastic_vector()

real(srp) function, dimension(size(tstep)) the_environment::light_surface::light_surface_stochastic_vector ( integer, dimension(:), intent(in)  tstep,
logical, intent(in)  is_stochastic 
)

Calculate stochastic surface light at specific time step of the model.

Parameters
tsteptime step of the model, limited by maximum commondata::lifespan.
Returns
surface light intensity.
Parameters
is_stochasticlogical indicator for stochastic light intensity if TRUE, then Gaussian stochastic version is used, if FALSE, deterministic is used.
Note
This function accepts vector arguments.
Warning
Note that the tstep array parameter is mandatory here (otherwise the generic interface is ambiguous).

Definition at line 5447 of file m_env.f90.

Here is the call graph for this function:

The documentation for this interface was generated from the following file: