SUEWS API Site
Documentation of SUEWS source code
Functions/Subroutines
sumin_module Module Reference

Functions/Subroutines

subroutine sumin (snowUse, EmissionsMethod, NetRadiationMethod, RoughLenHeatMethod, RoughLenMomMethod, StorageHeatMethod, AerodynamicResistanceMethod, LAIType, SnowPackLimit, OHM_threshSW, OHM_threshWD, th, tl, Kmax, g1, g2, g3, g4, g5, g6, s1, s2, LaiPower, CRWmax, CRWmin, PrecipLimit, PrecipLimitAlb, RadMeltFact, SnowAlbMax, SnowAlbMin, SnowDensMax, SnowDensMin, SnowLimBldg, SnowLimPaved, tau_a, tau_f, tau_r, TempMeltFact, OHMIncQF, iy, id, it, imin, isec, dt_since_start, tstep, tstep_prev, startDLS, endDLS, alt, lat, lng, Z, timezone, SurfaceArea, sfr, z0m_in, zdm_in, alb, emis, SnowAlb, OHM_coef, WaterDist, AHProf_24hr, HumActivity_24hr, PopProf_24hr, TraffProf_24hr, WUProfA_24hr, WUProfM_24hr, snowProf_24hr, qn1_av, dqndt, qn1_s_av, dqnsdt, surf_var_id, DecidCap_id, albDecTr_id, albEveTr_id, albGrass_id, NumCapita_id, BaseT_id, BaseTe_id, GDDFull_id, SDDFull_id, LaiMin_id, LaiMax_id, MaxConductance_id, FAIbldg_id, FAIEveTree_id, FAIDecTree_id, bldgH_id, EveTreeH_id, DecTreeH_id, AH_MIN_id, AH_SLOPE_Cooling_id, AH_SLOPE_Heating_id, QF0_BEU_id, Qf_A_id, Qf_B_id, Qf_C_id, T_CRITIC_Cooling_id, T_CRITIC_Heating_id, TrafficRate_id, surf_attr_MinStorCap_id, surf_attr_DrainEquat_id, surf_attr_DrainCoef1_id, surf_attr_DrainCoef2_id, surf_attr_MaxStorCap_id, SoilStoreCap_id, SoilDepth_id, SatHydraulicConduct_id, AlbMin_DecTr_id, AlbMax_DecTr_id, AlbMin_EveTr_id, AlbMax_EveTr_id, AlbMin_Grass_id, AlbMax_Grass_id, CapMin_dec_id, CapMax_dec_id, PorMin_dec_id, PorMax_dec_id, DRAINRT_id, RAINCOVER_id, RAINMAXRES_id, FlowChange_id, PipeCapacity_id, RunoffToWater_id, StateLimit_id, WetThresh_id, BaseT_HC_id, Faut_id, IrrFracConif_id, IrrFracDecid_id, IrrFracGrass_id, DayWat_id, DayWatPer_id, PopDensDaytime_id, PopDensNighttime_id, porosity_id, GDD_id, HDD_id, LAI_id, WUDay_id, soilstore_id, state_id, SnowWater, avkdn, avRh, avU1, Press_hPa, Temp_C, Precip, qn, qf, qs, qh, qe, qsfc, tsk, CHKLOWQ, kdown_o, kup_o, ldown_o, lup_o, tsurf_o, smd_o, glw1d, cldfra1d)
 

Function/Subroutine Documentation

◆ sumin()

