1
2      SUBROUTINE RSINIT
3!***********************************************************************
4!                 RSINIT Module of the AMS/EPA Regulatory Model - AERMOD
5!
6!        PURPOSE: To Initialize Results Variables for Restart
7!
8!        PROGRAMMER: Roger Brode, Jeff Wang
9!
10!        DATE:    March 2, 1992
11!
12!        MODIFIED:   Added arrays associated with post-1997 PM10
13!                    processing.
14!                    R.W. Brode, PES, Inc.,  5/12/99
15!
16!        MODIFIED:   Changed parameter for specifying the number of
17!                    high annual/period averages from NVAL to NHIANN.
18!                    R.W. Brode, PES, Inc.,  4/3/98
19!
20!        INPUTS:  None
21!
22!        OUTPUTS: Initialized Variables
23!
24!        CALLED FROM:   MAIN
25!***********************************************************************
26
27!     Variable Declarations
28      USE MAIN1
29      IMPLICIT NONE
30      CHARACTER MODNAM*12
31
32      SAVE
33      INTEGER :: I , J , K , L , M
34
35!     Variable Initializations
36      MODNAM = 'RSINIT'                                                 !      0
37
38      READ (IRSUNT,ERR=99,END=999) ISDATE
39      READ (IRSUNT,ERR=99,END=999) NHIVAL , NMXVAL , NUMREC , NUMGRP ,  &
40     &                             NUMAVE , NUMTYP
41
42      IF ( NHIVAL.GT.0 ) THEN                                           !      0
43         READ (IRSUNT,ERR=99,END=999) (((((HIVALU(I,J,K,L,M),I=1,NUMREC)&
44     &                                ,J=1,NHIVAL),K=1,NUMGRP),L=1,     &
45     &                                NUMAVE),M=1,NUMTYP)
46         READ (IRSUNT,ERR=99,END=999) (((((NHIDAT(I,J,K,L,M),I=1,NUMREC)&
47     &                                ,J=1,NHIVAL),K=1,NUMGRP),L=1,     &
48     &                                NUMAVE),M=1,NUMTYP)
49         READ (IRSUNT,ERR=99,END=999) (((((HCLMSG(I,J,K,L,M),I=1,NUMREC)&
50     &                                ,J=1,NHIVAL),K=1,NUMGRP),L=1,     &
51     &                                NUMAVE),M=1,NUMTYP)
52
53         IF ( PM10AVE ) THEN                                            !      0
54            READ (IRSUNT,ERR=99,END=999) NUMYRS                         !      0
55            READ (IRSUNT,ERR=99,END=999)                                &
56     &            ((SUMH4H(I,J),I=1,NUMREC),J=1,NUMGRP)
57         ENDIF
58
59      ENDIF
60
61      IF ( NMXVAL.GT.0 ) THEN                                           !      0
62         READ (IRSUNT,ERR=99,END=999) ((((RMXVAL(I,J,K,L),I=1,NMXVAL),J=&
63     &                                1,NUMGRP),K=1,NUMAVE),L=1,NUMTYP)
64         READ (IRSUNT,ERR=99,END=999) ((((MXDATE(I,J,K,L),I=1,NMXVAL),J=&
65     &                                1,NUMGRP),K=1,NUMAVE),L=1,NUMTYP)
66         READ (IRSUNT,ERR=99,END=999) ((((MXLOCA(I,J,K,L),I=1,NMXVAL),J=&
67     &                                1,NUMGRP),K=1,NUMAVE),L=1,NUMTYP)
68         READ (IRSUNT,ERR=99,END=999) ((((MCLMSG(I,J,K,L),I=1,NMXVAL),J=&
69     &                                1,NUMGRP),K=1,NUMAVE),L=1,NUMTYP)
70      ENDIF
71
72      IF ( SEASONHR ) THEN                                              !      0
73!        Initialize the SEASON by HOUR-OF-DAY Arrays
74         READ (IRSUNT,ERR=99,END=999) (((((SHVALS(I,J,K,L,M),I=1,NUMREC)&
75     &                                ,J=1,NUMGRP),K=1,4),L=1,24),M=1,  &
76     &                                NUMTYP)
77         READ (IRSUNT,ERR=99,END=999) ((NSEAHR(I,J),I=1,4),J=1,24)      !      0
78         READ (IRSUNT,ERR=99,END=999) ((NSEACM(I,J),I=1,4),J=1,24)      !      0
79      ENDIF
80
81      IF ( PERIOD ) THEN                                                !      0
82         READ (IRSUNT,ERR=99,END=999) IANHRS , IANCLM , IANMSG          !      0
83         READ (IRSUNT,ERR=99,END=999) (((ANNVAL(I,J,K),I=1,NUMREC),J=1, &
84     &                                NUMGRP),K=1,NUMTYP)
85      ELSEIF ( ANNUAL ) THEN
86         READ (IRSUNT,ERR=99,END=999) IANHRS , IANCLM , IANMSG , NUMYRS !      0
87         READ (IRSUNT,ERR=99,END=999) (((ANNVAL(I,J,K),I=1,NUMREC),J=1, &
88     &                                NUMGRP),K=1,NUMTYP)
89         READ (IRSUNT,ERR=99,END=999) (((SUMANN(I,J,K),I=1,NUMREC),J=1, &
90     &                                NUMGRP),K=1,NUMTYP)
91      ENDIF
92
93      IF ( MULTYR .AND. PERIOD ) THEN                                   !      0
94!        Reinitialize the ANNVAL Array and Annual Counters
95         DO K = 1 , NUMTYP                                              !      0
96            DO J = 1 , NUMGRP                                           !      0
97               DO I = 1 , NUMREC                                        !      0
98                  ANNVAL(I,J,K) = 0.0                                   !      0
99               ENDDO
100            ENDDO
101         ENDDO
102         IANHRS = 0                                                     !      0
103         IANCLM = 0
104         IANMSG = 0
105!        Read the Maximum Annual Values
106         READ (IRSUNT,ERR=99,END=999) (((AMXVAL(I,J,K),I=1,NHIANN),J=1, &
107     &                                NUMGRP),K=1,NUMTYP)
108         READ (IRSUNT,ERR=99,END=999) (((IMXLOC(I,J,K),I=1,NHIANN),J=1, &
109     &                                NUMGRP),K=1,NUMTYP)
110      ENDIF
111
112      GOTO 1000                                                         !      0
113
114!     WRITE Error Message:  Error Reading INITFILE
115 99   DUMMY = 'INITFILE'                                                !      0
116      CALL ERRHDL(PATH,MODNAM,'E','510',DUMMY)
117      RUNERR = .TRUE.
118      GOTO 1000
119
120!     WRITE Error Message:  End of File Reached for INITFILE
121 999  DUMMY = 'INITFILE'                                                !      0
122      CALL ERRHDL(PATH,MODNAM,'E','580',DUMMY)
123      RUNERR = .TRUE.
124
125 1000 CONTINUE                                                          !      0
126      END


HyperKWIC - Version 1.00DD executed at 20:00 on 1 Mar 2018 | Personal or Academic or Evaluation User | Free for Non-Commercial, Non-Government Use