aboutsummaryrefslogtreecommitdiff
path: root/captain/db.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/db.f90')
-rw-r--r--captain/db.f909
1 files changed, 9 insertions, 0 deletions
diff --git a/captain/db.f90 b/captain/db.f90
index e191af7..2dc1cff 100644
--- a/captain/db.f90
+++ b/captain/db.f90
@@ -10,9 +10,18 @@ implicit none
contains
subroutine initialize_db(filename)
+ use logging
implicit none
character(*), intent(in)::filename
+ logical::exists
+
+ inquire(file=filename, exist=exists)
+ if(.not. exists) then
+ call write_log("Database does not exist, exiting")
+ call shutdown()
+ stop
+ end if
if(sqlite3_open(filename, db) == SQLITE_OK) then
database_file = filename