149 logical,
private :: urban_vars_checkrange = .false.
151 integer,
private,
parameter :: vmax = 19
152 integer,
private,
parameter :: i_trl = 1
153 integer,
private,
parameter :: i_tbl = 2
154 integer,
private,
parameter :: i_tgl = 3
155 integer,
private,
parameter :: i_tr = 4
156 integer,
private,
parameter :: i_tb = 5
157 integer,
private,
parameter :: i_tg = 6
158 integer,
private,
parameter :: i_tc = 7
159 integer,
private,
parameter :: i_qc = 8
160 integer,
private,
parameter :: i_uc = 9
161 integer,
private,
parameter :: i_rainr = 10
162 integer,
private,
parameter :: i_rainb = 11
163 integer,
private,
parameter :: i_raing = 12
164 integer,
private,
parameter :: i_sfc_temp = 13
165 integer,
private,
parameter :: i_sfc_alb_ir_dir = 14
166 integer,
private,
parameter :: i_sfc_alb_ir_dif = 15
167 integer,
private,
parameter :: i_sfc_alb_nir_dir = 16
168 integer,
private,
parameter :: i_sfc_alb_nir_dif = 17
169 integer,
private,
parameter :: i_sfc_alb_vis_dir = 18
170 integer,
private,
parameter :: i_sfc_alb_vis_dif = 19
172 character(len=H_SHORT),
private :: var_name(vmax)
173 character(len=H_MID),
private :: var_desc(vmax)
174 character(len=H_MID),
private :: var_stdn(vmax)
175 character(len=H_SHORT),
private :: var_unit(vmax)
176 integer,
private :: var_id(vmax)
177 integer,
private :: restart_fid = -1
179 data var_name /
'URBAN_TRL', &
192 'URBAN_SFC_ALB_IR_dir', &
193 'URBAN_SFC_ALB_IR_dif', &
194 'URBAN_SFC_ALB_NIR_dir', &
195 'URBAN_SFC_ALB_NIR_dif', &
196 'URBAN_SFC_ALB_VIS_dir', &
197 'URBAN_SFC_ALB_VIS_dif' /
199 data var_desc /
'urban temperature in layer of roof', &
200 'urban temperature in layer of wall', &
201 'urban temperature in layer of road', &
202 'urban surface temperature of roof', &
203 'urban surface temperature of wall', &
204 'urban surface temperature of road', &
205 'urban canopy air temperature', &
206 'urban canopy humidity', &
207 'urban canopy wind', &
208 'urban rain strage on roof', &
209 'urban rain strage on wall', &
210 'urban rain strage on road', &
211 'urban grid average of temperature', &
212 'urban grid average of albedo for IR (direct)', &
213 'urban grid average of albedo for IR (diffuse)', &
214 'urban grid average of albedo for NIR (direct)', &
215 'urban grid average of albedo for NIR (diffuse)', &
216 'urban grid average of albedo for VIS (direct)', &
217 'urban grid average of albedo for VIS (diffuse)' /
219 data var_stdn /
'', &
239 data var_unit /
'K', &
259 logical,
private :: urban_restart_in_check_coordinates = .true.
262 integer,
parameter :: im_trl = 1
263 integer,
parameter :: im_tbl = 2
264 integer,
parameter :: im_tgl = 3
265 integer,
parameter :: im_tr = 4
266 integer,
parameter :: im_tb = 5
267 integer,
parameter :: im_tg = 6
268 integer,
parameter :: im_tc = 7
269 integer,
parameter :: im_uc = 8
270 integer,
parameter :: im_qc = 9
271 integer,
parameter :: im_rainr = 10
272 integer,
parameter :: im_rainb = 11
273 integer,
parameter :: im_raing = 12
274 integer,
parameter :: im_roff = 13
275 integer,
parameter :: im_sfcwr = 14
276 integer,
parameter :: im_sfcwb = 15
277 integer,
parameter :: im_sfcwg = 16
278 integer,
parameter :: im_sfcir = 17
279 integer,
parameter :: im_sfcib = 18
280 integer,
parameter :: im_sfcig = 19
281 integer,
parameter :: im_masflx = 20
282 integer,
parameter :: im_engi_s = 21
283 integer,
parameter :: im_engi_sr = 22
284 integer,
parameter :: im_engi_sb = 23
285 integer,
parameter :: im_engi_sg = 24
286 integer,
parameter :: im_engi_w = 25
287 integer,
parameter :: im_engi_wr = 26
288 integer,
parameter :: im_engi_wb = 27
289 integer,
parameter :: im_engi_wg = 28
290 integer,
parameter :: im_engsfc_ghr = 29
291 integer,
parameter :: im_engsfc_ghb = 30
292 integer,
parameter :: im_engsfc_ghg = 31
293 integer,
parameter :: im_engsfc_eir = 32
294 integer,
parameter :: im_engsfc_eib = 33
295 integer,
parameter :: im_engsfc_eig = 34
296 integer,
parameter :: im_roff_ei = 35
297 integer,
parameter :: im_engflx = 36
298 integer,
parameter :: im_max = 35
299 integer,
private :: monit_id(im_max)
314 namelist / param_urban_vars / &
318 urban_restart_in_check_coordinates, &
325 urban_vars_checkrange
332 log_info(
"URBAN_vars_setup",*)
'Setup'
484 log_info(
"URBAN_vars_setup",*)
'Not found namelist. Default used.'
485 elseif( ierr > 0 )
then
486 log_error(
"URBAN_vars_setup",*)
'Not appropriate names in namelist PARAM_URBAN_VARS. Check!'
489 log_nml(param_urban_vars)
492 log_info(
"URBAN_vars_setup",*)
'List of prognostic variables (URBAN) '
493 log_info_cont(
'(1x,A,A24,A,A48,A,A12,A)') &
494 ' |',
'VARNAME ',
'|', &
495 'DESCRIPTION ',
'[',
'UNIT ',
']'
497 log_info_cont(
'(1x,A,I3,A,A24,A,A48,A,A12,A)') &
498 'NO.',iv,
'|',var_name(iv),
'|',var_desc(iv),
'[',var_unit(iv),
']'
506 log_info(
"URBAN_vars_setup",*)
'Restart input? : NO'
513 log_info(
"URBAN_vars_setup",*)
'Restart output? : NO'
518 call monitor_reg(
'URB_TRL',
'roof temperature',
'K m3', &
520 dim_type=
'UXY', is_tendency=.false. )
521 call monitor_reg(
'URB_TBL',
'wall temperature',
'K m3', &
523 dim_type=
'UXY', is_tendency=.false. )
524 call monitor_reg(
'URB_TGL',
'road temperature',
'K m3', &
526 dim_type=
'UXY', is_tendency=.false. )
527 call monitor_reg(
'URB_TR',
'roof surface temperature',
'K m2', &
529 dim_type=
'XY', is_tendency=.false. )
530 call monitor_reg(
'URB_TB',
'wall surface temperature',
'K m2', &
532 dim_type=
'XY', is_tendency=.false. )
533 call monitor_reg(
'URB_TG',
'road surface temperature',
'K m2', &
535 dim_type=
'XY', is_tendency=.false. )
536 call monitor_reg(
'URB_TC',
'canopy temperature',
'K m2', &
538 dim_type=
'XY', is_tendency=.false. )
539 call monitor_reg(
'URB_UC',
'canopy wind speed',
'm3/s', &
541 dim_type=
'XY', is_tendency=.false. )
542 call monitor_reg(
'URB_QC',
'canopy humidity',
'kg/m', &
544 dim_type=
'XY', is_tendency=.false. )
545 call monitor_reg(
'URB_RAINR',
'roof water',
'kg', &
546 monit_id(im_rainr), &
547 dim_type=
'XY', is_tendency=.false. )
548 call monitor_reg(
'URB_RAINB',
'wall water',
'kg', &
549 monit_id(im_rainb), &
550 dim_type=
'XY', is_tendency=.false. )
551 call monitor_reg(
'URB_RAING',
'road water',
'kg', &
552 monit_id(im_raing), &
553 dim_type=
'XY', is_tendency=.false. )
554 call monitor_reg(
'URB_ROFF',
'runoff water',
'kg', &
556 dim_type=
'XY', is_tendency=.false. )
568 log_info(
"URBAN_vars_finalize",*)
'Finalize'
659 file_cartesc_check_coordinates
664 character(len=19) :: timelabel
665 character(len=H_LONG) :: basename
671 log_info(
"URBAN_vars_restart_open",*)
'Open restart file (URBAN) '
682 log_info(
"URBAN_vars_restart_open",*)
'basename: ', trim(basename)
686 if ( urban_restart_in_check_coordinates )
then
687 call file_cartesc_check_coordinates( restart_fid, urban=.true. )
691 log_info(
"URBAN_vars_restart_open",*)
'restart file for urban is not specified.'
714 if ( restart_fid /= -1 )
then
716 log_info(
"URBAN_vars_restart_read",*)
'Read from restart file (URBAN) '
718 call file_cartesc_read( restart_fid, var_name(i_trl),
'UXY', &
720 call file_cartesc_read( restart_fid, var_name(i_tbl),
'UXY', &
722 call file_cartesc_read( restart_fid, var_name(i_tgl),
'UXY', &
725 call file_cartesc_read( restart_fid, var_name(i_tr),
'XY', &
727 call file_cartesc_read( restart_fid, var_name(i_tb),
'XY', &
729 call file_cartesc_read( restart_fid, var_name(i_tg),
'XY', &
731 call file_cartesc_read( restart_fid, var_name(i_tc),
'XY', &
733 call file_cartesc_read( restart_fid, var_name(i_qc),
'XY', &
735 call file_cartesc_read( restart_fid, var_name(i_uc),
'XY', &
738 call file_cartesc_read( restart_fid, var_name(i_rainr),
'XY', &
740 call file_cartesc_read( restart_fid, var_name(i_rainb),
'XY', &
742 call file_cartesc_read( restart_fid, var_name(i_raing),
'XY', &
745 call file_cartesc_read( restart_fid, var_name(i_sfc_temp),
'XY', &
747 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dir),
'XY', &
749 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dif),
'XY', &
751 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dir),
'XY', &
753 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dif),
'XY', &
755 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dir),
'XY', &
757 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dif),
'XY', &
769 log_error(
"URBAN_vars_restart_read",*)
'invalid restart file ID for urban.'
790 call file_history_in(
urban_trl(:,:,:), var_name(i_trl), var_desc(i_trl), var_unit(i_trl), dim_type=
'UXY' )
791 call file_history_in(
urban_tbl(:,:,:), var_name(i_tbl), var_desc(i_tbl), var_unit(i_tbl), dim_type=
'UXY' )
792 call file_history_in(
urban_tgl(:,:,:), var_name(i_tgl), var_desc(i_tgl), var_unit(i_tgl), dim_type=
'UXY' )
794 call file_history_in(
urban_tr(:,:), var_name(i_tr), var_desc(i_tr), var_unit(i_tr) )
795 call file_history_in(
urban_tb(:,:), var_name(i_tb), var_desc(i_tb), var_unit(i_tb) )
796 call file_history_in(
urban_tg(:,:), var_name(i_tg), var_desc(i_tg), var_unit(i_tg) )
797 call file_history_in(
urban_tc(:,:), var_name(i_tc), var_desc(i_tc), var_unit(i_tc) )
798 call file_history_in(
urban_qc(:,:), var_name(i_qc), var_desc(i_qc), var_unit(i_qc) )
799 call file_history_in(
urban_uc(:,:), var_name(i_uc), var_desc(i_uc), var_unit(i_uc) )
801 call file_history_in(
urban_rainr(:,:), var_name(i_rainr), var_desc(i_rainr), var_unit(i_rainr) )
802 call file_history_in(
urban_rainb(:,:), var_name(i_rainb), var_desc(i_rainb), var_unit(i_rainb) )
803 call file_history_in(
urban_raing(:,:), var_name(i_raing), var_desc(i_raing), var_unit(i_raing) )
805 call file_history_in(
urban_sfc_temp(:,:), var_name(i_sfc_temp), &
806 var_desc(i_sfc_temp), var_unit(i_sfc_temp), standard_name=var_stdn(i_sfc_temp) )
809 var_desc(i_sfc_alb_ir_dir), var_unit(i_sfc_alb_ir_dir), standard_name=var_stdn(i_sfc_alb_ir_dir) )
811 var_desc(i_sfc_alb_ir_dif), var_unit(i_sfc_alb_ir_dif), standard_name=var_stdn(i_sfc_alb_ir_dif) )
813 var_desc(i_sfc_alb_nir_dir), var_unit(i_sfc_alb_nir_dir), standard_name=var_stdn(i_sfc_alb_nir_dir) )
815 var_desc(i_sfc_alb_nir_dif), var_unit(i_sfc_alb_nir_dif), standard_name=var_stdn(i_sfc_alb_nir_dif) )
817 var_desc(i_sfc_alb_vis_dir), var_unit(i_sfc_alb_vis_dir), standard_name=var_stdn(i_sfc_alb_vis_dir) )
819 var_desc(i_sfc_alb_vis_dif), var_unit(i_sfc_alb_vis_dif), standard_name=var_stdn(i_sfc_alb_vis_dif) )
821 call file_history_in(
urban_roff(:,:),
'URBAN_RUNOFF', &
822 'urban runoff water',
'kg/m2/s' )
825 'urban grid average of w-momentum flux',
'kg/m2/s' )
827 'urban grid average of u-momentum flux',
'kg/m2/s' )
829 'urban grid average of v-momentum flux',
'kg/m2/s' )
831 'urban grid average of sensible heat flux (upward)',
'W/m2' )
833 'urban grid average of latent heat flux (upward)',
'W/m2' )
835 'urban grid average of subsurface heat flux (downward)',
'W/m2' )
838 'urban grid average of water vapor flux (upward)',
'kg/m2/s' )
840 call file_history_in(
urban_ustar(:,:),
'URBAN_Ustar', &
841 'urban friction velocity',
'm/s' )
842 call file_history_in(
urban_tstar(:,:),
'URBAN_Tstar', &
843 'urban temperature scale',
'K' )
844 call file_history_in(
urban_qstar(:,:),
'URBAN_Qstar', &
845 'urban moisture scale',
'kg/kg' )
846 call file_history_in(
urban_wstar(:,:),
'URBAN_Wstar', &
847 'urban convective velocity scale',
'm/s' )
848 call file_history_in(
urban_rlmo(:,:),
'URBAN_RLmo', &
849 'urban inversed Obukhov length',
'1/m' )
850 call file_history_in(
urban_u10(:,:),
'URBAN_U10', &
851 'urban 10m x-wind',
'm/s' )
852 call file_history_in(
urban_v10(:,:),
'URBAN_V10', &
853 'urban 10m y-wind',
'm/s' )
854 call file_history_in(
urban_t2(:,:),
'URBAN_T2', &
855 'urban 2m temprerature',
'K' )
856 call file_history_in(
urban_q2(:,:),
'URBAN_Q2', &
857 'urban 2m specific humidity',
'kg/kg' )
858 call file_history_in(
urban_z0m(:,:),
'URBAN_Z0M', &
859 'urban parameter of rougness length for momentum',
'm' )
860 call file_history_in(
urban_z0h(:,:),
'URBAN_Z0H', &
861 'urban parameter of rougness length for heat',
'm' )
862 call file_history_in(
urban_z0e(:,:),
'URBAN_Z0E', &
863 'urban parameter of rougness length for vapor',
'm' )
864 call file_history_in(
urban_zd(:,:),
'URBAN_ZD', &
865 'urban parameter of displacement height',
'm' )
866 call file_history_in(
urban_ah(:,:),
'URBAN_AH', &
867 'urban parameter of anthropogenic sensible heat',
'W/m2' )
868 call file_history_in(
urban_ahl(:,:),
'URBAN_AHL', &
869 'urban parameter of anthropogenic latent heat',
'W/m2' )
896 call monitor_put( monit_id(im_trl),
urban_trl(:,:,:) )
897 call monitor_put( monit_id(im_tbl),
urban_tbl(:,:,:) )
898 call monitor_put( monit_id(im_tgl),
urban_tgl(:,:,:) )
900 call monitor_put( monit_id(im_tr),
urban_tr(:,:) )
901 call monitor_put( monit_id(im_tb),
urban_tb(:,:) )
902 call monitor_put( monit_id(im_tg),
urban_tg(:,:) )
903 call monitor_put( monit_id(im_tc),
urban_tc(:,:) )
904 call monitor_put( monit_id(im_uc),
urban_uc(:,:) )
905 if ( monit_id(im_qc) > 0 )
then
914 call monitor_put( monit_id(im_qc), work2d(:,:) )
918 call monitor_put( monit_id(im_rainr),
urban_rainr(:,:) )
919 call monitor_put( monit_id(im_rainb),
urban_rainb(:,:) )
920 call monitor_put( monit_id(im_raing),
urban_raing(:,:) )
921 call monitor_put( monit_id(im_roff) ,
urban_roff(:,:) )
1072 logical,
intent(in),
optional :: force
1076 if (
present(force) )
then
1079 check = urban_vars_checkrange
1084 urban_trl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_trl), &
1087 urban_tbl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_tbl), &
1090 urban_tgl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_tgl), &
1093 urban_tr(:,:), 0.0_rp, 1000.0_rp, var_name(i_tr), &
1096 urban_tb(:,:), 0.0_rp, 1000.0_rp, var_name(i_tb), &
1099 urban_tg(:,:), 0.0_rp, 1000.0_rp, var_name(i_tg), &
1102 urban_tc(:,:), 0.0_rp, 1000.0_rp, var_name(i_tc), &
1105 urban_qc(:,:), 0.0_rp, 1.0_rp, var_name(i_qc), &
1108 urban_uc(:,:), 0.0_rp, 100.0_rp, var_name(i_uc), &
1111 urban_rainr(:,:), 0.0_rp, 1000.0_rp, var_name(i_rainr), &
1114 urban_rainb(:,:), 0.0_rp, 1000.0_rp, var_name(i_rainb), &
1117 urban_raing(:,:), 0.0_rp, 1000.0_rp, var_name(i_raing), &
1122 var_name(i_sfc_temp), __file__, __line__, &
1127 var_name(i_sfc_alb_ir_dir ), __file__, __line__, &
1131 var_name(i_sfc_alb_ir_dif ), __file__, __line__, &
1135 var_name(i_sfc_alb_nir_dir), __file__, __line__, &
1139 var_name(i_sfc_alb_nir_dif), __file__, __line__, &
1143 var_name(i_sfc_alb_vis_dir), __file__, __line__, &
1147 var_name(i_sfc_alb_vis_dif), __file__, __line__, &
1151 if (
present(force) )
then
1256 character(len=19) :: timelabel
1257 character(len=H_LONG) :: basename
1265 log_info(
"URBAN_vars_restart_create",*)
'Create restart file (URBAN) '
1274 log_info(
"URBAN_vars_restart_create",*)
'basename: ', trim(basename)
1297 if ( restart_fid /= -1 )
then
1316 if ( restart_fid /= -1 )
then
1318 log_info(
"URBAN_vars_restart_close",*)
'Close restart file (URBAN) '
1342 if ( restart_fid /= -1 )
then
1346 var_name(i), var_desc(i), var_unit(i), &
1350 do i = i_tr, i_sfc_alb_vis_dif
1352 var_name(i), var_desc(i), var_unit(i), &
1368 file_cartesc_write_var
1374 if ( restart_fid /= -1 )
then
1378 call file_cartesc_write_var( restart_fid, var_id(i_trl),
urban_trl(:,:,:), &
1379 var_name(i_trl),
'UXY', fill_halo=.true. )
1380 call file_cartesc_write_var( restart_fid, var_id(i_tbl),
urban_tbl(:,:,:), &
1381 var_name(i_tbl),
'UXY', fill_halo=.true. )
1382 call file_cartesc_write_var( restart_fid, var_id(i_tgl),
urban_tgl(:,:,:), &
1383 var_name(i_tgl),
'UXY', fill_halo=.true. )
1385 call file_cartesc_write_var( restart_fid, var_id(i_tr),
urban_tr(:,:), &
1386 var_name(i_tr),
'XY', fill_halo=.true. )
1387 call file_cartesc_write_var( restart_fid, var_id(i_tb),
urban_tb(:,:), &
1388 var_name(i_tb),
'XY', fill_halo=.true. )
1389 call file_cartesc_write_var( restart_fid, var_id(i_tg),
urban_tg(:,:), &
1390 var_name(i_tg),
'XY', fill_halo=.true. )
1391 call file_cartesc_write_var( restart_fid, var_id(i_tc),
urban_tc(:,:), &
1392 var_name(i_tc),
'XY', fill_halo=.true. )
1393 call file_cartesc_write_var( restart_fid, var_id(i_qc),
urban_qc(:,:), &
1394 var_name(i_qc),
'XY', fill_halo=.true. )
1395 call file_cartesc_write_var( restart_fid, var_id(i_uc),
urban_uc(:,:), &
1396 var_name(i_uc),
'XY', fill_halo=.true. )
1399 call file_cartesc_write_var( restart_fid, var_id(i_rainr),
urban_rainr(:,:), &
1400 var_name(i_rainr),
'XY', fill_halo=.true. )
1401 call file_cartesc_write_var( restart_fid, var_id(i_rainb),
urban_rainb(:,:), &
1402 var_name(i_rainb),
'XY', fill_halo=.true. )
1403 call file_cartesc_write_var( restart_fid, var_id(i_raing),
urban_raing(:,:), &
1404 var_name(i_raing),
'XY', fill_halo=.true. )
1406 call file_cartesc_write_var( restart_fid, var_id(i_sfc_temp), &
1408 var_name(i_sfc_temp),
'XY', fill_halo=.true. )
1410 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dir), &
1412 var_name(i_sfc_alb_ir_dir),
'XY', fill_halo=.true. )
1413 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dif), &
1415 var_name(i_sfc_alb_ir_dif),
'XY', fill_halo=.true. )
1416 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dir), &
1418 var_name(i_sfc_alb_nir_dir),
'XY', fill_halo=.true. )
1419 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dif), &
1421 var_name(i_sfc_alb_nir_dif),
'XY', fill_halo=.true. )
1422 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dir), &
1424 var_name(i_sfc_alb_vis_dir),
'XY', fill_halo=.true. )
1425 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dif), &
1427 var_name(i_sfc_alb_vis_dif),
'XY', fill_halo=.true. )