diff --git a/.gitignore b/.gitignore index e75bf820..f95aca15 100644 --- a/.gitignore +++ b/.gitignore @@ -78,7 +78,15 @@ examples/SCFenergy/testit.sh examples/WriteTest/testit.sh examples/hartreefock/Makefile.am examples/DataSummary/test/ -doc/ -!doc/Doxygen +doc/* +!doc/Doxyfile !doc/ABOUT_Algebra2.md !doc/mqcpack_logo.png +!doc/AGENT_API_GUIDE.md +!doc/api/ +doc/api/* +!doc/api/*.md +!doc/api/generate_procedure_index.py +!configure.ac +!Makefile.am +!examples/Build_Tests/Makefile.am diff --git a/.other_libs/build_fcns/Makefile.am_FormCHK b/.other_libs/build_fcns/Makefile.am_FormCHK deleted file mode 100644 index 58034dba..00000000 --- a/.other_libs/build_fcns/Makefile.am_FormCHK +++ /dev/null @@ -1,5 +0,0 @@ -AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) -AM_CPPFLAGS = $(MQC_CPPFLAGS) -SUBDIRS = src examples/Build_Tests -dist_doc_DATA = README - diff --git a/.other_libs/build_fcns/Makefile.am_example_FormCHK b/.other_libs/build_fcns/Makefile.am_example_FormCHK deleted file mode 100644 index dbd2f8fe..00000000 --- a/.other_libs/build_fcns/Makefile.am_example_FormCHK +++ /dev/null @@ -1,11 +0,0 @@ -AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) -AM_CPPFLAGS = $(MQC_CPPFLAGS) -AUTOMAKE_OPTIONS = subdir-objects -TESTS = ../algebra2/testit.sh -check_PROGRAMS = ../algebra2/algebra_fun -SOURCES = ../algebra2/algebra_fun.F03 -___algebra2_algebra_fun_SOURCES = ../algebra2/algebra_fun.F03 -LDADD = ../../src/libmqc.a ${MQC_LAPACK} ${MQC_BLAS} -build: ../algebra2/algebra_fun.$(OBJEXT) - - diff --git a/.other_libs/build_fcns/Makefile.am_example_MatrixFile b/.other_libs/build_fcns/Makefile.am_example_MatrixFile deleted file mode 100644 index efad4f57..00000000 --- a/.other_libs/build_fcns/Makefile.am_example_MatrixFile +++ /dev/null @@ -1,22 +0,0 @@ -AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) -AM_CPPFLAGS = $(MQC_CPPFLAGS) -AM_LDFLAGS = $(MQC_LDFLAGS) -AUTOMAKE_OPTIONS = subdir-objects -#TESTS = ../algebra2/testit.sh ../fullci/testit.sh ../hartreefock/testit.sh ../diishf/testit.sh ../DataSummary/testit.sh ../PrintAllData/testit.sh ../SCFenergy/testit.sh ../WriteTest/testit.sh -#check_PROGRAMS = ../algebra2/algebra_fun ../fullci/fullci ../hartreefock/hartreefock ../diishf/diishf ../DataSummary/DataSummary ../PrintAllData/DataPrint ../SCFenergy/SCFenergy ../WriteTest/ReadWrite -#SOURCES = ../algebra2/algebra_fun.F03 ../fullci/fullci.F03 ../hartreefock/hartreefock.F03 ../diishf/diishf.F03 ../DataSummary/DataSummary.F03 ../PrintAllData/DataPrint.F03 ../SCFenergy/SCFenergy.F03 ../WriteTest/ReadWrite.F03 -TESTS = ../algebra2/testit.sh ../fullci/testit.sh ../hartreefock/testit.sh ../WriteTest/testit.sh -check_PROGRAMS = ../algebra2/algebra_fun ../fullci/fullci ../hartreefock/hartreefock ../WriteTest/ReadWrite -SOURCES = ../algebra2/algebra_fun.F03 ../fullci/fullci.F03 ../hartreefock/hartreefock.F03 ../WriteTest/ReadWrite.F03 -___algebra2_algebra_fun_SOURCES = ../algebra2/algebra_fun.F03 -___fullci_fullci_SOURCES = ../fullci/fullci.F03 -___hartreefock_hartreefock_SOURCES = ../hartreefock/hartreefock.F03 -#___diishf_diishf_SOURCES = ../diishf/diishf.F03 -#___DataSummary_DataSummarya_SOURCES = ../DataSummary/DataSummary.F03 -#___PrintAllData_DataPrint_SOURCES = ../PrintAllData/DataPrint.F03 -#___SCFenergy_SCFenergy_SOURCES = ../SCFenergy/SCFenergy.F03 -___WriteTest_ReadWrite_SOURCES = ../WriteTest/ReadWrite.F03 -LDADD = ../../src/libmqc.a ${MQC_LAPACK} ${MQC_BLAS} -#LDFLAGS = $(MQC_LDFLAGS) -#build: ../algebra2/algebra_fun.$(OBJEXT) ../fullci/fullci.$(OBJEXT) ../hartreefock/hartreefock.$(OBJEXT) ../diishf/diishf.$(OBJEXT) ../DataSummary/DataSummary.$(OBJEXT) ../PrintAllData/DataPrint.$(OBJEXT) ../SCFenergy/SCFenergy.$(OBJEXT) ../WriteTest/ReadWrite.$(OBJEXT) -build: ../algebra2/algebra_fun.$(OBJEXT) ../fullci/fullci.$(OBJEXT) ../hartreefock/hartreefock.$(OBJEXT) ../WriteTest/ReadWrite.$(OBJEXT) diff --git a/.other_libs/build_fcns/README b/.other_libs/build_fcns/README index acc63986..85c73339 100644 --- a/.other_libs/build_fcns/README +++ b/.other_libs/build_fcns/README @@ -1,2 +1,4 @@ -This directory contains 2 scripts required by the install script. The functionality fails when used in the sctipt. -It also contains data files written by the install script. +This directory contains helper scripts and saved local defaults used by +mqc_script. The canonical Autotools inputs are configure.ac, Makefile.am, +src/Makefile.am, and examples/Build_Tests/Makefile.am in the main source tree. +Generated configure and Makefile.in files are not maintained here. diff --git a/.other_libs/build_fcns/configure.ac_FormCHK b/.other_libs/build_fcns/configure.ac_FormCHK deleted file mode 100644 index 5819f371..00000000 --- a/.other_libs/build_fcns/configure.ac_FormCHK +++ /dev/null @@ -1,24 +0,0 @@ -AC_INIT([MQC_Pack], [26.7.1], [hhratchian@ucmerced.edu]) -AM_INIT_AUTOMAKE([foreign]) -AC_CONFIG_SRCDIR([src/mqc_general.F03]) -AC_PROG_CPP -AC_PROG_CC( [pgcc gcc icc] ) -AC_PROG_FC( [pgfortran gfortran ifort] ) -MQC_SPECIFIC_FCFLAGS=; -if `echo $FC 2>&1 | grep 'pgfortran' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-r8 -i8 -Mallocatable=03 -module `pwd`/src" - MQC_CPPFLAGS="-DPGI -DFORMCHK" -elif `echo $FC 2>&1 | grep 'gfortran' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-std=f2008 -fdefault-real-8 -fdefault-integer-8 -J`pwd`/src" - MQC_CPPFLAGS="-DGNU -DFORMCHK" -elif `echo $FC 2>&1 | grep 'ifort' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-stand f03 -real-size 64 -integer-size 64 -module `pwd`/src" - MQC_CPPFLAGS="-DINTEL -DFORMCHK" -else - MQC_SPECIFIC_FCFLAGS="ERROR need to add instance of the special flags for this compiler into configure.ac" -fi -AC_PROG_RANLIB -AC_SUBST(MQC_SPECIFIC_FCFLAGS, $MQC_SPECIFIC_FCFLAGS) -AC_SUBST(MQC_CPPFLAGS, $MQC_CPPFLAGS) -AC_CONFIG_FILES([Makefile src/Makefile examples/Build_Tests/Makefile]) -AC_OUTPUT diff --git a/.other_libs/build_fcns/configure.ac_MatrixFile b/.other_libs/build_fcns/configure.ac_MatrixFile deleted file mode 100644 index 21610bb9..00000000 --- a/.other_libs/build_fcns/configure.ac_MatrixFile +++ /dev/null @@ -1,42 +0,0 @@ -AC_INIT([MQC_Pack], [26.7.1], [hhratchian@ucmerced.edu]) -AM_INIT_AUTOMAKE([foreign]) -AC_CONFIG_SRCDIR([src/mqc_general.F03]) -AC_LANG([Fortran]) -AC_PROG_CPP -AC_PROG_CC( [gcc gcc icc] ) -AC_PROG_FC( [pgfortran gfortran ifort] ) -MQC_SPECIFIC_FCFLAGS=; -MQC_LDFLAGS=; -if `echo $FC 2>&1 | grep 'pgfortran' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-r8 -i8 -mp -Mallocatable=03 -module `pwd`/src" - MQC_CPPFLAGS="-DMATRIXFILE -DPGI" - AC_CHECK_LIB(blas,dswap,[ - echo 'Attempting to compile with GNU blas/lapack libraries'],[ - echo 'Attempting to compile with Intel oneapi MKL libraries' - MQC_LDFLAGS="-lmkl_rt -lpthread -lm -ldl" - ]) -elif `echo $FC 2>&1 | grep 'gfortran' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-std=f2008 -fdefault-real-8 -fdefault-integer-8 -fopenmp -J`pwd`/src" - MQC_CPPFLAGS="-DMATRIXFILE -DGNU" - AC_CHECK_LIB(blas,dswap,[ - echo 'Attempting to compile with GNU blas/lapack libraries'],[ - echo 'Attempting to compile with Intel oneapi MKL libraries' - MQC_LDFLAGS="-lmkl_rt -Wl,--no-as-needed -lpthread -lm -ldl" - ]) -elif `echo $FC 2>&1 | grep 'ifort' >/dev/null 2>&1` ; then - MQC_SPECIFIC_FCFLAGS="-stand f03 -real-size 64 -integer-size 64 -openmp -module `pwd`/src" - MQC_CPPFLAGS="-DINTEL -DMATRIXFILE" - AC_CHECK_LIB(blas,dswap,[ - echo 'Attempting to compile with GNU blas/lapack libraries'],[ - echo 'Attempting to compile with Intel oneapi MKL libraries' - MQC_LDFLAGS="-lmkl_rt -lpthread -lm -ldl" - ]) -else - MQC_SPECIFIC_FCFLAGS="ERROR need to add instance of the special flags for this compiler into configure.ac" -fi -AC_PROG_RANLIB -AC_SUBST(MQC_SPECIFIC_FCFLAGS, $MQC_SPECIFIC_FCFLAGS) -AC_SUBST(MQC_CPPFLAGS, $MQC_CPPFLAGS) -AC_SUBST(MQC_LDFLAGS, $MQC_LDFLAGS) -AC_CONFIG_FILES([Makefile src/Makefile examples/Build_Tests/Makefile]) -AC_OUTPUT diff --git a/.other_libs/gauopen/Int_specific b/.other_libs/gauopen/Int_specific deleted file mode 100755 index cc3b5b1b..00000000 --- a/.other_libs/gauopen/Int_specific +++ /dev/null @@ -1,212 +0,0 @@ -#! /bin/bash -f - -chmod 755 ${MQC_HOME}/.other_libs/gauopen/To_lower -${MQC_HOME}/.other_libs/gauopen/To_lower qcmatrixio.F -mv mqc_tmp1 qcmatrixio.low -${MQC_HOME}/.other_libs/gauopen/To_lower qcmatrix.F -mv mqc_tmp1 qcmatrix.low - -sed -e 's/wr_libuf/wrlibuf4/g' < qcmatrixio.low > mqc_tmp1 -sed -e 's/wr_lrbuf/wrlrbuf4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lcbuf/wrlcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_lrind/wrlrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lao2e/wrlao2e4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/open_read/openread4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/open_write/openwrite4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_matf/closematf4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_2e1/rd2e14/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_2en/rd2en4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_cbuf/rdcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_head/rdhead4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_ibuf/rdibuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_labl/rdlabl4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_rbuf/rdrbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_rind/rdrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_skip/rdskip4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_2e/wr2e4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_cbuf/wrcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_head/wrhead4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_ibuf/wribuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_labl/wrlabl4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_rbuf/wrrbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_rind/wrrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expao1/expa14/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/expaon/expan4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aclear/aclea4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lenarr/lenar4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aoints/a4ints/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind2c/l4nd2c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind2/l4nd2/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind3c/l4nd3c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind3/l4nd3/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind4c/l4nd4c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind4/l4nd4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind5c/l4nd5c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind5/l4nd5/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/numnza/n4mnza/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/numnzr/n4mnzr/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/iclear/iclea4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/clean_label/clean_label4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_faf/closematf4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_expao/qcm_expao4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_maxinzr/qcm_maxinzr4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_chbuf/rd_chbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_chbufi/rd_chbufi4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_spa/rd_spa4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_spac/rd_spac4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_chbuf/wr_chbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_spa/wr_spa4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_numnzt/qcm_numnzt4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_numnztp/qcm_numnztp4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/close_matf/closematf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcmatrixio/qcmatrixi4/g' < mqc_tmp1 > qcmatrixio_4.F - -sed -e 's/wr_libuf/wrlibuf4/g' < qcmatrix.low > mqc_tmp1 -sed -e 's/wr_lrbuf/wrlrbuf4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lcbuf/wrlcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_lrind/wrlrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lao2e/wrlao2e4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/open_read/openread4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/open_write/openwrite4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_matf/closematf4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_2e1/rd2e14/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_2en/rd2en4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_cbuf/rdcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_head/rdhead4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_ibuf/rdibuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_labl/rdlabl4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_rbuf/rdrbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_rind/rdrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_skip/rdskip4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_2e/wr2e4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_cbuf/wrcbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_head/wrhead4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_ibuf/wribuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_labl/wrlabl4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_rbuf/wrrbuf4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_rind/wrrind4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expao1/expa14/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/expaon/expan4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aclear/aclea4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lenarr/lenar4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aoints/a4ints/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind2c/l4nd2c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind2/l4nd2/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind3c/l4nd3c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind3/l4nd3/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind4c/l4nd4c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind4/l4nd4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind5c/l4nd5c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind5/l4nd5/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/numnza/n4mnza/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/numnzr/n4mnzr/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/iclear/iclea4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expd2e/expd2e4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/pr_spa/pr_spa4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_numnzt/qcm_numnzt4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_numnztp/qcm_numnztp4/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcmatrixio/qcmatrixi4/g' < mqc_tmp2 > qcmatrix_4.F - -sed -e 's/wr_libuf/wrlibuf8/g' < qcmatrixio.low > mqc_tmp1 -sed -e 's/wr_lrbuf/wrlrbuf8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lcbuf/wrlcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_lrind/wrlrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lao2e/wrlao2e8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/open_read/openread8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/open_write/openwrite8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_matf/closematf8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_2e1/rd2e18/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_2en/rd2en8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_cbuf/rdcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_head/rdhead8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_ibuf/rdibuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_labl/rdlabl8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_rbuf/rdrbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_rind/rdrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_skip/rdskip8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_2e/wr2e8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_cbuf/wrcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_head/wrhead8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_ibuf/wribuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_labl/wrlabl8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_rbuf/wrrbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_rind/wrrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expao1/expa18/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/expaon/expan8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aclear/aclea8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lenarr/lenar8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aoints/a8ints/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind2c/l8nd2c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind2/l8nd2/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind3c/l8nd3c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind3/l8nd3/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind4c/l8nd4c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind4/l8nd4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind5c/l8nd5c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind5/l8nd5/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/numnza/n8mnza/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/numnzr/n8mnzr/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/iclear/iclea8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/clean_label/clean_label8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_faf/closematf8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_expao/qcm_expao8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_maxinzr/qcm_maxinzr8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_chbuf/rd_chbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_chbufi/rd_chbufi8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_spa/rd_spa8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_spac/rd_spac8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_chbuf/wr_chbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_spa/wr_spa8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_numnzt/qcm_numnzt8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_numnztp/qcm_numnztp8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcmatrixio/qcmatrixi8/g' < mqc_tmp2 > qcmatrixio_8.F - -sed -e 's/wr_libuf/wrlibuf8/g' < qcmatrix.low > mqc_tmp1 -sed -e 's/wr_lrbuf/wrlrbuf8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lcbuf/wrlcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_lrind/wrlrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_lao2e/wrlao2e8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/open_read/openread8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/open_write/openwrite8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/close_matf/closematf8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_2e1/rd2e18/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_2en/rd2en8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_cbuf/rdcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_head/rdhead8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_ibuf/rdibuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_labl/rdlabl8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_rbuf/rdrbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/rd_rind/rdrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/rd_skip/rdskip8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_2e/wr2e8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_cbuf/wrcbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_head/wrhead8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_ibuf/wribuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_labl/wrlabl8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/wr_rbuf/wrrbuf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/wr_rind/wrrind8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expao1/expa18/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/expaon/expan8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aclear/aclea8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lenarr/lenar8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/aoints/a8ints/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind2c/l8nd2c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind2/l8nd2/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind3c/l8nd3c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind3/l8nd3/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind4c/l8nd4c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind4/l8nd4/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/lind5c/l8nd5c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/lind5/l8nd5/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/numnza/n8mnza/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/numnzr/n8mnzr/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/iclear/iclea8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/expd2e/expd2e8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/pr_spa/pr_spa8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/qcm_numnzt/qcm_numnzt8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcm_numnztp/qcm_numnztp8/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/close_faf/closematf8/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/qcmatrixio/qcmatrixi8/g' < mqc_tmp1 > qcmatrix_8.F - -rm -f mqc_tmp1 mqc_tmp2 -rm -f qcmatrixio.low qcmatrix.low diff --git a/.other_libs/gauopen/README b/.other_libs/gauopen/README index 9b898106..34e677f4 100644 --- a/.other_libs/gauopen/README +++ b/.other_libs/gauopen/README @@ -1 +1,2 @@ -This file contains things put in it by the Install script - gauopen sources, objects, data files +The installer stores the selected external GauOpen directory in the ignored +`default` file. GauOpen sources and objects are not copied into this directory. diff --git a/.other_libs/gauopen/To_lower b/.other_libs/gauopen/To_lower deleted file mode 100755 index 3fc60064..00000000 --- a/.other_libs/gauopen/To_lower +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash -x - -sed -e 's/wr_libuf/wr_libuf_4/g' < $1 > mqc_tmp1 -sed -e 's/A/a/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/B/b/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/C/c/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/D/d/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/E/e/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/F/f/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/G/g/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/H/h/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/I/i/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/J/j/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/K/k/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/L/l/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/M/m/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/N/n/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/O/o/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/P/p/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/Q/q/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/R/r/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/S/s/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/T/t/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/U/u/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/V/v/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/W/w/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/X/x/g' < mqc_tmp2 > mqc_tmp1 -sed -e 's/Y/y/g' < mqc_tmp1 > mqc_tmp2 -sed -e 's/Z/z/g' < mqc_tmp2 > mqc_tmp1 - - - diff --git a/.other_libs/build_fcns/Makefile.am_MatrixFile b/Makefile.am similarity index 99% rename from .other_libs/build_fcns/Makefile.am_MatrixFile rename to Makefile.am index c77ed903..3a1eb04b 100644 --- a/.other_libs/build_fcns/Makefile.am_MatrixFile +++ b/Makefile.am @@ -2,4 +2,3 @@ AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) AM_CPPFLAGS = $(MQC_CPPFLAGS) SUBDIRS = src examples/Build_Tests dist_doc_DATA = README.md - diff --git a/README.md b/README.md index 4907d71b..e35e258b 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ ** ** ** The Merced Quantum Chemistry Package ** ** (MQCPack) ** - ** Version 26.7.1 ** - ** July 13, 2026 ** + ** Version 26.7.2 ** + ** July 30, 2026 ** ** ** ** ** ** Written By: ** @@ -85,9 +85,45 @@ software is, your program will work without any modifications. ## Installing - To build: - 1. ./mqc_install - 1. {Answer questions} +The interactive installer remains available: + +```sh +./mqc_install +``` + +Enable MatrixFile support with the external GauOpen source directory and the +currently supported 8-byte integer ABI. The build compiles the unmodified +`qcmatrix.F` and `qcmatrixio.F` files directly with isolated legacy-source +flags. Configure identifies the supported public or frontier GauOpen API from +the selected sources: + +```sh +./configure --prefix=/path/to/install \ + --with-gauopen=/path/to/gauopen \ + --with-gauopen-integer-bytes=8 +make MQC_LAPACK="-llapack" MQC_BLAS="-lblas" +make check MQC_LAPACK="-llapack" MQC_BLAS="-lblas" +make install MQC_LAPACK="-llapack" MQC_BLAS="-lblas" +``` + +The default `--with-gauopen-api=auto` can be replaced by +`--with-gauopen-api=public` or `--with-gauopen-api=frontier` after verifying +the source interface. Public GauOpen supports numerical MatrixFile records but +does not provide character-record routines; MQCPack character FAF operations +therefore terminate with an explicit unsupported-feature diagnostic. Frontier +GauOpen provides the `TypeA` and character-buffer interface used for character +scalar and fixed-width-vector FAF records. To prevent positive `TypeA` records +from being silently treated as integers, the public profile also rejects +frontier version-3 FAF files. + +Use `--without-gauopen` for a FormChk-only configuration; that path does not +need the GauOpen sources and produces a library that can link and use +the `MQC_Gaussian` formatted-checkpoint interface. MatrixFile types remain +available at compile time for shared source compatibility, but a MatrixFile +operation reports that GauOpen support was not configured and terminates. +A Git checkout may need +`autoreconf --install` once to generate `configure`; release source archives +normally include generated Autotools files. # Licence This project is licensed under the Apache License - see the LICENSE file for details diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..a0c3625b --- /dev/null +++ b/configure.ac @@ -0,0 +1,180 @@ +AC_INIT([MQC_Pack], [26.7.2], [hhratchian@ucmerced.edu]) +AM_INIT_AUTOMAKE([foreign]) +AC_CONFIG_SRCDIR([src/mqc_general.F03]) + +AC_PROG_CPP +AC_PROG_CC([nvc pgcc gcc icc]) +AC_PROG_FC([pgfortran nvfortran gfortran ifort]) +AC_PROG_RANLIB +AC_PROG_GREP +AC_LANG([Fortran]) + +AC_ARG_WITH([gauopen], + [AS_HELP_STRING([--with-gauopen=DIR], + [enable MatrixFile support using GauOpen sources in DIR])], + [AS_CASE([$withval], + [no], [mqc_with_gauopen=no; MQC_GAUOPEN_DIR=], + [yes], [AC_MSG_ERROR([--with-gauopen requires a directory])], + [mqc_with_gauopen=yes; MQC_GAUOPEN_DIR=$withval])], + [mqc_with_gauopen=no; MQC_GAUOPEN_DIR=]) + +AC_ARG_WITH([gauopen-integer-bytes], + [AS_HELP_STRING([--with-gauopen-integer-bytes=BYTES], + [select the GauOpen integer ABI; currently only 8 is supported @<:@default=8@:>@])], + [MQC_GAUOPEN_INTEGER_BYTES=$withval], + [MQC_GAUOPEN_INTEGER_BYTES=8]) + +AC_ARG_WITH([gauopen-api], + [AS_HELP_STRING([--with-gauopen-api=API], + [select the GauOpen API family: auto, public, or frontier @<:@default=auto@:>@])], + [mqc_gauopen_api_request=$withval], + [mqc_gauopen_api_request=auto]) + +AS_CASE([$mqc_gauopen_api_request], + [auto|public|frontier], [], + [AC_MSG_ERROR([--with-gauopen-api must be auto, public, or frontier])]) + +AS_CASE([$MQC_GAUOPEN_INTEGER_BYTES], + [8], [], + [AC_MSG_ERROR([only the 8-byte GauOpen integer ABI is currently supported])]) + +AS_IF([test "x$mqc_with_gauopen" = xyes], [ + AS_IF([test ! -d "$MQC_GAUOPEN_DIR"], + [AC_MSG_ERROR([GauOpen directory not found: $MQC_GAUOPEN_DIR])]) + AS_IF([test ! -f "$MQC_GAUOPEN_DIR/qcmatrixio.F" || + test ! -f "$MQC_GAUOPEN_DIR/qcmatrix.F"], + [AC_MSG_ERROR([GauOpen directory must contain qcmatrixio.F and qcmatrix.F])]) +]) + +MQC_GAUOPEN_API=none +AS_IF([test "x$mqc_with_gauopen" = xyes], [ + mqc_gauopen_detected_api=unknown + mqc_gauopen_has_close_faf=no + mqc_gauopen_has_close_matf=no + mqc_gauopen_has_rd_chbuf=no + mqc_gauopen_has_wr_chbuf=no + mqc_gauopen_has_frontier_rind=no + mqc_gauopen_has_public_rind=no + + AS_IF([$GREP -F -i 'Subroutine Close_FAF' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_close_faf=yes]) + AS_IF([$GREP -F -i 'Subroutine Close_MatF' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_close_matf=yes]) + AS_IF([$GREP -F -i 'Subroutine Rd_ChBuf' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_rd_chbuf=yes]) + AS_IF([$GREP -F -i 'Subroutine Wr_ChBuf' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_wr_chbuf=yes]) + AS_IF([$GREP -F -i 'Rd_RInd(IU,NR,LR,NRLR' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_frontier_rind=yes]) + AS_IF([$GREP -F -i 'Rd_RInd(IU,NR,LR,NTot,LenBuf,LNZ' \ + "$MQC_GAUOPEN_DIR/qcmatrixio.F" >/dev/null 2>&1], + [mqc_gauopen_has_public_rind=yes]) + + AS_IF([test "x$mqc_gauopen_has_close_faf" = xyes && + test "x$mqc_gauopen_has_close_matf" = xno && + test "x$mqc_gauopen_has_rd_chbuf" = xyes && + test "x$mqc_gauopen_has_wr_chbuf" = xyes && + test "x$mqc_gauopen_has_frontier_rind" = xyes], + [mqc_gauopen_detected_api=frontier], + [AS_IF([test "x$mqc_gauopen_has_close_matf" = xyes && + test "x$mqc_gauopen_has_close_faf" = xno && + test "x$mqc_gauopen_has_rd_chbuf" = xno && + test "x$mqc_gauopen_has_wr_chbuf" = xno && + test "x$mqc_gauopen_has_public_rind" = xyes], + [mqc_gauopen_detected_api=public])]) + + AS_CASE([$mqc_gauopen_api_request], + [auto], [ + AS_IF([test "x$mqc_gauopen_detected_api" = xunknown], + [AC_MSG_ERROR([unable to identify the GauOpen API family in $MQC_GAUOPEN_DIR; use --with-gauopen-api only after verifying its procedure signatures])]) + MQC_GAUOPEN_API=$mqc_gauopen_detected_api + ], + [public|frontier], [ + AS_IF([test "x$mqc_gauopen_detected_api" != xunknown && + test "x$mqc_gauopen_detected_api" != "x$mqc_gauopen_api_request"], + [AC_MSG_ERROR([requested GauOpen API $mqc_gauopen_api_request conflicts with detected API $mqc_gauopen_detected_api])]) + AS_IF([test "x$mqc_gauopen_detected_api" = xunknown], + [AC_MSG_WARN([forcing unrecognized GauOpen sources to use the $mqc_gauopen_api_request API profile])]) + MQC_GAUOPEN_API=$mqc_gauopen_api_request + ]) +], [ + AS_IF([test "x$mqc_gauopen_api_request" != xauto], + [AC_MSG_ERROR([--with-gauopen-api requires --with-gauopen=DIR])]) +]) + +AM_CONDITIONAL([WITH_GAUOPEN], + [test "x$mqc_with_gauopen" = xyes]) +AM_CONDITIONAL([GAUOPEN_PUBLIC], + [test "x$MQC_GAUOPEN_API" = xpublic]) +AM_CONDITIONAL([GAUOPEN_FRONTIER], + [test "x$MQC_GAUOPEN_API" = xfrontier]) + +MQC_SPECIFIC_FCFLAGS= +MQC_GAUOPEN_FCFLAGS= +MQC_CPPFLAGS= +MQC_LDFLAGS= + +AS_CASE([$FC], + [*pgfortran*|*nvfortran*], [ + MQC_SPECIFIC_FCFLAGS="-r8 -i8 -Mallocatable=03 -module $PWD/src" + MQC_GAUOPEN_FCFLAGS="-r8 -i8 -DUSE_I8" + MQC_CPPFLAGS="-DPGI" + AS_IF([test "x$mqc_with_gauopen" = xyes], + [MQC_SPECIFIC_FCFLAGS="$MQC_SPECIFIC_FCFLAGS -mp"]) + ], + [*gfortran*], [ + MQC_SPECIFIC_FCFLAGS="-std=f2008 -fdefault-real-8 -fdefault-integer-8 -J$PWD/src" + MQC_GAUOPEN_FCFLAGS="-std=legacy -fallow-argument-mismatch -fdefault-real-8 -fdefault-integer-8 -DUSE_I8" + MQC_CPPFLAGS="-DGNU" + AS_IF([test "x$mqc_with_gauopen" = xyes], + [MQC_SPECIFIC_FCFLAGS="$MQC_SPECIFIC_FCFLAGS -fopenmp"]) + ], + [*ifort*], [ + MQC_SPECIFIC_FCFLAGS="-stand f03 -real-size 64 -integer-size 64 -module $PWD/src" + MQC_GAUOPEN_FCFLAGS="-real-size 64 -integer-size 64 -DUSE_I8" + MQC_CPPFLAGS="-DINTEL" + AS_IF([test "x$mqc_with_gauopen" = xyes], + [MQC_SPECIFIC_FCFLAGS="$MQC_SPECIFIC_FCFLAGS -openmp"]) + ], + [AC_MSG_ERROR([unsupported Fortran compiler: $FC])]) + +AS_IF([test "x$mqc_with_gauopen" = xyes], [ + MQC_CPPFLAGS="$MQC_CPPFLAGS -DMATRIXFILE" + AS_CASE([$MQC_GAUOPEN_API], + [public], + [MQC_CPPFLAGS="$MQC_CPPFLAGS -DMQC_GAUOPEN_API_PUBLIC"], + [frontier], + [MQC_CPPFLAGS="$MQC_CPPFLAGS -DMQC_GAUOPEN_API_FRONTIER"], + [AC_MSG_ERROR([internal error: no GauOpen API profile selected])]) + AC_CHECK_LIB([blas], [dswap], + [AC_MSG_NOTICE([using the detected BLAS/LAPACK link environment])], + [AS_CASE([$FC], + [*gfortran*], + [MQC_LDFLAGS="-lmkl_rt -Wl,--no-as-needed -lpthread -lm -ldl"], + [MQC_LDFLAGS="-lmkl_rt -lpthread -lm -ldl"])]) +], [ + MQC_CPPFLAGS="$MQC_CPPFLAGS -DFORMCHK" +]) + +AC_SUBST([MQC_SPECIFIC_FCFLAGS]) +AC_SUBST([MQC_GAUOPEN_FCFLAGS]) +AC_SUBST([MQC_CPPFLAGS]) +AC_SUBST([MQC_LDFLAGS]) +AC_SUBST([MQC_GAUOPEN_DIR]) +AC_SUBST([MQC_GAUOPEN_INTEGER_BYTES]) +AC_SUBST([MQC_GAUOPEN_API]) + +AC_MSG_NOTICE([GauOpen support: $mqc_with_gauopen]) +AS_IF([test "x$mqc_with_gauopen" = xyes], [ + AC_MSG_NOTICE([GauOpen source directory: $MQC_GAUOPEN_DIR]) + AC_MSG_NOTICE([GauOpen API family: $MQC_GAUOPEN_API]) + AC_MSG_NOTICE([GauOpen integer ABI: $MQC_GAUOPEN_INTEGER_BYTES bytes]) +]) + +AC_CONFIG_FILES([Makefile src/Makefile examples/Build_Tests/Makefile]) +AC_OUTPUT diff --git a/doc/AGENT_API_GUIDE.md b/doc/AGENT_API_GUIDE.md new file mode 100644 index 00000000..4443a342 --- /dev/null +++ b/doc/AGENT_API_GUIDE.md @@ -0,0 +1,223 @@ +# MQCPack agent API guide + +This guide is the starting point for agents and developers working in a +repository that consumes MQCPack. It explains where the supported abstractions +live, which source files define them, and which scientific and binary-format +conventions must be preserved. + +The source remains authoritative. This guide supplies navigation and semantics; +it does not replace checking the exact declaration used by the MQCPack version +or Git commit on which a downstream repository depends. + +## Before reading or changing dependent code + +1. Resolve the MQCPack source root. In many local environments it is available + as `$mqcroot`; do not assume that variable exists everywhere. +2. Record the MQCPack version and, when reproducibility matters, the Git commit. + `MQC_General` provides `mqc_version`, `mqc_version_check`, and + `mqc_version_print`; the source commit distinguishes worktrees with the same + released version. +3. Read the relevant curated page below, then inspect the exact type, generic + interface, and implementation in `src/`. +4. Compile against `.mod`, object, GauOpen, and library files produced by one + compiler family and compatible flags. Never mix GNU, Intel, and NVidia + Fortran artifacts. +5. Preserve units, basis, rank, storage, spin-block ordering, record labels, and + integer precision as API data—not incidental implementation details. + +## Where to start + +| Downstream task | Read first | Source authority | +| --- | --- | --- | +| Constants, errors, printing, conversions, packed arrays, BLAS/LAPACK wrappers | [General utilities](api/general.md) | `src/mqc_general.F03`, `src/mqc_general_lapack.F03` | +| Scalars, vectors, matrices, rank-4 tensors, operators, eigensystems, SVD | [Algebra objects](api/algebra.md) | `src/mqc_algebra.F03` | +| Rank-changing numerical or character values | [MQC_Variable](api/algebra2.md) | `src/mqc_algebra2.F03` | +| SCF/post-SCF intermediates, spin blocks, determinants, two-electron integrals | [Electronic-structure objects](api/est.md) | `src/mqc_est.F03` | +| FChk or FAF/MatrixFile reading and writing | [Gaussian interfaces](api/gaussian.md) | `src/mqc_gaussian.F03`, `src/mqc_matwrapper_direct.F03` | +| Text files, linked lists, basis functions, molecule data, C interoperability | [Supporting modules](api/files-and-integrals.md) | corresponding files under `src/` | +| Find an exact declaration or type-bound implementation | [Generated procedure index](api/PROCEDURE_INDEX.md) | all principal `src/*.F03` files and `src/mqc_util.c` | + +## Layering and dependency direction + +The intended direction is: + +```text +MQC_General + ├─ MQC_Binary / MQC_DataStructures / MQC_Files / MQC_Integrals + ├─ MQC_Algebra + │ ├─ MQC_Algebra2 + │ ├─ MQC_Molecule + │ └─ MQC_EST + └─ MQC_MatWrapper + └─ MQC_Gaussian + └─ downstream programs and higher-level wavefunction handling +``` + +Reusable operations on intrinsic Fortran values belong in `MQC_General`. +Algebra modules validate object state, dispatch on type/rank/storage, and then +delegate where appropriate. Gaussian word counts, `TypeA`, `Len4L`, record +labels, and GauOpen semantics stay at the MatrixFile boundary. + +## What counts as the public API + +Prefer, in order: + +- documented derived types and their public type-bound procedures; +- generic interfaces such as `mqc_print`, `MatMul`, `Allocated`, `MQC`, and + overloaded intrinsic or operator names; +- named module procedures that are explicitly used by examples or documented + as entry points. + +Many modules do not set a module-wide `private` default. Consequently, some +implementation routines are technically accessible through `use` association. +That does not make every such routine a stable downstream contract. Avoid a +specific implementation name when a generic or type-bound entry point exists. + +The generated procedure index is deliberately called an inventory. It helps an +agent locate code, but does not upgrade internal routines into supported API. + +## Scientific invariants + +Before calling or changing MQCPack code, identify all applicable invariants: + +- numerical kind: new interfaces should use `int32`, `int64`, and `real64` + explicitly; +- units: especially Hartree versus eV, length units, and Gaussian Cartesian + coordinates; +- basis: AO, MO, spin orbital, or generalized spin; +- spin blocks: alpha, beta, alpha-beta, and beta-alpha are distinct; +- storage: full, symmetric, diagonal, Hermitian, antisymmetric, packed, or + specialized MatrixFile storage; +- shape and rank: do not infer them only from element count; +- file labels: FChk and FAF labels are compatibility keys; +- numerical thresholds: use `mqc_small` for zero/threshold decisions; +- resource ownership: an open file unit is connection state, not ordinary + copyable metadata. + +## Common downstream patterns + +### Algebra objects + +```fortran +program matrix_example + use iso_fortran_env, only: int64 + use MQC_Algebra + implicit none + + type(MQC_Matrix) :: overlapAO + + call overlapAO%identity(3_int64,3_int64) + call overlapAO%print(6_int64,'AO overlap matrix') +end program matrix_example +``` + +Check the exact overload before supplying optional arguments; many established +interfaces also accept intrinsic integer, real, complex, or MQCPack scalar +values. + +### MatrixFile character data + +```fortran +program read_faf_title + use MQC_Algebra2 + use MQC_Gaussian + implicit none + + type(MQC_Gaussian_Unformatted_Matrix_File) :: faf + type(MQC_Variable) :: title + + call faf%load('input.faf') + call faf%getArray('TITLE',mqcVarOut=title) + call mqc_print(title,header='TITLE') + call faf%closeFile() +end program read_faf_title +``` + +MatrixFile support must be present in the configured MQCPack build. Preserve +the exact record label and verify binary-format changes with both the public API +and an independent Gaussian-aware reader such as `dumpbaf` when available. +Character FAF operations additionally require the frontier GauOpen API +profile. A public GauOpen build supports numerical MatrixFile records but +reports character FAF operations as unsupported. It rejects frontier +version-3 FAF files because its legacy label interface cannot distinguish a +positive character `TypeA` from ordinary integer metadata safely. + +## Build and ABI compatibility + +MQCPack's Fortran `.mod` files and objects are compiler-specific. Default +integer/real promotion flags are also part of the effective ABI. A dependent +repository should record at least: + +- MQCPack version and preferably source commit; +- compiler family and version; +- `--without-gauopen` or the exact `--with-gauopen=DIR` configuration; +- detected or selected GauOpen API profile: `public` or `frontier`; +- GauOpen integer ABI, currently `--with-gauopen-integer-bytes=8`; +- integer/real-size and OpenMP flags; +- BLAS/LAPACK link line; +- installation prefix providing the matching `libmqc.a` and `.mod` files. + +`make install` places `libmqc.a` under `${prefix}/lib` and the matching +compiler-generated module files under `${prefix}/mod`. Use a separate prefix +for each compiler family and configuration; never replace installed module +files with artifacts from another build. + +Changing a public derived type changes its compiled module layout. Rebuild all +dependent objects after such a change; a stale object can compile cleanly and +then fail at runtime. + +MQCPack has one tracked Autotools configuration. MatrixFile builds are selected +with `--with-gauopen=DIR`; FormChk-only builds use `--without-gauopen`. Do not +select a build variant by replacing or symlinking `configure.ac` or +`Makefile.am` files. + +MatrixFile builds compile the external, unmodified GauOpen `qcmatrix.F` and +`qcmatrixio.F` sources directly. Dependency-only legacy flags are kept +separate from MQCPack's Fortran flags. The supported GauOpen integer ABI is +currently selected at configure time and limited to 8 bytes; one installed +library does not dispatch between 4-byte and 8-byte MatrixFiles at runtime. +Configure normally detects the API family from procedure capabilities: +`Close_MatF` and the older indexed-reader signature select the public profile; +`Close_FAF`, the newer indexed-reader signature, and character-buffer routines +select the frontier profile. Use `--with-gauopen-api=public` or `frontier` only +as an explicit override for a source tree whose interface has been verified. +Treat `MQC_MatWrapper` as an internal real/stub backend boundary. Downstream +code should use `MQC_Gaussian`; the wrapper's low-level adapter procedures are +not a supported compatibility API. + +In a FormChk-only build, `MQC_Gaussian` and its formatted-checkpoint API remain +linkable. The MatrixFile type remains declared for compile-time source +compatibility, but MatrixFile operations terminate with a clear unsupported- +feature diagnostic. Record the configuration explicitly instead of testing +MatrixFile availability by calling an operation. + +## Guidance to place in a dependent repository + +```text +MQCPack source is available at $mqcroot. + +Before changing MQCPack-dependent code, read: + $mqcroot/doc/AGENT_API_GUIDE.md + +Use its module guide to locate the relevant interface, then inspect the exact +declaration under $mqcroot/src. Preserve units, basis, rank, storage format, +spin-block ordering, Gaussian labels, and compiler compatibility. Record the +MQCPack version or Git commit used by this repository. +``` + +If the dependent project pins a particular installation or commit, replace the +generic `$mqcroot` language with that exact path and revision. + +## Maintaining this documentation + +Update a curated page whenever a public type, generic, scientific convention, +file layout, or recommended use changes. Regenerate the inventory after source +procedure, interface, type, or type-bound binding changes: + +```sh +python3 doc/api/generate_procedure_index.py +python3 doc/api/generate_procedure_index.py --check +``` + +The first command updates the file; the second is suitable for a consistency +check. The scanner has no third-party dependencies. diff --git a/doc/api/PROCEDURE_INDEX.md b/doc/api/PROCEDURE_INDEX.md new file mode 100644 index 00000000..942b4d89 --- /dev/null +++ b/doc/api/PROCEDURE_INDEX.md @@ -0,0 +1,1575 @@ +# MQCPack source procedure index + +> Generated by `python3 doc/api/generate_procedure_index.py`. Do not edit by hand. + +This is a source inventory, not a stability guarantee. Prefer the interfaces +described in [AGENT_API_GUIDE.md](../AGENT_API_GUIDE.md) and the curated API +pages. Many MQCPack modules do not declare a module-wide `private` default, so +a technically accessible implementation routine is not automatically a supported +downstream interface. + +The current inventory contains 878 Fortran/C procedure definitions +and 259 type-bound procedure or generic bindings. + +The scanner recognizes free-form Fortran declarations and ordinary C function +definitions. Conditional compilation can change which entries are built, and +generic overload membership must still be checked in the source interface block. + +## `src/mqc_general.F03` + +### Modules + +- `MQC_General` ([source](../../src/mqc_general.F03#L1)) + +### Generic and defined interfaces + +- `mqc_print` ([source](../../src/mqc_general.F03#L84)) +- `mqc_print_scalar` ([source](../../src/mqc_general.F03#L102)) +- `mqc_print_vector` ([source](../../src/mqc_general.F03#L109)) +- `mqc_print_matrix` ([source](../../src/mqc_general.F03#L116)) +- `mqc_print_r4tensor` ([source](../../src/mqc_general.F03#L123)) +- `mqc_packedDiagonalMatrix2FullMatrix` ([source](../../src/mqc_general.F03#L129)) +- `mqc_matrixSymm2Full` ([source](../../src/mqc_general.F03#L134)) +- `num2char` ([source](../../src/mqc_general.F03#L139)) +- `mqc_adjustl` ([source](../../src/mqc_general.F03#L145)) +- `mqc_adjustr` ([source](../../src/mqc_general.F03#L150)) +- `mqc_len_trim` ([source](../../src/mqc_general.F03#L155)) +- `mqc_trim` ([source](../../src/mqc_general.F03#L160)) +- `sort` ([source](../../src/mqc_general.F03#L164)) +- `matrixOrderedColumns` ([source](../../src/mqc_general.F03#L169)) +- `flatten` ([source](../../src/mqc_general.F03#L174)) +- `contraction` ([source](../../src/mqc_general.F03#L179)) +- `mqc_dgesv` ([source](../../src/mqc_general.F03#L185)) + +### Procedure definitions + +- `mqc_version` — `subroutine` ([source](../../src/mqc_general.F03#L203)) +- `mqc_version_check` — `function` ([source](../../src/mqc_general.F03#L225)) +- `mqc_version_print` — `subroutine` ([source](../../src/mqc_general.F03#L317)) +- `mqc_error` — `Subroutine` ([source](../../src/mqc_general.F03#L342)) +- `mqc_error_i` — `subroutine` ([source](../../src/mqc_general.F03#L371)) +- `mqc_error_r` — `subroutine` ([source](../../src/mqc_general.F03#L436)) +- `mqc_error_l` — `subroutine` ([source](../../src/mqc_general.F03#L502)) +- `mqc_error_A` — `subroutine` ([source](../../src/mqc_general.F03#L594)) +- `mqc_get_command_argument` — `Subroutine` ([source](../../src/mqc_general.F03#L660)) +- `mqc_get_command_argument_integer` — `Subroutine` ([source](../../src/mqc_general.F03#L685)) +- `mqc_get_command_argument_real` — `Subroutine` ([source](../../src/mqc_general.F03#L710)) +- `MQC_Print_Scalar_Character` — `subroutine` ([source](../../src/mqc_general.F03#L743)) +- `MQC_Print_Scalar_Integer` — `Subroutine` ([source](../../src/mqc_general.F03#L785)) +- `MQC_Print_Scalar_Real` — `Subroutine` ([source](../../src/mqc_general.F03#L828)) +- `MQC_Print_Scalar_Complex` — `Subroutine` ([source](../../src/mqc_general.F03#L870)) +- `MQC_Print_Rank4Tensor_Array_Real` — `Subroutine` ([source](../../src/mqc_general.F03#L911)) +- `MQC_Print_Matrix_Array_Integer` — `Subroutine` ([source](../../src/mqc_general.F03#L959)) +- `MQC_Print_Matrix_Array_Real` — `Subroutine` ([source](../../src/mqc_general.F03#L1014)) +- `MQC_Print_Matrix_Array_Complex` — `Subroutine` ([source](../../src/mqc_general.F03#L1075)) +- `MQC_Print_Matrix_Array_Logical` — `Subroutine` ([source](../../src/mqc_general.F03#L1128)) +- `MQC_Print_Vector_Array_Character` — `subroutine` ([source](../../src/mqc_general.F03#L1182)) +- `MQC_Print_Vector_Array_Integer` — `subroutine` ([source](../../src/mqc_general.F03#L1222)) +- `MQC_Print_Vector_Array_Real` — `Subroutine` ([source](../../src/mqc_general.F03#L1268)) +- `MQC_Print_Vector_Array_Complex` — `Subroutine` ([source](../../src/mqc_general.F03#L1320)) +- `MQC_Print_Vector_Array_Logical` — `subroutine` ([source](../../src/mqc_general.F03#L1365)) +- `MQC_Print_R4Tensor_Array_Integer` — `Subroutine` ([source](../../src/mqc_general.F03#L1405)) +- `MQC_Print_R4Tensor_Array_Real` — `Subroutine` ([source](../../src/mqc_general.F03#L1453)) +- `MQC_Print_R4Tensor_Array_Complex` — `Subroutine` ([source](../../src/mqc_general.F03#L1501)) +- `mqc_adjustl_character_scalar` — `function` ([source](../../src/mqc_general.F03#L1556)) +- `mqc_adjustl_character_vector` — `function` ([source](../../src/mqc_general.F03#L1577)) +- `mqc_adjustr_character_scalar` — `function` ([source](../../src/mqc_general.F03#L1602)) +- `mqc_adjustr_character_vector` — `function` ([source](../../src/mqc_general.F03#L1623)) +- `mqc_len_trim_character_scalar` — `function` ([source](../../src/mqc_general.F03#L1648)) +- `mqc_len_trim_character_vector` — `function` ([source](../../src/mqc_general.F03#L1669)) +- `mqc_trim_character_scalar` — `function` ([source](../../src/mqc_general.F03#L1690)) +- `String_Change_Case` — `Subroutine` ([source](../../src/mqc_general.F03#L1710)) +- `integer2character` — `function` ([source](../../src/mqc_general.F03#L1773)) +- `real2character` — `function` ([source](../../src/mqc_general.F03#L1800)) +- `complex2character` — `function` ([source](../../src/mqc_general.F03#L1829)) +- `Build_String_Add_Int` — `Subroutine` ([source](../../src/mqc_general.F03#L1857)) +- `mqc_float` — `function` ([source](../../src/mqc_general.F03#L1904)) +- `mqc_normalizeVector` — `Subroutine` ([source](../../src/mqc_general.F03#L1928)) +- `mqc_vectorTrimZero` — `Subroutine` ([source](../../src/mqc_general.F03#L1957)) +- `mqc_vectorPhase` — `Subroutine` ([source](../../src/mqc_general.F03#L2017)) +- `mqc_crossProduct3D_real` — `function` ([source](../../src/mqc_general.F03#L2077)) +- `mqc_outerProduct_real` — `Function` ([source](../../src/mqc_general.F03#L2108)) +- `mqc_matrixTrimZero` — `Subroutine` ([source](../../src/mqc_general.F03#L2151)) +- `mqc_contraction_full_real` — `function` ([source](../../src/mqc_general.F03#L2216)) +- `mqc_packedSymmetricMatrix2FullMatrix_integer` — `Subroutine` ([source](../../src/mqc_general.F03#L2246)) +- `mqc_packedSymmetricMatrix2FullMatrix_real` — `Subroutine` ([source](../../src/mqc_general.F03#L2324)) +- `mqc_matrixSymm2Full_integer` — `function` ([source](../../src/mqc_general.F03#L2402)) +- `mqc_matrixSymm2Full_real` — `function` ([source](../../src/mqc_general.F03#L2444)) +- `mqc_packedDiagonalMatrix2FullMatrix_integer` — `Subroutine` ([source](../../src/mqc_general.F03#L2486)) +- `mqc_packedDiagonalMatrix2FullMatrix_real` — `subroutine` ([source](../../src/mqc_general.F03#L2521)) +- `mqc_packedSymmetricSymmetricR4Tensor2Full_real` — `subroutine` ([source](../../src/mqc_general.F03#L2555)) +- `mqc_FullMatrix2packedSymmetricMatrix_real` — `subroutine` ([source](../../src/mqc_general.F03#L2622)) +- `mqc_matrixFull2Symm_real` — `function` ([source](../../src/mqc_general.F03#L2699)) +- `mqc_matrixTrace` — `function` ([source](../../src/mqc_general.F03#L2739)) +- `mqc_diagMatrixTimesFullMatrix` — `subroutine` ([source](../../src/mqc_general.F03#L2766)) +- `mqc_matrixInverse_symmFull` — `subroutine` ([source](../../src/mqc_general.F03#L2814)) +- `MQC_leastSquaresFit` — `subroutine` ([source](../../src/mqc_general.F03#L2888)) +- `mqc_bubbleSort_integer` — `subroutine` ([source](../../src/mqc_general.F03#L2935)) +- `mqc_bubbleSort_real` — `subroutine` ([source](../../src/mqc_general.F03#L3008)) +- `mqc_matrixOrderedColumns_integer` — `subroutine` ([source](../../src/mqc_general.F03#L3085)) +- `mqc_matrixOrderedColumns_real` — `subroutine` ([source](../../src/mqc_general.F03#L3122)) +- `mqc_flattenR4Real` — `function` ([source](../../src/mqc_general.F03#L3159)) +- `mqc_isqrt` — `function` ([source](../../src/mqc_general.F03#L3183)) +- `mqc_factorial` — `function` ([source](../../src/mqc_general.F03#L3206)) +- `mqc_doubleFactorial` — `function` ([source](../../src/mqc_general.F03#L3232)) +- `mqc_seq` — `subroutine` ([source](../../src/mqc_general.F03#L3263)) +- `mqc_sphericalPolar2xyz` — `subroutine` ([source](../../src/mqc_general.F03#L3296)) + +## `src/mqc_general_lapack.F03` + +### Procedure definitions + +- `mqc_dsyev_eigensystem_symmFull` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L43)) +- `mqc_dgeev_eigensystem_Full` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L119)) +- `mqc_dsyevr_eigensystem_symmFull` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L245)) +- `mqc_dgesvd_svd_Full` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L352)) +- `mqc_dgesv_mat` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L455)) +- `mqc_dgesv_vec` — `subroutine` ([source](../../src/mqc_general_lapack.F03#L527)) + +## `src/mqc_binary.F03` + +### Modules + +- `MQC_Binary` ([source](../../src/mqc_binary.F03#L1)) + +### Derived types + +- `mqc_bits` ([source](../../src/mqc_binary.F03#L45)) + +### Type-bound bindings + +- `mqc_bits%print` — `mqc_bits_print` ([source](../../src/mqc_binary.F03#L50)) + +### Generic and defined interfaces + +- `mqc_print` ([source](../../src/mqc_binary.F03#L62)) +- `mqc_bits` ([source](../../src/mqc_binary.F03#L67)) +- `btest` ([source](../../src/mqc_binary.F03#L72)) +- `ibset` ([source](../../src/mqc_binary.F03#L77)) +- `ibclr` ([source](../../src/mqc_binary.F03#L82)) +- `iand` ([source](../../src/mqc_binary.F03#L87)) +- `ieor` ([source](../../src/mqc_binary.F03#L92)) +- `ior` ([source](../../src/mqc_binary.F03#L97)) +- `popcnt` ([source](../../src/mqc_binary.F03#L102)) +- `mvBits` ([source](../../src/mqc_binary.F03#L107)) +- `iBits` ([source](../../src/mqc_binary.F03#L112)) +- `iShft` ([source](../../src/mqc_binary.F03#L117)) + +### Procedure definitions + +- `MQC_Bits_Initialize` — `function` ([source](../../src/mqc_binary.F03#L132)) +- `MQC_Bits_Print` — `subroutine` ([source](../../src/mqc_binary.F03#L176)) +- `MQC_BitPosition` — `subroutine` ([source](../../src/mqc_binary.F03#L270)) +- `MQC_BTest` — `function` ([source](../../src/mqc_binary.F03#L297)) +- `MQC_IBitSet` — `function` ([source](../../src/mqc_binary.F03#L326)) +- `MQC_IBitClr` — `function` ([source](../../src/mqc_binary.F03#L352)) +- `MQC_IAnd` — `function` ([source](../../src/mqc_binary.F03#L378)) +- `MQC_IEOR` — `function` ([source](../../src/mqc_binary.F03#L411)) +- `MQC_IOR` — `function` ([source](../../src/mqc_binary.F03#L444)) +- `MQC_PopCnt` — `function` ([source](../../src/mqc_binary.F03#L477)) +- `MQC_MvBits` — `subroutine` ([source](../../src/mqc_binary.F03#L504)) +- `MQC_iBits` — `function` ([source](../../src/mqc_binary.F03#L544)) +- `MQC_iShft` — `function` ([source](../../src/mqc_binary.F03#L573)) +- `MQC_concatenate_bits` — `function` ([source](../../src/mqc_binary.F03#L602)) + +## `src/mqc_datastructures.F03` + +### Modules + +- `MQC_DataStructures` ([source](../../src/mqc_datastructures.F03#L1)) + +### Derived types + +- `MQC_LinkedList` ([source](../../src/mqc_datastructures.F03#L38)) + +### Generic and defined interfaces + +- `LinkedList_Return_Value` ([source](../../src/mqc_datastructures.F03#L45)) + +### Procedure definitions + +- `LinkedList_Return_Integer_Value` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L56)) +- `LinkedList_Return_Real_Value` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L87)) +- `LinkedList_Return_Character_Value` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L118)) +- `LinkedList_Return_Binary_Value` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L150)) +- `LinkedList_Print_Node` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L181)) +- `LinkedList_Print` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L213)) +- `LinkedList_Insert_Node` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L255)) +- `LinkedList_Push` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L311)) +- `LinkedList_UnShift` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L348)) +- `LinkedList_GoToBeginning` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L380)) +- `LinkedList_GoToEnd` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L398)) +- `LinkedList_GetNext` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L416)) +- `LinkedList_GetPrevious` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L457)) +- `LinkedList_IsPreviousAssociated` — `Function` ([source](../../src/mqc_datastructures.F03#L498)) +- `LinkedList_IsNextAssociated` — `Function` ([source](../../src/mqc_datastructures.F03#L515)) +- `LinkedList_Delete_Node` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L532)) +- `LinkedList_Delete_Branch` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L581)) +- `LinkedList_Delete` — `Subroutine` ([source](../../src/mqc_datastructures.F03#L633)) + +## `src/mqc_files.F03` + +### Modules + +- `MQC_Files` ([source](../../src/mqc_files.F03#L1)) + +### Derived types + +- `MQC_FileInfo` ([source](../../src/mqc_files.F03#L39)) +- `MQC_Text_FileInfo` ([source](../../src/mqc_files.F03#L48)) + +### Type-bound bindings + +- `MQC_FileInfo%IsOpen` — `MQC_File_IsOpen` ([source](../../src/mqc_files.F03#L44)) +- `MQC_Text_FileInfo%OpenFile` — `MQC_Open_Text_File` ([source](../../src/mqc_files.F03#L56)) +- `MQC_Text_FileInfo%CloseFile` — `MQC_Close_Text_File` ([source](../../src/mqc_files.F03#L57)) +- `MQC_Text_FileInfo%Rewind` — `MQC_Rewind_Text_File` ([source](../../src/mqc_files.F03#L58)) +- `MQC_Text_FileInfo%LoadBuffer` — `MQC_Files_Load_Buffer` ([source](../../src/mqc_files.F03#L59)) +- `MQC_Text_FileInfo%GetBuffer` — `MQC_Files_Text_File_Get_Buffer` ([source](../../src/mqc_files.F03#L60)) +- `MQC_Text_FileInfo%GetNextString` — `MQC_Files_Text_File_Read_String` ([source](../../src/mqc_files.F03#L61)) +- `MQC_Text_FileInfo%GetNextInteger` — `MQC_Files_Text_File_Read_Int` ([source](../../src/mqc_files.F03#L62)) +- `MQC_Text_FileInfo%WriteLine` — `MQC_Files_Text_File_Write_Line` ([source](../../src/mqc_files.F03#L63)) + +### Procedure definitions + +- `MQC_getUnitNumber` — `function` ([source](../../src/mqc_files.F03#L81)) +- `MQC_init_unitNumbersOpened` — `subroutine` ([source](../../src/mqc_files.F03#L121)) +- `MQC_setOn_unitNumbersOpened` — `subroutine` ([source](../../src/mqc_files.F03#L144)) +- `MQC_setOff_unitNumbersOpened` — `subroutine` ([source](../../src/mqc_files.F03#L173)) +- `MQC_get_unitNumbersOpened` — `function` ([source](../../src/mqc_files.F03#L195)) +- `MQC_File_IsOpen` — `Function` ([source](../../src/mqc_files.F03#L218)) +- `MQC_Open_Text_File` — `Subroutine` ([source](../../src/mqc_files.F03#L240)) +- `MQC_Close_Text_File` — `Subroutine` ([source](../../src/mqc_files.F03#L306)) +- `MQC_Rewind_Text_File` — `Subroutine` ([source](../../src/mqc_files.F03#L336)) +- `MQC_Files_Text_Parse_Set_Delimiters` — `Subroutine` ([source](../../src/mqc_files.F03#L361)) +- `MQC_Files_Text_Parse_Controls` — `Subroutine` ([source](../../src/mqc_files.F03#L390)) +- `MQC_Files_Text_File_Get_Buffer` — `Subroutine` ([source](../../src/mqc_files.F03#L417)) +- `MQC_Files_Text_File_Read_Int` — `Subroutine` ([source](../../src/mqc_files.F03#L456)) +- `MQC_Files_Text_File_Read_Int_Vec` — `Subroutine` ([source](../../src/mqc_files.F03#L498)) +- `MQC_Files_Text_File_Read_Real` — `Subroutine` ([source](../../src/mqc_files.F03#L551)) +- `MQC_Files_Text_File_Read_Real_Vec` — `Subroutine` ([source](../../src/mqc_files.F03#L585)) +- `MQC_Files_Text_File_Read_String` — `Subroutine` ([source](../../src/mqc_files.F03#L638)) +- `MQC_Files_Text_File_Read_Next` — `Subroutine` ([source](../../src/mqc_files.F03#L673)) +- `MQC_Files_Next_String` — `Subroutine` ([source](../../src/mqc_files.F03#L738)) +- `MQC_Files_Char_Type` — `Subroutine` ([source](../../src/mqc_files.F03#L808)) +- `MQC_Files_Load_Buffer` — `Function` ([source](../../src/mqc_files.F03#L942)) +- `MQC_Files_Delimiter_Test` — `Function` ([source](../../src/mqc_files.F03#L1019)) +- `MQC_Files_Next_Delimiter` — `Function` ([source](../../src/mqc_files.F03#L1070)) +- `MQC_Files_Next_NonDelimiter` — `Function` ([source](../../src/mqc_files.F03#L1109)) +- `MQC_Files_FF_Search` — `Subroutine` ([source](../../src/mqc_files.F03#L1148)) +- `MQC_Files_Text_File_Write_Line` — `Subroutine` ([source](../../src/mqc_files.F03#L1242)) + +## `src/mqc_integrals.F03` + +### Modules + +- `MQC_Integrals` ([source](../../src/mqc_integrals.F03#L1)) + +### Derived types + +- `MQC_CGTF` ([source](../../src/mqc_integrals.F03#L52)) +- `MQC_basisSet` ([source](../../src/mqc_integrals.F03#L72)) + +### Type-bound bindings + +- `MQC_CGTF%init` — `MQC_CGTF_init` ([source](../../src/mqc_integrals.F03#L62)) +- `MQC_CGTF%print` — `MQC_CGTF_print` ([source](../../src/mqc_integrals.F03#L63)) +- `MQC_CGTF%shell2nBasis` — `MQC_CGTF_nBasisFunctions` ([source](../../src/mqc_integrals.F03#L64)) +- `MQC_CGTF%primitiveSelfOverlap` — `MQC_CGTF_primitiveSelfOverlap` ([source](../../src/mqc_integrals.F03#L65)) +- `MQC_basisSet%init` — `MQC_basisSet_init` ([source](../../src/mqc_integrals.F03#L77)) +- `MQC_basisSet%print` — `MQC_basisSet_print` ([source](../../src/mqc_integrals.F03#L78)) +- `MQC_basisSet%addShell` — `MQC_basisSet_addShell` ([source](../../src/mqc_integrals.F03#L79)) + +### Procedure definitions + +- `MQC_CGTF_init` — `subroutine` ([source](../../src/mqc_integrals.F03#L93)) +- `MQC_CGTF_print` — `subroutine` ([source](../../src/mqc_integrals.F03#L163)) +- `MQC_basisSet_init` — `subroutine` ([source](../../src/mqc_integrals.F03#L189)) +- `MQC_basisSet_addShell` — `subroutine` ([source](../../src/mqc_integrals.F03#L225)) +- `MQC_basisSet_print` — `subroutine` ([source](../../src/mqc_integrals.F03#L263)) +- `MQC_Integrals_SetDEBUG` — `subroutine` ([source](../../src/mqc_integrals.F03#L284)) +- `basisSetValuesList` — `function` ([source](../../src/mqc_integrals.F03#L307)) +- `basisSetValuesList1` — `subroutine` ([source](../../src/mqc_integrals.F03#L339)) +- `basisSetOverlapMatrix` — `function` ([source](../../src/mqc_integrals.F03#L372)) +- `LinkedList_Return_CGTF_Value` — `subroutine` ([source](../../src/mqc_integrals.F03#L410)) +- `MQC_CGTF_nBasisFunctions` — `function` ([source](../../src/mqc_integrals.F03#L439)) +- `MQC_CGTF_extendLArray` — `function` ([source](../../src/mqc_integrals.F03#L455)) +- `MQC_CGTF_primitiveSelfOverlap` — `function` ([source](../../src/mqc_integrals.F03#L585)) +- `MQC_Overlap_Distribution_Primitive_XYZ_Constants` — `subroutine` ([source](../../src/mqc_integrals.F03#L628)) +- `MQC_Value_CGFT` — `subroutine` ([source](../../src/mqc_integrals.F03#L659)) +- `MQC_Value_Primitive_Radial` — `function` ([source](../../src/mqc_integrals.F03#L712)) +- `MQC_Value_Primitive_Angular` — `function` ([source](../../src/mqc_integrals.F03#L735)) +- `MQC_Overlap_CGFT` — `subroutine` ([source](../../src/mqc_integrals.F03#L759)) +- `MQC_Overlap_Primitive_XYZ_OS` — `subroutine` ([source](../../src/mqc_integrals.F03#L877)) + +## `src/mqc_algebra.F03` + +### Modules + +- `MQC_Algebra` ([source](../../src/mqc_algebra.F03#L34)) + +### Derived types + +- `MQC_Scalar` ([source](../../src/mqc_algebra.F03#L76)) +- `MQC_Vector` ([source](../../src/mqc_algebra.F03#L107)) +- `MQC_Matrix` ([source](../../src/mqc_algebra.F03#L195)) +- `MQC_R4Tensor` ([source](../../src/mqc_algebra.F03#L279)) + +### Type-bound bindings + +- `MQC_Scalar%print` — `MQC_Print_Scalar_Algebra1` ([source](../../src/mqc_algebra.F03#L83)) +- `MQC_Scalar%rval` — `MQC_Scalar_Get_Intrinsic_Real` ([source](../../src/mqc_algebra.F03#L85)) +- `MQC_Scalar%ival` — `MQC_Scalar_Get_Intrinsic_Integer` ([source](../../src/mqc_algebra.F03#L87)) +- `MQC_Scalar%cval` — `MQC_Scalar_Get_Intrinsic_Complex` ([source](../../src/mqc_algebra.F03#L89)) +- `MQC_Scalar%abs` — `MQC_Scalar_Get_ABS_Value` ([source](../../src/mqc_algebra.F03#L91)) +- `MQC_Scalar%phase` — `MQC_Scalar_Get_Phase` ([source](../../src/mqc_algebra.F03#L93)) +- `MQC_Scalar%sqrt` — `MQC_Scalar_Sqrt` ([source](../../src/mqc_algebra.F03#L95)) +- `MQC_Scalar%exp` — `MQC_Scalar_Exp` ([source](../../src/mqc_algebra.F03#L97)) +- `MQC_Scalar%log` — `MQC_Scalar_Log` ([source](../../src/mqc_algebra.F03#L99)) +- `MQC_Scalar%random` — `MQC_Scalar_Get_Random_Value` ([source](../../src/mqc_algebra.F03#L101)) +- `MQC_Vector%print` — `MQC_Print_Vector_Algebra1` ([source](../../src/mqc_algebra.F03#L116)) +- `MQC_Vector%size` — `MQC_Length_Vector` ([source](../../src/mqc_algebra.F03#L118)) +- `MQC_Vector%init` — `MQC_Vector_Initialize` ([source](../../src/mqc_algebra.F03#L120)) +- `MQC_Vector%set` — `MQC_Vector_Set` ([source](../../src/mqc_algebra.F03#L122)) +- `MQC_Vector%norm` — `MQC_Vector_Norm` ([source](../../src/mqc_algebra.F03#L124)) +- `MQC_Vector%transpose` — `MQC_Vector_Transpose` ([source](../../src/mqc_algebra.F03#L126)) +- `MQC_Vector%dagger` — `MQC_Vector_Conjugate_Transpose` ([source](../../src/mqc_algebra.F03#L128)) +- `MQC_Vector%at_sca` — `MQC_Vector_Scalar_At_Scalar` ([source](../../src/mqc_algebra.F03#L129)) +- `MQC_Vector%at_int` — `MQC_Vector_Scalar_At_Int` ([source](../../src/mqc_algebra.F03#L130)) +- `MQC_Vector%at` — `at_sca, at_int` ([source](../../src/mqc_algebra.F03#L132)) +- `MQC_Vector%vat` — `MQC_Vector_Vector_At` ([source](../../src/mqc_algebra.F03#L134)) +- `MQC_Vector%getArrayI` — `MQC_Vector_Integer_Get_Array` ([source](../../src/mqc_algebra.F03#L136)) +- `MQC_Vector%getArrayR` — `MQC_Vector_Real_Get_Array` ([source](../../src/mqc_algebra.F03#L138)) +- `MQC_Vector%getArrayC` — `MQC_Vector_Complex_Get_Array` ([source](../../src/mqc_algebra.F03#L140)) +- `MQC_Vector%put_sca` — `MQC_Vector_Scalar_Put_Scalar` ([source](../../src/mqc_algebra.F03#L141)) +- `MQC_Vector%put_int` — `MQC_Vector_Scalar_Put_Int` ([source](../../src/mqc_algebra.F03#L142)) +- `MQC_Vector%put` — `put_sca, put_int` ([source](../../src/mqc_algebra.F03#L144)) +- `MQC_Vector%vput` — `MQC_Vector_Vector_Put` ([source](../../src/mqc_algebra.F03#L146)) +- `MQC_Vector%push` — `MQC_Vector_Push` ([source](../../src/mqc_algebra.F03#L148)) +- `MQC_Vector%unshift` — `MQC_Vector_Unshift` ([source](../../src/mqc_algebra.F03#L150)) +- `MQC_Vector%pop` — `MQC_Vector_Pop` ([source](../../src/mqc_algebra.F03#L152)) +- `MQC_Vector%shift` — `MQC_Vector_Shift` ([source](../../src/mqc_algebra.F03#L154)) +- `MQC_Vector%maxval` — `MQC_Vector_MaxVal` ([source](../../src/mqc_algebra.F03#L156)) +- `MQC_Vector%minval` — `MQC_Vector_MinVal` ([source](../../src/mqc_algebra.F03#L158)) +- `MQC_Vector%maxloc` — `MQC_Vector_MaxLoc` ([source](../../src/mqc_algebra.F03#L160)) +- `MQC_Vector%minloc` — `MQC_Vector_MinLoc` ([source](../../src/mqc_algebra.F03#L162)) +- `MQC_Vector%argsort` — `MQC_Vector_argsort` ([source](../../src/mqc_algebra.F03#L164)) +- `MQC_Vector%sort` — `MQC_Vector_sort` ([source](../../src/mqc_algebra.F03#L167)) +- `MQC_Vector%sqrt` — `MQC_Vector_Sqrt` ([source](../../src/mqc_algebra.F03#L169)) +- `MQC_Vector%exp` — `MQC_Vector_Exp` ([source](../../src/mqc_algebra.F03#L171)) +- `MQC_Vector%abs` — `MQC_Vector_Abs` ([source](../../src/mqc_algebra.F03#L173)) +- `MQC_Vector%sum` — `MQC_Vector_Sum` ([source](../../src/mqc_algebra.F03#L175)) +- `MQC_Vector%product` — `MQC_Vector_Product` ([source](../../src/mqc_algebra.F03#L177)) +- `MQC_Vector%power` — `MQC_Vector_Power` ([source](../../src/mqc_algebra.F03#L179)) +- `MQC_Vector%diag` — `MQC_Matrix_DiagMatrix_Put_Vector` ([source](../../src/mqc_algebra.F03#L181)) +- `MQC_Vector%hphdiag` — `MQC_Matrix_DiagMatrix_Put_Vector` ([source](../../src/mqc_algebra.F03#L182)) +- `MQC_Vector%diagf` — `MQC_Matrix_DiagMatrix_Put_Vector_func` ([source](../../src/mqc_algebra.F03#L184)) +- `MQC_Matrix%print` — `MQC_Print_Matrix_Algebra1` ([source](../../src/mqc_algebra.F03#L204)) +- `MQC_Matrix%init` — `MQC_Matrix_Initialize` ([source](../../src/mqc_algebra.F03#L206)) +- `MQC_Matrix%identity` — `MQC_Matrix_Identity` ([source](../../src/mqc_algebra.F03#L208)) +- `MQC_Matrix%set` — `MQC_Matrix_Set` ([source](../../src/mqc_algebra.F03#L210)) +- `MQC_Matrix%norm` — `MQC_Matrix_Norm` ([source](../../src/mqc_algebra.F03#L212)) +- `MQC_Matrix%transpose` — `MQC_Matrix_Transpose` ([source](../../src/mqc_algebra.F03#L214)) +- `MQC_Matrix%dagger` — `MQC_Matrix_Conjugate_Transpose` ([source](../../src/mqc_algebra.F03#L216)) +- `MQC_Matrix%diag` — `MQC_Matrix_Diagonalize` ([source](../../src/mqc_algebra.F03#L219)) +- `MQC_Matrix%svd` — `MQC_Matrix_SVD` ([source](../../src/mqc_algebra.F03#L221)) +- `MQC_Matrix%eigensys` — `mqc_matrix_generalized_eigensystem` ([source](../../src/mqc_algebra.F03#L223)) +- `MQC_Matrix%inv` — `MQC_Matrix_Inverse` ([source](../../src/mqc_algebra.F03#L225)) +- `MQC_Matrix%det` — `mqc_matrix_determinant` ([source](../../src/mqc_algebra.F03#L227)) +- `MQC_Matrix%minor` — `mqc_matrix_minor` ([source](../../src/mqc_algebra.F03#L229)) +- `MQC_Matrix%cofactor` — `mqc_matrix_cofactor` ([source](../../src/mqc_algebra.F03#L231)) +- `MQC_Matrix%trace` — `mqc_matrix_trace` ([source](../../src/mqc_algebra.F03#L233)) +- `MQC_Matrix%pinv` — `mqc_matrix_MPInv` ([source](../../src/mqc_algebra.F03#L235)) +- `MQC_Matrix%diagonal` — `mqc_matrix_diagonal_elements` ([source](../../src/mqc_algebra.F03#L237)) +- `MQC_Matrix%rmsmax` — `MQC_Matrix_RMS_Max` ([source](../../src/mqc_algebra.F03#L240)) +- `MQC_Matrix%sqrt` — `MQC_Matrix_Sqrt` ([source](../../src/mqc_algebra.F03#L242)) +- `MQC_Matrix%exp` — `MQC_Matrix_Exp` ([source](../../src/mqc_algebra.F03#L244)) +- `MQC_Matrix%sum` — `MQC_Matrix_Sum` ([source](../../src/mqc_algebra.F03#L246)) +- `MQC_Matrix%psum` — `MQC_Matrix_Partial_Sum` ([source](../../src/mqc_algebra.F03#L247)) +- `MQC_Matrix%power` — `MQC_Matrix_Power` ([source](../../src/mqc_algebra.F03#L249)) +- `MQC_Matrix%at_sca` — `MQC_Matrix_Scalar_At_Scalar` ([source](../../src/mqc_algebra.F03#L250)) +- `MQC_Matrix%at_scaint` — `MQC_Matrix_Scalar_At_ScaInt` ([source](../../src/mqc_algebra.F03#L251)) +- `MQC_Matrix%at_intsca` — `MQC_Matrix_Scalar_At_IntSca` ([source](../../src/mqc_algebra.F03#L252)) +- `MQC_Matrix%at_int` — `MQC_Matrix_Scalar_At_Int` ([source](../../src/mqc_algebra.F03#L253)) +- `MQC_Matrix%at` — `at_sca, at_int, at_scaint, at_intsca` ([source](../../src/mqc_algebra.F03#L255)) +- `MQC_Matrix%vat` — `MQC_Matrix_Vector_At` ([source](../../src/mqc_algebra.F03#L257)) +- `MQC_Matrix%mat` — `MQC_Matrix_Matrix_At` ([source](../../src/mqc_algebra.F03#L259)) +- `MQC_Matrix%put_sca` — `MQC_Matrix_Scalar_Put_Scalar` ([source](../../src/mqc_algebra.F03#L260)) +- `MQC_Matrix%put_scaint` — `MQC_Matrix_Scalar_Put_ScaInt` ([source](../../src/mqc_algebra.F03#L261)) +- `MQC_Matrix%put_intsca` — `MQC_Matrix_Scalar_Put_IntSca` ([source](../../src/mqc_algebra.F03#L262)) +- `MQC_Matrix%put_int` — `MQC_Matrix_Scalar_Put_Int` ([source](../../src/mqc_algebra.F03#L263)) +- `MQC_Matrix%put` — `put_sca, put_int, put_scaint, put_intsca` ([source](../../src/mqc_algebra.F03#L266)) +- `MQC_Matrix%vput` — `MQC_Matrix_Vector_Put` ([source](../../src/mqc_algebra.F03#L269)) +- `MQC_Matrix%mput` — `MQC_Matrix_Matrix_Put` ([source](../../src/mqc_algebra.F03#L272)) +- `MQC_Matrix%mpad` — `MQC_Matrix_Pad` ([source](../../src/mqc_algebra.F03#L275)) +- `MQC_R4Tensor%print` — `MQC_Print_r4tensor_Algebra1` ([source](../../src/mqc_algebra.F03#L288)) +- `MQC_R4Tensor%at_sca` — `MQC_R4Tensor_At_Scalar` ([source](../../src/mqc_algebra.F03#L289)) +- `MQC_R4Tensor%at_int` — `MQC_R4Tensor_At_Int` ([source](../../src/mqc_algebra.F03#L290)) +- `MQC_R4Tensor%at` — `at_sca, at_int` ([source](../../src/mqc_algebra.F03#L292)) +- `MQC_R4Tensor%vat` — `MQC_R4Tensor_Vector_At` ([source](../../src/mqc_algebra.F03#L294)) +- `MQC_R4Tensor%mat` — `MQC_R4Tensor_Matrix_At` ([source](../../src/mqc_algebra.F03#L296)) +- `MQC_R4Tensor%tat` — `MQC_R4Tensor_R4Tensor_At` ([source](../../src/mqc_algebra.F03#L298)) +- `MQC_R4Tensor%put_sca` — `MQC_R4Tensor_Put_Scalar` ([source](../../src/mqc_algebra.F03#L299)) +- `MQC_R4Tensor%put_int` — `MQC_R4Tensor_Put_Int` ([source](../../src/mqc_algebra.F03#L300)) +- `MQC_R4Tensor%put` — `put_sca, put_int` ([source](../../src/mqc_algebra.F03#L303)) +- `MQC_R4Tensor%vput` — `MQC_R4Tensor_Vector_Put` ([source](../../src/mqc_algebra.F03#L306)) +- `MQC_R4Tensor%mput` — `MQC_R4Tensor_Matrix_Put` ([source](../../src/mqc_algebra.F03#L309)) +- `MQC_R4Tensor%tput` — `MQC_R4Tensor_R4Tensor_Put` ([source](../../src/mqc_algebra.F03#L312)) +- `MQC_R4Tensor%init` — `MQC_R4Tensor_Initialize` ([source](../../src/mqc_algebra.F03#L314)) + +### Generic and defined interfaces + +- `MQC_Print` ([source](../../src/mqc_algebra.F03#L330)) +- `num2char` ([source](../../src/mqc_algebra.F03#L338)) +- `Contraction` ([source](../../src/mqc_algebra.F03#L343)) +- `conjg` ([source](../../src/mqc_algebra.F03#L349)) +- `float` ([source](../../src/mqc_algebra.F03#L357)) +- `int` ([source](../../src/mqc_algebra.F03#L362)) +- `mqc_have_real` ([source](../../src/mqc_algebra.F03#L367)) +- `mqc_have_int` ([source](../../src/mqc_algebra.F03#L375)) +- `mqc_have_complex` ([source](../../src/mqc_algebra.F03#L383)) +- `mqc_cast_integer` ([source](../../src/mqc_algebra.F03#L391)) +- `mqc_cast_real` ([source](../../src/mqc_algebra.F03#L397)) +- `mqc_cast_complex` ([source](../../src/mqc_algebra.F03#L404)) +- `Matmul` ([source](../../src/mqc_algebra.F03#L410)) +- `Transpose` ([source](../../src/mqc_algebra.F03#L417)) +- `Dagger` ([source](../../src/mqc_algebra.F03#L423)) +- `Cmplx` ([source](../../src/mqc_algebra.F03#L429)) +- `maxval` ([source](../../src/mqc_algebra.F03#L437)) +- `minval` ([source](../../src/mqc_algebra.F03#L442)) +- `maxloc` ([source](../../src/mqc_algebra.F03#L447)) +- `minloc` ([source](../../src/mqc_algebra.F03#L452)) +- `Sqrt` ([source](../../src/mqc_algebra.F03#L457)) +- `Exp` ([source](../../src/mqc_algebra.F03#L464)) +- `abs` ([source](../../src/mqc_algebra.F03#L471)) +- `log` ([source](../../src/mqc_algebra.F03#L477)) +- `real` ([source](../../src/mqc_algebra.F03#L482)) +- `aimag` ([source](../../src/mqc_algebra.F03#L490)) +- `Sin` ([source](../../src/mqc_algebra.F03#L498)) +- `Cos` ([source](../../src/mqc_algebra.F03#L503)) +- `Tan` ([source](../../src/mqc_algebra.F03#L508)) +- `ASin` ([source](../../src/mqc_algebra.F03#L513)) +- `ACos` ([source](../../src/mqc_algebra.F03#L518)) +- `ATan` ([source](../../src/mqc_algebra.F03#L523)) +- `ATan2` ([source](../../src/mqc_algebra.F03#L528)) +- `Sinh` ([source](../../src/mqc_algebra.F03#L533)) +- `Cosh` ([source](../../src/mqc_algebra.F03#L538)) +- `MQC_Set_Array2Vector` ([source](../../src/mqc_algebra.F03#L543)) +- `MQC_Vector` ([source](../../src/mqc_algebra.F03#L550)) +- `MQC_Matrix_SymmMatrix_Put` ([source](../../src/mqc_algebra.F03#L557)) +- `MQC_Matrix_DiagMatrix_Put` ([source](../../src/mqc_algebra.F03#L562)) +- `Matrix_Symm2Sq` ([source](../../src/mqc_algebra.F03#L568)) +- `Dot_Product` ([source](../../src/mqc_algebra.F03#L575)) +- `Sum` ([source](../../src/mqc_algebra.F03#L580)) +- `Reshape` ([source](../../src/mqc_algebra.F03#L586)) +- `Size` ([source](../../src/mqc_algebra.F03#L592)) +- `Sign` ([source](../../src/mqc_algebra.F03#L600)) +- `Allocated` ([source](../../src/mqc_algebra.F03#L605)) +- `MQC_Vector_Scalar_At` ([source](../../src/mqc_algebra.F03#L613)) +- `MQC_Matrix_Scalar_At` ([source](../../src/mqc_algebra.F03#L619)) +- `MQC_R4Tensor_At` ([source](../../src/mqc_algebra.F03#L627)) +- `MQC_Vector_Scalar_Put` ([source](../../src/mqc_algebra.F03#L633)) +- `MQC_Matrix_Scalar_Put` ([source](../../src/mqc_algebra.F03#L639)) +- `MQC_R4Tensor_Matrix_Contraction` ([source](../../src/mqc_algebra.F03#L647)) +- `MQC_R4Tensor_R4Tensor_Partial_Contraction` ([source](../../src/mqc_algebra.F03#L652)) +- `MQC_R4Tensor_Put` ([source](../../src/mqc_algebra.F03#L657)) +- `identity` ([source](../../src/mqc_algebra.F03#L663)) +- `init` ([source](../../src/mqc_algebra.F03#L668)) +- `Assignment (=)` ([source](../../src/mqc_algebra.F03#L684)) +- `Operator (+)` ([source](../../src/mqc_algebra.F03#L695)) +- `Operator (-)` ([source](../../src/mqc_algebra.F03#L706)) +- `Operator (*)` ([source](../../src/mqc_algebra.F03#L717)) +- `Operator (/)` ([source](../../src/mqc_algebra.F03#L740)) +- `Operator (**)` ([source](../../src/mqc_algebra.F03#L754)) +- `Operator (.ne.)` ([source](../../src/mqc_algebra.F03#L762)) +- `Operator (.eq.)` ([source](../../src/mqc_algebra.F03#L773)) +- `Operator (.lt.)` ([source](../../src/mqc_algebra.F03#L784)) +- `Operator (.gt.)` ([source](../../src/mqc_algebra.F03#L793)) +- `Operator (.le.)` ([source](../../src/mqc_algebra.F03#L802)) +- `Operator (.ge.)` ([source](../../src/mqc_algebra.F03#L811)) +- `Assignment (=)` ([source](../../src/mqc_algebra.F03#L822)) +- `Operator (.dot.)` ([source](../../src/mqc_algebra.F03#L829)) +- `Operator (*)` ([source](../../src/mqc_algebra.F03#L834)) +- `Operator (**)` ([source](../../src/mqc_algebra.F03#L844)) +- `Operator (/)` ([source](../../src/mqc_algebra.F03#L849)) +- `Operator (+)` ([source](../../src/mqc_algebra.F03#L856)) +- `Operator (-)` ([source](../../src/mqc_algebra.F03#L863)) +- `Operator (.ewp.)` ([source](../../src/mqc_algebra.F03#L869)) +- `Operator (.ewd.)` ([source](../../src/mqc_algebra.F03#L875)) +- `Operator (.x.)` ([source](../../src/mqc_algebra.F03#L880)) +- `Operator (.outer.)` ([source](../../src/mqc_algebra.F03#L885)) +- `Assignment (=)` ([source](../../src/mqc_algebra.F03#L892)) +- `Operator (+)` ([source](../../src/mqc_algebra.F03#L903)) +- `Operator (-)` ([source](../../src/mqc_algebra.F03#L910)) +- `Operator (*)` ([source](../../src/mqc_algebra.F03#L915)) +- `Operator (**)` ([source](../../src/mqc_algebra.F03#L921)) +- `Operator (.dot.)` ([source](../../src/mqc_algebra.F03#L926)) +- `Operator (.outer.)` ([source](../../src/mqc_algebra.F03#L932)) +- `Operator (.crossouter.)` ([source](../../src/mqc_algebra.F03#L936)) +- `Assignment (=)` ([source](../../src/mqc_algebra.F03#L943)) +- `Operator (+)` ([source](../../src/mqc_algebra.F03#L953)) +- `Operator (-)` ([source](../../src/mqc_algebra.F03#L958)) +- `Operator (.eq.)` ([source](../../src/mqc_algebra.F03#L963)) +- `Operator (.ge.)` ([source](../../src/mqc_algebra.F03#L971)) +- `Operator (.le.)` ([source](../../src/mqc_algebra.F03#L979)) + +### Procedure definitions + +- `MQC_Algebra_SetDEBUG` — `subroutine` ([source](../../src/mqc_algebra.F03#L999)) +- `factorial` — `function` ([source](../../src/mqc_algebra.F03#L1042)) +- `Bin_Coeff` — `Function` ([source](../../src/mqc_algebra.F03#L1092)) +- `MQC_Allocate_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1179)) +- `MQC_Deallocate_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1233)) +- `MQC_Scalar_IsAllocated` — `Function` ([source](../../src/mqc_algebra.F03#L1278)) +- `MQC_Input_Integer_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1327)) +- `MQC_Input_Real_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1374)) +- `MQC_Input_Complex_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1421)) +- `MQC_Output_MQCScalar_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1468)) +- `MQC_Output_Integer_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1530)) +- `MQC_Output_Real_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1585)) +- `MQC_Output_Complex_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1640)) +- `MQC_Print_Scalar_Algebra1` — `Subroutine` ([source](../../src/mqc_algebra.F03#L1723)) +- `MQC_Scalar_Cmplx` — `Function` ([source](../../src/mqc_algebra.F03#L1812)) +- `MQC_Scalar_Sqrt` — `Function` ([source](../../src/mqc_algebra.F03#L1894)) +- `MQC_Scalar_Exp` — `Function` ([source](../../src/mqc_algebra.F03#L1947)) +- `MQC_Scalar_Sin` — `Function` ([source](../../src/mqc_algebra.F03#L2000)) +- `MQC_Scalar_Cos` — `Function` ([source](../../src/mqc_algebra.F03#L2053)) +- `MQC_Scalar_Tan` — `Function` ([source](../../src/mqc_algebra.F03#L2106)) +- `MQC_Scalar_ASin` — `Function` ([source](../../src/mqc_algebra.F03#L2159)) +- `MQC_Scalar_ACos` — `Function` ([source](../../src/mqc_algebra.F03#L2212)) +- `MQC_Scalar_ATan` — `Function` ([source](../../src/mqc_algebra.F03#L2265)) +- `MQC_Scalar_ATan2` — `Function` ([source](../../src/mqc_algebra.F03#L2319)) +- `MQC_Scalar_Sinh` — `Function` ([source](../../src/mqc_algebra.F03#L2373)) +- `MQC_Scalar_Cosh` — `Function` ([source](../../src/mqc_algebra.F03#L2427)) +- `MQC_Scalar_HaveReal` — `Function` ([source](../../src/mqc_algebra.F03#L2481)) +- `MQC_Scalar_HaveInteger` — `Function` ([source](../../src/mqc_algebra.F03#L2522)) +- `MQC_Scalar_HaveComplex` — `Function` ([source](../../src/mqc_algebra.F03#L2563)) +- `MQC_Scalar_Get_Intrinsic_Real` — `Function` ([source](../../src/mqc_algebra.F03#L2604)) +- `MQC_Scalar_Get_Intrinsic_Integer` — `Function` ([source](../../src/mqc_algebra.F03#L2654)) +- `MQC_Scalar_Get_Intrinsic_Complex` — `Function` ([source](../../src/mqc_algebra.F03#L2704)) +- `MQC_Scalar_Get_ABS_Value` — `Function` ([source](../../src/mqc_algebra.F03#L2754)) +- `MQC_Scalar_Get_Phase` — `Function` ([source](../../src/mqc_algebra.F03#L2811)) +- `MQC_Scalar_Log` — `Function` ([source](../../src/mqc_algebra.F03#L2863)) +- `MQC_Scalar_Get_Random_Value` — `Subroutine` ([source](../../src/mqc_algebra.F03#L2946)) +- `MQC_ScalarAdd` — `Function` ([source](../../src/mqc_algebra.F03#L3034)) +- `MQC_ScalarSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L3122)) +- `MQC_ScalarMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L3207)) +- `MQC_ScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L3292)) +- `MQC_ScalarExponent` — `Function` ([source](../../src/mqc_algebra.F03#L3379)) +- `MQC_ScalarIntegerExponent` — `Function` ([source](../../src/mqc_algebra.F03#L3466)) +- `MQC_ScalarRealExponent` — `Function` ([source](../../src/mqc_algebra.F03#L3531)) +- `MQC_ScalarComplexExponent` — `Function` ([source](../../src/mqc_algebra.F03#L3596)) +- `MQC_ScalarNE` — `Function` ([source](../../src/mqc_algebra.F03#L3657)) +- `MQC_IntegerNEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L3735)) +- `MQC_ScalarNEInteger` — `Function` ([source](../../src/mqc_algebra.F03#L3793)) +- `MQC_RealNEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L3851)) +- `MQC_ScalarNEReal` — `Function` ([source](../../src/mqc_algebra.F03#L3909)) +- `MQC_ComplexNEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L3967)) +- `MQC_ScalarNEComplex` — `Function` ([source](../../src/mqc_algebra.F03#L4025)) +- `MQC_ScalarEQ` — `Function` ([source](../../src/mqc_algebra.F03#L4083)) +- `MQC_IntegerEQScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4153)) +- `MQC_ScalarEQInteger` — `Function` ([source](../../src/mqc_algebra.F03#L4212)) +- `MQC_RealEQScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4271)) +- `MQC_ScalarEQReal` — `Function` ([source](../../src/mqc_algebra.F03#L4330)) +- `MQC_ComplexEQScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4389)) +- `MQC_ScalarEQComplex` — `Function` ([source](../../src/mqc_algebra.F03#L4448)) +- `MQC_ScalarLT` — `Function` ([source](../../src/mqc_algebra.F03#L4513)) +- `MQC_IntegerLTScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4610)) +- `MQC_ScalarLTInteger` — `Function` ([source](../../src/mqc_algebra.F03#L4679)) +- `MQC_RealLTScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4748)) +- `MQC_ScalarLTReal` — `Function` ([source](../../src/mqc_algebra.F03#L4817)) +- `MQC_ScalarGT` — `Function` ([source](../../src/mqc_algebra.F03#L4886)) +- `MQC_IntegerGTScalar` — `Function` ([source](../../src/mqc_algebra.F03#L4983)) +- `MQC_ScalarGTInteger` — `Function` ([source](../../src/mqc_algebra.F03#L5052)) +- `MQC_RealGTScalar` — `Function` ([source](../../src/mqc_algebra.F03#L5121)) +- `MQC_ScalarGTReal` — `Function` ([source](../../src/mqc_algebra.F03#L5190)) +- `MQC_ScalarLE` — `Function` ([source](../../src/mqc_algebra.F03#L5257)) +- `MQC_RealLEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L5332)) +- `MQC_ScalarLEReal` — `Function` ([source](../../src/mqc_algebra.F03#L5395)) +- `MQC_IntegerLEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L5458)) +- `MQC_ScalarLEInteger` — `Function` ([source](../../src/mqc_algebra.F03#L5521)) +- `MQC_ScalarGE` — `Function` ([source](../../src/mqc_algebra.F03#L5584)) +- `MQC_RealGEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L5659)) +- `MQC_ScalarGEReal` — `Function` ([source](../../src/mqc_algebra.F03#L5722)) +- `MQC_IntegerGEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L5785)) +- `MQC_ScalarGEInteger` — `Function` ([source](../../src/mqc_algebra.F03#L5848)) +- `MQC_Scalar_Complex_Conjugate` — `Function` ([source](../../src/mqc_algebra.F03#L5901)) +- `MQC_Scalar_Complex_RealPart` — `Function` ([source](../../src/mqc_algebra.F03#L5946)) +- `MQC_Scalar_Complex_ImagPart` — `Function` ([source](../../src/mqc_algebra.F03#L5993)) +- `MQC_IntegerScalarMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6042)) +- `MQC_ScalarIntegerMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6092)) +- `MQC_RealScalarMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6142)) +- `MQC_ScalarRealMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6192)) +- `MQC_ComplexScalarMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6242)) +- `MQC_ScalarComplexMultiply` — `Function` ([source](../../src/mqc_algebra.F03#L6292)) +- `MQC_IntegerScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6342)) +- `MQC_ScalarIntegerDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6392)) +- `MQC_RealScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6442)) +- `MQC_ScalarRealDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6492)) +- `MQC_ComplexScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6542)) +- `MQC_ScalarComplexDivide` — `Function` ([source](../../src/mqc_algebra.F03#L6592)) +- `MQC_IntegerScalarAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6642)) +- `MQC_ScalarIntegerAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6692)) +- `MQC_RealScalarAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6742)) +- `MQC_ScalarRealAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6792)) +- `MQC_ComplexScalarAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6842)) +- `MQC_ScalarComplexAdd` — `Function` ([source](../../src/mqc_algebra.F03#L6892)) +- `MQC_IntegerScalarSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L6942)) +- `MQC_ScalarIntegerSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L6992)) +- `MQC_RealScalarSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L7042)) +- `MQC_ScalarRealSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L7092)) +- `MQC_ComplexScalarSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L7142)) +- `MQC_ScalarComplexSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L7192)) +- `MQC_Scalar_Sign` — `Function` ([source](../../src/mqc_algebra.F03#L7242)) +- `mqcscalar2character` — `function` ([source](../../src/mqc_algebra.F03#L7320)) +- `MQC_Allocate_Vector` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7436)) +- `MQC_Deallocate_Vector` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7495)) +- `MQC_Length_Vector` — `Function` ([source](../../src/mqc_algebra.F03#L7539)) +- `MQC_Vector_HaveReal` — `Function` ([source](../../src/mqc_algebra.F03#L7580)) +- `MQC_Vector_HaveInteger` — `Function` ([source](../../src/mqc_algebra.F03#L7621)) +- `MQC_Vector_HaveComplex` — `Function` ([source](../../src/mqc_algebra.F03#L7662)) +- `MQC_Vector_IsColumn` — `Function` ([source](../../src/mqc_algebra.F03#L7703)) +- `MQC_Vector_Copy_Int2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7744)) +- `MQC_Vector_Copy_Int2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7789)) +- `MQC_Vector_Copy_Real2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7834)) +- `MQC_Vector_Copy_Real2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7879)) +- `MQC_Vector_Copy_Complex2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7925)) +- `MQC_Vector_Copy_Complex2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L7970)) +- `MQC_Vector_Scalar_At_Scalar` — `Function` ([source](../../src/mqc_algebra.F03#L8023)) +- `MQC_Vector_Scalar_At_Int` — `Function` ([source](../../src/mqc_algebra.F03#L8073)) +- `MQC_Vector_Vector_At` — `Function` ([source](../../src/mqc_algebra.F03#L8146)) +- `MQC_Vector_Integer_Get_Array` — `Function` ([source](../../src/mqc_algebra.F03#L8233)) +- `MQC_Vector_Real_Get_Array` — `Function` ([source](../../src/mqc_algebra.F03#L8277)) +- `MQC_Vector_Complex_Get_Array` — `Function` ([source](../../src/mqc_algebra.F03#L8321)) +- `MQC_Set_Vector2IntegerArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8373)) +- `MQC_Set_Vector2RealArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8442)) +- `MQC_Set_Vector2ComplexArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8511)) +- `MQC_Set_Array2Vector_Integer` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8580)) +- `MQC_Set_Array2Vector_Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8635)) +- `MQC_Set_Array2Vector_Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8686)) +- `MQC_Set_Array2Vector_Integer_Func` — `Function` ([source](../../src/mqc_algebra.F03#L8730)) +- `MQC_Set_Array2Vector_Real_Func` — `Function` ([source](../../src/mqc_algebra.F03#L8772)) +- `MQC_Set_Array2Vector_Complex_Func` — `Function` ([source](../../src/mqc_algebra.F03#L8814)) +- `MQC_Set_Vector2Vector` — `Subroutine` ([source](../../src/mqc_algebra.F03#L8863)) +- `MQC_VectorVectorSum` — `Function` ([source](../../src/mqc_algebra.F03#L8930)) +- `MQC_VectorVectorDifference` — `Function` ([source](../../src/mqc_algebra.F03#L9048)) +- `MQC_ScalarVectorSum` — `Function` ([source](../../src/mqc_algebra.F03#L9164)) +- `MQC_VectorScalarSum` — `Function` ([source](../../src/mqc_algebra.F03#L9268)) +- `MQC_ScalarVectorDifference` — `Function` ([source](../../src/mqc_algebra.F03#L9374)) +- `MQC_ElementVectorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L9481)) +- `MQC_Vector_Transpose` — `Function` ([source](../../src/mqc_algebra.F03#L9590)) +- `MQC_Vector_Conjugate_Transpose` — `Function` ([source](../../src/mqc_algebra.F03#L9633)) +- `MQC_VectorVectorDotProduct` — `Function` ([source](../../src/mqc_algebra.F03#L9686)) +- `mqc_outer` — `Function` ([source](../../src/mqc_algebra.F03#L9793)) +- `MQC_CrossProduct` — `Function` ([source](../../src/mqc_algebra.F03#L9885)) +- `MQC_Print_Vector_Algebra1` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10085)) +- `MQC_vector_cast_integer` — `function` ([source](../../src/mqc_algebra.F03#L10186)) +- `MQC_vector_cast_real` — `function` ([source](../../src/mqc_algebra.F03#L10230)) +- `MQC_vector_cast_complex` — `function` ([source](../../src/mqc_algebra.F03#L10275)) +- `MQC_Vector_Scalar_Put_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10334)) +- `MQC_Vector_Scalar_Put_Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10393)) +- `MQC_Vector_Scalar_Increment` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10511)) +- `MQC_Vector_Vector_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10614)) +- `MQC_Vector_Initialize` — `Subroutine` ([source](../../src/mqc_algebra.F03#L10734)) +- `MQC_Vector_Set` — `subroutine` ([source](../../src/mqc_algebra.F03#L10813)) +- `MQC_ScalarVectorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L10899)) +- `mqc_VectorScalarProduct` — `function` ([source](../../src/mqc_algebra.F03#L10990)) +- `MQC_VectorScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L11036)) +- `MQC_RealVectorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L11093)) +- `mqc_VectorRealProduct` — `function` ([source](../../src/mqc_algebra.F03#L11152)) +- `MQC_VectorRealDivide` — `Function` ([source](../../src/mqc_algebra.F03#L11198)) +- `MQC_IntegerVectorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L11255)) +- `mqc_VectorIntegerProduct` — `function` ([source](../../src/mqc_algebra.F03#L11314)) +- `MQC_VectorIntegerDivide` — `Function` ([source](../../src/mqc_algebra.F03#L11360)) +- `MQC_ComplexVectorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L11417)) +- `mqc_VectorComplexProduct` — `function` ([source](../../src/mqc_algebra.F03#L11476)) +- `MQC_VectorComplexDivide` — `Function` ([source](../../src/mqc_algebra.F03#L11522)) +- `MQC_Vector_Norm` — `Function` ([source](../../src/mqc_algebra.F03#L11586)) +- `MQC_Vector_isAllocated` — `Function` ([source](../../src/mqc_algebra.F03#L11656)) +- `MQC_Vector_Push` — `Subroutine` ([source](../../src/mqc_algebra.F03#L11705)) +- `MQC_Vector_Unshift` — `Subroutine` ([source](../../src/mqc_algebra.F03#L11776)) +- `MQC_Vector_Pop` — `Function` ([source](../../src/mqc_algebra.F03#L11841)) +- `MQC_Vector_Shift` — `Function` ([source](../../src/mqc_algebra.F03#L11891)) +- `MQC_Vector_MaxVal` — `Function` ([source](../../src/mqc_algebra.F03#L11941)) +- `MQC_Vector_MinVal` — `Function` ([source](../../src/mqc_algebra.F03#L11992)) +- `MQC_Vector_MaxLoc` — `Function` ([source](../../src/mqc_algebra.F03#L12043)) +- `MQC_Vector_MinLoc` — `Function` ([source](../../src/mqc_algebra.F03#L12096)) +- `MQC_Vector_ArgSort` — `Function` ([source](../../src/mqc_algebra.F03#L12149)) +- `MQC_Vector_Sort` — `Subroutine` ([source](../../src/mqc_algebra.F03#L12211)) +- `mqc_vector_sqrt` — `subroutine` ([source](../../src/mqc_algebra.F03#L12264)) +- `mqc_vector_exp` — `subroutine` ([source](../../src/mqc_algebra.F03#L12307)) +- `mqc_vector_abs` — `subroutine` ([source](../../src/mqc_algebra.F03#L12350)) +- `mqc_vector_sqrt_func` — `function` ([source](../../src/mqc_algebra.F03#L12393)) +- `mqc_vector_exp_func` — `function` ([source](../../src/mqc_algebra.F03#L12438)) +- `mqc_vector_abs_func` — `function` ([source](../../src/mqc_algebra.F03#L12483)) +- `mqc_vector_power` — `subroutine` ([source](../../src/mqc_algebra.F03#L12535)) +- `mqc_vector_power_func` — `function` ([source](../../src/mqc_algebra.F03#L12601)) +- `mqc_vector_complex_realPart` — `function` ([source](../../src/mqc_algebra.F03#L12664)) +- `mqc_vector_complex_imagPart` — `function` ([source](../../src/mqc_algebra.F03#L12709)) +- `MQC_Vector_Cmplx` — `Function` ([source](../../src/mqc_algebra.F03#L12762)) +- `mqc_vector_sum` — `function` ([source](../../src/mqc_algebra.F03#L12845)) +- `mqc_vector_product` — `function` ([source](../../src/mqc_algebra.F03#L12890)) +- `MQC_Vector_Complex_Conjugate` — `Function` ([source](../../src/mqc_algebra.F03#L12935)) +- `MQC_Vector_Reshape_Matrix` — `Function` ([source](../../src/mqc_algebra.F03#L12985)) +- `MQC_ScalarEQVector` — `Function` ([source](../../src/mqc_algebra.F03#L13055)) +- `MQC_VectorEQScalar` — `Function` ([source](../../src/mqc_algebra.F03#L13110)) +- `MQC_IntegerEQVector` — `Function` ([source](../../src/mqc_algebra.F03#L13165)) +- `MQC_VectorEQInteger` — `Function` ([source](../../src/mqc_algebra.F03#L13220)) +- `MQC_ScalarGEVector` — `Function` ([source](../../src/mqc_algebra.F03#L13275)) +- `MQC_VectorGEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L13330)) +- `MQC_IntegerGEVector` — `Function` ([source](../../src/mqc_algebra.F03#L13385)) +- `MQC_VectorGEInteger` — `Function` ([source](../../src/mqc_algebra.F03#L13440)) +- `MQC_ScalarLEVector` — `Function` ([source](../../src/mqc_algebra.F03#L13495)) +- `MQC_VectorLEScalar` — `Function` ([source](../../src/mqc_algebra.F03#L13550)) +- `MQC_IntegerLEVector` — `Function` ([source](../../src/mqc_algebra.F03#L13605)) +- `MQC_VectorLEInteger` — `Function` ([source](../../src/mqc_algebra.F03#L13660)) +- `MQC_Matrix_Diagonalize` — `Subroutine` ([source](../../src/mqc_algebra.F03#L13728)) +- `MQC_Matrix_Cast_Real` — `Function` ([source](../../src/mqc_algebra.F03#L13915)) +- `MQC_R4Tensor_Cast_Real` — `Function` ([source](../../src/mqc_algebra.F03#L13958)) +- `MQC_Matrix_Cast_Integer` — `Function` ([source](../../src/mqc_algebra.F03#L14005)) +- `MQC_Matrix_Cast_Complex` — `Function` ([source](../../src/mqc_algebra.F03#L14049)) +- `MQC_Matrix_Scalar_At_Scalar` — `Function` ([source](../../src/mqc_algebra.F03#L14111)) +- `MQC_Matrix_Scalar_At_ScaInt` — `Function` ([source](../../src/mqc_algebra.F03#L14172)) +- `MQC_Matrix_Scalar_At_IntSca` — `Function` ([source](../../src/mqc_algebra.F03#L14234)) +- `MQC_Matrix_Scalar_At_Int` — `Function` ([source](../../src/mqc_algebra.F03#L14297)) +- `MQC_Matrix_Vector_At` — `Function` ([source](../../src/mqc_algebra.F03#L14513)) +- `MQC_Matrix_Vector_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L14782)) +- `MQC_Matrix_Matrix_At` — `Function` ([source](../../src/mqc_algebra.F03#L15011)) +- `MQC_Matrix_DiagMatrix_Put_Vector_Func` — `Function` ([source](../../src/mqc_algebra.F03#L15308)) +- `MQC_Matrix_DiagMatrix_Put_Vector` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15371)) +- `MQC_Matrix_DiagMatrix_Put_Integer` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15435)) +- `MQC_Matrix_DiagMatrix_Put_Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15492)) +- `MQC_Matrix_DiagMatrix_Put_Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15549)) +- `MQC_Matrix_SymmMatrix_Put_Integer` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15621)) +- `MQC_Matrix_SymmMatrix_Put_Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15719)) +- `MQC_Matrix_SymmMatrix_Put_Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15817)) +- `MQC_Matrix_Matrix_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L15926)) +- `MQC_Matrix_Pad` — `function` ([source](../../src/mqc_algebra.F03#L16578)) +- `symIndexHash` — `Function` ([source](../../src/mqc_algebra.F03#L16664)) +- `MQC_ElementMatrixProduct` — `Function` ([source](../../src/mqc_algebra.F03#L16766)) +- `MQC_ElementMatrixDivide` — `Function` ([source](../../src/mqc_algebra.F03#L18028)) +- `MQC_ElementMatrixPower` — `Function` ([source](../../src/mqc_algebra.F03#L19156)) +- `MQC_Matrix_Test_Symmetric` — `Function` ([source](../../src/mqc_algebra.F03#L19282)) +- `MQC_Matrix_Test_Diagonal` — `Function` ([source](../../src/mqc_algebra.F03#L19944)) +- `MQC_Allocate_Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20081)) +- `MQC_Deallocate_Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20195)) +- `MQC_Matrix_isAllocated` — `Function` ([source](../../src/mqc_algebra.F03#L20244)) +- `MQC_Set_IntegerArray2Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20294)) +- `MQC_Set_RealArray2Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20349)) +- `MQC_Set_ComplexArray2Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20404)) +- `MQC_Set_Matrix2IntegerArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20459)) +- `MQC_Set_Matrix2RealArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20546)) +- `MQC_Set_Matrix2ComplexArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20635)) +- `MQC_Set_Matrix2Matrix` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20725)) +- `MQC_Print_Matrix_Algebra1` — `Subroutine` ([source](../../src/mqc_algebra.F03#L20816)) +- `MQC_Matrix_Copy_Int2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21005)) +- `MQC_Matrix_Copy_Int2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21049)) +- `MQC_Matrix_Copy_Real2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21093)) +- `MQC_Matrix_Copy_Real2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21137)) +- `MQC_Matrix_Copy_Complex2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21181)) +- `MQC_Matrix_Copy_Complex2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21225)) +- `MQC_Matrix_Rows` — `Function` ([source](../../src/mqc_algebra.F03#L21269)) +- `MQC_Matrix_Columns` — `Function` ([source](../../src/mqc_algebra.F03#L21310)) +- `MQC_Matrix_Size` — `Function` ([source](../../src/mqc_algebra.F03#L21358)) +- `MQC_Matrix_HaveReal` — `Function` ([source](../../src/mqc_algebra.F03#L21413)) +- `MQC_Matrix_HaveInteger` — `Function` ([source](../../src/mqc_algebra.F03#L21454)) +- `MQC_Matrix_HaveComplex` — `Function` ([source](../../src/mqc_algebra.F03#L21495)) +- `MQC_Matrix_HaveFull` — `Function` ([source](../../src/mqc_algebra.F03#L21536)) +- `MQC_Matrix_HaveSymmetric` — `Function` ([source](../../src/mqc_algebra.F03#L21581)) +- `MQC_Matrix_HaveDiagonal` — `Function` ([source](../../src/mqc_algebra.F03#L21627)) +- `MQC_Matrix_Transpose` — `Function` ([source](../../src/mqc_algebra.F03#L21672)) +- `MQC_Matrix_Conjugate_Transpose` — `Function` ([source](../../src/mqc_algebra.F03#L21774)) +- `MQC_Matrix_Symmetrize` — `Function` ([source](../../src/mqc_algebra.F03#L21896)) +- `MQC_Matrix_Full2Symm` — `Subroutine` ([source](../../src/mqc_algebra.F03#L21966)) +- `MQC_Matrix_Symm2Full` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22088)) +- `MQC_Matrix_Full2Diag` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22204)) +- `MQC_Matrix_Diag2Full` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22287)) +- `MQC_Matrix_Symm2Diag` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22366)) +- `MQC_Matrix_Diag2Symm` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22462)) +- `MQC_Matrix_Symm2Full_Func` — `Function` ([source](../../src/mqc_algebra.F03#L22590)) +- `Matrix_Symm2Sq_Integer` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22705)) +- `Matrix_Symm2Sq_Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22796)) +- `Matrix_Symm2Sq_Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L22888)) +- `MQC_Vector2DiagMatrix` — `Function` ([source](../../src/mqc_algebra.F03#L22949)) +- `MQC_MatrixMatrixSum` — `Function` ([source](../../src/mqc_algebra.F03#L23002)) +- `MQC_MatrixMatrixSubtract` — `Function` ([source](../../src/mqc_algebra.F03#L23151)) +- `MQC_MatrixMatrixDotProduct` — `Function` ([source](../../src/mqc_algebra.F03#L23302)) +- `MQC_MatrixVectorDotProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24090)) +- `MQC_VectormatrixDotProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24268)) +- `MQC_MatrixScalarProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24453)) +- `MQC_ScalarMatrixProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24532)) +- `MQC_IntegerMatrixProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24610)) +- `MQC_MatrixIntegerProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24666)) +- `MQC_RealMatrixProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24722)) +- `MQC_MatrixRealProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24778)) +- `MQC_ComplexMatrixProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24834)) +- `MQC_MatrixComplexProduct` — `Function` ([source](../../src/mqc_algebra.F03#L24890)) +- `MQC_MatrixScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L24946)) +- `MQC_Matrix_Matrix_Contraction` — `Function` ([source](../../src/mqc_algebra.F03#L25017)) +- `MQC_Matrix_Scalar_Put_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25108)) +- `MQC_Matrix_Scalar_Put_ScaInt` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25198)) +- `MQC_Matrix_Scalar_Put_IntSca` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25288)) +- `MQC_Matrix_Scalar_Put_Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25377)) +- `MQC_Matrix_Initialize` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25656)) +- `MQC_Matrix_Initialize_Func` — `Function` ([source](../../src/mqc_algebra.F03#L25758)) +- `MQC_Matrix_Identity` — `Subroutine` ([source](../../src/mqc_algebra.F03#L25860)) +- `MQC_Matrix_Identity_Func` — `Function` ([source](../../src/mqc_algebra.F03#L25932)) +- `MQC_Matrix_Set` — `subroutine` ([source](../../src/mqc_algebra.F03#L26007)) +- `MQC_Matrix_Norm` — `Function` ([source](../../src/mqc_algebra.F03#L26108)) +- `mqc_matrix_determinant` — `function` ([source](../../src/mqc_algebra.F03#L26190)) +- `mqc_matrix_minor` — `function` ([source](../../src/mqc_algebra.F03#L26323)) +- `mqc_matrix_cofactor` — `function` ([source](../../src/mqc_algebra.F03#L26409)) +- `mqc_matrix_inverse` — `function` ([source](../../src/mqc_algebra.F03#L26469)) +- `mqc_matrix_trace` — `function` ([source](../../src/mqc_algebra.F03#L26578)) +- `mqc_matrix_diagonal_elements` — `function` ([source](../../src/mqc_algebra.F03#L26623)) +- `mqc_matrix_generalized_eigensystem` — `subroutine` ([source](../../src/mqc_algebra.F03#L26693)) +- `MQC_Matrix_SVD` — `Subroutine` ([source](../../src/mqc_algebra.F03#L26965)) +- `MQC_Matrix_RMS_Max` — `Subroutine` ([source](../../src/mqc_algebra.F03#L27091)) +- `mqc_matrix_sqrt` — `subroutine` ([source](../../src/mqc_algebra.F03#L27183)) +- `mqc_matrix_sqrt_func` — `function` ([source](../../src/mqc_algebra.F03#L27235)) +- `mqc_matrix_exp` — `subroutine` ([source](../../src/mqc_algebra.F03#L27297)) +- `mqc_matrix_exp_func` — `function` ([source](../../src/mqc_algebra.F03#L27349)) +- `MQC_Givens_Matrix` — `Function` ([source](../../src/mqc_algebra.F03#L27416)) +- `MQC_Matrix_Matrix_Outer` — `Function` ([source](../../src/mqc_algebra.F03#L27474)) +- `MQC_Matrix_Matrix_Cross_Outer` — `Function` ([source](../../src/mqc_algebra.F03#L27540)) +- `mqc_matrix_complex_realPart` — `function` ([source](../../src/mqc_algebra.F03#L27598)) +- `mqc_matrix_complex_imagPart` — `function` ([source](../../src/mqc_algebra.F03#L27648)) +- `MQC_Matrix_Cmplx` — `Function` ([source](../../src/mqc_algebra.F03#L27716)) +- `MQC_Matrix_Complex_Conjugate` — `Function` ([source](../../src/mqc_algebra.F03#L27858)) +- `MQC_Matrix_Reshape_Vector` — `Function` ([source](../../src/mqc_algebra.F03#L27905)) +- `MQC_Matrix_MPInv` — `Function` ([source](../../src/mqc_algebra.F03#L27976)) +- `mqc_matrix_sum` — `function` ([source](../../src/mqc_algebra.F03#L28049)) +- `mqc_matrix_partial_sum` — `function` ([source](../../src/mqc_algebra.F03#L28103)) +- `mqc_matrix_power` — `subroutine` ([source](../../src/mqc_algebra.F03#L28171)) +- `MQC_Allocate_R4Tensor` — `Subroutine` ([source](../../src/mqc_algebra.F03#L28286)) +- `MQC_Deallocate_R4Tensor` — `Subroutine` ([source](../../src/mqc_algebra.F03#L28373)) +- `MQC_R4Tensor_At_Scalar` — `Function` ([source](../../src/mqc_algebra.F03#L28455)) +- `MQC_R4Tensor_At_int` — `Function` ([source](../../src/mqc_algebra.F03#L28533)) +- `MQC_R4Tensor_Put_Scalar` — `Subroutine` ([source](../../src/mqc_algebra.F03#L28670)) +- `MQC_R4Tensor_Put_Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L28764)) +- `MQC_Print_R4Tensor_Algebra1` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29071)) +- `MQC_Set_IntegerArray2Tensor` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29167)) +- `MQC_Set_RealArray2Tensor` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29215)) +- `MQC_Set_ComplexArray2Tensor` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29263)) +- `MQC_Set_Tensor2IntegerArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29311)) +- `MQC_Set_Tensor2RealArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29373)) +- `MQC_Set_Tensor2ComplexArray` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29435)) +- `MQC_R4Tensor_Initialize` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29526)) +- `MQC_Matrix_SymmSymmR4Tensor_Put_Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29591)) +- `MQC_Matrix_SymmSymmR4Tensor_Put_Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29644)) +- `MQC_R4Tensor_HaveInteger` — `Function` ([source](../../src/mqc_algebra.F03#L29688)) +- `MQC_R4Tensor_HaveReal` — `Function` ([source](../../src/mqc_algebra.F03#L29729)) +- `MQC_R4Tensor_HaveComplex` — `Function` ([source](../../src/mqc_algebra.F03#L29769)) +- `MQC_R4Tensor_HaveFull` — `Function` ([source](../../src/mqc_algebra.F03#L29809)) +- `MQC_R4Tensor_HaveSymmetric` — `Function` ([source](../../src/mqc_algebra.F03#L29854)) +- `MQC_R4Tensor_Full2Symm` — `Subroutine` ([source](../../src/mqc_algebra.F03#L29899)) +- `MQC_R4Tensor_Symm2Full` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30008)) +- `MQC_R4Tensor_Size` — `Function` ([source](../../src/mqc_algebra.F03#L30130)) +- `MQC_R4Tensor_isAllocated` — `Function` ([source](../../src/mqc_algebra.F03#L30189)) +- `MQC_R4Tensor_Copy_Int2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30233)) +- `MQC_R4Tensor_Copy_Int2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30277)) +- `MQC_R4Tensor_Copy_Real2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30321)) +- `MQC_R4Tensor_Copy_Real2Complex` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30365)) +- `MQC_R4Tensor_Copy_Complex2Int` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30409)) +- `MQC_R4Tensor_Copy_Complex2Real` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30453)) +- `MQC_R4Tensor_R4Tensor_Contraction` — `Function` ([source](../../src/mqc_algebra.F03#L30503)) +- `MQC_R4Tensor_R4Tensor_Sum` — `Function` ([source](../../src/mqc_algebra.F03#L30564)) +- `MQC_R4Tensor_R4Tensor_Difference` — `Function` ([source](../../src/mqc_algebra.F03#L30705)) +- `MQC_R4Tensor_Vector_At` — `Function` ([source](../../src/mqc_algebra.F03#L30804)) +- `MQC_R4Tensor_Vector_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L30975)) +- `MQC_R4Tensor_Matrix_At` — `Function` ([source](../../src/mqc_algebra.F03#L31149)) +- `MQC_R4Tensor_Matrix_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L31347)) +- `MQC_R4Tensor_R4Tensor_At` — `Function` ([source](../../src/mqc_algebra.F03#L31572)) +- `MQC_R4Tensor_R4Tensor_Put` — `Subroutine` ([source](../../src/mqc_algebra.F03#L31805)) +- `MQC_R4Tensor_Test_Symmetric` — `Function` ([source](../../src/mqc_algebra.F03#L32191)) +- `MQC_R4TensorScalarDivide` — `Function` ([source](../../src/mqc_algebra.F03#L32306)) +- `MQC_ScalarR4TensorProduct` — `Function` ([source](../../src/mqc_algebra.F03#L32377)) +- `MQC_R4TensorScalarProduct` — `Function` ([source](../../src/mqc_algebra.F03#L32478)) +- `MQC_R4Tensor_Complex_Conjugate` — `Function` ([source](../../src/mqc_algebra.F03#L32532)) +- `mqc_R4Tensor_complex_realPart` — `function` ([source](../../src/mqc_algebra.F03#L32576)) +- `mqc_R4Tensor_complex_imagPart` — `function` ([source](../../src/mqc_algebra.F03#L32621)) +- `MQC_R4Tensor_Matrix_Contraction` — `Function` ([source](../../src/mqc_algebra.F03#L32690)) +- `MQC_R4Tensor_R4Tensor_Partial_Contraction` — `Function` ([source](../../src/mqc_algebra.F03#L32856)) + +## `src/mqc_algebra2.F03` + +### Modules + +- `MQC_Algebra2` ([source](../../src/mqc_algebra2.F03#L1)) + +### Derived types + +- `MQC_Variable` ([source](../../src/mqc_algebra2.F03#L70)) + +### Type-bound bindings + +- `MQC_Variable%init` — `MQC_Variable_initialize` ([source](../../src/mqc_algebra2.F03#L81)) +- `MQC_Variable%MQC_Variable_clear_mqc` — `MQC_Variable_clear_mqc` ([source](../../src/mqc_algebra2.F03#L82)) +- `MQC_Variable%MQC_Variable_clear_integer` — `MQC_Variable_clear_integer` ([source](../../src/mqc_algebra2.F03#L83)) +- `MQC_Variable%MQC_Variable_clear_real` — `MQC_Variable_clear_real` ([source](../../src/mqc_algebra2.F03#L84)) +- `MQC_Variable%MQC_Variable_clear_character` — `MQC_Variable_clear_character` ([source](../../src/mqc_algebra2.F03#L85)) +- `MQC_Variable%clear` — `MQC_Variable_clear_mqc, MQC_Variable_clear_integer, MQC_Variable_clear_real, MQC_Variable_clear_character` ([source](../../src/mqc_algebra2.F03#L86)) +- `MQC_Variable%MQC_Variable_put_MQC` — `MQC_Variable_put_MQC` ([source](../../src/mqc_algebra2.F03#L90)) +- `MQC_Variable%MQC_Variable_put_intrinsicInteger` — `MQC_Variable_put_intrinsicInteger` ([source](../../src/mqc_algebra2.F03#L91)) +- `MQC_Variable%MQC_Variable_put_intrinsicReal` — `MQC_Variable_put_intrinsicReal` ([source](../../src/mqc_algebra2.F03#L92)) +- `MQC_Variable%MQC_Variable_put_intrinsicCharacter` — `MQC_Variable_put_intrinsicCharacter` ([source](../../src/mqc_algebra2.F03#L93)) +- `MQC_Variable%putMQC` — `MQC_Variable_put_MQC` ([source](../../src/mqc_algebra2.F03#L94)) +- `MQC_Variable%put` — `MQC_Variable_put_MQC, MQC_Variable_put_intrinsicInteger, MQC_Variable_put_intrinsicReal, MQC_Variable_put_intrinsicCharacter` ([source](../../src/mqc_algebra2.F03#L95)) +- `MQC_Variable%getVal` — `MQC_Variable_get_MQC` ([source](../../src/mqc_algebra2.F03#L99)) +- `MQC_Variable%getRank` — `MQC_Variable_getRank` ([source](../../src/mqc_algebra2.F03#L100)) +- `MQC_Variable%getType` — `MQC_Variable_getType` ([source](../../src/mqc_algebra2.F03#L101)) +- `MQC_Variable%getCharacterLength` — `MQC_Variable_getCharacterLength` ([source](../../src/mqc_algebra2.F03#L102)) +- `MQC_Variable%change_case` — `MQC_Variable_Change_Case` ([source](../../src/mqc_algebra2.F03#L103)) +- `MQC_Variable%adjustl` — `MQC_Variable_AdjustL` ([source](../../src/mqc_algebra2.F03#L104)) +- `MQC_Variable%adjustr` — `MQC_Variable_AdjustR` ([source](../../src/mqc_algebra2.F03#L105)) +- `MQC_Variable%len_trim` — `MQC_Variable_Len_Trim` ([source](../../src/mqc_algebra2.F03#L106)) +- `MQC_Variable%trim` — `MQC_Variable_Trim` ([source](../../src/mqc_algebra2.F03#L107)) +- `MQC_Variable%print` — `MQC_Print_mqcVariable` ([source](../../src/mqc_algebra2.F03#L108)) +- `MQC_Variable%isConformable` — `MQC_Variable_isConformable` ([source](../../src/mqc_algebra2.F03#L109)) +- `MQC_Variable%trimZero` — `mqc_variable_trimZero` ([source](../../src/mqc_algebra2.F03#L110)) +- `MQC_Variable%trace` — `mqc_variable_matrixTrace` ([source](../../src/mqc_algebra2.F03#L111)) +- `MQC_Variable%iPower` — `MQC_Variable_integerPower` ([source](../../src/mqc_algebra2.F03#L112)) +- `MQC_Variable%rPower` — `MQC_Variable_realPower` ([source](../../src/mqc_algebra2.F03#L113)) +- `MQC_Variable%column` — `MQC_Variable_MatrixGetColumn` ([source](../../src/mqc_algebra2.F03#L114)) +- `MQC_Variable%eigen` — `MQC_Variable_Matrix_Eigensystem` ([source](../../src/mqc_algebra2.F03#L115)) +- `MQC_Variable%diag` — `MQC_Variable_DiagonalMatrix2FullMatrix` ([source](../../src/mqc_algebra2.F03#L116)) +- `MQC_Variable%det` — `MQC_Variable_Matrix_Determinant` ([source](../../src/mqc_algebra2.F03#L117)) +- `MQC_Variable%subMatrix` — `MQC_Variable_SubMatrix` ([source](../../src/mqc_algebra2.F03#L118)) + +### Generic and defined interfaces + +- `rank` ([source](../../src/mqc_algebra2.F03#L130)) +- `size` ([source](../../src/mqc_algebra2.F03#L135)) +- `reshape` ([source](../../src/mqc_algebra2.F03#L140)) +- `len` ([source](../../src/mqc_algebra2.F03#L145)) +- `adjustl` ([source](../../src/mqc_algebra2.F03#L150)) +- `adjustr` ([source](../../src/mqc_algebra2.F03#L153)) +- `len_trim` ([source](../../src/mqc_algebra2.F03#L156)) +- `trim` ([source](../../src/mqc_algebra2.F03#L159)) +- `String_Change_Case` ([source](../../src/mqc_algebra2.F03#L164)) +- `mqc` ([source](../../src/mqc_algebra2.F03#L170)) +- `int` ([source](../../src/mqc_algebra2.F03#L177)) +- `float` ([source](../../src/mqc_algebra2.F03#L180)) +- `contraction` ([source](../../src/mqc_algebra2.F03#L185)) +- `dot_product` ([source](../../src/mqc_algebra2.F03#L190)) +- `outer_product` ([source](../../src/mqc_algebra2.F03#L195)) +- `sum` ([source](../../src/mqc_algebra2.F03#L200)) +- `MQC_Variable_clear` ([source](../../src/mqc_algebra2.F03#L205)) +- `mqc_variable_fillVal` ([source](../../src/mqc_algebra2.F03#L213)) +- `mqc_variable_put` ([source](../../src/mqc_algebra2.F03#L226)) +- `mqc_print` ([source](../../src/mqc_algebra2.F03#L234)) +- `transpose` ([source](../../src/mqc_algebra2.F03#L239)) +- `MatMul` ([source](../../src/mqc_algebra2.F03#L244)) +- `MQC_Variable_Power` ([source](../../src/mqc_algebra2.F03#L249)) +- `assignment (=)` ([source](../../src/mqc_algebra2.F03#L263)) +- `operator (+)` ([source](../../src/mqc_algebra2.F03#L285)) +- `operator (-)` ([source](../../src/mqc_algebra2.F03#L290)) +- `operator (*)` ([source](../../src/mqc_algebra2.F03#L295)) +- `operator (/)` ([source](../../src/mqc_algebra2.F03#L300)) +- `operator (.conformable.)` ([source](../../src/mqc_algebra2.F03#L305)) + +### Procedure definitions + +- `MQC_Algebra2_SetIOut` — `subroutine` ([source](../../src/mqc_algebra2.F03#L372)) +- `MQC_Algebra2_SetDEBUG` — `subroutine` ([source](../../src/mqc_algebra2.F03#L391)) +- `MQC_Variable_initialize` — `subroutine` ([source](../../src/mqc_algebra2.F03#L416)) +- `MQC_Variable_getArrayPosition` — `function` ([source](../../src/mqc_algebra2.F03#L593)) +- `MQC_Variable_getLength` — `function` ([source](../../src/mqc_algebra2.F03#L644)) +- `MQC_Variable_getCharacterLength` — `function` ([source](../../src/mqc_algebra2.F03#L681)) +- `MQC_Variable_getRank` — `function` ([source](../../src/mqc_algebra2.F03#L707)) +- `MQC_Variable_getSize` — `function` ([source](../../src/mqc_algebra2.F03#L730)) +- `MQC_Variable_reshape` — `function` ([source](../../src/mqc_algebra2.F03#L778)) +- `MQC_Variable_getType` — `function` ([source](../../src/mqc_algebra2.F03#L810)) +- `MQC_Variable_getTypeCode` — `function` ([source](../../src/mqc_algebra2.F03#L851)) +- `MQC_Variable_isConformable` — `function` ([source](../../src/mqc_algebra2.F03#L896)) +- `MQC_Variable_isInitialized` — `function` ([source](../../src/mqc_algebra2.F03#L928)) +- `MQC_Variable_getShape` — `subroutine` ([source](../../src/mqc_algebra2.F03#L952)) +- `MQC_Variable_AdjustL` — `function` ([source](../../src/mqc_algebra2.F03#L989)) +- `MQC_Variable_AdjustR` — `function` ([source](../../src/mqc_algebra2.F03#L1031)) +- `MQC_Variable_Len_Trim` — `function` ([source](../../src/mqc_algebra2.F03#L1073)) +- `MQC_Variable_Trim` — `function` ([source](../../src/mqc_algebra2.F03#L1109)) +- `MQC_Variable_Change_Case` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1140)) +- `MQC_Print_mqcVariable` — `Subroutine` ([source](../../src/mqc_algebra2.F03#L1190)) +- `MQC_Variable_get_MQC` — `function` ([source](../../src/mqc_algebra2.F03#L1379)) +- `MQC_Variable_MatrixGetColumn` — `function` ([source](../../src/mqc_algebra2.F03#L1427)) +- `MQC_Variable_MatrixPermuteColumns` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1479)) +- `MQC_Variable_put_MQC` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1594)) +- `MQC_Variable_put_intrinsicInteger` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1649)) +- `MQC_Variable_put_intrinsicReal` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1696)) +- `MQC_Variable_put_intrinsicCharacter` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1742)) +- `MQC_Variable_clear_general` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1783)) +- `MQC_Variable_clear_mqc` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1871)) +- `MQC_Variable_clear_integer` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1934)) +- `MQC_Variable_clear_real` — `subroutine` ([source](../../src/mqc_algebra2.F03#L1971)) +- `MQC_Variable_clear_character` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2008)) +- `MQC_Variable_mqc2mqc_subroutine` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2041)) +- `MQC_Variable_mqc2mqc` — `function` ([source](../../src/mqc_algebra2.F03#L2093)) +- `MQC_Variable_setVal` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2116)) +- `MQC_Variable_setVal_intrinsicScalar2mqcScalar_character` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2368)) +- `MQC_Variable_setVal_intrinsicScalar2mqcScalar_integer` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2391)) +- `MQC_Variable_setVal_intrinsicScalar2mqcScalar_real` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2416)) +- `MQC_Variable_setVal_intrinsicVector2mqcVector_character` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2441)) +- `MQC_Variable_setVal_intrinsicVector2mqcVector_integer` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2463)) +- `MQC_Variable_setVal_intrinsicVector2mqcVector_real` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2488)) +- `MQC_Variable_setVal_intrinsicMatrix2mqcMatrix_integer` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2514)) +- `MQC_Variable_setVal_intrinsicMatrix2mqcMatrix_real` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2545)) +- `MQC_Variable_setVal_intrinsicRank42mqcRank4_real` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2584)) +- `MQC_Variable_mqc2intrinsicCharacterScalar` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2631)) +- `MQC_Variable_mqc2intrinsicIntegerScalar` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2661)) +- `MQC_Variable_mqc2intrinsicRealScalar` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2697)) +- `MQC_Variable_mqc2intrinsicInteger1Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2733)) +- `MQC_Variable_mqc2intrinsicReal1Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2781)) +- `MQC_Variable_mqc2intrinsicCharacter1Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2828)) +- `MQC_Variable_mqc2intrinsicInteger2Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2859)) +- `MQC_Variable_mqc2intrinsicReal2Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2901)) +- `MQC_Variable_mqc2intrinsicReal4Array` — `subroutine` ([source](../../src/mqc_algebra2.F03#L2943)) +- `MQC_Variable_from_intrinsicCharacter` — `function` ([source](../../src/mqc_algebra2.F03#L2987)) +- `MQC_Variable_from_intrinsicInteger` — `function` ([source](../../src/mqc_algebra2.F03#L3009)) +- `MQC_Variable_from_intrinsicReal` — `function` ([source](../../src/mqc_algebra2.F03#L3034)) +- `MQC_Variable_INT_Scalar` — `function` ([source](../../src/mqc_algebra2.F03#L3059)) +- `MQC_Variable_FLOAT_Scalar` — `function` ([source](../../src/mqc_algebra2.F03#L3083)) +- `MQC_Variable_Matrix_Transpose` — `function` ([source](../../src/mqc_algebra2.F03#L3107)) +- `MQC_Variable_Addition` — `function` ([source](../../src/mqc_algebra2.F03#L3198)) +- `MQC_Variable_Subtraction` — `function` ([source](../../src/mqc_algebra2.F03#L3318)) +- `MQC_Variable_Multiplication` — `function` ([source](../../src/mqc_algebra2.F03#L3434)) +- `MQC_Variable_Division` — `function` ([source](../../src/mqc_algebra2.F03#L3531)) +- `MQC_Variable_IntegerPower` — `function` ([source](../../src/mqc_algebra2.F03#L3620)) +- `mqc_variable_trimZero` — `Subroutine` ([source](../../src/mqc_algebra2.F03#L3685)) +- `MQC_Variable_RealPower` — `function` ([source](../../src/mqc_algebra2.F03#L3721)) +- `MQC_Variable_Array_Sum` — `function` ([source](../../src/mqc_algebra2.F03#L3778)) +- `MQC_Variable_SubMatrix` — `function` ([source](../../src/mqc_algebra2.F03#L3897)) +- `mqc_variable_matrixTrace` — `function` ([source](../../src/mqc_algebra2.F03#L3969)) +- `MQC_Variable_Contraction_Full` — `function` ([source](../../src/mqc_algebra2.F03#L3993)) +- `MQC_Variable_dot_product` — `function` ([source](../../src/mqc_algebra2.F03#L4066)) +- `MQC_Variable_outer_product` — `function` ([source](../../src/mqc_algebra2.F03#L4098)) +- `MQC_Variable_MatrixVector` — `function` ([source](../../src/mqc_algebra2.F03#L4179)) +- `MQC_Variable_Matrix_Multiplication` — `function` ([source](../../src/mqc_algebra2.F03#L4261)) +- `MQC_Variable_DiagonalMatrix2FullMatrix` — `function` ([source](../../src/mqc_algebra2.F03#L4401)) +- `MQC_Variable_UnitMatrix` — `function` ([source](../../src/mqc_algebra2.F03#L4441)) +- `MQC_Variable_Matrix_Eigensystem` — `subroutine` ([source](../../src/mqc_algebra2.F03#L4476)) +- `MQC_Variable_Matrix_Determinant` — `function` ([source](../../src/mqc_algebra2.F03#L4519)) + +## `src/mqc_molecule.F03` + +### Modules + +- `MQC_Molecule` ([source](../../src/mqc_molecule.F03#L22)) + +### Derived types + +- `MQC_Molecule_Data` ([source](../../src/mqc_molecule.F03#L58)) + +### Type-bound bindings + +- `MQC_Molecule_Data%print` — `MQC_Print_Nuclear_Geometry` ([source](../../src/mqc_molecule.F03#L64)) +- `MQC_Molecule_Data%getNucRep` — `MQC_Get_Nuclear_Repulsion` ([source](../../src/mqc_molecule.F03#L66)) +- `MQC_Molecule_Data%getNumAtoms` — `MQC_Molecule_Data_GetNAtoms` ([source](../../src/mqc_molecule.F03#L68)) +- `MQC_Molecule_Data%updateMolData` — `MQC_Update_Mol_Data` ([source](../../src/mqc_molecule.F03#L70)) + +### Generic and defined interfaces + +- `MQC_Print` ([source](../../src/mqc_molecule.F03#L74)) + +### Procedure definitions + +- `MQC_Molecule_Data_Allocate` — `Subroutine` ([source](../../src/mqc_molecule.F03#L116)) +- `MQC_Molecule_Data_DeAllocate` — `Subroutine` ([source](../../src/mqc_molecule.F03#L164)) +- `MQC_Molecule_Data_GetNAtoms` — `Function` ([source](../../src/mqc_molecule.F03#L206)) +- `MQC_Molecule_Data_Fill` — `Subroutine` ([source](../../src/mqc_molecule.F03#L278)) +- `MQC_Molecule_Data_Output` — `Subroutine` ([source](../../src/mqc_molecule.F03#L411)) +- `MQC_Get_Nuclear_Repulsion` — `Function` ([source](../../src/mqc_molecule.F03#L461)) +- `MQC_Get_Nuclear_Symbols` — `Function` ([source](../../src/mqc_molecule.F03#L514)) +- `mqc_print_nuclear_geometry` — `subroutine` ([source](../../src/mqc_molecule.F03#L571)) +- `mqc_element_symbol` — `function` ([source](../../src/mqc_molecule.F03#L648)) +- `mqc_atomic_number` — `function` ([source](../../src/mqc_molecule.F03#L923)) +- `MQC_Update_Mol_Data` — `Subroutine` ([source](../../src/mqc_molecule.F03#L1226)) + +## `src/mqc_est.F03` + +### Modules + +- `MQC_EST` ([source](../../src/mqc_est.F03#L29)) + +### Derived types + +- `MQC_SCF_Integral` ([source](../../src/mqc_est.F03#L75)) +- `MQC_SCF_Eigenvalues` ([source](../../src/mqc_est.F03#L163)) +- `MQC_Wavefunction` ([source](../../src/mqc_est.F03#L209)) +- `MQC_Basis_Set` ([source](../../src/mqc_est.F03#L228)) +- `MQC_PSCF_Wavefunction` ([source](../../src/mqc_est.F03#L243)) +- `MQC_Determinant_String` ([source](../../src/mqc_est.F03#L253)) +- `MQC_Determinant` ([source](../../src/mqc_est.F03#L259)) +- `mqc_twoERIs` ([source](../../src/mqc_est.F03#L272)) +- `mqc_twoERISet` ([source](../../src/mqc_est.F03#L291)) + +### Type-bound bindings + +- `MQC_SCF_Integral%print` — `mqc_print_integral` ([source](../../src/mqc_est.F03#L90)) +- `MQC_SCF_Integral%hasAlpha` — `mqc_integral_has_alpha` ([source](../../src/mqc_est.F03#L91)) +- `MQC_SCF_Integral%hasBeta` — `mqc_integral_has_beta` ([source](../../src/mqc_est.F03#L92)) +- `MQC_SCF_Integral%hasAlphaBeta` — `mqc_integral_has_alphabeta` ([source](../../src/mqc_est.F03#L93)) +- `MQC_SCF_Integral%hasBetaAlpha` — `mqc_integral_has_betaalpha` ([source](../../src/mqc_est.F03#L94)) +- `MQC_SCF_Integral%type` — `mqc_integral_array_type` ([source](../../src/mqc_est.F03#L95)) +- `MQC_SCF_Integral%blockSize` — `mqc_integral_dimension` ([source](../../src/mqc_est.F03#L96)) +- `MQC_SCF_Integral%getLabel` — `mqc_integral_array_name` ([source](../../src/mqc_est.F03#L98)) +- `MQC_SCF_Integral%addLabel` — `mqc_integral_add_name` ([source](../../src/mqc_est.F03#L100)) +- `MQC_SCF_Integral%changeType` — `mqc_integral_change_type` ([source](../../src/mqc_est.F03#L102)) +- `MQC_SCF_Integral%getBlock` — `mqc_integral_output_block` ([source](../../src/mqc_est.F03#L104)) +- `MQC_SCF_Integral%identity` — `mqc_integral_identity` ([source](../../src/mqc_est.F03#L106)) +- `MQC_SCF_Integral%init` — `mqc_integral_initialize` ([source](../../src/mqc_est.F03#L108)) +- `MQC_SCF_Integral%diag` — `mqc_scf_integral_diagonalize` ([source](../../src/mqc_est.F03#L110)) +- `MQC_SCF_Integral%svd` — `mqc_scf_integral_svd` ([source](../../src/mqc_est.F03#L112)) +- `MQC_SCF_Integral%eigensys` — `mqc_scf_integral_generalized_eigensystem` ([source](../../src/mqc_est.F03#L115)) +- `MQC_SCF_Integral%inv` — `mqc_scf_integral_inverse` ([source](../../src/mqc_est.F03#L117)) +- `MQC_SCF_Integral%trace` — `mqc_scf_integral_trace` ([source](../../src/mqc_est.F03#L119)) +- `MQC_SCF_Integral%det` — `mqc_scf_integral_determinant` ([source](../../src/mqc_est.F03#L121)) +- `MQC_SCF_Integral%norm` — `mqc_integral_norm` ([source](../../src/mqc_est.F03#L123)) +- `MQC_SCF_Integral%power` — `mqc_scf_integral_power` ([source](../../src/mqc_est.F03#L125)) +- `MQC_SCF_Integral%powerf` — `mqc_scf_integral_power_func` ([source](../../src/mqc_est.F03#L127)) +- `MQC_SCF_Integral%pinv` — `mqc_scf_integral_pinv` ([source](../../src/mqc_est.F03#L129)) +- `MQC_SCF_Integral%put` — `mqc_integral_put` ([source](../../src/mqc_est.F03#L131)) +- `MQC_SCF_Integral%at` — `mqc_integral_at` ([source](../../src/mqc_est.F03#L133)) +- `MQC_SCF_Integral%setEList` — `mqc_integral_set_energy_list` ([source](../../src/mqc_est.F03#L134)) +- `MQC_SCF_Integral%getEList` — `mqc_integral_get_energy_list` ([source](../../src/mqc_est.F03#L135)) +- `MQC_SCF_Integral%deleteEList` — `mqc_integral_delete_energy_list` ([source](../../src/mqc_est.F03#L136)) +- `MQC_SCF_Integral%ipad` — `mqc_integral_pad` ([source](../../src/mqc_est.F03#L137)) +- `MQC_SCF_Integral%esum` — `MQC_Integral_Sum_Elements` ([source](../../src/mqc_est.F03#L139)) +- `MQC_SCF_Integral%pesum` — `MQC_Integral_Partial_Sum_Elements` ([source](../../src/mqc_est.F03#L140)) +- `MQC_SCF_Integral%orbitals` — `mqc_integral_output_orbitals` ([source](../../src/mqc_est.F03#L142)) +- `MQC_SCF_Integral%swap` — `mqc_integral_swap_orbitals` ([source](../../src/mqc_est.F03#L144)) +- `MQC_SCF_Integral%combine` — `mqc_integral_combine_orbitals` ([source](../../src/mqc_est.F03#L146)) +- `MQC_SCF_Integral%update` — `mqc_integral_update_orbitals` ([source](../../src/mqc_est.F03#L148)) +- `MQC_SCF_Integral%swapODB` — `mqc_integral_swap_offDiagBlocks` ([source](../../src/mqc_est.F03#L150)) +- `MQC_SCF_Integral%outer` — `mqc_integral_outer` ([source](../../src/mqc_est.F03#L152)) +- `MQC_SCF_Integral%outer2ERI` — `mqc_integral_integral_outer_product` ([source](../../src/mqc_est.F03#L154)) +- `MQC_SCF_Integral%crossouter2ERI` — `mqc_integral_integral_crossouter_product` ([source](../../src/mqc_est.F03#L156)) +- `MQC_SCF_Integral%diagonal` — `mqc_scf_integral_diagonal_elements` ([source](../../src/mqc_est.F03#L158)) +- `MQC_SCF_Eigenvalues%print` — `mqc_print_eigenvalues` ([source](../../src/mqc_est.F03#L169)) +- `MQC_SCF_Eigenvalues%hasAlpha` — `mqc_eigenvalues_has_alpha` ([source](../../src/mqc_est.F03#L170)) +- `MQC_SCF_Eigenvalues%hasBeta` — `mqc_eigenvalues_has_beta` ([source](../../src/mqc_est.F03#L171)) +- `MQC_SCF_Eigenvalues%type` — `mqc_eigenvalues_array_type` ([source](../../src/mqc_est.F03#L172)) +- `MQC_SCF_Eigenvalues%blockSize` — `mqc_eigenvalues_dimension` ([source](../../src/mqc_est.F03#L173)) +- `MQC_SCF_Eigenvalues%init` — `mqc_eigenvalues_initialize` ([source](../../src/mqc_est.F03#L175)) +- `MQC_SCF_Eigenvalues%getLabel` — `mqc_eigenvalues_array_name` ([source](../../src/mqc_est.F03#L177)) +- `MQC_SCF_Eigenvalues%addLabel` — `mqc_eigenvalues_add_name` ([source](../../src/mqc_est.F03#L179)) +- `MQC_SCF_Eigenvalues%getBlock` — `mqc_eigenvalues_output_block` ([source](../../src/mqc_est.F03#L181)) +- `MQC_SCF_Eigenvalues%power` — `mqc_scf_eigenvalues_power` ([source](../../src/mqc_est.F03#L183)) +- `MQC_SCF_Eigenvalues%put` — `mqc_eigenvalues_put` ([source](../../src/mqc_est.F03#L186)) +- `MQC_SCF_Eigenvalues%push` — `mqc_eigenvalues_push` ([source](../../src/mqc_est.F03#L189)) +- `MQC_SCF_Eigenvalues%at` — `mqc_eigenvalues_at` ([source](../../src/mqc_est.F03#L192)) +- `MQC_SCF_Eigenvalues%outer` — `mqc_eigen_eigen_outer_product` ([source](../../src/mqc_est.F03#L194)) +- `MQC_SCF_Eigenvalues%minval` — `MQC_Eigenvalues_MinVal` ([source](../../src/mqc_est.F03#L196)) +- `MQC_SCF_Eigenvalues%maxval` — `MQC_Eigenvalues_MaxVal` ([source](../../src/mqc_est.F03#L198)) +- `MQC_SCF_Eigenvalues%minloc` — `MQC_Eigenvalues_MinLoc` ([source](../../src/mqc_est.F03#L200)) +- `MQC_SCF_Eigenvalues%maxloc` — `MQC_Eigenvalues_MaxLoc` ([source](../../src/mqc_est.F03#L202)) +- `MQC_SCF_Eigenvalues%abs` — `MQC_Eigenvalues_Abs` ([source](../../src/mqc_est.F03#L204)) +- `MQC_Wavefunction%print` — `mqc_print_wavefunction` ([source](../../src/mqc_est.F03#L223)) +- `mqc_twoERIs%print` — `mqc_print_twoERIs` ([source](../../src/mqc_est.F03#L279)) +- `mqc_twoERIs%at` — `mqc_twoERIs_at` ([source](../../src/mqc_est.F03#L280)) +- `mqc_twoERIs%blockSize` — `mqc_eris_dimension` ([source](../../src/mqc_est.F03#L282)) +- `mqc_twoERIs%hasSpinBlock` — `mqc_eris_has_spinBlock` ([source](../../src/mqc_est.F03#L283)) +- `mqc_twoERIs%getBlock` — `mqc_2eris_output_block` ([source](../../src/mqc_est.F03#L285)) +- `mqc_twoERIs%type` — `mqc_eris_array_type` ([source](../../src/mqc_est.F03#L286)) +- `mqc_twoERISet%print` — `mqc_print_twoERISet` ([source](../../src/mqc_est.F03#L296)) +- `mqc_twoERISet%erinum` — `mqc_2ERISet_get_erinum` ([source](../../src/mqc_est.F03#L297)) +- `mqc_twoERISet%eris` — `mqc_2ERISet_output_eri` ([source](../../src/mqc_est.F03#L298)) +- `mqc_twoERISet%transform` — `mqc_2ERISet_transform` ([source](../../src/mqc_est.F03#L299)) +- `mqc_twoERISet%addtoset` — `mqc_2ERISet_addtoset` ([source](../../src/mqc_est.F03#L300)) + +### Generic and defined interfaces + +- `mqc_print` ([source](../../src/mqc_est.F03#L310)) +- `Allocated` ([source](../../src/mqc_est.F03#L319)) +- `MatMul` ([source](../../src/mqc_est.F03#L325)) +- `Dot_Product` ([source](../../src/mqc_est.F03#L335)) +- `Transpose` ([source](../../src/mqc_est.F03#L340)) +- `Dagger` ([source](../../src/mqc_est.F03#L345)) +- `Contraction` ([source](../../src/mqc_est.F03#L350)) +- `PartialContraction` ([source](../../src/mqc_est.F03#L358)) +- `MQC_Matrix_UndoSpinBlockGHF` ([source](../../src/mqc_est.F03#L363)) +- `Conjg` ([source](../../src/mqc_est.F03#L369)) +- `Size` ([source](../../src/mqc_est.F03#L374)) +- `maxval` ([source](../../src/mqc_est.F03#L381)) +- `minval` ([source](../../src/mqc_est.F03#L386)) +- `maxloc` ([source](../../src/mqc_est.F03#L391)) +- `minloc` ([source](../../src/mqc_est.F03#L396)) +- `abs` ([source](../../src/mqc_est.F03#L401)) +- `intiden` ([source](../../src/mqc_est.F03#L406)) +- `Assignment (=)` ([source](../../src/mqc_est.F03#L421)) +- `Operator (+)` ([source](../../src/mqc_est.F03#L429)) +- `Operator (.sum.)` ([source](../../src/mqc_est.F03#L435)) +- `Operator (-)` ([source](../../src/mqc_est.F03#L440)) +- `Operator (*)` ([source](../../src/mqc_est.F03#L447)) +- `Operator (.ewp.)` ([source](../../src/mqc_est.F03#L453)) + +### Procedure definitions + +- `mqc_print_wavefunction` — `subroutine` ([source](../../src/mqc_est.F03#L542)) +- `mqc_print_integral` — `subroutine` ([source](../../src/mqc_est.F03#L684)) +- `mqc_print_eigenvalues` — `subroutine` ([source](../../src/mqc_est.F03#L859)) +- `mqc_print_twoERIs` — `subroutine` ([source](../../src/mqc_est.F03#L960)) +- `mqc_print_twoERISet` — `subroutine` ([source](../../src/mqc_est.F03#L1080)) +- `MQC_Integral_isAllocated` — `Function` ([source](../../src/mqc_est.F03#L1136)) +- `MQC_Eigenvalues_isAllocated` — `Function` ([source](../../src/mqc_est.F03#L1184)) +- `mqc_integral_has_alpha` — `function` ([source](../../src/mqc_est.F03#L1226)) +- `mqc_integral_has_beta` — `function` ([source](../../src/mqc_est.F03#L1266)) +- `mqc_integral_has_alphaBeta` — `function` ([source](../../src/mqc_est.F03#L1308)) +- `mqc_integral_has_betaAlpha` — `function` ([source](../../src/mqc_est.F03#L1350)) +- `mqc_eigenvalues_has_alpha` — `function` ([source](../../src/mqc_est.F03#L1392)) +- `mqc_eigenvalues_has_beta` — `function` ([source](../../src/mqc_est.F03#L1434)) +- `mqc_eris_has_spinBlock` — `function` ([source](../../src/mqc_est.F03#L1501)) +- `mqc_integral_array_type` — `function` ([source](../../src/mqc_est.F03#L1579)) +- `mqc_eigenvalues_array_type` — `function` ([source](../../src/mqc_est.F03#L1618)) +- `mqc_eris_array_type` — `function` ([source](../../src/mqc_est.F03#L1659)) +- `mqc_integral_array_name` — `function` ([source](../../src/mqc_est.F03#L1698)) +- `mqc_eigenvalues_array_name` — `function` ([source](../../src/mqc_est.F03#L1737)) +- `mqc_integral_add_name` — `subroutine` ([source](../../src/mqc_est.F03#L1782)) +- `mqc_integral_change_type` — `function` ([source](../../src/mqc_est.F03#L1836)) +- `mqc_eigenvalues_add_name` — `subroutine` ([source](../../src/mqc_est.F03#L1927)) +- `mqc_integral_dimension` — `function` ([source](../../src/mqc_est.F03#L1987)) +- `mqc_eigenvalues_dimension` — `function` ([source](../../src/mqc_est.F03#L2069)) +- `mqc_eigenvalues_initialize` — `subroutine` ([source](../../src/mqc_est.F03#L2162)) +- `mqc_eris_dimension` — `function` ([source](../../src/mqc_est.F03#L2261)) +- `mqc_twoeriSet_allocate` — `subroutine` ([source](../../src/mqc_est.F03#L2348)) +- `mqc_twoeris_allocate` — `subroutine` ([source](../../src/mqc_est.F03#L2549)) +- `mqc_integral_allocate` — `subroutine` ([source](../../src/mqc_est.F03#L2688)) +- `mqc_matrix_to_integral` — `subroutine` ([source](../../src/mqc_est.F03#L2868)) +- `mqc_eigenvalues_allocate` — `subroutine` ([source](../../src/mqc_est.F03#L2981)) +- `mqc_twoeris_transform` — `subroutine` ([source](../../src/mqc_est.F03#L3082)) +- `mqc_integral_identity` — `subroutine` ([source](../../src/mqc_est.F03#L3341)) +- `mqc_integral_identity_func` — `function` ([source](../../src/mqc_est.F03#L3436)) +- `mqc_integral_initialize` — `subroutine` ([source](../../src/mqc_est.F03#L3537)) +- `mqc_integral_output_block` — `function` ([source](../../src/mqc_est.F03#L3652)) +- `mqc_integral_output_orbitals` — `function` ([source](../../src/mqc_est.F03#L3811)) +- `mqc_integral_swap_orbitals` — `function` ([source](../../src/mqc_est.F03#L4289)) +- `mqc_integral_combine_orbitals` — `subroutine` ([source](../../src/mqc_est.F03#L4419)) +- `mqc_integral_update_orbitals` — `function` ([source](../../src/mqc_est.F03#L4788)) +- `mqc_integral_swap_offDiagBlocks` — `function` ([source](../../src/mqc_est.F03#L4871)) +- `mqc_detString_print` — `function` ([source](../../src/mqc_est.F03#L4939)) +- `mqc_eigenvalues_output_block` — `function` ([source](../../src/mqc_est.F03#L5023)) +- `mqc_2ERIs_output_block` — `function` ([source](../../src/mqc_est.F03#L5188)) +- `mqc_2ERISet_output_eri` — `function` ([source](../../src/mqc_est.F03#L5576)) +- `mqc_2ERISet_transform` — `subroutine` ([source](../../src/mqc_est.F03#L5694)) +- `mqc_2ERISet_addToSet` — `subroutine` ([source](../../src/mqc_est.F03#L5802)) +- `mqc_2ERISet_get_erinum` — `function` ([source](../../src/mqc_est.F03#L5904)) +- `mqc_set_integral2integral` — `subroutine` ([source](../../src/mqc_est.F03#L5968)) +- `mqc_integral_output_array` — `subroutine` ([source](../../src/mqc_est.F03#L6030)) +- `mqc_eigenvalues_output_array` — `subroutine` ([source](../../src/mqc_est.F03#L6129)) +- `mqc_2ERIs_output_array` — `subroutine` ([source](../../src/mqc_est.F03#L6213)) +- `mqc_integral_matrix_multiply` — `function` ([source](../../src/mqc_est.F03#L6265)) +- `mqc_matrix_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L6448)) +- `mqc_integral_pad` — `function` ([source](../../src/mqc_est.F03#L6645)) +- `mqc_integral_sum` — `function` ([source](../../src/mqc_est.F03#L6789)) +- `mqc_eri_sum` — `function` ([source](../../src/mqc_est.F03#L7049)) +- `mqc_integral_difference` — `function` ([source](../../src/mqc_est.F03#L7212)) +- `mqc_matrix_integral_difference` — `function` ([source](../../src/mqc_est.F03#L7457)) +- `mqc_eri_difference` — `function` ([source](../../src/mqc_est.F03#L7579)) +- `mqc_integral_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L7750)) +- `mqc_scalar_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L7958)) +- `mqc_integral_scalar_multiply` — `function` ([source](../../src/mqc_est.F03#L8063)) +- `mqc_element_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L8168)) +- `mqc_integral_integral_outer_product` — `function` ([source](../../src/mqc_est.F03#L8309)) +- `mqc_integral_integral_crossouter_product` — `function` ([source](../../src/mqc_est.F03#L8446)) +- `mqc_eigen_eigen_outer_product` — `function` ([source](../../src/mqc_est.F03#L8571)) +- `mqc_integral_eigenvalues_multiply` — `function` ([source](../../src/mqc_est.F03#L8665)) +- `mqc_eigenvalues_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L8797)) +- `mqc_eigenvalues_eigenvalues_multiply` — `function` ([source](../../src/mqc_est.F03#L8929)) +- `mqc_eigenvalue_eigenvalue_dotProduct` — `function` ([source](../../src/mqc_est.F03#L9029)) +- `mqc_integral_transpose` — `function` ([source](../../src/mqc_est.F03#L9124)) +- `mqc_integral_conjugate_transpose` — `function` ([source](../../src/mqc_est.F03#L9197)) +- `mqc_integral_norm` — `function` ([source](../../src/mqc_est.F03#L9284)) +- `mqc_matrix_spinBlockGHF` — `subroutine` ([source](../../src/mqc_est.F03#L9369)) +- `mqc_matrix_undoSpinBlockGHF_EigenValues` — `subroutine` ([source](../../src/mqc_est.F03#L9606)) +- `mqc_matrix_undoSpinBlockGHF_integral` — `subroutine` ([source](../../src/mqc_est.F03#L9673)) +- `mqc_scf_integral_contraction` — `function` ([source](../../src/mqc_est.F03#L9769)) +- `mqc_eri_integral_contraction` — `function` ([source](../../src/mqc_est.F03#L9870)) +- `mqc_eri_r4tensor_contraction` — `function` ([source](../../src/mqc_est.F03#L10721)) +- `mqc_eri_eri_contraction` — `function` ([source](../../src/mqc_est.F03#L10851)) +- `mqc_eri_eri_partial_contraction` — `function` ([source](../../src/mqc_est.F03#L11036)) +- `mqc_index_to_string` — `function` ([source](../../src/mqc_est.F03#L11408)) +- `mqc_eri_interaction` — `function` ([source](../../src/mqc_est.F03#L11465)) +- `mqc_scf_integral_generalized_eigensystem` — `subroutine` ([source](../../src/mqc_est.F03#L11908)) +- `mqc_scf_integral_diagonalize` — `subroutine` ([source](../../src/mqc_est.F03#L12126)) +- `mqc_scf_integral_svd` — `subroutine` ([source](../../src/mqc_est.F03#L12245)) +- `mqc_scf_integral_inverse` — `function` ([source](../../src/mqc_est.F03#L12435)) +- `mqc_scf_integral_trace` — `function` ([source](../../src/mqc_est.F03#L12495)) +- `mqc_scf_integral_determinant` — `function` ([source](../../src/mqc_est.F03#L12543)) +- `mqc_scf_integral_conjg` — `function` ([source](../../src/mqc_est.F03#L12591)) +- `mqc_integral_set_energy_list` — `subroutine` ([source](../../src/mqc_est.F03#L12658)) +- `mqc_integral_get_energy_list` — `function` ([source](../../src/mqc_est.F03#L12699)) +- `mqc_integral_delete_energy_list` — `subroutine` ([source](../../src/mqc_est.F03#L12742)) +- `mqc_integral_sum_elements` — `function` ([source](../../src/mqc_est.F03#L12784)) +- `mqc_integral_partial_sum_elements` — `function` ([source](../../src/mqc_est.F03#L12845)) +- `mqc_integral_multiply` — `function` ([source](../../src/mqc_est.F03#L13001)) +- `mqc_scf_eigenvalues_power` — `subroutine` ([source](../../src/mqc_est.F03#L13109)) +- `mqc_scf_integral_power` — `subroutine` ([source](../../src/mqc_est.F03#L13185)) +- `mqc_scf_integral_power_func` — `function` ([source](../../src/mqc_est.F03#L13279)) +- `mqc_scf_integral_pinv` — `function` ([source](../../src/mqc_est.F03#L13330)) +- `MQC_twoERIs_At` — `function` ([source](../../src/mqc_est.F03#L13487)) +- `mqc_integral_put` — `subroutine` ([source](../../src/mqc_est.F03#L14528)) +- `mqc_integral_at` — `function` ([source](../../src/mqc_est.F03#L14708)) +- `mqc_eigenvalues_at` — `function` ([source](../../src/mqc_est.F03#L14865)) +- `mqc_eigenvalues_put` — `subroutine` ([source](../../src/mqc_est.F03#L15018)) +- `mqc_eigenvalues_push` — `subroutine` ([source](../../src/mqc_est.F03#L15138)) +- `mqc_scf_transformation_matrix` — `subroutine` ([source](../../src/mqc_est.F03#L15248)) +- `mqc_scf_integral_diagonal_elements` — `function` ([source](../../src/mqc_est.F03#L15310)) +- `mqc_eigenvalues_minval` — `function` ([source](../../src/mqc_est.F03#L15376)) +- `mqc_eigenvalues_maxval` — `function` ([source](../../src/mqc_est.F03#L15451)) +- `mqc_eigenvalues_minloc` — `function` ([source](../../src/mqc_est.F03#L15526)) +- `mqc_eigenvalues_maxloc` — `function` ([source](../../src/mqc_est.F03#L15606)) +- `mqc_eigenvalues_abs` — `function` ([source](../../src/mqc_est.F03#L15675)) +- `Gen_Det_Str` — `Subroutine` ([source](../../src/mqc_est.F03#L15783)) +- `TRCI_DETS_STRING` — `subroutine` ([source](../../src/mqc_est.F03#L16146)) +- `TRCI_DETS_ARR` — `subroutine` ([source](../../src/mqc_est.F03#L16449)) +- `build_trci_ph_list` — `subroutine` ([source](../../src/mqc_est.F03#L16633)) +- `mqc_detString_to_occArray` — `function` ([source](../../src/mqc_est.F03#L16688)) +- `Slater_Condon` — `Function` ([source](../../src/mqc_est.F03#L16781)) +- `TwoERI_Trans` — `Subroutine` ([source](../../src/mqc_est.F03#L17716)) +- `mqc_integral_outer` — `function` ([source](../../src/mqc_est.F03#L20634)) +- `S2_Mat_Elem` — `Function` ([source](../../src/mqc_est.F03#L20724)) +- `MQC_Build_CI_Hamiltonian` — `Subroutine` ([source](../../src/mqc_est.F03#L21979)) +- `MQC_Build_Index_Determinant_Strings` — `Subroutine` ([source](../../src/mqc_est.F03#L22426)) +- `MQC_Get_Substring_CI_Parameters` — `Subroutine` ([source](../../src/mqc_est.F03#L22690)) +- `MQC_Get_String_From_Substring` — `Subroutine` ([source](../../src/mqc_est.F03#L22868)) +- `MQC_Build_CI_Operator` — `Subroutine` ([source](../../src/mqc_est.F03#L23033)) +- `MQC_Strings_At_Index` — `Subroutine` ([source](../../src/mqc_est.F03#L23211)) +- `MQC_SubStrings_At_Index` — `Subroutine` ([source](../../src/mqc_est.F03#L23390)) +- `MQC_Index_Strings` — `Subroutine` ([source](../../src/mqc_est.F03#L23503)) +- `MQC_Get_String_Index` — `function` ([source](../../src/mqc_est.F03#L23610)) +- `ci_vertex_weight` — `function` ([source](../../src/mqc_est.F03#L23733)) +- `build_genelogical_tree` — `subroutine` ([source](../../src/mqc_est.F03#L23843)) +- `get_string_sub_level` — `function` ([source](../../src/mqc_est.F03#L23943)) +- `get_string_nElec` — `function` ([source](../../src/mqc_est.F03#L23987)) +- `get_subLevels` — `subroutine` ([source](../../src/mqc_est.F03#L24061)) +- `get_expansion_size` — `subroutine` ([source](../../src/mqc_est.F03#L24183)) +- `get_one_gamma_matrix` — `function` ([source](../../src/mqc_est.F03#L24340)) + +## `src/mqc_matwrapper_direct.F03` + +### Modules + +- `MQC_MatWrapper` ([source](../../src/mqc_matwrapper_direct.F03#L7)) + +### Derived types + +- `MQC_MatrixFile_Layout` ([source](../../src/mqc_matwrapper_direct.F03#L74)) +- `MQC_MatrixFile_Character_Record_Layout` ([source](../../src/mqc_matwrapper_direct.F03#L86)) + +### Type-bound bindings + +- `MQC_MatrixFile_Layout%set` — `MQC_MatrixFile_Layout_Set` ([source](../../src/mqc_matwrapper_direct.F03#L82)) +- `MQC_MatrixFile_Layout%setForWrite` — `MQC_MatrixFile_Layout_Set_For_Write` ([source](../../src/mqc_matwrapper_direct.F03#L83)) + +### Procedure definitions + +- `MQC_MatrixFile_Layout_Set` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L98)) +- `MQC_MatrixFile_Layout_Set_For_Write` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L134)) +- `MQC_MatrixFile_Get_Character_Record_Layout` — `function` ([source](../../src/mqc_matwrapper_direct.F03#L158)) +- `MQC_MatrixFile_Get_Character_Write_Layout` — `function` ([source](../../src/mqc_matwrapper_direct.F03#L213)) +- `MQC_MatrixFile_Open_Read` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L259)) +- `MQC_MatrixFile_Open_Write` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L279)) +- `MQC_MatrixFile_Close` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L298)) +- `MQC_MatrixFile_Len_Array` — `function` ([source](../../src/mqc_matwrapper_direct.F03#L311)) +- `MQC_MatrixFile_Read_Header` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L323)) +- `MQC_MatrixFile_Write_Header` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L346)) +- `MQC_MatrixFile_Read_Label` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L369)) +- `MQC_MatrixFile_Write_Label` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L395)) +- `MQC_MatrixFile_Read_Character_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L422)) +- `MQC_MatrixFile_Write_Character_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L437)) +- `MQC_MatrixFile_Read_Integer_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L452)) +- `MQC_MatrixFile_Read_Real_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L463)) +- `MQC_MatrixFile_Read_Complex_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L474)) +- `MQC_MatrixFile_Read_Two_Electron` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L485)) +- `MQC_MatrixFile_Read_Indexed_Real` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L498)) +- `MQC_MatrixFile_Skip` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L518)) +- `MQC_MatrixFile_Write_AO_Two_Electron` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L527)) +- `MQC_MatrixFile_Write_Real_Array` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L539)) +- `MQC_MatrixFile_Write_Integer_Array` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L564)) +- `MQC_MatrixFile_Write_Complex_Array` — `subroutine` ([source](../../src/mqc_matwrapper_direct.F03#L589)) + +## `src/mqc_matwrapper_stub.F03` + +### Modules + +- `MQC_MatWrapper` ([source](../../src/mqc_matwrapper_stub.F03#L1)) + +### Derived types + +- `MQC_MatrixFile_Layout` ([source](../../src/mqc_matwrapper_stub.F03#L66)) +- `MQC_MatrixFile_Character_Record_Layout` ([source](../../src/mqc_matwrapper_stub.F03#L78)) + +### Type-bound bindings + +- `MQC_MatrixFile_Layout%set` — `MQC_MatrixFile_Layout_Set` ([source](../../src/mqc_matwrapper_stub.F03#L74)) +- `MQC_MatrixFile_Layout%setForWrite` — `MQC_MatrixFile_Layout_Set_For_Write` ([source](../../src/mqc_matwrapper_stub.F03#L75)) + +### Procedure definitions + +- `MQC_MatrixFile_Unsupported` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L90)) +- `MQC_MatrixFile_Layout_Set` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L104)) +- `MQC_MatrixFile_Layout_Set_For_Write` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L115)) +- `MQC_MatrixFile_Get_Character_Record_Layout` — `function` ([source](../../src/mqc_matwrapper_stub.F03#L123)) +- `MQC_MatrixFile_Get_Character_Write_Layout` — `function` ([source](../../src/mqc_matwrapper_stub.F03#L134)) +- `MQC_MatrixFile_Open_Read` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L145)) +- `MQC_MatrixFile_Open_Write` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L159)) +- `MQC_MatrixFile_Close` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L173)) +- `MQC_MatrixFile_Len_Array` — `function` ([source](../../src/mqc_matwrapper_stub.F03#L181)) +- `MQC_MatrixFile_Read_Header` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L192)) +- `MQC_MatrixFile_Write_Header` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L212)) +- `MQC_MatrixFile_Read_Label` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L232)) +- `MQC_MatrixFile_Write_Label` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L246)) +- `MQC_MatrixFile_Read_Character_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L258)) +- `MQC_MatrixFile_Write_Character_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L268)) +- `MQC_MatrixFile_Read_Integer_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L278)) +- `MQC_MatrixFile_Read_Real_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L288)) +- `MQC_MatrixFile_Read_Complex_Buffer` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L298)) +- `MQC_MatrixFile_Read_Two_Electron` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L308)) +- `MQC_MatrixFile_Read_Indexed_Real` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L320)) +- `MQC_MatrixFile_Skip` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L333)) +- `MQC_MatrixFile_Write_AO_Two_Electron` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L341)) +- `MQC_MatrixFile_Write_Real_Array` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L353)) +- `MQC_MatrixFile_Write_Integer_Array` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L367)) +- `MQC_MatrixFile_Write_Complex_Array` — `subroutine` ([source](../../src/mqc_matwrapper_stub.F03#L381)) + +## `src/mqc_gaussian.F03` + +### Modules + +- `MQC_Gaussian` ([source](../../src/mqc_gaussian.F03#L1)) + +### Derived types + +- `MQC_Gaussian_FChk_File` ([source](../../src/mqc_gaussian.F03#L75)) +- `MQC_Gaussian_Unformatted_Matrix_File` ([source](../../src/mqc_gaussian.F03#L88)) +- `MQC_Gaussian_Molecule_Data` ([source](../../src/mqc_gaussian.F03#L137)) + +### Type-bound bindings + +- `MQC_Gaussian_FChk_File%OpenFile` — `MQC_Gaussian_FChk_Open` ([source](../../src/mqc_gaussian.F03#L80)) +- `MQC_Gaussian_Unformatted_Matrix_File%OpenFile` — `MQC_Gaussian_Unformatted_Matrix_Open` ([source](../../src/mqc_gaussian.F03#L100)) +- `MQC_Gaussian_Unformatted_Matrix_File%CloseFile` — `MQC_Gaussian_Unformatted_Matrix_Close` ([source](../../src/mqc_gaussian.F03#L101)) +- `MQC_Gaussian_Unformatted_Matrix_File%load` — `MQC_Gaussian_Unformatted_Matrix_Read_Header` ([source](../../src/mqc_gaussian.F03#L102)) +- `MQC_Gaussian_Unformatted_Matrix_File%create` — `MQC_Gaussian_Unformatted_Matrix_Write_Header` ([source](../../src/mqc_gaussian.F03#L103)) +- `MQC_Gaussian_Unformatted_Matrix_File%isRestricted` — `MQC_Gaussian_IsRestricted` ([source](../../src/mqc_gaussian.F03#L104)) +- `MQC_Gaussian_Unformatted_Matrix_File%isUnrestricted` — `MQC_Gaussian_IsUnrestricted` ([source](../../src/mqc_gaussian.F03#L105)) +- `MQC_Gaussian_Unformatted_Matrix_File%isGeneral` — `MQC_Gaussian_IsGeneral` ([source](../../src/mqc_gaussian.F03#L106)) +- `MQC_Gaussian_Unformatted_Matrix_File%isComplex` — `MQC_Gaussian_IsComplex` ([source](../../src/mqc_gaussian.F03#L107)) +- `MQC_Gaussian_Unformatted_Matrix_File%getAtomicNumbers` — `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Numbers` ([source](../../src/mqc_gaussian.F03#L108)) +- `MQC_Gaussian_Unformatted_Matrix_File%getAtomCarts` — `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Carts` ([source](../../src/mqc_gaussian.F03#L109)) +- `MQC_Gaussian_Unformatted_Matrix_File%getAtomWeights` — `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Weights` ([source](../../src/mqc_gaussian.F03#L110)) +- `MQC_Gaussian_Unformatted_Matrix_File%getVal` — `MQC_Gaussian_Unformatted_Matrix_Get_Value_Integer` ([source](../../src/mqc_gaussian.F03#L111)) +- `MQC_Gaussian_Unformatted_Matrix_File%getValReal` — `MQC_Gaussian_Unformatted_Matrix_Get_Value_Real` ([source](../../src/mqc_gaussian.F03#L112)) +- `MQC_Gaussian_Unformatted_Matrix_File%getArray` — `MQC_Gaussian_Unformatted_Matrix_Read_Array` ([source](../../src/mqc_gaussian.F03#L113)) +- `MQC_Gaussian_Unformatted_Matrix_File%getAtomInfo` — `MQC_Gaussian_Unformatted_Matrix_Get_Atom_Info` ([source](../../src/mqc_gaussian.F03#L114)) +- `MQC_Gaussian_Unformatted_Matrix_File%getBasisInfo` — `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Info_Element` ([source](../../src/mqc_gaussian.F03#L115)) +- `MQC_Gaussian_Unformatted_Matrix_File%getBasisArray` — `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Info_Array` ([source](../../src/mqc_gaussian.F03#L116)) +- `MQC_Gaussian_Unformatted_Matrix_File%getBasisData` — `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Set_Matrices` ([source](../../src/mqc_gaussian.F03#L117)) +- `MQC_Gaussian_Unformatted_Matrix_File%getMolData` — `MQC_Gaussian_Unformatted_Matrix_Get_Molecule_Data` ([source](../../src/mqc_gaussian.F03#L118)) +- `MQC_Gaussian_Unformatted_Matrix_File%getESTObj` — `MQC_Gaussian_Unformatted_Matrix_Get_EST_Object` ([source](../../src/mqc_gaussian.F03#L119)) +- `MQC_Gaussian_Unformatted_Matrix_File%get2ERIObj` — `MQC_Gaussian_Unformatted_Matrix_Get_twoERIs` ([source](../../src/mqc_gaussian.F03#L120)) +- `MQC_Gaussian_Unformatted_Matrix_File%get2ERISet` — `MQC_Gaussian_Unformatted_Matrix_Get_twoERISet` ([source](../../src/mqc_gaussian.F03#L121)) +- `MQC_Gaussian_Unformatted_Matrix_File%get2ERIs` — `get2ERIObj, get2ERISet` ([source](../../src/mqc_gaussian.F03#L122)) +- `MQC_Gaussian_Unformatted_Matrix_File%writeArray2` — `MQC_Gaussian_Unformatted_Matrix_Write_Array2` ([source](../../src/mqc_gaussian.F03#L123)) +- `MQC_Gaussian_Unformatted_Matrix_File%writeArray` — `MQC_Gaussian_Unformatted_Matrix_Write_Array` ([source](../../src/mqc_gaussian.F03#L124)) +- `MQC_Gaussian_Unformatted_Matrix_File%writeBasisData` — `MQC_Gaussian_Unformatted_Matrix_Write_Basis_Set_Matrices` ([source](../../src/mqc_gaussian.F03#L125)) +- `MQC_Gaussian_Unformatted_Matrix_File%writeESTObj` — `MQC_Gaussian_Unformatted_Matrix_Write_EST_Object` ([source](../../src/mqc_gaussian.F03#L126)) +- `MQC_Gaussian_Unformatted_Matrix_File%write2ERIObj` — `MQC_Gaussian_Unformatted_Matrix_Write_twoERIs` ([source](../../src/mqc_gaussian.F03#L127)) +- `MQC_Gaussian_Unformatted_Matrix_File%write2ERISet` — `MQC_Gaussian_Unformatted_Matrix_Write_twoERISet` ([source](../../src/mqc_gaussian.F03#L128)) +- `MQC_Gaussian_Unformatted_Matrix_File%write2ERIs` — `write2ERIObj, write2ERISet` ([source](../../src/mqc_gaussian.F03#L129)) +- `MQC_Gaussian_Unformatted_Matrix_File%updateHeader` — `MQC_Gaussian_Unformatted_Matrix_Update_Header_Info` ([source](../../src/mqc_gaussian.F03#L130)) + +### Generic and defined interfaces + +- `basisType2FunctionInfo` ([source](../../src/mqc_gaussian.F03#L150)) +- `assignment (=)` ([source](../../src/mqc_gaussian.F03#L163)) + +### Procedure definitions + +- `MQC_Gaussian_SetDEBUG` — `subroutine` ([source](../../src/mqc_gaussian.F03#L183)) +- `MQC_Gaussian_ICGU` — `subroutine` ([source](../../src/mqc_gaussian.F03#L202)) +- `MQC_Gaussian_IsRestricted` — `function` ([source](../../src/mqc_gaussian.F03#L256)) +- `MQC_Gaussian_IsUnrestricted` — `function` ([source](../../src/mqc_gaussian.F03#L278)) +- `MQC_Gaussian_IsGeneral` — `function` ([source](../../src/mqc_gaussian.F03#L300)) +- `MQC_Gaussian_IsComplex` — `function` ([source](../../src/mqc_gaussian.F03#L322)) +- `MQC_Gaussian_FChk_Open` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L342)) +- `Find_FChk_Entry` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L393)) +- `MQC_Gaussian_Fill_Molecule_Data_FChk` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L529)) +- `MQC_Gaussian_Fill_Molecule_Data` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L618)) +- `MQC_Gaussian_Output_Molecule_Data` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L650)) +- `MQC_Gaussian_Unformatted_Matrix_Open` — `subroutine` ([source](../../src/mqc_gaussian.F03#L679)) +- `MQC_Gaussian_Unformatted_Matrix_Close` — `subroutine` ([source](../../src/mqc_gaussian.F03#L729)) +- `MQC_Gaussian_Unformatted_Matrix_Assign` — `subroutine` ([source](../../src/mqc_gaussian.F03#L795)) +- `MQC_Gaussian_Unformatted_Matrix_Read_Header` — `subroutine` ([source](../../src/mqc_gaussian.F03#L883)) +- `MQC_Gaussian_Unformatted_Matrix_Write_Header` — `subroutine` ([source](../../src/mqc_gaussian.F03#L1027)) +- `MQC_Gaussian_Unformatted_Matrix_Read_Array` — `subroutine` ([source](../../src/mqc_gaussian.F03#L1230)) +- `MQC_Gaussian_Unformatted_Matrix_Write_Array2` — `subroutine` ([source](../../src/mqc_gaussian.F03#L1781)) +- `MQC_Gaussian_Unformatted_Matrix_Write_Array` — `subroutine` ([source](../../src/mqc_gaussian.F03#L2020)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Atom_Info` — `Function` ([source](../../src/mqc_gaussian.F03#L2381)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Numbers` — `Function` ([source](../../src/mqc_gaussian.F03#L2444)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Carts` — `Function` ([source](../../src/mqc_gaussian.F03#L2489)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Atomic_Weights` — `Function` ([source](../../src/mqc_gaussian.F03#L2534)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Info_Element` — `Function` ([source](../../src/mqc_gaussian.F03#L2580)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Info_Array` — `Function` ([source](../../src/mqc_gaussian.F03#L2661)) +- `MQC_Gaussian_Unformatted_Matrix_Basis_Type_To_Function_Info` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L2734)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Basis_Set_Matrices` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L2778)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Molecule_Data` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L2844)) +- `MQC_Gaussian_Unformatted_Matrix_Update_Header_Info` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L2906)) +- `MQC_Gaussian_Unformatted_Matrix_Write_Basis_Set_Matrices` — `Subroutine` ([source](../../src/mqc_gaussian.F03#L3074)) +- `mqc_gaussian_unformatted_matrix_write_EST_object` — `subroutine` ([source](../../src/mqc_gaussian.F03#L3140)) +- `mqc_gaussian_unformatted_matrix_get_EST_object` — `subroutine` ([source](../../src/mqc_gaussian.F03#L3589)) +- `MQC_Gaussian_FAF_Get_3DQuadratureGrid` — `subroutine` ([source](../../src/mqc_gaussian.F03#L5280)) +- `mqc_gaussian_unformatted_matrix_get_twoERIs` — `subroutine` ([source](../../src/mqc_gaussian.F03#L5339)) +- `mqc_gaussian_unformatted_matrix_write_twoERIs` — `subroutine` ([source](../../src/mqc_gaussian.F03#L5562)) +- `mqc_gaussian_unformatted_matrix_get_twoERISet` — `subroutine` ([source](../../src/mqc_gaussian.F03#L5684)) +- `mqc_gaussian_unformatted_matrix_write_twoERISet` — `subroutine` ([source](../../src/mqc_gaussian.F03#L5810)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Value_Integer` — `Function` ([source](../../src/mqc_gaussian.F03#L5894)) +- `MQC_Gaussian_Unformatted_Matrix_Get_Value_Real` — `Function` ([source](../../src/mqc_gaussian.F03#L6003)) +- `MQC_Gaussian_Unformatted_Matrix_Array_Type` — `Function` ([source](../../src/mqc_gaussian.F03#L6097)) + +## `src/mqc_FullWavefunction.F03` + +### Modules + +- `MQC_FullWavefunction` ([source](../../src/mqc_FullWavefunction.F03#L2)) + +## `src/mqc_interface.F03` + +### Procedure definitions + +- `mqc_error_i_c2f_0` — `subroutine` ([source](../../src/mqc_interface.F03#L35)) +- `print_line_c2f` — `subroutine` ([source](../../src/mqc_interface.F03#L64)) +- `flush_c2f` — `subroutine` ([source](../../src/mqc_interface.F03#L91)) +- `mqc_create_File_Name_lists_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L106)) +- `mqc_simplify_formula_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L137)) +- `mqc_Matfile_Guide_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L168)) +- `mqc_get_MatrixFile_Name_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L218)) +- `mqc_get_FormChk_Name_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L254)) +- `mqc_File_Exists_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L289)) +- `mqc_File_Is_Executable_F2C` — `subroutine` ([source](../../src/mqc_interface.F03#L313)) +- `mqc_copy_vec` — `subroutine` ([source](../../src/mqc_interface.F03#L349)) + +## `src/mqc_util.c` + +### Procedure definitions + +- `mqc_get_MatrixFile_Name` — `C function` ([source](../../src/mqc_util.c#L73)) +- `mqc_get_FormChk_Name` — `C function` ([source](../../src/mqc_util.c#L102)) +- `mqc_create_File_Name_lists` — `C function` ([source](../../src/mqc_util.c#L134)) +- `mqc_File_Name_list` — `C function` ([source](../../src/mqc_util.c#L145)) +- `mqc_Remove_Init_WhiteSpace` — `C function` ([source](../../src/mqc_util.c#L368)) +- `mqc_Remove_Return` — `C function` ([source](../../src/mqc_util.c#L381)) +- `mqc_LOWER` — `C function` ([source](../../src/mqc_util.c#L395)) +- `mqc_FINDstrINline` — `C function` ([source](../../src/mqc_util.c#L410)) +- `mqc_Global_init` — `C function` ([source](../../src/mqc_util.c#L426)) +- `mqc_Free_Input_Link_List` — `C function` ([source](../../src/mqc_util.c#L505)) +- `mqc_Write_Input_Link_List` — `C function` ([source](../../src/mqc_util.c#L528)) +- `mqc_abort_` — `C function` ([source](../../src/mqc_util.c#L569)) +- `mqc_File_Exists` — `C function` ([source](../../src/mqc_util.c#L578)) +- `mqc_File_Is_Executable` — `C function` ([source](../../src/mqc_util.c#L590)) +- `mqc_get_scratch_dir` — `C function` ([source](../../src/mqc_util.c#L658)) +- `mqc_ASCII_or_Binary` — `C function` ([source](../../src/mqc_util.c#L673)) +- `fsize` — `C function` ([source](../../src/mqc_util.c#L914)) +- `mqc_Matfile_Guide` — `C function` ([source](../../src/mqc_util.c#L923)) +- `Invalid_int_len` — `C function` ([source](../../src/mqc_util.c#L1254)) +- `Get_Unformated_Data` — `C function` ([source](../../src/mqc_util.c#L1264)) +- `mqc_Simplify_Formula` — `C function` ([source](../../src/mqc_util.c#L1339)) diff --git a/doc/api/algebra.md b/doc/api/algebra.md new file mode 100644 index 00000000..f20e52ab --- /dev/null +++ b/doc/api/algebra.md @@ -0,0 +1,87 @@ +# Algebra objects + +Source authority: [`src/mqc_algebra.F03`](../../src/mqc_algebra.F03). + +`MQC_Algebra` provides strongly shaped numerical objects and overloaded +intrinsic-like operations. Use it when rank and storage are conceptually stable: +`MQC_Scalar`, `MQC_Vector`, `MQC_Matrix`, and `MQC_R4Tensor`. + +## Primary types + +### `MQC_Scalar` + +Holds one integer, real, or complex value. Preferred type-bound operations +include `print`, `rval`, `ival`, `cval`, `abs`, `phase`, `sqrt`, `exp`, `log`, +and `random`. Assignment and arithmetic are overloaded for intrinsic and +MQCPack scalar operands. + +### `MQC_Vector` + +Holds a rank-1 integer, real, or complex array and tracks row/column +orientation. Important methods include: + +- construction/state: `init`, `set`, `size`, `print`; +- access/mutation: `at`, `vat`, `put`, `vput`, `getArrayI`, `getArrayR`, + `getArrayC`; +- sequence operations: `push`, `unshift`, `pop`, `shift`; +- algebra: `norm`, `transpose`, `dagger`, `sum`, `product`, `power`; +- element operations: `maxval`, `minval`, `maxloc`, `minloc`, `argsort`, + `sort`, `sqrt`, `exp`, `abs`; +- diagonal construction: `diag`/`diagf`. + +### `MQC_Matrix` + +Holds rank-2 integer, real, or complex data with explicit storage metadata. +Important methods include: + +- construction/state: `init`, `identity`, `set`, `print`; +- access/mutation: `at`, `vat`, `mat`, `put`, `vput`, `mput`, `mpad`; +- transformations: `transpose`, `dagger`, `sqrt`, `exp`, `power`; +- decompositions/solves: `diag`, `svd`, `eigensys`, `inv`, `pinv`; +- invariants/inspection: `norm`, `det`, `minor`, `cofactor`, `trace`, + `diagonal`, `rmsmax`, `sum`, `psum`. + +### `MQC_R4Tensor` + +Holds rank-4 integer, real, or complex data. Its public methods cover +initialization, printing, scalar/vector/matrix/tensor access (`at`, `vat`, +`mat`, `tat`) and corresponding mutation (`put`, `vput`, `mput`, `tput`). +Tensor contractions and outer products are also available through module +generics. + +## Generics and operators + +The module overloads assignment, arithmetic, comparisons, `MatMul`, +`Dot_Product`, `Transpose`, `Dagger`, `Contraction`, `PartialContraction`, +`Reshape`, `Size`, `Allocated`, `Sum`, `Sqrt`, `Exp`, `Cmplx`, `real`, +`aimag`, and several trigonometric functions. It also defines MQCPack-specific +operators for element-wise, dot, outer, cross-outer, and contraction-related +operations. + +Always inspect the generic block for the exact supported operand pair. A +familiar intrinsic name does not imply that every intrinsic rank/type +combination is implemented for MQCPack objects. + +## Storage conventions + +Matrix and tensor storage metadata is part of the object contract. Established +matrix values include full, symmetric, diagonal, antisymmetric, Hermitian, and +anti-Hermitian forms (spelled with the `Stor...` names used in the source). +Do not directly infer a private backing-array shape or change storage metadata +without using the object's initialization/conversion routines. + +The source notes that lower-triangular matrix data is stored row by row. It also +permits diagonal elements in some symmetry storage modes for practical storage +purposes, so do not assume that a storage flag alone proves every mathematical +property of the represented matrix. + +## Choosing between algebra layers + +Use `MQC_Algebra` when code benefits from a fixed scalar/vector/matrix/tensor +type and storage-aware operations. Use [`MQC_Variable`](algebra2.md) when rank +must change dynamically, a single container must hold several intrinsic types, +or character scalar/vector data is required. + +Do not reach into private vector, matrix, or tensor arrays. Use `getArray*`, +`at`, and the documented mutation methods so allocation, type, orientation, and +storage invariants remain consistent. diff --git a/doc/api/algebra2.md b/doc/api/algebra2.md new file mode 100644 index 00000000..f7535724 --- /dev/null +++ b/doc/api/algebra2.md @@ -0,0 +1,66 @@ +# `MQC_Variable` + +Source authority: [`src/mqc_algebra2.F03`](../../src/mqc_algebra2.F03). + +`MQC_Algebra2` provides `MQC_Variable`, a flexible container whose numerical +rank can change at runtime. It supports integer, real, and complex numerical +data and character scalars/fixed-width vectors. + +## State and access + +Preferred type-bound entry points include: + +- `init`, `clear`, `put`, `putMQC`, and `getVal`; +- `getRank`, `getType`, and `getCharacterLength`; +- `print` and `isConformable`; +- numerical methods `trimZero`, `trace`, `iPower`, `rPower`, `column`, + `eigen`, `diag`, `det`, and `subMatrix`; +- character methods `change_case`, `adjustl`, `adjustr`, `len_trim`, and + scalar `trim`. + +Generic interfaces include `MQC`, `RANK`, `SIZE`, `RESHAPE`, `LEN`, +`ADJUSTL`, `ADJUSTR`, `LEN_TRIM`, `TRIM`, `String_Change_Case`, `INT`, +`FLOAT`, `Contraction`, `Dot_Product`, `MatMul`, `Transpose`, assignment, and +the supported arithmetic/operator families. + +The module also exposes public `dataType` and `storageFormat` metadata, but +consumers should prefer the query and initialization interfaces rather than +manually constructing an inconsistent object. + +## Character contract + +Character `MQC_Variable` values currently support only: + +- rank zero: one character scalar; +- rank one: a vector whose elements all have the same declared character + length. + +The backing store is a deferred-length allocatable character array. Scalar +character data uses a one-element backing array while the object reports rank +zero. Preserve that distinction and the fixed-width vector invariant. + +Character objects support assignment, `RANK`, `SIZE`, `LEN`, reshape within +the supported ranks, `MQC`, `put`, `getVal`, copying, printing, case changes, +`ADJUSTL`, `ADJUSTR`, `LEN_TRIM`, and scalar `TRIM`. Numerical operators must +not silently accept or promote character type. + +FAF/MatrixFile word sizes and `TypeA` rules do not belong in this module. +Standalone character variables may have widths that cannot be encoded as an +exact MatrixFile record; encoding validation occurs in `MQC_Gaussian` and +`MQC_MatWrapper`. + +## Intrinsic/object layering + +Reusable character algorithms operate on intrinsic values in `MQC_General`: +`mqc_adjustl`, `mqc_adjustr`, `mqc_len_trim`, `mqc_trim`, and the character +printing kernels. `MQC_Algebra2` validates object state and rank, then delegates +to those kernels. Follow the same design for extensions so intrinsic and object +callers receive consistent behavior. + +## Test reference + +`unitTests/src/unitTest02.f03` is the focused behavioral reference for character +scalar/vector assignment, rank/size/length, reshape, put/get, clear, copy, +printing, case conversion, adjustment, trimmed length, and scalar trimming. +Use it when determining whether a proposed change preserves the current +contract. diff --git a/doc/api/est.md b/doc/api/est.md new file mode 100644 index 00000000..ac5864ae --- /dev/null +++ b/doc/api/est.md @@ -0,0 +1,87 @@ +# Electronic-structure objects + +Source authority: [`src/mqc_est.F03`](../../src/mqc_est.F03). + +`MQC_EST` builds quantum-chemistry intermediates on the algebra layer. Its +array labels, basis interpretation, spin layout, and storage conventions are +scientific API. + +## Principal types + +### `MQC_SCF_Integral` + +Represents one-electron operators or related matrices using up to four spin +blocks. The source defines the generalized block arrangement as: + +```text +| alpha beta-alpha | +| alpha-beta beta | +``` + +The corresponding object components are named `Alpha`, `Beta`, `AlphaBeta`, +and `BetaAlpha`. Never interchange the off-diagonal blocks merely because their +dimensions happen to match. + +Public methods cover printing, type/dimension/label queries, initialization, +block extraction, identity construction, diagonalization, SVD, generalized +eigensystems, inverse, trace, determinant, norm, powers, pseudoinverse, +element access/mutation, energy-list management, padding, sums, orbital +selection/reordering/combination/update, off-diagonal block swapping, outer +products, and diagonal extraction. See the generated index for exact binding +names and implementations. + +`Array_Type` distinguishes established representations such as space, spin, +and general. `Array_Name` is a semantic label. Preserve both through +transformations. + +### `MQC_SCF_Eigenvalues` + +Stores alpha/beta eigenvalue vectors plus array name/type metadata. Its public +surface covers initialization, labels, block access, power, mutation, +append/access, outer products, extrema/locations, and absolute values. + +### Wavefunction and basis containers + +- `MQC_Wavefunction` groups MO coefficients, MO energies and symmetries, core + Hamiltonian, Fock, density and SCF density matrices, overlap, electron and + basis counts, charge, multiplicity, basis/symmetry labels, spin type, and a + complex/real flag. +- `MQC_Basis_Set` stores the Gaussian MatrixFile-oriented shell-to-atom map, + shell types, primitive counts/exponents, contraction coefficients, and shell + coordinates as MQCPack matrices. +- `MQC_PSCF_Wavefunction` extends the single-reference wavefunction with + core/valence/active/frozen counts, amplitudes, and energies. + +### Determinants and two-electron integrals + +- `MQC_Determinant` stores occupation strings through `MQC_Bits`, determinant + counts/order, basis/core/virtual counts, and substitution metadata. +- `mqc_twoERIs` stores spin-resolved rank-4 tensors with integral-type and + storage-type metadata. Use `getBlock`, `blockSize`, `type`, `at`, and + `print` rather than reaching into private spin blocks. +- `mqc_twoERISet` owns multiple two-electron-integral objects and provides + `erinum`, `eris`, `transform`, `addtoset`, and `print`. + +## Generic operations + +The module extends `mqc_print`, `Allocated`, `MatMul`, arithmetic and +comparison operators, contractions, outer products, and other algebraic +interfaces to EST types. Inspect the interface block before relying on an +operand pairing: supported spin structures and return types are more +constrained than an intrinsic matrix expression might suggest. + +## Checklist for EST changes + +For every input and result, state or determine: + +- AO, MO, spin-orbital, or generalized-spin basis; +- restricted, unrestricted, or general wavefunction convention; +- real or complex data; +- active spin blocks and their row/column dimensions; +- full/symmetric or specialized integral storage; +- whether energies are Hartree and whether indices include core/frozen spaces; +- semantic label expected by Gaussian or downstream code. + +Broad changes in this module can propagate through many overloads. Prefer small +changes and validate a representative restricted, unrestricted, and general +case whenever the changed code can reach all three. diff --git a/doc/api/files-and-integrals.md b/doc/api/files-and-integrals.md new file mode 100644 index 00000000..5744387d --- /dev/null +++ b/doc/api/files-and-integrals.md @@ -0,0 +1,97 @@ +# Supporting modules + +This page covers file abstractions, linked data, contracted Gaussian basis +objects, molecule data, interoperability, and the status of the higher-level +wavefunction module. + +## `MQC_Files` + +Source: [`src/mqc_files.F03`](../../src/mqc_files.F03). + +`MQC_FileInfo` is the abstract base carrying filename, open state, and unit +number; `IsOpen` queries connection state. `MQC_Text_FileInfo` adds a text +buffer, cursor and parsing controls, with bindings `OpenFile`, `CloseFile`, +`Rewind`, `LoadBuffer`, `GetBuffer`, `GetNextString`, `GetNextInteger`, and +`WriteLine`. + +Use `MQC_getUnitNumber` and the module's unit registry rather than inventing a +fixed unit in reusable library code. Keep the registry synchronized when a +derived file type closes or replaces a connection. + +Text parsing distinguishes loaded-buffer state, quote handling, repeated +delimiters, and whether a blank line means EOF. Configure those controls via +the existing parsing helpers rather than duplicating tokenization downstream. + +## `MQC_DataStructures` and `MQC_Binary` + +Sources: [`src/mqc_datastructures.F03`](../../src/mqc_datastructures.F03) and +[`src/mqc_binary.F03`](../../src/mqc_binary.F03). + +`MQC_LinkedList` stores polymorphic values and provides typed return helpers for +integer, real, character, and `MQC_Bits` data. Because storage uses `class(*)`, +callers must preserve the expected dynamic type when retrieving values. + +`MQC_Bits` represents bit strings used especially by determinant machinery. +It extends familiar bit operations through generics including `btest`, +`ibset`, `ibclr`, `iand`, `ieor`, `ior`, `popcnt`, `mvBits`, `iBits`, and +`iShft`, and provides `mqc_bits` construction and `mqc_print`/`%print`. + +## `MQC_Integrals` + +Source: [`src/mqc_integrals.F03`](../../src/mqc_integrals.F03). + +`MQC_CGTF` represents one contracted Gaussian-type shell/function object. Its +public bindings are: + +- `init`: set angular momentum, center, contraction coefficients, and primitive + exponents; +- `print`: report the object; +- `shell2nBasis`: return the number of basis functions for the shell; +- `primitiveSelfOverlap`: compute primitive self-overlap information. + +`MQC_basisSet` owns a collection of `MQC_CGTF` shells and tracks basis/shell +counts. Use `init`, `addShell`, and `print` to maintain its allocation and count +invariants. + +Angular momentum, Cartesian center, coefficient/exponent pairing, primitive +normalization, and shell ordering are scientific data. Preserve them when +mapping to Gaussian basis records or EST basis matrices. + +## `MQC_Molecule` + +Source: [`src/mqc_molecule.F03`](../../src/mqc_molecule.F03). + +`MQC_Molecule_Data` holds atom count, atomic numbers, masses, nuclear charges, +and Cartesian coordinates. Its public methods are `print`, `getNucRep`, +`getNumAtoms`, and `updateMolData`. Coordinate units and the orientation of the +3-by-`NAtoms` coordinate matrix must be explicit at call boundaries. + +The nuclear-repulsion result is meaningful only when coordinates and charges +use the expected units/conventions. Do not infer units from a variable named +only `coordinates` in downstream code. + +## C/Fortran interoperability + +Sources: [`src/mqc_interface.F03`](../../src/mqc_interface.F03) and +[`src/mqc_util.c`](../../src/mqc_util.c). + +These files bridge fixed-size Fortran character buffers and C strings for error +reporting, file-list creation, FormChk/MatrixFile discovery, file/executable +checks, scratch handling, and MatrixFile guidance. Preserve `bind(C)` names, +null termination, buffer lengths, integer conversions, and the established +Fortran-owned output path. + +Prefer the Fortran wrapper routines from Fortran callers. Calling C helpers +directly creates additional responsibility for string termination and C kind +compatibility. + +## `MQC_FullWavefunction` + +Source: [`src/mqc_FullWavefunction.F03`](../../src/mqc_FullWavefunction.F03). + +This higher-level module currently contains substantial historical and +work-in-progress code, much of it commented with active `hph` context. Do not +treat commented type sketches as public API and do not remove them as casual +cleanup. For stable downstream work, prefer the active `MQC_Gaussian` and +`MQC_EST` objects unless an active `MQC_FullWavefunction` entry point is +verified in the exact source revision. diff --git a/doc/api/gaussian.md b/doc/api/gaussian.md new file mode 100644 index 00000000..11ac28cb --- /dev/null +++ b/doc/api/gaussian.md @@ -0,0 +1,153 @@ +# Gaussian file interfaces + +Source authority: [`src/mqc_gaussian.F03`](../../src/mqc_gaussian.F03), the +GauOpen backend in +[`src/mqc_matwrapper_direct.F03`](../../src/mqc_matwrapper_direct.F03), +and the FormChk-only boundary in +[`src/mqc_matwrapper_stub.F03`](../../src/mqc_matwrapper_stub.F03). + +`MQC_Gaussian` is the public boundary for Gaussian formatted-checkpoint and +unformatted MatrixFile/FAF data. `MQC_MatWrapper` adapts MQCPack-prefixed +operations to unmodified external GauOpen sources and centralizes raw record +layout. + +`MQC_MatWrapper` is an internal backend boundary, not a supported downstream +API. Its prefixed adapter procedures are public only so `MQC_Gaussian` and +focused MQCPack tests can use the selected real or stub implementation. The +obsolete unprefixed wrapper procedures and copied GauOpen helper routines are +not compatibility interfaces. Downstream code should use the file types and +type-bound operations in `MQC_Gaussian`. + +Configure MatrixFile support explicitly with +`--with-gauopen=/path/to/gauopen --with-gauopen-integer-bytes=8`. Configure +detects one of two supported source interfaces and defines the corresponding +adapter profile: + +- public: version-2 files, logical `ASym`, `Close_MatF`, and the older + `Rd_RInd` signature; +- frontier: version-3 files, integer `TypeA`, `Close_FAF`, the newer + `Rd_RInd` signature, and `Rd_ChBuf`/`Wr_ChBuf`. + +`--with-gauopen-api=auto` is the default. An explicitly verified source tree +can be selected with `--with-gauopen-api=public` or +`--with-gauopen-api=frontier`; a requested profile that conflicts with a +recognized source interface is rejected. Use `--without-gauopen` for the +FormChk-only configuration. The integer ABI and API profile are part of the +installed library's compatibility contract; do not mix the resulting library +or module files with artifacts from another compiler or configuration. The +supported build currently uses one configured 8-byte GauOpen ABI; it does not +dispatch between 4-byte and 8-byte MatrixFiles at runtime. GauOpen's legacy +source flags are isolated from the stricter flags used for MQCPack sources. + +The FormChk-only library remains linkable through `MQC_Gaussian`, including +`MQC_Gaussian_FChk_File` and the FChk search routines. The MatrixFile type is +still declared so shared source can compile, but any MatrixFile read, write, +or layout operation terminates with an explicit diagnostic that MQCPack was +configured without GauOpen support. Callers must not use the MatrixFile type +as a runtime capability probe. + +## Public file types + +### `MQC_Gaussian_FChk_File` + +Extends `MQC_Text_FileInfo` and records the title, job type, method, and basis. +Its `OpenFile` binding opens and initializes formatted-checkpoint parsing. +`Find_FChk_Entry` and related module procedures locate typed scalar or array +entries. Treat FChk entry tags as stable compatibility keys. + +### `MQC_Gaussian_Unformatted_Matrix_File` + +Extends `MQC_FileInfo`. Preferred type-bound operations are: + +- lifecycle: `OpenFile`, `CloseFile`, `load`, `create`, `updateHeader`; +- wavefunction classification: `isRestricted`, `isUnrestricted`, `isGeneral`, + `isComplex`; +- molecule/basis access: `getAtomicNumbers`, `getAtomCarts`, `getAtomWeights`, + `getAtomInfo`, `getBasisInfo`, `getBasisArray`, `getBasisData`, `getMolData`; +- typed data: `getVal`, `getValReal`, `getArray`, `getESTObj`, `get2ERIs`; +- writing: `writeArray`, `writeArray2`, `writeBasisData`, `writeESTObj`, + `write2ERIs`. + +Use the exact signature in the source because several routines have multiple +optional destinations or dispatch according to the supplied MQCPack object. + +## Connection ownership and assignment + +Defined assignment copies persistent MatrixFile header, molecular, layout, and +cached-scalar metadata into independent destination storage. It deliberately +does not copy a live GauOpen connection. The destination is left disconnected: +blank filename, closed state, zero unit, blank read/write mode, and unset header +I/O flags. + +Assigning over an open destination closes that destination first. It must not +alter the source connection. Code that needs a connected destination must open +or create it explicitly after assignment. + +## Character FAF records + +Character data is exposed through `getArray(...,mqcVarOut=...)` and +`writeArray2`. Logical values are character scalars or rank-1 fixed-width +vectors represented by `MQC_Variable`. These operations require the frontier +GauOpen profile. Public GauOpen does not export character-buffer operations; +attempted character FAF layout or buffer operations terminate with a clear +unsupported-feature diagnostic rather than writing a partial character +record. Numerical MatrixFile operations remain supported in the public +profile for its version-2 files. Because the legacy label reader discards raw +positive `TypeA`, the public profile rejects version-3 FAF files rather than +risk silently treating a frontier character record as an integer array. + +Do not interpret raw positive `TypeA` as the element width without +normalization: + +```text +payloadCharacters = Len4L * NTot +elementWidth = payloadCharacters when raw TypeA = 1 + raw TypeA when raw TypeA > 1 +elementCount = payloadCharacters / elementWidth +bufferCharacters = Len4L * LenBuf +``` + +Raw `TypeA=1` is Gaussian's legacy marker for one scalar spanning the complete +payload. Values greater than one are explicit fixed element widths. The +translation belongs in +`MQC_MatrixFile_Get_Character_Record_Layout`; outgoing translation belongs in +`MQC_MatrixFile_Get_Character_Write_Layout`. + +When scanning past an unrequested character record, the reader must consume it +with `Rd_ChBuf`, not a numeric skip routine, or later label reads become +desynchronized. + +Outgoing exact-shape encoding currently requires: + +- element width greater than one, because `TypeA=1` has legacy scalar meaning; +- positive element count and buffer word count; +- total payload characters divisible by the target file's `Len4L`. + +These are file-format constraints, not general `MQC_Variable` restrictions. +When packing a deferred-length character buffer, initialize the full declared +length; assignment of a one-character blank can reallocate it to length one. +For real or complex array metadata, frontier `TypeA=-1` means +antisymmetric/anti-Hermitian while `TypeA=1` means symmetric/Hermitian; do not +collapse those signs when writing externally consumed records. + +## MatrixFile layout types + +`MQC_MatrixFile_Layout` stores the active integer width, file version, header +record count, `Len12L`, `Len4L`, and raw-format flag. Its `set` and +`setForWrite` methods establish per-file metadata. + +`MQC_MatrixFile_Character_Record_Layout` holds logical element count/width and +payload/buffer sizes in both characters and file words. Keep word arithmetic +at this boundary rather than leaking it into algebra objects. + +## Validation standard + +For binary encoding changes, passing an MQCPack round trip alone is not enough. +Validate both: + +1. public MQCPack write/read behavior, including skip and rewind/rescan paths; +2. independent Gaussian `dumpbaf` inspection when it is available. + +Initialize the Gaussian/GDV/MQCPack shell environment with the repository's +documented `gdvcode2026` setup before build or Gaussian work. Never combine +GauOpen objects or `.mod` files from different compilers. diff --git a/doc/api/general.md b/doc/api/general.md new file mode 100644 index 00000000..1309ef67 --- /dev/null +++ b/doc/api/general.md @@ -0,0 +1,59 @@ +# General utilities + +Source authority: [`src/mqc_general.F03`](../../src/mqc_general.F03) and +[`src/mqc_general_lapack.F03`](../../src/mqc_general_lapack.F03). + +`MQC_General` is the lowest reusable MQCPack layer. It owns constants, version +and error helpers, intrinsic-value printing and conversion, small array +kernels, packed/full storage conversions, sorting and contractions, and the +project's BLAS/LAPACK wrappers. + +## Preferred entry points + +- Versioning: `mqc_version`, `mqc_version_check`, `mqc_version_print`. +- Errors: `mqc_error` and the typed `mqc_error_*` helpers. Hard invalid input + or invalid state should use these rather than an unstructured `stop`. +- Output: `mqc_print`, `mqc_print_scalar`, `mqc_print_vector`, + `mqc_print_matrix`, and `mqc_print_r4tensor` for intrinsic character, + integer, real, complex, and supported logical arrays. +- Numeric conversion: `mqc_float`, `num2char`, `integer2character`, + `real2character`, and `complex2character`. +- Character kernels: `mqc_adjustl`, `mqc_adjustr`, `mqc_len_trim`, and scalar + `mqc_trim`. These operate on intrinsic values; `MQC_Algebra2` supplies the + corresponding `MQC_Variable` layer. +- Array/storage helpers: `mqc_packedDiagonalMatrix2FullMatrix`, + `mqc_matrixSymm2Full`, `matrixOrderedColumns`, `flatten`, and `contraction`. +- Linear solves: the `mqc_dgesv` generic dispatches matrix and vector right-hand + sides. Other BLAS/LAPACK-backed kernels are declared in this module and + implemented partly through `mqc_general_lapack.F03`. + +Consult the [procedure index](PROCEDURE_INDEX.md) for all specific overloads. + +## Numerical rules + +- Use `mqc_small` for numerical zero and threshold comparisons. +- Use `real64`, `int64`, and `int32` explicitly in new interfaces even though + supported build configurations promote default kinds. +- Use `mqc_float(...)` when converting integers or literals in mixed numerical + formulas. +- Treat packed/full conversion routines as storage transformations. Confirm the + expected packed ordering before interchanging their output with external + software. + +## Error and output behavior + +The `iOut` convention is established throughout MQCPack; unit 6 is the normal +screen output. Preserve caller-supplied output units. Public output labels may +be consumed by tests or downstream scripts and should not be casually changed. + +Character printing supports scalars and rank-1 fixed-width vectors through the +intrinsic kernels. `MQC_Variable%print` delegates to these routines, so fixes at +this layer should benefit both intrinsic and object use. + +## Use-association caution + +`MQC_General` exports a broad set of names and several later modules re-export +them through use association. When a downstream unit uses multiple MQCPack +modules, prefer `only:` lists if a generic becomes ambiguous. Do not bypass an +object-layer generic merely because its intrinsic implementation routine is +visible. diff --git a/doc/api/generate_procedure_index.py b/doc/api/generate_procedure_index.py new file mode 100644 index 00000000..f42f6a5a --- /dev/null +++ b/doc/api/generate_procedure_index.py @@ -0,0 +1,293 @@ +#!/usr/bin/env python3 +"""Generate MQCPack's source-level API inventory. + +This intentionally uses only Python's standard library. It is a lightweight +Fortran declaration scanner, not a compiler: the curated API pages remain the +authority for semantics and recommended downstream use. +""" + +from __future__ import annotations + +import argparse +import re +from dataclasses import dataclass, field +from pathlib import Path + + +FORTRAN_SOURCES = ( + "src/mqc_general.F03", + "src/mqc_general_lapack.F03", + "src/mqc_binary.F03", + "src/mqc_datastructures.F03", + "src/mqc_files.F03", + "src/mqc_integrals.F03", + "src/mqc_algebra.F03", + "src/mqc_algebra2.F03", + "src/mqc_molecule.F03", + "src/mqc_est.F03", + "src/mqc_matwrapper_direct.F03", + "src/mqc_matwrapper_stub.F03", + "src/mqc_gaussian.F03", + "src/mqc_FullWavefunction.F03", + "src/mqc_interface.F03", +) + + +@dataclass +class Entry: + name: str + line: int + detail: str = "" + + +@dataclass +class SourceInventory: + path: str + modules: list[Entry] = field(default_factory=list) + types: list[Entry] = field(default_factory=list) + bindings: list[Entry] = field(default_factory=list) + interfaces: list[Entry] = field(default_factory=list) + procedures: list[Entry] = field(default_factory=list) + + +def logical_statements(path: Path) -> list[tuple[int, str]]: + """Join ordinary free-form continuation lines and discard comments.""" + statements: list[tuple[int, str]] = [] + buffer = "" + start_line = 0 + for line_number, physical_line in enumerate( + path.read_text(encoding="utf-8", errors="replace").splitlines(), 1 + ): + code = physical_line.split("!", 1)[0].rstrip() + if not code.strip(): + continue + if not buffer: + start_line = line_number + piece = code.strip() + if buffer and piece.startswith("&"): + piece = piece[1:].lstrip() + continued = piece.endswith("&") + if continued: + piece = piece[:-1].rstrip() + buffer = f"{buffer} {piece}".strip() + if not continued: + statements.append((start_line, buffer)) + buffer = "" + if buffer: + statements.append((start_line, buffer)) + return statements + + +def parse_fortran(repo_root: Path, relative_path: str) -> SourceInventory: + inventory = SourceInventory(relative_path) + type_name: str | None = None + interface_depth = 0 + + module_re = re.compile(r"^\s*module\s+(?!procedure\b)([a-z]\w*)", re.I) + type_re = re.compile( + r"^\s*type\s*(?!\()(?!(?:is|default)\b)" + r"(?:,[^:]*)?(?:::|\s+)\s*([a-z]\w*)\s*$", + re.I, + ) + interface_re = re.compile(r"^\s*interface(?:\s+(.+?))?\s*$", re.I) + procedure_re = re.compile( + r"^\s*(?:(?:pure|elemental|recursive|impure|module)\s+)*" + r"(?:(?:integer|real|complex|logical|character|type\s*\([^)]*\)|" + r"class\s*\([^)]*\)|double\s+precision)" + r"(?:\s*\([^)]*\))?(?:\s*,[^:]*)?\s+)?" + r"(subroutine|function)\s+([a-z]\w*)\b", + re.I, + ) + binding_re = re.compile( + r"^\s*procedure(?:\s*\([^)]*\))?(?:\s*,[^:]*)?::\s*(.+)$", re.I + ) + generic_re = re.compile(r"^\s*generic(?:\s*,[^:]*)?::\s*(.+)$", re.I) + + statements = logical_statements(repo_root / relative_path) + has_module = any(module_re.match(statement) for _, statement in statements) + module_contains = not has_module + + for line_number, statement in statements: + lower = statement.lower().strip() + + module_match = module_re.match(statement) + if module_match: + inventory.modules.append(Entry(module_match.group(1), line_number)) + continue + + if re.match(r"^\s*end\s*type\b", statement, re.I): + type_name = None + continue + + if type_name is None: + type_match = type_re.match(statement) + if type_match: + type_name = type_match.group(1) + inventory.types.append(Entry(type_name, line_number)) + continue + else: + binding_match = binding_re.match(statement) + generic_match = generic_re.match(statement) + if generic_match: + declaration = generic_match.group(1).strip() + if "=>" in declaration: + binding, target = ( + part.strip() for part in declaration.split("=>", 1) + ) + else: + binding, target = declaration, declaration + inventory.bindings.append( + Entry(f"{type_name}%{binding}", line_number, target) + ) + elif binding_match: + declaration = binding_match.group(1) + for item in declaration.split(","): + item = item.strip() + if not item: + continue + if "=>" in item: + binding, target = (part.strip() for part in item.split("=>", 1)) + else: + binding, target = item, item + inventory.bindings.append( + Entry(f"{type_name}%{binding}", line_number, target) + ) + continue + + if re.match(r"^\s*end\s*interface\b", statement, re.I): + interface_depth = max(0, interface_depth - 1) + continue + + interface_match = interface_re.match(statement) + if interface_match: + interface_depth += 1 + if interface_depth == 1 and interface_match.group(1): + inventory.interfaces.append( + Entry(interface_match.group(1).strip(), line_number) + ) + continue + + if lower == "contains" and interface_depth == 0: + module_contains = True + continue + + if module_contains and interface_depth == 0 and not lower.startswith("end"): + procedure_match = procedure_re.match(statement) + if procedure_match: + inventory.procedures.append( + Entry(procedure_match.group(2), line_number, procedure_match.group(1)) + ) + + return inventory + + +def parse_c(repo_root: Path) -> SourceInventory: + relative_path = "src/mqc_util.c" + inventory = SourceInventory(relative_path) + text = (repo_root / relative_path).read_text(encoding="utf-8", errors="replace") + definition_re = re.compile( + r"(?m)^[ \t]*(?!if\b|for\b|while\b|switch\b)" + r"(?:static\s+)?(?:void|int|long|off_t|size_t|char\s*\*|FILE\s*\*)" + r"\s+([a-zA-Z_]\w*)\s*\([^;{}]*?\)\s*\{" + ) + for match in definition_re.finditer(text): + line_number = text.count("\n", 0, match.start()) + 1 + inventory.procedures.append(Entry(match.group(1), line_number, "C function")) + return inventory + + +def source_link(relative_path: str, line: int) -> str: + return f"../../{relative_path}#L{line}" + + +def render_entries(entries: list[Entry], relative_path: str, include_detail: bool) -> list[str]: + rows: list[str] = [] + seen: set[tuple[str, int, str]] = set() + for entry in entries: + key = (entry.name.lower(), entry.line, entry.detail.lower()) + if key in seen: + continue + seen.add(key) + detail = f" — `{entry.detail}`" if include_detail and entry.detail else "" + rows.append( + f"- `{entry.name}`{detail} " + f"([source]({source_link(relative_path, entry.line)}))" + ) + return rows + + +def render(inventories: list[SourceInventory]) -> str: + procedure_count = sum(len(item.procedures) for item in inventories) + binding_count = sum(len(item.bindings) for item in inventories) + lines = [ + "# MQCPack source procedure index", + "", + "> Generated by `python3 doc/api/generate_procedure_index.py`. Do not edit by hand.", + "", + "This is a source inventory, not a stability guarantee. Prefer the interfaces", + "described in [AGENT_API_GUIDE.md](../AGENT_API_GUIDE.md) and the curated API", + "pages. Many MQCPack modules do not declare a module-wide `private` default, so", + "a technically accessible implementation routine is not automatically a supported", + "downstream interface.", + "", + f"The current inventory contains {procedure_count} Fortran/C procedure definitions", + f"and {binding_count} type-bound procedure or generic bindings.", + "", + "The scanner recognizes free-form Fortran declarations and ordinary C function", + "definitions. Conditional compilation can change which entries are built, and", + "generic overload membership must still be checked in the source interface block.", + "", + ] + + for inventory in inventories: + lines.extend((f"## `{inventory.path}`", "")) + sections = ( + ("Modules", inventory.modules, False), + ("Derived types", inventory.types, False), + ("Type-bound bindings", inventory.bindings, True), + ("Generic and defined interfaces", inventory.interfaces, False), + ("Procedure definitions", inventory.procedures, True), + ) + for title, entries, include_detail in sections: + if not entries: + continue + lines.extend((f"### {title}", "")) + lines.extend(render_entries(entries, inventory.path, include_detail)) + lines.append("") + return "\n".join(lines).rstrip() + "\n" + + +def main() -> None: + default_root = Path(__file__).resolve().parents[2] + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--root", type=Path, default=default_root) + parser.add_argument( + "--output", + type=Path, + default=Path(__file__).resolve().parent / "PROCEDURE_INDEX.md", + ) + parser.add_argument( + "--check", + action="store_true", + help="fail if the existing output differs instead of rewriting it", + ) + args = parser.parse_args() + + repo_root = args.root.resolve() + inventories = [parse_fortran(repo_root, path) for path in FORTRAN_SOURCES] + inventories.append(parse_c(repo_root)) + generated = render(inventories) + + if args.check: + current = args.output.read_text(encoding="utf-8") if args.output.exists() else "" + if current != generated: + raise SystemExit( + f"{args.output} is stale; run doc/api/generate_procedure_index.py" + ) + return + + args.output.write_text(generated, encoding="utf-8") + + +if __name__ == "__main__": + main() diff --git a/examples/Build_Tests/Makefile.am b/examples/Build_Tests/Makefile.am new file mode 100644 index 00000000..c40ee185 --- /dev/null +++ b/examples/Build_Tests/Makefile.am @@ -0,0 +1,54 @@ +AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) +AM_CPPFLAGS = $(MQC_CPPFLAGS) +AM_LDFLAGS = $(MQC_LDFLAGS) +AUTOMAKE_OPTIONS = subdir-objects +TESTS_ENVIRONMENT = abs_top_srcdir='$(abs_top_srcdir)' \ + abs_top_builddir='$(abs_top_builddir)' +CLEANFILES = ../algebra2/outfile ../fullci/outfile ../hartreefock/outfile \ + unitTest07-numerical.faf + +TESTS = ../algebra2/testit.sh unitTest01 unitTest02 +check_PROGRAMS = ../algebra2/algebra_fun unitTest01 unitTest02 + +if WITH_GAUOPEN +TESTS += ../fullci/testit.sh ../hartreefock/testit.sh \ + unitTest07 +check_PROGRAMS += ../fullci/fullci ../hartreefock/hartreefock unitTest07 +if GAUOPEN_FRONTIER +TESTS += unitTest03 unitTest04 +check_PROGRAMS += unitTest03 unitTest04 +else +TESTS += test_public_gauopen_character.sh +check_PROGRAMS += unitTest03 +endif +else +TESTS += unitTest05 test_no_gauopen_matrixfile.sh +check_PROGRAMS += unitTest05 unitTest06 +endif + +___algebra2_algebra_fun_SOURCES = ../algebra2/algebra_fun.F03 +___fullci_fullci_SOURCES = ../fullci/fullci.F03 +___hartreefock_hartreefock_SOURCES = ../hartreefock/hartreefock.F03 +unitTest01_SOURCES = ../../unitTests/src/unitTest01.f03 +unitTest02_SOURCES = ../../unitTests/src/unitTest02.f03 +unitTest03_SOURCES = ../../unitTests/src/unitTest03.f03 +unitTest04_SOURCES = ../../unitTests/src/unitTest04.f03 +unitTest05_SOURCES = ../../unitTests/src/unitTest05.f03 +unitTest06_SOURCES = ../../unitTests/src/unitTest06.f03 +unitTest07_SOURCES = ../../unitTests/src/unitTest07.f03 + +EXTRA_DIST = test_no_gauopen_matrixfile.sh \ + test_public_gauopen_character.sh ../algebra2/testit.sh \ + ../algebra2/OUTPUT/out ../fullci/testit.sh ../fullci/OUTPUT/out \ + ../hartreefock/testit.sh ../hartreefock/OUTPUT/out \ + ../data/MatrixFile/rhf_h2-sto3g.mat + +LDADD = ../../src/libmqc.a ${MQC_LAPACK} ${MQC_BLAS} + +BUILD_PROGRAM_OBJECTS = ../algebra2/algebra_fun.$(OBJEXT) +if WITH_GAUOPEN +BUILD_PROGRAM_OBJECTS += ../fullci/fullci.$(OBJEXT) \ + ../hartreefock/hartreefock.$(OBJEXT) unitTest07.$(OBJEXT) +endif + +build: $(BUILD_PROGRAM_OBJECTS) diff --git a/examples/Build_Tests/test_no_gauopen_matrixfile.sh b/examples/Build_Tests/test_no_gauopen_matrixfile.sh new file mode 100755 index 00000000..4eac7202 --- /dev/null +++ b/examples/Build_Tests/test_no_gauopen_matrixfile.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +output_file="${TMPDIR:-/tmp}/mqc-no-gauopen-$$.log" +trap 'rm -f "$output_file"' EXIT HUP INT TERM + +if ./unitTest06 >"$output_file" 2>&1; then + echo "unitTest06 unexpectedly completed successfully" + cat "$output_file" + exit 1 +fi + +expected_message="MQCPack was configured without GauOpen support; MatrixFile operations are unavailable." +if ! grep -F "$expected_message" "$output_file" >/dev/null; then + echo "unitTest06 did not report the expected no-GauOpen diagnostic" + cat "$output_file" + exit 1 +fi + +echo "PASS: FormChk-only MatrixFile operation reports unsupported feature" +exit 0 diff --git a/examples/Build_Tests/test_public_gauopen_character.sh b/examples/Build_Tests/test_public_gauopen_character.sh new file mode 100755 index 00000000..90791adf --- /dev/null +++ b/examples/Build_Tests/test_public_gauopen_character.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +output_file=unitTest03-public-gauopen.out +faf_file=unitTest03-character.faf +expected_message="Character FAF I/O requires the GauOpen frontier TypeA API; the configured public GauOpen API does not provide character record support." + +if ./unitTest03 >"$output_file" 2>&1; then + echo "unitTest03 unexpectedly completed with public GauOpen" + rm -f "$output_file" "$faf_file" + exit 1 +fi + +if ! grep -F "$expected_message" "$output_file" >/dev/null 2>&1; then + echo "unitTest03 did not report the expected public-GauOpen character diagnostic" + cat "$output_file" + rm -f "$output_file" "$faf_file" + exit 1 +fi + +rm -f "$output_file" "$faf_file" +echo "PASS: public GauOpen character FAF operation reports unsupported feature" diff --git a/examples/algebra2/testit.sh b/examples/algebra2/testit.sh index 60eea79d..fa5e461e 100755 --- a/examples/algebra2/testit.sh +++ b/examples/algebra2/testit.sh @@ -1,8 +1,9 @@ #! /bin/bash -chmod 755 ../*/testit.sh -cd ../algebra2 -./algebra_fun &> outfile -diff -b -B outfile OUTPUT/out +: "${abs_top_srcdir:=$(cd ../.. && pwd)}" +: "${abs_top_builddir:=$(cd ../.. && pwd)}" +cd "${abs_top_builddir}/examples/algebra2" +./algebra_fun &> outfile +diff -b -B outfile "${abs_top_srcdir}/examples/algebra2/OUTPUT/out" diff --git a/examples/fullci/testit.sh b/examples/fullci/testit.sh index 59ed5395..83c0ea98 100755 --- a/examples/fullci/testit.sh +++ b/examples/fullci/testit.sh @@ -1,8 +1,12 @@ #! /bin/bash -x -cd ../fullci -rm outfile +: "${abs_top_srcdir:=$(cd ../.. && pwd)}" +: "${abs_top_builddir:=$(cd ../.. && pwd)}" + +cd "${abs_top_builddir}/examples/fullci" +rm -f outfile # set up the Gaussian environment +rm -rf workdir mkdir workdir cd workdir >> outfile 2>&1 echo "---------------------------------" >> ../outfile 2>&1 @@ -13,7 +17,8 @@ echo "Finished with tests designed to fail">> ../outfile echo "-------------" >> ../outfile 2>&1 echo "MatFile test">> ../outfile echo "-------------" >> ../outfile 2>&1 -cp ../../data/MatrixFile/rhf_h2-sto3g.mat . >> ../outfile +cp "${abs_top_srcdir}/examples/data/MatrixFile/rhf_h2-sto3g.mat" . \ + >> ../outfile ../fullci rhf_h2-sto3g.mat >> ../outfile cd .. rm -r workdir @@ -21,6 +26,6 @@ rm -r workdir sed -e 'sZ-0.000000Z 0.000000Zg' < outfile > outfile_tmp mv outfile_tmp outfile -diff -b -B outfile OUTPUT/out +diff -b -B outfile "${abs_top_srcdir}/examples/fullci/OUTPUT/out" exit diff --git a/examples/hartreefock/testit.sh b/examples/hartreefock/testit.sh index 393bf71f..898b0973 100755 --- a/examples/hartreefock/testit.sh +++ b/examples/hartreefock/testit.sh @@ -1,8 +1,12 @@ #! /bin/bash -x -cd ../hartreefock -rm outfile +: "${abs_top_srcdir:=$(cd ../.. && pwd)}" +: "${abs_top_builddir:=$(cd ../.. && pwd)}" + +cd "${abs_top_builddir}/examples/hartreefock" +rm -f outfile # set up the Gaussian environment +rm -rf workdir mkdir workdir cd workdir >> outfile 2>&1 echo "---------------------------------" >> ../outfile 2>&1 @@ -13,7 +17,8 @@ echo "Finished with tests designed to fail">> ../outfile echo "-------------" >> ../outfile 2>&1 echo "MatFile test">> ../outfile echo "-------------" >> ../outfile 2>&1 -cp ../../data/MatrixFile/rhf_h2-sto3g.mat . >> ../outfile +cp "${abs_top_srcdir}/examples/data/MatrixFile/rhf_h2-sto3g.mat" . \ + >> ../outfile ../hartreefock -f rhf_h2-sto3g.mat >> ../outfile cd .. rm -r workdir @@ -21,6 +26,6 @@ rm -r workdir sed -e 'sZ-0.000000Z 0.000000Zg' < outfile > outfile_tmp mv outfile_tmp outfile -diff -b -B outfile OUTPUT/out +diff -b -B outfile "${abs_top_srcdir}/examples/hartreefock/OUTPUT/out" exit diff --git a/mqc_script b/mqc_script index 3bc74db5..58551ba8 100755 --- a/mqc_script +++ b/mqc_script @@ -8,8 +8,8 @@ mqc_tmpfile="${MQC_HOME}/.other_libs/build_fcns/tmp" cd ${MQC_HOME} # -# Developers need to add to or modify the makefiles -# This needs to be done by developers only: +# Regenerate the conventional Autotools outputs when their tracked inputs are +# newer or the generated support files are absent. # chmod 755 ${MQC_HOME}/.other_libs/build_fcns/chmod_all ${MQC_HOME}/.other_libs/build_fcns/cp_all ${MQC_HOME}/.other_libs/build_fcns/rm_all ${MQC_HOME}/.other_libs/build_fcns/remove_Gau_pid ${MQC_HOME}/.other_libs/build_fcns/remove_SCRDIR > ${mqc_tmpfile} 2>&1 @@ -18,22 +18,13 @@ if [ ! -f test-driver ] || [ ! -f install-sh ] || [ ! -f missing ] || [ ! -f depcomp ] || + [ ! -f configure ] || + [ ! -f Makefile.in ] || [ ! -f src/Makefile.in ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_FormCHK ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_MatrixFile ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_FormCHK ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_MatrixFile ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/configure_FormCHK ] || - [ ! -f ${MQC_HOME}/.other_libs/build_fcns/configure_MatrixFile ] || - [ ! -L ${MQC_HOME}/configure ] || - [ ${MQC_HOME}/.other_libs/build_fcns/configure.ac_FormCHK -nt ${MQC_HOME}/.other_libs/build_fcns/configure_FormCHK ] || - [ ${MQC_HOME}/.other_libs/build_fcns/configure.ac_MatrixFile -nt ${MQC_HOME}/.other_libs/build_fcns/configure_MatrixFile ] || - [ ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_FormCHK -nt ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_FormCHK ] || - [ ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_MatrixFile -nt ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_MatrixFile ] || - [ ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_FormCHK -nt ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_FormCHK ] || - [ ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_MatrixFile -nt ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_MatrixFile ] || - [ examples/Build_Tests/Makefile.am_MatrixFile -nt examples/Build_Tests/Makefile.in ] || - [ examples/Build_Tests/Makefile.am_FormCHK -nt examples/Build_Tests/Makefile.in ] || + [ ! -f examples/Build_Tests/Makefile.in ] || + [ configure.ac -nt configure ] || + [ Makefile.am -nt Makefile.in ] || + [ examples/Build_Tests/Makefile.am -nt examples/Build_Tests/Makefile.in ] || [ src/Makefile.am -nt src/Makefile.in ]; then if [ -f Makefile ]; then make clean > ${mqc_tmpfile} 2>&1 @@ -41,47 +32,16 @@ if [ ! -f test-driver ] || cd ${MQC_HOME}/src ${MQC_HOME}/.other_libs/build_fcns/rm_all .mod > ${mqc_tmpfile} 2>&1 cd ${MQC_HOME} - rm -f Makefile.in src/Makefile.in examples/Build_Tests/Makefile.in > ${mqc_tmpfile} 2>&1 - rm -f Makefile src/Makefile examples/Build_Tests/Makefile > ${mqc_tmpfile} 2>&1 - rm -f configure.ac Makefile.am configure > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure.ac_FormCHK configure.ac - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_FormCHK Makefile.am - cd ${MQC_HOME}/examples/Build_Tests - rm -f Makefile.am Makefile.in > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_FormCHK Makefile.am - cd ${MQC_HOME} - rm -rf autom4te.cache > ${mqc_tmpfile} 2>&1 - autoreconf --install - mv configure ${MQC_HOME}/.other_libs/build_fcns/configure_FormCHK - mv Makefile.in ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_FormCHK - rm -f configure.ac Makefile.am > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure.ac_MatrixFile configure.ac - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_MatrixFile Makefile.am - cd ${MQC_HOME}/examples/Build_Tests - mv Makefile.in ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_FormCHK - rm -f Makefile.am > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_MatrixFile Makefile.am - cd ${MQC_HOME} rm -rf autom4te.cache > ${mqc_tmpfile} 2>&1 - rm -f ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_MatrixFile > ${mqc_tmpfile} 2>&1 - autoreconf --install - mv configure ${MQC_HOME}/.other_libs/build_fcns/configure_MatrixFile - mv Makefile.in ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_MatrixFile - cd ${MQC_HOME}/examples/Build_Tests - mv Makefile.in ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_MatrixFile - cd ${MQC_HOME} + autoreconf --install --force fi -# -# Done with developers only section -# - # # Should we add MatrixFile ability to the MQCPack library? # echo "MatrixFile specific information" echo "" -echo "MACPack requires gauopen to process MatrixFiles." +echo "MQCPack requires GauOpen to process MatrixFiles." echo "(If you don't have it there are instructions" echo "on how to obtain it below.)" echo "" @@ -93,28 +53,9 @@ do echo "" if [ "$INTERFACE" = "y" ]; then MQC_Use_GauOpen="y" - rm -f Makefile.in Makefile.am configure configure.ac > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure_MatrixFile configure - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure.ac_MatrixFile configure.ac - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_MatrixFile Makefile.in - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_MatrixFile Makefile.am - cd ${MQC_HOME}/examples/Build_Tests - rm -f Makefile.in Makefile.am > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_MatrixFile Makefile.in - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_MatrixFile Makefile.am elif [ "$INTERFACE" = "n" ]; then - rm -f Makefile.in Makefile.am configure configure.ac > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure_FormCHK configure - ln -s ${MQC_HOME}/.other_libs/build_fcns/configure.ac_FormCHK configure.ac - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_FormCHK Makefile.in - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_FormCHK Makefile.am - cd ${MQC_HOME}/examples/Build_Tests - rm -f Makefile.in Makefile.am > ${mqc_tmpfile} 2>&1 - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.in_example_FormCHK Makefile.in - ln -s ${MQC_HOME}/.other_libs/build_fcns/Makefile.am_example_FormCHK Makefile.am MQC_Use_GauOpen="n" fi - cd ${MQC_HOME} done export FC="g" @@ -138,7 +79,6 @@ do else MQC_INTEGER_Compiler_Flag=" " fi - MQC_L_INTEGER_Compiler_Flag="-fdefault-integer-8" MQC_Compiler="GNU" else echo "gfortran not found in path" @@ -180,7 +120,6 @@ do else MQC_INTEGER_Compiler_Flag=" " fi - MQC_L_INTEGER_Compiler_Flag="-i8" else echo "Cannot use NVidia option: nvfortran not found in path" fi @@ -213,7 +152,6 @@ do else MQC_INTEGER_Compiler_Flag=" " fi - MQC_L_INTEGER_Compiler_Flag="-integer-size 64" else echo "Cannot use Intel option. ifort not found in path" fi @@ -241,9 +179,6 @@ if [ "${MQC_CLEAN}" != "0" ]; then cd ${MQC_HOME}/src ${MQC_HOME}/.other_libs/build_fcns/rm_all .mod > ${mqc_tmpfile} 2>&1 ${MQC_HOME}/.other_libs/build_fcns/rm_all .o > ${mqc_tmpfile} 2>&1 - cd ${MQC_HOME}/src/GauOpen > ${mqc_tmpfile} 2>&1 - ${MQC_HOME}/.other_libs/build_fcns/rm_all .o > ${mqc_tmpfile} 2>&1 - rm -f qcmatrixio_4.F qcmatrix_4.F qcmatrixio_8.F qcmatrix_8.F > ${mqc_tmpfile} 2>&1 cd ${MQC_HOME}/examples/Build_Tests > ${mqc_tmpfile} 2>&1 ${MQC_HOME}/.other_libs/build_fcns/rm_all .o > ${mqc_tmpfile} 2>&1 cd ${MQC_HOME} @@ -432,25 +367,16 @@ do fi done -# Start making objects. Make the GauOpen objects first. -# Remove the library. So that is contains only what the build wants to add. +# Remove the library so it contains only the objects selected by configure. rm -f ${MQC_HOME}/src/libmqc.a -if [ ! -d "${MQC_HOME}/src/GauOpen" ]; then - mkdir ${MQC_HOME}/src/GauOpen -fi if [ "${MQC_Use_GauOpen}" = "y" ]; then # -# We are going to add MatrixFile ability to the MQC library +# Find the external, unmodified GauOpen sources. Configure and make compile +# these files directly with their dependency-specific legacy flags. # -# Build the gauopen objects that MQC requires. These objects -# will be added to the MQC library -# - cd ${MQC_HOME}/src/GauOpen > ${mqc_tmpfile} 2>&1 - - MQC_INTERFACE="g" -# First find out where the gauopen sources reside - while [ "$MQC_INTERFACE" = "g" ] + MQC_GAUOPEN_SOURCES_FOUND="n" + while [ "${MQC_GAUOPEN_SOURCES_FOUND}" = "n" ] do if [ -f ${MQC_HOME}/.other_libs/gauopen/default ]; then echo "Enter the path to the gauopen directory" @@ -464,86 +390,13 @@ if [ "${MQC_Use_GauOpen}" = "y" ]; then MQC_GAUOPEN_DIR="`cat ${MQC_HOME}/.other_libs/gauopen/default`" fi fi -# Copy and use just 2 gauopen files to a local directory. If all three files are not -# in the directory, ask again. - found="t" - if [ -d ${MQC_GAUOPEN_DIR} ]; then -# Copy qcmatrixio.F in if the local copy is different from the source - if [ -f ${MQC_GAUOPEN_DIR}/qcmatrixio.F ] && - [ -f ${MQC_GAUOPEN_DIR}/qcmatrix.F ]; then - if [ -f qcmatrixio.F ] && - [ -f qcmatrix.F ]; then -# Check that the gauopen sources are right - diff ${MQC_GAUOPEN_DIR}/qcmatrixio.F qcmatrixio.F > ${mqc_tmpfile} 2>&1 - if [ ! -s ${mqc_tmpfile} ]; then - diff ${MQC_GAUOPEN_DIR}/qcmatrix.F qcmatrix.F > ${mqc_tmpfile} 2>&1 - fi -# if the gauopen files are right, but the processed sources don't exist: - if [ ! -s ${mqc_tmpfile} ]; then - if [ ! -s qcmatrixio_4.F ] || - [ ! -s qcmatrix_4.F ] || - [ ! -s qcmatrixio_8.F ] || - [ ! -s qcmatrix_8.F ]; then - cp qcmatrix.F ${mqc_tmpfile} - fi - fi - - if [ -s ${mqc_tmpfile} ]; then - cp ${MQC_GAUOPEN_DIR}/qcmatrixio.F . - cp ${MQC_GAUOPEN_DIR}/qcmatrix.F . - chmod 755 ${MQC_HOME}/.other_libs/gauopen/Int_specific > ${mqc_tmpfile} 2>&1 - ${MQC_HOME}/.other_libs/gauopen/Int_specific > ${mqc_tmpfile} 2>&1 - fi - else - cp ${MQC_GAUOPEN_DIR}/qcmatrixio.F . - cp ${MQC_GAUOPEN_DIR}/qcmatrix.F . - chmod 755 ${MQC_HOME}/.other_libs/gauopen/Int_specific > ${mqc_tmpfile} 2>&1 - ${MQC_HOME}/.other_libs/gauopen/Int_specific > ${mqc_tmpfile} 2>&1 - fi - else - found="f" - fi -# Copy qcmatrix.F in if the local copy is different from the source - if [ "${found}" = "t" ]; then - ${FC} -c -g -O0 qcmatrixio_4.F qcmatrix_4.F > ${mqc_tmpfile} 2>&1 - ${FC} -c -g -O0 -Duse_i8 ${MQC_L_INTEGER_Compiler_Flag} qcmatrixio_8.F qcmatrix_8.F > ${mqc_tmpfile} 2>&1 - if [ ! -f qcmatrixio_4.o ]; then - rm -f qcmatrixio_8.o qcmatrix_4.o qcmatrix_8.o - elif [ ! -f qcmatrixio_8.o ]; then - rm -f qcmatrix_4.o qcmatrix_4.o qcmatrix_8.o - elif [ ! -f qcmatrix_4.o ]; then - rm -f qcmatrix_4.o qcmatrixio_8.o qcmatrix_8.o - elif [ ! -f qcmatrix_8.o ]; then - rm -f qcmatrix_4.o qcmatrixio_8.o qcmatrix_4.o - fi - if [ -f qcmatrix_4.o ]; then - MQC_INTERFACE="y" - echo ${MQC_GAUOPEN_DIR} > ${MQC_HOME}/.other_libs/gauopen/default 2>&1 - else - echo "" - echo "Failed to build the required gauopen routines." - echo "The next `wc -l ${mqc_tmpfile}` lines are the output of make:" - cat ${mqc_tmpfile} - echo "" - echo "" - fi - rm -r ${mqc_tmpfile} - else - echo "" - echo "Did not find required gauopen sources." - echo "Please check that the directory that you supplied" - echo "is readable and contains:" - echo " qcmatrixio.F " - echo " qcmatrix.F" - echo "If you need to get gauopen:" - echo " - Go to http://gaussian.com/interfacing/" - echo " - Choose the Download tab" - echo " - Choose to Download" - echo "" - fi + if [ -f "${MQC_GAUOPEN_DIR}/qcmatrixio.F" ] && + [ -f "${MQC_GAUOPEN_DIR}/qcmatrix.F" ]; then + MQC_GAUOPEN_SOURCES_FOUND="y" + echo "${MQC_GAUOPEN_DIR}" > ${MQC_HOME}/.other_libs/gauopen/default else echo "" - echo "You entered \'${MQC_GAUOPEN_DIR}\' which is not a directory" + echo "The GauOpen directory must contain qcmatrixio.F and qcmatrix.F." echo "If you need to get gauopen:" echo " - Go to http://gaussian.com/interfacing/" echo " - Choose the Download tab" @@ -551,18 +404,6 @@ if [ "${MQC_Use_GauOpen}" = "y" ]; then echo "" fi done -# -# Done building gauopen -# -else - cd ${MQC_HOME}/src/GauOpen - rm -f qcmatrixio.F qcmatrix.F > ${mqc_tmpfile} 2>&1 - cp ${MQC_HOME}/.other_libs/gauopen/qcmatrixio_4.F . - cp ${MQC_HOME}/.other_libs/gauopen/qcmatrix_4.F . - cp ${MQC_HOME}/.other_libs/gauopen/qcmatrixio_8.F . - cp ${MQC_HOME}/.other_libs/gauopen/qcmatrix_8.F . - ${FC} -c -g -O0 qcmatrixio_4.F qcmatrix_4.F > ${mqc_tmpfile} 2>&1 - ${FC} -c -g -O0 -Duse_i8 ${MQC_L_INTEGER_Compiler_Flag} qcmatrixio_8.F qcmatrix_8.F > ${mqc_tmpfile} 2>&1 fi cd ${MQC_HOME} @@ -570,7 +411,16 @@ cd ${MQC_HOME} # Now build the MQCPack library. # chmod 755 ./configure > ${mqc_tmpfile} 2>&1 -./configure --prefix=${MQC_INSTALLATIONDIR} --silent +if [ "${MQC_Use_GauOpen}" = "y" ]; then + MQC_CONFIGURE_GAUOPEN_ARGS=( + "--with-gauopen=${MQC_GAUOPEN_DIR}" + "--with-gauopen-integer-bytes=8" + ) +else + MQC_CONFIGURE_GAUOPEN_ARGS=("--without-gauopen") +fi +./configure --prefix=${MQC_INSTALLATIONDIR} \ + "${MQC_CONFIGURE_GAUOPEN_ARGS[@]}" --silent make MQC_LAPACK=${MQC_LAPACK} MQC_BLAS=${MQC_BLAS} stat=$? if [ $stat -ne 0 ] ; then @@ -721,23 +571,20 @@ if [ "${MQC_RUN_GAU}" = "y" ]; then # Save the working GAUSS_SCRDIR for use as default next time echo ${GAUSS_SCRDIR} > ${MQC_HOME}/.other_libs/gaussian/default_scratch 2>&1 # Use the script that will run Gaussian - rm -f ${MQC_HOME}/examples/DataSummary/testit.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ${MQC_HOME}/examples/SCFenergy/testit.sh ${MQC_HOME}/examples/WriteTest/testit.sh + rm -f ${MQC_HOME}/examples/DataSummary/testit.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ${MQC_HOME}/examples/SCFenergy/testit.sh ln -s ${MQC_HOME}/examples/DataSummary/testit_runGau.sh ${MQC_HOME}/examples/DataSummary/testit.sh ln -s ${MQC_HOME}/examples/PrintAllData/testit_runGau.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ln -s ${MQC_HOME}/examples/SCFenergy/testit_runGau.sh ${MQC_HOME}/examples/SCFenergy/testit.sh - ln -s ${MQC_HOME}/examples/WriteTest/testit_runGau.sh ${MQC_HOME}/examples/WriteTest/testit.sh else # Use the script that will not run Gaussian - rm -f ${MQC_HOME}/examples/DataSummary/testit.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ${MQC_HOME}/examples/SCFenergy/testit.sh ${MQC_HOME}/examples/WriteTest/testit.sh + rm -f ${MQC_HOME}/examples/DataSummary/testit.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ${MQC_HOME}/examples/SCFenergy/testit.sh ln -s ${MQC_HOME}/examples/DataSummary/testit_no_runGau.sh ${MQC_HOME}/examples/DataSummary/testit.sh ln -s ${MQC_HOME}/examples/PrintAllData/testit_no_runGau.sh ${MQC_HOME}/examples/PrintAllData/testit.sh ln -s ${MQC_HOME}/examples/SCFenergy/testit_no_runGau.sh ${MQC_HOME}/examples/SCFenergy/testit.sh - ln -s ${MQC_HOME}/examples/WriteTest/testit_no_runGau.sh ${MQC_HOME}/examples/WriteTest/testit.sh fi chmod 755 ${MQC_HOME}/examples/DataSummary/testit.sh > ${mqc_tmpfile} 2>&1 chmod 755 ${MQC_HOME}/examples/PrintAllData/testit.sh > ${mqc_tmpfile} 2>&1 chmod 755 ${MQC_HOME}/examples/SCFenergy/testit.sh > ${mqc_tmpfile} 2>&1 -chmod 755 ${MQC_HOME}/examples/WriteTest/testit.sh > ${mqc_tmpfile} 2>&1 # These functions are required because BASH has a problem with '*' ${MQC_HOME}/.other_libs/build_fcns/chmod_all > ${mqc_tmpfile} 2>&1 @@ -765,9 +612,5 @@ fi rm -f make.install.log -${MQC_HOME}/.other_libs/build_fcns/cp_all src .mod ${MQC_INSTALLATIONDIR}/mod > ${mqc_tmpfile} 2>&1 -rm -f ${mqc_tmpfile} - echo "Successfully Finished! with installation and testing" exit - diff --git a/releaseNotes.txt b/releaseNotes.txt index e9a0c744..1fd24a33 100644 --- a/releaseNotes.txt +++ b/releaseNotes.txt @@ -8,6 +8,11 @@ number updates will be documented here. Note that the minor version number will often be updated near the start of the month and the revision number in that case will be set to 0. +July 30, 2026 +* MQCPack version set to 26.7.2. +* This version has a new set of build files using automake to streamline + future expansions, including unit tests and other validation tests. + July 13, 2026 * MQCPack version set to 26.7.1. * Added support for writing character scalar and fixed-width vector diff --git a/src/Makefile.am b/src/Makefile.am index d3c1e678..7a9d8245 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,8 +1,66 @@ AM_FCFLAGS = $(MQC_SPECIFIC_FCFLAGS) AM_CPPFLAGS = $(MQC_CPPFLAGS) +mqcmoddir = $(prefix)/mod +MQC_MODULE_FILES = mqc_general.mod mqc_binary.mod \ + mqc_datastructures.mod mqc_files.mod mqc_integrals.mod \ + mqc_algebra.mod mqc_algebra2.mod mqc_molecule.mod mqc_est.mod \ + mqc_matwrapper.mod mqc_gaussian.mod mqc_fullwavefunction.mod +nodist_mqcmod_DATA = $(MQC_MODULE_FILES) +EXTRA_DIST = mqc_general_lapack.F03 lib_LIBRARIES = libmqc.a -libmqc_a_LIBADD = GauOpen/qcmatrix_4.o GauOpen/qcmatrix_8.o GauOpen/qcmatrixio_4.o GauOpen/qcmatrixio_8.o -libmqc_a_SOURCES = mqc_general.F03 mqc_binary.F03 mqc_datastructures.F03 mqc_files.F03 mqc_integrals.F03 mqc_algebra.F03 mqc_algebra2.F03 mqc_molecule.F03 mqc_est.F03 mqc_util.c mqc_matwrapper.F03 mqc_gaussian.F03 mqc_FullWavefunction.F03 mqc_interface.F03 -build: mqc_general.$(OBJEXT) mqc_binary.$(OBJEXT) mqc_datastructures.$(OBJEXT) mqc_files.$(OBJEXT) mqc_integrals.$(OBJEXT) mqc_algebra.$(OBJEXT) mqc_algebra2.$(OBJEXT) mqc_molecule.$(OBJEXT) mqc_est.$(OBJEXT) mqc_util.$(OBJEXT) mqc_matwrapper.$(OBJEXT) mqc_gaussian.$(OBJEXT) mqc_FullWavefunction.$(OBJEXT) mqc_interface.$(OBJEXT) +CLEANFILES = gauopen_qcmatrix.$(OBJEXT) gauopen_qcmatrixio.$(OBJEXT) \ + $(MQC_MODULE_FILES) +if WITH_GAUOPEN +libmqc_a_LIBADD = gauopen_qcmatrix.$(OBJEXT) gauopen_qcmatrixio.$(OBJEXT) +endif +libmqc_a_SOURCES = mqc_general.F03 mqc_binary.F03 mqc_datastructures.F03 mqc_files.F03 mqc_integrals.F03 mqc_algebra.F03 mqc_algebra2.F03 mqc_molecule.F03 mqc_est.F03 mqc_util.c +if WITH_GAUOPEN +libmqc_a_SOURCES += mqc_matwrapper_direct.F03 +else +libmqc_a_SOURCES += mqc_matwrapper_stub.F03 +endif +libmqc_a_SOURCES += mqc_gaussian.F03 mqc_FullWavefunction.F03 mqc_interface.F03 +build: $(libmqc_a_OBJECTS) +mqc_binary.$(OBJEXT): mqc_general.$(OBJEXT) +mqc_datastructures.$(OBJEXT): mqc_general.$(OBJEXT) \ + mqc_binary.$(OBJEXT) +mqc_files.$(OBJEXT): mqc_general.$(OBJEXT) +mqc_integrals.$(OBJEXT): mqc_general.$(OBJEXT) \ + mqc_datastructures.$(OBJEXT) +mqc_algebra.$(OBJEXT): mqc_general.$(OBJEXT) +mqc_algebra2.$(OBJEXT): mqc_general.$(OBJEXT) +mqc_molecule.$(OBJEXT): mqc_general.$(OBJEXT) mqc_algebra.$(OBJEXT) \ + mqc_datastructures.$(OBJEXT) mqc_files.$(OBJEXT) +mqc_est.$(OBJEXT): mqc_general.$(OBJEXT) mqc_binary.$(OBJEXT) \ + mqc_algebra.$(OBJEXT) mqc_datastructures.$(OBJEXT) \ + mqc_files.$(OBJEXT) +mqc_matwrapper_direct.$(OBJEXT): mqc_general.$(OBJEXT) +mqc_matwrapper_stub.$(OBJEXT): mqc_general.$(OBJEXT) +if WITH_GAUOPEN +MQC_MATWRAPPER_OBJECT = mqc_matwrapper_direct.$(OBJEXT) +else +MQC_MATWRAPPER_OBJECT = mqc_matwrapper_stub.$(OBJEXT) +endif +mqc_gaussian.$(OBJEXT): mqc_general.$(OBJEXT) mqc_files.$(OBJEXT) \ + mqc_algebra.$(OBJEXT) mqc_algebra2.$(OBJEXT) mqc_est.$(OBJEXT) \ + mqc_molecule.$(OBJEXT) $(MQC_MATWRAPPER_OBJECT) +mqc_FullWavefunction.$(OBJEXT): mqc_algebra.$(OBJEXT) \ + mqc_datastructures.$(OBJEXT) mqc_files.$(OBJEXT) \ + mqc_est.$(OBJEXT) mqc_gaussian.$(OBJEXT) +mqc_interface.$(OBJEXT): mqc_general.$(OBJEXT) + +$(MQC_MODULE_FILES): libmqc.a + @test -f $@ || { \ + echo "Expected Fortran module file $@ was not generated." >&2; \ + exit 1; \ + } + +if WITH_GAUOPEN +gauopen_qcmatrix.$(OBJEXT): $(MQC_GAUOPEN_DIR)/qcmatrix.F + $(FC) $(MQC_GAUOPEN_FCFLAGS) -c -o $@ "$<" + +gauopen_qcmatrixio.$(OBJEXT): $(MQC_GAUOPEN_DIR)/qcmatrixio.F + $(FC) $(MQC_GAUOPEN_FCFLAGS) -c -o $@ "$<" +endif diff --git a/src/mqc_FullWavefunction.F03 b/src/mqc_FullWavefunction.F03 index 79b46877..6d25d719 100644 --- a/src/mqc_FullWavefunction.F03 +++ b/src/mqc_FullWavefunction.F03 @@ -11,8 +11,8 @@ module MQC_FullWavefunction ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_algebra.F03 b/src/mqc_algebra.F03 index 40fab08b..1500d3ca 100644 --- a/src/mqc_algebra.F03 +++ b/src/mqc_algebra.F03 @@ -43,8 +43,8 @@ Module MQC_Algebra ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_algebra2.F03 b/src/mqc_algebra2.F03 index bba03046..3198a67c 100644 --- a/src/mqc_algebra2.F03 +++ b/src/mqc_algebra2.F03 @@ -12,8 +12,8 @@ Module MQC_Algebra2 ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** @@ -997,6 +997,7 @@ function MQC_Variable_AdjustL(mqcVariable) result(mqcVariableOut) implicit none class(MQC_Variable),intent(in)::mqcVariable type(MQC_Variable)::mqcVariableOut + integer(kind=int64)::iCharacter ! ! if(.not.mqcVariable%initialized) & @@ -1012,8 +1013,10 @@ function MQC_Variable_AdjustL(mqcVariable) result(mqcVariableOut) mqcVariableOut%characterArray(1) = & mqc_adjustl(mqcVariable%characterArray(1)) case(1) - mqcVariableOut%characterArray = & - mqc_adjustl(mqcVariable%characterArray) + do iCharacter = 1,SIZE(mqcVariable%characterArray) + mqcVariableOut%characterArray(iCharacter) = & + mqc_adjustl(mqcVariable%characterArray(iCharacter)) + endDo case default call mqc_error_i('ADJUSTL found an unsupported character '// & 'MQC_Variable rank.',6,'RANK(mqcVariable)',RANK(mqcVariable)) @@ -1036,6 +1039,7 @@ function MQC_Variable_AdjustR(mqcVariable) result(mqcVariableOut) implicit none class(MQC_Variable),intent(in)::mqcVariable type(MQC_Variable)::mqcVariableOut + integer(kind=int64)::iCharacter ! ! if(.not.mqcVariable%initialized) & @@ -1051,8 +1055,10 @@ function MQC_Variable_AdjustR(mqcVariable) result(mqcVariableOut) mqcVariableOut%characterArray(1) = & mqc_adjustr(mqcVariable%characterArray(1)) case(1) - mqcVariableOut%characterArray = & - mqc_adjustr(mqcVariable%characterArray) + do iCharacter = 1,SIZE(mqcVariable%characterArray) + mqcVariableOut%characterArray(iCharacter) = & + mqc_adjustr(mqcVariable%characterArray(iCharacter)) + endDo case default call mqc_error_i('ADJUSTR found an unsupported character '// & 'MQC_Variable rank.',6,'RANK(mqcVariable)',RANK(mqcVariable)) diff --git a/src/mqc_binary.F03 b/src/mqc_binary.F03 index 11db4627..29337de5 100644 --- a/src/mqc_binary.F03 +++ b/src/mqc_binary.F03 @@ -10,8 +10,8 @@ module MQC_Binary ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_datastructures.F03 b/src/mqc_datastructures.F03 index 81e99aeb..34d3e90d 100644 --- a/src/mqc_datastructures.F03 +++ b/src/mqc_datastructures.F03 @@ -10,8 +10,8 @@ Module MQC_DataStructures ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_est.F03 b/src/mqc_est.F03 index 556f6d3c..662c4243 100644 --- a/src/mqc_est.F03 +++ b/src/mqc_est.F03 @@ -38,8 +38,8 @@ Module MQC_EST ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_files.F03 b/src/mqc_files.F03 index e0fddad5..40f56f52 100644 --- a/src/mqc_files.F03 +++ b/src/mqc_files.F03 @@ -10,8 +10,8 @@ Module MQC_Files ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_gaussian.F03 b/src/mqc_gaussian.F03 index 4976dcfb..8ac2852c 100644 --- a/src/mqc_gaussian.F03 +++ b/src/mqc_gaussian.F03 @@ -10,8 +10,8 @@ Module MQC_Gaussian ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** @@ -37,7 +37,30 @@ Module MQC_Gaussian USE MQC_Algebra2 USE MQC_EST USE MQC_molecule - USE MQC_matwrapper + use MQC_MatWrapper, only: MQC_MatrixFile_Layout, & + MQC_MatrixFile_Character_Record_Layout, & + MQC_MatrixFile_Get_Character_Record_Layout, & + MQC_MatrixFile_Get_Character_Write_Layout, & + Close_MatF => MQC_MatrixFile_Close, & + Open_Read => MQC_MatrixFile_Open_Read, & + Open_Write => MQC_MatrixFile_Open_Write, & + LenArr => MQC_MatrixFile_Len_Array, & + Rd_Head => MQC_MatrixFile_Read_Header, & + Wr_Head => MQC_MatrixFile_Write_Header, & + Rd_Labl_TypeA => MQC_MatrixFile_Read_Label, & + Wr_Labl_TypeA => MQC_MatrixFile_Write_Label, & + Rd_ChBuf => MQC_MatrixFile_Read_Character_Buffer, & + Wr_ChBuf => MQC_MatrixFile_Write_Character_Buffer, & + Rd_IBuf => MQC_MatrixFile_Read_Integer_Buffer, & + Rd_RBuf => MQC_MatrixFile_Read_Real_Buffer, & + Rd_CBuf => MQC_MatrixFile_Read_Complex_Buffer, & + Rd_2EN => MQC_MatrixFile_Read_Two_Electron, & + Rd_RInd => MQC_MatrixFile_Read_Indexed_Real, & + Rd_Skip => MQC_MatrixFile_Skip, & + Wr_LAO2E => MQC_MatrixFile_Write_AO_Two_Electron, & + Wr_LRBuf => MQC_MatrixFile_Write_Real_Array, & + Wr_LIBuf => MQC_MatrixFile_Write_Integer_Array, & + Wr_LCBuf => MQC_MatrixFile_Write_Complex_Array USE iso_fortran_env ! !---------------------------------------------------------------- @@ -1155,6 +1178,10 @@ subroutine MQC_Gaussian_Unformatted_Matrix_Write_Header(fileinfo, & allocate(fileinfo%basisFunction2Atom(fileinfo%NBasis)) fileinfo%basisFunction2Atom = 0 endIf + if(.not.allocated(fileinfo%IBasisFunctionType)) then + allocate(fileinfo%IBasisFunctionType(fileinfo%NBasis)) + fileinfo%IBasisFunctionType = 0 + endIf if(fileinfo%icgu.eq.111) then iopcl = 0 diff --git a/src/mqc_general.F03 b/src/mqc_general.F03 index 9a170261..39c6a699 100644 --- a/src/mqc_general.F03 +++ b/src/mqc_general.F03 @@ -10,8 +10,8 @@ Module MQC_General ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** @@ -215,8 +215,8 @@ subroutine mqc_version(major,minor,revision,versionString) ! if(PRESENT(major)) major = 26 if(PRESENT(minor)) minor = 7 - if(PRESENT(revision)) revision = 1 - if(PRESENT(versionString)) versionString = '26.7.1' + if(PRESENT(revision)) revision = 2 + if(PRESENT(versionString)) versionString = '26.7.2' ! return end subroutine mqc_version @@ -1584,10 +1584,14 @@ function mqc_adjustl_character_vector(stringIn) result(stringOut) ! implicit none character(len=*),dimension(:),intent(in)::stringIn - character(len=LEN(stringIn)),dimension(SIZE(stringIn))::stringOut + character(len=:),dimension(:),allocatable::stringOut + integer(kind=int64)::iCharacter ! ! - stringOut = ADJUSTL(stringIn) + allocate(character(len=LEN(stringIn))::stringOut(SIZE(stringIn))) + do iCharacter = 1,SIZE(stringIn) + stringOut(iCharacter) = ADJUSTL(stringIn(iCharacter)) + endDo ! return end function mqc_adjustl_character_vector @@ -1626,10 +1630,14 @@ function mqc_adjustr_character_vector(stringIn) result(stringOut) ! implicit none character(len=*),dimension(:),intent(in)::stringIn - character(len=LEN(stringIn)),dimension(SIZE(stringIn))::stringOut + character(len=:),dimension(:),allocatable::stringOut + integer(kind=int64)::iCharacter ! ! - stringOut = ADJUSTR(stringIn) + allocate(character(len=LEN(stringIn))::stringOut(SIZE(stringIn))) + do iCharacter = 1,SIZE(stringIn) + stringOut(iCharacter) = ADJUSTR(stringIn(iCharacter)) + endDo ! return end function mqc_adjustr_character_vector diff --git a/src/mqc_general_lapack.F03 b/src/mqc_general_lapack.F03 index 205ef145..4157f3ca 100644 --- a/src/mqc_general_lapack.F03 +++ b/src/mqc_general_lapack.F03 @@ -9,8 +9,8 @@ ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_integrals.F03 b/src/mqc_integrals.F03 index ce8741c5..da76191d 100644 --- a/src/mqc_integrals.F03 +++ b/src/mqc_integrals.F03 @@ -10,8 +10,8 @@ module MQC_Integrals ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/src/mqc_interface.F03 b/src/mqc_interface.F03 index edcad365..f36f4da3 100644 --- a/src/mqc_interface.F03 +++ b/src/mqc_interface.F03 @@ -9,8 +9,8 @@ ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** @@ -347,7 +347,6 @@ end subroutine mqc_File_Is_Executable_F2C ! integerTmp is was integer in the calling subroutine. ! subroutine mqc_copy_vec( integerTmp8, integerTmp4, arrayTmp, LR) - use MQC_MatWrapper use iso_fortran_env, only: int32, int64, real64 Implicit None integer(kind=int64),dimension(:),intent(inout)::integerTmp8 @@ -355,13 +354,6 @@ subroutine mqc_copy_vec( integerTmp8, integerTmp4, arrayTmp, LR) real(kind=real64),dimension(:),intent(out)::arrayTmp integer(kind=int64),intent(in):: LR integer(kind=int64):: i - Character(Len=64)::Ignorable - Integer(kind=int32)::IntPrecision - Integer(kind=int32)::Call_Test - - Call_Test=0 - call MQC_Mat_Precision(Ignorable, IntPrecision, Call_Test) - write(6,1234) lr 1234 format( i10 ) flush(6) @@ -377,15 +369,5 @@ subroutine mqc_copy_vec( integerTmp8, integerTmp4, arrayTmp, LR) return - if ( IntPrecision .eq. 4 ) then -! -! These 2 arrays are the same, with different size declarations. -! Starting from the end allows us to expand the array without overwriting data -! - do i = LR, 1, -1 - integerTmp8(i) = integerTmp4(i) - end do - endif - return end subroutine mqc_copy_vec #endif diff --git a/src/mqc_matwrapper.F03 b/src/mqc_matwrapper.F03 deleted file mode 100644 index f771275d..00000000 --- a/src/mqc_matwrapper.F03 +++ /dev/null @@ -1,2621 +0,0 @@ -!hph #define UCMGAUOPEN - Module MQC_MatWrapper -! -! *********************************************************************** -! *********************************************************************** -! ** ** -! ** The Merced Quantum Chemistry Package ** -! ** (MQCPack) ** -! ** ** -! ** Written By: ** -! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** -! ** Mullally, and Hrant P. Hratchian ** -! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** -! ** ** -! ** ** -! ** Modules beloning to MQCPack: ** -! ** 1. MQC_General ** -! ** 2. MQC_Binary ** -! ** 3. MQC_DataStructures ** -! ** 4. MQC_Integrals ** -! ** 5. MQC_Algebra ** -! ** 6. MQC_Files ** -! ** 7. MQC_Molecule ** -! ** 8. MQC_EST ** -! ** 9. MQC_Gaussian ** -! ** ** -! *********************************************************************** -! *********************************************************************** -! -! - use mqc_general - use iso_fortran_env, only: int32, int64, real64 -! -! Matrix-file layout metadata... -! - type MQC_MatrixFile_Layout - integer(kind=int32)::integerBytes=0 - integer(kind=int64)::fileVersion=0 - integer(kind=int64)::nHeaderRecords=0 - integer(kind=int64)::len12Bytes=0 - integer(kind=int64)::len4Bytes=0 - logical::rawFormat=.false. - contains - procedure,public::set => MQC_MatrixFile_Layout_Set - procedure,public::setForWrite => MQC_MatrixFile_Layout_Set_For_Write - end type MQC_MatrixFile_Layout -! -! Logical and stored sizes for one fixed-width character record. -! - type MQC_MatrixFile_Character_Record_Layout - integer(kind=int64)::elementCount=0 - integer(kind=int64)::elementWidth=0 - integer(kind=int64)::payloadCharacters=0 - integer(kind=int64)::bufferCharacters=0 - integer(kind=int64)::payloadWords=0 - integer(kind=int64)::bufferWords=0 - end type MQC_MatrixFile_Character_Record_Layout -! -! -! -! Subroutines/Functions... -! - CONTAINS -!PROCEDURE MQC_MatrixFile_Layout_Set - subroutine MQC_MatrixFile_Layout_Set(layout,fileVersion, & - nHeaderRecords,len12Bytes,len4Bytes) -! -! Store layout metadata read from a Gaussian matrix-file header. The -! integer byte width selects the matching GauOpen wrapper implementation, -! while Len12L and Len4L retain the file-format word sizes. -! -! H. P. Hratchian, 2026. -! - implicit none - class(MQC_MatrixFile_Layout),intent(inout)::layout - integer(kind=int64),intent(in)::fileVersion,nHeaderRecords, & - len12Bytes,len4Bytes -! - integer(kind=int32)::intPrecision,callTest - character(len=64)::name -! - callTest = 0 - call MQC_Mat_Precision(name,intPrecision,callTest) - if(intPrecision.ne.4.and.intPrecision.ne.8) & - call MQC_Error_I('MQC_MatrixFile_Layout_Set: Matrix-file integer '// & - 'width must be 4 or 8 bytes.',6,'intPrecision', & - INT(intPrecision,kind=int64)) - if(len12Bytes.le.0) & - call MQC_Error_I('MQC_MatrixFile_Layout_Set: Len12L must be '// & - 'positive.',6,'len12Bytes',len12Bytes) - if(len4Bytes.le.0) & - call MQC_Error_I('MQC_MatrixFile_Layout_Set: Len4L must be '// & - 'positive.',6,'len4Bytes',len4Bytes) -! - layout%integerBytes = intPrecision - layout%fileVersion = fileVersion - layout%nHeaderRecords = nHeaderRecords - layout%len12Bytes = len12Bytes - layout%len4Bytes = len4Bytes - layout%rawFormat = .false. -! - return - end subroutine MQC_MatrixFile_Layout_Set - - -!PROCEDURE MQC_MatrixFile_Layout_Set_For_Write - subroutine MQC_MatrixFile_Layout_Set_For_Write(layout) -! -! Initialize layout metadata for a newly written Gaussian matrix file. -! The active GauOpen integer precision determines both file word sizes. -! -! H. P. Hratchian, 2026. -! - implicit none - class(MQC_MatrixFile_Layout),intent(inout)::layout -! - integer(kind=int32)::intPrecision,callTest - character(len=64)::name -! - callTest = 0 - call MQC_Mat_Precision(name,intPrecision,callTest) - if(intPrecision.ne.4.and.intPrecision.ne.8) & - call MQC_Error_I('MQC_MatrixFile_Layout_Set_For_Write: Matrix-'// & - 'file integer width must be 4 or 8 bytes.',6,'intPrecision', & - INT(intPrecision,kind=int64)) -! - layout%integerBytes = intPrecision - layout%fileVersion = 3 - layout%nHeaderRecords = 11 - layout%len12Bytes = intPrecision - layout%len4Bytes = intPrecision - layout%rawFormat = .false. -! - return - end subroutine MQC_MatrixFile_Layout_Set_For_Write - - -!PROCEDURE MQC_MatrixFile_Get_Character_Record_Layout - function MQC_MatrixFile_Get_Character_Record_Layout(layout,nTot, & - lenBuf,n1,n2,n3,n4,n5,typeA) result(recordLayout) -! -! Translate raw GauOpen character-record word counts into logical fixed- -! width character elements. A positive TypeA identifies character data. -! TypeA=1 is the legacy marker for one character scalar spanning the full -! payload; larger TypeA values are explicit fixed element widths. NTot and -! LenBuf are expressed in Len4L-sized file words. This normalization -! follows Gaussian's RdBAF1 routine. -! -! H. P. Hratchian, 2026. -! - implicit none - type(MQC_MatrixFile_Layout),intent(in)::layout - integer(kind=int64),intent(in)::nTot,lenBuf,n1,n2,n3,n4,n5,typeA - type(MQC_MatrixFile_Character_Record_Layout)::recordLayout - integer(kind=int64)::rawElementCount -! - if(layout%len4Bytes.le.0) & - call MQC_Error_I('Character FAF record has invalid Len4L.',6, & - 'layout%len4Bytes',layout%len4Bytes) - if(nTot.le.0) & - call MQC_Error_I('Character FAF record has invalid NTot.',6, & - 'nTot',nTot) - if(lenBuf.le.0) & - call MQC_Error_I('Character FAF record has invalid LenBuf.',6, & - 'lenBuf',lenBuf) - if(typeA.le.0) & - call MQC_Error_I('Character FAF record has invalid TypeA.',6, & - 'typeA',typeA) -! - rawElementCount = LenArr(n1,n2,n3,n4,n5) - if(rawElementCount.le.0) & - call MQC_Error_I('Character FAF record has invalid raw dimensions.', & - 6,'rawElementCount',rawElementCount) - recordLayout%payloadCharacters = layout%len4Bytes*nTot - recordLayout%payloadWords = nTot - if(typeA.eq.1) then - recordLayout%elementWidth = recordLayout%payloadCharacters - else - recordLayout%elementWidth = typeA - endIf - if(MOD(recordLayout%payloadCharacters, & - recordLayout%elementWidth).ne.0) & - call MQC_Error('Character FAF payload length is not divisible by '// & - 'the logical element width.',6) - recordLayout%elementCount = recordLayout%payloadCharacters/ & - recordLayout%elementWidth - recordLayout%bufferCharacters = layout%len4Bytes*lenBuf - recordLayout%bufferWords = lenBuf -! - return - end function MQC_MatrixFile_Get_Character_Record_Layout - - -!PROCEDURE MQC_MatrixFile_Get_Character_Write_Layout - function MQC_MatrixFile_Get_Character_Write_Layout(layout, & - elementCount,elementWidth,bufferWords) result(recordLayout) -! -! Translate logical fixed-width character elements into raw GauOpen word -! and character counts for writing. The payload must end on a complete -! Len4L word so the logical shape is preserved when Gaussian normalizes -! the record. TypeA=1 is reserved for the legacy scalar marker. -! -! H. P. Hratchian, 2026. -! - implicit none - type(MQC_MatrixFile_Layout),intent(in)::layout - integer(kind=int64),intent(in)::elementCount,elementWidth,bufferWords - type(MQC_MatrixFile_Character_Record_Layout)::recordLayout -! - if(layout%len4Bytes.le.0) & - call MQC_Error_I('Character FAF write has invalid Len4L.',6, & - 'layout%len4Bytes',layout%len4Bytes) - if(elementCount.le.0) & - call MQC_Error_I('Character FAF write has no logical elements.',6, & - 'elementCount',elementCount) - if(elementWidth.le.1) & - call MQC_Error_I('Character FAF element width must be greater than '// & - 'one; TypeA=1 is the legacy scalar marker.',6,'elementWidth', & - elementWidth) - if(bufferWords.le.0) & - call MQC_Error_I('Character FAF write has invalid buffer words.',6, & - 'bufferWords',bufferWords) -! - recordLayout%elementCount = elementCount - recordLayout%elementWidth = elementWidth - recordLayout%payloadCharacters = elementCount*elementWidth - if(MOD(recordLayout%payloadCharacters,layout%len4Bytes).ne.0) & - call MQC_Error('Character FAF payload must occupy a whole number '// & - 'of Len4L words.',6) - recordLayout%payloadWords = recordLayout%payloadCharacters/ & - layout%len4Bytes - recordLayout%bufferWords = bufferWords - recordLayout%bufferCharacters = layout%len4Bytes*bufferWords -! - return - end function MQC_MatrixFile_Get_Character_Write_Layout - - - Subroutine MQC_Read_Mat_Precision_Test(MatFileName, IntPrecision) - Implicit None -! -! IU receives the Fortran unit number or -1 if the open failed. -! - Integer( kind=int32 ) LStr, IUUse, Len12D, Len4D - Parameter (LStr=64,IUUse=57) - - Character(Len=*),Intent(In)::MatFileName - Integer(kind=int32),Intent(Out)::IntPrecision - - Character(len=LStr)::LabFil, GVers, Title - Integer(kind=int64) IU - Integer(kind=int32) IVers,NLab,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,Len12L,Len4L,IOpCl,ICGU - - Integer(kind=int64) IVers_8,NLab_8,NAtoms_8,NBasis_8,NBsUse_8,ICharg_8,Multip_8,NE_8,Len12L_8,Len4L_8,IOpCl_8,ICGU_8 - Integer( kind=int64 ) Len12D_8, Len4D_8 - Integer(kind=int32) IError - Integer(kind=int64) IError_8 - Integer(kind=int64) IOut - Integer(kind=int64) rec_len, bufsize - Integer(kind=int64) LStr64 - Character(len=LStr)::DataType - logical I_OPENED - -!!!!!!!!!!!!!!!!! - IntPrecision = 8 -!!!!!!!!!!!!!!!!! -! -! Len12D=4 -! Len4D=4 -! IU = IUUse -!! -! Title = ' ' -! INQUIRE (IU, OPENED=I_OPENED ) -! if ( I_OPENED ) then -! write(6, 1030) trim(MatFileName) -! 1030 format( "File was Open. Close then open ", a) -! call Close_MatF(IU) -! endif -! -! LStr64 = LStr -! call mqc_Matfile_Guide_F2C(MatFileName, DataType, LStr64, rec_len, bufsize) -! if ( trim(DataType) .eq. "Long" ) then -! IntPrecision = 8 -! else if ( trim(DataType) .eq. "Int" ) then -! IntPrecision = 4 -! else if ( trim(DataType) .eq. "Raw" ) then -! IntPrecision = 0 -! else if ( trim(DataType) .eq. "Could not open File" ) then -! IntPrecision = -1 -! else -! Iout = 6 -! call MQC_Error_A('Unknown DataType - should be Long, Int or Raw', Iout, 'trim(DataType)', trim(DataType)) -! endIf - - Return - end subroutine MQC_Read_Mat_Precision_Test - - Subroutine MQC_Mat_Precision(MatFileName, IntPrecision, Call_Test) - Implicit None -! -! IU receives the Fortran unit number or -1 if the open failed. -! - Character(Len=*),Intent(In)::MatFileName - Integer(kind=int32),Intent(Out)::IntPrecision - Integer(kind=int32),Intent(In)::Call_Test - Integer(kind=int32),save::Save_IntPrecision - Data Save_IntPrecision/0/ - - If ( Call_Test .EQ. 0 ) then - IntPrecision = Save_IntPrecision - Else If ( Call_Test .EQ. 2 ) then -! -! Write the Matrix Element file. Set Integer precision to what is was -! for the Matrix Element file read. If nothing has been read, set it -! to 8 Bytes. - If ( Save_IntPrecision .EQ. 0 ) then - Save_IntPrecision = 8 - EndIf - IntPrecision = Save_IntPrecision - Else - call MQC_Read_Mat_Precision_Test(MatFileName, IntPrecision) - Save_IntPrecision = IntPrecision - EndIf - return - end subroutine MQC_Mat_Precision - - Subroutine Wr_LRInd(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - Implicit None - - Character(Len=*),Intent(In)::Label - Integer(kind=int64),Intent(In)::IU - Logical,Intent(In)::ASym - Integer(kind=int64),Intent(In)::NR,LenBuf,N1,N2,N3,N4,N5 - Real(kind=real64),Dimension(:),Intent(InOut)::X - - Integer(kind=int32)::NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4 - Integer(kind=int32)::IU_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LenBuf_4 = LenBuf - N1_4 = N1 - N2_4 = N2 - N3_4 = N3 - N4_4 = N4 - N5_4 = N5 - call WrLRInd4(IU_4,Label,NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4,ASym,X) - else -! File requires 64-bit integers, so no change - call WrLRInd8(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - endif - Return - End Subroutine Wr_LRInd - - Subroutine Wr_LAO2E(IU,Label,NR,LenBuf,N,RInt) - Implicit None - - Character(Len=*),Intent(In)::Label - Integer(kind=int64),Intent(In)::IU - Integer(kind=int64),Intent(In)::NR,LenBuf,N - Real(kind=real64),Dimension(:),Intent(InOut)::RInt - - Integer(kind=int32)::NR_4,LenBuf_4,N_4 - Integer(kind=int32)::IU_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LenBuf_4 = LenBuf - N_4 = N - call WrLAO2E4(IU_4,Label,NR_4,LenBuf_4,N_4,RInt) - else -! File requires 64-bit integers, so no change - call WrLAO2E8(IU,Label,NR,LenBuf,N,RInt) - endif - Return - End Subroutine Wr_LAO2E - - Subroutine Open_Read(Name,IU,LabFil,IVers,NLab,GVers,Title,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,Len12L,Len4L,IOpCl,ICGU) - Implicit None - - Character(Len=*),Intent(In)::Name - Character(Len=64),Intent(InOut)::LabFil - Character(Len=64),Intent(InOut)::GVers - Character(Len=64),Intent(InOut)::Title - Integer(kind=int64),Intent(Out)::IU,IVers,NLab,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,Len12L,Len4L,IOpCl,ICGU - - Integer(kind=int32)::IU_4,IVers_4,NLab_4,NAtoms_4,NBasis_4,NBsUse_4, & - ICharg_4,Multip_4,NE_4,Len12L_4,Len4L_4,IOpCl_4,ICGU_4 - Integer(kind=int32)::IntPrecision, Call_Test - Integer(kind=int64)::IOut - Call_Test = 1 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - call mqc_error('Open_Read: Attempt to use single precision.') - call OpenRead4(Name,IU_4,LabFil,IVers_4,NLab_4,GVers,Title, & - NAtoms_4,NBasis_4,NBsUse_4,ICharg_4,Multip_4,NE_4,Len12L_4, & - Len4L_4,IOpCl_4,ICGU_4) - IU = IU_4 - IVers = IVers_4 - NLab = NLab_4 - NAtoms = NAtoms_4 - NBasis = NBasis_4 - NBsUse = NBsUse_4 - ICharg = ICharg_4 - Multip = Multip_4 - NE = NE_4 - Len12L = Len12L_4 - Len4L = Len4L_4 - IOpCl = IOpCl_4 - ICGU = ICGU_4 - else if ( IntPrecision .eq. 8 ) then -! File requires 64-bit integers, so no change - call OpenRead8(Name,IU,LabFil,IVers,NLab,GVers,Title,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,Len12L,Len4L,IOpCl,ICGU) - else if ( IntPrecision .eq. 0 ) then -! Raw file - IU = -2 - else if ( IntPrecision .eq. -1 ) then -! Failure to open file - IU = -1 - else - IOut = 6 - ICGU = IntPrecision - call MQC_Error_I('Open_Read: IntPrecision should be 4 or 8', Iout, & - 'IntPrecision', ICGU ) - endif - if ( IU .eq. -1 ) then - IOut = 6 - call MQC_Error_A('Open_Read: Unable to Open File', Iout, 'Name', Name) - endif - Return - End Subroutine Open_Read - - Subroutine Open_Write(Name,IU,LabFil,GVers,Title,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,IOpCl,ICGU) - Implicit None - - Character(Len=*),Intent(In)::Name - Character(Len=64),Intent(InOut)::LabFil - Character(Len=64),Intent(InOut)::GVers - Character(Len=64),Intent(InOut)::Title - Integer(kind=int64),Intent(Out)::IU - Integer(kind=int64),Intent(In)::NAtoms,NBasis,NBsUse,ICharg,Multip,NE,IOpCl,ICGU - Integer(kind=int32)::IU_4,NAtoms_4,NBasis_4,NBsUse_4,ICharg_4,Multip_4,NE_4,IOpCl_4,ICGU_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Integer(kind=int64)::IERR - Integer(kind=int64)::IOut - Call_Test = 2 - - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - NAtoms_4 = NAtoms - NBasis_4 = NBasis - NBsUse_4 = NBsUse - ICharg_4 = ICharg - Multip_4 = Multip - NE_4 = NE - IOpCl_4 = IOpCl - ICGU_4 = ICGU - call OpenWrite4(Name,IU_4,LabFil,GVers,Title,NAtoms_4,NBasis_4,NBsUse_4,ICharg_4,Multip_4,NE_4,IOpCl_4,ICGU_4) - IU = IU_4 - else if ( IntPrecision .eq. 8 ) then -! File requires 64-bit integers, so no change - call OpenWrite8(Name,IU,LabFil,GVers,Title,NAtoms,NBasis,NBsUse,ICharg,Multip,NE,IOpCl,ICGU) - else - IOut = 6 - IERR = IntPrecision - call MQC_Error_I('Open_Write: IntPrecision should be 4 or 8', Iout, & - 'IntPrecision', IERR) - endif - Return - End Subroutine Open_Write - - Subroutine Close_MatF(IU) - Implicit None -! -! Close a matrix-element file. -! - Integer(kind=int64),Intent(In)::IU - -#ifdef UCMGAUOPEN - Call CloseMatF8(.false.,IU) -#else - Call CloseMatF8(IU) -#endif - - Return - End Subroutine Close_MatF -!hph+ -! -! Function AOInts(CBuf) result(aoint) -! Implicit None -! Character(Len=*),Intent(InOut)::CBuf -! Logical aoint -! Logical, external::a4ints -! AOInt = A4Ints(CBuf) -! End Function AOInts -! -!hph- - - Function LenArr(N1,N2,N3,N4,N5) result(LenAr) - Implicit None - Integer(kind=int64),Intent(In)::N1,N2,N3,N4,N5 - Integer(kind=int64)::LenAr - - Integer(kind=int64), external::LenAr8 - - LenAr = LenAr8(N1,N2,N3,N4,N5) - End Function LenArr - -!hph+ - - Function LInd2C(Check,N1,N2,ASym,I,J,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,I,J,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::l8nd2c - Integer(kind=int64)::Lind8 - - Lind8 = L8nd2C(Check,N1,N2,ASym,I,J,Sign) - End Function LInd2C - - Function Lind2(Check,N1,N2,ASym,I,J,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,I,J,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::L8nd2 - Integer(kind=int64)::Lind8 - - Lind8 = L8nd2(Check,N1,N2,ASym,I,J,Sign) - End Function Lind2 - - Function Lind3C(Check,N1,N2,N3,ASym,I,J,K,Sign) result(Lind8) - Implicit None - - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,I,J,K,Sign - Logical,Intent(InOut)::Check,ASym - Integer(kind=int64), external::L8nd3C - Integer(kind=int64)::Lind8 - - Lind8 = L8nd3C(Check,N1,N2,N3,ASym,I,J,K,Sign) - End Function Lind3C - - Function Lind3(Check,N1,N2,N3,ASym,I,J,K,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,I,J,K,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::L8nd3 - Integer(kind=int64)::Lind8 - - Lind8 = L8nd3(Check,N1,N2,N3,ASym,I,J,K,Sign) - End Function Lind3 - - Function Lind4C(Check,N1,N2,N3,N4,ASym,I,J,K,L,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,N4,I,J,K,L,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::L8nd4C - Integer(kind=int64)::Lind8 - - Lind8 = L8nd4C(Check,N1,N2,N3,N4,ASym,I,J,K,L,Sign) - End Function Lind4C - - Function Lind4(Check,N1,N2,N3,N4,ASym,I,J,K,L,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,N4,I,J,K,L,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::L8nd4 - Integer(kind=int64)::Lind8 - - Lind8 = L8nd4(Check,N1,N2,N3,N4,ASym,I,J,K,L,Sign) - End Function Lind4 - - Function Lind5C(Check,N1,N2,N3,N4,N5,ASym,I,J,K,L,M,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,N4,N5,I,J,K,L,M,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64),external::L8nd5C - Integer(kind=int64)::Lind8 - - Lind8 = L8nd5C(Check,N1,N2,N3,N4,N5,ASym,I,J,K,L,M,Sign) - End Function Lind5C - - Function Lind5(Check,N1,N2,N3,N4,N5,ASym,I,J,K,L,M,Sign) result(Lind8) - Implicit None - Integer(kind=int64),Intent(InOUT)::N1,N2,N3,N4,N5,I,J,K,L,M,Sign - Logical,Intent(InOut)::Check,ASym - - Integer(kind=int64), external::L8nd5 - Integer(kind=int64)::Lind8 - - Lind8 = L8nd5(Check,N1,N2,N3,N4,N5,ASym,I,J,K,L,M,Sign) - End Function Lind5 - - Subroutine Rd_2E1(IU,LR,NTot,LenBuf,RArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,LR,NTOT,LenBuf - Real(kind=real64),Dimension(:),Intent(InOut)::RArr - - Integer(kind=int32)::IU_4,LR_4,NTOT_4,LenBuf_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - LR_4 = LR - NTOT_4 = NTOT - LenBuf_4 = LenBuf - call Rd2E14(IU_4,LR_4,NTot_4,LenBuf_4,RArr) - else -! File requires 64-bit integers, so no change - call Rd2E18(IU,LR,NTot,LenBuf,RArr) - endif - Return - End Subroutine Rd_2E1 - - Subroutine Rd_IBuf(IU,NTot,LenBuf,Arr) - Implicit None - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(NTot),Intent(Out)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - Integer(kind=int32),Dimension(NTot)::Arr_4 - - Integer(kind=int64)::I - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - - Call RdIBuf4(IU_4,NTot_4,LenBuf_4,Arr_4) - DO I = 1,NTot - Arr(I) = Arr_4(I) - ENDDO - else -! File requires 64-bit integers, so no change - Call RdIBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Rd_IBuf - - Subroutine Rd_Labl(IU,IVers,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5,ASym,NRI,EOF) - Implicit None - - Integer(kind=int64),Intent(In)::IU,IVers - Character(Len=64),Intent(Out)::CBuf - Integer(kind=int64),Intent(Out)::NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5,NRI - Logical,Intent(Out)::ASym,EOF - - Integer(kind=int64)::TypeA - - Call Rd_Labl_TypeA(IU,IVers,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3, & - N4,N5,TypeA,NRI,EOF) - ASym = TypeA.ne.0 - Return - End Subroutine Rd_Labl - -!PROCEDURE Rd_Labl_TypeA - Subroutine Rd_Labl_TypeA(IU,IVers,CBuf,NI,NR,NTot,LenBuf,N1,N2, & - N3,N4,N5,TypeA,NRI,EOF) - Implicit None - - Integer(kind=int64),Intent(In)::IU,IVers - Character(Len=64),Intent(Out)::CBuf - Integer(kind=int64),Intent(Out)::NI,NR,NTot,LenBuf,N1,N2,N3, & - N4,N5,TypeA,NRI - Logical,Intent(Out)::EOF - - Integer(kind=int32)::IU_4,IVers_4 - Integer(kind=int32)::NI_4,NR_4,NTot_4,LenBuf_4,N1_4,N2_4, & - N3_4,N4_4,N5_4,TypeA_4,NRI_4 - Logical::ASym - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! -! File requires 32-bit integers. -! - IU_4 = IU - IVers_4 = IVers -#ifdef UCMGAUOPEN - Call RdLabl4(IU_4,IVers_4,CBuf,NI_4,NR_4,NTot_4,LenBuf_4, & - N1_4,N2_4,N3_4,N4_4,N5_4,TypeA_4,NRI_4,EOF) -#else - Call RdLabl4(IU_4,IVers_4,CBuf,NI_4,NR_4,NTot_4,LenBuf_4, & - N1_4,N2_4,N3_4,N4_4,N5_4,ASym,NRI_4,EOF) - if(ASym) then - TypeA_4 = -1 - else - TypeA_4 = 0 - endIf -#endif - NI = NI_4 - NR = NR_4 - NTot = NTot_4 - LenBuf = LenBuf_4 - N1 = N1_4 - N2 = N2_4 - N3 = N3_4 - N4 = N4_4 - N5 = N5_4 - TypeA = TypeA_4 - NRI = NRI_4 - else -! -! File requires 64-bit integers, so no change. -! -#ifdef UCMGAUOPEN - Call RdLabl8(IU,IVers,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4, & - N5,TypeA,NRI,EOF) -#else - Call RdLabl8(IU,IVers,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4, & - N5,ASym,NRI,EOF) - if(ASym) then - TypeA = -1 - else - TypeA = 0 - endIf -#endif - endif - Return - End Subroutine Rd_Labl_TypeA - - Subroutine Rd_RInd(IU,NR,LR,NTot,LenBuf,LNZ,RArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NR,LR,NTot,LenBuf - Integer(kind=int64),Intent(Out)::LNZ - Real(kind=real64),Dimension(:),Intent(Out)::RArr - - Integer(kind=int32)::IU_4,NR_4,LR_4,NTot_4,LenBuf_4 - Integer(kind=int32)::LNZ_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LR_4 = LR - NTot_4 = NTot - LenBuf_4 = LenBuf - Call RdRInd4(IU_4,NR_4,LR_4,NTot_4,LenBuf_4,LNZ_4,RArr) - LNZ = LNZ_4 - else -! File requires 64-bit integers, so no change -#ifdef UCMGAUOPEN - Call RdRInd8(IU,NR,LR,NR*LR,NTot,LenBuf,RArr) -#else - Call RdRInd8(IU,NR,LR,NTot,LenBuf,LNZ,RArr) -#endif - endif - Return - End Subroutine Rd_RInd - - Subroutine Rd_Skip(IU,NTot,LenBuf) - Implicit None - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - - Call RdSkip8(IU,NTot,LenBuf) - Return - End Subroutine Rd_Skip - - Subroutine Wr_2E(IU,NTot,NR,N,LR,LenBuf,RArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,NR,N,LR,LenBuf - Real(kind=real64),Dimension(:),Intent(Out)::RArr - - Integer(kind=int32)::IU_4,NTot_4,NR_4,N_4,LR_4,LenBuf_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - NTot_4 = NTot - N_4 = N - IU_4 = IU - NR_4 = NR - LR_4 = LR - NTot_4 = NTot - LenBuf_4 = LenBuf - CALL Wr2E4(IU_4,NTot_4,NR_4,N_4,LR_4,LenBuf_4,RArr) - else -! File requires 64-bit integers, so no change - CALL Wr2E8(IU,NTot,NR,N,LR,LenBuf,RArr) - endif - Return - End Subroutine Wr_2E - - Subroutine Wr_IBuf(IU,NTot,LenBuf,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(NTot),Intent(In)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - Integer(kind=int32),Dimension(NTot)::Arr_4 - Integer(kind=int32)::I - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - DO i = 1, NTot - Arr_4(I) = Arr(I) - Enddo - Call WrIBuf4(IU_4,NTot_4,LenBuf_4,Arr_4) - else -! File requires 64-bit integers, so no change - Call WrIBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Wr_IBuf - - Subroutine Wr_Labl(IU,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5,ASym) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5 - Logical,Intent(In)::ASym - Character(Len=*),Intent(In)::CBuf - - Integer(kind=int64)::TypeA - - if(ASym) then - TypeA = -1 - else - TypeA = 0 - endIf - Call Wr_Labl_TypeA(IU,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5, & - TypeA) - Return - End Subroutine Wr_Labl - -!PROCEDURE Wr_Labl_TypeA - Subroutine Wr_Labl_TypeA(IU,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5, & - TypeA) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5 - Integer(kind=int64),Intent(In)::TypeA - Character(Len=*),Intent(In)::CBuf - - Integer(kind=int32)::IU_4,NI_4,NR_4,NTot_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4 - Integer(kind=int32)::TypeA_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Logical::ASym - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! -! File requires 32-bit integers. -! - IU_4 = IU - NI_4 = NI - NR_4 = NR - NTot_4 = NTot - LenBuf_4 = LenBuf - N1_4 = N1 - N2_4 = N2 - N3_4 = N3 - N4_4 = N4 - N5_4 = N5 - TypeA_4 = TypeA -#ifdef UCMGAUOPEN -! -! GauOpen's label writer preserves the exact field sequence expected -! by RdLabl. A negative TypeA requests the two-real-block convention, -! which is encoded by negating the nonnegative NR value. -! - if(NR_4.lt.0) then - Call MQC_Error('Wr_Labl_TypeA: NR must be nonnegative.') - endIf - if(TypeA_4.lt.0) then - Call WrLabl4(IU_4,CBuf,NI_4,-NR_4,NTot_4,LenBuf_4,N1_4, & - N2_4,N3_4,N4_4,N5_4,TypeA_4) - else - Call WrLabl4(IU_4,CBuf,NI_4,NR_4,NTot_4,LenBuf_4,N1_4, & - N2_4,N3_4,N4_4,N5_4,TypeA_4) - endIf -#else - ASym = TypeA.ne.0 - Call WrLabl4(IU_4,CBuf,NI_4,NR_4,NTot_4,LenBuf_4,N1_4, & - N2_4,N3_4,N4_4,N5_4,ASym) -#endif - else -! -! File requires 64-bit integers, so no change. -! -#ifdef UCMGAUOPEN -! -! Keep the 8-byte label record identical to the 4-byte convention -! above. -! - if(NR.lt.0) then - Call MQC_Error('Wr_Labl_TypeA: NR must be nonnegative.') - endIf - if(TypeA.lt.0) then - Call WrLabl8(IU,CBuf,NI,-NR,NTot,LenBuf,N1,N2,N3,N4,N5, & - TypeA) - else - Call WrLabl8(IU,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5, & - TypeA) - endIf -#else - ASym = TypeA.ne.0 - Call WrLabl8(IU,CBuf,NI,NR,NTot,LenBuf,N1,N2,N3,N4,N5,ASym) -#endif - endif - Return - End Subroutine Wr_Labl_TypeA - - Subroutine Wr_RBuf(IU,NTot,LenBuf,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Real(kind=real64),Dimension(:),Intent(In)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - Call WrRBuf4(IU_4,NTot_4,LenBuf_4,Arr) - else -! File requires 64-bit integers, so no change - Call WrRBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Wr_RBuf - - Subroutine Wr_RInd(IU,NR,LR,NTot,LenBuf,RArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NR,LR,NTot,LenBuf - Real(kind=real64),Dimension(:),Intent(In)::RArr - - Integer(kind=int32)::IU_4,NR_4,LR_4,NTot_4,LenBuf_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - NR_4 = NR - LR_4 = LR - Call WrRInd4(IU_4,NR_4,LR_4,NTot_4,LenBuf_4,RArr) - else -! File requires 64-bit integers, so no change - Call WrRInd8(IU,NR,LR,NTot,LenBuf,RArr) - endif - Return - End Subroutine Wr_RInd - - Subroutine ExpAO1(N,LR,RI,RO) - Implicit None - - Integer(kind=int64),Intent(In)::N, LR - Real(kind=real64),Dimension(:),Intent(Out)::RI - Real(kind=real64),Dimension(:),Intent(Out)::RO -! This routine does no I/O - Call ExpA18(N,LR,RI,RO) - Return - End Subroutine ExpAO1 - - Subroutine ExpAON(NE,N,LR,RI,RO) - Implicit None - - Integer(kind=int64),Intent(In)::NE,N, LR - Real(kind=real64),Dimension(:),Intent(Out)::RI - Real(kind=real64),Dimension(:),Intent(Out)::RO -! This routine does no I/O - Call ExpAN8(NE,N,LR,RI,RO) - Return - End Subroutine ExpAON - - Subroutine AClear(N,A) - Implicit None - - Integer(kind=int64),Intent(In)::N - Real(kind=real64),Dimension(:),Intent(Out)::A - - call AClea8(N,A) - Return - End Subroutine AClear - - Subroutine IClear(N,IA) - Implicit None - - Integer(kind=int64),Intent(In)::N - Integer(kind=int64),Dimension(N),Intent(Out)::IA - - Call IClea8(N,IA) - Return - End Subroutine IClear - -!hph- - -!hph+ - Integer(kind=int64) Function mqc_LenArr(NR,NI,NRI,N1,N2,N3,N4,N5, & - s_datatype, s_shape, s_formula ) - Implicit None -! -! This is a modified Lenarr routine from GauOpen with these changes: -! 1. Added code to capture the math, so that it's easier to figure out -! the dimensions of arrays. -! 2. Converted from FORTRAN 77 to FORTRAN 2003 -! - Integer(kind=int64),intent(in)::NR,NI,NRI - Integer(kind=int64),intent(in)::N1,N2,N3,N4,N5 - character(LEN=*),intent(out)::s_datatype, s_shape, s_formula - Integer(kind=int64) N1X,N2X,N3X,N4X,N5X,Sign - Integer(kind=int64) size - character(LEN=1024) s_N1X, s_N2X, s_N3X, s_N4X, s_N5X - character(LEN=1024) s_absN1X,s_absN2X,s_absN3X,s_absN4X,s_absN5X - character(LEN=1024) s_TMP, s_Lind5_result, s_Logic - Logical::ASym - character(len=8)::tab -! -! Format statements. -! - 1030 Format( " - 2-D MATRIX allocated full (",a," x ",a,")" ) - 1050 Format( " - SYMMETRIC MATRIX ((",a,"+1)*",a,"/2)" ) - 1060 Format( " - VECTOR(",a,")" ) - 1080 Format( " - MULTIPLE SYMMETIC MATRICES (((",a,"+1)x",a,"/2) x ",a,")" ) - 1090 Format( " - MULTIPLE SYMMETIC MATRICES (((",a,"+1)x",a,"/2) x (",a,"x",a,"))" ) - 1110 Format( " - SYMMETRIC SUPER MATRIX (((",a,"+1) x ",a,")/2+1) x ((",a,"+1) x ",a,")/4" ) - 1120 Format( " - TRISYMMETRIC MATRIX ((",a,"+2) x (",a,"+1) x ",a,"1)/6" ) - 1130 Format( " - 3-D MATRIX allocated full (",a," x ",a," x ",a,")" ) - 2010 Format( i15 ) -! - 1231 format( a) - 1232 format( 2a) - 1233 format( 3a) - - s_datatype= "UNKNOWN" - if(NR.gt.0.and.NI.gt.0) then - if((NR.eq.1.or.NR.eq.2.or.NR.eq.3).and.NI.eq.4) then - s_datatype= "TENSOR" - else - s_datatype= "MIXED" - endIf - elseIf(NI.eq.1) then - s_datatype= "INTEGER" - elseIf(NR.eq.1) then - if(NRI.eq.1) then - s_datatype= "REAL" - elseIf(NRI.eq.2) then - s_datatype= "COMPLEX" - endIf - endIf - if (N1.gt.1.and.N2.eq.1.and.N3.eq.1.and.N4.eq.1.and.N5.eq.1) then - s_shape="VECTOR" - write( s_N1X,2010) N1 - call mqc_StripSpaces(s_N1X) - write( s_formula, 1060) trim(s_N1X) - mqc_LenArr = N1 - return - else If(N1.gt.1.and.N2.gt.1.and.(N3.eq.1.or.N3.eq.0) & - .and.(N4.eq.1.or.N4.eq.1).and.(N5.eq.1.or.N5.eq.0)) then - s_shape="MATRIX" - write( s_N1X,2010) N1 - call mqc_StripSpaces(s_N1X) - write( s_N2X,2010) N2 - call mqc_StripSpaces(s_N2X) - write( s_formula, 1030) trim(s_N1X),trim(s_N2X) - mqc_LenArr = N1*N2 - return - elseIf(N1.le.-1.and.N2.eq.(-N1).and.N3.eq.1.and.N4.eq.1.and.N5.eq.1) then - s_shape="SYMMATRIX" - write( s_N2X,2010) N2 - call mqc_StripSpaces(s_N2X) - write( s_formula, 1050) trim(s_N2X),trim(s_N2X) - mqc_LenArr = ((N2+1)*N2)/2 - return - elseIf(N1.le.-1.and.N2.eq.N1.and.N3.eq.N1.and.N4.eq.(-N1).and.N5.eq.1) then - s_shape="SYMSYM" - Size = ((N4+1)*N4)/2 - mqc_LenArr = ((Size+1)*Size)/2 - write( s_N4X,2010) N4 - call mqc_StripSpaces(s_N4X) - write( s_formula, 1110)trim(s_N4X),trim(s_N4X),trim(s_N4X),trim(s_N4X) - return - elseIf(N1.le.-1.and.N2.gt.1.and.N3.gt.1.and.N4.eq.1.and.N5.eq.1) then - s_shape="MULTISYMMATRICES" - mqc_LenArr = ((N2+1)*N2)/2*N3 - write( s_N2X,2010) N2 - call mqc_StripSpaces(s_N2X) - write( s_N3X,2010) N3 - call mqc_StripSpaces(s_N3X) - write( s_formula, 1080)trim(s_N2X),trim(s_N2X),trim(s_N3X) - return - elseIf(N1.le.-1.and.N2.gt.1.and.N3.gt.1.and.N4.gt.1.and.N5.eq.1) then - s_shape="MULTISYMMATRICES" - mqc_LenArr = ((N2+1)*N2)/2*N3*N4 - write( s_N2X,2010) N2 - call mqc_StripSpaces(s_N2X) - write( s_N3X,2010) N3 - call mqc_StripSpaces(s_N3X) - write( s_N4X,2010) N4 - call mqc_StripSpaces(s_N4X) - write( s_formula, 1090)trim(s_N2X),trim(s_N2X),trim(s_N3X),trim(s_N4X) - return - elseIf(N1.le.-1.and.N2.eq.N1.and.N3.eq.(-N1).and.N4.eq.1.and.N5.eq.1) then - s_shape="TRISYMMATRICES" - mqc_LenArr = ((N3+2)*(N3+1)*N3)/6 - write( s_N3X,2010) N3 - call mqc_StripSpaces(s_N3X) - write( s_formula, 1120)trim(s_N3X),trim(s_N3X),trim(s_N3X) - return - else If((N1.eq.1.or.N1.eq.0).and.(N2.eq.1.or.N2.eq.0).and. & - (N3.eq.1.or.N3.eq.0).and.(N4.eq.1.or.N4.eq.0).and.(N5.eq.1 & - .or.N5.eq.0)) then - s_shape="SCALAR" - mqc_LenArr = 1 - s_formula = " 1 " - return - else If((N4.eq.1.or.N4.eq.0).and.(N5.eq.1.or.N5.eq.0).and.N1.gt.1 & - .and.N2.gt.1.and.N3.gt.1) then - s_shape="3DMATRIX" - mqc_LenArr = N1*N2*N3 - write( s_N1X,2010) N1 - call mqc_StripSpaces(s_N1X) - write( s_N2X,2010) N2 - call mqc_StripSpaces(s_N2X) - write( s_N3X,2010) N3 - call mqc_StripSpaces(s_N3X) - write( s_formula, 1130)trim(s_N1X),trim(s_N2X),trim(s_N3X) - return - endif - s_shape="UNKNOWN" - N1X = N1 - If(N1X.eq.0) N1X = 1 - N2X = N2 - If(N2X.eq.0) N2X = 1 - N3X = N3 - If(N3X.eq.0) N3X = 1 - N4X = N4 - If(N4X.eq.0) N4X = 1 - N5X = N5 - If(N5X.eq.0) N5X = 1 - - s_Logic = " " - if ( N1X .eq. 1 ) Then - s_N1X = "1" - s_absN1X = "1" - s_Logic = "(NA.eq.1.or.NA.eq.0)" - else if ( N1X .eq. -1 ) Then - s_N1X = "-1" - s_absN1X = "1" - s_Logic = "NA.eq.-1" - else - s_N1X = "NA" - if ( N1X .gt. 0 ) Then - s_absN1X = s_N1X - else - s_absN1X = "(-NA)" - endif - endif - if ( N2X .eq. 1 ) Then - s_N2X = "1" - s_absN2X = "1" - write( s_TMP,1232) trim(s_Logic),".and.(NB.eq.1.or.NB.eq.0)" - s_Logic=s_TMP - else if ( N2X .eq. -1 ) Then - s_N2X = "-1" - s_absN2X = "1" - write( s_TMP,1232) trim(s_Logic),".and.NB.eq.-1" - s_Logic=s_TMP - else if ( N1.eq.N2 ) then - s_N2X = s_N1X - s_absN2X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.NA.eq.NB" - s_Logic=s_TMP - else if ( (-N1).eq.N2 ) then - s_N2X = "(-NA)" - s_absN2X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.(-NA).eq.NB" - s_Logic=s_TMP - else - s_N2X = "NB" - if ( N2X .gt. 0 ) Then - s_absN2X = s_N2X - else - s_absN2X = "(-NB)" - endif - endif - if ( N3X .eq. 1 ) Then - s_N3X = "1" - s_absN3X = "1" - write( s_TMP,1232) trim(s_Logic),".and.(NC.eq.1.or.NC.eq.0)" - s_Logic=s_TMP - else if ( N3X .eq. -1 ) Then - s_N3X = "-1" - s_absN3X = "1" - write( s_TMP,1232) trim(s_Logic),".and.NC.eq.-1" - s_Logic=s_TMP - else if ( N1.eq.N3 ) then - s_N3X = s_N1X - s_absN3X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.NA.eq.NC" - s_Logic=s_TMP - else if ( (-N1).eq.N3 ) then - s_N3X = "(-NA)" - s_absN3X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.(-NA).eq.NC" - s_Logic=s_TMP - else if ( N2.eq.N3 ) then - s_N3X = s_N2X - s_absN3X = s_absN2X - write( s_TMP,1232) trim(s_Logic),".and.NB.eq.NC" - s_Logic=s_TMP - else - s_N3X = "NC" - if ( N3X .gt. 0 ) Then - s_absN3X = s_N3X - else - s_absN3X = "(-NC)" - endif - endif - if ( N4X .eq. 1 ) Then - s_N4X = "1" - s_absN4X = "1" - write( s_TMP,1232) trim(s_Logic),".and.(ND.eq.1.or.ND.eq.0)" - s_Logic=s_TMP - else if ( N4X .eq. -1 ) Then - s_N4X = "-1" - s_absN4X = "1" - write( s_TMP,1232) trim(s_Logic),".and.ND.eq.-1" - s_Logic=s_TMP - else if ( N1.eq.N4 ) then - s_N4X = s_N1X - s_absN4X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.NA.eq.ND" - s_Logic=s_TMP - else if ( (-N1).eq.N4 ) then - s_N4X = "(-NA)" - s_absN4X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.(-NA).eq.ND" - s_Logic=s_TMP - else if ( N2.eq.N4 ) then - s_N4X = s_N2X - s_absN4X = s_absN2X - write( s_TMP,1232) trim(s_Logic),".and.NB.eq.ND" - s_Logic=s_TMP - else if ( N3.eq.N4 ) then - s_N4X = s_N3X - s_absN4X = s_absN3X - write( s_TMP,1232) trim(s_Logic),".and.NC.eq.ND" - s_Logic=s_TMP - else - s_N4X = "ND" - if ( N4X .gt. 0 ) Then - s_absN4X = s_N4X - else - s_absN4X = "(-ND)" - endif - endif - if ( N5X .eq. 1 ) Then - s_N5X = "1" - s_absN5X = "1" - write( s_TMP,1232) trim(s_Logic),".and.(NE.eq.1.or.NE.eq.0)" - s_Logic=s_TMP - else if ( N5X .eq. -1 ) Then - s_N5X = "-1" - s_absN5X = "1" - write( s_TMP,1232) trim(s_Logic),".and.NE.eq.-1" - s_Logic=s_TMP - else if ( N1.eq.N5 ) then - s_N5X = s_N1X - s_absN5X = s_absN1X - write( s_TMP,1232) trim(s_Logic),".and.NA.eq.NE" - s_Logic=s_TMP - else if ( N2.eq.N5 ) then - s_N5X = s_N2X - s_absN5X = s_absN2X - write( s_TMP,1232) trim(s_Logic),".and.NB.eq.NE" - s_Logic=s_TMP - else if ( N3.eq.N5 ) then - s_N5X = s_N3X - s_absN5X = s_absN3X - write( s_TMP,1232) trim(s_Logic),".and.NC.eq.NE" - s_Logic=s_TMP - else if ( N4.eq.N5 ) then - s_N5X = s_N4X - s_absN5X = s_absN4X - write( s_TMP,1232) trim(s_Logic),".and.ND.eq.NE" - s_Logic=s_TMP - else - s_N5X = "NE" - if ( N5X .gt. 0 ) Then - s_absN5X = s_N5X - else - s_absN5X = "(-NE)" - endif - endif - - ASym=.False. - mqc_LenArr = mqc_Lind5(.False.,N1X,N2X,N3X,N4X,N5X,ASym,Abs(N1X), & - Abs(N2X),Abs(N3X),Abs(N4X),abs(N5X),Sign, & - s_N1X,s_N2X,s_N3X,s_N4X,s_N5X, & - s_absN1X,s_absN2X,s_absN3X,s_absN4X,s_absN5X, & - s_Lind5_result,s_Logic)+1 - call mqc_simplify_formula_F2C(s_Lind5_result) - write( s_formula, 1233) trim(s_Lind5_result),"+1 Here's the logic:",trim(s_Logic) - - Return - End Function mqc_Lenarr -!hph- - -!hph+ - - Integer(kind=int64) Function mqc_Lind2(Check,N1,N2,ASym,I,J,Sign, & - s_N1,s_N2,s_I,s_J,s_Lind2_result, s_Logic) - - Implicit None -! -! Linear or square indexing, I,J are 1-based, -! output is 0-based. Sign is +/-1. -! - Logical,intent(in)::Check,ASym - Integer(kind=int64),intent(out)::Sign - Integer(kind=int64),intent(in)::N1,N2,I,J - character(LEN=*),intent(in)::s_N1,s_N2,s_I,s_J - character(LEN=*),intent(out)::s_Lind2_result, s_Logic - character(LEN=1024) s_TMP - - Sign = 1 - If(Check.and.(N2.le.0.or.N1.eq.0.or.(N1.lt.0.and.N1.ne.(-N2)).or. & - I.lt.1.or.I.gt.Abs(N1).or.J.lt.1.or.J.gt.N2)) then - mqc_Lind2 = -1 - s_Lind2_result = "-1" - Return - endIf - 1231 format(a) - 1232 format(2a) - 1233 format(3a) - 1234 format(4a) - 1235 format(5a) - 1236 format(6a) - 1237 format(7a) - If(N1.lt.0) then - write(s_TMP,1234) trim(s_Logic),".and.",trim(s_N1),".lt.0" - s_Logic = s_TMP - If(I.ge.J) then - write(s_TMP,1235) trim(s_Logic),".and.",trim(s_I),".ge.",trim(s_J) - s_Logic = s_TMP - mqc_Lind2 = (I*(I-1))/2 + J - 1 - write( s_Lind2_result, 1237)"(",trim(s_I),"*(", & - trim(s_I),"-1))/2 + ",trim(s_J), "-1" - else - write(s_TMP,1235) trim(s_Logic),".and.",trim(s_I),".lt.",trim(s_J) - s_Logic = s_TMP - mqc_Lind2 = (J*(J-1))/2 + I - 1 - write( s_Lind2_result, 1237) "(",trim(s_J),"*(", & - trim(s_J),"-1))/2+",trim(s_I),"-1" - If(ASym) Sign = -1 - endIf - else - If(N1.gt.1) then - write(s_TMP,1234) trim(s_Logic),".and.",trim(s_N1),".gt.1" - else - write(s_TMP,1234) trim(s_Logic),".and.",trim(s_N1),".ge.0" - endif - s_Logic = s_TMP - mqc_Lind2 = N1*(J-1) + I - 1 - write( s_Lind2_result, 1236)trim(s_N1),"*(", & - trim(s_J),"-1)+",trim(s_I),"-1" - endIf - Return - End Function mqc_Lind2 - - Integer(kind=int64) Function mqc_Lind3(Check,N1,N2,N3,ASym,I,J,K,Sign, & - s_N1,s_N2,s_N3,s_I,s_J,s_K,s_Lind3_result,s_Logic) - Implicit None -! -! Linear or square indexing, I,J,K are 1-based, -! output is 0-based. Sign is +/-1. -! - Logical,intent(in)::Check - Logical,intent(inout)::ASym - Integer(kind=int64),intent(in)::N1,N2,N3,I,J,K - Integer(kind=int64),intent(out)::Sign - character(LEN=*),intent(in)::s_N1,s_N2,s_N3,s_I,s_J,s_K - character(LEN=*),intent(out)::s_Lind3_result, s_Logic - Integer(kind=int64) I1,J1,K1,N12,IJ - character(LEN=1024) s_ij,s_i1,s_j1,s_k1,s_N12,s_Lind2_result - 1231 format(a) - 1232 format(2a) - 1233 format(3a) - 1234 format(4a) - 1235 format(5a) - 1236 format(6a) - 1237 format(7a) - 1238 format(8a) - 1239 format(9a) - 1240 format(10a) - 1242 format(12a) - Sign = 1 - If(Check.and.(N3.le.0.or.(N1*N2).eq.0.or. & - (N1.lt.0.and.N1.ne.(-Abs(N2))).or. & - (N2.lt.0.and.N2.ne.(-N3)).or.I.lt.1.or.I.gt.Abs(N1).or. & - J.lt.1.or.J.gt.Abs(N2).or.K.lt.1.or.K.gt.N3)) then - mqc_Lind3 = -1 - s_Lind3_result = "-1" - Return - endIf - I1 = I - 1 - if ( I1 .ne. 0 ) Then - write( s_I1, 1233)"(",trim(s_I),"-1)" - else - s_I1 = "0" - endif - J1 = J - 1 - if ( J1 .ne. 0 ) Then - write( s_J1, 1233)"(",trim(s_J),"-1)" - else - s_J1 = "0" - endif - - K1 = K - 1 - if ( K1 .ne. 0 ) Then - write( s_K1, 1233)"(",trim(s_K),"-1)" - else - s_K1 = "0" - endif - - If(N1.gt.0) then - If(N2.gt.0) then - mqc_LInd3 = N1*(N2*K1+J1) + I1 - write( s_Lind3_result, 1239)trim(s_N1),"*(",trim(s_N2), & - "*",trim(s_K1),"+",trim(s_J1),")+",trim(s_I1) - else - mqc_Lind3 = N1*mqc_Lind2(.False.,N2,N3,ASym,J,K,Sign, & - s_N2,s_N3,s_J,s_K,s_Lind2_result,s_Logic) - write( s_Lind3_result, 1234)trim(s_N1),"*(", & - trim(s_Lind2_result),")" - endIf - else if(N2.gt.0) then - N12 = (N2*(N2+1))/2 - write( s_N12, 1235)"(",trim(s_N2),"*(", & - trim(s_N2),"+1))/2" - If(I.ge.J) then - IJ = (I*I1)/2 + J1 - write( s_IJ, 1236)"(",Trim(s_I),"*", & - Trim(s_I1),")/2 + ",Trim(s_J1) - else - IJ = (J*J1)/2 + I1 - write( s_IJ, 1236)"(",Trim(s_J),"*", & - Trim(s_J1),")/2+",Trim(s_I1) - If(ASym) Sign = -1 - endIf - mqc_Lind3 = (N12)*K1 + IJ - write( s_Lind3_result, 1236)"(",trim(s_N12),")*", & - trim(s_K1),"+",trim(s_IJ) - else - K1 = Max(I,J,K) - 1 - if ( I .eq. J ) then - if ( I .eq. K ) then - write( s_K1, 1233)"(",Trim(s_I),"-1)" - Else - write( s_K1, 1235)"(Max(",Trim(s_I),",", & - Trim(s_K),")-1)" - EndIf - Else - write( s_K1, 1237)"(Max(",Trim(s_I),",", & - Trim(s_J),",",Trim(s_K),")-1)" - EndIf - I1 = Min(I,J,K) - 1 - if ( I .eq. J ) then - if ( I .eq. K ) then - write( s_K1, 1233)"(",Trim(s_I),"-1)" - Else - write( s_I1, 1235)"(Min(",Trim(s_I),",", & - Trim(s_K),")-1)" - EndIf - Else - write( s_I1, 1237)"(Min(",Trim(s_I),",", & - Trim(s_J),",",Trim(s_K),")-1)" - EndIf - J1 = I + J + K - K1 - I1 - 3 - write( s_J1, 1240)Trim(s_I),"+",Trim(s_J),"+", & - Trim(s_K),"-",Trim(s_K1),"-",Trim(s_I1),"-3" - mqc_LInd3 = I1 + ((J1)*(J1+1))/2 + ((K1)*(K1+1)*(K1+2))/6 - write( s_Lind3_result, 1242)Trim(s_I1),"+((", & - Trim(s_J1),")*(",Trim(s_J1),"+1))/2+((", & - Trim(s_K1),")*(",Trim(s_K1),"+1)*(",Trim(s_K1),"+2))/6" - - endIf - Return - End Function mqc_Lind3 - - Integer(kind=int64) Function mqc_Lind4(Check,N1,N2,N3,N4,ASym,I,J,K,L,Sign, & - s_N1,s_N2,s_N3,s_N4,s_I,s_J,s_K,s_L, & - s_Lind4_result,s_Logic) - Implicit None -! -! Linear or square indexing, I,J,K,L are 1-based, -! output is 0-based. Sign is +/-1. -! - Logical,intent(in)::Check - Logical,intent(inout)::ASym - character(LEN=*),intent(in)::s_N1,s_N2,s_N3,s_N4,s_I,s_J,s_K,s_L - character(LEN=*),intent(out)::s_Lind4_result,s_Logic - Integer(kind=int64),intent(in)::N1,N2,N3,N4,I,J,K,L - Integer(kind=int64),intent(inout)::Sign - character(LEN=1024) s_I1,s_J1,s_K1,s_L1,s_ICase - character(LEN=1024) s_TMP1, s_TMP2, s_JK, s_JKL, s_KL - character(LEN=1024) s_ij, s_N12, s_n23, s_IJK, s_N123 - character(LEN=1024) s_Lind2_result, s_Lind3_result - Integer(kind=int64) I1,J1,K1,L1,ICase,N23 - Integer(kind=int64) N123,KL,IJ,IJK,JKL,JK,N12,SignIJ,SignKL -! - If(Check.and.(N4.le.0.or.(N1*N2*N3).eq.0.or. & - (N1.lt.0.and.N1.ne.(-Abs(N2))).or. & - (N2.lt.0.and.N2.ne.(-Abs(N3))).or. & - (N3.lt.0.and.N3.ne.(-N4)).or. & - I.lt.1.or.I.gt.Abs(N1).or.J.lt.1.or.J.gt.Abs(N2).or. & - K.lt.1.or.K.gt.Abs(N3).or.L.lt.1.or.L.gt.N4)) then - mqc_Lind4 = -1 - Sign = 1 - s_Lind4_result = "-1" - Return - endIf - 1231 format(a) - 1232 format(2a) - 1233 format(3a) - 1235 format(5a) - 1236 format(6a) - 1237 format(7a) - 1238 format(8a) - 1239 format(9a) - 1243 format(13a) - 1244 format(14a) - - I1 = I - 1 - if ( I1.ne.0 ) then - write(S_I1,1233)"(",trim(s_i),"-1)" - else - S_I1 = "0" - endif - J1 = J - 1 - if ( J1.ne.0 ) then - write(S_J1,1233)"(",trim(s_j),"-1)" - else - S_J1 = "0" - endif - K1 = K - 1 - if ( K1.ne.0 ) then - write(S_K1,1233)"(",trim(s_k),"-1)" - else - S_K1 = "0" - endif - L1 = L - 1 - if ( L1.ne.0 ) then - write(S_L1,1233)"(",trim(s_L),"-1)" - else - S_L1 = "0" - endif - - ICase = 0 - If(N1.lt.0 ) ICase = ICase + 1 - If(N2.lt.0) ICase = ICase + 2 - If(N3.lt.0) ICase = ICase + 4 - if ( ICase .eq. 0 ) then -! -! No symmetries. -! - If(N1.gt.1 ) then - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".gt.1" - else - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".ge.0" - endif - s_Logic=s_TMP1 - If(N2.gt.1 ) then - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N2),".gt.1" - else - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N2),".ge.0" - endif - s_Logic=s_TMP1 - If(N3.gt.1 ) then - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N3),".gt.1" - else - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N3),".ge.0" - endif - s_Logic=s_TMP1 - - mqc_Lind4 = N1*(N2*(N3*L1+K1)+J1) + I1 - write(s_Lind4_result,1243)trim(s_N1),"*(", & - trim(s_N2),"*(", trim(s_N3),"*",trim(s_L1), & - "+",trim(s_K1),")+",trim(s_J1),")+",trim(s_I1) - Sign = 1 - Return - else if ( ICase .eq. 1 ) then -! -! I<=J -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".lt.0.and.", & - trim(s_N2),".ge.0.and.",trim(s_N3),".ge.0" - s_Logic=s_TMP1 - - IJ = mqc_Lind2(.False.,N1,N2,ASym,I,J,Sign, & - s_N1,s_N2,s_I,s_J,s_Lind2_result,s_Logic) - s_ij = s_Lind2_result - N12 = (N2*(N2+1))/2 - write(s_n12,1237)"(",Trim(s_N2),"*(",trim(s_N2),"+1))/2" - - mqc_Lind4 = N12*(N3*L1+K1) + IJ - write(s_Lind4_result,1239)trim(s_N12),"*(",Trim(s_N3),"*", & - Trim(s_L1),"+",Trim(s_K1),")+",trim(s_IJ) - - Return - else if ( ICase .eq. 2 ) then -! -! I,J<=K,L -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".ge.0.and.", & - trim(s_N2),".lt.0.and.",trim(s_N3),".ge.0" - s_Logic=s_TMP1 - - JK = mqc_Lind2(.False.,N2,N3,ASym,J,K,Sign, & - s_N2,s_N3,s_J,s_K,s_Lind2_result,s_Logic) - s_JK = s_Lind2_result - - N23 = (N3*(N3+1))/2 - write(s_n23,1235)"(",Trim(s_N3),"*(", Trim(s_N3),"+1))/2" - mqc_Lind4 = N1*(N23*L1+JK) + I1 - - write(s_Lind4_result,1239)trim(s_N1),"*(",trim(s_N23), & - "*",trim(s_L1),"+",trim(s_JK),")+",trim(s_I1) - Return - else if ( ICase .eq. 3 ) then -! -! I<=J<=K,L -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".lt.0.and.", & - trim(s_N2),".lt.0.and.",trim(s_N3),".ge.0" - - s_Logic=s_TMP1 - - IJK = mqc_Lind3(.False.,N1,N2,N3,ASym,I,J,K,Sign, & - s_N1,s_N2,s_N3,s_I,s_J,s_K,s_Lind3_result,s_Logic) - s_IJK = s_Lind3_result - - N123 = (N3*(N3+1)*(N3+2))/6 - write(s_N123,1237)"(",Trim(s_N3),"*(",Trim(s_N3),"+1)*(", & - Trim(s_N3),"+2))/6" - - mqc_Lind4 = (N123)*L1 + IJK - if ( L1 .eq. 0 .or. N123 .eq. 0 ) then - s_Lind4_result = Trim(s_IJK) - Else - write(s_Lind4_result,1236)"(",Trim(s_N123),")*", & - Trim(s_L1),"+",Trim(s_IJK) - EndIf - Return - else if ( ICase .eq. 4 ) then -! -! I,J,K<=L -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".ge.0.and.", & - trim(s_N2),".ge.0.and.",trim(s_N3),".lt.0" - s_Logic=s_TMP1 - - KL = mqc_Lind2(.False.,N3,N4,ASym,K,L,Sign, & - s_N3,s_N4,s_K,s_L,s_Lind2_result,s_Logic) - s_KL = s_Lind2_result - - mqc_Lind4 = N1*(N2*(KL)+J1) + I1 - write(s_Lind4_result,1239)trim(s_N1),"*(",trim(s_N2), & - "*(",trim(s_KL),")+",trim(s_J1),")+",trim(s_I1) - Return - else if ( ICase .eq. 5 ) then -! -! I<=J,K<=L -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".lt.0.and.", & - trim(s_N2),".ge.0.and.",trim(s_N3),".lt.0" - s_Logic=s_TMP1 - - IJ = mqc_Lind2(.False.,N1,N2,ASym,I,J,SignIJ, & - s_N1,s_N2,s_I,s_J,s_Lind2_result,s_Logic) - s_IJ = s_Lind2_result - - KL = mqc_Lind2(.False.,N3,N4,ASym,K,L,SignKL, & - s_N3,s_N4,s_K,s_L,s_Lind2_result,s_Logic) - s_KL = s_Lind2_result - - N12 = (N2*(N2+1))/2 - write(s_N12,1235)"(",trim(s_N2),"*(",trim(s_N2),"+1))/2" - - mqc_Lind4 = N12*(KL) + IJ - write(s_Lind4_result,1235)trim(s_N12),"*(",trim(s_KL),")+", & - trim(s_IJ) - Sign = SignIJ*SignKL - Return - else if ( ICase .eq. 6 ) then -! -! I,J<=K<=L -! - write(s_TMP1,1238)trim(s_Logic),".and.",trim(s_N1),".ge.0.and.", & - trim(s_N2),".lt.0.and.",trim(s_N3),".lt.0" - s_Logic=s_TMP1 - - JKL = mqc_Lind3(.False.,N2,N3,N4,ASym,J,K,L,Sign, & - s_N2,s_N3,s_N4,s_J,s_K,s_L,s_Lind3_result,s_Logic) - s_JKL = s_Lind3_result - - mqc_Lind4 = N1*(JKL) + I1 - If ( N1.eq.0 .or. JKL.eq.0) then - s_Lind4_result = s_I1 - Else - write(s_Lind4_result,1235)trim(s_N1),"*(", & - trim(s_JKL),")+",trim(s_I1) - EndIF - Return - else if ( ICase .eq. 7 ) then -! -! I<=J<=K<=L -! - write(s_TMP1,1238) trim(s_Logic),".and.",trim(s_N1),".lt.0.and.", & - trim(s_N2),".lt.0.and.",trim(s_N3),".lt.0" - s_Logic=s_TMP1 - - IJ = mqc_Lind2(.False.,N1,N4,ASym,I,J,SignIJ, & - s_N1,s_N4,s_I,s_J,s_Lind2_result,s_Logic) - s_IJ = s_Lind2_result - - KL = mqc_Lind2(.False.,N3,N4,ASym,K,L,SignKL, & - s_N3,s_N4,s_K,s_L,s_Lind2_result,s_Logic) - s_kl = s_Lind2_result - - write(s_TMP1,1233)"(",trim(s_IJ),"+1)" - write(s_TMP2,1233)"(",trim(s_KL),"+1)" - mqc_Lind4 = mqc_Lind2(.False.,N1,N4,ASym,IJ+1,KL+1,Sign, & - s_N1,s_N4,s_TMP1,s_TMP2,s_Lind2_result,s_Logic) - s_Lind4_result = s_Lind2_result - - Sign = Sign*SignIJ*SignKL - endif - Return - End Function mqc_Lind4 - - Integer(kind=int64) Function mqc_Lind5(Check,N1,N2,N3,N4,N5,ASym,I,J,K,L, & - M,Sign,s_N1,s_N2,s_N3,s_N4,s_N5,s_I,s_J,s_K,s_L,s_M, & - s_Lind5_result,s_Logic) - Implicit None -! -! Linear or square indexing, I,J,K,L,M are 1-based, output is -! 0-based. Sign is +/-1, LM indices can not be lower triangular. -! - Logical,intent(in)::Check - Logical,intent(inout)::ASym - Integer(kind=int64),intent(in)::N1,N2,N3,N4,N5,I,J,K,L,M - Integer(kind=int64),intent(inout)::Sign - Integer(kind=int64) M1,N1A,N2A,N3A,N1234 - character(LEN=*),intent(in)::s_N1,s_N2,s_N3,s_N4,s_N5,s_I - character(LEN=*),intent(in)::s_J,s_K,s_L,s_M - character(LEN=*),intent(out)::s_Lind5_result,s_Logic - character(LEN=1024) s_M1, s_N1A, s_N2A, s_N3A - character(LEN=1024) s_N1234, s_Lind4_result -! - If(Check.and.(N5.le.0.or.N4.le.0.or.(N1*N2*N3).eq.0.or. & - (N1.lt.0.and.N1.ne.(-Abs(N2))).or. & - (N2.lt.0.and.N2.ne.(-Abs(N3))).or. & - (N3.lt.0.and.N2.ne.(-N4)).or. & - I.lt.1.or.I.gt.Abs(N1).or.J.lt.1.or.J.gt.Abs(N2).or. & - K.lt.1.or.K.gt.Abs(N3).or.L.lt.1.or.L.gt.N4)) then - mqc_Lind5 = -1 - Sign = 1 - s_Lind5_result = "-1" - Return - endIf - 1231 format(a) - 1232 format(2a) - 1233 format(3a) - 1235 format(5a) - 1236 format(6a) - M1 = M - 1 - if ( M1.ne.0 ) then - write( s_M1, 1233) "(",trim(s_M),"-1)" - else - s_M1 = "0" - endif - - N1A = abs(N1) - if ( N1.lt.0 ) then - write( s_N1A, 1233) "(-(",trim(s_N1),"))" - else - s_N1A = s_N1 - endif - - N2A = abs(N2) - if ( N2.lt.0 ) then - write( s_N2A, 1233) "(-(",trim(s_N2),"))" - else - s_N2A = s_N2 - endif - - N3A = abs(N3) - if ( N3.lt.0 ) then - write( s_N3A, 1233) "(-(",trim(s_N3),"))" - else - s_N3A = s_N3 - endif - - N1234 = mqc_Lind4(.False.,N1,N2,N3,N4,ASym,N1A,N2A,N3A,N4,Sign, & - s_N1,s_N2,s_N3,s_N4,s_N1A,s_N2A,s_N3A, & - s_N4,s_Lind4_result,s_Logic) + 1 - write( s_N1234, 1233) "(",trim(s_Lind4_result),"+1)" - - mqc_Lind5 = mqc_Lind4(.False.,N1,N2,N3,N4,ASym,I,J,K,L,Sign, & - s_N1,s_N2,s_N3,s_N4,s_I,s_J,s_K,s_L, & - s_Lind4_result,s_Logic ) + N1234*M1 - - if ( M1.eq.0 .or. N1234.eq.0 ) then - s_Lind5_result = s_Lind4_result - Else - write( s_Lind5_result, 1235) trim(s_Lind4_result),"+", & - trim(s_N1234),"*",trim(s_M1) - EndIF - - Return - End Function mqc_Lind5 - -!hph- - - subroutine mqc_StripSpaces(string) - character(len=*) :: string - integer :: stringLen - integer :: last, actual - - stringLen = len (string) - last = 1 - actual = 1 - - do while (actual < stringLen) - if (string(last:last) == ' ') then - actual = actual + 1 - string(last:last) = string(actual:actual) - string(actual:actual) = ' ' - else - last = last + 1 - if (actual < last) & - actual = last - endif - end do - end subroutine mqc_StripSpaces - -!hph+ - - Subroutine Rd_RMixed(IU,NTot,LenBuf,IArr,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - Call RdRMixed4(IU,NTot,LenBuf,IArr,Arr) - else -! File requires 64-bit integers, so no change - Call RdRMixed8(IU,NTot,LenBuf,IArr,Arr) - endif - Return - End Subroutine Rd_RMixed - - subroutine RdRMixed8(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int64),Dimension(lenbuf)::iBuf - Real(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - read(iu) iBuf, buf - do i = 1, ndo - iarr(ind+i) = ibuf(i) - arr(ind+i) = buf(i) - enddo - enddo - return - end subroutine RdRMixed8 - - subroutine RdRMixed4(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32),Dimension(lenbuf)::iBuf - Real(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - read(iu) iBuf, buf - do i = 1, ndo - iarr(ind+i) = ibuf(i) - arr(ind+i) = buf(i) - enddo - enddo - return - end subroutine RdRMixed4 - - Subroutine Wr_RMixed(IU,NTot,LenBuf,IArr,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - Call WrRMixed4(IU,NTot,LenBuf,IArr,Arr) - else -! File requires 64-bit integers, so no change - Call WrRMixed8(IU,NTot,LenBuf,IArr,Arr) - endif - Return - End Subroutine Wr_RMixed - - subroutine WrRMixed8(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int64),Dimension(lenbuf)::iBuf - Real(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - do i = 1, ndo - ibuf(i) = iarr(ind+i) - buf(i) = arr(ind+i) - enddo - write(iu) iBuf, buf - enddo - return - end subroutine WrRMixed8 - - subroutine WrRMixed4(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32),Dimension(lenbuf)::iBuf - Real(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - do i = 1, ndo - ibuf(i) = iarr(ind+i) - buf(i) = arr(ind+i) - enddo - write(iu) iBuf, buf - enddo - return - end subroutine WrRMixed4 - - Subroutine Rd_CMixed(IU,NTot,LenBuf,IArr,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Complex(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - Call RdCMixed4(IU,NTot,LenBuf,IArr,Arr) - else -! File requires 64-bit integers, so no change - Call RdCMixed8(IU,NTot,LenBuf,IArr,Arr) - endif - Return - End Subroutine Rd_CMixed - - subroutine RdCMixed8(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Complex(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int64),Dimension(lenbuf)::iBuf - Complex(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - read(iu) iBuf, buf - do i = 1, ndo - iarr(ind+i) = ibuf(i) - arr(ind+i) = buf(i) - enddo - enddo - return - end subroutine RdCMixed8 - - subroutine RdCMixed4(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(NTot),Intent(Out)::IArr - Complex(kind=real64),Dimension(NTot),Intent(Out)::Arr - - Integer(kind=int32),Dimension(lenbuf)::iBuf - Complex(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - read(iu) iBuf, buf - do i = 1, ndo - iarr(ind+i) = ibuf(i) - arr(ind+i) = buf(i) - enddo - enddo - return - end subroutine RdCMixed4 - - Subroutine Wr_CMixed(IU,NTot,LenBuf,IArr,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Complex(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - Call WrCMixed4(IU,NTot,LenBuf,IArr,Arr) - else -! File requires 64-bit integers, so no change - Call WrCMixed8(IU,NTot,LenBuf,IArr,Arr) - endif - Return - End Subroutine Wr_CMixed - - subroutine WrCMixed8(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(:),Intent(Out)::IArr - Complex(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int64),Dimension(lenbuf)::iBuf - Complex(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - do i = 1, ndo - ibuf(i) = iarr(ind+i) - buf(i) = arr(ind+i) - enddo - write(iu) iBuf, buf - enddo - return - end subroutine WrCMixed8 - - subroutine WrCMixed4(IU,NTot,LenBuf,IArr,Arr) - implicit none - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Integer(kind=int64),Dimension(NTot),Intent(Out)::IArr - Complex(kind=real64),Dimension(NTot),Intent(Out)::Arr - - Integer(kind=int32),Dimension(lenbuf)::iBuf - Complex(kind=real64),Dimension(lenbuf)::Buf - - integer ind,ndo,i -! - do ind = 0, (ntot-1), lenbuf - ndo = min(lenbuf,ntot-ind) - do i = 1, ndo - ibuf(i) = iarr(ind+i) - buf(i) = arr(ind+i) - enddo - write(iu) iBuf, buf - enddo - return - end subroutine WrCMixed4 - - Subroutine Rd_2EN(IU,NR,LR,LRNR,NTot,LenBuf,RArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NR,LR,LRNR,NTot,LenBuf - Real(kind=real64),Dimension(:),Intent(InOut)::RArr - - Integer(kind=int32)::IU_4,NR_4,LR_4,LRNR_4,NTot_4,LenBuf_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LR_4 = LR - LRNR_4 = LRNR - NTot_4 = NTot - LenBuf_4 = LenBuf - call Rd2EN4(IU,NR,LR,LRNR,NTot,LenBuf,RArr) - else -! File requires 64-bit integers, so no change - call Rd2EN8(IU,NR,LR,LRNR,NTot,LenBuf,RArr) - endif - Return - End Subroutine Rd_2EN - - Subroutine Rd_RBuf(IU,NTot,LenBuf,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Real(kind=real64),Dimension(:),Intent(Out)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - Call RdRBuf4(IU_4,NTot_4,LenBuf_4,Arr) - else -! File requires 64-bit integers, so no change - Call RdRBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Rd_RBuf - - Subroutine Wr_LRBuf(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - Implicit None - - Character(Len=*),Intent(In)::Label - Integer(kind=int64),Intent(In)::IU - Logical,Intent(In)::ASym - Integer(kind=int64),Intent(In)::NR,LenBuf,N1,N2,N3,N4,N5 - Real(kind=real64),Dimension(:),Intent(InOut)::X - - Integer(kind=int32)::NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4 - Integer(kind=int32)::IU_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LenBuf_4 = LenBuf - N1_4 = N1 - N2_4 = N2 - N3_4 = N3 - N4_4 = N4 - N5_4 = N5 - call WrLRBuf4(IU_4,Label,NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4,ASym,X) - else -! File requires 64-bit integers, so no change - call WrLRBuf8(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - endif - Return - End Subroutine Wr_LRBuf - - Subroutine Wr_Head(IU,NAtoms,NAt3,NBasis,IAn,IAtTyp,AtmChg,C,IBfAtm, & - IBfTyp,AtmWgt,NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB,NPrmDB,NBTot) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NAtoms,NAt3,NBasis - INTEGER(kind=int64),Dimension(NAtoms),Intent(In)::IAn - INTEGER(kind=int64),Dimension(NAtoms),Intent(In)::IAtTyp - REAL(kind=real64),Dimension(:),Intent(In)::AtmChg - REAL(kind=real64),Dimension(:),Intent(In)::C - INTEGER(kind=int64),Dimension(NBasis),Intent(In)::IBfTyp - INTEGER(kind=int64),Dimension(NBasis),Intent(In)::IBfAtm - REAL(kind=real64),Dimension(:),Intent(In)::AtmWgt - Integer(kind=int64),Intent(In)::NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB,NPrmDB,NBTot - - Integer(kind=int32)::IU_4,NAtoms_4,NAt3_4,NBasis_4 - INTEGER(kind=int32),Dimension(NAtoms)::IAn_4 - INTEGER(kind=int32),Dimension(NAtoms)::IAtTyp_4 - INTEGER(kind=int32),Dimension(NBasis)::IBfTyp_4 - INTEGER(kind=int32),Dimension(NBasis)::IBfAtm_4 - Integer(kind=int32)::NFC_4,NFV_4,ITran_4,IDum9_4,NShlAO_4,NPrmAO_4,NShlDB_4,NPrmDB_4,NBTot_4 - - Integer(kind=int64) I - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NAtoms_4 = NAtoms - NAt3_4 = NAt3 - NBasis_4 = NBasis - DO i = 1, NAtoms - IAn_4(I) = IAn(I) - IAtTyp_4(I) = IAtTyp(I) - Enddo - DO i = 1, NBasis - IBfTyp_4(I) = IBfTyp(I) - IBfAtm_4(I) = IBfAtm(I) - Enddo - NFC_4 = NFC - NFV_4 = NFV - ITran_4 = ITran - IDum9_4 = IDum9 - NShlAO_4 = NShlAO - NPrmAO_4 = NPrmAO - NShlDB_4 = NShlDB - NPrmDB_4 = NPrmDB - NBTot_4 = NBTot - Call WrHead4(IU_4,NAtoms_4,NAt3_4,NBasis_4,IAn_4,IAtTyp_4,AtmChg,C,IBfAtm_4, & - IBfTyp_4,AtmWgt,NFC_4,NFV_4,ITran_4,IDum9_4,NShlAO_4,NPrmAO_4,NShlDB_4,NPrmDB_4,NBTot_4) - - else -! File requires 64-bit integers, so no change - Call WrHead8(IU,NAtoms,NAt3,NBasis,IAn,IAtTyp,AtmChg,C,IBfAtm, & - IBfTyp,AtmWgt,NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB,NPrmDB,NBTot) - endif - Return - End Subroutine Wr_Head - - Subroutine Rd_Head(IU,NLab,NAtoms,NBasis,IAn,IAtTyp,AtmChg,C, & - IBfAtm,IBfTyp,AtmWgt,NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB, & - NPrmDB,NBTot) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NAtoms,NBasis,NLab - Integer(kind=int64),Dimension(NAtoms),Intent(Out)::IAn - Integer(kind=int64),Dimension(NAtoms),Intent(Out)::IAtTyp - Real(kind=real64),Dimension(:),Intent(Out)::AtmChg - Real(kind=real64),Dimension(:),Intent(InOut)::C - Integer(kind=int64),Dimension(NBasis),Intent(Out)::IBfAtm - Integer(kind=int64),Dimension(NBasis),Intent(Out)::IBfTyp - Real(kind=real64),Dimension(:),Intent(InOut)::AtmWgt - Integer(kind=int64),Intent(Out)::NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB,NPrmDB,NBTot - - Integer(kind=int32)::IU_4,NAtoms_4,NBasis_4,NLab_4 - Integer(kind=int32),Dimension(NAtoms)::IAn_4 - Integer(kind=int32),Dimension(NAtoms)::IAtTyp_4 - Integer(kind=int32),Dimension(NBasis)::IBfAtm_4 - Integer(kind=int32),Dimension(NBasis)::IBfTyp_4 - Integer(kind=int32)::NFC_4,NFV_4,ITran_4,IDum9_4,NShlAO_4,NPrmAO_4,NShlDB_4,NPrmDB_4,NBTot_4 - Integer(kind=int64)::I - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NAtoms_4 = NAtoms - NBasis_4 = NBasis - NLab_4 = NLab - Call RdHead4(IU_4,NLab_4,NAtoms_4,NBasis_4,IAn_4,IAtTyp_4,AtmChg,C, & - IBfAtm_4,IBfTyp_4,AtmWgt,NFC_4,NFV_4,ITran_4,IDum9_4,NShlAO_4,NPrmAO_4,NShlDB_4, & - NPrmDB_4,NBTot_4) - DO I = 1,NAtoms - IAn(I) = IAn_4(I) - IAtTyp(I) = IAtTyp_4(I) - ENDDO - DO I = 1,NBasis - IBfAtm(I) = IBfAtm_4(I) - IBfTyp(I) = IBfTyp_4(I) - ENDDO - NFC = NFC_4 - NFV = NFV_4 - ITran = ITran_4 - IDum9 = IDum9_4 - NShlAO = NShlAO_4 - NPrmAO = NPrmAO_4 - NShlDB = NShlDB_4 - NPrmDB = NPrmDB_4 - NBTot = NBTot_4 - else -! File requires 64-bit integers, so no change - Call RdHead8(IU,NLab,NAtoms,NBasis,IAn,IAtTyp,AtmChg,C, & - IBfAtm,IBfTyp,AtmWgt,NFC,NFV,ITran,IDum9,NShlAO,NPrmAO,NShlDB, & - NPrmDB,NBTot) - Endif - Return - End Subroutine Rd_Head - - Subroutine Wr_LIBuf(IU,Label,NI,LenBuf,N1,N2,N3,N4,N5,ASym,IX) - Implicit None -! - Character(Len=*),Intent(In)::Label - Integer(kind=int64),Intent(In)::IU - Logical,Intent(In)::ASym - Integer(kind=int64),Intent(In)::NI,LenBuf,N1,N2,N3,N4,N5 - Integer(kind=int64),Dimension(:),Intent(In)::IX - - Integer(kind=int32) IU_4,NI_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4 - - Integer(kind=int32),Dimension(:),Allocatable::IX_4 - Integer(kind=int32)::I - Integer(kind=int64)::NTot -! -! This routine writes and integer array, so it needs to be copied. -! - Integer(kind=int32)::AllocateStatus - Integer(kind=int32)::DeAllocateStatus - Integer(kind=int64), external::LenAr8 -! - Integer(kind=int64)::Iout - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NI_4 = NI - LenBuf_4 = LenBuf - N1_4 = N1 - N2_4 = N2 - N3_4 = N3 - N4_4 = N4 - N5_4 = N5 - NTot = LenAr8(N1,N2,N3,N4,N5) - Iout = 6 - Allocate ( IX_4(NTot), STAT = AllocateStatus) - IF (AllocateStatus /= 0) call MQC_Error_I('Not Enough Memory', Iout, 'NTot', NTot) - do i=1, NTot - IX_4(i) = IX(i) - enddo - call WrLIBuf4(IU_4,Label,NI_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4,ASym,IX_4) - DEALLOCATE (IX_4, STAT = DeAllocateStatus) - IF (DeAllocateStatus /= 0) call MQC_Error_I('Not able to deallocate Memory', Iout, 'NTot', NTot) - else -! File requires 64-bit integers, so no change - call WrLIBuf8(IU,Label,NI,LenBuf,N1,N2,N3,N4,N5,ASym,IX) - endif - Return - End Subroutine Wr_LIBuf - - Subroutine Wr_LCBuf(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - Implicit None - - Character(Len=*),Intent(In)::Label - Integer(kind=int64),Intent(In)::IU - Logical,Intent(In)::ASym - Integer(kind=int64),Intent(In)::NR,LenBuf,N1,N2,N3,N4,N5 - Complex(kind=real64),Dimension(:),Intent(InOut)::X - - Integer(kind=int32)::NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4 - Integer(kind=int32)::IU_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NR_4 = NR - LenBuf_4 = LenBuf - N1_4 = N1 - N2_4 = N2 - N3_4 = N3 - N4_4 = N4 - N5_4 = N5 - call WrLCBuf4(IU_4,Label,NR_4,LenBuf_4,N1_4,N2_4,N3_4,N4_4,N5_4,ASym,X) - else -! File requires 64-bit integers, so no change - call WrLCBuf8(IU,Label,NR,LenBuf,N1,N2,N3,N4,N5,ASym,X) - endif - Return - End Subroutine Wr_LCBuf - -!PROCEDURE Rd_ChBuf - Subroutine Rd_ChBuf(IU,LR,LenBuf,CArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,LR,LenBuf - Character(Len=*),Intent(InOut)::CArr - - Integer(kind=int32)::IU_4,LR_4,LenBuf_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! -! File requires 32-bit integers. -! - IU_4 = IU - LR_4 = LR - LenBuf_4 = LenBuf - call Rd_ChBuf4(IU_4,LR_4,LenBuf_4,CArr) - else -! -! File requires 64-bit integers, so no change. -! - call Rd_ChBuf8(IU,LR,LenBuf,CArr) - endif - Return - End Subroutine Rd_ChBuf - -!PROCEDURE Rd_ChBufI - Subroutine Rd_ChBufI(IU,LR,LenBuf,CArr,IArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,LR,LenBuf - Character(Len=*),Intent(InOut)::CArr - Integer(kind=int64),Dimension(LR),Intent(Out)::IArr - - Integer(kind=int32)::IU_4,LR_4,LenBuf_4 - Integer(kind=int32),Dimension(LR)::IArr_4 - Integer(kind=int64)::I - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! -! File requires 32-bit integers. -! - IU_4 = IU - LR_4 = LR - LenBuf_4 = LenBuf - call Rd_ChBuf4I(IU_4,LR_4,LenBuf_4,CArr,IArr_4) - do I = 1,LR - IArr(I) = IArr_4(I) - endDo - else -! -! File requires 64-bit integers, so no change. -! - call Rd_ChBuf8I(IU,LR,LenBuf,CArr,IArr) - endif - Return - End Subroutine Rd_ChBufI - -!PROCEDURE Wr_ChBuf - Subroutine Wr_ChBuf(IU,LR,LenBuf,CArr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,LR,LenBuf - Character(Len=*),Intent(In)::CArr - - Integer(kind=int32)::IU_4,LR_4,LenBuf_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! -! File requires 32-bit integers. -! - IU_4 = IU - LR_4 = LR - LenBuf_4 = LenBuf - call Wr_ChBuf4(IU_4,LR_4,LenBuf_4,CArr) - else -! -! File requires 64-bit integers, so no change. -! - call Wr_ChBuf8(IU,LR,LenBuf,CArr) - endif - Return - End Subroutine Wr_ChBuf - - Subroutine Rd_CBuf(IU,NTot,LenBuf,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Complex(kind=real64),Dimension(NTot),Intent(InOut)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - call RdCBuf4(IU_4,NTot_4,LenBuf_4,Arr) - else -! File requires 64-bit integers, so no change - call RdCBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Rd_CBuf - - Subroutine Wr_CBuf(IU,NTot,LenBuf,Arr) - Implicit None - - Integer(kind=int64),Intent(In)::IU,NTot,LenBuf - Complex(kind=real64),Dimension(NTot),Intent(In)::Arr - - Integer(kind=int32)::IU_4,NTot_4,LenBuf_4 - - Integer(kind=int32)::IntPrecision, Call_Test - Character(Len=64)::Name - - Call_Test = 0 - call MQC_Mat_Precision(Name, IntPrecision, Call_Test) - if ( IntPrecision .eq. 4 ) then -! File requires 32-bit integers - IU_4 = IU - NTot_4 = NTot - LenBuf_4 = LenBuf - call WrCBuf4(IU_4,NTot_4,LenBuf_4,Arr) - else -! File requires 64-bit integers, so no change - call WrCBuf8(IU,NTot,LenBuf,Arr) - endif - Return - End Subroutine Wr_CBuf -!hph- - - End Module MQC_MatWrapper diff --git a/src/mqc_matwrapper_direct.F03 b/src/mqc_matwrapper_direct.F03 new file mode 100644 index 00000000..db65fb04 --- /dev/null +++ b/src/mqc_matwrapper_direct.F03 @@ -0,0 +1,613 @@ +#if defined(MQC_GAUOPEN_API_PUBLIC) && defined(MQC_GAUOPEN_API_FRONTIER) +#error "Only one GauOpen API family may be selected." +#elif !defined(MQC_GAUOPEN_API_PUBLIC) && !defined(MQC_GAUOPEN_API_FRONTIER) +#error "A GauOpen API family must be selected by configure." +#endif + + module MQC_MatWrapper +! +! *********************************************************************** +! *********************************************************************** +! ** ** +! ** The Merced Quantum Chemistry Package ** +! ** (MQCPack) ** +! ** ** +! ** Written By: ** +! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** +! ** Mullally, and Hrant P. Hratchian ** +! ** ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** +! ** ** +! ** ** +! ** Modules beloning to MQCPack: ** +! ** 1. MQC_General ** +! ** 2. MQC_Binary ** +! ** 3. MQC_DataStructures ** +! ** 4. MQC_Integrals ** +! ** 5. MQC_Algebra ** +! ** 6. MQC_Files ** +! ** 7. MQC_Molecule ** +! ** 8. MQC_EST ** +! ** 9. MQC_Gaussian ** +! ** ** +! *********************************************************************** +! *********************************************************************** +! +! This module is the MQCPack-owned adapter for unmodified GauOpen +! qcmatrix.F and qcmatrixio.F sources compiled with 8-byte integers. It +! normalizes the public version-2 ASym API and the frontier TypeA API. +! Raw GauOpen procedure names remain external and unmodified; prefixed +! adapter names keep them separate from MQCPack's module symbols. +! +! H. P. Hratchian, 2026. +! + use iso_fortran_env, only: int32, int64, real64 + use MQC_General, only: mqc_error,mqc_error_a,mqc_error_i + implicit none + private + public::MQC_MatrixFile_Layout + public::MQC_MatrixFile_Character_Record_Layout + public::MQC_MatrixFile_Get_Character_Record_Layout + public::MQC_MatrixFile_Get_Character_Write_Layout + public::MQC_MatrixFile_Open_Read,MQC_MatrixFile_Open_Write + public::MQC_MatrixFile_Close,MQC_MatrixFile_Len_Array + public::MQC_MatrixFile_Read_Header,MQC_MatrixFile_Write_Header + public::MQC_MatrixFile_Read_Label,MQC_MatrixFile_Write_Label + public::MQC_MatrixFile_Read_Character_Buffer + public::MQC_MatrixFile_Write_Character_Buffer + public::MQC_MatrixFile_Read_Integer_Buffer + public::MQC_MatrixFile_Read_Real_Buffer + public::MQC_MatrixFile_Read_Complex_Buffer + public::MQC_MatrixFile_Read_Two_Electron + public::MQC_MatrixFile_Read_Indexed_Real,MQC_MatrixFile_Skip + public::MQC_MatrixFile_Write_AO_Two_Electron + public::MQC_MatrixFile_Write_Real_Array + public::MQC_MatrixFile_Write_Integer_Array + public::MQC_MatrixFile_Write_Complex_Array +! + character(len=*),parameter::publicCharacterError = & + 'Character FAF I/O requires the GauOpen frontier TypeA API; '// & + 'the configured public GauOpen API does not provide character '// & + 'record support.' +! + type MQC_MatrixFile_Layout + integer(kind=int32)::integerBytes=0 + integer(kind=int64)::fileVersion=0 + integer(kind=int64)::nHeaderRecords=0 + integer(kind=int64)::len12Bytes=0 + integer(kind=int64)::len4Bytes=0 + logical::rawFormat=.false. + contains + procedure,public::set => MQC_MatrixFile_Layout_Set + procedure,public::setForWrite => MQC_MatrixFile_Layout_Set_For_Write + end type MQC_MatrixFile_Layout +! + type MQC_MatrixFile_Character_Record_Layout + integer(kind=int64)::elementCount=0 + integer(kind=int64)::elementWidth=0 + integer(kind=int64)::payloadCharacters=0 + integer(kind=int64)::bufferCharacters=0 + integer(kind=int64)::payloadWords=0 + integer(kind=int64)::bufferWords=0 + end type MQC_MatrixFile_Character_Record_Layout +! + contains +! +!PROCEDURE MQC_MatrixFile_Layout_Set + subroutine MQC_MatrixFile_Layout_Set(layout,fileVersion, & + nHeaderRecords,len12Bytes,len4Bytes) +! +! Store layout metadata read from an 8-byte GauOpen MatrixFile header. +! +! H. P. Hratchian, 2026. +! + implicit none + class(MQC_MatrixFile_Layout),intent(inout)::layout + integer(kind=int64),intent(in)::fileVersion,nHeaderRecords, & + len12Bytes,len4Bytes +! + if(len12Bytes.ne.8_int64) & + call mqc_error_i('MatrixFile Len12L is incompatible with the '// & + 'configured 8-byte GauOpen ABI.',6_int64,'len12Bytes',len12Bytes) + if(len4Bytes.ne.8_int64) & + call mqc_error_i('MatrixFile Len4L is incompatible with the '// & + 'configured 8-byte GauOpen ABI.',6_int64,'len4Bytes',len4Bytes) +#ifdef MQC_GAUOPEN_API_PUBLIC + if(fileVersion.ge.3_int64) & + call mqc_error_i('The configured public GauOpen API cannot safely '// & + 'identify character records in a frontier version-3 FAF.', & + 6_int64,'fileVersion',fileVersion) +#endif +! + layout%integerBytes = 8_int32 + layout%fileVersion = fileVersion + layout%nHeaderRecords = nHeaderRecords + layout%len12Bytes = len12Bytes + layout%len4Bytes = len4Bytes + layout%rawFormat = .false. +! + return + end subroutine MQC_MatrixFile_Layout_Set +! +!PROCEDURE MQC_MatrixFile_Layout_Set_For_Write + subroutine MQC_MatrixFile_Layout_Set_For_Write(layout) +! +! Initialize layout metadata for the configured 8-byte GauOpen ABI. +! +! H. P. Hratchian, 2026. +! + implicit none + class(MQC_MatrixFile_Layout),intent(inout)::layout +! + layout%integerBytes = 8_int32 +#ifdef MQC_GAUOPEN_API_PUBLIC + layout%fileVersion = 2_int64 +#else + layout%fileVersion = 3_int64 +#endif + layout%nHeaderRecords = 11_int64 + layout%len12Bytes = 8_int64 + layout%len4Bytes = 8_int64 + layout%rawFormat = .false. +! + return + end subroutine MQC_MatrixFile_Layout_Set_For_Write +! +!PROCEDURE MQC_MatrixFile_Get_Character_Record_Layout + function MQC_MatrixFile_Get_Character_Record_Layout(layout,nTot, & + lenBuf,n1,n2,n3,n4,n5,typeA) result(recordLayout) +! +! Normalize GauOpen character-record words into fixed-width elements. +! +! H. P. Hratchian, 2026. +! + implicit none + type(MQC_MatrixFile_Layout),intent(in)::layout + integer(kind=int64),intent(in)::nTot,lenBuf,n1,n2,n3,n4,n5,typeA + type(MQC_MatrixFile_Character_Record_Layout)::recordLayout + integer(kind=int64)::rawElementCount +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call mqc_error(publicCharacterError,6_int64) + return +#else + if(layout%len4Bytes.le.0) & + call mqc_error_i('Character FAF record has invalid Len4L.', & + 6_int64,'layout%len4Bytes',layout%len4Bytes) + if(nTot.le.0) & + call mqc_error_i('Character FAF record has invalid NTot.', & + 6_int64,'nTot',nTot) + if(lenBuf.le.0) & + call mqc_error_i('Character FAF record has invalid LenBuf.', & + 6_int64,'lenBuf',lenBuf) + if(typeA.le.0) & + call mqc_error_i('Character FAF record has invalid TypeA.', & + 6_int64,'typeA',typeA) +! + rawElementCount = MQC_MatrixFile_Len_Array(n1,n2,n3,n4,n5) + if(rawElementCount.le.0) & + call mqc_error_i('Character FAF record has invalid raw dimensions.', & + 6_int64,'rawElementCount',rawElementCount) + recordLayout%payloadCharacters = layout%len4Bytes*nTot + recordLayout%payloadWords = nTot + if(typeA.eq.1) then + recordLayout%elementWidth = recordLayout%payloadCharacters + else + recordLayout%elementWidth = typeA + endIf + if(mod(recordLayout%payloadCharacters, & + recordLayout%elementWidth).ne.0) & + call mqc_error('Character FAF payload length is not divisible by '// & + 'the logical element width.',6_int64) + recordLayout%elementCount = recordLayout%payloadCharacters/ & + recordLayout%elementWidth + recordLayout%bufferCharacters = layout%len4Bytes*lenBuf + recordLayout%bufferWords = lenBuf +#endif +! + return + end function MQC_MatrixFile_Get_Character_Record_Layout +! +!PROCEDURE MQC_MatrixFile_Get_Character_Write_Layout + function MQC_MatrixFile_Get_Character_Write_Layout(layout, & + elementCount,elementWidth,bufferWords) result(recordLayout) +! +! Translate fixed-width character elements into GauOpen word counts. +! +! H. P. Hratchian, 2026. +! + implicit none + type(MQC_MatrixFile_Layout),intent(in)::layout + integer(kind=int64),intent(in)::elementCount,elementWidth,bufferWords + type(MQC_MatrixFile_Character_Record_Layout)::recordLayout +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call mqc_error(publicCharacterError,6_int64) + return +#else + if(layout%len4Bytes.le.0) & + call mqc_error_i('Character FAF write has invalid Len4L.', & + 6_int64,'layout%len4Bytes',layout%len4Bytes) + if(elementCount.le.0) & + call mqc_error_i('Character FAF write has no logical elements.', & + 6_int64,'elementCount',elementCount) + if(elementWidth.le.1) & + call mqc_error_i('Character FAF element width must be greater than '// & + 'one; TypeA=1 is the legacy scalar marker.',6_int64, & + 'elementWidth',elementWidth) + if(bufferWords.le.0) & + call mqc_error_i('Character FAF write has invalid buffer words.', & + 6_int64,'bufferWords',bufferWords) +! + recordLayout%elementCount = elementCount + recordLayout%elementWidth = elementWidth + recordLayout%payloadCharacters = elementCount*elementWidth + if(mod(recordLayout%payloadCharacters,layout%len4Bytes).ne.0) & + call mqc_error('Character FAF payload must occupy a whole number '// & + 'of Len4L words.',6_int64) + recordLayout%payloadWords = recordLayout%payloadCharacters/ & + layout%len4Bytes + recordLayout%bufferWords = bufferWords + recordLayout%bufferCharacters = layout%len4Bytes*bufferWords +#endif +! + return + end function MQC_MatrixFile_Get_Character_Write_Layout +! +!PROCEDURE MQC_MatrixFile_Open_Read + subroutine MQC_MatrixFile_Open_Read(name,iUnit,labFil,iVers,nLab, & + gVers,title,nAtoms,nBasis,nBasisUse,iCharge,multiplicity, & + nElectrons,len12L,len4L,iOpCl,icgu) + implicit none + character(len=*),intent(in)::name + character(len=64),intent(inout)::labFil,gVers,title + integer(kind=int64),intent(out)::iUnit,iVers,nLab,nAtoms,nBasis, & + nBasisUse,iCharge,multiplicity,nElectrons,len12L,len4L,iOpCl,icgu +! + call Open_Read(name,iUnit,labFil,iVers,nLab,gVers,title,nAtoms, & + nBasis,nBasisUse,iCharge,multiplicity,nElectrons,len12L,len4L, & + iOpCl,icgu) + if(iUnit.eq.-1_int64) & + call mqc_error_a('Unable to open MatrixFile for reading.',6_int64, & + 'name',name) +! + return + end subroutine MQC_MatrixFile_Open_Read +! +!PROCEDURE MQC_MatrixFile_Open_Write + subroutine MQC_MatrixFile_Open_Write(name,iUnit,labFil,gVers,title, & + nAtoms,nBasis,nBasisUse,iCharge,multiplicity,nElectrons,iOpCl,icgu) + implicit none + character(len=*),intent(in)::name + character(len=64),intent(inout)::labFil,gVers,title + integer(kind=int64),intent(out)::iUnit + integer(kind=int64),intent(in)::nAtoms,nBasis,nBasisUse,iCharge, & + multiplicity,nElectrons,iOpCl,icgu +! + call Open_Write(name,iUnit,labFil,gVers,title,nAtoms,nBasis, & + nBasisUse,iCharge,multiplicity,nElectrons,iOpCl,icgu) + if(iUnit.eq.-1_int64) & + call mqc_error_a('Unable to open MatrixFile for writing.',6_int64, & + 'name',name) +! + return + end subroutine MQC_MatrixFile_Open_Write +! +!PROCEDURE MQC_MatrixFile_Close + subroutine MQC_MatrixFile_Close(iUnit) + implicit none + integer(kind=int64),intent(in)::iUnit +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Close_MatF(iUnit) +#else + call Close_FAF(.false.,iUnit) +#endif + return + end subroutine MQC_MatrixFile_Close +! +!PROCEDURE MQC_MatrixFile_Len_Array + function MQC_MatrixFile_Len_Array(n1,n2,n3,n4,n5) & + result(arrayLength) + implicit none + integer(kind=int64),intent(in)::n1,n2,n3,n4,n5 + integer(kind=int64)::arrayLength + integer(kind=int64),external::LenArr +! + arrayLength = LenArr(n1,n2,n3,n4,n5) + return + end function MQC_MatrixFile_Len_Array +! +!PROCEDURE MQC_MatrixFile_Read_Header + subroutine MQC_MatrixFile_Read_Header(iUnit,nLab,nAtoms,nBasis, & + atomicNumbers,atomTypes,atomicCharges,cartesians,basisFunction2Atom, & + basisFunctionTypes,atomicWeights,nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal) + implicit none + integer(kind=int64),intent(in)::iUnit,nLab,nAtoms,nBasis + integer(kind=int64),dimension(nAtoms),intent(out)::atomicNumbers, & + atomTypes + real(kind=real64),dimension(:),intent(out)::atomicCharges + real(kind=real64),dimension(:),intent(inout)::cartesians,atomicWeights + integer(kind=int64),dimension(nBasis),intent(out)::basisFunction2Atom, & + basisFunctionTypes + integer(kind=int64),intent(out)::nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal +! + call Rd_Head(iUnit,nLab,nAtoms,nBasis,atomicNumbers,atomTypes, & + atomicCharges,cartesians,basisFunction2Atom,basisFunctionTypes, & + atomicWeights,nfc,nfv,iTran,iDum9,nShellAO,nPrimitiveAO,nShellDB, & + nPrimitiveDB,nBasisTotal) + return + end subroutine MQC_MatrixFile_Read_Header +! +!PROCEDURE MQC_MatrixFile_Write_Header + subroutine MQC_MatrixFile_Write_Header(iUnit,nAtoms,nAtomCoordinates, & + nBasis,atomicNumbers,atomTypes,atomicCharges,cartesians, & + basisFunction2Atom,basisFunctionTypes,atomicWeights,nfc,nfv,iTran, & + iDum9,nShellAO,nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal) + implicit none + integer(kind=int64),intent(in)::iUnit,nAtoms,nAtomCoordinates,nBasis + integer(kind=int64),dimension(nAtoms),intent(in)::atomicNumbers, & + atomTypes + real(kind=real64),dimension(:),intent(in)::atomicCharges,cartesians, & + atomicWeights + integer(kind=int64),dimension(nBasis),intent(in)::basisFunction2Atom, & + basisFunctionTypes + integer(kind=int64),intent(in)::nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal +! + call Wr_Head(iUnit,nAtoms,nAtomCoordinates,nBasis,atomicNumbers, & + atomTypes,atomicCharges,cartesians,basisFunction2Atom, & + basisFunctionTypes,atomicWeights,nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal) + return + end subroutine MQC_MatrixFile_Write_Header +! +!PROCEDURE MQC_MatrixFile_Read_Label + subroutine MQC_MatrixFile_Read_Label(iUnit,iVers,label,nInteger, & + nReal,nTotal,bufferLength,n1,n2,n3,n4,n5,typeA,nRealInteger, & + endOfFile) + implicit none + integer(kind=int64),intent(in)::iUnit,iVers + character(len=64),intent(out)::label + integer(kind=int64),intent(out)::nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,typeA,nRealInteger + logical,intent(out)::endOfFile +#ifdef MQC_GAUOPEN_API_PUBLIC + logical::asymmetric +#endif +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Rd_Labl(iUnit,iVers,label,nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,asymmetric,nRealInteger,endOfFile) + typeA = 0_int64 + if(asymmetric) typeA = -1_int64 +#else + call Rd_Labl(iUnit,iVers,label,nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,typeA,nRealInteger,endOfFile) +#endif + return + end subroutine MQC_MatrixFile_Read_Label +! +!PROCEDURE MQC_MatrixFile_Write_Label + subroutine MQC_MatrixFile_Write_Label(iUnit,label,nInteger,nReal, & + nTotal,bufferLength,n1,n2,n3,n4,n5,typeA) + implicit none + integer(kind=int64),intent(in)::iUnit,nInteger,nReal,nTotal, & + bufferLength,n1,n2,n3,n4,n5,typeA + character(len=*),intent(in)::label +#ifdef MQC_GAUOPEN_API_PUBLIC + logical::asymmetric +#endif +! + if(nReal.lt.0) & + call mqc_error('MQC_MatrixFile_Write_Label: nReal must be '// & + 'nonnegative.',6_int64) +#ifdef MQC_GAUOPEN_API_PUBLIC + if(typeA.ne.0_int64.and.typeA.ne.-1_int64) & + call mqc_error(publicCharacterError,6_int64) + asymmetric = typeA.eq.-1_int64 + call Wr_Labl(iUnit,label,nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,asymmetric) +#else + call Wr_Labl(iUnit,label,nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,typeA) +#endif + return + end subroutine MQC_MatrixFile_Write_Label +! +!PROCEDURE MQC_MatrixFile_Read_Character_Buffer + subroutine MQC_MatrixFile_Read_Character_Buffer(iUnit,nCharacters, & + bufferLength,characterArray) + implicit none + integer(kind=int64),intent(in)::iUnit,nCharacters,bufferLength + character(len=*),intent(inout)::characterArray +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call mqc_error(publicCharacterError,6_int64) +#else + call Rd_ChBuf(iUnit,nCharacters,bufferLength,characterArray) +#endif + return + end subroutine MQC_MatrixFile_Read_Character_Buffer +! +!PROCEDURE MQC_MatrixFile_Write_Character_Buffer + subroutine MQC_MatrixFile_Write_Character_Buffer(iUnit,nCharacters, & + bufferLength,characterArray) + implicit none + integer(kind=int64),intent(in)::iUnit,nCharacters,bufferLength + character(len=*),intent(in)::characterArray +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call mqc_error(publicCharacterError,6_int64) +#else + call Wr_ChBuf(iUnit,nCharacters,bufferLength,characterArray) +#endif + return + end subroutine MQC_MatrixFile_Write_Character_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Integer_Buffer + subroutine MQC_MatrixFile_Read_Integer_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + integer(kind=int64),dimension(nTotal),intent(out)::array +! + call Rd_IBuf(iUnit,nTotal,bufferLength,array) + return + end subroutine MQC_MatrixFile_Read_Integer_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Real_Buffer + subroutine MQC_MatrixFile_Read_Real_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + real(kind=real64),dimension(:),intent(out)::array +! + call Rd_RBuf(iUnit,nTotal,bufferLength,array) + return + end subroutine MQC_MatrixFile_Read_Real_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Complex_Buffer + subroutine MQC_MatrixFile_Read_Complex_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + complex(kind=real64),dimension(nTotal),intent(inout)::array +! + call Rd_CBuf(iUnit,nTotal,bufferLength,array) + return + end subroutine MQC_MatrixFile_Read_Complex_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Two_Electron + subroutine MQC_MatrixFile_Read_Two_Electron(iUnit,nReal,recordLength, & + recordBlockLength,nTotal,bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nReal,recordLength, & + recordBlockLength,nTotal,bufferLength + real(kind=real64),dimension(:),intent(inout)::array +! + call Rd_2EN(iUnit,nReal,recordLength,recordBlockLength,nTotal, & + bufferLength,array) + return + end subroutine MQC_MatrixFile_Read_Two_Electron +! +!PROCEDURE MQC_MatrixFile_Read_Indexed_Real + subroutine MQC_MatrixFile_Read_Indexed_Real(iUnit,nReal,recordLength, & + nTotal,bufferLength,nNonzero,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nReal,recordLength,nTotal, & + bufferLength + integer(kind=int64),intent(out)::nNonzero + real(kind=real64),dimension(:),intent(out)::array +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Rd_RInd(iUnit,nReal,recordLength,nTotal,bufferLength,nNonzero, & + array) +#else + call Rd_RInd(iUnit,nReal,recordLength,nReal*recordLength,nTotal, & + bufferLength,array) + nNonzero = nTotal +#endif + return + end subroutine MQC_MatrixFile_Read_Indexed_Real +! +!PROCEDURE MQC_MatrixFile_Skip + subroutine MQC_MatrixFile_Skip(iUnit,nTotal,bufferLength) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength +! + call Rd_Skip(iUnit,nTotal,bufferLength) + return + end subroutine MQC_MatrixFile_Skip +! +!PROCEDURE MQC_MatrixFile_Write_AO_Two_Electron + subroutine MQC_MatrixFile_Write_AO_Two_Electron(iUnit,label,nReal, & + bufferLength,nIntegrals,integrals) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,nIntegrals + real(kind=real64),dimension(:),intent(inout)::integrals +! + call Wr_LAO2E(iUnit,label,nReal,bufferLength,nIntegrals,integrals) + return + end subroutine MQC_MatrixFile_Write_AO_Two_Electron +! +!PROCEDURE MQC_MatrixFile_Write_Real_Array + subroutine MQC_MatrixFile_Write_Real_Array(iUnit,label,nReal, & + bufferLength,n1,n2,n3,n4,n5,asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,n1,n2,n3, & + n4,n5 + logical,intent(in)::asymmetric + real(kind=real64),dimension(:),intent(inout)::array +#ifdef MQC_GAUOPEN_API_FRONTIER + integer(kind=int64)::typeA +#endif +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Wr_LRBuf(iUnit,label,nReal,bufferLength,n1,n2,n3,n4,n5, & + asymmetric,array) +#else + typeA = 0_int64 + if(asymmetric) typeA = -1_int64 + call Wr_LRBuf(iUnit,label,nReal,bufferLength,n1,n2,n3,n4,n5,typeA, & + array) +#endif + return + end subroutine MQC_MatrixFile_Write_Real_Array +! +!PROCEDURE MQC_MatrixFile_Write_Integer_Array + subroutine MQC_MatrixFile_Write_Integer_Array(iUnit,label,nInteger, & + bufferLength,n1,n2,n3,n4,n5,asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nInteger,bufferLength,n1,n2, & + n3,n4,n5 + logical,intent(in)::asymmetric + integer(kind=int64),dimension(:),intent(in)::array +#ifdef MQC_GAUOPEN_API_FRONTIER + integer(kind=int64)::typeA +#endif +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Wr_LIBuf(iUnit,label,nInteger,bufferLength,n1,n2,n3,n4,n5, & + asymmetric,array) +#else + typeA = 0_int64 + if(asymmetric) typeA = -1_int64 + call Wr_LIBuf(iUnit,label,nInteger,bufferLength,n1,n2,n3,n4,n5, & + typeA,array) +#endif + return + end subroutine MQC_MatrixFile_Write_Integer_Array +! +!PROCEDURE MQC_MatrixFile_Write_Complex_Array + subroutine MQC_MatrixFile_Write_Complex_Array(iUnit,label,nReal, & + bufferLength,n1,n2,n3,n4,n5,asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,n1,n2,n3, & + n4,n5 + logical,intent(in)::asymmetric + complex(kind=real64),dimension(:),intent(inout)::array +#ifdef MQC_GAUOPEN_API_FRONTIER + integer(kind=int64)::typeA +#endif +! +#ifdef MQC_GAUOPEN_API_PUBLIC + call Wr_LCBuf(iUnit,label,nReal,bufferLength,n1,n2,n3,n4,n5, & + asymmetric,array) +#else + typeA = 0_int64 + if(asymmetric) typeA = -1_int64 + call Wr_LCBuf(iUnit,label,ABS(nReal),bufferLength,n1,n2,n3,n4,n5, & + typeA,array) +#endif + return + end subroutine MQC_MatrixFile_Write_Complex_Array +! + end module MQC_MatWrapper diff --git a/src/mqc_matwrapper_stub.F03 b/src/mqc_matwrapper_stub.F03 new file mode 100644 index 00000000..6319d6c9 --- /dev/null +++ b/src/mqc_matwrapper_stub.F03 @@ -0,0 +1,394 @@ + module MQC_MatWrapper +! +! *********************************************************************** +! *********************************************************************** +! ** ** +! ** The Merced Quantum Chemistry Package ** +! ** (MQCPack) ** +! ** ** +! ** Written By: ** +! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** +! ** Mullally, and Hrant P. Hratchian ** +! ** ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** +! ** ** +! ** ** +! ** Modules beloning to MQCPack: ** +! ** 1. MQC_General ** +! ** 2. MQC_Binary ** +! ** 3. MQC_DataStructures ** +! ** 4. MQC_Integrals ** +! ** 5. MQC_Algebra ** +! ** 6. MQC_Files ** +! ** 7. MQC_Molecule ** +! ** 8. MQC_EST ** +! ** 9. MQC_Gaussian ** +! ** ** +! *********************************************************************** +! *********************************************************************** +! +! This module preserves the MQC_Gaussian compile-time MatrixFile boundary +! in builds configured without GauOpen. Formatted-checkpoint operations do +! not call these routines; every MatrixFile operation reports one clear +! unsupported-feature error. +! +! H. P. Hratchian, 2026. +! + use iso_fortran_env, only: int32, int64, real64 + use MQC_General, only: mqc_error + implicit none + private + public::MQC_MatrixFile_Layout + public::MQC_MatrixFile_Character_Record_Layout + public::MQC_MatrixFile_Get_Character_Record_Layout + public::MQC_MatrixFile_Get_Character_Write_Layout + public::MQC_MatrixFile_Open_Read,MQC_MatrixFile_Open_Write + public::MQC_MatrixFile_Close,MQC_MatrixFile_Len_Array + public::MQC_MatrixFile_Read_Header,MQC_MatrixFile_Write_Header + public::MQC_MatrixFile_Read_Label,MQC_MatrixFile_Write_Label + public::MQC_MatrixFile_Read_Character_Buffer + public::MQC_MatrixFile_Write_Character_Buffer + public::MQC_MatrixFile_Read_Integer_Buffer + public::MQC_MatrixFile_Read_Real_Buffer + public::MQC_MatrixFile_Read_Complex_Buffer + public::MQC_MatrixFile_Read_Two_Electron + public::MQC_MatrixFile_Read_Indexed_Real,MQC_MatrixFile_Skip + public::MQC_MatrixFile_Write_AO_Two_Electron + public::MQC_MatrixFile_Write_Real_Array + public::MQC_MatrixFile_Write_Integer_Array + public::MQC_MatrixFile_Write_Complex_Array +! + character(len=*),parameter::MQC_NO_GAUOPEN_MESSAGE = & + 'MQCPack was configured without GauOpen support; MatrixFile '// & + 'operations are unavailable.' +! + type MQC_MatrixFile_Layout + integer(kind=int32)::integerBytes=0 + integer(kind=int64)::fileVersion=0 + integer(kind=int64)::nHeaderRecords=0 + integer(kind=int64)::len12Bytes=0 + integer(kind=int64)::len4Bytes=0 + logical::rawFormat=.false. + contains + procedure,public::set => MQC_MatrixFile_Layout_Set + procedure,public::setForWrite => MQC_MatrixFile_Layout_Set_For_Write + end type MQC_MatrixFile_Layout +! + type MQC_MatrixFile_Character_Record_Layout + integer(kind=int64)::elementCount=0 + integer(kind=int64)::elementWidth=0 + integer(kind=int64)::payloadCharacters=0 + integer(kind=int64)::bufferCharacters=0 + integer(kind=int64)::payloadWords=0 + integer(kind=int64)::bufferWords=0 + end type MQC_MatrixFile_Character_Record_Layout +! + contains +! +!PROCEDURE MQC_MatrixFile_Unsupported + subroutine MQC_MatrixFile_Unsupported() +! +! Report use of MatrixFile functionality from a FormChk-only build. +! +! H. P. Hratchian, 2026. +! + implicit none +! + call mqc_error(MQC_NO_GAUOPEN_MESSAGE) +! + return + end subroutine MQC_MatrixFile_Unsupported +! +!PROCEDURE MQC_MatrixFile_Layout_Set + subroutine MQC_MatrixFile_Layout_Set(layout,fileVersion, & + nHeaderRecords,len12Bytes,len4Bytes) + implicit none + class(MQC_MatrixFile_Layout),intent(inout)::layout + integer(kind=int64),intent(in)::fileVersion,nHeaderRecords, & + len12Bytes,len4Bytes +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Layout_Set +! +!PROCEDURE MQC_MatrixFile_Layout_Set_For_Write + subroutine MQC_MatrixFile_Layout_Set_For_Write(layout) + implicit none + class(MQC_MatrixFile_Layout),intent(inout)::layout +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Layout_Set_For_Write +! +!PROCEDURE MQC_MatrixFile_Get_Character_Record_Layout + function MQC_MatrixFile_Get_Character_Record_Layout(layout,nTot, & + lenBuf,n1,n2,n3,n4,n5,typeA) result(recordLayout) + implicit none + type(MQC_MatrixFile_Layout),intent(in)::layout + integer(kind=int64),intent(in)::nTot,lenBuf,n1,n2,n3,n4,n5,typeA + type(MQC_MatrixFile_Character_Record_Layout)::recordLayout +! + call MQC_MatrixFile_Unsupported() + end function MQC_MatrixFile_Get_Character_Record_Layout +! +!PROCEDURE MQC_MatrixFile_Get_Character_Write_Layout + function MQC_MatrixFile_Get_Character_Write_Layout(layout, & + elementCount,elementWidth,bufferWords) result(recordLayout) + implicit none + type(MQC_MatrixFile_Layout),intent(in)::layout + integer(kind=int64),intent(in)::elementCount,elementWidth,bufferWords + type(MQC_MatrixFile_Character_Record_Layout)::recordLayout +! + call MQC_MatrixFile_Unsupported() + end function MQC_MatrixFile_Get_Character_Write_Layout +! +!PROCEDURE MQC_MatrixFile_Open_Read + subroutine MQC_MatrixFile_Open_Read(name,iUnit,labFil,iVers,nLab, & + gVers,title,nAtoms, & + nBasis,nBasisUse,iCharge,multiplicity,nElectrons,len12L,len4L, & + iOpCl,icgu) + implicit none + character(len=*),intent(in)::name + character(len=64),intent(inout)::labFil,gVers,title + integer(kind=int64),intent(out)::iUnit,iVers,nLab,nAtoms,nBasis, & + nBasisUse,iCharge,multiplicity,nElectrons,len12L,len4L,iOpCl,icgu +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Open_Read +! +!PROCEDURE MQC_MatrixFile_Open_Write + subroutine MQC_MatrixFile_Open_Write(name,iUnit,labFil,gVers,title, & + nAtoms,nBasis, & + nBasisUse,iCharge,multiplicity,nElectrons,iOpCl,icgu) + implicit none + character(len=*),intent(in)::name + character(len=64),intent(inout)::labFil,gVers,title + integer(kind=int64),intent(out)::iUnit + integer(kind=int64),intent(in)::nAtoms,nBasis,nBasisUse,iCharge, & + multiplicity,nElectrons,iOpCl,icgu +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Open_Write +! +!PROCEDURE MQC_MatrixFile_Close + subroutine MQC_MatrixFile_Close(iUnit) + implicit none + integer(kind=int64),intent(in)::iUnit +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Close +! +!PROCEDURE MQC_MatrixFile_Len_Array + function MQC_MatrixFile_Len_Array(n1,n2,n3,n4,n5) & + result(arrayLength) + implicit none + integer(kind=int64),intent(in)::n1,n2,n3,n4,n5 + integer(kind=int64)::arrayLength +! + arrayLength = 0_int64 + call MQC_MatrixFile_Unsupported() + end function MQC_MatrixFile_Len_Array +! +!PROCEDURE MQC_MatrixFile_Read_Header + subroutine MQC_MatrixFile_Read_Header(iUnit,nLab,nAtoms,nBasis, & + atomicNumbers,atomTypes, & + atomicCharges,cartesians,basisFunction2Atom,basisFunctionTypes, & + atomicWeights,nfc,nfv,iTran,iDum9,nShellAO,nPrimitiveAO,nShellDB, & + nPrimitiveDB,nBasisTotal) + implicit none + integer(kind=int64),intent(in)::iUnit,nLab,nAtoms,nBasis + integer(kind=int64),dimension(nAtoms),intent(out)::atomicNumbers, & + atomTypes + real(kind=real64),dimension(:),intent(out)::atomicCharges + real(kind=real64),dimension(:),intent(inout)::cartesians,atomicWeights + integer(kind=int64),dimension(nBasis),intent(out)::basisFunction2Atom, & + basisFunctionTypes + integer(kind=int64),intent(out)::nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Header +! +!PROCEDURE MQC_MatrixFile_Write_Header + subroutine MQC_MatrixFile_Write_Header(iUnit,nAtoms,nAtomCoordinates, & + nBasis,atomicNumbers, & + atomTypes,atomicCharges,cartesians,basisFunction2Atom, & + basisFunctionTypes,atomicWeights,nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal) + implicit none + integer(kind=int64),intent(in)::iUnit,nAtoms,nAtomCoordinates,nBasis + integer(kind=int64),dimension(nAtoms),intent(in)::atomicNumbers, & + atomTypes + real(kind=real64),dimension(:),intent(in)::atomicCharges,cartesians, & + atomicWeights + integer(kind=int64),dimension(nBasis),intent(in)::basisFunction2Atom, & + basisFunctionTypes + integer(kind=int64),intent(in)::nfc,nfv,iTran,iDum9,nShellAO, & + nPrimitiveAO,nShellDB,nPrimitiveDB,nBasisTotal +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Header +! +!PROCEDURE MQC_MatrixFile_Read_Label + subroutine MQC_MatrixFile_Read_Label(iUnit,iVers,label,nInteger, & + nReal,nTotal, & + bufferLength,n1,n2,n3,n4,n5,typeA,nRealInteger,endOfFile) + implicit none + integer(kind=int64),intent(in)::iUnit,iVers + character(len=64),intent(out)::label + integer(kind=int64),intent(out)::nInteger,nReal,nTotal,bufferLength, & + n1,n2,n3,n4,n5,typeA,nRealInteger + logical,intent(out)::endOfFile +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Label +! +!PROCEDURE MQC_MatrixFile_Write_Label + subroutine MQC_MatrixFile_Write_Label(iUnit,label,nInteger,nReal, & + nTotal, & + bufferLength,n1,n2,n3,n4,n5,typeA) + implicit none + integer(kind=int64),intent(in)::iUnit,nInteger,nReal,nTotal, & + bufferLength,n1,n2,n3,n4,n5,typeA + character(len=*),intent(in)::label +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Label +! +!PROCEDURE MQC_MatrixFile_Read_Character_Buffer + subroutine MQC_MatrixFile_Read_Character_Buffer(iUnit,nCharacters, & + bufferLength,characterArray) + implicit none + integer(kind=int64),intent(in)::iUnit,nCharacters,bufferLength + character(len=*),intent(inout)::characterArray +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Character_Buffer +! +!PROCEDURE MQC_MatrixFile_Write_Character_Buffer + subroutine MQC_MatrixFile_Write_Character_Buffer(iUnit,nCharacters, & + bufferLength,characterArray) + implicit none + integer(kind=int64),intent(in)::iUnit,nCharacters,bufferLength + character(len=*),intent(in)::characterArray +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Character_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Integer_Buffer + subroutine MQC_MatrixFile_Read_Integer_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + integer(kind=int64),dimension(nTotal),intent(out)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Integer_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Real_Buffer + subroutine MQC_MatrixFile_Read_Real_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + real(kind=real64),dimension(:),intent(out)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Real_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Complex_Buffer + subroutine MQC_MatrixFile_Read_Complex_Buffer(iUnit,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength + complex(kind=real64),dimension(nTotal),intent(inout)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Complex_Buffer +! +!PROCEDURE MQC_MatrixFile_Read_Two_Electron + subroutine MQC_MatrixFile_Read_Two_Electron(iUnit,nReal,recordLength, & + recordBlockLength,nTotal, & + bufferLength,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nReal,recordLength, & + recordBlockLength,nTotal,bufferLength + real(kind=real64),dimension(:),intent(inout)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Two_Electron +! +!PROCEDURE MQC_MatrixFile_Read_Indexed_Real + subroutine MQC_MatrixFile_Read_Indexed_Real(iUnit,nReal,recordLength, & + nTotal,bufferLength, & + nNonzero,array) + implicit none + integer(kind=int64),intent(in)::iUnit,nReal,recordLength,nTotal, & + bufferLength + integer(kind=int64),intent(out)::nNonzero + real(kind=real64),dimension(:),intent(out)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Read_Indexed_Real +! +!PROCEDURE MQC_MatrixFile_Skip + subroutine MQC_MatrixFile_Skip(iUnit,nTotal,bufferLength) + implicit none + integer(kind=int64),intent(in)::iUnit,nTotal,bufferLength +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Skip +! +!PROCEDURE MQC_MatrixFile_Write_AO_Two_Electron + subroutine MQC_MatrixFile_Write_AO_Two_Electron(iUnit,label,nReal, & + bufferLength,nIntegrals, & + integrals) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,nIntegrals + real(kind=real64),dimension(:),intent(inout)::integrals +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_AO_Two_Electron +! +!PROCEDURE MQC_MatrixFile_Write_Real_Array + subroutine MQC_MatrixFile_Write_Real_Array(iUnit,label,nReal, & + bufferLength,n1,n2,n3,n4,n5, & + asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,n1,n2,n3, & + n4,n5 + logical,intent(in)::asymmetric + real(kind=real64),dimension(:),intent(inout)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Real_Array +! +!PROCEDURE MQC_MatrixFile_Write_Integer_Array + subroutine MQC_MatrixFile_Write_Integer_Array(iUnit,label,nInteger, & + bufferLength,n1,n2,n3,n4, & + n5,asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nInteger,bufferLength,n1,n2, & + n3,n4,n5 + logical,intent(in)::asymmetric + integer(kind=int64),dimension(:),intent(in)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Integer_Array +! +!PROCEDURE MQC_MatrixFile_Write_Complex_Array + subroutine MQC_MatrixFile_Write_Complex_Array(iUnit,label,nReal, & + bufferLength,n1,n2,n3,n4,n5, & + asymmetric,array) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),intent(in)::iUnit,nReal,bufferLength,n1,n2,n3, & + n4,n5 + logical,intent(in)::asymmetric + complex(kind=real64),dimension(:),intent(inout)::array +! + call MQC_MatrixFile_Unsupported() + end subroutine MQC_MatrixFile_Write_Complex_Array +! + end module MQC_MatWrapper diff --git a/src/mqc_molecule.F03 b/src/mqc_molecule.F03 index 82a42a31..2f6d9218 100644 --- a/src/mqc_molecule.F03 +++ b/src/mqc_molecule.F03 @@ -31,8 +31,8 @@ Module MQC_Molecule ! ** Lee M. Thompson, Xianghai Sheng, Andrew D. Mahler, Dave ** ! ** Mullally, and Hrant P. Hratchian ** ! ** ** -! ** Version 26.7.1 ** -! ** July 13, 2026 ** +! ** Version 26.7.2 ** +! ** July 30, 2026 ** ! ** ** ! ** ** ! ** Modules beloning to MQCPack: ** diff --git a/unitTests/src/unitTest01.f03 b/unitTests/src/unitTest01.f03 index 96629dc2..9f1c4c9c 100644 --- a/unitTests/src/unitTest01.f03 +++ b/unitTests/src/unitTest01.f03 @@ -1,55 +1,74 @@ - Program unitTest01 + program unitTest01 ! -! unitTest01: This unit test program tests the version reporting and -! checking routines in MQC_General. +! Validate MQCPack version reporting and inclusive version comparisons. +! Every expectation is checked directly so Automake receives a nonzero +! status if the version routines become inconsistent. ! -! -H. P. Hratchian, 2020. -! -! -! USE Connections +! H. P. Hratchian, 2020, 2026. ! + use iso_fortran_env, only: int64 use mqc_general -! -! Variable Declarations -! implicit none +! integer(kind=int64)::major,minor,revision character(len=512)::versionString -! -! Format Statements -! - 1000 Format(1x,'Major Version Number: ',I2,/, & - 1x,'Minor Version Number: ',I2,2x,'Revision Number: ',I2) - 1100 Format(/,1x,'Full Version String: <',A,'>',/) - 2000 Format(1x,'Is 2020: ',L1) - 2010 Format(1x,'Is 2020.5: ',L1) - 2020 Format(1x,'Is 2020.5.1: ',L1) - 2100 Format(1x,'Is 2020: ',L1) - 2110 Format(1x,'Is 2020.4: ',L1) - 2120 Format(1x,'Is 2020.4.0: ',L1) - 3000 Format(1x,'Is NEWER than 2018: ',L1) - 3100 Format(1x,'Is OLDER than 2018: ',L1) - 9000 Format(/,1x,'END OF unitTest01') - -! + character(len=64)::expectedVersion ! call mqc_version(major,minor,revision,versionString) - write(*,1000) major,minor,revision - write(*,1100) TRIM(versionString) -! -! - write(*,2000) mqc_version_check(isMajor=20) - write(*,2010) mqc_version_check(isMajor=20,isMinor=5) - write(*,2020) mqc_version_check(isMajor=20,isMinor=5,isRevision=1) -! -! - write(*,2100) mqc_version_check(isMajor=20) - write(*,2110) mqc_version_check(isMajor=20,isMinor=4) - write(*,2120) mqc_version_check(isMajor=20,isMinor=4,isRevision=0) -! + write(expectedVersion,'(I0,".",I0,".",I0)') major,minor,revision +! + call assertTrue(major.ge.0_int64.and.major.le.99_int64, & + 'The major version is not a two-digit calendar year.') + call assertTrue(minor.ge.1_int64.and.minor.le.12_int64, & + 'The minor version is not a calendar month.') + call assertTrue(revision.ge.0_int64, & + 'The revision counter is negative.') + call assertTrue(TRIM(versionString).eq.TRIM(expectedVersion), & + 'The full version string disagrees with its components.') +! + call assertTrue(mqc_version_check(isMajor=major), & + 'The exact major-version check failed.') + call assertTrue(mqc_version_check(isMajor=major,isMinor=minor), & + 'The exact major/minor-version check failed.') + call assertTrue(mqc_version_check(isMajor=major,isMinor=minor, & + isRevision=revision),'The exact full-version check failed.') + call assertTrue(.not.mqc_version_check(isMajor=major,isMinor=minor, & + isRevision=revision+1_int64), & + 'An incorrect revision was accepted as an exact match.') +! +! Older-than and newer-than comparisons are inclusive. +! + call assertTrue(mqc_version_check(newerThanMajor=major), & + 'The inclusive newer-than check rejected the current major version.') + call assertTrue(mqc_version_check(olderThanMajor=major), & + 'The inclusive older-than check rejected the current major version.') + call assertTrue(mqc_version_check(newerThanMajor=major-1_int64), & + 'The newer-than check rejected an older major version.') + call assertTrue(mqc_version_check(olderThanMajor=major+1_int64), & + 'The older-than check rejected a newer major version.') + call assertTrue(.not.mqc_version_check(newerThanMajor= & + major+1_int64),'The newer-than check accepted a newer version.') + call assertTrue(.not.mqc_version_check(olderThanMajor= & + major-1_int64),'The older-than check accepted an older version.') +! + write(*,'(1x,A)') 'unitTest01: PASS' +! + contains + + +!PROCEDURE assertTrue + subroutine assertTrue(condition,message) + implicit none + logical,intent(in)::condition + character(len=*),intent(in)::message ! - write(*,3000) mqc_version_check(newerThanMajor=18) - write(*,3100) mqc_version_check(olderThanMajor=18) + if(.not.condition) then + write(*,'(1x,A)') 'FAIL: '//TRIM(message) + error stop 1 + endIf ! - write(*,9000) + return + end subroutine assertTrue + + end program unitTest01 diff --git a/unitTests/src/unitTest02.f03 b/unitTests/src/unitTest02.f03 index ca568439..ece7dd6b 100644 --- a/unitTests/src/unitTest02.f03 +++ b/unitTests/src/unitTest02.f03 @@ -22,9 +22,12 @@ program unitTest02 type(MQC_Variable)::scalarVariable,vectorVariable,changedVariable type(MQC_Variable)::elementVariable,reshapedVariable,clearedVariable type(MQC_Variable)::adjustedVariable,lengthVariable,trimmedVariable + type(MQC_Variable)::scalarKernelVariable character(len=8),dimension(3)::vectorInput character(len=8),dimension(3)::intrinsicCharacterVector character(len=:),dimension(:),allocatable::vectorOutput + character(len=8),dimension(3)::vectorOutputFixed + character(len=8),dimension(3)::expectedCharacterVector character(len=:),allocatable::trimmedOutput character(len=8)::intrinsicCharacterScalar character(len=8)::scalarOutput @@ -71,8 +74,9 @@ program unitTest02 ! overloaded and type-bound MQC_Variable operations. ! intrinsicCharacterScalar = ' Ab' - intrinsicCharacterVector = & - [ character(len=8)::' One',' Two','Three' ] + intrinsicCharacterVector(1) = ' One' + intrinsicCharacterVector(2) = ' Two' + intrinsicCharacterVector(3) = 'Three' ! scalarOutput = mqc_adjustl(intrinsicCharacterScalar) call assertCharacter('general scalar adjustl',scalarOutput,'Ab') @@ -85,30 +89,22 @@ program unitTest02 call assertInteger('general scalar trim length', & LEN(trimmedOutput),4_int64) ! - vectorOutput = mqc_adjustl(intrinsicCharacterVector) - call assertCharacterVector('general vector adjustl',vectorOutput, & - [ character(len=8)::'One','Two','Three' ]) - vectorOutput = mqc_adjustr(intrinsicCharacterVector) - call assertCharacterVector('general vector adjustr',vectorOutput, & - [ character(len=8)::' One',' Two',' Three' ]) - integerVector = mqc_len_trim(intrinsicCharacterVector) - call assertIntegerVector('general vector len_trim',integerVector, & - [5_int64,4_int64,5_int64]) + call testGeneralCharacterVectors(intrinsicCharacterVector) ! - scalarVariable = intrinsicCharacterScalar - adjustedVariable = ADJUSTL(scalarVariable) + scalarKernelVariable = ' Ab ' + adjustedVariable = ADJUSTL(scalarKernelVariable) scalarOutput = adjustedVariable call assertCharacter('overloaded scalar adjustl',scalarOutput,'Ab') call assertInteger('adjustl preserves scalar length', & LEN(adjustedVariable),8_int64) - adjustedVariable = scalarVariable%adjustr() + adjustedVariable = scalarKernelVariable%adjustr() scalarOutput = adjustedVariable call assertCharacter('type-bound scalar adjustr',scalarOutput, & ' Ab') - lengthVariable = LEN_TRIM(scalarVariable) + lengthVariable = LEN_TRIM(scalarKernelVariable) integerScalar = lengthVariable call assertInteger('overloaded scalar len_trim',integerScalar,4_int64) - trimmedVariable = scalarVariable%trim() + trimmedVariable = scalarKernelVariable%trim() scalarOutput = trimmedVariable call assertCharacter('type-bound scalar trim',scalarOutput,' Ab') call assertInteger('trim changes scalar length', & @@ -117,12 +113,20 @@ program unitTest02 vectorVariable = intrinsicCharacterVector adjustedVariable = vectorVariable%adjustl() vectorOutput = adjustedVariable - call assertCharacterVector('type-bound vector adjustl',vectorOutput, & - [ character(len=8)::'One','Two','Three' ]) + vectorOutputFixed = vectorOutput + expectedCharacterVector(1) = 'One' + expectedCharacterVector(2) = 'Two' + expectedCharacterVector(3) = 'Three' + call assertTrue('type-bound vector adjustl', & + ALL(vectorOutputFixed.eq.expectedCharacterVector)) adjustedVariable = ADJUSTR(vectorVariable) vectorOutput = adjustedVariable - call assertCharacterVector('overloaded vector adjustr',vectorOutput, & - [ character(len=8)::' One',' Two',' Three' ]) + vectorOutputFixed = vectorOutput + expectedCharacterVector(1) = ' One' + expectedCharacterVector(2) = ' Two' + expectedCharacterVector(3) = ' Three' + call assertTrue('overloaded vector adjustr', & + ALL(vectorOutputFixed.eq.expectedCharacterVector)) lengthVariable = vectorVariable%len_trim() integerVector = [0_int64] integerVector = lengthVariable @@ -132,14 +136,18 @@ program unitTest02 ! Character vector assignment, extraction, insertion, reshape, and ! allocatable intrinsic assignment. ! - vectorInput = [ character(len=8)::'Alpha','bETA','Gamma' ] + vectorInput(1) = 'Alpha' + vectorInput(2) = 'bETA' + vectorInput(3) = 'Gamma' vectorVariable = vectorInput call assertInteger('vector rank',RANK(vectorVariable),1_int64) call assertInteger('vector size',SIZE(vectorVariable),3_int64) call assertInteger('vector dimension',SIZE(vectorVariable,1),3_int64) call assertInteger('vector length',LEN(vectorVariable),8_int64) vectorOutput = vectorVariable - call assertCharacterVector('vector round trip',vectorOutput,vectorInput) + vectorOutputFixed = vectorOutput + call assertTrue('vector round trip', & + ALL(vectorOutputFixed.eq.vectorInput)) ! call vectorVariable%put('Delta',[2_int64]) elementVariable = vectorVariable%getVal([2_int64]) @@ -148,12 +156,17 @@ program unitTest02 ! reshapedVariable = RESHAPE(vectorVariable,[3_int64]) vectorOutput = reshapedVariable - call assertCharacterVector('reshape preserves values',vectorOutput, & - [ character(len=8)::'Alpha','Delta','Gamma' ]) + vectorOutputFixed = vectorOutput + expectedCharacterVector(1) = 'Alpha' + expectedCharacterVector(2) = 'Delta' + expectedCharacterVector(3) = 'Gamma' + call assertTrue('reshape preserves values', & + ALL(vectorOutputFixed.eq.expectedCharacterVector)) changedVariable = MQC_Variable_mqc2mqc(vectorVariable) vectorOutput = changedVariable - call assertCharacterVector('explicit MQC copy',vectorOutput, & - [ character(len=8)::'Alpha','Delta','Gamma' ]) + vectorOutputFixed = vectorOutput + call assertTrue('explicit MQC copy', & + ALL(vectorOutputFixed.eq.expectedCharacterVector)) ! ! Clear must retain the fixed element width across the new vector. ! @@ -161,8 +174,10 @@ program unitTest02 call assertInteger('clear length',LEN(clearedVariable),5_int64) call clearedVariable%change_case('U') vectorOutput = clearedVariable - call assertCharacterVector('clear and change case',vectorOutput, & - [ character(len=5)::'MIXED','MIXED','MIXED' ]) + vectorOutputFixed = vectorOutput + expectedCharacterVector = 'MIXED' + call assertTrue('clear and change case', & + ALL(vectorOutputFixed.eq.expectedCharacterVector)) ! ! The scalar MQC conversion and the character printing wrappers are also ! part of the public character pathway. @@ -199,6 +214,33 @@ program unitTest02 ! contains + +!PROCEDURE testGeneralCharacterVectors + subroutine testGeneralCharacterVectors(input) + implicit none + character(len=8),dimension(3),intent(in)::input + character(len=8),dimension(3)::actual,expected + integer(kind=int64),dimension(:),allocatable::lengths +! + actual = mqc_adjustl(input) + expected(1) = 'One' + expected(2) = 'Two' + expected(3) = 'Three' + call assertTrue('general vector adjustl',ALL(actual.eq.expected)) +! + actual = mqc_adjustr(input) + expected(1) = ' One' + expected(2) = ' Two' + expected(3) = ' Three' + call assertTrue('general vector adjustr',ALL(actual.eq.expected)) +! + lengths = mqc_len_trim(input) + call assertIntegerVector('general vector len_trim',lengths, & + [5_int64,4_int64,5_int64]) +! + return + end subroutine testGeneralCharacterVectors + ! !PROCEDURE assertCharacter subroutine assertCharacter(label,actual,expected) @@ -217,25 +259,6 @@ end subroutine assertCharacter ! -!PROCEDURE assertCharacterVector - subroutine assertCharacterVector(label,actual,expected) - implicit none - character(len=*),intent(in)::label - character(len=*),dimension(:),intent(in)::actual,expected -! - if(SIZE(actual).ne.SIZE(expected)) then - write(*,'(1x,A)') 'FAIL: '//TRIM(label)//' size mismatch' - error stop 1 - endIf - if(ANY(actual.ne.expected)) then - write(*,'(1x,A)') 'FAIL: '//TRIM(label) - error stop 1 - endIf -! - return - end subroutine assertCharacterVector - - ! !PROCEDURE assertContains subroutine assertContains(label,actual,expectedSubstring) @@ -292,4 +315,20 @@ subroutine assertIntegerVector(label,actual,expected) end subroutine assertIntegerVector +! +!PROCEDURE assertTrue + subroutine assertTrue(label,condition) + implicit none + character(len=*),intent(in)::label + logical,intent(in)::condition +! + if(.not.condition) then + write(*,'(1x,A)') 'FAIL: '//TRIM(label) + error stop 1 + endIf +! + return + end subroutine assertTrue + + end program unitTest02 diff --git a/unitTests/src/unitTest03.f03 b/unitTests/src/unitTest03.f03 new file mode 100644 index 00000000..43a7a3ed --- /dev/null +++ b/unitTests/src/unitTest03.f03 @@ -0,0 +1,149 @@ + program unitTest03 +! +! Validate character scalar and fixed-width-vector FAF records through +! the public MQCPack interface. The final raw record deliberately uses +! Gaussian's legacy TypeA=1 scalar marker so the test also protects +! normalization, character-aware skipping, rewind, rank, width, and value +! behavior at the MatrixFile boundary. +! +! H. P. Hratchian, 2026. +! + use iso_fortran_env, only: int64 + use mqc_general + use mqc_algebra2 + use MQC_MatWrapper, only: & + Wr_Labl_TypeA => MQC_MatrixFile_Write_Label, & + Wr_ChBuf => MQC_MatrixFile_Write_Character_Buffer + use mqc_gaussian + implicit none +! + character(len=*),parameter::fileName='unitTest03-character.faf' + character(len=8),parameter::titleExpected='test' + character(len=8),parameter::legacyExpected='legacy' + character(len=72),parameter::routeExpected = & + '#p test geom=modela b3lyp sto-3g nosymm int=dkh output=faf '// & + 'iop(3/33=2)' + character(len=16),parameter::pointGroupExpected='C02V' + character(len=8),dimension(4),parameter::irrepExpected = & + [character(len=8)::'A1','A2','B1','B2'] + integer(kind=int64),parameter::lenBufWords=4000_int64 +! + type(MQC_Gaussian_Unformatted_Matrix_File)::outputFile,inputFile + type(MQC_Variable)::titleValue,routeValue,pointGroupValue,irrepValue + type(MQC_Variable)::readValue +! + call deleteFile(fileName) +! + titleValue = titleExpected + routeValue = routeExpected + pointGroupValue = pointGroupExpected + irrepValue = irrepExpected +! + call outputFile%writeArray2('TITLE',titleValue,filename=fileName) + call outputFile%writeArray2('ROUTE',routeValue) + call outputFile%writeArray2('POINT GROUP',pointGroupValue) + call outputFile%writeArray2('POINT GROUP IRREP NAMES',irrepValue) +! +! Append one width-8 scalar using raw TypeA=1. NTot and LenBuf are file +! words, while Wr_ChBuf receives the corresponding character counts. +! + call Wr_Labl_TypeA(outputFile%unitNumber,'LEGACY TITLE',1_int64, & + 0_int64,1_int64,lenBufWords,1_int64,1_int64,1_int64,1_int64, & + 1_int64,1_int64) + call Wr_ChBuf(outputFile%unitNumber,8_int64, & + outputFile%matrixFileLayout%len4Bytes*lenBufWords,legacyExpected) + call outputFile%closeFile() +! +! Reading the final record first forces the scanner to consume every +! preceding character payload. Later requests require rewind and rescan. +! + call inputFile%load(fileName) + call inputFile%getArray('LEGACY TITLE',mqcVarOut=readValue) + call validateScalar('LEGACY TITLE',readValue,legacyExpected,8_int64) + call inputFile%getArray('POINT GROUP IRREP NAMES',mqcVarOut=readValue) + call validateVector('POINT GROUP IRREP NAMES',readValue,irrepExpected) + call inputFile%getArray('ROUTE',mqcVarOut=readValue) + call validateScalar('ROUTE',readValue,routeExpected,72_int64) + call inputFile%getArray('POINT GROUP',mqcVarOut=readValue) + call validateScalar('POINT GROUP',readValue,pointGroupExpected, & + 16_int64) + call inputFile%getArray('TITLE',mqcVarOut=readValue) + call validateScalar('TITLE',readValue,titleExpected,8_int64) + call inputFile%closeFile() +! + call deleteFile(fileName) + write(*,'(1x,A)') 'unitTest03: PASS' +! + contains + + +!PROCEDURE validateScalar + subroutine validateScalar(label,value,expected,expectedWidth) + implicit none + character(len=*),intent(in)::label,expected + type(MQC_Variable),intent(in)::value + integer(kind=int64),intent(in)::expectedWidth + character(len=:),allocatable::actual +! + if(TRIM(value%getType()).ne.'CHARACTER') & + call mqc_error('Expected a character value for '//TRIM(label)) + if(RANK(value).ne.0) & + call mqc_error('Expected a scalar value for '//TRIM(label)) + if(SIZE(value).ne.1) & + call mqc_error('Expected one scalar element for '//TRIM(label)) + if(LEN(value).ne.expectedWidth) & + call mqc_error('Unexpected character width for '//TRIM(label)) + allocate(character(len=LEN(value))::actual) + actual = value + if(actual.ne.expected) & + call mqc_error('Unexpected character value for '//TRIM(label)) +! + return + end subroutine validateScalar + + +!PROCEDURE validateVector + subroutine validateVector(label,value,expected) + implicit none + character(len=*),intent(in)::label + type(MQC_Variable),intent(in)::value + character(len=*),dimension(:),intent(in)::expected + character(len=:),dimension(:),allocatable::actual +! + if(TRIM(value%getType()).ne.'CHARACTER') & + call mqc_error('Expected a character value for '//TRIM(label)) + if(RANK(value).ne.1) & + call mqc_error('Expected a vector value for '//TRIM(label)) + if(SIZE(value).ne.SIZE(expected)) & + call mqc_error('Unexpected vector size for '//TRIM(label)) + if(LEN(value).ne.LEN(expected)) & + call mqc_error('Unexpected vector width for '//TRIM(label)) + actual = value + if(ANY(actual.ne.expected)) & + call mqc_error('Unexpected vector values for '//TRIM(label)) +! + return + end subroutine validateVector + + +!PROCEDURE deleteFile + subroutine deleteFile(path) + implicit none + character(len=*),intent(in)::path + integer(kind=int64)::deleteUnit,ioStatus + logical::exists +! + inquire(file=path,exist=exists) + if(exists) then + open(newunit=deleteUnit,file=path,status='old',form='unformatted', & + access='sequential',iostat=ioStatus) + if(ioStatus.ne.0) & + call mqc_error('Unable to open temporary FAF for deletion.') + close(deleteUnit,status='delete') + endIf +! + return + end subroutine deleteFile + + + end program unitTest03 diff --git a/unitTests/src/unitTest04.f03 b/unitTests/src/unitTest04.f03 new file mode 100644 index 00000000..3da6900f --- /dev/null +++ b/unitTests/src/unitTest04.f03 @@ -0,0 +1,328 @@ + program unitTest04 +! +! Validate disconnected deep-copy assignment for Gaussian MatrixFile +! objects, assignment over an open destination, usable copied header +! metadata, preservation of the source connection, and repeated access +! through the Gaussian-scalar cache. The test creates both FAFs itself. +! +! H. P. Hratchian, 2026. +! + use iso_fortran_env, only: int64,real64 + use mqc_general + use mqc_algebra2 + use mqc_gaussian + implicit none +! + character(len=*),parameter::sourceFileName = & + 'unitTest04-assignment-source.faf' + character(len=*),parameter::outputFileName = & + 'unitTest04-assignment-output.faf' + character(len=8),parameter::titleExpected='test' + character(len=72),parameter::routeExpected = & + '#p test geom=modela b3lyp sto-3g nosymm int=dkh output=faf '// & + 'iop(3/33=2)' + character(len=16),parameter::pointGroupExpected='C02V' + character(len=8),dimension(4),parameter::irrepExpected = & + [character(len=8)::'A1','A2','B1','B2'] + real(kind=real64),parameter::scfEnergyExpected=-75.123456_real64 +! + type(MQC_Gaussian_Unformatted_Matrix_File)::createFile,sourceFile + type(MQC_Gaussian_Unformatted_Matrix_File)::outputFile,verifyFile + type(MQC_Variable)::characterValue,gaussianScalarsValue + character(len=:),dimension(:),allocatable::irrepActual + real(kind=real64),dimension(50)::gaussianScalarsExpected + real(kind=real64)::scfEnergyFirst,scfEnergySecond,cachedEnergy + integer(kind=int64)::sourceUnit,outputUnit + logical::unitOpen +! + call deleteFile(sourceFileName) + call deleteFile(outputFileName) +! +! Build a small source file containing both character records and enough +! Gaussian scalar values for the public SCF-energy cache pathway. +! + characterValue = titleExpected + call createFile%writeArray2('TITLE',characterValue, & + filename=sourceFileName) + characterValue = routeExpected + call createFile%writeArray2('ROUTE',characterValue) + characterValue = pointGroupExpected + call createFile%writeArray2('POINT GROUP',characterValue) + characterValue = irrepExpected + call createFile%writeArray2('POINT GROUP IRREP NAMES',characterValue) + gaussianScalarsExpected = 0.0_real64 + gaussianScalarsExpected(32) = scfEnergyExpected + gaussianScalarsValue = gaussianScalarsExpected + call createFile%writeArray2('GAUSSIAN SCALARS',gaussianScalarsValue) + call createFile%closeFile() +! + call sourceFile%load(sourceFileName) + scfEnergyFirst = sourceFile%getValReal('scfenergy') + scfEnergySecond = sourceFile%getValReal('scfenergy') + call assertReal('first SCF energy',scfEnergyFirst,scfEnergyExpected) + call assertReal('cached SCF energy',scfEnergySecond,scfEnergyExpected) + call assertTrue(sourceFile%gaussianScalars_read, & + 'Gaussian scalar retrieval did not set the cache flag.') + sourceUnit = sourceFile%UnitNumber + outputFile = sourceFile +! +! Assignment must preserve the source connection and disconnect the copy. +! + call assertTrue(sourceFile%isOpen(), & + 'Assignment closed the source FAF.') + call assertTrue(sourceFile%UnitNumber.eq.sourceUnit, & + 'Assignment changed the source unit number.') + call assertDisconnected(outputFile) +! +! Check fixed metadata and allocation/value state. +! + call assertTrue(outputFile%gaussianScalars_read.eqv. & + sourceFile%gaussianScalars_read, & + 'gaussianScalars_read was not copied.') + call assertTrue(outputFile%LabFil.eq.sourceFile%LabFil, & + 'LabFil was not copied.') + call assertTrue(outputFile%GVers.eq.sourceFile%GVers, & + 'GVers was not copied.') + call assertTrue(outputFile%Title.eq.sourceFile%Title, & + 'Title was not copied.') + call assertTrue(outputFile%matrixFileLayout%integerBytes.eq. & + sourceFile%matrixFileLayout%integerBytes, & + 'Matrix-file integer width was not copied.') + call assertTrue(outputFile%matrixFileLayout%fileVersion.eq. & + sourceFile%matrixFileLayout%fileVersion, & + 'Matrix-file version was not copied.') + call assertTrue(outputFile%matrixFileLayout%nHeaderRecords.eq. & + sourceFile%matrixFileLayout%nHeaderRecords, & + 'Matrix-file header count was not copied.') + call assertTrue(outputFile%matrixFileLayout%len12Bytes.eq. & + sourceFile%matrixFileLayout%len12Bytes, & + 'Matrix-file Len12L size was not copied.') + call assertTrue(outputFile%matrixFileLayout%len4Bytes.eq. & + sourceFile%matrixFileLayout%len4Bytes, & + 'Matrix-file Len4L size was not copied.') + call assertTrue(outputFile%matrixFileLayout%rawFormat.eqv. & + sourceFile%matrixFileLayout%rawFormat, & + 'Matrix-file raw-format flag was not copied.') +! + call assertIntegerScalar('natoms',outputFile%natoms,sourceFile%natoms) + call assertIntegerScalar('nbasis',outputFile%nbasis,sourceFile%nbasis) + call assertIntegerScalar('nbasisUse',outputFile%nbasisUse, & + sourceFile%nbasisUse) + call assertIntegerScalar('icharge',outputFile%icharge, & + sourceFile%icharge) + call assertIntegerScalar('multiplicity',outputFile%multiplicity, & + sourceFile%multiplicity) + call assertIntegerScalar('nelectrons',outputFile%nelectrons, & + sourceFile%nelectrons) + call assertIntegerScalar('icgu',outputFile%icgu,sourceFile%icgu) + call assertIntegerScalar('NFC',outputFile%NFC,sourceFile%NFC) + call assertIntegerScalar('NFV',outputFile%NFV,sourceFile%NFV) + call assertIntegerScalar('ITran',outputFile%ITran,sourceFile%ITran) + call assertIntegerScalar('IDum9',outputFile%IDum9,sourceFile%IDum9) + call assertIntegerScalar('NShlAO',outputFile%NShlAO, & + sourceFile%NShlAO) + call assertIntegerScalar('NPrmAO',outputFile%NPrmAO, & + sourceFile%NPrmAO) + call assertIntegerScalar('NShlDB',outputFile%NShlDB, & + sourceFile%NShlDB) + call assertIntegerScalar('NPrmDB',outputFile%NPrmDB, & + sourceFile%NPrmDB) + call assertIntegerScalar('NBTot',outputFile%NBTot,sourceFile%NBTot) + call assertIntegerVector('atomicNumbers',outputFile%atomicNumbers, & + sourceFile%atomicNumbers) + call assertIntegerVector('atomTypes',outputFile%atomTypes, & + sourceFile%atomTypes) + call assertIntegerVector('basisFunction2Atom', & + outputFile%basisFunction2Atom,sourceFile%basisFunction2Atom) + call assertIntegerVector('IBasisFunctionType', & + outputFile%IBasisFunctionType,sourceFile%IBasisFunctionType) + call assertIntegerVector('IgaussianScalars', & + outputFile%IgaussianScalars,sourceFile%IgaussianScalars) + call assertRealVector('atomicCharges',outputFile%atomicCharges, & + sourceFile%atomicCharges) + call assertRealVector('atomicWeights',outputFile%atomicWeights, & + sourceFile%atomicWeights) + call assertRealVector('cartesians',outputFile%cartesians, & + sourceFile%cartesians) + call assertRealVector('gaussianScalars',outputFile%gaussianScalars, & + sourceFile%gaussianScalars) +! +! Allocatable assignment must produce independent cache storage. +! + call assertTrue(allocated(outputFile%gaussianScalars), & + 'The copied Gaussian scalar cache is not allocated.') + cachedEnergy = sourceFile%gaussianScalars(32) + outputFile%gaussianScalars(32) = cachedEnergy+1.0_real64 + call assertReal('independent Gaussian scalar cache', & + sourceFile%gaussianScalars(32),cachedEnergy) + outputFile%gaussianScalars(32) = cachedEnergy +! +! Copied header metadata must be sufficient to create a new FAF. +! + call outputFile%create(outputFileName) + call sourceFile%getArray('TITLE',mqcVarOut=characterValue) + call outputFile%writeArray2('COPIED TITLE',characterValue) + call sourceFile%getArray('ROUTE',mqcVarOut=characterValue) + call outputFile%writeArray2('COPIED ROUTE',characterValue) + call sourceFile%getArray('POINT GROUP',mqcVarOut=characterValue) + call outputFile%writeArray2('COPIED POINT GROUP',characterValue) + call sourceFile%getArray('POINT GROUP IRREP NAMES', & + mqcVarOut=characterValue) + call outputFile%writeArray2('COPIED IRREPS',characterValue) +! +! Replacing an open destination must close its old unit without changing +! the source connection, then leave the replacement disconnected. +! + outputUnit = outputFile%UnitNumber + outputFile = sourceFile + call assertDisconnected(outputFile) + inquire(unit=outputUnit,opened=unitOpen) + call assertTrue(.not.unitOpen, & + 'Assignment did not close the previous output unit.') + call assertTrue(sourceFile%isOpen(), & + 'Replacing an open destination closed the source FAF.') + call outputFile%closeFile() + call sourceFile%closeFile() +! + call verifyFile%load(outputFileName) + call verifyFile%getArray('COPIED IRREPS',mqcVarOut=characterValue) + call assertTrue(RANK(characterValue).eq.1, & + 'The copied irrep record is not a vector.') + call assertTrue(SIZE(characterValue).eq.SIZE(irrepExpected), & + 'The copied irrep vector has the wrong size.') + call assertTrue(LEN(characterValue).eq.LEN(irrepExpected), & + 'The copied irrep vector has the wrong width.') + irrepActual = characterValue + call assertTrue(ALL(irrepActual.eq.irrepExpected), & + 'The copied irrep values are incorrect.') + call verifyFile%closeFile() +! + call deleteFile(sourceFileName) + call deleteFile(outputFileName) + write(*,'(1x,A)') 'unitTest04: PASS' +! + contains + + +!PROCEDURE assertTrue + subroutine assertTrue(condition,message) + implicit none + logical,intent(in)::condition + character(len=*),intent(in)::message +! + if(.not.condition) call mqc_error(TRIM(message)) +! + return + end subroutine assertTrue + + +!PROCEDURE assertReal + subroutine assertReal(label,value,expected) + implicit none + character(len=*),intent(in)::label + real(kind=real64),intent(in)::value,expected +! + if(ABS(value-expected).gt.mqc_small) & + call mqc_error(TRIM(label)//' differs.') +! + return + end subroutine assertReal + + +!PROCEDURE assertDisconnected + subroutine assertDisconnected(fileinfo) + implicit none + type(MQC_Gaussian_Unformatted_Matrix_File),intent(in)::fileinfo +! + call assertTrue(.not.fileinfo%isOpen(), & + 'The assigned FAF object is marked open.') + call assertTrue(fileinfo%UnitNumber.eq.0, & + 'The assigned FAF object has a nonzero unit number.') + call assertTrue(LEN_TRIM(fileinfo%filename).eq.0, & + 'The assigned FAF object retained a filename.') + call assertTrue(.not.fileinfo%declared, & + 'The assigned FAF object retained its declared flag.') + call assertTrue(.not.fileinfo%header_read, & + 'The assigned FAF object retained its header-read flag.') + call assertTrue(.not.fileinfo%header_written, & + 'The assigned FAF object retained its header-written flag.') + call assertTrue(fileinfo%readWriteMode.eq.' ', & + 'The assigned FAF object retained its read/write mode.') +! + return + end subroutine assertDisconnected + + +!PROCEDURE assertIntegerScalar + subroutine assertIntegerScalar(label,value,expected) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),allocatable,intent(in)::value,expected +! + call assertTrue(allocated(value).eqv.allocated(expected), & + TRIM(label)//' allocation state differs.') + if(allocated(expected)) & + call assertTrue(value.eq.expected,TRIM(label)//' value differs.') +! + return + end subroutine assertIntegerScalar + + +!PROCEDURE assertIntegerVector + subroutine assertIntegerVector(label,value,expected) + implicit none + character(len=*),intent(in)::label + integer(kind=int64),dimension(:),allocatable,intent(in)::value,expected +! + call assertTrue(allocated(value).eqv.allocated(expected), & + TRIM(label)//' allocation state differs.') + if(allocated(expected)) then + call assertTrue(SIZE(value).eq.SIZE(expected), & + TRIM(label)//' size differs.') + call assertTrue(ALL(value.eq.expected),TRIM(label)//' values differ.') + endIf +! + return + end subroutine assertIntegerVector + + +!PROCEDURE assertRealVector + subroutine assertRealVector(label,value,expected) + implicit none + character(len=*),intent(in)::label + real(kind=real64),dimension(:),allocatable,intent(in)::value,expected +! + call assertTrue(allocated(value).eqv.allocated(expected), & + TRIM(label)//' allocation state differs.') + if(allocated(expected)) then + call assertTrue(SIZE(value).eq.SIZE(expected), & + TRIM(label)//' size differs.') + call assertTrue(ALL(ABS(value-expected).le.mqc_small), & + TRIM(label)//' values differ.') + endIf +! + return + end subroutine assertRealVector + + +!PROCEDURE deleteFile + subroutine deleteFile(path) + implicit none + character(len=*),intent(in)::path + integer(kind=int64)::deleteUnit,ioStatus + logical::exists +! + inquire(file=path,exist=exists) + if(exists) then + open(newunit=deleteUnit,file=path,status='old',form='unformatted', & + access='sequential',iostat=ioStatus) + if(ioStatus.ne.0) & + call mqc_error('Unable to open temporary FAF for deletion.') + close(deleteUnit,status='delete') + endIf +! + return + end subroutine deleteFile + + + end program unitTest04 diff --git a/unitTests/src/unitTest05.f03 b/unitTests/src/unitTest05.f03 new file mode 100644 index 00000000..86dada3a --- /dev/null +++ b/unitTests/src/unitTest05.f03 @@ -0,0 +1,40 @@ + program unitTest05 +! +! Confirm that a FormChk-only MQCPack build links MQC_Gaussian and reads +! the formatted-checkpoint title and route summary without GauOpen. +! +! H. P. Hratchian, 2026. +! + use MQC_Gaussian + use MQC_General, only: mqc_error + implicit none +! + type(MQC_Gaussian_FChk_File)::fchkFile + character(len=*),parameter::fileName='unitTest05.fchk' + integer::fileUnit + logical::ok +! + open(newunit=fileUnit,file=fileName,status='replace',action='write') + write(fileUnit,'(A)') 'FormChk-only MQC_Gaussian smoke test' + write(fileUnit,'(A)') 'SP RHF STO-3G' + close(fileUnit) +! + call fchkFile%openFile(fileName,-1,ok) + if(.not.ok) & + call mqc_error('unitTest05: unable to open the test FChk file.') + if(trim(fchkFile%title).ne.'FormChk-only MQC_Gaussian smoke test') & + call mqc_error('unitTest05: incorrect FChk title.') + if(trim(fchkFile%jobType).ne.'SP') & + call mqc_error('unitTest05: incorrect FChk job type.') + if(trim(fchkFile%method).ne.'RHF') & + call mqc_error('unitTest05: incorrect FChk method.') + if(trim(fchkFile%basisSet).ne.'STO-3G') & + call mqc_error('unitTest05: incorrect FChk basis set.') +! + call fchkFile%closeFile() + open(newunit=fileUnit,file=fileName,status='old') + close(fileUnit,status='delete') +! + write(*,'(A)') 'PASS: FormChk-only MQC_Gaussian link and read' +! + end program unitTest05 diff --git a/unitTests/src/unitTest06.f03 b/unitTests/src/unitTest06.f03 new file mode 100644 index 00000000..7c2f7912 --- /dev/null +++ b/unitTests/src/unitTest06.f03 @@ -0,0 +1,17 @@ + program unitTest06 +! +! A FormChk-only build must reject MatrixFile operations with the stable +! unsupported-feature diagnostic checked by the surrounding shell test. +! +! H. P. Hratchian, 2026. +! + use MQC_Gaussian + use MQC_General, only: mqc_error + implicit none +! + type(MQC_Gaussian_Unformatted_Matrix_File)::matrixFile +! + call matrixFile%load('unitTest06.faf') + call mqc_error('unitTest06: MatrixFile load unexpectedly returned.') +! + end program unitTest06 diff --git a/unitTests/src/unitTest07.f03 b/unitTests/src/unitTest07.f03 new file mode 100644 index 00000000..e1d29a82 --- /dev/null +++ b/unitTests/src/unitTest07.f03 @@ -0,0 +1,93 @@ + program unitTest07 +! +! Validate numerical MatrixFile writing and reading through the public +! MQCPack interface shared by the public and frontier GauOpen profiles. +! Reading the matrix first also exercises numerical record skipping and +! rewind before the earlier vector is requested. +! +! H. P. Hratchian, 2026. +! + use iso_fortran_env, only: int64,real64 + use mqc_general + use mqc_algebra2 + use mqc_gaussian + implicit none +! + character(len=*),parameter::fileName='unitTest07-numerical.faf' + real(kind=real64),dimension(4),parameter::vectorExpected = & + [1.25_real64,-2.5_real64,3.75_real64,-4.125_real64] + real(kind=real64),dimension(2,3),parameter::matrixExpected = & + reshape([1.0_real64,2.0_real64,3.0_real64,4.0_real64, & + 5.0_real64,6.0_real64],[2,3]) +! + type(MQC_Gaussian_Unformatted_Matrix_File)::outputFile,inputFile + type(MQC_Variable)::writeValue,readValue + real(kind=real64),dimension(:),allocatable::vectorActual + real(kind=real64),dimension(:,:),allocatable::matrixActual +! + call deleteFile(fileName) +! + writeValue = vectorExpected + call outputFile%writeArray2('MQC TEST REAL VECTOR',writeValue, & + filename=fileName) + writeValue = matrixExpected + call outputFile%writeArray2('MQC TEST REAL MATRIX',writeValue) + call outputFile%closeFile() +! +! Read the last record first, then rewind for the earlier record. +! + call inputFile%load(fileName) + call inputFile%getArray('MQC TEST REAL MATRIX',mqcVarOut=readValue) + if(RANK(readValue).ne.2) & + call mqc_error('unitTest07: expected a rank-2 real matrix.') + if(SIZE(readValue,1).ne.SIZE(matrixExpected,1).or. & + SIZE(readValue,2).ne.SIZE(matrixExpected,2)) & + call mqc_error('unitTest07: unexpected real-matrix shape.') + matrixActual = readValue + if(ANY(ABS(matrixActual-matrixExpected).gt.mqc_small)) & + call mqc_error('unitTest07: real-matrix round trip failed.') +! + call inputFile%getArray('MQC TEST REAL VECTOR',mqcVarOut=readValue) + if(RANK(readValue).ne.1) & + call mqc_error('unitTest07: expected a rank-1 real vector.') + if(SIZE(readValue).ne.SIZE(vectorExpected)) & + call mqc_error('unitTest07: unexpected real-vector size.') + vectorActual = readValue + if(ANY(ABS(vectorActual-vectorExpected).gt.mqc_small)) & + call mqc_error('unitTest07: real-vector round trip failed.') + call inputFile%closeFile() +! + call deleteFile(fileName) + write(*,'(1x,A)') 'unitTest07: PASS' +! + contains + + +!PROCEDURE deleteFile + subroutine deleteFile(path) +! +! Delete a prior test MatrixFile without depending on shell cleanup. +! +! H. P. Hratchian, 2026. +! + implicit none + character(len=*),intent(in)::path + integer(kind=int64)::deleteUnit,ioStatus + logical::exists +! + inquire(file=path,exist=exists) + if(exists) then + open(newunit=deleteUnit,file=path,status='old', & + form='unformatted',access='sequential',iostat=ioStatus) + if(ioStatus.ne.0) & + call mqc_error('unitTest07: unable to open old test file.') + close(deleteUnit,status='delete',iostat=ioStatus) + if(ioStatus.ne.0) & + call mqc_error('unitTest07: unable to delete old test file.') + endIf +! + return + end subroutine deleteFile + + + end program unitTest07