From 1a78609e0f4a7dfa9bb32be6499806b52a1c10b4 Mon Sep 17 00:00:00 2001 From: Benjamin Tessore Date: Tue, 14 Nov 2023 12:29:45 +0100 Subject: [PATCH 1/2] Bug fix --- src/dust_prop.f90 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/dust_prop.f90 b/src/dust_prop.f90 index eb53e1bbb..68305713e 100644 --- a/src/dust_prop.f90 +++ b/src/dust_prop.f90 @@ -1065,6 +1065,19 @@ subroutine calc_local_scattering_matrices(lambda, p_lambda) 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) & @@ -1207,6 +1220,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 From 1098892a3ec9d07962b16c0830a3db8eb5901ef5 Mon Sep 17 00:00:00 2001 From: Benjamin Tessore Date: Tue, 14 Nov 2023 13:29:59 +0100 Subject: [PATCH 2/2] Bug fix --- src/dust_prop.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dust_prop.f90 b/src/dust_prop.f90 index 68305713e..87791ce5d 100644 --- a/src/dust_prop.f90 +++ b/src/dust_prop.f90 @@ -1062,6 +1062,7 @@ 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