Skip to content

Commit a5eab47

Browse files
remove buggy code (answer changes!)
1 parent 6aefddb commit a5eab47

File tree

1 file changed

+4
-31
lines changed

1 file changed

+4
-31
lines changed

src/dynamics/se/dycore/fvm_reconstruction_mod.F90

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,6 @@ subroutine slope_limiter(nhe,nc,nhc,fcube,jx,jy,k,nlev,ntrac,irecons,recons,sphe
472472
! DO NOT NEED ABS here, if disc<0 we have a saddle point (no maximum or minimum)
473473
disc = 4.0_r8 * r4 *r5 - r6*r6
474474
if (abs(disc) > threshold) then
475-
!not b4b ex1 = (r6*r3 - 2.0_r8*r5*r2) / disc + scx
476-
!not b4b ex2 = (r6*r2 - 2.0_r8*r4*r3) / disc + scy
477475
ex1 = (r6*r3 - 2.0_r8*r5*r2)
478476
ex2 = (r6*r2 - 2.0_r8*r4*r3)
479477
disc = 1 /disc
@@ -490,37 +488,12 @@ subroutine slope_limiter(nhe,nc,nhc,fcube,jx,jy,k,nlev,ntrac,irecons,recons,sphe
490488
!
491489
! Check all potential minimizer points along element boundaries
492490
!
493-
if (abs(r6) > threshold) then
494-
invtmp = 1.0_r8 / (r6 + scy)
495-
do n=1,2
496-
! Left edge, intercept with du/dx = 0
497-
ex2 = invtmp * (-r2 - 2.0_r8 * r4 * (xminmax(n) - scx))
498-
if ((ex2 > yminmax(1)-threshold) .and. (ex2 < yminmax(2)+threshold)) then
499-
dx = xminmax(n) - scx; dy = ex2 - scy
500-
v1 = f0 + r2*dx + r3*dy + r4*(m1+dx*dx) + r5*(m2+dy*dy) + r6*(m3+dx*dy)
501-
max_val = max(max_val, v1)
502-
min_val = min(min_val, v1)
503-
endif
504-
enddo
505-
!
506-
! Top/bottom edge, intercept with du/dy = 0
507-
!
508-
invtmp = 1.0_r8 / r6 + scx
509-
do n = 1,2
510-
ex1 = invtmp * (-r3 - 2.0_r8 * r5 * (yminmax(n) - scy))
511-
if ( (ex1 > xminmax(1)-threshold) .and. (ex1 < xminmax(2)+threshold) ) then
512-
dx = ex1 - scx; dy = yminmax(n) - scy
513-
v1 = f0 + r2*dx + r3*dy + r4*(m1+dx*dx) + r5*(m2+dy*dy) + r6*(m3+dx*dy)
514-
max_val = max(max_val, v1)
515-
min_val = min(min_val, v1)
516-
endif
517-
enddo
518-
endif
491+
519492
!
520493
! Top/bottom edge, y=const., du/dx=0
521494
!
522495
if (abs(r4) > threshold) then
523-
invtmp = 1.0_r8 / (2.0_r8 * r4)! + spherecentroid(1,i,j)
496+
invtmp = 1.0_r8 / (2.0_r8 * r4)
524497
do n = 1,2
525498
ex1 = scx+invtmp * (-r2 - r6 * (yminmax(n) - scy))
526499
if ((ex1 > xminmax(1)-threshold) .and. (ex1 < xminmax(2)+threshold)) then
@@ -532,10 +505,10 @@ subroutine slope_limiter(nhe,nc,nhc,fcube,jx,jy,k,nlev,ntrac,irecons,recons,sphe
532505
enddo
533506
endif
534507
!
535-
! Top/bottom edge, y=const., du/dx=0
508+
! Left/right edge, x=const., du/dy=0
536509
!
537510
if (abs(r5) > threshold) then
538-
invtmp = 1.0_r8 / (2.0_r8 * r5)! + spherecentroid(1,i,j)
511+
invtmp = 1.0_r8 / (2.0_r8 * r5)
539512
do n = 1,2
540513
ex1 = scy+invtmp * (-r3 - r6 * (xminmax(n) - scx))
541514
if ((ex1 > yminmax(1)-threshold) .and. (ex1 < yminmax(2)+threshold)) then

0 commit comments

Comments
 (0)