LCOV - code coverage report
Current view: top level - src/80_rttddft - m_rttddft_propagate.F90 (source / functions) Coverage Total Hit
Test: coverage.info Lines: 90.9 % 11 10
Test Date: 2026-11-10 13:31:01 Functions: 100.0 % 1 1
Branches: 71.4 % 7 5

             Branch data     Line data    Source code
       1                 :             : !!****m* ABINIT/m_rttddft_propagate
       2                 :             : !! NAME
       3                 :             : !!  m_rttddft_propagate
       4                 :             : !!
       5                 :             : !! FUNCTION
       6                 :             : !!  Driver to perform electronic or nuclear step
       7                 :             : !!
       8                 :             : !! COPYRIGHT
       9                 :             : !!  Copyright (C) 2021-2026 ABINIT group (FB)
      10                 :             : !!  This file is distributed under the terms of the
      11                 :             : !!  GNU General Public License, see ~abinit/COPYING
      12                 :             : !!  or http://www.gnu.org/copyleft/gpl.txt .
      13                 :             : !!
      14                 :             : !! SOURCE
      15                 :             : 
      16                 :             : #if defined HAVE_CONFIG_H
      17                 :             : #include "config.h"
      18                 :             : #endif
      19                 :             : 
      20                 :             : #include "abi_common.h"
      21                 :             : 
      22                 :             : module m_rttddft_propagate
      23                 :             : 
      24                 :             :  use defs_basis
      25                 :             :  use defs_abitypes,         only: MPI_type
      26                 :             :  use defs_datatypes,        only: pseudopotential_type
      27                 :             : 
      28                 :             :  use m_dtset,               only: dataset_type
      29                 :             :  use m_errors,              only: msg_hndl
      30                 :             :  use m_hamiltonian,         only: gs_hamiltonian_type
      31                 :             :  use m_rttddft,             only: rttddft_setup_ele_step
      32                 :             :  use m_rttddft_propagators, only: rttddft_propagator_er, &
      33                 :             :                                 & rttddft_propagator_emr
      34                 :             :  use m_rttddft_tdks,        only: tdks_type
      35                 :             :  use m_specialmsg,          only: wrtout
      36                 :             : 
      37                 :             :  implicit none
      38                 :             : 
      39                 :             :  private
      40                 :             : !!***
      41                 :             : 
      42                 :             :  public :: rttddft_propagate_ele
      43                 :             : !public :: rttddft_propagate_nuc
      44                 :             : !!***
      45                 :             : 
      46                 :             : contains
      47                 :             : !!***
      48                 :             : 
      49                 :             : !!****f* m_rttddft/rttddft_propagate_ele
      50                 :             : !!
      51                 :             : !! NAME
      52                 :             : !!  rttddft_propagate_ele
      53                 :             : !!
      54                 :             : !! FUNCTION
      55                 :             : !!  Main subroutine to propagate time-dependent KS orbitals
      56                 :             : !!
      57                 :             : !! INPUTS
      58                 :             : !!  dtset <type(dataset_type)>=all input variables for this dataset
      59                 :             : !!  istep <integer> = step number
      60                 :             : !!  mpi_enreg <MPI_type> = MPI-parallelisation information
      61                 :             : !!  psps <type(pseudopotential_type)> = variables related to pseudopotentials
      62                 :             : !!  tdks <type(tdks_type)> = the tdks object to initialize
      63                 :             : !!
      64                 :             : !! OUTPUT
      65                 :             : !!
      66                 :             : !! SOURCE
      67                 :        1725 : subroutine rttddft_propagate_ele(dtset, istep, mpi_enreg, psps, tdks)
      68                 :             : 
      69                 :             :  !Arguments ------------------------------------
      70                 :             :  !scalars
      71                 :             :  integer,                    intent(in)    :: istep
      72                 :             :  type(dataset_type),         intent(inout) :: dtset
      73                 :             :  type(MPI_type),             intent(inout) :: mpi_enreg
      74                 :             :  type(pseudopotential_type), intent(inout) :: psps
      75                 :             :  type(tdks_type),            intent(inout) :: tdks
      76                 :             : 
      77                 :             :  !Local variables-------------------------------
      78                 :             :  !scalars
      79                 :             :  character(len=500)        :: msg
      80                 :             :  !arrays
      81                 :             : 
      82                 :             : ! ***********************************************************************
      83                 :             : 
      84                 :        1725 :  write(msg,'(a,a,i0)') ch10, '--- Iteration ', istep
      85                 :        1725 :  call wrtout(ab_out,msg)
      86         [ +  + ]:        1725 :  if (do_write_log) call wrtout(std_out,msg)
      87                 :             : 
      88                 :             :  ! Update various quantities after a nuclear step
      89         [ -  + ]:        1725 :  if (dtset%ionmov /= 0) call rttddft_setup_ele_step(dtset,mpi_enreg,psps,tdks)
      90                 :             : 
      91                 :             :  ! Propagate cg
      92                 :        3430 :  select case (dtset%td_propagator)
      93                 :             :    case(0)
      94                 :        1705 :       call rttddft_propagator_er(dtset,istep,mpi_enreg,psps,tdks,calc_properties=.true.)
      95                 :             :    case(1)
      96                 :          20 :       call rttddft_propagator_emr(dtset,istep,mpi_enreg,psps,tdks)
      97                 :             :    case default
      98                 :           0 :       write(msg,"(a)") "Unknown Propagator - check the value of td_propagator"
      99      [ +  +  - ]:        1725 :       ABI_ERROR(msg)
     100                 :             :  end select
     101                 :             : 
     102                 :        1725 : end subroutine rttddft_propagate_ele
     103                 :             : !!***
     104                 :             : 
     105                 :             : !!****f* m_rttddft/rttddft_propagate_nuc
     106                 :             : !!
     107                 :             : !! NAME
     108                 :             : !!  rttddft_propagate_nuc
     109                 :             : !!
     110                 :             : !! FUNCTION
     111                 :             : !!  Main subroutine to propagate nuclei using Ehrenfest dynamics
     112                 :             : !!
     113                 :             : !! INPUTS
     114                 :             : !!  dtset <type(dataset_type)>=all input variables for this dataset
     115                 :             : !!  istep <integer> = step number
     116                 :             : !!  mpi_enreg <MPI_type> = MPI-parallelisation information
     117                 :             : !!  psps <type(pseudopotential_type)> = variables related to pseudopotentials
     118                 :             : !!  tdks <type(tdks_type)> = the tdks object to initialize
     119                 :             : !!
     120                 :             : !! OUTPUT
     121                 :             : !!
     122                 :             : !! SIDE EFFECTS
     123                 :             : !!
     124                 :             : !! SOURCE
     125                 :             : !subroutine rttddft_propagate_nuc(dtset, istep, mpi_enreg, psps, tdks)
     126                 :             : 
     127                 :             : !!Arguments ------------------------------------
     128                 :             : !!scalars
     129                 :             : !type(tdks_type),            intent(inout) :: tdks
     130                 :             : !integer,                    intent(in)    :: istep
     131                 :             : !type(dataset_type),         intent(in)    :: dtset
     132                 :             : !type(MPI_type),             intent(inout) :: mpi_enreg
     133                 :             : !type(pseudopotential_type), intent(inout) :: psps
     134                 :             : !
     135                 :             : !!Local variables-------------------------------
     136                 :             : !!scalars
     137                 :             : !character(len=500)   :: msg
     138                 :             : !!arrays
     139                 :             : !
     140                 :             : ! ***********************************************************************
     141                 :             : 
     142                 :             : !write(msg,'(2a,i5,a)') ch10,'--- Iteration',istep
     143                 :             : !call wrtout(ab_out,msg)
     144                 :             : !if (do_write_log) call wrtout(std_out,msg)
     145                 :             : 
     146                 :             : !end subroutine rttddft_propagate_nuc
     147                 :             : !!***
     148                 :             : 
     149                 :             : end module m_rttddft_propagate
     150                 :             : !!***
        

Generated by: LCOV version 2.3-1