Question: Help to compile FORTAN code for an Homeogenous slab shielding problem. The code is listed below which will not compile. - - - - -

Help to compile FORTAN code for an Homeogenous slab shielding problem. The code is listed below which will not compile.
----------------------------------------------------------------
1. The number of trials run.
2. The thickness of the slab.
3. The value of the total macroscopic cross section.
4. The value of the macroscopic absorption cross section.
5. The fraction of particles that were absorbed in the slab.
6. The fraction of particles that penetrated the slab.
7. The fraction of particles that backscattered out of the slab.
8. The sum of the three fractions, that is, items 5,6 and 7.
---------------------------------------------------------------
program infiniteslab
!.. Provides the file I/O shell for the Monte Carlo infinite slab project
!.. Format-free read of data for 'ncase' cases from fort.100
!.. Writes formatted output to fort.101
!.. Compilation command
!.. gfortran -o infslab.exe infiniteslab.f95-static ranseed.f95
implicit none
!.. ncase - number of cases to run (user input)
!.. ntrial - number of particles (trials)
!.. sigt - total macro xsec,1/cm
!.. siga - absorption macro xec, 1/cm
!.. thick - shield thickness, cm
!.. tprob - sum of the output probabilities
!.. fabs - fraction absorbed
!.. fback - fraction backscattered
!.. fpen - fraction penetrated
integer :: ncase, n, ntrial =10000
real :: sigt, siga, thick, tprob, fabs, fback, fpen
!.. Store run title enclosed by single quotes
!.. Should include student name
real :: r !.. random number between 0 and 1
integer :: d, i, x !..
real :: theta !..
real, parameter :: pi =3.1415926536
character(len=80) :: title
!.. add additional declaration statements here
!..|
!.. V
call ranseed
!.. read input file fort.100
read(100,*) title !.. store run title
read(100,*) ncase !.. read number of cases
read(100,*)!.. Skip file description
!.. inititalize outputs
tprob =0. ; fabs =0. ; fback =0. ; fpen =0.
!.. write output to fort.101
write(101,*) title
write(101,50)!.. write header line
!========================================================================
!.. run 'ncase' cases each of 'ntrial' trials
outer: do n =1, ncase
!.. read next line of data from the input file
read(100,*) ntrial, thick, sigt, siga
middle:do i =1, ntrail
!.. insert infinite slab algorithm here
!..|
!.. V
call random_number (r)
d =-log (r)/ sigt
x = x + d
call random_number (r)
theta =2*pi*r
x = x + dcos(theta)
call random_number (r)
if ( r =1.E-6) r =1.E-6 then !.. ensure r not zero
d =-log(r)/ sigt
if (x >= thick) then
fpen = fpen +1
cycle middle
call random_number (r)
if (r <= siga / sigt ) then
fabs = fabs +1
cycle middle
inner: do
call random_number (r)
d =-log (r)/ sigt
x = x + d
call random_number (r)
theta =2*pi*r
x = x + dcos(theta)
call random_number (r)
if ( r <1.E-6) r =1.E-6 then !.. ensure r not zero
d =-log(r)/ sigt
if ( x > thick ) then
fpen = fpen +1
cycle middle
if (x <0) then
fback = fback +1
cycle middle
end if
call random_number (r)
if (r < siga/sigt) then
fabs = fabs +1
cycle middle
end do middle
end do outer
!.. write output for present case to fort.101
write(101,51) n, ntrial, thick, sigt, siga, fabs, fpen, fback, tprob
!========================================================================
r = log(1.E-36)
!.. FORMAT statements describe the manner in which data is to be written to file
50 format(' Case # Trials Slab cm Sigt Siga Pabs Ppen ',&
'Pback Totalprob')
51 format('',I4,2X,I8,1X,F8.2,1X,2F8.3,4F8.4)
end program infiniteslab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!