Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/shock' into test-suite-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Nov 27, 2023
2 parents 5e360d5 + b17a283 commit 8c0857f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/setup/setup_shock.F90
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ subroutine choose_shock (gamma,polyk,dtg,iexist)
use physcon, only:pi,Rg,au,solarm
use prompting, only:prompt
use units, only:udist,utime,unit_density,unit_pressure
use setunits, only:set_units_interactive
real, intent(inout) :: gamma,polyk
real, intent(out) :: dtg
logical, intent(in) :: iexist
Expand Down Expand Up @@ -436,6 +437,9 @@ subroutine choose_shock (gamma,polyk,dtg,iexist)
yright = 0.0
zright = 0.0
const = sqrt(4.*pi)

if (do_radiation) call set_units_interactive(gr)

!
!--list of shocks
!
Expand Down Expand Up @@ -678,7 +682,9 @@ end function get_conserved_density
!------------------------------------------
subroutine write_setupfile(filename,iprint,numstates,gamma,polyk,dtg)
use infile_utils, only:write_inopt
use dim, only:tagline
use dim, only:tagline,do_radiation
use setunits, only:write_options_units
use part, only:gr
integer, intent(in) :: iprint,numstates
real, intent(in) :: gamma,polyk,dtg
character(len=*), intent(in) :: filename
Expand All @@ -690,6 +696,8 @@ subroutine write_setupfile(filename,iprint,numstates,gamma,polyk,dtg)
write(lu,"(a)") '# '//trim(tagline)
write(lu,"(a)") '# input file for Phantom shock tube setup'

if (do_radiation) call write_options_units(lu,gr)

write(lu,"(/,a)") '# shock tube'
do i=1,numstates
call write_inopt(leftstate(i), trim(var_label(i))//'left', trim(var_label(i))//' (left)', lu,ierr1)
Expand Down Expand Up @@ -754,6 +762,9 @@ end subroutine write_setupfile
!------------------------------------------
subroutine read_setupfile(filename,iprint,numstates,gamma,polyk,dtg,ierr)
use infile_utils, only:open_db_from_file,inopts,close_db,read_inopt
use setunits, only:read_options_and_set_units
use part, only:gr
use dim, only:do_radiation
character(len=*), intent(in) :: filename
integer, parameter :: lu = 21
integer, intent(in) :: iprint,numstates
Expand All @@ -767,6 +778,10 @@ subroutine read_setupfile(filename,iprint,numstates,gamma,polyk,dtg,ierr)
write(iprint, '(1x,2a)') 'Setup_shock: Reading setup options from ',trim(filename)

nerr = 0

! units
if (do_radiation) call read_options_and_set_units(db,nerr,gr)

do i=1,numstates
call read_inopt(leftstate(i), trim(var_label(i))//'left',db,errcount=nerr)
call read_inopt(rightstate(i),trim(var_label(i))//'right',db,errcount=nerr)
Expand Down

0 comments on commit 8c0857f

Please sign in to comment.