Skip to content

Commit

Permalink
Remove interaction with model and relaxation term
Browse files Browse the repository at this point in the history
  • Loading branch information
NoraLoose committed Dec 3, 2023
1 parent 2069dcf commit 6d240d3
Showing 1 changed file with 34 additions and 33 deletions.
67 changes: 34 additions & 33 deletions src/parameterizations/lateral/MOM_Zanna_Bolton.F90
Original file line number Diff line number Diff line change
Expand Up @@ -547,13 +547,13 @@ subroutine Zanna_Bolton_2020(u, v, h, diffu, diffv, G, GV, CS, &

! Update the eddy viscosity acceleration with ZB model
call cpu_clock_begin(CS%id_clock_upd)
do k=1,nz ; do j=js,je ; do I=Isq,Ieq
diffu(I,j,k) = diffu(I,j,k) + ZB2020u(I,j,k)
enddo ; enddo ; enddo
!do k=1,nz ; do j=js,je ; do I=Isq,Ieq
! diffu(I,j,k) = diffu(I,j,k) + ZB2020u(I,j,k)
!enddo ; enddo ; enddo

do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
diffv(i,J,k) = diffv(i,J,k) + ZB2020v(i,J,k)
enddo ; enddo ; enddo
!do k=1,nz ; do J=Jsq,Jeq ; do i=is,ie
! diffv(i,J,k) = diffv(i,J,k) + ZB2020v(i,J,k)
!enddo ; enddo ; enddo
call cpu_clock_end(CS%id_clock_upd)

call cpu_clock_begin(CS%id_clock_post)
Expand Down Expand Up @@ -614,13 +614,14 @@ subroutine step_forward_ZB_memory(u, v, h, G, GV, CS)
call pass_var(CS%Tyy, G%Domain)
call pass_var(CS%Txy, G%Domain, position=CORNER)

!if (CS%Txx_with_memory(20,20,1) == 0.) then
! ! This is lazy initial condition
! do k = 1,nz
! CS%Txx_with_memory(:,:,k) = CS%Txx(:,:,k) * G%mask2dT(:,:)
! CS%Tyy_with_memory(:,:,k) = CS%Tyy(:,:,k) * G%mask2dT(:,:)
! enddo
!endif
if (CS%Txx_with_memory(20,20,1) == 0.) then
! This is lazy initial condition
do k = 1,nz
CS%Txx_with_memory(:,:,k) = CS%Txx(:,:,k) * G%mask2dT(:,:)
CS%Tyy_with_memory(:,:,k) = CS%Tyy(:,:,k) * G%mask2dT(:,:)
CS%Txy_with_memory(:,:,k) = CS%Txy(:,:,k) * G%mask2dBu(:,:)
enddo
endif

if (CS%ZB_memory_type == 1) then
call tensor_advection(u, v, G, GV, CS)
Expand All @@ -631,18 +632,18 @@ subroutine step_forward_ZB_memory(u, v, h, G, GV, CS)
! relax Txx, Tyy to ZB: this is the Eulerian part of the averaging
do j=js-1,je+1 ; do i=is-1,ie+1
! compute eddy memory time scale at cell center
sh_xy_h = 0.25 * ( (CS%sh_xy(I-1,J-1,k) + CS%sh_xy(I,J,k)) &
+ (CS%sh_xy(I-1,J,k) + CS%sh_xy(I,J-1,k)) )
D = sqrt(CS%sh_xx(i,j,k) * CS%sh_xx(i,j,k) + sh_xy_h * sh_xy_h)
tau = CS%ZB_memory_const / (D + 1.0/CS%ZB_max_memory)
!tau = 7776000.0 ! 90 days
CS%ZBtau(i,j,k) = tau

! Eulerian memory with implicit time stepping
CS%Txx_with_memory(i,j,k) = tau / (tau + CS%dt) * CS%Txx_with_memory(i,J,k) &
+ CS%dt / (tau + CS%dt) * CS%Txx(i,j,k)
CS%Tyy_with_memory(i,j,k) = tau / (tau + CS%dt) * CS%Tyy_with_memory(i,J,k) &
+ CS%dt / (tau + CS%dt) * CS%Tyy(i,j,k)
!sh_xy_h = 0.25 * ( (CS%sh_xy(I-1,J-1,k) + CS%sh_xy(I,J,k)) &
! + (CS%sh_xy(I-1,J,k) + CS%sh_xy(I,J-1,k)) )
!D = sqrt(CS%sh_xx(i,j,k) * CS%sh_xx(i,j,k) + sh_xy_h * sh_xy_h)
!tau = CS%ZB_memory_const / (D + 1.0/CS%ZB_max_memory)
!!tau = 7776000.0 ! 90 days
!CS%ZBtau(i,j,k) = tau

!! Eulerian memory with implicit time stepping
!CS%Txx_with_memory(i,j,k) = tau / (tau + CS%dt) * CS%Txx_with_memory(i,J,k) &
! + CS%dt / (tau + CS%dt) * CS%Txx(i,j,k)
!CS%Tyy_with_memory(i,j,k) = tau / (tau + CS%dt) * CS%Tyy_with_memory(i,J,k) &
! + CS%dt / (tau + CS%dt) * CS%Tyy(i,j,k)

CS%Txx(i,j,k) = CS%Txx_with_memory(i,j,k)
CS%Tyy(i,j,k) = CS%Tyy_with_memory(i,j,k)
Expand All @@ -651,14 +652,14 @@ subroutine step_forward_ZB_memory(u, v, h, G, GV, CS)

do J=Jsq-1,Jeq+1 ; do I=Isq-1,Ieq+1
! compute eddy memory time scale at cell corner
sh_xx_q = 0.25 * ( (CS%sh_xx(i+1,j+1,k) + CS%sh_xx(i,j,k)) &
+ (CS%sh_xx(i+1,j,k) + CS%sh_xx(i,j+1,k)))
D = sqrt(CS%sh_xy(I,J,k) * CS%sh_xy(I,J,k) + sh_xx_q * sh_xx_q)
tau = CS%ZB_memory_const / (D + 1.0/CS%ZB_max_memory)
!tau = 7776000.0 ! 90 days

CS%Txy_with_memory(I,J,k) = tau / (tau + CS%dt) * CS%Txy_with_memory(i,J,k) &
+ CS%dt / (tau + CS%dt) * CS%Txy(I,J,k)
!sh_xx_q = 0.25 * ( (CS%sh_xx(i+1,j+1,k) + CS%sh_xx(i,j,k)) &
! + (CS%sh_xx(i+1,j,k) + CS%sh_xx(i,j+1,k)))
!D = sqrt(CS%sh_xy(I,J,k) * CS%sh_xy(I,J,k) + sh_xx_q * sh_xx_q)
!tau = CS%ZB_memory_const / (D + 1.0/CS%ZB_max_memory)
!!tau = 7776000.0 ! 90 days

!CS%Txy_with_memory(I,J,k) = tau / (tau + CS%dt) * CS%Txy_with_memory(i,J,k) &
! + CS%dt / (tau + CS%dt) * CS%Txy(I,J,k)

CS%Txy(I,J,k) = CS%Txy_with_memory(I,J,k)

Expand Down

0 comments on commit 6d240d3

Please sign in to comment.