@@ -4424,7 +4424,7 @@ end subroutine bt_mass_source
4424
4424
! > barotropic_init initializes a number of time-invariant fields used in the
4425
4425
! ! barotropic calculation and initializes any barotropic fields that have not
4426
4426
! ! already been initialized.
4427
- subroutine barotropic_init (u , v , h , eta , Time , G , GV , US , param_file , diag , CS , &
4427
+ subroutine barotropic_init (u , v , h , Time , G , GV , US , param_file , diag , CS , &
4428
4428
restart_CS , calc_dtbt , BT_cont , SAL_CSp , HA_CSp )
4429
4429
type (ocean_grid_type), intent (inout ) :: G ! < The ocean's grid structure.
4430
4430
type (verticalGrid_type), intent (in ) :: GV ! < The ocean's vertical grid structure.
@@ -4435,9 +4435,6 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
4435
4435
intent (in ) :: v ! < The meridional velocity [L T-1 ~> m s-1].
4436
4436
real , dimension (SZI_(G),SZJ_(G),SZK_(GV)), &
4437
4437
intent (in ) :: h ! < Layer thicknesses [H ~> m or kg m-2].
4438
- real , dimension (SZI_(G),SZJ_(G)), &
4439
- intent (in ) :: eta ! < Free surface height or column mass anomaly
4440
- ! ! [Z ~> m] or [H ~> kg m-2].
4441
4438
type (time_type), target , intent (in ) :: Time ! < The current model time.
4442
4439
type (param_file_type), intent (in ) :: param_file ! < A structure to parse for run-time parameters.
4443
4440
type (diag_ctrl), target , intent (inout ) :: diag ! < A structure that is used to regulate diagnostic
@@ -4465,7 +4462,7 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
4465
4462
real :: SSH_extra ! An estimate of how much higher SSH might get, for use
4466
4463
! in calculating the safe external wave speed [Z ~> m].
4467
4464
real :: dtbt_input ! The input value of DTBT, [nondim] if negative or [s] if positive.
4468
- real :: dtbt_tmp ! A temporary copy of CS%dtbt read from a restart file [T ~> s]
4465
+ real :: dtbt_restart ! A temporary copy of CS%dtbt read from a restart file [T ~> s]
4469
4466
real :: wave_drag_scale ! A scaling factor for the barotropic linear wave drag
4470
4467
! piston velocities [nondim].
4471
4468
character (len= 200 ) :: inputdir ! The directory in which to find input files.
@@ -4978,9 +4975,9 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
4978
4975
4979
4976
CS% dtbt_fraction = 0.98 ; if (dtbt_input < 0.0 ) CS% dtbt_fraction = - dtbt_input
4980
4977
4981
- dtbt_tmp = - 1.0
4978
+ dtbt_restart = - 1.0
4982
4979
if (query_initialized(CS% dtbt, " DTBT" , restart_CS)) then
4983
- dtbt_tmp = CS% dtbt
4980
+ dtbt_restart = CS% dtbt
4984
4981
endif
4985
4982
4986
4983
! Estimate the maximum stable barotropic time step.
@@ -4991,14 +4988,17 @@ subroutine barotropic_init(u, v, h, eta, Time, G, GV, US, param_file, diag, CS,
4991
4988
H_to_Z = GV% H_to_RZ / CS% Rho_BT_lin
4992
4989
do k= 1 ,GV% ke ; gtot_estimate = gtot_estimate + H_to_Z* GV% g_prime(K) ; enddo
4993
4990
endif
4991
+
4992
+ ! CS%dtbt calculated here by set_dtbt is only used when dtbt is not reset during the run, i.e. DTBT_RESET_PERIOD<0.
4994
4993
call set_dtbt(G, GV, US, CS, gtot_est= gtot_estimate, SSH_add= SSH_extra)
4995
4994
4996
4995
if (dtbt_input > 0.0 ) then
4997
4996
CS% dtbt = US% s_to_T * dtbt_input
4998
- elseif (dtbt_tmp > 0.0 ) then
4999
- CS% dtbt = dtbt_tmp
4997
+ elseif (dtbt_restart > 0.0 ) then
4998
+ CS% dtbt = dtbt_restart
5000
4999
endif
5001
- if ((dtbt_tmp > 0.0 ) .and. (dtbt_input > 0.0 )) calc_dtbt = .false.
5000
+
5001
+ calc_dtbt = .true. ; if ((dtbt_restart > 0.0 ) .and. (dtbt_input > 0.0 )) calc_dtbt = .false.
5002
5002
5003
5003
call log_param(param_file, mdl, " DTBT as used" , CS% dtbt, units= " s" , unscale= US% T_to_s)
5004
5004
call log_param(param_file, mdl, " estimated maximum DTBT" , CS% dtbt_max, units= " s" , unscale= US% T_to_s)
0 commit comments