Skip to content

Commit

Permalink
Rename sum to asum, as "sum" is also a generic fortran function (CICE…
Browse files Browse the repository at this point in the history
…-Consortium#905)

Co-authored-by: Mads Hvid Ribergaard <[email protected]>
  • Loading branch information
mhrib and Mads Hvid Ribergaard committed Nov 10, 2023
1 parent 4450a3e commit 5d09123
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2939,7 +2939,7 @@ subroutine set_state_var (nx_block, ny_block, &
indxi, indxj ! compressed indices for cells with aicen > puny

real (kind=dbl_kind) :: &
Tsfc, sum, hbar, abar, puny, rhos, Lfresh, rad_to_deg, rsnw_fall, dist_ratio, Tffresh
Tsfc, asum, hbar, abar, puny, rhos, Lfresh, rad_to_deg, rsnw_fall, dist_ratio, Tffresh

real (kind=dbl_kind), dimension(ncat) :: &
ainit, hinit ! initial area, thickness
Expand Down Expand Up @@ -3075,7 +3075,7 @@ subroutine set_state_var (nx_block, ny_block, &
! Note: the resulting average ice thickness
! tends to be less than hbar due to the
! nonlinear distribution of ice thicknesses
sum = c0
asum = c0
do n = 1, ncat
if (n < ncat) then
hinit(n) = p5*(hin_max(n-1) + hin_max(n)) ! m
Expand All @@ -3084,10 +3084,10 @@ subroutine set_state_var (nx_block, ny_block, &
endif
! parabola, max at h=hbar, zero at h=0, 2*hbar
ainit(n) = max(c0, (c2*hbar*hinit(n) - hinit(n)**2))
sum = sum + ainit(n)
asum = asum + ainit(n)
enddo
do n = 1, ncat
ainit(n) = ainit(n) / (sum + puny/ncat) ! normalize
ainit(n) = ainit(n) / (asum + puny/ncat) ! normalize
enddo

else
Expand Down

0 comments on commit 5d09123

Please sign in to comment.