45 integer,
private,
parameter :: num_vars_3d = 4
46 integer,
private,
parameter :: num_vars_2d = 4
47 integer,
private,
parameter :: num_vars_2d_op = 4
49 real(RP),
private :: atmos_phy_rd_offline_diffuse_rate = 0.5_rp
50 real(RP),
private :: atmos_phy_rd_offline_nir_rate = 0.5_rp
52 logical,
private :: vars_2d_exist(num_vars_2d_op)
67 character(len=H_SHORT) :: vars_3d (num_vars_3d)
68 character(len=H_SHORT) :: vars_2d (num_vars_2d)
69 character(len=H_SHORT) :: vars_2d_op(num_vars_2d_op)
71 data vars_3d /
'RFLX_LW_up',
'RFLX_LW_dn',
'RFLX_SW_up',
'RFLX_SW_dn' /
72 data vars_2d /
'SFLX_LW_up',
'SFLX_LW_dn',
'SFLX_SW_up',
'SFLX_SW_dn' /
73 data vars_2d_op /
'SFLX_NIR_dn_dir',
'SFLX_NIR_dn_dif',
'SFLX_VIS_dn_dir',
'SFLX_VIS_dn_dif' /
76 character(len=H_SHORT) :: ATMOS_PHY_RD_offline_axistype =
'XYZ' 77 logical :: ATMOS_PHY_RD_offline_enable_periodic_year = .false.
78 logical :: ATMOS_PHY_RD_offline_enable_periodic_month = .false.
79 logical :: ATMOS_PHY_RD_offline_enable_periodic_day = .false.
80 integer :: ATMOS_PHY_RD_offline_step_fixed = 0
81 real(RP) :: ATMOS_PHY_RD_offline_offset = 0.0_rp
82 real(RP) :: ATMOS_PHY_RD_offline_defval
83 logical :: ATMOS_PHY_RD_offline_check_coordinates = .true.
84 integer :: ATMOS_PHY_RD_offline_step_limit = 0
86 namelist / param_atmos_phy_rd_offline / &
87 atmos_phy_rd_offline_basename, &
88 atmos_phy_rd_offline_axistype, &
89 atmos_phy_rd_offline_enable_periodic_year, &
90 atmos_phy_rd_offline_enable_periodic_month, &
91 atmos_phy_rd_offline_enable_periodic_day, &
92 atmos_phy_rd_offline_step_fixed, &
93 atmos_phy_rd_offline_offset, &
94 atmos_phy_rd_offline_defval, &
95 atmos_phy_rd_offline_check_coordinates, &
96 atmos_phy_rd_offline_step_limit, &
97 atmos_phy_rd_offline_diffuse_rate, &
98 atmos_phy_rd_offline_nir_rate
104 log_info(
"ATMOS_PHY_RD_offline_setup",*)
'Setup' 105 log_info(
"ATMOS_PHY_RD_offline_setup",*)
'Offline radiation process' 107 atmos_phy_rd_offline_defval = undef
111 read(
io_fid_conf,nml=param_atmos_phy_rd_offline,iostat=ierr)
113 log_info(
"ATMOS_PHY_RD_offline_setup",*)
'Not found namelist. Default used.' 114 elseif( ierr > 0 )
then 115 log_error(
"ATMOS_PHY_RD_offline_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_PHY_RD_OFFLINE. Check!' 118 log_nml(param_atmos_phy_rd_offline)
120 if ( atmos_phy_rd_offline_basename(1) ==
'' )
then 121 log_error(
"ATMOS_PHY_RD_offline_setup",*)
'ATMOS_PHY_RD_offline_basename is necessary' 125 do n = 1, num_vars_3d
128 atmos_phy_rd_offline_axistype, &
129 atmos_phy_rd_offline_enable_periodic_year, &
130 atmos_phy_rd_offline_enable_periodic_month, &
131 atmos_phy_rd_offline_enable_periodic_day, &
132 atmos_phy_rd_offline_step_fixed, &
133 atmos_phy_rd_offline_offset, &
134 atmos_phy_rd_offline_defval, &
135 atmos_phy_rd_offline_check_coordinates, &
136 atmos_phy_rd_offline_step_limit )
139 do n = 1, num_vars_2d
143 atmos_phy_rd_offline_enable_periodic_year, &
144 atmos_phy_rd_offline_enable_periodic_month, &
145 atmos_phy_rd_offline_enable_periodic_day, &
146 atmos_phy_rd_offline_step_fixed, &
147 atmos_phy_rd_offline_offset, &
148 atmos_phy_rd_offline_defval, &
149 atmos_phy_rd_offline_check_coordinates, &
150 atmos_phy_rd_offline_step_limit )
153 do n = 1, num_vars_2d_op
157 atmos_phy_rd_offline_enable_periodic_year, &
158 atmos_phy_rd_offline_enable_periodic_month, &
159 atmos_phy_rd_offline_enable_periodic_day, &
160 atmos_phy_rd_offline_step_fixed, &
161 atmos_phy_rd_offline_offset, &
162 atmos_phy_rd_offline_defval, &
163 atmos_phy_rd_offline_check_coordinates, &
164 atmos_phy_rd_offline_step_limit, &
165 exist = vars_2d_exist(n) )
166 if ( vars_2d_exist(n) )
then 167 log_info(
"ATMOS_PHY_RD_offline_setup",*)
'', trim(vars_2d_op(n)),
' found.' 169 log_info(
"ATMOS_PHY_RD_offline_setup",*)
'', trim(vars_2d_op(n)),
' not found.' 179 KA, KS, KE, IA, IS, IE, JA, JS, JE, &
186 file_external_input_update
194 integer,
intent(in) :: KA, KS, KE
195 integer,
intent(in) :: IA, IS, IE
196 integer,
intent(in) :: JA, JS, JE
197 real(DP),
intent(in) :: time_now
198 real(RP),
intent(out) :: flux_rad (ka,ia,ja,2,2)
201 real(RP) :: buffer(ia,ja)
202 logical :: error, error_sum, error_sflx
207 log_progress(*)
'atmosphere / physics / radiation / offline' 214 call file_external_input_update(
'RFLX_LW_up', time_now, flux_rad(:,:,:,
i_lw,
i_up), error )
215 error_sum = ( error .OR. error_sum )
217 call file_external_input_update(
'RFLX_LW_dn', time_now, flux_rad(:,:,:,
i_lw,
i_dn), error )
218 error_sum = ( error .OR. error_sum )
220 call file_external_input_update(
'RFLX_SW_up', time_now, flux_rad(:,:,:,
i_sw,
i_up), error )
221 error_sum = ( error .OR. error_sum )
223 call file_external_input_update(
'RFLX_SW_dn', time_now, flux_rad(:,:,:,
i_sw,
i_dn), error )
224 error_sum = ( error .OR. error_sum )
228 call file_external_input_update(
'SFLX_LW_up', time_now, buffer(:,:), error )
238 flux_rad(ks-1,i,j,
i_lw,
i_up) = buffer(i,j)
243 call file_external_input_update(
'SFLX_LW_dn', time_now, buffer(:,:), error )
253 flux_rad(ks-1,i,j,
i_lw,
i_dn) = buffer(i,j)
258 call file_external_input_update(
'SFLX_SW_up', time_now, buffer(:,:), error )
268 flux_rad(ks-1,i,j,
i_sw,
i_up) = buffer(i,j)
273 call file_external_input_update(
'SFLX_SW_dn', time_now, buffer(:,:), error )
283 flux_rad(ks-1,i,j,
i_sw,
i_dn) = buffer(i,j)
303 if ( vars_2d_exist(1) )
then 304 call file_external_input_update(
'SFLX_NIR_dn_dir', time_now, sflx_rad_dn(:,:,
i_r_direct,
i_r_vis), error )
305 error_sum = ( error .OR. error_sum )
310 if ( vars_2d_exist(2) )
then 311 call file_external_input_update(
'SFLX_NIR_dn_dif', time_now, sflx_rad_dn(:,:,
i_r_direct,
i_r_vis), error )
312 error_sum = ( error .OR. error_sum )
317 if ( vars_2d_exist(3) )
then 318 call file_external_input_update(
'SFLX_VIS_dn_dir', time_now, sflx_rad_dn(:,:,
i_r_direct,
i_r_vis), error )
319 error_sum = ( error .OR. error_sum )
324 if ( vars_2d_exist(4) )
then 325 call file_external_input_update(
'SFLX_VIS_dn_dif', time_now, sflx_rad_dn(:,:,
i_r_direct,
i_r_vis), error )
326 error_sum = ( error .OR. error_sum )
331 if ( error_sflx )
then 338 sflx_rad_dn(i,j,
i_r_direct ,
i_r_nir) = ( 1.0_rp-atmos_phy_rd_offline_diffuse_rate ) &
339 * ( atmos_phy_rd_offline_nir_rate ) * flux_rad(ks-1,i,j,
i_sw,
i_dn)
341 * ( atmos_phy_rd_offline_nir_rate ) * flux_rad(ks-1,i,j,
i_sw,
i_dn)
342 sflx_rad_dn(i,j,
i_r_direct ,
i_r_vis) = ( 1.0_rp-atmos_phy_rd_offline_diffuse_rate ) &
343 * ( 1.0_rp-atmos_phy_rd_offline_nir_rate ) * flux_rad(ks-1,i,j,
i_sw,
i_dn)
345 * ( 1.0_rp-atmos_phy_rd_offline_nir_rate ) * flux_rad(ks-1,i,j,
i_sw,
i_dn)
350 if ( error_sum )
then 351 log_error(
"ATMOS_PHY_RD_offline_flux",*)
'Requested data is not found!' module coupler / surface-atmospehre
integer, parameter, public i_r_vis
integer, public io_fid_conf
Config file ID.
integer, parameter, public n_rad_dir
integer, parameter, public n_rad_rgn
subroutine, public atmos_phy_rd_offline_flux(KA, KS, KE, IA, IS, IE, JA, JS, JE, time_now, flux_rad, SFLX_rad_dn)
Radiation main.
integer, parameter, public i_lw
real(rp), public const_undef
integer, parameter, public i_sw
integer, parameter, public i_dn
module atmosphere / physics / radiation / offline
subroutine, public prc_abort
Abort Process.
integer, parameter, public i_r_direct
integer, parameter, public i_r_nir
module atmosphere / physics / radiation / common
integer, parameter, public i_r_ir
integer, parameter, public i_r_diffuse
integer, parameter, public i_up
subroutine, public atmos_phy_rd_offline_setup
Setup.