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 7, 2024
1 parent 5a7cd1c commit 96d8f60
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 36 deletions.
14 changes: 4 additions & 10 deletions src/Voronoi.f90
Original file line number Diff line number Diff line change
Expand Up @@ -846,10 +846,10 @@ subroutine cross_Voronoi_cell(x,y,z, u,v,w, icell, previous_cell, x1,y1,z1, next

real(kind=dp), parameter :: prec = 1e-5

real(kind=dp) :: s_tmp, den, num, s_entry, s_exit
real(kind=dp) :: s_tmp, den
integer :: i, id_n, l, ifirst, ilast

integer :: i_star, check_cell
integer :: i_star
real(kind=dp) :: d_to_star
logical :: is_a_star_neighbour

Expand Down Expand Up @@ -1000,15 +1000,9 @@ real(dp) function distance_to_closest_wall_Voronoi(icell,x,y,z) result(s)
real(kind=dp), intent(in) :: x,y,z

! n = normale a la face, p = point sur la face, r = position du photon, k = direction de vol
real(kind=dp) :: s_tmp, den, num, s_entry, s_exit
real(kind=dp) :: s_tmp, den
integer :: i, id_n, l, ifirst, ilast

integer :: i_star, check_cell
real(kind=dp) :: d_to_star
logical :: is_a_star_neighbour

real(kind=dp), dimension(3) :: delta_r

! n = normale a la face, p = point sur la face, r = position du photon, k = direction de vol
real, dimension(3) :: n, p, r, k, r_cell, r_neighbour

Expand Down Expand Up @@ -1091,7 +1085,7 @@ subroutine cross_Voronoi_cell_vect(x,y,z, u,v,w, icell, previous_cell, x1,y1,z1,
real :: s_tmp_wall, den1
real(kind=dp) :: b, c, delta, rac, s1, s2, h

integer :: n_neighbours, n_wall, ifirst, ilast, id_min, id_max
integer :: n_neighbours, ifirst, ilast

logical :: lhit_wall, was_cut

Expand Down
3 changes: 2 additions & 1 deletion src/dust_transfer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,8 @@ subroutine propagate_packet(id,lambda,p_lambda,icell,x,y,z,u,v,w,stokes,flag_sta
logical, intent(out) :: flag_scatt

real(kind=dp), dimension(4,4) :: M
real(kind=dp) :: u1,v1,w1, phi, cospsi, Planck_opacity, rec_Planck_opacity, d, diff_coeff
real(kind=dp) :: u1,v1,w1, phi, cospsi
!real(kind=dp) :: Planck_opacity, rec_Planck_opacity, d, diff_coeff
integer :: taille_grain, itheta
integer :: n_iteractions_in_cell, icell_old
integer, pointer :: p_icell
Expand Down
2 changes: 0 additions & 2 deletions src/grid.f90
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ module grid
contains

subroutine alloc_atomrt_grid()
integer(kind=8) :: mem_alloc_local = 0

!merge vturb and v_turb (molecular emission)
!TO DO: move vturb in molecular emission in grid.f90
Expand Down Expand Up @@ -274,7 +273,6 @@ end subroutine define_physical_zones
subroutine setup_grid()

logical, save :: lfirst = .true.
integer :: mem_size

if (.not.lVoronoi) then
nrz = n_rad * nz
Expand Down
8 changes: 4 additions & 4 deletions src/mol_transfer.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ subroutine emission_line_tau_surface_map(imol,tau,ibin,iaz)

integer :: i,j, id, icell, iTrans
real(kind=dp) :: l, taille_pix, x0, y0, z0, u0, v0, w0
logical :: lintersect, flag_star, flag_direct_star, flag_sortie, lpacket_alive
logical :: lintersect, flag_sortie, lpacket_alive
integer, dimension(4) :: ispeed

! Direction de visee pour le ray-tracing
Expand Down Expand Up @@ -1153,7 +1153,7 @@ subroutine emission_line_tau_surface_map(imol,tau,ibin,iaz)
!$omp parallel &
!$omp default(none) &
!$omp private(i,j,id,icell,lintersect,x0,y0,z0,u0,v0,w0) &
!$omp private(flag_star,flag_direct_star,flag_sortie,lpacket_alive,pixelcenter) &
!$omp private(flag_sortie,lpacket_alive,pixelcenter) &
!$omp shared(tau,Icorner,imol,iTrans,dx,dy,u,v,w,ispeed,tab_speed_rt) &
!$omp shared(taille_pix,npix_x,npix_y,ibin,iaz,tau_surface_map,move_to_grid)
id = 1 ! pour code sequentiel
Expand Down Expand Up @@ -1213,7 +1213,7 @@ subroutine emission_line_energy_fraction_surface_map(imol,flux_fraction,ibin,iaz

integer :: i,j, id, icell, iTrans, iiTrans
real(kind=dp) :: l, taille_pix, x0, y0, z0, u0, v0, w0, Flux, factor
logical :: lintersect, flag_star, flag_direct_star, flag_sortie, lpacket_alive
logical :: lintersect, flag_sortie, lpacket_alive
integer, dimension(4) :: ispeed

! Direction de visee pour le ray-tracing
Expand Down Expand Up @@ -1266,7 +1266,7 @@ subroutine emission_line_energy_fraction_surface_map(imol,flux_fraction,ibin,iaz
!$omp parallel &
!$omp default(none) &
!$omp private(i,j,id,icell,lintersect,x0,y0,z0,u0,v0,w0) &
!$omp private(flag_star,flag_direct_star,flag_sortie,lpacket_alive,pixelcenter,Flux) &
!$omp private(flag_sortie,lpacket_alive,pixelcenter,Flux) &
!$omp shared(flux_fraction,Icorner,imol,iTrans,iiTrans,dx,dy,u,v,w,ispeed,tab_speed_rt) &
!$omp shared(taille_pix,npix_x,npix_y,ibin,iaz,tau_surface_map,move_to_grid,spectre,factor)
id = 1 ! pour code sequentiel
Expand Down
11 changes: 5 additions & 6 deletions src/output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1057,11 +1057,11 @@ subroutine write_tau_surface(imol)

integer :: status,unit,blocksize,bitpix,naxis
integer, dimension(5) :: naxes
integer :: i,j,group,fpixel,nelements, alloc_status, xcenter, lambda, itype, ibin, iaz
integer :: i,j,group,fpixel,nelements, alloc_status, lambda, ibin, iaz

character(len = 512) :: filename
logical :: simple, extend
real :: pixel_scale_x, pixel_scale_y, Q, U
real :: pixel_scale_x, pixel_scale_y

! Allocation dynamique pour passer en stack
real, dimension(:,:,:,:,:), allocatable :: image
Expand Down Expand Up @@ -1171,11 +1171,11 @@ subroutine write_tau_map(imol)

integer :: status,unit,blocksize,bitpix,naxis
integer, dimension(5) :: naxes
integer :: i,j,group,fpixel,nelements, alloc_status, xcenter, lambda, itype, ibin, iaz
integer :: i,j,group,fpixel,nelements, alloc_status, lambda, ibin, iaz

character(len = 512) :: filename
logical :: simple, extend
real :: pixel_scale_x, pixel_scale_y, Q, U
real :: pixel_scale_x, pixel_scale_y

! Allocation dynamique pour passer en stack
real, dimension(:,:,:,:), allocatable :: image
Expand Down Expand Up @@ -3177,7 +3177,7 @@ subroutine ecriture_pops(imol,ext)
character(len=32), intent(in), optional :: ext

character(len=512) :: filename
integer :: status,unit,blocksize,bitpix,naxis,icell
integer :: status,unit,blocksize,bitpix,naxis
integer, dimension(3) :: naxes
integer :: group,fpixel,nelements
logical :: simple, extend
Expand Down Expand Up @@ -3546,7 +3546,6 @@ subroutine write_atomic_maps(atom)

integer :: status,unit,blocksize,bitpix,naxis
integer, dimension(6) :: naxes
integer, dimension(4) :: naxes_cont
integer :: group,fpixel,nelements
integer :: n, kr, i, j
logical :: simple, extend
Expand Down
4 changes: 0 additions & 4 deletions src/thermal_emission.f90
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,6 @@ subroutine im_reemission_LTE(id,icell,p_icell,aleat1,aleat2,lambda)
! Calcul de la temperature de la cellule et stokage energie recue + T
! Reemission d'un photon a la bonne longeur d'onde

use radiation_field, only : xKJ_abs, E0

implicit none

integer, intent(in) :: id, icell, p_icell
Expand Down Expand Up @@ -875,8 +873,6 @@ subroutine Temp_finale()
! C. Pinte
! 24/01/05

use radiation_field, only : xKJ_abs, E0

implicit none

real :: Temp
Expand Down
16 changes: 7 additions & 9 deletions src/utils.f90
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ function matdiag(A,n)
real(kind=dp), intent(in) :: A(n*n)
! real(kind=dp), intent(in) :: A(n,n)
real(kind=dp) :: matdiag(n)
integer :: i

! do i = 1, n
! matdiag(i) = A(i,i)
Expand All @@ -275,7 +274,7 @@ subroutine Jacobi(a,b,x,n)
real(kind=dp), parameter :: omega = 1.0 ! Damping factor (0 < omega < 1)
integer, parameter :: nIterMax = 20000

integer :: niter, i
integer :: niter
real(kind=dp) :: diff

logical :: lconverged
Expand Down Expand Up @@ -315,7 +314,7 @@ subroutine Jacobi_sparse(a,b,x,n)
real(kind=dp), parameter :: omega = 1.0 ! Damping factor (0 < omega < 1)
integer, parameter :: nIterMax = 20000

integer :: niter, i
integer :: niter
real(kind=dp) :: diff

logical :: lconverged
Expand Down Expand Up @@ -429,7 +428,7 @@ function Ng_accelerate(m,n,x)
logical :: Ng_accelerate
real(kind=dp), intent(inout) :: x(m,*)
integer :: i, j, k
real(kind=dp) :: x0(m), A(n, n), b(n), w, dy, di, max_sol
real(kind=dp) :: x0(m), A(n, n), b(n), w, dy, di

ng_accelerate = .false.

Expand Down Expand Up @@ -474,7 +473,7 @@ subroutine Accelerate(m,n,x)
integer, intent(in) :: m, n
real(kind=dp), intent(inout) :: x(m,*)
integer :: i, j, k
real(kind=dp) :: x0(m), A(n, n), b(n), w, dy, di, max_sol
real(kind=dp) :: x0(m), A(n, n), b(n), w, dy, di

A(:,:) = 0.0_dp; b(:) = 0.0_dp
x0(:) = x(:,1)
Expand Down Expand Up @@ -525,14 +524,14 @@ subroutine check_ng_pops(m,n,o,x,xtot)
integer, intent(in) :: m,n,o
real(kind=dp), intent(inout) :: x(m,n,o)
real(kind=dp), intent(in) :: xtot(n)
integer :: i, j, k
integer :: i, j
real(kind=dp) :: dum(o)

!take absolute value

!$omp parallel &
!$omp default(none) &
!$omp private(i,j,k,dum)&
!$omp private(i,j,dum)&
!$omp shared(m,n,o,x,xtot)
!$omp do schedule(dynamic,1)
do i=1,n
Expand Down Expand Up @@ -830,7 +829,7 @@ function mcfost_update(lforce_update, lmanual, n_days)
integer, intent(in), optional :: n_days
logical :: lupdate, mcfost_update

character(len=512) :: cmd, url, url_sha1, last_version, current_binary, s
character(len=512) :: cmd, url, url_sha1, last_version, current_binary
character(len=40) :: mcfost_sha1, mcfost_update_sha1
integer :: syst_status, ios

Expand Down Expand Up @@ -1867,7 +1866,6 @@ function bilinear(N,xi,i0,M,yi,j0,f,xo,yo)
real(kind=dp), intent(in) :: xi(N),yi(M),f(N,M)
real(kind=dp), intent(in) :: xo,yo
integer, intent(in) :: i0, j0
integer :: i, j
real(kind=dp) :: norm, f11, f21, f12, f22

norm = ((xi(i0) - xi(i0-1)) * (yi(j0) - yi(j0-1)))
Expand Down

0 comments on commit 96d8f60

Please sign in to comment.