diff --git a/src/core/MOM.F90 b/src/core/MOM.F90 index f6bf668b73..bd3103e468 100644 --- a/src/core/MOM.F90 +++ b/src/core/MOM.F90 @@ -50,6 +50,7 @@ module MOM use MOM_ALE, only : ALE_init, ALE_end, ALE_main, ALE_CS, adjustGridForIntegrity use MOM_ALE, only : ALE_getCoordinate, ALE_getCoordinateUnits, ALE_writeCoordinateFile use MOM_ALE, only : ALE_updateVerticalGridType, ALE_remap_init_conds, ALE_register_diags +use MOM_barotropic, only : Barotropic_CS use MOM_boundary_update, only : call_OBC_register, OBC_register_end, update_OBC_CS use MOM_coord_initialization, only : MOM_initialize_coord use MOM_diabatic_driver, only : diabatic, diabatic_driver_init, diabatic_CS @@ -317,7 +318,8 @@ module MOM !< Pointer to the control structure for the MEKE updates type(VarMix_CS), pointer :: VarMix => NULL() !< Pointer to the control structure for the variable mixing module - + type(Barotropic_CS), pointer :: Barotropic_CSp => NULL() + !< Pointer to the control structure for the barotropic module type(tracer_registry_type), pointer :: tracer_Reg => NULL() !< Pointer to the MOM tracer registry type(tracer_advect_CS), pointer :: tracer_adv_CSp => NULL() @@ -959,7 +961,8 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, & call step_MOM_dyn_split_RK2(u, v, h, CS%tv, CS%visc, Time_local, dt, forces, & p_surf_begin, p_surf_end, CS%uh, CS%vh, CS%uhtr, CS%vhtr, & - CS%eta_av_bc, G, GV, CS%dyn_split_RK2_CSp, calc_dtbt, CS%VarMix, CS%MEKE) + CS%eta_av_bc, G, GV, CS%dyn_split_RK2_CSp, calc_dtbt, CS%VarMix, & + CS%MEKE, CS%Barotropic_CSp, CS%thickness_diffuse_CSp) if (showCallTree) call callTree_waypoint("finished step_MOM_dyn_split (step_MOM)") elseif (CS%do_dynamics) then ! ------------------------------------ not SPLIT @@ -973,11 +976,13 @@ subroutine step_MOM_dynamics(forces, p_surf_begin, p_surf_end, dt, dt_thermo, & if (CS%use_RK2) then call step_MOM_dyn_unsplit_RK2(u, v, h, CS%tv, CS%visc, Time_local, dt, forces, & p_surf_begin, p_surf_end, CS%uh, CS%vh, CS%uhtr, CS%vhtr, & - CS%eta_av_bc, G, GV, CS%dyn_unsplit_RK2_CSp, CS%VarMix, CS%MEKE) + CS%eta_av_bc, G, GV, CS%dyn_unsplit_RK2_CSp, CS%VarMix, CS%MEKE, & + CS%Barotropic_CSp, CS%thickness_diffuse_CSp) else call step_MOM_dyn_unsplit(u, v, h, CS%tv, CS%visc, Time_local, dt, forces, & p_surf_begin, p_surf_end, CS%uh, CS%vh, CS%uhtr, CS%vhtr, & - CS%eta_av_bc, G, GV, CS%dyn_unsplit_CSp, CS%VarMix, CS%MEKE, Waves=Waves) + CS%eta_av_bc, G, GV, CS%dyn_unsplit_CSp, CS%VarMix, CS%MEKE, & + CS%Barotropic_CSp, CS%thickness_diffuse_CSp, Waves=Waves) endif if (showCallTree) call callTree_waypoint("finished step_MOM_dyn_unsplit (step_MOM)") @@ -2291,6 +2296,7 @@ subroutine initialize_MOM(Time, Time_init, param_file, dirs, CS, restart_CSp, & call initialize_dyn_split_RK2(CS%u, CS%v, CS%h, CS%uh, CS%vh, eta, Time, & G, GV, param_file, diag, CS%dyn_split_RK2_CSp, restart_CSp, & CS%dt, CS%ADp, CS%CDp, MOM_internal_state, CS%VarMix, CS%MEKE, & + CS%Barotropic_CSp, CS%thickness_diffuse_CSp, & CS%OBC, CS%update_OBC_CSp, CS%ALE_CSp, CS%set_visc_CSp, & CS%visc, dirs, CS%ntrunc, calc_dtbt=calc_dtbt) if (CS%dtbt_reset_period > 0.0) then diff --git a/src/core/MOM_barotropic.F90 b/src/core/MOM_barotropic.F90 index 940c99b8be..022bde860d 100644 --- a/src/core/MOM_barotropic.F90 +++ b/src/core/MOM_barotropic.F90 @@ -55,7 +55,7 @@ module MOM_barotropic #endif public btcalc, bt_mass_source, btstep, barotropic_init, barotropic_end -public register_barotropic_restarts, set_dtbt +public register_barotropic_restarts, set_dtbt, barotropic_get_tav !> The barotropic stepping open boundary condition type type, private :: BT_OBC_type @@ -4348,6 +4348,29 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, param_file, diag, CS, & end subroutine barotropic_init +!> Copies ubtav and vbtav from private type into arrays +subroutine barotropic_get_tav(CS, ubtav, vbtav, G) + type(barotropic_CS), pointer :: CS !< Control structure for + !! this module + type(ocean_grid_type), intent(in) :: G !< Grid structure + real, dimension(SZIB_(G),SZJ_(G)), intent(inout) :: ubtav!< zonal barotropic vel. + !! ave. over baroclinic time-step (m s-1) + real, dimension(SZI_(G),SZJB_(G)), intent(inout) :: vbtav!< meridional barotropic vel. + !! ave. over baroclinic time-step (m s-1) + ! Local variables + integer :: i,j + + do j = G%jsc, G%jec ; do I = G%isc-1, G%iec + ubtav(I,j) = CS%ubtav(I,j) + enddo ; enddo + + do J = G%jsc-1, G%jec ; do i = G%isc, G%iec + vbtav(i,J) = CS%vbtav(i,J) + enddo ; enddo + +end subroutine barotropic_get_tav + + !> Clean up the barotropic control structure. subroutine barotropic_end(CS) type(barotropic_CS), pointer :: CS !< Control structure to clear out. @@ -4366,7 +4389,7 @@ subroutine barotropic_end(CS) end subroutine barotropic_end !> This subroutine is used to register any fields from MOM_barotropic.F90 -!! that should be written to or read from the restart file. +!!! that should be written to or read from the restart file. subroutine register_barotropic_restarts(HI, GV, param_file, CS, restart_CS) type(hor_index_type), intent(in) :: HI !< A horizontal index type structure. type(param_file_type), intent(in) :: param_file !< A structure to parse for run-time parameters. diff --git a/src/core/MOM_dynamics_split_RK2.F90 b/src/core/MOM_dynamics_split_RK2.F90 index d02285148a..9fdc2d77de 100644 --- a/src/core/MOM_dynamics_split_RK2.F90 +++ b/src/core/MOM_dynamics_split_RK2.F90 @@ -52,6 +52,7 @@ module MOM_dynamics_split_RK2 use MOM_open_boundary, only : open_boundary_test_extern_h use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS use MOM_set_visc, only : set_viscous_ML, set_visc_CS +use MOM_thickness_diffuse, only : thickness_diffuse_CS use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS use MOM_vert_friction, only : vertvisc, vertvisc_coef, vertvisc_remnant use MOM_vert_friction, only : vertvisc_limit_vel, vertvisc_init, vertvisc_CS @@ -228,7 +229,8 @@ 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) + G, GV, CS, calc_dtbt, VarMix, MEKE, Barotropic_CSp, & + 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)), & @@ -262,7 +264,12 @@ 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(thickness_diffuse_CS), pointer :: thickness_diffuse_CSp!< Pointer to a structure containing + !! interface height diffusivities + ! local variables real :: dt_pred ! The time step for the predictor part of the baroclinic time stepping. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: up ! Predicted zonal velocity in m s-1. @@ -679,7 +686,8 @@ 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, G, GV, CS%hor_visc_CSp, OBC=CS%OBC) + MEKE, Varmix, 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)") @@ -951,7 +959,8 @@ 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, OBC, update_OBC_CSp, ALE_CSp, setVisc_CSp, & + VarMix, MEKE, Barotropic_CSp, 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 type(verticalGrid_type), intent(in) :: GV !< ocean vertical grid structure @@ -978,6 +987,10 @@ 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(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 type(update_OBC_CS), pointer :: update_OBC_CSp !< points to OBC update related fields type(ALE_CS), pointer :: ALE_CSp !< points to ALE control structure @@ -1126,6 +1139,7 @@ subroutine initialize_dyn_split_RK2(u, v, h, uh, vh, eta, Time, G, GV, param_fil 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, & 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 diff --git a/src/core/MOM_dynamics_unsplit.F90 b/src/core/MOM_dynamics_unsplit.F90 index 47d3510c5a..cef44f65bc 100644 --- a/src/core/MOM_dynamics_unsplit.F90 +++ b/src/core/MOM_dynamics_unsplit.F90 @@ -50,7 +50,6 @@ module MOM_dynamics_unsplit !* * !********+*********+*********+*********+*********+*********+*********+** - use MOM_variables, only : vertvisc_type, thermo_var_ptrs use MOM_variables, only : accel_diag_ptrs, ocean_internal_state, cont_diag_ptrs use MOM_forcing_type, only : mech_forcing @@ -76,6 +75,7 @@ module MOM_dynamics_unsplit use MOM_time_manager, only : operator(-), operator(>), operator(*), operator(/) use MOM_ALE, only : ALE_CS +use MOM_barotropic, only : barotropic_CS use MOM_boundary_update, only : update_OBC_data, update_OBC_CS use MOM_continuity, only : continuity, continuity_init, continuity_CS use MOM_CoriolisAdv, only : CorAdCalc, CoriolisAdv_init, CoriolisAdv_CS @@ -91,6 +91,7 @@ module MOM_dynamics_unsplit use MOM_open_boundary, only : open_boundary_zero_normal_flow use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS use MOM_set_visc, only : set_viscous_ML, set_visc_CS +use MOM_thickness_diffuse, only : thickness_diffuse_CS use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS use MOM_vert_friction, only : vertvisc, vertvisc_coef use MOM_vert_friction, only : vertvisc_limit_vel, vertvisc_init, vertvisc_CS @@ -181,7 +182,7 @@ module MOM_dynamics_unsplit !! 3rd order (for the inviscid momentum equations) order scheme subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, & p_surf_begin, p_surf_end, uh, vh, uhtr, vhtr, eta_av, G, GV, CS, & - VarMix, MEKE, Waves) + VarMix, MEKE, Barotropic, thickness_diffuse, Waves) type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid structure. real, dimension(SZIB_(G),SZJ_(G),SZK_(G)), intent(inout) :: u !< The zonal velocity, in m s-1. @@ -216,6 +217,10 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, & !! that specify the spatially variable viscosities. type(MEKE_type), pointer :: MEKE !< A pointer to a structure containing !! fields related to the Mesoscale Eddy Kinetic Energy. + type(barotropic_CS), pointer :: Barotropic!< Pointer to a structure containing + !! barotropic velocities + type(thickness_diffuse_CS), pointer :: thickness_diffuse!< Pointer to a structure containing + !! interface height diffusivities type(wave_parameters_CS), optional, pointer :: Waves !< A pointer to a structure containing !! fields related to the surface wave conditions @@ -254,7 +259,7 @@ subroutine step_MOM_dyn_unsplit(u, v, h, tv, visc, Time_local, dt, forces, & call enable_averaging(dt,Time_local, CS%diag) call cpu_clock_begin(id_clock_horvisc) call horizontal_viscosity(u, v, h, CS%diffu, CS%diffv, MEKE, Varmix, & - G, GV, CS%hor_visc_CSp) + Barotropic, thickness_diffuse, G, GV, CS%hor_visc_CSp) call cpu_clock_end(id_clock_horvisc) call disable_averaging(CS%diag) diff --git a/src/core/MOM_dynamics_unsplit_RK2.F90 b/src/core/MOM_dynamics_unsplit_RK2.F90 index a1615ad413..4c1522480a 100644 --- a/src/core/MOM_dynamics_unsplit_RK2.F90 +++ b/src/core/MOM_dynamics_unsplit_RK2.F90 @@ -75,6 +75,7 @@ module MOM_dynamics_unsplit_RK2 use MOM_ALE, only : ALE_CS use MOM_boundary_update, only : update_OBC_data, update_OBC_CS +use MOM_barotropic, only : barotropic_CS use MOM_continuity, only : continuity, continuity_init, continuity_CS use MOM_CoriolisAdv, only : CorAdCalc, CoriolisAdv_init, CoriolisAdv_CS use MOM_debugging, only : check_redundant @@ -88,6 +89,7 @@ module MOM_dynamics_unsplit_RK2 use MOM_open_boundary, only : open_boundary_zero_normal_flow use MOM_PressureForce, only : PressureForce, PressureForce_init, PressureForce_CS use MOM_set_visc, only : set_viscous_ML, set_visc_CS +use MOM_thickness_diffuse, only : thickness_diffuse_CS use MOM_tidal_forcing, only : tidal_forcing_init, tidal_forcing_CS use MOM_vert_friction, only : vertvisc, vertvisc_coef use MOM_vert_friction, only : vertvisc_limit_vel, vertvisc_init, vertvisc_CS @@ -183,7 +185,7 @@ module MOM_dynamics_unsplit_RK2 !> Step the MOM6 dynamics using an unsplit quasi-2nd order Runge-Kutta scheme subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt, forces, & p_surf_begin, p_surf_end, uh, vh, uhtr, vhtr, eta_av, G, GV, CS, & - VarMix, MEKE) + VarMix, MEKE, Barotropic, thickness_diffuse) type(ocean_grid_type), intent(inout) :: G !< The ocean's grid structure. type(verticalGrid_type), intent(in) :: GV !< The ocean's vertical grid !! structure. @@ -230,7 +232,10 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt, type(MEKE_type), pointer :: MEKE !< A pointer to a structure containing !! fields related to the Mesoscale !! Eddy Kinetic Energy. - + type(barotropic_CS), pointer :: Barotropic!< Pointer to a structure containing + !! barotropic velocities + type(thickness_diffuse_CS), pointer :: thickness_diffuse!< Pointer to a structure containing + !! interface height diffusivities ! Local variables real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: h_av, hp real, dimension(SZIB_(G),SZJ_(G),SZK_(G)) :: up @@ -266,7 +271,7 @@ subroutine step_MOM_dyn_unsplit_RK2(u_in, v_in, h_in, tv, visc, Time_local, dt, call enable_averaging(dt,Time_local, CS%diag) call cpu_clock_begin(id_clock_horvisc) call horizontal_viscosity(u_in, v_in, h_in, CS%diffu, CS%diffv, MEKE, VarMix, & - G, GV, CS%hor_visc_CSp) + Barotropic, thickness_diffuse, G, GV, CS%hor_visc_CSp) call cpu_clock_end(id_clock_horvisc) call disable_averaging(CS%diag) call pass_vector(CS%diffu, CS%diffv, G%Domain, clock=id_clock_pass) diff --git a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 index d65634b1f7..4ad7ef4a7a 100644 --- a/src/parameterizations/lateral/MOM_thickness_diffuse.F90 +++ b/src/parameterizations/lateral/MOM_thickness_diffuse.F90 @@ -20,7 +20,7 @@ module MOM_thickness_diffuse implicit none ; private public thickness_diffuse, thickness_diffuse_init, thickness_diffuse_end -public vert_fill_TS +public vert_fill_TS, thickness_diffuse_get_KH #include @@ -52,12 +52,18 @@ module MOM_thickness_diffuse !! longer than DT, or 0 (the default) to use DT. integer :: nkml !< number of layers within mixed layer logical :: debug !< write verbose checksums for debugging purposes -! logical :: QG_Leith_GM !< If true, uses the QG Leith viscosity as the GM coefficient + logical :: use_GME_thickness_diffuse !< If true, passes GM coefficients to MOM_hor_visc for use + !! with GME closure. type(diag_ctrl), pointer :: diag => NULL() !< structure used to regulate timing of diagnostics real, pointer :: GMwork(:,:) => NULL() !< Work by thickness diffusivity (W m-2) real, pointer :: diagSlopeX(:,:,:) => NULL() !< Diagnostic: zonal neutral slope (nondim) real, pointer :: diagSlopeY(:,:,:) => NULL() !< Diagnostic: zonal neutral slope (nondim) + real, dimension(:,:,:), pointer :: & + KH_u_GME => NULL(), & !< interface height diffusivities in u-columns (m2 s-1) + KH_v_GME => NULL(), & !< interface height diffusivities in v-columns (m2 s-1) + KH_t_GME => NULL() !< interface height diffusivities in t-columns (m2 s-1) + !>@{ !! Diagnostic identifier integer :: id_uhGM = -1, id_vhGM = -1, id_GMwork = -1 @@ -238,6 +244,13 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, MEKE, VarMix, CDp, CS endif endif +!$OMP do + if (CS%use_GME_thickness_diffuse) then + do k=1,nz ; do j=js,je ; do I=is-1,ie + CS%KH_u_GME(I,j,k) = KH_u(I,j,k) + enddo ; enddo ; enddo + endif + !$OMP do do J=js-1,je ; do i=is,ie Khth_Loc(i,j) = CS%Khth @@ -305,6 +318,13 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, MEKE, VarMix, CDp, CS endif endif +!$OMP do + if (CS%use_GME_thickness_diffuse) then + do k=1,nz ; do j=js-1,je ; do I=is,ie + CS%KH_v_GME(I,j,k) = KH_v(I,j,k) + enddo ; enddo ; enddo + endif + !$OMP do do K=1,nz+1 ; do j=js,je ; do I=is-1,ie ; int_slope_u(I,j,K) = 0.0 ; enddo ; enddo ; enddo !$OMP do @@ -385,6 +405,13 @@ subroutine thickness_diffuse(h, uhtr, vhtr, tv, dt, G, GV, MEKE, VarMix, CDp, CS / (hu(I-1,j)+hu(I,j)+hv(i,J-1)+hv(i,J)+h_neglect) enddo ; enddo enddo + + if (CS%use_GME_thickness_diffuse) then + do k=1,nz; do j=js,je ; do i=is,ie + CS%KH_t_GME(i,j,k) = KH_t(i,j,k) + enddo ; enddo ; enddo + endif + if (CS%id_KH_t > 0) call post_data(CS%id_KH_t, KH_t, CS%diag) if (CS%id_KH_t1 > 0) call post_data(CS%id_KH_t1, KH_t(:,:,1), CS%diag) endif @@ -1805,6 +1832,15 @@ subroutine thickness_diffuse_init(Time, G, GV, param_file, diag, CDp, CS) "If true, write out verbose debugging data.", & default=.false., debuggingParam=.true.) + call get_param(param_file, mdl, "USE_GME", CS%use_GME_thickness_diffuse, & + "If true, use the GM+E backscatter scheme in association \n"//& + "with the Gent and McWilliams parameterization.", default=.false.) + + if (CS%use_GME_thickness_diffuse) then + allocate(CS%KH_u_GME(G%IsdB:G%IedB,G%jsd:G%jed,G%ke+1)) ; CS%KH_u_GME(:,:,:) = 0.0 + allocate(CS%KH_v_GME(G%isd:G%ied,G%JsdB:G%JedB,G%ke+1)) ; CS%KH_v_GME(:,:,:) = 0.0 + allocate(CS%KH_t_GME(G%isd:G%ied,G%jsd:G%jed,G%ke+1)) ; CS%KH_t_GME(:,:,:) = 0.0 + endif if (GV%Boussinesq) then ; flux_to_kg_per_s = GV%Rho0 else ; flux_to_kg_per_s = 1. ; endif @@ -1860,6 +1896,34 @@ subroutine thickness_diffuse_init(Time, G, GV, param_file, diag, CDp, CS) end subroutine thickness_diffuse_init +!> Copies ubtav and vbtav from private type into arrays +subroutine thickness_diffuse_get_KH(CS, KH_t_GME, KH_u_GME, KH_v_GME, G) + type(thickness_diffuse_CS), pointer :: CS !< Control structure for + !! this module + type(ocean_grid_type), intent(in) :: G !< Grid structure + real, dimension(SZI_(G),SZJ_(G),SZK_(G)+1), intent(inout) :: KH_t_GME!< interface height + !! diffusivities in t-columns (m2 s-1) + real, dimension(SZIB_(G),SZJ_(G),SZK_(G)+1), intent(inout) :: KH_u_GME!< interface height + !! diffusivities in u-columns (m2 s-1) + real, dimension(SZI_(G),SZJB_(G),SZK_(G)+1), intent(inout) :: KH_v_GME!< interface height + !! diffusivities in v-columns (m2 s-1) + ! Local variables + integer :: i,j,k + + do k=1,G%ke ; do j = G%jsc, G%jec ; do i = G%isc, G%iec + KH_t_GME(i,j,k) = CS%KH_t_GME(i,j,k) + enddo ; enddo ; enddo + + do k=1,G%ke ; do j = G%jsc, G%jec ; do I = G%isc-1, G%iec + KH_u_GME(I,j,k) = CS%KH_u_GME(I,j,k) + enddo ; enddo ; enddo + + do k=1,G%ke ; do J = G%jsc-1, G%jec ; do i = G%isc, G%iec + KH_v_GME(i,J,k) = CS%KH_v_GME(i,J,k) + enddo ; enddo ; enddo + +end subroutine thickness_diffuse_get_KH + !> Deallocate the thickness diffusion control structure subroutine thickness_diffuse_end(CS) type(thickness_diffuse_CS), pointer :: CS !< Control structure for thickness diffusion