Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 3 additions & 23 deletions Source/CFAST/cfast.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ program cfast
use utility_routines, only : cptime, read_command_options

use option_data, only: total_steps
use setup_data, only: cfast_version, stime, iofill, i_time_step, time_end, deltat, i_time_end, validation_flag, &
use setup_data, only: cfast_version, stime, iofill, i_time_step, time_end, deltat, i_time_end, validation_output, &
program_name, errormessage

implicit none

external post_process
real(eb) :: xdelt, tstop, tbeg, tend

program_name = 'CFAST'
Expand All @@ -60,7 +59,7 @@ program cfast
call read_command_options
call open_files

if (.not.validation_flag) call output_version(output_unit,'CFAST',cfast_version)
if (.not.validation_output) call output_version(output_unit,'CFAST',cfast_version)
call output_version(iofill,'CFAST',cfast_version)

call read_input_file
Expand All @@ -80,11 +79,9 @@ program cfast
call solve_simulation (tstop)
call cptime(tend)

if (.not.validation_flag) call output_runtime_diagnostics(output_unit,tend-tbeg,total_steps)
if (.not.validation_output) call output_runtime_diagnostics(output_unit,tend-tbeg,total_steps)
call output_runtime_diagnostics(iofill,tend-tbeg,total_steps)

call post_process('CFAST',0)

call cfastexit ('CFAST', 0)

contains
Expand All @@ -102,20 +99,3 @@ end subroutine output_runtime_diagnostics

end program cfast

subroutine post_process (name, errorcode)

use spreadsheet_routines, only : output_spreadsheet_dump
use dump_data, only: n_dumps
use option_data, only: total_steps
use setup_data, only: stime

character(len=*), intent(in) :: name
integer, intent(in) :: errorcode

! create the spreadsheet file of calculation results if necessary
if (n_dumps/=0) then
call output_spreadsheet_dump (name, errorcode, stime, total_steps)
end if

end subroutine post_process

6 changes: 1 addition & 5 deletions Source/CFAST/cfast_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ end module diag_data
module dump_data

use precision_parameters
use cfast_types, only: dump_type
use cparams, only: mx_dumps, mxitems

implicit none
Expand All @@ -88,9 +87,6 @@ module dump_data
(/'COMPARTMENTS', 'DEVICES ', 'MASSES ', 'VENTS ', 'WALLS '/)
integer, dimension(num_csvfiles) :: iocsv

integer :: n_dumps
type (dump_type), allocatable, dimension(:), target :: dumpinfo

logical :: alloc_dump = .true., init_dump = .true.

end module dump_data
Expand Down Expand Up @@ -278,7 +274,7 @@ module setup_data

logical :: nokbd=.false., initializeonly=.false., overwrite_testcase=.true.
logical :: listoutput=.false.
logical :: debugging = .false., validation_flag = .false., netheatflux = .false.
logical :: debugging = .false., validation_output = .false., net_heat_flux_output = .false.
integer :: outputformat = 0
integer, dimension(3) :: rundat
character(len=60) :: nnfile = " ", datafile
Expand Down
18 changes: 0 additions & 18 deletions Source/CFAST/cfast_structures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@ module cfast_types
character(len=128) :: fyi ! line available for comments or extra input
end type cfast_type

! user-customized data and calculation output data structure
type, extends(cfast_type) :: dump_type
! these are for user-specified calculations on data. output goes to _calculations.csv
character(len=24) :: file ! 'compartments', 'devices', 'masses', 'vents', or 'walls'
character(len=24) :: type ! 'trigger_greater', 'trigger_lesser', 'minimum', 'maximum', 'integrate',
! 'check_total_hrr'
real(eb) :: criterion ! Value used in 'trigger_...' analysis

character(len=128) :: first_field(2) ! Name of instrument, third row in spreadsheet and
! name of measurement for first device, second row in spreadsheet
character(len=128) :: second_field(2) ! Name of second instrument and second measurement,
! needed for 'trigger' and 'integrate',
! ignored for 'maximum', 'minimum', and 'check_total_hrr'
integer :: relative_column ! Order of columns. This is just the order in the input file

logical :: found ! The input channels are found in the requested csv files
end type dump_type

! detector / sprinkler structure
type, extends(cfast_type) :: detector_type
real(eb) :: center(3) ! position of detector center (user input)
Expand Down
47 changes: 3 additions & 44 deletions Source/CFAST/cfastexit.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ module exit_routines

use cparams, only: mx_dumps
use namelist_data, only: input_file_line, input_file_line_number
use setup_data, only: validation_flag, iofilo, iofill, iofilstat, smv_out_interval, iofilsmv, iofilsmvplt, iofilsmvzone, &
use setup_data, only: validation_output, iofilo, iofill, iofilstat, smv_out_interval, iofilsmv, iofilsmvplt, iofilsmvzone, &
ss_out_interval, iofilssc, iofilssd, iofilssm, iofilssv, iofilssdiag, iofilcalc, stopfile, program_name, &
errormessage, stime, project, extension
use option_data, only: total_steps
use dump_data, only: n_dumps, dumpinfo, csvnames, num_csvfiles, iocsv

implicit none

Expand All @@ -27,13 +26,12 @@ subroutine cfastexit (name, errorcode)
integer exitcode

