!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
    SUBROUTINE DIFCOF(LMHK,GM,GH,EL,Q2,Z,AKM,AKH)
!     ******************************************************************
!     *                                                                *
!     *                LEVEL 2.5 DIFFUSION COEFFICIENTS                *
!     *                                                                *
!     ******************************************************************
!-----------------------------------------------------------------------
    INCLUDE "parmeta.f90"
    INCLUDE "mpp.h"
# include "sp.h"
!-----------------------------------------------------------------------
    PARAMETER &
    (LP1=LM+1,LM1=LM-1)
!-----------------------------------------------------------------------
    PARAMETER &
!-----------------------------------------------------------------------
    (G=9.8,BETA=1./270.,BTG=BETA*G &
    ,PRT=1.0,GAM1=0.2222222222222222222 &
    ,A1=0.659888514560862645,A2=0.6574209922667784586 &
    ,B1=11.87799326209552761,B2=7.226971804046074028 &
    ,C1=0.000830955950095854396)
!-----------------------------------------------------------------------
! N     &(G=9.8,BETA=1./270.,BTG=BETA*G
! N     &,PRT=1.0,GAM1=0.2222222222222222222
! N     &,A1=0.3310949523016403346,A2=0.8273378704055731278
! N     &,B1=5.959709141429526024,B2=3.626088092074591135
! N     &,C1=-0.3330651924968952113)
!-----------------------------------------------------------------------
! Y     &(G=9.8,BETA=1./270.,BTG=BETA*G
! Y     &,PRT=0.8,GAM1=0.2222222222222222222
! Y     &,A1=0.9222222350809054114,A2=0.7350190142719400952
! Y     &,B1=16.60000023145629741,B2=10.10000014082581951
! Y     &,C1=0.0805318118080613468)
!-----------------------------------------------------------------------
    PARAMETER &
!--------------COEFFICIENTS FOR THE SM AND SH DETERMINANTS--------------
    (BSMH=-3.*A1*A2*(3.*A2+3.*B2*C1+12.*A1*C1-B2)*BTG &
    ,CESM=    A1*(1.-3.*C1) &

    ,BSHM=18.*A1*A1*A2*C1 &
    ,BSHH= 9.*A1*A2*A2*BTG &
    ,CESH=    A2 &
!--------------COEFFICIENTS OF THE TERMS IN THE DENOMINATOR-------------
    ,ADNM=18.*A1*A1*A2*(B2-3.*A2)*BTG &
    ,ADNH= 9.*A1*A2*A2*(12.*A1+3.*B2)*BTG*BTG &
    ,BDNM= 6.*A1*A1 &
    ,BDNH= 3.*A2*(7.*A1+B2)*BTG)
!-----------------------------------------------------------------------
    DIMENSION &
    Q2    (LM)
    DIMENSION &
    GM    (LM1),GH    (LM1),EL    (LM1) &
    ,AKM   (LM1),AKH   (LM1) &
    ,Z     (LP1)
!-----------------------------------------------------------------------
!***********************************************************************
    LMHM=LMHK-1
    LMHP=LMHK+1
    DO 100 L=1,LMHM
        ELL=EL(L)
    !-----------------------------------------------------------------------
        ELOQ2=ELL*ELL/Q2(L)
        ELOQ4=ELOQ2*ELOQ2
    !-----------------------------------------------------------------------
        GML=GM(L)
        GHL=GH(L)
    !--------------COEFFICIENTS OF THE TERMS IN THE DENOMINATOR-------------
        ADEN=(ADNM*GML+ADNH*GHL)*GHL
        BDEN= BDNM*GML+BDNH*GHL
        CDEN= 1.
    !--------------COEFFICIENTS FOR THE SM DETERMINANT----------------------
        BESM=BSMH*GHL
    !--------------COEFFICIENTS FOR THE SH DETERMINANT----------------------
        BESH=BSHM*GML+BSHH*GHL
    !--------------1./DENOMINATOR-------------------------------------------
        RDEN=1./(ADEN*ELOQ4+BDEN*ELOQ2+CDEN)
    !--------------SM AND SH------------------------------------------------
        ESM=(BESM*ELOQ2+CESM)*RDEN
        ESH=(BESH*ELOQ2+CESH)*RDEN
    !--------------DIFFUSION COEFFICIENTS-----------------------------------
        RDZ=2./(Z(L)-Z(L+2))
        Q1L=SQRT(Q2(L))
        ELQDZ=ELL*Q1L*RDZ
        AKM(L)=ELQDZ*ESM
        AKH(L)=ELQDZ*ESH
    !-----------------------------------------------------------------------
    100 END DO
!-----------------------------------------------------------------------
    RETURN
    END SUBROUTINE DIFCOF
