diff --git a/src/Model/Connection/GweInterfaceModel.f90 b/src/Model/Connection/GweInterfaceModel.f90 index 1a6636dd362..ce22883260b 100644 --- a/src/Model/Connection/GweInterfaceModel.f90 +++ b/src/Model/Connection/GweInterfaceModel.f90 @@ -195,9 +195,6 @@ subroutine gweifmod_df(this) this%ia => this%dis%con%ia this%ja => this%dis%con%ja ! - ! -- Define shared data (cpw, rhow, latent heat of vaporization) - call this%gwecommon%gweshared_dat_df(this%neq) - ! ! -- Allocate model arrays, now that neq and nja are assigned call this%allocate_arrays() ! diff --git a/src/Model/GroundWaterEnergy/gwe.f90 b/src/Model/GroundWaterEnergy/gwe.f90 index 2d20666e7d3..947584b24c8 100644 --- a/src/Model/GroundWaterEnergy/gwe.f90 +++ b/src/Model/GroundWaterEnergy/gwe.f90 @@ -148,7 +148,6 @@ end subroutine gwe_cr subroutine gwe_df(this) ! -- modules use SimModule, only: store_error - use GweInputDataModule, only: gweshared_dat_df ! -- dummy class(GweModelType) :: this ! -- local @@ -181,9 +180,6 @@ subroutine gwe_df(this) this%ia => this%dis%con%ia this%ja => this%dis%con%ja ! - ! -- Define shared data (cpw, rhow, latent heat of vaporization) - call this%gwecommon%gweshared_dat_df(this%neq) - ! ! -- Allocate model arrays, now that neq and nja are assigned call this%allocate_arrays() ! diff --git a/src/Model/ModelUtilities/GweInputData.f90 b/src/Model/ModelUtilities/GweInputData.f90 index d5d302a4a5f..9914b4f917a 100644 --- a/src/Model/ModelUtilities/GweInputData.f90 +++ b/src/Model/ModelUtilities/GweInputData.f90 @@ -7,7 +7,6 @@ module GweInputDataModule private public :: GweInputDataType public :: gweshared_dat_cr - public :: gweshared_dat_df public :: set_gwe_dat_ptrs !> Data for sharing among multiple packages. Originally read in from @@ -30,78 +29,28 @@ module GweInputDataModule contains - ! -- public - procedure, public :: gweshared_dat_df + ! public procedure, public :: set_gwe_dat_ptrs procedure, public :: gweshared_dat_da - ! -- private - procedure, private :: allocate_shared_vars - procedure, private :: set_gwe_shared_scalars - procedure, private :: set_gwe_shared_arrays + ! private + procedure, private :: set_gwe_scalar_ptrs + procedure, private :: set_gwe_array_ptrs end type GweInputDataType contains -!> @brief Allocate the shared data -!< + !> @brief Allocate the shared data + !< subroutine gweshared_dat_cr(gwe_dat) - ! -- modules - ! -- dummy + ! modules + ! dummy type(GweInputDataType), pointer :: gwe_dat !< the input data block - ! - ! -- Create the object + + ! create the object allocate (gwe_dat) - ! - ! -- Return - return - end subroutine gweshared_dat_cr -!> @brief Define the shared data -!< - subroutine gweshared_dat_df(this, nodes) - ! -- dummy - class(GweInputDataType) :: this !< the input data block - integer(I4B), intent(in) :: nodes - ! -- local - ! - ! -- Allocate variables - call this%allocate_shared_vars(nodes) - ! - ! -- Return - return - end subroutine gweshared_dat_df - - !> @brief Define the information this object holds - !! - !! Allocate strings for storing label names - !! Intended to be analogous to allocate_scalars() - !< - subroutine allocate_shared_vars(this, nodes) - ! -- dummy - class(GweInputDataType) :: this !< TspLabelsType object - integer(I4B), intent(in) :: nodes - ! -- local - integer(I4B) :: i - ! - allocate (this%gwecpw) - allocate (this%gwerhow) - allocate (this%gwelatheatvap) - allocate (this%gwerhos(nodes)) - allocate (this%gwecps(nodes)) - ! - ! -- Initialize values - this%gwecpw = 4.184e3 !< J/(kg*C) @ 20C - this%gwerhow = DEP3 !< kg/m3 @ 20C - this%gwelatheatvap = 2.4535e6 !< J/kg @ 20C - do i = 1, nodes - this%gwecps(i) = DZERO - this%gwerhos(i) = DZERO - end do - ! - ! -- Return - return - end subroutine allocate_shared_vars + end subroutine gweshared_dat_cr !> @brief Allocate and read data from EST !! @@ -110,24 +59,23 @@ end subroutine allocate_shared_vars !! the aquifer material (cps), and density of the aquifer material !! (rhow) is used among other packages and is therefore stored in a !! separate class + !< subroutine set_gwe_dat_ptrs(this, gwerhow, gwecpw, gwelatheatvap, & gwerhos, gwecps) - ! -- dummy + ! dummy class(GweInputDataType) :: this !< the input data block - real(DP), intent(in) :: gwerhow !< ptr to density of water specified in EST - real(DP), intent(in) :: gwecpw !< ptr to heat capacity of water specified in EST - real(DP), intent(in) :: gwelatheatvap !< ptr to latent heat of vaporization specified in EST + real(DP), intent(in), pointer :: gwerhow !< ptr to density of water specified in EST + real(DP), intent(in), pointer :: gwecpw !< ptr to heat capacity of water specified in EST + real(DP), intent(in), pointer :: gwelatheatvap !< ptr to latent heat of vaporization specified in EST real(DP), dimension(:), pointer, contiguous :: gwerhos !< ptr to sptially-variably density of aquifer material specified in EST real(DP), dimension(:), pointer, contiguous :: gwecps !< ptr to sptially-variably heat capacity of aquifer material specified in EST - ! - ! -- Allocate scalars - call this%set_gwe_shared_scalars(gwerhow, gwecpw, gwelatheatvap) - ! - ! -- Allocate arrays - call this%set_gwe_shared_arrays(gwerhos, gwecps) - ! - ! -- Return - return + + ! allocate scalars + call this%set_gwe_scalar_ptrs(gwerhow, gwecpw, gwelatheatvap) + + ! allocate arrays + call this%set_gwe_array_ptrs(gwerhos, gwecps) + end subroutine set_gwe_dat_ptrs !> @brief Set pointers to scalars read by the EST package @@ -138,68 +86,61 @@ end subroutine set_gwe_dat_ptrs !! simulating evaporation will need access to latent heat of !! of vaporization. !< - subroutine set_gwe_shared_scalars(this, gwerhow, gwecpw, gwelatheatvap) - ! -- dummy + subroutine set_gwe_scalar_ptrs(this, gwerhow, gwecpw, gwelatheatvap) + ! dummy class(GweInputDataType) :: this !< GweInputDataType object - real(DP), intent(in) :: gwerhow - real(DP), intent(in) :: gwecpw - real(DP), intent(in), optional :: gwelatheatvap - ! - ! -- Set the pointers - ! -- Fixed density of water to be used by GWE - this%gwerhow = gwerhow - ! -- Spatially constant heat capacity of water ! kluge note: "specific heat" (which is heat capacity per unit mass) is probably the more correct term - this%gwecpw = gwecpw - ! -- Latent heat of vaporization + real(DP), pointer, intent(in) :: gwerhow !< density of water + real(DP), pointer, intent(in) :: gwecpw !< mass-based heat capacity of water + real(DP), pointer, intent(in), optional :: gwelatheatvap !< latent heat of vaporization + + ! set the pointers + ! fixed density of water to be used by GWE (vs GWT-based density) + this%gwerhow => gwerhow + ! spatially constant heat capacity of water ! kluge note: "specific heat" (which is heat capacity per unit mass) is probably the more correct term + this%gwecpw => gwecpw + ! latent heat of vaporization if (present(gwelatheatvap)) then - this%gwelatheatvap = gwelatheatvap + this%gwelatheatvap => gwelatheatvap end if - ! - ! -- Return - return - end subroutine set_gwe_shared_scalars + + end subroutine set_gwe_scalar_ptrs !> @brief Set pointers to data arrays read by the EST package !! for use by other packages !! - !! Set pointers to GWE-related arrays for use - !! by multiple packages. + !! Set pointers to GWE-related arrays for use by multiple packages !< - subroutine set_gwe_shared_arrays(this, gwerhos, gwecps) - ! -- dummy + subroutine set_gwe_array_ptrs(this, gwerhos, gwecps) + ! dummy class(GweInputDataType) :: this !< GweInputDataType object real(DP), dimension(:), pointer, contiguous, intent(in) :: gwerhos real(DP), dimension(:), pointer, contiguous, intent(in) :: gwecps - ! - ! -- Set the pointers - ! -- Spatially-variable density of aquifer solid material - this%gwerhos = gwerhos - ! -- Spatially-variable heat capacity of aquifer solid material - this%gwecps = gwecps - ! - ! -- Return - return - end subroutine set_gwe_shared_arrays + + ! set the pointers + ! spatially-variable density of aquifer solid material + this%gwerhos => gwerhos + ! spatially-variable heat capacity of aquifer solid material + this%gwecps => gwecps + + end subroutine set_gwe_array_ptrs !> @ brief Deallocate memory !! - !! Deallocate GWE shared data array memory + !! Set pointers to null !< subroutine gweshared_dat_da(this) - ! -- dummy + ! dummy class(GweInputDataType) :: this !< the input data block - ! - ! -- Scalars - deallocate (this%gwelatheatvap) - deallocate (this%gwerhow) - deallocate (this%gwecpw) - ! - ! -- Arrays - deallocate (this%gwerhos) - deallocate (this%gwecps) - ! - ! -- Return - return + + ! scalars + this%gwelatheatvap => null() + this%gwerhow => null() + this%gwecpw => null() + + ! arrays + this%gwerhos => null() + this%gwecps => null() + end subroutine gweshared_dat_da end module GweInputDataModule