Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state_vector is NaN when land use is off #1221

Closed
glemieux opened this issue Jul 15, 2024 · 1 comment · Fixed by #1223
Closed

state_vector is NaN when land use is off #1221

glemieux opened this issue Jul 15, 2024 · 1 comment · Fixed by #1223

Comments

@glemieux
Copy link
Contributor

API testing with e3sm_landuse_develop suite for E3SM-Project/E3SM#6353 exposed an issue in which state_vector is being referenced without being defined when use_fates_luh is .false.:

! if the area of secondary land has just exceeded the minimum below which we ignore things,
! set the flag to keep track of that.
if ( (state_vector(secondaryland) .gt. site_in%min_allowed_landuse_fraction) .and. &

The state_vector is set upstream in the same subroutine only when use_fates_luh is true:

if (hlm_use_luh .eq. itrue) then
call GetLUHStatedata(bc_in, state_vector)
site_secondaryland_first_exceeding_min = (state_vector(secondaryland) .gt. site_in%min_allowed_landuse_fraction) &
.and. (.not. site_in%landuse_vector_gt_min(secondaryland))
end if

@ckoven for non land use mode run cases, I figured we could simply make sure that state_vector = current_fates_landuse_state_vector based on the very first call at the start of the disturbance_rates subroutine:

! first calculate the fraction of the site that is primary land
current_fates_landuse_state_vector = site_in%get_current_landuse_statevector()

This results in the test passing, but I wanted to double check my logic first.

There is one other case that follows this pattern in LoggingMortality_frac:

if (hlm_use_luh .eq. itrue) then
call GetLUHStatedata(bc_in, state_vector)
site_secondaryland_first_exceeding_min = (state_vector(secondaryland) .gt. currentSite%min_allowed_landuse_fraction) &
.and. (.not. currentSite%landuse_vector_gt_min(secondaryland))
end if

where state_vector is only used in that subroutine behind a check on site_secondaryland_first_exceeding_min which should always be false for non land use mode per the current logic seen above.

@glemieux
Copy link
Contributor Author

glemieux commented Jul 16, 2024

I should note that the failing test cases on perlmutter are ERS_D_Ld15.f45_g37.IELMFATES.pm-cpu_intel.elm-fates_cold_treedamage and SMS_D_Ld20.f45_f45.IELMFATES.pm-cpu_intel.elm-fates_rd.

The same issue presented itself on izumi via SMS_D_Mmpi-serial_Ld5.5x5_amazon.I2000Clm60FatesRs.izumi_nag.clm-FatesCold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant