Skip to content

Commit

Permalink
Remove the abort when more than 2 roots are found in U and K
Browse files Browse the repository at this point in the history
calculation.

-mod(MOD_CanopyLayerProfile.F90):
    remove 'abort', change to return. This case hardly happens.
    Basically, it will not affect the simulation so much.
  • Loading branch information
yuanhuas committed Oct 23, 2024
1 parent 6945cc1 commit 1291953
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions main/MOD_CanopyLayerProfile.F90
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,17 @@ RECURSIVE SUBROUTINE ufindroots(ztop,zbot,zmid, &
IF (udiff_lb == 0) THEN !root found
rootn = rootn + 1
IF (rootn > 2) THEN
print *, "U root number > 2, abort!"
CALL abort
print *, "Warning: U root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = zmid
ENDIF
ELSE IF (udiff_ub*udiff_lb < 0) THEN
IF (ztop-zmid < 0.01) THEN
rootn = rootn + 1 !root found
IF (rootn > 2) THEN
print *, "U root number > 2, abort!"
CALL abort
print *, "Warning: U root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = (ztop+zmid)/2.
ELSE
Expand All @@ -379,17 +379,17 @@ RECURSIVE SUBROUTINE ufindroots(ztop,zbot,zmid, &
IF (udiff_ub == 0) THEN !root found
rootn = rootn + 1
IF (rootn > 2) THEN
print *, "U root number > 2, abort!"
CALL abort
print *, "Warning: U root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = zmid
ENDIF
ELSE IF (udiff_ub*udiff_lb < 0) THEN
IF (zmid-zbot < 0.01) THEN
rootn = rootn + 1 !root found
IF (rootn > 2) THEN
print *, "U root number > 2, abort!"
CALL abort
print *, "Warning: U root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = (zmid+zbot)/2.
ELSE
Expand Down Expand Up @@ -591,17 +591,17 @@ RECURSIVE SUBROUTINE kfindroots(ztop,zbot,zmid, &
IF (kdiff_lb == 0) THEN !root found
rootn = rootn + 1
IF (rootn > 2) THEN
print *, "K root number > 2, abort!"
CALL abort
print *, "Warning: K root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = zmid
ENDIF
ELSE IF (kdiff_ub*kdiff_lb < 0) THEN
IF (ztop-zmid < 0.01) THEN
rootn = rootn + 1 !root found
IF (rootn > 2) THEN
print *, "K root number > 2, abort!"
CALL abort
print *, "Warning: K root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = (ztop+zmid)/2.
ELSE
Expand All @@ -617,17 +617,17 @@ RECURSIVE SUBROUTINE kfindroots(ztop,zbot,zmid, &
IF (kdiff_ub == 0) THEN !root found
rootn = rootn + 1
IF (rootn > 2) THEN
print *, "K root number > 2, abort!"
CALL abort
print *, "Warning: K root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = zmid
ENDIF
ELSE IF (kdiff_ub*kdiff_lb < 0) THEN
IF (zmid-zbot < 0.01) THEN
rootn = rootn + 1 !root found
IF (rootn > 2) THEN
print *, "K root number > 2, abort!"
CALL abort
print *, "Warning: K root number > 2, attention!"
RETURN !CALL abort
ENDIF
roots(rootn) = (zmid+zbot)/2.
ELSE
Expand Down

0 comments on commit 1291953

Please sign in to comment.