Skip to content

Commit d36e11a

Browse files
committed
Use integer index instead of pointer to avoid ifort OpenMP issues
1 parent 5b94005 commit d36e11a

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/dust_prop.f90

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,14 +1063,7 @@ subroutine calc_local_scattering_matrices(lambda, p_lambda)
10631063
!$omp shared(zmax,kappa,kappa_abs_LTE,ksca_CDF,p_n_cells,fact,lvariable_dust,nbre_grains) &
10641064
!$omp shared(C_ext,C_sca,dust_density,S_grain,scattering_method,tab_g_pos,aniso_method,tab_g,lisotropic,low_mem_scattering) &
10651065
!$omp shared(lscatt_ray_tracing,letape_th,lsepar_pola,ldust_prop,lphase_function_file,s11_file,loverwrite_s12,Pmax) &
1066-
!$omp private(icell,k,k1,p_k,density,norme,theta,k_sca_tot,mu,g,g2,d1)
1067-
1068-
if (lvariable_dust) then
1069-
p_k => k
1070-
else
1071-
k1 = 1
1072-
p_k => k1
1073-
endif
1066+
!$omp private(icell,k,p_k,density,norme,theta,k_sca_tot,mu,g,g2,d1)
10741067

10751068
!$omp do schedule(dynamic,1)
10761069
do icell=1, p_n_cells
@@ -1086,6 +1079,8 @@ subroutine calc_local_scattering_matrices(lambda, p_lambda)
10861079
endif
10871080

10881081
do k=1,n_grains_tot
1082+
! Use integer index instead of pointer to avoid ifort OpenMP issues
1083+
p_k = merge(k, 1, lvariable_dust)
10891084
density=dust_density(p_k,icell) * nbre_grains(k)
10901085
if (aniso_method==1) then
10911086
! Moyennage matrice de mueller (long en cpu ) (le dernier indice est l'angle)

0 commit comments

Comments
 (0)