C     Custom f2py argument setter
      SUBROUTINE PYSETARGS(N, STRINGS)
      INTEGER N
      CHARACTER*120 STRINGS(50)
      COMMON /PYARGS/ NARGS, ARGS
      INTEGER NARGS
      CHARACTER*120 ARGS(50)
      INTEGER I

      NARGS = N - 1
      DO 10 I=1, N
         ARGS(I) = STRINGS(I)
   10 CONTINUE
      RETURN
      END

      SUBROUTINE MGTARG(I, NAME)
      COMMON /PYARGS/ NARGS, ARGS
      INTEGER NARGS
      CHARACTER*120 ARGS(50)
      INTEGER I
      CHARACTER*(*) NAME
      NAME = ARGS(I+1)
      RETURN
      END

      FUNCTION MNMARG()
      COMMON /PYARGS/ NARGS, ARGS
      INTEGER NARGS
      CHARACTER*120 ARGS(50)
      INTEGER MNMARG
      MNMARG = NARGS
      RETURN
      END
