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

Negative RADSH #166

Closed
palderman opened this issue Dec 1, 2021 · 2 comments
Closed

Negative RADSH #166

palderman opened this issue Dec 1, 2021 · 2 comments

Comments

@palderman
Copy link
Contributor

@chporter and @kthorp ,

I'm getting floating point errors with the forage model related to the fact that RADSH is negative due to ADDF being negative in CANABS() in ETPHOT.for. When I uncomment the check for ADDF < 0.0 (see below), the problem goes away. The issue seems to be limited to situations with very low LAI.

Is there a reason why the checks for negative numbers are commented out in CANABS() in ETPHOT.for? Is there any problem with allowing ADDF, ADDFSL, etc to be set to zero when the original calculation is negative? See here:

dssat-csm-os/SPAM/ETPHOT.for

Lines 1793 to 1800 in a20a2b5

C-KRT****************************
C-KRT ADDF = ADIR - ADDR
!-CHP ADDF = MAX(0.0,ADIR-ADDR)
ADDF = ADIR - ADDR
! IF (ADDF < 0.0) THEN
! ADDF = 0.0
! ENDIF
C-KRT****************************

dssat-csm-os/SPAM/ETPHOT.for

Lines 1814 to 1827 in a20a2b5

C-KRT************************************
C-KRT ADDFSL = ADIRSL - ADDRSL
C-KRT ADDFSH = ADDF - ADDFSL
!-CHP ADDFSL = MAX(0.0,ADIRSL - ADDRSL)
!-CHP ADDFSH = MAX(0.0,ADDF - ADDFSL)
ADDFSL = ADIRSL - ADDRSL
! IF (ADDFSL < 0.0) THEN
! ADDFSL = 0.0
! ENDIF
ADDFSH = ADDF - ADDFSL
! IF (ADDFSH < 0.0) THEN
! ADDFSH = 0.0
! ENDIF
C-KRT************************************

dssat-csm-os/SPAM/ETPHOT.for

Lines 1862 to 1869 in a20a2b5

C-KRT********************************
C-KRT ADIFSH = ADIF - ADIFSL
!-CHP ADIFSH = MAX(0.0,ADIF - ADIFSL)
ADIFSH = ADIF - ADIFSL
! IF (ADIFSH < 0.0) THEN
! ADIFSH = 0.0
! ENDIF
C-KRT********************************

dssat-csm-os/SPAM/ETPHOT.for

Lines 1883 to 1890 in a20a2b5

C-KRT********************************
C-KRT AREFSL = AREF - AREFSH
!-CHP AREFSL = MAX(0.0,AREF - AREFSH)
AREFSL = AREF - AREFSH
! IF (AREFSL < 0.0) THEN
! AREFSL = 0.0
! ENDIF
C-KRT********************************

@fabiooliveira72
Copy link
Contributor

Hi Dr. Alderman!

Yes, indeed. We have this problem right now. We had some problems with Canola experiments from Dr. White are having the same issue.

We are about the make a pull request to fix those issues. We need to check with a final testing if did not broke anything else.

Thank you so much,

Fabio Oliveira

@fabiooliveira72
Copy link
Contributor

fabiooliveira72 commented Jan 14, 2022

This issue was solved by merge Protections for Negative LAI and radiation absorbed by sunlit and shaded leaves

https://github.com/DSSAT/dssat-csm-os/tree/d0c9faa89c7dc3b276197e3ea7cdca64d41bdc5b

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