subroutine sumin_module::sumin ( integer, intent(in)  snowUse,
integer, intent(in)  EmissionsMethod,
integer, intent(in)  NetRadiationMethod,
integer, intent(in)  RoughLenHeatMethod,
integer, intent(in)  RoughLenMomMethod,
integer, intent(in)  StorageHeatMethod,
integer, intent(in)  AerodynamicResistanceMethod,
integer, dimension(3), intent(in)  LAIType,
real(kind(1d0)), dimension(7 + 1), intent(in)  SnowPackLimit,
real(kind(1d0)), dimension(7 + 1), intent(in)  OHM_threshSW,
real(kind(1d0)), dimension(7 + 1), intent(in)  OHM_threshWD,
real(kind(1d0)), intent(in)  th,
real(kind(1d0)), intent(in)  tl,
real(kind(1d0)), intent(in)  Kmax,
real(kind(1d0)), intent(in)  g1,
real(kind(1d0)), intent(in)  g2,
real(kind(1d0)), intent(in)  g3,
real(kind(1d0)), intent(in)  g4,
real(kind(1d0)), intent(in)  g5,
real(kind(1d0)), intent(in)  g6,
real(kind(1d0)), intent(in)  s1,
real(kind(1d0)), intent(in)  s2,
real(kind(1d0)), dimension(4, 3), intent(in)  LaiPower,
real(kind(1d0)), intent(in)  CRWmax,
real(kind(1d0)), intent(in)  CRWmin,
real(kind(1d0)), intent(in)  PrecipLimit,
real(kind(1d0)), intent(in)  PrecipLimitAlb,
real(kind(1d0)), intent(in)  RadMeltFact,
real(kind(1d0)), intent(in)  SnowAlbMax,
real(kind(1d0)), intent(in)  SnowAlbMin,
real(kind(1d0)), intent(in)  SnowDensMax,
real(kind(1d0)), intent(in)  SnowDensMin,
real(kind(1d0)), intent(in)  SnowLimBldg,
real(kind(1d0)), intent(in)  SnowLimPaved,
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(in)  TempMeltFact,
integer, intent(in)  OHMIncQF,
integer, intent(in)  iy,
integer, intent(in)  id,
integer, intent(in)  it,
integer, intent(in)  imin,
integer, intent(in)  isec,
integer, intent(in)  dt_since_start,
integer, intent(in)  tstep,
integer, intent(in)  tstep_prev,
integer, intent(in)  startDLS,
integer, intent(in)  endDLS,
real(kind(1d0)), intent(in)  alt,
real(kind(1d0)), intent(in)  lat,
real(kind(1d0)), intent(in)  lng,
real(kind(1d0)), intent(in)  Z,
real(kind(1d0)), intent(in)  timezone,
real(kind(1d0)), intent(in)  SurfaceArea,
real(kind(1d0)), dimension(7), intent(in)  sfr,
real(kind(1d0)), intent(in)  z0m_in,
real(kind(1d0)), intent(in)  zdm_in,
real(kind(1d0)), dimension(7), intent(inout)  alb,
real(kind(1d0)), dimension(7), intent(in)  emis,
real(kind(1d0)), intent(inout)  SnowAlb,
real(kind(1d0)), dimension(7 + 1, 4, 3), intent(in)  OHM_coef,
real(kind(1d0)), dimension(7 + 1, 7 - 1), intent(in)  WaterDist,
real(kind(1d0)), dimension(0:23, 2), intent(in)  AHProf_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in)  HumActivity_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in)  PopProf_24hr,
real(kind(1d0)), dimension(0:23, 2), intent(in)  TraffProf_24hr,
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)), dimension(0:23, 2), intent(in)  snowProf_24hr,
real(kind(1d0)), intent(inout)  qn1_av,
real(kind(1d0)), intent(inout)  dqndt,
real(kind(1d0)), intent(inout)  qn1_s_av,
real(kind(1d0)), intent(inout)  dqnsdt,
real(kind(1d0)), dimension(7), intent(inout)  surf_var_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)  NumCapita_id,
real(kind(1d0)), dimension(3), intent(inout)  BaseT_id,
real(kind(1d0)), dimension(3), intent(inout)  BaseTe_id,
real(kind(1d0)), dimension(3), intent(inout)  GDDFull_id,
real(kind(1d0)), dimension(3), intent(inout)  SDDFull_id,
real(kind(1d0)), dimension(3), intent(inout)  LaiMin_id,
real(kind(1d0)), dimension(3), intent(inout)  LaiMax_id,
real(kind(1d0)), dimension(3), intent(inout)  MaxConductance_id,
real(kind(1d0)), intent(inout)  FAIbldg_id,
real(kind(1d0)), intent(inout)  FAIEveTree_id,
real(kind(1d0)), intent(inout)  FAIDecTree_id,
real(kind(1d0)), intent(inout)  bldgH_id,
real(kind(1d0)), intent(inout)  EveTreeH_id,
real(kind(1d0)), intent(inout)  DecTreeH_id,
real(kind(1d0)), dimension(2), intent(inout)  AH_MIN_id,
real(kind(1d0)), dimension(2), intent(inout)  AH_SLOPE_Cooling_id,
real(kind(1d0)), dimension(2), intent(inout)  AH_SLOPE_Heating_id,
real(kind(1d0)), dimension(2), intent(inout)  QF0_BEU_id,
real(kind(1d0)), dimension(2), intent(inout)  Qf_A_id,
real(kind(1d0)), dimension(2), intent(inout)  Qf_B_id,
real(kind(1d0)), dimension(2), intent(inout)  Qf_C_id,
real(kind(1d0)), dimension(2), intent(inout)  T_CRITIC_Cooling_id,
real(kind(1d0)), dimension(2), intent(inout)  T_CRITIC_Heating_id,
real(kind(1d0)), dimension(2), intent(inout)  TrafficRate_id,
real(kind(1d0)), dimension(7), intent(inout)  surf_attr_MinStorCap_id,
real(kind(1d0)), dimension(7), intent(inout)  surf_attr_DrainEquat_id,
real(kind(1d0)), dimension(7), intent(inout)  surf_attr_DrainCoef1_id,
real(kind(1d0)), dimension(7), intent(inout)  surf_attr_DrainCoef2_id,
real(kind(1d0)), dimension(7), intent(inout)  surf_attr_MaxStorCap_id,
real(kind(1d0)), dimension(7), intent(inout)  SoilStoreCap_id,
real(kind(1d0)), dimension(7), intent(inout)  SoilDepth_id,
real(kind(1d0)), dimension(7), intent(inout)  SatHydraulicConduct_id,
real(kind(1d0)), intent(inout)  AlbMin_DecTr_id,
real(kind(1d0)), intent(inout)  AlbMax_DecTr_id,
real(kind(1d0)), intent(inout)  AlbMin_EveTr_id,
real(kind(1d0)), intent(inout)  AlbMax_EveTr_id,
real(kind(1d0)), intent(inout)  AlbMin_Grass_id,
real(kind(1d0)), intent(inout)  AlbMax_Grass_id,
real(kind(1d0)), intent(inout)  CapMin_dec_id,
real(kind(1d0)), intent(inout)  CapMax_dec_id,
real(kind(1d0)), intent(inout)  PorMin_dec_id,
real(kind(1d0)), intent(inout)  PorMax_dec_id,
real(kind(1d0)), intent(inout)  DRAINRT_id,
real(kind(1d0)), intent(inout)  RAINCOVER_id,
real(kind(1d0)), intent(inout)  RAINMAXRES_id,
real(kind(1d0)), intent(inout)  FlowChange_id,
real(kind(1d0)), intent(inout)  PipeCapacity_id,
real(kind(1d0)), intent(inout)  RunoffToWater_id,
real(kind(1d0)), dimension(7), intent(inout)  StateLimit_id,
real(kind(1d0)), dimension(7), intent(inout)  WetThresh_id,
real(kind(1d0)), intent(inout)  BaseT_HC_id,
real(kind(1d0)), intent(inout)  Faut_id,
real(kind(1d0)), intent(inout)  IrrFracConif_id,
real(kind(1d0)), intent(inout)  IrrFracDecid_id,
real(kind(1d0)), intent(inout)  IrrFracGrass_id,
real(kind(1d0)), dimension(7), intent(inout)  DayWat_id,
real(kind(1d0)), dimension(7), intent(inout)  DayWatPer_id,
real(kind(1d0)), intent(inout)  PopDensDaytime_id,
real(kind(1d0)), intent(inout)  PopDensNighttime_id,
real(kind(1d0)), intent(inout)  porosity_id,
real(kind(1d0)), dimension(5), intent(inout)  GDD_id,
real(kind(1d0)), dimension(12), intent(inout)  HDD_id,
real(kind(1d0)), dimension(3), intent(inout)  LAI_id,
real(kind(1d0)), dimension(9), intent(inout)  WUDay_id,
real(kind(1d0)), dimension(7), intent(inout)  soilstore_id,
real(kind(1d0)), dimension(7), intent(inout)  state_id,
real(kind(1d0)), dimension(7), intent(inout)  SnowWater,
real(kind(1d0)), intent(in)  avkdn,
real(kind(1d0)), intent(in)  avRh,
real(kind(1d0)), intent(in)  avU1,
real(kind(1d0)), intent(in)  Press_hPa,
real(kind(1d0)), intent(in)  Temp_C,
real(kind(1d0)), intent(in)  Precip,
real(kind(1d0)), intent(out)  qn,
real(kind(1d0)), intent(out)  qf,
real(kind(1d0)), intent(out)  qs,
real(kind(1d0)), intent(out)  qh,
real(kind(1d0)), intent(out)  qe,
real(kind(1d0)), intent(out)  qsfc,
real(kind(1d0)), intent(out)  tsk,
real(kind(1d0)), intent(out)  CHKLOWQ,
real(kind(1d0)), intent(out)  kdown_o,
real(kind(1d0)), intent(out)  kup_o,
real(kind(1d0)), intent(out)  ldown_o,
real(kind(1d0)), intent(out)  lup_o,
real(kind(1d0)), intent(out)  tsurf_o,
real(kind(1d0)), intent(out)  smd_o,
real(kind(1d0)), intent(in)  glw1d,
real(kind(1d0)), intent(in)  cldfra1d 
)

Definition at line 112 of file suews_ctrl_sumin.f95.

References suews_driver::suews_cal_main().

