1
0
mirror of https://github.com/TREX-CoE/fparser.git synced 2024-08-24 22:21:45 +02:00

%include functionality added

This commit is contained in:
Ravindra Shinde 2021-02-19 00:33:15 +01:00
parent 1f6b634d06
commit 44f8276ff6
3 changed files with 26 additions and 15 deletions

View File

@ -242,13 +242,18 @@ PROGRAM iochamp
enddo
endif
write(6,'(A)')
write(6,*) '------------------------------------------------------'
if (fdf_block('inline_xyz2', bfdf)) then
! Forward reading
write(6,*) 'Reading an inline_xyz block '
write(6,*) 'Reading an inline_xyz2 block '
ia = 1
do while((fdf_bline(bfdf, pline)) .and. (ia .le. na))
do while(fdf_bline(bfdf, pline))
if (pline%ntokens == 1) then
number_of_atoms = fdf_bintegers(pline, 1)
@ -265,7 +270,7 @@ PROGRAM iochamp
endif
enddo
write(6,*) 'Inline XYZ Coordinates block:'
write(6,*) 'Inline XYZ2 Coordinates block:'
do ia= 1, na
write(6,'(A4,3F10.6)') symbol(ia), (xa(i,ia),i=1,3)
enddo

10
src/temp.fdf Normal file
View 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

View File

@ -40,7 +40,7 @@ energy_tol 0.004
# An alternative way to provide 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
C -1.21479 0.70136 0
H -2.15666 1.24515 0
@ -65,23 +65,19 @@ hypothetical molecule
%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
%block molecule < "caffeine.xyz"
%block molecule < caffeine.xyz
### Two blocks with the same name not supported. Ignored without warning
%block molecule < "benzene.xyz"
## To include another file having fdf syntax
%include temp.fdf