(implicit ps) switch the debug mode on/off from input file

svn-origin-rev: 15088
This commit is contained in:
Hossein Banihashemian 2015-02-19 15:05:52 +00:00
parent 70bc4119d9
commit 3e5ca2828f
4 changed files with 41 additions and 9 deletions

View file

@ -776,6 +776,7 @@ END SUBROUTINE create_ewald_section
routineP = moduleN//':'//routineN
LOGICAL :: failure
TYPE(keyword_type), POINTER :: keyword
TYPE(section_type), POINTER :: subsection
failure=.FALSE.
@ -787,6 +788,15 @@ END SUBROUTINE create_ewald_section
n_keywords=1, n_subsections=4, repeats=.FALSE., required=.FALSE.,&
error=error)
NULLIFY(keyword)
CALL keyword_create(keyword, name="DEBUG", &
description="Whether or not to print out the values of the electrostatic potential "// &
"at Dirichlet regions.", &
usage="DEBUG <logical>", default_l_val=.FALSE., error=error)
CALL section_add_keyword(section, keyword, error=error)
CALL keyword_release(keyword, error=error)
NULLIFY(subsection)
CALL create_aa_planar_section(subsection, error)

View file

@ -28,6 +28,8 @@ MODULE dirichlet_bc_types
! main types
TYPE :: dirichlet_bc_parameters
LOGICAL :: debug
INTEGER :: n_aa_planar
REAL(KIND=dp), DIMENSION(:,:), POINTER :: aa_planar_xxtnt => NULL()
REAL(KIND=dp), DIMENSION(:,:), POINTER :: aa_planar_yxtnt => NULL()

View file

@ -90,7 +90,6 @@ MODULE ps_implicit_methods
compute_error_mixed_bc
END INTERFACE ps_implicit_compute_error
LOGICAL, PRIVATE, PARAMETER :: debug = .FALSE.
LOGICAL, PRIVATE, PARAMETER :: adjust_local_bounds = .FALSE.
CONTAINS
@ -499,7 +498,8 @@ CONTAINS
routineP = moduleN//':'//routineN
INTEGER :: data_size, handle, iter, j, lb1, lb2, lb3, max_iter, n_gates, &
n_tiles_tot, ngpts_local, outp_unit, times_called, ub1, ub2, ub3
n_tiles_tot, ng, ngpts_local, nt, nt_tot, outp_unit, times_called, ub1, &
ub2, ub3
INTEGER(KIND=int_8) :: ngpts
INTEGER, DIMENSION(2, 3) :: bounds_local
INTEGER, DIMENSION(3) :: npts_local
@ -683,13 +683,22 @@ CONTAINS
END IF
! debugging
IF (debug) THEN
IF (poisson_params%dbc_params%debug) THEN
v_new1D(ps_implicit_env%idx_3dto1d) = RESHAPE(v_new%cr3d, (/data_size/))
CALL DGEMV('N', n_tiles_tot, data_size, 1.0_dp, B, n_tiles_tot, v_new1D, 1, 0.0_dp, Bxv_new, 1)
CALL mp_sum(Bxv_new, pw_grid%para%group)
IF (outp_unit .GT. 0) THEN
WRITE(outp_unit, '(T8,A)') 'vhartree at DB regions : '
WRITE(outp_unit, '(T8,E10.2)') Bxv_new
WRITE(outp_unit, '(T3,A,A)') "======== debug ", REPEAT('=', 63)
WRITE(outp_unit, '(T25,A)') "Drgn tile vhartree"
WRITE(outp_unit, '(T24,A)') REPEAT('-', 32)
nt_tot = 1
DO ng = 1, n_gates
DO nt = 1, ps_implicit_env%gates(ng)%dirichlet_bc%n_tiles
WRITE(outp_unit, '(T22,I6,5X,I6,3X,E13.4)') ng, nt, Bxv_new(nt_tot)
nt_tot = nt_tot + 1
END DO
END DO
WRITE(outp_unit, '(T3,A)') REPEAT('=', 78)
END IF
END IF
@ -761,7 +770,8 @@ CONTAINS
routineP = moduleN//':'//routineN
INTEGER :: data_size, handle, iter, j, lb1, lb2, lb3, max_iter, n_gates, &
n_tiles_tot, ngpts_local, outp_unit, times_called, ub1, ub2, ub3
n_tiles_tot, ng, ngpts_local, nt, nt_tot, outp_unit, times_called, ub1, &
ub2, ub3
INTEGER(KIND=int_8) :: ngpts
INTEGER, DIMENSION(2, 3) :: bounds_local
INTEGER, DIMENSION(3) :: npts_local
@ -958,13 +968,22 @@ CONTAINS
END IF
! debugging
IF (debug) THEN
IF (poisson_params%dbc_params%debug) THEN
v_new1D(ps_implicit_env%idx_3dto1d) = RESHAPE(v_new%cr3d, (/data_size/))
CALL DGEMV('N', n_tiles_tot, data_size, 1.0_dp, B, n_tiles_tot, v_new1D, 1, 0.0_dp, Bxv_new, 1)
CALL mp_sum(Bxv_new, pw_grid%para%group)
IF (outp_unit .GT. 0) THEN
WRITE(outp_unit, '(T8,A)') 'vhartree at DB regions : '
WRITE(outp_unit, '(T8,E10.2)') Bxv_new
WRITE(outp_unit, '(T3,A)') "======== debug "//REPEAT('=', 63)
WRITE(outp_unit, '(T25,A)') "Drgn tile vhartree"
WRITE(outp_unit, '(T24,A)') REPEAT('-', 32)
nt_tot = 1
DO ng = 1, n_gates
DO nt = 1, ps_implicit_env%gates(ng)%dirichlet_bc%n_tiles
WRITE(outp_unit, '(T22,I6,5X,I6,3X,E13.4)') ng, nt, Bxv_new(nt_tot)
nt_tot = nt_tot + 1
END DO
END DO
WRITE(outp_unit, '(T3,A)') REPEAT('=', 78)
END IF
END IF

View file

@ -261,6 +261,7 @@ CONTAINS
! parsing DIRICHLET_BC subsection
dbc_section => section_vals_get_subs_vals(ps_implicit_section, "DIRICHLET_BC", error=error)
CALL section_vals_val_get(dbc_section, "DEBUG", l_val=params%dbc_params%debug, error=error)
aa_planar_section => section_vals_get_subs_vals(dbc_section, "AA_PLANAR", error=error)
planar_section => section_vals_get_subs_vals(dbc_section, "PLANAR", error=error)
xaa_cylindrical_section => section_vals_get_subs_vals(dbc_section, "XAA_CYLINDRICAL", error=error)