SCALE-RM
Data Types | Functions/Subroutines | Variables
scale_bulkflux Module Reference

module Surface bulk flux More...

Functions/Subroutines

subroutine, public bulkflux_setup (dx)
 
subroutine bulkflux_diagnose_scales_2d (IA, IS, IE, JA, JS, JE, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_QV, SFC_DENS, SFC_POTV, PBL, Ustar, Tstar, Qstar, Wstar, RLmo, mask)
 
subroutine bulkflux_diagnose_scales_0d (SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_QV, SFC_DENS, SFC_POTV, PBL, Ustar, Tstar, Qstar, Wstar, RLmo)
 
subroutine bulkflux_diagnose_surface_2d (IA, IS, IE, JA, JS, JE, ATM_U, ATM_V, ATM_TEMP, ATM_QV, SFC_TEMP, SFC_QV, ATM_Z1, SFC_Z0M, SFC_Z0H, SFC_Z0E, U10, V10, T2, Q2, mask, FracU10, FracT2, FracQ2)
 
subroutine calc_scales_b91w01 (IL, Uabs, TH1, TH0, TV0, Q1, Q0, PBL, log_Z1ovZ0M, log_Z1ovZ0H, log_Z1ovZ0E, DP_Z1, DP_Z0M, DP_Z0H, DP_Z0E, RzM, RzH, RzE, Wstar, Ustar, Tstar, Qstar, BFLX, FracU10, FracT2, FracQ2)
 
subroutine, public bulkflux_univfunc (KA, KS, KE, Z, IL, phi_m, phi_h)
 

Variables

procedure(bc), pointer, public bulkflux => NULL()
 
character(len=h_short), public bulkflux_type = 'B91W01'
 

Detailed Description

module Surface bulk flux

Description
calculation of surface bulk flux
Author
Team SCALE
NAMELIST
  • PARAM_BULKFLUX
    nametypedefault valuecomment
    BULKFLUX_TYPE character(len=H_SHORT) 'B91W01' ! 'U95', 'B71', 'B91', and 'B91W01'
    BULKFLUX_NK2018 logical .true. > Nishizawa and Kitamura (2018)
    BULKFLUX_ITR_SA_MAX integer 5 maximum iteration number for successive approximation
    BULKFLUX_ITR_NR_MAX integer 10 maximum iteration number for Newton-Raphson method
    BULKFLUX_WSCF real(RP) empirical scaling factor of Wstar (Beljaars 1994)
    BULKFLUX_UABS_MIN real(RP) 1.0E-2_RP minimum of Uabs [m/s]
    BULKFLUX_WSTAR_MIN real(RP) 1.0E-4_RP minimum of W* [m/s]
    BULKFLUX_SURFDIAG_NEUTRAL logical .true. calculate surface diagnoses with neutral condition

History Output
No history output

Function/Subroutine Documentation

◆ bulkflux_setup()

subroutine, public scale_bulkflux::bulkflux_setup ( real(rp), intent(in)  dx)

Definition at line 148 of file scale_bulkflux.F90.

