45 real(RP),
private :: ocean_dyn_slab_heatcapacity
47 logical,
private :: ocean_dyn_slab_nudging = .false.
48 real(DP),
private :: ocean_dyn_slab_nudging_tausec
49 logical,
private :: ocean_dyn_slab_offline_mode = .false.
69 real(DP) :: OCEAN_DYN_SLAB_nudging_tau = 0.0_dp
70 character(len=H_SHORT) :: OCEAN_DYN_SLAB_nudging_tau_unit =
"SEC" 72 logical :: OCEAN_DYN_SLAB_nudging_enable_periodic_year = .false.
73 logical :: OCEAN_DYN_SLAB_nudging_enable_periodic_month = .false.
74 logical :: OCEAN_DYN_SLAB_nudging_enable_periodic_day = .false.
75 integer :: OCEAN_DYN_SLAB_nudging_step_fixed = 0
76 real(RP) :: OCEAN_DYN_SLAB_nudging_offset = 0.0_rp
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
81 namelist / param_ocean_dyn_slab / &
83 ocean_dyn_slab_nudging, &
84 ocean_dyn_slab_nudging_tau, &
85 ocean_dyn_slab_nudging_tau_unit, &
86 ocean_dyn_slab_nudging_basename, &
87 ocean_dyn_slab_nudging_enable_periodic_year, &
88 ocean_dyn_slab_nudging_enable_periodic_month, &
89 ocean_dyn_slab_nudging_enable_periodic_day, &
90 ocean_dyn_slab_nudging_step_fixed, &
91 ocean_dyn_slab_nudging_offset, &
92 ocean_dyn_slab_nudging_defval, &
93 ocean_dyn_slab_nudging_check_coordinates, &
94 ocean_dyn_slab_nudging_step_limit
100 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Setup' 102 ocean_dyn_slab_nudging_defval = undef
106 read(
io_fid_conf,nml=param_ocean_dyn_slab,iostat=ierr)
108 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Not found namelist. Default used.' 109 elseif( ierr > 0 )
then 110 log_error(
"OCEAN_DYN_SLAB_setup",*)
'Not appropriate names in namelist PARAM_OCEAN_DYN_SLAB. Check!' 113 log_nml(param_ocean_dyn_slab)
119 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Ocean heat capacity [J/K/m2] : ', ocean_dyn_slab_heatcapacity
121 if ( ocean_dyn_slab_nudging )
then 122 call calendar_unit2sec( ocean_dyn_slab_nudging_tausec, ocean_dyn_slab_nudging_tau, ocean_dyn_slab_nudging_tau_unit )
124 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Use nudging for SST : ON' 125 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Relaxation time Tau [sec] : ', ocean_dyn_slab_nudging_tausec
127 if ( ocean_dyn_slab_nudging_tausec == 0.0_rp )
then 128 ocean_dyn_slab_offline_mode = .true.
129 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Tau=0 means that SST is completely replaced by the external data.' 132 if ( ocean_dyn_slab_nudging_basename(1) ==
'' )
then 133 log_error(
"OCEAN_DYN_SLAB_setup",*)
'OCEAN_DYN_SLAB_nudging_basename is necessary !!' 137 log_info(
"OCEAN_DYN_SLAB_setup",*)
'Use nudging for SST : OFF' 140 if ( ocean_dyn_slab_nudging )
then 144 ocean_dyn_slab_nudging_enable_periodic_year, &
145 ocean_dyn_slab_nudging_enable_periodic_month, &
146 ocean_dyn_slab_nudging_enable_periodic_day, &
147 ocean_dyn_slab_nudging_step_fixed, &
148 ocean_dyn_slab_nudging_offset, &
149 ocean_dyn_slab_nudging_defval, &
150 ocean_dyn_slab_nudging_check_coordinates, &
151 ocean_dyn_slab_nudging_step_limit )
175 file_external_input_update
178 integer,
intent(in) :: OKMAX, OKS, OKE
179 integer,
intent(in) :: OIA, OIS, OIE
180 integer,
intent(in) :: OJA, OJS, OJE
181 real(RP),
intent(in) :: OCEAN_TEMP_t (okmax,oia,oja)
182 real(RP),
intent(in) :: OCEAN_SFLX_G (oia,oja)
183 real(RP),
intent(in) :: OCEAN_SFLX_water(oia,oja)
184 real(RP),
intent(in) :: OCEAN_SFLX_ice (oia,oja)
185 logical,
intent(in) :: calc_flag (oia,oja)
186 real(DP),
intent(in) :: dt
187 real(DP),
intent(in) :: NOWDAYSEC
188 real(RP),
intent(inout) :: OCEAN_TEMP (okmax,oia,oja)
190 real(RP) :: OCEAN_TEMP_t_ndg(okmax,oia,oja)
191 real(RP) :: OCEAN_TEMP_ref (okmax,oia,oja)
198 log_progress(*)
'ocean / dynamics / slab' 200 if ( ocean_dyn_slab_nudging )
then 202 call file_external_input_update(
'OCEAN_TEMP', nowdaysec, ocean_temp_ref(:,:,:), error )
205 log_error(
"OCEAN_DYN_SLAB",*)
'Requested data is not found!' 210 rtau = 1.0_rp / max(ocean_dyn_slab_nudging_tausec,dt)
215 ocean_temp_t_ndg(k,i,j) = ( ocean_temp_ref(k,i,j) - ocean_temp(k,i,j) ) * rtau
221 ocean_temp_t_ndg(:,:,:) = 0.0_rp
224 if ( ocean_dyn_slab_offline_mode )
then 228 if ( calc_flag(i,j) )
then 229 ocean_temp(oks,i,j) = ocean_temp_ref(oks,i,j)
238 if ( calc_flag(i,j) )
then 240 ocean_temp(oks,i,j) = ocean_temp(oks,i,j) + ocean_temp_t_ndg(oks,i,j) * dt &
241 + ( ocean_sflx_g(i,j) - ocean_sflx_ice(i,j) * emelt ) / ocean_dyn_slab_heatcapacity * dt
243 ocean_temp(k,i,j) = ocean_temp(k,i,j) + ocean_temp_t_ndg(k,i,j) * dt
subroutine, public calendar_unit2sec(second, value, unit)
Convert several units to second.
real(rp), parameter, public const_dwatr
density of water [kg/m3]
real(rp), parameter, public const_cl
specific heat (liquid water) [J/kg/K]
integer, public io_fid_conf
Config file ID.
real(rp), public const_undef
real(rp), public ocean_dyn_slab_depth
water depth of slab ocean [m]
subroutine, public ocean_dyn_slab(OKMAX, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, OCEAN_TEMP_t, OCEAN_SFLX_G, OCEAN_SFLX_water, OCEAN_SFLX_ice, calc_flag, dt, NOWDAYSEC, OCEAN_TEMP)
Slab ocean model.
subroutine, public ocean_dyn_slab_setup
Setup.
subroutine, public prc_abort
Abort Process.
real(rp), parameter, public const_emelt
module ocean / dynamics / slab