Skip to content

Commit

Permalink
Removing unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinte committed Dec 11, 2024
1 parent 96d8f60 commit a0892a2
Show file tree
Hide file tree
Showing 27 changed files with 144 additions and 170 deletions.
5 changes: 2 additions & 3 deletions src/ML_prodimo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ subroutine save_J_ML(lambda, lISM)
! avant et apres le calcul du champ ISM

use dust_ray_tracing, only : n_phot_envoyes
use radiation_field, only : xJ_abs, xN_abs
use radiation_field, only : xJ_abs
use prodimo, only : chi_ISM, R_ISM, T_ISM_stars, Wdil, Tcmb
use parametres, only : Rmax
use temperature, only : E_disk
use cylindrical_grid, only : volume
use wavelengths, only : tab_lambda
Expand Down Expand Up @@ -151,7 +150,7 @@ subroutine xgb_compute_features()
use optical_depth, only : compute_column
use density, only : densite_pouss
use cylindrical_grid, only : r_grid, z_grid
use molecular_emission, only : densite_gaz, Tcin
use molecular_emission, only : densite_gaz
use temperature, only : Tdust
use Voronoi_grid, only : Voronoi

Expand Down
4 changes: 2 additions & 2 deletions src/SPH2mcfost.f90
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ subroutine SPH_to_Voronoi(n_SPH, ndusttypes, particle_id, x,y,z,h, vx,vy,vz, T_g

real, allocatable, dimension(:) :: a_SPH, log_a_SPH, rho_dust
real(dp), allocatable, dimension(:) :: gsize, grainsize_f, dN_ds, N_monomers, rho_monomers
real(dp), dimension(4) :: lambsol, lambguess
real(dp), dimension(4) :: lambsol

real(dp) :: mass, somme, Mtot, Mtot_dust, facteur, a, mass_factor
real(dp) :: mass, Mtot, Mtot_dust, facteur, a, mass_factor
real :: f, limit_threshold, density_factor
integer :: icell, l, k, iSPH, n_force_empty, i, id_n, ierr, N_pb

Expand Down
2 changes: 1 addition & 1 deletion src/benchmarks.f90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module benchmarks

subroutine init_Pascucci_benchmark()

character(len=32) :: filename = "Pascucci_optSi.dat"
!character(len=32) :: filename = "Pascucci_optSi.dat"

write(*,*) "------------------------------------------------"
write(*,*) "| Setting up the Pascucci et al 2004 benchmark |"
Expand Down
5 changes: 1 addition & 4 deletions src/diffusion.f90
Original file line number Diff line number Diff line change
Expand Up @@ -640,15 +640,12 @@ subroutine compute_Planck_opacities(icell, Planck_opacity,rec_Planck_opacity)
use wavelengths, only : n_lambda, tab_lambda, tab_delta_lambda
use Temperature, only : Tdust
use dust_prop, only : kappa
use Voronoi_grid, only : Voronoi
use cylindrical_grid, only : volume
use density, only : masse_gaz, densite_gaz

integer, intent(in) :: icell
real(dp), intent(out) :: Planck_opacity,rec_Planck_opacity ! cm2/g (ie per gram of gas)

integer :: lambda
real(dp) :: somme, somme2, cst, cst_wl, B, dB_dT, coeff_exp, wl, delta_wl, norm, T
real(dp) :: somme, somme2, cst, cst_wl, B, coeff_exp, wl, delta_wl, norm, T !dB_dT

integer, pointer :: p_icell
integer, target :: icell0
Expand Down
2 changes: 1 addition & 1 deletion src/disk_physics.f90
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ subroutine equilibre_hydrostatique()
implicit none

real, dimension(nz) :: rho, ln_rho
real :: dz, dz_m1, dTdz, fac, fac1, fac2, M_etoiles, M_mol, somme, cst
real :: dz, dz_m1, dTdz, fac1, fac2, M_etoiles, M_mol, somme, cst
integer :: i,j, k, icell, icell_m1

real, parameter :: gas_dust = 100
Expand Down
4 changes: 2 additions & 2 deletions src/dust_prop.f90
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ subroutine prop_grains(lambda)
implicit none

integer, intent(in) :: lambda
real :: a, wavel, x, qext, qsca, gsca, amu1, amu2, amu1_coat, amu2_coat, Cext, Csca
real :: a, wavel, x, qext, qsca, gsca, amu1, amu2, amu1_coat, amu2_coat
integer :: k, pop

qext=0.0
Expand Down Expand Up @@ -795,7 +795,7 @@ subroutine opacite(lambda, p_lambda, no_scatt)
integer, intent(in) :: lambda, p_lambda
logical, intent(in), optional :: no_scatt

integer :: icell, k, thetaj
integer :: icell, k
real(kind=dp) :: density, fact, k_abs_RE, k_abs_LTE, k_abs_tot, k_sca_tot, rho0
logical :: lcompute_obs, ldens0, compute_scatt

Expand Down
19 changes: 9 additions & 10 deletions src/gas/abo.f90
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ end function gammln
subroutine dealloc_barklem(barklem)
type(barklem_cross_data), intent(inout) :: barklem
deallocate(barklem%neff1, barklem%neff2, barklem%cross,barklem%alpha)
return
return
end subroutine dealloc_barklem


Expand Down Expand Up @@ -168,9 +168,8 @@ subroutine get_Barklem_cross_data(atom, kr, res)
real(kind=dp) :: neff1, neff2, nefftmp
real(kind=dp) :: findex1, findex2, mu, vmean, sqa0
real(kind=dp) :: cross, E_Rydberg2, deltaEi, deltaEj, expo
integer :: Li, Lj, i, j, Z, ic, k, index, index1
integer :: Li, Lj, i, j, Z, ic, index, index1
character(len=ATOM_LABEL_WIDTH) :: label_i, label_j
real(kind=dp) :: testcc

i = Atom%lines(kr)%i
j = Atom%lines(kr)%j
Expand Down Expand Up @@ -211,7 +210,7 @@ subroutine get_Barklem_cross_data(atom, kr, res)
write(*,*) "WARNING: Barklem, cannot parse label, using Unsold !"
res = .false.
return
endif
endif
!write(*,'("Si="(1F2.2)", Li="(1I2)", Ji="(1F2.2))') Si, Li, Ji
!write(*,'("Sj="(1F2.2)", Lj="(1I2)", Jj="(1F2.2))') Sj, Lj, Jj

Expand All @@ -227,7 +226,7 @@ subroutine get_Barklem_cross_data(atom, kr, res)
end if

if (.not. res ) then
write(*,*) "WARNING: Barklem, cannot get data, using Unsold !"
write(*,*) "WARNING: Barklem, cannot get data, using Unsold !"
return
endif
lread_from_table = .true.
Expand Down Expand Up @@ -262,7 +261,7 @@ subroutine get_Barklem_cross_data(atom, kr, res)
!write(*,*) neff2, bs%neff2(1), bs%neff2(bs%N2)
write(*,*) "neff outside domain, use Unsold"
res = .false.
return
return
end if

index = locate(bs%neff1,neff1)!minloc(abs(bs%neff1 - neff1), 1)
Expand Down Expand Up @@ -293,20 +292,20 @@ subroutine get_Barklem_cross_data(atom, kr, res)
atom%lines(kr)%cvdWaals(2) = &
bilinear(bs%N1,bs%neff1,index1,bs%N2,bs%neff2,index,bs%alpha,neff1,neff2)


endif !read from table

!comptue the actual cross-section with T factorised out.

cross = 2.0*sqa0 * (4.0/pi)**(0.5*atom%lines(kr)%cvdWaals(2)) * &
vmean * (vmean/vref)**(-atom%lines(kr)%cvdWaals(2))
vmean * (vmean/vref)**(-atom%lines(kr)%cvdWaals(2))

atom%lines(kr)%cvdWaals(1) = atom%lines(kr)%cvdWaals(1) * cross * &
atom%lines(kr)%cvdWaals(1) = atom%lines(kr)%cvdWaals(1) * cross * &
exp(gammln(2.0-0.5*atom%lines(kr)%cvdWaals(2)))

res = .true.
if (lread_from_table) call dealloc_barklem(bs)
return
end subroutine get_barklem_cross_data

end module abo
end module abo
24 changes: 12 additions & 12 deletions src/gas/atom_type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module atom_type
real(kind=dp) :: twohnu3_c2, gij
real(kind=dp) :: vmax, damp_max, damp_min !m/s
real :: qwing
real(kind=dp), allocatable, dimension(:) :: Rij, Rji, Cij, Cji
real(kind=dp), allocatable, dimension(:) :: Rij, Rji, Cij, Cji
real(kind=dp), dimension(4) :: cvdWaals
real(kind=dp), dimension(:), allocatable :: a
real(kind=dp), dimension(:,:,:,:,:), allocatable :: map !2d flux in the line
Expand All @@ -61,7 +61,7 @@ module atom_type
logical :: lany_gauss_prof
integer :: initial, nTrans_raytracing
!initial:
!0->LTE; 1->OLD_POPULATIONS; 2->ZERO_RADIATION; 3->CSWITCH; 4->SOBOLEV/CEP
!0->LTE; 1->OLD_POPULATIONS; 2->ZERO_RADIATION; 3->CSWITCH; 4->SOBOLEV/CEP
!only for lines !
integer :: j_Trans_rayTracing(Nmax_Trans_raytracing), i_Trans_rayTracing(Nmax_Trans_raytracing)
real :: vmax_rt !km/s !!
Expand Down Expand Up @@ -108,20 +108,20 @@ module atom_type
real(kind=dp), parameter :: cswitch_val = 1d6!1d12
real(kind=dp), parameter :: cswitch_down_scaling_factor = 10.0!ceil(exp(log(cswitch_val)/cswitch_niter))
logical :: lcswitch_enabled = .false. !if only one atom has cswith, it is True.

contains

function trans_number(atom, ilevel,jlevel)
!from lower level i and upper level j
!return the transition number from the first line 1
!return the transition number from the first line 1
!to the last continuum = atom%Ntrans
!
!
! TO DO: check that the returned number is consistent !
! define an independent function not relying on atom%ij_to_trans
type (AtomType), intent(in) :: atom
integer, intent(in) :: ilevel, jlevel
integer :: i, j, k , trans_number
integer :: trans_number

trans_number = atom%ij_to_trans(ilevel,jlevel)

Expand Down Expand Up @@ -405,13 +405,13 @@ subroutine parse_label(label, g, S, L,J, determined)
logical, intent(out) :: determined
integer, intent(out) :: L
real, intent(out) :: J, S


logical :: unknown_orbital
character(len=ATOM_LABEL_WIDTH+1) :: multiplet
character(len=1) :: orbit
integer :: i, Nl, parity, dk

multiplet = trim(label)
Nl = len(multiplet)

Expand Down Expand Up @@ -519,16 +519,16 @@ function vbroad(temp, w, xi)
real(kind=dp), intent(in) :: temp, xi
real, intent(in) :: w
real(kind=dp) :: vbroad

vbroad = sqrt( Vtherm*temp/w + xi*xi )

return
end function vbroad

function ntotal_ions(icell)
real(kind=dp) :: ntotal_ions
integer, intent(in) :: icell
integer :: n, j, il
integer :: n, il

ntotal_ions = 0.0
do n=1,n_atoms
Expand All @@ -542,4 +542,4 @@ function ntotal_ions(icell)
return
end function ntotal_ions

end module atom_type
end module atom_type
16 changes: 7 additions & 9 deletions src/gas/broad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ function line_damping(icell, line)
!for each transition individually
integer, intent(in) :: icell
type (AtomicLine), intent(in) :: line
integer :: k
real(kind=dp) :: radfreq_to_vel
real(kind=dp) :: adamp, vdw, vth
real(kind=dp) :: line_damping
real(kind=dp) :: Qelast, Gj


line_damping = line%Grad
vth = vbroad(T(icell), line%atom%weight, vturb(icell))
Expand Down Expand Up @@ -80,9 +79,9 @@ subroutine VanderWaals_line(icell, line, GvdW)
real(kind=dp), intent(out) :: GvdW
integer, intent(in) :: icell
type (AtomicLine), intent(in) :: line
integer :: i, j, ic, Z, k
integer :: i, j, ic, Z
real(kind=dp) :: vrel35_H, vrel35_He, fourPIeps0, deltaR
real(kind=dp) :: cross, gammaCorrH, gammaCorrHe, C625
real(kind=dp) :: cross, C625

j = line%j
i = line%i
Expand Down Expand Up @@ -142,7 +141,7 @@ subroutine Stark_line(icell,line, GStark)
real(kind=dp), intent(out) :: GStark
integer, intent(in) :: icell
type (AtomicLine), intent(in) :: line
integer :: k, ic, Z
integer :: ic, Z
real(kind=dp) :: C4, C, Cm, melONamu, cStark23, cStark
real(kind=dp) :: neff_u, neff_l, vrel, ERYDBERG

Expand Down Expand Up @@ -195,9 +194,8 @@ subroutine StarkLinear_line(icell, line, GStark)
real(kind=dp), intent(out) :: GStark
integer, intent(in) :: icell
type (AtomicLine), intent(in) :: line
real(kind=dp) :: n_upper, n_lower, Gstark2
real :: Z, K, dn, a1, gs
real(kind=dp) :: C, nelectric
real(kind=dp) :: n_upper, n_lower, nelectric
real :: Z, dn, a1, gs

Z = 1.0 + line%atom%stage(line%i)

Expand Down Expand Up @@ -300,4 +298,4 @@ end subroutine StarkLinear_line
! return
! end subroutine resonance_broadening

end module broad
end module broad
4 changes: 1 addition & 3 deletions src/gas/elements_type.f90
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,9 @@ module elements_type
'Th','Pa','U ','Np','Pu','Am','Cm','Bk','Cf','Es'/



contains

subroutine dealloc_elements()
integer :: n

deallocate(Tpf)
deallocate(elems)
Expand Down Expand Up @@ -139,7 +137,7 @@ subroutine read_abundance()
!
! Also read partition function

integer :: EOF, n, blocksize, unit, i, j, syst_status
integer :: EOF, n, blocksize, unit, i, j
integer :: NAXIST(1), naxis_found, hdutype, Nread
! integer :: cursor_init
character(len=256) :: some_comments
Expand Down
Loading

0 comments on commit a0892a2

Please sign in to comment.