From 902b6e8a33c99433bff87bd74cf1a391a2d772f9 Mon Sep 17 00:00:00 2001 From: Eric Morway Date: Thu, 10 Aug 2023 12:35:04 -0700 Subject: [PATCH] fixes https://github.com/MODFLOW-USGS/modflow6/pull/1306#discussion_r1272214064 --- src/Model/ModelUtilities/GweInputData.f90 | 88 +++++++++++------------ 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/Model/ModelUtilities/GweInputData.f90 b/src/Model/ModelUtilities/GweInputData.f90 index 4507ecc3051..32e388321d7 100644 --- a/src/Model/ModelUtilities/GweInputData.f90 +++ b/src/Model/ModelUtilities/GweInputData.f90 @@ -22,11 +22,11 @@ module GweInputDataModule character(len=LENMEMPATH) :: memoryPath = '' !< the location in the memory manager where the variables are stored ! mst data to be share across multiple packages - real(DP), pointer :: gwerhow => null() !< Density of water (for GWE purposes, a constant scalar) - real(DP), pointer :: gwecpw => null() !< Heat capacity of water (non-spatially varying) - real(DP), pointer :: gwelatheatvap => null() !< latent heat of vaporization - real(DP), dimension(:), pointer, contiguous :: gwerhos => null() !< Density of the aquifer material - real(DP), dimension(:), pointer, contiguous :: gwecps => null() !< Heat capacity of solids (spatially varying) + real(DP), pointer :: rhow => null() !< Density of water (for GWE purposes, a constant scalar) + real(DP), pointer :: cpw => null() !< Heat capacity of water (non-spatially varying) + real(DP), pointer :: latheatvap => null() !< latent heat of vaporization + real(DP), dimension(:), pointer, contiguous :: rhos => null() !< Density of the aquifer material + real(DP), dimension(:), pointer, contiguous :: cps => null() !< Heat capacity of solids (spatially varying) contains @@ -91,19 +91,19 @@ subroutine allocate_shared_vars(this, nodes) integer(I4B) :: i ! ------------------------------------------------------------------- ! - allocate (this%gwecpw) - allocate (this%gwerhow) - allocate (this%gwelatheatvap) - allocate (this%gwerhos(nodes)) - allocate (this%gwecps(nodes)) + allocate (this%cpw) + allocate (this%rhow) + allocate (this%latheatvap) + allocate (this%rhos(nodes)) + allocate (this%cps(nodes)) ! ! -- Initialize values - this%gwecpw = DZERO - this%gwerhow = DZERO - this%gwelatheatvap = DZERO + this%cpw = DZERO + this%rhow = DZERO + this%latheatvap = DZERO do i = 1, nodes - this%gwecps(i) = DZERO - this%gwerhos(i) = DZERO + this%cps(i) = DZERO + this%rhos(i) = DZERO end do ! ! -- return @@ -117,27 +117,27 @@ 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, gwerhos, gwecps, & - gwelatheatvap) + subroutine set_gwe_dat_ptrs(this, rhow, cpw, rhos, cps, & + latheatvap) ! -- modules ! -- dummy class(GweInputDataType) :: this !< the input data block - real(DP), intent(in) :: gwerhow !< ptr to density of water specified in MST - real(DP), intent(in) :: gwecpw !< ptr to heat capacity of water specified in MST - real(DP), intent(in) :: gwerhos !< ptr to sptially-variably density of aquifer material specified in MST - real(DP), intent(in) :: gwecps !< ptr to sptially-variably heat capacity of aquifer material specified in MST - real(DP), intent(in), optional :: gwelatheatvap !< ptr to latent heat of vaporization specified in MST + real(DP), intent(in) :: rhow !< ptr to density of water specified in MST + real(DP), intent(in) :: cpw !< ptr to heat capacity of water specified in MST + real(DP), intent(in) :: rhos !< ptr to sptially-variably density of aquifer material specified in MST + real(DP), intent(in) :: cps !< ptr to sptially-variably heat capacity of aquifer material specified in MST + real(DP), intent(in), optional :: latheatvap !< ptr to latent heat of vaporization specified in MST ! ------------------------------------------------------------------- ! ! -- Allocate scalars - if (present(gwelatheatvap)) then - call this%set_gwe_shared_scalars(gwerhow, gwecpw, gwelatheatvap) + if (present(latheatvap)) then + call this%set_gwe_shared_scalars(rhow, cpw, latheatvap) else - call this%set_gwe_shared_scalars(gwerhow, gwecpw) + call this%set_gwe_shared_scalars(rhow, cpw) end if ! ! -- Allocate arrays - call this%set_gwe_shared_arrays(gwerhos, gwecps) + call this%set_gwe_shared_arrays(rhos, cps) ! ! -- return return @@ -152,24 +152,24 @@ end subroutine set_gwe_dat_ptrs !! of vaporization. !! !< - subroutine set_gwe_shared_scalars(this, gwerhow, gwecpw, gwelatheatvap) + subroutine set_gwe_shared_scalars(this, rhow, cpw, latheatvap) ! -- modules ! -- dummy class(GweInputDataType) :: this !< GweInputDataType object - real(DP), intent(in) :: gwerhow - real(DP), intent(in) :: gwecpw - real(DP), intent(in), optional :: gwelatheatvap + real(DP), intent(in) :: rhow + real(DP), intent(in) :: cpw + real(DP), intent(in), optional :: latheatvap ! -- local ! ------------------------------------------------------------------- ! ! -- Set the pointers ! -- Fixed density of water to be used by GWE - this%gwerhow = gwerhow + this%rhow = rhow ! -- 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 + this%cpw = cpw ! -- Latent heat of vaporization - if (present(gwelatheatvap)) then - this%gwelatheatvap = gwelatheatvap + if (present(latheatvap)) then + this%latheatvap = latheatvap end if ! ! -- return @@ -183,20 +183,20 @@ end subroutine set_gwe_shared_scalars !! by multiple packages. !! !< - subroutine set_gwe_shared_arrays(this, gwerhos, gwecps) + subroutine set_gwe_shared_arrays(this, rhos, cps) ! -- modules ! -- dummy class(GweInputDataType) :: this !< GweInputDataType object - real(DP), intent(in) :: gwerhos - real(DP), intent(in) :: gwecps + real(DP), intent(in) :: rhos + real(DP), intent(in) :: cps ! -- local ! ------------------------------------------------------------------- ! ! -- Set the pointers ! -- Spatially-variable density of aquifer solid material - this%gwerhos = gwerhos + this%rhos = rhos ! -- Spatially-variable heat capacity of aquifer solid material - this%gwecps = gwecps + this%cps = cps ! ! -- return return @@ -213,13 +213,13 @@ subroutine gweshared_dat_da(this) class(GweInputDataType) :: this !< the input data block ! ! -- Scalars - deallocate (this%gwelatheatvap) - deallocate (this%gwerhow) - deallocate (this%gwecpw) + deallocate (this%latheatvap) + deallocate (this%rhow) + deallocate (this%cpw) ! ! -- Arrays - deallocate (this%gwerhos) - deallocate (this%gwecps) + deallocate (this%rhos) + deallocate (this%cps) ! ! -- return return