From b2cdd7b43e860ced5410b25080c4a65397a21a19 Mon Sep 17 00:00:00 2001 From: Raphael Dussin Date: Thu, 26 Aug 2021 09:58:55 -0400 Subject: [PATCH 1/3] add defaults and log for FIRST_MODE_PERIOD --- src/parameterizations/lateral/MOM_internal_tides.F90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parameterizations/lateral/MOM_internal_tides.F90 b/src/parameterizations/lateral/MOM_internal_tides.F90 index 4d66471408..ac6becf6ad 100644 --- a/src/parameterizations/lateral/MOM_internal_tides.F90 +++ b/src/parameterizations/lateral/MOM_internal_tides.F90 @@ -2206,7 +2206,11 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS) ! Allocate and populate frequency array (each a multiple of first for now) allocate(CS%frequency(num_freq)) - call get_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1, units="s", scale=US%s_to_T) + call get_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1, & + "The period of the first mode for internal tides", default=44567, & + units="s", scale=US%s_to_T) + call log_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1) + do fr=1,num_freq CS%frequency(fr) = (8.0*atan(1.0) * (real(fr)) / period_1) ! ADDED BDM enddo From df63cf33b676a5d398b5c72d859532f84553a476 Mon Sep 17 00:00:00 2001 From: Raphael Dussin Date: Fri, 27 Aug 2021 11:34:22 -0400 Subject: [PATCH 2/3] fix type default and init local array --- src/parameterizations/lateral/MOM_internal_tides.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parameterizations/lateral/MOM_internal_tides.F90 b/src/parameterizations/lateral/MOM_internal_tides.F90 index ac6becf6ad..a08c6cb163 100644 --- a/src/parameterizations/lateral/MOM_internal_tides.F90 +++ b/src/parameterizations/lateral/MOM_internal_tides.F90 @@ -212,6 +212,9 @@ subroutine propagate_int_tide(h, tv, cn, TKE_itidal_input, vel_btTide, Nb, dt, & I_rho0 = 1.0 / GV%Rho0 cn_subRO = 1e-100*US%m_s_to_L_T ! The hard-coded value here might need to increase. + ! init local arrays + drag_scale(:,:) = 0. + ! Set the wave speeds for the modes, using cg(n) ~ cg(1)/n.********************** ! This is wrong, of course, but it works reasonably in some cases. ! Uncomment if wave_speed is not used to calculate the true values (BDM). @@ -2207,7 +2210,7 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS) ! Allocate and populate frequency array (each a multiple of first for now) allocate(CS%frequency(num_freq)) call get_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1, & - "The period of the first mode for internal tides", default=44567, & + "The period of the first mode for internal tides", default=44567., & units="s", scale=US%s_to_T) call log_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1) From c7420005cd6b14d591843735435db48565a510ba Mon Sep 17 00:00:00 2001 From: Raphael Dussin Date: Fri, 27 Aug 2021 11:44:16 -0400 Subject: [PATCH 3/3] fix syntax --- src/parameterizations/lateral/MOM_internal_tides.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parameterizations/lateral/MOM_internal_tides.F90 b/src/parameterizations/lateral/MOM_internal_tides.F90 index a08c6cb163..c47c002aaa 100644 --- a/src/parameterizations/lateral/MOM_internal_tides.F90 +++ b/src/parameterizations/lateral/MOM_internal_tides.F90 @@ -2213,7 +2213,7 @@ subroutine internal_tides_init(Time, G, GV, US, param_file, diag, CS) "The period of the first mode for internal tides", default=44567., & units="s", scale=US%s_to_T) call log_param(param_file, mdl, "FIRST_MODE_PERIOD", period_1) - + do fr=1,num_freq CS%frequency(fr) = (8.0*atan(1.0) * (real(fr)) / period_1) ! ADDED BDM enddo