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 1233 of file suews_ctrl_input.f95.

1234 ! Matches AnthropogenicHeat characteristics via codes in SiteSelect
1235 ! HCW 20 Nov 2014
1236 ! MH 21 Jun 2017
1237 ! ---------------------------------------------------------
1238
1239 USE allocatearray
1240 USE initial
1242 USE defaultnotused
1243
1244 IMPLICIT NONE
1245
1246 INTEGER :: rr
1247 INTEGER :: codeCol
1248
1249 iv5 = 0 ! Reset iv5 to zero
1250
1251 DO iv5 = 1, nlinesanthropogenic
1252 IF (anthropogenic_coeff(iv5, ca_code) == siteselect(rr, codecol)) THEN
1253 EXIT
1254 ELSEIF (iv5 == nlinesanthropogenic) THEN
1255 WRITE (*, *) 'Program stopped! Anthropogenic code ', siteselect(rr, codecol), &
1256 'not found in SUEWS_AnthropogenicEmission.txt.'
1257 CALL errorhint(57, 'Cannot find code in SUEWS_AnthropogenicEmission.txt', &
1258 siteselect(rr, codecol), notused, notusedi)
1259 END IF
1260 END DO
1261
1262 RETURN
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable anthropogenic_coeff
real(kind(1d0)) notused
integer nlinesanthropogenic
subroutine errorhint(errh, problemfile, value, value2, valuei)

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

Here is the call graph for this function:

◆ codematchbiogen()

subroutine codematchbiogen ( integer gridiv,
integer surfacecharcodecol )

Definition at line 1326 of file suews_ctrl_input.f95.

1327 ! Matches Biogen characteristics via codes in *SuraceChar*
1328 ! MH 16 Jun 2017
1329 ! ---------------------------------------------------------
1330
1331 USE allocatearray
1332 USE initial
1334 USE defaultnotused
1335
1336 IMPLICIT NONE
1337
1338 INTEGER :: Gridiv
1339 INTEGER :: SurfaceCharCodeCol
1340
1341 iv5 = 0 ! Reset iv5 to zero
1342
1343 DO iv5 = 1, nlinesbiogen
1344 IF (biogen_coeff(iv5, cb_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1345 EXIT
1346 ELSEIF (iv5 == nlinesbiogen) THEN
1347 WRITE (*, *) 'Program stopped! Biogen code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_BiogenCO2.txt.'
1348 CALL errorhint(57, 'Cannot find code in SUEWS_BiogenCO2.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1349 END IF
1350 END DO
1351
1352 RETURN
real(kind(1d0)), dimension(:, :), allocatable biogen_coeff
real(kind(1d0)), dimension(:, :), allocatable surfacechar
integer nlinesbiogen

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

Here is the call graph for this function:

◆ codematchconductance()

subroutine codematchconductance ( integer rr,
integer codecol )

Definition at line 1203 of file suews_ctrl_input.f95.

1204 ! Matches Conductance characteristics via codes in SiteSelect
1205 ! HCW 20 Nov 2014
1206 ! ---------------------------------------------------------
1207
1208 USE allocatearray
1209 USE initial
1211 USE defaultnotused
1212
1213 IMPLICIT NONE
1214
1215 INTEGER :: rr
1216 INTEGER :: codeCol
1217
1218 iv5 = 0 ! Reset iv5 to zero
1219
1220 DO iv5 = 1, nlinesconductance
1221 IF (conductance_coeff(iv5, cc_code) == siteselect(rr, codecol)) THEN
1222 EXIT
1223 ELSEIF (iv5 == nlinesconductance) THEN
1224 WRITE (*, *) 'Program stopped! Conductance code ', siteselect(rr, codecol), 'not found in SUEWS_Conductance.txt.'
1225 CALL errorhint(57, 'Cannot find code in SUEWS_Conductance.txt', siteselect(rr, codecol), notused, notusedi)
1226 END IF
1227 END DO
1228
1229 RETURN
real(kind(1d0)), dimension(:, :), allocatable conductance_coeff
integer nlinesconductance

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

Here is the call graph for this function:

◆ codematchdist()

subroutine codematchdist ( integer rr,
integer codecol,
integer codecolsamesurf )

Definition at line 1024 of file suews_ctrl_input.f95.

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

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.

Here is the call graph for this function:

◆ codematchestm()

subroutine codematchestm ( integer gridiv,
integer is )

Definition at line 914 of file suews_ctrl_input.f95.

915 ! Matches ESTM coefficients via ESTM code
916 ! Modified HCW 16 Jun 2016 - for SUEWS surface types
917 ! - removed summer/winter wet/dry option
918 ! S.O. 04 Feb 2016
919 ! ---------------------------------------------------------
920
921 USE allocatearray
922 USE initial
925
926 IMPLICIT NONE
927
928 INTEGER :: gridiv
929 INTEGER :: is
930
931 iv5 = 0 ! Reset iv5 to zero
932
934 IF (estmcoefficients_coeff(iv5, ce_code) == surfacechar(gridiv, c_estmcode(is))) THEN
935 EXIT
936 ELSEIF (iv5 == nlinesestmcoefficients) THEN
937 WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_estmcode(is)), &
938 'not found in ESTM_Coefficients.txt for surface', is, '.'
939 CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_estmcode(is)), notused, notusedi)
940 END IF
941 END DO
942
943 RETURN
real(kind(1d0)), dimension(:, :), allocatable estmcoefficients_coeff
integer, dimension(nsurfincsnow) c_estmcode
integer nlinesestmcoefficients

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

Here is the call graph for this function:

◆ codematchestm_class()

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

Definition at line 947 of file suews_ctrl_input.f95.

