Work on continuous integration

* Started port of the previous CI.bash
* Also fix bug in spec.f (stdout was closed so nothing appeared on screen
  at the second call to libspec)
* Work on test suite
  - utils to create clusters are tested
  - PED calculator for polar and azimutal scans are tested
This commit is contained in:
Sylvain Tricot 2019-11-20 18:14:00 +01:00
parent d167bd9f75
commit 4807474889
14 changed files with 497 additions and 29 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ __pycache__
*.py[cod] *.py[cod]
*.so *.so
*.bak *.bak
package/

176
CI/CI.bash Normal file
View File

@ -0,0 +1,176 @@
#!/bin/bash
SCRIPT_NAME=$(basename $0)
TOPLEVEL=$(git rev-parse --show-toplevel)
VERSION=$(git describe|sed 's/-\([[:digit:]]\+\)-.*/\.post\1/')
(return 0 2>/dev/null) && sourced=1 || sourced=0
pythonpath_prepend() {
if [ -d "$1" ]; then
PYTHONPATH=${PYTHONPATH//":$1:"/:} #delete all instances in the middle
PYTHONPATH=${PYTHONPATH/%":$1"/} #delete any instance at the end
PYTHONPATH=${PYTHONPATH/#"$1:"/} #delete any instance at the beginning
PYTHONPATH="$1${PYTHONPATH:+":$PYTHONPATH"}" #prepend $1 or if $PATH is empty set to $1
export PYTHONPATH
fi
}
# Setup or upgrade the Python virtual environment
setup_virtualenv(){
VENV_PATH="$1"
virtualenv --python=python3 --system-site-packages "$VENV_PATH"
source "$VENV_PATH/bin/activate"
pip install --upgrade pip
pip install --upgrade numpy ase h5py lxml pint terminaltables pycairo
pip install --upgrade sphinx
status=$?
deactivate
[ $status -eq 0 ] || exit 1
}
activate_msspec_python3_virtualenv() {
VENV_PATH="$1"
# do not activate virtualenv if already activated
if [ x"${VIRTUAL_ENV}" == x ]; then
# We are not in a virtualenv
if [ x"${VENV_PATH}" != x ]; then
# activate the specified venv
export MSSPEC_ROOT="${TOPLEVEL}"
pythonpath_prepend "$MSSPEC_ROOT/src"
#PYTHONPATH="$PYTHONPATH":"$MSSPEC_ROOT"/src
source "$VENV_PATH/bin/activate"
else
# error
echo "Error: No venv specified!!"
fi
else
# We are in a virtualenv so load only variables
export MSSPEC_ROOT="${TOPLEVEL}"
pythonpath_prepend "$MSSPEC_ROOT/src"
fi
}
make_pymsspec_package() {
echo "Running setuptools for pymsspec, please wait... "
VERSION=$(get_package_version)
DEST=${TOPLEVEL}/install_resources/packages/${VERSION}
mkdir -p $DEST
cd ${TOPLEVEL}/src/python/pymsspec && python setup.py sdist 2>&1 > /dev/null
cp ${TOPLEVEL}/src/python/pymsspec/dist/pymsspec-${VERSION}.tar.gz ${DEST}/
rm -rf ${TOPLEVEL}/src/python/pymsspec/{*.egg-info,dist}
}
make_pybinding() {
echo "Creating Python library for Fortran code, please wait... "
activate_msspec_python3_virtualenv
cd ${TOPLEVEL}/src/ && make pybinding
}
make_selfex() {
echo "Creating the self-extractible setup program... "
VERSION=$(get_package_version)
DEST=${TOPLEVEL}/install_resources/packages/${VERSION}
LICENSE="${TOPLEVEL}/src/CI/license.txt"
REQUIREMENTS="${TOPLEVEL}/src/CI/requirements"
SETUPFILE="MsSpec-${VERSION}.setup"
MAKESELF=${TOPLEVEL}/src/CI/makeself/makeself.sh
#pip freeze > "${REQUIREMENTS}"
mkdir -p $DEST
cp "${TOPLEVEL}/src/CI/install.sh" "${DEST}"
chmod u+x "${DEST}/install.sh"
cp "${TOPLEVEL}/src/CI/uninstall.sh" "${DEST}"
cp "${TOPLEVEL}/src/CI/msspec" "${DEST}"
cp "${TOPLEVEL}/src/CI/requirements" "${DEST}"
cp "${TOPLEVEL}/src/CI/distro-requirements" "${DEST}"
get_makeself
cd "${DEST}/../" && ${MAKESELF} --license ${LICENSE} --quiet ${VERSION} ${SETUPFILE} "MsSpec - pymsspec" ./install.sh
rm -rf ${SETUPFILE}.bak
rm -rf "${DEST}"
#rm -rf "${REQUIREMENTS}"
}
make_pdf() {
DEST=${TOPLEVEL}/package
mkdir -p ${DEST}
# first activate the virtual environment
activate_msspec_python3_virtualenv
# then build the documentation.
cd "${TOPLEVEL}/doc"
make --no-print-directory latexpdf || exit 1
# remove previous pdf
rm -rf "${DEST}"/*.pdf
# copy the produced pdf file to the final location
cp "build/latex/MsSpec-python.pdf" "${TOPLEVEL}/package/MsSpec-${VERSION}.pdf"
}
make_html () {
make_pdf
# first activate the virtual environment
activate_msspec_python3_virtualenv
# then build the documentation.
cd "${TOPLEVEL}/doc"
make --no-print-directory html || exit 1
}
make_tests() {
echo "generate results for unit tests..."
activate_msspec_python3_virtualenv
python -c "from msspec.tests import create_tests_results; create_tests_results()"
}
create_package() {
VENV_PATH="$1"
source "$VENV_PATH/bin/activate"
#update_version
#make_tests
#make_pdf
#make_pymsspec_package
#make_msspecgui_package
#make_fortran_package
#make_selfex
#cleanup
deactivate
}
cleanup() {
echo "cleaning up..."
# remove results.txt file
python -c "from msspec.tests import delete_results_file; delete_results_file()"
VERSION=$(get_package_version)
rm -f ${TOPLEVEL}/guide/MsSpec-${VERSION}.pdf
}
show_help () {
echo "Usage: $SCRIPT_NAME [OPTIONS]"
echo "List of possible options:"
echo " -i Initialize a Python virtual environnment in FOLDER"
echo " -d Build the html documentation within the Python "
echo " virtual environnment in FOLDER"
}
if [ "$sourced" == 0 ]; then
while getopts "hi:dt" option; do
case $option in
i) setup_virtualenv "$OPTARG"
;;
d) make_html
;;
t) make_tests
;;
h) show_help
;;
*) show_help
;;
esac
done
fi

View File

@ -8,7 +8,11 @@ SETUPFILE:=pymsspec-$(VERSION).setup
clean: clean:
@rm -rf *.setup @echo "Cleaning all..."
@find ./src -type f -name '*.pyc' -exec rm {} +
@find ./src -type d -name '__pycache__' -exec rm -r {} +
+$(MAKE) -C src/ clean
+$(MAKE) -C doc/ clean
version: version:
@python ./CI/update_version.py @python ./CI/update_version.py
@ -16,9 +20,8 @@ version:
purge: clean purge: clean
@echo "Purging all..." @echo "Purging all..."
@find ./src -type f -name '*.pyc' -exec rm {} + @rm -rf *.setup
@find ./src -type d -name '__pycache__' -exec rm -r {} + +$(MAKE) -C src/ purge
+$(MAKE) -C src/ clean
selfex: purge selfex: purge
@echo "Creating the self-extractible setup program... " @echo "Creating the self-extractible setup program... "

View File

@ -16,3 +16,7 @@ clean:
@rm -rf dist @rm -rf dist
@rm -rf *.egg* @rm -rf *.egg*
purge: clean
+$(MAKE) -C msspec/spec/fortran purge
+$(MAKE) -C msspec/phagen/fortran purge

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
# vim: set ts=4 sw=4 sts noet mouse=a fdm=indent: # vim: set ts=4 sw=4 sts noet mouse=a fdm=indent:
SCRIPT_NAME=$(basename "$0")
PYTHON=python3 PYTHON=python3
VERSION=$(cat ./msspec/version.py|cut -d\" -f2) VERSION=$(cat ./msspec/version.py|cut -d\" -f2)
DEFAULT_DEST="${HOME}/.local/share" DEFAULT_DEST="${HOME}/.local/share"

View File

@ -68,14 +68,14 @@ from terminaltables.ascii_table import AsciiTable
try: #try:
MSSPEC_ROOT = os.environ['MSSPEC_ROOT'] # MSSPEC_ROOT = os.environ['MSSPEC_ROOT']
except KeyError: #except KeyError:
cfg = Config() # cfg = Config()
MSSPEC_ROOT = cfg.get('path') # MSSPEC_ROOT = cfg.get('path')
if MSSPEC_ROOT == str(None): #if MSSPEC_ROOT == str(None):
raise NameError('No path to the MsSpec distribution found !!') # raise NameError('No path to the MsSpec distribution found !!')
@ -185,7 +185,7 @@ class _MSCALCULATOR(Calculator):
LOGGER.debug(' create a space dedicated to the calculation') LOGGER.debug(' create a space dedicated to the calculation')
######################################################################## ########################################################################
self.init_folder = os.getcwd() self.init_folder = os.getcwd()
self.msspec_folder = os.path.join(MSSPEC_ROOT) #self.msspec_folder = os.path.join(MSSPEC_ROOT)
self.tmp_folder = os.path.abspath(folder) self.tmp_folder = os.path.abspath(folder)
LOGGER.debug(' folder: \'%s\'', self.tmp_folder) LOGGER.debug(' folder: \'%s\'', self.tmp_folder)
if not os.path.exists(self.tmp_folder): if not os.path.exists(self.tmp_folder):
@ -195,7 +195,7 @@ class _MSCALCULATOR(Calculator):
#copyfile(os.path.join(self.msspec_folder, 'ase', 'Makefile'), #copyfile(os.path.join(self.msspec_folder, 'ase', 'Makefile'),
# os.path.join(self.tmp_folder, 'Makefile')) # os.path.join(self.tmp_folder, 'Makefile'))
os.chdir(self.tmp_folder) #os.chdir(self.tmp_folder)
inv = cor = 'NO' inv = cor = 'NO'
if algorithm == 'expansion': if algorithm == 'expansion':
@ -225,8 +225,8 @@ class _MSCALCULATOR(Calculator):
calctype_spectro = self.spec_parameters.get_parameter('calctype_spectro') calctype_spectro = self.spec_parameters.get_parameter('calctype_spectro')
calctype_spectro = calctype_spectro.value calctype_spectro = calctype_spectro.value
self._make_opts = (MSSPEC_ROOT, calctype_spectro, inv, cor, #self._make_opts = (MSSPEC_ROOT, calctype_spectro, inv, cor,
spin, sorb, self.tmp_folder) # spin, sorb, self.tmp_folder)
# Initialize the working environment # Initialize the working environment
#self._make('init') #self._make('init')
@ -306,6 +306,7 @@ class _MSCALCULATOR(Calculator):
os.rename('fort.10', 'cluster.clu') os.rename('fort.10', 'cluster.clu')
os.rename('fort.35', 'tmatrix.tl') os.rename('fort.35', 'tmatrix.tl')
os.rename('fort.55', 'tmatrix.rad') os.rename('fort.55', 'tmatrix.rad')
os.chdir(self.init_folder)
def run_spec(self): def run_spec(self):
@ -366,6 +367,7 @@ class _MSCALCULATOR(Calculator):
t1 = time.time() t1 = time.time()
self.resources['spec_time'] = t1 - t0 self.resources['spec_time'] = t1 - t0
os.chdir(self.init_folder)
def get_tmatrix(self): def get_tmatrix(self):
LOGGER.info("Getting the TMatrix...") LOGGER.info("Getting the TMatrix...")

View File

@ -67,7 +67,7 @@ from distutils.version import StrictVersion, LooseVersion
import sys import sys
#sys.path.append('../../MsSpecGui/msspecgui/msspec/gui') #sys.path.append('../../MsSpecGui/msspecgui/msspec/gui')
from .msspecgui.msspec.gui.clusterviewer import ClusterViewer from msspec.msspecgui.msspec.gui.clusterviewer import ClusterViewer
def cols2matrix(x, y, z, nx=88*1+1, ny=360*1+1): def cols2matrix(x, y, z, nx=88*1+1, ny=360*1+1):
# mix the values of existing theta and new theta and return the # mix the values of existing theta and new theta and return the

View File

@ -6,7 +6,7 @@ objects_src := phagen_scf.f
objects := $(patsubst %.f,%.o, $(objects_src)) objects := $(patsubst %.f,%.o, $(objects_src))
.PHONY: clean pybinding .PHONY: clean purge pybinding
pybinding: libphagen.so pybinding: libphagen.so
@ -24,5 +24,8 @@ $(objects): $(objects_src)
clean: clean:
@echo "cleaning..." @echo "cleaning..."
rm -rf *.so *.o *.mod rm -rf *.so *.o *.mod
purge: clean
@echo "Purging..."
rm -rf ../*.so rm -rf ../*.so

View File

@ -8,7 +8,7 @@ OPTS := -g -Wall -Wextra -Warray-temporaries -Wconversion -fbacktrace -ffree-lin
EXE=prog EXE=prog
.PHONY: clean pybinding .PHONY: clean purge pybinding
pybinding: libspec.so pybinding: libspec.so
@ -33,6 +33,9 @@ $(objects): $(objects_src)
clean: clean:
@echo "cleaning..." @echo "cleaning..."
@rm -rf *.so *.o *.mod $(EXE) @rm -rf *.so *.o *.mod
@rm -rf ../*.so
purge: clean
@echo "Purging..."
@rm -rf $(EXE)
@rm -rf ../*.so

View File

@ -11,6 +11,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_ADSORB() SUBROUTINE ALLOC_ADSORB()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(ADS)) THEN
DEALLOCATE(ADS)
ENDIF
ALLOCATE(ADS(3,900)) ALLOCATE(ADS(3,900))
END SUBROUTINE ALLOC_ADSORB END SUBROUTINE ALLOC_ADSORB
END MODULE ADSORB_MOD END MODULE ADSORB_MOD
@ -37,8 +40,17 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_APPROX() SUBROUTINE ALLOC_APPROX()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(RTHFWD)) THEN
DEALLOCATE(RTHFWD)
ENDIF
ALLOCATE(RTHFWD(NATP_M)) ALLOCATE(RTHFWD(NATP_M))
IF (ALLOCATED(IBWD)) THEN
DEALLOCATE(IBWD)
ENDIF
ALLOCATE(IBWD(NATP_M)) ALLOCATE(IBWD(NATP_M))
IF (ALLOCATED(RTHBWD)) THEN
DEALLOCATE(RTHBWD)
ENDIF
ALLOCATE(RTHBWD(NATP_M)) ALLOCATE(RTHBWD(NATP_M))
END SUBROUTINE ALLOC_APPROX END SUBROUTINE ALLOC_APPROX
END MODULE APPROX_MOD END MODULE APPROX_MOD
@ -55,8 +67,17 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_ATOMS() SUBROUTINE ALLOC_ATOMS()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(VALZ)) THEN
DEALLOCATE(VALZ)
ENDIF
ALLOCATE(VALZ(NATCLU_M)) ALLOCATE(VALZ(NATCLU_M))
IF (ALLOCATED(NZAT)) THEN
DEALLOCATE(NZAT)
ENDIF
ALLOCATE(NZAT(NATCLU_M)) ALLOCATE(NZAT(NATCLU_M))
IF (ALLOCATED(CHEM)) THEN
DEALLOCATE(CHEM)
ENDIF
ALLOCATE(CHEM(NATCLU_M)) ALLOCATE(CHEM(NATCLU_M))
END SUBROUTINE ALLOC_ATOMS END SUBROUTINE ALLOC_ATOMS
END MODULE ATOMS_MOD END MODULE ATOMS_MOD
@ -70,7 +91,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_AUGER() SUBROUTINE ALLOC_AUGER()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(NLIN_A)) THEN
DEALLOCATE(NLIN_A)
ENDIF
ALLOCATE(NLIN_A(0:20)) ALLOCATE(NLIN_A(0:20))
IF (ALLOCATED(L_BOUNDS)) THEN
DEALLOCATE(L_BOUNDS)
ENDIF
ALLOCATE(L_BOUNDS(0:20,2)) ALLOCATE(L_BOUNDS(0:20,2))
END SUBROUTINE ALLOC_AUGER END SUBROUTINE ALLOC_AUGER
END MODULE AUGER_MOD END MODULE AUGER_MOD
@ -83,7 +110,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_BASES() SUBROUTINE ALLOC_BASES()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(ATBAS)) THEN
DEALLOCATE(ATBAS)
ENDIF
ALLOCATE(ATBAS(3*NATP_M)) ALLOCATE(ATBAS(3*NATP_M))
IF (ALLOCATED(VECBAS)) THEN
DEALLOCATE(VECBAS)
ENDIF
ALLOCATE(VECBAS(9)) ALLOCATE(VECBAS(9))
END SUBROUTINE ALLOC_BASES END SUBROUTINE ALLOC_BASES
END MODULE BASES_MOD END MODULE BASES_MOD
@ -100,10 +133,25 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_CLUSLIM() SUBROUTINE ALLOC_CLUSLIM()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(X_MAX)) THEN
DEALLOCATE(X_MAX)
ENDIF
ALLOCATE(X_MAX(NATCLU_M)) ALLOCATE(X_MAX(NATCLU_M))
IF (ALLOCATED(X_MIN)) THEN
DEALLOCATE(X_MIN)
ENDIF
ALLOCATE(X_MIN(NATCLU_M)) ALLOCATE(X_MIN(NATCLU_M))
IF (ALLOCATED(Y_MAX)) THEN
DEALLOCATE(Y_MAX)
ENDIF
ALLOCATE(Y_MAX(NATCLU_M)) ALLOCATE(Y_MAX(NATCLU_M))
IF (ALLOCATED(Y_MIN)) THEN
DEALLOCATE(Y_MIN)
ENDIF
ALLOCATE(Y_MIN(NATCLU_M)) ALLOCATE(Y_MIN(NATCLU_M))
IF (ALLOCATED(VAL)) THEN
DEALLOCATE(VAL)
ENDIF
ALLOCATE(VAL(NATCLU_M)) ALLOCATE(VAL(NATCLU_M))
END SUBROUTINE ALLOC_CLUSLIM END SUBROUTINE ALLOC_CLUSLIM
END MODULE CLUSLIM_MOD END MODULE CLUSLIM_MOD
@ -121,10 +169,25 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_COOR() SUBROUTINE ALLOC_COOR()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(NATYP)) THEN
DEALLOCATE(NATYP)
ENDIF
ALLOCATE(NATYP(NATM)) ALLOCATE(NATYP(NATM))
IF (ALLOCATED(NCHTYP)) THEN
DEALLOCATE(NCHTYP)
ENDIF
ALLOCATE(NCHTYP(NATP_M)) ALLOCATE(NCHTYP(NATP_M))
IF (ALLOCATED(NCORR)) THEN
DEALLOCATE(NCORR)
ENDIF
ALLOCATE(NCORR(NAT_EQ_M,NATP_M)) ALLOCATE(NCORR(NAT_EQ_M,NATP_M))
IF (ALLOCATED(INEW_AT)) THEN
DEALLOCATE(INEW_AT)
ENDIF
ALLOCATE(INEW_AT(NATCLU_M)) ALLOCATE(INEW_AT(NATCLU_M))
IF (ALLOCATED(SYM_AT)) THEN
DEALLOCATE(SYM_AT)
ENDIF
ALLOCATE(SYM_AT(3,NATCLU_M)) ALLOCATE(SYM_AT(3,NATCLU_M))
END SUBROUTINE ALLOC_COOR END SUBROUTINE ALLOC_COOR
END MODULE COOR_MOD END MODULE COOR_MOD
@ -142,6 +205,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_DEBWAL() SUBROUTINE ALLOC_DEBWAL()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(UJ2)) THEN
DEALLOCATE(UJ2)
ENDIF
ALLOCATE(UJ2(NATM)) ALLOCATE(UJ2(NATM))
END SUBROUTINE ALLOC_DEBWAL END SUBROUTINE ALLOC_DEBWAL
END MODULE DEBWAL_MOD END MODULE DEBWAL_MOD
@ -153,6 +219,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_INDAT() SUBROUTINE ALLOC_INDAT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(INDATA)) THEN
DEALLOCATE(INDATA)
ENDIF
ALLOCATE(INDATA(100)) ALLOCATE(INDATA(100))
END SUBROUTINE ALLOC_INDAT END SUBROUTINE ALLOC_INDAT
END MODULE INDAT_MOD END MODULE INDAT_MOD
@ -280,6 +349,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_MASSAT() SUBROUTINE ALLOC_MASSAT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(XMT)) THEN
DEALLOCATE(XMT)
ENDIF
ALLOCATE(XMT(NATM)) ALLOCATE(XMT(NATM))
END SUBROUTINE ALLOC_MASSAT END SUBROUTINE ALLOC_MASSAT
END MODULE MASSAT_MOD END MODULE MASSAT_MOD
@ -296,6 +368,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_MILLER() SUBROUTINE ALLOC_MILLER()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(IVN)) THEN
DEALLOCATE(IVN)
ENDIF
ALLOCATE(IVN(3)) ALLOCATE(IVN(3))
END SUBROUTINE ALLOC_MILLER END SUBROUTINE ALLOC_MILLER
END MODULE MILLER_MOD END MODULE MILLER_MOD
@ -350,6 +425,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_RELADS() SUBROUTINE ALLOC_RELADS()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(PCRELA)) THEN
DEALLOCATE(PCRELA)
ENDIF
ALLOCATE(PCRELA(3)) ALLOCATE(PCRELA(3))
END SUBROUTINE ALLOC_RELADS END SUBROUTINE ALLOC_RELADS
END MODULE RELADS_MOD END MODULE RELADS_MOD
@ -365,6 +443,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_RELAX() SUBROUTINE ALLOC_RELAX()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(PCREL)) THEN
DEALLOCATE(PCREL)
ENDIF
ALLOCATE(PCREL(10)) ALLOCATE(PCREL(10))
END SUBROUTINE ALLOC_RELAX END SUBROUTINE ALLOC_RELAX
END MODULE RELAX_MOD END MODULE RELAX_MOD
@ -429,10 +510,25 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_TRANS() SUBROUTINE ALLOC_TRANS()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DLT)) THEN
DEALLOCATE(DLT)
ENDIF
ALLOCATE(DLT(NE_M,NATM,0:18,2)) ALLOCATE(DLT(NE_M,NATM,0:18,2))
IF (ALLOCATED(TL)) THEN
DEALLOCATE(TL)
ENDIF
ALLOCATE(TL(0:NT_M,4,NATM,NE_M)) ALLOCATE(TL(0:NT_M,4,NATM,NE_M))
IF (ALLOCATED(VK)) THEN
DEALLOCATE(VK)
ENDIF
ALLOCATE(VK(NE_M)) ALLOCATE(VK(NE_M))
IF (ALLOCATED(VK2)) THEN
DEALLOCATE(VK2)
ENDIF
ALLOCATE(VK2(NE_M)) ALLOCATE(VK2(NE_M))
IF (ALLOCATED(LMAX)) THEN
DEALLOCATE(LMAX)
ENDIF
ALLOCATE(LMAX(NATM,NE_M)) ALLOCATE(LMAX(NATM,NE_M))
END SUBROUTINE ALLOC_TRANS END SUBROUTINE ALLOC_TRANS
END MODULE TRANS_MOD END MODULE TRANS_MOD
@ -450,10 +546,25 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_TL_AED() SUBROUTINE ALLOC_TL_AED()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DLT_A)) THEN
DEALLOCATE(DLT_A)
ENDIF
ALLOCATE(DLT_A(NE_M,NATM,0:18,2)) ALLOCATE(DLT_A(NE_M,NATM,0:18,2))
IF (ALLOCATED(TL_A)) THEN
DEALLOCATE(TL_A)
ENDIF
ALLOCATE(TL_A(0:NT_M,4,NATM,NE_M)) ALLOCATE(TL_A(0:NT_M,4,NATM,NE_M))
IF (ALLOCATED(VK_A)) THEN
DEALLOCATE(VK_A)
ENDIF
ALLOCATE(VK_A(NE_M)) ALLOCATE(VK_A(NE_M))
IF (ALLOCATED(VK2_A)) THEN
DEALLOCATE(VK2_A)
ENDIF
ALLOCATE(VK2_A(NE_M)) ALLOCATE(VK2_A(NE_M))
IF (ALLOCATED(LMAX_A)) THEN
DEALLOCATE(LMAX_A)
ENDIF
ALLOCATE(LMAX_A(NATM,NE_M)) ALLOCATE(LMAX_A(NATM,NE_M))
END SUBROUTINE ALLOC_TL_AED END SUBROUTINE ALLOC_TL_AED
END MODULE TL_AED_MOD END MODULE TL_AED_MOD
@ -502,6 +613,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_TYPEM() SUBROUTINE ALLOC_TYPEM()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(IEMET)) THEN
DEALLOCATE(IEMET)
ENDIF
ALLOCATE(IEMET(NEMET_M)) ALLOCATE(IEMET(NEMET_M))
END SUBROUTINE ALLOC_TYPEM END SUBROUTINE ALLOC_TYPEM
END MODULE TYPEM_MOD END MODULE TYPEM_MOD
@ -532,6 +646,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_VALIN() SUBROUTINE ALLOC_VALIN()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(NONVOL)) THEN
DEALLOCATE(NONVOL)
ENDIF
ALLOCATE(NONVOL(100)) ALLOCATE(NONVOL(100))
END SUBROUTINE ALLOC_VALIN END SUBROUTINE ALLOC_VALIN
END MODULE VALIN_MOD END MODULE VALIN_MOD
@ -544,7 +661,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_XMRHO() SUBROUTINE ALLOC_XMRHO()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(XMAT)) THEN
DEALLOCATE(XMAT)
ENDIF
ALLOCATE(XMAT(0:99)) ALLOCATE(XMAT(0:99))
IF (ALLOCATED(RHOAT)) THEN
DEALLOCATE(RHOAT)
ENDIF
ALLOCATE(RHOAT(0:99)) ALLOCATE(RHOAT(0:99))
END SUBROUTINE ALLOC_XMRHO END SUBROUTINE ALLOC_XMRHO
END MODULE XMRHO_MOD END MODULE XMRHO_MOD
@ -570,8 +693,17 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_VECSYS() SUBROUTINE ALLOC_VECSYS()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(ASYS)) THEN
DEALLOCATE(ASYS)
ENDIF
ALLOCATE(ASYS(3)) ALLOCATE(ASYS(3))
IF (ALLOCATED(BSYS)) THEN
DEALLOCATE(BSYS)
ENDIF
ALLOCATE(BSYS(3)) ALLOCATE(BSYS(3))
IF (ALLOCATED(CSYS)) THEN
DEALLOCATE(CSYS)
ENDIF
ALLOCATE(CSYS(3)) ALLOCATE(CSYS(3))
END SUBROUTINE ALLOC_VECSYS END SUBROUTINE ALLOC_VECSYS
END MODULE VECSYS_MOD END MODULE VECSYS_MOD
@ -583,6 +715,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_VIBRAT() SUBROUTINE ALLOC_VIBRAT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(I_FREE)) THEN
DEALLOCATE(I_FREE)
ENDIF
ALLOCATE(I_FREE(NATP_M)) ALLOCATE(I_FREE(NATP_M))
END SUBROUTINE ALLOC_VIBRAT END SUBROUTINE ALLOC_VIBRAT
END MODULE VIBRAT_MOD END MODULE VIBRAT_MOD
@ -594,6 +729,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_COEFRLM() SUBROUTINE ALLOC_COEFRLM()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(CF)) THEN
DEALLOCATE(CF)
ENDIF
ALLOCATE(CF(0:2*NL_M-2,0:2*NL_M-2,0:2*NL_M-2)) ALLOCATE(CF(0:2*NL_M-2,0:2*NL_M-2,0:2*NL_M-2))
END SUBROUTINE ALLOC_COEFRLM END SUBROUTINE ALLOC_COEFRLM
END MODULE COEFRLM_MOD END MODULE COEFRLM_MOD
@ -605,6 +743,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_EXPROT() SUBROUTINE ALLOC_EXPROT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(EXPR)) THEN
DEALLOCATE(EXPR)
ENDIF
ALLOCATE(EXPR(0:2*NL_M-2,0:2*NL_M-2)) ALLOCATE(EXPR(0:2*NL_M-2,0:2*NL_M-2))
END SUBROUTINE ALLOC_EXPROT END SUBROUTINE ALLOC_EXPROT
END MODULE EXPROT_MOD END MODULE EXPROT_MOD
@ -616,6 +757,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_EXPFAC() SUBROUTINE ALLOC_EXPFAC()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(EXPF)) THEN
DEALLOCATE(EXPF)
ENDIF
ALLOCATE(EXPF(0:2*NL_M-2,0:2*NL_M-2)) ALLOCATE(EXPF(0:2*NL_M-2,0:2*NL_M-2))
END SUBROUTINE ALLOC_EXPFAC END SUBROUTINE ALLOC_EXPFAC
END MODULE EXPFAC_MOD END MODULE EXPFAC_MOD
@ -627,6 +771,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_LOGAMAD() SUBROUTINE ALLOC_LOGAMAD()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(GLD)) THEN
DEALLOCATE(GLD)
ENDIF
ALLOCATE(GLD(0:N_GAUNT,2)) ALLOCATE(GLD(0:N_GAUNT,2))
END SUBROUTINE ALLOC_LOGAMAD END SUBROUTINE ALLOC_LOGAMAD
END MODULE LOGAMAD_MOD END MODULE LOGAMAD_MOD
@ -638,6 +785,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_EXPFAC2() SUBROUTINE ALLOC_EXPFAC2()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(EXPF2)) THEN
DEALLOCATE(EXPF2)
ENDIF
ALLOCATE(EXPF2(0:2*NL_M-2,0:2*NL_M-2)) ALLOCATE(EXPF2(0:2*NL_M-2,0:2*NL_M-2))
END SUBROUTINE ALLOC_EXPFAC2 END SUBROUTINE ALLOC_EXPFAC2
END MODULE EXPFAC2_MOD END MODULE EXPFAC2_MOD
@ -649,6 +799,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_FACTSQ() SUBROUTINE ALLOC_FACTSQ()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(FSQ)) THEN
DEALLOCATE(FSQ)
ENDIF
ALLOCATE(FSQ(0:2*NL_M-2)) ALLOCATE(FSQ(0:2*NL_M-2))
END SUBROUTINE ALLOC_FACTSQ END SUBROUTINE ALLOC_FACTSQ
END MODULE FACTSQ_MOD END MODULE FACTSQ_MOD
@ -715,7 +868,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_VALIN_AV() SUBROUTINE ALLOC_VALIN_AV()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(TH_0)) THEN
DEALLOCATE(TH_0)
ENDIF
ALLOCATE(TH_0(NTH_M)) ALLOCATE(TH_0(NTH_M))
IF (ALLOCATED(PH_0)) THEN
DEALLOCATE(PH_0)
ENDIF
ALLOCATE(PH_0(NPH_M)) ALLOCATE(PH_0(NPH_M))
END SUBROUTINE ALLOC_VALIN_AV END SUBROUTINE ALLOC_VALIN_AV
END MODULE VALIN_AV_MOD END MODULE VALIN_AV_MOD
@ -797,6 +956,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_C_G() SUBROUTINE ALLOC_C_G()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(CG)) THEN
DEALLOCATE(CG)
ENDIF
ALLOCATE(CG(-LI_M:LI_M+1,2,2)) ALLOCATE(CG(-LI_M:LI_M+1,2,2))
END SUBROUTINE ALLOC_C_G END SUBROUTINE ALLOC_C_G
END MODULE C_G_MOD END MODULE C_G_MOD
@ -808,8 +970,11 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_C_G_A() SUBROUTINE ALLOC_C_G_A()
USE DIM_MOD USE DIM_MOD
ALLOCATE(CGA(0:NCG_M,-NCG_M:NCG_M,0:NCG_M,-NCG_M:NCG_M,0:2*NCG IF (ALLOCATED(CGA)) THEN
&_M)) DEALLOCATE(CGA)
ENDIF
ALLOCATE(CGA(0:NCG_M,-NCG_M:NCG_M,0:NCG_M,-NCG_M:NCG_M,0:
& 2*NCG_M))
END SUBROUTINE ALLOC_C_G_A END SUBROUTINE ALLOC_C_G_A
END MODULE C_G_A_MOD END MODULE C_G_A_MOD
@ -820,6 +985,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_C_G_M() SUBROUTINE ALLOC_C_G_M()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(CG_S)) THEN
DEALLOCATE(CG_S)
ENDIF
ALLOCATE(CG_S(2,2,2)) ALLOCATE(CG_S(2,2,2))
END SUBROUTINE ALLOC_C_G_M END SUBROUTINE ALLOC_C_G_M
END MODULE C_G_M_MOD END MODULE C_G_M_MOD
@ -831,6 +999,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_DEXPFAC2() SUBROUTINE ALLOC_DEXPFAC2()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DEXPF2)) THEN
DEALLOCATE(DEXPF2)
ENDIF
ALLOCATE(DEXPF2(0:2*NL_M-2,0:2*NL_M-2)) ALLOCATE(DEXPF2(0:2*NL_M-2,0:2*NL_M-2))
END SUBROUTINE ALLOC_DEXPFAC2 END SUBROUTINE ALLOC_DEXPFAC2
END MODULE DEXPFAC2_MOD END MODULE DEXPFAC2_MOD
@ -842,6 +1013,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_DFACTSQ() SUBROUTINE ALLOC_DFACTSQ()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DFSQ)) THEN
DEALLOCATE(DFSQ)
ENDIF
ALLOCATE(DFSQ(0:2*NL_M-2)) ALLOCATE(DFSQ(0:2*NL_M-2))
END SUBROUTINE ALLOC_DFACTSQ END SUBROUTINE ALLOC_DFACTSQ
END MODULE DFACTSQ_MOD END MODULE DFACTSQ_MOD
@ -912,7 +1086,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_LINLBD() SUBROUTINE ALLOC_LINLBD()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(LBD)) THEN
DEALLOCATE(LBD)
ENDIF
ALLOCATE(LBD(-N_MU_M:N_MU_M,0:N_NU_M)) ALLOCATE(LBD(-N_MU_M:N_MU_M,0:N_NU_M))
IF (ALLOCATED(NUMAX)) THEN
DEALLOCATE(NUMAX)
ENDIF
ALLOCATE(NUMAX(NATP_M)) ALLOCATE(NUMAX(NATP_M))
END SUBROUTINE ALLOC_LINLBD END SUBROUTINE ALLOC_LINLBD
END MODULE LINLBD_MOD END MODULE LINLBD_MOD
@ -952,6 +1132,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_RA() SUBROUTINE ALLOC_RA()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(N_RA)) THEN
DEALLOCATE(N_RA)
ENDIF
ALLOCATE(N_RA(NATP_M)) ALLOCATE(N_RA(NATP_M))
END SUBROUTINE ALLOC_RA END SUBROUTINE ALLOC_RA
END MODULE RA_MOD END MODULE RA_MOD
@ -963,6 +1146,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_SPECTRUM() SUBROUTINE ALLOC_SPECTRUM()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(I_SPECTRUM)) THEN
DEALLOCATE(I_SPECTRUM)
ENDIF
ALLOCATE(I_SPECTRUM(NE_M)) ALLOCATE(I_SPECTRUM(NE_M))
END SUBROUTINE ALLOC_SPECTRUM END SUBROUTINE ALLOC_SPECTRUM
END MODULE SPECTRUM_MOD END MODULE SPECTRUM_MOD
@ -979,9 +1165,21 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_DIRECT() SUBROUTINE ALLOC_DIRECT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DIRANA)) THEN
DEALLOCATE(DIRANA)
ENDIF
ALLOCATE(DIRANA(3,49)) ALLOCATE(DIRANA(3,49))
IF (ALLOCATED(ANADIR)) THEN
DEALLOCATE(ANADIR)
ENDIF
ALLOCATE(ANADIR(3,49)) ALLOCATE(ANADIR(3,49))
IF (ALLOCATED(THETAR)) THEN
DEALLOCATE(THETAR)
ENDIF
ALLOCATE(THETAR(49)) ALLOCATE(THETAR(49))
IF (ALLOCATED(PHIR)) THEN
DEALLOCATE(PHIR)
ENDIF
ALLOCATE(PHIR(49)) ALLOCATE(PHIR(49))
END SUBROUTINE ALLOC_DIRECT END SUBROUTINE ALLOC_DIRECT
END MODULE DIRECT_MOD END MODULE DIRECT_MOD
@ -998,9 +1196,21 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_DIRECT_A() SUBROUTINE ALLOC_DIRECT_A()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(DIRANA_A)) THEN
DEALLOCATE(DIRANA_A)
ENDIF
ALLOCATE(DIRANA_A(3,49)) ALLOCATE(DIRANA_A(3,49))
IF (ALLOCATED(ANADIR_A)) THEN
DEALLOCATE(ANADIR_A)
ENDIF
ALLOCATE(ANADIR_A(3,49)) ALLOCATE(ANADIR_A(3,49))
IF (ALLOCATED(THETAR_A)) THEN
DEALLOCATE(THETAR_A)
ENDIF
ALLOCATE(THETAR_A(49)) ALLOCATE(THETAR_A(49))
IF (ALLOCATED(PHIR_A)) THEN
DEALLOCATE(PHIR_A)
ENDIF
ALLOCATE(PHIR_A(49)) ALLOCATE(PHIR_A(49))
END SUBROUTINE ALLOC_DIRECT_A END SUBROUTINE ALLOC_DIRECT_A
END MODULE DIRECT_A_MOD END MODULE DIRECT_A_MOD
@ -1016,9 +1226,21 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_PATH() SUBROUTINE ALLOC_PATH()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(NPATH)) THEN
DEALLOCATE(NPATH)
ENDIF
ALLOCATE(NPATH(0:NDIF_M)) ALLOCATE(NPATH(0:NDIF_M))
IF (ALLOCATED(NPATH2)) THEN
DEALLOCATE(NPATH2)
ENDIF
ALLOCATE(NPATH2(0:NDIF_M)) ALLOCATE(NPATH2(0:NDIF_M))
IF (ALLOCATED(NPMA)) THEN
DEALLOCATE(NPMA)
ENDIF
ALLOCATE(NPMA(0:NDIF_M)) ALLOCATE(NPMA(0:NDIF_M))
IF (ALLOCATED(NPMI)) THEN
DEALLOCATE(NPMI)
ENDIF
ALLOCATE(NPMI(0:NDIF_M)) ALLOCATE(NPMI(0:NDIF_M))
END SUBROUTINE ALLOC_PATH END SUBROUTINE ALLOC_PATH
END MODULE PATH_MOD END MODULE PATH_MOD
@ -1030,6 +1252,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_ROT() SUBROUTINE ALLOC_ROT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(RLM01)) THEN
DEALLOCATE(RLM01)
ENDIF
ALLOCATE(RLM01(1-NL_M:NL_M-1,1-NL_M:NL_M-1,0:NL_M-1)) ALLOCATE(RLM01(1-NL_M:NL_M-1,1-NL_M:NL_M-1,0:NL_M-1))
END SUBROUTINE ALLOC_ROT END SUBROUTINE ALLOC_ROT
END MODULE ROT_MOD END MODULE ROT_MOD
@ -1043,7 +1268,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_TESTPA() SUBROUTINE ALLOC_TESTPA()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(IT)) THEN
DEALLOCATE(IT)
ENDIF
ALLOCATE(IT(0:NDIF_M)) ALLOCATE(IT(0:NDIF_M))
IF (ALLOCATED(IN)) THEN
DEALLOCATE(IN)
ENDIF
ALLOCATE(IN(0:NDIF_M)) ALLOCATE(IN(0:NDIF_M))
END SUBROUTINE ALLOC_TESTPA END SUBROUTINE ALLOC_TESTPA
END MODULE TESTPA_MOD END MODULE TESTPA_MOD
@ -1067,6 +1298,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_TLDW() SUBROUTINE ALLOC_TLDW()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(TLT)) THEN
DEALLOCATE(TLT)
ENDIF
ALLOCATE(TLT(0:NT_M,4,NATM,NE_M)) ALLOCATE(TLT(0:NT_M,4,NATM,NE_M))
END SUBROUTINE ALLOC_TLDW END SUBROUTINE ALLOC_TLDW
END MODULE TLDW_MOD END MODULE TLDW_MOD
@ -1080,8 +1314,17 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_VARIA() SUBROUTINE ALLOC_VARIA()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(CEX)) THEN
DEALLOCATE(CEX)
ENDIF
ALLOCATE(CEX(0:NDIF_M)) ALLOCATE(CEX(0:NDIF_M))
IF (ALLOCATED(CEXDW)) THEN
DEALLOCATE(CEXDW)
ENDIF
ALLOCATE(CEXDW(0:NDIF_M)) ALLOCATE(CEXDW(0:NDIF_M))
IF (ALLOCATED(DW)) THEN
DEALLOCATE(DW)
ENDIF
ALLOCATE(DW(0:NDIF_M)) ALLOCATE(DW(0:NDIF_M))
END SUBROUTINE ALLOC_VARIA END SUBROUTINE ALLOC_VARIA
END MODULE VARIA_MOD END MODULE VARIA_MOD
@ -1093,7 +1336,10 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_LBD() SUBROUTINE ALLOC_LBD()
USE DIM_MOD USE DIM_MOD
INTEGER I,J INTEGER I, J
IF (ALLOCATED(LBDM)) THEN
DEALLOCATE(LBDM)
ENDIF
ALLOCATE(LBDM(2,NDIF_M)) ALLOCATE(LBDM(2,NDIF_M))
DO I=1,NDIF_M DO I=1,NDIF_M
DO J=1,2 DO J=1,2
@ -1110,6 +1356,9 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_SCATMAT() SUBROUTINE ALLOC_SCATMAT()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(F21)) THEN
DEALLOCATE(F21)
ENDIF
ALLOCATE(F21(NSPIN2_M,NLAMBDA_M,NLAMBDA_M,NDIF_M)) ALLOCATE(F21(NSPIN2_M,NLAMBDA_M,NLAMBDA_M,NDIF_M))
END SUBROUTINE ALLOC_SCATMAT END SUBROUTINE ALLOC_SCATMAT
END MODULE SCATMAT_MOD END MODULE SCATMAT_MOD
@ -1123,7 +1372,13 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_EXTREM() SUBROUTINE ALLOC_EXTREM()
USE DIM_MOD USE DIM_MOD
IF (ALLOCATED(FMIN)) THEN
DEALLOCATE(FMIN)
ENDIF
ALLOCATE(FMIN(0:NDIF_M)) ALLOCATE(FMIN(0:NDIF_M))
IF (ALLOCATED(FMAX)) THEN
DEALLOCATE(FMAX)
ENDIF
ALLOCATE(FMAX(0:NDIF_M)) ALLOCATE(FMAX(0:NDIF_M))
END SUBROUTINE ALLOC_EXTREM END SUBROUTINE ALLOC_EXTREM
END MODULE EXTREM_MOD END MODULE EXTREM_MOD
@ -1139,11 +1394,25 @@ C=======================================================================
CONTAINS CONTAINS
SUBROUTINE ALLOC_PRINTP() SUBROUTINE ALLOC_PRINTP()
USE DIM_MOD USE DIM_MOD
INTEGER I,J IF (ALLOCATED(FMN)) THEN
DEALLOCATE(FMN)
ENDIF
ALLOCATE(FMN(NPATH_M)) ALLOCATE(FMN(NPATH_M))
IF (ALLOCATED(PATH)) THEN
DEALLOCATE(PATH)
ENDIF
ALLOCATE(PATH(NPATH_M)) ALLOCATE(PATH(NPATH_M))
IF (ALLOCATED(DMN)) THEN
DEALLOCATE(DMN)
ENDIF
ALLOCATE(DMN(NPATH_M)) ALLOCATE(DMN(NPATH_M))
IF (ALLOCATED(JON)) THEN
DEALLOCATE(JON)
ENDIF
ALLOCATE(JON(NPATH_M)) ALLOCATE(JON(NPATH_M))
IF (ALLOCATED(JPON)) THEN
DEALLOCATE(JPON)
ENDIF
ALLOCATE(JPON(NPATH_M,NDIF_M)) ALLOCATE(JPON(NPATH_M,NDIF_M))
END SUBROUTINE ALLOC_PRINTP END SUBROUTINE ALLOC_PRINTP
END MODULE PRINTP_MOD END MODULE PRINTP_MOD

View File

@ -1285,7 +1285,7 @@ C
WRITE(IUO1,562) WRITE(IUO1,562)
ENDIF ENDIF
IF(ISOM.EQ.0) CLOSE(IUO2) IF(ISOM.EQ.0) CLOSE(IUO2)
IF((ISOM.EQ.0).AND.(NFICHLEC.NE.1)) CLOSE(IUO1) C! IF((ISOM.EQ.0).AND.(NFICHLEC.NE.1)) CLOSE(IUO1)
C C
C.......... End of the loop on the data files .......... C.......... End of the loop on the data files ..........
C C
@ -1309,7 +1309,7 @@ c ENDIF
ENDIF ENDIF
ENDIF ENDIF
C C
IF((ISOM.NE.0).OR.(NFICHLEC.EQ.1)) CLOSE(IUO1) C! IF((ISOM.NE.0).OR.(NFICHLEC.EQ.1)) CLOSE(IUO1)
IF(ISOM.NE.0) CLOSE(IUO2) IF(ISOM.NE.0) CLOSE(IUO2)
C STOP C STOP
GOTO 999 GOTO 999

View File

@ -144,8 +144,9 @@ def create_tests_results():
create_results(tc, 'test_cut_plane') create_results(tc, 'test_cut_plane')
tc = PEDCopperTestCase() tc = PEDCopperTestCase()
create_results(tc, 'test_phi_scan')
create_results(tc, 'test_theta_scan') create_results(tc, 'test_theta_scan')
tc = PEDCopperTestCase()
create_results(tc, 'test_phi_scan')
def delete_results_file(): def delete_results_file():
os.remove(RESULTS_FILENAME) os.remove(RESULTS_FILENAME)

View File

@ -9,6 +9,7 @@ setup(name='msspec',
include_package_data=True, include_package_data=True,
packages=find_packages(include='msspec.*'), packages=find_packages(include='msspec.*'),
install_requires=[ install_requires=[
'numpy',
'ase', 'ase',
'h5py', 'h5py',
'lxml', 'lxml',

View File

@ -266,7 +266,7 @@ class CommonBlockInfo(BaseInfo):
#exit() #exit()
else: else:
if re.match("^[A-HO-Z].*", v.name, re.I): if re.match("^[A-HO-Z].*", v.name, re.I):
v.type = "DOUBLE PRECISION" v.type = "REAL"
else: else:
v.type = "INTEGER" v.type = "INTEGER"
@ -808,6 +808,9 @@ def write_modules(infile):
# for each variable with a defined dimension # for each variable with a defined dimension
for variable in variables: for variable in variables:
if variable.dimension is not None: if variable.dimension is not None:
s += f" IF (ALLOCATED({variable.name})) THEN\n"
s += f" DEALLOCATE({variable.name})\n"
s += f" ENDIF\n"
s += f" ALLOCATE({variable})\n" s += f" ALLOCATE({variable})\n"
s += f" END SUBROUTINE ALLOC_{cbi.name.upper()}\n" s += f" END SUBROUTINE ALLOC_{cbi.name.upper()}\n"
@ -832,10 +835,11 @@ def write_modules(infile):
if __name__ == "__main__": if __name__ == "__main__":
infile = 'spec.f' infile = 'spec.f.orig'
# write the modules.f file # write the modules.f file
write_modules(infile) write_modules(infile)
exit()
fi = FileInfo(filename=infile) fi = FileInfo(filename=infile)