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

Ppm fix #117

Merged
merged 2 commits into from
Apr 30, 2021
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
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