Soil Water Balance (SWB2)
Toggle main menu visibility
Loading...
Searching...
No Matches
et__hargreaves_samani.F90
Go to the documentation of this file.
1
!> @file
2
!> Contains a single module, et_hargreaves, which
3
!> calculates potential evapotranspiration by means of the Hargreaves-Samani (1985) method.
4
5
6
!> Calculates potential evapotranspiration by means of the
7
!> Hargreaves-Samani (1985) method.
8
module
et__hargreaves_samani
9
!!****h* SWB/et_hargreaves
10
! NAME
11
! et_hargreaves.f95 - Evapotranspiration calculation using the
12
! Hargreaves method.
13
!
14
! SYNOPSIS
15
! This module calculates evapotranspiration using the Hargreaves
16
! method.
17
!
18
! NOTES
19
!
20
! Reference:
21
!
22
! Allen, R.G., and others, 2006, FAO Irrigation and Drainage Paper No. 56,
23
! "Crop Evapotranspiration (Guidelines for computing crop water
24
! requirements)", Food and Agriculture Organization, Rome, Italy.
25
!
26
!!***
27
28
use
iso_c_binding,
only
: c_short, c_int, c_float, c_double
29
use
constants_and_conversions
30
use
fstring
,
only
:
ascharacter
31
use
logfiles
,
only
:
logs
,
log_all
32
use
meteorological_calculations
33
use
parameters
,
only
:
params
34
use
solar_calculations
35
36
implicit none
37
38
39
! ET parameters -- default values are from Hargreaves and Samani (1985)
40
real
(c_double) ::
et_slope
! = 0.0023
41
real
(c_double) ::
et_exponent
! = 0.5
42
real
(c_double) ::
et_constant
! = 17.8
43
44
contains
45
46
subroutine
et_hargreaves_initialize
( )
!pConfig, sRecord )
47
!! Configures the module, using the command line in 'sRecord'
48
! [ ARGUMENTS ]
49
! type (T_MODEL_CONFIGURATION), pointer :: pConfig ! pointer to data structure that contains
50
! model options, flags, and other settings
51
! character (len=*),intent(inout) :: sRecord
52
53
! [ LOCALS ]
54
55
real
(kind=c_float),
allocatable
:: fet_slope(:)
56
real
(kind=c_float),
allocatable
:: fet_exponent(:)
57
real
(kind=c_float),
allocatable
:: fet_constant(:)
58
59
call
params
%get_parameters( skey=
"Hargreaves_ET_slope"
, fvalues=fet_slope)
60
call
params
%get_parameters( skey=
"Hargreaves_ET_exponent"
, fvalues=fet_exponent)
61
call
params
%get_parameters( skey=
"Hargreaves_ET_constant"
, fvalues=fet_constant)
62
63
if
( fet_slope(1) >
ftinyval
)
then
64
et_slope
= real(fet_slope(1), c_double)
65
else
66
et_slope
= 0.0023_c_double
67
endif
68
69
if
( fet_exponent(1) >
ftinyval
)
then
70
et_exponent
= real(fet_exponent(1), c_double)
71
else
72
et_exponent
= 0.5_c_double
73
endif
74
75
if
( fet_constant(1) >
ftinyval
)
then
76
et_constant
= real(fet_constant(1), c_double)
77
else
78
et_constant
= 17.8_c_double
79
endif
80
81
call
logs
%write(
"****************************************************************************"
)
82
call
logs
%write(
"initializing Hargreaves ET parameters"
)
83
call
logs
%write(
"****************************************************************************"
)
84
call
logs
%write(
" ET_SLOPE = "
//
ascharacter
(real(
et_slope
, c_float)))
85
call
logs
%write(
" ET_EXPONENT = "
//
ascharacter
(real(
et_exponent
, c_float)))
86
call
logs
%write(
" ET_CONSTANT = "
//
ascharacter
(real(
et_constant
, c_float)))
87
88
! write(UNIT=LU_LOG,FMT=*) "Configuring Hargreaves PET model"
89
90
! if (pConfig%rSouthernLatitude <= rNO_DATA_NCDC &
91
! .or. pConfig%rNorthernLatitude <= rNO_DATA_NCDC) then
92
93
! call Chomp( sRecord,sOption )
94
! read ( unit=sOption, fmt=*, iostat=iStat ) rValue
95
! call Assert( iStat == 0, "Could not read the southerly latitude" )
96
! pConfig%rSouthernLatitude = dpTWOPI * rValue / 360.0_c_float
97
98
! call Chomp( sRecord,sOption )
99
! read ( unit=sOption, fmt=*, iostat=iStat ) rValue
100
! call Assert( iStat == 0, "Could not read the northerly latitude" )
101
! pConfig%rNorthernLatitude = dpTWOPI * rValue / 360.0_c_float
102
103
! else
104
105
! call echolog("Southern and northern latitude values have been determined" &
106
! //"~from project grid bounds and projection parameters. The values supplied" &
107
! //"~with the Hargreaves PET option will be ignored...")
108
109
! endif
110
111
end subroutine
et_hargreaves_initialize
112
113
!------------------------------------------------------------------------------
114
115
impure
elemental
function
et_hargreaves_calculate
( iDayOfYear, iNumDaysInYear, fLatitude, fTMin, fTMax )
result
(fReferenceET0)
116
!! Computes the potential ET for each cell, based on TMIN and TMAX.
117
!! Stores cell-by-cell PET values in the model grid.
118
119
integer (c_int)
,
intent(in)
:: idayofyear
120
integer (c_int)
,
intent(in)
:: inumdaysinyear
121
real
(c_float),
intent(in)
:: flatitude
122
real
(c_float),
intent(in)
:: ftmin
123
real
(c_float),
intent(in)
:: ftmax
124
real
(c_double) :: freferenceet0
125
126
! [ LOCALS ]
127
real
(c_double) :: fdelta, fomega_s, fd_r, fra
128
real
(c_double) :: dlatitude_radians
129
130
dlatitude_radians = flatitude *
degrees_to_radians
131
132
fd_r =
relative_earth_sun_distance__d_r
(idayofyear,inumdaysinyear)
133
fdelta =
solar_declination__delta
(idayofyear, inumdaysinyear)
134
135
fomega_s =
sunrise_sunset_angle__omega_s
(dlatitude_radians, fdelta)
136
137
! NOTE that the following equation returns extraterrestrial radiation in
138
! MJ / m**2 / day. The Hargreaves equation requires extraterrestrial
139
! radiation to be expressed in units of mm / day.
140
fra =
extraterrestrial_radiation__ra
(dlatitude_radians, fdelta, fomega_s, fd_r)
141
142
freferenceet0 =
et0_hargreaves
(
equivalent_evaporation
(fra), ftmin, ftmax)
143
144
end function
et_hargreaves_calculate
145
146
147
elemental
function
et0_hargreaves
( rRa, rTMinF, rTMaxF )
result
(rET_0)
148
149
! [ ARGUMENTS ]
150
real
(c_double),
intent(in)
:: rra
151
real
(c_float),
intent(in)
:: rtminf
152
real
(c_float),
intent(in)
:: rtmaxf
153
154
! [ RETURN VALUE ]
155
real
(c_double) :: ret_0
156
157
! [ LOCALS ]
158
real
(c_double) :: rtdelta
159
real
(c_double) :: rtavg
160
161
rtavg = (rtminf + rtmaxf) / 2.0_c_double
162
163
rtdelta = abs(
f_to_k
(real(rtmaxf, c_double)) -
f_to_k
(real(rtminf, c_double)))
164
165
ret_0 = max(
dzero
, &
166
mm_to_in
(
et_slope
* rra * (
f_to_c
(rtavg) +
et_constant
) * (rtdelta**
et_exponent
) ) )
167
! mm_to_in( 0.0023_c_float * rRa * (F_to_C(rTavg) + 17.8_c_float) * sqrt(rTDelta)) )
168
169
end function
et0_hargreaves
170
171
172
end module
et__hargreaves_samani
constants_and_conversions
This module contains physical constants and convenience functions aimed at performing unit conversion...
Definition
constants_and_conversions.F90:8
constants_and_conversions::dzero
real(c_double), parameter dzero
Definition
constants_and_conversions.F90:55
constants_and_conversions::degrees_to_radians
real(c_double), parameter, public degrees_to_radians
Definition
constants_and_conversions.F90:30
constants_and_conversions::ftinyval
real(c_float), parameter ftinyval
Definition
constants_and_conversions.F90:47
et__hargreaves_samani
Calculates potential evapotranspiration by means of the Hargreaves-Samani (1985) method.
Definition
et__hargreaves_samani.F90:8
et__hargreaves_samani::et_constant
real(c_double) et_constant
Definition
et__hargreaves_samani.F90:42
et__hargreaves_samani::et_hargreaves_calculate
impure elemental real(c_double) function et_hargreaves_calculate(idayofyear, inumdaysinyear, flatitude, ftmin, ftmax)
Definition
et__hargreaves_samani.F90:116
et__hargreaves_samani::et_exponent
real(c_double) et_exponent
Definition
et__hargreaves_samani.F90:41
et__hargreaves_samani::et_hargreaves_initialize
subroutine et_hargreaves_initialize()
Definition
et__hargreaves_samani.F90:47
et__hargreaves_samani::et_slope
real(c_double) et_slope
Definition
et__hargreaves_samani.F90:40
et__hargreaves_samani::et0_hargreaves
elemental real(c_double) function et0_hargreaves(rra, rtminf, rtmaxf)
Definition
et__hargreaves_samani.F90:148
fstring
Definition
fstring.F90:1
logfiles
Definition
logfiles.F90:1
logfiles::logs
type(logfile_t), public logs
Definition
logfiles.F90:62
logfiles::log_all
@ log_all
Definition
logfiles.F90:22
meteorological_calculations
Definition
meteorological_calculations.F90:1
meteorological_calculations::equivalent_evaporation
elemental real(c_double) function equivalent_evaporation(rr)
Definition
meteorological_calculations.F90:46
parameters
Definition
parameters.F90:1
parameters::params
type(parameters_t), public params
Definition
parameters.F90:68
solar_calculations
Definition
solar_calculations.F90:1
solar_calculations::solar_declination__delta
elemental real(c_double) function solar_declination__delta(idayofyear, inumdaysinyear)
Calculate the solar declination for a given day of the year.
Definition
solar_calculations.F90:168
solar_calculations::relative_earth_sun_distance__d_r
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.
Definition
solar_calculations.F90:215
solar_calculations::sunrise_sunset_angle__omega_s
elemental real(c_double) function sunrise_sunset_angle__omega_s(dlatitude, ddelta)
Calculate sunrise/sunset angle, in RADIANS.
Definition
solar_calculations.F90:246
solar_calculations::extraterrestrial_radiation__ra
elemental real(c_double) function extraterrestrial_radiation__ra(dlatitude, ddelta, domega_s, ddsubr)
Calculate extraterrestrial radiation given latitude and time of year.
Definition
solar_calculations.F90:77
constants_and_conversions::f_to_c
Definition
constants_and_conversions.F90:104
constants_and_conversions::f_to_k
Definition
constants_and_conversions.F90:110
constants_and_conversions::mm_to_in
Definition
constants_and_conversions.F90:170
fstring::ascharacter
Definition
fstring.F90:44
src
et__hargreaves_samani.F90
Generated on
for Soil Water Balance (SWB2) by
1.17.0