Skip to content

Commit

Permalink
Move MP2 printer to WFC section
Browse files Browse the repository at this point in the history
If the user wants to adopt the print settings, he has to set the MP2 section which leads to problems with the other methods.
  • Loading branch information
Frederick Stein authored and fstein93 committed Dec 16, 2021
1 parent 964a920 commit 6b413b5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
17 changes: 8 additions & 9 deletions src/input_cp2k_mp2.F
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ SUBROUTINE create_mp2_section(section)
TYPE(section_type), POINTER :: section

TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
TYPE(section_type), POINTER :: print_key, subsection

CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="WF_CORRELATION", &
Expand Down Expand Up @@ -151,6 +151,13 @@ SUBROUTINE create_mp2_section(section)
CALL section_add_subsection(section, subsection)
CALL section_release(subsection)

NULLIFY (print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "PRINT", &
description="Controls the printing basic info about WFC methods", &
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)

END SUBROUTINE create_mp2_section

! **************************************************************************************************
Expand All @@ -161,7 +168,6 @@ SUBROUTINE create_mp2_details_section(section)
TYPE(section_type), POINTER :: section

TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: print_key

CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, name="MP2", &
Expand Down Expand Up @@ -191,13 +197,6 @@ SUBROUTINE create_mp2_details_section(section)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)

NULLIFY (print_key)
CALL cp_print_key_section_create(print_key, __LOCATION__, "MP2_INFO", &
description="Controls the printing basic info about MP2 method", &
print_level=low_print_level, add_last=add_last_numeric, filename="__STD_OUT__")
CALL section_add_subsection(section, print_key)
CALL section_release(print_key)

CALL keyword_create( &
keyword, __LOCATION__, &
name="BIG_SEND", &
Expand Down
4 changes: 2 additions & 2 deletions src/mp2.F
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ SUBROUTINE mp2_main(qs_env, calc_forces)

END IF

unit_nr = cp_print_key_unit_nr(logger, input, "DFT%XC%WF_CORRELATION%MP2%MP2_INFO", &
unit_nr = cp_print_key_unit_nr(logger, input, "DFT%XC%WF_CORRELATION%PRINT", &
extension=".mp2Log")

IF (unit_nr > 0) THEN
Expand Down Expand Up @@ -739,7 +739,7 @@ SUBROUTINE mp2_main(qs_env, calc_forces)
END IF
CALL cp_print_key_finished_output(unit_nr, logger, input, &
"DFT%XC%WF_CORRELATION%MP2%MP2_INFO")
"DFT%XC%WF_CORRELATION%PRINT")
CALL timestop(handle)
Expand Down
4 changes: 2 additions & 2 deletions src/mp2_cphf.F
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ SUBROUTINE update_mp2_forces(qs_env)
x_data=x_data)

logger => cp_get_default_logger()
iounit = cp_print_key_unit_nr(logger, input, "DFT%XC%WF_CORRELATION%MP2%MP2_INFO", &
iounit = cp_print_key_unit_nr(logger, input, "DFT%XC%WF_CORRELATION%PRINT", &
extension=".mp2Log")

p_env => qs_env%mp2_env%ri_grad%p_env
Expand Down Expand Up @@ -1588,7 +1588,7 @@ SUBROUTINE update_mp2_forces(qs_env)
CALL calculate_dispersion_pairpot(qs_env, dispersion_env, e_dummy, .TRUE.)
CALL cp_print_key_finished_output(iounit, logger, input, &
"DFT%XC%WF_CORRELATION%MP2%MP2_INFO")
"DFT%XC%WF_CORRELATION%PRINT")
CALL timestop(handle)
Expand Down
4 changes: 2 additions & 2 deletions src/mp2_setup.F
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ SUBROUTINE read_mp2_section(input, mp2_env)
mp2_env%p_screen = .TRUE.

! print some info about the MP2 parameters
unit_nr = cp_print_key_unit_nr(logger, mp2_section, "MP2%MP2_INFO", &
unit_nr = cp_print_key_unit_nr(logger, mp2_section, "PRINT", &
extension=".mp2Log")
IF ((mp2_env%method .NE. mp2_method_none) .AND. unit_nr > 0) THEN
WRITE (unit_nr, '(T2,A)') ""
Expand All @@ -365,7 +365,7 @@ SUBROUTINE read_mp2_section(input, mp2_env)
END IF

CALL cp_print_key_finished_output(unit_nr, logger, mp2_section, &
"MP2%MP2_INFO")
"PRINT")

CALL timestop(handle)

Expand Down

0 comments on commit 6b413b5

Please sign in to comment.