Unverified Commit 88043e2c authored by Graham, Aaron's avatar Graham, Aaron Committed by GitHub
Browse files

Fix uninitialized value in IAPWS module (#321)

* Fix uninitialized value in IAPWS module

* Make ireg intent out in regsopt
parent 149910ce
......@@ -3209,7 +3209,7 @@ ENDFUNCTION tph5n
SUBROUTINE regsopt(P, T, ireg)
REAL(SRK), INTENT(IN) :: P
REAL(SRK), INTENT(IN) :: T
INTEGER(SIK), INTENT(INOUT) :: ireg
INTEGER(SIK), INTENT(OUT) :: ireg
REAL(SRK), PARAMETER :: &
rpsr = 5.E-4_SRK, &! relative tolerance value. should not be lower than 2.E-4
......@@ -3219,22 +3219,19 @@ SUBROUTINE regsopt(P, T, ireg)
REAL(SRK), SAVE :: told = 0.0_SRK, pold = 0.0_SRK
INTEGER(SIK), SAVE :: iregold = 0
IF (ireg /= 0 .AND. ireg /= 1 .AND. ireg /= 2 .AND. ireg /= 3 .AND. ireg /= 5 .AND. ireg /= 9) ireg = 0
IF ((ABS(t - told) < tolerance) .AND. (ABS(p - pold) < tolerance)) THEN
ireg = iregold
RETURN
ENDIF
ireg = 0
! (czd)
! change cut off for region 5 to 900 c to account for limit of transport properties
IF ((t < 273.15_SRK) .OR. (t > 1173.15_SRK) .OR. (p > 100.0_SRK) .OR. (p < 5.0E-4_SRK)) THEN
ireg = 0
RETURN
RETURN !Leave ireg==0
ENDIF
ireg = 0
! include a REAL(SRKative tolerance value (czd)
! this was included to better estimate if the t,p where in
! a saturated region (ireg=9). failure to set ireg=9 causes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment