wstat.f90 1.76 KB
Newer Older
Marco Govoni's avatar
Marco Govoni committed
1
!
2
! Copyright (C) 2015-2017 M. Govoni 
Marco Govoni's avatar
Marco Govoni committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
! 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
!
!-----------------------------------------------------------------------
PROGRAM wstat
  !-----------------------------------------------------------------------
  ! 
  ! This is the main program that calculates the static screening.
  !
  USE check_stop,           ONLY : check_stop_init
  USE mp_global,            ONLY : mp_startup, mp_global_end
  USE west_environment,     ONLY : west_environment_start, west_environment_end
  USE mp,                   ONLY : mp_sum,mp_barrier
23
  USE wavefunctions_module, ONLY : evc
mahe's avatar
mahe committed
24
  USE function3d
25
  USE pwcom,                ONLY : npw,npwx
Marco Govoni's avatar
Marco Govoni committed
26
27
28
  ! 
  IMPLICIT NONE
  !
mahe's avatar
mahe committed
29
  INTEGER :: nx, ny, nz
Marco Govoni's avatar
Marco Govoni committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  CHARACTER(LEN=9) :: code = 'WSTAT'
  !
  ! *** START *** 
  !
  CALL check_stop_init ()
  !
  ! Initialize MPI, clocks, print initial messages
  !
#if defined(__MPI)
  CALL mp_startup ( start_images = .TRUE. )
#endif
  !
  CALL west_environment_start ( code )
  !
  CALL wstat_readin ( )
  !
  CALL wstat_setup ( )
  !
mahe's avatar
mahe committed
48
49
50
51
  !PRINT*, SHAPE(evc)
  !PRINT*, npw, npwx
  PRINT*, evc(1:100, 3)
  !
Marco Govoni's avatar
Bug fix    
Marco Govoni committed
52
53
  CALL write_function3d( 'wfcl.f3d', 30, 30, 30, npw, npwx, evc(:, 3))
  PRINT*, "WRITE FINISHED"
mahe's avatar
mahe committed
54
55
  !
  CALL read_function3d ( 'wfcl.f3d', nx, ny, nz, npw, npwx, evc(:, 3))
Marco Govoni's avatar
Bug fix    
Marco Govoni committed
56
  PRINT*, "READ FINISHED"
mahe's avatar
mahe committed
57
58
  PRINT*, nx, ny, nz
  PRINT*, evc(1:100, 3)
59
  !
Marco Govoni's avatar
Bug fix    
Marco Govoni committed
60
  STOP
61
  !
Marco Govoni's avatar
Marco Govoni committed
62
63
64
65
66
67
  CALL davidson_diago ( )
  !
  CALL exx_ungo ( )
  !
  CALL clean_scratchfiles( )
  !
Marco Govoni's avatar
Marco Govoni committed
68
  CALL west_print_clocks( )
Marco Govoni's avatar
Marco Govoni committed
69
70
71
72
73
74
  !
  CALL west_environment_end( code )
  !
  CALL mp_global_end()
  !
END PROGRAM