asnctl

Date:

10-20-2011

NAME

ASNCTL - Controls functions of ASSIGN, ASNFILE, ASNUNIT, and ASNRM routines

SYNOPSIS

CALL ASNCTL(option, value, ier)

DESCRIPTION

When using the Cray Fortran compiler, all arguments must be of default kind unless documented otherwise. On Cray systems, default kind is KIND=4 for integer, real, complex, and logical arguments.

The following is a list of valid arguments for this routine:

option

A Fortran character variable containing either of the following values.

  • Note: The ‘LOCAL’ and ‘NEWLOCAL’ modes are useful for any utility written in Fortran when you want to use ASSIGN(3F) but do not want to access the assign environment file set up by the user.

    ‘LOCAL’

    Causes ASNCTL to establish a local assign environment. The old assign environment is copied into the newly created local assign environment. Subsequent calls to ASSIGN, ASNUNIT, ASNFILE, and ASNRM (see ASSIGN(3F)) affect only the newly created local assign environment. Any future Fortran OPEN requests will also read from the local assign environment initiated by this call to ASNCTL. The user must set value to 1 when calling ASNCTL with option=‘LOCAL’.

    ‘NEWLOCAL’

    Causes ASNCTL to establish an empty local assign environment. Subsequent calls to ASSIGN, ASNUNIT, ASNFILE, and ASNRM (see ASSIGN(3F)) affect the newly created local assign environment. Any future Fortran OPEN requests will also read from the local assign environment initiated by this call to ASNCTL. The user must set value to 1 when calling ASNCTL with option=‘NEWLOCAL’.

    ‘RESTORE’

    Restores the assign environment that was active before the preceding ‘LOCAL’ or ‘NEWLOCAL’ request. Sets value to 1 when calling ASNCTL with option=‘RESTORE’.

value

Integer KIND=4 variable, constant, or array element containing the option value.

ier

Integer KIND=4 variable or array element that is assigned the error status on return. Zero (0) is usually returned, indicating that no errors were encountered; otherwise a positive error status is returned.

EXAMPLES

The writer of the following Fortran program wants to disregard any assign information provided by the user. However, the program requires sequential unformatted I/O on unit 11 with an unblocked file structure. This is accomplished by the following code:

INTEGER (KIND=4) IER
CALL ASNCTL('NEWLOCAL',1,ier)                        ! start local assign environment
CALL ASNUNIT(11_4,'-s unblocked',ier)        ! assign the "unblocked" file structure
OPEN(11,form='unformatted')                          ! open unit 11

SEE ALSO

ASSIGN(3F)