INTEGER FUNCTION PROMPTDFILE( PROMPT, RDONLY, FMTTED, RECLEN, & DEFAULT, CALLER ) CHARACTER*(*), INTENT(IN ) :: PROMPT ! prompt for user LOGICAL , INTENT(IN ) :: RDONLY ! TRUE iff file is input-only LOGICAL , INTENT(IN ) :: FMTTED ! TRUE iff file should be formatted INTEGER , INTENT(IN ) :: RECLEN ! record length CHARACTER*(*), INTENT(IN ) :: DEFAULT ! default logical file name CHARACTER*(*), INTENT(IN ) :: CALLER ! caller-name for logging messages
Prompts user for logical file name, then opens the Fortran direct access file associated with it, for read-only or not, formatted or not, as indicated by RDONLY and FMTTED, and with the indicated record length RECLEN.
If environment variable PROMPTFLAG is set to "N", returns unit number associated with logical name contained in DEFAULT without prompting the user.
Logs the value returned, for tracking and validation purposes.
Returns
For Fortran-90 declarations and interface checking:
USE M3UTILIO
See also:
GETDFILE(),
GETEFILE(),
PROMPTFFILE(), and
PROMPTMFILE().
setenv <lname> <pathname>
for the file
before program launch.
... USE M3UTILIO ... INTEGER FOODEV, BARDEV, QUXDEV ... FOODEV = PROMPTDFILE( 'Enter name for foo-file', & .TRUE., .TRUE., 529, & 'FOO', 'MYSUB' ) IF ( FOODEV .LT. 0 ) THEN ... error opening foo-file: deal with it END IF ...
To: Models-3/EDSS I/O API: The Help Pages