Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
awc__gridded_values.F90
Go to the documentation of this file.
1!> @file
2!> Contains a single module, awc_gridded_values, which
3!> populates awc by reading available water content directly from a gridded input.
4
5
6!> Populate available water content by reading in
7!> the available water content from a gridded data source.
8
10
11 use iso_c_binding, only : c_short, c_int, c_float, c_double
13 use data_catalog
15 use exceptions
16
17 implicit none
18
19 private
20
22
24
25contains
26
28
29 ! locate the data structure associated with the gridded available water content entries
30 pawc_grid => dat%find("AVAILABLE_WATER_CONTENT")
31 if ( .not. associated(pawc_grid) ) then
32 call warn("An AVAILABLE_WATER_CONTENT grid must be supplied in order to make use of this option.", &
33 __file__, __line__)
34
35 else
36
37 call pawc_grid%getvalues( )
38
39 end if
40
41 end subroutine awc_gridded_values_read
42
43!--------------------------------------------------------------------------------------------------
44
45 subroutine awc_gridded_values_initialize( lActive, fAWC )
46
47 logical (c_bool), intent(in) :: lactive(:,:)
48 real (c_float), intent(inout) :: fawc(:)
49
50 if ( associated( pawc_grid ) ) then
51
52 fawc = pack( pawc_grid%pGrdBase%rData, lactive )
53
54 else
55
56 fawc = -9999.0
57
58 endif
59
61
62end module awc__gridded_values
Populate available water content by reading in the available water content from a gridded data source...
subroutine, public awc_gridded_values_read()
type(data_catalog_entry_t), pointer, public pawc_grid
subroutine, public awc_gridded_values_initialize(lactive, fawc)
This module contains physical constants and convenience functions aimed at performing unit conversion...
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)