From 9393e72e6f271d27db798d5a2fbe1ec92adc3707 Mon Sep 17 00:00:00 2001 From: Aaron Schankler Date: Fri, 26 Mar 2021 15:07:52 -0400 Subject: [PATCH] Opium v3.8 --- configure | 16 ++++++++-------- configure.ac | 16 ++++++++-------- doc/CHANGELOG | 26 ++++++++++++++++++++++++++ makevars_static | 12 ++++++++++++ src/log | 15 --------------- src/main/opium.c | 2 +- src/output/do_qeupf.c | 16 ++++++++++++++-- src/output/do_recpot.c | 2 +- src/output/do_siesta.c | 4 +++- src/output/nwrite.c | 26 ++++++++++++++++++++++++-- src/output/writepwf.F | 23 +++++++++++++---------- src/output/writerecpot.F | 21 ++++++++++++--------- 12 files changed, 122 insertions(+), 57 deletions(-) create mode 100644 makevars_static delete mode 100644 src/log diff --git a/configure b/configure index 7c24713..2a80bc7 100755 --- a/configure +++ b/configure @@ -3293,7 +3293,7 @@ case $ac_cv_host in if test x"$CFLAGS" = "x-g"; then CFLAGS="-O3" fi - NOOPT="-O0 -r8" + NOOPT="-O0" fi ;; @@ -3312,12 +3312,12 @@ case $ac_cv_host in else LDFLAGS="$LDFLAGS -lUfor -lFutil -lfor" fi - NOOPT="-O0 -r8" + NOOPT="-O0" fi ;; *86-pc-linux-*) - NOOPT="-O0 -r8" + NOOPT="-O0" if test $FCT = pgf77 || test $FCT = pgf90; then # Extract the first word of "pgf77", so it can be a program name with args. set dummy pgf77; ac_word=$2 @@ -3367,7 +3367,7 @@ fi if test $FCT = ifc || test $FCT = ifort; then LD=$F77 LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8" + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -3410,7 +3410,7 @@ fi if test $FCT = ifc || test $FCT = ifort; then LD=$FCT LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 " + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -3444,7 +3444,7 @@ fi *x86_64*linux-*) - NOOPT="-O0 -r8" + NOOPT="-O0" if test $FCT = pgf77 || test $FCT = pgf90; then # Extract the first word of "pgf77", so it can be a program name with args. set dummy pgf77; ac_word=$2 @@ -3494,7 +3494,7 @@ fi if test $FCT = ifc || test $FCT = ifort; then LD=$FCT LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 " + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -3579,7 +3579,7 @@ fi if test $FCT = fort77; then - NOOPT="-O0 -r8" + NOOPT="-O0" FFLAGS="-r8 $FFLAGS" if test "${f2c_libraries+set}" = set; then LDFLAGS="-L$f2c_libraries $LDFLAGS" diff --git a/configure.ac b/configure.ac index 02dae19..4961579 100644 --- a/configure.ac +++ b/configure.ac @@ -154,7 +154,7 @@ dnl SGI's native C and fortran compilers if test x"$CFLAGS" = "x-g"; then CFLAGS="-O3" fi - NOOPT="-O0 -r8" + NOOPT="-O0" fi ;; @@ -174,13 +174,13 @@ dnl alpha linux with Compaq (HP)'s ccc and fort compilers else LDFLAGS="$LDFLAGS -lUfor -lFutil -lfor" fi - NOOPT="-O0 -r8" + NOOPT="-O0" fi ;; dnl 32 bit PC running linux *86-pc-linux-*) - NOOPT="-O0 -r8" + NOOPT="-O0" if test $FCT = pgf77 || test $FCT = pgf90; then dnl do this to get the library path correct AC_PATH_PROG([XPGF77],[pgf77],[huh],[$PATH]) @@ -192,7 +192,7 @@ dnl 32 bit PC running linux if test $FCT = ifc || test $FCT = ifort; then LD=$F77 LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8" + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -235,7 +235,7 @@ dnl 32 bit PC running linux if test $FCT = ifc || test $FCT = ifort; then LD=$FCT LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 " + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -270,7 +270,7 @@ dnl 32 bit PC running linux dnl 64bit PC running linux *x86_64*linux-*) - NOOPT="-O0 -r8" + NOOPT="-O0" if test $FCT = pgf77 || test $FCT = pgf90; then dnl do this to get the library path correct AC_PATH_PROG([XPGF77],[pgf77],[huh],[$PATH]) @@ -282,7 +282,7 @@ dnl 64bit PC running linux if test $FCT = ifc || test $FCT = ifort; then LD=$FCT LDFLAGS="$LDFLAGS -Vaxlib" - test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 " + test x"$FFLAGS" = x-g && FFLAGS="-O3 -save -r8 -fp-model strict" LDFLAGS="$LDFLAGS -L$i -static-libcxa" if test $FCT = ifort; then @@ -329,7 +329,7 @@ AC_PATH_PROG([XFORT77],[fort77],[huh],[$PATH]) dnl looks like we are stuck with fort77 and f2c if test $FCT = fort77; then - NOOPT="-O0 -r8" + NOOPT="-O0" FFLAGS="-r8 $FFLAGS" if test "${f2c_libraries+set}" = set; then LDFLAGS="-L$f2c_libraries $LDFLAGS" diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 4ad849b..311bdf7 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -401,17 +401,43 @@ Patch to enable partial core corrections for the .recpot (castep) format 6) worked more on gfortran compatibility +3.5 -> 3.6 +1) Added fully-relativisitc psps -- needed significant modifications which resulted in many routines needed changing +2) Restored most if not all of the support for separate command line action (>>opium al log ae ; >>opium al log ps ; etc..) which had been lost in previous releases. +3) Implemented QuantumESPRESSO's upf version 1 psp output. Version 2 is in progress. +4) Added DNL modifications from Ben Truscott +5) Added Flexib corrections submitted by Keith Refson +3.6 -> 3.7 +1) Added "teter" output which is format usable for frl/spin-orbit in ABINIT +2) Added "upf" (version 1) output which can be used for Quantum-Espresso (including frl/spin-orbit calculations) +3) Added "qso" output which is suitable for "QBOX" calculations +4) Added "QSOMesh" keyblock to define a linear mesh upon which the psp can be defined + +5) Cleaned up a number of warning and error message output + +6) Changed the printing in pwf and recpot output so gfortran will now work. + +7) NOTE to MAC users: This will be the first Mac release that was prepared on "Lion". The Mac executable should be fine on older Intel systems, however, PPC Mac can no longer use the static Mac binary. + + +3.7 -> 3.8 + +1) Restored the PCC version number for the recpot output. + +2) Added PCC for the QE upf output. + +3) Cleaned up a lot of the printing errors for the gfortran version. diff --git a/makevars_static b/makevars_static new file mode 100644 index 0000000..b44df4e --- /dev/null +++ b/makevars_static @@ -0,0 +1,12 @@ +CC=/share/apps/intel/Compiler/11.1/073/bin/ia32/icc +CFLAGS=-I../include -I../FlexiLib -I../uniPPlib -g -O2 -DCSYS=\"'Linux 2.6.9-42.ELsmp x86_64'\" -DCHOST=\"pzt.wm.edu\" -DCDATE=\"'Mon Apr 27 12:45:31 EDT 2009'\" +CPP=/share/apps/intel/Compiler/11.1/073/bin/ia32/icc -E +FC=/share/apps/intel/Compiler/11.1/073/bin/ia32/ifort +FFLAGS=-O2 -save -r8 -mp1 +FPP=/usr/bin/cpp +FPPFLAGS= +LD=/share/apps/intel/Compiler/11.1/073/bin/ia32/ifort +LDFLAGS= -lm -Vaxlib -nofor_main -L/share/apps/intel/Compiler/11.1/073/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib -static +RANLIB=ranlib +AR=/usr/bin/ar +NOOPT=-O0 -r8 diff --git a/src/log b/src/log deleted file mode 100644 index f88ee1d..0000000 --- a/src/log +++ /dev/null @@ -1,15 +0,0 @@ - - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - OPIUM Version: 3.7 - ===================================== - See http://opium.sourceforge.net for help and information - Copyright 2009 : The OPIUM project - - Compile host : BaconTini-2.local - Compile OS : Darwin 11.2.0 i386 - Compile date : Sun Nov 6 11:44:24 EST 2011 - - Execution host : BaconTini-2.local - time of execution: Sun Nov 6 14:27:44 2011 - - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/main/opium.c b/src/main/opium.c index 885b242..009eec0 100644 --- a/src/main/opium.c +++ b/src/main/opium.c @@ -24,7 +24,7 @@ * * ****************************************************************************/ -#define VERSION "3.7" +#define VERSION "3.8" #ifndef CHOST #define CHOST "unknown" #endif diff --git a/src/output/do_qeupf.c b/src/output/do_qeupf.c index 40924b1..d758611 100644 --- a/src/output/do_qeupf.c +++ b/src/output/do_qeupf.c @@ -110,6 +110,7 @@ int do_qeupf(param_t *param, FILE *fp_param, char *logfile){ for (i=0; inorb - param->nval; i++) zeff -= param->wnl[i]; + /* read in the local potential */ sprintf(filename, "%s.loc", param->name); fp = fopen(filename, "rb"); @@ -142,14 +143,14 @@ int do_qeupf(param_t *param, FILE *fp_param, char *logfile){ fread(rnl[i], sizeof(double), param->ngrid, fp); fclose(fp); } - + /* read in pcc */ if (param->rpcc > 0.){ sprintf(filename, "%s.rho_pcore", param->name); fp = fopen(filename, "rb"); fread(rscore, sizeof(double), param->ngrid, fp); fclose(fp); } - + /* First put in the param file: */ @@ -221,6 +222,17 @@ int do_qeupf(param_t *param, FILE *fp_param, char *logfile){ fprintf(fp," \n"); fprintf(fp,"\n"); + if (param->rpcc > 1e-6){ + + fprintf(fp,"\n\n\n"); + for (i=0;ingrid;i++){ + fprintf(fp,"%19.16le ",rscore[i]/rr[i]/rr[i]/4.0/M_PI); + if( (i+1)%4 == 0 ) fprintf(fp,"\n"); + } + if(i%4 !=0 ) fprintf(fp,"\n"); + fprintf(fp,"\n"); + } + fprintf(fp,"\n\n\n"); for (i=0;ingrid;i++){ fprintf(fp,"%19.16le ",nlcore[i]/rr[i]); diff --git a/src/output/do_recpot.c b/src/output/do_recpot.c index 2ea19e9..ddf23cb 100644 --- a/src/output/do_recpot.c +++ b/src/output/do_recpot.c @@ -171,5 +171,5 @@ void writeparam_(FILE *fpp, FILE *fpp_param, double *ecutev, int *version) { fprintf(fpp, "END COMMENT \n"); - + fprintf(fpp, " 3 %d \n",*version); } diff --git a/src/output/do_siesta.c b/src/output/do_siesta.c index f214338..4ef3799 100644 --- a/src/output/do_siesta.c +++ b/src/output/do_siesta.c @@ -33,6 +33,8 @@ #define M_PI 3.14159265358979323846 #endif +#define MAX(a, b) (((a) > (b)) ? (a):(b)) + #include "parameter.h" /* defines structure: 'param_t' */ #include "cdim.h" /* fortran code parameters */ #include "do_siesta.h" /* the module's own header */ @@ -211,7 +213,7 @@ int do_siesta(param_t *param, FILE *fp_param, char *logfile){ for (i=0; inval;i++){ if (param->npot[i]==0) { ii=i+ncore; - fprintf(fp_out,"%d%c%5.2f r=%5.2f/",nlm_label(param->nlm[ii]).n,xao[nlm_label(param->nlm[ii]).l],param->wnl[ii],param->rc[i]); + fprintf(fp_out,"%d%c%5.2f r=%5.2f/",nlm_label(param->nlm[ii]).n,xao[nlm_label(param->nlm[ii]).l],MAX(param->wnl[ii],0),param->rc[i]); } } fprintf(fp_out,"\n"); diff --git a/src/output/nwrite.c b/src/output/nwrite.c index 4b823bb..bb4b194 100644 --- a/src/output/nwrite.c +++ b/src/output/nwrite.c @@ -33,7 +33,7 @@ static int counter; void nwrite_(FILE *fp, char *linetag, int *n, char *format, double *x){ - if (counter==0) fprintf(fp, "%s", linetag); + if (counter==0) fprintf(fp, "%s", "E"); fprintf(fp, format, *x); @@ -44,10 +44,32 @@ void nwrite_(FILE *fp, char *linetag, int *n, char *format, double *x){ counter=0; } } +void nwrite2_(FILE *fp, int *n, char *format, double *x){ + + fprintf(fp, format, *x); + + if (counter<*n-1) + ++counter; + else{ + fprintf(fp, "\n"); + counter=0; + } +} void iwrite_(FILE *fp, char *linetag, int *n, char *format, int *x){ - if (counter==0) fprintf(fp, "%s", linetag); + if (counter==0) fprintf(fp, "%s", ""); + + fprintf(fp, format, *x); + + if (counter<*n-1) + ++counter; + else{ + fprintf(fp, "\n"); + counter=0; + } +} +void iwrite2_(FILE *fp, int *n, char *format, int *x){ fprintf(fp, format, *x); diff --git a/src/output/writepwf.F b/src/output/writepwf.F index 2fdb88b..4fc671b 100644 --- a/src/output/writepwf.F +++ b/src/output/writepwf.F @@ -49,7 +49,7 @@ subroutine writepwf(ifp, symbol) dimension psp(npspt0),dpsp(npspt0) dimension rrvloc(npdm) - character*2 xrpcc + character*1 xrpcc character*5 xproj character*8 xform @@ -57,6 +57,7 @@ subroutine writepwf(ifp, symbol) common /filenames/ file_log character*80 file_log + character*80 namepwf data bohrad,ryd / 0.529177,13.6057 / @@ -256,15 +257,17 @@ subroutine writepwf(ifp, symbol) c -- use the C I/O call to output the local potential coefficients c - call nclear(ifp) +c call nclear(ifp) do i=1,npspts - call nwrite(ifp, "", 4, "%18.8f", psp(i)) + call nwrite2(ifp, 4, "%18.8f", psp(i)) enddo call nclear(ifp) do i=1,npspts - call nwrite(ifp, "", 4, "%18.8f", dpsp(i)) + call nwrite2(ifp, 4, "%18.8f", dpsp(i)) enddo call nclear(ifp) + + c for kleinman-bylander non-local psp c change units @@ -293,12 +296,12 @@ subroutine writepwf(ifp, symbol) ill(i)=0 enddo - xform="%20.10f" +c xform="%20.10f" call nclear(ifp) do k=1,nll if (k.ne.ilocal+1) then do i=1,nflq - call nwrite(ifp, "", 3, "%20.10f ", flq(i,k)) + call nwrite2(ifp, 3, "%20.10f", flq(i,k)) enddo endif enddo @@ -307,7 +310,7 @@ subroutine writepwf(ifp, symbol) do k=1,nll if (k.ne.ilocal+1) then do i=1,nflq - call nwrite(ifp, "", 3, "%20.10f ", dflq(i,k)) + call nwrite2(ifp, 3, "%20.10f", dflq(i,k)) enddo endif enddo @@ -315,7 +318,7 @@ subroutine writepwf(ifp, symbol) do k=1,nll if (k.ne.ilocal+1) then - call nwrite(ifp, "", 3, "%20.10f ", eta(k)) + call nwrite2(ifp, 3, "%20.10f", eta(k)) endif enddo call nclear(ifp) @@ -333,8 +336,8 @@ subroutine writepwf(ifp, symbol) if (rpcc.gt.1e-12) then do i=1,np - call nwrite(ifp, "", 2, "%26.16e",r(i)) - call nwrite(ifp, "", 2, "%26.16e",rscore(i)) + call nwrite2(ifp, 2, "%26.16e",r(i)) + call nwrite2(ifp, 2, "%26.16e",rscore(i)) enddo endif diff --git a/src/output/writerecpot.F b/src/output/writerecpot.F index 350dcd7..141b52d 100644 --- a/src/output/writerecpot.F +++ b/src/output/writerecpot.F @@ -1,5 +1,5 @@ c -c Copyright (c) 1998-2012 The OPIUM Group +c Copyright (c) 1998-2008 The OPIUM Group c c This program is free software; you can redistribute it and/or modify c it under the terms of the GNU General Public License as published by @@ -209,6 +209,7 @@ subroutine writerecpot(ifp, ifp_param, psmeth) npspts=mq+1 gcut = float(npspts-1)*dql + c close(unit=7) if (rpcc.gt.1e-12) then @@ -218,19 +219,20 @@ subroutine writerecpot(ifp, ifp_param, psmeth) end if c open(unit=7,file=file_log,form='formatted',access='append') - - call nwrite(ifp, "", 1, "%18.8f", gcut/bohrad) + call nwrite2(ifp, 1, "%18.8f", gcut/bohrad) psp(1)=sumg0*ryd*(bohrad**3) do n=2,npspts psp(n)=(vl(n-1)-2.0d0*pi4*zeff/(dql*(n-1))**2)*ryd*(bohrad**3) enddo +c call nclear(ifp) c -- use the C I/O call to output the local potential coefficients do i=1,npspts - call nwrite(ifp, "", 3, "%20.10f ", psp(i)) + call nwrite2(ifp, 3, "%20.10f", psp(i)) enddo call nclear(ifp) + c for kleinman-bylander non-local psp c change units do m=1,nll @@ -248,15 +250,15 @@ subroutine writerecpot(ifp, ifp_param, psmeth) do k=1,nll if (k.ne.ilocal+1) then - call iwrite(ifp, "", 1, "%d",k-1) - call nwrite(ifp, "", 1, "%20.10f ",eta(k)) + call iwrite2(ifp, 1, "%d",k-1) + call nwrite2(ifp, 1, "%20.10f",eta(k)) do i=1,nflq - call nwrite(ifp, "", 3, "%20.10f ", flq(i,k)) + call nwrite2(ifp, 3, "%20.10f", flq(i,k)) enddo endif enddo - call iwrite(ifp, "", 1, "%d", 1000) + call iwrite2(ifp, 1, "%d", 1000) c c NLCC @@ -283,11 +285,12 @@ subroutine writerecpot(ifp, ifp_param, psmeth) enddo do i=1,npspts - call nwrite(ifp, "", 3, "%20.10f ", qcore(i)) + call nwrite2(ifp, 3, "%20.10f", qcore(i)) enddo end if call nclear(ifp) + 100 format(//,' npoint=',i5,2x,'atomic number=',i3,2x, $ 'valence charge=',i3,/)