Skip to content

Commit

Permalink
Add thickness_diffuse_CSp and Barotropic_CSp as arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-marques committed Jan 24, 2019
1 parent e8a7386 commit bef613b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ module MOM_dynamics_split_RK2
type(PressureForce_CS), pointer :: PressureForce_CSp => NULL()
!> A pointer to the barotropic stepping control structure
type(barotropic_CS), pointer :: barotropic_CSp => NULL()
!> A pointer to a structure containing interface height diffusivities
type(thickness_diffuse_CS), pointer :: thickness_diffuse_CSp => NULL()
!> A pointer to the vertical viscosity control structure
type(vertvisc_CS), pointer :: vertvisc_CSp => NULL()
!> A pointer to the set_visc control structure
Expand Down Expand Up @@ -229,8 +231,7 @@ module MOM_dynamics_split_RK2
subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
Time_local, dt, forces, p_surf_begin, p_surf_end, &
uh, vh, uhtr, vhtr, eta_av, &
G, GV, CS, calc_dtbt, VarMix, MEKE, Barotropic_CSp, &
thickness_diffuse_CSp)
G, GV, CS, calc_dtbt, VarMix, MEKE, thickness_diffuse_CSp)
type(ocean_grid_type), intent(inout) :: G !< ocean grid structure
type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure
real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), &
Expand Down Expand Up @@ -264,10 +265,10 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
logical, intent(in) :: calc_dtbt !< if true, recalculate barotropic time step
type(VarMix_CS), pointer :: VarMix !< specify the spatially varying viscosities
type(MEKE_type), pointer :: MEKE !< related to mesoscale eddy kinetic energy param
type(barotropic_CS), pointer :: Barotropic_CSp!< Pointer to a structure containing
!! barotropic velocities
! type(barotropic_CS), pointer :: Barotropic_CSp!< Pointer to a structure containing
! !! barotropic velocities
type(thickness_diffuse_CS), pointer :: thickness_diffuse_CSp!< Pointer to a structure containing
!! interface height diffusivities
!! interface height diffusivities

! local variables
real :: dt_pred ! The time step for the predictor part of the baroclinic time stepping.
Expand Down Expand Up @@ -686,7 +687,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
! diffu = horizontal viscosity terms (u_av)
call cpu_clock_begin(id_clock_horvisc)
call horizontal_viscosity(u_av, v_av, h_av, CS%diffu, CS%diffv, &
MEKE, Varmix, Barotropic_CSp, thickness_diffuse_CSp, &
MEKE, Varmix, CS%barotropic_CSp, thickness_diffuse_CSp, &
G, GV, CS%hor_visc_CSp, OBC=CS%OBC)
call cpu_clock_end(id_clock_horvisc)
if (showCallTree) call callTree_wayPoint("done with horizontal_viscosity (step_MOM_dyn_split_RK2)")
Expand Down Expand Up @@ -959,7 +960,7 @@ end subroutine register_restarts_dyn_split_RK2
!! dynamic core, including diagnostics and the cpu clocks.
subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_file, &
diag, CS, restart_CS, dt, Accel_diag, Cont_diag, MIS, &
VarMix, MEKE, Barotropic_CSp, thickness_diffuse_CSp, &
VarMix, MEKE, thickness_diffuse_CSp, &
OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, &
visc, dirs, ntrunc, calc_dtbt)
type(ocean_grid_type), intent(inout) :: G !< ocean grid structure
Expand Down Expand Up @@ -987,8 +988,8 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_fil
!! diagnostic pointers
type(VarMix_CS), pointer :: VarMix !< points to spatially variable viscosities
type(MEKE_type), pointer :: MEKE !< points to mesoscale eddy kinetic energy fields
type(Barotropic_CS), pointer :: Barotropic_CSp !< Pointer to the control structure for
!! the barotropic module
! type(Barotropic_CS), pointer :: Barotropic_CSp !< Pointer to the control structure for
! !! the barotropic module
type(thickness_diffuse_CS), pointer :: thickness_diffuse_CSp !< Pointer to the control structure
!! used for the isopycnal height diffusive transport.
type(ocean_OBC_type), pointer :: OBC !< points to OBC related fields
Expand All @@ -1002,6 +1003,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_fil
!! truncated (this should be 0).
logical, intent(out) :: calc_dtbt !< If true, recalculate the barotropic time step

! local variables
real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_tmp
character(len=40) :: mdl = "MOM_dynamics_split_RK2" ! This module's name.
character(len=48) :: thickness_units, flux_units, eta_rest_name
Expand Down Expand Up @@ -1143,10 +1145,13 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_fil
CS%barotropic_CSp, restart_CS, calc_dtbt, CS%BT_cont, &
CS%tides_CSp)

! CS%barotropic_CSp => Barotropic_CSp
! CS%thickness_diffuse_CSp => thickness_diffuse_CSp

if (.not. query_initialized(CS%diffu,"diffu",restart_CS) .or. &
.not. query_initialized(CS%diffv,"diffv",restart_CS)) &
call horizontal_viscosity(u, v, h, CS%diffu, CS%diffv, MEKE, VarMix, &
Barotropic_CSp, thickness_diffuse_CSp, &
CS%barotropic_CSp, thickness_diffuse_CSp, &
G, GV, CS%hor_visc_CSp, OBC=CS%OBC)
if (.not. query_initialized(CS%u_av,"u2", restart_CS) .or. &
.not. query_initialized(CS%u_av,"v2", restart_CS)) then
Expand Down

0 comments on commit bef613b

Please sign in to comment.