-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreadpht.f
141 lines (141 loc) · 3.96 KB
/
readpht.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
subroutine readpht
c
c-----CAMx v4.02 030709
c
c RDPHOT reads photolysis rates for five reactions as a function
c of zenith angle, height above ground, turbidity, surface albedo,
c and ozone column
c
c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
c ENVIRON International Corporation
c
c Modifications:
c none
c
c Input arguments:
c none
c
c Output arguments:
c none
c
c Routines called:
c none
c
c Called by:
c CHMPREP
c
include 'camx.prm'
include 'chmstry.com'
include 'filunit.com'
include 'ahomap.com'
c
character*80 record
dimension tmp3(3)
c
c-----Entry Point
c
c-----Read photolysis rates for the primary photolysis reactions
c declared in the CHEMPARAM file.
c NPHOT1 is the number of primary photolysis reactions
c
c The reference heights and zenith angles are set in CHEMDAT
c
line = 0
do iozn = 1,NOZN
do ialb = 1,NALB
do ihaze = 1,NHAZE
line = line + 1
read(iphot,'(a)',err=7000,end=7001) record
kount = 0
k1 = 1
do 10 k=k1,80
if (kount.eq.3) goto 11
if(record(k:k).eq.'=') then
kount = kount + 1
k1 = k + 1
read(record(k1:80),*,err=7002) tmp3(kount)
goto 10
endif
10 continue
11 continue
if (kount.ne.3) goto 7003
ozcl(iozn) = tmp3(1)
albcl(ialb) = tmp3(2)
hazcl(ihaze) = tmp3(3)
c
do ihght = 1,NHGHT
line = line + 1
read(iphot,*,err=7000,end=7001) tmp
do irxn = 1,nphot1
c write(iout,*) iozn,ialb,ihaze,ihght,irxn
line = line + 1
read(iphot,'(1x,10f12.0)',err=7000,end=7001)
& (prkn(izen,irxn,ihght,ihaze,ialb,iozn),izen=1,NZEN)
enddo
enddo
enddo
enddo
enddo
c
c-----Convert rates from per min to per hour
c
do iozn = 1,NOZN
do ialb = 1,NALB
do ihaze = 1,NHAZE
do ihght = 1,NHGHT
do irxn = 1,nphot1
do izen=1,NZEN
prkn(izen,irxn,ihght,ihaze,ialb,iozn) =
& prkn(izen,irxn,ihght,ihaze,ialb,iozn)*60.
enddo
enddo
enddo
enddo
enddo
enddo
c
close(iphot)
goto 9999
c
c----------------------------------------------------------------------
c Error messages:
c-----------------------------------------------------------------------
c
7000 continue
write(iout,'(//,A)') 'ERROR in READPHT:'
write(iout,'(/,2A,i5)') ' ERROR: Reading photolysis rates',
& ' file at line: ', line
write(iout,'(/,2A)') ' Does the rate file have the correct',
& ' number of reactions?'
call camxerr()
c
7001 continue
write(iout,'(//,A)') 'ERROR in READPHT:'
write(iout,'(/,A,/,A,i5)') ' ERROR: Reading photolysis rates',
& ' End of file at line: ', line
call camxerr()
c
7002 continue
write(iout,'(//,A)') 'ERROR in READPHT:'
write(iout,'(/,A,/,A,i5,/,A)')
& ' ERROR: Reading photolysis rates',
& ' Reading header record at line: ', line,
& record
call camxerr()
c
7003 continue
write(iout,'(//,A)') 'ERROR in READPHT:'
write(iout,'(/,A,/,A,i5,/,A)')
& ' ERROR: Reading photolysis rates',
& ' Reading header record at line: ', line,
& record
write(iout,*)'Did not find three = signs in header.'
call camxerr()
c
c----------------------------------------------------------------------
c Return point:
c-----------------------------------------------------------------------
c
9999 continue
return
end