112 
113  ! model configurations
114  INTEGER, INTENT(in) ::snowuse
115  INTEGER, INTENT(in) ::emissionsmethod
116  INTEGER, INTENT(in) ::netradiationmethod
117  INTEGER, INTENT(IN) ::roughlenheatmethod
118  INTEGER, INTENT(IN) ::roughlenmommethod
119  INTEGER, INTENT(IN) ::storageheatmethod
120  INTEGER, INTENT(IN) ::aerodynamicresistancemethod
121  INTEGER, DIMENSION(3), INTENT(IN) ::laitype
122  REAL(KIND(1D0)), DIMENSION(7 + 1), INTENT(IN) :: snowpacklimit
123  REAL(KIND(1D0)), DIMENSION(7 + 1), INTENT(IN) :: ohm_threshsw
124  REAL(KIND(1D0)), DIMENSION(7 + 1), INTENT(IN) :: ohm_threshwd
125  REAL(KIND(1D0)), INTENT(IN) :: th
126  REAL(KIND(1D0)), INTENT(IN) :: tl
127  REAL(KIND(1D0)), INTENT(IN) :: kmax
128  REAL(KIND(1D0)), INTENT(IN) :: g1
129  REAL(KIND(1D0)), INTENT(IN) :: g2
130  REAL(KIND(1D0)), INTENT(IN) :: g3
131  REAL(KIND(1D0)), INTENT(IN) :: g4
132  REAL(KIND(1D0)), INTENT(IN) :: g5
133  REAL(KIND(1D0)), INTENT(IN) :: g6
134  REAL(KIND(1D0)), INTENT(IN) :: s1
135  REAL(KIND(1D0)), INTENT(IN) :: s2
136  REAL(KIND(1D0)), DIMENSION(4, 3), INTENT(IN) :: laipower
137  REAL(KIND(1D0)), INTENT(IN) :: crwmax
138  REAL(KIND(1D0)), INTENT(IN) :: crwmin
139  REAL(KIND(1D0)), INTENT(IN) :: preciplimit
140  REAL(KIND(1D0)), INTENT(IN) :: preciplimitalb
141  REAL(KIND(1D0)), INTENT(IN) :: radmeltfact
142  REAL(KIND(1D0)), INTENT(IN) :: snowalbmax
143  REAL(KIND(1D0)), INTENT(IN) :: snowalbmin
144  REAL(KIND(1D0)), INTENT(IN) :: snowdensmax
145  REAL(KIND(1D0)), INTENT(IN) :: snowdensmin
146  REAL(KIND(1D0)), INTENT(IN) :: snowlimbldg
147  REAL(KIND(1D0)), INTENT(IN) :: snowlimpaved
148  REAL(KIND(1D0)), INTENT(IN) :: tau_a
149  REAL(KIND(1D0)), INTENT(IN) :: tau_f
150  REAL(KIND(1D0)), INTENT(IN) :: tau_r
151  REAL(KIND(1D0)), INTENT(IN) :: tempmeltfact
152 
153  INTEGER, INTENT(IN) ::ohmincqf !OHM calculation uses Q* only (0) or Q*+QF (1)
154 
155  ! time-related input
156  INTEGER, INTENT(IN) ::iy
157  INTEGER, INTENT(IN) ::id
158  INTEGER, INTENT(IN) ::it
159  INTEGER, INTENT(IN) ::imin
160  INTEGER, INTENT(in) ::isec
161  INTEGER, INTENT(in) ::dt_since_start ! time since simulation starts [s]
162  INTEGER, INTENT(IN) ::tstep
163  INTEGER, INTENT(IN) ::tstep_prev ! tstep size of the previous step
164  INTEGER, INTENT(IN) ::startdls ! start of daylight saving (inclusive)
165  INTEGER, INTENT(IN) ::enddls ! end of daylight saving (inclusive)
166 
167  ! site-specific geographical settings
168  REAL(KIND(1D0)), INTENT(IN) ::alt
169  REAL(KIND(1D0)), INTENT(IN) ::lat
170  REAL(KIND(1D0)), INTENT(IN) ::lng
171  REAL(KIND(1D0)), INTENT(IN) ::z
172  REAL(KIND(1D0)), INTENT(IN) ::timezone
173  REAL(KIND(1D0)), INTENT(IN) ::surfacearea
174  REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) ::sfr
175 
176  ! roughness related settings
177  REAL(KIND(1D0)), INTENT(in) ::z0m_in
178  REAL(KIND(1D0)), INTENT(in) ::zdm_in
179 
180  ! radiation related settings:
181  REAL(KIND(1D0)), DIMENSION(7), INTENT(INOUT) ::alb
182  REAL(KIND(1D0)), DIMENSION(7), INTENT(IN) ::emis
183  REAL(KIND(1D0)), INTENT(INOUT) ::snowalb
184 
185  ! OHM coeffcients
186  REAL(KIND(1D0)), DIMENSION(7 + 1, 4, 3), INTENT(IN) ::ohm_coef
187 
188  ! hydrology related settings
189  REAL(KIND(1D0)), DIMENSION(7 + 1, 7 - 1), INTENT(IN) ::waterdist
190 
191  ! profiles at 24 hours
192  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: ahprof_24hr
193  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: humactivity_24hr
194  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: popprof_24hr
195  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: traffprof_24hr
196  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: wuprofa_24hr
197  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: wuprofm_24hr
198  REAL(KIND(1D0)), DIMENSION(0:23, 2), INTENT(in) :: snowprof_24hr
199  ! daily states, also initial conditions
200 
201  REAL(KIND(1d0)), INTENT(INOUT) ::qn1_av
202  REAL(KIND(1d0)), INTENT(INOUT) ::dqndt
203  REAL(KIND(1d0)), INTENT(INOUT) ::qn1_s_av !qn1_av for snow
204  REAL(KIND(1d0)), INTENT(INOUT) ::dqnsdt !dqndt for snow
205  REAL(KIND(1d0)), INTENT(INOUT) ::decidcap_id
206  REAL(KIND(1d0)), INTENT(INOUT) ::albdectr_id
207  REAL(KIND(1d0)), INTENT(INOUT) ::albevetr_id
208  REAL(KIND(1d0)), INTENT(INOUT) ::albgrass_id
209  REAL(KIND(1d0)), INTENT(INOUT) ::numcapita_id
210 
211  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: baset_id
212  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: basete_id
213  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: gddfull_id
214  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: sddfull_id
215  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: laimin_id
216  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: laimax_id
217  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) :: maxconductance_id
218  REAL(KIND(1d0)), INTENT(INOUT) :: faibldg_id
219  REAL(KIND(1d0)), INTENT(INOUT) :: faievetree_id
220  REAL(KIND(1d0)), INTENT(INOUT) :: faidectree_id
221  REAL(KIND(1d0)), INTENT(INOUT) :: bldgh_id
222  REAL(KIND(1d0)), INTENT(INOUT) :: evetreeh_id
223  REAL(KIND(1d0)), INTENT(INOUT) :: dectreeh_id
224  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: ah_min_id
225  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: ah_slope_cooling_id
226  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: ah_slope_heating_id
227  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: qf0_beu_id
228  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: qf_a_id
229  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: qf_b_id
230  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: qf_c_id
231  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: t_critic_cooling_id
232  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: t_critic_heating_id
233  REAL(KIND(1d0)), DIMENSION(2), INTENT(INOUT) :: trafficrate_id
234  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: surf_attr_minstorcap_id
235  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: surf_attr_drainequat_id
236  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: surf_attr_draincoef1_id
237  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: surf_attr_draincoef2_id
238  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: surf_attr_maxstorcap_id
239 
240  REAL(KIND(1d0)), INTENT(INOUT) ::popdensdaytime_id
241  REAL(KIND(1d0)), INTENT(INOUT) ::popdensnighttime_id
242  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::soilstorecap_id
243  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::soildepth_id
244  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::sathydraulicconduct_id
245  REAL(KIND(1d0)), INTENT(INOUT) ::albmin_dectr_id
246  REAL(KIND(1d0)), INTENT(INOUT) ::albmax_dectr_id
247  REAL(KIND(1d0)), INTENT(INOUT) ::albmin_evetr_id
248  REAL(KIND(1d0)), INTENT(INOUT) ::albmax_evetr_id
249  REAL(KIND(1d0)), INTENT(INOUT) ::albmin_grass_id
250  REAL(KIND(1d0)), INTENT(INOUT) ::albmax_grass_id
251  REAL(KIND(1d0)), INTENT(INOUT) ::capmin_dec_id
252  REAL(KIND(1d0)), INTENT(INOUT) ::capmax_dec_id
253  REAL(KIND(1d0)), INTENT(INOUT) ::pormin_dec_id
254  REAL(KIND(1d0)), INTENT(INOUT) ::pormax_dec_id
255  REAL(KIND(1d0)), INTENT(INOUT) ::drainrt_id
256  REAL(KIND(1d0)), INTENT(INOUT) ::raincover_id
257  REAL(KIND(1d0)), INTENT(INOUT) ::rainmaxres_id
258  REAL(KIND(1d0)), INTENT(INOUT) ::flowchange_id
259  REAL(KIND(1d0)), INTENT(INOUT) ::pipecapacity_id
260  REAL(KIND(1d0)), INTENT(INOUT) ::runofftowater_id
261  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::statelimit_id
262  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::wetthresh_id
263  REAL(KIND(1d0)), INTENT(INOUT) ::baset_hc_id
264  REAL(KIND(1d0)), INTENT(INOUT) ::faut_id
265  REAL(KIND(1d0)), INTENT(INOUT) ::irrfracconif_id
266  REAL(KIND(1d0)), INTENT(INOUT) ::irrfracdecid_id
267  REAL(KIND(1d0)), INTENT(INOUT) ::irrfracgrass_id
268  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: daywat_id
269  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) :: daywatper_id
270  REAL(KIND(1d0)), INTENT(INOUT) ::porosity_id
271  REAL(KIND(1d0)), DIMENSION(5), INTENT(INOUT) ::gdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
272  REAL(KIND(1d0)), DIMENSION(12), INTENT(INOUT) ::hdd_id !Heating/Cooling Degree Days (see SUEWS_DailyState.f95)
273  REAL(KIND(1d0)), DIMENSION(3), INTENT(INOUT) ::lai_id !LAI for each veg surface [m2 m-2]
274  REAL(KIND(1d0)), DIMENSION(9), INTENT(INOUT) ::wuday_id
275  REAL(KIND(1D0)), DIMENSION(7), INTENT(INOUT) ::soilstore_id
276  REAL(KIND(1D0)), DIMENSION(7), INTENT(INOUT) ::state_id
277  REAL(KIND(1d0)), DIMENSION(7), INTENT(INOUT) ::surf_var_id !variable to store the current states
278  REAL(KIND(1D0)), DIMENSION(7), INTENT(INOUT) ::snowwater
279 
280  ! forcing variables
281  REAL(KIND(1D0)), INTENT(IN)::avkdn
282  REAL(KIND(1D0)), INTENT(IN)::glw1d
283  REAL(KIND(1D0)), INTENT(IN)::avrh
284  REAL(KIND(1D0)), INTENT(IN)::avu1
285  REAL(KIND(1D0)), INTENT(IN)::press_hpa
286  REAL(KIND(1D0)), INTENT(IN)::temp_c
287  REAL(KIND(1D0)), INTENT(IN)::precip
288  REAL(KIND(1D0)), INTENT(IN)::cldfra1d
289  ! output for WRF
290  REAL(KIND(1D0)), INTENT(out)::kdown_o
291  REAL(KIND(1D0)), INTENT(out)::kup_o
292  REAL(KIND(1D0)), INTENT(out)::ldown_o
293  REAL(KIND(1D0)), INTENT(out)::lup_o
294  REAL(KIND(1D0)), INTENT(out)::tsurf_o
295  REAL(KIND(1D0)), INTENT(out)::smd_o
296 
297  REAL(KIND(1D0)), INTENT(out)::qn
298  REAL(KIND(1D0)), INTENT(out)::qf
299  REAL(KIND(1D0)), INTENT(out)::qs
300  REAL(KIND(1D0)), INTENT(out)::qh
301  REAL(KIND(1D0)), INTENT(out)::qe
302  REAL(KIND(1D0)), INTENT(out)::qsfc
303  REAL(KIND(1D0)), INTENT(out)::tsk
304  REAL(KIND(1D0)), INTENT(out)::chklowq
305 
306  ! fixed settings in SuMin
307  INTEGER, PARAMETER ::veg_type = 1
308  INTEGER, PARAMETER ::gsmodel = 2
309  INTEGER, PARAMETER ::stabilitymethod = 3
310  INTEGER, PARAMETER ::smdmethod = 0
311  INTEGER, PARAMETER ::diagqn = 0
312  INTEGER, PARAMETER ::diagqs = 0
313  INTEGER, PARAMETER ::diagnose = 0
314  INTEGER, PARAMETER ::evapmethod = 2
315  INTEGER, PARAMETER ::laicalcyes = 1
316  INTEGER, PARAMETER ::waterusemethod = 0
317 
318  REAL(KIND(1D0)), PARAMETER:: lai_obs = 0
319  REAL(KIND(1D0)) :: ldown_obs
320  REAL(KIND(1D0)) ::fcld_obs
321  REAL(KIND(1D0)), PARAMETER:: snowfrac_obs = 0
322  REAL(KIND(1D0)), PARAMETER:: qn1_obs = 0
323  REAL(KIND(1D0)), PARAMETER:: qh_obs = 0
324  REAL(KIND(1D0)), PARAMETER:: qf_obs = 0
325  REAL(KIND(1D0)), PARAMETER:: qs_obs = 0
326 
327  ! local variables not used for WRF coupling
328  INTEGER::gridiv
329  INTEGER::ie_end
330  INTEGER::ie_start
331 #ifdef wrf
332  CHARACTER(len=1024) :: message ! Used to pass through function wrf_debug() by Zhenkun Li, 10/08/2018
333 #endif
334 
335  ! parameters used in SUEWS for now:
336  !REAL(KIND(1d0)), DIMENSION(7), PARAMETER ::SoilStoreCap = [150., 150., 150., 150., 150., 150., 0.] !Capacity of soil store for each surface [mm]
337  !REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::SoilDepth = 350 !Depth of sub-surface soil store for each surface [mm]
338  !REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::SatHydraulicConduct = 5E-4 !Saturated hydraulic conductivity for each soil subsurface [mm s-1]
339 
340  !REAL(KIND(1d0)), PARAMETER:: AlbMin_DecTr = 0.12 !Min albedo for deciduous trees [-]
341  !REAL(KIND(1d0)), PARAMETER:: AlbMax_DecTr = 0.18 !Max albedo for deciduous trees [-]
342  !REAL(KIND(1d0)), PARAMETER:: AlbMin_EveTr = 0.11 !Min albedo for evergreen trees [-]
343  !REAL(KIND(1d0)), PARAMETER:: AlbMax_EveTr = 0.12 !Max albedo for evergreen trees [-]
344  !REAL(KIND(1d0)), PARAMETER:: AlbMin_Grass = 0.18 !Min albedo for grass [-]
345  !REAL(KIND(1d0)), PARAMETER:: AlbMax_Grass = 0.21 !Max albedo for grass [-]
346 
347  !REAL(KIND(1d0)), PARAMETER:: CapMin_dec = 0.3 !Min storage capacity for deciduous trees [mm] (from input information)
348  !REAL(KIND(1d0)), PARAMETER:: CapMax_dec = 0.8 !Max storage capacity for deciduous trees [mm] (from input information)
349  !REAL(KIND(1d0)), PARAMETER:: PorMin_dec = 0.2 !Min porosity for deciduous trees
350  !REAL(KIND(1d0)), PARAMETER:: PorMax_dec = 0.6 !Max porosity for deciduous trees
351 
352  !REAL(KIND(1d0)), PARAMETER:: FAIbldg = 0. !Frontal area fraction of buildings
353  !REAL(KIND(1d0)), PARAMETER:: FAIEveTree = 0. !Frontal area fraction of evergreen trees
354  !REAL(KIND(1d0)), PARAMETER:: FAIDecTree = 0. !Frontal area fraction of deciduous trees
355 
356  !REAL(KIND(1d0)), PARAMETER :: bldgH = 10 !Mean building height
357  !REAL(KIND(1d0)), PARAMETER :: EveTreeH = 10 !Height of evergreen trees
358  !REAL(KIND(1d0)), PARAMETER :: DecTreeH = 10 !Height of deciduous trees
359  !grid base
360  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: BaseT = [5, 5, 5] !Base temperature for growing degree days [degC]
361  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: BaseTe = [11, 11, 11] !Base temperature for senescence degree days [degC]
362  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: GDDFull = [300, 300, 300] !Growing degree days needed for full capacity [degC]
363  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: SDDFull = [-450, -450, -450] !Senescence degree days needed to initiate leaf off [degC]
364  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: LaiMin = [4., 1., 1.6] !Min LAI [m2 m-2]
365  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: LaiMax = [5.1, 5.5, 5.9] !Max LAI [m2 m-2]
366  !REAL(KIND(1d0)), DIMENSION(3), PARAMETER:: MaxConductance = [7.4, 11.7, 30.1] !Max conductance [mm s-1]
367  !namelist
368  ! REAL(KIND(1d0)), DIMENSION(4, 3), PARAMETER:: LaiPower = RESHAPE( & !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
369  ! [[0.03, 0.03, 0.03], &
370  ! [0.0005, 0.0005, 0.0005], &
371  ! [0.03, 0.03, 0.03], &
372  ! [0.0005, 0.0005, 0.0005]], &
373  ! [4, 3], order=[2, 1])
374  !namelist
375  !INTEGER, DIMENSION(3), PARAMETER:: LAIType = 0 !LAI equation to use: original (0) or new (1)
376 
377  !REAL(KIND(1D0)), PARAMETER ::DRAINRT = 0.25 !Drainage rate of the water bucket [mm hr-1]
378  !REAL(KIND(1D0)), PARAMETER ::RAINCOVER = 1
379  !REAL(KIND(1D0)), PARAMETER ::RAINMAXRES = 10 !Maximum water bucket reservoir [mm]
380  !REAL(KIND(1d0)), PARAMETER ::FlowChange = 0 !Difference between the input and output flow in the water body
381  !REAL(KIND(1d0)), PARAMETER ::PipeCapacity = 100 !Capacity of pipes to transfer water
382  !REAL(KIND(1d0)), PARAMETER ::RunoffToWater = 0.1 !Fraction of surface runoff going to water body
383 
384  !REAL(KIND(1d0)), DIMENSION(7), PARAMETER:: StateLimit = [0.48, 0.25, 1.3, 0.8, 1.9, 1.0, 30000.] !Limit for state of each surface type [mm] (specified in input files)
385  !REAL(KIND(1d0)), DIMENSION(7), PARAMETER:: WetThresh = [0.48, 0.25, 1.3, 0.8, 1.9, 1., 0.5] !When State > WetThresh, rs=0 limit in SUEWS_evap [mm] (specified in input files)
386 
387  ! ---- Drainage characteristics ----------------------------------------------------------------
388  ! 1 - min storage capacity [mm]
389  ! 2 - Drainage equation to use
390  ! 3 - Drainage coeff 1 [units depend on choice of eqn]
391  ! 4 - Drainage coeff 2 [units depend on choice of eqn]
392  ! 5 - max storage capacity [mm]
393  !REAL(KIND(1d0)), DIMENSION(5, 7), PARAMETER:: surf_attr = RESHAPE( & ! variable to store the above five properties
394  ! [[0.48, 0.25, 1.3, 0.3, 1.9, 0.8, 0.5], &
395  ! [3., 3., 2., 2., 2., 3., 0.], &
396  ! [10., 10., 0.013, 0.013, 0.013, 10., 0.], &
397  ! [3., 3., 1.71, 1.71, 1.71, 3., 0.], &
398  ! [0.48, 0.25, 1.3, 0.8, 1.9, 0.8, 0.5]], &
399  ! [5, 7], order=[2, 1])
400 
401  !REAL(KIND(1d0)), DIMENSION(1, 7), PARAMETER:: surf_attr_MinStorCap = [ 0.48, 0.25, 1.3, 0.3, 1.9, 0.8, 0.5]
402  !REAL(KIND(1d0)), DIMENSION(1, 7), PARAMETER:: surf_attr_DrainEquat = [3., 3., 2., 2., 2., 3., 0.]
403  !REAL(KIND(1d0)), DIMENSION(1, 7), PARAMETER:: surf_attr_DrainCoef1 = [10., 10., 0.013, 0.013, 0.013, 10., 0.]
404  !REAL(KIND(1d0)), DIMENSION(1, 7), PARAMETER:: surf_attr_DrainCoef2 = [3., 3., 1.71, 1.71, 1.71, 3., 0.]
405  !REAL(KIND(1d0)), DIMENSION(1, 7), PARAMETER:: surf_attr_MaxStorCap = [0.48, 0.25, 1.3, 0.8, 1.9, 0.8, 0.5]
406 
407  !namelist
408  ! these will be assigned locally as data
409  ! use gsModel=2 as in Ward et al. (2016)
410  !REAL(KIND(1d0)), PARAMETER::th = 55 !Maximum temperature limit
411  !REAL(KIND(1d0)), PARAMETER::tl = -10 !Minimum temperature limit
412  !REAL(KIND(1d0)), PARAMETER::Kmax = 1200 !Annual maximum hourly solar radiation
413  !REAL(KIND(1d0)), PARAMETER::g1 = 3.5 !Fitted parameter
414  !REAL(KIND(1d0)), PARAMETER::g2 = 200 !Fitted parameter
415  !REAL(KIND(1d0)), PARAMETER::g3 = 0.13 !Fitted parameter
416  !REAL(KIND(1d0)), PARAMETER::g4 = 0.7 !Fitted parameter
417  !REAL(KIND(1d0)), PARAMETER::g5 = 30 !Fitted parameter
418  !REAL(KIND(1d0)), PARAMETER::g6 = 0.05 !Fitted parameter
419  !REAL(KIND(1d0)), PARAMETER::s1 = 5.56 !Fitted parameter
420  !REAL(KIND(1d0)), PARAMETER::s2 = 0 !surface res. calculations
421  !namelist
422  !REAL(KIND(1d0)), DIMENSION(7 + 1), PARAMETER:: OHM_threshSW = [10, 10, 10, 10, 10, 10, 10, 10] !Arrays for OHM thresholds
423  !REAL(KIND(1d0)), DIMENSION(7 + 1), PARAMETER:: OHM_threshWD = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9] !Arrays for OHM thresholds
424 
425  !REAL(KIND(1d0)), PARAMETER:: BaseT_HC = 18.9 !Base temperature for QF
426  !not used
427  REAL(KIND(1D0)), PARAMETER::xsmd = 0. !Measured soil moisture deficit
428  !Todo
429  REAL(KIND(1D0)), PARAMETER::wu_m3 = 0 !External water use
430  !REAL(KIND(1D0)), PARAMETER::Faut = 0 !Fraction of irrigated area using automatic irrigation
431  REAL(KIND(1D0)), PARAMETER::internalwateruse_h = 0 !Internal water use [mm h-1]
432  !REAL(KIND(1D0)), PARAMETER::IrrFracEveTr = 0 !Fraction of evergreen trees which are irrigated
433  !REAL(KIND(1D0)), PARAMETER::IrrFracDecTr = 0 !Fraction of deciduous trees which are irrigated
434  !REAL(KIND(1D0)), PARAMETER::IrrFracGrass = 0 !Fraction of grass which is irrigated
435  !Todo
436  !REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::DayWat = 0 !Days of watering allowed
437  !REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::DayWatPer = 0 !% of houses following daily water
438  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::ie_a = [-84.535, 9.959, 3.674] !Coefficients for automatic irrigation models
439  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::ie_m = [-25.36, 2.988, 1.102] !Coefficients for manual irrigation models
440 
441  ! local variables
442  REAL(KIND(1D0)), PARAMETER::narp_emis_snow = 0.9 !NARP-specific parameters
443  REAL(KIND(1D0))::narp_trans_site!NARP-specific parameters QUESTION: not used by SUEWS?
444 
445  !REAL(KIND(1D0)), PARAMETER::NumCapita = 0 !Number of people in the study area per hectare [ha-1]
446  !REAL(KIND(1D0)), PARAMETER::PopDensDaytime = 0 ! Daytime population density [ha-1] (i.e. workers)
447  !REAL(KIND(1D0)), PARAMETER::PopDensNighttime = 0 ! Nighttime population density [ha-1] (i.e. residents)
448 
449  ! snow related local variables
450  ! REAL(KIND(1D0)), PARAMETER ::CRWmax = 0.2 !Free water holding capacity of shallow SnowPack
451  ! REAL(KIND(1D0)), PARAMETER ::CRWmin = 0.05 !Free water holding capacity of deep SnowPack
452  ! REAL(KIND(1D0)), PARAMETER ::PrecipLimit = 2.2 !Temperature limit when precipitation occurs as snow
453  ! REAL(KIND(1D0)), PARAMETER ::PrecipLimitAlb = 2 !Precipitation limit for albedo change (in mm)
454  ! REAL(KIND(1D0)), PARAMETER ::RadMeltFact = 0.001 !Radiation melt factor
455  ! REAL(KIND(1D0)), PARAMETER ::SnowAlbMax = 0.8 !Maximum snow albedo
456  ! REAL(KIND(1D0)), PARAMETER ::SnowAlbMin = 0.18 !Minimum snow albedo
457  ! REAL(KIND(1D0)), PARAMETER ::SnowDensMax = 450 !Minimum density of snow
458  ! REAL(KIND(1D0)), PARAMETER ::SnowDensMin = 100 !Maximum density of snow
459  ! REAL(KIND(1D0)), PARAMETER ::SnowLimBldg = 100 !Snow removal limits for roofs in mm)
460  ! REAL(KIND(1D0)), PARAMETER ::SnowLimPaved = 100 !Snow removal limits for paved surfaces in mm)
461  ! REAL(KIND(1D0)), PARAMETER ::tau_a = 0.01 !Time constans related to albedo change
462  ! REAL(KIND(1D0)), PARAMETER ::tau_f = 0.1 !Time constans related to albedo change
463  ! REAL(KIND(1D0)), PARAMETER ::tau_r = 0.02 !Time constans related to albedo change
464  ! REAL(KIND(1D0)), PARAMETER ::TempMeltFact = 0.12 !Temperature melt factor
465  ! REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::SnowPackLimit = 0
466  ! REAL(KIND(1D0)), DIMENSION(0:23, 2), PARAMETER::snowProf_24hr = 0 ! Timing of snow removal (0 or 1) Hourly, WD/WE
467 
468  !grid level
469  ! Anthropogenic heat related variables
470  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::AH_MIN = 10!Minimum anthropogenic heat flux (AnthropHeatMethod = 1)
471  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::AH_SLOPE_Cooling = [2.7, 2.7]!Slope of the antrhropogenic heat flux calculation (AnthropHeatMethod = 1)
472  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::AH_SLOPE_Heating = [2.7, 2.7]!Slope of the antrhropogenic heat flux calculation (AnthropHeatMethod = 1)
473  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::QF0_BEU = [0.7442, 0.7955]
474  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_A = [0.1, 0.1]!Qf coefficients
475  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_B = [0.00986, 0.00986]!Qf coefficients
476  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::Qf_C = [0.0102, 0.0102]!Qf coefficients
477  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::BaseT_Cooling = [7, 7] !Critical temperature
478  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::BaseT_Heating = [7, 7] !Critical temperature
479  !REAL(KIND(1D0)), DIMENSION(2), PARAMETER ::TrafficRate = [0.0134, 0.0095]
480  !keep them here
481  REAL(KIND(1D0)), PARAMETER::ef_umolco2perj = 1.159
482  REAL(KIND(1D0)), PARAMETER::enef_v_jkm = 4e6
483  REAL(KIND(1D0)), PARAMETER::fcef_v_kgkm = 0.285
484  REAL(KIND(1D0)), PARAMETER::frfossilfuel_heat = 0.05
485  REAL(KIND(1D0)), PARAMETER::frfossilfuel_nonheat = 0
486  REAL(KIND(1D0)), PARAMETER::trafficunits = 1
487  REAL(KIND(1D0)), PARAMETER::maxqfmetab = 175
488  REAL(KIND(1D0)), PARAMETER::minqfmetab = 75
489 
490  ! AnOHM related: not used
491  REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::chanohm = 3 ! bulk transfer coef., added by TS AnOHM
492  REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::cpanohm = 2e6 ! heat capacity, added by TS AnOHM
493  REAL(KIND(1D0)), DIMENSION(7), PARAMETER ::kkanohm = 1.2 ! heat conductivity, added by TS AnOHM
494  REAL(KIND(1D0)), DIMENSION(:, :), ALLOCATABLE ::metforcingdata_grid
495 
496  !Biogenic CO2 related parameters
497  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::alpha_bioco2 = 0.005
498  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::alpha_enh_bioco2 = 0.016
499  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::beta_bioco2 = 8.747
500  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::beta_enh_bioco2 = 33.454
501  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::min_res_bioco2 = 0.6
502  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::resp_a = 2.43
503  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::resp_b = 0
504  REAL(KIND(1D0)), DIMENSION(3), PARAMETER ::theta_bioco2 = 0.96
505 
506  ! ESTM related variables, not used
507  REAL(KIND(1d0)), DIMENSION(24*3600/tstep) ::tair24hr
508  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE ::ts5mindata_ir !TODO:allocatable array can't serve as argument?
509 
510  REAL(KIND(1D0)) ::snowfallcum = 0 !Cumulative snowfall
511  REAL(KIND(1D0)), DIMENSION(7) ::icefrac = 0.2 !Estimated fraction of ice. Should be improved in the future
512  REAL(KIND(1D0)), DIMENSION(7) ::snowdens = 300 !Density of snow
513  REAL(KIND(1D0)), DIMENSION(7) ::snowfrac = 0 !!Surface fraction of snow cover
514  REAL(KIND(1D0)), DIMENSION(7) ::snowpack = 0 !Amount of snow on each surface in mm
515 
516  REAL(KIND(1D0)), DIMENSION(5) ::datetimeline
517  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5) ::dataoutlinesuews
518  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5) ::dataoutlinesnow
519  REAL(KIND(1d0)), DIMENSION(ncolumnsDataOutESTM - 5) ::dataoutlineestm
520  REAL(KIND(1d0)), DIMENSION(ncolumnsDataOutDailyState - 5) ::dailystateline
521 
522  ! drainage related parameters
523  REAL(KIND(1D0)), DIMENSION(6, 7)::storedrainprm
524  storedrainprm(1, :) = surf_attr_minstorcap_id
525  storedrainprm(2, :) = surf_attr_drainequat_id
526  storedrainprm(3, :) = surf_attr_draincoef1_id
527  storedrainprm(4, :) = surf_attr_draincoef2_id
528  storedrainprm(5, :) = surf_attr_maxstorcap_id
529 
530  storedrainprm(6, :) = surf_var_id
531  ldown_obs = glw1d
532  fcld_obs = cldfra1d
533  ! PRINT*,''
534  ! PRINT*, 'soilstore_id',soilstore_id
535  ! soilstore_id=MERGE(soilstore_id,soilstore_id*0,soilstore_id>0)
536  ! print*, 'soilstore_id modified',soilstore_id
537  ! PRINT*, 'state_id',state_id
538 #ifdef wrf
539  WRITE (message, *) 'in SuMin, before calculation, OHM_coef:', ohm_coef(1, :, :)
540  CALL wrf_debug(100, message)
541 #endif
542 
543  CALL suews_cal_main( &
544  aerodynamicresistancemethod, ah_min_id, ahprof_24hr, ah_slope_cooling_id, & ! input&inout in alphabetical order
545  ah_slope_heating_id, &
546  alb, albmax_dectr_id, albmax_evetr_id, albmax_grass_id, &
547  albmin_dectr_id, albmin_evetr_id, albmin_grass_id, &
548  alpha_bioco2, alpha_enh_bioco2, alt, avkdn, avrh, avu1, baset_id, basete_id, &
549  baset_hc_id, beta_bioco2, beta_enh_bioco2, bldgh_id, capmax_dec_id, capmin_dec_id, &
550  chanohm, cpanohm, crwmax, crwmin, daywat_id, daywatper_id, &
551  dectreeh_id, diagnose, diagqn, diagqs, drainrt_id, &
553  ef_umolco2perj, emis, emissionsmethod, enef_v_jkm, enddls, evetreeh_id, faibldg_id, &
554  faidectree_id, faievetree_id, faut_id, fcef_v_kgkm, fcld_obs, flowchange_id, &
555  frfossilfuel_heat, frfossilfuel_nonheat, g1, g2, g3, g4, g5, g6, gdd_id, &
556  gddfull_id, gridiv, gsmodel, hdd_id, humactivity_24hr, &
557  icefrac, id, ie_a, ie_end, ie_m, ie_start, imin, &
558  internalwateruse_h, irrfracconif_id, irrfracdecid_id, irrfracgrass_id, isec, it, evapmethod, &
559  iy, kkanohm, kmax, lai_id, laicalcyes, laimax_id, laimin_id, lai_obs, &
560  laipower, laitype, lat, ldown_obs, lng, maxconductance_id, maxqfmetab, &
562  narp_emis_snow, narp_trans_site, netradiationmethod, &
563  numcapita_id, ohm_coef, ohmincqf, ohm_threshsw, &
564  ohm_threshwd, pipecapacity_id, popdensdaytime_id, &
565  popdensnighttime_id, popprof_24hr, pormax_dec_id, pormin_dec_id, &
566  precip, preciplimit, preciplimitalb, press_hpa, &
567  qf0_beu_id, qf_a_id, qf_b_id, qf_c_id, &
568  qn1_obs, qh_obs, qs_obs, qf_obs, &
569  radmeltfact, raincover_id, rainmaxres_id, resp_a, resp_b, &
570  roughlenheatmethod, roughlenmommethod, runofftowater_id, s1, s2, &
571  sathydraulicconduct_id, sddfull_id, sfr, smdmethod, snowalb, snowalbmax, &
573  snowlimbldg, snowlimpaved, snowfrac_obs, snowpack, snowprof_24hr, snowuse, soildepth_id, &
574  soilstore_id, soilstorecap_id, stabilitymethod, startdls, state_id, statelimit_id, &
575  storageheatmethod, storedrainprm, surfacearea, tair24hr, tau_a, tau_f, tau_r, &
576  t_critic_cooling_id, t_critic_heating_id, temp_c, tempmeltfact, th, &
577  theta_bioco2, timezone, tl, trafficrate_id, trafficunits, &
578  traffprof_24hr, ts5mindata_ir, tstep, tstep_prev, veg_type, &
579  waterdist, waterusemethod, wetthresh_id, wu_m3, &
583  dailystateline)!output
584 
585  surf_var_id = storedrainprm(6, :) ! update surf_var_id
586 
587  kdown_o = dataoutlinesuews(1)
588  kup_o = dataoutlinesuews(2)
589  ldown_o = dataoutlinesuews(3)
590  lup_o = dataoutlinesuews(4)
591  tsurf_o = dataoutlinesuews(5)
592  smd_o = dataoutlinesuews(23)
593 
594  qn = dataoutlinesuews(6)
595  qf = dataoutlinesuews(7)
596  qs = dataoutlinesuews(8)
597  qh = dataoutlinesuews(9)
598  qe = dataoutlinesuews(10)
599  qsfc = dataoutlinesuews(16)
600  tsk = dataoutlinesuews(77) + 273.15
601  chklowq = 1
602 
603  ! PRINT*,''
604  ! PRINT*, 'avkdn,kup,ldown,lup,tsurf'
605  ! PRINT*, dataOutLineSUEWS(1:5)
606  ! PRINT*, 'qn1,qf,qs,qh,qe'
607  ! PRINT*, dataOutLineSUEWS(6:10)
608  ! PRINT*,''
609  ! IF ( ABS(qe)>1000 ) THEN
610  ! zdm_in=0.
611  ! PRINT*, 10./zdm_in
612  ! END IF
613 #ifdef wrf
614  WRITE (message, *) ' in SuMin, after calculation, OHM_coef:', ohm_coef(1, :, :)
615  CALL wrf_debug(100, message)
616 
617  WRITE (message, *) ' in SuMin, qn,qf,qs,qh,qe:', dataoutlinesuews(6:10)
618  CALL wrf_debug(100, message)
619 #endif
620 
real(kind(1d0)), dimension(:, :), allocatable metforcingdata_grid
real(kind(1d0)) qn1_s_av
real(kind(1d0)) tau_r
real(kind(1d0)), dimension(nsurf+1) ohm_threshwd
real(kind(1d0)), dimension(nsurf+1) ohm_threshsw
real(kind(1d0)), dimension(nsurf) snowdens
real(kind(1d0)) g1
real(kind(1d0)) s2
real(kind(1d0)), dimension(nvegsurf) theta_bioco2
integer gsmodel
real(kind(1d0)), dimension(nsurf) icefrac
real(kind(1d0)), dimension(nsurf) snowwater
real(kind(1d0)) g5
real(kind(1d0)) narp_emis_snow
real(kind(1d0)) snowfallcum
real(kind(1d0)), dimension(nsurf) state_id
real(kind(1d0)) qn1_av
real(kind(1d0)) kmax
real(kind(1d0)) snowlimpaved
real(kind(1d0)) z
real(kind(1d0)) th
real(kind(1d0)), dimension(0:23, 2) ahprof_24hr
real(kind(1d0)) snowalb
real(kind(1d0)) tempmeltfact
real(kind(1d0)), dimension(nsurf) soilstore_id
real(kind(1d0)) preciplimit
real(kind(1d0)), dimension(nvegsurf) alpha_enh_bioco2
real(kind(1d0)), dimension(4, nvegsurf) laipower
real(kind(1d0)), dimension(nsurf) snowpacklimit
real(kind(1d0)), dimension(ncolumnsdataoutsuews - 5) dataoutlinesuews
real(kind(1d0)), dimension(nvegsurf) alpha_bioco2
real(kind(1d0)) albevetr_id
real(kind(1d0)), dimension(nsurf) kkanohm
real(kind(1d0)), dimension(nvegsurf) resp_a
real(kind(1d0)) g2
integer isec
real(kind(1d0)), dimension(27) dataoutlineestm
real(kind(1d0)) zdm_in
real(kind(1d0)) snowdensmin
real(kind(1d0)) g3
real(kind(1d0)), dimension(ncolumnsdataoutsnow - 5) dataoutlinesnow
integer id
real(kind(1d0)), dimension(12) hdd_id
real(kind(1d0)), dimension(:), allocatable tair24hr
real(kind(1d0)) tau_f
real(kind(1d0)) dqnsdt
real(kind(1d0)), dimension(0:23, 2) popprof_24hr
integer, dimension(nvegsurf) laitype
integer imin
real(kind(1d0)) snowalbmax
real(kind(1d0)), dimension(0:23, 2) wuprofm_24hr
real(kind(1d0)), dimension(nvegsurf) resp_b
real(kind(1d0)), dimension(nsurf) chanohm
real(kind(1d0)), dimension(nsurf) emis
real(kind(1d0)) tau_a
real(kind(1d0)) radmeltfact
real(kind(1d0)), dimension(0:23, 2) snowprof_24hr
integer iy
real(kind(1d0)), dimension(nsurf) snowfrac
subroutine suews_cal_main(AerodynamicResistanceMethod, 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, avkdn, avRh, avU1, BaseT, BaseTe, BaseTMethod, BaseT_HC, beta_bioCO2, beta_enh_bioCO2, bldgH, CapMax_dec, CapMin_dec, chAnOHM, CO2PointSource, cpAnOHM, CRWmax, CRWmin, DayWat, DayWatPer, DecTreeH, Diagnose, DiagQN, DiagQS, DRAINRT, dt_since_start, dqndt, qn1_av, dqnsdt, qn1_s_av, EF_umolCO2perJ, emis, EmissionsMethod, EnEF_v_Jkm, endDLS, EveTreeH, FAIBldg, FAIDecTree, FAIEveTree, Faut, FcEF_v_kgkm, fcld_obs, FlowChange, FrFossilFuel_Heat, FrFossilFuel_NonHeat, G1, G2, G3, G4, G5, G6, 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, EvapMethod, iy, kkAnOHM, Kmax, LAI_id, LAICalcYes, LAIMax, LAIMin, LAI_obs, LAIPower, LAIType, lat, lenDay_id, ldown_obs, lng, MaxConductance, MaxFCMetab, MaxQFMetab, SnowWater, MetForcingData_grid, 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, 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, sfr, SMDMethod, SnowAlb, SnowAlbMax, SnowAlbMin, SnowPackLimit, SnowDens, SnowDensMax, SnowDensMin, SnowfallCum, SnowFrac, SnowLimBldg, SnowLimPaved, snowFrac_obs, SnowPack, SnowProf_24hr, snowUse, SoilDepth, soilstore_id, SoilStoreCap, StabilityMethod, startDLS, state_id, StateLimit, 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, TraffProf_24hr, Ts5mindata_ir, tstep, tstep_prev, veg_type, WaterDist, WaterUseMethod, WetThresh, wu_m3, WUDay_id, DecidCap_id, albDecTr_id, albEveTr_id, albGrass_id, porosity_id, WUProfA_24hr, WUProfM_24hr, xsmd, Z, z0m_in, zdm_in, datetimeLine, dataOutLineSUEWS, dataOutLineSnow, dataOutLineESTM, dataoutLineRSL, dataOutLineSOLWEIG, DailyStateLine)
real(kind(1d0)) g4
integer dt_since_start
real(kind(1d0)), dimension(nsurf+1, 4, 3) ohm_coef
real(kind(1d0)) z0m_in
real(kind(1d0)) narp_trans_site
real(kind(1d0)), dimension(nvegsurf) lai_id
real(kind(1d0)) porosity_id
real(kind(1d0)), dimension(nsurf) cpanohm
real(kind(1d0)) albgrass_id
real(kind(1d0)), dimension(nsurf) snowpack
real(kind(1d0)), dimension(6, nsurf) storedrainprm
real(kind(1d0)), dimension(0:23, 2) traffprof_24hr
real(kind(1d0)) dqndt
real(kind(1d0)), dimension(nsurf) sfr
real(kind(1d0)) snowlimbldg
real(kind(1d0)), dimension(0:23, 2) wuprofa_24hr
real(kind(1d0)) g6
real(kind(1d0)), dimension(9) wuday_id
real(kind(1d0)), dimension(nvegsurf) min_res_bioco2
real(kind(1d0)) crwmin
integer it
real(kind(1d0)) snowdensmax
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5) dailystateline
real(kind(1d0)), dimension(nsurf) alb
real(kind(1d0)) preciplimitalb
real(kind(1d0)) tl
real(kind(1d0)), dimension(nvegsurf) beta_enh_bioco2
real(kind(1d0)), dimension(0:23, 2) humactivity_24hr
real(kind(1d0)), dimension(nvegsurf) gdd_id
real(kind(1d0)), dimension(:), allocatable ts5mindata_ir
real(kind(1d0)) crwmax
real(kind(1d0)) snowalbmin
real(kind(1d0)), dimension(nvegsurf) beta_bioco2
real(kind(1d0)), dimension(5) datetimeline
real(kind(1d0)) albdectr_id
real(kind(1d0)), dimension(nsurf+1, nsurf - 1) waterdist
real(kind(1d0)) decidcap_id
real(kind(1d0)) s1
Here is the call graph for this function: