SUEWS API Site
Documentation of SUEWS source code
Modules | Functions/Subroutines | Variables
suews_ctrl_input.f95 File Reference

Go to the source code of this file.

Modules

module  run_info
 
module  metdisagg
 

Functions/Subroutines

subroutine metread (lfn, MetArray, InputmetFormat, ldown_option, NetRadiationMethod, snowUse, SMDMethod, SoilDepthMeas, SoilRocks, SoilDensity, SmCap)
 
subroutine run_control (eval, LowerLimit, Upperlimit)
 
subroutine skipheader (lfn, skip)
 
subroutine inputheadercheck (FileName)
 
real(kind(1d0)) function get_prof_spectime_inst (Hour, Min, Sec, Prof_24h)
 
real(kind(1d0)) function get_prof_spectime_mean (Hour, Min, Sec, Prof_24h)
 
real(kind(1d0)) function get_prof_spectime_sum (Hour, Min, Sec, Prof_24h, dt)
 
subroutine codematchohm (Gridiv, is, SWWD)
 
subroutine codematchestm (Gridiv, is)
 
subroutine codematchestm_class (Gridiv, is, ii)
 
subroutine codematchprof (Gridiv, SurfaceCharCodeCol)
 
subroutine codematchdist (rr, CodeCol, codeColSameSurf)
 
subroutine codematchnonveg (rr, CodeCol)
 
subroutine codematchveg (rr, CodeCol)
 
subroutine codematchwater (rr, CodeCol)
 
subroutine codematchsnow (rr, CodeCol)
 
subroutine codematchconductance (rr, CodeCol)
 
subroutine codematchanthropogenic (rr, CodeCol)
 
subroutine codematchirrigation (rr, CodeCol)
 
subroutine codematchsoil (Gridiv, SurfaceCharCodeCol)
 
subroutine codematchbiogen (Gridiv, SurfaceCharCodeCol)
 
subroutine metdisagg::disaggregatemet (iBlock, igrid)
 
subroutine metdisagg::disaggregateestm (iBlock)
 
subroutine metdisagg::disaggregatedatetime (DateTimeForDisagg, tstep, Nper, ReadLinesOrigMetDataMax, DateTimeDscd)
 
real(kind(1d0)) function, dimension(readlinesorig_loc *nper_loc) metdisagg::disagg_lin (Slow, SlowPrev, SlowNext, DisaggType, Nper_loc, ReadLinesOrig_loc, ReadLinesOrigMax_loc, iBlock)
 
real(kind(1d0)) function, dimension(readlinesorig_loc *nper_loc) metdisagg::disaggp_amongn (Slow, amongN, Nper_loc, ReadLinesOrig_loc, ReadLinesOrigMax_loc)
 
real(kind(1d0)) function, dimension(readlinesorig_loc *nper_loc) metdisagg::disaggp_amongnmult (Slow, multupperI, multamongN, Nper_loc, ReadLinesOrig_loc, ReadLinesOrigMax_loc)
 
integer function, dimension(:), allocatable metdisagg::randomsamples (N, OutOf)
 

Variables

character(len=90), dimension(14) run_info::text
 
integer run_info::lim0 = 0
 
integer run_info::lim1 = 1
 
integer run_info::lim2 = 2
 
integer run_info::lim4 = 4
 
integer run_info::lim3 = 3
 
integer run_info::lim6 = 6
 
integer run_info::lim8 = 8
 
integer run_info::lim12 = 12
 
integer run_info::lfn_us
 
logical run_info::file_qs
 

Function/Subroutine Documentation

◆ codematchanthropogenic()

subroutine codematchanthropogenic ( integer  rr,
integer  CodeCol 
)

Definition at line 1228 of file suews_ctrl_input.f95.

References allocatearray::anthropogenic_coeff, colnamesinputfiles::ca_code, errorhint(), initial::iv5, initial::nlinesanthropogenic, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::siteselect.

Referenced by initializesurfacecharacteristics().

1228  ! Matches AnthropogenicHeat characteristics via codes in SiteSelect
1229  ! HCW 20 Nov 2014
1230  ! MH 21 Jun 2017
1231  ! ---------------------------------------------------------
1232 
1233  USE allocatearray
1234  USE initial
1235  USE colnamesinputfiles
1236  USE defaultnotused
1237 
1238  IMPLICIT NONE
1239 
1240  INTEGER:: rr
1241  INTEGER:: codecol
1242 
1243  iv5 = 0 ! Reset iv5 to zero
1244 
1245  DO iv5 = 1, nlinesanthropogenic
1246  IF (anthropogenic_coeff(iv5, ca_code) == siteselect(rr, codecol)) THEN
1247  EXIT
1248  ELSEIF (iv5 == nlinesanthropogenic) THEN
1249  WRITE (*, *) 'Program stopped! Anthropogenic code ', siteselect(rr, codecol), &
1250  'not found in SUEWS_AnthropogenicEmission.txt.'
1251  CALL errorhint(57, 'Cannot find code in SUEWS_AnthropogenicEmission.txt', &
1252  siteselect(rr, codecol), notused, notusedi)
1253  ENDIF
1254  ENDDO
1255 
1256  RETURN
real(kind(1d0)) notused
integer nlinesanthropogenic
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable anthropogenic_coeff
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchbiogen()

subroutine codematchbiogen ( integer  Gridiv,
integer  SurfaceCharCodeCol 
)

Definition at line 1321 of file suews_ctrl_input.f95.

References allocatearray::biogen_coeff, colnamesinputfiles::cb_code, errorhint(), initial::iv5, initial::nlinesbiogen, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

1321  ! Matches Biogen characteristics via codes in *SuraceChar*
1322  ! MH 16 Jun 2017
1323  ! ---------------------------------------------------------
1324 
1325  USE allocatearray
1326  USE initial
1327  USE colnamesinputfiles
1328  USE defaultnotused
1329 
1330  IMPLICIT NONE
1331 
1332  INTEGER:: gridiv
1333  INTEGER:: surfacecharcodecol
1334 
1335  iv5 = 0 ! Reset iv5 to zero
1336 
1337  DO iv5 = 1, nlinesbiogen
1338  IF (biogen_coeff(iv5, cb_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1339  EXIT
1340  ELSEIF (iv5 == nlinesbiogen) THEN
1341  WRITE (*, *) 'Program stopped! Biogen code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_BiogenCO2.txt.'
1342  CALL errorhint(57, 'Cannot find code in SUEWS_BiogenCO2.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1343  ENDIF
1344  ENDDO
1345 
1346  RETURN
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable surfacechar
real(kind(1d0)), dimension(:, :), allocatable biogen_coeff
integer nlinesbiogen
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchconductance()

subroutine codematchconductance ( integer  rr,
integer  CodeCol 
)

Definition at line 1198 of file suews_ctrl_input.f95.

References colnamesinputfiles::cc_code, allocatearray::conductance_coeff, errorhint(), initial::iv5, initial::nlinesconductance, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::siteselect.

Referenced by initializesurfacecharacteristics().

1198  ! Matches Conductance characteristics via codes in SiteSelect
1199  ! HCW 20 Nov 2014
1200  ! ---------------------------------------------------------
1201 
1202  USE allocatearray
1203  USE initial
1204  USE colnamesinputfiles
1205  USE defaultnotused
1206 
1207  IMPLICIT NONE
1208 
1209  INTEGER:: rr
1210  INTEGER:: codecol
1211 
1212  iv5 = 0 ! Reset iv5 to zero
1213 
1214  DO iv5 = 1, nlinesconductance
1215  IF (conductance_coeff(iv5, cc_code) == siteselect(rr, codecol)) THEN
1216  EXIT
1217  ELSEIF (iv5 == nlinesconductance) THEN
1218  WRITE (*, *) 'Program stopped! Conductance code ', siteselect(rr, codecol), 'not found in SUEWS_Conductance.txt.'
1219  CALL errorhint(57, 'Cannot find code in SUEWS_Conductance.txt', siteselect(rr, codecol), notused, notusedi)
1220  ENDIF
1221  ENDDO
1222 
1223  RETURN
real(kind(1d0)) notused
integer nlinesconductance
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable conductance_coeff
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchdist()

subroutine codematchdist ( integer  rr,
integer  CodeCol,
integer  codeColSameSurf 
)

Definition at line 1019 of file suews_ctrl_input.f95.

References colnamesinputfiles::c_wgwatercode, colnamesinputfiles::cwg_code, colnamesinputfiles::cwg_topaved, colnamesinputfiles::cwg_torunoff, colnamesinputfiles::cwg_tosoilstore, errorhint(), initial::iv5, initial::nlineswgwaterdist, defaultnotused::notused, defaultnotused::notusedi, allocatearray::siteselect, and allocatearray::wgwaterdist_coeff.

Referenced by initializesurfacecharacteristics().

1019  ! Matches within-grid water distribution via codes
1020  ! Checks water cannot flow from one surface to the same surface
1021  ! Checks water distribution fractions sum to 1.
1022  ! HCW 10 Nov 2014
1023  ! ---------------------------------------------------------
1024 
1025  USE allocatearray
1026  USE initial
1027  USE colnamesinputfiles
1028  USE defaultnotused
1029 
1030  IMPLICIT NONE
1031 
1032  INTEGER:: rr
1033  INTEGER:: codecol, codecolsamesurf
1034 
1035  iv5 = 0 ! Reset iv5 to zero
1036 
1037  DO iv5 = 1, nlineswgwaterdist
1038  IF (wgwaterdist_coeff(iv5, cwg_code) == siteselect(rr, codecol)) THEN
1039  EXIT
1040  ELSEIF (iv5 == nlineswgwaterdist) THEN
1041  WRITE (*, *) 'Program stopped! Within-grid water distribution code ', siteselect(rr, codecol), &
1042  'not found in SUEWS_WaterDistWithinGrid.txt.'
1043  CALL errorhint(57, 'Cannot find code in SUEWS_WaterDistWithinGrid.txt', siteselect(rr, codecol), notused, notusedi)
1044  ENDIF
1045  ENDDO
1046 
1047  ! Check water flow to same surface is zero (previously in RunControlByGridByYear in SUEWS_Initial.f95)
1048  IF (wgwaterdist_coeff(iv5, codecolsamesurf) /= 0) THEN
1049  CALL errorhint(8, 'Diagonal elements should be zero as water cannot move from one surface to the same surface.', &
1050  wgwaterdist_coeff(iv5, codecolsamesurf), notused, notusedi)
1051  ENDIF
1052 
1053  !! QUESTION: MODIFY THIS?
1054  ! Check water either moves to runoff or soilstore, but not to both
1055  ! Model returns an error if both ToRunoff and ToSoilStore are non-zero.
1056  !! - Probably should remove this...
1057  !! - Also look at SUEWS_translate, as the non-zero value goes into WaterDist
1059  CALL errorhint(9, 'One of these (ToRunoff,ToSoilStore) should be zero.', &
1061  ENDIF
1062 
1063  !! Also do for water surface once implemented
1064  IF (codecol /= c_wgwatercode) THEN ! Except for Water surface
1065  ! Check total water distribution from each surface adds up to 1
1066  IF (sum(wgwaterdist_coeff(iv5, cwg_topaved:cwg_tosoilstore)) > 1.0000001 &
1067  .OR. sum(wgwaterdist_coeff(iv5, cwg_topaved:cwg_tosoilstore)) < 0.9999999) THEN
1068  CALL errorhint(8, 'Total water distribution from each surface should add up to 1.', &
1070  ENDIF
1071  ENDIF
1072 
1073  RETURN
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable wgwaterdist_coeff
integer nlineswgwaterdist
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchestm()

subroutine codematchestm ( integer  Gridiv,
integer  is 
)

Definition at line 909 of file suews_ctrl_input.f95.

References allocatearray::c_estmcode, colnamesinputfiles::ce_code, errorhint(), allocatearray::estmcoefficients_coeff, initial::iv5, initial::nlinesestmcoefficients, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

909  ! Matches ESTM coefficients via ESTM code
910  ! Modified HCW 16 Jun 2016 - for SUEWS surface types
911  ! - removed summer/winter wet/dry option
912  ! S.O. 04 Feb 2016
913  ! ---------------------------------------------------------
914 
915  USE allocatearray
916  USE initial
918  USE defaultnotused
919 
920  IMPLICIT NONE
921 
922  INTEGER:: gridiv
923  INTEGER:: is
924 
925  iv5 = 0 ! Reset iv5 to zero
926 
928  IF (estmcoefficients_coeff(iv5, ce_code) == surfacechar(gridiv, c_estmcode(is))) THEN
929  EXIT
930  ELSEIF (iv5 == nlinesestmcoefficients) THEN
931  WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_estmcode(is)), &
932  'not found in ESTM_Coefficients.txt for surface', is, '.'
933  CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_estmcode(is)), notused, notusedi)
934  ENDIF
935  ENDDO
936 
937  RETURN
integer nlinesestmcoefficients
real(kind(1d0)), dimension(:, :), allocatable estmcoefficients_coeff
real(kind(1d0)) notused
integer, dimension(nsurfincsnow) c_estmcode
real(kind(1d0)), dimension(:, :), allocatable surfacechar
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchestm_class()

subroutine codematchestm_class ( integer  Gridiv,
integer  is,
integer  ii 
)

Definition at line 942 of file suews_ctrl_input.f95.

References allocatearray::bldgsurf, colnamesinputfiles::c_code_estmclass_bldgs, colnamesinputfiles::c_code_estmclass_paved, colnamesinputfiles::ce_code, errorhint(), allocatearray::estmcoefficients_coeff, initial::iv5, initial::nlinesestmcoefficients, defaultnotused::notused, defaultnotused::notusedi, allocatearray::pavsurf, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

942  ! Matches ESTM coefficients via ESTM codes in SiteSelect for Paved and Bldgs ESTM classes
943  ! HCW 16 Jun 2016
944  ! ---------------------------------------------------------
945 
946  USE allocatearray
947  USE initial
949  USE defaultnotused
950 
951  IMPLICIT NONE
952 
953  INTEGER:: gridiv
954  INTEGER:: is, ii
955 
956  iv5 = 0 ! Reset iv5 to zero
957 
958  IF (is == bldgsurf) THEN
961  EXIT
962  ELSEIF (iv5 == nlinesestmcoefficients) THEN
963  WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_code_estmclass_bldgs(ii)), &
964  'not found in ESTM_Coefficients.txt for surface', is, '.'
965  CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_code_estmclass_bldgs(ii)), notused, notusedi)
966  ENDIF
967  ENDDO
968  ELSEIF (is == pavsurf) THEN
971  EXIT
972  ELSEIF (iv5 == nlinesestmcoefficients) THEN
973  WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_code_estmclass_paved(ii)), &
974  'not found in ESTM_Coefficients.txt for surface', is, '.'
975  CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_code_estmclass_paved(ii)), notused, notusedi)
976  ENDIF
977  ENDDO
978  ELSE
979  WRITE (*, *) 'Problem with CodeMatchESTM_Class (in SUEWS_CodeMatch.f95). ', is, ' not correct. Needs to be either ', &
980  '1 = Paved surfaced, 2 = Bldgs surfaces.'
981  stop
982  ENDIF
983  RETURN
integer nlinesestmcoefficients
integer, dimension(5) c_code_estmclass_bldgs
real(kind(1d0)), dimension(:, :), allocatable estmcoefficients_coeff
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable surfacechar
integer, dimension(3) c_code_estmclass_paved
integer, parameter pavsurf
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
integer, parameter bldgsurf
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchirrigation()

