LCOV - code coverage report
Current view: top level - src/hfxbase - hfx_contract_block.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:f515968) Lines: 11444 11714 97.7 %
Date: 2022-07-03 19:52:34 Functions: 431 433 99.5 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2022 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : ! **************************************************************************************************
       8             : !> \brief routines to contract density matrix blocks with the for center
       9             : !>        integrals to yield the Kohn-Sham matrix. The specialized routines
      10             : !>        are about 1.2-2.0 as fast as the default one.
      11             : !> \par History
      12             : !>      10.2009 created [Joost VandeVondele]
      13             : !> \author Joost VandeVondele
      14             : ! **************************************************************************************************
      15             : MODULE hfx_contract_block
      16             :    USE kinds,                           ONLY: dp
      17             : #include "../base/base_uses.f90"
      18             : 
      19             :    IMPLICIT NONE
      20             :    PRIVATE
      21             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'hfx_contract_block'
      22             :    PUBLIC :: contract_block
      23             : CONTAINS
      24             : ! **************************************************************************************************
      25             : !> \brief ...
      26             : !> \param ma_max ...
      27             : !> \param mb_max ...
      28             : !> \param mc_max ...
      29             : !> \param md_max ...
      30             : !> \param kbd ...
      31             : !> \param kbc ...
      32             : !> \param kad ...
      33             : !> \param kac ...
      34             : !> \param pbd ...
      35             : !> \param pbc ...
      36             : !> \param pad ...
      37             : !> \param pac ...
      38             : !> \param prim ...
      39             : !> \param scale ...
      40             : ! **************************************************************************************************
      41    52365206 :    SUBROUTINE contract_block(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      42             :       INTEGER                                  :: ma_max, mb_max, mc_max, md_max
      43             :       REAL(KIND=dp) :: kbd(mb_max*md_max), kbc(mb_max*mc_max), &
      44             :                        kad(ma_max*md_max), kac(ma_max*mc_max), pbd(mb_max*md_max), &
      45             :                        pbc(mb_max*mc_max), pad(ma_max*md_max), pac(ma_max*mc_max), &
      46             :                        prim(ma_max*mb_max*mc_max*md_max), scale
      47             : 
      48             : #if !defined (__LIBINT)
      49             :       MARK_USED(ma_max)
      50             :       MARK_USED(mb_max)
      51             :       MARK_USED(mc_max)
      52             :       MARK_USED(md_max)
      53             :       MARK_USED(kbd)
      54             :       MARK_USED(kbc)
      55             :       MARK_USED(kad)
      56             :       MARK_USED(kac)
      57             :       MARK_USED(pbd)
      58             :       MARK_USED(pbc)
      59             :       MARK_USED(pad)
      60             :       MARK_USED(pac)
      61             :       MARK_USED(prim)
      62             :       MARK_USED(scale)
      63             :       CPABORT("libint not compiled in")
      64             : #else
      65    29164985 :       SELECT CASE (ma_max)
      66             :       CASE (1)
      67    22300710 :          SELECT CASE (mb_max)
      68             :          CASE (1)
      69    11287546 :             SELECT CASE (mc_max)
      70             :             CASE (1)
      71     8201082 :                SELECT CASE (md_max)
      72             :                CASE (1)
      73     8117581 :                   CALL block_1_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      74             :                CASE (2)
      75       10391 :                   CALL block_1_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      76             :                CASE (3)
      77     2755976 :                   CALL block_1_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      78             :                CASE (4)
      79      156414 :                   CALL block_1_1_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      80             :                CASE (5)
      81      193142 :                   CALL block_1_1_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      82             :                CASE (6)
      83          11 :                   CALL block_1_1_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      84             :                CASE (7)
      85       23226 :                   CALL block_1_1_1_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      86             :                CASE (9)
      87          10 :                   CALL block_1_1_1_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      88             :                CASE (10)
      89           9 :                   CALL block_1_1_1_10(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      90             :                CASE (11)
      91           9 :                   CALL block_1_1_1_11(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      92             :                CASE (15)
      93          10 :                   CALL block_1_1_1_15(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      94             :                CASE DEFAULT
      95    11256779 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
      96             :                END SELECT
      97             :             CASE (2)
      98     7789161 :                SELECT CASE (md_max)
      99             :                CASE (1)
     100       35441 :                   CALL block_1_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     101             :                CASE (2)
     102        5028 :                   CALL block_1_1_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     103             :                CASE (3)
     104       31999 :                   CALL block_1_1_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     105             :                CASE (4)
     106           7 :                   CALL block_1_1_2_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     107             :                CASE (5)
     108       10255 :                   CALL block_1_1_2_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     109             :                CASE (6)
     110           8 :                   CALL block_1_1_2_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     111             :                CASE (7)
     112         742 :                   CALL block_1_1_2_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     113             :                CASE (9)
     114           6 :                   CALL block_1_1_2_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     115             :                CASE (10)
     116           5 :                   CALL block_1_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     117             :                CASE (11)
     118           4 :                   CALL block_1_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     119             :                CASE (15)
     120           6 :                   CALL block_1_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     121             :                CASE DEFAULT
     122       83501 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     123             :                END SELECT
     124             :             CASE (3)
     125     6564757 :                SELECT CASE (md_max)
     126             :                CASE (1)
     127     5072026 :                   CALL block_1_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     128             :                CASE (2)
     129       15297 :                   CALL block_1_1_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     130             :                CASE (3)
     131     2467850 :                   CALL block_1_1_3_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     132             :                CASE (4)
     133       39352 :                   CALL block_1_1_3_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     134             :                CASE (5)
     135      135264 :                   CALL block_1_1_3_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     136             :                CASE (6)
     137           7 :                   CALL block_1_1_3_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     138             :                CASE (7)
     139       23902 :                   CALL block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     140             :                CASE (9)
     141           6 :                   CALL block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     142             :                CASE (10)
     143           6 :                   CALL block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     144             :                CASE (11)
     145           5 :                   CALL block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     146             :                CASE (15)
     147           5 :                   CALL block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     148             :                CASE DEFAULT
     149     7753720 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     150             :                END SELECT
     151             :             CASE (4)
     152     1913637 :                SELECT CASE (md_max)
     153             :                CASE (1)
     154      709633 :                   CALL block_1_1_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     155             :                CASE (2)
     156           4 :                   CALL block_1_1_4_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     157             :                CASE (3)
     158      264088 :                   CALL block_1_1_4_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     159             :                CASE (4)
     160      362454 :                   CALL block_1_1_4_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     161             :                CASE (5)
     162      156345 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     163             :                CASE (6)
     164           7 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     165             :                CASE (7)
     166         183 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     167             :                CASE (9)
     168           5 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     169             :                CASE (10)
     170           5 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     171             :                CASE (11)
     172           3 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     173             :                CASE (15)
     174           4 :                   CALL block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     175             :                CASE DEFAULT
     176     1492731 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     177             :                END SELECT
     178             :             CASE (5)
     179      586515 :                SELECT CASE (md_max)
     180             :                CASE (1)
     181      586488 :                   CALL block_1_1_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     182             :                CASE (2)
     183       10248 :                   CALL block_1_1_5_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     184             :                CASE (3)
     185      305403 :                   CALL block_1_1_5_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     186             :                CASE (4)
     187      156150 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     188             :                CASE (5)
     189      134997 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     190             :                CASE (6)
     191           6 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     192             :                CASE (7)
     193       10698 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     194             :                CASE (9)
     195           4 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     196             :                CASE (10)
     197           4 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     198             :                CASE (11)
     199           3 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     200             :                CASE (15)
     201           3 :                   CALL block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     202             :                CASE DEFAULT
     203     1204004 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     204             :                END SELECT
     205             :             CASE (6)
     206      107670 :                SELECT CASE (md_max)
     207             :                CASE (1)
     208           5 :                   CALL block_1_1_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     209             :                CASE (2)
     210           1 :                   CALL block_1_1_6_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     211             :                CASE (3)
     212           1 :                   CALL block_1_1_6_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     213             :                CASE (4)
     214           1 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     215             :                CASE (5)
     216           1 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     217             :                CASE (6)
     218           6 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     219             :                CASE (7)
     220           2 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     221             :                CASE (9)
     222           2 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     223             :                CASE (10)
     224           3 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     225             :                CASE (11)
     226           2 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     227             :                CASE (15)
     228           3 :                   CALL block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     229             :                CASE DEFAULT
     230          27 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     231             :                END SELECT
     232             :             CASE (7)
     233       55613 :                SELECT CASE (md_max)
     234             :                CASE (1)
     235       55545 :                   CALL block_1_1_7_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     236             :                CASE (2)
     237         737 :                   CALL block_1_1_7_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     238             :                CASE (3)
     239       34715 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     240             :                CASE (4)
     241         178 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     242             :                CASE (5)
     243       10742 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     244             :                CASE (6)
     245           6 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     246             :                CASE (7)
     247        5698 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     248             :                CASE (9)
     249          12 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     250             :                CASE (10)
     251          11 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     252             :                CASE (11)
     253          11 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     254             :                CASE (15)
     255          10 :                   CALL block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     256             :                CASE DEFAULT
     257      107665 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     258             :                END SELECT
     259             :             CASE (9)
     260          65 :                SELECT CASE (md_max)
     261             :                CASE (1)
     262          10 :                   CALL block_1_1_9_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     263             :                CASE (2)
     264           1 :                   CALL block_1_1_9_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     265             :                CASE (3)
     266           1 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     267             :                CASE (4)
     268           1 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     269             :                CASE (5)
     270           4 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     271             :                CASE (6)
     272           3 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     273             :                CASE (7)
     274           5 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     275             :                CASE (9)
     276          14 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     277             :                CASE (10)
     278          10 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     279             :                CASE (11)
     280          10 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     281             :                CASE (15)
     282           9 :                   CALL block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     283             :                CASE DEFAULT
     284          68 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     285             :                END SELECT
     286             :             CASE (10)
     287          57 :                SELECT CASE (md_max)
     288             :                CASE (1)
     289           9 :                   CALL block_1_1_10_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     290             :                CASE (2)
     291           1 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     292             :                CASE (3)
     293           1 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     294             :                CASE (4)
     295           2 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     296             :                CASE (5)
     297           2 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     298             :                CASE (6)
     299           2 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     300             :                CASE (7)
     301           5 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     302             :                CASE (9)
     303           6 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     304             :                CASE (10)
     305          11 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     306             :                CASE (11)
     307           8 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     308             :                CASE (15)
     309           8 :                   CALL block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     310             :                CASE DEFAULT
     311          55 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     312             :                END SELECT
     313             :             CASE (11)
     314          57 :                SELECT CASE (md_max)
     315             :                CASE (1)
     316           9 :                   CALL block_1_1_11_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     317             :                CASE (2)
     318           1 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     319             :                CASE (3)
     320           2 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     321             :                CASE (4)
     322           2 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     323             :                CASE (5)
     324           2 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     325             :                CASE (6)
     326           2 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     327             :                CASE (7)
     328           5 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     329             :                CASE (9)
     330           4 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     331             :                CASE (10)
     332           4 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     333             :                CASE (11)
     334          10 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     335             :                CASE (15)
     336           7 :                   CALL block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     337             :                CASE DEFAULT
     338          48 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     339             :                END SELECT
     340             :             CASE (15)
     341          10 :                SELECT CASE (md_max)
     342             :                CASE (1)
     343          10 :                   CALL block_1_1_15_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     344             :                CASE (2)
     345           2 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     346             :                CASE (3)
     347           2 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     348             :                CASE (4)
     349           2 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     350             :                CASE (5)
     351           2 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     352             :                CASE (6)
     353           2 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     354             :                CASE (7)
     355           4 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     356             :                CASE (9)
     357           4 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     358             :                CASE (10)
     359           4 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     360             :                CASE (11)
     361           5 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     362             :                CASE (15)
     363          11 :                   CALL block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     364             :                CASE DEFAULT
     365          48 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     366             :                END SELECT
     367             :             CASE DEFAULT
     368    21898646 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     369             :             END SELECT
     370             :          CASE (2)
     371     6148390 :             SELECT CASE (mc_max)
     372             :             CASE (1)
     373        4665 :                SELECT CASE (md_max)
     374             :                CASE (1)
     375        1810 :                   CALL block_1_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     376             :                CASE (2)
     377         706 :                   CALL block_1_2_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     378             :                CASE (3)
     379        2409 :                   CALL block_1_2_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     380             :                CASE (4)
     381           4 :                   CALL block_1_2_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     382             :                CASE (5)
     383        1708 :                   CALL block_1_2_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     384             :                CASE (6)
     385           4 :                   CALL block_1_2_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     386             :                CASE (7)
     387         713 :                   CALL block_1_2_1_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     388             :                CASE (9)
     389           1 :                   CALL block_1_2_1_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     390             :                CASE (10)
     391           1 :                   CALL block_1_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     392             :                CASE (11)
     393           1 :                   CALL block_1_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     394             :                CASE (15)
     395           1 :                   CALL block_1_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     396             :                CASE DEFAULT
     397        7358 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     398             :                END SELECT
     399             :             CASE (2)
     400       10887 :                SELECT CASE (md_max)
     401             :                CASE (1)
     402         698 :                   CALL block_1_2_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     403             :                CASE (2)
     404         307 :                   CALL block_1_2_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     405             :                CASE (3)
     406         941 :                   CALL block_1_2_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     407             :                CASE (4)
     408           3 :                   CALL block_1_2_2_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     409             :                CASE (5)
     410         655 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     411             :                CASE (6)
     412           3 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     413             :                CASE (7)
     414         248 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     415             :                CASE (9)
     416           0 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     417             :                CASE (10)
     418           0 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     419             :                CASE (11)
     420           0 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     421             :                CASE (15)
     422           0 :                   CALL block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     423             :                CASE DEFAULT
     424        2855 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     425             :                END SELECT
     426             :             CASE (3)
     427        2418 :                SELECT CASE (md_max)
     428             :                CASE (1)
     429        2406 :                   CALL block_1_2_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     430             :                CASE (2)
     431         940 :                   CALL block_1_2_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     432             :                CASE (3)
     433        3509 :                   CALL block_1_2_3_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     434             :                CASE (4)
     435           4 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     436             :                CASE (5)
     437        2383 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     438             :                CASE (6)
     439           2 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     440             :                CASE (7)
     441         945 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     442             :                CASE (9)
     443           0 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     444             :                CASE (10)
     445           0 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     446             :                CASE (11)
     447           0 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     448             :                CASE (15)
     449           0 :                   CALL block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     450             :                CASE DEFAULT
     451       10189 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     452             :                END SELECT
     453             :             CASE (4)
     454        7231 :                SELECT CASE (md_max)
     455             :                CASE (1)
     456           2 :                   CALL block_1_2_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     457             :                CASE (2)
     458           2 :                   CALL block_1_2_4_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     459             :                CASE (3)
     460           1 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     461             :                CASE (4)
     462           4 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     463             :                CASE (5)
     464           2 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     465             :                CASE (6)
     466           1 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     467             :                CASE (7)
     468           0 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     469             :                CASE (9)
     470           0 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     471             :                CASE (10)
     472           0 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     473             :                CASE (11)
     474           0 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     475             :                CASE (15)
     476           0 :                   CALL block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     477             :                CASE DEFAULT
     478          12 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     479             :                END SELECT
     480             :             CASE (5)
     481        1708 :                SELECT CASE (md_max)
     482             :                CASE (1)
     483        1705 :                   CALL block_1_2_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     484             :                CASE (2)
     485         653 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     486             :                CASE (3)
     487        2381 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     488             :                CASE (4)
     489           0 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     490             :                CASE (5)
     491        1785 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     492             :                CASE (6)
     493           1 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     494             :                CASE (7)
     495         704 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     496             :                CASE (9)
     497           0 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     498             :                CASE (10)
     499           0 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     500             :                CASE (11)
     501           0 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     502             :                CASE (15)
     503           0 :                   CALL block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     504             :                CASE DEFAULT
     505        7229 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     506             :                END SELECT
     507             :             CASE (6)
     508        3098 :                SELECT CASE (md_max)
     509             :                CASE (1)
     510           1 :                   CALL block_1_2_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     511             :                CASE (2)
     512           1 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     513             :                CASE (3)
     514           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     515             :                CASE (4)
     516           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     517             :                CASE (5)
     518           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     519             :                CASE (6)
     520           1 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     521             :                CASE (7)
     522           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     523             :                CASE (9)
     524           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     525             :                CASE (10)
     526           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     527             :                CASE (11)
     528           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     529             :                CASE (15)
     530           0 :                   CALL block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     531             :                CASE DEFAULT
     532           3 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     533             :                END SELECT
     534             :             CASE (7)
     535         715 :                SELECT CASE (md_max)
     536             :                CASE (1)
     537         712 :                   CALL block_1_2_7_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     538             :                CASE (2)
     539         248 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     540             :                CASE (3)
     541         944 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     542             :                CASE (4)
     543           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     544             :                CASE (5)
     545         704 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     546             :                CASE (6)
     547           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     548             :                CASE (7)
     549         489 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     550             :                CASE (9)
     551           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     552             :                CASE (10)
     553           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     554             :                CASE (11)
     555           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     556             :                CASE (15)
     557           0 :                   CALL block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     558             :                CASE DEFAULT
     559        3097 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     560             :                END SELECT
     561             :             CASE (9)
     562           5 :                SELECT CASE (md_max)
     563             :                CASE (1)
     564           0 :                   CALL block_1_2_9_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     565             :                CASE (2)
     566           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     567             :                CASE (3)
     568           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     569             :                CASE (4)
     570           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     571             :                CASE (5)
     572           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     573             :                CASE (6)
     574           1 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     575             :                CASE (7)
     576           1 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     577             :                CASE (9)
     578           1 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     579             :                CASE (10)
     580           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     581             :                CASE (11)
     582           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     583             :                CASE (15)
     584           0 :                   CALL block_1_2_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     585             :                CASE DEFAULT
     586           3 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     587             :                END SELECT
     588             :             CASE (10)
     589           5 :                CALL block_1_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     590             :             CASE (11)
     591           7 :                CALL block_1_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     592             :             CASE (15)
     593           9 :                CALL block_1_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     594             :             CASE DEFAULT
     595       30767 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     596             :             END SELECT
     597             :          CASE (3)
     598     3192966 :             SELECT CASE (mc_max)
     599             :             CASE (1)
     600     1483733 :                SELECT CASE (md_max)
     601             :                CASE (1)
     602     1422702 :                   CALL block_1_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     603             :                CASE (2)
     604        8131 :                   CALL block_1_3_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     605             :                CASE (3)
     606     1078330 :                   CALL block_1_3_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     607             :                CASE (4)
     608       51899 :                   CALL block_1_3_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     609             :                CASE (5)
     610       89627 :                   CALL block_1_3_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     611             :                CASE (6)
     612           4 :                   CALL block_1_3_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     613             :                CASE (7)
     614       11913 :                   CALL block_1_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     615             :                CASE (9)
     616           1 :                   CALL block_1_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     617             :                CASE (10)
     618           1 :                   CALL block_1_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     619             :                CASE (11)
     620           1 :                   CALL block_1_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     621             :                CASE (15)
     622           1 :                   CALL block_1_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     623             :                CASE DEFAULT
     624     2662610 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     625             :                END SELECT
     626             :             CASE (2)
     627     2217228 :                SELECT CASE (md_max)
     628             :                CASE (1)
     629       24830 :                   CALL block_1_3_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     630             :                CASE (2)
     631        3861 :                   CALL block_1_3_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     632             :                CASE (3)
     633       23255 :                   CALL block_1_3_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     634             :                CASE (4)
     635           3 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     636             :                CASE (5)
     637        8103 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     638             :                CASE (6)
     639           3 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     640             :                CASE (7)
     641         976 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     642             :                CASE (9)
     643           0 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     644             :                CASE (10)
     645           0 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     646             :                CASE (11)
     647           0 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     648             :                CASE (15)
     649           0 :                   CALL block_1_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     650             :                CASE DEFAULT
     651       61031 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     652             :                END SELECT
     653             :             CASE (3)
     654     1738202 :                SELECT CASE (md_max)
     655             :                CASE (1)
     656     1130528 :                   CALL block_1_3_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     657             :                CASE (2)
     658       12117 :                   CALL block_1_3_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     659             :                CASE (3)
     660      950535 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     661             :                CASE (4)
     662       15399 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     663             :                CASE (5)
     664       70912 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     665             :                CASE (6)
     666           3 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     667             :                CASE (7)
     668       12904 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     669             :                CASE (9)
     670           0 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     671             :                CASE (10)
     672           0 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     673             :                CASE (11)
     674           0 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     675             :                CASE (15)
     676           0 :                   CALL block_1_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     677             :                CASE DEFAULT
     678     2192398 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     679             :                END SELECT
     680             :             CASE (4)
     681      840814 :                SELECT CASE (md_max)
     682             :                CASE (1)
     683      274135 :                   CALL block_1_3_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     684             :                CASE (2)
     685           1 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     686             :                CASE (3)
     687      125087 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     688             :                CASE (4)
     689      139197 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     690             :                CASE (5)
     691       69198 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     692             :                CASE (6)
     693           2 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     694             :                CASE (7)
     695          54 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     696             :                CASE (9)
     697           0 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     698             :                CASE (10)
     699           0 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     700             :                CASE (11)
     701           0 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     702             :                CASE (15)
     703           0 :                   CALL block_1_3_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     704             :                CASE DEFAULT
     705      607674 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     706             :                END SELECT
     707             :             CASE (5)
     708      257853 :                SELECT CASE (md_max)
     709             :                CASE (1)
     710      257849 :                   CALL block_1_3_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     711             :                CASE (2)
     712        8101 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     713             :                CASE (3)
     714      156408 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     715             :                CASE (4)
     716       69046 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     717             :                CASE (5)
     718       68742 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     719             :                CASE (6)
     720           1 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     721             :                CASE (7)
     722        6532 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     723             :                CASE (9)
     724           0 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     725             :                CASE (10)
     726           0 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     727             :                CASE (11)
     728           0 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     729             :                CASE (15)
     730           0 :                   CALL block_1_3_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     731             :                CASE DEFAULT
     732      566679 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     733             :                END SELECT
     734             :             CASE (6)
     735       50617 :                SELECT CASE (md_max)
     736             :                CASE (1)
     737           1 :                   CALL block_1_3_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     738             :                CASE (2)
     739           1 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     740             :                CASE (3)
     741           1 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     742             :                CASE (4)
     743           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     744             :                CASE (5)
     745           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     746             :                CASE (6)
     747           1 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     748             :                CASE (7)
     749           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     750             :                CASE (9)
     751           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     752             :                CASE (10)
     753           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     754             :                CASE (11)
     755           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     756             :                CASE (15)
     757           0 :                   CALL block_1_3_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     758             :                CASE DEFAULT
     759           4 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     760             :                END SELECT
     761             :             CASE (7)
     762       50616 :                CALL block_1_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     763             :             CASE (9)
     764           2 :                CALL block_1_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     765             :             CASE (10)
     766           4 :                CALL block_1_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     767             :             CASE (11)
     768           6 :                CALL block_1_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     769             :             CASE (15)
     770           8 :                CALL block_1_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     771             :             CASE DEFAULT
     772     6141032 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     773             :             END SELECT
     774             :          CASE (4)
     775      740983 :             SELECT CASE (mc_max)
     776             :             CASE (1)
     777      126059 :                SELECT CASE (md_max)
     778             :                CASE (1)
     779      126033 :                   CALL block_1_4_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     780             :                CASE (2)
     781           8 :                   CALL block_1_4_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     782             :                CASE (3)
     783       31034 :                   CALL block_1_4_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     784             :                CASE (4)
     785       61959 :                   CALL block_1_4_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     786             :                CASE (5)
     787       21733 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     788             :                CASE (6)
     789           4 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     790             :                CASE (7)
     791          97 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     792             :                CASE (9)
     793           1 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     794             :                CASE (10)
     795           1 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     796             :                CASE (11)
     797           1 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     798             :                CASE (15)
     799           1 :                   CALL block_1_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     800             :                CASE DEFAULT
     801      240872 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     802             :                END SELECT
     803             :             CASE (2)
     804       55914 :                SELECT CASE (md_max)
     805             :                CASE (1)
     806           2 :                   CALL block_1_4_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     807             :                CASE (2)
     808           8 :                   CALL block_1_4_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     809             :                CASE (3)
     810           7 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     811             :                CASE (4)
     812           3 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     813             :                CASE (5)
     814           3 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     815             :                CASE (6)
     816           3 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     817             :                CASE (7)
     818           0 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     819             :                CASE (9)
     820           0 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     821             :                CASE (10)
     822           0 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     823             :                CASE (11)
     824           0 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     825             :                CASE (15)
     826           0 :                   CALL block_1_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     827             :                CASE DEFAULT
     828          26 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     829             :                END SELECT
     830             :             CASE (3)
     831      202190 :                SELECT CASE (md_max)
     832             :                CASE (1)
     833       27218 :                   CALL block_1_4_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     834             :                CASE (2)
     835           3 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     836             :                CASE (3)
     837       11767 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     838             :                CASE (4)
     839       11199 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     840             :                CASE (5)
     841        5722 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     842             :                CASE (6)
     843           3 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     844             :                CASE (7)
     845           0 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     846             :                CASE (9)
     847           0 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     848             :                CASE (10)
     849           0 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     850             :                CASE (11)
     851           0 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     852             :                CASE (15)
     853           0 :                   CALL block_1_4_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     854             :                CASE DEFAULT
     855       55912 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     856             :                END SELECT
     857             :             CASE (4)
     858      122983 :                SELECT CASE (md_max)
     859             :                CASE (1)
     860       65294 :                   CALL block_1_4_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     861             :                CASE (2)
     862           1 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     863             :                CASE (3)
     864       16561 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     865             :                CASE (4)
     866       76123 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     867             :                CASE (5)
     868       16606 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     869             :                CASE (6)
     870           3 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     871             :                CASE (7)
     872         384 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     873             :                CASE (9)
     874           0 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     875             :                CASE (10)
     876           0 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     877             :                CASE (11)
     878           0 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     879             :                CASE (15)
     880           0 :                   CALL block_1_4_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     881             :                CASE DEFAULT
     882      174972 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     883             :                END SELECT
     884             :             CASE (5)
     885       57689 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     886             :             CASE (6)
     887           5 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     888             :             CASE (7)
     889         864 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     890             :             CASE (9)
     891           1 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     892             :             CASE (10)
     893           3 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     894             :             CASE (11)
     895           5 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     896             :             CASE (15)
     897           7 :                CALL block_1_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     898             :             CASE DEFAULT
     899      530356 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     900             :             END SELECT
     901             :          CASE (5)
     902      221182 :             SELECT CASE (mc_max)
     903             :             CASE (1)
     904      116583 :                SELECT CASE (md_max)
     905             :                CASE (1)
     906      109223 :                   CALL block_1_5_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     907             :                CASE (2)
     908        1713 :                   CALL block_1_5_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     909             :                CASE (3)
     910       54086 :                   CALL block_1_5_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     911             :                CASE (4)
     912       21750 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     913             :                CASE (5)
     914       30764 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     915             :                CASE (6)
     916           4 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     917             :                CASE (7)
     918        3442 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     919             :                CASE (9)
     920           2 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     921             :                CASE (10)
     922           1 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     923             :                CASE (11)
     924           1 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     925             :                CASE (15)
     926           1 :                   CALL block_1_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     927             :                CASE DEFAULT
     928      220987 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     929             :                END SELECT
     930             :             CASE (2)
     931      123747 :                SELECT CASE (md_max)
     932             :                CASE (1)
     933        1706 :                   CALL block_1_5_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     934             :                CASE (2)
     935         708 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     936             :                CASE (3)
     937        2403 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     938             :                CASE (4)
     939           7 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     940             :                CASE (5)
     941        1779 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     942             :                CASE (6)
     943           3 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     944             :                CASE (7)
     945         753 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     946             :                CASE (9)
     947           1 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     948             :                CASE (10)
     949           0 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     950             :                CASE (11)
     951           0 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     952             :                CASE (15)
     953           0 :                   CALL block_1_5_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     954             :                CASE DEFAULT
     955        7360 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     956             :                END SELECT
     957             :             CASE (3)
     958      108231 :                SELECT CASE (md_max)
     959             :                CASE (1)
     960       52079 :                   CALL block_1_5_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     961             :                CASE (2)
     962        2400 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     963             :                CASE (3)
     964       38042 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     965             :                CASE (4)
     966        5467 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     967             :                CASE (5)
     968       19919 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     969             :                CASE (6)
     970           4 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     971             :                CASE (7)
     972        4129 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     973             :                CASE (9)
     974           1 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     975             :                CASE (10)
     976           0 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     977             :                CASE (11)
     978           0 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     979             :                CASE (15)
     980           0 :                   CALL block_1_5_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     981             :                CASE DEFAULT
     982      122041 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     983             :                END SELECT
     984             :             CASE (4)
     985       56152 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     986             :             CASE (5)
     987       80151 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     988             :             CASE (6)
     989           7 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     990             :             CASE (7)
     991       13401 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     992             :             CASE (9)
     993           0 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     994             :             CASE (10)
     995           2 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     996             :             CASE (11)
     997           4 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
     998             :             CASE (15)
     999           6 :                CALL block_1_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1000             :             CASE DEFAULT
    1001      500111 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1002             :             END SELECT
    1003             :          CASE (6)
    1004       63185 :             SELECT CASE (mc_max)
    1005             :             CASE (1)
    1006          50 :                SELECT CASE (md_max)
    1007             :                CASE (1)
    1008          10 :                   CALL block_1_6_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1009             :                CASE (2)
    1010           9 :                   CALL block_1_6_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1011             :                CASE (3)
    1012           8 :                   CALL block_1_6_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1013             :                CASE (4)
    1014           8 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1015             :                CASE (5)
    1016           9 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1017             :                CASE (6)
    1018          10 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1019             :                CASE (7)
    1020           3 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1021             :                CASE (9)
    1022           2 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1023             :                CASE (10)
    1024           1 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1025             :                CASE (11)
    1026           1 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1027             :                CASE (15)
    1028           1 :                   CALL block_1_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1029             :                CASE DEFAULT
    1030          62 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1031             :                END SELECT
    1032             :             CASE (2)
    1033          40 :                SELECT CASE (md_max)
    1034             :                CASE (1)
    1035           2 :                   CALL block_1_6_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1036             :                CASE (2)
    1037           9 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1038             :                CASE (3)
    1039           7 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1040             :                CASE (4)
    1041           8 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1042             :                CASE (5)
    1043           9 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1044             :                CASE (6)
    1045           3 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1046             :                CASE (7)
    1047           1 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1048             :                CASE (9)
    1049           1 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1050             :                CASE (10)
    1051           0 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1052             :                CASE (11)
    1053           0 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1054             :                CASE (15)
    1055           0 :                   CALL block_1_6_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1056             :                CASE DEFAULT
    1057          40 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1058             :                END SELECT
    1059             :             CASE (3)
    1060          25 :                SELECT CASE (md_max)
    1061             :                CASE (1)
    1062           3 :                   CALL block_1_6_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1063             :                CASE (2)
    1064           4 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1065             :                CASE (3)
    1066           9 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1067             :                CASE (4)
    1068           9 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1069             :                CASE (5)
    1070           5 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1071             :                CASE (6)
    1072           4 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1073             :                CASE (7)
    1074           2 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1075             :                CASE (9)
    1076           1 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1077             :                CASE (10)
    1078           0 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1079             :                CASE (11)
    1080           0 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1081             :                CASE (15)
    1082           1 :                   CALL block_1_6_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1083             :                CASE DEFAULT
    1084          38 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1085             :                END SELECT
    1086             :             CASE (4)
    1087          22 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1088             :             CASE (5)
    1089          13 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1090             :             CASE (6)
    1091           9 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1092             :             CASE (7)
    1093           2 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1094             :             CASE (9)
    1095           0 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1096             :             CASE (10)
    1097           1 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1098             :             CASE (11)
    1099           3 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1100             :             CASE (15)
    1101           5 :                CALL block_1_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1102             :             CASE DEFAULT
    1103         195 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1104             :             END SELECT
    1105             :          CASE (7)
    1106       17580 :             SELECT CASE (mc_max)
    1107             :             CASE (1)
    1108        8341 :                SELECT CASE (md_max)
    1109             :                CASE (1)
    1110        5221 :                   CALL block_1_7_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1111             :                CASE (2)
    1112         715 :                   CALL block_1_7_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1113             :                CASE (3)
    1114        5914 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1115             :                CASE (4)
    1116          98 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1117             :                CASE (5)
    1118        3442 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1119             :                CASE (6)
    1120           1 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1121             :                CASE (7)
    1122        2069 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1123             :                CASE (9)
    1124           1 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1125             :                CASE (10)
    1126           1 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1127             :                CASE (11)
    1128           1 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1129             :                CASE (15)
    1130           1 :                   CALL block_1_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1131             :                CASE DEFAULT
    1132       17464 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1133             :                END SELECT
    1134             :             CASE (2)
    1135       21125 :                SELECT CASE (md_max)
    1136             :                CASE (1)
    1137         712 :                   CALL block_1_7_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1138             :                CASE (2)
    1139         251 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1140             :                CASE (3)
    1141         961 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1142             :                CASE (4)
    1143           1 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1144             :                CASE (5)
    1145         706 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1146             :                CASE (6)
    1147           1 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1148             :                CASE (7)
    1149         488 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1150             :                CASE (9)
    1151           0 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1152             :                CASE (10)
    1153           0 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1154             :                CASE (11)
    1155           0 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1156             :                CASE (15)
    1157           0 :                   CALL block_1_7_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1158             :                CASE DEFAULT
    1159        3120 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1160             :                END SELECT
    1161             :             CASE (3)
    1162       20413 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1163             :             CASE (4)
    1164         869 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1165             :             CASE (5)
    1166       13176 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1167             :             CASE (6)
    1168           0 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1169             :             CASE (7)
    1170        8051 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1171             :             CASE (9)
    1172           9 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1173             :             CASE (10)
    1174           7 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1175             :             CASE (11)
    1176           7 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1177             :             CASE (15)
    1178           7 :                CALL block_1_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1179             :             CASE DEFAULT
    1180       63123 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1181             :             END SELECT
    1182             :          CASE (9)
    1183         250 :             SELECT CASE (mc_max)
    1184             :             CASE (1)
    1185          18 :                SELECT CASE (md_max)
    1186             :                CASE (1)
    1187           5 :                   CALL block_1_9_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1188             :                CASE (2)
    1189           3 :                   CALL block_1_9_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1190             :                CASE (3)
    1191           2 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1192             :                CASE (4)
    1193           2 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1194             :                CASE (5)
    1195           2 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1196             :                CASE (6)
    1197           2 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1198             :                CASE (7)
    1199           4 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1200             :                CASE (9)
    1201           5 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1202             :                CASE (10)
    1203           2 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1204             :                CASE (11)
    1205           1 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1206             :                CASE (15)
    1207           1 :                   CALL block_1_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1208             :                CASE DEFAULT
    1209          29 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1210             :                END SELECT
    1211             :             CASE (2)
    1212          18 :                SELECT CASE (md_max)
    1213             :                CASE (1)
    1214           0 :                   CALL block_1_9_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1215             :                CASE (2)
    1216           3 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1217             :                CASE (3)
    1218           1 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1219             :                CASE (4)
    1220           2 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1221             :                CASE (5)
    1222           2 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1223             :                CASE (6)
    1224           2 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1225             :                CASE (7)
    1226           3 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1227             :                CASE (9)
    1228           0 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1229             :                CASE (10)
    1230           0 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1231             :                CASE (11)
    1232           0 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1233             :                CASE (15)
    1234           0 :                   CALL block_1_9_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1235             :                CASE DEFAULT
    1236          13 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1237             :                END SELECT
    1238             :             CASE (3)
    1239          18 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1240             :             CASE (4)
    1241           8 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1242             :             CASE (5)
    1243           3 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1244             :             CASE (6)
    1245           0 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1246             :             CASE (7)
    1247          13 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1248             :             CASE (9)
    1249          10 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1250             :             CASE (10)
    1251           8 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1252             :             CASE (11)
    1253           7 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1254             :             CASE (15)
    1255           7 :                CALL block_1_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1256             :             CASE DEFAULT
    1257         116 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1258             :             END SELECT
    1259             :          CASE (10)
    1260         301 :             SELECT CASE (mc_max)
    1261             :             CASE (1)
    1262          36 :                SELECT CASE (md_max)
    1263             :                CASE (1)
    1264           9 :                   CALL block_1_10_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1265             :                CASE (2)
    1266           4 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1267             :                CASE (3)
    1268           2 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1269             :                CASE (4)
    1270           2 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1271             :                CASE (5)
    1272           4 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1273             :                CASE (6)
    1274           4 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1275             :                CASE (7)
    1276           5 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1277             :                CASE (9)
    1278           4 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1279             :                CASE (10)
    1280           7 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1281             :                CASE (11)
    1282           2 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1283             :                CASE (15)
    1284           3 :                   CALL block_1_10_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1285             :                CASE DEFAULT
    1286          46 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1287             :                END SELECT
    1288             :             CASE (2)
    1289          27 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1290             :             CASE (3)
    1291          35 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1292             :             CASE (4)
    1293          24 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1294             :             CASE (5)
    1295          10 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1296             :             CASE (6)
    1297           5 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1298             :             CASE (7)
    1299          27 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1300             :             CASE (9)
    1301          21 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1302             :             CASE (10)
    1303           9 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1304             :             CASE (11)
    1305           7 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1306             :             CASE (15)
    1307          10 :                CALL block_1_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1308             :             CASE DEFAULT
    1309         221 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1310             :             END SELECT
    1311             :          CASE (11)
    1312         215 :             SELECT CASE (mc_max)
    1313             :             CASE (1)
    1314          41 :                SELECT CASE (md_max)
    1315             :                CASE (1)
    1316           9 :                   CALL block_1_11_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1317             :                CASE (2)
    1318           4 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1319             :                CASE (3)
    1320           2 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1321             :                CASE (4)
    1322           2 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1323             :                CASE (5)
    1324           4 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1325             :                CASE (6)
    1326           4 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1327             :                CASE (7)
    1328           5 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1329             :                CASE (9)
    1330           5 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1331             :                CASE (10)
    1332           6 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1333             :                CASE (11)
    1334           7 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1335             :                CASE (15)
    1336           4 :                   CALL block_1_11_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1337             :                CASE DEFAULT
    1338          52 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1339             :                END SELECT
    1340             :             CASE (2)
    1341          32 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1342             :             CASE (3)
    1343          39 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1344             :             CASE (4)
    1345          29 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1346             :             CASE (5)
    1347          15 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1348             :             CASE (6)
    1349           5 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1350             :             CASE (7)
    1351          30 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1352             :             CASE (9)
    1353          23 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1354             :             CASE (10)
    1355          11 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1356             :             CASE (11)
    1357           8 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1358             :             CASE (15)
    1359          11 :                CALL block_1_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1360             :             CASE DEFAULT
    1361         255 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1362             :             END SELECT
    1363             :          CASE (15)
    1364          36 :             SELECT CASE (mc_max)
    1365             :             CASE (1)
    1366          25 :                SELECT CASE (md_max)
    1367             :                CASE (1)
    1368           5 :                   CALL block_1_15_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1369             :                CASE (2)
    1370           3 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1371             :                CASE (3)
    1372           2 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1373             :                CASE (4)
    1374           2 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1375             :                CASE (5)
    1376           3 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1377             :                CASE (6)
    1378           3 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1379             :                CASE (7)
    1380           4 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1381             :                CASE (9)
    1382           4 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1383             :                CASE (10)
    1384           3 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1385             :                CASE (11)
    1386           2 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1387             :                CASE (15)
    1388           5 :                   CALL block_1_15_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1389             :                CASE DEFAULT
    1390          36 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1391             :                END SELECT
    1392             :             CASE (2)
    1393          20 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1394             :             CASE (3)
    1395          25 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1396             :             CASE (4)
    1397          15 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1398             :             CASE (5)
    1399           7 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1400             :             CASE (6)
    1401           1 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1402             :             CASE (7)
    1403          19 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1404             :             CASE (9)
    1405          14 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1406             :             CASE (10)
    1407          10 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1408             :             CASE (11)
    1409           9 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1410             :             CASE (15)
    1411           7 :                CALL block_1_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1412             :             CASE DEFAULT
    1413         163 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1414             :             END SELECT
    1415             :          CASE DEFAULT
    1416    29164985 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1417             :          END SELECT
    1418             :       CASE (2)
    1419    15897056 :          SELECT CASE (mb_max)
    1420             :          CASE (1)
    1421      136812 :             SELECT CASE (mc_max)
    1422             :             CASE (1)
    1423       26986 :                SELECT CASE (md_max)
    1424             :                CASE (1)
    1425       14170 :                   CALL block_2_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1426             :                CASE (2)
    1427        1913 :                   CALL block_2_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1428             :                CASE (3)
    1429       12668 :                   CALL block_2_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1430             :                CASE (4)
    1431           4 :                   CALL block_2_1_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1432             :                CASE (5)
    1433        4061 :                   CALL block_2_1_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1434             :                CASE (6)
    1435           5 :                   CALL block_2_1_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1436             :                CASE (7)
    1437         716 :                   CALL block_2_1_1_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1438             :                CASE (9)
    1439           4 :                   CALL block_2_1_1_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1440             :                CASE (10)
    1441           3 :                   CALL block_2_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1442             :                CASE (11)
    1443           3 :                   CALL block_2_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1444             :                CASE (15)
    1445           4 :                   CALL block_2_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1446             :                CASE DEFAULT
    1447       33551 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1448             :                END SELECT
    1449             :             CASE (2)
    1450       49334 :                SELECT CASE (md_max)
    1451             :                CASE (1)
    1452        4991 :                   CALL block_2_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1453             :                CASE (2)
    1454         915 :                   CALL block_2_1_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1455             :                CASE (3)
    1456        4810 :                   CALL block_2_1_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1457             :                CASE (4)
    1458           3 :                   CALL block_2_1_2_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1459             :                CASE (5)
    1460        1832 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1461             :                CASE (6)
    1462           4 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1463             :                CASE (7)
    1464         251 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1465             :                CASE (9)
    1466           3 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1467             :                CASE (10)
    1468           2 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1469             :                CASE (11)
    1470           2 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1471             :                CASE (15)
    1472           3 :                   CALL block_2_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1473             :                CASE DEFAULT
    1474       12816 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1475             :                END SELECT
    1476             :             CASE (3)
    1477       17827 :                SELECT CASE (md_max)
    1478             :                CASE (1)
    1479       17798 :                   CALL block_2_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1480             :                CASE (2)
    1481        2759 :                   CALL block_2_1_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1482             :                CASE (3)
    1483       16799 :                   CALL block_2_1_3_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1484             :                CASE (4)
    1485           4 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1486             :                CASE (5)
    1487        6020 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1488             :                CASE (6)
    1489           4 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1490             :                CASE (7)
    1491         947 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1492             :                CASE (9)
    1493           3 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1494             :                CASE (10)
    1495           3 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1496             :                CASE (11)
    1497           3 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1498             :                CASE (15)
    1499           3 :                   CALL block_2_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1500             :                CASE DEFAULT
    1501       44343 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1502             :                END SELECT
    1503             :             CASE (4)
    1504       27094 :                SELECT CASE (md_max)
    1505             :                CASE (1)
    1506           3 :                   CALL block_2_1_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1507             :                CASE (2)
    1508           2 :                   CALL block_2_1_4_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1509             :                CASE (3)
    1510           1 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1511             :                CASE (4)
    1512           5 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1513             :                CASE (5)
    1514           3 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1515             :                CASE (6)
    1516           3 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1517             :                CASE (7)
    1518           3 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1519             :                CASE (9)
    1520           3 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1521             :                CASE (10)
    1522           3 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1523             :                CASE (11)
    1524           1 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1525             :                CASE (15)
    1526           2 :                   CALL block_2_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1527             :                CASE DEFAULT
    1528          29 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1529             :                END SELECT
    1530             :             CASE (5)
    1531       10224 :                SELECT CASE (md_max)
    1532             :                CASE (1)
    1533       10213 :                   CALL block_2_1_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1534             :                CASE (2)
    1535        1829 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1536             :                CASE (3)
    1537       10121 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1538             :                CASE (4)
    1539           2 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1540             :                CASE (5)
    1541        4212 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1542             :                CASE (6)
    1543           2 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1544             :                CASE (7)
    1545         706 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1546             :                CASE (9)
    1547           2 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1548             :                CASE (10)
    1549           2 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1550             :                CASE (11)
    1551           1 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1552             :                CASE (15)
    1553           1 :                   CALL block_2_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1554             :                CASE DEFAULT
    1555       27091 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1556             :                END SELECT
    1557             :             CASE (6)
    1558        3114 :                SELECT CASE (md_max)
    1559             :                CASE (1)
    1560           1 :                   CALL block_2_1_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1561             :                CASE (2)
    1562           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1563             :                CASE (3)
    1564           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1565             :                CASE (4)
    1566           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1567             :                CASE (5)
    1568           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1569             :                CASE (6)
    1570           3 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1571             :                CASE (7)
    1572           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1573             :                CASE (9)
    1574           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1575             :                CASE (10)
    1576           1 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1577             :                CASE (11)
    1578           0 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1579             :                CASE (15)
    1580           0 :                   CALL block_2_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1581             :                CASE DEFAULT
    1582          11 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1583             :                END SELECT
    1584             :             CASE (7)
    1585         724 :                SELECT CASE (md_max)
    1586             :                CASE (1)
    1587         713 :                   CALL block_2_1_7_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1588             :                CASE (2)
    1589         249 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1590             :                CASE (3)
    1591         945 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1592             :                CASE (4)
    1593           1 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1594             :                CASE (5)
    1595         706 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1596             :                CASE (6)
    1597           3 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1598             :                CASE (7)
    1599         492 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1600             :                CASE (9)
    1601           2 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1602             :                CASE (10)
    1603           1 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1604             :                CASE (11)
    1605           0 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1606             :                CASE (15)
    1607           1 :                   CALL block_2_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1608             :                CASE DEFAULT
    1609        3113 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1610             :                END SELECT
    1611             :             CASE (9)
    1612          10 :                SELECT CASE (md_max)
    1613             :                CASE (1)
    1614           1 :                   CALL block_2_1_9_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1615             :                CASE (2)
    1616           1 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1617             :                CASE (3)
    1618           1 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1619             :                CASE (4)
    1620           1 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1621             :                CASE (5)
    1622           2 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1623             :                CASE (6)
    1624           2 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1625             :                CASE (7)
    1626           1 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1627             :                CASE (9)
    1628           2 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1629             :                CASE (10)
    1630           0 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1631             :                CASE (11)
    1632           0 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1633             :                CASE (15)
    1634           0 :                   CALL block_2_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1635             :                CASE DEFAULT
    1636          11 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1637             :                END SELECT
    1638             :             CASE (10)
    1639           9 :                CALL block_2_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1640             :             CASE (11)
    1641          10 :                CALL block_2_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1642             :             CASE (15)
    1643          11 :                CALL block_2_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1644             :             CASE DEFAULT
    1645      120995 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1646             :             END SELECT
    1647             :          CASE (2)
    1648      135050 :             SELECT CASE (mc_max)
    1649             :             CASE (1)
    1650       21048 :                SELECT CASE (md_max)
    1651             :                CASE (1)
    1652         739 :                   CALL block_2_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1653             :                CASE (2)
    1654         314 :                   CALL block_2_2_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1655             :                CASE (3)
    1656         999 :                   CALL block_2_2_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1657             :                CASE (4)
    1658           4 :                   CALL block_2_2_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1659             :                CASE (5)
    1660         705 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1661             :                CASE (6)
    1662           4 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1663             :                CASE (7)
    1664         249 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1665             :                CASE (9)
    1666           1 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1667             :                CASE (10)
    1668           1 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1669             :                CASE (11)
    1670           1 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1671             :                CASE (15)
    1672           1 :                   CALL block_2_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1673             :                CASE DEFAULT
    1674        3018 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1675             :                END SELECT
    1676             :             CASE (2)
    1677       10254 :                SELECT CASE (md_max)
    1678             :                CASE (1)
    1679         306 :                   CALL block_2_2_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1680             :                CASE (2)
    1681       16359 :                   CALL block_2_2_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1682             :                CASE (3)
    1683        3269 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1684             :                CASE (4)
    1685           3 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1686             :                CASE (5)
    1687         289 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1688             :                CASE (6)
    1689           3 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1690             :                CASE (7)
    1691          80 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1692             :                CASE (9)
    1693           0 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1694             :                CASE (10)
    1695           0 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1696             :                CASE (11)
    1697           0 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1698             :                CASE (15)
    1699           0 :                   CALL block_2_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1700             :                CASE DEFAULT
    1701       20309 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1702             :                END SELECT
    1703             :             CASE (3)
    1704        1016 :                SELECT CASE (md_max)
    1705             :                CASE (1)
    1706         997 :                   CALL block_2_2_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1707             :                CASE (2)
    1708        3270 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1709             :                CASE (3)
    1710        4347 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1711             :                CASE (4)
    1712           4 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1713             :                CASE (5)
    1714         989 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1715             :                CASE (6)
    1716           3 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1717             :                CASE (7)
    1718         337 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1719             :                CASE (9)
    1720           1 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1721             :                CASE (10)
    1722           0 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1723             :                CASE (11)
    1724           0 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1725             :                CASE (15)
    1726           0 :                   CALL block_2_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1727             :                CASE DEFAULT
    1728        9948 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1729             :                END SELECT
    1730             :             CASE (4)
    1731       35907 :                SELECT CASE (md_max)
    1732             :                CASE (1)
    1733           3 :                   CALL block_2_2_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1734             :                CASE (2)
    1735           3 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1736             :                CASE (3)
    1737           2 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1738             :                CASE (4)
    1739           5 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1740             :                CASE (5)
    1741           3 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1742             :                CASE (6)
    1743           2 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1744             :                CASE (7)
    1745           1 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1746             :                CASE (9)
    1747           0 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1748             :                CASE (10)
    1749           0 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1750             :                CASE (11)
    1751           0 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1752             :                CASE (15)
    1753           0 :                   CALL block_2_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1754             :                CASE DEFAULT
    1755          19 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1756             :                END SELECT
    1757             :             CASE (5)
    1758       35904 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1759             :             CASE (6)
    1760          10 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1761             :             CASE (7)
    1762        1071 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1763             :             CASE (9)
    1764           8 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1765             :             CASE (10)
    1766           9 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1767             :             CASE (11)
    1768          10 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1769             :             CASE (15)
    1770          11 :                CALL block_2_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1771             :             CASE DEFAULT
    1772      103261 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1773             :             END SELECT
    1774             :          CASE (3)
    1775       27913 :             SELECT CASE (mc_max)
    1776             :             CASE (1)
    1777       27147 :                SELECT CASE (md_max)
    1778             :                CASE (1)
    1779       10667 :                   CALL block_2_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1780             :                CASE (2)
    1781        1753 :                   CALL block_2_3_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1782             :                CASE (3)
    1783       10383 :                   CALL block_2_3_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1784             :                CASE (4)
    1785           3 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1786             :                CASE (5)
    1787        4015 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1788             :                CASE (6)
    1789           3 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1790             :                CASE (7)
    1791         960 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1792             :                CASE (9)
    1793           0 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1794             :                CASE (10)
    1795           0 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1796             :                CASE (11)
    1797           0 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1798             :                CASE (15)
    1799           0 :                   CALL block_2_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1800             :                CASE DEFAULT
    1801       27784 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1802             :                END SELECT
    1803             :             CASE (2)
    1804       46819 :                SELECT CASE (md_max)
    1805             :                CASE (1)
    1806        3800 :                   CALL block_2_3_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1807             :                CASE (2)
    1808        3677 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1809             :                CASE (3)
    1810        6872 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1811             :                CASE (4)
    1812           3 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1813             :                CASE (5)
    1814        1781 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1815             :                CASE (6)
    1816           3 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1817             :                CASE (7)
    1818         344 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1819             :                CASE (9)
    1820           0 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1821             :                CASE (10)
    1822           0 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1823             :                CASE (11)
    1824           0 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1825             :                CASE (15)
    1826           0 :                   CALL block_2_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1827             :                CASE DEFAULT
    1828       16480 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1829             :                END SELECT
    1830             :             CASE (3)
    1831       13811 :                SELECT CASE (md_max)
    1832             :                CASE (1)
    1833       13798 :                   CALL block_2_3_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1834             :                CASE (2)
    1835        5499 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1836             :                CASE (3)
    1837       16449 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1838             :                CASE (4)
    1839           3 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1840             :                CASE (5)
    1841        5955 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1842             :                CASE (6)
    1843           3 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1844             :                CASE (7)
    1845        1312 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1846             :                CASE (9)
    1847           0 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1848             :                CASE (10)
    1849           0 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1850             :                CASE (11)
    1851           0 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1852             :                CASE (15)
    1853           0 :                   CALL block_2_3_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1854             :                CASE DEFAULT
    1855       43019 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1856             :                END SELECT
    1857             :             CASE (4)
    1858          13 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1859             :             CASE (5)
    1860       32031 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1861             :             CASE (6)
    1862           5 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1863             :             CASE (7)
    1864        4264 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1865             :             CASE (9)
    1866           0 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1867             :             CASE (10)
    1868           0 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1869             :             CASE (11)
    1870           0 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1871             :             CASE (15)
    1872           0 :                CALL block_2_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1873             :             CASE DEFAULT
    1874      132032 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1875             :             END SELECT
    1876             :          CASE (4)
    1877       30986 :             SELECT CASE (mc_max)
    1878             :             CASE (1)
    1879          40 :                SELECT CASE (md_max)
    1880             :                CASE (1)
    1881           8 :                   CALL block_2_4_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1882             :                CASE (2)
    1883           8 :                   CALL block_2_4_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1884             :                CASE (3)
    1885           8 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1886             :                CASE (4)
    1887           8 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1888             :                CASE (5)
    1889           4 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1890             :                CASE (6)
    1891           3 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1892             :                CASE (7)
    1893           1 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1894             :                CASE (9)
    1895           0 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1896             :                CASE (10)
    1897           0 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1898             :                CASE (11)
    1899           0 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1900             :                CASE (15)
    1901           0 :                   CALL block_2_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1902             :                CASE DEFAULT
    1903          40 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1904             :                END SELECT
    1905             :             CASE (2)
    1906          26 :                SELECT CASE (md_max)
    1907             :                CASE (1)
    1908           2 :                   CALL block_2_4_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1909             :                CASE (2)
    1910           8 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1911             :                CASE (3)
    1912           7 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1913             :                CASE (4)
    1914           8 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1915             :                CASE (5)
    1916           4 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1917             :                CASE (6)
    1918           3 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1919             :                CASE (7)
    1920           0 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1921             :                CASE (9)
    1922           0 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1923             :                CASE (10)
    1924           0 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1925             :                CASE (11)
    1926           0 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1927             :                CASE (15)
    1928           0 :                   CALL block_2_4_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1929             :                CASE DEFAULT
    1930          32 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1931             :                END SELECT
    1932             :             CASE (3)
    1933          24 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1934             :             CASE (4)
    1935          14 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1936             :             CASE (5)
    1937          12 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1938             :             CASE (6)
    1939           7 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1940             :             CASE (7)
    1941           0 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1942             :             CASE (9)
    1943           0 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1944             :             CASE (10)
    1945           0 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1946             :             CASE (11)
    1947           0 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1948             :             CASE (15)
    1949           0 :                CALL block_2_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1950             :             CASE DEFAULT
    1951         129 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1952             :             END SELECT
    1953             :          CASE (5)
    1954        7486 :             SELECT CASE (mc_max)
    1955             :             CASE (1)
    1956        4660 :                SELECT CASE (md_max)
    1957             :                CASE (1)
    1958        1729 :                   CALL block_2_5_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1959             :                CASE (2)
    1960         661 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1961             :                CASE (3)
    1962        2388 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1963             :                CASE (4)
    1964           8 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1965             :                CASE (5)
    1966        1785 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1967             :                CASE (6)
    1968           3 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1969             :                CASE (7)
    1970         705 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1971             :                CASE (9)
    1972           1 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1973             :                CASE (10)
    1974           0 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1975             :                CASE (11)
    1976           0 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1977             :                CASE (15)
    1978           0 :                   CALL block_2_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1979             :                CASE DEFAULT
    1980        7280 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1981             :                END SELECT
    1982             :             CASE (2)
    1983        2931 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1984             :             CASE (3)
    1985       10190 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1986             :             CASE (4)
    1987          22 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1988             :             CASE (5)
    1989        7392 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1990             :             CASE (6)
    1991           9 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1992             :             CASE (7)
    1993        3122 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1994             :             CASE (9)
    1995           0 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1996             :             CASE (10)
    1997           0 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    1998             :             CASE (11)
    1999           0 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2000             :             CASE (15)
    2001           0 :                CALL block_2_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2002             :             CASE DEFAULT
    2003       30946 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2004             :             END SELECT
    2005             :          CASE (6)
    2006       14103 :             SELECT CASE (mc_max)
    2007             :             CASE (1)
    2008          57 :                SELECT CASE (md_max)
    2009             :                CASE (1)
    2010          10 :                   CALL block_2_6_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2011             :                CASE (2)
    2012           9 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2013             :                CASE (3)
    2014           8 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2015             :                CASE (4)
    2016           8 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2017             :                CASE (5)
    2018           9 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2019             :                CASE (6)
    2020           9 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2021             :                CASE (7)
    2022           2 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2023             :                CASE (9)
    2024           1 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2025             :                CASE (10)
    2026           1 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2027             :                CASE (11)
    2028           0 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2029             :                CASE (15)
    2030           0 :                   CALL block_2_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2031             :                CASE DEFAULT
    2032          57 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2033             :                END SELECT
    2034             :             CASE (2)
    2035          47 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2036             :             CASE (3)
    2037          44 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2038             :             CASE (4)
    2039          28 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2040             :             CASE (5)
    2041          16 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2042             :             CASE (6)
    2043          10 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2044             :             CASE (7)
    2045           3 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2046             :             CASE (9)
    2047           1 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2048             :             CASE (10)
    2049           0 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2050             :             CASE (11)
    2051           0 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2052             :             CASE (15)
    2053           0 :                CALL block_2_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2054             :             CASE DEFAULT
    2055         206 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2056             :             END SELECT
    2057             :          CASE (7)
    2058        3297 :             SELECT CASE (mc_max)
    2059             :             CASE (1)
    2060        1831 :                SELECT CASE (md_max)
    2061             :                CASE (1)
    2062         739 :                   CALL block_2_7_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2063             :                CASE (2)
    2064         251 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2065             :                CASE (3)
    2066         978 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2067             :                CASE (4)
    2068           2 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2069             :                CASE (5)
    2070         754 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2071             :                CASE (6)
    2072           2 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2073             :                CASE (7)
    2074         491 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2075             :                CASE (9)
    2076           0 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2077             :                CASE (10)
    2078           0 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2079             :                CASE (11)
    2080           0 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2081             :                CASE (15)
    2082           0 :                   CALL block_2_7_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2083             :                CASE DEFAULT
    2084        3217 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2085             :                END SELECT
    2086             :             CASE (2)
    2087        1092 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2088             :             CASE (3)
    2089        4384 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2090             :             CASE (4)
    2091           7 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2092             :             CASE (5)
    2093        3242 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2094             :             CASE (6)
    2095           0 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2096             :             CASE (7)
    2097        2104 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2098             :             CASE (9)
    2099           0 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2100             :             CASE (10)
    2101           0 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2102             :             CASE (11)
    2103           0 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2104             :             CASE (15)
    2105           0 :                CALL block_2_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2106             :             CASE DEFAULT
    2107       14046 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2108             :             END SELECT
    2109             :          CASE (9)
    2110         131 :             SELECT CASE (mc_max)
    2111             :             CASE (1)
    2112          20 :                SELECT CASE (md_max)
    2113             :                CASE (1)
    2114           3 :                   CALL block_2_9_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2115             :                CASE (2)
    2116           3 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2117             :                CASE (3)
    2118           2 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2119             :                CASE (4)
    2120           2 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2121             :                CASE (5)
    2122           2 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2123             :                CASE (6)
    2124           2 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2125             :                CASE (7)
    2126           3 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2127             :                CASE (9)
    2128           3 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2129             :                CASE (10)
    2130           1 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2131             :                CASE (11)
    2132           0 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2133             :                CASE (15)
    2134           1 :                   CALL block_2_9_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2135             :                CASE DEFAULT
    2136          22 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2137             :                END SELECT
    2138             :             CASE (2)
    2139          17 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2140             :             CASE (3)
    2141          21 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2142             :             CASE (4)
    2143          12 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2144             :             CASE (5)
    2145           6 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2146             :             CASE (6)
    2147           0 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2148             :             CASE (7)
    2149           2 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2150             :             CASE (9)
    2151           0 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2152             :             CASE (10)
    2153           0 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2154             :             CASE (11)
    2155           0 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2156             :             CASE (15)
    2157           0 :                CALL block_2_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2158             :             CASE DEFAULT
    2159          80 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2160             :             END SELECT
    2161             :          CASE (10)
    2162         109 :             CALL block_2_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2163             :          CASE (11)
    2164         140 :             CALL block_2_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2165             :          CASE (15)
    2166         120 :             CALL block_2_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2167             :          CASE DEFAULT
    2168      402064 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2169             :          END SELECT
    2170             :       CASE (3)
    2171    13896821 :          SELECT CASE (mb_max)
    2172             :          CASE (1)
    2173     4959904 :             SELECT CASE (mc_max)
    2174             :             CASE (1)
    2175     3148392 :                SELECT CASE (md_max)
    2176             :                CASE (1)
    2177     3070721 :                   CALL block_3_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2178             :                CASE (2)
    2179       10150 :                   CALL block_3_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2180             :                CASE (3)
    2181     1639141 :                   CALL block_3_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2182             :                CASE (4)
    2183       46132 :                   CALL block_3_1_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2184             :                CASE (5)
    2185      105212 :                   CALL block_3_1_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2186             :                CASE (6)
    2187           5 :                   CALL block_3_1_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2188             :                CASE (7)
    2189       16716 :                   CALL block_3_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2190             :                CASE (9)
    2191           4 :                   CALL block_3_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2192             :                CASE (10)
    2193           3 :                   CALL block_3_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2194             :                CASE (11)
    2195           3 :                   CALL block_3_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2196             :                CASE (15)
    2197           3 :                   CALL block_3_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2198             :                CASE DEFAULT
    2199     4888090 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2200             :                END SELECT
    2201             :             CASE (2)
    2202     4172707 :                SELECT CASE (md_max)
    2203             :                CASE (1)
    2204       31980 :                   CALL block_3_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2205             :                CASE (2)
    2206        4869 :                   CALL block_3_1_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2207             :                CASE (3)
    2208       29704 :                   CALL block_3_1_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2209             :                CASE (4)
    2210           3 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2211             :                CASE (5)
    2212       10124 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2213             :                CASE (6)
    2214           3 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2215             :                CASE (7)
    2216         979 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2217             :                CASE (9)
    2218           3 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2219             :                CASE (10)
    2220           2 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2221             :                CASE (11)
    2222           2 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2223             :                CASE (15)
    2224           2 :                   CALL block_3_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2225             :                CASE DEFAULT
    2226       77671 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2227             :                END SELECT
    2228             :             CASE (3)
    2229     3069905 :                SELECT CASE (md_max)
    2230             :                CASE (1)
    2231     2490294 :                   CALL block_3_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2232             :                CASE (2)
    2233       15149 :                   CALL block_3_1_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2234             :                CASE (3)
    2235     1514045 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2236             :                CASE (4)
    2237       13991 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2238             :                CASE (5)
    2239       89527 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2240             :                CASE (6)
    2241           4 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2242             :                CASE (7)
    2243       17707 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2244             :                CASE (9)
    2245           3 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2246             :                CASE (10)
    2247           2 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2248             :                CASE (11)
    2249           2 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2250             :                CASE (15)
    2251           3 :                   CALL block_3_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2252             :                CASE DEFAULT
    2253     4140727 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2254             :                END SELECT
    2255             :             CASE (4)
    2256      909877 :                SELECT CASE (md_max)
    2257             :                CASE (1)
    2258      260638 :                   CALL block_3_1_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2259             :                CASE (2)
    2260           2 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2261             :                CASE (3)
    2262      119951 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2263             :                CASE (4)
    2264      132775 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2265             :                CASE (5)
    2266       66176 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2267             :                CASE (6)
    2268           4 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2269             :                CASE (7)
    2270          57 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2271             :                CASE (9)
    2272           3 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2273             :                CASE (10)
    2274           2 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2275             :                CASE (11)
    2276           1 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2277             :                CASE (15)
    2278           2 :                   CALL block_3_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2279             :                CASE DEFAULT
    2280      579611 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2281             :                END SELECT
    2282             :             CASE (5)
    2283      303187 :                SELECT CASE (md_max)
    2284             :                CASE (1)
    2285      303176 :                   CALL block_3_1_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2286             :                CASE (2)
    2287       10121 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2288             :                CASE (3)
    2289      185051 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2290             :                CASE (4)
    2291       66025 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2292             :                CASE (5)
    2293       76404 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2294             :                CASE (6)
    2295           2 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2296             :                CASE (7)
    2297        8454 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2298             :                CASE (9)
    2299           2 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2300             :                CASE (10)
    2301           2 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2302             :                CASE (11)
    2303           1 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2304             :                CASE (15)
    2305           1 :                   CALL block_3_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2306             :                CASE DEFAULT
    2307      649239 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2308             :                END SELECT
    2309             :             CASE (6)
    2310       72711 :                SELECT CASE (md_max)
    2311             :                CASE (1)
    2312           1 :                   CALL block_3_1_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2313             :                CASE (2)
    2314           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2315             :                CASE (3)
    2316           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2317             :                CASE (4)
    2318           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2319             :                CASE (5)
    2320           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2321             :                CASE (6)
    2322           3 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2323             :                CASE (7)
    2324           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2325             :                CASE (9)
    2326           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2327             :                CASE (10)
    2328           1 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2329             :                CASE (11)
    2330           0 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2331             :                CASE (15)
    2332           0 :                   CALL block_3_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2333             :                CASE DEFAULT
    2334          11 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2335             :                END SELECT
    2336             :             CASE (7)
    2337       72710 :                CALL block_3_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2338             :             CASE (9)
    2339           8 :                CALL block_3_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2340             :             CASE (10)
    2341           9 :                CALL block_3_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2342             :             CASE (11)
    2343          10 :                CALL block_3_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2344             :             CASE (15)
    2345          11 :                CALL block_3_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2346             :             CASE DEFAULT
    2347    10408097 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2348             :             END SELECT
    2349             :          CASE (2)
    2350     4774515 :             SELECT CASE (mc_max)
    2351             :             CASE (1)
    2352       12235 :                SELECT CASE (md_max)
    2353             :                CASE (1)
    2354        2425 :                   CALL block_3_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2355             :                CASE (2)
    2356         942 :                   CALL block_3_2_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2357             :                CASE (3)
    2358        3540 :                   CALL block_3_2_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2359             :                CASE (4)
    2360           2 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2361             :                CASE (5)
    2362        2398 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2363             :                CASE (6)
    2364           2 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2365             :                CASE (7)
    2366         961 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2367             :                CASE (9)
    2368           1 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2369             :                CASE (10)
    2370           1 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2371             :                CASE (11)
    2372           1 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2373             :                CASE (15)
    2374           1 :                   CALL block_3_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2375             :                CASE DEFAULT
    2376       10274 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2377             :                END SELECT
    2378             :             CASE (2)
    2379       21192 :                SELECT CASE (md_max)
    2380             :                CASE (1)
    2381         939 :                   CALL block_3_2_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2382             :                CASE (2)
    2383        3268 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2384             :                CASE (3)
    2385        4286 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2386             :                CASE (4)
    2387           1 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2388             :                CASE (5)
    2389         971 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2390             :                CASE (6)
    2391           1 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2392             :                CASE (7)
    2393         344 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2394             :                CASE (9)
    2395           0 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2396             :                CASE (10)
    2397           0 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2398             :                CASE (11)
    2399           0 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2400             :                CASE (15)
    2401           0 :                   CALL block_3_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2402             :                CASE DEFAULT
    2403        9810 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2404             :                END SELECT
    2405             :             CASE (3)
    2406        3547 :                SELECT CASE (md_max)
    2407             :                CASE (1)
    2408        3538 :                   CALL block_3_2_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2409             :                CASE (2)
    2410        4289 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2411             :                CASE (3)
    2412        7590 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2413             :                CASE (4)
    2414           2 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2415             :                CASE (5)
    2416        3529 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2417             :                CASE (6)
    2418           1 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2419             :                CASE (7)
    2420        1304 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2421             :                CASE (9)
    2422           0 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2423             :                CASE (10)
    2424           0 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2425             :                CASE (11)
    2426           0 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2427             :                CASE (15)
    2428           0 :                   CALL block_3_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2429             :                CASE DEFAULT
    2430       20253 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2431             :                END SELECT
    2432             :             CASE (4)
    2433           9 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2434             :             CASE (5)
    2435       18725 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2436             :             CASE (6)
    2437           6 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2438             :             CASE (7)
    2439        4263 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2440             :             CASE (9)
    2441           8 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2442             :             CASE (10)
    2443           9 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2444             :             CASE (11)
    2445          10 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2446             :             CASE (15)
    2447          11 :                CALL block_3_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2448             :             CASE DEFAULT
    2449       71814 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2450             :             END SELECT
    2451             :          CASE (3)
    2452     2228350 :             SELECT CASE (mc_max)
    2453             :             CASE (1)
    2454     1149386 :                SELECT CASE (md_max)
    2455             :                CASE (1)
    2456     1084190 :                   CALL block_3_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2457             :                CASE (2)
    2458        8672 :                   CALL block_3_3_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2459             :                CASE (3)
    2460      912899 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2461             :                CASE (4)
    2462       20420 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2463             :                CASE (5)
    2464       60886 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2465             :                CASE (6)
    2466           4 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2467             :                CASE (7)
    2468       10473 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2469             :                CASE (9)
    2470           1 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2471             :                CASE (10)
    2472           1 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2473             :                CASE (11)
    2474           1 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2475             :                CASE (15)
    2476           1 :                   CALL block_3_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2477             :                CASE DEFAULT
    2478     2097548 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2479             :                END SELECT
    2480             :             CASE (2)
    2481     1928788 :                SELECT CASE (md_max)
    2482             :                CASE (1)
    2483       23222 :                   CALL block_3_3_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2484             :                CASE (2)
    2485        6928 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2486             :                CASE (3)
    2487       25037 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2488             :                CASE (4)
    2489           3 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2490             :                CASE (5)
    2491        8635 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2492             :                CASE (6)
    2493           3 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2494             :                CASE (7)
    2495        1368 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2496             :                CASE (9)
    2497           0 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2498             :                CASE (10)
    2499           0 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2500             :                CASE (11)
    2501           0 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2502             :                CASE (15)
    2503           0 :                   CALL block_3_3_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2504             :                CASE DEFAULT
    2505       65196 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2506             :                END SELECT
    2507             :             CASE (3)
    2508     1905566 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2509             :             CASE (4)
    2510      280534 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2511             :             CASE (5)
    2512      364567 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2513             :             CASE (6)
    2514          13 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2515             :             CASE (7)
    2516       42343 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2517             :             CASE (9)
    2518           8 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2519             :             CASE (10)
    2520           9 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2521             :             CASE (11)
    2522          10 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2523             :             CASE (15)
    2524          11 :                CALL block_3_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2525             :             CASE DEFAULT
    2526     4764241 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2527             :             END SELECT
    2528             :          CASE (4)
    2529      384588 :             SELECT CASE (mc_max)
    2530             :             CASE (1)
    2531       30345 :                SELECT CASE (md_max)
    2532             :                CASE (1)
    2533       30314 :                   CALL block_3_4_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2534             :                CASE (2)
    2535           8 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2536             :                CASE (3)
    2537       11441 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2538             :                CASE (4)
    2539       11939 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2540             :                CASE (5)
    2541        5666 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2542             :                CASE (6)
    2543           3 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2544             :                CASE (7)
    2545           0 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2546             :                CASE (9)
    2547           0 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2548             :                CASE (10)
    2549           0 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2550             :                CASE (11)
    2551           0 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2552             :                CASE (15)
    2553           0 :                   CALL block_3_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2554             :                CASE DEFAULT
    2555       59371 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2556             :                END SELECT
    2557             :             CASE (2)
    2558          31 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2559             :             CASE (3)
    2560       20244 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2561             :             CASE (4)
    2562       34320 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2563             :             CASE (5)
    2564       16827 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2565             :             CASE (6)
    2566           9 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2567             :             CASE (7)
    2568           0 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2569             :             CASE (9)
    2570           0 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2571             :             CASE (10)
    2572           0 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2573             :             CASE (11)
    2574           0 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2575             :             CASE (15)
    2576           0 :                CALL block_3_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2577             :             CASE DEFAULT
    2578      130802 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2579             :             END SELECT
    2580             :          CASE (5)
    2581      124843 :             SELECT CASE (mc_max)
    2582             :             CASE (1)
    2583       64026 :                SELECT CASE (md_max)
    2584             :                CASE (1)
    2585       53709 :                   CALL block_3_5_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2586             :                CASE (2)
    2587        2389 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2588             :                CASE (3)
    2589       38325 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2590             :                CASE (4)
    2591        6040 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2592             :                CASE (5)
    2593       20058 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2594             :                CASE (6)
    2595           7 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2596             :                CASE (7)
    2597        4113 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2598             :                CASE (9)
    2599           0 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2600             :                CASE (10)
    2601           0 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2602             :                CASE (11)
    2603           0 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2604             :                CASE (15)
    2605           0 :                   CALL block_3_5_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2606             :                CASE DEFAULT
    2607      124641 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2608             :                END SELECT
    2609             :             CASE (2)
    2610       10317 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2611             :             CASE (3)
    2612       98117 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2613             :             CASE (4)
    2614       17583 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2615             :             CASE (5)
    2616       58613 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2617             :             CASE (6)
    2618          10 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2619             :             CASE (7)
    2620       15936 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2621             :             CASE (9)
    2622           0 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2623             :             CASE (10)
    2624           0 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2625             :             CASE (11)
    2626           0 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2627             :             CASE (15)
    2628           0 :                CALL block_3_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2629             :             CASE DEFAULT
    2630      325217 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2631             :             END SELECT
    2632             :          CASE (6)
    2633       75352 :             SELECT CASE (mc_max)
    2634             :             CASE (1)
    2635          54 :                SELECT CASE (md_max)
    2636             :                CASE (1)
    2637          11 :                   CALL block_3_6_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2638             :                CASE (2)
    2639          10 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2640             :                CASE (3)
    2641           8 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2642             :                CASE (4)
    2643           8 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2644             :                CASE (5)
    2645           8 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2646             :                CASE (6)
    2647           8 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2648             :                CASE (7)
    2649           3 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2650             :                CASE (9)
    2651           1 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2652             :                CASE (10)
    2653           0 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2654             :                CASE (11)
    2655           0 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2656             :                CASE (15)
    2657           0 :                   CALL block_3_6_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2658             :                CASE DEFAULT
    2659          57 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2660             :                END SELECT
    2661             :             CASE (2)
    2662          43 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2663             :             CASE (3)
    2664          46 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2665             :             CASE (4)
    2666          29 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2667             :             CASE (5)
    2668          16 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2669             :             CASE (6)
    2670          11 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2671             :             CASE (7)
    2672           0 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2673             :             CASE (9)
    2674           0 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2675             :             CASE (10)
    2676           0 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2677             :             CASE (11)
    2678           0 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2679             :             CASE (15)
    2680           0 :                CALL block_3_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2681             :             CASE DEFAULT
    2682         202 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2683             :             END SELECT
    2684             :          CASE (7)
    2685       75295 :             CALL block_3_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2686             :          CASE (9)
    2687          69 :             CALL block_3_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2688             :          CASE (10)
    2689          94 :             CALL block_3_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2690             :          CASE (11)
    2691         123 :             CALL block_3_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2692             :          CASE (15)
    2693         107 :             CALL block_3_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2694             :          CASE DEFAULT
    2695    15776061 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2696             :          END SELECT
    2697             :       CASE (4)
    2698     4854624 :          SELECT CASE (mb_max)
    2699             :          CASE (1)
    2700      479767 :             SELECT CASE (mc_max)
    2701             :             CASE (1)
    2702      269304 :                SELECT CASE (md_max)
    2703             :                CASE (1)
    2704      269271 :                   CALL block_4_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2705             :                CASE (2)
    2706           6 :                   CALL block_4_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2707             :                CASE (3)
    2708       94465 :                   CALL block_4_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2709             :                CASE (4)
    2710       84786 :                   CALL block_4_1_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2711             :                CASE (5)
    2712       31008 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2713             :                CASE (6)
    2714           5 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2715             :                CASE (7)
    2716         100 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2717             :                CASE (9)
    2718           4 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2719             :                CASE (10)
    2720           3 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2721             :                CASE (11)
    2722           3 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2723             :                CASE (15)
    2724           4 :                   CALL block_4_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2725             :                CASE DEFAULT
    2726      479655 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2727             :                END SELECT
    2728             :             CASE (2)
    2729      146897 :                SELECT CASE (md_max)
    2730             :                CASE (1)
    2731           3 :                   CALL block_4_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2732             :                CASE (2)
    2733           5 :                   CALL block_4_1_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2734             :                CASE (3)
    2735           2 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2736             :                CASE (4)
    2737           3 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2738             :                CASE (5)
    2739           4 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2740             :                CASE (6)
    2741           4 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2742             :                CASE (7)
    2743           3 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2744             :                CASE (9)
    2745           3 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2746             :                CASE (10)
    2747           2 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2748             :                CASE (11)
    2749           2 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2750             :                CASE (15)
    2751           2 :                   CALL block_4_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2752             :                CASE DEFAULT
    2753          33 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2754             :                END SELECT
    2755             :             CASE (3)
    2756      902113 :                SELECT CASE (md_max)
    2757             :                CASE (1)
    2758       82835 :                   CALL block_4_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2759             :                CASE (2)
    2760           3 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2761             :                CASE (3)
    2762       38821 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2763             :                CASE (4)
    2764       16766 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2765             :                CASE (5)
    2766        8452 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2767             :                CASE (6)
    2768           4 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2769             :                CASE (7)
    2770           3 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2771             :                CASE (9)
    2772           3 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2773             :                CASE (10)
    2774           2 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2775             :                CASE (11)
    2776           2 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2777             :                CASE (15)
    2778           3 :                   CALL block_4_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2779             :                CASE DEFAULT
    2780      146894 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2781             :                END SELECT
    2782             :             CASE (4)
    2783      711108 :                SELECT CASE (md_max)
    2784             :                CASE (1)
    2785      355395 :                   CALL block_4_1_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2786             :                CASE (2)
    2787           2 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2788             :                CASE (3)
    2789      132029 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2790             :                CASE (4)
    2791      239876 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2792             :                CASE (5)
    2793       91521 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2794             :                CASE (6)
    2795           4 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2796             :                CASE (7)
    2797         441 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2798             :                CASE (9)
    2799           3 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2800             :                CASE (10)
    2801           2 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2802             :                CASE (11)
    2803           2 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2804             :                CASE (15)
    2805           3 :                   CALL block_4_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2806             :                CASE DEFAULT
    2807      819278 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2808             :                END SELECT
    2809             :             CASE (5)
    2810      355713 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2811             :             CASE (6)
    2812          15 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2813             :             CASE (7)
    2814        1153 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2815             :             CASE (9)
    2816          10 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2817             :             CASE (10)
    2818          11 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2819             :             CASE (11)
    2820          10 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2821             :             CASE (15)
    2822          11 :                CALL block_4_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2823             :             CASE DEFAULT
    2824     1802783 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2825             :             END SELECT
    2826             :          CASE (2)
    2827      717232 :             SELECT CASE (mc_max)
    2828             :             CASE (1)
    2829          13 :                SELECT CASE (md_max)
    2830             :                CASE (1)
    2831           5 :                   CALL block_4_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2832             :                CASE (2)
    2833           3 :                   CALL block_4_2_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2834             :                CASE (3)
    2835           3 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2836             :                CASE (4)
    2837           3 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2838             :                CASE (5)
    2839           2 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2840             :                CASE (6)
    2841           2 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2842             :                CASE (7)
    2843           1 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2844             :                CASE (9)
    2845           1 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2846             :                CASE (10)
    2847           1 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2848             :                CASE (11)
    2849           1 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2850             :                CASE (15)
    2851           1 :                   CALL block_4_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2852             :                CASE DEFAULT
    2853          23 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2854             :                END SELECT
    2855             :             CASE (2)
    2856          12 :                SELECT CASE (md_max)
    2857             :                CASE (1)
    2858           1 :                   CALL block_4_2_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2859             :                CASE (2)
    2860           2 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2861             :                CASE (3)
    2862           2 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2863             :                CASE (4)
    2864           1 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2865             :                CASE (5)
    2866           1 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2867             :                CASE (6)
    2868           1 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2869             :                CASE (7)
    2870           0 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2871             :                CASE (9)
    2872           0 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2873             :                CASE (10)
    2874           0 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2875             :                CASE (11)
    2876           0 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2877             :                CASE (15)
    2878           0 :                   CALL block_4_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2879             :                CASE DEFAULT
    2880           8 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2881             :                END SELECT
    2882             :             CASE (3)
    2883          11 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2884             :             CASE (4)
    2885          11 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2886             :             CASE (5)
    2887           7 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2888             :             CASE (6)
    2889           7 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2890             :             CASE (7)
    2891           7 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2892             :             CASE (9)
    2893           8 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2894             :             CASE (10)
    2895           9 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2896             :             CASE (11)
    2897          10 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2898             :             CASE (15)
    2899          11 :                CALL block_4_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2900             :             CASE DEFAULT
    2901         112 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2902             :             END SELECT
    2903             :          CASE (3)
    2904      889752 :             SELECT CASE (mc_max)
    2905             :             CASE (1)
    2906       99640 :                SELECT CASE (md_max)
    2907             :                CASE (1)
    2908       99631 :                   CALL block_4_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2909             :                CASE (2)
    2910           3 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2911             :                CASE (3)
    2912       42694 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2913             :                CASE (4)
    2914       22784 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2915             :                CASE (5)
    2916       10948 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2917             :                CASE (6)
    2918           2 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2919             :                CASE (7)
    2920           1 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2921             :                CASE (9)
    2922           1 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2923             :                CASE (10)
    2924           1 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2925             :                CASE (11)
    2926           1 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2927             :                CASE (15)
    2928           1 :                   CALL block_4_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2929             :                CASE DEFAULT
    2930      176067 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2931             :                END SELECT
    2932             :             CASE (2)
    2933           9 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2934             :             CASE (3)
    2935       65260 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2936             :             CASE (4)
    2937      317974 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2938             :             CASE (5)
    2939      157667 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2940             :             CASE (6)
    2941           7 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2942             :             CASE (7)
    2943         187 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2944             :             CASE (9)
    2945           8 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2946             :             CASE (10)
    2947           9 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2948             :             CASE (11)
    2949          10 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2950             :             CASE (15)
    2951          11 :                CALL block_4_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2952             :             CASE DEFAULT
    2953      717209 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2954             :             END SELECT
    2955             :          CASE (4)
    2956      430605 :             SELECT CASE (mc_max)
    2957             :             CASE (1)
    2958       76684 :                SELECT CASE (md_max)
    2959             :                CASE (1)
    2960       76647 :                   CALL block_4_4_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2961             :                CASE (2)
    2962           9 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2963             :                CASE (3)
    2964       17355 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2965             :                CASE (4)
    2966       75180 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2967             :                CASE (5)
    2968       14755 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2969             :                CASE (6)
    2970           9 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2971             :                CASE (7)
    2972         386 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2973             :                CASE (9)
    2974           1 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2975             :                CASE (10)
    2976           2 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2977             :                CASE (11)
    2978           1 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2979             :                CASE (15)
    2980           1 :                   CALL block_4_4_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2981             :                CASE DEFAULT
    2982      184346 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2983             :                END SELECT
    2984             :             CASE (2)
    2985          37 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2986             :             CASE (3)
    2987       30515 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2988             :             CASE (4)
    2989      385747 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2990             :             CASE (5)
    2991      109472 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2992             :             CASE (6)
    2993          14 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2994             :             CASE (7)
    2995        3516 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2996             :             CASE (9)
    2997           8 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    2998             :             CASE (10)
    2999           9 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3000             :             CASE (11)
    3001          10 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3002             :             CASE (15)
    3003          11 :                CALL block_4_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3004             :             CASE DEFAULT
    3005      713685 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3006             :             END SELECT
    3007             :          CASE (5)
    3008      246259 :             CALL block_4_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3009             :          CASE (6)
    3010         234 :             CALL block_4_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3011             :          CASE (7)
    3012        7948 :             CALL block_4_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3013             :          CASE (9)
    3014          93 :             CALL block_4_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3015             :          CASE (10)
    3016         118 :             CALL block_4_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3017             :          CASE (11)
    3018         151 :             CALL block_4_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3019             :          CASE (15)
    3020         132 :             CALL block_4_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3021             :          CASE DEFAULT
    3022     3488724 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3023             :          END SELECT
    3024             :       CASE (5)
    3025     1535953 :          SELECT CASE (mb_max)
    3026             :          CASE (1)
    3027      573739 :             SELECT CASE (mc_max)
    3028             :             CASE (1)
    3029      293227 :                SELECT CASE (md_max)
    3030             :                CASE (1)
    3031      265905 :                   CALL block_5_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3032             :                CASE (2)
    3033        4134 :                   CALL block_5_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3034             :                CASE (3)
    3035      138107 :                   CALL block_5_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3036             :                CASE (4)
    3037       31038 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3038             :                CASE (5)
    3039       48122 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3040             :                CASE (6)
    3041           5 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3042             :                CASE (7)
    3043        6324 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3044             :                CASE (9)
    3045           4 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3046             :                CASE (10)
    3047           4 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3048             :                CASE (11)
    3049           4 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3050             :                CASE (15)
    3051           4 :                   CALL block_5_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3052             :                CASE DEFAULT
    3053      493651 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3054             :                END SELECT
    3055             :             CASE (2)
    3056      339325 :                SELECT CASE (md_max)
    3057             :                CASE (1)
    3058       10288 :                   CALL block_5_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3059             :                CASE (2)
    3060        1917 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3061             :                CASE (3)
    3062       10139 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3063             :                CASE (4)
    3064           3 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3065             :                CASE (5)
    3066        4204 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3067             :                CASE (6)
    3068           4 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3069             :                CASE (7)
    3070         755 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3071             :                CASE (9)
    3072           3 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3073             :                CASE (10)
    3074           3 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3075             :                CASE (11)
    3076           3 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3077             :                CASE (15)
    3078           3 :                   CALL block_5_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3079             :                CASE DEFAULT
    3080       27322 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3081             :                END SELECT
    3082             :             CASE (3)
    3083      520097 :                SELECT CASE (md_max)
    3084             :                CASE (1)
    3085      165873 :                   CALL block_5_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3086             :                CASE (2)
    3087        6035 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3088             :                CASE (3)
    3089      106006 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3090             :                CASE (4)
    3091        8212 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3092             :                CASE (5)
    3093       35884 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3094             :                CASE (6)
    3095           4 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3096             :                CASE (7)
    3097        7011 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3098             :                CASE (9)
    3099           3 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3100             :                CASE (10)
    3101           3 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3102             :                CASE (11)
    3103           3 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3104             :                CASE (15)
    3105           3 :                   CALL block_5_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3106             :                CASE DEFAULT
    3107      329037 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3108             :                END SELECT
    3109             :             CASE (4)
    3110      354224 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3111             :             CASE (5)
    3112      303037 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3113             :             CASE (6)
    3114          18 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3115             :             CASE (7)
    3116       26851 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3117             :             CASE (9)
    3118          15 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3119             :             CASE (10)
    3120          10 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3121             :             CASE (11)
    3122          10 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3123             :             CASE (15)
    3124          11 :                CALL block_5_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3125             :             CASE DEFAULT
    3126     1534186 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3127             :             END SELECT
    3128             :          CASE (2)
    3129      831791 :             SELECT CASE (mc_max)
    3130             :             CASE (1)
    3131        7609 :                SELECT CASE (md_max)
    3132             :                CASE (1)
    3133        1724 :                   CALL block_5_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3134             :                CASE (2)
    3135         655 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3136             :                CASE (3)
    3137        2383 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3138             :                CASE (4)
    3139           3 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3140             :                CASE (5)
    3141        1779 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3142             :                CASE (6)
    3143           2 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3144             :                CASE (7)
    3145         705 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3146             :                CASE (9)
    3147           1 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3148             :                CASE (10)
    3149           1 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3150             :                CASE (11)
    3151           1 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3152             :                CASE (15)
    3153           1 :                   CALL block_5_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3154             :                CASE DEFAULT
    3155        7255 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3156             :                END SELECT
    3157             :             CASE (2)
    3158        5885 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3159             :             CASE (3)
    3160       10925 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3161             :             CASE (4)
    3162           7 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3163             :             CASE (5)
    3164       30120 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3165             :             CASE (6)
    3166           7 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3167             :             CASE (7)
    3168        3127 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3169             :             CASE (9)
    3170           8 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3171             :             CASE (10)
    3172           9 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3173             :             CASE (11)
    3174          10 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3175             :             CASE (15)
    3176          11 :                CALL block_5_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3177             :             CASE DEFAULT
    3178       80088 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3179             :             END SELECT
    3180             :          CASE (3)
    3181      493257 :             SELECT CASE (mc_max)
    3182             :             CASE (1)
    3183      146880 :                SELECT CASE (md_max)
    3184             :                CASE (1)
    3185      122528 :                   CALL block_5_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3186             :                CASE (2)
    3187        3999 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3188             :                CASE (3)
    3189       77176 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3190             :                CASE (4)
    3191       11368 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3192             :                CASE (5)
    3193       28178 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3194             :                CASE (6)
    3195           3 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3196             :                CASE (7)
    3197        5073 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3198             :                CASE (9)
    3199           1 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3200             :                CASE (10)
    3201           1 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3202             :                CASE (11)
    3203           1 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3204             :                CASE (15)
    3205           1 :                   CALL block_5_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3206             :                CASE DEFAULT
    3207      248329 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3208             :                END SELECT
    3209             :             CASE (2)
    3210       24352 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3211             :             CASE (3)
    3212      192958 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3213             :             CASE (4)
    3214      158456 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3215             :             CASE (5)
    3216      172790 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3217             :             CASE (6)
    3218           7 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3219             :             CASE (7)
    3220       20478 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3221             :             CASE (9)
    3222           8 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3223             :             CASE (10)
    3224           9 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3225             :             CASE (11)
    3226          10 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3227             :             CASE (15)
    3228          11 :                CALL block_5_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3229             :             CASE DEFAULT
    3230      824536 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3231             :             END SELECT
    3232             :          CASE (4)
    3233      244928 :             CALL block_5_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3234             :          CASE (5)
    3235      296756 :             CALL block_5_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3236             :          CASE (6)
    3237         267 :             CALL block_5_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3238             :          CASE (7)
    3239       54958 :             CALL block_5_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3240             :          CASE (9)
    3241          77 :             CALL block_5_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3242             :          CASE (10)
    3243         143 :             CALL block_5_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3244             :          CASE (11)
    3245         172 :             CALL block_5_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3246             :          CASE (15)
    3247         158 :             CALL block_5_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3248             :          CASE DEFAULT
    3249     3051841 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3250             :          END SELECT
    3251             :       CASE (6)
    3252      377148 :          SELECT CASE (mb_max)
    3253             :          CASE (1)
    3254         166 :             SELECT CASE (mc_max)
    3255             :             CASE (1)
    3256          49 :                SELECT CASE (md_max)
    3257             :                CASE (1)
    3258          10 :                   CALL block_6_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3259             :                CASE (2)
    3260           6 :                   CALL block_6_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3261             :                CASE (3)
    3262           5 :                   CALL block_6_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3263             :                CASE (4)
    3264           5 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3265             :                CASE (5)
    3266           6 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3267             :                CASE (6)
    3268           5 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3269             :                CASE (7)
    3270           4 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3271             :                CASE (9)
    3272           4 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3273             :                CASE (10)
    3274           4 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3275             :                CASE (11)
    3276           4 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3277             :                CASE (15)
    3278           4 :                   CALL block_6_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3279             :                CASE DEFAULT
    3280          57 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3281             :                END SELECT
    3282             :             CASE (2)
    3283          44 :                SELECT CASE (md_max)
    3284             :                CASE (1)
    3285           4 :                   CALL block_6_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3286             :                CASE (2)
    3287           5 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3288             :                CASE (3)
    3289           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3290             :                CASE (4)
    3291           4 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3292             :                CASE (5)
    3293           4 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3294             :                CASE (6)
    3295           4 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3296             :                CASE (7)
    3297           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3298             :                CASE (9)
    3299           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3300             :                CASE (10)
    3301           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3302             :                CASE (11)
    3303           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3304             :                CASE (15)
    3305           3 :                   CALL block_6_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3306             :                CASE DEFAULT
    3307          39 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3308             :                END SELECT
    3309             :             CASE (3)
    3310          40 :                SELECT CASE (md_max)
    3311             :                CASE (1)
    3312           5 :                   CALL block_6_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3313             :                CASE (2)
    3314           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3315             :                CASE (3)
    3316           5 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3317             :                CASE (4)
    3318           4 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3319             :                CASE (5)
    3320           4 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3321             :                CASE (6)
    3322           4 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3323             :                CASE (7)
    3324           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3325             :                CASE (9)
    3326           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3327             :                CASE (10)
    3328           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3329             :                CASE (11)
    3330           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3331             :                CASE (15)
    3332           3 :                   CALL block_6_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3333             :                CASE DEFAULT
    3334          40 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3335             :                END SELECT
    3336             :             CASE (4)
    3337          35 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3338             :             CASE (5)
    3339          28 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3340             :             CASE (6)
    3341          24 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3342             :             CASE (7)
    3343          27 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3344             :             CASE (9)
    3345          19 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3346             :             CASE (10)
    3347          14 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3348             :             CASE (11)
    3349          10 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3350             :             CASE (15)
    3351          12 :                CALL block_6_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3352             :             CASE DEFAULT
    3353         305 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3354             :             END SELECT
    3355             :          CASE (2)
    3356         135 :             SELECT CASE (mc_max)
    3357             :             CASE (1)
    3358          15 :                SELECT CASE (md_max)
    3359             :                CASE (1)
    3360           5 :                   CALL block_6_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3361             :                CASE (2)
    3362           3 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3363             :                CASE (3)
    3364           3 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3365             :                CASE (4)
    3366           3 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3367             :                CASE (5)
    3368           3 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3369             :                CASE (6)
    3370           3 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3371             :                CASE (7)
    3372           1 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3373             :                CASE (9)
    3374           1 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3375             :                CASE (10)
    3376           1 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3377             :                CASE (11)
    3378           1 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3379             :                CASE (15)
    3380           1 :                   CALL block_6_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3381             :                CASE DEFAULT
    3382          25 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3383             :                END SELECT
    3384             :             CASE (2)
    3385          10 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3386             :             CASE (3)
    3387           8 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3388             :             CASE (4)
    3389           7 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3390             :             CASE (5)
    3391           7 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3392             :             CASE (6)
    3393           8 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3394             :             CASE (7)
    3395           6 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3396             :             CASE (9)
    3397           8 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3398             :             CASE (10)
    3399           9 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3400             :             CASE (11)
    3401          10 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3402             :             CASE (15)
    3403          11 :                CALL block_6_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3404             :             CASE DEFAULT
    3405         109 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3406             :             END SELECT
    3407             :          CASE (3)
    3408         137 :             SELECT CASE (mc_max)
    3409             :             CASE (1)
    3410          16 :                SELECT CASE (md_max)
    3411             :                CASE (1)
    3412           5 :                   CALL block_6_3_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3413             :                CASE (2)
    3414           4 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3415             :                CASE (3)
    3416           3 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3417             :                CASE (4)
    3418           3 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3419             :                CASE (5)
    3420           3 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3421             :                CASE (6)
    3422           3 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3423             :                CASE (7)
    3424           1 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3425             :                CASE (9)
    3426           1 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3427             :                CASE (10)
    3428           1 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3429             :                CASE (11)
    3430           1 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3431             :                CASE (15)
    3432           1 :                   CALL block_6_3_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3433             :                CASE DEFAULT
    3434          26 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3435             :                END SELECT
    3436             :             CASE (2)
    3437          11 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3438             :             CASE (3)
    3439           9 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3440             :             CASE (4)
    3441           7 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3442             :             CASE (5)
    3443           7 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3444             :             CASE (6)
    3445           8 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3446             :             CASE (7)
    3447           5 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3448             :             CASE (9)
    3449           7 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3450             :             CASE (10)
    3451           9 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3452             :             CASE (11)
    3453          10 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3454             :             CASE (15)
    3455          11 :                CALL block_6_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3456             :             CASE DEFAULT
    3457         110 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3458             :             END SELECT
    3459             :          CASE (4)
    3460         111 :             CALL block_6_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3461             :          CASE (5)
    3462         110 :             CALL block_6_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3463             :          CASE (6)
    3464         346 :             CALL block_6_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3465             :          CASE (7)
    3466          37 :             CALL block_6_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3467             :          CASE (9)
    3468          99 :             CALL block_6_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3469             :          CASE (10)
    3470         167 :             CALL block_6_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3471             :          CASE (11)
    3472         193 :             CALL block_6_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3473             :          CASE (15)
    3474         180 :             CALL block_6_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3475             :          CASE DEFAULT
    3476        1767 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3477             :          END SELECT
    3478             :       CASE (7)
    3479      160055 :          SELECT CASE (mb_max)
    3480             :          CASE (1)
    3481       70769 :             SELECT CASE (mc_max)
    3482             :             CASE (1)
    3483       30930 :                SELECT CASE (md_max)
    3484             :                CASE (1)
    3485       27790 :                   CALL block_7_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3486             :                CASE (2)
    3487         716 :                   CALL block_7_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3488             :                CASE (3)
    3489       18245 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3490             :                CASE (4)
    3491          99 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3492             :                CASE (5)
    3493        6333 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3494             :                CASE (6)
    3495           4 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3496             :                CASE (7)
    3497        3510 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3498             :                CASE (9)
    3499           5 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3500             :                CASE (10)
    3501           5 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3502             :                CASE (11)
    3503           4 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3504             :                CASE (15)
    3505           5 :                   CALL block_7_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3506             :                CASE DEFAULT
    3507       56716 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3508             :                END SELECT
    3509             :             CASE (2)
    3510       56320 :                SELECT CASE (md_max)
    3511             :                CASE (1)
    3512         715 :                   CALL block_7_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3513             :                CASE (2)
    3514         251 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3515             :                CASE (3)
    3516         961 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3517             :                CASE (4)
    3518           2 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3519             :                CASE (5)
    3520         707 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3521             :                CASE (6)
    3522           3 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3523             :                CASE (7)
    3524         491 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3525             :                CASE (9)
    3526           3 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3527             :                CASE (10)
    3528           2 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3529             :                CASE (11)
    3530           2 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3531             :                CASE (15)
    3532           3 :                   CALL block_7_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3533             :                CASE DEFAULT
    3534        3140 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3535             :                END SELECT
    3536             :             CASE (3)
    3537       55605 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3538             :             CASE (4)
    3539        1163 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3540             :             CASE (5)
    3541       26644 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3542             :             CASE (6)
    3543          17 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3544             :             CASE (7)
    3545       14816 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3546             :             CASE (9)
    3547          46 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3548             :             CASE (10)
    3549          36 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3550             :             CASE (11)
    3551          25 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3552             :             CASE (15)
    3553          23 :                CALL block_7_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3554             :             CASE DEFAULT
    3555      158231 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3556             :             END SELECT
    3557             :          CASE (2)
    3558      110332 :             SELECT CASE (mc_max)
    3559             :             CASE (1)
    3560        1818 :                SELECT CASE (md_max)
    3561             :                CASE (1)
    3562         738 :                   CALL block_7_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3563             :                CASE (2)
    3564         249 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3565             :                CASE (3)
    3566         977 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3567             :                CASE (4)
    3568           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3569             :                CASE (5)
    3570         753 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3571             :                CASE (6)
    3572           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3573             :                CASE (7)
    3574         489 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3575             :                CASE (9)
    3576           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3577             :                CASE (10)
    3578           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3579             :                CASE (11)
    3580           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3581             :                CASE (15)
    3582           1 :                   CALL block_7_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3583             :                CASE DEFAULT
    3584        3212 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3585             :                END SELECT
    3586             :             CASE (2)
    3587        1080 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3588             :             CASE (3)
    3589        4368 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3590             :             CASE (4)
    3591           0 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3592             :             CASE (5)
    3593        3242 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3594             :             CASE (6)
    3595           4 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3596             :             CASE (7)
    3597        2110 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3598             :             CASE (9)
    3599           7 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3600             :             CASE (10)
    3601           9 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3602             :             CASE (11)
    3603          10 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3604             :             CASE (15)
    3605          11 :                CALL block_7_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3606             :             CASE DEFAULT
    3607       14053 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3608             :             END SELECT
    3609             :          CASE (3)
    3610      107120 :             CALL block_7_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3611             :          CASE (4)
    3612        7934 :             CALL block_7_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3613             :          CASE (5)
    3614       55196 :             CALL block_7_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3615             :          CASE (6)
    3616         112 :             CALL block_7_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3617             :          CASE (7)
    3618       33206 :             CALL block_7_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3619             :          CASE (9)
    3620         196 :             CALL block_7_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3621             :          CASE (10)
    3622         240 :             CALL block_7_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3623             :          CASE (11)
    3624         279 :             CALL block_7_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3625             :          CASE (15)
    3626         276 :             CALL block_7_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3627             :          CASE DEFAULT
    3628      376843 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3629             :          END SELECT
    3630             :       CASE (9)
    3631        1999 :          SELECT CASE (mb_max)
    3632             :          CASE (1)
    3633         113 :             SELECT CASE (mc_max)
    3634             :             CASE (1)
    3635          40 :                SELECT CASE (md_max)
    3636             :                CASE (1)
    3637          11 :                   CALL block_9_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3638             :                CASE (2)
    3639           4 :                   CALL block_9_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3640             :                CASE (3)
    3641           3 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3642             :                CASE (4)
    3643           3 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3644             :                CASE (5)
    3645           4 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3646             :                CASE (6)
    3647           4 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3648             :                CASE (7)
    3649           6 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3650             :                CASE (9)
    3651           6 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3652             :                CASE (10)
    3653           5 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3654             :                CASE (11)
    3655           5 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3656             :                CASE (15)
    3657           5 :                   CALL block_9_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3658             :                CASE DEFAULT
    3659          56 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3660             :                END SELECT
    3661             :             CASE (2)
    3662          36 :                SELECT CASE (md_max)
    3663             :                CASE (1)
    3664           3 :                   CALL block_9_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3665             :                CASE (2)
    3666           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3667             :                CASE (3)
    3668           1 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3669             :                CASE (4)
    3670           2 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3671             :                CASE (5)
    3672           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3673             :                CASE (6)
    3674           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3675             :                CASE (7)
    3676           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3677             :                CASE (9)
    3678           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3679             :                CASE (10)
    3680           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3681             :                CASE (11)
    3682           2 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3683             :                CASE (15)
    3684           3 :                   CALL block_9_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3685             :                CASE DEFAULT
    3686          29 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3687             :                END SELECT
    3688             :             CASE (3)
    3689          33 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3690             :             CASE (4)
    3691          28 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3692             :             CASE (5)
    3693          22 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3694             :             CASE (6)
    3695          18 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3696             :             CASE (7)
    3697          62 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3698             :             CASE (9)
    3699          54 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3700             :             CASE (10)
    3701          42 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3702             :             CASE (11)
    3703          29 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3704             :             CASE (15)
    3705          26 :                CALL block_9_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3706             :             CASE DEFAULT
    3707         399 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3708             :             END SELECT
    3709             :          CASE (2)
    3710          63 :             SELECT CASE (mc_max)
    3711             :             CASE (1)
    3712           2 :                SELECT CASE (md_max)
    3713             :                CASE (1)
    3714           2 :                   CALL block_9_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3715             :                CASE (2)
    3716           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3717             :                CASE (3)
    3718           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3719             :                CASE (4)
    3720           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3721             :                CASE (5)
    3722           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3723             :                CASE (6)
    3724           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3725             :                CASE (7)
    3726           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3727             :                CASE (9)
    3728           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3729             :                CASE (10)
    3730           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3731             :                CASE (11)
    3732           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3733             :                CASE (15)
    3734           1 :                   CALL block_9_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3735             :                CASE DEFAULT
    3736          12 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3737             :                END SELECT
    3738             :             CASE (2)
    3739           0 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3740             :             CASE (3)
    3741           0 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3742             :             CASE (4)
    3743           0 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3744             :             CASE (5)
    3745           1 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3746             :             CASE (6)
    3747           3 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3748             :             CASE (7)
    3749           5 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3750             :             CASE (9)
    3751           7 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3752             :             CASE (10)
    3753           8 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3754             :             CASE (11)
    3755          10 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3756             :             CASE (15)
    3757          11 :                CALL block_9_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3758             :             CASE DEFAULT
    3759          57 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3760             :             END SELECT
    3761             :          CASE (3)
    3762          51 :             CALL block_9_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3763             :          CASE (4)
    3764          45 :             CALL block_9_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3765             :          CASE (5)
    3766          75 :             CALL block_9_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3767             :          CASE (6)
    3768          76 :             CALL block_9_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3769             :          CASE (7)
    3770          45 :             CALL block_9_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3771             :          CASE (9)
    3772         250 :             CALL block_9_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3773             :          CASE (10)
    3774         213 :             CALL block_9_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3775             :          CASE (11)
    3776         308 :             CALL block_9_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3777             :          CASE (15)
    3778         305 :             CALL block_9_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3779             :          CASE DEFAULT
    3780        1824 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3781             :          END SELECT
    3782             :       CASE (10)
    3783        1598 :          SELECT CASE (mb_max)
    3784             :          CASE (1)
    3785          99 :             SELECT CASE (mc_max)
    3786             :             CASE (1)
    3787          30 :                SELECT CASE (md_max)
    3788             :                CASE (1)
    3789           9 :                   CALL block_10_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3790             :                CASE (2)
    3791           3 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3792             :                CASE (3)
    3793           3 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3794             :                CASE (4)
    3795           3 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3796             :                CASE (5)
    3797           3 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3798             :                CASE (6)
    3799           3 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3800             :                CASE (7)
    3801           5 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3802             :                CASE (9)
    3803           5 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3804             :                CASE (10)
    3805           5 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3806             :                CASE (11)
    3807           4 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3808             :                CASE (15)
    3809           4 :                   CALL block_10_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3810             :                CASE DEFAULT
    3811          47 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3812             :                END SELECT
    3813             :             CASE (2)
    3814          21 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3815             :             CASE (3)
    3816          21 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3817             :             CASE (4)
    3818          17 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3819             :             CASE (5)
    3820          18 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3821             :             CASE (6)
    3822          16 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3823             :             CASE (7)
    3824          57 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3825             :             CASE (9)
    3826          47 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3827             :             CASE (10)
    3828          46 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3829             :             CASE (11)
    3830          33 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3831             :             CASE (15)
    3832          26 :                CALL block_10_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3833             :             CASE DEFAULT
    3834         349 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3835             :             END SELECT
    3836             :          CASE (2)
    3837          52 :             CALL block_10_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3838             :          CASE (3)
    3839          46 :             CALL block_10_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3840             :          CASE (4)
    3841          39 :             CALL block_10_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3842             :          CASE (5)
    3843          33 :             CALL block_10_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3844             :          CASE (6)
    3845          27 :             CALL block_10_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3846             :          CASE (7)
    3847          45 :             CALL block_10_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3848             :          CASE (9)
    3849         104 :             CALL block_10_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3850             :          CASE (10)
    3851         309 :             CALL block_10_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3852             :          CASE (11)
    3853         329 :             CALL block_10_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3854             :          CASE (15)
    3855         267 :             CALL block_10_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3856             :          CASE DEFAULT
    3857        1600 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3858             :          END SELECT
    3859             :       CASE (11)
    3860        1730 :          SELECT CASE (mb_max)
    3861             :          CASE (1)
    3862          95 :             SELECT CASE (mc_max)
    3863             :             CASE (1)
    3864          30 :                SELECT CASE (md_max)
    3865             :                CASE (1)
    3866           9 :                   CALL block_11_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3867             :                CASE (2)
    3868           3 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3869             :                CASE (3)
    3870           3 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3871             :                CASE (4)
    3872           3 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3873             :                CASE (5)
    3874           3 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3875             :                CASE (6)
    3876           3 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3877             :                CASE (7)
    3878           5 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3879             :                CASE (9)
    3880           5 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3881             :                CASE (10)
    3882           5 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3883             :                CASE (11)
    3884           5 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3885             :                CASE (15)
    3886           4 :                   CALL block_11_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3887             :                CASE DEFAULT
    3888          48 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3889             :                END SELECT
    3890             :             CASE (2)
    3891          21 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3892             :             CASE (3)
    3893          21 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3894             :             CASE (4)
    3895          17 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3896             :             CASE (5)
    3897          17 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3898             :             CASE (6)
    3899          15 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3900             :             CASE (7)
    3901          58 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3902             :             CASE (9)
    3903          49 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3904             :             CASE (10)
    3905          45 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3906             :             CASE (11)
    3907          39 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3908             :             CASE (15)
    3909          32 :                CALL block_11_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3910             :             CASE DEFAULT
    3911         362 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3912             :             END SELECT
    3913             :          CASE (2)
    3914          47 :             CALL block_11_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3915             :          CASE (3)
    3916          40 :             CALL block_11_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3917             :          CASE (4)
    3918          34 :             CALL block_11_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3919             :          CASE (5)
    3920          28 :             CALL block_11_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3921             :          CASE (6)
    3922          23 :             CALL block_11_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3923             :          CASE (7)
    3924          45 :             CALL block_11_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3925             :          CASE (9)
    3926          47 :             CALL block_11_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3927             :          CASE (10)
    3928          49 :             CALL block_11_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3929             :          CASE (11)
    3930         359 :             CALL block_11_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3931             :          CASE (15)
    3932         215 :             CALL block_11_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3933             :          CASE DEFAULT
    3934        1249 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3935             :          END SELECT
    3936             :       CASE (15)
    3937       97313 :          SELECT CASE (mb_max)
    3938             :          CASE (1)
    3939         100 :             SELECT CASE (mc_max)
    3940             :             CASE (1)
    3941          41 :                SELECT CASE (md_max)
    3942             :                CASE (1)
    3943          11 :                   CALL block_15_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3944             :                CASE (2)
    3945           4 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3946             :                CASE (3)
    3947           3 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3948             :                CASE (4)
    3949           3 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3950             :                CASE (5)
    3951           4 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3952             :                CASE (6)
    3953           4 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3954             :                CASE (7)
    3955           6 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3956             :                CASE (9)
    3957           6 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3958             :                CASE (10)
    3959           6 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3960             :                CASE (11)
    3961           6 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3962             :                CASE (15)
    3963           6 :                   CALL block_15_1_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3964             :                CASE DEFAULT
    3965          59 :                   CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3966             :                END SELECT
    3967             :             CASE (2)
    3968          30 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3969             :             CASE (3)
    3970          33 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3971             :             CASE (4)
    3972          28 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3973             :             CASE (5)
    3974          22 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3975             :             CASE (6)
    3976          17 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3977             :             CASE (7)
    3978          67 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3979             :             CASE (9)
    3980          57 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3981             :             CASE (10)
    3982          45 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3983             :             CASE (11)
    3984          37 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3985             :             CASE (15)
    3986          38 :                CALL block_15_1(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3987             :             CASE DEFAULT
    3988         433 :                CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3989             :             END SELECT
    3990             :          CASE (2)
    3991          41 :             CALL block_15_2(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3992             :          CASE (3)
    3993          35 :             CALL block_15_3(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3994             :          CASE (4)
    3995          29 :             CALL block_15_4(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3996             :          CASE (5)
    3997          24 :             CALL block_15_5(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    3998             :          CASE (6)
    3999          19 :             CALL block_15_6(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4000             :          CASE (7)
    4001          47 :             CALL block_15_7(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4002             :          CASE (9)
    4003          49 :             CALL block_15_9(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4004             :          CASE (10)
    4005         124 :             CALL block_15_10(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4006             :          CASE (11)
    4007         203 :             CALL block_15_11(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4008             :          CASE (15)
    4009         364 :             CALL block_15_15(mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4010             :          CASE DEFAULT
    4011        1368 :             CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4012             :          END SELECT
    4013             :       CASE DEFAULT
    4014    52365206 :          CALL block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4015             :       END SELECT
    4016             : #endif
    4017    52365206 :    END SUBROUTINE contract_block
    4018             : 
    4019             : #if defined (__LIBINT)
    4020             : ! **************************************************************************************************
    4021             : !> \brief ...
    4022             : !> \param ma_max ...
    4023             : !> \param mb_max ...
    4024             : !> \param mc_max ...
    4025             : !> \param md_max ...
    4026             : !> \param kbd ...
    4027             : !> \param kbc ...
    4028             : !> \param kad ...
    4029             : !> \param kac ...
    4030             : !> \param pbd ...
    4031             : !> \param pbc ...
    4032             : !> \param pad ...
    4033             : !> \param pac ...
    4034             : !> \param prim ...
    4035             : !> \param scale ...
    4036             : ! **************************************************************************************************
    4037      200556 :    SUBROUTINE block_default(ma_max, mb_max, mc_max, md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4038             :       INTEGER                                            :: ma_max, mb_max, mc_max, md_max
    4039             :       REAL(KIND=dp) :: kbd(mb_max*md_max), kbc(mb_max*mc_max), kad(ma_max*md_max), &
    4040             :          kac(ma_max*mc_max), pbd(mb_max*md_max), pbc(mb_max*mc_max), pad(ma_max*md_max), &
    4041             :          pac(ma_max*mc_max), prim(ma_max*mb_max*mc_max*md_max), scale
    4042             : 
    4043             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4044             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4045             : 
    4046     3876996 :       kbd(1:mb_max*md_max) = 0.0_dp
    4047     4876236 :       kbc(1:mb_max*mc_max) = 0.0_dp
    4048     5871084 :       kad(1:ma_max*md_max) = 0.0_dp
    4049     7839768 :       kac(1:ma_max*mc_max) = 0.0_dp
    4050             :       p_index = 0
    4051     1175664 :       DO md = 1, md_max
    4052     8049717 :          DO mc = 1, mc_max
    4053    33026586 :             DO mb = 1, mb_max
    4054    25177425 :                ks_bd = 0.0_dp
    4055    25177425 :                ks_bc = 0.0_dp
    4056    25177425 :                p_bd = pbd((md - 1)*mb_max + mb)
    4057    25177425 :                p_bc = pbc((mc - 1)*mb_max + mb)
    4058   177923187 :                DO ma = 1, ma_max
    4059   152745762 :                   p_index = p_index + 1
    4060   152745762 :                   tmp = scale*prim(p_index)
    4061   152745762 :                   ks_bc = ks_bc + tmp*pad((md - 1)*ma_max + ma)
    4062   152745762 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*ma_max + ma)
    4063   152745762 :                   kad((md - 1)*ma_max + ma) = kad((md - 1)*ma_max + ma) - tmp*p_bc
    4064   177923187 :                   kac((mc - 1)*ma_max + ma) = kac((mc - 1)*ma_max + ma) - tmp*p_bd
    4065             :                END DO
    4066    25177425 :                kbd((md - 1)*mb_max + mb) = kbd((md - 1)*mb_max + mb) - ks_bd
    4067    32051478 :                kbc((mc - 1)*mb_max + mb) = kbc((mc - 1)*mb_max + mb) - ks_bc
    4068             :             END DO
    4069             :          END DO
    4070             :       END DO
    4071      200556 :    END SUBROUTINE block_default
    4072             : ! **************************************************************************************************
    4073             : !> \brief ...
    4074             : !> \param kbd ...
    4075             : !> \param kbc ...
    4076             : !> \param kad ...
    4077             : !> \param kac ...
    4078             : !> \param pbd ...
    4079             : !> \param pbc ...
    4080             : !> \param pad ...
    4081             : !> \param pac ...
    4082             : !> \param prim ...
    4083             : !> \param scale ...
    4084             : ! **************************************************************************************************
    4085     8117581 :    SUBROUTINE block_1_1_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4086             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*1), kad(1*1), kac(1*1), &
    4087             :                                                             pbd(1*1), pbc(1*1), pad(1*1), &
    4088             :                                                             pac(1*1), prim(1*1*1*1), scale
    4089             : 
    4090             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4091             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4092             : 
    4093     8117581 :       kbd(1:1*1) = 0.0_dp
    4094     8117581 :       kbc(1:1*1) = 0.0_dp
    4095     8117581 :       kad(1:1*1) = 0.0_dp
    4096     8117581 :       kac(1:1*1) = 0.0_dp
    4097     8117581 :       p_index = 0
    4098    16235162 :       DO md = 1, 1
    4099    24352743 :          DO mc = 1, 1
    4100    24352743 :             DO mb = 1, 1
    4101     8117581 :                ks_bd = 0.0_dp
    4102     8117581 :                ks_bc = 0.0_dp
    4103     8117581 :                p_bd = pbd((md - 1)*1 + mb)
    4104     8117581 :                p_bc = pbc((mc - 1)*1 + mb)
    4105    16235162 :                DO ma = 1, 1
    4106     8117581 :                   p_index = p_index + 1
    4107     8117581 :                   tmp = scale*prim(p_index)
    4108     8117581 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4109     8117581 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4110     8117581 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4111    16235162 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4112             :                END DO
    4113     8117581 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4114    16235162 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4115             :             END DO
    4116             :          END DO
    4117             :       END DO
    4118     8117581 :    END SUBROUTINE block_1_1_1_1
    4119             : ! **************************************************************************************************
    4120             : !> \brief ...
    4121             : !> \param kbd ...
    4122             : !> \param kbc ...
    4123             : !> \param kad ...
    4124             : !> \param kac ...
    4125             : !> \param pbd ...
    4126             : !> \param pbc ...
    4127             : !> \param pad ...
    4128             : !> \param pac ...
    4129             : !> \param prim ...
    4130             : !> \param scale ...
    4131             : ! **************************************************************************************************
    4132       10391 :    SUBROUTINE block_1_1_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4133             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*1), kad(1*2), kac(1*1), &
    4134             :                                                             pbd(1*2), pbc(1*1), pad(1*2), &
    4135             :                                                             pac(1*1), prim(1*1*1*2), scale
    4136             : 
    4137             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4138             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4139             : 
    4140       10391 :       kbd(1:1*2) = 0.0_dp
    4141       10391 :       kbc(1:1*1) = 0.0_dp
    4142       10391 :       kad(1:1*2) = 0.0_dp
    4143       10391 :       kac(1:1*1) = 0.0_dp
    4144       10391 :       p_index = 0
    4145       31173 :       DO md = 1, 2
    4146       51955 :          DO mc = 1, 1
    4147       62346 :             DO mb = 1, 1
    4148       20782 :                ks_bd = 0.0_dp
    4149       20782 :                ks_bc = 0.0_dp
    4150       20782 :                p_bd = pbd((md - 1)*1 + mb)
    4151       20782 :                p_bc = pbc((mc - 1)*1 + mb)
    4152       41564 :                DO ma = 1, 1
    4153       20782 :                   p_index = p_index + 1
    4154       20782 :                   tmp = scale*prim(p_index)
    4155       20782 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4156       20782 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4157       20782 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4158       41564 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4159             :                END DO
    4160       20782 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4161       41564 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4162             :             END DO
    4163             :          END DO
    4164             :       END DO
    4165       10391 :    END SUBROUTINE block_1_1_1_2
    4166             : ! **************************************************************************************************
    4167             : !> \brief ...
    4168             : !> \param kbd ...
    4169             : !> \param kbc ...
    4170             : !> \param kad ...
    4171             : !> \param kac ...
    4172             : !> \param pbd ...
    4173             : !> \param pbc ...
    4174             : !> \param pad ...
    4175             : !> \param pac ...
    4176             : !> \param prim ...
    4177             : !> \param scale ...
    4178             : ! **************************************************************************************************
    4179     2755976 :    SUBROUTINE block_1_1_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4180             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*1), kad(1*3), kac(1*1), &
    4181             :                                                             pbd(1*3), pbc(1*1), pad(1*3), &
    4182             :                                                             pac(1*1), prim(1*1*1*3), scale
    4183             : 
    4184             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4185             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4186             : 
    4187     2755976 :       kbd(1:1*3) = 0.0_dp
    4188     2755976 :       kbc(1:1*1) = 0.0_dp
    4189     2755976 :       kad(1:1*3) = 0.0_dp
    4190     2755976 :       kac(1:1*1) = 0.0_dp
    4191     2755976 :       p_index = 0
    4192    11023904 :       DO md = 1, 3
    4193    19291832 :          DO mc = 1, 1
    4194    24803784 :             DO mb = 1, 1
    4195     8267928 :                ks_bd = 0.0_dp
    4196     8267928 :                ks_bc = 0.0_dp
    4197     8267928 :                p_bd = pbd((md - 1)*1 + mb)
    4198     8267928 :                p_bc = pbc((mc - 1)*1 + mb)
    4199    16535856 :                DO ma = 1, 1
    4200     8267928 :                   p_index = p_index + 1
    4201     8267928 :                   tmp = scale*prim(p_index)
    4202     8267928 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4203     8267928 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4204     8267928 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4205    16535856 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4206             :                END DO
    4207     8267928 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4208    16535856 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4209             :             END DO
    4210             :          END DO
    4211             :       END DO
    4212     2755976 :    END SUBROUTINE block_1_1_1_3
    4213             : ! **************************************************************************************************
    4214             : !> \brief ...
    4215             : !> \param kbd ...
    4216             : !> \param kbc ...
    4217             : !> \param kad ...
    4218             : !> \param kac ...
    4219             : !> \param pbd ...
    4220             : !> \param pbc ...
    4221             : !> \param pad ...
    4222             : !> \param pac ...
    4223             : !> \param prim ...
    4224             : !> \param scale ...
    4225             : ! **************************************************************************************************
    4226      156414 :    SUBROUTINE block_1_1_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4227             :       REAL(KIND=dp)                                      :: kbd(1*4), kbc(1*1), kad(1*4), kac(1*1), &
    4228             :                                                             pbd(1*4), pbc(1*1), pad(1*4), &
    4229             :                                                             pac(1*1), prim(1*1*1*4), scale
    4230             : 
    4231             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4232             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4233             : 
    4234      156414 :       kbd(1:1*4) = 0.0_dp
    4235      156414 :       kbc(1:1*1) = 0.0_dp
    4236      156414 :       kad(1:1*4) = 0.0_dp
    4237      156414 :       kac(1:1*1) = 0.0_dp
    4238      156414 :       p_index = 0
    4239      782070 :       DO md = 1, 4
    4240     1407726 :          DO mc = 1, 1
    4241     1876968 :             DO mb = 1, 1
    4242      625656 :                ks_bd = 0.0_dp
    4243      625656 :                ks_bc = 0.0_dp
    4244      625656 :                p_bd = pbd((md - 1)*1 + mb)
    4245      625656 :                p_bc = pbc((mc - 1)*1 + mb)
    4246     1251312 :                DO ma = 1, 1
    4247      625656 :                   p_index = p_index + 1
    4248      625656 :                   tmp = scale*prim(p_index)
    4249      625656 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4250      625656 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4251      625656 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4252     1251312 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4253             :                END DO
    4254      625656 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4255     1251312 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4256             :             END DO
    4257             :          END DO
    4258             :       END DO
    4259      156414 :    END SUBROUTINE block_1_1_1_4
    4260             : ! **************************************************************************************************
    4261             : !> \brief ...
    4262             : !> \param kbd ...
    4263             : !> \param kbc ...
    4264             : !> \param kad ...
    4265             : !> \param kac ...
    4266             : !> \param pbd ...
    4267             : !> \param pbc ...
    4268             : !> \param pad ...
    4269             : !> \param pac ...
    4270             : !> \param prim ...
    4271             : !> \param scale ...
    4272             : ! **************************************************************************************************
    4273      193142 :    SUBROUTINE block_1_1_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4274             :       REAL(KIND=dp)                                      :: kbd(1*5), kbc(1*1), kad(1*5), kac(1*1), &
    4275             :                                                             pbd(1*5), pbc(1*1), pad(1*5), &
    4276             :                                                             pac(1*1), prim(1*1*1*5), scale
    4277             : 
    4278             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4279             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4280             : 
    4281      193142 :       kbd(1:1*5) = 0.0_dp
    4282      193142 :       kbc(1:1*1) = 0.0_dp
    4283      193142 :       kad(1:1*5) = 0.0_dp
    4284      193142 :       kac(1:1*1) = 0.0_dp
    4285      193142 :       p_index = 0
    4286     1158852 :       DO md = 1, 5
    4287     2124562 :          DO mc = 1, 1
    4288     2897130 :             DO mb = 1, 1
    4289      965710 :                ks_bd = 0.0_dp
    4290      965710 :                ks_bc = 0.0_dp
    4291      965710 :                p_bd = pbd((md - 1)*1 + mb)
    4292      965710 :                p_bc = pbc((mc - 1)*1 + mb)
    4293     1931420 :                DO ma = 1, 1
    4294      965710 :                   p_index = p_index + 1
    4295      965710 :                   tmp = scale*prim(p_index)
    4296      965710 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4297      965710 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4298      965710 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4299     1931420 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4300             :                END DO
    4301      965710 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4302     1931420 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4303             :             END DO
    4304             :          END DO
    4305             :       END DO
    4306      193142 :    END SUBROUTINE block_1_1_1_5
    4307             : ! **************************************************************************************************
    4308             : !> \brief ...
    4309             : !> \param kbd ...
    4310             : !> \param kbc ...
    4311             : !> \param kad ...
    4312             : !> \param kac ...
    4313             : !> \param pbd ...
    4314             : !> \param pbc ...
    4315             : !> \param pad ...
    4316             : !> \param pac ...
    4317             : !> \param prim ...
    4318             : !> \param scale ...
    4319             : ! **************************************************************************************************
    4320          11 :    SUBROUTINE block_1_1_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4321             :       REAL(KIND=dp)                                      :: kbd(1*6), kbc(1*1), kad(1*6), kac(1*1), &
    4322             :                                                             pbd(1*6), pbc(1*1), pad(1*6), &
    4323             :                                                             pac(1*1), prim(1*1*1*6), scale
    4324             : 
    4325             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4326             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4327             : 
    4328          11 :       kbd(1:1*6) = 0.0_dp
    4329          11 :       kbc(1:1*1) = 0.0_dp
    4330          11 :       kad(1:1*6) = 0.0_dp
    4331          11 :       kac(1:1*1) = 0.0_dp
    4332          11 :       p_index = 0
    4333          77 :       DO md = 1, 6
    4334         143 :          DO mc = 1, 1
    4335         198 :             DO mb = 1, 1
    4336          66 :                ks_bd = 0.0_dp
    4337          66 :                ks_bc = 0.0_dp
    4338          66 :                p_bd = pbd((md - 1)*1 + mb)
    4339          66 :                p_bc = pbc((mc - 1)*1 + mb)
    4340         132 :                DO ma = 1, 1
    4341          66 :                   p_index = p_index + 1
    4342          66 :                   tmp = scale*prim(p_index)
    4343          66 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4344          66 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4345          66 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4346         132 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4347             :                END DO
    4348          66 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4349         132 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4350             :             END DO
    4351             :          END DO
    4352             :       END DO
    4353          11 :    END SUBROUTINE block_1_1_1_6
    4354             : ! **************************************************************************************************
    4355             : !> \brief ...
    4356             : !> \param kbd ...
    4357             : !> \param kbc ...
    4358             : !> \param kad ...
    4359             : !> \param kac ...
    4360             : !> \param pbd ...
    4361             : !> \param pbc ...
    4362             : !> \param pad ...
    4363             : !> \param pac ...
    4364             : !> \param prim ...
    4365             : !> \param scale ...
    4366             : ! **************************************************************************************************
    4367       23226 :    SUBROUTINE block_1_1_1_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4368             :       REAL(KIND=dp)                                      :: kbd(1*7), kbc(1*1), kad(1*7), kac(1*1), &
    4369             :                                                             pbd(1*7), pbc(1*1), pad(1*7), &
    4370             :                                                             pac(1*1), prim(1*1*1*7), scale
    4371             : 
    4372             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4373             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4374             : 
    4375       23226 :       kbd(1:1*7) = 0.0_dp
    4376       23226 :       kbc(1:1*1) = 0.0_dp
    4377       23226 :       kad(1:1*7) = 0.0_dp
    4378       23226 :       kac(1:1*1) = 0.0_dp
    4379       23226 :       p_index = 0
    4380      185808 :       DO md = 1, 7
    4381      348390 :          DO mc = 1, 1
    4382      487746 :             DO mb = 1, 1
    4383      162582 :                ks_bd = 0.0_dp
    4384      162582 :                ks_bc = 0.0_dp
    4385      162582 :                p_bd = pbd((md - 1)*1 + mb)
    4386      162582 :                p_bc = pbc((mc - 1)*1 + mb)
    4387      325164 :                DO ma = 1, 1
    4388      162582 :                   p_index = p_index + 1
    4389      162582 :                   tmp = scale*prim(p_index)
    4390      162582 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4391      162582 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4392      162582 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4393      325164 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4394             :                END DO
    4395      162582 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4396      325164 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4397             :             END DO
    4398             :          END DO
    4399             :       END DO
    4400       23226 :    END SUBROUTINE block_1_1_1_7
    4401             : ! **************************************************************************************************
    4402             : !> \brief ...
    4403             : !> \param kbd ...
    4404             : !> \param kbc ...
    4405             : !> \param kad ...
    4406             : !> \param kac ...
    4407             : !> \param pbd ...
    4408             : !> \param pbc ...
    4409             : !> \param pad ...
    4410             : !> \param pac ...
    4411             : !> \param prim ...
    4412             : !> \param scale ...
    4413             : ! **************************************************************************************************
    4414          10 :    SUBROUTINE block_1_1_1_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4415             :       REAL(KIND=dp)                                      :: kbd(1*9), kbc(1*1), kad(1*9), kac(1*1), &
    4416             :                                                             pbd(1*9), pbc(1*1), pad(1*9), &
    4417             :                                                             pac(1*1), prim(1*1*1*9), scale
    4418             : 
    4419             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4420             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4421             : 
    4422          10 :       kbd(1:1*9) = 0.0_dp
    4423          10 :       kbc(1:1*1) = 0.0_dp
    4424          10 :       kad(1:1*9) = 0.0_dp
    4425          10 :       kac(1:1*1) = 0.0_dp
    4426          10 :       p_index = 0
    4427         100 :       DO md = 1, 9
    4428         190 :          DO mc = 1, 1
    4429         270 :             DO mb = 1, 1
    4430          90 :                ks_bd = 0.0_dp
    4431          90 :                ks_bc = 0.0_dp
    4432          90 :                p_bd = pbd((md - 1)*1 + mb)
    4433          90 :                p_bc = pbc((mc - 1)*1 + mb)
    4434         180 :                DO ma = 1, 1
    4435          90 :                   p_index = p_index + 1
    4436          90 :                   tmp = scale*prim(p_index)
    4437          90 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4438          90 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4439          90 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4440         180 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4441             :                END DO
    4442          90 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4443         180 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4444             :             END DO
    4445             :          END DO
    4446             :       END DO
    4447          10 :    END SUBROUTINE block_1_1_1_9
    4448             : ! **************************************************************************************************
    4449             : !> \brief ...
    4450             : !> \param kbd ...
    4451             : !> \param kbc ...
    4452             : !> \param kad ...
    4453             : !> \param kac ...
    4454             : !> \param pbd ...
    4455             : !> \param pbc ...
    4456             : !> \param pad ...
    4457             : !> \param pac ...
    4458             : !> \param prim ...
    4459             : !> \param scale ...
    4460             : ! **************************************************************************************************
    4461           9 :    SUBROUTINE block_1_1_1_10(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4462             :       REAL(KIND=dp)                                      :: kbd(1*10), kbc(1*1), kad(1*10), &
    4463             :                                                             kac(1*1), pbd(1*10), pbc(1*1), &
    4464             :                                                             pad(1*10), pac(1*1), prim(1*1*1*10), &
    4465             :                                                             scale
    4466             : 
    4467             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4468             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4469             : 
    4470           9 :       kbd(1:1*10) = 0.0_dp
    4471           9 :       kbc(1:1*1) = 0.0_dp
    4472           9 :       kad(1:1*10) = 0.0_dp
    4473           9 :       kac(1:1*1) = 0.0_dp
    4474           9 :       p_index = 0
    4475          99 :       DO md = 1, 10
    4476         189 :          DO mc = 1, 1
    4477         270 :             DO mb = 1, 1
    4478          90 :                ks_bd = 0.0_dp
    4479          90 :                ks_bc = 0.0_dp
    4480          90 :                p_bd = pbd((md - 1)*1 + mb)
    4481          90 :                p_bc = pbc((mc - 1)*1 + mb)
    4482         180 :                DO ma = 1, 1
    4483          90 :                   p_index = p_index + 1
    4484          90 :                   tmp = scale*prim(p_index)
    4485          90 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4486          90 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4487          90 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4488         180 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4489             :                END DO
    4490          90 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4491         180 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4492             :             END DO
    4493             :          END DO
    4494             :       END DO
    4495           9 :    END SUBROUTINE block_1_1_1_10
    4496             : ! **************************************************************************************************
    4497             : !> \brief ...
    4498             : !> \param kbd ...
    4499             : !> \param kbc ...
    4500             : !> \param kad ...
    4501             : !> \param kac ...
    4502             : !> \param pbd ...
    4503             : !> \param pbc ...
    4504             : !> \param pad ...
    4505             : !> \param pac ...
    4506             : !> \param prim ...
    4507             : !> \param scale ...
    4508             : ! **************************************************************************************************
    4509           9 :    SUBROUTINE block_1_1_1_11(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4510             :       REAL(KIND=dp)                                      :: kbd(1*11), kbc(1*1), kad(1*11), &
    4511             :                                                             kac(1*1), pbd(1*11), pbc(1*1), &
    4512             :                                                             pad(1*11), pac(1*1), prim(1*1*1*11), &
    4513             :                                                             scale
    4514             : 
    4515             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4516             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4517             : 
    4518           9 :       kbd(1:1*11) = 0.0_dp
    4519           9 :       kbc(1:1*1) = 0.0_dp
    4520           9 :       kad(1:1*11) = 0.0_dp
    4521           9 :       kac(1:1*1) = 0.0_dp
    4522           9 :       p_index = 0
    4523         108 :       DO md = 1, 11
    4524         207 :          DO mc = 1, 1
    4525         297 :             DO mb = 1, 1
    4526          99 :                ks_bd = 0.0_dp
    4527          99 :                ks_bc = 0.0_dp
    4528          99 :                p_bd = pbd((md - 1)*1 + mb)
    4529          99 :                p_bc = pbc((mc - 1)*1 + mb)
    4530         198 :                DO ma = 1, 1
    4531          99 :                   p_index = p_index + 1
    4532          99 :                   tmp = scale*prim(p_index)
    4533          99 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4534          99 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4535          99 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4536         198 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4537             :                END DO
    4538          99 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4539         198 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4540             :             END DO
    4541             :          END DO
    4542             :       END DO
    4543           9 :    END SUBROUTINE block_1_1_1_11
    4544             : ! **************************************************************************************************
    4545             : !> \brief ...
    4546             : !> \param kbd ...
    4547             : !> \param kbc ...
    4548             : !> \param kad ...
    4549             : !> \param kac ...
    4550             : !> \param pbd ...
    4551             : !> \param pbc ...
    4552             : !> \param pad ...
    4553             : !> \param pac ...
    4554             : !> \param prim ...
    4555             : !> \param scale ...
    4556             : ! **************************************************************************************************
    4557          10 :    SUBROUTINE block_1_1_1_15(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4558             :       REAL(KIND=dp)                                      :: kbd(1*15), kbc(1*1), kad(1*15), &
    4559             :                                                             kac(1*1), pbd(1*15), pbc(1*1), &
    4560             :                                                             pad(1*15), pac(1*1), prim(1*1*1*15), &
    4561             :                                                             scale
    4562             : 
    4563             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4564             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4565             : 
    4566          10 :       kbd(1:1*15) = 0.0_dp
    4567          10 :       kbc(1:1*1) = 0.0_dp
    4568          10 :       kad(1:1*15) = 0.0_dp
    4569          10 :       kac(1:1*1) = 0.0_dp
    4570          10 :       p_index = 0
    4571         160 :       DO md = 1, 15
    4572         310 :          DO mc = 1, 1
    4573         450 :             DO mb = 1, 1
    4574         150 :                ks_bd = 0.0_dp
    4575         150 :                ks_bc = 0.0_dp
    4576         150 :                p_bd = pbd((md - 1)*1 + mb)
    4577         150 :                p_bc = pbc((mc - 1)*1 + mb)
    4578         300 :                DO ma = 1, 1
    4579         150 :                   p_index = p_index + 1
    4580         150 :                   tmp = scale*prim(p_index)
    4581         150 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4582         150 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4583         150 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4584         300 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4585             :                END DO
    4586         150 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4587         300 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4588             :             END DO
    4589             :          END DO
    4590             :       END DO
    4591          10 :    END SUBROUTINE block_1_1_1_15
    4592             : ! **************************************************************************************************
    4593             : !> \brief ...
    4594             : !> \param kbd ...
    4595             : !> \param kbc ...
    4596             : !> \param kad ...
    4597             : !> \param kac ...
    4598             : !> \param pbd ...
    4599             : !> \param pbc ...
    4600             : !> \param pad ...
    4601             : !> \param pac ...
    4602             : !> \param prim ...
    4603             : !> \param scale ...
    4604             : ! **************************************************************************************************
    4605       35441 :    SUBROUTINE block_1_1_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4606             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*2), kad(1*1), kac(1*2), &
    4607             :                                                             pbd(1*1), pbc(1*2), pad(1*1), &
    4608             :                                                             pac(1*2), prim(1*1*2*1), scale
    4609             : 
    4610             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4611             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4612             : 
    4613       35441 :       kbd(1:1*1) = 0.0_dp
    4614       35441 :       kbc(1:1*2) = 0.0_dp
    4615       35441 :       kad(1:1*1) = 0.0_dp
    4616       35441 :       kac(1:1*2) = 0.0_dp
    4617       35441 :       p_index = 0
    4618       70882 :       DO md = 1, 1
    4619      141764 :          DO mc = 1, 2
    4620      177205 :             DO mb = 1, 1
    4621       70882 :                ks_bd = 0.0_dp
    4622       70882 :                ks_bc = 0.0_dp
    4623       70882 :                p_bd = pbd((md - 1)*1 + mb)
    4624       70882 :                p_bc = pbc((mc - 1)*1 + mb)
    4625      141764 :                DO ma = 1, 1
    4626       70882 :                   p_index = p_index + 1
    4627       70882 :                   tmp = scale*prim(p_index)
    4628       70882 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4629       70882 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4630       70882 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4631      141764 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4632             :                END DO
    4633       70882 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4634      141764 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4635             :             END DO
    4636             :          END DO
    4637             :       END DO
    4638       35441 :    END SUBROUTINE block_1_1_2_1
    4639             : ! **************************************************************************************************
    4640             : !> \brief ...
    4641             : !> \param kbd ...
    4642             : !> \param kbc ...
    4643             : !> \param kad ...
    4644             : !> \param kac ...
    4645             : !> \param pbd ...
    4646             : !> \param pbc ...
    4647             : !> \param pad ...
    4648             : !> \param pac ...
    4649             : !> \param prim ...
    4650             : !> \param scale ...
    4651             : ! **************************************************************************************************
    4652        5028 :    SUBROUTINE block_1_1_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4653             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*2), kad(1*2), kac(1*2), &
    4654             :                                                             pbd(1*2), pbc(1*2), pad(1*2), &
    4655             :                                                             pac(1*2), prim(1*1*2*2), scale
    4656             : 
    4657             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4658             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4659             : 
    4660        5028 :       kbd(1:1*2) = 0.0_dp
    4661        5028 :       kbc(1:1*2) = 0.0_dp
    4662        5028 :       kad(1:1*2) = 0.0_dp
    4663        5028 :       kac(1:1*2) = 0.0_dp
    4664        5028 :       p_index = 0
    4665       15084 :       DO md = 1, 2
    4666       35196 :          DO mc = 1, 2
    4667       50280 :             DO mb = 1, 1
    4668       20112 :                ks_bd = 0.0_dp
    4669       20112 :                ks_bc = 0.0_dp
    4670       20112 :                p_bd = pbd((md - 1)*1 + mb)
    4671       20112 :                p_bc = pbc((mc - 1)*1 + mb)
    4672       40224 :                DO ma = 1, 1
    4673       20112 :                   p_index = p_index + 1
    4674       20112 :                   tmp = scale*prim(p_index)
    4675       20112 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4676       20112 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4677       20112 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4678       40224 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4679             :                END DO
    4680       20112 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4681       40224 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4682             :             END DO
    4683             :          END DO
    4684             :       END DO
    4685        5028 :    END SUBROUTINE block_1_1_2_2
    4686             : ! **************************************************************************************************
    4687             : !> \brief ...
    4688             : !> \param kbd ...
    4689             : !> \param kbc ...
    4690             : !> \param kad ...
    4691             : !> \param kac ...
    4692             : !> \param pbd ...
    4693             : !> \param pbc ...
    4694             : !> \param pad ...
    4695             : !> \param pac ...
    4696             : !> \param prim ...
    4697             : !> \param scale ...
    4698             : ! **************************************************************************************************
    4699       31999 :    SUBROUTINE block_1_1_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4700             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*2), kad(1*3), kac(1*2), &
    4701             :                                                             pbd(1*3), pbc(1*2), pad(1*3), &
    4702             :                                                             pac(1*2), prim(1*1*2*3), scale
    4703             : 
    4704             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4705             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4706             : 
    4707       31999 :       kbd(1:1*3) = 0.0_dp
    4708       31999 :       kbc(1:1*2) = 0.0_dp
    4709       31999 :       kad(1:1*3) = 0.0_dp
    4710       31999 :       kac(1:1*2) = 0.0_dp
    4711       31999 :       p_index = 0
    4712      127996 :       DO md = 1, 3
    4713      319990 :          DO mc = 1, 2
    4714      479985 :             DO mb = 1, 1
    4715      191994 :                ks_bd = 0.0_dp
    4716      191994 :                ks_bc = 0.0_dp
    4717      191994 :                p_bd = pbd((md - 1)*1 + mb)
    4718      191994 :                p_bc = pbc((mc - 1)*1 + mb)
    4719      383988 :                DO ma = 1, 1
    4720      191994 :                   p_index = p_index + 1
    4721      191994 :                   tmp = scale*prim(p_index)
    4722      191994 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4723      191994 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4724      191994 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4725      383988 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4726             :                END DO
    4727      191994 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4728      383988 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4729             :             END DO
    4730             :          END DO
    4731             :       END DO
    4732       31999 :    END SUBROUTINE block_1_1_2_3
    4733             : ! **************************************************************************************************
    4734             : !> \brief ...
    4735             : !> \param kbd ...
    4736             : !> \param kbc ...
    4737             : !> \param kad ...
    4738             : !> \param kac ...
    4739             : !> \param pbd ...
    4740             : !> \param pbc ...
    4741             : !> \param pad ...
    4742             : !> \param pac ...
    4743             : !> \param prim ...
    4744             : !> \param scale ...
    4745             : ! **************************************************************************************************
    4746           7 :    SUBROUTINE block_1_1_2_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4747             :       REAL(KIND=dp)                                      :: kbd(1*4), kbc(1*2), kad(1*4), kac(1*2), &
    4748             :                                                             pbd(1*4), pbc(1*2), pad(1*4), &
    4749             :                                                             pac(1*2), prim(1*1*2*4), scale
    4750             : 
    4751             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4752             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4753             : 
    4754           7 :       kbd(1:1*4) = 0.0_dp
    4755           7 :       kbc(1:1*2) = 0.0_dp
    4756           7 :       kad(1:1*4) = 0.0_dp
    4757           7 :       kac(1:1*2) = 0.0_dp
    4758           7 :       p_index = 0
    4759          35 :       DO md = 1, 4
    4760          91 :          DO mc = 1, 2
    4761         140 :             DO mb = 1, 1
    4762          56 :                ks_bd = 0.0_dp
    4763          56 :                ks_bc = 0.0_dp
    4764          56 :                p_bd = pbd((md - 1)*1 + mb)
    4765          56 :                p_bc = pbc((mc - 1)*1 + mb)
    4766         112 :                DO ma = 1, 1
    4767          56 :                   p_index = p_index + 1
    4768          56 :                   tmp = scale*prim(p_index)
    4769          56 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4770          56 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4771          56 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4772         112 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4773             :                END DO
    4774          56 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4775         112 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4776             :             END DO
    4777             :          END DO
    4778             :       END DO
    4779           7 :    END SUBROUTINE block_1_1_2_4
    4780             : ! **************************************************************************************************
    4781             : !> \brief ...
    4782             : !> \param kbd ...
    4783             : !> \param kbc ...
    4784             : !> \param kad ...
    4785             : !> \param kac ...
    4786             : !> \param pbd ...
    4787             : !> \param pbc ...
    4788             : !> \param pad ...
    4789             : !> \param pac ...
    4790             : !> \param prim ...
    4791             : !> \param scale ...
    4792             : ! **************************************************************************************************
    4793       10255 :    SUBROUTINE block_1_1_2_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4794             :       REAL(KIND=dp)                                      :: kbd(1*5), kbc(1*2), kad(1*5), kac(1*2), &
    4795             :                                                             pbd(1*5), pbc(1*2), pad(1*5), &
    4796             :                                                             pac(1*2), prim(1*1*2*5), scale
    4797             : 
    4798             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4799             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4800             : 
    4801       10255 :       kbd(1:1*5) = 0.0_dp
    4802       10255 :       kbc(1:1*2) = 0.0_dp
    4803       10255 :       kad(1:1*5) = 0.0_dp
    4804       10255 :       kac(1:1*2) = 0.0_dp
    4805       10255 :       p_index = 0
    4806       61530 :       DO md = 1, 5
    4807      164080 :          DO mc = 1, 2
    4808      256375 :             DO mb = 1, 1
    4809      102550 :                ks_bd = 0.0_dp
    4810      102550 :                ks_bc = 0.0_dp
    4811      102550 :                p_bd = pbd((md - 1)*1 + mb)
    4812      102550 :                p_bc = pbc((mc - 1)*1 + mb)
    4813      205100 :                DO ma = 1, 1
    4814      102550 :                   p_index = p_index + 1
    4815      102550 :                   tmp = scale*prim(p_index)
    4816      102550 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4817      102550 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4818      102550 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4819      205100 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4820             :                END DO
    4821      102550 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4822      205100 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4823             :             END DO
    4824             :          END DO
    4825             :       END DO
    4826       10255 :    END SUBROUTINE block_1_1_2_5
    4827             : ! **************************************************************************************************
    4828             : !> \brief ...
    4829             : !> \param kbd ...
    4830             : !> \param kbc ...
    4831             : !> \param kad ...
    4832             : !> \param kac ...
    4833             : !> \param pbd ...
    4834             : !> \param pbc ...
    4835             : !> \param pad ...
    4836             : !> \param pac ...
    4837             : !> \param prim ...
    4838             : !> \param scale ...
    4839             : ! **************************************************************************************************
    4840           8 :    SUBROUTINE block_1_1_2_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4841             :       REAL(KIND=dp)                                      :: kbd(1*6), kbc(1*2), kad(1*6), kac(1*2), &
    4842             :                                                             pbd(1*6), pbc(1*2), pad(1*6), &
    4843             :                                                             pac(1*2), prim(1*1*2*6), scale
    4844             : 
    4845             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4846             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4847             : 
    4848           8 :       kbd(1:1*6) = 0.0_dp
    4849           8 :       kbc(1:1*2) = 0.0_dp
    4850           8 :       kad(1:1*6) = 0.0_dp
    4851           8 :       kac(1:1*2) = 0.0_dp
    4852           8 :       p_index = 0
    4853          56 :       DO md = 1, 6
    4854         152 :          DO mc = 1, 2
    4855         240 :             DO mb = 1, 1
    4856          96 :                ks_bd = 0.0_dp
    4857          96 :                ks_bc = 0.0_dp
    4858          96 :                p_bd = pbd((md - 1)*1 + mb)
    4859          96 :                p_bc = pbc((mc - 1)*1 + mb)
    4860         192 :                DO ma = 1, 1
    4861          96 :                   p_index = p_index + 1
    4862          96 :                   tmp = scale*prim(p_index)
    4863          96 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4864          96 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4865          96 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4866         192 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4867             :                END DO
    4868          96 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4869         192 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4870             :             END DO
    4871             :          END DO
    4872             :       END DO
    4873           8 :    END SUBROUTINE block_1_1_2_6
    4874             : ! **************************************************************************************************
    4875             : !> \brief ...
    4876             : !> \param kbd ...
    4877             : !> \param kbc ...
    4878             : !> \param kad ...
    4879             : !> \param kac ...
    4880             : !> \param pbd ...
    4881             : !> \param pbc ...
    4882             : !> \param pad ...
    4883             : !> \param pac ...
    4884             : !> \param prim ...
    4885             : !> \param scale ...
    4886             : ! **************************************************************************************************
    4887         742 :    SUBROUTINE block_1_1_2_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4888             :       REAL(KIND=dp)                                      :: kbd(1*7), kbc(1*2), kad(1*7), kac(1*2), &
    4889             :                                                             pbd(1*7), pbc(1*2), pad(1*7), &
    4890             :                                                             pac(1*2), prim(1*1*2*7), scale
    4891             : 
    4892             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4893             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4894             : 
    4895         742 :       kbd(1:1*7) = 0.0_dp
    4896         742 :       kbc(1:1*2) = 0.0_dp
    4897         742 :       kad(1:1*7) = 0.0_dp
    4898         742 :       kac(1:1*2) = 0.0_dp
    4899         742 :       p_index = 0
    4900        5936 :       DO md = 1, 7
    4901       16324 :          DO mc = 1, 2
    4902       25970 :             DO mb = 1, 1
    4903       10388 :                ks_bd = 0.0_dp
    4904       10388 :                ks_bc = 0.0_dp
    4905       10388 :                p_bd = pbd((md - 1)*1 + mb)
    4906       10388 :                p_bc = pbc((mc - 1)*1 + mb)
    4907       20776 :                DO ma = 1, 1
    4908       10388 :                   p_index = p_index + 1
    4909       10388 :                   tmp = scale*prim(p_index)
    4910       10388 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4911       10388 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4912       10388 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4913       20776 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4914             :                END DO
    4915       10388 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4916       20776 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4917             :             END DO
    4918             :          END DO
    4919             :       END DO
    4920         742 :    END SUBROUTINE block_1_1_2_7
    4921             : ! **************************************************************************************************
    4922             : !> \brief ...
    4923             : !> \param kbd ...
    4924             : !> \param kbc ...
    4925             : !> \param kad ...
    4926             : !> \param kac ...
    4927             : !> \param pbd ...
    4928             : !> \param pbc ...
    4929             : !> \param pad ...
    4930             : !> \param pac ...
    4931             : !> \param prim ...
    4932             : !> \param scale ...
    4933             : ! **************************************************************************************************
    4934           6 :    SUBROUTINE block_1_1_2_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4935             :       REAL(KIND=dp)                                      :: kbd(1*9), kbc(1*2), kad(1*9), kac(1*2), &
    4936             :                                                             pbd(1*9), pbc(1*2), pad(1*9), &
    4937             :                                                             pac(1*2), prim(1*1*2*9), scale
    4938             : 
    4939             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4940             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4941             : 
    4942           6 :       kbd(1:1*9) = 0.0_dp
    4943           6 :       kbc(1:1*2) = 0.0_dp
    4944           6 :       kad(1:1*9) = 0.0_dp
    4945           6 :       kac(1:1*2) = 0.0_dp
    4946           6 :       p_index = 0
    4947          60 :       DO md = 1, 9
    4948         168 :          DO mc = 1, 2
    4949         270 :             DO mb = 1, 1
    4950         108 :                ks_bd = 0.0_dp
    4951         108 :                ks_bc = 0.0_dp
    4952         108 :                p_bd = pbd((md - 1)*1 + mb)
    4953         108 :                p_bc = pbc((mc - 1)*1 + mb)
    4954         216 :                DO ma = 1, 1
    4955         108 :                   p_index = p_index + 1
    4956         108 :                   tmp = scale*prim(p_index)
    4957         108 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    4958         108 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    4959         108 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    4960         216 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    4961             :                END DO
    4962         108 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    4963         216 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    4964             :             END DO
    4965             :          END DO
    4966             :       END DO
    4967           6 :    END SUBROUTINE block_1_1_2_9
    4968             : ! **************************************************************************************************
    4969             : !> \brief ...
    4970             : !> \param md_max ...
    4971             : !> \param kbd ...
    4972             : !> \param kbc ...
    4973             : !> \param kad ...
    4974             : !> \param kac ...
    4975             : !> \param pbd ...
    4976             : !> \param pbc ...
    4977             : !> \param pad ...
    4978             : !> \param pac ...
    4979             : !> \param prim ...
    4980             : !> \param scale ...
    4981             : ! **************************************************************************************************
    4982          15 :    SUBROUTINE block_1_1_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    4983             :       INTEGER                                            :: md_max
    4984             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*2), kad(1*md_max), kac(1*2), pbd(1*md_max), pbc(1*2), &
    4985             :          pad(1*md_max), pac(1*2), prim(1*1*2*md_max), scale
    4986             : 
    4987             :       INTEGER                                            :: ma, mb, mc, md, p_index
    4988             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    4989             : 
    4990         199 :       kbd(1:1*md_max) = 0.0_dp
    4991          15 :       kbc(1:1*2) = 0.0_dp
    4992         199 :       kad(1:1*md_max) = 0.0_dp
    4993          15 :       kac(1:1*2) = 0.0_dp
    4994          15 :       p_index = 0
    4995         199 :       DO md = 1, md_max
    4996         567 :          DO mc = 1, 2
    4997         920 :             DO mb = 1, 1
    4998         368 :                ks_bd = 0.0_dp
    4999         368 :                ks_bc = 0.0_dp
    5000         368 :                p_bd = pbd((md - 1)*1 + mb)
    5001         368 :                p_bc = pbc((mc - 1)*1 + mb)
    5002         736 :                DO ma = 1, 1
    5003         368 :                   p_index = p_index + 1
    5004         368 :                   tmp = scale*prim(p_index)
    5005         368 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5006         368 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5007         368 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5008         736 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5009             :                END DO
    5010         368 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5011         736 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5012             :             END DO
    5013             :          END DO
    5014             :       END DO
    5015          15 :    END SUBROUTINE block_1_1_2
    5016             : ! **************************************************************************************************
    5017             : !> \brief ...
    5018             : !> \param kbd ...
    5019             : !> \param kbc ...
    5020             : !> \param kad ...
    5021             : !> \param kac ...
    5022             : !> \param pbd ...
    5023             : !> \param pbc ...
    5024             : !> \param pad ...
    5025             : !> \param pac ...
    5026             : !> \param prim ...
    5027             : !> \param scale ...
    5028             : ! **************************************************************************************************
    5029     5072026 :    SUBROUTINE block_1_1_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5030             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*3), kad(1*1), kac(1*3), &
    5031             :                                                             pbd(1*1), pbc(1*3), pad(1*1), &
    5032             :                                                             pac(1*3), prim(1*1*3*1), scale
    5033             : 
    5034             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5035             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5036             : 
    5037     5072026 :       kbd(1:1*1) = 0.0_dp
    5038     5072026 :       kbc(1:1*3) = 0.0_dp
    5039     5072026 :       kad(1:1*1) = 0.0_dp
    5040     5072026 :       kac(1:1*3) = 0.0_dp
    5041     5072026 :       p_index = 0
    5042    10144052 :       DO md = 1, 1
    5043    25360130 :          DO mc = 1, 3
    5044    35504182 :             DO mb = 1, 1
    5045    15216078 :                ks_bd = 0.0_dp
    5046    15216078 :                ks_bc = 0.0_dp
    5047    15216078 :                p_bd = pbd((md - 1)*1 + mb)
    5048    15216078 :                p_bc = pbc((mc - 1)*1 + mb)
    5049    30432156 :                DO ma = 1, 1
    5050    15216078 :                   p_index = p_index + 1
    5051    15216078 :                   tmp = scale*prim(p_index)
    5052    15216078 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5053    15216078 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5054    15216078 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5055    30432156 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5056             :                END DO
    5057    15216078 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5058    30432156 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5059             :             END DO
    5060             :          END DO
    5061             :       END DO
    5062     5072026 :    END SUBROUTINE block_1_1_3_1
    5063             : ! **************************************************************************************************
    5064             : !> \brief ...
    5065             : !> \param kbd ...
    5066             : !> \param kbc ...
    5067             : !> \param kad ...
    5068             : !> \param kac ...
    5069             : !> \param pbd ...
    5070             : !> \param pbc ...
    5071             : !> \param pad ...
    5072             : !> \param pac ...
    5073             : !> \param prim ...
    5074             : !> \param scale ...
    5075             : ! **************************************************************************************************
    5076       15297 :    SUBROUTINE block_1_1_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5077             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*3), kad(1*2), kac(1*3), &
    5078             :                                                             pbd(1*2), pbc(1*3), pad(1*2), &
    5079             :                                                             pac(1*3), prim(1*1*3*2), scale
    5080             : 
    5081             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5082             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5083             : 
    5084       15297 :       kbd(1:1*2) = 0.0_dp
    5085       15297 :       kbc(1:1*3) = 0.0_dp
    5086       15297 :       kad(1:1*2) = 0.0_dp
    5087       15297 :       kac(1:1*3) = 0.0_dp
    5088       15297 :       p_index = 0
    5089       45891 :       DO md = 1, 2
    5090      137673 :          DO mc = 1, 3
    5091      214158 :             DO mb = 1, 1
    5092       91782 :                ks_bd = 0.0_dp
    5093       91782 :                ks_bc = 0.0_dp
    5094       91782 :                p_bd = pbd((md - 1)*1 + mb)
    5095       91782 :                p_bc = pbc((mc - 1)*1 + mb)
    5096      183564 :                DO ma = 1, 1
    5097       91782 :                   p_index = p_index + 1
    5098       91782 :                   tmp = scale*prim(p_index)
    5099       91782 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5100       91782 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5101       91782 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5102      183564 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5103             :                END DO
    5104       91782 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5105      183564 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5106             :             END DO
    5107             :          END DO
    5108             :       END DO
    5109       15297 :    END SUBROUTINE block_1_1_3_2
    5110             : ! **************************************************************************************************
    5111             : !> \brief ...
    5112             : !> \param kbd ...
    5113             : !> \param kbc ...
    5114             : !> \param kad ...
    5115             : !> \param kac ...
    5116             : !> \param pbd ...
    5117             : !> \param pbc ...
    5118             : !> \param pad ...
    5119             : !> \param pac ...
    5120             : !> \param prim ...
    5121             : !> \param scale ...
    5122             : ! **************************************************************************************************
    5123     2467850 :    SUBROUTINE block_1_1_3_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5124             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*3), kad(1*3), kac(1*3), &
    5125             :                                                             pbd(1*3), pbc(1*3), pad(1*3), &
    5126             :                                                             pac(1*3), prim(1*1*3*3), scale
    5127             : 
    5128             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5129             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5130             : 
    5131     2467850 :       kbd(1:1*3) = 0.0_dp
    5132     2467850 :       kbc(1:1*3) = 0.0_dp
    5133     2467850 :       kad(1:1*3) = 0.0_dp
    5134     2467850 :       kac(1:1*3) = 0.0_dp
    5135     2467850 :       p_index = 0
    5136     9871400 :       DO md = 1, 3
    5137    32082050 :          DO mc = 1, 3
    5138    51824850 :             DO mb = 1, 1
    5139    22210650 :                ks_bd = 0.0_dp
    5140    22210650 :                ks_bc = 0.0_dp
    5141    22210650 :                p_bd = pbd((md - 1)*1 + mb)
    5142    22210650 :                p_bc = pbc((mc - 1)*1 + mb)
    5143    44421300 :                DO ma = 1, 1
    5144    22210650 :                   p_index = p_index + 1
    5145    22210650 :                   tmp = scale*prim(p_index)
    5146    22210650 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5147    22210650 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5148    22210650 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5149    44421300 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5150             :                END DO
    5151    22210650 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5152    44421300 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5153             :             END DO
    5154             :          END DO
    5155             :       END DO
    5156     2467850 :    END SUBROUTINE block_1_1_3_3
    5157             : ! **************************************************************************************************
    5158             : !> \brief ...
    5159             : !> \param kbd ...
    5160             : !> \param kbc ...
    5161             : !> \param kad ...
    5162             : !> \param kac ...
    5163             : !> \param pbd ...
    5164             : !> \param pbc ...
    5165             : !> \param pad ...
    5166             : !> \param pac ...
    5167             : !> \param prim ...
    5168             : !> \param scale ...
    5169             : ! **************************************************************************************************
    5170       39352 :    SUBROUTINE block_1_1_3_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5171             :       REAL(KIND=dp)                                      :: kbd(1*4), kbc(1*3), kad(1*4), kac(1*3), &
    5172             :                                                             pbd(1*4), pbc(1*3), pad(1*4), &
    5173             :                                                             pac(1*3), prim(1*1*3*4), scale
    5174             : 
    5175             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5176             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5177             : 
    5178       39352 :       kbd(1:1*4) = 0.0_dp
    5179       39352 :       kbc(1:1*3) = 0.0_dp
    5180       39352 :       kad(1:1*4) = 0.0_dp
    5181       39352 :       kac(1:1*3) = 0.0_dp
    5182       39352 :       p_index = 0
    5183      196760 :       DO md = 1, 4
    5184      668984 :          DO mc = 1, 3
    5185     1101856 :             DO mb = 1, 1
    5186      472224 :                ks_bd = 0.0_dp
    5187      472224 :                ks_bc = 0.0_dp
    5188      472224 :                p_bd = pbd((md - 1)*1 + mb)
    5189      472224 :                p_bc = pbc((mc - 1)*1 + mb)
    5190      944448 :                DO ma = 1, 1
    5191      472224 :                   p_index = p_index + 1
    5192      472224 :                   tmp = scale*prim(p_index)
    5193      472224 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5194      472224 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5195      472224 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5196      944448 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5197             :                END DO
    5198      472224 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5199      944448 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5200             :             END DO
    5201             :          END DO
    5202             :       END DO
    5203       39352 :    END SUBROUTINE block_1_1_3_4
    5204             : ! **************************************************************************************************
    5205             : !> \brief ...
    5206             : !> \param kbd ...
    5207             : !> \param kbc ...
    5208             : !> \param kad ...
    5209             : !> \param kac ...
    5210             : !> \param pbd ...
    5211             : !> \param pbc ...
    5212             : !> \param pad ...
    5213             : !> \param pac ...
    5214             : !> \param prim ...
    5215             : !> \param scale ...
    5216             : ! **************************************************************************************************
    5217      135264 :    SUBROUTINE block_1_1_3_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5218             :       REAL(KIND=dp)                                      :: kbd(1*5), kbc(1*3), kad(1*5), kac(1*3), &
    5219             :                                                             pbd(1*5), pbc(1*3), pad(1*5), &
    5220             :                                                             pac(1*3), prim(1*1*3*5), scale
    5221             : 
    5222             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5223             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5224             : 
    5225      135264 :       kbd(1:1*5) = 0.0_dp
    5226      135264 :       kbc(1:1*3) = 0.0_dp
    5227      135264 :       kad(1:1*5) = 0.0_dp
    5228      135264 :       kac(1:1*3) = 0.0_dp
    5229      135264 :       p_index = 0
    5230      811584 :       DO md = 1, 5
    5231     2840544 :          DO mc = 1, 3
    5232     4734240 :             DO mb = 1, 1
    5233     2028960 :                ks_bd = 0.0_dp
    5234     2028960 :                ks_bc = 0.0_dp
    5235     2028960 :                p_bd = pbd((md - 1)*1 + mb)
    5236     2028960 :                p_bc = pbc((mc - 1)*1 + mb)
    5237     4057920 :                DO ma = 1, 1
    5238     2028960 :                   p_index = p_index + 1
    5239     2028960 :                   tmp = scale*prim(p_index)
    5240     2028960 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5241     2028960 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5242     2028960 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5243     4057920 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5244             :                END DO
    5245     2028960 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5246     4057920 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5247             :             END DO
    5248             :          END DO
    5249             :       END DO
    5250      135264 :    END SUBROUTINE block_1_1_3_5
    5251             : ! **************************************************************************************************
    5252             : !> \brief ...
    5253             : !> \param kbd ...
    5254             : !> \param kbc ...
    5255             : !> \param kad ...
    5256             : !> \param kac ...
    5257             : !> \param pbd ...
    5258             : !> \param pbc ...
    5259             : !> \param pad ...
    5260             : !> \param pac ...
    5261             : !> \param prim ...
    5262             : !> \param scale ...
    5263             : ! **************************************************************************************************
    5264           7 :    SUBROUTINE block_1_1_3_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5265             :       REAL(KIND=dp)                                      :: kbd(1*6), kbc(1*3), kad(1*6), kac(1*3), &
    5266             :                                                             pbd(1*6), pbc(1*3), pad(1*6), &
    5267             :                                                             pac(1*3), prim(1*1*3*6), scale
    5268             : 
    5269             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5270             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5271             : 
    5272           7 :       kbd(1:1*6) = 0.0_dp
    5273           7 :       kbc(1:1*3) = 0.0_dp
    5274           7 :       kad(1:1*6) = 0.0_dp
    5275           7 :       kac(1:1*3) = 0.0_dp
    5276           7 :       p_index = 0
    5277          49 :       DO md = 1, 6
    5278         175 :          DO mc = 1, 3
    5279         294 :             DO mb = 1, 1
    5280         126 :                ks_bd = 0.0_dp
    5281         126 :                ks_bc = 0.0_dp
    5282         126 :                p_bd = pbd((md - 1)*1 + mb)
    5283         126 :                p_bc = pbc((mc - 1)*1 + mb)
    5284         252 :                DO ma = 1, 1
    5285         126 :                   p_index = p_index + 1
    5286         126 :                   tmp = scale*prim(p_index)
    5287         126 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5288         126 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5289         126 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5290         252 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5291             :                END DO
    5292         126 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5293         252 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5294             :             END DO
    5295             :          END DO
    5296             :       END DO
    5297           7 :    END SUBROUTINE block_1_1_3_6
    5298             : ! **************************************************************************************************
    5299             : !> \brief ...
    5300             : !> \param md_max ...
    5301             : !> \param kbd ...
    5302             : !> \param kbc ...
    5303             : !> \param kad ...
    5304             : !> \param kac ...
    5305             : !> \param pbd ...
    5306             : !> \param pbc ...
    5307             : !> \param pad ...
    5308             : !> \param pac ...
    5309             : !> \param prim ...
    5310             : !> \param scale ...
    5311             : ! **************************************************************************************************
    5312       23924 :    SUBROUTINE block_1_1_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5313             :       INTEGER                                            :: md_max
    5314             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*3), kad(1*md_max), kac(1*3), pbd(1*md_max), pbc(1*3), &
    5315             :          pad(1*md_max), pac(1*3), prim(1*1*3*md_max), scale
    5316             : 
    5317             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5318             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5319             : 
    5320      191482 :       kbd(1:1*md_max) = 0.0_dp
    5321       23924 :       kbc(1:1*3) = 0.0_dp
    5322      191482 :       kad(1:1*md_max) = 0.0_dp
    5323       23924 :       kac(1:1*3) = 0.0_dp
    5324       23924 :       p_index = 0
    5325      191482 :       DO md = 1, md_max
    5326      694156 :          DO mc = 1, 3
    5327     1172906 :             DO mb = 1, 1
    5328      502674 :                ks_bd = 0.0_dp
    5329      502674 :                ks_bc = 0.0_dp
    5330      502674 :                p_bd = pbd((md - 1)*1 + mb)
    5331      502674 :                p_bc = pbc((mc - 1)*1 + mb)
    5332     1005348 :                DO ma = 1, 1
    5333      502674 :                   p_index = p_index + 1
    5334      502674 :                   tmp = scale*prim(p_index)
    5335      502674 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5336      502674 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5337      502674 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5338     1005348 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5339             :                END DO
    5340      502674 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5341     1005348 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5342             :             END DO
    5343             :          END DO
    5344             :       END DO
    5345       23924 :    END SUBROUTINE block_1_1_3
    5346             : ! **************************************************************************************************
    5347             : !> \brief ...
    5348             : !> \param kbd ...
    5349             : !> \param kbc ...
    5350             : !> \param kad ...
    5351             : !> \param kac ...
    5352             : !> \param pbd ...
    5353             : !> \param pbc ...
    5354             : !> \param pad ...
    5355             : !> \param pac ...
    5356             : !> \param prim ...
    5357             : !> \param scale ...
    5358             : ! **************************************************************************************************
    5359      709633 :    SUBROUTINE block_1_1_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5360             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*4), kad(1*1), kac(1*4), &
    5361             :                                                             pbd(1*1), pbc(1*4), pad(1*1), &
    5362             :                                                             pac(1*4), prim(1*1*4*1), scale
    5363             : 
    5364             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5365             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5366             : 
    5367      709633 :       kbd(1:1*1) = 0.0_dp
    5368      709633 :       kbc(1:1*4) = 0.0_dp
    5369      709633 :       kad(1:1*1) = 0.0_dp
    5370      709633 :       kac(1:1*4) = 0.0_dp
    5371      709633 :       p_index = 0
    5372     1419266 :       DO md = 1, 1
    5373     4257798 :          DO mc = 1, 4
    5374     6386697 :             DO mb = 1, 1
    5375     2838532 :                ks_bd = 0.0_dp
    5376     2838532 :                ks_bc = 0.0_dp
    5377     2838532 :                p_bd = pbd((md - 1)*1 + mb)
    5378     2838532 :                p_bc = pbc((mc - 1)*1 + mb)
    5379     5677064 :                DO ma = 1, 1
    5380     2838532 :                   p_index = p_index + 1
    5381     2838532 :                   tmp = scale*prim(p_index)
    5382     2838532 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5383     2838532 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5384     2838532 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5385     5677064 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5386             :                END DO
    5387     2838532 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5388     5677064 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5389             :             END DO
    5390             :          END DO
    5391             :       END DO
    5392      709633 :    END SUBROUTINE block_1_1_4_1
    5393             : ! **************************************************************************************************
    5394             : !> \brief ...
    5395             : !> \param kbd ...
    5396             : !> \param kbc ...
    5397             : !> \param kad ...
    5398             : !> \param kac ...
    5399             : !> \param pbd ...
    5400             : !> \param pbc ...
    5401             : !> \param pad ...
    5402             : !> \param pac ...
    5403             : !> \param prim ...
    5404             : !> \param scale ...
    5405             : ! **************************************************************************************************
    5406           4 :    SUBROUTINE block_1_1_4_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5407             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*4), kad(1*2), kac(1*4), &
    5408             :                                                             pbd(1*2), pbc(1*4), pad(1*2), &
    5409             :                                                             pac(1*4), prim(1*1*4*2), scale
    5410             : 
    5411             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5412             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5413             : 
    5414           4 :       kbd(1:1*2) = 0.0_dp
    5415           4 :       kbc(1:1*4) = 0.0_dp
    5416           4 :       kad(1:1*2) = 0.0_dp
    5417           4 :       kac(1:1*4) = 0.0_dp
    5418           4 :       p_index = 0
    5419          12 :       DO md = 1, 2
    5420          44 :          DO mc = 1, 4
    5421          72 :             DO mb = 1, 1
    5422          32 :                ks_bd = 0.0_dp
    5423          32 :                ks_bc = 0.0_dp
    5424          32 :                p_bd = pbd((md - 1)*1 + mb)
    5425          32 :                p_bc = pbc((mc - 1)*1 + mb)
    5426          64 :                DO ma = 1, 1
    5427          32 :                   p_index = p_index + 1
    5428          32 :                   tmp = scale*prim(p_index)
    5429          32 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5430          32 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5431          32 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5432          64 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5433             :                END DO
    5434          32 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5435          64 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5436             :             END DO
    5437             :          END DO
    5438             :       END DO
    5439           4 :    END SUBROUTINE block_1_1_4_2
    5440             : ! **************************************************************************************************
    5441             : !> \brief ...
    5442             : !> \param kbd ...
    5443             : !> \param kbc ...
    5444             : !> \param kad ...
    5445             : !> \param kac ...
    5446             : !> \param pbd ...
    5447             : !> \param pbc ...
    5448             : !> \param pad ...
    5449             : !> \param pac ...
    5450             : !> \param prim ...
    5451             : !> \param scale ...
    5452             : ! **************************************************************************************************
    5453      264088 :    SUBROUTINE block_1_1_4_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5454             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*4), kad(1*3), kac(1*4), &
    5455             :                                                             pbd(1*3), pbc(1*4), pad(1*3), &
    5456             :                                                             pac(1*4), prim(1*1*4*3), scale
    5457             : 
    5458             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5459             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5460             : 
    5461      264088 :       kbd(1:1*3) = 0.0_dp
    5462      264088 :       kbc(1:1*4) = 0.0_dp
    5463      264088 :       kad(1:1*3) = 0.0_dp
    5464      264088 :       kac(1:1*4) = 0.0_dp
    5465      264088 :       p_index = 0
    5466     1056352 :       DO md = 1, 3
    5467     4225408 :          DO mc = 1, 4
    5468     7130376 :             DO mb = 1, 1
    5469     3169056 :                ks_bd = 0.0_dp
    5470     3169056 :                ks_bc = 0.0_dp
    5471     3169056 :                p_bd = pbd((md - 1)*1 + mb)
    5472     3169056 :                p_bc = pbc((mc - 1)*1 + mb)
    5473     6338112 :                DO ma = 1, 1
    5474     3169056 :                   p_index = p_index + 1
    5475     3169056 :                   tmp = scale*prim(p_index)
    5476     3169056 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5477     3169056 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5478     3169056 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5479     6338112 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5480             :                END DO
    5481     3169056 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5482     6338112 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5483             :             END DO
    5484             :          END DO
    5485             :       END DO
    5486      264088 :    END SUBROUTINE block_1_1_4_3
    5487             : ! **************************************************************************************************
    5488             : !> \brief ...
    5489             : !> \param kbd ...
    5490             : !> \param kbc ...
    5491             : !> \param kad ...
    5492             : !> \param kac ...
    5493             : !> \param pbd ...
    5494             : !> \param pbc ...
    5495             : !> \param pad ...
    5496             : !> \param pac ...
    5497             : !> \param prim ...
    5498             : !> \param scale ...
    5499             : ! **************************************************************************************************
    5500      362454 :    SUBROUTINE block_1_1_4_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5501             :       REAL(KIND=dp)                                      :: kbd(1*4), kbc(1*4), kad(1*4), kac(1*4), &
    5502             :                                                             pbd(1*4), pbc(1*4), pad(1*4), &
    5503             :                                                             pac(1*4), prim(1*1*4*4), scale
    5504             : 
    5505             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5506             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5507             : 
    5508      362454 :       kbd(1:1*4) = 0.0_dp
    5509      362454 :       kbc(1:1*4) = 0.0_dp
    5510      362454 :       kad(1:1*4) = 0.0_dp
    5511      362454 :       kac(1:1*4) = 0.0_dp
    5512      362454 :       p_index = 0
    5513     1812270 :       DO md = 1, 4
    5514     7611534 :          DO mc = 1, 4
    5515    13048344 :             DO mb = 1, 1
    5516     5799264 :                ks_bd = 0.0_dp
    5517     5799264 :                ks_bc = 0.0_dp
    5518     5799264 :                p_bd = pbd((md - 1)*1 + mb)
    5519     5799264 :                p_bc = pbc((mc - 1)*1 + mb)
    5520    11598528 :                DO ma = 1, 1
    5521     5799264 :                   p_index = p_index + 1
    5522     5799264 :                   tmp = scale*prim(p_index)
    5523     5799264 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5524     5799264 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5525     5799264 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5526    11598528 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5527             :                END DO
    5528     5799264 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5529    11598528 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5530             :             END DO
    5531             :          END DO
    5532             :       END DO
    5533      362454 :    END SUBROUTINE block_1_1_4_4
    5534             : ! **************************************************************************************************
    5535             : !> \brief ...
    5536             : !> \param md_max ...
    5537             : !> \param kbd ...
    5538             : !> \param kbc ...
    5539             : !> \param kad ...
    5540             : !> \param kac ...
    5541             : !> \param pbd ...
    5542             : !> \param pbc ...
    5543             : !> \param pad ...
    5544             : !> \param pac ...
    5545             : !> \param prim ...
    5546             : !> \param scale ...
    5547             : ! **************************************************************************************************
    5548      156552 :    SUBROUTINE block_1_1_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5549             :       INTEGER                                            :: md_max
    5550             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*4), kad(1*md_max), kac(1*4), pbd(1*md_max), pbc(1*4), &
    5551             :          pad(1*md_max), pac(1*4), prim(1*1*4*md_max), scale
    5552             : 
    5553             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5554             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5555             : 
    5556      939788 :       kbd(1:1*md_max) = 0.0_dp
    5557      156552 :       kbc(1:1*4) = 0.0_dp
    5558      939788 :       kad(1:1*md_max) = 0.0_dp
    5559      156552 :       kac(1:1*4) = 0.0_dp
    5560      156552 :       p_index = 0
    5561      939788 :       DO md = 1, md_max
    5562     4072732 :          DO mc = 1, 4
    5563     7049124 :             DO mb = 1, 1
    5564     3132944 :                ks_bd = 0.0_dp
    5565     3132944 :                ks_bc = 0.0_dp
    5566     3132944 :                p_bd = pbd((md - 1)*1 + mb)
    5567     3132944 :                p_bc = pbc((mc - 1)*1 + mb)
    5568     6265888 :                DO ma = 1, 1
    5569     3132944 :                   p_index = p_index + 1
    5570     3132944 :                   tmp = scale*prim(p_index)
    5571     3132944 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5572     3132944 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5573     3132944 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5574     6265888 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5575             :                END DO
    5576     3132944 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5577     6265888 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5578             :             END DO
    5579             :          END DO
    5580             :       END DO
    5581      156552 :    END SUBROUTINE block_1_1_4
    5582             : ! **************************************************************************************************
    5583             : !> \brief ...
    5584             : !> \param kbd ...
    5585             : !> \param kbc ...
    5586             : !> \param kad ...
    5587             : !> \param kac ...
    5588             : !> \param pbd ...
    5589             : !> \param pbc ...
    5590             : !> \param pad ...
    5591             : !> \param pac ...
    5592             : !> \param prim ...
    5593             : !> \param scale ...
    5594             : ! **************************************************************************************************
    5595      586488 :    SUBROUTINE block_1_1_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5596             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*5), kad(1*1), kac(1*5), &
    5597             :                                                             pbd(1*1), pbc(1*5), pad(1*1), &
    5598             :                                                             pac(1*5), prim(1*1*5*1), scale
    5599             : 
    5600             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5601             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5602             : 
    5603      586488 :       kbd(1:1*1) = 0.0_dp
    5604      586488 :       kbc(1:1*5) = 0.0_dp
    5605      586488 :       kad(1:1*1) = 0.0_dp
    5606      586488 :       kac(1:1*5) = 0.0_dp
    5607      586488 :       p_index = 0
    5608     1172976 :       DO md = 1, 1
    5609     4105416 :          DO mc = 1, 5
    5610     6451368 :             DO mb = 1, 1
    5611     2932440 :                ks_bd = 0.0_dp
    5612     2932440 :                ks_bc = 0.0_dp
    5613     2932440 :                p_bd = pbd((md - 1)*1 + mb)
    5614     2932440 :                p_bc = pbc((mc - 1)*1 + mb)
    5615     5864880 :                DO ma = 1, 1
    5616     2932440 :                   p_index = p_index + 1
    5617     2932440 :                   tmp = scale*prim(p_index)
    5618     2932440 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5619     2932440 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5620     2932440 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5621     5864880 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5622             :                END DO
    5623     2932440 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5624     5864880 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5625             :             END DO
    5626             :          END DO
    5627             :       END DO
    5628      586488 :    END SUBROUTINE block_1_1_5_1
    5629             : ! **************************************************************************************************
    5630             : !> \brief ...
    5631             : !> \param kbd ...
    5632             : !> \param kbc ...
    5633             : !> \param kad ...
    5634             : !> \param kac ...
    5635             : !> \param pbd ...
    5636             : !> \param pbc ...
    5637             : !> \param pad ...
    5638             : !> \param pac ...
    5639             : !> \param prim ...
    5640             : !> \param scale ...
    5641             : ! **************************************************************************************************
    5642       10248 :    SUBROUTINE block_1_1_5_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5643             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*5), kad(1*2), kac(1*5), &
    5644             :                                                             pbd(1*2), pbc(1*5), pad(1*2), &
    5645             :                                                             pac(1*5), prim(1*1*5*2), scale
    5646             : 
    5647             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5648             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5649             : 
    5650       10248 :       kbd(1:1*2) = 0.0_dp
    5651       10248 :       kbc(1:1*5) = 0.0_dp
    5652       10248 :       kad(1:1*2) = 0.0_dp
    5653       10248 :       kac(1:1*5) = 0.0_dp
    5654       10248 :       p_index = 0
    5655       30744 :       DO md = 1, 2
    5656      133224 :          DO mc = 1, 5
    5657      225456 :             DO mb = 1, 1
    5658      102480 :                ks_bd = 0.0_dp
    5659      102480 :                ks_bc = 0.0_dp
    5660      102480 :                p_bd = pbd((md - 1)*1 + mb)
    5661      102480 :                p_bc = pbc((mc - 1)*1 + mb)
    5662      204960 :                DO ma = 1, 1
    5663      102480 :                   p_index = p_index + 1
    5664      102480 :                   tmp = scale*prim(p_index)
    5665      102480 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5666      102480 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5667      102480 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5668      204960 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5669             :                END DO
    5670      102480 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5671      204960 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5672             :             END DO
    5673             :          END DO
    5674             :       END DO
    5675       10248 :    END SUBROUTINE block_1_1_5_2
    5676             : ! **************************************************************************************************
    5677             : !> \brief ...
    5678             : !> \param kbd ...
    5679             : !> \param kbc ...
    5680             : !> \param kad ...
    5681             : !> \param kac ...
    5682             : !> \param pbd ...
    5683             : !> \param pbc ...
    5684             : !> \param pad ...
    5685             : !> \param pac ...
    5686             : !> \param prim ...
    5687             : !> \param scale ...
    5688             : ! **************************************************************************************************
    5689      305403 :    SUBROUTINE block_1_1_5_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5690             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*5), kad(1*3), kac(1*5), &
    5691             :                                                             pbd(1*3), pbc(1*5), pad(1*3), &
    5692             :                                                             pac(1*5), prim(1*1*5*3), scale
    5693             : 
    5694             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5695             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5696             : 
    5697      305403 :       kbd(1:1*3) = 0.0_dp
    5698      305403 :       kbc(1:1*5) = 0.0_dp
    5699      305403 :       kad(1:1*3) = 0.0_dp
    5700      305403 :       kac(1:1*5) = 0.0_dp
    5701      305403 :       p_index = 0
    5702     1221612 :       DO md = 1, 3
    5703     5802657 :          DO mc = 1, 5
    5704    10078299 :             DO mb = 1, 1
    5705     4581045 :                ks_bd = 0.0_dp
    5706     4581045 :                ks_bc = 0.0_dp
    5707     4581045 :                p_bd = pbd((md - 1)*1 + mb)
    5708     4581045 :                p_bc = pbc((mc - 1)*1 + mb)
    5709     9162090 :                DO ma = 1, 1
    5710     4581045 :                   p_index = p_index + 1
    5711     4581045 :                   tmp = scale*prim(p_index)
    5712     4581045 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5713     4581045 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5714     4581045 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5715     9162090 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5716             :                END DO
    5717     4581045 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5718     9162090 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5719             :             END DO
    5720             :          END DO
    5721             :       END DO
    5722      305403 :    END SUBROUTINE block_1_1_5_3
    5723             : ! **************************************************************************************************
    5724             : !> \brief ...
    5725             : !> \param md_max ...
    5726             : !> \param kbd ...
    5727             : !> \param kbc ...
    5728             : !> \param kad ...
    5729             : !> \param kac ...
    5730             : !> \param pbd ...
    5731             : !> \param pbc ...
    5732             : !> \param pad ...
    5733             : !> \param pac ...
    5734             : !> \param prim ...
    5735             : !> \param scale ...
    5736             : ! **************************************************************************************************
    5737      301865 :    SUBROUTINE block_1_1_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5738             :       INTEGER                                            :: md_max
    5739             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*5), kad(1*md_max), kac(1*5), pbd(1*md_max), pbc(1*5), &
    5740             :          pad(1*md_max), pac(1*5), prim(1*1*5*md_max), scale
    5741             : 
    5742             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5743             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5744             : 
    5745     1676526 :       kbd(1:1*md_max) = 0.0_dp
    5746      301865 :       kbc(1:1*5) = 0.0_dp
    5747     1676526 :       kad(1:1*md_max) = 0.0_dp
    5748      301865 :       kac(1:1*5) = 0.0_dp
    5749      301865 :       p_index = 0
    5750     1676526 :       DO md = 1, md_max
    5751     8549831 :          DO mc = 1, 5
    5752    15121271 :             DO mb = 1, 1
    5753     6873305 :                ks_bd = 0.0_dp
    5754     6873305 :                ks_bc = 0.0_dp
    5755     6873305 :                p_bd = pbd((md - 1)*1 + mb)
    5756     6873305 :                p_bc = pbc((mc - 1)*1 + mb)
    5757    13746610 :                DO ma = 1, 1
    5758     6873305 :                   p_index = p_index + 1
    5759     6873305 :                   tmp = scale*prim(p_index)
    5760     6873305 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5761     6873305 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5762     6873305 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5763    13746610 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5764             :                END DO
    5765     6873305 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5766    13746610 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5767             :             END DO
    5768             :          END DO
    5769             :       END DO
    5770      301865 :    END SUBROUTINE block_1_1_5
    5771             : ! **************************************************************************************************
    5772             : !> \brief ...
    5773             : !> \param kbd ...
    5774             : !> \param kbc ...
    5775             : !> \param kad ...
    5776             : !> \param kac ...
    5777             : !> \param pbd ...
    5778             : !> \param pbc ...
    5779             : !> \param pad ...
    5780             : !> \param pac ...
    5781             : !> \param prim ...
    5782             : !> \param scale ...
    5783             : ! **************************************************************************************************
    5784           5 :    SUBROUTINE block_1_1_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5785             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*6), kad(1*1), kac(1*6), &
    5786             :                                                             pbd(1*1), pbc(1*6), pad(1*1), &
    5787             :                                                             pac(1*6), prim(1*1*6*1), scale
    5788             : 
    5789             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5790             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5791             : 
    5792           5 :       kbd(1:1*1) = 0.0_dp
    5793           5 :       kbc(1:1*6) = 0.0_dp
    5794           5 :       kad(1:1*1) = 0.0_dp
    5795           5 :       kac(1:1*6) = 0.0_dp
    5796           5 :       p_index = 0
    5797          10 :       DO md = 1, 1
    5798          40 :          DO mc = 1, 6
    5799          65 :             DO mb = 1, 1
    5800          30 :                ks_bd = 0.0_dp
    5801          30 :                ks_bc = 0.0_dp
    5802          30 :                p_bd = pbd((md - 1)*1 + mb)
    5803          30 :                p_bc = pbc((mc - 1)*1 + mb)
    5804          60 :                DO ma = 1, 1
    5805          30 :                   p_index = p_index + 1
    5806          30 :                   tmp = scale*prim(p_index)
    5807          30 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5808          30 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5809          30 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5810          60 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5811             :                END DO
    5812          30 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5813          60 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5814             :             END DO
    5815             :          END DO
    5816             :       END DO
    5817           5 :    END SUBROUTINE block_1_1_6_1
    5818             : ! **************************************************************************************************
    5819             : !> \brief ...
    5820             : !> \param kbd ...
    5821             : !> \param kbc ...
    5822             : !> \param kad ...
    5823             : !> \param kac ...
    5824             : !> \param pbd ...
    5825             : !> \param pbc ...
    5826             : !> \param pad ...
    5827             : !> \param pac ...
    5828             : !> \param prim ...
    5829             : !> \param scale ...
    5830             : ! **************************************************************************************************
    5831           1 :    SUBROUTINE block_1_1_6_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5832             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*6), kad(1*2), kac(1*6), &
    5833             :                                                             pbd(1*2), pbc(1*6), pad(1*2), &
    5834             :                                                             pac(1*6), prim(1*1*6*2), scale
    5835             : 
    5836             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5837             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5838             : 
    5839           1 :       kbd(1:1*2) = 0.0_dp
    5840           1 :       kbc(1:1*6) = 0.0_dp
    5841           1 :       kad(1:1*2) = 0.0_dp
    5842           1 :       kac(1:1*6) = 0.0_dp
    5843           1 :       p_index = 0
    5844           3 :       DO md = 1, 2
    5845          15 :          DO mc = 1, 6
    5846          26 :             DO mb = 1, 1
    5847          12 :                ks_bd = 0.0_dp
    5848          12 :                ks_bc = 0.0_dp
    5849          12 :                p_bd = pbd((md - 1)*1 + mb)
    5850          12 :                p_bc = pbc((mc - 1)*1 + mb)
    5851          24 :                DO ma = 1, 1
    5852          12 :                   p_index = p_index + 1
    5853          12 :                   tmp = scale*prim(p_index)
    5854          12 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5855          12 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5856          12 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5857          24 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5858             :                END DO
    5859          12 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5860          24 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5861             :             END DO
    5862             :          END DO
    5863             :       END DO
    5864           1 :    END SUBROUTINE block_1_1_6_2
    5865             : ! **************************************************************************************************
    5866             : !> \brief ...
    5867             : !> \param kbd ...
    5868             : !> \param kbc ...
    5869             : !> \param kad ...
    5870             : !> \param kac ...
    5871             : !> \param pbd ...
    5872             : !> \param pbc ...
    5873             : !> \param pad ...
    5874             : !> \param pac ...
    5875             : !> \param prim ...
    5876             : !> \param scale ...
    5877             : ! **************************************************************************************************
    5878           1 :    SUBROUTINE block_1_1_6_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5879             :       REAL(KIND=dp)                                      :: kbd(1*3), kbc(1*6), kad(1*3), kac(1*6), &
    5880             :                                                             pbd(1*3), pbc(1*6), pad(1*3), &
    5881             :                                                             pac(1*6), prim(1*1*6*3), scale
    5882             : 
    5883             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5884             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5885             : 
    5886           1 :       kbd(1:1*3) = 0.0_dp
    5887           1 :       kbc(1:1*6) = 0.0_dp
    5888           1 :       kad(1:1*3) = 0.0_dp
    5889           1 :       kac(1:1*6) = 0.0_dp
    5890           1 :       p_index = 0
    5891           4 :       DO md = 1, 3
    5892          22 :          DO mc = 1, 6
    5893          39 :             DO mb = 1, 1
    5894          18 :                ks_bd = 0.0_dp
    5895          18 :                ks_bc = 0.0_dp
    5896          18 :                p_bd = pbd((md - 1)*1 + mb)
    5897          18 :                p_bc = pbc((mc - 1)*1 + mb)
    5898          36 :                DO ma = 1, 1
    5899          18 :                   p_index = p_index + 1
    5900          18 :                   tmp = scale*prim(p_index)
    5901          18 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5902          18 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5903          18 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5904          36 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5905             :                END DO
    5906          18 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5907          36 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5908             :             END DO
    5909             :          END DO
    5910             :       END DO
    5911           1 :    END SUBROUTINE block_1_1_6_3
    5912             : ! **************************************************************************************************
    5913             : !> \brief ...
    5914             : !> \param md_max ...
    5915             : !> \param kbd ...
    5916             : !> \param kbc ...
    5917             : !> \param kad ...
    5918             : !> \param kac ...
    5919             : !> \param pbd ...
    5920             : !> \param pbc ...
    5921             : !> \param pad ...
    5922             : !> \param pac ...
    5923             : !> \param prim ...
    5924             : !> \param scale ...
    5925             : ! **************************************************************************************************
    5926          20 :    SUBROUTINE block_1_1_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5927             :       INTEGER                                            :: md_max
    5928             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*6), kad(1*md_max), kac(1*6), pbd(1*md_max), pbc(1*6), &
    5929             :          pad(1*md_max), pac(1*6), prim(1*1*6*md_max), scale
    5930             : 
    5931             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5932             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5933             : 
    5934         194 :       kbd(1:1*md_max) = 0.0_dp
    5935          20 :       kbc(1:1*6) = 0.0_dp
    5936         194 :       kad(1:1*md_max) = 0.0_dp
    5937          20 :       kac(1:1*6) = 0.0_dp
    5938          20 :       p_index = 0
    5939         194 :       DO md = 1, md_max
    5940        1238 :          DO mc = 1, 6
    5941        2262 :             DO mb = 1, 1
    5942        1044 :                ks_bd = 0.0_dp
    5943        1044 :                ks_bc = 0.0_dp
    5944        1044 :                p_bd = pbd((md - 1)*1 + mb)
    5945        1044 :                p_bc = pbc((mc - 1)*1 + mb)
    5946        2088 :                DO ma = 1, 1
    5947        1044 :                   p_index = p_index + 1
    5948        1044 :                   tmp = scale*prim(p_index)
    5949        1044 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5950        1044 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5951        1044 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5952        2088 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    5953             :                END DO
    5954        1044 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    5955        2088 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    5956             :             END DO
    5957             :          END DO
    5958             :       END DO
    5959          20 :    END SUBROUTINE block_1_1_6
    5960             : ! **************************************************************************************************
    5961             : !> \brief ...
    5962             : !> \param kbd ...
    5963             : !> \param kbc ...
    5964             : !> \param kad ...
    5965             : !> \param kac ...
    5966             : !> \param pbd ...
    5967             : !> \param pbc ...
    5968             : !> \param pad ...
    5969             : !> \param pac ...
    5970             : !> \param prim ...
    5971             : !> \param scale ...
    5972             : ! **************************************************************************************************
    5973       55545 :    SUBROUTINE block_1_1_7_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    5974             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*7), kad(1*1), kac(1*7), &
    5975             :                                                             pbd(1*1), pbc(1*7), pad(1*1), &
    5976             :                                                             pac(1*7), prim(1*1*7*1), scale
    5977             : 
    5978             :       INTEGER                                            :: ma, mb, mc, md, p_index
    5979             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    5980             : 
    5981       55545 :       kbd(1:1*1) = 0.0_dp
    5982       55545 :       kbc(1:1*7) = 0.0_dp
    5983       55545 :       kad(1:1*1) = 0.0_dp
    5984       55545 :       kac(1:1*7) = 0.0_dp
    5985       55545 :       p_index = 0
    5986      111090 :       DO md = 1, 1
    5987      499905 :          DO mc = 1, 7
    5988      833175 :             DO mb = 1, 1
    5989      388815 :                ks_bd = 0.0_dp
    5990      388815 :                ks_bc = 0.0_dp
    5991      388815 :                p_bd = pbd((md - 1)*1 + mb)
    5992      388815 :                p_bc = pbc((mc - 1)*1 + mb)
    5993      777630 :                DO ma = 1, 1
    5994      388815 :                   p_index = p_index + 1
    5995      388815 :                   tmp = scale*prim(p_index)
    5996      388815 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    5997      388815 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    5998      388815 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    5999      777630 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6000             :                END DO
    6001      388815 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6002      777630 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6003             :             END DO
    6004             :          END DO
    6005             :       END DO
    6006       55545 :    END SUBROUTINE block_1_1_7_1
    6007             : ! **************************************************************************************************
    6008             : !> \brief ...
    6009             : !> \param kbd ...
    6010             : !> \param kbc ...
    6011             : !> \param kad ...
    6012             : !> \param kac ...
    6013             : !> \param pbd ...
    6014             : !> \param pbc ...
    6015             : !> \param pad ...
    6016             : !> \param pac ...
    6017             : !> \param prim ...
    6018             : !> \param scale ...
    6019             : ! **************************************************************************************************
    6020         737 :    SUBROUTINE block_1_1_7_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6021             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*7), kad(1*2), kac(1*7), &
    6022             :                                                             pbd(1*2), pbc(1*7), pad(1*2), &
    6023             :                                                             pac(1*7), prim(1*1*7*2), scale
    6024             : 
    6025             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6026             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6027             : 
    6028         737 :       kbd(1:1*2) = 0.0_dp
    6029         737 :       kbc(1:1*7) = 0.0_dp
    6030         737 :       kad(1:1*2) = 0.0_dp
    6031         737 :       kac(1:1*7) = 0.0_dp
    6032         737 :       p_index = 0
    6033        2211 :       DO md = 1, 2
    6034       12529 :          DO mc = 1, 7
    6035       22110 :             DO mb = 1, 1
    6036       10318 :                ks_bd = 0.0_dp
    6037       10318 :                ks_bc = 0.0_dp
    6038       10318 :                p_bd = pbd((md - 1)*1 + mb)
    6039       10318 :                p_bc = pbc((mc - 1)*1 + mb)
    6040       20636 :                DO ma = 1, 1
    6041       10318 :                   p_index = p_index + 1
    6042       10318 :                   tmp = scale*prim(p_index)
    6043       10318 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6044       10318 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6045       10318 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6046       20636 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6047             :                END DO
    6048       10318 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6049       20636 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6050             :             END DO
    6051             :          END DO
    6052             :       END DO
    6053         737 :    END SUBROUTINE block_1_1_7_2
    6054             : ! **************************************************************************************************
    6055             : !> \brief ...
    6056             : !> \param md_max ...
    6057             : !> \param kbd ...
    6058             : !> \param kbc ...
    6059             : !> \param kad ...
    6060             : !> \param kac ...
    6061             : !> \param pbd ...
    6062             : !> \param pbc ...
    6063             : !> \param pad ...
    6064             : !> \param pac ...
    6065             : !> \param prim ...
    6066             : !> \param scale ...
    6067             : ! **************************************************************************************************
    6068       51383 :    SUBROUTINE block_1_1_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6069             :       INTEGER                                            :: md_max
    6070             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*7), kad(1*md_max), kac(1*7), pbd(1*md_max), pbc(1*7), &
    6071             :          pad(1*md_max), pac(1*7), prim(1*1*7*md_max), scale
    6072             : 
    6073             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6074             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6075             : 
    6076      250361 :       kbd(1:1*md_max) = 0.0_dp
    6077       51383 :       kbc(1:1*7) = 0.0_dp
    6078      250361 :       kad(1:1*md_max) = 0.0_dp
    6079       51383 :       kac(1:1*7) = 0.0_dp
    6080       51383 :       p_index = 0
    6081      250361 :       DO md = 1, md_max
    6082     1643207 :          DO mc = 1, 7
    6083     2984670 :             DO mb = 1, 1
    6084     1392846 :                ks_bd = 0.0_dp
    6085     1392846 :                ks_bc = 0.0_dp
    6086     1392846 :                p_bd = pbd((md - 1)*1 + mb)
    6087     1392846 :                p_bc = pbc((mc - 1)*1 + mb)
    6088     2785692 :                DO ma = 1, 1
    6089     1392846 :                   p_index = p_index + 1
    6090     1392846 :                   tmp = scale*prim(p_index)
    6091     1392846 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6092     1392846 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6093     1392846 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6094     2785692 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6095             :                END DO
    6096     1392846 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6097     2785692 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6098             :             END DO
    6099             :          END DO
    6100             :       END DO
    6101       51383 :    END SUBROUTINE block_1_1_7
    6102             : ! **************************************************************************************************
    6103             : !> \brief ...
    6104             : !> \param kbd ...
    6105             : !> \param kbc ...
    6106             : !> \param kad ...
    6107             : !> \param kac ...
    6108             : !> \param pbd ...
    6109             : !> \param pbc ...
    6110             : !> \param pad ...
    6111             : !> \param pac ...
    6112             : !> \param prim ...
    6113             : !> \param scale ...
    6114             : ! **************************************************************************************************
    6115          10 :    SUBROUTINE block_1_1_9_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6116             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*9), kad(1*1), kac(1*9), &
    6117             :                                                             pbd(1*1), pbc(1*9), pad(1*1), &
    6118             :                                                             pac(1*9), prim(1*1*9*1), scale
    6119             : 
    6120             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6121             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6122             : 
    6123          10 :       kbd(1:1*1) = 0.0_dp
    6124          10 :       kbc(1:1*9) = 0.0_dp
    6125          10 :       kad(1:1*1) = 0.0_dp
    6126          10 :       kac(1:1*9) = 0.0_dp
    6127          10 :       p_index = 0
    6128          20 :       DO md = 1, 1
    6129         110 :          DO mc = 1, 9
    6130         190 :             DO mb = 1, 1
    6131          90 :                ks_bd = 0.0_dp
    6132          90 :                ks_bc = 0.0_dp
    6133          90 :                p_bd = pbd((md - 1)*1 + mb)
    6134          90 :                p_bc = pbc((mc - 1)*1 + mb)
    6135         180 :                DO ma = 1, 1
    6136          90 :                   p_index = p_index + 1
    6137          90 :                   tmp = scale*prim(p_index)
    6138          90 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6139          90 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6140          90 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6141         180 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6142             :                END DO
    6143          90 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6144         180 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6145             :             END DO
    6146             :          END DO
    6147             :       END DO
    6148          10 :    END SUBROUTINE block_1_1_9_1
    6149             : ! **************************************************************************************************
    6150             : !> \brief ...
    6151             : !> \param kbd ...
    6152             : !> \param kbc ...
    6153             : !> \param kad ...
    6154             : !> \param kac ...
    6155             : !> \param pbd ...
    6156             : !> \param pbc ...
    6157             : !> \param pad ...
    6158             : !> \param pac ...
    6159             : !> \param prim ...
    6160             : !> \param scale ...
    6161             : ! **************************************************************************************************
    6162           1 :    SUBROUTINE block_1_1_9_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6163             :       REAL(KIND=dp)                                      :: kbd(1*2), kbc(1*9), kad(1*2), kac(1*9), &
    6164             :                                                             pbd(1*2), pbc(1*9), pad(1*2), &
    6165             :                                                             pac(1*9), prim(1*1*9*2), scale
    6166             : 
    6167             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6168             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6169             : 
    6170           1 :       kbd(1:1*2) = 0.0_dp
    6171           1 :       kbc(1:1*9) = 0.0_dp
    6172           1 :       kad(1:1*2) = 0.0_dp
    6173           1 :       kac(1:1*9) = 0.0_dp
    6174           1 :       p_index = 0
    6175           3 :       DO md = 1, 2
    6176          21 :          DO mc = 1, 9
    6177          38 :             DO mb = 1, 1
    6178          18 :                ks_bd = 0.0_dp
    6179          18 :                ks_bc = 0.0_dp
    6180          18 :                p_bd = pbd((md - 1)*1 + mb)
    6181          18 :                p_bc = pbc((mc - 1)*1 + mb)
    6182          36 :                DO ma = 1, 1
    6183          18 :                   p_index = p_index + 1
    6184          18 :                   tmp = scale*prim(p_index)
    6185          18 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6186          18 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6187          18 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6188          36 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6189             :                END DO
    6190          18 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6191          36 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6192             :             END DO
    6193             :          END DO
    6194             :       END DO
    6195           1 :    END SUBROUTINE block_1_1_9_2
    6196             : ! **************************************************************************************************
    6197             : !> \brief ...
    6198             : !> \param md_max ...
    6199             : !> \param kbd ...
    6200             : !> \param kbc ...
    6201             : !> \param kad ...
    6202             : !> \param kac ...
    6203             : !> \param pbd ...
    6204             : !> \param pbc ...
    6205             : !> \param pad ...
    6206             : !> \param pac ...
    6207             : !> \param prim ...
    6208             : !> \param scale ...
    6209             : ! **************************************************************************************************
    6210          57 :    SUBROUTINE block_1_1_9(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6211             :       INTEGER                                            :: md_max
    6212             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*9), kad(1*md_max), kac(1*9), pbd(1*md_max), pbc(1*9), &
    6213             :          pad(1*md_max), pac(1*9), prim(1*1*9*md_max), scale
    6214             : 
    6215             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6216             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6217             : 
    6218         608 :       kbd(1:1*md_max) = 0.0_dp
    6219          57 :       kbc(1:1*9) = 0.0_dp
    6220         608 :       kad(1:1*md_max) = 0.0_dp
    6221          57 :       kac(1:1*9) = 0.0_dp
    6222          57 :       p_index = 0
    6223         608 :       DO md = 1, md_max
    6224        5567 :          DO mc = 1, 9
    6225       10469 :             DO mb = 1, 1
    6226        4959 :                ks_bd = 0.0_dp
    6227        4959 :                ks_bc = 0.0_dp
    6228        4959 :                p_bd = pbd((md - 1)*1 + mb)
    6229        4959 :                p_bc = pbc((mc - 1)*1 + mb)
    6230        9918 :                DO ma = 1, 1
    6231        4959 :                   p_index = p_index + 1
    6232        4959 :                   tmp = scale*prim(p_index)
    6233        4959 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6234        4959 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6235        4959 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6236        9918 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6237             :                END DO
    6238        4959 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6239        9918 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6240             :             END DO
    6241             :          END DO
    6242             :       END DO
    6243          57 :    END SUBROUTINE block_1_1_9
    6244             : ! **************************************************************************************************
    6245             : !> \brief ...
    6246             : !> \param kbd ...
    6247             : !> \param kbc ...
    6248             : !> \param kad ...
    6249             : !> \param kac ...
    6250             : !> \param pbd ...
    6251             : !> \param pbc ...
    6252             : !> \param pad ...
    6253             : !> \param pac ...
    6254             : !> \param prim ...
    6255             : !> \param scale ...
    6256             : ! **************************************************************************************************
    6257           9 :    SUBROUTINE block_1_1_10_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6258             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*10), kad(1*1), &
    6259             :                                                             kac(1*10), pbd(1*1), pbc(1*10), &
    6260             :                                                             pad(1*1), pac(1*10), prim(1*1*10*1), &
    6261             :                                                             scale
    6262             : 
    6263             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6264             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6265             : 
    6266           9 :       kbd(1:1*1) = 0.0_dp
    6267           9 :       kbc(1:1*10) = 0.0_dp
    6268           9 :       kad(1:1*1) = 0.0_dp
    6269           9 :       kac(1:1*10) = 0.0_dp
    6270           9 :       p_index = 0
    6271          18 :       DO md = 1, 1
    6272         108 :          DO mc = 1, 10
    6273         189 :             DO mb = 1, 1
    6274          90 :                ks_bd = 0.0_dp
    6275          90 :                ks_bc = 0.0_dp
    6276          90 :                p_bd = pbd((md - 1)*1 + mb)
    6277          90 :                p_bc = pbc((mc - 1)*1 + mb)
    6278         180 :                DO ma = 1, 1
    6279          90 :                   p_index = p_index + 1
    6280          90 :                   tmp = scale*prim(p_index)
    6281          90 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6282          90 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6283          90 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6284         180 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6285             :                END DO
    6286          90 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6287         180 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6288             :             END DO
    6289             :          END DO
    6290             :       END DO
    6291           9 :    END SUBROUTINE block_1_1_10_1
    6292             : ! **************************************************************************************************
    6293             : !> \brief ...
    6294             : !> \param md_max ...
    6295             : !> \param kbd ...
    6296             : !> \param kbc ...
    6297             : !> \param kad ...
    6298             : !> \param kac ...
    6299             : !> \param pbd ...
    6300             : !> \param pbc ...
    6301             : !> \param pad ...
    6302             : !> \param pac ...
    6303             : !> \param prim ...
    6304             : !> \param scale ...
    6305             : ! **************************************************************************************************
    6306          46 :    SUBROUTINE block_1_1_10(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6307             :       INTEGER                                            :: md_max
    6308             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*10), kad(1*md_max), kac(1*10), pbd(1*md_max), &
    6309             :          pbc(1*10), pad(1*md_max), pac(1*10), prim(1*1*10*md_max), scale
    6310             : 
    6311             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6312             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6313             : 
    6314         488 :       kbd(1:1*md_max) = 0.0_dp
    6315          46 :       kbc(1:1*10) = 0.0_dp
    6316         488 :       kad(1:1*md_max) = 0.0_dp
    6317          46 :       kac(1:1*10) = 0.0_dp
    6318          46 :       p_index = 0
    6319         488 :       DO md = 1, md_max
    6320        4908 :          DO mc = 1, 10
    6321        9282 :             DO mb = 1, 1
    6322        4420 :                ks_bd = 0.0_dp
    6323        4420 :                ks_bc = 0.0_dp
    6324        4420 :                p_bd = pbd((md - 1)*1 + mb)
    6325        4420 :                p_bc = pbc((mc - 1)*1 + mb)
    6326        8840 :                DO ma = 1, 1
    6327        4420 :                   p_index = p_index + 1
    6328        4420 :                   tmp = scale*prim(p_index)
    6329        4420 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6330        4420 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6331        4420 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6332        8840 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6333             :                END DO
    6334        4420 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6335        8840 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6336             :             END DO
    6337             :          END DO
    6338             :       END DO
    6339          46 :    END SUBROUTINE block_1_1_10
    6340             : ! **************************************************************************************************
    6341             : !> \brief ...
    6342             : !> \param kbd ...
    6343             : !> \param kbc ...
    6344             : !> \param kad ...
    6345             : !> \param kac ...
    6346             : !> \param pbd ...
    6347             : !> \param pbc ...
    6348             : !> \param pad ...
    6349             : !> \param pac ...
    6350             : !> \param prim ...
    6351             : !> \param scale ...
    6352             : ! **************************************************************************************************
    6353           9 :    SUBROUTINE block_1_1_11_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6354             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*11), kad(1*1), &
    6355             :                                                             kac(1*11), pbd(1*1), pbc(1*11), &
    6356             :                                                             pad(1*1), pac(1*11), prim(1*1*11*1), &
    6357             :                                                             scale
    6358             : 
    6359             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6360             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6361             : 
    6362           9 :       kbd(1:1*1) = 0.0_dp
    6363           9 :       kbc(1:1*11) = 0.0_dp
    6364           9 :       kad(1:1*1) = 0.0_dp
    6365           9 :       kac(1:1*11) = 0.0_dp
    6366           9 :       p_index = 0
    6367          18 :       DO md = 1, 1
    6368         117 :          DO mc = 1, 11
    6369         207 :             DO mb = 1, 1
    6370          99 :                ks_bd = 0.0_dp
    6371          99 :                ks_bc = 0.0_dp
    6372          99 :                p_bd = pbd((md - 1)*1 + mb)
    6373          99 :                p_bc = pbc((mc - 1)*1 + mb)
    6374         198 :                DO ma = 1, 1
    6375          99 :                   p_index = p_index + 1
    6376          99 :                   tmp = scale*prim(p_index)
    6377          99 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6378          99 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6379          99 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6380         198 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6381             :                END DO
    6382          99 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6383         198 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6384             :             END DO
    6385             :          END DO
    6386             :       END DO
    6387           9 :    END SUBROUTINE block_1_1_11_1
    6388             : ! **************************************************************************************************
    6389             : !> \brief ...
    6390             : !> \param md_max ...
    6391             : !> \param kbd ...
    6392             : !> \param kbc ...
    6393             : !> \param kad ...
    6394             : !> \param kac ...
    6395             : !> \param pbd ...
    6396             : !> \param pbc ...
    6397             : !> \param pad ...
    6398             : !> \param pac ...
    6399             : !> \param prim ...
    6400             : !> \param scale ...
    6401             : ! **************************************************************************************************
    6402          39 :    SUBROUTINE block_1_1_11(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6403             :       INTEGER                                            :: md_max
    6404             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*11), kad(1*md_max), kac(1*11), pbd(1*md_max), &
    6405             :          pbc(1*11), pad(1*md_max), pac(1*11), prim(1*1*11*md_max), scale
    6406             : 
    6407             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6408             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6409             : 
    6410         403 :       kbd(1:1*md_max) = 0.0_dp
    6411          39 :       kbc(1:1*11) = 0.0_dp
    6412         403 :       kad(1:1*md_max) = 0.0_dp
    6413          39 :       kac(1:1*11) = 0.0_dp
    6414          39 :       p_index = 0
    6415         403 :       DO md = 1, md_max
    6416        4407 :          DO mc = 1, 11
    6417        8372 :             DO mb = 1, 1
    6418        4004 :                ks_bd = 0.0_dp
    6419        4004 :                ks_bc = 0.0_dp
    6420        4004 :                p_bd = pbd((md - 1)*1 + mb)
    6421        4004 :                p_bc = pbc((mc - 1)*1 + mb)
    6422        8008 :                DO ma = 1, 1
    6423        4004 :                   p_index = p_index + 1
    6424        4004 :                   tmp = scale*prim(p_index)
    6425        4004 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6426        4004 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6427        4004 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6428        8008 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6429             :                END DO
    6430        4004 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6431        8008 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6432             :             END DO
    6433             :          END DO
    6434             :       END DO
    6435          39 :    END SUBROUTINE block_1_1_11
    6436             : ! **************************************************************************************************
    6437             : !> \brief ...
    6438             : !> \param kbd ...
    6439             : !> \param kbc ...
    6440             : !> \param kad ...
    6441             : !> \param kac ...
    6442             : !> \param pbd ...
    6443             : !> \param pbc ...
    6444             : !> \param pad ...
    6445             : !> \param pac ...
    6446             : !> \param prim ...
    6447             : !> \param scale ...
    6448             : ! **************************************************************************************************
    6449          10 :    SUBROUTINE block_1_1_15_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6450             :       REAL(KIND=dp)                                      :: kbd(1*1), kbc(1*15), kad(1*1), &
    6451             :                                                             kac(1*15), pbd(1*1), pbc(1*15), &
    6452             :                                                             pad(1*1), pac(1*15), prim(1*1*15*1), &
    6453             :                                                             scale
    6454             : 
    6455             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6456             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6457             : 
    6458          10 :       kbd(1:1*1) = 0.0_dp
    6459          10 :       kbc(1:1*15) = 0.0_dp
    6460          10 :       kad(1:1*1) = 0.0_dp
    6461          10 :       kac(1:1*15) = 0.0_dp
    6462          10 :       p_index = 0
    6463          20 :       DO md = 1, 1
    6464         170 :          DO mc = 1, 15
    6465         310 :             DO mb = 1, 1
    6466         150 :                ks_bd = 0.0_dp
    6467         150 :                ks_bc = 0.0_dp
    6468         150 :                p_bd = pbd((md - 1)*1 + mb)
    6469         150 :                p_bc = pbc((mc - 1)*1 + mb)
    6470         300 :                DO ma = 1, 1
    6471         150 :                   p_index = p_index + 1
    6472         150 :                   tmp = scale*prim(p_index)
    6473         150 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6474         150 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6475         150 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6476         300 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6477             :                END DO
    6478         150 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6479         300 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6480             :             END DO
    6481             :          END DO
    6482             :       END DO
    6483          10 :    END SUBROUTINE block_1_1_15_1
    6484             : ! **************************************************************************************************
    6485             : !> \brief ...
    6486             : !> \param md_max ...
    6487             : !> \param kbd ...
    6488             : !> \param kbc ...
    6489             : !> \param kad ...
    6490             : !> \param kac ...
    6491             : !> \param pbd ...
    6492             : !> \param pbc ...
    6493             : !> \param pad ...
    6494             : !> \param pac ...
    6495             : !> \param prim ...
    6496             : !> \param scale ...
    6497             : ! **************************************************************************************************
    6498          38 :    SUBROUTINE block_1_1_15(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6499             :       INTEGER                                            :: md_max
    6500             :       REAL(KIND=dp) :: kbd(1*md_max), kbc(1*15), kad(1*md_max), kac(1*15), pbd(1*md_max), &
    6501             :          pbc(1*15), pad(1*md_max), pac(1*15), prim(1*1*15*md_max), scale
    6502             : 
    6503             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6504             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6505             : 
    6506         402 :       kbd(1:1*md_max) = 0.0_dp
    6507          38 :       kbc(1:1*15) = 0.0_dp
    6508         402 :       kad(1:1*md_max) = 0.0_dp
    6509          38 :       kac(1:1*15) = 0.0_dp
    6510          38 :       p_index = 0
    6511         402 :       DO md = 1, md_max
    6512        5862 :          DO mc = 1, 15
    6513       11284 :             DO mb = 1, 1
    6514        5460 :                ks_bd = 0.0_dp
    6515        5460 :                ks_bc = 0.0_dp
    6516        5460 :                p_bd = pbd((md - 1)*1 + mb)
    6517        5460 :                p_bc = pbc((mc - 1)*1 + mb)
    6518       10920 :                DO ma = 1, 1
    6519        5460 :                   p_index = p_index + 1
    6520        5460 :                   tmp = scale*prim(p_index)
    6521        5460 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6522        5460 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6523        5460 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6524       10920 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6525             :                END DO
    6526        5460 :                kbd((md - 1)*1 + mb) = kbd((md - 1)*1 + mb) - ks_bd
    6527       10920 :                kbc((mc - 1)*1 + mb) = kbc((mc - 1)*1 + mb) - ks_bc
    6528             :             END DO
    6529             :          END DO
    6530             :       END DO
    6531          38 :    END SUBROUTINE block_1_1_15
    6532             : ! **************************************************************************************************
    6533             : !> \brief ...
    6534             : !> \param kbd ...
    6535             : !> \param kbc ...
    6536             : !> \param kad ...
    6537             : !> \param kac ...
    6538             : !> \param pbd ...
    6539             : !> \param pbc ...
    6540             : !> \param pad ...
    6541             : !> \param pac ...
    6542             : !> \param prim ...
    6543             : !> \param scale ...
    6544             : ! **************************************************************************************************
    6545        1810 :    SUBROUTINE block_1_2_1_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6546             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*1), kad(1*1), kac(1*1), &
    6547             :                                                             pbd(2*1), pbc(2*1), pad(1*1), &
    6548             :                                                             pac(1*1), prim(1*2*1*1), scale
    6549             : 
    6550             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6551             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6552             : 
    6553        1810 :       kbd(1:2*1) = 0.0_dp
    6554        1810 :       kbc(1:2*1) = 0.0_dp
    6555        1810 :       kad(1:1*1) = 0.0_dp
    6556        1810 :       kac(1:1*1) = 0.0_dp
    6557        1810 :       p_index = 0
    6558        3620 :       DO md = 1, 1
    6559        5430 :          DO mc = 1, 1
    6560        7240 :             DO mb = 1, 2
    6561        3620 :                ks_bd = 0.0_dp
    6562        3620 :                ks_bc = 0.0_dp
    6563        3620 :                p_bd = pbd((md - 1)*2 + mb)
    6564        3620 :                p_bc = pbc((mc - 1)*2 + mb)
    6565        7240 :                DO ma = 1, 1
    6566        3620 :                   p_index = p_index + 1
    6567        3620 :                   tmp = scale*prim(p_index)
    6568        3620 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6569        3620 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6570        3620 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6571        7240 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6572             :                END DO
    6573        3620 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6574        5430 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6575             :             END DO
    6576             :          END DO
    6577             :       END DO
    6578        1810 :    END SUBROUTINE block_1_2_1_1
    6579             : ! **************************************************************************************************
    6580             : !> \brief ...
    6581             : !> \param kbd ...
    6582             : !> \param kbc ...
    6583             : !> \param kad ...
    6584             : !> \param kac ...
    6585             : !> \param pbd ...
    6586             : !> \param pbc ...
    6587             : !> \param pad ...
    6588             : !> \param pac ...
    6589             : !> \param prim ...
    6590             : !> \param scale ...
    6591             : ! **************************************************************************************************
    6592         706 :    SUBROUTINE block_1_2_1_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6593             :       REAL(KIND=dp)                                      :: kbd(2*2), kbc(2*1), kad(1*2), kac(1*1), &
    6594             :                                                             pbd(2*2), pbc(2*1), pad(1*2), &
    6595             :                                                             pac(1*1), prim(1*2*1*2), scale
    6596             : 
    6597             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6598             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6599             : 
    6600         706 :       kbd(1:2*2) = 0.0_dp
    6601         706 :       kbc(1:2*1) = 0.0_dp
    6602         706 :       kad(1:1*2) = 0.0_dp
    6603         706 :       kac(1:1*1) = 0.0_dp
    6604         706 :       p_index = 0
    6605        2118 :       DO md = 1, 2
    6606        3530 :          DO mc = 1, 1
    6607        5648 :             DO mb = 1, 2
    6608        2824 :                ks_bd = 0.0_dp
    6609        2824 :                ks_bc = 0.0_dp
    6610        2824 :                p_bd = pbd((md - 1)*2 + mb)
    6611        2824 :                p_bc = pbc((mc - 1)*2 + mb)
    6612        5648 :                DO ma = 1, 1
    6613        2824 :                   p_index = p_index + 1
    6614        2824 :                   tmp = scale*prim(p_index)
    6615        2824 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6616        2824 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6617        2824 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6618        5648 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6619             :                END DO
    6620        2824 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6621        4236 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6622             :             END DO
    6623             :          END DO
    6624             :       END DO
    6625         706 :    END SUBROUTINE block_1_2_1_2
    6626             : ! **************************************************************************************************
    6627             : !> \brief ...
    6628             : !> \param kbd ...
    6629             : !> \param kbc ...
    6630             : !> \param kad ...
    6631             : !> \param kac ...
    6632             : !> \param pbd ...
    6633             : !> \param pbc ...
    6634             : !> \param pad ...
    6635             : !> \param pac ...
    6636             : !> \param prim ...
    6637             : !> \param scale ...
    6638             : ! **************************************************************************************************
    6639        2409 :    SUBROUTINE block_1_2_1_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6640             :       REAL(KIND=dp)                                      :: kbd(2*3), kbc(2*1), kad(1*3), kac(1*1), &
    6641             :                                                             pbd(2*3), pbc(2*1), pad(1*3), &
    6642             :                                                             pac(1*1), prim(1*2*1*3), scale
    6643             : 
    6644             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6645             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6646             : 
    6647        2409 :       kbd(1:2*3) = 0.0_dp
    6648        2409 :       kbc(1:2*1) = 0.0_dp
    6649        2409 :       kad(1:1*3) = 0.0_dp
    6650        2409 :       kac(1:1*1) = 0.0_dp
    6651        2409 :       p_index = 0
    6652        9636 :       DO md = 1, 3
    6653       16863 :          DO mc = 1, 1
    6654       28908 :             DO mb = 1, 2
    6655       14454 :                ks_bd = 0.0_dp
    6656       14454 :                ks_bc = 0.0_dp
    6657       14454 :                p_bd = pbd((md - 1)*2 + mb)
    6658       14454 :                p_bc = pbc((mc - 1)*2 + mb)
    6659       28908 :                DO ma = 1, 1
    6660       14454 :                   p_index = p_index + 1
    6661       14454 :                   tmp = scale*prim(p_index)
    6662       14454 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6663       14454 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6664       14454 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6665       28908 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6666             :                END DO
    6667       14454 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6668       21681 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6669             :             END DO
    6670             :          END DO
    6671             :       END DO
    6672        2409 :    END SUBROUTINE block_1_2_1_3
    6673             : ! **************************************************************************************************
    6674             : !> \brief ...
    6675             : !> \param kbd ...
    6676             : !> \param kbc ...
    6677             : !> \param kad ...
    6678             : !> \param kac ...
    6679             : !> \param pbd ...
    6680             : !> \param pbc ...
    6681             : !> \param pad ...
    6682             : !> \param pac ...
    6683             : !> \param prim ...
    6684             : !> \param scale ...
    6685             : ! **************************************************************************************************
    6686           4 :    SUBROUTINE block_1_2_1_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6687             :       REAL(KIND=dp)                                      :: kbd(2*4), kbc(2*1), kad(1*4), kac(1*1), &
    6688             :                                                             pbd(2*4), pbc(2*1), pad(1*4), &
    6689             :                                                             pac(1*1), prim(1*2*1*4), scale
    6690             : 
    6691             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6692             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6693             : 
    6694           4 :       kbd(1:2*4) = 0.0_dp
    6695           4 :       kbc(1:2*1) = 0.0_dp
    6696           4 :       kad(1:1*4) = 0.0_dp
    6697           4 :       kac(1:1*1) = 0.0_dp
    6698           4 :       p_index = 0
    6699          20 :       DO md = 1, 4
    6700          36 :          DO mc = 1, 1
    6701          64 :             DO mb = 1, 2
    6702          32 :                ks_bd = 0.0_dp
    6703          32 :                ks_bc = 0.0_dp
    6704          32 :                p_bd = pbd((md - 1)*2 + mb)
    6705          32 :                p_bc = pbc((mc - 1)*2 + mb)
    6706          64 :                DO ma = 1, 1
    6707          32 :                   p_index = p_index + 1
    6708          32 :                   tmp = scale*prim(p_index)
    6709          32 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6710          32 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6711          32 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6712          64 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6713             :                END DO
    6714          32 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6715          48 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6716             :             END DO
    6717             :          END DO
    6718             :       END DO
    6719           4 :    END SUBROUTINE block_1_2_1_4
    6720             : ! **************************************************************************************************
    6721             : !> \brief ...
    6722             : !> \param kbd ...
    6723             : !> \param kbc ...
    6724             : !> \param kad ...
    6725             : !> \param kac ...
    6726             : !> \param pbd ...
    6727             : !> \param pbc ...
    6728             : !> \param pad ...
    6729             : !> \param pac ...
    6730             : !> \param prim ...
    6731             : !> \param scale ...
    6732             : ! **************************************************************************************************
    6733        1708 :    SUBROUTINE block_1_2_1_5(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6734             :       REAL(KIND=dp)                                      :: kbd(2*5), kbc(2*1), kad(1*5), kac(1*1), &
    6735             :                                                             pbd(2*5), pbc(2*1), pad(1*5), &
    6736             :                                                             pac(1*1), prim(1*2*1*5), scale
    6737             : 
    6738             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6739             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6740             : 
    6741        1708 :       kbd(1:2*5) = 0.0_dp
    6742        1708 :       kbc(1:2*1) = 0.0_dp
    6743        1708 :       kad(1:1*5) = 0.0_dp
    6744        1708 :       kac(1:1*1) = 0.0_dp
    6745        1708 :       p_index = 0
    6746       10248 :       DO md = 1, 5
    6747       18788 :          DO mc = 1, 1
    6748       34160 :             DO mb = 1, 2
    6749       17080 :                ks_bd = 0.0_dp
    6750       17080 :                ks_bc = 0.0_dp
    6751       17080 :                p_bd = pbd((md - 1)*2 + mb)
    6752       17080 :                p_bc = pbc((mc - 1)*2 + mb)
    6753       34160 :                DO ma = 1, 1
    6754       17080 :                   p_index = p_index + 1
    6755       17080 :                   tmp = scale*prim(p_index)
    6756       17080 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6757       17080 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6758       17080 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6759       34160 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6760             :                END DO
    6761       17080 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6762       25620 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6763             :             END DO
    6764             :          END DO
    6765             :       END DO
    6766        1708 :    END SUBROUTINE block_1_2_1_5
    6767             : ! **************************************************************************************************
    6768             : !> \brief ...
    6769             : !> \param kbd ...
    6770             : !> \param kbc ...
    6771             : !> \param kad ...
    6772             : !> \param kac ...
    6773             : !> \param pbd ...
    6774             : !> \param pbc ...
    6775             : !> \param pad ...
    6776             : !> \param pac ...
    6777             : !> \param prim ...
    6778             : !> \param scale ...
    6779             : ! **************************************************************************************************
    6780           4 :    SUBROUTINE block_1_2_1_6(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6781             :       REAL(KIND=dp)                                      :: kbd(2*6), kbc(2*1), kad(1*6), kac(1*1), &
    6782             :                                                             pbd(2*6), pbc(2*1), pad(1*6), &
    6783             :                                                             pac(1*1), prim(1*2*1*6), scale
    6784             : 
    6785             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6786             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6787             : 
    6788           4 :       kbd(1:2*6) = 0.0_dp
    6789           4 :       kbc(1:2*1) = 0.0_dp
    6790           4 :       kad(1:1*6) = 0.0_dp
    6791           4 :       kac(1:1*1) = 0.0_dp
    6792           4 :       p_index = 0
    6793          28 :       DO md = 1, 6
    6794          52 :          DO mc = 1, 1
    6795          96 :             DO mb = 1, 2
    6796          48 :                ks_bd = 0.0_dp
    6797          48 :                ks_bc = 0.0_dp
    6798          48 :                p_bd = pbd((md - 1)*2 + mb)
    6799          48 :                p_bc = pbc((mc - 1)*2 + mb)
    6800          96 :                DO ma = 1, 1
    6801          48 :                   p_index = p_index + 1
    6802          48 :                   tmp = scale*prim(p_index)
    6803          48 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6804          48 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6805          48 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6806          96 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6807             :                END DO
    6808          48 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6809          72 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6810             :             END DO
    6811             :          END DO
    6812             :       END DO
    6813           4 :    END SUBROUTINE block_1_2_1_6
    6814             : ! **************************************************************************************************
    6815             : !> \brief ...
    6816             : !> \param kbd ...
    6817             : !> \param kbc ...
    6818             : !> \param kad ...
    6819             : !> \param kac ...
    6820             : !> \param pbd ...
    6821             : !> \param pbc ...
    6822             : !> \param pad ...
    6823             : !> \param pac ...
    6824             : !> \param prim ...
    6825             : !> \param scale ...
    6826             : ! **************************************************************************************************
    6827         713 :    SUBROUTINE block_1_2_1_7(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6828             :       REAL(KIND=dp)                                      :: kbd(2*7), kbc(2*1), kad(1*7), kac(1*1), &
    6829             :                                                             pbd(2*7), pbc(2*1), pad(1*7), &
    6830             :                                                             pac(1*1), prim(1*2*1*7), scale
    6831             : 
    6832             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6833             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6834             : 
    6835         713 :       kbd(1:2*7) = 0.0_dp
    6836         713 :       kbc(1:2*1) = 0.0_dp
    6837         713 :       kad(1:1*7) = 0.0_dp
    6838         713 :       kac(1:1*1) = 0.0_dp
    6839         713 :       p_index = 0
    6840        5704 :       DO md = 1, 7
    6841       10695 :          DO mc = 1, 1
    6842       19964 :             DO mb = 1, 2
    6843        9982 :                ks_bd = 0.0_dp
    6844        9982 :                ks_bc = 0.0_dp
    6845        9982 :                p_bd = pbd((md - 1)*2 + mb)
    6846        9982 :                p_bc = pbc((mc - 1)*2 + mb)
    6847       19964 :                DO ma = 1, 1
    6848        9982 :                   p_index = p_index + 1
    6849        9982 :                   tmp = scale*prim(p_index)
    6850        9982 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6851        9982 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6852        9982 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6853       19964 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6854             :                END DO
    6855        9982 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6856       14973 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6857             :             END DO
    6858             :          END DO
    6859             :       END DO
    6860         713 :    END SUBROUTINE block_1_2_1_7
    6861             : ! **************************************************************************************************
    6862             : !> \brief ...
    6863             : !> \param kbd ...
    6864             : !> \param kbc ...
    6865             : !> \param kad ...
    6866             : !> \param kac ...
    6867             : !> \param pbd ...
    6868             : !> \param pbc ...
    6869             : !> \param pad ...
    6870             : !> \param pac ...
    6871             : !> \param prim ...
    6872             : !> \param scale ...
    6873             : ! **************************************************************************************************
    6874           1 :    SUBROUTINE block_1_2_1_9(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6875             :       REAL(KIND=dp)                                      :: kbd(2*9), kbc(2*1), kad(1*9), kac(1*1), &
    6876             :                                                             pbd(2*9), pbc(2*1), pad(1*9), &
    6877             :                                                             pac(1*1), prim(1*2*1*9), scale
    6878             : 
    6879             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6880             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6881             : 
    6882           1 :       kbd(1:2*9) = 0.0_dp
    6883           1 :       kbc(1:2*1) = 0.0_dp
    6884           1 :       kad(1:1*9) = 0.0_dp
    6885           1 :       kac(1:1*1) = 0.0_dp
    6886           1 :       p_index = 0
    6887          10 :       DO md = 1, 9
    6888          19 :          DO mc = 1, 1
    6889          36 :             DO mb = 1, 2
    6890          18 :                ks_bd = 0.0_dp
    6891          18 :                ks_bc = 0.0_dp
    6892          18 :                p_bd = pbd((md - 1)*2 + mb)
    6893          18 :                p_bc = pbc((mc - 1)*2 + mb)
    6894          36 :                DO ma = 1, 1
    6895          18 :                   p_index = p_index + 1
    6896          18 :                   tmp = scale*prim(p_index)
    6897          18 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6898          18 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6899          18 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6900          36 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6901             :                END DO
    6902          18 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6903          27 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6904             :             END DO
    6905             :          END DO
    6906             :       END DO
    6907           1 :    END SUBROUTINE block_1_2_1_9
    6908             : ! **************************************************************************************************
    6909             : !> \brief ...
    6910             : !> \param md_max ...
    6911             : !> \param kbd ...
    6912             : !> \param kbc ...
    6913             : !> \param kad ...
    6914             : !> \param kac ...
    6915             : !> \param pbd ...
    6916             : !> \param pbc ...
    6917             : !> \param pad ...
    6918             : !> \param pac ...
    6919             : !> \param prim ...
    6920             : !> \param scale ...
    6921             : ! **************************************************************************************************
    6922           3 :    SUBROUTINE block_1_2_1(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6923             :       INTEGER                                            :: md_max
    6924             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*1), kad(1*md_max), kac(1*1), pbd(2*md_max), pbc(2*1), &
    6925             :          pad(1*md_max), pac(1*1), prim(1*2*1*md_max), scale
    6926             : 
    6927             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6928             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6929             : 
    6930          75 :       kbd(1:2*md_max) = 0.0_dp
    6931           3 :       kbc(1:2*1) = 0.0_dp
    6932          39 :       kad(1:1*md_max) = 0.0_dp
    6933           3 :       kac(1:1*1) = 0.0_dp
    6934           3 :       p_index = 0
    6935          39 :       DO md = 1, md_max
    6936          75 :          DO mc = 1, 1
    6937         144 :             DO mb = 1, 2
    6938          72 :                ks_bd = 0.0_dp
    6939          72 :                ks_bc = 0.0_dp
    6940          72 :                p_bd = pbd((md - 1)*2 + mb)
    6941          72 :                p_bc = pbc((mc - 1)*2 + mb)
    6942         144 :                DO ma = 1, 1
    6943          72 :                   p_index = p_index + 1
    6944          72 :                   tmp = scale*prim(p_index)
    6945          72 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6946          72 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6947          72 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6948         144 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6949             :                END DO
    6950          72 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6951         108 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6952             :             END DO
    6953             :          END DO
    6954             :       END DO
    6955           3 :    END SUBROUTINE block_1_2_1
    6956             : ! **************************************************************************************************
    6957             : !> \brief ...
    6958             : !> \param kbd ...
    6959             : !> \param kbc ...
    6960             : !> \param kad ...
    6961             : !> \param kac ...
    6962             : !> \param pbd ...
    6963             : !> \param pbc ...
    6964             : !> \param pad ...
    6965             : !> \param pac ...
    6966             : !> \param prim ...
    6967             : !> \param scale ...
    6968             : ! **************************************************************************************************
    6969         698 :    SUBROUTINE block_1_2_2_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    6970             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*2), kad(1*1), kac(1*2), &
    6971             :                                                             pbd(2*1), pbc(2*2), pad(1*1), &
    6972             :                                                             pac(1*2), prim(1*2*2*1), scale
    6973             : 
    6974             :       INTEGER                                            :: ma, mb, mc, md, p_index
    6975             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    6976             : 
    6977         698 :       kbd(1:2*1) = 0.0_dp
    6978         698 :       kbc(1:2*2) = 0.0_dp
    6979         698 :       kad(1:1*1) = 0.0_dp
    6980         698 :       kac(1:1*2) = 0.0_dp
    6981         698 :       p_index = 0
    6982        1396 :       DO md = 1, 1
    6983        2792 :          DO mc = 1, 2
    6984        4886 :             DO mb = 1, 2
    6985        2792 :                ks_bd = 0.0_dp
    6986        2792 :                ks_bc = 0.0_dp
    6987        2792 :                p_bd = pbd((md - 1)*2 + mb)
    6988        2792 :                p_bc = pbc((mc - 1)*2 + mb)
    6989        5584 :                DO ma = 1, 1
    6990        2792 :                   p_index = p_index + 1
    6991        2792 :                   tmp = scale*prim(p_index)
    6992        2792 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    6993        2792 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    6994        2792 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    6995        5584 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    6996             :                END DO
    6997        2792 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    6998        4188 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    6999             :             END DO
    7000             :          END DO
    7001             :       END DO
    7002         698 :    END SUBROUTINE block_1_2_2_1
    7003             : ! **************************************************************************************************
    7004             : !> \brief ...
    7005             : !> \param kbd ...
    7006             : !> \param kbc ...
    7007             : !> \param kad ...
    7008             : !> \param kac ...
    7009             : !> \param pbd ...
    7010             : !> \param pbc ...
    7011             : !> \param pad ...
    7012             : !> \param pac ...
    7013             : !> \param prim ...
    7014             : !> \param scale ...
    7015             : ! **************************************************************************************************
    7016         307 :    SUBROUTINE block_1_2_2_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7017             :       REAL(KIND=dp)                                      :: kbd(2*2), kbc(2*2), kad(1*2), kac(1*2), &
    7018             :                                                             pbd(2*2), pbc(2*2), pad(1*2), &
    7019             :                                                             pac(1*2), prim(1*2*2*2), scale
    7020             : 
    7021             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7022             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7023             : 
    7024         307 :       kbd(1:2*2) = 0.0_dp
    7025         307 :       kbc(1:2*2) = 0.0_dp
    7026         307 :       kad(1:1*2) = 0.0_dp
    7027         307 :       kac(1:1*2) = 0.0_dp
    7028         307 :       p_index = 0
    7029         921 :       DO md = 1, 2
    7030        2149 :          DO mc = 1, 2
    7031        4298 :             DO mb = 1, 2
    7032        2456 :                ks_bd = 0.0_dp
    7033        2456 :                ks_bc = 0.0_dp
    7034        2456 :                p_bd = pbd((md - 1)*2 + mb)
    7035        2456 :                p_bc = pbc((mc - 1)*2 + mb)
    7036        4912 :                DO ma = 1, 1
    7037        2456 :                   p_index = p_index + 1
    7038        2456 :                   tmp = scale*prim(p_index)
    7039        2456 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7040        2456 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7041        2456 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7042        4912 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7043             :                END DO
    7044        2456 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7045        3684 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7046             :             END DO
    7047             :          END DO
    7048             :       END DO
    7049         307 :    END SUBROUTINE block_1_2_2_2
    7050             : ! **************************************************************************************************
    7051             : !> \brief ...
    7052             : !> \param kbd ...
    7053             : !> \param kbc ...
    7054             : !> \param kad ...
    7055             : !> \param kac ...
    7056             : !> \param pbd ...
    7057             : !> \param pbc ...
    7058             : !> \param pad ...
    7059             : !> \param pac ...
    7060             : !> \param prim ...
    7061             : !> \param scale ...
    7062             : ! **************************************************************************************************
    7063         941 :    SUBROUTINE block_1_2_2_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7064             :       REAL(KIND=dp)                                      :: kbd(2*3), kbc(2*2), kad(1*3), kac(1*2), &
    7065             :                                                             pbd(2*3), pbc(2*2), pad(1*3), &
    7066             :                                                             pac(1*2), prim(1*2*2*3), scale
    7067             : 
    7068             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7069             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7070             : 
    7071         941 :       kbd(1:2*3) = 0.0_dp
    7072         941 :       kbc(1:2*2) = 0.0_dp
    7073         941 :       kad(1:1*3) = 0.0_dp
    7074         941 :       kac(1:1*2) = 0.0_dp
    7075         941 :       p_index = 0
    7076        3764 :       DO md = 1, 3
    7077        9410 :          DO mc = 1, 2
    7078       19761 :             DO mb = 1, 2
    7079       11292 :                ks_bd = 0.0_dp
    7080       11292 :                ks_bc = 0.0_dp
    7081       11292 :                p_bd = pbd((md - 1)*2 + mb)
    7082       11292 :                p_bc = pbc((mc - 1)*2 + mb)
    7083       22584 :                DO ma = 1, 1
    7084       11292 :                   p_index = p_index + 1
    7085       11292 :                   tmp = scale*prim(p_index)
    7086       11292 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7087       11292 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7088       11292 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7089       22584 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7090             :                END DO
    7091       11292 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7092       16938 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7093             :             END DO
    7094             :          END DO
    7095             :       END DO
    7096         941 :    END SUBROUTINE block_1_2_2_3
    7097             : ! **************************************************************************************************
    7098             : !> \brief ...
    7099             : !> \param kbd ...
    7100             : !> \param kbc ...
    7101             : !> \param kad ...
    7102             : !> \param kac ...
    7103             : !> \param pbd ...
    7104             : !> \param pbc ...
    7105             : !> \param pad ...
    7106             : !> \param pac ...
    7107             : !> \param prim ...
    7108             : !> \param scale ...
    7109             : ! **************************************************************************************************
    7110           3 :    SUBROUTINE block_1_2_2_4(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7111             :       REAL(KIND=dp)                                      :: kbd(2*4), kbc(2*2), kad(1*4), kac(1*2), &
    7112             :                                                             pbd(2*4), pbc(2*2), pad(1*4), &
    7113             :                                                             pac(1*2), prim(1*2*2*4), scale
    7114             : 
    7115             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7116             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7117             : 
    7118           3 :       kbd(1:2*4) = 0.0_dp
    7119           3 :       kbc(1:2*2) = 0.0_dp
    7120           3 :       kad(1:1*4) = 0.0_dp
    7121           3 :       kac(1:1*2) = 0.0_dp
    7122           3 :       p_index = 0
    7123          15 :       DO md = 1, 4
    7124          39 :          DO mc = 1, 2
    7125          84 :             DO mb = 1, 2
    7126          48 :                ks_bd = 0.0_dp
    7127          48 :                ks_bc = 0.0_dp
    7128          48 :                p_bd = pbd((md - 1)*2 + mb)
    7129          48 :                p_bc = pbc((mc - 1)*2 + mb)
    7130          96 :                DO ma = 1, 1
    7131          48 :                   p_index = p_index + 1
    7132          48 :                   tmp = scale*prim(p_index)
    7133          48 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7134          48 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7135          48 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7136          96 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7137             :                END DO
    7138          48 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7139          72 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7140             :             END DO
    7141             :          END DO
    7142             :       END DO
    7143           3 :    END SUBROUTINE block_1_2_2_4
    7144             : ! **************************************************************************************************
    7145             : !> \brief ...
    7146             : !> \param md_max ...
    7147             : !> \param kbd ...
    7148             : !> \param kbc ...
    7149             : !> \param kad ...
    7150             : !> \param kac ...
    7151             : !> \param pbd ...
    7152             : !> \param pbc ...
    7153             : !> \param pad ...
    7154             : !> \param pac ...
    7155             : !> \param prim ...
    7156             : !> \param scale ...
    7157             : ! **************************************************************************************************
    7158         906 :    SUBROUTINE block_1_2_2(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7159             :       INTEGER                                            :: md_max
    7160             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*2), kad(1*md_max), kac(1*2), pbd(2*md_max), pbc(2*2), &
    7161             :          pad(1*md_max), pac(1*2), prim(1*2*2*md_max), scale
    7162             : 
    7163             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7164             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7165             : 
    7166       10964 :       kbd(1:2*md_max) = 0.0_dp
    7167         906 :       kbc(1:2*2) = 0.0_dp
    7168        5935 :       kad(1:1*md_max) = 0.0_dp
    7169         906 :       kac(1:1*2) = 0.0_dp
    7170         906 :       p_index = 0
    7171        5935 :       DO md = 1, md_max
    7172       15993 :          DO mc = 1, 2
    7173       35203 :             DO mb = 1, 2
    7174       20116 :                ks_bd = 0.0_dp
    7175       20116 :                ks_bc = 0.0_dp
    7176       20116 :                p_bd = pbd((md - 1)*2 + mb)
    7177       20116 :                p_bc = pbc((mc - 1)*2 + mb)
    7178       40232 :                DO ma = 1, 1
    7179       20116 :                   p_index = p_index + 1
    7180       20116 :                   tmp = scale*prim(p_index)
    7181       20116 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7182       20116 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7183       20116 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7184       40232 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7185             :                END DO
    7186       20116 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7187       30174 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7188             :             END DO
    7189             :          END DO
    7190             :       END DO
    7191         906 :    END SUBROUTINE block_1_2_2
    7192             : ! **************************************************************************************************
    7193             : !> \brief ...
    7194             : !> \param kbd ...
    7195             : !> \param kbc ...
    7196             : !> \param kad ...
    7197             : !> \param kac ...
    7198             : !> \param pbd ...
    7199             : !> \param pbc ...
    7200             : !> \param pad ...
    7201             : !> \param pac ...
    7202             : !> \param prim ...
    7203             : !> \param scale ...
    7204             : ! **************************************************************************************************
    7205        2406 :    SUBROUTINE block_1_2_3_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7206             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*3), kad(1*1), kac(1*3), &
    7207             :                                                             pbd(2*1), pbc(2*3), pad(1*1), &
    7208             :                                                             pac(1*3), prim(1*2*3*1), scale
    7209             : 
    7210             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7211             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7212             : 
    7213        2406 :       kbd(1:2*1) = 0.0_dp
    7214        2406 :       kbc(1:2*3) = 0.0_dp
    7215        2406 :       kad(1:1*1) = 0.0_dp
    7216        2406 :       kac(1:1*3) = 0.0_dp
    7217        2406 :       p_index = 0
    7218        4812 :       DO md = 1, 1
    7219       12030 :          DO mc = 1, 3
    7220       24060 :             DO mb = 1, 2
    7221       14436 :                ks_bd = 0.0_dp
    7222       14436 :                ks_bc = 0.0_dp
    7223       14436 :                p_bd = pbd((md - 1)*2 + mb)
    7224       14436 :                p_bc = pbc((mc - 1)*2 + mb)
    7225       28872 :                DO ma = 1, 1
    7226       14436 :                   p_index = p_index + 1
    7227       14436 :                   tmp = scale*prim(p_index)
    7228       14436 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7229       14436 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7230       14436 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7231       28872 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7232             :                END DO
    7233       14436 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7234       21654 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7235             :             END DO
    7236             :          END DO
    7237             :       END DO
    7238        2406 :    END SUBROUTINE block_1_2_3_1
    7239             : ! **************************************************************************************************
    7240             : !> \brief ...
    7241             : !> \param kbd ...
    7242             : !> \param kbc ...
    7243             : !> \param kad ...
    7244             : !> \param kac ...
    7245             : !> \param pbd ...
    7246             : !> \param pbc ...
    7247             : !> \param pad ...
    7248             : !> \param pac ...
    7249             : !> \param prim ...
    7250             : !> \param scale ...
    7251             : ! **************************************************************************************************
    7252         940 :    SUBROUTINE block_1_2_3_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7253             :       REAL(KIND=dp)                                      :: kbd(2*2), kbc(2*3), kad(1*2), kac(1*3), &
    7254             :                                                             pbd(2*2), pbc(2*3), pad(1*2), &
    7255             :                                                             pac(1*3), prim(1*2*3*2), scale
    7256             : 
    7257             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7258             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7259             : 
    7260         940 :       kbd(1:2*2) = 0.0_dp
    7261         940 :       kbc(1:2*3) = 0.0_dp
    7262         940 :       kad(1:1*2) = 0.0_dp
    7263         940 :       kac(1:1*3) = 0.0_dp
    7264         940 :       p_index = 0
    7265        2820 :       DO md = 1, 2
    7266        8460 :          DO mc = 1, 3
    7267       18800 :             DO mb = 1, 2
    7268       11280 :                ks_bd = 0.0_dp
    7269       11280 :                ks_bc = 0.0_dp
    7270       11280 :                p_bd = pbd((md - 1)*2 + mb)
    7271       11280 :                p_bc = pbc((mc - 1)*2 + mb)
    7272       22560 :                DO ma = 1, 1
    7273       11280 :                   p_index = p_index + 1
    7274       11280 :                   tmp = scale*prim(p_index)
    7275       11280 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7276       11280 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7277       11280 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7278       22560 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7279             :                END DO
    7280       11280 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7281       16920 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7282             :             END DO
    7283             :          END DO
    7284             :       END DO
    7285         940 :    END SUBROUTINE block_1_2_3_2
    7286             : ! **************************************************************************************************
    7287             : !> \brief ...
    7288             : !> \param kbd ...
    7289             : !> \param kbc ...
    7290             : !> \param kad ...
    7291             : !> \param kac ...
    7292             : !> \param pbd ...
    7293             : !> \param pbc ...
    7294             : !> \param pad ...
    7295             : !> \param pac ...
    7296             : !> \param prim ...
    7297             : !> \param scale ...
    7298             : ! **************************************************************************************************
    7299        3509 :    SUBROUTINE block_1_2_3_3(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7300             :       REAL(KIND=dp)                                      :: kbd(2*3), kbc(2*3), kad(1*3), kac(1*3), &
    7301             :                                                             pbd(2*3), pbc(2*3), pad(1*3), &
    7302             :                                                             pac(1*3), prim(1*2*3*3), scale
    7303             : 
    7304             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7305             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7306             : 
    7307        3509 :       kbd(1:2*3) = 0.0_dp
    7308        3509 :       kbc(1:2*3) = 0.0_dp
    7309        3509 :       kad(1:1*3) = 0.0_dp
    7310        3509 :       kac(1:1*3) = 0.0_dp
    7311        3509 :       p_index = 0
    7312       14036 :       DO md = 1, 3
    7313       45617 :          DO mc = 1, 3
    7314      105270 :             DO mb = 1, 2
    7315       63162 :                ks_bd = 0.0_dp
    7316       63162 :                ks_bc = 0.0_dp
    7317       63162 :                p_bd = pbd((md - 1)*2 + mb)
    7318       63162 :                p_bc = pbc((mc - 1)*2 + mb)
    7319      126324 :                DO ma = 1, 1
    7320       63162 :                   p_index = p_index + 1
    7321       63162 :                   tmp = scale*prim(p_index)
    7322       63162 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7323       63162 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7324       63162 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7325      126324 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7326             :                END DO
    7327       63162 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7328       94743 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7329             :             END DO
    7330             :          END DO
    7331             :       END DO
    7332        3509 :    END SUBROUTINE block_1_2_3_3
    7333             : ! **************************************************************************************************
    7334             : !> \brief ...
    7335             : !> \param md_max ...
    7336             : !> \param kbd ...
    7337             : !> \param kbc ...
    7338             : !> \param kad ...
    7339             : !> \param kac ...
    7340             : !> \param pbd ...
    7341             : !> \param pbc ...
    7342             : !> \param pad ...
    7343             : !> \param pac ...
    7344             : !> \param prim ...
    7345             : !> \param scale ...
    7346             : ! **************************************************************************************************
    7347        3334 :    SUBROUTINE block_1_2_3(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7348             :       INTEGER                                            :: md_max
    7349             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*3), kad(1*md_max), kac(1*3), pbd(2*md_max), pbc(2*3), &
    7350             :          pad(1*md_max), pac(1*3), prim(1*2*3*md_max), scale
    7351             : 
    7352             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7353             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7354             : 
    7355       40450 :       kbd(1:2*md_max) = 0.0_dp
    7356        3334 :       kbc(1:2*3) = 0.0_dp
    7357       21892 :       kad(1:1*md_max) = 0.0_dp
    7358        3334 :       kac(1:1*3) = 0.0_dp
    7359        3334 :       p_index = 0
    7360       21892 :       DO md = 1, md_max
    7361       77566 :          DO mc = 1, 3
    7362      185580 :             DO mb = 1, 2
    7363      111348 :                ks_bd = 0.0_dp
    7364      111348 :                ks_bc = 0.0_dp
    7365      111348 :                p_bd = pbd((md - 1)*2 + mb)
    7366      111348 :                p_bc = pbc((mc - 1)*2 + mb)
    7367      222696 :                DO ma = 1, 1
    7368      111348 :                   p_index = p_index + 1
    7369      111348 :                   tmp = scale*prim(p_index)
    7370      111348 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7371      111348 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7372      111348 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7373      222696 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7374             :                END DO
    7375      111348 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7376      167022 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7377             :             END DO
    7378             :          END DO
    7379             :       END DO
    7380        3334 :    END SUBROUTINE block_1_2_3
    7381             : ! **************************************************************************************************
    7382             : !> \brief ...
    7383             : !> \param kbd ...
    7384             : !> \param kbc ...
    7385             : !> \param kad ...
    7386             : !> \param kac ...
    7387             : !> \param pbd ...
    7388             : !> \param pbc ...
    7389             : !> \param pad ...
    7390             : !> \param pac ...
    7391             : !> \param prim ...
    7392             : !> \param scale ...
    7393             : ! **************************************************************************************************
    7394           2 :    SUBROUTINE block_1_2_4_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7395             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*4), kad(1*1), kac(1*4), &
    7396             :                                                             pbd(2*1), pbc(2*4), pad(1*1), &
    7397             :                                                             pac(1*4), prim(1*2*4*1), scale
    7398             : 
    7399             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7400             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7401             : 
    7402           2 :       kbd(1:2*1) = 0.0_dp
    7403           2 :       kbc(1:2*4) = 0.0_dp
    7404           2 :       kad(1:1*1) = 0.0_dp
    7405           2 :       kac(1:1*4) = 0.0_dp
    7406           2 :       p_index = 0
    7407           4 :       DO md = 1, 1
    7408          12 :          DO mc = 1, 4
    7409          26 :             DO mb = 1, 2
    7410          16 :                ks_bd = 0.0_dp
    7411          16 :                ks_bc = 0.0_dp
    7412          16 :                p_bd = pbd((md - 1)*2 + mb)
    7413          16 :                p_bc = pbc((mc - 1)*2 + mb)
    7414          32 :                DO ma = 1, 1
    7415          16 :                   p_index = p_index + 1
    7416          16 :                   tmp = scale*prim(p_index)
    7417          16 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7418          16 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7419          16 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7420          32 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7421             :                END DO
    7422          16 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7423          24 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7424             :             END DO
    7425             :          END DO
    7426             :       END DO
    7427           2 :    END SUBROUTINE block_1_2_4_1
    7428             : ! **************************************************************************************************
    7429             : !> \brief ...
    7430             : !> \param kbd ...
    7431             : !> \param kbc ...
    7432             : !> \param kad ...
    7433             : !> \param kac ...
    7434             : !> \param pbd ...
    7435             : !> \param pbc ...
    7436             : !> \param pad ...
    7437             : !> \param pac ...
    7438             : !> \param prim ...
    7439             : !> \param scale ...
    7440             : ! **************************************************************************************************
    7441           2 :    SUBROUTINE block_1_2_4_2(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7442             :       REAL(KIND=dp)                                      :: kbd(2*2), kbc(2*4), kad(1*2), kac(1*4), &
    7443             :                                                             pbd(2*2), pbc(2*4), pad(1*2), &
    7444             :                                                             pac(1*4), prim(1*2*4*2), scale
    7445             : 
    7446             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7447             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7448             : 
    7449           2 :       kbd(1:2*2) = 0.0_dp
    7450           2 :       kbc(1:2*4) = 0.0_dp
    7451           2 :       kad(1:1*2) = 0.0_dp
    7452           2 :       kac(1:1*4) = 0.0_dp
    7453           2 :       p_index = 0
    7454           6 :       DO md = 1, 2
    7455          22 :          DO mc = 1, 4
    7456          52 :             DO mb = 1, 2
    7457          32 :                ks_bd = 0.0_dp
    7458          32 :                ks_bc = 0.0_dp
    7459          32 :                p_bd = pbd((md - 1)*2 + mb)
    7460          32 :                p_bc = pbc((mc - 1)*2 + mb)
    7461          64 :                DO ma = 1, 1
    7462          32 :                   p_index = p_index + 1
    7463          32 :                   tmp = scale*prim(p_index)
    7464          32 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7465          32 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7466          32 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7467          64 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7468             :                END DO
    7469          32 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7470          48 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7471             :             END DO
    7472             :          END DO
    7473             :       END DO
    7474           2 :    END SUBROUTINE block_1_2_4_2
    7475             : ! **************************************************************************************************
    7476             : !> \brief ...
    7477             : !> \param md_max ...
    7478             : !> \param kbd ...
    7479             : !> \param kbc ...
    7480             : !> \param kad ...
    7481             : !> \param kac ...
    7482             : !> \param pbd ...
    7483             : !> \param pbc ...
    7484             : !> \param pad ...
    7485             : !> \param pac ...
    7486             : !> \param prim ...
    7487             : !> \param scale ...
    7488             : ! **************************************************************************************************
    7489           8 :    SUBROUTINE block_1_2_4(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7490             :       INTEGER                                            :: md_max
    7491             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*4), kad(1*md_max), kac(1*4), pbd(2*md_max), pbc(2*4), &
    7492             :          pad(1*md_max), pac(1*4), prim(1*2*4*md_max), scale
    7493             : 
    7494             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7495             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7496             : 
    7497          78 :       kbd(1:2*md_max) = 0.0_dp
    7498           8 :       kbc(1:2*4) = 0.0_dp
    7499          43 :       kad(1:1*md_max) = 0.0_dp
    7500           8 :       kac(1:1*4) = 0.0_dp
    7501           8 :       p_index = 0
    7502          43 :       DO md = 1, md_max
    7503         183 :          DO mc = 1, 4
    7504         455 :             DO mb = 1, 2
    7505         280 :                ks_bd = 0.0_dp
    7506         280 :                ks_bc = 0.0_dp
    7507         280 :                p_bd = pbd((md - 1)*2 + mb)
    7508         280 :                p_bc = pbc((mc - 1)*2 + mb)
    7509         560 :                DO ma = 1, 1
    7510         280 :                   p_index = p_index + 1
    7511         280 :                   tmp = scale*prim(p_index)
    7512         280 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7513         280 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7514         280 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7515         560 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7516             :                END DO
    7517         280 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7518         420 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7519             :             END DO
    7520             :          END DO
    7521             :       END DO
    7522           8 :    END SUBROUTINE block_1_2_4
    7523             : ! **************************************************************************************************
    7524             : !> \brief ...
    7525             : !> \param kbd ...
    7526             : !> \param kbc ...
    7527             : !> \param kad ...
    7528             : !> \param kac ...
    7529             : !> \param pbd ...
    7530             : !> \param pbc ...
    7531             : !> \param pad ...
    7532             : !> \param pac ...
    7533             : !> \param prim ...
    7534             : !> \param scale ...
    7535             : ! **************************************************************************************************
    7536        1705 :    SUBROUTINE block_1_2_5_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7537             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*5), kad(1*1), kac(1*5), &
    7538             :                                                             pbd(2*1), pbc(2*5), pad(1*1), &
    7539             :                                                             pac(1*5), prim(1*2*5*1), scale
    7540             : 
    7541             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7542             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7543             : 
    7544        1705 :       kbd(1:2*1) = 0.0_dp
    7545        1705 :       kbc(1:2*5) = 0.0_dp
    7546        1705 :       kad(1:1*1) = 0.0_dp
    7547        1705 :       kac(1:1*5) = 0.0_dp
    7548        1705 :       p_index = 0
    7549        3410 :       DO md = 1, 1
    7550       11935 :          DO mc = 1, 5
    7551       27280 :             DO mb = 1, 2
    7552       17050 :                ks_bd = 0.0_dp
    7553       17050 :                ks_bc = 0.0_dp
    7554       17050 :                p_bd = pbd((md - 1)*2 + mb)
    7555       17050 :                p_bc = pbc((mc - 1)*2 + mb)
    7556       34100 :                DO ma = 1, 1
    7557       17050 :                   p_index = p_index + 1
    7558       17050 :                   tmp = scale*prim(p_index)
    7559       17050 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7560       17050 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7561       17050 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7562       34100 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7563             :                END DO
    7564       17050 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7565       25575 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7566             :             END DO
    7567             :          END DO
    7568             :       END DO
    7569        1705 :    END SUBROUTINE block_1_2_5_1
    7570             : ! **************************************************************************************************
    7571             : !> \brief ...
    7572             : !> \param md_max ...
    7573             : !> \param kbd ...
    7574             : !> \param kbc ...
    7575             : !> \param kad ...
    7576             : !> \param kac ...
    7577             : !> \param pbd ...
    7578             : !> \param pbc ...
    7579             : !> \param pad ...
    7580             : !> \param pac ...
    7581             : !> \param prim ...
    7582             : !> \param scale ...
    7583             : ! **************************************************************************************************
    7584        5524 :    SUBROUTINE block_1_2_5(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7585             :       INTEGER                                            :: md_max
    7586             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*5), kad(1*md_max), kac(1*5), pbd(2*md_max), pbc(2*5), &
    7587             :          pad(1*md_max), pac(1*5), prim(1*2*5*md_max), scale
    7588             : 
    7589             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7590             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7591             : 
    7592       50140 :       kbd(1:2*md_max) = 0.0_dp
    7593        5524 :       kbc(1:2*5) = 0.0_dp
    7594       27832 :       kad(1:1*md_max) = 0.0_dp
    7595        5524 :       kac(1:1*5) = 0.0_dp
    7596        5524 :       p_index = 0
    7597       27832 :       DO md = 1, md_max
    7598      139372 :          DO mc = 1, 5
    7599      356928 :             DO mb = 1, 2
    7600      223080 :                ks_bd = 0.0_dp
    7601      223080 :                ks_bc = 0.0_dp
    7602      223080 :                p_bd = pbd((md - 1)*2 + mb)
    7603      223080 :                p_bc = pbc((mc - 1)*2 + mb)
    7604      446160 :                DO ma = 1, 1
    7605      223080 :                   p_index = p_index + 1
    7606      223080 :                   tmp = scale*prim(p_index)
    7607      223080 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7608      223080 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7609      223080 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7610      446160 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7611             :                END DO
    7612      223080 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7613      334620 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7614             :             END DO
    7615             :          END DO
    7616             :       END DO
    7617        5524 :    END SUBROUTINE block_1_2_5
    7618             : ! **************************************************************************************************
    7619             : !> \brief ...
    7620             : !> \param kbd ...
    7621             : !> \param kbc ...
    7622             : !> \param kad ...
    7623             : !> \param kac ...
    7624             : !> \param pbd ...
    7625             : !> \param pbc ...
    7626             : !> \param pad ...
    7627             : !> \param pac ...
    7628             : !> \param prim ...
    7629             : !> \param scale ...
    7630             : ! **************************************************************************************************
    7631           1 :    SUBROUTINE block_1_2_6_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7632             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*6), kad(1*1), kac(1*6), &
    7633             :                                                             pbd(2*1), pbc(2*6), pad(1*1), &
    7634             :                                                             pac(1*6), prim(1*2*6*1), scale
    7635             : 
    7636             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7637             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7638             : 
    7639           1 :       kbd(1:2*1) = 0.0_dp
    7640           1 :       kbc(1:2*6) = 0.0_dp
    7641           1 :       kad(1:1*1) = 0.0_dp
    7642           1 :       kac(1:1*6) = 0.0_dp
    7643           1 :       p_index = 0
    7644           2 :       DO md = 1, 1
    7645           8 :          DO mc = 1, 6
    7646          19 :             DO mb = 1, 2
    7647          12 :                ks_bd = 0.0_dp
    7648          12 :                ks_bc = 0.0_dp
    7649          12 :                p_bd = pbd((md - 1)*2 + mb)
    7650          12 :                p_bc = pbc((mc - 1)*2 + mb)
    7651          24 :                DO ma = 1, 1
    7652          12 :                   p_index = p_index + 1
    7653          12 :                   tmp = scale*prim(p_index)
    7654          12 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7655          12 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7656          12 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7657          24 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7658             :                END DO
    7659          12 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7660          18 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7661             :             END DO
    7662             :          END DO
    7663             :       END DO
    7664           1 :    END SUBROUTINE block_1_2_6_1
    7665             : ! **************************************************************************************************
    7666             : !> \brief ...
    7667             : !> \param md_max ...
    7668             : !> \param kbd ...
    7669             : !> \param kbc ...
    7670             : !> \param kad ...
    7671             : !> \param kac ...
    7672             : !> \param pbd ...
    7673             : !> \param pbc ...
    7674             : !> \param pad ...
    7675             : !> \param pac ...
    7676             : !> \param prim ...
    7677             : !> \param scale ...
    7678             : ! **************************************************************************************************
    7679           2 :    SUBROUTINE block_1_2_6(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7680             :       INTEGER                                            :: md_max
    7681             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*6), kad(1*md_max), kac(1*6), pbd(2*md_max), pbc(2*6), &
    7682             :          pad(1*md_max), pac(1*6), prim(1*2*6*md_max), scale
    7683             : 
    7684             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7685             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7686             : 
    7687          18 :       kbd(1:2*md_max) = 0.0_dp
    7688           2 :       kbc(1:2*6) = 0.0_dp
    7689          10 :       kad(1:1*md_max) = 0.0_dp
    7690           2 :       kac(1:1*6) = 0.0_dp
    7691           2 :       p_index = 0
    7692          10 :       DO md = 1, md_max
    7693          58 :          DO mc = 1, 6
    7694         152 :             DO mb = 1, 2
    7695          96 :                ks_bd = 0.0_dp
    7696          96 :                ks_bc = 0.0_dp
    7697          96 :                p_bd = pbd((md - 1)*2 + mb)
    7698          96 :                p_bc = pbc((mc - 1)*2 + mb)
    7699         192 :                DO ma = 1, 1
    7700          96 :                   p_index = p_index + 1
    7701          96 :                   tmp = scale*prim(p_index)
    7702          96 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7703          96 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7704          96 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7705         192 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7706             :                END DO
    7707          96 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7708         144 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7709             :             END DO
    7710             :          END DO
    7711             :       END DO
    7712           2 :    END SUBROUTINE block_1_2_6
    7713             : ! **************************************************************************************************
    7714             : !> \brief ...
    7715             : !> \param kbd ...
    7716             : !> \param kbc ...
    7717             : !> \param kad ...
    7718             : !> \param kac ...
    7719             : !> \param pbd ...
    7720             : !> \param pbc ...
    7721             : !> \param pad ...
    7722             : !> \param pac ...
    7723             : !> \param prim ...
    7724             : !> \param scale ...
    7725             : ! **************************************************************************************************
    7726         712 :    SUBROUTINE block_1_2_7_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7727             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*7), kad(1*1), kac(1*7), &
    7728             :                                                             pbd(2*1), pbc(2*7), pad(1*1), &
    7729             :                                                             pac(1*7), prim(1*2*7*1), scale
    7730             : 
    7731             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7732             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7733             : 
    7734         712 :       kbd(1:2*1) = 0.0_dp
    7735         712 :       kbc(1:2*7) = 0.0_dp
    7736         712 :       kad(1:1*1) = 0.0_dp
    7737         712 :       kac(1:1*7) = 0.0_dp
    7738         712 :       p_index = 0
    7739        1424 :       DO md = 1, 1
    7740        6408 :          DO mc = 1, 7
    7741       15664 :             DO mb = 1, 2
    7742        9968 :                ks_bd = 0.0_dp
    7743        9968 :                ks_bc = 0.0_dp
    7744        9968 :                p_bd = pbd((md - 1)*2 + mb)
    7745        9968 :                p_bc = pbc((mc - 1)*2 + mb)
    7746       19936 :                DO ma = 1, 1
    7747        9968 :                   p_index = p_index + 1
    7748        9968 :                   tmp = scale*prim(p_index)
    7749        9968 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7750        9968 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7751        9968 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7752       19936 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7753             :                END DO
    7754        9968 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7755       14952 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7756             :             END DO
    7757             :          END DO
    7758             :       END DO
    7759         712 :    END SUBROUTINE block_1_2_7_1
    7760             : ! **************************************************************************************************
    7761             : !> \brief ...
    7762             : !> \param md_max ...
    7763             : !> \param kbd ...
    7764             : !> \param kbc ...
    7765             : !> \param kad ...
    7766             : !> \param kac ...
    7767             : !> \param pbd ...
    7768             : !> \param pbc ...
    7769             : !> \param pad ...
    7770             : !> \param pac ...
    7771             : !> \param prim ...
    7772             : !> \param scale ...
    7773             : ! **************************************************************************************************
    7774        2385 :    SUBROUTINE block_1_2_7(md_max, kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7775             :       INTEGER                                            :: md_max
    7776             :       REAL(KIND=dp) :: kbd(2*md_max), kbc(2*7), kad(1*md_max), kac(1*7), pbd(2*md_max), pbc(2*7), &
    7777             :          pad(1*md_max), pac(1*7), prim(1*2*7*md_max), scale
    7778             : 
    7779             :       INTEGER                                            :: ma, mb, mc, md, p_index
    7780             :       REAL(KIND=dp)                                      :: ks_bc, ks_bd, p_bc, p_bd, tmp
    7781             : 
    7782       22927 :       kbd(1:2*md_max) = 0.0_dp
    7783        2385 :       kbc(1:2*7) = 0.0_dp
    7784       12656 :       kad(1:1*md_max) = 0.0_dp
    7785        2385 :       kac(1:1*7) = 0.0_dp
    7786        2385 :       p_index = 0
    7787       12656 :       DO md = 1, md_max
    7788       84553 :          DO mc = 1, 7
    7789      225962 :             DO mb = 1, 2
    7790      143794 :                ks_bd = 0.0_dp
    7791      143794 :                ks_bc = 0.0_dp
    7792      143794 :                p_bd = pbd((md - 1)*2 + mb)
    7793      143794 :                p_bc = pbc((mc - 1)*2 + mb)
    7794      287588 :                DO ma = 1, 1
    7795      143794 :                   p_index = p_index + 1
    7796      143794 :                   tmp = scale*prim(p_index)
    7797      143794 :                   ks_bc = ks_bc + tmp*pad((md - 1)*1 + ma)
    7798      143794 :                   ks_bd = ks_bd + tmp*pac((mc - 1)*1 + ma)
    7799      143794 :                   kad((md - 1)*1 + ma) = kad((md - 1)*1 + ma) - tmp*p_bc
    7800      287588 :                   kac((mc - 1)*1 + ma) = kac((mc - 1)*1 + ma) - tmp*p_bd
    7801             :                END DO
    7802      143794 :                kbd((md - 1)*2 + mb) = kbd((md - 1)*2 + mb) - ks_bd
    7803      215691 :                kbc((mc - 1)*2 + mb) = kbc((mc - 1)*2 + mb) - ks_bc
    7804             :             END DO
    7805             :          END DO
    7806             :       END DO
    7807        2385 :    END SUBROUTINE block_1_2_7
    7808             : ! **************************************************************************************************
    7809             : !> \brief ...
    7810             : !> \param kbd ...
    7811             : !> \param kbc ...
    7812             : !> \param kad ...
    7813             : !> \param kac ...
    7814             : !> \param pbd ...
    7815             : !> \param pbc ...
    7816             : !> \param pad ...
    7817             : !> \param pac ...
    7818             : !> \param prim ...
    7819             : !> \param scale ...
    7820             : ! **************************************************************************************************
    7821           0 :    SUBROUTINE block_1_2_9_1(kbd, kbc, kad, kac, pbd, pbc, pad, pac, prim, scale)
    7822             :       REAL(KIND=dp)                                      :: kbd(2*1), kbc(2*9), kad(1*1), kac(1*9), &
    7823             :                                                             pbd(2*1), pbc(2*9), pad(1*1), &
    7824             :                                                             pac(1*9), prim(1*2*9*1), scale<