Skip to content

Commit

Permalink
Merge branch 'peterdschwartz/lnd/resolve-NaN-issues' (PR #5341)
Browse files Browse the repository at this point in the history
Due to NaNs leaking through the initialization phase of ELM, ELM has not been able to
adequately be run in DEBUG mode. The first two commits allow all e3sm_land_developer
tests to complete in DEBUG mode except for the one that fails in MOSART.

Fixes #4820
Fixes #5138
Fixes #4946

[non-BFB]
  • Loading branch information
bishtgautam committed Mar 28, 2023
2 parents 2f5c01d + 189a44d commit a33b6e5
Show file tree
Hide file tree
Showing 21 changed files with 1,937 additions and 1,950 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPRDCTCBC.f19_g16.67a0f98.0401-01-01-00000.nc'
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPRDCTCBC.f19_g16.67a0f98.noNaN.0401-01-01-00000.nc'

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I20TRGSWCNPRDCTCBC.f19_g16.67a0f98.0401-01-01-00000.nc'
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I20TRGSWCNPRDCTCBC.f19_g16.67a0f98.noNaN.0401-01-01-00000.nc'

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPECACNTBC.f19_g16.67a0f98.0201-01-01-00000.nc'
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPECACNTBC.f19_g16.67a0f98.noNaN.0201-01-01-00000.nc'
NFIX_PTASE_plant = .true.

Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPECACNTBC.f19_g16.67a0f98.0201-01-01-00000.nc'
finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_map/clmi.I1850GSWCNPECACNTBC.f19_g16.67a0f98.noNaN.0201-01-01-00000.nc'

5 changes: 2 additions & 3 deletions components/elm/src/biogeochem/FireMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ module FireMod
! !USES:
use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL
use shr_const_mod , only : SHR_CONST_PI,SHR_CONST_TKFRZ
use shr_infnan_mod , only : shr_infnan_isnan
use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print
use shr_strdata_mod , only : shr_strdata_advance
use shr_log_mod , only : errMsg => shr_log_errMsg
Expand Down Expand Up @@ -124,7 +123,7 @@ subroutine FireArea (bounds, &
!$acc routine seq
! !USES:
use elm_varpar , only: max_patch_per_col
use elm_varcon , only: secspday
use elm_varcon , only: secspday, spval
use elm_varctl , only: use_nofire, spinup_state, spinup_mortality_factor
use dynSubgridControlMod , only: run_has_transient_landcover
use pftvarcon , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree
Expand Down Expand Up @@ -370,7 +369,7 @@ subroutine FireArea (bounds, &

! For non-crop -- natural vegetation and bare-soil
if( veg_pp%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then
if( .not. (btran2(p) .ne. btran2(p)))then !?shr_infnan_isnan(btran2(p))) then
if( btran2(p) .ne. spval) then
if (btran2(p) <= 1._r8 ) then
btran_col(c) = btran_col(c)+btran2(p)*veg_pp%wtcol(p)
wtlf(c) = wtlf(c)+veg_pp%wtcol(p)
Expand Down
40 changes: 20 additions & 20 deletions components/elm/src/biogeophys/CanopyStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -118,26 +118,26 @@ subroutine InitAllocate(this, bounds )

allocate(this%frac_veg_nosno_patch (begp:endp)) ; this%frac_veg_nosno_patch (:) = ispval
allocate(this%frac_veg_nosno_alb_patch (begp:endp)) ; this%frac_veg_nosno_alb_patch (:) = 0
allocate(this%tlai_patch (begp:endp)) ; this%tlai_patch (:) = nan
allocate(this%tsai_patch (begp:endp)) ; this%tsai_patch (:) = nan
allocate(this%tlai_hist_patch (begp:endp)) ; this%tlai_hist_patch (:) = nan
allocate(this%tsai_hist_patch (begp:endp)) ; this%tsai_hist_patch (:) = nan
allocate(this%htop_hist_patch (begp:endp)) ; this%htop_hist_patch (:) = nan
allocate(this%elai_patch (begp:endp)) ; this%elai_patch (:) = nan
allocate(this%elai240_patch (begp:endp)) ; this%elai240_patch (:) = nan
allocate(this%esai_patch (begp:endp)) ; this%esai_patch (:) = nan
allocate(this%laisun_patch (begp:endp)) ; this%laisun_patch (:) = nan
allocate(this%laisha_patch (begp:endp)) ; this%laisha_patch (:) = nan
allocate(this%laisun_z_patch (begp:endp,1:nlevcan)) ; this%laisun_z_patch (:,:) = nan
allocate(this%laisha_z_patch (begp:endp,1:nlevcan)) ; this%laisha_z_patch (:,:) = nan
allocate(this%mlaidiff_patch (begp:endp)) ; this%mlaidiff_patch (:) = nan
allocate(this%annlai_patch (12,begp:endp)) ; this%annlai_patch (:,:) = nan
allocate(this%htop_patch (begp:endp)) ; this%htop_patch (:) = nan
allocate(this%hbot_patch (begp:endp)) ; this%hbot_patch (:) = nan
allocate(this%displa_patch (begp:endp)) ; this%displa_patch (:) = nan
allocate(this%fsun_patch (begp:endp)) ; this%fsun_patch (:) = nan
allocate(this%fsun24_patch (begp:endp)) ; this%fsun24_patch (:) = nan
allocate(this%fsun240_patch (begp:endp)) ; this%fsun240_patch (:) = nan
allocate(this%tlai_patch (begp:endp)) ; this%tlai_patch (:) = spval
allocate(this%tsai_patch (begp:endp)) ; this%tsai_patch (:) = spval
allocate(this%tlai_hist_patch (begp:endp)) ; this%tlai_hist_patch (:) = spval
allocate(this%tsai_hist_patch (begp:endp)) ; this%tsai_hist_patch (:) = spval
allocate(this%htop_hist_patch (begp:endp)) ; this%htop_hist_patch (:) = spval
allocate(this%elai_patch (begp:endp)) ; this%elai_patch (:) = spval
allocate(this%elai240_patch (begp:endp)) ; this%elai240_patch (:) = spval
allocate(this%esai_patch (begp:endp)) ; this%esai_patch (:) = spval
allocate(this%laisun_patch (begp:endp)) ; this%laisun_patch (:) = spval
allocate(this%laisha_patch (begp:endp)) ; this%laisha_patch (:) = spval
allocate(this%laisun_z_patch (begp:endp,1:nlevcan)) ; this%laisun_z_patch (:,:) = spval
allocate(this%laisha_z_patch (begp:endp,1:nlevcan)) ; this%laisha_z_patch (:,:) = spval
allocate(this%mlaidiff_patch (begp:endp)) ; this%mlaidiff_patch (:) = spval
allocate(this%annlai_patch (12,begp:endp)) ; this%annlai_patch (:,:) = spval
allocate(this%htop_patch (begp:endp)) ; this%htop_patch (:) = spval
allocate(this%hbot_patch (begp:endp)) ; this%hbot_patch (:) = spval
allocate(this%displa_patch (begp:endp)) ; this%displa_patch (:) = spval
allocate(this%fsun_patch (begp:endp)) ; this%fsun_patch (:) = spval
allocate(this%fsun24_patch (begp:endp)) ; this%fsun24_patch (:) = spval
allocate(this%fsun240_patch (begp:endp)) ; this%fsun240_patch (:) = spval

allocate(this%alt_col (begc:endc)) ; this%alt_col (:) = spval;
allocate(this%altmax_col (begc:endc)) ; this%altmax_col (:) = spval
Expand Down
Loading

0 comments on commit a33b6e5

Please sign in to comment.