948 ! Matches ESTM coefficients via ESTM codes in SiteSelect for Paved and Bldgs ESTM classes
949 ! HCW 16 Jun 2016
950 ! ---------------------------------------------------------
951
952 USE allocatearray
953 USE initial
956
957 IMPLICIT NONE
958
959 INTEGER :: gridiv
960 INTEGER :: is, ii
961
962 iv5 = 0 ! Reset iv5 to zero
963
964 IF (is == bldgsurf) THEN
967 EXIT
968 ELSEIF (iv5 == nlinesestmcoefficients) THEN
969 WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_code_estmclass_bldgs(ii)), &
970 'not found in ESTM_Coefficients.txt for surface', is, '.'
971 CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_code_estmclass_bldgs(ii)), notused, notusedi)
972 END IF
973 END DO
974 ELSEIF (is == pavsurf) THEN
977 EXIT
978 ELSEIF (iv5 == nlinesestmcoefficients) THEN
979 WRITE (*, *) 'Program stopped! ESTM code', surfacechar(gridiv, c_code_estmclass_paved(ii)), &
980 'not found in ESTM_Coefficients.txt for surface', is, '.'
981 CALL errorhint(57, 'Cannot find ESTM code', surfacechar(gridiv, c_code_estmclass_paved(ii)), notused, notusedi)
982 END IF
983 END DO
984 ELSE
985 WRITE (*, *) 'Problem with CodeMatchESTM_Class (in SUEWS_ctrl_input.f95). ', is, ' not correct. Needs to be either ', &
986 '1 = Paved surfaced, 2 = Bldgs surfaces.'
987 stop
988 END IF
989 RETURN
integer, parameter bldgsurf
integer, parameter pavsurf
integer, dimension(5) c_code_estmclass_bldgs
integer, dimension(3) c_code_estmclass_paved

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.

Here is the call graph for this function:

◆ codematchirrigation()

subroutine codematchirrigation ( integer rr,
integer codecol )

Definition at line 1266 of file suews_ctrl_input.f95.

1267 ! Matches Irrigation characteristics via codes in SiteSelect
1268 ! HCW 20 Nov 2014
1269 ! ---------------------------------------------------------
1270
1271 USE allocatearray
1272 USE initial
1274 USE defaultnotused
1275
1276 IMPLICIT NONE
1277
1278 INTEGER :: rr
1279 INTEGER :: codeCol
1280
1281 iv5 = 0 ! Reset iv5 to zero
1282
1283 DO iv5 = 1, nlinesirrigation
1284 IF (irrigation_coeff(iv5, cir_code) == siteselect(rr, codecol)) THEN
1285 EXIT
1286 ELSEIF (iv5 == nlinesirrigation) THEN
1287 WRITE (*, *) 'Program stopped! Irrigation code ', siteselect(rr, codecol), 'not found in SUEWS_Irrigation.txt.'
1288 CALL errorhint(57, 'Cannot find code in SUEWS_Irrigation.txt', siteselect(rr, codecol), notused, notusedi)
1289 END IF
1290 END DO
1291
1292 RETURN
real(kind(1d0)), dimension(:, :), allocatable irrigation_coeff
integer nlinesirrigation

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

Here is the call graph for this function:

◆ codematchnonveg()

subroutine codematchnonveg ( integer rr,
integer codecol )

Definition at line 1083 of file suews_ctrl_input.f95.

1084 ! Matches Impervious characteristics via codes in SiteSelect
1085 ! HCW 20 Nov 2014
1086 ! ---------------------------------------------------------
1087
1088 USE allocatearray
1089 USE initial
1091 USE defaultnotused
1092
1093 IMPLICIT NONE
1094
1095 INTEGER :: rr
1096 INTEGER :: codeCol
1097
1098 iv5 = 0 ! Reset iv5 to zero
1099
1100 DO iv5 = 1, nlinesnonveg
1101 IF (nonveg_coeff(iv5, ci_code) == siteselect(rr, codecol)) THEN
1102 EXIT
1103 ELSEIF (iv5 == nlinesnonveg) THEN
1104 WRITE (*, *) 'Program stopped! NonVeg code ', siteselect(rr, codecol), 'not found in SUEWS_NonVeg.txt.'
1105 CALL errorhint(57, 'Cannot find code in SUEWS_NonVeg.txt', siteselect(rr, codecol), notused, notusedi)
1106 END IF
1107 END DO
1108
1109 RETURN
real(kind(1d0)), dimension(:, :), allocatable nonveg_coeff
integer nlinesnonveg

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

Here is the call graph for this function:

◆ codematchohm()

subroutine codematchohm ( integer gridiv,
integer is,
character(len=4) swwd )

Definition at line 837 of file suews_ctrl_input.f95.

