CHARACTER*16 FUNCTION PROMPTMFILE( PROMPT, FMODE, DEFAULT, CALLER ) CHARACTER*(*) PROMPT ! prompt for user INTEGER FMODE ! file opening-mode CHARACTER*(*) DEFAULT ! default logical file name CHARACTER*(*) CALLER ! caller-name for logging messages
Prompts user for logical file name, then uses OPEN3() to open the I/O API file associated with it according to the indicated FMODE:
NOTE: Joan Novak (EPA) and Ed Bilicki (MCNC) have declared as a software standard that modeling programs may not use FSCREA3 as the mode for opening files. FSCREA3 is reserved for use by analysis/data extraction programs only.
If environment variable PROMPTFLAG is set to "N", returns the logical name contained in DEFAULT without prompting the user.
Logs the value returned, for tracking and validation purposes.
For Fortran-90 declarations and interface checking:
See also OPEN3(), PROMPTDFILE(), and PROMPTFFILE().
setenv <lname> <pathname> for the file
before program launch.
File name must have length at most 16.
For FSREAD3 or FSRDWR3, file must already exist.
For FSNEW3, file must not already exist.
For FSNEW3, FSUNKN3, or FSCREA3, caller must supply file description (which must follow Models-3 date and time conventions ).
I/O API must already be initialized by a call to INIT3() or init3c().
Must not be called for read/write/update (FSRDWR3, FSNEW3, FSUNK3, or FSCREA3) on a file already open for read-only (FSREAD3).
Must not be called for new (FSNEW3) on a file already open.
... USE M3UTILIO ... CHARACTER*16 FNAME ... ... set up file description if FDESC3 COMMONs... FNAME = PROMPTMFILE( & 'Enter optional file name for FOO (or "NONE")', & FSUNKN3, 'FOO', 'me' ) IF ( FNAME .EQ. 'NONE" ) THEN ... user doesn't want output foo-file END IF ...
Up: Utility Routines
To: Models-3/EDSS I/O API: The Help Pages