SCALE-RM
mod_land_phy_driver.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
9 !-------------------------------------------------------------------------------
11  !-----------------------------------------------------------------------------
12  !
13  !++ used modules
14  !
15  use scale_precision
16  use scale_stdio
17  use scale_prof
18  use scale_debug
21 
22  use scale_const, only: &
23  i_sw => const_i_sw, &
24  i_lw => const_i_lw
25  !-----------------------------------------------------------------------------
26  implicit none
27  private
28  !-----------------------------------------------------------------------------
29  !
30  !++ Public procedure
31  !
32  public :: land_phy_driver_setup
33  public :: land_phy_driver_resume
34  public :: land_phy_driver
35 
36  !-----------------------------------------------------------------------------
37  !
38  !++ Public parameters & variables
39  !
40  !-----------------------------------------------------------------------------
41  !
42  !++ Private procedure
43  !
44  !-----------------------------------------------------------------------------
45  !
46  !++ Private parameters & variables
47  !
48  !-----------------------------------------------------------------------------
49 contains
50  !-----------------------------------------------------------------------------
52  subroutine land_phy_driver_setup
53  use scale_land_phy, only: &
55  use scale_land_sfc, only: &
57  use mod_land_admin, only: &
58  land_type, &
59  land_sw
60  implicit none
61  !---------------------------------------------------------------------------
62 
63  if( io_l ) write(io_fid_log,*)
64  if( io_l ) write(io_fid_log,*) '++++++ Module[DRIVER] / Categ[LAND PHY] / Origin[SCALE-RM]'
65 
66  if ( land_sw ) then
67 
68  ! setup library component
71 
72  else
73  if( io_l ) write(io_fid_log,*) '*** this component is never called.'
74  endif
75 
76  return
77  end subroutine land_phy_driver_setup
78 
79  !-----------------------------------------------------------------------------
81  subroutine land_phy_driver_resume
82  use mod_admin_restart, only: &
84  use mod_land_admin, only: &
85  land_sw
86  implicit none
87 
88  if ( land_sw ) then
89 
90  if ( .NOT. restart_run ) then ! tentative
91  ! run once (only for the diagnostic value)
92  call prof_rapstart('LND_Physics', 1)
93  call land_phy_driver( update_flag = .true. )
94  call prof_rapend ('LND_Physics', 1)
95  end if
96  end if
97 
98  return
99  end subroutine land_phy_driver_resume
100  !-----------------------------------------------------------------------------
102  subroutine land_phy_driver( update_flag )
104  atmos_thermodyn_templhv
105  use scale_time, only: &
106  dt => time_dtsec_land
107  use scale_rm_statistics, only: &
109  stat_total
110  use scale_history, only: &
111  hist_in
112  use scale_grid_real, only: &
113  real_z1
114  use scale_land_grid, only: &
115  grid_lcdz
116  use scale_land_phy, only: &
117  land_phy
118  use scale_land_sfc, only: &
119  land_sfc
120  use mod_land_vars, only: &
121  land_property, &
122  i_waterlimit, &
123  i_watercritical, &
124  i_thermalcond, &
125  i_heatcapacity, &
126  i_waterdiff, &
127  i_z0m, &
128  i_z0h, &
129  i_z0e, &
130  land_temp, &
131  land_water, &
132  land_sfc_temp, &
133  land_sfc_albedo, &
134  land_temp_t, &
135  land_water_t, &
136  land_sfc_temp_t, &
138  land_sflx_mw, &
139  land_sflx_mu, &
140  land_sflx_mv, &
141  land_sflx_sh, &
142  land_sflx_lh, &
143  land_sflx_gh, &
144  land_sflx_evap, &
145  land_u10, &
146  land_v10, &
147  land_t2, &
148  land_q2, &
149  atmos_temp, &
150  atmos_pres, &
151  atmos_w, &
152  atmos_u, &
153  atmos_v, &
154  atmos_dens, &
155  atmos_qv, &
156  atmos_pbl, &
157  atmos_sfc_pres, &
158  atmos_sflx_lw, &
159  atmos_sflx_sw, &
161  implicit none
162 
163  ! parameters
164  real(RP), parameter :: BETA_MAX = 1.0_rp
165 
166  ! arguments
167  logical, intent(in) :: update_flag
168 
169  ! works
170  real(RP) :: LAND_QVEF(ia,ja)
171  real(RP) :: LAND_DZ1 (ia,ja)
172 
173  real(RP) :: total ! dummy
174  real(RP) :: lhv(ia,ja)
175 
176  character(len=2) :: sk
177 
178  integer :: k, i, j
179  !---------------------------------------------------------------------------
180 
181  if ( update_flag ) then
182 
183 !OCL XFILL
184  do j = js, je
185  do i = is, ie
186  land_qvef(i,j) = min( land_water(lks,i,j) / land_property(i,j,i_watercritical), beta_max )
187  land_dz1(i,j) = grid_lcdz(lks)
188  end do
189  end do
190 
191  call land_sfc( land_sfc_temp_t(:,:), & ! [OUT]
192  land_sflx_mw(:,:), & ! [OUT]
193  land_sflx_mu(:,:), & ! [OUT]
194  land_sflx_mv(:,:), & ! [OUT]
195  land_sflx_sh(:,:), & ! [OUT]
196  land_sflx_lh(:,:), & ! [OUT]
197  land_sflx_gh(:,:), & ! [OUT]
198  land_u10(:,:), & ! [OUT]
199  land_v10(:,:), & ! [OUT]
200  land_t2(:,:), & ! [OUT]
201  land_q2(:,:), & ! [OUT]
202  atmos_temp(:,:), & ! [IN]
203  atmos_pres(:,:), & ! [IN]
204  atmos_w(:,:), & ! [IN]
205  atmos_u(:,:), & ! [IN]
206  atmos_v(:,:), & ! [IN]
207  atmos_dens(:,:), & ! [IN]
208  atmos_qv(:,:), & ! [IN]
209  real_z1(:,:), & ! [IN]
210  atmos_pbl(:,:), & ! [IN]
211  atmos_sfc_pres(:,:), & ! [IN]
212  atmos_sflx_lw(:,:), & ! [IN]
213  atmos_sflx_sw(:,:), & ! [IN]
214  land_temp(lks,:,:), & ! [IN]
215  land_sfc_temp(:,:), & ! [IN]
216  land_qvef(:,:), & ! [IN]
217  land_sfc_albedo(:,:,i_lw), & ! [IN]
218  land_sfc_albedo(:,:,i_sw), & ! [IN]
219  land_dz1(:,:), & ! [IN]
220  land_property(:,:,i_thermalcond), & ! [IN]
221  land_property(:,:,i_z0m), & ! [IN]
222  land_property(:,:,i_z0h), & ! [IN]
223  land_property(:,:,i_z0e), & ! [IN]
224  dt ) ! [IN]
225 
226  call atmos_thermodyn_templhv( lhv, atmos_temp )
227 
228 !OCL XFILL
229  do j = js, je
230  do i = is, ie
231  land_sflx_evap(i,j) = land_sflx_lh(i,j) / lhv(i,j)
232  end do
233  end do
234 
235  call land_phy( land_temp_t(:,:,:), & ! [OUT]
236  land_water_t(:,:,:), & ! [OUT]
237  land_temp(:,:,:), & ! [IN]
238  land_water(:,:,:), & ! [IN]
239  land_property(:,:,i_waterlimit), & ! [IN]
240  land_property(:,:,i_thermalcond), & ! [IN]
241  land_property(:,:,i_heatcapacity), & ! [IN]
242  land_property(:,:,i_waterdiff), & ! [IN]
243  land_sflx_gh(:,:), & ! [IN]
244  atmos_sflx_prec(:,:), & ! [IN]
245  land_sflx_evap(:,:), & ! [IN]
246  grid_lcdz(:), & ! [IN]
247  dt ) ! [IN]
248 
249  ! no albedo update (tentative)
250 !OCL XFILL
251  land_sfc_albedo_t(:,:,:) = 0.0_rp
252 
253  call hist_in( land_temp_t(:,:,:), 'LAND_TEMP_t', 'tendency of LAND_TEMP', 'K', zdim='land' )
254  call hist_in( land_water_t(:,:,:), 'LAND_WATER_t', 'tendency of LAND_WATER', 'm3/m3', zdim='land' )
255 
256  call hist_in( land_sfc_temp_t(:,:), 'LAND_SFC_TEMP_t', 'tendency of LAND_SFC_TEMP', 'K' )
257  call hist_in( land_sfc_albedo_t(:,:,i_lw), 'LAND_ALB_LW_t', 'tendency of LAND_ALB_LW', '0-1' )
258  call hist_in( land_sfc_albedo_t(:,:,i_sw), 'LAND_ALB_SW_t', 'tendency of LAND_ALB_SW', '0-1' )
259 
260  call hist_in( land_property(:,:,i_waterlimit), 'LP_WaterLimit', 'LAND PROPERTY, WaterLimit', 'm3/m3' )
261  call hist_in( land_property(:,:,i_watercritical), 'LP_WaterCritical', 'LAND PROPERTY, WaterCritical', 'm3/m3' )
262  call hist_in( land_property(:,:,i_thermalcond), 'LP_ThermalCond', 'LAND PROPERTY, ThermalCond', 'W/K/m' )
263  call hist_in( land_property(:,:,i_heatcapacity), 'LP_HeatCapacity', 'LAND PROPERTY, HeatCapacity', 'J/K/m3' )
264  call hist_in( land_property(:,:,i_waterdiff), 'LP_WaterDiff', 'LAND PROPERTY, WaterDiff', 'm2/s' )
265  call hist_in( land_property(:,:,i_z0m), 'LP_Z0M', 'LAND PROPERTY, Z0M', 'm' )
266  call hist_in( land_property(:,:,i_z0h), 'LP_Z0H', 'LAND PROPERTY, Z0H', 'm' )
267  call hist_in( land_property(:,:,i_z0e), 'LP_Z0E', 'LAND PROPERTY, Z0E', 'm' )
268 
269  endif
270 
271  if ( statistics_checktotal ) then
272  do k = lks, lke
273  write(sk,'(I2.2)') k
274 
275  call stat_total( total, land_temp_t(k,:,:), 'LAND_TEMP_t'//sk )
276  call stat_total( total, land_water_t(k,:,:), 'LAND_WATER_t'//sk )
277  enddo
278 
279  call stat_total( total, land_sfc_temp_t(:,:), 'LAND_SFC_TEMP_t' )
280  call stat_total( total, land_sfc_albedo_t(:,:,i_lw), 'LAND_ALB_LW_t' )
281  call stat_total( total, land_sfc_albedo_t(:,:,i_sw), 'LAND_ALB_SW_t' )
282  endif
283 
284  return
285  end subroutine land_phy_driver
286 
287 end module mod_land_phy_driver
module Land admin
integer, public is
start point of inner domain: x, local
module DEBUG
Definition: scale_debug.F90:13
logical, public statistics_checktotal
calc&report variable totals to logfile?
real(rp), dimension(:,:), allocatable, public land_v10
land surface velocity v at 10m [m/s]
integer, public je
end point of inner domain: y, local
real(rp), dimension(:,:), allocatable, public land_sflx_mw
land surface w-momentum flux [kg/m2/s]
integer, public const_i_lw
long-wave radiation index
Definition: scale_const.F90:98
character(len=h_short), public land_type
integer, parameter, public i_heatcapacity
subroutine, public land_phy_driver_setup
Setup.
integer, parameter, public i_waterlimit
subroutine, public land_phy_driver(update_flag)
Driver.
real(rp), dimension(:,:), allocatable, public atmos_qv
real(rp), dimension(:,:), allocatable, public land_sflx_sh
land surface sensible heat flux [J/m2/s]
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
real(rp), dimension(:,:), allocatable, public atmos_pbl
real(rp), dimension(:,:), allocatable, public atmos_sflx_prec
real(rp), dimension(:,:), allocatable, public atmos_u
module STDIO
Definition: scale_stdio.F90:12
integer, parameter, public i_watercritical
subroutine, public land_phy_setup(LAND_TYPE)
Setup.
module GRID (cartesian) for land
real(rp), dimension(:,:,:), allocatable, public land_sfc_albedo_t
tendency of LAND_SFC_albedo
real(rp), dimension(:,:), allocatable, public land_sflx_lh
land surface latent heat flux [J/m2/s]
real(rp), dimension(:,:), allocatable, public atmos_w
real(dp), public time_dtsec_land
time interval of land step [sec]
Definition: scale_time.F90:48
integer, parameter, public i_z0h
real(rp), dimension(:,:), allocatable, public land_sflx_evap
land surface water vapor flux [kg/m2/s]
integer, parameter, public i_z0e
module Statistics
real(rp), dimension(:,:), allocatable, public atmos_sfc_pres
procedure(lnd), pointer, public land_phy
real(rp), dimension(:,:), allocatable, public atmos_pres
module grid index
real(rp), dimension(:,:), allocatable, public land_sfc_temp
land surface skin temperature [K]
real(rp), dimension(:,:), allocatable, public atmos_temp
real(rp), dimension(:,:), allocatable, public land_sflx_mu
land surface u-momentum flux [kg/m2/s]
real(rp), dimension(:,:), allocatable, public land_q2
land surface water vapor at 2m [kg/kg]
integer, public ia
of x whole cells (local, with HALO)
real(rp), dimension(:,:), allocatable, public land_t2
land surface temperature at 2m [K]
real(rp), dimension(:,:), allocatable, public real_z1
Height of the lowermost grid from surface (cell center) [m].
module GRID (real space)
real(rp), dimension(:,:,:), allocatable, public land_temp
temperature of each soil layer [K]
integer, public js
start point of inner domain: y, local
module LAND / Physics
module TIME
Definition: scale_time.F90:15
real(rp), dimension(:,:), allocatable, public land_u10
land surface velocity u at 10m [m/s]
module LAND / Surface fluxes
real(rp), dimension(:,:,:), allocatable, public land_water_t
tendency of LAND_WATER
real(rp), dimension(:,:,:), allocatable, public land_sfc_albedo
land surface albedo [0-1]
module LAND Variables
module administrator for restart
real(rp), dimension(:,:), allocatable, public land_sfc_temp_t
tendency of LAND_SFC_TEMP
module CONSTANT
Definition: scale_const.F90:14
real(rp), dimension(:,:), allocatable, public atmos_dens
real(rp), dimension(:,:), allocatable, public land_sflx_gh
land surface heat flux [J/m2/s]
subroutine, public land_sfc_setup(LAND_TYPE)
real(rp), dimension(:,:), allocatable, public atmos_v
subroutine, public prof_rapstart(rapname_base, level)
Start raptime.
Definition: scale_prof.F90:132
real(rp), dimension(:,:,:), allocatable, public land_water
moisture of each soil layer [m3/m3]
procedure(lndsfc), pointer, public land_sfc
module profiler
Definition: scale_prof.F90:10
real(rp), dimension(:,:), allocatable, public land_sflx_mv
land surface v-momentum flux [kg/m2/s]
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:,:,:), allocatable, public land_temp_t
tendency of LAND_TEMP
subroutine, public land_phy_driver_resume
Resume.
real(rp), dimension(:), allocatable, public grid_lcdz
z-length of control volume [m]
module ATMOSPHERE / Thermodynamics
integer, parameter, public i_z0m
integer, public const_i_sw
short-wave radiation index
Definition: scale_const.F90:99
module PRECISION
module LAND / Physics
module HISTORY
module land grid index
logical, public land_sw
logical, public restart_run
is this run restart?
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
real(rp), dimension(:,:), allocatable, public atmos_sflx_sw
integer, parameter, public i_thermalcond
subroutine, public prof_rapend(rapname_base, level)
Save raptime.
Definition: scale_prof.F90:178
integer, parameter, public i_waterdiff
real(rp), dimension(:,:,:), allocatable, public land_property
land surface property
real(rp), dimension(:,:), allocatable, public atmos_sflx_lw
integer, public ja
of y whole cells (local, with HALO)