148  use scale_prc, only: &
149  prc_abort
150  implicit none
151  real(RP), intent(in) :: dx
152 
153  namelist / param_bulkflux / &
154  bulkflux_type, &
155  bulkflux_nk2018, &
156  bulkflux_itr_sa_max, &
157  bulkflux_itr_nr_max, &
158  bulkflux_wscf, &
159  bulkflux_uabs_min, &
160  bulkflux_wstar_min, &
161  bulkflux_surfdiag_neutral
162 
163  integer :: ierr
164  !---------------------------------------------------------------------------
165 
166  log_newline
167  log_info("BULKFLUX_setup",*) 'Setup'
168 
169  ! WSCF = 1.2 for dx > 1 km (Beljaars 1994)
170  ! lim_{dx->0} WSCF = 0 for LES (Fig. 6 Kitamura and Ito 2016 BLM)
171  bulkflux_wscf = 1.2_rp * min(dx*1.e-3_rp, 1.0_rp)
172 
173 
174  !--- read namelist
175  rewind(io_fid_conf)
176  read(io_fid_conf,nml=param_bulkflux,iostat=ierr)
177 
178  if( ierr < 0 ) then !--- missing
179  log_info("BULKFLUX_setup",*) 'Not found namelist. Default used.'
180  elseif( ierr > 0 ) then !--- fatal error
181  log_error("BULKFLUX_setup",*) 'Not appropriate names in namelist PARAM_BULKFLUX. Check!'
182  call prc_abort
183  endif
184  log_nml(param_bulkflux)
185 
186  log_newline
187  log_info("BULKFLUX_setup",*) 'Scheme for surface bulk flux : ', trim(bulkflux_type)
188  select case(bulkflux_type)
189  case('U95')
190  log_info_cont(*) '=> Uno et al.(1995)'
191 #ifndef _OPENACC
192  bulkflux => bulkflux_u95
193 #endif
194  case('B71')
195  log_info_cont(*) '=> Businger et al. (1971)'
196  flag_b71 = .true.
197  flag_w01 = .false.
198 #ifndef _OPENACC
199  bulkflux => bulkflux_b91w01
200 #endif
201  case('B91W01')
202  log_info_cont(*) '=> Beljaars and Holtslag (1991) and Wilson (2001)'
203  flag_b71 = .false.
204  flag_w01 = .true.
205 #ifndef _OPENACC
206  bulkflux => bulkflux_b91w01
207 #endif
208  case('B91')
209  log_info_cont(*) '=> Beljaars and Holtslag (1991)'
210  flag_b71 = .false.
211  flag_w01 = .false.
212 #ifndef _OPENACC
213  bulkflux => bulkflux_b91w01
214 #endif
215  case default
216  log_error("BULKFLUX_setup",*) 'Unsupported BULKFLUX_type. STOP'
217  call prc_abort
218  end select
219 
220  !$acc update device(BULKFLUX_NK2018, BULKFLUX_itr_sa_max, BULKFLUX_itr_nr_max)
221  !$acc update device(BULKFLUX_WSCF)
222  !$acc update device(BULKFLUX_Uabs_min, BULKFLUX_Wstar_min)
223  !$acc update device(BULKFLUX_surfdiag_neutral)
224  !$acc update device(flag_B71, flag_W01)
225 
226  return

References bulkflux, bulkflux_type, scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver(), and mod_rm_prep::rm_prep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bulkflux_diagnose_scales_2d()

subroutine scale_bulkflux::bulkflux_diagnose_scales_2d ( integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ia,ja), intent(in)  SFLX_MW,
real(rp), dimension (ia,ja), intent(in)  SFLX_MU,
real(rp), dimension (ia,ja), intent(in)  SFLX_MV,
real(rp), dimension (ia,ja), intent(in)  SFLX_SH,
real(rp), dimension (ia,ja), intent(in)  SFLX_QV,
real(rp), dimension(ia,ja), intent(in)  SFC_DENS,
real(rp), dimension(ia,ja), intent(in)  SFC_POTV,
real(rp), dimension (ia,ja), intent(in)  PBL,
real(rp), dimension(ia,ja), intent(out)  Ustar,
real(rp), dimension(ia,ja), intent(out)  Tstar,
real(rp), dimension(ia,ja), intent(out)  Qstar,
real(rp), dimension(ia,ja), intent(out)  Wstar,
real(rp), dimension (ia,ja), intent(out)  RLmo,
logical, dimension(ia,ja), intent(in), optional  mask 
)

Definition at line 240 of file scale_bulkflux.F90.

