I need help with my program. It was working before but I added the lines with + to put the concentration in an array to make it easier to plot all the values changed to INF and NAN
! This program will calculate pollutant concentration profile
! in x direction based on down wind distance from the source
Real q, u, s, t, x, y, z, h, w, i, j, k, l, o
Character p, a, b, c, d, e, f
+ Real g(21,21,7)
Integer n, m
Print*, 'This will calculate concentration by Gaussian Model.'
Print*, 'Some parameters are needed for the calculation'
Print*, 'What is the emmission rate?'
Read*, q
Print*, 'Next what is the wind velocity?'
Read*, u
Print*, ' Is there daylight or is it at night?'
Print*, ' Please enter 1 for day or 2 for n.'
Read*, m
IF (m == 1) THEN
Print*, 'How intense is solar radiation? Enter 1 for strong,'
Print*, '2 for moderate, and 3 for weak.'
Read*, n
IF (n == 1) THEN
IF (u < 2.5) THEN
p='a'
Print*, 'What is the emmission height?'
Read*, h
ELSE IF (u < 5) THEN
p='b'
Print*, 'What is the emmission height?'
Read*, h
ELSE
p='c'
Print*, 'What is the emmission height?'
Read*, h
END IF
END IF
IF (n == 2) THEN
IF (u < 2) THEN
p='a'
Print*, 'What is the emmission height?'
Read*, h
ELSE IF (u < 4) THEN
p='b'
Print*, 'What is the emmission height?'
Read*, h
ELSE IF (u<5.5) THEN
p='c'
Print*, 'What is the emmission height?'
Read*, h
ELSE
p='d'
Print*, 'What is the emmission height?'
Read*, h
END IF
ELSE IF (n == 3) THEN
IF (u < 2) THEN
p='b'
Print*, 'What is the emmission height?'
Read*, h
ELSE IF (u < 5) THEN
p='c'
Print*, 'What is the emmission height?'
Read*, h
ELSE
p='d'
Print*, 'What is the emmission height?'
Read*, h
END IF
END IF
IF (m == 2) THEN
IF (u < 3.5) THEN
p='f'
Print*, 'What is the emmission height?'
Read*, h
ELSE IF (u < 5) THEN
p='e'
Print*, 'What is the emmission height?'
Read*, h
ELSE
p='d'
Print*, 'What is the emmission height?'
Read*, h
END IF
END IF
IF (p == 'a') THEN
l=.469
i=.903
j=.017
k=1.380
ELSE IF (p == 'b') THEN
l=.306
i=.885
j=.072
k=1.021
ELSE IF (p == 'c') THEN
l=.230
i=.885
j=.076
k=.879
ELSE IF (p == 'd') THEN
l=.219
i=.764
j=.140
k=.727
ELSE IF (p == 'e') THEN
h=.237
i=.691
j=.217
k=.610
ELSE
l=.273
i=.594
j=.262
k=.500
END IF
Write(3,*), ' Xdist Ydist Zdist Pollutant Conc '
do 5000 x = 1, 21
do 5001 y = 1, 21
do 5002 z = 1, 7
s=l*x**i
t=j*x**k
o=(exp(-(z-h)**2/(2*t**2))-exp(-(z+h)**2/(2*t**2)))
w=q/(2*pi*u*s*t)*exp(-y**2/(2*s**2))*o
Write(3,*), ' ',x,' ',y, ' ',z, ' ', w
+ g(x,y,z)=w
Print*, g(x,y,z), x, y, z, w
5002 CONTINUE
5001 CONTINUE
5000 CONTINUE
END IF
END