Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / hydro / Routing / Reservoirs / Level_Pool / module_levelpool_properties.F90
blob0e4a9dfc00b1821ea1a930caf2ba58370f087716
1 ! This module defines and instantiates objects
2 ! for a level pool type reservoir's
3 ! parameters/properties. Properties holds
4 ! static/unchanging variables that are
5 ! set when the given reservoir object is
6 ! initialized/instantiated.
7 module module_levelpool_properties
9     use module_reservoir, only: reservoir_properties
10     use iso_fortran_env, only: int64
11     implicit none
13     ! Extend/derive level pool properties from the abstract base
14     ! type for reservoir properties.
15     type, extends(reservoir_properties) :: levelpool_properties_interface
16         real :: lake_area                ! area of lake (km^2)
17         real :: weir_elevation           ! bottom of weir elevation (meters AMSL)
18         real :: weir_coeffecient         ! weir coefficient
19         real :: weir_length              ! weir length (meters)
20         real :: dam_length               ! dam length (meters)
21         real :: orifice_elevation        ! orifice elevation (meters AMSL)
22         real :: orifice_coefficient      ! orifice coefficient
23         real :: orifice_area             ! orifice area (meters^2)
24         real :: max_depth                ! max depth of reservoir before overtop (meters)
25         integer(kind=int64) :: lake_number           ! lake number
27     contains
29         procedure :: init => levelpool_properties_init
30         procedure :: destroy => levelpool_properties_destroy
32     end type levelpool_properties_interface
34 contains
36     !Level Pool Properties Constructor
37     subroutine levelpool_properties_init(this, lake_area, &
38         weir_elevation, weir_coeffecient, weir_length, dam_length, orifice_elevation, &
39         orifice_coefficient, orifice_area, max_depth, lake_number)
40         implicit none
41         class(levelpool_properties_interface), intent(inout) :: this ! the type object being initialized
42         real, intent(in)    :: lake_area                ! area of lake (km^2)
43         real, intent(in)    :: weir_elevation           ! bottom of weir elevation (meters AMSL)
44         real, intent(in)    :: weir_coeffecient         ! weir coefficient
45         real, intent(in)    :: weir_length              ! weir length (meters)
46         real, intent(in)    :: dam_length               ! dam length (meters)
47         real, intent(in)    :: orifice_elevation        ! orifice elevation (meters AMSL)
48         real, intent(in)    :: orifice_coefficient      ! orifice coefficient
49         real, intent(in)    :: orifice_area             ! orifice area (meters^2)
50         real, intent(in)    :: max_depth                ! max depth of reservoir before overtop (meters)
51         integer(kind=int64), intent(in) :: lake_number              ! lake number
53         ! Assign the values passed in to a particular level pool reservoir
54         ! properties object's variables.
55         this%lake_area = lake_area
56         this%weir_elevation = weir_elevation
57         this%weir_coeffecient = weir_coeffecient
58         this%weir_length = weir_length
59         this%orifice_elevation = orifice_elevation
60         this%orifice_coefficient = orifice_coefficient
61         this%orifice_area = orifice_area
62         this%max_depth = max_depth
63         this%lake_number = lake_number
64         this%dam_length = dam_length
66     end subroutine levelpool_properties_init
68     !Level Pool Properties Destructor
69     subroutine levelpool_properties_destroy(this)
70         implicit none
71         class(levelpool_properties_interface), intent(inout) :: this ! the type object being destroyed
72     end subroutine levelpool_properties_destroy
74 end module module_levelpool_properties