Skip to content

Commit

Permalink
Merge pull request #212 from neutrinoceros/cleanup_unused_vars
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jul 28, 2023
2 parents 934bb9b + 3623764 commit 9efddef
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 32 deletions.
2 changes: 1 addition & 1 deletion yt_astro_analysis/halo_analysis/halo_finding/fof/EnzoFOF.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion yt_astro_analysis/halo_analysis/halo_finding/hop/EnzoHop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 5 additions & 9 deletions yt_astro_analysis/halo_analysis/halo_finding/hop/hop_hop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
11 changes: 3 additions & 8 deletions yt_astro_analysis/halo_analysis/halo_finding/hop/hop_regroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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); */
Expand Down Expand Up @@ -402,14 +400,11 @@ centers. */
the idmerge field. */
/* I think this will work even if saddledensthresh<densthresh */
{
int j, k, g1, g2, ngroups, dummy[3];
int j, g1, g2, ngroups, dummy[3];
Group *gr;
float *densestbound, fdum[3], dens;
float *densestbound, dens;
int *densestboundgroup, changes;
char line[80]; /*, *tempfilename; */
char tempfilename[256];
FILE *fp;
FILE *boundfp;
float *gdensity = my_comm->gdensity;
int *g1temp,*g2temp;
float *denstemp;
Expand Down
15 changes: 4 additions & 11 deletions yt_astro_analysis/halo_analysis/halo_finding/hop/hop_smooth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand All @@ -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.
Expand Down Expand Up @@ -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;pi<smx->kd->nActive;++pi) {
if (IMARK == 0) continue;
/*
Expand Down
2 changes: 0 additions & 2 deletions yt_astro_analysis/halo_analysis/halo_finding/hop/smooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)\
{\
Expand Down

0 comments on commit 9efddef

Please sign in to comment.