From 1f6b634d06b4530d26d60e691e1f5182c4d463ca Mon Sep 17 00:00:00 2001 From: Ravindra Shinde Date: Thu, 18 Feb 2021 23:21:04 +0100 Subject: [PATCH] xyz file comment line ignored --- src/iochamp.f90 | 21 ++++----------------- src/test-champ.inp | 10 +++++++++- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/iochamp.f90 b/src/iochamp.f90 index 3ba3e74..a6de4ae 100644 --- a/src/iochamp.f90 +++ b/src/iochamp.f90 @@ -165,12 +165,7 @@ PROGRAM iochamp write(*,*) "number of atoms", number_of_atoms endif na = number_of_atoms - - if (pline%ntokens == 1) then -! molecule_name = fdf_bnames(pline, 1) - molecule_name = fdf_get('molecule', 'Unknown molecule') - endif - + if (pline%ntokens == 4) then symbol(ia) = fdf_bnames(pline, 1) do i= 1, 3 @@ -224,18 +219,14 @@ PROGRAM iochamp write(6,*) 'Reading an inline_xyz block ' 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) write(*,*) "Number of atoms", number_of_atoms endif na = number_of_atoms - if (pline%ntokens == 1) then - molecule_name = fdf_string('', 'Unknown molecule') - endif - if (pline%ntokens == 4) then symbol(ia) = fdf_bnames(pline, 1) do i= 1, 3 @@ -264,11 +255,7 @@ PROGRAM iochamp write(*,*) "Number of atoms", number_of_atoms endif na = number_of_atoms - - if (pline%ntokens == 1) then - molecule_name = fdf_string('', 'Unknown molecule') - endif - + if (pline%ntokens == 4) then symbol(ia) = fdf_bnames(pline, 1) do i= 1, 3 diff --git a/src/test-champ.inp b/src/test-champ.inp index 24c2036..4d84f2b 100644 --- a/src/test-champ.inp +++ b/src/test-champ.inp @@ -9,6 +9,8 @@ sr_eps 0.001 sr_adiag 0.05 energy_tol 0.004 + + %block optimization_flags optimize_wavefunction no optimize_ci No @@ -16,6 +18,8 @@ energy_tol 0.004 optimize_orbitals False %endblock + + # The sub blocks currently does not parse. %block general @@ -54,7 +58,7 @@ energy_tol 0.004 %block inline_xyz 3 -molecule name unknown +hypothetical molecule Nh 1.50 1.108000 -3 Ox 0.333000 0 45 Pd -1.431000 -1.108000 20 @@ -76,4 +80,8 @@ H 0 -0.75545 -0.47116 %block molecule < "caffeine.xyz" + + +### Two blocks with the same name not supported. Ignored without warning + %block molecule < "benzene.xyz"