ASAGI I/O
ASAGI is a fileformat that is used by codes such as SeisSol or ExaHype. It employs the NetCDF4 data format.
We can read ASAGI files into GMG, and write GMG datasets to ASAGI format, which makes it straightforward to use GMG to create a model setup or to couple the results of geodynamic simulations (e.g., produced by LaMEM) with codes that support ASAGI.
GeophysicalModelGenerator.read_ASAGI Function
data::CartData = read_ASAGI(fname_asagi::String)Reads a 3D ASAGI NetCDF file, which is used as input for a number of codes such as SeisSol, and returns a CartData set. fname_asagi must end in .nc. Requires loading NCDatasets.
GeophysicalModelGenerator.write_ASAGI Function
write_ASAGI(fname::String, Data::CartData; fields::Union{Nothing, Tuple}=nothing, km_to_m::Bool=false)Writes a CartData structure Data to the ASAGI file fname * "_ASAGI.nc", which can be read by SeisSol or ExaHype, and returns the file name. Only individual (scalar) array fields can be written, so vector or tensor fields need to be split first. The element type of each field is kept.
Keywords:
fields: tuple with the names of the fields to write, for example(:Rho, :Sxx)(default: all fields)km_to_m: if true, the coordinates are multiplied by 1000 (default=false)
Requires loading NCDatasets.