240  use scale_const, only: &
241  eps => const_eps, &
242  grav => const_grav, &
243  cpdry => const_cpdry, &
244  karman => const_karman, &
245  epstvap => const_epstvap
246  implicit none
247  integer, intent(in) :: IA, IS, IE
248  integer, intent(in) :: JA, JS, JE
249 
250  real(RP), intent(in) :: SFLX_MW (IA,JA)
251  real(RP), intent(in) :: SFLX_MU (IA,JA)
252  real(RP), intent(in) :: SFLX_MV (IA,JA)
253  real(RP), intent(in) :: SFLX_SH (IA,JA)
254  real(RP), intent(in) :: SFLX_QV (IA,JA)
255  real(RP), intent(in) :: SFC_DENS(IA,JA)
256  real(RP), intent(in) :: SFC_POTV(IA,JA)
257  real(RP), intent(in) :: PBL (IA,JA)
258 
259  real(RP), intent(out) :: Ustar(IA,JA)
260  real(RP), intent(out) :: Tstar(IA,JA)
261  real(RP), intent(out) :: Qstar(IA,JA)
262  real(RP), intent(out) :: Wstar(IA,JA)
263  real(RP), intent(out) :: RLmo (IA,JA)
264 
265  logical, intent(in), optional :: mask(IA,JA)
266 
267  integer :: i, j
268 
269  if ( present(mask) ) then
270  !$omp parallel do
271  !$acc kernels
272  do j = js, je
273  do i = is, ie
274  if ( mask(i,j) ) then
275  call bulkflux_diagnose_scales_0d( sflx_mw(i,j), sflx_mu(i,j), sflx_mv(i,j), & ! (in)
276  sflx_sh(i,j), sflx_qv(i,j), & ! (in)
277  sfc_dens(i,j), sfc_potv(i,j), pbl(i,j), & ! (in)
278  ustar(i,j), tstar(i,j), qstar(i,j), & ! (out)
279  wstar(i,j), rlmo(i,j) ) ! (out)
280  end if
281  end do
282  end do
283  !$acc end kernels
284  else
285  !$omp parallel do
286  !$acc kernels
287  do j = js, je
288  do i = is, ie
289  call bulkflux_diagnose_scales_0d( sflx_mw(i,j), sflx_mu(i,j), sflx_mv(i,j), & ! (in)
290  sflx_sh(i,j), sflx_qv(i,j), & ! (in)
291  sfc_dens(i,j), sfc_potv(i,j), pbl(i,j), & ! (in)
292  ustar(i,j), tstar(i,j), qstar(i,j), & ! (out)
293  wstar(i,j), rlmo(i,j) ) ! (out)
294  end do
295  end do
296  !$acc end kernels
297  end if
298 
299  return

References bulkflux_diagnose_scales_0d(), scale_const::const_cpdry, scale_const::const_eps, scale_const::const_epstvap, scale_const::const_grav, and scale_const::const_karman.

Here is the call graph for this function:

◆ bulkflux_diagnose_scales_0d()

subroutine scale_bulkflux::bulkflux_diagnose_scales_0d ( real(rp), intent(in)  SFLX_MW,
real(rp), intent(in)  SFLX_MU,
real(rp), intent(in)  SFLX_MV,
real(rp), intent(in)  SFLX_SH,
real(rp), intent(in)  SFLX_QV,
real(rp), intent(in)  SFC_DENS,
real(rp), intent(in)  SFC_POTV,
real(rp), intent(in)  PBL,
real(rp), intent(out)  Ustar,
real(rp), intent(out)  Tstar,
real(rp), intent(out)  Qstar,
real(rp), intent(out)  Wstar,
real(rp), intent(out)  RLmo 
)

Definition at line 308 of file scale_bulkflux.F90.

308  !$acc routine seq
309  use scale_const, only: &
310  eps => const_eps, &
311  grav => const_grav, &
312  cpdry => const_cpdry, &
313  karman => const_karman, &
314  epstvap => const_epstvap
315  implicit none
316  real(RP), intent(in) :: SFLX_MW
317  real(RP), intent(in) :: SFLX_MU
318  real(RP), intent(in) :: SFLX_MV
319  real(RP), intent(in) :: SFLX_SH
320  real(RP), intent(in) :: SFLX_QV
321  real(RP), intent(in) :: SFC_DENS
322  real(RP), intent(in) :: SFC_POTV
323  real(RP), intent(in) :: PBL
324 
325  real(RP), intent(out) :: Ustar
326  real(RP), intent(out) :: Tstar
327  real(RP), intent(out) :: Qstar
328  real(RP), intent(out) :: Wstar
329  real(RP), intent(out) :: RLmo
330 
331  real(RP) :: BFLX, tmp, sw
332  logical :: ws_flag
333  integer :: i, j
334 
335  ws_flag = ( bulkflux_type == 'B91W01' )
336 
337  ustar = sqrt( sqrt( sflx_mw**2 + sflx_mu**2 + sflx_mv**2 ) / sfc_dens )
338  sw = 0.5_rp - sign( 0.5_rp, ustar - eps )
339  tstar = - sflx_sh / ( sfc_dens * ustar * cpdry + sw ) * ( 1.0_rp - sw )
340  qstar = - sflx_qv / ( sfc_dens * ustar + sw ) * ( 1.0_rp - sw )
341  bflx = - ustar * tstar - epstvap * ustar * qstar * sfc_potv
342  rlmo = - karman * grav * bflx / ( ustar**3 * sfc_potv + sw ) * ( 1.0_rp - sw )
343  if ( ws_flag ) then
344  tmp = pbl * grav / sfc_potv * bflx
345  sw = 0.5_rp + sign( 0.5_rp, tmp ) ! if tmp is plus, sw = 1
346  wstar = ( tmp * sw )**( 1.0_rp / 3.0_rp )
347  else
348  wstar = 0.0_rp
349  end if
350 
351  return

