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

Correction of time level inconsistency in transport #222

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions columnphysics/icepack_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,20 @@ subroutine shift_ice (ntrcr, ncat, &
real (kind=dbl_kind) :: &
worka, workb

real (kind=dbl_kind), dimension(ncat) :: aicen_init
real (kind=dbl_kind), dimension(ncat) :: vicen_init
real (kind=dbl_kind), dimension(ncat) :: vsnon_init

character(len=*),parameter :: subname='(shift_ice)'

!-----------------------------------------------------------------
! store initial snow and ice volume
!-----------------------------------------------------------------

aicen_init(:) = aicen(:)
vicen_init(:) = vicen(:)
vsnon_init(:) = vsnon(:)

!-----------------------------------------------------------------
! Define variables equal to aicen*trcrn, vicen*trcrn, vsnon*trcrn
!-----------------------------------------------------------------
Expand Down Expand Up @@ -577,15 +589,17 @@ subroutine shift_ice (ntrcr, ncat, &
endif
endif
if (icepack_warnings_aborted(subname)) return
enddo ! boundaries, 1 to ncat-1

!-----------------------------------------------------------------
! transfer volume and energy between categories
!-----------------------------------------------------------------

do n = 1, ncat-1

if (daice(n) > c0) then ! daice(n) can be < puny

nd = donor(n)
worka = daice(n) / aicen(nd)
if (nd == n) then
nr = nd+1
else ! nd = n+1
Expand All @@ -598,7 +612,8 @@ subroutine shift_ice (ntrcr, ncat, &
vicen(nd) = vicen(nd) - dvice(n)
vicen(nr) = vicen(nr) + dvice(n)

dvsnow = vsnon(nd) * worka
worka = daice(n) / aicen_init(nd)
dvsnow = vsnon_init(nd) * worka
vsnon(nd) = vsnon(nd) - dvsnow
vsnon(nr) = vsnon(nr) + dvsnow
workb = dvsnow
Expand Down