The current index order of SOLPS data arrays: (poloidal, radial, species) make sense only for column-major arrays (Fortran-style or F-style), because the species slice is needed more often than the radial slice and the radial slice is needed more often than the poloidal slice.
In the raw simulation files, the arrays are stored in column-major order, and load_b2f_file() and read_block44() return F-style arrays. But on the MDS server they are stored in row-major order (C-style) and with inverse indexing. When reading from MDS, the index order is inverted but the order is not changed from C-style to F-style.
Thus, to improve the performance we should either change the order from C-style to F-style when reading from MDS and also make sure that all arrays created for operation with the SOLPS data arrays are F-style, or to make all arrays C-style and invert the indexing: (species, radial, poloidal). I like the second option better because C-style arrays are default in numpy.
The current index order of SOLPS data arrays: (poloidal, radial, species) make sense only for column-major arrays (Fortran-style or F-style), because the species slice is needed more often than the radial slice and the radial slice is needed more often than the poloidal slice.
In the raw simulation files, the arrays are stored in column-major order, and
load_b2f_file()andread_block44()return F-style arrays. But on the MDS server they are stored in row-major order (C-style) and with inverse indexing. When reading from MDS, the index order is inverted but the order is not changed from C-style to F-style.Thus, to improve the performance we should either change the order from C-style to F-style when reading from MDS and also make sure that all arrays created for operation with the SOLPS data arrays are F-style, or to make all arrays C-style and invert the indexing: (species, radial, poloidal). I like the second option better because C-style arrays are default in numpy.