References bulkflux_type, scale_const::const_cpdry, scale_const::const_eps, scale_const::const_epstvap, scale_const::const_grav, and scale_const::const_karman.

Referenced by bulkflux_diagnose_scales_2d().

Here is the caller graph for this function:

◆ bulkflux_diagnose_surface_2d()

subroutine scale_bulkflux::bulkflux_diagnose_surface_2d ( integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE,
real(rp), dimension (ia,ja), intent(in)  ATM_U,
real(rp), dimension (ia,ja), intent(in)  ATM_V,
real(rp), dimension(ia,ja), intent(in)  ATM_TEMP,
real(rp), dimension (ia,ja), intent(in)  ATM_QV,
real(rp), dimension(ia,ja), intent(in)  SFC_TEMP,
real(rp), dimension (ia,ja), intent(in)  SFC_QV,
real(rp), dimension (ia,ja), intent(in)  ATM_Z1,
real(rp), dimension (ia,ja), intent(in)  SFC_Z0M,
real(rp), dimension (ia,ja), intent(in)  SFC_Z0H,
real(rp), dimension (ia,ja), intent(in)  SFC_Z0E,
real(rp), dimension(ia,ja), intent(out)  U10,
real(rp), dimension(ia,ja), intent(out)  V10,
real(rp), dimension (ia,ja), intent(out)  T2,
real(rp), dimension (ia,ja), intent(out)  Q2,
logical, dimension (ia,ja), intent(in), optional  mask,
real(rp), dimension(ia,ja), intent(in), optional  FracU10,
real(rp), dimension (ia,ja), intent(in), optional  FracT2,
real(rp), dimension (ia,ja), intent(in), optional  FracQ2 
)

Definition at line 367 of file scale_bulkflux.F90.

