1
0
mirror of https://github.com/TREX-CoE/fparser.git synced 2025-01-10 13:08:30 +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: # A string containing a filename:
filename = 'another_file' filename = 'another_file'
# load molecular coordinates using special keyword molecule # load molecular coordinates using special keyword molecule
molecule = benzene.xyz molecule = benzene.xyz

View File

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