diff --git a/src/iochamp.f90 b/src/iochamp.f90 index a6de4ae..ac58a9b 100644 --- a/src/iochamp.f90 +++ b/src/iochamp.f90 @@ -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 diff --git a/src/temp.fdf b/src/temp.fdf new file mode 100644 index 0000000..224b129 --- /dev/null +++ b/src/temp.fdf @@ -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 diff --git a/src/test-champ.inp b/src/test-champ.inp index 4d84f2b..d898558 100644 --- a/src/test-champ.inp +++ b/src/test-champ.inp @@ -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 \ No newline at end of file