diff --git a/Source/CFAST/cfast.f90 b/Source/CFAST/cfast.f90 index 9345a8c29..1f11bc490 100644 --- a/Source/CFAST/cfast.f90 +++ b/Source/CFAST/cfast.f90 @@ -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' @@ -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 @@ -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 @@ -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 - diff --git a/Source/CFAST/cfast_data.f90 b/Source/CFAST/cfast_data.f90 index 2ad04e5cb..4bda35869 100644 --- a/Source/CFAST/cfast_data.f90 +++ b/Source/CFAST/cfast_data.f90 @@ -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 @@ -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 @@ -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 diff --git a/Source/CFAST/cfast_structures.f90 b/Source/CFAST/cfast_structures.f90 index 2b26e3240..7aace9e03 100644 --- a/Source/CFAST/cfast_structures.f90 +++ b/Source/CFAST/cfast_structures.f90 @@ -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) diff --git a/Source/CFAST/cfastexit.f90 b/Source/CFAST/cfastexit.f90 index f60a145d9..68f72f288 100644 --- a/Source/CFAST/cfastexit.f90 +++ b/Source/CFAST/cfastexit.f90 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 ------------------------------------------- diff --git a/Source/CFAST/initialization.f90 b/Source/CFAST/initialization.f90 index d1ef35231..603cccec9 100644 --- a/Source/CFAST/initialization.f90 +++ b/Source/CFAST/initialization.f90 @@ -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 @@ -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 diff --git a/Source/CFAST/input.f90 b/Source/CFAST/input.f90 index 9695920ec..a230a5ec8 100644 --- a/Source/CFAST/input.f90 +++ b/Source/CFAST/input.f90 @@ -21,7 +21,7 @@ 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 @@ -29,7 +29,6 @@ module input_routines 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 diff --git a/Source/CFAST/input_namelist.f90 b/Source/CFAST/input_namelist.f90 index f272fac71..9e48938ec 100644 --- a/Source/CFAST/input_namelist.f90 +++ b/Source/CFAST/input_namelist.f90 @@ -5,7 +5,7 @@ module namelist_input_routines use exit_routines, only: cfastexit use fire_routines, only: flame_height use cfast_types, only: detector_type, fire_type, room_type, table_type, target_type, material_type, & - vent_type, visual_type, dump_type + vent_type, visual_type use cparams, only: mxdtect, mxfires, mxhvents, mxvvents, mxrooms, mxtarg, mxmvents, mxtabls, mxtablcols, & mxmatl, mx_hsep, default_grid, pde, cylpde, smoked, heatd, sprinkd, trigger_by_time, trigger_by_temp, trigger_by_flux, & @@ -19,12 +19,11 @@ module namelist_input_routines use diag_data, only: partial_pressure_h2o, partial_pressure_co2, gas_temperature, upper_layer_thickness, & verification_time_step, verification_fire_heat_flux, verification_ast, & radiative_incident_flux_ast, radi_verification_flag - use dump_data, only: n_dumps, dumpinfo, num_csvfiles, csvnames use fire_data, only: n_fires, fireinfo, n_furn, furn_time, furn_temp, tgignt, lower_o2_limit, mxpts, sigma_s, n_tabls, & tablinfo, init_fire use namelist_data, only: input_file_line_number, input_file_line, headflag, timeflag, initflag, miscflag, matlflag, & compflag, devcflag, tablflag, insfflag, fireflag, ventflag, connflag, diagflag, slcfflag, isofflag, & - dumpflag, convert_negative_distances + convert_negative_distances use option_data, only: option, on, off, frad, & fdebug, fpsteady, fpdassl, fresidprn use room_data, only: n_rooms, roominfo, exterior_ambient_temperature, interior_ambient_temperature, exterior_abs_pressure, & @@ -33,7 +32,7 @@ module namelist_input_routines interior_ambient_o2_mass_fraction, exterior_ambient_o2_mass_fraction, & interior_ambient_n2_mass_fraction, exterior_ambient_n2_mass_fraction use setup_data, only: iofili, iofill, cfast_version, title, time_end, & - print_out_interval, smv_out_interval, ss_out_interval, validation_flag, netheatflux, ssoutoptions, & + print_out_interval, smv_out_interval, ss_out_interval, validation_output, net_heat_flux_output, ssoutoptions, & overwrite_testcase, inputfile, errormessage use solver_data, only: stpmax, stp_cnt_max, stpmin, stpmin_cnt_max, stpminflag use smkview_data, only: n_visual, visualinfo @@ -70,7 +69,6 @@ subroutine namelist_input call read_isof (iofili) call read_slcf (iofili) call read_diag (iofili) - call read_dump (iofili) close (iofili) @@ -214,120 +212,56 @@ end subroutine set_defaults end subroutine read_time - ! --------------------------- apply_output_options ------------------------------------------- - -!> \brief apply output options read from &OUTP - - subroutine apply_output_options (validation_output, net_heat_flux_output, spreadsheet_output) - - logical, intent(in) :: validation_output, net_heat_flux_output - character(len=*), intent(in) :: spreadsheet_output - - if (validation_output) validation_flag = .true. - if (net_heat_flux_output) netheatflux = .true. - if (trim(spreadsheet_output)/=' ') call set_spreadsheet_output_options(spreadsheet_output) - - end subroutine apply_output_options - - ! --------------------------- set_spreadsheet_output_options ------------------------------------------- - -!> \brief set spreadsheet output options from a CDMVW-style option string - - subroutine set_spreadsheet_output_options (selected_outputs) - - character(len=*), intent(in) :: selected_outputs - - integer :: i, index - character(len=26) :: selected - - selected = adjustl(selected_outputs) - do i = 1, len_trim(selected) - if (selected(i:i)>='a'.and.selected(i:i)<='z') selected(i:i) = achar(ichar(selected(i:i))-32) - end do - ssoutoptions = 0 - - if (selected=='ALL') then - ssoutoptions = (/ (i, i=1,26) /) - return - end if - if (selected=='NONE'.or.selected=='OFF') return - - do i = 1, len_trim(selected) - if (selected(i:i)>='A'.and.selected(i:i)<='Z') then - index = ichar(selected(i:i))-ichar('A')+1 - else - cycle - end if - ssoutoptions(index) = i - end do - - end subroutine set_spreadsheet_output_options - ! --------------------------- read_output_options ------------------------------------------- -!> \brief pre-read output options needed before the full input file is processed - -!> \param lu (input): logical input unit number for the open input file + !> \brief pre-read output options needed before the full input file is processed + !> \param lu (input): logical input unit number for the open input file subroutine read_output_options (lu) + use setup_data, only: validation_output, net_heat_flux_output integer, intent(in) :: lu - integer :: ios - real(eb) :: criterion - logical :: validation_output, net_heat_flux_output - character(len=25) :: file, type - character(len=64) :: id, first_device, first_measurement, second_device, second_measurement - character(len=64), dimension(2) :: first_field, second_field character(len=26) :: spreadsheet_output character(len=128) :: fyi + integer :: i, index + character(len=26) :: selected - namelist /OUTP/ id, file, first_device, first_measurement, second_device, & - second_measurement, first_field, second_field, criterion, type, fyi, validation_output, & - net_heat_flux_output, spreadsheet_output + namelist /OUTP/ fyi, validation_output, net_heat_flux_output, spreadsheet_output ios = 1 rewind (unit=lu) input_file_line_number = 0 + spreadsheet_output = ' ' - outp_loop: do - call checkread ('OUTP',lu,ios) - if (ios==1) exit outp_loop - - call set_defaults - read(lu,OUTP,iostat=ios) - if (ios>0) then - write(errormessage, '(a)') 'Error, Invalid specification in &OUTP inputs.' - call cfastexit('read_output_options',1) - end if + call checkread ('OUTP',lu,ios) + read(lu,OUTP,iostat=ios) + if (ios>0) then + write(errormessage, '(a)') 'Error, Invalid specification in &OUTP inputs.' + call cfastexit('read_output_options',1) + end if - call apply_output_options(validation_output, net_heat_flux_output, spreadsheet_output) - end do outp_loop + ssoutoptions = (/ (i, i=1,26) /) + if (trim(spreadsheet_output)/=' ') then + selected = adjustl(spreadsheet_output) + do i = 1, len_trim(selected) + if (selected(i:i)>='a'.and.selected(i:i)<='z') selected(i:i) = achar(ichar(selected(i:i))-32) + end do + ssoutoptions = 0 + + do i = 1, len_trim(selected) + if (selected(i:i)>='A'.and.selected(i:i)<='Z') then + index = ichar(selected(i:i))-ichar('A')+1 + else + cycle + end if + ssoutoptions(index) = i + end do + end if rewind (unit=lu) input_file_line_number = 0 - contains - - subroutine set_defaults - - id = ' ' - fyi = ' ' - file = ' ' - first_field = ' ' - second_field = (/' ', ' '/) - first_device = ' ' - first_measurement = ' ' - second_device = ' ' - second_measurement = ' ' - type = ' ' - criterion = -1 - validation_output = .false. - net_heat_flux_output = .false. - spreadsheet_output = ' ' - - end subroutine set_defaults - end subroutine read_output_options ! --------------------------- read_init ------------------------------------------ @@ -2383,7 +2317,7 @@ subroutine read_diag (lu) end if diag_flag - if (radi_verification_flag) validation_flag = .true. + if (radi_verification_flag) validation_output = .true. contains @@ -2408,244 +2342,6 @@ end subroutine set_defaults end subroutine read_diag - ! --------------------------- read_dump -------------------------------------------- - -!> \brief read in &DUMP namelist that includes optional output specifications - -!> \param lu (input): logical input unit number for the open input file - - subroutine read_dump (lu) - - integer, intent(in) :: lu - - integer :: ios, i, ii, counter - type(dump_type), pointer :: dumpptr - logical :: found, validation_output, net_heat_flux_output - - real(eb) :: criterion - character(len=4) :: dump_syntax - character(len=25) :: file, type - character(len=64) :: id, first_device, first_measurement, second_device, second_measurement - character(len=64), dimension(2) :: first_field, second_field - character(len=26) :: spreadsheet_output - character(len=128) :: fyi - - namelist /DUMP/ id, file, first_device, first_measurement, second_device, & - second_measurement, first_field, second_field, criterion, type, fyi - namelist /OUTP/ id, file, first_device, first_measurement, second_device, & - second_measurement, first_field, second_field, criterion, type, fyi, validation_output, & - net_heat_flux_output, spreadsheet_output - - - ios = 1 - rewind (unit=lu) - input_file_line_number = 0 - counter = 0 - dump_syntax = "NULL" - - ! Scan entire file to look for 'DUMP' - dump_loop: do - call checkread ('DUMP',lu,ios) - if (ios==0) then - dumpflag=.true. - dump_syntax = 'DUMP' - call set_defaults - read(lu,DUMP,err=34,iostat=ios) - counter = counter + 1 -34 if (ios>0) then - write(errormessage, '(a,i3)') 'Error, Invalid specification in &DUMP inputs. Check &DUMP number ' , counter+1 - call cfastexit('read_dump',1) - end if - else if (ios==1) then - exit dump_loop - end if - end do dump_loop - if (.not.dumpflag.and.counter==0) then - ios = 1 - rewind (unit=lu) - input_file_line_number = 0 - counter = 0 - ! Scan entire file to look for 'OUTP' - outp_loop: do - call checkread ('OUTP',lu,ios) - if (ios==0) then - dump_syntax = 'OUTP' - call set_defaults - read(lu,OUTP,err=35,iostat=ios) - counter = counter + 1 -35 if (ios>0) then - write(errormessage, '(a,i3)') 'Error, Invalid specification in &OUTP inputs. Check &OUTP number ' , counter+1 - call cfastexit('read_dump',1) - end if - if (.not.output_options_only()) dumpflag=.true. - else if (ios==1) then - exit outp_loop - end if - end do outp_loop - end if - - if (counter>0) then - - rewind (lu) - input_file_line_number = 0 - - ! Assign value to CFAST variables for further calculations - read_dump_loop: do ii = 1,counter - - call checkread(dump_syntax,lu,ios) - call set_defaults - if (dump_syntax=='DUMP') read(lu,DUMP) - if (dump_syntax=='OUTP') read(lu,OUTP) - - call apply_output_options(validation_output, net_heat_flux_output, spreadsheet_output) - if (dump_syntax=='OUTP' .and. output_options_only()) cycle read_dump_loop - - if (first_field(1)==' ' .and. first_field(2)==' ' .and. first_device/=' ' .and. first_measurement/=' ') then - first_field(1) = first_device - first_field(2) = first_measurement - end if - if (second_field(1)==' ' .and. second_field(2)==' ' .and. second_device/=' ' .and. second_measurement/=' ') then - second_field(1) = second_device - second_field(2) = second_measurement - end if - - if (id == ' ') then - write(errormessage,'(3a,i0)') 'Error in &',dump_syntax,': ID must be defined number ', counter - call cfastexit('read_dump',2) - end if - - if (.not.newid(id)) then - write(errormessage,'(5a,i3)') '***Error, Not a unique identifier for &',dump_syntax,': ',trim(id), & - 'Check dump ',counter - call cfastexit('read_dump',3) - end if - found = .false. - do i = 1, num_csvfiles - if (trim(file)==trim(csvnames(i))) then - found = .true. - end if - end do - if (.not.found) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': Invalid specification for FILE ',trim(file), & - ' number ',counter - call cfastexit('read_dump',4) - end if - if (.not.((type(1:3)=='MIN').or.(type(1:3)=='MAX').or. & - (type(1:8)=='TRIGGER_').or.(type(1:9)=='INTEGRATE').or. & - (type(1:15)=='CHECK_TOTAL_HRR'))) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': Invalid specification for type ',trim(type), & - ' number ',counter - call cfastexit('read_dump',5) - end if - if (first_field(1)==' ') then - write(errormessage,'(3a,i0)') 'Error in &',dump_syntax,': FIRST_FIELD must be defined, number ',counter - call cfastexit('read_dump',6) - end if - if (first_field(2)==' ') then - write(errormessage,'(3a,i0)') 'Error in &',dump_syntax,': FIRST_FIELD must be defined, number ',counter - call cfastexit('read_dump',7) - end if - if ((type(1:8)=='TRIGGER_').and.(second_field(1)==' ')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': SECOND_FIELD must be defined for type ', trim(type), & - ', number ',counter - call cfastexit('read_dump',8) - end if - if ((type(1:8)=='TRIGGER_').and.(second_field(2)==' ')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': SECOND_FIELD must be defined for type ', trim(type), & - ', number ',counter - call cfastexit('read_dump',9) - end if - if ((type(1:9)=='INTEGRATE').and.(second_field(2)==' ')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': SECOND_FIELD must be defined for type ', trim(type), & - ', number ',counter - call cfastexit('read_dump',10) - end if - if ((trim(type)=='INTEGRATE').and.(second_field(2)==' ')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': SECOND_FIELD must be defined for type ', trim(type), & - ', number ',counter - call cfastexit('read_dump',11) - end if - if ((type(1:9)=='INTEGRATE').and.(first_field(1)(1:4)/='Time')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': FIRST_FIELD must be defined as Simulation Time for ', & - trim(type),', number ',counter - call cfastexit('read_dump',12) - end if - if ((type(1:9)=='INTEGRATE').and.(first_field(1)(1:15)/='Simulation Time')) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': FIRST_FIELD must be defined as Time for ', & - trim(type),' number ',counter - call cfastexit('read_dump',13) - end if - if ((type(1:8)=='TRIGGER_').and.(criterion<=0)) then - write(errormessage,'(3a,i0)') 'Error in &',dump_syntax,': for a TRIGGER analysis CRITERION must be > 0 number ', & - counter - call cfastexit('read_dump',14) - end if - - n_dumps = n_dumps + 1 - if (n_dumps>mx_dumps) then - write(errormessage,'(5a,i0)') 'Error in &',dump_syntax,': Too many &',dump_syntax,' entries. Maximum is', mx_dumps - call cfastexit('read_dump',15) - end if - dumpptr => dumpinfo(n_dumps) - dumpptr%id = id - dumpptr%fyi = fyi - if (type(1:15) == 'CHECK_TOTAL_HRR') then - dumpptr%file = 'NORMAL' - dumpptr%type = type(1:len(dumpptr%type)) - dumpptr%first_field(1) = 'Time' - dumpptr%first_field(2) = 'Simulation Time' - dumpptr%second_field = first_field - dumpptr%criterion = 0 - dumpptr%relative_column = n_dumps - dumpptr%found = .false. - else - dumpptr%file = file(1:len(dumpptr%file)) - dumpptr%type = type(1:len(dumpptr%type)) - dumpptr%first_field(1) = first_field(1) - dumpptr%first_field(2) = first_field(2) - dumpptr%second_field(1) = second_field(1) - dumpptr%second_field(2) = second_field(2) - dumpptr%criterion = criterion - dumpptr%relative_column = n_dumps - dumpptr%found = .false. - end if - - end do read_dump_loop - - end if - - contains - - subroutine set_defaults - - id = ' ' - fyi = ' ' - file = ' ' - first_field = ' ' - second_field = (/' ', ' '/) - first_device = ' ' - first_measurement = ' ' - second_device = ' ' - second_measurement = ' ' - type = ' ' - criterion = -1 - validation_output = .false. - net_heat_flux_output = .false. - spreadsheet_output = ' ' - - end subroutine set_defaults - - logical function output_options_only() - - output_options_only = id==' ' .and. file==' ' .and. first_device==' ' .and. & - first_measurement==' ' .and. second_device==' ' .and. second_measurement==' ' .and. & - first_field(1)==' ' .and. first_field(2)==' ' .and. second_field(1)==' ' .and. & - second_field(2)==' ' .and. type==' ' .and. criterion<0 - - end function output_options_only - - end subroutine read_dump - ! --------------------------- checkread --------------------------------------- !> \brief read input file checking for the next specified namelist input. diff --git a/Source/CFAST/output.f90 b/Source/CFAST/output.f90 index f248fe2a5..fb7fff37d 100644 --- a/Source/CFAST/output.f90 +++ b/Source/CFAST/output.f90 @@ -20,14 +20,14 @@ module output_routines use setup_data, only: cfast_version, iofill, iofilo, iofilstat, iofilsmv, iofilsmvplt, iofilsmvzone, & iofilssc, iofilssd, iofilssw, iofilssm, iofilssv, & iofilssdiag, inputfile, iofilcalc, listoutput, & - outputfile, statusfile, title, outputformat, validation_flag, netheatflux, time_end, print_out_interval, & + outputfile, statusfile, title, outputformat, validation_output, net_heat_flux_output, time_end, print_out_interval, & smv_out_interval, ss_out_interval, smvhead, smvdata, smvcsv, & ssdiag, sscalculation, sscompartment, ssdevice, sswall, ssmasses, ssvent, ssoutoptions, errormessage use solver_data, only: atol, nofp, noftu, noftl, nofvu, nofwt, nofoxyl, nofprd use devc_data, only: n_detectors, detectorinfo, n_targets, targetinfo use material_data, only: n_matl, material_info use vent_data, only: n_hvents, hventinfo, n_vvents, vventinfo, n_mvents, mventinfo, n_leaks, leakinfo - use dump_data, only: n_dumps, dumpinfo, iocsv, iocsv_walls, iocsv_compartments, iocsv_vents, iocsv_masses, iocsv_devices + use dump_data, only: iocsv, iocsv_walls, iocsv_compartments, iocsv_vents, iocsv_masses, iocsv_devices use iso_fortran_env, only: compiler_version implicit none @@ -567,7 +567,7 @@ subroutine results_targets tctemp = targptr%tinternal gasfed = targptr%fed_gas heatfed = targptr%fed_heat - if (validation_flag.or.netheatflux) then + if (validation_output.or.net_heat_flux_output) then itotal = targptr%flux_incident_front total = targptr%flux_net_gauge(1) else @@ -1217,7 +1217,7 @@ subroutine flwout (outbuf,flow1,flow2,flow3,flow4,flow5,flow6,flow7,flow8) write (outbuf(13*(i-1)+1:13*i),5000) flow(i) end if if (flow(i)<=atol) outbuf(13*(i-1)+1:13*i) = ' ' - if (validation_flag.and.flow(i).ne.0.0_eb) write (outbuf(13*(i-1)+1:13*i),5050) flow(i) + if (validation_output.and.flow(i).ne.0.0_eb) write (outbuf(13*(i-1)+1:13*i),5050) flow(i) end do 5000 format (2x,1pg11.3) @@ -1488,11 +1488,6 @@ subroutine open_output_files if (ssoutoptions(ichar('W')-ichar('A')+1)>0) open(iofilssw, file=sswall,form='formatted') iocsv(iocsv_walls) = iofilssw - if (n_dumps/=0) then - iofilcalc = get_filenumber() - open (iofilcalc, file=sscalculation,form='formatted') - end if - if (radi_verification_flag) then iofilssdiag = get_filenumber() open (iofilssdiag, file=ssdiag,form='formatted') diff --git a/Source/CFAST/outputspreadsheet.f90 b/Source/CFAST/outputspreadsheet.f90 index 6f890fa2f..716f9d53a 100644 --- a/Source/CFAST/outputspreadsheet.f90 +++ b/Source/CFAST/outputspreadsheet.f90 @@ -9,7 +9,7 @@ module spreadsheet_routines use spreadsheet_header_routines use utility_routines, only: ssaddtolist, readcsvformat, tointstring - use cfast_types, only: fire_type, room_type, detector_type, target_type, vent_type, dump_type, ssout_type, vent_type + use cfast_types, only: fire_type, room_type, detector_type, target_type, vent_type, ssout_type, vent_type use cparams, only: u, l, in, out, mxrooms, mxfires, mxdtect, mxtarg, mxhvents, mxfslab, mxvvents, mxmvents, mxleaks, & ns, soot, soot_flaming, soot_smolder, smoked, mx_dumps, mxss, cjetvelocitymin, & @@ -20,12 +20,11 @@ module spreadsheet_routines use diag_data, only: radi_verification_flag use fire_data, only: n_fires, fireinfo use room_data, only: n_rooms, roominfo, pressure_ref - use setup_data, only: validation_flag, iofilsmvzone, iofilssc, iofilssd, iofilssw, iofilssm, iofilssv, & + use setup_data, only: validation_output, iofilsmvzone, iofilssc, iofilssd, iofilssw, iofilssm, iofilssv, & iofilssdiag, iofilcalc, iofill, ss_out_interval, project, extension, ssoutoptions, errormessage use spreadsheet_output_data, only: n_sscomp, sscompinfo, n_ssdevice, ssdeviceinfo, n_sswall, sswallinfo, n_ssmass, & ssmassinfo, n_ssvent, ssventinfo, outarray use vent_data, only: n_hvents, hventinfo, n_vvents, vventinfo, n_mvents, mventinfo, n_leaks, leakinfo - use dump_data, only: n_dumps, dumpinfo, csvnames, num_csvfiles, iocsv implicit none @@ -33,7 +32,7 @@ module spreadsheet_routines private - public output_spreadsheet, output_spreadsheet_smokeview, output_spreadsheet_dump + public output_spreadsheet, output_spreadsheet_smokeview contains @@ -88,7 +87,7 @@ subroutine output_spreadsheet_compartments (time) call ssaddtoheader (sscompinfo, n_sscomp, 'VOL_'//trim(cRoom), 'Upper Layer Volume', roomptr%id, 'm^3') call ssaddtoheader (sscompinfo, n_sscomp, 'PRS_'//trim(cRoom), 'Pressure', roomptr%id, 'Pa') call ssaddtoheader (sscompinfo, n_sscomp, 'APRS_'//trim(cRoom), 'Absolute Pressure', roomptr%id, 'Pa') - if (validation_flag) then + if (validation_output) then species_units = 'mol_frac' smoke_units = 'mg/m^3' else @@ -223,7 +222,7 @@ subroutine output_spreadsheet_devices (time) targptr%id, 'm') call ssaddtoheader (ssdeviceinfo, n_ssdevice, 'TRGPRS_'//trim(cDet), 'Target Pressure', & targptr%id, 'Pa') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssdeviceinfo, n_ssdevice, 'TRGFLXR_'//trim(cDet), 'Target Radiative Flux', & targptr%id, 'kW/m^2') call ssaddtoheader (ssdeviceinfo, n_ssdevice, 'TRGFLXC_'//trim(cDet), 'Target Convective Flux', & @@ -246,7 +245,7 @@ subroutine output_spreadsheet_devices (time) targptr%id, 'kW/m^2') end if ! back surface - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssdeviceinfo, n_ssdevice, 'B_TRGFLXI_'//trim(cDet), 'Back Target Incident Flux', & targptr%id, 'kW/m^2') call ssaddtoheader (ssdeviceinfo, n_ssdevice, 'B_TRGFLXT_'//trim(cDet), 'Back Target Net Flux', & @@ -363,7 +362,7 @@ subroutine output_spreadsheet_masses (time) roomptr%id,'kg') call ssaddtoheader (ssmassinfo, n_ssmass, 'ULMTS_'//trim(cRoom), 'Trace Species Upper Layer Mass', & roomptr%id,'kg') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssmassinfo, n_ssmass, 'ULMF_'//trim(cRoom), 'Fuel Upper Layer Mass', roomptr%id, 'mole') call ssaddtoheader (ssmassinfo, n_ssmass, 'ULPQ_'//trim(cRoom), 'Potential Total Heat Upper Layer', & roomptr%id, 'J') @@ -402,7 +401,7 @@ subroutine output_spreadsheet_masses (time) roomptr%id, 'kg') call ssaddtoheader (ssmassinfo, n_ssmass, 'LLMTS_'//trim(cRoom), 'Trace Species Lower Layer Mass', & roomptr%id,'kg') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssmassinfo, n_ssmass, 'LLMF_'//trim(cRoom), 'Fuel Lower Layer Mass', roomptr%id, 'mole') call ssaddtoheader (ssmassinfo, n_ssmass, 'LLPQ_'//trim(cRoom), 'Potential Total Heat Lower Layer', & roomptr%id, 'J') @@ -500,7 +499,7 @@ subroutine output_spreadsheet_vents (time) 'Net Inflow',ventptr%id,'kg/s') call ssaddtoheader (ssventinfo, n_ssvent,'WF_'//trim(cito)//'_'//trim(cifrom)//'_'//trim(cvent), & 'Opening Fraction',ventptr%id,'') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssventinfo, n_ssvent,'WT_'//trim(cifrom)//'_u_inflow'//'_'//trim(cvent), & 'Total Inflow Upper',ventptr%id,'kg/s') call ssaddtoheader (ssventinfo, n_ssvent,'WT_'//trim(cifrom)//'_u_outflow'//'_'//trim(cvent), & @@ -534,7 +533,7 @@ subroutine output_spreadsheet_vents (time) 'Net Inflow',ventptr%id,'kg/s') call ssaddtoheader (ssventinfo, n_ssvent,'CFF_'//trim(cito)//'_'//trim(cifrom)//'_'//trim(cvent), & 'Opening Fraction',ventptr%id,'') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssventinfo, n_ssvent,'CFT_'//trim(cifrom)//'_u_inflow'//'_'//trim(cvent), & 'Total Inflow Upper',ventptr%id,'kg/s') call ssaddtoheader (ssventinfo, n_ssvent,'CFT_'//trim(cifrom)//'_u_outflow'//'_'//trim(cvent), & @@ -572,7 +571,7 @@ subroutine output_spreadsheet_vents (time) 'Trace Species Filtered',ventptr%id,'kg') call ssaddtoheader (ssventinfo, n_ssvent,'MF_'//trim(cito)//'_'//trim(cifrom)//'_'//trim(cvent), & 'Opening Fraction',ventptr%id,'') - if (validation_flag) then + if (validation_output) then call ssaddtoheader (ssventinfo, n_ssvent,'MT_'//trim(cifrom)//'_u_inflow'//'_'//trim(cvent), & 'Total Inflow Upper',ventptr%id,'kg/s') call ssaddtoheader (ssventinfo, n_ssvent,'MT_'//trim(cifrom)//'_u_outflow'//'_'//trim(cvent), & @@ -811,7 +810,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,n2) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,n2) end if @@ -826,7 +825,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,o2) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,o2) end if @@ -841,7 +840,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,co2) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,co2) end if @@ -856,7 +855,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,co) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,co) end if @@ -871,7 +870,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,hcn) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,hcn) end if @@ -886,7 +885,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,hcl) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,hcl) end if @@ -902,7 +901,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,fuel) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,fuel) end if @@ -917,7 +916,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,h2o) - if (validation_flag) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction + if (validation_output) ssvalue = ssvalue*0.01_eb ! converts molar % to molar fraction else ssvalue = roomptr%species_mass(layer,h2o) end if @@ -933,7 +932,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,soot) - if (validation_flag) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 + if (validation_output) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 else ssvalue = roomptr%species_mass(layer,soot) end if @@ -949,7 +948,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,soot_flaming) - if (validation_flag) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 + if (validation_output) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 else ssvalue = roomptr%species_mass(layer,soot_flaming) end if @@ -965,7 +964,7 @@ subroutine ssaddvaluetooutput (ssptr, time, position, outarray) if (roomptr%id==device) then if (index(measurement,'Mass')==0) then ssvalue = roomptr%species_output(layer,soot_smolder) - if (validation_flag) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 + if (validation_output) ssvalue = ssvalue*264.6903_eb ! converts converts od to mg/m^3 else ssvalue = roomptr%species_mass(layer,soot_smolder) end if @@ -1598,7 +1597,7 @@ subroutine ssprintresults (iounit, ic, array) if (ic>0) then out = ' ' do i = 1, ic - if (validation_flag) then + if (validation_output) then write (out(i),"(e12.5)" ) array(i) else write (out(i),"(e12.5)" ) array(i) @@ -1775,285 +1774,4 @@ subroutine output_spreadsheet_diag (time) end subroutine output_spreadsheet_diag - !--------------------------output_spreadsheet_dump----------------------------------------------------------- - - subroutine output_spreadsheet_dump (name, errorcode, stime, total_steps) - - character(len=*), intent(in) :: name - integer, intent(in) :: errorcode, total_steps - real(eb) :: stime - - integer, parameter :: nr = 2, ipad = 5, nc = mx_dumps + ipad - real(eb) :: dumparray(nr, nc) - character(len=128) :: dumpcarray(nr, nc) - integer :: i, icount, 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 - mxcol = 0 - if (ss_out_interval>0 .and. n_dumps > 0 .and. errorcode == 0) then - icount = n_dumps - do i = 1, num_csvfiles - if (icount>0) then - call do_csvfile(nr, nc, dumparray, dumpcarray, ipad, i, icount, mxcol) - else - exit - end if - end do - else if (n_dumps > 0) then - do i = 1, n_dumps - dumpcarray(1, ipad + i) = trim(dumpinfo(i)%id) - end do - end if - call writecsvformat(iofilcalc, dumparray, dumpcarray, nr, nc, 1, 2, mxcol) - - end subroutine output_spreadsheet_dump - - !--------------------do_csvfile--------------------------------------- - - subroutine do_csvfile(nr, nc, dumparray, dumpcarray, ipad, idx, icount, mxcol) - - integer, intent(in) :: nr, nc, idx, ipad - integer, intent(inout) :: mxcol, icount - real(eb), intent(inout) :: dumparray(nr, nc) - character(len=*), intent(inout) :: dumpcarray(nr, nc) - - integer :: i - type(dump_type), pointer :: dumpptr - logical :: first, lend - - integer, parameter :: numr = 3, numc = 32000 - real(eb) :: lastval(2, mx_dumps), lasttime(mx_dumps), x(numr, numc) - character(len=128) :: header(numr, numc), c(numr, numc) - - integer :: relcol, mxhr, mxhc, ic, cols(mx_dumps), icol, num_entries - integer :: primecol(mx_dumps), seccol(2, mx_dumps), mxr, mxc - real(eb) :: dummy(2, mx_dumps) - - lastval = 0.0_eb - lasttime = 0.0_eb - x = 0.0_eb - header = ' ' - c = ' ' - cols = 0 - primecol = 0 - seccol = 0 - dummy = 0.0_eb - - first = .true. - num_entries = 0 - icol = 0 - do i = 1, n_dumps - if (icount>0) then - dumpptr => dumpinfo(i) - dumpptr%found = .false. - if (dumpptr%file==csvnames(idx)) then - num_entries = num_entries + 1 - relcol = dumpptr%relative_column + ipad - icount = icount - 1 - icol = icol + 1 - cols(icol) = i - mxcol = max(mxcol, relcol) - dumpcarray(1,relcol) = dumpptr%id - if (first) then - rewind(iocsv(idx)) - call readcsvformat(iocsv(idx), x, header, numr, numc, 2, 3, mxhr, mxhc, lend) - first = .false. - if (lend) then - return - end if - end if - call fnd_col(ic, header, numr, numc, mxhr, mxhc, dumpptr%first_field(1), dumpptr%first_field(2)) - primecol(cols(icol)) = ic - if (ic>0) then - dumpptr%found = .true. - end if - if ((dumpptr%type(1:8) == 'TRIGGER_' .or. & - dumpptr%type(1:9) == 'INTEGRATE').and.dumpptr%found) then - call fnd_col(ic, header, numr, numc, mxhr, mxhc, dumpptr%second_field(1), & - dumpptr%second_field(2)) - seccol(1,cols(icol)) = ic - if (ic<1) then - dumpptr%found = .false. - end if - else if (dumpptr%type(1:15) == 'CHECK_TOTAL_HRR'.and.dumpptr%found) then - call fnd_col(ic, header, numr, numc, mxhr, mxhc, dumpptr%second_field(1), & - dumpptr%second_field(2)) - seccol(1,cols(icol)) = ic - if (ic<1) then - dumpptr%found = .false. - end if - call fnd_col(ic, header, numr, numc, mxhr, mxhc, dumpptr%second_field(1), & - 'HRR Expected') - seccol(2,cols(icol)) = ic - if (ic<1) then - dumpptr%found = .false. - end if - end if - end if - end if - end do - - call readcsvformat(iocsv(idx), x, c, numr, numc, 2, 2, mxr, mxc, lend) - if (.not.lend) then - do i = 1, icol - dumpptr => dumpinfo(cols(i)) - if (dumpptr%found) then - relcol = dumpptr%relative_column + ipad - if (dumpptr%type(1:1) == 'M') then - dumparray(2,relcol) = x(1, primecol(cols(i))) - else if (dumpptr%type(1:8) == 'TRIGGER_') then - dumparray(2,relcol) = -1 - else if (dumpptr%type(1:9) == 'INTEGRATE') then - dumparray(2,relcol) = -1 - lasttime(i) = x(1, primecol(cols(i))) - lastval(1,i) = x(1, seccol(1,cols(i))) - else if (dumpptr%type(1:15) == 'CHECK_TOTAL_HRR') then - dumparray(2,relcol) = -1 - dummy(1:2,i) = 0 - lasttime(i) = x(1, primecol(cols(i))) - lastval(1:2,i) = x(1, seccol(1:2,cols(i))) - else - dumparray(2,relcol) = -1001 - end if - end if - end do - else - return - end if - - do while (.not.lend) - call readcsvformat(iocsv(idx), x, c, numr, numc, 1, 1, mxr, mxc, lend) - if (.not.lend) then - do i = 1, icol - dumpptr => dumpinfo(cols(i)) - if (dumpptr%found) then - relcol = dumpptr%relative_column + ipad - if (dumpptr%type(1:3) == 'MAX') then - dumparray(2,relcol) = max(dumparray(2,relcol),x(1, primecol(cols(i)))) - else if (dumpptr%type(1:3) == 'MIN') then - dumparray(2,relcol) = min(dumparray(2,relcol),x(1, primecol(cols(i)))) - else if (dumpptr%type(1:15) == 'TRIGGER_GREATER') then - if (x(1, seccol(1,cols(i)))>=dumpptr%criterion.and.dumparray(2,relcol)== -1) then - dumparray(2,relcol) = x(1, primecol(cols(i))) - end if - else if (dumpptr%type(1:14) == 'TRIGGER_LESSER') then - if (x(1, seccol(1,i))<=dumpptr%criterion.and.dumparray(2,relcol)== -1) then - dumparray(2,relcol) = x(1, primecol(cols(i))) - end if - else if (dumpptr%type(1:9) == 'INTEGRATE') then - dumparray(2,relcol) = dumparray(2,relcol) + & - (x(1, seccol(1,cols(i)))+lastval(1,i))/2*(x(1, primecol(cols(i)))-lasttime(i)) - lasttime(i) = x(1, primecol(cols(i))) - lastval(1,i) = x(1, seccol(1,cols(i))) - else if (dumpptr%type(1:15) == 'CHECK_TOTAL_HRR') then - dummy(1:2,i) = dummy(1:2,i) + & - (x(1, seccol(1:2,cols(i)))+lastval(1:2,i))/2*(x(1, primecol(cols(i)))-lasttime(i)) - if (dummy(2,i)>0) then - dumparray(2,relcol) = dummy(1,i)/dummy(2,i)*100.0 - end if - lasttime(i) = x(1, primecol(cols(i))) - lastval(1:2,i) = x(1, seccol(1:2,cols(i))) - else - dumparray(2,relcol) = -1001 - end if - end if - end do - end if - end do - - end subroutine do_csvfile - - !-----------------------------fnd_col(ic, c, nr, nc, mxr, mxc, instrument, measurement)----------------------------------- - - subroutine fnd_col(ic, c, nr, nc, mxr, mxc, instrument, measurement) - - integer, intent(out) :: ic - integer, intent(in) :: nr, nc, mxr, mxc - character(len=*), intent(in) :: c(nr, nc), instrument, measurement - - ! note that we read in the headers ignoring the first row (short names) so the row below are one less that the actual row - integer, parameter :: instrumentRow = 2, measurementRow = 1, timeColumn = 1 - integer :: i - - ic = -1 - if (trim(instrument)=='Time') then - ic = timeColumn - return - end if - - if (mxr < 2) then - write(errormessage,*)'Error, need at least two rows to use fnd_col mxr = ',mxr - !call cfastexit('fnd_col',1) - stop - end if - do i = 1, mxc - if (trim(instrument) == trim(c(instrumentRow,i))) then - if (trim(measurement) == trim(c(measurementRow,i))) then - ic = i - return - end if - end if - end do - - end subroutine fnd_col - - - ! --------------------------- writecsvformat ------------------------------------------- - - subroutine writecsvformat (iunit, x, c, nr, nc, nstart, mxr, mxc) - - ! routine: writecsvformat - ! purpose:writess a comma-delimited file as generated by Micorsoft Excel, assuming that all - ! the data is in the form of real numbers - ! arguments: iunit = logical unit, already open to .csv file - ! x = array of dimension (numr,numc) for values in spreadsheet - ! c = character array of same dimenaion as x for character values in spreadsheet - ! nr = # of rows of arrays x and c - ! nc = # of columns of arrays x and c - ! nstart = starting row of spreadsheet to read - ! mxr = actual number of rows read - ! mxc = actual number of columns read - - integer, intent(in) :: iunit, nr, nc, nstart, mxr, mxc - - real(eb), intent(in) :: x(nr,nc) - character(len=*), intent(inout) :: c(nr,nc) - - character(len=204800) :: buf - integer :: i, j, ic, ie - - do i = nstart, mxr - buf = ' ' - ic = 1 - do j = 1, mxc - if (x(i,j) /= 0.0) then - write(c(i,j),'(e16.9)') x(i,j) - end if - ie = ic + len_trim(c(i,j)) - buf(ic:ie) = trim(c(i,j)) - ic = ie+1 - buf(ic:ic) = ',' - ic = ic+1 - end do - write(iunit,'(A)') buf(1:ic) - end do - - end subroutine writecsvformat - end module spreadsheet_routines diff --git a/Source/CFAST/solve.f90 b/Source/CFAST/solve.f90 index 00d5492fc..2496e9a35 100644 --- a/Source/CFAST/solve.f90 +++ b/Source/CFAST/solve.f90 @@ -220,7 +220,6 @@ subroutine solve_simulation (tstop) ! is presently used by DASSL. The important point is that N_ODES is set to ! NOFPRD - external post_process real(eb), intent(in) :: tstop integer, parameter :: maxord = 5 @@ -548,7 +547,6 @@ subroutine solve_simulation (tstop) call write_error_component (ieqmax) write (*,'(a,i0)') '***Error, dassl - idid = ', idid write (iofill,'(a,i0)') '***Error, dassl - idid = ', idid - call post_process stop end if @@ -629,7 +627,6 @@ subroutine solve_simulation (tstop) write (*,'(a,f10.5,1x,a,f10.5)') '***Error, Problem in DASSL backing from ',t,'to time ',tdout write (iofill,'(a,i0)') '***Error, dassl - idid = ', idid write (iofill,'(a,f10.5,1x,a,f10.5)') '***Error, Problem in DASSL backing from ',t,'to time ',tdout - call post_process write (errormessage,'(a)') '***Error, Equation solver could not find a solution.' call cfastexit ('solve_simulation', 3) stop diff --git a/Source/CFAST/ssHeaders.f90 b/Source/CFAST/ssHeaders.f90 index f55c79ec2..f15401a05 100644 --- a/Source/CFAST/ssHeaders.f90 +++ b/Source/CFAST/ssHeaders.f90 @@ -13,7 +13,7 @@ module spreadsheet_header_routines use diag_data, only: ioresid, ioslab use fire_data, only: n_fires, fireinfo, fire_type use room_data, only: n_rooms, roominfo, room_type - use setup_data, only: validation_flag, iofilsmvzone, iofilsmv, iofilssdiag + use setup_data, only: validation_output, iofilsmvzone, iofilsmv, iofilssdiag use vent_data, only: n_hvents, hventinfo, n_vvents, vventinfo, n_mvents, mventinfo, n_leaks, leakinfo implicit none diff --git a/Source/CFAST/utilities.f90 b/Source/CFAST/utilities.f90 index 297917331..b7c11b79c 100644 --- a/Source/CFAST/utilities.f90 +++ b/Source/CFAST/utilities.f90 @@ -6,8 +6,8 @@ module utility_routines use cparams, only: lbufln, mxss use room_data, only: nwpts, slab_splits, iwbound - use setup_data, only: ncol, iofill, rundat, nokbd, initializeonly, debugging, validation_flag, outputformat, & - netheatflux, ssoutoptions, errormessage, listoutput + use setup_data, only: ncol, iofill, rundat, nokbd, initializeonly, debugging, validation_output, outputformat, & + net_heat_flux_output, ssoutoptions, errormessage, listoutput implicit none @@ -520,8 +520,8 @@ subroutine read_command_options if (cmdflag('L',iopt)/=0) listoutput = .true. if (cmdflag('I',iopt)/=0) initializeonly = .true. if (cmdflag('D',iopt)/=0) debugging = .true. - if (cmdflag('V',iopt)/=0) validation_flag = .true. - if (cmdflag('N',iopt)/=0) netheatflux = .true. + if (cmdflag('V',iopt)/=0) validation_output = .true. + if (cmdflag('N',iopt)/=0) net_heat_flux_output = .true. if (cmdflag('O',iopt)/=0) then ssoutoptions = 0 ssselected(1:26) = trim(strs(cmdflag('O',iopt)))