Skip to content
Snippets Groups Projects
Commit df689191 authored by Karl-Michael Schindler's avatar Karl-Michael Schindler
Browse files

Add run with original code from Lambin

parent b733f240
No related merge requests found
......@@ -20,8 +20,9 @@ tests/oxlog/bosonf90
tests/oxlog/bosou
tests/oxlog/eelsou
tests/setepslog/eelsf90
tests/seteps/build-f90
tests/seteps/build-original
tests/seteps/build-f77
tests/seteps/build-WFW
tests/seteps/build-f90
tests/seteps/build-f90-new
tests/seteps/build-WFW
tests/SetEpsTestCasesFromScratch/*/eels
......@@ -12,9 +12,8 @@ ifeq "$(GFORTAN_VERSION_GE_5)" "1"
FFLAGS += -fdiagnostics-color=auto
endif
all: build-f77/setepsdriver build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdriver-2 build-WFW/setepsdriver
all: build-original/setepsdriver build-f77/setepsdriver build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdriver-2 build-WFW/setepsdriver
# implicit rules for compiling fortran files
build-f77/seteps.o: ../../source/split-f77/seteps.f
$(FC) $(FFLAGS) -Wno-conversion -Wno-compare-reals -c -o $@ $<
......@@ -40,6 +39,9 @@ build-WFW/seteps.o: $(wildcard ../../source/WFW\\ seteps/myEels20-seteps.f
build-WFW/seteps_mod.mod: $(wildcard ../../source/WFW\\ seteps/myEels20-seteps.f90)
$(FC) $(FFLAGS) -c -Jbuild-WFW -o build-WFW/seteps.o '$(MYEELS20_SETEPS)'
build-original/setepsdriver: setepsdriver-original.f90 seteps-original.for
$(FC) $(FFLAGS) -o $@ setepsdriver-original.f90 seteps-original.for
build-f77/setepsdriver: setepsdriver-f77.f90 build-f77/seteps.o
$(FC) $(FFLAGS) -o $@ $^
......@@ -55,9 +57,13 @@ build-f90-new/setepsdriver-2: setepsdriver-f90-new-2.f90 build-f90-new/seteps.o
build-WFW/setepsdriver: setepsdriver-WFW.f90 build-WFW/seteps.o build-WFW/seteps_mod.mod
$(FC) $(FFLAGS) -Jbuild-WFW -o $@ $< build-WFW/seteps.o
test: build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdriver-2 build-f77/setepsdriver build-WFW/setepsdriver
for NUMBER in 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 ; do \
test: build-original/setepsdriver build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdriver-2 build-f77/setepsdriver build-WFW/setepsdriver
for NUMBER in 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025 ; do \
echo " eels input file number: "$$NUMBER ; \
cp ../../tests/inputFiles/eelsin$$NUMBER build-original/eelsin ; \
build-original/setepsdriver ; \
mv build-original/epsout results-original/epsout$$NUMBER ; \
rm build-original/eelsin ; \
cp ../../tests/inputFiles/eelsin$$NUMBER build-f77/eelsin ; \
build-f77/setepsdriver ; \
mv build-f77/epsout results-f77/epsout$$NUMBER ; \
......@@ -68,7 +74,7 @@ test: build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdr
rm build-f90/eelsin ; \
cp ../../tests/inputFiles/eelsin$$NUMBER build-f90-new/eelsin ; \
build-f90-new/setepsdriver-1 ; \
mv build-f90-new/epsout results-f90/epsout$$NUMBER ; \
mv build-f90-new/epsout results-f90-new-1/epsout$$NUMBER ; \
rm build-f90-new/eelsin ; \
cp ../../tests/inputFiles/eelsin$$NUMBER build-WFW/eelsin ; \
build-WFW/setepsdriver ; \
......@@ -79,7 +85,7 @@ test: build-f90/setepsdriver build-f90-new/setepsdriver-1 build-f90-new/setepsdr
echo " eels input file number: "$$NUMBER ; \
cp ../../tests/seteps/setepsIn/setepsIn$$NUMBER.txt build-f90-new/setepsIn.txt ; \
build-f90-new/setepsdriver-2 ; \
mv build-f90-new/epsout results-f90-new/epsout$$NUMBER ; \
mv build-f90-new/epsout results-f90-new-2/epsout$$NUMBER ; \
rm build-f90-new/setepsIn.txt ; \
done
......@@ -94,7 +100,8 @@ cleanbuild:
cleanresults:
rm -rf results-f77/*
rm -rf results-f90/*
rm -rf results-f90-new/*
rm -rf results-f90-new-1/*
rm -rf results-f90-new-2/*
rm -rf results-WFW/*
.PHONY: all test clean
C subroutine seteps from original Lambin code with minimal changes.
C All changes are in lowercase. KMS-2024
SUBROUTINE SETEPS(NEPS,NOS,OSC,EPSINF,WN)
C ******************************************************************
C * *
C * SET UP LONG-WAVELENGTH DIELECTRIC FUNCTIONS OF THE LAYERS FOR *
C * THE PRESENT FREQUENCY WN (IN CM**-1) *
C * *
C ******************************************************************
implicit none
integer lmax, neps, nos, nper, layers, j, k, l
PARAMETER(LMAX=100)
DOUBLE PRECISION ARGMIN,ARGMAX,EPSINF,EPSMAC,OSC,THICK,WN,X
double COMPLEX DENO,EPS
DIMENSION NOS(NEPS),OSC(3,lmax),EPSINF(NEPS)
COMMON/MULAYR/EPS(LMAX),THICK(LMAX),ARGMIN,ARGMAX,EPSMAC,
, LAYERS,NPER
J = 0
DO 2 L=1,NEPS
EPS(L) = EPSINF(L)
DO 1 K=1,NOS(L)
J = J+1
X = WN/OSC(1,J)
C DENO = X*CMPLX(X,OSC(3,J))
DENO = X*dcmplx(X,OSC(3,J))
IF(OSC(2,J).GE.0.0D0) DENO = 1.0-DENO
C IF(ABS(DENO).EQ.0.0) DENO = EPSMAC
if (abs(deno) .lt. epsmac) deno = epsmac
EPS(L) = EPS(L)+OSC(2,J)/DENO
1 CONTINUE
2 CONTINUE
IF(NEPS.EQ.LAYERS+1) THEN
C THE SUBSTRATE IS A ANISOTROPIC UNIAXIAL MATERIAL
EPS(LAYERS) = SQRT(EPS(LAYERS)*EPS(LAYERS+1))
IF(IMAG(EPS(LAYERS)).LT.0.0) EPS(LAYERS) = -EPS(LAYERS)
ENDIF
RETURN
END
program setepsdriver
implicit none
double precision :: wmin, wmax, dw, wn
integer :: jos, layers, neps, nper
character (len = 10) :: name
character (len = 10) mode
integer :: i, j, k, l, noPoints
integer :: lmax, jmax
parameter (lmax = 100, jmax = 300)
double complex :: eps(lmax)
double precision :: argmin, argmax, epsmac, thick(lmax)
double precision :: osc(3,jmax), epsinf(lmax)
integer :: nos(lmax)
common / mulayr / eps, thick, argmin, argmax, epsmac, layers, nper
write(*,*) 'setepsdriver-original start'
epsmac = epsilon(1.0d0)
open(unit = 11, file = 'build-original/eelsin')
read(11, *)
read(11, *)
read(11, *)
read(11, *)
read(11, *) wmin
read(11, *) wmax
read(11, *) dw
read(11, *)
read(11, *)
read(11, *) layers, nper, mode
neps = layers
if (nper == -1) then
neps = layers + 1
nper = 1
endif
jos = 0
do l = 1, neps
if (l <= layers) then
read(11, *) name
endif
read(11, *) epsinf(l), nos(l)
if (nos(l) > 0) then
do j = 1, nos(l)
jos = jos + 1
read(11, *) (osc(k, jos), k = 1, 3)
enddo
endif
enddo
close (unit = 11)
noPoints = 1 + int((wmax - wmin) / dw)
wn = wmin
open(unit = 12, file = 'build-original/epsout')
do i = 0, noPoints
call seteps(neps, nos, osc, epsinf, wn)
write (12, '(30g15.7)') wn, (eps(j), j = 1, neps)
wn = wn + dw
end do
close (unit = 12)
end program setepsdriver
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment