40 private :: canopy_wind
44 private :: multi_layer
45 private :: urban_param_setup
46 private :: read_urban_param_table
47 private :: read_urban_gridded_data_2d
48 private :: read_urban_gridded_data_3d
57 real(RP),
private :: DTS_MAX = 0.1_rp
59 integer ,
private :: BOUND = 1
63 real(RP),
private :: ZR = 10.0_rp
64 real(RP),
private :: roof_width = 9.0_rp
65 real(RP),
private :: road_width = 11.0_rp
66 real(RP),
private :: SIGMA_ZED = 1.0_rp
67 real(RP),
private :: AH_TBL = 17.5_rp
68 real(RP),
private :: AHL_TBL = 0.0_rp
69 real(RP),
private :: BETR = 0.0_rp
70 real(RP),
private :: BETB = 0.0_rp
71 real(RP),
private :: BETG = 0.0_rp
72 real(RP),
private :: STRGR = 0.0_rp
73 real(RP),
private :: STRGB = 0.0_rp
74 real(RP),
private :: STRGG = 0.0_rp
75 real(RP),
private :: CAPR = 1.2e6_rp
76 real(RP),
private :: CAPB = 1.2e6_rp
77 real(RP),
private :: CAPG = 1.2e6_rp
78 real(RP),
private :: AKSR = 2.28_rp
79 real(RP),
private :: AKSB = 2.28_rp
80 real(RP),
private :: AKSG = 2.28_rp
81 real(RP),
private :: ALBR = 0.2_rp
82 real(RP),
private :: ALBB = 0.2_rp
83 real(RP),
private :: ALBG = 0.2_rp
84 real(RP),
private :: EPSR = 0.90_rp
85 real(RP),
private :: EPSB = 0.90_rp
86 real(RP),
private :: EPSG = 0.90_rp
87 real(RP),
private :: Z0R = 0.01_rp
88 real(RP),
private :: Z0B = 0.0001_rp
89 real(RP),
private :: Z0G = 0.01_rp
90 real(RP),
private :: TRLEND = 293.00_rp
91 real(RP),
private :: TBLEND = 293.00_rp
92 real(RP),
private :: TGLEND = 293.00_rp
94 real(RP),
private :: ahdiurnal(1:24)
97 real(RP),
private :: R
98 real(RP),
private :: RW
99 real(RP),
private :: HGT
100 real(RP),
private :: Z0HR
101 real(RP),
private :: Z0HB
102 real(RP),
private :: Z0HG
103 real(RP),
private :: Z0C_TBL
104 real(RP),
private :: Z0HC_TBL
105 real(RP),
private :: ZDC_TBL
106 real(RP),
private :: SVF
108 real(RP),
private :: XXXR = 0.0_rp
109 real(RP),
private :: XXXC = 0.0_rp
112 integer,
private :: I_SHR, I_SHB, I_SHG
113 integer,
private :: I_LHR, I_LHB, I_LHG
114 integer,
private :: I_GHR, I_GHB, I_GHG
115 integer,
private :: I_RNR, I_RNB, I_RNG, I_RNgrd
122 UIA, UIS, UIE, UJA, UJS, UJE, &
124 Z0M, Z0H, Z0E, ZD, AH_URB, AHL_URB )
134 integer,
intent(in) :: uia, uis, uie
135 integer,
intent(in) :: uja, ujs, uje
136 real(rp),
intent(in) :: fact_urban(uia,uja)
137 real(rp),
intent(out) :: z0m(uia,uja)
138 real(rp),
intent(out) :: z0h(uia,uja)
139 real(rp),
intent(out) :: z0e(uia,uja)
140 real(rp),
intent(out) :: zd (uia,uja)
141 real(rp),
intent(out) :: ah_urb (uia,uja,1:24)
142 real(rp),
intent(out) :: ahl_urb (uia,uja,1:24)
144 character(len=H_LONG) :: urban_dyn_kusaka01_param_in_filename =
''
145 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_z0m_in_filename =
''
146 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_z0m_in_varname =
'URBAN_Z0M'
147 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_z0h_in_filename =
''
148 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_z0h_in_varname =
'URBAN_Z0H'
151 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_ah_in_filename =
''
152 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_ah_in_varname =
'URBAN_AH'
153 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_ahl_in_filename =
''
154 character(len=H_LONG) :: urban_dyn_kusaka01_gridded_ahl_in_varname =
'URBAN_AHL'
156 namelist / param_urban_dyn_kusaka01 / &
159 urban_dyn_kusaka01_param_in_filename, &
160 urban_dyn_kusaka01_gridded_z0m_in_filename, &
161 urban_dyn_kusaka01_gridded_z0h_in_filename, &
163 urban_dyn_kusaka01_gridded_ah_in_filename, &
164 urban_dyn_kusaka01_gridded_ahl_in_filename
166 real(rp) :: udata(uia,uja)
167 real(rp) :: udata2(uia,uja,24)
174 log_info(
"URBAN_DYN_kusaka01_setup",*)
'Setup'
178 read(
io_fid_conf,nml=param_urban_dyn_kusaka01,iostat=ierr)
180 log_info(
"URBAN_DYN_kusaka01_setup",*)
'Not found namelist. Default used.'
181 elseif( ierr > 0 )
then
182 log_error(
"URBAN_DYN_kusaka01_setup",*)
'Not appropriate names in namelist PARAM_URBAN_DYN_KUSAKA01. Check!'
185 log_nml(param_urban_dyn_kusaka01)
188 if( urban_dyn_kusaka01_param_in_filename /=
'' )
then
189 call read_urban_param_table( trim(urban_dyn_kusaka01_param_in_filename) )
193 call urban_param_setup
195 ahdiurnal(:) = (/ 0.356, 0.274, 0.232, 0.251, 0.375, 0.647, 0.919, 1.135, 1.249, 1.328, &
196 1.365, 1.363, 1.375, 1.404, 1.457, 1.526, 1.557, 1.521, 1.372, 1.206, &
197 1.017, 0.876, 0.684, 0.512 /)
206 ah_urb(i,j,k) = ah_tbl * ahdiurnal(k) * fact_urban(i,j)
207 ahl_urb(i,j,k) = ahl_tbl * ahdiurnal(k) * fact_urban(i,j)
213 if( urban_dyn_kusaka01_gridded_z0m_in_filename /=
'' )
then
215 call read_urban_gridded_data_2d( &
217 urban_dyn_kusaka01_gridded_z0m_in_filename, &
218 urban_dyn_kusaka01_gridded_z0m_in_varname, &
224 if( udata(i,j) /= undef )
then
225 if ( udata(i,j) > 0.0_rp )
then
226 z0m(i,j) = udata(i,j)
227 else if ( udata(i,j) < 0.0_rp )
then
228 log_error(
"URBAN_DYN_kusaka01_setup",*)
'Gridded Z0M data includes data less than 0. Please check data!',i,j
231 log_warn(
"URBAN_DYN_kusaka01_setup",*)
'Gridded Z0M data includes 0; default or table value is used to avoid zero division',
prc_myrank,i,j
239 if( urban_dyn_kusaka01_gridded_z0h_in_filename /=
'' )
then
241 call read_urban_gridded_data_2d( &
243 urban_dyn_kusaka01_gridded_z0h_in_filename, &
244 urban_dyn_kusaka01_gridded_z0h_in_varname, &
250 if( udata(i,j) /= undef )
then
251 if ( udata(i,j) > 0.0_rp )
then
252 z0h(i,j) = udata(i,j)
253 z0e(i,j) = udata(i,j)
254 else if ( udata(i,j) < 0.0_rp )
then
255 log_error(
"URBAN_DYN_kusaka01_setup",*)
'Gridded Z0H data includes data less than 0. Please check data!',i,j
258 log_warn(
"URBAN_DYN_kusaka01_setup",*)
'Gridded Z0H data includes 0; default or table value is used to avoid zero division',
prc_myrank,i,j
291 if( urban_dyn_kusaka01_gridded_ah_in_filename /=
'' )
then
293 call read_urban_gridded_data_3d( &
295 urban_dyn_kusaka01_gridded_ah_in_filename, &
296 urban_dyn_kusaka01_gridded_ah_in_varname, &
303 if( udata2(i,j,k) /= undef )
then
304 ah_urb(i,j,k) = udata2(i,j,k)
312 if( urban_dyn_kusaka01_gridded_ahl_in_filename /=
'' )
then
314 call read_urban_gridded_data_3d( &
316 urban_dyn_kusaka01_gridded_ahl_in_filename, &
317 urban_dyn_kusaka01_gridded_ahl_in_varname, &
324 if( udata2(i,j,k) /= undef )
then
325 ahl_urb(i,j,k) = udata2(i,j,k)
332 call file_history_reg(
'URBAN_SHR',
'urban sensible heat flux on roof',
'W/m2', i_shr , ndims=2 )
333 call file_history_reg(
'URBAN_SHB',
'urban sensible heat flux on wall',
'W/m2', i_shb , ndims=2 )
334 call file_history_reg(
'URBAN_SHG',
'urban sensible heat flux on road',
'W/m2', i_shg , ndims=2 )
335 call file_history_reg(
'URBAN_LHR',
'urban latent heat flux on roof',
'W/m2', i_lhr , ndims=2 )
336 call file_history_reg(
'URBAN_LHB',
'urban latent heat flux on wall',
'W/m2', i_lhb , ndims=2 )
337 call file_history_reg(
'URBAN_LHG',
'urban latent heat flux on road',
'W/m2', i_lhg , ndims=2 )
338 call file_history_reg(
'URBAN_GHR',
'urban ground heat flux on roof',
'W/m2', i_ghr , ndims=2 )
339 call file_history_reg(
'URBAN_GHB',
'urban ground heat flux on wall',
'W/m2', i_ghb , ndims=2 )
340 call file_history_reg(
'URBAN_GHG',
'urban ground heat flux on road',
'W/m2', i_ghg , ndims=2 )
341 call file_history_reg(
'URBAN_RNR',
'urban net radiation on roof',
'W/m2', i_rnr , ndims=2 )
342 call file_history_reg(
'URBAN_RNB',
'urban net radiation on wall',
'W/m2', i_rnb , ndims=2 )
343 call file_history_reg(
'URBAN_RNG',
'urban net radiation on road',
'W/m2', i_rng , ndims=2 )
344 call file_history_reg(
'URBAN_RNgrd',
'urban grid average of net radiation',
'W/m2', i_rngrd, ndims=2 )
353 UKA, UKS, UKE, UIA, UIS, UIE, UJA, UJS, UJE, &
367 TRL_URB, TBL_URB, TGL_URB, &
368 TR_URB, TB_URB, TG_URB, &
369 TC_URB, QC_URB, UC_URB, &
370 RAINR_URB, RAINB_URB, RAING_URB, &
374 MWFLX, MUFLX, MVFLX, &
375 SHFLX, LHFLX, GHFLX, &
376 Ustar, Tstar, Qstar, Wstar, &
385 qsat => atmos_saturation_dens2qsat_all
390 integer,
intent(in) :: uka, uks, uke
391 integer,
intent(in) :: uia, uis, uie
392 integer,
intent(in) :: uja, ujs, uje
394 real(rp),
intent(in) :: tmpa(uia,uja)
395 real(rp),
intent(in) :: prsa(uia,uja)
396 real(rp),
intent(in) :: u1 (uia,uja)
397 real(rp),
intent(in) :: v1 (uia,uja)
398 real(rp),
intent(in) :: dens(uia,uja)
399 real(rp),
intent(in) :: qa (uia,uja)
400 real(rp),
intent(in) :: lhv (uia,uja)
401 real(rp),
intent(in) :: z1 (uia,uja)
402 real(rp),
intent(in) :: pbl (uia,uja)
403 real(rp),
intent(in) :: rhos(uia,uja)
404 real(rp),
intent(in) :: prss(uia,uja)
405 real(rp),
intent(in) :: lwd (uia,uja,2)
406 real(rp),
intent(in) :: swd (uia,uja,2)
407 real(rp),
intent(in) :: rain(uia,uja)
408 real(rp),
intent(in) :: eflx(uia,uja)
409 real(rp),
intent(in) :: z0m (uia,uja)
410 real(rp),
intent(in) :: z0h (uia,uja)
411 real(rp),
intent(in) :: z0e (uia,uja)
412 real(rp),
intent(in) :: zd (uia,uja)
413 real(rp),
intent(in) :: cdz(uka)
414 real(rp),
intent(in) :: tansl_x(uia,uja)
415 real(rp),
intent(in) :: tansl_y(uia,uja)
416 real(rp),
intent(in) :: fact_urban(uia,uja)
417 real(
dp),
intent(in) :: dt
419 real(rp),
intent(inout) :: tr_urb (uia,uja)
420 real(rp),
intent(inout) :: tb_urb (uia,uja)
421 real(rp),
intent(inout) :: tg_urb (uia,uja)
422 real(rp),
intent(inout) :: tc_urb (uia,uja)
423 real(rp),
intent(inout) :: qc_urb (uia,uja)
424 real(rp),
intent(inout) :: uc_urb (uia,uja)
425 real(rp),
intent(inout) :: trl_urb (uks:uke,uia,uja)
426 real(rp),
intent(inout) :: tbl_urb (uks:uke,uia,uja)
427 real(rp),
intent(inout) :: tgl_urb (uks:uke,uia,uja)
428 real(rp),
intent(inout) :: rainr_urb(uia,uja)
429 real(rp),
intent(inout) :: rainb_urb(uia,uja)
430 real(rp),
intent(inout) :: raing_urb(uia,uja)
431 real(rp),
intent(out) :: roff_urb (uia,uja)
433 real(rp),
intent(out) :: sfc_temp(uia,uja)
435 real(rp),
intent(out) :: mwflx (uia,uja)
436 real(rp),
intent(out) :: muflx (uia,uja)
437 real(rp),
intent(out) :: mvflx (uia,uja)
438 real(rp),
intent(out) :: shflx (uia,uja)
439 real(rp),
intent(out) :: lhflx (uia,uja)
440 real(rp),
intent(out) :: ghflx (uia,uja)
441 real(rp),
intent(out) :: ustar (uia,uja)
442 real(rp),
intent(out) :: tstar (uia,uja)
443 real(rp),
intent(out) :: qstar (uia,uja)
444 real(rp),
intent(out) :: wstar (uia,uja)
445 real(rp),
intent(out) :: rlmo (uia,uja)
446 real(rp),
intent(out) :: u10 (uia,uja)
447 real(rp),
intent(out) :: v10 (uia,uja)
448 real(rp),
intent(out) :: t2 (uia,uja)
449 real(rp),
intent(out) :: q2 (uia,uja)
453 logical,
parameter :: lsolar = .false.
455 real(rp),
parameter :: uabs_min = 0.1_rp
464 real(rp) :: trl(uks:uke)
465 real(rp) :: tbl(uks:uke)
466 real(rp) :: tgl(uks:uke)
473 real(rp) :: shr (uia,uja)
474 real(rp) :: shb (uia,uja)
475 real(rp) :: shg (uia,uja)
476 real(rp) :: lhr (uia,uja)
477 real(rp) :: lhb (uia,uja)
478 real(rp) :: lhg (uia,uja)
479 real(rp) :: ghr (uia,uja)
480 real(rp) :: ghb (uia,uja)
481 real(rp) :: ghg (uia,uja)
482 real(rp) :: rnr (uia,uja)
483 real(rp) :: rnb (uia,uja)
484 real(rp) :: rng (uia,uja)
485 real(rp) :: rngrd(uia,uja)
509 log_progress(*)
'urban / dynamics / Kusaka01'
518 if( fact_urban(i,j) > 0.0_rp )
then
523 w = u1(i,j) * tansl_x(i,j) + v1(i,j) * tansl_y(i,j)
524 uabs = sqrt( u1(i,j)**2 + v1(i,j)**2 + w**2 )
535 trl(k) = trl_urb(k,i,j)
536 tbl(k) = tbl_urb(k,i,j)
537 tgl(k) = tgl_urb(k,i,j)
540 rainr = rainr_urb(i,j)
541 rainb = rainb_urb(i,j)
542 raing = raing_urb(i,j)
544 call slc_main( uka, uks, uke, uia, uis, uie, uja, ujs, uje, &
600 dzr(:), dzg(:), dzb(:), &
612 trl_urb(k,i,j) = trl(k)
613 tbl_urb(k,i,j) = tbl(k)
614 tgl_urb(k,i,j) = tgl(k)
616 rainr_urb(i,j) = rainr
617 rainb_urb(i,j) = rainb
618 raing_urb(i,j) = raing
630 call qsat( sfc_temp(i,j), rhos(i,j), &
633 call bulkflux( tmpa(i,j), sfc_temp(i,j), &
634 prsa(i,j), prss(i,j), &
636 uabs, z1(i,j), pbl(i,j), &
637 z0m(i,j), z0h(i,j), z0e(i,j), &
638 ustar(i,j), tstar(i,j), qstar(i,j), &
639 wstar(i,j), rlmo(i,j), ra, &
640 fracu10, fract2, fracq2 )
642 if ( uabs < eps )
then
647 mflux = - rhos(i,j) * ustar(i,j)**2
648 mwflx(i,j) = mflux * w / uabs
649 muflx(i,j) = mflux * u1(i,j) / uabs
650 mvflx(i,j) = mflux * v1(i,j) / uabs
654 sfc_temp(i,j) = undef
655 albedo(i,j,:,:) = undef
690 shr(:,:), shb(:,:), shg(:,:), &
691 lhr(:,:), lhb(:,:), lhg(:,:), &
692 ghr(:,:), ghb(:,:), ghg(:,:), &
693 rnr(:,:), rnb(:,:), rng(:,:), &
700 subroutine slc_main( &
701 UKA, UKS, UKE, UIA, UIS, UIE, UJA, UJS, UJE, &
765 karman => const_karman, &
766 cpdry => const_cpdry, &
767 grav => const_grav, &
768 rdry => const_rdry, &
769 rvap => const_rvap, &
771 tem00 => const_tem00, &
774 hydrometeor_lhv => atmos_hydrometeor_lhv
776 qsat => atmos_saturation_dens2qsat_all
779 bulkflux_diagnose_surface
782 integer,
intent(in) :: uka, uks, uke
783 integer,
intent(in) :: uia, uis, uie
784 integer,
intent(in) :: uja, ujs, uje
787 logical ,
intent(in) :: lsolar
790 real(rp),
intent(in) :: prsa
791 real(rp),
intent(in) :: prss
792 real(rp),
intent(in) :: ta
793 real(rp),
intent(in) :: rhos
794 real(rp),
intent(in) :: qa
795 real(rp),
intent(in) :: ua
796 real(rp),
intent(in) :: u1
797 real(rp),
intent(in) :: v1
798 real(rp),
intent(in) :: lhv
799 real(rp),
intent(in) :: za
800 real(rp),
intent(in) :: ssg(2)
801 real(rp),
intent(in) :: llg(2)
802 real(rp),
intent(in) :: rain
803 real(rp),
intent(in) :: eflx
804 real(rp),
intent(in) :: rhoo
805 real(rp),
intent(in) :: z0c
806 real(rp),
intent(in) :: z0hc
807 real(rp),
intent(in) :: zdc
808 real(rp),
intent(in) :: dzr(uka)
809 real(rp),
intent(in) :: dzb(uka)
810 real(rp),
intent(in) :: dzg(uka)
811 real(
dp),
intent(in) :: dt
814 real(rp),
intent(inout) :: trl(uks:uke)
815 real(rp),
intent(inout) :: tbl(uks:uke)
816 real(rp),
intent(inout) :: tgl(uks:uke)
817 real(rp),
intent(inout) :: tr
818 real(rp),
intent(inout) :: tb
819 real(rp),
intent(inout) :: tg
820 real(rp),
intent(inout) :: tc
821 real(rp),
intent(inout) :: qc
822 real(rp),
intent(inout) :: uc
823 real(rp),
intent(inout) :: rainr
824 real(rp),
intent(inout) :: rainb
825 real(rp),
intent(inout) :: raing
826 real(rp),
intent(out) :: roff
829 real(rp),
intent(out) :: albd_sw_grid
830 real(rp),
intent(out) :: albd_lw_grid
831 real(rp),
intent(out) :: rts
832 real(rp),
intent(out) :: sh
833 real(rp),
intent(out) :: lh
834 real(rp),
intent(out) :: ghflx
835 real(rp),
intent(out) :: rn
836 real(rp),
intent(out) :: u10
837 real(rp),
intent(out) :: v10
838 real(rp),
intent(out) :: t2
839 real(rp),
intent(out) :: q2
840 real(rp),
intent(out) :: rnr, rnb, rng
841 real(rp),
intent(out) :: shr, shb, shg
842 real(rp),
intent(out) :: lhr, lhb, lhg
843 real(rp),
intent(out) :: ghr, ghb, ghg
844 integer ,
intent(in) :: i, j
850 real(rp),
parameter :: redf_min = 1.0e-2_rp
851 real(rp),
parameter :: redf_max = 1.0_rp
863 real(rp) :: w, vfgs, vfgw, vfwg, vfws, vfww
864 real(rp) :: rflux_sw, rflux_lw
871 real(rp) :: trlp(uks:uke)
872 real(rp) :: tblp(uks:uke)
873 real(rp) :: tglp(uks:uke)
882 real(rp) :: roffr, roffb, roffg
884 real(rp) :: lup, ldn, rup
887 real(rp) :: lnet, snet, flxuv
890 real(rp) :: psim,psim2,psim10
891 real(rp) :: psih,psih2,psih10
900 real(rp) :: sr, sb, sg, rr, rb, rg
901 real(rp) :: sr1, sb1, sb2, sg1, sg2
902 real(rp) :: rb1, rb2, rg1, rg2
903 real(rp) :: hr, eler, g0r
904 real(rp) :: hb, eleb, g0b
905 real(rp) :: hg, eleg, g0g
908 real(rp) :: qs0r, qs0b, qs0g
910 real(rp) :: ribr, bhr, cdr
911 real(rp) :: ribc, bhc, cdc
912 real(rp) :: alphab, alphag, alphac
913 real(rp) :: chr, chb, chg, chc
914 real(rp) :: tc1, tc2, qc1, qc2
917 real(rp) :: dts_max_onestep = 0.0_rp
918 real(rp) :: resi1,resi2
919 real(rp) :: resi1p,resi2p
920 real(rp) :: g0rp,g0bp,g0gp
922 real(rp) :: xxx, xxx2, xxx10
923 real(rp) :: tha,thc,ths,ths1,ths2
928 real(rp) :: fracu10, fract2
937 tha = ta * ( pre00 / prsa )**rovcp
957 dts_max_onestep = dts_max * dt
959 if ( zdc + z0c + 2.0_rp >= za )
then
960 log_error(
"URBAN_DYN_kusaka01_SLC_main",*)
'ZDC + Z0C + 2m must be less than the 1st level! STOP.'
966 w = 2.0_rp * 1.0_rp * hgt
969 vfwg = ( 1.0_rp - svf ) * ( 1.0_rp - r ) / w
971 vfww = 1.0_rp - 2.0_rp * vfwg
973 rflux_sw = ssg(1) + ssg(2)
974 rflux_lw = llg(1) + llg(2)
981 call canopy_wind(za, ua, z0c, zdc, uc)
988 raint = 1.0_rp * ( rain * dt )
989 call cal_beta(betr, raint, rainr, strgr, roffr)
991 raint = 0.1_rp * ( rain * dt )
992 call cal_beta(betb, raint, rainb, strgb, roffb)
994 raint = 0.9_rp * ( rain * dt )
995 call cal_beta(betg, raint, raing, strgg, roffg)
997 roff = ( r * roffr + rw * ( roffb + roffg ) ) / dt
1003 if( rflux_sw > 0.0_rp )
then
1008 sr1 = rflux_sw * ( 1.0_rp - albr )
1009 sg1 = rflux_sw * vfgs * ( 1.0_rp - albg )
1010 sb1 = rflux_sw * vfws * ( 1.0_rp - albb )
1011 sg2 = sb1 * albb / ( 1.0_rp - albb ) * vfgw * ( 1.0_rp - albg )
1012 sb2 = sg1 * albg / ( 1.0_rp - albg ) * vfwg * ( 1.0_rp - albb )
1017 snet = r * sr + w * sb + rw * sg
1029 exn = ( prss / pre00 )**rovcp
1046 do iteration = 1, 100
1051 bhr = log(z0r/z0hr) / 0.4_rp
1052 ribr = ( grav * 2.0_rp / (tha+ths) ) * (tha-ths) * (z+z0r) / (ua*ua+eps)
1053 call mos(xxxr,chr,cdr,bhr,ribr,z,z0r,ua,tha,ths,rhoo)
1055 call qsat( tr, rhos, &
1060 rr = epsr * ( rflux_lw - stb * (tr**4) )
1062 hr = rhoo * cpdry * chr * ua * (ths-tha) * exn
1063 eler = min( rhoo * chr * ua * betr * (qs0r-qa), real(rainr/dt,rp) ) * lhv
1064 g0r = sr + rr - hr - eler
1078 call multi_layer(uke,bound,g0r,capr,aksr,trl,dzr,dt,trlend)
1083 if( abs(resi1) < sqrt(eps) )
then
1085 tr = max( trp - dts_max_onestep, min( trp + dts_max_onestep, tr ) )
1089 if ( resi1*resi1p < 0.0_rp )
then
1090 tr = (tr + trl(1)) * 0.5_rp
1094 tr = max( trp - dts_max_onestep, min( trp + dts_max_onestep, tr ) )
1107 if ( iteration > 100 )
then
1108 log_warn(
"URBAN_DYN_kusaka01_SLC_main",*)
'iteration for TR was not converged',
prc_myrank,i,j
1109 log_info_cont(*)
'---------------------------------------------------------------------------------'
1110 log_info_cont(*)
'DEBUG Message --- Residual [K] :', resi1
1112 log_info_cont(*)
'DEBUG Message --- TRP : Initial TR [K] :', trp
1113 log_info_cont(*)
'DEBUG Message --- TRLP: Initial TRL [K] :', trlp
1115 log_info_cont(*)
'DEBUG Message --- rflux_SW : Shortwave radiation [W/m2] :', rflux_sw
1116 log_info_cont(*)
'DEBUG Message --- rflux_LW : Longwave radiation [W/m2] :', rflux_lw
1117 log_info_cont(*)
'DEBUG Message --- PRSS: Surface pressure [Pa] :', prss
1118 log_info_cont(*)
'DEBUG Message --- PRSA: Pressure at 1st atmos layer [m] :', prsa
1119 log_info_cont(*)
'DEBUG Message --- RHOO: Air density [kg/m3] :', rhoo
1120 log_info_cont(*)
'DEBUG Message --- ZA : Height at 1st atmos layer [m] :', za
1121 log_info_cont(*)
'DEBUG Message --- TA : Temperature at 1st atmos layer [K] :', ta
1122 log_info_cont(*)
'DEBUG Message --- UA : Wind speed at 1st atmos layer [m/s] :', ua
1123 log_info_cont(*)
'DEBUG Message --- QA : Specific humidity at 1st atmos layer [kg/kg] :', qa
1124 log_info_cont(*)
'DEBUG Message --- DZR : Depth of surface layer [m] :', dzr
1126 log_info_cont(*)
'DEBUG Message --- R, W, RW : Normalized height and road width [-] :', r, w,rw
1127 log_info_cont(*)
'DEBUG Message --- SVF : Sky View Factors [-] :', svf
1128 log_info_cont(*)
'DEBUG Message --- BETR: Evaporation efficiency [-] :', betr
1129 log_info_cont(*)
'DEBUG Message --- EPSR: Surface emissivity of roof [-] :', epsr
1130 log_info_cont(*)
'DEBUG Message --- CAPR: Heat capacity of roof [J m-3 K] :', capr
1131 log_info_cont(*)
'DEBUG Message --- AKSR: Thermal conductivity of roof [W m-1 K] :', aksr
1132 log_info_cont(*)
'DEBUG Message --- QS0R: Surface specific humidity [kg/kg] :', qs0r
1133 log_info_cont(*)
'DEBUG Message --- ZDC : Desplacement height of canopy [m] :', zdc
1134 log_info_cont(*)
'DEBUG Message --- Z0R : Momentum roughness length of roof [m] :', z0r
1135 log_info_cont(*)
'DEBUG Message --- Z0HR: Thermal roughness length of roof [m] :', z0hr
1136 log_info_cont(*)
'---------------------------------------------------------------------------------'
1141 ribr = ( grav * 2.0_rp / (tha+ths) ) * (tha-ths) * (z+z0r) / (ua*ua+eps)
1142 call mos(xxxr,chr,cdr,bhr,ribr,z,z0r,ua,tha,ths,rhoo)
1144 call qsat( tr, rhos, &
1149 rr = epsr * ( rflux_lw - stb * (tr**4) )
1150 hr = rhoo * cpdry * chr * ua * (ths-tha) * exn
1151 eler = min( rhoo * chr * ua * betr * (qs0r-qa), real(rainr/dt,rp) ) * lhv
1153 g0r = sr + rr - hr - eler
1156 call multi_layer(uke,bound,g0r,capr,aksr,trl,dzr,dt,trlend)
1160 if ( abs(resi1) > dts_max_onestep )
then
1161 if ( abs(resi1) > dts_max_onestep*10.0_rp )
then
1162 log_error(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TR exceeded a limit! STOP.'
1163 log_error_cont(*)
'previous TR and updated TR(TRL(1)) is ',tr-resi1, tr
1166 log_warn(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TR exceeded a limit'
1167 log_info_cont(*)
'previous TR and updated TR(TRL(1)) is ', tr-resi1, tr
1177 alphab = 6.15_rp + 4.18_rp * uc
1178 if( uc > 5.0_rp ) alphab = 7.51_rp * (uc**0.78_rp )
1179 alphag = 6.15_rp + 4.18_rp * uc
1180 if( uc > 5.0_rp ) alphag = 7.51_rp * (uc**0.78_rp )
1181 chb = alphab / rhoo / cpdry / uc
1182 chg = alphag / rhoo / cpdry / uc
1190 do iteration = 1, 200
1197 bhc = log(z0c/z0hc) / 0.4_rp
1198 ribc = ( grav * 2.0_rp / (tha+thc) ) * (tha-thc) * (z+z0c) / (ua*ua+eps)
1199 call mos(xxxc,chc,cdc,bhc,ribc,z,z0c,ua,tha,thc,rhoo)
1200 alphac = chc * rhoo * cpdry * ua
1202 call qsat( tb, rhos, qs0b )
1203 call qsat( tg, rhos, qs0g )
1207 tc1 = rw*alphac + rw*alphag + w*alphab
1209 tc2 = rw*alphac*tha + w*alphab*ths1 + rw*alphag*ths2
1211 qc1 = rw*(chc*ua) + rw*(chg*betg*uc) + w*(chb*betb*uc)
1212 qc2 = rw*(chc*ua)*qa + rw*(chg*betg*uc)*qs0g + w*(chb*betb*uc)*qs0b
1213 qc = max( qc2 / ( qc1 + eps ), 0.0_rp )
1215 rg1 = epsg * ( rflux_lw * vfgs &
1216 + epsb * vfgw * stb * tb**4 &
1219 rb1 = epsb * ( rflux_lw * vfws &
1220 + epsg * vfwg * stb * tg**4 &
1221 + epsb * vfww * stb * tb**4 &
1224 rg2 = epsg * ( (1.0_rp-epsb) * vfgw * vfws * rflux_lw &
1225 + (1.0_rp-epsb) * vfgw * vfwg * epsg * stb * tg**4 &
1226 + epsb * (1.0_rp-epsb) * vfgw * vfww * stb * tb**4 )
1228 rb2 = epsb * ( (1.0_rp-epsg) * vfwg * vfgs * rflux_lw &
1229 + (1.0_rp-epsg) * epsb * vfgw * vfwg * stb * tb**4 &
1230 + (1.0_rp-epsb) * vfws * vfww * rflux_lw &
1231 + (1.0_rp-epsb) * vfwg * vfww * stb * epsg * tg**4 &
1232 + epsb * (1.0_rp-epsb) * vfww * (1.0_rp-2.0_rp*vfws) * stb * tb**4 )
1237 hb = rhoo * cpdry * chb * uc * (ths1-thc) * exn
1238 eleb = min( rhoo * chb * uc * betb * (qs0b-qc), real(rainb/dt,rp) ) * lhv
1240 g0b = sb + rb - hb - eleb
1242 hg = rhoo * cpdry * chg * uc * (ths2-thc) * exn
1243 eleg = min( rhoo * chg * uc * betg * (qs0g-qc), real(raing/dt,rp) ) * lhv
1245 g0g = sg + rg - hg - eleg
1248 call multi_layer(uke,bound,g0b,capb,aksb,tbl,dzb,dt,tblend)
1252 call multi_layer(uke,bound,g0g,capg,aksg,tgl,dzg,dt,tglend)
1270 if ( abs(resi1) < sqrt(eps) .AND. abs(resi2) < sqrt(eps) )
then
1273 tb = max( tbp - dts_max_onestep, min( tbp + dts_max_onestep, tb ) )
1274 tg = max( tgp - dts_max_onestep, min( tgp + dts_max_onestep, tg ) )
1278 if ( resi1*resi1p < 0.0_rp )
then
1279 tb = (tb + tbl(1)) * 0.5_rp
1283 if ( resi2*resi2p < 0.0_rp )
then
1284 tg = (tg + tgl(1)) * 0.5_rp
1288 tb = max( tbp - dts_max_onestep, min( tbp + dts_max_onestep, tb ) )
1289 tg = max( tgp - dts_max_onestep, min( tgp + dts_max_onestep, tg ) )
1295 call qsat( tb, rhos, qs0b )
1296 call qsat( tg, rhos, qs0g )
1303 tc1 = rw*alphac + rw*alphag + w*alphab
1305 tc2 = rw*alphac*tha + w*alphab*ths1 + rw*alphag*ths2
1309 qc1 = rw*(chc*ua) + rw*(chg*betg*uc) + w*(chb*betb*uc)
1310 qc2 = rw*(chc*ua)*qa + rw*(chg*betg*uc)*qs0g + w*(chb*betb*uc)*qs0b
1311 qc = max( qc2 / ( qc1 + eps ), 0.0_rp )
1331 if ( iteration > 200 )
then
1332 log_warn(
"URBAN_DYN_Kusaka01_main",*)
'iteration for TB/TG was not converged',
prc_myrank,i,j
1333 log_info_cont(*)
'---------------------------------------------------------------------------------'
1334 log_info_cont(*)
'DEBUG Message --- Residual [K] :', resi1,resi2
1336 log_info_cont(*)
'DEBUG Message --- TBP : Initial TB [K] :', tbp
1337 log_info_cont(*)
'DEBUG Message --- TBLP: Initial TBL [K] :', tblp
1338 log_info_cont(*)
'DEBUG Message --- TGP : Initial TG [K] :', tgp
1339 log_info_cont(*)
'DEBUG Message --- TGLP: Initial TGL [K] :', tglp
1340 log_info_cont(*)
'DEBUG Message --- TCP : Initial TC [K] :', tcp
1341 log_info_cont(*)
'DEBUG Message --- QCP : Initial QC [K] :', qcp
1343 log_info_cont(*)
'DEBUG Message --- UC : Canopy wind [m/s] :', uc
1344 log_info_cont(*)
'DEBUG Message --- rflux_SW : Shortwave radiation [W/m2] :', rflux_sw
1345 log_info_cont(*)
'DEBUG Message --- rflux_LW : Longwave radiation [W/m2] :', rflux_lw
1346 log_info_cont(*)
'DEBUG Message --- PRSS: Surface pressure [Pa] :', prss
1347 log_info_cont(*)
'DEBUG Message --- PRSA: Pressure at 1st atmos layer [m] :', prsa
1348 log_info_cont(*)
'DEBUG Message --- RHOO: Air density [kg/m3] :', rhoo
1349 log_info_cont(*)
'DEBUG Message --- ZA : Height at 1st atmos layer [m] :', za
1350 log_info_cont(*)
'DEBUG Message --- TA : Temperature at 1st atmos layer [K] :', ta
1351 log_info_cont(*)
'DEBUG Message --- UA : Wind speed at 1st atmos layer [m/s] :', ua
1352 log_info_cont(*)
'DEBUG Message --- QA : Specific humidity at 1st atmos layer [kg/kg] :', qa
1353 log_info_cont(*)
'DEBUG Message --- DZB : Depth of surface layer [m] :', dzb
1354 log_info_cont(*)
'DEBUG Message --- DZG : Depth of surface layer [m] :', dzg
1356 log_info_cont(*)
'DEBUG Message --- R, W, RW : Normalized height and road width [-] :', r, w,rw
1357 log_info_cont(*)
'DEBUG Message --- SVF : Sky View Factors [-] :', svf
1358 log_info_cont(*)
'DEBUG Message --- BETB,BETG : Evaporation efficiency [-] :', betb,betg
1359 log_info_cont(*)
'DEBUG Message --- EPSB,EPSG : Surface emissivity [-] :', epsb,epsg
1360 log_info_cont(*)
'DEBUG Message --- CAPB,CAPG : Heat capacity [J m-3 K] :', capb,capg
1361 log_info_cont(*)
'DEBUG Message --- AKSB,AKSG : Thermal conductivity [W m-1 K] :', aksb,aksb
1362 log_info_cont(*)
'DEBUG Message --- QS0B,QS0G : Surface specific humidity [kg/kg] :', qs0b,qs0g
1363 log_info_cont(*)
'DEBUG Message --- ZDC : Desplacement height of canopy [m] :', zdc
1364 log_info_cont(*)
'DEBUG Message --- Z0M : Momentum roughness length of canopy [m] :', z0c
1365 log_info_cont(*)
'DEBUG Message --- Z0H/Z0E : Thermal roughness length of canopy [m] :', z0hc
1366 log_info_cont(*)
'---------------------------------------------------------------------------------'
1371 rg1 = epsg * ( rflux_lw * vfgs &
1372 + epsb * vfgw * stb * tb**4 &
1374 rb1 = epsb * ( rflux_lw * vfws &
1375 + epsg * vfwg * stb * tg**4 &
1376 + epsb * vfww * stb * tb**4 &
1379 rg2 = epsg * ( (1.0_rp-epsb) * vfgw * vfws * rflux_lw &
1380 + (1.0_rp-epsb) * vfgw * vfwg * epsg * stb * tg**4 &
1381 + epsb * (1.0_rp-epsb) * vfgw * vfww * stb * tb**4 )
1382 rb2 = epsb * ( (1.0_rp-epsg) * vfwg * vfgs * rflux_lw &
1383 + (1.0_rp-epsg) * epsb * vfgw * vfwg * stb * tb**4 &
1384 + (1.0_rp-epsb) * vfws * vfww * rflux_lw &
1385 + (1.0_rp-epsb) * vfwg * vfww * stb * epsg * tg**4 &
1386 + epsb * (1.0_rp-epsb) * vfww * (1.0_rp-2.0_rp*vfws) * stb * tb**4 )
1395 hb = rhoo * cpdry * chb * uc * (ths1-thc) * exn
1396 eleb = min( rhoo * chb * uc * betb * (qs0b-qc), real(rainb/dt,rp) ) * lhv
1398 g0b = sb + rb - hb - eleb
1400 hg = rhoo * cpdry * chg * uc * (ths2-thc) * exn
1401 eleg = min( rhoo * chg * uc * betg * (qs0g-qc), real(raing/dt,rp) ) * lhv
1403 g0g = sg + rg - hg - eleg
1406 call multi_layer(uke,bound,g0b,capb,aksb,tbl,dzb,dt,tblend)
1411 call multi_layer(uke,bound,g0g,capg,aksg,tgl,dzg,dt,tglend)
1415 if ( abs(resi1) > dts_max_onestep )
then
1416 if ( abs(resi1) > dts_max_onestep*10.0_rp )
then
1417 log_error(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TB exceeded a limit! STOP.'
1418 log_error_cont(*)
'previous TB and updated TB(TBL(1)) is ', tb-resi1,tb
1421 log_warn(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TB exceeded a limit'
1422 log_info_cont(*)
'previous TB and updated TB(TBL(1)) is ', tb-resi1, tb
1425 if ( abs(resi2) > dts_max_onestep )
then
1426 if ( abs(resi2) > dts_max_onestep*10.0_rp )
then
1427 log_error(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TG exceeded a limit! STOP.'
1428 log_error_cont(*)
'previous TG and updated TG(TGL(1)) is ', tg-resi2, tg, resi2
1431 log_warn(
"URBAN_DYN_Kusaka01_main",*)
'tendency of TG exceeded a limit'
1432 log_info_cont(*)
'previous TG and updated TG(TGL(1)) is ', tg-resi2, tg
1439 flxuv = ( r*cdr + rw*cdc ) * ua * ua
1440 sh = ( r*hr + w*hb + rw*hg )
1441 lh = ( r*eler + w*eleb + rw*eleg )
1442 ghflx = r*g0r + w*g0b + rw*g0g
1443 lnet = r*rr + w*rb + rw*rg
1449 lw = rflux_lw - lnet
1450 sw = rflux_sw - snet
1454 sdn = r + w * (vfws + vfgs * albg * vfwg) + rw * (vfgs + vfws * albb * vfgw)
1456 + w * ( vfws * albb + vfgs * albg * vfwg *albb ) &
1457 + rw * ( vfgs * albg + vfws * albb * vfgw *albg )
1459 albd_sw_grid = sup / sdn
1462 ldn = r + w*vfws + rw*vfgs
1463 lup = r * (1.0_rp-epsr) &
1464 + w*( (1.0_rp-epsb*vfww)*(1.0_rp-epsb)*vfws - epsb*vfwg*(1.0_rp-epsg)*vfgs ) &
1465 + rw*( (1.0_rp-epsg)*vfgs - epsg*(1.0_rp-vfgs)*(1.0_rp-epsb)*vfws )
1467 rup = (ldn - lup) * rflux_lw - lnet
1468 albd_lw_grid = lup / ldn
1494 rainr = max(0.0_rp, rainr-(lhr/lhv)*real(dt,kind=rp))
1495 rainb = max(0.0_rp, rainb-(lhb/lhv)*real(dt,kind=rp))
1496 raing = max(0.0_rp, raing-(lhg/lhv)*real(dt,kind=rp))
1502 rts = ( rup / stb / ( 1.0_rp-albd_lw_grid) )**0.25
1515 call cal_psi(xxx,psim,psih)
1517 xxx2 = (2.0_rp/z) * xxx
1518 call cal_psi(xxx2,psim2,psih2)
1520 xxx10 = (10.0_rp/z) * xxx
1521 call cal_psi(xxx10,psim10,psih10)
1524 fracu10 = ( log(10.0_rp/z0c ) - psim10 ) / ( log(z/z0c ) - psim )
1525 fract2 = ( log( 2.0_rp/z0hc) - psih2 ) / ( log(z/z0hc) - psih )
1527 call bulkflux_diagnose_surface( u1, v1, &
1531 z0c, z0hc, 1.0_rp, &
1533 fracu10, fract2, 1.0_rp )
1538 end subroutine slc_main
1541 subroutine canopy_wind(ZA, UA, Z0C, ZDC, UC)
1544 real(rp),
intent(in) :: za
1545 real(rp),
intent(in) :: ua
1546 real(rp),
intent(in) :: z0c
1547 real(rp),
intent(in) :: zdc
1548 real(rp),
intent(out) :: uc
1550 real(rp) :: ur,zc,xlb,bb
1552 if( zr + 2.0_rp < za )
then
1553 ur = ua * log((zr-zdc)/z0c) / log((za-zdc)/z0c)
1555 xlb = 0.4_rp * (zr-zdc)
1557 bb = 0.4_rp * zr / ( xlb * log((zr-zdc)/z0c) )
1558 uc = ur * exp( -bb * (1.0_rp-zc/zr) )
1565 uc = max(uc,0.01_rp)
1568 end subroutine canopy_wind
1571 subroutine cal_beta(BET, RAIN, WATER, STRG, ROFF)
1574 real(rp),
intent(out) :: bet
1575 real(rp),
intent(in) :: rain
1576 real(rp),
intent(inout) :: water
1577 real(rp),
intent(inout) :: strg
1578 real(rp),
intent(inout) :: roff
1580 if ( strg == 0.0_rp )
then
1584 water = water + rain
1585 roff = max(0.0_rp, water-strg)
1586 water = water - max(0.0_rp, water-strg)
1587 bet = min( water / strg, 1.0_rp)
1591 end subroutine cal_beta
1594 subroutine cal_psi(zeta,psim,psih)
1599 real(rp),
intent(inout) :: zeta
1600 real(rp),
intent(out) :: psim
1601 real(rp),
intent(out) :: psih
1604 if( zeta >= 1.0_rp ) zeta = 1.0_rp
1605 if( zeta <= -5.0_rp ) zeta = -5.0_rp
1607 if( zeta > 0.0_rp )
then
1608 psim = -5.0_rp * zeta
1609 psih = -5.0_rp * zeta
1611 x = ( 1.0_rp - 16.0_rp * zeta )**0.25_rp
1612 psim = 2.0_rp * log((1.0_rp+x)/2.0_rp) + log((1.0_rp+x*x)/2.0_rp) - 2.0_rp*atan(x) + pi/2.0_rp
1613 psih = 2.0_rp * log((1.0_rp+x*x)/2.0_rp)
1617 end subroutine cal_psi
1624 subroutine mos(XXX,CH,CD,B1,RIB,Z,Z0,UA,TA,TSF,RHO)
1630 real(rp),
intent(in) :: b1, z, z0, ua, ta, tsf, rho
1631 real(rp),
intent(out) :: cd, ch
1632 real(rp),
intent(inout) :: xxx, rib
1633 real(rp) :: xxx0, x, x0, faih, dpsim, dpsih
1634 real(rp) :: f, df, xxxp, us, ts, al, xkb, dd, psim, psih
1636 integer,
parameter :: newt_end = 10
1640 lnz = log( (z+z0)/z0 )
1642 if( rib <= -15.0_rp ) rib = -15.0_rp
1644 if( rib < 0.0_rp )
then
1646 do newt = 1, newt_end
1648 if( xxx >= 0.0_rp ) xxx = -1.0e-3_rp
1650 xxx0 = xxx * z0/(z+z0)
1652 x = (1.0_rp-16.0_rp*xxx)**0.25
1653 x0 = (1.0_rp-16.0_rp*xxx0)**0.25
1656 - log( (x+1.0_rp)**2 * (x**2+1.0_rp) ) &
1657 + 2.0_rp * atan(x) &
1658 + log( (x+1.0_rp)**2 * (x0**2+1.0_rp) ) &
1660 faih = 1.0_rp / sqrt( 1.0_rp - 16.0_rp*xxx )
1661 psih = lnz + 0.4_rp*b1 &
1662 - 2.0_rp * log( sqrt( 1.0_rp - 16.0_rp*xxx ) + 1.0_rp ) &
1663 + 2.0_rp * log( sqrt( 1.0_rp - 16.0_rp*xxx0 ) + 1.0_rp )
1665 dpsim = ( 1.0_rp - 16.0_rp*xxx )**(-0.25) / xxx &
1666 - ( 1.0_rp - 16.0_rp*xxx0 )**(-0.25) / xxx
1667 dpsih = 1.0_rp / sqrt( 1.0_rp - 16.0_rp*xxx ) / xxx &
1668 - 1.0_rp / sqrt( 1.0_rp - 16.0_rp*xxx0 ) / xxx
1670 f = rib * psim**2 / psih - xxx
1672 df = rib * ( 2.0_rp*dpsim*psim*psih - dpsih*psim**2 ) &
1678 if( xxx <= -10.0_rp ) xxx = -10.0_rp
1682 else if( rib >= 0.142857_rp )
then
1685 psim = lnz + 7.0_rp * xxx
1686 psih = psim + 0.4_rp * b1
1692 dd = -4.0_rp * rib * 7.0_rp * xkb * al + (al+xkb)**2
1693 if( dd <= 0.0_rp ) dd = 0.0_rp
1695 xxx = ( al + xkb - 2.0_rp*rib*7.0_rp*al - sqrt(dd) ) / ( 2.0_rp * ( rib*7.0_rp**2 - 7.0_rp ) )
1696 psim = lnz + 7.0_rp * min( xxx, 0.714_rp )
1697 psih = psim + 0.4_rp * b1
1701 us = 0.4_rp * ua / psim
1702 if( us <= 0.01_rp ) us = 0.01_rp
1703 ts = 0.4_rp * (ta-tsf) / psih
1705 cd = us * us / (ua+eps)**2
1706 ch = 0.4_rp * us / psih / (ua+eps)
1713 subroutine multi_layer(KM,BOUND,G0,CAP,AKS,TSL,DZ,DELT,TSLEND)
1722 real(rp),
intent(in) :: g0
1723 real(rp),
intent(in) :: cap
1724 real(rp),
intent(in) :: aks
1725 real(
dp),
intent(in) :: delt
1726 real(rp),
intent(in) :: tslend
1727 integer,
intent(in) :: km
1728 integer,
intent(in) :: bound
1729 real(rp),
intent(in) :: dz(km)
1730 real(rp),
intent(inout) :: tsl(km)
1731 real(rp) :: a(km), b(km), c(km), d(km), p(km), q(km)
1739 b(1) = cap * dz(1) / delt &
1740 + 2.0_rp * aks / (dz(1)+dz(2))
1741 c(1) = -2.0_rp * aks / (dz(1)+dz(2))
1742 d(1) = cap * dz(1) / delt * tsl(1) + g0
1745 a(k) = -2.0_rp * aks / (dz(k-1)+dz(k))
1746 b(k) = cap * dz(k) / delt + 2.0_rp * aks / (dz(k-1)+dz(k)) + 2.0_rp * aks / (dz(k)+dz(k+1))
1747 c(k) = -2.0_rp * aks / (dz(k)+dz(k+1))
1748 d(k) = cap * dz(k) / delt * tsl(k)
1751 if( bound == 1 )
then
1752 a(km) = -2.0_rp * aks / (dz(km-1)+dz(km))
1753 b(km) = cap * dz(km) / delt + 2.0_rp * aks / (dz(km-1)+dz(km))
1755 d(km) = cap * dz(km) / delt * tsl(km)
1757 a(km) = -2.0_rp * aks / (dz(km-1)+dz(km))
1758 b(km) = cap * dz(km) / delt + 2.0_rp * aks / (dz(km-1)+dz(km)) + 2.0_rp * aks / (dz(km)+dzend)
1760 d(km) = cap * dz(km) / delt * tsl(km) + 2.0_rp * aks * tslend / (dz(km)+dzend)
1767 p(k) = -c(k) / ( a(k) * p(k-1) + b(k) )
1768 q(k) = ( -a(k) * q(k-1) + d(k) ) / ( a(k) * p(k-1) + b(k) )
1774 tsl(k) = p(k) * tsl(k+1) + q(k)
1778 end subroutine multi_layer
1781 subroutine multi_layer2(KM,BOUND,G0,CAP,AKS,TSL,DZ,DELT,TSLEND,CAP1,AKS1)
1790 real(rp),
intent(in) :: g0
1791 real(rp),
intent(in) :: cap
1792 real(rp),
intent(in) :: aks
1793 real(rp),
intent(in) :: cap1
1794 real(rp),
intent(in) :: aks1
1795 real(
dp),
intent(in) :: delt
1796 real(rp),
intent(in) :: tslend
1797 integer,
intent(in) :: km
1798 integer,
intent(in) :: bound
1799 real(rp),
intent(in) :: dz(km)
1800 real(rp),
intent(inout) :: tsl(km)
1801 real(rp) :: a(km), b(km), c(km), d(km), x(km), p(km), q(km)
1809 b(1) = cap1 * dz(1) / delt &
1810 + 2.0_rp * aks1 / (dz(1)+dz(2))
1811 c(1) = -2.0_rp * aks1 / (dz(1)+dz(2))
1812 d(1) = cap1 * dz(1) / delt * tsl(1) + g0
1815 a(k) = -2.0_rp * aks / (dz(k-1)+dz(k))
1816 b(k) = cap * dz(k) / delt + 2.0_rp * aks / (dz(k-1)+dz(k)) + 2.0_rp * aks / (dz(k)+dz(k+1))
1817 c(k) = -2.0_rp * aks / (dz(k)+dz(k+1))
1818 d(k) = cap * dz(k) / delt * tsl(k)
1821 if( bound == 1 )
then
1822 a(km) = -2.0_rp * aks / (dz(km-1)+dz(km))
1823 b(km) = cap * dz(km) / delt + 2.0_rp * aks / (dz(km-1)+dz(km))
1825 d(km) = cap * dz(km) / delt * tsl(km)
1827 a(km) = -2.0_rp * aks / (dz(km-1)+dz(km))
1828 b(km) = cap * dz(km) / delt + 2.0_rp * aks / (dz(km-1)+dz(km)) + 2.0_rp * aks / (dz(km)+dzend)
1830 d(km) = cap * dz(km) / delt * tsl(km) + 2.0_rp * aks * tslend / (dz(km)+dzend)
1837 p(k) = -c(k) / ( a(k) * p(k-1) + b(k) )
1838 q(k) = ( -a(k) * q(k-1) + d(k) ) / ( a(k) * p(k-1) + b(k) )
1844 x(k) = p(k) * x(k+1) + q(k)
1852 end subroutine multi_layer2
1856 subroutine urban_param_setup
1859 real(rp) :: dhgt,thgt,vfws,vfgs
1878 zdc_tbl = zr * 0.3_rp
1879 z0c_tbl = zr * 0.15_rp
1880 z0hc_tbl = 0.1_rp * z0c_tbl
1883 hgt = zr / ( road_width + roof_width )
1886 r = roof_width / ( road_width + roof_width )
1890 dhgt = hgt / 100.0_rp
1893 thgt = hgt - dhgt / 2.0_rp
1896 vfws = vfws + 0.25_rp * ( 1.0_rp - thgt / sqrt( thgt**2 + rw**2 ) )
1899 vfws = vfws / 99.0_rp
1900 vfws = vfws * 2.0_rp
1901 vfgs = 1.0_rp - 2.0_rp * vfws * hgt / rw
1905 end subroutine urban_param_setup
1909 subroutine read_urban_param_table( INFILENAME )
1914 character(*),
intent(in) :: infilename
1916 namelist / param_urban_data / &
1953 file = trim(infilename), &
1954 form =
'formatted', &
1958 if ( ierr /= 0 )
then
1960 log_error(
"URBAN_DYN_kusaka01_setup",*)
'Failed to open a parameter file : ', trim(infilename)
1964 log_info(
"URBAN_DYN_kusaka01_setup",*)
'read_urban_param_table: Read urban parameters from file'
1967 read (fid,nml=param_urban_data,iostat=ierr)
1968 if ( ierr < 0 )
then
1969 log_info(
"read_urban_param_table",*)
'Not found namelist of PARAM_URBAN_DATA. Default used.'
1970 elseif( ierr > 0 )
then
1971 log_error(
"read_urban_param_table",*)
'Not appropriate names in PARAM_URBAN_DATA of ', trim(infilename)
1974 log_nml(param_urban_data)
1977 if ( zr <= 0.0_rp )
then
1978 log_error(
"read_urban_param_table",*)
'ZR is not appropriate value; ZR must be larger than 0. ZR=', zr
1985 end subroutine read_urban_param_table
1989 subroutine read_urban_gridded_data_2d( &
1996 file_cartesc_read, &
1998 file_cartesc_check_coordinates, &
2003 integer ,
intent(in) :: uia, uja
2004 character(len=*),
intent(in) :: infilename
2005 character(len=*),
intent(in) :: varname
2006 real(rp),
intent(out) :: udata(uia,uja)
2011 log_info(
"URBAN_DYN_kusaka01_setup",*)
'read_urban_gridded_data ',trim(varname)
2015 call file_cartesc_read( fid, varname,
'XY', udata(:,:) )
2018 call file_cartesc_check_coordinates( fid )
2022 end subroutine read_urban_gridded_data_2d
2026 subroutine read_urban_gridded_data_3d( &
2033 file_cartesc_read, &
2035 file_cartesc_check_coordinates, &
2040 integer ,
intent(in) :: uia, uja
2041 character(len=*),
intent(in) :: infilename
2042 character(len=*),
intent(in) :: varname
2043 real(rp),
intent(out) :: udata(uia,uja,24)
2048 log_info(
"URBAN_DYN_kusaka01_setup",*)
'read_urban_gridded_data ',trim(varname)
2053 call file_cartesc_read( fid, varname,
'XY', udata(:,:,k), k )
2057 call file_cartesc_check_coordinates( fid )
2061 end subroutine read_urban_gridded_data_3d
2073 integer,
intent(in) :: UIA, UJA
2074 real(RP),
intent(in) :: SHR(UIA,UJA), SHB(UIA,UJA), SHG(UIA,UJA)
2075 real(RP),
intent(in) :: LHR(UIA,UJA), LHB(UIA,UJA), LHG(UIA,UJA)
2076 real(RP),
intent(in) :: GHR(UIA,UJA), GHB(UIA,UJA), GHG(UIA,UJA)
2077 real(RP),
intent(in) :: RNR(UIA,UJA), RNB(UIA,UJA), RNG(UIA,UJA)
2078 real(RP),
intent(in) :: RNgrd(UIA,UJA)
2080 call file_history_put( i_shr, shr(:,:) )
2081 call file_history_put( i_shb, shb(:,:) )
2082 call file_history_put( i_shg, shg(:,:) )
2083 call file_history_put( i_lhr, lhr(:,:) )
2084 call file_history_put( i_lhb, lhb(:,:) )
2085 call file_history_put( i_lhg, lhg(:,:) )
2086 call file_history_put( i_ghr, ghr(:,:) )
2087 call file_history_put( i_ghb, ghb(:,:) )
2088 call file_history_put( i_ghg, ghg(:,:) )
2089 call file_history_put( i_rnr, rnr(:,:) )
2090 call file_history_put( i_rnb, rnb(:,:) )
2091 call file_history_put( i_rng, rng(:,:) )
2092 call file_history_put( i_rngrd, rngrd(:,:) )