1
2      SUBROUTINE SETCAR
3!***********************************************************************
4!                 SETCAR Module of the AMS/EPA Regulatory Model - AERMOD
5!
6!        PURPOSE: Setup the Final Cartesian Grid Receptor Network Inputs
7!
8!        PROGRAMMER:  Jeff Wang, Roger Brode
9!
10!        DATE:    March 2, 1992
11!
12!        MODIFIED:  To Include TOXXFILE Option - 9/29/92
13!
14!        INPUTS:  The GRIDCART Sub-pathway Input Parameters
15!
16!        OUTPUTS: Cartesian Grid Receptor Network Inputs
17!
18!        CALLED FROM:   RECART
19!***********************************************************************
20
21!     Variable Declarations
22      USE MAIN1
23      IMPLICIT NONE
24      CHARACTER MODNAM*12
25
26      SAVE
27      INTEGER :: I , J , JSET
28
29!     Variable Initializations
30      MODNAM = 'SETCAR'                                                 !      0
31
32      IF ( ICOUNT.NE.0 .AND. JCOUNT.NE.0 ) THEN
33!        Setup The Coordinate Of The Receptors
34         NETSTA(INNET) = IRXR + 1                                       !      0
35         ISET = IRXR
36         JSET = IRYR
37         DO J = 1 , JCOUNT
38            DO I = 1 , ICOUNT                                           !      0
39               ISET = ISET + 1                                          !      0
40               JSET = JSET + 1
41               IF ( ISET.GT.NREC ) THEN
42!                 Error Msg: Maximum Number Of Receptor Exceeded
43                  WRITE (DUMMY,'(I8)') NREC                             !      0
44                  CALL ERRHDL(PATH,MODNAM,'E','219',DUMMY)
45                  GOTO 999
46               ENDIF
47               IF ( ICOUNT.GT.IXM ) THEN                                !      0
48!                 WRITE Error Message:  Too Many X-Coordinates for This Network
49                  WRITE (DUMMY,'(I8)') IXM                              !      0
50                  CALL ERRHDL(PATH,MODNAM,'E','225',DUMMY)
51                  GOTO 999
52               ENDIF
53               IF ( JCOUNT.GT.IYM ) THEN                                !      0
54!                 WRITE Error Message:  Too Many Y-Coordinates for This Network
55                  WRITE (DUMMY,'(I8)') IYM                              !      0
56                  CALL ERRHDL(PATH,MODNAM,'E','226',DUMMY)
57                  GOTO 999
58               ENDIF
59               AXR(ISET) = XCOORD(I,INNET)                              !      0
60               AYR(JSET) = YCOORD(J,INNET)
61            ENDDO
62         ENDDO
63         IRXR = ISET                                                    !      0
64         IRYR = JSET
65         NETEND(INNET) = IRXR
66         NUMXPT(INNET) = ICOUNT
67         NUMYPT(INNET) = JCOUNT
68         NTID(INNET) = NETIDT
69         NTTYP(INNET) = 'GRIDCART'
70!        Define ITAB, NXTOX, NYTOX Variables for TOXXFILE Option, 9/29/92
71         IF ( ITAB.LT.0 ) THEN
72!           First Receptor Network Defined - Set Variables
73            ITAB = 2                                                    !      0
74            NXTOX = ICOUNT
75            NYTOX = JCOUNT
76         ELSE
77!           Previous Receptors Have Been Defined - Reset ITAB = 0
78            ITAB = 0                                                    !      0
79         ENDIF
80      ENDIF
81
82!     Setup The AZELEV Array
83      CALL SBYVAL(ZETMP1,ZETMP2,IZE)                                    !      0
84      ISET = IRZE
85      DO I = 1 , IZE
86         ISET = ISET + 1                                                !      0
87         IF ( ISET.GT.NREC ) THEN
88!           Error Msg: Maximum Number Of Receptor Exceeded
89            WRITE (DUMMY,'(I8)') NREC                                   !      0
90            CALL ERRHDL(PATH,MODNAM,'E','219',DUMMY)
91            GOTO 999
92         ENDIF
93         AZELEV(ISET) = ZETMP2(I)                                       !      0
94      ENDDO
95      IRZE = ISET                                                       !      0
96
97!     Setup The AZHILL Array
98      CALL SBYVAL(ZHTMP1,ZHTMP2,IZH)
99      ISET = IRZH
100      DO I = 1 , IZH
101         ISET = ISET + 1                                                !      0
102         IF ( ISET.GT.NREC ) THEN
103!           Error Msg: Maximum Number Of Receptor Exceeded
104            WRITE (DUMMY,'(I8)') NREC                                   !      0
105            CALL ERRHDL(PATH,MODNAM,'E','219',DUMMY)
106            GOTO 999
107         ENDIF
108         AZHILL(ISET) = ZHTMP2(I)                                       !      0
109      ENDDO
110      IRZH = ISET                                                       !      0
111
112!     Setup The AZFLAG Aarry
113      CALL SBYVAL(ZFTMP1,ZFTMP2,IZF)
114      ISET = IRZF
115      DO I = 1 , IZF
116         ISET = ISET + 1                                                !      0
117         IF ( ISET.GT.NREC ) THEN
118!           Error Msg: Maximum Number Of Receptor Exceeded
119            WRITE (DUMMY,'(I8)') NREC                                   !      0
120            CALL ERRHDL(PATH,MODNAM,'E','219',DUMMY)
121            GOTO 999
122         ENDIF
123         AZFLAG(ISET) = ZFTMP2(I)                                       !      0
124      ENDDO
125      IRZF = ISET                                                       !      0
126
127      DO I = IDC1 + 1 , IRXR
128         NETID(I) = NETIDT                                              !      0
129         RECTYP(I) = 'GC'
130      ENDDO
131
132 999  CONTINUE                                                          !      0
133      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