view libcruft/ranlib/getcgn.f @ 14204:704f7895eef0 stable release-3-6-0 release-3.6.0

Version 3.6.0 released. * configure.ac (AC_INIT): Version is now 3.6.0. (OCTAVE_API_VERSION_NUMBER): Now 48. (OCTAVE_RELEASE_DATE): Now 2012-01-15.
author John W. Eaton <jwe@octave.org>
date Sun, 15 Jan 2012 13:02:42 -0500
parents 0e71ead7359d
children
line wrap: on
line source

      SUBROUTINE getcgn(g)
      INTEGER g
C**********************************************************************
C
C      SUBROUTINE GETCGN(G)
C                         Get GeNerator
C
C     Returns in G the number of the current random number generator
C
C
C                              Arguments
C
C
C     G <-- Number of the current random number generator (1..32)
C                    INTEGER G
C
C**********************************************************************
C
      INTEGER curntg,numg
      SAVE curntg
      PARAMETER (numg=32)
      DATA curntg/1/
C
      g = curntg
      RETURN

      ENTRY setcgn(g)
C**********************************************************************
C
C     SUBROUTINE SETCGN( G )
C                      Set GeNerator
C
C     Sets  the  current  generator to G.    All references to a generat
C     are to the current generator.
C
C
C                              Arguments
C
C
C     G --> Number of the current random number generator (1..32)
C                    INTEGER G
C
C**********************************************************************
C
C     Abort if generator number out of range
C
      IF (.NOT. (g.LT.0.OR.g.GT.numg)) GO TO 10
      WRITE (*,*) ' Generator number out of range in SETCGN:',
     +  ' Legal range is 1 to ',numg,' -- ABORT!'
      CALL XSTOPX (' Generator number out of range in SETCGN')

   10 curntg = g
      RETURN

      END