Skip to content

Commit

Permalink
Merge branch 'breichl-user/bgr/ideal_hurricane_config' into dev/gfdl
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallberg-NOAA committed Oct 22, 2018
2 parents ad3bcc1 + 313f47a commit d6ed12f
Show file tree
Hide file tree
Showing 10 changed files with 734 additions and 393 deletions.
17 changes: 10 additions & 7 deletions config_src/solo_driver/MOM_surface_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ module MOM_surface_forcing
use user_surface_forcing, only : USER_surface_forcing_init, user_surface_forcing_CS
use user_revise_forcing, only : user_alter_forcing, user_revise_forcing_init
use user_revise_forcing, only : user_revise_forcing_CS
use SCM_idealized_hurricane, only : SCM_idealized_hurricane_wind_init
use SCM_idealized_hurricane, only : SCM_idealized_hurricane_wind_forcing
use SCM_idealized_hurricane, only : SCM_idealized_hurricane_CS
use idealized_hurricane, only : idealized_hurricane_wind_init
use idealized_hurricane, only : idealized_hurricane_wind_forcing, SCM_idealized_hurricane_wind_forcing
use idealized_hurricane, only : idealized_hurricane_CS
use SCM_CVmix_tests, only : SCM_CVmix_tests_surface_forcing_init
use SCM_CVmix_tests, only : SCM_CVmix_tests_wind_forcing
use SCM_CVmix_tests, only : SCM_CVmix_tests_buoyancy_forcing
Expand Down Expand Up @@ -199,7 +199,7 @@ module MOM_surface_forcing
type(dumbbell_surface_forcing_CS), pointer :: dumbbell_forcing_CSp => NULL()
type(MESO_surface_forcing_CS), pointer :: MESO_forcing_CSp => NULL()
type(Neverland_surface_forcing_CS), pointer :: Neverland_forcing_CSp => NULL()
type(SCM_idealized_hurricane_CS), pointer :: SCM_idealized_hurricane_CSp => NULL()
type(idealized_hurricane_CS), pointer :: idealized_hurricane_CSp => NULL()
type(SCM_CVmix_tests_CS), pointer :: SCM_CVmix_tests_CSp => NULL()
!!@}