subroutine codematchirrigation ( integer  rr,
integer  CodeCol 
)

Definition at line 1261 of file suews_ctrl_input.f95.

References colnamesinputfiles::cir_code, errorhint(), allocatearray::irrigation_coeff, initial::iv5, initial::nlinesirrigation, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::siteselect.

Referenced by initializesurfacecharacteristics().

1261  ! Matches Irrigation characteristics via codes in SiteSelect
1262  ! HCW 20 Nov 2014
1263  ! ---------------------------------------------------------
1264 
1265  USE allocatearray
1266  USE initial
1267  USE colnamesinputfiles
1268  USE defaultnotused
1269 
1270  IMPLICIT NONE
1271 
1272  INTEGER:: rr
1273  INTEGER:: codecol
1274 
1275  iv5 = 0 ! Reset iv5 to zero
1276 
1277  DO iv5 = 1, nlinesirrigation
1278  IF (irrigation_coeff(iv5, cir_code) == siteselect(rr, codecol)) THEN
1279  EXIT
1280  ELSEIF (iv5 == nlinesirrigation) THEN
1281  WRITE (*, *) 'Program stopped! Irrigation code ', siteselect(rr, codecol), 'not found in SUEWS_Irrigation.txt.'
1282  CALL errorhint(57, 'Cannot find code in SUEWS_Irrigation.txt', siteselect(rr, codecol), notused, notusedi)
1283  ENDIF
1284  ENDDO
1285 
1286  RETURN
real(kind(1d0)), dimension(:, :), allocatable irrigation_coeff
real(kind(1d0)) notused
integer nlinesirrigation
real(kind(1d0)), dimension(:, :), allocatable siteselect
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchnonveg()

subroutine codematchnonveg ( integer  rr,
integer  CodeCol 
)

Definition at line 1078 of file suews_ctrl_input.f95.

References colnamesinputfiles::ci_code, errorhint(), initial::iv5, initial::nlinesnonveg, allocatearray::nonveg_coeff, defaultnotused::notused, defaultnotused::notusedi, and allocatearray::siteselect.

Referenced by initializesurfacecharacteristics().

1078  ! Matches Impervious characteristics via codes in SiteSelect
1079  ! HCW 20 Nov 2014
1080  ! ---------------------------------------------------------
1081 
1082  USE allocatearray
1083  USE initial
1084  USE colnamesinputfiles
1085  USE defaultnotused
1086 
1087  IMPLICIT NONE
1088 
1089  INTEGER:: rr
1090  INTEGER:: codecol
1091 
1092  iv5 = 0 ! Reset iv5 to zero
1093 
1094  DO iv5 = 1, nlinesnonveg
1095  IF (nonveg_coeff(iv5, ci_code) == siteselect(rr, codecol)) THEN
1096  EXIT
1097  ELSEIF (iv5 == nlinesnonveg) THEN
1098  WRITE (*, *) 'Program stopped! NonVeg code ', siteselect(rr, codecol), 'not found in SUEWS_NonVeg.txt.'
1099  CALL errorhint(57, 'Cannot find code in SUEWS_NonVeg.txt', siteselect(rr, codecol), notused, notusedi)
1100  ENDIF
1101  ENDDO
1102 
1103  RETURN
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable siteselect
integer nlinesnonveg
real(kind(1d0)), dimension(:, :), allocatable nonveg_coeff
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchohm()

subroutine codematchohm ( integer  Gridiv,
integer  is,
character(len=4)  SWWD 
)

Definition at line 832 of file suews_ctrl_input.f95.

References allocatearray::c_ohmcode_sdry, allocatearray::c_ohmcode_swet, allocatearray::c_ohmcode_wdry, allocatearray::c_ohmcode_wwet, colnamesinputfiles::co_code, errorhint(), initial::iv5, initial::nlinesohmcoefficients, defaultnotused::notused, defaultnotused::notusedi, allocatearray::ohmcoefficients_coeff, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

