~siesta-sip/siesta/sip-solver

« back to all changes in this revision

Viewing changes to Util/Vibra/Src/fcbuild.f

  • Committer: Alberto Garcia
  • Date: 2015-06-22 09:32:02 UTC
  • Revision ID: albertog@icmab.es-20150622093202-enhjztqfku2e976q
Revert previous change affecting FA and FC files. FAC/FCC files.

* At revno 464, a change was introduced to output the constrained
  forces to the FA and FC files.  This had unintended consequences for
  some analysis tools.

  The change has been reverted, and the FC/FA files are now created as
  before. In addition, if constraints are used, new FCC/FAC files
  will be created with the constrained forces.

  The vibra utility will default to use the FCC files if the
  GeometryConstraints block exists, and in any case the
  force-constants file to use can be specified with the Vibra.FC fdf
  option.

  To support these changes, the write_forces subroutine has now 
  the geometry step as an additional argument.

  The writing of forces has been moved to its appropriate place in the
  write_subs modules.

* Some more cosmetic changes in the Vibra package.

modified:
  Docs/siesta.tex
  Src/Makefile
  Src/iofa.f
  Src/ofc.f
  Src/siesta_analysis.F
  Src/siesta_forces.F
  Src/state_analysis.F
  Src/write_subs.F
  Util/Vibra/Docs/CHANGES
  Util/Vibra/Docs/vibra.tex
  Util/Vibra/Examples/README
  Util/Vibra/Examples/si54.bands
  Util/Vibra/Examples/si54.fdf
  Util/Vibra/Src/Makefile
  Util/Vibra/Src/fcbuild.f
  Util/Vibra/Src/recoor.f
  Util/Vibra/Src/vibra.f

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
c *********************************************************************
15
15
c Build supercell coordinates for Force Constant Matrix calculation,
16
16
c for clusters, linear chains, slabs and 3D xtals.
17
 
c Compatible with vibrator.f
 
17
c Compatible with vibra.f
18
18
c
19
19
c Uses the FDF (Flexible Data Format) package (version 0.66.1.5)
20
20
c of J.M.Soler and A. Garcia, 
58
58
      data pi / 3.1415926d0 /
59
59
      data overflow /.false./
60
60
 
 
61
      logical :: has_constr
 
62
 
61
63
      type(block_fdf)            :: bfdf
62
64
      type(parsed_line), pointer :: pline
63
65
 
114
116
      write(6,'(a,f10.5,a)') 'Lattice Constant    = ',alat,'  Bohr'
115
117
c ...
116
118
 
 
119
c Whether the constrainst block exists
 
120
      has_constr = fdf_block('GeometryConstraints',bfdf)
 
121
      has_constr = has_constr .or.
 
122
     &     fdf_block('Geometry.Constraints',bfdf)
 
123
c ...
 
124
      
117
125
c Lattice vectors of unit cell...
118
126
      if ( fdf_block('LatticeParameters',bfdf) .and.
119
127
     .     fdf_block('LatticeVectors',bfdf) ) then
264
272
      call io_assign(iunit)
265
273
      open(unit=iunit,file='FC.fdf',status='new',err=100)
266
274
 
 
275
c  Write new constrained file if the GeometryConstraints
 
276
c  block exists
 
277
      if ( has_constr ) then
 
278
         write(iunit,*)
 
279
         write(iunit,'(a)') '# GeometryConstraints block found'
 
280
         write(iunit,'(a)') '# defaulting to constrained FC'
 
281
         write(iunit,'(a,a)') 'Vibra.FC ',trim(slabel)//'.FCC'
 
282
         write(iunit,*)
 
283
      end if
 
284
c ...
 
285
      
267
286
c  Write Number of atoms in Supercell ...
268
287
      write(iunit,'(a,i5)') 'NumberOfAtoms       ',nnat
269
288
      write(iunit,*) 
323
342
     . '    ERROR: File FC.fdf already exists!',
324
343
     . '********************************************'
325
344
      stop
 
345
 
326
346
      CONTAINS
327
347
 
328
348
      subroutine die(str)