Rewrote Makefile rules

This commit is contained in:
Sylvain Tricot 2022-02-28 22:30:37 +01:00
parent 1feaa0591f
commit b1d47a718e
7 changed files with 549 additions and 162 deletions

View File

@ -25,8 +25,7 @@
###############################################################################
DEBUG = 0
BUILDDIR = build
EXE = eps
SO = $(EXE).so
SO = eps.so
FC = gfortran
PREFIX = $(HOME)/.local
AUTHORS = Didier Sébilleau <didier.sebilleau@univ-rennes1.fr>, \
@ -37,7 +36,7 @@ AUTHORS = Didier Sébilleau <didier.sebilleau@univ-rennes1.fr>, \
# /!\ DO NOT EDIT BELOW THAT LINE (unlesss you know what you're doing...) #
# CORE CONFIGURATION #
################################################################################
SHELL = bash
PYTHON_PKG_NAME = msspec_dfm
VERSION = $(shell cd python && python -c 'from $(PYTHON_PKG_NAME) import __version__; print(__version__)')
SRCDIR = fortran/DFM_library
@ -237,19 +236,17 @@ calc_POST:=$(SRCDIR)/PLASMON_LIBRARY/plasmon_dispersion_2.f90 \
$(SRCDIR)/CALCULATORS_LIBRARY/call_calc_p.f90
SRCS:= $(read_SRCS) $(io_SRCS) $(calc_DEPS) $(calc_SRCS) $(calc_TEST) $(calc_POST)
SRCS:=$(read_SRCS) $(io_SRCS) $(calc_DEPS) $(calc_SRCS) $(calc_TEST) $(calc_POST)
OBJS:=$(addprefix $(BUILDDIR)/,$(patsubst %.f90,%.o,$(SRCS)))
.PHONY: all obj exe so pypkg install uninstall clean help
.PHONY: all obj so pypkg install uninstall man clean help
all: so
obj: $(OBJS)
#exe: $(BUILDDIR)/$(EXE)
so: python/$(PYTHON_PKG_NAME)/$(SO)
pypkg: python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz
@ -259,29 +256,21 @@ python/VERSION:
@cat $(VERSION) > $@
install: python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz
@echo "Installing $^"
@pip install $^
python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz: python/$(PYTHON_PKG_NAME)/$(SO)
python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz: python/man/$(EXE).1.gz
python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz: man
python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz: python/MANIFEST.in python/setup.py python/pip.freeze $(shell find python/$(PYTHON_PKG_NAME) -name '*.py')
@cd python && python setup.py sdist
python/$(PYTHON_PKG_NAME)/$(SO): $(OBJS) $(SRCDIR)/../epsilon.f90
python/$(PYTHON_PKG_NAME)/$(SO): $(OBJS) $(SRCDIR)/../_dfm.f90
@echo "Building $@ shared object..."
@mkdir -p $(BUILDDIR)
@sed -e 's/END PROGRAM.*/END SUBROUTINE/' -e 's/PROGRAM/SUBROUTINE/' $(SRCDIR)/../epsilon.f90 > $(BUILDDIR)/_dfm.f90
@$(F2PY) -m $(BUILDDIR).$(basename $(@F)) -c $(filter-out $(lastword $^), $^) $(BUILDDIR)/_dfm.f90 && mv $(BUILDDIR)/*.so $@
#$(BUILDDIR)/$(EXE): $(OBJS) $(SRCDIR)/../epsilon.f90
# @echo "building main $@..."
# @$(FC) $(FFLAGS) $(LDFLAGS) $(LDLIBS) -J $(BUILDDIR) -o $@ $^
python/man/$(EXE).1.gz: python/man/manpage.txt
@sed -e 's/^\.TH.*/\.TH man 1 \"$(shell date)\" \"$(VERSION)\" \"$(EXE) man page\"/' \
-e 's/^$$AUTHORS$$.*/$(AUTHORS)/' $^ > $@
@gzip $@
@$(F2PY) -I$(BUILDDIR) -m $(BUILDDIR).$(basename $(@F)) -c $(filter-out $(lastword $^), $^) $(SRCDIR)/../_dfm.f90 && mv $(BUILDDIR)/*.so $@
$(BUILDDIR)/%.o: %.f90
@ -290,9 +279,11 @@ $(BUILDDIR)/%.o: %.f90
@$(FC) $(FFLAGS) -J $(BUILDDIR) -I $(BUILDDIR) -fPIC -o $@ -c $<
install: python/dist/$(PYTHON_PKG_NAME)-$(VERSION).tar.gz
@echo "Installing $^"
@pip install $^
man: python/man/inputfile.spec
@cd python && python setup.py --command-packages=click_man.commands man_pages --target ./man/pages
@cd python/man/pages && cat ../inputfile.spec >> *-generate.1
@cd python/man/pages && echo -e ".SH AUTHORS\n.PP\n$(AUTHORS)" | tee -a *.1 > /dev/null
@cd python/man/pages && gzip -f *.1
uninstall:
@ -305,7 +296,7 @@ clean:
@rm -rf python/dist
@rm -rf python/*.egg-info
@rm -f python/VERSION
@rm -f python/man/*.gz
@rm -rf python/man/pages
help:
@ -316,4 +307,3 @@ help:
@echo "It is also possible to add debugging symbols with the 'DEBUG' variable."
@echo "For example, to install in another (writable) location with debugging options:"
@echo " make DEBUG=1 && make install PREFIX=/opt"

View File

@ -6,6 +6,7 @@ MODULE OUTFILES
! This module contains functions/subroutines for working with
! the output files
!
CHARACTER (LEN = 80) :: OUTDIR
CONTAINS
!
!
@ -59,104 +60,104 @@ CONTAINS
!
IMPLICIT NONE
!
CHARACTER (LEN = 100) :: FLIST(NOFFN)
CHARACTER (LEN = 100) :: FLIST(NOFFN)
!
! Filenames:
!
DFFILE='Results/diel_func.dat' ! dielectric function file
PZFILE='Results/pola_func.dat' ! polarization function
SUFILE='Results/susc_func.dat' ! susceptibility function
CDFILE='Results/cond_func.dat' ! electrical conductivity
DFFILE=TRIM(OUTDIR)//'/diel_func.dat' ! dielectric function file
PZFILE=TRIM(OUTDIR)//'/pola_func.dat' ! polarization function
SUFILE=TRIM(OUTDIR)//'/susc_func.dat' ! susceptibility function
CDFILE=TRIM(OUTDIR)//'/cond_func.dat' ! electrical conductivity
!
PDFILE='Results/plas_disp.dat' ! plasmon dispersion file
EHFILE='Results/elec_hole.dat' ! electron-hole dispersion file
E2FILE='Results/elec_hol2.dat' ! two electron-hole dispersion
CKFILE='Results/int_pot_k.dat' ! interaction potential (k-space)
CRFILE='Results/int_pot_r.dat' ! interaction potential (real space)
PKFILE='Results/plas_kine.dat' ! plasmon kinetic energy file
PDFILE=TRIM(OUTDIR)//'/plas_disp.dat' ! plasmon dispersion file
EHFILE=TRIM(OUTDIR)//'/elec_hole.dat' ! electron-hole dispersion file
E2FILE=TRIM(OUTDIR)//'/elec_hol2.dat' ! two electron-hole dispersion
CKFILE=TRIM(OUTDIR)//'/int_pot_k.dat' ! interaction potential (k-space)
CRFILE=TRIM(OUTDIR)//'/int_pot_r.dat' ! interaction potential (real space)
PKFILE=TRIM(OUTDIR)//'/plas_kine.dat' ! plasmon kinetic energy file
!
LFFILE='Results/loca_fiel.dat' ! local-field correction file G(q,om)
IQFILE='Results/ginf_fiel.dat' ! G(q,inf) file
SFFILE='Results/stru_fact.dat' ! structure factor file S(q,om)
PCFILE='Results/pair_corr.dat' ! pair correlation function file
P2FILE='Results/pair_dist.dat' ! pair distribution function file
VXFILE='Results/vertex_fu.dat' ! vertex function Gamma(q,om)
DCFILE='Results/plas_damp.dat' ! plasmon damping coefficient Im[eps]/q^2
MDFILE='Results/mome_dist.dat' ! momentum distribution
LDFILE='Results/landau_pa.dat' ! Landau parameters
DPFILE='Results/damp_file.dat' ! damping file
LTFILE='Results/life_time.dat' ! plasmon lifetime file
BRFILE='Results/broadenin.dat' ! plasmon broadening
PEFILE='Results/plas_ener.dat' ! plasmon energy
QCFILE='Results/qc_bounds.dat' ! plasmon q-bounds
RLFILE='Results/rela_time.dat' ! relaxation time
KSFILE='Results/screen_wv.dat' ! screening wave vector
OQFILE='Results/omega_qvf.dat' ! omega = q * v_F file
MEFILE='Results/moments_e.dat' ! moments of epsilon
MSFILE='Results/moments_s.dat' ! moments of S(q,omega)
MLFILE='Results/moments_l.dat' ! moments of loss function
MCFILE='Results/moments_c.dat' ! moments of conductivity
DEFILE='Results/deri_epsi.dat' ! derivative of Re[ dielectric function ]
ZEFILE='Results/ree0_file.dat' ! Re[ dielectric function ] = 0
SRFILE='Results/sum_rules.dat' ! sum rules for epsilon
CWFILE='Results/confin_wf.dat' ! confinement wave function
CFFILE='Results/confin_pt.dat' ! confinement potential
EMFILE='Results/effe_mass.dat' ! effective mass
MFFILE='Results/mean_path.dat' ! mean free path
SPFILE='Results/spec_func.dat' ! spectral function
SEFILE='Results/self_ener.dat' ! self-energy
SBFILE='Results/subb_ener.dat' ! subband energies
ESFILE='Results/elia_func.dat' ! Eliashberg function
GRFILE='Results/grune_par.dat' ! Grüneisen parameter
FDFILE='Results/fermi_dir.dat' ! Fermi-Dirac distribution
BEFILE='Results/bose_eins.dat' ! Bose-Einstein distribution
MXFILE='Results/maxwell_d.dat' ! Maxwell distribution
SCFILE='Results/scale_par.dat' ! scale parameters
DSFILE='Results/dens_stat.dat' ! density of states
NVFILE='Results/neva_four.dat' ! Nevanlinaa/memory function
MTFILE='Results/memo_time.dat' ! time domain memory function
LFFILE=TRIM(OUTDIR)//'/loca_fiel.dat' ! local-field correction file G(q,om)
IQFILE=TRIM(OUTDIR)//'/ginf_fiel.dat' ! G(q,inf) file
SFFILE=TRIM(OUTDIR)//'/stru_fact.dat' ! structure factor file S(q,om)
PCFILE=TRIM(OUTDIR)//'/pair_corr.dat' ! pair correlation function file
P2FILE=TRIM(OUTDIR)//'/pair_dist.dat' ! pair distribution function file
VXFILE=TRIM(OUTDIR)//'/vertex_fu.dat' ! vertex function Gamma(q,om)
DCFILE=TRIM(OUTDIR)//'/plas_damp.dat' ! plasmon damping coefficient Im[eps]/q^2
MDFILE=TRIM(OUTDIR)//'/mome_dist.dat' ! momentum distribution
LDFILE=TRIM(OUTDIR)//'/landau_pa.dat' ! Landau parameters
DPFILE=TRIM(OUTDIR)//'/damp_file.dat' ! damping file
LTFILE=TRIM(OUTDIR)//'/life_time.dat' ! plasmon lifetime file
BRFILE=TRIM(OUTDIR)//'/broadenin.dat' ! plasmon broadening
PEFILE=TRIM(OUTDIR)//'/plas_ener.dat' ! plasmon energy
QCFILE=TRIM(OUTDIR)//'/qc_bounds.dat' ! plasmon q-bounds
RLFILE=TRIM(OUTDIR)//'/rela_time.dat' ! relaxation time
KSFILE=TRIM(OUTDIR)//'/screen_wv.dat' ! screening wave vector
OQFILE=TRIM(OUTDIR)//'/omega_qvf.dat' ! omega = q * v_F file
MEFILE=TRIM(OUTDIR)//'/moments_e.dat' ! moments of epsilon
MSFILE=TRIM(OUTDIR)//'/moments_s.dat' ! moments of S(q,omega)
MLFILE=TRIM(OUTDIR)//'/moments_l.dat' ! moments of loss function
MCFILE=TRIM(OUTDIR)//'/moments_c.dat' ! moments of conductivity
DEFILE=TRIM(OUTDIR)//'/deri_epsi.dat' ! derivative of Re[ dielectric function ]
ZEFILE=TRIM(OUTDIR)//'/ree0_file.dat' ! Re[ dielectric function ] = 0
SRFILE=TRIM(OUTDIR)//'/sum_rules.dat' ! sum rules for epsilon
CWFILE=TRIM(OUTDIR)//'/confin_wf.dat' ! confinement wave function
CFFILE=TRIM(OUTDIR)//'/confin_pt.dat' ! confinement potential
EMFILE=TRIM(OUTDIR)//'/effe_mass.dat' ! effective mass
MFFILE=TRIM(OUTDIR)//'/mean_path.dat' ! mean free path
SPFILE=TRIM(OUTDIR)//'/spec_func.dat' ! spectral function
SEFILE=TRIM(OUTDIR)//'/self_ener.dat' ! self-energy
SBFILE=TRIM(OUTDIR)//'/subb_ener.dat' ! subband energies
ESFILE=TRIM(OUTDIR)//'/elia_func.dat' ! Eliashberg function
GRFILE=TRIM(OUTDIR)//'/grune_par.dat' ! Grüneisen parameter
FDFILE=TRIM(OUTDIR)//'/fermi_dir.dat' ! Fermi-Dirac distribution
BEFILE=TRIM(OUTDIR)//'/bose_eins.dat' ! Bose-Einstein distribution
MXFILE=TRIM(OUTDIR)//'/maxwell_d.dat' ! Maxwell distribution
SCFILE=TRIM(OUTDIR)//'/scale_par.dat' ! scale parameters
DSFILE=TRIM(OUTDIR)//'/dens_stat.dat' ! density of states
NVFILE=TRIM(OUTDIR)//'/neva_four.dat' ! Nevanlinaa/memory function
MTFILE=TRIM(OUTDIR)//'/memo_time.dat' ! time domain memory function
!
GPFILE='Results/gran_part.dat' ! grand partition function
PRFILE='Results/epressure.dat' ! electronic pressure
COFILE='Results/comp_file.dat' ! compressibility
CPFILE='Results/chem_pote.dat' ! chemical potential
BMFILE='Results/bulk_modu.dat' ! bulk modulus
SHFILE='Results/shear_mod.dat' ! shear modulus
S0FILE='Results/zero_soun.dat' ! zero sound velocity
S1FILE='Results/firs_soun.dat' ! first sound velocity
DTFILE='Results/Debye_tmp.dat' ! Debye temperature
PSFILE='Results/para_susc.dat' ! Pauli paramagnetic susceptibility
IEFILE='Results/inter_ene.dat' ! internal energy
EIFILE='Results/exces_ene.dat' ! excess internal energy
FHFILE='Results/helm_free.dat' ! Helmholtz free energy
EYFILE='Results/entropy_f.dat' ! entropy
GPFILE=TRIM(OUTDIR)//'/gran_part.dat' ! grand partition function
PRFILE=TRIM(OUTDIR)//'/epressure.dat' ! electronic pressure
COFILE=TRIM(OUTDIR)//'/comp_file.dat' ! compressibility
CPFILE=TRIM(OUTDIR)//'/chem_pote.dat' ! chemical potential
BMFILE=TRIM(OUTDIR)//'/bulk_modu.dat' ! bulk modulus
SHFILE=TRIM(OUTDIR)//'/shear_mod.dat' ! shear modulus
S0FILE=TRIM(OUTDIR)//'/zero_soun.dat' ! zero sound velocity
S1FILE=TRIM(OUTDIR)//'/firs_soun.dat' ! first sound velocity
DTFILE=TRIM(OUTDIR)//'/Debye_tmp.dat' ! Debye temperature
PSFILE=TRIM(OUTDIR)//'/para_susc.dat' ! Pauli paramagnetic susceptibility
IEFILE=TRIM(OUTDIR)//'/inter_ene.dat' ! internal energy
EIFILE=TRIM(OUTDIR)//'/exces_ene.dat' ! excess internal energy
FHFILE=TRIM(OUTDIR)//'/helm_free.dat' ! Helmholtz free energy
EYFILE=TRIM(OUTDIR)//'/entropy_f.dat' ! entropy
!
EFFILE='Results/fermi_ene.dat' ! Fermi energy
KFFILE='Results/fermi_vec.dat' ! Fermi momentum
VFFILE='Results/fermi_vel.dat' ! Fermi velocity
TEFILE='Results/fermi_tmp.dat' ! Fermi temperature
DLFILE='Results/fermi_dos.dat' ! Fermi density of states
EFFILE=TRIM(OUTDIR)//'/fermi_ene.dat' ! Fermi energy
KFFILE=TRIM(OUTDIR)//'/fermi_vec.dat' ! Fermi momentum
VFFILE=TRIM(OUTDIR)//'/fermi_vel.dat' ! Fermi velocity
TEFILE=TRIM(OUTDIR)//'/fermi_tmp.dat' ! Fermi temperature
DLFILE=TRIM(OUTDIR)//'/fermi_dos.dat' ! Fermi density of states
!
TWFILE='Results/thermal_w.dat' ! thermal De Broglie wavelength
VTFILE='Results/thermal_v.dat' ! thermal velocity
TCFILE='Results/thermal_c.dat' ! thermal conductivity
TWFILE=TRIM(OUTDIR)//'/thermal_w.dat' ! thermal De Broglie wavelength
VTFILE=TRIM(OUTDIR)//'/thermal_v.dat' ! thermal velocity
TCFILE=TRIM(OUTDIR)//'/thermal_c.dat' ! thermal conductivity
!
EGFILE='Results/ground_st.dat' ! ground state energy
EXFILE='Results/ex_energy.dat' ! exchange energy
XCFILE='Results/xc_energy.dat' ! exchange correlation energy
ECFILE='Results/corr_ener.dat' ! correlation energy
HFFILE='Results/hf_energy.dat' ! Hartree-Fock energy
EKFILE='Results/kine_ener.dat' ! kinetic energy
EPFILE='Results/pote_ener.dat' ! potential energy
EGFILE=TRIM(OUTDIR)//'/ground_st.dat' ! ground state energy
EXFILE=TRIM(OUTDIR)//'/ex_energy.dat' ! exchange energy
XCFILE=TRIM(OUTDIR)//'/xc_energy.dat' ! exchange correlation energy
ECFILE=TRIM(OUTDIR)//'/corr_ener.dat' ! correlation energy
HFFILE=TRIM(OUTDIR)//'/hf_energy.dat' ! Hartree-Fock energy
EKFILE=TRIM(OUTDIR)//'/kine_ener.dat' ! kinetic energy
EPFILE=TRIM(OUTDIR)//'/pote_ener.dat' ! potential energy
!
VIFILE='Results/visc_coef.dat' ! shear viscosity
DIFILE='Results/diff_coef.dat' ! diffusion coefficient
VIFILE=TRIM(OUTDIR)//'/visc_coef.dat' ! shear viscosity
DIFILE=TRIM(OUTDIR)//'/diff_coef.dat' ! diffusion coefficient
!
FPFILE='Results/fluct_pot.dat' ! fluctuation potential file
ELFILE='Results/ener_loss.dat' ! energy loss function
POFILE='Results/stop_powe.dat' ! stopping power
RFFILE='Results/refrac_in.dat' ! refractive index
VCFILE='Results/dyna_coul.dat' ! dynamic screened Coulomb potential V(q,omega)
FPFILE=TRIM(OUTDIR)//'/fluct_pot.dat' ! fluctuation potential file
ELFILE=TRIM(OUTDIR)//'/ener_loss.dat' ! energy loss function
POFILE=TRIM(OUTDIR)//'/stop_powe.dat' ! stopping power
RFFILE=TRIM(OUTDIR)//'/refrac_in.dat' ! refractive index
VCFILE=TRIM(OUTDIR)//'/dyna_coul.dat' ! dynamic screened Coulomb potential V(q,omega)
!
! Corresponding fortran units
!
@ -425,7 +426,7 @@ CONTAINS
! For instance, if we want to compute the correlation energy
! as a function of r_s, we will loop on the input data files
! with different r_s, but all results have to be written
! into the same output file 'Results/corr_ener.dat'
! into the same output file 'OUTDIR/corr_ener.dat'
!
!
! Author : D. Sébilleau

345
src/fortran/_dfm.f90 Normal file
View File

@ -0,0 +1,345 @@
!
!=======================================================================
!
SUBROUTINE EPSILON(MYINFILE, MYOUTDIR)
!
! This program computes model dielectric functions for many type
! of materials. These dielectric functions are essentially based
! on the Fermi liquid theory.
!
! Several other physical quantities, based on the
! dielectric function can also be computed, namely:
!
! * the loss function
! * the EELS cross-section
! * the plasmon fluctuation potential
! * the stopping power
! * the optical properties
!
!
! Lead developer: Didier Sébilleau
!
! Co-developers : Aditi Mandal, Sylvain Tricot
!
!
!
! Main notations :
!
! * X : dimensionless factor --> X = q / (2 * k_F)
!
! * Y : dimensionless factor --> Y = q / k_F
!
! * Z : dimensionless factor --> Z = omega / omega_q = V / (4 * X * X)
!
! * U : dimensionless factor --> U = omega / (q * v_F) = X * Z = V / (4 * X)
!
! * V : dimensionless factor --> V = omega / omega_{k_F} = Z * Y^2 = 4 U * X
!
!
!
!
! Last modified : 6 Aug 2021
!
!
USE ACCURACY_REAL
USE DIMENSION_CODE, ONLY : NSIZE
!
USE SF_VALUES, ONLY : SQO_TYPE
!
USE REAL_NUMBERS, ONLY : ZERO,ONE,HALF,SMALL
USE MATERIAL_PROP, ONLY : RS,DMN
USE EXT_FIELDS, ONLY : H
!
USE Q_GRID
!
USE FERMI_VALUES
USE FERMI_VALUES_M
USE PLASMON_ENE
USE PLASMA_SCALE
USE CALC_ASYMPT
!
USE PRINT_CALC_TYPE
USE PRINT_HEADERS
USE PRINT_FERMI
USE PRINT_PLASMONS
USE PRINT_ASYMPTOTIC
USE PRINT_SCALE_PARAM
USE PRINT_MAT_LENGTHS
USE PRINT_THERMAL
USE PRINT_THERMODYNAMICS
USE PRINT_ENERGIES_EL
!
USE DAMPING_COEF
USE PLASMON_DISPERSION
!
USE CALL_CALC_1
USE CALL_CALC_2
USE CALL_CALC_3
USE CALL_CALC_5
USE CALL_CALC_7
USE CALL_CALC_9
USE CALL_CALC_P
!
USE TEST_INTEGRALS_2
USE TEST_INTEGRALS_3
USE TEST_INTEGRALS_8
USE TEST_INT_HUBBARD
!
USE RE_EPS_0_TREATMENT
!
USE INPUT_DATA
!
USE OUT_VALUES_10
!
USE OUT_CALC
!
USE CHANGE_FILENAMES
!
USE OUTFILES
USE OPEN_OUTFILES
USE CLOSE_OUTFILES
!
IMPLICIT NONE
!
INTEGER :: N_IF,JF
INTEGER :: IQ,IE
!
REAL (WP) :: Q,X
REAL (WP) :: EPSR(NSIZE),EPSI(NSIZE),EN(NSIZE)
!
CHARACTER (LEN = 100) :: INPDATA(999)
CHARACTER (LEN = 100) :: LOGFILE(999)
!
CHARACTER (LEN = 100) :: MYINFILE
CHARACTER (LEN = 100) :: MYOUTDIR
!
OUTDIR = MYOUTDIR
CALL SYSTEM('mkdir -p '//TRIM(OUTDIR))
!
! Loop on the input data files
!
! N_IF = 11
N_IF = 1
! READ(*,15) N_IF !
! DO JF = 1,N_IF !
! READ(*,25) INPDATA(JF) !
! END DO !
INPDATA(1) = TRIM(MYINFILE)
! INPDATA(1) = 'Data/epsilon.dat'
! INPDATA(1) = 'Data/epsilon_00.dat'
! INPDATA(2) = 'Data/epsilon_01.dat'
! INPDATA(3) = 'Data/epsilon_02.dat'
! INPDATA(4) = 'Data/epsilon_03.dat'
! INPDATA(5) = 'Data/epsilon_04.dat'
! INPDATA(6) = 'Data/epsilon_05.dat'
! INPDATA(7) = 'Data/epsilon_06.dat'
! INPDATA(8) = 'Data/epsilon_07.dat'
! INPDATA(9) = 'Data/epsilon_08.dat'
! INPDATA(10) = 'Data/epsilon_09.dat'
! INPDATA(11) = 'Data/epsilon_10.dat'
!
!
! Name of the corresponding log files
!
CALL LOGFILE_NAMES(N_IF,LOGFILE) !
!
DO JF = 1,N_IF ! start loop on files
!
! Initialization of the arrays
!
DO IE=1,NSIZE !
EN(IE) = ZERO !
EPSR(IE) = ZERO !
EPSI(IE) = ZERO !
END DO !
!
! Opening input/log data files
!
OPEN(UNIT=5,FILE=TRIM(INPDATA(JF)),STATUS='OLD') !
OPEN(UNIT=6,FILE=TRIM(LOGFILE(JF)),STATUS='UNKNOWN') !
!
! Printing the headers
!
CALL PRINT_ASCII !
!
! Reading the input data file
!
CALL READ_DATA !
!
IF(SQO_TYPE == 'UTI') THEN !
OPEN(UNIT = 1, FILE = TRIM(OUTDIR)//'/utic_para.dat', & !
STATUS = 'unknown') !
END IF !
!
! Opening result files
!
CALL OPEN_OUTPUT_FILES(N_IF,JF) !
!
! Post-processing:
!
IF(PL_DISP == ' EXACT') THEN !
I_PP = I_FP + I_PD !
ELSE !
I_PP = I_FP !
END IF !
!
! Printing the information on the calculations to be performed
!
! CALL PRINT_CALC_INFO !
!
! Computation of the Fermi values and storage
!
WRITE(6,10) !
!
IF(H < SMALL) THEN !
CALL CALC_FERMI(DMN,RS) !
CALL PRINT_FERMI_SI !
ELSE !
CALL CALC_FERMI_M(DMN,RS) !
CALL PRINT_FERMI_SI_M !
END IF !
!
! Test of the integrals
!
IF(I_TI /= 0) THEN !
IF(I_TI == 2) CALL CALC_TEST_INT_2 !
IF(I_TI == 3) CALL CALC_TEST_INT_3 !
IF(I_TI == 8) CALL CALC_TEST_INT_8 !
IF(I_TI == 10) CALL CALC_TEST_HUBBARD !
END IF !
!
! Computation of the plasmon properties and storage
!
CALL CALC_PLASMON_ENE !
CALL CALC_PLASMA_SCALE !
!
! Computation of the asymptotic values and storage
!
! CALL CALC_ASYMPT_VALUES !
!
! Selective printing of physical properties (log file)
!
IF(I_WR == 1) THEN !
!
! Printing the plasma properties
!
WRITE(6,10) !
CALL PRINT_PLASMA !
!
! Printing the asymptotic values
!
WRITE(6,10) !
CALL PRINT_ASYMPT_VALUES !
!
! Printing the scale parameters
!
WRITE(6,10) !
CALL PRINT_SCALE_PARAMETERS !
!
! Printing the material's characteristic lengths
!
WRITE(6,10) !
CALL PRINT_CHAR_LENGTHS !
!
! Printing the thermal properties
!
WRITE(6,10) !
CALL PRINT_THERMAL_PROP !
!
! Printing the thermodynamics properties
!
WRITE(6,10) !
CALL PRINT_THERMODYNAMICS_PROP !
!
! Printing the energies at q = 0
!
WRITE(6,10) !
CALL PRINT_ENERGIES(ZERO,0,ZERO,ONE) !
!
END IF !
!
! Calling calculator 5 (Fermi properties)
!
IF(I_C5 > 0) CALL USE_CALC_5 !
!
! Starting the loop on q
! (the loop on energy is inside the calculators)
!
!
!.......... Loop on plasmon momentum Q ..........
!
DO IQ = 1,N_Q !
!
Q = Q_MIN + FLOAT(IQ - 1) * Q_STEP ! Q = q/k_F
!
X = HALF * Q ! X = q/(2k_f)
!
! Computing and printing the damping (if any)
!
CALL CALC_DAMPING(IQ,X)
!
! Calling calculator 1 (eps, pi, chi, sigma)
!
IF(I_C1 > 0) CALL USE_CALC_1(X,EN,EPSR,EPSI) !
!
! Calling calculator 2
!
IF(I_C2 > 0) CALL USE_CALC_2(IQ,X) !
!
! Calling calculator 3
!
IF(I_C3 > 0) CALL USE_CALC_3(IQ,X) !
!
! Calling calculator 9
!
IF(I_C9 > 0) CALL USE_CALC_9(X) !
!
! Calling test calculator
!
! CALL CALC_TEST(IQ,X)
!
!.......... End of loop on plasmon momentum Q ..........
!
END DO !
!
! Calling calculator 7 (Energies)
!
IF(I_C7 > 0) CALL USE_CALC_7 !
!
! Post-processing whenever requested
!
IF(I_PP > 0) CALL USE_CALC_P !
!
IF(I_ZE == 1) THEN !
CALL REORDER_EPS0_PRINT !
END IF !
!
! Closing input/log data files
!
CLOSE(5) !
CLOSE(6) !
!
IF(SQO_TYPE == 'UTI') THEN !
CLOSE(1) !
END IF !
!
! Closing the indexed result files
!
CALL CLOSE_OUTPUT_FILES(0) !
!
! End of input data files loop
!
END DO !
!
! Closing the other result files
!
CALL CLOSE_OUTPUT_FILES(1) !
!
! Formats:
!
10 FORMAT(' ')
15 FORMAT(I3)
25 FORMAT(A50)
!
END SUBROUTINE

View File

@ -1,13 +1,6 @@
.\" Manpage for eps.
.TH man 1 "22 February 2022" "1.0" "eps man page"
.SH NAME
eps \- compute the dielectric function
.SH SYNOPSIS
eps INPUT_FILE
.SH DESCRIPTION
eps is a program to compute the dielectric function in the (q,omega) space according to various models and approximations.
.SH OPTIONS
The INPUT_FILE is formatted as follows
.SH INPUT FILE FORMAT
The input file is formatted as follows:
******************************************************************************
* MsSpec DIELECTRIC FUNCTION MODULE *
@ -2595,17 +2588,3 @@ The INPUT_FILE is formatted as follows
* I_WR : switch for writing physical properties into the log file
I_WR = 0 : does not write
I_WR = 1 : writes
.SH BUGS
No known bugs for now.
.SH AUTHOR
$AUTHORS$

View File

@ -20,31 +20,101 @@
# Last modified: Fri, 25 Feb 2022 17:27:32 +0100
# Committed by : Sylvain Tricot <sylvain.tricot@univ-rennes1.fr> 1645806435 +0100
import argparse
import click
import logging
from msspec_dfm.version import __version__
from msspec_dfm.eps import epsilon
def main():
parser = argparse.ArgumentParser(description="Compute the dielectric function")
# The folder option is the default place where are the results
parser.add_argument('--folder', default='./Results',
help='The default place where are stored the results..')
parser.add_argument('--verbose', '-v', default=0, action='count',
help=('Increase verbosity output. Full verbosity'
' for -vvv'))
parser.add_argument('--version', action='store_true',
help=('Show the program version.'))
args = parser.parse_args()
# adjust the verbosity level
@click.group(invoke_without_command=True, no_args_is_help=True)
@click.option('--version', is_flag=True,
help='Print the program version and exit.')
@click.option('-v', '--verbose', count=True,
help='Increase the verbosity output. Full verbosity for -vvv')
def main(version, verbose):
# Adjust the verbosity level
verbosity_levels = [logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
logging.basicConfig(level=verbosity_levels[min(args.verbose, len(verbosity_levels)-1)])
logging.basicConfig(level=verbosity_levels[min(verbose, len(verbosity_levels)-1)])
if args.version:
# Print the version and exit
if version:
logging.debug('Getting the version number...')
print(__version__)
exit(0)
@main.command()
@click.option('--input-file', default='Data/epsilon.dat', show_default=True,
metavar='FILE_NAME',
help='The input filename.')
def generate(input_file):
"""Generate an input file.
An input file with default parameters will be written to INPUT_FILE.
"""
logging.debug("Generating the input file \'{:s}\'...".format(input_file))
print(input_file)
@main.command()
@click.argument('input-file')
@click.option('--folder', default='./Results', show_default=True,
metavar='FOLDER_NAME',
help='The output folder.')
def compute(input_file, folder):
"""Compute the dielectric function.
All the calculation parameters are defined in INPUT_FILE.
See help of the 'generate' command for a full reference of the file
format and all the options.
"""
logging.debug("Computing...")
logging.debug(" Input file : \'{:s}\'".format(input_file))
logging.debug(" Output folder: \'{:s}\'".format(folder))
@main.command()
@click.argument('plot-type', metavar='TYPE',
type=click.Choice(['diel_func', 'susc_func', 'cond_func',
'loca_fiel', 'stru_fact', 'vertex_fu',
'deri_epsi', 'self_ener', 'dyna_coul'],
case_sensitive=False))
@click.option('--folder', default='./Results', show_default=True, metavar='FOLDER_NAME',
help='The folder containing the results.')
@click.option('--img', is_flag=True,
help='Select imaginery part.')
@click.option('--bounds', nargs=2, type=float, default=[-2, 2], show_default=True,
metavar='LOWER UPPER',
help='Limits for the colorbar scale.')
@click.option('--plot3d', is_flag=True,
help='Plot in 3D.')
@click.option('--contour', is_flag=True,
help='Add contours.')
@click.option('--pdeh', is_flag=True,
help='Add the dispersion and electron-hole curves.')
@click.option('--levels', type=int, default=8, show_default=True,
help='Number of levels for contour plots.')
@click.option('--Ef', 'Ef', type=float, default=1, show_default=True,
help='Fermi energy if renormalization is needed.')
@click.option('--strides', type=int, default=64, show_default=True,
help='Number of strides for 3D plot. The lower, the higher the resolution.')
def plot(plot_type, folder, img, bounds, plot3d, contour, pdeh, levels, Ef, strides):
"""Plotting the results.
\b
The plot TYPE value may be one of the following values:
* diel_func
* susc_func
* cond_func
* loca_fiel
* stru_fact
* vertex_fu
* deri_epsi
* self_ener
* dyna_coul
"""
logging.debug("Plotting...")
for key, value in locals().items():
logging.debug(" {}: {}".format(key, value))
if __name__ == '__main__':
main()

View File

@ -1 +1,3 @@
matplotlib
click
click-man

View File

@ -33,7 +33,7 @@ if __name__ == "__main__":
include_package_data=True,
packages=find_packages(include='msspec_dfm.*'),
install_requires=REQUIREMENTS,
data_files = [('share/man/man1', glob.glob('man/*.gz'))],
data_files = [('share/man/man1', glob.glob('man/pages/*.gz'))],
author='Didier Sébilleau, Aditi Mandhal, Sylvain Tricot',
author_email='sylvain.tricot@univ-rennes1.fr',