```c   This program performs power calculations
c   for a proposed ASTM plastic lumber standard.
c
c   Steve Verrill, 3/26/99
c
c
c

real xmoduli(5),cv(8),probf(8,5)

integer icv(8),moduli(5),num(8)

real*8 pf,dfn,dfd,xncp

integer istatus

character*80 results

character*80 argv,intwrite

data icv/5,10,15,20,25,30,35,40/
data num/3,7,14,23,35,49,67,86/

call getarg(3,results)

open(unit=7,file=results,access="append",status="unknown")

call getarg(4,results)

write(6,9900) results
9900 format("The results from this run have been appended to",
x       " the file `",a80,"`To see how to download",
x       " this file,",
x       ' read this description of anonymous ftp',
x       '.','Alternatively, you should be able to do a',
x       ' "Save As" or "Print" in your browser.')

write(7,9700)
9700 format(////,1x,"**************************************",//,1x,
x               "Output from astmplast2.f",//,1x,
x               "**************************************",/)

c
c   secant moduli
c

call getarg(1,argv)
write(intwrite,7) argv
7    format(a80)

call getarg(2,argv)
write(intwrite,7) argv

do 40 i = 1,nummod

xmoduli(i) = moduli(i)

40   continue

c
c   cvs
c

numcv = 8

do 55 i = 1,numcv

cv(i) = icv(i)/100.0

55   continue

write(6,61)
write(7,62)
61   format('These calculations assume that the secant moduli',
x' are normally distributed.')
62   format(/,1x,'These calculations assume that the secant moduli',
x' are normally distributed.',/)

c
c   perform the power calculations
c

do 110 i = 1,numcv

idof = num(i) - 1
xn = num(i)

fac = sqrt(xn)
dfn = 1.0d0
dfd = xn - 1.0d0

do 100 j = 1,nummod

xncp = fac*(xmoduli(j) - 50000)/
x             (xmoduli(j)*cv(i))

c            write(6,90) i,j,fac,xmoduli(j),cv(i),xncp
c 90         format("The i,j,fac,xmoduli(j),cv(i),xncp",
c     x      " values are",i1,2x,i1,2x,4(e12.4,2x),
c     x      "")

ier = 0
call mdtn(0.0d0,idof,xncp,pf,ier)

if (ier .ne. 0) then

write(6,81) istatus
write(7,82) istatus
81            format('Error 81: istatus = ',i2,'.',
x         '',
x         'sverrill@fs.fed.us.')
82            format(/,1x,'Error 81: istatus = ',i2,'.',/,
x         ' steve@swst.org.',/)

stop

endif

probf(i,j) = pf

100     continue

110  continue

c      write(6,115)
c 115  format("Got to 115.")

write(6,1010)
write(7,1012) (moduli(i), i = 1,nummod)
1010 format('Moduli are on top.  Coefficients',
x' of variation and corresponding sample sizes',
x' are along the left side.  Probabilities',
x' of failing the test are in the table.')
1012 format(///,1x,'Moduli are on top.  Coefficients of',
x' variation and corresponding sample sizes',/,1x,
x'are along the left side.  ',
x'Probabilities of failing the test',/,1x,'are in the table.',
x//,
x10x,5(2x,i6),/)

do 1016 i = 1,numcv
write(7,1014) icv(i),num(i),(probf(i,j),j = 1,nummod)
1014    format(2x,i2,2x,i2,2x,5(3x,f5.3))
1016 continue

write(6,1020)
1020 format("")

write(6,1030) nummod
1030 format("",
x"",
x"")
do 1034 i = 1,nummod
write(6,1032) moduli(i)
1032    format("")
1034 continue
write(6,1036)
1036 format("")

do 1050 i = 1,numcv

write(6,1042) icv(i),num(i),(probf(i,j), j = 1,nummod)
1042    format("","",
x   "",
x   (""))

write(6,1044)
1044    format("")

1050 continue

write(6,1052)
1052 format("CoefficientofvariationSamplesize Modulus  ",i6,"",i3,"",i3,"",f5.3,"")

write(6,6060)
6060 format('For further information,',
x'',
x'sverrill@fs.fed.us',

stop

end
```