SUEWS API Site
Documentation of SUEWS source code
suews_ctrl_const.f95
Go to the documentation of this file.
1 ! sg feb 2012 - added some comments
2 ! sg feb 2012 - changed number of surfaces to allocatable array
3 ! lj jun 2012 - snow part added
4 ! HW, LJ Oct 2014 - fixes to the structure
5 ! HCW 03 Mar 2015 - tidied
6 ! HCW 03 Jul 2015 - added albedo max & min to SUEWS_NonVeg.txt (min not used), SUEWS_Veg.txt, SUEWS_Water.txt (min not used)
7 ! LJ 06 Jul 2015 - changed alb_snow, albsnowmin and albsnowmax to SnowAlb, SnowAlbMin and SnowAlbMax (to be systematic with
8 ! other variables). Similarly denssnow changed to SnowDens. cMDS_SnowAlb=29 added.
9 ! HCW 10 Mar 2016 - variable vsmd added for soil moisture of vegetated surfaces
10 ! TS 14 Mar 2016 - multiple addtions for AnOHM
11 ! HCW 14 Jun 2016 - updated columns for ESTM and column names for AnOHM
12 ! HCW 26 Aug 2016 - CO2 flux added
13 ! HCW 16 Jan 2017 - WhereWhen module added to store info relating to grid and datetime
14 ! MH 16 Jun 2017 - Added biogenic CO2 and edited Site_Select
15 ! MH 21 Jun 2017 - Added anthropogenic CO2 and edited Site_Select
16 
17 !==================================================================================================
19 
20  IMPLICIT NONE
21 
22  ! ---- Set parameters for reading in data ------------------------------------------------------
23 ! #ifdef nc
24 ! INTEGER, PARAMETER:: MaxNumberOfGrids = 90000 !Max no. grids !TS changed to 90000 for large-scale simulation based on netCDF IO
25 ! #else
26  INTEGER, PARAMETER:: maxnumberofgrids = 10000 !Max no. grids !HCW changed to 2000 from 10000 so prog can run on windows (2GB lim)
27 ! #endif
28  INTEGER, PARAMETER:: maxlinesmet = 8640 !Max no. lines to read in one go (for all grids, ie MaxLinesMet/NumberOfGrids each)
29 
30  ! ---- Set number of columns in input files ----------------------------------------------------
31  INTEGER, PARAMETER:: ncolumnssiteselect = 101 !SUEWS_SiteSelect.txt
32  INTEGER, PARAMETER:: ncolumnsnonveg = 24 !SUEWS_NonVeg.txt
33  INTEGER, PARAMETER:: ncolumnsveg = 38 !SUEWS_Veg.txt
34  INTEGER, PARAMETER:: ncolumnswater = 22 !SUEWS_Water.txt
35  INTEGER, PARAMETER:: ncolumnssnow = 25 !SUEWS_Snow.txt
36  INTEGER, PARAMETER:: ncolumnssoil = 9 !SUEWS_Soil.txt
37  INTEGER, PARAMETER:: ncolumnsconductance = 13 !SUEWS_Conductance.txt
38  INTEGER, PARAMETER:: ncolumnsohmcoefficients = 4 !SUEWS_OHMCoefficients.txt
39  INTEGER, PARAMETER:: ncolumnsestmcoefficients = 52 !SUEWS_ESTMCoefficients.txt ! S.O. 04 Feb 2016
40  INTEGER, PARAMETER:: ncolumnsanthropogenic = 39 !SUEWS_AnthropogenicEmission.txt
41  INTEGER, PARAMETER:: ncolumnsirrigation = 25 !SUEWS_Irrigation.txt
42  INTEGER, PARAMETER:: ncolumnsprofiles = 25 !SUEWS_Profiles.txt
43  INTEGER, PARAMETER:: ncolumnswgwaterdist = 10 !SUEWS_WithinGridWaterDist.txt
44  INTEGER, PARAMETER:: ncolumnsbiogen = 9 !SUEWS_BiogenCO2.txt
45  INTEGER, PARAMETER:: ncolumnsmetforcingdata = 24 !Meteorological forcing file (_data.txt)
46  INTEGER, PARAMETER:: ncolsestmdata = 13 !ESTM input file (_ESTM_Ts_data.txt))
47 
48  ! ---- Set number of columns in output files ---------------------------------------------------
49  INTEGER, PARAMETER:: ncolumnsdataoutsuews = 87, & !Main output file (_5.txt). dataOutSUEWS created in SUEWS_Calculations.f95
50  ncolumnsdataoutsnow = 103, &
51  ncolumnsdataoutsol = 31, &
52  ncolumnsdataoutbl = 22, &
53  ncolumnsdataoutestm = 32, &
55  ncolumnsdataoutrsl = 125
56 
57  ! ---- Define input file headers ---------------------------------------------------------------
58  CHARACTER(len=20), DIMENSION(ncolumnsSiteSelect):: headersiteselect_file !Header for SiteSelect.txt
59  CHARACTER(len=20), DIMENSION(ncolumnsNonVeg):: headernonveg_file !Header for the nonveg surface
60  CHARACTER(len=20), DIMENSION(ncolumnsNonVeg):: headernonveg_reqd !Expected header for the nonveg surface
61  CHARACTER(len=20), DIMENSION(ncolumnsVeg):: headerveg_file !Header for the veg surface
62  CHARACTER(len=20), DIMENSION(ncolumnsVeg):: headerveg_reqd !Expected header for the veg surface
63  CHARACTER(len=20), DIMENSION(ncolumnsWater):: headerwater_file !Header for water surface
64  CHARACTER(len=20), DIMENSION(ncolumnsWater):: headerwater_reqd !Expected header for water surface
65  CHARACTER(len=20), DIMENSION(ncolumnsSnow):: headersnow_file !Header for Snow surface
66  CHARACTER(len=20), DIMENSION(ncolumnsSnow):: headersnow_reqd !Expected header for Snow surface
67  CHARACTER(len=20), DIMENSION(ncolumnsSoil):: headersoil_file !Header for soils
68  CHARACTER(len=20), DIMENSION(ncolumnsSoil):: headersoil_reqd !Expected header for soils
69  CHARACTER(len=20), DIMENSION(ncolumnsConductance):: headercond_file !Header for conductances
70  CHARACTER(len=20), DIMENSION(ncolumnsConductance):: headercond_reqd !Expected header for conductances
71  CHARACTER(len=20), DIMENSION(ncolumnsOHMCoefficients):: headerohmcoefficients_file !Header for soils
72  CHARACTER(len=20), DIMENSION(ncolumnsOHMCoefficients):: headerohmcoefficients_reqd !Expected header for soils
73  CHARACTER(len=20), DIMENSION(ncolumnsESTMCoefficients):: headerestmcoefficients_file !Header for soils ! S.O. 04 Feb 2016
74  CHARACTER(len=20), DIMENSION(ncolumnsESTMCoefficients):: headerestmcoefficients_reqd !Expected header for soils ! S.O. 04 Feb 2016
75  CHARACTER(len=20), DIMENSION(ncolumnsAnthropogenic):: headeranthropogenic_file !Header for QF
76  CHARACTER(len=20), DIMENSION(ncolumnsAnthropogenic):: headeranthropogenic_reqd !Expected header for QF
77  CHARACTER(len=20), DIMENSION(ncolumnsIrrigation):: headerirrigation_file !Header for Irrigation
78  CHARACTER(len=20), DIMENSION(ncolumnsIrrigation):: headerirrigation_reqd !Expected header for Irrigation
79  CHARACTER(len=20), DIMENSION(ncolumnsProfiles):: headerprofiles_file !Header for Profiles
80  CHARACTER(len=20), DIMENSION(ncolumnsProfiles):: headerprofiles_reqd !Expected header for Profiles
81  CHARACTER(len=20), DIMENSION(ncolumnsWGWaterDist):: headerwgwaterdist_file !Header for Profiles
82  CHARACTER(len=20), DIMENSION(ncolumnsWGWaterDist):: headerwgwaterdist_reqd !Expected header for Profiles
83  CHARACTER(len=20), DIMENSION(ncolumnsBiogen):: headerbiogen_file !Header for Biogen
84  CHARACTER(len=20), DIMENSION(ncolumnsBiogen):: headerbiogen_reqd !Expected header for Biogen
85 
86  ! ---- Define output file headers --------------------------------------------------------------
87  INTEGER, DIMENSION(:), ALLOCATABLE:: usecolumnsdataout !Column numbers used to select output variables
88  ! If change lengths in SUEWS_Output.f95, also need to adjust here
89  CHARACTER(len=14*ncolumnsDataOutSUEWS):: headeruse, formatuse, headerusenosep, formatusenosep !Header and format in correct form
90  CHARACTER(len=52*ncolumnsDataOutSUEWS):: longnmuse
91  CHARACTER(len=14*ncolumnsDataOutSUEWS):: unitsuse
92  CHARACTER(len=3*ncolumnsDataOutSUEWS):: aggreguse
93  CHARACTER(len=4*ncolumnsDataOutSUEWS):: colnosuse
94 
95  ! ---- Define arrays to store input information from SiteInfo spreadsheet ----------------------
96  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::siteselect !Stores info from SiteSelect.txt
97  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::nonveg_coeff !Coefficients for the nonveg surfaces
98  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::veg_coeff !Coefficients for the veg surfaces
99  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::water_coeff !Coefficients for the water surface
100  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::snow_coeff !Coefficients for snow
101  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::soil_coeff !Coefficients for soil
102  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::conductance_coeff !Coefficients for conductances
103  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::ohmcoefficients_coeff !Coefficients for OHMCoefficients
104  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::estmcoefficients_coeff !Coefficients for ESTMCoefficients ! S.O. 04 Feb 2016
105  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::anthropogenic_coeff !Coefficients for AnthropogenicEmissions
106  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::irrigation_coeff !Coefficients for Irrigation
107  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::profiles_coeff !Coefficients for Profiles
108  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::wgwaterdist_coeff !Coefficients for WithinGridWaterDist
109  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE::biogen_coeff !Coefficients for BiogenCO2
110 
111  ! ---- Define arrays for model calculations ----------------------------------------------------
112  INTEGER, DIMENSION(:), ALLOCATABLE:: grididmatrix !Array containing GridIDs in SiteSelect after sorting
113  INTEGER, DIMENSION(:), ALLOCATABLE:: grididmatrix0 !Array containing GridIDs in SiteSelect in the original order
114  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE:: surfacechar !Array for surface characteristics
115  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: metforcingdata !Array for meteorological forcing data
116  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE :: metforcingdata_grid !Array for meteorological forcing data of one grid used by AnOHM
117  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: estmforcingdata !Array for ESTM forcing data
118  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE:: modeldailystate !DailyState array
119  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE:: dailystatefirstopen
120  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: modeloutputdata !Output data matrix
121  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutsuews !Main data output matrix
122  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutrsl !Main data output matrix
123  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutbl !CBL output matrix
124  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutsol !SOLWEIG POI output matrix
125  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutsnow !Main data output matrix
126  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutestm !ESTM output matrix
127  REAL(KIND(1d0)), DIMENSION(:, :, :), ALLOCATABLE:: dataoutdailystate !DailyState output array
128 
129  ! -------- output per each timestep ----------------------------------------------------------------
130  REAL(KIND(1D0)), DIMENSION(5) ::datetimeline ! output of datetime info per each timestep
131  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSUEWS - 5) ::dataoutlinesuews ! output of SUEWS results per each timestep
132  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutSnow - 5) ::dataoutlinesnow ! output of snow results per each timestep
133  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutRSL - 5) ::dataoutlinersl ! output of snow results per each timestep
134  REAL(KIND(1D0)), DIMENSION(ncolumnsDataOutDailyState - 5)::dailystateline ! output of DailyState results per each timestep
135 
136  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE:: metfordisagg !Array for original met forcing data (for disaggregation)
137  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE:: metfordisaggprev, metfordisaggnext !Stores last and next row of met data
138 
139  REAL(KIND(1d0)), DIMENSION(:, :), ALLOCATABLE:: estmfordisagg !Array for original ESTM forcing data (for disaggregation)
140  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE:: estmfordisaggprev, estmfordisaggnext !Stores last and next row of ESTM data
141 
142  ! ---- Define array for hourly profiles interpolated to tstep ----------------------------------
143  ! REAL(KIND(1d0)),DIMENSION(:,:,:),ALLOCATABLE:: TstepProfiles
144  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: AHProf_tstep
145  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: WUProfM_tstep
146  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: WUProfA_tstep
147  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: HumActivity_tstep
148  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: TraffProf_tstep
149  ! REAL(KIND(1d0)),DIMENSION(:,:), ALLOCATABLE:: PopProf_tstep
150 
151  REAL(KIND(1d0)), DIMENSION(0:23, 2):: ahprof_24hr !Anthropogenic heat profiles for (1)weekdays / (2)weekends
152  REAL(KIND(1d0)), DIMENSION(0:23, 2):: humactivity_24hr !Human actvity profiles for (1)weekdays / (2)weekends
153  REAL(KIND(1d0)), DIMENSION(0:23, 2):: traffprof_24hr !Traffic profiles for (1)weekdays / (2)weekends
154  REAL(KIND(1d0)), DIMENSION(0:23, 2):: popprof_24hr !Population profiles for (1)weekdays / (2)weekends
155  REAL(KIND(1d0)), DIMENSION(0:23, 2):: wuprofm_24hr !Hourly profiles for water use (manual irrigation)
156  REAL(KIND(1d0)), DIMENSION(0:23, 2):: wuprofa_24hr !Hourly profiles for water use (automatic irrigation)
157 
158  ! ---- For ESTM
159  REAL(KIND(1d0)), ALLOCATABLE, DIMENSION(:, :):: ts5mindata !surface temperature input data
160  REAL(KIND(1d0)), ALLOCATABLE, DIMENSION(:) :: ts5mindata_ir !=ts5mindata(ir,:), ts input for the current timestep
161  REAL(KIND(1d0)), ALLOCATABLE, DIMENSION(:) :: tair24hr
162  REAL(KIND(1d0)), DIMENSION(27) :: dataoutlineestm !ESTM output for the current timestep and grid
163 
164  ! Column numbers for TstepProfiles
165  INTEGER:: ctp_enusewd = 1, &
166  ctp_enusewe = 2, &
167  ctp_wumanuwd = 3, &
168  ctp_wumanuwe = 4, &
169  ctp_wuautowd = 5, &
170  ctp_wuautowe = 6, &
171  ctp_snowcwd = 7, &
172  ctp_snowcwe = 8, &
173  ctp_humactivitywd = 9, &
174  ctp_humactivitywe = 10, &
175  ctp_traffprofwd = 11, &
176  ctp_traffprofwe = 12, &
177  ctp_popprofwd = 13, &
178  ctp_popprofwe = 14
179  !-----------------------------------------------------------------------------------------------
180 
181  ! ---- Surface types ---------------------------------------------------------------------------
182  INTEGER, PARAMETER:: nsurf = 7 !Total number of surfaces
183  INTEGER, PARAMETER:: nvegsurf = 3 !Number of surfaces that are vegetated
184  INTEGER, PARAMETER:: nsurfincsnow = nsurf + 1 !Number of surfaces + snow
185 
186  INTEGER, PARAMETER:: pavsurf = 1, & !When all surfaces considered together (1-7)
187  bldgsurf = 2, &
188  conifsurf = 3, &
189  decidsurf = 4, &
190  grasssurf = 5, & !New surface classes: Grass = 5th/7 surfaces
191  bsoilsurf = 6, & !New surface classes: Bare soil = 6th/7 surfaces
192  watersurf = 7, &
193  excesssurf = 8, & !Runoff or subsurface soil in WGWaterDist
194  nsurfdonotreceivedrainage = 0, & !Number of surfaces that do not receive drainage water (green roof)
195  ivconif = 1, & !When only vegetated surfaces considered (1-3)
196  ivdecid = 2, &
197  ivgrass = 3
198 
199  REAL(KIND(1d0)), DIMENSION(nsurf):: sfr !Surface fractions [-]
200 
201  ! ---- Water balance for each surface ---------------------------------------------------------
202  !These variables are expressed as depths [mm] over each surface(is); the depth therefore varies with sfr(is)
203  REAL(KIND(1d0)), DIMENSION(nsurf):: addwater !Water from other surfaces (WGWaterDist in SUEWS_ReDistributeWater.f95) [mm]
204  REAL(KIND(1d0)), DIMENSION(nsurf):: addwaterrunoff !Fraction of water going to runoff/sub-surface soil (WGWaterDist) [-]
205  ! N.B. this is not an amount; drain(is)*AddWaterRunoff(is) is the amount [mm]
206  REAL(KIND(1d0)), DIMENSION(nsurf):: chang !Change in state [mm]
207  REAL(KIND(1d0)), DIMENSION(nsurf):: drain !Drainage of each surface type [mm]
208  REAL(KIND(1d0)), DIMENSION(nsurf):: evap !Evaporation from each surface type [mm]
209  REAL(KIND(1d0)), DIMENSION(nsurf):: runoff !Runoff from each surface type [mm]
210  REAL(KIND(1d0)), DIMENSION(nsurf):: runoffsoil !Soil runoff from each soil sub-surface [mm]
211  REAL(KIND(1d0)), DIMENSION(nsurf):: smd_nsurf !Soil moisture deficit of each sub-surface [mm]
212  REAL(KIND(1d0)), DIMENSION(nsurf):: smd_nsurfout !Soil moisture deficit of each sub-surface (written out) [mm]
213  REAL(KIND(1d0)), DIMENSION(nsurf):: soilstore_id !Soil moisture of each surface type [mm]
214  REAL(KIND(1d0)), DIMENSION(nsurf):: soilstoreold !Soil moisture of each surface type from previous timestep [mm]
215  REAL(KIND(1d0)), DIMENSION(nsurf):: state_id !Wetness status of each surface type [mm]
216  REAL(KIND(1d0)), DIMENSION(nsurf):: stateout !Wetness status of each surface type (written out) [mm]
217  REAL(KIND(1d0)), DIMENSION(nsurf):: stateold !Wetness status of each surface type from previous timestep [mm]
218  REAL(KIND(1D0)), DIMENSION(nsurf):: rss_nsurf !Surface resistance after wet/partially wet adjustment for each surface
219 
220  REAL(KIND(1d0)), DIMENSION(nsurf):: wetthresh !When state_id > WetThresh, RS=0 limit in SUEWS_evap [mm] (specified in input files)
221  REAL(KIND(1d0)), DIMENSION(nsurf):: statelimit !Limit for state_id of each surface type [mm] (specified in input files)
222 
223  REAL(KIND(1d0)), DIMENSION(1):: waterdepth !Depth of open water
224 
225  ! ---- Soil characteristics specified in input files -------------------------------------------
226  REAL(KIND(1d0)), DIMENSION(nsurf):: sathydraulicconduct !Saturated hydraulic conductivity for each soil subsurface [mm s-1]
227  REAL(KIND(1d0)), DIMENSION(nsurf):: soildepth !Depth of sub-surface soil store for each surface [mm]
228  REAL(KIND(1d0)), DIMENSION(nsurf):: soilstorecap !Capacity of soil store for each surface [mm]
229 
230  ! ---- Within-grid water distribution matrix ---------------------------------------------------
231  REAL(KIND(1d0)), DIMENSION(nsurf + 1, nsurf - 1)::waterdist !Within-grid water distribution to other surfaces and runoff/soil store [-]
232 
233  ! ---- Drainage characteristics ----------------------------------------------------------------
234  REAL(KIND(1d0)), DIMENSION(6, nsurf):: storedrainprm !Storage capacities and drainage equation info for each surface
235  ! 1 - min storage capacity [mm]
236  ! 2 - Drainage equation to use
237  ! 3 - Drainage coeff 1 [units depend on choice of eqn]
238  ! 4 - Drainage coeff 2 [units depend on choice of eqn]
239  ! 5 - max storage capacity [mm]
240  ! 6 - current storage capacity [mm]
241  !-----------------------------------------------------------------------------------------------
242 
243  ! ---- Define arrays at daily timestep ---------------------------------------------------------
244  INTEGER, PARAMETER:: ndays = 366 !Max no. days in a year used to specify size of daily arrays
245  !! Could delete NDays and allocate these elsewhere once no. days is known
246  ! REAL(KIND(1d0)),DIMENSION( 0:ndays, 5):: GDD !Growing Degree Days (see SUEWS_DailyState.f95)
247  ! REAL(KIND(1d0)),DIMENSION(-4:ndays, 6):: HDD !Heating Degree Days (see SUEWS_DailyState.f95)
248  ! REAL(KIND(1d0)),DIMENSION( 0:ndays, 9):: WUDay !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
249  ! REAL(KIND(1d0)),DIMENSION(-4:ndays, nvegsurf):: LAI !LAI for each veg surface [m2 m-2]
250 
251  REAL(KIND(1d0)), DIMENSION(nvegsurf) :: gdd_id, gdd_id_prev !Growing Degree Days (see SUEWS_DailyState.f95)
252  REAL(KIND(1d0)), DIMENSION(nvegsurf) :: sdd_id !Growing Degree Days (see SUEWS_DailyState.f95)
253  REAL(KIND(1d0)):: tmin_id, tmax_id, lenday_id
254  REAL(KIND(1d0)), DIMENSION(12) :: hdd_id
255  REAL(KIND(1d0)), DIMENSION(9) :: wuday_id, wuday_id_prev !Daily water use for EveTr, DecTr, Grass [mm] (see SUEWS_DailyState.f95)
256  REAL(KIND(1d0)), DIMENSION(nvegsurf) :: lai_id, lai_id_prev !LAI for each veg surface [m2 m-2]
257 
258  ! Seasonality of deciduous trees accounted for by the following variables which change with time
259  ! REAL(KIND(1d0)),DIMENSION( 0:ndays):: DecidCap !Storage capacity of deciduous trees [mm]
260  ! REAL(KIND(1d0)),DIMENSION( 0:ndays):: porosity !Porosity of deciduous trees [-]
261  ! REAL(KIND(1d0)),DIMENSION( 0:ndays):: albDecTr !Albedo of deciduous trees [-]
262  ! REAL(KIND(1d0)),DIMENSION( 0:ndays):: albEveTr !Albedo of evergreen trees [-]
263  ! REAL(KIND(1d0)),DIMENSION( 0:ndays):: albGrass !Albedo of grass[-]
264 
265  REAL(KIND(1d0)):: albmin_dectr, & !Min albedo for deciduous trees [-]
266  albmax_dectr, & !Max albedo for deciduous trees [-]
267  capmin_dec, & !Min storage capacity for deciduous trees [mm] (from input information)
268  capmax_dec, & !Max storage capacity for deciduous trees [mm] (from input information)
269  pormin_dec, & !Min porosity for deciduous trees
270  pormax_dec, & !Max porosity for deciduous trees
271  albmin_evetr, & !Min albedo for evergreen trees [-]
272  albmax_evetr, & !Max albedo for evergreen trees [-]
273  albmin_grass, & !Min albedo for grass [-]
274  albmax_grass !Max albedo for grass [-]
275 
276  ! Replicate arrays needed for DailyState, adding dimension to identify the grid, HCW 27 Nov 2014
277  !! Could delete MaxNumberOfGrids and allocate these elsewhere once NumberOfGrids is known
278  ! REAL(KIND(1d0)),DIMENSION( 0:ndays, 5,MaxNumberOfGrids):: GDD_grids
279  ! REAL(KIND(1d0)),DIMENSION(-4:ndays, 6,MaxNumberOfGrids):: HDD_grids
280  ! REAL(KIND(1d0)),DIMENSION( 0:ndays, 9,MaxNumberOfGrids):: WUDay_grids
281  ! REAL(KIND(1d0)),DIMENSION(-4:ndays, nvegsurf,MaxNumberOfGrids):: LAI_grids
282 
283  REAL(KIND(1d0)), DIMENSION(nvegsurf, MaxNumberOfGrids):: gdd_id_grids
284  REAL(KIND(1d0)), DIMENSION(nvegsurf, MaxNumberOfGrids):: sdd_id_grids
285  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: tmin_id_grids
286  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: tmax_id_grids
287  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: lenday_id_grids
288  REAL(KIND(1d0)), DIMENSION(12, MaxNumberOfGrids):: hdd_id_grids
289  REAL(KIND(1d0)), DIMENSION(9, MaxNumberOfGrids):: wuday_id_grids
290  REAL(KIND(1d0)), DIMENSION(nvegsurf, MaxNumberOfGrids):: lai_id_grids
291 
292  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: albDecTr_grids
293  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: DecidCap_grids
294  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: porosity_grids
295  !
296  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: albEveTr_grids
297  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: albGrass_grids
298 
299  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: decidcap_id_grids
300  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: albdectr_id_grids
301  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: albevetr_id_grids
302  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: albgrass_id_grids
303  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids):: porosity_id_grids
304 
305  REAL(KIND(1d0)) :: decidcap_id
306  REAL(KIND(1d0)) :: albdectr_id
307  REAL(KIND(1d0)) :: albevetr_id
308  REAL(KIND(1d0)) :: albgrass_id
309  REAL(KIND(1d0)) :: porosity_id
310 
311  ! AnOHM related: added by TS 01 Mar 2016
312  ! store AnOHM coef. of all sfc. by TS 09 Apr 2016
313  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: Bo_grids
314  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: mAH_grids
315  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: a1AnOHM_grids
316  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: a2AnOHM_grids
317  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids):: a3AnOHM_grids
318  ! REAL(KIND(1d0)),DIMENSION( 0:ndays,MaxNumberOfGrids,nsurf,3):: a123AnOHM_gs
319  REAL(KIND(1d0)):: xbo ! daily Bowen ratio
320  !! store water states for AnOHM iteration, by TS 13 Apr 2016
321  !REAL(KIND(1d0)),DIMENSION(0:ndays,MaxNumberOfGrids,nsurf):: soilmoistDay !Soil moisture of each surface type at the end of a day [mm], 13 Apr 2016 TS
322  !REAL(KIND(1d0)),DIMENSION(0:ndays,MaxNumberOfGrids,nsurf):: stateDay !Wetness status of each existing surface type at the end of a day [mm], 13 Apr 2016 TS
323 
324  ! Day of week, month and season (used for water use and energy use calculations, and in OHM)
325  ! INTEGER,DIMENSION(0:ndays,3)::DayofWeek !1 - day of week; 2 - month; 3 - season
326  !-----------------------------------------------------------------------------------------------
327 
328  ! --- Vegetation phenology ---------------------------------------------------------------------
329  ! Parameters provided in input information for each vegetation surface (SUEWS_Veg.txt)
330  REAL(KIND(1d0)), DIMENSION(nvegsurf):: baset !Base temperature for growing degree days [degC]
331  REAL(KIND(1d0)), DIMENSION(nvegsurf):: basete !Base temperature for senescence degree days [degC]
332  REAL(KIND(1d0)), DIMENSION(nvegsurf):: gddfull !Growing degree days needed for full capacity [degC]
333  REAL(KIND(1d0)), DIMENSION(nvegsurf):: sddfull !Senescence degree days needed to initiate leaf off [degC]
334  REAL(KIND(1d0)), DIMENSION(nvegsurf):: laimin !Min LAI [m2 m-2]
335  REAL(KIND(1d0)), DIMENSION(nvegsurf):: laimax !Max LAI [m2 m-2]
336  REAL(KIND(1d0)), DIMENSION(nvegsurf):: maxconductance !Max conductance [mm s-1]
337  REAL(KIND(1d0)), DIMENSION(4, nvegsurf):: laipower !Coeffs for LAI equation: 1,2 - leaf growth; 3,4 - leaf off
338  !! N.B. currently DecTr only, although input provided for all veg types
339  INTEGER, DIMENSION(nvegsurf):: laitype !LAI equation to use: original (0) or new (1)
340  !real(kind(1d0))::GDDmax,SDDMax ! Max GDD and SDD across all veg types [degC] (removed HCW 03 Mar 2015)
341 
342  REAL(KIND(1d0)), DIMENSION(nvegsurf):: biogenco2code, & !Biogenic CO2 Code for SUEWS_BiogenCO2.txt
343  alpha_bioco2, &
344  beta_bioco2, &
345  theta_bioco2, &
347  beta_enh_bioco2, &
348  resp_a, &
349  resp_b, &
351 
352  !No longer used (removed HCW 27 Nov 2014)
353  !real(kind(1d0)),dimension(0:23)::runT ! running average T for the day
354  !real(kind(1d0)),dimension(0:23)::runP ! running total Precip for the day
355  !real (kind(1d0))::avT_h, totP_h ! daily running average Temp, Total precip
356  !-----------------------------------------------------------------------------------------------
357 
358  ! ---- Variables related to NARP ---------------------------------------------------------------
359  REAL(KIND(1d0)), DIMENSION(nsurf):: alb !Albedo of each surface type [-]
360  REAL(KIND(1d0)), DIMENSION(nsurf):: emis !Emissivity of each surface type [-]
361 
362  REAL(KIND(1d0)):: bulkalbedo !Bulk albedo for whole surface (areally-weighted)
363 
364  ! Radiation balance components for different surfaces
365  REAL(KIND(1d0)), DIMENSION(nsurf):: tsurf_ind, & !Surface temperature for each surface [degC]
366  tsurf_ind_snow, & !Snow surface temperature for each surface [degC]
368  REAL(KIND(1d0)), DIMENSION(nsurf):: kup_ind, & !Outgoing shortwave radiation for each surface [W m-2]
369  kup_ind_snow, & !Outgoing shortwave radiation for each snow surface [W m-2]
371  REAL(KIND(1d0)), DIMENSION(nsurf):: lup_ind, & !Outgoing longwave radiation for each surface [W m-2]
372  lup_ind_snow, & !Outgoing longwave radiation for each snow surface [W m-2]
374  REAL(KIND(1d0)), DIMENSION(nsurf):: qn1_ind, & !Net all-wave radiation for each surface [W m-2]
375  qn1_ind_snow, & !Net all-wave radiation for each snow surface [W m-2]
377 
378  ! ---- NARP-specific parameters ----------------------------------------------------------------
379  REAL(KIND(1d0)) :: narp_lat, narp_long, narp_year, narp_tz, &
381  REAL(KIND(1D0)) :: narp_g(365) !!QUESTION: Should this be NDays? - HCW
382  INTEGER :: narp_nperhour
383  REAL(KIND(1D0)), ALLOCATABLE :: narp_kdown_hr(:)
384  ! Constants required
385  REAL(KIND(1D0)), PARAMETER :: deg2rad = 0.017453292, &
386  rad2deg = 57.29577951, &
387  sigma_sb = 5.67e-8
388  !-----------------------------------------------------------------------------------------------
389 
390  ! ---- OHM coefficients ------------------------------------------------------------------------
391  REAL(KIND(1d0)), DIMENSION(nsurf + 1, 4, 3):: ohm_coef !Array for OHM coefficients
392  REAL(KIND(1d0)), DIMENSION(nsurf + 1):: ohm_threshsw, ohm_threshwd !Arrays for OHM thresholds
393  REAL(KIND(1d0)):: a1, a2, a3 !OHM coefficients, a1 [-]; a2 [h]; a3 [W m-2]
394  ! REAL(KIND(1d0)),DIMENSION(:,:),ALLOCATABLE:: qn1_store, qn1_S_store !Q* values for each timestep over previous hr (_S for snow)
395  ! REAL(KIND(1d0)),DIMENSION(:,:),ALLOCATABLE:: qn1_av_store, qn1_S_av_store !Hourly Q* values for each timestep over previous 2 hr
396  ! REAL(KIND(1d0)),DIMENSION(:),ALLOCATABLE::qn1_store_grid,qn1_av_store_grid
397  ! REAL(KIND(1d0)),DIMENSION(:),ALLOCATABLE::qn1_S_store_grid,qn1_S_av_store_grid
398 
399  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE::tair_av_grids
400  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE::qn1_av_grids, qn1_s_av_grids
401  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE::dqndt_grids, dqnsdt_grids
402  REAL(KIND(1d0))::qn1_av, dqndt
403  REAL(KIND(1d0))::tair_av
404  REAL(KIND(1d0))::qn1_s_av, dqnsdt
405 
406  !-----------------------------------------------------------------------------------------------
407 
408  ! ---- Snow-related variables ------------------------------------------------------------------
409  REAL(KIND(1d0)), DIMENSION(nsurf):: changsnow, & !Change in snowpack in mm
410  maxsnowvol, & !! Maximum snow volume
411  snowwater, & !!Liquid water in the snow pack of ith surface
412  ev_snow, & !!Evaporation from snowpack in mm
413  mw_ind, & !Melt water from individual surface in mm
414  mw_indday, & !!Melt water per day from each surface type in m3
415  runoffsnow, & !!Runoff from snowpack in mm and in m3
416  snowdens, & !Density of snow
417  snowfrac, & !!Surface fraction of snow cover
418  icefrac, &
419  snowinit, &
420  snowdepth, & !Depth of snow in cm
421  snowtosurf, & !Meltwater flowing from snow to surface
422  volswe, &
423  statefraction, & !Fraction of state that can freeze
424  freezmelt, & !Amount of freezing meltwater in mm for the ith surface area
425  qm_freezstate, & !Heat by freezing of surface state
426  freezstate, & !Amount of freezing state in mm for the ith surface area
427  freezstatevol, &
428  qm_melt, & !Heat consumption by snow melt
429  qm_rain, & !Heat by rain falling on snow
430  rainonsnow, & !Liquid precipitation falling on snow ()
431  snowpacklimit, &
432  deltaqi
433 
434  REAL(KIND(1d0)), DIMENSION(nsurf, MaxNumberOfGrids)::icefrac_grids
435 
436  REAL(KIND(1d0)), DIMENSION(nsurf):: snowpack, & !Amount of snow on each surface in mm
438  INTEGER, DIMENSION(nsurf):: heig, & !snow layer height
439  snowcoverforms, &
440  snowcalcswitch = 0 !Defines if snow related balance is made
441  !-----------------------------------------------------------------------------------------------
442 
443  ! ---- Grid connections ------------------------------------------------------------------------
444  !! Grid connections needs coding, currently no water transfer between grids
445  ! Added HCW 14 Nov 2014
446  INTEGER, PARAMETER:: nconns = 8 !Number of grids for between-grid connections
447  REAL(KIND(1d0)), DIMENSION(nconns):: gridtofrac !Fraction of water moving to the grid specified in GridTo [-]
448  REAL(KIND(1d0)), DIMENSION(nconns):: gridto !Grid that water moves to
449  !!character(len=15),dimension(2,MaxNumberOfGrids)::GridConnections !List of different grid corrections
450  !!real (kind(1d0)),dimension(MaxNumberOfGrids):: GridConnectionsFrac !Fraction of water moving between the different grids
451  !-----------------------------------------------------------------------------------------------
452 
453  ! ---- AnOHM related variable, added by TS, 01 Mar 2016 ---------------------------------------------------------------
454  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids) :: a1anohm, a2anohm, a3anohm ! OHM coefficients, a1 [-]; a2 [h]; a3 [W m-2]
455  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids) :: mahanohm ! daily mean AH [W m-2]
456  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids) :: boanohmstart ! initial Bo for interation [-]
457  REAL(KIND(1d0)), DIMENSION(MaxNumberOfGrids) :: boanohmend ! final Bo for interation [-]
458  REAL(KIND(1d0)), DIMENSION(nsurf):: cpanohm ! heat capacity [J m-3 K-1]
459  REAL(KIND(1d0)), DIMENSION(nsurf):: kkanohm ! thermal conductivity [W m-1 K-1]
460  REAL(KIND(1d0)), DIMENSION(nsurf):: chanohm ! bulk transfer coef. [-]
461  !-----------------------------------------------------------------------------------------------
462 
463  ! ESTM variables for SUEWS surfaces
464  REAL(KIND(1d0)), DIMENSION(5, nsurfIncSnow):: zsurf_suewssurfs, &
467  !-----------------------------------------------------------------------------------------------
468  !---------------------------------- Column numbers ---------------------------------------------
469 
470  ! ---- Set column numbering for SurfaceChar ----------------------------------------------------
471  ! Columns 1:80 are the same as in SiteSelect.txt and defined below
472  INTEGER:: cc !Column counter
473  INTEGER, PARAMETER:: ccendsi = ncolumnssiteselect
474 
475  ! Applicable to each surface
476  INTEGER, DIMENSION(nsurf):: c_albmin = (/(cc, cc=ccendsi + 0*nsurf + 1, ccendsi + 0*nsurf + nsurf, 1)/) !Min. albedo
477  INTEGER, DIMENSION(nsurf):: c_albmax = (/(cc, cc=ccendsi + 1*nsurf + 1, ccendsi + 1*nsurf + nsurf, 1)/) !Max. albedo
478  INTEGER, DIMENSION(nsurf):: c_emis = (/(cc, cc=ccendsi + 2*nsurf + 1, ccendsi + 2*nsurf + nsurf, 1)/) !Emissivity
479  INTEGER, DIMENSION(nsurf):: c_stormin = (/(cc, cc=ccendsi + 3*nsurf + 1, ccendsi + 3*nsurf + nsurf, 1)/) !Min. storage capacity (canopy)
480  INTEGER, DIMENSION(nsurf):: c_stormax = (/(cc, cc=ccendsi + 4*nsurf + 1, ccendsi + 4*nsurf + nsurf, 1)/) !Max. storage capacity (canopy)
481  INTEGER, DIMENSION(nsurf):: c_wetthresh = (/(cc, cc=ccendsi + 5*nsurf + 1, ccendsi + 5*nsurf + nsurf, 1)/) !Threshold for wet evaporation [mm]
482  INTEGER, DIMENSION(nsurf):: c_statelimit = (/(cc, cc=ccendsi + 6*nsurf + 1, ccendsi + 6*nsurf + nsurf, 1)/) !Limit for surface state [mm]
483  INTEGER, DIMENSION(nsurf):: c_dreq = (/(cc, cc=ccendsi + 7*nsurf + 1, ccendsi + 7*nsurf + nsurf, 1)/) !Drainage equation
484  INTEGER, DIMENSION(nsurf):: c_drcoef1 = (/(cc, cc=ccendsi + 8*nsurf + 1, ccendsi + 8*nsurf + nsurf, 1)/) !Drainage coef. 1
485  INTEGER, DIMENSION(nsurf):: c_drcoef2 = (/(cc, cc=ccendsi + 9*nsurf + 1, ccendsi + 9*nsurf + nsurf, 1)/) !Drainage coef. 2
486  INTEGER, DIMENSION(nsurf):: c_soiltcode = (/(cc, cc=ccendsi + 10*nsurf + 1, ccendsi + 10*nsurf + nsurf, 1)/) !Soil type code
487 
488  ! N.B. not included in SUEWS_Water.txt
489  INTEGER, DIMENSION(nsurf):: c_snowlimpat = (/(cc, cc=ccendsi + 11*nsurf + 1, ccendsi + 11*nsurf + nsurf, 1)/) !Snow limit for patchiness
490  ! N.B. currently only in SUEWS_NonVeg.txt
491  INTEGER, DIMENSION(nsurf):: c_snowlimrem = (/(cc, cc=ccendsi + 12*nsurf + 1, ccendsi + 12*nsurf + nsurf, 1)/) !Snow limit for removal
492  ! AnOHM TS
493  INTEGER, DIMENSION(nsurf):: c_cpanohm = (/(cc, cc=ccendsi + 13*nsurf + 1, ccendsi + 13*nsurf + nsurf, 1)/) !heat capacity, AnOHM TS
494  INTEGER, DIMENSION(nsurf):: c_kkanohm = (/(cc, cc=ccendsi + 14*nsurf + 1, ccendsi + 14*nsurf + nsurf, 1)/) !heat conductivity, AnOHM TS
495  INTEGER, DIMENSION(nsurf):: c_chanohm = (/(cc, cc=ccendsi + 15*nsurf + 1, ccendsi + 15*nsurf + nsurf, 1)/) !bulk transfer coef., AnOHM TS
496 
497  ! Find current column number
498  INTEGER, PARAMETER:: ccendi = (ccendsi + 15*nsurf + nsurf) !add columns for AnOHM, AnOHM TS
499 
500  ! Applicable to vegetated surfaces only
501  INTEGER, DIMENSION(NVegSurf):: c_baset = (/(cc, cc=ccendi + 0*nvegsurf + 1, ccendi + 0*nvegsurf + nvegsurf, 1)/) !Base temp. for leaf-on
502  INTEGER, DIMENSION(NVegSurf):: c_basete = (/(cc, cc=ccendi + 1*nvegsurf + 1, ccendi + 1*nvegsurf + nvegsurf, 1)/) !Base temp. for leaf-off
503  INTEGER, DIMENSION(NVegSurf):: c_gddfull = (/(cc, cc=ccendi + 2*nvegsurf + 1, ccendi + 2*nvegsurf + nvegsurf, 1)/) !GDD for full LAI
504  INTEGER, DIMENSION(NVegSurf):: c_sddfull = (/(cc, cc=ccendi + 3*nvegsurf + 1, ccendi + 3*nvegsurf + nvegsurf, 1)/) !SDD for start of leaf-fall
505  INTEGER, DIMENSION(NVegSurf):: c_laimin = (/(cc, cc=ccendi + 4*nvegsurf + 1, ccendi + 4*nvegsurf + nvegsurf, 1)/) !Min. LAI
506  INTEGER, DIMENSION(NVegSurf):: c_laimax = (/(cc, cc=ccendi + 5*nvegsurf + 1, ccendi + 5*nvegsurf + nvegsurf, 1)/) !Max. LAI
507  INTEGER, DIMENSION(NVegSurf):: c_porositymin = (/(cc, cc=ccendi + 6*nvegsurf + 1, ccendi + 6*nvegsurf + nvegsurf, 1)/) !Min. Porosity
508  INTEGER, DIMENSION(NVegSurf):: c_porositymax = (/(cc, cc=ccendi + 7*nvegsurf + 1, ccendi + 7*nvegsurf + nvegsurf, 1)/) !Max. Porosity
509  INTEGER, DIMENSION(NVegSurf):: c_gsmax = (/(cc, cc=ccendi + 8*nvegsurf + 1, ccendi + 8*nvegsurf + nvegsurf, 1)/) !Max. conductance
510  INTEGER, DIMENSION(NVegSurf):: c_laieq = (/(cc, cc=ccendi + 9*nvegsurf + 1, ccendi + 9*nvegsurf + nvegsurf, 1)/) !LAI equation
511  INTEGER, DIMENSION(NVegSurf):: c_leafgp1 = (/(cc, cc=ccendi + 10*nvegsurf + 1, ccendi + 10*nvegsurf + nvegsurf, 1)/) !Leaf growth power 1
512  INTEGER, DIMENSION(NVegSurf):: c_leafgp2 = (/(cc, cc=ccendi + 11*nvegsurf + 1, ccendi + 11*nvegsurf + nvegsurf, 1)/) !Leaf growth power 2
513  INTEGER, DIMENSION(NVegSurf):: c_leafop1 = (/(cc, cc=ccendi + 12*nvegsurf + 1, ccendi + 12*nvegsurf + nvegsurf, 1)/) !Leaf-off power 1
514  INTEGER, DIMENSION(NVegSurf):: c_leafop2 = (/(cc, cc=ccendi + 13*nvegsurf + 1, ccendi + 13*nvegsurf + nvegsurf, 1)/) !Leaf-off power 2
515  INTEGER, DIMENSION(NVegSurf):: c_biogenco2code = (/(cc, cc=ccendi + 14*nvegsurf + 1, ccendi + 14*nvegsurf + nvegsurf, 1)/) !Biogenic CO2 Code
516  ! Find current column number
517  INTEGER, PARAMETER:: ccendp = (ccendi + 14*nvegsurf + nvegsurf)
518 
519  ! Applicable to water surfaces only
520  INTEGER:: c_waterdepth = (ccendp + 1)
521 
522  ! Find current column number
523  INTEGER, PARAMETER:: ccendw = (ccendp + 1)
524 
525  ! Applicable to snow only
526  INTEGER:: c_snowrmfactor = (ccendw + 1)
527  INTEGER:: c_snowtmfactor = (ccendw + 2)
528  INTEGER:: c_snowalbmin = (ccendw + 3)
529  INTEGER:: c_snowalbmax = (ccendw + 4)
530  !integer:: c_SnowAlb = (ccEndW+ 5)
531  INTEGER:: c_snowemis = (ccendw + 6)
532  INTEGER:: c_snowtau_a = (ccendw + 7)
533  INTEGER:: c_snowtau_f = (ccendw + 8)
534  INTEGER:: c_snowplimalb = (ccendw + 9)
535  INTEGER:: c_snowsdmin = (ccendw + 10)
536  INTEGER:: c_snowsdmax = (ccendw + 11)
537  INTEGER:: c_snowtau_r = (ccendw + 12)
538  INTEGER:: c_snowcrwmin = (ccendw + 13)
539  INTEGER:: c_snowcrwmax = (ccendw + 14)
540  INTEGER:: c_snowplimsnow = (ccendw + 15)
541 
542  ! Find current column number
543  INTEGER, PARAMETER:: ccendsn = (ccendw + 15)
544 
545  ! Soil information
546  INTEGER, DIMENSION(nsurf):: c_soildepth = (/(cc, cc=ccendsn + 0*nsurf + 1, ccendsn + 0*nsurf + nsurf, 1)/) ! Volumetric SM capacity
547  INTEGER, DIMENSION(nsurf):: c_soilstcap = (/(cc, cc=ccendsn + 1*nsurf + 1, ccendsn + 1*nsurf + nsurf, 1)/) ! Volumetric SM capacity
548  INTEGER, DIMENSION(nsurf):: c_ksat = (/(cc, cc=ccendsn + 2*nsurf + 1, ccendsn + 2*nsurf + nsurf, 1)/) ! Saturated hydraulic conductivity
549  INTEGER, DIMENSION(nsurf):: c_soildens = (/(cc, cc=ccendsn + 3*nsurf + 1, ccendsn + 3*nsurf + nsurf, 1)/) ! Soil Density
550  INTEGER, DIMENSION(nsurf):: c_soilinfrate = (/(cc, cc=ccendsn + 4*nsurf + 1, ccendsn + 4*nsurf + nsurf, 1)/) ! Soil infiltration rate
551  INTEGER, DIMENSION(nsurf):: c_obssmdepth = (/(cc, cc=ccendsn + 5*nsurf + 1, ccendsn + 5*nsurf + nsurf, 1)/) ! Depth of SM obs
552  INTEGER, DIMENSION(nsurf):: c_obssmmax = (/(cc, cc=ccendsn + 6*nsurf + 1, ccendsn + 6*nsurf + nsurf, 1)/) ! Obs maximum SM [kg kg-1 OR m3 m-3]
553  INTEGER, DIMENSION(nsurf):: c_obssnrfrac = (/(cc, cc=ccendsn + 7*nsurf + 1, ccendsn + 7*nsurf + nsurf, 1)/) ! Obs fraction of soil without rocks
554 
555  ! Find current column number
556  INTEGER, PARAMETER:: ccendso = (ccendsn + 7*nsurf + nsurf)
557 
558  ! Surface conductance
559  INTEGER:: c_gsg1 = (ccendso + 1)
560  INTEGER:: c_gsg2 = (ccendso + 2)
561  INTEGER:: c_gsg3 = (ccendso + 3)
562  INTEGER:: c_gsg4 = (ccendso + 4)
563  INTEGER:: c_gsg5 = (ccendso + 5)
564  INTEGER:: c_gsg6 = (ccendso + 6)
565  INTEGER:: c_gsth = (ccendso + 7)
566  INTEGER:: c_gstl = (ccendso + 8)
567  INTEGER:: c_gss1 = (ccendso + 9)
568  INTEGER:: c_gss2 = (ccendso + 10)
569  INTEGER:: c_gskmax = (ccendso + 11)
570  INTEGER:: c_gsmodel = (ccendso + 12)
571 
572  ! Find current column number
573  INTEGER, PARAMETER:: ccendgs = (ccendso + 12)
574 
575  ! OHM codes
576  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmcode_swet = (/(cc, cc=ccendgs + 0*nsurfincsnow + 1, &
577  ccendgs + 0*nsurfincsnow + nsurfincsnow, 1)/) !OHM code (summer wet)
578  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmcode_sdry = (/(cc, cc=ccendgs + 1*nsurfincsnow + 1, &
579  ccendgs + 1*nsurfincsnow + nsurfincsnow, 1)/) !OHM code (summer dry)
580  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmcode_wwet = (/(cc, cc=ccendgs + 2*nsurfincsnow + 1, &
581  ccendgs + 2*nsurfincsnow + nsurfincsnow, 1)/) !OHM code (winter wet)
582  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmcode_wdry = (/(cc, cc=ccendgs + 3*nsurfincsnow + 1, &
583  ccendgs + 3*nsurfincsnow + nsurfincsnow, 1)/) !OHM code (winter dry)
584  INTEGER, DIMENSION(nsurfIncSnow):: c_a1_swet = (/(cc, cc=ccendgs + 4*nsurfincsnow + 1, &
585  ccendgs + 4*nsurfincsnow + nsurfincsnow, 1)/) !OHM a1 (summer wet)
586  INTEGER, DIMENSION(nsurfIncSnow):: c_a2_swet = (/(cc, cc=ccendgs + 5*nsurfincsnow + 1, &
587  ccendgs + 5*nsurfincsnow + nsurfincsnow, 1)/) !OHM a2 (summer wet)
588  INTEGER, DIMENSION(nsurfIncSnow):: c_a3_swet = (/(cc, cc=ccendgs + 6*nsurfincsnow + 1, &
589  ccendgs + 6*nsurfincsnow + nsurfincsnow, 1)/) !OHM a3 (summer wet)
590  INTEGER, DIMENSION(nsurfIncSnow):: c_a1_sdry = (/(cc, cc=ccendgs + 7*nsurfincsnow + 1, &
591  ccendgs + 7*nsurfincsnow + nsurfincsnow, 1)/) !OHM a1 (summer dry)
592  INTEGER, DIMENSION(nsurfIncSnow):: c_a2_sdry = (/(cc, cc=ccendgs + 8*nsurfincsnow + 1, &
593  ccendgs + 8*nsurfincsnow + nsurfincsnow, 1)/) !OHM a2 (summer dry)
594  INTEGER, DIMENSION(nsurfIncSnow):: c_a3_sdry = (/(cc, cc=ccendgs + 9*nsurfincsnow + 1, &
595  ccendgs + 9*nsurfincsnow + nsurfincsnow, 1)/) !OHM a3 (summer dry)
596  INTEGER, DIMENSION(nsurfIncSnow):: c_a1_wwet = (/(cc, cc=ccendgs + 10*nsurfincsnow + 1, &
597  ccendgs + 10*nsurfincsnow + nsurfincsnow, 1)/) !OHM a1 (winter wet)
598  INTEGER, DIMENSION(nsurfIncSnow):: c_a2_wwet = (/(cc, cc=ccendgs + 11*nsurfincsnow + 1, &
599  ccendgs + 11*nsurfincsnow + nsurfincsnow, 1)/) !OHM a2 (winter wet)
600  INTEGER, DIMENSION(nsurfIncSnow):: c_a3_wwet = (/(cc, cc=ccendgs + 12*nsurfincsnow + 1, &
601  ccendgs + 12*nsurfincsnow + nsurfincsnow, 1)/) !OHM a3 (winter wet)
602  INTEGER, DIMENSION(nsurfIncSnow):: c_a1_wdry = (/(cc, cc=ccendgs + 13*nsurfincsnow + 1, &
603  ccendgs + 13*nsurfincsnow + nsurfincsnow, 1)/) !OHM a1 (winter dry)
604  INTEGER, DIMENSION(nsurfIncSnow):: c_a2_wdry = (/(cc, cc=ccendgs + 14*nsurfincsnow + 1, &
605  ccendgs + 14*nsurfincsnow + nsurfincsnow, 1)/) !OHM a2 (winter dry)
606  INTEGER, DIMENSION(nsurfIncSnow):: c_a3_wdry = (/(cc, cc=ccendgs + 15*nsurfincsnow + 1, &
607  ccendgs + 15*nsurfincsnow + nsurfincsnow, 1)/) !OHM a3 (winter dry)
608 
609  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmthresh_sw = (/(cc, cc=ccendgs + 16*nsurfincsnow + 1, &
610  ccendgs + 16*nsurfincsnow + nsurfincsnow, 1)/) !OHM Threshold (summer/winter)
611  INTEGER, DIMENSION(nsurfIncSnow):: c_ohmthresh_wd = (/(cc, cc=ccendgs + 17*nsurfincsnow + 1, &
612  ccendgs + 17*nsurfincsnow + nsurfincsnow, 1)/) !OHM Threshold (wet/dry)
613 
614  ! ESTM code for each surface inclduing snow
615  INTEGER, DIMENSION(nsurfIncSnow):: c_estmcode = (/(cc, cc=ccendgs + 18*nsurfincsnow + 1, &
616  ccendgs + 18*nsurfincsnow + nsurfincsnow, 1)/) !ESTM code
617 
618  ! Find current column number
619  INTEGER, PARAMETER:: ccendo = (ccendgs + 18*nsurfincsnow + nsurfincsnow)
620 
621  ! Anthropogenic Emissions
622  INTEGER :: c_basethdd = (ccendo + 1)
623  INTEGER :: c_qf_a1 = (ccendo + 2)
624  INTEGER :: c_qf_b1 = (ccendo + 3)
625  INTEGER :: c_qf_c1 = (ccendo + 4)
626  INTEGER :: c_qf_a2 = (ccendo + 5)
627  INTEGER :: c_qf_b2 = (ccendo + 6)
628  INTEGER :: c_qf_c2 = (ccendo + 7)
629  INTEGER :: c_ahmin_wd = (ccendo + 8)
630  INTEGER :: c_ahmin_we = (ccendo + 9)
631  INTEGER :: c_ahslopeheating_wd = (ccendo + 10)
632  INTEGER :: c_ahslopeheating_we = (ccendo + 11)
633  INTEGER :: c_ahslopecooling_wd = (ccendo + 12)
634  INTEGER :: c_ahslopecooling_we = (ccendo + 13)
635  INTEGER :: c_tcriticheating_we = (ccendo + 14)
636  INTEGER :: c_tcriticheating_wd = (ccendo + 15)
637  INTEGER :: c_tcriticcooling_we = (ccendo + 16)
638  INTEGER :: c_tcriticcooling_wd = (ccendo + 17)
639  INTEGER :: c_enprofwd = (ccendo + 18)
640  INTEGER :: c_enprofwe = (ccendo + 19)
641  INTEGER :: c_co2mwd = (ccendo + 20)
642  INTEGER :: c_co2mwe = (ccendo + 21)
643  INTEGER :: c_traffprofwd = (ccendo + 22)
644  INTEGER :: c_traffprofwe = (ccendo + 23)
645  INTEGER :: c_popprofwd = (ccendo + 24)
646  INTEGER :: c_popprofwe = (ccendo + 25)
647  INTEGER :: c_minqfmetab = (ccendo + 26)
648  INTEGER :: c_maxqfmetab = (ccendo + 27)
649  INTEGER :: c_minfcmetab = (ccendo + 28)
650  INTEGER :: c_maxfcmetab = (ccendo + 29)
651  INTEGER :: c_frpddwe = (ccendo + 30)
652  INTEGER :: c_frfossilfuel_heat = (ccendo + 31)
653  INTEGER :: c_frfossilfuel_nonheat = (ccendo + 32)
654  INTEGER :: c_ef_umolco2perj = (ccendo + 33)
655  INTEGER :: c_enef_v_jkm = (ccendo + 34)
656  INTEGER :: c_fcef_v_kgkmwd = (ccendo + 35)
657  INTEGER :: c_fcef_v_kgkmwe = (ccendo + 36)
658  INTEGER :: c_co2pointsource = (ccendo + 37)
659  INTEGER :: c_trafficunits = (ccendo + 38)
660 
661  ! Find current column number
662  INTEGER, PARAMETER:: ccenda = (ccendo + 38)
663 
664  ! Irrigation
665  INTEGER :: c_iestart = (ccenda + 1)
666  INTEGER :: c_ieend = (ccenda + 2)
667  INTEGER :: c_intwu = (ccenda + 3)
668  INTEGER :: c_faut = (ccenda + 4)
669  INTEGER, DIMENSION(3):: c_ie_a = (/(cc, cc=ccenda + 4 + 0*3 + 1, ccenda + 4 + 0*3 + 3, 1)/) ! Automatic irrigation coeffs
670  INTEGER, DIMENSION(3):: c_ie_m = (/(cc, cc=ccenda + 4 + 1*3 + 1, ccenda + 4 + 1*3 + 3, 1)/) ! Manual irrigation coeffs
671  INTEGER, DIMENSION(7):: c_daywat = (/(cc, cc=ccenda + 10 + 0*7 + 1, ccenda + 10 + 0*7 + 7, 1)/) ! Irrigation allowed on each day
672  INTEGER, DIMENSION(7):: c_daywatper = (/(cc, cc=ccenda + 10 + 1*7 + 1, ccenda + 10 + 1*7 + 7, 1)/) ! Fraction properties using irrigation allowed on each day
673 
674  ! Find current column number
675  INTEGER, PARAMETER:: ccendir = (ccenda + 10 + 1*7 + 7)
676 
677  ! Hourly profiles
678  INTEGER, DIMENSION(24):: c_hrprofenusewd = (/(cc, cc=ccendir + 0*24 + 1, ccendir + 0*24 + 24, 1)/) ! Energy use, weekdays
679  INTEGER, DIMENSION(24):: c_hrprofenusewe = (/(cc, cc=ccendir + 1*24 + 1, ccendir + 1*24 + 24, 1)/) ! Energy use, weekends
680  INTEGER, DIMENSION(24):: c_hrprofwumanuwd = (/(cc, cc=ccendir + 2*24 + 1, ccendir + 2*24 + 24, 1)/) ! Water use, manual, weekdays
681  INTEGER, DIMENSION(24):: c_hrprofwumanuwe = (/(cc, cc=ccendir + 3*24 + 1, ccendir + 3*24 + 24, 1)/) ! Water use, manual, weekends
682  INTEGER, DIMENSION(24):: c_hrprofwuautowd = (/(cc, cc=ccendir + 4*24 + 1, ccendir + 4*24 + 24, 1)/) ! Water use, automatic, weekdays
683  INTEGER, DIMENSION(24):: c_hrprofwuautowe = (/(cc, cc=ccendir + 5*24 + 1, ccendir + 5*24 + 24, 1)/) ! Water use, automatic, weekends
684  INTEGER, DIMENSION(24):: c_hrprofsnowcwd = (/(cc, cc=ccendir + 6*24 + 1, ccendir + 6*24 + 24, 1)/) ! Snow clearing, weekdays
685  INTEGER, DIMENSION(24):: c_hrprofsnowcwe = (/(cc, cc=ccendir + 7*24 + 1, ccendir + 7*24 + 24, 1)/) ! Snow clearing, weekends
686  INTEGER, DIMENSION(24):: c_hrprofhumactivitywd = (/(cc, cc=ccendir + 8*24 + 1, ccendir + 8*24 + 24, 1)/) ! Human activity, weekdays
687  INTEGER, DIMENSION(24):: c_hrprofhumactivitywe = (/(cc, cc=ccendir + 9*24 + 1, ccendir + 9*24 + 24, 1)/) ! Human activity, weekends
688  INTEGER, DIMENSION(24):: c_hrproftraffwd = (/(cc, cc=ccendir + 10*24 + 1, ccendir + 10*24 + 24, 1)/) ! Traffic, weekdays
689  INTEGER, DIMENSION(24):: c_hrproftraffwe = (/(cc, cc=ccendir + 11*24 + 1, ccendir + 11*24 + 24, 1)/) ! Traffic, weekends
690  INTEGER, DIMENSION(24):: c_hrprofpopwd = (/(cc, cc=ccendir + 12*24 + 1, ccendir + 12*24 + 24, 1)/) ! Population, weekdays
691  INTEGER, DIMENSION(24):: c_hrprofpopwe = (/(cc, cc=ccendir + 13*24 + 1, ccendir + 13*24 + 24, 1)/) ! Population, weekends
692 
693  ! Find current column number
694  INTEGER, PARAMETER:: ccendpr = (ccendir + 13*24 + 24)
695 
696  ! Within-grid water distribution (for each surface)
697  INTEGER, DIMENSION(nsurf):: c_wgtopaved = (/(cc, cc=ccendpr + 0*nsurf + 1, ccendpr + 0*nsurf + nsurf, 1)/) !Water dist to Paved
698  INTEGER, DIMENSION(nsurf):: c_wgtobldgs = (/(cc, cc=ccendpr + 1*nsurf + 1, ccendpr + 1*nsurf + nsurf, 1)/) !Water dist to Bldgs
699  INTEGER, DIMENSION(nsurf):: c_wgtoevetr = (/(cc, cc=ccendpr + 2*nsurf + 1, ccendpr + 2*nsurf + nsurf, 1)/) !Water dist to EveTr
700  INTEGER, DIMENSION(nsurf):: c_wgtodectr = (/(cc, cc=ccendpr + 3*nsurf + 1, ccendpr + 3*nsurf + nsurf, 1)/) !Water dist to DecTr
701  INTEGER, DIMENSION(nsurf):: c_wgtograss = (/(cc, cc=ccendpr + 4*nsurf + 1, ccendpr + 4*nsurf + nsurf, 1)/) !Water dist to Grass
702  INTEGER, DIMENSION(nsurf):: c_wgtobsoil = (/(cc, cc=ccendpr + 5*nsurf + 1, ccendpr + 5*nsurf + nsurf, 1)/) !Water dist to BSoil
703  INTEGER, DIMENSION(nsurf):: c_wgtowater = (/(cc, cc=ccendpr + 6*nsurf + 1, ccendpr + 6*nsurf + nsurf, 1)/) !Water dist to Water
704  INTEGER, DIMENSION(nsurf):: c_wgtorunoff = (/(cc, cc=ccendpr + 7*nsurf + 1, ccendpr + 7*nsurf + nsurf, 1)/) !Water dist to runoff
705  INTEGER, DIMENSION(nsurf):: c_wgtosoilstore = (/(cc, cc=ccendpr + 8*nsurf + 1, ccendpr + 8*nsurf + nsurf, 1)/) !Water dist to sub-surface soil
706 
707  ! Find current column number
708  INTEGER, PARAMETER:: cbendwg = (ccendpr + 8*nsurf + nsurf)
709 
710  ! Biogenic CO2
711  INTEGER, DIMENSION(nvegsurf):: c_alpha_bioco2 = (/(cc, cc=cbendwg + 0*nvegsurf + 1, cbendwg + 0*nvegsurf + nvegsurf, 1)/)
712  INTEGER, DIMENSION(nvegsurf):: c_beta_bioco2 = (/(cc, cc=cbendwg + 1*nvegsurf + 1, cbendwg + 1*nvegsurf + nvegsurf, 1)/)
713  INTEGER, DIMENSION(nvegsurf):: c_theta_bioco2 = (/(cc, cc=cbendwg + 2*nvegsurf + 1, cbendwg + 2*nvegsurf + nvegsurf, 1)/)
714  INTEGER, DIMENSION(nvegsurf):: c_alpha_enh_bioco2 = (/(cc, cc=cbendwg + 3*nvegsurf + 1, cbendwg + 3*nvegsurf + nvegsurf, 1)/)
715  INTEGER, DIMENSION(nvegsurf):: c_beta_enh_bioco2 = (/(cc, cc=cbendwg + 4*nvegsurf + 1, cbendwg + 4*nvegsurf + nvegsurf, 1)/)
716  INTEGER, DIMENSION(nvegsurf):: c_resp_a = (/(cc, cc=cbendwg + 5*nvegsurf + 1, cbendwg + 5*nvegsurf + nvegsurf, 1)/)
717  INTEGER, DIMENSION(nvegsurf):: c_resp_b = (/(cc, cc=cbendwg + 6*nvegsurf + 1, cbendwg + 6*nvegsurf + nvegsurf, 1)/)
718  INTEGER, DIMENSION(nvegsurf):: c_min_res_bioco2 = (/(cc, cc=cbendwg + 7*nvegsurf + 1, cbendwg + 7*nvegsurf + nvegsurf, 1)/)
719 
720  ! Find current column number
721  INTEGER, PARAMETER:: ccendb = (cbendwg + 7*nvegsurf + nvegsurf)
722 
723  !ESTM
724  ! Roof/surface characteristics for all surfaces including snow
725  INTEGER, DIMENSION(nsurfIncSnow) :: &
727  c_surf_k1 = [(cc, cc=ccendb + 1*nsurfincsnow + 1, ccendb + 1*nsurfincsnow + nsurfincsnow, 1)], &
730  c_surf_k2 = [(cc, cc=ccendb + 4*nsurfincsnow + 1, ccendb + 4*nsurfincsnow + nsurfincsnow, 1)], &
733  c_surf_k3 = [(cc, cc=ccendb + 7*nsurfincsnow + 1, ccendb + 7*nsurfincsnow + nsurfincsnow, 1)], &
736  c_surf_k4 = [(cc, cc=ccendb + 10*nsurfincsnow + 1, ccendb + 10*nsurfincsnow + nsurfincsnow, 1)], &
737  c_surf_rhocp4 = [(cc, cc=ccendb + 11*nsurfincsnow + 1, ccendb + 11*nsurfincsnow + nsurfincsnow, 1)], &
738  c_surf_thick5 = [(cc, cc=ccendb + 12*nsurfincsnow + 1, ccendb + 12*nsurfincsnow + nsurfincsnow, 1)], &
739  c_surf_k5 = [(cc, cc=ccendb + 13*nsurfincsnow + 1, ccendb + 13*nsurfincsnow + nsurfincsnow, 1)], &
741  ! Find current column number
742  INTEGER, PARAMETER:: ccendestmb = (ccendb + 14*nsurfincsnow + nsurfincsnow)
743  ! Other ESTM characteristics are for built surfaces only
744  INTEGER:: c_wall_thick1 = (ccendestmb + 1)
745  INTEGER:: c_wall_k1 = (ccendestmb + 2)
746  INTEGER:: c_wall_rhocp1 = (ccendestmb + 3)
747  INTEGER:: c_wall_thick2 = (ccendestmb + 4)
748  INTEGER:: c_wall_k2 = (ccendestmb + 5)
749  INTEGER:: c_wall_rhocp2 = (ccendestmb + 6)
750  INTEGER:: c_wall_thick3 = (ccendestmb + 7)
751  INTEGER:: c_wall_k3 = (ccendestmb + 8)
752  INTEGER:: c_wall_rhocp3 = (ccendestmb + 9)
753  INTEGER:: c_wall_thick4 = (ccendestmb + 10)
754  INTEGER:: c_wall_k4 = (ccendestmb + 11)
755  INTEGER:: c_wall_rhocp4 = (ccendestmb + 12)
756  INTEGER:: c_wall_thick5 = (ccendestmb + 13)
757  INTEGER:: c_wall_k5 = (ccendestmb + 14)
758  INTEGER:: c_wall_rhocp5 = (ccendestmb + 15)
759  INTEGER:: c_internal_thick1 = (ccendestmb + 16)
760  INTEGER:: c_internal_k1 = (ccendestmb + 17)
761  INTEGER:: c_internal_rhocp1 = (ccendestmb + 18)
762  INTEGER:: c_internal_thick2 = (ccendestmb + 19)
763  INTEGER:: c_internal_k2 = (ccendestmb + 20)
764  INTEGER:: c_internal_rhocp2 = (ccendestmb + 21)
765  INTEGER:: c_internal_thick3 = (ccendestmb + 22)
766  INTEGER:: c_internal_k3 = (ccendestmb + 23)
767  INTEGER:: c_internal_rhocp3 = (ccendestmb + 24)
768  INTEGER:: c_internal_thick4 = (ccendestmb + 25)
769  INTEGER:: c_internal_k4 = (ccendestmb + 26)
770  INTEGER:: c_internal_rhocp4 = (ccendestmb + 27)
771  INTEGER:: c_internal_thick5 = (ccendestmb + 28)
772  INTEGER:: c_internal_k5 = (ccendestmb + 29)
773  INTEGER:: c_internal_rhocp5 = (ccendestmb + 30)
774  INTEGER:: c_nroom = (ccendestmb + 31)
775  INTEGER:: c_alb_ibld = (ccendestmb + 32)
776  INTEGER:: c_em_ibld = (ccendestmb + 33)
777  INTEGER:: c_ch_iwall = (ccendestmb + 34)
778  INTEGER:: c_ch_iroof = (ccendestmb + 35)
779  INTEGER:: c_ch_ibld = (ccendestmb + 36)
780  ! Find current column number
781  INTEGER, PARAMETER:: ccendestmm = (ccendestmb + 36)
782  ! For Paved surfaces, there are 3 possible ESTM classes (with _Surf characteristics only)
783  INTEGER, DIMENSION(3):: c_surf_thick1_paved = (/(cc, cc=ccendestmm + 0*3 + 1, ccendestmm + 0*3 + 3, 1)/)
784  INTEGER, DIMENSION(3):: c_surf_k1_paved = (/(cc, cc=ccendestmm + 1*3 + 1, ccendestmm + 1*3 + 3, 1)/)
785  INTEGER, DIMENSION(3):: c_surf_rhocp1_paved = (/(cc, cc=ccendestmm + 2*3 + 1, ccendestmm + 2*3 + 3, 1)/)
786  INTEGER, DIMENSION(3):: c_surf_thick2_paved = (/(cc, cc=ccendestmm + 3*3 + 1, ccendestmm + 3*3 + 3, 1)/)
787  INTEGER, DIMENSION(3):: c_surf_k2_paved = (/(cc, cc=ccendestmm + 4*3 + 1, ccendestmm + 4*3 + 3, 1)/)
788  INTEGER, DIMENSION(3):: c_surf_rhocp2_paved = (/(cc, cc=ccendestmm + 5*3 + 1, ccendestmm + 5*3 + 3, 1)/)
789  INTEGER, DIMENSION(3):: c_surf_thick3_paved = (/(cc, cc=ccendestmm + 6*3 + 1, ccendestmm + 6*3 + 3, 1)/)
790  INTEGER, DIMENSION(3):: c_surf_k3_paved = (/(cc, cc=ccendestmm + 7*3 + 1, ccendestmm + 7*3 + 3, 1)/)
791  INTEGER, DIMENSION(3):: c_surf_rhocp3_paved = (/(cc, cc=ccendestmm + 8*3 + 1, ccendestmm + 8*3 + 3, 1)/)
792  INTEGER, DIMENSION(3):: c_surf_thick4_paved = (/(cc, cc=ccendestmm + 9*3 + 1, ccendestmm + 9*3 + 3, 1)/)
793  INTEGER, DIMENSION(3):: c_surf_k4_paved = (/(cc, cc=ccendestmm + 10*3 + 1, ccendestmm + 10*3 + 3, 1)/)
794  INTEGER, DIMENSION(3):: c_surf_rhocp4_paved = (/(cc, cc=ccendestmm + 11*3 + 1, ccendestmm + 11*3 + 3, 1)/)
795  INTEGER, DIMENSION(3):: c_surf_thick5_paved = (/(cc, cc=ccendestmm + 12*3 + 1, ccendestmm + 12*3 + 3, 1)/)
796  INTEGER, DIMENSION(3):: c_surf_k5_paved = (/(cc, cc=ccendestmm + 13*3 + 1, ccendestmm + 13*3 + 3, 1)/)
797  INTEGER, DIMENSION(3):: c_surf_rhocp5_paved = (/(cc, cc=ccendestmm + 14*3 + 1, ccendestmm + 14*3 + 3, 1)/)
798  ! Find current column number
799  INTEGER, PARAMETER:: ccendestmmp = (ccendestmm + 14*3 + 3)
800  ! For Bldgs surfaces, there are 5 possible ESTM classes (all characteristics)
801  INTEGER, DIMENSION(5):: c_surf_thick1_bldgs = (/(cc, cc=ccendestmmp + 0*5 + 1, ccendestmmp + 0*5 + 5, 1)/)
802  INTEGER, DIMENSION(5):: c_surf_k1_bldgs = (/(cc, cc=ccendestmmp + 1*5 + 1, ccendestmmp + 1*5 + 5, 1)/)
803  INTEGER, DIMENSION(5):: c_surf_rhocp1_bldgs = (/(cc, cc=ccendestmmp + 2*5 + 1, ccendestmmp + 2*5 + 5, 1)/)
804  INTEGER, DIMENSION(5):: c_surf_thick2_bldgs = (/(cc, cc=ccendestmmp + 3*5 + 1, ccendestmmp + 3*5 + 5, 1)/)
805  INTEGER, DIMENSION(5):: c_surf_k2_bldgs = (/(cc, cc=ccendestmmp + 4*5 + 1, ccendestmmp + 4*5 + 5, 1)/)
806  INTEGER, DIMENSION(5):: c_surf_rhocp2_bldgs = (/(cc, cc=ccendestmmp + 5*5 + 1, ccendestmmp + 5*5 + 5, 1)/)
807  INTEGER, DIMENSION(5):: c_surf_thick3_bldgs = (/(cc, cc=ccendestmmp + 6*5 + 1, ccendestmmp + 6*5 + 5, 1)/)
808  INTEGER, DIMENSION(5):: c_surf_k3_bldgs = (/(cc, cc=ccendestmmp + 7*5 + 1, ccendestmmp + 7*5 + 5, 1)/)
809  INTEGER, DIMENSION(5):: c_surf_rhocp3_bldgs = (/(cc, cc=ccendestmmp + 8*5 + 1, ccendestmmp + 8*5 + 5, 1)/)
810  INTEGER, DIMENSION(5):: c_surf_thick4_bldgs = (/(cc, cc=ccendestmmp + 9*5 + 1, ccendestmmp + 9*5 + 5, 1)/)
811  INTEGER, DIMENSION(5):: c_surf_k4_bldgs = (/(cc, cc=ccendestmmp + 10*5 + 1, ccendestmmp + 10*5 + 5, 1)/)
812  INTEGER, DIMENSION(5):: c_surf_rhocp4_bldgs = (/(cc, cc=ccendestmmp + 11*5 + 1, ccendestmmp + 11*5 + 5, 1)/)
813  INTEGER, DIMENSION(5):: c_surf_thick5_bldgs = (/(cc, cc=ccendestmmp + 12*5 + 1, ccendestmmp + 12*5 + 5, 1)/)
814  INTEGER, DIMENSION(5):: c_surf_k5_bldgs = (/(cc, cc=ccendestmmp + 13*5 + 1, ccendestmmp + 13*5 + 5, 1)/)
815  INTEGER, DIMENSION(5):: c_surf_rhocp5_bldgs = (/(cc, cc=ccendestmmp + 14*5 + 1, ccendestmmp + 14*5 + 5, 1)/)
816  INTEGER, DIMENSION(5):: c_wall_thick1_bldgs = (/(cc, cc=ccendestmmp + 15*5 + 1, ccendestmmp + 15*5 + 5, 1)/)
817  INTEGER, DIMENSION(5):: c_wall_k1_bldgs = (/(cc, cc=ccendestmmp + 16*5 + 1, ccendestmmp + 16*5 + 5, 1)/)
818  INTEGER, DIMENSION(5):: c_wall_rhocp1_bldgs = (/(cc, cc=ccendestmmp + 17*5 + 1, ccendestmmp + 17*5 + 5, 1)/)
819  INTEGER, DIMENSION(5):: c_wall_thick2_bldgs = (/(cc, cc=ccendestmmp + 18*5 + 1, ccendestmmp + 18*5 + 5, 1)/)
820  INTEGER, DIMENSION(5):: c_wall_k2_bldgs = (/(cc, cc=ccendestmmp + 19*5 + 1, ccendestmmp + 19*5 + 5, 1)/)
821  INTEGER, DIMENSION(5):: c_wall_rhocp2_bldgs = (/(cc, cc=ccendestmmp + 20*5 + 1, ccendestmmp + 20*5 + 5, 1)/)
822  INTEGER, DIMENSION(5):: c_wall_thick3_bldgs = (/(cc, cc=ccendestmmp + 21*5 + 1, ccendestmmp + 21*5 + 5, 1)/)
823  INTEGER, DIMENSION(5):: c_wall_k3_bldgs = (/(cc, cc=ccendestmmp + 22*5 + 1, ccendestmmp + 22*5 + 5, 1)/)
824  INTEGER, DIMENSION(5):: c_wall_rhocp3_bldgs = (/(cc, cc=ccendestmmp + 23*5 + 1, ccendestmmp + 23*5 + 5, 1)/)
825  INTEGER, DIMENSION(5):: c_wall_thick4_bldgs = (/(cc, cc=ccendestmmp + 24*5 + 1, ccendestmmp + 24*5 + 5, 1)/)
826  INTEGER, DIMENSION(5):: c_wall_k4_bldgs = (/(cc, cc=ccendestmmp + 25*5 + 1, ccendestmmp + 25*5 + 5, 1)/)
827  INTEGER, DIMENSION(5):: c_wall_rhocp4_bldgs = (/(cc, cc=ccendestmmp + 26*5 + 1, ccendestmmp + 26*5 + 5, 1)/)
828  INTEGER, DIMENSION(5):: c_wall_thick5_bldgs = (/(cc, cc=ccendestmmp + 27*5 + 1, ccendestmmp + 27*5 + 5, 1)/)
829  INTEGER, DIMENSION(5):: c_wall_k5_bldgs = (/(cc, cc=ccendestmmp + 28*5 + 1, ccendestmmp + 28*5 + 5, 1)/)
830  INTEGER, DIMENSION(5):: c_wall_rhocp5_bldgs = (/(cc, cc=ccendestmmp + 29*5 + 1, ccendestmmp + 29*5 + 5, 1)/)
831  INTEGER, DIMENSION(5):: c_internal_thick1_bldgs = (/(cc, cc=ccendestmmp + 30*5 + 1, ccendestmmp + 30*5 + 5, 1)/)
832  INTEGER, DIMENSION(5):: c_internal_k1_bldgs = (/(cc, cc=ccendestmmp + 31*5 + 1, ccendestmmp + 31*5 + 5, 1)/)
833  INTEGER, DIMENSION(5):: c_internal_rhocp1_bldgs = (/(cc, cc=ccendestmmp + 32*5 + 1, ccendestmmp + 32*5 + 5, 1)/)
834  INTEGER, DIMENSION(5):: c_internal_thick2_bldgs = (/(cc, cc=ccendestmmp + 33*5 + 1, ccendestmmp + 33*5 + 5, 1)/)
835  INTEGER, DIMENSION(5):: c_internal_k2_bldgs = (/(cc, cc=ccendestmmp + 34*5 + 1, ccendestmmp + 34*5 + 5, 1)/)
836  INTEGER, DIMENSION(5):: c_internal_rhocp2_bldgs = (/(cc, cc=ccendestmmp + 35*5 + 1, ccendestmmp + 35*5 + 5, 1)/)
837  INTEGER, DIMENSION(5):: c_internal_thick3_bldgs = (/(cc, cc=ccendestmmp + 36*5 + 1, ccendestmmp + 36*5 + 5, 1)/)
838  INTEGER, DIMENSION(5):: c_internal_k3_bldgs = (/(cc, cc=ccendestmmp + 37*5 + 1, ccendestmmp + 37*5 + 5, 1)/)
839  INTEGER, DIMENSION(5):: c_internal_rhocp3_bldgs = (/(cc, cc=ccendestmmp + 38*5 + 1, ccendestmmp + 38*5 + 5, 1)/)
840  INTEGER, DIMENSION(5):: c_internal_thick4_bldgs = (/(cc, cc=ccendestmmp + 39*5 + 1, ccendestmmp + 39*5 + 5, 1)/)
841  INTEGER, DIMENSION(5):: c_internal_k4_bldgs = (/(cc, cc=ccendestmmp + 40*5 + 1, ccendestmmp + 40*5 + 5, 1)/)
842  INTEGER, DIMENSION(5):: c_internal_rhocp4_bldgs = (/(cc, cc=ccendestmmp + 41*5 + 1, ccendestmmp + 41*5 + 5, 1)/)
843  INTEGER, DIMENSION(5):: c_internal_thick5_bldgs = (/(cc, cc=ccendestmmp + 42*5 + 1, ccendestmmp + 42*5 + 5, 1)/)
844  INTEGER, DIMENSION(5):: c_internal_k5_bldgs = (/(cc, cc=ccendestmmp + 43*5 + 1, ccendestmmp + 43*5 + 5, 1)/)
845  INTEGER, DIMENSION(5):: c_internal_rhocp5_bldgs = (/(cc, cc=ccendestmmp + 44*5 + 1, ccendestmmp + 44*5 + 5, 1)/)
846  INTEGER, DIMENSION(5):: c_nroom_bldgs = (ccendestmmp + 44*5 + 5 + 1)
847  INTEGER, DIMENSION(5):: c_alb_ibld_bldgs = (ccendestmmp + 44*5 + 5 + 2)
848  INTEGER, DIMENSION(5):: c_em_ibld_bldgs = (ccendestmmp + 44*5 + 5 + 3)
849  INTEGER, DIMENSION(5):: c_ch_iwall_bldgs = (ccendestmmp + 44*5 + 5 + 4)
850  INTEGER, DIMENSION(5):: c_ch_iroof_bldgs = (ccendestmmp + 44*5 + 5 + 5)
851  INTEGER, DIMENSION(5):: c_ch_ibld_bldgs = (ccendestmmp + 44*5 + 5 + 6)
852 
853  !Last column number for SurfaceChar array
854  INTEGER, PARAMETER:: maxncols_c = (ccendestmmp + 44*5 + 5 + 6)
855  !-----------------------------------------------------------------------------------------------
856 
857  ! ---- Set column numbering for ModelOutputData ------------------------------------------------
858  ! Applicable to each surface
859  INTEGER, PARAMETER:: ccmod = 32
860  INTEGER, DIMENSION(nsurf):: cmod_state = (/(cc, cc=ccmod + 0*nsurf + 1, ccmod + 0*nsurf + nsurf, 1)/) !Above ground state
861  INTEGER, DIMENSION(nsurf):: cmod_soilstate = (/(cc, cc=ccmod + 1*nsurf + 1, ccmod + 1*nsurf + nsurf, 1)/) !Below ground state (soil store)
862  INTEGER, DIMENSION(nsurf):: cmod_snowwaterstate = (/(cc, cc=ccmod + 2*nsurf + 1, ccmod + 2*nsurf + nsurf, 1)/) !Liquid (melted) water
863  INTEGER, DIMENSION(nsurf):: cmod_snowpack = (/(cc, cc=ccmod + 3*nsurf + 1, ccmod + 3*nsurf + nsurf, 1)/) !SWE
864  INTEGER, DIMENSION(nsurf):: cmod_snowfrac = (/(cc, cc=ccmod + 4*nsurf + 1, ccmod + 4*nsurf + nsurf, 1)/) !Snow fraction
865  INTEGER, DIMENSION(nsurf):: cmod_snowdens = (/(cc, cc=ccmod + 5*nsurf + 1, ccmod + 5*nsurf + nsurf, 1)/) !Snow density
866 
867  !Last column number for ModelOutputData array
868  INTEGER, PARAMETER:: maxncols_cmod = ccmod + 5*nsurf + nsurf
869  !-----------------------------------------------------------------------------------------------
870 
871  ! ---- Set column numbering for ModelDailyState ------------------------------------------------
872  ! Applicable to each surface
873  INTEGER, PARAMETER:: ccmds = 30
874  INTEGER, DIMENSION(nsurf):: cmds_snowdens = (/(cc, cc=ccmds + 0*nsurf + 1, ccmds + 0*nsurf + nsurf, 1)/) !Snow density
875 
876  !Last column number for ModelDailyState array
877  INTEGER, PARAMETER:: maxncols_cmds = ccmds + 0*nsurf + nsurf
878  !-----------------------------------------------------------------------------------------------
879 
880  ! ---- Set column numbering for ESTM_Ts_data input file ===-------------------------------------
881  ! HCW 15 June 2016
882  INTEGER, PARAMETER:: cts_iy = 1
883  INTEGER, PARAMETER:: cts_id = 2
884  INTEGER, PARAMETER:: cts_it = 3
885  INTEGER, PARAMETER:: cts_imin = 4
886  INTEGER, PARAMETER:: cts_tiair = 5
887  INTEGER, PARAMETER:: cts_tsurf = 6
888  INTEGER, PARAMETER:: cts_troof = 7
889  INTEGER, PARAMETER:: cts_troad = 8
890  INTEGER, PARAMETER:: cts_twall = 9
891  INTEGER, PARAMETER:: cts_twall_n = 10
892  INTEGER, PARAMETER:: cts_twall_e = 11
893  INTEGER, PARAMETER:: cts_twall_s = 12
894  INTEGER, PARAMETER:: cts_twall_w = 13
895 
896 END MODULE allocatearray
897 !==================================================================================================
898 
899 !==================================================================================================
900 MODULE initial
901 
902  IMPLICIT NONE
903 
904  INTEGER::firstyear, & !First year to run (specified in SiteSelect.txt)
905  lastyear, & !Last year to run (specified in SiteSelect.txt)
906  firstgrid, & !First grid to run (as in SiteSelect)
907  lastgrid, & !Last grid to run (as in SiteSelect)
908  numberofgrids, & !Number of grids
909  gridcounter, & !Counter for grids (i.e. from 1 to NumberOfGrids)
910  readblocksmetdata, & !Number of blocks of met data to read (for each grid, for each year)
911  readblocksorigmetdata, & !Number of blocks of original met data to read (for each grid, for each year)
912  readlinesmetdata, & !Number of lines of met data in each block (for each grid)
913  readlinesorigmetdata, & !Number of lines of original met data in each block (before downscaling)
914  readlinesorigestmdata, & !Number of lines of original ESTM data in each block (before downscaling)
915  readlinesorigmetdatamax, & !No. lines of original met data in each block (adjusts for last block (equivalent of irMax))
916  readlinesorigestmdatamax, & !No. lines of original ESTM data in each block
917  nlinesorigmetdata, & !Number of lines in original met data file
918  nlinesorigestmdata, & !Number of lines in original ESTM data file
919  nlinesmetdata, & !Number of lines in Met Forcing file
920  nlinesestmdata, & !Number of lines in ESTM Forcing file
921  nlinessiteselect, & !Number of lines in SUEWS_SiteSelect.txt
922  nlinesnonveg, & !Number of lines in SUEWS_NonVeg.txt
923  nlinesveg, & !Number of lines in SUEWS_Veg.txt
924  nlineswater, & !Number of lines in SUEWS_Water.txt
925  nlinessnow, & !Number of lines in SUEWS_Snow.txt
926  nlinessoil, & !Number of lines in SUEWS_Soil.txt
927  nlinesconductance, & !Number of lines in SUEWS_Conductance.txt
928  nlinesohmcoefficients, & !Number of lines in SUEWS_OHMCoefficients.txt
929  nlinesestmcoefficients, & !Number of lines in SUEWS_ESTMCoefficients.txt
930  nlinesanthropogenic, & !Number of lines in SUEWS_AnthropogenicEmission.txt
931  nlinesirrigation, & !Number of lines in SUEWS_Irrigation.txt
932  nlinesprofiles, & !Number of lines in SUEWS_Profiles.txt
933  nlineswgwaterdist, & !Number of lines in SUEWS_WGWaterDist.txt
934  nlinesbiogen, & !Number of lines in SUEWS_BiogenCO2.txt
935  nlines, & !Number of lines in different files
936  skippedlines, & !Number of lines to skip over before reading each block of met data
937  skippedlinesorig, & !Number of lines to skip over before reading each block of data from original met file
938  skippedlinesorigestm, & !Number of lines to skip over before reading each block of data from original ESTM file
939  iv5 !Counter for code matching.
940 
941 END MODULE initial
942 !==================================================================================================
943 
944 !==================================================================================================
945 MODULE data_in
946 
947  IMPLICIT NONE
948 
949  CHARACTER(len=90)::progname = 'SUEWS_V2019a'
950 
951  ! ---- Run information ------------------------------------------------------------------------
952  CHARACTER(len=20):: filecode !Set in RunControl
953  CHARACTER(len=150):: fileinputpath, & !Filepath for input files (set in RunControl)
954  fileoutputpath !Filepath for output files (set in RunControl)
955  ! ---- File names -----------------------------------------------------------------------------
956  CHARACTER(len=150):: fileout, & !Output file name
957  filechoices, & !Run characteristics file name
958  filestateinit, & !Run characteristics file name
959  filemet, & !Meteorological forcing file name
960  fileorigmet, & !Original meteorological forcing file name (i.e. before downscaling)
961  fileorigestm, & !Original ESTM forcing file name (i.e. before downscaling)
962  filedscdmet, & !Downscaled meteorological forcing file name
963  filedscdestm, & !Downscaled ESTM forcing file name
964  filedaily, & !Daily State output file name
965  fileestmts, & !ESTM input file name
966  solweigpoiout, & !SOLWEIG poi file name
967  blout, & !CLB output file name
968  fileout_tt, & !Output file name (for resolution at model time-step)
969  estmout_tt
970 
971  INTEGER:: skipheadersiteinfo = 2 !Number of header lines to skip in SiteInfo files
972  INTEGER:: skipheadermet = 1 !Number of header lines to skip in met forcing file
973 
974  ! ---- Model options set in RunControl --------------------------------------------------------
975  INTEGER:: emissionsmethod, & !
976  cbluse, & !CBL slab model used (1) or not used (0)
977  multiplemetfiles, & !Indicates whether a single met file is used for all grids (0) or one for each grid (1)
978  multipleinitfiles, & !Indicates whether a single initial conditions file is used for all grids (0) or one for each grid (1)
979  multipleestmfiles, & !Indicates whether a single ESTM input data file is used for all grids (0) or one for each grid (1)
980  keeptstepfilesin, & !Delete (0) or keep (1) input met files at resolution of tstep (used by python, not fortran)
981  keeptstepfilesout, & !Delete (0) or keep (1) output files at resolution of tstep (used by python, not fortran)
982  resolutionfilesin, & !Specify resolution of input file [s]
983  resolutionfilesout, & !Specify resolution of output file [s]
984  resolutionfilesinestm, &!Specify resolution of ESTM input file [s]
985  writeoutoption, & !Choose variables to include in main output file
986  netradiationmethod, & !Options for net all-wave radiation calculation
987  ohmincqf, & !OHM calculation uses Q* only (0) or Q*+QF (1)
988  storageheatmethod, & !OHM (1); QS in met file (2); AnOHM(3); ESTM(4)
989  snowuse, & !Snow part used (1) or not used (0)
990  ! SOLWEIGuse, & !SOLWEIG part used (calculates Tmrt and other fluxes on a grid, FL)
991  smdmethod, & !Use modelled (0) or observed(1,2) soil moisture
992  waterusemethod, & !Use modelled (0) or observed (1) water use
993  roughlenmommethod, & !Defines method for calculating z0 & zd
994  disaggmethod, & ! Sets disaggregation method for original met forcing data
995  disaggmethodestm, & ! Sets disaggregation method for original met forcing data
996  raindisaggmethod, & ! Sets disaggregation method for original met forcing data for rainfall
997  rainamongn, & ! Number of subintervals over which to disaggregate rainfall
998  kdownzen, & ! Controls whether Kdown disaggregation uses zenith angle (1) or not (0)
999  suppresswarnings = 1, & ! Set to 1 to prevent warnings.txt file from being written
1000  diagnose, & !Set to 1 to get print-out of model progress
1001  diagnosedisagg, & !Set to 1 to get print-out of met forcing disaggregation progress
1002  ! ncMode, & !Write output file in netCDF (1) or not (0) , TS, 09 Dec 2016
1003  ! nRow, & !number of rows of checker board layout in the netCDF output, TS, 09 Dec 2016
1004  ! nCol, & !number of columns of checker board layout in the netCDF output, TS, 09 Dec 2016
1005  diagnosedisaggestm, & !Set to 1 to get print-out of ESTM forcing disaggregation progress
1006  diagqn, diagqs !Set to 1 to print values/components
1007 
1008  ! For more complex downscaling allow different RainAmongN for different intensities
1009  INTEGER, DIMENSION(5):: multrainamongn ! RainAmongN for each intensity bin
1010  REAL(KIND(1d0)), DIMENSION(5):: multrainamongnupperi ! Upper bound of intensity bin for which to apply MultRainAmongN
1011 
1012  ! ---- Model options currently set in model, but may be moved to RunControl at a later date
1013  INTEGER:: albedochoice, & !No additional albedo varaition (0); zenith angle calculation (1)
1014  !Currently set to 0 in SUEWS_Initial
1015  inputmetformat, & !Defines format for met input data: LUMPS format(1) or SUEWS format(10)
1016  !Currently set to 10 in SUEWS_Initial
1017  evapmethod, & !Evaporation calculated according to Rutter (1) or Shuttleworth (2)
1018  !Currently set to 2 in OverallRunControl
1019  laicalcyes, & !Use observed (0) or modelled (1) LAI
1020  !Currently set to 1 in OverallRunControl
1021  writedailystate !Daily state file written (1)
1022  !Currently set to 1 in SUEWS_Initial
1023 
1024  ! ---- Other options used within model --------------------------------------------------------
1025  INTEGER:: ldown_option !Parameterisation used for downward longwave radiation (1/2/3)
1026 
1027  ! ---- Output file numbers --------------------------------------------------------------------
1028  INTEGER:: lfnout, & !Error Output write units
1029  lfnoutc, & !Clean output write units
1030  lfnold !!Was used for GridConnections
1031 
1032  INTEGER:: outputformats !Used to control writing out of output file format
1033 
1034  ! ---- Other options set in RunControl --------------------------------------------------------
1035  REAL(KIND(1d0)):: timezone !Timezone (GMT=0)
1036 
1037  ! ---- Variables in alphabetical order --------------------------------------------------------
1038  !! Add units
1039  REAL(KIND(1d0)):: alpha_qhqe, & !Alpha parameter used in LUMPS QH and QE calculations [-]
1040  alt, & !Altitude [m]
1041  ! avdens, & !Average air density, moved to `moist` by TS, 27 Aug 2019
1042  avkdn, & !Average downwelling shortwave radiation
1043  avrh, & !Average relative humidity
1044  avts, & !Average surface temperature
1045  avu1, & !Average wind speed
1046  avu10_ms, & !Average wind speed at 10 m
1047  azimuth, & !Sun azimuth in degrees
1048  basethdd, & !Base temperature for QF
1049  buildenergyuse, & ! Building energy use
1050  co2mwd, & !Diurnal activity profile (weekday)
1051  co2mwe, & !Diurnal activity profile (weekend)
1052  co2pointsource, & !CO2 point source [kg C day-1]
1053  e_mod, & !Modelled latent heat flux with LUMPS [W m-2]
1054  ef_umolco2perj, &!CO2 emission factor for fuels used for building heating [umol CO2 J-1]
1055  emis_snow, & !Emissivity of snow
1056  enef_v_jkm, &!Heat release per vehicle per meter of travel [J km-1 veh-1]
1057  enprofwd, & !Diurnal energy use profile (weekday)
1058  enprofwe, & !Diurnal energy use profile (weekend)
1059  fc, & !CO2 flux [umol m-2 s-1]
1060  fc_anthro, & !CO2 flux (anthropogenic part) [umol m-2 s-1]
1061  fc_biogen, & !CO2 flux (biogenic part) [umol m-2 s-1]
1062  fc_build, & !CO2 flux (building energy use component) [umol m-2 s-1]
1063  fc_metab, & !CO2 flux (human metabolism component) [umol m-2 s-1]
1064  fc_photo, & !CO2 flux (photosynthesis component) [umol m-2 s-1]
1065  fc_point, & !CO2 flux (Point source component) [umol m-2 s-1]
1066  fc_respi, & !CO2 flux (non-human respiration component) [umol m-2 s-1]
1067  fc_traff, & !CO2 flux (traffic component) [umol m-2 s-1]
1068  fcld, & !Cloud fraction modelled
1069  fcld_obs, & !Cloud fraction observed
1070  frfossilfuel_heat, & !Fraction of fossil fuels used for building heating relative to district heating
1071  frfossilfuel_nonheat, & !Fraction of fossil fuels used for energy consumption relative to district heating
1072  frpddwe, & !Fraction of weekend population to weekday population
1073  h_mod, & !Modelled sensible heat flux with LUMPS [W m-2]
1074  kclear, & !Theoretical downward shortwave radiation
1075  kdiff, & !Diffuse shortwave radiation
1076  kdir, & !Direct shortwave radiation
1077  kup, & !Upward shortwave radiation
1078  lai_obs, & !LAI for study area provided in met forcing file
1079  lat, & !Latitude
1080  ldown, & !Downward longwave radiation
1081  ldown_obs, & !Downwelling longwave radiation
1082  lng, & !Longitude
1083  lup, & !Upward longwave radiation
1084  maxfcmetab, &!Maximum (day) CO2 from human metabolism
1085  maxqfmetab, &!Maximum (day) anthropogenic heat from human metabolism
1086  minfcmetab, &!Minimum (night) CO2 from human metabolism
1087  minqfmetab, &!Minimum (night) anthropogenic heat from human metabolism
1088  popdensnighttime, & ! Nighttime population density [ha-1] (i.e. residents)
1089  popprofwd, & !Diurnal profile for population density (weekday)
1090  popprofwe, & !Diurnal profile for population density (weekend)
1091  precip, & !Precipitation per timestep [mm]
1092  precip_hr, & !Precipitation [mm hr-1]
1093  press_hpa, & !Station air pressure in hPa
1094  pres_kpa, & !Station air pressure in kPa
1095  q2_gkg, & ! Specific humidity at 2 m
1096  qe, & !Observed latent heat flux
1097  qe_obs, &
1098  qf_build, & !Anthropogenic heat flux from building [W m-2]
1099  qf_metab, & !Anthropogenic heat flux from human metabolism [W m-2]
1100  qf_traff, & !Anthropogenic heat flux from traffic [W m-2]
1101  qf_obs, & !Observed anthropogenic heat flux
1102  qf_sahp, & !Anthropogenic heat flux calculated by SAHP
1103  qf_sahp_base, &!Anthropogenic heat flux calculated by SAHP (temp independent part)
1104  qf_sahp_heat, &!Anthropogenic heat flux calculated by SAHP (heating part only)
1105  qf_sahp_ac, & !AC contribution
1106  qh, & !Observed sensible heat flux
1107  qh_obs, &
1108  qh_r, & !Sensible heat flux calculated using resistance method
1109  qn1, & !Net all-wave radiation for the study area
1110  qn1_bup, &
1111  qn1_obs, & !Observed new all-wave radiation
1112  qn1_s, & !Total net all-wave radiation for the SnowPack
1113  qn1_snowfree, & !Total net all-wave radiation for the snowfree surface
1114  qs_obs, & !Observed storage heat flux
1115  qsanohm, & !Simulated storage heat flux by AnOHM, TS 30 May 2016
1116  qsestm, & !Simulated storage heat flux by ESTM, TS 30 May 2016
1117  snow, & !snow cover
1118  snowfrac_obs, &!Observed snow cover
1119  temp_c, & !Air temperature
1120  t2_c, & !Air temperature at 2 m, TS 20 May 2017
1121  trafficunits, & !Option for traffic units (1=[veh km m-2 day-1] 2=[veh km cap-1 day-1])
1122  traffprofwd, &!Diurnal traffic profile (weekday)
1123  traffprofwe, &!Diurnal traffic profile (weekend)
1124  trans_site, & !Atmospheric transmissivity
1125  tsurf, & !Surface temperature
1126  wdir, & ! Wind direction
1127  wu_m3, & !Water use provided in met forcing file [m3]
1128  xsmd, & !Measured soil moisture deficit
1129  year, & !Year of the measurements
1130  zenith_deg !Sun zenith angle in degrees
1131 
1132  REAL(KIND(1d0)), DIMENSION(2)::qf_a, qf_b, qf_c, & !Qf coefficients
1133  ah_min, & !Minimum anthropogenic heat flux (AnthropHeatMethod = 1)
1134  ah_slope_heating, & !Slope of the antrhropogenic heat flux calculation (AnthropHeatMethod = 1)
1135  ah_slope_cooling, &
1136  fcef_v_kgkm, &
1137  ! NumCapita, &
1138  popdensdaytime, &
1139  t_critic_heating, & !Critical temperature
1140  t_critic_cooling, & !Critical cooling temperature
1141  trafficrate, & !Traffic rate
1142  qf0_beu
1143 
1144  ! INTEGER,DIMENSION(2)::DayLightSavingDay !DOY when daylight saving changes
1145  INTEGER::startdls !DOY when daylight saving starts
1146  INTEGER::enddls !DOY when daylight saving ends
1147 
1148  INTEGER::ncblstep !number of time steps of Runge-kutta methods in one hour
1149 
1150  !---------Water bucket (see B. Offerle's PhD)----------------------------------
1151  REAL(KIND(1D0)):: drainrt, & !Drainage rate of the water bucket [mm hr-1]
1152  rainbucket, & !RAINFALL RESERVOIR [mm]
1153  raincover, &
1154  rainmaxres, & !Maximum water bucket reservoir [mm]
1155  rainres, & ! [mm]
1156  tempveg !TEMPORARY VEGETATIVE SURFACE FRACTION ADJUSTED BY RAINFALL
1157 
1158  !---------SOLWEIG variables---------------------------------------------------
1159  REAL(KIND(1D0)):: absl, & ! Absorption coefficient of longwave radiation of a person
1160  absk, & ! Absorption coefficient of shortwave radiation of a person
1161  heightgravity, & ! Centre of gravity for a standing person
1162  transmin, & ! Tranmissivity of K through decidious vegetation (leaf on)
1163  transmax ! Tranmissivity of K through decidious vegetation (leaf off)
1164 
1165  INTEGER:: posture, & ! 1.Standing, 2.Sitting
1166  usevegdem, & ! With vegetation (1)
1167  row, & ! Y coordinate for point of interest
1168  col, & ! X coordinate for point of interest
1169  onlyglobal, & ! if no diffuse and direct SW, then =1
1170  solweigpoi_out, & ! write output variables at point of interest
1171  tmrt_out, & ! write output Tmrt grid
1172  lup2d_out, & ! write output Lup grid
1173  ldown2d_out, & ! write output Ldown grid
1174  kup2d_out, & ! write output Kup grid
1175  kdown2d_out, & ! write output Kdown grid
1176  gvf_out, & ! write output GroundViewFActor grid
1177  solweig_ldown, & ! 1= use SOLWEIG code to estimate Ldown, 0=use SEUWS
1178  outinterval, & ! Output interval in minutes
1179  runforgrid ! If only one grid should be run. All grids -999
1180 
1181  CHARACTER(len=150):: dsmpath, & ! Path to DSMs
1182  dsmname, & ! Ground and building DSM
1183  cdsmname, & ! Canopy DSM
1184  tdsmname, & ! Trunk zone DSM
1185  svfpath, & ! Path to SVFs
1186  svfsuffix, & !
1187  buildingsname! Boolean matrix for locations of building pixels
1188 
1189  !--------- AnOHM related variables----------------------------------
1190  ! to be added here
1191 
1192 END MODULE data_in
1193 !==================================================================================================
1194 
1195 MODULE snowmod
1196  IMPLICIT NONE
1197 
1198  REAL(KIND(1D0))::adjmeltfact, & !Factor between melt and freezing factors
1199  snowfallcum, & !Cumulative snowfall
1200  fwh, & !Weighted freezing water
1201  lvs_j_kg, & !Latent heat of sublimation in J/kg
1202  mwh, & !Weighted hourly water melt
1203  mwstore, & !Meltwater storage
1204  preciplimit, & !Temperature limit when precipitation occurs as snow
1205  preciplimitalb, & !Precipitation limit for albedo change (in mm)
1206  qm, & !Snow melt associated heat flux
1207  qmfreez, & !Energy released in freezing of meltwater or surface state
1208  qmrain, &
1209  qn1_snow, & !Net all-wave radiation of SnowPack
1210  qn1_nosnow, & !Same for the snow free surface
1211  radmeltfact, & !Radiation melt factor
1212  snowalb, & !Snow albedo
1213  snowalbmin, & !Minimum snow albedo
1214  snowalbmax, & !Maximum snow albedo
1215  snowdensmin, & !Minimum density of snow
1216  snowdensmax, & !Maximum density of snow
1217  snowlimbldg, & !Snow removal limits for roofs in mm)
1218  snowlimpaved, & !Snow removal limits for paved surfaces in mm)
1219  swe, & !Weighted snow water equivalent (in mm)
1220  tau_a, & !Time constans related to albedo change
1221  tau_f, &
1222  tau_r, & !Time constant for density increase.
1223  tempmeltfact, & !Temperature melt factor
1224  volday, & !Volume of the melted water per day
1225  zf, &
1226  waterholdcapfrac, & !Water holding capacity factor
1227  crwmin, & !Free water holding capacity of deep SnowPack
1228  crwmax !Free water holding capacity of shallow SnowPack
1229 
1230  REAL(KIND(1D0)), DIMENSION(2):: snowremoval = 0 ! Removal of snow in mm
1231  REAL(KIND(1d0)), DIMENSION(0:23, 2):: snowprof_24hr ! Timing of snow removal (0 or 1) Hourly, WD/WE
1232 
1233  INTEGER::snowfractionchoice = 2 !Choice how fraction of snow is calculated
1234 
1235 END MODULE snowmod
1236 !===================================================================================
1237 
1238 !==================================================================================================
1240  IMPLICIT NONE
1241  REAL(KIND(1d0)):: notused = -55.55, reall, nan = -999, pnan = 999
1242  INTEGER:: notusedi = -55, ios_out
1243  INTEGER:: errorchoice, warningchoice !errorChoice/warningChoice defines if problems.txt/warnings.txt is opened for the first time
1244 END MODULE defaultnotused
1245 !==================================================================================================
1246 
1247 !==================================================================================================
1248 MODULE time
1249  INTEGER:: iy, & !Year
1250  id, & !Day of year
1251  it, & !Hour
1252  imin, & !Minutes
1253  isec, & !Seconds
1254  dls !day lightsavings =1 + 1h) =0
1255 
1256  REAL(KIND(1d0)):: dectime !Decimal time
1257  REAL(KIND(1d0)):: tstepcount !Count number of timesteps in this day
1258  INTEGER:: nofdaysthisyear !Based on whether leap year or not
1259  INTEGER:: dt_since_start ! time since simulation starts [s]
1260 
1261  INTEGER:: iy_prev_t, id_prev_t !Value of iy and id at previous timestep
1262 
1263 END MODULE time
1264 !==================================================================================================
1265 
1266 !===================================================================================
1267 MODULE mod_grav
1268  REAL(KIND(1d0)):: grav = 9.80665 !g - gravity - physics today august 1987
1269 END MODULE mod_grav
1270 
1271 !===================================================================================
1272 MODULE mod_k
1273  REAL(KIND(1d0)) :: k = 0.4, & !Von Karman's contant
1274  k2 = 0.16, & !Power of Van Karman's contant
1275  neut_limit = 0.001000 !Limit for neutral stability
1276 END MODULE mod_k
1277 
1278 !===================================================================================
1279 MODULE thresh
1280  REAL(KIND(1d0)) :: ipthreshold_mmhr = 10 !Threshold for intense precipitation [mm hr-1]
1281 
1282 END MODULE thresh
1283 
1284 !===================================================================================
1285 MODULE gas
1286  ! press (mb) ea (mb)
1287  IMPLICIT NONE
1288  REAL(KIND(1d0)):: comp = 0.9995
1289  REAL(KIND(1d0)):: epsil = 0.62197 !ratio molecular weight of water vapor/dry air (kg/mol/kg/mol)
1290  REAL(KIND(1d0)):: epsil_gkg = 621.97 !ratio molecular weight of water vapor/dry air in g/kg
1291  REAL(KIND(1d0)):: dry_gas = 8.31451 !Dry gas constant (J/k/mol)
1292  REAL(KIND(1d0)):: gas_ct_wat = 461.05 !Gas constant for water (J/kg/K)
1293  REAL(KIND(1d0)):: molar = 0.028965 !Dry air molar fraction in kg/mol
1294  REAL(KIND(1d0)):: molar_wat_vap = 0.0180153 !Molar fraction of water vapor in kg/mol
1295  REAL(KIND(1d0)):: gas_ct_dry = 8.31451/0.028965 !j/kg/k=dry_gas/molar
1296  REAL(KIND(1d0)):: gas_ct_wv = 8.31451/0.0180153 !j/kg/kdry_gas/molar_wat_vap
1297 END MODULE gas
1298 
1299 !**********************************************
1300 MODULE mod_z
1301  REAL(KIND(1d0)) :: zzd, & !Active measurement height (meas. height-displac. height)
1302  z0m, & !Aerodynamic roughness length
1303  zdm, & !Displacement height
1304  z0m_in, & !Aerodynamic roughness length set in SiteSelect
1305  zdm_in, & !Displacement height set in SiteSelect
1306  z !Windspeed height
1307  REAL(KIND(1E10))::z0v !Roughness length for vapour
1308 END MODULE mod_z
1309 
1310 !**********************************************
1311 MODULE resist !Variables related surface resistance calculations (P. 1744 in G&O1991)
1312  IMPLICIT NONE
1313  REAL(KIND(1d0)):: th, & !Maximum temperature limit
1314  tl, & !Minimum temperature limit
1315  kmax, & !Annual maximum hourly solar radiation
1316  g1, g2, g3, g4, & !Fitted parameters related to
1317  g5, g6, s1, s2, & !surface res. calculations
1318  tc, & !Temperature parameter 1
1319  tc2 !Temperature parameter 2
1320  INTEGER:: gsmodel !Choice of gs parameterisation (1 = Ja11, 2 = Wa16)
1321 END MODULE resist
1322 
1323 !**********************************************
1324 MODULE moist
1325  IMPLICIT NONE
1326 
1327  REAL(KIND(1d0))::avcp, & !Specific heat capacity
1328  dens_dry, & !Dry air density kg m-3
1329  avdens, & !Average air density
1330  dq, & !Specific humidity deficit
1331  ea_hpa, & !Water vapour pressure in hPa
1332  es_hpa, & !Saturation vapour pressure in hPa
1333  lv_j_kg, & !Latent heat of vaporization in [J kg-1]
1334  tlv, & !Latent heat of vaporization per timestep [J kg-1 s-1] (tlv=lv_J_kg/tstep_real)
1335  psyc_hpa, & !Psychometric constant in hPa
1336  psycice_hpa, & !Psychometric constant in hPa for snow
1337  s_pa, & !Vapour pressure versus temperature slope in Pa
1338  s_hpa, & !Vapour pressure versus temperature slope in hPa
1339  sice_hpa, & !Vapour pressure versus temperature slope in hPa above ice/snow
1340  vpd_hpa, & !Vapour pressure deficit in hPa
1341  vpd_pa, & !Vapour pressure deficit in Pa
1342  waterdens = 999.8395 !Density of water in 0 cel deg
1343 
1344 END MODULE moist
1345 !**********************************************
1346 
1347 MODULE gis_data
1348  IMPLICIT NONE
1349 
1350  REAL(KIND(1d0)):: areaunir, & !Unirrigated area
1351  areair, & !Irrigated area
1352  bldgh, & !Mean building height
1353  faibldg, & !Frontal area fraction of buildings
1354  faitree, & !Frontal area fraction of trees
1355  faievetree, & !Frontal area fraction of evergreen trees
1356  faidectree, & !Frontal area fraction of deciduous trees
1357  grassfractionirrigated, & !Irrigated grass fraction for LUMPS
1358  pavedfractionirrigated, & !Irrigated paved area fraction for LUMPS
1359  treeh, & !Mean tree height
1360  evetreeh, & !Height of evergreen trees
1361  dectreeh, & !Height of deciduous trees
1362  treefractionirrigated, & !Irrigated tree fraction for LUMPS
1363  veg_fr, & !Vegetation fraction from land area
1364  !- For LUMPS - dependent on user choice & water
1365  vegfraction, & ! sum of vegetation -not including water
1366  impervfraction, & ! sum of surface cover fractions for impervious surfaces
1367  pervfraction, & ! sum of surface cover fractions for pervious surfaces
1368  nonwaterfraction, & ! sum of surface cover fractions for all except water surfaces
1369  areazh !=(sfr(BldgSurf)+sfr(ConifSurf)+sfr(DecidSurf)) !Total area of buildings and trees
1370 
1371  INTEGER:: idgis, & !Time integers used in the code
1372  itgis, & !
1373  veg_type = 1 !Defines how vegetation is calculated for LUMPS
1374 
1375 END MODULE gis_data
1376 
1377 !************************************************************
1379  IMPLICIT NONE
1380 
1381  INTEGER:: tstep, & !Timestep [s] at which the model is run (set in RunControl)
1382  tstep_prev, & !Timestep [s] of previous timestamp !NB: not used by SUEWS, but by WRF-SUEWS for adaptive time step
1383  nsh, & !Number of timesteps per hour
1384  nsd, & !Number of timesteps per day
1385  nsdorig, & !Number of timesteps per day for original met forcing file
1386  t_interval, & !Number of seconds in an hour [s] (now set in OverallRunControl)
1387  nper, nperestm ! Number of model time-steps per input resolution (ResolutionFilesIn/Tstep)
1388 
1389  REAL(KIND(1d0)):: nsh_real, & !nsh cast as a real for use in calculations
1390  tstep_real, & !tstep cast as a real for use in calculations
1391  nper_real, nperestm_real !Nper as real
1392 
1393  REAL(KIND(1d0)):: halftimestep !In decimal time based on interval
1394 
1395  !Options for model setup (switches, etc) mainly set in RunControl
1396  INTEGER:: stabilitymethod, & !Defines stability functions used (set in RunControl)
1397  roughlenheatmethod !Defines method for calculating roughness length for heat (set in RunControl)
1398 
1399  INTEGER:: in
1400  INTEGER:: is !Integer to count over surface types
1401 
1402  !These are variables which currently have been removed from SuesInput.nml
1403  INTEGER::aerodynamicresistancemethod = 2 !The method used to calculate aerodynamic resistance
1404 
1405  INTEGER::ie_start, & !Starting time of water use (DOY)
1406  ie_end !Ending time of water use (DOY)
1407 
1408  REAL(KIND(1d0)), DIMENSION(2):: surplusevap !Surplus for evaporation in 5 min timestep
1409  ! sg -- need to determine size
1410 
1411  !Variables listed in SuesInput.nml
1412  REAL(KIND(1d0))::flowchange, & !Difference between the input and output flow in the water body
1413  pipecapacity, & !Capacity of pipes to transfer water
1414  runofftowater, & !Fraction of surface runoff going to water body
1415  smcap, & !Volumetric/gravimetric soil moisture capacity
1416  soildensity, & !Bulk density of soil
1417  soildepthmeas, & !Soil depth of the measured soil moisture
1418  soilrocks, & !Fraction of rocks in soil
1419  surfacearea, & !Surface area of the study area [m2]
1420  surfacearea_ha, & !Surface area of the study area [ha]
1421  waterbodytype, & !If water body type is pond/lake (=1) or river (=2)
1422  waterstorcap, & !Capacity of water body when surface is wet
1423  wuareaevetr_m2, & !Water use area (evergreen trees) [m2]
1424  wuareadectr_m2, & !Water use area (deciduous trees) [m2]
1425  wuareagrass_m2, & !Water use area (grass) [m2]
1426  wuareatotal_m2, & !Water use area (total) [m2]
1427  wu_evetr, & !Water use for evergreen trees/shrubs [mm]
1428  wu_dectr, & !Water use for deciduous trees/shrubs [mm]
1429  wu_grass !Water use for grass [mm]
1430 
1431  !Other related to SUES
1432  REAL(KIND(1d0))::additionalwater, & !Water flow from other grids
1433  ch_per_interval, & !Change in state per interval
1434  chsnow_per_interval, & !Change in snow state per interval
1435  di_dt, & !Water flow between two stores
1436  dr_per_interval, & !Drainage per interval
1437  ev_per_interval, & !Evaporation per interval
1438  surf_chang_per_tstep, & !Change in surface state per timestep [mm] (for whole surface)
1439  tot_chang_per_tstep, & !Change in surface and SoilState per timestep [mm] (for whole surface)
1440  nwstate_per_tstep, & !State per timestep [mm] (for whole surface, excluding water body)
1441  state_per_tstep, & !State per timestep [mm] (for whole surface)
1442  drain_per_tstep, & !Drainage per timestep [mm] (for whole surface, excluding water body)
1443  runoff_per_tstep, & !Runoff per timestep [mm] (for whole surface)
1444  runoffsoil_per_tstep, & !Runoff to deep soil per timestep [mm] (for whole surface, excluding water body)
1445  ev_per_tstep, & !Evaporation per timestep [mm] (for whole surface)
1446  qe_per_tstep, & !QE [W m-2] (for whole surface)
1447  p_mm, & !Inputs to surface water balance
1448  pin, & !Rain per time interval
1449  planf, & !Areally weighted frontal area fraction
1450  rb, & !Boundary layer resistance
1451  ! Water leaving each grid for grid-to-grid connectivity
1452  runoffagimpervious, & !Above ground runoff from impervious surface [mm] for whole surface area
1453  runoffagveg, & !Above ground runoff from vegetated surfaces [mm] for whole surface area
1454  runoffwaterbody, & !Above ground runoff from water surface [mm] for whole surface area
1455  runoffpipes, & !Runoff in pipes [mm] for whole surface area
1456  runoffagimpervious_m3, & !Volume of above ground runoff from impervious surface [m3]
1457  runoffagveg_m3, & !Volume of above ground runoff from vegetated surfaces [m3]
1458  runoffwaterbody_m3, & !Volume of above ground runoff from water surface [m3]
1459  runoffpipes_m3, & !Volume of runoff in pipes [m3]
1460  runoff_per_interval, & ! Total water transported to each grid for grid-to-grid connectivity
1461  addimpervious, & !Water from impervious surfaces of other grids [mm] for whole surface area
1462  addveg, & !Water from vegetated surfaces of other grids [mm] for whole surface area
1463  addwaterbody, & !Water from water surface of other grids [mm] for whole surface area
1464  addpipes, & !Water in pipes from other grids [mm] for whole surface area
1466  qe_per_interval, & !latent heat per interval
1467  soilmoistcap, &
1468  soilstate, & !Area-averaged soil moisture [mm] for whole surface
1469  st_per_interval, &!Surface state per interval
1470  surpluswaterbody, & !Extra runoff that goes to water body [mm] as specified by RunoffToWater
1471  tlv_sub, &
1472  overuse = 0, &
1473  zh !Areally weighted roughness element height
1474 
1475  !Calculation of u*,stability and aerodynamic resistance
1476  REAL(KIND(1d0))::h, & !Kinematic sensible heat flux [K m s-1] used to calculate friction velocity
1477  l_mod, & !Monin-Obukhov length (either measured or modelled)
1478  psim, & !Stability function of momentum
1479  psih, & !Stability function of heat
1480  ra, & !Aerodynamic resistance
1481  rasnow, & !Aerodynamic resistance over snow
1482  tstar, & !T*
1483  ustar, & !Friction velocity
1484  z0_gis !Roughness length for momentum from gis input file
1485 
1486  !Surface resistance related variables
1487  REAL(KIND(1d0))::resistsurf, & !Surface resistance
1488  gdq, & !G(dq)
1489  qnm, & !QMAX/(QMAX+G2)
1490  gq, & !G(Q*)
1491  gtemp, & !G(T)
1492  gl, & !G(LAI)
1493  sdp, & !S1/G6+S2
1494  smd, & !Soil moisture deficit of the soil surface layer
1495  vsmd, & !Soil moisture deficit for vegetated surfaces only (QUESTION: what about BSoil?)
1496  gs, & !G(Soil moisture deficit)
1497  gsc, & !Surface Layer Conductance
1498  rss !Surface resistance after wet/partially wet adjustment
1499 
1500  !SUES latent heat flux related variables
1501  REAL(KIND(1d0)):: vdrc, & !Second term up in calculation of E
1502  numpm, & !Numerator of PM equation
1503  sp, & !Term in calculation of E
1504  sae, & !Same
1505  ev, & !Evaporation
1506  rst, & !Flag in SUEWS_Evap (gets set to 1 if surface dry; 0 if surface wet)
1507  qeph, & !Latent heat flux (W m^-2)
1508  qeout !Latent heat flux [W m-2]
1509 
1510  REAL(KIND(1d0)), DIMENSION(:), ALLOCATABLE:: qhforcbl, qeforcbl ! Stores previous timestep qh and qe for CBL model. Added by HCW 21 Mar 2017
1511  INTEGER:: qh_choice ! selection of qh use to drive CBL growth 1=Suews 2=lumps 3=obs
1512 
1513  !Water use related variables
1514  REAL(KIND(1d0)):: ext_wu, & !External water use for the model timestep [mm] (over whole study area)
1515  faut, & !Fraction of irrigated area using automatic irrigation
1516  int_wu, & !Internal water use for the model timestep [mm] (over whole study area)
1517  irrfracconif, & !Fraction of evergreen trees which are irrigated
1518  irrfracdecid, & !Fraction of deciduous trees which are irrigated
1519  irrfracgrass, & !Fraction of grass which is irrigated
1520  internalwateruse_h !Internal water use [mm h-1]
1521 
1522  ! 7 - number of days in week
1523  REAL(KIND(1d0)), DIMENSION(7)::daywatper, & !% of houses following daily water
1524  daywat !Days of watering allowed
1525  ! REAL(KIND(1d0)), DIMENSION(0:23, 2):: WUProfM_24hr, & !Hourly profiles for water use (manual irrigation)
1526  ! WUProfA_24hr !Hourly profiles for water use (automatic irrigation)
1527 
1528  REAL(KIND(1d0)), DIMENSION(3)::ie_a, ie_m !Coefficients for automatic and manual irrigation models
1529 
1530 END MODULE sues_data
1531 
1532 !**********************************************
1533 !===================================================================================
1535  IMPLICIT NONE
1536  REAL(KIND(1d0)):: vegphenlumps, deltalai
1537 END MODULE vegphenogy
1538 
1539 MODULE filename
1540  CHARACTER(len=90):: smithfile !file for NARP
1541 END MODULE filename
1542 
1544 
1545  REAL(KIND(1d0))::laiinitialevetr, &
1546  laiinitialdectr, &
1547  laiinitialgrass, &
1548  porosity0, &
1549  decidcap0, &
1550  albdectr0, &
1551  albevetr0, &
1552  albgrass0, &
1553  temp_c0, &
1554  gdd_1_0, &
1555  gdd_2_0, &
1569  snowpackpaved, &
1570  snowpackbldgs, &
1571  snowpackevetr, &
1572  snowpackdectr, &
1573  snowpackgrass, &
1574  snowpackbsoil, &
1575  snowpackwater, &
1576  snowalb0!,&
1577  ! BoInit !initial Bo for AnOHM, TS 13 Jul 2016 ! removed, TS 30 Jan 2018
1578 
1579  INTEGER::id_prev
1580 
1581 END MODULE initialcond
1582 
1583 !-------------------------------------------------
1584 !New modules for the column numbers
1585 
1586 !-------------------------------------------------------------------------
1588 
1589  IMPLICIT NONE
1590 
1591  !========== Columns for ModelDailyState array =========================
1592 
1593  INTEGER:: cmds_id_prev = 3, &
1594  cmds_hdd1 = 4, &
1595  cmds_hdd2 = 5, &
1596  cmds_tempc = 6, &
1597  cmds_tempcrm = 7, &
1598  cmds_precip = 8, &
1599  cmds_dayssincerain = 9, &
1600  cmds_tempcold1 = 10, &
1601  cmds_tempcold2 = 11, &
1602  cmds_tempcold3 = 12, &
1603  cmds_gddmin = 13, &
1604  cmds_gddmax = 14, &
1605  cmds_gdd1_0 = 15, &
1606  cmds_gdd2_0 = 16, &
1607  cmds_laiinitialevetr = 17, &
1608  cmds_laiinitialdectr = 18, &
1609  cmds_laiinitialgrass = 19, &
1610  cmds_porosity = 20, &
1611  cmds_albevetr = 21, &
1612  cmds_albdectr = 22, &
1613  cmds_albgrass = 23, &
1614  cmds_decidcap = 24, &
1615  cmds_snowfallcum = 25, &
1616  cmds_laievetr = 26, &
1617  cmds_laidectr = 27, &
1618  cmds_laigrass = 28, &
1619  cmds_snowalb = 29, &
1620  cmds_boratio = 30, & ! noontime Bowen ratio, added by TS
1621  cmds_a1anohm = 31, & ! a1 of AnOHM, added by TS
1622  cmds_a2anohm = 32, & ! a2 of AnOHM, added by TS
1623  cmds_a3anohm = 33 ! a3 of AnOHM, added by TS
1624 
1625 END MODULE colnamesmodeldailystate
1626 
1627 !-------------------------------------------------------------------------
1629 
1630  IMPLICIT NONE
1631 
1632  INTEGER:: ccc !Column counter
1633 
1634  ! Column names and numbers must match the input files
1635 
1636  !========== Columns for SUEWS_SiteSelect.txt ==========================
1637  ! Columns 1:97 are the same for SurfaceChar
1638  INTEGER::c_grid = 1, &
1639  c_year = 2, &
1640  c_startdls = 3, &
1641  c_enddls = 4, &
1642  ! Site info
1643  c_lat = 5, &
1644  c_lng = 6, &
1645  c_tz = 7, &
1646  c_area = 8, &
1647  c_alt = 9, &
1648  c_z = 10, &
1649  ! Time info
1650  c_id = 11, &
1651  c_it = 12, &
1652  c_imin = 13, &
1653  ! Surface fractions
1654  c_frpaved = 14, &
1655  c_frbldgs = 15, &
1656  c_frevetr = 16, &
1657  c_frdectr = 17, &
1658  c_frgrass = 18, &
1659  c_frbsoil = 19, &
1660  c_frwater = 20, &
1661  ! Irrigated fractions
1662  c_irrevetrfrac = 21, &
1663  c_irrdectrfrac = 22, &
1664  c_irrgrassfrac = 23, &
1665  ! Height information
1666  c_hbldgs = 24, &
1667  c_hevetr = 25, &
1668  c_hdectr = 26, &
1669  c_z0m = 27, &
1670  c_zdm = 28, &
1671  c_faibldgs = 29, &
1672  c_faievetr = 30, &
1673  c_faidectr = 31, &
1674  ! Population
1675  c_popdensday = 32, &
1676  c_popdensnight = 33, &
1677  c_trafficrate_wd = 34, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekday
1678  c_trafficrate_we = 35, & ! Mean traffic rate in modelled area [veh km m-2 s-1] Weekend
1679  c_qf0_beu_wd = 36, & ! Building energy use for modelled area [W m-2] - QUESTION: could change units?
1680  c_qf0_beu_we = 37, &
1681  ! Codes for different surfaces
1682  c_pavedcode = 38, & ! Links characteristics in SUEWS_NonVeg.txt
1683  c_bldgscode = 39, & ! Links characteristics in SUEWS_NonVeg.txt
1684  c_evetrcode = 40, & ! Links characteristics in SUEWS_Veg.txt
1685  c_dectrcode = 41, & ! Links characteristics in SUEWS_Veg.txt
1686  c_grasscode = 42, & ! Links characteristics in SUEWS_Veg.txt
1687  c_bsoilcode = 43, & ! Links characteristics in SUEWS_Veg.txt
1688  c_watercode = 44, & ! Links characteristics in SUEWS_Water.txt
1689  ! LUMPS info
1690  c_lumpsdr = 45, &
1691  c_lumpscover = 46, &
1692  c_lumpsmaxres = 47, &
1693  ! NARP info
1694  c_narptrans = 48, &
1695  ! Code for conductances
1696  c_condcode = 49, & ! Links characteristics in SUEWS_Conductance.txt
1697  ! Code for snow
1698  c_snowcode = 50, & ! Links characteristics in SUEWS_Snow.txt
1699  ! Codes for human impacts on energy, water and snow
1700  c_snowprofwd = 51, & ! Snow-clearing profile in SUEWS_Profile.txt (weekdays)
1701  c_snowprofwe = 52, & ! Snow-clearing profile in SUEWS_Profile.txt (weekends)
1702  c_qfcode = 53, & ! Links anthropogenic heat info in SUEWS_AnthropogenicEmission.txt
1703  c_irrcode = 54, & ! Links irrigation info in SUEWS_Irrigation.txt
1704  c_wprofmanuwd = 55, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekdays)
1705  c_wprofmanuwe = 56, & ! Links to water-use profile in SUEWS_Profile.txt (manual irrigation, weekends)
1706  c_wprofautowd = 57, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekdays)
1707  c_wprofautowe = 58, & ! Links to water-use profile in SUEWS_Profile.txt (automatic irrigation, weekends)
1708  ! Flow information
1709  c_flowchange = 59, & ! Difference in input & output flows for water surface
1710  c_runofftowater = 60, & ! Fraction of above-ground runoff flowing to water surface
1711  c_pipecapacity = 61, & ! Pipe capacity [mm]
1712  ! Runoff (to 8 adjacent grids)
1713  c_gridconnection1of8 = 62, &
1714  c_fraction1of8 = 63, &
1715  c_gridconnection2of8 = 64, &
1716  c_fraction2of8 = 65, &
1717  c_gridconnection3of8 = 66, &
1718  c_fraction3of8 = 67, &
1719  c_gridconnection4of8 = 68, &
1720  c_fraction4of8 = 69, &
1721  c_gridconnection5of8 = 70, &
1722  c_fraction5of8 = 71, &
1723  c_gridconnection6of8 = 72, &
1724  c_fraction6of8 = 73, &
1725  c_gridconnection7of8 = 74, &
1726  c_fraction7of8 = 75, &
1727  c_gridconnection8of8 = 76, &
1728  c_fraction8of8 = 77, &
1729  ! Runoff within grid (for each surface type)
1730  c_wgpavedcode = 78, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1731  c_wgbldgscode = 79, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1732  c_wgevetrcode = 80, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1733  c_wgdectrcode = 81, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1734  c_wggrasscode = 82, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1735  c_wgbsoilcode = 83, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1736  c_wgwatercode = 84, & ! Links to SUEWS_WaterDistibuteWithinGrid.txt
1737  ! Additional info for ESTM
1738  c_areawall = 85 ! Wall surface fraction (Awall/Agridcell)
1739 
1740  INTEGER, DIMENSION(3):: c_fr_estmclass_paved = (/(ccc, ccc=86, 88, 1)/) ! Fraction of Paved surface with ESTM Class 1-5
1741  INTEGER, DIMENSION(3):: c_code_estmclass_paved = (/(ccc, ccc=89, 91, 1)/) ! Code for Paved surface ESTM Class 1-5
1742  INTEGER, DIMENSION(5):: c_fr_estmclass_bldgs = (/(ccc, ccc=92, 96, 1)/) ! Fraction of Bldgs surface with ESTM Class 1-5
1743  INTEGER, DIMENSION(5):: c_code_estmclass_bldgs = (/(ccc, ccc=97, 101, 1)/) ! Code for Bldgs surface ESTM Class 1-5
1744 
1745  !========== Columns for SUEWS_NonVeg.txt ==========================
1746  INTEGER :: ci_code = 1, &
1747  ci_albmin = 2, &
1748  ci_albmax = 3, &
1749  ci_emis = 4, &
1750  ci_stormin = 5, &
1751  ci_stormax = 6, &
1752  ci_wetthresh = 7, &
1753  ci_statelimit = 8, &
1754  ci_dreq = 9, &
1755  ci_drcoef1 = 10, &
1756  ci_drcoef2 = 11, &
1757  ci_soiltcode = 12, &
1758  ci_snowlimpat = 13, &
1759  ci_snowlimrem = 14, &
1760  ci_ohmcode_swet = 15, &
1761  ci_ohmcode_sdry = 16, &
1762  ci_ohmcode_wwet = 17, &
1763  ci_ohmcode_wdry = 18, &
1764  ci_ohmthresh_sw = 19, &
1765  ci_ohmthresh_wd = 20, &
1766  ci_estmcode = 21, & ! ESTM code for each surface (if 0 use codes in SiteSelect instead)
1767  ci_cpanohm = 22, & ! heat capacity, added by TS AnOHM
1768  ci_kkanohm = 23, & ! heat conductivity, added by TS AnOHM
1769  ci_chanohm = 24 ! bulk transfer coef., added by TS AnOHM
1770 
1771  !========== Columns for SUEWS_Veg.txt ============================
1772  INTEGER :: cp_code = 1, &
1773  cp_albmin = 2, &
1774  cp_albmax = 3, &
1775  cp_emis = 4, &
1776  cp_stormin = 5, &
1777  cp_stormax = 6, &
1778  cp_wetthresh = 7, &
1779  cp_statelimit = 8, &
1780  cp_dreq = 9, &
1781  cp_drcoef1 = 10, &
1782  cp_drcoef2 = 11, &
1783  cp_soiltcode = 12, &
1784  cp_snowlimpat = 13, &
1785  cp_baset = 14, &
1786  cp_basete = 15, &
1787  cp_gddfull = 16, &
1788  cp_sddfull = 17, &
1789  cp_laimin = 18, &
1790  cp_laimax = 19, &
1791  cp_porositymin = 20, &
1792  cp_porositymax = 21, &
1793  cp_gsmax = 22, &
1794  cp_laieq = 23, &
1795  cp_leafgp1 = 24, &
1796  cp_leafgp2 = 25, &
1797  cp_leafop1 = 26, &
1798  cp_leafop2 = 27, &
1799  cp_ohmcode_swet = 28, &
1800  cp_ohmcode_sdry = 29, &
1801  cp_ohmcode_wwet = 30, &
1802  cp_ohmcode_wdry = 31, &
1803  cp_ohmthresh_sw = 32, &
1804  cp_ohmthresh_wd = 33, &
1805  cp_estmcode = 34, &
1806  cp_cpanohm = 35, & ! heat capacity, added by TS AnOHM
1807  cp_kkanohm = 36, & ! heat conductivity, added by TS AnOHM
1808  cp_chanohm = 37, & ! bulk transfer coef., added by TS AnOHM
1809  cp_biogenco2code = 38
1810 
1811  !========== Columns for SUEWS_Water.txt ===============================
1812  INTEGER :: cw_code = 1, &
1813  cw_albmin = 2, &
1814  cw_albmax = 3, &
1815  cw_emis = 4, &
1816  cw_stormin = 5, &
1817  cw_stormax = 6, &
1818  cw_wetthresh = 7, &
1819  cw_statelimit = 8, &
1820  cw_waterdepth = 9, &
1821  cw_dreq = 10, &
1822  cw_drcoef1 = 11, &
1823  cw_drcoef2 = 12, &
1824  cw_ohmcode_swet = 13, &
1825  cw_ohmcode_sdry = 14, &
1826  cw_ohmcode_wwet = 15, &
1827  cw_ohmcode_wdry = 16, &
1828  cw_ohmthresh_sw = 17, &
1829  cw_ohmthresh_wd = 18, &
1830  cw_estmcode = 19, &
1831  cw_cpanohm = 20, & ! heat capacity, added by TS AnOHM
1832  cw_kkanohm = 21, & ! heat conductivity, added by TS AnOHM
1833  cw_chanohm = 22 ! bulk transfer coef., added by TS AnOHM
1834 
1835  !========== Columns for SUEWS_Snow.txt ================================
1836  INTEGER :: cs_code = 1, &
1837  cs_snowrmfactor = 2, &
1838  cs_snowtmfactor = 3, &
1839  cs_snowalbmin = 4, &
1840  cs_snowalbmax = 5, &
1841  cs_snowemis = 6, &
1842  cs_snowtau_a = 7, &
1843  cs_snowtau_f = 8, &
1844  cs_snowplimalb = 9, &
1845  cs_snowsdmin = 10, &
1846  cs_snowsdmax = 11, &
1847  cs_snowtau_r = 12, &
1848  cs_snowcrwmin = 13, &
1849  cs_snowcrwmax = 14, &
1850  cs_snowplimsnow = 15, &
1851  cs_ohmcode_swet = 16, &
1852  cs_ohmcode_sdry = 17, &
1853  cs_ohmcode_wwet = 18, &
1854  cs_ohmcode_wdry = 19, &
1855  cs_ohmthresh_sw = 20, &
1856  cs_ohmthresh_wd = 21, &
1857  cs_estmcode = 22, &
1858  cs_cpanohm = 23, & ! heat capacity, added by TS
1859  cs_kkanohm = 24, & ! heat conductivity, added by TS
1860  cs_chanohm = 25 ! bulk transfer coef., added by TS
1861 
1862  !========== Columns for SUEWS_Soil.txt ================================
1863  INTEGER :: cso_code = 1, &
1864  cso_soildepth = 2, &
1865  cso_soilstcap = 3, &
1866  cso_ksat = 4, &
1867  cso_soildens = 5, &
1868  cso_soilinfrate = 6, &
1869  cso_obssmdepth = 7, &
1870  cso_obssmmax = 8, &
1871  cso_obssnrfrac = 9
1872 
1873  !========== Columns for SUEWS_Conductance.txt =========================
1874  INTEGER :: cc_code = 1, &
1875  cc_gsg1 = 2, &
1876  cc_gsg2 = 3, &
1877  cc_gsg3 = 4, &
1878  cc_gsg4 = 5, &
1879  cc_gsg5 = 6, &
1880  cc_gsg6 = 7, &
1881  cc_gsth = 8, &
1882  cc_gstl = 9, &
1883  cc_gss1 = 10, &
1884  cc_gss2 = 11, &
1885  cc_gskmax = 12, &
1886  cc_gsmodel = 13 !Options for surface conductance calculation (1 - Ja11, 2 - Wa16)
1887 
1888  !========== Columns for SUEWS_OHMCoefficients.txt =====================
1889  INTEGER :: co_code = 1, &
1890  co_a1 = 2, &
1891  co_a2 = 3, &
1892  co_a3 = 4
1893 
1894  !========== Columns for SUEWS_ESTMCoefficients.txt =====================! ! S.O. 04 Feb 2016
1895  INTEGER::ce_code = 1, &
1896  ce_surf_thick1 = 2, & !Characteristics for 5x roof/surface layers
1897  ce_surf_k1 = 3, &
1898  ce_surf_rhocp1 = 4, &
1899  ce_surf_thick2 = 5, &
1900  ce_surf_k2 = 6, &
1901  ce_surf_rhocp2 = 7, &
1902  ce_surf_thick3 = 8, &
1903  ce_surf_k3 = 9, &
1904  ce_surf_rhocp3 = 10, &
1905  ce_surf_thick4 = 11, &
1906  ce_surf_k4 = 12, &
1907  ce_surf_rhocp4 = 13, &
1908  ce_surf_thick5 = 14, &
1909  ce_surf_k5 = 15, &
1910  ce_surf_rhocp5 = 16, &
1911  ce_wall_thick1 = 17, & ! Characteristics for 5x external wall layers (used for Bldgs surfaces only)
1912  ce_wall_k1 = 18, &
1913  ce_wall_rhocp1 = 19, &
1914  ce_wall_thick2 = 20, &
1915  ce_wall_k2 = 21, &
1916  ce_wall_rhocp2 = 22, &
1917  ce_wall_thick3 = 23, &
1918  ce_wall_k3 = 24, &
1919  ce_wall_rhocp3 = 25, &
1920  ce_wall_thick4 = 26, &
1921  ce_wall_k4 = 27, &
1922  ce_wall_rhocp4 = 28, &
1923  ce_wall_thick5 = 29, &
1924  ce_wall_k5 = 30, &
1925  ce_wall_rhocp5 = 31, &
1926  ce_internal_thick1 = 32, & ! Characteristics for 5x internal wall layers (used for Bldgs surfaces only)
1927  ce_internal_k1 = 33, &
1928  ce_internal_rhocp1 = 34, &
1929  ce_internal_thick2 = 35, &
1930  ce_internal_k2 = 36, &
1931  ce_internal_rhocp2 = 37, &
1932  ce_internal_thick3 = 38, &
1933  ce_internal_k3 = 39, &
1934  ce_internal_rhocp3 = 40, &
1935  ce_internal_thick4 = 41, &
1936  ce_internal_k4 = 42, &
1937  ce_internal_rhocp4 = 43, &
1938  ce_internal_thick5 = 44, &
1939  ce_internal_k5 = 45, &
1940  ce_internal_rhocp5 = 46, &
1941  ce_nroom = 47, &
1942  ce_alb_ibld = 48, &
1943  ce_em_ibld = 49, &
1944  ce_ch_iwall = 50, &
1945  ce_ch_iroof = 51, &
1946  ce_ch_ibld = 52
1947 
1948  !========== Columns for SUEWS_AnthropogenicEmission.txt ===================
1949  INTEGER :: ca_code = 1, &
1950  ca_basethdd = 2, &
1951  ca_qf_a1 = 3, & !Weekday
1952  ca_qf_b1 = 4, & !Weekday
1953  ca_qf_c1 = 5, & !Weekday
1954  ca_qf_a2 = 6, & !Weekend
1955  ca_qf_b2 = 7, & !Weekend
1956  ca_qf_c2 = 8, & !Weekend
1957  ca_ahmin_wd = 9, & !Weekday
1958  ca_ahmin_we = 10, & !Weekend
1959  ca_ahslopeheating_wd = 11, & !Weekday
1960  ca_ahslopeheating_we = 12, & !Weekend
1961  ca_ahslopecooling_wd = 13, & !Weekday
1962  ca_ahslopecooling_we = 14, & !Weekend
1963  ca_tcriticheating_wd = 15, & !Weekday
1964  ca_tcriticheating_we = 16, & !Weekend
1965  ca_tcriticcooling_wd = 17, & !Weekday
1966  ca_tcriticcooling_we = 18, & !Weekend
1967  ca_enprofwd = 19, & !Weekday
1968  ca_enprofwe = 20, & !Weekday
1969  ca_co2mwd = 21, & !Weekday
1970  ca_co2mwe = 22, & !Weekend
1971  ca_traffprofwd = 23, & !Weekday
1972  ca_traffprofwe = 24, & !Weekend
1973  ca_popprofwd = 25, & !Weekday
1974  ca_popprofwe = 26, & !Weekend
1975  ca_minqfmetab = 27, &
1976  ca_maxqfmetab = 28, &
1977  ca_minfcmetab = 29, &
1978  ca_maxfcmetab = 30, &
1979  ca_frpddwe = 31, &
1980  ca_frfossilfuel_heat = 32, &
1981  ca_frfossilfuel_nonheat = 33, &
1982  ca_ef_umolco2perj = 34, &
1983  ca_enef_v_jkm = 35, &
1984  ca_fcef_v_kgkmwd = 36, &
1985  ca_fcef_v_kgkmwe = 37, &
1986  ca_co2pointsource = 38, &
1987  ca_trafficunits = 39
1988 
1989  !========== Columns for SUEWS_Irrigation.txt ==========================
1990 
1991  INTEGER :: cir_code = 1, &
1992  cir_iestart = 2, &
1993  cir_ieend = 3, &
1994  cir_intwu = 4, &
1995  cir_faut = 5, &
1996  cir_ie_a1 = 6, &
1997  cir_ie_a2 = 7, &
1998  cir_ie_a3 = 8, &
1999  cir_ie_m1 = 9, &
2000  cir_ie_m2 = 10, &
2001  cir_ie_m3 = 11, &
2002  cir_daywat1 = 12, &
2003  cir_daywat2 = 13, &
2004  cir_daywat3 = 14, &
2005  cir_daywat4 = 15, &
2006  cir_daywat5 = 16, &
2007  cir_daywat6 = 17, &
2008  cir_daywat7 = 18, &
2009  cir_daywatper1 = 19, &
2010  cir_daywatper2 = 20, &
2011  cir_daywatper3 = 21, &
2012  cir_daywatper4 = 22, &
2013  cir_daywatper5 = 23, &
2014  cir_daywatper6 = 24, &
2015  cir_daywatper7 = 25
2016 
2017  !========== Columns for SUEWS_Profile.txt =============================
2018 
2019  INTEGER:: cc !Column counter
2020 
2021  INTEGER:: cpr_code = 1
2022  INTEGER, DIMENSION(24):: cpr_hours = (/(cc, cc=2, 25, 1)/) ! Hourly profile data
2023 
2024  !========== Columns for SUEWS_WithinGridWaterDist.txt =================
2025 
2026  INTEGER:: cwg_code = 1, &
2027  cwg_topaved = 2, &
2028  cwg_tobldgs = 3, &
2029  cwg_toevetr = 4, &
2030  cwg_todectr = 5, &
2031  cwg_tograss = 6, &
2032  cwg_tobsoil = 7, &
2033  cwg_towater = 8, &
2034  cwg_torunoff = 9, &
2035  cwg_tosoilstore = 10
2036 
2037  !========== Columns for SUEWS_BiogenCO2.txt ===================
2038  INTEGER :: cb_code = 1, &
2039  cb_alpha = 2, &
2040  cb_beta = 3, &
2041  cb_theta = 4, &
2042  cb_alpha_enh = 5, &
2043  cb_beta_enh = 6, &
2044  cb_resp_a = 7, &
2045  cb_resp_b = 8, &
2046  cb_min_r = 9
2047 
2048 END MODULE colnamesinputfiles
2049 
2050 !----------------------------------------------------------------------------------------
2051 
2052 !----------------------------------------------------------------------------------
2054  ! Stores grid and datetime info
2055 
2056  INTEGER:: gridid !Grid number (as specified in SUEWS_SiteSelect.txt)
2057  CHARACTER(LEN=10):: gridid_text !Grid number as a text string
2058  CHARACTER(LEN=15):: datetime ! YYYY DOY HH MM
2059 
2060 END MODULE wherewhen
2061 
2062 !----------------------------------------------------------------------------------
2064 
2065  REAL(KIND(1d0)), PARAMETER ::pi = 3.14159265359
2066  REAL(KIND(1d0)), PARAMETER ::dtr = 0.0174532925, rtd = 57.2957795
2067 
2068 END MODULE mathconstants
2069 
2070 !----------------------------------------------------------------------------------
2072 
2073  REAL(KIND(1d0)), PARAMETER :: c2k = 273.15 !Celsius to Kelvin
2074  REAL(KIND(1d0)), PARAMETER :: sbconst = 5.67051e-8 !Stefan Boltzmann constant [W m-2 K-4]
2075  REAL(KIND(1d0)), PARAMETER :: jtoumolpar = 4.6 ! Convert PAR from W m-2 to umol m-2 s-1
2076  REAL(KIND(1d0)), PARAMETER :: kdntopar = 0.46 ! Conversion from Kdn to PAR, originally from Tsubo and Walker (2005), used in Bellucco et al. (2017)
2077 
2078 END MODULE physconstants
integer, dimension(5) c_internal_rhocp2_bldgs
real(kind(1d0)) gsc
real(kind(1d0)) wu_dectr
real(kind(1d0)) qf_metab
integer, parameter ncolumnssnow
real(kind(1d0)) ev_per_tstep
real(kind(1d0)) nper_real
integer, parameter cts_tsurf
real(kind(1d0)), dimension(nvegsurf) lai_id_prev
real(kind(1d0)), dimension(nsurf) maxsnowvol
integer, parameter cts_imin
integer, dimension(nsurfincsnow) c_surf_thick2
real(kind(1d0)) absl
real(kind(1d0)) areazh
integer, dimension(nsurf) c_soiltcode
real(kind(1d0)) molar_wat_vap
real(kind(1d0)), dimension(nsurf) qn1_ind_nosnow
real(kind(1d0)) minfcmetab
integer readlinesorigmetdata
real(kind(1d0)) l_mod
real(kind(1d0)) wuareatotal_m2
real(kind(1d0)), dimension(nsurf) mw_ind
integer inputmetformat
integer, dimension(5) c_surf_k4_bldgs
integer, dimension(nvegsurf) c_theta_bioco2
real(kind(1d0)) rainbucket
integer, dimension(nvegsurf) c_resp_b
real(kind(1d0)) tlv
integer outputformats
integer, parameter ncolumnswgwaterdist
real(kind(1d0)) psycice_hpa
real(kind(1d0)) evetreeh
integer keeptstepfilesout
integer, dimension(3) c_ie_a
character(len=20), dimension(ncolumnsbiogen) headerbiogen_reqd
integer, parameter cts_troad
real(kind(1d0)), dimension(nsurf) freezstate
real(kind(1d0)) runoffagimpervious_m3
real(kind(1d0)) soilstorebldgsstate
real(kind(1d0)), dimension(:, :), allocatable metforcingdata_grid
real(kind(1d0)) soilmoistcap
real(kind(1d0)) qn1_s_av
integer, dimension(5) c_wall_k5_bldgs
real(kind(1d0)) impervfraction
integer disaggmethodestm
integer iy_prev_t
real(kind(1d0)) tau_r
real(kind(1d0)) enprofwe
integer, dimension(nsurfincsnow) c_ohmcode_swet
real(kind(1d0)), dimension(nsurf+1) ohm_threshwd
integer, dimension(nsurfincsnow) c_a3_swet
real(kind(1d0)), dimension(:), allocatable metfordisaggprev
real(kind(1d0)), parameter sbconst
character(len=20), dimension(ncolumnssoil) headersoil_reqd
real(kind(1d0)), dimension(nsurf+1) ohm_threshsw
integer diagqn
real(kind(1d0)) heightgravity
integer, parameter ccendp
character(len=90) progname
real(kind(1d0)), dimension(nsurf) qn1_ind
integer, parameter ccendestmmp
integer, parameter ccendir
real(kind(1d0)), dimension(nsurf) changsnow
integer, parameter ccendo
real(kind(1d0)) co2mwd
real(kind(1d0)), dimension(nsurf) snowdens
integer, parameter ncolumnssiteselect
real(kind(1d0)) tc2
real(kind(1d0)), dimension(nsurf) rainonsnow
real(kind(1d0)) g1
integer, dimension(nvegsurf) c_leafgp2
integer diagnosedisaggestm
integer, dimension(nsurf) c_dreq
integer skippedlinesorig
integer, parameter nconns
real(kind(1d0)), dimension(maxnumberofgrids) tmin_id_grids
real(kind(1d0)) halftimestep
real(kind(1d0)), dimension(:, :), allocatable water_coeff
real(kind(1d0)) trans_site
integer numberofgrids
real(kind(1d0)) ra
real(kind(1d0)) s2
integer, dimension(5) c_internal_thick2_bldgs
real(kind(1d0)), dimension(nvegsurf) theta_bioco2
integer gsmodel
real(kind(1d0)) pres_kpa
real(kind(1d0)) k
real(kind(1d0)), dimension(3) ie_m
integer, parameter ncolumnsdataoutestm
integer, dimension(nsurfincsnow) c_a2_sdry
integer, dimension(nsurf) c_snowlimpat
real(kind(1d0)), dimension(nsurf) icefrac
real(kind(1d0)) ustar
real(kind(1d0)) qf_sahp_heat
integer, dimension(nsurf) snowcalcswitch
integer, dimension(nvegsurf) c_alpha_bioco2
integer, parameter maxncols_cmds
real(kind(1d0)) waterdens
real(kind(1d0)), dimension(nsurf) snowwater
integer nlinessoil
real(kind(1d0)) nwstate_per_tstep
character(len=15) datetime
integer, parameter ncolumnsnonveg
real(kind(1d0)), dimension(:, :, :), allocatable dataoutestm
integer, dimension(nsurf) cmod_snowdens
integer, dimension(nvegsurf) c_leafop2
integer writedailystate
real(kind(1d0)), dimension(nsurf) statefraction
integer, dimension(5) c_alb_ibld_bldgs
integer, dimension(nsurf) c_wgtosoilstore
real(kind(1d0)) albmin_grass
real(kind(1d0)) g5
character(len=150) dsmname
integer, dimension(3) c_fr_estmclass_paved
real(kind(1d0)), dimension(365) narp_g
real(kind(1d0)) waterbodytype
real(kind(1d0)), dimension(maxnumberofgrids) boanohmend
real(kind(1d0)) narp_emis_snow
integer, dimension(nsurfincsnow) c_surf_k2
real(kind(1d0)) snowfallcum
integer, parameter ncolumnsmetforcingdata
real(kind(1d0)) albmin_evetr
real(kind(1d0)), dimension(nsurf) state_id
real(kind(1d0)) snowpackbsoil
real(kind(1d0)) vegfraction
integer, dimension(nsurf) c_wgtowater
integer, dimension(nsurf) c_soilinfrate
integer snowfractionchoice
real(kind(1d0)) fc_metab
real(kind(1d0)) pipecapacity
integer, parameter ivgrass
integer, dimension(nsurf) c_wetthresh
real(kind(1d0)) narp_year
real(kind(1d0)) mwstore
integer, dimension(5) c_wall_thick3_bldgs
real(kind(1d0)), dimension(:), allocatable qn1_s_av_grids
real(kind(1d0)), dimension(:, :), allocatable irrigation_coeff
real(kind(1d0)) qn1_av
real(kind(1d0)) pin
real(kind(1d0)), parameter jtoumolpar
real(kind(1d0)) transmax
real(kind(1d0)) kmax
integer, dimension(nsurf) c_soildepth
integer, dimension(3) c_surf_rhocp5_paved
integer, dimension(nsurf) c_snowlimrem
integer, dimension(nsurf) c_obssmdepth
integer nlinesestmcoefficients
integer, dimension(3) c_ie_m
real(kind(1d0)) a2
real(kind(1d0)) qf_traff
integer runforgrid
real(kind(1d0)), dimension(nvegsurf) laimax
real(kind(1d0)) deltalai
real(kind(1d0)), dimension(2) t_critic_cooling
integer skipheadersiteinfo
integer, parameter ncolumnsdataoutdailystate
integer nlinesprofiles
real(kind(1d0)), dimension(:, :), allocatable soil_coeff
real(kind(1d0)), dimension(:), allocatable qn1_av_grids
integer resolutionfilesout
real(kind(1d0)) epsil
integer, dimension(nsurfincsnow) c_a3_wdry
real(kind(1d0)) zenith_deg
real(kind(1d0)) drain_per_tstep
real(kind(1d0)) dr_per_interval
real(kind(1d0)) fc_anthro
real(kind(1d0)) fc_traff
integer, parameter ncolumnsveg
integer, dimension(3) c_surf_rhocp2_paved
integer, parameter cts_troof
integer, dimension(5) c_code_estmclass_bldgs
real(kind(1d0)), dimension(1) waterdepth
integer, parameter ccendsi
real(kind(1d0)), dimension(ncolumnsdataoutrsl - 5) dataoutlinersl
integer, dimension(5) c_internal_thick4_bldgs
real(kind(1d0)) psim
real(kind(1d0)) avrh
integer, dimension(nsurfincsnow) c_surf_rhocp5
real(kind(1d0)), parameter deg2rad
real(kind(1d0)), dimension(:, :, :), allocatable dataoutbl
real(kind(1d0)), dimension(2) qf_c
character(len=14 *ncolumnsdataoutsuews) formatusenosep
real(kind(1d0)), dimension(nsurf) drain
integer diagnose
real(kind(1d0)) nan
integer, dimension(nvegsurf) c_beta_enh_bioco2
real(kind(1d0)) snowlimpaved
integer, dimension(5) c_wall_rhocp4_bldgs
real(kind(1d0)), dimension(2) popdensdaytime
integer, dimension(5) c_surf_thick1_bldgs
real(kind(1d0)) z
integer, dimension(nsurf) snowcoverforms
integer onlyglobal
integer, parameter bsoilsurf
real(kind(1d0)) th
integer, parameter cts_twall
integer, dimension(nsurfincsnow) c_surf_thick3
character(len=150) filestateinit
real(kind(1d0)), dimension(nvegsurf) maxconductance
real(kind(1d0)) alt
integer, dimension(24) c_hrproftraffwe
integer, parameter nsurfincsnow
real(kind(1d0)), dimension(0:23, 2) ahprof_24hr
real(kind(1d0)) snowalb
real(kind(1d0)) wu_m3
integer, dimension(24) c_hrproftraffwd
real(kind(1d0)) runoffagveg_m3
real(kind(1d0)), dimension(nsurf) kup_ind_snow
real(kind(1d0)) temp_c
integer keeptstepfilesin
real(kind(1d0)) rainres
real(kind(1d0)) tempmeltfact
real(kind(1d0)) resistsurf
real(kind(1d0)), dimension(nvegsurf) biogenco2code
real(kind(1d0)), dimension(nsurf) soilstore_id
integer readlinesorigestmdatamax
real(kind(1d0)) preciplimit
real(kind(1d0)) avts
real(kind(1d0)), dimension(:, :), allocatable estmcoefficients_coeff
integer c_tcriticheating_we
real(kind(1d0)) fc_biogen
real(kind(1d0)), dimension(nsurf) qm_freezstate
integer, dimension(nsurfincsnow) c_a2_swet
real(kind(1d0)) qn1_snow
real(kind(1d0)) sae
character(len=150) fileorigmet
real(kind(1d0)) bulkalbedo
real(kind(1d0)) faibldg
integer, dimension(3) c_surf_thick4_paved
real(kind(1d0)), dimension(:, :), allocatable snow_coeff
real(kind(1d0)), dimension(nvegsurf) alpha_enh_bioco2
real(kind(1d0)) avu1
real(kind(1d0)) basethdd
real(kind(1d0)) notused
real(kind(1d0)) a1
real(kind(1d0)) state_per_tstep
integer, dimension(nvegsurf) c_sddfull
real(kind(1d0)), dimension(:), allocatable estmfordisaggnext
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_file
character(len=150) filedaily
integer solweigpoi_out
real(kind(1d0)), dimension(4, nvegsurf) laipower
integer, dimension(5) c_surf_thick4_bldgs
real(kind(1d0)) narp_lat
integer, dimension(nsurf) c_albmin
integer, dimension(nsurfincsnow) c_ohmcode_wwet
integer, dimension(5) c_internal_k4_bldgs
real(kind(1d0)) veg_fr
integer, dimension(24) cpr_hours
real(kind(1d0)) qf_build
real(kind(1d0)) emis_snow
real(kind(1d0)) gas_ct_wv
real(kind(1d0)) zf
real(kind(1d0)), dimension(maxnumberofgrids) albevetr_id_grids
integer, parameter cbendwg
real(kind(1d0)), dimension(2) t_critic_heating
real(kind(1d0)), dimension(nvegsurf, maxnumberofgrids) lai_id_grids
real(kind(1d0)), dimension(:, :), allocatable ts5mindata
integer, parameter ccendgs
integer, dimension(:), allocatable usecolumnsdataout
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_reqd
integer, dimension(nsurfincsnow) c_surf_thick4
integer, parameter ncolumnsohmcoefficients
real(kind(1d0)) temp_c0
integer dls
real(kind(1d0)), dimension(maxnumberofgrids) lenday_id_grids
real(kind(1d0)), dimension(nsurf) ev_snow
real(kind(1d0)) year
real(kind(1d0)), dimension(nsurf) snowpacklimit
real(kind(1d0)) internalwateruse_h
integer, parameter ncolumnsestmcoefficients
real(kind(1d0)) snow
real(kind(1d0)) surfacearea_ha
real(kind(1d0)), dimension(ncolumnsdataoutsuews - 5) dataoutlinesuews
real(kind(1d0)), dimension(2) ah_slope_heating
real(kind(1d0)), dimension(12, maxnumberofgrids) hdd_id_grids
real(kind(1d0)) soilrocks
integer, dimension(5) c_ch_ibld_bldgs
integer, dimension(nsurfincsnow) c_surf_rhocp2
real(kind(1d0)), dimension(5, nsurfincsnow) ksurf_suewssurfs
real(kind(1d0)) albmax_evetr
real(kind(1d0)), dimension(nvegsurf) alpha_bioco2
real(kind(1d0)), dimension(2) ah_min
real(kind(1d0)), dimension(maxnumberofgrids) albdectr_id_grids
real(kind(1d0)) absk
real(kind(1d0)), dimension(nsurf) kup_ind_nosnow
real(kind(1d0)) p_mm
real(kind(1d0)) maxqfmetab
integer snowuse
integer, parameter cts_tiair
character(len=4 *ncolumnsdataoutsuews) colnosuse
integer nlinesorigmetdata
real(kind(1d0)) qn1_bup
real(kind(1d0)) k2
real(kind(1d0)) snowwaterbldgsstate
real(kind(1d0)) pnan
real(kind(1d0)) addveg
character(len=150) buildingsname
integer nlinesirrigation
real(kind(1d0)) zdm
real(kind(1d0)) planf
integer, parameter ncolumnsdataoutbl
integer multipleestmfiles
real(kind(1d0)) albevetr_id
real(kind(1d0)), dimension(nsurf) kkanohm
integer, parameter nsurf
integer, parameter ncolumnsirrigation
real(kind(1d0)) soilstorepavedstate
real(kind(1d0)) z0_gis
integer writeoutoption
real(kind(1d0)) soilstate
integer, dimension(nsurfincsnow) c_estmcode
real(kind(1d0)) ipthreshold_mmhr
integer, dimension(nsurfincsnow) c_a2_wwet
integer, dimension(nsurfincsnow) c_ohmcode_wdry
integer, dimension(nvegsurf) c_porositymin
real(kind(1d0)) snowpackdectr
integer c_frfossilfuel_heat
real(kind(1d0)) a3
real(kind(1d0)) gdd_1_0
real(kind(1d0)), dimension(5) multrainamongnupperi
real(kind(1d0)) fc_photo
real(kind(1d0)) tlv_sub
real(kind(1d0)), dimension(nvegsurf) resp_a
real(kind(1d0)) g2
real(kind(1d0)) lvs_j_kg
character(len=150) fileestmts
integer suppresswarnings
integer isec
real(kind(1d0)) areair
real(kind(1d0)) zh
real(kind(1d0)), dimension(5, nsurfincsnow) zsurf_suewssurfs
real(kind(1d0)) runoffpipes
integer id_prev_t
integer, dimension(5) c_wall_thick4_bldgs
real(kind(1d0)) tc
real(kind(1d0)) wuareagrass_m2
real(kind(1d0)) soilstoregrassstate
integer, parameter ccendb
real(kind(1d0)) xsmd
integer, dimension(5) c_internal_rhocp3_bldgs
integer albedochoice
real(kind(1d0)) ldown
real(kind(1d0)) qeph
real(kind(1d0)) snowwaterwaterstate
character(len=150) estmout_tt
integer, parameter nsurfdonotreceivedrainage
real(kind(1d0)) narp_long
integer, parameter ncolumnsbiogen
real(kind(1d0)) tmax_id
integer, dimension(:), allocatable grididmatrix
real(kind(1d0)), dimension(:, :), allocatable surfacechar
integer emissionsmethod
real(kind(1d0)) qf_sahp_ac
integer, parameter ncolumnswater
integer nlinesveg
integer, dimension(nvegsurf) c_porositymax
integer, dimension(nvegsurf) c_laimax
character(len=20), dimension(ncolumnsprofiles) headerprofiles_file
character(len=150) fileout_tt
real(kind(1d0)), dimension(nsurf) evap
real(kind(1d0)) snowfrac_obs
real(kind(1d0)) ext_wu
integer, dimension(nsurf) c_drcoef2
character(len=20), dimension(ncolumnsirrigation) headerirrigation_file
real(kind(1d0)) snowwatergrassstate
real(kind(1d0)) ea_hpa
integer, parameter ccmds
integer, dimension(nsurf) c_obssmmax
real(kind(1d0)) lv_j_kg
real(kind(1d0)) qf_obs
real(kind(1d0)), dimension(nsurf) soilstorecap
real(kind(1d0)), dimension(:), allocatable narp_kdown_hr
character(len=150) svfpath
real(kind(1d0)) epsil_gkg
real(kind(1d0)) gdq
real(kind(1d0)) enprofwd
integer multiplemetfiles
real(kind(1d0)), dimension(nvegsurf) sdd_id
real(kind(1d0)), dimension(27) dataoutlineestm
real(kind(1d0)) qn1_s
real(kind(1d0)), dimension(nsurf) lup_ind
integer, dimension(5) c_wall_rhocp5_bldgs
real(kind(1d0)), dimension(maxnumberofgrids) boanohmstart
integer startdls
real(kind(1d0)), dimension(nsurf, maxnumberofgrids) icefrac_grids
real(kind(1d0)) zdm_in
real(kind(1d0)), dimension(nsurf) chang
real(kind(1d0)) snowpackbldgs
real(kind(1d0)) fwh
real(kind(1d0)) co2mwe
real(kind(1d0)) qm
integer, dimension(5) c_internal_k3_bldgs
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_file
real(kind(1d0)) vpd_pa
real(kind(1d0)) nonwaterfraction
real(kind(1d0)) snowdensmin
integer nlinesanthropogenic
integer aerodynamicresistancemethod
integer, parameter ncolumnsdataoutsol
real(kind(1d0)), dimension(:), allocatable dailystatefirstopen
integer resolutionfilesinestm
real(kind(1d0)) runoffsoil_per_interval
real(kind(1d0)) vdrc
real(kind(1d0)) tair_av
real(kind(1d0)) faievetree
real(kind(1d0)) zzd
real(kind(1d0)) soildensity
real(kind(1d0)), dimension(nsurf) rss_nsurf
real(kind(1d0)), parameter kdntopar
real(kind(1d0)), dimension(nsurf) tsurf_ind_nosnow
real(kind(1d0)), dimension(:), allocatable estmfordisaggprev
real(kind(1d0)) ev
real(kind(1d0)) g3
real(kind(1d0)) snowwaterbsoilstate
real(kind(1d0)) wuareadectr_m2
real(kind(1d0)) kdir
integer, parameter cts_twall_n
real(kind(1d0)) runoffwaterbody_m3
integer kdown2d_out
real(kind(1d0)), dimension(ncolumnsdataoutsnow - 5) dataoutlinesnow
real(kind(1d0)) albmax_grass
integer, parameter conifsurf
integer readlinesorigmetdatamax
integer, dimension(7) c_daywat
real(kind(1d0)) frpddwe
integer, dimension(5) c_surf_k3_bldgs
integer, dimension(nsurfincsnow) c_a1_sdry
real(kind(1d0)), dimension(nsurf) sathydraulicconduct
integer, dimension(24) c_hrprofsnowcwd
real(kind(1d0)) qn1
integer, dimension(nsurfincsnow) c_a1_wdry
real(kind(1d0)), dimension(nsurf) snowinit
real(kind(1d0)) popprofwe
integer, dimension(nsurfincsnow) c_a2_wdry
real(kind(1d0)), dimension(nsurf) statelimit
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsol
integer diagqs
real(kind(1d0)) co2pointsource
integer, dimension(nvegsurf) c_leafgp1
integer id
real(kind(1d0)), dimension(nvegsurf) gddfull
real(kind(1d0)) runoff_per_tstep
integer, dimension(5) c_wall_k2_bldgs
integer, dimension(24) c_hrprofwumanuwd
real(kind(1d0)) runoffagimpervious
integer nlinesconductance
character(len=150) filedscdestm
integer, dimension(5) c_internal_rhocp5_bldgs
real(kind(1d0)) fc_respi
integer kdownzen
integer, parameter cts_twall_w
real(kind(1d0)) rainmaxres
real(kind(1d0)) ldown_obs
real(kind(1d0)) int_wu
real(kind(1d0)), dimension(12) hdd_id
real(kind(1d0)) fcld_obs
integer, parameter cts_twall_e
real(kind(1d0)), dimension(nsurf) snowdepth
integer nlinesestmdata
real(kind(1d0)), dimension(:), allocatable tair24hr
real(kind(1d0)) buildenergyuse
real(kind(1d0)), dimension(2) fcef_v_kgkm
real(kind(1d0)) avcp
character(len=3 *ncolumnsdataoutsuews) aggreguse
real(kind(1d0)) dq
real(kind(1d0)) tau_f
real(kind(1d0)) adjmeltfact
real(kind(1d0)) lng
real(kind(1d0)) capmax_dec
real(kind(1d0)) dqnsdt
integer, parameter ncolumnsconductance
real(kind(1d0)) avu10_ms
real(kind(1d0)), dimension(0:23, 2) popprof_24hr
integer, parameter ndays
integer nlinesohmcoefficients
integer, dimension(nvegsurf) laitype
real(kind(1d0)) gas_ct_wat
real(kind(1d0)), parameter dtr
real(kind(1d0)) raincover
integer, dimension(5) c_fr_estmclass_bldgs
integer, dimension(:), allocatable grididmatrix0
integer imin
character(len=14 *ncolumnsdataoutsuews) headerusenosep
real(kind(1d0)) snowalbmax
character(len=150) filedscdmet
real(kind(1d0)), dimension(0:23, 2) wuprofm_24hr
real(kind(1d0)) snowwaterevetrstate
real(kind(1d0)), dimension(maxnumberofgrids) porosity_id_grids
integer, dimension(3) c_surf_k2_paved
integer, dimension(24) c_hrprofwumanuwe
integer, parameter ccendpr
real(kind(1d0)) laiinitialdectr
real(kind(1d0)), dimension(nvegsurf) resp_b
real(kind(1d0)), dimension(maxnumberofgrids) a2anohm
real(kind(1d0)) sp
real(kind(1d0)), dimension(2) qf_a
real(kind(1d0)), dimension(nsurf) mw_indday
character(len=150) tdsmname
integer, parameter cts_id
character(len=20), dimension(ncolumnswater) headerwater_reqd
real(kind(1d0)) qn1_nosnow
real(kind(1d0)) pormax_dec
integer, dimension(5) c_internal_k5_bldgs
integer, dimension(5) c_em_ibld_bldgs
integer, dimension(nsurf) c_wgtopaved
character(len=150) svfsuffix
real(kind(1d0)) porosity0
integer, parameter cts_iy
real(kind(1d0)), dimension(nsurf) chanohm
integer, dimension(nsurf) c_ksat
real(kind(1d0)), dimension(2) snowremoval
real(kind(1d0)) gas_ct_dry
real(kind(1d0)) soildepthmeas
integer nlineswater
real(kind(1d0)) avkdn
real(kind(1d0)) nperestm_real
integer, dimension(24) c_hrprofsnowcwe
real(kind(1d0)) runoffagveg
integer, dimension(7) c_daywatper
character(len=20), dimension(ncolumnssoil) headersoil_file
integer, dimension(nsurf) c_soildens
integer, dimension(5) c_surf_rhocp5_bldgs
real(kind(1d0)) dectreeh
character(len=150) fileinputpath
real(kind(1d0)) kup
integer, dimension(nsurfincsnow) c_surf_rhocp1
real(kind(1d0)), dimension(:, :, :), allocatable dataoutdailystate
real(kind(1d0)) sdp
integer, dimension(24) c_hrprofpopwd
real(kind(1d0)) numpm
integer laicalcyes
integer, dimension(5) c_wall_rhocp2_bldgs
real(kind(1d0)) lai_obs
real(kind(1d0)) areaunir
real(kind(1d0)) wu_grass
real(kind(1d0)) faut
real(kind(1d0)) addpipes
real(kind(1d0)) tmin_id
real(kind(1d0)) lat
real(kind(1d0)), dimension(nsurf) emis
integer, parameter ncolumnsdataoutrsl
integer, parameter ncolumnsdataoutsnow
real(kind(1d0)), dimension(nsurf) soildepth
real(kind(1d0)) faitree
integer, dimension(nsurfincsnow) c_surf_k4
real(kind(1d0)), dimension(:, :), allocatable siteselect
integer, dimension(24) c_hrprofhumactivitywe
integer skipheadermet
integer, parameter maxncols_cmod
integer, parameter grasssurf
real(kind(1d0)) qs_obs
real(kind(1d0)), dimension(:, :), allocatable ohmcoefficients_coeff
real(kind(1d0)) psih
real(kind(1d0)), dimension(nvegsurf) gdd_id_prev
real(kind(1d0)) tau_a
real(kind(1d0)) radmeltfact
integer c_ahslopeheating_wd
integer nlinesorigestmdata
real(kind(1d0)) runoffsoil_per_tstep
real(kind(1d0)) e_mod
real(kind(1d0)) kclear
integer, dimension(nvegsurf) c_laimin
real(kind(1d0)) gl
real(kind(1d0)) irrfracgrass
real(kind(1d0)) treefractionirrigated
real(kind(1d0)), dimension(:, :), allocatable anthropogenic_coeff
real(kind(1d0)) snowpackpaved
real(kind(1d0)), dimension(maxnumberofgrids) mahanohm
integer, dimension(nsurfincsnow) c_surf_rhocp3
real(kind(1d0)) smcap
integer, parameter cts_it
real(kind(1d0)) mwh
real(kind(1d0)), dimension(0:23, 2) snowprof_24hr
real(kind(1d0)), dimension(:, :), allocatable modeldailystate
real(kind(1d0)) wu_evetr
integer, parameter ccmod
integer c_ahslopecooling_wd
integer c_frfossilfuel_nonheat
real(kind(1d0)), parameter rtd
real(kind(1d0)), dimension(:, :), allocatable estmfordisagg
real(kind(1d0)) qeout
real(kind(1d0)) tstar
character(len=150) solweigpoiout
integer, dimension(3) c_surf_thick2_paved
integer iy
integer, dimension(nvegsurf) c_laieq
real(kind(1d0)) qf_sahp
real(kind(1d0)), dimension(nsurf) stateout
real(kind(1d0)) wuareaevetr_m2
integer, parameter ccendi
integer, dimension(3) c_surf_k1_paved
integer, parameter maxlinesmet
integer, dimension(nsurfincsnow) c_ohmthresh_wd
integer usevegdem
integer, dimension(nsurf) cmod_state
real(kind(1d0)), dimension(nsurf) snowfrac
real(kind(1d0)) snowpackgrass
character(len=150) fileout
real(kind(1d0)) s_pa
integer, dimension(5) c_wall_rhocp3_bldgs
integer, parameter ivconif
real(kind(1d0)), dimension(nsurf) runoffsoil
real(kind(1d0)) qmrain
integer, dimension(5) c_surf_rhocp3_bldgs
integer roughlenheatmethod
integer, dimension(nvegsurf) c_min_res_bioco2
integer, dimension(nsurf) c_wgtograss
real(kind(1d0)), dimension(:), allocatable metfordisaggnext
integer, dimension(nsurf) c_stormin
real(kind(1d0)) qe_per_interval
integer, dimension(24) c_hrprofhumactivitywd
integer, dimension(nsurf) c_soilstcap
character(len=20), dimension(ncolumnsbiogen) headerbiogen_file
real(kind(1d0)) lup
integer skippedlines
real(kind(1d0)) addimpervious
real(kind(1d0)) psyc_hpa
character(len=14 *ncolumnsdataoutsuews) formatuse
real(kind(1d0)) tstep_real
integer, parameter ncolsestmdata
character(len=150) filemet
integer, dimension(5) c_internal_rhocp4_bldgs
real(kind(1d0)) g4
integer, dimension(5) c_surf_thick2_bldgs
integer, parameter ncolumnsanthropogenic
integer, parameter ncolumnssoil
integer dt_since_start
real(kind(1d0)), dimension(:, :), allocatable biogen_coeff
integer, dimension(nsurf) c_wgtorunoff
integer, dimension(nsurf) c_chanohm
real(kind(1d0)) waterstorcap
real(kind(1d0)) frfossilfuel_heat
real(kind(1d0)) faidectree
integer, dimension(5) c_nroom_bldgs
real(kind(1d0)), dimension(nsurf+1, 4, 3) ohm_coef
real(kind(1d0)) fc_point
real(kind(1d0)), dimension(nsurf) smd_nsurfout
real(kind(1d0)), dimension(nvegsurf) laimin
integer nofdaysthisyear
real(kind(1d0)) surpluswaterbody
integer, dimension(5) c_surf_rhocp4_bldgs
integer, dimension(nsurf) c_obssnrfrac
real(kind(1d0)) t2_c
real(kind(1d0)) qf_sahp_base
real(kind(1d0)) surfacearea
real(kind(1d0)) runoffpipes_m3
integer, parameter nvegsurf
integer, dimension(nsurfincsnow) c_surf_thick5
integer raindisaggmethod
real(kind(1d0)), dimension(nsurf) qn1_ind_snow
integer, parameter ccenda
real(kind(1d0)) runoffwaterbody
real(kind(1d0)), dimension(nsurf) freezstatevol
real(kind(1d0)), dimension(nsurf) wetthresh
integer nlinessiteselect
integer, dimension(nsurf) c_cpanohm
integer c_tcriticcooling_we
integer, dimension(nsurf) c_albmax
character(len=20) filecode
real(kind(1d0)) narp_tz
real(kind(1d0)) vegphenlumps
real(kind(1d0)), dimension(:), allocatable qeforcbl
real(kind(1d0)) albevetr0
integer nlinesnonveg
real(kind(1d0)) pervfraction
integer, dimension(24) c_hrprofwuautowd
character(len=20), dimension(ncolumnssnow) headersnow_file
real(kind(1d0)), dimension(nconns) gridtofrac
integer readblocksorigmetdata
integer, dimension(5) c_surf_rhocp1_bldgs
integer, dimension(5) c_surf_k2_bldgs
integer, dimension(3) c_surf_rhocp4_paved
real(kind(1d0)), dimension(:, :), allocatable wgwaterdist_coeff
integer, dimension(nsurf) cmod_snowfrac
real(kind(1d0)), dimension(maxnumberofgrids) a3anohm
character(len=10) gridid_text
integer nlinesmetdata
real(kind(1d0)) fc_build
integer ncblstep
integer firstyear
integer, dimension(3) c_surf_thick1_paved
real(kind(1d0)), dimension(3) ie_a
real(kind(1d0)) z0m_in
integer, parameter cts_twall_s
integer, dimension(3) c_surf_k5_paved
integer, dimension(5) c_internal_thick3_bldgs
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsuews
real(kind(1d0)) albdectr0
real(kind(1d0)) qmfreez
real(kind(1d0)), dimension(nsurf) deltaqi
real(kind(1d0)) qh_obs
real(kind(1d0)) narp_trans_site
integer, dimension(nsurf) c_wgtodectr
character(len=150) cdsmname
real(kind(1d0)) treeh
real(kind(1d0)), dimension(nvegsurf) lai_id
integer, dimension(nsurf) c_stormax
real(kind(1d0)), dimension(nsurf) stateold
integer evapmethod
real(kind(1d0)), dimension(nsurf) snowtosurf
real(kind(1d0)) gq
real(kind(1d0)) di_dt
real(kind(1d0)) molar
integer, parameter ccendw
integer cbluse
integer, dimension(nvegsurf) c_gsmax
integer lastgrid
integer nlinesbiogen
integer, dimension(nsurfincsnow) c_surf_k5
real(kind(1d0)), dimension(nsurf) lup_ind_snow
real(kind(1d0)) soilstorebsoilstate
character(len=20), dimension(ncolumnsnonveg) headernonveg_file
integer disaggmethod
real(kind(1d0)), dimension(2) trafficrate
integer, dimension(nsurf) c_statelimit
character(len=150) blout
real(kind(1d0)), dimension(:, :, :), allocatable dataoutrsl
real(kind(1d0)), dimension(5, nsurfincsnow) rsurf_suewssurfs
real(kind(1d0)), dimension(9, maxnumberofgrids) wuday_id_grids
real(kind(1d0)) azimuth
real(kind(1d0)), dimension(:, :), allocatable veg_coeff
integer, dimension(nsurf) cmod_snowwaterstate
character(len=20), dimension(ncolumnssnow) headersnow_reqd
real(kind(1d0)) lenday_id
real(kind(1d0)), dimension(nsurf) qm_melt
integer c_tcriticheating_wd
integer, dimension(3) c_code_estmclass_paved
real(kind(1d0)) snowpackevetr
real(kind(1d0)) volday
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_file
real(kind(1d0)) popdensnighttime
real(kind(1d0)) snowwaterpavedstate
character(len=20), dimension(ncolumnswater) headerwater_file
integer, dimension(24) c_hrprofenusewd
real(kind(1d0)) ch_per_interval
integer ldown_option
real(kind(1d0)) porosity_id
integer, dimension(5) c_surf_k1_bldgs
real(kind(1d0)) trafficunits
character(len=20), dimension(ncolumnsveg) headerveg_file
real(kind(1d0)) gs
real(kind(1d0)) laiinitialevetr
real(kind(1d0)) snowalb0
real(kind(1d0)), dimension(maxnumberofgrids) decidcap_id_grids
real(kind(1d0)) qh_r
real(kind(1d0)), dimension(nsurf) cpanohm
real(kind(1d0)) reall
real(kind(1d0)) soilstoredectrstate
integer solweig_ldown
real(kind(1d0)) smd
integer, dimension(nvegsurf) c_leafop1
real(kind(1d0)), dimension(2) qf_b
integer, dimension(nvegsurf) c_resp_a
real(kind(1d0)), dimension(nconns) gridto
real(kind(1d0)), dimension(nsurf) freezmelt
real(kind(1d0)) albmin_dectr
real(kind(1d0)), dimension(maxnumberofgrids) a1anohm
real(kind(1d0)) additionalwater
real(kind(1d0)) qsanohm
real(kind(1d0)) traffprofwe
real(kind(1d0)) vpd_hpa
integer, dimension(nsurfincsnow) c_a3_sdry
integer, dimension(nsurfincsnow) c_a1_wwet
real(kind(1d0)) q2_gkg
integer, dimension(nsurf) cmod_snowpack
integer, dimension(5) c_wall_thick5_bldgs
real(kind(1d0)), dimension(nvegsurf) basete
real(kind(1d0)) qe
character(len=20), dimension(ncolumnsprofiles) headerprofiles_reqd
integer, parameter ccendso
integer, parameter ccendestmb
integer, parameter ncolumnsdataoutsuews
real(kind(1d0)) albgrass_id
real(kind(1d0)), dimension(:), allocatable dqnsdt_grids
real(kind(1d0)), dimension(:), allocatable qhforcbl
real(kind(1d0)), parameter sigma_sb
real(kind(1d0)) snowpackwater
real(kind(1d0)) drainrt
integer nlinessnow
real(kind(1d0)) minqfmetab
integer smdmethod
integer, dimension(nvegsurf) c_biogenco2code
integer, parameter excesssurf
integer nlineswgwaterdist
integer readlinesorigestmdata
integer outinterval
real(kind(1d0)), dimension(nsurf) addwater
real(kind(1d0)) rss
integer ohmincqf
real(kind(1d0)), dimension(nsurf) snowpack
integer, dimension(nsurfincsnow) c_ohmcode_sdry
integer tmrt_out
integer, dimension(nvegsurf) c_basete
real(kind(1d0)) maxfcmetab
real(kind(1d0)), dimension(6, nsurf) storedrainprm
integer, dimension(nvegsurf) c_alpha_enh_bioco2
integer, dimension(5) c_internal_thick5_bldgs
integer, dimension(nsurfincsnow) c_a1_swet
integer readblocksmetdata
character(len=20), dimension(ncolumnsirrigation) headerirrigation_reqd
integer, dimension(3) c_surf_thick3_paved
real(kind(1d0)), dimension(nsurf) runoffsnow
real(kind(1d0)), dimension(nvegsurf, maxnumberofgrids) sdd_id_grids
integer ldown2d_out
real(kind(1d0)) h_mod
real(kind(1d0)), dimension(maxnumberofgrids) albgrass_id_grids
real(kind(1d0)) es_hpa
character(len=150) fileorigestm
real(kind(1d0)), dimension(nsurf) volswe
integer, dimension(5) c_wall_k1_bldgs
real(kind(1d0)) traffprofwd
real(kind(1d0)) overuse
real(kind(1d0)) chsnow_per_interval
real(kind(1d0)), dimension(0:23, 2) traffprof_24hr
real(kind(1d0)), dimension(7) daywatper
real(kind(1d0)) dqndt
real(kind(1d0)), dimension(nsurf) sfr
real(kind(1d0)) fcld
integer resolutionfilesin
real(kind(1d0)) laiinitialgrass
real(kind(1d0)) snowlimbldg
real(kind(1d0)), dimension(2) surplusevap
integer, dimension(5) c_surf_rhocp2_bldgs
real(kind(1d0)) decidcap0
real(kind(1d0)) snowwaterdectrstate
integer netradiationmethod
real(kind(1d0)), dimension(0:23, 2) wuprofa_24hr
real(kind(1d0)) rb
real(kind(1d0)), dimension(:, :), allocatable nonveg_coeff
real(kind(1d0)), dimension(nsurf) addwaterrunoff
integer, dimension(nsurf) heig
integer, dimension(nsurfincsnow) c_a3_wwet
real(kind(1d0)) nsh_real
real(kind(1d0)), dimension(:, :, :), allocatable metforcingdata
real(kind(1d0)) neut_limit
integer, dimension(5) multrainamongn
real(kind(1d0)) sice_hpa
real(kind(1d0)) gtemp
integer roughlenmommethod
real(kind(1d0)) g6
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsnow
character(len=20), dimension(ncolumnsveg) headerveg_reqd
integer, parameter maxncols_c
real(kind(1d0)) dry_gas
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_reqd
character(len=90) smithfile
integer waterusemethod
integer, dimension(nsurfincsnow) c_surf_k1
integer, dimension(nvegsurf) c_beta_bioco2
character(len=150) dsmpath
real(kind(1d0)) qh
integer c_ahslopeheating_we
real(kind(1d0)), dimension(nsurf) smd_nsurf
real(kind(1d0)) addwaterbody
integer lup2d_out
integer, dimension(nsurf) cmod_soilstate
integer, parameter maxnumberofgrids
real(kind(1d0)) alpha_qhqe
real(kind(1d0)), parameter rad2deg
integer, dimension(nsurf) c_wgtobldgs
integer rainamongn
integer, dimension(nsurf) c_wgtobsoil
real(kind(1d0)) narp_alb_snow
real(kind(1d0)), dimension(9) wuday_id
real(kind(1d0)) qe_per_tstep
integer, dimension(3) c_surf_rhocp1_paved
integer, dimension(3) c_surf_k3_paved
real(kind(1d0)), dimension(:, :, :), allocatable estmforcingdata
character(len=20), dimension(ncolumnssiteselect) headersiteselect_file
integer, dimension(nsurfincsnow) c_surf_thick1
real(kind(1d0)) s_hpa
real(kind(1d0)) fc
real(kind(1d0)), dimension(nvegsurf) min_res_bioco2
real(kind(1d0)) precip
real(kind(1d0)) frfossilfuel_nonheat
real(kind(1d0)), dimension(:, :), allocatable conductance_coeff
real(kind(1d0)) crwmin
real(kind(1d0)), dimension(nsurf) snowpackold
real(kind(1d0)) tstepcount
integer, parameter ncolumnsprofiles
real(kind(1d0)) bldgh
integer it
real(kind(1e10)) z0v
integer, dimension(5) c_wall_k4_bldgs
integer, dimension(24) c_hrprofwuautowe
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_reqd
real(kind(1d0)) gdd_2_0
integer diagnosedisagg
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_reqd
integer c_ahslopecooling_we
character(len=52 *ncolumnsdataoutsuews) longnmuse
real(kind(1d0)) qnm
integer, dimension(5) c_internal_k1_bldgs
integer, parameter ccendestmm
real(kind(1d0)) snowdensmax
integer, parameter decidsurf
real(kind(1d0)) z0m
real(kind(1d0)), dimension(:), allocatable tair_av_grids
real(kind(1d0)) st_per_interval
real(kind(1d0)) dectime
integer, dimension(5) c_ch_iroof_bldgs
real(kind(1d0)), parameter pi
real(kind(1d0)) ef_umolco2perj
real(kind(1d0)) tsurf
integer, dimension(5) c_surf_thick5_bldgs
real(kind(1d0)), dimension(ncolumnsdataoutdailystate - 5) dailystateline
integer, parameter pavsurf
real(kind(1d0)), dimension(2) ah_slope_cooling
real(kind(1d0)) tot_chang_per_tstep
integer, dimension(nsurf) cmds_snowdens
real(kind(1d0)), dimension(nsurf) alb
real(kind(1d0)) irrfracdecid
real(kind(1d0)) preciplimitalb
integer readlinesmetdata
real(kind(1d0)) h
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_file
real(kind(1d0)) pormin_dec
integer, dimension(nsurf) c_wgtoevetr
real(kind(1d0)) pavedfractionirrigated
real(kind(1d0)) tl
real(kind(1d0)) avdens
real(kind(1d0)) soilstoreevetrstate
integer lastyear
real(kind(1d0)) albgrass0
real(kind(1d0)), dimension(nvegsurf) beta_enh_bioco2
integer kup2d_out
integer, dimension(nsurf) c_kkanohm
integer, dimension(5) c_internal_k2_bldgs
integer, dimension(nvegsurf) c_baset
real(kind(1d0)), dimension(0:23, 2) humactivity_24hr
integer, dimension(3) c_surf_rhocp3_paved
real(kind(1d0)) transmin
real(kind(1d0)), dimension(:), allocatable dqndt_grids
real(kind(1d0)) qn1_obs
real(kind(1d0)) ev_per_interval
integer storageheatmethod
integer stabilitymethod
real(kind(1d0)) dens_dry
integer, dimension(24) c_hrprofenusewe
integer, dimension(5) c_wall_thick1_bldgs
integer, parameter ccendsn
integer nlines
real(kind(1d0)) grassfractionirrigated
real(kind(1d0)), dimension(:, :, :), allocatable modeloutputdata
real(kind(1d0)) waterholdcapfrac
integer, dimension(5) c_surf_k5_bldgs
integer, dimension(5) c_wall_k3_bldgs
real(kind(1d0)) capmin_dec
integer, parameter bldgsurf
integer, parameter watersurf
integer, dimension(nsurf) c_drcoef1
real(kind(1d0)), dimension(nsurf) runoff
character(len=20), dimension(ncolumnsconductance) headercond_file
integer, dimension(5) c_wall_thick2_bldgs
real(kind(1d0)) wdir
real(kind(1d0)) popprofwd
real(kind(1d0)), dimension(nvegsurf) gdd_id
character(len=14 *ncolumnsdataoutsuews) headeruse
real(kind(1d0)), dimension(nvegsurf) sddfull
integer, dimension(nvegsurf) c_gddfull
real(kind(1d0)) runoff_per_interval
real(kind(1d0)), dimension(:), allocatable ts5mindata_ir
real(kind(1d0)) crwmax
character(len=14 *ncolumnsdataoutsuews) unitsuse
character(len=20), dimension(ncolumnsconductance) headercond_reqd
real(kind(1d0)) rasnow
real(kind(1d0)), dimension(nsurf) soilstoreold
real(kind(1d0)) comp
integer multipleinitfiles
real(kind(1d0)), dimension(:, :), allocatable profiles_coeff
real(kind(1d0)), dimension(nsurf) lup_ind_nosnow
real(kind(1d0)), dimension(nsurf) kup_ind
real(kind(1d0)) qn1_snowfree
real(kind(1d0)) xbo
integer, dimension(5) c_internal_rhocp1_bldgs
real(kind(1d0)) enef_v_jkm
real(kind(1d0)), dimension(9) wuday_id_prev
character(len=150) fileoutputpath
real(kind(1d0)) qsestm
real(kind(1d0)), dimension(maxnumberofgrids) tmax_id_grids
real(kind(1d0)), parameter c2k
real(kind(1d0)), dimension(2) qf0_beu
character(len=150) filechoices
real(kind(1d0)) swe
real(kind(1d0)) grav
real(kind(1d0)) kdiff
integer, dimension(24) c_hrprofpopwe
real(kind(1d0)), dimension(:, :), allocatable metfordisagg
real(kind(1d0)), dimension(nvegsurf) baset
real(kind(1d0)) tempveg
real(kind(1d0)) press_hpa
integer, dimension(nsurf) c_emis
integer, dimension(nsurfincsnow) c_surf_k3
real(kind(1d0)) snowalbmin
real(kind(1d0)), dimension(7) daywat
real(kind(1d0)) runofftowater
real(kind(1d0)) surf_chang_per_tstep
real(kind(1d0)) flowchange
real(kind(1d0)), dimension(nsurf) qm_rain
integer firstgrid
integer, dimension(5) c_ch_iwall_bldgs
real(kind(1d0)), dimension(nvegsurf, maxnumberofgrids) gdd_id_grids
integer, dimension(nsurfincsnow) c_ohmthresh_sw
integer, dimension(nsurfincsnow) c_surf_rhocp4
integer gridcounter
integer c_tcriticcooling_wd
real(kind(1d0)), dimension(nvegsurf) beta_bioco2
real(kind(1d0)), dimension(5) datetimeline
real(kind(1d0)), dimension(nsurf) tsurf_ind
integer skippedlinesorigestm
integer, dimension(5) c_wall_rhocp1_bldgs
real(kind(1d0)) albdectr_id
integer, dimension(5) c_surf_thick3_bldgs
real(kind(1d0)) irrfracconif
integer, dimension(3) c_surf_k4_paved
integer, parameter ivdecid
integer, dimension(5) c_internal_thick1_bldgs
integer, dimension(3) c_surf_thick5_paved
real(kind(1d0)) qe_obs
real(kind(1d0)), dimension(nsurf) tsurf_ind_snow
real(kind(1d0)), dimension(nsurf+1, nsurf - 1) waterdist
real(kind(1d0)) timezone
real(kind(1d0)) decidcap_id
real(kind(1d0)) albmax_dectr
real(kind(1d0)) vsmd
character(len=20), dimension(ncolumnsnonveg) headernonveg_reqd
real(kind(1d0)) rst
real(kind(1d0)) s1
real(kind(1d0)) precip_hr