Skip to content

Commit

Permalink
Merge pull request FESOM#117 from FESOM/PPM_fix
Browse files Browse the repository at this point in the history
Ppm fix
  • Loading branch information
koldunovn authored Apr 30, 2021
2 parents 1f419bd + 5e9cdf6 commit 1d0d856
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/oce_adv_tra_ver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,24 @@ subroutine adv_tra_vert_ppm(ttf, w, do_Xmoment, mesh, flux, init_zero)
nzmax=nlevels_nod2D(n)
nzmin=ulevels_nod2D(n)

! tracer at surface layer
tv(nzmin)=ttf(nzmin,n)

! tracer at surface+1 layer
! tv(2)=-ttf(1,n)*min(sign(1.0, W(2,n)), 0._WP)+ttf(2,n)*max(sign(1.0, W(2,n)), 0._WP)
tv(nzmin+1)=0.5*(ttf(nzmin,n)+ttf(nzmin+1,n))

! tacer at bottom-1 layer
!tv(nzmax-1)=-ttf(nzmax-2,n)*min(sign(1.0, W(nzmax-1,n)), 0._WP)+ttf(nzmax-1,n)*max(sign(1.0, W(nzmax-1,n)), 0._WP)
tv(nzmax-1)=0.5_WP*(ttf(nzmax-2,n)+ttf(nzmax-1,n))

! tracer at bottom layer
! tracer at surface level
tv(nzmin)=ttf(nzmin,n)
! tracer at surface+1 level
! tv(2)=-ttf(1,n)*min(sign(1.0, W(2,n)), 0._WP)+ttf(2,n)*max(sign(1.0, W(2,n)), 0._WP)
! tv(3)=-ttf(2,n)*min(sign(1.0, W(3,n)), 0._WP)+ttf(3,n)*max(sign(1.0, W(3,n)), 0._WP)
tv(nzmin+1)=0.5*(ttf(nzmin, n)+ttf(nzmin+1,n))
! tacer at bottom-1 level
tv(nzmax-1)=-ttf(nzmax-2,n)*min(sign(1.0, W(nzmax-1,n)), 0._WP)+ttf(nzmax-1,n)*max(sign(1.0, W(nzmax-1,n)), 0._WP)
! tv(nzmax-1)=0.5_WP*(ttf(nzmax-2,n)+ttf(nzmax-1,n))
! tracer at bottom level
tv(nzmax)=ttf(nzmax-1,n)

!_______________________________________________________________________
! calc tracer for surface+2 until depth-2 layer
! see Colella and Woodward, JCP, 1984, 174-201 --> equation (1.9)
! loop over layers (segments)
!!PS do nz=3, nzmax-3
do nz=nzmin+2, nzmax-2
do nz=nzmin+1, nzmax-3
!___________________________________________________________________
! for uniform spaced vertical grids --> piecewise parabolic method (ppm)
! equation (1.9)
Expand All @@ -432,10 +430,10 @@ subroutine adv_tra_vert_ppm(ttf, w, do_Xmoment, mesh, flux, init_zero)
! for non-uniformity spaced vertical grids --> piecewise parabolic
! method (ppm) see see Colella and Woodward, JCP, 1984, 174-201
! --> full equation (1.6), (1.7) and (1.8)
dzjm1 = hnode_new(nz-2,n)
dzj = hnode_new(nz-1,n)
dzjp1 = hnode_new(nz,n)
dzjp2 = hnode_new(nz+1,n)
dzjm1 = hnode_new(nz-1,n)
dzj = hnode_new(nz ,n)
dzjp1 = hnode_new(nz+1,n)
dzjp2 = hnode_new(nz+2,n)
! Be carefull here vertical operation have to be done on NEW vertical mesh !!!

!___________________________________________________________________
Expand Down

0 comments on commit 1d0d856

Please sign in to comment.