Skip to content

Commit 6047c4a

Browse files
committed
read shf options block; will need to circle back and test TS functionality later
1 parent c7c0848 commit 6047c4a

File tree

2 files changed

+46
-11
lines changed

2 files changed

+46
-11
lines changed

src/Model/GroundWaterEnergy/PbstBase.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ subroutine read_options(this)
112112
character(len=MAXCHARLEN) :: fname
113113
logical :: isfound
114114
logical :: endOfBlock
115-
logical(LGP) :: foundchildclassoption
115+
logical(LGP) :: found
116116
integer(I4B) :: ierr
117117
! -- formats
118118
character(len=*), parameter :: fmtts = &
@@ -153,11 +153,11 @@ subroutine read_options(this)
153153
case default
154154
!
155155
! -- Check for child class options
156-
call this%pbst_options(keyword, foundchildclassoption)
156+
call this%pbst_options(keyword, found)
157157
!
158158
! -- Defer to subtype to read the option;
159159
! -- if the subtype can't handle it, report an error
160-
if (.not. this%read_option(keyword)) then
160+
if (.not. found) then
161161
write (errmsg, '(a,3(1x,a),a)') &
162162
'Unknown', trim(adjustl(this%packName)), "option '", &
163163
trim(keyword), "'."

src/Model/GroundWaterEnergy/gwe-shf.f90

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,51 @@ subroutine shf_allocate_arrays(this)
108108
!! This routine overrides PbstBaseType%bnd_options
109109
!<
110110
subroutine shf_options(this, option, found)
111-
111+
! -- dummy
112+
class(ShfType), intent(inout) :: this
113+
character(len=*), intent(inout) :: option
114+
logical, intent(inout) :: found
115+
!
112116
found = .true.
113-
foundgcclassoption = .false.
114117
select case (option)
115-
case ('FLOW_PACKAGE_NAME')
116-
call this%parser%GetStringCaps(this%flowpackagename)
117-
write (this%iout, '(4x,a)') &
118-
'THIS '//trim(adjustl(this%text))//' PACKAGE CORRESPONDS TO A GWF &
119-
&PACKAGE WITH THE NAME '//trim(adjustl(this%flowpackagename))
120-
118+
case ('DENSITY_AIR')
119+
this%rhoa = this%parser%GetDouble()
120+
if (this%rhoa <= 0.0) then
121+
write (errmsg, '(a)') 'Specified value for the density of &
122+
&the atmosphere must be greater than 0.0.'
123+
call store_error(errmsg)
124+
call this%parser%StoreErrorUnit()
125+
else
126+
write (this%iout, '(4x,a,1pg15.6)') &
127+
"The density of the atmosphere has been set to: ", this%rhoa
128+
end if
129+
case ('HEAT_CAPACITY_AIR')
130+
this%cpa = this%parser%GetDouble()
131+
if (this%cpa <= 0.0) then
132+
write (errmsg, '(a)') 'Specified value for the heat capacity of &
133+
&the atmosphere must be greater than 0.0.'
134+
call store_error(errmsg)
135+
call this%parser%StoreErrorUnit()
136+
else
137+
write (this%iout, '(4x,a,1pg15.6)') &
138+
"The heat capacity of the atmosphere has been set to: ", this%cpa
139+
end if
140+
case ('DRAG_COEFFICIENT')
141+
this%cd = this%parser%GetDouble()
142+
if (this%cd <= 0.0) then
143+
write (errmsg, '(a)') 'Specified value for the drag coefficient &
144+
&must be greater than 0.0.'
145+
call store_error(errmsg)
146+
call this%parser%StoreErrorUnit()
147+
else
148+
write (this%iout, '(4x,a,1pg15.6)') &
149+
"The heat capacity of the atmosphere has been set to: ", this%cpa
150+
end if
151+
case default
152+
write (errmsg, '(a,a)') 'Unknown SHF option: ', trim(option)
153+
call store_error(errmsg)
154+
call this%parser%StoreErrorUnit()
155+
end select
121156
end subroutine shf_options
122157

123158
!> @brief Deallocate package memory

0 commit comments

Comments
 (0)