!*******************************************************************************
!$RCSfile$
!$Revision$
!$Date$
!*******************************************************************************

!------ McWIF interface module

MODULE McWIFintrf

  INTERFACE

    INTEGER FUNCTION SetMcWIF( grid,u,v,w,th,p,alpha,csq,DivScale )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN  ) :: grid
      REAL, DIMENSION(:),    POINTER :: u, v, w, th, p, alpha, csq
      REAL,            INTENT( OUT ) :: DivScale
    END FUNCTION SetMcWIF

    INTEGER FUNCTION RelaxMcWIF( grid,u,v,w,p,alpha,csq,DivScale )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN ) :: grid
      REAL, DIMENSION(:),   POINTER :: u, v, w, p, alpha, csq
      REAL,            INTENT( IN ) :: DivScale
    END FUNCTION RelaxMcWIF

    INTEGER FUNCTION FFTMcWIF( grid,u,v,w,p,alpha,csq )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN ) :: grid
      REAL, DIMENSION(:),   POINTER :: u, v, w, p, alpha, csq
    END FUNCTION FFTMcWIF

  END INTERFACE

END MODULE McWIFintrf

!==============================================================================

MODULE McWIFsubIntrf

  INTERFACE

    SUBROUTINE StepRelaxP( grid,u,v,w,p,alpha,csq,divmax )
      USE SWIM_fi
       TYPE( MetGrid ), INTENT( IN  ) :: grid
       REAL, DIMENSION(:),    POINTER :: u, v, w, p, alpha, csq
       REAL,            INTENT( OUT ) :: divmax
    END SUBROUTINE StepRelaxP

    SUBROUTINE StepU( grid,u,v,w,p,alpha )
      USE SWIM_fi
      USE SWIMparam_fd
       TYPE( MetGrid ), INTENT( IN  ) :: grid
       REAL, DIMENSION(:),    POINTER :: u, v, w, p, alpha, csq
    END SUBROUTINE StepU

    SUBROUTINE SetBC( grid,u,v,w )
      USE SWIM_fi
      USE SWIMparam_fd
      TYPE( MetGrid ), INTENT( IN  ) :: grid
      REAL, DIMENSION(:),    POINTER :: u, v, w
    END SUBROUTINE SetBC

    SUBROUTINE SetFFTsrce( grid,u,v,w,p,psrce )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN ) :: grid
      REAL, DIMENSION(:),   POINTER :: u, v, w, p, psrce
    END SUBROUTINE SetFFTsrce

    INTEGER FUNCTION IterFFT( grid,p,pm,psrce )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN ) :: grid
      REAL, DIMENSION(:),   POINTER :: p, pm, psrce
    END FUNCTION IterFFT

    INTEGER FUNCTION ZeroNetFlux( grid,u,v )
      USE SWIM_fi
      TYPE( MetGrid ), INTENT( IN  ) :: grid
      REAL, DIMENSION(:),    POINTER :: u, v
    END FUNCTION ZeroNetFlux

  END INTERFACE

END MODULE McWIFsubIntrf

MODULE MGfield_fd
  INTEGER MGfield_str_xxx
END MODULE MGfield_fd

