Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Aug 18, 2023
1 parent 506e4e5 commit 82f56ec
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions src/Model/ModelUtilities/GweInputData.f90
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 82f56ec

Please sign in to comment.