49 CHARACTER(len=4) :: year_txt
51 CHARACTER(len=20):: FileCodeX, &
54 CHARACTER(len=20):: grid_txt, &
56 ResIn_txt, ResInESTM_txt
58 INTEGER:: nlinesLimit, &
67 REAL:: timeStart, timeFinish
72 CALL cpu_time(timestart)
77 WRITE (*, *)
'========================================================' 94 WRITE (tstep_txt,
'(I5)')
tstep/60
113 'No. of grids exceeds max. possible no. of grids.', &
114 REAL(MaxNumberOfGrids, KIND(1d0)), NotUsed, NumberOfGrids)
120 DO igrid = 1, numberofgrids
134 WRITE (*, *)
'--------------------------------------------' 136 WRITE (*, *)
'No. grids identified:', numberofgrids,
'grids' 140 nlineslimit = int(floor(
maxlinesmet/
REAL(numberofgrids, kind(1d0))))
155 IF (
diagnose == 1)
WRITE (*, *)
'Calling ESTM_initials...' 163 WRITE (year_txt,
'(I4)') year_int
174 CALL errorhint(2,
'Problem in SUEWS_Program: check resolution of met forcing data (ResolutionFilesIn)'// &
175 'and model time-step (Tstep).', &
176 REAL(Tstep, KIND(1d0)), NotUsed, ResolutionFilesIn)
177 ELSEIF (
nper > 1)
THEN 178 WRITE (*, *)
'Resolution of met forcing data: ', trim(adjustl(resin_txt)),
' min;', &
179 ' model time-step: ', trim(adjustl(tstep_txt)),
' min',
' -> SUEWS will perform disaggregation.' 180 IF (
diagnose == 1)
WRITE (*, *)
'Getting information for met disaggregation' 186 //trim(adjustl(resin_txt))//
'.txt' 190 //trim(adjustl(resin_txt))//
'.txt' 216 ELSEIF (
nper == 1)
THEN 217 WRITE (*, *)
'ResolutionFilesIn = Tstep: no disaggregation needed for met data.' 227 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
231 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
248 WRITE (*, *)
'Met data will be read in blocks of ',
readlinesmetdata,
'lines.' 259 IF (
diagnose == 1)
WRITE (*, *)
'Allocating arrays in SUEWS_Program.f95...' 328 CALL errorhint(2,
'Problem in SUEWS_Program: check resolution of ESTM forcing data (ResolutionFilesInESTM)'// &
329 'and model time-step (Tstep).', &
330 REAL(Tstep, KIND(1d0)), NotUsed, ResolutionFilesInESTM)
332 WRITE (*, *)
'Resolution of ESTM forcing data: ', trim(adjustl(resinestm_txt)),
' min;', &
333 ' model time-step: ', trim(adjustl(tstep_txt)),
' min',
' -> SUEWS will perform disaggregation.' 334 IF (
diagnose == 1)
WRITE (*, *)
'Getting information for ESTM disaggregation' 340 //trim(adjustl(resinestm_txt))//
'.txt' 344 //trim(adjustl(resinestm_txt))//
'.txt' 354 'Downscaled ESTM and met input files will have different lengths',
REAL(nlinesMetdata, KIND(1d0)), &
355 NotUsed, nlinesESTMdata*NperESTM)
366 ELSEIF (nperestm == 1)
THEN 367 WRITE (*, *)
'ResolutionFilesInESTM = Tstep: no disaggregation needed for met data.' 373 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
377 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
388 CALL errorhint(66,
'ESTM input file different length to met forcing file',
REAL(nlinesMetdata, KIND(1d0)), &
389 NotUsed, nlinesESTMdata)
423 DO igrid = 1, numberofgrids
430 IF (iblock == 1)
THEN 431 IF (
diagnose == 1)
WRITE (*, *)
'First block of data - doing initialisation' 442 WRITE (*, *)
'Program stopped! Year', year_int,
'and/or grid', igrid,
'not found in SiteSelect.txt.' 443 CALL errorhint(59,
'Cannot find year and/or grid in SiteSelect.txt',
REAL(igrid, KIND(1d0)), NotUsed, year_int)
463 //trim(adjustl(resin_txt))//
'.txt' 466 //trim(adjustl(tstep_txt))//
'.txt' 472 //trim(adjustl(resin_txt))//
'.txt' 474 //trim(adjustl(tstep_txt))//
'.txt' 482 ELSEIF (
nper == 1)
THEN 485 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
486 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
508 IF (iblock == 1)
THEN 509 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
516 IF (nperestm > 1)
THEN 529 //
'_ESTM_Ts_data_'//trim(adjustl(resinestm_txt))//
'.txt' 532 //
'_ESTM_Ts_data_'//trim(adjustl(tstep_txt))//
'.txt' 538 //trim(adjustl(resinestm_txt))//
'.txt' 540 //trim(adjustl(tstep_txt))//
'.txt' 549 ELSEIF (nperestm == 1)
THEN 551 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
552 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
585 IF (iblock == 1)
THEN 607 DO igrid = 1, numberofgrids
614 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
615 IF (ir == 1 .AND. igrid == 1)
THEN 616 WRITE (*, *) trim(adjustl(filecodex)), &
617 ': Now running block ', iblock,
'/',
readblocksmetdata,
' of ', trim(year_txt),
'...' 619 IF (
diagnose == 1)
WRITE (*, *)
'Calling SUEWS_Calculations...' 623 IF (
diagnose == 1)
WRITE (*, *)
'SUEWS_Calculations finished...' 627 IF (igrid == numberofgrids)
THEN 633 IF (ir == irmax)
THEN 640 filecodexwy = trim(
filecode)//trim(adjustl(grid_txt))
641 IF (
diagnose == 1)
WRITE (*, *)
'Calling NextInitial...' 661 DO igrid = 1, numberofgrids
662 IF (
diagnose == 1)
WRITE (*, *)
'Calling SUEWS_Output...' 683 IF (
diagnose == 1)
WRITE (*, *)
'Deallocating arrays in SUEWS_Program.f95...' 738 CALL cpu_time(timefinish)
739 WRITE (*, *)
"Time = ", timefinish - timestart,
" seconds." 743 OPEN (500, file=
'problems.txt')
746 OPEN (500, file=
'problems.txt', position=
"append")
749 WRITE (500, *)
'--------------' 750 WRITE (500, *)
'Run completed.' 755 WRITE (*, *)
"----- SUEWS run completed -----" real(kind(1d0)) nper_real
integer readlinesorigmetdata
real(kind(1d0)), dimension(:, :), allocatable metforcingdata_grid
character(len=90) progname
integer, parameter maxncols_cmds
character(len=15) datetime
real(kind(1d0)), dimension(:, :, :), allocatable dataoutestm
integer, parameter ncolumnsmetforcingdata
real(kind(1d0)), dimension(:), allocatable qn1_s_av_grids
integer, parameter ncolumnsdataoutdailystate
subroutine cbl_readinputdata(FileInputPath, qh_choice)
real(kind(1d0)), dimension(:), allocatable qn1_av_grids
real(kind(1d0)), dimension(:, :, :), allocatable dataoutbl
subroutine disaggregatemet(iBlock, igrid)
integer readlinesorigestmdatamax
subroutine suews_output(irMax, iv, Gridiv, iyr)
character(len=150) fileorigmet
real(kind(1d0)), dimension(:, :), allocatable ts5mindata
integer, dimension(:), allocatable usecolumnsdataout
subroutine leapyearcalc(year_int, nroDays)
integer nlinesorigmetdata
integer, parameter ncolumnsdataoutbl
integer multipleestmfiles
character(len=150) fileestmts
subroutine suews_initializemetdata(lunit)
integer, dimension(:), allocatable grididmatrix
real(kind(1d0)), dimension(:, :), allocatable surfacechar
subroutine initialstate(GridName, year_int, Gridiv, NumberOfGrids)
real(kind(1d0)), dimension(:), allocatable dailystatefirstopen
integer resolutionfilesinestm
subroutine disaggregateestm(iBlock)
integer readlinesorigmetdatamax
character(len=150) filedscdestm
real(kind(1d0)), dimension(:), allocatable tair24hr
subroutine initializesurfacecharacteristics(Gridiv, rr)
integer, dimension(:), allocatable grididmatrix0
character(len=150) filedscdmet
subroutine nextinitial(GridName, year_int)
real(kind(1d0)) nperestm_real
character(len=150) fileinputpath
real(kind(1d0)), dimension(:, :, :), allocatable dataoutdailystate
integer, parameter ncolumnsdataoutrsl
integer, parameter ncolumnsdataoutsnow
real(kind(1d0)), dimension(:, :), allocatable siteselect
integer, parameter maxncols_cmod
integer nlinesorigestmdata
real(kind(1d0)), dimension(:, :), allocatable modeldailystate
integer, parameter maxlinesmet
subroutine overallruncontrol
integer, parameter ncolsestmdata
character(len=150) filemet
character(len=20) filecode
real(kind(1d0)), dimension(:), allocatable qeforcbl
integer readblocksorigmetdata
character(len=10) gridid_text
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsuews
integer function count_lines(filename)
real(kind(1d0)), dimension(:, :, :), allocatable dataoutrsl
subroutine suews_getestmdata(lunit)
integer, parameter ncolumnsdataoutsuews
real(kind(1d0)), dimension(:), allocatable dqnsdt_grids
real(kind(1d0)), dimension(:), allocatable qhforcbl
integer readlinesorigestmdata
subroutine suews_calculations(Gridiv, ir, iMB, irMax)
integer readblocksmetdata
character(len=150) fileorigestm
integer resolutionfilesin
real(kind(1d0)), dimension(:, :, :), allocatable metforcingdata
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsnow
integer, parameter maxncols_c
integer, parameter maxnumberofgrids
real(kind(1d0)), dimension(:, :, :), allocatable estmforcingdata
real(kind(1d0)), dimension(:), allocatable tair_av_grids
real(kind(1d0)), dimension(:), allocatable dqndt_grids
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
integer storageheatmethod
real(kind(1d0)), dimension(:, :, :), allocatable modeloutputdata
real(kind(1d0)), dimension(:), allocatable ts5mindata_ir
integer skippedlinesorigestm