Skip to content

Commit

Permalink
+Rescaled G%CoriolisBu
Browse files Browse the repository at this point in the history
  Rescaled G%CoriolisBu, G%df_dx and G%df_dy for dimenisonal consistency
testing.  Answers in the Baltic test case are bitwise identical.
  • Loading branch information
Hallberg-NOAA committed Oct 11, 2019
1 parent 2a5e98a commit 887f0fa
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/SIS_dyn_bgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ subroutine SIS_B_dynamics(ci, misp, mice, ui, vi, uo, vo, &
do J=jsc-1,jec ; do I=isc-1,iec
if( (G%mask2dBu(i,j)>0.5).and.(miv(i,j)>CS%MIV_MIN)) then ! timestep ice velocity (H&D eqn 22)
rr = CS%cdw*CS%Rho_ocean*abs(cmplx(ui(i,j)-uo(i,j),vi(i,j)-vo(i,j))) * &
exp(sign(CS%blturn*pi/180,G%CoriolisBu(i,j))*(0.0,1.0))
exp(sign(CS%blturn*pi/180,US%s_to_T*G%CoriolisBu(i,j))*(0.0,1.0))
!
! first, timestep explicit parts (ice, wind & ocean part of water stress)
!
Expand Down Expand Up @@ -540,7 +540,7 @@ subroutine SIS_B_dynamics(ci, misp, mice, ui, vi, uo, vo, &
! second, timestep implicit parts (Coriolis and ice part of water stress)
!
newuv = cmplx(ui(I,J),vi(I,J)) / &
(1 + dt_Rheo*(0.0,1.0)*G%CoriolisBu(I,J) + civ(I,J)*rr*dtmiv(I,J))
(1 + dt_Rheo*(0.0,1.0)*US%s_to_T*G%CoriolisBu(I,J) + civ(I,J)*rr*dtmiv(I,J))
ui(I,J) = real(newuv); vi(I,J) = aimag(newuv)
!
! sum for averages
Expand All @@ -549,8 +549,8 @@ subroutine SIS_B_dynamics(ci, misp, mice, ui, vi, uo, vo, &
fyic(I,J) = fyic(I,J) + fyic_now
fxoc(I,J) = fxoc(I,J) + real(civ(I,J)*rr*cmplx(ui(I,J)-uo(I,J), vi(I,J)-vo(I,J)))
fyoc(I,J) = fyoc(I,J) + aimag(civ(I,J)*rr*cmplx(ui(I,J)-uo(I,J), vi(I,J)-vo(I,J)))
fxco(I,J) = fxco(I,J) - miv(I,J)*real ((0.0,1.0)*G%CoriolisBu(I,J) * cmplx(ui(I,J),vi(I,J)))
fyco(I,J) = fyco(I,J) - miv(I,J)*aimag((0.0,1.0)*G%CoriolisBu(I,J) * cmplx(ui(I,J),vi(I,J)))
fxco(I,J) = fxco(I,J) - miv(I,J)*real ((0.0,1.0)*US%s_to_T*G%CoriolisBu(I,J) * cmplx(ui(I,J),vi(I,J)))
fyco(I,J) = fyco(I,J) - miv(I,J)*aimag((0.0,1.0)*US%s_to_T*G%CoriolisBu(I,J) * cmplx(ui(I,J),vi(I,J)))

endif
enddo ; enddo
Expand Down
2 changes: 1 addition & 1 deletion src/SIS_dyn_cgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ subroutine SIS_C_dynamics(ci, mis, mice, ui, vi, uo, vo, &
!$OMP do
do J=jsc-1,jec ; do I=isc-1,iec
tot_area = ((G%areaT(i,j) + G%areaT(i+1,j+1)) + (G%areaT(i+1,j) + G%areaT(i,j+1)))
q(I,J) = G%CoriolisBu(I,J) * tot_area / &
q(I,J) = US%s_to_T*G%CoriolisBu(I,J) * tot_area / &
(((G%areaT(i,j) * mis(i,j) + G%areaT(i+1,j+1) * mis(i+1,j+1)) + &
(G%areaT(i+1,j) * mis(i+1,j) + G%areaT(i,j+1) * mis(i,j+1))) + tot_area * m_neglect)
enddo ; enddo
Expand Down
10 changes: 5 additions & 5 deletions src/SIS_fixed_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ subroutine SIS_initialize_fixed(G, US, PF, write_geom, output_dir)

! Calculate the value of the Coriolis parameter at the latitude !
! of the q grid points [s-1].
call MOM_initialize_rotation(G%CoriolisBu, G, PF)
call MOM_initialize_rotation(G%CoriolisBu, G, PF, US)
! Calculate the components of grad f (beta)
call MOM_calculate_grad_Coriolis(G%dF_dx, G%dF_dy, G)
call MOM_calculate_grad_Coriolis(G%dF_dx, G%dF_dy, G, US)
if (debug) then
call Bchksum(G%CoriolisBu, "SIS_initialize_fixed: f ", G%HI)
call hchksum(G%dF_dx, "SIS_initialize_fixed: dF_dx ", G%HI, scale=US%m_to_L)
call hchksum(G%dF_dy, "SIS_initialize_fixed: dF_dy ", G%HI, scale=US%m_to_L)
call Bchksum(G%CoriolisBu, "SIS_initialize_fixed: f ", G%HI, scale=US%s_to_T)
call hchksum(G%dF_dx, "SIS_initialize_fixed: dF_dx ", G%HI, scale=US%m_to_L*US%s_to_T)
call hchksum(G%dF_dy, "SIS_initialize_fixed: dF_dy ", G%HI, scale=US%m_to_L*US%s_to_T)
endif

call initialize_grid_rotation_angle(G, PF)
Expand Down
6 changes: 3 additions & 3 deletions src/SIS_hor_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,10 @@ module SIS_hor_grid
real ALLOCABLE_, dimension(NIMEM_,NJMEM_) :: &
bathyT !< Ocean bottom depth at tracer points [m].
real ALLOCABLE_, dimension(NIMEMB_PTR_,NJMEMB_PTR_) :: &
CoriolisBu !< The Coriolis parameter at corner points [s-1].
CoriolisBu !< The Coriolis parameter at corner points [T-1 ~> s-1].
real ALLOCABLE_, dimension(NIMEM_,NJMEM_) :: &
df_dx, & !< Derivative d/dx f (Coriolis parameter) at h-points [s-1 L-1 ~> s-1 m-1].
df_dy !< Derivative d/dy f (Coriolis parameter) at h-points [s-1 L-1 ~> s-1 m-1].
df_dx, & !< Derivative d/dx f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].
df_dy !< Derivative d/dy f (Coriolis parameter) at h-points [T-1 L-1 ~> s-1 m-1].
real :: g_Earth !< The gravitational acceleration [m s-2].

type(unit_scale_type), pointer :: US => NULL() !< A dimensional unit scaling type
Expand Down
4 changes: 2 additions & 2 deletions src/SIS_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ subroutine ice_grid_chksum(G, US, haloshift)
call uvchksum("G%IareaC[uv]", G%IareaCu, G%IareaCv, G, halos=hs, scale=US%m_to_L**2)

call hchksum(G%bathyT, "G%bathyT", G%HI, haloshift=hs)
call Bchksum(G%CoriolisBu, "G%CoriolisBu", G%HI, haloshift=hs)
call hchksum_pair("G%dF_d[xy]", G%dF_dx, G%dF_dy, G, halos=hs, scale=US%m_to_L)
call Bchksum(G%CoriolisBu, "G%CoriolisBu", G%HI, haloshift=hs, scale=US%s_to_T)
call hchksum_pair("G%dF_d[xy]", G%dF_dx, G%dF_dy, G, halos=hs, scale=US%s_to_T*US%m_to_L)

end subroutine ice_grid_chksum

Expand Down

0 comments on commit 887f0fa

Please sign in to comment.