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