367  implicit none
368  integer, intent(in) :: IA, IS, IE
369  integer, intent(in) :: JA, JS, JE
370 
371  real(RP), intent(in) :: ATM_U (IA,JA)
372  real(RP), intent(in) :: ATM_V (IA,JA)
373  real(RP), intent(in) :: ATM_TEMP(IA,JA)
374  real(RP), intent(in) :: ATM_QV (IA,JA)
375  real(RP), intent(in) :: SFC_TEMP(IA,JA)
376  real(RP), intent(in) :: SFC_QV (IA,JA)
377  real(RP), intent(in) :: ATM_Z1 (IA,JA)
378  real(RP), intent(in) :: SFC_Z0M (IA,JA)
379  real(RP), intent(in) :: SFC_Z0H (IA,JA)
380  real(RP), intent(in) :: SFC_Z0E (IA,JA)
381 
382  real(RP), intent(out) :: U10(IA,JA)
383  real(RP), intent(out) :: V10(IA,JA)
384  real(RP), intent(out) :: T2 (IA,JA)
385  real(RP), intent(out) :: Q2 (IA,JA)
386 
387  logical, intent(in), optional :: mask (IA,JA)
388  real(RP), intent(in), optional :: FracU10(IA,JA)
389  real(RP), intent(in), optional :: FracT2 (IA,JA)
390  real(RP), intent(in), optional :: FracQ2 (IA,JA)
391 
392  integer :: i, j
393 
394  if ( present(fracu10) ) then
395  if ( present(mask) ) then
396  !$omp parallel do
397  !$acc kernels
398  do j = js, je
399  do i = is, ie
400  if ( mask(i,j) ) then
401  call bulkflux_diagnose_surface_0d( atm_u(i,j), atm_v(i,j), &
402  atm_temp(i,j), atm_qv(i,j), &
403  sfc_temp(i,j), sfc_qv(i,j), &
404  atm_z1(i,j), &
405  sfc_z0m(i,j), sfc_z0h(i,j), sfc_z0e(i,j), &
406  u10(i,j), v10(i,j), t2(i,j), q2(i,j), &
407  fracu10(i,j), fract2(i,j), fracq2(i,j) )
408  end if
409  end do
410  end do
411  !$acc end kernels
412 
413  else
414  !$omp parallel do
415  !$acc kernels
416  do j = js, je
417  do i = is, ie
418  call bulkflux_diagnose_surface_0d( atm_u(i,j), atm_v(i,j), &
419  atm_temp(i,j), atm_qv(i,j), &
420  sfc_temp(i,j), sfc_qv(i,j), &
421  atm_z1(i,j), &
422  sfc_z0m(i,j), sfc_z0h(i,j), sfc_z0e(i,j), &
423  u10(i,j), v10(i,j), t2(i,j), q2(i,j), &
424  fracu10(i,j), fract2(i,j), fracq2(i,j) )
425  end do
426  end do
427  !$acc end kernels
428  end if
429  else
430  if ( present(mask) ) then
431  !$omp parallel do
432  !$acc kernels
433  do j = js, je
434  do i = is, ie
435  if ( mask(i,j) ) then
436  call bulkflux_diagnose_surface_0d( atm_u(i,j), atm_v(i,j), &
437  atm_temp(i,j), atm_qv(i,j), &
438  sfc_temp(i,j), sfc_qv(i,j), &
439  atm_z1(i,j), &
440  sfc_z0m(i,j), sfc_z0h(i,j), sfc_z0e(i,j), &
441  u10(i,j), v10(i,j), t2(i,j), q2(i,j) )
442  end if
443  end do
444  end do
445  !$acc end kernels
446 
447  else
448  !$omp parallel do
449  !$acc kernels
450  do j = js, je
451  do i = is, ie
452  call bulkflux_diagnose_surface_0d( atm_u(i,j), atm_v(i,j), &
453  atm_temp(i,j), atm_qv(i,j), &
454  sfc_temp(i,j), sfc_qv(i,j), &
455  atm_z1(i,j), &
456  sfc_z0m(i,j), sfc_z0h(i,j), sfc_z0e(i,j), &
457  u10(i,j), v10(i,j), t2(i,j), q2(i,j) )
458  end do
459  end do
460  !$acc end kernels
461  end if
462  end if
463 
464  return

References bulkflux_type, calc_scales_b91w01(), scale_const::const_cpdry, scale_const::const_cpvap, scale_const::const_epstvap, scale_const::const_grav, scale_const::const_karman, scale_const::const_pre00, scale_const::const_rdry, and scale_const::const_rvap.

Here is the call graph for this function:

◆ calc_scales_b91w01()

subroutine scale_bulkflux::calc_scales_b91w01 ( real(dp), intent(in)  IL,
real(dp), intent(in)  Uabs,
real(dp), intent(in)  TH1,
real(dp), intent(in)  TH0,
real(dp), intent(in)  TV0,
real(rp), intent(in)  Q1,
real(rp), intent(in)  Q0,
real(rp), intent(in)  PBL,
real(dp), intent(in)  log_Z1ovZ0M,
real(dp), intent(in)  log_Z1ovZ0H,
real(dp), intent(in)  log_Z1ovZ0E,
real(dp), intent(in)  DP_Z1,
real(dp), intent(in)  DP_Z0M,
real(dp), intent(in)  DP_Z0H,
real(dp), intent(in)  DP_Z0E,
real(dp), intent(in)  RzM,
real(dp), intent(in)  RzH,
real(dp), intent(in)  RzE,
real(dp), intent(inout)  Wstar,
real(dp), intent(out)  Ustar,
real(dp), intent(out)  Tstar,
real(dp), intent(out)  Qstar,
real(dp), intent(out)  BFLX,
real(rp), intent(out), optional  FracU10,
real(rp), intent(out), optional  FracT2,
real(rp), intent(out), optional  FracQ2 
)

Definition at line 989 of file scale_bulkflux.F90.