832  ! Matches OHM coefficients a1, a2, a3 via OHM codes
833  ! for summer/winter wet/dry conditions
834  ! HCW 03 Nov 2014
835  ! ---------------------------------------------------------
836 
837  USE allocatearray
838  USE initial
840  USE defaultnotused
841 
842  IMPLICIT NONE
843 
844  INTEGER:: gridiv
845  INTEGER:: is
846  CHARACTER(len=4):: swwd
847 
848  iv5 = 0 ! Reset iv5 to zero
849 
850  IF (swwd == 'SWet') THEN
851 
852  DO iv5 = 1, nlinesohmcoefficients
854  EXIT
855  ELSEIF (iv5 == nlinesohmcoefficients) THEN
856  WRITE (*, *) 'Program stopped! OHM code (summer wet)', surfacechar(gridiv, c_ohmcode_swet(is)), &
857  'not found in OHM_Coefficients.txt for surface', is, '.'
858  CALL errorhint(57, 'Cannot find OHM code (summer wet)', surfacechar(gridiv, c_ohmcode_swet(is)), notused, notusedi)
859  ENDIF
860  ENDDO
861 
862  ELSEIF (swwd == 'SDry') THEN
863 
864  DO iv5 = 1, nlinesohmcoefficients
866  EXIT
867  ELSEIF (iv5 == nlinesohmcoefficients) THEN
868  WRITE (*, *) 'Program stopped! OHM code (summer dry)', surfacechar(gridiv, c_ohmcode_sdry(is)), &
869  'not found in OHM_Coefficients.txt for surface', is, '.'
870  CALL errorhint(57, 'Cannot find OHM code (summer dry)', surfacechar(gridiv, c_ohmcode_sdry(is)), notused, notusedi)
871  ENDIF
872  ENDDO
873 
874  ELSEIF (swwd == 'WWet') THEN
875 
876  DO iv5 = 1, nlinesohmcoefficients
878  EXIT
879  ELSEIF (iv5 == nlinesohmcoefficients) THEN
880  WRITE (*, *) 'Program stopped! OHM code (winter wet)', surfacechar(gridiv, c_ohmcode_wwet(is)), &
881  'not found in OHM_Coefficients.txt for surface', is, '.'
882  CALL errorhint(57, 'Cannot find OHM code (winter wet)', surfacechar(gridiv, c_ohmcode_wwet(is)), notused, notusedi)
883  ENDIF
884  ENDDO
885 
886  ELSEIF (swwd == 'WDry') THEN
887 
888  DO iv5 = 1, nlinesohmcoefficients
890  EXIT
891  ELSEIF (iv5 == nlinesohmcoefficients) THEN
892  WRITE (*, *) 'Program stopped! OHM code (winter dry)', surfacechar(gridiv, c_ohmcode_wdry(is)), &
893  'not found in OHM_Coefficients.txt for surface', is, '.'
894  CALL errorhint(57, 'Cannot find OHM code (winter dry)', surfacechar(gridiv, c_ohmcode_wdry(is)), notused, notusedi)
895  ENDIF
896  ENDDO
897 
898  ELSE
899  WRITE (*, *) 'Problem with CodeMatchOHM (in SUEWS_CodeMatch.f95). ', swwd, ' not recognised. Needs to be one of: ', &
900  'SWet = Summer Wet, SDry = Summer Dry, WWet = WinterWet, WDry = Winter Dry. N.B. Case sensitive. '
901  stop
902  ENDIF
903 
904  RETURN
integer, dimension(nsurfincsnow) c_ohmcode_swet
real(kind(1d0)) notused
integer, dimension(nsurfincsnow) c_ohmcode_wwet
integer, dimension(nsurfincsnow) c_ohmcode_wdry
real(kind(1d0)), dimension(:, :), allocatable surfacechar
integer nlinesohmcoefficients
real(kind(1d0)), dimension(:, :), allocatable ohmcoefficients_coeff
integer, dimension(nsurfincsnow) c_ohmcode_sdry
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchprof()

subroutine codematchprof ( integer  Gridiv,
integer  SurfaceCharCodeCol 
)

Definition at line 988 of file suews_ctrl_input.f95.

References colnamesinputfiles::cpr_code, errorhint(), initial::iv5, initial::nlinesprofiles, defaultnotused::notused, defaultnotused::notusedi, allocatearray::profiles_coeff, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

