FishMet: Fish feeding and appetite model, OPEN EDITION  0.1
FishMet: Fish feeding and appetite model, OPEN EDITION
environ Module Reference

Module defining the environment. More...

Data Types

type  food_item
 Defines the food item. More...
 

Functions/Subroutines

elemental subroutine food_item_init (this, mass)
 Initialise the food item with its parameters. More...
 
elemental subroutine food_item_copy_assign_to (this, what_to_copy)
 Copy what_to_copy object to this (target) object. More...
 
impure class(food_item) function, pointer food_item_schedule_feed (this, time_step, is_provided)
 Schedule the provision of food items depending on the time step. It returns a pointer to the food item class object if food is given or null pointer otherwise. More...
 
impure subroutine food_provisioning_pattern_init (max_steps)
 Initialise and set up the global food provisioning pattern array commondata::global_interval_food_pattern given the day:night pattern commondata::global_hours_daytime_feeding. Note that feeding can occur only during the daytime. More...
 
impure subroutine food_provisioning_get_file (max_steps, csv_file, column, is_single)
 Read the food provisioning pattern from a CSV file. This allows to get any arbitrary pattern of food input. The input CSV file encodes data by minute. There, 1 or any other non-zero value means that food is provided during the minute interval, 0 means that food is not provided. The file can describe by-minute pattern for 24 h or more if is_single is TRUE. The pattern is then propagated for all 24 h periods described by the max_steps parameter. More...
 
impure subroutine food_provisioning_get_raw (max_steps, csv_file, column, is_single)
 Read the food provisioning pattern from a CSV file in raw format by s. This allows to get any arbitrary pattern of food input. Unlike the food_provisioning_get_file() subroutine, this procedure accepts the food provisioning data in the raw format equal to the model time step i.e. s (second). There, 1 or any other non-zero value means that food is provided during the time step while 0 means that food is not provided. The file can any duration within or exceeding 24 h period. Any data over 24 h are accepted only if is_single is TRUE. More...
 
elemental logical function schedule_2_int (check_n, int1, int2)
 Schedule two intervals N1 = food given, steps, N2 = gap, steps. More...
 
elemental logical function is_day (time_step)
 Determine if the time step corresponds to day (returns true) or night (returns false). More...
 

Detailed Description

Module defining the environment.

Function/Subroutine Documentation

◆ food_item_init()

elemental subroutine environ::food_item_init ( class(food_item), intent(inout)  this,
real(srp), intent(in), optional  mass 
)

Initialise the food item with its parameters.

Definition at line 39 of file m_env.f90.

◆ food_item_copy_assign_to()

elemental subroutine environ::food_item_copy_assign_to ( class(food_item), intent(inout)  this,
class(food_item), intent(in)  what_to_copy 
)

Copy what_to_copy object to this (target) object.

Note
The code is actually equivalent to thismass = food_item_inmass , but if the base class includes several components (e.g. energetic value), an explicit copy method is beneficial.
Warning
Note that making this an assignment overload (assignment(=)) is dangerous as it will then apply to any higher-order hierarchy objects. These will therefore not copy all data components on normal = assignment, resulting in cryptic errors.

Definition at line 62 of file m_env.f90.

◆ food_item_schedule_feed()

impure class(food_item) function, pointer environ::food_item_schedule_feed ( class(food_item), intent(in), target  this,
integer(long), intent(in), optional  time_step,
logical, intent(out), optional  is_provided 
)

Schedule the provision of food items depending on the time step. It returns a pointer to the food item class object if food is given or null pointer otherwise.

Note
The function cannot be pure due to pointer assignment (C1283).
Parameters
[in]thisAny derivative of the ::food_item object
[in]time_stepOptional time step, if not provided the global commondata::global_time_step is used
[out]is_providedOptional output indicator that shows if the food item is provided.

TODO: The rule for scheduling the food items is here

Definition at line 74 of file m_env.f90.

Here is the call graph for this function:

