I need help with my program. I changed x y and z to integer
and my concentration value is back to the value it is supposed to be. The problem I have is that the concentration is supposed to get stored in the array g but all the values of the array is just 0.
! This program will calculate pollutant concentration profile
! in x direction based on down wind distance from the source
Real q, u, s, t, h, w, i, j, k, l, o
Character p, a, b, c, d, e, f
Real g(21,21,7)
Integer n, m, x, y, z
! The variables used are as follows:
! q=Emission Rate (g/s) ,u= wind velocity, s=sigma y (m),
! t=sigma z calculation (m), i=Ry, j=ry k=Rz, l=rz coefficient
! w=concentration (g/m^3), o= placeholder variable in w calc
! (a-f) = stability estimate p=placeholder (ph) coefficient
! n= ph for intensity of solar radiation, m= ph for day/night
! x= dist in plume direction (m), y= horiz dist off plume axis (m)
! z=height (m), h= emission height (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
Write(4,*), 'The array value is ...', g(x,y,w)
Print*, g(x,y,z), x, y, z, w
5002 CONTINUE
5001 CONTINUE
5000 CONTINUE
END IF
END
and my concentration value is back to the value it is supposed to be. The problem I have is that the concentration is supposed to get stored in the array g but all the values of the array is just 0.
! This program will calculate pollutant concentration profile
! in x direction based on down wind distance from the source
Real q, u, s, t, h, w, i, j, k, l, o
Character p, a, b, c, d, e, f
Real g(21,21,7)
Integer n, m, x, y, z
! The variables used are as follows:
! q=Emission Rate (g/s) ,u= wind velocity, s=sigma y (m),
! t=sigma z calculation (m), i=Ry, j=ry k=Rz, l=rz coefficient
! w=concentration (g/m^3), o= placeholder variable in w calc
! (a-f) = stability estimate p=placeholder (ph) coefficient
! n= ph for intensity of solar radiation, m= ph for day/night
! x= dist in plume direction (m), y= horiz dist off plume axis (m)
! z=height (m), h= emission height (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
Write(4,*), 'The array value is ...', g(x,y,w)
Print*, g(x,y,z), x, y, z, w
5002 CONTINUE
5001 CONTINUE
5000 CONTINUE
END IF
END