SARS(5) File Formats Manual SARS(5)

sarsStar AeRoSol file format

sars is a binary file format for storing the radiative properties of an aerosol. The volumetric mesh to which the CKs are attached is described there but must be defined in a separated file via, for example, the smsh(5) file format.

A sars file begins by a header that describes the layout of the data. Next the spectral bands on which the radiative coefficients were defined are listed. Finally, the entire list of the scattering coefficients and absorption coefficients are stored.

The header consists of 3 64-bit integers. The first integer is a power of two (usually 4096) that defines the pagesize in bytes on which the radiative coefficients are aligned. The remaining two integers store the number of bands and the number of nodes, that is, the number of radiative coefficients per band which is actually the number of nodes in the volumetric mesh to which these coefficients are attached.

After the header comes the list of spectral bands sorted in ascending order relative to their interval. Each spectral band is defined by 2 double-precision floating-point numbers that represent the lower and upper limits of the band in nanometers.

Fill bytes follow the list of spectral bands to ensure alignment of the radiative coefficients on pagesize. By aligning data on pagesize, and depending on system requirements, memory mapping can be used to automatically load/unload the radiative coefficients on demand (see mmap(2)). For each band, the absorption coefficient and diffusion coefficient are listed per node. This list is followed by a padding, which is a list of bytes that provides memory alignment of the following data to pagesize. Bands are sorted according to the order in which they were previously declared.

Data are encoded with respect to the little endian bytes ordering, i.e. least significant bytes are stored first.

The file format is as follows:

sars ::= pagesize⟩ ⟨#bands⟩ ⟨#nodes
bands
padding
rad-coefs
 
pagesize ::= uint64_t
#bands ::= uint64_t
#nodes ::= uint64_t
padding ::= [int8_t ...] # Ensure alignment on pagesize
 
bands ::= band...
band ::= band-low⟩ ⟨band-upp
band-low ::= double # Inclusive bound in nm
band-upp ::= double # Excusive bound in nm
 
rad-coefs ::= per-band-k...
ka-ks ::= ka⟩ ⟨ks
ka ::= float # In m^-1
ks ::= float # In m^-1

mmap(2), smsh(5)

July 28, 2023 UNIX