989  !$acc routine seq
990  use scale_const, only: &
991  grav => const_grav, &
992  karman => const_karman, &
993  epstvap => const_epstvap
994  implicit none
995  real(DP), intent(in) :: IL
996  real(DP), intent(in) :: Uabs
997  real(DP), intent(in) :: TH1
998  real(DP), intent(in) :: TH0
999  real(DP), intent(in) :: TV0
1000  real(RP), intent(in) :: Q1
1001  real(RP), intent(in) :: Q0
1002  real(RP), intent(in) :: PBL
1003  real(DP), intent(in) :: log_Z1ovZ0M
1004  real(DP), intent(in) :: log_Z1ovZ0H
1005  real(DP), intent(in) :: log_Z1ovZ0E
1006  real(DP), intent(in) :: DP_Z1
1007  real(DP), intent(in) :: DP_Z0M
1008  real(DP), intent(in) :: DP_Z0H
1009  real(DP), intent(in) :: DP_Z0E
1010  real(DP), intent(in) :: RzM
1011  real(DP), intent(in) :: RzH
1012  real(DP), intent(in) :: RzE
1013 
1014  real(DP), intent(inout) :: Wstar
1015 
1016  real(DP), intent(out) :: Ustar
1017  real(DP), intent(out) :: Tstar
1018  real(DP), intent(out) :: Qstar
1019  real(DP), intent(out) :: BFLX
1020 
1021  real(RP), intent(out), optional :: FracU10
1022  real(RP), intent(out), optional :: FracT2
1023  real(RP), intent(out), optional :: FracQ2
1024 
1025  real(DP) :: denoM, denoH, denoE
1026 
1027  real(DP) :: tmp, sw
1028 
1029  if ( il < 0.0_dp ) then ! unstable condition
1030 
1031  if ( bulkflux_nk2018 ) then
1032  denom = log_z1ovz0m &
1033  - fmm_unstable(dp_z1,il) + fmm_unstable(dp_z0m,il) * dp_z0m / dp_z1 &
1034  + rzm * ( fm_unstable(dp_z0m,il) - 1.0_dp )
1035  tmp = fhm_unstable(dp_z1,il)
1036  denoh = log_z1ovz0h &
1037  - tmp + fhm_unstable(dp_z0h,il) * dp_z0h / dp_z1 &
1038  + rzh * ( fh_unstable(dp_z0h,il) - 1.0_dp )
1039  denoe = log_z1ovz0e &
1040  - tmp + fhm_unstable(dp_z0e,il) * dp_z0e / dp_z1 &
1041  + rze * ( fh_unstable(dp_z0e,il) - 1.0_dp )
1042  else
1043  denom = log_z1ovz0m - fm_unstable(dp_z1,il) + fm_unstable(dp_z0m,il)
1044  tmp = fh_unstable(dp_z1,il)
1045  denoh = log_z1ovz0h - tmp + fh_unstable(dp_z0h,il)
1046  denoe = log_z1ovz0e - tmp + fh_unstable(dp_z0e,il)
1047  end if
1048  ustar = karman / denom * sqrt( uabs**2 + (bulkflux_wscf*wstar)**2 )
1049  tstar = karman / denoh * ( th1 - th0 )
1050  qstar = karman / denoe * ( q1 - q0 )
1051  if ( present(fracu10) ) then
1052  fracu10 = ( log(10.0_dp/dp_z0m) - fm_unstable(10.0_dp,il) + fm_unstable(dp_z0m,il) ) / denom
1053  tmp = fm_unstable(2.0_dp,il)
1054  fract2 = ( log(2.0_dp/dp_z0h) - tmp + fh_unstable(dp_z0h,il) ) / denoh
1055  fracq2 = ( log(2.0_dp/dp_z0e) - tmp + fh_unstable(dp_z0e,il) ) / denoe
1056  end if
1057 
1058  else ! stable condition
1059 
1060  if ( bulkflux_nk2018 ) then
1061  denom = log_z1ovz0m &
1062  - fmm_stable(dp_z1,il) + fmm_stable(dp_z0m,il) * dp_z0m / dp_z1 &
1063  + rzm * ( fm_stable(dp_z0m,il) - 1.0_dp )
1064  tmp = fhm_stable(dp_z1,il)
1065  denoh = log_z1ovz0h &
1066  - tmp + fhm_stable(dp_z0h,il) * dp_z0h / dp_z1 &
1067  + rzh * ( fh_stable(dp_z0h,il) - 1.0_dp )
1068  denoe = log_z1ovz0e &
1069  - tmp + fhm_stable(dp_z0e,il) * dp_z0e / dp_z1 &
1070  + rze * ( fh_stable(dp_z0e,il) - 1.0_dp )
1071  else
1072  denom = log_z1ovz0m - fm_stable(dp_z1,il) + fm_stable(dp_z0m,il)
1073  tmp = fh_stable(dp_z1,il)
1074  denoh = log_z1ovz0h - tmp + fh_stable(dp_z0h,il)
1075  denoe = log_z1ovz0e - tmp + fh_stable(dp_z0e,il)
1076  end if
1077  ustar = karman / denom * uabs
1078  tstar = karman / denoh * ( th1 - th0 )
1079  qstar = karman / denoe * ( q1 - q0 )
1080  if ( present(fracu10) ) then
1081  fracu10 = ( log(10.0_dp/dp_z0m) - fm_stable(10.0_dp,il) + fm_stable(dp_z0m,il) ) / denom
1082  tmp = fh_stable(2.0_dp,il)
1083  fract2 = ( log(2.0_dp/dp_z0h) - tmp + fh_stable(dp_z0h,il) ) / denoh
1084  fracq2 = ( log(2.0_dp/dp_z0e) - tmp + fh_stable(dp_z0e,il) ) / denoe
1085  end if
1086 
1087  end if
1088 
1089  ! estimate buoyancy flux
1090  bflx = - ustar * tstar - epstvap * ustar * qstar * tv0
1091 
1092  ! update free convection velocity scale
1093  tmp = pbl * grav / tv0 * bflx
1094  sw = 0.5_dp + sign( 0.5_dp, tmp ) ! if tmp is plus, sw = 1
1095  wstar = ( tmp * sw )**( 1.0_dp / 3.0_dp )
1096 
1097  ! avoid zero division with UstarC = 0
1098  ustar = sign( max( abs(ustar), eps ), ustar )
1099 
1100  return

