From 99914bc7af81931c6788b9bfed720e2ad97414a9 Mon Sep 17 00:00:00 2001 From: pietrodelugas Date: Thu, 18 Aug 2016 13:41:08 +0000 Subject: [PATCH] now read_conf_from_file reads configuration for the xml output file. git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12784 c92efa57-630b-4861-b058-cf58834340f0 --- PW/src/read_conf_from_file.f90 | 25 +++++++++++++++++++++++++ PW/src/read_file.f90 | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/PW/src/read_conf_from_file.f90 b/PW/src/read_conf_from_file.f90 index 10ebe0c94..d0e0050d0 100644 --- a/PW/src/read_conf_from_file.f90 +++ b/PW/src/read_conf_from_file.f90 @@ -17,6 +17,11 @@ FUNCTION read_config_from_file(nat, at_old,omega_old, lmovecell, at, bg, omega, ! USE cellmd, ONLY : at_old, omega_old, lmovecell USE io_files, ONLY : tmp_dir, prefix USE pw_restart, ONLY : pw_readfile +#ifdef __XSD + USE pw_restart, ONLY : pw_readschema_file, init_vars_from_schema + USE qes_types_module, ONLY : output_type, input_type, parallel_info_type, general_info_type + USE qes_libs_module, ONLY : qes_reset_output, qes_reset_input, qes_reset_general_info, qes_reset_parallel_info +#endif ! IMPLICIT NONE ! @@ -26,6 +31,13 @@ FUNCTION read_config_from_file(nat, at_old,omega_old, lmovecell, at, bg, omega, REAL(DP),INTENT(inout) :: at(3,3), bg(3,3), omega REAL(DP),INTENT(inout) :: tau(3,nat) INTEGER :: ierr +#ifdef __XSD + TYPE ( output_type), ALLOCATABLE :: output_obj + TYPE ( input_type ), ALLOCATABLE :: input_obj + TYPE (parallel_info_type),ALLOCATABLE :: parinfo_obj + TYPE (general_info_type ),ALLOCATABLE :: geninfo_obj +#endif + ! ! WRITE( stdout, '(/5X,"Atomic positions and unit cell read from directory:", & @@ -33,7 +45,20 @@ FUNCTION read_config_from_file(nat, at_old,omega_old, lmovecell, at, bg, omega, ! ! ... check if restart file is present, if yes read config parameters ! +#ifdef __XSD + ALLOCATE (output_obj, input_obj, parinfo_obj, geninfo_obj) + CALL pw_readschema_file ( ierr, output_obj, input_obj, parinfo_obj, geninfo_obj) + IF (ierr == 0 ) THEN + CALL init_vars_from_schema ( 'config', ierr, output_obj, input_obj, parinfo_obj, geninfo_obj ) + CALL qes_reset_output(output_obj) + CALL qes_reset_input (input_obj) + CALL qes_reset_parallel_info (parinfo_obj) + CALL qes_reset_general_info (geninfo_obj) + END IF + DEALLOCATE ( output_obj, input_obj, parinfo_obj, geninfo_obj ) +#else CALL pw_readfile( 'config', ierr ) +#endif ! IF ( ierr > 0 ) THEN ! diff --git a/PW/src/read_file.f90 b/PW/src/read_file.f90 index c6eca4c32..2fa1c7264 100644 --- a/PW/src/read_file.f90 +++ b/PW/src/read_file.f90 @@ -199,7 +199,7 @@ SUBROUTINE read_xml_file_internal(withbs) ! ... first we get the version of the qexml file ! if not already read CALL init_vars_from_schema ( 'header', ierr, output_obj, input_obj, parinfo_obj, geninfo_obj ) - CALL errore( 'read_xml_file ', 'unable to determine qexml version', ABS(ierr) ) + CALL errore( 'read_xml_file ', 'unable to determine determine schema version', ABS(ierr) ) #else ! ... first we get the version of the qexml file ! if not already read