LCOV - code coverage report
Current view: top level - src - pw_poisson_read_input.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:2fce0f8) Lines: 262 263 99.6 %
Date: 2024-12-21 06:28:57 Functions: 6 6 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief Reading of input parameters for the pw_poisson-modules.
      10             : !> \par History
      11             : !>      01.2014 Code moved into separate module to make pw_poisson-modules
      12             : !>              independet from input_section_types and input_constants.
      13             : !> \author Ole Schuett
      14             : ! **************************************************************************************************
      15             : MODULE pw_poisson_read_input
      16             :    USE cell_types,                      ONLY: use_perd_none,&
      17             :                                               use_perd_x,&
      18             :                                               use_perd_xy,&
      19             :                                               use_perd_xyz,&
      20             :                                               use_perd_xz,&
      21             :                                               use_perd_y,&
      22             :                                               use_perd_yz,&
      23             :                                               use_perd_z
      24             :    USE dirichlet_bc_types,              ONLY: xy_plane,&
      25             :                                               xz_plane,&
      26             :                                               yz_plane
      27             :    USE input_section_types,             ONLY: section_vals_get,&
      28             :                                               section_vals_get_subs_vals,&
      29             :                                               section_vals_type,&
      30             :                                               section_vals_val_get
      31             :    USE kinds,                           ONLY: dp
      32             :    USE ps_wavelet_types,                ONLY: WAVELET0D,&
      33             :                                               WAVELET2D,&
      34             :                                               WAVELET3D
      35             :    USE pw_poisson_types,                ONLY: &
      36             :         do_ewald_none, pw_poisson_analytic, pw_poisson_implicit, pw_poisson_mt, &
      37             :         pw_poisson_multipole, pw_poisson_none, pw_poisson_parameter_type, pw_poisson_periodic, &
      38             :         pw_poisson_wavelet
      39             : #include "./base/base_uses.f90"
      40             : 
      41             :    IMPLICIT NONE
      42             :    PRIVATE
      43             : 
      44             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'pw_poisson_read_input'
      45             : 
      46             :    PUBLIC :: pw_poisson_read_parameters
      47             : 
      48             : CONTAINS
      49             : 
      50             : ! **************************************************************************************************
      51             : !> \brief Reads the POISSON input-section and into pw_poisson_parameter_type.
      52             : !> \param poisson_section ...
      53             : !> \param params ...
      54             : !> \par History
      55             : !>      01.2014 Code moved into separate module from pw_poisson_types,
      56             : !>              pw_poisson_methods and ps_wavelet_types.
      57             : !> \author Ole Schuett
      58             : ! **************************************************************************************************
      59       41612 :    SUBROUTINE pw_poisson_read_parameters(poisson_section, params)
      60             :       TYPE(section_vals_type), POINTER                   :: poisson_section
      61             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
      62             : 
      63             :       INTEGER                                            :: periodic
      64             :       TYPE(section_vals_type), POINTER                   :: mt_section, wavelet_section
      65             : 
      66       20806 :       NULLIFY (mt_section, wavelet_section)
      67             : 
      68       20806 :       CALL section_vals_val_get(poisson_section, "POISSON_SOLVER", i_val=params%solver)
      69             : 
      70             :       ! Decoding PERIODIC depending on chosen solver,
      71             :       ! because not all solvers support every possible periodicity
      72       20806 :       CALL section_vals_val_get(poisson_section, "PERIODIC", i_val=periodic)
      73       40756 :       SELECT CASE (params%solver)
      74             :       CASE (pw_poisson_periodic, pw_poisson_analytic, pw_poisson_mt, pw_poisson_multipole, &
      75             :             pw_poisson_implicit)
      76       19950 :          CALL decode_periodic_green(periodic, params)
      77             :       CASE (pw_poisson_wavelet)
      78         856 :          CALL decode_periodic_wavelet(periodic, params)
      79             :       CASE (pw_poisson_none)
      80             :       CASE default
      81       20806 :          CPABORT("")
      82             :       END SELECT
      83             : 
      84             :       ! Set Ewald default to NONE
      85       20806 :       params%ewald_type = do_ewald_none
      86             : 
      87             :       ! parsing MT subsection
      88       20806 :       mt_section => section_vals_get_subs_vals(poisson_section, "MT")
      89       20806 :       CALL section_vals_val_get(mt_section, "REL_CUTOFF", r_val=params%mt_rel_cutoff)
      90       20806 :       CALL section_vals_val_get(mt_section, "ALPHA", r_val=params%mt_alpha)
      91             : 
      92             :       ! parsing WAVELET subsection
      93       20806 :       wavelet_section => section_vals_get_subs_vals(poisson_section, "WAVELET")
      94       20806 :       CALL section_vals_val_get(wavelet_section, "SCF_TYPE", i_val=params%wavelet_scf_type)
      95             : 
      96             :       ! parsing IMPLICIT subsection
      97       20806 :       CALL ps_implicit_read_parameters(poisson_section, params)
      98             : 
      99       20806 :    END SUBROUTINE pw_poisson_read_parameters
     100             : 
     101             : ! **************************************************************************************************
     102             : !> \brief Helper routien for pw_poisson_read_parameters
     103             : !> \param periodic ...
     104             : !> \param params ...
     105             : !> \author Ole Schuett
     106             : ! **************************************************************************************************
     107       19950 :    SUBROUTINE decode_periodic_green(periodic, params)
     108             :       INTEGER, INTENT(IN)                                :: periodic
     109             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
     110             : 
     111       19950 :       SELECT CASE (periodic)
     112             :       CASE (use_perd_x)
     113           8 :          params%periodic = (/1, 0, 0/)
     114             :       CASE (use_perd_y)
     115           8 :          params%periodic = (/0, 1, 0/)
     116             :       CASE (use_perd_z)
     117           8 :          params%periodic = (/0, 0, 1/)
     118             :       CASE (use_perd_xy)
     119          16 :          params%periodic = (/1, 1, 0/)
     120             :       CASE (use_perd_xz)
     121           8 :          params%periodic = (/1, 0, 1/)
     122             :       CASE (use_perd_yz)
     123          16 :          params%periodic = (/0, 1, 1/)
     124             :       CASE (use_perd_xyz)
     125       74128 :          params%periodic = (/1, 1, 1/)
     126             :       CASE (use_perd_none)
     127        5608 :          params%periodic = (/0, 0, 0/)
     128             :       CASE DEFAULT
     129       19950 :          CPABORT("")
     130             :       END SELECT
     131             :       ! check for consistent use of periodicity (cell <-> Poisson solver)
     132             :       !CPPostcondition(ALL(perd == cell%perd),cp_fatal_level,routineP,failure)
     133             : 
     134       19950 :    END SUBROUTINE decode_periodic_green
     135             : 
     136             : ! **************************************************************************************************
     137             : !> \brief Helper routien for pw_poisson_read_parameters
     138             : !> \param periodic ...
     139             : !> \param params ...
     140             : !> \author Ole Schuett
     141             : ! **************************************************************************************************
     142         856 :    SUBROUTINE decode_periodic_wavelet(periodic, params)
     143             :       INTEGER, INTENT(IN)                                :: periodic
     144             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
     145             : 
     146         856 :       params%wavelet_special_dimension = 0
     147             : 
     148        1390 :       SELECT CASE (periodic)
     149             :       CASE (use_perd_none)
     150         534 :          params%wavelet_geocode = "F"
     151         534 :          params%wavelet_method = WAVELET0D
     152             :       CASE (use_perd_xz)
     153           2 :          params%wavelet_geocode = "S"
     154           2 :          params%wavelet_method = WAVELET2D
     155           2 :          params%wavelet_special_dimension = 2
     156             :       CASE (use_perd_xyz)
     157         320 :          params%wavelet_geocode = "P"
     158         320 :          params%wavelet_method = WAVELET3D
     159             :       CASE (use_perd_x, use_perd_y, use_perd_z, use_perd_xy, use_perd_yz)
     160           0 :          CPABORT("Poisson solver for this periodicity not yet implemented")
     161             :       CASE DEFAULT
     162         856 :          CPABORT("")
     163             :       END SELECT
     164             : 
     165         856 :    END SUBROUTINE decode_periodic_wavelet
     166             : 
     167             : ! **************************************************************************************************
     168             : !> \brief Reads the subsection IMPLICIT and initializes corresponding parameters in
     169             : !>        pw_poisson_parameter_type
     170             : !> \param poisson_section poisson section to be read from input
     171             : !> \param params poisson_env parameters
     172             : !> \par History
     173             : !>      08.2014 created [Hossein Bani-Hashemian]
     174             : !> \author Mohammad Hossein Bani-Hashemian
     175             : ! **************************************************************************************************
     176       41612 :    SUBROUTINE ps_implicit_read_parameters(poisson_section, params)
     177             :       TYPE(section_vals_type), POINTER                   :: poisson_section
     178             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
     179             : 
     180             :       LOGICAL                                            :: has_dielectric
     181             :       TYPE(section_vals_type), POINTER                   :: dbc_section, dielectric_section, &
     182             :                                                             ps_implicit_section
     183             : 
     184       20806 :       NULLIFY (ps_implicit_section, dielectric_section, dbc_section)
     185             : 
     186             :       ! parsing IMPLICIT subsection
     187       20806 :       ps_implicit_section => section_vals_get_subs_vals(poisson_section, "IMPLICIT")
     188             :       CALL section_vals_val_get(ps_implicit_section, "BOUNDARY_CONDITIONS", &
     189       20806 :                                 i_val=params%ps_implicit_params%boundary_condition)
     190             :       CALL section_vals_val_get(ps_implicit_section, "ZERO_INITIAL_GUESS", &
     191       20806 :                                 l_val=params%ps_implicit_params%zero_initial_guess)
     192       20806 :       CALL section_vals_val_get(ps_implicit_section, "max_iter", i_val=params%ps_implicit_params%max_iter)
     193       20806 :       CALL section_vals_val_get(ps_implicit_section, "tol", r_val=params%ps_implicit_params%tol)
     194       20806 :       CALL section_vals_val_get(ps_implicit_section, "omega", r_val=params%ps_implicit_params%omega)
     195             :       CALL section_vals_val_get(ps_implicit_section, "neumann_directions", &
     196       20806 :                                 i_val=params%ps_implicit_params%neumann_directions)
     197             : 
     198             :       ! parsing DIELECTRIC subsection
     199       20806 :       dielectric_section => section_vals_get_subs_vals(ps_implicit_section, "DIELECTRIC")
     200       20806 :       CALL section_vals_get(dielectric_section, explicit=has_dielectric)
     201       20806 :       params%has_dielectric = has_dielectric
     202       20806 :       CALL dielectric_read_parameters(dielectric_section, params)
     203             : 
     204             :       ! parsing DIRICHLET_BC subsection
     205       20806 :       dbc_section => section_vals_get_subs_vals(ps_implicit_section, "DIRICHLET_BC")
     206       20806 :       CALL dirichlet_bc_read_parameters(dbc_section, params)
     207             : 
     208       20806 :    END SUBROUTINE ps_implicit_read_parameters
     209             : 
     210             : ! **************************************************************************************************
     211             : !> \brief Reads the subsection DIELECTRIC and initializes corresponding parameters in
     212             : !>        pw_poisson_parameter_type
     213             : !> \param dielectric_section dielectric section to be read from input
     214             : !> \param params poisson_env parameters
     215             : !> \par History
     216             : !>      07.2015 created [Hossein Bani-Hashemian]
     217             : !> \author Mohammad Hossein Bani-Hashemian
     218             : ! **************************************************************************************************
     219       62418 :    SUBROUTINE dielectric_read_parameters(dielectric_section, params)
     220             :       TYPE(section_vals_type), POINTER                   :: dielectric_section
     221             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
     222             : 
     223             :       INTEGER                                            :: i, n_aac_rep, n_xaaa_rep
     224             :       LOGICAL                                            :: aa_cuboidal_explicit, &
     225             :                                                             xaa_annular_explicit
     226             :       REAL(dp)                                           :: eps, zeta
     227       20806 :       REAL(dp), DIMENSION(:), POINTER :: aa_cuboidal_xxtnt, aa_cuboidal_yxtnt, aa_cuboidal_zxtnt, &
     228       20806 :          xaa_annular_bctr, xaa_annular_brad, xaa_annular_xxtnt
     229             :       TYPE(section_vals_type), POINTER                   :: aa_cuboidal_section, xaa_annular_section
     230             : 
     231             :       CALL section_vals_val_get(dielectric_section, "DIELECTRIC_CORE_CORRECTION", &
     232       20806 :                                 l_val=params%dielectric_params%dielec_core_correction)
     233             :       CALL section_vals_val_get(dielectric_section, "DIELECTRIC_FUNCTION_TYPE", &
     234       20806 :                                 i_val=params%dielectric_params%dielec_functiontype)
     235       20806 :       CALL section_vals_val_get(dielectric_section, "epsilon", r_val=params%dielectric_params%eps0)
     236       20806 :       CALL section_vals_val_get(dielectric_section, "rho_min", r_val=params%dielectric_params%rho_min)
     237       20806 :       CALL section_vals_val_get(dielectric_section, "rho_max", r_val=params%dielectric_params%rho_max)
     238             :       CALL section_vals_val_get(dielectric_section, "DERIVATIVE_METHOD", &
     239       20806 :                                 i_val=params%dielectric_params%derivative_method)
     240             : 
     241       20806 :       aa_cuboidal_section => section_vals_get_subs_vals(dielectric_section, "DIELEC_AA_CUBOIDAL")
     242       20806 :       xaa_annular_section => section_vals_get_subs_vals(dielectric_section, "DIELEC_XAA_ANNULAR")
     243       20806 :       CALL section_vals_get(aa_cuboidal_section, explicit=aa_cuboidal_explicit, n_repetition=n_aac_rep)
     244       20806 :       CALL section_vals_get(xaa_annular_section, explicit=xaa_annular_explicit, n_repetition=n_xaaa_rep)
     245             : 
     246       20806 :       IF (params%solver .EQ. pw_poisson_implicit) THEN
     247             : 
     248          54 :          IF (aa_cuboidal_explicit) THEN
     249           2 :             params%dielectric_params%n_aa_cuboidal = n_aac_rep
     250             :             ALLOCATE (params%dielectric_params%aa_cuboidal_xxtnt(2, n_aac_rep), &
     251             :                       params%dielectric_params%aa_cuboidal_yxtnt(2, n_aac_rep), &
     252             :                       params%dielectric_params%aa_cuboidal_zxtnt(2, n_aac_rep), &
     253             :                       params%dielectric_params%aa_cuboidal_eps(n_aac_rep), &
     254          22 :                       params%dielectric_params%aa_cuboidal_zeta(n_aac_rep))
     255           2 :             NULLIFY (aa_cuboidal_xxtnt, aa_cuboidal_yxtnt, aa_cuboidal_zxtnt)
     256           4 :             DO i = 1, n_aac_rep
     257           2 :                CALL section_vals_val_get(aa_cuboidal_section, "epsilon", i_rep_section=i, r_val=eps)
     258           2 :                CALL section_vals_val_get(aa_cuboidal_section, "zeta", i_rep_section=i, r_val=zeta)
     259           2 :                CALL section_vals_val_get(aa_cuboidal_section, "X_xtnt", i_rep_section=i, r_vals=aa_cuboidal_xxtnt)
     260           2 :                CALL section_vals_val_get(aa_cuboidal_section, "Y_xtnt", i_rep_section=i, r_vals=aa_cuboidal_yxtnt)
     261           2 :                CALL section_vals_val_get(aa_cuboidal_section, "Z_xtnt", i_rep_section=i, r_vals=aa_cuboidal_zxtnt)
     262           2 :                params%dielectric_params%aa_cuboidal_eps(i) = eps
     263           2 :                params%dielectric_params%aa_cuboidal_zeta(i) = zeta
     264           6 :                params%dielectric_params%aa_cuboidal_xxtnt(:, i) = aa_cuboidal_xxtnt
     265           6 :                params%dielectric_params%aa_cuboidal_yxtnt(:, i) = aa_cuboidal_yxtnt
     266          10 :                params%dielectric_params%aa_cuboidal_zxtnt(:, i) = aa_cuboidal_zxtnt
     267             :             END DO
     268             :          ELSE
     269          52 :             params%dielectric_params%n_aa_cuboidal = 0
     270             :          END IF
     271             : 
     272          54 :          IF (xaa_annular_explicit) THEN
     273           4 :             params%dielectric_params%n_xaa_annular = n_xaaa_rep
     274             :             ALLOCATE (params%dielectric_params%xaa_annular_xxtnt(2, n_xaaa_rep), &
     275             :                       params%dielectric_params%xaa_annular_bctr(2, n_xaaa_rep), &
     276             :                       params%dielectric_params%xaa_annular_brad(2, n_xaaa_rep), &
     277             :                       params%dielectric_params%xaa_annular_eps(n_xaaa_rep), &
     278          44 :                       params%dielectric_params%xaa_annular_zeta(n_xaaa_rep))
     279           4 :             NULLIFY (xaa_annular_xxtnt, xaa_annular_bctr, xaa_annular_brad)
     280           8 :             DO i = 1, n_xaaa_rep
     281           4 :                CALL section_vals_val_get(xaa_annular_section, "epsilon", i_rep_section=i, r_val=eps)
     282           4 :                CALL section_vals_val_get(xaa_annular_section, "zeta", i_rep_section=i, r_val=zeta)
     283           4 :                CALL section_vals_val_get(xaa_annular_section, "X_xtnt", i_rep_section=i, r_vals=xaa_annular_xxtnt)
     284           4 :                CALL section_vals_val_get(xaa_annular_section, "BASE_CENTER", i_rep_section=i, r_vals=xaa_annular_bctr)
     285           4 :                CALL section_vals_val_get(xaa_annular_section, "BASE_RADII", i_rep_section=i, r_vals=xaa_annular_brad)
     286           4 :                params%dielectric_params%xaa_annular_eps(i) = eps
     287           4 :                params%dielectric_params%xaa_annular_zeta(i) = zeta
     288          12 :                params%dielectric_params%xaa_annular_xxtnt(:, i) = xaa_annular_xxtnt
     289          12 :                params%dielectric_params%xaa_annular_bctr(:, i) = xaa_annular_bctr
     290          20 :                params%dielectric_params%xaa_annular_brad(:, i) = xaa_annular_brad
     291             :             END DO
     292             :          ELSE
     293          50 :             params%dielectric_params%n_xaa_annular = 0
     294             :          END IF
     295             : 
     296             :       END IF
     297             : 
     298       20806 :    END SUBROUTINE dielectric_read_parameters
     299             : 
     300             : ! **************************************************************************************************
     301             : !> \brief Reads the subsection DIRICHLET_BC and initializes corresponding parameters in
     302             : !>        pw_poisson_parameter_type
     303             : !> \param dbc_section dirichlet_bc section to be read from input
     304             : !> \param params poisson_env parameters
     305             : !> \par History
     306             : !>      08.2014 created [Hossein Bani-Hashemian]
     307             : !>      07.2015 refactored [Hossein Bani-Hashemian]
     308             : !>      10.2015 revised [Hossein Bani-Hashemian]
     309             : !> \author Mohammad Hossein Bani-Hashemian
     310             : ! **************************************************************************************************
     311      104030 :    SUBROUTINE dirichlet_bc_read_parameters(dbc_section, params)
     312             :       TYPE(section_vals_type), POINTER                   :: dbc_section
     313             :       TYPE(pw_poisson_parameter_type), INTENT(INOUT)     :: params
     314             : 
     315             :       INTEGER :: aa_cylindrical_apxtyp, aa_cylindrical_nsides, i, n_aac_rep, n_aacyl_rep, &
     316             :          n_aap_rep, n_p_rep, parallel_axis, parallel_plane
     317       20806 :       INTEGER, DIMENSION(:), POINTER                     :: aa_cuboidal_nprtn, aa_cylindrical_nprtn, &
     318       20806 :                                                             aa_planar_nprtn, planar_nprtn
     319             :       LOGICAL                                            :: aa_cuboidal_explicit, &
     320             :                                                             aa_cylindrical_explicit, &
     321             :                                                             aa_planar_explicit, is_periodic, &
     322             :                                                             planar_explicit
     323             :       REAL(dp)                                           :: aa_cylindrical_brad, delta_alpha, freq, &
     324             :                                                             intercept, osc_frac, phase, sigma, &
     325             :                                                             thickness, v_D
     326       20806 :       REAL(dp), DIMENSION(:), POINTER :: aa_cuboidal_xxtnt, aa_cuboidal_yxtnt, aa_cuboidal_zxtnt, &
     327       20806 :          aa_cylindrical_bctr, aa_cylindrical_xtnt, aa_planar_xxtnt, aa_planar_yxtnt, &
     328       20806 :          aa_planar_zxtnt, planar_Avtx, planar_Bvtx, planar_Cvtx
     329             :       TYPE(section_vals_type), POINTER                   :: aa_cuboidal_section, &
     330             :                                                             aa_cylindrical_section, &
     331             :                                                             aa_planar_section, planar_section
     332             : 
     333       20806 :       CALL section_vals_val_get(dbc_section, "VERBOSE_OUTPUT", l_val=params%dbc_params%verbose_output)
     334       20806 :       aa_planar_section => section_vals_get_subs_vals(dbc_section, "AA_PLANAR")
     335       20806 :       planar_section => section_vals_get_subs_vals(dbc_section, "PLANAR")
     336       20806 :       aa_cylindrical_section => section_vals_get_subs_vals(dbc_section, "AA_CYLINDRICAL")
     337       20806 :       aa_cuboidal_section => section_vals_get_subs_vals(dbc_section, "AA_CUBOIDAL")
     338       20806 :       CALL section_vals_get(aa_planar_section, explicit=aa_planar_explicit, n_repetition=n_aap_rep)
     339       20806 :       CALL section_vals_get(planar_section, explicit=planar_explicit, n_repetition=n_p_rep)
     340       20806 :       CALL section_vals_get(aa_cylindrical_section, explicit=aa_cylindrical_explicit, n_repetition=n_aacyl_rep)
     341       20806 :       CALL section_vals_get(aa_cuboidal_section, explicit=aa_cuboidal_explicit, n_repetition=n_aac_rep)
     342             : 
     343       20806 :       IF (params%solver .EQ. pw_poisson_implicit) THEN
     344             : 
     345          54 :          IF (aa_planar_explicit) THEN
     346          16 :             params%dbc_params%n_aa_planar = n_aap_rep
     347             :             ALLOCATE (params%dbc_params%aa_planar_nprtn(3, n_aap_rep), &
     348             :                       params%dbc_params%aa_planar_pplane(n_aap_rep), &
     349             :                       params%dbc_params%aa_planar_xxtnt(2, n_aap_rep), &
     350             :                       params%dbc_params%aa_planar_yxtnt(2, n_aap_rep), &
     351             :                       params%dbc_params%aa_planar_zxtnt(2, n_aap_rep), &
     352             :                       params%dbc_params%aa_planar_vD(n_aap_rep), &
     353             :                       params%dbc_params%aa_planar_frequency(n_aap_rep), &
     354             :                       params%dbc_params%aa_planar_phase(n_aap_rep), &
     355             :                       params%dbc_params%aa_planar_osc_frac(n_aap_rep), &
     356             :                       params%dbc_params%aa_planar_sigma(n_aap_rep), &
     357             :                       params%dbc_params%aa_planar_thickness(n_aap_rep), &
     358         400 :                       params%dbc_params%aa_planar_is_periodic(n_aap_rep))
     359          16 :             NULLIFY (aa_planar_nprtn, aa_planar_xxtnt, aa_planar_yxtnt, aa_planar_zxtnt)
     360          40 :             DO i = 1, n_aap_rep
     361          24 :                CALL section_vals_val_get(aa_planar_section, "v_D", i_rep_section=i, r_val=v_D)
     362          24 :                CALL section_vals_val_get(aa_planar_section, "OSCILLATING_FRACTION", i_rep_section=i, r_val=osc_frac)
     363          24 :                CALL section_vals_val_get(aa_planar_section, "FREQUENCY", i_rep_section=i, r_val=freq)
     364          24 :                CALL section_vals_val_get(aa_planar_section, "PHASE", i_rep_section=i, r_val=phase)
     365          24 :                CALL section_vals_val_get(aa_planar_section, "SIGMA", i_rep_section=i, r_val=sigma)
     366          24 :                CALL section_vals_val_get(aa_planar_section, "THICKNESS", i_rep_section=i, r_val=thickness)
     367          24 :                CALL section_vals_val_get(aa_planar_section, "PERIODIC_REGION", i_rep_section=i, l_val=is_periodic)
     368          24 :                params%dbc_params%aa_planar_vD(i) = v_D
     369          24 :                params%dbc_params%aa_planar_frequency(i) = freq
     370          24 :                params%dbc_params%aa_planar_phase(i) = phase
     371          24 :                params%dbc_params%aa_planar_osc_frac(i) = osc_frac
     372          24 :                params%dbc_params%aa_planar_sigma(i) = sigma
     373          24 :                params%dbc_params%aa_planar_thickness(i) = thickness
     374          24 :                params%dbc_params%aa_planar_is_periodic(i) = is_periodic
     375             : 
     376          24 :                CALL section_vals_val_get(aa_planar_section, "PARALLEL_PLANE", i_rep_section=i, i_val=parallel_plane)
     377          24 :                CALL section_vals_val_get(aa_planar_section, "INTERCEPT", i_rep_section=i, r_val=intercept)
     378          40 :                SELECT CASE (parallel_plane)
     379             :                CASE (xy_plane)
     380           2 :                   params%dbc_params%aa_planar_pplane(i) = xy_plane
     381           2 :                   CALL section_vals_val_get(aa_planar_section, "X_xtnt", i_rep_section=i, r_vals=aa_planar_xxtnt)
     382           2 :                   CALL section_vals_val_get(aa_planar_section, "Y_xtnt", i_rep_section=i, r_vals=aa_planar_yxtnt)
     383           6 :                   params%dbc_params%aa_planar_xxtnt(:, i) = aa_planar_xxtnt
     384           6 :                   params%dbc_params%aa_planar_yxtnt(:, i) = aa_planar_yxtnt
     385           6 :                   params%dbc_params%aa_planar_zxtnt(:, i) = intercept
     386             : 
     387           2 :                   CALL section_vals_val_get(aa_planar_section, "N_PRTN", i_rep_section=i, i_vals=aa_planar_nprtn)
     388           2 :                   params%dbc_params%aa_planar_nprtn(1, i) = aa_planar_nprtn(1)
     389           2 :                   params%dbc_params%aa_planar_nprtn(2, i) = aa_planar_nprtn(2)
     390           2 :                   params%dbc_params%aa_planar_nprtn(3, i) = 1
     391             :                CASE (yz_plane)
     392          20 :                   params%dbc_params%aa_planar_pplane(i) = yz_plane
     393          20 :                   CALL section_vals_val_get(aa_planar_section, "Y_xtnt", i_rep_section=i, r_vals=aa_planar_yxtnt)
     394          20 :                   CALL section_vals_val_get(aa_planar_section, "Z_xtnt", i_rep_section=i, r_vals=aa_planar_zxtnt)
     395          60 :                   params%dbc_params%aa_planar_xxtnt(:, i) = intercept
     396          60 :                   params%dbc_params%aa_planar_yxtnt(:, i) = aa_planar_yxtnt
     397          60 :                   params%dbc_params%aa_planar_zxtnt(:, i) = aa_planar_zxtnt
     398             : 
     399          20 :                   CALL section_vals_val_get(aa_planar_section, "N_PRTN", i_rep_section=i, i_vals=aa_planar_nprtn)
     400          20 :                   params%dbc_params%aa_planar_nprtn(1, i) = 1
     401          20 :                   params%dbc_params%aa_planar_nprtn(2, i) = aa_planar_nprtn(1)
     402          20 :                   params%dbc_params%aa_planar_nprtn(3, i) = aa_planar_nprtn(2)
     403             :                CASE (xz_plane)
     404           2 :                   params%dbc_params%aa_planar_pplane(i) = xz_plane
     405           2 :                   CALL section_vals_val_get(aa_planar_section, "X_xtnt", i_rep_section=i, r_vals=aa_planar_xxtnt)
     406           2 :                   CALL section_vals_val_get(aa_planar_section, "Z_xtnt", i_rep_section=i, r_vals=aa_planar_zxtnt)
     407           6 :                   params%dbc_params%aa_planar_xxtnt(:, i) = aa_planar_xxtnt
     408           6 :                   params%dbc_params%aa_planar_yxtnt(:, i) = intercept
     409           6 :                   params%dbc_params%aa_planar_zxtnt(:, i) = aa_planar_zxtnt
     410             : 
     411           2 :                   CALL section_vals_val_get(aa_planar_section, "N_PRTN", i_rep_section=i, i_vals=aa_planar_nprtn)
     412           2 :                   params%dbc_params%aa_planar_nprtn(1, i) = aa_planar_nprtn(1)
     413           2 :                   params%dbc_params%aa_planar_nprtn(2, i) = 1
     414          26 :                   params%dbc_params%aa_planar_nprtn(3, i) = aa_planar_nprtn(2)
     415             :                END SELECT
     416             : 
     417             :             END DO
     418             :          ELSE
     419          38 :             params%dbc_params%n_aa_planar = 0
     420             :          END IF
     421             : 
     422          54 :          IF (planar_explicit) THEN
     423           6 :             params%dbc_params%n_planar = n_p_rep
     424             :             ALLOCATE (params%dbc_params%planar_nprtn(2, n_p_rep), &
     425             :                       params%dbc_params%planar_Avtx(3, n_p_rep), &
     426             :                       params%dbc_params%planar_Bvtx(3, n_p_rep), &
     427             :                       params%dbc_params%planar_Cvtx(3, n_p_rep), &
     428             :                       params%dbc_params%planar_vD(n_p_rep), &
     429             :                       params%dbc_params%planar_frequency(n_p_rep), &
     430             :                       params%dbc_params%planar_phase(n_p_rep), &
     431             :                       params%dbc_params%planar_osc_frac(n_p_rep), &
     432             :                       params%dbc_params%planar_sigma(n_p_rep), &
     433             :                       params%dbc_params%planar_thickness(n_p_rep), &
     434         138 :                       params%dbc_params%planar_is_periodic(n_p_rep))
     435           6 :             NULLIFY (planar_nprtn, planar_Avtx, planar_Bvtx, planar_Cvtx)
     436          12 :             DO i = 1, n_p_rep
     437           6 :                CALL section_vals_val_get(planar_section, "N_PRTN", i_rep_section=i, i_vals=planar_nprtn)
     438           6 :                CALL section_vals_val_get(planar_section, "A", i_rep_section=i, r_vals=planar_Avtx)
     439           6 :                CALL section_vals_val_get(planar_section, "B", i_rep_section=i, r_vals=planar_Bvtx)
     440           6 :                CALL section_vals_val_get(planar_section, "C", i_rep_section=i, r_vals=planar_Cvtx)
     441           6 :                CALL section_vals_val_get(planar_section, "v_D", i_rep_section=i, r_val=v_D)
     442           6 :                CALL section_vals_val_get(planar_section, "OSCILLATING_FRACTION", i_rep_section=i, r_val=osc_frac)
     443           6 :                CALL section_vals_val_get(planar_section, "FREQUENCY", i_rep_section=i, r_val=freq)
     444           6 :                CALL section_vals_val_get(planar_section, "PHASE", i_rep_section=i, r_val=phase)
     445           6 :                CALL section_vals_val_get(planar_section, "SIGMA", i_rep_section=i, r_val=sigma)
     446           6 :                CALL section_vals_val_get(planar_section, "THICKNESS", i_rep_section=i, r_val=thickness)
     447          18 :                params%dbc_params%planar_nprtn(:, i) = planar_nprtn
     448          24 :                params%dbc_params%planar_Avtx(:, i) = planar_Avtx
     449          24 :                params%dbc_params%planar_Bvtx(:, i) = planar_Bvtx
     450          24 :                params%dbc_params%planar_Cvtx(:, i) = planar_Cvtx
     451           6 :                params%dbc_params%planar_vD(i) = v_D
     452           6 :                params%dbc_params%planar_frequency(i) = freq
     453           6 :                params%dbc_params%planar_phase(i) = phase
     454           6 :                params%dbc_params%planar_osc_frac(i) = osc_frac
     455           6 :                params%dbc_params%planar_sigma(i) = sigma
     456           6 :                params%dbc_params%planar_thickness(i) = thickness
     457          18 :                params%dbc_params%planar_is_periodic(i) = .FALSE. ! periodic not yet implemented
     458             :             END DO
     459             :          ELSE
     460          48 :             params%dbc_params%n_planar = 0
     461             :          END IF
     462             : 
     463          54 :          IF (aa_cylindrical_explicit) THEN
     464          10 :             params%dbc_params%n_aa_cylindrical = n_aacyl_rep
     465             :             ALLOCATE (params%dbc_params%aa_cylindrical_paxis(n_aacyl_rep), &
     466             :                       params%dbc_params%aa_cylindrical_nprtn(2, n_aacyl_rep), &
     467             :                       params%dbc_params%aa_cylindrical_nsides(n_aacyl_rep), &
     468             :                       params%dbc_params%aa_cylindrical_apxtyp(n_aacyl_rep), &
     469             :                       params%dbc_params%aa_cylindrical_xtnt(2, n_aacyl_rep), &
     470             :                       params%dbc_params%aa_cylindrical_bctr(2, n_aacyl_rep), &
     471             :                       params%dbc_params%aa_cylindrical_brad(n_aacyl_rep), &
     472             :                       params%dbc_params%aa_cylindrical_vD(n_aacyl_rep), &
     473             :                       params%dbc_params%aa_cylindrical_frequency(n_aacyl_rep), &
     474             :                       params%dbc_params%aa_cylindrical_phase(n_aacyl_rep), &
     475             :                       params%dbc_params%aa_cylindrical_osc_frac(n_aacyl_rep), &
     476             :                       params%dbc_params%aa_cylindrical_sigma(n_aacyl_rep), &
     477             :                       params%dbc_params%aa_cylindrical_thickness(n_aacyl_rep), &
     478             :                       params%dbc_params%aa_cylindrical_sgap(n_aacyl_rep), &
     479         310 :                       params%dbc_params%aa_cylindrical_is_periodic(n_aacyl_rep))
     480          10 :             NULLIFY (aa_cylindrical_nprtn, aa_cylindrical_xtnt, aa_cylindrical_bctr)
     481          22 :             DO i = 1, n_aacyl_rep
     482          12 :                CALL section_vals_val_get(aa_cylindrical_section, "PARALLEL_AXIS", i_rep_section=i, i_val=parallel_axis)
     483          12 :                CALL section_vals_val_get(aa_cylindrical_section, "N_PRTN", i_rep_section=i, i_vals=aa_cylindrical_nprtn)
     484          12 :                CALL section_vals_val_get(aa_cylindrical_section, "N_SIDES", i_rep_section=i, i_val=aa_cylindrical_nsides)
     485          12 :                CALL section_vals_val_get(aa_cylindrical_section, "APX_TYPE", i_rep_section=i, i_val=aa_cylindrical_apxtyp)
     486          12 :                CALL section_vals_val_get(aa_cylindrical_section, "xtnt", i_rep_section=i, r_vals=aa_cylindrical_xtnt)
     487          12 :                CALL section_vals_val_get(aa_cylindrical_section, "BASE_CENTER", i_rep_section=i, r_vals=aa_cylindrical_bctr)
     488          12 :                CALL section_vals_val_get(aa_cylindrical_section, "BASE_RADIUS", i_rep_section=i, r_val=aa_cylindrical_brad)
     489          12 :                CALL section_vals_val_get(aa_cylindrical_section, "v_D", i_rep_section=i, r_val=v_D)
     490          12 :                CALL section_vals_val_get(aa_cylindrical_section, "OSCILLATING_FRACTION", i_rep_section=i, r_val=osc_frac)
     491          12 :                CALL section_vals_val_get(aa_cylindrical_section, "FREQUENCY", i_rep_section=i, r_val=freq)
     492          12 :                CALL section_vals_val_get(aa_cylindrical_section, "PHASE", i_rep_section=i, r_val=phase)
     493          12 :                CALL section_vals_val_get(aa_cylindrical_section, "SIGMA", i_rep_section=i, r_val=sigma)
     494          12 :                CALL section_vals_val_get(aa_cylindrical_section, "THICKNESS", i_rep_section=i, r_val=thickness)
     495          12 :                CALL section_vals_val_get(aa_cylindrical_section, "delta_alpha", i_rep_section=i, r_val=delta_alpha)
     496          12 :                params%dbc_params%aa_cylindrical_paxis(i) = parallel_axis
     497          36 :                params%dbc_params%aa_cylindrical_nprtn(:, i) = aa_cylindrical_nprtn
     498          12 :                params%dbc_params%aa_cylindrical_nsides(i) = aa_cylindrical_nsides
     499          12 :                params%dbc_params%aa_cylindrical_apxtyp(i) = aa_cylindrical_apxtyp
     500          36 :                params%dbc_params%aa_cylindrical_xtnt(:, i) = aa_cylindrical_xtnt
     501          36 :                params%dbc_params%aa_cylindrical_bctr(:, i) = aa_cylindrical_bctr
     502          12 :                params%dbc_params%aa_cylindrical_brad(i) = aa_cylindrical_brad
     503          12 :                params%dbc_params%aa_cylindrical_vD(i) = v_D
     504          12 :                params%dbc_params%aa_cylindrical_frequency(i) = freq
     505          12 :                params%dbc_params%aa_cylindrical_phase(i) = phase
     506          12 :                params%dbc_params%aa_cylindrical_osc_frac(i) = osc_frac
     507          12 :                params%dbc_params%aa_cylindrical_sigma(i) = sigma
     508          12 :                params%dbc_params%aa_cylindrical_thickness(i) = thickness
     509          12 :                params%dbc_params%aa_cylindrical_sgap(i) = delta_alpha
     510          58 :                params%dbc_params%aa_cylindrical_is_periodic(i) = .FALSE. ! periodic not yet implemented
     511             :             END DO
     512             :          ELSE
     513          44 :             params%dbc_params%n_aa_cylindrical = 0
     514          88 :             ALLOCATE (params%dbc_params%aa_cylindrical_nsides(n_aacyl_rep))
     515             :          END IF
     516             : 
     517          54 :          IF (aa_cuboidal_explicit) THEN
     518           6 :             params%dbc_params%n_aa_cuboidal = n_aac_rep
     519             :             ALLOCATE (params%dbc_params%aa_cuboidal_nprtn(3, n_aac_rep), &
     520             :                       params%dbc_params%aa_cuboidal_xxtnt(2, n_aac_rep), &
     521             :                       params%dbc_params%aa_cuboidal_yxtnt(2, n_aac_rep), &
     522             :                       params%dbc_params%aa_cuboidal_zxtnt(2, n_aac_rep), &
     523             :                       params%dbc_params%aa_cuboidal_vD(n_aac_rep), &
     524             :                       params%dbc_params%aa_cuboidal_frequency(n_aac_rep), &
     525             :                       params%dbc_params%aa_cuboidal_phase(n_aac_rep), &
     526             :                       params%dbc_params%aa_cuboidal_osc_frac(n_aac_rep), &
     527             :                       params%dbc_params%aa_cuboidal_sigma(n_aac_rep), &
     528         126 :                       params%dbc_params%aa_cuboidal_is_periodic(n_aac_rep))
     529           6 :             NULLIFY (aa_cuboidal_nprtn, aa_cuboidal_xxtnt, aa_cuboidal_yxtnt, aa_cuboidal_zxtnt)
     530          12 :             DO i = 1, n_aac_rep
     531           6 :                CALL section_vals_val_get(aa_cuboidal_section, "N_PRTN", i_rep_section=i, i_vals=aa_cuboidal_nprtn)
     532           6 :                CALL section_vals_val_get(aa_cuboidal_section, "X_xtnt", i_rep_section=i, r_vals=aa_cuboidal_xxtnt)
     533           6 :                CALL section_vals_val_get(aa_cuboidal_section, "Y_xtnt", i_rep_section=i, r_vals=aa_cuboidal_yxtnt)
     534           6 :                CALL section_vals_val_get(aa_cuboidal_section, "Z_xtnt", i_rep_section=i, r_vals=aa_cuboidal_zxtnt)
     535           6 :                CALL section_vals_val_get(aa_cuboidal_section, "v_D", i_rep_section=i, r_val=v_D)
     536           6 :                CALL section_vals_val_get(aa_cuboidal_section, "OSCILLATING_FRACTION", i_rep_section=i, r_val=osc_frac)
     537           6 :                CALL section_vals_val_get(aa_cuboidal_section, "FREQUENCY", i_rep_section=i, r_val=freq)
     538           6 :                CALL section_vals_val_get(aa_cuboidal_section, "PHASE", i_rep_section=i, r_val=phase)
     539           6 :                CALL section_vals_val_get(aa_cuboidal_section, "SIGMA", i_rep_section=i, r_val=sigma)
     540           6 :                CALL section_vals_val_get(aa_cuboidal_section, "PERIODIC_REGION", i_rep_section=i, l_val=is_periodic)
     541          24 :                params%dbc_params%aa_cuboidal_nprtn(:, i) = aa_cuboidal_nprtn
     542          18 :                params%dbc_params%aa_cuboidal_xxtnt(:, i) = aa_cuboidal_xxtnt
     543          18 :                params%dbc_params%aa_cuboidal_yxtnt(:, i) = aa_cuboidal_yxtnt
     544          18 :                params%dbc_params%aa_cuboidal_zxtnt(:, i) = aa_cuboidal_zxtnt
     545           6 :                params%dbc_params%aa_cuboidal_vD(i) = v_D
     546           6 :                params%dbc_params%aa_cuboidal_frequency(i) = freq
     547           6 :                params%dbc_params%aa_cuboidal_phase(i) = phase
     548           6 :                params%dbc_params%aa_cuboidal_osc_frac(i) = osc_frac
     549           6 :                params%dbc_params%aa_cuboidal_sigma(i) = sigma
     550          18 :                params%dbc_params%aa_cuboidal_is_periodic(i) = is_periodic
     551             :             END DO
     552             :          ELSE
     553          48 :             params%dbc_params%n_aa_cuboidal = 0
     554             :          END IF
     555             : 
     556             :       END IF
     557             : 
     558       20806 :    END SUBROUTINE dirichlet_bc_read_parameters
     559             : 
     560             : END MODULE pw_poisson_read_input

Generated by: LCOV version 1.15