53 CHARACTER(len=4) :: year_txt
55 CHARACTER(len=20) :: filecodex, &
58 CHARACTER(len=20) :: grid_txt, &
60 resin_txt, resinestm_txt
62 INTEGER :: readlinesmetdata_read
63 INTEGER :: nlineslimit, &
66 INTEGER :: year_int, &
72 REAL :: timestart, timefinish
75 CALL cpu_time(timestart)
80 WRITE (*, *)
'========================================================'
82 WRITE (*, *)
'Version commit: ', trim(
git_commit)
99 WRITE (tstep_txt,
'(I5)')
tstep/60
118 'No. of grids exceeds max. possible no. of grids.', &
139 WRITE (*, *)
'--------------------------------------------'
160 IF (
diagnose == 1)
WRITE (*, *)
'Calling ESTM_initials...'
167 IF (
diagnose == 1)
WRITE (*, *)
'Calling ESTM_ext_initialise...'
169 WRITE (*, *)
'No. vertical layers identified:',
nlayer,
'layers'
175 IF (
diagnose == 1)
WRITE (*, *)
'Calling ESTM_initials...'
183 WRITE (year_txt,
'(I4)') year_int
194 CALL errorhint(2,
'Problem in SUEWS_Program: check resolution of met forcing data (ResolutionFilesIn)'// &
195 'and model time-step (Tstep).', &
198 WRITE (*, *)
'Resolution of met forcing data: ', trim(adjustl(resin_txt)),
' min;', &
199 ' model time-step: ', trim(adjustl(tstep_txt)),
' min',
' -> SUEWS will perform disaggregation.'
200 IF (
diagnose == 1)
WRITE (*, *)
'Getting information for met disaggregation'
206 //trim(adjustl(resin_txt))//
'.txt'
210 //trim(adjustl(resin_txt))//
'.txt'
237 WRITE (*, *)
'ResolutionFilesIn = Tstep: no disaggregation needed for met data.'
247 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
251 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
268 WRITE (*, *)
'Met data will be read in blocks of ',
readlinesmetdata,
'lines.'
277 IF (
diagnose == 1)
WRITE (*, *)
'Allocating arrays in SUEWS_Program.f95...'
330 CALL errorhint(2,
'Problem in SUEWS_Program: check resolution of ESTM forcing data (ResolutionFilesInESTM)'// &
331 'and model time-step (Tstep).', &
334 WRITE (*, *)
'Resolution of ESTM forcing data: ', trim(adjustl(resinestm_txt)),
' min;', &
335 ' model time-step: ', trim(adjustl(tstep_txt)),
' min',
' -> SUEWS will perform disaggregation.'
336 IF (
diagnose == 1)
WRITE (*, *)
'Getting information for ESTM disaggregation'
342 //trim(adjustl(resinestm_txt))//
'.txt'
346 //trim(adjustl(resinestm_txt))//
'.txt'
356 'Downscaled ESTM and met input files will have different lengths', real(
nlinesmetdata, kind(1d0)), &
369 WRITE (*, *)
'ResolutionFilesInESTM = Tstep: no disaggregation needed for met data.'
375 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
379 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
390 CALL errorhint(66,
'ESTM input file different length to met forcing file', real(
nlinesmetdata, kind(1d0)), &
423 IF (iblock == 1)
THEN
424 IF (
diagnose == 1)
WRITE (*, *)
'First block of data - doing initialisation'
435 WRITE (*, *)
'Program stopped! Year', year_int,
'and/or grid', igrid,
'not found in SiteSelect.txt.'
436 CALL errorhint(59,
'Cannot find year and/or grid in SiteSelect.txt', real(igrid, kind(1d0)),
notused, year_int)
449 print *,
'Read in', readlinesmetdata_read,
'lines of met data in block', iblock,
'/',
readblocksmetdata
467 //trim(adjustl(resin_txt))//
'.txt'
470 //trim(adjustl(tstep_txt))//
'.txt'
476 //trim(adjustl(resin_txt))//
'.txt'
478 //trim(adjustl(tstep_txt))//
'.txt'
489 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
490 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
512 IF (iblock == 1)
THEN
513 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
533 //
'_ESTM_Ts_data_'//trim(adjustl(resinestm_txt))//
'.txt'
536 //
'_ESTM_Ts_data_'//trim(adjustl(tstep_txt))//
'.txt'
542 //trim(adjustl(resinestm_txt))//
'.txt'
544 //trim(adjustl(tstep_txt))//
'.txt'
555 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
556 filecodexwg = trim(
filecode)//
'_'//trim(year_txt)
589 IF (iblock == 1)
THEN
620 filecodex = trim(
filecode)//trim(adjustl(grid_txt))//
'_'//trim(year_txt)
621 IF (ir == 1 .AND. igrid == 1)
THEN
622 WRITE (*, *) trim(adjustl(filecodex)), &
623 ': Now running block ', iblock,
'/',
readblocksmetdata,
' of ', trim(year_txt),
'...'
626 IF (
diagnose == 1)
WRITE (*, *)
'Calling SUEWS_Calculations...'
628 IF (
diagnose == 1)
WRITE (*, *)
'SUEWS_Calculations finished...'
637 IF (ir == irmax)
THEN
640 filecodexwy = trim(
filecode)//trim(adjustl(grid_txt))
641 IF (
diagnose == 1)
WRITE (*, *)
'Calling NextInitial...'
659 IF (
diagnose == 1)
WRITE (*, *)
'Calling SUEWS_Output...'
667 IF (
diagnose == 1)
WRITE (*, *)
'Deallocating arrays in SUEWS_Program.f95...'
716 CALL cpu_time(timefinish)
717 WRITE (*, *)
"Time = ", timefinish - timestart,
" seconds."
721 OPEN (500, file=
'problems.txt')
724 OPEN (500, file=
'problems.txt', position=
"append")
727 WRITE (500, *)
'--------------'
728 WRITE (500, *)
'Run completed.'
733 WRITE (*, *)
"----- SUEWS run completed -----"
real(kind(1d0)), dimension(:), allocatable dqndt_grids
real(kind(1d0)), dimension(:, :), allocatable modeldailystate
real(kind(1d0)), dimension(:, :, :), allocatable dataoutspartacus
real(kind(1d0)), dimension(:, :), allocatable siteselect
real(kind(1d0)), dimension(:, :), allocatable ts5mindata
real(kind(1d0)), dimension(:), allocatable dailystatefirstopen
real(kind(1d0)), dimension(:, :), allocatable tin_surf_grids
integer, parameter ncolsestmdata
integer, parameter maxncols_cmod
real(kind(1d0)), dimension(:, :), allocatable metforcingdata_grid
real(kind(1d0)), dimension(:, :, :), allocatable dataoutestmext
integer, parameter maxnumberofgrids
integer, parameter ncolumnsdataoutbl
real(kind(1d0)), dimension(:), allocatable dqnsdt_grids
integer, parameter ncolumnsmetforcingdata
real(kind(1d0)), dimension(:), allocatable qn_s_av_grids
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsnow
integer, parameter ncolumnsdataoutsuews
integer, dimension(:), allocatable grididmatrix0
integer, dimension(:), allocatable usecolumnsdataout
integer, parameter ncolumnsdataoutestm
real(kind(1d0)), dimension(:, :, :), allocatable dataoutdebug
real(kind(1d0)), dimension(:, :), allocatable tsfc_surf_grids
integer, parameter maxncols_c
real(kind(1d0)), dimension(:), allocatable tair24hr
integer, parameter ncolumnsdataoutbeers
real(kind(1d0)), dimension(:, :, :), allocatable metforcingdata
integer, parameter ncolumnsdataoutspartacus
integer, parameter ncolumnsdataoutrsl
real(kind(1d0)), dimension(:, :), allocatable surfacechar
integer, dimension(:), allocatable grididmatrix
integer, parameter ncolumnsdataoutestmext
integer, parameter ncolumnsdataoutsnow
real(kind(1d0)), dimension(:, :, :), allocatable dataoutrsl
real(kind(1d0)), dimension(:, :, :), allocatable dataoutsuews
integer, parameter ncolumnsdataoutdailystate
integer, parameter maxncols_cmds
real(kind(1d0)), dimension(:), allocatable ts5mindata_ir
real(kind(1d0)), dimension(:, :, :), allocatable dataoutbl
real(kind(1d0)), dimension(:, :, :), allocatable modeloutputdata
real(kind(1d0)), dimension(:, :, :), allocatable dataoutdailystate
real(kind(1d0)), dimension(:, :, :), allocatable dataoutestm
real(kind(1d0)), dimension(:), allocatable tair_av_grids
real(kind(1d0)), dimension(:, :, :), allocatable estmforcingdata
real(kind(1d0)), dimension(:, :, :), allocatable dataoutbeers
integer, parameter maxlinesmet
real(kind(1d0)), dimension(:), allocatable qn_av_grids
integer, parameter ncolumnsdataoutdebug
subroutine cbl_readinputdata(FileInputPath, qh_choice)
subroutine suews_output(irMax, iv, Gridiv, iyr)
integer function count_lines(filename)
character(len=150) filedscdestm
integer netradiationmethod
integer resolutionfilesin
character(len=20) filecode
integer resolutionfilesinestm
character(len=150) fileestmts
character(len=90) progname
character(len=150) filemet
integer storageheatmethod
character(len=150) fileinputpath
character(len=150) filedscdmet
integer multipleestmfiles
character(len=150) fileorigestm
character(len=150) fileorigmet
subroutine suews_getestmdata(lunit)
subroutine estm_ext_finalise
subroutine estm_ext_initialise
integer readblocksmetdata
integer nlinesorigmetdata
integer nlinesorigestmdata
integer readlinesorigestmdatamax
integer readlinesorigmetdata
integer readlinesorigmetdatamax
integer readlinesorigestmdata
integer skippedlinesorigestm
integer readblocksorigmetdata
subroutine disaggregateestm(iBlock)
subroutine disaggregatemet(iBlock, igrid)
subroutine spartacus_initialise
real(kind(1d0)), dimension(:), allocatable qeforcbl
real(kind(1d0)), dimension(:), allocatable qhforcbl
real(kind(1d0)) nperestm_real
real(kind(1d0)) npertstepin_real
character(len=90) git_commit
character(len=90) compiler_ver
character(len=10) gridid_text
character(len=15) datetime
subroutine suews_calculations(Gridiv, ir, iMB, irMax)
subroutine errorhint(errh, ProblemFile, VALUE, value2, valueI)
subroutine overallruncontrol
subroutine initializesurfacecharacteristics(Gridiv, rr)
subroutine initialstate(GridName, year_int, Gridiv, NumberOfGrids)
subroutine suews_initializemetdata(lunit, ReadlinesMetdata_read)
subroutine nextinitial(GridName, year_int)
subroutine leapyearcalc(year_int, nroDays)