FE-Project
Loading...
Searching...
No Matches
scale_atm_phy_rd_dgm_simple.F90
Go to the documentation of this file.
1!> module FElib / Atmosphere / Physics radiation
2!!
3!! @par Description
4!! A module to provide simplified radiation schemes based on Vallis et al. (2018),
5!! which are a gray radiation scheme and a two-band longwave and one-band shortwave radiation scheme
6!!
7!! @author Yuta Kawai, Team SCALE
8!!
9!! @par Reference
10!! - Vallis, G.K., Colyer, G., Geen, R., Gerber, E., Jucker, M., Maher, P.,
11!! Paterson, A., Pietschnig, M., Penn, J., and Thomson, S.I. 2018:
12!! Isca, v1.0: a framework for the global modelling of the atmospheres of Earth and other planets at varying levels of complexity.
13!! Geosci. Model Dev., 11, 843–859.
14!! - Frierson, D.M.W., Held, I.M., and Zurita-Gotor, P. 2006:
15!! A gray-radiation aquaplanet moist GCM. Part I: Static stability and eddy scale.
16!! J. Atmos. Sci., 63, 2548–2566.
17!! - Byrne, M.P., and O’Gorman, P.A. 2013:
18!! Land–ocean warming contrast over a wide range of climates:
19!! convective quasi-equilibrium theory and idealized simulations.
20!! J. Climate, 26, 4000–4016.
21!! - Geen, R., Czaja, A., and Haigh, J.D. 2016:
22!! The effects of increasing humidity on heat transport by extratropical waves.
23!! Geophys. Res. Lett., 43, 8314–8321.
24!!
25!-------------------------------------------------------------------------------
26#include "scaleFElib.h"
28 !-----------------------------------------------------------------------------
29 !
30 !++ Used modules
31 !
32 use scale_precision
33 use scale_io
34 use scale_prc
35 use scale_prof
36
37 use scale_atmos_phy_rd_common, only: &
38 i_up, i_dn, i_lw, i_sw
39
40 use scale_element_base, only: &
48
49 !-----------------------------------------------------------------------------
50 implicit none
51 private
52 !-----------------------------------------------------------------------------
53 !
54 !++ Public type & procedure
55 !
56
57
58 integer, parameter :: N_LW_BND_MAX = 2
59
60 !> Derived type to represent a simplified radiation scheme based on Vallis et al. (2018)
61 type, public :: atmphyradsimple
62 integer :: optdep_type !< Type of optical depth calculation
63
64 !- Parameters for optical depth calculation with a gray-radiation scheme
65 real(rp) :: optdep_vallis_eq5_params(4) !< Parameters associated with optical depth calculation (Eq.5 in Vallis et al. (2018))
66 !! A, mu, B, C
67
68 !- Parameters for optical depth calculation with a two-band longwave and one-band shortwave radiation scheme
69 real(rp) :: optdep_vallis_eq6a_params(2) !< Parameters associated with optical depth calculation (Eq.6a in Vallis et al. (2018))
70 !! a_SW, c_SW
71 real(rp) :: optdep_vallis_eq7a_params(4) !< Parameters associated with optical depth calculation (Eq.7a in Vallis et al. (2018))
72 !! a_LW, b_LW, c_LW, d_LW
73 real(rp) :: optdep_vallis_eq7b_params(4) !< Parameters associated with optical depth calculation (Eq.7b in Vallis et al. (2018))
74 !! a_win, b_win, c_win, d_win
75 integer :: optdep_vallis_eq6a_kadd !< Number of layers above the model top in the SW optical depth calculation.
76 real(rp) :: optdep_vallis_eq6a_qv_above_mot !< Specific humidity above the model top used in the SW optical depth calculation.
77
78 real(rp) :: difffactor !< Diffusivity factor for the two-stream approximation
79 real(rp) :: frac_lw(n_lw_bnd_max) !< The fraction of the longwave spectrum at each band
80 real(rp) :: pco2 !< CO2 concentration in ppmv
81
82 contains
83 procedure, public :: init => atm_phy_rd_dgm_simple_init
84 procedure, public :: final => atm_phy_rd_dgm_simple_final
85 procedure, public :: calculate_rad_flux => atm_phy_rd_dgm_simple_flux
86 procedure, private :: calc_optical_thick
87 end type atmphyradsimple
88
89 !-----------------------------------------------------------------------------
90 !++ Public parameters & variables
91 !
92 !-----------------------------------------------------------------------------
93 !
94 !++ Private procedure
95 !
96 !-----------------------------------------------------------------------------
97 !
98 !++ Private parameters & variables
99 !
100 integer, parameter :: optdep_type_v2018_gray = 1 !< An idealized radiation scheme based on Eq.5.
101 !! This is gray in infrared so that a single optical thickness is defined for the entire longwave spectrum,
102 !! which includes a parameterization of long-wave absorption by CO2.
103
104 integer, parameter :: optdep_type_v2018_lwbnd2swbnd1 = 2 !< An idealized radiation scheme based on Eqs. 6 and 7.
105 !! This scheme has two infrared bands and one shortwave band, as described in Green et al. (2016),
106 !! which provides an intermediate complexity between gray radiation and more sophisticated radiation schemes.
107 !! All bands were originally parameterized by fitting to data from SBDART for a range of atmospheric profiles.
108 !! Vallis et al. (2018) include the CO2 absorption in each band and changes the functional form of the non-window optical depth.
109 !! The upward flux of shortwave radiation is assumed to be transparent.
110
111contains
112
113 !> Initialize an object to represent a gray-radiation scheme
114!OCL SERIAL
115 subroutine atm_phy_rd_dgm_simple_init( this )
116 implicit none
117 class(atmphyradsimple), intent(inout) :: this
118
119 character(len=H_MID) :: simple_rd_type = 'Gray' !< Type of radiation scheme. 'Gray', 'LWbnd2+SWbnd1'
120 character(len=H_MID) :: v2018_gray_optdepth_params_type = 'V2018' !< How to specify the parameters for optical depth calculation (Eq.5 in Vallis et al. (2018)). 'BO2013', 'V2018', 'USER'
121 real(rp) :: v2018_gray_optdepth_lw_params(4) !< Array of parameters for optical depth calculation with LW radiation (Eq.5 in Vallis et al. (2018)). A, mu, B, C
122
123 character(len=H_MID) :: v2018_lwbnd2swbnd1_optdepth_params_type = 'V2018' !< How to specify the parameters for optical depth calculation (Eq.6 in Vallis et al. (2018)). 'V2018', 'USER'
124 real(rp) :: v2018_lwbnd2swbnd1_optdepth_sw_params(2) !< Array of parameters for optical depth calculation with SW band (< 4 μm) (Eq.6 in Vallis et al. (2018)). a_SW, c_SW
125 real(rp) :: v2018_lwbnd2swbnd1_optdepth_lw_params(4) !< Array of parameters for optical depth calculation with LW no-window band (> 4 μm) (Eq.7a in Vallis et al. (2018)). a_LW, b_LW, c_LW, d_LW
126 real(rp) :: v2018_lwbnd2swbnd1_optdepth_lw_window_params(4) !< Array of parameters for optical depth calculation with LW window band (8-14 μm) (Eq.7b in Vallis et al. (2018)). a_win, b_win, c_win, d_win
127 real(rp) :: v2018_lwbnd2swbnd1_lw_window_frac !< Fraction of for LW window band in the longwave spectrum.
128 integer :: v2018_lwbnd2swbnd1_optdepth_sw_kadd = 4 !< Number of layers above the model top in the SW optical depth calculation.
129 real(rp) :: v2018_lwbnd2swbnd1_optdepth_sw_qv_above_mot = 1e-3_rp !< Optical thickness for shortwave radiation above the model top.
130
131 real(rp) :: diffusivityfactor = 1.0_rp !< Diffusivity factor for the two-stream approximation, which is typically set to 1.66 for a plane-parallel atmosphere with isotropic scattering.
132 !! However, we set it to 1.0 in this idealized radiation scheme, following the formulation in Vallis et al. (2018).
133
134 real(rp) :: pco2 = 360.0_rp !< CO2 concentration in ppmv
135
136 namelist / param_atmos_phy_rd_dgm_simple / &
137 simple_rd_type, &
138 !-
139 v2018_gray_optdepth_params_type, &
140 v2018_gray_optdepth_lw_params, &
141 !-
142 v2018_lwbnd2swbnd1_optdepth_params_type, &
143 v2018_lwbnd2swbnd1_optdepth_sw_params, &
144 v2018_lwbnd2swbnd1_optdepth_lw_params, &
145 v2018_lwbnd2swbnd1_optdepth_lw_window_params, &
146 v2018_lwbnd2swbnd1_lw_window_frac, &
147 v2018_lwbnd2swbnd1_optdepth_sw_kadd, &
148 v2018_lwbnd2swbnd1_optdepth_sw_qv_above_mot, &
149 !-
150 diffusivityfactor, &
151 pco2
152
153 integer :: ierr
154 !--------------------------------------------------------------------
155
156 log_newline
157 log_info("ATMOS_PHY_RD_dgm_simple_setup",*) 'Setup'
158
159 !--- read namelist
160 rewind(io_fid_conf)
161 read(io_fid_conf,nml=param_atmos_phy_rd_dgm_simple,iostat=ierr)
162 if( ierr < 0 ) then !--- missing
163 log_info("ATMOS_PHY_RD_dgm_simple_setup",*) 'Not found namelist. Default used.'
164 elseif( ierr > 0 ) then !--- fatal error
165 log_error("ATMOS_PHY_RD_dgm_simple_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_RD_DGM_SIMPLE. Check!'
166 call prc_abort
167 endif
168 log_nml(param_atmos_phy_rd_dgm_simple)
169
170 select case(trim(simple_rd_type))
171 case('Gray')
172 this%optdep_type = optdep_type_v2018_gray
173 this%FRAC_LW = [ 1.0_rp, 0.0_rp ]
174 case('LWbnd2+SWbnd1')
175 this%optdep_type = optdep_type_v2018_lwbnd2swbnd1
176 case default
177 log_error("ATMOS_PHY_RD_dgm_simple_setup",*) 'SIMPLE_RD_TYPE is invalid. Check!', trim(simple_rd_type)
178 call prc_abort
179 end select
180
181 this%pCO2 = pco2
182 this%diffFactor = diffusivityfactor
183
184 if ( this%optdep_type == optdep_type_v2018_gray ) then
185 select case(trim(v2018_gray_optdepth_params_type))
186 case('BO2013')
187 this%OPTDEP_VALLIS_EQ5_PARAMS = [ 0.8678_rp, 1.0_rp, 1997.9_rp, 0.0_rp ]
188 case('V2018')
189 this%OPTDEP_VALLIS_EQ5_PARAMS = [ 0.1627_rp, 1.0_rp, 1997.9_rp, 0.17_rp ]
190 case('USER')
191 this%OPTDEP_VALLIS_EQ5_PARAMS(:) = v2018_gray_optdepth_lw_params(:)
192 case default
193 log_error("ATMOS_PHY_RD_dgm_simple_setup",*) 'V2018_GRAY_OPTDEPTH_PARAMS_TYPE is invalid. Check!', trim(v2018_gray_optdepth_params_type)
194 call prc_abort
195 end select
196 end if
197
198 if ( this%optdep_type == optdep_type_v2018_lwbnd2swbnd1 ) then
199 select case(trim(v2018_lwbnd2swbnd1_optdepth_params_type))
200 case('V2018')
201 ! Based on Vallis et al. (2018), the default values for these coefficients were fitted to output from Santa Barbara DISORT Atmospheric Radiative Transfer 60 (SBDART).1
202 this%OPTDEP_VALLIS_EQ6a_PARAMS = [ 5.96e-2_rp, 2.9e-3_rp ]
203 this%OPTDEP_VALLIS_EQ7a_PARAMS = [ 0.1_rp, 23.8_rp, 254.0_rp, 0.2023_rp ]
204 this%OPTDEP_VALLIS_EQ7b_PARAMS = [ 0.215_rp, 1.4711e2_rp, 1.0814e4_rp, 0.0954_rp ]
205 this%FRAC_LW = [ 0.6268_rp, 0.3732_rp ]
206 this%OPTDEP_VALLIS_EQ6a_kadd = v2018_lwbnd2swbnd1_optdepth_sw_kadd
207 this%OPTDEP_VALLIS_EQ6a_QV_above_MOT = v2018_lwbnd2swbnd1_optdepth_sw_qv_above_mot
208 case('USER')
209 this%OPTDEP_VALLIS_EQ6a_PARAMS(:) = v2018_lwbnd2swbnd1_optdepth_sw_params(:)
210 this%OPTDEP_VALLIS_EQ7a_PARAMS(:) = v2018_lwbnd2swbnd1_optdepth_lw_params(:)
211 this%OPTDEP_VALLIS_EQ7b_PARAMS(:) = v2018_lwbnd2swbnd1_optdepth_lw_window_params(:)
212 this%FRAC_LW = [ 1.0_rp - v2018_lwbnd2swbnd1_lw_window_frac, v2018_lwbnd2swbnd1_lw_window_frac ]
213 this%OPTDEP_VALLIS_EQ6a_kadd = v2018_lwbnd2swbnd1_optdepth_sw_kadd
214 this%OPTDEP_VALLIS_EQ6a_QV_above_MOT = v2018_lwbnd2swbnd1_optdepth_sw_qv_above_mot
215 case default
216 log_error("ATMOS_PHY_RD_dgm_simple_setup",*) 'V2018_LWbnd2SWbnd1_OPTDEPTH_PARAMS_TYPE is invalid. Check!', trim(v2018_lwbnd2swbnd1_optdepth_params_type)
217 call prc_abort
218 end select
219 end if
220 return
221 end subroutine atm_phy_rd_dgm_simple_init
222
223 !> Finalize an object to represent a gray-radiation scheme
224!OCL SERIAL
225 subroutine atm_phy_rd_dgm_simple_final(this)
226 implicit none
227 class(atmphyradsimple), intent(inout) :: this
228 !--------------------------------------------------------------------
229 return
230 end subroutine atm_phy_rd_dgm_simple_final
231
232 !> Calculate radiative fluxes assuming only absorption and emission of radiation, without scattering.
233 !!
234!OCL SERIAL
235 subroutine atm_phy_rd_dgm_simple_flux( this, &
236 flux, flux_top, sflx_up, sflx_dn, & ! (out)
237 solins, pres, temp, dens, qv, sfc_temp, sfc_alb, & ! (in)
238 lcmesh, elem3d, lcmesh2d, elem2d ) ! (in)
239 use scale_const, only: &
240 pi => const_pi, &
241 stb => const_stb
242 implicit none
243 class(atmphyradsimple), intent(inout) :: this
244 class(localmesh3d), intent(in) :: lcmesh
245 class(elementbase3d), intent(in) :: elem3d
246 class(localmesh2d), intent(in) :: lcmesh2d
247 class(elementbase2d), intent(in) :: elem2d
248 real(rp), intent(out) :: flux(elem3d%nnode_h1d**2,elem3d%nnode_v,lcmesh%ne2d,lcmesh%nez,2,2)
249 real(rp), intent(out) :: flux_top(elem2d%np,lcmesh2d%ne,2,2)
250 real(rp), intent(out) :: sflx_up(elem2d%np,lcmesh2d%ne,2)
251 real(rp), intent(out) :: sflx_dn(elem2d%np,lcmesh2d%ne,2)
252 real(rp), intent(in) :: pres(elem3d%nnode_v,lcmesh%nez,elem3d%nnode_h1d**2,lcmesh%ne2d)
253 real(rp), intent(in) :: temp(elem3d%nnode_v,lcmesh%nez,elem3d%nnode_h1d**2,lcmesh%ne2d)
254 real(rp), intent(in) :: dens(elem3d%nnode_v,lcmesh%nez,elem3d%nnode_h1d**2,lcmesh%ne2d)
255 real(rp), intent(in) :: qv(elem3d%nnode_v,lcmesh%nez,elem3d%nnode_h1d**2,lcmesh%ne2d)
256 real(rp), intent(in) :: solins(elem2d%np,lcmesh2d%nea)
257 real(rp), intent(in) :: sfc_alb(elem2d%np,lcmesh2d%nea)
258 real(rp), intent(in) :: sfc_temp(elem2d%np,lcmesh2d%nea)
259
260 integer :: ke, ke_z, ke_h
261 integer :: p, p_z, p_h
262
263 real(rp) :: dtau_lw(elem3d%nnode_v-1,lcmesh%nez,n_lw_bnd_max)
264 real(rp) :: dtau_sw(elem3d%nnode_v-1,lcmesh%nez)
265 real(rp) :: dtau_sw_kadd !< Optical thickness for shortwave radiation above the model top.
266 ! This is used to calculate the downward shortwave flux at the model top.
267
268 real(rp) :: trans_lw(elem3d%nnode_v-1,lcmesh%nez,n_lw_bnd_max) !< Transmission across the layer
269 real(rp) :: trans_sw(elem3d%nnode_v-1,lcmesh%nez) !< Transmission across the layer
270 real(rp) :: co2(elem3d%nnode_v,lcmesh%nez)
271 real(rp) :: src(elem3d%nnode_v-1,lcmesh%nez) !< Source term across the layer
272 real(rp) :: temp_
273 real(rp) :: d
274
275 real(rp) :: flux_up_lw(elem3d%nnode_v,lcmesh%nez,n_lw_bnd_max)
276 real(rp) :: flux_dn_lw(elem3d%nnode_v,lcmesh%nez,n_lw_bnd_max)
277 real(rp) :: flux_up_lw_tot(elem3d%nnode_v,lcmesh%nez)
278 real(rp) :: flux_dn_lw_tot(elem3d%nnode_v,lcmesh%nez)
279 real(rp) :: flux_up_sw(elem3d%nnode_v,lcmesh%nez)
280 real(rp) :: flux_dn_sw(elem3d%nnode_v,lcmesh%nez)
281
282 integer :: n_lw_bnd
283 integer :: bnd_i
284
285 real(rp) :: r_lw(n_lw_bnd_max) !< Fraction of the longwave spectrum in each band
286 !--------------------------------------------------------------------
287
288 d = this%diffFactor
289 r_lw(:) = this%FRAC_LW(:)
290
291 select case( this%optdep_type )
293 n_lw_bnd = 1
294 case( optdep_type_v2018_lwbnd2swbnd1 )
295 n_lw_bnd = 2
296 end select
297
298 !$omp parallel do collapse(2) &
299 !$omp private( dtau_lw, dtau_sw, dtau_sw_kadd, trans_lw, trans_sw, flux_up_lw, flux_dn_lw, flux_up_sw, flux_dn_sw, &
300 !$omp flux_up_lw_tot, flux_dn_lw_tot, CO2, temp_, Src )
301 do ke_h=1, lcmesh%Ne2D
302 do p_h=1, elem3d%Nnode_h1D**2
303 co2(:,:) = this%pCO2
304 call this%calc_optical_thick( dtau_lw, dtau_sw, dtau_sw_kadd, & ! (out)
305 pres(:,:,p_h,ke_h), qv(:,:,p_h,ke_h), co2(:,:), & ! (in)
306 elem3d%Nnode_v, lcmesh%NeZ ) ! (in)
307
308 trans_lw(:,:,1:n_lw_bnd) = exp(- d * dtau_lw(:,:,1:n_lw_bnd))
309 trans_sw(:,:) = exp(- dtau_sw(:,:))
310
311 !- Calculate the source term for longwave radiation
312 do ke_z=1, lcmesh%NeZ
313 do p_z=1, elem3d%Nnode_v-1
314 temp_ = 0.5_rp * ( temp(p_z,ke_z,p_h,ke_h) + temp(p_z+1,ke_z,p_h,ke_h) )
315 src(p_z,ke_z) = temp_**4 * stb
316 end do
317 end do
318
319 !- Calculate downward radiative fluxes for longwave and shortwave radiation
320
321 flux_dn_lw_tot(:,:) = 0.0_rp
322 do bnd_i =1, n_lw_bnd
323 flux_dn_lw(elem3d%Nnode_v,lcmesh%NeZ,bnd_i) = 0.0_rp
324 do ke_z=lcmesh%NeZ, 1, -1
325 do p_z=elem3d%Nnode_v-1, 1, -1
326 flux_dn_lw(p_z,ke_z,bnd_i) = flux_dn_lw(p_z+1,ke_z,bnd_i) * trans_lw(p_z,ke_z,bnd_i) &
327 + r_lw(bnd_i) * src(p_z,ke_z) * ( 1.0_rp - trans_lw(p_z,ke_z,bnd_i) )
328 end do
329 if ( ke_z > 1 ) then
330 flux_dn_lw(elem3d%Nnode_v,ke_z-1,bnd_i) = flux_dn_lw(1,ke_z,bnd_i)
331 end if
332 end do
333
334 flux_dn_lw_tot(:,:) = flux_dn_lw_tot(:,:) + flux_dn_lw(:,:,bnd_i)
335 end do
336
337 flux_dn_sw(elem3d%Nnode_v,lcmesh%NeZ) = solins(p_h,ke_h) * exp(-dtau_sw_kadd)
338 do ke_z=lcmesh%NeZ, 1, -1
339 do p_z=elem3d%Nnode_v-1, 1, -1
340 flux_dn_sw(p_z,ke_z) = flux_dn_sw(p_z+1,ke_z) * trans_sw(p_z,ke_z)
341 end do
342 if ( ke_z > 1 ) then
343 flux_dn_sw(elem3d%Nnode_v,ke_z-1) = flux_dn_sw(1,ke_z)
344 end if
345 end do
346
347 !- Calculate upward radiative fluxes for longwave and shortwave radiation
348
349 flux_up_lw_tot(:,:) = 0.0_rp
350 do bnd_i =1, n_lw_bnd
351 flux_up_lw(1,1,bnd_i) = r_lw(bnd_i) * sfc_temp(p_h,ke_h)**4 * stb
352 do ke_z=1, lcmesh%NeZ
353 do p_z=1, elem3d%Nnode_v-1
354 flux_up_lw(p_z+1,ke_z,bnd_i) = flux_up_lw(p_z,ke_z,bnd_i) * trans_lw(p_z,ke_z,bnd_i) &
355 + r_lw(bnd_i) * src(p_z,ke_z) * ( 1.0_rp - trans_lw(p_z,ke_z,bnd_i) )
356 end do
357 if ( ke_z < lcmesh%NeZ ) then
358 flux_up_lw(1,ke_z+1,bnd_i) = flux_up_lw(elem3d%Nnode_v,ke_z,bnd_i)
359 end if
360 end do
361
362 flux_up_lw_tot(:,:) = flux_up_lw_tot(:,:) + flux_up_lw(:,:,bnd_i)
363 end do
364
365 ! * Note that the upward flux of shortwave is transparent *
366
367 flux_up_sw(1,1) = sfc_alb(p_h,ke_h) * flux_dn_sw(1,1)
368 do ke_z=1, lcmesh%NeZ
369 do p_z=1, elem3d%Nnode_v-1
370 flux_up_sw(p_z+1,ke_z) = flux_up_sw(p_z,ke_z) ! * trans_sw(p_z,ke_z)
371 end do
372 if ( ke_z < lcmesh%NeZ ) then
373 flux_up_sw(1,ke_z+1) = flux_up_sw(elem3d%Nnode_v,ke_z)
374 end if
375 end do
376
377 !- Store the calculated fluxes into the output arrays
378
379 do ke_z=1, lcmesh%NeZ
380 do p_z=1, elem3d%Nnode_v
381 flux(p_h,p_z,ke_h,ke_z,i_lw,i_up) = flux_up_lw_tot(p_z,ke_z)
382 flux(p_h,p_z,ke_h,ke_z,i_lw,i_dn) = flux_dn_lw_tot(p_z,ke_z)
383
384 flux(p_h,p_z,ke_h,ke_z,i_sw,i_up) = flux_up_sw(p_z,ke_z)
385 flux(p_h,p_z,ke_h,ke_z,i_sw,i_dn) = flux_dn_sw(p_z,ke_z)
386 end do
387 end do
388
389 flux_top(p_h,ke_h,i_lw,i_up) = flux_up_lw_tot(elem3d%Nnode_v,lcmesh%NeZ)
390 flux_top(p_h,ke_h,i_lw,i_dn) = flux_dn_lw_tot(elem3d%Nnode_v,lcmesh%NeZ)
391 flux_top(p_h,ke_h,i_sw,i_up) = flux_up_sw(elem3d%Nnode_v,lcmesh%NeZ)
392 flux_top(p_h,ke_h,i_sw,i_dn) = flux_dn_sw(elem3d%Nnode_v,lcmesh%NeZ)
393 sflx_dn(p_h,ke_h,i_lw) = flux_dn_lw_tot(1,1)
394 sflx_dn(p_h,ke_h,i_sw) = flux_dn_sw(1,1)
395 sflx_up(p_h,ke_h,i_lw) = flux_up_lw_tot(1,1)
396 sflx_up(p_h,ke_h,i_sw) = flux_up_sw(1,1)
397 end do
398 end do
399
400 return
401 end subroutine atm_phy_rd_dgm_simple_flux
402
403!-- private -----
404 !> Calculate optical thickness for longwave and shortwave radiation
405!OCL SERIAL
406 subroutine calc_optical_thick( this, dtau_lw, dtau_sw, dtau_sw_kadd, &
407 pres, qv, CO2, Nnode_v, NeZ )
408 implicit none
409 class(atmphyradsimple), intent(in) :: this
410 integer, intent(in) :: nnode_v
411 integer, intent(in) :: nez
412 real(rp), intent(out) :: dtau_lw(nnode_v-1,nez,n_lw_bnd_max)
413 real(rp), intent(out) :: dtau_sw(nnode_v-1,nez)
414 real(rp), intent(out) :: dtau_sw_kadd !< Optical thickness for shortwave radiation above the model top. This is used to calculate the downward shortwave flux at the model top.
415 real(rp), intent(in) :: pres(nnode_v,nez)
416 real(rp), intent(in) :: qv(nnode_v,nez)
417 real(rp), intent(in) :: co2(nnode_v,nez)
418
419 integer :: ke_z, p_z
420
421 real(rp) :: a, b, c
422
423 real(rp) :: a_sw, b_sw, c_sw
424 real(rp) :: a_lw, b_lw, c_lw, d_lw
425 real(rp) :: a_win, b_win, c_win, d_win
426 real(rp) :: tau_sw_
427
428 real(rp) :: dsig
429
430 real(rp), parameter :: p0 = 1.0e5_rp
431 real(rp) :: qv_tmp
432 real(rp) :: ln_co2ov360ppm
433
434 real(rp) :: dsig_above_mot
435 real(rp) :: dtau_sw_kadd_tmp
436 integer :: k
437 !---------------------------------------------------------
438
439 if ( this%optdep_type == optdep_type_v2018_gray ) then
440 a = this%OPTDEP_VALLIS_EQ5_PARAMS(1) * this%OPTDEP_VALLIS_EQ5_PARAMS(2)
441 b = this%OPTDEP_VALLIS_EQ5_PARAMS(3)
442 c = this%OPTDEP_VALLIS_EQ5_PARAMS(4)
443 dtau_sw_kadd = 0.0_rp
444
445 do ke_z=1, nez
446 do p_z=1, nnode_v-1
447 qv_tmp = 0.5_rp * ( qv(p_z,ke_z) + qv(p_z+1,ke_z) )
448 dsig = max( pres(p_z,ke_z) - pres(p_z+1,ke_z), 0.0_rp ) / p0
449 dtau_lw(p_z,ke_z,1) = ( a + b * qv_tmp + c * log( co2(p_z,ke_z) / 360.0_rp ) ) * dsig
450 dtau_sw(p_z,ke_z) = 0.0_rp * dsig
451 end do
452 end do
453
454 else if ( this%optdep_type == optdep_type_v2018_lwbnd2swbnd1 ) then
455 a_sw = this%OPTDEP_VALLIS_EQ6a_PARAMS(1)
456 c_sw = this%OPTDEP_VALLIS_EQ6a_PARAMS(2)
457
458 a_lw = this%OPTDEP_VALLIS_EQ7a_PARAMS(1)
459 b_lw = this%OPTDEP_VALLIS_EQ7a_PARAMS(2)
460 c_lw = this%OPTDEP_VALLIS_EQ7a_PARAMS(3)
461 d_lw = this%OPTDEP_VALLIS_EQ7a_PARAMS(4)
462
463 a_win = this%OPTDEP_VALLIS_EQ7b_PARAMS(1)
464 b_win = this%OPTDEP_VALLIS_EQ7b_PARAMS(2)
465 c_win = this%OPTDEP_VALLIS_EQ7b_PARAMS(3)
466 d_win = this%OPTDEP_VALLIS_EQ7b_PARAMS(4)
467
468 !- Calculate the optical thickness for shortwave radiation above the model top
469
470 dsig_above_mot = pres(nnode_v,nez) / p0
471 dsig = dsig_above_mot / real(this%OPTDEP_VALLIS_EQ6a_kadd, kind=rp)
472 qv_tmp = this%OPTDEP_VALLIS_EQ6a_QV_above_MOT
473 ln_co2ov360ppm = log( co2(nnode_v,nez) / 360.0_rp )
474
475 tau_sw_ = 0.0_rp
476 do k=1, this%OPTDEP_VALLIS_EQ6a_kadd
477 b_sw = exp( 1.887e-2_rp / ( tau_sw_ + 9.522e-3_rp ) + 1.603_rp / ( tau_sw_ + 5.194e-1_rp )**2 )
478 dtau_sw_kadd_tmp = ( a_sw + b_sw * qv_tmp + c_sw * ln_co2ov360ppm ) * dsig
479 tau_sw_ = tau_sw_ + dtau_sw_kadd_tmp
480 end do
481 dtau_sw_kadd = tau_sw_
482
483 !-
484 do ke_z=nez, 1, -1
485 do p_z=nnode_v-1, 1, -1
486 qv_tmp = 0.5_rp * ( qv(p_z,ke_z) + qv(p_z+1,ke_z) )
487 dsig = max( pres(p_z,ke_z) - pres(p_z+1,ke_z), 0.0_rp ) / p0
488 ln_co2ov360ppm = log( co2(p_z,ke_z) / 360.0_rp )
489
490 b_sw = exp( 1.887e-2_rp / ( tau_sw_ + 9.522e-3_rp ) + 1.603_rp / ( tau_sw_ + 5.194e-1_rp )**2 )
491 dtau_sw(p_z,ke_z) = ( a_sw + b_sw * qv_tmp + c_sw * ln_co2ov360ppm ) * dsig
492 dtau_lw(p_z,ke_z,1) = ( a_lw + b_lw * log( c_lw * qv_tmp + 1.0_rp ) + d_lw * ln_co2ov360ppm ) * dsig
493 dtau_lw(p_z,ke_z,2) = ( a_win + qv_tmp * ( b_win + c_win * qv_tmp ) + d_win * ln_co2ov360ppm ) * dsig
494
495 tau_sw_ = tau_sw_ + dtau_sw(p_z,ke_z)
496 end do
497 end do
498 end if
499
500 return
501 end subroutine calc_optical_thick
502
module FElib / Atmosphere / Physics radiation
integer, parameter optdep_type_v2018_gray
An idealized radiation scheme based on Eq.5. This is gray in infrared so that a single optical thickn...
module FElib / Element / Base
module FElib / Element / hexahedron
module FElib / Mesh / Local 2D
module FElib / Mesh / Local 3D
module FElib / Mesh / Base 3D
module FElib / Data / base
Derived type to represent a simplified radiation scheme based on Vallis et al. (2018)
Derived type representing a 1D reference element.
Derived type representing a 2D reference element.
Derived type representing a 3D reference element.
Derived type representing a hexahedral element.
Derived type representing a local mesh for 2D domain.
Derived type to manage a local 3D computational domain.
Derived type representing a field with 3D local mesh.
Derived type to manage a computational mesh (base type for 3D domain)
Derived type representing a field with 3D mesh.