43 logical (c_bool),
intent(in) :: lactive(:,:)
46 integer (c_int) :: istat
48 integer (c_int) :: iindex
49 integer (c_int),
allocatable :: ilandusecodes(:)
50 integer (c_int) :: inumberoflanduses
51 logical (c_bool) :: larelengthsequal
56 call die(
"A FOG_RATIO grid must be supplied in order to make use of this option.", __file__, __line__)
59 call slstring%append(
"LU_Code")
60 call slstring%append(
"Landuse_Code")
62 call params%get_parameters( slkeys=slstring, ivalues=ilandusecodes )
63 inumberoflanduses = count( ilandusecodes > 0 )
67 call slstring%append(
"Fog_catch_eff")
68 call slstring%append(
"Fog_catch_efficiency")
73 call warn(
"Failed to find a data column containing fog catch efficiency values.", lfatal=
true, &
78 if ( .not. larelengthsequal ) &
79 call warn( smessage=
"The number of landuses does not match the number of fog catch efficiency values.", &
80 smodule=__file__, iline=__line__, lfatal=.
true._c_bool )
88 real (c_float),
intent(in) :: frainfall(:)
89 real (c_float),
intent(inout) :: ffog(:)
90 integer (c_int),
intent(in) :: ilanduse_index(:)
91 logical (c_bool),
intent(in) :: lactive(:,:)
92 real (c_float),
intent(in) :: nodata_fill_value(:,:)
95 integer (c_int) :: iindex
96 real (c_float) :: ffactor
98 associate( dt =>
sim_dt%curr )
101 call die(
"INTERNAL PROGRAMMING ERROR: attempted use of NULL pointer", __file__, __line__)
103 if ( .not.
allocated(
pfog_ratio%pGrdBase%rData) ) &
104 call die(
"INTERNAL PROGRAMMING ERROR: attempted use of unallocated variable", __file__, __line__)
108 ffog = frainfall * pack(
pfog_ratio%pGrdBase%rData, lactive ) &
This module contains physical constants and convenience functions aimed at performing unit conversion...
logical(c_bool), parameter, public true
real(c_float), parameter ftinyval
Defines the DATA_CATALOG_T data type, which contains type-bound procedures to add,...
type(data_catalog_t), public dat
DAT is a global to hold data catalog entries.
subroutine, public warn(smessage, smodule, iline, shints, lfatal, iloglevel, lecho)
subroutine, public die(smessage, smodule, iline, shints, scalledby, icalledbyline)
Module fog__monthly_grid provides support for estimating fog drip given a gridded map of FOG_RATIO an...
real(c_float), dimension(:), allocatable ffog_catch_efficiency
subroutine, public fog_monthly_grid_initialize(lactive)
Initialize the fog drip algorithm.
type(data_catalog_entry_t), pointer, public pfog_ratio
subroutine, public fog_monthly_grid_calculate(frainfall, ffog, ilanduse_index, lactive, nodata_fill_value)
type(logfile_t), public logs
type(parameters_t), public params
type(date_range_t), public sim_dt