Skip to content

Commit f9b4002

Browse files
authored
added multiline output keyword support; propogated ions into product mixture through legacy cli (#52)
1 parent c761787 commit f9b4002

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

source/input.f90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ subroutine read_problem(fin, problem, ierr)
250250
line = adjustl(line)
251251
if (is_empty(line)) cycle
252252
if (is_keyword(line)) then
253+
if (dsname == 'outp' .and. line(1:4) == 'outp') then
254+
! Legacy behavior allows repeated output datasets; merge them.
255+
buffer = buffer // ' ' // trim(line)
256+
cycle
257+
end if
253258
backspace(fin)
254259
exit
255260
else

source/input_test.pf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,19 @@ contains
120120
return
121121
end subroutine
122122

123+
@test
124+
subroutine test_parse_outp_repeated_dataset_keywords
125+
type(OutputDataset) :: outp
126+
127+
outp = parse_outp('outp short outp massf outp siunits outp trace=1e-8 outp transport')
128+
129+
@assertEqual(.true., outp%mass_fractions)
130+
@assertEqual(.true., outp%transport)
131+
@assertTrue(allocated(outp%trace))
132+
@assertEqual(1.0d-8, outp%trace)
133+
@assertEqual(.true., outp%siunit)
134+
end subroutine
135+
123136
@test
124137
subroutine test_parse_reac_custom_species
125138
type(ReactantInput), allocatable :: reac(:)

source/main.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ subroutine run_thermo_problem(prob, thermo, solver, solutions, partials)
266266
else
267267
product_names = reactants%get_products(thermo)
268268
end if
269-
products = Mixture(thermo, product_names)
269+
products = Mixture(thermo, product_names, ions=prob%problem%include_ions)
270270

271271
! Get the loop sizes
272272
num_state1 = 1
@@ -535,7 +535,7 @@ subroutine run_shock_problem(prob, thermo, solver, solutions)
535535
else
536536
product_names = reactants%get_products(thermo)
537537
end if
538-
products = Mixture(thermo, product_names)
538+
products = Mixture(thermo, product_names, ions=prob%problem%include_ions)
539539

540540
! Get the problem flags
541541
if (prob%problem%shk_incident) then
@@ -767,7 +767,7 @@ subroutine run_detonation_problem(prob, thermo, solver, solutions)
767767
else
768768
product_names = reactants%get_products(thermo)
769769
end if
770-
products = Mixture(thermo, product_names)
770+
products = Mixture(thermo, product_names, ions=prob%problem%include_ions)
771771

772772
! Get the problem flags
773773
if (prob%problem%frozen) then

0 commit comments

Comments
 (0)