838 ! Matches OHM coefficients a1, a2, a3 via OHM codes
839 ! for summer/winter wet/dry conditions
840 ! HCW 03 Nov 2014
841 ! ---------------------------------------------------------
842
843 USE allocatearray
844 USE initial
847
848 IMPLICIT NONE
849
850 INTEGER :: gridiv
851 INTEGER :: is
852 CHARACTER(len=4) :: SWWD
853
854 iv5 = 0 ! Reset iv5 to zero
855
856 IF (swwd == 'SWet') THEN
857
860 EXIT
861 ELSEIF (iv5 == nlinesohmcoefficients) THEN
862 WRITE (*, *) 'Program stopped! OHM code (summer wet)', surfacechar(gridiv, c_ohmcode_swet(is)), &
863 'not found in OHM_Coefficients.txt for surface', is, '.'
864 CALL errorhint(57, 'Cannot find OHM code (summer wet)', surfacechar(gridiv, c_ohmcode_swet(is)), notused, notusedi)
865 END IF
866 END DO
867
868 ELSEIF (swwd == 'SDry') THEN
869
872 EXIT
873 ELSEIF (iv5 == nlinesohmcoefficients) THEN
874 WRITE (*, *) 'Program stopped! OHM code (summer dry)', surfacechar(gridiv, c_ohmcode_sdry(is)), &
875 'not found in OHM_Coefficients.txt for surface', is, '.'
876 CALL errorhint(57, 'Cannot find OHM code (summer dry)', surfacechar(gridiv, c_ohmcode_sdry(is)), notused, notusedi)
877 END IF
878 END DO
879
880 ELSEIF (swwd == 'WWet') THEN
881
884 EXIT
885 ELSEIF (iv5 == nlinesohmcoefficients) THEN
886 WRITE (*, *) 'Program stopped! OHM code (winter wet)', surfacechar(gridiv, c_ohmcode_wwet(is)), &
887 'not found in OHM_Coefficients.txt for surface', is, '.'
888 CALL errorhint(57, 'Cannot find OHM code (winter wet)', surfacechar(gridiv, c_ohmcode_wwet(is)), notused, notusedi)
889 END IF
890 END DO
891
892 ELSEIF (swwd == 'WDry') THEN
893
896 EXIT
897 ELSEIF (iv5 == nlinesohmcoefficients) THEN
898 WRITE (*, *) 'Program stopped! OHM code (winter dry)', surfacechar(gridiv, c_ohmcode_wdry(is)), &
899 'not found in OHM_Coefficients.txt for surface', is, '.'
900 CALL errorhint(57, 'Cannot find OHM code (winter dry)', surfacechar(gridiv, c_ohmcode_wdry(is)), notused, notusedi)
901 END IF
902 END DO
903
904 ELSE
905 WRITE (*, *) 'Problem with CodeMatchOHM (in SUEWS_CodeMatch.f95). ', swwd, ' not recognised. Needs to be one of: ', &
906 'SWet = Summer Wet, SDry = Summer Dry, WWet = WinterWet, WDry = Winter Dry. N.B. Case sensitive. '
907 stop
908 END IF
909
910 RETURN
integer, dimension(nsurfincsnow) c_ohmcode_wwet
integer, dimension(nsurfincsnow) c_ohmcode_sdry
integer, dimension(nsurfincsnow) c_ohmcode_swet
integer, dimension(nsurfincsnow) c_ohmcode_wdry
real(kind(1d0)), dimension(:, :), allocatable ohmcoefficients_coeff
integer nlinesohmcoefficients

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.

Here is the call graph for this function:

◆ codematchprof()

subroutine codematchprof ( integer gridiv,
integer surfacecharcodecol )

Definition at line 993 of file suews_ctrl_input.f95.

