Skip to content

Commit

Permalink
chore(gwf3ic8.f90): cleanup docstrings in IC (#1462)
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs authored Dec 4, 2023
1 parent c1815cc commit f4429ce
Showing 1 changed file with 26 additions and 11 deletions.
37 changes: 26 additions & 11 deletions src/Model/GroundWaterFlow/gwf3ic8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,23 @@ module GwfIcModule
public :: ic_cr

type, extends(NumericalPackageType) :: GwfIcType

real(DP), dimension(:), pointer, contiguous :: strt => null() ! starting head

contains

procedure :: ic_ar
procedure :: ic_da
procedure, private :: ic_load
procedure, private :: allocate_arrays
procedure, private :: source_griddata

end type GwfIcType

contains

!> @brief Create a new initial conditions object
!<
subroutine ic_cr(ic, name_model, input_mempath, inunit, iout, dis)
! -- modules
use MemoryManagerExtModule, only: mem_set_value
Expand All @@ -38,23 +43,23 @@ subroutine ic_cr(ic, name_model, input_mempath, inunit, iout, dis)
character(len=*), parameter :: fmtic = &
"(1x, /1x, 'IC -- Initial Conditions Package, Version 8, 3/28/2015', &
&' input read from mempath: ', A, //)"

!
! -- create IC object
allocate (ic)

!
! -- create name and memory path
call ic%set_names(1, name_model, 'IC', 'IC', input_mempath)

!
! -- allocate scalars
call ic%allocate_scalars()

!
! -- set variables
ic%inunit = inunit
ic%iout = iout

!
! -- set pointers
ic%dis => dis

!
! -- check if pkg is enabled,
if (inunit > 0) then
! print message identifying pkg
Expand All @@ -63,31 +68,39 @@ subroutine ic_cr(ic, name_model, input_mempath, inunit, iout, dis)
end subroutine ic_cr

!> @brief Load data from IDM into package
!<
subroutine ic_load(this)
! -- modules
use BaseDisModule, only: DisBaseType
! -- dummy
class(GwfIcType) :: this
!
call this%source_griddata()
end subroutine ic_load

!> @brief Allocate arrays, load from IDM, and assign head.
!> @brief Allocate arrays, load from IDM, and assign head
!<
subroutine ic_ar(this, x)
! -- dummy
class(GwfIcType) :: this
real(DP), dimension(:), intent(inout) :: x
! -- local
integer(I4B) :: n

!
! -- allocate arrays
call this%allocate_arrays(this%dis%nodes)

!
! -- load from IDM
call this%ic_load()

!
! -- assign starting head
do n = 1, this%dis%nodes
x(n) = this%strt(n)
end do
end subroutine ic_ar

!> @brief Deallocate
!<
subroutine ic_da(this)
! -- modules
use MemoryManagerModule, only: mem_deallocate
Expand All @@ -106,7 +119,8 @@ subroutine ic_da(this)
call this%NumericalPackageType%da()
end subroutine ic_da

! @brief Allocate arrays
!> @brief Allocate arrays
!<
subroutine allocate_arrays(this, nodes)
! -- modules
use MemoryManagerModule, only: mem_allocate
Expand All @@ -119,6 +133,7 @@ subroutine allocate_arrays(this, nodes)
end subroutine allocate_arrays

!> @brief Copy grid data from IDM into package
!<
subroutine source_griddata(this)
! -- modules
use SimModule, only: store_error, store_error_filename
Expand Down

0 comments on commit f4429ce

Please sign in to comment.