mirror of
https://github.com/TREX-CoE/fparser.git
synced 2025-01-09 20:48:57 +01:00
%include functionality added
This commit is contained in:
parent
1f6b634d06
commit
44f8276ff6
@ -242,13 +242,18 @@ PROGRAM iochamp
|
|||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
write(6,'(A)')
|
||||||
|
|
||||||
|
write(6,*) '------------------------------------------------------'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (fdf_block('inline_xyz2', bfdf)) then
|
if (fdf_block('inline_xyz2', bfdf)) then
|
||||||
! Forward reading
|
! Forward reading
|
||||||
write(6,*) 'Reading an inline_xyz block '
|
write(6,*) 'Reading an inline_xyz2 block '
|
||||||
ia = 1
|
ia = 1
|
||||||
|
|
||||||
do while((fdf_bline(bfdf, pline)) .and. (ia .le. na))
|
do while(fdf_bline(bfdf, pline))
|
||||||
|
|
||||||
if (pline%ntokens == 1) then
|
if (pline%ntokens == 1) then
|
||||||
number_of_atoms = fdf_bintegers(pline, 1)
|
number_of_atoms = fdf_bintegers(pline, 1)
|
||||||
@ -265,7 +270,7 @@ PROGRAM iochamp
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
write(6,*) 'Inline XYZ Coordinates block:'
|
write(6,*) 'Inline XYZ2 Coordinates block:'
|
||||||
do ia= 1, na
|
do ia= 1, na
|
||||||
write(6,'(A4,3F10.6)') symbol(ia), (xa(i,ia),i=1,3)
|
write(6,'(A4,3F10.6)') symbol(ia), (xa(i,ia),i=1,3)
|
||||||
enddo
|
enddo
|
||||||
|
10
src/temp.fdf
Normal file
10
src/temp.fdf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
%block inline_xyz2
|
||||||
|
6
|
||||||
|
|
||||||
|
C 3.402 0.773 -9.252
|
||||||
|
C 4.697 0.791 -8.909
|
||||||
|
H 2.933 -0.150 -9.521
|
||||||
|
H 2.837 1.682 -9.258
|
||||||
|
H 5.262 -0.118 -8.904
|
||||||
|
H 5.167 1.714 -8.641
|
||||||
|
%endblock inline_xyz2
|
@ -40,7 +40,7 @@ energy_tol 0.004
|
|||||||
# An alternative way to provide coordinates
|
# An alternative way to provide coordinates
|
||||||
|
|
||||||
%block Coordinates
|
%block Coordinates
|
||||||
C 0.00000 1.40272 0
|
C 0.00000 1.40272 0 # can have comments in between or after the data
|
||||||
H 0.00000 2.49029 0
|
H 0.00000 2.49029 0
|
||||||
C -1.21479 0.70136 0
|
C -1.21479 0.70136 0
|
||||||
H -2.15666 1.24515 0
|
H -2.15666 1.24515 0
|
||||||
@ -65,23 +65,19 @@ hypothetical molecule
|
|||||||
%endblock inline_xyz
|
%endblock inline_xyz
|
||||||
|
|
||||||
|
|
||||||
## Example explaining the optional comment line in xyz files
|
|
||||||
|
|
||||||
%block inline_xyz2
|
|
||||||
3
|
|
||||||
|
|
||||||
O 0 0.00000 0.11779
|
|
||||||
H 0 0.75545 -0.47116
|
|
||||||
H 0 -0.75545 -0.47116
|
|
||||||
%endblock inline_xyz2
|
|
||||||
|
|
||||||
|
|
||||||
### Read molecule's geometry directly from the xyz file
|
### Read molecule's geometry directly from the xyz file
|
||||||
|
|
||||||
%block molecule < "caffeine.xyz"
|
%block molecule < caffeine.xyz
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### Two blocks with the same name not supported. Ignored without warning
|
### Two blocks with the same name not supported. Ignored without warning
|
||||||
|
|
||||||
%block molecule < "benzene.xyz"
|
%block molecule < "benzene.xyz"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## To include another file having fdf syntax
|
||||||
|
|
||||||
|
%include temp.fdf
|
Loading…
Reference in New Issue
Block a user