5
public :: ival, manual, orbital, txt2wrd, die
13
character(len=*), intent(in) :: txt
16
integer :: tmp, iostat
19
!! read(txt,fmt=*,iostat=iostat) tmp
20
read(txt,fmt="(i10)",iostat=iostat) tmp
21
! Sometimes the above read succeeds
22
! for non-numeric strings...
23
!!!! if (tmp== 0 .or. iostat /= 0) then
25
! Not an integer, return -1 flag
33
subroutine txt2wrd (txt, wrd, nw, pepe)
36
character(len=*), intent(in) :: txt
37
character(len=20), intent(out) :: wrd(:)
38
integer, intent(out) :: nw
39
integer, intent(in) :: pepe
41
character(len=len(txt)+1) taux
42
integer :: i1, i2, nmaxwords
48
do while (len_trim(taux).ne.0)
50
if (nw.gt.nmaxwords) STOP "overflow in txt2wrd"
52
i2=index(taux(i1+1:),' ')+i1
54
taux(i1:i2-1)=repeat(' ',i2-i1)
56
end subroutine txt2wrd
58
subroutine orbital (txt, ia, c, n, l, k)
60
character(len=*), intent(in) :: txt
61
character(len=*), intent(out) :: c
62
integer, intent(out) :: ia, n, l, k
64
character(len=len(txt)) :: atx, ntx
65
integer :: i_, i0, lng, il
75
! Defaults meaning "not specified"
83
if (i_.eq.1) return ! Error
87
ntx=txt(1:i0)//repeat(' ',20-i0)
89
if (ia.eq.-1) then ! Label specified
90
if (i0.gt.2) return ! No more stuff
97
! Now search for shell info
100
atx=txt(i_+1:20)//repeat(' ',i_)
102
il=scan(atx,'spdfgh')
103
if ((il.ne.0).and.(il.ne.1).and.(scan(atx,'spdfgh',back=.true.).eq.il)) then
104
l=index('spdfgh',atx(il:il))-1
111
ntx=atx(1:il-1)//repeat(' ',20-il+1)
113
if (n.eq.-1) then !! error
118
! m quantum number (actually index)
123
ntx=atx(il+1:20)//repeat(' ',il)
125
if (trim(ntx).eq.'y') k=1
126
if (trim(ntx).eq.'z') k=2
127
if (trim(ntx).eq.'x') k=3
130
if (trim(ntx).eq.'xy') k=1
131
if (trim(ntx).eq.'yz') k=2
132
if (trim(ntx).eq.'z2') k=3
133
if (trim(ntx).eq.'xz') k=4
134
if (trim(ntx).eq.'x2-y2') k=5
138
if ((k.eq.-1).or.(k.le.0).or.(k.gt.2*l+1)) then
146
endsubroutine orbital
150
write(6,"('* MPROP PROGRAM')")
151
write(6,"(' Miquel Llunell, Universitat de Barcelona, 2005')")
152
write(6,"(' Alberto Garcia, ICMAB-CSIC, 2007')")
154
write(6,"(' MPROP calculates both DOS projections and COOP curves')")
155
write(6,"(' using output files obtained with SIESTA. The atomic orbital (AO)')")
156
write(6,"(' sets are defined in an input file (MLabel.mpr).')")
158
write(6,*) "Usage: mprop [ options ] MPROP_FILE_BASENAME"
159
write(6,*) "Options:"
160
write(6,*) " -h: print manual "
161
write(6,*) " -d: debug "
162
write(6,*) " -l: print summary of energy information "
163
write(6,*) " -s SMEAR : set value of smearing parameter (default 0.5 eV)"
164
write(6,*) " -m Min_e : set lower bound of energy range "
165
write(6,*) " -M Max_e : set upper bound of energy range "
167
write(6,"('* .mpr FILE STRUCTURE')")
168
write(6,"(' SLabel # Name of the siesta output files')")
169
write(6,"(' DOS/COOP # Define the curve type to be calculated')")
170
write(6,"(' /-[ If DOS selected; as many blocks as projections wanted ]')")
171
write(6,"(' | projection_name # DOS projection name')")
172
write(6,"(' \- Subset of AO (*) # Subset of orbitals included')")
173
write(6,"(' /-[ If COOP selected; as many blocks as projections wanted ]')")
174
write(6,"(' | curve_name # COOP curve name')")
175
write(6,"(' | Subset I of AO (*) # Reference atoms or orbitals')")
176
write(6,"(' | d1 d2 # Distance range')")
177
write(6,"(' \- Subset II of AO (*) # Neighbour atoms or orbitals')")
178
write(6,"(' (*) See below how to define subsets of AO')")
179
write(6,"('* INPUT FILES')")
180
write(6,"(' [output files from SIESTA >= 2.4.1]')")
181
write(6,"(' SLabel.WFSX and SLabel.HSX (new format)')")
183
write(6,"('* OUTPUT FORMAT')")
185
write(6,*) " SLabel.alldos : full-range approximate DOS curve"
186
write(6,*) " SLabel.ados : specified-range approximate DOS curve"
187
write(6,*) " SLabel.intdos : full-range integrated-DOS curve"
188
write(6,*) " MLabel.CurveName.pdos : PDOS curves"
189
write(6,*) " MLabel.CurveName.coop : COOP curves"
190
write(6,*) " MLabel.CurveName.cohp : COHP curves"
191
write(6,"(' [A control .stt file will always be generated]')")
193
write(6,"('* PROJECTION AND CURVES NAMES')")
194
write(6,"(' Alphanumerical string up to 30 char. with no spaces')")
195
write(6,"('* SUBSET OF AO USING ORDER NUMBERS')")
196
write(6,"(' List of integer numbers preceeded by a + symbol')")
197
write(6,"(' Each number refers to one AO in the final list of AO of SIESTA')")
198
write(6,"(' Example: + 23 65 78')")
199
write(6,"('* SUBSET OF AO USING ATOM_SHELL NOTATION')")
200
write(6,"(' List of atoms and shell groups of AO')")
201
write(6,"(' General notation: ATOM_SHELL')")
202
write(6,"(' > ATOM: Atomic symbol refers to all the atoms of that type')")
203
write(6,"(' Integer number refers to the N-th atom in unit cell')")
204
write(6,"(' > SHELL: Integer1+Letter+Integer2')")
205
write(6,"(' > Integer1 refers to the n quantum number')")
206
write(6,"(' > Letter refers to the l quantum number (s,p,d,f,g,h)')")
207
write(6,"(' > Integer2 refers to a single AO into the n-l shell')")
208
write(6,"(' Alternatively alphanimerical strings can be used')")
209
write(6,"(' p-shells 1 y d-shells 1 xy 4 xz')")
210
write(6,"(' 2 z 2 yz 5 x2-y2')")
211
write(6,"(' 3 x 3 z2')")
212
write(6,"(' Particular cases:')")
213
write(6,"(' > Just ATOM is indicated: all the AO of the atom will be included')")
214
write(6,"(' > No value for Integer2: all the AO of the shell will be included')")
215
write(6,"(' Example: Ca_3p Al 4_4d3 5 O_2py')")
218
end subroutine manual