From 0ecdb998856b2ca3d565e3fb0e973f85b52240f0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Thu, 8 Jun 2017 13:50:17 -0400 Subject: [PATCH] fix uninitialized data access as reported by @martok in #174 --- lib/meam/meam_dens_final.F | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/meam/meam_dens_final.F b/lib/meam/meam_dens_final.F index 92195dcaf4..cdc47067e2 100644 --- a/lib/meam/meam_dens_final.F +++ b/lib/meam/meam_dens_final.F @@ -98,13 +98,14 @@ c Complete the calculation of density call G_gam(Gamma(i),ibar_meam(elti), $ gsmooth_factor,G,errorflag) if (errorflag.ne.0) return + call get_shpfcn(shp,lattce_meam(elti,elti)) if (ibar_meam(elti).le.0) then Gbar = 1.d0 + dGbar = 0.d0 else - call get_shpfcn(shp,lattce_meam(elti,elti)) if (mix_ref_t.eq.1) then - gam = (t_ave(1,i)*shpi(1)+t_ave(2,i)*shpi(2) - $ +t_ave(3,i)*shpi(3))/(Z*Z) + gam = (t_ave(1,i)*shp(1)+t_ave(2,i)*shp(2) + $ +t_ave(3,i)*shp(3))/(Z*Z) else gam = (t1_meam(elti)*shp(1)+t2_meam(elti)*shp(2) $ +t3_meam(elti)*shp(3))/(Z*Z) @@ -119,9 +120,8 @@ c Complete the calculation of density Gbar = 1.d0 dGbar = 0.d0 else - call get_shpfcn(shpi,lattce_meam(elti,elti)) - gam = (t_ave(1,i)*shpi(1)+t_ave(2,i)*shpi(2) - $ +t_ave(3,i)*shpi(3))/(Z*Z) + gam = (t_ave(1,i)*shp(1)+t_ave(2,i)*shp(2) + $ +t_ave(3,i)*shp(3))/(Z*Z) call dG_gam(gam,ibar_meam(elti),gsmooth_factor, $ Gbar,dGbar) endif