Eötvös Quantum Utilities  v4.9.146
Providing the Horsepowers in the Quantum Realm
hsx_EQuUs.f90
Go to the documentation of this file.
1 !======================================================================
2 ! Wrapper module to call the functions in the module hsx_m from the SIESTA package.
3 ! This file is part of the EQuUs package. (for details see: http://eqt.elte.hu/equus/home)
4 ! Copyright (C) 2016 Peter Rakyta, Ph.D.
5 !
6 ! This program is free software: you can redistribute it and/or modify
7 ! it under the terms of the GNU General Public License as published by
8 ! the Free Software Foundation, either version 3 of the License, or
9 ! (at your option) any later version.
10 !
11 ! This program is distributed in the hope that it will be useful,
12 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ! GNU General Public License for more details.
15 !
16 ! You should have received a copy of the GNU General Public License
17 ! along with this program. If not, see http://www.gnu.org/licenses/.
18 !
19 !======================================================================
20 MODULE hsx_equus
21 
22  use equus_c
23  use hsx_m
24 
25  type(hsx_t), public :: hsx
26 
27 
28 
29 !****************************************************************
30  CONTAINS
31 !****************************************************************
32 
33 
34 
35 
36 !-------------------------------------------------------------------------------------------------
37 ! DESCRIPTION:
44 !
45  subroutine read_hsx( fname, fname_len, eq_struct)
46 
47 
48  integer*8 fname_len
49  character(len=fname_len), intent(in) :: fname
50  logical :: file_exist
51 
52  TYPE(eqstruct) :: eq_struct
53  TYPE(eqelement), target :: eq_elements(26)
54 
55 
56 
57 ! double check for the existence of the file
58  inquire(file=fname, exist=file_exist)
59  if (.not.file_exist) then
60  print *, 'File does not exist'
61  stop
62  endif
63 
64 
65  ! Obtaining the HSX structure
66  call read_hsx_file( hsx, fname )
67 
68 
69  call assocelement( eq_elements(1), "nspecies", hsx%nspecies )
70  call assocelement( eq_elements(2), "na_u", hsx%na_u )
71  call assocelement( eq_elements(3), "no_u", hsx%no_u )
72  call assocelement( eq_elements(4), "no_s", hsx%no_s )
73  call assocelement( eq_elements(5), "nspin", hsx%nspin )
74  call assocelement( eq_elements(6), "nh", hsx%nh )
75  call assocelement( eq_elements(7), "gamma", hsx%gamma )
76  call assocelement( eq_elements(8), "has_xij", hsx%has_xij )
77  call assocelement( eq_elements(9), "no", hsx%no )
78  call assocelement( eq_elements(10), "nquant", hsx%nquant )
79  call assocelement( eq_elements(11), "lquant", hsx%lquant )
80  call assocelement( eq_elements(12), "zeta", hsx%zeta )
81  call assocelement( eq_elements(13), "iaorb", hsx%iaorb )
82  call assocelement( eq_elements(14), "iphorb", hsx%iphorb )
83  call assocelement( eq_elements(15), "label", hsx%label )
84  call assocelement( eq_elements(16), "numh", hsx%numh )
85  call assocelement( eq_elements(17), "listhptr", hsx%listhptr )
86  call assocelement( eq_elements(18), "listh", hsx%listh )
87  call assocelement( eq_elements(19), "indxuo", hsx%indxuo )
88  call assocelement( eq_elements(20), "hamilt", hsx%hamilt )
89  call assocelement( eq_elements(21), "Sover", hsx%Sover )
90  call assocelement( eq_elements(22), "xij", hsx%xij )
91  call assocelement( eq_elements(23), "isa", hsx%isa )
92  call assocelement( eq_elements(24), "zval", hsx%zval )
93  call assocelement( eq_elements(25), "qtot", hsx%qtot )
94  call assocelement( eq_elements(26), "temp", hsx%temp )
95 
96 
97  eq_struct%fields = c_loc(eq_elements(1))
98  eq_struct%numfields = SIZE( eq_elements, 1 )
99 
100 
101  end subroutine read_hsx
102 
103 
104 
105 
106 end module
107 
108 
type(hsx_t), public hsx
Definition: hsx_EQuUs.f90:25
subroutine read_hsx(fname, fname_len, eq_struct)
Definition: hsx_EQuUs.f90:46