Skip to content

Commit

Permalink
Merge suma lines that need not be separate
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Oct 27, 2023
1 parent 83bc76f commit 9ee7850
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/mksurfdata_esmf/src/mksurfdata.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,8 @@ subroutine normalize_and_check_landuse(ns_o)

! Confirm that we have done the rescaling correctly: now the sum of all landunits
! should be 100% within tol_loose
suma = pctlak(n) + pctwet(n) + pctgla(n) + pcturb(n) + pctcft(n)%get_pct_l2g()
suma = suma + pctnatpft(n)%get_pct_l2g() + pctocn(n)
suma = pctlak(n) + pctwet(n) + pctgla(n) + pcturb(n) + pctocn(n) + &
pctcft(n)%get_pct_l2g() + pctnatpft(n)%get_pct_l2g()
if (abs(suma - 100._r8) > tol_loose) then
write(6,*) subname, ' ERROR: landunits do not sum to 100%'
write(6,*) 'n, suma, pctlak, pctwet, pctgla, pcturb, pctnatveg, pctcrop, pctocn = '
Expand Down Expand Up @@ -1264,8 +1264,8 @@ subroutine normalize_and_check_landuse(ns_o)
! Include pctocn in suma but do not include in the
! renormalization. When pctocn /= 0, it is 100, and
! all other terms are 0.
suma = pctlak(n) + pctwet(n) + pcturb(n) + pctgla(n) + pctocn(n)
suma = suma + pctnatpft(n)%get_pct_l2g() + pctcft(n)%get_pct_l2g()
suma = pctlak(n) + pctwet(n) + pcturb(n) + pctgla(n) + pctocn(n) + &
pctnatpft(n)%get_pct_l2g() + pctcft(n)%get_pct_l2g()
if ( abs(suma - 100.0_r8) > 2.0*epsilon(suma) )then
pctlak(n) = pctlak(n) * 100._r8/suma
pctwet(n) = pctwet(n) * 100._r8/suma
Expand Down Expand Up @@ -1314,8 +1314,8 @@ subroutine normalize_and_check_landuse(ns_o)
call shr_sys_abort()
end if

suma = pctlak(n) + pctwet(n) + pcturb(n) + pctgla(n) + pctcft(n)%get_pct_l2g()
suma = suma + pctnatpft(n)%get_pct_l2g() + pctocn(n)
suma = pctlak(n) + pctwet(n) + pcturb(n) + pctgla(n) + pctocn(n) + &
pctcft(n)%get_pct_l2g() + pctnatpft(n)%get_pct_l2g()
if ( abs(suma-100._r8) > 1.e-10_r8) then
write (6,*) subname, ' error: sum of pctocn, pctlak, pctwet,', &
'pcturb, pctgla, pctnatveg and pctcrop is NOT equal to 100'
Expand Down

0 comments on commit 9ee7850

Please sign in to comment.