diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md deleted file mode 100644 index 26595f78..00000000 --- a/docs/CHANGELOG.md +++ /dev/null @@ -1,29 +0,0 @@ - - -## Added - - * [Cmake](https://cmake.org/) build recipe. - * [Doxygen](https://www.doxygen.nl/) documentation. - - -## Modified - - * Used the definifition of lib/my_second.f.ifort as default `my_second.f` - * `dmc`, `vmc` and `include` folders are now in `src` (a new source common folder). - * INFO.md is moved to `src` folder too. - * `lib` and `lib2` change names cyrus and pspline folders, now placed in a common `lib` folder. - * `input` folder is moved to `src/vmc`. - * notes_jastrow.pdf and README.md are now in a new `docs` folder. - * `interface` folder is moved to `tools` folder. - * CHANGELOG.md and CHANGELOG.md are moved to `docs`. - -## Removed - -* Link to unused *LINPACK* library -* Unused files in lib2 (Using available libraries in the system) -* jdqz: EigensolverJacobi-Davidson QZ is not longer available. ​ - - -## Fixed - - diff --git a/docs/CONFIG.md b/docs/CONFIG.md deleted file mode 100644 index f86c7bc9..00000000 --- a/docs/CONFIG.md +++ /dev/null @@ -1,22 +0,0 @@ -The Makefile is (UNIX-) platform-independend, but you must have GNU-make -(gmake) to use it. (On Linux make is gmake) - -The subdirectory make_config contains platform specific files with -settings for the fortran compiler used by the Makefile. - -You might have to create the settings for your platform. Choose the -appropriate file and copy (or symlink) it to settings.make - -`make clean` to get rid of old object files, -`make vmc` to build the vmc code -`make dmc` to build the dmc code - -Shortcuts: - -`make seq` to build the vmc,fit,dmc codes -`make mpi` to build the mpi version of the vmc,fit,dmc -`make all` to build seq,mpi - -In the subdirectory `input` there are awk-scripts which are used -in context with the input reader (during compilation) and you might -have to adjust the path to awk at the top of those scripts. diff --git a/docs/Doxyfile b/docs/Doxyfile index c7c85439..c12e6941 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -471,7 +471,7 @@ LOOKUP_CACHE_SIZE = 0 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = NO +EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. diff --git a/docs/vmc_common_blocks.csv b/docs/vmc_common_blocks.csv deleted file mode 100644 index e9f607bb..00000000 --- a/docs/vmc_common_blocks.csv +++ /dev/null @@ -1,149 +0,0 @@ -# common_block_name , appearences , status_of_refactoring -atom,113,DONE -b_tmove,2,DONE -Bloc,10,DONE -Bloc_da,4,DONE -Bloc_dj,4,DONE -bparm,24,DONE -casula,2,DONE -cblock,1,DONE -chck,2,DONE -coefs,70,DONE -config,6,DONE -const,92,DONE -const2,3,DONE -constant,3,DONE -contr2,33,DONE -contr3,10,DONE -contrl,30,DONE -contrl_per,21,DONE -contrldmc,1,DONE -csfs,74,DONE -cuspmat4,5,Todo -da_energy_ave,7,DONE -da_energy_now,8,DONE -da_jastrow4val,8,DONE -da_orbval,8,DONE -da_pseudo,7,DONE -deloc_dj,6,DONE -denergy_det,3,DONE -denupdn,3,DONE -derivjas,9,DONE -dets,49,DONE -dets_equiv,2,DONE -distance,14,Todo -distances_sav,2,DONE -dorb,24,DONE -elec,53,DONE -est2cm,8,DONE -estcum,8,DONE -estpsi,5,DONE -estsig,7,DONE -estsum,8,DONE -ewald,5,DONE -ewald_basis,4,DONE -force_analy,35,DONE -force_dmc,1,DONE -force_fin,4,DONE -force_mat_n,2,DONE -forcepar,20, DONE -forcest,6, DONE -forcestr,8,DONE -forcewt,8,DONE -gauss_ecp,2,DONE -ghostatom,15,DONE -gradhess_all,4,Todo -gradhess_ci,4,DONE -gradhess_jas,3,DONE -gradhess_mix_jas_ci,2,DONE -gradhess_mix_jas_orb,2,DONE -gradhess_mix_orb_ci,2, DONE -gradhess_orb,2,DONE -gradhessjo,4,DONE -gradjerr,7,DONE -grdnthes,2,DONE -grdntsmv,13,DONE -grdntspar,10,DONE -header,2,DONE -icount_ci,2,Todo -icount_orb,1,Todo -icount_prop,2,Todo -ijasnonlin,3,DONE -insout,6,DONE -jaso,8,DONE -jaspar,29,DONE -jaspar1,8,DONE -jaspar2,6,DONE -jaspar3,34,DONE -jaspar4,31,DONE -jaspar6,26,DONE -jaspointer,4,DONE -jd_scratch,2,DONE -kinet,3,DONE -linear_norm,3,DONE -mix_jas_ci,6,DONE -mmpol_hpsi,4,DONE -mmpolo,2,DONE -mpiconf,25,DONE -multidet,26,DONE -multimat,10,DONE -multimatn,3,DONE -multislater,23,Todo -multislatern,8,Todo -ncusp,1,DONE -numbas,14,DONE -numbas1,7,DONE -numbas2,2,DONE -numexp,2,DONE -optorb_mix,3,DONE -optwf_contrl,101,DONE -optwf_corsam,11,DONE -optwf_func,11,DONE -optwf_nparmj,13,DONE -optwf_parms,52,DONE -optwf_wjas,13,DONE -orbital_num_spl2,1,DONE -orbval,28,Todo -pars,4,DONE -pcm_force,2,DONE -pcm_hpsi,4,DONE -pcm_num_spl2,1,DONE -pcm_xv_new,3,DONE -pcmo,2,DONE -periodic,16,DONE -phifun,14,DONE -pseudo_champ,3,DONE -pseudo_fahy,3,DONE -pseudo_tm,7,DONE -pworbital,5,DONE -qua,14,Todo -rlobxy,1,DONE -rnyucm,6,Todo -sa_check,1,DONE -sa_weights,8,DONE -scale_more,2,DONE -scratch,1,DONE -slater,17,Todo -slatn,5,DONE -sr_index,2,DONE -sr_mat_n,20,DONE -stats,2,DONE -step,6,DONE -tempor,1,DONE -tempor_test,2,DONE -test,1,DONE -tmpnode,2,DONE -vardep,3,DONE -velocity_jastrow,7,DONE -wfsec,49,DONE -ycompact,6,DONE -ycompactn,3,DONE -zcompact,4,DONE -zmatrix,10,DONE -zmatrix_grad,1,DONE -orbval, ?, Todo -pseudo, ?, DONE -jasn, ?, DONE -optorb, ?, DONE -mix_orb_ci, ?, DONE -mix_jas_orb, ?, DONE \ No newline at end of file diff --git a/docs/vmc_problematic_cblocks.md b/docs/vmc_problematic_cblocks.md deleted file mode 100644 index bcc3802a..00000000 --- a/docs/vmc_problematic_cblocks.md +++ /dev/null @@ -1,186 +0,0 @@ -# Problematic Common blocks - -Common blocks that were not deleted in the second round. - -- [x] ***#3 common block /Bloc/***\ -**PROBLEM:** \ -Variables xmatd, xmatu are shared with common block /scratch/. -\ -**SOLUTION:** \ -The common block scratch was used only by optjas.f. Solution is simple: delete xmatd, xmatu from scratch module and introduce a "use Bloc, only: xmatd, xmatu" statement.\ -FYI: \ -common /Bloc/ \ -b(MORB,MELEC), xmat(MELEC * * 2,2), xmatu(MELEC* * 2), xmatd(MELEC * * 2) - -- [x] ***#17 common block /contrl/***\ -**PROBLEM:** \ -contrl shares variable nconf with common block /sr_mat_n/.\ -**SOLUTION:** \ -Variable nconf was changed to n_conf (only used in read_input.f for dmc calculations) before doing the python refactoring, that is: \ -common /contrl/ nstep,nblk,nblkeq,nconf,nconf_new,isite,idump,irstar\ -To:\ -common /contrl/ nstep,nblk,nblkeq,n_conf,nconf_new,isite,idump,irstar - -- [ ] ***#21 common block /cuspmat4/***\ -**PROBLEM:** \ -It requires to move the parameters NEQSX and MTERMS to an include file (done!) and to solve icusp(NEQSX) array issue: this variable also appears as an integer and an array with dimensions icusp(MCTYPE) throughout the code.\ -**SOLUTION:** \ -TODO - -- [x] ***#22 common block /da_energy_ave/***\ -**PROBLEM:** \ -Common block force_fin uses array with same name as da_energy_ave.\ -**SOLUTION:** \ -To change the name of the (common block) module from da_energy_ave to da_energy_ave_m. - -- [x] ***#27 common block /deloc_dj/***\ -**PROBLEM:** \ -optjas.f allocates an array with the same name as deloc_dj.\ -To change the name of the (common block) module from deloc_dj to deloc_dj_m. - -- [x] ***#28 common block /denergy_det/***\ -**PROBLEM:** \ -Common block and variable have the same name, e.i:\ -common /denergy_det/ denergy_det(MDET,2)\ -**SOLUTION:** \ -To change the name of the (common block) module from denergy_det to denergy_det_m. - -- [ ] ***#33 common block /distance/***\ -**PROBLEM:** \ -After substituting the common block it fails to reproduce numbers of butadiene-3wfs/TZ-1M-128 test:\ -total E = -26.1345117 +- 0.0114277 1.14277 0.82670 0.82670 1.91\ -total E = -26.1668044 +- 0.0105012 1.05012 0.78215 0.78215 1.80\ -total E = -26.1868742 +- 0.0090494 0.99132 0.74752 0.74752 1.76\ -total E = -26.1825821 +- 0.0080614 0.96737 0.73212 0.73212 1.75\ -and should be:\ -totalE=-26.1345117\ -totalE=-26.1560896\ -totalE=-26.1885011\ -totalE=-26.2094842\ -running in 5 processors.\ -After multiple checks and several trials, number differences keep appearing. I could not find the reason why. I am blaming the fact that variables r_ee, r_en, rshift, rvec_ee, rvec_en are quite spread on the code, sometimes even redefined instead of calling the /distance/ common block. I pass to the next one...\ -**SOLUTION:** \ -TODO - -- [x] ***#35 common block /dorb/***\ -**PROBLEM:** \ - Common block /orbval/ has an array with same name as dorb common block. -**SOLUTION:** \ -To change the name of the (common block) module from denergy_det to dorb_m. - -- [ ] ***#54 common block /gradhess_all/***\ -**PROBLEM:** \ -MPARMALL parameter defined in optorb.f should be in a include file.\ -**SOLUTION:** \ -TODO - -- [ ] ***#67 common block /icount_ci/***\ -**PROBLEM:** \ -Common blocks /icount_ci/, /icount_orb/ and /icount_prop/ are initialized in optwf_matrix_corsamp.f as: - - block data optprt_count - - implicit real*8(a-h,o-z) - - common /icount_ci/ icount_ci - common /icount_orb/ icount_orb - common /icount_prop/ icount_prop - data icount_ci /1/ - data icount_orb /1/ - data icount_prop /1/ - - end - -However, /icount_ci/ in optci.f is used as:\ -common /icount_ci/ icount - -and /icount_prop/ in properties.f as:\ -common /icount_prop/ icount - -Besides, icount variable is used in other subroutines like pcm.f without calling the block, and in pcm_reduce.f, giving even dimensions to the variable: -dimension icount(0:NPROCX),idispl(0:NPROCX)\ -**SOLUTION:** \ -TODO - -- [ ] ***#68 common block /icount_orb/*** -**PROBLEM:** \ -Same as #67.\ -**SOLUTION:** \ -TODO - -- [ ] ***#69 common block /icount_prop/***\ -**PROBLEM:** \ -Same as #67.\ -**SOLUTION:** \ -TODO - -- [x] ***#88 common block /multimat/***\ -**PROBLEM:** \ -MEXCIT parameter must be included in a include file.\ -**SOLUTION:** \ -I included NCOEF parameter in the vmc.h file. - -- [x] ***#89 common block /multimatn/***\ -**PROBLEM:** \ -MEXCIT parameter must be included in a include file.\ -**SOLUTION:** \ -I included NCOEF parameter in the vmc.h file. - -- [ ] ***#90 common block /multislater/***\ -**PROBLEM:** \ -Unknown.\ -**SOLUTION:** \ -TODO - -- [ ] ***#91 common block /multislatern/***\ -**PROBLEM:** \ -It has equivalent arguments to common block /orbval/.\ -**SOLUTION:** \ -TODO - -- [x] ***#96 common block /numexp/***\ -**PROBLEM:** \ -NCOEF must be include in a include file.\ -**SOLUTION:** \ -I included NCOEF parameter in the vmc.h file. - -- [ ] ***#105 common block /orbval/*** -**PROBLEM:** \ -It shares variables with common block /multislatern/, they should be condensed in just one.\ -Shares dorb and ddorb with common block /slater/.\ -**SOLUTION:** \ -TODO - -- [x] ***#118 common block /qua/***\ -**PROBLEM:** \ -Unclear why but tests numbers are not reproducible.\ -**SOLUTION:** \ -I missed call to the common block in roqua.f. - -- [x] ***#120 common block /rnyucm/***\ -**PROBLEM:** \ -m(4) and l(4) have no connection with l1, l2, l3, l4 and m1, m2, m3, m4 variables.\ -**SOLUTION:** \ -l1, l2, l3, l4 and m1, m2, m3, m4 are changed by l(1), l(2), l(3) ... - -- [ ] ***#125 common block /slater/***\ -**PROBLEM:** \ -Unknown. \ -**SOLUTION:** \ -TODO - -- [x] ***#135 common block /vardep/***\ -**PROBLEM:** \ -NEQSX parameter must be include in an input file.\ -**SOLUTION:** \ -NEQSX and MTERMS were included in the vmc.h file. - -- [x] ***#142 common block /zmatrix_grad/***\ -**PROBLEM:** \ -Parameter MCENT3 defined in misc_grdnts.f should be included in an include file.\ -**SOLUTION:** \ -To add: \ -parameter (MCENT3=3*MCENT)\ -in the vmc.h file.\ - - diff --git a/src/module/m_atom.f90 b/src/module/m_atom.f90 index 3e63f3fd..1ae2560f 100644 --- a/src/module/m_atom.f90 +++ b/src/module/m_atom.f90 @@ -1,68 +1,80 @@ -!> Module that defines the sytem / molecule. -!>@param nelec Number of electrons in the system. -!>@param ndn Number of down electrons. -!>@param nup Number of up electrons. -!>@param cent Coordinates of the centers. -!>@param znuc Nuclear charges. -!>@param iwctype Type of the wavefunction. -!>@param nctype Number of types of centers. -!>@param ncent Number of centers. -!>@param nctype_tot Total number of types of centers. -!>@param ncent_tot Total number of centers. -!>@param symbol Elemental symbol of the centers. -!>@param atomtyp Type of the centers. -!>@param newghostype New ghost type. -!>@param nghostcent Number of ghost centers. -!>@param allocate_atom Allocates memory for the system. -!>@author Ravindra Shinde +!> Module that defines the system/molecule. module system use precision_kinds, only: dp implicit none - integer :: nelec + !> Number of electrons in the system. + integer :: nelec + + !> Number of down electrons. integer :: ndn + + !> Number of up electrons. integer :: nup + !> Coordinates of the centers. real(dp), dimension(:, :), allocatable :: cent + + !> Nuclear charges. real(dp), dimension(:), allocatable :: znuc + !> Type of the wavefunction. integer, dimension(:), allocatable :: iwctype - integer :: nctype, ncent - integer :: nctype_tot, ncent_tot + + !> Number of types of centers. + integer :: nctype + + !> Number of centers. + integer :: ncent + + !> Total number of types of centers. + integer :: nctype_tot + + !> Total number of centers. + integer :: ncent_tot + + !> Elemental symbol of the centers. character(len=2), dimension(:), allocatable :: symbol + + !> Type of the centers. character(len=2), dimension(:), allocatable :: atomtyp + !> New ghost type. integer :: newghostype + + !> Number of ghost centers. integer :: nghostcent private - public :: nelec - public :: ndn, nup - public :: znuc, cent, iwctype, nctype, ncent, ncent_tot, nctype_tot, symbol, atomtyp - public :: allocate_atom, deallocate_atom - public :: newghostype, nghostcent + public :: nelec, ndn, nup, znuc, cent, iwctype, nctype, ncent, ncent_tot, nctype_tot + public :: symbol, atomtyp, allocate_atom, deallocate_atom + public :: newghostype, nghostcent save contains + !> Allocates memory for the system. - !>@param allocate_atom Allocates memory for the system. - !>@author Ravindra Shinde subroutine allocate_atom() + + !> Allocating memory for centers. if (.not. allocated(cent)) allocate (cent(3, ncent_tot)) + + !> Allocating memory for nuclear charges. if (.not. allocated(znuc)) allocate (znuc(nctype_tot)) + + !> Allocating memory for wavefunction type. if (.not. allocated(iwctype)) allocate (iwctype(nctype_tot), source=0) + + !> Allocating memory for elemental symbols. if (.not. allocated(symbol)) allocate (symbol(ncent_tot)) end subroutine allocate_atom !> Deallocates memory for the system. - !>@param deallocate_atom Deallocates memory for the system. - !>@author Ravindra Shinde subroutine deallocate_atom() if (allocated(iwctype)) deallocate (iwctype) if (allocated(znuc)) deallocate (znuc) if (allocated(cent)) deallocate (cent) end subroutine deallocate_atom -end module system - +end module system \ No newline at end of file diff --git a/src/module/m_basis.f90 b/src/module/m_basis.f90 index 19071172..d2e4badf 100644 --- a/src/module/m_basis.f90 +++ b/src/module/m_basis.f90 @@ -1,24 +1,39 @@ +!> Module that contains the basis set information. +!> @var zex Screening constants for each basis function. +!> @var betaq +!> @var ns Number of s functions at each center. +!> @var np Number of px functions of each type at each center. +!> @var nd Number of d functions at each center. +!> @var nf Number of f functions at each center. +!> @var ng Number of g functions at each center. +!> @subroutine allocate_basis Allocates memory for the basis set. +!> @subroutine deallocate_basis Deallocates memory for the basis set. +!> @author Ravindra Shinde module basis - !> ncent = number of centers - !> zex = screening constants for each basis function - !> betaq = - !> cent = positions of each center - !> ns = number of s functions at each center - !> np = number of px functions of each type at each center - !> nd = number of d functions at each center - !> nf = number of f functions at each center - - use precision_kinds, only: dp + use precision_kinds, only: dp implicit none - real(dp), dimension(:, :), allocatable :: zex !(MBASIS,MWF) + !> Screening constants for each basis function. + real(dp), dimension(:, :), allocatable :: zex + + !> Beta coefficient parameter. real(dp) :: betaq - integer, dimension(:), allocatable :: ns !(MCTYPE) - integer, dimension(:), allocatable :: np !(MCTYPE) - integer, dimension(:), allocatable :: nd !(MCTYPE) - integer, dimension(:), allocatable :: nf !(MCTYPE) - integer, dimension(:), allocatable :: ng !(MCTYPE) + + !> Number of s functions at each center. + integer, dimension(:), allocatable :: ns + + !> Number of px functions at each center. + integer, dimension(:), allocatable :: np + + !> Number of d functions at each center. + integer, dimension(:), allocatable :: nd + + !> Number of f functions at each center. + integer, dimension(:), allocatable :: nf + + !> Number of g functions at each center. + integer, dimension(:), allocatable :: ng private public :: zex, betaq @@ -26,17 +41,15 @@ module basis public :: allocate_basis, deallocate_basis save contains + !> Allocates memory for the basis set. + !> @note deprecated subroutine allocate_basis() - - ! if (.not. allocated(zex)) allocate(zex(nbasis,MWF)) - ! if (.not. allocated(ns)) allocate(ns(nctype)) - ! if (.not. allocated(np)) allocate(np(3,nctype)) - ! if (.not. allocated(nd)) allocate(nd(nctype)) - ! if (.not. allocated(nf)) allocate(nf(nctype)) - ! if (.not. allocated(ng)) allocate(ng(nctype)) - + ! Allocate basis is called while reading the basis set from the input file. end subroutine allocate_basis + !> Deallocates memory for the basis set. + !> This subroutine deallocates memory for the basis set parameters + !> to avoid memory leaks after calculations are finished. subroutine deallocate_basis() if (allocated(ng)) deallocate (ng) @@ -44,27 +57,32 @@ subroutine deallocate_basis() if (allocated(nd)) deallocate (nd) if (allocated(np)) deallocate (np) if (allocated(ns)) deallocate (ns) - if (allocated(zex)) deallocate (zex) end subroutine deallocate_basis end module basis +!> Module defining constants for numerical basis representation. +!> Provides parameters used in various numerical modules for managing basis sets. module numbas_mod !> Arguments: MRWF_PTS, MRWF implicit none + !> Maximum number of wavefunction points. integer, parameter :: MRWF_PTS = 4000 + + !> Maximum number of wavefunctions. integer, parameter :: MRWF = 200 + private public :: MRWF, MRWF_PTS save end module numbas_mod +!> Module numexp module numexp - !> Arguments: ae, ce use multiple_geo, only: MFORCE use numbas_mod, only: MRWF @@ -73,7 +91,10 @@ module numexp implicit none + !> Array for storing the ae coefficients. real(dp), dimension(:, :, :, :), allocatable :: ae !(2,MRWF,MCTYPE,MFORCE) + + !> Array for storing the ce coefficients. real(dp), dimension(:, :, :, :), allocatable :: ce !(NCOEF,MRWF,MCTYPE,MFORCE) private @@ -81,6 +102,7 @@ module numexp public :: allocate_numexp, deallocate_numexp save contains + !> Allocates memory for the ae and ce arrays. subroutine allocate_numexp() use multiple_geo, only: MFORCE use numbas_mod, only: MRWF @@ -90,6 +112,7 @@ subroutine allocate_numexp() if (.not. allocated(ce)) allocate (ce(NCOEF, MRWF, nctype_tot, MFORCE)) end subroutine allocate_numexp + !> Deallocates memory for the ae and ce arrays. subroutine deallocate_numexp() if (allocated(ce)) deallocate (ce) if (allocated(ae)) deallocate (ae) @@ -97,6 +120,7 @@ end subroutine deallocate_numexp end module numexp +!> Module numbas for numerical basis information module numbas !> Arguments: arg, d2rwf, igrid, iwrwf, nr, nrbas, numr, r0, rwf @@ -105,15 +129,34 @@ module numbas implicit none + !> Array of basis function arguments. real(dp), dimension(:), allocatable :: arg !(MCTYPE) + + !> Array of second derivatives of the wavefunctions. real(dp), dimension(:, :, :, :), allocatable :: d2rwf !(MRWF_PTS,MRWF,MCTYPE,MWF) + + !> Array of grid indices. integer, dimension(:), allocatable :: igrid !(MCTYPE) + + !> Array of wavefunction indices. integer, dimension(:, :), allocatable :: iwrwf !(MBASIS,MCTYPE) + + !> Array of number of radial points. integer, dimension(:), allocatable :: nr !(MCTYPE) + + !> Array of number of shells in basis functions. integer, dimension(:), allocatable :: nrbas !(MCTYPE) + + !> Number of radial points. integer :: numr + + !> Array r0 real(dp), dimension(:), allocatable :: r0 !(MCTYPE) + + !> Array of wavefunction maximum radii for each basis function. real(dp), dimension(:,:), allocatable :: rmaxwf !(nrbas, MCTYPE) + + !> Array of wavefunctions. real(dp), dimension(:, :, :, :), allocatable :: rwf !(MRWF_PTS,MRWF,MCTYPE,MWF) private @@ -121,6 +164,7 @@ module numbas public :: allocate_numbas, deallocate_numbas save contains + !> Allocates memory for the numerical basis arrays. subroutine allocate_numbas() use coefs, only: nbasis use multiple_geo, only: nwftype @@ -137,6 +181,7 @@ subroutine allocate_numbas() if (.not. allocated(rwf)) allocate (rwf(MRWF_PTS, MRWF, nctype_tot, nwftype)) end subroutine allocate_numbas + !> Deallocates memory for the numerical basis arrays. subroutine deallocate_numbas() if (allocated(rmaxwf)) deallocate (rmaxwf) if (allocated(rwf)) deallocate (rwf) @@ -151,12 +196,16 @@ end subroutine deallocate_numbas end module numbas +!> Module numbas1 for numerical basis information module numbas1 !> Arguments: iwlbas, nbastyp implicit none + !> Array of basis function indices. integer, dimension(:, :), allocatable :: iwlbas !(MBASIS,MCTYPE) + + !> Array of basis function types. integer, dimension(:), allocatable :: nbastyp !(MCTYPE) private @@ -164,6 +213,7 @@ module numbas1 public :: allocate_numbas1, deallocate_numbas1 save contains + !> Allocates memory for the numerical basis arrays. subroutine allocate_numbas1() use coefs, only: nbasis use system, only: nctype_tot @@ -171,6 +221,7 @@ subroutine allocate_numbas1() ! if (.not. allocated(nbastyp)) allocate (nbastyp(nctype_tot)) end subroutine allocate_numbas1 + !> Deallocates memory for the numerical basis arrays. subroutine deallocate_numbas1() if (allocated(nbastyp)) deallocate (nbastyp) if (allocated(iwlbas)) deallocate (iwlbas) @@ -178,12 +229,16 @@ end subroutine deallocate_numbas1 end module numbas1 +!> Module numbas2 for numerical basis information module numbas2 !> Arguments: ibas0, ibas1 implicit none + !> Array of basis function indices. integer, dimension(:), allocatable :: ibas0 !(MCENT) + + !> Array of basis function indices. integer, dimension(:), allocatable :: ibas1 !(MCENT) private @@ -191,12 +246,14 @@ module numbas2 public :: allocate_numbas2, deallocate_numbas2 save contains + !> Allocates memory for the numerical basis arrays. subroutine allocate_numbas2() use system, only: ncent_tot if (.not. allocated(ibas0)) allocate (ibas0(ncent_tot), source=0) if (.not. allocated(ibas1)) allocate (ibas1(ncent_tot), source=0) end subroutine allocate_numbas2 + !> Deallocates memory for the numerical basis arrays. subroutine deallocate_numbas2() if (allocated(ibas1)) deallocate (ibas1) if (allocated(ibas0)) deallocate (ibas0) @@ -204,10 +261,11 @@ end subroutine deallocate_numbas2 end module numbas2 +!> Module m_basis for basis set information. module m_basis contains +!> Subroutine to allocate memory for the basis set. subroutine allocate_m_basis() - ! use basis, only: allocate_basis use numbas, only: allocate_numbas use numbas1, only: allocate_numbas1 use numbas2, only: allocate_numbas2 @@ -215,13 +273,13 @@ subroutine allocate_m_basis() implicit none - ! call allocate_basis() call allocate_numexp() call allocate_numbas() call allocate_numbas1() call allocate_numbas2() end subroutine allocate_m_basis +!> Subroutine to deallocate memory for the basis set. subroutine deallocate_m_basis() use basis, only: deallocate_basis use numbas, only: deallocate_numbas @@ -239,17 +297,30 @@ subroutine deallocate_m_basis() end subroutine deallocate_m_basis end module -! subroutines required by the trexio modules +!> Module trexio basis for recreating basis grid from trexio file. module m_trexio_basis use coefs, only: nbasis implicit none + !> Fixed array of slm per angular momentum. integer, dimension(5) :: slm_per_l = (/1, 3, 6, 10, 15/) !s,p,d,f,g + + !> Total number of shells in the basis set. integer :: basis_num_shell + + !> Array of indices for the spherical harmonics. integer, allocatable :: index_slm(:) !(nbasis) + + !> Array of indices for the radial ao basis functions. integer, allocatable :: ao_radial_index(:) !(nbasis) + + !> Array of number of radial basis functions per center. integer, allocatable :: num_rad_per_cent(:) !(ncent_tot) + + !> Array of number of ao basis functions per center. integer, allocatable :: num_ao_per_cent(:) !(ncent_tot) + + !> Array of angular momentum for each shell. integer, allocatable :: basis_shell_ang_mom(:) !(nshell) private @@ -259,6 +330,8 @@ module m_trexio_basis public :: gnorm contains + + !> Function to calculate the normalization constant for the basis functions. double precision function gnorm(exponent, l) use precision_kinds, only: dp implicit none diff --git a/src/module/m_coefs.f90 b/src/module/m_coefs.f90 index 9dfb03d1..e1c17004 100644 --- a/src/module/m_coefs.f90 +++ b/src/module/m_coefs.f90 @@ -1,11 +1,12 @@ +!> Module that contains the wavefunction coefficients information. +!>@author Ravindra Shinde module coefs - !> need a better name is that the MO ? - !> if yes can we put it in basis ? - !> Arguments: coef, nbasis, norb - implicit none + !> Number of AO basis functions. integer :: nbasis + + !> Maximum number of additional orbitals integer :: next_max save diff --git a/src/vmc/new_parser_read_data.f90 b/src/vmc/new_parser_read_data.f90 index ad65cb67..2a759e61 100644 --- a/src/vmc/new_parser_read_data.f90 +++ b/src/vmc/new_parser_read_data.f90 @@ -2,11 +2,11 @@ module parser_read_data use error, only: fatal_error implicit none contains -subroutine header_printing() - !> This subroutine prints the header in each output file. It contains some - !! useful information about the compilers, version of the code, input and output file names. - !! @author Ravindra Shinde (r.l.shinde@utwente.nl) +!> This subroutine prints the header in each output file. It contains some +!! useful information about the compilers, version of the code, input and output file names. +!! @author Ravindra Shinde (r.l.shinde@utwente.nl) +subroutine header_printing() use contrl_file, only: errunit,file_error,file_input,file_output use contrl_file, only: ounit use mpi_f08 @@ -123,12 +123,12 @@ subroutine header_printing() end subroutine header_printing +!> This subroutine reads the .xyz molecule file. It then computes the +!! number of types of atoms, nuclear charges (from the symbol), and +!! number of valence electrons if pseudopotential is provided. +!! @author Ravindra Shinde (r.l.shinde@utwente.nl) +!! @date subroutine read_molecule_file(file_molecule) - !> This subroutine reads the .xyz molecule file. It then computes the - !! number of types of atoms, nuclear charges (from the symbol), and - !! number of valence electrons if pseudopotential is provided. - !! @author Ravindra Shinde (r.l.shinde@utwente.nl) - !! @date use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -298,11 +298,9 @@ end subroutine read_molecule_file - +!> This subroutine reads the single state determinant file. +!! @author Ravindra Shinde subroutine read_determinants_file(file_determinants) - !> This subroutine reads the single state determinant file. - !! @author Ravindra Shinde - use contrl_file, only: errunit,ounit use csfs, only: nstates use custom_broadcast, only: bcast @@ -440,10 +438,10 @@ subroutine read_determinants_file(file_determinants) end subroutine read_determinants_file +!> This subroutine reads the multideterminants file. The first line appears as 'multideterminants' ndet_local +!! CI coefficients and occupation of determinants in wf +!! @author Ravindra Shinde subroutine read_multideterminants_file(file_multideterminants) - !> This subroutine reads the multideterminants file. The first line appears as 'multideterminants' ndet_local - !! CI coefficients and occupation of determinants in wf - !! @author Ravindra Shinde use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -517,11 +515,9 @@ end subroutine read_multideterminants_file - +!> This subroutine reads jastrow parameters from a text file. +!>@author Ravindra Shinde subroutine read_jastrow_file(file_jastrow) - ! This subroutine reads jastrow parameters from a file. - ! Ravindra - use bparm, only: nocuspb,nspin2b use csfs, only: nstates use contrl_file, only: errunit,ounit @@ -575,7 +571,7 @@ subroutine read_jastrow_file(file_jastrow) if (ndn .eq. 1 .and. nspin2 .eq. 3) call fatal_error('JASTROW: 1 spin down and nspin2=3') - if (ijas .eq. 4 .and. (isc .lt. 2 .or. isc .gt. 5)) & + if (ijas .eq. 4 .and. (isc .lt. 2 .or. isc .gt. 5)) & call fatal_error('JASTROW: if ijas=4, isc must be one of 2,3,4,5') nspin2b = iabs(nspin2) @@ -906,10 +902,10 @@ subroutine read_jastrow_file(file_jastrow) end subroutine read_jastrow_file - +!> This subroutine reads the LCAO orbitals from a text file. +!> @author Ravindra Shinde +!> @author Stu Shepard subroutine read_orbitals_file(file_orbitals) - ! Ravindra - use coefs, only: nbasis use contrl_file, only: errunit,ounit use control, only: mode @@ -926,8 +922,6 @@ subroutine read_orbitals_file(file_orbitals) use vmc_mod, only: norb_tot, nwftypeorb, nstoo, nstoomax, otos, extrao, nstoo_tot use write_orb_loc_mod, only: write_orb_loc - ! was not in master but is needed - implicit none ! local use @@ -1117,11 +1111,9 @@ subroutine read_orbitals_file(file_orbitals) end subroutine read_orbitals_file - +!> This subroutine reads the csf coefficients from the determinant file. +!> @author Ravindra Shinde subroutine read_csf_file(file_determinants) - ! This subroutine reads the csf coefficients from the determinant file. - ! Ravindra - use ci000, only: nciprim,nciterm use contrl_file, only: errunit,ounit use csfs, only: ccsf,ncsf,nstates @@ -1260,10 +1252,9 @@ subroutine read_csf_file(file_determinants) end subroutine read_csf_file +!> This subroutine reads the csf coefficients from the determinant file. +!> @author Ravindra Shinde subroutine read_csfmap_file(file_determinants) - ! This subroutine reads the csf coefficients from the determinant file. - ! Ravindra - use contrl_file, only: errunit,ounit use csfs, only: ccsf,cxdet,iadet,ibdet,icxdet,ncsf,nstates use custom_broadcast, only: bcast @@ -1419,11 +1410,9 @@ end subroutine read_csfmap_file - +!> Read basis function exponents (only if no numerical basis) +!> @author Ravindra subroutine read_exponents_file(file_exponents) - ! Read basis function exponents (only if no numerical basis) - ! Ravindra - use basis, only: zex use coefs, only: nbasis use contrl_file, only: errunit,ounit @@ -1490,11 +1479,9 @@ subroutine read_exponents_file(file_exponents) end subroutine read_exponents_file - +!> This subroutines reads the jastrow derivatives for the jastrow optimization. +!> @author Ravindra Shinde subroutine read_jasderiv_file(file_jastrow_der) - ! Read jastrow derivatives - ! Ravindra - use bparm, only: nspin2b use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast @@ -1673,9 +1660,8 @@ subroutine read_jasderiv_file(file_jastrow_der) end subroutine read_jasderiv_file +!> This subroutine reads the forces from the forces file. subroutine read_forces_file(file_forces) - ! - ! Ravindra use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -1753,9 +1739,9 @@ subroutine read_forces_file(file_forces) if (wid) close(iunit) end subroutine read_forces_file -subroutine read_symmetry_file(file_symmetry) - ! Ravindra +!> This subroutine reads the symmetry information of orbitals from the symmetry file. +subroutine read_symmetry_file(file_symmetry) use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -1832,6 +1818,7 @@ subroutine read_symmetry_file(file_symmetry) end subroutine read_symmetry_file +!> This subroutine reads the optorb_mixvirt from the optorb_mixvirt file. subroutine read_optorb_mixvirt_file(file_optorb_mixvirt) ! ! Ravindra @@ -1913,7 +1900,7 @@ subroutine read_optorb_mixvirt_file(file_optorb_mixvirt) end subroutine read_optorb_mixvirt_file - +!> This subroutine reads the orbital energies from the eigenvalues file. subroutine read_eigenvalues_file(file_eigenvalues) use contrl_file, only: errunit,ounit @@ -1984,7 +1971,7 @@ subroutine read_eigenvalues_file(file_eigenvalues) end subroutine read_eigenvalues_file - +!> This subroutine reads the information about the numerical basis from the basis_num_info file. subroutine read_basis_num_info_file(file_basis_num_info) ! Ravindra ! Basis function types and pointers to radial parts tables @@ -2008,7 +1995,7 @@ subroutine read_basis_num_info_file(file_basis_num_info) use mpitimer, only: elapsed_time use control, only: ipr - + implicit none ! local use @@ -2140,7 +2127,7 @@ subroutine read_basis_num_info_file(file_basis_num_info) end subroutine read_basis_num_info_file - +!> This subroutine reads the dmatrix from the dmatrix file. subroutine read_dmatrix_file(file_dmatrix) ! Ravindra (no=ndetorb, ns=nweight) !INPUT dmatrix i i a= @@ -2246,7 +2233,7 @@ subroutine read_dmatrix_file(file_dmatrix) end subroutine read_dmatrix_file - +!> This subroutine reads the cavity spheres file. subroutine read_cavity_spheres_file(file_cavity_spheres) ! Ravindra ! Read centers of cavity spheres and radii @@ -2316,12 +2303,10 @@ subroutine read_cavity_spheres_file(file_cavity_spheres) end subroutine read_cavity_spheres_file +!> This subroutine reads the information for which x,y,z cartesian coordiantes of +!> atoms energy gradients are to be calculated for. +!> @author Omar Valsson subroutine read_gradients_cartesian_file(file_gradients_cartesian) - !Ravindra - !INPUT gradients_cartesian inp - !KEYDOC Read for which x,y,z cartesian coordiantes of - !KEYDOC atoms energy gradients are to be calculated for. - ! Originally written by Omar Valsson use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast @@ -2415,12 +2400,10 @@ subroutine read_gradients_cartesian_file(file_gradients_cartesian) if (wid) close(iunit) end subroutine read_gradients_cartesian_file +!> This subroutine reads the information for which Z matrix (internal) coordiantes of +!> atoms energy gradients are to be calculated for. +!> @author Omar Valsson subroutine read_gradients_zmatrix_file(file_gradients_zmatrix) - ! Ravindra - ! Read for which Z matrix (internal) coordiantes of - ! atoms energy gradients are to be calculated for. - - ! Originally written by Omar Valsson. use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -2513,11 +2496,11 @@ subroutine read_gradients_zmatrix_file(file_gradients_zmatrix) end subroutine read_gradients_zmatrix_file + +!> This subroutine reads the information for which Z matrix (internal) coordiantes of +!> atoms energy gradients are to be calculated for. +!> @author Omar Valsson subroutine read_modify_zmatrix_file(file_modify_zmatrix) - ! Ravindra - ! - ! Read for which Z matrix (internal) coordiantes of - ! atoms energy gradients are to be calculated for. use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -2585,11 +2568,10 @@ subroutine read_modify_zmatrix_file(file_modify_zmatrix) if (wid) close(iunit) end subroutine read_modify_zmatrix_file + +!> This subroutine reads the information from the hessian zmatrix file. +!> @author Omar Valsson subroutine read_hessian_zmatrix_file(file_hessian_zmatrix) - ! Ravindra - ! - ! Read for which Z matrix (internal) coordiantes of - ! atoms energy gradients are to be calculated for. use contrl_file, only: errunit,ounit use custom_broadcast, only: bcast use general, only: pooldir @@ -2658,9 +2640,10 @@ subroutine read_hessian_zmatrix_file(file_hessian_zmatrix) end subroutine read_hessian_zmatrix_file +!> This subroutine reads the information from the zmatrix connection file +!> for the Z matrix coordinates. +!> @author Omar Valsson subroutine read_zmatrix_connection_file(file_zmatrix_connection) - ! Ravindra - ! ! Read the atom connection matrix for the Z matrix. ! It is need when calculating forces in Z matrix ! coordinates. @@ -2750,6 +2733,7 @@ subroutine read_zmatrix_connection_file(file_zmatrix_connection) if (wid) close(iunit) end subroutine read_zmatrix_connection_file +!> This subroutine reads the efield file. subroutine read_efield_file(file_efield) !ncharges_tmp, iscreen_tmp ! Ravindra use contrl_file, only: errunit,ounit