
C **********************************************************************
C *                                                                    *
C *                        SUBROUTINE MYGETARG                         *
C *                                                                    *
C * Selects the correct Fortran routine for getting command line       *
C * arguments in dependence of the platform being used.                *
C *                                                                    *
C * Input parameters:                                                  *
C *   n: number of command line argument to be read                    *
C *                                                                    *
C * Output parameters:                                                 *
C *   buf: the nth command line argument                               *
C *                                                                    *
C * V7.1 MB                                                            *
C *                                                                    *
C **********************************************************************

#if defined(_CRAY)

      subroutine mygetarg (n,buf)

      implicit none

      integer       n,len,err
      character*(*) buf

      call pxfgetarg(n,buf,len,err)

      return
      end

#else

      subroutine mygetarg (n,buf)

      implicit none

      integer       n
      character*(*) buf

      call getarg(n,buf)

      return
      end

#endif

C **********************************************************************
C *                                                                    *
C *                          FUNCTION IARGC                            *
C *                                                                    *
C * Selects the correct Fortran function for counting command line     *
C * arguments.                                                         *
C *                                                                    *
C * Input parameters: none                                             *
C *                                                                    *
C * Output parameters: none                                            *
C *                                                                    *
C * Function value: number of arguments                                *
C *                                                                    *
C * V7.1 MB                                                            *
C *                                                                    *
C **********************************************************************

#if defined(_CRAY)

      integer function myiargc ()

      implicit none

      integer ipxfargc

      myiargc = ipxfargc()

      return
      end

#else

      integer function myiargc ()

      implicit none

      integer iargc

      myiargc = iargc()

      return
      end

#endif

C **********************************************************************
C *                                                                    *
C *                        FUNCTION COMPLEXSIZE                        *
C *                        FUNCTION REALSIZE                           *
C *                        FUNCTION INTEGERSIZE                        *
C *                        FUNCTION LOGICALSIZE                        *
C *                                                                    *
C * Returns the size in bytes of a complex / real / integer / logical  *
C * variable for the platform being used.                              *
C *                                                                    *
C * Input parameters: none                                             *
C * Output parameters: none                                            *
C * Function value: size (in bytes) of the corresponding data type     *
C *                                                                    *
C * V7.1 MB                                                            *
C *                                                                    *
C **********************************************************************

      integer function complexsize ()

      implicit none

#if defined(_CRAY)
      complexsize = 16
#else
      complexsize = 16
#endif
      return
      end

      integer function realsize ()

      implicit none

#if defined(_CRAY)
      realsize = 8
#else
      realsize = 8
#endif
      return
      end

      integer function integersize ()

      implicit none

#if defined(_CRAY)
      integersize = 8
#else
      integersize = 4
#endif
      return
      end

      integer function logicalsize ()

      implicit none

#if defined(_CRAY)
      logicalsize = 8
#else
      logicalsize = 4
#endif
      return
      end

