Commit 53fb021d by Francois Gygi

*** empty log message ***


git-svn-id: http://qboxcode.org/svn/qb/trunk@743 cba15fb0-1239-40c8-b417-11db7ca47a34
parent d77e8940
#-------------------------------------------------------------------------------
#
# Copyright (c) 2008 The Regents of the University of California
#
# This file is part of Qbox
#
# Qbox is distributed under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of
# the License, or (at your option) any later version.
# See the file COPYING in the root directory of this distribution
# or <http://www.gnu.org/licenses/>.
#
#-------------------------------------------------------------------------------
#
# x8664_gcc.mk
#
#-------------------------------------------------------------------------------
# $Id: pavane.mk,v 1.10 2009-09-08 05:38:06 fgygi Exp $
#
PLT=Linux_x8664
#-------------------------------------------------------------------------------
GCCDIR=/usr/lib/gcc/x86_64-redhat-linux/3.4.3
#MPIDIR=$(HOME)/software/mpich/mpich-1.2.6
MPIDIR=/opt/mpich-1.2.7p1
XERCESCDIR=$(HOME)/software/xerces/Linux_x8664/xerces-c-src_2_7_0
PLTOBJECTS = readTSC.o
#CXX=/usr/bin/g++
CXX=mpicxx
LD=$(CXX)
PLTFLAGS += -DIA32 -DUSE_FFTW -D_LARGEFILE_SOURCE \
-D_FILE_OFFSET_BITS=64 -DUSE_MPI -DSCALAPACK -DADD_ \
-DAPP_NO_THREADS -DXML_USE_NO_THREADS -DUSE_XERCES
FFTWDIR=$(HOME)/software/fftw/Linux_x8664/fftw-2.1.5/fftw
BLASDIR=$(HOME)/software/atlas/x86_64/lib
LAPACKDIR=$(HOME)/software/lapack/LAPACK
#BLASDIR=/usr/lib64
#LAPACKDIR=/usr/lib64
INCLUDE = -I$(MPIDIR)/include -I$(FFTWDIR) -I$(XERCESCDIR)/include
CXXFLAGS= -O4 -Wunused -D$(PLT) $(INCLUDE) $(PLTFLAGS) $(DFLAGS)
LIBPATH = -L$(FFTWDIR)/.libs -L/usr/X11R6/lib \
-L$(MPIDIR)/lib -L$(BLASDIR) \
-L$(XERCESCDIR)/lib -L$(HOME)/lib
#LIBS = $(PLIBS) -lpthread -lfftw \
# -lmpich -lxerces-c \
# $(LAPACKDIR)/liblapack.a \
# -lf77blas -latlas -lgfortran
LIBS = $(PLIBS) -lpthread -lfftw \
-lm -Xlinker -Bstatic \
-lc -static-libgcc -lmpich -lxerces-c \
$(LAPACKDIR)/liblapack.a \
-lf77blas -latlas -lgfortran \
-Xlinker -Bdynamic
#LIBS = $(PLIBS) -lfftw -llapack -lblas -lm -lmpich \
# $(XERCESCDIR)/lib/libxerces-c.a
LDFLAGS = $(LIBPATH) $(LIBS)
PLAT=Linux_x8664
# Blacs libraries
BLACSDBGLVL = 0
BLACSdir = $(HOME)/software/blacs/Linux_x8664/BLACS/LIB
BLACSFINIT = $(BLACSdir)/blacsF77init_MPI-$(PLAT)-$(BLACSDBGLVL).a
BLACSCINIT = $(BLACSdir)/blacsCinit_MPI-$(PLAT)-$(BLACSDBGLVL).a
BLACSLIB = $(BLACSdir)/blacs_MPI-$(PLAT)-$(BLACSDBGLVL).a
CBLACSLIB = $(BLACSCINIT) $(BLACSLIB) $(BLACSCINIT)
FBLACSLIB = $(BLACSFINIT) $(BLACSLIB) $(BLACSFINIT)
# Scalapack libraries
#SCALAPACK_DIR = $(HOME)/software/scalapack/Linux_x8664/SCALAPACK
SCALAPACK_DIR = $(HOME)/software/scalapack/Linux_x8664/scalapack-1.8.0
#PBLASLIB = $(SCALAPACK_DIR)/pblas_$(PLAT).a
SCALAPACKLIB = $(SCALAPACK_DIR)/libscalapack.a
#TOOLSLIB = $(SCALAPACK_DIR)/tools_$(PLAT).a
#REDISTLIB = $(SCALAPACK_DIR)/redist_$(PLAT).a
LAPACKLIB = -llapack
BLASLIB = -lf77blasf -latlas
# Parallel libraries
#PLIBS = $(SCALAPACKLIB) $(PBLASLIB) $(TOOLSLIB) $(REDISTLIB) $(CBLACSLIB)
PLIBS = $(SCALAPACKLIB) $(CBLACSLIB)
#-------------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
//
// xmlSpecies.C: transform a GP pseudopotential file into a fpmd xml species
//
// use: xmlSpecies < psfile > xmlfile
//
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdio>
#include "qbox_xmlns.h"
using namespace std;
int main(int argc, char **argv)
{
int np, zion,lloc,nquad,lmax1,lmax;
double rcut,pmass,radius,covradius;
char buf[256];
char psname_buf[256];
char color_buf[256];
int ntokens;
// skip # comment lines
while ( ( (char) cin.peek() ) == '#' )
{
while ( cin.get() != '\n' );
}
cin.getline(&buf[0],256);
ntokens =
sscanf(&buf[0]," %d %d %lf %lf %d %s %s %lf %lf %d %d",
&np, &zion, &rcut, &pmass, &lmax1, &psname_buf[0],
&color_buf[0], &radius, &covradius, &lloc, &nquad );
lmax = lmax1 - 1;
if ( ntokens == 9 )
{
// lloc and nquad were not read: use default values
// default value of lloc is lmax
lloc = lmax;
// default value of nquad is 0 (Kleinman-Bylander)
nquad = 0;
}
cout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
cout << "<fpmd:species xmlns:fpmd=\""
<< qbox_xmlns()
<< "\"" << endl;
cout << " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " << endl;
cout << " xsi:schemaLocation=\"";
cout << qbox_xmlns();
cout << " species.xsd\">" << endl;
cout << "<description>" << psname_buf << "</description>" << endl;
cout << "<symbol>X</symbol>" << endl;
cout << "<atomic_number> A </atomic_number>" << endl;
cout << "<mass>" << pmass << "</mass>" << endl;
cout << "<norm_conserving_pseudopotential>" << endl;
cout << "<valence_charge>" << zion << "</valence_charge>" << endl;
cout << "<lmax>" << lmax << "</lmax>" << endl;
cout << "<llocal>" << lloc << "</llocal>" << endl;
cout << "<nquad>" << nquad << "</nquad>" << endl;
cout << "<rquad> RQUAD </rquad>" << endl;
cout << "<mesh_spacing> DR </mesh_spacing>" << endl;
cout.setf(ios::scientific,ios::floatfield);
for ( int l = 0; l < lmax1; l++ )
{
cout << "<projector l=\"" << l << "\" size=\"" << np << "\">" << endl;
cout << "<radial_potential>" << endl;
int npdum;
double rdum;
if ( l > 0 )
{
// skip # comment lines
while ( ( (char) cin.peek() ) == '#' )
{
while ( cin.get() != '\n' );
}
cin >> npdum;
while ( cin.get() != '\n' );
}
double r,v,phi;
for ( int i = 0; i < np; i++ )
{
cin >> r >> v;
cout << setw(13) << setprecision(6) << v << endl;
while ( cin.get() != '\n' );
}
cout << "</radial_potential>" << endl;
// read phi except if l == lmax && lloc == lmax_
if ( !( l == lmax && lloc == lmax ) )
{
cout << "<radial_function>" << endl;
// skip # comment lines
while ( ( (char) cin.peek() ) == '#' )
{
while ( cin.get() != '\n' );
}
cin >> npdum;
while ( cin.get() != '\n' );
for ( int i = 0; i < np; i++ )
{
cin >> r >> phi; while ( cin.get() != '\n' );
cout << setw(13) << setprecision(6) << phi << endl;
}
cout << "</radial_function>" << endl;
}
cout << "</projector>" << endl;
}
cout << "</norm_conserving_pseudopotential>" << endl;
cout << "</fpmd:species>" << endl;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment