SCALE-RM
scale_atmos_phy_sf_bulk.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
11 !-------------------------------------------------------------------------------
12 #include "scalelib.h"
14  !-----------------------------------------------------------------------------
15  !
16  !++ used modules
17  !
18  use scale_precision
19  use scale_io
20  use scale_prof
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
28  public :: atmos_phy_sf_bulk_setup
29  public :: atmos_phy_sf_bulk_flux
30 
31  !-----------------------------------------------------------------------------
32  !
33  !++ Public parameters & variables
34  !
35  !-----------------------------------------------------------------------------
36  !
37  !++ Private procedure
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private parameters & variables
42  !
43  real(RP), private :: atmos_phy_sf_bulk_beta = 1.0_rp ! evaporation efficiency (0-1)
44 
45  !-----------------------------------------------------------------------------
46 contains
47  !-----------------------------------------------------------------------------
49  subroutine atmos_phy_sf_bulk_setup
50  use scale_prc, only: &
51  prc_abort
52  implicit none
53 
54  namelist / param_atmos_phy_sf_bulk / &
55  atmos_phy_sf_bulk_beta
56 
57  integer :: ierr
58  !---------------------------------------------------------------------------
59 
60  log_newline
61  log_info("ATMOS_PHY_SF_bulk_setup",*) 'Setup'
62  log_info("ATMOS_PHY_SF_bulk_setup",*) 'Bulk scheme'
63 
64  !--- read namelist
65  rewind(io_fid_conf)
66  read(io_fid_conf,nml=param_atmos_phy_sf_bulk,iostat=ierr)
67  if( ierr < 0 ) then !--- missing
68  log_info("ATMOS_PHY_SF_bulk_setup",*) 'Not found namelist. Default used.'
69  elseif( ierr > 0 ) then !--- fatal error
70  log_error("ATMOS_PHY_SF_bulk_setup",*) 'Not appropriate names in namelist PARAM_ATMOS_PHY_SF_BULK. Check!'
71  call prc_abort
72  endif
73  log_nml(param_atmos_phy_sf_bulk)
74 
75  return
76  end subroutine atmos_phy_sf_bulk_setup
77 
78  !-----------------------------------------------------------------------------
80  subroutine atmos_phy_sf_bulk_flux( &
81  IA, IS, IE, JA, JS, JE, &
82  ATM_W, ATM_U, ATM_V, &
83  ATM_TEMP, ATM_PRES, ATM_QV, &
84  SFC_DENS, SFC_TEMP, SFC_PRES, &
85  SFC_Z0M, SFC_Z0H, SFC_Z0E, &
86  PBL, ATM_Z1, &
87  SFLX_MW, SFLX_MU, SFLX_MV, &
88  SFLX_SH, SFLX_LH, SFLX_QV, &
89  U10, V10, T2, Q2 )
90  use scale_const, only: &
91  cpdry => const_cpdry, &
92  epsvap => const_epsvap
93  use scale_atmos_hydrometeor, only: &
94  hydrometeor_lhv => atmos_hydrometeor_lhv
95  use scale_atmos_saturation, only: &
96  saturation_psat_all => atmos_saturation_psat_all
97  use scale_bulkflux, only: &
98  bulkflux
99  implicit none
100  integer, intent(in) :: IA, IS, IE
101  integer, intent(in) :: JA, JS, JE
102 
103  real(RP), intent(in) :: ATM_W (ia,ja) ! velocity w at the lowermost layer (cell center) [m/s]
104  real(RP), intent(in) :: ATM_U (ia,ja) ! velocity u at the lowermost layer (cell center) [m/s]
105  real(RP), intent(in) :: ATM_V (ia,ja) ! velocity v at the lowermost layer (cell center) [m/s]
106  real(RP), intent(in) :: ATM_TEMP(ia,ja) ! temperature at the lowermost layer (cell center) [K]
107  real(RP), intent(in) :: ATM_PRES(ia,ja) ! pressure at the lowermost layer (cell center) [Pa]
108  real(RP), intent(in) :: ATM_QV (ia,ja) ! qv at the lowermost layer (cell center) [kg/kg]
109  real(RP), intent(in) :: SFC_DENS(ia,ja) ! density at the surface atmosphere [kg/m3]
110  real(RP), intent(in) :: SFC_TEMP(ia,ja) ! temperature at the surface skin [K]
111  real(RP), intent(in) :: SFC_PRES(ia,ja) ! pressure at the surface atmosphere [Pa]
112  real(RP), intent(in) :: SFC_Z0M (ia,ja) ! surface roughness length (momentum) [m]
113  real(RP), intent(in) :: SFC_Z0H (ia,ja) ! surface roughness length (heat) [m]
114  real(RP), intent(in) :: SFC_Z0E (ia,ja) ! surface roughness length (vapor) [m]
115  real(RP), intent(in) :: PBL (ia,ja) ! depth of the PBL [m]
116  real(RP), intent(in) :: ATM_Z1 (ia,ja) ! height of the lowermost grid from surface (cell center) [m]
117 
118  real(RP), intent(out) :: SFLX_MW(ia,ja) ! surface flux for z-momentum (area center) [m/s*kg/m2/s]
119  real(RP), intent(out) :: SFLX_MU(ia,ja) ! surface flux for x-momentum (area center) [m/s*kg/m2/s]
120  real(RP), intent(out) :: SFLX_MV(ia,ja) ! surface flux for y-momentum (area center) [m/s*kg/m2/s]
121  real(RP), intent(out) :: SFLX_SH(ia,ja) ! surface flux for sensible heat (area center) [J/m2/s]
122  real(RP), intent(out) :: SFLX_LH(ia,ja) ! surface flux for latent heat (area center) [J/m2/s]
123  real(RP), intent(out) :: SFLX_QV(ia,ja) ! surface flux for qv (area center) [kg/m2/s]
124  real(RP), intent(out) :: U10 (ia,ja) ! velocity u at 10m height
125  real(RP), intent(out) :: V10 (ia,ja) ! velocity v at 10m height
126  real(RP), intent(out) :: T2 (ia,ja) ! temperature t at 2m height
127  real(RP), intent(out) :: Q2 (ia,ja) ! water vapor q at 2m height
128 
129  real(RP) :: SFC_PSAT (ia,ja) ! saturatad water vapor pressure [Pa]
130  real(RP) :: LHV (ia,ja)
131 
132  real(RP) :: Ustar ! friction velocity [m]
133  real(RP) :: Tstar ! friction temperature [K]
134  real(RP) :: Qstar ! friction mixing rate [kg/kg]
135  real(RP) :: Uabs ! modified absolute velocity [m/s]
136  real(RP) :: Ra ! Aerodynamic resistance (=1/Ce) [1/s]
137  real(RP) :: SFC_QSAT ! saturatad water vapor mixing ratio [kg/kg]
138  real(RP) :: SFC_QV ! water vapor mixing ratio [kg/kg]
139 
140  real(RP) :: FracU10 ! calculation parameter for U10 [-]
141  real(RP) :: FracT2 ! calculation parameter for T2 [-]
142  real(RP) :: FracQ2 ! calculation parameter for Q2 [-]
143 
144  integer :: i, j
145  !---------------------------------------------------------------------------
146 
147  log_progress(*) 'atmosphere / physics / surface flux / bulk'
148 
149  ! ToDo consider ATM_TEMP is appropriate
150  call hydrometeor_lhv( ia, is, ie, ja, js, je, &
151  atm_temp(:,:), & ! [IN]
152  lhv(:,:) ) ! [OUT]
153 
154  call saturation_psat_all( ia, is, ie, ja, js, je, &
155  sfc_temp(:,:), & ! [IN]
156  sfc_psat(:,:) ) ! [OUT]
157 
158 #ifndef __GFORTRAN__
159  !$omp parallel do default(none) &
160  !$omp private(SFC_QSAT,SFC_QV,Ustar,Tstar,Qstar,Uabs,Ra,FracU10,FracT2,FracQ2) &
161  !$omp shared (IS,IE,JS,JE,EPSvap,ATMOS_PHY_SF_BULK_beta,CPdry,LHV,bulkflux, &
162  !$omp ATM_TEMP,ATM_PRES,ATM_QV,ATM_W,ATM_U,ATM_V,ATM_Z1, &
163  !$omp SFC_DENS,SFC_TEMP,SFC_PRES,SFC_PSAT,SFC_Z0M,SFC_Z0H,SFC_Z0E,PBL, &
164  !$omp SFLX_MW,SFLX_MU,SFLX_MV,SFLX_SH,SFLX_LH,SFLX_QV,U10,V10,T2,Q2)
165 #else
166  !$omp parallel do default(shared) &
167  !$omp private(SFC_QSAT,SFC_QV,Ustar,Tstar,Qstar,Uabs,Ra,FracU10,FracT2,FracQ2)
168 #endif
169  do j = js, je
170  do i = is, ie
171  ! qdry = 1 - psat
172  sfc_qsat = epsvap * sfc_psat(i,j) / ( sfc_pres(i,j) - ( 1.0_rp-epsvap ) * sfc_psat(i,j) )
173 
174  sfc_qv = ( 1.0_rp - atmos_phy_sf_bulk_beta ) * atm_qv(i,j) + atmos_phy_sf_bulk_beta * sfc_qsat
175 
176  call bulkflux( ustar, & ! [OUT]
177  tstar, & ! [OUT]
178  qstar, & ! [OUT]
179  uabs, & ! [OUT]
180  ra, & ! [OUT]
181  fracu10, & ! [OUT]
182  fract2, & ! [OUT]
183  fracq2, & ! [OUT]
184  atm_temp(i,j), & ! [IN]
185  sfc_temp(i,j), & ! [IN]
186  atm_pres(i,j), & ! [IN]
187  sfc_pres(i,j), & ! [IN]
188  atm_qv(i,j), & ! [IN]
189  sfc_qv , & ! [IN]
190  atm_u(i,j), & ! [IN]
191  atm_v(i,j), & ! [IN]
192  atm_z1(i,j), & ! [IN]
193  pbl(i,j), & ! [IN]
194  sfc_z0m(i,j), & ! [IN]
195  sfc_z0h(i,j), & ! [IN]
196  sfc_z0e(i,j) ) ! [IN]
197 
198  !-----< momentum >-----
199  sflx_mw(i,j) = -sfc_dens(i,j) * ustar * ustar / uabs * atm_w(i,j)
200  sflx_mu(i,j) = -sfc_dens(i,j) * ustar * ustar / uabs * atm_u(i,j)
201  sflx_mv(i,j) = -sfc_dens(i,j) * ustar * ustar / uabs * atm_v(i,j)
202 
203  !-----< heat flux >-----
204  sflx_sh(i,j) = -sfc_dens(i,j) * ustar * tstar * cpdry
205  sflx_lh(i,j) = -sfc_dens(i,j) * ustar * qstar * lhv(i,j)
206 
207  !-----< mass flux >-----
208  sflx_qv(i,j) = sflx_lh(i,j) / lhv(i,j)
209 
210  !-----< U10, T2, q2 >-----
211  !U10(i,j) = FracU10 * ATM_U(i,j)
212  !V10(i,j) = FracU10 * ATM_V(i,j)
213  !T2 (i,j) = ( 1.0_RP - FracT2 ) * SFC_TEMP(i,j) + FracT2 * ATM_TEMP(i,j)
214  !Q2 (i,j) = ( 1.0_RP - FracQ2 ) * SFC_QV + FracQ2 * ATM_QV (i,j)
215 
216  u10(i,j) = atm_u(i,j) * log( 10.0_rp / sfc_z0m(i,j) ) / log( atm_z1(i,j) / sfc_z0m(i,j) )
217  v10(i,j) = atm_v(i,j) * log( 10.0_rp / sfc_z0m(i,j) ) / log( atm_z1(i,j) / sfc_z0m(i,j) )
218  t2(i,j) = sfc_temp(i,j) + ( atm_temp(i,j) - sfc_temp(i,j) ) &
219  * ( log( 2.0_rp / sfc_z0m(i,j) ) * log( 2.0_rp / sfc_z0h(i,j) ) ) &
220  / ( log( atm_z1(i,j) / sfc_z0m(i,j) ) * log( atm_z1(i,j) / sfc_z0h(i,j) ) )
221  q2(i,j) = sfc_qv + ( atm_qv(i,j) - sfc_qv ) &
222  * ( log( 2.0_rp / sfc_z0m(i,j) ) * log( 2.0_rp / sfc_z0e(i,j) ) ) &
223  / ( log( atm_z1(i,j) / sfc_z0m(i,j) ) * log( atm_z1(i,j) / sfc_z0e(i,j) ) )
224  enddo
225  enddo
226 
227  return
228  end subroutine atmos_phy_sf_bulk_flux
229 
230 end module scale_atmos_phy_sf_bulk
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:56
module atmosphere / saturation
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
subroutine, public atmos_phy_sf_bulk_flux(IA, IS, IE, JA, JS, JE, ATM_W, ATM_U, ATM_V, ATM_TEMP, ATM_PRES, ATM_QV, SFC_DENS, SFC_TEMP, SFC_PRES, SFC_Z0M, SFC_Z0H, SFC_Z0E, PBL, ATM_Z1, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_QV, U10, V10, T2, Q2)
Calculate surface flux.
module atmosphere / hydrometeor
module PROCESS
Definition: scale_prc.F90:11
procedure(bc), pointer, public bulkflux
module atmosphere / physics / surface / bulk
subroutine, public atmos_phy_sf_bulk_setup
Setup.
real(rp), public const_epsvap
Rdry / Rvap.
Definition: scale_const.F90:69
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
module CONSTANT
Definition: scale_const.F90:11
module profiler
Definition: scale_prof.F90:11
module Surface bulk flux
module PRECISION
module STDIO
Definition: scale_io.F90:10