--- ../orgsrc/BOOTDIST.FOR	2009-01-31 23:04:07.251000000 -0500
+++ BOOTDIST.FOR	2009-01-31 22:13:46.554000000 -0500
@@ -33,7 +33,7 @@
 *  comparisons between populations
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
-     +   INTST*8,REALST*8,LOGST*8,COEF*48,ONAME*64,POPNUM*4
+     +   INTST*64,REALST*8,LOGST*8,COEF*48,PHYF*64,POPNUM*4
       REAL BDIST,SDIST,ADIST,JX,GX,SMJX2,SMGX2,EDJX2,FREQ2,
      +   JXY1,JX1,JY1,IUN,ID,REALVL,SEED*8
       INTEGER MINI2,MAXI2,N2,INTVL,DCOEF,POP1,POP2
@@ -45,12 +45,14 @@
       COMMON/CHARV/LINE,DATE,TIME,TITLE,FMT
       COMMON/PAGES/FULSKP
 
-      DIMENSION INTST(2),BDIST(ML,MT,MT),SDIST(MT,MT),POPNUM(MT),
+      DIMENSION INTST(4),BDIST(ML,MT,MT),SDIST(MT,MT),POPNUM(MT),
      +   ADIST(MT,MT),JX(MT),GX(MT),SMJX2(MT),SMGX2(MT),EDJX2(MT),
-     +   FREQ2(MA,MT),MINI2(MT),MAXI2(MT),N2(MT),INTVL(1),REALVL(1),
+     +   FREQ2(MA,MT),MINI2(MT),MAXI2(MT),N2(MT),INTVL(3),REALVL(1),
      +   LOGVL(7),REALST(1)
+* below are where the valid tokens are declared...
       LOGICAL FULSKP
-      DATA INTST/'COEF','NREPS'/
+* added 'SEED' and 'PHYF'
+      DATA INTST/'COEF','NREPS','SEED','PHYF'/
      
       COEF(1)='Nei (1978) unbiased genetic identity'
       COEF(2)='Nei (1978) unbiased genetic distance'
@@ -67,39 +69,47 @@
       COEF(13)='Edwards (1971,1974) "E" distance'
 
       CALL PAGSKP
-      WRITE (2,600) TITLE,DATE,TIME
+      WRITE (6,600) TITLE,DATE,TIME
 
 *     Defaults:
 
          INTVL(1)=0
          INTVL(2)=0
+         INTVL(3)=IRand(0)
 
