Skip to content

Commit

Permalink
(eos-gasradrec) fix error on irecomb value upon initialisation
Browse files Browse the repository at this point in the history
  • Loading branch information
themikelau committed Mar 12, 2022
1 parent f2c693e commit 0579ed5
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/main/eos_gasradrec.f90
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ subroutine init_eos_gasradrec(ierr)
eion(1:2) = 0. ! He recombination only
elseif (irecomb == 3) then
eion(1:4) = 0. ! No recombination energy
else
elseif (irecomb < 0 .or. irecomb > 3) then
ierr = 1
endif
write(*,'(1x,a,i1,a)') 'Initialising gas+rad+rec EoS (irecomb = ',irecomb,')'
Expand Down Expand Up @@ -177,7 +177,7 @@ subroutine read_options_eos_gasradrec(name,valstring,imatch,igotall,ierr)
select case(trim(name))
case('irecomb')
read(valstring,*,iostat=ierr) irecomb
if ((irecomb < 0) .or. (irecomb > 2)) call fatal(label,'irecomb = 0,1,2')
if ((irecomb < 0) .or. (irecomb > 3)) call fatal(label,'irecomb = 0,1,2,3')
ngot = ngot + 1
case default
imatch = .false.
Expand All @@ -197,7 +197,7 @@ subroutine write_options_eos_gasradrec(iunit)
use infile_utils, only:write_inopt
integer, intent(in) :: iunit

call write_inopt(irecomb,'irecomb','recombination energy to include. 0=H2+H+He, 1=H+He, 2=He',iunit)
call write_inopt(irecomb,'irecomb','recombination energy to include. 0=H2+H+He, 1=H+He, 2=He, 3=none',iunit)

end subroutine write_options_eos_gasradrec

Expand Down
27 changes: 15 additions & 12 deletions src/setup/setup_star.f90
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,10 @@ end subroutine setpart
!+
!-----------------------------------------------------------------------
subroutine setup_interactive(polyk,gamma,iexist,id,master,ierr)
use prompting, only:prompt
use units, only:select_unit
use eos, only:X_in,Z_in,gmw,irecomb
use prompting, only:prompt
use units, only:select_unit
use eos, only:X_in,Z_in,gmw
use eos_gasradrec, only:irecomb
real, intent(out) :: polyk,gamma
logical, intent(in) :: iexist
integer, intent(in) :: id,master
Expand Down Expand Up @@ -722,10 +723,11 @@ end subroutine write_mass
!+
!-----------------------------------------------------------------------
subroutine write_setupfile(filename,gamma,polyk)
use infile_utils, only:write_inopt,get_optstring
use dim, only:tagline
use relaxstar, only:write_options_relax
use eos, only:X_in,Z_in,gmw,irecomb
use infile_utils, only:write_inopt,get_optstring
use dim, only:tagline
use relaxstar, only:write_options_relax
use eos, only:X_in,Z_in,gmw
use eos_gasradrec, only:irecomb
real, intent(in) :: gamma,polyk
character(len=*), intent(in) :: filename
integer, parameter :: iunit = 20
Expand Down Expand Up @@ -828,11 +830,12 @@ end subroutine write_setupfile
!+
!-----------------------------------------------------------------------
subroutine read_setupfile(filename,gamma,polyk,ierr)
use infile_utils, only:open_db_from_file,inopts,close_db,read_inopt
use io, only:error
use units, only:select_unit
use relaxstar, only:read_options_relax
use eos, only:X_in,Z_in,gmw,irecomb
use infile_utils, only:open_db_from_file,inopts,close_db,read_inopt
use io, only:error
use units, only:select_unit
use relaxstar, only:read_options_relax
use eos, only:X_in,Z_in,gmw
use eos_gasradrec, only:irecomb
character(len=*), intent(in) :: filename
integer, parameter :: lu = 21
integer, intent(out) :: ierr
Expand Down
3 changes: 2 additions & 1 deletion src/utils/analysis_common_envelope.F90
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ module analysis
use energies, only:compute_energies,ekin,etherm,epot,etot
use ptmass, only:get_accel_sink_gas,get_accel_sink_sink
use kernel, only:kernel_softening,radkern,wkern,cnormk
use eos, only:equationofstate,ieos,init_eos,finish_eos,X_in,Z_in,gmw,get_spsound,irecomb
use eos, only:equationofstate,ieos,init_eos,finish_eos,X_in,Z_in,gmw,get_spsound
use eos_gasradrec,only:irecomb
use eos_mesa, only:get_eos_kappa_mesa,get_eos_pressure_temp_mesa,&
get_eos_various_mesa,get_eos_pressure_temp_gamma1_mesa
use setbinary, only:Rochelobe_estimate,L1_point
Expand Down
11 changes: 6 additions & 5 deletions src/utils/moddump_recalcuT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ module moddump
contains

subroutine modify_dump(npart,npartoftype,massoftype,xyzh,vxyzu)
use eos, only:equationofstate,ieos,init_eos,done_init_eos,calc_temp_and_ene,finish_eos,&
gmw,X_in,Z_in,irecomb,gamma,eosinfo
use io, only:iprint
use part, only:rhoh,eos_vars,itemp,igasP,igas,store_temperature
use units, only:unit_density,unit_pressure,unit_ergg
use eos, only:equationofstate,ieos,init_eos,done_init_eos,calc_temp_and_ene,&
finish_eos,gmw,X_in,Z_in,gamma,eosinfo
use eos_gasradrec, only:irecomb
use io, only:iprint
use part, only:rhoh,eos_vars,itemp,igasP,igas,store_temperature
use units, only:unit_density,unit_pressure,unit_ergg
integer, intent(inout) :: npart
integer, intent(inout) :: npartoftype(:)
real, intent(inout) :: massoftype(:)
Expand Down

0 comments on commit 0579ed5

Please sign in to comment.