2003-01-20 05:58:50 +08:00
|
|
|
!
|
2006-03-14 01:21:46 +08:00
|
|
|
! Copyright (C) 2001-2006 Quantum-ESPRESSO group
|
2003-01-20 05:58:50 +08:00
|
|
|
! 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 .
|
|
|
|
!
|
2004-08-23 14:51:19 +08:00
|
|
|
!----------------------------------------------------------------------------
|
2003-12-10 22:57:07 +08:00
|
|
|
SUBROUTINE init_run()
|
2004-08-23 14:51:19 +08:00
|
|
|
!----------------------------------------------------------------------------
|
2003-01-20 05:58:50 +08:00
|
|
|
!
|
2007-09-21 20:10:25 +08:00
|
|
|
USE klist, ONLY : nkstot
|
|
|
|
USE wvfct, ONLY : nbnd, et, wg, btype
|
|
|
|
USE control_flags, ONLY : lmd
|
|
|
|
USE dynamics_module, ONLY : allocate_dyn_vars
|
2007-11-12 22:49:09 +08:00
|
|
|
USE paw_variables, ONLY : okpaw
|
|
|
|
USE paw_init, ONLY : paw_init_onecenter, allocate_paw_internals
|
2007-11-13 23:15:28 +08:00
|
|
|
#ifdef __PARA
|
|
|
|
USE paw_init, ONLY : paw_post_init
|
|
|
|
#endif
|
2007-10-18 03:12:51 +08:00
|
|
|
USE bp, ONLY : lberry, lelfield
|
2003-04-22 04:42:34 +08:00
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
IMPLICIT NONE
|
2003-04-22 04:42:34 +08:00
|
|
|
!
|
|
|
|
!
|
2003-10-17 00:30:12 +08:00
|
|
|
CALL start_clock( 'init_run' )
|
2003-04-22 04:42:34 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL setup()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
! ... allocate memory for G- and R-space fft arrays
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL allocate_fft()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
! ... generate reciprocal-lattice vectors and fft indices
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL ggen()
|
2006-01-31 00:17:30 +08:00
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL summary()
|
2006-01-31 00:17:30 +08:00
|
|
|
!
|
|
|
|
! ... allocate memory for all other arrays (potentials, wavefunctions etc)
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL allocate_nlpot()
|
2007-11-13 23:15:28 +08:00
|
|
|
IF (okpaw) THEN
|
|
|
|
CALL allocate_paw_internals()
|
|
|
|
CALL paw_init_onecenter()
|
|
|
|
ENDIF
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL allocate_locpot()
|
|
|
|
CALL allocate_wfc()
|
2007-10-18 03:12:51 +08:00
|
|
|
CALL allocate_bp_efield()
|
|
|
|
IF( lberry .or. lelfield) call bp_global_map()
|
2007-07-10 19:15:31 +08:00
|
|
|
CALL memory_report()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2006-04-25 01:32:08 +08:00
|
|
|
ALLOCATE( et( nbnd, nkstot ) , wg( nbnd, nkstot ), btype( nbnd, nkstot ) )
|
2006-03-14 01:21:46 +08:00
|
|
|
!
|
2006-01-31 00:17:30 +08:00
|
|
|
et(:,:) = 0.D0
|
2006-04-19 23:49:58 +08:00
|
|
|
wg(:,:) = 0.D0
|
2006-01-31 00:17:30 +08:00
|
|
|
!
|
2006-04-25 01:32:08 +08:00
|
|
|
btype(:,:) = 1
|
|
|
|
!
|
2003-12-10 22:57:07 +08:00
|
|
|
CALL openfil()
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2006-08-09 05:25:26 +08:00
|
|
|
CALL init_h()
|
2007-11-13 23:15:28 +08:00
|
|
|
!
|
|
|
|
! Finish to initialize PAW data and cleanup
|
|
|
|
! arrays that are only used for init (parallel only)
|
|
|
|
#ifdef __PARA
|
|
|
|
IF (okpaw) CALL paw_post_init()
|
|
|
|
#endif
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
2006-01-14 01:25:42 +08:00
|
|
|
IF ( lmd ) CALL allocate_dyn_vars()
|
|
|
|
!
|
2006-04-25 01:32:08 +08:00
|
|
|
CALL stop_clock( 'init_run' )
|
2003-10-17 00:30:12 +08:00
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE init_run
|
2006-08-09 05:25:26 +08:00
|
|
|
!
|
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
SUBROUTINE init_h()
|
|
|
|
!----------------------------------------------------------------------------
|
|
|
|
!
|
|
|
|
IMPLICIT NONE
|
|
|
|
!
|
|
|
|
CALL hinit0()
|
|
|
|
CALL potinit()
|
|
|
|
!
|
|
|
|
CALL newd()
|
|
|
|
!
|
2007-03-15 10:27:04 +08:00
|
|
|
CALL wfcinit()
|
2006-08-09 05:25:26 +08:00
|
|
|
!
|
|
|
|
RETURN
|
|
|
|
!
|
|
|
|
END SUBROUTINE init_h
|