Skip to content

Commit

Permalink
Merge pull request mom-ocean#1346 from marshallward/fgnv_bound_fix
Browse files Browse the repository at this point in the history
Bugfix: FGNV streamfunction vertical bounds
  • Loading branch information
adcroft authored Mar 13, 2021
2 parents a6f680c + 33d28f1 commit 8dd9072
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/parameterizations/lateral/MOM_thickness_diffuse.F90
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,14 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV
! Solve an elliptic equation for the streamfunction following Ferrari et al., 2010.
do I=is-1,ie
if (G%mask2dCu(I,j)>0.) then
Sfn_unlim_u(I,:) = ( 1. + CS%FGNV_scale ) * Sfn_unlim_u(I,:)
do K=2,nz
Sfn_unlim_u(I,K) = (1. + CS%FGNV_scale) * Sfn_unlim_u(I,K)
enddo
call streamfn_solver(nz, c2_h_u(I,:), hN2_u(I,:), Sfn_unlim_u(I,:))
else
Sfn_unlim_u(I,:) = 0.
do K=2,nz
Sfn_unlim_u(I,K) = 0.
enddo
endif
enddo
endif
Expand Down Expand Up @@ -1259,10 +1263,14 @@ subroutine thickness_diffuse_full(h, e, Kh_u, Kh_v, tv, uhD, vhD, cg1, dt, G, GV
! Solve an elliptic equation for the streamfunction following Ferrari et al., 2010.
do i=is,ie
if (G%mask2dCv(i,J)>0.) then
Sfn_unlim_v(i,:) = ( 1. + CS%FGNV_scale ) * Sfn_unlim_v(i,:)
do K=2,nz
Sfn_unlim_v(i,K) = (1. + CS%FGNV_scale) * Sfn_unlim_v(i,K)
enddo
call streamfn_solver(nz, c2_h_v(i,:), hN2_v(i,:), Sfn_unlim_v(i,:))
else
Sfn_unlim_v(i,:) = 0.
do K=2,nz
Sfn_unlim_v(i,K) = 0.
enddo
endif
enddo
endif
Expand Down

0 comments on commit 8dd9072

Please sign in to comment.