      SUBROUTINE SCMOM(CEN0,CEPHI0,CEPSI,CIN0,CIPHI0,CIPSI,CEMOM0, &
                       CEMOM2,CEMOM3,CEMOM4,CEMOM5,CEMOM6,CEMOM7,CEMOM8, &
                       CIMOM0,CIMOM2,CIMOM3,CIMOM4,CIMOM5,CIMOM6,CIMOM7, &
                       CIMOM8,CEPHIS0,CEDPHI0,CIPHIS0,CIDPHI0,PEN0, &
                       PEPHI0,PEPSI,PIN0,PIPHI0,PIPSI,ILGA,LEVA)
!-----------------------------------------------------------------------
!     PURPOSE:
!     --------
!     CALCULATION OF VARIOUS MOMENTS OF THE DRY AEROSOL SIZE
!     DISTRIBUTION. RESULTS WILL BE USED IN SUBSEQUENT CALCULATIONS
!     SUCH AS FOR WATER CONTENT. CALCULATIONS ARE FOR THE SUB-GRID
!     SECTIONS THAT ARE USED IN THE CONDENSATION/EVAPORATION
!     CALCULATIONS.
!
!     HISTORY:
!     --------
!     * JUN 20/2008 - K.VONSALZEN   ADDITIONAL MOMENTS.
!     * AUG 18/2006 - K.VONSALZEN   NEW.
!
!-----------------------------------------------------------------------
!
      USE SCPARM
      USE SDPARM
      USE SDCODE
      USE FPDEF
!
      IMPLICIT REAL (A-H,O-Z), INTEGER (I-N)
!
      INTEGER, INTENT(IN) :: ILGA,LEVA
      REAL, INTENT(IN), DIMENSION(ILGA,LEVA,ISEXT) :: CEPHIS0,CEDPHI0
      REAL, INTENT(IN), DIMENSION(ILGA,LEVA,ISINT) :: CIPHIS0,CIDPHI0
      REAL, INTENT(IN), DIMENSION(ILGA,LEVA,ISAEXT) :: &
                                               PEN0,PEPHI0,PEPSI
      REAL, INTENT(IN), DIMENSION(ILGA,LEVA,ISAINT) :: &
                                               PIN0,PIPHI0,PIPSI
      REAL, INTENT(OUT), DIMENSION(ILGA,LEVA,ISEXT) :: &
                                          CEN0,CEPHI0,CEPSI
      REAL(R8), INTENT(OUT), DIMENSION(ILGA,LEVA,ISEXT) :: &
                                          CEMOM0,CEMOM2,CEMOM3,CEMOM4, &
                                          CEMOM5,CEMOM6,CEMOM7,CEMOM8
      REAL, INTENT(OUT), DIMENSION(ILGA,LEVA,ISINT) :: &
                                          CIN0,CIPHI0,CIPSI
      REAL(R8), INTENT(OUT), DIMENSION(ILGA,LEVA,ISINT) :: &
                                          CIMOM0,CIMOM2,CIMOM3,CIMOM4, &
                                          CIMOM5,CIMOM6,CIMOM7,CIMOM8
!
!-----------------------------------------------------------------------
!
!     * PLA PARAMETERS FOR EXTERNALLY MIXED AEROSOL TYPES.
!
      ISC=0
      DO IS=1,ISWEXT
        ISM=SEXTF%ISWET(IS)%ISM
        DO IST=1,ISESC
          ISC=ISC+1
          DO L=1,LEVA
          DO IL=1,ILGA
            CEN0  (IL,L,ISC)=PEN0  (IL,L,ISM)
            CEPHI0(IL,L,ISC)=PEPHI0(IL,L,ISM)
            CEPSI (IL,L,ISC)=PEPSI (IL,L,ISM)
          ENDDO
          ENDDO
        ENDDO
      ENDDO
!
!     * PLA PARAMETERS FOR INTERNALLY MIXED AEROSOL TYPES.
!
      ISC=0
      DO IS=1,ISWINT
        ISI=SINTF%ISWET(IS)%ISI
        DO IST=1,ISESC
          ISC=ISC+1
          DO L=1,LEVA
          DO IL=1,ILGA
            CIN0  (IL,L,ISC)=PIN0  (IL,L,ISI)
            CIPHI0(IL,L,ISC)=PIPHI0(IL,L,ISI)
            CIPSI (IL,L,ISC)=PIPSI (IL,L,ISI)
          ENDDO
          ENDDO
        ENDDO
      ENDDO
!
!     * THIRD AND FOURTH MOMENT OF THE SIZE DISTRIBUTION FOR EXTERNALLY
!     * MIXED TYPES OF AEROSOLS AND MASS OF WATER.
!
      IF ( ISEXT > 0 ) THEN
        CEMOM0=SDINT0(CEPHI0,CEPSI,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=2.
        CEMOM2=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=3.
        CEMOM3=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=4.
        CEMOM4=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=5.
        CEMOM5=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=6.
        CEMOM6=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=7.
        CEMOM7=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        RMOM=8.
        CEMOM8=SDINT(CEPHI0,CEPSI,RMOM,CEPHIS0,CEDPHI0,ILGA,LEVA,ISEXT)
        WHERE ( ABS(CEPSI-YNA) <= YTINY )
          CEMOM0=YNA
          CEMOM2=YNA
          CEMOM3=YNA
          CEMOM4=YNA
          CEMOM5=YNA
          CEMOM6=YNA
          CEMOM7=YNA
          CEMOM8=YNA
        ENDWHERE
      ENDIF
!
!     * THIRD AND FOURTH MOMENT OF THE SIZE DISTRIBUTION FOR INTERNALLY
!     * MIXED TYPES OF AEROSOLS.
!
      IF ( ISINT > 0 ) THEN
        CIMOM0=SDINT0(CIPHI0,CIPSI,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=2.
        CIMOM2=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=3.
        CIMOM3=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=4.
        CIMOM4=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=5.
        CIMOM5=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=6.
        CIMOM6=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=7.
        CIMOM7=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        RMOM=8.
        CIMOM8=SDINT(CIPHI0,CIPSI,RMOM,CIPHIS0,CIDPHI0,ILGA,LEVA,ISINT)
        WHERE ( ABS(CIPSI-YNA) <= YTINY )
          CIMOM0=YNA
          CIMOM2=YNA
          CIMOM3=YNA
          CIMOM4=YNA
          CIMOM5=YNA
          CIMOM6=YNA
          CIMOM7=YNA
          CIMOM8=YNA
        ENDWHERE
      ENDIF
!
      END SUBROUTINE SCMOM
