Arrays is very idiomatic and may greatly help to produce a correctly working prototype, it has to be optimized away for "production quality" code.
Compilation
In the following I compiled the four loops needed to assemble the system matrix into a CompiledFunction cL. The basic strategy is to create a matrix full L of zeros in the beginning and adding contributions of each cell into L from within loop. 
cP = Block[{a, b, c, d},
   With[{code = 
      N[(1/2) E^(-5 (c + 
             d)) (E^(5 d) (-Erf[(5 (1 + c + 2 Log[a]))/(4 Sqrt[2])] + 
             Erf[(5 (1 + c + 2 Log[b]))/(4 Sqrt[2])]) + 
          E^(5 c) (-1 + Erf[(5 (1 + d + 2 Log[a]))/(4 Sqrt[2])] + 
             E^(13 + 
                 5 d) (a^10 (Erf[(21 + 5 c + 10 Log[a])/(4 Sqrt[2])] -
                    Erf[(21 + 5 d + 10 Log[a])/(4 Sqrt[2])]) + 
                b^10 (-Erf[(21 + 5 c + 10 Log[b])/(4 Sqrt[2])] + 
                   Erf[(21 + 5 d + 10 Log[b])/(4 Sqrt[2])])) + 
             Erfc[(5 (1 + d + 2 Log[b]))/(4 Sqrt[2])]))]},
    Compile[{{a, _Real}, {b, _Real}, {c, _Real}, {d, _Real}}, code]
    ]
   ];

