From 3623764a7ac7afd9b04ef336496fb0f670e1d998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 28 Jul 2023 16:22:24 +0200 Subject: [PATCH] MNT: cleanup unused variables --- .../halo_analysis/halo_finding/fof/EnzoFOF.c | 2 +- .../halo_analysis/halo_finding/hop/EnzoHop.c | 2 +- .../halo_analysis/halo_finding/hop/hop_hop.c | 14 +++++--------- .../halo_analysis/halo_finding/hop/hop_regroup.c | 11 +++-------- .../halo_analysis/halo_finding/hop/hop_smooth.c | 15 ++++----------- .../halo_analysis/halo_finding/hop/smooth.h | 2 -- 6 files changed, 14 insertions(+), 32 deletions(-) diff --git a/yt_astro_analysis/halo_analysis/halo_finding/fof/EnzoFOF.c b/yt_astro_analysis/halo_analysis/halo_finding/fof/EnzoFOF.c index 3dc88e84..6d861cb9 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/fof/EnzoFOF.c +++ b/yt_astro_analysis/halo_analysis/halo_finding/fof/EnzoFOF.c @@ -34,7 +34,7 @@ Py_EnzoFOF(PyObject *obj, PyObject *args) int nMembers = 8; int i, num_particles; KDFOF kd; - int nBucket,j; + int nBucket; float fEps; int nGroup,bVerbose=1; int sec,usec; diff --git a/yt_astro_analysis/halo_analysis/halo_finding/hop/EnzoHop.c b/yt_astro_analysis/halo_analysis/halo_finding/hop/EnzoHop.c index 6b9a890e..86d2ee1d 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/hop/EnzoHop.c +++ b/yt_astro_analysis/halo_analysis/halo_finding/hop/EnzoHop.c @@ -99,7 +99,7 @@ Py_EnzoHop(PyObject *obj, PyObject *args) float thresh = 160.0; int i, num_particles; KD kd; - int nBucket = 16, kdcount = 0; + int nBucket = 16; PyArrayObject *particle_density; HC my_comm; PyArrayObject *particle_group_id; diff --git a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_hop.c b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_hop.c index 3ef55955..dceb45ac 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_hop.c +++ b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_hop.c @@ -58,14 +58,12 @@ void hop_main(KD kd, HC *my_comm, float densthresh) { /* KD kd; */ SMX smx; - int nBucket,nSmooth,i,j; - FILE *fp, *fpb; - char ach[80],achFile[80], *inputfile, *densfile; + int nSmooth,j; + char achFile[80]; float fPeriod[3]; int bDensity,bGroup,bSym,bMerge,nDens,nHop,nMerge,bTopHat; float fDensThresh; - nBucket = 16; nSmooth = 64; nDens = 64; nHop = -1; @@ -77,8 +75,6 @@ void hop_main(KD kd, HC *my_comm, float densthresh) bSym = 1; bTopHat = 0; strcpy(achFile,"output_hop"); - inputfile = NULL; - i = 1; /* for (j=0;j<3;++j) fPeriod[j] = HUGE; */ for (j=0;j<3;++j) fPeriod[j] = 1.0; nMerge = 4; @@ -375,7 +371,7 @@ particles are in the assumed group numbering, i.e. 0 to ngroup-1, with for searching. If not, we left the old radius alone. Either way, we're ready to go. */ { - int j, k, g, next, newgroup; + int j; ReSizeSMX(smx, smx->nMerge+2); /* Alter the smoothing scale on smx */ smx->nHashLength = smx->nGroups*10+1; @@ -466,7 +462,7 @@ but leaving the particle information intact. */ radius) correctly, we won't reduce the size of the fList and pList arrays */ { - PQ_STATIC; + int PQ_j; if (nSmooth>smx->nSmooth) { /* We're increasing the size */ smx->nListSize = nSmooth+RESMOOTH_SAFE; free(smx->fList); @@ -524,7 +520,7 @@ void binOutHop(SMX smx, HC *my_comm, float densthresh) /* Write Group tag for each particle. Particles should be ordered. */ /* Binary file: nActive, nGroups, list of Groups */ { - int j,dummy; + int j; /* FILE *blahfp = fopen("Part-PreMergeGroup.txt","w"); *//* S Skory */ Grouplist *g = my_comm->gl; Slice *s = my_comm->s; diff --git a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_regroup.c b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_regroup.c index 68ddfd41..70192399 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_regroup.c +++ b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_regroup.c @@ -86,9 +86,8 @@ typedef struct controlstruct { void parsecommandline(float dens_outer, Controls *c) { - int narg, qmerge; + int qmerge; char *outname, *rootname; - narg = 1; rootname = c->dataname = c->densname = c->gmergename = c->tagname = outname = c->outsizename = c->outtagname = c->outgmergename = NULL; c->qdenscut = -1; @@ -213,7 +212,6 @@ void regroup_main(float dens_outer, HC *my_comm) { Grouplist *gl = my_comm->gl; Slice *s = my_comm->s; - FILE *f; Controls c; /* parsecommandline(argc, argv, &c); */ @@ -402,14 +400,11 @@ centers. */ the idmerge field. */ /* I think this will work even if saddledensthreshgdensity; int *g1temp,*g2temp; float *denstemp; diff --git a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_smooth.c b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_smooth.c index 2b200590..0f33fd97 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_smooth.c +++ b/yt_astro_analysis/halo_analysis/halo_finding/hop/hop_smooth.c @@ -34,7 +34,7 @@ the case of equal mass particles. */ int smInit(SMX *psmx,KD kd,int nSmooth,float *fPeriod) { SMX smx; - PQ_STATIC; + int PQ_j; int pi,j; fprintf(stderr,"nSmooth = %d kd->nActive = %d\n", nSmooth, kd->nActive); assert(nSmooth <= kd->nActive); @@ -84,14 +84,12 @@ void smFinish(SMX smx) void smBallSearch(SMX smx,float fBall2,float *ri) { KDN *c; - PARTICLE *p; int cell,cp,ct,pj; float fDist2,dx,dy,dz,lx,ly,lz,sx,sy,sz,x,y,z; PQ *pq; - PQ_STATIC; + PQ *PQ_t,*PQ_lt; c = smx->kd->kdNodes; - p = smx->kd->p; pq = smx->pqHead; x = ri[0]; y = ri[1]; @@ -175,12 +173,10 @@ void smBallSearch(SMX smx,float fBall2,float *ri) int smBallGather(SMX smx,float fBall2,float *ri) { KDN *c; - PARTICLE *p; int pj,nCnt,cp,nSplit; float dx,dy,dz,x,y,z,lx,ly,lz,sx,sy,sz,fDist2; c = smx->kd->kdNodes; - p = smx->kd->p; nSplit = smx->kd->nSplit; lx = smx->fPeriod[0]; ly = smx->fPeriod[1]; @@ -227,9 +223,9 @@ int smBallGather(SMX smx,float fBall2,float *ri) void smSmooth(SMX smx,void (*fncSmooth)(SMX,int,int,int *,float *)) { KDN *c; - PARTICLE *p; PQ *pq,*pqLast; - PQ_STATIC; + PQ *PQ_t,*PQ_lt; + int PQ_j,PQ_i; int cell; int pi,pin,pj,pNext,nCnt,nSmooth; float dx,dy,dz,x,y,z,h2,ax,ay,az; @@ -246,7 +242,6 @@ void smSmooth(SMX smx,void (*fncSmooth)(SMX,int,int,int *,float *)) } pqLast = &smx->pq[smx->nSmooth-1]; c = smx->kd->kdNodes; - p = smx->kd->p; nSmooth = smx->nSmooth; /* ** Initialize Priority Queue. @@ -370,11 +365,9 @@ void smSmooth(SMX smx,void (*fncSmooth)(SMX,int,int,int *,float *)) void smReSmooth(SMX smx,void (*fncSmooth)(SMX,int,int,int *,float *)) { - PARTICLE *p; int pi,nSmooth; float temp_ri[3]; - p = smx->kd->p; for (pi=0;pikd->nActive;++pi) { if (IMARK == 0) continue; /* diff --git a/yt_astro_analysis/halo_analysis/halo_finding/hop/smooth.h b/yt_astro_analysis/halo_analysis/halo_finding/hop/smooth.h index 4ce6f6ed..ec1a453e 100644 --- a/yt_astro_analysis/halo_analysis/halo_finding/hop/smooth.h +++ b/yt_astro_analysis/halo_analysis/halo_finding/hop/smooth.h @@ -64,8 +64,6 @@ typedef struct smContext { float fDensThresh; /* Density Threshold for group finding */ } * SMX; -#define PQ_STATIC PQ *PQ_t,*PQ_lt;int PQ_j,PQ_i - #define PQ_INIT(pq,n)\ {\