      SUBROUTINE VERTIC(F,EIGG,EIGGT,DOTPRO,MODS,INOUT)
      DIMENSION EIGG( 7 , 7 ),EIGGT( 7 , 7 ),DOTPRO( 7 )
CJPB  COMPLEX*8 F( 289 , 7 ),COL( 7 ),SUM
      COMPLEX   F( 289 , 7 ),COL( 7 ),SUM
C     INOUT=-1 TO OBTAIN VERTICAL MODE EXPANSION
C     INOUT=+1 TO OBTAIN SPET. COEFS. FROM VERTICAL EXPANSION
      IF(INOUT)10,20,30
10    CONTINUE
      DO 4 I=1, 289
      DO 2 MOD=1,MODS
      SUM=(0.,0.)
      DO 1 LEV=1, 7
      SUM=SUM+CMPLX(EIGGT(LEV,MOD)* REAL(F(I,LEV)),
     1              EIGGT(LEV,MOD)*AIMAG(F(I,LEV)))
1     CONTINUE
2     COL(MOD)=CMPLX(DOTPRO(MOD)*REAL(SUM),DOTPRO(MOD)*AIMAG(SUM))
      DO 3 MOD=1,MODS
3     F(I,MOD)=COL(MOD)
4     CONTINUE
20    RETURN
30    CONTINUE
      DO 8 I=1, 289
      DO 5 MOD=1,MODS
5     COL(MOD)=F(I,MOD)
      DO 7 LEV=1, 7
      F(I,LEV)=(0.,0.)
      DO 6 MOD=1,MODS
      F(I,LEV)=F(I,LEV)+CMPLX(
     1EIGG(LEV,MOD)*REAL(COL(MOD)),EIGG(LEV,MOD)*AIMAG(COL(MOD)))
6     CONTINUE
7     CONTINUE
8     CONTINUE
      RETURN
      END