994 ! Matches Soil characteristics via codes in *SurfaceChar*
995 ! for energy use/water use/snow clearing
996 ! HCW 20 Nov 2014
997 ! ---------------------------------------------------------
998
999 USE allocatearray
1000 USE initial
1002 USE defaultnotused
1003
1004 IMPLICIT NONE
1005
1006 INTEGER :: Gridiv
1007 INTEGER :: SurfaceCharCodeCol
1008
1009 iv5 = 0 ! Reset iv5 to zero
1010
1011 DO iv5 = 1, nlinesprofiles
1012 IF (profiles_coeff(iv5, cpr_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1013 EXIT
1014 ELSEIF (iv5 == nlinesprofiles) THEN
1015 WRITE (*, *) 'Program stopped! Profile code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_Profiles.txt.'
1016 CALL errorhint(57, 'Cannot find code in SUEWS_Profiles.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1017 END IF
1018 END DO
1019
1020 RETURN
real(kind(1d0)), dimension(:, :), allocatable profiles_coeff
integer nlinesprofiles

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

Here is the call graph for this function:

◆ codematchsnow()

subroutine codematchsnow ( integer rr,
integer codecol )

Definition at line 1173 of file suews_ctrl_input.f95.

1174 ! Matches Snow characteristics via codes in SiteSelect
1175 ! HCW 20 Nov 2014
1176 ! ---------------------------------------------------------
1177
1178 USE allocatearray
1179 USE initial
1181 USE defaultnotused
1182
1183 IMPLICIT NONE
1184
1185 INTEGER :: rr
1186 INTEGER :: codeCol
1187
1188 iv5 = 0 ! Reset iv5 to zero
1189
1190 DO iv5 = 1, nlinessnow
1191 IF (snow_coeff(iv5, cs_code) == siteselect(rr, codecol)) THEN
1192 EXIT
1193 ELSEIF (iv5 == nlinessnow) THEN
1194 WRITE (*, *) 'Program stopped! Snow code ', siteselect(rr, codecol), 'not found in SUEWS_Snow.txt.'
1195 CALL errorhint(57, 'Cannot find code in SUEWS_Snow.txt', siteselect(rr, codecol), notused, notusedi)
1196 END IF
1197 END DO
1198
1199 RETURN
real(kind(1d0)), dimension(:, :), allocatable snow_coeff

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

Here is the call graph for this function:

◆ codematchsoil()

subroutine codematchsoil ( integer gridiv,
integer surfacecharcodecol )

Definition at line 1296 of file suews_ctrl_input.f95.

1297 ! Matches Soil characteristics via codes in *SurfaceChar*
1298 ! HCW 20 Nov 2014
1299 ! ---------------------------------------------------------
1300
1301 USE allocatearray
1302 USE initial
1304 USE defaultnotused
1305
1306 IMPLICIT NONE
1307
1308 INTEGER :: Gridiv
1309 INTEGER :: SurfaceCharCodeCol
1310
1311 iv5 = 0 ! Reset iv5 to zero
1312
1313 DO iv5 = 1, nlinessoil
1314 IF (soil_coeff(iv5, cso_code) == surfacechar(gridiv, surfacecharcodecol)) THEN
1315 EXIT
1316 ELSEIF (iv5 == nlinessoil) THEN
1317 WRITE (*, *) 'Program stopped! Soil code ', surfacechar(gridiv, surfacecharcodecol), 'not found in SUEWS_Soil.txt.'
1318 CALL errorhint(57, 'Cannot find code in SUEWS_Soil.txt', surfacechar(gridiv, surfacecharcodecol), notused, notusedi)
1319 END IF
1320 END DO
1321
1322 RETURN
real(kind(1d0)), dimension(:, :), allocatable soil_coeff

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

Here is the call graph for this function:

◆ codematchveg()

subroutine codematchveg ( integer rr,
integer codecol )

Definition at line 1113 of file suews_ctrl_input.f95.

1114 ! Matches Pervious characteristics via codes in SiteSelect
1115 ! HCW 20 Nov 2014
1116 ! ---------------------------------------------------------
1117
1118 USE allocatearray
1119 USE initial
1121 USE defaultnotused
1122
1123 IMPLICIT NONE
1124
1125 INTEGER :: rr
1126 INTEGER :: codeCol
1127
1128 iv5 = 0 ! Reset iv5 to zero
1129
1130 DO iv5 = 1, nlinesveg
1131 IF (veg_coeff(iv5, cp_code) == siteselect(rr, codecol)) THEN
1132 EXIT
1133 ELSEIF (iv5 == nlinesveg) THEN
1134 WRITE (*, *) 'Program stopped! Veg code ', siteselect(rr, codecol), 'not found in SUEWS_Vegs.txt.'
1135 CALL errorhint(57, 'Cannot find code in SUEWS_Veg.txt', siteselect(rr, codecol), notused, notusedi)
1136 END IF
1137 END DO
1138
1139 RETURN
real(kind(1d0)), dimension(:, :), allocatable veg_coeff

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

Here is the call graph for this function:

◆ codematchwater()

subroutine codematchwater ( integer rr,
integer codecol )

Definition at line 1143 of file suews_ctrl_input.f95.

1144 ! Matches Water characteristics via codes in SiteSelect
1145 ! HCW 20 Nov 2014
1146 ! ---------------------------------------------------------
1147
1148 USE allocatearray
1149 USE initial
1151 USE defaultnotused
1152
1153 IMPLICIT NONE
1154
1155 INTEGER :: rr
1156 INTEGER :: codeCol
1157
1158 iv5 = 0 ! Reset iv5 to zero
1159
1160 DO iv5 = 1, nlineswater
1161 IF (water_coeff(iv5, cw_code) == siteselect(rr, codecol)) THEN
1162 EXIT
1163 ELSEIF (iv5 == nlineswater) THEN
1164 WRITE (*, *) 'Program stopped! Water code ', siteselect(rr, codecol), 'not found in SUEWS_Water.txt.'
1165 CALL errorhint(57, 'Cannot find code in SUEWS_Water.txt', siteselect(rr, codecol), notused, notusedi)
1166 END IF
1167 END DO
1168
1169 RETURN
real(kind(1d0)), dimension(:, :), allocatable water_coeff
integer nlineswater

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

Here is the call 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 746 of file suews_ctrl_input.f95.

747
748 IMPLICIT NONE
749
750 INTEGER :: i, j !Used to count over hours and sub-hourly timesteps
751 INTEGER, INTENT(IN) :: Hour, Min, Sec
752 INTEGER :: total_sec, SecPerHour
753 REAL(KIND(1D0)), DIMENSION(0:23), INTENT(IN) :: Prof_24h
754 REAL(KIND(1D0)) :: deltaProf !Change in hourly profiles per model timestep
755 REAL(KIND(1D0)) :: Prof_CurrTime
756
757 total_sec = min*60 + sec
758 secperhour = 3600
759
760 i = hour
761 j = i + 1
762 IF (j == 24) j = 0
763
764 deltaprof = (prof_24h(j) - prof_24h(i))/secperhour
765 prof_currtime = prof_24h(hour) + deltaprof*total_sec
766

◆ 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 772 of file suews_ctrl_input.f95.

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

◆ 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 804 of file suews_ctrl_input.f95.

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

◆ inputheadercheck()

subroutine inputheadercheck ( character(len=50) filename)

Definition at line 258 of file suews_ctrl_input.f95.

259 ! Checks columns in input files match the columns expected by model code
260 ! Model code columns are defined here
261 ! Latest update:
262 ! MH 21 Jun 2017 - Added parameters to SUEWS_AnthropogenicEmissions.txt
263 ! MH 16 Jun 2017 - Added SUEWS_BiogenCO2.txt
264 ! TS 02 Mar 2016 - AnOHM related variables added
265 ! LJ 27 Jan 2016 - Removal of tabs
266 ! LJ 07 July 2015 - snow albedo removed
267 ! HCW 12 Nov 2014
268 !-------------------------------------------------------------------------
269
270 USE allocatearray
273
274 IMPLICIT NONE
275
276 CHARACTER(len=50) :: FileName
277
278 ! ========== Define expected column names here ==========
279 ! =======================================================
280
281 ! ========== SUEWS_NonVeg.txt =============
282 headernonveg_reqd(ci_code) = "Code"
283 headernonveg_reqd(ci_albmin) = "AlbedoMin"
284 headernonveg_reqd(ci_albmax) = "AlbedoMax"
285 headernonveg_reqd(ci_emis) = "Emissivity"
286 headernonveg_reqd(ci_stormin) = "StorageMin"
287 headernonveg_reqd(ci_stormax) = "StorageMax"
288 headernonveg_reqd(ci_wetthresh) = "WetThreshold"
289 headernonveg_reqd(ci_statelimit) = "StateLimit"
290 headernonveg_reqd(ci_dreq) = "DrainageEq"
291 headernonveg_reqd(ci_drcoef1) = "DrainageCoef1"
292 headernonveg_reqd(ci_drcoef2) = "DrainageCoef2"
293 headernonveg_reqd(ci_soiltcode) = "SoilTypeCode"
294 headernonveg_reqd(ci_snowlimpat) = "SnowLimPatch"
295 headernonveg_reqd(ci_snowlimrem) = "SnowLimRemove"
296 headernonveg_reqd(ci_ohmcode_swet) = "OHMCode_SummerWet"
297 headernonveg_reqd(ci_ohmcode_sdry) = "OHMCode_SummerDry"
298 headernonveg_reqd(ci_ohmcode_wwet) = "OHMCode_WinterWet"
299 headernonveg_reqd(ci_ohmcode_wdry) = "OHMCode_WinterDry"
300 headernonveg_reqd(ci_ohmthresh_sw) = "OHMThresh_SW"
301 headernonveg_reqd(ci_ohmthresh_wd) = "OHMThresh_WD"
302 headernonveg_reqd(ci_estmcode) = "ESTMCode"
303 headernonveg_reqd(ci_cpanohm) = "AnOHM_Cp" ! AnOHM TS
304 headernonveg_reqd(ci_kkanohm) = "AnOHM_Kk" ! AnOHM TS
305 headernonveg_reqd(ci_chanohm) = "AnOHM_Ch" ! AnOHM TS
306
307 ! ========== SUEWS_Veg.txt ===============
308 headerveg_reqd(cp_code) = "Code"
309 headerveg_reqd(cp_albmin) = "AlbedoMin"
310 headerveg_reqd(cp_albmax) = "AlbedoMax"
311 headerveg_reqd(cp_emis) = "Emissivity"
312 headerveg_reqd(cp_stormin) = "StorageMin"
313 headerveg_reqd(cp_stormax) = "StorageMax"
314 headerveg_reqd(cp_wetthresh) = "WetThreshold"
315 headerveg_reqd(cp_statelimit) = "StateLimit"
316 headerveg_reqd(cp_dreq) = "DrainageEq"
317 headerveg_reqd(cp_drcoef1) = "DrainageCoef1"
318 headerveg_reqd(cp_drcoef2) = "DrainageCoef2"
319 headerveg_reqd(cp_soiltcode) = "SoilTypeCode"
320 headerveg_reqd(cp_snowlimpat) = "SnowLimPatch"
321 headerveg_reqd(cp_baset) = "BaseT"
322 headerveg_reqd(cp_basete) = "BaseTe"
323 headerveg_reqd(cp_gddfull) = "GDDFull"
324 headerveg_reqd(cp_sddfull) = "SDDFull"
325 headerveg_reqd(cp_laimin) = "LAIMin"
326 headerveg_reqd(cp_laimax) = "LAIMax"
327 headerveg_reqd(cp_porositymin) = "PorosityMin"
328 headerveg_reqd(cp_porositymax) = "PorosityMax"
329 headerveg_reqd(cp_gsmax) = "MaxConductance"
330 headerveg_reqd(cp_laieq) = "LAIEq"
331 headerveg_reqd(cp_leafgp1) = "LeafGrowthPower1"
332 headerveg_reqd(cp_leafgp2) = "LeafGrowthPower2"
333 headerveg_reqd(cp_leafop1) = "LeafOffPower1"
334 headerveg_reqd(cp_leafop2) = "LeafOffPower2"
335 headerveg_reqd(cp_ohmcode_swet) = "OHMCode_SummerWet"
336 headerveg_reqd(cp_ohmcode_sdry) = "OHMCode_SummerDry"
337 headerveg_reqd(cp_ohmcode_wwet) = "OHMCode_WinterWet"
338 headerveg_reqd(cp_ohmcode_wdry) = "OHMCode_WinterDry"
339 headerveg_reqd(cp_ohmthresh_sw) = "OHMThresh_SW"
340 headerveg_reqd(cp_ohmthresh_wd) = "OHMThresh_WD"
341 headerveg_reqd(cp_estmcode) = "ESTMCode"
342 headerveg_reqd(cp_cpanohm) = "AnOHM_Cp" ! AnOHM TS
343 headerveg_reqd(cp_kkanohm) = "AnOHM_Kk" ! AnOHM TS
344 headerveg_reqd(cp_chanohm) = "AnOHM_Ch" ! AnOHM TS
345 headerveg_reqd(cp_biogenco2code) = "BiogenCO2Code"
346
347 ! ========== SUEWS_Water.txt ==================
348 headerwater_reqd(cw_code) = "Code"
349 headerwater_reqd(cw_albmin) = "AlbedoMin"
350 headerwater_reqd(cw_albmax) = "AlbedoMax"
351 headerwater_reqd(cw_emis) = "Emissivity"
352 headerwater_reqd(cw_stormin) = "StorageMin"
353 headerwater_reqd(cw_stormax) = "StorageMax"
354 headerwater_reqd(cw_wetthresh) = "WetThreshold"
355 headerwater_reqd(cw_statelimit) = "StateLimit"
356 headerwater_reqd(cw_waterdepth) = "WaterDepth"
357 headerwater_reqd(cw_dreq) = "DrainageEq"
358 headerwater_reqd(cw_drcoef1) = "DrainageCoef1"
359 headerwater_reqd(cw_drcoef2) = "DrainageCoef2"
360 headerwater_reqd(cw_ohmcode_swet) = "OHMCode_SummerWet"
361 headerwater_reqd(cw_ohmcode_sdry) = "OHMCode_SummerDry"
362 headerwater_reqd(cw_ohmcode_wwet) = "OHMCode_WinterWet"
363 headerwater_reqd(cw_ohmcode_wdry) = "OHMCode_WinterDry"
364 headerwater_reqd(cw_ohmthresh_sw) = "OHMThresh_SW"
365 headerwater_reqd(cw_ohmthresh_wd) = "OHMThresh_WD"
366 headerwater_reqd(cw_estmcode) = "ESTMCode"
367 headerwater_reqd(cw_cpanohm) = "AnOHM_Cp" ! AnOHM TS
368 headerwater_reqd(cw_kkanohm) = "AnOHM_Kk" ! AnOHM TS
369 headerwater_reqd(cw_chanohm) = "AnOHM_Ch" ! AnOHM TS
370
371 ! ========== SUEWS_Snow.txt ===================
372 headersnow_reqd(cs_code) = "Code"
373 headersnow_reqd(cs_snowrmfactor) = "RadMeltFactor"
374 headersnow_reqd(cs_snowtmfactor) = "TempMeltFactor"
375 headersnow_reqd(cs_snowalbmin) = "AlbedoMin"
376 headersnow_reqd(cs_snowalbmax) = "AlbedoMax"
377 headersnow_reqd(cs_snowemis) = "Emissivity"
380 headersnow_reqd(cs_snowplimalb) = "PrecipLimAlb"
381 headersnow_reqd(cs_snowsdmin) = "SnowDensMin"
382 headersnow_reqd(cs_snowsdmax) = "SnowDensMax"
386 headersnow_reqd(cs_snowplimsnow) = "PrecipLimSnow"
387 headersnow_reqd(cs_ohmcode_swet) = "OHMCode_SummerWet"
388 headersnow_reqd(cs_ohmcode_sdry) = "OHMCode_SummerDry"
389 headersnow_reqd(cs_ohmcode_wwet) = "OHMCode_WinterWet"
390 headersnow_reqd(cs_ohmcode_wdry) = "OHMCode_WinterDry"
391 headersnow_reqd(cs_ohmthresh_sw) = "OHMThresh_SW"
392 headersnow_reqd(cs_ohmthresh_wd) = "OHMThresh_WD"
393 headersnow_reqd(cs_estmcode) = "ESTMCode"
394 headersnow_reqd(cs_cpanohm) = "AnOHM_Cp" ! AnOHM TS
395 headersnow_reqd(cs_kkanohm) = "AnOHM_Kk" ! AnOHM TS
396 headersnow_reqd(cs_chanohm) = "AnOHM_Ch" ! AnOHM TS
397
398 ! ========== SUEWS_Soil.txt ===================
399 headersoil_reqd(cso_code) = "Code"
400 headersoil_reqd(cso_soildepth) = "SoilDepth"
401 headersoil_reqd(cso_soilstcap) = "SoilStoreCap"
402 headersoil_reqd(cso_ksat) = "SatHydraulicCond"
403 headersoil_reqd(cso_soildens) = "SoilDensity"
404 headersoil_reqd(cso_soilinfrate) = "InfiltrationRate"
405 headersoil_reqd(cso_obssmdepth) = "OBS_SMDepth"
406 headersoil_reqd(cso_obssmmax) = "OBS_SMCap"
407 headersoil_reqd(cso_obssnrfrac) = "OBS_SoilNotRocks"
408
409 ! ========== SUEWS_Conductance.txt ============
410 headercond_reqd(cc_code) = "Code"
421 headercond_reqd(cc_gskmax) = "Kmax"
422 headercond_reqd(cc_gsmodel) = "gsModel"
423
424 ! ========== SUEWS_OHMCoefficients.txt ========
429
430 ! ========== SUEWS_ESTMCoefficients.txt ========
478 headerestmcoefficients_reqd(ce_alb_ibld) = "Internal_albedo"
479 headerestmcoefficients_reqd(ce_em_ibld) = "Internal_emissivity"
480 headerestmcoefficients_reqd(ce_ch_iwall) = "Internal_CHwall"
481 headerestmcoefficients_reqd(ce_ch_iroof) = "Internal_CHroof"
482 headerestmcoefficients_reqd(ce_ch_ibld) = "Internal_CHbld"
483
484 ! ========== SUEWS_AnthropogenicEmission.txt ======
495 headeranthropogenic_reqd(ca_ahslopeheating_wd) = "AHSlope_Heating_WD"
496 headeranthropogenic_reqd(ca_ahslopeheating_we) = "AHSlope_Heating_WE"
497 headeranthropogenic_reqd(ca_ahslopecooling_wd) = "AHSlope_Cooling_WD"
498 headeranthropogenic_reqd(ca_ahslopecooling_we) = "AHSlope_Cooling_WE"
499 headeranthropogenic_reqd(ca_tcriticheating_wd) = "TCritic_Heating_WD"
500 headeranthropogenic_reqd(ca_tcriticheating_we) = "TCritic_Heating_WE"
501 headeranthropogenic_reqd(ca_tcriticcooling_wd) = "TCritic_Cooling_WD"
502 headeranthropogenic_reqd(ca_tcriticcooling_we) = "TCritic_Cooling_WE"
503 headeranthropogenic_reqd(ca_enprofwd) = "EnergyUseProfWD"
504 headeranthropogenic_reqd(ca_enprofwe) = "EnergyUseProfWE"
505 headeranthropogenic_reqd(ca_co2mwd) = "ActivityProfWD"
506 headeranthropogenic_reqd(ca_co2mwe) = "ActivityProfWE"
517 headeranthropogenic_reqd(ca_frfossilfuel_nonheat) = "FrFossilFuel_NonHeat"
524
525 ! ========== SUEWS_Irrigation.txt =============
529 headerirrigation_reqd(cir_intwu) = "InternalWaterUse"
545 headerirrigation_reqd(cir_daywatper1) = "DayWatPer(1)"
546 headerirrigation_reqd(cir_daywatper2) = "DayWatPer(2)"
547 headerirrigation_reqd(cir_daywatper3) = "DayWatPer(3)"
548 headerirrigation_reqd(cir_daywatper4) = "DayWatPer(4)"
549 headerirrigation_reqd(cir_daywatper5) = "DayWatPer(5)"
550 headerirrigation_reqd(cir_daywatper6) = "DayWatPer(6)"
551 headerirrigation_reqd(cir_daywatper7) = "DayWatPer(7)"
552
553 ! ========== SUEWS_Profiles.txt ===============
579
580 ! ========== SUEWS_WithinGridWaterDist.txt ====
591
592 ! ========== SUEWS_BiogenCO2.txt ======
593 headerbiogen_reqd(cb_code) = "Code"
594 headerbiogen_reqd(cb_alpha) = "alpha"
595 headerbiogen_reqd(cb_beta) = "beta"
596 headerbiogen_reqd(cb_theta) = "theta"
597 headerbiogen_reqd(cb_alpha_enh) = "alpha_enh"
598 headerbiogen_reqd(cb_beta_enh) = "beta_enh"
599 headerbiogen_reqd(cb_resp_a) = "resp_a"
600 headerbiogen_reqd(cb_resp_b) = "resp_b"
601 headerbiogen_reqd(cb_min_r) = "min_respi"
602
603 ! =======================================================
604
605 !write(*,*) 'Checking header for ', FileName
606 ! Check columns in input files match model code
607
608 IF (filename == 'SUEWS_NonVeg.txt') THEN
609 IF (any(headernonveg_file /= headernonveg_reqd)) THEN
611 WRITE (*, *) headernonveg_file
612 WRITE (*, *) headernonveg_reqd
613 CALL errorhint(56, 'Names or order of columns in SUEWS_NonVeg.txt does not match model code.', notused, notused, notusedi)
614 END IF
615
616 ELSEIF (filename == 'SUEWS_Veg.txt') THEN
617 IF (any(headerveg_file /= headerveg_reqd)) THEN
618 WRITE (*, *) headerveg_file == headerveg_reqd
619 CALL errorhint(56, 'Names or order of columns in SUEWS_Veg.txt does not match model code.', notused, notused, notusedi)
620 END IF
621
622 ELSEIF (filename == 'SUEWS_Water.txt') THEN
623 IF (any(headerwater_file /= headerwater_reqd)) THEN
624 WRITE (*, *) headerwater_file == headerwater_reqd
625 WRITE (*, *) headerwater_file
626 WRITE (*, *) headerwater_reqd
627 CALL errorhint(56, 'Names or order of columns in SUEWS_Water.txt does not match model code.', notused, notused, notusedi)
628 END IF
629
630 ELSEIF (filename == 'SUEWS_Snow.txt') THEN
631 IF (any(headersnow_file /= headersnow_reqd)) THEN
632 WRITE (*, *) headersnow_file == headersnow_reqd
633 CALL errorhint(56, 'Names or order of columns in SUEWS_Snow.txt does not match model code.', notused, notused, notusedi)
634 END IF
635
636 ELSEIF (filename == 'SUEWS_Soil.txt') THEN
637 IF (any(headersoil_file /= headersoil_reqd)) THEN
638 WRITE (*, *) headersoil_file == headersoil_reqd
639 CALL errorhint(56, 'Names or order of columns in SUEWS_Soil.txt does not match model code.', notused, notused, notusedi)
640 END IF
641
642 ELSEIF (filename == 'SUEWS_Conductance.txt') THEN
643 IF (any(headercond_file /= headercond_reqd)) THEN
644 WRITE (*, *) headercond_file == headercond_reqd
645 CALL errorhint(56, 'Names or order of columns in SUEWS_Cond.txt does not match model code.', notused, notused, notusedi)
646 END IF
647
648 ELSEIF (filename == 'SUEWS_OHMCoefficients.txt') THEN
651 CALL errorhint(56, 'Names or order of columns in SUEWS_OHMCoefficients.txt does not match model code.', &
653 END IF
654
655 ELSEIF (filename == 'SUEWS_ESTMCoefficients.txt') THEN
658 CALL errorhint(56, 'Names or order of columns in SUEWS_ESTMCoefficients.txt does not match model code.', &
660 END IF
661
662 ELSEIF (filename == 'SUEWS_AnthropogenicEmission.txt') THEN
665 CALL errorhint(56, 'Names or order of columns in SUEWS_AnthropogenicEmission.txt does not match model code.', &
667 END IF
668
669 ELSEIF (filename == 'SUEWS_Irrigation.txt') THEN
672 WRITE (*, *) headerirrigation_file
673 WRITE (*, *) headerirrigation_reqd
674 CALL errorhint(56, 'Names or order of columns in SUEWS_Irrigation.txt does not match model code.', &
676 END IF
677
678 ELSEIF (filename == 'SUEWS_Profiles.txt') THEN
681 CALL errorhint(56, 'Names or order of columns in SUEWS_Profiles.txt does not match model code.', &
683 END IF
684
685 ELSEIF (filename == 'SUEWS_WithinGridWaterDist.txt') THEN
688 CALL errorhint(56, 'Names or order of columns in SUEWS_WithinGridWaterDist.txt does not match model code.', &
690 END IF
691
692 ELSEIF (filename == 'SUEWS_BiogenCO2.txt') THEN
693 IF (any(headerbiogen_file /= headerbiogen_reqd)) THEN
695 CALL errorhint(56, 'Names or order of columns in SUEWS_BiogenCO2.txt does not match model code.', &
697 END IF
698
699 ELSE
700 WRITE (*, *) 'Problem in subroutine InputHeaderCheck. File header not specified in model code for ', filename
702
703 END IF
704
character(len=20), dimension(ncolumnsnonveg) headernonveg_reqd
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_reqd
character(len=20), dimension(ncolumnsnonveg) headernonveg_file
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_file
character(len=20), dimension(ncolumnswater) headerwater_reqd
character(len=20), dimension(ncolumnswater) headerwater_file
character(len=20), dimension(ncolumnssnow) headersnow_file
character(len=20), dimension(ncolumnsveg) headerveg_file
character(len=20), dimension(ncolumnsprofiles) headerprofiles_reqd
character(len=20), dimension(ncolumnssnow) headersnow_reqd
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_reqd
character(len=20), dimension(ncolumnssoil) headersoil_file
character(len=20), dimension(ncolumnsirrigation) headerirrigation_reqd
character(len=20), dimension(ncolumnsanthropogenic) headeranthropogenic_file
character(len=20), dimension(ncolumnsveg) headerveg_reqd
character(len=20), dimension(ncolumnsbiogen) headerbiogen_reqd
character(len=20), dimension(ncolumnsohmcoefficients) headerohmcoefficients_file
character(len=20), dimension(ncolumnsprofiles) headerprofiles_file
character(len=20), dimension(ncolumnsconductance) headercond_reqd
character(len=20), dimension(ncolumnsirrigation) headerirrigation_file
character(len=20), dimension(ncolumnsbiogen) headerbiogen_file
character(len=20), dimension(ncolumnsconductance) headercond_file
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_reqd
character(len=20), dimension(ncolumnssoil) headersoil_reqd
character(len=20), dimension(ncolumnsestmcoefficients) headerestmcoefficients_file
character(len=20), dimension(ncolumnswgwaterdist) headerwgwaterdist_reqd
integer, dimension(24) cpr_hours

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_baset_hc, 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_h_maintain, 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.

Here is the call 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 13 of file suews_ctrl_input.f95.

15
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, & !Volumetric/gravimetric soil moisture capacity
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, &
72 temp_c, wdir, pres_kpa, precip, avkdn, snowfrac_obs, ldown_obs, fcld_obs
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, &
86 temp_c, pres_kpa, precip, avkdn, snowfrac_obs, ldown_obs, fcld_obs, &
87 wu_m3, xsmd, lai_obs, kdiff, kdir, wdir
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
97 xsmd = (smcap - xsmd)*soildepthmeas*soilrocks
98 ELSEIF (smdmethod == 2 .AND. xsmd /= -999) THEN !Soil moisture -gravimetric
99 xsmd = (smcap - xsmd)*soildensity*soildepthmeas*soilrocks
100 ELSE
101 xsmd = -999
102 END IF
103
104 ELSE
105 CALL errorhint(55, 'RunControl.nml, InputMetFormat not usable.', notused, notused, inputmetformat)
106 END IF
107
108 !===============Meteorological variables reading done==========================
109 pres_hpa = pres_kpa*10. ! convert to hPa
110
111 ! get decimal time
112 dectime = id + it + imin/60.0
113
114 IF (iostat_var < 0) THEN
115 iostat_var = 0
116 CLOSE (lfn)
117 RETURN
118 END IF
119
120 IF (avkdn < 0) THEN
121 CALL errorhint(27, 'Met Data: avKdn - needed for StoreDrainPrm. resistance, If present, check file not tab delimited', &
122 avkdn, dectime, notusedi)
123 !sg removed this is causing the problems with resistances
124 ! AvKdn=0 !Solar radiation cannot be lower than 1
125 END IF
126
127 IF ((ldown_option == 1) .AND. (ldown_obs < 0)) THEN
128 CALL errorhint(27, 'Met Data: LWdn (ldown_obs) - impact Q* calc', ldown_obs, dectime, notusedi)
129
130 ELSEIF (ldown_option == 2) THEN
131 IF (fcld_obs == -999.0 .OR. fcld_obs < 0 .OR. fcld_obs > 1) THEN
132 CALL errorhint(27, 'Met Data: flcd_obs - impacts LW & Q* radiation', fcld_obs, dectime, notusedi)
133 END IF
134 END IF
135
136 IF (qn1_obs == -999 .AND. netradiationmethod == 0) THEN !If measured Q* is used and it is -999
137 CALL errorhint(27, 'Met Data: Q* - will impact everything', qn1_obs, dectime, notusedi)
138 END IF
139
140 IF (avu1 <= 0) THEN !If wind speed is negative
141 CALL errorhint(27, 'Met Data: avU1 - impacts aeroydnamic resistances', avu1, dectime, notusedi)
142 END IF
143
144 IF (temp_c < -50 .OR. temp_c > 60) THEN !If temperature unrealistic
145 CALL errorhint(27, 'Met Data: Temp_C - beyond what is expected', temp_c, dectime, notusedi)
146 END IF
147
148 IF (avrh > 100 .OR. avrh < 1) THEN !If relative humidity larger than 100%
149 CALL errorhint(27, 'Met Data: avRH - beyond what is expected', avrh, dectime, notusedi)
150 END IF
151
152 IF (pres_kpa < 80) THEN !If pressure too low
153 CALL errorhint(27, 'Met Data: Pres_kPa - too low - this could be fixed in model', pres_kpa, dectime, notusedi)
154 END IF
155
156 IF (precip < 0) THEN !If rain in negative, set it to zero
157 CALL errorhint(27, 'Met Data: Precip - less than 0', precip, dectime, notusedi)
158 END IF
159
160 IF (snowfrac_obs == nan) snowfrac_obs = 0
161
162 IF (snowuse == 0 .AND. (snowfrac_obs < 0 .OR. snowfrac_obs > 1)) THEN
163 CALL errorhint(27, 'Met Data: snow not between [0 1]', snowfrac_obs, dectime, notusedi)
164 END IF
165
166 IF (xsmd < 0 .AND. smdmethod == 1) THEN !If soil moisture deficit is zero
167 CALL errorhint(27, 'Met Data: xsmd - less than 0', xsmd, dectime, notusedi)
168 END IF
169
170 !Create an array to be printed out.
171 metarray(1:24) = (/iy, id, it, imin, qn1_obs, qh_obs, qe_obs, qs_obs, qf_obs, avu1, &
172 avrh, temp_c, pres_hpa, precip, avkdn, snowfrac_obs, ldown_obs, &
173 fcld_obs, wu_m3, xsmd, lai_obs, kdiff, kdir, wdir/)
174
175 !write(*,*) 'In LUMPS_MetRead (2)'
176 !write(*,*) 'imin',imin
177 !write(*,*) 'it',it
178 !write(*,*) 'id',id
179 !write(*,*) 'iy',iy
180
181 RETURN
182
real(kind(1d0)) nan

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

Referenced by metdisagg::disaggregatemet().

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 203 of file suews_ctrl_input.f95.

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

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

◆ skipheader()

subroutine skipheader ( integer lfn,
integer skip )

Definition at line 242 of file suews_ctrl_input.f95.

244 IMPLICIT NONE
245
246 INTEGER :: skip, lfn, i
247 DO i = 1, skip
248 READ (lfn, *, err=201, iostat=ios_out)
249 END DO
250
251 RETURN
252
253201 reall = real(skip)
254 CALL errorhint(20, 'In SkipHeader subroutine.', reall, notused, ios_out)
real(kind(1d0)) reall

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

Referenced by estm_module::suews_getestmdata().

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