Skip to content

Commit

Permalink
Bug fix: stellar balck-bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinte committed Jun 13, 2024
1 parent 1fa8a38 commit e0cd616
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/init_mcfost.f90
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ subroutine set_default_variables()
loverwrite_s12 = .false.
lnot_random_Voronoi = .false.
lignore_sink=.false.
lstar_bb = .false.

tmp_dir = "./"

Expand Down Expand Up @@ -244,7 +245,7 @@ subroutine get_mcfost_utils_dir()

integer :: i, n_dir

! Test if MCFOST_UTILS is defined
! Test if MCFOST_UTILS is defined
call get_environment_variable('MCFOST_UTILS',mcfost_utils)
if (mcfost_utils == "") call error("environnement variable MCFOST_UTILS is not defined.")
call get_environment_variable('MY_MCFOST_UTILS',my_mcfost_utils)
Expand Down Expand Up @@ -291,7 +292,7 @@ subroutine initialisation_mcfost()
character(len=4) :: n_chiffres
character(len=128) :: fmt1, fargo3d_dir, fargo3d_id, athena_file, idefix_file, pluto_dir, pluto_id

logical :: lresol, lMC_bins, lPA, lzoom, lmc, lHG, lonly_scatt, lupdate, lno_T, lno_SED, lpola, lstar_bb, lold_PA
logical :: lresol, lMC_bins, lPA, lzoom, lmc, lHG, lonly_scatt, lupdate, lno_T, lno_SED, lpola, lold_PA

real :: nphot_img = 0.0, n_rad_opt = 0, nz_opt = 0, n_T_opt = 0

Expand All @@ -316,7 +317,6 @@ subroutine initialisation_mcfost()
lno_T = .false.
lno_SED = .false.
lpola = .false.
lstar_bb = .false.
star_force_Mdot(:) = .false.
star_Mdot(:) = 0.0
lold_PA = .false.
Expand Down
2 changes: 2 additions & 0 deletions src/parameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ module parametres

integer :: n_etoiles
type(star_type), dimension(:), allocatable :: etoile
logical :: lstar_bb


! Spot
real :: T_spot, surf_fraction_spot, theta_spot, phi_spot
Expand Down
5 changes: 4 additions & 1 deletion src/stars.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1269,7 +1269,7 @@ subroutine compute_stellar_parameters()

! Pas de fUV et pas de spectre stellaire pour le moment
etoile(i)%fUV = 0.0 ; etoile(i)%slope_UV = 0.0 ;
!etoile(i)%lb_body = .false. ! We do not update anymore as it is an command line option
etoile(i)%lb_body = .false. ! Not a bb by default
etoile(i)%spectre = "None"

write(*,*) "Star #",i," Teff=", etoile(i)%T, "K, r=", real(etoile(i)%r), "Rsun"
Expand All @@ -1278,6 +1278,9 @@ subroutine compute_stellar_parameters()
! Passage rayon en AU
etoile(:)%r = etoile(:)%r * Rsun_to_AU

! We force again a black-body if needed
if (lstar_bb) etoile(:)%lb_body = .true.

return

end subroutine compute_stellar_parameters
Expand Down

0 comments on commit e0cd616

Please sign in to comment.