◆ food_provisioning_pattern_init()

impure subroutine environ::food_provisioning_pattern_init ( integer(long), intent(in)  max_steps)

Initialise and set up the global food provisioning pattern array commondata::global_interval_food_pattern given the day:night pattern commondata::global_hours_daytime_feeding. Note that feeding can occur only during the daytime.

Definition at line 122 of file m_env.f90.

Here is the call graph for this function:

◆ food_provisioning_get_file()

impure subroutine environ::food_provisioning_get_file ( integer(long), intent(in)  max_steps,
character(len=*), intent(in)  csv_file,
integer, intent(in), optional  column,
logical, intent(in), optional  is_single 
)

Read the food provisioning pattern from a CSV file. This allows to get any arbitrary pattern of food input. The input CSV file encodes data by minute. There, 1 or any other non-zero value means that food is provided during the minute interval, 0 means that food is not provided. The file can describe by-minute pattern for 24 h or more if is_single is TRUE. The pattern is then propagated for all 24 h periods described by the max_steps parameter.

Parameters
[in]max_stepsMaximum number of the time steps of the model, normally commondata::global_run_model_hours().
[in]csv_fileInput file name
[in]columnOptional column number in the CSV data file. Default is column 1.
[in]is_singleOptional parameter flag that determines if the feeding schedule pattern from the data file csv_file is applied only once for the first 24 h period (TRUE) or propagated to each 24 h period (FALSE). The default value is FALSE

Definition at line 165 of file m_env.f90.

◆ food_provisioning_get_raw()

impure subroutine environ::food_provisioning_get_raw ( integer(long), intent(in)  max_steps,
character(len=*), intent(in)  csv_file,
integer, intent(in), optional  column,
logical, intent(in), optional  is_single 
)

Read the food provisioning pattern from a CSV file in raw format by s. This allows to get any arbitrary pattern of food input. Unlike the food_provisioning_get_file() subroutine, this procedure accepts the food provisioning data in the raw format equal to the model time step i.e. s (second). There, 1 or any other non-zero value means that food is provided during the time step while 0 means that food is not provided. The file can any duration within or exceeding 24 h period. Any data over 24 h are accepted only if is_single is TRUE.

Parameters
[in]max_stepsMaximum number of the time steps of the model, normally commondata::global_run_model_hours().
[in]csv_fileInput file name
[in]columnOptional column number in the CSV data file. Default is column 1.
[in]is_singleOptional parameter flag that determines if the feeding schedule pattern from the data file csv_file is applied only once for the first 24 h period (TRUE) or propagated to each 24 h period (FALSE). The default value is FALSE

Definition at line 305 of file m_env.f90.

◆ schedule_2_int()

elemental logical function environ::schedule_2_int ( integer(long), intent(in)  check_n,
integer, intent(in)  int1,
integer, intent(in)  int2 
)

Schedule two intervals N1 = food given, steps, N2 = gap, steps.

   N1     N2       N1     N2
 +----+----------+----+----------+  ...
                        ^check_n
Parameters
[in]check_nValue to be checked, normally raw time steps
[in]int1The length of the interval when the food is provided, raw steps
Warning
If intervals are set in min, multiply argument by commondata::minute
Parameters
[in]int2The length of the interval when the food id not provided, raw steps
Warning
If intervals are set in min, multiply argument by commondata::minute
Returns
Returns TRUE if check_n is within the int1 interval, otherwise FALSE.

Definition at line 415 of file m_env.f90.

Here is the caller graph for this function:

◆ is_day()

elemental logical function environ::is_day ( integer(long), intent(in), optional  time_step)

Determine if the time step corresponds to day (returns true) or night (returns false).

Note
that it is a wrapper to schedule_2_int().
Parameters
[in]time_stepOptional time step, if absent determine is it day or night for commondata::global_time_step

Definition at line 445 of file m_env.f90.

Here is the call graph for this function:
Here is the caller graph for this function: