Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CreateSQLiteDatabase
! SUBROUTINE INFORMATION:
! AUTHOR Greg Stark
! DATE WRITTEN July 2008
! MODIFIED January 2010, Kyle Benne, Added tabular tables
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine creates and opens the SQL database (i.e., eplusout.sql)
! METHODOLOGY EMPLOYED:
! Standard SQL92 queries and commands via the Fortran SQLite3 API
! REFERENCES:
! na
! USE STATEMENTS:
USE ISO_C_FUNCTION_BINDING
USE InputProcessor
USE DataGlobals, ONLY: MaxNameLength
USE DataPrecisionGlobals, ONLY: r64
USE DataSystemVariables, ONLY: DDOnly
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=255) :: nameString
CHARACTER(len=MaxNameLength), DIMENSION(5) :: Alphas
REAL(r64), DIMENSION(2) :: Number
INTEGER NumAlpha, NumNumber, IOStat
INTEGER :: result
!unused INTEGER :: DATE_TIME (8)
INTEGER :: NumberOfSQLiteObjects = 0
NumberOfSQLiteObjects = GetNumObjectsFound('Output:SQLite')
IF (NumberOfSQLiteObjects == 1) THEN
WriteOutputToSQLite = .TRUE.
CALL GetObjectItem('Output:SQLite',1,Alphas,NumAlpha,Number,NumNumber,IOStat)
SELECT CASE(MakeUPPERCase(Alphas(1)))
CASE('SIMPLEANDTABULAR')
nameString = 'eplusout.sql'
WriteTabularDataToSQLite = .TRUE.
CASE('SIMPLE')
nameString = 'eplusout.sql'
CASE DEFAULT
CALL ShowSevereError('Output:SQLite Object, Option Type = ' //Alphas(1))
CALL ShowContinueError('Valid choices are "Simple" and "SimpleAndTabular"')
WriteOutputToSQLite = .FALSE.
WriteTabularDataToSQLite = .FALSE.
END SELECT
ELSE
WriteTabularDataToSQLite = .FALSE.
WriteOutputToSQLite = .FALSE.
END IF
IF (DDOnly) THEN
WriteTabularDataToSQLite = .FALSE.
WriteOutputToSQLite = .FALSE.
ENDIF
IF (WriteOutputToSQLite) THEN
result = SQLiteOpenDatabaseMacro (nameString)
! If the result from the open command is none zero, then the db failed to open and we issue a fatal error
IF (result .NE. 0) THEN
CALL ShowFatalError('The SQLite database failed to open. Please close any ' &
// 'programs that might already be accessing the database.')
END IF
result = SQLiteExecuteCommandMacro ('PRAGMA locking_mode = EXCLUSIVE;')
result = SQLiteExecuteCommandMacro ('PRAGMA journal_mode = OFF;')
result = SQLiteExecuteCommandMacro ('PRAGMA synchronous = OFF;')
CALL InitializeSQLiteTables
! CALL InitializeIndexes
IF (WriteTabularDataToSQLite) THEN
CALL InitializeTabularDataTable
CALL InitializeTabularDataView
END IF
END IF
END SUBROUTINE CreateSQLiteDatabase