-         CALL READER (2,0,0,INTST,REALST,LOGST,INTVL,REALVL,LOGVL,
+
+         CALL READER (4,0,0,INTST,REALST,LOGST,INTVL,REALVL,LOGVL,
      +      IERROR)
          IF (IERROR.EQ.1) RETURN
          DCOEF=INTVL(1)
          NBOOT=INTVL(2)
+         SEED=INTVL(3)
+* kludge: PHYF filename is put in the INTST array at READER (MISC.FOR)
+         PHYF=INTST(4)
 
       IF(NBOOT.GE.1) THEN
-      WRITE(*,'(//////////////////////)')
-      WRITE(*,'(A)')' Distance/Similarity measure:'
-      WRITE(*,'(A64)')COEF(DCOEF)
-      WRITE(*,'(A)')' Name of the file to contain the bootstrapped PHYLI
-     +P matrix file?'
-      READ(*,'(A)')ONAME
-      OPEN(UNIT=6,FILE=ONAME)
-
-      WRITE(*,'(A)')' Random seed?'
-      READ(*,'(F10.0)')SEED
+*      WRITE(*,'(//////////////////////)')
+*      WRITE(*,'(A)')' Distance/Similarity measure:'
+*      WRITE(*,'(A64)')COEF(DCOEF)
+*      WRITE(*,'(A)')' Name of the file to contain the bootstrapped PHYLI
+*     +P matrix file?'
+*      READ(*,'(A)') ONAME
+*      OPEN(UNIT=6,FILE=ONAME)
+
+* default is 'out.phy'/maj
+      OPEN(UNIT=8,FILE=PHYF)
+* SEED is now set in the data file/maj
+*      WRITE(*,'(A)')' Random seed?'
+*      READ(*,'(F10.0)')SEED
       ENDIF
 
       IF(NBOOT.LT.1) THEN
-      WRITE(*,'(//////////////////////)')
-      WRITE(*,'(A)')' Distance/Similarity measure:'
-      WRITE(*,'(A64)')COEF(DCOEF)
-      WRITE(*,'(A)')' Name of the file to contain the PHYLIP matrix?'
-      READ(*,'(A)')ONAME
-      OPEN(UNIT=6,FILE=ONAME)
+*      WRITE(*,'(//////////////////////)')
+*      WRITE(*,'(A)')' Distance/Similarity measure:'
+*      WRITE(*,'(A64)')COEF(DCOEF)
+*      WRITE(*,'(A)')' Name of the file to contain the PHYLIP matrix?'
+*      READ(*,'(A)')ONAME
+      OPEN(UNIT=8,FILE=PHYF)
       ENDIF
 
       DO 100 J=1,NLOC
@@ -247,7 +257,7 @@
       IF(NBOOT.GT.1)THEN
       RINT=100000/NLOC
       DO 300 L=1,NLOC
-         RJ=RAND(SEED)/RINT
+         RJ=RANDS(SEED)/RINT
          J=RJ+1
          IF(J.GT.NLOC)J=NLOC
       DO 310 K1=2,NOTU
@@ -298,9 +308,11 @@
       ENDIF
 
       IF(DCOEF.GE.7) THEN
-      WRITE(6,611)NOTU
+*      WRITE(6,611)NOTU
+      WRITE(8,611)NOTU
       DO 500 POP1=1,NOTU
-      WRITE(6,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
+*      WRITE(6,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
+      WRITE(8,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
 500   CONTINUE
       ENDIF
 
@@ -369,27 +381,30 @@
 520         CONTINUE
 510      CONTINUE
 
-      WRITE(6,611)NOTU
+*      WRITE(6,611)NOTU
+      WRITE(8,611)NOTU
       DO 580 POP1=1,NOTU
-      WRITE(6,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
-  580 CONTINUE
+*      WRITE(6,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
+      WRITE(8,610)POPNUM(POP1),(ADIST(POP1,POP2),POP2=1,NOTU)
+ 580  CONTINUE
       ENDIF
 
       IF(NBOOT.LE.1)THEN
-      WRITE (2,602) COEF(DCOEF),ONAME
+      WRITE (6,602) COEF(DCOEF),ONAME
       RETURN
       ENDIF
 
   290 CONTINUE
 
-      WRITE (2,601) COEF(DCOEF),NBOOT,ONAME
+      WRITE (6,601) COEF(DCOEF),NBOOT,ONAME
       RETURN
 
 600   FORMAT (//////T3,76('*')/T3,'*',T78,'*'/T3,'*',2X,A72,
-     +'*'/T3,'*',T78,'*'/T3,
-     +'*  Bootstrapping of Genetic similarity and distance coefficients',
-     +T78,'*'/T3,'*',T78,'*'/T3,'*  BIOSYS-1   Release 1.7',3X,A12,3X,
-     +A12,T78,'*'/T3,'*',T78,'*'/T3,76('*')///)
+     + '*'/T3,'*',T78,'*'/T3,
+     +'*  Bootstrapping of Genetic similarity and distance', 
+     +' coefficients',
+     +T78,'*'/T3,'*',T78,'*'/T3,'*  BIOSYS-1   Release 1.7',
+     +3X,A12,3X,A12,T78,'*'/T3,'*',T78,'*'/T3,76('*')///)
 601   FORMAT (/' Matrices calculated and stored for further ',
      +'analysis by PHYLIP3.5C:',//,A64,//,I10,
      +' pseudo-replicated matrices were written to file: ', A64,
@@ -402,7 +417,7 @@
       END
 
 C     Pseudorandom number generator 
-      FUNCTION RAND(SEED)
+      FUNCTION RANDS(SEED)
       REAL*8 SEED,GENA,GENB
       GENA=(5.0**13.0)*SEED
       GENB=2.0**35.0
--- ../orgsrc/CLUSTER.FOR	2009-01-31 23:04:23.284000000 -0500
+++ CLUSTER.FOR	2009-01-31 22:13:46.671000000 -0500
@@ -37,7 +37,7 @@
 *  or complete linkage cluster analysis
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
-     +   INTST*8,LOGST*8,REALST*8,COEF*48,POPNAM*16
+     +   INTST*64,LOGST*8,REALST*8,COEF*48,POPNAM*16
       REAL S,COPH,HPLASY,CD,CUSE,TERMB,WT,
      +   REALVL,YLIM
       INTEGER DELETD,NN,ITAX,IVECT,ICLINE,ICBEG,ICEND,NPOS,NCENT,
@@ -60,10 +60,10 @@
      +     LOGST/'COPHEN','PLASOUT','PLOT','END'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
       IF (NOCOEF .EQ. 1) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
   1   CONTINUE
@@ -89,28 +89,28 @@
       PLOT=LOGVL(3)
 
       IF (NCOEF.LE.0 .OR. NCOEF.GE.14) THEN
-         WRITE (2,301) INTST(1),NCOEF
+         WRITE (6,301) INTST(1),NCOEF
          IERROR=1
       ENDIF
       IF (NALGOR.LE.0 .OR. NALGOR.GE.5) THEN
-         WRITE (2,301) INTST(2),NALGOR
+         WRITE (6,301) INTST(2),NALGOR
          IERROR=1
       ENDIF
       IF (YLIM.LT.0.) THEN
-         WRITE (2,302) YLIM
+         WRITE (6,302) YLIM
          IERROR=1
       ENDIF
       IF (IERROR.EQ.1) GO TO 1
 
       CALL PAGSKP
       IF (NALGOR.EQ.1) THEN
-         WRITE (2,201)
+         WRITE (6,201)
       ELSE IF (NALGOR.EQ.2) THEN
-         WRITE (2,202)
+         WRITE (6,202)
       ELSE IF (NALGOR.EQ.3) THEN
-         WRITE (2,203)
+         WRITE (6,203)
       ELSE IF (NALGOR.EQ.4) THEN
-         WRITE (2,204)
+         WRITE (6,204)
       ENDIF
 
 *  Get input matrix:
@@ -120,7 +120,7 @@
          IF (MATFIL(J).EQ.NCOEF) GO TO 10
             READ (15)
 500   CONTINUE
-      WRITE (2,303) NCOEF,COEF(NCOEF)
+      WRITE (6,303) NCOEF,COEF(NCOEF)
       GO TO 1
  10   READ (15) ((S(I,J),I=J,NOTU),J=1,NOTU)
 
@@ -135,7 +135,7 @@
       ELSE
          NH=1
       ENDIF
-      WRITE (2,205) COEF(NCOEF)
+      WRITE (6,205) COEF(NCOEF)
 
       DO 503 I=1,NOTU
          DELETD(I)=0
@@ -172,7 +172,7 @@
                ITAX(NPAIR,2)=J
                CD(NPAIR)=S(I,J)
                DELETD(J)=2
-               WRITE (2,206) (ITAX(NPAIR,K),K=1,2),CD(NPAIR),ITER
+               WRITE (6,206) (ITAX(NPAIR,K),K=1,2),CD(NPAIR),ITER
             ENDIF
          ENDIF
 506   CONTINUE
@@ -210,13 +210,13 @@
 
       NPHOLD=NPAIR+1
       IF (NPHOLD.LT.NOTU) GO TO 13
-      WRITE (2,207)
+      WRITE (6,207)
       CALL COPHMT (POPNAM,S,COPH,HPLASY,CD,ITAX,INAME,
      +   COPHEN,NPLASY,NCOEF,MHLFMT,MT)
       CALL TRPRIN (NH,0,PATHLF,PDSUM,LINKED,POPNAM,TERMB,ITAX,
      +   CD,CUSE,IVECT,ICLINE,ICBEG,ICEND,NPOS,NCENT,
      +   NLINE,NORDER,MT)
-      IF (PLOT) WRITE (2,*)
+      IF (PLOT) WRITE (6,*)
      +   'NOTE: This version of BIOSYS does not support plotting'
       GO TO 1
 *
--- ../orgsrc/DATA.FOR	2009-01-31 23:04:29.596000000 -0500
+++ DATA.FOR	2009-01-31 22:13:46.786000000 -0500
@@ -44,7 +44,7 @@
 *  all subsequent steps.
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,CG1,CG2,
-     +   LETTER,POPNAM*16,POPNUM*4,CMG1,CMG2,CNA,INTST*8,
+     +   LETTER,POPNAM*16,POPNUM*4,CMG1,CMG2,CNA,INTST*64,
      +   REALST*8,LOGST*8,LOCNAM*5,NUM*4
       REAL FREQ,FREQ2,FRQHOM,Q,TFREQ,ZERO
       INTEGER NOBS,MINI,MAXI,N,MAXIT,MINA,MAXA,NSMPL,MINI2,MAXI2,N2,
@@ -69,7 +69,7 @@
      +   LOGST/'CHECKSUM','RUNCOND','PRINT','ALPHA','NUMER','CORR'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       IREC=0
       NORUN=.FALSE.
       K=0
@@ -102,15 +102,15 @@
 
       IERROR=0
       IF (DATYP.LE.0 .OR. DATYP.GE.4) THEN
-         WRITE (2,300) INTST(1),DATYP
+         WRITE (6,300) INTST(1),DATYP
          IERROR=1
       ENDIF
       IF (NCOL.GT.MCOM) THEN
-         WRITE (2,301)
+         WRITE (6,301)
          IERROR=1
       ENDIF
       IF (DATYP.NE.1 .AND. NCOL.LE.0.) THEN
-         WRITE (2,302)
+         WRITE (6,302)
          IERROR=1
       ENDIF
       IF (IERROR.EQ.1) STOP
@@ -122,26 +122,26 @@
       IF (DATYP .NE. 3) REWIND 18
 
       IF (DATYP.EQ.1) THEN
-         WRITE (2,201)
+         WRITE (6,201)
       ELSE IF (DATYP.EQ.2) THEN
-         WRITE (2,202)
+         WRITE (6,202)
       ELSE IF (DATYP.EQ.3) THEN
-         WRITE (2,203)
-         IF (NOCORR) WRITE (2,204)
+         WRITE (6,203)
+         IF (NOCORR) WRITE (6,204)
       ENDIF
       IF (ALPHA) THEN
-         WRITE (2,206)
+         WRITE (6,206)
       ELSE
-         WRITE (2,205)
+         WRITE (6,205)
       ENDIF
       IF (CHKSUM) THEN
-         WRITE (2,207)
-         IF (RNCOND) WRITE (2,208)
+         WRITE (6,207)
+         IF (RNCOND) WRITE (6,208)
       ENDIF
-      IF (NOPRIN) WRITE (2,209)
-      WRITE (2,210)
+      IF (NOPRIN) WRITE (6,209)
+      WRITE (6,210)
 
-      READ (1,100) FMT
+      READ (5,100) FMT
 
 *  Array initialization:
 
@@ -176,7 +176,7 @@
 *  New population data:
 
       K=K+1
-      READ (1,101) POPNUM(K),POPNAM(K),(KHIER(K,NH),NH=1,3),IGRP(K)
+      READ (5,101) POPNUM(K),POPNAM(K),(KHIER(K,NH),NH=1,3),IGRP(K)
       IF (DATYP.LE.2) THEN
          IF (DATYP.EQ.1) THEN
 
@@ -184,9 +184,9 @@
 
  12         CONTINUE
             IF (NUMER) THEN
-               READ (1,FMT,ERR=30) NUM,(NG1(J),NG2(J),J=1,NLOC)
+               READ (5,FMT,ERR=30) NUM,(NG1(J),NG2(J),J=1,NLOC)
             ELSE
-               READ (1,FMT,ERR=30) NUM,(CG1(J),CG2(J),J=1,NLOC)
+               READ (5,FMT,ERR=30) NUM,(CG1(J),CG2(J),J=1,NLOC)
             ENDIF
             IF (NUM.NE.'NEXT') THEN
                DO 505 J=1,NLOC
@@ -225,10 +225,10 @@
 
             DO 506 J=1,NLOC
                IF (NUMER) THEN
-                  READ (1,FMT,ERR=30) (MG1(NC),MG2(NC),NIND(NC),
+                  READ (5,FMT,ERR=30) (MG1(NC),MG2(NC),NIND(NC),
      +               NC=1,NCOL)
                ELSE
-                  READ (1,FMT,ERR=30) (CMG1(NC),CMG2(NC),NIND(NC),
+                  READ (5,FMT,ERR=30) (CMG1(NC),CMG2(NC),NIND(NC),
      +               NC=1,NCOL)
                ENDIF
                DO 507 NC=1,NCOL
@@ -271,7 +271,7 @@
             TWONJ=2*NJ
 
             IF (NJ.LE.0) THEN
-               WRITE (2,303) J,LOCNAM(J),POPNAM(K),POPNUM(K)
+               WRITE (6,303) J,LOCNAM(J),POPNAM(K),POPNUM(K)
                STOP
             ENDIF
             DO 509 I1=MINIJ,MAXIJ
@@ -301,9 +301,9 @@
 
          DO 512 J=1,NLOC
             IF (NUMER) THEN
-               READ (1,FMT,ERR=30) N(J),(NA(NC),Q(NC),NC=1,NCOL)
+               READ (5,FMT,ERR=30) N(J),(NA(NC),Q(NC),NC=1,NCOL)
             ELSE
-               READ (1,FMT,ERR=30) N(J),(CNA(NC),Q(NC),NC=1,NCOL)
+               READ (5,FMT,ERR=30) N(J),(CNA(NC),Q(NC),NC=1,NCOL)
             ENDIF
             MINIJ=999
             MAXIJ=0
@@ -343,7 +343,7 @@
                   SUM=SUM+TFREQ(I)
 514            CONTINUE
                IF (ABS(SUM-1.).GT.ZERO) THEN
-                  WRITE (2,304) LOCNAM(J),POPNAM(K),POPNUM(K)
+                  WRITE (6,304) LOCNAM(J),POPNAM(K),POPNUM(K)
                   NORUN=.TRUE.
                ENDIF
             ENDIF
@@ -402,43 +402,43 @@
          NCOL=NCOL-1
       ENDIF
       CALL PAGSKP
-      WRITE (2,211) K1,K2
-      WRITE (2,212) ('--------',K=K1,K2)
+      WRITE (6,211) K1,K2
+      WRITE (6,212) ('--------',K=K1,K2)
       NCOLS=K2-K1+1
       FMT='(7X,  (4X),''Population'')'
       WRITE (FMT(5:6),'(I2)') NCOLS-1
-      WRITE (2,FMT)
-      WRITE (2,213) ('--------',K=K1+1,K2)
-      WRITE (2,214) (K,K=K1,K2)
-      WRITE (2,212) ('--------',K=K1,K2)
+      WRITE (6,FMT)
+      WRITE (6,213) ('--------',K=K1+1,K2)
+      WRITE (6,214) (K,K=K1,K2)
+      WRITE (6,212) ('--------',K=K1,K2)
       REWIND 16
       DO 519 J=1,NLOC
          READ (16) FREQ2,MINI2,MAXI2,N2
-         WRITE (2,215) LOCNAM (J),(N2(K),K=K1,K2)
+         WRITE (6,215) LOCNAM (J),(N2(K),K=K1,K2)
          MAXITJ=MAXIT(J)
          DO 520 I=1,MAXITJ
             IF (NUMER) THEN
-               WRITE (2,217) I,(FREQ2(I,K),K=K1,K2)
+               WRITE (6,217) I,(FREQ2(I,K),K=K1,K2)
             ELSE
-               WRITE (2,216) LETTER(I),(FREQ2(I,K),K=K1,K2)
+               WRITE (6,216) LETTER(I),(FREQ2(I,K),K=K1,K2)
             ENDIF
 520      CONTINUE
 519   CONTINUE
-      WRITE (2,212) ('--------',K=K1,K2)
-      WRITE (2,218)
+      WRITE (6,212) ('--------',K=K1,K2)
+      WRITE (6,218)
       IF (K2.NE.NOTU) THEN
          K1=K1+NCOL
          GO TO 28
       ENDIF
-      WRITE (2,219)
+      WRITE (6,219)
       DO 521 K=1,NOTU
-         WRITE (2,220) POPNUM(K),K,POPNAM(K)
+         WRITE (6,220) POPNUM(K),K,POPNAM(K)
 521   CONTINUE
-      WRITE (2,221)
+      WRITE (6,221)
       IF (RNCOND .AND. NORUN) STOP
       RETURN
 
- 30   WRITE (2,305) K,J
+ 30   WRITE (6,305) K,J
       STOP
 
 100   FORMAT (A80)
@@ -510,7 +510,7 @@
 C     LETNUM=ICHAR(ALLDES)
 C     IF (LETNUM.LT.193 .OR. LETNUM.GT.233) THEN
 C        IERR=1
-C        WRITE (2,300) ALLDES
+C        WRITE (6,300) ALLDES
 C     ELSE IF (LETNUM.LE.201) THEN
 C        LETNUM=LETNUM-192
 C     ELSE IF (LETNUM.LE.217) THEN
@@ -524,7 +524,7 @@
 C     LETNUM=ICHAR(ALLDES)-32
 C     IF (LETNUM.LT.1 .OR. LETNUM.GT.26) THEN
 C        IERR=1
-C        WRITE (2,300) ALLDES
+C        WRITE (6,300) ALLDES
 C     ENDIF
 *------------- End CDC default collating sequence -------------*
 
@@ -532,7 +532,7 @@
       LETNUM=ICHAR(ALLDES)-64
       IF (LETNUM.LT.1 .OR. LETNUM.GT.26) THEN
          IERR=1
-         WRITE (2,300) ALLDES
+         WRITE (6,300) ALLDES
       ENDIF
 *----------------------- End ASCII ----------------------------*
 
@@ -540,7 +540,7 @@
 C     LETNUM=ICHAR(ALLDES)-192
 C     IF (LETNUM.LT.1 .OR. LETNUM.GT.26) THEN
 C        IERR=1
-C        WRITE (2,300) ALLDES
+C        WRITE (6,300) ALLDES
 C     ENDIF
 *----------------------- End PRIME ----------------------------*
 
@@ -563,12 +563,12 @@
 
       IF (IERR.NE.1) THEN
          IF (NLET.EQ.1) THEN
-            WRITE (2,300) LETTER(IVAL)
+            WRITE (6,300) LETTER(IVAL)
          ELSE
-            WRITE (2,301) IVAL
+            WRITE (6,301) IVAL
          ENDIF
       ENDIF
-      WRITE (2,302) J,LOCNAM(J),POPNAM(K)
+      WRITE (6,302) J,LOCNAM(J),POPNAM(K)
       STOP
 
 300   FORMAT (' ERROR: Allele "',A1,'" greater than nall.')
--- ../orgsrc/DISTRIB.FOR	2009-01-31 23:04:31.061000000 -0500
+++ DISTRIB.FOR	2009-01-31 22:13:46.906000000 -0500
@@ -24,7 +24,7 @@
      +    SMGX2,EDJX2,IHIER,HNUM,NDIST,POPNAM,MA,MT)
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,LETTER,
-     +   JLINE*61,INTST*8,REALST*8,LOGST*8,COEF*48,POPNAM*16,HNAME*10
+     +   JLINE*61,INTST*64,REALST*8,LOGST*8,COEF*48,POPNAM*16,HNAME*10
       REAL JXY,DSING,DROG1,DROG2,DARC,DCHORD,DPREV,DEDW,SROG,IUNB,
      +   DUNB,IDEN,DIST,DMINUN,DMIN,JX,GX,SMJX2,SMGX2,EDJX2,FREQ2,
      +   YLAB,INTRVL,REALVL
@@ -49,9 +49,9 @@
       DATA INTST/'COEF'/,LOGST/'END'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       IF (NOHIER.NE.0) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
 
@@ -67,12 +67,12 @@
       IF (LOGVL(1)) RETURN
       NCOEF=INTVL(1)
       IF (NCOEF.LE.0 .OR. NCOEF.GE.14) THEN
-         WRITE (2,301) NCOEF
+         WRITE (6,301) NCOEF
          GO TO 2
       ENDIF
 
       IF (NCOEF .EQ. 2 .OR. NCOEF .EQ. 4) THEN
-         WRITE (2,302)
+         WRITE (6,302)
          GO TO 2
       ENDIF
 
@@ -133,7 +133,7 @@
 *  Histogram output:
 
       CALL PAGSKP
-      WRITE (2,201) COEF(NCOEF)
+      WRITE (6,201) COEF(NCOEF)
       PERC=0.
       DO 509 I=1,10
          PERC=PERC+10.
@@ -141,7 +141,7 @@
 509   CONTINUE
       DO 510 L=1,NLEVP1
          LSUML=LSUM(L)*NLOC
-         WRITE (2,202) HNAME(L),LSUML
+         WRITE (6,202) HNAME(L),LSUML
 *        (Find maximum value for scaling)
          NMAX=-1
          DO 511 I=1,20
@@ -170,12 +170,12 @@
             JLINE(I:I)='+'
 513      CONTINUE
          PERC=0.
-         WRITE (2,203)
+         WRITE (6,203)
          NSPACE=NTIC*2-5
          FMT='(T7,''0.0'',10(    X,F5.1))'
          WRITE (FMT(14:17),'(I4.4)') NSPACE
-         WRITE (2,FMT) (YLAB(I),I=1,NLAB)
-         WRITE (2,204) JLINE
+         WRITE (6,FMT) (YLAB(I),I=1,NLAB)
+         WRITE (6,204) JLINE
          CU=0.
          DO 514 I=1,20
             CU=CU+INTRVL
@@ -184,19 +184,19 @@
             IF (NSTARS.NE.0) THEN
                FMT='(T8,''!'',  (''*''),T73,:,''('',F6.2,'')'')'
                WRITE (FMT(9:10),'(I2.2)') NSTARS
-               WRITE (2,FMT) PCTG
-               WRITE (2,FMT)
+               WRITE (6,FMT) PCTG
+               WRITE (6,FMT)
             ELSE
-               WRITE (2,205) PCTG
-               WRITE (2,205)
+               WRITE (6,205) PCTG
+               WRITE (6,205)
             ENDIF
-            IF (I .NE. 20) WRITE (2,206) CU
+            IF (I .NE. 20) WRITE (6,206) CU
 514      CONTINUE
-         WRITE (2,207) SCALE,JLINE
+         WRITE (6,207) SCALE,JLINE
          FMT='(T7,''0.0'',10(    X,F5.1))'
          WRITE (FMT(14:17),'(I4.4)') NSPACE
-         WRITE (2,FMT) (YLAB(I),I=1,NLAB)
-         WRITE (2,203)
+         WRITE (6,FMT) (YLAB(I),I=1,NLAB)
+         WRITE (6,203)
 510   CONTINUE
       GO TO 2
 
--- ../orgsrc/DISWAG.FOR	2009-01-31 23:04:31.931000000 -0500
+++ DISWAG.FOR	2009-01-31 22:13:47.026000000 -0500
@@ -83,7 +83,7 @@
 
       IMPLICIT INTEGER (B,X-Z)
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
-     +   INTST*8,REALST*8,LOGST*8,COEF*48,POPNAM*16
+     +   INTST*64,REALST*8,LOGST*8,COEF*48,POPNAM*16
       REAL D,P,DPHEN,HPLASY,TERMB,CD,CUSE,FITNS,M,MINDB,MI,REALVL
       INTEGER NWT,ANC,ANCTOP,ANCPRV,NTERM,NCONN,IGRP,ITAX,IVECT,ICLINE,
      +   ICBEG,ICEND,NPOS,NCENT,NLINE,NORDER,LINKED,
@@ -115,9 +115,9 @@
       IFILE=12
       JFILE=13
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       IF (NOCOEF .EQ. 1) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
       ZADD(1)=0
@@ -164,49 +164,49 @@
 
       IERROR=0
       IF (NCOEF.GT.7 .AND. NCOEF.LT.14) THEN
-         WRITE (2,201) COEF(NCOEF)
+         WRITE (6,201) COEF(NCOEF)
       ELSE
-         WRITE (2,301) INTST(1),NCOEF
+         WRITE (6,301) INTST(1),NCOEF
          IERROR=1
       ENDIF
       IF (NADD .EQ. 0) THEN
-         WRITE (2,202)
+         WRITE (6,202)
       ELSE IF (NADD.GE.1 .AND. NADD.LE.3) THEN
-         WRITE (2,203) NADD
+         WRITE (6,203) NADD
       ELSE
-         WRITE (2,301) INTST(2),NADD
+         WRITE (6,301) INTST(2),NADD
          IERROR=1
       ENDIF
       IF (NADD .EQ. 0) THEN
          IF (NFIT .EQ. 1) THEN
-            WRITE (2,204)
+            WRITE (6,204)
          ELSE IF (NFIT .EQ. 2) THEN
-            WRITE (2,205)
+            WRITE (6,205)
          ELSE IF (NFIT .EQ. 3) THEN
-            WRITE (2,206)
+            WRITE (6,206)
          ELSE
-            WRITE (2,301) INTST(3),NFIT
+            WRITE (6,301) INTST(3),NFIT
             IERROR=1
          ENDIF
 
          IF (MAXTR.LE.0 .OR. MAXTR.GE.31) THEN
-            WRITE (2,301) INTST(4),MAXTR
+            WRITE (6,301) INTST(4),MAXTR
             IERROR=1
          ELSE
-            WRITE (2,207) MAXTR
+            WRITE (6,207) MAXTR
          ENDIF
       ENDIF
-      IF (NONEG) WRITE (2,208)
+      IF (NONEG) WRITE (6,208)
       IF (NROOT .EQ. 1) THEN
-         WRITE (2,209)
+         WRITE (6,209)
       ELSE IF (NROOT .EQ. 2) THEN
-         WRITE (2,210)
+         WRITE (6,210)
       ELSE
-         WRITE (2,301) INTST(5),NROOT
+         WRITE (6,301) INTST(5),NROOT
          IERROR=1
       ENDIF
       IF (IERROR.EQ.1) RETURN
-      IF (NOOPT) WRITE (2,211)
+      IF (NOOPT) WRITE (6,211)
 
 *  Get phenetic distance matrix:
 
@@ -215,7 +215,7 @@
          IF (MATFIL(J).EQ.NCOEF) GO TO 16
             READ (15)
 501   CONTINUE
-      WRITE (2,302) NCOEF,COEF(NCOEF)
+      WRITE (6,302) NCOEF,COEF(NCOEF)
       RETURN
  16   READ (15) ((DPHEN(I,J),I=J,NOTU),J=1,NOTU)
       REWIND 15
@@ -449,7 +449,7 @@
                               CALL SWITCH (K,ANC(K),Y,X)
                               KSTART=K+1
                               NUMTR=NUMTR+1
-                              IF (STEPS) WRITE (2,212) Z,X,Y
+                              IF (STEPS) WRITE (6,212) Z,X,Y
                            ELSE
                               NTIE=1
                            ENDIF
@@ -471,19 +471,19 @@
       IF (.NOT. SICRT) THEN
          CALL CHANGE (IFILE,JFILE)
          IF (STEPS) THEN
-            WRITE (2,213)
+            WRITE (6,213)
             DO 512 I=1,NUMTR
                READ (IFILE,REC=I) ANC,D
                IF (NFIT.EQ.1) THEN
-                  WRITE (2,214) I,FITNS(I)
+                  WRITE (6,214) I,FITNS(I)
                ELSE IF (NFIT.EQ.2) THEN
-                  WRITE (2,215) I,FITNS(I)
+                  WRITE (6,215) I,FITNS(I)
                ELSE
                   R= -FITNS(I)
-                  WRITE (2,216) I,R
+                  WRITE (6,216) I,R
                ENDIF
                DO 513 J=1,NEWNOD
-                  IF (ANC(J).GT.0) WRITE (2,217) J,ANC(J)
+                  IF (ANC(J).GT.0) WRITE (6,217) J,ANC(J)
 513            CONTINUE
 512         CONTINUE
          ENDIF
@@ -839,24 +839,24 @@
 
       IF (NADD.NE.0) THEN
          NUMSTP=NODE-NOTU
-         WRITE (2,200) NUMSTP
-         WRITE (2,201) Z,X,Y
+         WRITE (6,200) NUMSTP
+         WRITE (6,201) Z,X,Y
       ELSE
          IF (NFIT.LT.2) THEN
-            WRITE (2,202) TEST
+            WRITE (6,202) TEST
          ELSE IF (NFIT.EQ.2) THEN
-            WRITE (2,203) TEST
+            WRITE (6,203) TEST
          ELSE
             R=-TEST
-            WRITE (2,204) R
+            WRITE (6,204) R
          ENDIF
-         WRITE (2,205) Z,X,Y,NTREE
+         WRITE (6,205) Z,X,Y,NTREE
       ENDIF
 
       DO 500 I=1,NODE
          IF (ANC(I).GT.0) THEN
             CALL SWITCH (I,ANC(I),BR2,BR1)
-            WRITE (2,206) BR1,BR2,P(MDEX(BR1,BR2))
+            WRITE (6,206) BR1,BR2,P(MDEX(BR1,BR2))
          ENDIF
 500   CONTINUE
       RETURN
@@ -932,24 +932,24 @@
       COMMON/PAGES/FULSKP
 
       CALL PAGSKP
-      WRITE (2,200)
-      IF (NSTOP.EQ.1) WRITE (2,201)
-      WRITE (2,202)
+      WRITE (6,200)
+      IF (NSTOP.EQ.1) WRITE (6,201)
+      WRITE (6,202)
       PDSUM=0.
       DO 500 K=1,NT2M2
          IF (ANC(K).NE.0) THEN
             CALL SWITCH (K,ANC(K),BR2,BR1)
             SEGLEN=P(MDEX(BR1,BR2))
             IF (BR1.LE.NOTU) THEN
-               WRITE (2,203) POPNAM(BR1),BR2,SEGLEN
+               WRITE (6,203) POPNAM(BR1),BR2,SEGLEN
                TERMB(BR1)=SEGLEN
             ELSE
-               WRITE (2,204) BR1,BR2,SEGLEN
+               WRITE (6,204) BR1,BR2,SEGLEN
             ENDIF
             PDSUM=PDSUM+SEGLEN
          ENDIF
 500   CONTINUE
-      WRITE (2,205)
+      WRITE (6,205)
 
 *  Print patristic distance matrix:
 
@@ -1244,14 +1244,14 @@
       ENDIF
       CALL PAGSKP
       IF (NROOT.NE.2) THEN
-         WRITE (2,200)
+         WRITE (6,200)
       ELSE
-         WRITE (2,201)
+         WRITE (6,201)
       ENDIF
-      IF (NSTOP.EQ.1) WRITE (2,202)
+      IF (NSTOP.EQ.1) WRITE (6,202)
       CALL TRPRIN (1,1,PATHLF,PDSUM,LINKED,POPNAM,TERMB,ITAX,CD,CUSE,
      +   IVECT,ICLINE,ICBEG,ICEND,NPOS,NCENT,NLINE,NORDER,MT)
-      WRITE (2,204)
+      WRITE (6,204)
       RETURN
 
 200   FORMAT (///' Wagner tree produced by rooting at midpoint of ',
@@ -1328,7 +1328,7 @@
          IF (NTERM(I).EQ.1) IFD=1
 500   CONTINUE
       IF (IFD .EQ. 0) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          NROOT=1
          RETURN
       ENDIF
@@ -1368,7 +1368,7 @@
 502   CONTINUE
       IF (NTRMFD.NE.1) THEN
          IF (NTRMFD .EQ. NTHOLD) THEN
-            WRITE (2,301)
+            WRITE (6,301)
             NROOT=1
             RETURN
          ENDIF
--- ../orgsrc/FSTAT4.FOR	2009-01-31 23:04:32.721000000 -0500
+++ FSTAT4.FOR	2009-01-31 23:12:27.800000000 -0500
@@ -32,15 +32,18 @@
 *  Subprograms required by step FSTAT: FSTAT  READER  CONVRT            *
 *                                                                       *
 *=======================================================================*
+*      PARAMETER (MXT=50, MXL=75, MXA=25, MXC=25, MXA2=MXA+MXA,
+*    +   MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
 
-      SUBROUTINE FSTAT
-     +   (FREQ2,FREQ,FRQHOM,BIGP,SMALLP,SMPSQ,FISNUM,FISDEN,FISIK,FISI,
+      SUBROUTINE FSTAT4
+     +   (FREQ2,FREQ,FRQHOM,
+     +    BIGP,SMALLP,SMPSQ,FISNUM,FISDEN,FISIK,FISI,
      +    FIS,FIT,FST,MINI,MAXI,MINI2,MAXI2,N,N2,NOBS,LOCNAM,PRES,VAR,
      +    MA,ML,MT,WGT,POPCNT,AL,BL,CL,CFJK,TJK,XFJK,FL,THETL,CAPFL,
      +    HETER)
 
       CHARACTER DATE*12,TIME*12,TITLE*72,FMT*80,LINE*80,
-     +   INTST*8,REALST*8,LOGST*8,LOCNAM*5,FISROW*8,LETTER
+     +   INTST*64,REALST*8,LOGST*8,LOCNAM*5,FISROW*8,LETTER
       REAL FREQ2,FRQHOM,BIGP,SMALLP,SMPSQ,FISNUM,FISDEN,FISIK,FISI,FIS,
      +   FIT,FST,REALVL,TOTN,D2,A,B,C,WGT,POPCNT,AL,BL,CL,
      +    CFJK,TJK,XFJK,FL,THETL,CAPFL,HETER
@@ -54,7 +57,7 @@
      +   SMPSQ(MA),FISNUM(MT),FISDEN(MT),FISIK(MT),FISI(MT),FIS(ML),
      +   FIT(ML),FST(ML),MINI(ML),MAXI(ML),MINI2(MT),MAXI2(MT),N(ML),
      +   N2(MT),NOBS(MA,MA,ML),PRES(MA),VAR(ML),FISROW(15),INTVL(1),
-     +   REALVL(1),LOGVL(1),WGT(MT),POPCNT(ML),AL(ML),BL(ML),CL(ML),
+     +   REALVL(1),LOGVL(4),WGT(MT),POPCNT(ML),AL(ML),BL(ML),CL(ML),
      +   CFJK(ML),TJK(ML),XFJK(ML),FL(ML),THETL(ML),CAPFL(ML),
      +   HETER(MA,ML)
       LOGICAL FULSKP
@@ -62,9 +65,9 @@
       DATA INTST/'OUTPUT'/,LOGST/'END','UNWT','NEI','WEIR'/
       DATA ZERO/1.E-6/,UNDEF/99.E9/
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       IF (NDATYP .EQ. 3) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
       INTVL(1)=2
@@ -81,25 +84,25 @@
       WEIR=LOGVL(4)
       IF(WEIR) NEI=.TRUE.
       IF (OUTPUT.LE.0 .OR. OUTPUT.GE.4) THEN
-         WRITE (2,301) OUTPUT
+         WRITE (6,301) OUTPUT
          RETURN
       ENDIF
       OUT1=.TRUE.
       OUT2=.TRUE.
       IF (OUTPUT.LT.2) THEN
-         WRITE (2,201)
+         WRITE (6,201)
       ELSE IF (OUTPUT.EQ.2) THEN
-         WRITE (2,202)
+         WRITE (6,202)
          OUT1=.FALSE.
       ELSE IF (OUTPUT.GT.2) THEN
-         WRITE (2,203)
+         WRITE (6,203)
          OUT1=.FALSE.
          OUT2=.FALSE.
       ENDIF
 
-      IF (UNWT) WRITE (2,226)
-      IF (.NOT.UNWT) WRITE (2,225)
-      IF (WEIR) WRITE (2,227)
+      IF (UNWT) WRITE (6,226)
+      IF (.NOT.UNWT) WRITE (6,225)
+      IF (WEIR) WRITE (6,227)
 
       FISTOT=0.
       FITTOT=0.
@@ -197,7 +200,7 @@
             I2=NOTU
             GO TO 11
          ENDIF
-         WRITE (2,205) LOCNAM(J)
+         WRITE (6,205) LOCNAM(J)
          NCOL=15
          IF (CRT) NCOL=9
          I1=1
@@ -207,17 +210,17 @@
             I2=I2-1
             NCOL=NCOL-1
          ENDIF
-         WRITE (2,206) ('--------',I=I1,I2)
+         WRITE (6,206) ('--------',I=I1,I2)
          NCOLS=I2-I1+1
          NSKIPS=NCOLS-1
          FMT='(6X,  (4X),''Subpopulation'')'
          WRITE (FMT(5:6),'(I2)') NSKIPS
-         WRITE (2,FMT)
+         WRITE (6,FMT)
          I1P1=I1+1
-         WRITE (2,207) ('--------',I=I1P1,I2)
+         WRITE (6,207) ('--------',I=I1P1,I2)
 
-         WRITE (2,208) (I,I=I1,I2)
-         WRITE (2,206) ('--------',I=I1,I2)
+         WRITE (6,208) (I,I=I1,I2)
+         WRITE (6,206) ('--------',I=I1,I2)
  11      DO 504 K=1,NALL
             IF (PRES(K)) THEN
                SPK=0.
@@ -262,22 +265,22 @@
                IF (OUT1) THEN
                   CALL CONVRT (FISIK,FISROW,I1,I2,MT)
                   IF (NLET.NE.0) THEN
-                     WRITE (2,209) LETTER(K),(FISROW(I),I=1,NCOLS)
+                     WRITE (6,209) LETTER(K),(FISROW(I),I=1,NCOLS)
                      GO TO 504
                   ENDIF
-                  WRITE (2,210) K,(FISROW(I),I=1,NCOLS)
+                  WRITE (6,210) K,(FISROW(I),I=1,NCOLS)
                ENDIF
             ENDIF
 504      CONTINUE
          IF (OUT1) THEN
-            WRITE (2,206) ('--------',I=I1,I2)
+            WRITE (6,206) ('--------',I=I1,I2)
             DO 506 I=I1,I2
                FISI(I)=FISNUM(I)/FISDEN(I)
 506         CONTINUE
             CALL CONVRT (FISI,FISROW,I1,I2,MT)
-            WRITE (2,211) (FISROW(I),I=1,NCOLS)
-            WRITE (2,206) ('--------',I=I1,I2)
-            WRITE (2,212)
+            WRITE (6,211) (FISROW(I),I=1,NCOLS)
+            WRITE (6,206) ('--------',I=I1,I2)
+            WRITE (6,212)
             IF (I2.NE.NOTU) THEN
                I1=I1+NCOL
                GO TO 9
@@ -286,7 +289,7 @@
 
 *        F(is), F(it), and F(st) for individual alleles:
          IF (WEIR) GO TO 550
-         IF (OUT2) WRITE (2,213) LOCNAM(J)
+         IF (OUT2) WRITE (6,213) LOCNAM(J)
          FISJ=0.
          FITJ=0.
          FSTJ=0.
@@ -324,16 +327,16 @@
                IF (OUT2) THEN
                   IF (FISK .EQ. UNDEF) THEN
                      IF (NLET.NE.0) THEN
-                           WRITE (2,214) LETTER(K),FSTK,FITK
+                           WRITE (6,214) LETTER(K),FSTK,FITK
                            GO TO 507
                      ENDIF
-                     WRITE (2,215) K,FSTK,FITK
+                     WRITE (6,215) K,FSTK,FITK
                      GO TO 507
                   ENDIF
                   IF (NLET.NE.0) THEN
-                      WRITE (2,216) LETTER(K),FISK,FSTK,FITK
+                      WRITE (6,216) LETTER(K),FISK,FSTK,FITK
                   ELSE
-                      WRITE (2,217) K,FISK,FSTK,FITK
+                      WRITE (6,217) K,FISK,FSTK,FITK
                   ENDIF
                ENDIF
             ENDIF
@@ -355,9 +358,9 @@
          FST(J)=FSTJ
          IF (OUT2) THEN
             IF (FISJ .EQ. UNDEF) THEN
-               WRITE (2,218) FSTJ,FITJ
+               WRITE (6,218) FSTJ,FITJ
             ELSE
-               WRITE (2,219) FISJ,FSTJ,FITJ
+               WRITE (6,219) FISJ,FSTJ,FITJ
             ENDIF
          ENDIF
       IF(.NOT.WEIR) GO TO 500
@@ -365,7 +368,7 @@
 C     Calculations for Weir and Cockerham's method.
 
  550  SUMALV=0.0                                                       
-      IF (OUT2) WRITE (2,213) LOCNAM(J)
+      IF (OUT2) WRITE (6,213) LOCNAM(J)
       DO 1930 IWB=1,NALL                                              
       IF(SMALLP(IWB).EQ.0.0) GO TO 1930                                
       ALLVAR=0.0                                                       
@@ -407,16 +410,16 @@
   555    IF (OUT2) THEN
             IF (FA .EQ. UNDEF) THEN
                IF (NLET.NE.0) THEN
-                  WRITE(2,214) LETTER(IWB),THETA,CAPFA
+                  WRITE(6,214) LETTER(IWB),THETA,CAPFA
                      GO TO 1930
                ENDIF
-                  WRITE(2,215)IWB,FA,THETA,CAPFA
+                  WRITE(6,215)IWB,FA,THETA,CAPFA
                      GO TO 1930
             ENDIF
                IF (NLET.NE.0) THEN
-                  WRITE (2,216) LETTER(IWB),FA,THETA,CAPFA
+                  WRITE (6,216) LETTER(IWB),FA,THETA,CAPFA
                ELSE
-                  WRITE(2,217)IWB,FA,THETA,CAPFA
+                  WRITE(6,217)IWB,FA,THETA,CAPFA
                ENDIF
          ENDIF
  1930 CONTINUE                                                         
@@ -438,10 +441,10 @@
       POPC=CL(J)+POPC
         IF (OUT2) THEN
          IF(FL(J).EQ.UNDEF) THEN                                                  
-            WRITE(2,218)THETL(J),CAPFL(J)                       
+            WRITE(6,218)THETL(J),CAPFL(J)                       
             CALL PAGSKP
          ELSE 
-            WRITE(2,219)FL(J),THETL(J),CAPFL(J)
+            WRITE(6,219)FL(J),THETL(J),CAPFL(J)
          ENDIF
         ENDIF
       CALL PAGSKP
@@ -456,20 +459,20 @@
 *  Summary table:
       IF(WEIR) GO TO 560
       CALL PAGSKP
-      WRITE (2,220)
+      WRITE (6,220)
       DO 508 J=1,NLOC
          IF (VAR(J)) THEN
             IF (FIS(J) .EQ. UNDEF) THEN
-               WRITE (2,221) LOCNAM(J),FST(J),FIT(J)
+               WRITE (6,221) LOCNAM(J),FST(J),FIT(J)
             ELSE
-               WRITE (2,222) LOCNAM(J),FIS(J),FST(J),FIT(J)
+               WRITE (6,222) LOCNAM(J),FIS(J),FST(J),FIT(J)
             ENDIF
          ENDIF
 508   CONTINUE
       FISBAR=FISTOT/DN1TOT
       FITBAR=FITTOT/DN2TOT
       FSTBAR=FSTTOT/DN2TOT
-      WRITE (2,223) FISBAR,FSTBAR,FITBAR
+      WRITE (6,223) FISBAR,FSTBAR,FITBAR
       IF(.NOT.WEIR) RETURN
 
 C     JACKKNIFE PROCEDURE TO CALCULATE THE VARIANCE IN F-STATISTICS    
@@ -514,17 +517,17 @@
       CALL PAGSKP
 C                                                                      
 C     PRINT TABLE OF F-STATISTICS (WEIR & COCKERHAM)                   
-      WRITE(2,220)                                                    
+      WRITE(6,220)                                                    
       DO 2100 IXFW=1,NLOC                                              
       IF(POPCNT(IXFW).LE.1)GO TO 2100
          IF(FL(IXFW).EQ.UNDEF) THEN
-           WRITE(2,221)LOCNAM(IXFW),THETL(IXFW),CAPFL(IXFW)                                                      
+           WRITE(6,221)LOCNAM(IXFW),THETL(IXFW),CAPFL(IXFW)                                                      
          ELSE
-           WRITE(2,222)LOCNAM(IXFW),FL(IXFW),THETL(IXFW),CAPFL(IXFW)                                                      
+           WRITE(6,222)LOCNAM(IXFW),FL(IXFW),THETL(IXFW),CAPFL(IXFW)                                                      
          ENDIF
  2100 CONTINUE
-      WRITE(2,230)FP,THETP,CAPFP                                                         
-      WRITE(2,231)AFIS,ATHT,ACAP,SDFJK,SDTHT,SDCAP                    
+      WRITE(6,230)FP,THETP,CAPFP                                                         
+      WRITE(6,231)AFIS,ATHT,ACAP,SDFJK,SDTHT,SDCAP                    
       RETURN
 
 200   FORMAT (//////T3,76('*')/T3,'*',T78,'*'/T3,'*',2X,A72,
@@ -591,4 +594,3 @@
 500   CONTINUE
       RETURN
       END
-
--- ../orgsrc/HDYWBG.FOR	2009-01-31 23:04:33.450000000 -0500
+++ HDYWBG.FOR	2009-01-31 22:13:47.257000000 -0500
@@ -38,7 +38,7 @@
 *  calculates coefficients for deficiency or excess of heterozygotes
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,LETTER,
-     +   POPNAM*16,POPNUM*4,INTST*8,REALST*8,LOGST*8,LOCNAM*5
+     +   POPNAM*16,POPNUM*4,INTST*64,REALST*8,LOGST*8,LOCNAM*5
       DOUBLE PRECISION LGFACT,LOGFCT,LOGFAC,DENOM
       REAL FREQ,EXPHET,UNCEXP,REALVL
       INTEGER MINI,MAXI,N,NOBS,OBSHET,MAXCOM,JPOOL,
@@ -59,9 +59,9 @@
      +   INTST/'ZZZ'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       IF (NDATYP .EQ. 3) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
 
@@ -78,15 +78,15 @@
       NOPOOL=LOGVL(3)
       EXACTP=LOGVL(4)
 
-      IF (LEVENE) WRITE (2,201)
-      IF (YATES) WRITE (2,202)
-      IF (NOPOOL) WRITE (2,203)
+      IF (LEVENE) WRITE (6,201)
+      IF (YATES) WRITE (6,202)
+      IF (NOPOOL) WRITE (6,203)
       IF (EXACTP) NOPOOL=.FALSE.
       REWIND 17
       REWIND 18
       DO 501 K=1,NOTU
          CALL PAGSKP
-         WRITE (2,204) POPNAM(K),POPNUM(K)
+         WRITE (6,204) POPNAM(K),POPNUM(K)
          READ (17) FREQ,MINI,MAXI,N
          READ (18) NOBS
          KPOLY=0
@@ -98,8 +98,8 @@
             JPOOL(J)=0
             IF (MINI(J).NE.MAXI(J)) THEN
                KPOLY=KPOLY+1
-               IF (KPOLY.EQ.1) WRITE (2,205)
-               WRITE (2,206) LOCNAM(J)
+               IF (KPOLY.EQ.1) WRITE (6,205)
+               WRITE (6,206) LOCNAM(J)
                NALLS=0
                MAXFRQ=0
                CHISQ=0.
@@ -149,16 +149,16 @@
                         ENDIF
                         CHISQ=CHISQ+CALC
                         IF (NLET.EQ.1) THEN
-                           WRITE (2,208) LETTER(I1),LETTER(I2),OBS,EXP
+                           WRITE (6,208) LETTER(I1),LETTER(I2),OBS,EXP
                         ELSE
-                           WRITE (2,207) I1,I2,OBS,EXP
+                           WRITE (6,207) I1,I2,OBS,EXP
                         ENDIF
 504                  CONTINUE
                   ENDIF
 503            CONTINUE
                IDF=NALLS*(NALLS-1)/2
                P=1.-FCHSQ(CHISQ,IDF)
-               WRITE (2,209) CHISQ,IDF,P
+               WRITE (6,209) CHISQ,IDF,P
                IF (NALLS.GE.3) THEN
                   KPOOL=1
                   JPOOL(J)=1
@@ -166,16 +166,16 @@
             ENDIF
 502      CONTINUE
          IF (KPOLY.LE.0) THEN
-            WRITE (2,210)
+            WRITE (6,210)
             GO TO 501
          ENDIF
-         WRITE (2,211)
+         WRITE (6,211)
          IF (KPOOL.NE.0 .AND. .NOT. NOPOOL) THEN
 
 *           With pooling:
 
             CALL PAGSKP
-            WRITE (2,212) POPNAM(K),POPNUM(K)
+            WRITE (6,212) POPNAM(K),POPNUM(K)
             DO 505 J=1,NLOC
                IF (JPOOL(J).EQ.1) THEN
                   MINIJ=MINI(J)
@@ -220,19 +220,19 @@
                      CHISQ= D1*D1/EXP1 + D2*D2/EXP2 + D3*D3/EXP3
                      P=1.-FCHSQ(CHISQ,IDF)
                   ENDIF
-                  WRITE (2,213) LOCNAM(J),OBS1,EXP1
-                  WRITE (2,214) OBS2,EXP2
-                  WRITE (2,215) OBS3,EXP3,CHISQ,IDF,P
+                  WRITE (6,213) LOCNAM(J),OBS1,EXP1
+                  WRITE (6,214) OBS2,EXP2
+                  WRITE (6,215) OBS3,EXP3,CHISQ,IDF,P
                ENDIF
 505         CONTINUE
-            WRITE (2,216)
+            WRITE (6,216)
          ENDIF
          IF (EXACTP) THEN
 
 *           Calculation of exact P-values using binomial expectations:
 
             CALL PAGSKP
-            WRITE (2,217) POPNAM(K),POPNUM(K)
+            WRITE (6,217) POPNAM(K),POPNUM(K)
 
 *           Log factorial table:
 
@@ -281,14 +281,14 @@
                            GO TO 18
                         ENDIF
                      ENDIF
-                     WRITE (2,218) LOCNAM(J),R1,R2,R3,PSUM
+                     WRITE (6,218) LOCNAM(J),R1,R2,R3,PSUM
 
                   ELSE IF (4*R1*R3-R2*R2 .EQ. 0) THEN
 
 *                    Perfect fit to H-W expectations:
 
                      PSUM=1.0
-                     WRITE (2,218) LOCNAM(J),R1,R2,R3,PSUM
+                     WRITE (6,218) LOCNAM(J),R1,R2,R3,PSUM
 
                   ELSE IF (4*R1*R3-R2*R2 .GT. 0) THEN
 
@@ -311,18 +311,18 @@
                            GO TO 23
                         ENDIF
                      ENDIF
-                     WRITE (2,218) LOCNAM(J),R1,R2,R3,PSUM
+                     WRITE (6,218) LOCNAM(J),R1,R2,R3,PSUM
                   ENDIF
                ENDIF
 508         CONTINUE
-            WRITE (2,219)
+            WRITE (6,219)
          ENDIF
 
 *     Selander's "D", Wright's fixation index:
                                                    
 
          CALL PAGSKP
-         WRITE (2,220) POPNAM(K),POPNUM(K)
+         WRITE (6,220) POPNAM(K),POPNUM(K)
          DO 512 J=1,NLOC
             IF (MINI(J).NE.MAXI(J)) THEN
               IF(N(J).EQ.0)GO TO 512                                     
@@ -352,10 +352,10 @@
                  CHISC=ANUMER/DENOM                                                
                      IDF=1                                                             
                      P=1.-FCHSQ(CHISC,IDF)
-               WRITE (2,221) LOCNAM(J),HOBS,HEXP,F,D,CHISC,P
+               WRITE (6,221) LOCNAM(J),HOBS,HEXP,F,D,CHISC,P
             ENDIF
 512      CONTINUE
-         WRITE (2,222)
+         WRITE (6,222)
 501   CONTINUE
       RETURN
 
@@ -460,4 +460,3 @@
 500   CONTINUE
       RETURN
       END
-
--- ../orgsrc/HETXSQ.FOR	2009-01-31 23:04:34.175000000 -0500
+++ HETXSQ.FOR	2009-01-31 22:13:47.371000000 -0500
@@ -25,7 +25,7 @@
      +    OBS,CALC,POPNAM,NAME,IHIER,HNUM,MA,ML,MT)
 
       CHARACTER LINE*80,DUM,DATE*12,TIME*12,TITLE*72,FMT*80,NAME*16,
-     +   LETTER,INTST*8,REALST*8,LOGST*8,LOCNAM*5,POPNAM*16,HNAME*10
+     +   LETTER,INTST*64,REALST*8,LOGST*8,LOCNAM*5,POPNAM*16,HNAME*10
       REAL FREQ2,OBSUM,EXP,OBS,CALC,REALVL
       INTEGER MINI2,MAXI2,N2,NUMALL,IHIER,HNUM,SUBDIV
       LOGICAL IPRES,SUB,CONTAB,LOGVL,CRT
@@ -43,7 +43,7 @@
       DATA INTST/'SUBDIV'/,LOGST/'CONTAB','END'/,ZERO/1.E-6/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
 *  Defaults:
 
@@ -59,13 +59,13 @@
       SUB=SUBDIV.NE.0
       IF (SUB) THEN
          IF (NOHIER.NE.0) THEN
-            WRITE (2,300)
+            WRITE (6,300)
             RETURN
          ENDIF
          REWIND 14
          READ (14) IHIER,HNUM,NAME
          IF (SUBDIV.GT.NLEVEL) THEN
-            WRITE (2,301) NLEVEL
+            WRITE (6,301) NLEVEL
             RETURN
          ENDIF
          NCYC=NHIER(SUBDIV)
@@ -77,7 +77,7 @@
                IF (IHIER(HNUM(K),SUBDIV).EQ.ICYC) NPOPS=NPOPS+1
 501         CONTINUE
             IF (NPOPS.LE.1) THEN
-               WRITE (2,201) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
+               WRITE (6,201) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
                GO TO 500
             ENDIF
          ENDIF
@@ -125,25 +125,25 @@
 505                  CONTINUE
 504               CONTINUE
                   CALL PAGSKP
-                  WRITE (2,202) LOCNAM(J)
-                  IF (SUB) WRITE (2,203) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
+                  WRITE (6,202) LOCNAM(J)
+                  IF (SUB) WRITE (6,203) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
                   NCOL=9
                   IF (CRT) NCOL=4
                   CHISQ=0.
                   I1=1
   8               I2=MIN(I1+NCOL-1,NALLS)
-                  WRITE (2,204) ('----------',II=I1,I2)
+                  WRITE (6,204) ('----------',II=I1,I2)
                   NSKIPS=(I2-I1+1)*5
                   FMT='(T35,    X,''Allele'')'
                   WRITE (FMT(6:9),'(I4)') NSKIPS
-                  WRITE (2,FMT)
-                  WRITE (2,205) ('----------',II=I1,I2)
+                  WRITE (6,FMT)
+                  WRITE (6,205) ('----------',II=I1,I2)
                   IF (NLET.NE.1) THEN
-                     WRITE (2,206) (NUMALL(I),I=I1,I2)
+                     WRITE (6,206) (NUMALL(I),I=I1,I2)
                   ELSE
-                     WRITE (2,207) (LETTER(NUMALL(I)),I=I1,I2)
+                     WRITE (6,207) (LETTER(NUMALL(I)),I=I1,I2)
                   ENDIF
-                  WRITE (2,208) ('----------',II=I1,I2)
+                  WRITE (6,208) ('----------',II=I1,I2)
                   DO 506 K=1,NOTU
                      IF (SUB) THEN
                         IF (IHIER(HNUM(K),SUBDIV) .NE. ICYC) GO TO 506
@@ -159,11 +159,11 @@
                         EXP(I)=EXPI
 507                  CONTINUE
 
-                     WRITE (2,209) POPNAM(K),(OBS(I),I=I1,I2)
-                     WRITE (2,210) (EXP(I),I=I1,I2)
-                     WRITE (2,211) (CALC(I),I=I1,I2)
+                     WRITE (6,209) POPNAM(K),(OBS(I),I=I1,I2)
+                     WRITE (6,210) (EXP(I),I=I1,I2)
+                     WRITE (6,211) (CALC(I),I=I1,I2)
 506               CONTINUE
-                  WRITE (2,208) ('----------',II=I1,I2)
+                  WRITE (6,208) ('----------',II=I1,I2)
                   IF (I2.NE.NALLS) THEN
                      I1=I1+NCOL
                      GO TO 8
@@ -171,7 +171,7 @@
                   IDF=(NPOPS-1)*(NALLS-1)
                   P=1.-FCHSQ(CHISQ,IDF)
                   IF (ABS(P).LT.ZERO) P=0.
-                  WRITE (2,212) CHISQ,IDF,P
+                  WRITE (6,212) CHISQ,IDF,P
                ENDIF
 502         CONTINUE
          ENDIF
@@ -181,9 +181,9 @@
          CSQSUM=0.
          IDFSUM=0
          CALL PAGSKP
-         WRITE (2,213)
-         IF (SUB) WRITE (2,203) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
-         WRITE (2,214)
+         WRITE (6,213)
+         IF (SUB) WRITE (6,203) HNAME(SUBDIV),NAME(ICYC,SUBDIV)
+         WRITE (6,214)
          REWIND 16
          DO 508 J=1,NLOC
             READ (16) FREQ2,MINI2,MAXI2,N2
@@ -230,14 +230,14 @@
                IDF=(NPOPS-1)*(NALLS-1)
                P=1.-FCHSQ(CHISQ,IDF)
                IF (ABS(P).LT.ZERO) P=0.
-               WRITE (2,215) LOCNAM(J),NALLS,CHISQ,IDF,P
+               WRITE (6,215) LOCNAM(J),NALLS,CHISQ,IDF,P
                CSQSUM=CSQSUM+CHISQ
                IDFSUM=IDFSUM+IDF
             ENDIF
 508      CONTINUE
          P=1.-FCHSQ(CSQSUM,IDFSUM)
          IF (ABS(P).LT.ZERO) P=0.
-         WRITE (2,216) CSQSUM,IDFSUM,P
+         WRITE (6,216) CSQSUM,IDFSUM,P
 500   CONTINUE
       RETURN
 
--- ../orgsrc/HIER.FOR	2009-01-31 23:04:34.875000000 -0500
+++ HIER.FOR	2009-01-31 22:13:47.506000000 -0500
@@ -31,7 +31,7 @@
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
      +   NAME*16,POPNAM*16,INAME*16,HNAME*10,
-     +   INTST*8,REALST*8,LOGST*8,LETTER
+     +   INTST*64,REALST*8,LOGST*8,LETTER
       INTEGER IHIER,KHIER,LHIER,HNUM,JHIER,INTVL
       LOGICAL NOPRIN,LOGVL
       REAL REALVL
@@ -48,7 +48,7 @@
       DATA INTST/'NLEVEL'/,LOGST/'NOPRINT'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
       NOHIER=0
 
 *  Defaults:
@@ -64,19 +64,19 @@
       NLEVEL=INTVL(1)
       NOPRIN=LOGVL(1)
       IF (NLEVEL.LE.0 .OR. NLEVEL.GE.4) THEN
-         WRITE (2,300) NLEVEL
+         WRITE (6,300) NLEVEL
          RETURN
       ENDIF
-      WRITE (2,201) NLEVEL
-      IF (NOPRIN) WRITE (2,202)
-      WRITE (2,203)
+      WRITE (6,201) NLEVEL
+      IF (NOPRIN) WRITE (6,202)
+      WRITE (6,203)
       DO 500 J=1,NLEVEL
          JHIER(J)=0
          NHIER(J)=0
 500   CONTINUE
       NLEVP1=NLEVEL+1
       DO 600 J=1,NLEVP1
-         READ (1,'(A10)') HNAME(J)
+         READ (5,'(A10)') HNAME(J)
 600   CONTINUE
       NROW=0
       NHOLD=1
@@ -84,7 +84,7 @@
 *  Get name and hierarchical level for a group:
 
   3   CONTINUE
-      READ (1,101) LINE
+      READ (5,101) LINE
       IF (LINE(1:3).NE.'END') THEN
          DO 501 JBEG=1,7,3
             IF (LINE(JBEG:JBEG) .NE. ' ') GO TO 4
@@ -135,7 +135,7 @@
             GO TO 504
 505      CONTINUE
 *        (If cycle completely through 505 loop, no match found; error)
-         WRITE (2,301) POPNAM(K)
+         WRITE (6,301) POPNAM(K)
          NOHIER=1
 504   CONTINUE
       IF (NOHIER.EQ.1) RETURN
@@ -149,7 +149,7 @@
 *  Print hierarchy and associated populations:
 
       CALL PAGSKP
-      WRITE (2,204) (HNAME(I),I=1,NLEVEL)
+      WRITE (6,204) (HNAME(I),I=1,NLEVEL)
       DO 507 I=1,NROW
          DO 508 J=1,NLEVEL
             IF (I.NE.1) THEN
@@ -157,13 +157,13 @@
             ENDIF
             FMT='(/7X,  (5X),A16)'
             WRITE (FMT(6:7),'(I2)') J
-            WRITE (2,FMT) NAME(IHIER(I,J),J)
+            WRITE (6,FMT) NAME(IHIER(I,J),J)
             IF (J.GE.NLEVEL) THEN
                DO 509 K=1,NOTU
                   IF (HNUM(K) .EQ. I) THEN
                      FMT='(/10X, (5X),A16)'
                      WRITE (FMT(7:7),'(I1)') NLEVEL
-                     WRITE (2,FMT) POPNAM(K)
+                     WRITE (6,FMT) POPNAM(K)
                   ENDIF
 509            CONTINUE
             ENDIF
--- ../orgsrc/MAIN.FOR	2009-01-31 23:04:35.632000000 -0500
+++ MAIN.FOR	2009-01-31 22:13:47.620000000 -0500
@@ -1,5 +1,5 @@
-$LARGE
-$DEBUG
+* $LARGE
+* $DEBUG
 *************************************************************************
 *                                                                       *
 *                    P R O G R A M   B I O S Y S - 2                    *
@@ -92,7 +92,7 @@
 C    +   TAPE3=OPTIN)
 
       INTEGER DWRECL,DARECL
-      LOGICAL CRT,IBM,PRIME,IBMPC
+      LOGICAL CRT,IBM,PRIME,IBMPC,GNU77
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
      +   COEF*48,WORD1*4,WORD2*4
 
@@ -104,11 +104,14 @@
 *-----------------------------------------------------------------*
 *  Parameter statement for IBM-PC large version and default
 *     mainframe dimensions:
-C     PARAMETER (MXT=50, MXL=75, MXA=25, MXC=25, MXA2=MXA+MXA,
-C    +   MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
+*      PARAMETER (MXT=50, MXL=75, MXA=25, MXC=25, MXA2=MXA+MXA,
+*     +  MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
 *  Parameter statement for IBM-PC small version:
-      PARAMETER (MXT=40, MXL=30, MXA=10, MXC=8, MXA2=MXA+MXA,
-     +   MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
+*      PARAMETER (MXT=40, MXL=30, MXA=10, MXC=8, MXA2=MXA+MXA,
+*     +   MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
+*  Parameter statement for real computers in the 21st century
+      PARAMETER (MXT=200, MXL=200, MXA=200, MXC=200, MXA2=MXA+MXA,
+     +  MXLT=MXL*MXT, MXT2=MXT+MXT, MXHLFT=MXT2*(MXT2+1)/2)
 
       LOGICAL FULSKP
       COMMON/PAGES/FULSKP
@@ -124,7 +127,7 @@
 
 *  Main program:
 
-      CHARACTER INTST(3)*8,REALST(1)*8,LOGST(2)*8
+      CHARACTER INTST(3)*64,REALST(1)*8,LOGST(2)*8
       INTEGER INTVL(3)
       REAL REALVL(1)
       LOGICAL LOGVL(2)
@@ -143,7 +146,7 @@
      +   NSMPL(MXL,MXT),INDX(MXLT)
 
 *  DATIN, VARIAB, and HDYWBG:
-
+*****
       REAL FREQ(MXA,MXL)
       INTEGER MINI(MXL),MAXI(MXL),N(MXL),NOBS(MXA,MXA,MXL)
 
@@ -152,12 +155,12 @@
       INTEGER KHIER(MXT,3)
 
 *  DATIN, SIMDIS, BOOTDIST, SINGLE, AYAGRM, HETXSQ, FSTAT, and WRIGHT:
-
+****
       REAL FREQ2(MXA,MXT)
       INTEGER MINI2(MXT),MAXI2(MXT),N2(MXT)
 
 *  DATIN and FSTAT:
-
+*****
       REAL FRQHOM(MXA,MXT)
 
 *  VARIAB:
@@ -179,6 +182,8 @@
 *  BOOTDIST:
 
       REAL BDIST(MXL,MXT,MXT),SDIST(MXT,MXT),ADIST(MXT,MXT)
+      INTEGER SEED
+      CHARACTER PHYF*50
 
 *  MATOUT,SINGLE,CLUSTER, and SIMAVE:
 
@@ -217,7 +222,7 @@
       INTEGER NTOT(MXA),NUMALL(MXA)
 
 *  FSTAT and WRIGHT:
-
+***
       LOGICAL PRES(MXA)
 
 *  FSTAT:
@@ -333,8 +338,7 @@
      +            ( NCENT(1),  DARC(1, 8)),  ( NLINE(1),  DARC(1, 9)),
      +            (NORDER(1),  DARC(1,10)),  (LINKED(1),  DARC(1,11))
 
-      DATA INTST/'NOTU','NLOC','NALL'/,LOGST/'CRT','FULLSKIP'/,
-     +    REALST/'ZZZ'/
+      DATA INTST/'NOTU','NLOC','NALL'/,LOGST/'CRT','FULLSKIP'/
 
 *--------------------------------------------------------------------*
 *  Set IBM to .TRUE. if program is to be compiled under VS-Fortran   *
@@ -354,7 +358,13 @@
 *  Set IBMPC to .TRUE. if program is to be compiled under Microsoft  *
 *  Fortran (4.01 or higher) on the IBM PC, to .FALSE. otherwise.     *
 *--------------------------------------------------------------------*
-      DATA IBMPC/.TRUE./
+      DATA IBMPC/.FALSE./
+
+*--------------------------------------------------------------------*
+*  Set GNU77 to .TRUE. if program is to be compiled under GNU        *
+*  Fortran, to .FALSE. otherwise.                                    *
+*--------------------------------------------------------------------*
+      DATA GNU77/.TRUE./
 
       IF (IBMPC) THEN
          OPEN (1, FILE=' ')
@@ -373,15 +383,16 @@
 *     MS-Fortran chokes on attempt to rewind printer or console,
 *     but the rewind isn't needed in any case.  It IS needed on
 *     some of the other systems, however.
-      IF (.NOT.IBMPC) THEN
-         REWIND 1
-         REWIND 2
-      ENDIF
+*      IF (.NOT.IBMPC) THEN
+*         REWIND 1
+*         REWIND 2
+*      ENDIF
       CALL GETDT (DATE,TIME)
       CALL PAGSKP
-      WRITE (2,200) DATE,TIME
-      READ (1,'(A72)',END=23) TITLE
-      WRITE (2,201) TITLE
+      WRITE (6,200) DATE,TIME
+      READ (5,'(A72)',END=23) TITLE
+      WRITE (6,201) TITLE
+
 
 *  Options and parameters:
 *     NOTU   = number of populations (OTU's)
@@ -391,6 +402,7 @@
 *     New option added with PC version:
 *     FULSKP : output form feed for page skips rather than just
 *              skipping a few lines
+*
 
 *  Defaults:
 
@@ -399,8 +411,9 @@
       INTVL(3)=MXA
       LOGVL(1)=.FALSE.
       LOGVL(2)=.FALSE.
-
-      CALL READER (3,0,2,INTST,REALST,LOGST,INTVL,REALVL,LOGVL,IERROR)
+      
+      CALL READER (3,0,2,INTST,REALST,LOGST,INTVL,REALVL,LOGVL,
+     +             IERROR)
       IF (IERROR.EQ.1) STOP
       NOTU=INTVL(1)
       NLOC=INTVL(2)
@@ -412,25 +425,25 @@
 
       IERROR=0
       IF (NOTU.LE.1) THEN
-         WRITE (2,300) NOTU
+         WRITE (6,300) NOTU
          IERROR=1
       ELSE IF (NOTU.GT.MXT) THEN
-         WRITE (2,301) INTST(1)
+         WRITE (6,301) INTST(1)
          IERROR=1
       ELSE IF (NLOC.LE.0) THEN
-         WRITE (2,302)
+         WRITE (6,302)
          IERROR=1
       ELSE IF (NLOC.GT.MXL) THEN
-         WRITE (2,301) INTST(2)
+         WRITE (6,301) INTST(2)
          IERROR=1
       ELSE IF (NALL.GT.MXA) THEN
-         WRITE (2,301) INTST(3)
+         WRITE (6,301) INTST(3)
          IERROR=1
       ENDIF
       IF (IERROR.EQ.1) STOP
 
-      WRITE (2,202) NOTU,NLOC,NALL
-      IF (CRT) WRITE (2,203)
+      WRITE (6,202) NOTU,NLOC,NALL
+      IF (CRT) WRITE (6,203)
 
 *  Parameters for variable dimensioning:
 
@@ -459,16 +472,20 @@
 *        ( PRIME wants RECL in 16-bit words )
          DWRECL=DWRECL*2
          DARECL=DARECL*2
+      ELSE IF (GNU77) THEN
+*        this addition was key. 
+         DWRECL=DWRECL*4
+         DARECL=DARECL*4
       ENDIF
 
 *  Locus names:
 
-      READ (1,'(A80)') FMT
-      READ (1,FMT) (LOCNAM(J),J=1,NLOC)
+      READ (5,'(A80)') FMT
+      READ (5,FMT) (LOCNAM(J),J=1,NLOC)
 
 *  Calls to "step" subroutines:
 
-  6   READ (1,101,IOSTAT=IOS) WORD1,WORD2
+  6   READ (5,101,IOSTAT=IOS) WORD1,WORD2
       IF (IOS.LT.0) STOP
       IF (WORD1 .NE. 'STEP') GO TO 6
 
@@ -522,7 +539,7 @@
      +      IVECT,ICLINE,ICBEG,ICEND,NPOS,NCENT,NLINE,
      +      NORDER,LINKED,MT,MT2,MHLFMT,ANCTOP,ANCPRV,DWRECL)
       ELSE IF (WORD2.EQ.'FSTA') THEN
-         CALL FSTAT (FREQ2,FREQ,FRQHOM,BIGP,SMALLP,SMPSQ,FISNUM,
+         CALL FSTAT4 (FREQ2,FREQ,FRQHOM,BIGP,SMALLP,SMPSQ,FISNUM,
      +    FISDEN,FISIK,FISI,FIS,FIT,FST,MINI,MAXI,MINI2,MAXI2,N,
      +    N2,NOBS,LOCNAM,PRES,VAR,MA,ML,MT,WGT,POPCNT,AL,BL,CL,
      +    CFJK,TJK,XFJK,FL,THETL,CAPFL,HETER)
@@ -530,30 +547,33 @@
          CALL WRIGHT (FREQ2,QSUM,VC,F,MINI2,MAXI2,N2,IHIER,
      +      HNUM,NSUM,PRES,LOCNAM,MA,ML,MT)
       ELSE
-         WRITE (2,303) WORD2
+         WRITE (6,303) WORD2
       ENDIF
       GO TO 6
- 23   WRITE (2,304)
+ 23   WRITE (6,304)
       STOP
 
 101   FORMAT (A4,1X,A4)
-200   FORMAT (////////T3,8('B'),T14,7('I'),T24,7('O'),T35,8('S'),
-     +T44,3('Y'),T52,3('Y'),T57,8('S'),/T3,9('B'),T14,
-     +7('I'),T23,9('O'),T34,9('S'),T45,3('Y'),T51,3('Y'),T56,9('S'),
-     +/T3,3('B'),T9,3('B'),T16,3('I'),T23,3('O'),T29,
-     +3('O'),T34,3('S'),T46,3('Y'),T50,3('Y'),T56,3('S'),/T3,
-     +3('B'),T9,3('B'),T16,3('I'),T23,3('O'),T29,3('O'),T34,3('S'),T47,
-     +5('Y'),T56,3('S'),/T3,8('B'),T16,3('I'),T23,3('O'),
-     +T29,3('O'),T34,8('S'),T48,3('Y'),T56,8('S'),
-     +/T3,8('B'),T16,3('I'),T23,3('O'),T29,3('O'),T35,8('S'),
-     +T48,3('Y'),T57,8('S'),/T3,3('B'),T9,
-     +3('B'),T16,3('I'),T23,3('O'),T29,3('O'),T40,3('S'),T48,
-     +3('Y'),T62,3('S'),/T3,3('B'),T9,3('B'),T16,3('I'),
-     +T23,3('O'),T29,3('O'),T40,3('S'),T48,3('Y'),T62,3('S'),
-     +/T3,9('B'),T14,7('I'),T23,9('O'),T34,9('S'),T48,3('Y'),
-     +T56,9('S'),/T3,8('B'),T14,7('I'),T24,7('O'),T34,
-     +8('S'),T48,3('Y'),T56,8('S')///T3,
-     +'Release 2.0',7X,'Colorado State University',8X,A12,5X,A12///)
+C$$$200   FORMAT (////////T3,8("B"),T14,7("I"),T24,7("O"),T35,8("S"),
+C$$$     +T44,3("Y"),T52,3("Y"),T57,8("S"),/T3,9("B"),T14,
+C$$$     +7("I"),T23,9("O"),T34,9("S"),T45,3("Y"),T51,3("Y"),T56,9("S"),
+C$$$     +/T3,3("B"),T9,3("B"),T16,3("I"),T23,3("O"),T29,
+C$$$     +3("O"),T34,3("S"),T46,3("Y"),T50,3("Y"),T56,3("S"),/T3,
+C$$$     +3("B"),T9,3("B"),T16,3("I"),T23,3("O"),T29,3("O"),T34,3("S"),T47,
+C$$$     +5("Y"),T56,3("S"),/T3,8("B"),T16,3("I"),T23,3("O"),
+C$$$     +T29,3("O"),T34,8("S"),T48,3("Y"),T56,8("S"),
+C$$$     +/T3,8("B"),T16,3("I"),T23,3("O"),T29,3("O"),T35,8("S"),
+C$$$     +T48,3("Y"),T57,8("S"),/T3,3("B"),T9,
+C$$$     +3("B"),T16,3("I"),T23,3("O"),T29,3("O"),T40,3("S"),T48,
+C$$$     +3("Y"),T62,3("S"),/T3,3("B"),T9,3("B"),T16,3("I"),
+C$$$     +T23,3("O"),T29,3("O"),T40,3("S"),T48,3("Y"),T62,3("S"),
+C$$$     +/T3,9("B"),T14,7("I"),T23,9("O"),T34,9("S"),T48,3("Y"),
+C$$$     +T56,9("S"),/T3,8("B"),T14,7("I"),T24,7("O"),T34,
+C$$$     +8("S"),T48,3("Y"),T56,8("S")///T3,
+C$$$     +"Release 2.0",7X,"Colorado State University",8X,A12,5X,A12///)
+ 200  FORMAT (/'BIOSYS'/'Release 2.0',7X,'Colorado State University',8X,
+     +        A12,5X,A12/'Modified for compilation in GNU Fortran by',
+     +        /'Mark A. Jensen, Fortinbras Research')
 201   FORMAT (' Title: ',A72)
 202   FORMAT (/' Number of populations (OTU''s) =',I5/
      +         ' Number of loci =',I5/
@@ -565,6 +585,7 @@
 303   FORMAT (////' ERROR: Unrecognized step name.  First 4 characters a
      +re "',A4,'"'//)
 304   FORMAT (/' ERROR: Data file empty')
+ 305  FORMAT (/' Dude, \'sup?',A)
       END
 
 
--- ../orgsrc/MISC.FOR	2009-01-31 23:04:36.309000000 -0500
+++ MISC.FOR	2009-01-31 22:56:29.097000000 -0500
@@ -65,8 +65,8 @@
       IMPLICIT INTEGER (A-Z)
       LOGICAL LOGVL
       REAL REALVL
-      CHARACTER LINE*80,KEYWRD*10,INTST*8,REALST*8,LOGST*8,
-     +   FMT*10,VALUE*8
+      CHARACTER LINE*80,KEYWRD*10,INTST*64,REALST*8,LOGST*8,
+     +   FMT*10,VALUE*12
       DIMENSION INTST(*),REALST(*),LOGST(*),
      +   INTVL(*),REALVL(*),LOGVL(*)
 
@@ -77,7 +77,7 @@
       ERRCOD=0
 
   1   IF (LINE.EQ.' ' .OR. LINE(1:1).EQ.'*') THEN
-         READ (1,'(A80)',IOSTAT=IOS) LINE
+         READ (5,'(A80)',IOSTAT=IOS) LINE
          IF (IOS.LT.0) RETURN
       ENDIF
       CALL GOBBLE (LINE,.TRUE.)
@@ -98,9 +98,22 @@
          IF (KEYWRD(1:LENKEY).EQ.INTST(I)(1:LENKEY)) THEN
             CALL GETVAL (LINE,VALUE,LENVAL,ERRCOD)
             IF (ERRCOD.GT.0) GO TO 3
-            WRITE (FMT,400) LENVAL
+* kludge: look for 'PHYF' and make sure it's formatted
+* as character...(so the API remains unchanged)
+            IF (KEYWRD(1:LENKEY).EQ.'PHYF') THEN
+               WRITE (FMT,410) LENVAL
+            ELSE
+               WRITE (FMT,400) LENVAL
+            ENDIF
+ 410        FORMAT ('(A',I2,')')
 400         FORMAT ('(I',I2,')')
-            READ (VALUE,FMT,ERR=2) INTVL(I)
+* kludge: put the .phy filename in the INTST array
+            IF (KEYWRD(1:LENKEY).EQ.'PHYF') THEN
+               READ (VALUE,FMT,ERR=2) INTST(I)
+            ELSE
+               READ (VALUE,FMT,ERR=2) INTVL(I)
+            ENDIF
+
             GO TO 1
          ENDIF
 500   CONTINUE
@@ -137,6 +150,7 @@
          ENDIF
 502   CONTINUE
 
+
 *  No match found:
 
       ERRCOD=2
@@ -148,13 +162,13 @@
 
   3   CONTINUE
       IF (ERRCOD.EQ.1) THEN
-         WRITE (2,300) KEYWRD
+         WRITE (6,300) KEYWRD
 300      FORMAT (' Missing value for keyword: ',A)
       ELSE IF (ERRCOD.EQ.2) THEN
-         WRITE (2,301) KEYWRD(1:LENKEY)//LINE(1:15)
+         WRITE (6,301) KEYWRD(1:LENKEY)//LINE(1:15)
 301      FORMAT (' Syntax error near: ',A)
       ELSE IF (ERRCOD.EQ.3) THEN
-         WRITE (2,302) KEYWRD(1:LENKEY),VALUE(1:LENVAL)
+         WRITE (6,302) KEYWRD(1:LENKEY),VALUE(1:LENVAL)
 302      FORMAT (' Illegal value: ',A,' = ',A)
       ENDIF
       RETURN
@@ -295,15 +309,24 @@
 *---------------------- End PRIME -----------------------------*
 
 *--------------------- Begin IBMPC ----------------------------*
-      INTEGER*2   IHR,IMIN,ISEC,I100TH,IYR,IMON,IDAY
-      CALL GETTIM(IHR,IMIN,ISEC,I100TH)
-      CALL GETDAT(IYR,IMON,IDAY)
-      WRITE (DAY,200) IDAY,IMON,IYR
-  200 FORMAT (I2.2,':',I2.2,':',I4.4,2X)
-      WRITE (TIM,201) IHR,IMIN,ISEC
-  201 FORMAT (I2.2,':',I2.2,':',I2.2,4X)
+C      INTEGER*2   IHR,IMIN,ISEC,I100TH,IYR,IMON,IDAY
+C      CALL GETTIM(IHR,IMIN,ISEC,I100TH)
+C      CALL GETDAT(IYR,IMON,IDAY)
+C      WRITE (DAY,200) IDAY,IMON,IYR
+C  200 FORMAT (I2.2,':',I2.2,':',I4.4,2X)
+C      WRITE (TIM,201) IHR,IMIN,ISEC
+C  201 FORMAT (I2.2,':',I2.2,':',I2.2,4X)
 *---------------------- End IBMPC -----------------------------*
 
+*--------------------- Begin GNU g77 /maj------------------------*
+      CHARACTER DATE*12,TIME*12,ZONE*12
+      CALL Date_and_Time(DATE,TIME,ZONE)
+      WRITE (DAY,200) DATE(1:4),DATE(5:6),DATE(7:8)
+  200 FORMAT (A4,'-',A2,'-',A2)
+      WRITE (TIM,201) TIME(1:2),TIME(3:4),TIME(5:6)
+  201 FORMAT (A2,':',A2,':',A2)
+*---------------------- End GNU g77 -----------------------------*
+
 *--------------------------------------------------------------*
 *  If you want to provide your own date and time routines, do  *
 *  it here and comment out VM/CMS, CDC, VAX, and IBMPC calls   *
@@ -344,10 +367,10 @@
 *     Fortran-style carriage control.  Ordinarily, mainframes     *
 *     will use the '1', micros will use the ASCII formfeed.       *
 *-----------------------------------------------------------------*
-C        WRITE (2,'(''1'')')
-         WRITE (2,'(A1)') CHAR(12)
+C        WRITE (6,'(''1'')')
+         WRITE (6,'(A1)') CHAR(12)
       ELSE
-         WRITE (2,'(///)')
+         WRITE (6,'(///)')
       ENDIF
       RETURN
       END
@@ -375,33 +398,33 @@
       CALL PAGSKP
       IF (MTYPE.EQ.1) THEN
 *        Multi-locus similarity and distance coefficients:
-         WRITE (2,200)
-         WRITE (2,201) COEF(NBELOW)
-         IF (NABOVE.NE.0) WRITE (2,202) COEF(NABOVE)
+         WRITE (6,200)
+         WRITE (6,201) COEF(NBELOW)
+         IF (NABOVE.NE.0) WRITE (6,202) COEF(NABOVE)
       ELSE IF (MTYPE.EQ.2) THEN
 *        Single locus coefficients:
-         WRITE (2,203) COEF(NSING),NAMLOC
+         WRITE (6,203) COEF(NSING),NAMLOC
       ELSE IF (MTYPE.EQ.3) THEN
 *        Cophenetic values:
-         WRITE (2,204)
+         WRITE (6,204)
       ELSE IF (MTYPE.EQ.4) THEN
 *        Homoplasy matrix;
-         WRITE (2,205)
+         WRITE (6,205)
       ELSE IF (MTYPE.EQ.5) THEN
 *        Phenetic distance matrix (DISWAG):
-         WRITE (2,206)
+         WRITE (6,206)
       ELSE IF (MTYPE.EQ.6) THEN
 *        Patristic distance matrix (DISWAG):
-         WRITE (2,207)
+         WRITE (6,207)
       ENDIF
 
       KMIN=1
   8   KMAX=MIN(KMIN+NCOL-1,NOTU)
-      IF (KMIN .NE. 1) WRITE (2,208)
-      WRITE (2,209)
-      WRITE (2,210) ('-------',K=KMIN,KMAX)
-      WRITE (2,211) (K,K=KMIN,KMAX)
-      WRITE (2,210) ('-------',K=KMIN,KMAX)
+      IF (KMIN .NE. 1) WRITE (6,208)
+      WRITE (6,209)
+      WRITE (6,210) ('-------',K=KMIN,KMAX)
+      WRITE (6,211) (K,K=KMIN,KMAX)
+      WRITE (6,210) ('-------',K=KMIN,KMAX)
       KBEG=1
       IF (NABOVE.EQ.0) KBEG=KMIN
       DO 500 K1=KBEG,NOTU
@@ -423,10 +446,10 @@
                WRITE (LINE(K),'(F7.3)') MATRIX(I,J)
             ENDIF
 501      CONTINUE
-         WRITE (2,212) K1,POPNAM(K1),(LINE(I),I=1,K)
+         WRITE (6,212) K1,POPNAM(K1),(LINE(I),I=1,K)
 500   CONTINUE
-      WRITE (2,210) ('-------',K=KMIN,KMAX)
-      WRITE (2,214)
+      WRITE (6,210) ('-------',K=KMIN,KMAX)
+      WRITE (6,214)
       IF (KMAX.EQ.NOTU) RETURN
       KMIN=KMIN+NCOL
       GO TO 8
--- ../orgsrc/PRINTREE.FOR	2009-01-31 23:04:36.974000000 -0500
+++ PRINTREE.FOR	2009-01-31 22:13:47.849000000 -0500
@@ -56,7 +56,7 @@
 500   CONTINUE
       IF (NPLASY) CALL MATPRT (4,0,0,'DUMMY',HPLASY,POPNAM,2,MT)
       CALL PAGSKP
-      WRITE (2,200)
+      WRITE (6,200)
       N=NOTU*(NOTU-1)/2
       SUMXSQ=SSX1-SUMX*SUMX/N
       SUMYSQ=SSX2-SUMY*SUMY/N
@@ -64,7 +64,7 @@
       CPCC=SUMXY/SQRT(SUMXSQ*SUMYSQ)
       PRAGF=100.*FARRF/SUMX
       FMSD=SQRT(FMSS/(N-1))
-      WRITE (2,201) FARRF,PRAGF,FMSD,CPCC
+      WRITE (6,201) FARRF,PRAGF,FMSD,CPCC
       RETURN
 200   FORMAT (////' Goodness of fit statistics'/1X,26('*'))
 201   FORMAT (///5X,'Farris (1972) "f" =',F10.3//
@@ -157,7 +157,7 @@
             IMOVE=(ISPACE-8)/2+2
             FMT='(///1X,               X,''Distance''/)'
             WRITE (FMT(8:22),'(I15)') IMOVE
-            WRITE (2,FMT)
+            WRITE (6,FMT)
             GO TO 12
          ENDIF
          BEG=1.-SCRAN
@@ -169,12 +169,12 @@
          IMOVE=(ISPACE-18)/2+2
          FMT='(///1X,    X,''Distance from root''/)'
          WRITE (FMT(8:11),'(I4)') IMOVE
-         WRITE (2,FMT)
+         WRITE (6,FMT)
       ELSE
          IMOVE=(ISPACE-11)/2+2
          FMT='(///1X,            X,''Similarity''/)'
          WRITE (FMT(8:19),'(I12)') IMOVE
-         WRITE (2,FMT)
+         WRITE (6,FMT)
       ENDIF
  12   DO 505 I=1,NOTU
          LINKED(I)=0
@@ -215,9 +215,9 @@
 510   CONTINUE
 
       CALL TAXIS (LINE,IBASE,ISPACE)
-      WRITE (2,200) (XNUM(J),J=1,INCR)
-      WRITE (2,201) LINE(1:ISPACE)
-      WRITE (2,202)
+      WRITE (6,200) (XNUM(J),J=1,INCR)
+      WRITE (6,201) LINE(1:ISPACE)
+      WRITE (6,202)
       DO 511 I=1,NOTU
          NLINE(NPOS(I))=2*I-1
 511   CONTINUE
@@ -247,7 +247,7 @@
                      IF (IDEX.EQ.ITAX(J3,1) .OR. IDEX .EQ.
      +                  ITAX(J3,2)) GO TO 18
 514               CONTINUE
-                  WRITE (2,300)
+                  WRITE (6,300)
                   STOP
  18               ICEND(J,K)=CUSE(J3)*TX+.5
                   ICLINE(J,K)=NCENT(J3)
@@ -298,21 +298,21 @@
             JTAX=JTAX+1
             FMT='(2X,A    ,1X,A16)'
             WRITE (FMT(6:8),'(I3)') ITERM
-            WRITE (2,FMT) LINE(1:ITERM),POPNAM(NORDER(JTAX))
+            WRITE (6,FMT) LINE(1:ITERM),POPNAM(NORDER(JTAX))
          ELSE
             FMT='(2X,A    )'
             WRITE (FMT(6:8),'(I3)') ISPACE
-            WRITE (2,FMT) LINE(1:ISPACE)
+            WRITE (6,FMT) LINE(1:ISPACE)
          ENDIF
          DO 521 L=1,ISPACE
             LINE(L:L)=' '
 521      CONTINUE
 516   CONTINUE
       CALL TAXIS (LINE,IBASE,ISPACE)
-      WRITE (2,202)
-      WRITE (2,201) LINE(1:ISPACE)
-      WRITE (2,200) (XNUM(J),J=1,INCR)
-      IF (WAGNER) WRITE (2,203) PDSUM
+      WRITE (6,202)
+      WRITE (6,201) LINE(1:ISPACE)
+      WRITE (6,200) (XNUM(J),J=1,INCR)
+      IF (WAGNER) WRITE (6,203) PDSUM
       RETURN
 
 200   FORMAT (1X,F4.2,4X,10(F6.2,4X))
--- ../orgsrc/SIMDIS.FOR	2009-01-31 23:04:37.709000000 -0500
+++ SIMDIS.FOR	2009-01-31 22:13:47.974000000 -0500
@@ -48,7 +48,7 @@
 *  comparisons between populations
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,
-     +   INTST*8,REALST*8,LOGST*8,COEF*48,POPNAM*16
+     +   INTST*64,REALST*8,LOGST*8,COEF*48,POPNAM*16
       REAL JXY,DSING,DROG1,DROG2,DARC,DCHORD,DPREV,DEDW,SROG,IUNB,
      +   DUNB,IDEN,DIST,DMINUN,DMIN,JX,GX,SMJX2,SMGX2,EDJX2,FREQ2,
      +   JXY1,JX1,JY1,IUN,ID,REALVL
@@ -79,7 +79,7 @@
       NSING=NSONLY
       IF (NSONLY.LE.0) THEN
          CALL PAGSKP
-         WRITE (2,200) TITLE,DATE,TIME
+         WRITE (6,200) TITLE,DATE,TIME
 
 *     Defaults:
 
@@ -102,13 +102,13 @@
 C        COFILE=LOGVL(7)
          COFILE=.FALSE.
          IF (NSING.LT.0 .OR. NSING.GE.14) THEN
-            WRITE (2,300) NSING
+            WRITE (6,300) NSING
             NSING=0
          ENDIF
          DO 501 I=1,6
             IF (LOGVL(I)) GO TO 2
 501      CONTINUE
-         WRITE (2,301)
+         WRITE (6,301)
          NOCOEF=1
          RETURN
 
@@ -165,7 +165,7 @@
             SMGX2(K1)=(2.*NX*SMJX-1.)/(2*NX-1)
             IF (SMGX2(K1).LE.ZERO) THEN
                IF (.NOT.WARNED .AND. NEI) THEN
-                  WRITE (2,302)
+                  WRITE (6,302)
                   WARNED=.TRUE.
                ENDIF
                SMGX2(K1)=0.5
@@ -382,7 +382,7 @@
 516      CONTINUE
       ENDIF
 
-      WRITE (2,201)
+      WRITE (6,201)
       IF (COFILE) THEN
          REWIND 3
          WRITE (3,202) TITLE
@@ -393,7 +393,7 @@
       ENDIF
       DO 518 I=1,NMAT
          IMAT=MATFIL(I)
-         WRITE (2,204) COEF(IMAT)
+         WRITE (6,204) COEF(IMAT)
          IF (COFILE) THEN
             WRITE (3,205) COEF(IMAT)
 *           (JXY is used simply for temporary storage)
@@ -408,8 +408,8 @@
 519         CONTINUE
          ENDIF
 518   CONTINUE
-      IF (NSING.GT.0) WRITE (2,207) COEF(NSING)
-      IF (COFILE) WRITE (2,208)
+      IF (NSING.GT.0) WRITE (6,207) COEF(NSING)
+      IF (COFILE) WRITE (6,208)
       RETURN
 *
 200   FORMAT (//////T3,76('*')/T3,'*',T78,'*'/T3,'*',2X,A72,
@@ -486,7 +486,7 @@
 *  Loads previously calculated similarity and distance matrices into
 *  "MATRIX" and calls printing routine
 
-      CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,INTST*8,
+      CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,INTST*64,
      +   REALST*8,LOGST*8,COEF*48,POPNAM*16
       REAL MATRIX,REALVL
       INTEGER ABOVE,BELOW
@@ -502,10 +502,10 @@
       DATA INTST/'BELOW','ABOVE'/,LOGST/'END'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
       IF (NOCOEF .EQ. 1) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
 
@@ -521,11 +521,11 @@
       BELOW=INTVL(1)
       ABOVE=INTVL(2)
       IF (BELOW.LE.0 .OR. BELOW.GE.14) THEN
-         WRITE (2,301) INTST(1),BELOW
+         WRITE (6,301) INTST(1),BELOW
          GO TO 2
       ENDIF
       IF (ABOVE.LT.0 .AND. ABOVE.GE.14) THEN
-         WRITE (2,301) INTST(2),ABOVE
+         WRITE (6,301) INTST(2),ABOVE
          GO TO 2
       ENDIF
 
@@ -536,7 +536,7 @@
          IF (MATFIL(J).EQ.BELOW) GO TO 5
             READ (15)
 500   CONTINUE
-      WRITE (2,302) BELOW,COEF(BELOW)
+      WRITE (6,302) BELOW,COEF(BELOW)
       GO TO 2
   5   READ (15) ((MATRIX(K1,K2),K1=K2,NOTU),K2=1,NOTU)
       IF (ABOVE.NE.0) THEN
@@ -545,7 +545,7 @@
             IF (MATFIL(J).EQ.ABOVE) GO TO 6
                READ (15)
 501      CONTINUE
-         WRITE (2,302) ABOVE,COEF(ABOVE)
+         WRITE (6,302) ABOVE,COEF(ABOVE)
          GO TO 2
   6      READ (15) ((MATRIX(K2,K1),K1=K2,NOTU),K2=1,NOTU)
       ENDIF
@@ -592,7 +592,7 @@
 *  level
 
       CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,LETTER,
-     +   INTST*8,REALST*8,LOGST*8,COEF*48,NAME*16,HNAME*10,
+     +   INTST*64,REALST*8,LOGST*8,COEF*48,NAME*16,HNAME*10,
      +   LINAVE*5,LINMIN*5,LINMAX*5
       REAL MATRIX,CAVE,CMIN,CMAX,REALVL
       INTEGER IHIER,NPOPS,HNUM
@@ -613,14 +613,14 @@
       DATA INTST/'LEVEL','COEF'/,LOGST/'END'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
       IF (NOHIER.NE.0) THEN
-         WRITE (2,300)
+         WRITE (6,300)
          RETURN
       ENDIF
       IF (NOCOEF .EQ. 1 ) THEN
-         WRITE (2,301)
+         WRITE (6,301)
          RETURN
       ENDIF
       REWIND 14
@@ -639,19 +639,19 @@
       NCOEF=INTVL(2)
 
       IF (LEVEL.LE.0 .OR. LEVEL.GE.4) THEN
-         WRITE (2,302) INTST(1),LEVEL
+         WRITE (6,302) INTST(1),LEVEL
          GO TO 3
       ENDIF
       IF (LEVEL.GT.NLEVEL) THEN
-         WRITE (2,303) NLEVEL
+         WRITE (6,303) NLEVEL
          GO TO 3
       ENDIF
 
       CALL PAGSKP
-      WRITE (2,201) HNAME(LEVEL)
+      WRITE (6,201) HNAME(LEVEL)
       IEND=LENSTR(HNAME(LEVEL))
-      WRITE (2,202) ('*',I=1,IEND)
-      WRITE (2,203) COEF(NCOEF)
+      WRITE (6,202) ('*',I=1,IEND)
+      WRITE (6,203) COEF(NCOEF)
 
 *  Read coefficients:
 
@@ -660,7 +660,7 @@
          IF (MATFIL(J).EQ.NCOEF) GO TO 7
             READ (15)
 501   CONTINUE
-      WRITE (2,304) NCOEF,(COEF((NC-1)*13 + NCOEF),NC=1,6)
+      WRITE (6,304) NCOEF,(COEF((NC-1)*13 + NCOEF),NC=1,6)
       GO TO 3
   7   READ (15) ((MATRIX(I,J),I=J,NOTU),J=1,NOTU)
 
@@ -720,11 +720,11 @@
  11   KMAX=MIN(KMIN+NCOL-1,NT)
       IF (KMIN .NE. 1) THEN
          CALL PAGSKP
-         WRITE (2,204)
+         WRITE (6,204)
       ENDIF
-      WRITE (2,205) ('---------------',K=KMIN,KMAX)
-      WRITE (2,206) HNAME(LEVEL),(K,K=KMIN,KMAX)
-      WRITE (2,205) ('---------------',K=KMIN,KMAX)
+      WRITE (6,205) ('---------------',K=KMIN,KMAX)
+      WRITE (6,206) HNAME(LEVEL),(K,K=KMIN,KMAX)
+      WRITE (6,205) ('---------------',K=KMIN,KMAX)
       DO 508 K1=KMIN,NT
          KEND=MIN(K1,KMAX)
          K=0
@@ -740,11 +740,11 @@
                WRITE (LINMAX(K),'(F5.3)') CMAX(K1,K2)
             ENDIF
 550      CONTINUE
-         WRITE (2,207) K1,NAME(K1,LEVEL),NPOPS(K1),(LINAVE(L),L=1,K)
-         WRITE (2,208) (LINMIN(L),LINMAX(L),L=1,K)
+         WRITE (6,207) K1,NAME(K1,LEVEL),NPOPS(K1),(LINAVE(L),L=1,K)
+         WRITE (6,208) (LINMIN(L),LINMAX(L),L=1,K)
 508   CONTINUE
-      WRITE (2,205) ('----------------',K=KMIN,KMAX)
-      IF (NOCOMP) WRITE (2,209)
+      WRITE (6,205) ('----------------',K=KMIN,KMAX)
+      IF (NOCOMP) WRITE (6,209)
 
       IF (KMAX.EQ.NT) GO TO 3
       KMIN=KMIN+NCOL
@@ -799,7 +799,7 @@
 
 *  Gets single-locus similarity coefficients and calls printing routine
 
-      CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,INTST*8,
+      CHARACTER LINE*80,DATE*12,TIME*12,TITLE*72,FMT*80,INTST*64,
      +   REALST*8,LOGST*8,LOCNAM*5,COEF*48,POPNAM*16
       REAL JXY,DSING,DROG1,DROG2,DARC,DCHORD,DPREV,DEDW,SROG,IUNB,DUNB,
      +   IDEN,DIST,DMINUN,DMIN,JX,GX,SMJX2,SMGX2,EDJX2,FREQ2,MATRIX,
@@ -822,7 +822,7 @@
       DATA INTST/'COEF'/,LOGST/'END'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
   1   INTVL(1)=0
       LOGVL(1)=.FALSE.
@@ -831,7 +831,7 @@
       IF (LOGVL(1)) RETURN
       NCOEF=INTVL(1)
       IF (NCOEF.LE.0 .OR. NCOEF.GE.14) THEN
-         WRITE (2,300) NCOEF
+         WRITE (6,300) NCOEF
          GO TO 1
       ENDIF
 
--- ../orgsrc/VARIAB.FOR	2009-01-31 23:04:39.287000000 -0500
+++ VARIAB.FOR	2009-01-31 22:13:48.095000000 -0500
@@ -27,7 +27,7 @@
 *  populations
 
       CHARACTER LINE*80,DUM,DATE*12,TIME*12,TITLE*72,FMT*80,LETTER,
-     +   POPNAM*16,POPNUM*4,INTST*8,REALST*8,LOGST*8,LOCNAM*5
+     +   POPNAM*16,POPNUM*4,INTST*64,REALST*8,LOGST*8,LOCNAM*5
       REAL FREQ,HBI,HUNB,HDC,AVEN,AVEALL,HETUNB,HETBIA,HETDIR,POLYNO,
      +   POLY99,POLY95,SEN,SEALL,SEHBIA,SEHUNB,SEHDIR,PLEVEL,DIFF
       INTEGER MINI,MAXI,N,NOBS,HTYPE,PCRIT
@@ -49,7 +49,7 @@
       DATA INTST/'HTYPE','PCRIT'/,LOGST/'FULLOUT','END'/,REALST/'ZZZ'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
 *  Defaults:
 
@@ -64,11 +64,11 @@
       HTYPE=INTVL(1)
       PCRIT=INTVL(2)
       IF (HTYPE.NE.1 .AND. HTYPE.NE.2) THEN
-         WRITE (2,300) INTST(2),HTYPE
+         WRITE (6,300) INTST(2),HTYPE
          HTYPE=1
       ENDIF
       IF (PCRIT.LT.0 .OR. PCRIT.GE.3) THEN
-         WRITE (2,300) INTST(2),PCRIT
+         WRITE (6,300) INTST(2),PCRIT
          PCRIT=0
       ENDIF
       REWIND 17
@@ -186,7 +186,7 @@
             NCOL=15
             IF (CRT) NCOL=9
             CALL PAGSKP
-            WRITE (2,201) POPNAM(K),POPNUM(K)
+            WRITE (6,201) POPNAM(K),POPNUM(K)
             J1=1
   5         J2=MIN(J1+NCOL-1,NLOC)
             NDIFF=NLOC-J2-3
@@ -194,45 +194,45 @@
                J2=J2+NDIFF
                NCOL=NCOL+NDIFF
             ENDIF
-            WRITE (2,202) ('--------',J=J1,J2)
+            WRITE (6,202) ('--------',J=J1,J2)
             NCOLS=J2-J1+1
             FMT='(6X,  (4X),''Locus and sample size'')'
             WRITE (FMT(5:6),'(I2)') MAX(NCOLS-2, 1)
-            WRITE (2,FMT)
+            WRITE (6,FMT)
             J1P1=J1+1
-            WRITE (2,203) ('--------',J=J1P1,J2)
-            WRITE (2,204) (LOCNAM(J),J=J1,J2)
-            WRITE (2,205) (N(J),J=J1,J2)
-            WRITE (2,206) ('--------',J=J1,J2)
-            WRITE (2,207)
+            WRITE (6,203) ('--------',J=J1P1,J2)
+            WRITE (6,204) (LOCNAM(J),J=J1,J2)
+            WRITE (6,205) (N(J),J=J1,J2)
+            WRITE (6,206) ('--------',J=J1,J2)
+            WRITE (6,207)
             DO 504 I=IMIN,IMAX
                IF (NLET.EQ.1) THEN
-                  WRITE (2,209) LETTER(I),(FREQ(I,J),J=J1,J2)
+                  WRITE (6,209) LETTER(I),(FREQ(I,J),J=J1,J2)
                ELSE
-                  WRITE (2,208) I,(FREQ(I,J),J=J1,J2)
+                  WRITE (6,208) I,(FREQ(I,J),J=J1,J2)
                ENDIF
 504         CONTINUE
-            WRITE (2,210) (HBI(J),J=J1,J2)
-            WRITE (2,211) (HUNB(J),J=J1,J2)
+            WRITE (6,210) (HBI(J),J=J1,J2)
+            WRITE (6,211) (HUNB(J),J=J1,J2)
 
-            IF (NDATYP .NE. 3) WRITE (2,212) (HDC(J),J=J1,J2)
-            WRITE (2,206) ('--------',J=J1,J2)
+            IF (NDATYP .NE. 3) WRITE (6,212) (HDC(J),J=J1,J2)
+            WRITE (6,206) ('--------',J=J1,J2)
             IF (J2.NE.NLOC) THEN
                J1=J1+NCOL
                GO TO 5
             ENDIF
-            WRITE (2,213) HETBIA(K),SEHBIA(K),HETUNB(K),SEHUNB(K)
-            IF (NDATYP .NE. 3) WRITE (2,214) HETDIR(K),SEHDIR(K)
-            WRITE (2,215) AVEALL(K),SEALL(K)
-            WRITE (2,216) POLY95(K),POLY99(K),POLYNO(K)
+            WRITE (6,213) HETBIA(K),SEHBIA(K),HETUNB(K),SEHUNB(K)
+            IF (NDATYP .NE. 3) WRITE (6,214) HETDIR(K),SEHDIR(K)
+            WRITE (6,215) AVEALL(K),SEALL(K)
+            WRITE (6,216) POLY95(K),POLY99(K),POLYNO(K)
          ENDIF
 500   CONTINUE
 
 *  Summary of genetic variability in all populations:
 
       CALL PAGSKP
-      WRITE (2,217) NLOC
-      WRITE (2,218)
+      WRITE (6,217) NLOC
+      WRITE (6,218)
       DO 505 K=1,NOTU
          IF (HTYPE.NE.2) THEN
             HET=HETUNB(K)
@@ -249,29 +249,29 @@
             POLY=POLY95(K)
          ENDIF
          IF (NDATYP.NE.3) THEN
-            WRITE (2,219) K,POPNAM(K),AVEN(K),AVEALL(K),POLY,
+            WRITE (6,219) K,POPNAM(K),AVEN(K),AVEALL(K),POLY,
      +         HETDIR(K),HET
-            WRITE (2,220) SEN(K),SEALL(K),SEHDIR(K),SEHET
+            WRITE (6,220) SEN(K),SEALL(K),SEHDIR(K),SEHET
          ELSE
-            WRITE (2,221) K,POPNAM(K),AVEN(K),AVEALL(K),POLY,HET
-            WRITE (2,222) SEN(K),SEALL(K),SEHET
+            WRITE (6,221) K,POPNAM(K),AVEN(K),AVEALL(K),POLY,HET
+            WRITE (6,222) SEN(K),SEALL(K),SEHET
          ENDIF
 505   CONTINUE
-      WRITE (2,223)
+      WRITE (6,223)
 
 *  Footnotes:
 
       IF (PCRIT.GT.0) THEN
-         WRITE (2,225) PLEVEL(PCRIT)
+         WRITE (6,225) PLEVEL(PCRIT)
       ELSE
-         WRITE (2,224)
+         WRITE (6,224)
       ENDIF
       IF (HTYPE.EQ.1) THEN
-         WRITE (2,226)
+         WRITE (6,226)
       ELSE
-         WRITE (2,227)
+         WRITE (6,227)
       ENDIF
-      IF (NDATYP.EQ.3) WRITE (2,228)
+      IF (NDATYP.EQ.3) WRITE (6,228)
       RETURN
 
 200   FORMAT (//////T3,76('*')/T3,'*',T78,'*'/T3,'*',2X,A72,
--- ../orgsrc/WRIGHT.FOR	2009-01-31 23:04:40.017000000 -0500
+++ WRIGHT.FOR	2009-01-31 22:13:48.211000000 -0500
@@ -28,7 +28,7 @@
      +   (FREQ2,QSUM,VC,F,MINI2,MAXI2,N2,IHIER,HNUM,NSUM,PRES,
      +    LOCNAM,MA,ML,MT)
 
-      CHARACTER INTST*8,REALST*8,LOGST*8,LOCNAM*5,HNAME*10,
+      CHARACTER INTST*64,REALST*8,LOGST*8,LOCNAM*5,HNAME*10,
      +   LNAME*10,DATE*12,TIME*12,TITLE*72,FMT*80,LINE*80,LETTER
       REAL FREQ2,QSUM,VC,F,SUM,MSQ,REALVL
       INTEGER MINI2,MAXI2,N2,IHIER,NSUM,HNUM
@@ -50,7 +50,7 @@
      +   INTST/'NOPARM'/,LOGST/'NOCORR','NOHRCHY','END'/
 
       CALL PAGSKP
-      WRITE (2,200) TITLE,DATE,TIME
+      WRITE (6,200) TITLE,DATE,TIME
 
 *  Defaults:
 
@@ -62,17 +62,17 @@
       CALL READER (1,0,3,INTST,REALST,LOGST,INTVL,REALVL,LOGVL,IERROR)
       IF (IERROR.EQ.1) RETURN
       NOCORR=LOGVL(1)
-      IF (NOCORR) WRITE (2,201)
+      IF (NOCORR) WRITE (6,201)
       NOHCHY=LOGVL(2)
       IF (NOHCHY) THEN
-         WRITE (2,203)
+         WRITE (6,203)
          CALL NONHRF (FREQ2,MINI2,MAXI2,N2,LOCNAM,PRES,NOCORR,
      +                MA,ML,MT)
          RETURN
       ELSE
-         WRITE (2,202)
+         WRITE (6,202)
          IF (NOHIER.NE.0) THEN
-            WRITE (2,300)
+            WRITE (6,300)
             RETURN
          ENDIF
          REWIND 14
@@ -118,7 +118,7 @@
 506      CONTINUE
          IF (NALLS.NE.1) THEN
             CALL PAGSKP
-            WRITE (2,204) LOCNAM(J)
+            WRITE (6,204) LOCNAM(J)
             SUMDEN=0.
             SUMSE=0.
             DO 508 I=1,NALL
@@ -227,41 +227,41 @@
 
             DO 524 L1=1,NLEVP1
                DO 525 L2=L1+1,NLEVP2
-                  WRITE (2,205) LNAME(L1),LNAME(L2)
+                  WRITE (6,205) LNAME(L1),LNAME(L2)
                   DO 526 I=1,NALL
                      IF (PRES(I)) THEN
                         IF (NLET.NE.1) THEN
                            IF (F(L1,L2,I).NE.UNDEF) THEN
-                              WRITE (2,206) I,VC(L1,L2,I),
+                              WRITE (6,206) I,VC(L1,L2,I),
      +                           F(L1,L2,I)
                            ELSE
-                              WRITE (2,207) I,VC(L1,L2,I)
+                              WRITE (6,207) I,VC(L1,L2,I)
                            ENDIF
                         ELSE
                            IF (F(L1,L2,I).NE.UNDEF) THEN
-                              WRITE (2,208) LETTER(I),VC(L1,L2,I),
+                              WRITE (6,208) LETTER(I),VC(L1,L2,I),
      +                                      F(L1,L2,I)
                            ELSE
-                              WRITE (2,209) LETTER(I),VC(L1,L2,I)
+                              WRITE (6,209) LETTER(I),VC(L1,L2,I)
                            ENDIF
                         ENDIF
                      ENDIF
 526               CONTINUE
                   IF (FSUM(L1,L2).NE.UNDEF) THEN
-                     WRITE (2,210) VCSUM(L1,L2),FSUM(L1,L2)
+                     WRITE (6,210) VCSUM(L1,L2),FSUM(L1,L2)
                   ELSE
-                     WRITE (2,211) VCSUM(L1,L2)
+                     WRITE (6,211) VCSUM(L1,L2)
                   ENDIF
 525            CONTINUE
 524         CONTINUE
-            WRITE (2,212) SUMDEN
+            WRITE (6,212) SUMDEN
          ENDIF
 503   CONTINUE
 
 *  Totals for all loci:
 
       CALL PAGSKP
-      WRITE (2,213)
+      WRITE (6,213)
       DO 527 L=1,NLEVP1
          FTOT(L,NLEVP2)=VCTOT(L,NLEVP2)/TOTDEN
 527   CONTINUE
@@ -279,14 +279,14 @@
       DO 530 L1=1,NLEVP1
          DO 531 L2=L1+1,NLEVP2
             IF (FTOT(L1,L2).NE.UNDEF) THEN
-               WRITE (2,214) LNAME(L1),LNAME(L2),VCTOT(L1,L2),
+               WRITE (6,214) LNAME(L1),LNAME(L2),VCTOT(L1,L2),
      +                       FTOT(L1,L2)
             ELSE
-               WRITE (2,215) LNAME(L1),LNAME(L2),VCTOT(L1,L2)
+               WRITE (6,215) LNAME(L1),LNAME(L2),VCTOT(L1,L2)
             ENDIF
 531      CONTINUE
 530   CONTINUE
-      WRITE (2,216)
+      WRITE (6,216)
       RETURN
 
 200   FORMAT (//////T3,76('*')/T3,'*',T78,'*'/T3,'*',2X,A72,
@@ -340,7 +340,7 @@
       DATA ZERO/1.E-6/
 
       CALL PAGSKP
-      WRITE (2,200)
+      WRITE (6,200)
       TOTSE=0.
       TOTDEN=0.
       TOTVDT=0.
@@ -362,7 +362,7 @@
 501      CONTINUE
          IF (NALLS.NE.1) THEN
             NL=NL+1
-            WRITE (2,201) LOCNAM(J)
+            WRITE (6,201) LOCNAM(J)
             SUMSE=0.
             SUMVDT=0.
             SUMDEN=0.
@@ -389,14 +389,14 @@
                   SUMDEN=SUMDEN+DENOM
                   FDT=VDT/DENOM
                   IF (NLET.NE.1) THEN
-                     WRITE (2,202) I,QT,SESQ,VDT,DENOM,FDT
+                     WRITE (6,202) I,QT,SESQ,VDT,DENOM,FDT
                   ELSE
-                     WRITE (2,203) LETTER(I),QT,SESQ,VDT,DENOM,FDT
+                     WRITE (6,203) LETTER(I),QT,SESQ,VDT,DENOM,FDT
                   ENDIF
                ENDIF
 503         CONTINUE
             FDTLOC=SUMVDT/SUMDEN
-            WRITE (2,204) SUMSE,SUMVDT,SUMDEN,FDTLOC
+            WRITE (6,204) SUMSE,SUMVDT,SUMDEN,FDTLOC
             TOTSE=TOTSE+SUMSE
             TOTVDT=TOTVDT+SUMVDT
             TOTDEN=TOTDEN+SUMDEN
@@ -406,7 +406,7 @@
       AVESE=TOTSE/NL
       AVEVDT=TOTVDT/NL
       AVEDEN=TOTDEN/NL
-      WRITE (2,205) AVESE,AVEVDT,AVEDEN,AVEFDT
+      WRITE (6,205) AVESE,AVEVDT,AVEDEN,AVEFDT
       RETURN
 *
 200   FORMAT (' Non-hierarchical F-statistics'/1X,29('*')////1X,65('-')/
