FLASH-X
Doxygen Generated Documentation From Interface Source Code
Functions/Subroutines
Logfile_open.F90 File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine Logfile_open (logUnit, logUnitLocal)
 

Function/Subroutine Documentation

◆ Logfile_open()

subroutine Logfile_open ( integer  logUnit,
logical  logUnitLocal 
)

FLASH supports two types of logfiles. One that keeps track of the global state of the simulation, and another type that logs local information from each processor separately. A simulation generates at most one global logfile, whereas the number of local logfiles generated by the simulation can be anywhere from 0 to the number of processors in the simulation.

This function opens the global log file, either in append mode if it already exists or as a new file.

The local logfiles are expected to be used mostly for diagnostic purposes. The local logfiles are always opened in the append mode, and the handle is returned to the calling routine. It is the responsibility of the calling routine to call Logfile_close after it has finished writing to the logfile.

logUnit - the handle for the file opened by the function, returns a 0 if no file has been opened logUnitLocal - if true, indicates that the local logfile should be opened. By default the global logfile is opened.

EXAMPLE

Any code unit can include the following statements to log local processor related information in the local logfile

logUnitLocal=.true. call Logfile_open(logUnit,logUnitLocal) if(logUnit/=0) then write(logUnit,*)'I am logging some information' call Logfile_close(logUnitLocal) end if

Definition at line 53 of file Logfile_open.F90.