Skip to content

Commit

Permalink
Merge pull request #61 from optados-developers/PR51
Browse files Browse the repository at this point in the history
This adds "PDOS String Reads labels" functionallity
  • Loading branch information
ajm143 authored Nov 14, 2024
2 parents 7445701 + f3d8e73 commit bb8a1a9
Show file tree
Hide file tree
Showing 44 changed files with 10,118 additions and 249 deletions.
17 changes: 14 additions & 3 deletions optados/documents/user_guide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
\def\red{\textcolor{red}}
\usepackage{lscape}

\usepackage{hyperref}

%\parskip=2mm
\newcommand{\kbf}{\mathbf{k}}
\renewcommand{\d}{\mathrm{d}}
Expand Down Expand Up @@ -415,12 +417,18 @@ \section{Installation}

Choose which compiler to use to make \optados. The valid values are:
\begin{itemize}
\item[{\bf --}] \verb#g95# (default)
\item[{\bf --}] \verb#gfortran#
\item[{\bf --}] \verb#gfortran# (default)
\item[{\bf --}] \verb#ifort#
\item[{\bf --}] \verb#nag#
\item[{\bf --}] \verb#pathscale#
\item[{\bf --}] \verb#pgf90#
\item[{\bf --}] \verb#AOOC#
\item[{\bf --}] \verb#oneAPI#
\end{itemize}

The following are no longer supported but are provided for legacy systems:
\begin{itemize}
\item[{\bf --}] \verb#g95#
\item[{\bf --}] \verb#pathscale#
\item[{\bf --}] \verb#sun#
\end{itemize}

Expand Down Expand Up @@ -741,6 +749,9 @@ \section{PDOS Parameters}
\item[{\bf --}] \verb#Si1(s;d)# (decompose onto 's' and 'd' channels for
atom Si1)
\item[{\bf --}] \verb#sum:C1:C3:C4-C8# (decompose onto atoms C1, C2 and C4,C5,C6,C7,C8 and combine into the single projection)
\item[{\bf --}] \verb#``C:Exi'':H# (decompose only onto site labelled C:Exi in \verb#seedname-out.cell# and Hydrogen sites)
\item[{\bf --}] \verb#``C'':H# (decompose only onto Carbon sites that \textit{are not labelled} in \verb#seedname-out.cell# and Hydrogen sites. \textit{N.B} this is the same as \verb#C:H# if no sites are labelled.)


\end{itemize}

Expand Down
34 changes: 23 additions & 11 deletions optados/src/electronic.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1149,9 +1149,8 @@ subroutine elec_pdos_read

! Band indices used in the read-in of the pdos
real(kind=dp) :: dummyr1, dummyr2, dummyr3
integer :: dummyi, ib, ik, is
integer :: dummyi, ib, ik, is, iorbitals
integer :: pdos_in_unit, ierr, inodes
logical :: full_debug_pdos_weights = .false.
character(filename_len) :: pdos_filename
real(kind=dp) :: time0, time1, file_version
real(kind=dp), parameter :: file_ver = 1.0_dp
Expand Down Expand Up @@ -1181,14 +1180,15 @@ subroutine elec_pdos_read
read (pdos_in_unit) pdos_mwab%nspins
read (pdos_in_unit) pdos_mwab%norbitals
read (pdos_in_unit) pdos_mwab%nbands
if (full_debug_pdos_weights) then
write (stdout, *) " ***** F U L L _ D E B U G _ P D O S _ W E I G H T S ***** "
write (stdout, *) "pdos_mwab%nkpoints= ", pdos_mwab%nkpoints
write (stdout, *) "pdos_mwab%nspins= ", pdos_mwab%nspins
write (stdout, *) "pdos_mwab%norbitals= ", pdos_mwab%norbitals
write (stdout, *) "pdos_mwab%nbands= ", pdos_mwab%nbands
write (stdout, *) " **** ***** ***** ***** ***** ***** ***** ***** ***** "
end if
if (iprint > 3) then
write (stdout, *) " +==========================================================================+"
write (stdout, *) " | D E B U G P D O S |"
write (stdout, *) " +==========================================================================+"
write (stdout, *) " pdos_mwab%nkpoints : ", pdos_mwab%nkpoints
write (stdout, *) " pdos_mwab%nspins : ", pdos_mwab%nspins
write (stdout, *) " pdos_mwab%norbitals: ", pdos_mwab%norbitals
write (stdout, *) " pdos_mwab%nbands : ", pdos_mwab%nbands
endif