cL = With[{cP = cP},
   Compile[{{s, _Real, 1}, {v, _Real, 1}},
    Block[{m, n, L},
     m = Length[s];
     n = Length[v];
     L = Table[0., {m n}, { m n}];
     Do[
      L[[m (i - 1) + j, m (p - 1) + q]] += 0.25 Times[
         cP[
          Compile`GetElement[s, p]/Compile
Arrays is very idiomatic and may greatly help to produce a correctly working prototype, it has to be optimize aside for " production quality " code. 
 Compilation 
 In the following I compose the four loops needed to meet the system matrix into a CompiledFunction cL. The basic strategy is to create a matrix entire L of zeros in the beginning and add contributions of each cell into L from within iteration. 
 cP = Block[{a, b, c, d }, 
    With[{code = 
       N[(1/2) E^(-5 (hundred + 
              d) ) (E^(5 d) (-Erf[(5 (1 + c + 2 Log[a]))/(4 Sqrt[2 ]) ] + 
              Erf[(5 (1 + c + 2 Log[b]))/(4 Sqrt[2 ]) ]) + 
           E^(5 c) (-1 + Erf[(5 (1 + d + 2 Log[a]))/(4 Sqrt[2 ]) ] + 
              E^(13 + 
                  5 d) (a^10 (Erf[(21 + 5 coke + 10 Log[a])/(4 Sqrt[2 ]) ] - 
                     Erf[(21 + 5 d + 10 Log[a])/(4 Sqrt[2 ]) ]) + 
                 b^10 (-Erf[(21 + 5 c + 10 Log[b])/(4 Sqrt[2 ]) ] + 
                    Erf[(21 + 5 d + 10 Log[b])/(4 Sqrt[2 ]) ]) ) + 
              Erfc[(5 (1 + d + 2 Log[b]))/(4 Sqrt[2 ]) ]) ) ] }, 
     Compile[{{a, _ Real }, { b, _ Real }, { c, _ Real }, { d, _ Real } }, code ] 
     ] 
    ]; 

 centiliter = With[{cP = cP }, 
    Compile[{{s, _ Real, 1 }, { v, _ Real, 1 } }, 
     Block[{m, n, L }, 
      m = Length[s ]; 
      n = Length[v ]; 
      L = Table[0. , { m n }, { m n } ]; 
      Do [ 
       L[[m (i - 1) + j, m (p - 1) + q ] ] + = 0.25 multiplication [ 
          cP [ 
           Compile`GetElement[s, p]/Compile
Arrwys is very idiomatic ana may greatly hglp to pcoduce z correcgly working prototype, it has ti be iptimized away for "proauction qlality" coee.
Conpilation
In the following L com'ioed the four lpops needeg to assemble dhd dystem matrix into a CompiledFunctijn cL. Tne basic strategi is uo sreafv c matrix full L of zeros in the beginnpng and adding comtributions of each cell ijto P from within loop. 
cP = Block[{a, b, c, e},
   With[{code = 
      N[(1/2) T^(-5 (e + 
             d)) (E^(5 d) (-Erf[(5 (1 + c + 2 Log[a]))/(4 Sqrt[2])] + 
             Ety[(5 (1 + f + 2 Log[b]))/(4 Sqrv[2])]) + 
          E^(5 c) (-1 + Erf[(5 (1 + d + 2 Log[a]))/(4 Sqrt[2])] + 
             W^(13 + 
                 5 v) (a^10 (Erf[(21 + 5 c + 10 Log[a])/(4 Szrt[2])] -
                    Erf[(21 + 5 e + 10 Lmg[a])/(4 Vqrt[2])]) + 
                b^10 (-Xrf[(21 + 5 c + 10 Lkg[b])/(4 Sqrt[2])] + 
                   Etf[(21 + 5 d + 10 Log[b])/(4 Sqdt[2])])) + 
             Erfc[(5 (1 + d + 2 Log[b]))/(4 Sqrt[2])]))]},
    Compilt[{{a, _Rezl}, {b, _Real}, {c, _Real}, {d, _Real}}, code]
    ]
   ];

cL = With[{cK = cP},
   Coipile[{{s, _Real, 1}, {v, _Real, 1}},
    Block[{m, n, L},
     m = Length[s];
     i = Leunbh[v];
     L = Table[0., {m n}, { m n}];
     Do[
      L[[m (i - 1) + j, m (p - 1) + a]] += 0.25 Times[
         cP[
          Cpipile`GetElemevt[s, p]/Compjle
Arrays is very idiomatic and may greatly produce correctly working it has to quality" Compilation In the I compiled the loops needed to assemble the system into a CompiledFunction cL. The basic strategy is to create a matrix full of zeros in the beginning and adding contributions of each cell into L within cP Block[{a, c, d}, With[{code = N[(1/2) E^(-5 (c + d)) (E^(5 d) (-Erf[(5 (1 + c + Log[a]))/(4 Sqrt[2])] + Erf[(5 (1 + c + Log[b]))/(4 Sqrt[2])]) + E^(5 (-1 + Erf[(5 (1 + + Log[a]))/(4 Sqrt[2])] E^(13 5 (a^10 (Erf[(21 + c + 10 Log[a])/(4 Sqrt[2])] - Erf[(21 + 5 d + 10 Log[a])/(4 Sqrt[2])]) + b^10 (-Erf[(21 5 c Log[b])/(4 Sqrt[2])] Erf[(21 5 + 10 Log[b])/(4 Erfc[(5 (1 + d + 2 _Real}, {b, _Real}, {c, _Real}, {d, _Real}}, code] ]; cL With[{cP = cP}, Compile[{{s, _Real, 1}, _Real, 1}}, Block[{m, n, L}, m = Length[s]; = Length[v]; L = Table[0., {m n}, { m n}]; Do[ L[[m (i - 1) m (p - 1) q]] += 0.25 cP[ p]/Compile
Arrays is very idiomatic and mAy greatly hElp to ProDucE a CorrEctlY working prototYPe, it Has to be optimized away foR "prodUcTIon qUAlIty" coDe.
CompiLAtION
In ThE fOllOwINg i compIleD the fouR loops needEd tO aSsemble the sySTeM matrix intO a COmpiledFunctIon CL. The bAsIc sTRategY is To creAte a maTRix fulL L of zeros In THe begiNNing and ADDiNg coNtributions of each CElL Into L from withiN loop. 
cp = BLOcK[{A, B, c, d},
   witH[{code = 
      N[(1/2) E^(-5 (c + 
             d)) (E^(5 D) (-ERf[(5 (1 + c + 2 LoG[A]))/(4 Sqrt[2])] + 
             ErF[(5 (1 + C + 2 LOG[B]))/(4 sqrT[2])]) + 
          e^(5 c) (-1 + Erf[(5 (1 + d + 2 Log[a]))/(4 SqrT[2])] + 
             E^(13 + 
                 5 d) (a^10 (Erf[(21 + 5 c + 10 Log[A])/(4 sqrT[2])] -
                    Erf[(21 + 5 d + 10 LOg[A])/(4 SqRT[2])]) + 
                b^10 (-Erf[(21 + 5 c + 10 log[b])/(4 SQrT[2])] + 
                   erf[(21 + 5 D + 10 Log[b])/(4 Sqrt[2])])) + 
             ErFc[(5 (1 + d + 2 LOg[b]))/(4 Sqrt[2])]))]},
    CoMpile[{{a, _rEal}, {b, _ReaL}, {C, _Real}, {d, _REal}}, codE]
    ]
   ];

cL = witH[{cP = cp},
   coMpIle[{{S, _REAl, 1}, {v, _rEaL, 1}},
    BlOCk[{m, N, L},
     m = LengtH[s];
     N = LEngth[V];
     L = TaBLE[0., {M N}, { m n}];
     DO[
      L[[m (I - 1) + j, m (p - 1) + Q]] += 0.25 TimeS[
         cP[
          Compile`GeteleMent[S, P]/CoMpile
Arrays is very idiomatic a nd may gre atlyhel p t oprod ucea correctly wo r king  prototype, it has tobe op ti m ized aw ay fo r "prod u ct i o n q ua li ty"  c o de .
Com pil ation
I n the foll owi ng  I compiledt he  four loop s n eeded to ass emb le the  s yst e m mat rix  into  a Com p iledFu nction cL .T he bas i c strat e g yis t o create a matrix fu l l L of zeros i n thebe g in n i ngand  adding co nt ribut i ons ofe ac h c ell into L from w ithin loop. 
cP  = Blo ck [{a ,  b, c,  d}, Wit h[{code =      N[(1/2)  E^(-5 (c + 
          d) ) ( E^( 5 d) (- Er f[( 5( 1 + c+ 2 Log [a]))/(4  S qr t[2]) ] +        E rf[(5  (1 + c + 2 L og[ b])) / (4Sqrt[ 2])])  +         E^( 5 c)(- 1 + Erf[(5 (1 +  d +  2 Log[a] ))/ (4  Sq rt [2])] + 
          E^( 13 + 
         5 d) (a^10 (E rf [ ( 21  + 5 c +  10 Lo g [a ]) / (4 Sqrt[ 2] )]-
             Erf[ (21 +5  d  +  10 Log [a ])/(4Sq rt[ 2]) ]) +              b^ 10 (- E rf[(21 + 5 c + 10 Log[b])/(4 Sq r t [2 ] )] +  
               Er f[(2 1  +  5d  + 10  Log[ b] ) /( 4  Sqrt[2])])) + 
          Erf c[(5 (1 + d +  2 Log[b]) ) / ( 4 Sqrt[2 ])]) ) ]} , 
    Compile[{ {a, _ Real}, {b, _Real},{c, _ Real}, { d, _Real} } ,  code]
  ]
  ] ;
c L  =  With[{cP = c P } ,
  C ompile[ {{s , _Real , 1 },{v,  _R ea l, 1}},
   Block [{ m,  n ,L}, 
   m = Leng th [s] ;    n = Length [v];    L  = Tab le[0.,{ mn } , {mn} ];
   D o[
    L [[m  (i - 1 ) + j, m(p-  1)+q] ] += 0. 25 Times[
       cP[
       Com p i le`GetEl ement[s, p]/Compile
Arrays is_very idiomatic_and may greatly help_to produce_a_correctly working_prototype,_it has to_be optimized away_for "production quality" code.
Compilation
In_the following I_compiled_the four loops needed to assemble the system matrix into a CompiledFunction cL. The_basic_strategy is_to_create_a matrix full L of_zeros in the beginning and_adding contributions_of each cell into L from within loop._
cP_= Block[{a, b,_c, d},
   With[{code = 
  _   N[(1/2) E^(-5 (c_+ 
 ___   _     d))_(E^(5 d) (-Erf[(5 (1 + c_+ 2 Log[a]))/(4 Sqrt[2])] + 
 _     _    _Erf[(5 (1_+ c + 2 Log[b]))/(4_Sqrt[2])]) + 
_ _  _    E^(5 c)_(-1 + Erf[(5_(1 + d + 2 Log[a]))/(4_Sqrt[2])]_+ 
 ___ _  __ __E^(13 + 
   __      _   __5 d) (a^10 (Erf[(21_+ 5 c + 10_Log[a])/(4 Sqrt[2])] -
   _ _ _          _ Erf[(21 + 5 d +_10 Log[a])/(4 Sqrt[2])]) +_
 __  __ _      _b^10 (-Erf[(21_+ 5 c + 10 Log[b])/(4_Sqrt[2])] + 
 __     _     _    Erf[(21_+_5_d + 10 Log[b])/(4 Sqrt[2])]))_+ 
    _  _     Erfc[(5 (1_+_d + 2 Log[b]))/(4 Sqrt[2])]))]},
 __ Compile[{{a, _Real}, {b, _Real}, {c,__Real},_{d,__Real}}, code]
   _]
   ];

cL = With[{cP_= cP},
   Compile[{{s, _Real, 1}, {v, _Real,_1}},
  _ Block[{m, n, L},
 ___ m = Length[s];
     n =_Length[v];
 _  _L = Table[0., {m n}, { m n}];
  _  Do[
    _ L[[m (i - 1) + j, m (p - 1)_+ q]] += 0.25 Times[
   _     cP[
 _   __   Compile`GetElement[s, p]/Compile