147 logical,
private :: urban_vars_checkrange = .false.
149 integer,
private,
parameter :: vmax = 19
150 integer,
private,
parameter :: i_trl = 1
151 integer,
private,
parameter :: i_tbl = 2
152 integer,
private,
parameter :: i_tgl = 3
153 integer,
private,
parameter :: i_tr = 4
154 integer,
private,
parameter :: i_tb = 5
155 integer,
private,
parameter :: i_tg = 6
156 integer,
private,
parameter :: i_tc = 7
157 integer,
private,
parameter :: i_qc = 8
158 integer,
private,
parameter :: i_uc = 9
159 integer,
private,
parameter :: i_rainr = 10
160 integer,
private,
parameter :: i_rainb = 11
161 integer,
private,
parameter :: i_raing = 12
162 integer,
private,
parameter :: i_sfc_temp = 13
163 integer,
private,
parameter :: i_sfc_alb_ir_dir = 14
164 integer,
private,
parameter :: i_sfc_alb_ir_dif = 15
165 integer,
private,
parameter :: i_sfc_alb_nir_dir = 16
166 integer,
private,
parameter :: i_sfc_alb_nir_dif = 17
167 integer,
private,
parameter :: i_sfc_alb_vis_dir = 18
168 integer,
private,
parameter :: i_sfc_alb_vis_dif = 19
170 character(len=H_SHORT),
private :: var_name(vmax)
171 character(len=H_MID),
private :: var_desc(vmax)
172 character(len=H_MID),
private :: var_stdn(vmax)
173 character(len=H_SHORT),
private :: var_unit(vmax)
174 integer,
private :: var_id(vmax)
175 integer,
private :: restart_fid = -1
177 data var_name /
'URBAN_TRL', &
190 'URBAN_SFC_ALB_IR_dir', &
191 'URBAN_SFC_ALB_IR_dif', &
192 'URBAN_SFC_ALB_NIR_dir', &
193 'URBAN_SFC_ALB_NIR_dif', &
194 'URBAN_SFC_ALB_VIS_dir', &
195 'URBAN_SFC_ALB_VIS_dif' /
197 data var_desc /
'urban temperature in layer of roof', &
198 'urban temperature in layer of wall', &
199 'urban temperature in layer of road', &
200 'urban surface temperature of roof', &
201 'urban surface temperature of wall', &
202 'urban surface temperature of road', &
203 'urban canopy air temperature', &
204 'urban canopy humidity', &
205 'urban canopy wind', &
206 'urban rain strage on roof', &
207 'urban rain strage on wall', &
208 'urban rain strage on road', &
209 'urban grid average of temperature', &
210 'urban grid average of albedo for IR (direct)', &
211 'urban grid average of albedo for IR (diffuse)', &
212 'urban grid average of albedo for NIR (direct)', &
213 'urban grid average of albedo for NIR (diffuse)', &
214 'urban grid average of albedo for VIS (direct)', &
215 'urban grid average of albedo for VIS (diffuse)' /
217 data var_stdn /
'', &
237 data var_unit /
'K', &
257 logical,
private :: urban_restart_in_check_coordinates = .true.
260 integer,
parameter :: im_trl = 1
261 integer,
parameter :: im_tbl = 2
262 integer,
parameter :: im_tgl = 3
263 integer,
parameter :: im_tr = 4
264 integer,
parameter :: im_tb = 5
265 integer,
parameter :: im_tg = 6
266 integer,
parameter :: im_tc = 7
267 integer,
parameter :: im_uc = 8
268 integer,
parameter :: im_qc = 9
269 integer,
parameter :: im_rainr = 10
270 integer,
parameter :: im_rainb = 11
271 integer,
parameter :: im_raing = 12
272 integer,
parameter :: im_roff = 13
273 integer,
parameter :: im_sfcwr = 14
274 integer,
parameter :: im_sfcwb = 15
275 integer,
parameter :: im_sfcwg = 16
276 integer,
parameter :: im_sfcir = 17
277 integer,
parameter :: im_sfcib = 18
278 integer,
parameter :: im_sfcig = 19
279 integer,
parameter :: im_masflx = 20
280 integer,
parameter :: im_engi_s = 21
281 integer,
parameter :: im_engi_sr = 22
282 integer,
parameter :: im_engi_sb = 23
283 integer,
parameter :: im_engi_sg = 24
284 integer,
parameter :: im_engi_w = 25
285 integer,
parameter :: im_engi_wr = 26
286 integer,
parameter :: im_engi_wb = 27
287 integer,
parameter :: im_engi_wg = 28
288 integer,
parameter :: im_engsfc_ghr = 29
289 integer,
parameter :: im_engsfc_ghb = 30
290 integer,
parameter :: im_engsfc_ghg = 31
291 integer,
parameter :: im_engsfc_eir = 32
292 integer,
parameter :: im_engsfc_eib = 33
293 integer,
parameter :: im_engsfc_eig = 34
294 integer,
parameter :: im_roff_ei = 35
295 integer,
parameter :: im_engflx = 36
296 integer,
parameter :: im_max = 35
297 integer,
private :: monit_id(im_max)
312 namelist / param_urban_vars / &
316 urban_restart_in_check_coordinates, &
323 urban_vars_checkrange
330 log_info(
"URBAN_vars_setup",*)
'Setup'
474 log_info(
"URBAN_vars_setup",*)
'Not found namelist. Default used.'
475 elseif( ierr > 0 )
then
476 log_error(
"URBAN_vars_setup",*)
'Not appropriate names in namelist PARAM_URBAN_VARS. Check!'
479 log_nml(param_urban_vars)
482 log_info(
"URBAN_vars_setup",*)
'List of prognostic variables (URBAN) '
483 log_info_cont(
'(1x,A,A24,A,A48,A,A12,A)') &
484 ' |',
'VARNAME ',
'|', &
485 'DESCRIPTION ',
'[',
'UNIT ',
']'
487 log_info_cont(
'(1x,A,I3,A,A24,A,A48,A,A12,A)') &
488 'NO.',iv,
'|',var_name(iv),
'|',var_desc(iv),
'[',var_unit(iv),
']'
496 log_info(
"URBAN_vars_setup",*)
'Restart input? : NO'
503 log_info(
"URBAN_vars_setup",*)
'Restart output? : NO'
508 call monitor_reg(
'URB_TRL',
'roof temperature',
'K m3', &
510 dim_type=
'UXY', is_tendency=.false. )
511 call monitor_reg(
'URB_TBL',
'wall temperature',
'K m3', &
513 dim_type=
'UXY', is_tendency=.false. )
514 call monitor_reg(
'URB_TGL',
'road temperature',
'K m3', &
516 dim_type=
'UXY', is_tendency=.false. )
517 call monitor_reg(
'URB_TR',
'roof surface temperature',
'K m2', &
519 dim_type=
'XY', is_tendency=.false. )
520 call monitor_reg(
'URB_TB',
'wall surface temperature',
'K m2', &
522 dim_type=
'XY', is_tendency=.false. )
523 call monitor_reg(
'URB_TG',
'road surface temperature',
'K m2', &
525 dim_type=
'XY', is_tendency=.false. )
526 call monitor_reg(
'URB_TC',
'canopy temperature',
'K m2', &
528 dim_type=
'XY', is_tendency=.false. )
529 call monitor_reg(
'URB_UC',
'canopy wind speed',
'm3/s', &
531 dim_type=
'XY', is_tendency=.false. )
532 call monitor_reg(
'URB_QC',
'canopy humidity',
'kg/m', &
534 dim_type=
'XY', is_tendency=.false. )
535 call monitor_reg(
'URB_RAINR',
'roof water',
'kg', &
536 monit_id(im_rainr), &
537 dim_type=
'XY', is_tendency=.false. )
538 call monitor_reg(
'URB_RAINB',
'wall water',
'kg', &
539 monit_id(im_rainb), &
540 dim_type=
'XY', is_tendency=.false. )
541 call monitor_reg(
'URB_RAING',
'road water',
'kg', &
542 monit_id(im_raing), &
543 dim_type=
'XY', is_tendency=.false. )
544 call monitor_reg(
'URB_ROFF',
'runoff water',
'kg', &
546 dim_type=
'XY', is_tendency=.false. )
558 file_cartesc_check_coordinates
563 character(len=19) :: timelabel
564 character(len=H_LONG) :: basename
568 log_info(
"URBAN_vars_restart_open",*)
'Open restart file (URBAN) '
579 log_info(
"URBAN_vars_restart_open",*)
'basename: ', trim(basename)
583 if ( urban_restart_in_check_coordinates )
then
584 call file_cartesc_check_coordinates( restart_fid, urban=.true. )
588 log_info(
"URBAN_vars_restart_open",*)
'restart file for urban is not specified.'
607 if ( restart_fid /= -1 )
then
609 log_info(
"URBAN_vars_restart_read",*)
'Read from restart file (URBAN) '
611 call file_cartesc_read( restart_fid, var_name(i_trl),
'UXY', &
613 call file_cartesc_read( restart_fid, var_name(i_tbl),
'UXY', &
615 call file_cartesc_read( restart_fid, var_name(i_tgl),
'UXY', &
618 call file_cartesc_read( restart_fid, var_name(i_tr),
'XY', &
620 call file_cartesc_read( restart_fid, var_name(i_tb),
'XY', &
622 call file_cartesc_read( restart_fid, var_name(i_tg),
'XY', &
624 call file_cartesc_read( restart_fid, var_name(i_tc),
'XY', &
626 call file_cartesc_read( restart_fid, var_name(i_qc),
'XY', &
628 call file_cartesc_read( restart_fid, var_name(i_uc),
'XY', &
631 call file_cartesc_read( restart_fid, var_name(i_rainr),
'XY', &
633 call file_cartesc_read( restart_fid, var_name(i_rainb),
'XY', &
635 call file_cartesc_read( restart_fid, var_name(i_raing),
'XY', &
638 call file_cartesc_read( restart_fid, var_name(i_sfc_temp),
'XY', &
640 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dir),
'XY', &
642 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_ir_dif),
'XY', &
644 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dir),
'XY', &
646 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_nir_dif),
'XY', &
648 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dir),
'XY', &
650 call file_cartesc_read( restart_fid, var_name(i_sfc_alb_vis_dif),
'XY', &
657 log_error(
"URBAN_vars_restart_read",*)
'invalid restart file ID for urban.'
676 call file_history_in(
urban_trl(:,:,:), var_name(i_trl), var_desc(i_trl), var_unit(i_trl), dim_type=
'UXY' )
677 call file_history_in(
urban_tbl(:,:,:), var_name(i_tbl), var_desc(i_tbl), var_unit(i_tbl), dim_type=
'UXY' )
678 call file_history_in(
urban_tgl(:,:,:), var_name(i_tgl), var_desc(i_tgl), var_unit(i_tgl), dim_type=
'UXY' )
680 call file_history_in(
urban_tr(:,:), var_name(i_tr), var_desc(i_tr), var_unit(i_tr) )
681 call file_history_in(
urban_tb(:,:), var_name(i_tb), var_desc(i_tb), var_unit(i_tb) )
682 call file_history_in(
urban_tg(:,:), var_name(i_tg), var_desc(i_tg), var_unit(i_tg) )
683 call file_history_in(
urban_tc(:,:), var_name(i_tc), var_desc(i_tc), var_unit(i_tc) )
684 call file_history_in(
urban_qc(:,:), var_name(i_qc), var_desc(i_qc), var_unit(i_qc) )
685 call file_history_in(
urban_uc(:,:), var_name(i_uc), var_desc(i_uc), var_unit(i_uc) )
687 call file_history_in(
urban_rainr(:,:), var_name(i_rainr), var_desc(i_rainr), var_unit(i_rainr) )
688 call file_history_in(
urban_rainb(:,:), var_name(i_rainb), var_desc(i_rainb), var_unit(i_rainb) )
689 call file_history_in(
urban_raing(:,:), var_name(i_raing), var_desc(i_raing), var_unit(i_raing) )
691 call file_history_in(
urban_sfc_temp(:,:), var_name(i_sfc_temp), &
692 var_desc(i_sfc_temp), var_unit(i_sfc_temp), standard_name=var_stdn(i_sfc_temp) )
695 var_desc(i_sfc_alb_ir_dir), var_unit(i_sfc_alb_ir_dir), standard_name=var_stdn(i_sfc_alb_ir_dir) )
697 var_desc(i_sfc_alb_ir_dif), var_unit(i_sfc_alb_ir_dif), standard_name=var_stdn(i_sfc_alb_ir_dif) )
699 var_desc(i_sfc_alb_nir_dir), var_unit(i_sfc_alb_nir_dir), standard_name=var_stdn(i_sfc_alb_nir_dir) )
701 var_desc(i_sfc_alb_nir_dif), var_unit(i_sfc_alb_nir_dif), standard_name=var_stdn(i_sfc_alb_nir_dif) )
703 var_desc(i_sfc_alb_vis_dir), var_unit(i_sfc_alb_vis_dir), standard_name=var_stdn(i_sfc_alb_vis_dir) )
705 var_desc(i_sfc_alb_vis_dif), var_unit(i_sfc_alb_vis_dif), standard_name=var_stdn(i_sfc_alb_vis_dif) )
707 call file_history_in(
urban_roff(:,:),
'URBAN_RUNOFF', &
708 'urban runoff water',
'kg/m2/s' )
711 'urban grid average of w-momentum flux',
'kg/m2/s' )
713 'urban grid average of u-momentum flux',
'kg/m2/s' )
715 'urban grid average of v-momentum flux',
'kg/m2/s' )
717 'urban grid average of sensible heat flux (upward)',
'W/m2' )
719 'urban grid average of latent heat flux (upward)',
'W/m2' )
721 'urban grid average of subsurface heat flux (downward)',
'W/m2' )
724 'urban grid average of water vapor flux (upward)',
'kg/m2/s' )
726 call file_history_in(
urban_ustar(:,:),
'URBAN_Ustar', &
727 'urban friction velocity',
'm/s' )
728 call file_history_in(
urban_tstar(:,:),
'URBAN_Tstar', &
729 'urban temperature scale',
'K' )
730 call file_history_in(
urban_qstar(:,:),
'URBAN_Qstar', &
731 'urban moisture scale',
'kg/kg' )
732 call file_history_in(
urban_wstar(:,:),
'URBAN_Wstar', &
733 'urban convective velocity scale',
'm/s' )
734 call file_history_in(
urban_rlmo(:,:),
'URBAN_RLmo', &
735 'urban inversed Obukhov length',
'1/m' )
736 call file_history_in(
urban_u10(:,:),
'URBAN_U10', &
737 'urban 10m x-wind',
'm/s' )
738 call file_history_in(
urban_v10(:,:),
'URBAN_V10', &
739 'urban 10m y-wind',
'm/s' )
740 call file_history_in(
urban_t2(:,:),
'URBAN_T2', &
741 'urban 2m temprerature',
'K' )
742 call file_history_in(
urban_q2(:,:),
'URBAN_Q2', &
743 'urban 2m specific humidity',
'kg/kg' )
744 call file_history_in(
urban_z0m(:,:),
'URBAN_Z0M', &
745 'urban parameter of rougness length for momentum',
'm' )
746 call file_history_in(
urban_z0h(:,:),
'URBAN_Z0H', &
747 'urban parameter of rougness length for heat',
'm' )
748 call file_history_in(
urban_z0e(:,:),
'URBAN_Z0E', &
749 'urban parameter of rougness length for vapor',
'm' )
750 call file_history_in(
urban_zd(:,:),
'URBAN_ZD', &
751 'urban parameter of displacement height',
'm' )
752 call file_history_in(
urban_ah(:,:),
'URBAN_AH', &
753 'urban parameter of anthropogenic sensible heat',
'W/m2' )
754 call file_history_in(
urban_ahl(:,:),
'URBAN_AHL', &
755 'urban parameter of anthropogenic latent heat',
'W/m2' )
780 call monitor_put( monit_id(im_trl),
urban_trl(:,:,:) )
781 call monitor_put( monit_id(im_tbl),
urban_tbl(:,:,:) )
782 call monitor_put( monit_id(im_tgl),
urban_tgl(:,:,:) )
784 call monitor_put( monit_id(im_tr),
urban_tr(:,:) )
785 call monitor_put( monit_id(im_tb),
urban_tb(:,:) )
786 call monitor_put( monit_id(im_tg),
urban_tg(:,:) )
787 call monitor_put( monit_id(im_tc),
urban_tc(:,:) )
788 call monitor_put( monit_id(im_uc),
urban_uc(:,:) )
789 if ( monit_id(im_qc) > 0 )
then
796 call monitor_put( monit_id(im_qc), work2d(:,:) )
800 call monitor_put( monit_id(im_rainr),
urban_rainr(:,:) )
801 call monitor_put( monit_id(im_rainb),
urban_rainb(:,:) )
802 call monitor_put( monit_id(im_raing),
urban_raing(:,:) )
803 call monitor_put( monit_id(im_roff) ,
urban_roff(:,:) )
953 logical,
intent(in),
optional :: force
957 if (
present(force) )
then
960 check = urban_vars_checkrange
965 urban_trl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_trl), &
968 urban_tbl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_tbl), &
971 urban_tgl(:,:,:), 0.0_rp, 1000.0_rp, var_name(i_tgl), &
974 urban_tr(:,:), 0.0_rp, 1000.0_rp, var_name(i_tr), &
977 urban_tb(:,:), 0.0_rp, 1000.0_rp, var_name(i_tb), &
980 urban_tg(:,:), 0.0_rp, 1000.0_rp, var_name(i_tg), &
983 urban_tc(:,:), 0.0_rp, 1000.0_rp, var_name(i_tc), &
986 urban_qc(:,:), 0.0_rp, 1.0_rp, var_name(i_qc), &
989 urban_uc(:,:), 0.0_rp, 100.0_rp, var_name(i_uc), &
992 urban_rainr(:,:), 0.0_rp, 1000.0_rp, var_name(i_rainr), &
995 urban_rainb(:,:), 0.0_rp, 1000.0_rp, var_name(i_rainb), &
998 urban_raing(:,:), 0.0_rp, 1000.0_rp, var_name(i_raing), &
1003 var_name(i_sfc_temp), __file__, __line__, &
1008 var_name(i_sfc_alb_ir_dir ), __file__, __line__, &
1012 var_name(i_sfc_alb_ir_dif ), __file__, __line__, &
1016 var_name(i_sfc_alb_nir_dir), __file__, __line__, &
1020 var_name(i_sfc_alb_nir_dif), __file__, __line__, &
1024 var_name(i_sfc_alb_vis_dir), __file__, __line__, &
1028 var_name(i_sfc_alb_vis_dif), __file__, __line__, &
1032 if (
present(force) )
then
1137 character(len=19) :: timelabel
1138 character(len=H_LONG) :: basename
1144 log_info(
"URBAN_vars_restart_create",*)
'Create restart file (URBAN) '
1153 log_info(
"URBAN_vars_restart_create",*)
'basename: ', trim(basename)
1172 if ( restart_fid /= -1 )
then
1187 if ( restart_fid /= -1 )
then
1189 log_info(
"URBAN_vars_restart_close",*)
'Close restart file (URBAN) '
1209 if ( restart_fid /= -1 )
then
1213 var_name(i), var_desc(i), var_unit(i), &
1217 do i = i_tr, i_sfc_alb_vis_dif
1219 var_name(i), var_desc(i), var_unit(i), &
1233 file_cartesc_write_var
1237 if ( restart_fid /= -1 )
then
1241 call file_cartesc_write_var( restart_fid, var_id(i_trl),
urban_trl(:,:,:), &
1242 var_name(i_trl),
'UXY', fill_halo=.true. )
1243 call file_cartesc_write_var( restart_fid, var_id(i_tbl),
urban_tbl(:,:,:), &
1244 var_name(i_tbl),
'UXY', fill_halo=.true. )
1245 call file_cartesc_write_var( restart_fid, var_id(i_tgl),
urban_tgl(:,:,:), &
1246 var_name(i_tgl),
'UXY', fill_halo=.true. )
1248 call file_cartesc_write_var( restart_fid, var_id(i_tr),
urban_tr(:,:), &
1249 var_name(i_tr),
'XY', fill_halo=.true. )
1250 call file_cartesc_write_var( restart_fid, var_id(i_tb),
urban_tb(:,:), &
1251 var_name(i_tb),
'XY', fill_halo=.true. )
1252 call file_cartesc_write_var( restart_fid, var_id(i_tg),
urban_tg(:,:), &
1253 var_name(i_tg),
'XY', fill_halo=.true. )
1254 call file_cartesc_write_var( restart_fid, var_id(i_tc),
urban_tc(:,:), &
1255 var_name(i_tc),
'XY', fill_halo=.true. )
1256 call file_cartesc_write_var( restart_fid, var_id(i_qc),
urban_qc(:,:), &
1257 var_name(i_qc),
'XY', fill_halo=.true. )
1258 call file_cartesc_write_var( restart_fid, var_id(i_uc),
urban_uc(:,:), &
1259 var_name(i_uc),
'XY', fill_halo=.true. )
1262 call file_cartesc_write_var( restart_fid, var_id(i_rainr),
urban_rainr(:,:), &
1263 var_name(i_rainr),
'XY', fill_halo=.true. )
1264 call file_cartesc_write_var( restart_fid, var_id(i_rainb),
urban_rainb(:,:), &
1265 var_name(i_rainb),
'XY', fill_halo=.true. )
1266 call file_cartesc_write_var( restart_fid, var_id(i_raing),
urban_raing(:,:), &
1267 var_name(i_raing),
'XY', fill_halo=.true. )
1269 call file_cartesc_write_var( restart_fid, var_id(i_sfc_temp), &
1271 var_name(i_sfc_temp),
'XY', fill_halo=.true. )
1273 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dir), &
1275 var_name(i_sfc_alb_ir_dir),
'XY', fill_halo=.true. )
1276 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_ir_dif), &
1278 var_name(i_sfc_alb_ir_dif),
'XY', fill_halo=.true. )
1279 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dir), &
1281 var_name(i_sfc_alb_nir_dir),
'XY', fill_halo=.true. )
1282 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_nir_dif), &
1284 var_name(i_sfc_alb_nir_dif),
'XY', fill_halo=.true. )
1285 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dir), &
1287 var_name(i_sfc_alb_vis_dir),
'XY', fill_halo=.true. )
1288 call file_cartesc_write_var( restart_fid, var_id(i_sfc_alb_vis_dif), &
1290 var_name(i_sfc_alb_vis_dif),
'XY', fill_halo=.true. )