SCALE-RM
mod_cpl_vars.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
20  use scale_debug
22  use scale_tracer
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedure
30  !
31  public :: cpl_vars_setup
32 
33  public :: cpl_putatm
34  public :: cpl_putocn
35  public :: cpl_putlnd
36  public :: cpl_puturb
37  public :: cpl_getsfc_atm
38  public :: cpl_getatm_ocn
39  public :: cpl_getatm_lnd
40  public :: cpl_getatm_urb
41 
42  !-----------------------------------------------------------------------------
43  !
44  !++ Public parameters & variables
45  !
46 
47  ! Input from ocean model
48  real(RP), public, allocatable :: ocn_sfc_temp (:,:) ! ocean surface skin temperature [K]
49  real(RP), public, allocatable :: ocn_sfc_albedo(:,:,:,:) ! ocean surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
50  real(RP), public, allocatable :: ocn_sfc_z0m (:,:) ! ocean surface roughness length for momemtum [m]
51  real(RP), public, allocatable :: ocn_sfc_z0h (:,:) ! ocean surface roughness length for heat [m]
52  real(RP), public, allocatable :: ocn_sfc_z0e (:,:) ! ocean surface roughness length for vapor [m]
53  real(RP), public, allocatable :: ocn_sflx_mw (:,:) ! ocean surface w-momentum flux [kg/m/s2]
54  real(RP), public, allocatable :: ocn_sflx_mu (:,:) ! ocean surface u-momentum flux [kg/m/s2]
55  real(RP), public, allocatable :: ocn_sflx_mv (:,:) ! ocean surface v-momentum flux [kg/m/s2]
56  real(RP), public, allocatable :: ocn_sflx_sh (:,:) ! ocean surface sensible heat flux [J/m/s2]
57  real(RP), public, allocatable :: ocn_sflx_lh (:,:) ! ocean surface latent heat flux [J/m2/s]
58  real(RP), public, allocatable :: ocn_sflx_g (:,:) ! ocean surface water heat flux [J/m2/s]
59  real(RP), public, allocatable :: ocn_sflx_qtrc (:,:,:) ! ocean surface tracer flux [kg/m2/s]
60  real(RP), public, allocatable :: ocn_u10 (:,:) ! ocean velocity u at 10m [m/s]
61  real(RP), public, allocatable :: ocn_v10 (:,:) ! ocean velocity v at 10m [m/s]
62  real(RP), public, allocatable :: ocn_t2 (:,:) ! ocean temperature at 2m [K]
63  real(RP), public, allocatable :: ocn_q2 (:,:) ! ocean water vapor at 2m [kg/kg]
64 
65  ! Input from land model
66  real(RP), public, allocatable :: lnd_sfc_temp (:,:) ! land surface skin temperature [K]
67  real(RP), public, allocatable :: lnd_sfc_albedo(:,:,:,:) ! land surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
68  real(RP), public, allocatable :: lnd_sfc_z0m (:,:) ! land surface roughness length for momemtum [m]
69  real(RP), public, allocatable :: lnd_sfc_z0h (:,:) ! land surface roughness length for heat [m]
70  real(RP), public, allocatable :: lnd_sfc_z0e (:,:) ! land surface roughness length for vapor [m]
71  real(RP), public, allocatable :: lnd_sflx_mw (:,:) ! land surface w-momentum flux [kg/m/s2]
72  real(RP), public, allocatable :: lnd_sflx_mu (:,:) ! land surface u-momentum flux [kg/m/s2]
73  real(RP), public, allocatable :: lnd_sflx_mv (:,:) ! land surface v-momentum flux [kg/m/s2]
74  real(RP), public, allocatable :: lnd_sflx_sh (:,:) ! land surface sensible heat flux [J/m2/s]
75  real(RP), public, allocatable :: lnd_sflx_lh (:,:) ! land surface latent heat flux [J/m2/s]
76  real(RP), public, allocatable :: lnd_sflx_g (:,:) ! land surface ground heat flux [J/m2/s]
77  real(RP), public, allocatable :: lnd_sflx_qtrc (:,:,:) ! land surface tracer flux [kg/m2/s]
78  real(RP), public, allocatable :: lnd_u10 (:,:) ! land velocity u at 10m [m/s]
79  real(RP), public, allocatable :: lnd_v10 (:,:) ! land velocity v at 10m [m/s]
80  real(RP), public, allocatable :: lnd_t2 (:,:) ! land temperature at 2m [K]
81  real(RP), public, allocatable :: lnd_q2 (:,:) ! land water vapor at 2m [kg/kg]
82 
83  ! Input from urban model
84  real(RP), public, allocatable :: urb_sfc_temp (:,:) ! urban surface skin temperature [K]
85  real(RP), public, allocatable :: urb_sfc_albedo(:,:,:,:) ! urban surface albedo (direct/diffuse,IR/near-IR/VIS) (0-1)
86  real(RP), public, allocatable :: urb_sfc_z0m (:,:) ! urban surface roughness length for momemtum [m]
87  real(RP), public, allocatable :: urb_sfc_z0h (:,:) ! urban surface roughness length for heat [m]
88  real(RP), public, allocatable :: urb_sfc_z0e (:,:) ! urban surface roughness length for vapor [m]
89  real(RP), public, allocatable :: urb_sflx_mw (:,:) ! urban surface w-momentum flux [kg/m/s2]
90  real(RP), public, allocatable :: urb_sflx_mu (:,:) ! urban surface u-momentum flux [kg/m/s2]
91  real(RP), public, allocatable :: urb_sflx_mv (:,:) ! urban surface v-momentum flux [kg/m/s2]
92  real(RP), public, allocatable :: urb_sflx_sh (:,:) ! urban surface sensible heat flux [J/m2/s]
93  real(RP), public, allocatable :: urb_sflx_lh (:,:) ! urban surface latent heat flux [J/m2/s]
94  real(RP), public, allocatable :: urb_sflx_g (:,:) ! urban surface ground heat flux [J/m2/s]
95  real(RP), public, allocatable :: urb_sflx_qtrc (:,:,:) ! urban surface tracer flux [kg/m2/s]
96  real(RP), public, allocatable :: urb_u10 (:,:) ! urban velocity u at 10m [m/s]
97  real(RP), public, allocatable :: urb_v10 (:,:) ! urban velocity v at 10m [m/s]
98  real(RP), public, allocatable :: urb_t2 (:,:) ! urban temperature at 2m [K]
99  real(RP), public, allocatable :: urb_q2 (:,:) ! urban water vapor at 2m [kg/kg]
100 
101  ! Output to ocean model
102  real(RP), public, allocatable :: ocn_atm_temp (:,:) ! temperature at the lowermost atmosphere layer [K]
103  real(RP), public, allocatable :: ocn_atm_pres (:,:) ! pressure at the lowermost atmosphere layer [Pa]
104  real(RP), public, allocatable :: ocn_atm_w (:,:) ! velocity w at the lowermost atmosphere layer [m/s]
105  real(RP), public, allocatable :: ocn_atm_u (:,:) ! velocity u at the lowermost atmosphere layer [m/s]
106  real(RP), public, allocatable :: ocn_atm_v (:,:) ! velocity v at the lowermost atmosphere layer [m/s]
107  real(RP), public, allocatable :: ocn_atm_dens (:,:) ! density at the lowermost atmosphere layer [kg/m3]
108  real(RP), public, allocatable :: ocn_atm_qv (:,:) ! water vapor at the lowermost atmosphere layer [kg/kg]
109  real(RP), public, allocatable :: ocn_atm_pbl (:,:) ! the top of atmospheric mixing layer [m]
110  real(RP), public, allocatable :: ocn_atm_sfc_dens (:,:) ! surface density [kg/m3]
111  real(RP), public, allocatable :: ocn_atm_sfc_pres (:,:) ! surface pressure [Pa]
112  real(RP), public, allocatable :: ocn_atm_sflx_rad_dn(:,:,:,:) ! downward radiation flux (direct/diffuse,IR/near-IR/VIS) [J/m2/s]
113  real(RP), public, allocatable :: ocn_atm_cossza (:,:) ! cos(solar zenith angle) (0-1)
114  real(RP), public, allocatable :: ocn_atm_sflx_rain (:,:) ! liquid water flux [kg/m2/s]
115  real(RP), public, allocatable :: ocn_atm_sflx_snow (:,:) ! ice water flux [kg/m2/s]
116 
117  ! Output to land model
118  real(RP), public, allocatable :: lnd_atm_temp (:,:) ! temperature at the lowermost atmosphere layer [K]
119  real(RP), public, allocatable :: lnd_atm_pres (:,:) ! pressure at the lowermost atmosphere layer [Pa]
120  real(RP), public, allocatable :: lnd_atm_w (:,:) ! velocity w at the lowermost atmosphere layer [m/s]
121  real(RP), public, allocatable :: lnd_atm_u (:,:) ! velocity u at the lowermost atmosphere layer [m/s]
122  real(RP), public, allocatable :: lnd_atm_v (:,:) ! velocity v at the lowermost atmosphere layer [m/s]
123  real(RP), public, allocatable :: lnd_atm_dens (:,:) ! density at the lowermost atmosphere layer [kg/m3]
124  real(RP), public, allocatable :: lnd_atm_qv (:,:) ! water vapor at the lowermost atmosphere layer [kg/kg]
125  real(RP), public, allocatable :: lnd_atm_pbl (:,:) ! the top of atmospheric mixing layer [m]
126  real(RP), public, allocatable :: lnd_atm_sfc_dens (:,:) ! surface density [kg/m3]
127  real(RP), public, allocatable :: lnd_atm_sfc_pres (:,:) ! surface pressure [Pa]
128  real(RP), public, allocatable :: lnd_atm_sflx_rad_dn(:,:,:,:) ! downward radiation flux (direct/diffuse,IR/near-IR/VIS) [J/m2/s]
129  real(RP), public, allocatable :: lnd_atm_cossza (:,:) ! cos(solar zenith angle) (0-1)
130  real(RP), public, allocatable :: lnd_atm_sflx_rain (:,:) ! liquid water flux [kg/m2/s]
131  real(RP), public, allocatable :: lnd_atm_sflx_snow (:,:) ! ice water flux [kg/m2/s]
132 
133  ! Output to urban model
134  real(RP), public, allocatable :: urb_atm_temp (:,:) ! temperature at the lowermost atmosphere layer [K]
135  real(RP), public, allocatable :: urb_atm_pres (:,:) ! pressure at the lowermost atmosphere layer [Pa]
136  real(RP), public, allocatable :: urb_atm_w (:,:) ! velocity w at the lowermost atmosphere layer [m/s]
137  real(RP), public, allocatable :: urb_atm_u (:,:) ! velocity u at the lowermost atmosphere layer [m/s]
138  real(RP), public, allocatable :: urb_atm_v (:,:) ! velocity v at the lowermost atmosphere layer [m/s]
139  real(RP), public, allocatable :: urb_atm_dens (:,:) ! density at the lowermost atmosphere layer [kg/m3]
140  real(RP), public, allocatable :: urb_atm_qv (:,:) ! water vapor at the lowermost atmosphere layer [kg/kg]
141  real(RP), public, allocatable :: urb_atm_pbl (:,:) ! the top of atmospheric mixing layer [m]
142  real(RP), public, allocatable :: urb_atm_sfc_dens (:,:) ! surface density [kg/m3]
143  real(RP), public, allocatable :: urb_atm_sfc_pres (:,:) ! surface pressure [Pa]
144  real(RP), public, allocatable :: urb_atm_sflx_rad_dn(:,:,:,:) ! downward radiation flux (direct/diffuse,IR/near-IR/VIS) [J/m2/s]
145  real(RP), public, allocatable :: urb_atm_cossza (:,:) ! cos(solar zenith angle) (0-1)
146  real(RP), public, allocatable :: urb_atm_sflx_rain (:,:) ! liquid water flux [kg/m2/s]
147  real(RP), public, allocatable :: urb_atm_sflx_snow (:,:) ! ice water flux [kg/m2/s]
148 
149  ! counter
150  real(RP), public :: cnt_putatm_ocn ! put counter for atmos to ocean
151  real(RP), public :: cnt_putatm_lnd ! put counter for atmos to land
152  real(RP), public :: cnt_putatm_urb ! put counter for atmos to urban
153  real(RP), public :: cnt_putocn ! put counter for ocean
154  real(RP), public :: cnt_putlnd ! put counter for land
155  real(RP), public :: cnt_puturb ! put counter for urban
156 
157  !-----------------------------------------------------------------------------
158  !
159  !++ Private procedure
160  !
161  !-----------------------------------------------------------------------------
162  !
163  !++ Private parameters & variables
164  !
165  !-----------------------------------------------------------------------------
166 contains
167  !-----------------------------------------------------------------------------
169  subroutine cpl_vars_setup
170  use scale_const, only: &
171  undef => const_undef
172  use scale_prc, only: &
173  prc_abort
174  use scale_landuse, only: &
179  use scale_atmos_hydrometeor, only: &
181  use mod_ocean_admin, only: &
182  ocean_do
183  use mod_land_admin, only: &
184  land_do
185  use mod_urban_admin, only: &
186  urban_do
187  use mod_lake_admin, only: &
188  lake_do
189  implicit none
190 
191  real(RP) :: checkfact
192  !---------------------------------------------------------------------------
193 
194  log_newline
195  log_info("CPL_vars_setup",*) 'Setup'
196  log_info("CPL_vars_setup",*) 'No namelists.'
197 
198  ! Check consistency of OCEAN_do and LANDUSE_fact_ocean
199  checkfact = maxval( landuse_fact_ocean(:,:) )
200  if ( .NOT. ocean_do .AND. checkfact > 0.0_rp ) then
201  log_error("CPL_vars_setup",*) 'Ocean fraction exists, but ocean component has not been called. Please check this inconsistency. STOP.', checkfact
202  call prc_abort
203  endif
204 
205  ! Check consistency of LAND_do and LANDUSE_fact_land
206  checkfact = maxval( landuse_fact_land(:,:) )
207  if ( .NOT. land_do .AND. checkfact > 0.0_rp ) then
208  log_error("CPL_vars_setup",*) 'Land fraction exists, but land component has not been called. Please check this inconsistency. STOP.', checkfact
209  call prc_abort
210  endif
211 
212  ! Check consistency of URBAN_do and LANDUSE_fact_urban
213  checkfact = maxval( landuse_fact_urban(:,:) )
214  if ( .NOT. urban_do .AND. checkfact > 0.0_rp ) then
215  log_error("CPL_vars_setup",*) 'Urban fraction exists, but urban component has not been called. Please check this inconsistency. STOP.', checkfact
216  call prc_abort
217  endif
218 
219  ! Check consistency of LAKE_do and LANDUSE_fact_lake
220  checkfact = maxval( landuse_fact_lake(:,:) )
221  if ( .NOT. lake_do .AND. checkfact > 0.0_rp ) then
222  log_error("CPL_vars_setup",*) 'Lake fraction exists, but lake component has not been called. Please check this inconsistency. STOP.', checkfact
223  call prc_abort
224  endif
225 
226 
227  allocate( ocn_sfc_temp(ia,ja) )
228  allocate( ocn_sfc_albedo(ia,ja,n_rad_dir,n_rad_rgn) )
229  allocate( ocn_sfc_z0m(ia,ja) )
230  allocate( ocn_sfc_z0h(ia,ja) )
231  allocate( ocn_sfc_z0e(ia,ja) )
232  allocate( ocn_sflx_mu(ia,ja) )
233  allocate( ocn_sflx_mv(ia,ja) )
234  allocate( ocn_sflx_mw(ia,ja) )
235  allocate( ocn_sflx_sh(ia,ja) )
236  allocate( ocn_sflx_lh(ia,ja) )
237  allocate( ocn_sflx_g(ia,ja) )
238  allocate( ocn_sflx_qtrc(ia,ja,qa) )
239  allocate( ocn_u10(ia,ja) )
240  allocate( ocn_v10(ia,ja) )
241  allocate( ocn_t2(ia,ja) )
242  allocate( ocn_q2(ia,ja) )
243  ocn_sfc_temp(:,:) = undef
244  ocn_sfc_albedo(:,:,:,:) = undef
245  ocn_sfc_z0m(:,:) = undef
246  ocn_sfc_z0h(:,:) = undef
247  ocn_sfc_z0e(:,:) = undef
248  ocn_sflx_mu(:,:) = undef
249  ocn_sflx_mv(:,:) = undef
250  ocn_sflx_mw(:,:) = undef
251  ocn_sflx_sh(:,:) = undef
252  ocn_sflx_lh(:,:) = undef
253  ocn_sflx_g(:,:) = undef
254  ocn_sflx_qtrc(:,:,:) = undef
255  ocn_u10(:,:) = undef
256  ocn_v10(:,:) = undef
257  ocn_t2(:,:) = undef
258  ocn_q2(:,:) = undef
259 
260  allocate( lnd_sfc_temp(ia,ja) )
261  allocate( lnd_sfc_albedo(ia,ja,n_rad_dir,n_rad_rgn) )
262  allocate( lnd_sfc_z0m(ia,ja) )
263  allocate( lnd_sfc_z0h(ia,ja) )
264  allocate( lnd_sfc_z0e(ia,ja) )
265  allocate( lnd_sflx_mu(ia,ja) )
266  allocate( lnd_sflx_mv(ia,ja) )
267  allocate( lnd_sflx_mw(ia,ja) )
268  allocate( lnd_sflx_sh(ia,ja) )
269  allocate( lnd_sflx_lh(ia,ja) )
270  allocate( lnd_sflx_g(ia,ja) )
271  allocate( lnd_sflx_qtrc(ia,ja,qa) )
272  allocate( lnd_u10(ia,ja) )
273  allocate( lnd_v10(ia,ja) )
274  allocate( lnd_t2(ia,ja) )
275  allocate( lnd_q2(ia,ja) )
276  lnd_sfc_temp(:,:) = undef
277  lnd_sfc_albedo(:,:,:,:) = undef
278  lnd_sfc_z0m(:,:) = undef
279  lnd_sfc_z0h(:,:) = undef
280  lnd_sfc_z0e(:,:) = undef
281  lnd_sflx_mu(:,:) = undef
282  lnd_sflx_mv(:,:) = undef
283  lnd_sflx_mw(:,:) = undef
284  lnd_sflx_sh(:,:) = undef
285  lnd_sflx_lh(:,:) = undef
286  lnd_sflx_g(:,:) = undef
287  lnd_sflx_qtrc(:,:,:) = undef
288  lnd_u10(:,:) = undef
289  lnd_v10(:,:) = undef
290  lnd_t2(:,:) = undef
291  lnd_q2(:,:) = undef
292 
293  allocate( urb_sfc_temp(ia,ja) )
294  allocate( urb_sfc_albedo(ia,ja,n_rad_dir,n_rad_rgn) )
295  allocate( urb_sfc_z0m(ia,ja) )
296  allocate( urb_sfc_z0h(ia,ja) )
297  allocate( urb_sfc_z0e(ia,ja) )
298  allocate( urb_sflx_mu(ia,ja) )
299  allocate( urb_sflx_mv(ia,ja) )
300  allocate( urb_sflx_mw(ia,ja) )
301  allocate( urb_sflx_sh(ia,ja) )
302  allocate( urb_sflx_lh(ia,ja) )
303  allocate( urb_sflx_g(ia,ja) )
304  allocate( urb_sflx_qtrc(ia,ja,qa) )
305  allocate( urb_u10(ia,ja) )
306  allocate( urb_v10(ia,ja) )
307  allocate( urb_t2(ia,ja) )
308  allocate( urb_q2(ia,ja) )
309  urb_sfc_temp(:,:) = undef
310  urb_sfc_albedo(:,:,:,:) = undef
311  urb_sfc_z0m(:,:) = undef
312  urb_sfc_z0h(:,:) = undef
313  urb_sfc_z0e(:,:) = undef
314  urb_sflx_mu(:,:) = undef
315  urb_sflx_mv(:,:) = undef
316  urb_sflx_mw(:,:) = undef
317  urb_sflx_sh(:,:) = undef
318  urb_sflx_lh(:,:) = undef
319  urb_sflx_g(:,:) = undef
320  urb_sflx_qtrc(:,:,:) = undef
321  urb_u10(:,:) = undef
322  urb_v10(:,:) = undef
323  urb_t2(:,:) = undef
324  urb_q2(:,:) = undef
325 
326  allocate( ocn_atm_temp(ia,ja) )
327  allocate( ocn_atm_pres(ia,ja) )
328  allocate( ocn_atm_w(ia,ja) )
329  allocate( ocn_atm_u(ia,ja) )
330  allocate( ocn_atm_v(ia,ja) )
331  allocate( ocn_atm_dens(ia,ja) )
332  allocate( ocn_atm_qv(ia,ja) )
333  allocate( ocn_atm_pbl(ia,ja) )
334  allocate( ocn_atm_sfc_dens(ia,ja) )
335  allocate( ocn_atm_sfc_pres(ia,ja) )
337  allocate( ocn_atm_cossza(ia,ja) )
338  allocate( ocn_atm_sflx_rain(ia,ja) )
339  allocate( ocn_atm_sflx_snow(ia,ja) )
340  ocn_atm_temp(:,:) = undef
341  ocn_atm_pres(:,:) = undef
342  ocn_atm_w(:,:) = undef
343  ocn_atm_u(:,:) = undef
344  ocn_atm_v(:,:) = undef
345  ocn_atm_dens(:,:) = undef
346  ocn_atm_qv(:,:) = undef
347  ocn_atm_pbl(:,:) = undef
348  ocn_atm_sfc_dens(:,:) = undef
349  ocn_atm_sfc_pres(:,:) = undef
350  ocn_atm_sflx_rad_dn(:,:,:,:) = undef
351  ocn_atm_cossza(:,:) = undef
352  ocn_atm_sflx_rain(:,:) = undef
353  ocn_atm_sflx_snow(:,:) = undef
354 
355  allocate( lnd_atm_temp(ia,ja) )
356  allocate( lnd_atm_pres(ia,ja) )
357  allocate( lnd_atm_w(ia,ja) )
358  allocate( lnd_atm_u(ia,ja) )
359  allocate( lnd_atm_v(ia,ja) )
360  allocate( lnd_atm_dens(ia,ja) )
361  allocate( lnd_atm_qv(ia,ja) )
362  allocate( lnd_atm_pbl(ia,ja) )
363  allocate( lnd_atm_sfc_dens(ia,ja) )
364  allocate( lnd_atm_sfc_pres(ia,ja) )
366  allocate( lnd_atm_cossza(ia,ja) )
367  allocate( lnd_atm_sflx_rain(ia,ja) )
368  allocate( lnd_atm_sflx_snow(ia,ja) )
369  lnd_atm_temp(:,:) = undef
370  lnd_atm_pres(:,:) = undef
371  lnd_atm_w(:,:) = undef
372  lnd_atm_u(:,:) = undef
373  lnd_atm_v(:,:) = undef
374  lnd_atm_dens(:,:) = undef
375  lnd_atm_qv(:,:) = undef
376  lnd_atm_pbl(:,:) = undef
377  lnd_atm_sfc_dens(:,:) = undef
378  lnd_atm_sfc_pres(:,:) = undef
379  lnd_atm_sflx_rad_dn(:,:,:,:) = undef
380  lnd_atm_cossza(:,:) = undef
381  lnd_atm_sflx_rain(:,:) = undef
382  lnd_atm_sflx_snow(:,:) = undef
383 
384  allocate( urb_atm_temp(ia,ja) )
385  allocate( urb_atm_pres(ia,ja) )
386  allocate( urb_atm_w(ia,ja) )
387  allocate( urb_atm_u(ia,ja) )
388  allocate( urb_atm_v(ia,ja) )
389  allocate( urb_atm_dens(ia,ja) )
390  allocate( urb_atm_qv(ia,ja) )
391  allocate( urb_atm_pbl(ia,ja) )
392  allocate( urb_atm_sfc_dens(ia,ja) )
393  allocate( urb_atm_sfc_pres(ia,ja) )
395  allocate( urb_atm_cossza(ia,ja) )
396  allocate( urb_atm_sflx_rain(ia,ja) )
397  allocate( urb_atm_sflx_snow(ia,ja) )
398  urb_atm_temp(:,:) = undef
399  urb_atm_pres(:,:) = undef
400  urb_atm_w(:,:) = undef
401  urb_atm_u(:,:) = undef
402  urb_atm_v(:,:) = undef
403  urb_atm_dens(:,:) = undef
404  urb_atm_qv(:,:) = undef
405  urb_atm_pbl(:,:) = undef
406  urb_atm_sfc_dens(:,:) = undef
407  urb_atm_sfc_pres(:,:) = undef
408  urb_atm_sflx_rad_dn(:,:,:,:) = undef
409  urb_atm_cossza(:,:) = undef
410  urb_atm_sflx_rain(:,:) = undef
411  urb_atm_sflx_snow(:,:) = undef
412 
413  ! counter intialize
414  cnt_putatm_ocn = 0.0_rp
415  cnt_putatm_lnd = 0.0_rp
416  cnt_putatm_urb = 0.0_rp
417  cnt_putocn = 0.0_rp
418  cnt_putlnd = 0.0_rp
419  cnt_puturb = 0.0_rp
420 
421  if ( atmos_hydrometeor_dry ) then
422  ocn_atm_qv = 0.0_rp
423  lnd_atm_qv = 0.0_rp
424  urb_atm_qv = 0.0_rp
425  endif
426 
427  return
428  end subroutine cpl_vars_setup
429 
430  !-----------------------------------------------------------------------------
431  subroutine cpl_putatm( &
432  TEMP, &
433  PRES, &
434  W, &
435  U, &
436  V, &
437  DENS, &
438  QV, &
439  PBL, &
440  SFC_DENS, &
441  SFC_PRES, &
442  SFLX_rad_dn, &
443  cosSZA, &
444  SFLX_rain, &
445  SFLX_snow, &
446  countup )
449  implicit none
450 
451  real(RP), intent(in) :: TEMP (ia,ja)
452  real(RP), intent(in) :: PRES (ia,ja)
453  real(RP), intent(in) :: W (ia,ja)
454  real(RP), intent(in) :: U (ia,ja)
455  real(RP), intent(in) :: V (ia,ja)
456  real(RP), intent(in) :: DENS (ia,ja)
457  real(RP), intent(in) :: QV (ia,ja)
458  real(RP), intent(in) :: PBL (ia,ja)
459  real(RP), intent(in) :: SFC_DENS (ia,ja)
460  real(RP), intent(in) :: SFC_PRES (ia,ja)
461  real(RP), intent(in) :: SFLX_rad_dn(ia,ja,n_rad_dir,n_rad_rgn)
462  real(RP), intent(in) :: cosSZA (ia,ja)
463  real(RP), intent(in) :: SFLX_rain (ia,ja)
464  real(RP), intent(in) :: SFLX_snow (ia,ja)
465  logical, intent(in) :: countup
466 
467  integer :: i, j, idir, irgn
468  !---------------------------------------------------------------------------
469 
470  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
471  !$omp shared(JS,JE,IS,IE,OCN_ATM_TEMP,OCN_ATM_PRES,OCN_ATM_W,OCN_ATM_U) &
472  !$omp shared(OCN_ATM_V,OCN_ATM_DENS,CNT_putATM_OCN,TEMP,PRES,W,U,V,DENS) &
473  !$omp shared(ATMOS_HYDROMETEOR_dry,OCN_ATM_QV,OCN_ATM_PBL,OCN_ATM_SFC_DENS,OCN_ATM_SFC_PRES,OCN_ATM_SFLX_rad_dn) &
474  !$omp shared(OCN_ATM_cosSZA,OCN_ATM_SFLX_rain,OCN_ATM_SFLX_snow,QV,PBL,SFC_DENS,SFC_PRES) &
475  !$omp shared(SFLX_rad_dn,cosSZA,SFLX_rain,SFLX_snow) &
476  !$omp shared(LND_ATM_TEMP,LND_ATM_PRES,LND_ATM_W,LND_ATM_U,LND_ATM_V,LND_ATM_DENS) &
477  !$omp shared(LND_ATM_QV,LND_ATM_PBL,LND_ATM_SFC_DENS,LND_ATM_SFC_PRES,LND_ATM_SFLX_rad_dn,LND_ATM_cosSZA) &
478  !$omp shared(LND_ATM_SFLX_rain,LND_ATM_SFLX_snow) &
479  !$omp shared(URB_ATM_TEMP,URB_ATM_PRES,URB_ATM_W,URB_ATM_U,URB_ATM_V,URB_ATM_DENS) &
480  !$omp shared(URB_ATM_QV,URB_ATM_PBL,URB_ATM_SFC_DENS,URB_ATM_SFC_PRES,URB_ATM_SFLX_rad_dn,URB_ATM_cosSZA) &
481  !$omp shared(URB_ATM_SFLX_rain,URB_ATM_SFLX_snow,CNT_putATM_URB,CNT_putATM_LND)
482  do j = js, je
483  do i = is, ie
484  ! for ocean
485  ocn_atm_temp(i,j) = ocn_atm_temp(i,j) * cnt_putatm_ocn + temp(i,j)
486  ocn_atm_pres(i,j) = ocn_atm_pres(i,j) * cnt_putatm_ocn + pres(i,j)
487  ocn_atm_w(i,j) = ocn_atm_w(i,j) * cnt_putatm_ocn + w(i,j)
488  ocn_atm_u(i,j) = ocn_atm_u(i,j) * cnt_putatm_ocn + u(i,j)
489  ocn_atm_v(i,j) = ocn_atm_v(i,j) * cnt_putatm_ocn + v(i,j)
490  ocn_atm_dens(i,j) = ocn_atm_dens(i,j) * cnt_putatm_ocn + dens(i,j)
491  if ( .NOT. atmos_hydrometeor_dry ) &
492  ocn_atm_qv(i,j) = ocn_atm_qv(i,j) * cnt_putatm_ocn + qv(i,j)
493  ocn_atm_pbl(i,j) = ocn_atm_pbl(i,j) * cnt_putatm_ocn + pbl(i,j)
494  ocn_atm_sfc_dens(i,j) = ocn_atm_sfc_dens(i,j) * cnt_putatm_ocn + sfc_dens(i,j)
495  ocn_atm_sfc_pres(i,j) = ocn_atm_sfc_pres(i,j) * cnt_putatm_ocn + sfc_pres(i,j)
496  ocn_atm_cossza(i,j) = ocn_atm_cossza(i,j) * cnt_putatm_ocn + cossza(i,j)
497  ocn_atm_sflx_rain(i,j) = ocn_atm_sflx_rain(i,j) * cnt_putatm_ocn + sflx_rain(i,j)
498  ocn_atm_sflx_snow(i,j) = ocn_atm_sflx_snow(i,j) * cnt_putatm_ocn + sflx_snow(i,j)
499  do irgn = i_r_ir, i_r_vis
500  do idir = i_r_direct, i_r_diffuse
501  ocn_atm_sflx_rad_dn(i,j,idir,irgn) = ocn_atm_sflx_rad_dn(i,j,idir,irgn) * cnt_putatm_ocn + sflx_rad_dn(i,j,idir,irgn)
502  enddo
503  enddo
504 
505  ! for land
506  lnd_atm_temp(i,j) = lnd_atm_temp(i,j) * cnt_putatm_lnd + temp(i,j)
507  lnd_atm_pres(i,j) = lnd_atm_pres(i,j) * cnt_putatm_lnd + pres(i,j)
508  lnd_atm_w(i,j) = lnd_atm_w(i,j) * cnt_putatm_lnd + w(i,j)
509  lnd_atm_u(i,j) = lnd_atm_u(i,j) * cnt_putatm_lnd + u(i,j)
510  lnd_atm_v(i,j) = lnd_atm_v(i,j) * cnt_putatm_lnd + v(i,j)
511  lnd_atm_dens(i,j) = lnd_atm_dens(i,j) * cnt_putatm_lnd + dens(i,j)
512  if ( .NOT. atmos_hydrometeor_dry ) &
513  lnd_atm_qv(i,j) = lnd_atm_qv(i,j) * cnt_putatm_lnd + qv(i,j)
514  lnd_atm_pbl(i,j) = lnd_atm_pbl(i,j) * cnt_putatm_lnd + pbl(i,j)
515  lnd_atm_sfc_dens(i,j) = lnd_atm_sfc_dens(i,j) * cnt_putatm_lnd + sfc_dens(i,j)
516  lnd_atm_sfc_pres(i,j) = lnd_atm_sfc_pres(i,j) * cnt_putatm_lnd + sfc_pres(i,j)
517  lnd_atm_cossza(i,j) = lnd_atm_cossza(i,j) * cnt_putatm_lnd + cossza(i,j)
518  lnd_atm_sflx_rain(i,j) = lnd_atm_sflx_rain(i,j) * cnt_putatm_lnd + sflx_rain(i,j)
519  lnd_atm_sflx_snow(i,j) = lnd_atm_sflx_snow(i,j) * cnt_putatm_lnd + sflx_snow(i,j)
520  do irgn = i_r_ir, i_r_vis
521  do idir = i_r_direct, i_r_diffuse
522  lnd_atm_sflx_rad_dn(i,j,idir,irgn) = lnd_atm_sflx_rad_dn(i,j,idir,irgn) * cnt_putatm_lnd + sflx_rad_dn(i,j,idir,irgn)
523  enddo
524  enddo
525 
526  ! for urban
527  urb_atm_temp(i,j) = urb_atm_temp(i,j) * cnt_putatm_urb + temp(i,j)
528  urb_atm_pres(i,j) = urb_atm_pres(i,j) * cnt_putatm_urb + pres(i,j)
529  urb_atm_w(i,j) = urb_atm_w(i,j) * cnt_putatm_urb + w(i,j)
530  urb_atm_u(i,j) = urb_atm_u(i,j) * cnt_putatm_urb + u(i,j)
531  urb_atm_v(i,j) = urb_atm_v(i,j) * cnt_putatm_urb + v(i,j)
532  urb_atm_dens(i,j) = urb_atm_dens(i,j) * cnt_putatm_urb + dens(i,j)
533  if ( .NOT. atmos_hydrometeor_dry ) &
534  urb_atm_qv(i,j) = urb_atm_qv(i,j) * cnt_putatm_urb + qv(i,j)
535  urb_atm_pbl(i,j) = urb_atm_pbl(i,j) * cnt_putatm_urb + pbl(i,j)
536  urb_atm_sfc_dens(i,j) = urb_atm_sfc_dens(i,j) * cnt_putatm_urb + sfc_dens(i,j)
537  urb_atm_sfc_pres(i,j) = urb_atm_sfc_pres(i,j) * cnt_putatm_urb + sfc_pres(i,j)
538  urb_atm_cossza(i,j) = urb_atm_cossza(i,j) * cnt_putatm_urb + cossza(i,j)
539  urb_atm_sflx_rain(i,j) = urb_atm_sflx_rain(i,j) * cnt_putatm_urb + sflx_rain(i,j)
540  urb_atm_sflx_snow(i,j) = urb_atm_sflx_snow(i,j) * cnt_putatm_urb + sflx_snow(i,j)
541  do irgn = i_r_ir, i_r_vis
542  do idir = i_r_direct, i_r_diffuse
543  urb_atm_sflx_rad_dn(i,j,idir,irgn) = urb_atm_sflx_rad_dn(i,j,idir,irgn) * cnt_putatm_urb + sflx_rad_dn(i,j,idir,irgn)
544  enddo
545  enddo
546  enddo
547  enddo
548 
549  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
550  !$omp shared(JS,JE,IS,IE) &
551  !$omp shared(OCN_ATM_TEMP,OCN_ATM_PRES,OCN_ATM_W,OCN_ATM_U,OCN_ATM_V,OCN_ATM_DENS,OCN_ATM_QV) &
552  !$omp shared(OCN_ATM_PBL,OCN_ATM_SFC_DENS,OCN_ATM_SFC_PRES,OCN_ATM_SFLX_rad_dn,OCN_ATM_cosSZA,OCN_ATM_SFLX_rain) &
553  !$omp shared(OCN_ATM_SFLX_snow,CNT_putATM_OCN) &
554  !$omp shared(LND_ATM_TEMP,LND_ATM_PRES,LND_ATM_W,LND_ATM_U,LND_ATM_V,LND_ATM_DENS,LND_ATM_QV) &
555  !$omp shared(LND_ATM_PBL,LND_ATM_SFC_DENS,LND_ATM_SFC_PRES,LND_ATM_SFLX_rad_dn,LND_ATM_cosSZA,LND_ATM_SFLX_rain) &
556  !$omp shared(LND_ATM_SFLX_snow,CNT_putATM_LND) &
557  !$omp shared(URB_ATM_TEMP,URB_ATM_PRES,URB_ATM_W,URB_ATM_U,URB_ATM_V,URB_ATM_DENS,URB_ATM_QV) &
558  !$omp shared(URB_ATM_PBL,URB_ATM_SFC_DENS,URB_ATM_SFC_PRES,URB_ATM_SFLX_rad_dn,URB_ATM_cosSZA,URB_ATM_SFLX_rain) &
559  !$omp shared(URB_ATM_SFLX_snow,CNT_putATM_URB)
560  do j = js, je
561  do i = is, ie
562  ! for ocean
563  ocn_atm_temp(i,j) = ocn_atm_temp(i,j) / ( cnt_putatm_ocn + 1.0_rp )
564  ocn_atm_pres(i,j) = ocn_atm_pres(i,j) / ( cnt_putatm_ocn + 1.0_rp )
565  ocn_atm_w(i,j) = ocn_atm_w(i,j) / ( cnt_putatm_ocn + 1.0_rp )
566  ocn_atm_u(i,j) = ocn_atm_u(i,j) / ( cnt_putatm_ocn + 1.0_rp )
567  ocn_atm_v(i,j) = ocn_atm_v(i,j) / ( cnt_putatm_ocn + 1.0_rp )
568  ocn_atm_dens(i,j) = ocn_atm_dens(i,j) / ( cnt_putatm_ocn + 1.0_rp )
569  ocn_atm_qv(i,j) = ocn_atm_qv(i,j) / ( cnt_putatm_ocn + 1.0_rp )
570  ocn_atm_pbl(i,j) = ocn_atm_pbl(i,j) / ( cnt_putatm_ocn + 1.0_rp )
571  ocn_atm_sfc_dens(i,j) = ocn_atm_sfc_dens(i,j) / ( cnt_putatm_ocn + 1.0_rp )
572  ocn_atm_sfc_pres(i,j) = ocn_atm_sfc_pres(i,j) / ( cnt_putatm_ocn + 1.0_rp )
573  ocn_atm_cossza(i,j) = ocn_atm_cossza(i,j) / ( cnt_putatm_ocn + 1.0_rp )
574  ocn_atm_sflx_rain(i,j) = ocn_atm_sflx_rain(i,j) / ( cnt_putatm_ocn + 1.0_rp )
575  ocn_atm_sflx_snow(i,j) = ocn_atm_sflx_snow(i,j) / ( cnt_putatm_ocn + 1.0_rp )
576  do irgn = i_r_ir, i_r_vis
577  do idir = i_r_direct, i_r_diffuse
578  ocn_atm_sflx_rad_dn(i,j,idir,irgn) = ocn_atm_sflx_rad_dn(i,j,idir,irgn) / ( cnt_putatm_ocn + 1.0_rp )
579  enddo
580  enddo
581 
582  ! for land
583  lnd_atm_temp(i,j) = lnd_atm_temp(i,j) / ( cnt_putatm_lnd + 1.0_rp )
584  lnd_atm_pres(i,j) = lnd_atm_pres(i,j) / ( cnt_putatm_lnd + 1.0_rp )
585  lnd_atm_w(i,j) = lnd_atm_w(i,j) / ( cnt_putatm_lnd + 1.0_rp )
586  lnd_atm_u(i,j) = lnd_atm_u(i,j) / ( cnt_putatm_lnd + 1.0_rp )
587  lnd_atm_v(i,j) = lnd_atm_v(i,j) / ( cnt_putatm_lnd + 1.0_rp )
588  lnd_atm_dens(i,j) = lnd_atm_dens(i,j) / ( cnt_putatm_lnd + 1.0_rp )
589  lnd_atm_qv(i,j) = lnd_atm_qv(i,j) / ( cnt_putatm_lnd + 1.0_rp )
590  lnd_atm_pbl(i,j) = lnd_atm_pbl(i,j) / ( cnt_putatm_lnd + 1.0_rp )
591  lnd_atm_sfc_dens(i,j) = lnd_atm_sfc_dens(i,j) / ( cnt_putatm_lnd + 1.0_rp )
592  lnd_atm_sfc_pres(i,j) = lnd_atm_sfc_pres(i,j) / ( cnt_putatm_lnd + 1.0_rp )
593  lnd_atm_cossza(i,j) = lnd_atm_cossza(i,j) / ( cnt_putatm_lnd + 1.0_rp )
594  lnd_atm_sflx_rain(i,j) = lnd_atm_sflx_rain(i,j) / ( cnt_putatm_lnd + 1.0_rp )
595  lnd_atm_sflx_snow(i,j) = lnd_atm_sflx_snow(i,j) / ( cnt_putatm_lnd + 1.0_rp )
596  do irgn = i_r_ir, i_r_vis
597  do idir = i_r_direct, i_r_diffuse
598  lnd_atm_sflx_rad_dn(i,j,idir,irgn) = lnd_atm_sflx_rad_dn(i,j,idir,irgn) / ( cnt_putatm_lnd + 1.0_rp )
599  enddo
600  enddo
601 
602  ! for urban
603  urb_atm_temp(i,j) = urb_atm_temp(i,j) / ( cnt_putatm_urb + 1.0_rp )
604  urb_atm_pres(i,j) = urb_atm_pres(i,j) / ( cnt_putatm_urb + 1.0_rp )
605  urb_atm_w(i,j) = urb_atm_w(i,j) / ( cnt_putatm_urb + 1.0_rp )
606  urb_atm_u(i,j) = urb_atm_u(i,j) / ( cnt_putatm_urb + 1.0_rp )
607  urb_atm_v(i,j) = urb_atm_v(i,j) / ( cnt_putatm_urb + 1.0_rp )
608  urb_atm_dens(i,j) = urb_atm_dens(i,j) / ( cnt_putatm_urb + 1.0_rp )
609  urb_atm_qv(i,j) = urb_atm_qv(i,j) / ( cnt_putatm_urb + 1.0_rp )
610  urb_atm_pbl(i,j) = urb_atm_pbl(i,j) / ( cnt_putatm_urb + 1.0_rp )
611  urb_atm_sfc_dens(i,j) = urb_atm_sfc_dens(i,j) / ( cnt_putatm_urb + 1.0_rp )
612  urb_atm_sfc_pres(i,j) = urb_atm_sfc_pres(i,j) / ( cnt_putatm_urb + 1.0_rp )
613  urb_atm_cossza(i,j) = urb_atm_cossza(i,j) / ( cnt_putatm_urb + 1.0_rp )
614  urb_atm_sflx_rain(i,j) = urb_atm_sflx_rain(i,j) / ( cnt_putatm_urb + 1.0_rp )
615  urb_atm_sflx_snow(i,j) = urb_atm_sflx_snow(i,j) / ( cnt_putatm_urb + 1.0_rp )
616  do irgn = i_r_ir, i_r_vis
617  do idir = i_r_direct, i_r_diffuse
618  urb_atm_sflx_rad_dn(i,j,idir,irgn) = urb_atm_sflx_rad_dn(i,j,idir,irgn) / ( cnt_putatm_urb + 1.0_rp )
619  enddo
620  enddo
621  enddo
622  enddo
623 
624  if( countup ) then
625  cnt_putatm_ocn = cnt_putatm_ocn + 1.0_rp
626  cnt_putatm_lnd = cnt_putatm_lnd + 1.0_rp
627  cnt_putatm_urb = cnt_putatm_urb + 1.0_rp
628  endif
629 
630  return
631  end subroutine cpl_putatm
632 
633  !-----------------------------------------------------------------------------
634  subroutine cpl_putocn( &
635  SFC_TEMP, &
636  SFC_albedo, &
637  SFC_Z0M, &
638  SFC_Z0H, &
639  SFC_Z0E, &
640  SFLX_MW, &
641  SFLX_MU, &
642  SFLX_MV, &
643  SFLX_SH, &
644  SFLX_LH, &
645  SFLX_G, &
646  SFLX_QTRC, &
647  U10, &
648  V10, &
649  T2, &
650  Q2, &
651  countup )
652  implicit none
653 
654  real(RP), intent(in) :: SFC_TEMP (ia,ja)
655  real(RP), intent(in) :: SFC_albedo(ia,ja,n_rad_dir,n_rad_rgn)
656  real(RP), intent(in) :: SFC_Z0M (ia,ja)
657  real(RP), intent(in) :: SFC_Z0H (ia,ja)
658  real(RP), intent(in) :: SFC_Z0E (ia,ja)
659  real(RP), intent(in) :: SFLX_MW (ia,ja)
660  real(RP), intent(in) :: SFLX_MU (ia,ja)
661  real(RP), intent(in) :: SFLX_MV (ia,ja)
662  real(RP), intent(in) :: SFLX_SH (ia,ja)
663  real(RP), intent(in) :: SFLX_LH (ia,ja)
664  real(RP), intent(in) :: SFLX_G (ia,ja)
665  real(RP), intent(in) :: SFLX_QTRC (ia,ja,qa)
666  real(RP), intent(in) :: U10 (ia,ja)
667  real(RP), intent(in) :: V10 (ia,ja)
668  real(RP), intent(in) :: T2 (ia,ja)
669  real(RP), intent(in) :: Q2 (ia,ja)
670  logical, intent(in) :: countup
671 
672  integer :: i, j, idir, irgn
673  !---------------------------------------------------------------------------
674 
675  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
676  !$omp shared(JS,JE,IS,IE,OCN_SFC_TEMP,OCN_SFC_albedo,OCN_SFC_Z0M,OCN_SFC_Z0H,OCN_SFC_Z0E) &
677  !$omp shared(OCN_SFLX_MW,OCN_SFLX_MU,OCN_SFLX_MV,OCN_SFLX_SH,OCN_SFLX_LH,OCN_SFLX_G,OCN_SFLX_QTRC,OCN_U10,OCN_V10,OCN_T2,OCN_Q2) &
678  !$omp shared(SFC_TEMP,SFC_albedo,SFC_Z0M,SFC_Z0H,SFC_Z0E,SFLX_MW,SFLX_MU,SFLX_MV,SFLX_SH,SFLX_LH,SFLX_G,SFLX_QTRC,U10,V10,T2,Q2) &
679  !$omp shared(CNT_putOCN)
680  do j = js, je
681  do i = is, ie
682  ocn_sfc_temp(i,j) = ocn_sfc_temp(i,j) * cnt_putocn + sfc_temp(i,j)
683  ocn_sfc_z0m(i,j) = ocn_sfc_z0m(i,j) * cnt_putocn + sfc_z0m(i,j)
684  ocn_sfc_z0h(i,j) = ocn_sfc_z0h(i,j) * cnt_putocn + sfc_z0h(i,j)
685  ocn_sfc_z0e(i,j) = ocn_sfc_z0e(i,j) * cnt_putocn + sfc_z0e(i,j)
686  ocn_sflx_mw(i,j) = ocn_sflx_mw(i,j) * cnt_putocn + sflx_mw(i,j)
687  ocn_sflx_mu(i,j) = ocn_sflx_mu(i,j) * cnt_putocn + sflx_mu(i,j)
688  ocn_sflx_mv(i,j) = ocn_sflx_mv(i,j) * cnt_putocn + sflx_mv(i,j)
689  ocn_sflx_sh(i,j) = ocn_sflx_sh(i,j) * cnt_putocn + sflx_sh(i,j)
690  ocn_sflx_lh(i,j) = ocn_sflx_lh(i,j) * cnt_putocn + sflx_lh(i,j)
691  ocn_sflx_g(i,j) = ocn_sflx_g(i,j) * cnt_putocn + sflx_g(i,j)
692  ocn_sflx_qtrc(i,j,:) = ocn_sflx_qtrc(i,j,:) * cnt_putocn + sflx_qtrc(i,j,:)
693  ocn_u10(i,j) = ocn_u10(i,j) * cnt_putocn + u10(i,j)
694  ocn_v10(i,j) = ocn_v10(i,j) * cnt_putocn + v10(i,j)
695  ocn_t2(i,j) = ocn_t2(i,j) * cnt_putocn + t2(i,j)
696  ocn_q2(i,j) = ocn_q2(i,j) * cnt_putocn + q2(i,j)
697  do irgn = i_r_ir, i_r_vis
698  do idir = i_r_direct, i_r_diffuse
699  ocn_sfc_albedo(i,j,idir,irgn) = ocn_sfc_albedo(i,j,idir,irgn) * cnt_putocn + sfc_albedo(i,j,idir,irgn)
700  enddo
701  enddo
702 
703  ocn_sfc_temp(i,j) = ocn_sfc_temp(i,j) / ( cnt_putocn + 1.0_rp )
704  ocn_sfc_z0m(i,j) = ocn_sfc_z0m(i,j) / ( cnt_putocn + 1.0_rp )
705  ocn_sfc_z0h(i,j) = ocn_sfc_z0h(i,j) / ( cnt_putocn + 1.0_rp )
706  ocn_sfc_z0e(i,j) = ocn_sfc_z0e(i,j) / ( cnt_putocn + 1.0_rp )
707  ocn_sflx_mw(i,j) = ocn_sflx_mw(i,j) / ( cnt_putocn + 1.0_rp )
708  ocn_sflx_mu(i,j) = ocn_sflx_mu(i,j) / ( cnt_putocn + 1.0_rp )
709  ocn_sflx_mv(i,j) = ocn_sflx_mv(i,j) / ( cnt_putocn + 1.0_rp )
710  ocn_sflx_sh(i,j) = ocn_sflx_sh(i,j) / ( cnt_putocn + 1.0_rp )
711  ocn_sflx_lh(i,j) = ocn_sflx_lh(i,j) / ( cnt_putocn + 1.0_rp )
712  ocn_sflx_g(i,j) = ocn_sflx_g(i,j) / ( cnt_putocn + 1.0_rp )
713  ocn_sflx_qtrc(i,j,:) = ocn_sflx_qtrc(i,j,:) / ( cnt_putocn + 1.0_rp )
714  ocn_u10(i,j) = ocn_u10(i,j) / ( cnt_putocn + 1.0_rp )
715  ocn_v10(i,j) = ocn_v10(i,j) / ( cnt_putocn + 1.0_rp )
716  ocn_t2(i,j) = ocn_t2(i,j) / ( cnt_putocn + 1.0_rp )
717  ocn_q2(i,j) = ocn_q2(i,j) / ( cnt_putocn + 1.0_rp )
718  do irgn = i_r_ir, i_r_vis
719  do idir = i_r_direct, i_r_diffuse
720  ocn_sfc_albedo(i,j,idir,irgn) = ocn_sfc_albedo(i,j,idir,irgn) / ( cnt_putocn + 1.0_rp )
721  enddo
722  enddo
723  enddo
724  enddo
725 
726  if( countup ) then
727  cnt_putocn = cnt_putocn + 1.0_rp
728  endif
729 
730  return
731  end subroutine cpl_putocn
732 
733  !-----------------------------------------------------------------------------
734  subroutine cpl_putlnd( &
735  SFC_TEMP, &
736  SFC_albedo, &
737  SFC_Z0M, &
738  SFC_Z0H, &
739  SFC_Z0E, &
740  SFLX_MW, &
741  SFLX_MU, &
742  SFLX_MV, &
743  SFLX_SH, &
744  SFLX_LH, &
745  SFLX_G, &
746  SFLX_QTRC, &
747  U10, &
748  V10, &
749  T2, &
750  Q2, &
751  countup )
752  implicit none
753 
754  real(RP), intent(in) :: SFC_TEMP (ia,ja)
755  real(RP), intent(in) :: SFC_albedo(ia,ja,n_rad_dir,n_rad_rgn)
756  real(RP), intent(in) :: SFC_Z0M (ia,ja)
757  real(RP), intent(in) :: SFC_Z0H (ia,ja)
758  real(RP), intent(in) :: SFC_Z0E (ia,ja)
759  real(RP), intent(in) :: SFLX_MW (ia,ja)
760  real(RP), intent(in) :: SFLX_MU (ia,ja)
761  real(RP), intent(in) :: SFLX_MV (ia,ja)
762  real(RP), intent(in) :: SFLX_SH (ia,ja)
763  real(RP), intent(in) :: SFLX_LH (ia,ja)
764  real(RP), intent(in) :: SFLX_G (ia,ja)
765  real(RP), intent(in) :: SFLX_QTRC (ia,ja,qa)
766  real(RP), intent(in) :: U10 (ia,ja)
767  real(RP), intent(in) :: V10 (ia,ja)
768  real(RP), intent(in) :: T2 (ia,ja)
769  real(RP), intent(in) :: Q2 (ia,ja)
770  logical, intent(in) :: countup
771 
772  integer :: i, j, idir, irgn
773  !---------------------------------------------------------------------------
774 
775  !$omp parallel do default(none) &
776  !$omp shared(JS,JE,IS,IE,LND_SFC_TEMP,LND_SFC_albedo,LND_SFC_Z0M,LND_SFC_Z0H,LND_SFC_Z0E) &
777  !$omp shared(LND_SFLX_MW,LND_SFLX_MU,LND_SFLX_MV,LND_SFLX_SH,LND_SFLX_LH,LND_SFLX_G,LND_SFLX_QTRC) &
778  !$omp shared(LND_U10,LND_V10,LND_T2,LND_Q2,CNT_putLND,SFC_TEMP,SFC_albedo,SFC_Z0M,SFC_Z0H) &
779  !$omp shared(SFC_Z0E,SFLX_MW,SFLX_MU,SFLX_MV,SFLX_SH,SFLX_LH,SFLX_G,SFLX_QTRC,U10,V10,T2,Q2) &
780  !$omp private(i,j,idir,irgn) OMP_SCHEDULE_
781  do j = js, je
782  do i = is, ie
783  lnd_sfc_temp(i,j) = lnd_sfc_temp(i,j) * cnt_putlnd + sfc_temp(i,j)
784  lnd_sfc_z0m(i,j) = lnd_sfc_z0m(i,j) * cnt_putlnd + sfc_z0m(i,j)
785  lnd_sfc_z0h(i,j) = lnd_sfc_z0h(i,j) * cnt_putlnd + sfc_z0h(i,j)
786  lnd_sfc_z0e(i,j) = lnd_sfc_z0e(i,j) * cnt_putlnd + sfc_z0e(i,j)
787  lnd_sflx_mw(i,j) = lnd_sflx_mw(i,j) * cnt_putlnd + sflx_mw(i,j)
788  lnd_sflx_mu(i,j) = lnd_sflx_mu(i,j) * cnt_putlnd + sflx_mu(i,j)
789  lnd_sflx_mv(i,j) = lnd_sflx_mv(i,j) * cnt_putlnd + sflx_mv(i,j)
790  lnd_sflx_sh(i,j) = lnd_sflx_sh(i,j) * cnt_putlnd + sflx_sh(i,j)
791  lnd_sflx_lh(i,j) = lnd_sflx_lh(i,j) * cnt_putlnd + sflx_lh(i,j)
792  lnd_sflx_g(i,j) = lnd_sflx_g(i,j) * cnt_putlnd + sflx_g(i,j)
793  lnd_sflx_qtrc(i,j,:) = lnd_sflx_qtrc(i,j,:) * cnt_putlnd + sflx_qtrc(i,j,:)
794  lnd_u10(i,j) = lnd_u10(i,j) * cnt_putlnd + u10(i,j)
795  lnd_v10(i,j) = lnd_v10(i,j) * cnt_putlnd + v10(i,j)
796  lnd_t2(i,j) = lnd_t2(i,j) * cnt_putlnd + t2(i,j)
797  lnd_q2(i,j) = lnd_q2(i,j) * cnt_putlnd + q2(i,j)
798  do irgn = i_r_ir, i_r_vis
799  do idir = i_r_direct, i_r_diffuse
800  lnd_sfc_albedo(i,j,idir,irgn) = lnd_sfc_albedo(i,j,idir,irgn) * cnt_putlnd + sfc_albedo(i,j,idir,irgn)
801  enddo
802  enddo
803 
804  lnd_sfc_temp(i,j) = lnd_sfc_temp(i,j) / ( cnt_putlnd + 1.0_rp )
805  lnd_sfc_z0m(i,j) = lnd_sfc_z0m(i,j) / ( cnt_putlnd + 1.0_rp )
806  lnd_sfc_z0h(i,j) = lnd_sfc_z0h(i,j) / ( cnt_putlnd + 1.0_rp )
807  lnd_sfc_z0e(i,j) = lnd_sfc_z0e(i,j) / ( cnt_putlnd + 1.0_rp )
808  lnd_sflx_mw(i,j) = lnd_sflx_mw(i,j) / ( cnt_putlnd + 1.0_rp )
809  lnd_sflx_mu(i,j) = lnd_sflx_mu(i,j) / ( cnt_putlnd + 1.0_rp )
810  lnd_sflx_mv(i,j) = lnd_sflx_mv(i,j) / ( cnt_putlnd + 1.0_rp )
811  lnd_sflx_sh(i,j) = lnd_sflx_sh(i,j) / ( cnt_putlnd + 1.0_rp )
812  lnd_sflx_lh(i,j) = lnd_sflx_lh(i,j) / ( cnt_putlnd + 1.0_rp )
813  lnd_sflx_g(i,j) = lnd_sflx_g(i,j) / ( cnt_putlnd + 1.0_rp )
814  lnd_sflx_qtrc(i,j,:) = lnd_sflx_qtrc(i,j,:) / ( cnt_putlnd + 1.0_rp )
815  lnd_u10(i,j) = lnd_u10(i,j) / ( cnt_putlnd + 1.0_rp )
816  lnd_v10(i,j) = lnd_v10(i,j) / ( cnt_putlnd + 1.0_rp )
817  lnd_t2(i,j) = lnd_t2(i,j) / ( cnt_putlnd + 1.0_rp )
818  lnd_q2(i,j) = lnd_q2(i,j) / ( cnt_putlnd + 1.0_rp )
819  do irgn = i_r_ir, i_r_vis
820  do idir = i_r_direct, i_r_diffuse
821  lnd_sfc_albedo(i,j,idir,irgn) = lnd_sfc_albedo(i,j,idir,irgn) / ( cnt_putlnd + 1.0_rp )
822  enddo
823  enddo
824  enddo
825  enddo
826 
827  if( countup ) then
828  cnt_putlnd = cnt_putlnd + 1.0_rp
829  endif
830 
831  return
832  end subroutine cpl_putlnd
833 
834  !-----------------------------------------------------------------------------
835  subroutine cpl_puturb( &
836  SFC_TEMP, &
837  SFC_albedo, &
838  SFC_Z0M, &
839  SFC_Z0H, &
840  SFC_Z0E, &
841  SFLX_MW, &
842  SFLX_MU, &
843  SFLX_MV, &
844  SFLX_SH, &
845  SFLX_LH, &
846  SFLX_G, &
847  SFLX_QTRC, &
848  U10, &
849  V10, &
850  T2, &
851  Q2, &
852  countup )
853  implicit none
854 
855  real(RP), intent(in) :: SFC_TEMP (ia,ja)
856  real(RP), intent(in) :: SFC_albedo(ia,ja,n_rad_dir,n_rad_rgn)
857  real(RP), intent(in) :: SFC_Z0M (ia,ja)
858  real(RP), intent(in) :: SFC_Z0H (ia,ja)
859  real(RP), intent(in) :: SFC_Z0E (ia,ja)
860  real(RP), intent(in) :: SFLX_MW (ia,ja)
861  real(RP), intent(in) :: SFLX_MU (ia,ja)
862  real(RP), intent(in) :: SFLX_MV (ia,ja)
863  real(RP), intent(in) :: SFLX_SH (ia,ja)
864  real(RP), intent(in) :: SFLX_LH (ia,ja)
865  real(RP), intent(in) :: SFLX_G (ia,ja)
866  real(RP), intent(in) :: SFLX_QTRC (ia,ja,qa)
867  real(RP), intent(in) :: U10 (ia,ja)
868  real(RP), intent(in) :: V10 (ia,ja)
869  real(RP), intent(in) :: T2 (ia,ja)
870  real(RP), intent(in) :: Q2 (ia,ja)
871  logical, intent(in) :: countup
872 
873  integer :: i, j, idir, irgn
874  !---------------------------------------------------------------------------
875 
876  !$omp parallel do default(none) OMP_SCHEDULE_ &
877  !$omp shared(JS,JE,IS,IE, &
878  !$omp URB_SFC_TEMP,URB_SFC_albedo,URB_SFC_Z0M,URB_SFC_Z0H,URB_SFC_Z0E, &
879  !$omp URB_SFLX_MW,URB_SFLX_MU,URB_SFLX_MV,URB_SFLX_SH,URB_SFLX_LH,URB_SFLX_G,URB_SFLX_QTRC,URB_U10,URB_V10,URB_T2,URB_Q2,CNT_putURB, &
880  !$omp SFC_TEMP,SFC_albedo,SFC_Z0M,SFC_Z0H,SFC_Z0E,SFLX_MW,SFLX_MU,SFLX_MV,SFLX_SH,SFLX_LH,SFLX_G,SFLX_QTRC,U10,V10,T2,Q2)
881  do j = js, je
882  do i = is, ie
883  urb_sfc_temp(i,j) = urb_sfc_temp(i,j) * cnt_puturb + sfc_temp(i,j)
884  urb_sfc_z0m(i,j) = urb_sfc_z0m(i,j) * cnt_puturb + sfc_z0m(i,j)
885  urb_sfc_z0h(i,j) = urb_sfc_z0h(i,j) * cnt_puturb + sfc_z0h(i,j)
886  urb_sfc_z0e(i,j) = urb_sfc_z0e(i,j) * cnt_puturb + sfc_z0e(i,j)
887  urb_sflx_mw(i,j) = urb_sflx_mw(i,j) * cnt_puturb + sflx_mw(i,j)
888  urb_sflx_mu(i,j) = urb_sflx_mu(i,j) * cnt_puturb + sflx_mu(i,j)
889  urb_sflx_mv(i,j) = urb_sflx_mv(i,j) * cnt_puturb + sflx_mv(i,j)
890  urb_sflx_sh(i,j) = urb_sflx_sh(i,j) * cnt_puturb + sflx_sh(i,j)
891  urb_sflx_lh(i,j) = urb_sflx_lh(i,j) * cnt_puturb + sflx_lh(i,j)
892  urb_sflx_g(i,j) = urb_sflx_g(i,j) * cnt_puturb + sflx_g(i,j)
893  urb_sflx_qtrc(i,j,:) = urb_sflx_qtrc(i,j,:) * cnt_puturb + sflx_qtrc(i,j,:)
894  urb_u10(i,j) = urb_u10(i,j) * cnt_puturb + u10(i,j)
895  urb_v10(i,j) = urb_v10(i,j) * cnt_puturb + v10(i,j)
896  urb_t2(i,j) = urb_t2(i,j) * cnt_puturb + t2(i,j)
897  urb_q2(i,j) = urb_q2(i,j) * cnt_puturb + q2(i,j)
898  do irgn = i_r_ir, i_r_vis
899  do idir = i_r_direct, i_r_diffuse
900  urb_sfc_albedo(i,j,idir,irgn) = urb_sfc_albedo(i,j,idir,irgn) * cnt_puturb + sfc_albedo(i,j,idir,irgn)
901  enddo
902  enddo
903 
904  urb_sfc_temp(i,j) = urb_sfc_temp(i,j) / ( cnt_puturb + 1.0_rp )
905  urb_sfc_z0m(i,j) = urb_sfc_z0m(i,j) / ( cnt_puturb + 1.0_rp )
906  urb_sfc_z0h(i,j) = urb_sfc_z0h(i,j) / ( cnt_puturb + 1.0_rp )
907  urb_sfc_z0e(i,j) = urb_sfc_z0e(i,j) / ( cnt_puturb + 1.0_rp )
908  urb_sflx_mw(i,j) = urb_sflx_mw(i,j) / ( cnt_puturb + 1.0_rp )
909  urb_sflx_mu(i,j) = urb_sflx_mu(i,j) / ( cnt_puturb + 1.0_rp )
910  urb_sflx_mv(i,j) = urb_sflx_mv(i,j) / ( cnt_puturb + 1.0_rp )
911  urb_sflx_sh(i,j) = urb_sflx_sh(i,j) / ( cnt_puturb + 1.0_rp )
912  urb_sflx_lh(i,j) = urb_sflx_lh(i,j) / ( cnt_puturb + 1.0_rp )
913  urb_sflx_g(i,j) = urb_sflx_g(i,j) / ( cnt_puturb + 1.0_rp )
914  urb_sflx_qtrc(i,j,:) = urb_sflx_qtrc(i,j,:) / ( cnt_puturb + 1.0_rp )
915  urb_u10(i,j) = urb_u10(i,j) / ( cnt_puturb + 1.0_rp )
916  urb_v10(i,j) = urb_v10(i,j) / ( cnt_puturb + 1.0_rp )
917  urb_t2(i,j) = urb_t2(i,j) / ( cnt_puturb + 1.0_rp )
918  urb_q2(i,j) = urb_q2(i,j) / ( cnt_puturb + 1.0_rp )
919  do irgn = i_r_ir, i_r_vis
920  do idir = i_r_direct, i_r_diffuse
921  urb_sfc_albedo(i,j,idir,irgn) = urb_sfc_albedo(i,j,idir,irgn) / ( cnt_puturb + 1.0_rp )
922  enddo
923  enddo
924  enddo
925  enddo
926 
927  if( countup ) then
928  cnt_puturb = cnt_puturb + 1.0_rp
929  endif
930 
931  return
932  end subroutine cpl_puturb
933 
934  !-----------------------------------------------------------------------------
935  subroutine cpl_getsfc_atm( &
936  SFC_TEMP, &
937  SFC_albedo, &
938  SFC_Z0M, &
939  SFC_Z0H, &
940  SFC_Z0E, &
941  SFLX_MW, &
942  SFLX_MU, &
943  SFLX_MV, &
944  SFLX_SH, &
945  SFLX_LH, &
946  SFLX_G, &
947  SFLX_QTRC, &
948  U10, &
949  V10, &
950  T2, &
951  Q2 )
952  use scale_landuse, only: &
953  fact_ocean => landuse_fact_ocean, &
954  fact_land => landuse_fact_land, &
955  fact_urban => landuse_fact_urban
956  implicit none
957 
958  real(RP), intent(out) :: SFC_TEMP (ia,ja)
959  real(RP), intent(out) :: SFC_albedo(ia,ja,n_rad_dir,n_rad_rgn)
960  real(RP), intent(out) :: SFC_Z0M (ia,ja)
961  real(RP), intent(out) :: SFC_Z0H (ia,ja)
962  real(RP), intent(out) :: SFC_Z0E (ia,ja)
963  real(RP), intent(out) :: SFLX_MW (ia,ja)
964  real(RP), intent(out) :: SFLX_MU (ia,ja)
965  real(RP), intent(out) :: SFLX_MV (ia,ja)
966  real(RP), intent(out) :: SFLX_SH (ia,ja)
967  real(RP), intent(out) :: SFLX_LH (ia,ja)
968  real(RP), intent(out) :: SFLX_G (ia,ja)
969  real(RP), intent(out) :: SFLX_QTRC (ia,ja,qa)
970  real(RP), intent(out) :: U10 (ia,ja)
971  real(RP), intent(out) :: V10 (ia,ja)
972  real(RP), intent(out) :: T2 (ia,ja)
973  real(RP), intent(out) :: Q2 (ia,ja)
974 
975  integer :: i, j, idir, irgn, iq
976  !---------------------------------------------------------------------------
977 
978  !$omp parallel do default(none) &
979  !$omp shared(JS,JE,IS,IE,QA,SFLX_QTRC,SFC_TEMP,SFC_albedo,SFC_Z0M,SFC_Z0H,SFC_Z0E) &
980  !$omp shared(SFLX_MW,SFLX_MU,SFLX_MV,SFLX_SH,SFLX_LH,SFLX_G,U10,V10,T2,Q2) &
981  !$omp shared(fact_ocean,fact_land,fact_urban,OCN_SFC_TEMP,LND_SFC_TEMP,URB_SFC_TEMP,OCN_SFC_albedo) &
982  !$omp shared(LND_SFC_albedo,URB_SFC_albedo,OCN_SFC_Z0M,LND_SFC_Z0M,URB_SFC_Z0M) &
983  !$omp shared(OCN_SFC_Z0H,LND_SFC_Z0H,URB_SFC_Z0H,OCN_SFC_Z0E,LND_SFC_Z0E,URB_SFC_Z0E,OCN_SFLX_MW) &
984  !$omp shared(LND_SFLX_MW,URB_SFLX_MW,OCN_SFLX_MU,LND_SFLX_MU,URB_SFLX_MU,OCN_SFLX_MV,LND_SFLX_MV) &
985  !$omp shared(URB_SFLX_MV,OCN_SFLX_SH,LND_SFLX_SH,URB_SFLX_SH,OCN_SFLX_LH,LND_SFLX_LH,URB_SFLX_LH) &
986  !$omp shared(OCN_SFLX_G,LND_SFLX_G,URB_SFLX_G,OCN_SFLX_QTRC,LND_SFLX_QTRC,URB_SFLX_QTRC,OCN_U10) &
987  !$omp shared(LND_U10,URB_U10,OCN_V10,LND_V10,URB_V10,OCN_T2,LND_T2,URB_T2,OCN_Q2,LND_Q2,URB_Q2) &
988  !$omp private(i,j,iq) OMP_SCHEDULE_
989  do j = js, je
990  do i = is, ie
991  sfc_temp(i,j) = fact_ocean(i,j) * ocn_sfc_temp(i,j) &
992  + fact_land(i,j) * lnd_sfc_temp(i,j) &
993  + fact_urban(i,j) * urb_sfc_temp(i,j)
994 
995  do irgn = i_r_ir, i_r_vis
996  do idir = i_r_direct, i_r_diffuse
997  sfc_albedo(i,j,idir,irgn) = fact_ocean(i,j) * ocn_sfc_albedo(i,j,idir,irgn) &
998  + fact_land(i,j) * lnd_sfc_albedo(i,j,idir,irgn) &
999  + fact_urban(i,j) * urb_sfc_albedo(i,j,idir,irgn)
1000  enddo
1001  enddo
1002 
1003  sfc_z0m(i,j) = fact_ocean(i,j) * ocn_sfc_z0m(i,j) &
1004  + fact_land(i,j) * lnd_sfc_z0m(i,j) &
1005  + fact_urban(i,j) * urb_sfc_z0m(i,j)
1006 
1007  sfc_z0h(i,j) = fact_ocean(i,j) * ocn_sfc_z0h(i,j) &
1008  + fact_land(i,j) * lnd_sfc_z0h(i,j) &
1009  + fact_urban(i,j) * urb_sfc_z0h(i,j)
1010 
1011  sfc_z0e(i,j) = fact_ocean(i,j) * ocn_sfc_z0e(i,j) &
1012  + fact_land(i,j) * lnd_sfc_z0e(i,j) &
1013  + fact_urban(i,j) * urb_sfc_z0e(i,j)
1014 
1015  sflx_mw(i,j) = fact_ocean(i,j) * ocn_sflx_mw(i,j) &
1016  + fact_land(i,j) * lnd_sflx_mw(i,j) &
1017  + fact_urban(i,j) * urb_sflx_mw(i,j)
1018 
1019  sflx_mu(i,j) = fact_ocean(i,j) * ocn_sflx_mu(i,j) &
1020  + fact_land(i,j) * lnd_sflx_mu(i,j) &
1021  + fact_urban(i,j) * urb_sflx_mu(i,j)
1022 
1023  sflx_mv(i,j) = fact_ocean(i,j) * ocn_sflx_mv(i,j) &
1024  + fact_land(i,j) * lnd_sflx_mv(i,j) &
1025  + fact_urban(i,j) * urb_sflx_mv(i,j)
1026 
1027  sflx_sh(i,j) = fact_ocean(i,j) * ocn_sflx_sh(i,j) &
1028  + fact_land(i,j) * lnd_sflx_sh(i,j) &
1029  + fact_urban(i,j) * urb_sflx_sh(i,j)
1030 
1031  sflx_lh(i,j) = fact_ocean(i,j) * ocn_sflx_lh(i,j) &
1032  + fact_land(i,j) * lnd_sflx_lh(i,j) &
1033  + fact_urban(i,j) * urb_sflx_lh(i,j)
1034 
1035  ! SFLX_G is positive for upward, while OCN_SFLX_G, LND_SFLX_G, and URB_SFLX_G is positive for downward
1036  sflx_g(i,j) = - fact_ocean(i,j) * ocn_sflx_g(i,j) &
1037  - fact_land(i,j) * lnd_sflx_g(i,j) &
1038  - fact_urban(i,j) * urb_sflx_g(i,j)
1039 
1040  do iq = 1, qa
1041  sflx_qtrc(i,j,iq) = fact_ocean(i,j) * ocn_sflx_qtrc(i,j,iq) &
1042  + fact_land(i,j) * lnd_sflx_qtrc(i,j,iq) &
1043  + fact_urban(i,j) * urb_sflx_qtrc(i,j,iq)
1044  enddo
1045 
1046  u10(i,j) = fact_ocean(i,j) * ocn_u10(i,j) &
1047  + fact_land(i,j) * lnd_u10(i,j) &
1048  + fact_urban(i,j) * urb_u10(i,j)
1049 
1050  v10(i,j) = fact_ocean(i,j) * ocn_v10(i,j) &
1051  + fact_land(i,j) * lnd_v10(i,j) &
1052  + fact_urban(i,j) * urb_v10(i,j)
1053 
1054  t2(i,j) = fact_ocean(i,j) * ocn_t2(i,j) &
1055  + fact_land(i,j) * lnd_t2(i,j) &
1056  + fact_urban(i,j) * urb_t2(i,j)
1057 
1058  q2(i,j) = fact_ocean(i,j) * ocn_q2(i,j) &
1059  + fact_land(i,j) * lnd_q2(i,j) &
1060  + fact_urban(i,j) * urb_q2(i,j)
1061  enddo
1062  enddo
1063 
1064  cnt_putocn = 0.0_rp
1065  cnt_putlnd = 0.0_rp
1066  cnt_puturb = 0.0_rp
1067 
1068  return
1069  end subroutine cpl_getsfc_atm
1070 
1071  !-----------------------------------------------------------------------------
1072  subroutine cpl_getatm_ocn( &
1073  TEMP, &
1074  PRES, &
1075  W, &
1076  U, &
1077  V, &
1078  DENS, &
1079  QV, &
1080  PBL, &
1081  SFC_DENS, &
1082  SFC_PRES, &
1083  SFLX_rad_dn, &
1084  cosSZA, &
1085  SFLX_rain, &
1086  SFLX_snow )
1087  implicit none
1088 
1089  real(RP), intent(out) :: TEMP (ia,ja)
1090  real(RP), intent(out) :: PRES (ia,ja)
1091  real(RP), intent(out) :: W (ia,ja)
1092  real(RP), intent(out) :: U (ia,ja)
1093  real(RP), intent(out) :: V (ia,ja)
1094  real(RP), intent(out) :: DENS (ia,ja)
1095  real(RP), intent(out) :: QV (ia,ja)
1096  real(RP), intent(out) :: PBL (ia,ja)
1097  real(RP), intent(out) :: SFC_DENS (ia,ja)
1098  real(RP), intent(out) :: SFC_PRES (ia,ja)
1099  real(RP), intent(out) :: SFLX_rad_dn(ia,ja,n_rad_dir,n_rad_rgn)
1100  real(RP), intent(out) :: cosSZA (ia,ja)
1101  real(RP), intent(out) :: SFLX_rain (ia,ja)
1102  real(RP), intent(out) :: SFLX_snow (ia,ja)
1103 
1104  integer :: i, j, idir, irgn
1105  !---------------------------------------------------------------------------
1106 
1107 !OCL XFILL
1108  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
1109  !$omp shared(JS,JE,IS,IE,TEMP,PRES,W,U,V,DENS,QV,PBL,SFC_DENS,SFC_PRES,SFLX_rad_dn,cosSZA,SFLX_rain) &
1110  !$omp shared(SFLX_snow) &
1111  !$omp shared(OCN_ATM_TEMP,OCN_ATM_PRES,OCN_ATM_W,OCN_ATM_U,OCN_ATM_V,OCN_ATM_DENS,OCN_ATM_QV) &
1112  !$omp shared(OCN_ATM_PBL,OCN_ATM_SFC_DENS,OCN_ATM_SFC_PRES,OCN_ATM_SFLX_rad_dn,OCN_ATM_cosSZA,OCN_ATM_SFLX_rain) &
1113  !$omp shared(OCN_ATM_SFLX_snow)
1114  do j = js, je
1115  do i = is, ie
1116  temp(i,j) = ocn_atm_temp(i,j)
1117  pres(i,j) = ocn_atm_pres(i,j)
1118  w(i,j) = ocn_atm_w(i,j)
1119  u(i,j) = ocn_atm_u(i,j)
1120  v(i,j) = ocn_atm_v(i,j)
1121  dens(i,j) = ocn_atm_dens(i,j)
1122  qv(i,j) = ocn_atm_qv(i,j)
1123  pbl(i,j) = ocn_atm_pbl(i,j)
1124  sfc_dens(i,j) = ocn_atm_sfc_dens(i,j)
1125  sfc_pres(i,j) = ocn_atm_sfc_pres(i,j)
1126  cossza(i,j) = ocn_atm_cossza(i,j)
1127  sflx_rain(i,j) = ocn_atm_sflx_rain(i,j)
1128  sflx_snow(i,j) = ocn_atm_sflx_snow(i,j)
1129  do irgn = i_r_ir, i_r_vis
1130  do idir = i_r_direct, i_r_diffuse
1131  sflx_rad_dn(i,j,idir,irgn) = ocn_atm_sflx_rad_dn(i,j,idir,irgn)
1132  enddo
1133  enddo
1134  enddo
1135  enddo
1136 
1137  cnt_putatm_ocn = 0.0_rp
1138 
1139  return
1140  end subroutine cpl_getatm_ocn
1141 
1142  !-----------------------------------------------------------------------------
1143  subroutine cpl_getatm_lnd( &
1144  TEMP, &
1145  PRES, &
1146  W, &
1147  U, &
1148  V, &
1149  DENS, &
1150  QV, &
1151  PBL, &
1152  SFC_DENS, &
1153  SFC_PRES, &
1154  SFLX_rad_dn, &
1155  cosSZA, &
1156  SFLX_rain, &
1157  SFLX_snow )
1158  implicit none
1159 
1160  real(RP), intent(out) :: TEMP (ia,ja)
1161  real(RP), intent(out) :: PRES (ia,ja)
1162  real(RP), intent(out) :: W (ia,ja)
1163  real(RP), intent(out) :: U (ia,ja)
1164  real(RP), intent(out) :: V (ia,ja)
1165  real(RP), intent(out) :: DENS (ia,ja)
1166  real(RP), intent(out) :: QV (ia,ja)
1167  real(RP), intent(out) :: PBL (ia,ja)
1168  real(RP), intent(out) :: SFC_DENS (ia,ja)
1169  real(RP), intent(out) :: SFC_PRES (ia,ja)
1170  real(RP), intent(out) :: SFLX_rad_dn(ia,ja,n_rad_dir,n_rad_rgn)
1171  real(RP), intent(out) :: cosSZA (ia,ja)
1172  real(RP), intent(out) :: SFLX_rain (ia,ja)
1173  real(RP), intent(out) :: SFLX_snow (ia,ja)
1174 
1175  integer :: i, j, idir, irgn
1176  !---------------------------------------------------------------------------
1177 
1178 !OCL XFILL
1179  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
1180  !$omp shared(JS,JE,IS,IE,TEMP,PRES,W,U,V,DENS,QV,PBL,SFC_DENS,SFC_PRES,SFLX_rad_dn,cosSZA,SFLX_rain) &
1181  !$omp shared(SFLX_snow) &
1182  !$omp shared(LND_ATM_TEMP,LND_ATM_PRES,LND_ATM_W,LND_ATM_U,LND_ATM_V,LND_ATM_DENS,LND_ATM_QV) &
1183  !$omp shared(LND_ATM_PBL,LND_ATM_SFC_DENS,LND_ATM_SFC_PRES,LND_ATM_SFLX_rad_dn,LND_ATM_cosSZA,LND_ATM_SFLX_rain) &
1184  !$omp shared(LND_ATM_SFLX_snow)
1185  do j = js, je
1186  do i = is, ie
1187  temp(i,j) = lnd_atm_temp(i,j)
1188  pres(i,j) = lnd_atm_pres(i,j)
1189  w(i,j) = lnd_atm_w(i,j)
1190  u(i,j) = lnd_atm_u(i,j)
1191  v(i,j) = lnd_atm_v(i,j)
1192  dens(i,j) = lnd_atm_dens(i,j)
1193  qv(i,j) = lnd_atm_qv(i,j)
1194  pbl(i,j) = lnd_atm_pbl(i,j)
1195  sfc_dens(i,j) = lnd_atm_sfc_dens(i,j)
1196  sfc_pres(i,j) = lnd_atm_sfc_pres(i,j)
1197  cossza(i,j) = lnd_atm_cossza(i,j)
1198  sflx_rain(i,j) = lnd_atm_sflx_rain(i,j)
1199  sflx_snow(i,j) = lnd_atm_sflx_snow(i,j)
1200  do irgn = i_r_ir, i_r_vis
1201  do idir = i_r_direct, i_r_diffuse
1202  sflx_rad_dn(i,j,idir,irgn) = lnd_atm_sflx_rad_dn(i,j,idir,irgn)
1203  enddo
1204  enddo
1205  enddo
1206  enddo
1207 
1208  cnt_putatm_lnd = 0.0_rp
1209 
1210  return
1211  end subroutine cpl_getatm_lnd
1212 
1213  !-----------------------------------------------------------------------------
1214  subroutine cpl_getatm_urb( &
1215  TEMP, &
1216  PRES, &
1217  W, &
1218  U, &
1219  V, &
1220  DENS, &
1221  QV, &
1222  PBL, &
1223  SFC_DENS, &
1224  SFC_PRES, &
1225  SFLX_rad_dn, &
1226  cosSZA, &
1227  SFLX_rain, &
1228  SFLX_snow )
1229  implicit none
1230 
1231  real(RP), intent(out) :: TEMP (ia,ja)
1232  real(RP), intent(out) :: PRES (ia,ja)
1233  real(RP), intent(out) :: W (ia,ja)
1234  real(RP), intent(out) :: U (ia,ja)
1235  real(RP), intent(out) :: V (ia,ja)
1236  real(RP), intent(out) :: DENS (ia,ja)
1237  real(RP), intent(out) :: QV (ia,ja)
1238  real(RP), intent(out) :: PBL (ia,ja)
1239  real(RP), intent(out) :: SFC_DENS (ia,ja)
1240  real(RP), intent(out) :: SFC_PRES (ia,ja)
1241  real(RP), intent(out) :: SFLX_rad_dn(ia,ja,n_rad_dir,n_rad_rgn)
1242  real(RP), intent(out) :: cosSZA (ia,ja)
1243  real(RP), intent(out) :: SFLX_rain (ia,ja)
1244  real(RP), intent(out) :: SFLX_snow (ia,ja)
1245 
1246  integer :: i, j, idir, irgn
1247  !---------------------------------------------------------------------------
1248 
1249 !OCL XFILL
1250  !$omp parallel do default(none) private(i,j,idir,irgn) OMP_SCHEDULE_ &
1251  !$omp shared(JS,JE,IS,IE,TEMP,PRES,W,U,V,DENS,QV,PBL,SFC_DENS,SFC_PRES,SFLX_rad_dn,cosSZA,SFLX_rain) &
1252  !$omp shared(SFLX_snow) &
1253  !$omp shared(URB_ATM_TEMP,URB_ATM_PRES,URB_ATM_W,URB_ATM_U,URB_ATM_V,URB_ATM_DENS,URB_ATM_QV) &
1254  !$omp shared(URB_ATM_PBL,URB_ATM_SFC_DENS,URB_ATM_SFC_PRES,URB_ATM_SFLX_rad_dn,URB_ATM_cosSZA,URB_ATM_SFLX_rain) &
1255  !$omp shared(URB_ATM_SFLX_snow)
1256  do j = js, je
1257  do i = is, ie
1258  temp(i,j) = urb_atm_temp(i,j)
1259  pres(i,j) = urb_atm_pres(i,j)
1260  w(i,j) = urb_atm_w(i,j)
1261  u(i,j) = urb_atm_u(i,j)
1262  v(i,j) = urb_atm_v(i,j)
1263  dens(i,j) = urb_atm_dens(i,j)
1264  qv(i,j) = urb_atm_qv(i,j)
1265  pbl(i,j) = urb_atm_pbl(i,j)
1266  sfc_dens(i,j) = urb_atm_sfc_dens(i,j)
1267  sfc_pres(i,j) = urb_atm_sfc_pres(i,j)
1268  cossza(i,j) = urb_atm_cossza(i,j)
1269  sflx_rain(i,j) = urb_atm_sflx_rain(i,j)
1270  sflx_snow(i,j) = urb_atm_sflx_snow(i,j)
1271  do irgn = i_r_ir, i_r_vis
1272  do idir = i_r_direct, i_r_diffuse
1273  sflx_rad_dn(i,j,idir,irgn) = urb_atm_sflx_rad_dn(i,j,idir,irgn)
1274  enddo
1275  enddo
1276  enddo
1277  enddo
1278 
1279  cnt_putatm_urb = 0.0_rp
1280 
1281  return
1282  end subroutine cpl_getatm_urb
1283 
1284 end module mod_cpl_vars
module Land admin
module DEBUG
Definition: scale_debug.F90:11
real(rp), dimension(:,:), allocatable, public urb_sflx_g
real(rp), dimension(:,:), allocatable, public lnd_sflx_g
real(rp), dimension(:,:), allocatable, public urb_atm_w
real(rp), dimension(:,:), allocatable, public urb_sflx_mv
real(rp), public cnt_putatm_ocn
real(rp), dimension(:,:,:,:), allocatable, public lnd_sfc_albedo
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
urban factor
real(rp), public cnt_putatm_lnd
real(rp), dimension(:,:), allocatable, public ocn_v10
module coupler / surface-atmospehre
real(rp), dimension(:,:), allocatable, public lnd_sflx_mw
real(rp), dimension(:,:), allocatable, public ocn_atm_w
real(rp), dimension(:,:), allocatable, public ocn_atm_pbl
real(rp), dimension(:,:), allocatable, public ocn_sflx_mv
integer, public ia
of whole cells: x, local, with HALO
real(rp), dimension(:,:), allocatable, public lnd_sfc_temp
real(rp), dimension(:,:), allocatable, public lnd_atm_cossza
integer, parameter, public i_r_vis
real(rp), dimension(:,:), allocatable, public ocn_sflx_lh
real(rp), dimension(:,:), allocatable, public urb_sfc_z0h
logical, public ocean_do
real(rp), dimension(:,:), allocatable, public lnd_atm_dens
real(rp), dimension(:,:), allocatable, public urb_sflx_sh
real(rp), dimension(:,:), allocatable, public ocn_atm_dens
real(rp), dimension(:,:,:), allocatable, public ocn_sflx_qtrc
logical, public lake_do
real(rp), dimension(:,:), allocatable, public lnd_sflx_mv
real(rp), dimension(:,:), allocatable, public ocn_q2
real(rp), dimension(:,:), allocatable, public urb_atm_pres
integer, public qa
integer, public ja
of whole cells: y, local, with HALO
integer, parameter, public n_rad_dir
real(rp), dimension(:,:), allocatable, public ocn_sfc_temp
integer, parameter, public n_rad_rgn
real(rp), dimension(:,:), allocatable, public urb_atm_cossza
real(rp), dimension(:,:), allocatable, public ocn_sfc_z0e
real(rp), dimension(:,:), allocatable, public urb_sfc_z0e
real(rp), dimension(:,:), allocatable, public ocn_atm_sflx_snow
subroutine, public cpl_getsfc_atm(SFC_TEMP, SFC_albedo, SFC_Z0M, SFC_Z0H, SFC_Z0E, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_G, SFLX_QTRC, U10, V10, T2, Q2)
real(rp), dimension(:,:), allocatable, public lnd_atm_temp
real(rp), dimension(:,:), allocatable, public urb_atm_sflx_snow
real(rp), public const_undef
Definition: scale_const.F90:41
real(rp), dimension(:,:), allocatable, public urb_q2
real(rp), dimension(:,:,:), allocatable, public lnd_sflx_qtrc
real(rp), dimension(:,:), allocatable, public ocn_atm_temp
real(rp), dimension(:,:), allocatable, public ocn_sflx_g
real(rp), dimension(:,:), allocatable, public ocn_atm_sfc_dens
real(rp), dimension(:,:), allocatable, public ocn_sfc_z0h
module Lake admin
real(rp), dimension(:,:,:), allocatable, public urb_sflx_qtrc
real(rp), dimension(:,:), allocatable, public urb_atm_sfc_pres
real(rp), dimension(:,:), allocatable, public ocn_t2
integer, public is
start point of inner domain: x, local
real(rp), dimension(:,:), allocatable, public lnd_atm_qv
real(rp), dimension(:,:), allocatable, public lnd_v10
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:,:), allocatable, public ocn_atm_sfc_pres
real(rp), public cnt_putlnd
module TRACER
module atmosphere / hydrometeor
real(rp), dimension(:,:), allocatable, public ocn_atm_qv
real(rp), dimension(:,:), allocatable, public lnd_t2
real(rp), dimension(:,:), allocatable, public lnd_atm_sflx_snow
module LANDUSE
real(rp), dimension(:,:), allocatable, public lnd_atm_v
module atmosphere / grid / cartesC index
real(rp), dimension(:,:), allocatable, public ocn_u10
subroutine, public cpl_vars_setup
Setup.
module COUPLER Variables
real(rp), dimension(:,:), allocatable, public lnd_sfc_z0e
real(rp), dimension(:,:), allocatable, public ocn_sflx_sh
module PROCESS
Definition: scale_prc.F90:11
integer, public je
end point of inner domain: y, local
real(rp), dimension(:,:), allocatable, public ocn_atm_v
real(rp), dimension(:,:), allocatable, public lnd_sfc_z0m
real(rp), dimension(:,:), allocatable, public urb_sfc_z0m
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
subroutine, public cpl_putocn(SFC_TEMP, SFC_albedo, SFC_Z0M, SFC_Z0H, SFC_Z0E, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_G, SFLX_QTRC, U10, V10, T2, Q2, countup)
real(rp), dimension(:,:), allocatable, public lnd_atm_sflx_rain
real(rp), dimension(:,:), allocatable, public ocn_atm_cossza
real(rp), dimension(:,:), allocatable, public lnd_atm_sfc_dens
module Ocean admin
real(rp), dimension(:,:), allocatable, public landuse_fact_lake
lake factor
real(rp), dimension(:,:), allocatable, public ocn_atm_sflx_rain
real(rp), dimension(:,:), allocatable, public ocn_sflx_mw
real(rp), dimension(:,:,:,:), allocatable, public urb_sfc_albedo
real(rp), dimension(:,:), allocatable, public lnd_sflx_lh
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
real(rp), dimension(:,:), allocatable, public lnd_atm_pbl
module CONSTANT
Definition: scale_const.F90:11
real(rp), dimension(:,:), allocatable, public ocn_atm_u
subroutine, public cpl_puturb(SFC_TEMP, SFC_albedo, SFC_Z0M, SFC_Z0H, SFC_Z0E, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_G, SFLX_QTRC, U10, V10, T2, Q2, countup)
integer, public js
start point of inner domain: y, local
integer, parameter, public i_r_direct
real(rp), dimension(:,:,:,:), allocatable, public lnd_atm_sflx_rad_dn
real(rp), dimension(:,:), allocatable, public urb_atm_v
real(rp), dimension(:,:), allocatable, public urb_t2
real(rp), dimension(:,:), allocatable, public urb_sflx_lh
real(rp), dimension(:,:), allocatable, public lnd_u10
real(rp), dimension(:,:), allocatable, public urb_atm_pbl
real(rp), dimension(:,:), allocatable, public lnd_atm_sfc_pres
real(rp), dimension(:,:), allocatable, public lnd_sflx_mu
module profiler
Definition: scale_prof.F90:11
real(rp), dimension(:,:,:,:), allocatable, public ocn_atm_sflx_rad_dn
subroutine, public cpl_putlnd(SFC_TEMP, SFC_albedo, SFC_Z0M, SFC_Z0H, SFC_Z0E, SFLX_MW, SFLX_MU, SFLX_MV, SFLX_SH, SFLX_LH, SFLX_G, SFLX_QTRC, U10, V10, T2, Q2, countup)
real(rp), dimension(:,:), allocatable, public lnd_atm_pres
subroutine, public cpl_getatm_lnd(TEMP, PRES, W, U, V, DENS, QV, PBL, SFC_DENS, SFC_PRES, SFLX_rad_dn, cosSZA, SFLX_rain, SFLX_snow)
real(rp), dimension(:,:), allocatable, public lnd_q2
subroutine, public cpl_putatm(TEMP, PRES, W, U, V, DENS, QV, PBL, SFC_DENS, SFC_PRES, SFLX_rad_dn, cosSZA, SFLX_rain, SFLX_snow, countup)
real(rp), dimension(:,:), allocatable, public urb_atm_qv
real(rp), dimension(:,:), allocatable, public urb_u10
real(rp), dimension(:,:), allocatable, public urb_atm_sflx_rain
real(rp), dimension(:,:), allocatable, public urb_atm_dens
real(rp), dimension(:,:,:,:), allocatable, public ocn_sfc_albedo
module PRECISION
real(rp), dimension(:,:), allocatable, public urb_atm_sfc_dens
real(rp), dimension(:,:), allocatable, public ocn_atm_pres
real(rp), dimension(:,:), allocatable, public lnd_atm_u
real(rp), dimension(:,:), allocatable, public lnd_atm_w
real(rp), dimension(:,:), allocatable, public urb_v10
integer, parameter, public i_r_ir
module STDIO
Definition: scale_io.F90:10
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
integer, parameter, public i_r_diffuse
real(rp), dimension(:,:), allocatable, public urb_sfc_temp
module Urban admin
logical, public urban_do
real(rp), dimension(:,:), allocatable, public lnd_sflx_sh
subroutine, public cpl_getatm_urb(TEMP, PRES, W, U, V, DENS, QV, PBL, SFC_DENS, SFC_PRES, SFLX_rad_dn, cosSZA, SFLX_rain, SFLX_snow)
real(rp), public cnt_puturb
real(rp), dimension(:,:), allocatable, public urb_sflx_mw
logical, public land_do
real(rp), dimension(:,:), allocatable, public lnd_sfc_z0h
real(rp), dimension(:,:), allocatable, public ocn_sflx_mu
subroutine, public cpl_getatm_ocn(TEMP, PRES, W, U, V, DENS, QV, PBL, SFC_DENS, SFC_PRES, SFLX_rad_dn, cosSZA, SFLX_rain, SFLX_snow)
real(rp), public cnt_putocn
real(rp), dimension(:,:), allocatable, public urb_sflx_mu
real(rp), dimension(:,:), allocatable, public ocn_sfc_z0m
real(rp), dimension(:,:), allocatable, public urb_atm_temp
real(rp), dimension(:,:), allocatable, public urb_atm_u
real(rp), dimension(:,:,:,:), allocatable, public urb_atm_sflx_rad_dn
real(rp), public cnt_putatm_urb