Skip to content

Commit

Permalink
Fix signs + detailed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkitBarik committed Jun 17, 2024
1 parent e9bb616 commit a23c257
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/preCalculations.f90
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,10 @@ subroutine preCalc(tscheme)
if ( amp_tide /= 0.0_cp ) then
y20_norm = 0.5_cp * sqrt(5.0_cp/pi)
y22_norm = 0.25_cp * sqrt(7.5_cp/pi)
tide_fac20 = amp_tide / y20_norm * r_cmb**2
tide_fac22p = half * amp_tide / y22_norm / sqrt(6.0_cp) * r_cmb**2 ! Needs a half factor
tide_fac22n = -7.0_cp * tide_fac22p ! Half factor carried over
tide_fac20 = amp_tide / y20_norm * r_cmb**2 ! (2,0,1) mode of Ogilvie 2014
tide_fac22p = half * amp_tide / y22_norm / sqrt(6.0_cp) * r_cmb**2 ! Needs a half factor, (2,2,1) mode
tide_fac22n = -7.0_cp * tide_fac22p ! Half factor carried over, (2,2,3) mode,
! has opposite sign to that of the other two (Polfliet & Smeyers, 1990)
else
tide_fac20 = 0.0_cp
tide_fac22p = 0.0_cp
Expand Down
7 changes: 6 additions & 1 deletion src/updateWP.f90
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,17 @@ subroutine updateWP(time, s, xi, w, dw, ddw, dwdt, p, dp, dpdt, tscheme, &
end if

if ( amp_tide /= 0.0_cp ) then
! tide_fac22p -> (2,2,1)
! tide_fac22n -> (2,2,3)
! (2,2,3) must have the same signed frequency
! as (2,0,1) above while (2,2,1) has the opposite
! sign in the rotating frame (Ogilvie, 2014)
rhs1(1,2*lm-1,threadid)=rhs1(1,2*lm-1,threadid) &
& + (tide_fac22p + tide_fac22n) &
& /real(l1*(l1+1),kind=cp) &
& * cos(omega_tide*(time))
rhs1(1,2*lm,threadid) =rhs1(1,2*lm,threadid) &
& + (tide_fac22p - tide_fac22n) &
& + (-tide_fac22p + tide_fac22n) &
& /real(l1*(l1+1),kind=cp) &
& * sin(omega_tide*(time))
end if
Expand Down

0 comments on commit a23c257

Please sign in to comment.