43 real(RP),
private :: OCEAN_DYN_SLAB_HeatCapacity
45 logical,
private :: OCEAN_DYN_SLAB_nudging = .false.
46 real(DP),
private :: OCEAN_DYN_SLAB_nudging_tausec
47 logical,
private :: OCEAN_DYN_SLAB_offline_mode = .false.
64 file_external_input_regist
66 real(rp),
intent(in) :: depth
68 real(dp) :: ocean_dyn_slab_nudging_tau = 0.0_dp
69 character(len=H_SHORT) :: ocean_dyn_slab_nudging_tau_unit =
"SEC"
70 character(len=H_LONG) :: ocean_dyn_slab_nudging_basename =
''
71 logical :: ocean_dyn_slab_nudging_basename_add_num = .false.
72 integer :: ocean_dyn_slab_nudging_number_of_files = 1
73 logical :: ocean_dyn_slab_nudging_enable_periodic_year = .false.
74 logical :: ocean_dyn_slab_nudging_enable_periodic_month = .false.
75 logical :: ocean_dyn_slab_nudging_enable_periodic_day = .false.
76 integer :: ocean_dyn_slab_nudging_step_fixed = 0
77 real(rp) :: ocean_dyn_slab_nudging_defval
78 logical :: ocean_dyn_slab_nudging_check_coordinates = .true.
79 integer :: ocean_dyn_slab_nudging_step_limit = 0
82 real(rp) :: ocean_dyn_slab_depth = -1.0_rp
84 namelist / param_ocean_dyn_slab / &
85 ocean_dyn_slab_nudging, &
86 ocean_dyn_slab_nudging_tau, &
87 ocean_dyn_slab_nudging_tau_unit, &
88 ocean_dyn_slab_nudging_basename, &
89 ocean_dyn_slab_nudging_basename_add_num, &
90 ocean_dyn_slab_nudging_number_of_files, &
91 ocean_dyn_slab_nudging_enable_periodic_year, &
92 ocean_dyn_slab_nudging_enable_periodic_month, &
93 ocean_dyn_slab_nudging_enable_periodic_day, &
94 ocean_dyn_slab_nudging_step_fixed, &
95 ocean_dyn_slab_nudging_defval, &
96 ocean_dyn_slab_nudging_check_coordinates, &
97 ocean_dyn_slab_nudging_step_limit, &
104 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Setup'
106 ocean_dyn_slab_nudging_defval = undef
110 read(
io_fid_conf,nml=param_ocean_dyn_slab,iostat=ierr)
112 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Not found namelist. Default used.'
113 elseif( ierr > 0 )
then
114 log_error(
"OCEAN_DYN_SLAB_setup",*)
'Not appropriate names in namelist PARAM_OCEAN_DYN_SLAB. Check!'
117 log_nml(param_ocean_dyn_slab)
119 if ( ocean_dyn_slab_depth >= 0.0 )
then
120 log_error(
"OCEAN_DYN_SLAB_setup",*)
'"OCEAN_DYN_SLAB_DEPTH" is obsolete. USE "ODZ" of "PARAM_OCEAN_GRID_CARTESC"'
124 ocean_dyn_slab_heatcapacity = dwatr *
cv_water * depth
127 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Slab ocean depth [m] : ', depth
128 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Ocean heat capacity [J/K/m2] : ', ocean_dyn_slab_heatcapacity
130 if ( ocean_dyn_slab_nudging )
then
131 call calendar_unit2sec( ocean_dyn_slab_nudging_tausec, ocean_dyn_slab_nudging_tau, ocean_dyn_slab_nudging_tau_unit )
133 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Use nudging for SST : ON'
134 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Relaxation time Tau [sec] : ', ocean_dyn_slab_nudging_tausec
136 if ( ocean_dyn_slab_nudging_tausec == 0.0_rp )
then
137 ocean_dyn_slab_offline_mode = .true.
138 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Tau=0 means that SST is completely replaced by the external data.'
141 if ( ocean_dyn_slab_nudging_basename ==
'' )
then
142 log_error(
"OCEAN_DYN_SLAB_setup",*)
'OCEAN_DYN_SLAB_nudging_basename is necessary !!'
146 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Use nudging for SST : OFF'
149 if ( ocean_dyn_slab_nudging )
then
150 call file_external_input_regist( ocean_dyn_slab_nudging_basename, &
151 ocean_dyn_slab_nudging_basename_add_num, &
152 ocean_dyn_slab_nudging_number_of_files, &
155 ocean_dyn_slab_nudging_enable_periodic_year, &
156 ocean_dyn_slab_nudging_enable_periodic_month, &
157 ocean_dyn_slab_nudging_enable_periodic_day, &
158 ocean_dyn_slab_nudging_step_fixed, &
159 ocean_dyn_slab_nudging_defval, &
160 check_coordinates = ocean_dyn_slab_nudging_check_coordinates, &
161 step_limit = ocean_dyn_slab_nudging_step_limit, &
162 allow_missing = ( .not. ocean_dyn_slab_offline_mode ) )
187 file_external_input_update
192 integer,
intent(in) :: okmax, oks, oke
193 integer,
intent(in) :: oia, ois, oie
194 integer,
intent(in) :: oja, ojs, oje
195 real(rp),
intent(in) :: ocean_temp_t (okmax,oia,oja)
196 real(rp),
intent(in) :: ocean_sflx_g (oia,oja)
197 real(rp),
intent(in) :: ocean_sflx_water(oia,oja)
198 logical,
intent(in) :: calc_flag (oia,oja)
199 real(dp),
intent(in) :: dt
200 real(dp),
intent(in) :: nowdaysec
201 real(rp),
intent(inout) :: ocean_temp (okmax,oia,oja)
202 real(rp),
intent(out) :: mass_supl (oia,oja)
203 real(rp),
intent(out) :: engi_supl (oia,oja)
205 real(rp) :: ocean_temp_t_ndg(okmax,oia,oja)
206 real(rp) :: ocean_temp_ref (okmax,oia,oja)
219 log_progress(*)
'ocean / dynamics / slab'
221 if ( ocean_dyn_slab_nudging )
then
223 call file_external_input_update(
'OCEAN_TEMP', nowdaysec, ocean_temp_ref(:,:,:), error )
227 log_error(
"OCEAN_DYN_SLAB",*)
'Requested data is not found!'
231 if ( .not. ocean_dyn_slab_offline_mode )
then
234 rtau = 1.0_rp / max(ocean_dyn_slab_nudging_tausec,dt)
241 if ( ocean_temp_ref(k,i,j) == undef )
then
242 ocean_temp_t_ndg(k,i,j) = 0.0_rp
244 ocean_temp_t_ndg(k,i,j) = ( ocean_temp_ref(k,i,j) - ocean_temp(k,i,j) ) * rtau
259 ocean_temp_t_ndg(k,i,j) = 0.0_rp
266 if ( ocean_dyn_slab_offline_mode )
then
272 if ( calc_flag(i,j) )
then
273 ocean_temp(oks,i,j) = ocean_temp_ref(oks,i,j)
275 mass_supl(i,j) = 0.0_rp
276 engi_supl(i,j) = 0.0_rp
287 if ( calc_flag(i,j) )
then
289 dcp =
cv_water * ocean_sflx_water(i,j) * dt
290 ocean_temp(oks,i,j) = ocean_temp(oks,i,j) &
291 + ( ocean_sflx_g(i,j) * dt - dcp * ocean_temp(oks,i,j) ) &
292 / ( ocean_dyn_slab_heatcapacity + dcp ) &
293 + ocean_temp_t_ndg(oks,i,j) * dt
295 ocean_temp(k,i,j) = ocean_temp(k,i,j) + ocean_temp_t_ndg(k,i,j) * dt
297 mass_supl(i,j) = - ocean_sflx_water(i,j)
298 engi_supl(i,j) =
cv_water * mass_supl(i,j) * ocean_temp(oks,i,j)
300 mass_supl(i,j) = 0.0_rp
301 engi_supl(i,j) = 0.0_rp