From 8465f00ef7dd8e8a616fe5302285f1e9681247e7 Mon Sep 17 00:00:00 2001 From: mfgu Date: Tue, 7 Jul 2015 12:26:28 +0000 Subject: [PATCH 1/2] incorporate a few bug fixes from Evgeny git-svn-id: file:///home/fnevgeny/svn/fac/trunk/fac@706 ad7935cb-1c1c-0410-8b58-bafadb17b910 --- config.status | 2 +- faclib/dbase.c | 4 ++-- faclib/dbase.h | 2 ++ faclib/orbital.c | 4 ++-- faclib/structure.c | 42 ++++++++++++++++++++++++++++-------------- python/Makefile | 2 +- 6 files changed, 36 insertions(+), 20 deletions(-) diff --git a/config.status b/config.status index bace439e..be522067 100755 --- a/config.status +++ b/config.status @@ -561,7 +561,7 @@ s,@LIBOBJS@,|#_!!_#|,g s,@F77@,|#_!!_#|gfortran,g s,@FFLAGS@,|#_!!_#|-fPIC -ff2c -fno-strength-reduce -fno-common -O2,g s,@ac_ct_F77@,|#_!!_#|gfortran,g -s,@FLIBS@,|#_!!_#|-L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.3 -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lgfortranbegin -lgfortran,g +s,@FLIBS@,|#_!!_#|-L/sw/lib/gcc4.3/lib/gcc/i686-apple-darwin8/4.3.1 -L/sw/lib/gcc4.3/lib/gcc/i686-apple-darwin8/4.3.1/../../.. -lgfortranbegin -lgfortran,g s,@FFLAGSNO@,|#_!!_#|-fPIC -ff2c -fno-strength-reduce -fno-common,g s,@LTLIBOBJS@,|#_!!_#|,g :end diff --git a/faclib/dbase.c b/faclib/dbase.c index a509e9fe..e58c2f39 100644 --- a/faclib/dbase.c +++ b/faclib/dbase.c @@ -3335,7 +3335,7 @@ int MemENFTable(char *fn) { n = ReadFHeader(f, &fh, &swp); if (n == 0) return 0; - sr = sizeof(ENF_RECORD); + sr = SIZE_ENF_RECORD; if (mem_enf_table) free(mem_enf_table); @@ -4661,7 +4661,7 @@ int AppendTable(char *fn) { if (f == NULL) return -1; n = ReadFHeader(f, &fh, &swp); if (swp) { - printf("File %s is in different byte-order\n", fn); + printf("File %s is in different byte-order\n"); fclose(f); return -1; } diff --git a/faclib/dbase.h b/faclib/dbase.h index 66127e14..5d2c0cf7 100644 --- a/faclib/dbase.h +++ b/faclib/dbase.h @@ -87,6 +87,8 @@ typedef struct _ENF_RECORD_ { double energy; int pbasis; } ENF_RECORD; +#define SIZE_ENF_RECORD \ + (sizeof(int)*2 + sizeof(double)) typedef struct _TR_HEADER_ { long int position; diff --git a/faclib/orbital.c b/faclib/orbital.c index 54801ca5..cbca0a27 100755 --- a/faclib/orbital.c +++ b/faclib/orbital.c @@ -1237,11 +1237,11 @@ int RadialRydberg(ORBITAL *orb, POTENTIAL *pot) { delta = qo-qi; dq[j] = delta; } - for (j = 0; j < ME; j++) { + for (j = 0; j < ME-1; j++) { if (dq[j] > 0 && dq[j+1] < dq[j]) break; } i = j; - for (; j < ME; j++) { + for (; j < ME-1; j++) { if (dq[j+1] >= dq[j]) break; } nme = j - i + 1; diff --git a/faclib/structure.c b/faclib/structure.c index 26357ad6..b898a85c 100755 --- a/faclib/structure.c +++ b/faclib/structure.c @@ -853,23 +853,37 @@ double HamiltonElementEB(int ib, int jb) { nz = ang_frozen.nz[kz]; for (i = 0; i < nz; i++) { if (B1[0] || B1[1] || B1[2]) { - if (ang[i].k == 2 && ang[i].k0 == ang[i].k1) { + if (ang[i].k == 2) { orb0 = GetOrbital(ang[i].k0); GetJLFromKappa(orb0->kappa, &jorb0, &korb0); - for (m = 0; m < 3; m++) { - if (B1[m] == 0) continue; - q = m-1; - q2 = 2*q; - a = W3j(ji, 2, jj, -mi, -q2, mj); - if (a == 0.0) continue; - a *= B1[m]*ang[i].coeff; - if (IsOdd(abs(ji-mi+q2)/2)) a = -a; - b = sqrt(0.25*jorb0*(jorb0+2.0)*(jorb0+1.0)); - c = 1.0023192*(jorb0+1.0)*W6j(korb0, 1, jorb0, 2, jorb0, 1)*sqrt(1.5); - if (IsEven((korb0+jorb0+1)/2)) c = -c; - r += a*(b + c); + if (ang[i].k1 == ang[i].k0) { + orb1 = orb0; + jorb1 = jorb0; + korb1 = korb0; + } else { + orb1 = GetOrbital(ang[i].k1); + GetJLFromKappa(orb1->kappa, &jorb1, &korb1); } - } + if (orb0->n == orb1->n && korb0 == korb1){ + for (m = 0; m < 3; m++) { + if (B1[m] == 0) continue; + q = m-1; + q2 = 2*q; + a = W3j(ji, 2, jj, -mi, -q2, mj); + if (a == 0.0) continue; + a *= B1[m]*ang[i].coeff; + if (IsOdd(abs(ji-mi+q2)/2)) a = -a; + if (jorb0 == jorb1) { + b = sqrt(0.25*jorb0*(jorb0+2.0)*(jorb0+1.0)); + } else { + b = 0.0; + } + c = 1.0023192*sqrt((jorb0+1.0)*(jorb1+1.0))*W6j(korb0, 1, jorb0, 2, jorb1, 1)*sqrt(1.5); + if (IsEven((korb0+jorb0+1)/2)) c = -c; + r += a*(b + c); + } + } + } } if (E1[0] || E1[1] || E1[2]) { if (ang[i].k == 2) { diff --git a/python/Makefile b/python/Makefile index 958e8d5a..ad98f879 100644 --- a/python/Makefile +++ b/python/Makefile @@ -13,7 +13,7 @@ CC = gcc CFLAGS = -O2 -fPIC -fno-strength-reduce -fno-common CPPFLAGS = -I/disks/d4a/home/mfgu/src/fac -I/disks/d4a/home/mfgu/src/fac/faclib -I${PYINC} LDFLAGS = -L/disks/d4a/home/mfgu/src/fac -LIBS = -lfac -lm -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.3 -L/sw/lib/gcc4.2/lib/gcc/i686-apple-darwin8/4.2.3/../../.. -lgfortranbegin -lgfortran ${PYLIB} +LIBS = -lfac -lm -L/sw/lib/gcc4.3/lib/gcc/i686-apple-darwin8/4.3.1 -L/sw/lib/gcc4.3/lib/gcc/i686-apple-darwin8/4.3.1/../../.. -lgfortranbegin -lgfortran ${PYLIB} all: mpy From c22338301b388fca2159d643880fabfe1549ed24 Mon Sep 17 00:00:00 2001 From: mfgu Date: Tue, 7 Jul 2015 12:59:46 +0000 Subject: [PATCH 2/2] update README/ChangeLog for version 1.1.2 git-svn-id: file:///home/fnevgeny/svn/fac/trunk/fac@707 ad7935cb-1c1c-0410-8b58-bafadb17b910 --- ChangeLog | 8 ++++++++ README | 27 ++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56e93c88..96bc3448 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Version 1.1.2, 07/07/2015 + 1. incorporate a few bug fixes from Evgeny, most notably + concerning the Zeemann splitting. + 2. separate the source files into fac_util and fac_core, the + former contains third party uitlities that cannot be + distributed under GPL, while the latter contains the fac core + that are distrubted under GPL from this version on. + Version 1.1.1, 04/30/2006 1. change the argument of coulcc to have a small imaginary part for DCOUL function. so that the results are ok for bound state energies. diff --git a/README b/README index c39575e4..3a9e2275 100755 --- a/README +++ b/README @@ -3,14 +3,11 @@ FAC is a software packge for the calculation of various atomic processes. Contents of the package: -README, this file. -ChangeLog, changes. + +1. Third party content that cannot be distributed under GPL. + These files are bundled in fac_util.tar.gz blas/, BLAS routines in fortran. coul/, fortran routines related to coulomb functions. -demo/, some demo scripts. -doc/, reference guide for FAC -doc/papers/, papers describe the theoretical backgrounds. -faclib/, core numerical library. ionis/, ionization balance calculation of Arnaud&Raymond, and that of Mazzotta et al. Rates fitted by Verner et al. lapack/, fortran routines from LAPACK. @@ -21,9 +18,22 @@ mpfun/, it used to be the multi-precision floating point arithmetic implementation of quad-precision arithmetics. The associated Legendre functions are also put into this directory. ode/, Livermore Solver for odinary differential equations. +toms/, some numerical routines from TOMS. + +2. Everything below are distributed under GPL. + These files are bundled in fac_core.tar.gz +README, this file. +ChangeLog, changes. +configure.ac,AutoConf input file +configure, configure script after parsing configure.ac +setup.py, python setup script for building the pfac interface +demo/, some demo scripts. +doc/, reference guide for FAC +doc/papers/, papers describe the theoretical backgrounds. +faclib/, core numerical library. python/, python interface. sfac/, non-python interface. -toms/, some numerical routines from TOMS. + INSTALL: There are two interfaces available to the FAC numerical lib. One makes use @@ -47,6 +57,9 @@ Unpack it in a directory and add bin to your PATH. INSTALL FROM SOURCE: STEPS: +0) download the two source packages, fac_util.tar.gz and fac_core.tar.gz, + and gunzip, extract under the same directory. + 1) ./configure Note 1: Specify the option --with-cfortran=xxFortran, if you F77 compiler is not g77 or sun's f77. see faclib/cfortran.doc for supported F77