Skip to content

Commit babc30a

Browse files
committed
(*)Correct dimensionally inconsistent advective CFL
Corrects the dimensionally inconsistent expressions for the CFL number in the tracer advection code, in which a negligible thickness had been added to the cell volume to avoid division by zero. This change does not alter the solutions in the MOM6-examples test cases, but now it permits dimensional rescaling of lengths over a much larger range, and it could change answers if the minimum layer thicknesses are small enough.
1 parent 6ab1721 commit babc30a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/tracer/MOM_tracer_advect.F90

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,8 @@ subroutine advect_x(Tr, hprev, uhr, uh_neglect, OBC, domore_u, ntr, Idt, &
485485
else
486486
uhh(I) = uhr(I,j,k)
487487
endif
488-
!ts2(I) = 0.5*(1.0 + uhh(I)/(hprev(i+1,j,k)+h_neglect))
489-
CFL(I) = - uhh(I)/(hprev(i+1,j,k)+h_neglect) ! CFL is positive
488+
!ts2(I) = 0.5*(1.0 + uhh(I) / (hprev(i+1,j,k) + h_neglect*G%areaT(i+1,j)))
489+
CFL(I) = - uhh(I) / (hprev(i+1,j,k) + h_neglect*G%areaT(i+1,j)) ! CFL is positive
490490
else
491491
hup = hprev(i,j,k) - G%areaT(i,j)*min_h
492492
hlos = MAX(0.0,-uhr(I-1,j,k))
@@ -497,8 +497,8 @@ subroutine advect_x(Tr, hprev, uhr, uh_neglect, OBC, domore_u, ntr, Idt, &
497497
else
498498
uhh(I) = uhr(I,j,k)
499499
endif
500-
!ts2(I) = 0.5*(1.0 - uhh(I)/(hprev(i,j,k)+h_neglect))
501-
CFL(I) = uhh(I)/(hprev(i,j,k)+h_neglect) ! CFL is positive
500+
!ts2(I) = 0.5*(1.0 - uhh(I) / (hprev(i,j,k) + h_neglect*G%areaT(i,j)))
501+
CFL(I) = uhh(I) / (hprev(i,j,k) + h_neglect*G%areaT(i,j)) ! CFL is positive
502502
endif
503503
enddo
504504

@@ -573,7 +573,7 @@ subroutine advect_x(Tr, hprev, uhr, uh_neglect, OBC, domore_u, ntr, Idt, &
573573
! Original implementation of PLM
574574
!flux_x(I,m) = uhh(I)*(Tr(m)%t(i+1,j,k) - slope_x(i+1,m)*ts2(I))
575575
endif
576-
!ts2(I) = 0.5*(1.0 - uhh(I)/(hprev(i,j,k)+h_neglect))
576+
!ts2(I) = 0.5*(1.0 - uhh(I)/(hprev(i,j,k)+h_neglect*G%areaT(i,j)))
577577
enddo ; enddo
578578
endif ! usePPM
579579

@@ -856,8 +856,8 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
856856
else
857857
vhh(i,J) = vhr(i,J,k)
858858
endif
859-
!ts2(i) = 0.5*(1.0 + vhh(i,J) / (hprev(i,j+1,k)+h_neglect))
860-
CFL(i) = - vhh(i,J) / (hprev(i,j+1,k)+h_neglect) ! CFL is positive
859+
!ts2(i) = 0.5*(1.0 + vhh(i,J) / (hprev(i,j+1,k) + h_neglect*G%areaT(i,j+1))
860+
CFL(i) = - vhh(i,J) / (hprev(i,j+1,k) + h_neglect*G%areaT(i,j+1)) ! CFL is positive
861861
else
862862
hup = hprev(i,j,k) - G%areaT(i,j)*min_h
863863
hlos = MAX(0.0,-vhr(i,J-1,k))
@@ -868,8 +868,8 @@ subroutine advect_y(Tr, hprev, vhr, vh_neglect, OBC, domore_v, ntr, Idt, &
868868
else
869869
vhh(i,J) = vhr(i,J,k)
870870
endif
871-
!ts2(i) = 0.5*(1.0 - vhh(i,J) / (hprev(i,j,k)+h_neglect))
872-
CFL(i) = vhh(i,J) / (hprev(i,j,k)+h_neglect) ! CFL is positive
871+
!ts2(i) = 0.5*(1.0 - vhh(i,J) / (hprev(i,j,k) + h_neglect*G%areaT(i,j)))
872+
CFL(i) = vhh(i,J) / (hprev(i,j,k) + h_neglect*G%areaT(i,j)) ! CFL is positive
873873
endif
874874
enddo
875875

0 commit comments

Comments
 (0)