diff --git a/lib/Makefile.jt65_osx b/lib/Makefile.jt65_osx index 2d4e56c2e..891229854 100644 --- a/lib/Makefile.jt65_osx +++ b/lib/Makefile.jt65_osx @@ -25,7 +25,7 @@ CFLAGS = -I. -fbounds-check -fPIE %.o: %.F90 ${FC} ${FFLAGS} -c $< -all: libjt9.a jt65 jt65sim +all: libjt9.a jt65 jt65sim OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \ fmtmsg.o deg2grid.o\ @@ -34,7 +34,7 @@ OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \ four2a.o grid2deg.o wisdom.o \ symspec.o analytic.o db.o \ encode232.o interleave9.o\ - entail.o fano232.o gran.o sync9.o decjt9.o \ + entail.o fano232.o sgran.o gran.o sync9.o decjt9.o \ fil3.o decoder.o timer.o exp_decode65.o fqso_first.o\ twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\ fillcom.o chkss2.o zplot9.o flat1.o flat2.o \ @@ -55,7 +55,7 @@ jt65: $(OBJS7) libjt9.a libsfrsd.a $(CP) jt65 $(EXE_DIR) OBJS2 = jt65sim.o wavhdr.o -jt65sim: $(OBJS2) libjt9.a +jt65sim: $(OBJS2) libjt9.a $(FC) -o jt65sim $(OBJS2) -L. -L/opt/local/lib -ljt9 -lfftw3f $(CP) jt65sim $(EXE_DIR) diff --git a/lib/extract.f90 b/lib/extract.f90 index ff5f2e267..46b60b6bb 100644 --- a/lib/extract.f90 +++ b/lib/extract.f90 @@ -71,6 +71,7 @@ subroutine extract(s3,nadd,nqd,ntrials,naggressive,ndepth,nexp_decode, & ncandidates=param(0) nhard=param(1) nsoft=param(2) + nerased=param(3) if(nhard.lt.0 .and. ndepth.ge.5) then call timer('exp_deco',0) @@ -99,6 +100,9 @@ subroutine extract(s3,nadd,nqd,ntrials,naggressive,ndepth,nexp_decode, & call interleave63(correct,63,1) call graycode65(correct,63,1) call unpackmsg(dat4,decoded) !Unpack the user message +! open(43,file='stats.dat',access='append',status='unknown') +! write(43,*) nhard,nsoft,nerased,ntry +! close(43) ncount=0 if(iand(dat4(10),8).ne.0) ltext=.true. nsf=1 diff --git a/lib/jt65sim.f90 b/lib/jt65sim.f90 index 18acffd2d..72dbd833a 100644 --- a/lib/jt65sim.f90 +++ b/lib/jt65sim.f90 @@ -62,6 +62,9 @@ program jt65sim h=default_header(12000,npts) dfsig=2000.0/nsigs !Freq spacing between sigs in file (Hz) +! generate new random number seed for each run using /dev/urandom on linux and os x + nerr=sgran() + do ifile=1,nfiles !Loop over requested number of files write(fname,1002) ifile !Output filename 1002 format('000000_',i4.4) diff --git a/lib/sgran.c b/lib/sgran.c new file mode 100644 index 000000000..697408360 --- /dev/null +++ b/lib/sgran.c @@ -0,0 +1,15 @@ +#include +#include +#include + +/* seed rand using urandom */ +float sgran_() +{ + unsigned int seed; + FILE *urandom; + urandom = fopen ("/dev/urandom","r"); + fread (&seed, sizeof (seed), 1, urandom); + srand (seed); + + return(0); +}