Skip to content

Commit

Permalink
SIRIUS: Fix string lenght issue with section_name
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed Jan 17, 2020
1 parent a7aace4 commit e2b44dc
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/input_cp2k_pwdft.F
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ SUBROUTINE create_pwdft_section(section)
CHARACTER(len=*), PARAMETER :: routineN = 'create_pwdft_section', &
routineP = moduleN//':'//routineN

CHARACTER(len=32) :: section_name
TYPE(section_type), POINTER :: subsection

! ------------------------------------------------------------------------
Expand All @@ -81,27 +80,19 @@ SUBROUTINE create_pwdft_section(section)
"supported by libxc and Van der Waals corrections (libvdwxc).")

NULLIFY (subsection)
section_name = ''
section_name = 'control'
CALL create_sirius_section(subsection, section_name)
CALL create_sirius_section(subsection, 'control')
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

section_name = ''
section_name = 'parameters'
CALL create_sirius_section(subsection, section_name)
CALL create_sirius_section(subsection, 'parameters')
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

section_name = ''
section_name = 'mixer'
CALL create_sirius_section(subsection, section_name)
CALL create_sirius_section(subsection, 'mixer')
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

section_name = ''
section_name = 'iterative_solver'
CALL create_sirius_section(subsection, section_name)
CALL create_sirius_section(subsection, 'iterative_solver')
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

Expand All @@ -119,7 +110,7 @@ END SUBROUTINE create_pwdft_section
! **************************************************************************************************
SUBROUTINE create_sirius_section(section, section_name)
TYPE(section_type), POINTER :: section
CHARACTER(len=32), INTENT(in) :: section_name
CHARACTER(len=*), INTENT(in) :: section_name

CHARACTER(len=*), PARAMETER :: routineN = 'create_sirius_section', &
routineP = moduleN//':'//routineN
Expand All @@ -128,6 +119,7 @@ SUBROUTINE create_sirius_section(section, section_name)

CPASSERT(.NOT. ASSOCIATED(section))
CALL sirius_option_get_length(TRIM(ADJUSTL(section_name))//CHAR(0), length)

CALL section_create(section, __LOCATION__, &
name=TRIM(ADJUSTL(section_name)), &
description=TRIM(section_name)//" section", &
Expand All @@ -145,7 +137,7 @@ END SUBROUTINE create_sirius_section
! **************************************************************************************************
SUBROUTINE fill_in_section(section, section_name)
TYPE(section_type), POINTER :: section
CHARACTER(len=32), INTENT(in) :: section_name
CHARACTER(len=*), INTENT(in) :: section_name

CHARACTER(len=*), PARAMETER :: routineN = 'fill_in_section', &
routineP = moduleN//':'//routineN
Expand Down

0 comments on commit e2b44dc

Please sign in to comment.