INIT3() and init3c()

Fortran version:

    INTEGER FUNCTION  INIT3()

C version:

init3c() is a C wrapper calling the Fortran INIT3()
    int init3c( ) ;

Summary:

#include "iodecl3.h" for C.

INIT3() initializes the I/O API's internal data structures and returns the unit number for the log device (opening the file with logical name "LOGDEV" on that unit, if the logical name has been set, otherwise returning unit 6 for "standard Fortran output".

May be called multiple times; in which case, calls after the first simply return the unit number for the log file.

User may optionally supply a "scenario description file" with up to 60 lines of up to 80 characters each, by setenv'ing the logical name SCENFILE to the physical file name of the a user-supplied text file containing the scenario description. Contents of the scenario description file will be copied into the headers of all files opened for writing by the calling program.

User may optionally supply a file name for the working log file by setenv'ing the logical name LOGFILE to the path name.

User may optionally supply an "execution ID" character-string of up to 80 characters by setenv'ing the logical name EXECUTION_ID to it. Contents of the execution ID will be copied into the headers of all files opened for writing by the calling program. Note that you need to quote multi-word values for EXECUTION_ID:

    setenv  EXECUTION_ID  'This run will pling the Inghams'
    

Preconditions:

USE M3UTILIO or INCLUDE 'IODECL3.EXT' for Fortran, or #include "iodecl3.h" for C.

Repeated INIT3()- SHUT3() sequences within one program's execution may cause strange results. (Calls of INIT3() subsequent to SHUT3() will generate a warning message to the log).

Fortran Usage:

For Fortran-90 declarations and interface checking:
    USE M3UTILIO
    

    ...
    USE M3UTILIO
    ...
    INTEGER	  LOGUNIT
    ...
    LOGUNIT = INIT3( )
    !!  Now I/O API is set up, and LOGUNIT is the unit number 
    !!  for the log file (or is 6 for st'd output).
    ...

C Usage:

    ...
    #include "iodecl3.h"
    ...
    int  logunit ;
    ...
    logunit = init3c( ) ;
            /*  Now I/O API is set up, and LOGUNIT is the Fortran unit
                number for the log file (or is 6 for st'd Fortran 
                output).  */
    ...


Previous: DESC3

Next: INTERP3

Up: Public I/O Routines

To: Models-3/EDSS I/O API: The Help Pages