C***********************************************************************
C***********************************************************************
      SUBROUTINE get_friction(iter) 
C-----------------------------------------------------------------------
C Initialize the bottom friction, vertical eddy viscosity 

      INCLUDE 'CASCO.DIM'
      INCLUDE 'friction.h' 
      INCLUDE 'startstop.h'
      INCLUDE 'mesh.h' 

      INTEGER ITER
C
C  local variables 
      INTEGER I,J 
C  Linearized bottom stress coefficient
C
      IF(NLBS.EQ.0)THEN
         DO I=1,NN
            AK(I)=AKMIN
         ENDDO
	 WRITE(*,*)'get_friction. ak = akmin = ',AKMIN
      ELSEIF(NLBS.EQ.1) THEN
	 CALL LIN_STRESS(KD0,SEC0,ITER,AK,AKMIN,NN)
      ELSE 
	 WRITE(*,*)'GET_FRICTION: ILLEGAL NLBS ', NLBS
	 WRITE(2,*)'GET_FRICTION: ILLEGAL NLBS ', NLBS
	 STOP
      ENDIF
C
C  Vertical eddy viscosities for momentum 
C
      IF(CLOSURE.EQ.'CONSTANT')THEN
         DO J=1,NEV
            DO I=1,NN
               ENZM(I,J)=EKMIN
            ENDDO
         ENDDO
	 WRITE(*,*)'get_friction. enzm = ekmin = ',EKMIN
      ELSEIF(CLOSURE.EQ.'SPATIAL') THEN
	 CALL LIN_ENZ(KD0,SEC0,ITER,ENZM,EKMIN,NN,NNV)
      ELSE 
	 WRITE(*,*)'GET_FRICTION: ILLEGAL CLOSURE ', CLOSURE
	 WRITE(2,*)'GET_FRICTION: ILLEGAL CLOSURE ', CLOSURE
	 STOP
      ENDIF
       

      RETURN
      END
