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

Solar radiation error handling #794

Open
jkshuman opened this issue Oct 14, 2021 · 2 comments
Open

Solar radiation error handling #794

jkshuman opened this issue Oct 14, 2021 · 2 comments

Comments

@jkshuman
Copy link
Contributor

jkshuman commented Oct 14, 2021

FATES has consistently been producing radiation warning messages that end up producing very large logs. (see these issues: #236 #191 #772) A PR was introduced to reduce unnecessary log messages here: (#792) In review of this PR792 it became apparent that one of the most consistent warnings for a "BalanceCheck on solar radiation" is triggered outside of FATES here in CTSM: https://github.com/ESCOMP/CTSM/blob/bb3d227887b551c8d4e71bc1473753231bbdeb54/src/biogeophys/BalanceCheckMod.F90#L924-L934

On the FATES side there is handling of solar radiation error that needs attention and discussion. This issue will act as a prompt, so that we address this part of the FATES code. tagging @ckoven @rosiealice @rgknox @jenniferholm @adrifoster @mpaiao (but all are welcome to comment!) The whole section within SurfaceAlbedoMod devoted to conservation check needs thorough discussion and review, but there is a section where the error appears to be added back onto the albedo (second linked section below here).

!==============================================================================!
! Conservation check
!==============================================================================!
! Total radiation balance: absorbed = incoming - outgoing
if (radtype == idirect)then
error = abs(currentPatch%sabs_dir(ib) - (currentPatch%tr_soil_dir(ib) * &
(1.0_r8-currentPatch%gnd_alb_dir(ib) ) + &
currentPatch%tr_soil_dir_dif(ib) * (1.0_r8-currentPatch%gnd_alb_dif(ib) )))
if ( abs(error) > 0.0001)then

Here is a link to that specific section of the code with comments on the error handling that was noted in PR792:
!here we are adding a within-ED radiation scheme tolerance, and then adding the diffrence onto the albedo
!it is important that the lower boundary for this is ~1000 times smaller than the tolerance in surface albedo.
if (abs(error) > 1.e-9_r8 .and. abs(error) < 0.15_r8)then
albd_parb_out(ib) = albd_parb_out(ib) + error
!this terms adds the error back on to the albedo. While this is partly inexcusable, it is
! in the medium term a solution that
! prevents the model from crashing with small and occasional energy balances issues.
! These are extremely difficult to debug, many have been solved already, leading
! to the complexity of this code, but where the system generates occasional errors, we
! will deal with them for now.
end if
if (abs(error) > 0.15_r8)then
write(fates_log(),*) 'Large Dir Radn consvn error',error ,ib
write(fates_log(),*) 'diags', albd_parb_out(ib), ftdd_parb_out(ib), &
ftid_parb_out(ib), fabd_parb_out(ib)
write(fates_log(),*) 'lai_change',lai_change(currentpatch%ncl_p,1:numpft,1:diag_nlevleaf)
write(fates_log(),*) 'elai',currentpatch%elai_profile(currentpatch%ncl_p,1:numpft,1:diag_nlevleaf)
write(fates_log(),*) 'esai',currentpatch%esai_profile(currentpatch%ncl_p,1:numpft,1:diag_nlevleaf)
write(fates_log(),*) 'ftweight',ftweight(1,1:numpft,1:diag_nlevleaf)
write(fates_log(),*) 'cp',currentPatch%area, currentPatch%patchno
write(fates_log(),*) 'ground albedo diffuse (ib)', currentPatch%gnd_alb_dir(ib)

@jenniferholm
Copy link
Contributor

Thanks for starting this Jackie! These solar radiation errors are annoying.

@jkshuman
Copy link
Contributor Author

This issue was referenced in a SE call today, and we discussed that the radiation code in general would benefit from an overall refactoring, potential update to variables names and a stand alone unit test.

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

No branches or pull requests

2 participants