Skip to content

Commit

Permalink
use existing prms code to reset freeh2o and pk_ice when pkwatere_equi…
Browse files Browse the repository at this point in the history
…v is <= DNEARZERO
  • Loading branch information
jmccreight committed Nov 1, 2023
1 parent 03981a8 commit f32017d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Binary file modified bin/prms_mac_m1_ifort_dbl_prec
Binary file not shown.
14 changes: 3 additions & 11 deletions prms_src/prms5.2.1/prms/snowcomp.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ INTEGER FUNCTION snorun()


! LAST check to clear out all arrays if packwater is gone
IF ( Pkwater_equiv(i)<=0.0D0 ) THEN
IF ( Pkwater_equiv(i) <= DNEARZERO ) THEN
IF ( Print_debug>DEBUG_less ) THEN
IF ( Pkwater_equiv(i)<-DNEARZERO ) &
& PRINT *, 'Snowpack problem, pkwater_equiv negative, HRU:', i, ' value:', Pkwater_equiv(i)
Expand All @@ -1458,8 +1458,8 @@ INTEGER FUNCTION snorun()
Snowcov_area(i) = 0.0
Pk_def(i) = 0.0
Pk_temp(i) = 0.0
Pk_ice(i) = 0.0
Freeh2o(i) = 0.0
Pk_ice(i) = 0.0D0
Freeh2o(i) = 0.0D0
Snowcov_areasv(i) = 0.0 ! rsr, not in original code
Ai(i) = 0.0D0
Frac_swe(i) = 0.0
Expand Down Expand Up @@ -1488,14 +1488,6 @@ INTEGER FUNCTION snorun()
Basin_snowdepth = Basin_snowdepth + Pk_depth(i)*DBLE( Hru_area(i) )
Basin_tcal = Basin_tcal + DBLE( Tcal(i)*Hru_area(i) )

! Enforce consistency between prognostic and diagnostic vars when for these small values
! causes issues with prms_canopy
if (pkwater_equiv(i) < DNEARZERO) then
pkwater_equiv(i) = 0.0D0
pk_ice(i) = 0.0D0
freeh2o(i) = 0.0D0
end if

ENDDO

! Area normalize basin totals
Expand Down

0 comments on commit f32017d

Please sign in to comment.