Skip to content

Commit

Permalink
Bug fix: non-allocated arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
cpinte committed May 30, 2024
1 parent a302209 commit c100edc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/SPH2mcfost.f90
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ subroutine setup_SPH2mcfost(extra_heating)
call read_gadget2_file(iunit,density_files(1), x,y,z,h,massgas,rho,rhodust,ndusttypes,n_SPH,ierr)
else if (ldensity_file) then
call read_Voronoi_fits_file(density_files(1), x,y,z,h,vx,vy,vz,particle_id,massgas,n_SPH)
ldust_moments = .false.
ndusttypes=0
else
call error("Unknown SPH structure.")
endif
Expand Down Expand Up @@ -116,7 +118,8 @@ subroutine setup_SPH2mcfost(extra_heating)
if (lemission_atom) then
call hydro_to_Voronoi_atomic(n_SPH,T_gas,vturb,massgas,mass_ne_on_massgas,atomic_mask)
endif
deallocate(massgas,rho)
deallocate(massgas)
if (allocated(rho)) deallocate(rho)
if (allocated(vturb)) deallocate(vturb)
if (allocated(mass_ne_on_massgas)) deallocate (mass_ne_on_massgas)
if (allocated(atomic_mask)) deallocate(atomic_mask)
Expand Down
6 changes: 0 additions & 6 deletions src/dust_ray_tracing.f90
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,6 @@ subroutine init_directions_ray_tracing()
enddo
enddo


do ibin=1, RT_n_incl
write(*,*) ibin, tab_RT_incl(ibin), -tab_uv_rt(ibin), tab_w_rt(ibin)
enddo


if (.not. allocated(star_position)) then
allocate(star_position(n_etoiles,RT_n_incl,RT_n_az,2), star_vr(n_etoiles,RT_n_incl,RT_n_az), stat=alloc_status)
if (alloc_status > 0) call error('Allocation error star_position')
Expand Down

0 comments on commit c100edc

Please sign in to comment.