Skip to content

Commit

Permalink
Merge pull request #46 from alperaltuntas/introduce_cvmix_tidal
Browse files Browse the repository at this point in the history
Add tidal mixing module and cvmix tidal interface
  • Loading branch information
gustavo-marques authored Apr 6, 2018
2 parents 78bb40c + bf322c8 commit 86e7074
Show file tree
Hide file tree
Showing 4 changed files with 1,363 additions and 859 deletions.
2 changes: 1 addition & 1 deletion pkg/CVMix-src
10 changes: 9 additions & 1 deletion src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ module MOM_diabatic_driver
use MOM_cvmix_conv, only : cvmix_conv_end, calculate_cvmix_conv
use MOM_domains, only : pass_var, To_West, To_South, To_All, Omit_Corners
use MOM_domains, only : create_group_pass, do_group_pass, group_pass_type
use MOM_tidal_mixing, only : tidal_mixing_init, tidal_mixing_cs
use MOM_tidal_mixing, only : tidal_mixing_end
use MOM_energetic_PBL, only : energetic_PBL, energetic_PBL_init
use MOM_energetic_PBL, only : energetic_PBL_end, energetic_PBL_CS
use MOM_energetic_PBL, only : energetic_PBL_get_MLD
Expand Down Expand Up @@ -90,6 +92,7 @@ module MOM_diabatic_driver
!! shear-driven diapycnal diffusivity.
logical :: use_cvmix_shear !< If true, use the CVMix module to find the
!! shear-driven diapycnal diffusivity.
logical :: use_tidal_mixing !< If true, activate tidal mixing diffusivity.
logical :: use_cvmix_conv !< If true, use the CVMix module to get enhanced
!! mixing due to convection.
logical :: use_sponge !< If true, sponges may be applied anywhere in the
Expand Down Expand Up @@ -220,6 +223,7 @@ module MOM_diabatic_driver
type(optics_type), pointer :: optics => NULL()
type(diag_to_Z_CS), pointer :: diag_to_Z_CSp => NULL()
type(KPP_CS), pointer :: KPP_CSp => NULL()
type(tidal_mixing_cs), pointer :: tidal_mixing_csp => NULL()
type(cvmix_conv_cs), pointer :: cvmix_conv_csp => NULL()
type(diapyc_energy_req_CS), pointer :: diapyc_en_rec_CSp => NULL()

Expand Down Expand Up @@ -2337,6 +2341,8 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag,
allocate(CS%frazil_heat_diag(isd:ied,jsd:jed,nz) ) ; CS%frazil_heat_diag(:,:,:) = 0.
endif

! CS%use_tidal_mixing is set to True if an internal tidal dissipation scheme is to be used.
CS%use_tidal_mixing = tidal_mixing_init(Time, G, GV, param_file, diag, diag_to_Z_CSp, CS%tidal_mixing_CSp)

! CS%use_cvmix_conv is set to True if CVMix convection will be used, otherwise
! False.
Expand All @@ -2356,7 +2362,7 @@ subroutine diabatic_driver_init(Time, G, GV, param_file, useALEalgorithm, diag,
endif

! initialize module for setting diffusivities
call set_diffusivity_init(Time, G, GV, param_file, diag, CS%set_diff_CSp, diag_to_Z_CSp, CS%int_tide_CSp)
call set_diffusivity_init(Time, G, GV, param_file, diag, CS%set_diff_CSp, diag_to_Z_CSp, CS%int_tide_CSp, CS%tidal_mixing_CSp)


! set up the clocks for this module
Expand Down Expand Up @@ -2429,6 +2435,8 @@ subroutine diabatic_driver_end(CS)
call KPP_end(CS%KPP_CSp)
endif

if (CS%use_tidal_mixing) call tidal_mixing_end(CS%tidal_mixing_CSp)

if (CS%use_cvmix_conv) call cvmix_conv_end(CS%cvmix_conv_csp)

if (CS%use_energetic_PBL) &
Expand Down
Loading

0 comments on commit 86e7074

Please sign in to comment.