allocate (pdos_orbital%species_no(pdos_mwab%norbitals), stat=ierr)
if (ierr /= 0) call io_error(" Error : cannot allocate pdos_orbital")
Expand All @@ -1200,6 +1200,18 @@ subroutine elec_pdos_read
read (pdos_in_unit) pdos_orbital%species_no(1:pdos_mwab%norbitals)
read (pdos_in_unit) pdos_orbital%rank_in_species(1:pdos_mwab%norbitals)
read (pdos_in_unit) pdos_orbital%am_channel(1:pdos_mwab%norbitals)
if (iprint > 3) then
write (stdout, *)
write (stdout, *) " +--------------------------------------------------------------------------+"
write (stdout, *) " pdos_orbital% "
write (stdout, *) " species_no rank_in_species am_channel"
write (stdout, *) " +--------------------------------------------------------------------------+"
do iorbitals = 1, pdos_mwab%norbitals
write (stdout, '(10x,i5,25x,i5,25x,i5)') pdos_orbital%species_no(iorbitals), pdos_orbital%rank_in_species(iorbitals), &
& pdos_orbital%am_channel(iorbitals)
end do
write (stdout, *) " +==========================================================================+ "
end if
!-------------------------------------------------------------------------!
end if
call comms_bcast(pdos_mwab%norbitals, 1)
Expand Down Expand Up @@ -1235,7 +1247,7 @@ subroutine elec_pdos_read
read (pdos_in_unit) dummyi ! this is the spin number
read (pdos_in_unit) nbands_occ(ik, is)
do ib = 1, nbands_occ(ik, is)
if (full_debug_pdos_weights) then
if (iprint > 3) then
write (stdout, *) " ***** F U L L _ D E B U G _ P D O S _ W E I G H T S ***** "
write (stdout, *) ib, ik, is
write (stdout, *) " **** ***** ***** ***** ***** ***** ***** ***** ***** "
Expand Down
15 changes: 11 additions & 4 deletions optados/src/parameters.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module od_parameters

use od_constants, only: dp
use od_io, only: stdout, maxlen
use od_cell, only: atoms_label, num_atoms, num_species, atoms_symbol, &
use od_cell, only: atoms_label, num_atoms, num_species, atoms_symbol, atoms_label, &
& atoms_species_num, atoms_pos_frac, atoms_pos_cart, num_crystal_symmetry_operations

implicit none
Expand Down Expand Up @@ -549,6 +549,7 @@ subroutine param_write_atomic_coord
implicit none

integer :: nat, nsp, atom_counter
character(len=maxlen) :: temp_symb

! System

Expand All @@ -558,14 +559,20 @@ subroutine param_write_atomic_coord
if (iprint > 2) then
write (stdout, '(1x,a)') '+----------------------------------------------------------------------------+'
if (lenconfac .eq. 1.0_dp) then
write (stdout, '(1x,a)') '| Site Fractional Coordinate Cartesian Coordinate (Ang) |'
write (stdout, '(1x,a)') '| Site Fractional Coordinate Cartesian Coordinate (Ang) |'
else
write (stdout, '(1x,a)') '| Site Fractional Coordinate Cartesian Coordinate (Bohr) |'
write (stdout, '(1x,a)') '| Site Fractional Coordinate Cartesian Coordinate (Bohr) |'
end if
write (stdout, '(1x,a)') '+----------------------------------------------------------------------------+'
do nsp = 1, num_species
do nat = 1, atoms_species_num(nsp)
write (stdout, '(1x,a1,1x,a2,1x,i3,3F10.5,3x,a1,1x,3F10.5,4x,a1)') '|', atoms_symbol(nsp), nat, &
! Use the atoms species unless atom label is present
if (trim(atoms_symbol(nsp)) .ne. trim(atoms_label(nsp))) then
temp_symb = atoms_label(nsp)
else
temp_symb = atoms_symbol(nsp)
endif
write (stdout, '(1x,a1,1x,a7,1x,i3,7x,3F8.4,3x,a1,1x,3F8.4,4x,a1)') '|', trim(temp_symb), nat, &
atoms_pos_frac(:, nat, nsp), '|', atoms_pos_cart(:, nat, nsp)*lenconfac, '|'
end do
end do
Expand Down
Loading

0 comments on commit bb8a1a9

Please sign in to comment.