2014-04-01 18:37:27 +02:00
|
|
|
BEGIN_PROVIDER [ character*(128), ezfio_filename ]
|
|
|
|
implicit none
|
|
|
|
BEGIN_DOC
|
2014-04-07 17:36:19 +02:00
|
|
|
! Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment
|
|
|
|
! variable if it is set, or as the 1st argument of the command line.
|
2014-04-01 18:37:27 +02:00
|
|
|
END_DOC
|
2014-04-07 17:36:19 +02:00
|
|
|
|
|
|
|
! Get the QPACKAGE_INPUT environment variable
|
|
|
|
call getenv('QPACKAGE_INPUT',ezfio_filename)
|
|
|
|
if (ezfio_filename == '') then
|
|
|
|
! Get from the command line
|
|
|
|
integer :: iargc
|
|
|
|
call getarg(0,ezfio_filename)
|
|
|
|
if (iargc() /= 1) then
|
|
|
|
print *, 'Missing EZFIO file name in the command line:'
|
|
|
|
print *, trim(ezfio_filename)//' <ezfio_file>'
|
|
|
|
stop 1
|
|
|
|
endif
|
|
|
|
call getarg(1,ezfio_filename)
|
|
|
|
endif
|
|
|
|
|
|
|
|
! Check that file exists
|
|
|
|
logical :: exists
|
2014-04-07 20:01:30 +02:00
|
|
|
inquire(file=trim(ezfio_filename)//'/ezfio/creation',exist=exists)
|
2014-04-07 17:36:19 +02:00
|
|
|
if (.not.exists) then
|
|
|
|
print *, 'Error: file '//trim(ezfio_filename)//' does not exist'
|
2014-04-01 18:37:27 +02:00
|
|
|
stop 1
|
|
|
|
endif
|
2014-04-07 17:36:19 +02:00
|
|
|
|
2014-04-01 18:37:27 +02:00
|
|
|
call ezfio_set_file(ezfio_filename)
|
2014-04-07 17:36:19 +02:00
|
|
|
|
2014-04-01 18:37:27 +02:00
|
|
|
END_PROVIDER
|
2014-04-07 17:36:19 +02:00
|
|
|
|