exitcode = errorcode
if (errorcode/=0) call post_process
if (errorcode/=0) then
if (trim(name)=='solve_simulation' .and. errorcode==5) then
! validation flag test for the maximum iteration exit is because of CFASTBot's testing to make
! sure that CFAST can initialize and run a few steps of all the cases in debug mode but doesn't run
! to completion. DO NOT CHANGE WITHOUT CHANGING CFASTBOT.
if (.not.validation_flag) write (*, '(''Maximum iteration exit from '',a)') program_name
if (.not.validation_output) write (*, '(''Maximum iteration exit from '',a)') program_name
if (iofill/=0) write (iofill, '(''Maximum iteration exit from CFAST'',a)') program_name
exitcode = 0
else
Expand All @@ -50,7 +48,7 @@ subroutine cfastexit (name, errorcode)
end if
end if
else
if (.not.validation_flag) write (*, '(''Normal exit from '',a)') program_name
if (.not.validation_output) write (*, '(''Normal exit from '',a)') program_name
if (iofill/=0) write (iofill, '(''Normal exit from '',a)') program_name
end if

Expand All @@ -66,43 +64,6 @@ subroutine cfastexit (name, errorcode)

contains

subroutine post_process

integer, parameter :: nr = 2, ipad = 5, nc = mx_dumps + ipad
real(eb) :: dumparray(nr, nc)
character(len=128) :: dumpcarray(nr, nc)
integer :: i, mxcol

if (n_dumps<=0) return
dumparray(1, 1:nc) = 0
dumparray(2, 2:nc) = -1001
dumpcarray(1:nr, 2:nc) = 'NO VALUE ASSIGNED'
dumparray(2,1) = 0
dumpcarray(1,1) = 'File Name'
dumpcarray(2,1) = trim(project) // trim(extension)
dumpcarray(1,2) = 'Exit Code'
dumparray(2,2) = errorcode
dumpcarray(2,2) = '0'
dumpcarray(1,3) = 'Exit Routine'
dumpcarray(2,3) = trim(name)
dumparray(2,3) = 0
dumpcarray(1,4) = 'Simulation Time Completed'
dumparray(2,4) = stime
dumpcarray(1,5) = 'Total Steps Completed'
dumparray(2,5) = total_steps

do i = 1, n_dumps
dumpcarray(1, ipad + i) = trim(dumpinfo(i)%id)
end do
mxcol = ipad+n_dumps
call writecsvformat(iofilcalc, dumparray, dumpcarray, nr, nc, 1, 2, mxcol)

end subroutine post_process

! copied from outputspreadsheet because of make problems trying to
! include outputspreadsheet in cfastexit. A better solution should be
! found.

subroutine writecsvformat (iunit, x, c, nr, nc, nstart, mxr, mxc)

! routine: writecsvformat
Expand Down Expand Up @@ -143,8 +104,6 @@ subroutine writecsvformat (iunit, x, c, nr, nc, nstart, mxr, mxc)

end subroutine writecsvformat

!call output_spreadsheet_dump (name, errorcode, stime, total_steps)

end subroutine cfastexit

! --------------------------- delete_output_files -------------------------------------------
Expand Down
20 changes: 0 additions & 20 deletions Source/CFAST/initialization.f90
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ module initialization_routines
use defaults, only: default_temperature, default_pressure, default_relative_humidity, default_rti, &
default_activation_temperature, default_lower_oxygen_limit, default_radiative_fraction
use devc_data, only: n_detectors, detectorinfo, n_targets, targetinfo, alloc_devc, init_devc
use dump_data, only: n_dumps, dumpinfo, csvnames, iocsv_compartments, iocsv_vents, iocsv_masses, iocsv_walls, iocsv_devices, &
alloc_dump, init_dump
use fire_data, only: n_fires, fireinfo, n_tabls, tablinfo, n_furn, mxpts, lower_o2_limit, tgignt, summed_total_trace, &
alloc_fire, init_fire
use material_data, only: n_matl, material_info, alloc_matl, init_matl
Expand Down Expand Up @@ -566,24 +564,6 @@ subroutine initialize_memory
n_ssvent = 0
end if

! post-run calculation data
if (alloc_dump) then
alloc_dump = .false.
allocate (dumpinfo(mx_dumps))
end if
if (init_dump) then
init_dump = .false.
n_dumps = 0
dumpinfo(1:mx_dumps)%file = ' '
dumpinfo(1:mx_dumps)%type = ' '
dumpinfo(1:mx_dumps)%first_field(1) = ' '
dumpinfo(1:mx_dumps)%first_field(2) = ' '
dumpinfo(1:mx_dumps)%second_field(1) = ' '
dumpinfo(1:mx_dumps)%second_field(2) = ' '
dumpinfo(1:mx_dumps)%relative_column = -1
dumpinfo(1:mx_dumps)%criterion = -1
end if

end subroutine initialize_memory


Expand Down
3 changes: 1 addition & 2 deletions Source/CFAST/input.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ module input_routines
use namelist_data, only: input_file_line
use setup_data, only: iofili, iofilg, iofill, inputfile, outputfile, exepath, datapath, project, extension, smvhead, smvdata, &
smvcsv, smvsinfo, sscompartment, ssdevice, sswall, ssmasses, ssvent, &
ssdiag, sscalculation, validation_flag, gitfile, errorlogging, stopfile, queryfile, statusfile, &
ssdiag, sscalculation, validation_output, gitfile, errorlogging, stopfile, queryfile, statusfile, &
overwrite_testcase, errormessage
use smkview_data, only: n_slice, n_iso, n_visual, isoinfo, sliceinfo, visualinfo
use devc_data, only: n_detectors, detectorinfo, n_targets, targetinfo
use material_data, only: n_matl, material_info
use vent_data, only: n_hvents, n_vvents, hventinfo, vventinfo
use room_data, only: n_rooms, roominfo, exterior_ambient_temperature, interior_ambient_temperature, exterior_abs_pressure, &
interior_abs_pressure, pressure_ref, pressure_offset, exterior_rho, interior_rho
use dump_data, only: n_dumps, dumpinfo

implicit none
external get_info
Expand Down
Loading
Loading