28 use iso_c_binding,
only : c_short, c_int, c_float, c_double
52 character (len=256) :: sOption
53 integer (c_int) :: iStat
54 real (c_float) :: rValue
56 real (kind=c_float),
allocatable :: fet_slope(:)
57 real (kind=c_float),
allocatable :: fet_exponent(:)
58 real (kind=c_float),
allocatable :: fet_constant(:)
60 call params%get_parameters( skey=
"Hargreaves_ET_slope", fvalues=fet_slope)
61 call params%get_parameters( skey=
"Hargreaves_ET_exponent", fvalues=fet_exponent)
62 call params%get_parameters( skey=
"Hargreaves_ET_constant", fvalues=fet_constant)
65 et_slope = real(fet_slope(1), c_double)
70 if ( fet_exponent(1) >
ftinyval)
then
76 if ( fet_constant(1) >
ftinyval)
then
82 print *,
"****************************************************************************"
83 print *,
"initializing Hargreaves ET parameters"
84 print *,
"****************************************************************************"
120 integer (c_int),
intent(in) :: idayofyear
121 integer (c_int),
intent(in) :: inumdaysinyear
122 real (c_float),
intent(in) :: flatitude
123 real (c_float),
intent(in) :: ftmin
124 real (c_float),
intent(in) :: ftmax
125 real (c_double) :: freferenceet0
128 real (c_double) :: fdelta, fomega_s, fd_r, fra
129 real (c_double) :: dlatitude_radians
151 real (c_double),
intent(in) :: rra
152 real (c_float),
intent(in) :: rtminf
153 real (c_float),
intent(in) :: rtmaxf
156 real (c_double) :: ret_0
159 real (c_double) :: rtdelta
160 real (c_double) :: rtavg
162 rtavg = (rtminf + rtmaxf) / 2.0_c_double
164 rtdelta = abs(
f_to_k(real(rtmaxf, c_double)) -
f_to_k(real(rtminf, c_double)))
This module contains physical constants and convenience functions aimed at performing unit conversion...
real(c_float), parameter, public rzero
real(c_double), parameter, public degrees_to_radians
real(c_float), parameter ftinyval
Calculates potential evapotranspiration by means of the Hargreaves-Samani (1985) method.
real(c_double) et_constant
impure elemental real(c_double) function et_hargreaves_calculate(idayofyear, inumdaysinyear, flatitude, ftmin, ftmax)
real(c_double) et_exponent
subroutine et_hargreaves_initialize()
elemental real(c_double) function et0_hargreaves(rra, rtminf, rtmaxf)
elemental real(c_double) function equivalent_evaporation(rr)
type(parameters_t), public params
elemental real(c_double) function solar_declination__delta(idayofyear, inumdaysinyear)
Calculate the solar declination for a given day of the year.
elemental real(c_double) function relative_earth_sun_distance__d_r(idayofyear, inumdaysinyear)
Calculate the inverse relative Earth-Sun distance for a given day of the year.
elemental real(c_double) function sunrise_sunset_angle__omega_s(dlatitude, ddelta)
Calculate sunrise/sunset angle, in RADIANS.
elemental real(c_double) function extraterrestrial_radiation__ra(dlatitude, ddelta, domega_s, ddsubr)
Calculate extraterrestrial radiation given latitude and time of year.