Skip to content

Commit

Permalink
Merge pull request ESCOMP#2053 from slevis-lmwg/small_snocan_to_zero
Browse files Browse the repository at this point in the history
Change small snocan to zero
  • Loading branch information
slevis-lmwg authored Sep 13, 2023
2 parents 4f4a683 + 9fd0612 commit 350a436
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
76 changes: 76 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,80 @@
===============================================================
Tag name: ctsm5.1.dev141
Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310)
Date: Wed Sep 13 13:58:04 MDT 2023
One-line Summary: Change small snocan to zero

Purpose and description of changes
----------------------------------

Issues #2041 and #2048 discuss and resolve a test failure in the ctsm5.2
branch. The failure goes away when we reset small snocan to zero.

Bill Sacks recommended merging this change in ctsm5.1 and then updating
the ctsm5.2 branch to the latest ctsm5.1.


Significant changes to scientifically-supported configurations
--------------------------------------------------------------

Does this tag change answers significantly for any of the following physics configurations?
(Details of any changes will be given in the "Answer changes" section below.)

[Put an [X] in the box for any configuration with significant answer changes.]

[ ] clm5_1

[ ] clm5_0

[ ] ctsm5_0-nwp

[ ] clm4_5


Bugs fixed or introduced
------------------------
CTSM issues fixed (include CTSM Issue #):
Fixes #2041
Fixes #2048


Testing summary:
----------------

[PASS means all tests PASS; OK means tests PASS other than expected fails.]

regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing):

cheyenne ---- OK
izumi ------- OK


Answer changes
--------------

Changes answers relative to baseline:
Yes

Summarize any changes to answers, i.e.,
- what code configurations: All
- what platforms/compilers: All
- nature of change: roundoff

The answer changes are expected to be roundoff-level because the code change
just truncates roundoff-level greater-than-zero states to exactly zero for
snocan that most likely needed to be zero anyway.

The answer changes grow to greater than roundoff, but the
cprnc.out file from a 20-year izumi test-suite case does not contain
differences of concerning magnitude.

Other details
-------------
Pull Requests that document the changes (include PR ids):
https://github.com/ESCOMP/ctsm/pull/2053

===============================================================
===============================================================
Tag name: ctsm5.1.dev140
Originator(s): afoster (Adrianna Foster)
Date: Tue Sep 12 14:47:06 MDT 2023
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm5.1.dev141 slevis 09/13/2023 Change small snocan to zero
ctsm5.1.dev140 afoster 09/12/2023 add lai_streams capability for FATES
ctsm5.1.dev139 slevis 08/28/2023 Fix problems uncovered by nag -nan tests
ctsm5.1.dev138 slevis 08/25/2023 Refactor max_patch_per_col and maxsoil_patches loops
Expand Down
11 changes: 11 additions & 0 deletions src/biogeophys/CanopyFluxesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ module CanopyFluxesMod
use EDTypesMod , only : ed_site_type
use SoilWaterRetentionCurveMod, only : soil_water_retention_curve_type
use LunaMod , only : Update_Photosynthesis_Capacity, Acc24_Climate_LUNA,Acc240_Climate_LUNA,Clear24_Climate_LUNA
use NumericsMod , only : truncate_small_values
!
! !PUBLIC TYPES:
implicit none
Expand Down Expand Up @@ -422,6 +423,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
real(r8) :: uuc(bounds%begp:bounds%endp) ! undercanopy windspeed
real(r8) :: carea_stem ! cross-sectional area of stem
real(r8) :: dlrad_leaf ! Downward longwave radition from leaf
real(r8) :: snocan_baseline(bounds%begp:bounds%endp) ! baseline of snocan for use in truncate_small_values

! Indices for raw and rah
integer, parameter :: above_canopy = 1 ! Above canopy
Expand Down Expand Up @@ -1599,6 +1601,9 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
cgrndl(p) = cgrndl(p) + forc_rho(c)*wtgq(p)*wtalq(p)*dqgdT(c)
cgrnd(p) = cgrnds(p) + cgrndl(p)*htvp(c)

! save before updating
snocan_baseline(p) = snocan(p)

! Update dew accumulation (kg/m2)
if (t_veg(p) > tfrz ) then ! above freezing, update accumulation in liqcan
if ((qflx_evap_veg(p)-qflx_tran_veg(p))*dtime > liqcan(p)) then ! all liq evap
Expand All @@ -1616,6 +1621,12 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp,
end if

end do

! Remove snocan that got reduced by more than a factor of rel_epsilon
! snocan < rel_epsilon * snocan_baseline will be set to zero
! See NumericsMod for rel_epsilon value
call truncate_small_values(fn, filterp, begp, endp, &
snocan_baseline(begp:endp), snocan(begp:endp))

if ( use_fates ) then

Expand Down

0 comments on commit 350a436

Please sign in to comment.