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

module Surface bulk flux More...

Functions/Subroutines

subroutine, public bulkflux_setup (dx)
 
real(dp) function fmm_unstable (Z, IL)
 

Variables

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

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', 'B94', and 'B91W01'
    BULKFLUX_USE_MEAN logical .true.
    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_ERR_MIN real(RP) 1.0E-3_RP minimum value of error
    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]

History Output
No history output

Function/Subroutine Documentation

◆ bulkflux_setup()

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

Definition at line 125 of file scale_bulkflux.F90.

References bulkflux, scale_const::const_cpdry, scale_const::const_eps, scale_const::const_epstvap, scale_const::const_grav, scale_const::const_karman, scale_const::const_pi, scale_const::const_pre00, scale_const::const_rdry, fmm_unstable(), scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_rm_driver::rm_driver().

125  use scale_prc, only: &
126  prc_abort
127  implicit none
128  real(RP), intent(in) :: dx
129 
130  namelist / param_bulkflux / &
131  bulkflux_type, &
132  bulkflux_use_mean, &
133  bulkflux_itr_sa_max, &
134  bulkflux_itr_nr_max, &
135  bulkflux_err_min, &
136  bulkflux_wscf, &
137  bulkflux_uabs_min, &
138  bulkflux_wstar_min
139 
140  integer :: ierr
141  !---------------------------------------------------------------------------
142 
143  log_newline
144  log_info("BULKFLUX_setup",*) 'Setup'
145 
146  ! WSCF = 1.2 for dx > 1 km (Beljaars 1994)
147  ! lim_{dx->0} WSCF = 0 for LES (Fig. 6 Kitamura and Ito 2016 BLM)
148  bulkflux_wscf = 1.2_rp * min(dx*1.e-3_rp, 1.0_rp)
149 
150 
151  !--- read namelist
152  rewind(io_fid_conf)
153  read(io_fid_conf,nml=param_bulkflux,iostat=ierr)
154 
155  if( ierr < 0 ) then !--- missing
156  log_info("BULKFLUX_setup",*) 'Not found namelist. Default used.'
157  elseif( ierr > 0 ) then !--- fatal error
158  log_error("BULKFLUX_setup",*) 'Not appropriate names in namelist PARAM_BULKFLUX. Check!'
159  call prc_abort
160  endif
161  log_nml(param_bulkflux)
162 
163  log_newline
164  log_info("BULKFLUX_setup",*) 'Scheme for surface bulk flux : ', trim(bulkflux_type)
165  select case(bulkflux_type)
166  case('U95')
167  log_info_cont(*) '=> Uno et al.(1995)'
168  bulkflux => bulkflux_u95
169  case('B91W01')
170  log_info_cont(*) '=> Beljaars (1991) and Wilson (2001)'
171  flag_w01 = .true.
172  bulkflux => bulkflux_b91w01
173  case('B94')
174  log_info_cont(*) '=> Beljaars (1994)'
175  flag_w01 = .false.
176  bulkflux => bulkflux_b91w01
177  case default
178  log_error("BULKFLUX_setup",*) 'Unsupported BULKFLUX_type. STOP'
179  call prc_abort
180  end select
181 
182  return
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
module PROCESS
Definition: scale_prc.F90:11
procedure(bc), pointer, public bulkflux
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fmm_unstable()

real(dp) function scale_bulkflux::fmm_unstable ( real(dp), intent(in)  Z,
real(dp), intent(in)  IL 
)

Definition at line 931 of file scale_bulkflux.F90.

References scale_const::const_eps, and scale_const::const_pi.

Referenced by bulkflux_setup().

931  use scale_const, only: &
932  pi => const_pi, &
933  eps => const_eps
934  implicit none
935 
936  ! argument
937  real(DP), intent(in) :: z
938  real(DP), intent(in) :: il
939 
940  ! function
941  real(DP) :: fmm_unstable
942 
943  ! Wilson (2001)
944  real(DP), parameter :: gamma = 3.6_dp
945 
946  ! works
947  real(DP) :: r
948  real(DP) :: f, r3
949  real(DP) :: r4r, r2r
950  !---------------------------------------------------------------------------
951 
952  r = min( z * il, 0.0_dp )
953 
954  if ( flag_w01 ) then
955  ! Wilson (2001)
956  r3 = (-r)**(1.0_dp/3.0_dp)
957  if ( r > -eps ) then
958  fmm_unstable = 9.0_dp / 20.0_dp * gamma * r3**2
959  else
960  f = sqrt( 1.0_dp + gamma * r3**2 )
961  fmm_unstable = 3.0_dp * log( ( 1.0_dp + f ) * 0.5_dp ) &
962  + 1.5_dp / ( sqrt(gamma)**3 * r) * asinh( sqrt(gamma) * r3 ) &
963  + 1.5_dp * f / ( gamma * r3**2 ) &
964  - 1.0_dp
965  end if
966  else
967  ! Beljaars and Holtslag (1994), originally Paulson (1974) and Dyer (1974)
968  if ( r > -eps ) then ! |R|<EPS, now R < 0
969  fmm_unstable = - 2.0_dp * r
970  else
971  r2r = sqrt( 1.0_dp - 16.0_dp * r )
972  r4r = sqrt( r2r )
973  fmm_unstable = log( ( 1.0_dp + r4r )**2 * ( 1.0_dp + r2r ) * 0.125_dp ) &
974  - 2.0_dp * atan( r4r ) &
975  + ( 1.0_dp - r4r*r2r ) / ( 12.0_dp * r ) &
976  + pi * 0.5_dp - 1.0_dp
977  end if
978  end if
979 
980  return
module CONSTANT
Definition: scale_const.F90:11
real(rp), public const_eps
small number
Definition: scale_const.F90:33
real(rp), public const_pi
pi
Definition: scale_const.F90:31
Here is the caller graph for this function:

Variable Documentation

◆ bulkflux

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