Skip to content

Commit

Permalink
fix(gwe-est): add error checks for user-specified values of 0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emorway-usgs committed Aug 6, 2024
1 parent 8124ad4 commit c334441
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions doc/ReleaseNotes/develop.tex
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
\item When using SFT in a model where some of the stream reaches are not connected to an active GWF cell (the cellid parameter is set equal to either 0 or NONE) memory access violations were occurring. The program was fixed by setting the correct number of reaches connected to GWF cells. The program was tested using a new example with a DISU grid type and multiple GWF cells deactivated (idomain equals 0) that host SFR reaches.
\item Support for temperature observations was missing in the Observation (OBS) utility for a GWE model and has been added.
\item UZF was not writing a message to the GWF listing file when it had finished reading the PACKAGEDATA block. An appropriate message is now written to the GWF listing file.
\item Error checking was added to the EST package to ensure that the inputs HEAT\_CAPACITY\_WATER and DENSITY\_WATER are not 0.0. Values of 0.0 for either parameter result in a divide by zero error.

% \item xxx
\end{itemize}
Expand Down
28 changes: 22 additions & 6 deletions src/Model/GroundWaterEnergy/gwe-est.f90
Original file line number Diff line number Diff line change
Expand Up @@ -680,14 +680,30 @@ subroutine read_options(this)
write (this%iout, fmtidcy2)
case ('HEAT_CAPACITY_WATER')
this%cpw = this%parser%GetDouble()
write (this%iout, '(4x,a,1pg15.6)') &
'Heat capacity of the water has been set to: ', &
this%cpw
if (this%cpw <= 0.0) then
write (errmsg, '(a)') 'SPECIFIED VALUE FOR THE HEAT CAPACITY OF &
&WATER MUST BE GREATER THAN 0.0 OR A DIVIDE BY ZERO ERROR &
&WILL OCCUR.'
call store_error(errmsg)
call this%parser%StoreErrorUnit()
else
write (this%iout, '(4x,a,1pg15.6)') &
'Heat capacity of the water has been set to: ', &
this%cpw
end if
case ('DENSITY_WATER')
this%rhow = this%parser%GetDouble()
write (this%iout, '(4x,a,1pg15.6)') &
'Density of the water has been set to: ', &
this%rhow
if (this%rhow <= 0.0) then
write (errmsg, '(a)') 'SPECIFIED VALUE FOR THE DENSITY OF &
&WATER MUST BE GREATER THAN 0.0 OR A DIVIDE BY ZERO ERROR &
&WILL OCCUR.'
call store_error(errmsg)
call this%parser%StoreErrorUnit()
else
write (this%iout, '(4x,a,1pg15.6)') &
'Density of the water has been set to: ', &
this%rhow
end if
case ('LATENT_HEAT_VAPORIZATION')
this%latheatvap = this%parser%GetDouble()
write (this%iout, '(4x,a,1pg15.6)') &
Expand Down

0 comments on commit c334441

Please sign in to comment.