Skip to content

Commit

Permalink
Merge pull request #84 from cpinte/fix_dustprop
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
cpinte authored Nov 14, 2023
2 parents 3338318 + 1098892 commit 4801891
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/dust_prop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,23 @@ subroutine calc_local_scattering_matrices(lambda, p_lambda)
real :: mu, g, g2

integer :: icell, k, l
logical :: ldens0

fact = AU_to_cm * mum_to_cm**2
!write(*,*) "Computing local scattering properties", lambda, p_lambda

! see opacite()
! Attention : dans le cas no_strat, il ne faut pas que la cellule (1,1,1) soit vide.
! on la met à nbre_grains et on effacera apres
! c'est pour les prop de diffusion en relatif donc la veleur exacte n'a pas d'importante
ldens0 = .false.
if (.not.lvariable_dust) then
icell = icell_ref
if (maxval(densite_pouss(:,icell)) < tiny_real) then
ldens0 = .true.
densite_pouss(:,icell) = densite_pouss(:,icell_not_empty)
endif
endif

!$omp parallel &
!$omp default(none) &
Expand Down Expand Up @@ -1208,6 +1222,13 @@ subroutine calc_local_scattering_matrices(lambda, p_lambda)
!$omp enddo
!$omp end parallel

! see opacite()
! On remet la densite à zéro si besoin
if (ldens0) then
icell = icell_ref
densite_pouss(:,icell) = 0.0_sp
endif

return

end subroutine calc_local_scattering_matrices
Expand Down

0 comments on commit 4801891

Please sign in to comment.