1
0
mirror of https://github.com/TREX-CoE/fparser.git synced 2024-12-23 04:44:04 +01:00

lines commented for the time being

This commit is contained in:
Ravindra Shinde 2021-02-12 09:03:10 +01:00
parent e7cd810448
commit 15772e1855
2 changed files with 30 additions and 30 deletions

View File

@ -20,7 +20,7 @@ title = "A sample champ input file specification in config format"
# A string containing a filename:
filename = 'another_file'
# load molecular coordinates using special keyword molecule
# load molecular coordinates using special keyword molecule
molecule = benzene.xyz

View File

@ -300,8 +300,9 @@ contains
line_number = line_number + 1
if (line_number == 1) then
! parse the line and store the number as number of atoms
coordinates%natoms = adjustl(line)
allocate((coordinates%cartesian(3,coordinates%natoms)))
! coordinates%natoms = line !! conversion needed here remove debug line below
coordinates%natoms = 12
allocate(coordinates%cartesian(3,coordinates%natoms))
write(*,*) "Number of atoms from the xyz file", coordinates%natoms
elseif (line_number == 2) then
! parse the line and store the string as a comment
@ -309,12 +310,12 @@ contains
write(*,*) "Comment from the xyz file", coordinates%comment
else
! parse the line and store the variables
call prepare_get_var(coordinates, "", CFG_string_type, 1, 1) ! 1 for element name and 1 is the position where line starts
call prepare_get_var(coordinates, "", CFG_real_type, 3, 2) ! 3 for x,y,z and 2 is the position where numbers start
real_data = cfg%vars(ix)%real_data
! call prepare_get_var(coordinates, "", CFG_string_type, 1, 1) ! first atom name & then position whr line starts
! call prepare_get_var(coordinates, "", CFG_real_type, 3, 2) ! 3 for x,y,z & 2 is where numbers start
! real_data = cfg%vars(ix)%real_data
call parse_xyz(coordinates, line)
coordinates%cartesian(3,coordinates%natoms)
! call parse_xyz(coordinates, line)
! coordinates%cartesian(3,coordinates%natoms)
endif
end do
@ -336,9 +337,8 @@ contains
logical :: append
character(len=CFG_string_len) :: line
character(len=CFG_name_len) :: var_name, category
integer :: ix, equal_sign_ix
logical :: append
! character(len=CFG_name_len) :: var_name, category
! integer :: ix, equal_sign_ix
! Work on a copy
@ -350,27 +350,27 @@ contains
if (line == "") return
if (ix <= 0) then
! Variable still needs to be created, for now store data as a string
call prepare_store_var(cfg, trim(var_name), CFG_unknown_type, 1, &
"Not yet created", ix, .false.)
cfg%vars(ix)%stored_data = line
else
if (append) then
cfg%vars(ix)%stored_data = &
trim(cfg%vars(ix)%stored_data) // trim(line)
else
cfg%vars(ix)%stored_data = line
end if
! if (ix <= 0) then
! ! Variable still needs to be created, for now store data as a string
! ! call prepare_store_var(coordinates, trim(var_name), CFG_unknown_type, 1, &
! ! "Not yet created", ix, .false.)
! ! coordinates%vars(ix)%stored_data = line
! else
! if (append) then
! coordinates%vars(ix)%stored_data = &
! trim(coordinates%vars(ix)%stored_data) // trim(line)
! else
! coordinates%vars(ix)%stored_data = line
! end if
! If type is known, read in values
if (cfg%vars(ix)%var_type /= CFG_unknown_type) then
call read_variable(cfg%vars(ix))
end if
end if
! ! If type is known, read in values
! if (coordinates%vars(ix)%var_type /= CFG_unknown_type) then
! call read_variable(coordinates%vars(ix))
! end if
! end if
! Store how the variable was set
cfg%vars(ix)%set_by = set_by
!! Store how the variable was set
! coordinates%vars(ix)%set_by = set_by
end subroutine parse_xyz