Expand Down Expand Up @@ -275,8 +275,10 @@ subroutine set_forcing(sfc_state, forces, fluxes, day_start, day_interval, G, CS
call wind_forcing_const(sfc_state, forces, CS%tau_x0, CS%tau_y0, day_center, G, CS)
elseif (trim(CS%wind_config) == "Neverland") then
call Neverland_wind_forcing(sfc_state, forces, day_center, G, CS%Neverland_forcing_CSp)
elseif (trim(CS%wind_config) == "ideal_hurr") then
call idealized_hurricane_wind_forcing(sfc_state, forces, day_center, G, CS%idealized_hurricane_CSp)
elseif (trim(CS%wind_config) == "SCM_ideal_hurr") then
call SCM_idealized_hurricane_wind_forcing(sfc_state, forces, day_center, G, CS%SCM_idealized_hurricane_CSp)
call SCM_idealized_hurricane_wind_forcing(sfc_state, forces, day_center, G, CS%idealized_hurricane_CSp)
elseif (trim(CS%wind_config) == "SCM_CVmix_tests") then
call SCM_CVmix_tests_wind_forcing(sfc_state, forces, day_center, G, CS%SCM_CVmix_tests_CSp)
elseif (trim(CS%wind_config) == "USER") then
Expand Down Expand Up @@ -1685,8 +1687,9 @@ subroutine surface_forcing_init(Time, G, param_file, diag, CS, tracer_flow_CSp)
call MESO_surface_forcing_init(Time, G, param_file, diag, CS%MESO_forcing_CSp)
elseif (trim(CS%wind_config) == "Neverland") then
call Neverland_surface_forcing_init(Time, G, param_file, diag, CS%Neverland_forcing_CSp)
elseif (trim(CS%wind_config) == "SCM_ideal_hurr") then
call SCM_idealized_hurricane_wind_init(Time, G, param_file, CS%SCM_idealized_hurricane_CSp)
elseif (trim(CS%wind_config) == "ideal_hurr" .or.&
trim(CS%wind_config) == "SCM_ideal_hurr") then
call idealized_hurricane_wind_init(Time, G, param_file, CS%idealized_hurricane_CSp)
elseif (trim(CS%wind_config) == "const") then
call get_param(param_file, mdl, "CONST_WIND_TAUX", CS%tau_x0, &
"With wind_config const, this is the constant zonal\n"//&
Expand Down
3 changes: 2 additions & 1 deletion src/core/MOM.F90
Original file line number Diff line number Diff line change
Expand Up @@ -961,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,&
waves=waves)
if (showCallTree) call callTree_waypoint("finished step_MOM_dyn_split (step_MOM)")

elseif (CS%do_dynamics) then ! ------------------------------------ not SPLIT
Expand Down
10 changes: 6 additions & 4 deletions src/core/MOM_dynamics_split_RK2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module MOM_dynamics_split_RK2
use MOM_vert_friction, only : updateCFLtruncationValue
use MOM_verticalGrid, only : verticalGrid_type, get_thickness_units
use MOM_verticalGrid, only : get_flux_units, get_tr_flux_units
use MOM_wave_interface, only: wave_parameters_CS

implicit none ; private

Expand Down Expand Up @@ -228,7 +229,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)
G, GV, CS, calc_dtbt, VarMix, MEKE, Waves)
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 @@ -262,7 +263,8 @@ 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(wave_parameters_CS), optional, pointer :: Waves !< A pointer to a structure containing
!! fields related to the surface wave conditions
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.
Expand Down Expand Up @@ -576,7 +578,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
call vertvisc_coef(up, vp, h, forces, visc, dt_pred, G, GV, CS%vertvisc_CSp, &
CS%OBC)
call vertvisc(up, vp, h, forces, visc, dt_pred, CS%OBC, CS%ADp, CS%CDp, G, &
GV, CS%vertvisc_CSp, CS%taux_bot, CS%tauy_bot)
GV, CS%vertvisc_CSp, CS%taux_bot, CS%tauy_bot, waves=waves)
if (showCallTree) call callTree_wayPoint("done with vertvisc (step_MOM_dyn_split_RK2)")
if (G%nonblocking_updates) then
call cpu_clock_end(id_clock_vertvisc)
Expand Down Expand Up @@ -774,7 +776,7 @@ subroutine step_MOM_dyn_split_RK2(u, v, h, tv, visc, &
call cpu_clock_begin(id_clock_vertvisc)
call vertvisc_coef(u, v, h, forces, visc, dt, G, GV, CS%vertvisc_CSp, CS%OBC)
call vertvisc(u, v, h, forces, visc, dt, CS%OBC, CS%ADp, CS%CDp, G, GV, &
CS%vertvisc_CSp, CS%taux_bot, CS%tauy_bot)
CS%vertvisc_CSp, CS%taux_bot, CS%tauy_bot,waves=waves)
if (G%nonblocking_updates) then
call cpu_clock_end(id_clock_vertvisc)
call start_group_pass(CS%pass_uv, G%Domain, clock=id_clock_pass)
Expand Down
4 changes: 0 additions & 4 deletions src/initialization/MOM_state_initialization.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ module MOM_state_initialization
use Rossby_front_2d_initialization, only : Rossby_front_initialize_thickness
use Rossby_front_2d_initialization, only : Rossby_front_initialize_temperature_salinity
use Rossby_front_2d_initialization, only : Rossby_front_initialize_velocity
use SCM_idealized_hurricane, only : SCM_idealized_hurricane_TS_init
use SCM_CVMix_tests, only: SCM_CVMix_tests_TS_init
use dyed_channel_initialization, only : dyed_channel_set_OBC_tracer_data
use dyed_obcs_initialization, only : dyed_obcs_set_OBC_data
Expand Down Expand Up @@ -338,7 +337,6 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
" \t seamount - no motion test with seamount ICs. \n"//&
" \t dumbbell - sloshing channel ICs. \n"//&
" \t rossby_front - a mixed layer front in thermal wind balance.\n"//&
" \t SCM_ideal_hurr - used in the SCM idealized hurricane test.\n"//&
" \t SCM_CVMix_tests - used in the SCM CVMix tests.\n"//&
" \t USER - call a user modified routine.", &
fail_if_missing=new_sim, do_not_log=just_read)
Expand Down Expand Up @@ -370,8 +368,6 @@ subroutine MOM_initialize_state(u, v, h, tv, Time, G, GV, PF, dirs, &
tv%S, h, G, GV, PF, eos, just_read_params=just_read)
case ("rossby_front"); call Rossby_front_initialize_temperature_salinity ( tv%T, &
tv%S, h, G, GV, PF, eos, just_read_params=just_read)
case ("SCM_ideal_hurr"); call SCM_idealized_hurricane_TS_init ( tv%T, &
tv%S, h, G, GV, PF, just_read_params=just_read)
case ("SCM_CVMix_tests"); call SCM_CVMix_tests_TS_init (tv%T, &
tv%S, h, G, GV, PF, just_read_params=just_read)
case ("dense"); call dense_water_initialize_TS(G, GV, PF, eos, tv%T, tv%S, &
Expand Down
31 changes: 21 additions & 10 deletions src/parameterizations/vertical/MOM_CVMix_KPP.F90
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ module MOM_CVMix_KPP
integer :: id_NLT_dTdt = -1
integer :: id_NLT_temp_budget = -1
integer :: id_NLT_saln_budget = -1
integer :: id_EnhK = -1, id_EnhW = -1, id_EnhVt2 = -1
integer :: id_EnhK = -1, id_EnhVt2 = -1
integer :: id_EnhW = -1
integer :: id_La_SL = -1
integer :: id_OBLdepth_original = -1
!!@}

