      SUBROUTINE ALATLON(NLONA,NLATA,ELONA,ELATA)
C
C     * APR 22/02 - B. MIVILLE (REVISED FOR NEW PI VALUE)
C     * OCT 04/01 - B. MIVILLE (CORRECT "ELATA" DIMENSION DECLARATION)
C     * JUN 08/01 - B. MIVILLE
C
C     * CALCULATE THE AGCM LAT/LON ASSUMING A GAUSSIAN GRID
C
C     * INPUT PARAMETERS...
C
C     * NLONA = NUMBER OF ATMOSPHERE LONGITUDES INCLUDING CYCLIC
C     * NLATA = NUMBER OF ATMOSPHERE LATITUDES 
C
C     * OUTPUT PARAMETERS...
C
C     * ELONA = ATMOSPHERE LONGITUDES (PLUS ONE EXTRA TO THE WEST OF THE 
C     *         FIRST LONGITUDE
C     * ELATA = ATMOSPHERE LATITUDES (PLUS ONE EXTRA FOR EACH OF THE NORTH 
C     *         AND SOUTH)
C
C-----------------------------------------------------------------------
C
C     * JM=384 IS THE MAXIMUM GRID SIZE EXPECTED IN LATITUDES
C
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      PARAMETER (JM=384)
      INTEGER ILATH,NLONA,NLATA
      REAL ELONA(0:NLONA,0:NLATA+1), ELATA(0:NLONA,0:NLATA+1), DLON
      REAL*8 SL(JM), WL(JM), CL(JM), RADL(JM), WOSSL(JM)
      DATA PI/3.1415926535898D0/
C-----------------------------------------------------------------------
C
C     * VERIFY THAT INPUT NUMBER OF LATITUDES DOES NOT GO
C     * OVER THE MAXIMUM ALLOWED
C
      IF(NLATA.GT.JM) THEN
         WRITE(6,'(2A,I8,A,I8)') 'NUMBER OF LATITUDES OVER MAXIMUM',
     1        'NLATA: ',NLATA,'  MAXIMUM: ',JM
         CALL                                      XIT('ALATLON',-13)
      ENDIF
C
      ILATH = NLATA/2
      RAD=180.0E0/PI
C
      CALL GAUSSG (ILATH,SL,WL,CL,RADL,WOSSL)
      CALL TRIGL  (ILATH,SL,WL,CL,RADL,WOSSL)
C     
C     * CALCULATE THE ATMOSPHERE LONGITUDE ASSUMING IT IS UNIFORMELY 
C     * SPACED AND CYCLIC (ASSUMING A START AT LONGITUDE 0 DEGREE). 
C     * THE CYCLIC LONGITUDE IS GIVEN 360. DEGREES. CALCULATES THE
C     * LATITUDES USING THE GAUSSIAN LATITUDES.
C     
      DLON=360.E0/FLOAT(NLONA-1)
C
      DO 135 I = 0,NLONA
         DO 130 J = 1,NLATA
            ELONA(I,J)=DLON*FLOAT(I-1)
            ELATA(I,J)=ASIN(SL(J))*RAD
C           * MAKE CERTAIN THAT REPEAT LONGITUDES IS 360 IN CASE OF
C           * ROUND OFF ERROR MAKES IT DIFFERENT
            ELONA(NLONA,J)=360.0E0
 130     CONTINUE
C
C        * GIVE VALUES TO THE EXTRA LATITUDES TO MAKE SURE THAT THE
C        * OCEAN LATITUDES ARE INSIDE THE ATMOSPHERE ONES..
C
         ELATA(I,0)=ELATA(I,1)-100.E0
         ELATA(I,NLATA+1)=ELATA(I,NLATA)+100.E0
         ELONA(I,0)=ELONA(I,1)
         ELONA(I,NLATA+1)=ELONA(I,1)
C
 135  CONTINUE
C
      RETURN
      END
