diff --git a/app/misc/skderivs/skderivs.F90 b/app/misc/skderivs/skderivs.F90 index cc039d5a2d..724a229e29 100644 --- a/app/misc/skderivs/skderivs.F90 +++ b/app/misc/skderivs/skderivs.F90 @@ -9,22 +9,24 @@ !> Calculates the first and second derivatives of matrix elements program skderivs - use dftbp_common_accuracy - use dftbp_common_constants + use dftbp_common_accuracy, only : dp, lc + use dftbp_common_constants, only : maxL, shellNames use dftbp_common_globalenv, only : stdOut use dftbp_common_file, only : TFileDescr, openFile, closeFile - use dftbp_dftb_slakoeqgrid - use dftbp_io_charmanip + use dftbp_dftb_slakoeqgrid, only : getNIntegrals, getSKIntegrals, init, skEqGridNew,& + & skEqGridOld, TSlakoEqGrid + use dftbp_io_charmanip, only : i2c, unquote use dftbp_io_hsdparser, only : parseHSD, dumpHSD, getNodeHSDName - use dftbp_io_hsdutils - use dftbp_io_hsdutils2 - use dftbp_io_message - use dftbp_type_linkedlist - use dftbp_type_oldskdata + use dftbp_io_hsdutils, only : detailedError, getChild, getChildValue + use dftbp_io_hsdutils2, only : warnUnprocessedNodes + use dftbp_type_linkedlist, only : append, asArray, init, intoArray, len, TListInt,& + & TListIntR1 + use dftbp_type_oldskdata, only : readFromFile, TOldSKData #:if WITH_MPI use dftbp_common_mpienv #:endif - use xmlf90_flib_dom + use dftbp_extlibs_xmlf90, only : char, fNode, string, assignment(=), append_to_string,& + & resize_string implicit none diff --git a/app/misc/slakovalue/integvalue.F90 b/app/misc/slakovalue/integvalue.F90 index 6fe8beb940..a0ed21f01e 100644 --- a/app/misc/slakovalue/integvalue.F90 +++ b/app/misc/slakovalue/integvalue.F90 @@ -8,11 +8,12 @@ !> Reads a spline repulsive from an SK-table and returns its value and its first !! and second derivatives. program integvalue - use dftbp_common_accuracy + use dftbp_common_accuracy, only : dp, lc use dftbp_common_globalenv, only : stdOut - use dftbp_dftb_slakoeqgrid - use dftbp_io_message - use dftbp_type_oldskdata + use dftbp_dftb_slakoeqgrid, only : getCutoff, getSKIntegrals, init, skEqGridNew,& + & TSlakoEqGrid + use dftbp_io_message, only : error + use dftbp_type_oldskdata, only : readFromFile, TOldSKData implicit none integer, parameter :: nSKInter = 20 diff --git a/app/phonons/initphonons.F90 b/app/phonons/initphonons.F90 index 1374a82f2b..3b057c83aa 100644 --- a/app/phonons/initphonons.F90 +++ b/app/phonons/initphonons.F90 @@ -8,29 +8,32 @@ #:include 'common.fypp' module phonons_initphonons - use dftbp_common_accuracy - use dftbp_common_atomicmass - use dftbp_common_constants - use dftbp_common_environment + use dftbp_common_accuracy, only : dp, lc, mc + use dftbp_common_atomicmass, only : getAtomicMass + use dftbp_common_constants, only : amu__au + use dftbp_common_environment, only : TEnvironment use dftbp_common_file, only : TFileDescr, closeFile, openFile - use dftbp_common_globalenv + use dftbp_common_globalenv, only : stdOut, tIoProc use dftbp_common_status, only : TStatus - use dftbp_common_unitconversion - use dftbp_dftb_periodic - use dftbp_io_charmanip + use dftbp_common_unitconversion, only : energyUnits, lengthUnits + use dftbp_dftb_periodic, only : getCellTranslations, getNrOfNeighboursForAll,& + & getSuperSampling, TNeighbourList, TNeighbourlist_init, updateNeighbourList + use dftbp_io_charmanip, only : i2c, tolower, unquote use dftbp_io_hsdparser, only : parseHSD, dumpHSD - use dftbp_io_hsdutils - use dftbp_io_hsdutils2 - use dftbp_io_message - use dftbp_io_tokenreader - use dftbp_io_xmlutils - use dftbp_math_simplealgebra - use dftbp_transport_negfvars - use dftbp_type_linkedlist - use dftbp_type_oldskdata - use dftbp_type_typegeometryhsd - use dftbp_type_wrappedintr - use xmlf90_flib_dom + use dftbp_io_hsdutils, only : detailedError, getChild, getChildren, getChildValue,& + & getFirstTextChild, getSelectedAtomIndices, getSelectedIndices, setChild, setChildValue + use dftbp_io_hsdutils2, only : convertUnitHsd, setUnprocessed, warnUnprocessedNodes + use dftbp_io_message, only : error + use dftbp_io_tokenreader, only : getNextToken + use dftbp_math_simplealgebra, only : determinant33 + use dftbp_transport_negfvars, only : ContactInfo, TNEGFtundos, TTransPar + use dftbp_type_linkedlist, only : append, asArray, asVector, destruct, get, init,& + & len, TListCharLc, TListInt, TListIntR1, TListReal, TListRealR1, TListString + use dftbp_type_oldskdata, only : readFromFile, TOldSKData + use dftbp_type_typegeometryhsd, only : readTGeometryGen, readTGeometryHSD, TGeometry + use dftbp_type_wrappedintr, only : TWrappedInt1 + use dftbp_extlibs_xmlf90, only : char, fnode, fnodelist, getLength, string, textNodeName,& + & assignment(=), getNodeName, getItem1, destroyNodeList implicit none private diff --git a/app/phonons/libnegfint.F90 b/app/phonons/libnegfint.F90 index 0954fa93a3..0cfc7d769c 100644 --- a/app/phonons/libnegfint.F90 +++ b/app/phonons/libnegfint.F90 @@ -26,8 +26,8 @@ #:include "common.fypp" module phonons_libnegfint - use dftbp_common_accuracy - use dftbp_common_environment + use dftbp_common_accuracy, only: dp + use dftbp_common_environment, only: TEnvironment use dftbp_common_file, only : TFileDescr, closeFile, openFile use dftbp_common_globalenv, only : stdOut, tIoProc use dftbp_extlibs_negf, only : getel, lnParams, pass_DM, Tnegf, kb, units, convertHeatCurrent,& @@ -39,12 +39,12 @@ module phonons_libnegfint & set_elph_block_dephasing, set_elph_dephasing, set_elph_s_dephasing, set_ldos_indexes,& & set_tun_indexes, set_params, writememinfo, writepeakinfo, dns2csr, csr2dns, nzdrop, printcsr use phonons_initphonons, only : TempMin, TempMax, TempStep, modeEnum - use dftbp_io_message - use dftbp_transport_matconv - use dftbp_transport_negfvars + use dftbp_io_message, only: error + use dftbp_transport_matconv, only: destruct + use dftbp_transport_negfvars, only: TNEGFTunDos, TTranspar use dftbp_type_commontypes, only : TOrbitals #:if WITH_MPI - use dftbp_extlibs_mpifx + use dftbp_extlibs_mpifx, only: mpifx_comm, mpifx_reduceip, MPI_SUM use dftbp_extlibs_negf, only : negf_mpi_init #:endif implicit none diff --git a/app/phonons/phonons.F90 b/app/phonons/phonons.F90 index 151ea07718..2b3eb5ff26 100644 --- a/app/phonons/phonons.F90 +++ b/app/phonons/phonons.F90 @@ -10,17 +10,20 @@ program phonons use dftbp_common_accuracy, only : dp, lc use dftbp_common_constants, only : Hartree__cm, Bohr__AA, Hartree__J, Hartree__eV, hbar, pi - use dftbp_common_environment + use dftbp_common_environment, only: TEnvironment, TEnvironment_init use dftbp_common_file, only : closeFile, openFile, TFileDescr - use dftbp_common_globalenv - use phonons_initphonons - use dftbp_io_message - use dftbp_io_taggedoutput + use dftbp_common_globalenv, only : destructGlobalEnv, initGlobalEnv, stdOut, tIOProc + use phonons_initphonons, only : tTransport, tWriteTagged, geo, neighbourList,& + & modesToPlot, nCells, tPlotModes, tAnimateModes, tXmakeMol, tCompModes,& + & tPhonDispersion, nSteps, nMovedAtom, nModesToPlot, nCycles, iMovedAtoms,& + & outputUnits, nKPoints, nAtomUnitCell, autotestTag, nNeighbour, selTypeModes,& + & img2CentCell, kPoint, transpar, dynMatrix, tundos, atomicMasses, initProgramVariables,& + & destructProgramVariables + use dftbp_io_message, only : error + use dftbp_io_taggedoutput, only : TTaggedWriter, TTaggedWriter_init use dftbp_math_eigensolver, only : heev use dftbp_math_simplealgebra, only : invert33 - use dftbp_type_typegeometry - use phonons_libnegfint - use ln_structure + use phonons_libnegfint, only : calc_phonon_current, init_tun_proj, negf_init, negf_init_str implicit none type(TEnvironment) :: env diff --git a/app/transporttools/helpsetupgeom.F90 b/app/transporttools/helpsetupgeom.F90 index 279f67b5bd..79d38186fa 100644 --- a/app/transporttools/helpsetupgeom.F90 +++ b/app/transporttools/helpsetupgeom.F90 @@ -6,18 +6,18 @@ !--------------------------------------------------------------------------------------------------! module transporttools_helpsetupgeom - use dftbp_common_accuracy - use dftbp_common_constants - use dftbp_common_globalenv + use dftbp_common_accuracy, only : dp, lc + use dftbp_common_constants, only : Bohr__AA + use dftbp_common_globalenv, only : stdOut use dftbp_common_file, only : TFileDescr, openFile, closeFile - use dftbp_io_message - use dftbp_math_f08math - use dftbp_math_simplealgebra - use dftbp_math_sorting + use dftbp_io_message, only : error, warning + use dftbp_math_simplealgebra, only : cross3 + use dftbp_math_sorting, only : index_heap_sort use dftbp_transport_negfvars, only : contactInfo - use dftbp_type_linkedlist - use dftbp_type_typegeometry - use dftbp_type_wrappedintr + use dftbp_type_linkedlist, only : append, asArray, destruct, get, init, len,& + & TListInt, TListIntR1 + use dftbp_type_typegeometry, only : TGeometry + use dftbp_type_wrappedintr, only : TWrappedInt1 implicit none private diff --git a/app/transporttools/inputdata.F90 b/app/transporttools/inputdata.F90 index 7e7b56d82d..6197e45990 100644 --- a/app/transporttools/inputdata.F90 +++ b/app/transporttools/inputdata.F90 @@ -9,14 +9,8 @@ !> Contains data type representing the input data for setupgeom module transporttools_inputdata - use dftbp_common_accuracy - use dftbp_io_message - use dftbp_transport_negfvars - use dftbp_type_commontypes - use dftbp_type_linkedlist - use dftbp_type_typegeometry - use dftbp_type_wrappedintr - + use dftbp_transport_negfvars, only: TTransPar + use dftbp_type_typegeometry, only: TGeometry implicit none private diff --git a/app/transporttools/setupgeom.F90 b/app/transporttools/setupgeom.F90 index 32213a076a..bffa03eff6 100644 --- a/app/transporttools/setupgeom.F90 +++ b/app/transporttools/setupgeom.F90 @@ -8,7 +8,7 @@ #:include 'common.fypp' program setupgeom - use dftbp_common_globalenv + use dftbp_common_globalenv, only: destructGlobalEnv, initGlobalEnv use dftbp_common_release, only : releaseYear use dftbp_io_formatout, only : printDftbHeader use transporttools_inputdata, only : TInputData diff --git a/src/dftbp/api/mm/capi.F90 b/src/dftbp/api/mm/capi.F90 index e8519660db..17a4cb56e7 100644 --- a/src/dftbp/api/mm/capi.F90 +++ b/src/dftbp/api/mm/capi.F90 @@ -7,8 +7,9 @@ !> Contains the C-API of DFTB+. module dftbp_capi - use, intrinsic :: iso_c_binding - use, intrinsic :: iso_fortran_env + use, intrinsic :: iso_c_binding, only : c_char, c_ptr, c_int, c_null_ptr, c_bool,& + & c_double, c_funptr, c_null_char, c_associated, c_loc, c_f_pointer, c_f_procpointer + use, intrinsic :: iso_fortran_env, only : output_unit use dftbp_common_accuracy, only : dp use dftbp_common_file, only : TFileDescr, openFile use dftbp_common_globalenv, only : instanceSafeBuild diff --git a/src/dftbp/api/mm/mmapi.F90 b/src/dftbp/api/mm/mmapi.F90 index 0cf1534536..381d87215d 100644 --- a/src/dftbp/api/mm/mmapi.F90 +++ b/src/dftbp/api/mm/mmapi.F90 @@ -9,7 +9,7 @@ !> Provides DFTB+ API for MM-type high level access module dftbp_mmapi - use iso_fortran_env, only : output_unit + use, intrinsic :: iso_fortran_env, only : output_unit use dftbp_common_accuracy, only : dp use dftbp_common_environment, only : TEnvironment, TEnvironment_init use dftbp_common_file, only : TFileDescr, openFile, closeFile diff --git a/src/dftbp/api/mm/qdepextpotgenc.F90 b/src/dftbp/api/mm/qdepextpotgenc.F90 index 7469288846..97dbb28b4c 100644 --- a/src/dftbp/api/mm/qdepextpotgenc.F90 +++ b/src/dftbp/api/mm/qdepextpotgenc.F90 @@ -7,7 +7,7 @@ !> Simplified C-interface with callbacks for population dependant external potential generators. module dftbp_dftbplus_qdepextpotgenc - use, intrinsic :: iso_c_binding + use, intrinsic :: iso_c_binding, only : c_double, c_ptr use dftbp_common_accuracy, only : dp use dftbp_dftbplus_qdepextpotgen, only : TQDepExtPotGen implicit none diff --git a/src/dftbp/common/gpuenv.F90 b/src/dftbp/common/gpuenv.F90 index 39c202819b..85c879e32a 100644 --- a/src/dftbp/common/gpuenv.F90 +++ b/src/dftbp/common/gpuenv.F90 @@ -10,7 +10,7 @@ !> Information on any GPUs on the system module dftbp_common_gpuenv - use iso_c_binding, only : c_int + use, intrinsic :: iso_c_binding, only : c_int use dftbp_common_globalenv, only : stdOut use dftbp_extlibs_magma, only : getGpusAvailable, getGpusRequested implicit none diff --git a/src/dftbp/derivs/rotatedegen.F90 b/src/dftbp/derivs/rotatedegen.F90 index bba429116b..57ed5367a3 100644 --- a/src/dftbp/derivs/rotatedegen.F90 +++ b/src/dftbp/derivs/rotatedegen.F90 @@ -19,7 +19,7 @@ module dftbp_derivs_rotatedegen #:if WITH_SCALAPACK use dftbp_common_environment, only : TEnvironment use dftbp_type_densedescr, only: TDenseDescr - use linecomm_module, only : linecomm + use dftbp_extlibs_scalapackfx, only : linecomm #:endif implicit none diff --git a/src/dftbp/dftb/dispmbd.F90 b/src/dftbp/dftb/dispmbd.F90 index 2dc43ca3a0..b9e64a2c6f 100644 --- a/src/dftbp/dftb/dispmbd.F90 +++ b/src/dftbp/dftb/dispmbd.F90 @@ -20,7 +20,7 @@ module dftbp_dftb_dispmbd use dftbp_math_simplealgebra, only: determinant33 use dftbp_type_commontypes, only : TOrbitals use dftbp_type_typegeometry, only: TGeometry - use mbd, only: TDispMbdInp => mbd_input_t, mbd_calc_t + use dftbp_extlibs_mbd, only: TDispMbdInp, mbd_calc_t implicit none private diff --git a/src/dftbp/dftb/sccinit.F90 b/src/dftbp/dftb/sccinit.F90 index e2a2689052..6e9b6620ae 100644 --- a/src/dftbp/dftb/sccinit.F90 +++ b/src/dftbp/dftb/sccinit.F90 @@ -17,7 +17,7 @@ module dftbp_dftb_sccinit use dftbp_type_commontypes, only : TOrbitals use dftbp_type_multipole, only : TMultipole use dftbp_dftb_hybridxc, only : checkSupercellFoldingMatrix - use dftbp_dftb_densitymatrix, onLy : TDensityMatrix + use dftbp_dftb_densitymatrix, only : TDensityMatrix implicit none private diff --git a/src/dftbp/dftbplus/mainio.F90 b/src/dftbp/dftbplus/mainio.F90 index 87e6151643..583444bcbc 100644 --- a/src/dftbp/dftbplus/mainio.F90 +++ b/src/dftbp/dftbplus/mainio.F90 @@ -21,7 +21,7 @@ module dftbp_dftbplus_mainio use dftbp_common_file, only : TFileDescr, openFile, closeFile use dftbp_common_globalenv, only : stdOut, destructGlobalEnv, abortProgram use dftbp_common_status, only : TStatus - use dftbp_dftb_densitymatrix, onLy : TDensityMatrix + use dftbp_dftb_densitymatrix, only : TDensityMatrix use dftbp_dftb_determinants, only : TDftbDeterminants use dftbp_dftb_dispersions, only : TDispersionIface use dftbp_dftb_elecconstraints, only: TElecConstraint diff --git a/src/dftbp/extlibs/CMakeLists.txt b/src/dftbp/extlibs/CMakeLists.txt index ea7a3e99b6..55f1eae2b4 100644 --- a/src/dftbp/extlibs/CMakeLists.txt +++ b/src/dftbp/extlibs/CMakeLists.txt @@ -32,5 +32,9 @@ if(WITH_MAGMA) ${curdir}/magmac.c) endif() +if(WITH_MBD) + list(APPEND sources-fpp ${curdir}/mbd.F90) +endif() + set(ALL-SOURCES-FPP ${ALL-SOURCES-FPP} ${sources-fpp} PARENT_SCOPE) set(ALL-SOURCES-C ${ALL-SOURCES-C} ${sources-c} PARENT_SCOPE) diff --git a/src/dftbp/extlibs/arpack.F90 b/src/dftbp/extlibs/arpack.F90 index fb4649f640..c057c889c9 100644 --- a/src/dftbp/extlibs/arpack.F90 +++ b/src/dftbp/extlibs/arpack.F90 @@ -14,7 +14,7 @@ module dftbp_extlibs_arpack use dftbp_common_accuracy, only : rsp, rdp #:if not WITH_ARPACK - use dftbp_io_message + use dftbp_io_message, only : error #:endif implicit none private diff --git a/src/dftbp/extlibs/elsiiface.F90 b/src/dftbp/extlibs/elsiiface.F90 index 569e505c2c..e7015d2353 100644 --- a/src/dftbp/extlibs/elsiiface.F90 +++ b/src/dftbp/extlibs/elsiiface.F90 @@ -13,9 +13,26 @@ module dftbp_extlibs_elsiiface use dftbp_common_accuracy, only : dp #:if WITH_ELSI - use elsi + use elsi, only : elsi_ev_complex, elsi_ev_real, elsi_get_version, elsi_finalize,& + & elsi_reinit, elsi_init, elsi_set_mpi_global, elsi_set_sing_check, elsi_set_mpi,& + & elsi_set_csc_blk, elsi_set_zero_def, elsi_set_sparsity_mask, elsi_set_blacs,& + & elsi_init_rw, elsi_set_rw_blacs, elsi_set_rw_zero_def, elsi_get_datestamp,& + & elsi_set_elpa_solver, elsi_set_elpa_autotune, elsi_set_elpa_gpu,& + & elsi_set_omm_flavor, elsi_set_omm_n_elpa, elsi_set_omm_tol,& + & elsi_set_pexsi_np_per_pole, elsi_set_pexsi_mu_min, elsi_set_pexsi_mu_max,& + & elsi_set_pexsi_method, elsi_set_pexsi_n_pole, elsi_set_pexsi_n_mu,& + & elsi_set_pexsi_np_symbo, elsi_set_pexsi_delta_e, elsi_set_ntpoly_tol,& + & elsi_set_ntpoly_filter, elsi_set_ntpoly_method, elsi_set_spin, elsi_set_kpoint,& + & elsi_set_output, elsi_set_output_log, elsi_get_entropy, elsi_get_mu,& + & elsi_get_pexsi_mu_max, elsi_get_pexsi_mu_min, elsi_write_mat_real,& + & elsi_finalize_rw, elsi_dm_complex, elsi_write_mat_complex, elsi_set_mu_broaden_width,& + & elsi_set_mu_mp_order, elsi_set_mu_broaden_scheme, elsi_set_pexsi_temp,& + & elsi_set_csc, elsi_set_rw_csc, elsi_write_mat_complex_sparse, elsi_dm_complex_sparse,& + & elsi_get_edm_real_sparse, elsi_get_edm_real, elsi_set_rw_mpi, elsi_get_edm_complex,& + & elsi_get_edm_complex_sparse, elsi_dm_real, elsi_write_mat_real_sparse,& + & elsi_dm_real_sparse, elsi_rw_handle, elsi_handle #:else - use iso_c_binding, only : r8 => c_double, i4 => c_int32_t + use, intrinsic :: iso_c_binding, only : r8 => c_double, i4 => c_int32_t use dftbp_io_message, only : error #:endif implicit none diff --git a/src/dftbp/extlibs/fsockets.F90 b/src/dftbp/extlibs/fsockets.F90 index 4d32367df6..f9f59cb2fa 100644 --- a/src/dftbp/extlibs/fsockets.F90 +++ b/src/dftbp/extlibs/fsockets.F90 @@ -7,7 +7,8 @@ !> Socket interface library module dftbp_extlibs_fsockets - use fsockets + use fsockets, only : writebuffer, readbuffer, close_socket, connect_inet_socket,& + & connect_unix_socket implicit none #:if WITH_SOCKETS diff --git a/src/dftbp/extlibs/mpifx.F90 b/src/dftbp/extlibs/mpifx.F90 index 1a5b1f1769..495e8ef1b2 100644 --- a/src/dftbp/extlibs/mpifx.F90 +++ b/src/dftbp/extlibs/mpifx.F90 @@ -10,7 +10,11 @@ !> Exporting mpifx functionality if compiled with mpi support, otherwise empty. module dftbp_extlibs_mpifx #:if WITH_MPI - use libmpifx_module + use libmpifx_module, only : mpifx_abort, mpifx_allgather, mpifx_allreduce,& + & mpifx_allreduceip, mpifx_barrier, mpifx_bcast, mpifx_comm, mpifx_finalize,& + & mpifx_init_thread, mpifx_recv, mpifx_reduceip, mpifx_send, MPIFX_SIZE_T, & + & mpifx_win, MPI_COMM_TYPE_SHARED, MPI_LAND, MPI_LOR, MPI_MAX, MPI_SUM, & + & MPI_THREAD_FUNNELED, mpifx_gatherv #:endif implicit none public diff --git a/src/dftbp/extlibs/negf.F90 b/src/dftbp/extlibs/negf.F90 index a77ea88cf9..e98056c78a 100644 --- a/src/dftbp/extlibs/negf.F90 +++ b/src/dftbp/extlibs/negf.F90 @@ -19,7 +19,8 @@ module dftbp_extlibs_negf & init_negf, init_structure, pass_hs, set_bp_dephasing, set_drop, set_elph_block_dephasing,& & set_elph_dephasing, set_elph_s_dephasing, set_ldos_indexes, set_params, set_scratch,& & set_tun_indexes, writememinfo, writepeakinfo, dns2csr, csr2dns, nzdrop, printcsr,& - & compute_phonon_current, thermal_conductance, convertHeatCurrent, convertHeatConductance + & compute_phonon_current, thermal_conductance, convertHeatCurrent, convertHeatConductance,& + & r_CSR, r_DNS #:if WITH_MPI use libnegf, only : negf_mpi_init, negf_cart_init #:endif diff --git a/src/dftbp/extlibs/poisson.F90 b/src/dftbp/extlibs/poisson.F90 index dc15e4d921..a23c8c086e 100644 --- a/src/dftbp/extlibs/poisson.F90 +++ b/src/dftbp/extlibs/poisson.F90 @@ -21,7 +21,7 @@ module dftbp_extlibs_poisson use dftbp_io_message, only : error use dftbp_type_commontypes, only : TOrbitals #:if WITH_MPI - use libmpifx_module, only : mpifx_barrier, mpifx_bcast + use dftbp_extlibs_mpifx, only : mpifx_barrier, mpifx_bcast #:endif #:if WITH_POISSON use dftbp_poisson_poisson, only : poiss_savepotential, poiss_updcoords, active_id, natoms,& diff --git a/src/dftbp/extlibs/scalapackfx.F90 b/src/dftbp/extlibs/scalapackfx.F90 index 111bcd12d2..a303f99eae 100644 --- a/src/dftbp/extlibs/scalapackfx.F90 +++ b/src/dftbp/extlibs/scalapackfx.F90 @@ -10,7 +10,13 @@ !> Exports scalapackfx functionality if compiled with scalapack support, otherwise empty. module dftbp_extlibs_scalapackfx #:if WITH_SCALAPACK - use libscalapackfx_module + use libscalapackfx_module, only : DLEN_, blacsgrid, blocklist, size,& + & pblasfx_pgemm, pblasfx_ptranc, scalafx_getdescriptor, scalafx_getlocalshape,& + & scalafx_indxl2g, scalafx_cpl2g, scalafx_islocal, scalafx_cpg2l, pblasfx_psymv,& + & CSRC_, RSRC_, MB_, NB_, scalafx_addl2g, scalafx_addg2l, pblasfx_ptran,& + & pblasfx_phemm, pblasfx_psymm, linecomm, scalafx_ppotrf, scalafx_ppotri, M_,& + & N_, scalafx_pgetrf, blacsfx_gemr2d, scalafx_phegv, scalafx_phegvd,& + & scalafx_phegvr, scalafx_psygv, scalafx_psygvd, scalafx_psygvr #:endif implicit none public diff --git a/src/dftbp/extlibs/xmlf90.F90 b/src/dftbp/extlibs/xmlf90.F90 index b916e2e92d..df286ab30c 100644 --- a/src/dftbp/extlibs/xmlf90.F90 +++ b/src/dftbp/extlibs/xmlf90.F90 @@ -7,12 +7,17 @@ !> Exporting the functionality we use from the library XMLF90. module dftbp_extlibs_xmlf90 - use xmlf90_flib_dom - use xmlf90_flib_wxml - use xmlf90_strings + use xmlf90_flib_dom, only : fnode, string, fnodeList, TEXT_NODE, item,& + & getParentNode, getLength, getFirstChild, removeChild, getNextSibling,& + & getAttributeNode, getNodeType, char, getLastChild, getPreviousSibling,& + & operator(==), destroyNode, append, getNodeValue, getNodeName, assignment(=),& + & len, createElement, appendChild, createTextNode, createDocumentNode,& + & prepend_to_string, getAttribute, setAttribute, normalize, textNodeName,& + & ELEMENT_NODE, replaceChild, trim, append_to_string, resize_string, getItem1,& + & parsefile, removeAttribute, setTagName, destroyNodeList + use xmlf90_flib_wxml, only : xmlf_t, xml_NewElement, xml_AddPCData, xml_EndElement,& + & xml_Close, xml_OpenFile, xml_ADDXMLDeclaration implicit none public - public :: xmlf_t - end module dftbp_extlibs_xmlf90 diff --git a/src/dftbp/include/common.fypp b/src/dftbp/include/common.fypp index 4a0f497880..ae838595df 100644 --- a/src/dftbp/include/common.fypp +++ b/src/dftbp/include/common.fypp @@ -124,7 +124,7 @@ end block #! Simple macro printing out the position of a line #:def PRINT_POSITION() block - use iso_fortran_env, only : output_unit + use, intrinsic :: iso_fortran_env, only : output_unit write(output_unit, "(a)") "Reached line ${_LINE_}$ in ${_FILE_}$" flush(output_unit) end block diff --git a/src/dftbp/include/error.fypp b/src/dftbp/include/error.fypp index 878c73b19c..a049a9bc86 100644 --- a/src/dftbp/include/error.fypp +++ b/src/dftbp/include/error.fypp @@ -20,7 +20,7 @@ #:def ERROR_HANDLING(errVar, errNumber, msg) block use dftbp_common_accuracy, only : lc - use dftbp_io_message + use dftbp_io_message, only : error, warning !> Error handling string character(lc) :: stringTmp @@ -41,7 +41,7 @@ #:def FORMATTED_ERROR_HANDLING(errVar, errNumber, formating, *variables) block use dftbp_common_accuracy, only : lc - use dftbp_io_message + use dftbp_io_message, only : error, warning !> Error handling string character(lc) :: stringTmp diff --git a/src/dftbp/io/hsdparser.F90 b/src/dftbp/io/hsdparser.F90 index 000d4d0607..7be7fc425e 100644 --- a/src/dftbp/io/hsdparser.F90 +++ b/src/dftbp/io/hsdparser.F90 @@ -19,9 +19,9 @@ module dftbp_io_hsdparser use dftbp_common_file, only : TFileDescr, TOpenOptions, openFile, closeFile use dftbp_extlibs_xmlf90, only : fnode, string, getNodeType, TEXT_NODE, len, getParentNode, char,& - & getAttributeNode, getFirstChild, getNextSibling, removeChild, createElement, appendChild,& + & getAttributeNode, getFirstChild, getNextSibling, removeChild, appendChild,& & createElement, createTextNode, createDocumentNode, assignment(=), prepend_to_string,& - & getAttribute, getNodeName, getNodeValue, destroyNode, setAttribute, getAttribute, normalize + & getAttribute, getNodeName, getNodeValue, destroyNode, setAttribute, normalize use dftbp_io_charmanip, only : newline, whiteSpaces, trim2, tolower, i2c, unquotedIndex, unquote,& & unquotedScan, convertWhitespaces, getFirstOccurance use dftbp_io_linereader, only : TLineReader diff --git a/src/dftbp/poisson/mpi_poisson.F90 b/src/dftbp/poisson/mpi_poisson.F90 index 608dcca29c..29c62d76ab 100644 --- a/src/dftbp/poisson/mpi_poisson.F90 +++ b/src/dftbp/poisson/mpi_poisson.F90 @@ -18,7 +18,7 @@ module dftbp_poisson_mpi_poisson #:if WITH_MPI - use libmpifx_module, only : mpifx_comm, mpifx_gatherv + use dftbp_extlibs_mpifx, only : mpifx_comm, mpifx_gatherv implicit none private diff --git a/src/dftbp/solvation/cosmo.F90 b/src/dftbp/solvation/cosmo.F90 index a6d8cd8c5a..d6716fbec4 100644 --- a/src/dftbp/solvation/cosmo.F90 +++ b/src/dftbp/solvation/cosmo.F90 @@ -8,7 +8,7 @@ #:include 'common.fypp' module dftbp_solvation_cosmo - use ddcosmo_core, only : ddupdate, TDomainDecomposition_init, wghpot, intrhs, fdoka, fdokb,& + use dftbp_extlibs_ddcosmo, only : ddupdate, TDomainDecomposition_init, wghpot, intrhs, fdoka, fdokb,& & fdoga use dftbp_common_accuracy, only : dp use dftbp_common_constants, only : pi, Hartree__eV, Bohr__AA diff --git a/src/dftbp/transport/matconv.F90 b/src/dftbp/transport/matconv.F90 index 4526efbbb5..4824ec8903 100644 --- a/src/dftbp/transport/matconv.F90 +++ b/src/dftbp/transport/matconv.F90 @@ -19,7 +19,7 @@ module dftbp_transport_matconv use dftbp_common_accuracy, only : dp use dftbp_common_constants, only : pi use dftbp_type_commontypes, only : TOrbitals - use libnegf, only: r_CSR, z_CSR, r_DNS, z_DNS, create, destroy + use dftbp_extlibs_negf, only: r_CSR, z_CSR, r_DNS, z_DNS, create, destroy implicit none private diff --git a/test/src/dftbp/api/mm/testers/test_ehrenfest.f90 b/test/src/dftbp/api/mm/testers/test_ehrenfest.f90 index 93dca50bbc..a5d731c2d2 100644 --- a/test/src/dftbp/api/mm/testers/test_ehrenfest.f90 +++ b/test/src/dftbp/api/mm/testers/test_ehrenfest.f90 @@ -8,7 +8,8 @@ program test_ehrenfest use, intrinsic :: iso_fortran_env, only : output_unit use dftbp_common_constants, only : AA__Bohr, V_m__au, eV__Hartree, fs__au, pi, imag - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, dumpHsd,& + & setChild, getDftbPlusApi, getDftbPlusBuild, TDftbPlus_init ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_ehrenfest_ext_ions.f90 b/test/src/dftbp/api/mm/testers/test_ehrenfest_ext_ions.f90 index 716b2a0b96..ffcf1c5147 100644 --- a/test/src/dftbp/api/mm/testers/test_ehrenfest_ext_ions.f90 +++ b/test/src/dftbp/api/mm/testers/test_ehrenfest_ext_ions.f90 @@ -8,7 +8,8 @@ program test_ehrenfest use, intrinsic :: iso_fortran_env, only : output_unit use dftbp_common_constants, only : AA__Bohr, V_m__au, eV__Hartree, fs__au, pi, imag - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, dumpHsd,& + & setChild, getDftbPlusApi, getDftbPlusBuild, TDftbPlus_init ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_extcharges.f90 b/test/src/dftbp/api/mm/testers/test_extcharges.f90 index 06306a7498..261bbc2529 100644 --- a/test/src/dftbp/api/mm/testers/test_extcharges.f90 +++ b/test/src/dftbp/api/mm/testers/test_extcharges.f90 @@ -8,7 +8,9 @@ !> example code for adding external charges to a water molecule calculation program test_extcharges use, intrinsic :: iso_fortran_env, only : output_unit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, getMaxAngFromSlakoFile,& + & setChild, getDftbPlusApi, getDftbPlusBuild, TDftbPlus_init, convertAtomTypesToSpecies,& + & dumpHsd use dftbp_common_constants, only : AA__Bohr ! Only needed for the internal test system use testhelpers, only : writeAutotestTag diff --git a/test/src/dftbp/api/mm/testers/test_extpot.f90 b/test/src/dftbp/api/mm/testers/test_extpot.f90 index be4447cee4..41bd8cd0c5 100644 --- a/test/src/dftbp/api/mm/testers/test_extpot.f90 +++ b/test/src/dftbp/api/mm/testers/test_extpot.f90 @@ -7,9 +7,10 @@ program test_extpot use, intrinsic :: iso_fortran_env, only : output_unit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, dumpHsd,& + & setChild, getDftbPlusApi, getDftbPlusBuild, TDftbPlus_init use dftbp_common_constants, only : AA__Bohr - use extchargepot + use extchargepot, only : getPointChargeGradients, getPointChargePotential ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_extpot2.f90 b/test/src/dftbp/api/mm/testers/test_extpot2.f90 index dbfab79ce5..754d3a6dd4 100644 --- a/test/src/dftbp/api/mm/testers/test_extpot2.f90 +++ b/test/src/dftbp/api/mm/testers/test_extpot2.f90 @@ -13,9 +13,11 @@ !> program test_extpot2 use, intrinsic :: iso_fortran_env, only : output_unit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, getMaxAngFromSlakoFile,& + & setChildValue, getDftbPlusBuild, getDftbPlusApi, TDftbPlus_init, setChild,& + & dumpHsd use dftbp_common_constants, only : AA__Bohr - use extchargepot + use extchargepot, only : getPointChargePotential, getPointChargeGradients ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_fileinit.f90 b/test/src/dftbp/api/mm/testers/test_fileinit.f90 index a6e1e41c82..c4f7bbbaf2 100644 --- a/test/src/dftbp/api/mm/testers/test_fileinit.f90 +++ b/test/src/dftbp/api/mm/testers/test_fileinit.f90 @@ -8,7 +8,8 @@ !> Reads in a dftb_in.hsd file then overrides some of its supplied setting, before calculating !> properties program test_fileinit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, getDftbPlusApi, getDftbPlusBuild,& + & TDftbPlus_init use dftbp_common_constants, only : AA__Bohr ! Only needed for the internal test system use testhelpers, only : writeAutotestTag diff --git a/test/src/dftbp/api/mm/testers/test_intcharges.f90 b/test/src/dftbp/api/mm/testers/test_intcharges.f90 index de9b10cfd6..3db960d39b 100644 --- a/test/src/dftbp/api/mm/testers/test_intcharges.f90 +++ b/test/src/dftbp/api/mm/testers/test_intcharges.f90 @@ -8,7 +8,9 @@ !> example code for changing internal charges inside calculation program test_intcharges use, intrinsic :: iso_fortran_env, only : output_unit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, getMaxAngFromSlakoFile,& + & setChildValue, getDftbPlusApi, getDftbPlusBuild, setChild, TDftbPlus_init,& + & convertAtomTypesToSpecies, dumpHsd ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_neighbour_list.f90 b/test/src/dftbp/api/mm/testers/test_neighbour_list.f90 index 2680c6333f..7d5f338bb7 100644 --- a/test/src/dftbp/api/mm/testers/test_neighbour_list.f90 +++ b/test/src/dftbp/api/mm/testers/test_neighbour_list.f90 @@ -7,7 +7,8 @@ !> Explicitly sets the neighbour list via the API and checks the result program test_neighbour_list - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, TDftbPlus_init, getDftbPlusApi,& + & getDftbPlusBuild ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_qdepextpot.f90 b/test/src/dftbp/api/mm/testers/test_qdepextpot.f90 index 5004f5b34a..7164f5d62b 100644 --- a/test/src/dftbp/api/mm/testers/test_qdepextpot.f90 +++ b/test/src/dftbp/api/mm/testers/test_qdepextpot.f90 @@ -11,7 +11,8 @@ !> Use it with the input in the test/api/mm/qdepextpot/ folder. !> program test_qdepextpot - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, TDftbPlus_init, getDftbPlusApi,& + & getDftbPlusBuild use extchargepot, only : getPointChargePotential use extchargepotgen, only : TExtChargePotGen, TExtChargePotGen_init ! Only needed for the internal test system diff --git a/test/src/dftbp/api/mm/testers/test_timeprop.f90 b/test/src/dftbp/api/mm/testers/test_timeprop.f90 index d006473173..2a8c8c4a9d 100644 --- a/test/src/dftbp/api/mm/testers/test_timeprop.f90 +++ b/test/src/dftbp/api/mm/testers/test_timeprop.f90 @@ -8,7 +8,8 @@ program test_timeprop use, intrinsic :: iso_fortran_env, only : output_unit use dftbp_common_constants, only : AA__Bohr, V_m__au - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, dumpHsd,& + & getDftbPlusApi, getDftbPlusBuild, setChild, TDftbPlus_init ! Only needed for the internal test system use testhelpers, only : writeAutotestTag implicit none diff --git a/test/src/dftbp/api/mm/testers/test_treeinit.f90 b/test/src/dftbp/api/mm/testers/test_treeinit.f90 index 839b0321b5..cc5a5e4064 100644 --- a/test/src/dftbp/api/mm/testers/test_treeinit.f90 +++ b/test/src/dftbp/api/mm/testers/test_treeinit.f90 @@ -9,7 +9,8 @@ !> periodic geometry with k-points. program test_treeinit use, intrinsic :: iso_fortran_env, only : output_unit - use dftbplus + use dftbplus, only : TDftbPlus, TDftbPlusInput, fnode, setChildValue, dumpHsd,& + & setChild, getDftbPlusApi, getDftbPlusBuild, TDftbPlus_init use dftbp_common_constants, only : AA__Bohr ! Only needed for the internal test system use testhelpers, only : writeAutotestTag diff --git a/test/src/dftbp/api/mm/testers/testhelpers.f90 b/test/src/dftbp/api/mm/testers/testhelpers.f90 index b9eedc9966..4f84519233 100644 --- a/test/src/dftbp/api/mm/testers/testhelpers.f90 +++ b/test/src/dftbp/api/mm/testers/testhelpers.f90 @@ -8,7 +8,8 @@ !> Module containing routines for the automatic testing of the API functionality module testhelpers - use, intrinsic :: iso_c_binding + use, intrinsic :: iso_c_binding, only : c_ptr, c_double, c_int, c_associated,& + & c_f_pointer use dftbp_common_accuracy, only : dp use dftbp_common_file, only : TFileDescr, openFile, closeFile use dftbp_io_taggedoutput, only : tagLabels, TTaggedWriter, TTaggedWriter_init