﻿'Alm'⎕NS''                                                  ⍝ initializes Alm namespace
Read1st←{t←⍵ ⎕FSTIE 0 ⋄ ns←⎕FREAD t,1 ⋄ _←⎕FUNTIE t ⋄ ns}   ⍝ function that reads the first component of a dcf file
Alm.(pmf pm_)←Read1st¨'.\pmf203401.DCF' '.\pm_203401.DCF'   ⍝ reads the two biggest namespaces among the ones saved for each month
⊃∘⍴¨Alm.(pmf pm_).⎕NL ¯2                                    ⍝ number of variables in each namespace
]disp ∪¨Alm.(pmf pm_).(⍴∘⍎¨⎕NL ¯2)                          ⍝ all variables have the same shape
SizeOf←{⍺←0 ⋄ (⎕SIZE'⍵')÷2*10×⍺}                            ⍝ funtions that gives the size of the object ⍵
2 SizeOf Temp←Alm.(pmf pm_).((0∘⌷)∘⍎¨⎕NL ¯2)                ⍝ no compression
⍴Temp←⍉⊃⍪/⊃⍪/Temp                                           ⍝ merges all 3-rows matrices into a single huge matrix
2 SizeOf¨(srmt_pack{⍺ ⍵}uCompress)Temp                      ⍝ our modified version of packB and LZ4 compression
Alm.(Pmf Pm_)←Read1st¨'.\qmf203401.DCF' '.\qm_203401.DCF'   ⍝ reads two other smaller namespaces among the ones saved for each month
⊃∘⍴¨Alm.(Pmf Pm_).⎕NL ¯2                                    ⍝ number of variables in each namespace
]disp ∪¨Alm.(Pmf Pm_).(⍴∘⍎¨⎕NL ¯2)                          ⍝ nearly all variables have the same shape
2 SizeOf Temp←Alm.(Pmf Pm_).(⍎¨⎕NL ¯2)                      ⍝ no compression
⍴Temp←⍉⊃⍪/{(¯2↑1,⍴⍵)⍴⍵}¨⊃⍪/Temp                             ⍝ merges all arrays into a single huge matrix
2 SizeOf¨(srmt_pack{⍺ ⍵}uCompress)Temp                      ⍝ our modified version of packB and LZ4 compression

