10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-08 07:03:57 +01:00
quantum_package/src/Ezfio_files/ezfio.irp.f

34 lines
966 B
Fortran
Raw Normal View History

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.
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'
stop 1
endif
2014-04-07 17:36:19 +02:00
call ezfio_set_file(ezfio_filename)
2014-04-07 17:36:19 +02:00
END_PROVIDER
2014-04-07 17:36:19 +02:00