References scale_const::const_epstvap, scale_const::const_grav, and scale_const::const_karman.

Referenced by bulkflux_diagnose_surface_2d().

Here is the caller graph for this function:

◆ bulkflux_univfunc()

subroutine, public scale_bulkflux::bulkflux_univfunc ( integer  KA,
integer  KS,
integer  KE,
real(rp), dimension(ka), intent(in)  Z,
real(rp), intent(in)  IL,
real(rp), dimension(ka), intent(out)  phi_m,
real(rp), dimension(ka), intent(out)  phi_h 
)

Definition at line 1108 of file scale_bulkflux.F90.

1108  !$acc routine vector
1109  implicit none
1110  integer :: KA, KS, KE
1111  real(RP), intent(in) :: Z(KA)
1112  real(RP), intent(in) :: IL
1113  real(RP), intent(out) :: phi_m(KA)
1114  real(RP), intent(out) :: phi_h(KA)
1115  integer :: k
1116  real(DP) :: z_DP, IL_DP
1117 
1118  il_dp = il
1119 
1120  if ( il > 0.0_rp ) then
1121  do k = ks, ke
1122  z_dp = z(k)
1123  phi_m(k) = pm_stable( z_dp, il_dp )
1124  phi_h(k) = ph_stable( z_dp, il_dp )
1125  end do
1126  else
1127  do k = ks, ke
1128  z_dp = z(k)
1129  phi_m(k) = pm_unstable( z_dp, il_dp )
1130  phi_h(k) = ph_unstable( z_dp, il_dp )
1131  end do
1132  end if
1133 
1134  return

References scale_const::const_pi.

Variable Documentation

◆ bulkflux

procedure(bc), pointer, public scale_bulkflux::bulkflux => NULL()

◆ bulkflux_type

character(len=h_short), public scale_bulkflux::bulkflux_type = 'B91W01'
scale_const::const_grav
real(rp), public const_grav
standard acceleration of gravity [m/s2]
Definition: scale_const.F90:49
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_const::const_epstvap
real(rp), public const_epstvap
1 / epsilon - 1
Definition: scale_const.F90:76
scale_const::const_eps
real(rp), public const_eps
small number
Definition: scale_const.F90:35
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_const::const_cpdry
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:60
scale_const::const_karman
real(rp), parameter, public const_karman
von Karman constant
Definition: scale_const.F90:54
scale_bulkflux::bulkflux
procedure(bc), pointer, public bulkflux
Definition: scale_bulkflux.F90:84