Expand Down Expand Up @@ -523,6 +525,8 @@ logical function KPP_init(paramFile, G, GV, diag, Time, CS, passive, Waves)
'Langmuir number enhancement to K as used by [CVMix] KPP','nondim')
CS%id_EnhVt2 = register_diag_field('ocean_model', 'EnhVt2', diag%axesTL, Time, &
'Langmuir number enhancement to Vt2 as used by [CVMix] KPP','nondim')
CS%id_La_SL = register_diag_field('ocean_model', 'KPP_La_SL', diag%axesT1, Time, &
'Surface-layer Langmuir number computed in [CVMix] KPP','nondim')

allocate( CS%N( SZI_(G), SZJ_(G), SZK_(G)+1 ) )
CS%N(:,:,:) = 0.
Expand Down Expand Up @@ -707,10 +711,12 @@ subroutine KPP_calculate(CS, G, GV, h, uStar, &
if (CS%LT_K_METHOD==LT_K_MODE_CONSTANT) then
LangEnhK = CS%KPP_K_ENH_FAC
elseif (CS%LT_K_METHOD==LT_K_MODE_VR12) then
LangEnhK = min(10.,sqrt(1.+(1.5*WAVES%LangNum(i,j))**(-2) + &
(5.4*WAVES%LangNum(i,j))**(-4)))
! Added minimum value for La_SL, so removed maximum value for LangEnhK.
LangEnhK = sqrt(1.+(1.5*WAVES%La_SL(i,j))**(-2) + &
(5.4*WAVES%La_SL(i,j))**(-4))
elseif (CS%LT_K_METHOD==LT_K_MODE_RW16) then
LangEnhK = min(2.25, 1. + 1./WAVES%LangNum(i,j))
!This maximum value is proposed in Reichl et al., 2016 JPO formula
LangEnhK = min(2.25, 1. + 1./WAVES%La_SL(i,j))
else
!This shouldn't be reached.
!call MOM_error(WARNING,"Unexpected behavior in MOM_CVMix_KPP, see error in LT_K_ENHANCEMENT")
Expand Down Expand Up @@ -915,7 +921,7 @@ subroutine KPP_compute_BLD(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, buoyFlux,
real :: MLD_GUESS, LA
real :: surfHuS, surfHvS, surfUs, surfVs, wavedir, currentdir
real :: VarUp, VarDn, M, VarLo, VarAvg
real :: H10pct, H20pct,CMNFACT, USx20pct, USy20pct
real :: H10pct, H20pct,CMNFACT, USx20pct, USy20pct, enhvt2
integer :: B
real :: WST

Expand Down Expand Up @@ -1064,7 +1070,7 @@ subroutine KPP_compute_BLD(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, buoyFlux,
MLD_GUESS = max( 1., abs(CS%OBLdepthprev(i,j) ) )
call get_Langmuir_Number( LA, G, GV, MLD_guess, surfFricVel, I, J, &
H=H(i,j,:), U_H=U_H, V_H=V_H, WAVES=WAVES)
WAVES%LangNum(i,j)=LA
WAVES%La_SL(i,j)=LA
endif


Expand Down Expand Up @@ -1111,20 +1117,24 @@ subroutine KPP_compute_BLD(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, buoyFlux,
LangEnhVT2(k) = CS%KPP_VT2_ENH_FAC
enddo
elseif (CS%LT_VT2_METHOD==LT_VT2_MODE_VR12) then
!Introduced minimum value for La_SL, so maximum value for enhvt2 is removed.
enhvt2 = sqrt(1.+(1.5*WAVES%La_SL(i,j))**(-2) + &
(5.4*WAVES%La_SL(i,j))**(-4))
do k=1,G%ke
LangEnhVT2(k) = min(10.,sqrt(1.+(1.5*WAVES%LangNum(i,j))**(-2) + &
(5.4*WAVES%LangNum(i,j))**(-4)))
LangEnhVT2(k) = enhvt2
enddo
elseif (CS%LT_VT2_METHOD==LT_VT2_MODE_RW16) then
!Introduced minimum value for La_SL, so maximum value for enhvt2 is removed.
enhvt2 = 1. + 2.3*WAVES%La_SL(i,j)**(-0.5)
do k=1,G%ke
LangEnhVT2(k) = min(2.25, 1. + 1./WAVES%LangNum(i,j))
LangEnhVT2(k) = enhvt2
enddo
elseif (CS%LT_VT2_METHOD==LT_VT2_MODE_LF17) then
CS%CS=cvmix_get_kpp_real('c_s',CS%KPP_params)
do k=1,G%ke
WST = (max(0.,-buoyflux(i,j,1))*(-cellHeight(k)))**(1./3.)
LangEnhVT2(k) = sqrt((0.15*WST**3. + 0.17*surfFricVel**3.* &
(1.+0.49*WAVES%LangNum(i,j)**(-2.))) / &
(1.+0.49*WAVES%La_SL(i,j)**(-2.))) / &
(0.2*ws_1d(k)**3/(CS%cs*CS%surf_layer_ext*CS%vonKarman**4.)))
enddo
else
Expand Down Expand Up @@ -1297,6 +1307,7 @@ subroutine KPP_compute_BLD(CS, G, GV, h, Temp, Salt, u, v, EOS, uStar, buoyFlux,
if (CS%id_BulkUz2 > 0) call post_data(CS%id_BulkUz2, CS%Uz2, CS%diag)
if (CS%id_EnhK > 0) call post_data(CS%id_EnhK, CS%EnhK, CS%diag)
if (CS%id_EnhVt2 > 0) call post_data(CS%id_EnhVt2, CS%EnhVt2, CS%diag)
if (CS%id_La_SL>0.and.present(WAVES)) call post_data(CS%id_La_SL,WAVES%La_SL,CS%diag)

! BLD smoothing:
if (CS%n_smooth > 0) call KPP_smooth_BLD(CS,G,GV,h)
Expand Down
4 changes: 2 additions & 2 deletions src/parameterizations/vertical/MOM_diabatic_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ subroutine diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_end, &
! The KPP scheme calculates boundary layer diffusivities and non-local transport.

call KPP_compute_BLD(CS%KPP_CSp, G, GV, h, tv%T, tv%S, u, v, tv%eqn_of_state, &
fluxes%ustar, CS%KPP_buoy_flux)
fluxes%ustar, CS%KPP_buoy_flux, Waves=Waves)

call KPP_calculate(CS%KPP_CSp, G, GV, h, fluxes%ustar, CS%KPP_buoy_flux, Kd_heat, &
Kd_salt, visc%Kv_shear, CS%KPP_NLTheat, CS%KPP_NLTscalar, Waves=Waves)
Expand Down Expand Up @@ -1530,7 +1530,7 @@ subroutine legacy_diabatic(u, v, h, tv, Hml, fluxes, visc, ADp, CDp, dt, Time_en
endif

call KPP_compute_BLD(CS%KPP_CSp, G, GV, h, tv%T, tv%S, u, v, tv%eqn_of_state, &
fluxes%ustar, CS%KPP_buoy_flux)
fluxes%ustar, CS%KPP_buoy_flux, Waves=Waves)

call KPP_calculate(CS%KPP_CSp, G, GV, h, fluxes%ustar, CS%KPP_buoy_flux, Kd_heat, &
Kd_salt, visc%Kv_shear, CS%KPP_NLTheat, CS%KPP_NLTscalar, Waves=Waves)
Expand Down
Loading

0 comments on commit d6ed12f

Please sign in to comment.