Fixed namespace declarations, etc. ccViz works

This commit is contained in:
Alberto Garcia 2016-10-14 14:29:34 +02:00
parent a73198121e
commit f5ffa8810c
4 changed files with 48 additions and 84 deletions

View File

@ -242,63 +242,21 @@ OBJS += m_cite.o
m_pexsi.o m_pexsi_driver.o m_pexsi_dos.o m_pexsi_local_dos.o: f_ppexsi_interface.o
#--------------------------------------------------------------
# FoX whatnot
# FoX build targets:
FoX_configured=FoX/.config
FoX_built=FoX/.FoX
# This is how we pick up modules and libraries for FoX:
FoX_FCFLAGS=`FoX/FoX-config --fcflags`
FoX_LIBS=`FoX/FoX-config --libs --wcml`
# And add them to global compiler flags:
INCFLAGS:=$(INCFLAGS) $(FoX_FCFLAGS)
# First, it needs to be configured. This may have been done
# by the main SIESTA configure, but in case not:
FC_DEFAULT:=$(FC)
FC_SERIAL?=$(FC_DEFAULT)
$(FoX_configured):
(cd FoX; touch arch.make ; \
CONFIGURE="$(VPATH)/FoX/configure"; \
AR="$(AR)" RANLIB="$(RANLIB)" \
$$CONFIGURE VPATH="$(VPATH)/FoX" \
FC="$(FC_SERIAL)" FCFLAGS="$(FFLAGS:$(IPO_FLAG)=)" \
--enable-wcml $(DUMMY_FOX) || false )
# Sadly the configure script does not store the AR and RANLIB flags... :(
(cd FoX ; echo "AR = $(AR)" >> arch.make ; \
echo "RANLIB = $(RANLIB)" >> arch.make )
# Note we have to make sure to use the same compiler as SIESTA,
# and pick up all the same FFLAGS, and also remember to maybe ask for a dummy library.
# Note also that the "false" clause will stop the 'make' process if the configuration fails.
# Then we want to make FoX itself. Like so:
$(FoX_built): $(FoX_configured)
(cd FoX; $(MAKE) -j 1 )
# Now ensure that building FoX is inserted into the dependency chain.
# Routines using FoX:
# version (compinfo.o) does not actually need FoX, but making it build after
# FoX is done avoids a warning as we use the FoX-config script everywhere.
$(SYSOBJ) $(OBJS) \
basis_io.o efield.o initatom.o ioeig.o kpoint_grid.o meshsubs.o \
mulliken.o ordern.o outcell.o pdos.o post_scf_work.o radial.o \
scfconvergence_test.o setup_hamiltonian.o siesta_analysis.o \
siesta_cml.o siesta_cmlsubs.o siesta_end.o siesta_forces.o \
siesta_init.o siesta_move.o siesta_options.o state_analysis.o \
state_init.o struct_init.o write_subs.o xml.o: $(FoX_built)
#--------------------------------------------------------------
XMLPARSER=libxmlparser.a
$(XMLPARSER):
(cd xmlparser ; $(MAKE) -j 1 "VPATH=$(VPATH)/xmlparser" \
FFFLAGS="$(FFLAGS:$(IPO_FLAG)=)" module)
WXML=libwxml.a
$(WXML):
(cd wxml ; $(MAKE) -j 1 "VPATH=$(VPATH)/wxml" \
FFFLAGS="$(FFLAGS:$(IPO_FLAG)=)" module)
#--------------------------------------------------------------
libmpi_f90.a:
@(cd MPI ; $(MAKE) -j 1 \
@ -452,13 +410,15 @@ siesta: check-siesta what version \
$(FC) -o siesta \
$(LDFLAGS) $(ALL_OBJS) $(FDF) $(WXML) $(XMLPARSER) \
$(XC) $(MPI_INTERFACE) \
$(COMP_LIBS) $(FoX_LIBS) $(LIBS)
$(COMP_LIBS) $(LIBS)
libSiestaForces.a: $(OBJS) $(SYSOBJ)
$(AR) $(ARFLAGS_EXTRA) cru libSiestaForces.a $(OBJS) $(SYSOBJ)
@if [ ! -z "$(MPI_INTERFACE)" ] ; then \
$(AR) $(ARFLAGS_EXTRA) cru libSiestaForces.a MPI/*.o ; fi
-$(RANLIB) libSiestaForces.a
#
#----------------------------------------------------------------------------
# TranSIESTA objects needed for siesta
@ -510,7 +470,7 @@ transiesta: check-ts what version \
$(FC) -o transiesta \
$(LDFLAGS) $(ALL_OBJS) $(TS_OBJS) $(FDF) $(XC) \
$(MPI_INTERFACE) $(NETCDF_INTERFACE) \
$(COMP_LIBS) $(FoX_LIBS) $(LIBS)
$(COMP_LIBS) $(LIBS)
clean:
@ -522,7 +482,6 @@ clean:
rm -f *.bck *~
rm -f aux_*.f aux_*.f90
(cd fdf ; $(MAKE) clean)
(cd FoX ; touch arch.make ; $(MAKE) distclean)
(cd xmlparser ; $(MAKE) clean)
(cd wxml ; $(MAKE) clean)
@if [ -d MPI ] ; then (cd MPI && $(MAKE) clean ) ; fi
@ -1224,7 +1183,8 @@ siesta_analysis.o: m_pexsi_dos.o m_pexsi_local_dos.o m_spin.o m_steps.o
siesta_analysis.o: parallel.o projected_DOS.o siesta2wannier90.o siesta_cml.o
siesta_analysis.o: siesta_geom.o siesta_options.o sparse_matrices.o units.o
siesta_analysis.o: write_subs.o writewave.o zmatrix.o
siesta_cmlsubs.o: files.o parallel.o siesta_cml.o timestamp.o
siesta_cmlsubs.o: files.o m_uuid.o parallel.o siesta_cml.o timestamp.o
siesta_cmlsubs.o:
siesta_dicts.o: atomlist.o m_energies.o m_forces.o precision.o siesta_geom.o
siesta_dicts.o: siesta_options.o
siesta_end.o: alloc.o bands.o densematrix.o extrae_eventllist.o flook_siesta.o
@ -1380,6 +1340,7 @@ class_zdata2d.o: class_Data2D.o
class_zspdata1d.o: class_SpData1D.o
class_zspdata2d.o: class_SpData2D.o
class_ztrimat.o: class_TriMat.o
cmlcomp.o: cml.o
diagmemory.o: memoryinfo.o
f90sockets.o: fsockets.o
fsiesta.o: fsiesta_sockets.o

View File

@ -67,7 +67,7 @@ c Cell volume
if (cml_p) then
call cmlAddCrystal(xf=mainXML,
. title='Lattice Parameters', lenfmt='r6', angfmt='r6',
. title='Lattice Parameters', fmt='r6',
. alpha=celang(1), beta=celang(2), gamma=celang(3),
. a=cellm(1)/Ang, b=cellm(2)/Ang, c=cellm(3)/Ang )
endif

View File

@ -25,6 +25,7 @@ Module siesta_cmlsubs
Use files, only : slabel, label_length
Use parallel, only : nodes, ionode
Use version_info
use m_uuid, only: generate_uuid
Use m_timestamp, only: datestring
Character(len=label_length+4) :: fname
@ -43,9 +44,20 @@ Module siesta_cmlsubs
If (cml_p) Then
Write(fname,'(a)') Trim(slabel)//'.xml'
Call cmlBeginFile(mainXML, trim(fname), unit=-1)
Call cmlAddNamespace(mainXML, 'siesta', 'http://www.uam.es/siesta/namespace')
Call cmlAddNamespace(mainXML, 'siestaUnits', 'http://www.uam.es/siesta/namespace/units')
Call cmlStartCml(mainXML, convention="CMLComp")
Call cmlStartCml(mainXML)
call cmlAddNamespace(mainXML, 'xmlns', 'http://www.xml-cml.org/schema')
Call cmlAddNamespace(mainXML, 'xmlns:siesta', 'http://www.uam.es/siesta/namespace')
Call cmlAddNamespace(mainXML, 'xmlns:siestaUnits', 'http://www.uam.es/siesta/namespace/units')
call cmlAddNamespace(mainXML, 'xmlns:xsd', 'http://www.w3.org/2001/XMLSchema')
call cmlAddNamespace(mainXML, 'xmlns:fpx', 'http://www.uszla.me.uk/fpx')
call cmlAddNamespace(mainXML, 'xmlns:dc', 'http://purl.org/dc/elements/1.1/')
call cmlAddNamespace(mainXML, 'xmlns:units', 'http://www.uszla.me.uk/FoX/units')
call cmlAddNamespace(mainXML, 'xmlns:cmlUnits', 'http://www.xml-cml.org/units/units')
call cmlAddNamespace(mainXML, 'xmlns:siUnits', 'http://www.xml-cml.org/units/siUnits')
call cmlAddNamespace(mainXML, 'xmlns:atomicUnits', 'http://www.xml-cml.org/units/atomic')
Call cmlStartMetadataList(mainXML)
Call cmlAddMetadata(mainXML, name='siesta:Program', content='Siesta')
Call cmlAddMetadata(mainXML, name='siesta:Version', content=version_str)
@ -53,6 +65,7 @@ Module siesta_cmlsubs
Call cmlAddMetadata(mainXML, name='siesta:Flags', content=fflags)
Call cmlAddMetadata(mainXML, name='siesta:PPFlags', content=fppflags)
Call cmlAddMetadata(mainXML, name='siesta:StartTime',content=datestring())
Call cmlAddMetadata(mainXML, name='siesta:run_UUID',content=generate_uuid(1))
If (nodes>1) Then
Call cmlAddMetadata(mainXML, name='siesta:Mode', content='Parallel')
Else

View File

@ -3,6 +3,7 @@ module flib_wcml
use flib_wxml, only: xmlf_t, str, xml_OpenFile, xml_Close
use flib_wxml, only: xml_NewElement, xml_AddPcData, xml_AddAttribute
use flib_wxml, only: xml_EndElement, xml_AddArray
use flib_wxml, only: xml_AddXMLDeclaration
use flib_wstml, only: stmAddScalar
use flib_wstml, only: stmAddMatrix
use flib_wstml, only: stmAddArray
@ -146,6 +147,7 @@ CONTAINS
logical, intent(in), optional :: replace
call xml_OpenFile(filename, xf, indent=.true.)
call xml_AddXMLDeclaration(xf,encoding="UTF-8")
end subroutine cmlBeginFile
@ -161,7 +163,7 @@ CONTAINS
character(len=*), intent(in) :: prefix
character(len=*), intent(in) :: URI
! Do nothing
call xml_AddAttribute(xf,prefix,URI)
end subroutine cmlAddNamespace
@ -178,22 +180,16 @@ CONTAINS
if (present(id)) call xml_AddAttribute(xf, 'id', id)
if (present(title)) call xml_AddAttribute(xf, 'title', title)
if (present(dictref)) call xml_AddAttribute(xf, 'dictRef', dictref)
if (present(convention)) then
call xml_AddAttribute(xf, 'convention', convention)
else
call xml_AddAttribute(xf, 'convention', 'CMLComp')
endif
call xml_AddAttribute(xf, 'convention', 'CMLComp')
if (present(fileId)) then
call xml_AddAttribute(xf, 'fileId', fileId)
else
call xml_AddAttribute(xf, 'fileId', 'NameOfCMLFIle')
endif
if (present(version)) then
call xml_AddAttribute(xf, 'version', version)
endif
! call cmlAddMetadata(xf, name='UUID', content=generate_uuid(1))
end subroutine cmlStartCml
!--------------------------------------------------------------------
@ -1603,7 +1599,7 @@ CONTAINS
! 1. creates and writes a DP <cell> element
! -------------------------------------------------
SUBROUTINE cmlAddCrystalDP(xf, a, b, c, alpha, beta, gamma, id, title, dictref, conv, lenfmt, angfmt, spaceType, fmt)
SUBROUTINE cmlAddCrystalDP(xf, a, b, c, alpha, beta, gamma, id, title, dictref, conv, lenunits, angunits, spaceType, fmt)
implicit none
type(xmlf_t), intent(inout) :: xf
real(kind=dp), intent(in) :: a, b, c ! cell parameters
@ -1614,27 +1610,21 @@ CONTAINS
character(len=*), intent(in), optional :: title ! title
character(len=*), intent(in), optional :: dictref ! dictref
character(len=*), intent(in), optional :: conv ! convention
character(len=*), intent(in), optional :: lenfmt ! units for length (default = angstrom)
character(len=*), intent(in), optional :: angfmt ! units for angles (default = degree)
character(len=*), intent(in), optional :: lenunits ! units for length (default = angstrom)
character(len=*), intent(in), optional :: angunits ! units for angles (default = degree)
character(len=*), intent(in), optional :: spaceType ! spacegroup
character(len=*), intent(in), optional :: fmt ! format
! Flush on entry and exit
character(len=30) :: lunits, aunits
character(len=10) :: formt
if (present(fmt)) then
formt = fmt
else
formt = '(f8.3)'
endif
if (present(lenfmt)) then
lunits = lenfmt
if (present(lenunits)) then
lunits = lenunits
else
lunits = U_ANGSTR
endif
if (present(angfmt)) then
aunits = angfmt
if (present(angunits)) then
aunits = angunits
else
aunits = U_DEGREE
endif
@ -1663,7 +1653,7 @@ CONTAINS
! 2. creates and writes a SP <cell> element
! -------------------------------------------------
SUBROUTINE cmlAddCrystalSP(xf, a, b, c, alpha, beta, gamma, id, title, dictref, conv, lenfmt, angfmt, spaceType, fmt)
SUBROUTINE cmlAddCrystalSP(xf, a, b, c, alpha, beta, gamma, id, title, dictref, conv, lenunits, angunits, spaceType, fmt)
implicit none
type(xmlf_t), intent(inout) :: xf
real(kind=sp), intent(in) :: a, b, c ! cell parameters
@ -1674,8 +1664,8 @@ CONTAINS
character(len=*), intent(in), optional :: title ! title
character(len=*), intent(in), optional :: dictref ! dictref
character(len=*), intent(in), optional :: conv ! convention
character(len=*), intent(in), optional :: lenfmt ! units for length (' ' = angstrom)
character(len=*), intent(in), optional :: angfmt ! units for angles (' ' = degree)
character(len=*), intent(in), optional :: lenunits ! units for length (' ' = angstrom)
character(len=*), intent(in), optional :: angunits ! units for angles (' ' = degree)
character(len=*), intent(in), optional :: spaceType ! spacegroup
character(len=*), intent(in), optional :: fmt ! format
@ -1688,13 +1678,13 @@ CONTAINS
else
formt = '(f8.3)'
endif
if (present(lenfmt)) then
lunits = lenfmt
if (present(lenunits)) then
lunits = lenunits
else
lunits = U_ANGSTR
endif
if (present(angfmt)) then
aunits = angfmt
if (present(angunits)) then
aunits = angunits
else
aunits = U_DEGREE
endif