988  ! Matches Soil characteristics via codes in *SurfaceChar*
989  ! for energy use/water use/snow clearing
990  ! HCW 20 Nov 2014
991  ! ---------------------------------------------------------
992 
993  USE allocatearray
994  USE initial
996  USE defaultnotused
997 
998  IMPLICIT NONE
999 
1000  INTEGER:: gridiv
1001  INTEGER:: surfacecharcodecol
1002 
1003  iv5 = 0 ! Reset iv5 to zero
1004 
1005  DO iv5 = 1, nlinesprofiles
1006  IF (profiles_coeff(iv5, cpr_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1007  EXIT
1008  ELSEIF (iv5 == nlinesprofiles) THEN
1009  WRITE (*, *) 'Program stopped! Profile code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_Profiles.txt.'
1010  CALL errorhint(57, 'Cannot find code in SUEWS_Profiles.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1011  ENDIF
1012  ENDDO
1013 
1014  RETURN
integer nlinesprofiles
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable surfacechar
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
real(kind(1d0)), dimension(:, :), allocatable profiles_coeff
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchsnow()

subroutine codematchsnow ( integer  rr,
integer  CodeCol 
)

Definition at line 1168 of file suews_ctrl_input.f95.

References colnamesinputfiles::cs_code, errorhint(), initial::iv5, initial::nlinessnow, defaultnotused::notused, defaultnotused::notusedi, allocatearray::siteselect, and allocatearray::snow_coeff.

Referenced by initializesurfacecharacteristics().

1168  ! Matches Snow characteristics via codes in SiteSelect
1169  ! HCW 20 Nov 2014
1170  ! ---------------------------------------------------------
1171 
1172  USE allocatearray
1173  USE initial
1174  USE colnamesinputfiles
1175  USE defaultnotused
1176 
1177  IMPLICIT NONE
1178 
1179  INTEGER:: rr
1180  INTEGER:: codecol
1181 
1182  iv5 = 0 ! Reset iv5 to zero
1183 
1184  DO iv5 = 1, nlinessnow
1185  IF (snow_coeff(iv5, cs_code) == siteselect(rr, codecol)) THEN
1186  EXIT
1187  ELSEIF (iv5 == nlinessnow) THEN
1188  WRITE (*, *) 'Program stopped! Snow code ', siteselect(rr, codecol), 'not found in SUEWS_Snow.txt.'
1189  CALL errorhint(57, 'Cannot find code in SUEWS_Snow.txt', siteselect(rr, codecol), notused, notusedi)
1190  ENDIF
1191  ENDDO
1192 
1193  RETURN
real(kind(1d0)), dimension(:, :), allocatable snow_coeff
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable siteselect
integer nlinessnow
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchsoil()

subroutine codematchsoil ( integer  Gridiv,
integer  SurfaceCharCodeCol 
)

Definition at line 1291 of file suews_ctrl_input.f95.

References colnamesinputfiles::cso_code, errorhint(), initial::iv5, initial::nlinessoil, defaultnotused::notused, defaultnotused::notusedi, allocatearray::soil_coeff, and allocatearray::surfacechar.

Referenced by initializesurfacecharacteristics().

1291  ! Matches Soil characteristics via codes in *SurfaceChar*
1292  ! HCW 20 Nov 2014
1293  ! ---------------------------------------------------------
1294 
1295  USE allocatearray
1296  USE initial
1297  USE colnamesinputfiles
1298  USE defaultnotused
1299 
1300  IMPLICIT NONE
1301 
1302  INTEGER:: gridiv
1303  INTEGER:: surfacecharcodecol
1304 
1305  iv5 = 0 ! Reset iv5 to zero
1306 
1307  DO iv5 = 1, nlinessoil
1308  IF (soil_coeff(iv5, cso_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1309  EXIT
1310  ELSEIF (iv5 == nlinessoil) THEN
1311  WRITE (*, *) 'Program stopped! Soil code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_Soil.txt.'
1312  CALL errorhint(57, 'Cannot find code in SUEWS_Soil.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1313  ENDIF
1314  ENDDO
1315 
1316  RETURN
integer nlinessoil
real(kind(1d0)), dimension(:, :), allocatable soil_coeff
real(kind(1d0)) notused
real(kind(1d0)), dimension(:, :), allocatable surfacechar
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchveg()

subroutine codematchveg ( integer  rr,
integer  CodeCol 
)

Definition at line 1108 of file suews_ctrl_input.f95.

References colnamesinputfiles::cp_code, errorhint(), initial::iv5, initial::nlinesveg, defaultnotused::notused, defaultnotused::notusedi, allocatearray::siteselect, and allocatearray::veg_coeff.

Referenced by initializesurfacecharacteristics().

1108  ! Matches Pervious characteristics via codes in SiteSelect
1109  ! HCW 20 Nov 2014
1110  ! ---------------------------------------------------------
1111 
1112  USE allocatearray
1113  USE initial
1114  USE colnamesinputfiles
1115  USE defaultnotused
1116 
1117  IMPLICIT NONE
1118 
1119  INTEGER:: rr
1120  INTEGER:: codecol
1121 
1122  iv5 = 0 ! Reset iv5 to zero
1123 
1124  DO iv5 = 1, nlinesveg
1125  IF (veg_coeff(iv5, cp_code) == siteselect(rr, codecol)) THEN
1126  EXIT
1127  ELSEIF (iv5 == nlinesveg) THEN
1128  WRITE (*, *) 'Program stopped! Veg code ', siteselect(rr, codecol), 'not found in SUEWS_Vegs.txt.'
1129  CALL errorhint(57, 'Cannot find code in SUEWS_Veg.txt', siteselect(rr, codecol), notused, notusedi)
1130  ENDIF
1131  ENDDO
1132 
1133  RETURN
real(kind(1d0)) notused
integer nlinesveg
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable veg_coeff
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ codematchwater()

subroutine codematchwater ( integer  rr,
integer  CodeCol 
)

Definition at line 1138 of file suews_ctrl_input.f95.

References colnamesinputfiles::cw_code, errorhint(), initial::iv5, initial::nlineswater, defaultnotused::notused, defaultnotused::notusedi, allocatearray::siteselect, and allocatearray::water_coeff.

Referenced by initializesurfacecharacteristics().

1138  ! Matches Water characteristics via codes in SiteSelect
1139  ! HCW 20 Nov 2014
1140  ! ---------------------------------------------------------
1141 
1142  USE allocatearray
1143  USE initial
1144  USE colnamesinputfiles
1145  USE defaultnotused
1146 
1147  IMPLICIT NONE
1148 
1149  INTEGER:: rr
1150  INTEGER:: codecol
1151 
1152  iv5 = 0 ! Reset iv5 to zero
1153 
1154  DO iv5 = 1, nlineswater
1155  IF (water_coeff(iv5, cw_code) == siteselect(rr, codecol)) THEN
1156  EXIT
1157  ELSEIF (iv5 == nlineswater) THEN
1158  WRITE (*, *) 'Program stopped! Water code ', siteselect(rr, codecol), 'not found in SUEWS_Water.txt.'
1159  CALL errorhint(57, 'Cannot find code in SUEWS_Water.txt', siteselect(rr, codecol), notused, notusedi)
1160  ENDIF
1161  ENDDO
1162 
1163  RETURN
real(kind(1d0)), dimension(:, :), allocatable water_coeff
real(kind(1d0)) notused
integer nlineswater
real(kind(1d0)), dimension(:, :), allocatable siteselect
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_prof_spectime_inst()

real(kind(1d0)) function get_prof_spectime_inst ( integer, intent(in)  Hour,
integer, intent(in)  Min,
integer, intent(in)  Sec,
real(kind(1d0)), dimension(0:23), intent(in)  Prof_24h 
)

Definition at line 743 of file suews_ctrl_input.f95.

743 
744  IMPLICIT NONE
745 
746  INTEGER :: i, j !Used to count over hours and sub-hourly timesteps
747  INTEGER, INTENT(IN) :: hour, min, sec
748  INTEGER :: total_sec, secperhour
749  REAL(KIND(1d0)), DIMENSION(0:23), INTENT(IN) :: prof_24h
750  REAL(KIND(1d0)):: deltaprof !Change in hourly profiles per model timestep
751  REAL(KIND(1d0)) :: prof_currtime
752 
753  total_sec = min*60 + sec
754  secperhour = 3600
755 
756  i = hour
757  j = i + 1
758  IF (j == 24) j = 0
759 
760  deltaprof = (prof_24h(j) - prof_24h(i))/secperhour
761  prof_currtime = prof_24h(hour) + deltaprof*total_sec
762 

◆ get_prof_spectime_mean()

real(kind(1d0)) function get_prof_spectime_mean ( integer, intent(in)  Hour,
integer, intent(in)  Min,
integer, intent(in)  Sec,
real(kind(1d0)), dimension(0:23), intent(in)  Prof_24h 
)

Definition at line 769 of file suews_ctrl_input.f95.

769 
770  IMPLICIT NONE
771 
772  INTEGER :: i, j !Used to count over hours and sub-hourly timesteps
773  INTEGER, INTENT(IN) :: hour, min, sec
774  INTEGER :: total_sec, secperhour
775  REAL(KIND(1d0)), DIMENSION(0:23), INTENT(IN) :: prof_24h
776  REAL(KIND(1d0)), DIMENSION(0:23):: prof_24h_mean
777  REAL(KIND(1d0)):: deltaprof !Change in hourly profiles per model timestep
778  REAL(KIND(1d0)) :: prof_currtime
779 
780  total_sec = min*60 + sec
781  secperhour = 3600
782 
783  prof_24h_mean = merge(prof_24h/(sum(prof_24h)/size(prof_24h, dim=1)), 0.d0, sum(prof_24h) /= 0) ! prevent zero-division
784  ! print*, Prof_24h_mean
785 
786  i = hour
787  j = i + 1
788  IF (j == 24) j = 0
789 
790  deltaprof = (prof_24h_mean(j) - prof_24h_mean(i))/secperhour
791 
792  ! print*, deltaProf,total_sec
793  prof_currtime = prof_24h_mean(i) + deltaprof*total_sec
794 

◆ get_prof_spectime_sum()

real(kind(1d0)) function get_prof_spectime_sum ( integer, intent(in)  Hour,
integer, intent(in)  Min,
integer, intent(in)  Sec,
real(kind(1d0)), dimension(0:23), intent(in)  Prof_24h,
integer, intent(in)  dt 
)

Definition at line 801 of file suews_ctrl_input.f95.

801 
802  IMPLICIT NONE
803 
804  INTEGER :: i, j !Used to count over hours and sub-hourly timesteps
805  INTEGER, INTENT(IN) :: hour, min, sec, dt
806  INTEGER :: total_sec, secperhour
807  REAL(KIND(1d0)), DIMENSION(0:23), INTENT(IN) :: prof_24h
808  REAL(KIND(1d0)), DIMENSION(0:23):: prof_24h_sum
809  REAL(KIND(1d0)):: deltaprof !Change in hourly profiles per model timestep
810  REAL(KIND(1d0)) :: prof_currtime
811 
812  total_sec = min*60 + sec
813  secperhour = 3600
814 
815  prof_24h_sum = merge(prof_24h/(sum(prof_24h)), 0.d0, sum(prof_24h) /= 0) ! prevent zero-division
816 
817  i = hour
818  j = i + 1
819  IF (j == 24) j = 0
820 
821  deltaprof = (prof_24h_sum(j) - prof_24h_sum(i))/secperhour
822  prof_currtime = prof_24h_sum(hour) + deltaprof*total_sec
823  prof_currtime = prof_currtime*dt/secperhour
824 

◆ inputheadercheck()

subroutine inputheadercheck ( character(len=50)  FileName)

Definition at line 256 of file suews_ctrl_input.f95.

References colnamesinputfiles::ca_ahmin_wd, colnamesinputfiles::ca_ahmin_we, colnamesinputfiles::ca_ahslopecooling_wd, colnamesinputfiles::ca_ahslopecooling_we, colnamesinputfiles::ca_ahslopeheating_wd, colnamesinputfiles::ca_ahslopeheating_we, colnamesinputfiles::ca_basethdd, colnamesinputfiles::ca_co2mwd, colnamesinputfiles::ca_co2mwe, colnamesinputfiles::ca_co2pointsource, colnamesinputfiles::ca_code, colnamesinputfiles::ca_ef_umolco2perj, colnamesinputfiles::ca_enef_v_jkm, colnamesinputfiles::ca_enprofwd, colnamesinputfiles::ca_enprofwe, colnamesinputfiles::ca_fcef_v_kgkmwd, colnamesinputfiles::ca_fcef_v_kgkmwe, colnamesinputfiles::ca_frfossilfuel_heat, colnamesinputfiles::ca_frfossilfuel_nonheat, colnamesinputfiles::ca_frpddwe, colnamesinputfiles::ca_maxfcmetab, colnamesinputfiles::ca_maxqfmetab, colnamesinputfiles::ca_minfcmetab, colnamesinputfiles::ca_minqfmetab, colnamesinputfiles::ca_popprofwd, colnamesinputfiles::ca_popprofwe, colnamesinputfiles::ca_qf_a1, colnamesinputfiles::ca_qf_a2, colnamesinputfiles::ca_qf_b1, colnamesinputfiles::ca_qf_b2, colnamesinputfiles::ca_qf_c1, colnamesinputfiles::ca_qf_c2, colnamesinputfiles::ca_tcriticcooling_wd, colnamesinputfiles::ca_tcriticcooling_we, colnamesinputfiles::ca_tcriticheating_wd, colnamesinputfiles::ca_tcriticheating_we, colnamesinputfiles::ca_trafficunits, colnamesinputfiles::ca_traffprofwd, colnamesinputfiles::ca_traffprofwe, colnamesinputfiles::cb_alpha, colnamesinputfiles::cb_alpha_enh, colnamesinputfiles::cb_beta, colnamesinputfiles::cb_beta_enh, colnamesinputfiles::cb_code, colnamesinputfiles::cb_min_r, colnamesinputfiles::cb_resp_a, colnamesinputfiles::cb_resp_b, colnamesinputfiles::cb_theta, colnamesinputfiles::cc_code, colnamesinputfiles::cc_gsg1, colnamesinputfiles::cc_gsg2, colnamesinputfiles::cc_gsg3, colnamesinputfiles::cc_gsg4, colnamesinputfiles::cc_gsg5, colnamesinputfiles::cc_gsg6, colnamesinputfiles::cc_gskmax, colnamesinputfiles::cc_gsmodel, colnamesinputfiles::cc_gss1, colnamesinputfiles::cc_gss2, colnamesinputfiles::cc_gsth, colnamesinputfiles::cc_gstl, colnamesinputfiles::ce_alb_ibld, colnamesinputfiles::ce_ch_ibld, colnamesinputfiles::ce_ch_iroof, colnamesinputfiles::ce_ch_iwall, colnamesinputfiles::ce_code, colnamesinputfiles::ce_em_ibld, colnamesinputfiles::ce_internal_k1, colnamesinputfiles::ce_internal_k2, colnamesinputfiles::ce_internal_k3, colnamesinputfiles::ce_internal_k4, colnamesinputfiles::ce_internal_k5, colnamesinputfiles::ce_internal_rhocp1, colnamesinputfiles::ce_internal_rhocp2, colnamesinputfiles::ce_internal_rhocp3, colnamesinputfiles::ce_internal_rhocp4, colnamesinputfiles::ce_internal_rhocp5, colnamesinputfiles::ce_internal_thick1, colnamesinputfiles::ce_internal_thick2, colnamesinputfiles::ce_internal_thick3, colnamesinputfiles::ce_internal_thick4, colnamesinputfiles::ce_internal_thick5, colnamesinputfiles::ce_nroom, colnamesinputfiles::ce_surf_k1, colnamesinputfiles::ce_surf_k2, colnamesinputfiles::ce_surf_k3, colnamesinputfiles::ce_surf_k4, colnamesinputfiles::ce_surf_k5, colnamesinputfiles::ce_surf_rhocp1, colnamesinputfiles::ce_surf_rhocp2, colnamesinputfiles::ce_surf_rhocp3, colnamesinputfiles::ce_surf_rhocp4, colnamesinputfiles::ce_surf_rhocp5, colnamesinputfiles::ce_surf_thick1, colnamesinputfiles::ce_surf_thick2, colnamesinputfiles::ce_surf_thick3, colnamesinputfiles::ce_surf_thick4, colnamesinputfiles::ce_surf_thick5, colnamesinputfiles::ce_wall_k1, colnamesinputfiles::ce_wall_k2, colnamesinputfiles::ce_wall_k3, colnamesinputfiles::ce_wall_k4, colnamesinputfiles::ce_wall_k5, colnamesinputfiles::ce_wall_rhocp1, colnamesinputfiles::ce_wall_rhocp2, colnamesinputfiles::ce_wall_rhocp3, colnamesinputfiles::ce_wall_rhocp4, colnamesinputfiles::ce_wall_rhocp5, colnamesinputfiles::ce_wall_thick1, colnamesinputfiles::ce_wall_thick2, colnamesinputfiles::ce_wall_thick3, colnamesinputfiles::ce_wall_thick4, colnamesinputfiles::ce_wall_thick5, colnamesinputfiles::ci_albmax, colnamesinputfiles::ci_albmin, colnamesinputfiles::ci_chanohm, colnamesinputfiles::ci_code, colnamesinputfiles::ci_cpanohm, colnamesinputfiles::ci_drcoef1, colnamesinputfiles::ci_drcoef2, colnamesinputfiles::ci_dreq, colnamesinputfiles::ci_emis, colnamesinputfiles::ci_estmcode, colnamesinputfiles::ci_kkanohm, colnamesinputfiles::ci_ohmcode_sdry, colnamesinputfiles::ci_ohmcode_swet, colnamesinputfiles::ci_ohmcode_wdry, colnamesinputfiles::ci_ohmcode_wwet, colnamesinputfiles::ci_ohmthresh_sw, colnamesinputfiles::ci_ohmthresh_wd, colnamesinputfiles::ci_snowlimpat, colnamesinputfiles::ci_snowlimrem, colnamesinputfiles::ci_soiltcode, colnamesinputfiles::ci_statelimit, colnamesinputfiles::ci_stormax, colnamesinputfiles::ci_stormin, colnamesinputfiles::ci_wetthresh, colnamesinputfiles::cir_code, colnamesinputfiles::cir_daywat1, colnamesinputfiles::cir_daywat2, colnamesinputfiles::cir_daywat3, colnamesinputfiles::cir_daywat4, colnamesinputfiles::cir_daywat5, colnamesinputfiles::cir_daywat6, colnamesinputfiles::cir_daywat7, colnamesinputfiles::cir_daywatper1, colnamesinputfiles::cir_daywatper2, colnamesinputfiles::cir_daywatper3, colnamesinputfiles::cir_daywatper4, colnamesinputfiles::cir_daywatper5, colnamesinputfiles::cir_daywatper6, colnamesinputfiles::cir_daywatper7, colnamesinputfiles::cir_faut, colnamesinputfiles::cir_ie_a1, colnamesinputfiles::cir_ie_a2, colnamesinputfiles::cir_ie_a3, colnamesinputfiles::cir_ie_m1, colnamesinputfiles::cir_ie_m2, colnamesinputfiles::cir_ie_m3, colnamesinputfiles::cir_ieend, colnamesinputfiles::cir_iestart, colnamesinputfiles::cir_intwu, colnamesinputfiles::co_a1, colnamesinputfiles::co_a2, colnamesinputfiles::co_a3, colnamesinputfiles::co_code, colnamesinputfiles::cp_albmax, colnamesinputfiles::cp_albmin, colnamesinputfiles::cp_baset, colnamesinputfiles::cp_basete, colnamesinputfiles::cp_biogenco2code, colnamesinputfiles::cp_chanohm, colnamesinputfiles::cp_code, colnamesinputfiles::cp_cpanohm, colnamesinputfiles::cp_drcoef1, colnamesinputfiles::cp_drcoef2, colnamesinputfiles::cp_dreq, colnamesinputfiles::cp_emis, colnamesinputfiles::cp_estmcode, colnamesinputfiles::cp_gddfull, colnamesinputfiles::cp_gsmax, colnamesinputfiles::cp_kkanohm, colnamesinputfiles::cp_laieq, colnamesinputfiles::cp_laimax, colnamesinputfiles::cp_laimin, colnamesinputfiles::cp_leafgp1, colnamesinputfiles::cp_leafgp2, colnamesinputfiles::cp_leafop1, colnamesinputfiles::cp_leafop2, colnamesinputfiles::cp_ohmcode_sdry, colnamesinputfiles::cp_ohmcode_swet, colnamesinputfiles::cp_ohmcode_wdry, colnamesinputfiles::cp_ohmcode_wwet, colnamesinputfiles::cp_ohmthresh_sw, colnamesinputfiles::cp_ohmthresh_wd, colnamesinputfiles::cp_porositymax, colnamesinputfiles::cp_porositymin, colnamesinputfiles::cp_sddfull, colnamesinputfiles::cp_snowlimpat, colnamesinputfiles::cp_soiltcode, colnamesinputfiles::cp_statelimit, colnamesinputfiles::cp_stormax, colnamesinputfiles::cp_stormin, colnamesinputfiles::cp_wetthresh, colnamesinputfiles::cpr_code, colnamesinputfiles::cpr_hours, colnamesinputfiles::cs_chanohm, colnamesinputfiles::cs_code, colnamesinputfiles::cs_cpanohm, colnamesinputfiles::cs_estmcode, colnamesinputfiles::cs_kkanohm, colnamesinputfiles::cs_ohmcode_sdry, colnamesinputfiles::cs_ohmcode_swet, colnamesinputfiles::cs_ohmcode_wdry, colnamesinputfiles::cs_ohmcode_wwet, colnamesinputfiles::cs_ohmthresh_sw, colnamesinputfiles::cs_ohmthresh_wd, colnamesinputfiles::cs_snowalbmax, colnamesinputfiles::cs_snowalbmin, colnamesinputfiles::cs_snowcrwmax, colnamesinputfiles::cs_snowcrwmin, colnamesinputfiles::cs_snowemis, colnamesinputfiles::cs_snowplimalb, colnamesinputfiles::cs_snowplimsnow, colnamesinputfiles::cs_snowrmfactor, colnamesinputfiles::cs_snowsdmax, colnamesinputfiles::cs_snowsdmin, colnamesinputfiles::cs_snowtau_a, colnamesinputfiles::cs_snowtau_f, colnamesinputfiles::cs_snowtau_r, colnamesinputfiles::cs_snowtmfactor, colnamesinputfiles::cso_code, colnamesinputfiles::cso_ksat, colnamesinputfiles::cso_obssmdepth, colnamesinputfiles::cso_obssmmax, colnamesinputfiles::cso_obssnrfrac, colnamesinputfiles::cso_soildens, colnamesinputfiles::cso_soildepth, colnamesinputfiles::cso_soilinfrate, colnamesinputfiles::cso_soilstcap, colnamesinputfiles::cw_albmax, colnamesinputfiles::cw_albmin, colnamesinputfiles::cw_chanohm, colnamesinputfiles::cw_code, colnamesinputfiles::cw_cpanohm, colnamesinputfiles::cw_drcoef1, colnamesinputfiles::cw_drcoef2, colnamesinputfiles::cw_dreq, colnamesinputfiles::cw_emis, colnamesinputfiles::cw_estmcode, colnamesinputfiles::cw_kkanohm, colnamesinputfiles::cw_ohmcode_sdry, colnamesinputfiles::cw_ohmcode_swet, colnamesinputfiles::cw_ohmcode_wdry, colnamesinputfiles::cw_ohmcode_wwet, colnamesinputfiles::cw_ohmthresh_sw, colnamesinputfiles::cw_ohmthresh_wd, colnamesinputfiles::cw_statelimit, colnamesinputfiles::cw_stormax, colnamesinputfiles::cw_stormin, colnamesinputfiles::cw_waterdepth, colnamesinputfiles::cw_wetthresh, colnamesinputfiles::cwg_code, colnamesinputfiles::cwg_tobldgs, colnamesinputfiles::cwg_tobsoil, colnamesinputfiles::cwg_todectr, colnamesinputfiles::cwg_toevetr, colnamesinputfiles::cwg_tograss, colnamesinputfiles::cwg_topaved, colnamesinputfiles::cwg_torunoff, colnamesinputfiles::cwg_tosoilstore, colnamesinputfiles::cwg_towater, errorhint(), allocatearray::headeranthropogenic_file, allocatearray::headeranthropogenic_reqd, allocatearray::headerbiogen_file, allocatearray::headerbiogen_reqd, allocatearray::headercond_file, allocatearray::headercond_reqd, allocatearray::headerestmcoefficients_file, allocatearray::headerestmcoefficients_reqd, allocatearray::headerirrigation_file, allocatearray::headerirrigation_reqd, allocatearray::headernonveg_file, allocatearray::headernonveg_reqd, allocatearray::headerohmcoefficients_file, allocatearray::headerohmcoefficients_reqd, allocatearray::headerprofiles_file, allocatearray::headerprofiles_reqd, allocatearray::headersnow_file, allocatearray::headersnow_reqd, allocatearray::headersoil_file, allocatearray::headersoil_reqd, allocatearray::headerveg_file, allocatearray::headerveg_reqd, allocatearray::headerwater_file, allocatearray::headerwater_reqd, allocatearray::headerwgwaterdist_file, allocatearray::headerwgwaterdist_reqd, defaultnotused::notused, and defaultnotused::notusedi.

Referenced by readcoeff().

256  ! Checks columns in input files match the columns expected by model code
257  ! Model code columns are defined here
258  ! Latest update:
259  ! MH 21 Jun 2017 - Added parameters to SUEWS_AnthropogenicEmissions.txt
260  ! MH 16 Jun 2017 - Added SUEWS_BiogenCO2.txt
261  ! TS 02 Mar 2016 - AnOHM related variables added
262  ! LJ 27 Jan 2016 - Removal of tabs
263  ! LJ 07 July 2015 - snow albedo removed
264  ! HCW 12 Nov 2014
265  !-------------------------------------------------------------------------
266 
267  USE allocatearray
269  USE defaultnotused
270 
271  IMPLICIT NONE
272 
273  CHARACTER(len=50):: filename
274 
275  ! ========== Define expected column names here ==========
276  ! =======================================================
277 
278  ! ========== SUEWS_NonVeg.txt =============
279  headernonveg_reqd(ci_code) = "Code"
280  headernonveg_reqd(ci_albmin) = "AlbedoMin"
281  headernonveg_reqd(ci_albmax) = "AlbedoMax"
282  headernonveg_reqd(ci_emis) = "Emissivity"
283  headernonveg_reqd(ci_stormin) = "StorageMin"
284  headernonveg_reqd(ci_stormax) = "StorageMax"
285  headernonveg_reqd(ci_wetthresh) = "WetThreshold"
286  headernonveg_reqd(ci_statelimit) = "StateLimit"
287  headernonveg_reqd(ci_dreq) = "DrainageEq"
288  headernonveg_reqd(ci_drcoef1) = "DrainageCoef1"
289  headernonveg_reqd(ci_drcoef2) = "DrainageCoef2"
290  headernonveg_reqd(ci_soiltcode) = "SoilTypeCode"
291  headernonveg_reqd(ci_snowlimpat) = "SnowLimPatch"
292  headernonveg_reqd(ci_snowlimrem) = "SnowLimRemove"
293  headernonveg_reqd(ci_ohmcode_swet) = "OHMCode_SummerWet"
294  headernonveg_reqd(ci_ohmcode_sdry) = "OHMCode_SummerDry"
295  headernonveg_reqd(ci_ohmcode_wwet) = "OHMCode_WinterWet"
296  headernonveg_reqd(ci_ohmcode_wdry) = "OHMCode_WinterDry"
297  headernonveg_reqd(ci_ohmthresh_sw) = "OHMThresh_SW"
298  headernonveg_reqd(ci_ohmthresh_wd) = "OHMThresh_WD"
299  headernonveg_reqd(ci_estmcode) = "ESTMCode"
300  headernonveg_reqd(ci_cpanohm) = "AnOHM_Cp" ! AnOHM TS
301  headernonveg_reqd(ci_kkanohm) = "AnOHM_Kk" ! AnOHM TS
302  headernonveg_reqd(ci_chanohm) = "AnOHM_Ch" ! AnOHM TS
303 
304  ! ========== SUEWS_Veg.txt ===============
305  headerveg_reqd(cp_code) = "Code"
306  headerveg_reqd(cp_albmin) = "AlbedoMin"
307  headerveg_reqd(cp_albmax) = "AlbedoMax"
308  headerveg_reqd(cp_emis) = "Emissivity"
309  headerveg_reqd(cp_stormin) = "StorageMin"
310  headerveg_reqd(cp_stormax) = "StorageMax"
311  headerveg_reqd(cp_wetthresh) = "WetThreshold"
312  headerveg_reqd(cp_statelimit) = "StateLimit"
313  headerveg_reqd(cp_dreq) = "DrainageEq"
314  headerveg_reqd(cp_drcoef1) = "DrainageCoef1"
315  headerveg_reqd(cp_drcoef2) = "DrainageCoef2"
316  headerveg_reqd(cp_soiltcode) = "SoilTypeCode"
317  headerveg_reqd(cp_snowlimpat) = "SnowLimPatch"
318  headerveg_reqd(cp_baset) = "BaseT"
319  headerveg_reqd(cp_basete) = "BaseTe"
320  headerveg_reqd(cp_gddfull) = "GDDFull"
321  headerveg_reqd(cp_sddfull) = "SDDFull"
322  headerveg_reqd(cp_laimin) = "LAIMin"
323  headerveg_reqd(cp_laimax) = "LAIMax"
324  headerveg_reqd(cp_porositymin) = "PorosityMin"
325  headerveg_reqd(cp_porositymax) = "PorosityMax"
326  headerveg_reqd(cp_gsmax) = "MaxConductance"
327  headerveg_reqd(cp_laieq) = "LAIEq"
328  headerveg_reqd(cp_leafgp1) = "LeafGrowthPower1"
329  headerveg_reqd(cp_leafgp2) = "LeafGrowthPower2"
330  headerveg_reqd(cp_leafop1) = "LeafOffPower1"
331  headerveg_reqd(cp_leafop2) = "LeafOffPower2"
332  headerveg_reqd(cp_ohmcode_swet) = "OHMCode_SummerWet"
333  headerveg_reqd(cp_ohmcode_sdry) = "OHMCode_SummerDry"
334  headerveg_reqd(cp_ohmcode_wwet) = "OHMCode_WinterWet"
335  headerveg_reqd(cp_ohmcode_wdry) = "OHMCode_WinterDry"
336  headerveg_reqd(cp_ohmthresh_sw) = "OHMThresh_SW"
337  headerveg_reqd(cp_ohmthresh_wd) = "OHMThresh_WD"
338  headerveg_reqd(cp_estmcode) = "ESTMCode"
339  headerveg_reqd(cp_cpanohm) = "AnOHM_Cp" ! AnOHM TS
340  headerveg_reqd(cp_kkanohm) = "AnOHM_Kk" ! AnOHM TS
341  headerveg_reqd(cp_chanohm) = "AnOHM_Ch" ! AnOHM TS
342  headerveg_reqd(cp_biogenco2code) = "BiogenCO2Code"
343 
344  ! ========== SUEWS_Water.txt ==================
345  headerwater_reqd(cw_code) = "Code"
346  headerwater_reqd(cw_albmin) = "AlbedoMin"
347  headerwater_reqd(cw_albmax) = "AlbedoMax"
348  headerwater_reqd(cw_emis) = "Emissivity"
349  headerwater_reqd(cw_stormin) = "StorageMin"
350  headerwater_reqd(cw_stormax) = "StorageMax"
351  headerwater_reqd(cw_wetthresh) = "WetThreshold"
352  headerwater_reqd(cw_statelimit) = "StateLimit"
353  headerwater_reqd(cw_waterdepth) = "WaterDepth"
354  headerwater_reqd(cw_dreq) = "DrainageEq"
355  headerwater_reqd(cw_drcoef1) = "DrainageCoef1"
356  headerwater_reqd(cw_drcoef2) = "DrainageCoef2"
357  headerwater_reqd(cw_ohmcode_swet) = "OHMCode_SummerWet"
358  headerwater_reqd(cw_ohmcode_sdry) = "OHMCode_SummerDry"
359  headerwater_reqd(cw_ohmcode_wwet) = "OHMCode_WinterWet"
360  headerwater_reqd(cw_ohmcode_wdry) = "OHMCode_WinterDry"
361  headerwater_reqd(cw_ohmthresh_sw) = "OHMThresh_SW"
362  headerwater_reqd(cw_ohmthresh_wd) = "OHMThresh_WD"
363  headerwater_reqd(cw_estmcode) = "ESTMCode"
364  headerwater_reqd(cw_cpanohm) = "AnOHM_Cp" ! AnOHM TS
365  headerwater_reqd(cw_kkanohm) = "AnOHM_Kk" ! AnOHM TS
366  headerwater_reqd(cw_chanohm) = "AnOHM_Ch" ! AnOHM TS
367 
368  ! ========== SUEWS_Snow.txt ===================
369  headersnow_reqd(cs_code) = "Code"
370  headersnow_reqd(cs_snowrmfactor) = "RadMeltFactor"
371  headersnow_reqd(cs_snowtmfactor) = "TempMeltFactor"
372  headersnow_reqd(cs_snowalbmin) = "AlbedoMin"
373  headersnow_reqd(cs_snowalbmax) = "AlbedoMax"
374  headersnow_reqd(cs_snowemis) = "Emissivity"
375  headersnow_reqd(cs_snowtau_a) = "tau_a"
376  headersnow_reqd(cs_snowtau_f) = "tau_f"
377  headersnow_reqd(cs_snowplimalb) = "PrecipLimAlb"
378  headersnow_reqd(cs_snowsdmin) = "SnowDensMin"
379  headersnow_reqd(cs_snowsdmax) = "SnowDensMax"
380  headersnow_reqd(cs_snowtau_r) = "tau_r"
381  headersnow_reqd(cs_snowcrwmin) = "CRWMin"
382  headersnow_reqd(cs_snowcrwmax) = "CRWMax"
383  headersnow_reqd(cs_snowplimsnow) = "PrecipLimSnow"
384  headersnow_reqd(cs_ohmcode_swet) = "OHMCode_SummerWet"
385  headersnow_reqd(cs_ohmcode_sdry) = "OHMCode_SummerDry"
386  headersnow_reqd(cs_ohmcode_wwet) = "OHMCode_WinterWet"
387  headersnow_reqd(cs_ohmcode_wdry) = "OHMCode_WinterDry"
388  headersnow_reqd(cs_ohmthresh_sw) = "OHMThresh_SW"
389  headersnow_reqd(cs_ohmthresh_wd) = "OHMThresh_WD"
390  headersnow_reqd(cs_estmcode) = "ESTMCode"
391  headersnow_reqd(cs_cpanohm) = "AnOHM_Cp" ! AnOHM TS
392  headersnow_reqd(cs_kkanohm) = "AnOHM_Kk" ! AnOHM TS
393  headersnow_reqd(cs_chanohm) = "AnOHM_Ch" ! AnOHM TS
394 
395  ! ========== SUEWS_Soil.txt ===================
396  headersoil_reqd(cso_code) = "Code"
397  headersoil_reqd(cso_soildepth) = "SoilDepth"
398  headersoil_reqd(cso_soilstcap) = "SoilStoreCap"
399  headersoil_reqd(cso_ksat) = "SatHydraulicCond"
400  headersoil_reqd(cso_soildens) = "SoilDensity"
401  headersoil_reqd(cso_soilinfrate) = "InfiltrationRate"
402  headersoil_reqd(cso_obssmdepth) = "OBS_SMDepth"
403  headersoil_reqd(cso_obssmmax) = "OBS_SMCap"
404  headersoil_reqd(cso_obssnrfrac) = "OBS_SoilNotRocks"
405 
406  ! ========== SUEWS_Conductance.txt ============
407  headercond_reqd(cc_code) = "Code"
408  headercond_reqd(cc_gsg1) = "G1"
409  headercond_reqd(cc_gsg2) = "G2"
410  headercond_reqd(cc_gsg3) = "G3"
411  headercond_reqd(cc_gsg4) = "G4"
412  headercond_reqd(cc_gsg5) = "G5"
413  headercond_reqd(cc_gsg6) = "G6"
414  headercond_reqd(cc_gsth) = "TH"
415  headercond_reqd(cc_gstl) = "TL"
416  headercond_reqd(cc_gss1) = "S1"
417  headercond_reqd(cc_gss2) = "S2"
418  headercond_reqd(cc_gskmax) = "Kmax"
419  headercond_reqd(cc_gsmodel) = "gsModel"
420 
421  ! ========== SUEWS_OHMCoefficients.txt ========
426 
427  ! ========== SUEWS_ESTMCoefficients.txt ========
475  headerestmcoefficients_reqd(ce_alb_ibld) = "Internal_albedo"
476  headerestmcoefficients_reqd(ce_em_ibld) = "Internal_emissivity"
477  headerestmcoefficients_reqd(ce_ch_iwall) = "Internal_CHwall"
478  headerestmcoefficients_reqd(ce_ch_iroof) = "Internal_CHroof"
479  headerestmcoefficients_reqd(ce_ch_ibld) = "Internal_CHbld"
480 
481  ! ========== SUEWS_AnthropogenicEmission.txt ======
492  headeranthropogenic_reqd(ca_ahslopeheating_wd) = "AHSlope_Heating_WD"
493  headeranthropogenic_reqd(ca_ahslopeheating_we) = "AHSlope_Heating_WE"
494  headeranthropogenic_reqd(ca_ahslopecooling_wd) = "AHSlope_Cooling_WD"
495  headeranthropogenic_reqd(ca_ahslopecooling_we) = "AHSlope_Cooling_WE"
496  headeranthropogenic_reqd(ca_tcriticheating_wd) = "TCritic_Heating_WD"
497  headeranthropogenic_reqd(ca_tcriticheating_we) = "TCritic_Heating_WE"
498  headeranthropogenic_reqd(ca_tcriticcooling_wd) = "TCritic_Cooling_WD"
499  headeranthropogenic_reqd(ca_tcriticcooling_we) = "TCritic_Cooling_WE"
500  headeranthropogenic_reqd(ca_enprofwd) = "EnergyUseProfWD"
501  headeranthropogenic_reqd(ca_enprofwe) = "EnergyUseProfWE"
502  headeranthropogenic_reqd(ca_co2mwd) = "ActivityProfWD"
503  headeranthropogenic_reqd(ca_co2mwe) = "ActivityProfWE"
513  headeranthropogenic_reqd(ca_frfossilfuel_heat) = "FrFossilFuel_Heat"
514  headeranthropogenic_reqd(ca_frfossilfuel_nonheat) = "FrFossilFuel_NonHeat"
515  headeranthropogenic_reqd(ca_ef_umolco2perj) = "EF_umolCO2perJ"
517  headeranthropogenic_reqd(ca_fcef_v_kgkmwd) = "FcEF_v_kgkmWD"
518  headeranthropogenic_reqd(ca_fcef_v_kgkmwe) = "FcEF_v_kgkmWE"
519  headeranthropogenic_reqd(ca_co2pointsource) = "CO2PointSource"
520  headeranthropogenic_reqd(ca_trafficunits) = "TrafficUnits"
521 
522  ! ========== SUEWS_Irrigation.txt =============
524  headerirrigation_reqd(cir_iestart) = "Ie_start"
525  headerirrigation_reqd(cir_ieend) = "Ie_end"
526  headerirrigation_reqd(cir_intwu) = "InternalWaterUse"
534  headerirrigation_reqd(cir_daywat1) = "DayWat(1)"
535  headerirrigation_reqd(cir_daywat2) = "DayWat(2)"
536  headerirrigation_reqd(cir_daywat3) = "DayWat(3)"
537  headerirrigation_reqd(cir_daywat4) = "DayWat(4)"
538  headerirrigation_reqd(cir_daywat5) = "DayWat(5)"
539  headerirrigation_reqd(cir_daywat6) = "DayWat(6)"
540  headerirrigation_reqd(cir_daywat7) = "DayWat(7)"
541  headerirrigation_reqd(cir_daywatper1) = "DayWatPer(1)"
542  headerirrigation_reqd(cir_daywatper2) = "DayWatPer(2)"
543  headerirrigation_reqd(cir_daywatper3) = "DayWatPer(3)"
544  headerirrigation_reqd(cir_daywatper4) = "DayWatPer(4)"
545  headerirrigation_reqd(cir_daywatper5) = "DayWatPer(5)"
546  headerirrigation_reqd(cir_daywatper6) = "DayWatPer(6)"
547  headerirrigation_reqd(cir_daywatper7) = "DayWatPer(7)"
548 
549  ! ========== SUEWS_Profiles.txt ===============
550  headerprofiles_reqd(cpr_code) = "Code"
560  headerprofiles_reqd(cpr_hours(10)) = "9"
561  headerprofiles_reqd(cpr_hours(11)) = "10"
562  headerprofiles_reqd(cpr_hours(12)) = "11"
563  headerprofiles_reqd(cpr_hours(13)) = "12"
564  headerprofiles_reqd(cpr_hours(14)) = "13"
565  headerprofiles_reqd(cpr_hours(15)) = "14"
566  headerprofiles_reqd(cpr_hours(16)) = "15"
567  headerprofiles_reqd(cpr_hours(17)) = "16"
568  headerprofiles_reqd(cpr_hours(18)) = "17"
569  headerprofiles_reqd(cpr_hours(19)) = "18"
570  headerprofiles_reqd(cpr_hours(20)) = "19"
571  headerprofiles_reqd(cpr_hours(21)) = "20"
572  headerprofiles_reqd(cpr_hours(22)) = "21"
573  headerprofiles_reqd(cpr_hours(23)) = "22"
574  headerprofiles_reqd(cpr_hours(24)) = "23"
575 
576  ! ========== SUEWS_WithinGridWaterDist.txt ====
586  headerwgwaterdist_reqd(cwg_tosoilstore) = "ToSoilStore"
587 
588  ! ========== SUEWS_BiogenCO2.txt ======
589  headerbiogen_reqd(cb_code) = "Code"
590  headerbiogen_reqd(cb_alpha) = "alpha"
591  headerbiogen_reqd(cb_beta) = "beta"
592  headerbiogen_reqd(cb_theta) = "theta"
593  headerbiogen_reqd(cb_alpha_enh) = "alpha_enh"
594  headerbiogen_reqd(cb_beta_enh) = "beta_enh"
595  headerbiogen_reqd(cb_resp_a) = "resp_a"
596  headerbiogen_reqd(cb_resp_b) = "resp_b"
597  headerbiogen_reqd(cb_min_r) = "min_respi"
598 
599  ! =======================================================
600 
601  !write(*,*) 'Checking header for ', FileName
602  ! Check columns in input files match model code
603 
604  IF (filename == 'SUEWS_NonVeg.txt') THEN
605  IF (any(headernonveg_file /= headernonveg_reqd)) THEN
606  WRITE (*, *) headernonveg_file == headernonveg_reqd
607  WRITE (*, *) headernonveg_file
608  WRITE (*, *) headernonveg_reqd
609  CALL errorhint(56, 'Names or order of columns in SUEWS_NonVeg.txt does not match model code.', notused, notused, notusedi)
610  ENDIF
611 
612  ELSEIF (filename == 'SUEWS_Veg.txt') THEN
613  IF (any(headerveg_file /= headerveg_reqd)) THEN
614  WRITE (*, *) headerveg_file == headerveg_reqd
615  CALL errorhint(56, 'Names or order of columns in SUEWS_Veg.txt does not match model code.', notused, notused, notusedi)
616  ENDIF
617 
618  ELSEIF (filename == 'SUEWS_Water.txt') THEN
619  IF (any(headerwater_file /= headerwater_reqd)) THEN
620  WRITE (*, *) headerwater_file == headerwater_reqd
621  WRITE (*, *) headerwater_file
622  WRITE (*, *) headerwater_reqd
623  CALL errorhint(56, 'Names or order of columns in SUEWS_Water.txt does not match model code.', notused, notused, notusedi)
624  ENDIF
625 
626  ELSEIF (filename == 'SUEWS_Snow.txt') THEN
627  IF (any(headersnow_file /= headersnow_reqd)) THEN
628  WRITE (*, *) headersnow_file == headersnow_reqd
629  CALL errorhint(56, 'Names or order of columns in SUEWS_Snow.txt does not match model code.', notused, notused, notusedi)
630  ENDIF
631 
632  ELSEIF (filename == 'SUEWS_Soil.txt') THEN
633  IF (any(headersoil_file /= headersoil_reqd)) THEN
634  WRITE (*, *) headersoil_file == headersoil_reqd
635  CALL errorhint(56, 'Names or order of columns in SUEWS_Soil.txt does not match model code.', notused, notused, notusedi)
636  ENDIF
637 
638  ELSEIF (filename == 'SUEWS_Conductance.txt') THEN
639  IF (any(headercond_file /= headercond_reqd)) THEN
640  WRITE (*, *) headercond_file == headercond_reqd
641  CALL errorhint(56, 'Names or order of columns in SUEWS_Cond.txt does not match model code.', notused, notused, notusedi)
642  ENDIF
643 
644  ELSEIF (filename == 'SUEWS_OHMCoefficients.txt') THEN
647  CALL errorhint(56, 'Names or order of columns in SUEWS_OHMCoefficients.txt does not match model code.', &
649  ENDIF
650 
651  ELSEIF (filename == 'SUEWS_ESTMCoefficients.txt') THEN
654  CALL errorhint(56, 'Names or order of columns in SUEWS_ESTMCoefficients.txt does not match model code.', &
656  ENDIF
657 
658  ELSEIF (filename == 'SUEWS_AnthropogenicEmission.txt') THEN
661  CALL errorhint(56, 'Names or order of columns in SUEWS_AnthropogenicEmission.txt does not match model code.', &
663  ENDIF
664 
665  ELSEIF (filename == 'SUEWS_Irrigation.txt') THEN
668  WRITE (*, *) headerirrigation_file
669  WRITE (*, *) headerirrigation_reqd
670  CALL errorhint(56, 'Names or order of columns in SUEWS_Irrigation.txt does not match model code.', &
672  ENDIF
673 
674  ELSEIF (filename == 'SUEWS_Profiles.txt') THEN
675  IF (any(headerprofiles_file /= headerprofiles_reqd)) THEN
677  CALL errorhint(56, 'Names or order of columns in SUEWS_Profiles.txt does not match model code.', &
679  ENDIF
680 
681  ELSEIF (filename == 'SUEWS_WithinGridWaterDist.txt') THEN
684  CALL errorhint(56, 'Names or order of columns in SUEWS_WithinGridWaterDist.txt does not match model code.', &
686  ENDIF
687 
688  ELSEIF (filename == 'SUEWS_BiogenCO2.txt') THEN
689  IF (any(headerbiogen_file /= headerbiogen_reqd)) THEN
690  WRITE (*, *) headerbiogen_file == headerbiogen_reqd
691  CALL errorhint(56, 'Names or order of columns in SUEWS_BiogenCO2.txt does not match model code.', &
693  ENDIF
694 
695  ELSE
696  WRITE (*, *) 'Problem in subroutine InputHeaderCheck. File header not specified in model code for ', filename
698 
699  ENDIF
700 
character(len=20), dimension(ncolumnsbiogen) headerbiogen_reqd
character(len=20), dimension(ncolumnssoil) headersoil_reqd
real(kind(1d0)) notused
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_file
integer, dimension(24) cpr_hours
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_reqd
character(len=20), dimension(ncolumnsprofiles) headerprofiles_file
character(len=20), dimension(ncolumnsirrigation) headerirrigation_file
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_file
character(len=20), dimension(ncolumnswater) headerwater_reqd
character(len=20), dimension(ncolumnssoil) headersoil_file
character(len=20), dimension(ncolumnsbiogen) headerbiogen_file
character(len=20), dimension(ncolumnssnow) headersnow_file
character(len=20), dimension(ncolumnsnonveg) headernonveg_file
character(len=20), dimension(ncolumnssnow) headersnow_reqd
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_file
character(len=20), dimension(ncolumnswater) headerwater_file
character(len=20), dimension(ncolumnsveg) headerveg_file
character(len=20), dimension(ncolumnsprofiles) headerprofiles_reqd
character(len=20), dimension(ncolumnsirrigation) headerirrigation_reqd
character(len=20), dimension(ncolumnsveg) headerveg_reqd
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_reqd
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_reqd
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_reqd
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_file
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
character(len=20), dimension(ncolumnsconductance) headercond_file
character(len=20), dimension(ncolumnsconductance) headercond_reqd
character(len=20), dimension(ncolumnsnonveg) headernonveg_reqd
Here is the call graph for this function:
Here is the caller graph for this function:

◆ metread()

subroutine metread ( integer  lfn,
real(kind(1d0)), dimension(24)  MetArray,
integer  InputmetFormat,
integer  ldown_option,
integer  NetRadiationMethod,
integer  snowUse,
integer  SMDMethod,
real(kind(1d0))  SoilDepthMeas,
real(kind(1d0))  SoilRocks,
real(kind(1d0))  SoilDensity,
real(kind(1d0))  SmCap 
)

Definition at line 15 of file suews_ctrl_input.f95.

References errorhint(), defaultnotused::nan, defaultnotused::notused, and defaultnotused::notusedi.

Referenced by metdisagg::disaggregatemet(), and suews_initializemetdata().

15 
16  USE defaultnotused
17 
18  IMPLICIT NONE
19 
20  !INPUT
21  REAL(KIND(1d0)), DIMENSION(24)::metarray !Array leaving the subroutine within
22  !each INTERVAL (defined in RunControl.nml)
23  ! - Met data now provided at a resolution of tstep, HCW Jan 2015
24 
25  REAL(KIND(1d0))::smcap, &
26  soildepthmeas, & !Measured soil depth
27  soilrocks, & !Rocks on ground
28  soildensity !Density of soil
29 
30  INTEGER::inputmetformat, & !Format of the meteorological forcing file
31  ldown_option, & !Method of calculating Ldown
32  netradiationmethod, & !Method of calculating Q*
33  smdmethod, & !Method of measured soil moisture
34  snowuse
35 
36  ! Variables read in
37  REAL(KIND(1d0))::avkdn, & !Average downwelling shortwave radiation
38  avrh, & !Average relative humidity
39  avu1, & !Average wind speed
40  dectime, & !Decimal time
41  fcld_obs, & !Cloud fraction observed
42  iy, & !Year
43  id, & !Day
44  it, & !Hour
45  imin, & !Minute
46  kdiff, & !Diffuse shortwave radiation
47  kdir, & !Direct shortwave radiation
48  lai_obs, & !Overall LAI of the study area
49  ldown_obs, & !Downwelling longwave radiation
50  precip, & !Rainfall [mm]
51  pres_hpa, & !Station air pressure in hPa
52  pres_kpa, & !Station air pressure in kPa
53  snowfrac_obs, & !Observed surface fraction of snow (between 0 and 1)
54  qe_obs, & !Observed latent heat flux
55  qf_obs, & !Observed antrhropogeni heat flux
56  qh_obs, & !Observed sensible heat flux
57  qn1_obs, & !Observed net all-wave radiation
58  qs_obs, & !Observed storage heat flux
59  temp_c, & !Air temperature
60  wdir, & !Wind direction
61  wu_m3, & !Water use provided in met forcing file [m3]
62  xsmd !Measured soil moisture deficit
63 
64  INTEGER::iostat_var, lfn
65 
66  !-----------------------------------------------------------------------------------
67  !-----------------------------------------------------------------------------------
68 
69  IF (inputmetformat == 0) THEN !Default format using LUMPS only
70 
71  READ (lfn, *, iostat=iostat_var) iy, id, it, imin, qn1_obs, avu1, avrh, &
73 
74  !Set other variables needed while running SUEWS to zero
75  qf_obs = nan
76  qs_obs = nan
77  qh_obs = nan
78  qe_obs = nan
79  xsmd = -99999
80  kdiff = nan
81  kdir = nan
82  wdir = nan
83 
84  ELSEIF (inputmetformat == 10) THEN !SUEWS reading
85  READ (lfn, *, iostat=iostat_var) iy, id, it, imin, qn1_obs, qh_obs, qe_obs, qs_obs, qf_obs, avu1, avrh, &
88 
89  !write(*,*) 'In LUMPS_MetRead (1)'
90  !write(*,*) 'imin',imin
91  !write(*,*) 'it',it
92  !write(*,*) 'id',id
93  !write(*,*) 'iy',iy
94 
95  !Calculate observed soil moisture deficits from either volumetric or gravimetric SoilStates
96  IF (smdmethod == 1 .AND. xsmd /= -999) THEN !Soil moisture - volumetric
98  ELSEIF (smdmethod == 2 .AND. xsmd /= -999) THEN !Soil moisture -gravimetric
100  ELSE
101  xsmd = -999
102  ENDIF
103 
104  ELSE
105  CALL errorhint(55, 'RunControl.nml, InputMetFormat not usable.', notused, notused, inputmetformat)
106  ENDIF
107 
108  !===============Meteorological variables reading done==========================
109  pres_hpa = pres_kpa*10. ! convert to hPa
110 
111  IF (iostat_var < 0) THEN
112  iostat_var = 0
113  CLOSE (lfn)
114  RETURN
115  ENDIF
116 
117  IF (avkdn < 0) THEN
118  CALL errorhint(27, 'Met Data: avKdn - needed for StoreDrainPrm. resistance, If present, check file not tab delimited', &
120  !sg removed this is causing the problems with resistances
121  ! AvKdn=0 !Solar radiation cannot be lower than 1
122  ENDIF
123 
124  IF ((ldown_option == 1) .AND. (ldown_obs < 0)) THEN
125  CALL errorhint(27, 'Met Data: LWdn (ldown_obs) - impact Q* calc', ldown_obs, dectime, notusedi)
126 
127  ELSEIF (ldown_option == 2) THEN
128  IF (fcld_obs == -999.0 .OR. fcld_obs < 0 .OR. fcld_obs > 1) THEN
129  CALL errorhint(27, 'Met Data: flcd_obs - impacts LW & Q* radiation', fcld_obs, dectime, notusedi)
130  ENDIF
131  ENDIF
132 
133  IF (qn1_obs == -999 .AND. netradiationmethod == 0) THEN !If measured Q* is used and it is -999
134  CALL errorhint(27, 'Met Data: Q* - will impact everything', qn1_obs, dectime, notusedi)
135  ENDIF
136 
137  IF (avu1 <= 0) THEN !If wind speed is negative
138  CALL errorhint(27, 'Met Data: avU1 - impacts aeroydnamic resistances', avu1, dectime, notusedi)
139  ENDIF
140 
141  IF (temp_c < -50 .OR. temp_c > 60) THEN !If temperature unrealistic
142  CALL errorhint(27, 'Met Data: Temp_C - beyond what is expected', temp_c, dectime, notusedi)
143  ENDIF
144 
145  IF (avrh > 100 .OR. avrh < 1) THEN !If relative humidity larger than 100%
146  CALL errorhint(27, 'Met Data: avRH - beyond what is expected', avrh, dectime, notusedi)
147  ENDIF
148 
149  IF (pres_kpa < 80) THEN !If pressure too low
150  CALL errorhint(27, 'Met Data: Pres_kPa - too low - this could be fixed in model', pres_kpa, dectime, notusedi)
151  ENDIF
152 
153  IF (precip < 0) THEN !If rain in negative, set it to zero
154  CALL errorhint(27, 'Met Data: Precip - less than 0', precip, dectime, notusedi)
155  ENDIF
156 
157  IF (snowfrac_obs == nan) snowfrac_obs = 0
158 
159  IF (snowuse == 0 .AND. (snowfrac_obs < 0 .OR. snowfrac_obs > 1)) THEN
160  CALL errorhint(27, 'Met Data: snow not between [0 1]', snowfrac_obs, dectime, notusedi)
161  ENDIF
162 
163  IF (xsmd < 0 .AND. smdmethod == 1) THEN !If soil moisture deficit is zero
164  CALL errorhint(27, 'Met Data: xsmd - less than 0', xsmd, dectime, notusedi)
165  ENDIF
166 
167  !Create an array to be printed out.
168  metarray(1:24) = (/iy, id, it, imin, qn1_obs, qh_obs, qe_obs, qs_obs, qf_obs, avu1, &
169  avrh, temp_c, pres_hpa, precip, avkdn, snowfrac_obs, ldown_obs, &
171 
172  !write(*,*) 'In LUMPS_MetRead (2)'
173  !write(*,*) 'imin',imin
174  !write(*,*) 'it',it
175  !write(*,*) 'id',id
176  !write(*,*) 'iy',iy
177 
178  RETURN
179 
integer inputmetformat
real(kind(1d0)) pres_kpa
real(kind(1d0)) avrh
real(kind(1d0)) nan
real(kind(1d0)) wu_m3
real(kind(1d0)) temp_c
real(kind(1d0)) avu1
real(kind(1d0)) notused
real(kind(1d0)) soilrocks
integer snowuse
real(kind(1d0)) xsmd
real(kind(1d0)) snowfrac_obs
real(kind(1d0)) qf_obs
real(kind(1d0)) soildensity
real(kind(1d0)) kdir
integer id
real(kind(1d0)) ldown_obs
real(kind(1d0)) fcld_obs
integer imin
real(kind(1d0)) soildepthmeas
real(kind(1d0)) avkdn
real(kind(1d0)) lai_obs
real(kind(1d0)) qs_obs
real(kind(1d0)) smcap
integer iy
real(kind(1d0)) qh_obs
integer ldown_option
integer smdmethod
integer netradiationmethod
real(kind(1d0)) precip
integer it
real(kind(1d0)) dectime
real(kind(1d0)) qn1_obs
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
real(kind(1d0)) wdir
real(kind(1d0)) kdiff
real(kind(1d0)) qe_obs
Here is the call graph for this function:
Here is the caller graph for this function:

◆ run_control()

subroutine run_control ( integer  eval,
integer  LowerLimit,
integer  Upperlimit 
)

Definition at line 201 of file suews_ctrl_input.f95.

References run_info::file_qs, run_info::lfn_us, and run_info::text.

201  ! ver - determines if value to be read is an integer or real and returns the value
202  ! if ver=-9 - then use integer
203  USE run_info
204  IMPLICIT NONE
205  INTEGER::eval, i, lowerlimit, upperlimit
206  CHARACTER(len=4)::check
207 
208  IF (file_qs) THEN
209 101 READ (lfn_us, *) check
210  WRITE (*, *) check
211  DO i = 1, 3
212  IF (check(i:i) == "#") THEN
213  ! write(*,*)check(i:i),i,"check"
214  GOTO 101
215  ELSE
216  backspace(lfn_us)
217  READ (lfn_us, *) eval
218  !write(*,*)eval, TEXT(1)
219  EXIT
220  ENDIF
221  ENDDO
222  ENDIF
223 
224  WRITE (12, 120) eval, text(1)
225 
226  IF (eval < lowerlimit .OR. eval > upperlimit) THEN
227  WRITE (*, *) "Value out of range"
228  WRITE (*, *) eval, text(1)
229  stop
230  ENDIF
231 
232  WRITE (*, 120) eval, text(1)
233 120 FORMAT(i4, 2x, a90)
234 
235  RETURN
character(len=90), dimension(14) text

◆ skipheader()

subroutine skipheader ( integer  lfn,
integer  skip 
)

Definition at line 240 of file suews_ctrl_input.f95.

References errorhint(), defaultnotused::ios_out, defaultnotused::notused, and defaultnotused::reall.

Referenced by estm_module::suews_getestmdata(), and suews_initializemetdata().

240  USE defaultnotused
241  IMPLICIT NONE
242 
243  INTEGER::skip, lfn, i
244  DO i = 1, skip
245  READ (lfn, *, err=201, iostat=ios_out)
246  END DO
247 
248  RETURN
249 
250 201 reall = REAL(skip)
251  CALL errorhint(20, 'In SkipHeader subroutine.', reall, notused, ios_out)
real(kind(1d0)) notused
real(kind(1d0)) reall
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
Here is the call graph for this function:
Here is the caller graph for this function: