SUEWS API Site
Documentation of SUEWS source code
Data Types | Functions/Subroutines
suews_driver Module Reference

Data Types

type  anthroemis_prm
 
type  anthroheat_prm
 
type  anthroheat_state
 
type  array_m
 
type  bioco2_prm
 
type  conductance_prm
 
type  config
 
type  ehc_prm
 
type  heat_state
 
type  hydro_state
 
type  irrig_daywater
 
type  irrigation_prm
 
type  lai_prm
 
type  lc_bldg_prm
 
type  lc_bsoil_prm
 
type  lc_dectr_prm
 
type  lc_evetr_prm
 
type  lc_grass_prm
 
type  lc_paved_prm
 
type  lc_water_prm
 
type  lumps_prm
 
type  method_prm
 
type  ohm_coef_lc
 
type  ohm_prm
 
type  ohm_state
 
type  output_block
 
type  output_line
 
type  phenology_state
 
type  site_prm
 
type  snow_prm
 
type  snow_state
 
type  soil_prm
 
type  spartacus_layer_prm
 
type  spartacus_prm
 
type  suews_forcing
 
type  suews_timer
 
type  surf_store_prm
 
type  water_dist_prm
 

Functions/Subroutines

subroutine output_line_init (this_line)
 
subroutine output_block_init (this_block, len)
 
subroutine output_block_finalize (this_line)
 
subroutine var2add_two (arg_type, res_type)
 
subroutine arr2add_two (arg_type, res_type)
 
subroutine suews_cal_main (ah_min, ahprof_24hr, ah_slope_cooling, ah_slope_heating, alb, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, alpha_bioco2, alpha_enh_bioco2, alt, kdown, avrh, avu1, baset, basete, beta_bioco2, beta_enh_bioco2, bldgh, capmax_dec, capmin_dec, chanohm, co2pointsource, cpanohm, crwmax, crwmin, daywat, daywatper, dectreeh, diagmethod, diagnose, drainrt, dt_since_start, dqndt, qn_av, dqnsdt, qn_s_av, ef_umolco2perj, emis, emissionsmethod, enef_v_jkm, enddls, evetreeh, faibldg, faidectree, faievetree, faimethod, faut, fcef_v_kgkm, fcld_obs, flowchange, frfossilfuel_heat, frfossilfuel_nonheat, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gdd_id, gddfull, gridiv, gsmodel, h_maintain, hdd_id, humactivity_24hr, icefrac, id, ie_a, ie_end, ie_m, ie_start, imin, internalwateruse_h, irrfracpaved, irrfracbldgs, irrfracevetr, irrfracdectr, irrfracgrass, irrfracbsoil, irrfracwater, isec, it, iy, kkanohm, kmax, lai_id, laimax, laimin, lai_obs, laipower, laitype, lat, lenday_id, ldown_obs, lng, maxconductance, maxfcmetab, maxqfmetab, snowwater, minfcmetab, minqfmetab, min_res_bioco2, narp_emis_snow, narp_trans_site, netradiationmethod, nlayer, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, ohm_coef, ohmincqf, ohm_threshsw, ohm_threshwd, pipecapacity, popdensdaytime, popdensnighttime, popprof_24hr, pormax_dec, pormin_dec, precip, preciplimit, preciplimitalb, press_hpa, qf0_beu, qf_a, qf_b, qf_c, qn1_obs, qs_obs, qf_obs, radmeltfact, raincover, rainmaxres, resp_a, resp_b, roughlenheatmethod, roughlenmommethod, runofftowater, s1, s2, sathydraulicconduct, sddfull, sdd_id, smdmethod, snowalb, snowalbmax, snowalbmin, snowpacklimit, snowdens, snowdensmax, snowdensmin, snowfallcum, snowfrac, snowlimbldg, snowlimpaved, snowfrac_obs, snowpack, snowprof_24hr, snowuse, soildepth, stabilitymethod, startdls, soilstore_surf, soilstorecap_surf, state_surf, statelimit_surf, wetthresh_surf, soilstore_roof, soilstorecap_roof, state_roof, statelimit_roof, wetthresh_roof, soilstore_wall, soilstorecap_wall, state_wall, statelimit_wall, wetthresh_wall, storageheatmethod, storedrainprm, surfacearea, tair_av, tau_a, tau_f, tau_r, tmax_id, tmin_id, baset_cooling, baset_heating, temp_c, tempmeltfact, th, theta_bioco2, timezone, tl, trafficrate, trafficunits, sfr_surf, tsfc_roof, tsfc_wall, tsfc_surf, temp_roof, temp_wall, temp_surf, tin_roof, tin_wall, tin_surf, k_roof, k_wall, k_surf, cp_roof, cp_wall, cp_surf, dz_roof, dz_wall, dz_surf, traffprof_24hr, ts5mindata_ir, tstep, tstep_prev, veg_type, waterdist, waterusemethod, wu_m3, wuday_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, wuprofa_24hr, wuprofm_24hr, xsmd, z, z0m_in, zdm_in, output_line_suews)
 
subroutine suews_cal_main_dts (ah_min, ahprof_24hr, ah_slope_cooling, ah_slope_heating, alb, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, alpha_bioco2, alpha_enh_bioco2, alt, kdown, avrh, avu1, baset, basete, beta_bioco2, beta_enh_bioco2, bldgh, capmax_dec, capmin_dec, chanohm, co2pointsource, cpanohm, crwmax, crwmin, daywat, daywatper, dectreeh, diagmethod, diagnose, drainrt, dt_since_start, dqndt, qn_av, dqnsdt, qn_s_av, ef_umolco2perj, emis, emissionsmethod, enef_v_jkm, enddls, evetreeh, faibldg, faidectree, faievetree, faimethod, faut, fcef_v_kgkm, fcld_obs, flowchange, frfossilfuel_heat, frfossilfuel_nonheat, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gdd_id, gddfull, gridiv, gsmodel, h_maintain, hdd_id, humactivity_24hr, icefrac, id, ie_a, ie_end, ie_m, ie_start, imin, internalwateruse_h, irrfracpaved, irrfracbldgs, irrfracevetr, irrfracdectr, irrfracgrass, irrfracbsoil, irrfracwater, isec, it, iy, kkanohm, kmax, lai_id, laimax, laimin, lai_obs, laipower, laitype, lat, lenday_id, ldown_obs, lng, maxconductance, maxfcmetab, maxqfmetab, snowwater, minfcmetab, minqfmetab, min_res_bioco2, narp_emis_snow, narp_trans_site, netradiationmethod, nlayer, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, ohm_coef, ohmincqf, ohm_threshsw, ohm_threshwd, pipecapacity, popdensdaytime, popdensnighttime, popprof_24hr, pormax_dec, pormin_dec, precip, preciplimit, preciplimitalb, press_hpa, qf0_beu, qf_a, qf_b, qf_c, qn1_obs, qs_obs, qf_obs, radmeltfact, raincover, rainmaxres, resp_a, resp_b, roughlenheatmethod, roughlenmommethod, runofftowater, s1, s2, sathydraulicconduct, sddfull, sdd_id, smdmethod, snowalb, snowalbmax, snowalbmin, snowpacklimit, snowdens, snowdensmax, snowdensmin, snowfallcum, snowfrac, snowlimbldg, snowlimpaved, snowfrac_obs, snowpack, snowprof_24hr, snowuse, soildepth, stabilitymethod, startdls, soilstore_surf, soilstorecap_surf, state_surf, statelimit_surf, wetthresh_surf, soilstore_roof, soilstorecap_roof, state_roof, statelimit_roof, wetthresh_roof, soilstore_wall, soilstorecap_wall, state_wall, statelimit_wall, wetthresh_wall, storageheatmethod, storedrainprm, surfacearea, tair_av, tau_a, tau_f, tau_r, tmax_id, tmin_id, baset_cooling, baset_heating, temp_c, tempmeltfact, th, theta_bioco2, timezone, tl, trafficrate, trafficunits, sfr_surf, tsfc_roof, tsfc_wall, tsfc_surf, temp_roof, temp_wall, temp_surf, tin_roof, tin_wall, tin_surf, k_roof, k_wall, k_surf, cp_roof, cp_wall, cp_surf, dz_roof, dz_wall, dz_surf, traffprof_24hr, ts5mindata_ir, tstep, tstep_prev, veg_type, waterdist, waterusemethod, wu_m3, wuday_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, wuprofa_24hr, wuprofm_24hr, xsmd, z, z0m_in, zdm_in, output_line_suews)
 
subroutine suews_cal_anthropogenicemission (ah_min, ahprof_24hr, ah_slope_cooling, ah_slope_heating, co2pointsource, dayofweek_id, dls, ef_umolco2perj, emissionsmethod, enef_v_jkm, fcef_v_kgkm, frfossilfuel_heat, frfossilfuel_nonheat, hdd_id, humactivity_24hr, imin, it, maxfcmetab, maxqfmetab, minfcmetab, minqfmetab, popdensdaytime, popdensnighttime, popprof_24hr, qf, qf0_beu, qf_a, qf_b, qf_c, qf_obs, qf_sahp, surfacearea, baset_cooling, baset_heating, temp_c, trafficrate, trafficunits, traffprof_24hr, fc_anthro, fc_build, fc_metab, fc_point, fc_traff)
 
subroutine suews_cal_anthropogenicemission_dts (ah_min_working, ah_min_holiday, ahprof_24hr_working, ahprof_24hr_holiday, ah_slope_cooling_working, ah_slope_cooling_holiday, ah_slope_heating_working, ah_slope_heating_holiday, co2pointsource, dayofweek_id, dls, ef_umolco2perj, emissionsmethod, enef_v_jkm, fcef_v_kgkm, frfossilfuel_heat, frfossilfuel_nonheat, hdd_id, humactivity_24hr_working, humactivity_24hr_holiday, imin, it, maxfcmetab, maxqfmetab, minfcmetab, minqfmetab, popdensdaytime_working, popdensdaytime_holiday, popdensnighttime, popprof_24hr_working, popprof_24hr_holiday, qf, qf0_beu_working, qf0_beu_holiday, qf_a_working, qf_a_holiday, qf_b_working, qf_b_holiday, qf_c_working, qf_c_holiday, qf_obs, qf_sahp, surfacearea, baset_cooling_working, baset_cooling_holiday, baset_heating_working, baset_heating_holiday, temp_c, trafficrate_working, trafficrate_holiday, trafficunits, traffprof_24hr_working, traffprof_24hr_holiday, fc_anthro, fc_build, fc_metab, fc_point, fc_traff)
 
subroutine suews_cal_biogenco2 (alpha_bioco2, alpha_enh_bioco2, avkdn, avrh, beta_bioco2, beta_enh_bioco2, dectime, diagnose, emissionsmethod, fc_anthro, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gfunc, gsmodel, id, it, kmax, lai_id, laimin, laimax, maxconductance, min_res_bioco2, press_hpa, resp_a, resp_b, s1, s2, sfr_surf, smdmethod, snowfrac, t2_c, temp_c, theta_bioco2, th, tl, vsmd, xsmd, fc, fc_biogen, fc_photo, fc_respi)
 
subroutine suews_cal_biogenco2_dts (alpha_bioco2_evetr, alpha_bioco2_dectr, alpha_bioco2_grass, alpha_enh_bioco2_evetr, alpha_enh_bioco2_dectr, alpha_enh_bioco2_grass, avkdn, avrh, beta_bioco2_evetr, beta_bioco2_dectr, beta_bioco2_grass, beta_enh_bioco2_evetr, beta_enh_bioco2_dectr, beta_enh_bioco2_grass, dectime, diagnose, emissionsmethod, fc_anthro, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gfunc, gsmodel, id, it, kmax, lai_id, laimin_evetr, laimin_dectr, laimin_grass, laimax_evetr, laimax_dectr, laimax_grass, maxconductance_evetr, maxconductance_dectr, maxconductance_grass, min_res_bioco2_evetr, min_res_bioco2_dectr, min_res_bioco2_grass, press_hpa, resp_a_evetr, resp_a_dectr, resp_a_grass, resp_b_evetr, resp_b_dectr, resp_b_grass, s1, s2, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, smdmethod, snowfrac, t2_c, temp_c, theta_bioco2_evetr, theta_bioco2_dectr, theta_bioco2_grass, th, tl, vsmd, xsmd, fc, fc_biogen, fc_photo, fc_respi)
 
subroutine suews_cal_qn (storageheatmethod, netradiationmethod, snowuse, tstep, nlayer, snowpack_prev, tau_a, tau_f, snowalbmax, snowalbmin, diagnose, ldown_obs, fcld_obs, dectime, zenith_deg, tsurf_0, kdown, tair_c, avrh, ea_hpa, qn1_obs, snowalb_prev, snowfrac_prev, diagqn, narp_trans_site, narp_emis_snow, icefrac, sfr_surf, sfr_roof, sfr_wall, tsfc_surf, tsfc_roof, tsfc_wall, emis, alb_prev, albdectr_id, albevetr_id, albgrass_id, lai_id, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, alb_next, ldown, fcld, qn_surf, qn_roof, qn_wall, qn, qn_snowfree, qn_snow, kclear, kup, lup, tsurf, qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, albedo_snow, snowalb_next, dataoutlinespartacus)
 
subroutine suews_cal_qn_dts (storageheatmethod, netradiationmethod, snowuse, tstep, nlayer, snowpack_prev, tau_a, tau_f, snowalbmax, snowalbmin, diagnose, ldown_obs, fcld_obs, dectime, zenith_deg, tsurf_0, kdown, tair_c, avrh, ea_hpa, qn1_obs, snowalb_prev, snowfrac_prev, diagqn, narp_trans_site, narp_emis_snow, icefrac, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, sfr_roof, sfr_wall, tsfc_surf, tsfc_roof, tsfc_wall, emis_paved, emis_bldg, emis_evetr, emis_dectr, emis_grass, emis_bsoil, emis_water, alb_prev, albdectr_id, albevetr_id, albgrass_id, lai_id, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, alb_next, ldown, fcld, qn_surf, qn_roof, qn_wall, qn, qn_snowfree, qn_snow, kclear, kup, lup, tsurf, qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, albedo_snow, snowalb_next, dataoutlinespartacus)
 
subroutine suews_cal_qs (storageheatmethod, qs_obs, ohmincqf, gridiv, id, tstep, dt_since_start, diagnose, nlayer, qg_surf, qg_roof, qg_wall, tsfc_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, tsfc_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, tsfc_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_surf, ohm_coef, ohm_threshsw, ohm_threshwd, soilstore_id, soilstorecap, state_id, snowuse, snowfrac, diagqs, hdd_id, metforcingdata_grid, ts5mindata_ir, qf, qn, avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, bldgh, alb, emis, cpanohm, kkanohm, chanohm, emissionsmethod, tair_av, qn_av_prev, dqndt_prev, qn_s_av_prev, dqnsdt_prev, storedrainprm, qn_s, dataoutlineestm, qs, qn_av_next, dqndt_next, qn_s_av_next, dqnsdt_next, deltaqi, a1, a2, a3, temp_out_roof, qs_roof, temp_out_wall, qs_wall, temp_out_surf, qs_surf)
 
subroutine suews_cal_qs_dts (storageheatmethod, qs_obs, ohmincqf, gridiv, id, tstep, dt_since_start, diagnose, nlayer, qg_surf, qg_roof, qg_wall, tsfc_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, tsfc_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, tsfc_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, ohm_coef_paved, ohm_coef_bldg, ohm_coef_evetr, ohm_coef_dectr, ohm_coef_grass, ohm_coef_bsoil, ohm_coef_water, ohm_threshsw_paved, ohm_threshsw_bldg, ohm_threshsw_evetr, ohm_threshsw_dectr, ohm_threshsw_grass, ohm_threshsw_bsoil, ohm_threshsw_water, ohm_threshwd_paved, ohm_threshwd_bldg, ohm_threshwd_evetr, ohm_threshwd_dectr, ohm_threshwd_grass, ohm_threshwd_bsoil, ohm_threshwd_water, soilstore_id, soilstorecap_paved, soilstorecap_bldg, soilstorecap_evetr, soilstorecap_dectr, soilstorecap_grass, soilstorecap_bsoil, soilstorecap_water, state_id, snowuse, snowfrac, diagqs, hdd_id, metforcingdata_grid, ts5mindata_ir, qf, qn, avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, bldgh, alb, emis_paved, emis_bldg, emis_evetr, emis_dectr, emis_grass, emis_bsoil, emis_water, cpanohm_paved, cpanohm_bldg, cpanohm_evetr, cpanohm_dectr, cpanohm_grass, cpanohm_bsoil, cpanohm_water, kkanohm_paved, kkanohm_bldg, kkanohm_evetr, kkanohm_dectr, kkanohm_grass, kkanohm_bsoil, kkanohm_water, chanohm_paved, chanohm_bldg, chanohm_evetr, chanohm_dectr, chanohm_grass, chanohm_bsoil, chanohm_water, emissionsmethod, tair_av, qn_av_prev, dqndt_prev, qn_s_av_prev, dqnsdt_prev, storedrainprm, qn_s, dataoutlineestm, qs, qn_av_next, dqndt_next, qn_s_av_next, dqnsdt_next, deltaqi, a1, a2, a3, temp_out_roof, qs_roof, temp_out_wall, qs_wall, temp_out_surf, qs_surf)
 
subroutine suews_cal_water (diagnose, snowuse, nonwaterfraction, addpipes, addimpervious, addveg, addwaterbody, state_id, sfr_surf, storedrainprm, waterdist, nsh_real, drain_per_tstep, drain, frac_water2runoff, additionalwater, runoffpipes, runoff_per_interval, addwater)
 
subroutine suews_cal_water_dts (diagnose, snowuse, nonwaterfraction, addpipes, addimpervious, addveg, addwaterbody, state_id, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, storedrainprm, waterdist_paved_topaved, waterdist_paved_tobldg, waterdist_paved_toevetr, waterdist_paved_todectr, waterdist_paved_tograss, waterdist_paved_tobsoil, waterdist_paved_towater, waterdist_paved_tosoilstore, waterdist_bldg_topaved, waterdist_bldg_tobldg, waterdist_bldg_toevetr, waterdist_bldg_todectr, waterdist_bldg_tograss, waterdist_bldg_tobsoil, waterdist_bldg_towater, waterdist_bldg_tosoilstore, waterdist_evetr_topaved, waterdist_evetr_tobldg, waterdist_evetr_toevetr, waterdist_evetr_todectr, waterdist_evetr_tograss, waterdist_evetr_tobsoil, waterdist_evetr_towater, waterdist_evetr_tosoilstore, waterdist_dectr_topaved, waterdist_dectr_tobldg, waterdist_dectr_toevetr, waterdist_dectr_todectr, waterdist_dectr_tograss, waterdist_dectr_tobsoil, waterdist_dectr_towater, waterdist_dectr_tosoilstore, waterdist_grass_topaved, waterdist_grass_tobldg, waterdist_grass_toevetr, waterdist_grass_todectr, waterdist_grass_tograss, waterdist_grass_tobsoil, waterdist_grass_towater, waterdist_grass_tosoilstore, waterdist_bsoil_topaved, waterdist_bsoil_tobldg, waterdist_bsoil_toevetr, waterdist_bsoil_todectr, waterdist_bsoil_tograss, waterdist_bsoil_tobsoil, waterdist_bsoil_towater, waterdist_bsoil_tosoilstore, nsh_real, drain_per_tstep, drain, frac_water2runoff, additionalwater, runoffpipes, runoff_per_interval, addwater)
 
subroutine suews_init_qh (avdens, avcp, h_mod, qn1, dectime, h_init)
 
subroutine suews_cal_snow (diagnose, nlayer, tstep, imin, it, evapmethod, dayofweek_id, crwmin, crwmax, dectime, avdens, avcp, lv_j_kg, lvs_j_kg, avrh, press_hpa, temp_c, rasnow, psyc_hpa, sice_hpa, tau_r, radmeltfact, tempmeltfact, snowalbmax, preciplimit, preciplimitalb, qn_ind_snow, kup_ind_snow, deltaqi, tsurf_ind_snow, snowalb_in, pervfraction, vegfraction, addimpervious, qn_snowfree, qf, qs, vpd_hpa, s_hpa, rs, ra, rb, snowdensmax, snowdensmin, precip, pipecapacity, runofftowater, addveg, snowlimpaved, snowlimbldg, flowchange, drain, wetthresh_surf, soilstorecap, tsurf_ind, sfr_surf, addwater, addwaterrunoff, storedrainprm, snowpacklimit, snowprof_24hr, snowpack_in, snowfrac_in, snowwater_in, icefrac_in, snowdens_in, snowfallcum_in, state_id_in, soilstore_id_in, qn_surf, qs_surf, snowremoval, snowpack_out, snowfrac_out, snowwater_out, icefrac_out, snowdens_out, snowfallcum_out, state_id_out, soilstore_id_out, state_per_tstep, nwstate_per_tstep, qe, qe_surf, qe_roof, qe_wall, snowalb_out, swe, chsnow_per_tstep, ev_per_tstep, runoff_per_tstep, surf_chang_per_tstep, runoffpipes, mwstore, runoffwaterbody, runoffagveg, runoffagimpervious, rss_surf, dataoutlinesnow)
 
subroutine suews_cal_snow_dts (diagnose, nlayer, tstep, imin, it, evapmethod, dayofweek_id, crwmin, crwmax, dectime, avdens, avcp, lv_j_kg, lvs_j_kg, avrh, press_hpa, temp_c, rasnow, psyc_hpa, sice_hpa, tau_r, radmeltfact, tempmeltfact, snowalbmax, preciplimit, preciplimitalb, qn_ind_snow, kup_ind_snow, deltaqi, tsurf_ind_snow, snowalb_in, pervfraction, vegfraction, addimpervious, qn_snowfree, qf, qs, vpd_hpa, s_hpa, rs, ra, rb, snowdensmax, snowdensmin, precip, pipecapacity, runofftowater, addveg, snowlimpaved, snowlimbldg, flowchange, drain, wetthresh_paved, wetthresh_bldg, wetthresh_evetr, wetthresh_dectr, wetthresh_grass, wetthresh_bsoil, wetthresh_water, soilstorecap_paved, soilstorecap_bldg, soilstorecap_evetr, soilstorecap_dectr, soilstorecap_grass, soilstorecap_bsoil, soilstorecap_water, tsurf_ind, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, addwater, addwaterrunoff, storedrainprm, snowpacklimit, snowprof_24hr_working, snowprof_24hr_holiday, snowpack_in, snowfrac_in, snowwater_in, icefrac_in, snowdens_in, snowfallcum_in, state_id_in, soilstore_id_in, qn_surf, qs_surf, snowremoval, snowpack_out, snowfrac_out, snowwater_out, icefrac_out, snowdens_out, snowfallcum_out, state_id_out, soilstore_id_out, state_per_tstep, nwstate_per_tstep, qe, qe_surf, qe_roof, qe_wall, snowalb_out, swe, chsnow_per_tstep, ev_per_tstep, runoff_per_tstep, surf_chang_per_tstep, runoffpipes, mwstore, runoffwaterbody, runoffagveg, runoffagimpervious, rss_surf, dataoutlinesnow)
 
subroutine suews_cal_qe (diagnose, storageheatmethod, nlayer, tstep, evapmethod, avdens, avcp, lv_j_kg, psyc_hpa, pervfraction, addimpervious, qf, vpd_hpa, s_hpa, rs, ra_h, rb, precip, pipecapacity, runofftowater, nonwaterfraction, wu_surf, addveg, addwaterbody, addwater_surf, flowchange, drain_surf, frac_water2runoff_surf, storedrainprm, sfr_surf, statelimit_surf, soilstorecap_surf, wetthresh_surf, state_surf_in, soilstore_surf_in, qn_surf, qs_surf, sfr_roof, statelimit_roof, soilstorecap_roof, wetthresh_roof, state_roof_in, soilstore_roof_in, qn_roof, qs_roof, sfr_wall, statelimit_wall, soilstorecap_wall, wetthresh_wall, state_wall_in, soilstore_wall_in, qn_wall, qs_wall, state_surf_out, soilstore_surf_out, ev_surf, state_roof_out, soilstore_roof_out, ev_roof, state_wall_out, soilstore_wall_out, ev_wall, state_grid, nwstate_grid, ev0_surf, qe0_surf, qe, qe_surf, qe_roof, qe_wall, ev_grid, runoff_grid, surf_chang_grid, runoffpipes_grid, runoffwaterbody_grid, runoffagveg_grid, runoffagimpervious_grid, rss_surf)
 
subroutine suews_cal_qe_dts (diagnose, storageheatmethod, nlayer, tstep, evapmethod, avdens, avcp, lv_j_kg, psyc_hpa, pervfraction, addimpervious, qf, vpd_hpa, s_hpa, rs, ra_h, rb, precip, pipecapacity, runofftowater, nonwaterfraction, wu_surf, addveg, addwaterbody, addwater_surf, flowchange, drain_surf, frac_water2runoff_surf, storedrainprm, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, statelimit_paved, statelimit_bldg, statelimit_evetr, statelimit_dectr, statelimit_grass, statelimit_bsoil, statelimit_water, soilstorecap_paved, soilstorecap_bldg, soilstorecap_evetr, soilstorecap_dectr, soilstorecap_grass, soilstorecap_bsoil, soilstorecap_water, wetthresh_paved, wetthresh_bldg, wetthresh_evetr, wetthresh_dectr, wetthresh_grass, wetthresh_bsoil, wetthresh_water, state_surf_in, soilstore_surf_in, qn_surf, qs_surf, sfr_roof, statelimit_roof, soilstorecap_roof, wetthresh_roof, state_roof_in, soilstore_roof_in, qn_roof, qs_roof, sfr_wall, statelimit_wall, soilstorecap_wall, wetthresh_wall, state_wall_in, soilstore_wall_in, qn_wall, qs_wall, state_surf_out, soilstore_surf_out, ev_surf, state_roof_out, soilstore_roof_out, ev_roof, state_wall_out, soilstore_wall_out, ev_wall, state_grid, nwstate_grid, ev0_surf, qe0_surf, qe, qe_surf, qe_roof, qe_wall, ev_grid, runoff_grid, surf_chang_grid, runoffpipes_grid, runoffwaterbody_grid, runoffagveg_grid, runoffagimpervious_grid, rss_surf)
 
subroutine suews_cal_qh (qhmethod, nlayer, storageheatmethod, qn, qf, qmrain, qe, qs, qmfreez, qm, avdens, avcp, sfr_surf, sfr_roof, sfr_wall, tsfc_surf, tsfc_roof, tsfc_wall, temp_c, ra, qh, qh_residual, qh_resist, qh_resist_surf, qh_resist_roof, qh_resist_wall)
 
subroutine suews_cal_qh_dts (qhmethod, nlayer, storageheatmethod, qn, qf, qmrain, qe, qs, qmfreez, qm, avdens, avcp, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, sfr_roof, sfr_wall, tsfc_surf, tsfc_roof, tsfc_wall, temp_c, ra, qh, qh_residual, qh_resist, qh_resist_surf, qh_resist_roof, qh_resist_wall)
 
subroutine suews_cal_resistance (stabilitymethod, diagnose, aerodynamicresistancemethod, roughlenheatmethod, snowuse, id, it, gsmodel, smdmethod, avdens, avcp, qh_init, zzd, z0m, zdm, avu1, temp_c, vegfraction, avkdn, kmax, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, s1, s2, th, tl, dq, xsmd, vsmd, maxconductance, laimax, lai_id, snowfrac, sfr_surf, g_kdown, g_dq, g_ta, g_smd, g_lai, ustar, tstar, l_mod, zl, gsc, rs, ra, rasnow, rb, z0v, z0vsnow)
 
subroutine suews_cal_resistance_dts (stabilitymethod, diagnose, aerodynamicresistancemethod, roughlenheatmethod, snowuse, id, it, gsmodel, smdmethod, avdens, avcp, qh_init, zzd, z0m, zdm, avu1, temp_c, vegfraction, avkdn, kmax, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, s1, s2, th, tl, dq, xsmd, vsmd, maxconductance_evetr, maxconductance_dectr, maxconductance_grass, laimax_evetr, laimax_dectr, laimax_grass, lai_id, snowfrac, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, g_kdown, g_dq, g_ta, g_smd, g_lai, ustar, tstar, l_mod, zl, gsc, rs, ra, rasnow, rb, z0v, z0vsnow)
 
subroutine suews_update_outputline (additionalwater, alb, avkdn, avu10_ms, azimuth, chsnow_per_interval, dectime, drain_per_tstep, e_mod, ev_per_tstep, ext_wu, fc, fc_build, fcld, fc_metab, fc_photo, fc_respi, fc_point, fc_traff, flowchange, h_mod, id, imin, int_wu, it, iy, kup, lai_id, ldown, l_mod, lup, mwh, mwstore, nsh_real, nwstate_per_tstep, precip, q2_gkg, qeout, qf, qh, qh_resist, qm, qmfreez, qmrain, qn, qn_snow, qn_snowfree, qs, ra, resistsurf, rh2, runoffagimpervious, runoffagveg, runoff_per_tstep, runoffpipes, runoffsoil_per_tstep, runoffwaterbody, sfr_surf, smd, smd_nsurf, snowalb, snowremoval, state_id, state_per_tstep, surf_chang_per_tstep, swe, t2_c, tskin_c, tot_chang_per_tstep, tsurf, ustar, wu_nsurf, z0m, zdm, zenith_deg, datetimeline, dataoutlinesuews)
 
subroutine ehc_update_outputline (iy, id, it, imin, dectime, nlayer, tsfc_out_surf, qs_surf, tsfc_out_roof, qn_roof, qs_roof, qe_roof, qh_roof, state_roof, soilstore_roof, tsfc_out_wall, qn_wall, qs_wall, qe_wall, qh_wall, state_wall, soilstore_wall, datetimeline, dataoutlineehc)
 
real(kind(1d0)) function, dimension(n_fill) fill_result_x (res_valid, n_fill)
 
subroutine suews_update_output (snowuse, storageheatmethod, readlinesmetdata, numberofgrids, ir, gridiv, dataoutlinesuews, dataoutlinesnow, dataoutlineestm, dataoutlinersl, dataoutlinebeers, dataoutlinedebug, dataoutlinespartacus, dataoutlineehc, dataoutsuews, dataoutsnow, dataoutestm, dataoutrsl, dataoutbeers, dataoutdebug, dataoutspartacus, dataoutehc)
 
subroutine suews_cal_surf (storageheatmethod, netradiationmethod, nlayer, sfr_surf, building_frac, building_scale, height, vegfraction, impervfraction, pervfraction, nonwaterfraction, sfr_roof, sfr_wall)
 
subroutine suews_cal_surf_dts (storageheatmethod, netradiationmethod, nlayer, sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water, building_frac, building_scale, height, vegfraction, impervfraction, pervfraction, nonwaterfraction, sfr_roof, sfr_wall)
 
elemental real(kind(1d0)) function set_nan (x)
 
real(kind(1d0)) function square (x)
 
real function square_real (x)
 
subroutine output_name_n (i, name, group, aggreg, outlevel)
 
subroutine output_size (nvar)
 
subroutine suews_cal_multitsteps (metforcingblock, len_sim, ah_min, ahprof_24hr, ah_slope_cooling, ah_slope_heating, alb, albmax_dectr, albmax_evetr, albmax_grass, albmin_dectr, albmin_evetr, albmin_grass, alpha_bioco2, alpha_enh_bioco2, alt, baset, basete, beta_bioco2, beta_enh_bioco2, bldgh, capmax_dec, capmin_dec, chanohm, co2pointsource, cpanohm, crwmax, crwmin, daywat, daywatper, dectreeh, diagmethod, diagnose, drainrt, dt_since_start, dqndt, qn_av, dqnsdt, qn_s_av, ef_umolco2perj, emis, emissionsmethod, enef_v_jkm, enddls, evetreeh, faibldg, faidectree, faievetree, faimethod, faut, fcef_v_kgkm, flowchange, frfossilfuel_heat, frfossilfuel_nonheat, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gdd_id, gddfull, gridiv, gsmodel, h_maintain, hdd_id, humactivity_24hr, icefrac, ie_a, ie_end, ie_m, ie_start, internalwateruse_h, irrfracpaved, irrfracbldgs, irrfracevetr, irrfracdectr, irrfracgrass, irrfracbsoil, irrfracwater, kkanohm, kmax, lai_id, laimax, laimin, laipower, laitype, lat, lng, maxconductance, maxfcmetab, maxqfmetab, snowwater, minfcmetab, minqfmetab, min_res_bioco2, narp_emis_snow, narp_trans_site, netradiationmethod, ohm_coef, ohmincqf, ohm_threshsw, ohm_threshwd, pipecapacity, popdensdaytime, popdensnighttime, popprof_24hr, pormax_dec, pormin_dec, preciplimit, preciplimitalb, qf0_beu, qf_a, qf_b, qf_c, nlayer, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, radmeltfact, raincover, rainmaxres, resp_a, resp_b, roughlenheatmethod, roughlenmommethod, runofftowater, s1, s2, sathydraulicconduct, sddfull, sdd_id, smdmethod, snowalb, snowalbmax, snowalbmin, snowpacklimit, snowdens, snowdensmax, snowdensmin, snowfallcum, snowfrac, snowlimbldg, snowlimpaved, snowpack, snowprof_24hr, snowuse, soildepth, stabilitymethod, startdls, soilstore_surf, soilstorecap_surf, state_surf, statelimit_surf, wetthresh_surf, soilstore_roof, soilstorecap_roof, state_roof, statelimit_roof, wetthresh_roof, soilstore_wall, soilstorecap_wall, state_wall, statelimit_wall, wetthresh_wall, storageheatmethod, storedrainprm, surfacearea, tair_av, tau_a, tau_f, tau_r, baset_cooling, baset_heating, tempmeltfact, th, theta_bioco2, timezone, tl, trafficrate, trafficunits, sfr_surf, tsfc_roof, tsfc_wall, tsfc_surf, temp_roof, temp_wall, temp_surf, tin_roof, tin_wall, tin_surf, k_wall, k_roof, k_surf, cp_wall, cp_roof, cp_surf, dz_wall, dz_roof, dz_surf, tmin_id, tmax_id, lenday_id, traffprof_24hr, ts5mindata_ir, tstep, tstep_prev, veg_type, waterdist, waterusemethod, wuday_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, wuprofa_24hr, wuprofm_24hr, z, z0m_in, zdm_in, output_block_suews)
 
subroutine suews_cal_sunposition (year, idectime, utc, locationlatitude, locationlongitude, locationaltitude, sunazimuth, sunzenith)
 
real(kind(1d0)) function cal_tair_av (tair_av_prev, dt_since_start, tstep, temp_c)
 
real(kind(1d0)) function cal_tsfc (qh, avdens, avcp, ra, temp_c)
 

Function/Subroutine Documentation

◆ arr2add_two()

subroutine suews_driver::arr2add_two ( type(array_m), intent(in) arg_type,
type(array_m), intent(out) res_type )

Definition at line 644 of file suews_ctrl_driver.f95.

645 TYPE(array_m), INTENT(in) :: arg_type
646 TYPE(array_m), INTENT(out) :: res_type
647 res_type%var1 = arg_type%var1*2
648 res_type%var2 = arg_type%var2 + 3
649

◆ cal_tair_av()

real(kind(1d0)) function suews_driver::cal_tair_av ( real(kind(1d0)), intent(in) tair_av_prev,
integer, intent(in) dt_since_start,
integer, intent(in) tstep,
real(kind(1d0)), intent(in) temp_c )

Definition at line 10948 of file suews_ctrl_driver.f95.

10949 ! calculate mean air temperature of past 24 hours
10950 ! TS, 17 Sep 2019
10951 IMPLICIT NONE
10952 REAL(KIND(1D0)), INTENT(in) :: tair_av_prev
10953 REAL(KIND(1D0)), INTENT(in) :: temp_c
10954 INTEGER, INTENT(in) :: dt_since_start
10955 INTEGER, INTENT(in) :: tstep
10956
10957 REAL(KIND(1D0)) :: tair_av_next
10958
10959 REAL(KIND(1D0)), PARAMETER :: len_day_s = 24*3600 ! day length in seconds
10960 REAL(KIND(1D0)) :: len_cal_s ! length of average period in seconds
10961 REAL(KIND(1D0)) :: temp_k ! temp in K
10962
10963 ! determine the average period
10964 IF (dt_since_start > len_day_s) THEN
10965 ! if simulation has been running over one day
10966 len_cal_s = len_day_s
10967 ELSE
10968 ! if simulation has been running less than one day
10969 len_cal_s = dt_since_start + tstep
10970 END IF
10971 temp_k = temp_c + 273.15
10972 tair_av_next = tair_av_prev*(len_cal_s - tstep*1.)/len_cal_s + temp_k*tstep/len_cal_s
10973

Referenced by suews_cal_main(), and suews_cal_main_dts().

Here is the caller graph for this function:

◆ cal_tsfc()

real(kind(1d0)) function suews_driver::cal_tsfc ( real(kind(1d0)), intent(in) qh,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(in) temp_c )

Definition at line 10976 of file suews_ctrl_driver.f95.

10977 ! calculate surface/skin temperature
10978 ! TS, 23 Oct 2019
10979 IMPLICIT NONE
10980 REAL(KIND(1D0)), INTENT(in) :: qh ! sensible heat flux [W m-2]
10981 REAL(KIND(1D0)), INTENT(in) :: avdens ! air density [kg m-3]
10982 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J m-3 K-1]
10983 REAL(KIND(1D0)), INTENT(in) :: RA !Aerodynamic resistance [s m^-1]
10984 REAL(KIND(1D0)), INTENT(in) :: temp_C ! air temperature [C]
10985
10986 REAL(KIND(1D0)) :: tsfc_C ! surface temperature [C]
10987
10988 tsfc_c = qh/(avdens*avcp)*ra + temp_c

References moist::avcp, and moist::avdens.

Referenced by suews_cal_main(), and suews_cal_main_dts().

Here is the caller graph for this function:

◆ ehc_update_outputline()

subroutine suews_driver::ehc_update_outputline ( integer, intent(in) iy,
integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) imin,
real(kind(1d0)), intent(in) dectime,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_out_surf,
real(kind(1d0)), dimension(nsurf), intent(in) qs_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_out_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qn_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qs_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qe_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qh_roof,
real(kind(1d0)), dimension(nlayer), intent(in) state_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_out_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qn_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qs_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qe_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qh_wall,
real(kind(1d0)), dimension(nlayer), intent(in) state_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_wall,
real(kind(1d0)), dimension(5), intent(out) datetimeline,
real(kind(1d0)), dimension(ncolumnsdataoutehc - 5), intent(out) dataoutlineehc )

Definition at line 9499 of file suews_ctrl_driver.f95.

9517 IMPLICIT NONE
9518
9519 REAL(KIND(1D0)), PARAMETER :: NAN = -999
9520 INTEGER, PARAMETER :: n_fill = 15
9521
9522 INTEGER, INTENT(in) :: iy ! year [YYYY]
9523 INTEGER, INTENT(in) :: id ! day of the year [DOY]
9524 INTEGER, INTENT(in) :: it ! hour [H]
9525 INTEGER, INTENT(in) :: imin ! minutes [M]
9526
9527 INTEGER, INTENT(in) :: nlayer ! number of vertical levels in urban canopy [-]
9528 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
9529
9530 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_out_surf !surface temperature [degC]
9531 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qs_surf !heat storage flux of each surface type [W m-2]
9532 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_out_roof !roof surface temperature [degC]
9533 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: Qn_roof !net all-wave radiation of the roof [W m-2]
9534 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QS_roof !heat storage flux of the roof [W m-2]
9535 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QE_roof !latent heat flux of the roof [W m-2]
9536 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QH_roof !sensible heat flux of the roof [W m-2]
9537 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_roof !wetness state of the roof [mm]
9538 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_roof !soil moisture of roof [mm]
9539 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_out_wall !wall surface temperature [degC]
9540 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: Qn_wall !net all-wave radiation of the wall [W m-2]
9541 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QS_wall !heat storage flux of the wall [W m-2]
9542 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QE_wall !latent heat flux of the wall [W m-2]
9543 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: QH_wall !sensible heat flux of the wall [W m-2]
9544 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_wall !wetness state of the wall [mm]
9545 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_wall !soil moisture of wall [mm]
9546
9547 REAL(KIND(1D0)), DIMENSION(5), INTENT(OUT) :: datetimeLine !date & time
9548 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutEHC - 5), INTENT(out) :: dataOutLineEHC
9549 ! REAL(KIND(1d0)),DIMENSION(ncolumnsDataOutSnow-5),INTENT(out) :: dataOutLineSnow
9550 ! REAL(KIND(1d0)),DIMENSION(ncolumnsDataOutESTM-5),INTENT(out) :: dataOutLineESTM
9551 ! INTEGER:: is
9552 REAL(KIND(1D0)) :: LAI_wt !area weighted LAI [m2 m-2]
9553 REAL(KIND(1D0)) :: RH2_pct ! RH2 in percentage [-]
9554
9555 ! the variables below with '_x' endings stand for 'exported' values
9556 REAL(KIND(1D0)) :: ResistSurf_x !output surface resistance [s m-1]
9557 REAL(KIND(1D0)) :: surf_chang_per_tstep_x !output change in state_id (exluding snowpack) per timestep [mm]
9558 REAL(KIND(1D0)) :: l_mod_x !output Obukhov length [m]
9559 REAL(KIND(1D0)) :: bulkalbedo !output area-weighted albedo [-]
9560 REAL(KIND(1D0)) :: smd_nsurf_x(nsurf) !output soil moisture deficit for each surface [mm]
9561 REAL(KIND(1D0)) :: state_x(nsurf) !output wetness status of each surfaces[mm]
9562 REAL(KIND(1D0)) :: wu_DecTr !water use for deciduous tree and shrubs [mm]
9563 REAL(KIND(1D0)) :: wu_EveTr !water use of evergreen tree and shrubs [mm]
9564 REAL(KIND(1D0)) :: wu_Grass !water use for grass [mm]
9565
9566 ! date & time:
9567 datetimeline = [ &
9568 REAL(iy, KIND(1D0)), REAL(id, KIND(1D0)), &
9569 REAL(it, KIND(1D0)), REAL(imin, KIND(1D0)), dectime]
9570 !Define the overall output matrix to be printed out step by step
9571 dataoutlineehc = [ &
9572 tsfc_out_surf, qs_surf, & !output
9573 fill_result_x(tsfc_out_roof, n_fill), &
9574 fill_result_x(qn_roof, n_fill), &
9575 fill_result_x(qs_roof, n_fill), &
9576 fill_result_x(qe_roof, n_fill), &
9577 fill_result_x(qh_roof, n_fill), &
9578 fill_result_x(state_roof, n_fill), &
9579 fill_result_x(soilstore_roof, n_fill), &
9580 fill_result_x(tsfc_out_wall, n_fill), &
9581 fill_result_x(qn_wall, n_fill), &
9582 fill_result_x(qs_wall, n_fill), &
9583 fill_result_x(qe_wall, n_fill), &
9584 fill_result_x(qh_wall, n_fill), &
9585 fill_result_x(state_wall, n_fill), &
9586 fill_result_x(soilstore_wall, n_fill) &
9587 ]
9588 ! set invalid values to NAN
9589 ! dataOutLineSUEWS = set_nan(dataOutLineSUEWS)
9590
9591 !====================update output line end==============================
9592

References fill_result_x().

Referenced by suews_cal_main(), and suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill_result_x()

real(kind(1d0)) function, dimension(n_fill) suews_driver::fill_result_x ( real(kind(1d0)), dimension(:), intent(in) res_valid,
integer, intent(in) n_fill )

Definition at line 9596 of file suews_ctrl_driver.f95.

9597 IMPLICIT NONE
9598 REAL(KIND(1D0)), DIMENSION(:), INTENT(IN) :: res_valid
9599 INTEGER, INTENT(IN) :: n_fill
9600 REAL(KIND(1D0)), DIMENSION(n_fill) :: res_filled
9601
9602 REAL(KIND(1D0)), PARAMETER :: NAN = -999
9603
9604 res_filled = reshape(res_valid, [n_fill], pad=[nan])

Referenced by ehc_update_outputline().

Here is the caller graph for this function:

◆ output_block_finalize()

subroutine suews_driver::output_block_finalize ( type(output_block), intent(inout) this_line)

Definition at line 620 of file suews_ctrl_driver.f95.

621 TYPE(output_block), INTENT(inout) :: this_line
622
623 ! Deallocate memory for the arrays
624 IF (ALLOCATED(this_line%dataOutBlockSUEWS)) DEALLOCATE (this_line%dataOutBlockSUEWS)
625 IF (ALLOCATED(this_line%dataOutBlockSnow)) DEALLOCATE (this_line%dataOutBlockSnow)
626 IF (ALLOCATED(this_line%dataOutBlockESTM)) DEALLOCATE (this_line%dataOutBlockESTM)
627 IF (ALLOCATED(this_line%dataOutBlockEHC)) DEALLOCATE (this_line%dataOutBlockEHC)
628 IF (ALLOCATED(this_line%dataOutBlockRSL)) DEALLOCATE (this_line%dataOutBlockRSL)
629 IF (ALLOCATED(this_line%dataOutBlockBEERS)) DEALLOCATE (this_line%dataOutBlockBEERS)
630 IF (ALLOCATED(this_line%dataOutBlockDebug)) DEALLOCATE (this_line%dataOutBlockDebug)
631 IF (ALLOCATED(this_line%dataOutBlockSPARTACUS)) DEALLOCATE (this_line%dataOutBlockSPARTACUS)
632 IF (ALLOCATED(this_line%dataOutBlockDailyState)) DEALLOCATE (this_line%dataOutBlockDailyState)
633

Referenced by suews_cal_multitsteps().

Here is the caller graph for this function:

◆ output_block_init()

subroutine suews_driver::output_block_init ( type(output_block), intent(inout) this_block,
integer, intent(in) len )

Definition at line 593 of file suews_ctrl_driver.f95.

594 TYPE(output_block), INTENT(inout) :: this_block
595 INTEGER, INTENT(in) :: len
596
597 ! Allocate memory for the arrays
598 ALLOCATE (this_block%dataOutBlockSUEWS(len, ncolumnsdataoutsuews))
599 ALLOCATE (this_block%dataOutBlockSnow(len, ncolumnsdataoutsnow))
600 ALLOCATE (this_block%dataOutBlockESTM(len, ncolumnsdataoutestm))
601 ALLOCATE (this_block%dataOutBlockEHC(len, ncolumnsdataoutehc))
602 ALLOCATE (this_block%dataOutBlockRSL(len, ncolumnsdataoutrsl))
603 ALLOCATE (this_block%dataOutBlockBEERS(len, ncolumnsdataoutbeers))
604 ALLOCATE (this_block%dataOutBlockDebug(len, ncolumnsdataoutdebug))
605 ALLOCATE (this_block%dataOutBlockSPARTACUS(len, ncolumnsdataoutspartacus))
606 ALLOCATE (this_block%dataOutBlockDailyState(len, ncolumnsdataoutdailystate))
607
608 ! Set default values
609 this_block%dataOutBlockSUEWS = -999.0
610 this_block%dataOutBlockSnow = -999.0
611 this_block%dataOutBlockESTM = -999.0
612 this_block%dataOutBlockEHC = -999.0
613 this_block%dataOutBlockRSL = -999.0
614 this_block%dataOutBlockBEERS = -999.0
615 this_block%dataOutBlockDebug = -999.0
616 this_block%dataOutBlockSPARTACUS = -999.0
617 this_block%dataOutBlockDailyState = -999.0

References allocatearray::ncolumnsdataoutbeers, allocatearray::ncolumnsdataoutdailystate, allocatearray::ncolumnsdataoutdebug, allocatearray::ncolumnsdataoutehc, allocatearray::ncolumnsdataoutestm, allocatearray::ncolumnsdataoutrsl, allocatearray::ncolumnsdataoutsnow, allocatearray::ncolumnsdataoutspartacus, and allocatearray::ncolumnsdataoutsuews.

Referenced by suews_cal_multitsteps().

Here is the caller graph for this function:

◆ output_line_init()

subroutine suews_driver::output_line_init ( type(output_line), intent(inout) this_line)

Definition at line 577 of file suews_ctrl_driver.f95.

578 TYPE(output_line), INTENT(inout) :: this_line
579
580 ! Set default values
581 this_line%datetimeLine = -999.0
582 this_line%dataOutLineSUEWS = -999.0
583 this_line%dataOutLineSnow = -999.0
584 this_line%dataOutLineESTM = -999.0
585 this_line%dataOutLineEHC = -999.0
586 this_line%dataOutLineRSL = -999.0
587 this_line%dataOutLineBEERS = -999.0
588 this_line%dataOutLineDebug = -999.0
589 this_line%dataOutLineSPARTACUS = -999.0
590 this_line%dataOutLineDailyState = -999.0

Referenced by suews_cal_main(), and suews_cal_main_dts().

Here is the caller graph for this function:

◆ output_name_n()

subroutine suews_driver::output_name_n ( integer, intent(in) i,
character(len=15), intent(out) name,
character(len=15), intent(out) group,
character(len=15), intent(out) aggreg,
integer, intent(out) outlevel )

Definition at line 10054 of file suews_ctrl_driver.f95.

10055 ! used by f2py module to handle output names
10056 IMPLICIT NONE
10057 ! the dimension is potentially incorrect,
10058 ! which should be consistent with that in output module
10059 INTEGER, INTENT(in) :: i
10060 CHARACTER(len=15), INTENT(out) :: name, group, aggreg
10061 INTEGER, INTENT(out) :: outlevel
10062
10063 INTEGER :: nVar
10064 nvar = SIZE(varlistall, dim=1)
10065 IF (i < nvar .AND. i > 0) THEN
10066 name = trim(varlistall(i)%header)
10067 group = trim(varlistall(i)%group)
10068 aggreg = trim(varlistall(i)%aggreg)
10069 outlevel = varlistall(i)%level
10070 ELSE
10071 name = ''
10072 group = ''
10073 aggreg = ''
10074 outlevel = 0
10075 END IF
10076

References ctrl_output::varlistall.

◆ output_size()

subroutine suews_driver::output_size ( integer, intent(out) nvar)

Definition at line 10079 of file suews_ctrl_driver.f95.

10080 ! used by f2py module to get size of the output list
10081 IMPLICIT NONE
10082 ! the dimension is potentially incorrect,
10083 ! which should be consistent with that in output module
10084 INTEGER, INTENT(out) :: nVar
10085
10086 nvar = SIZE(varlistall, dim=1)
10087

References ctrl_output::varlistall.

◆ set_nan()

elemental real(kind(1d0)) function suews_driver::set_nan ( real(kind(1d0)), intent(in) x)

Definition at line 10010 of file suews_ctrl_driver.f95.

10011 IMPLICIT NONE
10012 REAL(KIND(1D0)), PARAMETER :: pNAN = 30000 ! 30000 to prevent water_state being filtered out as it can be large
10013 REAL(KIND(1D0)), PARAMETER :: pZERO = 1e-8 ! to prevent inconsistency caused by positive or negative zero
10014 REAL(KIND(1D0)), PARAMETER :: NAN = -999
10015 REAL(KIND(1D0)), INTENT(in) :: x
10016 REAL(KIND(1D0)) :: xx
10017
10018 IF (abs(x) > pnan) THEN
10019 xx = nan
10020 ELSEIF (abs(x) < pzero) THEN
10021 xx = 0
10022 ELSE
10023 xx = x
10024 END IF
10025

Referenced by suews_cal_main(), suews_cal_main_dts(), and suews_update_output().

Here is the caller graph for this function:

◆ square()

real(kind(1d0)) function suews_driver::square ( real(kind(1d0)), intent(in) x)

Definition at line 10030 of file suews_ctrl_driver.f95.

10031 IMPLICIT NONE
10032 REAL(KIND(1D0)), PARAMETER :: pNAN = 9999
10033 REAL(KIND(1D0)), PARAMETER :: NAN = -999
10034 REAL(KIND(1D0)), INTENT(in) :: x
10035 REAL(KIND(1D0)) :: xx
10036
10037 xx = x**2 + nan/pnan
10038 xx = x**2
10039

◆ square_real()

real function suews_driver::square_real ( real, intent(in) x)

Definition at line 10042 of file suews_ctrl_driver.f95.

10043 IMPLICIT NONE
10044 REAL, PARAMETER :: pNAN = 9999
10045 REAL, PARAMETER :: NAN = -999
10046 REAL, INTENT(in) :: x
10047 REAL :: xx
10048
10049 xx = x**2 + nan/pnan
10050 xx = x**2
10051

◆ suews_cal_anthropogenicemission()

subroutine suews_driver::suews_cal_anthropogenicemission ( real(kind(1d0)), dimension(2), intent(in) ah_min,
real(kind(1d0)), dimension(0:23, 2), intent(in) ahprof_24hr,
real(kind(1d0)), dimension(2), intent(in) ah_slope_cooling,
real(kind(1d0)), dimension(2), intent(in) ah_slope_heating,
real(kind(1d0)), intent(in) co2pointsource,
integer, dimension(3), intent(in) dayofweek_id,
integer, intent(in) dls,
real(kind(1d0)), intent(in) ef_umolco2perj,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) enef_v_jkm,
real(kind(1d0)), dimension(2), intent(in) fcef_v_kgkm,
real(kind(1d0)), intent(in) frfossilfuel_heat,
real(kind(1d0)), intent(in) frfossilfuel_nonheat,
real(kind(1d0)), dimension(6, 2), intent(in) hdd_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) humactivity_24hr,
integer, intent(in) imin,
integer, intent(in) it,
real(kind(1d0)), intent(in) maxfcmetab,
real(kind(1d0)), intent(in) maxqfmetab,
real(kind(1d0)), intent(in) minfcmetab,
real(kind(1d0)), intent(in) minqfmetab,
real(kind(1d0)), dimension(2), intent(in) popdensdaytime,
real(kind(1d0)), intent(in) popdensnighttime,
real(kind(1d0)), dimension(0:23, 2), intent(in) popprof_24hr,
real(kind(1d0)), intent(out) qf,
real(kind(1d0)), dimension(2), intent(in) qf0_beu,
real(kind(1d0)), dimension(2), intent(in) qf_a,
real(kind(1d0)), dimension(2), intent(in) qf_b,
real(kind(1d0)), dimension(2), intent(in) qf_c,
real(kind(1d0)), intent(in) qf_obs,
real(kind(1d0)), intent(out) qf_sahp,
real(kind(1d0)), intent(in) surfacearea,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), dimension(2), intent(in) trafficrate,
real(kind(1d0)), intent(in) trafficunits,
real(kind(1d0)), dimension(0:23, 2), intent(in) traffprof_24hr,
real(kind(1d0)), intent(out) fc_anthro,
real(kind(1d0)), intent(out) fc_build,
real(kind(1d0)), intent(out) fc_metab,
real(kind(1d0)), intent(out) fc_point,
real(kind(1d0)), intent(out) fc_traff )

Definition at line 4994 of file suews_ctrl_driver.f95.

5003
5004 IMPLICIT NONE
5005
5006 ! INTEGER, INTENT(in)::Diagnose
5007 INTEGER, INTENT(in) :: DLS ! daylighting savings
5008 INTEGER, INTENT(in) :: EmissionsMethod !0 - Use values in met forcing file, or default QF;1 - Method according to Loridan et al. (2011) : SAHP; 2 - Method according to Jarvi et al. (2011) : SAHP_2
5009 ! INTEGER, INTENT(in) :: id
5010 INTEGER, INTENT(in) :: it ! hour [H]
5011 INTEGER, INTENT(in) :: imin ! minutes [M]
5012 ! INTEGER, INTENT(in) :: nsh
5013 INTEGER, DIMENSION(3), INTENT(in) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
5014
5015 REAL(KIND(1D0)), DIMENSION(6, 2), INTENT(in) :: HDD_id ! Heating Degree Days (see SUEWS_DailyState.f95)
5016
5017 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: AH_MIN ! miniumum anthropogenic heat flux [W m-2]
5018 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: AH_SLOPE_Heating ! heating slope for the anthropogenic heat flux calculation [W m-2 K-1]
5019 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: AH_SLOPE_Cooling ! cooling slope for the anthropogenic heat flux calculation [W m-2 K-1]
5020 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: FcEF_v_kgkm ! CO2 Emission factor [kg km-1]
5021 ! REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::NumCapita
5022 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: PopDensDaytime ! Daytime population density [people ha-1] (i.e. workers)
5023 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: QF0_BEU ! Fraction of base value coming from buildings [-]
5024 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: Qf_A ! Base value for QF [W m-2]
5025 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: Qf_B ! Parameter related to heating degree days [W m-2 K-1 (Cap ha-1 )-1]
5026 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: Qf_C ! Parameter related to cooling degree days [W m-2 K-1 (Cap ha-1 )-1]
5027 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: BaseT_Heating ! base temperatrue for heating degree day [degC]
5028 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: BaseT_Cooling ! base temperature for cooling degree day [degC]
5029 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: TrafficRate ! Traffic rate [veh km m-2 s-1]
5030
5031 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: AHProf_24hr ! diurnal profile of anthropogenic heat flux (AVERAGE of the multipliers is equal to 1) [-]
5032 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: HumActivity_24hr ! diurnal profile of human activity [-]
5033 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: TraffProf_24hr ! diurnal profile of traffic activity calculation[-]
5034 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: PopProf_24hr ! diurnal profile of population [-]
5035
5036 REAL(KIND(1D0)), INTENT(in) :: CO2PointSource ! point source [kgC day-1]
5037 REAL(KIND(1D0)), INTENT(in) :: EF_umolCO2perJ !co2 emission factor [umol J-1]
5038 REAL(KIND(1D0)), INTENT(in) :: EnEF_v_Jkm ! energy emission factor [J K m-1]
5039 REAL(KIND(1D0)), INTENT(in) :: FrFossilFuel_Heat ! fraction of fossil fuel heat [-]
5040 REAL(KIND(1D0)), INTENT(in) :: FrFossilFuel_NonHeat ! fraction of fossil fuel non heat [-]
5041 REAL(KIND(1D0)), INTENT(in) :: MaxFCMetab ! maximum FC metabolism [umol m-2 s-1]
5042 REAL(KIND(1D0)), INTENT(in) :: MaxQFMetab ! maximum QF Metabolism [W m-2]
5043 REAL(KIND(1D0)), INTENT(in) :: MinFCMetab ! minimum QF metabolism [umol m-2 s-1]
5044 REAL(KIND(1D0)), INTENT(in) :: MinQFMetab ! minimum FC metabolism [W m-2]
5045 REAL(KIND(1D0)), INTENT(in) :: PopDensNighttime ! nighttime population density [ha-1] (i.e. residents)
5046 REAL(KIND(1D0)), INTENT(in) :: QF_obs ! observed anthropogenic heat flux from met forcing file when EmissionMethod=0 [W m-2]
5047 REAL(KIND(1D0)), INTENT(in) :: Temp_C ! air temperature [degC]
5048 REAL(KIND(1D0)), INTENT(in) :: TrafficUnits ! traffic units choice [-]
5049
5050 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::sfr_surf
5051 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::SnowFrac
5052 REAL(KIND(1D0)), INTENT(IN) :: SurfaceArea !surface area [m-2]
5053
5054 REAL(KIND(1D0)), INTENT(out) :: Fc_anthro ! anthropogenic co2 flux [umol m-2 s-1]
5055 REAL(KIND(1D0)), INTENT(out) :: Fc_build ! co2 emission from building component [umol m-2 s-1]
5056 REAL(KIND(1D0)), INTENT(out) :: Fc_metab ! co2 emission from metabolism component [umol m-2 s-1]
5057 REAL(KIND(1D0)), INTENT(out) :: Fc_point ! co2 emission from point source [umol m-2 s-1]
5058 REAL(KIND(1D0)), INTENT(out) :: Fc_traff ! co2 emission from traffic component [umol m-2 s-1]
5059 REAL(KIND(1D0)), INTENT(out) :: QF ! anthropogeic heat flux when EmissionMethod = 0 [W m-2]
5060 REAL(KIND(1D0)), INTENT(out) :: QF_SAHP !total anthropogeic heat flux when EmissionMethod is not 0 [W m-2]
5061
5062 INTEGER, PARAMETER :: notUsedI = -999
5063 REAL(KIND(1D0)), PARAMETER :: notUsed = -999
5064
5065 IF (emissionsmethod == 0) THEN ! use observed qf
5066 qf = qf_obs
5067 ELSEIF ((emissionsmethod > 0 .AND. emissionsmethod <= 6) .OR. emissionsmethod >= 11) THEN
5068 CALL anthropogenicemissions( &
5069 co2pointsource, emissionsmethod, &
5070 it, imin, dls, dayofweek_id, &
5071 ef_umolco2perj, fcef_v_kgkm, enef_v_jkm, trafficunits, &
5072 frfossilfuel_heat, frfossilfuel_nonheat, &
5073 minfcmetab, maxfcmetab, minqfmetab, maxqfmetab, &
5074 popdensdaytime, popdensnighttime, &
5075 temp_c, hdd_id, qf_a, qf_b, qf_c, &
5076 ah_min, ah_slope_heating, ah_slope_cooling, &
5077 baset_heating, baset_cooling, &
5078 trafficrate, &
5079 qf0_beu, qf_sahp, &
5080 fc_anthro, fc_metab, fc_traff, fc_build, fc_point, &
5081 ahprof_24hr, humactivity_24hr, traffprof_24hr, popprof_24hr, surfacearea)
5082
5083 ELSE
5084 CALL errorhint(73, 'RunControl.nml:EmissionsMethod unusable', notused, notused, emissionsmethod)
5085 END IF
5086
5087 IF (emissionsmethod >= 1) qf = qf_sahp
5088
5089 IF (emissionsmethod >= 0 .AND. emissionsmethod <= 6) THEN
5090 fc_anthro = 0
5091 fc_metab = 0
5092 fc_traff = 0
5093 fc_build = 0
5094 fc_point = 0
5095 END IF
5096
subroutine errorhint(errh, problemfile, value, value2, valuei)

References anemsn_module::anthropogenicemissions(), and errorhint().

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_anthropogenicemission_dts()

subroutine suews_driver::suews_cal_anthropogenicemission_dts ( real(kind(1d0)), intent(in) ah_min_working,
real(kind(1d0)), intent(in) ah_min_holiday,
real(kind(1d0)), dimension(0:23), intent(in) ahprof_24hr_working,
real(kind(1d0)), dimension(0:23), intent(in) ahprof_24hr_holiday,
real(kind(1d0)), intent(in) ah_slope_cooling_working,
real(kind(1d0)), intent(in) ah_slope_cooling_holiday,
real(kind(1d0)), intent(in) ah_slope_heating_working,
real(kind(1d0)), intent(in) ah_slope_heating_holiday,
real(kind(1d0)), intent(in) co2pointsource,
integer, dimension(3), intent(in) dayofweek_id,
integer, intent(in) dls,
real(kind(1d0)), intent(in) ef_umolco2perj,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) enef_v_jkm,
real(kind(1d0)), dimension(2), intent(in) fcef_v_kgkm,
real(kind(1d0)), intent(in) frfossilfuel_heat,
real(kind(1d0)), intent(in) frfossilfuel_nonheat,
real(kind(1d0)), dimension(6, 2), intent(in) hdd_id,
real(kind(1d0)), dimension(0:23), intent(in) humactivity_24hr_working,
real(kind(1d0)), dimension(0:23), intent(in) humactivity_24hr_holiday,
integer, intent(in) imin,
integer, intent(in) it,
real(kind(1d0)), intent(in) maxfcmetab,
real(kind(1d0)), intent(in) maxqfmetab,
real(kind(1d0)), intent(in) minfcmetab,
real(kind(1d0)), intent(in) minqfmetab,
real(kind(1d0)), intent(in) popdensdaytime_working,
real(kind(1d0)), intent(in) popdensdaytime_holiday,
real(kind(1d0)), intent(in) popdensnighttime,
real(kind(1d0)), dimension(0:23), intent(in) popprof_24hr_working,
real(kind(1d0)), dimension(0:23), intent(in) popprof_24hr_holiday,
real(kind(1d0)), intent(out) qf,
real(kind(1d0)), intent(in) qf0_beu_working,
real(kind(1d0)), intent(in) qf0_beu_holiday,
real(kind(1d0)), intent(in) qf_a_working,
real(kind(1d0)), intent(in) qf_a_holiday,
real(kind(1d0)), intent(in) qf_b_working,
real(kind(1d0)), intent(in) qf_b_holiday,
real(kind(1d0)), intent(in) qf_c_working,
real(kind(1d0)), intent(in) qf_c_holiday,
real(kind(1d0)), intent(in) qf_obs,
real(kind(1d0)), intent(out) qf_sahp,
real(kind(1d0)), intent(in) surfacearea,
real(kind(1d0)), intent(in) baset_cooling_working,
real(kind(1d0)), intent(in) baset_cooling_holiday,
real(kind(1d0)), intent(in) baset_heating_working,
real(kind(1d0)), intent(in) baset_heating_holiday,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) trafficrate_working,
real(kind(1d0)), intent(in) trafficrate_holiday,
real(kind(1d0)), intent(in) trafficunits,
real(kind(1d0)), dimension(0:23), intent(in) traffprof_24hr_working,
real(kind(1d0)), dimension(0:23), intent(in) traffprof_24hr_holiday,
real(kind(1d0)), intent(out) fc_anthro,
real(kind(1d0)), intent(out) fc_build,
real(kind(1d0)), intent(out) fc_metab,
real(kind(1d0)), intent(out) fc_point,
real(kind(1d0)), intent(out) fc_traff )

Definition at line 5099 of file suews_ctrl_driver.f95.

5121
5122 IMPLICIT NONE
5123
5124 ! INTEGER, INTENT(in)::Diagnose
5125 INTEGER, INTENT(in) :: DLS ! daylighting savings
5126 INTEGER, INTENT(in) :: EmissionsMethod !0 - Use values in met forcing file, or default QF;1 - Method according to Loridan et al. (2011) : SAHP; 2 - Method according to Jarvi et al. (2011) : SAHP_2
5127 ! INTEGER, INTENT(in) :: id
5128 INTEGER, INTENT(in) :: it ! hour [H]
5129 INTEGER, INTENT(in) :: imin ! minutes [M]
5130 ! INTEGER, INTENT(in) :: nsh
5131 INTEGER, DIMENSION(3), INTENT(in) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
5132
5133 REAL(KIND(1D0)), DIMENSION(6, 2), INTENT(in) :: HDD_id ! Heating Degree Days (see SUEWS_DailyState.f95)
5134
5135 REAL(KIND(1D0)), INTENT(in) :: AH_MIN_working
5136 REAL(KIND(1D0)), INTENT(in) :: AH_MIN_holiday
5137 REAL(KIND(1D0)), DIMENSION(2) :: AH_MIN ! miniumum anthropogenic heat flux [W m-2]
5138 REAL(KIND(1D0)), INTENT(in) :: AH_SLOPE_Heating_working
5139 REAL(KIND(1D0)), INTENT(in) :: AH_SLOPE_Heating_holiday
5140 REAL(KIND(1D0)), DIMENSION(2) :: AH_SLOPE_Heating ! heating slope for the anthropogenic heat flux calculation [W m-2 K-1]
5141 REAL(KIND(1D0)), INTENT(in) :: AH_SLOPE_Cooling_working
5142 REAL(KIND(1D0)), INTENT(in) :: AH_SLOPE_Cooling_holiday
5143 REAL(KIND(1D0)), DIMENSION(2) :: AH_SLOPE_Cooling ! cooling slope for the anthropogenic heat flux calculation [W m-2 K-1]
5144 REAL(KIND(1D0)), DIMENSION(2), INTENT(in) :: FcEF_v_kgkm ! CO2 Emission factor [kg km-1]
5145 ! REAL(KIND(1d0)), DIMENSION(2), INTENT(in)::NumCapita
5146
5147 REAL(KIND(1D0)), INTENT(in) :: PopDensDaytime_working
5148 REAL(KIND(1D0)), INTENT(in) :: PopDensDaytime_holiday
5149 REAL(KIND(1D0)), DIMENSION(2) :: PopDensDaytime ! Daytime population density [people ha-1] (i.e. workers)
5150
5151 REAL(KIND(1D0)), INTENT(in) :: QF0_BEU_working
5152 REAL(KIND(1D0)), INTENT(in) :: QF0_BEU_holiday
5153 REAL(KIND(1D0)), DIMENSION(2) :: QF0_BEU ! Fraction of base value coming from buildings [-]
5154 REAL(KIND(1D0)), INTENT(in) :: Qf_A_working
5155 REAL(KIND(1D0)), INTENT(in) :: Qf_A_holiday
5156 REAL(KIND(1D0)), DIMENSION(2) :: Qf_A ! Base value for QF [W m-2]
5157 REAL(KIND(1D0)), INTENT(in) :: Qf_B_working
5158 REAL(KIND(1D0)), INTENT(in) :: Qf_B_holiday
5159 REAL(KIND(1D0)), DIMENSION(2) :: Qf_B ! Parameter related to heating degree days [W m-2 K-1 (Cap ha-1 )-1]
5160 REAL(KIND(1D0)), INTENT(in) :: Qf_C_working
5161 REAL(KIND(1D0)), INTENT(in) :: Qf_C_holiday
5162 REAL(KIND(1D0)), DIMENSION(2) :: Qf_C ! Parameter related to cooling degree days [W m-2 K-1 (Cap ha-1 )-1]
5163
5164 REAL(KIND(1D0)), INTENT(in) :: BaseT_Heating_working
5165 REAL(KIND(1D0)), INTENT(in) :: BaseT_Heating_holiday
5166 REAL(KIND(1D0)), DIMENSION(2) :: BaseT_Heating ! base temperatrue for heating degree day [degC]
5167 REAL(KIND(1D0)), INTENT(in) :: BaseT_Cooling_working
5168 REAL(KIND(1D0)), INTENT(in) :: BaseT_Cooling_holiday
5169 REAL(KIND(1D0)), DIMENSION(2) :: BaseT_Cooling ! base temperature for cooling degree day [degC]
5170
5171 REAL(KIND(1D0)), INTENT(in) :: TrafficRate_working
5172 REAL(KIND(1D0)), INTENT(in) :: TrafficRate_holiday
5173 REAL(KIND(1D0)), DIMENSION(2) :: TrafficRate ! Traffic rate [veh km m-2 s-1]
5174
5175 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: AHProf_24hr_working
5176 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: AHProf_24hr_holiday
5177 REAL(KIND(1D0)), DIMENSION(0:23, 2) :: AHProf_24hr ! diurnal profile of anthropogenic heat flux (AVERAGE of the multipliers is equal to 1) [-]
5178
5179 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: HumActivity_24hr_working
5180 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: HumActivity_24hr_holiday
5181 REAL(KIND(1D0)), DIMENSION(0:23, 2) :: HumActivity_24hr ! diurnal profile of human activity [-]
5182
5183 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: TraffProf_24hr_working
5184 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: TraffProf_24hr_holiday
5185 REAL(KIND(1D0)), DIMENSION(0:23, 2) :: TraffProf_24hr ! diurnal profile of traffic activity calculation[-]
5186
5187 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: PopProf_24hr_working
5188 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: PopProf_24hr_holiday
5189 REAL(KIND(1D0)), DIMENSION(0:23, 2) :: PopProf_24hr ! diurnal profile of population [-]
5190
5191 REAL(KIND(1D0)), INTENT(in) :: CO2PointSource ! point source [kgC day-1]
5192 REAL(KIND(1D0)), INTENT(in) :: EF_umolCO2perJ !co2 emission factor [umol J-1]
5193 REAL(KIND(1D0)), INTENT(in) :: EnEF_v_Jkm ! energy emission factor [J K m-1]
5194 REAL(KIND(1D0)), INTENT(in) :: FrFossilFuel_Heat ! fraction of fossil fuel heat [-]
5195 REAL(KIND(1D0)), INTENT(in) :: FrFossilFuel_NonHeat ! fraction of fossil fuel non heat [-]
5196 REAL(KIND(1D0)), INTENT(in) :: MaxFCMetab ! maximum FC metabolism [umol m-2 s-1]
5197 REAL(KIND(1D0)), INTENT(in) :: MaxQFMetab ! maximum QF Metabolism [W m-2]
5198 REAL(KIND(1D0)), INTENT(in) :: MinFCMetab ! minimum QF metabolism [umol m-2 s-1]
5199 REAL(KIND(1D0)), INTENT(in) :: MinQFMetab ! minimum FC metabolism [W m-2]
5200 REAL(KIND(1D0)), INTENT(in) :: PopDensNighttime ! nighttime population density [ha-1] (i.e. residents)
5201 REAL(KIND(1D0)), INTENT(in) :: QF_obs ! observed anthropogenic heat flux from met forcing file when EmissionMethod=0 [W m-2]
5202 REAL(KIND(1D0)), INTENT(in) :: Temp_C ! air temperature [degC]
5203 REAL(KIND(1D0)), INTENT(in) :: TrafficUnits ! traffic units choice [-]
5204
5205 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::sfr_surf
5206 ! REAL(KIND(1d0)), DIMENSION(nsurf), INTENT(in)::SnowFrac
5207 REAL(KIND(1D0)), INTENT(IN) :: SurfaceArea !surface area [m-2]
5208
5209 REAL(KIND(1D0)), INTENT(out) :: Fc_anthro ! anthropogenic co2 flux [umol m-2 s-1]
5210 REAL(KIND(1D0)), INTENT(out) :: Fc_build ! co2 emission from building component [umol m-2 s-1]
5211 REAL(KIND(1D0)), INTENT(out) :: Fc_metab ! co2 emission from metabolism component [umol m-2 s-1]
5212 REAL(KIND(1D0)), INTENT(out) :: Fc_point ! co2 emission from point source [umol m-2 s-1]
5213 REAL(KIND(1D0)), INTENT(out) :: Fc_traff ! co2 emission from traffic component [umol m-2 s-1]
5214 REAL(KIND(1D0)), INTENT(out) :: QF ! anthropogeic heat flux when EmissionMethod = 0 [W m-2]
5215 REAL(KIND(1D0)), INTENT(out) :: QF_SAHP !total anthropogeic heat flux when EmissionMethod is not 0 [W m-2]
5216
5217 INTEGER, PARAMETER :: notUsedI = -999
5218 REAL(KIND(1D0)), PARAMETER :: notUsed = -999
5219
5220 ah_min(1) = ah_min_working
5221 ah_min(2) = ah_min_holiday
5222 ah_slope_heating(1) = ah_slope_heating_working
5223 ah_slope_heating(2) = ah_slope_heating_holiday
5224 ah_slope_cooling(1) = ah_slope_cooling_working
5225 ah_slope_cooling(2) = ah_slope_cooling_holiday
5226
5227 trafficrate(1) = trafficrate_working
5228 trafficrate(2) = trafficrate_holiday
5229
5230 popdensdaytime(1) = popdensdaytime_working
5231 popdensdaytime(2) = popdensdaytime_holiday
5232 qf0_beu(1) = qf0_beu_working
5233 qf0_beu(2) = qf0_beu_holiday
5234 qf_a(1) = qf_a_working
5235 qf_a(2) = qf_a_holiday
5236 qf_b(1) = qf_b_working
5237 qf_b(2) = qf_b_holiday
5238 qf_c(1) = qf_c_working
5239 qf_c(2) = qf_c_holiday
5240 baset_heating(1) = baset_heating_working
5241 baset_heating(2) = baset_heating_holiday
5242 baset_cooling(1) = baset_cooling_working
5243 baset_cooling(2) = baset_cooling_holiday
5244
5245 ahprof_24hr(:, 1) = ahprof_24hr_working
5246 ahprof_24hr(:, 2) = ahprof_24hr_holiday
5247 humactivity_24hr(:, 1) = humactivity_24hr_working
5248 humactivity_24hr(:, 2) = humactivity_24hr_holiday
5249 popprof_24hr(:, 1) = popprof_24hr_working
5250 popprof_24hr(:, 2) = popprof_24hr_holiday
5251 traffprof_24hr(:, 1) = traffprof_24hr_working
5252 traffprof_24hr(:, 2) = traffprof_24hr_holiday
5253
5254 IF (emissionsmethod == 0) THEN ! use observed qf
5255 qf = qf_obs
5256 ELSEIF ((emissionsmethod > 0 .AND. emissionsmethod <= 6) .OR. emissionsmethod >= 11) THEN
5257 CALL anthropogenicemissions( &
5258 co2pointsource, emissionsmethod, &
5259 it, imin, dls, dayofweek_id, &
5260 ef_umolco2perj, fcef_v_kgkm, enef_v_jkm, trafficunits, &
5261 frfossilfuel_heat, frfossilfuel_nonheat, &
5262 minfcmetab, maxfcmetab, minqfmetab, maxqfmetab, &
5263 popdensdaytime, popdensnighttime, &
5264 temp_c, hdd_id, qf_a, qf_b, qf_c, &
5265 ah_min, ah_slope_heating, ah_slope_cooling, &
5266 baset_heating, baset_cooling, &
5267 trafficrate, &
5268 qf0_beu, qf_sahp, &
5269 fc_anthro, fc_metab, fc_traff, fc_build, fc_point, &
5270 ahprof_24hr, humactivity_24hr, traffprof_24hr, popprof_24hr, surfacearea)
5271
5272 ELSE
5273 CALL errorhint(73, 'RunControl.nml:EmissionsMethod unusable', notused, notused, emissionsmethod)
5274 END IF
5275
5276 IF (emissionsmethod >= 1) qf = qf_sahp
5277
5278 IF (emissionsmethod >= 0 .AND. emissionsmethod <= 6) THEN
5279 fc_anthro = 0
5280 fc_metab = 0
5281 fc_traff = 0
5282 fc_build = 0
5283 fc_point = 0
5284 END IF
5285

References anemsn_module::anthropogenicemissions(), and errorhint().

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_biogenco2()

subroutine suews_driver::suews_cal_biogenco2 ( real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_enh_bioco2,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_enh_bioco2,
real(kind(1d0)), intent(in) dectime,
integer, intent(in) diagnose,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) fc_anthro,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), intent(in) gfunc,
integer, intent(in) gsmodel,
integer, intent(in) id,
integer, intent(in) it,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(3), intent(in) maxconductance,
real(kind(1d0)), dimension(nvegsurf), intent(in) min_res_bioco2,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_a,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_b,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
integer, intent(in) smdmethod,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
real(kind(1d0)), intent(in) t2_c,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), dimension(nvegsurf), intent(in) theta_bioco2,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), intent(in) vsmd,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(out) fc,
real(kind(1d0)), intent(out) fc_biogen,
real(kind(1d0)), intent(out) fc_photo,
real(kind(1d0)), intent(out) fc_respi )

Definition at line 5290 of file suews_ctrl_driver.f95.

5297
5298 IMPLICIT NONE
5299
5300 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: alpha_bioCO2 !The mean apparent ecosystem quantum. Represents the initial slope of the light-response curve [-]
5301 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: alpha_enh_bioCO2 !part of the alpha coefficient related to the fraction of vegetation [-]
5302 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: beta_bioCO2 !The light-saturated gross photosynthesis of the canopy [umol m-2 s-1 ]
5303 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: beta_enh_bioCO2 !Part of the beta coefficient related to the fraction of vegetation [umol m-2 s-1 ]
5304 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAI_id !=LAI(id-1,:), LAI for each veg surface [m2 m-2]
5305 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAIMin !Min LAI [m2 m-2]
5306 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAIMax !Max LAI [m2 m-2]
5307 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: min_res_bioCO2 !minimum soil respiration rate (for cold-temperature limit) [umol m-2 s-1]
5308 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: resp_a !Respiration coefficient a
5309 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: resp_b !Respiration coefficient b - related to air temperature dependency
5310 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: theta_bioCO2 !The convexity of the curve at light saturation [-]
5311
5312 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf ! surface fraction [-]
5313 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac !surface fraction of snow cover [-]
5314
5315 REAL(KIND(1D0)), DIMENSION(3), INTENT(in) :: MaxConductance !max conductance [mm s-1]
5316
5317 ! INTEGER, INTENT(in) :: BSoilSurf
5318 ! INTEGER, INTENT(in) :: ConifSurf
5319 ! INTEGER, INTENT(in) :: DecidSurf
5320 INTEGER, INTENT(in) :: Diagnose
5321 INTEGER, INTENT(in) :: EmissionsMethod
5322 ! INTEGER, INTENT(in) :: GrassSurf
5323 INTEGER, INTENT(in) :: gsmodel !choice of gs parameterisation (1 = Ja11, 2 = Wa16)
5324 INTEGER, INTENT(in) :: id !day of year [-]
5325 INTEGER, INTENT(in) :: it ! hour [H]
5326 ! INTEGER, INTENT(in) :: ivConif
5327 ! INTEGER, INTENT(in) :: ivDecid
5328 ! INTEGER, INTENT(in) :: ivGrass
5329 ! INTEGER, INTENT(in) :: nsurf
5330 ! INTEGER, INTENT(in) :: NVegSurf
5331 INTEGER, INTENT(in) :: SMDMethod !Method of measured soil moisture [-]
5332
5333 REAL(KIND(1D0)), INTENT(in) :: avkdn !Average downwelling shortwave radiation [W m-2]
5334 REAL(KIND(1D0)), INTENT(in) :: avRh !average relative humidity (%) [-]
5335 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
5336 REAL(KIND(1D0)), INTENT(in) :: Fc_anthro !anthropogenic co2 flux [umol m-2 s-1]
5337 REAL(KIND(1D0)), INTENT(in) :: G_max !Fitted parameters related to surface res. calculations
5338 REAL(KIND(1D0)), INTENT(in) :: G_k !Fitted parameters related to surface res. calculations
5339 REAL(KIND(1D0)), INTENT(in) :: G_q_base !Fitted parameters related to surface res. calculations
5340 REAL(KIND(1D0)), INTENT(in) :: G_q_shape !Fitted parameters related to surface res. calculations
5341 REAL(KIND(1D0)), INTENT(in) :: G_t !Fitted parameters related to surface res. calculations
5342 REAL(KIND(1D0)), INTENT(in) :: G_sm !Fitted parameters related to surface res. calculations
5343 REAL(KIND(1D0)), INTENT(in) :: gfunc
5344 REAL(KIND(1D0)), INTENT(in) :: Kmax !annual maximum hourly solar radiation [W m-2]
5345 REAL(KIND(1D0)), INTENT(in) :: Press_hPa !air pressure [hPa]
5346 REAL(KIND(1D0)), INTENT(in) :: S1 !a parameter related to soil moisture dependence [-]
5347 REAL(KIND(1D0)), INTENT(in) :: S2 !a parameter related to soil moisture dependence [mm]
5348 REAL(KIND(1D0)), INTENT(in) :: t2_C !modelled 2 meter air temperature [degC]
5349 REAL(KIND(1D0)), INTENT(in) :: Temp_C ! measured air temperature [degC]
5350 REAL(KIND(1D0)), INTENT(in) :: TH !Maximum temperature limit [degC]
5351 REAL(KIND(1D0)), INTENT(in) :: TL !Minimum temperature limit [degC]
5352 REAL(KIND(1D0)), INTENT(in) :: vsmd !Soil moisture deficit for vegetated surfaces only [mm]
5353 REAL(KIND(1D0)), INTENT(in) :: xsmd !Measured soil moisture deficit [mm]
5354
5355 REAL(KIND(1D0)), INTENT(out) :: Fc_biogen !biogenic CO2 flux [umol m-2 s-1]
5356 REAL(KIND(1D0)), INTENT(out) :: Fc_photo !co2 flux from photosynthesis [umol m-2 s-1]
5357 REAL(KIND(1D0)), INTENT(out) :: Fc_respi !co2 flux from respiration [umol m-2 s-1]
5358 REAL(KIND(1D0)), INTENT(out) :: Fc !total co2 flux [umol m-2 s-1]
5359
5360 REAL(KIND(1D0)) :: gfunc2 !gdq*gtemp*gs*gq for photosynthesis calculations (With modelled 2 meter temperature)
5361 REAL(KIND(1D0)) :: dq !Specific humidity deficit [g/kg]
5362 REAL(KIND(1D0)) :: t2 !air temperature at 2m [degC]
5363 REAL(KIND(1D0)) :: dummy1 !Latent heat of vaporization in [J kg-1]
5364 REAL(KIND(1D0)) :: dummy2 !Latent heat of sublimation in J/kg
5365 REAL(KIND(1D0)) :: dummy3 !Saturation vapour pressure over water[hPa]
5366 REAL(KIND(1D0)) :: dummy4 !Vapour pressure of water[hpa]
5367 REAL(KIND(1D0)) :: dummy5 !vapour pressure deficit[hpa]
5368 REAL(KIND(1D0)) :: dummy6 !vapour pressure deficit[pa]
5369 REAL(KIND(1D0)) :: dummy7 !Vap density or absolute humidity [kg m-3]
5370 REAL(KIND(1D0)) :: dummy8 !specific heat capacity [J kg-1 K-1]
5371 REAL(KIND(1D0)) :: dummy9 !Air density [kg m-3]
5372 REAL(KIND(1D0)) :: dummy10 !Surface Layer Conductance [mm s-1]
5373 REAL(KIND(1D0)) :: dummy11 !Surface resistance [s m-1]
5374
5375 IF (emissionsmethod >= 11) THEN
5376
5377 IF (gsmodel == 3 .OR. gsmodel == 4) THEN ! With modelled 2 meter temperature
5378 ! Call LUMPS_cal_AtmMoist for dq and SurfaceResistance for gfunc with 2 meter temperature
5379 ! If modelled 2 meter temperature is too different from measured air temperature then
5380 ! use temp_c
5381 IF (abs(temp_c - t2_c) > 5) THEN
5382 t2 = temp_c
5383 ELSE
5384 t2 = t2_c
5385 END IF
5386
5387 CALL cal_atmmoist( &
5388 t2, press_hpa, avrh, dectime, & ! input:
5389 dummy1, dummy2, & ! output:
5390 dummy3, dummy4, dummy5, dummy6, dq, dummy7, dummy8, dummy9)
5391
5392 CALL surfaceresistance( &
5393 id, it, & ! input:
5394 smdmethod, snowfrac, sfr_surf, avkdn, t2, dq, xsmd, vsmd, maxconductance, &
5395 laimax, lai_id, gsmodel, kmax, &
5396 g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, th, tl, s1, s2, &
5397 dummy10, dummy10, dummy10, dummy10, dummy10, & ! output:
5398 gfunc2, dummy10, dummy11) ! output:
5399 END IF
5400
5401 ! Calculate CO2 fluxes from biogenic components
5402 IF (diagnose == 1) WRITE (*, *) 'Calling CO2_biogen...'
5403 CALL co2_biogen( &
5404 alpha_bioco2, alpha_enh_bioco2, avkdn, beta_bioco2, beta_enh_bioco2, bsoilsurf, & ! input:
5405 conifsurf, decidsurf, dectime, emissionsmethod, gfunc, gfunc2, grasssurf, gsmodel, &
5406 id, it, ivconif, ivdecid, ivgrass, lai_id, laimin, laimax, min_res_bioco2, nsurf, &
5407 nvegsurf, resp_a, resp_b, sfr_surf, snowfrac, t2, temp_c, theta_bioco2, &
5408 fc_biogen, fc_photo, fc_respi) ! output:
5409 END IF
5410
5411 IF (emissionsmethod >= 0 .AND. emissionsmethod <= 6) THEN
5412 fc_biogen = 0
5413 fc_photo = 0
5414 fc_respi = 0
5415 END IF
5416
5417 fc = fc_anthro + fc_biogen
5418

References allocatearray::bsoilsurf, atmmoiststab_module::cal_atmmoist(), co2_module::co2_biogen(), allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, allocatearray::ivconif, allocatearray::ivdecid, allocatearray::ivgrass, allocatearray::nsurf, allocatearray::nvegsurf, and resist_module::surfaceresistance().

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_biogenco2_dts()

subroutine suews_driver::suews_cal_biogenco2_dts ( real(kind(1d0)), intent(in) alpha_bioco2_evetr,
real(kind(1d0)), intent(in) alpha_bioco2_dectr,
real(kind(1d0)), intent(in) alpha_bioco2_grass,
real(kind(1d0)), intent(in) alpha_enh_bioco2_evetr,
real(kind(1d0)), intent(in) alpha_enh_bioco2_dectr,
real(kind(1d0)), intent(in) alpha_enh_bioco2_grass,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) beta_bioco2_evetr,
real(kind(1d0)), intent(in) beta_bioco2_dectr,
real(kind(1d0)), intent(in) beta_bioco2_grass,
real(kind(1d0)), intent(in) beta_enh_bioco2_evetr,
real(kind(1d0)), intent(in) beta_enh_bioco2_dectr,
real(kind(1d0)), intent(in) beta_enh_bioco2_grass,
real(kind(1d0)), intent(in) dectime,
integer, intent(in) diagnose,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) fc_anthro,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), intent(in) gfunc,
integer, intent(in) gsmodel,
integer, intent(in) id,
integer, intent(in) it,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
real(kind(1d0)), intent(in) laimin_evetr,
real(kind(1d0)), intent(in) laimin_dectr,
real(kind(1d0)), intent(in) laimin_grass,
real(kind(1d0)), intent(in) laimax_evetr,
real(kind(1d0)), intent(in) laimax_dectr,
real(kind(1d0)), intent(in) laimax_grass,
real(kind(1d0)), intent(in) maxconductance_evetr,
real(kind(1d0)), intent(in) maxconductance_dectr,
real(kind(1d0)), intent(in) maxconductance_grass,
real(kind(1d0)), intent(in) min_res_bioco2_evetr,
real(kind(1d0)), intent(in) min_res_bioco2_dectr,
real(kind(1d0)), intent(in) min_res_bioco2_grass,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) resp_a_evetr,
real(kind(1d0)), intent(in) resp_a_dectr,
real(kind(1d0)), intent(in) resp_a_grass,
real(kind(1d0)), intent(in) resp_b_evetr,
real(kind(1d0)), intent(in) resp_b_dectr,
real(kind(1d0)), intent(in) resp_b_grass,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
integer, intent(in) smdmethod,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
real(kind(1d0)), intent(in) t2_c,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) theta_bioco2_evetr,
real(kind(1d0)), intent(in) theta_bioco2_dectr,
real(kind(1d0)), intent(in) theta_bioco2_grass,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), intent(in) vsmd,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(out) fc,
real(kind(1d0)), intent(out) fc_biogen,
real(kind(1d0)), intent(out) fc_photo,
real(kind(1d0)), intent(out) fc_respi )

Definition at line 5421 of file suews_ctrl_driver.f95.

5442
5443 IMPLICIT NONE
5444
5445 REAL(KIND(1D0)), INTENT(in) :: alpha_bioCO2_evetr
5446 REAL(KIND(1D0)), INTENT(in) :: alpha_bioCO2_dectr
5447 REAL(KIND(1D0)), INTENT(in) :: alpha_bioCO2_grass
5448 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: alpha_bioCO2 !The mean apparent ecosystem quantum. Represents the initial slope of the light-response curve [-]
5449
5450 REAL(KIND(1D0)), INTENT(in) :: alpha_enh_bioCO2_evetr
5451 REAL(KIND(1D0)), INTENT(in) :: alpha_enh_bioCO2_dectr
5452 REAL(KIND(1D0)), INTENT(in) :: alpha_enh_bioCO2_grass
5453 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: alpha_enh_bioCO2 !part of the alpha coefficient related to the fraction of vegetation [-]
5454
5455 REAL(KIND(1D0)), INTENT(in) :: beta_bioCO2_evetr
5456 REAL(KIND(1D0)), INTENT(in) :: beta_bioCO2_dectr
5457 REAL(KIND(1D0)), INTENT(in) :: beta_bioCO2_grass
5458 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: beta_bioCO2 !The light-saturated gross photosynthesis of the canopy [umol m-2 s-1 ]
5459
5460 REAL(KIND(1D0)), INTENT(in) :: beta_enh_bioCO2_evetr
5461 REAL(KIND(1D0)), INTENT(in) :: beta_enh_bioCO2_dectr
5462 REAL(KIND(1D0)), INTENT(in) :: beta_enh_bioCO2_grass
5463 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: beta_enh_bioCO2 !Part of the beta coefficient related to the fraction of vegetation [umol m-2 s-1 ]
5464
5465 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAI_id !=LAI(id-1,:), LAI for each veg surface [m2 m-2]
5466
5467 REAL(KIND(1D0)), INTENT(in) :: LAIMin_evetr
5468 REAL(KIND(1D0)), INTENT(in) :: LAIMin_dectr
5469 REAL(KIND(1D0)), INTENT(in) :: LAIMin_grass
5470 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAIMin !Min LAI [m2 m-2]
5471
5472 REAL(KIND(1D0)), INTENT(in) :: LAIMax_evetr
5473 REAL(KIND(1D0)), INTENT(in) :: LAIMax_dectr
5474 REAL(KIND(1D0)), INTENT(in) :: LAIMax_grass
5475 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAIMax !Max LAI [m2 m-2]
5476
5477 REAL(KIND(1D0)), INTENT(in) :: min_res_bioCO2_evetr
5478 REAL(KIND(1D0)), INTENT(in) :: min_res_bioCO2_dectr
5479 REAL(KIND(1D0)), INTENT(in) :: min_res_bioCO2_grass
5480 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: min_res_bioCO2 !minimum soil respiration rate (for cold-temperature limit) [umol m-2 s-1]
5481
5482 REAL(KIND(1D0)), INTENT(in) :: resp_a_evetr
5483 REAL(KIND(1D0)), INTENT(in) :: resp_a_dectr
5484 REAL(KIND(1D0)), INTENT(in) :: resp_a_grass
5485 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: resp_a !Respiration coefficient a
5486
5487 REAL(KIND(1D0)), INTENT(in) :: resp_b_evetr
5488 REAL(KIND(1D0)), INTENT(in) :: resp_b_dectr
5489 REAL(KIND(1D0)), INTENT(in) :: resp_b_grass
5490 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: resp_b !Respiration coefficient b - related to air temperature dependency
5491
5492 REAL(KIND(1D0)), INTENT(in) :: theta_bioCO2_evetr
5493 REAL(KIND(1D0)), INTENT(in) :: theta_bioCO2_dectr
5494 REAL(KIND(1D0)), INTENT(in) :: theta_bioCO2_grass
5495 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: theta_bioCO2 !The convexity of the curve at light saturation [-]
5496
5497 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
5498 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
5499 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
5500 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
5501 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
5502 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
5503 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
5504 REAL(KIND(1D0)), DIMENSION(nsurf) :: sfr_surf !surface fraction ratio [-]
5505
5506 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac !surface fraction of snow cover [-]
5507
5508 REAL(KIND(1D0)), INTENT(IN) :: MaxConductance_evetr
5509 REAL(KIND(1D0)), INTENT(IN) :: MaxConductance_dectr
5510 REAL(KIND(1D0)), INTENT(IN) :: MaxConductance_grass
5511 REAL(KIND(1D0)), DIMENSION(3) :: MaxConductance !max conductance [mm s-1]
5512
5513 ! INTEGER, INTENT(in) :: BSoilSurf
5514 ! INTEGER, INTENT(in) :: ConifSurf
5515 ! INTEGER, INTENT(in) :: DecidSurf
5516 INTEGER, INTENT(in) :: Diagnose
5517 INTEGER, INTENT(in) :: EmissionsMethod
5518 ! INTEGER, INTENT(in) :: GrassSurf
5519 INTEGER, INTENT(in) :: gsmodel !choice of gs parameterisation (1 = Ja11, 2 = Wa16)
5520 INTEGER, INTENT(in) :: id !day of year [-]
5521 INTEGER, INTENT(in) :: it ! hour [H]
5522 ! INTEGER, INTENT(in) :: ivConif
5523 ! INTEGER, INTENT(in) :: ivDecid
5524 ! INTEGER, INTENT(in) :: ivGrass
5525 ! INTEGER, INTENT(in) :: nsurf
5526 ! INTEGER, INTENT(in) :: NVegSurf
5527 INTEGER, INTENT(in) :: SMDMethod !Method of measured soil moisture [-]
5528
5529 REAL(KIND(1D0)), INTENT(in) :: avkdn !Average downwelling shortwave radiation [W m-2]
5530 REAL(KIND(1D0)), INTENT(in) :: avRh !average relative humidity (%) [-]
5531 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
5532 REAL(KIND(1D0)), INTENT(in) :: Fc_anthro !anthropogenic co2 flux [umol m-2 s-1]
5533 REAL(KIND(1D0)), INTENT(in) :: G_max !Fitted parameters related to surface res. calculations
5534 REAL(KIND(1D0)), INTENT(in) :: G_k !Fitted parameters related to surface res. calculations
5535 REAL(KIND(1D0)), INTENT(in) :: G_q_base !Fitted parameters related to surface res. calculations
5536 REAL(KIND(1D0)), INTENT(in) :: G_q_shape !Fitted parameters related to surface res. calculations
5537 REAL(KIND(1D0)), INTENT(in) :: G_t !Fitted parameters related to surface res. calculations
5538 REAL(KIND(1D0)), INTENT(in) :: G_sm !Fitted parameters related to surface res. calculations
5539 REAL(KIND(1D0)), INTENT(in) :: gfunc
5540 REAL(KIND(1D0)), INTENT(in) :: Kmax !annual maximum hourly solar radiation [W m-2]
5541 REAL(KIND(1D0)), INTENT(in) :: Press_hPa !air pressure [hPa]
5542 REAL(KIND(1D0)), INTENT(in) :: S1 !a parameter related to soil moisture dependence [-]
5543 REAL(KIND(1D0)), INTENT(in) :: S2 !a parameter related to soil moisture dependence [mm]
5544 REAL(KIND(1D0)), INTENT(in) :: t2_C !modelled 2 meter air temperature [degC]
5545 REAL(KIND(1D0)), INTENT(in) :: Temp_C ! measured air temperature [degC]
5546 REAL(KIND(1D0)), INTENT(in) :: TH !Maximum temperature limit [degC]
5547 REAL(KIND(1D0)), INTENT(in) :: TL !Minimum temperature limit [degC]
5548 REAL(KIND(1D0)), INTENT(in) :: vsmd !Soil moisture deficit for vegetated surfaces only [mm]
5549 REAL(KIND(1D0)), INTENT(in) :: xsmd !Measured soil moisture deficit [mm]
5550
5551 REAL(KIND(1D0)), INTENT(out) :: Fc_biogen !biogenic CO2 flux [umol m-2 s-1]
5552 REAL(KIND(1D0)), INTENT(out) :: Fc_photo !co2 flux from photosynthesis [umol m-2 s-1]
5553 REAL(KIND(1D0)), INTENT(out) :: Fc_respi !co2 flux from respiration [umol m-2 s-1]
5554 REAL(KIND(1D0)), INTENT(out) :: Fc !total co2 flux [umol m-2 s-1]
5555
5556 REAL(KIND(1D0)) :: gfunc2 !gdq*gtemp*gs*gq for photosynthesis calculations (With modelled 2 meter temperature)
5557 REAL(KIND(1D0)) :: dq !Specific humidity deficit [g/kg]
5558 REAL(KIND(1D0)) :: t2 !air temperature at 2m [degC]
5559 REAL(KIND(1D0)) :: dummy1 !Latent heat of vaporization in [J kg-1]
5560 REAL(KIND(1D0)) :: dummy2 !Latent heat of sublimation in J/kg
5561 REAL(KIND(1D0)) :: dummy3 !Saturation vapour pressure over water[hPa]
5562 REAL(KIND(1D0)) :: dummy4 !Vapour pressure of water[hpa]
5563 REAL(KIND(1D0)) :: dummy5 !vapour pressure deficit[hpa]
5564 REAL(KIND(1D0)) :: dummy6 !vapour pressure deficit[pa]
5565 REAL(KIND(1D0)) :: dummy7 !Vap density or absolute humidity [kg m-3]
5566 REAL(KIND(1D0)) :: dummy8 !specific heat capacity [J kg-1 K-1]
5567 REAL(KIND(1D0)) :: dummy9 !Air density [kg m-3]
5568 REAL(KIND(1D0)) :: dummy10 !Surface Layer Conductance [mm s-1]
5569 REAL(KIND(1D0)) :: dummy11 !Surface resistance [s m-1]
5570
5571 alpha_bioco2 = [alpha_bioco2_evetr, alpha_bioco2_dectr, alpha_bioco2_grass]
5572 alpha_enh_bioco2 = [alpha_enh_bioco2_evetr, alpha_enh_bioco2_dectr, alpha_enh_bioco2_grass]
5573 beta_bioco2 = [beta_bioco2_evetr, beta_bioco2_dectr, beta_bioco2_grass]
5574 beta_enh_bioco2 = [beta_enh_bioco2_evetr, beta_enh_bioco2_dectr, beta_enh_bioco2_grass]
5575 laimin = [laimin_evetr, laimin_dectr, laimin_grass]
5576 laimax = [laimax_evetr, laimax_dectr, laimax_grass]
5577 min_res_bioco2 = [min_res_bioco2_evetr, min_res_bioco2_dectr, min_res_bioco2_grass]
5578 resp_a = [resp_a_evetr, resp_a_dectr, resp_a_grass]
5579 resp_b = [resp_b_evetr, resp_b_dectr, resp_b_grass]
5580 theta_bioco2 = [theta_bioco2_evetr, theta_bioco2_dectr, theta_bioco2_grass]
5581 maxconductance = [maxconductance_evetr, maxconductance_dectr, maxconductance_grass]
5582 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
5583
5584 IF (emissionsmethod >= 11) THEN
5585
5586 IF (gsmodel == 3 .OR. gsmodel == 4) THEN ! With modelled 2 meter temperature
5587 ! Call LUMPS_cal_AtmMoist for dq and SurfaceResistance for gfunc with 2 meter temperature
5588 ! If modelled 2 meter temperature is too different from measured air temperature then
5589 ! use temp_c
5590 IF (abs(temp_c - t2_c) > 5) THEN
5591 t2 = temp_c
5592 ELSE
5593 t2 = t2_c
5594 END IF
5595
5596 CALL cal_atmmoist( &
5597 t2, press_hpa, avrh, dectime, & ! input:
5598 dummy1, dummy2, & ! output:
5599 dummy3, dummy4, dummy5, dummy6, dq, dummy7, dummy8, dummy9)
5600
5601 CALL surfaceresistance( &
5602 id, it, & ! input:
5603 smdmethod, snowfrac, sfr_surf, avkdn, t2, dq, xsmd, vsmd, maxconductance, &
5604 laimax, lai_id, gsmodel, kmax, &
5605 g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, th, tl, s1, s2, &
5606 dummy10, dummy10, dummy10, dummy10, dummy10, & ! output:
5607 gfunc2, dummy10, dummy11) ! output:
5608 END IF
5609
5610 ! Calculate CO2 fluxes from biogenic components
5611 IF (diagnose == 1) WRITE (*, *) 'Calling CO2_biogen...'
5612 CALL co2_biogen( &
5613 alpha_bioco2, alpha_enh_bioco2, avkdn, beta_bioco2, beta_enh_bioco2, bsoilsurf, & ! input:
5614 conifsurf, decidsurf, dectime, emissionsmethod, gfunc, gfunc2, grasssurf, gsmodel, &
5615 id, it, ivconif, ivdecid, ivgrass, lai_id, laimin, laimax, min_res_bioco2, nsurf, &
5616 nvegsurf, resp_a, resp_b, sfr_surf, snowfrac, t2, temp_c, theta_bioco2, &
5617 fc_biogen, fc_photo, fc_respi) ! output:
5618 END IF
5619
5620 IF (emissionsmethod >= 0 .AND. emissionsmethod <= 6) THEN
5621 fc_biogen = 0
5622 fc_photo = 0
5623 fc_respi = 0
5624 END IF
5625
5626 fc = fc_anthro + fc_biogen
5627

References allocatearray::bsoilsurf, atmmoiststab_module::cal_atmmoist(), co2_module::co2_biogen(), allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, allocatearray::ivconif, allocatearray::ivdecid, allocatearray::ivgrass, allocatearray::nsurf, allocatearray::nvegsurf, and resist_module::surfaceresistance().

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_main()

subroutine suews_driver::suews_cal_main ( real(kind(1d0)), dimension(2), intent(in) ah_min,
real(kind(1d0)), dimension(0:23, 2), intent(in) ahprof_24hr,
real(kind(1d0)), dimension(2), intent(in) ah_slope_cooling,
real(kind(1d0)), dimension(2), intent(in) ah_slope_heating,
real(kind(1d0)), dimension(nsurf), intent(inout) alb,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_enh_bioco2,
real(kind(1d0)), intent(in) alt,
real(kind(1d0)), intent(in) kdown,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_enh_bioco2,
real(kind(1d0)), intent(in) bldgh,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), dimension(nsurf), intent(in) chanohm,
real(kind(1d0)), intent(in) co2pointsource,
real(kind(1d0)), dimension(nsurf), intent(in) cpanohm,
real(kind(1d0)), intent(in) crwmax,
real(kind(1d0)), intent(in) crwmin,
real(kind(1d0)), dimension(7), intent(in) daywat,
real(kind(1d0)), dimension(7), intent(in) daywatper,
real(kind(1d0)), intent(in) dectreeh,
integer, intent(in) diagmethod,
integer, intent(in) diagnose,
real(kind(1d0)), intent(in) drainrt,
integer, intent(in) dt_since_start,
real(kind(1d0)), intent(inout) dqndt,
real(kind(1d0)), intent(inout) qn_av,
real(kind(1d0)), intent(inout) dqnsdt,
real(kind(1d0)), intent(inout) qn_s_av,
real(kind(1d0)), intent(in) ef_umolco2perj,
real(kind(1d0)), dimension(nsurf), intent(in) emis,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) enef_v_jkm,
integer, intent(in) enddls,
real(kind(1d0)), intent(in) evetreeh,
real(kind(1d0)), intent(in) faibldg,
real(kind(1d0)), intent(in) faidectree,
real(kind(1d0)), intent(in) faievetree,
integer, intent(in) faimethod,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), dimension(2), intent(in) fcef_v_kgkm,
real(kind(1d0)), intent(in) fcld_obs,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), intent(in) frfossilfuel_heat,
real(kind(1d0)), intent(in) frfossilfuel_nonheat,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), dimension(nvegsurf), intent(inout) gdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
integer, intent(in) gridiv,
integer, intent(in) gsmodel,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(12), intent(inout) hdd_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) humactivity_24hr,
real(kind(1d0)), dimension(nsurf), intent(inout) icefrac,
integer, intent(in) id,
real(kind(1d0)), dimension(3), intent(in) ie_a,
integer, intent(in) ie_end,
real(kind(1d0)), dimension(3), intent(in) ie_m,
integer, intent(in) ie_start,
integer, intent(in) imin,
real(kind(1d0)), intent(in) internalwateruse_h,
real(kind(1d0)), intent(in) irrfracpaved,
real(kind(1d0)), intent(in) irrfracbldgs,
real(kind(1d0)), intent(in) irrfracevetr,
real(kind(1d0)), intent(in) irrfracdectr,
real(kind(1d0)), intent(in) irrfracgrass,
real(kind(1d0)), intent(in) irrfracbsoil,
real(kind(1d0)), intent(in) irrfracwater,
integer, intent(in) isec,
integer, intent(in) it,
integer, intent(in) iy,
real(kind(1d0)), dimension(nsurf), intent(in) kkanohm,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), dimension(nvegsurf), intent(inout) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
integer, dimension(nvegsurf), intent(in) laitype,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(inout) lenday_id,
real(kind(1d0)), intent(in) ldown_obs,
real(kind(1d0)), intent(in) lng,
real(kind(1d0)), dimension(3), intent(in) maxconductance,
real(kind(1d0)), intent(in) maxfcmetab,
real(kind(1d0)), intent(in) maxqfmetab,
real(kind(1d0)), dimension(nsurf), intent(inout) snowwater,
real(kind(1d0)), intent(in) minfcmetab,
real(kind(1d0)), intent(in) minqfmetab,
real(kind(1d0)), dimension(nvegsurf), intent(in) min_res_bioco2,
real(kind(1d0)), intent(in) narp_emis_snow,
real(kind(1d0)), intent(in) narp_trans_site,
integer, intent(in) netradiationmethod,
integer, intent(in) nlayer,
integer, intent(in) n_vegetation_region_urban,
integer, intent(in) n_stream_sw_urban,
integer, intent(in) n_stream_lw_urban,
real(kind(1d0)), intent(in) sw_dn_direct_frac,
real(kind(1d0)), intent(in) air_ext_sw,
real(kind(1d0)), intent(in) air_ssa_sw,
real(kind(1d0)), intent(in) veg_ssa_sw,
real(kind(1d0)), intent(in) air_ext_lw,
real(kind(1d0)), intent(in) air_ssa_lw,
real(kind(1d0)), intent(in) veg_ssa_lw,
real(kind(1d0)), intent(in) veg_fsd_const,
real(kind(1d0)), intent(in) veg_contact_fraction_const,
real(kind(1d0)), intent(in) ground_albedo_dir_mult_fact,
logical, intent(in) use_sw_direct_albedo,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) veg_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer), intent(in) veg_scale,
real(kind(1d0)), dimension(nlayer), intent(in) alb_roof,
real(kind(1d0)), dimension(nlayer), intent(in) emis_roof,
real(kind(1d0)), dimension(nlayer), intent(in) alb_wall,
real(kind(1d0)), dimension(nlayer), intent(in) emis_wall,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) roof_albedo_dir_mult_fact,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) wall_specular_frac,
real(kind(1d0)), dimension(nsurf + 1, 4, 3), intent(in) ohm_coef,
integer, intent(in) ohmincqf,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshsw,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshwd,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), dimension(2), intent(in) popdensdaytime,
real(kind(1d0)), intent(in) popdensnighttime,
real(kind(1d0)), dimension(0:23, 2), intent(in) popprof_24hr,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) preciplimit,
real(kind(1d0)), intent(in) preciplimitalb,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), dimension(2), intent(in) qf0_beu,
real(kind(1d0)), dimension(2), intent(in) qf_a,
real(kind(1d0)), dimension(2), intent(in) qf_b,
real(kind(1d0)), dimension(2), intent(in) qf_c,
real(kind(1d0)), intent(in) qn1_obs,
real(kind(1d0)), intent(in) qs_obs,
real(kind(1d0)), intent(in) qf_obs,
real(kind(1d0)), intent(in) radmeltfact,
real(kind(1d0)), intent(in) raincover,
real(kind(1d0)), intent(in) rainmaxres,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_a,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_b,
integer, intent(in) roughlenheatmethod,
integer, intent(in) roughlenmommethod,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), dimension(nsurf), intent(in) sathydraulicconduct,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), dimension(nvegsurf), intent(inout) sdd_id,
integer, intent(in) smdmethod,
real(kind(1d0)), intent(inout) snowalb,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) snowalbmin,
real(kind(1d0)), dimension(nsurf), intent(in) snowpacklimit,
real(kind(1d0)), dimension(nsurf), intent(inout) snowdens,
real(kind(1d0)), intent(in) snowdensmax,
real(kind(1d0)), intent(in) snowdensmin,
real(kind(1d0)), intent(inout) snowfallcum,
real(kind(1d0)), dimension(nsurf), intent(inout) snowfrac,
real(kind(1d0)), intent(in) snowlimbldg,
real(kind(1d0)), intent(in) snowlimpaved,
real(kind(1d0)), intent(in) snowfrac_obs,
real(kind(1d0)), dimension(nsurf), intent(inout) snowpack,
real(kind(1d0)), dimension(0:23, 2), intent(in) snowprof_24hr,
integer, intent(in) snowuse,
real(kind(1d0)), dimension(nsurf), intent(in) soildepth,
integer, intent(in) stabilitymethod,
integer, intent(in) startdls,
real(kind(1d0)), dimension(nsurf), intent(inout) soilstore_surf,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap_surf,
real(kind(1d0)), dimension(nsurf), intent(inout) state_surf,
real(kind(1d0)), dimension(nsurf), intent(in) statelimit_surf,
real(kind(1d0)), dimension(nsurf), intent(in) wetthresh_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) state_roof,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_roof,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_wall,
real(kind(1d0)), dimension(nlayer), intent(inout) state_wall,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_wall,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_wall,
integer, intent(in) storageheatmethod,
real(kind(1d0)), dimension(6, nsurf), intent(inout) storedrainprm,
real(kind(1d0)), intent(in) surfacearea,
real(kind(1d0)), intent(inout) tair_av,
real(kind(1d0)), intent(in) tau_a,
real(kind(1d0)), intent(in) tau_f,
real(kind(1d0)), intent(in) tau_r,
real(kind(1d0)), intent(inout) tmax_id,
real(kind(1d0)), intent(inout) tmin_id,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) tempmeltfact,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), dimension(nvegsurf), intent(in) theta_bioco2,
real(kind(1d0)), intent(in) timezone,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), dimension(2), intent(in) trafficrate,
real(kind(1d0)), intent(in) trafficunits,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_wall,
real(kind(1d0)), dimension(nsurf), intent(inout) tsfc_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(inout) temp_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tin_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tin_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tin_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) k_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) cp_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) dz_surf,
real(kind(1d0)), dimension(0:23, 2), intent(in) traffprof_24hr,
real(kind(1d0)), dimension(:), intent(in) ts5mindata_ir,
integer, intent(in) tstep,
integer, intent(in) tstep_prev,
integer, intent(in) veg_type,
real(kind(1d0)), dimension(nsurf + 1, nsurf - 1), intent(in) waterdist,
integer, intent(in) waterusemethod,
real(kind(1d0)), intent(in) wu_m3,
real(kind(1d0)), dimension(9), intent(inout) wuday_id,
real(kind(1d0)), intent(inout) decidcap_id,
real(kind(1d0)), intent(inout) albdectr_id,
real(kind(1d0)), intent(inout) albevetr_id,
real(kind(1d0)), intent(inout) albgrass_id,
real(kind(1d0)), intent(inout) porosity_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofa_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofm_24hr,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(in) z,
real(kind(1d0)), intent(in) z0m_in,
real(kind(1d0)), intent(in) zdm_in,
type(output_line), intent(out) output_line_suews )

Definition at line 652 of file suews_ctrl_driver.f95.

717 ! datetimeLine, dataOutLineSUEWS, dataOutLineSnow, dataOutLineESTM, dataoutLineRSL, & !output
718 ! dataOutLineBEERS, & !output
719 ! dataOutLineDebug, dataOutLineSPARTACUS, &
720 ! dataOutLineEHC, &
721 ! dataOutLineDailyState) !output
722
723 IMPLICIT NONE
724
725 ! ########################################################################################
726 ! input variables
727 INTEGER, PARAMETER :: AerodynamicResistanceMethod = 2 !method to calculate RA [-]
728 INTEGER, PARAMETER :: BaseTMethod = 2 ! base t method [-]
729 INTEGER, INTENT(IN) :: Diagnose ! flag for printing diagnostic info during runtime [N/A]C
730 INTEGER, PARAMETER :: DiagQN = 0 ! flag for printing diagnostic info for QN module during runtime [N/A] ! not used and will be removed
731 INTEGER, PARAMETER :: DiagQS = 0 ! flag for printing diagnostic info for QS module during runtime [N/A] ! not used and will be removed
732 INTEGER, INTENT(IN) :: startDLS !start of daylight saving [DOY]
733 INTEGER, INTENT(IN) :: endDLS !end of daylight saving [DOY]
734 INTEGER, INTENT(IN) :: EmissionsMethod !method to calculate anthropogenic heat [-]
735 INTEGER, INTENT(IN) :: Gridiv ! grid id [-]
736 INTEGER, INTENT(IN) :: nlayer ! number of vertical layers in urban canyon [-]
737 INTEGER, INTENT(IN) :: gsModel !choice of gs parameterisation (1 = Ja11, 2 = Wa16) [-]
738 INTEGER, INTENT(IN) :: id ! day of year, 1-366 [-]
739 INTEGER, INTENT(IN) :: Ie_end !ending time of water use [DOY]
740 INTEGER, INTENT(IN) :: Ie_start !starting time of water use [DOY]
741 INTEGER, INTENT(IN) :: isec ! seconds, 0-59 [s]
742 INTEGER, INTENT(IN) :: imin !minutes, 0-59 [min]
743 INTEGER, INTENT(IN) :: it ! hour, 0-23 [h]
744 INTEGER, PARAMETER :: EvapMethod = 2 ! Evaporation calculated according to Rutter (1) or Shuttleworth (2) [-]
745 INTEGER, INTENT(IN) :: iy ! year [y]
746 INTEGER, PARAMETER :: LAImethod = 1 ! boolean to determine if calculate LAI [-]
747 INTEGER, INTENT(IN) :: NetRadiationMethod ! method for calculation of radiation fluxes [-]
748 INTEGER, INTENT(IN) :: OHMIncQF ! Determines whether the storage heat flux calculation uses Q* or ( Q* +QF) [-]
749 INTEGER, INTENT(IN) :: RoughLenHeatMethod ! method to calculate heat roughness length [-]
750 INTEGER, INTENT(IN) :: RoughLenMomMethod ! Determines how aerodynamic roughness length (z0m) and zero displacement height (zdm) are calculated [-]
751 INTEGER, INTENT(IN) :: FAIMethod ! Determines how FAI is calculated [-]
752 INTEGER, INTENT(IN) :: SMDMethod ! Determines method for calculating soil moisture deficit [-]
753 INTEGER, INTENT(IN) :: SnowUse ! Determines whether the snow part of the model runs[-]
754 INTEGER, INTENT(IN) :: StabilityMethod !method to calculate atmospheric stability [-]
755 INTEGER, INTENT(IN) :: StorageHeatMethod !Determines method for calculating storage heat flux ΔQS [-]
756 INTEGER, INTENT(in) :: DiagMethod !Defines how near surface diagnostics are calculated
757 INTEGER, INTENT(IN) :: tstep !timestep [s]
758 INTEGER, INTENT(IN) :: tstep_prev ! tstep size of the previous step [s]
759 INTEGER, INTENT(in) :: dt_since_start ! time since simulation starts [s]
760 INTEGER, INTENT(IN) :: veg_type !Defines how vegetation is calculated for LUMPS [-]
761 INTEGER, INTENT(IN) :: WaterUseMethod !Defines how external water use is calculated[-]
762
763 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr !maximum albedo for deciduous tree and shrub [-]
764 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr !maximum albedo for evergreen tree and shrub [-]
765 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass !maximum albedo for grass [-]
766 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr !minimum albedo for deciduous tree and shrub [-]
767 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr !minimum albedo for evergreen tree and shrub [-]
768 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass !minimum albedo for grass [-]
769 REAL(KIND(1D0)), INTENT(IN) :: alt !solar altitude [deg]
770 REAL(KIND(1D0)), INTENT(IN) :: kdown !incominging shortwave radiation [W m-2]
771 REAL(KIND(1D0)), INTENT(IN) :: avRh !relative humidity [-]
772 REAL(KIND(1D0)), INTENT(IN) :: avU1 !average wind speed at 1m [W m-1]
773 REAL(KIND(1D0)), PARAMETER :: BaseT_HC = 18.2 !base temperature for heating degree dayb [degC] ! to be fully removed TODO
774 REAL(KIND(1D0)), INTENT(IN) :: bldgH !average building height [m]
775 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec !maximum water storage capacity for upper surfaces (i.e. canopy)
776 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec !minimum water storage capacity for upper surfaces (i.e. canopy)
777 REAL(KIND(1D0)), INTENT(IN) :: CO2PointSource ! point source [kgC day-1]
778 REAL(KIND(1D0)), INTENT(IN) :: CRWmax !maximum water holding capacity of snow [mm]
779 REAL(KIND(1D0)), INTENT(IN) :: CRWmin !minimum water holding capacity of snow [mm]
780 REAL(KIND(1D0)), INTENT(IN) :: DecTreeH !average height of deciduous tree and shrub [-]
781 REAL(KIND(1D0)), INTENT(IN) :: DRAINRT !Drainage rate of the water bucket [mm hr-1]
782 REAL(KIND(1D0)), INTENT(IN) :: EF_umolCO2perJ !co2 emission factor [umol J-1]
783 REAL(KIND(1D0)), INTENT(IN) :: EnEF_v_Jkm ! energy emission factor [J K m-1]
784 REAL(KIND(1D0)), INTENT(IN) :: EveTreeH !height of evergreen tree [m]
785 REAL(KIND(1D0)), INTENT(IN) :: FAIBldg ! frontal area index for buildings [-]
786 REAL(KIND(1D0)), INTENT(IN) :: FAIDecTree ! frontal area index for deciduous tree [-]
787 REAL(KIND(1D0)), INTENT(IN) :: FAIEveTree ! frontal area index for evergreen tree [-]
788 REAL(KIND(1D0)), INTENT(IN) :: Faut !Fraction of irrigated area using automatic irrigation [-]
789 REAL(KIND(1D0)), INTENT(IN) :: fcld_obs !observed could fraction [-]
790 REAL(KIND(1D0)), INTENT(IN) :: FlowChange !Difference between the input and output flow in the water body [mm]
791 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_Heat ! fraction of fossil fuel heat [-]
792 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_NonHeat ! fraction of fossil fuel non heat [-]
793 REAL(KIND(1D0)), INTENT(IN) :: g_max !Fitted parameters related to surface res. calculations
794 REAL(KIND(1D0)), INTENT(IN) :: g_k !Fitted parameters related to surface res. calculations
795 REAL(KIND(1D0)), INTENT(IN) :: g_q_base !Fitted parameters related to surface res. calculations
796 REAL(KIND(1D0)), INTENT(IN) :: g_q_shape !Fitted parameters related to surface res. calculations
797 REAL(KIND(1D0)), INTENT(IN) :: g_t !Fitted parameters related to surface res. calculations
798 REAL(KIND(1D0)), INTENT(IN) :: g_sm !Fitted parameters related to surface res. calculations
799 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
800 REAL(KIND(1D0)), INTENT(IN) :: InternalWaterUse_h !Internal water use [mm h-1]
801 REAL(KIND(1D0)), INTENT(IN) :: IrrFracPaved !fraction of paved which are irrigated [-]
802 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBldgs !fraction of buildings (e.g., green roofs) which are irrigated [-]
803 REAL(KIND(1D0)), INTENT(IN) :: IrrFracDecTr !fraction of deciduous trees which are irrigated [-]
804 REAL(KIND(1D0)), INTENT(IN) :: IrrFracEveTr !fraction of evergreen trees which are irrigated [-]
805 REAL(KIND(1D0)), INTENT(IN) :: IrrFracGrass !fraction of grass which are irrigated [-]
806 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBSoil !fraction of bare soil trees which are irrigated [-]
807 REAL(KIND(1D0)), INTENT(IN) :: IrrFracWater !fraction of water which are irrigated [-]
808 REAL(KIND(1D0)), INTENT(IN) :: Kmax !annual maximum hourly solar radiation [W m-2]
809 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs !observed LAI [m2 m-2]
810 REAL(KIND(1D0)), INTENT(IN) :: lat !latitude [deg]
811 REAL(KIND(1D0)), INTENT(IN) :: ldown_obs !observed incoming longwave radiation [W m-2]
812 REAL(KIND(1D0)), INTENT(IN) :: lng !longitude [deg]
813 REAL(KIND(1D0)), INTENT(IN) :: MaxFCMetab ! maximum FC metabolism [umol m-2 s-1]
814 REAL(KIND(1D0)), INTENT(IN) :: MaxQFMetab ! maximum QF Metabolism [W m-2]
815 REAL(KIND(1D0)), INTENT(IN) :: MinFCMetab ! minimum QF metabolism [umol m-2 s-1]
816 REAL(KIND(1D0)), INTENT(IN) :: MinQFMetab ! minimum FC metabolism [W m-2]
817 REAL(KIND(1D0)), INTENT(IN) :: NARP_EMIS_SNOW ! snow emissivity in NARP model [-]
818 REAL(KIND(1D0)), INTENT(IN) :: NARP_TRANS_SITE !atmospheric transmissivity for NARP [-]
819 REAL(KIND(1D0)), INTENT(IN) :: PipeCapacity !capacity of pipes to transfer water [mm]
820 REAL(KIND(1D0)), INTENT(IN) :: PopDensNighttime ! nighttime population density (i.e. residents) [ha-1]
821 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec !full leaf-on summertime value used only for DecTr
822 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec !leaf-off wintertime value used only for DecTr
823 REAL(KIND(1D0)), INTENT(IN) :: Precip !rain data [mm]
824 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimit !temperature limit when precipitation falls as snow [degC]
825 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimitAlb !Limit for hourly precipitation when the ground is fully covered with snow [mm]
826 REAL(KIND(1D0)), INTENT(IN) :: Press_hPa !air pressure [hPa]
827 REAL(KIND(1D0)), INTENT(IN) :: qn1_obs !observed net all-wave radiation [W m-2]
828 REAL(KIND(1D0)), INTENT(IN) :: qs_obs !observed heat storage flux [W m-2]
829 REAL(KIND(1D0)), INTENT(IN) :: qf_obs !observed anthropogenic heat flux [W m-2]
830 REAL(KIND(1D0)), INTENT(IN) :: RadMeltFact !hourly radiation melt factor of snow [mm W-1 h-1]
831 REAL(KIND(1D0)), INTENT(IN) :: RAINCOVER !limit when surface totally covered with water for LUMPS [mm]
832 REAL(KIND(1D0)), INTENT(IN) :: RainMaxRes !maximum water bucket reservoir. Used for LUMPS surface wetness control. [mm]
833 REAL(KIND(1D0)), INTENT(IN) :: RunoffToWater !fraction of above-ground runoff flowing to water surface during flooding [-]
834 REAL(KIND(1D0)), INTENT(IN) :: S1 !a parameter related to soil moisture dependence [-]
835 REAL(KIND(1D0)), INTENT(IN) :: S2 !a parameter related to soil moisture dependence [mm]
836 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMax !effective surface albedo (middle of the day value) for summertime [-]
837 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMin !effective surface albedo (middle of the day value) for wintertime (not including snow) [-]
838 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMax !maximum snow density [kg m-3]
839 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMin !fresh snow density [kg m-3]
840 REAL(KIND(1D0)), INTENT(IN) :: SnowLimBldg !Limit of the snow water equivalent for snow removal from building roofs [mm]
841 REAL(KIND(1D0)), INTENT(IN) :: SnowLimPaved !limit of the snow water equivalent for snow removal from roads[mm]
842 REAL(KIND(1D0)), INTENT(IN) :: snowFrac_obs !observed snow fraction [-]
843 REAL(KIND(1D0)), INTENT(IN) :: SurfaceArea !area of the grid [ha]
844 REAL(KIND(1D0)), INTENT(IN) :: tau_a !time constant for snow albedo aging in cold snow [-]
845 REAL(KIND(1D0)), INTENT(IN) :: tau_f !time constant for snow albedo aging in melting snow [-]
846 REAL(KIND(1D0)), INTENT(IN) :: tau_r !time constant for snow density ageing [-]
847 REAL(KIND(1D0)), INTENT(IN) :: Temp_C !air temperature [degC]
848 REAL(KIND(1D0)), INTENT(IN) :: TempMeltFact !hourly temperature melt factor of snow [mm K-1 h-1]
849 REAL(KIND(1D0)), INTENT(IN) :: TH !upper air temperature limit [degC]
850 REAL(KIND(1D0)), INTENT(IN) :: timezone !time zone, for site relative to UTC (east is positive) [h]
851 REAL(KIND(1D0)), INTENT(IN) :: TL !lower air temperature limit [degC]
852 REAL(KIND(1D0)), INTENT(IN) :: TrafficUnits ! traffic units choice [-]
853 REAL(KIND(1D0)), INTENT(IN) :: wu_m3 ! external water input (e.g., irrigation) [m3]
854 REAL(KIND(1D0)), INTENT(IN) :: xsmd ! observed soil moisture; can be provided either as volumetric ([m3 m-3] when SMDMethod = 1) or gravimetric quantity ([kg kg-1] when SMDMethod = 2
855 REAL(KIND(1D0)), INTENT(IN) :: Z ! measurement height [m]
856 REAL(KIND(1D0)), INTENT(IN) :: z0m_in !roughness length for momentum [m]
857 REAL(KIND(1D0)), INTENT(IN) :: zdm_in !zero-plane displacement [m]
858
859 INTEGER, DIMENSION(NVEGSURF), INTENT(IN) :: LAIType !LAI calculation choice[-]
860
861 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_MIN !minimum QF values [W m-2]
862 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Cooling ! cooling slope for the anthropogenic heat flux calculation [W m-2 K-1]
863 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Heating ! heating slope for the anthropogenic heat flux calculation [W m-2 K-1]
864 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: FcEF_v_kgkm ! CO2 Emission factor [kg km-1]
865 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: QF0_BEU ! Fraction of base value coming from buildings [-]
866 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_A ! Base value for QF [W m-2]
867 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_B ! Parameter related to heating degree days [W m-2 K-1 (Cap ha-1 )-1]
868 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_C ! Parameter related to cooling degree days [W m-2 K-1 (Cap ha-1 )-1]
869 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: PopDensDaytime ! Daytime population density [people ha-1] (i.e. workers)
870 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling ! base temperature for cooling degree day [degC]
871 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating ! base temperatrue for heating degree day [degC]
872 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: TrafficRate ! Traffic rate [veh km m-2 s-1]
873 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_a !Coefficient for automatic irrigation model
874 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_m !Coefficients for manual irrigation models
875 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: MaxConductance !the maximum conductance of each vegetation or surface type. [mm s-1]
876 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWat !Irrigation flag: 1 for on and 0 for off [-]
877 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWatPer !Fraction of properties using irrigation for each day of a week [-]
878 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshSW !Temperature threshold determining whether summer/winter OHM coefficients are applied [degC]
879 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshWD !Soil moisture threshold determining whether wet/dry OHM coefficients are applied [-]
880 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: chAnOHM !Bulk transfer coefficient for this surface to use in AnOHM [-]
881 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: cpAnOHM !Volumetric heat capacity for this surface to use in AnOHM [J m-3]
882 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: emis !Effective surface emissivity[-]
883 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: kkAnOHM !Thermal conductivity for this surface to use in AnOHM [W m K-1]
884 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SatHydraulicConduct !Hydraulic conductivity for saturated soil [mm s-1]
885 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: sfr_surf !surface cover fraction[-]
886 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SnowPackLimit !Limit for the snow water equivalent when snow cover starts to be patchy [mm]
887 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilDepth !Depth of soil beneath the surface [mm]
888 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilStoreCap_surf !Capacity of soil store for each surface [mm]
889 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: StateLimit_surf !Upper limit to the surface state [mm]
890 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: WetThresh_surf ! !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
891 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_bioCO2 !The mean apparent ecosystem quantum. Represents the initial slope of the light-response curve [-]
892 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_enh_bioCO2 !Part of the alpha coefficient related to the fraction of vegetation[-]
893 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseT !Base Temperature for initiating growing degree days (GDD) for leaf growth [degC]
894 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseTe !Base temperature for initiating sensesance degree days (SDD) for leaf off [degC]
895 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_bioCO2 !The light-saturated gross photosynthesis of the canopy [umol m-2 s-1 ]
896 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_enh_bioCO2 !Part of the beta coefficient related to the fraction of vegetation [umol m-2 s-1 ]
897 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: GDDFull !the growing degree days (GDD) needed for full capacity of the leaf area index [degC]
898 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMax !full leaf-on summertime value [m2 m-2]
899 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMin !leaf-off wintertime value [m2 m-2]
900 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: min_res_bioCO2 !Minimum soil respiration rate (for cold-temperature limit) [umol m-2 s-1]
901 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_a !Respiration coefficient a
902 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_b !Respiration coefficient b - related to air temperature dependency
903 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: SDDFull !the sensesence degree days (SDD) needed to initiate leaf off [degC]
904 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: SnowProf_24hr !Hourly profile values used in snow clearing [-]
905 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: theta_bioCO2 !The convexity of the curve at light saturation [-]
906 REAL(KIND(1D0)), DIMENSION(4, NVEGSURF), INTENT(IN) :: LAIPower !parameters required by LAI calculation
907 REAL(KIND(1D0)), DIMENSION(nsurf + 1, 4, 3), INTENT(IN) :: OHM_coef !Coefficients for OHM calculation
908 REAL(KIND(1D0)), DIMENSION(NSURF + 1, NSURF - 1), INTENT(IN) :: WaterDist !Fraction of water redistribution [-]
909 REAL(KIND(1D0)), DIMENSION(:), INTENT(IN) :: Ts5mindata_ir !surface temperature input data[degC]
910 REAL(KIND(1D0)), DIMENSION(10) :: MetForcingData_grid ! met forcing array of grid
911
912 ! diurnal profile values for 24hr
913 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: AHProf_24hr !Hourly profile values used in energy use calculation [-]
914 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: HumActivity_24hr !Hourly profile values used in human activity calculation[-]
915 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: PopProf_24hr !Hourly profile values used in dynamic population estimation[-]
916 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: TraffProf_24hr !Hourly profile values used in traffic activity calculation[-]
917 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfA_24hr !Hourly profile values used in automatic irrigation[-]
918 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfM_24hr !Hourly profile values used in manual irrigation[-]
919
920 ! ####################################################################################
921 ! ESTM_ehc
922 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_roof !Capacity of soil store for roof [mm]
923 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_roof !Limit for state_id of roof [mm]
924 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_roof ! wetness threshold of roof[mm]
925 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_roof !Soil moisture of roof [mm]
926 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_roof !wetness status of roof [mm]
927
928 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_wall !Capacity of soil store for wall [mm]
929 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_wall !Limit for state_id of wall [mm]
930 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_wall ! wetness threshold of wall[mm]
931 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_wall !Soil moisture of wall [mm]
932 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_wall !wetness status of wall [mm]
933
934 ! ########################################################################################
935
936 ! ########################################################################################
937 ! inout variables
938 ! OHM related:
939 REAL(KIND(1D0)), INTENT(INOUT) :: qn_av ! weighted average of net all-wave radiation [W m-2]
940 REAL(KIND(1D0)), INTENT(INOUT) :: dqndt ! rate of change of net radiation [W m-2 h-1]
941 REAL(KIND(1D0)), INTENT(INOUT) :: qn_s_av ! weighted average of qn over snow [W m-2]
942 REAL(KIND(1D0)), INTENT(INOUT) :: dqnsdt ! Rate of change of net radiation [W m-2 h-1]
943
944 ! snow related:
945 REAL(KIND(1D0)), INTENT(INOUT) :: SnowfallCum !cumulated snow falling [mm]
946 REAL(KIND(1D0)), INTENT(INOUT) :: SnowAlb !albedo of know [-]
947 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: IceFrac !fraction of ice in snowpack [-]
948 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowWater ! snow water[mm]
949 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowDens !snow density [kg m-3]
950 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowFrac !snow fraction [-]
951 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowPack !snow water equivalent on each land cover [mm]
952
953 ! water balance related:
954 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: soilstore_surf !soil moisture of each surface type [mm]
955 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: state_surf !wetness status of each surface type [mm]
956 REAL(KIND(1D0)), DIMENSION(6, NSURF), INTENT(INOUT) :: StoreDrainPrm !coefficients used in drainage calculation [-]
957
958 ! phenology related:
959 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: alb !albedo [-]
960 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: GDD_id !Growing Degree Days [degC d]
961 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INout) :: SDD_id !Senescence Degree Days[degC d]
962 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: LAI_id !LAI for each veg surface [m2 m-2]
963 REAL(KIND(1D0)), INTENT(INout) :: Tmin_id !Daily minimum temperature [degC]
964 REAL(KIND(1D0)), INTENT(INout) :: Tmax_id !Daily maximum temperature [degC]
965 REAL(KIND(1D0)), INTENT(INout) :: lenDay_id !daytime length [h]
966 REAL(KIND(1D0)), INTENT(INOUT) :: DecidCap_id !Moisture storage capacity of deciduous trees [mm]
967 REAL(KIND(1D0)), INTENT(INOUT) :: albDecTr_id !Albedo of deciduous trees [-]
968 REAL(KIND(1D0)), INTENT(INOUT) :: albEveTr_id !Albedo of evergreen trees [-]
969 REAL(KIND(1D0)), INTENT(INOUT) :: albGrass_id !Albedo of grass [-]
970 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id !Porosity of deciduous trees [-]
971
972 ! anthropogenic heat related:
973 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id !Heating Degree Days [degC d]
974
975 ! water use related:
976 REAL(KIND(1D0)), DIMENSION(9), INTENT(INOUT) :: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm]
977
978 ! ESTM related:
979 REAL(KIND(1D0)), INTENT(INOUT) :: Tair_av !average air temperature [degC]
980
981 ! ESTM_ehc related:
982 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(INOUT) :: temp_roof !interface temperature between depth layers in roof [degC]
983 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(INOUT) :: temp_wall !interface temperature between depth layers in wall [degC]
984 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(INOUT) :: temp_surf !interface temperature between depth layers [degC]
985
986 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_roof !roof surface temperature [degC]
987 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_wall !wall surface temperature [degC]
988 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(INOUT) :: tsfc_surf !surface temperature [degC]
989
990 ! SPARTACUS input variables
991 INTEGER, INTENT(IN) :: n_vegetation_region_urban !Number of regions used to describe vegetation [-]
992 INTEGER, INTENT(IN) :: n_stream_sw_urban ! shortwave diffuse streams per hemisphere [-]
993 INTEGER, INTENT(IN) :: n_stream_lw_urban ! LW streams per hemisphere [-]
994 REAL(KIND(1D0)), INTENT(IN) :: sw_dn_direct_frac
995 REAL(KIND(1D0)), INTENT(IN) :: air_ext_sw
996 REAL(KIND(1D0)), INTENT(IN) :: air_ssa_sw
997 REAL(KIND(1D0)), INTENT(IN) :: veg_ssa_sw
998 REAL(KIND(1D0)), INTENT(IN) :: air_ext_lw
999 REAL(KIND(1D0)), INTENT(IN) :: air_ssa_lw
1000 REAL(KIND(1D0)), INTENT(IN) :: veg_ssa_lw
1001 REAL(KIND(1D0)), INTENT(IN) :: veg_fsd_const
1002 REAL(KIND(1D0)), INTENT(IN) :: veg_contact_fraction_const
1003 REAL(KIND(1D0)), INTENT(IN) :: ground_albedo_dir_mult_fact
1004
1005 ! ########################################################################################
1006
1007 ! ########################################################################################
1008 ! output variables
1009 REAL(KIND(1D0)), DIMENSION(5) :: datetimeLine !date & time
1010 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5) :: dataOutLineSUEWS
1011 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5) :: dataOutLineSnow
1012 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutESTM - 5) :: dataOutLineESTM
1013 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutEHC - 5) :: dataOutLineEHC
1014 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutRSL - 5) :: dataoutLineRSL
1015 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutBEERS - 5) :: dataOutLineBEERS
1016 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDebug - 5) :: dataOutLineDebug
1017 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSPARTACUS - 5) :: dataOutLineSPARTACUS
1018 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5) :: dataOutLineDailyState
1019 ! save all output variables in a single derived type
1020 TYPE(output_line), INTENT(OUT) :: output_line_suews
1021 ! ########################################################################################
1022
1023 ! ########################################################################################
1024 ! local variables
1025 REAL(KIND(1D0)) :: a1 !AnOHM coefficients of grid [-]
1026 REAL(KIND(1D0)) :: a2 ! AnOHM coefficients of grid [h]
1027 REAL(KIND(1D0)) :: a3 !AnOHM coefficients of grid [W m-2]
1028 REAL(KIND(1D0)) :: AdditionalWater !!Additional water coming from other grids [mm] (these are expressed as depths over the whole surface)
1029 REAL(KIND(1D0)) :: U10_ms !average wind speed at 10m [W m-1]
1030 REAL(KIND(1D0)) :: azimuth !solar azimuth [angle]
1031 REAL(KIND(1D0)) :: chSnow_per_interval ! change state_id of snow and surface per time interval [mm]
1032
1033 REAL(KIND(1D0)) :: dens_dry !Vap density or absolute humidity (kg m-3)
1034 REAL(KIND(1D0)) :: deltaLAI !change in LAI [m2 m-2]
1035 REAL(KIND(1D0)) :: drain_per_tstep ! total drainage for all surface type at each timestep [mm]
1036 REAL(KIND(1D0)) :: Ea_hPa !vapor pressure [hPa]
1037 REAL(KIND(1D0)) :: QE_LUMPS !turbulent latent heat flux by LUMPS model [W m-2]
1038 REAL(KIND(1D0)) :: es_hPa !Saturation vapour pressure over water [hPa]
1039 REAL(KIND(1D0)) :: ev_per_tstep ! evaporation at each time step [mm]
1040 REAL(KIND(1D0)) :: wu_ext !external water use [mm]
1041 REAL(KIND(1D0)) :: Fc !total co2 flux [umol m-2 s-1]
1042 REAL(KIND(1D0)) :: Fc_anthro !anthropogenic co2 flux [umol m-2 s-1]
1043 REAL(KIND(1D0)) :: Fc_biogen !biogenic CO2 flux [umol m-2 s-1]
1044 REAL(KIND(1D0)) :: Fc_build ! anthropogenic co2 flux [umol m-2 s-1]
1045 REAL(KIND(1D0)) :: fcld !estomated cloud fraction [-]
1046 REAL(KIND(1D0)) :: Fc_metab ! co2 emission from metabolism component [umol m-2 s-1]
1047 REAL(KIND(1D0)) :: Fc_photo !co2 flux from photosynthesis [umol m
1048 REAL(KIND(1D0)) :: Fc_point ! co2 emission from point source [umol m-2 s-1]
1049 REAL(KIND(1D0)) :: Fc_respi !co2 flux from respiration [umol m-2 s-1]
1050 REAL(KIND(1D0)) :: Fc_traff ! co2 emission from traffic component [umol m-2 s-1]
1051 REAL(KIND(1D0)) :: gfunc
1052 REAL(KIND(1D0)) :: gsc !Surface Layer Conductance
1053 REAL(KIND(1D0)) :: QH_LUMPS !turbulent sensible heat flux from LUMPS model [W m-2]
1054 REAL(KIND(1D0)) :: wu_int !internal water use [mm]
1055 REAL(KIND(1D0)) :: kclear !clear sky incoming shortwave radiation [W m-2]
1056 REAL(KIND(1D0)) :: kup !outgoing shortwave radiation [W m-2]
1057 REAL(KIND(1D0)) :: ldown !incoming longtwave radiation [W m-2]
1058 REAL(KIND(1D0)) :: lup !outgoing longwave radiation [W m-2]
1059 REAL(KIND(1D0)) :: L_mod !Obukhov length [m]
1060 REAL(KIND(1D0)) :: mwh !snowmelt [mm]
1061 REAL(KIND(1D0)) :: mwstore !overall met water [mm]
1062 REAL(KIND(1D0)) :: NWstate_per_tstep ! state_id at each tinestep(excluding water body) [mm]
1063 REAL(KIND(1D0)) :: FAI ! frontal area index [-]
1064 REAL(KIND(1D0)) :: PAI ! plan area index [-]
1065 REAL(KIND(1D0)) :: zL ! Stability scale [-]
1066 REAL(KIND(1D0)) :: q2_gkg ! Air specific humidity at 2 m [g kg-1]
1067 REAL(KIND(1D0)) :: qe !turbuent latent heat flux [W m-2]
1068 REAL(KIND(1D0)) :: qf !anthropogenic heat flux [W m-2]
1069 REAL(KIND(1D0)) :: QF_SAHP !total anthropogeic heat flux when EmissionMethod is not 0 [W m-2]
1070 REAL(KIND(1D0)) :: qh !turbulent sensible heat flux [W m-2]
1071 REAL(KIND(1D0)) :: qh_residual ! residual based sensible heat flux [W m-2]
1072 REAL(KIND(1D0)) :: qh_resist !resistance bnased sensible heat flux [W m-2]
1073 REAL(KIND(1D0)) :: Qm !Snowmelt-related heat [W m-2]
1074 REAL(KIND(1D0)) :: QmFreez !heat related to freezing of surface store [W m-2]
1075 REAL(KIND(1D0)) :: QmRain !melt heat for rain on snow [W m-2]
1076 REAL(KIND(1D0)) :: qn !net all-wave radiation [W m-2]
1077 REAL(KIND(1D0)) :: qn_snow !net all-wave radiation on snow surface [W m-2]
1078 REAL(KIND(1D0)) :: qn_snowfree !net all-wave radiation on snow-free surface [W m-2]
1079 REAL(KIND(1D0)) :: qs !heat storage flux [W m-2]
1080 REAL(KIND(1D0)) :: RA_h ! aerodynamic resistance [s m-1]
1081 REAL(KIND(1D0)) :: RS ! surface resistance [s m-1]
1082 REAL(KIND(1D0)), DIMENSION(NSURF) :: rss_surf ! surface resistance adjusted by surface wetness state[s m-1]
1083 REAL(KIND(1D0)) :: RH2 ! air relative humidity at 2m [-]
1084 REAL(KIND(1D0)) :: runoffAGveg !Above ground runoff from vegetated surfaces for all surface area [mm]
1085 REAL(KIND(1D0)) :: runoffAGimpervious !Above ground runoff from impervious surface for all surface area [mm]
1086 REAL(KIND(1D0)) :: runoff_per_tstep !runoff water at each time step [mm]
1087 REAL(KIND(1D0)) :: runoffPipes !runoff to pipes [mm]
1088 REAL(KIND(1D0)) :: runoffSoil_per_tstep !Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
1089 REAL(KIND(1D0)) :: runoffwaterbody !Above ground runoff from water body for all surface area [mm]
1090 REAL(KIND(1D0)) :: smd !soil moisture deficit [mm]
1091 REAL(KIND(1D0)) :: SoilState !Area-averaged soil moisture for whole surface [mm]
1092 REAL(KIND(1D0)) :: state_per_tstep !state_id at each timestep [mm]
1093 REAL(KIND(1D0)) :: surf_chang_per_tstep !change in state_id (exluding snowpack) per timestep [mm]
1094 REAL(KIND(1D0)) :: swe !overall snow water equavalent[mm]
1095 REAL(KIND(1D0)) :: t2_C !modelled 2 meter air temperature [degC]
1096 REAL(KIND(1D0)) :: TSfc_C ! surface temperature [degC]
1097 REAL(KIND(1D0)) :: TempVeg ! temporary vegetative surface fraction adjusted by rainfall [-]
1098 REAL(KIND(1D0)) :: tot_chang_per_tstep !Change in surface state_id [mm]
1099 REAL(KIND(1D0)) :: TStar !T*, temperature scale [-]
1100 REAL(KIND(1D0)) :: tsurf !surface temperatue [degC]
1101 REAL(KIND(1D0)) :: UStar !friction velocity [m s-1]
1102 REAL(KIND(1D0)) :: VPD_Pa !vapour pressure deficit [Pa]
1103 REAL(KIND(1D0)) :: z0m !Aerodynamic roughness length [m]
1104 REAL(KIND(1D0)) :: zdm !zero-plane displacement [m]
1105 REAL(KIND(1D0)) :: ZENITH_deg !solar zenith angle in degree [°]
1106 REAL(KIND(1D0)) :: zH ! Mean building height [m]
1107
1108 REAL(KIND(1D0)), DIMENSION(2) :: SnowRemoval !snow removal [mm]
1109 REAL(KIND(1D0)), DIMENSION(NSURF) :: wu_surf !external water use of each surface type [mm]
1110 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezMelt !freezing of melt water[mm]
1111 REAL(KIND(1D0)), DIMENSION(nsurf) :: kup_ind_snow !outgoing shortwave on snowpack [W m-2]
1112 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: mw_ind !melt water from sknowpack[mm]
1113 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_freezState !heat related to freezing of surface store [W m-2]
1114 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_melt !melt heat [W m-2]
1115 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_rain !melt heat for rain on snow [W m-2]
1116 REAL(KIND(1D0)), DIMENSION(NSURF) :: qn_ind_snow !net all-wave radiation on snowpack [W m-2]
1117 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: rainOnSnow !rain water on snow event [mm]
1118 REAL(KIND(1D0)), DIMENSION(NSURF) :: runoffSoil !Soil runoff from each soil sub-surface [mm]
1119 REAL(KIND(1D0)), DIMENSION(NSURF) :: smd_nsurf !soil moisture deficit for each surface
1120 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: snowDepth !Snow depth [m]
1121
1122 REAL(KIND(1D0)), DIMENSION(nsurf) :: Tsurf_ind_snow !snowpack surface temperature [C]
1123
1124 ! INTEGER, DIMENSION(NSURF) :: snowCalcSwitch
1125 INTEGER, DIMENSION(3) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
1126 INTEGER :: DLS
1127
1128 REAL(KIND(1D0)) :: dq !Specific humidity deficit [g/kg]
1129 REAL(KIND(1D0)) :: lvS_J_kg !latent heat of sublimation [J kg-1]
1130 REAL(KIND(1D0)) :: psyc_hPa !psychometric constant [hPa]
1131 REAL(KIND(1D0)) :: z0v !roughness for heat [m]
1132 REAL(KIND(1D0)) :: z0vSnow !roughness for heat [m]
1133 REAL(KIND(1D0)) :: RAsnow !Aerodynamic resistance for snow [s m-1]
1134 REAL(KIND(1D0)) :: RB !boundary layer resistance shuttleworth
1135 REAL(KIND(1D0)) :: runoff_per_interval !run-off at each time interval [mm]
1136 REAL(KIND(1D0)) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
1137 REAL(KIND(1D0)) :: sIce_hpa !satured curve on snow [hPa]
1138 REAL(KIND(1D0)) :: SoilMoistCap !Maximum capacity of soil store [mm]
1139 ! REAL(KIND(1D0)) :: veg_fr !vegetation fraction [-]
1140 REAL(KIND(1D0)) :: VegPhenLumps
1141 REAL(KIND(1D0)) :: VPd_hpa ! vapour pressure deficit [hPa]
1142 REAL(KIND(1D0)) :: vsmd !Soil moisture deficit for vegetated surfaces only [mm]
1143 REAL(KIND(1D0)) :: ZZD !Active measurement height[m]
1144
1145 REAL(KIND(1D0)), DIMENSION(NSURF) :: deltaQi ! storage heat flux of snow surfaces [W m-2]
1146 REAL(KIND(1D0)), DIMENSION(NSURF) :: drain_surf !drainage of each surface type [mm]
1147 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezState !freezing of state_id [mm]
1148 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezStateVol !surface state_id [mm]
1149 REAL(KIND(1D0)), DIMENSION(NSURF) :: tsurf_ind !snow-free surface temperature [degC]
1150
1151 ! TODO: TS 25 Oct 2017
1152 ! the variables are not used currently as grid-to-grid connection is NOT set up.
1153 ! set these variables as zero.
1154 REAL(KIND(1D0)) :: addImpervious = 0
1155 REAL(KIND(1D0)) :: addPipes = 0
1156 REAL(KIND(1D0)) :: addVeg = 0
1157 REAL(KIND(1D0)) :: addWaterBody = 0
1158 REAL(KIND(1D0)), DIMENSION(NSURF) :: AddWater = 0
1159 REAL(KIND(1D0)), DIMENSION(NSURF) :: frac_water2runoff = 0
1160
1161 ! values that are derived from tstep
1162 INTEGER :: nsh ! number of timesteps per hour
1163 REAL(KIND(1D0)) :: nsh_real ! nsh in type real [-]
1164 REAL(KIND(1D0)) :: tstep_real ! tstep in type real
1165 REAL(KIND(1D0)) :: dectime !decimal time [-]
1166
1167 ! values that are derived from sfr_surf (surface fractions)
1168 REAL(KIND(1D0)) :: VegFraction ! fraction of vegetation [-]
1169 REAL(KIND(1D0)) :: ImpervFraction !fractioin of impervious surface [-]
1170 REAL(KIND(1D0)) :: PervFraction !fraction of pervious surfaces [-]
1171 REAL(KIND(1D0)) :: NonWaterFraction !fraction of non-water [-]
1172
1173 ! snow related temporary values
1174 REAL(KIND(1D0)) :: albedo_snow !snow albedo [-]
1175
1176 ! ########################################################################################
1177 ! TS 19 Sep 2019
1178 ! temporary variables to save values for inout varialbes
1179 ! suffixes and denote values from last and to next tsteps, respectively
1180 ! these variables are introduced to allow safe and robust iterations inccurred in this subroutine
1181 ! so that these values won't updated in unexpectedly many times
1182
1183 ! OHM related:
1184 REAL(KIND(1D0)) :: qn_av_prev, qn_av_next ! weighted average of net all-wave radiation [W m-2]
1185 REAL(KIND(1D0)) :: dqndt_prev, dqndt_next ! Rate of change of net radiation [W m-2 h-1]
1186 REAL(KIND(1D0)) :: qn_s_av_prev, qn_s_av_next ! weighted average of qn over snow [W m-2]
1187 REAL(KIND(1D0)) :: dqnsdt_prev, dqnsdt_next ! Rate of change of net radiation [W m-2 h-1]
1188
1189 ! snow related:
1190 REAL(KIND(1D0)) :: SnowfallCum_prev, SnowfallCum_next !cumulative snow depth [mm]
1191 REAL(KIND(1D0)) :: SnowAlb_prev, SnowAlb_next !snow albedo [-]
1192
1193 REAL(KIND(1D0)), DIMENSION(NSURF) :: IceFrac_prev, IceFrac_next !fraction of ice in snowpack [-]
1194 REAL(KIND(1D0)), DIMENSION(NSURF) :: SnowWater_prev, SnowWater_next ! snow water[mm]
1195 REAL(KIND(1D0)), DIMENSION(NSURF) :: SnowDens_prev, SnowDens_next !snow density [kg m-3]
1196 REAL(KIND(1D0)), DIMENSION(NSURF) :: SnowFrac_prev, SnowFrac_next !snow fraction [-]
1197 REAL(KIND(1D0)), DIMENSION(NSURF) :: SnowPack_prev, SnowPack_next !snow water equivalent on each land cover [mm]
1198
1199 ! water balance related:
1200 REAL(KIND(1D0)), DIMENSION(NSURF) :: soilstore_surf_prev, soilstore_surf_next !soil moisture of each surface type [mm]
1201 REAL(KIND(1D0)), DIMENSION(nlayer) :: soilstore_roof_prev, soilstore_roof_next !soil moisture of roof [mm]
1202 REAL(KIND(1D0)), DIMENSION(nlayer) :: soilstore_wall_prev, soilstore_wall_next !soil moisture of wall[mm]
1203 REAL(KIND(1D0)), DIMENSION(NSURF) :: state_surf_prev, state_surf_next !wetness status of each surface type [mm]
1204 REAL(KIND(1D0)), DIMENSION(nlayer) :: state_roof_prev, state_roof_next !wetness status of roof [mm]
1205 REAL(KIND(1D0)), DIMENSION(nlayer) :: state_wall_prev, state_wall_next !wetness status of wall [mm]
1206 REAL(KIND(1D0)), DIMENSION(NSURF) :: ev0_surf ! evapotranspiration from PM of each surface type [mm]
1207 REAL(KIND(1D0)), DIMENSION(NSURF) :: ev_surf ! evapotranspiration of each surface type [mm]
1208 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_roof ! evapotranspiration of each roof layer [mm]
1209 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_wall ! evapotranspiration of each wall type [mm]
1210 REAL(KIND(1D0)), DIMENSION(6, NSURF) :: StoreDrainPrm_prev, StoreDrainPrm_next !coefficients used in drainage calculation [-]
1211
1212 ! phenology related:
1213 REAL(KIND(1D0)), DIMENSION(NSURF) :: alb_prev, alb_next !albedo [-]
1214 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: GDD_id_prev, GDD_id_next !Growing Degree Days [degC]
1215 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: LAI_id_prev, LAI_id_next !Senescence Degree Days[degC]
1216 REAL(KIND(1D0)), DIMENSION(nvegsurf) :: SDD_id_prev, SDD_id_next !LAI for each veg surface [m2 m-2]
1217
1218 REAL(KIND(1D0)) :: DecidCap_id_prev, DecidCap_id_next !Moisture storage capacity of deciduous trees [mm]
1219 REAL(KIND(1D0)) :: albDecTr_id_prev, albDecTr_id_next !Albedo of deciduous trees [-]
1220 REAL(KIND(1D0)) :: albEveTr_id_prev, albEveTr_id_next !Albedo of evergreen trees [-]
1221 REAL(KIND(1D0)) :: albGrass_id_prev, albGrass_id_next !Albedo of grass [-]
1222 REAL(KIND(1D0)) :: porosity_id_prev, porosity_id_next !Porosity of deciduous trees [-]
1223
1224 REAL(KIND(1D0)) :: Tmin_id_prev, Tmin_id_next !Daily minimum temperature [degC]
1225 REAL(KIND(1D0)) :: Tmax_id_prev, Tmax_id_next !Daily maximum temperature [degC]
1226 REAL(KIND(1D0)) :: lenDay_id_prev, lenDay_id_next !daytime length [h]
1227
1228 ! anthropogenic heat related:
1229 REAL(KIND(1D0)), DIMENSION(12) :: HDD_id_prev, HDD_id_next !Heating Degree Days [degC d]
1230
1231 ! water use related:
1232 REAL(KIND(1D0)), DIMENSION(9) :: WUDay_id_prev, WUDay_id_next !Daily water use for EveTr, DecTr, Grass [mm]
1233
1234 REAL(KIND(1D0)) :: Tair_av_prev, Tair_av_next !average air temperature [degC]
1235 ! ########################################################################################
1236
1237 ! Related to RSL wind profiles
1238 INTEGER, PARAMETER :: nz = 90 ! number of levels 10 levels in canopy plus 20 (3 x Zh) above the canopy
1239
1240 ! flag for Tsurf convergence
1241 LOGICAL :: flag_converge
1242 REAL(KIND(1D0)) :: Ts_iter !average surface temperature of all surfaces [degC]
1243 REAL(KIND(1D0)) :: dif_tsfc_iter
1244 REAL(KIND(1D0)) :: QH_Init !initialised sensible heat flux [W m-2]
1245 INTEGER :: i_iter
1246
1247 ! ########################################################################################
1248 ! ! extended for ESTM_ehc, TS 20 Jan 2022
1249 !
1250 ! input arrays: standard suews surfaces
1251 REAL(KIND(1D0)), DIMENSION(nlayer) :: tsfc_out_roof, tsfc0_out_roof !surface temperature of roof[degC]
1252 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_roof ! indoor temperature for roof [degC]
1253 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_roof !roof surface fraction [-]
1254 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_in_roof ! temperature at inner interfaces of roof [degC]
1255 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_roof ! thermal conductivity of roof [W m-1 K]
1256 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_roof ! Heat capacity of roof [J m-3 K-1]
1257 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_roof ! thickness of each layer in roof [m]
1258 ! input arrays: standard suews surfaces
1259 REAL(KIND(1D0)), DIMENSION(nlayer) :: tsfc_out_wall, tsfc0_out_wall !surface temperature of wall [degC]
1260 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_wall ! indoor temperature for wall [degC]
1261 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_wall !wall surface fraction [-]
1262 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_in_wall ! temperature at inner interfaces of wall [degC]
1263 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_wall ! thermal conductivity of wall [W m-1 K]
1264 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_wall ! Heat capacity of wall [J m-3 K-1]
1265 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_wall ! thickness of each layer in wall [m]
1266 ! input arrays: standard suews surfaces
1267 REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc_out_surf, tsfc0_out_surf !surface temperature [degC]
1268 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tin_surf !deep bottom temperature for each surface [degC]
1269 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth) :: temp_in_surf ! temperature at inner interfaces of of each surface [degC]
1270 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: k_surf ! thermal conductivity of v [W m-1 K]
1271 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: cp_surf ! Heat capacity of each surface [J m-3 K-1]
1272 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: dz_surf ! thickness of each layer in each surface [m]
1273
1274 ! output arrays:
1275
1276 ! roof facets
1277 ! aggregated heat storage of all roof facets
1278 REAL(KIND(1D0)), DIMENSION(nlayer) :: QS_roof ! heat storage flux for roof component [W m-2]
1279 !interface temperature between depth layers
1280 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_out_roof !interface temperature between depth layers [degC]
1281
1282 ! energy fluxes of individual surfaces
1283 REAL(KIND(1D0)), DIMENSION(nlayer) :: QG_roof ! heat flux used in ESTM_ehc as forcing of roof surface [W m-2]
1284 REAL(KIND(1D0)), DIMENSION(nlayer) :: QN_roof ! net all-wave radiation of roof surface [W m-2]
1285 REAL(KIND(1D0)), DIMENSION(nlayer) :: qe_roof ! latent heat flux of roof surface [W m-2]
1286 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_roof ! sensible heat flux of roof surface [W m-2]
1287 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_resist_roof ! resist-based sensible heat flux of roof surface [W m-2]
1288
1289 ! wall facets
1290 ! aggregated heat storage of all wall facets
1291 REAL(KIND(1D0)), DIMENSION(nlayer) :: QS_wall ! heat storage flux for wall component [W m-2]
1292 !interface temperature between depth layers
1293 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_out_wall !interface temperature between depth layers [degC]
1294
1295 ! energy fluxes of individual surfaces
1296 REAL(KIND(1D0)), DIMENSION(nlayer) :: QG_wall ! heat flux used in ESTM_ehc as forcing of wall surface [W m-2]
1297 REAL(KIND(1D0)), DIMENSION(nlayer) :: QN_wall ! net all-wave radiation of wall surface [W m-2]
1298 REAL(KIND(1D0)), DIMENSION(nlayer) :: qe_wall ! latent heat flux of wall surface [W m-2]
1299 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_wall ! sensible heat flux of wall surface [W m-2]
1300 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_resist_wall ! resistance based sensible heat flux of wall surface [W m-2]
1301
1302 ! standard suews surfaces
1303 !interface temperature between depth layers
1304 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth) :: temp_out_surf !interface temperature between depth layers[degC]
1305
1306 ! energy fluxes of individual surfaces
1307 REAL(KIND(1D0)), DIMENSION(nsurf) :: QG_surf ! heat flux used in ESTM_ehc as forcing of individual surface [W m-2]
1308 REAL(KIND(1D0)), DIMENSION(nsurf) :: QN_surf ! net all-wave radiation of individual surface [W m-2]
1309 REAL(KIND(1D0)), DIMENSION(nsurf) :: qs_surf ! aggregated heat storage of of individual surface [W m-2]
1310 REAL(KIND(1D0)), DIMENSION(nsurf) :: qe0_surf ! latent heat flux from PM of individual surface [W m-2]
1311 REAL(KIND(1D0)), DIMENSION(nsurf) :: qe_surf ! latent heat flux of individual surface [W m-2]
1312 REAL(KIND(1D0)), DIMENSION(nsurf) :: qh_surf ! sensinle heat flux of individual surface [W m-2]
1313 REAL(KIND(1D0)), DIMENSION(nsurf) :: qh_resist_surf ! resistance based sensible heat flux of individual surface [W m-2]
1314 ! surface temperature
1315 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc_qh_surf ! latent heat flux of individual surface [W m-2]
1316
1317 ! iterator for surfaces
1318 INTEGER :: i_surf !iterator for surfaces
1319
1320 ! used in iteration
1321 INTEGER :: max_iter !maximum iteration
1322 REAL(KIND(1D0)) :: ratio_iter
1323
1324 LOGICAL, INTENT(IN) :: use_sw_direct_albedo !boolean, Specify ground and roof albedos separately for direct solar radiation [-]
1325
1326 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height ! height in spartacus [m]
1327 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac !building fraction [-]
1328 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_frac !vegetation fraction [-]
1329 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale ! diameter of buildings [[m]
1330 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_scale ! scale of tree crowns [m]
1331 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_roof !albedo of roof [-]
1332 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_roof ! emissivity of roof [-]
1333 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_wall !albedo of wall [-]
1334 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_wall ! emissivity of wall [-]
1335 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: roof_albedo_dir_mult_fact !Ratio of the direct and diffuse albedo of the roof[-]
1336 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: wall_specular_frac ! Fraction of wall reflection that is specular [-]
1337
1338 REAL(KIND(1D0)) :: g_kdown !gdq*gtemp*gs*gq for photosynthesis calculations
1339 REAL(KIND(1D0)) :: g_dq !gdq*gtemp*gs*gq for photosynthesis calculations
1340 REAL(KIND(1D0)) :: g_ta !gdq*gtemp*gs*gq for photosynthesis calculations
1341 REAL(KIND(1D0)) :: g_smd !gdq*gtemp*gs*gq for photosynthesis calculations
1342 REAL(KIND(1D0)) :: g_lai !gdq*gtemp*gs*gq for photosynthesis calculations
1343
1344 ! calculated values of FAI
1345 REAL(KIND(1D0)) :: FAIBldg_use
1346 REAL(KIND(1D0)) :: FAIEveTree_use
1347 REAL(KIND(1D0)) :: FAIDecTree_use
1348
1349 ! ####
1350 ! set initial values for output arrays
1351 swe = 0.
1352 mwh = 0.
1353 mwstore = 0.
1354 chsnow_per_interval = 0.
1355 snowremoval = 0.
1356 qm = 0
1357 qmfreez = 0
1358 qmrain = 0
1359
1360 ! these output variables are used for debugging
1361 qe0_surf = 0 ! QE from PM: only meaningful when snowuse=0
1362 ev0_surf = 0 ! ev from PM: only meaningful when snowuse=0
1363 ev_surf = 0 ! ev from water balance: only meaningful when snowuse=0
1364
1365 ! ####
1366 ! force several snow related state variables to zero if snow module is off
1367 IF (snowuse == 0) THEN
1368 snowdens = 0.
1369 snowfrac = 0.
1370 snowwater = 0.
1371 snowalb = 0.
1372 icefrac = 0.
1373 snowpack = 0.
1374 END IF
1375
1376 ! ########################################################################################
1377 ! save initial values of inout variables
1378 qn_av_prev = qn_av
1379 dqndt_prev = dqndt
1380 qn_s_av_prev = qn_s_av
1381 dqnsdt_prev = dqnsdt
1382 snowfallcum_prev = snowfallcum
1383 snowalb_prev = snowalb
1384 icefrac_prev = icefrac
1385 snowwater_prev = snowwater
1386 snowdens_prev = snowdens
1387 snowfrac_prev = merge(snowfrac_obs, snowfrac, netradiationmethod == 0)
1388 snowpack_prev = snowpack
1389 state_surf_prev = state_surf
1390 soilstore_surf_prev = soilstore_surf
1391 IF (storageheatmethod == 5) THEN
1392 state_roof_prev = state_roof
1393 state_wall_prev = state_wall
1394 soilstore_roof_prev = soilstore_roof
1395 soilstore_wall_prev = soilstore_wall
1396 END IF
1397 tair_av_prev = tair_av
1398 lai_id_prev = lai_id
1399 gdd_id_prev = gdd_id
1400 sdd_id_prev = sdd_id
1401 tmin_id_prev = tmin_id
1402 tmax_id_prev = tmax_id
1403 lenday_id_prev = lenday_id
1404 storedrainprm_prev = storedrainprm
1405 decidcap_id_prev = decidcap_id
1406 porosity_id_prev = porosity_id
1407 alb_prev = alb
1408 albdectr_id_prev = albdectr_id
1409 albevetr_id_prev = albevetr_id
1410 albgrass_id_prev = albgrass_id
1411 hdd_id_prev = hdd_id
1412 wuday_id_prev = wuday_id
1413
1414 ! ESTM_ehc related
1415 ! save initial values of inout variables
1416 IF (storageheatmethod == 5) THEN
1417 temp_in_roof = temp_roof
1418 temp_in_wall = temp_wall
1419 temp_in_surf = temp_surf
1420 END IF
1421 ! initialise indoor/bottom boundary temperature arrays
1422 ! tin_roof = 10.
1423 ! tin_wall = 10.
1424 ! tin_surf = 3.
1425
1426 ! initialise variables
1427 qn_av_next = qn_av
1428 dqndt_next = dqndt
1429 qn_s_av_next = qn_s_av
1430 dqnsdt_next = dqnsdt
1431 snowfallcum_next = snowfallcum
1432 snowalb_next = snowalb
1433 icefrac_next = icefrac
1434 snowwater_next = snowwater
1435 snowdens_next = snowdens
1436 snowfrac_next = snowfrac_prev
1437 snowpack_next = snowpack
1438 state_surf_next = state_surf
1439 soilstore_surf_next = soilstore_surf
1440
1441 IF (storageheatmethod == 5) THEN
1442
1443 soilstore_roof_next = soilstore_roof
1444 soilstore_wall_next = soilstore_wall
1445 state_roof_next = state_roof
1446 state_wall_next = state_wall
1447
1448 END IF
1449
1450 tair_av_next = tair_av
1451 lai_id_next = lai_id
1452 gdd_id_next = gdd_id
1453 sdd_id_next = sdd_id
1454 tmin_id_next = tmin_id
1455 tmax_id_next = tmax_id
1456 lenday_id_next = lenday_id
1457 storedrainprm_next = storedrainprm
1458 decidcap_id_next = decidcap_id
1459 porosity_id_next = porosity_id
1460 alb_next = alb
1461 albdectr_id_next = albdectr_id
1462 albevetr_id_next = albevetr_id
1463 albgrass_id_next = albgrass_id
1464 hdd_id_next = hdd_id
1465 wuday_id_next = wuday_id
1466
1467 ! initialise output variables
1468 dataoutlinesnow = -999.
1469 dataoutlineestm = -999.
1470 dataoutlineehc = -999.
1471 dataoutlinersl = -999.
1472 dataoutlinebeers = -999.
1473 dataoutlinedebug = -999.
1474 dataoutlinespartacus = -999.
1475 dataoutlinedailystate = -999.
1476
1477 !########################################################################################
1478 ! main calculation starts here
1479 !########################################################################################
1480
1481 ! iteration is used below to get results converge
1482 flag_converge = .false.
1483 ts_iter = temp_c
1484
1485 tsfc_out_surf = tsfc_surf
1486 tsfc0_out_surf = tsfc_surf
1487 ! TODO: ESTM work: to allow heterogeneous surface temperatures
1488 IF (storageheatmethod == 5 .OR. netradiationmethod > 1000) THEN
1489 tsfc_out_roof = tsfc_roof
1490 tsfc0_out_roof = tsfc_roof
1491 tsfc_out_wall = tsfc_wall
1492 tsfc0_out_wall = tsfc_wall
1493 END IF
1494 ! PRINT *, 'sfr_surf for this grid ', sfr_surf
1495 ! PRINT *, 'before iteration Ts_iter = ', Ts_iter
1496 ! L_mod_iter = 10
1497 i_iter = 1
1498 max_iter = 30
1499 DO WHILE ((.NOT. flag_converge) .AND. i_iter < max_iter)
1500 ! PRINT *, '=========================== '
1501 ! PRINT *, 'Ts_iter of ', i_iter, ' is:', Ts_iter
1502
1503 ! calculate dectime
1504 CALL suews_cal_dectime( &
1505 id, it, imin, isec, & ! input
1506 dectime) ! output
1507
1508 ! calculate tstep related VARIABLES
1509 CALL suews_cal_tstep( &
1510 tstep, & ! input
1511 nsh, nsh_real, tstep_real) ! output
1512
1513 ! calculate surface fraction related VARIABLES
1514 CALL suews_cal_surf( &
1515 storageheatmethod, netradiationmethod, & !input
1516 nlayer, sfr_surf, & !input
1517 building_frac, building_scale, height, & !input
1518 vegfraction, impervfraction, pervfraction, nonwaterfraction, & ! output
1519 sfr_roof, sfr_wall) ! output
1520
1521 ! calculate dayofweek information
1522 CALL suews_cal_weekday( &
1523 iy, id, lat, & !input
1524 dayofweek_id) !output
1525
1526 ! calculate dayofweek information
1527 CALL suews_cal_dls( &
1528 id, startdls, enddls, & !input
1529 dls) !output
1530
1531 ! calculate mean air temperature of past 24 hours
1532 tair_av_next = cal_tair_av(tair_av_prev, dt_since_start, tstep, temp_c)
1533
1534 !==============main calculation start=======================
1535
1536 !==============surface roughness calculation=======================
1537 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_RoughnessParameters...'
1538 IF (diagnose == 1) print *, 'z0m_in =', z0m_in
1539 CALL suews_cal_roughnessparameters( &
1540 roughlenmommethod, faimethod, &
1541 sfr_surf, & !input
1542 surfacearea, & !input
1543 bldgh, evetreeh, dectreeh, &
1544 porosity_id_prev, faibldg, faievetree, faidectree, &
1545 z0m_in, zdm_in, z, &
1546 fai, pai, & !output
1547 zh, z0m, zdm, zzd)
1548 ! print *, 'day =', id, 'hour =', it, 'porosity_id = ', porosity_id_prev
1549
1550 !=================Calculate sun position=================
1551 IF (diagnose == 1) WRITE (*, *) 'Calling NARP_cal_SunPosition...'
1552 CALL narp_cal_sunposition( &
1553 REAL(iy, KIND(1D0)), & !input:
1554 dectime - tstep/2/86400, & ! sun position at middle of timestep before
1555 timezone, lat, lng, alt, &
1556 azimuth, zenith_deg) !output:
1557
1558 !=================Call the SUEWS_cal_DailyState routine to get surface characteristics ready=================
1559 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_DailyState...'
1560 CALL suews_cal_dailystate( &
1561 iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, dayofweek_id, & !input
1562 tmin_id_prev, tmax_id_prev, lenday_id_prev, &
1563 basetmethod, &
1564 waterusemethod, ie_start, ie_end, &
1565 laimethod, laitype, &
1566 nsh_real, kdown, temp_c, precip, baset_hc, &
1567 baset_heating, baset_cooling, &
1568 lat, faut, lai_obs, &
1569 albmax_dectr, albmax_evetr, albmax_grass, &
1570 albmin_dectr, albmin_evetr, albmin_grass, &
1571 capmax_dec, capmin_dec, pormax_dec, pormin_dec, &
1572 ie_a, ie_m, daywatper, daywat, &
1573 baset, basete, gddfull, sddfull, laimin, laimax, laipower, &
1574 decidcap_id_prev, storedrainprm_prev, lai_id_prev, gdd_id_prev, sdd_id_prev, &
1575 albdectr_id_prev, albevetr_id_prev, albgrass_id_prev, porosity_id_prev, & !input
1576 hdd_id_prev, & !input
1577 state_surf_prev, soilstore_surf_prev, soilstorecap_surf, h_maintain, & !input
1578 hdd_id_next, & !output
1579 tmin_id_next, tmax_id_next, lenday_id_next, &
1580 albdectr_id_next, albevetr_id_next, albgrass_id_next, porosity_id_next, & !output
1581 decidcap_id_next, storedrainprm_next, lai_id_next, gdd_id_next, sdd_id_next, wuday_id_next) !output
1582
1583 !=================Calculation of density and other water related parameters=================
1584 IF (diagnose == 1) WRITE (*, *) 'Calling LUMPS_cal_AtmMoist...'
1585 CALL cal_atmmoist( &
1586 temp_c, press_hpa, avrh, dectime, & ! input:
1587 lv_j_kg, lvs_j_kg, & ! output:
1588 es_hpa, ea_hpa, vpd_hpa, vpd_pa, dq, dens_dry, avcp, avdens)
1589
1590 !======== Calculate soil moisture =========
1591 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_update_SoilMoist...'
1592 CALL suews_update_soilmoist( &
1593 nonwaterfraction, & !input
1594 soilstorecap_surf, sfr_surf, soilstore_surf_prev, &
1595 soilmoistcap, soilstate, & !output
1596 vsmd, smd)
1597
1598 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_WaterUse...'
1599 !=================Gives the external and internal water uses per timestep=================
1600 CALL suews_cal_wateruse( &
1601 nsh_real, & ! input:
1602 wu_m3, surfacearea, sfr_surf, &
1603 irrfracpaved, irrfracbldgs, &
1604 irrfracevetr, irrfracdectr, irrfracgrass, &
1605 irrfracbsoil, irrfracwater, &
1606 dayofweek_id, wuprofa_24hr, wuprofm_24hr, &
1607 internalwateruse_h, hdd_id_next, wuday_id_next, &
1608 waterusemethod, nsh, it, imin, dls, &
1609 wu_surf, wu_int, wu_ext) ! output:
1610
1611 ! ===================ANTHROPOGENIC HEAT AND CO2 FLUX======================
1612 CALL suews_cal_anthropogenicemission( &
1613 ah_min, ahprof_24hr, ah_slope_cooling, ah_slope_heating, co2pointsource, & ! input:
1614 dayofweek_id, dls, ef_umolco2perj, emissionsmethod, enef_v_jkm, &
1615 fcef_v_kgkm, frfossilfuel_heat, frfossilfuel_nonheat, hdd_id_next, humactivity_24hr, &
1616 imin, it, maxfcmetab, maxqfmetab, minfcmetab, minqfmetab, &
1617 popdensdaytime, popdensnighttime, popprof_24hr, qf, qf0_beu, qf_a, qf_b, qf_c, &
1618 qf_obs, qf_sahp, surfacearea, baset_cooling, baset_heating, &
1619 temp_c, trafficrate, trafficunits, traffprof_24hr, &
1620 fc_anthro, fc_build, fc_metab, fc_point, fc_traff) ! output:
1621
1622 ! ========================================================================
1623 ! N.B.: the following parts involves snow-related calculations.
1624 ! ===================NET ALLWAVE RADIATION================================
1625 ! if (kdown>0 .and. i_iter == 1) then
1626 ! print *, 'snowFrac_prev=', snowFrac_prev
1627 ! snowFrac_prev=-999
1628 ! print *, 'snowFrac_prev=', snowFrac_prev
1629 ! endif
1630 CALL suews_cal_qn( &
1631 storageheatmethod, netradiationmethod, snowuse, & !input
1632 tstep, nlayer, snowpack_prev, tau_a, tau_f, snowalbmax, snowalbmin, &
1633 diagnose, ldown_obs, fcld_obs, &
1634 dectime, zenith_deg, ts_iter, kdown, temp_c, avrh, ea_hpa, qn1_obs, &
1635 snowalb_prev, snowfrac_prev, diagqn, &
1636 narp_trans_site, narp_emis_snow, icefrac_prev, &
1637 sfr_surf, sfr_roof, sfr_wall, &
1638 tsfc_out_surf, tsfc_out_roof, tsfc_out_wall, &
1639 emis, alb_prev, albdectr_id_next, albevetr_id_next, albgrass_id_next, &
1640 lai_id, & !input
1641 n_vegetation_region_urban, &
1642 n_stream_sw_urban, n_stream_lw_urban, &
1643 sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
1644 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
1645 veg_fsd_const, veg_contact_fraction_const, &
1646 ground_albedo_dir_mult_fact, use_sw_direct_albedo, & !input
1647 height, building_frac, veg_frac, building_scale, veg_scale, & !input: SPARTACUS
1648 alb_roof, emis_roof, alb_wall, emis_wall, &
1649 roof_albedo_dir_mult_fact, wall_specular_frac, &
1650 alb_next, ldown, fcld, & !output
1651 qn_surf, qn_roof, qn_wall, &
1652 qn, qn_snowfree, qn_snow, kclear, kup, lup, tsurf, &
1653 qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, &
1654 albedo_snow, snowalb_next, &
1655 dataoutlinespartacus)
1656
1657 ! IF (qn < -300) THEN
1658 ! PRINT *, 'qn=', qn
1659 ! PRINT *, 'snowFrac_prev=', snowFrac_prev
1660 ! END IF
1661
1662 ! PRINT *, 'Qn_surf after SUEWS_cal_Qn ', qn_surf
1663 ! PRINT *, 'qn_roof after SUEWS_cal_Qn ', qn_roof
1664 ! PRINT *, 'qn_wall after SUEWS_cal_Qn ', qn_wall
1665 ! PRINT *, ''
1666
1667 ! =================STORAGE HEAT FLUX=======================================
1668 IF (i_iter == 1) THEN
1669 qg_surf = 0.1*qn_surf
1670 qg_roof = 0.1*qn_roof
1671 qg_wall = 0.1*qn_wall
1672 ELSE
1673 qg_surf = qn_surf + qf - (qh_surf + qe_surf)
1674 qg_roof = qn_roof + qf - (qh_roof + qe_roof)
1675 qg_wall = qn_wall + qf - (qh_wall + qe_wall)
1676 END IF
1677
1678 ! PRINT *, 'Qg_surf before cal_qs', Qg_surf
1679 ! PRINT *, 'Qg_roof before cal_qs', Qg_roof
1680 ! PRINT *, 'Qg_wall before cal_qs', Qg_wall
1681 ! print *,''
1682
1683 ! PRINT *, 'tsfc_surf before cal_qs', tsfc_out_surf
1684 ! PRINT *, 'tsfc_out_roof before cal_qs', tsfc_out_roof
1685 ! PRINT *, 'tsfc_wall before cal_qs', tsfc_out_wall
1686 ! PRINT *, ''
1687
1688 CALL suews_cal_qs( &
1689 storageheatmethod, qs_obs, ohmincqf, gridiv, & !input
1690 id, tstep, dt_since_start, diagnose, &
1691 nlayer, &
1692 qg_surf, qg_roof, qg_wall, &
1693 tsfc_out_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, & !input
1694 tsfc_out_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, & !input
1695 tsfc_out_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_surf, & !input
1696 ohm_coef, ohm_threshsw, ohm_threshwd, &
1697 soilstore_surf_prev, soilstorecap_surf, state_surf_prev, snowuse, snowfrac_prev, diagqs, &
1698 hdd_id, metforcingdata_grid, ts5mindata_ir, qf, qn, &
1699 kdown, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, &
1700 bldgh, alb, emis, cpanohm, kkanohm, chanohm, emissionsmethod, &
1701 tair_av, qn_av_prev, dqndt_prev, qn_s_av_prev, dqnsdt_prev, &
1702 storedrainprm, &
1703 qn_snow, dataoutlineestm, qs, & !output
1704 qn_av_next, dqndt_next, qn_s_av_next, dqnsdt_next, &
1705 deltaqi, a1, a2, a3, &
1706 temp_out_roof, qs_roof, & !output
1707 temp_out_wall, qs_wall, & !output
1708 temp_out_surf, qs_surf) !output
1709
1710 ! update iteration variables
1711 ! temp_in_roof = temp_out_roof
1712 ! temp_in_wall = temp_out_wall
1713 ! temp_in_surf = temp_out_surf
1714 ! Ts_iter = DOT_PRODUCT(tsfc_out_surf, sfr_surf)
1715 ! PRINT *, 'QS_surf after cal_qs', QS_surf
1716 ! PRINT *, 'QS_roof after cal_qs', QS_roof
1717 ! PRINT *, 'QS_wall after cal_qs', QS_wall
1718
1719 ! PRINT *, ''
1720
1721 ! PRINT *, 'tsfc_surf after cal_qs', tsfc_out_surf
1722 ! PRINT *, 'tsfc_roof after cal_qs', tsfc_out_roof
1723 ! PRINT *, 'tsfc_wall after cal_qs', tsfc_out_wall
1724 ! PRINT *, ''
1725 ! print *,'tsfc_surf abs. diff.:',maxval(abs(tsfc_out_surf-tsfc0_out_surf)),maxloc(abs(tsfc_out_surf-tsfc0_out_surf))
1726 ! dif_tsfc_iter=maxval(abs(tsfc_out_surf-tsfc0_out_surf))
1727 ! print *,'tsfc_roof abs. diff.:',maxval(abs(tsfc_out_roof-tsfc0_out_roof)),maxloc(abs(tsfc_out_roof-tsfc0_out_roof))
1728 ! dif_tsfc_iter=max(maxval(abs(tsfc_out_roof-tsfc0_out_roof)),dif_tsfc_iter)
1729 ! print *,'tsfc_wall abs. diff.:',maxval(abs(tsfc_out_wall-tsfc0_out_wall)),maxloc(abs(tsfc_out_wall-tsfc0_out_wall))
1730 ! dif_tsfc_iter=max(maxval(abs(tsfc0_out_wall-tsfc_out_wall)),dif_tsfc_iter)
1731
1732 ! tsfc0_out_surf = tsfc_out_surf
1733 ! tsfc0_out_roof = tsfc_out_roof
1734 ! tsfc0_out_wall = tsfc_out_wall
1735
1736 !==================Energy related to snow melting/freezing processes=======
1737 IF (diagnose == 1) WRITE (*, *) 'Calling MeltHeat'
1738
1739 !==========================Turbulent Fluxes================================
1740 IF (diagnose == 1) WRITE (*, *) 'Calling LUMPS_cal_QHQE...'
1741 IF (i_iter == 1) THEN
1742 !Calculate QH and QE from LUMPS in the first iteration of each time step
1743 CALL lumps_cal_qhqe( &
1744 veg_type, & !input
1745 snowuse, qn, qf, qs, temp_c, vegfraction, avcp, press_hpa, lv_j_kg, &
1746 tstep_real, drainrt, nsh_real, &
1747 precip, rainmaxres, raincover, sfr_surf, lai_id_next, laimax, laimin, &
1748 qh_lumps, & !output
1749 qe_lumps, psyc_hpa, s_hpa, sice_hpa, tempveg, vegphenlumps)
1750
1751 ! use LUMPS QH to do stability correction
1752 qh_init = qh_lumps
1753 ELSE
1754 ! use SUEWS QH to do stability correction
1755 qh_init = qh
1756 END IF
1757
1758 !============= calculate water balance =============
1759 CALL suews_cal_water( &
1760 diagnose, & !input
1761 snowuse, nonwaterfraction, addpipes, addimpervious, addveg, addwaterbody, &
1762 state_surf_prev, sfr_surf, storedrainprm_next, waterdist, nsh_real, &
1763 drain_per_tstep, & !output
1764 drain_surf, frac_water2runoff, &
1765 additionalwater, runoffpipes, runoff_per_interval, &
1766 addwater)
1767 !============= calculate water balance end =============
1768
1769 !===============Resistance Calculations=======================
1770 CALL suews_cal_resistance( &
1771 stabilitymethod, & !input:
1772 diagnose, aerodynamicresistancemethod, roughlenheatmethod, snowuse, &
1773 id, it, gsmodel, smdmethod, &
1774 avdens, avcp, qh_init, zzd, z0m, zdm, &
1775 avu1, temp_c, vegfraction, kdown, &
1776 kmax, &
1777 g_max, g_k, g_q_base, g_q_shape, &
1778 g_t, g_sm, s1, s2, &
1779 th, tl, &
1780 dq, xsmd, vsmd, maxconductance, laimax, lai_id_next, snowfrac_prev, sfr_surf, &
1781 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
1782 ustar, tstar, l_mod, & !output
1783 zl, gsc, rs, ra_h, rasnow, rb, z0v, z0vsnow)
1784
1785 !===================Resistance Calculations End=======================
1786
1787 !===================Calculate surface hydrology and related soil water=======================
1788 IF (snowuse == 1) THEN
1789
1790 ! ===================Calculate snow related hydrology=======================
1791 CALL suews_cal_snow( &
1792 diagnose, nlayer, & !input
1793 tstep, imin, it, evapmethod, dayofweek_id, crwmin, crwmax, &
1794 dectime, avdens, avcp, lv_j_kg, lvs_j_kg, avrh, press_hpa, temp_c, &
1795 rasnow, psyc_hpa, sice_hpa, tau_r, &
1796 radmeltfact, tempmeltfact, snowalbmax, preciplimit, preciplimitalb, &
1797 qn_ind_snow, kup_ind_snow, deltaqi, tsurf_ind_snow, &
1798 snowalb_next, &
1799 pervfraction, vegfraction, addimpervious, qn_snowfree, qf, qs, vpd_hpa, s_hpa, &
1800 rs, ra_h, rb, snowdensmax, snowdensmin, precip, pipecapacity, runofftowater, &
1801 addveg, snowlimpaved, snowlimbldg, &
1802 flowchange, drain_surf, wetthresh_surf, soilstorecap_surf, &
1803 tsurf_ind, sfr_surf, &
1804 addwater, frac_water2runoff, storedrainprm_next, snowpacklimit, snowprof_24hr, &
1805 snowpack_prev, snowfrac_prev, snowwater_prev, icefrac_prev, snowdens_prev, & ! input:
1806 snowfallcum_prev, state_surf_prev, soilstore_surf_prev, & ! input:
1807 qn_surf, qs_surf, &
1808 snowremoval, & ! snow specific output
1809 snowpack_next, snowfrac_next, snowwater_next, icefrac_next, snowdens_next, & ! output
1810 snowfallcum_next, state_surf_next, soilstore_surf_next, & ! general output:
1811 state_per_tstep, nwstate_per_tstep, &
1812 qe, qe_surf, qe_roof, qe_wall, &
1813 snowalb_next, &
1814 swe, chsnow_per_interval, ev_per_tstep, runoff_per_tstep, &
1815 surf_chang_per_tstep, runoffpipes, mwstore, runoffwaterbody, &
1816 runoffagveg, runoffagimpervious, rss_surf, &
1817 dataoutlinesnow)
1818 ! N.B.: snow-related calculations end here.
1819 !===================================================
1820 ELSE
1821 !======== Evaporation and surface state_id for snow-free conditions ========
1822 CALL suews_cal_qe( &
1823 diagnose, storageheatmethod, nlayer, & !input
1824 tstep, &
1825 evapmethod, &
1826 avdens, avcp, lv_j_kg, &
1827 psyc_hpa, &
1828 pervfraction, &
1829 addimpervious, &
1830 qf, vpd_hpa, s_hpa, rs, ra_h, rb, &
1831 precip, pipecapacity, runofftowater, &
1832 nonwaterfraction, wu_surf, addveg, addwaterbody, addwater, &
1833 flowchange, drain_surf, &
1834 frac_water2runoff, storedrainprm_next, &
1835 sfr_surf, statelimit_surf, soilstorecap_surf, wetthresh_surf, & ! input:
1836 state_surf_prev, soilstore_surf_prev, qn_surf, qs_surf, & ! input:
1837 sfr_roof, statelimit_roof, soilstorecap_roof, wetthresh_roof, & ! input:
1838 state_roof_prev, soilstore_roof_prev, qn_roof, qs_roof, & ! input:
1839 sfr_wall, statelimit_wall, soilstorecap_wall, wetthresh_wall, & ! input:
1840 state_wall_prev, soilstore_wall_prev, qn_wall, qs_wall, & ! input:
1841 state_surf_next, soilstore_surf_next, ev_surf, & ! general output:
1842 state_roof_next, soilstore_roof_next, ev_roof, & ! general output:
1843 state_wall_next, soilstore_wall_next, ev_wall, & ! general output:
1844 state_per_tstep, nwstate_per_tstep, &
1845 ev0_surf, qe0_surf, &
1846 qe, qe_surf, qe_roof, qe_wall, &
1847 ev_per_tstep, runoff_per_tstep, &
1848 surf_chang_per_tstep, runoffpipes, &
1849 runoffwaterbody, &
1850 runoffagveg, runoffagimpervious, rss_surf)
1851 !======== Evaporation and surface state_id end========
1852 END IF
1853 IF (diagnose == 1) print *, 'before SUEWS_cal_SoilState soilstore_id = ', soilstore_surf_next
1854
1855 !=== Horizontal movement between soil stores ===
1856 ! Now water is allowed to move horizontally between the soil stores
1857 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_HorizontalSoilWater...'
1858 CALL suews_cal_horizontalsoilwater( &
1859 sfr_surf, & ! input: ! surface fractions
1860 soilstorecap_surf, & !Capacity of soil store for each surface [mm]
1861 soildepth, & !Depth of sub-surface soil store for each surface [mm]
1862 sathydraulicconduct, & !Saturated hydraulic conductivity for each soil subsurface [mm s-1]
1863 surfacearea, & !Surface area of the study area [m2]
1864 nonwaterfraction, & ! sum of surface cover fractions for all except water surfaces
1865 tstep_real, & !tstep cast as a real for use in calculations
1866 soilstore_surf_next, & ! inout:!Soil moisture of each surface type [mm]
1867 runoffsoil, & !Soil runoff from each soil sub-surface [mm]
1868 runoffsoil_per_tstep & ! output:!Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
1869 )
1870
1871 !========== Calculate soil moisture ============
1872 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_SoilState...'
1873 CALL suews_cal_soilstate( &
1874 smdmethod, xsmd, nonwaterfraction, soilmoistcap, & !input
1875 soilstorecap_surf, surf_chang_per_tstep, &
1876 soilstore_surf_next, soilstore_surf_prev, sfr_surf, &
1877 smd, smd_nsurf, tot_chang_per_tstep, soilstate) !output
1878
1879 !============ Sensible heat flux ===============
1880 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_QH...'
1881 CALL suews_cal_qh( &
1882 1, nlayer, storageheatmethod, & !input
1883 qn, qf, qmrain, qe, qs, qmfreez, qm, avdens, avcp, &
1884 sfr_surf, sfr_roof, sfr_wall, &
1885 tsfc_out_surf, tsfc_out_roof, tsfc_out_wall, &
1886 temp_c, &
1887 ra_h, &
1888 qh, qh_residual, qh_resist, & !output
1889 qh_resist_surf, qh_resist_roof, qh_resist_wall)
1890 ! PRINT *, 'qn_surf after SUEWS_cal_QH', qn_surf
1891 ! PRINT *, 'qs_surf after SUEWS_cal_QH', qs_surf
1892 ! PRINT *, 'qe_surf after SUEWS_cal_QH', qe_surf
1893 ! PRINT *, 'qh_surf after SUEWS_cal_QH (resist)', qh_surf
1894 ! PRINT *, 'qh_roof after SUEWS_cal_QH (resist)', qh_roof
1895 ! PRINT *, 'qh_wall after SUEWS_cal_QH (resist)', qh_wall
1896 ! PRINT *, ''
1897
1898 ! PRINT *, 'tsfc_surf after SUEWS_cal_QH (resist)', tsfc_out_surf
1899 ! PRINT *, 'tsfc_roof after SUEWS_cal_QH (resist)', tsfc_out_roof
1900 ! PRINT *, 'tsfc_wall after SUEWS_cal_QH (resist)', tsfc_out_wall
1901 ! PRINT *, ''
1902 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
1903 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
1904 !============ Sensible heat flux end ===============
1905
1906 ! residual heat flux
1907 ! PRINT *, 'residual surf: ', qn_surf + qf - qs_surf - qe_surf - qh_surf
1908 ! PRINT *, 'residual roof: ', qn_roof + qf - qs_roof - qe_roof - qh_roof
1909 ! PRINT *, 'residual wall: ', qn_wall + qf - qs_wall - qe_wall - qh_wall
1910
1911 !============ Sensible heat flux end===============
1912
1913 !============ calculate surface temperature ===============
1914 tsfc_c = cal_tsfc(qh, avdens, avcp, ra_h, temp_c)
1915
1916 !============= calculate surface specific QH and Tsfc ===============
1917 ! note: tsfc has an upper limit of temp_c+50 to avoid numerical errors
1918 tsfc0_out_surf = min(tsfc_out_surf, temp_c + 50)
1919 tsfc0_out_roof = min(tsfc_out_roof, temp_c + 50)
1920 tsfc0_out_wall = min(tsfc_out_wall, temp_c + 50)
1921
1922 qh_surf = qn_surf + qf - qs_surf - qe_surf
1923 qh_roof = qn_roof + qf - qs_roof - qe_roof
1924 qh_wall = qn_wall + qf - qs_wall - qe_wall
1925
1926 IF (diagnose == 1) THEN
1927 print *, 'qn_surf before QH back env.:', qn_surf
1928 print *, 'qf before QH back env.:', qf
1929 print *, 'qs_surf before QH back env.:', qs_surf
1930 print *, 'qe_surf before QH back env.:', qe_surf
1931 print *, 'qh_surf before QH back env.:', qh_surf
1932
1933 print *, 'qn_roof before QH back env.:', qn_roof
1934 print *, 'qs_roof before QH back env.:', qs_roof
1935 print *, 'qe_roof before QH back env.:', qe_roof
1936 print *, 'qh_roof before QH back env.:', qh_roof
1937
1938 END IF
1939 DO i_surf = 1, nsurf
1940 ! TSfc_QH_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, RA_h, temp_c)
1941 tsfc_out_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, ra_h, temp_c)
1942 ! if ( i_surf==1 ) then
1943 ! tsfc_out_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, RA_h, temp_c)
1944 ! else
1945 ! tsfc_out_surf(i_surf)=tsfc0_out_surf(i_surf)
1946 ! end if
1947 ! restrict calculated heat storage to a sensible range
1948 ! tsfc_out_surf(i_surf) = MAX(MIN(tsfc_out_surf(i_surf), 100.0), -100.0)
1949 END DO
1950
1951 DO i_surf = 1, nlayer
1952 tsfc_out_roof(i_surf) = cal_tsfc(qh_roof(i_surf), avdens, avcp, ra_h, temp_c)
1953 tsfc_out_wall(i_surf) = cal_tsfc(qh_wall(i_surf), avdens, avcp, ra_h, temp_c)
1954 END DO
1955
1956 IF (diagnose == 1) print *, 'tsfc_surf after QH back env.:', tsfc_out_surf
1957 ! print *,'tsfc_roof after QH back env.:',tsfc_out_roof
1958 IF (diagnose == 1) print *, &
1959 'tsfc_surf abs. diff.:', maxval(abs(tsfc_out_surf - tsfc0_out_surf)), maxloc(abs(tsfc_out_surf - tsfc0_out_surf))
1960 dif_tsfc_iter = maxval(abs(tsfc_out_surf - tsfc0_out_surf))
1961 IF (storageheatmethod == 5) THEN
1962 IF (diagnose == 1) print *, &
1963 'tsfc_roof abs. diff.:', maxval(abs(tsfc_out_roof - tsfc0_out_roof)), maxloc(abs(tsfc_out_roof - tsfc0_out_roof))
1964 dif_tsfc_iter = max(maxval(abs(tsfc_out_roof - tsfc0_out_roof)), dif_tsfc_iter)
1965 IF (diagnose == 1) print *, &
1966 'tsfc_wall abs. diff.:', maxval(abs(tsfc_out_wall - tsfc0_out_wall)), maxloc(abs(tsfc_out_wall - tsfc0_out_wall))
1967 dif_tsfc_iter = max(maxval(abs(tsfc0_out_wall - tsfc_out_wall)), dif_tsfc_iter)
1968 END IF
1969
1970 ! ====test===
1971 ! see if this converges better
1972 ratio_iter = .4
1973 ! ratio_iter = .3
1974 tsfc_out_surf = (tsfc0_out_surf*(1 - ratio_iter) + tsfc_out_surf*ratio_iter)
1975 tsfc_out_roof = (tsfc0_out_roof*(1 - ratio_iter) + tsfc_out_roof*ratio_iter)
1976 tsfc_out_wall = (tsfc0_out_wall*(1 - ratio_iter) + tsfc_out_wall*ratio_iter)
1977 ! =======test end=======
1978
1979 ! PRINT *, 'tsfc_surf after qh_cal', TSfc_QH_surf
1980
1981 !============ surface-level diagonostics end ===============
1982
1983 ! force quit do-while, i.e., skip iteration and use NARP for Tsurf calculation
1984 ! if (NetRadiationMethod < 10 .or. NetRadiationMethod > 100) exit
1985
1986 ! Test if sensible heat fluxes converge in iterations
1987 ! if (abs(QH - QH_Init) > 0.1) then
1988 ! IF (ABS(Ts_iter - TSfc_C) > 0.1) THEN
1989 ! flag_converge = .FALSE.
1990 ! ELSE
1991 ! flag_converge = .TRUE.
1992 ! PRINT *, 'Iteration done in', i_iter, ' iterations'
1993 ! PRINT *, ' Ts_iter: ', Ts_iter, ' TSfc_C: ', TSfc_C
1994 ! END IF
1995 ! IF (MINVAL(ABS(TSfc_QH_surf - tsfc_surf)) > 0.1) THEN
1996 ! IF (ABS(qh_residual - qh_resist) > .2) THEN
1997 IF (dif_tsfc_iter > .1) THEN
1998 flag_converge = .false.
1999 ELSE
2000 flag_converge = .true.
2001 ! PRINT *, 'Iteration done in', i_iter, ' iterations'
2002 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
2003 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
2004 ! PRINT *, ' abs. dif_tsfc: ', dif_tsfc_iter
2005
2006 END IF
2007
2008 i_iter = i_iter + 1
2009 ! force quit do-while loop if not convergent after 100 iterations
2010 IF (diagnose == 1 .AND. i_iter == max_iter) THEN
2011 ! PRINT *, 'Iteration did not converge in', i_iter, ' iterations'
2012 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
2013 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
2014 ! PRINT *, ' Ts_iter: ', Ts_iter, ' TSfc_C: ', TSfc_C
2015 ! PRINT *, ' abs. dif_tsfc: ', dif_tsfc_iter
2016 ! exit
2017 END IF
2018
2019 ! Ts_iter = TSfc_C
2020 ! l_mod_iter = l_mod
2021 ! PRINT *, '========================='
2022 ! PRINT *, ''
2023 !==============main calculation end=======================
2024 END DO ! end iteration for tsurf calculations
2025
2026 !==============================================================
2027 ! Calculate diagnostics: these variables are decoupled from the main SUEWS calculation
2028
2029 !============ roughness sub-layer diagonostics ===============
2030 IF (diagnose == 1) WRITE (*, *) 'Calling RSLProfile...'
2031 CALL rslprofile( &
2032 diagmethod, &
2033 zh, z0m, zdm, z0v, &
2034 l_mod, sfr_surf, fai, pai, &
2035 stabilitymethod, ra_h, &
2036 avcp, lv_j_kg, avdens, &
2037 avu1, temp_c, avrh, press_hpa, z, qh, qe, & ! input
2038 t2_c, q2_gkg, u10_ms, rh2, & !output
2039 dataoutlinersl) ! output
2040
2041 ! ============ BIOGENIC CO2 FLUX =======================
2042 CALL suews_cal_biogenco2( &
2043 alpha_bioco2, alpha_enh_bioco2, kdown, avrh, beta_bioco2, beta_enh_bioco2, & ! input:
2044 dectime, diagnose, emissionsmethod, fc_anthro, g_max, g_k, g_q_base, g_q_shape, &
2045 g_t, g_sm, gfunc, gsmodel, id, it, kmax, lai_id_next, laimin, &
2046 laimax, maxconductance, min_res_bioco2, press_hpa, resp_a, &
2047 resp_b, s1, s2, sfr_surf, smdmethod, snowfrac, t2_c, temp_c, theta_bioco2, th, tl, vsmd, xsmd, &
2048 fc, fc_biogen, fc_photo, fc_respi) ! output:
2049
2050 ! calculations of diagnostics end
2051 !==============================================================
2052
2053 !==============================================================
2054 ! update inout variables with new values
2055 qn_av = qn_av_next
2056 dqndt = dqndt_next
2057 qn_s_av = qn_s_av_next
2058 dqnsdt = dqnsdt_next
2059 snowfallcum = snowfallcum_next
2060 snowalb = snowalb_next
2061 icefrac = icefrac_next
2062 snowwater = snowwater_next
2063 snowdens = snowdens_next
2064 snowfrac = snowfrac_next
2065 snowpack = snowpack_next
2066
2067 soilstore_surf = soilstore_surf_next
2068 state_surf = state_surf_next
2069 alb = alb_next
2070 gdd_id = gdd_id_next
2071 sdd_id = sdd_id_next
2072 lai_id = lai_id_next
2073 decidcap_id = decidcap_id_next
2074 albdectr_id = albdectr_id_next
2075 albevetr_id = albevetr_id_next
2076 albgrass_id = albgrass_id_next
2077 porosity_id = porosity_id_next
2078 storedrainprm = storedrainprm_next
2079 tair_av = tair_av_next
2080 tmin_id = tmin_id_next
2081 tmax_id = tmax_id_next
2082 lenday_id = lenday_id_next
2083 hdd_id = hdd_id_next
2084 wuday_id = wuday_id_next
2085
2086 IF (storageheatmethod == 5) THEN
2087 ! ESTM_ehc related
2088 temp_roof = temp_out_roof
2089 temp_wall = temp_out_wall
2090 temp_surf = temp_out_surf
2091 tsfc_roof = tsfc_out_roof
2092 tsfc_wall = tsfc_out_wall
2093 tsfc_surf = tsfc_out_surf
2094
2095 soilstore_roof = soilstore_roof_next
2096 state_roof = state_roof_next
2097 soilstore_wall = soilstore_wall_next
2098 state_wall = state_wall_next
2099 END IF
2100
2101 !==============use SOLWEIG to get localised radiation flux==================
2102 ! if (sfr_surf(BldgSurf) > 0) then
2103 ! CALL SOLWEIG_cal_main(id, it, dectime, 0.8d0, FAI, avkdn, ldown, Temp_C, avRh, Press_hPa, TSfc_C, &
2104 ! lat, ZENITH_deg, azimuth, 1.d0, alb(1), alb(2), emis(1), emis(2), bldgH, dataOutLineSOLWEIG)
2105 ! else
2106 ! dataOutLineSOLWEIG = set_nan(dataOutLineSOLWEIG)
2107 ! endif
2108
2109 !==============use BEERS to get localised radiation flux==================
2110 ! TS 14 Jan 2021: BEERS is a modified version of SOLWEIG
2111 IF (sfr_surf(bldgsurf) > 0) THEN
2112 pai = sfr_surf(2)/sum(sfr_surf(1:2))
2113 CALL beers_cal_main(iy, id, dectime, pai, fai, kdown, ldown, temp_c, avrh, &
2114 press_hpa, tsfc_c, lat, lng, alt, timezone, zenith_deg, azimuth, &
2115 alb(1), alb(2), emis(1), emis(2), &
2116 dataoutlinebeers) ! output
2117 ! CALL SOLWEIG_cal_main(id, it, dectime, 0.8d0, FAI, avkdn, ldown, Temp_C, avRh, Press_hPa, TSfc_C, &
2118 ! lat, ZENITH_deg, azimuth, 1.d0, alb(1), alb(2), emis(1), emis(2), bldgH, dataOutLineSOLWEIG)
2119 ELSE
2120 dataoutlinebeers = set_nan(dataoutlinebeers)
2121 END IF
2122
2123 !==============translation of output variables into output array===========
2124 CALL suews_update_outputline( &
2125 additionalwater, alb, kdown, u10_ms, azimuth, & !input
2126 chsnow_per_interval, dectime, &
2127 drain_per_tstep, qe_lumps, ev_per_tstep, wu_ext, fc, fc_build, fcld, &
2128 fc_metab, fc_photo, fc_respi, fc_point, fc_traff, flowchange, &
2129 qh_lumps, id, imin, wu_int, it, iy, &
2130 kup, lai_id, ldown, l_mod, lup, mwh, &
2131 mwstore, &
2132 nsh_real, nwstate_per_tstep, precip, q2_gkg, &
2133 qe, qf, qh, qh_resist, qm, qmfreez, &
2134 qmrain, qn, qn_snow, qn_snowfree, qs, ra_h, &
2135 rs, rh2, runoffagimpervious, runoffagveg, &
2136 runoff_per_tstep, runoffpipes, runoffsoil_per_tstep, &
2137 runoffwaterbody, sfr_surf, smd, smd_nsurf, snowalb, snowremoval, &
2138 state_surf_next, state_per_tstep, surf_chang_per_tstep, swe, t2_c, tsfc_c, &
2139 tot_chang_per_tstep, tsurf, ustar, &
2140 wu_surf, &
2141 z0m, zdm, zenith_deg, &
2142 datetimeline, dataoutlinesuews) !output
2143
2144 CALL ehc_update_outputline( &
2145 iy, id, it, imin, dectime, nlayer, & !input
2146 tsfc_out_surf, qs_surf, &
2147 tsfc_out_roof, &
2148 qn_roof, &
2149 qs_roof, &
2150 qe_roof, &
2151 qh_roof, &
2152 state_roof, &
2153 soilstore_roof, &
2154 tsfc_out_wall, &
2155 qn_wall, &
2156 qs_wall, &
2157 qe_wall, &
2158 qh_wall, &
2159 state_wall, &
2160 soilstore_wall, &
2161 datetimeline, dataoutlineehc) !output
2162
2163 ! daily state_id:
2164 CALL update_dailystateline( &
2165 it, imin, nsh_real, & !input
2166 gdd_id, hdd_id, lai_id, &
2167 sdd_id, &
2168 tmin_id, tmax_id, lenday_id, &
2169 decidcap_id, &
2170 albdectr_id, &
2171 albevetr_id, &
2172 albgrass_id, &
2173 porosity_id, &
2174 wuday_id, &
2175 vegphenlumps, &
2176 snowalb, snowdens, &
2177 a1, a2, a3, &
2178 dataoutlinedailystate) !out
2179
2180 !==============translation end ================
2181
2182 dataoutlinedebug = &
2183 [tsfc0_out_surf, &
2184 qn_surf, qs_surf, qe0_surf, qe_surf, qh_surf, & ! energy balance
2185 wu_surf, ev0_surf, ev_surf, drain_surf, state_surf_prev, state_surf_next, soilstore_surf_prev, soilstore_surf_next, & ! water balance
2186 rs, ra_h, rb, rasnow, rss_surf, & ! for debugging QE
2187 vsmd, s1/g_sm + s2, g_sm, g_sm*(vsmd - s1/g_sm + s2), & ! debug g_smd
2188 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! for debugging RS: surface resistance
2189 vpd_hpa, lv_j_kg, avdens, avcp, s_hpa, psyc_hpa, & ! for debugging QE
2190 i_iter*1d0, &
2191 faibldg_use, faievetree_use, faidectree_use, fai, &
2192 dqndt]
2193
2194 !==============output==========================
2195 CALL output_line_init(output_line_suews)
2196 output_line_suews%datetimeLine = datetimeline
2197 output_line_suews%dataOutLineSUEWS = [datetimeline, dataoutlinesuews]
2198 output_line_suews%dataOutLineEHC = [datetimeline, dataoutlineehc]
2199 output_line_suews%dataOutLineDailyState = [datetimeline, dataoutlinedailystate]
2200 output_line_suews%dataOutLineBEERS = [datetimeline, dataoutlinebeers]
2201 output_line_suews%dataOutLineDebug = [datetimeline, dataoutlinedebug]
2202 output_line_suews%dataOutLineSPARTACUS = [datetimeline, dataoutlinespartacus]
2203 output_line_suews%dataOutLineSnow = [datetimeline, dataoutlinesnow]
2204 output_line_suews%dataoutLineRSL = [datetimeline, dataoutlinersl]
2205 output_line_suews%dataOutLineESTM = [datetimeline, dataoutlineestm]
2206
subroutine suews_cal_dectime(id, it, imin, isec, dectime)
subroutine suews_cal_weekday(iy, id, lat, dayofweek_id)
subroutine suews_cal_dls(id, startdls, enddls, dls)
subroutine suews_cal_tstep(tstep, nsh, nsh_real, tstep_real)

References moist::avcp, moist::avdens, beers_module::beers_cal_main(), allocatearray::bldgsurf, atmmoiststab_module::cal_atmmoist(), cal_tair_av(), cal_tsfc(), ehc_update_outputline(), lumps_module::lumps_cal_qhqe(), moist::lv_j_kg, narp_module::narp_cal_sunposition(), allocatearray::nsurf, output_line_init(), rsl_module::rslprofile(), set_nan(), suews_cal_anthropogenicemission(), suews_cal_biogenco2(), dailystate_module::suews_cal_dailystate(), beers_module::suews_cal_dectime(), beers_module::suews_cal_dls(), waterdist_module::suews_cal_horizontalsoilwater(), suews_cal_qe(), suews_cal_qh(), suews_cal_qn(), suews_cal_qs(), suews_cal_resistance(), resist_module::suews_cal_roughnessparameters(), suews_cal_snow(), waterdist_module::suews_cal_soilstate(), suews_cal_surf(), beers_module::suews_cal_tstep(), suews_cal_water(), waterdist_module::suews_cal_wateruse(), beers_module::suews_cal_weekday(), suews_update_outputline(), waterdist_module::suews_update_soilmoist(), and dailystate_module::update_dailystateline().

Referenced by sumin_module::sumin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_main_dts()

subroutine suews_driver::suews_cal_main_dts ( real(kind(1d0)), dimension(2), intent(in) ah_min,
real(kind(1d0)), dimension(0:23, 2), intent(in) ahprof_24hr,
real(kind(1d0)), dimension(2), intent(in) ah_slope_cooling,
real(kind(1d0)), dimension(2), intent(in) ah_slope_heating,
real(kind(1d0)), dimension(nsurf), intent(inout) alb,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_enh_bioco2,
real(kind(1d0)), intent(in) alt,
real(kind(1d0)), intent(in) kdown,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_enh_bioco2,
real(kind(1d0)), intent(in) bldgh,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), dimension(nsurf), intent(in) chanohm,
real(kind(1d0)), intent(in) co2pointsource,
real(kind(1d0)), dimension(nsurf), intent(in) cpanohm,
real(kind(1d0)), intent(in) crwmax,
real(kind(1d0)), intent(in) crwmin,
real(kind(1d0)), dimension(7), intent(in) daywat,
real(kind(1d0)), dimension(7), intent(in) daywatper,
real(kind(1d0)), intent(in) dectreeh,
integer, intent(in) diagmethod,
integer, intent(in) diagnose,
real(kind(1d0)), intent(in) drainrt,
integer, intent(in) dt_since_start,
real(kind(1d0)), intent(inout) dqndt,
real(kind(1d0)), intent(inout) qn_av,
real(kind(1d0)), intent(inout) dqnsdt,
real(kind(1d0)), intent(inout) qn_s_av,
real(kind(1d0)), intent(in) ef_umolco2perj,
real(kind(1d0)), dimension(nsurf), intent(in) emis,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) enef_v_jkm,
integer, intent(in) enddls,
real(kind(1d0)), intent(in) evetreeh,
real(kind(1d0)), intent(in) faibldg,
real(kind(1d0)), intent(in) faidectree,
real(kind(1d0)), intent(in) faievetree,
integer, intent(in) faimethod,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), dimension(2), intent(in) fcef_v_kgkm,
real(kind(1d0)), intent(in) fcld_obs,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), intent(in) frfossilfuel_heat,
real(kind(1d0)), intent(in) frfossilfuel_nonheat,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), dimension(nvegsurf), intent(inout) gdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
integer, intent(in) gridiv,
integer, intent(in) gsmodel,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(12), intent(inout) hdd_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) humactivity_24hr,
real(kind(1d0)), dimension(nsurf), intent(inout) icefrac,
integer, intent(in) id,
real(kind(1d0)), dimension(3), intent(in) ie_a,
integer, intent(in) ie_end,
real(kind(1d0)), dimension(3), intent(in) ie_m,
integer, intent(in) ie_start,
integer, intent(in) imin,
real(kind(1d0)), intent(in) internalwateruse_h,
real(kind(1d0)), intent(in) irrfracpaved,
real(kind(1d0)), intent(in) irrfracbldgs,
real(kind(1d0)), intent(in) irrfracevetr,
real(kind(1d0)), intent(in) irrfracdectr,
real(kind(1d0)), intent(in) irrfracgrass,
real(kind(1d0)), intent(in) irrfracbsoil,
real(kind(1d0)), intent(in) irrfracwater,
integer, intent(in) isec,
integer, intent(in) it,
integer, intent(in) iy,
real(kind(1d0)), dimension(nsurf), intent(in) kkanohm,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), dimension(nvegsurf), intent(inout) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), intent(in) lai_obs,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
integer, dimension(nvegsurf), intent(in) laitype,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(inout) lenday_id,
real(kind(1d0)), intent(in) ldown_obs,
real(kind(1d0)), intent(in) lng,
real(kind(1d0)), dimension(3), intent(in) maxconductance,
real(kind(1d0)), intent(in) maxfcmetab,
real(kind(1d0)), intent(in) maxqfmetab,
real(kind(1d0)), dimension(nsurf), intent(inout) snowwater,
real(kind(1d0)), intent(in) minfcmetab,
real(kind(1d0)), intent(in) minqfmetab,
real(kind(1d0)), dimension(nvegsurf), intent(in) min_res_bioco2,
real(kind(1d0)), intent(in) narp_emis_snow,
real(kind(1d0)), intent(in) narp_trans_site,
integer, intent(in) netradiationmethod,
integer, intent(in) nlayer,
integer, intent(in) n_vegetation_region_urban,
integer, intent(in) n_stream_sw_urban,
integer, intent(in) n_stream_lw_urban,
real(kind(1d0)), intent(in) sw_dn_direct_frac,
real(kind(1d0)), intent(in) air_ext_sw,
real(kind(1d0)), intent(in) air_ssa_sw,
real(kind(1d0)), intent(in) veg_ssa_sw,
real(kind(1d0)), intent(in) air_ext_lw,
real(kind(1d0)), intent(in) air_ssa_lw,
real(kind(1d0)), intent(in) veg_ssa_lw,
real(kind(1d0)), intent(in) veg_fsd_const,
real(kind(1d0)), intent(in) veg_contact_fraction_const,
real(kind(1d0)), intent(in) ground_albedo_dir_mult_fact,
logical, intent(in) use_sw_direct_albedo,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) veg_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer), intent(in) veg_scale,
real(kind(1d0)), dimension(nlayer), intent(in) alb_roof,
real(kind(1d0)), dimension(nlayer), intent(in) emis_roof,
real(kind(1d0)), dimension(nlayer), intent(in) alb_wall,
real(kind(1d0)), dimension(nlayer), intent(in) emis_wall,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) roof_albedo_dir_mult_fact,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) wall_specular_frac,
real(kind(1d0)), dimension(nsurf + 1, 4, 3), intent(in) ohm_coef,
integer, intent(in) ohmincqf,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshsw,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshwd,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), dimension(2), intent(in) popdensdaytime,
real(kind(1d0)), intent(in) popdensnighttime,
real(kind(1d0)), dimension(0:23, 2), intent(in) popprof_24hr,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) preciplimit,
real(kind(1d0)), intent(in) preciplimitalb,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), dimension(2), intent(in) qf0_beu,
real(kind(1d0)), dimension(2), intent(in) qf_a,
real(kind(1d0)), dimension(2), intent(in) qf_b,
real(kind(1d0)), dimension(2), intent(in) qf_c,
real(kind(1d0)), intent(in) qn1_obs,
real(kind(1d0)), intent(in) qs_obs,
real(kind(1d0)), intent(in) qf_obs,
real(kind(1d0)), intent(in) radmeltfact,
real(kind(1d0)), intent(in) raincover,
real(kind(1d0)), intent(in) rainmaxres,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_a,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_b,
integer, intent(in) roughlenheatmethod,
integer, intent(in) roughlenmommethod,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), dimension(nsurf), intent(in) sathydraulicconduct,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), dimension(nvegsurf), intent(inout) sdd_id,
integer, intent(in) smdmethod,
real(kind(1d0)), intent(inout) snowalb,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) snowalbmin,
real(kind(1d0)), dimension(nsurf), intent(in) snowpacklimit,
real(kind(1d0)), dimension(nsurf), intent(inout) snowdens,
real(kind(1d0)), intent(in) snowdensmax,
real(kind(1d0)), intent(in) snowdensmin,
real(kind(1d0)), intent(inout) snowfallcum,
real(kind(1d0)), dimension(nsurf), intent(inout) snowfrac,
real(kind(1d0)), intent(in) snowlimbldg,
real(kind(1d0)), intent(in) snowlimpaved,
real(kind(1d0)), intent(in) snowfrac_obs,
real(kind(1d0)), dimension(nsurf), intent(inout) snowpack,
real(kind(1d0)), dimension(0:23, 2), intent(in) snowprof_24hr,
integer, intent(in) snowuse,
real(kind(1d0)), dimension(nsurf), intent(in) soildepth,
integer, intent(in) stabilitymethod,
integer, intent(in) startdls,
real(kind(1d0)), dimension(nsurf), intent(inout) soilstore_surf,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap_surf,
real(kind(1d0)), dimension(nsurf), intent(inout) state_surf,
real(kind(1d0)), dimension(nsurf), intent(in) statelimit_surf,
real(kind(1d0)), dimension(nsurf), intent(in) wetthresh_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) state_roof,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_roof,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_wall,
real(kind(1d0)), dimension(nlayer), intent(inout) state_wall,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_wall,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_wall,
integer, intent(in) storageheatmethod,
real(kind(1d0)), dimension(6, nsurf), intent(inout) storedrainprm,
real(kind(1d0)), intent(in) surfacearea,
real(kind(1d0)), intent(inout) tair_av,
real(kind(1d0)), intent(in) tau_a,
real(kind(1d0)), intent(in) tau_f,
real(kind(1d0)), intent(in) tau_r,
real(kind(1d0)), intent(inout) tmax_id,
real(kind(1d0)), intent(inout) tmin_id,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) tempmeltfact,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), dimension(nvegsurf), intent(in) theta_bioco2,
real(kind(1d0)), intent(in) timezone,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), dimension(2), intent(in) trafficrate,
real(kind(1d0)), intent(in) trafficunits,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_wall,
real(kind(1d0)), dimension(nsurf), intent(inout) tsfc_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(inout) temp_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tin_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tin_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tin_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) k_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) cp_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) dz_surf,
real(kind(1d0)), dimension(0:23, 2), intent(in) traffprof_24hr,
real(kind(1d0)), dimension(:), intent(in) ts5mindata_ir,
integer, intent(in) tstep,
integer, intent(in) tstep_prev,
integer, intent(in) veg_type,
real(kind(1d0)), dimension(nsurf + 1, nsurf - 1), intent(in) waterdist,
integer, intent(in) waterusemethod,
real(kind(1d0)), intent(in) wu_m3,
real(kind(1d0)), dimension(9), intent(inout) wuday_id,
real(kind(1d0)), intent(inout) decidcap_id,
real(kind(1d0)), intent(inout) albdectr_id,
real(kind(1d0)), intent(inout) albevetr_id,
real(kind(1d0)), intent(inout) albgrass_id,
real(kind(1d0)), intent(inout) porosity_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofa_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofm_24hr,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(in) z,
real(kind(1d0)), intent(in) z0m_in,
real(kind(1d0)), intent(in) zdm_in,
type(output_line), intent(out) output_line_suews )

Definition at line 2209 of file suews_ctrl_driver.f95.

2273
2274 ! nlayer, &
2275 ! Ts5mindata_ir, ! for coupling with external models
2276 ! output_line_suews
2277
2278 ! ---output related variables
2279 ! datetimeLine, dataOutLineSUEWS, dataOutLineSnow, dataOutLineESTM, dataoutLineRSL, & !output
2280 ! dataOutLineBEERS, & !output
2281 ! dataOutLineDebug, dataOutLineSPARTACUS, &
2282 ! dataOutLineEHC, &
2283 ! dataOutLineDailyState) !output
2284
2285 IMPLICIT NONE
2286
2287 ! input variables
2288 REAL(KIND(1D0)), DIMENSION(:), INTENT(IN) :: Ts5mindata_ir !surface temperature input data[degC]
2289 REAL(KIND(1D0)), DIMENSION(10) :: MetForcingData_grid ! met forcing array of grid
2290
2291 INTEGER, INTENT(IN) :: nlayer ! number of vertical layers in urban canyon [-]
2292
2293 ! ---siteInfo-related variables
2294 TYPE(SITE_PRM) :: siteInfo
2295 REAL(KIND(1D0)), INTENT(IN) :: lat !latitude [deg]
2296 REAL(KIND(1D0)), INTENT(IN) :: lng !longitude [deg]
2297 REAL(KIND(1D0)), INTENT(IN) :: alt !solar altitude [deg]
2298 INTEGER, INTENT(IN) :: Gridiv ! grid id [-]
2299 REAL(KIND(1D0)), INTENT(IN) :: timezone !time zone, for site relative to UTC (east is positive) [h]
2300 REAL(KIND(1D0)), INTENT(IN) :: SurfaceArea !area of the grid [ha]
2301 REAL(KIND(1D0)), INTENT(IN) :: Z ! measurement height [m]
2302 REAL(KIND(1D0)), INTENT(IN) :: z0m_in !roughness length for momentum [m]
2303 REAL(KIND(1D0)), INTENT(IN) :: zdm_in !zero-plane displacement [m]
2304 REAL(KIND(1D0)), INTENT(IN) :: PipeCapacity !capacity of pipes to transfer water [mm]
2305 REAL(KIND(1D0)), INTENT(IN) :: RunoffToWater !fraction of above-ground runoff flowing to water surface during flooding [-]
2306 REAL(KIND(1D0)), INTENT(IN) :: NARP_TRANS_SITE !atmospheric transmissivity for NARP [-]
2307 REAL(KIND(1D0)), INTENT(IN) :: CO2PointSource ! point source [kgC day-1]
2308 REAL(KIND(1D0)), INTENT(IN) :: FlowChange !Difference between the input and output flow in the water body [mm]
2309
2310 ! ---forcing-related variables
2311 TYPE(SUEWS_FORCING) :: forcing
2312 REAL(KIND(1D0)), INTENT(IN) :: kdown !incominging shortwave radiation [W m-2]
2313 REAL(KIND(1D0)), INTENT(IN) :: ldown_obs !observed incoming longwave radiation [W m-2]
2314 REAL(KIND(1D0)), INTENT(IN) :: avRh !relative humidity [-]
2315 REAL(KIND(1D0)), INTENT(IN) :: Press_hPa !air pressure [hPa]
2316 REAL(KIND(1D0)), INTENT(IN) :: avU1 !average wind speed at 1m [W m-1]
2317 REAL(KIND(1D0)), INTENT(IN) :: Precip !rain data [mm]
2318 REAL(KIND(1D0)), INTENT(IN) :: fcld_obs !observed could fraction [-]
2319 REAL(KIND(1D0)), INTENT(IN) :: LAI_obs !observed LAI [m2 m-2]
2320 REAL(KIND(1D0)), INTENT(IN) :: snowFrac_obs !observed snow fraction [-]
2321 REAL(KIND(1D0)), INTENT(IN) :: xsmd ! observed soil moisture; can be provided either as volumetric ([m3 m-3] when SMDMethod = 1) or gravimetric quantity ([kg kg-1] when SMDMethod = 2
2322 REAL(KIND(1D0)), INTENT(IN) :: qn1_obs !observed net all-wave radiation [W m-2]
2323 REAL(KIND(1D0)), INTENT(IN) :: qs_obs !observed heat storage flux [W m-2]
2324 REAL(KIND(1D0)), INTENT(IN) :: qf_obs !observed anthropogenic heat flux [W m-2]
2325 REAL(KIND(1D0)), INTENT(IN) :: Temp_C !air temperature [degC]
2326 REAL(KIND(1D0)), INTENT(IN) :: wu_m3
2327 ! ESTM related:
2328 REAL(KIND(1D0)), INTENT(INOUT) :: Tair_av !average air temperature [degC]
2329
2330 ! ---timer-related variables
2331 TYPE(SUEWS_TIMER) :: timer
2332 INTEGER, INTENT(IN) :: id ! day of year, 1-366 [-]
2333 INTEGER, INTENT(IN) :: imin !minutes, 0-59 [min]
2334 INTEGER, INTENT(IN) :: isec ! seconds, 0-59 [s]
2335 INTEGER, INTENT(IN) :: it ! hour, 0-23 [h]
2336 INTEGER, INTENT(IN) :: iy ! year [y]
2337 INTEGER, INTENT(IN) :: tstep !timestep [s]
2338 INTEGER, INTENT(IN) :: tstep_prev ! tstep size of the previous step [s]
2339 INTEGER, INTENT(in) :: dt_since_start ! time since simulation starts [s]
2340
2341 ! ---method-related variables
2342 TYPE(METHOD_PRM) :: methodPrm
2343 INTEGER, INTENT(IN) :: Diagnose ! flag for printing diagnostic info during runtime [N/A]C
2344 INTEGER, INTENT(in) :: DiagMethod !Defines how near surface diagnostics are calculated
2345 INTEGER, INTENT(IN) :: EmissionsMethod !method to calculate anthropogenic heat [-]
2346 INTEGER, INTENT(IN) :: RoughLenHeatMethod ! method to calculate heat roughness length [-]
2347 INTEGER, INTENT(IN) :: RoughLenMomMethod ! Determines how aerodynamic roughness length (z0m) and zero displacement height (zdm) are calculated [-]
2348 INTEGER, INTENT(IN) :: FAIMethod !Determines how FAI is calculated [-]
2349 INTEGER, INTENT(IN) :: SMDMethod ! Determines method for calculating soil moisture deficit [-]
2350 INTEGER, INTENT(IN) :: WaterUseMethod !Defines how external water use is calculated[-]
2351 INTEGER, INTENT(IN) :: NetRadiationMethod ! method for calculation of radiation fluxes [-]
2352 INTEGER, INTENT(IN) :: StabilityMethod !method to calculate atmospheric stability [-]
2353 INTEGER, INTENT(IN) :: StorageHeatMethod
2354 INTEGER, INTENT(IN) :: SnowUse ! Determines whether the snow part of the model runs[-]
2355 LOGICAL, INTENT(IN) :: use_sw_direct_albedo !boolean, Specify ground and roof albedos separately for direct solar radiation [-]
2356 INTEGER, INTENT(IN) :: OHMIncQF ! Determines whether the storage heat flux calculation uses Q* or ( Q* +QF) [-]
2357
2358 ! ---lumps-related variables
2359 TYPE(LUMPS_PRM) :: lumpsPrm
2360 REAL(KIND(1D0)), INTENT(IN) :: RAINCOVER !limit when surface totally covered with water for LUMPS [mm]
2361 REAL(KIND(1D0)), INTENT(IN) :: RainMaxRes !maximum water bucket reservoir. Used for LUMPS surface wetness control. [mm]
2362 REAL(KIND(1D0)), INTENT(IN) :: DRAINRT !Drainage rate of the water bucket [mm hr-1]
2363 INTEGER, INTENT(IN) :: veg_type !Defines how vegetation is calculated for LUMPS [-]
2364
2365 ! ---ehc-related variables
2366 TYPE(EHC_PRM) :: ehcPrm
2367 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_roof !Capacity of soil store for roof [mm]
2368 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_roof !Limit for state_id of roof [mm]
2369 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_roof ! wetness threshold of roof[mm]
2370 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_wall !Capacity of soil store for wall [mm]
2371 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_wall !Limit for state_id of wall [mm]
2372 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_wall ! wetness threshold of wall[mm]
2373 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_roof ! indoor temperature for roof [degC]
2374 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_roof ! thermal conductivity of roof [W m-1 K]
2375 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_roof ! Heat capacity of roof [J m-3 K-1]
2376 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_roof ! thickness of each layer in roof [m]
2377 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_wall ! indoor temperature for wall [degC]
2378 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_wall ! thermal conductivity of wall [W m-1 K]
2379 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_wall ! Heat capacity of wall [J m-3 K-1]
2380 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_wall ! thickness of each layer in wall [m]
2381 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tin_surf !deep bottom temperature for each surface [degC]
2382 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: k_surf ! thermal conductivity of v [W m-1 K]
2383 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: cp_surf ! Heat capacity of each surface [J m-3 K-1]
2384 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: dz_surf ! thickness of each layer in each surface [m]
2385
2386 ! ---spartacus-related variables
2387 TYPE(SPARTACUS_PRM) :: spartacusPrm
2388 REAL(KIND(1D0)), INTENT(IN) :: air_ext_lw
2389 REAL(KIND(1D0)), INTENT(IN) :: air_ext_sw
2390 REAL(KIND(1D0)), INTENT(IN) :: air_ssa_lw
2391 REAL(KIND(1D0)), INTENT(IN) :: air_ssa_sw
2392 REAL(KIND(1D0)), INTENT(IN) :: veg_ssa_lw
2393 REAL(KIND(1D0)), INTENT(IN) :: veg_ssa_sw
2394 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height ! height in spartacus [m]
2395 REAL(KIND(1D0)), INTENT(IN) :: ground_albedo_dir_mult_fact
2396 INTEGER, INTENT(IN) :: n_stream_lw_urban ! LW streams per hemisphere [-]
2397 INTEGER, INTENT(IN) :: n_stream_sw_urban ! shortwave diffuse streams per hemisphere [-]
2398 INTEGER, INTENT(IN) :: n_vegetation_region_urban !Number of regions used to describe vegetation [-]
2399 REAL(KIND(1D0)), INTENT(IN) :: sw_dn_direct_frac
2400 REAL(KIND(1D0)), INTENT(IN) :: veg_contact_fraction_const
2401 REAL(KIND(1D0)), INTENT(IN) :: veg_fsd_const
2402
2403 ! ---spartacusLayer-related variables
2404 TYPE(SPARTACUS_LAYER_PRM) :: spartacusLayerPrm
2405 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac !building fraction [-]
2406 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale ! diameter of buildings [[m]
2407 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_frac !vegetation fraction [-]
2408 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_scale ! scale of tree crowns [m]
2409 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_roof !albedo of roof [-]
2410 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_roof ! emissivity of roof [-]
2411 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_wall !albedo of wall [-]
2412 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_wall ! emissivity of wall [-]
2413 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: roof_albedo_dir_mult_fact !Ratio of the direct and diffuse albedo of the roof[-]
2414 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: wall_specular_frac ! Fraction of wall reflection that is specular [-]
2415
2416 ! ---anthropogenic heat-related variables
2417 TYPE(anthroEMIS_PRM) :: ahemisPrm
2418 INTEGER, INTENT(IN) :: startDLS !start of daylight saving [DOY]
2419 INTEGER, INTENT(IN) :: endDLS !end of daylight saving [DOY]
2420 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: QF0_BEU ! Fraction of base value coming from buildings [-]
2421 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_A ! Base value for QF [W m-2]
2422 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_B ! Parameter related to heating degree days [W m-2 K-1 (Cap ha-1 )-1]
2423 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_C ! Parameter related to cooling degree days [W m-2 K-1 (Cap ha-1 )-1]
2424 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling ! base temperature for cooling degree day [degC]
2425 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating ! base temperatrue for heating degree day [degC]
2426 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: PopDensDaytime ! Daytime population density [people ha-1] (i.e. workers)
2427 REAL(KIND(1D0)), INTENT(IN) :: PopDensNighttime ! nighttime population density (i.e. residents) [ha-1]
2428 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: PopProf_24hr !Hourly profile values used in dynamic population estimation[-]
2429 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_MIN !minimum QF values [W m-2]
2430 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: AHProf_24hr !Hourly profile values used in energy use calculation [-]
2431 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Cooling ! cooling slope for the anthropogenic heat flux calculation [W m-2 K-1]
2432 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Heating ! heating slope for the anthropogenic heat flux calculation [W m-2 K-1]
2433 REAL(KIND(1D0)), INTENT(IN) :: EF_umolCO2perJ !co2 emission factor [umol J-1]
2434 REAL(KIND(1D0)), INTENT(IN) :: EnEF_v_Jkm ! energy emission factor [J K m-1]
2435 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_Heat ! fraction of fossil fuel heat [-]
2436 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_NonHeat ! fraction of fossil fuel non heat [-]
2437 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: FcEF_v_kgkm ! CO2 Emission factor [kg km-1]
2438 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: HumActivity_24hr !Hourly profile values used in human activity calculation[-]
2439 REAL(KIND(1D0)), INTENT(IN) :: MaxFCMetab ! maximum FC metabolism [umol m-2 s-1]
2440 REAL(KIND(1D0)), INTENT(IN) :: MaxQFMetab ! maximum QF Metabolism [W m-2]
2441 REAL(KIND(1D0)), INTENT(IN) :: MinFCMetab ! minimum QF metabolism [umol m-2 s-1]
2442 REAL(KIND(1D0)), INTENT(IN) :: MinQFMetab ! minimum FC metabolism [W m-2]
2443 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: TrafficRate ! Traffic rate [veh km m-2 s-1]
2444 REAL(KIND(1D0)), INTENT(IN) :: TrafficUnits ! traffic units choice [-]
2445 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: TraffProf_24hr !Hourly profile values used in traffic activity calculation[-]
2446
2447 ! ---irrigation-related variables
2448 TYPE(IRRIGATION_PRM) :: irrPrm
2449 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
2450 REAL(KIND(1D0)), INTENT(IN) :: Faut !Fraction of irrigated area using automatic irrigation [-]
2451 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_a !Coefficient for automatic irrigation model
2452 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_m !Coefficients for manual irrigation models
2453 INTEGER, INTENT(IN) :: Ie_end !ending time of water use [DOY]
2454 INTEGER, INTENT(IN) :: Ie_start !starting time of water use [DOY]
2455 REAL(KIND(1D0)), INTENT(IN) :: InternalWaterUse_h !Internal water use [mm h-1]
2456 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWat !Irrigation flag: 1 for on and 0 for off [-]
2457 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWatPer !Fraction of properties using irrigation for each day of a week [-]
2458 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfA_24hr !Hourly profile values used in automatic irrigation[-]
2459 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfM_24hr !Hourly profile values used in manual irrigation[-]
2460
2461 ! ---snow-related variables
2462 TYPE(SNOW_PRM) :: snowPrm
2463 REAL(KIND(1D0)), INTENT(IN) :: CRWmax !maximum water holding capacity of snow [mm]
2464 REAL(KIND(1D0)), INTENT(IN) :: CRWmin !minimum water holding capacity of snow [mm]
2465 REAL(KIND(1D0)), INTENT(IN) :: NARP_EMIS_SNOW ! snow emissivity in NARP model [-]
2466 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimit !temperature limit when precipitation falls as snow [degC]
2467 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimitAlb !Limit for hourly precipitation when the ground is fully covered with snow [mm]
2468 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMax !effective surface albedo (middle of the day value) for summertime [-]
2469 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMin !effective surface albedo (middle of the day value) for wintertime (not including snow) [-]
2470 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMax !maximum snow density [kg m-3]
2471 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMin !fresh snow density [kg m-3]
2472 REAL(KIND(1D0)), INTENT(IN) :: SnowLimBldg !Limit of the snow water equivalent for snow removal from building roofs [mm]
2473 REAL(KIND(1D0)), INTENT(IN) :: SnowLimPaved !limit of the snow water equivalent for snow removal from roads[mm]
2474 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SnowPackLimit !Limit for the snow water equivalent when snow cover starts to be patchy [mm]
2475 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: SnowProf_24hr !Hourly profile values used in snow clearing [-]
2476 REAL(KIND(1D0)), INTENT(IN) :: tau_a !time constant for snow albedo aging in cold snow [-]
2477 REAL(KIND(1D0)), INTENT(IN) :: tau_f !time constant for snow albedo aging in melting snow [-]
2478 REAL(KIND(1D0)), INTENT(IN) :: tau_r !time constant for snow density ageing [-]
2479 REAL(KIND(1D0)), INTENT(IN) :: TempMeltFact !hourly temperature melt factor of snow [mm K-1 h-1]
2480 REAL(KIND(1D0)), INTENT(IN) :: RadMeltFact !hourly radiation melt factor of snow [mm W-1 h-1]
2481
2482 ! ---conductance-related variables
2483 TYPE(CONDUCTANCE_PRM) :: conductancePrm
2484 REAL(KIND(1D0)), INTENT(IN) :: g_max !Fitted parameters related to surface res. calculations
2485 REAL(KIND(1D0)), INTENT(IN) :: g_k !Fitted parameters related to surface res. calculations
2486 REAL(KIND(1D0)), INTENT(IN) :: g_q_base !Fitted parameters related to surface res. calculations
2487 REAL(KIND(1D0)), INTENT(IN) :: g_q_shape !Fitted parameters related to surface res. calculations
2488 REAL(KIND(1D0)), INTENT(IN) :: g_t !Fitted parameters related to surface res. calculations
2489 REAL(KIND(1D0)), INTENT(IN) :: g_sm !Fitted parameters related to surface res. calculations
2490 REAL(KIND(1D0)), INTENT(IN) :: Kmax !annual maximum hourly solar radiation [W m-2]
2491 INTEGER, INTENT(IN) :: gsModel !choice of gs parameterisation (1 = Ja11, 2 = Wa16) [-]
2492 REAL(KIND(1D0)), INTENT(IN) :: S1 !a parameter related to soil moisture dependence [-]
2493 REAL(KIND(1D0)), INTENT(IN) :: S2 !a parameter related to soil moisture dependence [mm]
2494 REAL(KIND(1D0)), INTENT(IN) :: TH !upper air temperature limit [degC]
2495 REAL(KIND(1D0)), INTENT(IN) :: TL !lower air temperature limit [degC]
2496
2497 ! ---land cover related variables
2498 TYPE(LC_PAVED_PRM) :: pavedPrm
2499 TYPE(LC_BLDG_PRM) :: bldgPrm
2500 TYPE(LC_DECTR_PRM) :: dectrPrm
2501 TYPE(LC_EVETR_PRM) :: evetrPrm
2502 TYPE(LC_GRASS_PRM) :: grassPrm
2503 TYPE(LC_BSOIL_PRM) :: bsoilPrm
2504 TYPE(LC_WATER_PRM) :: waterPrm
2505
2506 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: sfr_surf !surface cover fraction[-]
2507 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: emis !Effective surface emissivity[-]
2508 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: chAnOHM !Bulk transfer coefficient for this surface to use in AnOHM [-]
2509 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: cpAnOHM !Volumetric heat capacity for this surface to use in AnOHM [J m-3]
2510 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: kkAnOHM !Thermal conductivity for this surface to use in AnOHM [W m K-1]
2511 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshSW !Temperature threshold determining whether summer/winter OHM coefficients are applied [degC]
2512 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshWD !Soil moisture threshold determining whether wet/dry OHM coefficients are applied [-]
2513 REAL(KIND(1D0)), DIMENSION(nsurf + 1, 4, 3), INTENT(IN) :: OHM_coef !Coefficients for OHM calculation
2514 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilDepth !Depth of soil beneath the surface [mm]
2515 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilStoreCap_surf !Capacity of soil store for each surface [mm]
2516 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SatHydraulicConduct !Hydraulic conductivity for saturated soil [mm s-1]
2517 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: StateLimit_surf !Upper limit to the surface state [mm]
2518 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: WetThresh_surf ! !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
2519 REAL(KIND(1D0)), DIMENSION(NSURF + 1, NSURF - 1), INTENT(IN) :: WaterDist !Fraction of water redistribution [-]
2520
2521 REAL(KIND(1D0)), INTENT(IN) :: IrrFracPaved !fraction of paved which are irrigated [-]
2522 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBldgs !fraction of buildings (e.g., green roofs) which are irrigated [-]
2523 REAL(KIND(1D0)), INTENT(IN) :: IrrFracDecTr !fraction of deciduous trees which are irrigated [-]
2524 REAL(KIND(1D0)), INTENT(IN) :: IrrFracEveTr !fraction of evergreen trees which are irrigated [-]
2525 REAL(KIND(1D0)), INTENT(IN) :: IrrFracGrass !fraction of grass which are irrigated [-]
2526 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBSoil !fraction of bare soil trees which are irrigated [-]
2527 REAL(KIND(1D0)), INTENT(IN) :: IrrFracWater !fraction of water which are irrigated [-]
2528
2529 REAL(KIND(1D0)), INTENT(IN) :: bldgH !average building height [m]
2530 REAL(KIND(1D0)), INTENT(IN) :: FAIBldg ! frontal area index for buildings [-]
2531
2532 REAL(KIND(1D0)), INTENT(IN) :: DecTreeH !average height of deciduous tree and shrub [-]
2533 REAL(KIND(1D0)), INTENT(IN) :: FAIDecTree ! frontal area index for deciduous tree [-]
2534 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec !maximum water storage capacity for upper surfaces (i.e. canopy)
2535 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec !minimum water storage capacity for upper surfaces (i.e. canopy)
2536 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec !full leaf-on summertime value used only for DecTr
2537 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec !leaf-off wintertime value used only for DecTr
2538 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr !maximum albedo for deciduous tree and shrub [-]
2539 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr !minimum albedo for deciduous tree and shrub [-]
2540
2541 REAL(KIND(1D0)), INTENT(IN) :: EveTreeH !height of evergreen tree [m]
2542 REAL(KIND(1D0)), INTENT(IN) :: FAIEveTree ! frontal area index for evergreen tree [-]
2543 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr !maximum albedo for evergreen tree and shrub [-]
2544 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr !minimum albedo for evergreen tree and shrub [-]
2545
2546 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass !maximum albedo for grass [-]
2547 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass !minimum albedo for grass [-]
2548
2549 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_bioCO2 !The light-saturated gross photosynthesis of the canopy [umol m-2 s-1 ]
2550 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_enh_bioCO2 !Part of the beta coefficient related to the fraction of vegetation [umol m-2 s-1 ]
2551 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_bioCO2 !The mean apparent ecosystem quantum. Represents the initial slope of the light-response curve [-]
2552 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_enh_bioCO2 !Part of the alpha coefficient related to the fraction of vegetation[-]
2553 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_a !Respiration coefficient a
2554 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_b !Respiration coefficient b - related to air temperature dependency
2555 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: min_res_bioCO2 !Minimum soil respiration rate (for cold-temperature limit) [umol m-2 s-1]
2556 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: theta_bioCO2 !The convexity of the curve at light saturation [-]
2557
2558 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseT !Base Temperature for initiating growing degree days (GDD) for leaf growth [degC]
2559 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseTe !Base temperature for initiating sensesance degree days (SDD) for leaf off [degC]
2560 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: SDDFull !the sensesence degree days (SDD) needed to initiate leaf off [degC]
2561 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: GDDFull !the growing degree days (GDD) needed for full capacity of the leaf area index [degC]
2562 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMax !full leaf-on summertime value [m2 m-2]
2563 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMin !leaf-off wintertime value [m2 m-2]
2564 REAL(KIND(1D0)), DIMENSION(4, NVEGSURF), INTENT(IN) :: LAIPower !parameters required by LAI calculation
2565 INTEGER, DIMENSION(NVEGSURF), INTENT(IN) :: LAIType !LAI calculation choice[-]
2566
2567 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: MaxConductance !the maximum conductance of each vegetation or surface type. [mm s-1]
2568
2569 ! ********** SUEWS_stateVariables **********
2570 ! ---anthropogenic heat-related states
2571 TYPE(anthroHEAT_STATE) :: anthroHeatState
2572 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id !Heating Degree Days [degC d]
2573
2574 ! ---water balance related states
2575 TYPE(HYDRO_STATE) :: hydroState
2576 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_roof !Soil moisture of roof [mm]
2577 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_roof !wetness status of roof [mm]
2578 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_wall !Soil moisture of wall [mm]
2579 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_wall !wetness status of wall [mm]
2580 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: soilstore_surf !soil moisture of each surface type [mm]
2581 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: state_surf !wetness status of each surface type [mm]
2582 REAL(KIND(1D0)), DIMENSION(9), INTENT(INOUT) :: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm]
2583
2584 ! ---heat storage related states
2585 TYPE(HEAT_STATE) :: heatState
2586 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(INOUT) :: temp_roof !interface temperature between depth layers in roof [degC]
2587 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_roof !roof surface temperature [degC]
2588 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(INOUT) :: temp_wall !interface temperature between depth layers in wall [degC]
2589 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_wall !wall surface temperature [degC]
2590 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(INOUT) :: tsfc_surf !surface temperature [degC]
2591 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(INOUT) :: temp_surf !interface temperature between depth layers [degC]
2592
2593 ! ---OHM related states
2594 TYPE(OHM_STATE) :: ohmState
2595 REAL(KIND(1D0)), INTENT(INOUT) :: qn_av ! weighted average of net all-wave radiation [W m-2]
2596 REAL(KIND(1D0)), INTENT(INOUT) :: dqndt ! rate of change of net radiation [W m-2 h-1]
2597 REAL(KIND(1D0)), INTENT(INOUT) :: qn_s_av ! weighted average of qn over snow [W m-2]
2598 REAL(KIND(1D0)), INTENT(INOUT) :: dqnsdt ! Rate of change of net radiation [W m-2 h-1]
2599
2600 ! ---snow related states
2601 TYPE(SNOW_STATE) :: snowState
2602 REAL(KIND(1D0)), INTENT(INOUT) :: SnowfallCum !cumulated snow falling [mm]
2603 REAL(KIND(1D0)), INTENT(INOUT) :: SnowAlb !albedo of know [-]
2604 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: IceFrac !fraction of ice in snowpack [-]
2605 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowWater ! snow water[mm]
2606 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowDens !snow density [kg m-3]
2607 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowFrac !snow fraction [-]
2608 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowPack !snow water equivalent on each land cover [mm]
2609
2610 ! ---phenology related states
2611 TYPE(PHENOLOGY_STATE) :: phenState
2612 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: alb !albedo [-]
2613 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: GDD_id !Growing Degree Days [degC d]
2614 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INout) :: SDD_id !Senescence Degree Days[degC d]
2615 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: LAI_id !LAI for each veg surface [m2 m-2]
2616 REAL(KIND(1D0)), INTENT(INout) :: Tmin_id !Daily minimum temperature [degC]
2617 REAL(KIND(1D0)), INTENT(INout) :: Tmax_id !Daily maximum temperature [degC]
2618 REAL(KIND(1D0)), INTENT(INout) :: lenDay_id !daytime length [h]
2619 REAL(KIND(1D0)), INTENT(INOUT) :: DecidCap_id !Moisture storage capacity of deciduous trees [mm]
2620 REAL(KIND(1D0)), INTENT(INOUT) :: albDecTr_id !Albedo of deciduous trees [-]
2621 REAL(KIND(1D0)), INTENT(INOUT) :: albEveTr_id !Albedo of evergreen trees [-]
2622 REAL(KIND(1D0)), INTENT(INOUT) :: albGrass_id !Albedo of grass [-]
2623 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id !Porosity of deciduous trees [-]
2624 REAL(KIND(1D0)), DIMENSION(6, NSURF), INTENT(INOUT) :: StoreDrainPrm !coefficients used in drainage calculation [-]
2625
2626 ! ########################################################################################
2627 ! output variables
2628 REAL(KIND(1D0)), DIMENSION(5) :: datetimeLine !date & time
2629 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5) :: dataOutLineSUEWS
2630 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5) :: dataOutLineSnow
2631 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutESTM - 5) :: dataOutLineESTM
2632 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutEHC - 5) :: dataOutLineEHC
2633 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutRSL - 5) :: dataoutLineRSL
2634 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutBEERS - 5) :: dataOutLineBEERS
2635 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDebug - 5) :: dataOutLineDebug
2636 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSPARTACUS - 5) :: dataOutLineSPARTACUS
2637 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5) :: dataOutLineDailyState
2638 ! save all output variables in a single derived type
2639 TYPE(output_line), INTENT(OUT) :: output_line_suews
2640 ! ########################################################################################
2641
2642 ! ########################################################################################
2643 ! local variables
2644 REAL(KIND(1D0)) :: a1 !AnOHM coefficients of grid [-]
2645 REAL(KIND(1D0)) :: a2 ! AnOHM coefficients of grid [h]
2646 REAL(KIND(1D0)) :: a3 !AnOHM coefficients of grid [W m-2]
2647 REAL(KIND(1D0)) :: AdditionalWater = 0 !!Additional water coming from other grids [mm] (these are expressed as depths over the whole surface)
2648 REAL(KIND(1D0)) :: U10_ms !average wind speed at 10m [W m-1]
2649 REAL(KIND(1D0)) :: azimuth !solar azimuth [angle]
2650 REAL(KIND(1D0)) :: chSnow_per_interval ! change state_id of snow and surface per time interval [mm]
2651
2652 REAL(KIND(1D0)) :: dens_dry !Vap density or absolute humidity (kg m-3)
2653 REAL(KIND(1D0)) :: deltaLAI !change in LAI [m2 m-2]
2654 REAL(KIND(1D0)) :: drain_per_tstep ! total drainage for all surface type at each timestep [mm]
2655 REAL(KIND(1D0)) :: Ea_hPa !vapor pressure [hPa]
2656 REAL(KIND(1D0)) :: QE_LUMPS !turbulent latent heat flux by LUMPS model [W m-2]
2657 REAL(KIND(1D0)) :: es_hPa !Saturation vapour pressure over water [hPa]
2658 REAL(KIND(1D0)) :: ev_per_tstep ! evaporation at each time step [mm]
2659 REAL(KIND(1D0)) :: wu_ext !external water use [mm]
2660 REAL(KIND(1D0)) :: Fc !total co2 flux [umol m-2 s-1]
2661 REAL(KIND(1D0)) :: Fc_anthro !anthropogenic co2 flux [umol m-2 s-1]
2662 REAL(KIND(1D0)) :: Fc_biogen !biogenic CO2 flux [umol m-2 s-1]
2663 REAL(KIND(1D0)) :: Fc_build ! anthropogenic co2 flux [umol m-2 s-1]
2664 REAL(KIND(1D0)) :: fcld !estomated cloud fraction [-]
2665 REAL(KIND(1D0)) :: Fc_metab ! co2 emission from metabolism component [umol m-2 s-1]
2666 REAL(KIND(1D0)) :: Fc_photo !co2 flux from photosynthesis [umol m
2667 REAL(KIND(1D0)) :: Fc_point ! co2 emission from point source [umol m-2 s-1]
2668 REAL(KIND(1D0)) :: Fc_respi !co2 flux from respiration [umol m-2 s-1]
2669 REAL(KIND(1D0)) :: Fc_traff ! co2 emission from traffic component [umol m-2 s-1]
2670 REAL(KIND(1D0)) :: gfunc
2671 REAL(KIND(1D0)) :: gsc !Surface Layer Conductance
2672 REAL(KIND(1D0)) :: QH_LUMPS !turbulent sensible heat flux from LUMPS model [W m-2]
2673 REAL(KIND(1D0)) :: wu_int !internal water use [mm]
2674 REAL(KIND(1D0)) :: kclear !clear sky incoming shortwave radiation [W m-2]
2675 REAL(KIND(1D0)) :: kup !outgoing shortwave radiation [W m-2]
2676 REAL(KIND(1D0)) :: ldown !incoming longtwave radiation [W m-2]
2677 REAL(KIND(1D0)) :: lup !outgoing longwave radiation [W m-2]
2678 REAL(KIND(1D0)) :: L_mod !Obukhov length [m]
2679 REAL(KIND(1D0)) :: mwh !snowmelt [mm]
2680 REAL(KIND(1D0)) :: mwstore !overall met water [mm]
2681 REAL(KIND(1D0)) :: NWstate_per_tstep ! state_id at each tinestep(excluding water body) [mm]
2682 REAL(KIND(1D0)) :: FAI ! frontal area index [-]
2683 REAL(KIND(1D0)) :: PAI ! plan area index [-]
2684 REAL(KIND(1D0)) :: zL ! Stability scale [-]
2685 REAL(KIND(1D0)) :: q2_gkg ! Air specific humidity at 2 m [g kg-1]
2686 REAL(KIND(1D0)) :: qe !turbuent latent heat flux [W m-2]
2687 REAL(KIND(1D0)) :: qf !anthropogenic heat flux [W m-2]
2688 REAL(KIND(1D0)) :: QF_SAHP !total anthropogeic heat flux when EmissionMethod is not 0 [W m-2]
2689 REAL(KIND(1D0)) :: qh !turbulent sensible heat flux [W m-2]
2690 REAL(KIND(1D0)) :: qh_residual ! residual based sensible heat flux [W m-2]
2691 REAL(KIND(1D0)) :: qh_resist !resistance bnased sensible heat flux [W m-2]
2692 REAL(KIND(1D0)) :: Qm !Snowmelt-related heat [W m-2]
2693 REAL(KIND(1D0)) :: QmFreez !heat related to freezing of surface store [W m-2]
2694 REAL(KIND(1D0)) :: QmRain !melt heat for rain on snow [W m-2]
2695 REAL(KIND(1D0)) :: qn !net all-wave radiation [W m-2]
2696 REAL(KIND(1D0)) :: qn_snow !net all-wave radiation on snow surface [W m-2]
2697 REAL(KIND(1D0)) :: qn_snowfree !net all-wave radiation on snow-free surface [W m-2]
2698 REAL(KIND(1D0)) :: qs !heat storage flux [W m-2]
2699 REAL(KIND(1D0)) :: RA_h ! aerodynamic resistance [s m-1]
2700 REAL(KIND(1D0)) :: RS ! surface resistance [s m-1]
2701 REAL(KIND(1D0)), DIMENSION(NSURF) :: rss_surf ! surface resistance adjusted by surface wetness state[s m-1]
2702 REAL(KIND(1D0)) :: RH2 ! air relative humidity at 2m [-]
2703 REAL(KIND(1D0)) :: runoffAGveg !Above ground runoff from vegetated surfaces for all surface area [mm]
2704 REAL(KIND(1D0)) :: runoffAGimpervious !Above ground runoff from impervious surface for all surface area [mm]
2705 REAL(KIND(1D0)) :: runoff_per_tstep !runoff water at each time step [mm]
2706 REAL(KIND(1D0)) :: runoffPipes !runoff to pipes [mm]
2707 REAL(KIND(1D0)) :: runoffSoil_per_tstep !Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
2708 REAL(KIND(1D0)) :: runoffwaterbody !Above ground runoff from water body for all surface area [mm]
2709 REAL(KIND(1D0)) :: smd !soil moisture deficit [mm]
2710 REAL(KIND(1D0)) :: SoilState !Area-averaged soil moisture for whole surface [mm]
2711 REAL(KIND(1D0)) :: state_per_tstep !state_id at each timestep [mm]
2712 REAL(KIND(1D0)) :: surf_chang_per_tstep !change in state_id (exluding snowpack) per timestep [mm]
2713 REAL(KIND(1D0)) :: swe !overall snow water equavalent[mm]
2714 REAL(KIND(1D0)) :: t2_C !modelled 2 meter air temperature [degC]
2715 REAL(KIND(1D0)) :: TSfc_C ! surface temperature [degC]
2716 REAL(KIND(1D0)) :: TempVeg ! temporary vegetative surface fraction adjusted by rainfall [-]
2717 REAL(KIND(1D0)) :: tot_chang_per_tstep !Change in surface state_id [mm]
2718 REAL(KIND(1D0)) :: TStar !T*, temperature scale [-]
2719 REAL(KIND(1D0)) :: tsurf !surface temperatue [degC]
2720 REAL(KIND(1D0)) :: UStar !friction velocity [m s-1]
2721 REAL(KIND(1D0)) :: VPD_Pa !vapour pressure deficit [Pa]
2722 REAL(KIND(1D0)) :: z0m !Aerodynamic roughness length [m]
2723 REAL(KIND(1D0)) :: zdm !zero-plane displacement [m]
2724 REAL(KIND(1D0)) :: ZENITH_deg !solar zenith angle in degree [°]
2725 REAL(KIND(1D0)) :: zH ! Mean building height [m]
2726
2727 REAL(KIND(1D0)), DIMENSION(2) :: SnowRemoval !snow removal [mm]
2728 REAL(KIND(1D0)), DIMENSION(NSURF) :: wu_surf !external water use of each surface type [mm]
2729 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezMelt !freezing of melt water[mm]
2730 REAL(KIND(1D0)), DIMENSION(nsurf) :: kup_ind_snow !outgoing shortwave on snowpack [W m-2]
2731 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: mw_ind !melt water from sknowpack[mm]
2732 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_freezState !heat related to freezing of surface store [W m-2]
2733 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_melt !melt heat [W m-2]
2734 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: Qm_rain !melt heat for rain on snow [W m-2]
2735 REAL(KIND(1D0)), DIMENSION(NSURF) :: qn_ind_snow !net all-wave radiation on snowpack [W m-2]
2736 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: rainOnSnow !rain water on snow event [mm]
2737 REAL(KIND(1D0)), DIMENSION(NSURF) :: runoffSoil !Soil runoff from each soil sub-surface [mm]
2738 REAL(KIND(1D0)), DIMENSION(NSURF) :: smd_nsurf !soil moisture deficit for each surface
2739 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: snowDepth !Snow depth [m]
2740
2741 REAL(KIND(1D0)), DIMENSION(nsurf) :: Tsurf_ind_snow !snowpack surface temperature [C]
2742
2743 ! INTEGER, DIMENSION(NSURF) :: snowCalcSwitch
2744 INTEGER, DIMENSION(3) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
2745 INTEGER :: DLS
2746
2747 REAL(KIND(1D0)) :: dq !Specific humidity deficit [g/kg]
2748 REAL(KIND(1D0)) :: lvS_J_kg !latent heat of sublimation [J kg-1]
2749 REAL(KIND(1D0)) :: psyc_hPa !psychometric constant [hPa]
2750 REAL(KIND(1D0)) :: z0v !roughness for heat [m]
2751 REAL(KIND(1D0)) :: z0vSnow !roughness for heat [m]
2752 REAL(KIND(1D0)) :: RAsnow !Aerodynamic resistance for snow [s m-1]
2753 REAL(KIND(1D0)) :: RB !boundary layer resistance shuttleworth
2754 REAL(KIND(1D0)) :: runoff_per_interval !run-off at each time interval [mm]
2755 REAL(KIND(1D0)) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
2756 REAL(KIND(1D0)) :: sIce_hpa !satured curve on snow [hPa]
2757 REAL(KIND(1D0)) :: SoilMoistCap !Maximum capacity of soil store [mm]
2758 ! REAL(KIND(1D0)) :: veg_fr !vegetation fraction [-]
2759 REAL(KIND(1D0)) :: VegPhenLumps
2760 REAL(KIND(1D0)) :: VPd_hpa ! vapour pressure deficit [hPa]
2761 REAL(KIND(1D0)) :: vsmd !Soil moisture deficit for vegetated surfaces only [mm]
2762 REAL(KIND(1D0)) :: ZZD !Active measurement height[m]
2763
2764 REAL(KIND(1D0)), DIMENSION(NSURF) :: deltaQi ! storage heat flux of snow surfaces [W m-2]
2765 REAL(KIND(1D0)), DIMENSION(NSURF) :: drain_surf !drainage of each surface type [mm]
2766 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezState !freezing of state_id [mm]
2767 ! REAL(KIND(1D0)), DIMENSION(NSURF) :: FreezStateVol !surface state_id [mm]
2768 REAL(KIND(1D0)), DIMENSION(NSURF) :: tsurf_ind !snow-free surface temperature [degC]
2769
2770 ! TODO: TS 25 Oct 2017
2771 ! the variables are not used currently as grid-to-grid connection is NOT set up.
2772 ! set these variables as zero.
2773 REAL(KIND(1D0)) :: addImpervious = 0
2774 REAL(KIND(1D0)) :: addPipes = 0
2775 REAL(KIND(1D0)) :: addVeg = 0
2776 REAL(KIND(1D0)) :: addWaterBody = 0
2777 REAL(KIND(1D0)), DIMENSION(NSURF) :: AddWater = 0
2778 REAL(KIND(1D0)), DIMENSION(NSURF) :: frac_water2runoff = 0
2779
2780 ! values that are derived from tstep
2781 INTEGER :: nsh ! number of timesteps per hour
2782 REAL(KIND(1D0)) :: nsh_real ! nsh in type real [-]
2783 REAL(KIND(1D0)) :: tstep_real ! tstep in type real
2784 REAL(KIND(1D0)) :: dectime !decimal time [-]
2785
2786 ! values that are derived from sfr_surf (surface fractions)
2787 REAL(KIND(1D0)) :: VegFraction ! fraction of vegetation [-]
2788 REAL(KIND(1D0)) :: ImpervFraction !fractioin of impervious surface [-]
2789 REAL(KIND(1D0)) :: PervFraction !fraction of pervious surfaces [-]
2790 REAL(KIND(1D0)) :: NonWaterFraction !fraction of non-water [-]
2791
2792 ! snow related temporary values
2793 REAL(KIND(1D0)) :: albedo_snow !snow albedo [-]
2794
2795 ! ########################################################################################
2796 ! TS 19 Sep 2019
2797 ! temporary variables to save values for inout varialbes
2798 ! suffixes and denote values from last and to next tsteps, respectively
2799 ! these variables are introduced to allow safe and robust iterations inccurred in this subroutine
2800 ! so that these values won't updated in unexpectedly many times
2801
2802 ! OHM related:
2803 TYPE(OHM_STATE) :: ohmState_prev, ohmState_next
2804
2805 ! snow related:
2806 TYPE(SNOW_STATE) :: snowState_prev, snowState_next
2807
2808 ! water balance related:
2809 TYPE(HYDRO_STATE) :: hydroState_prev, hydroState_next
2810 REAL(KIND(1D0)), DIMENSION(NSURF) :: ev0_surf ! evapotranspiration from PM of each surface type [mm]
2811 REAL(KIND(1D0)), DIMENSION(NSURF) :: ev_surf ! evapotranspiration of each surface type [mm]
2812 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_roof ! evapotranspiration of each roof layer [mm]
2813 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_wall ! evapotranspiration of each wall type [mm]
2814
2815 ! phenology related:
2816 TYPE(PHENOLOGY_STATE) :: phenState_prev, phenState_next
2817
2818 ! anthropogenic heat related:
2819 TYPE(anthroHEAT_STATE) :: anthroHeatState_prev, anthroHeatState_next
2820
2821 REAL(KIND(1D0)) :: Tair_av_prev, Tair_av_next !average air temperature [degC]
2822 ! ########################################################################################
2823 ! flag for Tsurf convergence
2824 LOGICAL :: flag_converge
2825 REAL(KIND(1D0)) :: Ts_iter !average surface temperature of all surfaces [degC]
2826 REAL(KIND(1D0)) :: dif_tsfc_iter
2827 REAL(KIND(1D0)) :: QH_Init !initialised sensible heat flux [W m-2]
2828 INTEGER :: i_iter
2829
2830 ! ########################################################################################
2831 ! ! extended for ESTM_ehc, TS 20 Jan 2022
2832 !
2833 ! input arrays: standard suews surfaces
2834 TYPE(HEAT_STATE) :: heatState_in, heatState_out
2835 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_roof !roof surface fraction [-]
2836 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_wall !wall surface fraction [-]
2837 REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc0_out_roof !surface temperature of roof[degC]
2838 REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc0_out_wall !surface temperature of wall[degC]
2839 REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc0_out_surf !surface temperature [degC]
2840
2841 ! output arrays:
2842
2843 ! roof facets
2844 ! aggregated heat storage of all roof facets
2845 REAL(KIND(1D0)), DIMENSION(nlayer) :: QS_roof ! heat storage flux for roof component [W m-2]
2846 !interface temperature between depth layers
2847 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_out_roof !interface temperature between depth layers [degC]
2848
2849 ! energy fluxes of individual surfaces
2850 REAL(KIND(1D0)), DIMENSION(nlayer) :: QG_roof ! heat flux used in ESTM_ehc as forcing of roof surface [W m-2]
2851 REAL(KIND(1D0)), DIMENSION(nlayer) :: QN_roof ! net all-wave radiation of roof surface [W m-2]
2852 REAL(KIND(1D0)), DIMENSION(nlayer) :: qe_roof ! latent heat flux of roof surface [W m-2]
2853 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_roof ! sensible heat flux of roof surface [W m-2]
2854 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_resist_roof ! resist-based sensible heat flux of roof surface [W m-2]
2855
2856 ! wall facets
2857 ! aggregated heat storage of all wall facets
2858 REAL(KIND(1D0)), DIMENSION(nlayer) :: QS_wall ! heat storage flux for wall component [W m-2]
2859 !interface temperature between depth layers
2860 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth) :: temp_out_wall !interface temperature between depth layers [degC]
2861
2862 ! energy fluxes of individual surfaces
2863 REAL(KIND(1D0)), DIMENSION(nlayer) :: QG_wall ! heat flux used in ESTM_ehc as forcing of wall surface [W m-2]
2864 REAL(KIND(1D0)), DIMENSION(nlayer) :: QN_wall ! net all-wave radiation of wall surface [W m-2]
2865 REAL(KIND(1D0)), DIMENSION(nlayer) :: qe_wall ! latent heat flux of wall surface [W m-2]
2866 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_wall ! sensible heat flux of wall surface [W m-2]
2867 REAL(KIND(1D0)), DIMENSION(nlayer) :: qh_resist_wall ! resistance based sensible heat flux of wall surface [W m-2]
2868
2869 ! standard suews surfaces
2870 !interface temperature between depth layers
2871 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth) :: temp_out_surf !interface temperature between depth layers[degC]
2872
2873 ! energy fluxes of individual surfaces
2874 REAL(KIND(1D0)), DIMENSION(nsurf) :: QG_surf ! heat flux used in ESTM_ehc as forcing of individual surface [W m-2]
2875 REAL(KIND(1D0)), DIMENSION(nsurf) :: QN_surf ! net all-wave radiation of individual surface [W m-2]
2876 REAL(KIND(1D0)), DIMENSION(nsurf) :: qs_surf ! aggregated heat storage of of individual surface [W m-2]
2877 REAL(KIND(1D0)), DIMENSION(nsurf) :: qe0_surf ! latent heat flux from PM of individual surface [W m-2]
2878 REAL(KIND(1D0)), DIMENSION(nsurf) :: qe_surf ! latent heat flux of individual surface [W m-2]
2879 REAL(KIND(1D0)), DIMENSION(nsurf) :: qh_surf ! sensinle heat flux of individual surface [W m-2]
2880 REAL(KIND(1D0)), DIMENSION(nsurf) :: qh_resist_surf ! resistance based sensible heat flux of individual surface [W m-2]
2881 ! surface temperature
2882 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc_qh_surf ! latent heat flux of individual surface [W m-2]
2883
2884 ! iterator for surfaces
2885 INTEGER :: i_surf !iterator for surfaces
2886
2887 ! used in iteration
2888 INTEGER :: max_iter !maximum iteration
2889 REAL(KIND(1D0)) :: ratio_iter
2890
2891 REAL(KIND(1D0)) :: g_kdown !gdq*gtemp*gs*gq for photosynthesis calculations
2892 REAL(KIND(1D0)) :: g_dq !gdq*gtemp*gs*gq for photosynthesis calculations
2893 REAL(KIND(1D0)) :: g_ta !gdq*gtemp*gs*gq for photosynthesis calculations
2894 REAL(KIND(1D0)) :: g_smd !gdq*gtemp*gs*gq for photosynthesis calculations
2895 REAL(KIND(1D0)) :: g_lai !gdq*gtemp*gs*gq for photosynthesis calculations
2896
2897 ! ####################################################################################
2898 ! Related to RSL wind profiles
2899 INTEGER, PARAMETER :: nz = 90 ! number of levels 10 levels in canopy plus 20 (3 x Zh) above the canopy
2900 INTEGER, PARAMETER :: AerodynamicResistanceMethod = 2 !method to calculate RA [-]
2901 INTEGER, PARAMETER :: BaseTMethod = 2 ! base t method [-]
2902 INTEGER, PARAMETER :: DiagQN = 0 ! flag for printing diagnostic info for QN module during runtime [N/A] ! not used and will be removed
2903 INTEGER, PARAMETER :: DiagQS = 0 ! flag for printing diagnostic info for QS module during runtime [N/A] ! not used and will be removed
2904 INTEGER, PARAMETER :: EvapMethod = 2 ! Evaporation calculated according to Rutter (1) or Shuttleworth (2) [-]
2905 INTEGER, PARAMETER :: LAImethod = 1 ! boolean to determine if calculate LAI [-]
2906 REAL(KIND(1D0)), PARAMETER :: BaseT_HC = 18.2 !base temperature for heating degree dayb [degC] ! to be fully removed TODO
2907
2908 ! calculated values of FAI
2909 REAL(KIND(1D0)) :: FAIBldg_use
2910 REAL(KIND(1D0)) :: FAIEveTree_use
2911 REAL(KIND(1D0)) :: FAIDecTree_use
2912
2913 ! ####################################################################################
2914 ALLOCATE (hydrostate_prev%soilstore_roof(nlayer))
2915 ALLOCATE (hydrostate_prev%state_roof(nlayer))
2916 ALLOCATE (hydrostate_prev%soilstore_wall(nlayer))
2917 ALLOCATE (hydrostate_prev%state_wall(nlayer))
2918 ALLOCATE (hydrostate_next%soilstore_roof(nlayer))
2919 ALLOCATE (hydrostate_next%state_roof(nlayer))
2920 ALLOCATE (hydrostate_next%soilstore_wall(nlayer))
2921 ALLOCATE (hydrostate_next%state_wall(nlayer))
2922
2923 ALLOCATE (heatstate_in%temp_roof(nlayer, ndepth))
2924 ALLOCATE (heatstate_in%temp_wall(nlayer, ndepth))
2925 ALLOCATE (heatstate_in%tsfc_roof(nlayer))
2926 ALLOCATE (heatstate_in%tsfc_wall(nlayer))
2927 ALLOCATE (heatstate_in%tsfc_surf(nsurf))
2928 ALLOCATE (heatstate_in%temp_surf(nsurf, ndepth))
2929
2930 ALLOCATE (heatstate_out%temp_roof(nlayer, ndepth))
2931 ALLOCATE (heatstate_out%temp_wall(nlayer, ndepth))
2932 ALLOCATE (heatstate_out%tsfc_roof(nlayer))
2933 ALLOCATE (heatstate_out%tsfc_wall(nlayer))
2934 ALLOCATE (heatstate_out%tsfc_surf(nsurf))
2935 ALLOCATE (heatstate_out%temp_surf(nsurf, ndepth))
2936
2937 ! ####################################################################################
2938 siteinfo%lat = lat
2939 siteinfo%lon = lng
2940 siteinfo%alt = alt
2941 siteinfo%gridiv = gridiv
2942 siteinfo%timezone = timezone
2943 siteinfo%surfacearea = surfacearea
2944 siteinfo%z = z
2945 siteinfo%z0m_in = z0m_in
2946 siteinfo%zdm_in = zdm_in
2947 siteinfo%pipecapacity = pipecapacity
2948 siteinfo%runofftowater = runofftowater
2949 siteinfo%narp_trans_site = narp_trans_site
2950 siteinfo%CO2PointSource = co2pointsource
2951 siteinfo%flowchange = flowchange
2952
2953 forcing%kdown = kdown
2954 forcing%ldown = ldown_obs
2955 forcing%RH = avrh
2956 forcing%pres = press_hpa
2957 forcing%U = avu1
2958 forcing%rain = precip
2959 forcing%Wuh = wu_m3
2960 forcing%fcld = fcld_obs
2961 forcing%LAI_obs = lai_obs
2962 forcing%snowfrac = snowfrac_obs
2963 forcing%xsmd = xsmd
2964 forcing%qn1_obs = qn1_obs
2965 forcing%qs_obs = qs_obs
2966 forcing%qf_obs = qf_obs
2967 forcing%Tair = tair_av
2968 forcing%temp_c = temp_c
2969
2970 timer%id = id
2971 timer%imin = imin
2972 timer%isec = isec
2973 timer%it = it
2974 timer%iy = iy
2975 timer%tstep = tstep
2976 timer%tstep_prev = tstep_prev
2977 timer%dt_since_start = dt_since_start
2978
2979 methodprm%Diagnose = diagnose
2980 methodprm%DiagMethod = diagmethod
2981 methodprm%EmissionsMethod = emissionsmethod
2982 methodprm%RoughLenHeatMethod = roughlenheatmethod
2983 methodprm%RoughLenMomMethod = roughlenmommethod
2984 methodprm%FAIMethod = faimethod
2985 methodprm%SMDMethod = smdmethod
2986 methodprm%WaterUseMethod = waterusemethod
2987 methodprm%NetRadiationMethod = netradiationmethod
2988 methodprm%StabilityMethod = stabilitymethod
2989 methodprm%StorageHeatMethod = storageheatmethod
2990 methodprm%SnowUse = snowuse
2991 methodprm%use_sw_direct_albedo = use_sw_direct_albedo
2992 methodprm%ohmIncQF = ohmincqf
2993
2994 lumpsprm%raincover = raincover
2995 lumpsprm%rainmaxres = rainmaxres
2996 lumpsprm%drainrt = drainrt
2997 lumpsprm%veg_type = veg_type
2998
2999 ! ESTM_ehc
3000 ALLOCATE (ehcprm%soil_storecap_roof(nlayer))
3001 ALLOCATE (ehcprm%soil_storecap_wall(nlayer))
3002 ALLOCATE (ehcprm%state_limit_roof(nlayer))
3003 ALLOCATE (ehcprm%state_limit_wall(nlayer))
3004 ALLOCATE (ehcprm%wet_thresh_roof(nlayer))
3005 ALLOCATE (ehcprm%wet_thresh_wall(nlayer))
3006 ALLOCATE (ehcprm%tin_roof(nlayer))
3007 ALLOCATE (ehcprm%tin_wall(nlayer))
3008 ALLOCATE (ehcprm%tin_surf(nlayer))
3009 ALLOCATE (ehcprm%k_roof(nlayer, ndepth))
3010 ALLOCATE (ehcprm%k_wall(nlayer, ndepth))
3011 ALLOCATE (ehcprm%k_surf(nlayer, ndepth))
3012 ALLOCATE (ehcprm%cp_roof(nlayer, ndepth))
3013 ALLOCATE (ehcprm%cp_wall(nlayer, ndepth))
3014 ALLOCATE (ehcprm%cp_surf(nlayer, ndepth))
3015 ALLOCATE (ehcprm%dz_roof(nlayer, ndepth))
3016 ALLOCATE (ehcprm%dz_wall(nlayer, ndepth))
3017 ALLOCATE (ehcprm%dz_surf(nlayer, ndepth))
3018 ehcprm%soil_storecap_roof = soilstorecap_roof
3019 ehcprm%soil_storecap_wall = soilstorecap_wall
3020 ehcprm%state_limit_roof = statelimit_roof
3021 ehcprm%state_limit_wall = statelimit_wall
3022 ehcprm%wet_thresh_roof = wetthresh_roof
3023 ehcprm%wet_thresh_wall = wetthresh_wall
3024 ehcprm%tin_roof = tin_roof
3025 ehcprm%tin_wall = tin_wall
3026 ehcprm%tin_surf = tin_surf
3027 ehcprm%k_roof = k_roof
3028 ehcprm%k_wall = k_wall
3029 ehcprm%k_surf = k_surf
3030 ehcprm%cp_roof = cp_roof
3031 ehcprm%cp_wall = cp_wall
3032 ehcprm%cp_surf = cp_surf
3033 ehcprm%dz_roof = dz_roof
3034 ehcprm%dz_wall = dz_wall
3035 ehcprm%dz_surf = dz_surf
3036
3037 ALLOCATE (spartacusprm%height(nlayer + 1))
3038 spartacusprm%air_ext_lw = air_ext_lw
3039 spartacusprm%air_ext_sw = air_ext_sw
3040 spartacusprm%air_ssa_lw = air_ssa_lw
3041 spartacusprm%air_ssa_sw = air_ssa_sw
3042 spartacusprm%veg_ssa_lw = veg_ssa_lw
3043 spartacusprm%veg_ssa_sw = veg_ssa_sw
3044 spartacusprm%height = height
3045 spartacusprm%ground_albedo_dir_mult_fact = ground_albedo_dir_mult_fact
3046 spartacusprm%n_stream_lw_urban = n_stream_lw_urban
3047 spartacusprm%n_stream_sw_urban = n_stream_sw_urban
3048 spartacusprm%n_vegetation_region_urban = n_vegetation_region_urban
3049 spartacusprm%sw_dn_direct_frac = sw_dn_direct_frac
3050 spartacusprm%veg_contact_fraction_const = veg_contact_fraction_const
3051 spartacusprm%veg_fsd_const = veg_fsd_const
3052
3053 ALLOCATE (spartacuslayerprm%building_frac(nlayer))
3054 ALLOCATE (spartacuslayerprm%building_scale(nlayer))
3055 ALLOCATE (spartacuslayerprm%veg_frac(nlayer))
3056 ALLOCATE (spartacuslayerprm%veg_scale(nlayer))
3057 ALLOCATE (spartacuslayerprm%alb_roof(nlayer))
3058 ALLOCATE (spartacuslayerprm%emis_roof(nlayer))
3059 ALLOCATE (spartacuslayerprm%alb_wall(nlayer))
3060 ALLOCATE (spartacuslayerprm%emis_wall(nlayer))
3061 ALLOCATE (spartacuslayerprm%roof_albedo_dir_mult_fact(nspec, nlayer))
3062 ALLOCATE (spartacuslayerprm%wall_specular_frac(nspec, nlayer))
3063 spartacuslayerprm%building_frac = building_frac
3064 spartacuslayerprm%building_scale = building_scale
3065 spartacuslayerprm%veg_frac = veg_frac
3066 spartacuslayerprm%veg_scale = veg_scale
3067 spartacuslayerprm%alb_roof = alb_roof
3068 spartacuslayerprm%emis_roof = emis_roof
3069 spartacuslayerprm%alb_wall = alb_wall
3070 spartacuslayerprm%emis_wall = emis_wall
3071 spartacuslayerprm%roof_albedo_dir_mult_fact = roof_albedo_dir_mult_fact
3072 spartacuslayerprm%wall_specular_frac = wall_specular_frac
3073
3074 ahemisprm%startdls = startdls
3075 ahemisprm%enddls = enddls
3076 ahemisprm%anthroheat%qf0_beu_working = qf0_beu(1)
3077 ahemisprm%anthroheat%qf0_beu_holiday = qf0_beu(2)
3078 ahemisprm%anthroheat%qf_a_working = qf_a(1)
3079 ahemisprm%anthroheat%qf_a_holiday = qf_a(2)
3080 ahemisprm%anthroheat%qf_b_working = qf_b(1)
3081 ahemisprm%anthroheat%qf_b_holiday = qf_b(2)
3082 ahemisprm%anthroheat%qf_c_working = qf_c(1)
3083 ahemisprm%anthroheat%qf_c_holiday = qf_c(2)
3084 ahemisprm%anthroheat%baset_cooling_working = baset_cooling(1)
3085 ahemisprm%anthroheat%baset_cooling_holiday = baset_cooling(2)
3086 ahemisprm%anthroheat%baset_heating_working = baset_heating(1)
3087 ahemisprm%anthroheat%baset_heating_holiday = baset_heating(2)
3088 ahemisprm%anthroheat%popdensdaytime_working = popdensdaytime(1)
3089 ahemisprm%anthroheat%popdensdaytime_holiday = popdensdaytime(2)
3090 ahemisprm%anthroheat%popdensnighttime = popdensnighttime
3091 ahemisprm%anthroheat%popprof_24hr_working = popprof_24hr(:, 1)
3092 ahemisprm%anthroheat%popprof_24hr_holiday = popprof_24hr(:, 2)
3093 ahemisprm%anthroheat%ah_min_working = ah_min(1)
3094 ahemisprm%anthroheat%ah_min_holiday = ah_min(2)
3095 ahemisprm%anthroheat%ahprof_24hr_working = ahprof_24hr(:, 1)
3096 ahemisprm%anthroheat%ahprof_24hr_holiday = ahprof_24hr(:, 2)
3097 ahemisprm%anthroheat%ah_slope_cooling_working = ah_slope_cooling(1)
3098 ahemisprm%anthroheat%ah_slope_cooling_holiday = ah_slope_cooling(2)
3099 ahemisprm%anthroheat%ah_slope_heating_working = ah_slope_heating(1)
3100 ahemisprm%anthroheat%ah_slope_heating_holiday = ah_slope_heating(2)
3101 ahemisprm%EF_umolCO2perJ = ef_umolco2perj
3102 ahemisprm%EnEF_v_Jkm = enef_v_jkm
3103 ahemisprm%FrFossilFuel_Heat = frfossilfuel_heat
3104 ahemisprm%FrFossilFuel_NonHeat = frfossilfuel_nonheat
3105 ahemisprm%FcEF_v_kgkm = fcef_v_kgkm
3106 ahemisprm%HumActivity_24hr_working = humactivity_24hr(:, 1)
3107 ahemisprm%HumActivity_24hr_holiday = humactivity_24hr(:, 2)
3108 ahemisprm%MaxFCMetab = maxfcmetab
3109 ahemisprm%MaxQFMetab = maxqfmetab
3110 ahemisprm%MinFCMetab = minfcmetab
3111 ahemisprm%MinQFMetab = minqfmetab
3112 ahemisprm%TrafficRate_working = trafficrate(1)
3113 ahemisprm%TrafficRate_holiday = trafficrate(2)
3114 ahemisprm%TrafficUnits = trafficunits
3115 ahemisprm%TraffProf_24hr_working = traffprof_24hr(:, 1)
3116 ahemisprm%TraffProf_24hr_holiday = traffprof_24hr(:, 2)
3117
3118 irrprm%h_maintain = h_maintain
3119 irrprm%faut = faut
3120 irrprm%ie_a = ie_a
3121 irrprm%ie_m = ie_m
3122 irrprm%ie_start = ie_start
3123 irrprm%ie_end = ie_end
3124 irrprm%internalwateruse_h = internalwateruse_h
3125 irrprm%irr_daywater%monday_flag = daywat(1)
3126 irrprm%irr_daywater%monday_percent = daywatper(1)
3127 irrprm%irr_daywater%tuesday_flag = daywat(2)
3128 irrprm%irr_daywater%tuesday_percent = daywatper(2)
3129 irrprm%irr_daywater%wednesday_flag = daywat(3)
3130 irrprm%irr_daywater%wednesday_percent = daywatper(3)
3131 irrprm%irr_daywater%thursday_flag = daywat(4)
3132 irrprm%irr_daywater%thursday_percent = daywatper(4)
3133 irrprm%irr_daywater%friday_flag = daywat(5)
3134 irrprm%irr_daywater%friday_percent = daywatper(5)
3135 irrprm%irr_daywater%saturday_flag = daywat(6)
3136 irrprm%irr_daywater%saturday_percent = daywatper(6)
3137 irrprm%irr_daywater%sunday_flag = daywat(7)
3138 irrprm%irr_daywater%sunday_percent = daywatper(7)
3139 irrprm%wuprofa_24hr_working = wuprofa_24hr(:, 1)
3140 irrprm%wuprofa_24hr_holiday = wuprofa_24hr(:, 2)
3141 irrprm%wuprofm_24hr_working = wuprofm_24hr(:, 1)
3142 irrprm%wuprofm_24hr_holiday = wuprofm_24hr(:, 2)
3143
3144 snowprm%crwmax = crwmax
3145 snowprm%crwmin = crwmin
3146 snowprm%narp_emis_snow = narp_emis_snow
3147 snowprm%preciplimit = preciplimit
3148 snowprm%preciplimitalb = preciplimitalb
3149 snowprm%snowalbmax = snowalbmax
3150 snowprm%snowalbmin = snowalbmin
3151 snowprm%snowdensmax = snowdensmax
3152 snowprm%snowdensmin = snowdensmin
3153 snowprm%snowlimbldg = snowlimbldg
3154 snowprm%snowlimpaved = snowlimpaved
3155 snowprm%snowpacklimit = snowpacklimit
3156 snowprm%snowprof_24hr_working = snowprof_24hr(:, 1)
3157 snowprm%snowprof_24hr_holiday = snowprof_24hr(:, 2)
3158 snowprm%tau_a = tau_a
3159 snowprm%tau_f = tau_f
3160 snowprm%tau_r = tau_r
3161 snowprm%tempmeltfact = tempmeltfact
3162 snowprm%radmeltfact = radmeltfact
3163
3164 conductanceprm%g_max = g_max
3165 conductanceprm%g_k = g_k
3166 conductanceprm%g_q_base = g_q_base
3167 conductanceprm%g_q_shape = g_q_shape
3168 conductanceprm%g_t = g_t
3169 conductanceprm%g_sm = g_sm
3170 conductanceprm%kmax = kmax
3171 conductanceprm%gsmodel = gsmodel
3172 conductanceprm%s1 = s1
3173 conductanceprm%s2 = s2
3174 conductanceprm%TH = th
3175 conductanceprm%TL = tl
3176
3177 pavedprm%sfr = sfr_surf(pavsurf)
3178 pavedprm%emis = emis(pavsurf)
3179 pavedprm%ohm%chanohm = chanohm(pavsurf)
3180 pavedprm%ohm%cpanohm = cpanohm(pavsurf)
3181 pavedprm%ohm%kkanohm = kkanohm(pavsurf)
3182 pavedprm%ohm%ohm_threshsw = ohm_threshsw(pavsurf)
3183 pavedprm%ohm%ohm_threshwd = ohm_threshwd(pavsurf)
3184
3185 !WRITE(*, *) 'OHM_COEF_pav', OHM_coef
3186
3187 pavedprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(pavsurf, 1, 1)
3188 !WRITE(*, *) 'PavSurf_OHM_COEF_A1_SUMMER_WET', OHM_coef(PavSurf, 1, 1)
3189 pavedprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(pavsurf, 2, 1)
3190 !WRITE(*, *) 'PavSurf_OHM_COEF_A1_SUMMER_DRY', OHM_coef(PavSurf, 2, 1)
3191 pavedprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(pavsurf, 3, 1)
3192 !WRITE(*, *) 'PavSurf_OHM_COEF_A1_WINTER_WRT', OHM_coef(PavSurf, 3, 1)
3193 pavedprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(pavsurf, 4, 1)
3194 ! WRITE(*, *) 'PavSurf_OHM_COEF_A1_WINTER_DRY', OHM_coef(PavSurf, 4, 1),
3195
3196 pavedprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(pavsurf, 1, 2)
3197 pavedprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(pavsurf, 2, 2)
3198 pavedprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(pavsurf, 3, 2)
3199 pavedprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(pavsurf, 4, 2)
3200
3201 pavedprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(pavsurf, 1, 3)
3202 pavedprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(pavsurf, 2, 3)
3203 pavedprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(pavsurf, 3, 3)
3204 pavedprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(pavsurf, 4, 3)
3205 ! WRITE(*,*) 'PavSurf_OHM_COEF_A3', pavedPrm%ohm%ohm_coef_lc(3)
3206
3207 pavedprm%soil%soildepth = soildepth(pavsurf)
3208 pavedprm%soil%soilstorecap = soilstorecap_surf(pavsurf)
3209 pavedprm%soil%sathydraulicconduct = sathydraulicconduct(pavsurf)
3210 pavedprm%statelimit = statelimit_surf(pavsurf)
3211 pavedprm%irrfracpaved = irrfracpaved
3212 pavedprm%wetthresh = wetthresh_surf(pavsurf)
3213 ! pavedPrm%storedrainprm%store_min = StoreDrainPrm(1, PavSurf)
3214 ! pavedPrm%storedrainprm%drain_eq = StoreDrainPrm(2, PavSurf)
3215 ! pavedPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, PavSurf)
3216 ! pavedPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, PavSurf)
3217 ! pavedPrm%storedrainprm%store_max = StoreDrainPrm(5, PavSurf)
3218 ! pavedPrm%storedrainprm%store_cap = StoreDrainPrm(6, PavSurf)
3219 pavedprm%waterdist%to_paved = waterdist(1, pavsurf)
3220 pavedprm%waterdist%to_bldg = waterdist(2, pavsurf)
3221 pavedprm%waterdist%to_evetr = waterdist(3, pavsurf)
3222 pavedprm%waterdist%to_dectr = waterdist(4, pavsurf)
3223 pavedprm%waterdist%to_grass = waterdist(5, pavsurf)
3224 pavedprm%waterdist%to_bsoil = waterdist(6, pavsurf)
3225 pavedprm%waterdist%to_water = waterdist(7, pavsurf)
3226 pavedprm%waterdist%to_soilstore = waterdist(8, pavsurf)
3227
3228 bldgprm%sfr = sfr_surf(bldgsurf)
3229 bldgprm%faibldg = faibldg
3230 bldgprm%bldgh = bldgh
3231 bldgprm%emis = emis(bldgsurf)
3232 bldgprm%ohm%chanohm = chanohm(bldgsurf)
3233 bldgprm%ohm%cpanohm = cpanohm(bldgsurf)
3234 bldgprm%ohm%kkanohm = kkanohm(bldgsurf)
3235 bldgprm%ohm%ohm_threshsw = ohm_threshsw(bldgsurf)
3236 bldgprm%ohm%ohm_threshwd = ohm_threshwd(bldgsurf)
3237 bldgprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(bldgsurf, 1, 1)
3238 bldgprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(bldgsurf, 2, 1)
3239 bldgprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(bldgsurf, 3, 1)
3240 bldgprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(bldgsurf, 4, 1)
3241 ! WRITE(*,*) 'bldgPrm_OHM_COEF_A1', bldgPrm%ohm%ohm_coef_lc(1)
3242
3243 bldgprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(bldgsurf, 1, 2)
3244 bldgprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(bldgsurf, 2, 2)
3245 bldgprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(bldgsurf, 3, 2)
3246 bldgprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(bldgsurf, 4, 2)
3247 ! WRITE(*,*) 'bldgPrm_OHM_COEF_A2', bldgPrm%ohm%ohm_coef_lc(2)
3248
3249 bldgprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(bldgsurf, 1, 3)
3250 bldgprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(bldgsurf, 2, 3)
3251 bldgprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(bldgsurf, 3, 3)
3252 bldgprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(bldgsurf, 4, 3)
3253 ! WRITE(*,*) 'bldgPrm_OHM_COEF_A3', bldgPrm%ohm%ohm_coef_lc(3)
3254
3255 bldgprm%soil%soildepth = soildepth(bldgsurf)
3256 bldgprm%soil%soilstorecap = soilstorecap_surf(bldgsurf)
3257 bldgprm%soil%sathydraulicconduct = sathydraulicconduct(bldgsurf)
3258 bldgprm%statelimit = statelimit_surf(bldgsurf)
3259 bldgprm%irrfracbldgs = irrfracbldgs
3260 bldgprm%wetthresh = wetthresh_surf(bldgsurf)
3261 ! bldgPrm%storedrainprm%store_min = StoreDrainPrm(1, BldgSurf)
3262 ! bldgPrm%storedrainprm%drain_eq = StoreDrainPrm(2, BldgSurf)
3263 ! bldgPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, BldgSurf)
3264 ! bldgPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, BldgSurf)
3265 ! bldgPrm%storedrainprm%store_max = StoreDrainPrm(5, BldgSurf)
3266 ! bldgPrm%storedrainprm%store_cap = StoreDrainPrm(6, BldgSurf)
3267 bldgprm%waterdist%to_paved = waterdist(1, bldgsurf)
3268 bldgprm%waterdist%to_bldg = waterdist(2, bldgsurf)
3269 bldgprm%waterdist%to_evetr = waterdist(3, bldgsurf)
3270 bldgprm%waterdist%to_dectr = waterdist(4, bldgsurf)
3271 bldgprm%waterdist%to_grass = waterdist(5, bldgsurf)
3272 bldgprm%waterdist%to_bsoil = waterdist(6, bldgsurf)
3273 bldgprm%waterdist%to_water = waterdist(7, bldgsurf)
3274 bldgprm%waterdist%to_soilstore = waterdist(8, bldgsurf)
3275
3276 dectrprm%sfr = sfr_surf(decidsurf)
3277 dectrprm%emis = emis(decidsurf)
3278 dectrprm%faidectree = faidectree
3279 dectrprm%dectreeh = dectreeh
3280 dectrprm%pormin_dec = pormin_dec
3281 dectrprm%pormax_dec = pormax_dec
3282 dectrprm%alb_min = albmin_dectr
3283 dectrprm%alb_max = albmax_dectr
3284 dectrprm%ohm%chanohm = chanohm(decidsurf)
3285 dectrprm%ohm%cpanohm = cpanohm(decidsurf)
3286 dectrprm%ohm%kkanohm = kkanohm(decidsurf)
3287 dectrprm%ohm%ohm_threshsw = ohm_threshsw(decidsurf)
3288 dectrprm%ohm%ohm_threshwd = ohm_threshwd(decidsurf)
3289
3290 dectrprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(decidsurf, 1, 1)
3291 dectrprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(decidsurf, 2, 1)
3292 dectrprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(decidsurf, 3, 1)
3293 dectrprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(decidsurf, 4, 1)
3294 ! WRITE(*,*) 'dectrPrm_OHM_COEF_A1', dectrPrm%ohm%ohm_coef_lc(1)
3295
3296 dectrprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(decidsurf, 1, 2)
3297 dectrprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(decidsurf, 2, 2)
3298 dectrprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(decidsurf, 3, 2)
3299 dectrprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(decidsurf, 4, 2)
3300 ! WRITE(*,*) 'dectrPrm_OHM_COEF_A2', dectrPrm%ohm%ohm_coef_lc(2)
3301
3302 dectrprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(decidsurf, 1, 3)
3303 dectrprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(decidsurf, 2, 3)
3304 dectrprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(decidsurf, 3, 3)
3305 dectrprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(decidsurf, 4, 3)
3306 ! WRITE(*,*) 'dectrPrm_OHM_COEF_A3', dectrPrm%ohm%ohm_coef_lc(3)
3307
3308 dectrprm%soil%soildepth = soildepth(decidsurf)
3309 dectrprm%soil%soilstorecap = soilstorecap_surf(decidsurf)
3310 dectrprm%soil%sathydraulicconduct = sathydraulicconduct(decidsurf)
3311 ! dectrPrm%statelimit = StateLimit_surf(DecidSurf)
3312 dectrprm%capmax_dec = capmax_dec
3313 dectrprm%capmin_dec = capmin_dec
3314 dectrprm%irrfracdectr = irrfracdectr
3315 dectrprm%wetthresh = wetthresh_surf(decidsurf)
3316 dectrprm%bioco2%beta_bioco2 = beta_bioco2(ivdecid)
3317 dectrprm%bioco2%beta_enh_bioco2 = beta_enh_bioco2(ivdecid)
3318 dectrprm%bioco2%alpha_bioco2 = alpha_bioco2(ivdecid)
3319 dectrprm%bioco2%alpha_enh_bioco2 = alpha_enh_bioco2(ivdecid)
3320 dectrprm%bioco2%resp_a = resp_a(ivdecid)
3321 dectrprm%bioco2%resp_b = resp_b(ivdecid)
3322 dectrprm%bioco2%min_res_bioCO2 = min_res_bioco2(ivdecid)
3323 dectrprm%bioco2%theta_bioco2 = theta_bioco2(ivdecid)
3324 dectrprm%maxconductance = maxconductance(ivdecid)
3325 dectrprm%lai%baset = baset(ivdecid)
3326 dectrprm%lai%gddfull = gddfull(ivdecid)
3327 dectrprm%lai%basete = basete(ivdecid)
3328 dectrprm%lai%sddfull = sddfull(ivdecid)
3329 dectrprm%lai%laimin = laimin(ivdecid)
3330 dectrprm%lai%laimax = laimax(ivdecid)
3331 dectrprm%lai%laipower = laipower(:, ivdecid)
3332 dectrprm%lai%laitype = laitype(ivdecid)
3333 ! dectrPrm%storedrainprm%store_min = StoreDrainPrm(1, DecidSurf)
3334 ! dectrPrm%storedrainprm%drain_eq = StoreDrainPrm(2, DecidSurf)
3335 ! dectrPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, DecidSurf)
3336 ! dectrPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, DecidSurf)
3337 ! dectrPrm%storedrainprm%store_max = StoreDrainPrm(5, DecidSurf)
3338 ! dectrPrm%storedrainprm%store_cap = StoreDrainPrm(6, DecidSurf)
3339 dectrprm%waterdist%to_paved = waterdist(1, decidsurf)
3340 dectrprm%waterdist%to_bldg = waterdist(2, decidsurf)
3341 dectrprm%waterdist%to_evetr = waterdist(3, decidsurf)
3342 dectrprm%waterdist%to_dectr = waterdist(4, decidsurf)
3343 dectrprm%waterdist%to_grass = waterdist(5, decidsurf)
3344 dectrprm%waterdist%to_bsoil = waterdist(6, decidsurf)
3345 dectrprm%waterdist%to_water = waterdist(7, decidsurf)
3346 dectrprm%waterdist%to_soilstore = waterdist(8, decidsurf)
3347
3348 evetrprm%sfr = sfr_surf(conifsurf)
3349 evetrprm%emis = emis(conifsurf)
3350 evetrprm%faievetree = faievetree
3351 evetrprm%evetreeh = evetreeh
3352 evetrprm%alb_min = albmin_evetr
3353 evetrprm%alb_max = albmax_evetr
3354 evetrprm%ohm%chanohm = chanohm(conifsurf)
3355 evetrprm%ohm%cpanohm = cpanohm(conifsurf)
3356 evetrprm%ohm%kkanohm = kkanohm(conifsurf)
3357 evetrprm%ohm%ohm_threshsw = ohm_threshsw(conifsurf)
3358 evetrprm%ohm%ohm_threshwd = ohm_threshwd(conifsurf)
3359 evetrprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(conifsurf, 1, 1)
3360 evetrprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(conifsurf, 2, 1)
3361 evetrprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(conifsurf, 3, 1)
3362 evetrprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(conifsurf, 4, 1)
3363 ! WRITE(*,*) 'evetrPrm_OHM_COEF_A1', evetrPrm%ohm%ohm_coef_lc(1)
3364
3365 evetrprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(conifsurf, 1, 2)
3366 evetrprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(conifsurf, 2, 2)
3367 evetrprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(conifsurf, 3, 2)
3368 evetrprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(conifsurf, 4, 2)
3369 ! WRITE(*,*) 'evetrPrm_OHM_COEF_A2', evetrPrm%ohm%ohm_coef_lc(2)
3370
3371 evetrprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(conifsurf, 1, 3)
3372 evetrprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(conifsurf, 2, 3)
3373 evetrprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(conifsurf, 3, 3)
3374 evetrprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(conifsurf, 4, 3)
3375 ! WRITE(*,*) 'evetrPrm_OHM_COEF_A3', evetrPrm%ohm%ohm_coef_lc(3)
3376
3377 evetrprm%soil%soildepth = soildepth(conifsurf)
3378 evetrprm%soil%soilstorecap = soilstorecap_surf(conifsurf)
3379 evetrprm%soil%sathydraulicconduct = sathydraulicconduct(conifsurf)
3380 evetrprm%statelimit = statelimit_surf(conifsurf)
3381 evetrprm%irrfracevetr = irrfracevetr
3382 evetrprm%wetthresh = wetthresh_surf(conifsurf)
3383 evetrprm%bioco2%beta_bioco2 = beta_bioco2(ivconif)
3384 evetrprm%bioco2%beta_enh_bioco2 = beta_enh_bioco2(ivconif)
3385 evetrprm%bioco2%alpha_bioco2 = alpha_bioco2(ivconif)
3386 evetrprm%bioco2%alpha_enh_bioco2 = alpha_enh_bioco2(ivconif)
3387 evetrprm%bioco2%resp_a = resp_a(ivconif)
3388 evetrprm%bioco2%resp_b = resp_b(ivconif)
3389 evetrprm%bioco2%min_res_bioCO2 = min_res_bioco2(ivconif)
3390 evetrprm%bioco2%theta_bioco2 = theta_bioco2(ivconif)
3391 evetrprm%maxconductance = maxconductance(ivconif)
3392 evetrprm%lai%baset = baset(ivconif)
3393 evetrprm%lai%gddfull = gddfull(ivconif)
3394 evetrprm%lai%basete = basete(ivconif)
3395 evetrprm%lai%sddfull = sddfull(ivconif)
3396 evetrprm%lai%laimin = laimin(ivconif)
3397 evetrprm%lai%laimax = laimax(ivconif)
3398 evetrprm%lai%laipower = laipower(:, ivconif)
3399 evetrprm%lai%laitype = laitype(ivconif)
3400 ! evetrPrm%storedrainprm%store_min = StoreDrainPrm(1, ConifSurf)
3401 ! evetrPrm%storedrainprm%drain_eq = StoreDrainPrm(2, ConifSurf)
3402 ! evetrPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, ConifSurf)
3403 ! evetrPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, ConifSurf)
3404 ! evetrPrm%storedrainprm%store_max = StoreDrainPrm(5, ConifSurf)
3405 ! evetrPrm%storedrainprm%store_cap = StoreDrainPrm(6, ConifSurf)
3406 evetrprm%waterdist%to_paved = waterdist(1, conifsurf)
3407 evetrprm%waterdist%to_bldg = waterdist(2, conifsurf)
3408 evetrprm%waterdist%to_evetr = waterdist(3, conifsurf)
3409 evetrprm%waterdist%to_dectr = waterdist(4, conifsurf)
3410 evetrprm%waterdist%to_grass = waterdist(5, conifsurf)
3411 evetrprm%waterdist%to_bsoil = waterdist(6, conifsurf)
3412 evetrprm%waterdist%to_water = waterdist(7, conifsurf)
3413 evetrprm%waterdist%to_soilstore = waterdist(8, conifsurf)
3414
3415 grassprm%sfr = sfr_surf(grasssurf)
3416 grassprm%emis = emis(grasssurf)
3417 grassprm%alb_min = albmin_grass
3418 grassprm%alb_max = albmax_grass
3419 grassprm%ohm%chanohm = chanohm(grasssurf)
3420 grassprm%ohm%cpanohm = cpanohm(grasssurf)
3421 grassprm%ohm%kkanohm = kkanohm(grasssurf)
3422 grassprm%ohm%ohm_threshsw = ohm_threshsw(grasssurf)
3423 grassprm%ohm%ohm_threshwd = ohm_threshwd(grasssurf)
3424 grassprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(grasssurf, 1, 1)
3425 grassprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(grasssurf, 2, 1)
3426 grassprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(grasssurf, 3, 1)
3427 grassprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(grasssurf, 4, 1)
3428 !WRITE(*,*) 'grassPrm_OHM_COEF_A1', grassPrm%ohm%ohm_coef_lc(1)
3429
3430 grassprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(grasssurf, 1, 2)
3431 grassprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(grasssurf, 2, 2)
3432 grassprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(grasssurf, 3, 2)
3433 grassprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(grasssurf, 4, 2)
3434 !WRITE(*,*) 'grassPrm_OHM_COEF_A2', grassPrm%ohm%ohm_coef_lc(2)
3435
3436 grassprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(grasssurf, 1, 3)
3437 grassprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(grasssurf, 2, 3)
3438 grassprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(grasssurf, 3, 3)
3439 grassprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(grasssurf, 4, 3)
3440 !WRITE(*,*) 'grassPrm_OHM_COEF_A3', grassPrm%ohm%ohm_coef_lc(3)
3441
3442 grassprm%soil%soildepth = soildepth(grasssurf)
3443 grassprm%soil%soilstorecap = soilstorecap_surf(grasssurf)
3444 grassprm%soil%sathydraulicconduct = sathydraulicconduct(grasssurf)
3445 grassprm%statelimit = statelimit_surf(grasssurf)
3446 grassprm%irrfracgrass = irrfracgrass
3447 grassprm%wetthresh = wetthresh_surf(grasssurf)
3448 grassprm%bioco2%beta_bioco2 = beta_bioco2(ivgrass)
3449 grassprm%bioco2%beta_enh_bioco2 = beta_enh_bioco2(ivgrass)
3450 grassprm%bioco2%alpha_bioco2 = alpha_bioco2(ivgrass)
3451 grassprm%bioco2%alpha_enh_bioco2 = alpha_enh_bioco2(ivgrass)
3452 grassprm%bioco2%resp_a = resp_a(ivgrass)
3453 grassprm%bioco2%resp_b = resp_b(ivgrass)
3454 grassprm%bioco2%min_res_bioCO2 = min_res_bioco2(ivgrass)
3455 grassprm%bioco2%theta_bioco2 = theta_bioco2(ivgrass)
3456 grassprm%maxconductance = maxconductance(ivgrass)
3457 grassprm%lai%baset = baset(ivgrass)
3458 grassprm%lai%gddfull = gddfull(ivgrass)
3459 grassprm%lai%basete = basete(ivgrass)
3460 grassprm%lai%sddfull = sddfull(ivgrass)
3461 grassprm%lai%laimin = laimin(ivgrass)
3462 grassprm%lai%laimax = laimax(ivgrass)
3463 grassprm%lai%laipower = laipower(:, ivgrass)
3464 grassprm%lai%laitype = laitype(ivgrass)
3465 ! grassPrm%storedrainprm%store_min = StoreDrainPrm(1, GrassSurf)
3466 ! grassPrm%storedrainprm%drain_eq = StoreDrainPrm(2, GrassSurf)
3467 ! grassPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, GrassSurf)
3468 ! grassPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, GrassSurf)
3469 ! grassPrm%storedrainprm%store_max = StoreDrainPrm(5, GrassSurf)
3470 ! grassPrm%storedrainprm%store_cap = StoreDrainPrm(6, GrassSurf)
3471 grassprm%waterdist%to_paved = waterdist(1, grasssurf)
3472 grassprm%waterdist%to_bldg = waterdist(2, grasssurf)
3473 grassprm%waterdist%to_evetr = waterdist(3, grasssurf)
3474 grassprm%waterdist%to_dectr = waterdist(4, grasssurf)
3475 grassprm%waterdist%to_grass = waterdist(5, grasssurf)
3476 grassprm%waterdist%to_bsoil = waterdist(6, grasssurf)
3477 grassprm%waterdist%to_water = waterdist(7, grasssurf)
3478 grassprm%waterdist%to_soilstore = waterdist(8, grasssurf)
3479
3480 bsoilprm%sfr = sfr_surf(bsoilsurf)
3481 bsoilprm%emis = emis(bsoilsurf)
3482 bsoilprm%ohm%chanohm = chanohm(bsoilsurf)
3483 bsoilprm%ohm%cpanohm = cpanohm(bsoilsurf)
3484 bsoilprm%ohm%kkanohm = kkanohm(bsoilsurf)
3485 bsoilprm%ohm%ohm_threshsw = ohm_threshsw(bsoilsurf)
3486 bsoilprm%ohm%ohm_threshwd = ohm_threshwd(bsoilsurf)
3487 bsoilprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(bsoilsurf, 1, 1)
3488 bsoilprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(bsoilsurf, 2, 1)
3489 bsoilprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(bsoilsurf, 3, 1)
3490 bsoilprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(bsoilsurf, 4, 1)
3491 !WRITE(*,*) 'bsoilPrm_OHM_COEF_A1', bsoilPrm%ohm%ohm_coef_lc(1)
3492
3493 bsoilprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(bsoilsurf, 1, 2)
3494 bsoilprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(bsoilsurf, 2, 2)
3495 bsoilprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(bsoilsurf, 3, 2)
3496 bsoilprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(bsoilsurf, 4, 2)
3497 !WRITE(*,*) 'bsoilPrm_OHM_COEF_A2', bsoilPrm%ohm%ohm_coef_lc(2)
3498
3499 bsoilprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(bsoilsurf, 1, 3)
3500 bsoilprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(bsoilsurf, 2, 3)
3501 bsoilprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(bsoilsurf, 3, 3)
3502 bsoilprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(bsoilsurf, 4, 3)
3503 !WRITE(*,*) 'bsoilPrm_OHM_COEF_A3', bsoilPrm%ohm%ohm_coef_lc(3)
3504
3505 bsoilprm%soil%soildepth = soildepth(bsoilsurf)
3506 bsoilprm%soil%soilstorecap = soilstorecap_surf(bsoilsurf)
3507 bsoilprm%soil%sathydraulicconduct = sathydraulicconduct(bsoilsurf)
3508 bsoilprm%statelimit = statelimit_surf(bsoilsurf)
3509 bsoilprm%irrfracbsoil = irrfracbsoil
3510 bsoilprm%wetthresh = wetthresh_surf(bsoilsurf)
3511 ! bsoilPrm%storedrainprm%store_min = StoreDrainPrm(1, BSoilSurf)
3512 ! bsoilPrm%storedrainprm%drain_eq = StoreDrainPrm(2, BSoilSurf)
3513 ! bsoilPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, BSoilSurf)
3514 ! bsoilPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, BSoilSurf)
3515 ! bsoilPrm%storedrainprm%store_max = StoreDrainPrm(5, BSoilSurf)
3516 ! bsoilPrm%storedrainprm%store_cap = StoreDrainPrm(6, BSoilSurf)
3517 bsoilprm%waterdist%to_paved = waterdist(1, bsoilsurf)
3518 bsoilprm%waterdist%to_bldg = waterdist(2, bsoilsurf)
3519 bsoilprm%waterdist%to_evetr = waterdist(3, bsoilsurf)
3520 bsoilprm%waterdist%to_dectr = waterdist(4, bsoilsurf)
3521 bsoilprm%waterdist%to_grass = waterdist(5, bsoilsurf)
3522 bsoilprm%waterdist%to_bsoil = waterdist(6, bsoilsurf)
3523 bsoilprm%waterdist%to_water = waterdist(7, bsoilsurf)
3524 bsoilprm%waterdist%to_soilstore = waterdist(8, bsoilsurf)
3525
3526 waterprm%sfr = sfr_surf(watersurf)
3527 waterprm%emis = emis(watersurf)
3528 waterprm%ohm%chanohm = chanohm(watersurf)
3529 waterprm%ohm%cpanohm = cpanohm(watersurf)
3530 waterprm%ohm%kkanohm = kkanohm(watersurf)
3531 waterprm%ohm%ohm_threshsw = ohm_threshsw(watersurf)
3532 waterprm%ohm%ohm_threshwd = ohm_threshwd(watersurf)
3533 waterprm%ohm%ohm_coef_lc(1)%summer_wet = ohm_coef(watersurf, 1, 1)
3534 waterprm%ohm%ohm_coef_lc(1)%summer_dry = ohm_coef(watersurf, 2, 1)
3535 waterprm%ohm%ohm_coef_lc(1)%winter_wet = ohm_coef(watersurf, 3, 1)
3536 waterprm%ohm%ohm_coef_lc(1)%winter_dry = ohm_coef(watersurf, 4, 1)
3537 !WRITE(*,*) 'waterPrm_OHM_COEF_A1', waterPrm%ohm%ohm_coef_lc(1)
3538
3539 waterprm%ohm%ohm_coef_lc(2)%summer_wet = ohm_coef(watersurf, 1, 2)
3540 waterprm%ohm%ohm_coef_lc(2)%summer_dry = ohm_coef(watersurf, 2, 2)
3541 waterprm%ohm%ohm_coef_lc(2)%winter_wet = ohm_coef(watersurf, 3, 2)
3542 waterprm%ohm%ohm_coef_lc(2)%winter_dry = ohm_coef(watersurf, 4, 2)
3543 !WRITE(*,*) 'waterPrm_OHM_COEF_A2', waterPrm%ohm%ohm_coef_lc(2)
3544
3545 waterprm%ohm%ohm_coef_lc(3)%summer_wet = ohm_coef(watersurf, 1, 3)
3546 waterprm%ohm%ohm_coef_lc(3)%summer_dry = ohm_coef(watersurf, 2, 3)
3547 waterprm%ohm%ohm_coef_lc(3)%winter_wet = ohm_coef(watersurf, 3, 3)
3548 waterprm%ohm%ohm_coef_lc(3)%winter_dry = ohm_coef(watersurf, 4, 3)
3549 !WRITE(*,*) 'waterPrm_OHM_COEF_A3', waterPrm%ohm%ohm_coef_lc(3)
3550
3551 waterprm%soil%soildepth = soildepth(watersurf)
3552 waterprm%soil%soilstorecap = soilstorecap_surf(watersurf)
3553 waterprm%soil%sathydraulicconduct = sathydraulicconduct(watersurf)
3554 waterprm%statelimit = statelimit_surf(watersurf)
3555 waterprm%irrfracwater = irrfracwater
3556 ! waterPrm%wetthresh = WetThresh_surf(WaterSurf)
3557 ! waterPrm%storedrainprm%store_min = StoreDrainPrm(1, WaterSurf)
3558 ! waterPrm%storedrainprm%drain_eq = StoreDrainPrm(2, WaterSurf)
3559 ! waterPrm%storedrainprm%drain_coef_1 = StoreDrainPrm(3, WaterSurf)
3560 ! waterPrm%storedrainprm%drain_coef_2 = StoreDrainPrm(4, WaterSurf)
3561 ! waterPrm%storedrainprm%store_max = StoreDrainPrm(5, WaterSurf)
3562 ! waterPrm%storedrainprm%store_cap = StoreDrainPrm(6, WaterSurf)
3563
3564 ! ********** SUEWS_stateVariables **********
3565 anthroheatstate%HDD_id = hdd_id
3566
3567 ! ESTM_ehc related:
3568 ! water balance related:
3569 ALLOCATE (hydrostate%soilstore_roof(nlayer))
3570 ALLOCATE (hydrostate%state_roof(nlayer))
3571 ALLOCATE (hydrostate%soilstore_wall(nlayer))
3572 ALLOCATE (hydrostate%state_wall(nlayer))
3573 hydrostate%soilstore_roof = soilstore_roof
3574 hydrostate%state_roof = state_roof
3575 hydrostate%soilstore_wall = soilstore_wall
3576 hydrostate%state_wall = state_wall
3577 hydrostate%soilstore_surf = soilstore_surf
3578 hydrostate%state_surf = state_surf
3579 hydrostate%WUDay_id = wuday_id
3580
3581 ALLOCATE (heatstate%temp_roof(nlayer, ndepth))
3582 ALLOCATE (heatstate%temp_wall(nlayer, ndepth))
3583 ALLOCATE (heatstate%tsfc_roof(nlayer))
3584 ALLOCATE (heatstate%tsfc_wall(nlayer))
3585 ALLOCATE (heatstate%tsfc_surf(nsurf))
3586 ALLOCATE (heatstate%temp_surf(nsurf, ndepth))
3587 heatstate%temp_roof = temp_roof
3588 heatstate%temp_wall = temp_wall
3589 heatstate%temp_surf = temp_surf
3590 heatstate%tsfc_roof = tsfc_roof
3591 heatstate%tsfc_wall = tsfc_wall
3592 heatstate%tsfc_surf = tsfc_surf
3593 heatstate%temp_surf = temp_surf
3594
3595 ! OHM related:
3596 ohmstate%qn_av = qn_av
3597 ohmstate%dqndt = dqndt
3598 ohmstate%qn_s_av = qn_s_av
3599 ohmstate%dqnsdt = dqnsdt
3600
3601 ! snow related:
3602 snowstate%snowfallCum = snowfallcum
3603 snowstate%snowalb = snowalb
3604 snowstate%icefrac = icefrac
3605 snowstate%snowdens = snowdens
3606 snowstate%snowfrac = snowfrac
3607 snowstate%snowpack = snowpack
3608 snowstate%snowwater = snowwater
3609
3610 ! phenology related:
3611 phenstate%alb = alb
3612 phenstate%lai_id = lai_id
3613 phenstate%SDD_id = sdd_id
3614 phenstate%GDD_id = gdd_id
3615 phenstate%porosity_id = porosity_id
3616 phenstate%decidcap_id = decidcap_id
3617 phenstate%albDecTr_id = albdectr_id
3618 phenstate%albEveTr_id = albevetr_id
3619 phenstate%albGrass_id = albgrass_id
3620 phenstate%Tmin_id = tmin_id
3621 phenstate%Tmax_id = tmax_id
3622 phenstate%lenDay_id = lenday_id
3623 phenstate%StoreDrainPrm = storedrainprm
3624
3625 ! ########################################3
3626 ! set initial values for output arrays
3627 swe = 0.
3628 mwh = 0.
3629 mwstore = 0.
3630 chsnow_per_interval = 0.
3631 snowremoval = 0.
3632 qm = 0
3633 qmfreez = 0
3634 qmrain = 0
3635
3636 ! these output variables are used for debugging
3637 qe0_surf = 0 ! QE from PM: only meaningful when snowuse=0
3638 ev0_surf = 0 ! ev from PM: only meaningful when snowuse=0
3639 ev_surf = 0 ! ev from water balance: only meaningful when snowuse=0
3640
3641 ! ####
3642 ! force several snow related state variables to zero if snow module is off
3643 IF (methodprm%snowuse == 0) THEN
3644 snowstate%SnowDens = 0.
3645 snowstate%SnowFrac = 0.
3646 snowstate%SnowWater = 0.
3647 snowstate%SnowAlb = 0.
3648 snowstate%IceFrac = 0.
3649 snowstate%SnowPack = 0.
3650 END IF
3651
3652 ! ########################################################################################
3653 ! save initial values of inout variables
3654 ohmstate_prev = ohmstate
3655
3656 snowstate_prev = snowstate
3657 snowstate_prev%snowfrac = merge(forcing%snowfrac, snowstate%SnowFrac, methodprm%NetRadiationMethod == 0)
3658
3659 hydrostate_prev = hydrostate
3660 ! IF (methodPrm%StorageHeatMethod == 5) THEN
3661 ! state_roof_prev = ehcState%state_roof
3662 ! state_wall_prev = ehcState%state_wall
3663 ! soilstore_roof_prev = ehcState%soilstore_roof
3664 ! soilstore_wall_prev = ehcState%soilstore_wall
3665 ! END IF
3666 ! Tair_av_prev = Tair_av
3667 tair_av_prev = forcing%Tair
3668 phenstate_prev = phenstate
3669 anthroheatstate_prev = anthroheatstate
3670
3671 ! ESTM_ehc related
3672 ! save initial values of inout variables
3673 heatstate_in = heatstate
3674 ! IF (StorageHeatMethod == 5) THEN
3675 ! temp_in_roof = temp_roof
3676 ! temp_in_wall = temp_wall
3677 ! temp_in_surf = temp_surf
3678 ! END IF
3679 ! initialise indoor/bottom boundary temperature arrays
3680 ! tin_roof = 10.
3681 ! tin_wall = 10.
3682 ! tin_surf = 3.
3683
3684 ! initialise variables
3685 ohmstate_next = ohmstate
3686 snowstate_next = snowstate
3687 hydrostate_next = hydrostate
3688 ! state_surf_next = state_surf
3689 ! soilstore_surf_next = soilstore_surf
3690
3691 hydrostate_next = hydrostate
3692 ! IF (StorageHeatMethod == 5) THEN
3693
3694 ! soilstore_roof_next = soilstore_roof
3695 ! soilstore_wall_next = soilstore_wall
3696 ! state_roof_next = state_roof
3697 ! state_wall_next = state_wall
3698
3699 ! END IF
3700
3701 ! Tair_av_next = Tair_av
3702 tair_av_next = forcing%Tair
3703 phenstate_next = phenstate
3704 anthroheatstate_next = anthroheatstate
3705
3706 ! initialise output variables
3707 dataoutlinesnow = -999.
3708 dataoutlineestm = -999.
3709 dataoutlineehc = -999.
3710 dataoutlinersl = -999.
3711 dataoutlinebeers = -999.
3712 dataoutlinedebug = -999.
3713 dataoutlinespartacus = -999.
3714 dataoutlinedailystate = -999.
3715
3716 !########################################################################################
3717 ! main calculation starts here
3718 !########################################################################################
3719
3720 ! iteration is used below to get results converge
3721 flag_converge = .false.
3722 ts_iter = temp_c
3723
3724 heatstate_out = heatstate
3725 tsfc0_out_surf = heatstate%tsfc_surf
3726 ! tsfc_out_surf = tsfc_surf
3727 ! tsfc0_out_surf = tsfc_surf
3728 ! ! TODO: ESTM work: to allow heterogeneous surface temperatures
3729 IF (storageheatmethod == 5 .OR. netradiationmethod > 1000) THEN
3730 tsfc0_out_roof = heatstate%tsfc_roof
3731 tsfc0_out_wall = heatstate%tsfc_wall
3732 END IF
3733 ! IF (StorageHeatMethod == 5 .OR. NetRadiationMethod > 1000) THEN
3734 ! tsfc_out_roof = tsfc_roof
3735 ! tsfc0_out_roof = tsfc_roof
3736 ! tsfc_out_wall = tsfc_wall
3737 ! tsfc0_out_wall = tsfc_wall
3738 ! END IF
3739 ! PRINT *, 'sfr_surf for this grid ', sfr_surf
3740 ! PRINT *, 'before iteration Ts_iter = ', Ts_iter
3741 ! L_mod_iter = 10
3742 i_iter = 1
3743 max_iter = 30
3744 DO WHILE ((.NOT. flag_converge) .AND. i_iter < max_iter)
3745 ! PRINT *, '=========================== '
3746 ! PRINT *, 'Ts_iter of ', i_iter, ' is:', Ts_iter
3747
3748 ! calculate dectime
3749 ! CALL SUEWS_cal_dectime( &
3750 ! id, it, imin, isec, & ! input
3751 ! dectime) ! output
3752 CALL suews_cal_dectime( &
3753 timer%id, timer%it, timer%imin, timer%isec, & ! input
3754 dectime) ! output
3755
3756 ! calculate tstep related VARIABLES
3757 ! CALL SUEWS_cal_tstep( &
3758 ! tstep, & ! input
3759 ! nsh, nsh_real, tstep_real) ! output
3760 CALL suews_cal_tstep( &
3761 timer%tstep, & ! input
3762 nsh, nsh_real, tstep_real) ! output
3763
3764 ! calculate surface fraction related VARIABLES
3765 ! CALL SUEWS_cal_surf( &
3766 ! StorageHeatMethod, NetRadiationMethod, & !input
3767 ! nlayer, sfr_surf, & !input
3768 ! building_frac, building_scale, height, & !input
3769 ! VegFraction, ImpervFraction, PervFraction, NonWaterFraction, & ! output
3770 ! sfr_roof, sfr_wall) ! output
3771 CALL suews_cal_surf_dts( &
3772 methodprm%StorageHeatMethod, methodprm%NetRadiationMethod, & !input
3773 nlayer, &
3774 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, & !input
3775 spartacuslayerprm%building_frac, spartacuslayerprm%building_scale, spartacusprm%height, & !input
3776 vegfraction, impervfraction, pervfraction, nonwaterfraction, & ! output
3777 sfr_roof, sfr_wall) ! output
3778
3779 ! calculate dayofweek information
3780 ! CALL SUEWS_cal_weekday( &
3781 ! iy, id, lat, & !input
3782 ! dayofWeek_id) !output
3783 CALL suews_cal_weekday( &
3784 timer%iy, timer%id, siteinfo%lat, & !input
3785 dayofweek_id) !output
3786
3787 ! calculate dayofweek information
3788 ! CALL SUEWS_cal_DLS( &
3789 ! id, startDLS, endDLS, & !input
3790 ! DLS) !output
3791 CALL suews_cal_dls( &
3792 timer%id, ahemisprm%startDLS, ahemisprm%endDLS, & !input
3793 dls) !output
3794
3795 ! calculate mean air temperature of past 24 hours
3796 ! Tair_av_next = cal_tair_av(Tair_av_prev, dt_since_start, tstep, temp_c)
3797 tair_av_next = cal_tair_av(tair_av_prev, timer%dt_since_start, timer%tstep, forcing%temp_c)
3798
3799 !==============main calculation start=======================
3800
3801 !==============surface roughness calculation=======================
3802 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_RoughnessParameters...'
3803 IF (methodprm%Diagnose == 1) print *, 'z0m_in =', z0m_in
3804 ! CALL SUEWS_cal_RoughnessParameters( &
3805 ! RoughLenMomMethod, sfr_surf, & !input
3806 ! bldgH, EveTreeH, DecTreeH, &
3807 ! porosity_id_prev, FAIBldg, FAIEveTree, FAIDecTree, &
3808 ! z0m_in, zdm_in, Z, &
3809 ! FAI, PAI, & !output
3810 ! zH, z0m, zdm, ZZD)
3811 CALL suews_cal_roughnessparameters_dts( &
3812 methodprm%RoughLenMomMethod, &
3813 methodprm%FAIMethod, &
3814 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, & !input
3815 siteinfo%SurfaceArea, &
3816 bldgprm%bldgH, evetrprm%EveTreeH, dectrprm%DecTreeH, &
3817 phenstate_prev%porosity_id, bldgprm%FAIBldg, evetrprm%FAIEveTree, dectrprm%FAIDecTree, &
3818 siteinfo%z0m_in, siteinfo%zdm_in, siteinfo%Z, &
3819 faibldg_use, faievetree_use, faidectree_use, & ! output:
3820 fai, pai, & !output
3821 zh, z0m, zdm, zzd)
3822 ! print *, 'day =', timer%id, 'hour =', timer%it, 'porosity_id = ', phenState_prev%porosity_id
3823
3824 !=================Calculate sun position=================
3825 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling NARP_cal_SunPosition...'
3826 ! CALL NARP_cal_SunPosition( &
3827 ! REAL(iy, KIND(1D0)), & !input:
3828 ! dectime - tstep/2/86400, & ! sun position at middle of timestep before
3829 ! timezone, lat, lng, alt, &
3830 ! azimuth, zenith_deg) !output:
3831 CALL narp_cal_sunposition( &
3832 REAL(timer%iy, KIND(1D0)), & !input:
3833 dectime - timer%tstep/2/86400, & ! sun position at middle of timestep before
3834 siteinfo%timezone, siteinfo%lat, siteinfo%lon, siteinfo%alt, &
3835 azimuth, zenith_deg) !output:
3836
3837 !=================Call the SUEWS_cal_DailyState routine to get surface characteristics ready=================
3838 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_DailyState...'
3839 ! CALL SUEWS_cal_DailyState( &
3840 ! iy, id, it, imin, isec, tstep, tstep_prev, dt_since_start, DayofWeek_id, & !input
3841 ! Tmin_id_prev, Tmax_id_prev, lenDay_id_prev, &
3842 ! BaseTMethod, &
3843 ! WaterUseMethod, Ie_start, Ie_end, &
3844 ! LAImethod, LAIType, &
3845 ! nsh_real, kdown, Temp_C, Precip, BaseT_HC, &
3846 ! BaseT_Heating, BaseT_Cooling, &
3847 ! lat, Faut, LAI_obs, &
3848 ! AlbMax_DecTr, AlbMax_EveTr, AlbMax_Grass, &
3849 ! AlbMin_DecTr, AlbMin_EveTr, AlbMin_Grass, &
3850 ! CapMax_dec, CapMin_dec, PorMax_dec, PorMin_dec, &
3851 ! Ie_a, Ie_m, DayWatPer, DayWat, &
3852 ! BaseT, BaseTe, GDDFull, SDDFull, LAIMin, LAIMax, LAIPower, &
3853 ! DecidCap_id_prev, StoreDrainPrm_prev, LAI_id_prev, GDD_id_prev, SDD_id_prev, &
3854 ! albDecTr_id_prev, albEveTr_id_prev, albGrass_id_prev, porosity_id_prev, & !input
3855 ! HDD_id_prev, & !input
3856 ! state_surf_prev, soilstore_surf_prev, SoilStoreCap_surf, H_maintain, & !input
3857 ! HDD_id_next, & !output
3858 ! Tmin_id_next, Tmax_id_next, lenDay_id_next, &
3859 ! albDecTr_id_next, albEveTr_id_next, albGrass_id_next, porosity_id_next, & !output
3860 ! DecidCap_id_next, StoreDrainPrm_next, LAI_id_next, GDD_id_next, SDD_id_next, WUDay_id_next) !output
3861
3862 !!! Do we need to separate the phenology parameters from the land cover parameters?
3863 CALL suews_cal_dailystate_dts( &
3864 timer%iy, timer%id, timer%it, timer%imin, timer%isec, &
3865 timer%tstep, timer%tstep_prev, timer%dt_since_start, dayofweek_id, & !input
3866 phenstate_prev%Tmin_id, phenstate_prev%Tmax_id, phenstate_prev%lenDay_id, &
3867 basetmethod, &
3868 methodprm%WaterUseMethod, irrprm%Ie_start, irrprm%Ie_end, &
3869 laimethod, &
3870 evetrprm%lai%laitype, dectrprm%lai%laitype, grassprm%lai%laitype, &
3871 nsh_real, forcing%kdown, forcing%Temp_C, forcing%rain, baset_hc, &
3872 ahemisprm%anthroheat%BaseT_Heating_working, ahemisprm%anthroheat%BaseT_Heating_holiday, &
3873 ahemisprm%anthroheat%BaseT_Cooling_working, ahemisprm%anthroheat%BaseT_Cooling_holiday, &
3874 siteinfo%lat, irrprm%Faut, forcing%LAI_obs, &
3875 evetrprm%Alb_Max, dectrprm%Alb_Max, grassprm%Alb_Max, &
3876 evetrprm%Alb_Min, dectrprm%Alb_Min, grassprm%Alb_Min, &
3877 dectrprm%CapMax_dec, dectrprm%CapMin_dec, dectrprm%PorMax_dec, dectrprm%PorMin_dec, &
3878 irrprm%Ie_a, irrprm%Ie_m, &
3879 irrprm%irr_daywater%monday_percent, irrprm%irr_daywater%tuesday_percent, &
3880 irrprm%irr_daywater%wednesday_percent, irrprm%irr_daywater%thursday_percent, &
3881 irrprm%irr_daywater%friday_percent, irrprm%irr_daywater%saturday_percent, &
3882 irrprm%irr_daywater%sunday_percent, &
3883 irrprm%irr_daywater%monday_flag, irrprm%irr_daywater%tuesday_flag, irrprm%irr_daywater%wednesday_flag, &
3884 irrprm%irr_daywater%thursday_flag, irrprm%irr_daywater%friday_flag, irrprm%irr_daywater%saturday_flag, &
3885 irrprm%irr_daywater%sunday_flag, &
3886 evetrprm%lai%BaseT, dectrprm%lai%BaseT, grassprm%lai%BaseT, & ! LAI-related input
3887 evetrprm%lai%BaseTe, dectrprm%lai%BaseTe, grassprm%lai%BaseTe, &
3888 evetrprm%lai%gddfull, dectrprm%lai%gddfull, grassprm%lai%gddfull, &
3889 evetrprm%lai%sddfull, dectrprm%lai%sddfull, grassprm%lai%sddfull, &
3890 evetrprm%lai%laimin, dectrprm%lai%laimin, grassprm%lai%laimin, &
3891 evetrprm%lai%laimax, dectrprm%lai%laimax, grassprm%lai%laimax, &
3892 evetrprm%lai%laipower, dectrprm%lai%laipower, grassprm%lai%laipower, &
3893 phenstate_prev%DecidCap_id, phenstate_prev%StoreDrainPrm, &
3894 phenstate_prev%LAI_id, phenstate_prev%GDD_id, phenstate_prev%SDD_id, &
3895 phenstate_prev%albDecTr_id, phenstate_prev%albEveTr_id, phenstate_prev%albGrass_id, phenstate_prev%porosity_id, & !input
3896 anthroheatstate_prev%HDD_id, & !input
3897 hydrostate_prev%state_surf, hydrostate_prev%soilstore_surf, soilstorecap_surf, irrprm%H_maintain, & !input
3898 anthroheatstate_next%HDD_id, & !output
3899 phenstate_next%Tmin_id, phenstate_next%Tmax_id, phenstate_next%lenDay_id, &
3900 phenstate_next%albDecTr_id, phenstate_next%albEveTr_id, phenstate_next%albGrass_id, phenstate_next%porosity_id, & !output
3901 phenstate_next%DecidCap_id, phenstate_next%StoreDrainPrm, phenstate_next%LAI_id, &
3902 phenstate_next%GDD_id, phenstate_next%SDD_id, &
3903 hydrostate_next%WUDay_id) !output
3904
3905 !=================Calculation of density and other water related parameters=================
3906 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling LUMPS_cal_AtmMoist...'
3907 ! CALL cal_AtmMoist( &
3908 ! Temp_C, Press_hPa, avRh, dectime, & ! input:
3909 ! lv_J_kg, lvS_J_kg, & ! output:
3910 ! es_hPa, Ea_hPa, VPd_hpa, VPD_Pa, dq, dens_dry, avcp, avdens)
3911 CALL cal_atmmoist( &
3912 forcing%Temp_C, forcing%pres, forcing%RH, dectime, & ! input:
3913 lv_j_kg, lvs_j_kg, & ! output:
3914 es_hpa, ea_hpa, vpd_hpa, vpd_pa, dq, dens_dry, avcp, avdens)
3915
3916 !======== Calculate soil moisture =========
3917 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling SUEWS_update_SoilMoist...'
3918 ! CALL SUEWS_update_SoilMoist( &
3919 ! NonWaterFraction, & !input
3920 ! SoilStoreCap_surf, sfr_surf, soilstore_surf_prev, &
3921 ! SoilMoistCap, SoilState, & !output
3922 ! vsmd, smd)
3923 CALL suews_update_soilmoist_dts( &
3924 nonwaterfraction, &
3925 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
3926 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, &
3927 evetrprm%soil%soilstorecap, dectrprm%soil%soilstorecap, &
3928 grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, waterprm%soil%soilstorecap, & !input
3929 hydrostate_prev%soilstore_surf, &
3930 soilmoistcap, soilstate, & !output
3931 vsmd, smd)
3932
3933 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_WaterUse...'
3934 !=================Gives the external and internal water uses per timestep=================
3935 ! CALL SUEWS_cal_WaterUse( &
3936 ! nsh_real, & ! input:
3937 ! wu_m3, SurfaceArea, sfr_surf, &
3938 ! IrrFracPaved, IrrFracBldgs, &
3939 ! IrrFracEveTr, IrrFracDecTr, IrrFracGrass, &
3940 ! IrrFracBSoil, IrrFracWater, &
3941 ! DayofWeek_id, WUProfA_24hr, WUProfM_24hr, &
3942 ! InternalWaterUse_h, HDD_id_next, WUDay_id_next, &
3943 ! WaterUseMethod, NSH, it, imin, DLS, &
3944 ! wu_surf, wu_int, wu_ext) ! output:
3945 CALL suews_cal_wateruse_dts( &
3946 nsh_real, & ! input:
3947 wu_m3, siteinfo%SurfaceArea, &
3948 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
3949 pavedprm%IrrFracPaved, bldgprm%IrrFracBldgs, &
3950 evetrprm%IrrFracEveTr, dectrprm%IrrFracDecTr, grassprm%IrrFracGrass, &
3951 bsoilprm%IrrFracBSoil, waterprm%IrrFracWater, &
3952 dayofweek_id, &
3953 irrprm%wuprofa_24hr_working, irrprm%wuprofa_24hr_holiday, &
3954 irrprm%wuprofm_24hr_working, irrprm%wuprofm_24hr_holiday, &
3955 irrprm%InternalWaterUse_h, &
3956 anthroheatstate_next%HDD_id, hydrostate_next%WUDay_id, & ! output:
3957 methodprm%WaterUseMethod, nsh, timer%it, timer%imin, dls, &
3958 wu_surf, wu_int, wu_ext)
3959
3960 ! ===================ANTHROPOGENIC HEAT AND CO2 FLUX======================
3961 ! CALL SUEWS_cal_AnthropogenicEmission( &
3962 ! AH_MIN, AHProf_24hr, AH_SLOPE_Cooling, AH_SLOPE_Heating, CO2PointSource, & ! input:
3963 ! dayofWeek_id, DLS, EF_umolCO2perJ, EmissionsMethod, EnEF_v_Jkm, &
3964 ! FcEF_v_kgkm, FrFossilFuel_Heat, FrFossilFuel_NonHeat, HDD_id_next, HumActivity_24hr, &
3965 ! imin, it, MaxFCMetab, MaxQFMetab, MinFCMetab, MinQFMetab, &
3966 ! PopDensDaytime, PopDensNighttime, PopProf_24hr, QF, QF0_BEU, Qf_A, Qf_B, Qf_C, &
3967 ! QF_obs, QF_SAHP, SurfaceArea, BaseT_Cooling, BaseT_Heating, &
3968 ! Temp_C, TrafficRate, TrafficUnits, TraffProf_24hr, &
3969 ! Fc_anthro, Fc_build, Fc_metab, Fc_point, Fc_traff) ! output:
3970
3971 CALL suews_cal_anthropogenicemission_dts( &
3972 ahemisprm%anthroheat%ah_min_working, ahemisprm%anthroheat%ah_min_holiday, &
3973 ahemisprm%anthroheat%ahprof_24hr_working, ahemisprm%anthroheat%ahprof_24hr_holiday, &
3974 ahemisprm%anthroheat%ah_slope_cooling_working, ahemisprm%anthroheat%ah_slope_cooling_holiday, &
3975 ahemisprm%anthroheat%ah_slope_heating_working, ahemisprm%anthroheat%ah_slope_heating_holiday, &
3976 siteinfo%CO2PointSource, & ! input:
3977 dayofweek_id, dls, ahemisprm%EF_umolCO2perJ, methodprm%EmissionsMethod, ahemisprm%EnEF_v_Jkm, &
3978 ahemisprm%FcEF_v_kgkm, ahemisprm%FrFossilFuel_Heat, ahemisprm%FrFossilFuel_NonHeat, &
3979 anthroheatstate_next%HDD_id, &
3980 ahemisprm%HumActivity_24hr_working, ahemisprm%HumActivity_24hr_holiday, &
3981 timer%imin, timer%it, ahemisprm%MaxFCMetab, ahemisprm%MaxQFMetab, ahemisprm%MinFCMetab, ahemisprm%MinQFMetab, &
3982 ahemisprm%anthroheat%popdensdaytime_working, ahemisprm%anthroheat%popdensdaytime_holiday, &
3983 ahemisprm%anthroheat%popdensnighttime, &
3984 ahemisprm%anthroheat%popprof_24hr_working, ahemisprm%anthroheat%popprof_24hr_holiday, &
3985 qf, &
3986 ahemisprm%anthroheat%qf0_beu_working, ahemisprm%anthroheat%qf0_beu_holiday, &
3987 ahemisprm%anthroheat%qf_a_working, ahemisprm%anthroheat%qf_a_holiday, &
3988 ahemisprm%anthroheat%qf_b_working, ahemisprm%anthroheat%qf_b_holiday, &
3989 ahemisprm%anthroheat%qf_c_working, ahemisprm%anthroheat%qf_c_holiday, &
3990 forcing%QF_obs, qf_sahp, siteinfo%SurfaceArea, &
3991 ahemisprm%anthroheat%baset_cooling_working, ahemisprm%anthroheat%baset_cooling_holiday, &
3992 ahemisprm%anthroheat%baset_heating_working, ahemisprm%anthroheat%baset_heating_holiday, &
3993 forcing%Temp_C, ahemisprm%TrafficRate_working, ahemisprm%TrafficRate_holiday, &
3994 ahemisprm%TrafficUnits, &
3995 ahemisprm%TraffProf_24hr_working, ahemisprm%TraffProf_24hr_holiday, &
3996 fc_anthro, fc_build, fc_metab, fc_point, fc_traff) ! output:
3997
3998 ! ========================================================================
3999 ! N.B.: the following parts involves snow-related calculations.
4000 ! ===================NET ALLWAVE RADIATION================================
4001 ! if (kdown>0 .and. i_iter == 1) then
4002 ! print *, 'snowFrac_prev=', snowFrac_prev
4003 ! snowFrac_prev=-999
4004 ! print *, 'snowFrac_prev=', snowFrac_prev
4005 ! endif
4006 ! CALL SUEWS_cal_Qn( &
4007 ! StorageHeatMethod, NetRadiationMethod, SnowUse, & !input
4008 ! tstep, nlayer, SnowPack_prev, tau_a, tau_f, SnowAlbMax, SnowAlbMin, &
4009 ! Diagnose, ldown_obs, fcld_obs, &
4010 ! dectime, ZENITH_deg, Ts_iter, kdown, Temp_C, avRH, ea_hPa, qn1_obs, &
4011 ! SnowAlb_prev, snowFrac_prev, DiagQN, &
4012 ! NARP_TRANS_SITE, NARP_EMIS_SNOW, IceFrac_prev, &
4013 ! sfr_surf, sfr_roof, sfr_wall, &
4014 ! tsfc_out_surf, tsfc_out_roof, tsfc_out_wall, &
4015 ! emis, alb_prev, albDecTr_id_next, albEveTr_id_next, albGrass_id_next, &
4016 ! LAI_id, & !input
4017 ! n_vegetation_region_urban, &
4018 ! n_stream_sw_urban, n_stream_lw_urban, &
4019 ! sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
4020 ! veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
4021 ! veg_fsd_const, veg_contact_fraction_const, &
4022 ! ground_albedo_dir_mult_fact, use_sw_direct_albedo, & !input
4023 ! height, building_frac, veg_frac, building_scale, veg_scale, & !input: SPARTACUS
4024 ! alb_roof, emis_roof, alb_wall, emis_wall, &
4025 ! roof_albedo_dir_mult_fact, wall_specular_frac, &
4026 ! alb_next, ldown, fcld, & !output
4027 ! QN_surf, QN_roof, QN_wall, &
4028 ! qn, qn_snowfree, qn_snow, kclear, kup, lup, tsurf, &
4029 ! qn_ind_snow, kup_ind_snow, Tsurf_ind_snow, Tsurf_ind, &
4030 ! albedo_snow, SnowAlb_next, &
4031 ! dataOutLineSPARTACUS)
4032
4033 CALL suews_cal_qn_dts( &
4034 methodprm%StorageHeatMethod, methodprm%NetRadiationMethod, methodprm%SnowUse, & !input
4035 timer%tstep, nlayer, snowstate_prev%SnowPack, snowprm%tau_a, snowprm%tau_f, snowprm%SnowAlbMax, snowprm%SnowAlbMin, &
4036 methodprm%Diagnose, forcing%ldown, forcing%fcld, &
4037 dectime, zenith_deg, ts_iter, forcing%kdown, forcing%Temp_C, forcing%RH, ea_hpa, forcing%qn1_obs, &
4038 snowstate_prev%snowalb, snowstate_prev%snowFrac, diagqn, &
4039 siteinfo%NARP_TRANS_SITE, snowprm%NARP_EMIS_SNOW, snowstate_prev%IceFrac, &
4040 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4041 sfr_roof, sfr_wall, &
4042 heatstate_out%tsfc_surf, heatstate_out%tsfc_roof, heatstate_out%tsfc_wall, &
4043 pavedprm%emis, bldgprm%emis, evetrprm%emis, dectrprm%emis, grassprm%emis, bsoilprm%emis, waterprm%emis, &
4044 phenstate_prev%alb, phenstate_next%albDecTr_id, phenstate_next%albEveTr_id, phenstate_next%albGrass_id, &
4045 phenstate%LAI_id, & !input
4046 spartacusprm%n_vegetation_region_urban, &
4047 spartacusprm%n_stream_sw_urban, spartacusprm%n_stream_lw_urban, &
4048 spartacusprm%sw_dn_direct_frac, spartacusprm%air_ext_sw, spartacusprm%air_ssa_sw, &
4049 spartacusprm%veg_ssa_sw, spartacusprm%air_ext_lw, spartacusprm%air_ssa_lw, spartacusprm%veg_ssa_lw, &
4050 spartacusprm%veg_fsd_const, spartacusprm%veg_contact_fraction_const, &
4051 spartacusprm%ground_albedo_dir_mult_fact, methodprm%use_sw_direct_albedo, & !input
4052 spartacusprm%height, spartacuslayerprm%building_frac, &
4053 spartacuslayerprm%veg_frac, spartacuslayerprm%building_scale, spartacuslayerprm%veg_scale, & !input: SPARTACUS
4054 spartacuslayerprm%alb_roof, spartacuslayerprm%emis_roof, spartacuslayerprm%alb_wall, spartacuslayerprm%emis_wall, &
4055 spartacuslayerprm%roof_albedo_dir_mult_fact, spartacuslayerprm%wall_specular_frac, &
4056 phenstate_next%alb, ldown, fcld, & !output
4057 qn_surf, qn_roof, qn_wall, &
4058 qn, qn_snowfree, qn_snow, kclear, kup, lup, tsurf, &
4059 qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, &
4060 albedo_snow, snowstate_next%SnowAlb, &
4061 dataoutlinespartacus)
4062
4063 ! IF (qn < -300) THEN
4064 ! PRINT *, 'qn=', qn
4065 ! PRINT *, 'snowFrac_prev=', snowFrac_prev
4066 ! END IF
4067
4068 ! PRINT *, 'Qn_surf after SUEWS_cal_Qn ', qn_surf
4069 ! PRINT *, 'qn_roof after SUEWS_cal_Qn ', qn_roof
4070 ! PRINT *, 'qn_wall after SUEWS_cal_Qn ', qn_wall
4071 ! PRINT *, ''
4072
4073 ! =================STORAGE HEAT FLUX=======================================
4074 IF (i_iter == 1) THEN
4075 qg_surf = 0.1*qn_surf
4076 qg_roof = 0.1*qn_roof
4077 qg_wall = 0.1*qn_wall
4078 ELSE
4079 qg_surf = qn_surf + qf - (qh_surf + qe_surf)
4080 qg_roof = qn_roof + qf - (qh_roof + qe_roof)
4081 qg_wall = qn_wall + qf - (qh_wall + qe_wall)
4082 END IF
4083
4084 ! PRINT *, 'Qg_surf before cal_qs', Qg_surf
4085 ! PRINT *, 'Qg_roof before cal_qs', Qg_roof
4086 ! PRINT *, 'Qg_wall before cal_qs', Qg_wall
4087 ! print *,''
4088
4089 ! PRINT *, 'tsfc_surf before cal_qs', tsfc_out_surf
4090 ! PRINT *, 'tsfc_out_roof before cal_qs', tsfc_out_roof
4091 ! PRINT *, 'tsfc_wall before cal_qs', tsfc_out_wall
4092 ! PRINT *, ''
4093
4094 ! CALL SUEWS_cal_Qs( &
4095 ! StorageHeatMethod, qs_obs, OHMIncQF, Gridiv, & !input
4096 ! id, tstep, dt_since_start, Diagnose, &
4097 ! nlayer, &
4098 ! Qg_surf, Qg_roof, Qg_wall, &
4099 ! tsfc_out_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, & !input
4100 ! tsfc_out_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, & !input
4101 ! tsfc_out_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_surf, & !input
4102 ! OHM_coef, OHM_threshSW, OHM_threshWD, &
4103 ! soilstore_surf_prev, SoilStoreCap_surf, state_surf_prev, SnowUse, SnowFrac_prev, DiagQS, &
4104 ! HDD_id, MetForcingData_grid, Ts5mindata_ir, qf, qn, &
4105 ! kdown, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, &
4106 ! bldgh, alb, emis, cpAnOHM, kkAnOHM, chAnOHM, EmissionsMethod, &
4107 ! Tair_av, qn_av_prev, dqndt_prev, qn_s_av_prev, dqnsdt_prev, &
4108 ! StoreDrainPrm, &
4109 ! qn_snow, dataOutLineESTM, qs, & !output
4110 ! qn_av_next, dqndt_next, qn_s_av_next, dqnsdt_next, &
4111 ! deltaQi, a1, a2, a3, &
4112 ! temp_out_roof, QS_roof, & !output
4113 ! temp_out_wall, QS_wall, & !output
4114 ! temp_out_surf, QS_surf) !output
4115 CALL suews_cal_qs_dts( &
4116 methodprm%StorageHeatMethod, forcing%qs_obs, methodprm%OHMIncQF, siteinfo%Gridiv, & !input
4117 timer%id, timer%tstep, timer%dt_since_start, methodprm%Diagnose, &
4118 nlayer, &
4119 qg_surf, qg_roof, qg_wall, &
4120 heatstate_out%tsfc_roof, ehcprm%tin_roof, &
4121 heatstate_in%temp_roof, ehcprm%k_roof, &
4122 ehcprm%cp_roof, ehcprm%dz_roof, sfr_roof, & !input
4123 heatstate_out%tsfc_wall, ehcprm%tin_wall, &
4124 heatstate_in%temp_wall, ehcprm%k_wall, &
4125 ehcprm%cp_wall, ehcprm%dz_wall, sfr_wall, & !input
4126 heatstate_out%tsfc_surf, ehcprm%tin_surf, &
4127 heatstate_in%temp_surf, ehcprm%k_surf, &
4128 ehcprm%cp_surf, ehcprm%dz_surf, &
4129 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, & !input
4130 pavedprm%ohm%ohm_coef_lc, bldgprm%ohm%ohm_coef_lc, evetrprm%ohm%ohm_coef_lc, &
4131 dectrprm%ohm%ohm_coef_lc, grassprm%ohm%ohm_coef_lc, bsoilprm%ohm%ohm_coef_lc, &
4132 waterprm%ohm%ohm_coef_lc, & !input
4133 pavedprm%ohm%ohm_threshsw, bldgprm%ohm%ohm_threshsw, evetrprm%ohm%ohm_threshsw, &
4134 dectrprm%ohm%ohm_threshsw, grassprm%ohm%ohm_threshsw, bsoilprm%ohm%ohm_threshsw, &
4135 waterprm%ohm%ohm_threshsw, & !input
4136 pavedprm%ohm%ohm_threshwd, bldgprm%ohm%ohm_threshwd, evetrprm%ohm%ohm_threshwd, &
4137 dectrprm%ohm%ohm_threshwd, grassprm%ohm%ohm_threshwd, bsoilprm%ohm%ohm_threshwd, &
4138 waterprm%ohm%ohm_threshwd, & !input
4139 hydrostate_prev%soilstore_surf, &
4140 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, &
4141 evetrprm%soil%soilstorecap, dectrprm%soil%soilstorecap, &
4142 grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, waterprm%soil%soilstorecap, & !input
4143 hydrostate_prev%state_surf, methodprm%SnowUse, snowstate_prev%SnowFrac, diagqs, &
4144 anthroheatstate%HDD_id, metforcingdata_grid, ts5mindata_ir, qf, qn, &
4145 forcing%kdown, forcing%U, forcing%temp_c, zenith_deg, forcing%RH, forcing%pres, ldown, &
4146 bldgprm%bldgh, phenstate%alb, &
4147 pavedprm%emis, bldgprm%emis, evetrprm%emis, dectrprm%emis, grassprm%emis, bsoilprm%emis, waterprm%emis, &
4148 pavedprm%ohm%cpanohm, bldgprm%ohm%cpanohm, evetrprm%ohm%cpanohm, &
4149 dectrprm%ohm%cpanohm, grassprm%ohm%cpanohm, bsoilprm%ohm%cpanohm, waterprm%ohm%cpanohm, &
4150 pavedprm%ohm%kkanohm, bldgprm%ohm%kkanohm, evetrprm%ohm%kkanohm, &
4151 dectrprm%ohm%kkanohm, grassprm%ohm%kkanohm, bsoilprm%ohm%kkanohm, waterprm%ohm%kkanohm, &
4152 pavedprm%ohm%chanohm, bldgprm%ohm%chanohm, evetrprm%ohm%chanohm, &
4153 dectrprm%ohm%chanohm, grassprm%ohm%chanohm, bsoilprm%ohm%chanohm, waterprm%ohm%chanohm, &
4154 methodprm%EmissionsMethod, &
4155 forcing%Tair, ohmstate_prev%qn_av, ohmstate_prev%dqndt, ohmstate_prev%qn_s_av, ohmstate_prev%dqnsdt, &
4156 phenstate%StoreDrainPrm, &
4157 qn_snow, dataoutlineestm, qs, & !output
4158 ohmstate_next%qn_av, ohmstate_next%dqndt, ohmstate_next%qn_s_av, ohmstate_next%dqnsdt, &
4159 deltaqi, a1, a2, a3, &
4160 heatstate_out%temp_roof, qs_roof, & !output
4161 heatstate_out%temp_wall, qs_wall, & !output
4162 heatstate_out%temp_surf, qs_surf) !output
4163 ! update iteration variables
4164 ! temp_in_roof = temp_out_roof
4165 ! temp_in_wall = temp_out_wall
4166 ! temp_in_surf = temp_out_surf
4167 ! Ts_iter = DOT_PRODUCT(tsfc_out_surf, sfr_surf)
4168 ! PRINT *, 'QS_surf after cal_qs', QS_surf
4169 ! PRINT *, 'QS_roof after cal_qs', QS_roof
4170 ! PRINT *, 'QS_wall after cal_qs', QS_wall
4171
4172 ! PRINT *, ''
4173
4174 ! PRINT *, 'tsfc_surf after cal_qs', tsfc_out_surf
4175 ! PRINT *, 'tsfc_roof after cal_qs', tsfc_out_roof
4176 ! PRINT *, 'tsfc_wall after cal_qs', tsfc_out_wall
4177 ! PRINT *, ''
4178 ! print *,'tsfc_surf abs. diff.:',maxval(abs(tsfc_out_surf-tsfc0_out_surf)),maxloc(abs(tsfc_out_surf-tsfc0_out_surf))
4179 ! dif_tsfc_iter=maxval(abs(tsfc_out_surf-tsfc0_out_surf))
4180 ! print *,'tsfc_roof abs. diff.:',maxval(abs(tsfc_out_roof-tsfc0_out_roof)),maxloc(abs(tsfc_out_roof-tsfc0_out_roof))
4181 ! dif_tsfc_iter=max(maxval(abs(tsfc_out_roof-tsfc0_out_roof)),dif_tsfc_iter)
4182 ! print *,'tsfc_wall abs. diff.:',maxval(abs(tsfc_out_wall-tsfc0_out_wall)),maxloc(abs(tsfc_out_wall-tsfc0_out_wall))
4183 ! dif_tsfc_iter=max(maxval(abs(tsfc0_out_wall-tsfc_out_wall)),dif_tsfc_iter)
4184
4185 ! tsfc0_out_surf = tsfc_out_surf
4186 ! tsfc0_out_roof = tsfc_out_roof
4187 ! tsfc0_out_wall = tsfc_out_wall
4188
4189 !==================Energy related to snow melting/freezing processes=======
4190 IF (diagnose == 1) WRITE (*, *) 'Calling MeltHeat'
4191
4192 !==========================Turbulent Fluxes================================
4193 IF (diagnose == 1) WRITE (*, *) 'Calling LUMPS_cal_QHQE...'
4194 IF (i_iter == 1) THEN
4195 !Calculate QH and QE from LUMPS in the first iteration of each time step
4196 ! CALL LUMPS_cal_QHQE( &
4197 ! veg_type, & !input
4198 ! SnowUse, qn, qf, qs, Temp_C, VegFraction, avcp, Press_hPa, lv_J_kg, &
4199 ! tstep_real, DRAINRT, nsh_real, &
4200 ! Precip, RainMaxRes, RAINCOVER, sfr_surf, LAI_id_next, LAImax, LAImin, &
4201 ! QH_LUMPS, & !output
4202 ! QE_LUMPS, psyc_hPa, s_hPa, sIce_hpa, TempVeg, VegPhenLumps)
4203 CALL lumps_cal_qhqe_dts( &
4204 lumpsprm%veg_type, & !input
4205 methodprm%SnowUse, qn, qf, qs, forcing%Temp_C, vegfraction, avcp, forcing%pres, lv_j_kg, &
4206 tstep_real, lumpsprm%drainrt, nsh_real, &
4207 forcing%rain, lumpsprm%rainmaxres, lumpsprm%raincover, &
4208 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4209 phenstate_next%LAI_id, &
4210 evetrprm%lai%laimax, dectrprm%lai%laimax, grassprm%lai%laimax, &
4211 evetrprm%lai%laimin, dectrprm%lai%laimin, grassprm%lai%laimin, &
4212 qh_lumps, & !output
4213 qe_lumps, psyc_hpa, s_hpa, sice_hpa, tempveg, vegphenlumps)
4214
4215 ! use LUMPS QH to do stability correction
4216 qh_init = qh_lumps
4217 ELSE
4218 ! use SUEWS QH to do stability correction
4219 qh_init = qh
4220 END IF
4221
4222 !============= calculate water balance =============
4223 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_Water...'
4224 ! CALL SUEWS_cal_Water( &
4225 ! Diagnose, & !input
4226 ! SnowUse, NonWaterFraction, addPipes, addImpervious, addVeg, addWaterBody, &
4227 ! state_surf_prev, sfr_surf, StoreDrainPrm_next, WaterDist, nsh_real, &
4228 ! drain_per_tstep, & !output
4229 ! drain_surf, frac_water2runoff, &
4230 ! AdditionalWater, runoffPipes, runoff_per_interval, &
4231 ! AddWater)
4232
4233 CALL suews_cal_water_dts( &
4234 methodprm%Diagnose, & !input
4235 methodprm%SnowUse, nonwaterfraction, addpipes, addimpervious, addveg, addwaterbody, &
4236 hydrostate_prev%state_surf, &
4237 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4238 phenstate_next%StoreDrainPrm, &
4239 pavedprm%waterdist%to_paved, pavedprm%waterdist%to_bldg, pavedprm%waterdist%to_evetr, &
4240 pavedprm%waterdist%to_dectr, pavedprm%waterdist%to_grass, pavedprm%waterdist%to_bsoil, pavedprm%waterdist%to_water, &
4241 pavedprm%waterdist%to_soilstore, &
4242 bldgprm%waterdist%to_paved, bldgprm%waterdist%to_bldg, bldgprm%waterdist%to_evetr, &
4243 bldgprm%waterdist%to_dectr, bldgprm%waterdist%to_grass, bldgprm%waterdist%to_bsoil, bldgprm%waterdist%to_water, &
4244 bldgprm%waterdist%to_soilstore, &
4245 evetrprm%waterdist%to_paved, evetrprm%waterdist%to_bldg, evetrprm%waterdist%to_evetr, &
4246 evetrprm%waterdist%to_dectr, evetrprm%waterdist%to_grass, evetrprm%waterdist%to_bsoil, evetrprm%waterdist%to_water, &
4247 evetrprm%waterdist%to_soilstore, &
4248 dectrprm%waterdist%to_paved, dectrprm%waterdist%to_bldg, dectrprm%waterdist%to_evetr, &
4249 dectrprm%waterdist%to_dectr, dectrprm%waterdist%to_grass, dectrprm%waterdist%to_bsoil, dectrprm%waterdist%to_water, &
4250 dectrprm%waterdist%to_soilstore, &
4251 grassprm%waterdist%to_paved, grassprm%waterdist%to_bldg, grassprm%waterdist%to_evetr, &
4252 grassprm%waterdist%to_dectr, grassprm%waterdist%to_grass, grassprm%waterdist%to_bsoil, grassprm%waterdist%to_water, &
4253 grassprm%waterdist%to_soilstore, &
4254 bsoilprm%waterdist%to_paved, bsoilprm%waterdist%to_bldg, bsoilprm%waterdist%to_evetr, &
4255 bsoilprm%waterdist%to_dectr, bsoilprm%waterdist%to_grass, bsoilprm%waterdist%to_bsoil, &
4256 bsoilprm%waterdist%to_water, &
4257 bsoilprm%waterdist%to_soilstore, &
4258 nsh_real, &
4259 drain_per_tstep, & !output
4260 drain_surf, frac_water2runoff, &
4261 additionalwater, runoffpipes, runoff_per_interval, &
4262 addwater)
4263 !============= calculate water balance end =============
4264
4265 !===============Resistance Calculations=======================
4266 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_Resistance...'
4267 ! CALL SUEWS_cal_Resistance( &
4268 ! StabilityMethod, & !input:
4269 ! Diagnose, AerodynamicResistanceMethod, RoughLenHeatMethod, SnowUse, &
4270 ! id, it, gsModel, SMDMethod, &
4271 ! avdens, avcp, QH_Init, zzd, z0m, zdm, &
4272 ! avU1, Temp_C, VegFraction, kdown, &
4273 ! Kmax, &
4274 ! g_max, g_k, g_q_base, g_q_shape, &
4275 ! g_t, g_sm, s1, s2, &
4276 ! th, tl, &
4277 ! dq, xsmd, vsmd, MaxConductance, LAIMax, LAI_id_next, SnowFrac_prev, sfr_surf, &
4278 ! g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
4279 ! UStar, TStar, L_mod, & !output
4280 ! zL, gsc, RS, RA_h, RAsnow, RB, z0v, z0vSnow)
4281 CALL suews_cal_resistance_dts( &
4282 methodprm%StabilityMethod, & !input:
4283 methodprm%Diagnose, aerodynamicresistancemethod, methodprm%RoughLenHeatMethod, methodprm%SnowUse, &
4284 timer%id, timer%it, &
4285 conductanceprm%gsModel, &
4286 methodprm%SMDMethod, &
4287 avdens, avcp, qh_init, zzd, z0m, zdm, &
4288 forcing%U, forcing%Temp_C, vegfraction, forcing%kdown, &
4289 conductanceprm%Kmax, conductanceprm%g_max, conductanceprm%g_k, conductanceprm%g_q_base, conductanceprm%g_q_shape, &
4290 conductanceprm%g_t, conductanceprm%g_sm, conductanceprm%s1, conductanceprm%s2, &
4291 conductanceprm%th, conductanceprm%tl, &
4292 dq, forcing%xsmd, vsmd, &
4293 evetrprm%maxconductance, dectrprm%maxconductance, grassprm%maxconductance, &
4294 evetrprm%lai%laimax, dectrprm%lai%laimax, grassprm%lai%laimax, &
4295 phenstate_next%LAI_id, snowstate_prev%SnowFrac, &
4296 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4297 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
4298 ustar, tstar, l_mod, & !output
4299 zl, gsc, rs, ra_h, rasnow, rb, z0v, z0vsnow)
4300
4301 !===================Resistance Calculations End=======================
4302
4303 !===================Calculate surface hydrology and related soil water=======================
4304 IF (snowuse == 1) THEN
4305
4306 ! ===================Calculate snow related hydrology=======================
4307 ! CALL SUEWS_cal_snow( &
4308 ! Diagnose, nlayer, & !input
4309 ! tstep, imin, it, EvapMethod, dayofWeek_id, CRWmin, CRWmax, &
4310 ! dectime, avdens, avcp, lv_J_kg, lvS_J_kg, avRh, Press_hPa, Temp_C, &
4311 ! RAsnow, psyc_hPa, sIce_hPa, tau_r, &
4312 ! RadMeltFact, TempMeltFact, SnowAlbMax, PrecipLimit, PrecipLimitAlb, &
4313 ! qn_ind_snow, kup_ind_snow, deltaQi, Tsurf_ind_snow, &
4314 ! SnowAlb_next, &
4315 ! PervFraction, vegfraction, addimpervious, qn_snowfree, qf, qs, vpd_hPa, s_hPa, &
4316 ! RS, RA_h, RB, SnowDensMax, snowdensmin, precip, PipeCapacity, RunoffToWater, &
4317 ! addVeg, SnowLimPaved, SnowLimBldg, &
4318 ! FlowChange, drain_surf, WetThresh_surf, SoilStoreCap_surf, &
4319 ! Tsurf_ind, sfr_surf, &
4320 ! AddWater, frac_water2runoff, StoreDrainPrm_next, SnowPackLimit, SnowProf_24hr, &
4321 ! SnowPack_prev, snowFrac_prev, SnowWater_prev, IceFrac_prev, SnowDens_prev, & ! input:
4322 ! SnowfallCum_prev, state_surf_prev, soilstore_surf_prev, & ! input:
4323 ! QN_surf, qs_surf, &
4324 ! SnowRemoval, & ! snow specific output
4325 ! SnowPack_next, SnowFrac_next, SnowWater_next, iceFrac_next, SnowDens_next, & ! output
4326 ! SnowfallCum_next, state_surf_next, soilstore_surf_next, & ! general output:
4327 ! state_per_tstep, NWstate_per_tstep, &
4328 ! qe, qe_surf, qe_roof, qe_wall, &
4329 ! SnowAlb_next, &
4330 ! swe, chSnow_per_interval, ev_per_tstep, runoff_per_tstep, &
4331 ! surf_chang_per_tstep, runoffPipes, mwstore, runoffwaterbody, &
4332 ! runoffAGveg, runoffAGimpervious, rss_surf, &
4333 ! dataOutLineSnow)
4334 CALL suews_cal_snow_dts( &
4335 methodprm%Diagnose, nlayer, & !input
4336 tstep, timer%imin, timer%it, evapmethod, dayofweek_id, snowprm%CRWmin, snowprm%CRWmax, &
4337 dectime, avdens, avcp, lv_j_kg, lvs_j_kg, forcing%RH, forcing%Pres, forcing%Temp_C, &
4338 rasnow, psyc_hpa, sice_hpa, snowprm%tau_r, &
4339 radmeltfact, tempmeltfact, snowprm%SnowAlbMax, snowprm%PrecipLimit, snowprm%PrecipLimitAlb, &
4340 qn_ind_snow, kup_ind_snow, deltaqi, tsurf_ind_snow, &
4341 snowstate_next%SnowAlb, &
4342 pervfraction, vegfraction, addimpervious, qn_snowfree, qf, qs, vpd_hpa, s_hpa, &
4343 rs, ra_h, rb, snowprm%SnowDensMax, snowprm%snowdensmin, forcing%rain, siteinfo%PipeCapacity, siteinfo%RunoffToWater, &
4344 addveg, snowprm%SnowLimPaved, snowprm%SnowLimBldg, &
4345 siteinfo%FlowChange, drain_surf, &
4346 pavedprm%wetthresh, bldgprm%wetthresh, evetrprm%wetthresh, dectrprm%wetthresh, &
4347 grassprm%wetthresh, bsoilprm%wetthresh, waterprm%wetthresh, &
4348 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, &
4349 evetrprm%soil%soilstorecap, dectrprm%soil%soilstorecap, &
4350 grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, waterprm%soil%soilstorecap, &
4351 tsurf_ind, &
4352 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4353 addwater, frac_water2runoff, phenstate_next%StoreDrainPrm, snowprm%SnowPackLimit, &
4354 snowprm%snowprof_24hr_working, snowprm%snowprof_24hr_holiday, &
4355 snowstate_prev%SnowPack, snowstate_prev%snowFrac, snowstate_prev%SnowWater, &
4356 snowstate_prev%IceFrac, snowstate_prev%SnowDens, & ! input:
4357 snowstate_prev%SnowfallCum, hydrostate_prev%state_surf, hydrostate_prev%soilstore_surf, & ! input:
4358 qn_surf, qs_surf, &
4359 snowremoval, & ! snow specific output
4360 snowstate_next%SnowPack, snowstate_next%SnowFrac, snowstate_next%SnowWater, &
4361 snowstate_next%iceFrac, snowstate_next%SnowDens, & ! output
4362 snowstate_next%SnowfallCum, hydrostate_next%state_surf, hydrostate_next%soilstore_surf, & ! general output:
4363 state_per_tstep, nwstate_per_tstep, &
4364 qe, qe_surf, qe_roof, qe_wall, &
4365 snowstate_next%SnowAlb, &
4366 swe, chsnow_per_interval, ev_per_tstep, runoff_per_tstep, &
4367 surf_chang_per_tstep, runoffpipes, mwstore, runoffwaterbody, &
4368 runoffagveg, runoffagimpervious, rss_surf, &
4369 dataoutlinesnow)
4370 ! N.B.: snow-related calculations end here.
4371 !===================================================
4372 ELSE
4373 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_QE...'
4374 !======== Evaporation and surface state_id for snow-free conditions ========
4375 ! CALL SUEWS_cal_QE( &
4376 ! Diagnose, storageheatmethod, nlayer, & !input
4377 ! tstep, &
4378 ! EvapMethod, &
4379 ! avdens, avcp, lv_J_kg, &
4380 ! psyc_hPa, &
4381 ! PervFraction, &
4382 ! addimpervious, &
4383 ! qf, vpd_hPa, s_hPa, RS, RA_h, RB, &
4384 ! precip, PipeCapacity, RunoffToWater, &
4385 ! NonWaterFraction, wu_surf, addVeg, addWaterBody, AddWater, &
4386 ! FlowChange, drain_surf, &
4387 ! frac_water2runoff, StoreDrainPrm_next, &
4388 ! sfr_surf, StateLimit_surf, SoilStoreCap_surf, WetThresh_surf, & ! input:
4389 ! state_surf_prev, soilstore_surf_prev, QN_surf, qs_surf, & ! input:
4390 ! sfr_roof, StateLimit_roof, SoilStoreCap_roof, WetThresh_roof, & ! input:
4391 ! state_roof_prev, soilstore_roof_prev, QN_roof, qs_roof, & ! input:
4392 ! sfr_wall, StateLimit_wall, SoilStoreCap_wall, WetThresh_wall, & ! input:
4393 ! state_wall_prev, soilstore_wall_prev, QN_wall, qs_wall, & ! input:
4394 ! state_surf_next, soilstore_surf_next, ev_surf, & ! general output:
4395 ! state_roof_next, soilstore_roof_next, ev_roof, & ! general output:
4396 ! state_wall_next, soilstore_wall_next, ev_wall, & ! general output:
4397 ! state_per_tstep, NWstate_per_tstep, &
4398 ! ev0_surf, qe0_surf, &
4399 ! qe, qe_surf, qe_roof, qe_wall, &
4400 ! ev_per_tstep, runoff_per_tstep, &
4401 ! surf_chang_per_tstep, runoffPipes, &
4402 ! runoffwaterbody, &
4403 ! runoffAGveg, runoffAGimpervious, rss_surf)
4404 CALL suews_cal_qe_dts( &
4405 methodprm%Diagnose, methodprm%storageheatmethod, nlayer, & !input
4406 timer%tstep, &
4407 evapmethod, &
4408 avdens, avcp, lv_j_kg, &
4409 psyc_hpa, &
4410 pervfraction, &
4411 addimpervious, &
4412 qf, vpd_hpa, s_hpa, rs, ra_h, rb, &
4413 forcing%rain, siteinfo%pipecapacity, siteinfo%runofftowater, &
4414 nonwaterfraction, wu_surf, addveg, addwaterbody, addwater, &
4415 siteinfo%flowchange, drain_surf, &
4416 frac_water2runoff, phenstate_next%StoreDrainPrm, &
4417 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4418 pavedprm%statelimit, bldgprm%statelimit, evetrprm%statelimit, &
4419 dectrprm%statelimit, grassprm%statelimit, bsoilprm%statelimit, waterprm%statelimit, &
4420 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, &
4421 evetrprm%soil%soilstorecap, dectrprm%soil%soilstorecap, &
4422 grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, waterprm%soil%soilstorecap, &
4423 pavedprm%wetthresh, bldgprm%wetthresh, evetrprm%wetthresh, &
4424 dectrprm%wetthresh, grassprm%wetthresh, bsoilprm%wetthresh, waterprm%wetthresh, &
4425 hydrostate_prev%state_surf, hydrostate_prev%soilstore_surf, qn_surf, qs_surf, & ! input:
4426 sfr_roof, ehcprm%state_limit_roof, ehcprm%soil_storecap_roof, ehcprm%wet_thresh_roof, & ! input:
4427 hydrostate_prev%state_roof, hydrostate_prev%soilstore_roof, qn_roof, qs_roof, & ! input:
4428 sfr_wall, ehcprm%state_limit_wall, ehcprm%soil_storecap_wall, ehcprm%wet_thresh_wall, & ! input:
4429 hydrostate_prev%state_wall, hydrostate_prev%soilstore_wall, qn_wall, qs_wall, & ! input:
4430 hydrostate_next%state_surf, hydrostate_next%soilstore_surf, ev_surf, & ! general output:
4431 hydrostate_next%state_roof, hydrostate_next%soilstore_roof, ev_roof, & ! general output:
4432 hydrostate_next%state_wall, hydrostate_next%soilstore_wall, ev_wall, & ! general output:
4433 state_per_tstep, nwstate_per_tstep, &
4434 ev0_surf, qe0_surf, &
4435 qe, qe_surf, qe_roof, qe_wall, &
4436 ev_per_tstep, runoff_per_tstep, &
4437 surf_chang_per_tstep, runoffpipes, &
4438 runoffwaterbody, &
4439 runoffagveg, runoffagimpervious, rss_surf)
4440 !======== Evaporation and surface state_id end========
4441 END IF
4442 ! IF (Diagnose == 1) PRINT *, 'before SUEWS_cal_SoilState soilstore_id = ', soilstore_surf_next
4443 IF (diagnose == 1) print *, 'before SUEWS_cal_SoilState soilstore_id = ', hydrostate_next%soilstore_surf
4444
4445 !=== Horizontal movement between soil stores ===
4446 ! Now water is allowed to move horizontally between the soil stores
4447 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_HorizontalSoilWater...'
4448 ! CALL SUEWS_cal_HorizontalSoilWater( &
4449 ! sfr_surf, & ! input: ! surface fractions
4450 ! SoilStoreCap_surf, & !Capacity of soil store for each surface [mm]
4451 ! SoilDepth, & !Depth of sub-surface soil store for each surface [mm]
4452 ! SatHydraulicConduct, & !Saturated hydraulic conductivity for each soil subsurface [mm s-1]
4453 ! SurfaceArea, & !Surface area of the study area [m2]
4454 ! NonWaterFraction, & ! sum of surface cover fractions for all except water surfaces
4455 ! tstep_real, & !tstep cast as a real for use in calculations
4456 ! soilstore_surf_next, & ! inout:!Soil moisture of each surface type [mm]
4457 ! runoffSoil, & !Soil runoff from each soil sub-surface [mm]
4458 ! runoffSoil_per_tstep & ! output:!Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
4459 ! )
4460 CALL suews_cal_horizontalsoilwater_dts( &
4461 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, & ! input: ! surface fractions
4462 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, evetrprm%soil%soilstorecap, &
4463 dectrprm%soil%soilstorecap, grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, &
4464 waterprm%soil%soilstorecap, & !Capacity of soil store for each surface [mm]
4465 pavedprm%soil%soildepth, bldgprm%soil%soildepth, evetrprm%soil%soildepth, &
4466 dectrprm%soil%soildepth, grassprm%soil%soildepth, bsoilprm%soil%soildepth, &
4467 waterprm%soil%soildepth, & !Depth of sub-surface soil store for each surface [mm]
4468 pavedprm%soil%sathydraulicconduct, bldgprm%soil%sathydraulicconduct, evetrprm%soil%sathydraulicconduct, &
4469 dectrprm%soil%sathydraulicconduct, grassprm%soil%sathydraulicconduct, bsoilprm%soil%sathydraulicconduct, &
4470 waterprm%soil%sathydraulicconduct, & !Saturated hydraulic conductivity for each soil subsurface [mm s-1]
4471 siteinfo%SurfaceArea, & !Surface area of the study area [m2]
4472 nonwaterfraction, & ! sum of surface cover fractions for all except water surfaces
4473 tstep_real, & !tstep cast as a real for use in calculations
4474 hydrostate_next%soilstore_surf, & ! inout:!Soil moisture of each surface type [mm]
4475 runoffsoil, & !Soil runoff from each soil sub-surface [mm]
4476 runoffsoil_per_tstep & ! output:!Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
4477 )
4478
4479 !========== Calculate soil moisture ============
4480 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_SoilState...'
4481 ! CALL SUEWS_cal_SoilState( &
4482 ! SMDMethod, xsmd, NonWaterFraction, SoilMoistCap, & !input
4483 ! SoilStoreCap_surf, surf_chang_per_tstep, &
4484 ! soilstore_surf_next, soilstore_surf_prev, sfr_surf, &
4485 ! smd, smd_nsurf, tot_chang_per_tstep, SoilState) !output
4486 CALL suews_cal_soilstate_dts( &
4487 methodprm%SMDMethod, forcing%xsmd, nonwaterfraction, soilmoistcap, & !input
4488 pavedprm%soil%soilstorecap, bldgprm%soil%soilstorecap, evetrprm%soil%soilstorecap, &
4489 dectrprm%soil%soilstorecap, grassprm%soil%soilstorecap, bsoilprm%soil%soilstorecap, &
4490 waterprm%soil%soilstorecap, & ! capacity of soil store for each surface [mm]
4491 surf_chang_per_tstep, &
4492 hydrostate_next%soilstore_surf, hydrostate_prev%soilstore_surf, &
4493 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4494 smd, smd_nsurf, tot_chang_per_tstep, soilstate) !output
4495
4496 !============ Sensible heat flux ===============
4497 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_QH...'
4498 ! CALL SUEWS_cal_QH( &
4499 ! 1, nlayer, storageheatmethod, & !input
4500 ! qn, qf, QmRain, qe, qs, QmFreez, qm, avdens, avcp, &
4501 ! sfr_surf, sfr_roof, sfr_wall, &
4502 ! tsfc_out_surf, tsfc_out_roof, tsfc_out_wall, &
4503 ! Temp_C, &
4504 ! RA_h, &
4505 ! qh, qh_residual, qh_resist, & !output
4506 ! qh_resist_surf, qh_resist_roof, qh_resist_wall)
4507
4508 CALL suews_cal_qh_dts( &
4509 1, nlayer, methodprm%StorageHeatMethod, & !input
4510 qn, qf, qmrain, qe, qs, qmfreez, qm, avdens, avcp, &
4511 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4512 sfr_roof, sfr_wall, &
4513 heatstate_out%tsfc_surf, heatstate_out%tsfc_roof, heatstate_out%tsfc_wall, &
4514 forcing%Temp_C, &
4515 ra_h, &
4516 qh, qh_residual, qh_resist, & !output
4517 qh_resist_surf, qh_resist_roof, qh_resist_wall)
4518 ! PRINT *, 'qn_surf after SUEWS_cal_QH', qn_surf
4519 ! PRINT *, 'qs_surf after SUEWS_cal_QH', qs_surf
4520 ! PRINT *, 'qe_surf after SUEWS_cal_QH', qe_surf
4521 ! PRINT *, 'qh_surf after SUEWS_cal_QH (resist)', qh_surf
4522 ! PRINT *, 'qh_roof after SUEWS_cal_QH (resist)', qh_roof
4523 ! PRINT *, 'qh_wall after SUEWS_cal_QH (resist)', qh_wall
4524 ! PRINT *, ''
4525
4526 ! PRINT *, 'tsfc_surf after SUEWS_cal_QH (resist)', tsfc_out_surf
4527 ! PRINT *, 'tsfc_roof after SUEWS_cal_QH (resist)', tsfc_out_roof
4528 ! PRINT *, 'tsfc_wall after SUEWS_cal_QH (resist)', tsfc_out_wall
4529 ! PRINT *, ''
4530 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
4531 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
4532 !============ Sensible heat flux end ===============
4533
4534 ! residual heat flux
4535 ! PRINT *, 'residual surf: ', qn_surf + qf - qs_surf - qe_surf - qh_surf
4536 ! PRINT *, 'residual roof: ', qn_roof + qf - qs_roof - qe_roof - qh_roof
4537 ! PRINT *, 'residual wall: ', qn_wall + qf - qs_wall - qe_wall - qh_wall
4538
4539 !============ Sensible heat flux end===============
4540
4541 !============ calculate surface temperature ===============
4542 tsfc_c = cal_tsfc(qh, avdens, avcp, ra_h, forcing%temp_c)
4543
4544 !============= calculate surface specific QH and Tsfc ===============
4545 ! note: tsfc has an upper limit of temp_c+50 to avoid numerical errors
4546 tsfc0_out_surf = min(heatstate_out%tsfc_surf, forcing%Temp_C + 50)
4547 tsfc0_out_roof = min(heatstate_out%tsfc_roof, forcing%Temp_C + 50)
4548 tsfc0_out_wall = min(heatstate_out%tsfc_wall, forcing%Temp_C + 50)
4549
4550 qh_surf = qn_surf + qf - qs_surf - qe_surf
4551 qh_roof = qn_roof + qf - qs_roof - qe_roof
4552 qh_wall = qn_wall + qf - qs_wall - qe_wall
4553
4554 IF (methodprm%diagnose == 1) THEN
4555 print *, 'qn_surf before QH back env.:', qn_surf
4556 print *, 'qf before QH back env.:', qf
4557 print *, 'qs_surf before QH back env.:', qs_surf
4558 print *, 'qe_surf before QH back env.:', qe_surf
4559 print *, 'qh_surf before QH back env.:', qh_surf
4560
4561 print *, 'qn_roof before QH back env.:', qn_roof
4562 print *, 'qs_roof before QH back env.:', qs_roof
4563 print *, 'qe_roof before QH back env.:', qe_roof
4564 print *, 'qh_roof before QH back env.:', qh_roof
4565
4566 END IF
4567 DO i_surf = 1, nsurf
4568 ! TSfc_QH_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, RA_h, temp_c)
4569 heatstate_out%tsfc_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, ra_h, forcing%temp_c)
4570 ! if ( i_surf==1 ) then
4571 ! tsfc_out_surf(i_surf) = cal_tsfc(qh_surf(i_surf), avdens, avcp, RA_h, temp_c)
4572 ! else
4573 ! tsfc_out_surf(i_surf)=tsfc0_out_surf(i_surf)
4574 ! end if
4575 ! restrict calculated heat storage to a sensible range
4576 ! tsfc_out_surf(i_surf) = MAX(MIN(tsfc_out_surf(i_surf), 100.0), -100.0)
4577 END DO
4578
4579 DO i_surf = 1, nlayer
4580 heatstate_out%tsfc_roof(i_surf) = cal_tsfc(qh_roof(i_surf), avdens, avcp, ra_h, forcing%temp_c)
4581 heatstate_out%tsfc_wall(i_surf) = cal_tsfc(qh_wall(i_surf), avdens, avcp, ra_h, forcing%temp_c)
4582 END DO
4583
4584 IF (methodprm%diagnose == 1) print *, 'tsfc_surf after QH back env.:', heatstate_out%tsfc_surf
4585 ! print *,'tsfc_roof after QH back env.:',tsfc_out_roof
4586 IF (methodprm%diagnose == 1) print *, &
4587 'tsfc_surf abs. diff.:', maxval(abs(heatstate_out%tsfc_surf - tsfc0_out_surf)), &
4588 maxloc(abs(heatstate_out%tsfc_surf - tsfc0_out_surf))
4589 dif_tsfc_iter = maxval(abs(heatstate_out%tsfc_surf - tsfc0_out_surf))
4590 IF (methodprm%StorageHeatMethod == 5) THEN
4591 IF (methodprm%diagnose == 1) print *, &
4592 'tsfc_roof abs. diff.:', maxval(abs(heatstate_out%tsfc_roof - tsfc0_out_roof)), &
4593 maxloc(abs(heatstate_out%tsfc_roof - tsfc0_out_roof))
4594 dif_tsfc_iter = max(maxval(abs(heatstate_out%tsfc_roof - tsfc0_out_roof)), dif_tsfc_iter)
4595 IF (methodprm%diagnose == 1) print *, &
4596 'tsfc_wall abs. diff.:', maxval(abs(heatstate_out%tsfc_wall - tsfc0_out_wall)), &
4597 maxloc(abs(heatstate_out%tsfc_wall - tsfc0_out_wall))
4598 dif_tsfc_iter = max(maxval(abs(tsfc0_out_wall - heatstate_out%tsfc_wall)), dif_tsfc_iter)
4599 END IF
4600
4601 ! ====test===
4602 ! see if this converges better
4603 ratio_iter = .4
4604 ! ratio_iter = .3
4605 heatstate_out%tsfc_surf = (tsfc0_out_surf*(1 - ratio_iter) + heatstate_out%tsfc_surf*ratio_iter)
4606 heatstate_out%tsfc_roof = (tsfc0_out_roof*(1 - ratio_iter) + heatstate_out%tsfc_roof*ratio_iter)
4607 heatstate_out%tsfc_wall = (tsfc0_out_wall*(1 - ratio_iter) + heatstate_out%tsfc_wall*ratio_iter)
4608 ! =======test end=======
4609
4610 ! PRINT *, 'tsfc_surf after qh_cal', TSfc_QH_surf
4611
4612 !============ surface-level diagonostics end ===============
4613
4614 ! force quit do-while, i.e., skip iteration and use NARP for Tsurf calculation
4615 ! if (NetRadiationMethod < 10 .or. NetRadiationMethod > 100) exit
4616
4617 ! Test if sensible heat fluxes converge in iterations
4618 ! if (abs(QH - QH_Init) > 0.1) then
4619 ! IF (ABS(Ts_iter - TSfc_C) > 0.1) THEN
4620 ! flag_converge = .FALSE.
4621 ! ELSE
4622 ! flag_converge = .TRUE.
4623 ! PRINT *, 'Iteration done in', i_iter, ' iterations'
4624 ! PRINT *, ' Ts_iter: ', Ts_iter, ' TSfc_C: ', TSfc_C
4625 ! END IF
4626 ! IF (MINVAL(ABS(TSfc_QH_surf - tsfc_surf)) > 0.1) THEN
4627 ! IF (ABS(qh_residual - qh_resist) > .2) THEN
4628 IF (dif_tsfc_iter > .1) THEN
4629 flag_converge = .false.
4630 ELSE
4631 flag_converge = .true.
4632 ! PRINT *, 'Iteration done in', i_iter, ' iterations'
4633 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
4634 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
4635 ! PRINT *, ' abs. dif_tsfc: ', dif_tsfc_iter
4636
4637 END IF
4638
4639 i_iter = i_iter + 1
4640 ! force quit do-while loop if not convergent after 100 iterations
4641 IF (methodprm%Diagnose == 1 .AND. i_iter == max_iter) THEN
4642 ! PRINT *, 'Iteration did not converge in', i_iter, ' iterations'
4643 ! PRINT *, ' qh_residual: ', qh_residual, ' qh_resist: ', qh_resist
4644 ! PRINT *, ' dif_qh: ', ABS(qh_residual - qh_resist)
4645 ! PRINT *, ' Ts_iter: ', Ts_iter, ' TSfc_C: ', TSfc_C
4646 ! PRINT *, ' abs. dif_tsfc: ', dif_tsfc_iter
4647 ! exit
4648 END IF
4649
4650 ! Ts_iter = TSfc_C
4651 ! l_mod_iter = l_mod
4652 ! PRINT *, '========================='
4653 ! PRINT *, ''
4654 !==============main calculation end=======================
4655 END DO ! end iteration for tsurf calculations
4656
4657 !==============================================================
4658 ! Calculate diagnostics: these variables are decoupled from the main SUEWS calculation
4659
4660 !============ roughness sub-layer diagonostics ===============
4661 IF (methodprm%Diagnose == 1) WRITE (*, *) 'Calling RSLProfile...'
4662 ! CALL RSLProfile( &
4663 ! DiagMethod, &
4664 ! zH, z0m, zdm, z0v, &
4665 ! L_MOD, sfr_surf, FAI, PAI, &
4666 ! StabilityMethod, RA_h, &
4667 ! avcp, lv_J_kg, avdens, &
4668 ! avU1, Temp_C, avRH, Press_hPa, z, qh, qe, & ! input
4669 ! T2_C, q2_gkg, U10_ms, RH2, & !output
4670 ! dataoutLineRSL) ! output
4671
4672 CALL rslprofile_dts( &
4673 methodprm%DiagMethod, &
4674 zh, z0m, zdm, z0v, &
4675 l_mod, &
4676 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4677 fai, pai, &
4678 methodprm%StabilityMethod, ra_h, &
4679 avcp, lv_j_kg, avdens, &
4680 forcing%U, forcing%Temp_C, forcing%RH, forcing%pres, siteinfo%z, qh, qe, & ! input
4681 t2_c, q2_gkg, u10_ms, rh2, & !output
4682 dataoutlinersl) ! output
4683
4684 ! ============ BIOGENIC CO2 FLUX =======================
4685 ! CALL SUEWS_cal_BiogenCO2( &
4686 ! alpha_bioCO2, alpha_enh_bioCO2, kdown, avRh, beta_bioCO2, beta_enh_bioCO2, & ! input:
4687 ! dectime, Diagnose, EmissionsMethod, Fc_anthro, g_max, g_k, g_q_base, g_q_shape, &
4688 ! g_t, g_sm, gfunc, gsmodel, id, it, Kmax, LAI_id_next, LAIMin, &
4689 ! LAIMax, MaxConductance, min_res_bioCO2, Press_hPa, resp_a, &
4690 ! resp_b, S1, S2, sfr_surf, SMDMethod, SnowFrac, t2_C, Temp_C, theta_bioCO2, TH, TL, vsmd, xsmd, &
4691 ! Fc, Fc_biogen, Fc_photo, Fc_respi) ! output:
4692
4693 CALL suews_cal_biogenco2_dts( &
4694 evetrprm%bioco2%alpha_bioco2, dectrprm%bioco2%alpha_bioco2, grassprm%bioco2%alpha_bioco2, &
4695 evetrprm%bioco2%alpha_enh_bioco2, dectrprm%bioco2%alpha_enh_bioco2, grassprm%bioco2%alpha_enh_bioco2, &
4696 forcing%kdown, forcing%RH, &
4697 evetrprm%bioco2%beta_bioCO2, dectrprm%bioco2%beta_bioCO2, grassprm%bioco2%beta_bioCO2, &
4698 evetrprm%bioco2%beta_enh_bioco2, dectrprm%bioco2%beta_enh_bioco2, grassprm%bioco2%beta_enh_bioco2, &
4699 dectime, methodprm%Diagnose, methodprm%EmissionsMethod, fc_anthro, &
4700 conductanceprm%g_max, conductanceprm%g_k, conductanceprm%g_q_base, conductanceprm%g_q_shape, &
4701 conductanceprm%g_t, conductanceprm%g_sm, gfunc, conductanceprm%gsmodel, &
4702 timer%id, timer%it, conductanceprm%Kmax, &
4703 phenstate_next%LAI_id, &
4704 evetrprm%lai%laimin, dectrprm%lai%laimin, grassprm%lai%laimin, &
4705 evetrprm%lai%laimax, dectrprm%lai%laimax, grassprm%lai%laimax, &
4706 evetrprm%MaxConductance, dectrprm%MaxConductance, grassprm%MaxConductance, &
4707 evetrprm%bioco2%min_res_bioCO2, dectrprm%bioco2%min_res_bioCO2, grassprm%bioco2%min_res_bioCO2, &
4708 forcing%Pres, &
4709 evetrprm%bioco2%resp_a, dectrprm%bioco2%resp_a, grassprm%bioco2%resp_a, &
4710 evetrprm%bioco2%resp_b, dectrprm%bioco2%resp_b, grassprm%bioco2%resp_b, &
4711 conductanceprm%S1, conductanceprm%S2, &
4712 pavedprm%sfr, bldgprm%sfr, evetrprm%sfr, dectrprm%sfr, grassprm%sfr, bsoilprm%sfr, waterprm%sfr, &
4713 methodprm%SMDMethod, snowstate%SnowFrac, &
4714 t2_c, forcing%Temp_C, &
4715 evetrprm%bioco2%theta_bioCO2, dectrprm%bioco2%theta_bioCO2, grassprm%bioco2%theta_bioco2, &
4716 conductanceprm%TH, conductanceprm%TL, vsmd, forcing%xsmd, &
4717 fc, fc_biogen, fc_photo, fc_respi) ! output:
4718
4719 ! calculations of diagnostics end
4720 !==============================================================
4721
4722 !==============================================================
4723 ! update inout variables with new values
4724 ohmstate%qn_av = ohmstate_next%qn_av
4725 ohmstate%dqndt = ohmstate_next%dqndt
4726 ohmstate%qn_s_av = ohmstate_next%qn_s_av
4727 ohmstate%dqnsdt = ohmstate_next%dqnsdt
4728 snowstate%SnowfallCum = snowstate_next%SnowfallCum
4729 snowstate%SnowAlb = snowstate_next%SnowAlb
4730 snowstate%IceFrac = snowstate_next%IceFrac
4731 snowstate%SnowWater = snowstate_next%SnowWater
4732 snowstate%SnowDens = snowstate_next%SnowDens
4733 snowstate%SnowFrac = snowstate_next%SnowFrac
4734 snowstate%SnowPack = snowstate_next%SnowPack
4735
4736 hydrostate%soilstore_surf = hydrostate_next%soilstore_surf
4737 hydrostate%state_surf = hydrostate_next%state_surf
4738 phenstate%alb = phenstate_next%alb
4739 phenstate%GDD_id = phenstate_next%GDD_id
4740 phenstate%SDD_id = phenstate_next%SDD_id
4741 phenstate%LAI_id = phenstate_next%LAI_id
4742 phenstate%DecidCap_id = phenstate_next%DecidCap_id
4743 phenstate%albDecTr_id = phenstate_next%albDecTr_id
4744 phenstate%albEveTr_id = phenstate_next%albEveTr_id
4745 phenstate%albGrass_id = phenstate_next%albGrass_id
4746 phenstate%porosity_id = phenstate_next%porosity_id
4747 phenstate%StoreDrainPrm = phenstate_next%StoreDrainPrm
4748 ! Tair_av = Tair_av_next
4749 forcing%Tair = tair_av_next
4750 phenstate%Tmin_id = phenstate_next%Tmin_id
4751 phenstate%Tmax_id = phenstate_next%Tmax_id
4752 phenstate%lenday_id = phenstate_next%lenday_id
4753 anthroheatstate%HDD_id = anthroheatstate_next%HDD_id
4754 hydrostate%WUDay_id = hydrostate_next%WUDay_id
4755
4756 IF (methodprm%StorageHeatMethod == 5) THEN
4757 ! ESTM_ehc related
4758 heatstate%temp_roof = heatstate_out%temp_roof
4759 heatstate%temp_wall = heatstate_out%temp_wall
4760 heatstate%temp_surf = heatstate_out%temp_surf
4761 heatstate%tsfc_roof = heatstate_out%tsfc_roof
4762 heatstate%tsfc_wall = heatstate_out%tsfc_wall
4763 heatstate%tsfc_surf = heatstate_out%tsfc_surf
4764
4765 hydrostate%soilstore_roof = hydrostate_next%soilstore_roof
4766 hydrostate%state_roof = hydrostate_next%state_roof
4767 hydrostate%soilstore_wall = hydrostate_next%soilstore_wall
4768 hydrostate%state_wall = hydrostate_next%state_wall
4769 END IF
4770
4771 !==============================================================
4772 ! update inout variables with new values (to be compatible with original interface)
4773 tair_av = tair_av_next
4774
4775 qn_av = ohmstate_next%qn_av
4776 dqndt = ohmstate_next%dqndt
4777 qn_s_av = ohmstate_next%qn_s_av
4778 dqnsdt = ohmstate_next%dqnsdt
4779
4780 snowfallcum = snowstate_next%SnowfallCum
4781 snowalb = snowstate_next%SnowAlb
4782 icefrac = snowstate_next%IceFrac
4783 snowwater = snowstate_next%SnowWater
4784 snowdens = snowstate_next%SnowDens
4785 snowfrac = snowstate_next%SnowFrac
4786 snowpack = snowstate_next%SnowPack
4787
4788 soilstore_surf = hydrostate_next%soilstore_surf
4789 state_surf = hydrostate_next%state_surf
4790 wuday_id = hydrostate_next%WUDay_id
4791
4792 alb = phenstate_next%alb
4793 gdd_id = phenstate_next%GDD_id
4794 sdd_id = phenstate_next%SDD_id
4795 lai_id = phenstate_next%LAI_id
4796 tmin_id = phenstate_next%Tmin_id
4797 tmax_id = phenstate_next%Tmax_id
4798 lenday_id = phenstate_next%lenday_id
4799 decidcap_id = phenstate_next%DecidCap_id
4800 albdectr_id = phenstate_next%albDecTr_id
4801 albevetr_id = phenstate_next%albEveTr_id
4802 albgrass_id = phenstate_next%albGrass_id
4803 porosity_id = phenstate_next%porosity_id
4804 storedrainprm = phenstate_next%StoreDrainPrm
4805 ! Tair_av = Tair_av_next
4806
4807 hdd_id = anthroheatstate_next%HDD_id
4808
4809 IF (methodprm%StorageHeatMethod == 5) THEN
4810 ! ESTM_ehc related
4811 temp_roof = heatstate_out%temp_roof
4812 temp_wall = heatstate_out%temp_wall
4813 temp_surf = heatstate_out%temp_surf
4814 tsfc_roof = heatstate_out%tsfc_roof
4815 tsfc_wall = heatstate_out%tsfc_wall
4816 tsfc_surf = heatstate_out%tsfc_surf
4817
4818 soilstore_roof = hydrostate_next%soilstore_roof
4819 state_roof = hydrostate_next%state_roof
4820 soilstore_wall = hydrostate_next%soilstore_wall
4821 state_wall = hydrostate_next%state_wall
4822 END IF
4823
4824 !==============use SOLWEIG to get localised radiation flux==================
4825 ! if (sfr_surf(BldgSurf) > 0) then
4826 ! CALL SOLWEIG_cal_main(id, it, dectime, 0.8d0, FAI, avkdn, ldown, Temp_C, avRh, Press_hPa, TSfc_C, &
4827 ! lat, ZENITH_deg, azimuth, 1.d0, alb(1), alb(2), emis(1), emis(2), bldgH, dataOutLineSOLWEIG)
4828 ! else
4829 ! dataOutLineSOLWEIG = set_nan(dataOutLineSOLWEIG)
4830 ! endif
4831
4832 !==============use BEERS to get localised radiation flux==================
4833 ! TS 14 Jan 2021: BEERS is a modified version of SOLWEIG
4834 IF (sfr_surf(bldgsurf) > 0) THEN
4835 pai = sfr_surf(2)/sum(sfr_surf(1:2))
4836 ! CALL BEERS_cal_main(iy, id, dectime, PAI, FAI, kdown, ldown, Temp_C, avrh, &
4837 ! Press_hPa, TSfc_C, lat, lng, alt, timezone, zenith_deg, azimuth, &
4838 ! alb(1), alb(2), emis(1), emis(2), &
4839 ! dataOutLineBEERS) ! output
4840 CALL beers_cal_main(timer%iy, timer%id, dectime, pai, fai, forcing%kdown, ldown, forcing%Temp_C, forcing%RH, &
4841 forcing%Pres, tsfc_c, siteinfo%lat, siteinfo%lon, siteinfo%alt, siteinfo%timezone, zenith_deg, azimuth, &
4842 phenstate%alb(1), phenstate%alb(2), pavedprm%emis, bldgprm%emis, &
4843 dataoutlinebeers) ! output
4844 ! CALL SOLWEIG_cal_main(id, it, dectime, 0.8d0, FAI, avkdn, ldown, Temp_C, avRh, Press_hPa, TSfc_C, &
4845 ! lat, ZENITH_deg, azimuth, 1.d0, alb(1), alb(2), emis(1), emis(2), bldgH, dataOutLineSOLWEIG)
4846 ELSE
4847 dataoutlinebeers = set_nan(dataoutlinebeers)
4848 END IF
4849
4850 !==============translation of output variables into output array===========
4851 ! CALL SUEWS_update_outputLine( &
4852 ! AdditionalWater, alb, kdown, U10_ms, azimuth, & !input
4853 ! chSnow_per_interval, dectime, &
4854 ! drain_per_tstep, QE_LUMPS, ev_per_tstep, wu_ext, Fc, Fc_build, fcld, &
4855 ! Fc_metab, Fc_photo, Fc_respi, Fc_point, Fc_traff, FlowChange, &
4856 ! QH_LUMPS, id, imin, wu_int, it, iy, &
4857 ! kup, LAI_id, ldown, l_mod, lup, mwh, &
4858 ! MwStore, &
4859 ! nsh_real, NWstate_per_tstep, Precip, q2_gkg, &
4860 ! qe, qf, qh, qh_resist, Qm, QmFreez, &
4861 ! QmRain, qn, qn_snow, qn_snowfree, qs, RA_h, &
4862 ! RS, RH2, runoffAGimpervious, runoffAGveg, &
4863 ! runoff_per_tstep, runoffPipes, runoffSoil_per_tstep, &
4864 ! runoffWaterBody, sfr_surf, smd, smd_nsurf, SnowAlb, SnowRemoval, &
4865 ! state_surf_next, state_per_tstep, surf_chang_per_tstep, swe, t2_C, TSfc_C, &
4866 ! tot_chang_per_tstep, tsurf, UStar, &
4867 ! wu_surf, &
4868 ! z0m, zdm, zenith_deg, &
4869 ! datetimeLine, dataOutLineSUEWS) !output
4870 CALL suews_update_outputline( &
4871 additionalwater, phenstate%alb, forcing%kdown, u10_ms, azimuth, & !input
4872 chsnow_per_interval, dectime, &
4873 drain_per_tstep, qe_lumps, ev_per_tstep, wu_ext, fc, fc_build, fcld, &
4874 fc_metab, fc_photo, fc_respi, fc_point, fc_traff, siteinfo%FlowChange, &
4875 qh_lumps, timer%id, timer%imin, wu_int, timer%it, timer%iy, &
4876 kup, phenstate%LAI_id, ldown, l_mod, lup, mwh, &
4877 mwstore, &
4878 nsh_real, nwstate_per_tstep, precip, q2_gkg, &
4879 qe, qf, qh, qh_resist, qm, qmfreez, &
4880 qmrain, qn, qn_snow, qn_snowfree, qs, ra_h, &
4881 rs, rh2, runoffagimpervious, runoffagveg, &
4882 runoff_per_tstep, runoffpipes, runoffsoil_per_tstep, &
4883 runoffwaterbody, &
4884 sfr_surf, &
4885 smd, smd_nsurf, snowstate%SnowAlb, snowremoval, &
4886 hydrostate%state_surf, state_per_tstep, surf_chang_per_tstep, swe, t2_c, tsfc_c, &
4887 tot_chang_per_tstep, tsurf, ustar, &
4888 wu_surf, &
4889 z0m, zdm, zenith_deg, &
4890 datetimeline, dataoutlinesuews) !output
4891
4892 ! CALL EHC_update_outputLine( &
4893 ! iy, id, it, imin, dectime, nlayer, & !input
4894 ! tsfc_out_surf, qs_surf, &
4895 ! tsfc_out_roof, &
4896 ! QN_roof, &
4897 ! QS_roof, &
4898 ! QE_roof, &
4899 ! QH_roof, &
4900 ! state_roof, &
4901 ! soilstore_roof, &
4902 ! tsfc_out_wall, &
4903 ! QN_wall, &
4904 ! QS_wall, &
4905 ! QE_wall, &
4906 ! QH_wall, &
4907 ! state_wall, &
4908 ! soilstore_wall, &
4909 ! datetimeLine, dataOutLineEHC) !output
4910 CALL ehc_update_outputline( &
4911 timer%iy, timer%id, timer%it, timer%imin, dectime, nlayer, & !input
4912 heatstate_out%tsfc_surf, qs_surf, &
4913 heatstate_out%tsfc_roof, &
4914 qn_roof, &
4915 qs_roof, &
4916 qe_roof, &
4917 qh_roof, &
4918 hydrostate%state_roof, &
4919 hydrostate%soilstore_roof, &
4920 heatstate_out%tsfc_wall, &
4921 qn_wall, &
4922 qs_wall, &
4923 qe_wall, &
4924 qh_wall, &
4925 hydrostate%state_wall, &
4926 hydrostate%soilstore_wall, &
4927 datetimeline, dataoutlineehc) !output
4928
4929 ! daily state_id:
4930 ! CALL update_DailyStateLine( &
4931 ! it, imin, nsh_real, & !input
4932 ! GDD_id, HDD_id, LAI_id, &
4933 ! SDD_id, &
4934 ! Tmin_id, Tmax_id, lenday_id, &
4935 ! DecidCap_id, &
4936 ! albDecTr_id, &
4937 ! albEveTr_id, &
4938 ! albGrass_id, &
4939 ! porosity_id, &
4940 ! WUDay_id, &
4941 ! VegPhenLumps, &
4942 ! SnowAlb, SnowDens, &
4943 ! a1, a2, a3, &
4944 ! dataOutLineDailyState) !out
4945 CALL update_dailystateline( &
4946 timer%it, timer%imin, nsh_real, & !input
4947 phenstate%GDD_id, anthroheatstate%HDD_id, phenstate%LAI_id, &
4948 phenstate%SDD_id, &
4949 phenstate%Tmin_id, phenstate%Tmax_id, phenstate%lenday_id, &
4950 phenstate%DecidCap_id, &
4951 phenstate%albDecTr_id, &
4952 phenstate%albEveTr_id, &
4953 phenstate%albGrass_id, &
4954 phenstate%porosity_id, &
4955 hydrostate%WUDay_id, &
4956 vegphenlumps, &
4957 snowstate%SnowAlb, snowstate%SnowDens, &
4958 a1, a2, a3, &
4959 dataoutlinedailystate) !out
4960
4961 !==============translation end ================
4962
4963 dataoutlinedebug = &
4964 [tsfc0_out_surf, &
4965 qn_surf, qs_surf, qe0_surf, qe_surf, qh_surf, & ! energy balance
4966 wu_surf, ev0_surf, ev_surf, drain_surf, &
4967 hydrostate_prev%state_surf, hydrostate_next%state_surf, &
4968 hydrostate_prev%soilstore_surf, hydrostate_next%soilstore_surf, & ! water balance
4969 rs, ra_h, rb, rasnow, rss_surf, & ! for debugging QE
4970 vsmd, s1/g_sm + s2, g_sm, g_sm*(vsmd - s1/g_sm + s2), & ! debug g_smd
4971 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! for debugging RS: surface resistance
4972 vpd_hpa, lv_j_kg, avdens, avcp, s_hpa, psyc_hpa, & ! for debugging QE
4973 i_iter*1d0, &
4974 faibldg_use, faievetree_use, faidectree_use, fai, &
4975 ohmstate%dqndt]
4976
4977 !==============output==========================
4978 CALL output_line_init(output_line_suews)
4979 output_line_suews%datetimeLine = datetimeline
4980 output_line_suews%dataOutLineSUEWS = [datetimeline, dataoutlinesuews]
4981 output_line_suews%dataOutLineEHC = [datetimeline, dataoutlineehc]
4982 output_line_suews%dataOutLineDailyState = [datetimeline, dataoutlinedailystate]
4983 output_line_suews%dataOutLineBEERS = [datetimeline, dataoutlinebeers]
4984 output_line_suews%dataOutLineDebug = [datetimeline, dataoutlinedebug]
4985 output_line_suews%dataOutLineSPARTACUS = [datetimeline, dataoutlinespartacus]
4986 output_line_suews%dataOutLineSnow = [datetimeline, dataoutlinesnow]
4987 output_line_suews%dataoutLineRSL = [datetimeline, dataoutlinersl]
4988 output_line_suews%dataOutLineESTM = [datetimeline, dataoutlineestm]
4989

References moist::avcp, moist::avdens, beers_module::beers_cal_main(), allocatearray::bldgsurf, allocatearray::bsoilsurf, atmmoiststab_module::cal_atmmoist(), cal_tair_av(), cal_tsfc(), allocatearray::conifsurf, allocatearray::decidsurf, ehc_update_outputline(), allocatearray::grasssurf, allocatearray::ivconif, allocatearray::ivdecid, allocatearray::ivgrass, lumps_module::lumps_cal_qhqe_dts(), moist::lv_j_kg, narp_module::narp_cal_sunposition(), allocatearray::ndepth, allocatearray::nspec, allocatearray::nsurf, output_line_init(), allocatearray::pavsurf, rsl_module::rslprofile_dts(), set_nan(), suews_cal_anthropogenicemission_dts(), suews_cal_biogenco2_dts(), dailystate_module::suews_cal_dailystate_dts(), beers_module::suews_cal_dectime(), beers_module::suews_cal_dls(), waterdist_module::suews_cal_horizontalsoilwater_dts(), suews_cal_qe_dts(), suews_cal_qh_dts(), suews_cal_qn_dts(), suews_cal_qs_dts(), suews_cal_resistance_dts(), resist_module::suews_cal_roughnessparameters_dts(), suews_cal_snow_dts(), waterdist_module::suews_cal_soilstate_dts(), suews_cal_surf_dts(), beers_module::suews_cal_tstep(), suews_cal_water_dts(), waterdist_module::suews_cal_wateruse_dts(), beers_module::suews_cal_weekday(), suews_update_outputline(), waterdist_module::suews_update_soilmoist_dts(), dailystate_module::update_dailystateline(), and allocatearray::watersurf.

Referenced by suews_cal_multitsteps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_multitsteps()

subroutine suews_driver::suews_cal_multitsteps ( real(kind(1d0)), dimension(len_sim, 24), intent(in) metforcingblock,
integer, intent(in) len_sim,
real(kind(1d0)), dimension(2), intent(in) ah_min,
real(kind(1d0)), dimension(0:23, 2), intent(in) ahprof_24hr,
real(kind(1d0)), dimension(2), intent(in) ah_slope_cooling,
real(kind(1d0)), dimension(2), intent(in) ah_slope_heating,
real(kind(1d0)), dimension(nsurf), intent(inout) alb,
real(kind(1d0)), intent(in) albmax_dectr,
real(kind(1d0)), intent(in) albmax_evetr,
real(kind(1d0)), intent(in) albmax_grass,
real(kind(1d0)), intent(in) albmin_dectr,
real(kind(1d0)), intent(in) albmin_evetr,
real(kind(1d0)), intent(in) albmin_grass,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) alpha_enh_bioco2,
real(kind(1d0)), intent(in) alt,
real(kind(1d0)), dimension(nvegsurf), intent(in) baset,
real(kind(1d0)), dimension(nvegsurf), intent(in) basete,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_bioco2,
real(kind(1d0)), dimension(nvegsurf), intent(in) beta_enh_bioco2,
real(kind(1d0)), intent(in) bldgh,
real(kind(1d0)), intent(in) capmax_dec,
real(kind(1d0)), intent(in) capmin_dec,
real(kind(1d0)), dimension(nsurf), intent(in) chanohm,
real(kind(1d0)), intent(in) co2pointsource,
real(kind(1d0)), dimension(nsurf), intent(in) cpanohm,
real(kind(1d0)), intent(in) crwmax,
real(kind(1d0)), intent(in) crwmin,
real(kind(1d0)), dimension(7), intent(in) daywat,
real(kind(1d0)), dimension(7), intent(in) daywatper,
real(kind(1d0)), intent(in) dectreeh,
integer, intent(in) diagmethod,
integer, intent(inout) diagnose,
real(kind(1d0)), intent(in) drainrt,
integer, intent(inout) dt_since_start,
real(kind(1d0)), intent(inout) dqndt,
real(kind(1d0)), intent(inout) qn_av,
real(kind(1d0)), intent(inout) dqnsdt,
real(kind(1d0)), intent(inout) qn_s_av,
real(kind(1d0)), intent(in) ef_umolco2perj,
real(kind(1d0)), dimension(nsurf), intent(in) emis,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) enef_v_jkm,
integer, intent(in) enddls,
real(kind(1d0)), intent(in) evetreeh,
real(kind(1d0)), intent(in) faibldg,
real(kind(1d0)), intent(in) faidectree,
real(kind(1d0)), intent(in) faievetree,
integer, intent(in) faimethod,
real(kind(1d0)), intent(in) faut,
real(kind(1d0)), dimension(2), intent(in) fcef_v_kgkm,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), intent(in) frfossilfuel_heat,
real(kind(1d0)), intent(in) frfossilfuel_nonheat,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), dimension(nvegsurf), intent(inout) gdd_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) gddfull,
integer, intent(in) gridiv,
integer, intent(in) gsmodel,
real(kind(1d0)), intent(in) h_maintain,
real(kind(1d0)), dimension(12), intent(inout) hdd_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) humactivity_24hr,
real(kind(1d0)), dimension(nsurf), intent(inout) icefrac,
real(kind(1d0)), dimension(3), intent(in) ie_a,
integer, intent(in) ie_end,
real(kind(1d0)), dimension(3), intent(in) ie_m,
integer, intent(in) ie_start,
real(kind(1d0)), intent(in) internalwateruse_h,
real(kind(1d0)), intent(in) irrfracpaved,
real(kind(1d0)), intent(in) irrfracbldgs,
real(kind(1d0)), intent(in) irrfracevetr,
real(kind(1d0)), intent(in) irrfracdectr,
real(kind(1d0)), intent(in) irrfracgrass,
real(kind(1d0)), intent(in) irrfracbsoil,
real(kind(1d0)), intent(in) irrfracwater,
real(kind(1d0)), dimension(nsurf), intent(in) kkanohm,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), dimension(nvegsurf), intent(inout) lai_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimax,
real(kind(1d0)), dimension(nvegsurf), intent(in) laimin,
real(kind(1d0)), dimension(4, nvegsurf), intent(in) laipower,
integer, dimension(nvegsurf), intent(in) laitype,
real(kind(1d0)), intent(in) lat,
real(kind(1d0)), intent(in) lng,
real(kind(1d0)), dimension(3), intent(in) maxconductance,
real(kind(1d0)), intent(in) maxfcmetab,
real(kind(1d0)), intent(in) maxqfmetab,
real(kind(1d0)), dimension(nsurf), intent(inout) snowwater,
real(kind(1d0)), intent(in) minfcmetab,
real(kind(1d0)), intent(in) minqfmetab,
real(kind(1d0)), dimension(nvegsurf), intent(in) min_res_bioco2,
real(kind(1d0)), intent(in) narp_emis_snow,
real(kind(1d0)), intent(in) narp_trans_site,
integer, intent(in) netradiationmethod,
real(kind(1d0)), dimension(nsurf + 1, 4, 3), intent(in) ohm_coef,
integer, intent(in) ohmincqf,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshsw,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshwd,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), dimension(2), intent(in) popdensdaytime,
real(kind(1d0)), intent(in) popdensnighttime,
real(kind(1d0)), dimension(0:23, 2), intent(in) popprof_24hr,
real(kind(1d0)), intent(in) pormax_dec,
real(kind(1d0)), intent(in) pormin_dec,
real(kind(1d0)), intent(in) preciplimit,
real(kind(1d0)), intent(in) preciplimitalb,
real(kind(1d0)), dimension(2), intent(in) qf0_beu,
real(kind(1d0)), dimension(2), intent(in) qf_a,
real(kind(1d0)), dimension(2), intent(in) qf_b,
real(kind(1d0)), dimension(2), intent(in) qf_c,
integer, intent(in) nlayer,
integer, intent(in) n_vegetation_region_urban,
integer, intent(in) n_stream_sw_urban,
integer, intent(in) n_stream_lw_urban,
real(kind(1d0)), intent(in) sw_dn_direct_frac,
real(kind(1d0)), intent(in) air_ext_sw,
real(kind(1d0)), intent(in) air_ssa_sw,
real(kind(1d0)), intent(in) veg_ssa_sw,
real(kind(1d0)), intent(in) air_ext_lw,
real(kind(1d0)), intent(in) air_ssa_lw,
real(kind(1d0)), intent(in) veg_ssa_lw,
real(kind(1d0)), intent(in) veg_fsd_const,
real(kind(1d0)), intent(in) veg_contact_fraction_const,
real(kind(1d0)), intent(in) ground_albedo_dir_mult_fact,
logical, intent(in) use_sw_direct_albedo,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) veg_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer), intent(in) veg_scale,
real(kind(1d0)), dimension(nlayer), intent(in) alb_roof,
real(kind(1d0)), dimension(nlayer), intent(in) emis_roof,
real(kind(1d0)), dimension(nlayer), intent(in) alb_wall,
real(kind(1d0)), dimension(nlayer), intent(in) emis_wall,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) roof_albedo_dir_mult_fact,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) wall_specular_frac,
real(kind(1d0)), intent(in) radmeltfact,
real(kind(1d0)), intent(in) raincover,
real(kind(1d0)), intent(in) rainmaxres,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_a,
real(kind(1d0)), dimension(nvegsurf), intent(in) resp_b,
integer, intent(in) roughlenheatmethod,
integer, intent(in) roughlenmommethod,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), dimension(nsurf), intent(in) sathydraulicconduct,
real(kind(1d0)), dimension(nvegsurf), intent(in) sddfull,
real(kind(1d0)), dimension(nvegsurf), intent(inout) sdd_id,
integer, intent(in) smdmethod,
real(kind(1d0)), intent(inout) snowalb,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) snowalbmin,
real(kind(1d0)), dimension(nsurf), intent(in) snowpacklimit,
real(kind(1d0)), dimension(nsurf), intent(inout) snowdens,
real(kind(1d0)), intent(in) snowdensmax,
real(kind(1d0)), intent(in) snowdensmin,
real(kind(1d0)), intent(inout) snowfallcum,
real(kind(1d0)), dimension(nsurf), intent(inout) snowfrac,
real(kind(1d0)), intent(in) snowlimbldg,
real(kind(1d0)), intent(in) snowlimpaved,
real(kind(1d0)), dimension(nsurf), intent(inout) snowpack,
real(kind(1d0)), dimension(0:23, 2), intent(in) snowprof_24hr,
integer, intent(in) snowuse,
real(kind(1d0)), dimension(nsurf), intent(in) soildepth,
integer, intent(in) stabilitymethod,
integer, intent(in) startdls,
real(kind(1d0)), dimension(nsurf), intent(inout) soilstore_surf,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap_surf,
real(kind(1d0)), dimension(nsurf), intent(inout) state_surf,
real(kind(1d0)), dimension(nsurf), intent(in) statelimit_surf,
real(kind(1d0)), dimension(nsurf), intent(in) wetthresh_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) state_roof,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_roof,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) soilstore_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_wall,
real(kind(1d0)), dimension(nlayer), intent(inout) state_wall,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_wall,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_wall,
integer, intent(in) storageheatmethod,
real(kind(1d0)), dimension(6, nsurf), intent(inout) storedrainprm,
real(kind(1d0)), intent(in) surfacearea,
real(kind(1d0)), intent(inout) tair_av,
real(kind(1d0)), intent(in) tau_a,
real(kind(1d0)), intent(in) tau_f,
real(kind(1d0)), intent(in) tau_r,
real(kind(1d0)), dimension(2), intent(in) baset_cooling,
real(kind(1d0)), dimension(2), intent(in) baset_heating,
real(kind(1d0)), intent(in) tempmeltfact,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), dimension(nvegsurf), intent(in) theta_bioco2,
real(kind(1d0)), intent(in) timezone,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), dimension(2), intent(in) trafficrate,
real(kind(1d0)), intent(in) trafficunits,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(inout) tsfc_wall,
real(kind(1d0)), dimension(nsurf), intent(inout) tsfc_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(inout) temp_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(inout) temp_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tin_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tin_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tin_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_roof,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) k_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_roof,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) cp_surf,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_roof,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) dz_surf,
real(kind(1d0)), intent(inout) tmin_id,
real(kind(1d0)), intent(inout) tmax_id,
real(kind(1d0)), intent(inout) lenday_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) traffprof_24hr,
real(kind(1d0)), dimension(:), intent(in) ts5mindata_ir,
integer, intent(in) tstep,
integer, intent(in) tstep_prev,
integer, intent(in) veg_type,
real(kind(1d0)), dimension(nsurf + 1, nsurf - 1), intent(in) waterdist,
integer, intent(in) waterusemethod,
real(kind(1d0)), dimension(9), intent(inout) wuday_id,
real(kind(1d0)), intent(inout) decidcap_id,
real(kind(1d0)), intent(inout) albdectr_id,
real(kind(1d0)), intent(inout) albevetr_id,
real(kind(1d0)), intent(inout) albgrass_id,
real(kind(1d0)), intent(inout) porosity_id,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofa_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in) wuprofm_24hr,
real(kind(1d0)), intent(in) z,
real(kind(1d0)), intent(in) z0m_in,
real(kind(1d0)), intent(in) zdm_in,
type(output_block), intent(out) output_block_suews )

Definition at line 10090 of file suews_ctrl_driver.f95.

10154 ! dataOutBlockSUEWS, dataOutBlockSnow, dataOutBlockESTM, dataOutBlockRSL, dataOutBlockBEERS, & !output
10155 ! dataOutBlockDebug, dataOutBlockSPARTACUS, dataOutBlockEHC, &
10156 ! DailyStateBlock)
10157
10158 IMPLICIT NONE
10159 ! input:
10160 ! met forcing block
10161 REAL(KIND(1D0)), DIMENSION(len_sim, 24), INTENT(IN) :: MetForcingBlock
10162 INTEGER, INTENT(IN) :: len_sim
10163 ! input variables
10164 INTEGER, INTENT(IN) :: nlayer ! number of vertical layers in urban canyon
10165 ! INTEGER, INTENT(IN) :: AerodynamicResistanceMethod !method to calculate RA [-]
10166 ! INTEGER, INTENT(IN) :: Diagnose
10167 INTEGER, INTENT(INOUT) :: Diagnose
10168 ! INTEGER, INTENT(IN) :: DiagQN
10169 ! INTEGER, INTENT(IN) :: DiagQS
10170 INTEGER, INTENT(IN) :: startDLS !start of daylight saving [DOY]
10171 INTEGER, INTENT(IN) :: endDLS !end of daylight saving [DOY]
10172 INTEGER, INTENT(IN) :: EmissionsMethod !method to calculate anthropogenic heat [-]
10173 INTEGER, INTENT(IN) :: Gridiv ! grid id [-]
10174 INTEGER, INTENT(IN) :: gsModel !choice of gs parameterisation (1 = Ja11, 2 = Wa16)
10175 INTEGER, INTENT(IN) :: Ie_end !ending time of water use [DOY]
10176 INTEGER, INTENT(IN) :: Ie_start !starting time of water use [DOY]
10177 ! INTEGER, INTENT(IN) :: LAICalcYes !boolean to determine if calculate LAI [-]
10178 INTEGER, INTENT(in) :: DiagMethod !Defines how near surface diagnostics are calculated [-]
10179 INTEGER, INTENT(IN) :: NetRadiationMethod ! method for calculation of radiation fluxes [-]
10180 INTEGER, INTENT(IN) :: OHMIncQF !Determines whether the storage heat flux calculation uses Q* or ( Q* +QF) [-]
10181 INTEGER, INTENT(IN) :: RoughLenHeatMethod !method to calculate heat roughness length [-]
10182 INTEGER, INTENT(IN) :: RoughLenMomMethod !Determines how aerodynamic roughness length (z0m) and zero displacement height (zdm) are calculated [-]
10183 INTEGER, INTENT(IN) :: FAIMethod !Determines how FAI is calculated [-]
10184 INTEGER, INTENT(IN) :: SMDMethod !Determines method for calculating soil moisture deficit [-]
10185 INTEGER, INTENT(IN) :: SnowUse !Determines whether the snow part of the model runs[-]
10186 INTEGER, INTENT(IN) :: StabilityMethod !method to calculate atmospheric stability [-]
10187 INTEGER, INTENT(IN) :: StorageHeatMethod !Determines method for calculating storage heat flux ΔQS [-]
10188 INTEGER, INTENT(IN) :: tstep !timestep [s]
10189 INTEGER, INTENT(IN) :: tstep_prev ! tstep size of the previous step
10190 ! dt_since_start is intentionally made as inout to keep naming consistency with the embedded subroutine
10191 INTEGER, INTENT(inout) :: dt_since_start ! time since simulation starts [s]
10192 INTEGER, INTENT(IN) :: veg_type !Defines how vegetation is calculated for LUMPS [-]
10193 INTEGER, INTENT(IN) :: WaterUseMethod !Defines how external water use is calculated[-]
10194
10195 INTEGER, DIMENSION(NVEGSURF), INTENT(IN) :: LAIType !LAI calculation choice[-]
10196
10197 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_DecTr !maximum albedo for deciduous tree and shrub [-]
10198 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_EveTr !maximum albedo for evergreen tree and shrub [-]
10199 REAL(KIND(1D0)), INTENT(IN) :: AlbMax_Grass !maximum albedo for grass [-]
10200 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_DecTr !minimum albedo for deciduous tree and shrub [-]
10201 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_EveTr !minimum albedo for evergreen tree and shrub [-]
10202 REAL(KIND(1D0)), INTENT(IN) :: AlbMin_Grass !minimum albedo for grass [-]
10203 REAL(KIND(1D0)), INTENT(IN) :: alt !solar altitude [deg]
10204 ! REAL(KIND(1D0)),INTENT(IN)::avkdn
10205 ! REAL(KIND(1D0)),INTENT(IN)::avRh
10206 ! REAL(KIND(1D0)),INTENT(IN)::avU1
10207 REAL(KIND(1D0)), INTENT(IN) :: bldgH !average building height [m]
10208 REAL(KIND(1D0)), INTENT(IN) :: CapMax_dec !maximum water storage capacity for upper surfaces (i.e. canopy)
10209 REAL(KIND(1D0)), INTENT(IN) :: CapMin_dec !minimum water storage capacity for upper surfaces (i.e. canopy)
10210 REAL(KIND(1D0)), INTENT(IN) :: CO2PointSource ! point source [kgC day-1]
10211 REAL(KIND(1D0)), INTENT(IN) :: CRWmax !maximum water holding capacity of snow [mm]
10212 REAL(KIND(1D0)), INTENT(IN) :: CRWmin !minimum water holding capacity of snow [mm]
10213 REAL(KIND(1D0)), INTENT(IN) :: DecTreeH !average height of deciduous tree and shrub [-]
10214 REAL(KIND(1D0)), INTENT(IN) :: DRAINRT !Drainage rate of the water bucket [mm hr-1]
10215 REAL(KIND(1D0)), INTENT(IN) :: EF_umolCO2perJ !co2 emission factor [umol J-1]
10216 REAL(KIND(1D0)), INTENT(IN) :: EnEF_v_Jkm ! energy emission factor [J K m-1]
10217 REAL(KIND(1D0)), INTENT(IN) :: EveTreeH !height of evergreen tree [m]
10218 REAL(KIND(1D0)), INTENT(IN) :: FAIBldg ! frontal area index for buildings [-]
10219 REAL(KIND(1D0)), INTENT(IN) :: FAIDecTree ! frontal area index for deciduous tree [-]
10220 REAL(KIND(1D0)), INTENT(IN) :: FAIEveTree ! frontal area index for evergreen tree [-]
10221 REAL(KIND(1D0)), INTENT(IN) :: Faut !Fraction of irrigated area using automatic irrigation [-]
10222 ! REAL(KIND(1D0)),INTENT(IN)::fcld_obs
10223 REAL(KIND(1D0)), INTENT(IN) :: FlowChange !Difference between the input and output flow in the water body [mm]
10224 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_Heat ! fraction of fossil fuel heat [-]
10225 REAL(KIND(1D0)), INTENT(IN) :: FrFossilFuel_NonHeat ! fraction of fossil fuel non heat [-]
10226 REAL(KIND(1D0)), INTENT(IN) :: G_max !Fitted parameters related to surface res. calculations
10227 REAL(KIND(1D0)), INTENT(IN) :: G_k !Fitted parameters related to surface res. calculations
10228 REAL(KIND(1D0)), INTENT(IN) :: G_q_base !Fitted parameters related to surface res. calculations
10229 REAL(KIND(1D0)), INTENT(IN) :: G_q_shape !Fitted parameters related to surface res. calculations
10230 REAL(KIND(1D0)), INTENT(IN) :: G_t !Fitted parameters related to surface res. calculations
10231 REAL(KIND(1D0)), INTENT(IN) :: G_sm !Fitted parameters related to surface res. calculations
10232 REAL(KIND(1D0)), INTENT(IN) :: H_maintain ! ponding water depth to maintain [mm]
10233 REAL(KIND(1D0)), INTENT(IN) :: InternalWaterUse_h !Internal water use [mm h-1
10234 REAL(KIND(1D0)), INTENT(IN) :: IrrFracPaved !fraction of paved which are irrigated [-]
10235 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBldgs !fraction of buildings (e.g., green roofs) which are irrigated [-]
10236 REAL(KIND(1D0)), INTENT(IN) :: IrrFracEveTr !fraction of evergreen trees which are irrigated [-]
10237 REAL(KIND(1D0)), INTENT(IN) :: IrrFracDecTr !fraction of deciduous trees which are irrigated [-]
10238 REAL(KIND(1D0)), INTENT(IN) :: IrrFracGrass !fraction of grass which are irrigated [-]
10239 REAL(KIND(1D0)), INTENT(IN) :: IrrFracBSoil !fraction of bare soil trees which are irrigated [-]
10240 REAL(KIND(1D0)), INTENT(IN) :: IrrFracWater !fraction of water which are irrigated [-]
10241 REAL(KIND(1D0)), INTENT(IN) :: Kmax !annual maximum hourly solar radiation [W m-2]
10242 ! REAL(KIND(1D0)),INTENT(IN)::LAI_obs
10243 REAL(KIND(1D0)), INTENT(IN) :: lat !latitude [deg]
10244 ! REAL(KIND(1D0)),INTENT(IN)::ldown_obs
10245 REAL(KIND(1D0)), INTENT(IN) :: lng !longitude [deg]
10246 REAL(KIND(1D0)), INTENT(IN) :: MaxFCMetab ! maximum FC metabolism [umol m-2 s-1]
10247 REAL(KIND(1D0)), INTENT(IN) :: MaxQFMetab ! maximum QF Metabolism [W m-2]
10248 REAL(KIND(1D0)), INTENT(IN) :: MinFCMetab ! minimum QF metabolism [umol m-2 s-1]
10249 REAL(KIND(1D0)), INTENT(IN) :: MinQFMetab ! minimum FC metabolism [W m-2]
10250 REAL(KIND(1D0)), INTENT(IN) :: NARP_EMIS_SNOW ! snow emissivity in NARP model [-]
10251 REAL(KIND(1D0)), INTENT(IN) :: NARP_TRANS_SITE !atmospheric transmissivity for NARP [-]
10252 REAL(KIND(1D0)), INTENT(IN) :: PipeCapacity !capacity of pipes to transfer water [mm]
10253 REAL(KIND(1D0)), INTENT(IN) :: PopDensNighttime ! nighttime population density [ha-1] (i.e. residents)
10254 REAL(KIND(1D0)), INTENT(IN) :: PorMax_dec !full leaf-on summertime value used only for DecTr
10255 REAL(KIND(1D0)), INTENT(IN) :: PorMin_dec !leaf-off wintertime value used only for DecTr
10256 ! REAL(KIND(1D0)),INTENT(IN)::Precip
10257 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimit !rain data [mm]
10258 REAL(KIND(1D0)), INTENT(IN) :: PrecipLimitAlb !temperature limit when precipitation falls as snow [degC]
10259 ! REAL(KIND(1D0)),INTENT(IN)::Press_hPa
10260 ! REAL(KIND(1D0)),INTENT(IN)::qh_obs
10261 ! REAL(KIND(1D0)),INTENT(IN)::qn1_obs
10262 ! REAL(KIND(1D0)),INTENT(IN)::qs_obs
10263 ! REAL(KIND(1D0)),INTENT(IN)::qf_obs
10264 REAL(KIND(1D0)), INTENT(IN) :: RadMeltFact !hourly radiation melt factor of snow [mm W-1 h-1]
10265 REAL(KIND(1D0)), INTENT(IN) :: RAINCOVER !limit when surface totally covered with water for LUMPS [mm]
10266 REAL(KIND(1D0)), INTENT(IN) :: RainMaxRes !maximum water bucket reservoir [mm] Used for LUMPS surface wetness control.
10267 REAL(KIND(1D0)), INTENT(IN) :: RunoffToWater !fraction of above-ground runoff flowing to water surface during flooding [-]
10268 REAL(KIND(1D0)), INTENT(IN) :: S1 !a parameter related to soil moisture dependence [-]
10269 REAL(KIND(1D0)), INTENT(IN) :: S2 !a parameter related to soil moisture dependence [mm]
10270 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMax !effective surface albedo (middle of the day value) for summertime [-]
10271 REAL(KIND(1D0)), INTENT(IN) :: SnowAlbMin !effective surface albedo (middle of the day value) for wintertime (not including snow) [-]
10272 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMax !maximum snow density [kg m-3]
10273 REAL(KIND(1D0)), INTENT(IN) :: SnowDensMin !fresh snow density [kg m-3]
10274 REAL(KIND(1D0)), INTENT(IN) :: SnowLimBldg !Limit of the snow water equivalent for snow removal from building roofs [mm]
10275 REAL(KIND(1D0)), INTENT(IN) :: SnowLimPaved !llimit of the snow water equivalent for snow removal from roads[mm]
10276 ! REAL(KIND(1D0)),INTENT(IN)::snowFrac_obs
10277 REAL(KIND(1D0)), INTENT(IN) :: SurfaceArea !area of the grid [ha]
10278 REAL(KIND(1D0)), INTENT(IN) :: tau_a !time constant for snow albedo aging in cold snow [-]
10279 REAL(KIND(1D0)), INTENT(IN) :: tau_f !time constant for snow albedo aging in melting snow [-]
10280 REAL(KIND(1D0)), INTENT(IN) :: tau_r !time constant for snow density ageing [-]
10281 ! REAL(KIND(1D0)),INTENT(IN)::Temp_C
10282 REAL(KIND(1D0)), INTENT(IN) :: TempMeltFact !hourly temperature melt factor of snow [mm K-1 h-1]
10283 REAL(KIND(1D0)), INTENT(IN) :: TH !upper air temperature limit [degC]
10284 REAL(KIND(1D0)), INTENT(IN) :: timezone !time zone [h] for site relative to UTC (east is positive)
10285 REAL(KIND(1D0)), INTENT(IN) :: TL !lower air temperature limit [degC]
10286 REAL(KIND(1D0)), INTENT(IN) :: TrafficUnits ! traffic units choice [-]
10287 ! REAL(KIND(1D0)),INTENT(IN)::xsmd
10288 REAL(KIND(1D0)), INTENT(IN) :: Z ! measurement height [m]
10289 REAL(KIND(1D0)), INTENT(IN) :: z0m_in !roughness length for momentum [m]
10290 REAL(KIND(1D0)), INTENT(IN) :: zdm_in !zero-plane displacement [m]
10291
10292 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_MIN !minimum QF values [W m-2]
10293 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Cooling ! cooling slope for the anthropogenic heat flux calculation [W m-2 K-1]
10294 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: AH_SLOPE_Heating ! heating slope for the anthropogenic heat flux calculation [W m-2 K-1]
10295 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: FcEF_v_kgkm ! CO2 Emission factor [kg km-1]
10296 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: QF0_BEU ! Fraction of base value coming from buildings [-]
10297 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_A ! Base value for QF [W m-2]
10298 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_B ! Parameter related to heating degree days [W m-2 K-1 (Cap ha-1 )-1]
10299 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: Qf_C ! Parameter related to cooling degree days [W m-2 K-1 (Cap ha-1 )-1]
10300 ! REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) ::Numcapita
10301 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: PopDensDaytime ! Daytime population density [people ha-1] (i.e. workers)
10302 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Cooling ! base temperature for cooling degree day [degC]
10303 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: BaseT_Heating ! base temperatrue for heating degree day [degC]
10304 REAL(KIND(1D0)), DIMENSION(2), INTENT(IN) :: TrafficRate ! Traffic rate [veh km m-2 s-1]
10305 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_a !Coefficient for automatic irrigation model
10306 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: Ie_m !Coefficients for manual irrigation models
10307 REAL(KIND(1D0)), DIMENSION(3), INTENT(IN) :: MaxConductance !the maximum conductance of each vegetation or surface type. [mm s-1]
10308 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWat !Irrigation flag: 1 for on and 0 for off [-]
10309 REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) :: DayWatPer !Fraction of properties using irrigation for each day of a week [-]
10310 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshSW !Temperature threshold determining whether summer/winter OHM coefficients are applied [degC]
10311 REAL(KIND(1D0)), DIMENSION(nsurf + 1), INTENT(IN) :: OHM_threshWD !Soil moisture threshold determining whether wet/dry OHM coefficients are applied [-]
10312 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: chAnOHM !Bulk transfer coefficient for this surface to use in AnOHM [-]
10313 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: cpAnOHM !Volumetric heat capacity for this surface to use in AnOHM [J m-3]
10314 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: emis !Effective surface emissivity[-]
10315 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: kkAnOHM !Thermal conductivity for this surface to use in AnOHM [W m K-1]
10316 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SatHydraulicConduct !Hydraulic conductivity for saturated soil [mm s-1]
10317 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: sfr_surf !surface cover fraction[-]
10318 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SnowPackLimit !Limit for the snow water equivalent when snow cover starts to be patchy [mm]
10319 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilDepth !Depth of soil beneath the surface [mm]
10320 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: SoilStoreCap_surf !Capacity of soil store for each surface [mm]
10321 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: StateLimit_surf !Upper limit to the surface state [mm]
10322 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: WetThresh_surf !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
10323 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_bioCO2 !The mean apparent ecosystem quantum. Represents the initial slope of the light-response curve [-]
10324 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: alpha_enh_bioCO2 !Part of the alpha coefficient related to the fraction of vegetation[-]
10325 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseT !Base Temperature for initiating growing degree days (GDD) for leaf growth [degC]
10326 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: BaseTe !Base temperature for initiating sensesance degree days (SDD) for leaf off [degC]
10327 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_bioCO2 !The light-saturated gross photosynthesis of the canopy [umol m-2 s-1 ]
10328 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: beta_enh_bioCO2 !Part of the beta coefficient related to the fraction of vegetation [umol m-2 s-1 ]
10329 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: GDDFull !the growing degree days (GDD) needed for full capacity of the leaf area index [degC]
10330 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMax !full leaf-on summertime value [m2 m-2]
10331 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: LAIMin !leaf-off wintertime value [m2 m-2]
10332 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: min_res_bioCO2 !Minimum soil respiration rate (for cold-temperature limit) [umol m-2 s-1]
10333 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_a !Respiration coefficient a
10334 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: resp_b !Respiration coefficient b - related to air temperature dependency
10335 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: SDDFull !the sensesence degree days (SDD) needed to initiate leaf off [degC]
10336 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: SnowProf_24hr !Hourly profile values used in snow clearing [-]
10337 REAL(KIND(1D0)), DIMENSION(NVEGSURF), INTENT(IN) :: theta_bioCO2 !The convexity of the curve at light saturation [-]
10338 REAL(KIND(1D0)), DIMENSION(4, NVEGSURF), INTENT(IN) :: LAIPower !parameters required by LAI calculation
10339 REAL(KIND(1D0)), DIMENSION(nsurf + 1, 4, 3), INTENT(IN) :: OHM_coef !Coefficients for OHM calculation
10340 REAL(KIND(1D0)), DIMENSION(NSURF + 1, NSURF - 1), INTENT(IN) :: WaterDist !Fraction of water redistribution [-]
10341 REAL(KIND(1D0)), DIMENSION(:), INTENT(IN) :: Ts5mindata_ir !surface temperature input data[degC]
10342
10343 ! diurnal profile values for 24hr
10344 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: AHProf_24hr !Hourly profile values used in energy use calculation [-]
10345 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: HumActivity_24hr !Hourly profile values used in human activity calculation[-]
10346 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: PopProf_24hr !Hourly profile values used in dynamic population estimation[-]
10347 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: TraffProf_24hr !Hourly profile values used in traffic activity calculation[-]
10348 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfA_24hr !Hourly profile values used in automatic irrigation[-]
10349 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(IN) :: WUProfM_24hr !Hourly profile values used in manual irrigation[-]
10350 ! ########################################################################################
10351
10352 ! ########################################################################################
10353 ! inout variables
10354 ! OHM related:
10355 REAL(KIND(1D0)), INTENT(INOUT) :: qn_av ! weighted average of net all-wave radiation [W m-2]
10356 REAL(KIND(1D0)), INTENT(INOUT) :: dqndt ! rate of change of net radiation [W m-2 h-1]
10357 REAL(KIND(1D0)), INTENT(INOUT) :: qn_s_av ! weighted average of qn over snow [W m-2]
10358 REAL(KIND(1D0)), INTENT(INOUT) :: dqnsdt ! Rate of change of net radiation [W m-2 h-1]
10359
10360 ! snow related:
10361 REAL(KIND(1D0)), INTENT(INOUT) :: SnowfallCum !cumulated snow falling [mm]
10362 REAL(KIND(1D0)), INTENT(INOUT) :: SnowAlb !albedo of know [-]
10363 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: IceFrac !fraction of ice in snowpack [-]
10364 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowWater ! snow water[mm]
10365 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowDens !snow density [kg m-3]
10366 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowFrac !snow fraction [-]
10367 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: SnowPack !snow water equivalent on each land cover [mm]
10368
10369 ! water balance related:
10370 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: soilstore_surf !soil moisture of each surface type [mm]
10371 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: state_surf !wetness status of each surface type [mm]
10372 REAL(KIND(1D0)), DIMENSION(6, NSURF), INTENT(INOUT) :: StoreDrainPrm !coefficients used in drainage calculation [-]
10373
10374 ! phenology related:
10375 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(INOUT) :: alb !albedo [-]
10376 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: GDD_id !Growing Degree Days [degC](see SUEWS_DailyState.f95)
10377 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: SDD_id !Senescence Degree Days [degC](see SUEWS_DailyState.f95)
10378 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(INOUT) :: LAI_id !LAI for each veg surface [m2 m-2]
10379 REAL(KIND(1D0)), INTENT(INOUT) :: DecidCap_id !Moisture storage capacity of deciduous trees [mm]
10380 REAL(KIND(1D0)), INTENT(INOUT) :: albDecTr_id !Albedo of deciduous trees [-]
10381 REAL(KIND(1D0)), INTENT(INOUT) :: albEveTr_id !Albedo of evergreen trees [-]
10382 REAL(KIND(1D0)), INTENT(INOUT) :: albGrass_id !Albedo of grass [-]
10383 REAL(KIND(1D0)), INTENT(INOUT) :: porosity_id !Porosity of deciduous trees [-]
10384 REAL(KIND(1D0)), INTENT(INOUT) :: Tmin_id !Daily minimum temperature [degC]
10385 REAL(KIND(1D0)), INTENT(INOUT) :: Tmax_id !Daily maximum temperature [degC]
10386 REAL(KIND(1D0)), INTENT(INOUT) :: lenday_id !daytime length [h]
10387
10388 ! anthropogenic heat related:
10389 REAL(KIND(1D0)), DIMENSION(12), INTENT(INOUT) :: HDD_id !Heating Degree Days [degC d](see SUEWS_DailyState.f95)
10390
10391 ! water use related:
10392 REAL(KIND(1D0)), DIMENSION(9), INTENT(INOUT) :: WUDay_id !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
10393
10394 ! ESTM related:
10395 REAL(KIND(1D0)), INTENT(INOUT) :: Tair_av !average air temperature [degC]
10396
10397 ! ! extended for ESTM_ehc, TS 20 Jan 2022
10398 ! input arrays: standard suews surfaces
10399 ! REAL(KIND(1D0)), DIMENSION(nroof) :: tsfc_roof
10400 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_roof !roof surface temperature [degC]
10401 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_roof !roof surface fraction [-]
10402 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_roof ! indoor temperature for roof [degC]
10403 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(inout) :: temp_roof !interface temperature between depth layers in roof[degC]
10404 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_roof ! thermal conductivity of roof [W m-1 K]
10405 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_roof ! Heat capacity of roof [J m-3 K-1]
10406 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_roof ! thickness of each layer in roof [m]
10407 ! input arrays: standard suews surfaces
10408 ! REAL(KIND(1D0)), DIMENSION(nwall) :: tsfc_wall
10409 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: tsfc_wall !surface temperature of wall [degC]
10410 REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_wall !wall surface fraction [-]
10411 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_wall ! indoor temperature for wall [degC]
10412 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(inout) :: temp_wall !interface temperature between depth layers in wall[degC]
10413 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_wall ! thermal conductivity of wall [W m-1 K]
10414 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_wall ! Heat capacity of wall [J m-3 K-1]
10415 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_wall ! thickness of each layer in wall [m]
10416 ! input arrays: standard suews surfaces
10417 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: tsfc_surf
10418 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(INOUT) :: tsfc_surf !surface temperature [degC]
10419 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tin_surf !deep bottom temperature for each surface [degC]
10420 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(inout) :: temp_surf !interface temperature between depth layers for each surfaces[degC]
10421 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: k_surf ! thermal conductivity of v [W m-1 K]
10422 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: cp_surf ! Heat capacity of each surface [J m-3 K-1]
10423 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: dz_surf ! thickness of each layer in each surface [m]
10424
10425 ! SPARTACUS input variables
10426 INTEGER, INTENT(IN) :: n_vegetation_region_urban, & !Number of regions used to describe vegetation
10427 n_stream_sw_urban, n_stream_lw_urban !shortwave diffuse streams per hemisphere; LW streams per hemisphere
10428 REAL(KIND(1D0)), INTENT(IN) :: sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
10429 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
10430 veg_fsd_const, veg_contact_fraction_const, &
10431 ground_albedo_dir_mult_fact
10432 LOGICAL, INTENT(IN) :: use_sw_direct_albedo
10433 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height ! height in spartacus [m]
10434 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac !building fraction [-]
10435 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_frac !vegetation fraction [-]
10436 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale ! diameter of buildings [[m]
10437 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_scale ! scale of tree crowns [m]
10438 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_roof !albedo of roof [-]
10439 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_roof ! emissivity of roof [-]
10440 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_wall !albedo of wall [-]
10441 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_wall ! emissivity of wall [-]
10442 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: roof_albedo_dir_mult_fact !Ratio of the direct and diffuse albedo of the roof[-]
10443 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: wall_specular_frac ! Fraction of wall reflection that is specular [-]
10444 ! ########################################################################################
10445
10446 ! ####################################################################################
10447 ! ESTM_ehc
10448 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_roof !Capacity of soil store for roof [mm]
10449 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_roof !Limit for state_id of roof [mm]
10450 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_roof ! wetness threshold of roof[mm]
10451 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_roof !Soil moisture of roof [mm]
10452 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_roof !wetness status of roof [mm]
10453
10454 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: SoilStoreCap_wall !Capacity of soil store for wall [mm]
10455 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: StateLimit_wall !Limit for state_id of wall [mm]
10456 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: wetthresh_wall ! wetness threshold of wall[mm]
10457 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: soilstore_wall !Soil moisture of wall [mm]
10458 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(INOUT) :: state_wall !wetness status of wall [mm]
10459
10460 ! ########################################################################################
10461 ! output variables
10462 TYPE(output_line) :: output_line_suews
10463 ! REAL(KIND(1D0)),DIMENSION(:,:,:),ALLOCATABLE,INTENT(OUT) ::datetimeBlock
10464 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSUEWS) :: dataOutBlockSUEWS
10465 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSnow) :: dataOutBlockSnow
10466 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutESTM) :: dataOutBlockESTM
10467 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutEHC) :: dataOutBlockEHC
10468 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutRSL) :: dataOutBlockRSL
10469 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsdataOutBEERS) :: dataOutBlockBEERS
10470 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutDebug) :: dataOutBlockDebug
10471 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSPARTACUS) :: dataOutBlockSPARTACUS
10472 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutDailyState) :: dataOutBlockDailyState
10473 ! ########################################################################################
10474
10475 ! internal temporal iteration related variables
10476 ! INTEGER::dt_since_start ! time since simulation starts [s]
10477
10478 ! model output blocks of the same size as met forcing block
10479
10480 ! local variables
10481 ! length of met forcing block
10482 INTEGER :: ir
10483 ! met forcing variables
10484 INTEGER :: iy
10485 INTEGER :: id
10486 INTEGER :: it
10487 INTEGER :: imin
10488 INTEGER :: isec
10489 INTEGER, PARAMETER :: gridiv_x = 1 ! a dummy gridiv as this routine is only one grid
10490 REAL(KIND(1D0)) :: qn1_obs
10491 REAL(KIND(1D0)) :: qh_obs
10492 REAL(KIND(1D0)) :: qe_obs
10493 REAL(KIND(1D0)) :: qs_obs
10494 REAL(KIND(1D0)) :: qf_obs
10495 REAL(KIND(1D0)) :: avu1
10496 REAL(KIND(1D0)) :: avrh
10497 REAL(KIND(1D0)) :: Temp_C
10498 REAL(KIND(1D0)) :: Press_hPa
10499 REAL(KIND(1D0)) :: Precip
10500 REAL(KIND(1D0)) :: avkdn
10501 REAL(KIND(1D0)) :: snowFrac_obs
10502 REAL(KIND(1D0)) :: ldown_obs
10503 REAL(KIND(1D0)) :: fcld_obs
10504 REAL(KIND(1D0)) :: wu_m3
10505 REAL(KIND(1D0)) :: xsmd
10506 REAL(KIND(1D0)) :: LAI_obs
10507 REAL(KIND(1D0)) :: kdiff
10508 REAL(KIND(1D0)) :: kdir
10509 REAL(KIND(1D0)) :: wdir
10510
10511 REAL(KIND(1D0)), DIMENSION(5) :: datetimeLine
10512 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5) :: dataOutLineSUEWS
10513 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5) :: dataOutLineSnow
10514 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutESTM - 5) :: dataOutLineESTM
10515 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutEHC - 5) :: dataOutLineEHC
10516 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutRSL - 5) :: dataOutLineRSL
10517 ! REAL(KIND(1D0)), DIMENSION(ncolumnsdataOutSOLWEIG - 5) :: dataOutLineSOLWEIG
10518 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutBEERS - 5) :: dataOutLineBEERS
10519 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDebug - 5) :: dataOutLinedebug
10520 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSPARTACUS - 5) :: dataOutLineSPARTACUS
10521 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5) :: dataOutLineDailyState
10522
10523 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSUEWS, 1) :: dataOutBlockSUEWS_X
10524 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSnow, 1) :: dataOutBlockSnow_X
10525 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutESTM, 1) :: dataOutBlockESTM_X
10526 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutEHC, 1) :: dataOutBlockEHC_X
10527 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutRSL, 1) :: dataOutBlockRSL_X
10528 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsdataOutBEERS, 1) :: dataOutBlockBEERS_X
10529 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutDebug, 1) :: dataOutBlockDebug_X
10530 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutSPARTACUS, 1) :: dataOutBlockSPARTACUS_X
10531 REAL(KIND(1D0)), DIMENSION(len_sim, ncolumnsDataOutDailyState, 1) :: dataOutBlockDailyState_X
10532
10533 ! REAL(KIND(1D0)), DIMENSION(10) :: MetForcingData_grid ! fake array as a placeholder
10534
10535 TYPE(output_block), INTENT(OUT) :: output_block_suews
10536
10537 ! allocate output arrays
10538
10539 diagnose = 0
10540
10541 DO ir = 1, len_sim, 1
10542 ! =============================================================================
10543 ! === Translate met data from MetForcingBlock to variable names used in model ==
10544 ! =============================================================================
10545 iy = int(metforcingblock(ir, 1)) !Integer variables
10546 id = int(metforcingblock(ir, 2))
10547 it = int(metforcingblock(ir, 3))
10548 imin = int(metforcingblock(ir, 4))
10549 isec = 0 ! NOT used by SUEWS but by WRF-SUEWS via the cal_main interface
10550 qn1_obs = metforcingblock(ir, 5) !Real values (kind(1d0))
10551 qh_obs = metforcingblock(ir, 6)
10552 qe_obs = metforcingblock(ir, 7)
10553 qs_obs = metforcingblock(ir, 8)
10554 qf_obs = metforcingblock(ir, 9)
10555 avu1 = metforcingblock(ir, 10)
10556 avrh = metforcingblock(ir, 11)
10557 temp_c = metforcingblock(ir, 12)
10558 press_hpa = metforcingblock(ir, 13)
10559 precip = metforcingblock(ir, 14)
10560 avkdn = metforcingblock(ir, 15)
10561 snowfrac_obs = metforcingblock(ir, 16)
10562 ldown_obs = metforcingblock(ir, 17)
10563 fcld_obs = metforcingblock(ir, 18)
10564 wu_m3 = metforcingblock(ir, 19)
10565 xsmd = metforcingblock(ir, 20)
10566 lai_obs = metforcingblock(ir, 21)
10567 kdiff = metforcingblock(ir, 22)
10568 kdir = metforcingblock(ir, 23)
10569 wdir = metforcingblock(ir, 24)
10570
10571 ! !================================================
10572 ! ! below is for debugging
10573 ! WRITE (year_txt, '(I4)') INT(iy)
10574 ! WRITE (id_text, '(I3)') INT(id)
10575 ! WRITE (it_text, '(I4)') INT(it)
10576 ! WRITE (imin_text, '(I4)') INT(imin)
10577
10578 ! FileStateInit = './'//TRIM(ADJUSTL(year_txt))//'_'&
10579 ! //TRIM(ADJUSTL(id_text))//'_'&
10580 ! //TRIM(ADJUSTL(it_text))//'_'&
10581 ! //TRIM(ADJUSTL(imin_text))//'_'&
10582 ! //'state_init.nml'
10583
10584 ! OPEN (12, file=FileStateInit, position='rewind')
10585
10586 ! write (12, *) '&state_init'
10587 ! write (12, *) 'aerodynamicresistancemethod=', aerodynamicresistancemethod
10588 ! write (12, *) 'ah_min=', ah_min
10589 ! write (12, *) 'ahprof_24hr=', ahprof_24hr
10590 ! write (12, *) 'ah_slope_cooling=', ah_slope_cooling
10591 ! write (12, *) 'ah_slope_heating=', ah_slope_heating
10592 ! write (12, *) 'alb=', alb
10593 ! write (12, *) 'albmax_dectr=', albmax_dectr
10594 ! write (12, *) 'albmax_evetr=', albmax_evetr
10595 ! write (12, *) 'albmax_grass=', albmax_grass
10596 ! write (12, *) 'albmin_dectr=', albmin_dectr
10597 ! write (12, *) 'albmin_evetr=', albmin_evetr
10598 ! write (12, *) 'albmin_grass=', albmin_grass
10599 ! write (12, *) 'alpha_bioco2=', alpha_bioco2
10600 ! write (12, *) 'alpha_enh_bioco2=', alpha_enh_bioco2
10601 ! write (12, *) 'alt=', alt
10602 ! write (12, *) 'avkdn=', avkdn
10603 ! write (12, *) 'avrh=', avrh
10604 ! write (12, *) 'avu1=', avu1
10605 ! write (12, *) 'baset=', baset
10606 ! write (12, *) 'basete=', basete
10607 ! write (12, *) 'BaseT_HC=', BaseT_HC
10608 ! write (12, *) 'beta_bioco2=', beta_bioco2
10609 ! write (12, *) 'beta_enh_bioco2=', beta_enh_bioco2
10610 ! write (12, *) 'bldgh=', bldgh
10611 ! write (12, *) 'capmax_dec=', capmax_dec
10612 ! write (12, *) 'capmin_dec=', capmin_dec
10613 ! write (12, *) 'chanohm=', chanohm
10614 ! write (12, *) 'co2pointsource=', co2pointsource
10615 ! write (12, *) 'cpanohm=', cpanohm
10616 ! write (12, *) 'crwmax=', crwmax
10617 ! write (12, *) 'crwmin=', crwmin
10618 ! write (12, *) 'daywat=', daywat
10619 ! write (12, *) 'daywatper=', daywatper
10620 ! write (12, *) 'dectreeh=', dectreeh
10621 ! write (12, *) 'diagnose=', diagnose
10622 ! write (12, *) 'diagqn=', diagqn
10623 ! write (12, *) 'diagqs=', diagqs
10624 ! write (12, *) 'drainrt=', drainrt
10625 ! write (12, *) 'dt_since_start=', dt_since_start
10626 ! write (12, *) 'dqndt=', dqndt
10627 ! write (12, *) 'qn_av=', qn_av
10628 ! write (12, *) 'dqnsdt=', dqnsdt
10629 ! write (12, *) 'qn1_s_av=', qn1_s_av
10630 ! write (12, *) 'ef_umolco2perj=', ef_umolco2perj
10631 ! write (12, *) 'emis=', emis
10632 ! write (12, *) 'emissionsmethod=', emissionsmethod
10633 ! write (12, *) 'enef_v_jkm=', enef_v_jkm
10634 ! write (12, *) 'enddls=', enddls
10635 ! write (12, *) 'evetreeh=', evetreeh
10636 ! write (12, *) 'faibldg=', faibldg
10637 ! write (12, *) 'faidectree=', faidectree
10638 ! write (12, *) 'faievetree=', faievetree
10639 ! write (12, *) 'faut=', faut
10640 ! write (12, *) 'fcef_v_kgkm=', fcef_v_kgkm
10641 ! write (12, *) 'fcld_obs=', fcld_obs
10642 ! write (12, *) 'flowchange=', flowchange
10643 ! write (12, *) 'frfossilfuel_heat=', frfossilfuel_heat
10644 ! write (12, *) 'frfossilfuel_nonheat=', frfossilfuel_nonheat
10645 ! write (12, *) 'g1=', g1
10646 ! write (12, *) 'g2=', g2
10647 ! write (12, *) 'g3=', g3
10648 ! write (12, *) 'g4=', g4
10649 ! write (12, *) 'g5=', g5
10650 ! write (12, *) 'g6=', g6
10651 ! write (12, *) 'gdd_id=', gdd_id
10652 ! write (12, *) 'gddfull=', gddfull
10653 ! write (12, *) 'gridiv=', gridiv
10654 ! write (12, *) 'gsmodel=', gsmodel
10655 ! write (12, *) 'hdd_id=', hdd_id
10656 ! write (12, *) 'humactivity_24hr=', humactivity_24hr
10657 ! write (12, *) 'icefrac=', icefrac
10658 ! write (12, *) 'id=', id
10659 ! write (12, *) 'ie_a=', ie_a
10660 ! write (12, *) 'ie_end=', ie_end
10661 ! write (12, *) 'ie_m=', ie_m
10662 ! write (12, *) 'ie_start=', ie_start
10663 ! write (12, *) 'imin=', imin
10664 ! write (12, *) 'internalwateruse_h=', internalwateruse_h
10665 ! write (12, *) 'IrrFracEveTr=', IrrFracEveTr
10666 ! write (12, *) 'IrrFracDecTr=', IrrFracDecTr
10667 ! write (12, *) 'irrfracgrass=', irrfracgrass
10668 ! write (12, *) 'isec=', isec
10669 ! write (12, *) 'it=', it
10670 ! write (12, *) 'evapmethod=', evapmethod
10671 ! write (12, *) 'iy=', iy
10672 ! write (12, *) 'kkanohm=', kkanohm
10673 ! write (12, *) 'kmax=', kmax
10674 ! write (12, *) 'lai_id=', lai_id
10675 ! write (12, *) 'laicalcyes=', laicalcyes
10676 ! write (12, *) 'laimax=', laimax
10677 ! write (12, *) 'laimin=', laimin
10678 ! write (12, *) 'lai_obs=', lai_obs
10679 ! write (12, *) 'laipower=', laipower
10680 ! write (12, *) 'laitype=', laitype
10681 ! write (12, *) 'lat=', lat
10682 ! write (12, *) 'lenday_id=', lenday_id
10683 ! write (12, *) 'ldown_obs=', ldown_obs
10684 ! write (12, *) 'lng=', lng
10685 ! write (12, *) 'maxconductance=', maxconductance
10686 ! write (12, *) 'maxfcmetab=', maxfcmetab
10687 ! write (12, *) 'maxqfmetab=', maxqfmetab
10688 ! write (12, *) 'snowwater=', snowwater
10689 ! ! write (12, *) 'metforcingdata_grid=', metforcingdata_grid
10690 ! write (12, *) 'minfcmetab=', minfcmetab
10691 ! write (12, *) 'minqfmetab=', minqfmetab
10692 ! write (12, *) 'min_res_bioco2=', min_res_bioco2
10693 ! write (12, *) 'narp_emis_snow=', narp_emis_snow
10694 ! write (12, *) 'narp_trans_site=', narp_trans_site
10695 ! write (12, *) 'netradiationmethod=', netradiationmethod
10696 ! write (12, *) 'ohm_coef=', ohm_coef
10697 ! write (12, *) 'ohmincqf=', ohmincqf
10698 ! write (12, *) 'ohm_threshsw=', ohm_threshsw
10699 ! write (12, *) 'ohm_threshwd=', ohm_threshwd
10700 ! write (12, *) 'pipecapacity=', pipecapacity
10701 ! write (12, *) 'popdensdaytime=', popdensdaytime
10702 ! write (12, *) 'popdensnighttime=', popdensnighttime
10703 ! write (12, *) 'popprof_24hr=', popprof_24hr
10704 ! write (12, *) 'pormax_dec=', pormax_dec
10705 ! write (12, *) 'pormin_dec=', pormin_dec
10706 ! write (12, *) 'precip=', precip
10707 ! write (12, *) 'preciplimit=', preciplimit
10708 ! write (12, *) 'preciplimitalb=', preciplimitalb
10709 ! write (12, *) 'press_hpa=', press_hpa
10710 ! write (12, *) 'qf0_beu=', qf0_beu
10711 ! write (12, *) 'qf_a=', qf_a
10712 ! write (12, *) 'qf_b=', qf_b
10713 ! write (12, *) 'qf_c=', qf_c
10714 ! write (12, *) 'qn1_obs=', qn1_obs
10715 ! write (12, *) 'qh_obs=', qh_obs
10716 ! write (12, *) 'qs_obs=', qs_obs
10717 ! write (12, *) 'qf_obs=', qf_obs
10718 ! write (12, *) 'radmeltfact=', radmeltfact
10719 ! write (12, *) 'raincover=', raincover
10720 ! write (12, *) 'rainmaxres=', rainmaxres
10721 ! write (12, *) 'resp_a=', resp_a
10722 ! write (12, *) 'resp_b=', resp_b
10723 ! write (12, *) 'roughlenheatmethod=', roughlenheatmethod
10724 ! write (12, *) 'roughlenmommethod=', roughlenmommethod
10725 ! write (12, *) 'runofftowater=', runofftowater
10726 ! write (12, *) 's1=', s1
10727 ! write (12, *) 's2=', s2
10728 ! write (12, *) 'sathydraulicconduct=', sathydraulicconduct
10729 ! write (12, *) 'sddfull=', sddfull
10730 ! write (12, *) 'sdd_id=', sdd_id
10731 ! write (12, *) 'sfr_surf=', sfr_surf
10732 ! write (12, *) 'smdmethod=', smdmethod
10733 ! write (12, *) 'snowalb=', snowalb
10734 ! write (12, *) 'snowalbmax=', snowalbmax
10735 ! write (12, *) 'snowalbmin=', snowalbmin
10736 ! write (12, *) 'snowpacklimit=', snowpacklimit
10737 ! write (12, *) 'snowdens=', snowdens
10738 ! write (12, *) 'snowdensmax=', snowdensmax
10739 ! write (12, *) 'snowdensmin=', snowdensmin
10740 ! write (12, *) 'snowfallcum=', snowfallcum
10741 ! write (12, *) 'snowfrac=', snowfrac
10742 ! write (12, *) 'snowlimbldg=', snowlimbldg
10743 ! write (12, *) 'snowlimpaved=', snowlimpaved
10744 ! write (12, *) 'snowfrac_obs=', snowfrac_obs
10745 ! write (12, *) 'snowpack=', snowpack
10746 ! write (12, *) 'snowprof_24hr=', snowprof_24hr
10747 ! write (12, *) 'SnowUse=', SnowUse
10748 ! write (12, *) 'soildepth=', soildepth
10749 ! write (12, *) 'soilstore_id=', soilstore_id
10750 ! write (12, *) 'soilstorecap=', soilstorecap
10751 ! write (12, *) 'stabilitymethod=', stabilitymethod
10752 ! write (12, *) 'startdls=', startdls
10753 ! write (12, *) 'state_id=', state_id
10754 ! write (12, *) 'statelimit=', statelimit
10755 ! write (12, *) 'storageheatmethod=', storageheatmethod
10756 ! write (12, *) 'storedrainprm=', storedrainprm
10757 ! write (12, *) 'surfacearea=', surfacearea
10758 ! write (12, *) 'tair_av=', tair_av
10759 ! write (12, *) 'tau_a=', tau_a
10760 ! write (12, *) 'tau_f=', tau_f
10761 ! write (12, *) 'tau_r=', tau_r
10762 ! write (12, *) 'tmax_id=', tmax_id
10763 ! write (12, *) 'tmin_id=', tmin_id
10764 ! write (12, *) 'BaseT_Cooling=', BaseT_Cooling
10765 ! write (12, *) 'BaseT_Heating=', BaseT_Heating
10766 ! write (12, *) 'temp_c=', temp_c
10767 ! write (12, *) 'tempmeltfact=', tempmeltfact
10768 ! write (12, *) 'th=', th
10769 ! write (12, *) 'theta_bioco2=', theta_bioco2
10770 ! write (12, *) 'timezone=', timezone
10771 ! write (12, *) 'tl=', tl
10772 ! write (12, *) 'trafficrate=', trafficrate
10773 ! write (12, *) 'trafficunits=', trafficunits
10774 ! write (12, *) 'traffprof_24hr=', traffprof_24hr
10775 ! ! write (12, *) 'ts5mindata_ir=', ts5mindata_ir
10776 ! write (12, *) 'tstep=', tstep
10777 ! write (12, *) 'tstep_prev=', tstep_prev
10778 ! write (12, *) 'veg_type=', veg_type
10779 ! write (12, *) 'waterdist=', waterdist
10780 ! write (12, *) 'waterusemethod=', waterusemethod
10781 ! write (12, *) 'wetthresh=', wetthresh
10782 ! write (12, *) 'wu_m3=', wu_m3
10783 ! write (12, *) 'wuday_id=', wuday_id
10784 ! write (12, *) 'decidcap_id=', decidcap_id
10785 ! write (12, *) 'albdectr_id=', albdectr_id
10786 ! write (12, *) 'albevetr_id=', albevetr_id
10787 ! write (12, *) 'albgrass_id=', albgrass_id
10788 ! write (12, *) 'porosity_id=', porosity_id
10789 ! write (12, *) 'wuprofa_24hr=', wuprofa_24hr
10790 ! write (12, *) 'wuprofm_24hr=', wuprofm_24hr
10791 ! write (12, *) 'xsmd=', xsmd
10792 ! write (12, *) 'z=', z
10793 ! write (12, *) 'z0m_in=', z0m_in
10794 ! write (12, *) 'zdm_in=', zdm_in
10795 ! write (12, *) '/'
10796
10797 ! WRITE (12, *) ''
10798
10799 ! CLOSE (12)
10800 ! !================================================
10801
10802 ! CALL SUEWS_cal_Main( &
10803 CALL suews_cal_main_dts( &
10804 ah_min, ahprof_24hr, ah_slope_cooling, & ! input&inout in alphabetical order
10805 ah_slope_heating, &
10806 alb, albmax_dectr, albmax_evetr, albmax_grass, &
10807 albmin_dectr, albmin_evetr, albmin_grass, &
10808 alpha_bioco2, alpha_enh_bioco2, alt, avkdn, avrh, avu1, baset, basete, &
10809 beta_bioco2, beta_enh_bioco2, bldgh, capmax_dec, capmin_dec, &
10810 chanohm, co2pointsource, cpanohm, crwmax, crwmin, daywat, daywatper, &
10811 dectreeh, diagmethod, diagnose, drainrt, &
10812 dt_since_start, dqndt, qn_av, dqnsdt, qn_s_av, &
10813 ef_umolco2perj, emis, emissionsmethod, enef_v_jkm, enddls, evetreeh, faibldg, &
10814 faidectree, faievetree, faimethod, faut, fcef_v_kgkm, fcld_obs, flowchange, &
10815 frfossilfuel_heat, frfossilfuel_nonheat, g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, gdd_id, &
10816 gddfull, gridiv, gsmodel, h_maintain, hdd_id, humactivity_24hr, &
10817 icefrac, id, ie_a, ie_end, ie_m, ie_start, imin, &
10818 internalwateruse_h, &
10819 irrfracpaved, irrfracbldgs, &
10820 irrfracevetr, irrfracdectr, irrfracgrass, &
10821 irrfracbsoil, irrfracwater, &
10822 isec, it, &
10823 iy, kkanohm, kmax, lai_id, laimax, laimin, lai_obs, &
10824 laipower, laitype, lat, lenday_id, ldown_obs, lng, maxconductance, maxfcmetab, maxqfmetab, &
10825 snowwater, minfcmetab, minqfmetab, min_res_bioco2, &
10826 narp_emis_snow, narp_trans_site, netradiationmethod, &
10827 nlayer, &
10828 n_vegetation_region_urban, &
10829 n_stream_sw_urban, n_stream_lw_urban, &
10830 sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
10831 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
10832 veg_fsd_const, veg_contact_fraction_const, &
10833 ground_albedo_dir_mult_fact, use_sw_direct_albedo, & !input
10834 height, building_frac, veg_frac, building_scale, veg_scale, & !input: SPARTACUS
10835 alb_roof, emis_roof, alb_wall, emis_wall, &
10836 roof_albedo_dir_mult_fact, wall_specular_frac, &
10837 ohm_coef, ohmincqf, ohm_threshsw, &
10838 ohm_threshwd, pipecapacity, popdensdaytime, &
10839 popdensnighttime, popprof_24hr, pormax_dec, pormin_dec, &
10840 precip, preciplimit, preciplimitalb, press_hpa, &
10841 qf0_beu, qf_a, qf_b, qf_c, &
10842 qn1_obs, qs_obs, qf_obs, &
10843 radmeltfact, raincover, rainmaxres, resp_a, resp_b, &
10844 roughlenheatmethod, roughlenmommethod, runofftowater, s1, s2, &
10845 sathydraulicconduct, sddfull, sdd_id, smdmethod, snowalb, snowalbmax, &
10846 snowalbmin, snowpacklimit, snowdens, snowdensmax, snowdensmin, snowfallcum, snowfrac, &
10847 snowlimbldg, snowlimpaved, snowfrac_obs, snowpack, snowprof_24hr, snowuse, soildepth, &
10848 stabilitymethod, startdls, &
10849 soilstore_surf, soilstorecap_surf, state_surf, statelimit_surf, wetthresh_surf, &
10850 soilstore_roof, soilstorecap_roof, state_roof, statelimit_roof, wetthresh_roof, &
10851 soilstore_wall, soilstorecap_wall, state_wall, statelimit_wall, wetthresh_wall, &
10852 storageheatmethod, storedrainprm, surfacearea, tair_av, tau_a, tau_f, tau_r, &
10853 tmax_id, tmin_id, &
10854 baset_cooling, baset_heating, temp_c, tempmeltfact, th, &
10855 theta_bioco2, timezone, tl, trafficrate, trafficunits, &
10856 sfr_surf, &
10857 tsfc_roof, tsfc_wall, tsfc_surf, &
10858 temp_roof, temp_wall, temp_surf, &
10859 tin_roof, tin_wall, tin_surf, &
10860 k_roof, k_wall, k_surf, &
10861 cp_roof, cp_wall, cp_surf, &
10862 dz_roof, dz_wall, dz_surf, &
10863 traffprof_24hr, ts5mindata_ir, tstep, tstep_prev, veg_type, &
10864 waterdist, waterusemethod, wu_m3, &
10865 wuday_id, decidcap_id, albdectr_id, albevetr_id, albgrass_id, porosity_id, &
10866 wuprofa_24hr, wuprofm_24hr, xsmd, z, z0m_in, zdm_in, &
10867 output_line_suews) !output
10868 ! datetimeLine, dataOutLineSUEWS, dataOutLineSnow, dataOutLineESTM, dataoutLineRSL, & !output
10869 ! dataOutLineBEERS, & !output
10870 ! dataOutLineDebug, dataOutLineSPARTACUS, &
10871 ! dataOutLineEHC, &
10872 ! dataOutLineDailyState) !output
10873
10874 ! update dt_since_start_x for next iteration, dt_since_start_x is used for Qn averaging. TS 28 Nov 2018
10875 dt_since_start = dt_since_start + tstep
10876
10877 !============ update DailyStateBlock ===============
10878 dataoutblockdailystate(ir, :) = [output_line_suews%dataOutLineDailyState]
10879
10880 !============ write out results ===============
10881 ! works at each timestep
10882 CALL suews_update_output( &
10883 snowuse, storageheatmethod, & !input
10884 len_sim, 1, &
10885 ir, gridiv_x, &
10886 output_line_suews%dataOutLineSUEWS, &
10887 output_line_suews%dataOutLineSnow, &
10888 output_line_suews%dataOutLineESTM, & !input
10889 output_line_suews%dataoutLineRSL, &
10890 output_line_suews%dataOutLineBEERS, &
10891 output_line_suews%dataOutLinedebug, &
10892 output_line_suews%dataOutLineSPARTACUS, &
10893 output_line_suews%dataOutLineEHC, & !input
10894 dataoutblocksuews_x, dataoutblocksnow_x, dataoutblockestm_x, & !
10895 dataoutblockrsl_x, dataoutblockbeers_x, dataoutblockdebug_x, dataoutblockspartacus_x, dataoutblockehc_x) !inout
10896
10897 END DO
10898
10899 dataoutblocksuews = dataoutblocksuews_x(:, :, 1)
10900 dataoutblocksnow = dataoutblocksnow_x(:, :, 1)
10901 dataoutblockestm = dataoutblockestm_x(:, :, 1)
10902 dataoutblockehc = dataoutblockehc_x(:, :, 1)
10903 dataoutblockrsl = dataoutblockrsl_x(:, :, 1)
10904 dataoutblockbeers = dataoutblockbeers_x(:, :, 1)
10905 dataoutblockdebug = dataoutblockdebug_x(:, :, 1)
10906 dataoutblockspartacus = dataoutblockspartacus_x(:, :, 1)
10907 ! dataOutBlockDailyState = dataOutBlockDailyState_X(:, :, 1)
10908
10909 ! initialize output block
10910 CALL output_block_finalize(output_block_suews)
10911 CALL output_block_init(output_block_suews, len_sim)
10912 ! transfer data to output block
10913 output_block_suews%dataOutBlockSUEWS = dataoutblocksuews
10914 output_block_suews%dataOutBlockSnow = dataoutblocksnow
10915 output_block_suews%dataOutBlockESTM = dataoutblockestm
10916 output_block_suews%dataOutBlockEHC = dataoutblockehc
10917 output_block_suews%dataOutBlockRSL = dataoutblockrsl
10918 output_block_suews%dataOutBlockBEERS = dataoutblockbeers
10919 output_block_suews%dataOutBlockDebug = dataoutblockdebug
10920 output_block_suews%dataOutBlockSPARTACUS = dataoutblockspartacus
10921 output_block_suews%dataOutBlockDailyState = dataoutblockdailystate
10922

References output_block_finalize(), output_block_init(), suews_cal_main_dts(), and suews_update_output().

Here is the call graph for this function:

◆ suews_cal_qe()

subroutine suews_driver::suews_cal_qe ( integer, intent(in) diagnose,
integer, intent(in) storageheatmethod,
integer, intent(in) nlayer,
integer, intent(in) tstep,
integer, intent(in) evapmethod,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) lv_j_kg,
real(kind(1d0)), intent(in) psyc_hpa,
real(kind(1d0)), intent(in) pervfraction,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) vpd_hpa,
real(kind(1d0)), intent(in) s_hpa,
real(kind(1d0)), intent(in) rs,
real(kind(1d0)), intent(in) ra_h,
real(kind(1d0)), intent(in) rb,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) nonwaterfraction,
real(kind(1d0)), dimension(nsurf), intent(in) wu_surf,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) addwaterbody,
real(kind(1d0)), dimension(nsurf), intent(in) addwater_surf,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), dimension(nsurf), intent(in) drain_surf,
real(kind(1d0)), dimension(nsurf), intent(in) frac_water2runoff_surf,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nsurf), intent(in) statelimit_surf,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap_surf,
real(kind(1d0)), dimension(nsurf), intent(in) wetthresh_surf,
real(kind(1d0)), dimension(nsurf), intent(in) state_surf_in,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_surf_in,
real(kind(1d0)), dimension(nsurf), intent(in) qn_surf,
real(kind(1d0)), dimension(nsurf), intent(in) qs_surf,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_roof,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_roof,
real(kind(1d0)), dimension(nlayer), intent(in) state_roof_in,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_roof_in,
real(kind(1d0)), dimension(nlayer), intent(in) qn_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qs_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_wall,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_wall,
real(kind(1d0)), dimension(nlayer), intent(in) state_wall_in,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_wall_in,
real(kind(1d0)), dimension(nlayer), intent(in) qn_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qs_wall,
real(kind(1d0)), dimension(nsurf), intent(out) state_surf_out,
real(kind(1d0)), dimension(nsurf), intent(out) soilstore_surf_out,
real(kind(1d0)), dimension(nsurf), intent(out) ev_surf,
real(kind(1d0)), dimension(nlayer), intent(out) state_roof_out,
real(kind(1d0)), dimension(nlayer), intent(out) soilstore_roof_out,
real(kind(1d0)), dimension(nlayer) ev_roof,
real(kind(1d0)), dimension(nlayer), intent(out) state_wall_out,
real(kind(1d0)), dimension(nlayer), intent(out) soilstore_wall_out,
real(kind(1d0)), dimension(nlayer) ev_wall,
real(kind(1d0)), intent(out) state_grid,
real(kind(1d0)), intent(out) nwstate_grid,
real(kind(1d0)), dimension(nsurf), intent(out) ev0_surf,
real(kind(1d0)), dimension(nsurf), intent(out) qe0_surf,
real(kind(1d0)), intent(out) qe,
real(kind(1d0)), dimension(nsurf), intent(out) qe_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qe_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qe_wall,
real(kind(1d0)), intent(out) ev_grid,
real(kind(1d0)), intent(out) runoff_grid,
real(kind(1d0)), intent(out) surf_chang_grid,
real(kind(1d0)), intent(out) runoffpipes_grid,
real(kind(1d0)), intent(out) runoffwaterbody_grid,
real(kind(1d0)), intent(out) runoffagveg_grid,
real(kind(1d0)), intent(out) runoffagimpervious_grid,
real(kind(1d0)), dimension(nsurf), intent(out) rss_surf )

Definition at line 8071 of file suews_ctrl_driver.f95.

8100
8101 IMPLICIT NONE
8102
8103 INTEGER, INTENT(in) :: Diagnose
8104 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS [-]
8105 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
8106 INTEGER, INTENT(in) :: tstep !timesteps [s]
8107 ! INTEGER, INTENT(in) :: imin
8108 ! INTEGER, INTENT(in) :: it
8109 INTEGER, INTENT(in) :: EvapMethod !Evaporation calculated according to Rutter (1) or Shuttleworth (2)
8110
8111 REAL(KIND(1D0)), INTENT(in) :: lv_j_kg !Latent heat of vapourisation [J kg-1]
8112 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
8113 REAL(KIND(1D0)), INTENT(in) :: psyc_hPa !Psychometric constant [hPa]
8114 REAL(KIND(1D0)), INTENT(in) :: avcp ! air heat capacity [J kg-1 K-1]
8115
8116 REAL(KIND(1D0)), INTENT(in) :: PervFraction ! sum of surface cover fractions for impervious surfaces [-]
8117 ! REAL(KIND(1D0)), INTENT(in) :: vegfraction
8118 REAL(KIND(1D0)), INTENT(in) :: addimpervious !Water from impervious surfaces of other grids for whole surface area [mm]
8119
8120 REAL(KIND(1D0)), INTENT(in) :: qf ! athropogenic heat flux [W m-2]
8121
8122 REAL(KIND(1D0)), INTENT(in) :: vpd_hPa ! vapour pressure deficit [hPa]
8123 REAL(KIND(1D0)), INTENT(in) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
8124 REAL(KIND(1D0)), INTENT(in) :: RS !surface resistance [s m-1]
8125 REAL(KIND(1D0)), INTENT(in) :: RA_h !aerodynamic resistance [s m-1]
8126 REAL(KIND(1D0)), INTENT(in) :: RB !boundary layer resistance [s m-1]
8127 ! REAL(KIND(1D0)), INTENT(in) :: snowdensmin
8128 REAL(KIND(1D0)), INTENT(in) :: precip !rain data [mm]
8129 REAL(KIND(1D0)), INTENT(in) :: PipeCapacity !Capacity of pipes to transfer water [mm]
8130 REAL(KIND(1D0)), INTENT(in) :: RunoffToWater !Fraction of surface runoff going to water body [-]
8131 REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction !Fraction of non-water surface [-]
8132 ! REAL(KIND(1d0)), INTENT(in)::wu_EveTr!Water use for evergreen trees/shrubs [mm]
8133 ! REAL(KIND(1d0)), INTENT(in)::wu_DecTr!Water use for deciduous trees/shrubs [mm]
8134 ! REAL(KIND(1d0)), INTENT(in)::wu_Grass!Water use for grass [mm]
8135 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
8136 REAL(KIND(1D0)), INTENT(in) :: addWaterBody !Water from water surface of other grids [mm] for whole surface area
8137 ! REAL(KIND(1D0)), INTENT(in) :: SnowLimPaved
8138 ! REAL(KIND(1D0)), INTENT(in) :: SnowLimBldg
8139 ! REAL(KIND(1D0)), INTENT(in) :: SurfaceArea
8140 REAL(KIND(1D0)), INTENT(in) :: FlowChange !Difference between the input and output flow in the water body [mm]
8141
8142 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WU_surf !external water use of each surface type [mm]
8143 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: drain_surf !Drainage of each surface type [mm]
8144
8145 ! input for generic suews surfaces
8146 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !surface fraction [-]
8147 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: StateLimit_surf !Limit for state_id of each surface type [mm] (specified in input files)
8148 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WetThresh_surf !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
8149 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap_surf !Capacity of soil store for each surface [mm]
8150 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_surf_in !wetness status of each surface type from previous timestep [mm]
8151 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_surf_in !initial water store in soil of each surface type [mm]
8152 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_surf ! latent heat flux of individual surface [W m-2]
8153 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qs_surf ! latent heat flux of individual surface [W m-2]
8154
8155 ! input for generic roof facets
8156 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof !surface fraction ratio of roof [-]
8157 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: StateLimit_roof !Limit for state_id of roof [mm]
8158 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: WetThresh_roof ! wetness threshold of roof[mm]
8159 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: SoilStoreCap_roof !Capacity of soil store for roof [mm]
8160 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_roof_in !wetness status of roof from previous timestep[mm]
8161 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_roof_in !Soil moisture of roof [mm]
8162 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qn_roof !net all-wave radiation for roof [W m-2]
8163 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qs_roof !heat storage flux for roof [W m-2]
8164
8165 ! input for generic wall facets
8166 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall !surface fraction ratio of wall [-]
8167 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: StateLimit_wall ! upper limit for state_id of wall [mm]
8168 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: WetThresh_wall ! wetness threshold of roof[mm]
8169 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: SoilStoreCap_wall !Capacity of soil store for wall [mm]
8170 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_wall_in !wetness status of wall from previous timestep[mm]
8171 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_wall_in !Soil moisture of wall [mm]
8172 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qn_wall !net all-wave radiation for wall [W m-2]
8173 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qs_wall !heat storage flux for wall [W m-2]
8174
8175 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPackLimit
8176 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: AddWater_surf !Water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm]
8177 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: frac_water2runoff_surf !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
8178 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
8179 ! REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: SnowProf_24hr
8180
8181 ! Total water transported to each grid for grid-to-grid connectivity
8182 ! REAL(KIND(1D0)), INTENT(in) :: runoff_per_interval_in
8183 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_in
8184 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac_in
8185 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowWater_in
8186 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: iceFrac_in
8187 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowDens_in
8188
8189 ! output:
8190 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: state_surf_out !wetness status of each surface type [mm]
8191 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstore_surf_out !soil moisture of each surface type [mm]
8192 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: state_roof_out !Wetness status of roof [mm]
8193 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: soilstore_roof_out !soil moisture of roof [mm]
8194 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: state_wall_out !wetness status of wall [mm]
8195 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: soilstore_wall_out !soil moisture of wall [mm]
8196 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowPack_out
8197 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowFrac_out
8198 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowWater_out
8199 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: iceFrac_out
8200 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowDens_out
8201
8202 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: runoffSnow_surf !Initialize for runoff caused by snowmelting
8203 REAL(KIND(1D0)), DIMENSION(nsurf) :: runoff_surf !runoff from each surface type [mm]
8204 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: chang !Change in state_id [mm]
8205 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: ChangSnow_surf
8206 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: snowDepth
8207 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowToSurf
8208 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_snow
8209 ! REAL(KIND(1D0)), DIMENSION(2), INTENT(out) :: SnowRemoval
8210 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe0_surf !evaporation of each surface type by PM [mm]
8211 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: ev0_surf !evaporation of each surface type by PM [mm]
8212 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: ev_surf !evaporation of each surface type [mm]
8213 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: rss_surf !Redefined surface resistance for wet surfaces [s m-1]
8214
8215 ! REAL(KIND(1D0)) :: p_mm !Inputs to surface water balance
8216 ! REAL(KIND(1d0)),INTENT(out)::rss
8217 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe_surf ! latent heat flux on ground surface [W m-2]
8218 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_roof ! latent heat flux on roof [W m-2]
8219 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_wall ! latent heat flux on wall [W m-2]
8220 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_roof ! evaporation of roof [mm]
8221 REAL(KIND(1D0)), DIMENSION(nlayer) :: rss_roof ! redefined surface resistance for wet roof [s m-1]
8222 REAL(KIND(1D0)), DIMENSION(nlayer) :: runoff_roof !runoff from roof [mm]
8223 ! REAL(KIND(1D0)) :: qe_roof_total !turbulent latent heat flux on the roof [W m-2]
8224 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_wall ! evaporation of wall [mm]
8225 REAL(KIND(1D0)), DIMENSION(nlayer) :: rss_wall ! redefined surface resistance for wet wall [s m-1]
8226 REAL(KIND(1D0)), DIMENSION(nlayer) :: runoff_wall !runoff from wall [mm]
8227 ! REAL(KIND(1D0)) :: qe_wall_total !turbulent latent heat flux on the wall [W m-2]
8228 REAL(KIND(1D0)), INTENT(out) :: state_grid !total state_id (including water body) [mm]
8229 REAL(KIND(1D0)), INTENT(out) :: NWstate_grid !total state_id (excluding water body) [mm]
8230 REAL(KIND(1D0)), INTENT(out) :: qe ! aggregated latent heat flux of all surfaces [W m-2]
8231 ! REAL(KIND(1D0)), INTENT(out) :: swe
8232 ! REAL(KIND(1D0)) :: ev
8233 ! REAL(KIND(1D0)), INTENT(out) :: chSnow_per_interval
8234 REAL(KIND(1D0)), INTENT(out) :: ev_grid ! total evaporation for all surfaces [mm]
8235 ! REAL(KIND(1D0)) :: qe_grid ! total latent heat flux [W m-2] for all surfaces [W m-2]
8236 REAL(KIND(1D0)), INTENT(out) :: runoff_grid ! total runoff for all surfaces [mm]
8237 REAL(KIND(1D0)), INTENT(out) :: surf_chang_grid ! total change in surface state_id for all surfaces [mm]
8238 REAL(KIND(1D0)), INTENT(out) :: runoffPipes_grid ! !Runoff in pipes for all surface area [mm]
8239 ! REAL(KIND(1D0)), INTENT(out) :: mwstore
8240 REAL(KIND(1D0)), INTENT(out) :: runoffWaterBody_grid !Above ground runoff from water surface for all surface area [mm]
8241 ! REAL(KIND(1D0)) :: runoffWaterBody_m3
8242 ! REAL(KIND(1D0)) :: runoffPipes_m3
8243 REAL(KIND(1D0)), INTENT(out) :: runoffAGveg_grid !Above ground runoff from vegetated surfaces for all surface area [mm]
8244 REAL(KIND(1D0)), INTENT(out) :: runoffAGimpervious_grid !Above ground runoff from impervious surface for all surface area [mm]
8245
8246 ! local:
8247 ! INTEGER :: is
8248
8249 ! REAL(KIND(1D0)) :: runoff_per_interval
8250 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: state_id_out
8251 REAL(KIND(1D0)), DIMENSION(nsurf) :: soilstore_id !Soil moisture of each surface type [mm]
8252 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowPack
8253 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac
8254 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowWater
8255 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: iceFrac
8256 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDens
8257 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn_e_surf !net available energy for evaporation for each surface[W m-2]
8258 REAL(KIND(1D0)), DIMENSION(nlayer) :: qn_e_roof !net available energy for evaporation for roof[W m-2]
8259 REAL(KIND(1D0)), DIMENSION(nlayer) :: qn_e_wall !net available energy for evaporation for wall[W m-2]
8260
8261 REAL(KIND(1D0)) :: pin !Rain per time interval
8262 REAL(KIND(1D0)) :: tlv !Latent heat of vapourisation per timestep [J kg-1 s-1]
8263 REAL(KIND(1D0)) :: nsh_real !timesteps per hour
8264 REAL(KIND(1D0)) :: state_building !aggregated surface water of building facets [mm]
8265 REAL(KIND(1D0)) :: soilstore_building !aggregated soilstore of building facets[mm]
8266 REAL(KIND(1D0)) :: capStore_builing ! aggregated storage capacity of building facets[mm]
8267 REAL(KIND(1D0)) :: runoff_building !aggregated Runoff of building facets [mm]
8268 REAL(KIND(1D0)) :: qe_building !aggregated qe of building facets[W m-2]
8269
8270 REAL(KIND(1D0)), DIMENSION(7) :: capStore_surf ! current storage capacity [mm]
8271
8272 ! runoff_per_interval = runoff_per_interval_in
8273 state_surf_out = state_surf_in
8274 soilstore_id = soilstore_surf_in
8275
8276 nsh_real = 3600/tstep*1.d0
8277
8278 tlv = lv_j_kg/tstep*1.d0 !Latent heat of vapourisation per timestep
8279
8280 pin = max(0., precip) !Initiate rain data [mm]
8281
8282 ! force these facets to be totally dry
8283 ! TODO: need to consider their hydrologic dynamics
8284 qe_roof = 0
8285 qe_wall = 0
8286 qe0_surf = 0
8287
8288 IF (diagnose == 1) WRITE (*, *) 'Calling evap_SUEWS and SoilStore...'
8289 ! == calculate QE ==
8290 ! --- general suews surfaces ---
8291 ! net available energy for evaporation
8292 qn_e_surf = qn_surf + qf - qs_surf ! qn1 changed to qn1_snowfree, lj in May 2013
8293
8294 ! soil store capacity
8295 capstore_surf = storedrainprm(6, :)
8296 CALL cal_evap_multi( &
8297 evapmethod, & !input
8298 sfr_surf, state_surf_in, wetthresh_surf, capstore_surf, & !input
8299 vpd_hpa, avdens, avcp, qn_e_surf, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8300 rss_surf, ev0_surf, qe0_surf) !output
8301
8302 IF (storageheatmethod == 5) THEN
8303 ! --- roofs ---
8304 ! net available energy for evaporation
8305 qn_e_roof = qn_roof + qf - qs_roof ! qn1 changed to qn1_snowfree, lj in May 2013
8306 CALL cal_evap_multi( &
8307 evapmethod, & !input
8308 sfr_roof, state_roof_in, wetthresh_roof, statelimit_roof, & !input
8309 vpd_hpa, avdens, avcp, qn_e_roof, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8310 rss_roof, ev_roof, qe_roof) !output
8311
8312 ! --- walls ---
8313 ! net available energy for evaporation
8314 qn_e_wall = qn_wall + qf - qs_wall ! qn1 changed to qn1_snowfree, lj in May 2013
8315 CALL cal_evap_multi( &
8316 evapmethod, & !input
8317 sfr_wall, state_wall_in, wetthresh_wall, statelimit_wall, & !input
8318 vpd_hpa, avdens, avcp, qn_e_wall, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8319 rss_wall, ev_wall, qe_wall) !output
8320
8321 ! == calculate water balance ==
8322 ! --- building facets: roofs and walls ---
8323 CALL cal_water_storage_building( &
8324 pin, nsh_real, nlayer, &
8325 sfr_roof, statelimit_roof, soilstorecap_roof, wetthresh_roof, & ! input:
8326 ev_roof, state_roof_in, soilstore_roof_in, & ! input:
8327 sfr_wall, statelimit_wall, soilstorecap_wall, wetthresh_wall, & ! input:
8328 ev_wall, state_wall_in, soilstore_wall_in, & ! input:
8329 ev_roof, state_roof_out, soilstore_roof_out, runoff_roof, & ! general output:
8330 ev_wall, state_wall_out, soilstore_wall_out, runoff_wall, & ! general output:
8331 state_building, soilstore_building, runoff_building, capstore_builing)
8332
8333 ! update QE based on the water balance
8334 qe_roof = tlv*ev_roof
8335 qe_wall = tlv*ev_wall
8336
8337 IF (sfr_surf(bldgsurf) < 1.0e-8) THEN
8338 qe_building = 0.0
8339 ELSE
8340 qe_building = (dot_product(qe_roof, sfr_roof) + dot_product(qe_wall, sfr_wall))/sfr_surf(bldgsurf)
8341 END IF
8342 END IF
8343 ! --- general suews surfaces ---
8344 CALL cal_water_storage_surf( &
8345 pin, nsh_real, &
8346 pipecapacity, runofftowater, & ! input:
8347 addimpervious, addveg, addwaterbody, flowchange, &
8348 soilstorecap_surf, statelimit_surf, &
8349 pervfraction, &
8350 sfr_surf, drain_surf, addwater_surf, frac_water2runoff_surf, wu_surf, &
8351 ev0_surf, state_surf_in, soilstore_surf_in, &
8352 ev_surf, state_surf_out, soilstore_surf_out, & ! output:
8353 runoff_surf, &
8354 runoffagimpervious_grid, runoffagveg_grid, runoffpipes_grid, runoffwaterbody_grid & ! output:
8355 )
8356
8357 ! update QE based on the water balance
8358 qe_surf = tlv*ev_surf
8359
8360 ! --- update building related ---
8361 IF (storageheatmethod == 5) THEN
8362 ! update building specific values
8363 qe_surf(bldgsurf) = qe_building
8364 state_surf_out(bldgsurf) = state_building
8365 soilstore_surf_out(bldgsurf) = soilstore_building/capstore_builing*capstore_surf(bldgsurf)
8366 runoff_surf(bldgsurf) = runoff_building
8367 END IF
8368
8369 ! aggregate all surface water fluxes/amounts
8370 qe = dot_product(qe_surf, sfr_surf)
8371
8372 ! Sum change from different surfaces to find total change to surface state_id
8373 surf_chang_grid = dot_product(state_surf_out - state_surf_in, sfr_surf)
8374
8375 ! Sum evaporation from different surfaces to find total evaporation [mm]
8376 ev_grid = dot_product(ev_surf, sfr_surf)
8377
8378 ! Sum runoff from different surfaces to find total runoff
8379 runoff_grid = dot_product(runoff_surf, sfr_surf)
8380
8381 ! Calculate total state_id (including water body)
8382 state_grid = dot_product(state_surf_out, sfr_surf)
8383
8384 IF (nonwaterfraction /= 0) THEN
8385 nwstate_grid = dot_product(state_surf_out(1:nsurf - 1), sfr_surf(1:nsurf - 1))/nonwaterfraction
8386 END IF
8387 ! Calculate volume of water that will move between grids
8388 ! Volume [m3] = Depth relative to whole area [mm] / 1000 [mm m-1] * SurfaceArea [m2]
8389 ! Need to use these volumes when converting back to addImpervious, AddVeg and AddWater
8390 ! runoffAGimpervious_m3 = runoffAGimpervious/1000*SurfaceArea
8391 ! runoffAGveg_m3 = runoffAGveg/1000*SurfaceArea
8392 ! runoffWaterBody_m3 = runoffWaterBody/1000*SurfaceArea
8393 ! runoffPipes_m3 = runoffPipes/1000*SurfaceArea
8394
8395 ! state_id_out = state_id_out
8396 ! soilstore_id_out = soilstore_id
8397 IF (storageheatmethod == 5) THEN
8398 IF (diagnose == 1) print *, 'in SUEWS_cal_QE soilstore_building = ', soilstore_building
8399 IF (diagnose == 1) print *, 'in SUEWS_cal_QE capStore_builing = ', capstore_builing
8400 IF (diagnose == 1) print *, 'in SUEWS_cal_QE capStore_surf(BldgSurf) = ', capstore_surf(bldgsurf)
8401 END IF
8402 IF (diagnose == 1) print *, 'in SUEWS_cal_QE soilstore_id = ', soilstore_surf_out
8403

References allocatearray::bldgsurf, evap_module::cal_evap_multi(), waterdist_module::cal_water_storage_building(), waterdist_module::cal_water_storage_surf(), and allocatearray::nsurf.

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_qe_dts()

subroutine suews_driver::suews_cal_qe_dts ( integer, intent(in) diagnose,
integer, intent(in) storageheatmethod,
integer, intent(in) nlayer,
integer, intent(in) tstep,
integer, intent(in) evapmethod,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) lv_j_kg,
real(kind(1d0)), intent(in) psyc_hpa,
real(kind(1d0)), intent(in) pervfraction,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) vpd_hpa,
real(kind(1d0)), intent(in) s_hpa,
real(kind(1d0)), intent(in) rs,
real(kind(1d0)), intent(in) ra_h,
real(kind(1d0)), intent(in) rb,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) nonwaterfraction,
real(kind(1d0)), dimension(nsurf), intent(in) wu_surf,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) addwaterbody,
real(kind(1d0)), dimension(nsurf), intent(in) addwater_surf,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), dimension(nsurf), intent(in) drain_surf,
real(kind(1d0)), dimension(nsurf), intent(in) frac_water2runoff_surf,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), intent(in) statelimit_paved,
real(kind(1d0)), intent(in) statelimit_bldg,
real(kind(1d0)), intent(in) statelimit_evetr,
real(kind(1d0)), intent(in) statelimit_dectr,
real(kind(1d0)), intent(in) statelimit_grass,
real(kind(1d0)), intent(in) statelimit_bsoil,
real(kind(1d0)), intent(in) statelimit_water,
real(kind(1d0)), intent(in) soilstorecap_paved,
real(kind(1d0)), intent(in) soilstorecap_bldg,
real(kind(1d0)), intent(in) soilstorecap_evetr,
real(kind(1d0)), intent(in) soilstorecap_dectr,
real(kind(1d0)), intent(in) soilstorecap_grass,
real(kind(1d0)), intent(in) soilstorecap_bsoil,
real(kind(1d0)), intent(in) soilstorecap_water,
real(kind(1d0)), intent(in) wetthresh_paved,
real(kind(1d0)), intent(in) wetthresh_bldg,
real(kind(1d0)), intent(in) wetthresh_evetr,
real(kind(1d0)), intent(in) wetthresh_dectr,
real(kind(1d0)), intent(in) wetthresh_grass,
real(kind(1d0)), intent(in) wetthresh_bsoil,
real(kind(1d0)), intent(in) wetthresh_water,
real(kind(1d0)), dimension(nsurf), intent(in) state_surf_in,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_surf_in,
real(kind(1d0)), dimension(nsurf), intent(in) qn_surf,
real(kind(1d0)), dimension(nsurf), intent(in) qs_surf,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_roof,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_roof,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_roof,
real(kind(1d0)), dimension(nlayer), intent(in) state_roof_in,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_roof_in,
real(kind(1d0)), dimension(nlayer), intent(in) qn_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qs_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nlayer), intent(in) statelimit_wall,
real(kind(1d0)), dimension(nlayer), intent(in) soilstorecap_wall,
real(kind(1d0)), dimension(nlayer), intent(in) wetthresh_wall,
real(kind(1d0)), dimension(nlayer), intent(in) state_wall_in,
real(kind(1d0)), dimension(nlayer), intent(in) soilstore_wall_in,
real(kind(1d0)), dimension(nlayer), intent(in) qn_wall,
real(kind(1d0)), dimension(nlayer), intent(in) qs_wall,
real(kind(1d0)), dimension(nsurf), intent(out) state_surf_out,
real(kind(1d0)), dimension(nsurf), intent(out) soilstore_surf_out,
real(kind(1d0)), dimension(nsurf), intent(out) ev_surf,
real(kind(1d0)), dimension(nlayer), intent(out) state_roof_out,
real(kind(1d0)), dimension(nlayer), intent(out) soilstore_roof_out,
real(kind(1d0)), dimension(nlayer) ev_roof,
real(kind(1d0)), dimension(nlayer), intent(out) state_wall_out,
real(kind(1d0)), dimension(nlayer), intent(out) soilstore_wall_out,
real(kind(1d0)), dimension(nlayer) ev_wall,
real(kind(1d0)), intent(out) state_grid,
real(kind(1d0)), intent(out) nwstate_grid,
real(kind(1d0)), dimension(nsurf), intent(out) ev0_surf,
real(kind(1d0)), dimension(nsurf), intent(out) qe0_surf,
real(kind(1d0)), intent(out) qe,
real(kind(1d0)), dimension(nsurf), intent(out) qe_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qe_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qe_wall,
real(kind(1d0)), intent(out) ev_grid,
real(kind(1d0)), intent(out) runoff_grid,
real(kind(1d0)), intent(out) surf_chang_grid,
real(kind(1d0)), intent(out) runoffpipes_grid,
real(kind(1d0)), intent(out) runoffwaterbody_grid,
real(kind(1d0)), intent(out) runoffagveg_grid,
real(kind(1d0)), intent(out) runoffagimpervious_grid,
real(kind(1d0)), dimension(nsurf), intent(out) rss_surf )

Definition at line 8406 of file suews_ctrl_driver.f95.

8440
8441 IMPLICIT NONE
8442
8443 INTEGER, INTENT(in) :: Diagnose
8444 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS [-]
8445 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
8446 INTEGER, INTENT(in) :: tstep !timesteps [s]
8447 ! INTEGER, INTENT(in) :: imin
8448 ! INTEGER, INTENT(in) :: it
8449 INTEGER, INTENT(in) :: EvapMethod !Evaporation calculated according to Rutter (1) or Shuttleworth (2)
8450
8451 REAL(KIND(1D0)), INTENT(in) :: lv_j_kg !Latent heat of vapourisation [J kg-1]
8452 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
8453 REAL(KIND(1D0)), INTENT(in) :: psyc_hPa !Psychometric constant [hPa]
8454 REAL(KIND(1D0)), INTENT(in) :: avcp ! air heat capacity [J kg-1 K-1]
8455
8456 REAL(KIND(1D0)), INTENT(in) :: PervFraction ! sum of surface cover fractions for impervious surfaces [-]
8457 ! REAL(KIND(1D0)), INTENT(in) :: vegfraction
8458 REAL(KIND(1D0)), INTENT(in) :: addimpervious !Water from impervious surfaces of other grids for whole surface area [mm]
8459
8460 REAL(KIND(1D0)), INTENT(in) :: qf ! athropogenic heat flux [W m-2]
8461
8462 REAL(KIND(1D0)), INTENT(in) :: vpd_hPa ! vapour pressure deficit [hPa]
8463 REAL(KIND(1D0)), INTENT(in) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
8464 REAL(KIND(1D0)), INTENT(in) :: RS !surface resistance [s m-1]
8465 REAL(KIND(1D0)), INTENT(in) :: RA_h !aerodynamic resistance [s m-1]
8466 REAL(KIND(1D0)), INTENT(in) :: RB !boundary layer resistance [s m-1]
8467 ! REAL(KIND(1D0)), INTENT(in) :: snowdensmin
8468 REAL(KIND(1D0)), INTENT(in) :: precip !rain data [mm]
8469 REAL(KIND(1D0)), INTENT(in) :: PipeCapacity !Capacity of pipes to transfer water [mm]
8470 REAL(KIND(1D0)), INTENT(in) :: RunoffToWater !Fraction of surface runoff going to water body [-]
8471 REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction !Fraction of non-water surface [-]
8472 ! REAL(KIND(1d0)), INTENT(in)::wu_EveTr!Water use for evergreen trees/shrubs [mm]
8473 ! REAL(KIND(1d0)), INTENT(in)::wu_DecTr!Water use for deciduous trees/shrubs [mm]
8474 ! REAL(KIND(1d0)), INTENT(in)::wu_Grass!Water use for grass [mm]
8475 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
8476 REAL(KIND(1D0)), INTENT(in) :: addWaterBody !Water from water surface of other grids [mm] for whole surface area
8477 ! REAL(KIND(1D0)), INTENT(in) :: SnowLimPaved
8478 ! REAL(KIND(1D0)), INTENT(in) :: SnowLimBldg
8479 ! REAL(KIND(1D0)), INTENT(in) :: SurfaceArea
8480 REAL(KIND(1D0)), INTENT(in) :: FlowChange !Difference between the input and output flow in the water body [mm]
8481
8482 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WU_surf !external water use of each surface type [mm]
8483 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: drain_surf !Drainage of each surface type [mm]
8484
8485 ! input for generic suews surfaces
8486 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
8487 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
8488 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
8489 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
8490 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
8491 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
8492 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
8493 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
8494
8495 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_paved
8496 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_bldg
8497 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_evetr
8498 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_dectr
8499 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_grass
8500 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_bsoil
8501 REAL(KIND(1D0)), INTENT(IN) :: StateLimit_water
8502 REAL(KIND(1D0)), DIMENSION(nsurf) :: StateLimit_surf !Limit for state_id of each surface type [mm] (specified in input files)
8503
8504 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_paved
8505 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_bldg
8506 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_evetr
8507 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_dectr
8508 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_grass
8509 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_bsoil
8510 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_water
8511 REAL(KIND(1D0)), DIMENSION(nsurf) :: WetThresh_surf !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
8512
8513 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_paved
8514 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bldg
8515 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_evetr
8516 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_dectr
8517 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_grass
8518 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bsoil
8519 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_water
8520 REAL(KIND(1D0)), DIMENSION(nsurf) :: SoilStoreCap_surf !Capacity of soil store for each surface [mm]
8521
8522 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_surf_in !wetness status of each surface type from previous timestep [mm]
8523 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_surf_in !initial water store in soil of each surface type [mm]
8524 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_surf ! latent heat flux of individual surface [W m-2]
8525 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qs_surf ! latent heat flux of individual surface [W m-2]
8526
8527 ! input for generic roof facets
8528 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof !surface fraction ratio of roof [-]
8529 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: StateLimit_roof !Limit for state_id of roof [mm]
8530 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: WetThresh_roof ! wetness threshold of roof[mm]
8531 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: SoilStoreCap_roof !Capacity of soil store for roof [mm]
8532 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_roof_in !wetness status of roof from previous timestep[mm]
8533 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_roof_in !Soil moisture of roof [mm]
8534 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qn_roof !net all-wave radiation for roof [W m-2]
8535 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qs_roof !heat storage flux for roof [W m-2]
8536
8537 ! input for generic wall facets
8538 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall !surface fraction ratio of wall [-]
8539 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: StateLimit_wall ! upper limit for state_id of wall [mm]
8540 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: WetThresh_wall ! wetness threshold of roof[mm]
8541 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: SoilStoreCap_wall !Capacity of soil store for wall [mm]
8542 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: state_wall_in !wetness status of wall from previous timestep[mm]
8543 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: soilstore_wall_in !Soil moisture of wall [mm]
8544 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qn_wall !net all-wave radiation for wall [W m-2]
8545 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qs_wall !heat storage flux for wall [W m-2]
8546
8547 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPackLimit
8548 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: AddWater_surf !Water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm]
8549 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: frac_water2runoff_surf !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
8550 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
8551 ! REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: SnowProf_24hr
8552
8553 ! Total water transported to each grid for grid-to-grid connectivity
8554 ! REAL(KIND(1D0)), INTENT(in) :: runoff_per_interval_in
8555 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_in
8556 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac_in
8557 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowWater_in
8558 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: iceFrac_in
8559 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowDens_in
8560
8561 ! output:
8562 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: state_surf_out !wetness status of each surface type [mm]
8563 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstore_surf_out !soil moisture of each surface type [mm]
8564 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: state_roof_out !Wetness status of roof [mm]
8565 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: soilstore_roof_out !soil moisture of roof [mm]
8566 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: state_wall_out !wetness status of wall [mm]
8567 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: soilstore_wall_out !soil moisture of wall [mm]
8568 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowPack_out
8569 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowFrac_out
8570 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowWater_out
8571 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: iceFrac_out
8572 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowDens_out
8573
8574 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: runoffSnow_surf !Initialize for runoff caused by snowmelting
8575 REAL(KIND(1D0)), DIMENSION(nsurf) :: runoff_surf !runoff from each surface type [mm]
8576 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: chang !Change in state_id [mm]
8577 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: ChangSnow_surf
8578 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: snowDepth
8579 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowToSurf
8580 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_snow
8581 ! REAL(KIND(1D0)), DIMENSION(2), INTENT(out) :: SnowRemoval
8582 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe0_surf !evaporation of each surface type by PM [mm]
8583 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: ev0_surf !evaporation of each surface type by PM [mm]
8584 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: ev_surf !evaporation of each surface type [mm]
8585 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: rss_surf !Redefined surface resistance for wet surfaces [s m-1]
8586
8587 ! REAL(KIND(1D0)) :: p_mm !Inputs to surface water balance
8588 ! REAL(KIND(1d0)),INTENT(out)::rss
8589 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe_surf ! latent heat flux on ground surface [W m-2]
8590 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_roof ! latent heat flux on roof [W m-2]
8591 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_wall ! latent heat flux on wall [W m-2]
8592 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_roof ! evaporation of roof [mm]
8593 REAL(KIND(1D0)), DIMENSION(nlayer) :: rss_roof ! redefined surface resistance for wet roof [s m-1]
8594 REAL(KIND(1D0)), DIMENSION(nlayer) :: runoff_roof !runoff from roof [mm]
8595 ! REAL(KIND(1D0)) :: qe_roof_total !turbulent latent heat flux on the roof [W m-2]
8596 REAL(KIND(1D0)), DIMENSION(nlayer) :: ev_wall ! evaporation of wall [mm]
8597 REAL(KIND(1D0)), DIMENSION(nlayer) :: rss_wall ! redefined surface resistance for wet wall [s m-1]
8598 REAL(KIND(1D0)), DIMENSION(nlayer) :: runoff_wall !runoff from wall [mm]
8599 ! REAL(KIND(1D0)) :: qe_wall_total !turbulent latent heat flux on the wall [W m-2]
8600 REAL(KIND(1D0)), INTENT(out) :: state_grid !total state_id (including water body) [mm]
8601 REAL(KIND(1D0)), INTENT(out) :: NWstate_grid !total state_id (excluding water body) [mm]
8602 REAL(KIND(1D0)), INTENT(out) :: qe ! aggregated latent heat flux of all surfaces [W m-2]
8603 ! REAL(KIND(1D0)), INTENT(out) :: swe
8604 ! REAL(KIND(1D0)) :: ev
8605 ! REAL(KIND(1D0)), INTENT(out) :: chSnow_per_interval
8606 REAL(KIND(1D0)), INTENT(out) :: ev_grid ! total evaporation for all surfaces [mm]
8607 ! REAL(KIND(1D0)) :: qe_grid ! total latent heat flux [W m-2] for all surfaces [W m-2]
8608 REAL(KIND(1D0)), INTENT(out) :: runoff_grid ! total runoff for all surfaces [mm]
8609 REAL(KIND(1D0)), INTENT(out) :: surf_chang_grid ! total change in surface state_id for all surfaces [mm]
8610 REAL(KIND(1D0)), INTENT(out) :: runoffPipes_grid ! !Runoff in pipes for all surface area [mm]
8611 ! REAL(KIND(1D0)), INTENT(out) :: mwstore
8612 REAL(KIND(1D0)), INTENT(out) :: runoffWaterBody_grid !Above ground runoff from water surface for all surface area [mm]
8613 ! REAL(KIND(1D0)) :: runoffWaterBody_m3
8614 ! REAL(KIND(1D0)) :: runoffPipes_m3
8615 REAL(KIND(1D0)), INTENT(out) :: runoffAGveg_grid !Above ground runoff from vegetated surfaces for all surface area [mm]
8616 REAL(KIND(1D0)), INTENT(out) :: runoffAGimpervious_grid !Above ground runoff from impervious surface for all surface area [mm]
8617
8618 ! local:
8619 ! INTEGER :: is
8620
8621 ! REAL(KIND(1D0)) :: runoff_per_interval
8622 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: state_id_out
8623 REAL(KIND(1D0)), DIMENSION(nsurf) :: soilstore_id !Soil moisture of each surface type [mm]
8624 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowPack
8625 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac
8626 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowWater
8627 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: iceFrac
8628 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDens
8629 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn_e_surf !net available energy for evaporation for each surface[W m-2]
8630 REAL(KIND(1D0)), DIMENSION(nlayer) :: qn_e_roof !net available energy for evaporation for roof[W m-2]
8631 REAL(KIND(1D0)), DIMENSION(nlayer) :: qn_e_wall !net available energy for evaporation for wall[W m-2]
8632
8633 REAL(KIND(1D0)) :: pin !Rain per time interval
8634 REAL(KIND(1D0)) :: tlv !Latent heat of vapourisation per timestep [J kg-1 s-1]
8635 REAL(KIND(1D0)) :: nsh_real !timesteps per hour
8636 REAL(KIND(1D0)) :: state_building !aggregated surface water of building facets [mm]
8637 REAL(KIND(1D0)) :: soilstore_building !aggregated soilstore of building facets[mm]
8638 REAL(KIND(1D0)) :: capStore_builing ! aggregated storage capacity of building facets[mm]
8639 REAL(KIND(1D0)) :: runoff_building !aggregated Runoff of building facets [mm]
8640 REAL(KIND(1D0)) :: qe_building !aggregated qe of building facets[W m-2]
8641
8642 REAL(KIND(1D0)), DIMENSION(7) :: capStore_surf ! current storage capacity [mm]
8643
8644 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
8645 statelimit_surf = [statelimit_paved, statelimit_bldg, statelimit_evetr, statelimit_dectr, &
8646 statelimit_grass, statelimit_bsoil, statelimit_water]
8647 soilstorecap_surf = [soilstorecap_paved, soilstorecap_bldg, soilstorecap_evetr, soilstorecap_dectr, &
8648 soilstorecap_grass, soilstorecap_bsoil, soilstorecap_water]
8649 wetthresh_surf = [wetthresh_paved, wetthresh_bldg, wetthresh_evetr, wetthresh_dectr, &
8650 wetthresh_grass, wetthresh_bsoil, wetthresh_water]
8651
8652 ! runoff_per_interval = runoff_per_interval_in
8653 state_surf_out = state_surf_in
8654 soilstore_id = soilstore_surf_in
8655
8656 nsh_real = 3600/tstep*1.d0
8657
8658 tlv = lv_j_kg/tstep*1.d0 !Latent heat of vapourisation per timestep
8659
8660 pin = max(0., precip) !Initiate rain data [mm]
8661
8662 ! force these facets to be totally dry
8663 ! TODO: need to consider their hydrologic dynamics
8664 qe_roof = 0
8665 qe_wall = 0
8666 qe0_surf = 0
8667
8668 IF (diagnose == 1) WRITE (*, *) 'Calling evap_SUEWS and SoilStore...'
8669 ! == calculate QE ==
8670 ! --- general suews surfaces ---
8671 ! net available energy for evaporation
8672 qn_e_surf = qn_surf + qf - qs_surf ! qn1 changed to qn1_snowfree, lj in May 2013
8673
8674 ! soil store capacity
8675 capstore_surf = storedrainprm(6, :)
8676 CALL cal_evap_multi( &
8677 evapmethod, & !input
8678 sfr_surf, state_surf_in, wetthresh_surf, capstore_surf, & !input
8679 vpd_hpa, avdens, avcp, qn_e_surf, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8680 rss_surf, ev0_surf, qe0_surf) !output
8681
8682 IF (storageheatmethod == 5) THEN
8683 ! --- roofs ---
8684 ! net available energy for evaporation
8685 qn_e_roof = qn_roof + qf - qs_roof ! qn1 changed to qn1_snowfree, lj in May 2013
8686 CALL cal_evap_multi( &
8687 evapmethod, & !input
8688 sfr_roof, state_roof_in, wetthresh_roof, statelimit_roof, & !input
8689 vpd_hpa, avdens, avcp, qn_e_roof, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8690 rss_roof, ev_roof, qe_roof) !output
8691
8692 ! --- walls ---
8693 ! net available energy for evaporation
8694 qn_e_wall = qn_wall + qf - qs_wall ! qn1 changed to qn1_snowfree, lj in May 2013
8695 CALL cal_evap_multi( &
8696 evapmethod, & !input
8697 sfr_wall, state_wall_in, wetthresh_wall, statelimit_wall, & !input
8698 vpd_hpa, avdens, avcp, qn_e_wall, s_hpa, psyc_hpa, rs, ra_h, rb, tlv, &
8699 rss_wall, ev_wall, qe_wall) !output
8700
8701 ! == calculate water balance ==
8702 ! --- building facets: roofs and walls ---
8703 CALL cal_water_storage_building( &
8704 pin, nsh_real, nlayer, &
8705 sfr_roof, statelimit_roof, soilstorecap_roof, wetthresh_roof, & ! input:
8706 ev_roof, state_roof_in, soilstore_roof_in, & ! input:
8707 sfr_wall, statelimit_wall, soilstorecap_wall, wetthresh_wall, & ! input:
8708 ev_wall, state_wall_in, soilstore_wall_in, & ! input:
8709 ev_roof, state_roof_out, soilstore_roof_out, runoff_roof, & ! general output:
8710 ev_wall, state_wall_out, soilstore_wall_out, runoff_wall, & ! general output:
8711 state_building, soilstore_building, runoff_building, capstore_builing)
8712
8713 ! update QE based on the water balance
8714 qe_roof = tlv*ev_roof
8715 qe_wall = tlv*ev_wall
8716
8717 IF (sfr_surf(bldgsurf) < 1.0e-8) THEN
8718 qe_building = 0.0
8719 ELSE
8720 qe_building = (dot_product(qe_roof, sfr_roof) + dot_product(qe_wall, sfr_wall))/sfr_surf(bldgsurf)
8721 END IF
8722 END IF
8723 ! --- general suews surfaces ---
8724 CALL cal_water_storage_surf( &
8725 pin, nsh_real, &
8726 pipecapacity, runofftowater, & ! input:
8727 addimpervious, addveg, addwaterbody, flowchange, &
8728 soilstorecap_surf, statelimit_surf, &
8729 pervfraction, &
8730 sfr_surf, drain_surf, addwater_surf, frac_water2runoff_surf, wu_surf, &
8731 ev0_surf, state_surf_in, soilstore_surf_in, &
8732 ev_surf, state_surf_out, soilstore_surf_out, & ! output:
8733 runoff_surf, &
8734 runoffagimpervious_grid, runoffagveg_grid, runoffpipes_grid, runoffwaterbody_grid & ! output:
8735 )
8736
8737 ! update QE based on the water balance
8738 qe_surf = tlv*ev_surf
8739
8740 ! --- update building related ---
8741 IF (storageheatmethod == 5) THEN
8742 ! update building specific values
8743 qe_surf(bldgsurf) = qe_building
8744 state_surf_out(bldgsurf) = state_building
8745 soilstore_surf_out(bldgsurf) = soilstore_building/capstore_builing*capstore_surf(bldgsurf)
8746 runoff_surf(bldgsurf) = runoff_building
8747 END IF
8748
8749 ! aggregate all surface water fluxes/amounts
8750 qe = dot_product(qe_surf, sfr_surf)
8751
8752 ! Sum change from different surfaces to find total change to surface state_id
8753 surf_chang_grid = dot_product(state_surf_out - state_surf_in, sfr_surf)
8754
8755 ! Sum evaporation from different surfaces to find total evaporation [mm]
8756 ev_grid = dot_product(ev_surf, sfr_surf)
8757
8758 ! Sum runoff from different surfaces to find total runoff
8759 runoff_grid = dot_product(runoff_surf, sfr_surf)
8760
8761 ! Calculate total state_id (including water body)
8762 state_grid = dot_product(state_surf_out, sfr_surf)
8763
8764 IF (nonwaterfraction /= 0) THEN
8765 nwstate_grid = dot_product(state_surf_out(1:nsurf - 1), sfr_surf(1:nsurf - 1))/nonwaterfraction
8766 END IF
8767 ! Calculate volume of water that will move between grids
8768 ! Volume [m3] = Depth relative to whole area [mm] / 1000 [mm m-1] * SurfaceArea [m2]
8769 ! Need to use these volumes when converting back to addImpervious, AddVeg and AddWater
8770 ! runoffAGimpervious_m3 = runoffAGimpervious/1000*SurfaceArea
8771 ! runoffAGveg_m3 = runoffAGveg/1000*SurfaceArea
8772 ! runoffWaterBody_m3 = runoffWaterBody/1000*SurfaceArea
8773 ! runoffPipes_m3 = runoffPipes/1000*SurfaceArea
8774
8775 ! state_id_out = state_id_out
8776 ! soilstore_id_out = soilstore_id
8777 IF (storageheatmethod == 5) THEN
8778 IF (diagnose == 1) print *, 'in SUEWS_cal_QE soilstore_building = ', soilstore_building
8779 IF (diagnose == 1) print *, 'in SUEWS_cal_QE capStore_builing = ', capstore_builing
8780 IF (diagnose == 1) print *, 'in SUEWS_cal_QE capStore_surf(BldgSurf) = ', capstore_surf(bldgsurf)
8781 END IF
8782 IF (diagnose == 1) print *, 'in SUEWS_cal_QE soilstore_id = ', soilstore_surf_out
8783

References allocatearray::bldgsurf, evap_module::cal_evap_multi(), waterdist_module::cal_water_storage_building(), waterdist_module::cal_water_storage_surf(), and allocatearray::nsurf.

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_qh()

subroutine suews_driver::suews_cal_qh ( integer, intent(in) qhmethod,
integer, intent(in) nlayer,
integer, intent(in) storageheatmethod,
real(kind(1d0)), intent(in) qn,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qmrain,
real(kind(1d0)), intent(in) qe,
real(kind(1d0)), intent(in) qs,
real(kind(1d0)), intent(in) qmfreez,
real(kind(1d0)), intent(in) qm,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(out) qh,
real(kind(1d0)), intent(out) qh_residual,
real(kind(1d0)), intent(out) qh_resist,
real(kind(1d0)), dimension(nsurf), intent(out) qh_resist_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qh_resist_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qh_resist_wall )

Definition at line 8788 of file suews_ctrl_driver.f95.

8797 IMPLICIT NONE
8798
8799 INTEGER, INTENT(in) :: QHMethod ! option for QH calculation: 1, residual; 2, resistance-based
8800 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS [-]
8801 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
8802
8803 REAL(KIND(1D0)), INTENT(in) :: qn !net all-wave radiation [W m-2]
8804 REAL(KIND(1D0)), INTENT(in) :: qf ! anthropogenic heat flux [W m-2]
8805 REAL(KIND(1D0)), INTENT(in) :: QmRain !melt heat for rain on snow [W m-2]
8806 REAL(KIND(1D0)), INTENT(in) :: qe !latent heat flux [W m-2]
8807 REAL(KIND(1D0)), INTENT(in) :: qs !heat storage flux [W m-2]
8808 REAL(KIND(1D0)), INTENT(in) :: QmFreez !heat related to freezing of surface store [W m-2]
8809 REAL(KIND(1D0)), INTENT(in) :: qm !Snowmelt-related heat [W m-2]
8810 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
8811 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
8812 ! REAL(KIND(1D0)), INTENT(in) :: tsurf
8813 REAL(KIND(1D0)), INTENT(in) :: Temp_C !air temperature [degC]
8814 REAL(KIND(1D0)), INTENT(in) :: RA !aerodynamic resistance [s m-1]
8815
8816 REAL(KIND(1D0)), INTENT(out) :: qh ! turtbulent sensible heat flux [W m-2]
8817 REAL(KIND(1D0)), INTENT(out) :: qh_resist !resistance bnased sensible heat flux [W m-2]
8818 REAL(KIND(1D0)), INTENT(out) :: qh_residual ! residual based sensible heat flux [W m-2]
8819 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf !surface temperature [degC]
8820 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !surface fraction ratio [-]
8821 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qh_resist_surf !resistance-based sensible heat flux [W m-2]
8822 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof !surface fraction of roof [-]
8823 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof !roof surface temperature [degC]
8824 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qh_resist_roof !resistance-based sensible heat flux of roof [W m-2]
8825 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall !surface fraction of wall [-]
8826 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall !wall surface temperature[degC]
8827 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qh_resist_wall !resistance-based sensible heat flux of wall [W m-2]
8828
8829 REAL(KIND(1D0)), PARAMETER :: NAN = -999
8830 INTEGER :: is
8831
8832 ! Calculate sensible heat flux as a residual (Modified by LJ in Nov 2012)
8833 qh_residual = (qn + qf + qmrain) - (qe + qs + qm + qmfreez) !qh=(qn1+qf+QmRain+QmFreez)-(qeOut+qs+Qm)
8834
8835 ! ! Calculate QH using resistance method (for testing HCW 06 Jul 2016)
8836 ! Aerodynamic-Resistance-based method
8837 DO is = 1, nsurf
8838 IF (ra /= 0) THEN
8839 qh_resist_surf(is) = avdens*avcp*(tsfc_surf(is) - temp_c)/ra
8840 ELSE
8841 qh_resist_surf(is) = nan
8842 END IF
8843 END DO
8844 IF (storageheatmethod == 5) THEN
8845 DO is = 1, nlayer
8846 IF (ra /= 0) THEN
8847 qh_resist_roof(is) = avdens*avcp*(tsfc_roof(is) - temp_c)/ra
8848 qh_resist_wall(is) = avdens*avcp*(tsfc_wall(is) - temp_c)/ra
8849 ELSE
8850 qh_resist_surf(is) = nan
8851 END IF
8852 END DO
8853
8854 ! IF (RA /= 0) THEN
8855 ! qh_resist = avdens*avcp*(tsurf - Temp_C)/RA
8856 ! ELSE
8857 ! qh_resist = NAN
8858 ! END IF
8859 ! aggregate QH of roof and wall
8860 qh_resist_surf(bldgsurf) = (dot_product(qh_resist_roof, sfr_roof) + dot_product(qh_resist_wall, sfr_wall))/2.
8861 END IF
8862
8863 qh_resist = dot_product(qh_resist_surf, sfr_surf)
8864
8865 ! choose output QH
8866 SELECT CASE (qhmethod)
8867 CASE (1)
8868 qh = qh_residual
8869 CASE (2)
8870 qh = qh_resist
8871 END SELECT
8872

References allocatearray::bldgsurf, and allocatearray::nsurf.

Referenced by suews_cal_main().

Here is the caller graph for this function:

◆ suews_cal_qh_dts()

subroutine suews_driver::suews_cal_qh_dts ( integer, intent(in) qhmethod,
integer, intent(in) nlayer,
integer, intent(in) storageheatmethod,
real(kind(1d0)), intent(in) qn,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qmrain,
real(kind(1d0)), intent(in) qe,
real(kind(1d0)), intent(in) qs,
real(kind(1d0)), intent(in) qmfreez,
real(kind(1d0)), intent(in) qm,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(out) qh,
real(kind(1d0)), intent(out) qh_residual,
real(kind(1d0)), intent(out) qh_resist,
real(kind(1d0)), dimension(nsurf), intent(out) qh_resist_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qh_resist_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qh_resist_wall )

Definition at line 8875 of file suews_ctrl_driver.f95.

8885 IMPLICIT NONE
8886
8887 INTEGER, INTENT(in) :: QHMethod ! option for QH calculation: 1, residual; 2, resistance-based
8888 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS [-]
8889 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
8890
8891 REAL(KIND(1D0)), INTENT(in) :: qn !net all-wave radiation [W m-2]
8892 REAL(KIND(1D0)), INTENT(in) :: qf ! anthropogenic heat flux [W m-2]
8893 REAL(KIND(1D0)), INTENT(in) :: QmRain !melt heat for rain on snow [W m-2]
8894 REAL(KIND(1D0)), INTENT(in) :: qe !latent heat flux [W m-2]
8895 REAL(KIND(1D0)), INTENT(in) :: qs !heat storage flux [W m-2]
8896 REAL(KIND(1D0)), INTENT(in) :: QmFreez !heat related to freezing of surface store [W m-2]
8897 REAL(KIND(1D0)), INTENT(in) :: qm !Snowmelt-related heat [W m-2]
8898 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
8899 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
8900 ! REAL(KIND(1D0)), INTENT(in) :: tsurf
8901 REAL(KIND(1D0)), INTENT(in) :: Temp_C !air temperature [degC]
8902 REAL(KIND(1D0)), INTENT(in) :: RA !aerodynamic resistance [s m-1]
8903
8904 REAL(KIND(1D0)), INTENT(out) :: qh ! turtbulent sensible heat flux [W m-2]
8905 REAL(KIND(1D0)), INTENT(out) :: qh_resist !resistance bnased sensible heat flux [W m-2]
8906 REAL(KIND(1D0)), INTENT(out) :: qh_residual ! residual based sensible heat flux [W m-2]
8907 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf !surface temperature [degC]
8908
8909 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
8910 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
8911 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
8912 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
8913 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
8914 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
8915 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
8916 REAL(KIND(1D0)), DIMENSION(nsurf) :: sfr_surf !surface fraction ratio [-]
8917
8918 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qh_resist_surf !resistance-based sensible heat flux [W m-2]
8919 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof !surface fraction of roof [-]
8920 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof !roof surface temperature [degC]
8921 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qh_resist_roof !resistance-based sensible heat flux of roof [W m-2]
8922 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall !surface fraction of wall [-]
8923 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall !wall surface temperature[degC]
8924 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qh_resist_wall !resistance-based sensible heat flux of wall [W m-2]
8925
8926 REAL(KIND(1D0)), PARAMETER :: NAN = -999
8927 INTEGER :: is
8928
8929 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
8930 ! Calculate sensible heat flux as a residual (Modified by LJ in Nov 2012)
8931 qh_residual = (qn + qf + qmrain) - (qe + qs + qm + qmfreez) !qh=(qn1+qf+QmRain+QmFreez)-(qeOut+qs+Qm)
8932
8933 ! ! Calculate QH using resistance method (for testing HCW 06 Jul 2016)
8934 ! Aerodynamic-Resistance-based method
8935 DO is = 1, nsurf
8936 IF (ra /= 0) THEN
8937 qh_resist_surf(is) = avdens*avcp*(tsfc_surf(is) - temp_c)/ra
8938 ELSE
8939 qh_resist_surf(is) = nan
8940 END IF
8941 END DO
8942 IF (storageheatmethod == 5) THEN
8943 DO is = 1, nlayer
8944 IF (ra /= 0) THEN
8945 qh_resist_roof(is) = avdens*avcp*(tsfc_roof(is) - temp_c)/ra
8946 qh_resist_wall(is) = avdens*avcp*(tsfc_wall(is) - temp_c)/ra
8947 ELSE
8948 qh_resist_surf(is) = nan
8949 END IF
8950 END DO
8951
8952 ! IF (RA /= 0) THEN
8953 ! qh_resist = avdens*avcp*(tsurf - Temp_C)/RA
8954 ! ELSE
8955 ! qh_resist = NAN
8956 ! END IF
8957 ! aggregate QH of roof and wall
8958 qh_resist_surf(bldgsurf) = (dot_product(qh_resist_roof, sfr_roof) + dot_product(qh_resist_wall, sfr_wall))/2.
8959 END IF
8960
8961 qh_resist = dot_product(qh_resist_surf, sfr_surf)
8962
8963 ! choose output QH
8964 SELECT CASE (qhmethod)
8965 CASE (1)
8966 qh = qh_residual
8967 CASE (2)
8968 qh = qh_resist
8969 END SELECT
8970

References allocatearray::bldgsurf, and allocatearray::nsurf.

Referenced by suews_cal_main_dts().

Here is the caller graph for this function:

◆ suews_cal_qn()

subroutine suews_driver::suews_cal_qn ( integer, intent(in) storageheatmethod,
integer, intent(in) netradiationmethod,
integer, intent(in) snowuse,
integer, intent(in) tstep,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) snowpack_prev,
real(kind(1d0)), intent(in) tau_a,
real(kind(1d0)), intent(in) tau_f,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) snowalbmin,
integer, intent(in) diagnose,
real(kind(1d0)), intent(in) ldown_obs,
real(kind(1d0)), intent(in) fcld_obs,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(in) zenith_deg,
real(kind(1d0)), intent(in) tsurf_0,
real(kind(1d0)), intent(in) kdown,
real(kind(1d0)), intent(in) tair_c,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) ea_hpa,
real(kind(1d0)), intent(in) qn1_obs,
real(kind(1d0)), intent(in) snowalb_prev,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac_prev,
integer, intent(in) diagqn,
real(kind(1d0)), intent(in) narp_trans_site,
real(kind(1d0)), intent(in) narp_emis_snow,
real(kind(1d0)), dimension(nsurf), intent(in) icefrac,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), dimension(nsurf), intent(in) emis,
real(kind(1d0)), dimension(nsurf), intent(in) alb_prev,
real(kind(1d0)), intent(in) albdectr_id,
real(kind(1d0)), intent(in) albevetr_id,
real(kind(1d0)), intent(in) albgrass_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
integer, intent(in) n_vegetation_region_urban,
integer, intent(in) n_stream_sw_urban,
integer, intent(in) n_stream_lw_urban,
real(kind(1d0)), intent(in) sw_dn_direct_frac,
real(kind(1d0)), intent(in) air_ext_sw,
real(kind(1d0)), intent(in) air_ssa_sw,
real(kind(1d0)), intent(in) veg_ssa_sw,
real(kind(1d0)), intent(in) air_ext_lw,
real(kind(1d0)), intent(in) air_ssa_lw,
real(kind(1d0)), intent(in) veg_ssa_lw,
real(kind(1d0)), intent(in) veg_fsd_const,
real(kind(1d0)), intent(in) veg_contact_fraction_const,
real(kind(1d0)), intent(in) ground_albedo_dir_mult_fact,
logical, intent(in) use_sw_direct_albedo,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) veg_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer), intent(in) veg_scale,
real(kind(1d0)), dimension(nlayer), intent(in) alb_roof,
real(kind(1d0)), dimension(nlayer), intent(in) emis_roof,
real(kind(1d0)), dimension(nlayer), intent(in) alb_wall,
real(kind(1d0)), dimension(nlayer), intent(in) emis_wall,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) roof_albedo_dir_mult_fact,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) wall_specular_frac,
real(kind(1d0)), dimension(nsurf), intent(out) alb_next,
real(kind(1d0)), intent(out) ldown,
real(kind(1d0)), intent(out) fcld,
real(kind(1d0)), dimension(nsurf), intent(out) qn_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qn_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qn_wall,
real(kind(1d0)), intent(out) qn,
real(kind(1d0)), intent(out) qn_snowfree,
real(kind(1d0)), intent(out) qn_snow,
real(kind(1d0)), intent(out) kclear,
real(kind(1d0)), intent(out) kup,
real(kind(1d0)), intent(out) lup,
real(kind(1d0)), intent(out) tsurf,
real(kind(1d0)), dimension(nsurf), intent(out) qn_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) kup_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) tsurf_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) tsurf_ind,
real(kind(1d0)), intent(out) albedo_snow,
real(kind(1d0)), intent(out) snowalb_next,
real(kind(1d0)), dimension(ncolumnsdataoutspartacus - 5), intent(out) dataoutlinespartacus )

Definition at line 5632 of file suews_ctrl_driver.f95.

5658 USE narp_module, ONLY: radmethod, narp
5659 USE spartacus_module, ONLY: spartacus
5660
5661 IMPLICIT NONE
5662 ! INTEGER,PARAMETER ::nsurf = 7 ! number of surface types
5663 ! INTEGER,PARAMETER ::ConifSurf = 3 !New surface classes: Grass = 5th/7 surfaces
5664 ! INTEGER,PARAMETER ::DecidSurf = 4 !New surface classes: Grass = 5th/7 surfaces
5665 ! INTEGER,PARAMETER ::GrassSurf = 5
5666
5667 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS
5668 INTEGER, INTENT(in) :: NetRadiationMethod !Determines method for calculation of radiation fluxes
5669 INTEGER, INTENT(in) :: SnowUse !Determines whether the snow part of the model runs; 0-Snow calculations are not performed.1-Snow calculations are performed.
5670 INTEGER, INTENT(in) :: Diagnose
5671 INTEGER, INTENT(in) :: DiagQN
5672 INTEGER, INTENT(in) :: tstep !timestep [s]
5673 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
5674
5675 ! REAL(KIND(1D0)), INTENT(in) :: snowFrac_obs
5676 REAL(KIND(1D0)), INTENT(in) :: ldown_obs !observed incoming longwave radiation [W m-2]
5677 REAL(KIND(1D0)), INTENT(in) :: fcld_obs !observed cloud fraction [-]
5678 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
5679 REAL(KIND(1D0)), INTENT(in) :: ZENITH_deg !solar zenith angle in degree [°]
5680 REAL(KIND(1D0)), INTENT(in) :: Tsurf_0
5681 REAL(KIND(1D0)), INTENT(in) :: kdown !incoming shortwave radiation [W m-2]
5682 REAL(KIND(1D0)), INTENT(in) :: Tair_C !Air temperature in degree C [degC]
5683 REAL(KIND(1D0)), INTENT(in) :: avRH !average relative humidity (%) in each layer [-]
5684 REAL(KIND(1D0)), INTENT(in) :: ea_hPa !vapor pressure [hPa]
5685 REAL(KIND(1D0)), INTENT(in) :: qn1_obs !observed net wall-wave radiation [W m-2]
5686 REAL(KIND(1D0)), INTENT(in) :: SnowAlb_prev ! snow albedo at previous timestep [-]
5687 REAL(KIND(1D0)), INTENT(in) :: NARP_EMIS_SNOW ! snow emissivity in NARP model [-]
5688 REAL(KIND(1D0)), INTENT(in) :: NARP_TRANS_SITE !Atmospheric transmissivity for NARP [-]
5689 REAL(KIND(1D0)), INTENT(in) :: tau_a, tau_f, SnowAlbMax, SnowAlbMin !tau_a=Time constant for snow albedo aging in cold snow [-], tau_f=Time constant for snow albedo aging in melting snow [-], SnowAlbMax=maxmimum snow albedo, SnowAlbMin=minimum snow albedo
5690
5691 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAI_id !LAI for day of year [m2 m-3]
5692
5693 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: IceFrac !fraction of ice in snowpack [-]
5694 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !fraction of each surfaces [-]
5695 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf ! surface temperature [degC]
5696 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof ! surface fraction of roofs at each surfaces [-]
5697 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof ! roof surface temperature [degC]
5698 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall ! surface fraction of walls at each surfaces [-]
5699 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall ! wall surface temperature [degC]
5700
5701 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: emis ! Effective surface emissivity. [-]
5702 REAL(KIND(1D0)), DIMENSION(nsurf) :: alb ! surface albedo [-]
5703 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: alb_prev ! input surface albedo [-]
5704 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: alb_next ! output surface albedo [-]
5705 REAL(KIND(1D0)), INTENT(in) :: albDecTr_id !!albedo for deciduous trees on day of year [-]
5706 ! REAL(KIND(1d0)), INTENT(in) ::DecidCap_id
5707 REAL(KIND(1D0)), INTENT(in) :: albEveTr_id !albedo for evergreen trees and shrubs on day of year [-]
5708 REAL(KIND(1D0)), INTENT(in) :: albGrass_id !albedo for grass on day of year [-]
5709
5710 ! REAL(KIND(1d0)), DIMENSION(6, nsurf), INTENT(inout)::StoreDrainPrm
5711
5712 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_prev !initial snow water equivalent on each land cover [mm]
5713 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: snowFrac_prev !initial snow fraction [-]
5714 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: snowFrac_next
5715 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac ! snow fractions of each surface [-]
5716
5717 REAL(KIND(1D0)), INTENT(out) :: ldown ! output incoming longwave radiation [W m-2]
5718 REAL(KIND(1D0)), INTENT(out) :: fcld ! estimated cloud fraction [-](used only for emissivity estimate)
5719 REAL(KIND(1D0)), INTENT(out) :: qn ! output net all-wave radiation [W m-2]
5720 REAL(KIND(1D0)), INTENT(out) :: qn_snowfree !output net all-wave radiation for snow free surface [W m-2]
5721 REAL(KIND(1D0)), INTENT(out) :: qn_snow ! output net all-wave radiation for snowpack [W m-2]
5722 REAL(KIND(1D0)), INTENT(out) :: kclear !output clear sky incoming shortwave radiation [W m-2]
5723 REAL(KIND(1D0)), INTENT(out) :: kup !output outgoing shortwave radiation [W m-2]
5724 REAL(KIND(1D0)), INTENT(out) :: lup !output outgoing longwave radiation [W m-2]
5725 REAL(KIND(1D0)), INTENT(out) :: tsurf !output surface temperature [degC]
5726 REAL(KIND(1D0)), INTENT(out) :: albedo_snow !estimated albedo of snow [-]
5727 REAL(KIND(1D0)), INTENT(out) :: SnowAlb_next !output snow albedo [-]
5728 REAL(KIND(1D0)) :: albedo_snowfree !estimated albedo for snow-free surface [-]
5729 REAL(KIND(1D0)) :: SnowAlb ! updated snow albedo [-]
5730
5731 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qn_surf !net all-wave radiation on each surface [W m-2]
5732 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qn_ind_snow !net all-wave radiation on snowpack [W m-2]
5733 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: kup_ind_snow !outgoing shortwave on snowpack [W m-2]
5734 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: Tsurf_ind_snow !snowpack surface temperature [C]
5735 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: tsurf_ind !snow-free surface temperature [C]
5736
5737 REAL(KIND(1D0)), DIMENSION(nsurf) :: lup_ind !outgoing longwave radiation from observation [W m-2]
5738 REAL(KIND(1D0)), DIMENSION(nsurf) :: kup_ind !outgoing shortwave radiation from observation [W m-2]
5739 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn1_ind !net all-wave radiation from observation [W m-2]
5740
5741 REAL(KIND(1D0)), PARAMETER :: NAN = -999
5742 INTEGER :: NetRadiationMethod_use
5743 INTEGER :: AlbedoChoice, ldown_option
5744
5745 ! SPARTACUS output variables
5746 ! REAL(KIND(1D0)), INTENT(OUT) :: alb_spc, emis_spc, lw_emission_spc, lw_up_spc, sw_up_spc, qn_spc
5747 ! REAL(KIND(1D0)), INTENT(OUT) :: top_net_lw_spc, ground_net_lw_spc, top_dn_lw_spc
5748 ! REAL(KIND(1D0)), DIMENSION(15), INTENT(OUT) :: clear_air_abs_lw_spc, wall_net_lw_spc, roof_net_lw_spc, &
5749 ! roof_in_lw_spc
5750 ! REAL(KIND(1D0)), INTENT(OUT) :: top_dn_dir_sw_spc, top_net_sw_spc, ground_dn_dir_sw_spc, ground_net_sw_spc
5751 ! REAL(KIND(1D0)), DIMENSION(15), INTENT(OUT) :: clear_air_abs_sw_spc, wall_net_sw_spc, roof_net_sw_spc, &
5752 ! roof_in_sw_spc
5753
5754 ! SPARTACUS input variables
5755 INTEGER, INTENT(IN) :: n_vegetation_region_urban, &
5756 n_stream_sw_urban, n_stream_lw_urban
5757 REAL(KIND(1D0)), INTENT(IN) :: sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
5758 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
5759 veg_fsd_const, veg_contact_fraction_const, &
5760 ground_albedo_dir_mult_fact
5761 LOGICAL, INTENT(IN) :: use_sw_direct_albedo !boolean, Specify ground and roof albedos separately for direct solar radiation [-]
5762
5763 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height ! height in spartacus [m]
5764 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac ! building fraction [-]
5765 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_frac !vegetation fraction [-]
5766 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale ! diameter of buildings [[m]. The only L method for buildings is Eq. 19 Hogan et al. 2018.
5767 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_scale ! scale of tree crowns [m]. Using the default use_symmetric_vegetation_scale_urban=.TRUE. so that Eq. 20 Hogan et al. 2018 is used for L.
5768 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_roof !albedo of roof [-]
5769 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_roof ! emissivity of roof [-]
5770 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_wall !albedo of wall [-]
5771 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_wall ! emissivity of wall [-]
5772 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: roof_albedo_dir_mult_fact !Ratio of the direct and diffuse albedo of the roof [-]
5773 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: wall_specular_frac ! Fraction of wall reflection that is specular [-]
5774 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qn_wall ! net all-wave radiation on the wall [W m-2]
5775 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qn_roof ! net all-wave radiation on the roof [W m-2]
5776
5777 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSPARTACUS - 5), INTENT(OUT) :: dataOutLineSPARTACUS
5778
5779 ! translate values
5780 alb = alb_prev
5781
5782 ! update snow albedo
5783 snowalb = update_snow_albedo( &
5784 tstep, snowpack_prev, snowalb_prev, tair_c, &
5785 tau_a, tau_f, snowalbmax, snowalbmin)
5786
5787 CALL radmethod( &
5788 netradiationmethod, & !input
5789 snowuse, & !input
5790 netradiationmethod_use, albedochoice, ldown_option) !output
5791
5792 snowfrac = snowfrac_prev
5793 IF (netradiationmethod_use > 0) THEN
5794
5795 ! IF (SnowUse==0) SnowFrac=snowFrac_obs
5796 IF (snowuse == 0) snowfrac = 0
5797
5798 IF (ldown_option == 2) THEN !observed cloud fraction provided as forcing
5799 fcld = fcld_obs
5800 END IF
5801
5802 !write(*,*) DecidCap(id), id, it, imin, 'Calc - near start'
5803
5804 ! Update variables that change daily and represent seasonal variability
5805 alb(decidsurf) = albdectr_id !Change deciduous albedo
5806 ! StoreDrainPrm(6, DecidSurf) = DecidCap_id !Change current storage capacity of deciduous trees
5807 ! Change EveTr and Grass albedo too
5808 alb(conifsurf) = albevetr_id
5809 alb(grasssurf) = albgrass_id
5810
5811 IF (diagnose == 1) WRITE (*, *) 'Calling NARP...'
5812 IF (diagqn == 1) WRITE (*, *) 'NetRadiationMethodX:', netradiationmethod_use
5813 IF (diagqn == 1) WRITE (*, *) 'AlbedoChoice:', albedochoice
5814
5815 ! TODO: TS 14 Feb 2022, ESTM development:
5816 ! here we use uniform `tsurf_0` for all land covers, which should be distinguished in future developments
5817
5818 CALL narp( &
5819 storageheatmethod, & !input:
5820 nsurf, sfr_surf, tsfc_surf, snowfrac, alb, emis, icefrac, & !
5821 narp_trans_site, narp_emis_snow, &
5822 dectime, zenith_deg, tsurf_0, kdown, tair_c, avrh, ea_hpa, qn1_obs, ldown_obs, &
5823 snowalb, &
5824 albedochoice, ldown_option, netradiationmethod_use, diagqn, &
5825 qn_surf, & ! output:
5826 qn, qn_snowfree, qn_snow, kclear, kup, ldown, lup, fcld, tsurf, & ! output:
5827 qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, albedo_snowfree, albedo_snow)
5828
5829 IF (diagqn == 1) WRITE (*, *) 'Calling SPARTACUS:'
5830 IF (netradiationmethod > 1000) THEN
5831 ! TODO: TS 14 Feb 2022, ESTM development: introduce facet surface temperatures
5832 CALL spartacus( &
5833 diagqn, & !input:
5834 sfr_surf, zenith_deg, nlayer, & !input:
5835 tsfc_surf, tsfc_roof, tsfc_wall, &
5836 kdown, ldown, tair_c, alb, emis, lai_id, &
5837 n_vegetation_region_urban, &
5838 n_stream_sw_urban, n_stream_lw_urban, &
5839 sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
5840 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
5841 veg_fsd_const, veg_contact_fraction_const, &
5842 ground_albedo_dir_mult_fact, use_sw_direct_albedo, &
5843 height, building_frac, veg_frac, sfr_roof, sfr_wall, &
5844 building_scale, veg_scale, & !input:
5845 alb_roof, emis_roof, alb_wall, emis_wall, &
5846 roof_albedo_dir_mult_fact, wall_specular_frac, &
5847 qn, kup, lup, qn_roof, qn_wall, qn_surf, & !output:
5848 dataoutlinespartacus)
5849 ELSE
5850 qn_roof = qn_surf(bldgsurf)
5851 qn_wall = qn_surf(bldgsurf)
5852 END IF
5853
5854 ELSE ! NetRadiationMethod==0
5855 ! SnowFrac = snowFrac_obs
5856 qn = qn1_obs
5857 qn_snowfree = qn1_obs
5858 qn_snow = qn1_obs
5859 ldown = nan
5860 lup = nan
5861 kup = nan
5862 tsurf = nan
5863 lup_ind = nan
5864 kup_ind = nan
5865 tsurf_ind = nan
5866 qn1_ind = nan
5867 fcld = nan
5868 qn_surf = qn
5869 qn_roof = qn_surf(bldgsurf)
5870 qn_wall = qn_surf(bldgsurf)
5871 END IF
5872 ! snowFrac_next = SnowFrac
5873
5874 IF (ldown_option == 1) THEN
5875 fcld = nan
5876 END IF
5877
5878 ! translate values
5879 alb_next = alb
5880 snowalb_next = snowalb
5881
subroutine radmethod(netradiationmethod, snowuse, netradiationmethod_use, albedochoice, ldown_option)
subroutine narp(storageheatmethod, nsurf, sfr_surf, tsfc_surf, snowfrac, alb, emis, icefrac, narp_trans_site, narp_emis_snow, dtime, zenith_deg, tsurf_0, kdown, temp_c, rh, press_hpa, qn1_obs, ldown_obs, snowalb, albedochoice, ldown_option, netradiationmethod_use, diagqn, qn_surf, qstarall, qstar_sf, qstar_s, kclear, kupall, ldown, lupall, fcld, tsurfall, qn1_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_surf, albedo_snowfree, albedo_snow)
subroutine spartacus(diagqn, sfr_surf, zenith_deg, nlayer, tsfc_surf, tsfc_roof, tsfc_wall, kdown, ldown, tair_c, alb_surf, emis_surf, lai_id, n_vegetation_region_urban, n_stream_sw_urban, n_stream_lw_urban, sw_dn_direct_frac, air_ext_sw, air_ssa_sw, veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, veg_fsd_const, veg_contact_fraction_const, ground_albedo_dir_mult_fact, use_sw_direct_albedo, height, building_frac, veg_frac, sfr_roof, sfr_wall, building_scale, veg_scale, alb_roof, emis_roof, alb_wall, emis_wall, roof_albedo_dir_mult_fact, wall_specular_frac, qn, kup, lup, qn_roof, qn_wall, qn_surf, dataoutlinespartacus)

References allocatearray::bldgsurf, allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, narp_module::narp(), allocatearray::nsurf, narp_module::radmethod(), spartacus_module::spartacus(), and snow_module::update_snow_albedo().

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_qn_dts()

subroutine suews_driver::suews_cal_qn_dts ( integer, intent(in) storageheatmethod,
integer, intent(in) netradiationmethod,
integer, intent(in) snowuse,
integer, intent(in) tstep,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) snowpack_prev,
real(kind(1d0)), intent(in) tau_a,
real(kind(1d0)), intent(in) tau_f,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) snowalbmin,
integer, intent(in) diagnose,
real(kind(1d0)), intent(in) ldown_obs,
real(kind(1d0)), intent(in) fcld_obs,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(in) zenith_deg,
real(kind(1d0)), intent(in) tsurf_0,
real(kind(1d0)), intent(in) kdown,
real(kind(1d0)), intent(in) tair_c,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) ea_hpa,
real(kind(1d0)), intent(in) qn1_obs,
real(kind(1d0)), intent(in) snowalb_prev,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac_prev,
integer, intent(in) diagqn,
real(kind(1d0)), intent(in) narp_trans_site,
real(kind(1d0)), intent(in) narp_emis_snow,
real(kind(1d0)), dimension(nsurf), intent(in) icefrac,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), intent(in) emis_paved,
real(kind(1d0)), intent(in) emis_bldg,
real(kind(1d0)), intent(in) emis_evetr,
real(kind(1d0)), intent(in) emis_dectr,
real(kind(1d0)), intent(in) emis_grass,
real(kind(1d0)), intent(in) emis_bsoil,
real(kind(1d0)), intent(in) emis_water,
real(kind(1d0)), dimension(nsurf), intent(in) alb_prev,
real(kind(1d0)), intent(in) albdectr_id,
real(kind(1d0)), intent(in) albevetr_id,
real(kind(1d0)), intent(in) albgrass_id,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
integer, intent(in) n_vegetation_region_urban,
integer, intent(in) n_stream_sw_urban,
integer, intent(in) n_stream_lw_urban,
real(kind(1d0)), intent(in) sw_dn_direct_frac,
real(kind(1d0)), intent(in) air_ext_sw,
real(kind(1d0)), intent(in) air_ssa_sw,
real(kind(1d0)), intent(in) veg_ssa_sw,
real(kind(1d0)), intent(in) air_ext_lw,
real(kind(1d0)), intent(in) air_ssa_lw,
real(kind(1d0)), intent(in) veg_ssa_lw,
real(kind(1d0)), intent(in) veg_fsd_const,
real(kind(1d0)), intent(in) veg_contact_fraction_const,
real(kind(1d0)), intent(in) ground_albedo_dir_mult_fact,
logical, intent(in) use_sw_direct_albedo,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) veg_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer), intent(in) veg_scale,
real(kind(1d0)), dimension(nlayer), intent(in) alb_roof,
real(kind(1d0)), dimension(nlayer), intent(in) emis_roof,
real(kind(1d0)), dimension(nlayer), intent(in) alb_wall,
real(kind(1d0)), dimension(nlayer), intent(in) emis_wall,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) roof_albedo_dir_mult_fact,
real(kind(1d0)), dimension(nspec, nlayer), intent(in) wall_specular_frac,
real(kind(1d0)), dimension(nsurf), intent(out) alb_next,
real(kind(1d0)), intent(out) ldown,
real(kind(1d0)), intent(out) fcld,
real(kind(1d0)), dimension(nsurf), intent(out) qn_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qn_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qn_wall,
real(kind(1d0)), intent(out) qn,
real(kind(1d0)), intent(out) qn_snowfree,
real(kind(1d0)), intent(out) qn_snow,
real(kind(1d0)), intent(out) kclear,
real(kind(1d0)), intent(out) kup,
real(kind(1d0)), intent(out) lup,
real(kind(1d0)), intent(out) tsurf,
real(kind(1d0)), dimension(nsurf), intent(out) qn_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) kup_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) tsurf_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(out) tsurf_ind,
real(kind(1d0)), intent(out) albedo_snow,
real(kind(1d0)), intent(out) snowalb_next,
real(kind(1d0)), dimension(ncolumnsdataoutspartacus - 5), intent(out) dataoutlinespartacus )

Definition at line 5884 of file suews_ctrl_driver.f95.

5912 USE narp_module, ONLY: radmethod, narp
5913 USE spartacus_module, ONLY: spartacus
5914
5915 IMPLICIT NONE
5916 ! INTEGER,PARAMETER ::nsurf = 7 ! number of surface types
5917 ! INTEGER,PARAMETER ::ConifSurf = 3 !New surface classes: Grass = 5th/7 surfaces
5918 ! INTEGER,PARAMETER ::DecidSurf = 4 !New surface classes: Grass = 5th/7 surfaces
5919 ! INTEGER,PARAMETER ::GrassSurf = 5
5920
5921 INTEGER, INTENT(in) :: storageheatmethod !Determines method for calculating storage heat flux ΔQS
5922 INTEGER, INTENT(in) :: NetRadiationMethod !Determines method for calculation of radiation fluxes
5923 INTEGER, INTENT(in) :: SnowUse !Determines whether the snow part of the model runs; 0-Snow calculations are not performed.1-Snow calculations are performed.
5924 INTEGER, INTENT(in) :: Diagnose
5925 INTEGER, INTENT(in) :: DiagQN
5926 INTEGER, INTENT(in) :: tstep !timestep [s]
5927 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
5928
5929 ! REAL(KIND(1D0)), INTENT(in) :: snowFrac_obs
5930 REAL(KIND(1D0)), INTENT(in) :: ldown_obs !observed incoming longwave radiation [W m-2]
5931 REAL(KIND(1D0)), INTENT(in) :: fcld_obs !observed cloud fraction [-]
5932 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
5933 REAL(KIND(1D0)), INTENT(in) :: ZENITH_deg !solar zenith angle in degree [°]
5934 REAL(KIND(1D0)), INTENT(in) :: Tsurf_0
5935 REAL(KIND(1D0)), INTENT(in) :: kdown !incoming shortwave radiation [W m-2]
5936 REAL(KIND(1D0)), INTENT(in) :: Tair_C !Air temperature in degree C [degC]
5937 REAL(KIND(1D0)), INTENT(in) :: avRH !average relative humidity (%) in each layer [-]
5938 REAL(KIND(1D0)), INTENT(in) :: ea_hPa !vapor pressure [hPa]
5939 REAL(KIND(1D0)), INTENT(in) :: qn1_obs !observed net wall-wave radiation [W m-2]
5940 REAL(KIND(1D0)), INTENT(in) :: SnowAlb_prev ! snow albedo at previous timestep [-]
5941 REAL(KIND(1D0)), INTENT(in) :: NARP_EMIS_SNOW ! snow emissivity in NARP model [-]
5942 REAL(KIND(1D0)), INTENT(in) :: NARP_TRANS_SITE !Atmospheric transmissivity for NARP [-]
5943 REAL(KIND(1D0)), INTENT(in) :: tau_a, tau_f, SnowAlbMax, SnowAlbMin !tau_a=Time constant for snow albedo aging in cold snow [-], tau_f=Time constant for snow albedo aging in melting snow [-], SnowAlbMax=maxmimum snow albedo, SnowAlbMin=minimum snow albedo
5944
5945 REAL(KIND(1D0)), DIMENSION(nvegsurf), INTENT(in) :: LAI_id !LAI for day of year [m2 m-3]
5946
5947 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: IceFrac !fraction of ice in snowpack [-]
5948
5949 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
5950 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
5951 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
5952 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
5953 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
5954 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
5955 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
5956 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
5957
5958 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf ! surface temperature [degC]
5959 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof ! surface fraction of roofs at each surfaces [-]
5960 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof ! roof surface temperature [degC]
5961 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall ! surface fraction of walls at each surfaces [-]
5962 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall ! wall surface temperature [degC]
5963
5964 REAL(KIND(1D0)), INTENT(IN) :: emis_paved
5965 REAL(KIND(1D0)), INTENT(IN) :: emis_bldg
5966 REAL(KIND(1D0)), INTENT(IN) :: emis_evetr
5967 REAL(KIND(1D0)), INTENT(IN) :: emis_dectr
5968 REAL(KIND(1D0)), INTENT(IN) :: emis_grass
5969 REAL(KIND(1D0)), INTENT(IN) :: emis_bsoil
5970 REAL(KIND(1D0)), INTENT(IN) :: emis_water
5971 REAL(KIND(1D0)), DIMENSION(nsurf) :: emis ! Effective surface emissivity. [-]
5972
5973 REAL(KIND(1D0)), DIMENSION(nsurf) :: alb ! surface albedo [-]
5974 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: alb_prev ! input surface albedo [-]
5975 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: alb_next ! output surface albedo [-]
5976 REAL(KIND(1D0)), INTENT(in) :: albDecTr_id !!albedo for deciduous trees on day of year [-]
5977 ! REAL(KIND(1d0)), INTENT(in) ::DecidCap_id
5978 REAL(KIND(1D0)), INTENT(in) :: albEveTr_id !albedo for evergreen trees and shrubs on day of year [-]
5979 REAL(KIND(1D0)), INTENT(in) :: albGrass_id !albedo for grass on day of year [-]
5980
5981 ! REAL(KIND(1d0)), DIMENSION(6, nsurf), INTENT(inout)::StoreDrainPrm
5982
5983 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_prev !initial snow water equivalent on each land cover [mm]
5984 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: snowFrac_prev !initial snow fraction [-]
5985 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: snowFrac_next
5986 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac ! snow fractions of each surface [-]
5987
5988 REAL(KIND(1D0)), INTENT(out) :: ldown ! output incoming longwave radiation [W m-2]
5989 REAL(KIND(1D0)), INTENT(out) :: fcld ! estimated cloud fraction [-](used only for emissivity estimate)
5990 REAL(KIND(1D0)), INTENT(out) :: qn ! output net all-wave radiation [W m-2]
5991 REAL(KIND(1D0)), INTENT(out) :: qn_snowfree !output net all-wave radiation for snow free surface [W m-2]
5992 REAL(KIND(1D0)), INTENT(out) :: qn_snow ! output net all-wave radiation for snowpack [W m-2]
5993 REAL(KIND(1D0)), INTENT(out) :: kclear !output clear sky incoming shortwave radiation [W m-2]
5994 REAL(KIND(1D0)), INTENT(out) :: kup !output outgoing shortwave radiation [W m-2]
5995 REAL(KIND(1D0)), INTENT(out) :: lup !output outgoing longwave radiation [W m-2]
5996 REAL(KIND(1D0)), INTENT(out) :: tsurf !output surface temperature [degC]
5997 REAL(KIND(1D0)), INTENT(out) :: albedo_snow !estimated albedo of snow [-]
5998 REAL(KIND(1D0)), INTENT(out) :: SnowAlb_next !output snow albedo [-]
5999 REAL(KIND(1D0)) :: albedo_snowfree !estimated albedo for snow-free surface [-]
6000 REAL(KIND(1D0)) :: SnowAlb ! updated snow albedo [-]
6001
6002 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qn_surf !net all-wave radiation on each surface [W m-2]
6003 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qn_ind_snow !net all-wave radiation on snowpack [W m-2]
6004 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: kup_ind_snow !outgoing shortwave on snowpack [W m-2]
6005 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: Tsurf_ind_snow !snowpack surface temperature [C]
6006 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: tsurf_ind !snow-free surface temperature [C]
6007
6008 REAL(KIND(1D0)), DIMENSION(nsurf) :: lup_ind !outgoing longwave radiation from observation [W m-2]
6009 REAL(KIND(1D0)), DIMENSION(nsurf) :: kup_ind !outgoing shortwave radiation from observation [W m-2]
6010 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn1_ind !net all-wave radiation from observation [W m-2]
6011
6012 REAL(KIND(1D0)), PARAMETER :: NAN = -999
6013 INTEGER :: NetRadiationMethod_use
6014 INTEGER :: AlbedoChoice, ldown_option
6015
6016 ! SPARTACUS output variables
6017 ! REAL(KIND(1D0)), INTENT(OUT) :: alb_spc, emis_spc, lw_emission_spc, lw_up_spc, sw_up_spc, qn_spc
6018 ! REAL(KIND(1D0)), INTENT(OUT) :: top_net_lw_spc, ground_net_lw_spc, top_dn_lw_spc
6019 ! REAL(KIND(1D0)), DIMENSION(15), INTENT(OUT) :: clear_air_abs_lw_spc, wall_net_lw_spc, roof_net_lw_spc, &
6020 ! roof_in_lw_spc
6021 ! REAL(KIND(1D0)), INTENT(OUT) :: top_dn_dir_sw_spc, top_net_sw_spc, ground_dn_dir_sw_spc, ground_net_sw_spc
6022 ! REAL(KIND(1D0)), DIMENSION(15), INTENT(OUT) :: clear_air_abs_sw_spc, wall_net_sw_spc, roof_net_sw_spc, &
6023 ! roof_in_sw_spc
6024
6025 ! SPARTACUS input variables
6026 INTEGER, INTENT(IN) :: n_vegetation_region_urban, &
6027 n_stream_sw_urban, n_stream_lw_urban
6028 REAL(KIND(1D0)), INTENT(IN) :: sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
6029 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
6030 veg_fsd_const, veg_contact_fraction_const, &
6031 ground_albedo_dir_mult_fact
6032 LOGICAL, INTENT(IN) :: use_sw_direct_albedo !boolean, Specify ground and roof albedos separately for direct solar radiation [-]
6033
6034 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height ! height in spartacus [m]
6035 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac ! building fraction [-]
6036 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_frac !vegetation fraction [-]
6037 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale ! diameter of buildings [[m]. The only L method for buildings is Eq. 19 Hogan et al. 2018.
6038 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: veg_scale ! scale of tree crowns [m]. Using the default use_symmetric_vegetation_scale_urban=.TRUE. so that Eq. 20 Hogan et al. 2018 is used for L.
6039 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_roof !albedo of roof [-]
6040 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_roof ! emissivity of roof [-]
6041 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: alb_wall !albedo of wall [-]
6042 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: emis_wall ! emissivity of wall [-]
6043 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: roof_albedo_dir_mult_fact !Ratio of the direct and diffuse albedo of the roof [-]
6044 REAL(KIND(1D0)), DIMENSION(nspec, nlayer), INTENT(IN) :: wall_specular_frac ! Fraction of wall reflection that is specular [-]
6045 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qn_wall ! net all-wave radiation on the wall [W m-2]
6046 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qn_roof ! net all-wave radiation on the roof [W m-2]
6047
6048 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSPARTACUS - 5), INTENT(OUT) :: dataOutLineSPARTACUS
6049
6050 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
6051 emis = [emis_paved, emis_bldg, emis_evetr, emis_dectr, emis_grass, emis_bsoil, emis_water]
6052 ! translate values
6053 alb = alb_prev
6054
6055 ! update snow albedo
6056 snowalb = update_snow_albedo( &
6057 tstep, snowpack_prev, snowalb_prev, tair_c, &
6058 tau_a, tau_f, snowalbmax, snowalbmin)
6059
6060 CALL radmethod( &
6061 netradiationmethod, & !input
6062 snowuse, & !input
6063 netradiationmethod_use, albedochoice, ldown_option) !output
6064
6065 snowfrac = snowfrac_prev
6066 IF (netradiationmethod_use > 0) THEN
6067
6068 ! IF (SnowUse==0) SnowFrac=snowFrac_obs
6069 IF (snowuse == 0) snowfrac = 0
6070
6071 IF (ldown_option == 2) THEN !observed cloud fraction provided as forcing
6072 fcld = fcld_obs
6073 END IF
6074
6075 !write(*,*) DecidCap(id), id, it, imin, 'Calc - near start'
6076
6077 ! Update variables that change daily and represent seasonal variability
6078 alb(decidsurf) = albdectr_id !Change deciduous albedo
6079 ! StoreDrainPrm(6, DecidSurf) = DecidCap_id !Change current storage capacity of deciduous trees
6080 ! Change EveTr and Grass albedo too
6081 alb(conifsurf) = albevetr_id
6082 alb(grasssurf) = albgrass_id
6083
6084 IF (diagnose == 1) WRITE (*, *) 'Calling NARP...'
6085 IF (diagqn == 1) WRITE (*, *) 'NetRadiationMethodX:', netradiationmethod_use
6086 IF (diagqn == 1) WRITE (*, *) 'AlbedoChoice:', albedochoice
6087
6088 ! TODO: TS 14 Feb 2022, ESTM development:
6089 ! here we use uniform `tsurf_0` for all land covers, which should be distinguished in future developments
6090
6091 CALL narp( &
6092 storageheatmethod, & !input:
6093 nsurf, sfr_surf, tsfc_surf, snowfrac, alb, emis, icefrac, & !
6094 narp_trans_site, narp_emis_snow, &
6095 dectime, zenith_deg, tsurf_0, kdown, tair_c, avrh, ea_hpa, qn1_obs, ldown_obs, &
6096 snowalb, &
6097 albedochoice, ldown_option, netradiationmethod_use, diagqn, &
6098 qn_surf, & ! output:
6099 qn, qn_snowfree, qn_snow, kclear, kup, ldown, lup, fcld, tsurf, & ! output:
6100 qn_ind_snow, kup_ind_snow, tsurf_ind_snow, tsurf_ind, albedo_snowfree, albedo_snow)
6101
6102 IF (diagqn == 1) WRITE (*, *) 'Calling SPARTACUS:'
6103 IF (netradiationmethod > 1000) THEN
6104 ! TODO: TS 14 Feb 2022, ESTM development: introduce facet surface temperatures
6105 CALL spartacus( &
6106 diagqn, & !input:
6107 sfr_surf, zenith_deg, nlayer, & !input:
6108 tsfc_surf, tsfc_roof, tsfc_wall, &
6109 kdown, ldown, tair_c, alb, emis, lai_id, &
6110 n_vegetation_region_urban, &
6111 n_stream_sw_urban, n_stream_lw_urban, &
6112 sw_dn_direct_frac, air_ext_sw, air_ssa_sw, &
6113 veg_ssa_sw, air_ext_lw, air_ssa_lw, veg_ssa_lw, &
6114 veg_fsd_const, veg_contact_fraction_const, &
6115 ground_albedo_dir_mult_fact, use_sw_direct_albedo, &
6116 height, building_frac, veg_frac, sfr_roof, sfr_wall, &
6117 building_scale, veg_scale, & !input:
6118 alb_roof, emis_roof, alb_wall, emis_wall, &
6119 roof_albedo_dir_mult_fact, wall_specular_frac, &
6120 qn, kup, lup, qn_roof, qn_wall, qn_surf, & !output:
6121 dataoutlinespartacus)
6122 ELSE
6123 qn_roof = qn_surf(bldgsurf)
6124 qn_wall = qn_surf(bldgsurf)
6125 END IF
6126
6127 ELSE ! NetRadiationMethod==0
6128 ! SnowFrac = snowFrac_obs
6129 qn = qn1_obs
6130 qn_snowfree = qn1_obs
6131 qn_snow = qn1_obs
6132 ldown = nan
6133 lup = nan
6134 kup = nan
6135 tsurf = nan
6136 lup_ind = nan
6137 kup_ind = nan
6138 tsurf_ind = nan
6139 qn1_ind = nan
6140 fcld = nan
6141 qn_surf = qn
6142 qn_roof = qn_surf(bldgsurf)
6143 qn_wall = qn_surf(bldgsurf)
6144 END IF
6145 ! snowFrac_next = SnowFrac
6146
6147 IF (ldown_option == 1) THEN
6148 fcld = nan
6149 END IF
6150
6151 ! translate values
6152 alb_next = alb
6153 snowalb_next = snowalb
6154

References allocatearray::bldgsurf, allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, narp_module::narp(), allocatearray::nsurf, narp_module::radmethod(), spartacus_module::spartacus(), and snow_module::update_snow_albedo().

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_qs()

subroutine suews_driver::suews_cal_qs ( integer, intent(in) storageheatmethod,
real(kind(1d0)), intent(in) qs_obs,
integer, intent(in) ohmincqf,
integer, intent(in) gridiv,
integer, intent(in) id,
integer, intent(in) tstep,
integer, intent(in) dt_since_start,
integer, intent(in) diagnose,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) qg_surf,
real(kind(1d0)), dimension(nlayer), intent(in) qg_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qg_wall,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tin_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) temp_in_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), dimension(nlayer), intent(in) tin_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) temp_in_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_wall,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nsurf), intent(in) tin_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) temp_in_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) k_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) cp_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) dz_surf,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nsurf + 1, 4, 3), intent(in) ohm_coef,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshsw,
real(kind(1d0)), dimension(nsurf + 1), intent(in) ohm_threshwd,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
integer, intent(in) snowuse,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
integer, intent(in) diagqs,
real(kind(1d0)), dimension(12), intent(in) hdd_id,
real(kind(1d0)), dimension(10), intent(in) metforcingdata_grid,
real(kind(1d0)), dimension(:), intent(in) ts5mindata_ir,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qn,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) zenith_deg,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) ldown,
real(kind(1d0)), intent(in) bldgh,
real(kind(1d0)), dimension(nsurf), intent(in) alb,
real(kind(1d0)), dimension(nsurf), intent(in) emis,
real(kind(1d0)), dimension(nsurf), intent(in) cpanohm,
real(kind(1d0)), dimension(nsurf), intent(in) kkanohm,
real(kind(1d0)), dimension(nsurf), intent(in) chanohm,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) tair_av,
real(kind(1d0)), intent(in) qn_av_prev,
real(kind(1d0)), intent(in) dqndt_prev,
real(kind(1d0)), intent(in) qn_s_av_prev,
real(kind(1d0)), intent(in) dqnsdt_prev,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), intent(out) qn_s,
real(kind(1d0)), dimension(27), intent(out) dataoutlineestm,
real(kind(1d0)), intent(out) qs,
real(kind(1d0)), intent(out) qn_av_next,
real(kind(1d0)), intent(out) dqndt_next,
real(kind(1d0)), intent(out) qn_s_av_next,
real(kind(1d0)), intent(out) dqnsdt_next,
real(kind(1d0)), dimension(nsurf), intent(out) deltaqi,
real(kind(1d0)), intent(out) a1,
real(kind(1d0)), intent(out) a2,
real(kind(1d0)), intent(out) a3,
real(kind(1d0)), dimension(nlayer, ndepth), intent(out) temp_out_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qs_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(out) temp_out_wall,
real(kind(1d0)), dimension(nlayer), intent(out) qs_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(out) temp_out_surf,
real(kind(1d0)), dimension(nsurf), intent(out) qs_surf )
Parameters
[in]metforcingdata_gridmet forcing array of grid
[out]a1AnOHM coefficients of grid [-]
[out]a2AnOHM coefficients of grid [h]
[out]a3AnOHM coefficients of grid [W m-2]

Definition at line 6159 of file suews_ctrl_driver.f95.

6180
6181 IMPLICIT NONE
6182
6183 INTEGER, INTENT(in) :: StorageHeatMethod !heat storage calculation option [-]
6184 INTEGER, INTENT(in) :: OHMIncQF !Determines whether the storage heat flux calculation uses Q* or ( Q* +QF)
6185 INTEGER, INTENT(in) :: Gridiv ! grid id [-]
6186 INTEGER, INTENT(in) :: id ! day of year [-]
6187 INTEGER, INTENT(in) :: tstep ! time step [s]
6188 INTEGER, INTENT(in) :: dt_since_start ! time since simulation starts [s]
6189 INTEGER, INTENT(in) :: Diagnose
6190 ! INTEGER, INTENT(in) ::nsh ! number of timesteps in one hour
6191 INTEGER, INTENT(in) :: SnowUse ! option for snow related calculations [-]
6192 INTEGER, INTENT(in) :: DiagQS ! diagnostic option [-]
6193 INTEGER, INTENT(in) :: EmissionsMethod ! AnthropHeat option [-]
6194 INTEGER, INTENT(in) :: nlayer ! number of vertical levels in urban canopy [-]
6195
6196 REAL(KIND(1D0)), INTENT(in) :: OHM_coef(nsurf + 1, 4, 3) ! OHM coefficients [-]
6197 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW(nsurf + 1) ! Temperature threshold determining whether summer/winter OHM coefficients are applied [degC]
6198 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD(nsurf + 1) ! Soil moisture threshold determining whether wet/dry OHM coefficients are applied [-]
6199 REAL(KIND(1D0)), INTENT(in) :: soilstore_id(nsurf) ! soil moisture on day of year
6200 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap(nsurf) ! capacity of soil store [J m-3 K-1]
6201 REAL(KIND(1D0)), INTENT(in) :: state_id(nsurf) ! wetness status [mm]
6202
6203 REAL(KIND(1D0)), DIMENSION(12), INTENT(in) :: HDD_id ! Heating degree day of the day of year
6204 REAL(KIND(1D0)), INTENT(in) :: qf ! anthropogenic heat lufx [W m-2]
6205 REAL(KIND(1D0)), INTENT(in) :: qn ! net all-wave radiative flux [W m-2]
6206 REAL(KIND(1D0)), INTENT(in) :: qs_obs ! observed heat storage flux [W m-2]
6207 REAL(KIND(1D0)), INTENT(in) :: avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown
6208 REAL(KIND(1D0)), INTENT(in) :: bldgh ! mean building height [m]
6209
6210 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: alb ! albedo [-]
6211 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: emis ! emissivity [-]
6212 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: cpAnOHM ! heat capacity [J m-3 K-1]
6213 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: kkAnOHM ! thermal conductivity [W m-1 K-1]
6214 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: chAnOHM ! bulk transfer coef [J m-3 K-1]
6215 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac ! snow fractions of each surface [-]
6216
6217 REAL(KIND(1D0)), DIMENSION(10), INTENT(in) :: MetForcingData_grid
6218
6219 REAL(KIND(1D0)), DIMENSION(:), INTENT(in) :: Ts5mindata_ir !surface temperature input data [degC]
6220
6221 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: QG_surf ! ground heat flux [W m-2]
6222 REAL(KIND(1D0)), INTENT(in) :: Tair_av ! mean air temperature of past 24hr [degC]
6223 REAL(KIND(1D0)), INTENT(in) :: qn_av_prev ! weighted average of qn [W m-2]
6224 REAL(KIND(1D0)), INTENT(out) :: qn_av_next ! weighted average of qn for previous 60 mins [W m-2]
6225 REAL(KIND(1D0)), INTENT(in) :: dqndt_prev ! Rate of change of net radiation at t-1 [W m-2 h-1]
6226 REAL(KIND(1D0)), INTENT(out) :: dqndt_next ! Rate of change of net radiation at t+1 [W m-2 h-1]
6227 REAL(KIND(1D0)), INTENT(in) :: qn_s_av_prev ! weighted average of qn over snow for previous 60mins [W m-2]
6228 REAL(KIND(1D0)), INTENT(out) :: qn_s_av_next ! weighted average of qn over snow for next 60mins [W m-2]
6229 REAL(KIND(1D0)), INTENT(in) :: dqnsdt_prev ! Rate of change of net radiation [W m-2 h-1] at t-1
6230 REAL(KIND(1D0)), INTENT(out) :: dqnsdt_next ! Rate of change of net radiation [W m-2 h-1] at t+1
6231 ! REAL(KIND(1d0)),DIMENSION(nsh),INTENT(inout) ::qn1_store_grid
6232 ! REAL(KIND(1d0)),DIMENSION(nsh),INTENT(inout) ::qn1_S_store_grid !< stored qn1 [W m-2]
6233
6234 ! REAL(KIND(1d0)),DIMENSION(2*nsh+1),INTENT(inout)::qn1_av_store_grid
6235 ! REAL(KIND(1d0)),DIMENSION(2*nsh+1),INTENT(inout)::qn1_S_av_store_grid !< average net radiation over previous hour [W m-2]
6236 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
6237
6238 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: deltaQi ! storage heat flux of snow surfaces [W m-2]
6239
6240 REAL(KIND(1D0)), DIMENSION(27), INTENT(out) :: dataOutLineESTM !data output from ESTM
6241 REAL(KIND(1D0)), INTENT(out) :: qn_S ! net all-wave radiation over snow [W m-2]
6242 REAL(KIND(1D0)), INTENT(out) :: qs ! storage heat flux [W m-2]
6243 REAL(KIND(1D0)), INTENT(out) :: a1
6244 REAL(KIND(1D0)), INTENT(out) :: a2
6245 REAL(KIND(1D0)), INTENT(out) :: a3
6246
6247 ! extended for ESTM_ehc
6248 ! input arrays: standard suews surfaces
6249 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qg_roof ! conductive heat flux through roof [W m-2]
6250 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_roof ! indoor/deep bottom temperature for roof [degC]
6251 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof ! surface fraction of roof [-]
6252 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: temp_in_roof ! temperature at inner interfaces of roof [degC]
6253 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_roof ! thermal conductivity of roof [W m-1 K]
6254 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_roof ! Heat capacity of roof [J m-3 K-1]
6255 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_roof ! thickness of each layer in roof [m]
6256 ! input arrays: standard suews surfaces
6257 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qg_wall ! conductive heat flux through wall [W m-2]
6258 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_wall ! indoor/deep bottom temperature for wall [degC]
6259 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall ! surface fraction of wall [-]
6260 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: temp_in_wall ! temperature at inner interfaces of wall [degC]
6261 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_wall ! thermal conductivity of wall [W m-1 K]
6262 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_wall ! Heat capacity of wall [J m-3 K-1]
6263 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_wall ! thickness of each layer in wall [m]
6264 ! input arrays: standard suews surfaces
6265 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tin_surf !deep bottom temperature for each surface [degC]
6266 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf ! fraction of each surface [-]
6267 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: temp_in_surf ! temperature at inner interfaces of of each surface [degC]
6268 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: k_surf ! thermal conductivity of v [W m-1 K]
6269 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: cp_surf ! Heat capacity of each surface [J m-3 K-1]
6270 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: dz_surf ! thickness of each layer in each surface [m]
6271 ! output arrays
6272 ! roof facets
6273 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof ! roof surface temperature [degC]
6274 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: QS_roof ! heat storage flux for roof component [W m-2]
6275 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(out) :: temp_out_roof !interface temperature between depth layers [degC]
6276 ! wall facets
6277 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall ! wall surface temperature [degC]
6278 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: QS_wall ! heat storage flux for wall component [W m-2]
6279 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(out) :: temp_out_wall !interface temperature between depth layers [degC]
6280 ! standard suews surfaces
6281 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf ! each surface temperature [degC]
6282 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: QS_surf ! heat storage flux for each surface component [W m-2]
6283 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(out) :: temp_out_surf !interface temperature between depth layers [degC]
6284
6285 ! internal use arrays
6286 REAL(KIND(1D0)) :: Tair_mav_5d ! Tair_mav_5d=HDD(id-1,4) HDD at the begining of today (id-1)
6287 REAL(KIND(1D0)) :: qn_use ! qn used in OHM calculations [W m-2]
6288
6289 REAL(KIND(1D0)) :: moist_surf(nsurf)
6290
6291 WRITE (*, *) 'OHM_coef = ', ohm_coef
6292
6293 ! initialise output variables
6294 deltaqi = 0
6295 !SnowFrac = 0
6296 !qn1_S = 0
6297 dataoutlineestm = -999
6298 qs = -999
6299 a1 = -999
6300 a2 = -999
6301 a3 = -999
6302
6303 ! calculate qn if qf should be included
6304 IF (ohmincqf == 1) THEN
6305 qn_use = qf + qn
6306 ELSEIF (ohmincqf == 0) THEN
6307 qn_use = qn
6308 END IF
6309
6310 IF (storageheatmethod == 0) THEN !Use observed QS
6311 qs = qs_obs
6312
6313 ELSEIF (storageheatmethod == 1) THEN !Use OHM to calculate QS
6314 tair_mav_5d = hdd_id(10)
6315 IF (diagnose == 1) WRITE (*, *) 'Calling OHM...'
6316 CALL ohm(qn_use, qn_av_prev, dqndt_prev, qn_av_next, dqndt_next, &
6317 qn_s, qn_s_av_prev, dqnsdt_prev, qn_s_av_next, dqnsdt_next, &
6318 tstep, dt_since_start, &
6319 sfr_surf, nsurf, &
6320 tair_mav_5d, &
6321 ohm_coef, &
6322 ohm_threshsw, ohm_threshwd, &
6323 soilstore_id, soilstorecap, state_id, &
6324 bldgsurf, watersurf, &
6325 snowuse, snowfrac, &
6326 diagqs, &
6327 a1, a2, a3, qs, deltaqi)
6328 qs_surf = qs
6329 qs_roof = qs
6330 qs_wall = qs
6331
6332 ! use AnOHM to calculate QS, TS 14 Mar 2016
6333 ELSEIF (storageheatmethod == 3) THEN
6334 IF (diagnose == 1) WRITE (*, *) 'Calling AnOHM...'
6335 ! CALL AnOHM(qn1_use,qn1_store_grid,qn1_av_store_grid,qf,&
6336 ! MetForcingData_grid,state_id/StoreDrainPrm(6,:),&
6337 ! alb, emis, cpAnOHM, kkAnOHM, chAnOHM,&
6338 ! sfr_surf,nsurf,nsh,EmissionsMethod,id,Gridiv,&
6339 ! a1,a2,a3,qs,deltaQi)
6340 moist_surf = state_id/storedrainprm(6, :)
6341 ! CALL AnOHM( &
6342 ! tstep, dt_since_start, &
6343 ! qn_use, qn_av_prev, dqndt_prev, qf, &
6344 ! MetForcingData_grid, moist_surf, &
6345 ! alb, emis, cpAnOHM, kkAnOHM, chAnOHM, & ! input
6346 ! sfr_surf, nsurf, EmissionsMethod, id, Gridiv, &
6347 ! qn_av_next, dqndt_next, &
6348 ! a1, a2, a3, qs, deltaQi) ! output
6349 qs_surf = qs
6350 qs_roof = qs
6351 qs_wall = qs
6352
6353 ! !Calculate QS using ESTM
6354 ELSEIF (storageheatmethod == 4 .OR. storageheatmethod == 14) THEN
6355 ! !CALL ESTM(QSestm,iMB)
6356 IF (diagnose == 1) WRITE (*, *) 'Calling ESTM...'
6357 CALL estm( &
6358 gridiv, & !input
6359 tstep, &
6360 avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, &
6361 bldgh, ts5mindata_ir, &
6362 tair_av, &
6363 dataoutlineestm, qs) !output
6364 ! CALL ESTM(QSestm,Gridiv,ir) ! iMB corrected to Gridiv, TS 09 Jun 2016
6365 ! QS=QSestm ! Use ESTM qs
6366 ELSEIF (storageheatmethod == 5) THEN
6367 ! !CALL ESTM(QSestm,iMB)
6368 IF (diagnose == 1) WRITE (*, *) 'Calling extended ESTM...'
6369 ! facets: seven suews standard facets + extra for buildings [roof, wall] (can be extended for heterogeneous buildings)
6370 !
6371 ! ASSOCIATE (v => dz_roof(1, 1:ndepth))
6372 ! PRINT *, 'dz_roof in cal_qs', v, SIZE(v)
6373 ! END ASSOCIATE
6374 ! ASSOCIATE (v => dz_wall(1, 1:ndepth))
6375 ! PRINT *, 'dz_wall in cal_qs', v, SIZE(v)
6376 ! END ASSOCIATE
6377 CALL ehc( &
6378 tstep, & !input
6379 nlayer, &
6380 qg_surf, qg_roof, qg_wall, &
6381 tsfc_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, & !input
6382 tsfc_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, & !input
6383 tsfc_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_surf, & !input
6384 temp_out_roof, qs_roof, & !output
6385 temp_out_wall, qs_wall, & !output
6386 temp_out_surf, qs_surf, & !output
6387 qs) !output
6388
6389 ! TODO: add deltaQi to output for snow heat storage
6390
6391 ! PRINT *, 'QS after ESTM_ehc', QS
6392 ! PRINT *, 'QS_roof after ESTM_ehc', QS_roof
6393 ! PRINT *, 'QS_wall after ESTM_ehc', QS_wall
6394 ! PRINT *, 'QS_surf after ESTM_ehc', QS_surf
6395 ! PRINT *, '------------------------------------'
6396 ! PRINT *, ''
6397 END IF
6398
subroutine ohm(qn1, qn_av_prev, dqndt_prev, qn_av_next, dqndt_next, qn1_s, qn_s_av_prev, dqnsdt_prev, qn_s_av_next, dqnsdt_next, tstep, dt_since_start, sfr_surf, nsurf, tair_mav_5d, ohm_coef, ohm_threshsw, ohm_threshwd, soilstore_id, soilstorecap, state_id, bldgsurf, watersurf, snowuse, snowfrac, diagqs, a1, a2, a3, qs, deltaqi)

References allocatearray::bldgsurf, ehc_module::ehc(), estm_module::estm(), ohm(), and allocatearray::watersurf.

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_qs_dts()

subroutine suews_driver::suews_cal_qs_dts ( integer, intent(in) storageheatmethod,
real(kind(1d0)), intent(in) qs_obs,
integer, intent(in) ohmincqf,
integer, intent(in) gridiv,
integer, intent(in) id,
integer, intent(in) tstep,
integer, intent(in) dt_since_start,
integer, intent(in) diagnose,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) qg_surf,
real(kind(1d0)), dimension(nlayer), intent(in) qg_roof,
real(kind(1d0)), dimension(nlayer), intent(in) qg_wall,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tin_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) temp_in_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_roof,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(in) tsfc_wall,
real(kind(1d0)), dimension(nlayer), intent(in) tin_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) temp_in_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) k_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) cp_wall,
real(kind(1d0)), dimension(nlayer, ndepth), intent(in) dz_wall,
real(kind(1d0)), dimension(nlayer), intent(in) sfr_wall,
real(kind(1d0)), dimension(nsurf), intent(in) tsfc_surf,
real(kind(1d0)), dimension(nsurf), intent(in) tin_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) temp_in_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) k_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) cp_surf,
real(kind(1d0)), dimension(nsurf, ndepth), intent(in) dz_surf,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_paved,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_bldg,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_evetr,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_dectr,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_grass,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_bsoil,
type(ohm_coef_lc), dimension(3), intent(in) ohm_coef_water,
real(kind(1d0)), intent(in) ohm_threshsw_paved,
real(kind(1d0)), intent(in) ohm_threshsw_bldg,
real(kind(1d0)), intent(in) ohm_threshsw_evetr,
real(kind(1d0)), intent(in) ohm_threshsw_dectr,
real(kind(1d0)), intent(in) ohm_threshsw_grass,
real(kind(1d0)), intent(in) ohm_threshsw_bsoil,
real(kind(1d0)), intent(in) ohm_threshsw_water,
real(kind(1d0)), intent(in) ohm_threshwd_paved,
real(kind(1d0)), intent(in) ohm_threshwd_bldg,
real(kind(1d0)), intent(in) ohm_threshwd_evetr,
real(kind(1d0)), intent(in) ohm_threshwd_dectr,
real(kind(1d0)), intent(in) ohm_threshwd_grass,
real(kind(1d0)), intent(in) ohm_threshwd_bsoil,
real(kind(1d0)), intent(in) ohm_threshwd_water,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id,
real(kind(1d0)), intent(in) soilstorecap_paved,
real(kind(1d0)), intent(in) soilstorecap_bldg,
real(kind(1d0)), intent(in) soilstorecap_evetr,
real(kind(1d0)), intent(in) soilstorecap_dectr,
real(kind(1d0)), intent(in) soilstorecap_grass,
real(kind(1d0)), intent(in) soilstorecap_bsoil,
real(kind(1d0)), intent(in) soilstorecap_water,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
integer, intent(in) snowuse,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
integer, intent(in) diagqs,
real(kind(1d0)), dimension(12), intent(in) hdd_id,
real(kind(1d0)), dimension(10), intent(in) metforcingdata_grid,
real(kind(1d0)), dimension(:), intent(in) ts5mindata_ir,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qn,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) zenith_deg,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) ldown,
real(kind(1d0)), intent(in) bldgh,
real(kind(1d0)), dimension(nsurf), intent(in) alb,
real(kind(1d0)), intent(in) emis_paved,
real(kind(1d0)), intent(in) emis_bldg,
real(kind(1d0)), intent(in) emis_evetr,
real(kind(1d0)), intent(in) emis_dectr,
real(kind(1d0)), intent(in) emis_grass,
real(kind(1d0)), intent(in) emis_bsoil,
real(kind(1d0)), intent(in) emis_water,
real(kind(1d0)), intent(in) cpanohm_paved,
real(kind(1d0)), intent(in) cpanohm_bldg,
real(kind(1d0)), intent(in) cpanohm_evetr,
real(kind(1d0)), intent(in) cpanohm_dectr,
real(kind(1d0)), intent(in) cpanohm_grass,
real(kind(1d0)), intent(in) cpanohm_bsoil,
real(kind(1d0)), intent(in) cpanohm_water,
real(kind(1d0)), intent(in) kkanohm_paved,
real(kind(1d0)), intent(in) kkanohm_bldg,
real(kind(1d0)), intent(in) kkanohm_evetr,
real(kind(1d0)), intent(in) kkanohm_dectr,
real(kind(1d0)), intent(in) kkanohm_grass,
real(kind(1d0)), intent(in) kkanohm_bsoil,
real(kind(1d0)), intent(in) kkanohm_water,
real(kind(1d0)), intent(in) chanohm_paved,
real(kind(1d0)), intent(in) chanohm_bldg,
real(kind(1d0)), intent(in) chanohm_evetr,
real(kind(1d0)), intent(in) chanohm_dectr,
real(kind(1d0)), intent(in) chanohm_grass,
real(kind(1d0)), intent(in) chanohm_bsoil,
real(kind(1d0)), intent(in) chanohm_water,
integer, intent(in) emissionsmethod,
real(kind(1d0)), intent(in) tair_av,
real(kind(1d0)), intent(in) qn_av_prev,
real(kind(1d0)), intent(in) dqndt_prev,
real(kind(1d0)), intent(in) qn_s_av_prev,
real(kind(1d0)), intent(in) dqnsdt_prev,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), intent(out) qn_s,
real(kind(1d0)), dimension(27), intent(out) dataoutlineestm,
real(kind(1d0)), intent(out) qs,
real(kind(1d0)), intent(out) qn_av_next,
real(kind(1d0)), intent(out) dqndt_next,
real(kind(1d0)), intent(out) qn_s_av_next,
real(kind(1d0)), intent(out) dqnsdt_next,
real(kind(1d0)), dimension(nsurf), intent(out) deltaqi,
real(kind(1d0)), intent(out) a1,
real(kind(1d0)), intent(out) a2,
real(kind(1d0)), intent(out) a3,
real(kind(1d0)), dimension(nlayer, ndepth), intent(out) temp_out_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qs_roof,
real(kind(1d0)), dimension(nlayer, ndepth), intent(out) temp_out_wall,
real(kind(1d0)), dimension(nlayer), intent(out) qs_wall,
real(kind(1d0)), dimension(nsurf, ndepth), intent(out) temp_out_surf,
real(kind(1d0)), dimension(nsurf), intent(out) qs_surf )
Parameters
[in]metforcingdata_gridmet forcing array of grid
[out]a1AnOHM coefficients of grid [-]
[out]a2AnOHM coefficients of grid [h]
[out]a3AnOHM coefficients of grid [W m-2]

Definition at line 6401 of file suews_ctrl_driver.f95.

6439
6440 IMPLICIT NONE
6441
6442 INTEGER, INTENT(in) :: StorageHeatMethod !heat storage calculation option [-]
6443 INTEGER, INTENT(in) :: OHMIncQF !Determines whether the storage heat flux calculation uses Q* or ( Q* +QF)
6444 INTEGER, INTENT(in) :: Gridiv ! grid id [-]
6445 INTEGER, INTENT(in) :: id ! day of year [-]
6446 INTEGER, INTENT(in) :: tstep ! time step [s]
6447 INTEGER, INTENT(in) :: dt_since_start ! time since simulation starts [s]
6448 INTEGER, INTENT(in) :: Diagnose
6449 ! INTEGER, INTENT(in) ::nsh ! number of timesteps in one hour
6450 INTEGER, INTENT(in) :: SnowUse ! option for snow related calculations [-]
6451 INTEGER, INTENT(in) :: DiagQS ! diagnostic option [-]
6452 INTEGER, INTENT(in) :: EmissionsMethod ! AnthropHeat option [-]
6453 INTEGER, INTENT(in) :: nlayer ! number of vertical levels in urban canopy [-]
6454
6455 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_paved(3)
6456 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_bldg(3)
6457 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_evetr(3)
6458 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_dectr(3)
6459 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_grass(3)
6460 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_bsoil(3)
6461 TYPE(OHM_COEF_LC), INTENT(in) :: OHM_coef_water(3)
6462 REAL(KIND(1D0)) :: OHM_coef(nsurf + 1, 4, 3) ! OHM coefficients [-]
6463
6464 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_paved
6465 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_bldg
6466 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_evetr
6467 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_dectr
6468 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_grass
6469 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_bsoil
6470 REAL(KIND(1D0)), INTENT(in) :: OHM_threshSW_water
6471 REAL(KIND(1D0)) :: OHM_threshSW(nsurf + 1) ! Temperature threshold determining whether summer/winter OHM coefficients are applied [degC]
6472
6473 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_paved
6474 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_bldg
6475 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_evetr
6476 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_dectr
6477 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_grass
6478 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_bsoil
6479 REAL(KIND(1D0)), INTENT(in) :: OHM_threshWD_water
6480 REAL(KIND(1D0)) :: OHM_threshWD(nsurf + 1) ! Soil moisture threshold determining whether wet/dry OHM coefficients are applied [-]
6481
6482 REAL(KIND(1D0)), INTENT(in) :: soilstore_id(nsurf) ! soil moisture on day of year
6483
6484 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_paved
6485 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bldg
6486 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_evetr
6487 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_dectr
6488 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_grass
6489 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bsoil
6490 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_water
6491 REAL(KIND(1D0)) :: SoilStoreCap(nsurf) ! capacity of soil store [J m-3 K-1]
6492
6493 REAL(KIND(1D0)), INTENT(in) :: state_id(nsurf) ! wetness status [mm]
6494
6495 REAL(KIND(1D0)), DIMENSION(12), INTENT(in) :: HDD_id ! Heating degree day of the day of year
6496 REAL(KIND(1D0)), INTENT(in) :: qf ! anthropogenic heat lufx [W m-2]
6497 REAL(KIND(1D0)), INTENT(in) :: qn ! net all-wave radiative flux [W m-2]
6498 REAL(KIND(1D0)), INTENT(in) :: qs_obs ! observed heat storage flux [W m-2]
6499 REAL(KIND(1D0)), INTENT(in) :: avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown
6500 REAL(KIND(1D0)), INTENT(in) :: bldgh ! mean building height [m]
6501
6502 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: alb ! albedo [-]
6503
6504 REAL(KIND(1D0)), INTENT(in) :: emis_paved
6505 REAL(KIND(1D0)), INTENT(in) :: emis_bldg
6506 REAL(KIND(1D0)), INTENT(in) :: emis_evetr
6507 REAL(KIND(1D0)), INTENT(in) :: emis_dectr
6508 REAL(KIND(1D0)), INTENT(in) :: emis_grass
6509 REAL(KIND(1D0)), INTENT(in) :: emis_bsoil
6510 REAL(KIND(1D0)), INTENT(in) :: emis_water
6511 REAL(KIND(1D0)), DIMENSION(nsurf) :: emis ! emissivity [-]
6512
6513 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_paved
6514 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_bldg
6515 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_evetr
6516 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_dectr
6517 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_grass
6518 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_bsoil
6519 REAL(KIND(1D0)), INTENT(in) :: cpAnOHM_water
6520 REAL(KIND(1D0)), DIMENSION(nsurf) :: cpAnOHM ! heat capacity [J m-3 K-1]
6521
6522 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_paved
6523 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_bldg
6524 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_evetr
6525 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_dectr
6526 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_grass
6527 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_bsoil
6528 REAL(KIND(1D0)), INTENT(in) :: kkAnOHM_water
6529 REAL(KIND(1D0)), DIMENSION(nsurf) :: kkAnOHM ! thermal conductivity [W m-1 K-1]
6530
6531 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_paved
6532 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_bldg
6533 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_evetr
6534 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_dectr
6535 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_grass
6536 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_bsoil
6537 REAL(KIND(1D0)), INTENT(in) :: chAnOHM_water
6538 REAL(KIND(1D0)), DIMENSION(nsurf) :: chAnOHM ! bulk transfer coef [J m-3 K-1]
6539
6540 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac ! snow fractions of each surface [-]
6541
6542 REAL(KIND(1D0)), DIMENSION(10), INTENT(in) :: MetForcingData_grid
6543
6544 REAL(KIND(1D0)), DIMENSION(:), INTENT(in) :: Ts5mindata_ir !surface temperature input data [degC]
6545
6546 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: QG_surf ! ground heat flux [W m-2]
6547 REAL(KIND(1D0)), INTENT(in) :: Tair_av ! mean air temperature of past 24hr [degC]
6548 REAL(KIND(1D0)), INTENT(in) :: qn_av_prev ! weighted average of qn [W m-2]
6549 REAL(KIND(1D0)), INTENT(out) :: qn_av_next ! weighted average of qn for previous 60 mins [W m-2]
6550 REAL(KIND(1D0)), INTENT(in) :: dqndt_prev ! Rate of change of net radiation at t-1 [W m-2 h-1]
6551 REAL(KIND(1D0)), INTENT(out) :: dqndt_next ! Rate of change of net radiation at t+1 [W m-2 h-1]
6552 REAL(KIND(1D0)), INTENT(in) :: qn_s_av_prev ! weighted average of qn over snow for previous 60mins [W m-2]
6553 REAL(KIND(1D0)), INTENT(out) :: qn_s_av_next ! weighted average of qn over snow for next 60mins [W m-2]
6554 REAL(KIND(1D0)), INTENT(in) :: dqnsdt_prev ! Rate of change of net radiation [W m-2 h-1] at t-1
6555 REAL(KIND(1D0)), INTENT(out) :: dqnsdt_next ! Rate of change of net radiation [W m-2 h-1] at t+1
6556 ! REAL(KIND(1d0)),DIMENSION(nsh),INTENT(inout) ::qn1_store_grid
6557 ! REAL(KIND(1d0)),DIMENSION(nsh),INTENT(inout) ::qn1_S_store_grid !< stored qn1 [W m-2]
6558
6559 ! REAL(KIND(1d0)),DIMENSION(2*nsh+1),INTENT(inout)::qn1_av_store_grid
6560 ! REAL(KIND(1d0)),DIMENSION(2*nsh+1),INTENT(inout)::qn1_S_av_store_grid !< average net radiation over previous hour [W m-2]
6561 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
6562
6563 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: deltaQi ! storage heat flux of snow surfaces [W m-2]
6564
6565 REAL(KIND(1D0)), DIMENSION(27), INTENT(out) :: dataOutLineESTM !data output from ESTM
6566 REAL(KIND(1D0)), INTENT(out) :: qn_S ! net all-wave radiation over snow [W m-2]
6567 REAL(KIND(1D0)), INTENT(out) :: qs ! storage heat flux [W m-2]
6568 REAL(KIND(1D0)), INTENT(out) :: a1
6569 REAL(KIND(1D0)), INTENT(out) :: a2
6570 REAL(KIND(1D0)), INTENT(out) :: a3
6571
6572 ! extended for ESTM_ehc
6573 ! input arrays: standard suews surfaces
6574 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qg_roof ! conductive heat flux through roof [W m-2]
6575 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_roof ! indoor/deep bottom temperature for roof [degC]
6576 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_roof ! surface fraction of roof [-]
6577 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: temp_in_roof ! temperature at inner interfaces of roof [degC]
6578 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_roof ! thermal conductivity of roof [W m-1 K]
6579 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_roof ! Heat capacity of roof [J m-3 K-1]
6580 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_roof ! thickness of each layer in roof [m]
6581 ! input arrays: standard suews surfaces
6582 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: qg_wall ! conductive heat flux through wall [W m-2]
6583 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tin_wall ! indoor/deep bottom temperature for wall [degC]
6584 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: sfr_wall ! surface fraction of wall [-]
6585 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: temp_in_wall ! temperature at inner interfaces of wall [degC]
6586 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: k_wall ! thermal conductivity of wall [W m-1 K]
6587 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: cp_wall ! Heat capacity of wall [J m-3 K-1]
6588 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(in) :: dz_wall ! thickness of each layer in wall [m]
6589 ! input arrays: standard suews surfaces
6590 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tin_surf !deep bottom temperature for each surface [degC]
6591
6592 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
6593 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
6594 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
6595 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
6596 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
6597 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
6598 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
6599 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
6600
6601 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: temp_in_surf ! temperature at inner interfaces of of each surface [degC]
6602 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: k_surf ! thermal conductivity of v [W m-1 K]
6603 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: cp_surf ! Heat capacity of each surface [J m-3 K-1]
6604 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(in) :: dz_surf ! thickness of each layer in each surface [m]
6605 ! output arrays
6606 ! roof facets
6607 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_roof ! roof surface temperature [degC]
6608 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: QS_roof ! heat storage flux for roof component [W m-2]
6609 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(out) :: temp_out_roof !interface temperature between depth layers [degC]
6610 ! wall facets
6611 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(in) :: tsfc_wall ! wall surface temperature [degC]
6612 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: QS_wall ! heat storage flux for wall component [W m-2]
6613 REAL(KIND(1D0)), DIMENSION(nlayer, ndepth), INTENT(out) :: temp_out_wall !interface temperature between depth layers [degC]
6614 ! standard suews surfaces
6615 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: tsfc_surf ! each surface temperature [degC]
6616 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: QS_surf ! heat storage flux for each surface component [W m-2]
6617 REAL(KIND(1D0)), DIMENSION(nsurf, ndepth), INTENT(out) :: temp_out_surf !interface temperature between depth layers [degC]
6618
6619 ! internal use arrays
6620 REAL(KIND(1D0)) :: Tair_mav_5d ! Tair_mav_5d=HDD(id-1,4) HDD at the begining of today (id-1)
6621 REAL(KIND(1D0)) :: qn_use ! qn used in OHM calculations [W m-2]
6622
6623 REAL(KIND(1D0)) :: moist_surf(nsurf)
6624
6625 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
6626
6627 ohm_coef(1, 1, 1) = ohm_coef_paved(1)%summer_wet
6628 ohm_coef(1, 2, 1) = ohm_coef_paved(1)%summer_dry
6629 ohm_coef(1, 3, 1) = ohm_coef_paved(1)%winter_wet
6630 ohm_coef(1, 4, 1) = ohm_coef_paved(1)%winter_dry
6631 !WRITE (*, *) 'OHM_coef_paved(1)%winter_dry', OHM_coef_paved(1)%winter_dry
6632 !WRITE (*, *) 'OHM_coef(1, 4, 1)', OHM_coef(1, 4, 1)
6633
6634 ohm_coef(1, 1, 2) = ohm_coef_paved(2)%summer_wet
6635 ohm_coef(1, 2, 2) = ohm_coef_paved(2)%summer_dry
6636 ohm_coef(1, 3, 2) = ohm_coef_paved(2)%winter_wet
6637 ohm_coef(1, 4, 2) = ohm_coef_paved(2)%winter_dry
6638
6639 ohm_coef(1, 1, 3) = ohm_coef_paved(3)%summer_wet
6640 ohm_coef(1, 2, 3) = ohm_coef_paved(3)%summer_dry
6641 ohm_coef(1, 3, 3) = ohm_coef_paved(3)%winter_wet
6642 ohm_coef(1, 4, 3) = ohm_coef_paved(3)%winter_dry
6643
6644 ohm_coef(2, 1, 1) = ohm_coef_bldg(1)%summer_wet
6645 ohm_coef(2, 2, 1) = ohm_coef_bldg(1)%summer_dry
6646 ohm_coef(2, 3, 1) = ohm_coef_bldg(1)%winter_wet
6647 ohm_coef(2, 4, 1) = ohm_coef_bldg(1)%winter_dry
6648
6649 ohm_coef(2, 1, 2) = ohm_coef_bldg(2)%summer_wet
6650 ohm_coef(2, 2, 2) = ohm_coef_bldg(2)%summer_dry
6651 ohm_coef(2, 3, 2) = ohm_coef_bldg(2)%winter_wet
6652 ohm_coef(2, 4, 2) = ohm_coef_bldg(2)%winter_dry
6653
6654 ohm_coef(2, 1, 3) = ohm_coef_bldg(3)%summer_wet
6655 ohm_coef(2, 2, 3) = ohm_coef_bldg(3)%summer_dry
6656 ohm_coef(2, 3, 3) = ohm_coef_bldg(3)%winter_wet
6657 ohm_coef(2, 4, 3) = ohm_coef_bldg(3)%winter_dry
6658
6659 ohm_coef(3, 1, 1) = ohm_coef_evetr(1)%summer_wet
6660 ohm_coef(3, 2, 1) = ohm_coef_evetr(1)%summer_dry
6661 ohm_coef(3, 3, 1) = ohm_coef_evetr(1)%winter_wet
6662 ohm_coef(3, 4, 1) = ohm_coef_evetr(1)%winter_dry
6663
6664 ohm_coef(3, 1, 2) = ohm_coef_evetr(2)%summer_wet
6665 ohm_coef(3, 2, 2) = ohm_coef_evetr(2)%summer_dry
6666 ohm_coef(3, 3, 2) = ohm_coef_evetr(2)%winter_wet
6667 ohm_coef(3, 4, 2) = ohm_coef_evetr(2)%winter_dry
6668
6669 ohm_coef(3, 1, 3) = ohm_coef_evetr(3)%summer_wet
6670 ohm_coef(3, 2, 3) = ohm_coef_evetr(3)%summer_dry
6671 ohm_coef(3, 3, 3) = ohm_coef_evetr(3)%winter_wet
6672 ohm_coef(3, 4, 3) = ohm_coef_evetr(3)%winter_dry
6673
6674 ohm_coef(4, 1, 1) = ohm_coef_dectr(1)%summer_wet
6675 ohm_coef(4, 2, 1) = ohm_coef_dectr(1)%summer_dry
6676 ohm_coef(4, 3, 1) = ohm_coef_dectr(1)%winter_wet
6677 ohm_coef(4, 4, 1) = ohm_coef_dectr(1)%winter_dry
6678
6679 ohm_coef(4, 1, 2) = ohm_coef_dectr(2)%summer_wet
6680 ohm_coef(4, 2, 2) = ohm_coef_dectr(2)%summer_dry
6681 ohm_coef(4, 3, 2) = ohm_coef_dectr(2)%winter_wet
6682 ohm_coef(4, 4, 2) = ohm_coef_dectr(2)%winter_dry
6683
6684 ohm_coef(4, 1, 3) = ohm_coef_dectr(3)%summer_wet
6685 ohm_coef(4, 2, 3) = ohm_coef_dectr(3)%summer_dry
6686 ohm_coef(4, 3, 3) = ohm_coef_dectr(3)%winter_wet
6687 ohm_coef(4, 4, 3) = ohm_coef_dectr(3)%winter_dry
6688
6689 ohm_coef(5, 1, 1) = ohm_coef_grass(1)%summer_wet
6690 ohm_coef(5, 2, 1) = ohm_coef_grass(1)%summer_dry
6691 ohm_coef(5, 3, 1) = ohm_coef_grass(1)%winter_wet
6692 ohm_coef(5, 4, 1) = ohm_coef_grass(1)%winter_dry
6693
6694 ohm_coef(5, 1, 2) = ohm_coef_grass(2)%summer_wet
6695 ohm_coef(5, 2, 2) = ohm_coef_grass(2)%summer_dry
6696 ohm_coef(5, 3, 2) = ohm_coef_grass(2)%winter_wet
6697 ohm_coef(5, 4, 2) = ohm_coef_grass(2)%winter_dry
6698
6699 ohm_coef(5, 1, 3) = ohm_coef_grass(3)%summer_wet
6700 ohm_coef(5, 2, 3) = ohm_coef_grass(3)%summer_dry
6701 ohm_coef(5, 3, 3) = ohm_coef_grass(3)%winter_wet
6702 ohm_coef(5, 4, 3) = ohm_coef_grass(3)%winter_dry
6703
6704 ohm_coef(6, 1, 1) = ohm_coef_bsoil(1)%summer_wet
6705 ohm_coef(6, 2, 1) = ohm_coef_bsoil(1)%summer_dry
6706 ohm_coef(6, 3, 1) = ohm_coef_bsoil(1)%winter_wet
6707 ohm_coef(6, 4, 1) = ohm_coef_bsoil(1)%winter_dry
6708
6709 ohm_coef(6, 1, 2) = ohm_coef_bsoil(2)%summer_wet
6710 ohm_coef(6, 2, 2) = ohm_coef_bsoil(2)%summer_dry
6711 ohm_coef(6, 3, 2) = ohm_coef_bsoil(2)%winter_wet
6712 ohm_coef(6, 4, 2) = ohm_coef_bsoil(2)%winter_dry
6713
6714 ohm_coef(6, 1, 3) = ohm_coef_bsoil(3)%summer_wet
6715 ohm_coef(6, 2, 3) = ohm_coef_bsoil(3)%summer_dry
6716 ohm_coef(6, 3, 3) = ohm_coef_bsoil(3)%winter_wet
6717 ohm_coef(6, 4, 3) = ohm_coef_bsoil(3)%winter_dry
6718
6719 ohm_coef(7, 1, 1) = ohm_coef_water(1)%summer_wet
6720 ohm_coef(7, 2, 1) = ohm_coef_water(1)%summer_dry
6721 ohm_coef(7, 3, 1) = ohm_coef_water(1)%winter_wet
6722 ohm_coef(7, 4, 1) = ohm_coef_water(1)%winter_dry
6723
6724 ohm_coef(7, 1, 2) = ohm_coef_water(2)%summer_wet
6725 ohm_coef(7, 2, 2) = ohm_coef_water(2)%summer_dry
6726 ohm_coef(7, 3, 2) = ohm_coef_water(2)%winter_wet
6727 ohm_coef(7, 4, 2) = ohm_coef_water(2)%winter_dry
6728
6729 ohm_coef(7, 1, 3) = ohm_coef_water(3)%summer_wet
6730 ohm_coef(7, 2, 3) = ohm_coef_water(3)%summer_dry
6731 ohm_coef(7, 3, 3) = ohm_coef_water(3)%winter_wet
6732 ohm_coef(7, 4, 3) = ohm_coef_water(3)%winter_dry
6733
6734 ohm_coef(8, 1, 1) = 0.0
6735 ohm_coef(8, 2, 1) = 0.0
6736 ohm_coef(8, 3, 1) = 0.0
6737 ohm_coef(8, 4, 1) = 0.0
6738
6739 ohm_coef(8, 1, 2) = 0.0
6740 ohm_coef(8, 2, 2) = 0.0
6741 ohm_coef(8, 3, 2) = 0.0
6742 ohm_coef(8, 4, 2) = 0.0
6743
6744 ohm_coef(8, 1, 3) = 0.0
6745 ohm_coef(8, 2, 3) = 0.0
6746 ohm_coef(8, 3, 3) = 0.0
6747 ohm_coef(8, 4, 3) = 0.0
6748
6749 ohm_threshsw(1) = ohm_threshsw_paved
6750 ohm_threshsw(2) = ohm_threshsw_bldg
6751 ohm_threshsw(3) = ohm_threshsw_evetr
6752 ohm_threshsw(4) = ohm_threshsw_dectr
6753 ohm_threshsw(5) = ohm_threshsw_grass
6754 ohm_threshsw(6) = ohm_threshsw_bsoil
6755 ohm_threshsw(7) = ohm_threshsw_water
6756
6757 ohm_threshwd(1) = ohm_threshwd_paved
6758 ohm_threshwd(2) = ohm_threshwd_bldg
6759 ohm_threshwd(3) = ohm_threshwd_evetr
6760 ohm_threshwd(4) = ohm_threshwd_dectr
6761 ohm_threshwd(5) = ohm_threshwd_grass
6762 ohm_threshwd(6) = ohm_threshwd_bsoil
6763 ohm_threshwd(7) = ohm_threshwd_water
6764
6765 soilstorecap(1) = soilstorecap_paved
6766 soilstorecap(2) = soilstorecap_bldg
6767 soilstorecap(3) = soilstorecap_evetr
6768 soilstorecap(4) = soilstorecap_dectr
6769 soilstorecap(5) = soilstorecap_grass
6770 soilstorecap(6) = soilstorecap_bsoil
6771 soilstorecap(7) = soilstorecap_water
6772
6773 emis(1) = emis_paved
6774 emis(2) = emis_bldg
6775 emis(3) = emis_evetr
6776 emis(4) = emis_dectr
6777 emis(5) = emis_grass
6778 emis(6) = emis_bsoil
6779 emis(7) = emis_water
6780
6781 cpanohm(1) = cpanohm_paved
6782 cpanohm(2) = cpanohm_bldg
6783 cpanohm(3) = cpanohm_evetr
6784 cpanohm(4) = cpanohm_dectr
6785 cpanohm(5) = cpanohm_grass
6786 cpanohm(6) = cpanohm_bsoil
6787 cpanohm(7) = cpanohm_water
6788
6789 kkanohm(1) = kkanohm_paved
6790 kkanohm(2) = kkanohm_bldg
6791 kkanohm(3) = kkanohm_evetr
6792 kkanohm(4) = kkanohm_dectr
6793 kkanohm(5) = kkanohm_grass
6794 kkanohm(6) = kkanohm_bsoil
6795 kkanohm(7) = kkanohm_water
6796
6797 chanohm(1) = chanohm_paved
6798 chanohm(2) = chanohm_bldg
6799 chanohm(3) = chanohm_evetr
6800 chanohm(4) = chanohm_dectr
6801 chanohm(5) = chanohm_grass
6802 chanohm(6) = chanohm_bsoil
6803 chanohm(7) = chanohm_water
6804
6805 ! WRITE (*, *) 'OHM_coef = ', OHM_coef
6806
6807 ! initialise output variables
6808 deltaqi = 0
6809 !SnowFrac = 0
6810 !qn1_S = 0
6811 dataoutlineestm = -999
6812 qs = -999
6813 a1 = -999
6814 a2 = -999
6815 a3 = -999
6816
6817 ! calculate qn if qf should be included
6818 IF (ohmincqf == 1) THEN
6819 qn_use = qf + qn
6820 ELSEIF (ohmincqf == 0) THEN
6821 qn_use = qn
6822 END IF
6823
6824 IF (storageheatmethod == 0) THEN !Use observed QS
6825 qs = qs_obs
6826
6827 ELSEIF (storageheatmethod == 1) THEN !Use OHM to calculate QS
6828 tair_mav_5d = hdd_id(10)
6829 IF (diagnose == 1) WRITE (*, *) 'Calling OHM...'
6830 CALL ohm(qn_use, qn_av_prev, dqndt_prev, qn_av_next, dqndt_next, &
6831 qn_s, qn_s_av_prev, dqnsdt_prev, qn_s_av_next, dqnsdt_next, &
6832 tstep, dt_since_start, &
6833 sfr_surf, nsurf, &
6834 tair_mav_5d, &
6835 ohm_coef, &
6836 ohm_threshsw, ohm_threshwd, &
6837 soilstore_id, soilstorecap, state_id, &
6838 bldgsurf, watersurf, &
6839 snowuse, snowfrac, &
6840 diagqs, &
6841 a1, a2, a3, qs, deltaqi)
6842 qs_surf = qs
6843 qs_roof = qs
6844 qs_wall = qs
6845
6846 ! use AnOHM to calculate QS, TS 14 Mar 2016
6847 ELSEIF (storageheatmethod == 3) THEN
6848 IF (diagnose == 1) WRITE (*, *) 'Calling AnOHM...'
6849 ! CALL AnOHM(qn1_use,qn1_store_grid,qn1_av_store_grid,qf,&
6850 ! MetForcingData_grid,state_id/StoreDrainPrm(6,:),&
6851 ! alb, emis, cpAnOHM, kkAnOHM, chAnOHM,&
6852 ! sfr_surf,nsurf,nsh,EmissionsMethod,id,Gridiv,&
6853 ! a1,a2,a3,qs,deltaQi)
6854 moist_surf = state_id/storedrainprm(6, :)
6855 ! CALL AnOHM( &
6856 ! tstep, dt_since_start, &
6857 ! qn_use, qn_av_prev, dqndt_prev, qf, &
6858 ! MetForcingData_grid, moist_surf, &
6859 ! alb, emis, cpAnOHM, kkAnOHM, chAnOHM, & ! input
6860 ! sfr_surf, nsurf, EmissionsMethod, id, Gridiv, &
6861 ! qn_av_next, dqndt_next, &
6862 ! a1, a2, a3, qs, deltaQi) ! output
6863 qs_surf = qs
6864 qs_roof = qs
6865 qs_wall = qs
6866
6867 ! !Calculate QS using ESTM
6868 ELSEIF (storageheatmethod == 4 .OR. storageheatmethod == 14) THEN
6869 ! !CALL ESTM(QSestm,iMB)
6870 IF (diagnose == 1) WRITE (*, *) 'Calling ESTM...'
6871 CALL estm( &
6872 gridiv, & !input
6873 tstep, &
6874 avkdn, avu1, temp_c, zenith_deg, avrh, press_hpa, ldown, &
6875 bldgh, ts5mindata_ir, &
6876 tair_av, &
6877 dataoutlineestm, qs) !output
6878 ! CALL ESTM(QSestm,Gridiv,ir) ! iMB corrected to Gridiv, TS 09 Jun 2016
6879 ! QS=QSestm ! Use ESTM qs
6880 ELSEIF (storageheatmethod == 5) THEN
6881 ! !CALL ESTM(QSestm,iMB)
6882 IF (diagnose == 1) WRITE (*, *) 'Calling extended ESTM...'
6883 ! facets: seven suews standard facets + extra for buildings [roof, wall] (can be extended for heterogeneous buildings)
6884 !
6885 ! ASSOCIATE (v => dz_roof(1, 1:ndepth))
6886 ! PRINT *, 'dz_roof in cal_qs', v, SIZE(v)
6887 ! END ASSOCIATE
6888 ! ASSOCIATE (v => dz_wall(1, 1:ndepth))
6889 ! PRINT *, 'dz_wall in cal_qs', v, SIZE(v)
6890 ! END ASSOCIATE
6891 CALL ehc( &
6892 tstep, & !input
6893 nlayer, &
6894 qg_surf, qg_roof, qg_wall, &
6895 tsfc_roof, tin_roof, temp_in_roof, k_roof, cp_roof, dz_roof, sfr_roof, & !input
6896 tsfc_wall, tin_wall, temp_in_wall, k_wall, cp_wall, dz_wall, sfr_wall, & !input
6897 tsfc_surf, tin_surf, temp_in_surf, k_surf, cp_surf, dz_surf, sfr_surf, & !input
6898 temp_out_roof, qs_roof, & !output
6899 temp_out_wall, qs_wall, & !output
6900 temp_out_surf, qs_surf, & !output
6901 qs) !output
6902
6903 ! TODO: add deltaQi to output for snow heat storage
6904
6905 ! PRINT *, 'QS after ESTM_ehc', QS
6906 ! PRINT *, 'QS_roof after ESTM_ehc', QS_roof
6907 ! PRINT *, 'QS_wall after ESTM_ehc', QS_wall
6908 ! PRINT *, 'QS_surf after ESTM_ehc', QS_surf
6909 ! PRINT *, '------------------------------------'
6910 ! PRINT *, ''
6911 END IF
6912

References allocatearray::bldgsurf, ehc_module::ehc(), estm_module::estm(), ohm(), and allocatearray::watersurf.

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_resistance()

subroutine suews_driver::suews_cal_resistance ( integer, intent(in) stabilitymethod,
integer, intent(in) diagnose,
integer, intent(in) aerodynamicresistancemethod,
integer, intent(in) roughlenheatmethod,
integer, intent(in) snowuse,
integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) gsmodel,
integer, intent(in) smdmethod,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) qh_init,
real(kind(1d0)), intent(in) zzd,
real(kind(1d0)), intent(in) z0m,
real(kind(1d0)), intent(in) zdm,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) vegfraction,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), intent(in) dq,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(in) vsmd,
real(kind(1d0)), dimension(3), intent(in) maxconductance,
real(kind(1d0)), dimension(3), intent(in) laimax,
real(kind(1d0)), dimension(3), intent(in) lai_id,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), intent(out) g_kdown,
real(kind(1d0)), intent(out) g_dq,
real(kind(1d0)), intent(out) g_ta,
real(kind(1d0)), intent(out) g_smd,
real(kind(1d0)), intent(out) g_lai,
real(kind(1d0)), intent(out) ustar,
real(kind(1d0)), intent(out) tstar,
real(kind(1d0)), intent(out) l_mod,
real(kind(1d0)), intent(out) zl,
real(kind(1d0)), intent(out) gsc,
real(kind(1d0)), intent(out) rs,
real(kind(1d0)), intent(out) ra,
real(kind(1d0)), intent(out) rasnow,
real(kind(1d0)), intent(out) rb,
real(kind(1d0)), intent(out) z0v,
real(kind(1d0)), intent(out) z0vsnow )

Definition at line 8975 of file suews_ctrl_driver.f95.

8989
8990 IMPLICIT NONE
8991
8992 INTEGER, INTENT(in) :: StabilityMethod !method to calculate atmospheric stability [-]
8993 INTEGER, INTENT(in) :: Diagnose
8994 INTEGER, INTENT(in) :: AerodynamicResistanceMethod !method to calculate RA [-]
8995 INTEGER, INTENT(in) :: RoughLenHeatMethod !method to calculate heat roughness length [-]
8996 INTEGER, INTENT(in) :: SnowUse !!Snow part used (1) or not used (0) [-]
8997 INTEGER, INTENT(in) :: id ! day of the year [-]
8998 INTEGER, INTENT(in) :: it !hour [h]
8999 INTEGER, INTENT(in) :: gsModel !Choice of gs parameterisation (1 = Ja11, 2 = Wa16)
9000 INTEGER, INTENT(in) :: SMDMethod !Method of measured soil moisture
9001
9002 ! REAL(KIND(1d0)), INTENT(in)::qh_obs
9003 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
9004 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
9005 REAL(KIND(1D0)), INTENT(in) :: QH_init !initial sensible heat flux [W m-2]
9006 REAL(KIND(1D0)), INTENT(in) :: zzd !Active measurement height (meas. height-displac. height) [m]
9007 REAL(KIND(1D0)), INTENT(in) :: z0m !Aerodynamic roughness length [m]
9008 REAL(KIND(1D0)), INTENT(in) :: zdm !Displacement height [m]
9009 REAL(KIND(1D0)), INTENT(in) :: avU1 !Average wind speed [m s-1]
9010 REAL(KIND(1D0)), INTENT(in) :: Temp_C !Air temperature [degC]
9011 REAL(KIND(1D0)), INTENT(in) :: VegFraction !Fraction of vegetation [-]
9012 REAL(KIND(1D0)), INTENT(in) :: avkdn !Average downwelling shortwave radiation [W m-2]
9013 REAL(KIND(1D0)), INTENT(in) :: Kmax !Annual maximum hourly solar radiation [W m-2]
9014 REAL(KIND(1D0)), INTENT(in) :: G_max !Fitted parameters related to surface res. calculations
9015 REAL(KIND(1D0)), INTENT(in) :: G_k !Fitted parameters related to surface res. calculations
9016 REAL(KIND(1D0)), INTENT(in) :: G_q_base !Fitted parameters related to surface res. calculations
9017 REAL(KIND(1D0)), INTENT(in) :: G_q_shape !Fitted parameters related to surface res. calculations
9018 REAL(KIND(1D0)), INTENT(in) :: G_t !Fitted parameters related to surface res. calculations
9019 REAL(KIND(1D0)), INTENT(in) :: G_sm !Fitted parameters related to surface res. calculations
9020 REAL(KIND(1D0)), INTENT(in) :: S1 !a parameter related to soil moisture dependence [-]
9021 REAL(KIND(1D0)), INTENT(in) :: S2 !a parameter related to soil moisture dependence [mm]
9022 REAL(KIND(1D0)), INTENT(in) :: TH !Maximum temperature limit [degC]
9023 REAL(KIND(1D0)), INTENT(in) :: TL !Minimum temperature limit [degC]
9024 REAL(KIND(1D0)), INTENT(in) :: dq !Specific humidity deficit
9025 REAL(KIND(1D0)), INTENT(in) :: xsmd !Measured soil moisture deficit
9026 REAL(KIND(1D0)), INTENT(in) :: vsmd !Soil moisture deficit for vegetated surfaces only[mm]
9027
9028 REAL(KIND(1D0)), DIMENSION(3), INTENT(in) :: MaxConductance !the maximum conductance of each vegetation or surface type. [mm s-1]
9029 REAL(KIND(1D0)), DIMENSION(3), INTENT(in) :: LAIMax !Max LAI [m2 m-2]
9030 REAL(KIND(1D0)), DIMENSION(3), INTENT(in) :: LAI_id !=LAI_id(id-1,:), LAI for each veg surface [m2 m-2]
9031
9032 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac !Surface fraction of snow cover [-]
9033 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !Surface fractions [-]
9034
9035 REAL(KIND(1D0)), INTENT(out) :: TStar !T* temperature scale
9036 REAL(KIND(1D0)), INTENT(out) :: UStar !friction velocity [m s-1]
9037 REAL(KIND(1D0)), INTENT(out) :: zL !stability scale
9038 REAL(KIND(1D0)), INTENT(out) :: gsc !Surface Layer Conductance
9039 REAL(KIND(1D0)), INTENT(out) :: RS !surface resistance [s m-1]
9040 REAL(KIND(1D0)), INTENT(out) :: RA !Aerodynamic resistance [s m-1]
9041 REAL(KIND(1D0)), INTENT(out) :: z0v !roughness for heat [m]
9042 REAL(KIND(1D0)), INTENT(out) :: RASnow !Aerodynamic resistance for snow [s m-1]
9043 REAL(KIND(1D0)), INTENT(out) :: z0vSnow !roughness for heat [m]
9044 REAL(KIND(1D0)), INTENT(out) :: RB !boundary layer resistance shuttleworth
9045 REAL(KIND(1D0)), INTENT(out) :: L_mod !Obukhov length [m]
9046
9047 REAL(KIND(1D0)), INTENT(out) :: g_kdown !gdq*gtemp*gs*gq for photosynthesis calculations
9048 REAL(KIND(1D0)), INTENT(out) :: g_dq !gdq*gtemp*gs*gq for photosynthesis calculations
9049 REAL(KIND(1D0)), INTENT(out) :: g_ta !gdq*gtemp*gs*gq for photosynthesis calculations
9050 REAL(KIND(1D0)), INTENT(out) :: g_smd !gdq*gtemp*gs*gq for photosynthesis calculations
9051 REAL(KIND(1D0)), INTENT(out) :: g_lai !gdq*gtemp*gs*gq for photosynthesis calculations
9052
9053 REAL(KIND(1D0)) :: gfunc !gdq*gtemp*gs*gq for photosynthesis calculations
9054 ! REAL(KIND(1d0)) ::H_init !Kinematic sensible heat flux [K m s-1] used to calculate friction velocity
9055
9056 ! Get first estimate of sensible heat flux. Modified by HCW 26 Feb 2015
9057 ! CALL SUEWS_init_QH( &
9058 ! avdens, avcp, QH_init, qn1, dectime, &
9059 ! H_init)
9060 rasnow = 0.0
9061
9062 IF (diagnose == 1) WRITE (*, *) 'Calling STAB_lumps...'
9063 !u* and Obukhov length out
9064 CALL cal_stab( &
9065 stabilitymethod, & ! input
9066 zzd, & !Active measurement height (meas. height-displac. height)
9067 z0m, & !Aerodynamic roughness length
9068 zdm, & !zero-plane displacement
9069 avu1, & !Average wind speed
9070 temp_c, & !Air temperature
9071 qh_init, & !sensible heat flux
9072 avdens, & ! air density
9073 avcp, & ! heat capacity of air
9074 l_mod, & ! output: !Obukhov length
9075 tstar, & !T*, temperature scale
9076 ustar, & !Friction velocity
9077 zl) !Stability scale
9078
9079 IF (diagnose == 1) WRITE (*, *) 'Calling AerodynamicResistance...'
9080 CALL aerodynamicresistance( &
9081 zzd, & ! input:
9082 z0m, &
9083 avu1, &
9084 l_mod, &
9085 ustar, &
9086 vegfraction, &
9087 aerodynamicresistancemethod, &
9088 stabilitymethod, &
9089 roughlenheatmethod, &
9090 ra, z0v) ! output:
9091
9092 IF (snowuse == 1) THEN
9093 IF (diagnose == 1) WRITE (*, *) 'Calling AerodynamicResistance for snow...'
9094 CALL aerodynamicresistance( &
9095 zzd, & ! input:
9096 z0m, &
9097 avu1, &
9098 l_mod, &
9099 ustar, &
9100 vegfraction, &
9101 aerodynamicresistancemethod, &
9102 stabilitymethod, &
9103 3, &
9104 rasnow, z0vsnow) ! output:
9105 END IF
9106
9107 IF (diagnose == 1) WRITE (*, *) 'Calling SurfaceResistance...'
9108 ! CALL SurfaceResistance(id,it) !qsc and surface resistance out
9109 CALL surfaceresistance( &
9110 id, it, & ! input:
9111 smdmethod, snowfrac, sfr_surf, avkdn, temp_c, dq, xsmd, vsmd, maxconductance, &
9112 laimax, lai_id, gsmodel, kmax, &
9113 g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, th, tl, s1, s2, &
9114 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
9115 gfunc, gsc, rs) ! output:
9116
9117 IF (diagnose == 1) WRITE (*, *) 'Calling BoundaryLayerResistance...'
9118 CALL boundarylayerresistance( &
9119 zzd, & ! input: !Active measurement height (meas. height- zero-plane displacement)
9120 z0m, & !Aerodynamic roughness length
9121 avu1, & !Average wind speed
9122 ustar, & ! input/output:
9123 rb) ! output:
9124

References resist_module::aerodynamicresistance(), resist_module::boundarylayerresistance(), atmmoiststab_module::cal_stab(), and resist_module::surfaceresistance().

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_resistance_dts()

subroutine suews_driver::suews_cal_resistance_dts ( integer, intent(in) stabilitymethod,
integer, intent(in) diagnose,
integer, intent(in) aerodynamicresistancemethod,
integer, intent(in) roughlenheatmethod,
integer, intent(in) snowuse,
integer, intent(in) id,
integer, intent(in) it,
integer, intent(in) gsmodel,
integer, intent(in) smdmethod,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) qh_init,
real(kind(1d0)), intent(in) zzd,
real(kind(1d0)), intent(in) z0m,
real(kind(1d0)), intent(in) zdm,
real(kind(1d0)), intent(in) avu1,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) vegfraction,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) kmax,
real(kind(1d0)), intent(in) g_max,
real(kind(1d0)), intent(in) g_k,
real(kind(1d0)), intent(in) g_q_base,
real(kind(1d0)), intent(in) g_q_shape,
real(kind(1d0)), intent(in) g_t,
real(kind(1d0)), intent(in) g_sm,
real(kind(1d0)), intent(in) s1,
real(kind(1d0)), intent(in) s2,
real(kind(1d0)), intent(in) th,
real(kind(1d0)), intent(in) tl,
real(kind(1d0)), intent(in) dq,
real(kind(1d0)), intent(in) xsmd,
real(kind(1d0)), intent(in) vsmd,
real(kind(1d0)), intent(in) maxconductance_evetr,
real(kind(1d0)), intent(in) maxconductance_dectr,
real(kind(1d0)), intent(in) maxconductance_grass,
real(kind(1d0)), intent(in) laimax_evetr,
real(kind(1d0)), intent(in) laimax_dectr,
real(kind(1d0)), intent(in) laimax_grass,
real(kind(1d0)), dimension(3), intent(in) lai_id,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), intent(out) g_kdown,
real(kind(1d0)), intent(out) g_dq,
real(kind(1d0)), intent(out) g_ta,
real(kind(1d0)), intent(out) g_smd,
real(kind(1d0)), intent(out) g_lai,
real(kind(1d0)), intent(out) ustar,
real(kind(1d0)), intent(out) tstar,
real(kind(1d0)), intent(out) l_mod,
real(kind(1d0)), intent(out) zl,
real(kind(1d0)), intent(out) gsc,
real(kind(1d0)), intent(out) rs,
real(kind(1d0)), intent(out) ra,
real(kind(1d0)), intent(out) rasnow,
real(kind(1d0)), intent(out) rb,
real(kind(1d0)), intent(out) z0v,
real(kind(1d0)), intent(out) z0vsnow )

Definition at line 9127 of file suews_ctrl_driver.f95.

9145
9146 IMPLICIT NONE
9147
9148 INTEGER, INTENT(in) :: StabilityMethod !method to calculate atmospheric stability [-]
9149 INTEGER, INTENT(in) :: Diagnose
9150 INTEGER, INTENT(in) :: AerodynamicResistanceMethod !method to calculate RA [-]
9151 INTEGER, INTENT(in) :: RoughLenHeatMethod !method to calculate heat roughness length [-]
9152 INTEGER, INTENT(in) :: SnowUse !!Snow part used (1) or not used (0) [-]
9153 INTEGER, INTENT(in) :: id ! day of the year [-]
9154 INTEGER, INTENT(in) :: it !hour [h]
9155 INTEGER, INTENT(in) :: gsModel !Choice of gs parameterisation (1 = Ja11, 2 = Wa16)
9156 INTEGER, INTENT(in) :: SMDMethod !Method of measured soil moisture
9157
9158 ! REAL(KIND(1d0)), INTENT(in)::qh_obs
9159 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
9160 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
9161 REAL(KIND(1D0)), INTENT(in) :: QH_init !initial sensible heat flux [W m-2]
9162 REAL(KIND(1D0)), INTENT(in) :: zzd !Active measurement height (meas. height-displac. height) [m]
9163 REAL(KIND(1D0)), INTENT(in) :: z0m !Aerodynamic roughness length [m]
9164 REAL(KIND(1D0)), INTENT(in) :: zdm !Displacement height [m]
9165 REAL(KIND(1D0)), INTENT(in) :: avU1 !Average wind speed [m s-1]
9166 REAL(KIND(1D0)), INTENT(in) :: Temp_C !Air temperature [degC]
9167 REAL(KIND(1D0)), INTENT(in) :: VegFraction !Fraction of vegetation [-]
9168 REAL(KIND(1D0)), INTENT(in) :: avkdn !Average downwelling shortwave radiation [W m-2]
9169 REAL(KIND(1D0)), INTENT(in) :: Kmax !Annual maximum hourly solar radiation [W m-2]
9170 REAL(KIND(1D0)), INTENT(in) :: G_max !Fitted parameters related to surface res. calculations
9171 REAL(KIND(1D0)), INTENT(in) :: G_k !Fitted parameters related to surface res. calculations
9172 REAL(KIND(1D0)), INTENT(in) :: G_q_base !Fitted parameters related to surface res. calculations
9173 REAL(KIND(1D0)), INTENT(in) :: G_q_shape !Fitted parameters related to surface res. calculations
9174 REAL(KIND(1D0)), INTENT(in) :: G_t !Fitted parameters related to surface res. calculations
9175 REAL(KIND(1D0)), INTENT(in) :: G_sm !Fitted parameters related to surface res. calculations
9176 REAL(KIND(1D0)), INTENT(in) :: S1 !a parameter related to soil moisture dependence [-]
9177 REAL(KIND(1D0)), INTENT(in) :: S2 !a parameter related to soil moisture dependence [mm]
9178 REAL(KIND(1D0)), INTENT(in) :: TH !Maximum temperature limit [degC]
9179 REAL(KIND(1D0)), INTENT(in) :: TL !Minimum temperature limit [degC]
9180 REAL(KIND(1D0)), INTENT(in) :: dq !Specific humidity deficit
9181 REAL(KIND(1D0)), INTENT(in) :: xsmd !Measured soil moisture deficit
9182 REAL(KIND(1D0)), INTENT(in) :: vsmd !Soil moisture deficit for vegetated surfaces only[mm]
9183
9184 REAL(KIND(1D0)), INTENT(in) :: MaxConductance_dectr
9185 REAL(KIND(1D0)), INTENT(in) :: MaxConductance_evetr
9186 REAL(KIND(1D0)), INTENT(in) :: MaxConductance_grass
9187 REAL(KIND(1D0)), DIMENSION(3) :: MaxConductance !the maximum conductance of each vegetation or surface type. [mm s-1]
9188
9189 REAL(KIND(1D0)), INTENT(in) :: LAIMax_dectr
9190 REAL(KIND(1D0)), INTENT(in) :: LAIMax_evetr
9191 REAL(KIND(1D0)), INTENT(in) :: LAIMax_grass
9192 REAL(KIND(1D0)), DIMENSION(3) :: LAIMax !Max LAI [m2 m-2]
9193
9194 REAL(KIND(1D0)), DIMENSION(3), INTENT(in) :: LAI_id !=LAI_id(id-1,:), LAI for each veg surface [m2 m-2]
9195
9196 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac !Surface fraction of snow cover [-]
9197
9198 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
9199 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
9200 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
9201 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
9202 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
9203 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
9204 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
9205 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
9206
9207 REAL(KIND(1D0)), INTENT(out) :: TStar !T* temperature scale
9208 REAL(KIND(1D0)), INTENT(out) :: UStar !friction velocity [m s-1]
9209 REAL(KIND(1D0)), INTENT(out) :: zL !stability scale
9210 REAL(KIND(1D0)), INTENT(out) :: gsc !Surface Layer Conductance
9211 REAL(KIND(1D0)), INTENT(out) :: RS !surface resistance [s m-1]
9212 REAL(KIND(1D0)), INTENT(out) :: RA !Aerodynamic resistance [s m-1]
9213 REAL(KIND(1D0)), INTENT(out) :: z0v !roughness for heat [m]
9214 REAL(KIND(1D0)), INTENT(out) :: RASnow !Aerodynamic resistance for snow [s m-1]
9215 REAL(KIND(1D0)), INTENT(out) :: z0vSnow !roughness for heat [m]
9216 REAL(KIND(1D0)), INTENT(out) :: RB !boundary layer resistance shuttleworth
9217 REAL(KIND(1D0)), INTENT(out) :: L_mod !Obukhov length [m]
9218
9219 REAL(KIND(1D0)), INTENT(out) :: g_kdown !gdq*gtemp*gs*gq for photosynthesis calculations
9220 REAL(KIND(1D0)), INTENT(out) :: g_dq !gdq*gtemp*gs*gq for photosynthesis calculations
9221 REAL(KIND(1D0)), INTENT(out) :: g_ta !gdq*gtemp*gs*gq for photosynthesis calculations
9222 REAL(KIND(1D0)), INTENT(out) :: g_smd !gdq*gtemp*gs*gq for photosynthesis calculations
9223 REAL(KIND(1D0)), INTENT(out) :: g_lai !gdq*gtemp*gs*gq for photosynthesis calculations
9224
9225 REAL(KIND(1D0)) :: gfunc !gdq*gtemp*gs*gq for photosynthesis calculations
9226 ! REAL(KIND(1d0)) ::H_init !Kinematic sensible heat flux [K m s-1] used to calculate friction velocity
9227
9228 ! Get first estimate of sensible heat flux. Modified by HCW 26 Feb 2015
9229 ! CALL SUEWS_init_QH( &
9230 ! avdens, avcp, QH_init, qn1, dectime, &
9231 ! H_init)
9232 rasnow = 0.0
9233
9234 maxconductance(1) = maxconductance_evetr
9235 maxconductance(2) = maxconductance_dectr
9236 maxconductance(3) = maxconductance_grass
9237
9238 laimax(1) = laimax_evetr
9239 laimax(2) = laimax_dectr
9240 laimax(3) = laimax_grass
9241
9242 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
9243
9244 IF (diagnose == 1) WRITE (*, *) 'Calling STAB_lumps...'
9245 !u* and Obukhov length out
9246 CALL cal_stab( &
9247 stabilitymethod, & ! input
9248 zzd, & !Active measurement height (meas. height-displac. height)
9249 z0m, & !Aerodynamic roughness length
9250 zdm, & !zero-plane displacement
9251 avu1, & !Average wind speed
9252 temp_c, & !Air temperature
9253 qh_init, & !sensible heat flux
9254 avdens, & ! air density
9255 avcp, & ! heat capacity of air
9256 l_mod, & ! output: !Obukhov length
9257 tstar, & !T*, temperature scale
9258 ustar, & !Friction velocity
9259 zl) !Stability scale
9260
9261 IF (diagnose == 1) WRITE (*, *) 'Calling AerodynamicResistance...'
9262 CALL aerodynamicresistance( &
9263 zzd, & ! input:
9264 z0m, &
9265 avu1, &
9266 l_mod, &
9267 ustar, &
9268 vegfraction, &
9269 aerodynamicresistancemethod, &
9270 stabilitymethod, &
9271 roughlenheatmethod, &
9272 ra, z0v) ! output:
9273
9274 IF (snowuse == 1) THEN
9275 IF (diagnose == 1) WRITE (*, *) 'Calling AerodynamicResistance for snow...'
9276 CALL aerodynamicresistance( &
9277 zzd, & ! input:
9278 z0m, &
9279 avu1, &
9280 l_mod, &
9281 ustar, &
9282 vegfraction, &
9283 aerodynamicresistancemethod, &
9284 stabilitymethod, &
9285 3, &
9286 rasnow, z0vsnow) ! output:
9287 END IF
9288
9289 IF (diagnose == 1) WRITE (*, *) 'Calling SurfaceResistance...'
9290 ! CALL SurfaceResistance(id,it) !qsc and surface resistance out
9291 CALL surfaceresistance( &
9292 id, it, & ! input:
9293 smdmethod, snowfrac, sfr_surf, avkdn, temp_c, dq, xsmd, vsmd, maxconductance, &
9294 laimax, lai_id, gsmodel, kmax, &
9295 g_max, g_k, g_q_base, g_q_shape, g_t, g_sm, th, tl, s1, s2, &
9296 g_kdown, g_dq, g_ta, g_smd, g_lai, & ! output:
9297 gfunc, gsc, rs) ! output:
9298
9299 IF (diagnose == 1) WRITE (*, *) 'Calling BoundaryLayerResistance...'
9300 CALL boundarylayerresistance( &
9301 zzd, & ! input: !Active measurement height (meas. height- zero-plane displacement)
9302 z0m, & !Aerodynamic roughness length
9303 avu1, & !Average wind speed
9304 ustar, & ! input/output:
9305 rb) ! output:
9306

References resist_module::aerodynamicresistance(), resist_module::boundarylayerresistance(), atmmoiststab_module::cal_stab(), and resist_module::surfaceresistance().

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_snow()

subroutine suews_driver::suews_cal_snow ( integer, intent(in) diagnose,
integer, intent(in) nlayer,
integer, intent(in) tstep,
integer, intent(in) imin,
integer, intent(in) it,
integer, intent(in) evapmethod,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) crwmin,
real(kind(1d0)), intent(in) crwmax,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) lv_j_kg,
real(kind(1d0)), intent(in) lvs_j_kg,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) rasnow,
real(kind(1d0)), intent(in) psyc_hpa,
real(kind(1d0)), intent(in) sice_hpa,
real(kind(1d0)), intent(in) tau_r,
real(kind(1d0)), intent(in) radmeltfact,
real(kind(1d0)), intent(in) tempmeltfact,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) preciplimit,
real(kind(1d0)), intent(in) preciplimitalb,
real(kind(1d0)), dimension(nsurf), intent(in) qn_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(in) kup_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(in) deltaqi,
real(kind(1d0)), dimension(nsurf), intent(in) tsurf_ind_snow,
real(kind(1d0)), intent(in) snowalb_in,
real(kind(1d0)), intent(in) pervfraction,
real(kind(1d0)), intent(in) vegfraction,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) qn_snowfree,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qs,
real(kind(1d0)), intent(in) vpd_hpa,
real(kind(1d0)), intent(in) s_hpa,
real(kind(1d0)), intent(in) rs,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(in) rb,
real(kind(1d0)), intent(in) snowdensmax,
real(kind(1d0)), intent(in) snowdensmin,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) snowlimpaved,
real(kind(1d0)), intent(in) snowlimbldg,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), dimension(nsurf), intent(in) drain,
real(kind(1d0)), dimension(nsurf), intent(in) wetthresh_surf,
real(kind(1d0)), dimension(nsurf), intent(in) soilstorecap,
real(kind(1d0)), dimension(nsurf), intent(in) tsurf_ind,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nsurf), intent(in) addwater,
real(kind(1d0)), dimension(nsurf), intent(in) addwaterrunoff,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), dimension(nsurf), intent(in) snowpacklimit,
real(kind(1d0)), dimension(0:23, 2), intent(in) snowprof_24hr,
real(kind(1d0)), dimension(nsurf), intent(in) snowpack_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowwater_in,
real(kind(1d0)), dimension(nsurf), intent(in) icefrac_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowdens_in,
real(kind(1d0)), intent(in) snowfallcum_in,
real(kind(1d0)), dimension(nsurf), intent(in) state_id_in,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id_in,
real(kind(1d0)), dimension(nsurf), intent(in) qn_surf,
real(kind(1d0)), dimension(nsurf), intent(in) qs_surf,
real(kind(1d0)), dimension(2), intent(out) snowremoval,
real(kind(1d0)), dimension(nsurf), intent(out) snowpack_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowfrac_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowwater_out,
real(kind(1d0)), dimension(nsurf), intent(out) icefrac_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowdens_out,
real(kind(1d0)), intent(out) snowfallcum_out,
real(kind(1d0)), dimension(nsurf), intent(out) state_id_out,
real(kind(1d0)), dimension(nsurf), intent(out) soilstore_id_out,
real(kind(1d0)), intent(out) state_per_tstep,
real(kind(1d0)), intent(out) nwstate_per_tstep,
real(kind(1d0)), intent(out) qe,
real(kind(1d0)), dimension(nsurf), intent(out) qe_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qe_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qe_wall,
real(kind(1d0)), intent(out) snowalb_out,
real(kind(1d0)), intent(out) swe,
real(kind(1d0)), intent(out) chsnow_per_tstep,
real(kind(1d0)), intent(out) ev_per_tstep,
real(kind(1d0)), intent(out) runoff_per_tstep,
real(kind(1d0)), intent(out) surf_chang_per_tstep,
real(kind(1d0)), intent(out) runoffpipes,
real(kind(1d0)), intent(out) mwstore,
real(kind(1d0)), intent(out) runoffwaterbody,
real(kind(1d0)), intent(out) runoffagveg,
real(kind(1d0)), intent(out) runoffagimpervious,
real(kind(1d0)), dimension(nsurf), intent(out) rss_surf,
real(kind(1d0)), dimension(ncolumnsdataoutsnow - 5), intent(out) dataoutlinesnow )

Definition at line 7275 of file suews_ctrl_driver.f95.

7302
7303 IMPLICIT NONE
7304
7305 INTEGER, INTENT(in) :: Diagnose
7306 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
7307 INTEGER, INTENT(in) :: tstep !timestep [s]
7308 INTEGER, INTENT(in) :: imin ! minutes [min]
7309 INTEGER, INTENT(in) :: it ! hour [H]
7310 INTEGER, INTENT(in) :: EvapMethod !Evaporation calculated according to Rutter (1) or Shuttleworth (2)
7311
7312 INTEGER, DIMENSION(nsurf) :: snowCalcSwitch
7313 INTEGER, DIMENSION(3), INTENT(in) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
7314
7315 REAL(KIND(1D0)), INTENT(in) :: CRWmin !minimum water holding capacity of snow [mm]
7316 REAL(KIND(1D0)), INTENT(in) :: CRWmax !maximum water holding capacity of snow [mm]
7317 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
7318 REAL(KIND(1D0)), INTENT(in) :: lvS_J_kg !latent heat of sublimation [J kg-1]
7319 REAL(KIND(1D0)), INTENT(in) :: lv_j_kg !Latent heat of vapourisation per timestep [J kg-1]
7320 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
7321 REAL(KIND(1D0)), INTENT(in) :: avRh !relative humidity [-]
7322 REAL(KIND(1D0)), INTENT(in) :: Press_hPa !air pressure [hPa]
7323 REAL(KIND(1D0)), INTENT(in) :: Temp_C !air temperature [degC]
7324 REAL(KIND(1D0)), INTENT(in) :: RAsnow !aerodynamic resistance of snow [s m-1]
7325 REAL(KIND(1D0)), INTENT(in) :: psyc_hPa !psychometric constant [hPa]
7326 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
7327 REAL(KIND(1D0)), INTENT(in) :: sIce_hPa !satured curve on snow [hPa]
7328 REAL(KIND(1D0)), INTENT(in) :: PervFraction !sum of surface cover fractions for impervious surfaces [-]
7329 REAL(KIND(1D0)), INTENT(in) :: vegfraction ! fraction of vegetation [-]
7330 REAL(KIND(1D0)), INTENT(in) :: addimpervious !Water from impervious surfaces of other grids for whole surface area [mm]
7331 REAL(KIND(1D0)), INTENT(in) :: qn_snowfree ! net all-wave radiation for snow-free surface [W m-2]
7332 REAL(KIND(1D0)), INTENT(in) :: qf !anthropogenic heat flux [W m-2]
7333 REAL(KIND(1D0)), INTENT(in) :: qs !heat storage flux [W m-2]
7334 REAL(KIND(1D0)), INTENT(in) :: vpd_hPa ! vapour pressure deficit [hPa]
7335 REAL(KIND(1D0)), INTENT(in) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
7336 REAL(KIND(1D0)), INTENT(in) :: RS !surface resistance [s m-1]
7337 REAL(KIND(1D0)), INTENT(in) :: RA !aerodynamic resistance [s m-1]
7338 REAL(KIND(1D0)), INTENT(in) :: RB !boundary layer resistance [s m-1]
7339 REAL(KIND(1D0)), INTENT(in) :: SnowDensMax !Fresh snow density [kg m-3]
7340 REAL(KIND(1D0)), INTENT(in) :: SnowDensMin !Fresh snow density [kg m-3]
7341 REAL(KIND(1D0)), INTENT(in) :: precip !rain data [mm]
7342 REAL(KIND(1D0)), INTENT(in) :: PipeCapacity !Capacity of pipes to transfer water [mm]
7343 REAL(KIND(1D0)), INTENT(in) :: RunoffToWater !Fraction of surface runoff going to water body [-]
7344 ! REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction
7345 ! REAL(KIND(1d0)), INTENT(in)::wu_EveTr!Water use for evergreen trees/shrubs [mm]
7346 ! REAL(KIND(1d0)), INTENT(in)::wu_DecTr!Water use for deciduous trees/shrubs [mm]
7347 ! REAL(KIND(1d0)), INTENT(in)::wu_Grass!Water use for grass [mm]
7348 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
7349 ! REAL(KIND(1D0)), INTENT(in) :: addWaterBody !Water from water surface of other grids [mm] for whole surface area
7350 REAL(KIND(1D0)), INTENT(in) :: SnowLimPaved !snow limit for paved [mm]
7351 REAL(KIND(1D0)), INTENT(in) :: SnowLimBldg !snow limit for building [mm]
7352 ! REAL(KIND(1D0)), INTENT(in) :: SurfaceArea
7353 REAL(KIND(1D0)), INTENT(in) :: FlowChange !Difference between the input and output flow in the water body [mm]
7354
7355 REAL(KIND(1D0)), INTENT(in) :: tau_r !time constant for snow density ageing [-]
7356
7357 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WU_nsurf
7358 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: drain !water flowing intyo drainage [mm]
7359 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WetThresh_surf !surface wetness threshold [mm]
7360 REAL(KIND(1D0)), DIMENSION(nsurf) :: mw_ind !melt water from sknowpack[mm]
7361 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SoilStoreCap !Capacity of soil store [mm]
7362 REAL(KIND(1D0)), DIMENSION(nsurf) :: rainonsnow !rain water on snow event [mm]
7363 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezmelt !freezing of melt water[mm]
7364 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezstate !freezing of state_id [mm]
7365 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezstatevol !surface state_id [mm]
7366 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_Melt !melt heat [W m-2]
7367 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_rain !melt heat for rain on snow [W m-2]
7368 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: Tsurf_ind !snow-free surface temperature [degC]
7369 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !surface fraction ratio [-]
7370 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPackLimit !Limit for the snow water equivalent when snow cover starts to be patchy [mm]
7371 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: StateLimit !Limit for state_id of each surface type [mm] (specified in input files)
7372 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: AddWater !addition water from other surfaces [mm]
7373 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: addwaterrunoff !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
7374 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
7375 REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: SnowProf_24hr !Hourly profile values used in snow clearing [-]
7376
7377 ! Total water transported to each grid for grid-to-grid connectivity
7378 ! REAL(KIND(1D0)), INTENT(in) :: runoff_per_interval_in
7379 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_id_in ! wetness status of each surface type from previous timestep [mm]
7380 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_id_in !soil moisture of each surface type from previous timestep[mm]
7381 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_in ! snowpack from previous timestep[mm]
7382 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac_in ! snow fraction from previous timestep[-]
7383 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowWater_in ! snow water from previous timestep[mm]
7384 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: iceFrac_in ! ice fraction from previous timestep [-]
7385 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowDens_in ! snow density from previous timestep[kg m-3]
7386
7387 ! output:
7388 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: state_id_out ! wetness status of each surface type at next timestep [mm]
7389 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstore_id_out !soil moisture of each surface type at next timestep[mm]
7390 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowPack_out ! snowpack at next timestep[mm]
7391 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowFrac_out ! snow fraction at next timestep[-]
7392 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowWater_out ! snow water at nexts timestep[mm]
7393 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: iceFrac_out ! ice fraction at next timestep [-]
7394 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowDens_out ! snow density at next timestep[kg m-3]
7395
7396 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: runoffSnow_surf !Initialize for runoff caused by snowmelting
7397 REAL(KIND(1D0)), DIMENSION(nsurf) :: runoff_surf ! runoff for each surface [-]
7398 REAL(KIND(1D0)), DIMENSION(nsurf) :: chang !Change in state_id [mm]
7399 REAL(KIND(1D0)), DIMENSION(nsurf) :: ChangSnow_surf !change in SnowPack (mm)
7400 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: snowDepth
7401 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowToSurf !the water flowing into snow free area [mm]
7402 REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_snow !Evaporation of now [mm]
7403 REAL(KIND(1D0)), DIMENSION(2), INTENT(out) :: SnowRemoval !snow removal [mm]
7404 REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_surf !evaporation of each surface type [mm]
7405 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: rss_surf !redefined surface resistance for wet surfaces [s m-1]
7406
7407 ! REAL(KIND(1D0)) :: p_mm !Inputs to surface water balance
7408 ! REAL(KIND(1d0)),INTENT(out)::rss
7409 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_surf ! net all-wave radiation of individual surface [W m-2]
7410 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qs_surf ! heat storage flux of individual surface [W m-2]
7411 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe_surf ! latent heat flux of individual surface [W m-2]
7412 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_roof ! latent heat flux of roof [W m-2]
7413 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_wall ! latent heat flux of wall [W m-2]
7414 REAL(KIND(1D0)), INTENT(out) :: state_per_tstep !state_id at each timestep [mm]
7415 REAL(KIND(1D0)), INTENT(out) :: NWstate_per_tstep ! state_id at each tinestep(excluding water body) [mm]
7416 REAL(KIND(1D0)), INTENT(out) :: qe !latent heat flux [W m-2]
7417 REAL(KIND(1D0)), INTENT(out) :: swe !overall snow water equavalent[mm]
7418 REAL(KIND(1D0)), INTENT(out) :: chSnow_per_tstep ! change state_id of snow and surface per time interval [mm]
7419 REAL(KIND(1D0)), INTENT(out) :: ev_per_tstep ! evaporation at each time step [mm]
7420 REAL(KIND(1D0)) :: qe_per_tstep !latent heat flux at each timestep[W m-2]
7421 REAL(KIND(1D0)), INTENT(out) :: runoff_per_tstep !runoff water at each time step [mm]
7422 REAL(KIND(1D0)), INTENT(out) :: surf_chang_per_tstep !change in state_id (exluding snowpack) per timestep [mm]
7423 REAL(KIND(1D0)), INTENT(out) :: runoffPipes !runoff to pipes [mm]
7424 REAL(KIND(1D0)), INTENT(out) :: mwstore !overall met water [mm]
7425 REAL(KIND(1D0)), INTENT(out) :: runoffwaterbody !Above ground runoff from water surface for all surface area [mm]
7426 ! REAL(KIND(1D0)) :: runoffWaterBody_m3
7427 ! REAL(KIND(1D0)) :: runoffPipes_m3
7428 REAL(KIND(1D0)), INTENT(out) :: runoffAGveg !Above ground runoff from vegetated surfaces for all surface area [mm]
7429 REAL(KIND(1D0)), INTENT(out) :: runoffAGimpervious !Above ground runoff from impervious surface for all surface area [mm]
7430
7431 ! local:
7432 INTEGER :: is ! surface type [-]
7433
7434 ! REAL(KIND(1D0)) :: runoff_per_interval
7435 REAL(KIND(1D0)), DIMENSION(nsurf) :: state_id_surf ! wetness status of each surface type [mm]
7436 REAL(KIND(1D0)), DIMENSION(nsurf) :: soilstore_id !soil moisture of each surface type[mm]
7437 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowPack ! snowpack [mm]
7438 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac !snow fraction [-]
7439 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowWater ! water in snow [mm]
7440 REAL(KIND(1D0)), DIMENSION(nsurf) :: iceFrac !ice fraction [-]
7441 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDens !snow density [kg m-3]
7442 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn_e_surf !net available energy for evaporation for each surfaces [W m-2]
7443
7444 REAL(KIND(1D0)), DIMENSION(2) :: SurplusEvap !surface evaporation in 5 min timestep [mm]
7445 REAL(KIND(1D0)) :: surplusWaterBody !Extra runoff that goes to water body [mm] as specified by RunoffToWater
7446 REAL(KIND(1D0)) :: pin !Rain per time interval [mm]
7447 ! REAL(KIND(1d0))::sae
7448 ! REAL(KIND(1d0))::vdrc
7449 ! REAL(KIND(1d0))::sp
7450 ! REAL(KIND(1d0))::numPM
7451 REAL(KIND(1D0)) :: qn_e !net available energy for evaporation [W m-2]
7452 REAL(KIND(1D0)) :: tlv !Latent heat of vapourisation per timestep [J kg-1 s-1]
7453 ! REAL(KIND(1D0)) :: runoffAGimpervious_m3
7454 ! REAL(KIND(1D0)) :: runoffAGveg_m3
7455 REAL(KIND(1D0)) :: nsh_real !timestep in a hour [-]
7456 ! REAL(KIND(1D0)) :: tstep_real
7457 REAL(KIND(1D0)) :: ev_tot !total evaporation for all surfaces [mm]
7458 REAL(KIND(1D0)) :: qe_tot ! total latent heat flux for all surfaces [W m-2]
7459 REAL(KIND(1D0)) :: surf_chang_tot !total change in state_id(excluding snowpack) for all surfaces [mm]
7460 REAL(KIND(1D0)) :: runoff_tot !total runoff for all surfaces [mm]
7461 REAL(KIND(1D0)) :: chSnow_tot !total change state_id of snow and surface [mm]
7462
7463 REAL(KIND(1D0)), DIMENSION(7) :: capStore_surf ! current storage capacity [mm]
7464
7465 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_freezState
7466 REAL(KIND(1D0)) :: mwh
7467 REAL(KIND(1D0)) :: fwh
7468 REAL(KIND(1D0)) :: Qm
7469 REAL(KIND(1D0)) :: QmFreez
7470 REAL(KIND(1D0)) :: QmRain
7471 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDepth
7472
7473 REAL(KIND(1D0)), INTENT(in) :: RadMeltFact
7474 REAL(KIND(1D0)), INTENT(in) :: TempMeltFact
7475 REAL(KIND(1D0)), INTENT(in) :: SnowAlbMax
7476 REAL(KIND(1D0)), INTENT(in) :: PrecipLimit
7477 REAL(KIND(1D0)), INTENT(in) :: PrecipLimitAlb
7478
7479 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_ind_snow
7480 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: kup_ind_snow
7481 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: deltaQi
7482 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: Tsurf_ind_snow
7483
7484 REAL(KIND(1D0)), INTENT(in) :: SnowfallCum_in
7485 REAL(KIND(1D0)), INTENT(out) :: SnowfallCum_out
7486 REAL(KIND(1D0)) :: SnowfallCum
7487
7488 REAL(KIND(1D0)), INTENT(in) :: SnowAlb_in
7489 REAL(KIND(1D0)), INTENT(out) :: SnowAlb_out
7490 REAL(KIND(1D0)) :: SnowAlb
7491 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5), INTENT(out) :: dataOutLineSnow
7492
7493 ! runoff_per_interval = runoff_per_interval_in
7494 state_id_surf = state_id_in
7495 soilstore_id = soilstore_id_in
7496
7497 ! tstep_real = tstep*1.D0
7498 nsh_real = 3600/tstep*1.d0
7499
7500 capstore_surf = 0 !initialise capStore
7501
7502 tlv = lv_j_kg/tstep*1.d0 !Latent heat of vapourisation per timestep
7503
7504 pin = max(0., precip) !Initiate rain data [mm]
7505
7506 ! Initialize the output variables
7507 qe_surf = 0
7508
7509 ev_per_tstep = 0
7510 qe_per_tstep = 0
7511 surf_chang_per_tstep = 0
7512 runoff_per_tstep = 0
7513 state_per_tstep = 0
7514 nwstate_per_tstep = 0
7515 chsnow_per_tstep = 0
7516 qe = 0
7517
7518 runoffagveg = 0
7519 runoffagimpervious = 0
7520 surpluswaterbody = 0
7521 runoff_surf = 0
7522 chang = 0
7523 surplusevap = 0
7524
7525 ! force these facets to be totally dry
7526 ! TODO: need to consider their hydrologic dynamics
7527 qe_roof = 0
7528 qe_wall = 0
7529
7530 ! net available energy for evaporation
7531 qn_e_surf = qn_surf + qf - qs_surf ! qn1 changed to qn1_snowfree, lj in May 2013
7532
7533 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_snow...'
7534 ! IF (SnowUse == 1) THEN ! snow calculation
7535 ! net available energy for evaporation
7536 qn_e = qn_snowfree + qf - qs ! qn1 changed to qn1_snowfree, lj in May 2013
7537
7538 snowpack = snowpack_in
7539 snowfrac = snowfrac_in
7540 snowwater = snowwater_in
7541 icefrac = icefrac_in
7542 snowdens = snowdens_in
7543 snowfallcum = snowfallcum_in
7544 snowalb = snowalb_in
7545
7546 ! update snow density
7547 snowdens = update_snow_dens( &
7548 tstep, snowfrac, snowdens, &
7549 tau_r, snowdensmax, snowdensmin)
7550
7551 ! Calculate snow-related energy budgets
7552 CALL meltheat( &
7553 lvs_j_kg, lv_j_kg, tstep*1d0, radmeltfact, tempmeltfact, & !input
7554 snowalbmax, snowdensmin, temp_c, precip, preciplimit, preciplimitalb, &
7555 nsh_real, sfr_surf, tsurf_ind, state_id_in, qn_ind_snow, &
7556 snowwater, deltaqi, &
7557 snowpack, snowfrac, snowalb, snowdens, snowfallcum, & !inout
7558 mwh, fwh, qm, qmfreez, qmrain, snowcalcswitch, & !output
7559 qm_melt, qm_freezstate, qm_rain, freezmelt, freezstate, freezstatevol, &
7560 rainonsnow, snowdepth, mw_ind)
7561
7562 DO is = 1, nsurf !For each surface in turn
7563 qe_tot = 0
7564 ev_tot = 0
7565 swe = 0
7566 ev_snow = 0
7567 runoff_tot = 0
7568 surf_chang_tot = 0
7569 chsnow_tot = 0
7570 snowremoval = 0
7571 runoffpipes = 0
7572 mwstore = 0
7573 runoffwaterbody = 0
7574 IF (sfr_surf(is) > 0) THEN
7575 ! IF (Diagnose == 1) WRITE (*, *) 'Calling SnowCalc...'
7576
7577 CALL snowcalc( &
7578 tstep, imin, it, dectime, is, & !input
7579 snowcalcswitch, &
7580 evapmethod, crwmin, crwmax, nsh_real, lvs_j_kg, avdens, &
7581 avrh, press_hpa, temp_c, rasnow, psyc_hpa, avcp, sice_hpa, &
7582 pervfraction, vegfraction, addimpervious, &
7583 vpd_hpa, qn_e, s_hpa, rs, ra, rb, tlv, snowdensmin, snowprof_24hr, precip, &
7584 pipecapacity, runofftowater, &
7585 addveg, snowlimpaved, snowlimbldg, flowchange, drain, &
7586 wetthresh_surf, state_id_in, mw_ind, soilstorecap, rainonsnow, &
7587 freezmelt, freezstate, freezstatevol, &
7588 qm_melt, qm_rain, tsurf_ind, sfr_surf, dayofweek_id, storedrainprm, snowpacklimit, &
7589 addwater, addwaterrunoff, &
7590 soilstore_id, snowpack, surplusevap, & !inout
7591 snowfrac, snowwater, icefrac, snowdens, &
7592 runoffagimpervious, runoffagveg, surpluswaterbody, &
7593 ev_tot, qe_tot, runoff_tot, surf_chang_tot, chsnow_tot, & ! output
7594 rss_surf, &
7595 runoff_surf, chang, changsnow_surf, snowtosurf, state_id_surf, ev_snow, &
7596 snowremoval, swe, &
7597 runoffpipes, mwstore, runoffwaterbody)
7598
7599 ELSE
7600 snowfrac(is) = 0
7601 snowdens(is) = 0
7602 snowpack(is) = 0
7603 END IF
7604 !Actual updates here as xx_tstep variables not taken as input to snowcalc
7605 ev_per_tstep = ev_per_tstep + ev_tot
7606 qe_per_tstep = qe_per_tstep + qe_tot
7607 runoff_per_tstep = runoff_per_tstep + runoff_tot
7608 surf_chang_per_tstep = surf_chang_per_tstep + surf_chang_tot
7609 chsnow_per_tstep = chsnow_per_tstep + chsnow_tot
7610
7611 !Store ev_tot for each surface
7612 ev_surf(is) = ev_tot
7613
7614 END DO
7615
7616 qe = qe_per_tstep
7617
7618 ! Calculate volume of water that will move between grids
7619 ! Volume [m3] = Depth relative to whole area [mm] / 1000 [mm m-1] * SurfaceArea [m2]
7620 ! Need to use these volumes when converting back to addImpervious, AddVeg and AddWater
7621 ! runoffAGimpervious_m3 = runoffAGimpervious/1000*SurfaceArea
7622 ! runoffAGveg_m3 = runoffAGveg/1000*SurfaceArea
7623 ! runoffWaterBody_m3 = runoffWaterBody/1000*SurfaceArea
7624 ! runoffPipes_m3 = runoffPipes/1000*SurfaceArea
7625
7626 state_id_out = state_id_surf
7627 soilstore_id_out = soilstore_id
7628
7629 snowwater_out = snowwater
7630 icefrac_out = icefrac
7631
7632 snowalb_out = snowalb
7633 snowdens_out = snowdens
7634 snowpack_out = snowpack
7635 snowfrac_out = snowfrac
7636 snowfallcum_out = snowfallcum
7637
7638 ! pack output into one line
7639 dataoutlinesnow = [ &
7640 snowpack_out(1:nsurf), mw_ind(1:nsurf), qm_melt(1:nsurf), & !26
7641 qm_rain(1:nsurf), qm_freezstate(1:nsurf), snowfrac_out(1:(nsurf - 1)), & !46
7642 rainonsnow(1:nsurf), & !53
7643 qn_ind_snow(1:nsurf), kup_ind_snow(1:nsurf), freezmelt(1:nsurf), & !74
7644 snowwater(1:nsurf), snowdens_out(1:nsurf), & !88
7645 snowdepth(1:nsurf), tsurf_ind_snow(1:nsurf), &
7646 snowalb_out]
7647

References snow_module::meltheat(), allocatearray::nsurf, snow_module::snowcalc(), and snow_module::update_snow_dens().

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_snow_dts()

subroutine suews_driver::suews_cal_snow_dts ( integer, intent(in) diagnose,
integer, intent(in) nlayer,
integer, intent(in) tstep,
integer, intent(in) imin,
integer, intent(in) it,
integer, intent(in) evapmethod,
integer, dimension(3), intent(in) dayofweek_id,
real(kind(1d0)), intent(in) crwmin,
real(kind(1d0)), intent(in) crwmax,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) lv_j_kg,
real(kind(1d0)), intent(in) lvs_j_kg,
real(kind(1d0)), intent(in) avrh,
real(kind(1d0)), intent(in) press_hpa,
real(kind(1d0)), intent(in) temp_c,
real(kind(1d0)), intent(in) rasnow,
real(kind(1d0)), intent(in) psyc_hpa,
real(kind(1d0)), intent(in) sice_hpa,
real(kind(1d0)), intent(in) tau_r,
real(kind(1d0)), intent(in) radmeltfact,
real(kind(1d0)), intent(in) tempmeltfact,
real(kind(1d0)), intent(in) snowalbmax,
real(kind(1d0)), intent(in) preciplimit,
real(kind(1d0)), intent(in) preciplimitalb,
real(kind(1d0)), dimension(nsurf), intent(in) qn_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(in) kup_ind_snow,
real(kind(1d0)), dimension(nsurf), intent(in) deltaqi,
real(kind(1d0)), dimension(nsurf), intent(in) tsurf_ind_snow,
real(kind(1d0)), intent(in) snowalb_in,
real(kind(1d0)), intent(in) pervfraction,
real(kind(1d0)), intent(in) vegfraction,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) qn_snowfree,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qs,
real(kind(1d0)), intent(in) vpd_hpa,
real(kind(1d0)), intent(in) s_hpa,
real(kind(1d0)), intent(in) rs,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(in) rb,
real(kind(1d0)), intent(in) snowdensmax,
real(kind(1d0)), intent(in) snowdensmin,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) pipecapacity,
real(kind(1d0)), intent(in) runofftowater,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) snowlimpaved,
real(kind(1d0)), intent(in) snowlimbldg,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), dimension(nsurf), intent(in) drain,
real(kind(1d0)), intent(in) wetthresh_paved,
real(kind(1d0)), intent(in) wetthresh_bldg,
real(kind(1d0)), intent(in) wetthresh_evetr,
real(kind(1d0)), intent(in) wetthresh_dectr,
real(kind(1d0)), intent(in) wetthresh_grass,
real(kind(1d0)), intent(in) wetthresh_bsoil,
real(kind(1d0)), intent(in) wetthresh_water,
real(kind(1d0)), intent(in) soilstorecap_paved,
real(kind(1d0)), intent(in) soilstorecap_bldg,
real(kind(1d0)), intent(in) soilstorecap_evetr,
real(kind(1d0)), intent(in) soilstorecap_dectr,
real(kind(1d0)), intent(in) soilstorecap_grass,
real(kind(1d0)), intent(in) soilstorecap_bsoil,
real(kind(1d0)), intent(in) soilstorecap_water,
real(kind(1d0)), dimension(nsurf), intent(in) tsurf_ind,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), dimension(nsurf), intent(in) addwater,
real(kind(1d0)), dimension(nsurf), intent(in) addwaterrunoff,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), dimension(nsurf), intent(in) snowpacklimit,
real(kind(1d0)), dimension(0:23), intent(in) snowprof_24hr_working,
real(kind(1d0)), dimension(0:23), intent(in) snowprof_24hr_holiday,
real(kind(1d0)), dimension(nsurf), intent(in) snowpack_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowfrac_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowwater_in,
real(kind(1d0)), dimension(nsurf), intent(in) icefrac_in,
real(kind(1d0)), dimension(nsurf), intent(in) snowdens_in,
real(kind(1d0)), intent(in) snowfallcum_in,
real(kind(1d0)), dimension(nsurf), intent(in) state_id_in,
real(kind(1d0)), dimension(nsurf), intent(in) soilstore_id_in,
real(kind(1d0)), dimension(nsurf), intent(in) qn_surf,
real(kind(1d0)), dimension(nsurf), intent(in) qs_surf,
real(kind(1d0)), dimension(2), intent(out) snowremoval,
real(kind(1d0)), dimension(nsurf), intent(out) snowpack_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowfrac_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowwater_out,
real(kind(1d0)), dimension(nsurf), intent(out) icefrac_out,
real(kind(1d0)), dimension(nsurf), intent(out) snowdens_out,
real(kind(1d0)), intent(out) snowfallcum_out,
real(kind(1d0)), dimension(nsurf), intent(out) state_id_out,
real(kind(1d0)), dimension(nsurf), intent(out) soilstore_id_out,
real(kind(1d0)), intent(out) state_per_tstep,
real(kind(1d0)), intent(out) nwstate_per_tstep,
real(kind(1d0)), intent(out) qe,
real(kind(1d0)), dimension(nsurf), intent(out) qe_surf,
real(kind(1d0)), dimension(nlayer), intent(out) qe_roof,
real(kind(1d0)), dimension(nlayer), intent(out) qe_wall,
real(kind(1d0)), intent(out) snowalb_out,
real(kind(1d0)), intent(out) swe,
real(kind(1d0)), intent(out) chsnow_per_tstep,
real(kind(1d0)), intent(out) ev_per_tstep,
real(kind(1d0)), intent(out) runoff_per_tstep,
real(kind(1d0)), intent(out) surf_chang_per_tstep,
real(kind(1d0)), intent(out) runoffpipes,
real(kind(1d0)), intent(out) mwstore,
real(kind(1d0)), intent(out) runoffwaterbody,
real(kind(1d0)), intent(out) runoffagveg,
real(kind(1d0)), intent(out) runoffagimpervious,
real(kind(1d0)), dimension(nsurf), intent(out) rss_surf,
real(kind(1d0)), dimension(ncolumnsdataoutsnow - 5), intent(out) dataoutlinesnow )

Definition at line 7650 of file suews_ctrl_driver.f95.

7683
7684 IMPLICIT NONE
7685
7686 INTEGER, INTENT(in) :: Diagnose
7687 INTEGER, INTENT(in) :: nlayer !number of vertical levels in urban canopy [-]
7688 INTEGER, INTENT(in) :: tstep !timestep [s]
7689 INTEGER, INTENT(in) :: imin ! minutes [min]
7690 INTEGER, INTENT(in) :: it ! hour [H]
7691 INTEGER, INTENT(in) :: EvapMethod !Evaporation calculated according to Rutter (1) or Shuttleworth (2)
7692
7693 INTEGER, DIMENSION(nsurf) :: snowCalcSwitch
7694 INTEGER, DIMENSION(3), INTENT(in) :: dayofWeek_id ! 1 - day of week; 2 - month; 3 - season
7695
7696 REAL(KIND(1D0)), INTENT(in) :: CRWmin !minimum water holding capacity of snow [mm]
7697 REAL(KIND(1D0)), INTENT(in) :: CRWmax !maximum water holding capacity of snow [mm]
7698 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
7699 REAL(KIND(1D0)), INTENT(in) :: lvS_J_kg !latent heat of sublimation [J kg-1]
7700 REAL(KIND(1D0)), INTENT(in) :: lv_j_kg !Latent heat of vapourisation per timestep [J kg-1]
7701 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
7702 REAL(KIND(1D0)), INTENT(in) :: avRh !relative humidity [-]
7703 REAL(KIND(1D0)), INTENT(in) :: Press_hPa !air pressure [hPa]
7704 REAL(KIND(1D0)), INTENT(in) :: Temp_C !air temperature [degC]
7705 REAL(KIND(1D0)), INTENT(in) :: RAsnow !aerodynamic resistance of snow [s m-1]
7706 REAL(KIND(1D0)), INTENT(in) :: psyc_hPa !psychometric constant [hPa]
7707 REAL(KIND(1D0)), INTENT(in) :: avcp !air heat capacity [J kg-1 K-1]
7708 REAL(KIND(1D0)), INTENT(in) :: sIce_hPa !satured curve on snow [hPa]
7709 REAL(KIND(1D0)), INTENT(in) :: PervFraction !sum of surface cover fractions for impervious surfaces [-]
7710 REAL(KIND(1D0)), INTENT(in) :: vegfraction ! fraction of vegetation [-]
7711 REAL(KIND(1D0)), INTENT(in) :: addimpervious !Water from impervious surfaces of other grids for whole surface area [mm]
7712 REAL(KIND(1D0)), INTENT(in) :: qn_snowfree ! net all-wave radiation for snow-free surface [W m-2]
7713 REAL(KIND(1D0)), INTENT(in) :: qf !anthropogenic heat flux [W m-2]
7714 REAL(KIND(1D0)), INTENT(in) :: qs !heat storage flux [W m-2]
7715 REAL(KIND(1D0)), INTENT(in) :: vpd_hPa ! vapour pressure deficit [hPa]
7716 REAL(KIND(1D0)), INTENT(in) :: s_hPa !vapour pressure versus temperature slope [hPa K-1]
7717 REAL(KIND(1D0)), INTENT(in) :: RS !surface resistance [s m-1]
7718 REAL(KIND(1D0)), INTENT(in) :: RA !aerodynamic resistance [s m-1]
7719 REAL(KIND(1D0)), INTENT(in) :: RB !boundary layer resistance [s m-1]
7720 REAL(KIND(1D0)), INTENT(in) :: SnowDensMax !Fresh snow density [kg m-3]
7721 REAL(KIND(1D0)), INTENT(in) :: SnowDensMin !Fresh snow density [kg m-3]
7722 REAL(KIND(1D0)), INTENT(in) :: precip !rain data [mm]
7723 REAL(KIND(1D0)), INTENT(in) :: PipeCapacity !Capacity of pipes to transfer water [mm]
7724 REAL(KIND(1D0)), INTENT(in) :: RunoffToWater !Fraction of surface runoff going to water body [-]
7725 ! REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction
7726 ! REAL(KIND(1d0)), INTENT(in)::wu_EveTr!Water use for evergreen trees/shrubs [mm]
7727 ! REAL(KIND(1d0)), INTENT(in)::wu_DecTr!Water use for deciduous trees/shrubs [mm]
7728 ! REAL(KIND(1d0)), INTENT(in)::wu_Grass!Water use for grass [mm]
7729 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
7730 ! REAL(KIND(1D0)), INTENT(in) :: addWaterBody !Water from water surface of other grids [mm] for whole surface area
7731 REAL(KIND(1D0)), INTENT(in) :: SnowLimPaved !snow limit for paved [mm]
7732 REAL(KIND(1D0)), INTENT(in) :: SnowLimBldg !snow limit for building [mm]
7733 ! REAL(KIND(1D0)), INTENT(in) :: SurfaceArea
7734 REAL(KIND(1D0)), INTENT(in) :: FlowChange !Difference between the input and output flow in the water body [mm]
7735
7736 REAL(KIND(1D0)), INTENT(in) :: tau_r !time constant for snow density ageing [-]
7737
7738 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: WU_nsurf
7739 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: drain !water flowing intyo drainage [mm]
7740
7741 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_paved
7742 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_bldg
7743 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_evetr
7744 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_dectr
7745 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_grass
7746 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_bsoil
7747 REAL(KIND(1D0)), INTENT(IN) :: WetThresh_water
7748 REAL(KIND(1D0)), DIMENSION(nsurf) :: WetThresh_surf !surface wetness threshold [mm], When State > WetThresh, RS=0 limit in SUEWS_evap [mm]
7749
7750 REAL(KIND(1D0)), DIMENSION(nsurf) :: mw_ind !melt water from sknowpack[mm]
7751
7752 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_paved
7753 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bldg
7754 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_evetr
7755 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_dectr
7756 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_grass
7757 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_bsoil
7758 REAL(KIND(1D0)), INTENT(in) :: SoilStoreCap_water
7759 REAL(KIND(1D0)), DIMENSION(nsurf) :: SoilStoreCap !Capacity of soil store for each surface [mm]
7760
7761 REAL(KIND(1D0)), DIMENSION(nsurf) :: rainonsnow !rain water on snow event [mm]
7762 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezmelt !freezing of melt water[mm]
7763 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezstate !freezing of state_id [mm]
7764 REAL(KIND(1D0)), DIMENSION(nsurf) :: freezstatevol !surface state_id [mm]
7765 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_Melt !melt heat [W m-2]
7766 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_rain !melt heat for rain on snow [W m-2]
7767 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: Tsurf_ind !snow-free surface temperature [degC]
7768
7769 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
7770 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
7771 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
7772 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
7773 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
7774 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
7775 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
7776 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
7777
7778 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPackLimit !Limit for the snow water equivalent when snow cover starts to be patchy [mm]
7779 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: StateLimit !Limit for state_id of each surface type [mm] (specified in input files)
7780 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: AddWater !addition water from other surfaces [mm]
7781 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: addwaterrunoff !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
7782 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm !Coefficients used in drainage calculation [-]
7783
7784 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: SnowProf_24hr_working
7785 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(in) :: SnowProf_24hr_holiday
7786 REAL(KIND(1D0)), DIMENSION(0:23, 2) :: SnowProf_24hr !Hourly profile values used in snow clearing [-]
7787
7788 ! Total water transported to each grid for grid-to-grid connectivity
7789 ! REAL(KIND(1D0)), INTENT(in) :: runoff_per_interval_in
7790 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_id_in ! wetness status of each surface type from previous timestep [mm]
7791 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_id_in !soil moisture of each surface type from previous timestep[mm]
7792 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowPack_in ! snowpack from previous timestep[mm]
7793 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowFrac_in ! snow fraction from previous timestep[-]
7794 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowWater_in ! snow water from previous timestep[mm]
7795 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: iceFrac_in ! ice fraction from previous timestep [-]
7796 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: SnowDens_in ! snow density from previous timestep[kg m-3]
7797
7798 ! output:
7799 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: state_id_out ! wetness status of each surface type at next timestep [mm]
7800 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstore_id_out !soil moisture of each surface type at next timestep[mm]
7801 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowPack_out ! snowpack at next timestep[mm]
7802 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowFrac_out ! snow fraction at next timestep[-]
7803 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowWater_out ! snow water at nexts timestep[mm]
7804 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: iceFrac_out ! ice fraction at next timestep [-]
7805 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: SnowDens_out ! snow density at next timestep[kg m-3]
7806
7807 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: runoffSnow_surf !Initialize for runoff caused by snowmelting
7808 REAL(KIND(1D0)), DIMENSION(nsurf) :: runoff_surf ! runoff for each surface [-]
7809 REAL(KIND(1D0)), DIMENSION(nsurf) :: chang !Change in state_id [mm]
7810 REAL(KIND(1D0)), DIMENSION(nsurf) :: ChangSnow_surf !change in SnowPack (mm)
7811 ! REAL(KIND(1D0)), DIMENSION(nsurf) :: snowDepth
7812 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowToSurf !the water flowing into snow free area [mm]
7813 REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_snow !Evaporation of now [mm]
7814 REAL(KIND(1D0)), DIMENSION(2), INTENT(out) :: SnowRemoval !snow removal [mm]
7815 REAL(KIND(1D0)), DIMENSION(nsurf) :: ev_surf !evaporation of each surface type [mm]
7816 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: rss_surf !redefined surface resistance for wet surfaces [s m-1]
7817
7818 ! REAL(KIND(1D0)) :: p_mm !Inputs to surface water balance
7819 ! REAL(KIND(1d0)),INTENT(out)::rss
7820 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_surf ! net all-wave radiation of individual surface [W m-2]
7821 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qs_surf ! heat storage flux of individual surface [W m-2]
7822 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: qe_surf ! latent heat flux of individual surface [W m-2]
7823 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_roof ! latent heat flux of roof [W m-2]
7824 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(out) :: qe_wall ! latent heat flux of wall [W m-2]
7825 REAL(KIND(1D0)), INTENT(out) :: state_per_tstep !state_id at each timestep [mm]
7826 REAL(KIND(1D0)), INTENT(out) :: NWstate_per_tstep ! state_id at each tinestep(excluding water body) [mm]
7827 REAL(KIND(1D0)), INTENT(out) :: qe !latent heat flux [W m-2]
7828 REAL(KIND(1D0)), INTENT(out) :: swe !overall snow water equavalent[mm]
7829 REAL(KIND(1D0)), INTENT(out) :: chSnow_per_tstep ! change state_id of snow and surface per time interval [mm]
7830 REAL(KIND(1D0)), INTENT(out) :: ev_per_tstep ! evaporation at each time step [mm]
7831 REAL(KIND(1D0)) :: qe_per_tstep !latent heat flux at each timestep[W m-2]
7832 REAL(KIND(1D0)), INTENT(out) :: runoff_per_tstep !runoff water at each time step [mm]
7833 REAL(KIND(1D0)), INTENT(out) :: surf_chang_per_tstep !change in state_id (exluding snowpack) per timestep [mm]
7834 REAL(KIND(1D0)), INTENT(out) :: runoffPipes !runoff to pipes [mm]
7835 REAL(KIND(1D0)), INTENT(out) :: mwstore !overall met water [mm]
7836 REAL(KIND(1D0)), INTENT(out) :: runoffwaterbody !Above ground runoff from water surface for all surface area [mm]
7837 ! REAL(KIND(1D0)) :: runoffWaterBody_m3
7838 ! REAL(KIND(1D0)) :: runoffPipes_m3
7839 REAL(KIND(1D0)), INTENT(out) :: runoffAGveg !Above ground runoff from vegetated surfaces for all surface area [mm]
7840 REAL(KIND(1D0)), INTENT(out) :: runoffAGimpervious !Above ground runoff from impervious surface for all surface area [mm]
7841
7842 ! local:
7843 INTEGER :: is ! surface type [-]
7844
7845 ! REAL(KIND(1D0)) :: runoff_per_interval
7846 REAL(KIND(1D0)), DIMENSION(nsurf) :: state_id_surf ! wetness status of each surface type [mm]
7847 REAL(KIND(1D0)), DIMENSION(nsurf) :: soilstore_id !soil moisture of each surface type[mm]
7848 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowPack ! snowpack [mm]
7849 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowFrac !snow fraction [-]
7850 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowWater ! water in snow [mm]
7851 REAL(KIND(1D0)), DIMENSION(nsurf) :: iceFrac !ice fraction [-]
7852 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDens !snow density [kg m-3]
7853 REAL(KIND(1D0)), DIMENSION(nsurf) :: qn_e_surf !net available energy for evaporation for each surfaces [W m-2]
7854
7855 REAL(KIND(1D0)), DIMENSION(2) :: SurplusEvap !surface evaporation in 5 min timestep [mm]
7856 REAL(KIND(1D0)) :: surplusWaterBody !Extra runoff that goes to water body [mm] as specified by RunoffToWater
7857 REAL(KIND(1D0)) :: pin !Rain per time interval [mm]
7858 ! REAL(KIND(1d0))::sae
7859 ! REAL(KIND(1d0))::vdrc
7860 ! REAL(KIND(1d0))::sp
7861 ! REAL(KIND(1d0))::numPM
7862 REAL(KIND(1D0)) :: qn_e !net available energy for evaporation [W m-2]
7863 REAL(KIND(1D0)) :: tlv !Latent heat of vapourisation per timestep [J kg-1 s-1]
7864 ! REAL(KIND(1D0)) :: runoffAGimpervious_m3
7865 ! REAL(KIND(1D0)) :: runoffAGveg_m3
7866 REAL(KIND(1D0)) :: nsh_real !timestep in a hour [-]
7867 ! REAL(KIND(1D0)) :: tstep_real
7868 REAL(KIND(1D0)) :: ev_tot !total evaporation for all surfaces [mm]
7869 REAL(KIND(1D0)) :: qe_tot ! total latent heat flux for all surfaces [W m-2]
7870 REAL(KIND(1D0)) :: surf_chang_tot !total change in state_id(excluding snowpack) for all surfaces [mm]
7871 REAL(KIND(1D0)) :: runoff_tot !total runoff for all surfaces [mm]
7872 REAL(KIND(1D0)) :: chSnow_tot !total change state_id of snow and surface [mm]
7873
7874 REAL(KIND(1D0)), DIMENSION(7) :: capStore_surf ! current storage capacity [mm]
7875
7876 REAL(KIND(1D0)), DIMENSION(nsurf) :: Qm_freezState
7877 REAL(KIND(1D0)) :: mwh
7878 REAL(KIND(1D0)) :: fwh
7879 REAL(KIND(1D0)) :: Qm
7880 REAL(KIND(1D0)) :: QmFreez
7881 REAL(KIND(1D0)) :: QmRain
7882 REAL(KIND(1D0)), DIMENSION(nsurf) :: SnowDepth
7883
7884 REAL(KIND(1D0)), INTENT(in) :: RadMeltFact
7885 REAL(KIND(1D0)), INTENT(in) :: TempMeltFact
7886 REAL(KIND(1D0)), INTENT(in) :: SnowAlbMax
7887 REAL(KIND(1D0)), INTENT(in) :: PrecipLimit
7888 REAL(KIND(1D0)), INTENT(in) :: PrecipLimitAlb
7889
7890 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: qn_ind_snow
7891 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: kup_ind_snow
7892 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: deltaQi
7893 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: Tsurf_ind_snow
7894
7895 REAL(KIND(1D0)), INTENT(in) :: SnowfallCum_in
7896 REAL(KIND(1D0)), INTENT(out) :: SnowfallCum_out
7897 REAL(KIND(1D0)) :: SnowfallCum
7898
7899 REAL(KIND(1D0)), INTENT(in) :: SnowAlb_in
7900 REAL(KIND(1D0)), INTENT(out) :: SnowAlb_out
7901 REAL(KIND(1D0)) :: SnowAlb
7902 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5), INTENT(out) :: dataOutLineSnow
7903
7904 wetthresh_surf = [wetthresh_paved, wetthresh_bldg, wetthresh_evetr, wetthresh_dectr, &
7905 wetthresh_grass, wetthresh_bsoil, wetthresh_water]
7906 soilstorecap = [soilstorecap_paved, soilstorecap_bldg, soilstorecap_evetr, soilstorecap_dectr, &
7907 soilstorecap_grass, soilstorecap_bsoil, soilstorecap_water]
7908 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
7909 snowprof_24hr(:, 1) = snowprof_24hr_working
7910 snowprof_24hr(:, 2) = snowprof_24hr_holiday
7911
7912 ! runoff_per_interval = runoff_per_interval_in
7913 state_id_surf = state_id_in
7914 soilstore_id = soilstore_id_in
7915
7916 ! tstep_real = tstep*1.D0
7917 nsh_real = 3600/tstep*1.d0
7918
7919 capstore_surf = 0 !initialise capStore
7920
7921 tlv = lv_j_kg/tstep*1.d0 !Latent heat of vapourisation per timestep
7922
7923 pin = max(0., precip) !Initiate rain data [mm]
7924
7925 ! Initialize the output variables
7926 qe_surf = 0
7927
7928 ev_per_tstep = 0
7929 qe_per_tstep = 0
7930 surf_chang_per_tstep = 0
7931 runoff_per_tstep = 0
7932 state_per_tstep = 0
7933 nwstate_per_tstep = 0
7934 chsnow_per_tstep = 0
7935 qe = 0
7936
7937 runoffagveg = 0
7938 runoffagimpervious = 0
7939 surpluswaterbody = 0
7940 runoff_surf = 0
7941 chang = 0
7942 surplusevap = 0
7943
7944 ! force these facets to be totally dry
7945 ! TODO: need to consider their hydrologic dynamics
7946 qe_roof = 0
7947 qe_wall = 0
7948
7949 ! net available energy for evaporation
7950 qn_e_surf = qn_surf + qf - qs_surf ! qn1 changed to qn1_snowfree, lj in May 2013
7951
7952 IF (diagnose == 1) WRITE (*, *) 'Calling SUEWS_cal_snow...'
7953 ! IF (SnowUse == 1) THEN ! snow calculation
7954 ! net available energy for evaporation
7955 qn_e = qn_snowfree + qf - qs ! qn1 changed to qn1_snowfree, lj in May 2013
7956
7957 snowpack = snowpack_in
7958 snowfrac = snowfrac_in
7959 snowwater = snowwater_in
7960 icefrac = icefrac_in
7961 snowdens = snowdens_in
7962 snowfallcum = snowfallcum_in
7963 snowalb = snowalb_in
7964
7965 ! update snow density
7966 snowdens = update_snow_dens( &
7967 tstep, snowfrac, snowdens, &
7968 tau_r, snowdensmax, snowdensmin)
7969
7970 ! Calculate snow-related energy budgets
7971 CALL meltheat( &
7972 lvs_j_kg, lv_j_kg, tstep*1d0, radmeltfact, tempmeltfact, & !input
7973 snowalbmax, snowdensmin, temp_c, precip, preciplimit, preciplimitalb, &
7974 nsh_real, sfr_surf, tsurf_ind, state_id_in, qn_ind_snow, &
7975 snowwater, deltaqi, &
7976 snowpack, snowfrac, snowalb, snowdens, snowfallcum, & !inout
7977 mwh, fwh, qm, qmfreez, qmrain, snowcalcswitch, & !output
7978 qm_melt, qm_freezstate, qm_rain, freezmelt, freezstate, freezstatevol, &
7979 rainonsnow, snowdepth, mw_ind)
7980
7981 DO is = 1, nsurf !For each surface in turn
7982 qe_tot = 0
7983 ev_tot = 0
7984 swe = 0
7985 ev_snow = 0
7986 runoff_tot = 0
7987 surf_chang_tot = 0
7988 chsnow_tot = 0
7989 snowremoval = 0
7990 runoffpipes = 0
7991 mwstore = 0
7992 runoffwaterbody = 0
7993 IF (sfr_surf(is) > 0) THEN
7994 ! IF (Diagnose == 1) WRITE (*, *) 'Calling SnowCalc...'
7995
7996 CALL snowcalc( &
7997 tstep, imin, it, dectime, is, & !input
7998 snowcalcswitch, &
7999 evapmethod, crwmin, crwmax, nsh_real, lvs_j_kg, avdens, &
8000 avrh, press_hpa, temp_c, rasnow, psyc_hpa, avcp, sice_hpa, &
8001 pervfraction, vegfraction, addimpervious, &
8002 vpd_hpa, qn_e, s_hpa, rs, ra, rb, tlv, snowdensmin, snowprof_24hr, precip, &
8003 pipecapacity, runofftowater, &
8004 addveg, snowlimpaved, snowlimbldg, flowchange, drain, &
8005 wetthresh_surf, state_id_in, mw_ind, soilstorecap, rainonsnow, &
8006 freezmelt, freezstate, freezstatevol, &
8007 qm_melt, qm_rain, tsurf_ind, sfr_surf, dayofweek_id, storedrainprm, snowpacklimit, &
8008 addwater, addwaterrunoff, &
8009 soilstore_id, snowpack, surplusevap, & !inout
8010 snowfrac, snowwater, icefrac, snowdens, &
8011 runoffagimpervious, runoffagveg, surpluswaterbody, &
8012 ev_tot, qe_tot, runoff_tot, surf_chang_tot, chsnow_tot, & ! output
8013 rss_surf, &
8014 runoff_surf, chang, changsnow_surf, snowtosurf, state_id_surf, ev_snow, &
8015 snowremoval, swe, &
8016 runoffpipes, mwstore, runoffwaterbody)
8017
8018 ELSE
8019 snowfrac(is) = 0
8020 snowdens(is) = 0
8021 snowpack(is) = 0
8022 END IF
8023 !Actual updates here as xx_tstep variables not taken as input to snowcalc
8024 ev_per_tstep = ev_per_tstep + ev_tot
8025 qe_per_tstep = qe_per_tstep + qe_tot
8026 runoff_per_tstep = runoff_per_tstep + runoff_tot
8027 surf_chang_per_tstep = surf_chang_per_tstep + surf_chang_tot
8028 chsnow_per_tstep = chsnow_per_tstep + chsnow_tot
8029
8030 !Store ev_tot for each surface
8031 ev_surf(is) = ev_tot
8032
8033 END DO
8034
8035 qe = qe_per_tstep
8036
8037 ! Calculate volume of water that will move between grids
8038 ! Volume [m3] = Depth relative to whole area [mm] / 1000 [mm m-1] * SurfaceArea [m2]
8039 ! Need to use these volumes when converting back to addImpervious, AddVeg and AddWater
8040 ! runoffAGimpervious_m3 = runoffAGimpervious/1000*SurfaceArea
8041 ! runoffAGveg_m3 = runoffAGveg/1000*SurfaceArea
8042 ! runoffWaterBody_m3 = runoffWaterBody/1000*SurfaceArea
8043 ! runoffPipes_m3 = runoffPipes/1000*SurfaceArea
8044
8045 state_id_out = state_id_surf
8046 soilstore_id_out = soilstore_id
8047
8048 snowwater_out = snowwater
8049 icefrac_out = icefrac
8050
8051 snowalb_out = snowalb
8052 snowdens_out = snowdens
8053 snowpack_out = snowpack
8054 snowfrac_out = snowfrac
8055 snowfallcum_out = snowfallcum
8056
8057 ! pack output into one line
8058 dataoutlinesnow = [ &
8059 snowpack_out(1:nsurf), mw_ind(1:nsurf), qm_melt(1:nsurf), & !26
8060 qm_rain(1:nsurf), qm_freezstate(1:nsurf), snowfrac_out(1:(nsurf - 1)), & !46
8061 rainonsnow(1:nsurf), & !53
8062 qn_ind_snow(1:nsurf), kup_ind_snow(1:nsurf), freezmelt(1:nsurf), & !74
8063 snowwater(1:nsurf), snowdens_out(1:nsurf), & !88
8064 snowdepth(1:nsurf), tsurf_ind_snow(1:nsurf), &
8065 snowalb_out]
8066

References snow_module::meltheat(), allocatearray::nsurf, snow_module::snowcalc(), and snow_module::update_snow_dens().

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_sunposition()

subroutine suews_driver::suews_cal_sunposition ( real(kind(1d0)), intent(in) year,
real(kind(1d0)), intent(in) idectime,
real(kind(1d0)), intent(in) utc,
real(kind(1d0)), intent(in) locationlatitude,
real(kind(1d0)), intent(in) locationlongitude,
real(kind(1d0)), intent(in) locationaltitude,
real(kind(1d0)), intent(out) sunazimuth,
real(kind(1d0)), intent(out) sunzenith )

Definition at line 10926 of file suews_ctrl_driver.f95.

10929 IMPLICIT NONE
10930
10931 REAL(KIND(1D0)), INTENT(in) :: year, idectime, UTC, &
10932 locationlatitude, locationlongitude, locationaltitude
10933 REAL(KIND(1D0)), INTENT(out) :: sunazimuth, sunzenith
10934
10935 CALL narp_cal_sunposition( &
10936 year, idectime, utc, locationlatitude, locationlongitude, locationaltitude, &
10937 sunazimuth, sunzenith)
10938

◆ suews_cal_surf()

subroutine suews_driver::suews_cal_surf ( integer, intent(in) storageheatmethod,
integer, intent(in) netradiationmethod,
integer, intent(in) nlayer,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), intent(out) vegfraction,
real(kind(1d0)), intent(out) impervfraction,
real(kind(1d0)), intent(out) pervfraction,
real(kind(1d0)), intent(out) nonwaterfraction,
real(kind(1d0)), dimension(nlayer), intent(out) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(out) sfr_wall )

Definition at line 9743 of file suews_ctrl_driver.f95.

9749 IMPLICIT NONE
9750
9751 INTEGER, INTENT(IN) :: StorageHeatMethod ! method for storage heat calculations [-]
9752 INTEGER, INTENT(IN) :: NetRadiationMethod ! method for net radiation calculations [-]
9753 INTEGER, INTENT(IN) :: nlayer !number of vertical layers[-]
9754 REAL(KIND(1D0)), DIMENSION(NSURF), INTENT(IN) :: sfr_surf !surface fraction [-]
9755 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac !cumulative surface fraction of buildings across vertical layers [-]
9756 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale !building scales of each vertical layer [m]
9757 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height !building height of each layer[-]
9758 REAL(KIND(1D0)), INTENT(OUT) :: VegFraction ! fraction of vegetation [-]
9759 REAL(KIND(1D0)), INTENT(OUT) :: ImpervFraction !fractioin of impervious surface [-]
9760 REAL(KIND(1D0)), INTENT(OUT) :: PervFraction !fraction of pervious surfaces [-]
9761 REAL(KIND(1D0)), INTENT(OUT) :: NonWaterFraction !fraction of non-water [-]
9762 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(OUT) :: sfr_roof !fraction of roof facets [-]
9763 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(OUT) :: sfr_wall !fraction of wall facets [-]
9764
9765 ! REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_roof ! individual building fraction at each layer
9766 REAL(KIND(1D0)), DIMENSION(nlayer) :: dz_ind ! individual net building height at each layer
9767 ! REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_wall ! individual net building height at each layer
9768 REAL(KIND(1D0)), DIMENSION(nlayer) :: perimeter_ind ! individual building perimeter at each layer
9769
9770 vegfraction = sfr_surf(conifsurf) + sfr_surf(decidsurf) + sfr_surf(grasssurf)
9771 impervfraction = sfr_surf(pavsurf) + sfr_surf(bldgsurf)
9772 pervfraction = 1 - impervfraction
9773 nonwaterfraction = 1 - sfr_surf(watersurf)
9774
9775 IF (storageheatmethod == 5 .OR. netradiationmethod > 1000) THEN
9776 ! get individual building fractions of each layer
9777 ! NB.: sum(sfr_roof) = building_frac(1)
9778 sfr_roof = 0.
9779 IF (nlayer > 1) sfr_roof(1:nlayer - 1) = building_frac(1:nlayer - 1) - building_frac(2:nlayer)
9780 sfr_roof(nlayer) = building_frac(nlayer)
9781
9782 ! get individual net building height of each layer
9783 dz_ind = 0.
9784 dz_ind(1:nlayer) = height(2:nlayer + 1) - height(1:nlayer)
9785
9786 ! get individual building perimeter of each layer
9787 ! this is from eq. 8 in SS documentation:
9788 ! https://github.com/ecmwf/spartacus-surface/blob/master/doc/spartacus_surface_documentation.pdf
9789 perimeter_ind = 0.
9790 perimeter_ind(1:nlayer) = 4.*building_frac(1:nlayer)/building_scale(1:nlayer)
9791
9792 ! sfr_wall stands for individual wall area
9793 ! get individual wall area at each layer
9794 sfr_wall = 0.
9795 ! this is from eq. 1 in SS documentation:
9796 ! https://github.com/ecmwf/spartacus-surface/blob/master/doc/spartacus_surface_documentation.pdf
9797 sfr_wall(1:nlayer) = perimeter_ind(1:nlayer)*dz_ind(1:nlayer)
9798 END IF
9799

References allocatearray::bldgsurf, allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, allocatearray::pavsurf, and allocatearray::watersurf.

Referenced by suews_cal_main().

Here is the caller graph for this function:

◆ suews_cal_surf_dts()

subroutine suews_driver::suews_cal_surf_dts ( integer, intent(in) storageheatmethod,
integer, intent(in) netradiationmethod,
integer, intent(in) nlayer,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), dimension(nlayer), intent(in) building_frac,
real(kind(1d0)), dimension(nlayer), intent(in) building_scale,
real(kind(1d0)), dimension(nlayer + 1), intent(in) height,
real(kind(1d0)), intent(out) vegfraction,
real(kind(1d0)), intent(out) impervfraction,
real(kind(1d0)), intent(out) pervfraction,
real(kind(1d0)), intent(out) nonwaterfraction,
real(kind(1d0)), dimension(nlayer), intent(out) sfr_roof,
real(kind(1d0)), dimension(nlayer), intent(out) sfr_wall )

Definition at line 9802 of file suews_ctrl_driver.f95.

9809 IMPLICIT NONE
9810
9811 INTEGER, INTENT(IN) :: StorageHeatMethod ! method for storage heat calculations [-]
9812 INTEGER, INTENT(IN) :: NetRadiationMethod ! method for net radiation calculations [-]
9813 INTEGER, INTENT(IN) :: nlayer !number of vertical layers[-]
9814
9815 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
9816 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
9817 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
9818 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
9819 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
9820 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
9821 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
9822 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
9823
9824 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_frac !cumulative surface fraction of buildings across vertical layers [-]
9825 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(IN) :: building_scale !building scales of each vertical layer [m]
9826 REAL(KIND(1D0)), DIMENSION(nlayer + 1), INTENT(IN) :: height !building height of each layer[-]
9827 REAL(KIND(1D0)), INTENT(OUT) :: VegFraction ! fraction of vegetation [-]
9828 REAL(KIND(1D0)), INTENT(OUT) :: ImpervFraction !fractioin of impervious surface [-]
9829 REAL(KIND(1D0)), INTENT(OUT) :: PervFraction !fraction of pervious surfaces [-]
9830 REAL(KIND(1D0)), INTENT(OUT) :: NonWaterFraction !fraction of non-water [-]
9831 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(OUT) :: sfr_roof !fraction of roof facets [-]
9832 REAL(KIND(1D0)), DIMENSION(nlayer), INTENT(OUT) :: sfr_wall !fraction of wall facets [-]
9833
9834 ! REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_roof ! individual building fraction at each layer
9835 REAL(KIND(1D0)), DIMENSION(nlayer) :: dz_ind ! individual net building height at each layer
9836 ! REAL(KIND(1D0)), DIMENSION(nlayer) :: sfr_wall ! individual net building height at each layer
9837 REAL(KIND(1D0)), DIMENSION(nlayer) :: perimeter_ind ! individual building perimeter at each layer
9838
9839 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
9840
9841 vegfraction = sfr_surf(conifsurf) + sfr_surf(decidsurf) + sfr_surf(grasssurf)
9842 impervfraction = sfr_surf(pavsurf) + sfr_surf(bldgsurf)
9843 pervfraction = 1 - impervfraction
9844 nonwaterfraction = 1 - sfr_surf(watersurf)
9845
9846 IF (storageheatmethod == 5 .OR. netradiationmethod > 1000) THEN
9847 ! get individual building fractions of each layer
9848 ! NB.: sum(sfr_roof) = building_frac(1)
9849 sfr_roof = 0.
9850 IF (nlayer > 1) sfr_roof(1:nlayer - 1) = building_frac(1:nlayer - 1) - building_frac(2:nlayer)
9851 sfr_roof(nlayer) = building_frac(nlayer)
9852
9853 ! get individual net building height of each layer
9854 dz_ind = 0.
9855 dz_ind(1:nlayer) = height(2:nlayer + 1) - height(1:nlayer)
9856
9857 ! get individual building perimeter of each layer
9858 ! this is from eq. 8 in SS documentation:
9859 ! https://github.com/ecmwf/spartacus-surface/blob/master/doc/spartacus_surface_documentation.pdf
9860 perimeter_ind = 0.
9861 perimeter_ind(1:nlayer) = 4.*building_frac(1:nlayer)/building_scale(1:nlayer)
9862
9863 ! sfr_wall stands for individual wall area
9864 ! get individual wall area at each layer
9865 sfr_wall = 0.
9866 ! this is from eq. 1 in SS documentation:
9867 ! https://github.com/ecmwf/spartacus-surface/blob/master/doc/spartacus_surface_documentation.pdf
9868 sfr_wall(1:nlayer) = perimeter_ind(1:nlayer)*dz_ind(1:nlayer)
9869 END IF
9870

References allocatearray::bldgsurf, allocatearray::conifsurf, allocatearray::decidsurf, allocatearray::grasssurf, allocatearray::pavsurf, and allocatearray::watersurf.

Referenced by suews_cal_main_dts().

Here is the caller graph for this function:

◆ suews_cal_water()

subroutine suews_driver::suews_cal_water ( integer, intent(in) diagnose,
integer, intent(in) snowuse,
real(kind(1d0)), intent(in) nonwaterfraction,
real(kind(1d0)), intent(in) addpipes,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) addwaterbody,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), dimension(nsurf + 1, nsurf - 1), intent(in) waterdist,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(out) drain_per_tstep,
real(kind(1d0)), dimension(nsurf), intent(out) drain,
real(kind(1d0)), dimension(nsurf), intent(out) frac_water2runoff,
real(kind(1d0)), intent(out) additionalwater,
real(kind(1d0)), intent(out) runoffpipes,
real(kind(1d0)), intent(out) runoff_per_interval,
real(kind(1d0)), dimension(nsurf), intent(out) addwater )

Definition at line 6917 of file suews_ctrl_driver.f95.

6925
6926 IMPLICIT NONE
6927 ! INTEGER,PARAMETER :: nsurf=7! number of surface types
6928 ! INTEGER,PARAMETER ::WaterSurf = 7
6929 INTEGER, INTENT(in) :: Diagnose
6930 INTEGER, INTENT(in) :: SnowUse !!Snow part used (1) or not used (0) [-]
6931
6932 REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction !the surface fraction of non-water [-]
6933 REAL(KIND(1D0)), INTENT(in) :: addPipes !additional water in pipes [mm]
6934 REAL(KIND(1D0)), INTENT(in) :: addImpervious !water from impervious surfaces of other grids [mm] for whole surface area
6935 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
6936 REAL(KIND(1D0)), INTENT(in) :: addWaterBody ! water from water body of other grids [mm] for whole surface area
6937 REAL(KIND(1D0)), INTENT(in) :: nsh_real !nsh cast as a real for use in calculations
6938
6939 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_id !wetness states of each surface [mm]
6940 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_id
6941 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: sfr_surf !Surface fractions [-]
6942 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm ! drain storage capacity [mm]
6943 REAL(KIND(1D0)), DIMENSION(nsurf + 1, nsurf - 1), INTENT(in) :: WaterDist !Within-grid water distribution to other surfaces and runoff/soil store [-]
6944
6945 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: drain !drainage of each surface type [mm]
6946 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: frac_water2runoff !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
6947 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: AddWater !water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm]
6948 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: stateOld
6949 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstoreOld
6950
6951 REAL(KIND(1D0)), INTENT(out) :: drain_per_tstep ! total drainage for all surface type at each timestep [mm]
6952 REAL(KIND(1D0)), INTENT(out) :: AdditionalWater !Additional water coming from other grids [mm] (these are expressed as depths over the whole surface)
6953 REAL(KIND(1D0)), INTENT(out) :: runoffPipes !run-off in pipes [mm]
6954 REAL(KIND(1D0)), INTENT(out) :: runoff_per_interval !run-off at each time interval [mm]
6955 INTEGER :: is
6956
6957 ! Retain previous surface state_id and soil moisture state_id
6958 ! stateOld = state_id !state_id of each surface [mm] for the previous timestep
6959 ! soilstoreOld = soilstore_id !Soil moisture of each surface [mm] for the previous timestep
6960
6961 !============= Grid-to-grid runoff =============
6962 ! Calculate additional water coming from other grids
6963 ! i.e. the variables addImpervious, addVeg, addWaterBody, addPipes
6964 !call RunoffFromGrid(GridFromFrac) !!Need to code between-grid water transfer
6965
6966 ! Sum water coming from other grids (these are expressed as depths over the whole surface)
6967 additionalwater = addpipes + addimpervious + addveg + addwaterbody ![mm]
6968
6969 ! Initialise runoff in pipes
6970 runoffpipes = addpipes !Water flowing in pipes from other grids. QUESTION: No need for scaling?
6971 !! CHECK p_i
6972 runoff_per_interval = addpipes !pipe plor added to total runoff.
6973
6974 !================== Drainage ===================
6975 ! Calculate drainage for each soil subsurface (excluding water body)
6976 IF (diagnose == 1) WRITE (*, *) 'Calling Drainage...'
6977
6978 IF (nonwaterfraction /= 0) THEN !Soil states only calculated if soil exists. LJ June 2017
6979 DO is = 1, nsurf - 1
6980
6981 CALL drainage( &
6982 is, & ! input:
6983 state_id(is), &
6984 storedrainprm(6, is), &
6985 storedrainprm(2, is), &
6986 storedrainprm(3, is), &
6987 storedrainprm(4, is), &
6988 nsh_real, &
6989 drain(is)) ! output
6990
6991 ! !HCW added and changed to StoreDrainPrm(6,is) here 20 Feb 2015
6992 ! drain_per_tstep=drain_per_tstep+(drain(is)*sfr_surf(is)/NonWaterFraction) !No water body included
6993 END DO
6994 drain_per_tstep = dot_product(drain(1:nsurf - 1), sfr_surf(1:nsurf - 1))/nonwaterfraction !No water body included
6995 ELSE
6996 drain(1:nsurf - 1) = 0
6997 drain_per_tstep = 0
6998 END IF
6999
7000 drain(watersurf) = 0 ! Set drainage from water body to zero
7001
7002 ! Distribute water within grid, according to WithinGridWaterDist matrix (Cols 1-7)
7003 IF (diagnose == 1) WRITE (*, *) 'Calling ReDistributeWater...'
7004 ! CALL ReDistributeWater
7005 !Calculates AddWater(is)
7006 CALL redistributewater( &
7007 snowuse, waterdist, sfr_surf, drain, & ! input:
7008 frac_water2runoff, addwater) ! output
7009

References waterdist_module::drainage(), allocatearray::nsurf, waterdist_module::redistributewater(), and allocatearray::watersurf.

Referenced by suews_cal_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_cal_water_dts()

subroutine suews_driver::suews_cal_water_dts ( integer, intent(in) diagnose,
integer, intent(in) snowuse,
real(kind(1d0)), intent(in) nonwaterfraction,
real(kind(1d0)), intent(in) addpipes,
real(kind(1d0)), intent(in) addimpervious,
real(kind(1d0)), intent(in) addveg,
real(kind(1d0)), intent(in) addwaterbody,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), intent(in) sfr_paved,
real(kind(1d0)), intent(in) sfr_bldg,
real(kind(1d0)), intent(in) sfr_evetr,
real(kind(1d0)), intent(in) sfr_dectr,
real(kind(1d0)), intent(in) sfr_grass,
real(kind(1d0)), intent(in) sfr_bsoil,
real(kind(1d0)), intent(in) sfr_water,
real(kind(1d0)), dimension(6, nsurf), intent(in) storedrainprm,
real(kind(1d0)), intent(in) waterdist_paved_topaved,
real(kind(1d0)), intent(in) waterdist_paved_tobldg,
real(kind(1d0)), intent(in) waterdist_paved_toevetr,
real(kind(1d0)), intent(in) waterdist_paved_todectr,
real(kind(1d0)), intent(in) waterdist_paved_tograss,
real(kind(1d0)), intent(in) waterdist_paved_tobsoil,
real(kind(1d0)), intent(in) waterdist_paved_towater,
real(kind(1d0)), intent(in) waterdist_paved_tosoilstore,
real(kind(1d0)), intent(in) waterdist_bldg_topaved,
real(kind(1d0)), intent(in) waterdist_bldg_tobldg,
real(kind(1d0)), intent(in) waterdist_bldg_toevetr,
real(kind(1d0)), intent(in) waterdist_bldg_todectr,
real(kind(1d0)), intent(in) waterdist_bldg_tograss,
real(kind(1d0)), intent(in) waterdist_bldg_tobsoil,
real(kind(1d0)), intent(in) waterdist_bldg_towater,
real(kind(1d0)), intent(in) waterdist_bldg_tosoilstore,
real(kind(1d0)), intent(in) waterdist_evetr_topaved,
real(kind(1d0)), intent(in) waterdist_evetr_tobldg,
real(kind(1d0)), intent(in) waterdist_evetr_toevetr,
real(kind(1d0)), intent(in) waterdist_evetr_todectr,
real(kind(1d0)), intent(in) waterdist_evetr_tograss,
real(kind(1d0)), intent(in) waterdist_evetr_tobsoil,
real(kind(1d0)), intent(in) waterdist_evetr_towater,
real(kind(1d0)), intent(in) waterdist_evetr_tosoilstore,
real(kind(1d0)), intent(in) waterdist_dectr_topaved,
real(kind(1d0)), intent(in) waterdist_dectr_tobldg,
real(kind(1d0)), intent(in) waterdist_dectr_toevetr,
real(kind(1d0)), intent(in) waterdist_dectr_todectr,
real(kind(1d0)), intent(in) waterdist_dectr_tograss,
real(kind(1d0)), intent(in) waterdist_dectr_tobsoil,
real(kind(1d0)), intent(in) waterdist_dectr_towater,
real(kind(1d0)), intent(in) waterdist_dectr_tosoilstore,
real(kind(1d0)), intent(in) waterdist_grass_topaved,
real(kind(1d0)), intent(in) waterdist_grass_tobldg,
real(kind(1d0)), intent(in) waterdist_grass_toevetr,
real(kind(1d0)), intent(in) waterdist_grass_todectr,
real(kind(1d0)), intent(in) waterdist_grass_tograss,
real(kind(1d0)), intent(in) waterdist_grass_tobsoil,
real(kind(1d0)), intent(in) waterdist_grass_towater,
real(kind(1d0)), intent(in) waterdist_grass_tosoilstore,
real(kind(1d0)), intent(in) waterdist_bsoil_topaved,
real(kind(1d0)), intent(in) waterdist_bsoil_tobldg,
real(kind(1d0)), intent(in) waterdist_bsoil_toevetr,
real(kind(1d0)), intent(in) waterdist_bsoil_todectr,
real(kind(1d0)), intent(in) waterdist_bsoil_tograss,
real(kind(1d0)), intent(in) waterdist_bsoil_tobsoil,
real(kind(1d0)), intent(in) waterdist_bsoil_towater,
real(kind(1d0)), intent(in) waterdist_bsoil_tosoilstore,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(out) drain_per_tstep,
real(kind(1d0)), dimension(nsurf), intent(out) drain,
real(kind(1d0)), dimension(nsurf), intent(out) frac_water2runoff,
real(kind(1d0)), intent(out) additionalwater,
real(kind(1d0)), intent(out) runoffpipes,
real(kind(1d0)), intent(out) runoff_per_interval,
real(kind(1d0)), dimension(nsurf), intent(out) addwater )

Definition at line 7012 of file suews_ctrl_driver.f95.

7041
7042 IMPLICIT NONE
7043 ! INTEGER,PARAMETER :: nsurf=7! number of surface types
7044 ! INTEGER,PARAMETER ::WaterSurf = 7
7045 INTEGER, INTENT(in) :: Diagnose
7046 INTEGER, INTENT(in) :: SnowUse !!Snow part used (1) or not used (0) [-]
7047
7048 REAL(KIND(1D0)), INTENT(in) :: NonWaterFraction !the surface fraction of non-water [-]
7049 REAL(KIND(1D0)), INTENT(in) :: addPipes !additional water in pipes [mm]
7050 REAL(KIND(1D0)), INTENT(in) :: addImpervious !water from impervious surfaces of other grids [mm] for whole surface area
7051 REAL(KIND(1D0)), INTENT(in) :: addVeg !Water from vegetated surfaces of other grids [mm] for whole surface area
7052 REAL(KIND(1D0)), INTENT(in) :: addWaterBody ! water from water body of other grids [mm] for whole surface area
7053 REAL(KIND(1D0)), INTENT(in) :: nsh_real !nsh cast as a real for use in calculations
7054
7055 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: state_id !wetness states of each surface [mm]
7056 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: soilstore_id
7057
7058 REAL(KIND(1D0)), INTENT(IN) :: sfr_paved
7059 REAL(KIND(1D0)), INTENT(IN) :: sfr_bldg
7060 REAL(KIND(1D0)), INTENT(IN) :: sfr_evetr
7061 REAL(KIND(1D0)), INTENT(IN) :: sfr_dectr
7062 REAL(KIND(1D0)), INTENT(IN) :: sfr_grass
7063 REAL(KIND(1D0)), INTENT(IN) :: sfr_bsoil
7064 REAL(KIND(1D0)), INTENT(IN) :: sfr_water
7065 REAL(KIND(1D0)), DIMENSION(NSURF) :: sfr_surf !surface fraction [-]
7066
7067 REAL(KIND(1D0)), DIMENSION(6, nsurf), INTENT(in) :: StoreDrainPrm ! drain storage capacity [mm]
7068
7069 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toPaved
7070 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toBldg
7071 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toDectr
7072 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toEvetr
7073 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toGrass
7074 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toBSoil
7075 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toWater
7076 REAL(KIND(1D0)), INTENT(in) :: WaterDist_paved_toSoilstore
7077 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toPaved
7078 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toBldg
7079 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toDectr
7080 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toEvetr
7081 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toGrass
7082 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toBSoil
7083 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toWater
7084 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bldg_toSoilstore
7085 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toPaved
7086 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toBldg
7087 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toDectr
7088 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toEvetr
7089 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toGrass
7090 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toBSoil
7091 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toWater
7092 REAL(KIND(1D0)), INTENT(in) :: WaterDist_dectr_toSoilstore
7093 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toPaved
7094 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toBldg
7095 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toDectr
7096 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toEvetr
7097 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toGrass
7098 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toBSoil
7099 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toWater
7100 REAL(KIND(1D0)), INTENT(in) :: WaterDist_evetr_toSoilstore
7101 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toPaved
7102 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toBldg
7103 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toDectr
7104 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toEvetr
7105 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toGrass
7106 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toBSoil
7107 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toWater
7108 REAL(KIND(1D0)), INTENT(in) :: WaterDist_grass_toSoilstore
7109 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toPaved
7110 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toBldg
7111 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toDectr
7112 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toEvetr
7113 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toGrass
7114 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toBSoil
7115 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toWater
7116 REAL(KIND(1D0)), INTENT(in) :: WaterDist_bsoil_toSoilStore
7117 REAL(KIND(1D0)), DIMENSION(nsurf + 1, nsurf - 1) :: WaterDist !Within-grid water distribution to other surfaces and runoff/soil store [-]
7118
7119 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: drain !drainage of each surface type [mm]
7120 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: frac_water2runoff !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
7121 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: AddWater !water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm]
7122 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: stateOld
7123 ! REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(out) :: soilstoreOld
7124
7125 REAL(KIND(1D0)), INTENT(out) :: drain_per_tstep ! total drainage for all surface type at each timestep [mm]
7126 REAL(KIND(1D0)), INTENT(out) :: AdditionalWater !Additional water coming from other grids [mm] (these are expressed as depths over the whole surface)
7127 REAL(KIND(1D0)), INTENT(out) :: runoffPipes !run-off in pipes [mm]
7128 REAL(KIND(1D0)), INTENT(out) :: runoff_per_interval !run-off at each time interval [mm]
7129 INTEGER :: is
7130
7131 additionalwater = 0.0
7132 additionalwater = addpipes + addimpervious + addveg + addwaterbody ![mm]
7133
7134 sfr_surf = [sfr_paved, sfr_bldg, sfr_evetr, sfr_dectr, sfr_grass, sfr_bsoil, sfr_water]
7135 waterdist(1, 1) = waterdist_paved_topaved
7136 waterdist(2, 1) = waterdist_paved_tobldg
7137 waterdist(3, 1) = waterdist_paved_toevetr
7138 waterdist(4, 1) = waterdist_paved_todectr
7139 waterdist(5, 1) = waterdist_paved_tograss
7140 waterdist(6, 1) = waterdist_paved_tobsoil
7141 waterdist(7, 1) = waterdist_paved_towater
7142 waterdist(8, 1) = waterdist_paved_tosoilstore
7143
7144 waterdist(1, 2) = waterdist_bldg_topaved
7145 waterdist(2, 2) = waterdist_bldg_tobldg
7146 waterdist(3, 2) = waterdist_bldg_toevetr
7147 waterdist(4, 2) = waterdist_bldg_todectr
7148 waterdist(5, 2) = waterdist_bldg_tograss
7149 waterdist(6, 2) = waterdist_bldg_tobsoil
7150 waterdist(7, 2) = waterdist_bldg_towater
7151 waterdist(8, 2) = waterdist_bldg_tosoilstore
7152
7153 waterdist(1, 3) = waterdist_evetr_topaved
7154 waterdist(2, 3) = waterdist_evetr_tobldg
7155 waterdist(3, 3) = waterdist_evetr_toevetr
7156 waterdist(4, 3) = waterdist_evetr_todectr
7157 waterdist(5, 3) = waterdist_evetr_tograss
7158 waterdist(6, 3) = waterdist_evetr_tobsoil
7159 waterdist(7, 3) = waterdist_evetr_towater
7160 waterdist(8, 3) = waterdist_evetr_tosoilstore
7161
7162 waterdist(1, 4) = waterdist_dectr_topaved
7163 waterdist(2, 4) = waterdist_dectr_tobldg
7164 waterdist(3, 4) = waterdist_dectr_toevetr
7165 waterdist(4, 4) = waterdist_dectr_todectr
7166 waterdist(5, 4) = waterdist_dectr_tograss
7167 waterdist(6, 4) = waterdist_dectr_tobsoil
7168 waterdist(7, 4) = waterdist_dectr_towater
7169 waterdist(8, 4) = waterdist_dectr_tosoilstore
7170
7171 waterdist(1, 5) = waterdist_grass_topaved
7172 waterdist(2, 5) = waterdist_grass_tobldg
7173 waterdist(3, 5) = waterdist_grass_toevetr
7174 waterdist(4, 5) = waterdist_grass_todectr
7175 waterdist(5, 5) = waterdist_grass_tograss
7176 waterdist(6, 5) = waterdist_grass_tobsoil
7177 waterdist(7, 5) = waterdist_grass_towater
7178 waterdist(8, 5) = waterdist_grass_tosoilstore
7179
7180 waterdist(1, 6) = waterdist_bsoil_topaved
7181 waterdist(2, 6) = waterdist_bsoil_tobldg
7182 waterdist(3, 6) = waterdist_bsoil_toevetr
7183 waterdist(4, 6) = waterdist_bsoil_todectr
7184 waterdist(5, 6) = waterdist_bsoil_tograss
7185 waterdist(6, 6) = waterdist_bsoil_tobsoil
7186 waterdist(7, 6) = waterdist_bsoil_towater
7187 waterdist(8, 6) = waterdist_bsoil_tosoilstore
7188
7189 ! Retain previous surface state_id and soil moisture state_id
7190 ! stateOld = state_id !state_id of each surface [mm] for the previous timestep
7191 ! soilstoreOld = soilstore_id !Soil moisture of each surface [mm] for the previous timestep
7192
7193 !============= Grid-to-grid runoff =============
7194 ! Calculate additional water coming from other grids
7195 ! i.e. the variables addImpervious, addVeg, addWaterBody, addPipes
7196 !call RunoffFromGrid(GridFromFrac) !!Need to code between-grid water transfer
7197
7198 ! Sum water coming from other grids (these are expressed as depths over the whole surface)
7199
7200 ! Initialise runoff in pipes
7201 runoffpipes = addpipes !Water flowing in pipes from other grids. QUESTION: No need for scaling?
7202 !! CHECK p_i
7203 runoff_per_interval = addpipes !pipe plor added to total runoff.
7204
7205 !================== Drainage ===================
7206 ! Calculate drainage for each soil subsurface (excluding water body)
7207 IF (diagnose == 1) WRITE (*, *) 'Calling Drainage...'
7208
7209 IF (nonwaterfraction /= 0) THEN !Soil states only calculated if soil exists. LJ June 2017
7210 DO is = 1, nsurf - 1
7211
7212 CALL drainage( &
7213 is, & ! input:
7214 state_id(is), &
7215 storedrainprm(6, is), &
7216 storedrainprm(2, is), &
7217 storedrainprm(3, is), &
7218 storedrainprm(4, is), &
7219 nsh_real, &
7220 drain(is)) ! output
7221
7222 ! !HCW added and changed to StoreDrainPrm(6,is) here 20 Feb 2015
7223 ! drain_per_tstep=drain_per_tstep+(drain(is)*sfr_surf(is)/NonWaterFraction) !No water body included
7224 END DO
7225 drain_per_tstep = dot_product(drain(1:nsurf - 1), sfr_surf(1:nsurf - 1))/nonwaterfraction !No water body included
7226 ELSE
7227 drain(1:nsurf - 1) = 0
7228 drain_per_tstep = 0
7229 END IF
7230
7231 drain(watersurf) = 0 ! Set drainage from water body to zero
7232
7233 ! Distribute water within grid, according to WithinGridWaterDist matrix (Cols 1-7)
7234 IF (diagnose == 1) WRITE (*, *) 'Calling ReDistributeWater...'
7235 ! CALL ReDistributeWater
7236 !Calculates AddWater(is)
7237 CALL redistributewater( &
7238 snowuse, waterdist, sfr_surf, drain, & ! input:
7239 frac_water2runoff, addwater) ! output
7240

References waterdist_module::drainage(), allocatearray::nsurf, waterdist_module::redistributewater(), and allocatearray::watersurf.

Referenced by suews_cal_main_dts().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_init_qh()

subroutine suews_driver::suews_init_qh ( real(kind(1d0)), intent(in) avdens,
real(kind(1d0)), intent(in) avcp,
real(kind(1d0)), intent(in) h_mod,
real(kind(1d0)), intent(in) qn1,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(out) h_init )

Definition at line 7245 of file suews_ctrl_driver.f95.

7248
7249 IMPLICIT NONE
7250 ! REAL(KIND(1d0)), INTENT(in)::qh_obs
7251 REAL(KIND(1D0)), INTENT(in) :: avdens !air density [kg m-3]
7252 REAL(KIND(1D0)), INTENT(in) :: avcp ! air heat capacity [J kg-1 K-1]
7253 REAL(KIND(1D0)), INTENT(in) :: h_mod !volumetric air heat capacity [J m-3 K-1]
7254 REAL(KIND(1D0)), INTENT(in) :: qn1 !net all-wave radiation [W m-2]
7255 REAL(KIND(1D0)), INTENT(in) :: dectime !local time (days), not daylight savings
7256 REAL(KIND(1D0)), INTENT(out) :: H_init !initial QH [W m-2]
7257
7258 REAL(KIND(1D0)), PARAMETER :: NAN = -999
7259 INTEGER, PARAMETER :: notUsedI = -999
7260
7261 ! Calculate kinematic heat flux (w'T') from sensible heat flux [W m-2] from observed data (if available) or LUMPS
7262 ! IF (qh_obs /= NAN) THEN !if(qh_obs/=NAN) qh=qh_obs !Commented out by HCW 04 Mar 2015
7263 ! H_init = qh_obs/(avdens*avcp) !Use observed value
7264 ! ELSE
7265 IF (h_mod /= nan) THEN
7266 h_init = h_mod/(avdens*avcp) !Use LUMPS value
7267 ELSE
7268 h_init = (qn1*0.2)/(avdens*avcp) !If LUMPS has had a problem, we still need a value
7269 CALL errorhint(38, 'LUMPS unable to calculate realistic value for H_mod.', h_mod, dectime, notusedi)
7270 END IF
7271 ! ENDIF
7272

References errorhint().

Here is the call graph for this function:

◆ suews_update_output()

subroutine suews_driver::suews_update_output ( integer, intent(in) snowuse,
integer, intent(in) storageheatmethod,
integer, intent(in) readlinesmetdata,
integer, intent(in) numberofgrids,
integer, intent(in) ir,
integer, intent(in) gridiv,
real(kind(1d0)), dimension(ncolumnsdataoutsuews), intent(in) dataoutlinesuews,
real(kind(1d0)), dimension(ncolumnsdataoutsnow), intent(in) dataoutlinesnow,
real(kind(1d0)), dimension(ncolumnsdataoutestm), intent(in) dataoutlineestm,
real(kind(1d0)), dimension(ncolumnsdataoutrsl), intent(in) dataoutlinersl,
real(kind(1d0)), dimension(ncolumnsdataoutbeers), intent(in) dataoutlinebeers,
real(kind(1d0)), dimension(ncolumnsdataoutdebug), intent(in) dataoutlinedebug,
real(kind(1d0)), dimension(ncolumnsdataoutspartacus), intent(in) dataoutlinespartacus,
real(kind(1d0)), dimension(ncolumnsdataoutehc), intent(in) dataoutlineehc,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutsuews, numberofgrids), intent(inout) dataoutsuews,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutsnow, numberofgrids), intent(inout) dataoutsnow,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutestm, numberofgrids), intent(inout) dataoutestm,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutrsl, numberofgrids), intent(inout) dataoutrsl,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutbeers, numberofgrids), intent(inout) dataoutbeers,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutdebug, numberofgrids), intent(inout) dataoutdebug,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutspartacus, numberofgrids), intent(inout) dataoutspartacus,
real(kind(1d0)), dimension(readlinesmetdata, ncolumnsdataoutehc, numberofgrids), intent(inout) dataoutehc )

Definition at line 9608 of file suews_ctrl_driver.f95.

9616 IMPLICIT NONE
9617
9618 INTEGER, INTENT(in) :: ReadLinesMetdata
9619 INTEGER, INTENT(in) :: NumberOfGrids
9620 INTEGER, INTENT(in) :: Gridiv
9621 INTEGER, INTENT(in) :: SnowUse
9622 INTEGER, INTENT(in) :: storageheatmethod
9623 INTEGER, INTENT(in) :: ir
9624
9625 ! REAL(KIND(1D0)), DIMENSION(5), INTENT(in) :: datetimeLine
9626 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS), INTENT(in) :: dataOutLineSUEWS
9627 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutESTM), INTENT(in) :: dataOutLineESTM
9628 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutEHC), INTENT(in) :: dataOutLineEHC
9629 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow), INTENT(in) :: dataOutLineSnow
9630 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutRSL), INTENT(in) :: dataoutLineRSL
9631 REAL(KIND(1D0)), DIMENSION(ncolumnsdataOutBEERS), INTENT(in) :: dataOutLineBEERS
9632 REAL(KIND(1D0)), DIMENSION(ncolumnsdataOutDebug), INTENT(in) :: dataOutLineDebug
9633 REAL(KIND(1D0)), DIMENSION(ncolumnsdataOutSPARTACUS), INTENT(in) :: dataOutLineSPARTACUS
9634
9635 REAL(KIND(1D0)), INTENT(inout) :: dataOutSUEWS(ReadLinesMetdata, ncolumnsDataOutSUEWS, NumberOfGrids)
9636 REAL(KIND(1D0)), INTENT(inout) :: dataOutSnow(ReadLinesMetdata, ncolumnsDataOutSnow, NumberOfGrids)
9637 REAL(KIND(1D0)), INTENT(inout) :: dataOutESTM(ReadLinesMetdata, ncolumnsDataOutESTM, NumberOfGrids)
9638 REAL(KIND(1D0)), INTENT(inout) :: dataOutEHC(ReadLinesMetdata, ncolumnsDataOutEHC, NumberOfGrids)
9639 REAL(KIND(1D0)), INTENT(inout) :: dataOutRSL(ReadLinesMetdata, ncolumnsDataOutRSL, NumberOfGrids)
9640 REAL(KIND(1D0)), INTENT(inout) :: dataOutBEERS(ReadLinesMetdata, ncolumnsdataOutBEERS, NumberOfGrids)
9641 REAL(KIND(1D0)), INTENT(inout) :: dataOutDebug(ReadLinesMetdata, ncolumnsDataOutDebug, NumberOfGrids)
9642 REAL(KIND(1D0)), INTENT(inout) :: dataOutSPARTACUS(ReadLinesMetdata, ncolumnsDataOutSPARTACUS, NumberOfGrids)
9643
9644 !====================== update output arrays ==============================
9645 !Define the overall output matrix to be printed out step by step
9646 dataoutsuews(ir, 1:ncolumnsdataoutsuews, gridiv) = [(dataoutlinesuews)]
9647 ! dataOutSUEWS(ir, 1:ncolumnsDataOutSUEWS, Gridiv) = [ set_nan(dataOutLineSUEWS)]
9648 dataoutrsl(ir, 1:ncolumnsdataoutrsl, gridiv) = [(dataoutlinersl)]
9649 dataoutdebug(ir, 1:ncolumnsdataoutdebug, gridiv) = [(dataoutlinedebug)]
9650 dataoutspartacus(ir, 1:ncolumnsdataoutspartacus, gridiv) = [(dataoutlinespartacus)]
9651 ! dataOutRSL(ir, 1:ncolumnsDataOutRSL, Gridiv) = [ set_nan(dataoutLineRSL)]
9652 dataoutbeers(ir, 1:ncolumnsdataoutbeers, gridiv) = [set_nan(dataoutlinebeers)]
9653 ! ! set invalid values to NAN
9654 ! dataOutSUEWS(ir,6:ncolumnsDataOutSUEWS,Gridiv)=set_nan(dataOutSUEWS(ir,6:ncolumnsDataOutSUEWS,Gridiv))
9655
9656 IF (snowuse == 1) THEN
9657 dataoutsnow(ir, 1:ncolumnsdataoutsnow, gridiv) = [set_nan(dataoutlinesnow)]
9658 END IF
9659
9660 IF (storageheatmethod == 4) THEN
9661 dataoutestm(ir, 1:ncolumnsdataoutestm, gridiv) = [set_nan(dataoutlineestm)]
9662 END IF
9663
9664 IF (storageheatmethod == 5) THEN
9665 dataoutehc(ir, 1:ncolumnsdataoutehc, gridiv) = [set_nan(dataoutlineehc)]
9666 END IF
9667
9668 !====================update output arrays end==============================
9669

References set_nan().

Referenced by suews_cal_multitsteps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ suews_update_outputline()

subroutine suews_driver::suews_update_outputline ( real(kind(1d0)), intent(in) additionalwater,
real(kind(1d0)), dimension(nsurf), intent(in) alb,
real(kind(1d0)), intent(in) avkdn,
real(kind(1d0)), intent(in) avu10_ms,
real(kind(1d0)), intent(in) azimuth,
real(kind(1d0)), intent(in) chsnow_per_interval,
real(kind(1d0)), intent(in) dectime,
real(kind(1d0)), intent(in) drain_per_tstep,
real(kind(1d0)), intent(in) e_mod,
real(kind(1d0)), intent(in) ev_per_tstep,
real(kind(1d0)), intent(in) ext_wu,
real(kind(1d0)), intent(in) fc,
real(kind(1d0)), intent(in) fc_build,
real(kind(1d0)), intent(in) fcld,
real(kind(1d0)), intent(in) fc_metab,
real(kind(1d0)), intent(in) fc_photo,
real(kind(1d0)), intent(in) fc_respi,
real(kind(1d0)), intent(in) fc_point,
real(kind(1d0)), intent(in) fc_traff,
real(kind(1d0)), intent(in) flowchange,
real(kind(1d0)), intent(in) h_mod,
integer, intent(in) id,
integer, intent(in) imin,
real(kind(1d0)), intent(in) int_wu,
integer, intent(in) it,
integer, intent(in) iy,
real(kind(1d0)), intent(in) kup,
real(kind(1d0)), dimension(nvegsurf), intent(in) lai_id,
real(kind(1d0)), intent(in) ldown,
real(kind(1d0)), intent(in) l_mod,
real(kind(1d0)), intent(in) lup,
real(kind(1d0)), intent(in) mwh,
real(kind(1d0)), intent(in) mwstore,
real(kind(1d0)), intent(in) nsh_real,
real(kind(1d0)), intent(in) nwstate_per_tstep,
real(kind(1d0)), intent(in) precip,
real(kind(1d0)), intent(in) q2_gkg,
real(kind(1d0)), intent(in) qeout,
real(kind(1d0)), intent(in) qf,
real(kind(1d0)), intent(in) qh,
real(kind(1d0)), intent(in) qh_resist,
real(kind(1d0)), intent(in) qm,
real(kind(1d0)), intent(in) qmfreez,
real(kind(1d0)), intent(in) qmrain,
real(kind(1d0)), intent(in) qn,
real(kind(1d0)), intent(in) qn_snow,
real(kind(1d0)), intent(in) qn_snowfree,
real(kind(1d0)), intent(in) qs,
real(kind(1d0)), intent(in) ra,
real(kind(1d0)), intent(in) resistsurf,
real(kind(1d0)), intent(in) rh2,
real(kind(1d0)), intent(in) runoffagimpervious,
real(kind(1d0)), intent(in) runoffagveg,
real(kind(1d0)), intent(in) runoff_per_tstep,
real(kind(1d0)), intent(in) runoffpipes,
real(kind(1d0)), intent(in) runoffsoil_per_tstep,
real(kind(1d0)), intent(in) runoffwaterbody,
real(kind(1d0)), dimension(nsurf), intent(in) sfr_surf,
real(kind(1d0)), intent(in) smd,
real(kind(1d0)), dimension(nsurf), intent(in) smd_nsurf,
real(kind(1d0)), intent(in) snowalb,
real(kind(1d0)), dimension(2), intent(in) snowremoval,
real(kind(1d0)), dimension(nsurf), intent(in) state_id,
real(kind(1d0)), intent(in) state_per_tstep,
real(kind(1d0)), intent(in) surf_chang_per_tstep,
real(kind(1d0)), intent(in) swe,
real(kind(1d0)), intent(in) t2_c,
real(kind(1d0)), intent(in) tskin_c,
real(kind(1d0)), intent(in) tot_chang_per_tstep,
real(kind(1d0)), intent(in) tsurf,
real(kind(1d0)), intent(in) ustar,
real(kind(1d0)), dimension(nsurf), intent(in) wu_nsurf,
real(kind(1d0)), intent(in) z0m,
real(kind(1d0)), intent(in) zdm,
real(kind(1d0)), intent(in) zenith_deg,
real(kind(1d0)), dimension(5), intent(out) datetimeline,
real(kind(1d0)), dimension(ncolumnsdataoutsuews - 5), intent(out) dataoutlinesuews )

Definition at line 9311 of file suews_ctrl_driver.f95.

9330 IMPLICIT NONE
9331
9332 REAL(KIND(1D0)), PARAMETER :: NAN = -999
9333 INTEGER, INTENT(in) :: iy ! year [YYYY]
9334 INTEGER, INTENT(in) :: id ! day of the year [DOY]
9335 INTEGER, INTENT(in) :: it ! hour [H]
9336 INTEGER, INTENT(in) :: imin ! minutes [M]
9337 REAL(KIND(1D0)), INTENT(in) :: AdditionalWater !Additional water coming from other grids [mm]
9338 REAL(KIND(1D0)), INTENT(in) :: alb(nsurf) !albedo of each surfaces [-]
9339 REAL(KIND(1D0)), INTENT(in) :: avkdn !Average downwelling shortwave radiation [W m-2]
9340 REAL(KIND(1D0)), INTENT(in) :: avU10_ms !average wind speed at 10m [W m-1]
9341 REAL(KIND(1D0)), INTENT(in) :: azimuth !solar azimuth [°]
9342 REAL(KIND(1D0)), INTENT(in) :: chSnow_per_interval ! change state_id of snow and surface per time interval [mm]
9343 REAL(KIND(1D0)), INTENT(in) :: dectime !decimal time [-]
9344 REAL(KIND(1D0)), INTENT(in) :: drain_per_tstep ! total dr ainage at each timestep [mm]
9345 REAL(KIND(1D0)), INTENT(in) :: E_mod
9346 REAL(KIND(1D0)), INTENT(in) :: ev_per_tstep ! evaporation at each time step [mm]
9347 REAL(KIND(1D0)), INTENT(in) :: ext_wu !external water use
9348 REAL(KIND(1D0)), INTENT(in) :: Fc !co2 emission [umol m-2 s-1]
9349 REAL(KIND(1D0)), INTENT(in) :: Fc_build ! co2 emission from building component [umol m-2 s-1]
9350 REAL(KIND(1D0)), INTENT(in) :: Fc_metab ! co2 emission from metabolism component [umol m-2 s-1]
9351 REAL(KIND(1D0)), INTENT(in) :: Fc_photo !co2 flux from photosynthesis [umol m-2 s-1]
9352 REAL(KIND(1D0)), INTENT(in) :: Fc_respi !co2 flux from respiration [umol m-2 s-1]
9353 REAL(KIND(1D0)), INTENT(in) :: Fc_point ! co2 emission from point source [umol m-2 s-1]
9354 REAL(KIND(1D0)), INTENT(in) :: Fc_traff !co2 flux from traffic [umol m-2 s-1]
9355 REAL(KIND(1D0)), INTENT(in) :: fcld !cloud fraction [-]
9356 REAL(KIND(1D0)), INTENT(in) :: FlowChange !Difference between the input and output flow in the water body [mm]
9357 REAL(KIND(1D0)), INTENT(in) :: h_mod !volumetric air heat capacity [J m-3 K-1]
9358 REAL(KIND(1D0)), INTENT(in) :: int_wu !internal water use [mm]
9359 REAL(KIND(1D0)), INTENT(in) :: kup !outgoing shortwave radiation [W m-2]
9360 REAL(KIND(1D0)), INTENT(in) :: l_mod !Obukhov length [m]
9361 REAL(KIND(1D0)), INTENT(in) :: LAI_id(nvegsurf) !leaf area index [m2 m-2]
9362 REAL(KIND(1D0)), INTENT(in) :: ldown !incoming longwave radiation [W m-2]
9363 REAL(KIND(1D0)), INTENT(in) :: lup !outgoing longwave radiation [W m-2]
9364 REAL(KIND(1D0)), INTENT(in) :: mwh !snowmelt [mm]
9365 REAL(KIND(1D0)), INTENT(in) :: MwStore !overall met water [mm]
9366 REAL(KIND(1D0)), INTENT(in) :: nsh_real !timestep in a hour [-]
9367 REAL(KIND(1D0)), INTENT(in) :: NWstate_per_tstep ! state_id at each tinestep(excluding water body) [mm]
9368 REAL(KIND(1D0)), INTENT(in) :: Precip !rain data [mm]
9369 REAL(KIND(1D0)), INTENT(in) :: q2_gkg ! Air specific humidity at 2 m [g kg-1]
9370 REAL(KIND(1D0)), INTENT(in) :: qeOut !latent heat flux [W -2]
9371 REAL(KIND(1D0)), INTENT(in) :: qf !anthropogenic heat flux [W m-2]
9372 REAL(KIND(1D0)), INTENT(in) :: qh !turbulent sensible heat flux [W m-2]
9373 REAL(KIND(1D0)), INTENT(in) :: qh_resist ! resistance-based turbulent sensible heat flux [W m-2]
9374 REAL(KIND(1D0)), INTENT(in) :: Qm !snowmelt-related heat [W m-2]
9375 REAL(KIND(1D0)), INTENT(in) :: QmFreez !heat related to freezing of surface store
9376 REAL(KIND(1D0)), INTENT(in) :: QmRain !melt heat for rain on snow [W m-2]
9377 REAL(KIND(1D0)), INTENT(in) :: qn !net all-wave radiation [W m-2]
9378 REAL(KIND(1D0)), INTENT(in) :: qn_snow !net all-wave radiation on snow surface [W m-2]
9379 REAL(KIND(1D0)), INTENT(in) :: qn_snowfree !net all-wave radiation on snow-free surface [W m-2]
9380 REAL(KIND(1D0)), INTENT(in) :: qs !heat storage flux [W m-2]
9381 REAL(KIND(1D0)), INTENT(in) :: RA !aerodynamic resistance [s m-1]
9382 REAL(KIND(1D0)), INTENT(in) :: resistsurf !surface resistance [s m-1]
9383 REAL(KIND(1D0)), INTENT(in) :: RH2 ! air relative humidity at 2m [-]
9384 REAL(KIND(1D0)), INTENT(in) :: runoff_per_tstep !runoff water at each time step [mm]
9385 REAL(KIND(1D0)), INTENT(in) :: runoffAGimpervious !Above ground runoff from impervious surface for all surface area [mm]
9386 REAL(KIND(1D0)), INTENT(in) :: runoffAGveg !Above ground runoff from vegetated surfaces for all surface area [mm]
9387 REAL(KIND(1D0)), INTENT(in) :: runoffPipes !runoff to pipes [mm]
9388 REAL(KIND(1D0)), INTENT(in) :: runoffSoil_per_tstep !Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
9389 REAL(KIND(1D0)), INTENT(in) :: runoffWaterBody !Above ground runoff from water body for all surface area [mm]
9390 REAL(KIND(1D0)), INTENT(in) :: sfr_surf(nsurf) !surface fraction [-]
9391 REAL(KIND(1D0)), INTENT(in) :: smd !soil moisture deficit [mm]
9392 REAL(KIND(1D0)), INTENT(in) :: smd_nsurf(nsurf) !smd for each surface [mm]
9393 REAL(KIND(1D0)), INTENT(in) :: SnowAlb !snow alebdo [-]
9394 REAL(KIND(1D0)), INTENT(in) :: SnowRemoval(2) !snow removal [mm]
9395 REAL(KIND(1D0)), INTENT(in) :: state_id(nsurf) ! wetness status of each surface type [mm]
9396 REAL(KIND(1D0)), INTENT(in) :: state_per_tstep !state_id at each timestep [mm]
9397 REAL(KIND(1D0)), INTENT(in) :: surf_chang_per_tstep !change in state_id (exluding snowpack) per timestep [mm]
9398 REAL(KIND(1D0)), INTENT(in) :: swe !overall snow water equavalent[mm]
9399 REAL(KIND(1D0)), INTENT(in) :: t2_C !modelled 2 meter air temperature [degC]
9400 REAL(KIND(1D0)), INTENT(in) :: tskin_C ! skin temperature [degC]
9401 REAL(KIND(1D0)), INTENT(in) :: tot_chang_per_tstep !Change in surface state_id [mm]
9402 REAL(KIND(1D0)), INTENT(in) :: tsurf !surface temperatue [degC]
9403 REAL(KIND(1D0)), INTENT(in) :: UStar !friction velocity [m s-1]
9404 REAL(KIND(1D0)), DIMENSION(nsurf), INTENT(in) :: wu_nsurf !water use of each surfaces [mm]
9405
9406 REAL(KIND(1D0)), INTENT(in) :: z0m !Aerodynamic roughness length [m]
9407 REAL(KIND(1D0)), INTENT(in) :: zdm !zero-plane displacement [m]
9408 REAL(KIND(1D0)), INTENT(in) :: zenith_deg !solar zenith angle in degree [°]
9409
9410 REAL(KIND(1D0)), DIMENSION(5), INTENT(OUT) :: datetimeLine !date & time
9411 REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5), INTENT(out) :: dataOutLineSUEWS
9412 ! REAL(KIND(1d0)),DIMENSION(ncolumnsDataOutSnow-5),INTENT(out) :: dataOutLineSnow
9413 ! REAL(KIND(1d0)),DIMENSION(ncolumnsDataOutESTM-5),INTENT(out) :: dataOutLineESTM
9414 ! INTEGER:: is
9415 REAL(KIND(1D0)) :: LAI_wt !area weighted LAI [m2 m-2]
9416 REAL(KIND(1D0)) :: RH2_pct ! RH2 in percentage [-]
9417
9418 ! the variables below with '_x' endings stand for 'exported' values
9419 REAL(KIND(1D0)) :: ResistSurf_x !output surface resistance [s m-1]
9420 REAL(KIND(1D0)) :: surf_chang_per_tstep_x !output change in state_id (exluding snowpack) per timestep [mm]
9421 REAL(KIND(1D0)) :: l_mod_x !output Obukhov length [m]
9422 REAL(KIND(1D0)) :: bulkalbedo !output area-weighted albedo [-]
9423 REAL(KIND(1D0)) :: smd_nsurf_x(nsurf) !output soil moisture deficit for each surface [mm]
9424 REAL(KIND(1D0)) :: state_x(nsurf) !output wetness status of each surfaces[mm]
9425 REAL(KIND(1D0)) :: wu_DecTr !water use for deciduous tree and shrubs [mm]
9426 REAL(KIND(1D0)) :: wu_EveTr !water use of evergreen tree and shrubs [mm]
9427 REAL(KIND(1D0)) :: wu_Grass !water use for grass [mm]
9428
9429 !=====================================================================
9430 !====================== Prepare data for output ======================
9431 ! values outside of reasonable range are set as NAN-like numbers. TS 10 Jun 2018
9432
9433 ! Remove non-existing surface type from surface and soil outputs ! Added back in with NANs by HCW 24 Aug 2016
9434 state_x = unpack(spread(nan, dim=1, ncopies=SIZE(sfr_surf)), mask=(sfr_surf < 0.00001), field=state_id)
9435 smd_nsurf_x = unpack(spread(nan, dim=1, ncopies=SIZE(sfr_surf)), mask=(sfr_surf < 0.00001), field=smd_nsurf)
9436
9437 resistsurf_x = min(9999., resistsurf)
9438
9439 surf_chang_per_tstep_x = merge(surf_chang_per_tstep, 0.d0, abs(surf_chang_per_tstep) > 1e-6)
9440
9441 l_mod_x = max(min(9999., l_mod), -9999.)
9442
9443 ! Calculate areally-weighted LAI
9444 ! IF(iy == (iy_prev_t +1) .AND. (id-1) == 0) THEN !Check for start of next year and avoid using LAI(id-1) as this is at the start of the year
9445 ! LAI_wt=DOT_PRODUCT(LAI(id_prev_t,:),sfr_surf(1+2:nvegsurf+2))
9446 ! ELSE
9447 ! LAI_wt=DOT_PRODUCT(LAI(id-1,:),sfr_surf(1+2:nvegsurf+2))
9448 ! ENDIF
9449
9450 lai_wt = dot_product(lai_id(:), sfr_surf(1 + 2:nvegsurf + 2))
9451
9452 ! Calculate areally-weighted albedo
9453 bulkalbedo = dot_product(alb, sfr_surf)
9454
9455 ! convert RH2 to a percentage form
9456 rh2_pct = rh2*100.0
9457
9458 ! translate water use to vegetated surfaces
9459 wu_dectr = wu_nsurf(3)
9460 wu_evetr = wu_nsurf(4)
9461 wu_grass = wu_nsurf(5)
9462
9463 !====================== update output line ==============================
9464 ! date & time:
9465 datetimeline = [ &
9466 REAL(iy, KIND(1D0)), REAL(id, KIND(1D0)), &
9467 REAL(it, KIND(1D0)), REAL(imin, KIND(1D0)), dectime]
9468 !Define the overall output matrix to be printed out step by step
9469 dataoutlinesuews = [ &
9470 avkdn, kup, ldown, lup, tsurf, &
9471 qn, qf, qs, qh, qeout, &
9472 h_mod, e_mod, qh_resist, &
9473 precip, ext_wu, ev_per_tstep, runoff_per_tstep, tot_chang_per_tstep, &
9474 surf_chang_per_tstep_x, state_per_tstep, nwstate_per_tstep, drain_per_tstep, smd, &
9475 flowchange/nsh_real, additionalwater, &
9476 runoffsoil_per_tstep, runoffpipes, runoffagimpervious, runoffagveg, runoffwaterbody, &
9477 int_wu, wu_evetr, wu_dectr, wu_grass, &
9478 smd_nsurf_x(1:nsurf - 1), &
9479 state_x(1:nsurf), &
9480 zenith_deg, azimuth, bulkalbedo, fcld, &
9481 lai_wt, z0m, zdm, &
9482 ustar, l_mod, ra, resistsurf, &
9483 fc, &
9484 fc_photo, fc_respi, fc_metab, fc_traff, fc_build, fc_point, &
9485 qn_snowfree, qn_snow, snowalb, &
9486 qm, qmfreez, qmrain, swe, mwh, mwstore, chsnow_per_interval, &
9487 snowremoval(1:2), &
9488 tskin_c, t2_c, q2_gkg, avu10_ms, rh2_pct & ! surface-level diagonostics
9489 ]
9490 ! set invalid values to NAN
9491 ! dataOutLineSUEWS = set_nan(dataOutLineSUEWS)
9492
9493 !====================update output line end==============================
9494

Referenced by suews_cal_main(), and suews_cal_main_dts().

Here is the caller graph for this function:

◆ var2add_two()

subroutine suews_driver::var2add_two ( type(config), intent(in) arg_type,
type(config), intent(out) res_type )

Definition at line 636 of file suews_ctrl_driver.f95.

637 TYPE(config), INTENT(in) :: arg_type
638 TYPE(config), INTENT(out) :: res_type
639 res_type%var1 = arg_type%var1 + arg_type%var2
640 res_type%var2 = arg_type%var1 - arg_type%var2
641