! ! Copyright (C) 2015-2019 M. Govoni ! This file is distributed under the terms of the ! GNU General Public License. See the file `LICENSE' ! in the root directory of the present distribution, ! or http://www.gnu.org/copyleft/gpl.txt . ! ! This file is part of WEST. ! ! Contributors to this file: ! Marco Govoni ! !----------------------------------------------------------------------- MODULE west_version !----------------------------------------------------------------------- ! USE forpy_mod, ONLY: list ! IMPLICIT NONE ! SAVE ! CHARACTER(LEN=*), PARAMETER :: west_version_number = 'checkit' CHARACTER(LEN=*), PARAMETER :: west_git_revision = 'unknown' CHARACTER(LEN=*), PARAMETER :: west_topdir = 'unset' LOGICAL, PARAMETER :: forpy_use_numpy = .FALSE. TYPE(list) :: paths ! CONTAINS ! SUBROUTINE start_forpy() ! USE forpy_mod, ONLY: forpy_initialize,get_sys_path,module_py,import_py,forpy_finalize ! IMPLICIT NONE ! INTEGER :: IERR TYPE(module_py) :: pymod ! IERR = forpy_initialize(forpy_use_numpy) IF(IERR/=0) CALL errore('forpy','Err: cannot init forpy',1) ! IERR = get_sys_path(paths) IF(IERR/=0) CALL errore('forpy','Err: cannot get_sys_path',1) ! IERR = paths%append(TRIM(ADJUSTL(west_topdir))//"/Pytools") IF(IERR/=0) CALL errore('forpy','Err: cannot append paths',1) ! ! Test: import west_fetch_input ! IERR = import_py(pymod,'west_fetch_input') IF(IERR/=0) THEN CALL forpy_finalize() CALL errore('forpy','Err: cannot import module',1) ENDIF ! END SUBROUTINE ! SUBROUTINE end_forpy() ! USE forpy_mod, ONLY: forpy_finalize ! IMPLICIT NONE ! CALL paths%destroy() CALL forpy_finalize() ! END SUBROUTINE ! END MODULE