SCALE-RM
scale_land_sfc_thick-slab.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
12  !-----------------------------------------------------------------------------
13  !
14  !++ used modules
15  !
16  use scale_precision
17  use scale_stdio
19  !-----------------------------------------------------------------------------
20  implicit none
21  private
22  !-----------------------------------------------------------------------------
23  !
24  !++ Public procedure
25  !
27  public :: land_sfc_thick_slab
28 
29  !-----------------------------------------------------------------------------
30  !
31  !++ Public parameters & variables
32  !
33  !-----------------------------------------------------------------------------
34  !
35  !++ Private procedure
36  !
37  !-----------------------------------------------------------------------------
38  !
39  !++ Private parameters & variables
40  !
41  !-----------------------------------------------------------------------------
42 contains
43  !-----------------------------------------------------------------------------
45  subroutine land_sfc_thick_slab_setup( LAND_TYPE )
46  use scale_process, only: &
48  implicit none
49 
50  character(len=*), intent(in) :: land_type
51 
52  logical :: dummy
53 
54  namelist / param_land_sfc_thick_slab / &
55  dummy
56 
57  integer :: ierr
58  !---------------------------------------------------------------------------
59 
60  if( io_l ) write(io_fid_log,*)
61  if( io_l ) write(io_fid_log,*) '++++++ Module[THICK-SLAB] / Categ[LAND SFC] / Origin[SCALElib]'
62 
63  !--- read namelist
64  rewind(io_fid_conf)
65  read(io_fid_conf,nml=param_land_sfc_thick_slab,iostat=ierr)
66  if( ierr < 0 ) then !--- missing
67  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
68  elseif( ierr > 0 ) then !--- fatal error
69  write(*,*) 'xxx Not appropriate names in namelist PARAM_LAND_SFC_THICK_SLAB. Check!'
70  call prc_mpistop
71  endif
72  if( io_nml ) write(io_fid_nml,nml=param_land_sfc_thick_slab)
73 
74  return
75  end subroutine land_sfc_thick_slab_setup
76 
77  !-----------------------------------------------------------------------------
78  subroutine land_sfc_thick_slab( &
79  LST_t, &
80  ZMFLX, &
81  XMFLX, &
82  YMFLX, &
83  SHFLX, &
84  LHFLX, &
85  GHFLX, &
86  U10, &
87  V10, &
88  T2, &
89  Q2, &
90  TMPA, &
91  PRSA, &
92  WA, &
93  UA, &
94  VA, &
95  RHOA, &
96  QVA, &
97  Z1, &
98  PBL, &
99  PRSS, &
100  LWD, &
101  SWD, &
102  TG, &
103  LST, &
104  QVEF, &
105  ALB_LW, &
106  ALB_SW, &
107  DZG, &
108  TCS, &
109  Z0M, &
110  Z0H, &
111  Z0E, &
112  dt )
113  use scale_process, only: &
115  use scale_const, only: &
116  pre00 => const_pre00, &
117  rdry => const_rdry, &
118  cpdry => const_cpdry, &
119  stb => const_stb
120  use scale_landuse, only: &
122  use scale_atmos_hydrometeor, only: &
123  hydrometeor_lhv => atmos_hydrometeor_lhv
124  use scale_atmos_saturation, only: &
125  qsat => atmos_saturation_pres2qsat_all
126  use scale_bulkflux, only: &
127  bulkflux
128  implicit none
129 
130  ! arguments
131  real(RP), intent(out) :: lst_t(ia,ja) ! tendency of LST
132  real(RP), intent(out) :: zmflx(ia,ja) ! z-momentum flux at the surface [kg/m/s2]
133  real(RP), intent(out) :: xmflx(ia,ja) ! x-momentum flux at the surface [kg/m/s2]
134  real(RP), intent(out) :: ymflx(ia,ja) ! y-momentum flux at the surface [kg/m/s2]
135  real(RP), intent(out) :: shflx(ia,ja) ! sensible heat flux at the surface [J/m2/s]
136  real(RP), intent(out) :: lhflx(ia,ja) ! latent heat flux at the surface [J/m2/s]
137  real(RP), intent(out) :: ghflx(ia,ja) ! ground heat flux at the surface [J/m2/s]
138  real(RP), intent(out) :: u10 (ia,ja) ! velocity u at 10m [m/s]
139  real(RP), intent(out) :: v10 (ia,ja) ! velocity v at 10m [m/s]
140  real(RP), intent(out) :: t2 (ia,ja) ! temperature at 2m [K]
141  real(RP), intent(out) :: q2 (ia,ja) ! water vapor at 2m [kg/kg]
142 
143  real(RP), intent(in) :: tmpa(ia,ja) ! temperature at the lowest atmospheric layer [K]
144  real(RP), intent(in) :: prsa(ia,ja) ! pressure at the lowest atmospheric layer [Pa]
145  real(RP), intent(in) :: wa (ia,ja) ! velocity w at the lowest atmospheric layer [m/s]
146  real(RP), intent(in) :: ua (ia,ja) ! velocity u at the lowest atmospheric layer [m/s]
147  real(RP), intent(in) :: va (ia,ja) ! velocity v at the lowest atmospheric layer [m/s]
148  real(RP), intent(in) :: rhoa(ia,ja) ! density at the lowest atmospheric layer [kg/m3]
149  real(RP), intent(in) :: qva (ia,ja) ! ratio of water vapor mass to total mass at the lowest atmospheric layer [kg/kg]
150  real(RP), intent(in) :: z1 (ia,ja) ! cell center height at the lowest atmospheric layer [m]
151  real(RP), intent(in) :: pbl (ia,ja) ! the top of atmospheric mixing layer [m]
152  real(RP), intent(in) :: prss(ia,ja) ! pressure at the surface [Pa]
153  real(RP), intent(in) :: lwd (ia,ja) ! downward long-wave radiation flux at the surface [J/m2/s]
154  real(RP), intent(in) :: swd (ia,ja) ! downward short-wave radiation flux at the surface [J/m2/s]
155 
156  real(RP), intent(in) :: tg (ia,ja) ! soil temperature [K]
157  real(RP), intent(in) :: lst (ia,ja) ! land surface temperature [K]
158  real(RP), intent(in) :: qvef (ia,ja) ! efficiency of evaporation (0-1)
159  real(RP), intent(in) :: alb_lw(ia,ja) ! surface albedo for LW (0-1)
160  real(RP), intent(in) :: alb_sw(ia,ja) ! surface albedo for SW (0-1)
161  real(RP), intent(in) :: dzg (ia,ja) ! soil depth [m]
162  real(RP), intent(in) :: tcs (ia,ja) ! thermal conductivity for soil [J/m/K/s]
163  real(RP), intent(in) :: z0m (ia,ja) ! roughness length for momemtum [m]
164  real(RP), intent(in) :: z0h (ia,ja) ! roughness length for heat [m]
165  real(RP), intent(in) :: z0e (ia,ja) ! roughness length for vapor [m]
166  real(DP), intent(in) :: dt ! delta time
167 
168  ! works
169  real(RP) :: lst1(ia,ja)
170 
171  real(RP) :: res ! residual
172 
173  real(RP) :: ustar ! friction velocity [m]
174  real(RP) :: tstar ! friction potential temperature [K]
175  real(RP) :: qstar ! friction water vapor mass ratio [kg/kg]
176  real(RP) :: uabs ! modified absolute velocity [m/s]
177  real(RP) :: qvsat ! saturation water vapor mixing ratio at surface [kg/kg]
178  real(RP) :: qvs ! water vapor mixing ratio at surface [kg/kg]
179 
180  real(RP) :: fracu10 ! calculation parameter for U10 [-]
181  real(RP) :: fract2 ! calculation parameter for T2 [-]
182  real(RP) :: fracq2 ! calculation parameter for Q2 [-]
183 
184  real(RP) :: lhv(ia,ja) ! latent heat of vaporization [J/kg]
185 
186  integer :: i, j
187  !---------------------------------------------------------------------------
188 
189  if( io_l ) write(io_fid_log,*) '*** Land surface step: Thick-Slab'
190 
191  call hydrometeor_lhv( lhv(:,:), tmpa(:,:) )
192 
193  ! update surface temperature
194  do j = js, je
195  do i = is, ie
196  lst1(i,j) = tg(i,j)
197  lst_t(i,j) = ( lst1(i,j) - lst(i,j) ) / dt
198  end do
199  end do
200 
201  ! calculate surface flux
202  do j = js, je
203  do i = is, ie
204 
205  if( landuse_fact_land(i,j) > 0.0_rp ) then
206 
207  call qsat( qvsat, & ! [OUT]
208  lst1(i,j), & ! [IN]
209  prss(i,j) ) ! [IN]
210 
211  qvs = ( 1.0_rp - qvef(i,j) ) * qva(i,j) + qvef(i,j) * qvsat
212 
213  call bulkflux( &
214  ustar, & ! [OUT]
215  tstar, & ! [OUT]
216  qstar, & ! [OUT]
217  uabs, & ! [OUT]
218  fracu10, & ! [OUT]
219  fract2, & ! [OUT]
220  fracq2, & ! [OUT]
221  tmpa(i,j), & ! [IN]
222  lst1(i,j), & ! [IN]
223  prsa(i,j), & ! [IN]
224  prss(i,j), & ! [IN]
225  qva(i,j), & ! [IN]
226  qvs, & ! [IN]
227  ua(i,j), & ! [IN]
228  va(i,j), & ! [IN]
229  z1(i,j), & ! [IN]
230  pbl(i,j), & ! [IN]
231  z0m(i,j), & ! [IN]
232  z0h(i,j), & ! [IN]
233  z0e(i,j) ) ! [IN]
234 
235  zmflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * wa(i,j)
236  xmflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * ua(i,j)
237  ymflx(i,j) = -rhoa(i,j) * ustar**2 / uabs * va(i,j)
238 
239  shflx(i,j) = - rhoa(i,j) * ustar * tstar &
240  * cpdry * ( prss(i,j) / pre00 )**( rdry/cpdry )
241  lhflx(i,j) = - rhoa(i,j) * ustar * qstar * lhv(i,j)
242 
243  ghflx(i,j) = -2.0_rp * tcs(i,j) * ( lst1(i,j) - tg(i,j) ) / dzg(i,j)
244 
245  ! calculation for residual
246  res = ( 1.0_rp - alb_sw(i,j) ) * swd(i,j) &
247  + ( 1.0_rp - alb_lw(i,j) ) * ( lwd(i,j) - stb * lst1(i,j)**4 ) &
248  - shflx(i,j) - lhflx(i,j) + ghflx(i,j)
249 
250  ! put residual in ground heat flux
251  ghflx(i,j) = ghflx(i,j) - res
252 
253  ! diagnostic variables considering unstable/stable state
254  !U10(i,j) = FracU10 * UA(i,j)
255  !V10(i,j) = FracU10 * VA(i,j)
256  !T2 (i,j) = ( 1.0_RP - FracT2 ) * LST1(i,j) + FracT2 * TMPA(i,j)
257  !Q2 (i,j) = ( 1.0_RP - FracQ2 ) * QVS + FracQ2 * QVA (i,j)
258 
259  ! diagnostic variables for neutral state
260  u10(i,j) = ua(i,j) * log( 10.0_rp / z0m(i,j) ) / log( z1(i,j) / z0m(i,j) )
261  v10(i,j) = va(i,j) * log( 10.0_rp / z0m(i,j) ) / log( z1(i,j) / z0m(i,j) )
262  t2(i,j) = lst1(i,j) + ( tmpa(i,j) - lst1(i,j) ) * ( log( 2.0_rp / z0m(i,j) ) * log( 2.0_rp / z0h(i,j) ) ) &
263  / ( log( z1(i,j) / z0m(i,j) ) * log( z1(i,j) / z0h(i,j) ) )
264  q2(i,j) = qvs + ( qva(i,j) - qvs ) * ( log( 2.0_rp / z0m(i,j) ) * log( 2.0_rp / z0e(i,j) ) ) &
265  / ( log( z1(i,j) / z0m(i,j) ) * log( z1(i,j) / z0e(i,j) ) )
266 
267  else
268 
269  ! not calculate surface flux
270  zmflx(i,j) = 0.0_rp
271  xmflx(i,j) = 0.0_rp
272  ymflx(i,j) = 0.0_rp
273  shflx(i,j) = 0.0_rp
274  lhflx(i,j) = 0.0_rp
275  ghflx(i,j) = 0.0_rp
276  u10(i,j) = 0.0_rp
277  v10(i,j) = 0.0_rp
278  t2(i,j) = 0.0_rp
279  q2(i,j) = 0.0_rp
280 
281  end if
282 
283  end do
284  end do
285 
286  return
287  end subroutine land_sfc_thick_slab
288 
289 end module scale_land_sfc_thick_slab
integer, public is
start point of inner domain: x, local
subroutine, public land_sfc_thick_slab_setup(LAND_TYPE)
Setup.
integer, public je
end point of inner domain: y, local
real(rp), public const_cpdry
specific heat (dry air,constant pressure) [J/kg/K]
Definition: scale_const.F90:58
module ATMOSPHERE / Saturation adjustment
subroutine, public prc_mpistop
Abort MPI.
real(rp), parameter, public const_stb
Stefan-Boltzman constant [W/m2/K4].
Definition: scale_const.F90:51
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
subroutine, public land_sfc_thick_slab(LST_t, ZMFLX, XMFLX, YMFLX, SHFLX, LHFLX, GHFLX, U10, V10, T2, Q2, TMPA, PRSA, WA, UA, VA, RHOA, QVA, Z1, PBL, PRSS, LWD, SWD, TG, LST, QVEF, ALB_LW, ALB_SW, DZG, TCS, Z0M, Z0H, Z0E, dt)
module STDIO
Definition: scale_stdio.F90:12
real(rp), public const_rdry
specific gas constant (dry air) [J/kg/K]
Definition: scale_const.F90:57
module grid index
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
integer, public ia
of whole cells: x, local, with HALO
module LANDUSE
real(rp), public const_pre00
pressure reference [Pa]
Definition: scale_const.F90:90
procedure(bc), pointer, public bulkflux
integer, public js
start point of inner domain: y, local
module PROCESS
module CONSTANT
Definition: scale_const.F90:14
integer, public ie
end point of inner domain: x, local
module Surface bulk flux
module PRECISION
module LAND / Surface fluxes with thick-slab land model
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57
integer, public ja
of whole cells: y, local, with HALO