Changeset 997 for sans/XOP_Dev/MonteCarlo/MonteCarlo4.c
 Timestamp:
 May 11, 2016 3:39:08 PM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

sans/XOP_Dev/MonteCarlo/MonteCarlo4.c
r834 r997 35 35 double retVal; //return value 36 36 37 longimon;37 SInt64 imon; 38 38 double r1,r2,xCtr,yCtr,sdd,pixSize,thick,wavelength,sig_incoh,sig_sas; 39 longind,index,n_index;39 IndexInt ind,index,n_index; 40 40 double qmax,theta_max,q0,zpow; 41 longn1,n2,n3;41 CountInt n1,n2,n3; 42 42 double dth,zz,xx,yy,phi; 43 43 double theta,ran,ll,rr; 44 longdone,find_theta,err; //used as logicals45 longxPixel,yPixel;44 int done,find_theta,err; //used as logicals 45 int xPixel,yPixel; 46 46 double vx,vy,vz,theta_z; 47 47 double sig_abs,ratio,sig_total; 48 48 double testQ,testPhi,left,delta,dummy,pi; 49 49 double sigabs_0,num_bins; 50 longNSingleIncoherent,NSingleCoherent,NScatterEvents,incoherentEvent,coherentEvent;51 longNDoubleCoherent,NMultipleScatter,isOn,xCtr_long,yCtr_long;52 longNMultipleCoherent,NCoherentEvents;50 CountInt NSingleIncoherent,NSingleCoherent,NScatterEvents,incoherentEvent,coherentEvent; 51 CountInt NDoubleCoherent,NMultipleScatter,isOn,xCtr_long,yCtr_long; 52 CountInt NMultipleCoherent,NCoherentEvents; 53 53 double deltaLam,v1,v2,currWavelength,rsq,fac; //for simulating wavelength distribution 54 54 double ssd, sourAp, souXX, souYY, magn; //sourcetosample, and source Ap radius for initlal trajectory … … 65 65 // long dataOffset; 66 66 // long numRows, numColumns; 67 longnumRows_ran_dev;67 CountInt numRows_ran_dev; 68 68 // double *dp0, *dp; 69 69 double value[2]; // Pointers used for double data. 70 longseed;71 longindices[MAX_DIMENSIONS];70 SInt32 seed; 71 IndexInt indices[MAX_DIMENSIONS]; 72 72 73 73 // char buf[256]; … … 122 122 results = (double*)WaveData(p>resultsH); 123 123 124 seed = ( long)results[0];124 seed = (SInt32)results[0]; 125 125 126 126 // sprintf(buf, "input seed = %ld\r", seed); … … 134 134 seed = 12348765; //nonnegative after that does nothing 135 135 136 imon = ( int)inputWave[0];136 imon = (SInt64)inputWave[0]; 137 137 r1 = inputWave[1]; 138 138 r2 = inputWave[2]; … … 149 149 sourAp = inputWave[13]; // radius, in cm, like r1 and r2 150 150 151 xCtr_long = ( long)(xCtr+0.5);152 yCtr_long = ( long)(yCtr+0.5);151 xCtr_long = (CountInt)(xCtr+0.5); 152 yCtr_long = (CountInt)(yCtr+0.5); 153 153 154 154 dummy = MDGetWaveScaling(p>ran_devH, 0, &delta, &left); //0 is the rows … … 379 379 //Choose index for scattering angle array. 380 380 //IND = NINT(THETA_z/DTH + 0.4999999) 381 ind = ( long)(theta_z/dth + 0.4999999); //round is eqivalent to nint()381 ind = (IndexInt)(theta_z/dth + 0.4999999); //round is eqivalent to nint() 382 382 nt[ind] += 1; //Increment bin for angle. 383 383 //Increment angle array for single scattering events.
Note: See TracChangeset
for help on using the changeset viewer.