@@ -11,30 +11,31 @@ using NCDatasets: nc_create, NC_NETCDF4, NC_CLOBBER, NC_NOWRITE, nc_def_dim, nc_
1111export write_ASAGI, read_ASAGI
1212
1313"""
14- write_ASAGI(fname::String, Data::CartData,
15- selected_fields ::Union{nothing , Tuple}=nothing;
16- km_to_m = false)
14+ write_ASAGI(fname::String, Data::CartData;
15+ fields ::Union{Nothing , Tuple}=nothing,
16+ km_to_m::Bool= false)
1717
1818Writes a CartData structure `Data` to an ASAGI file, which can be read by SeisSol or ExaHype.
1919You can optionally pass a tuple with fields to be written. Note that we can only write individual (scalar) fields to disk,
2020so vector or tensor fields needs to be split first
2121"""
22- function write_ASAGI (fname:: String , Data:: CartData ,
23- selected_fields :: Union{Nothing, Tuple} = nothing ;
24- km_to_m= false )
22+ function write_ASAGI (fname:: String , Data:: CartData ;
23+ fields :: Union{Nothing, Tuple} = nothing ,
24+ km_to_m:: Bool = false )
2525
2626 nx,ny,nz = size (Data. x)
2727 x = Data. x. val[:,1 ,1 ]
2828 y = Data. y. val[1 ,:,1 ]
2929 z = Data. z. val[1 ,1 ,:]
30- if km_to_m
30+ if km_to_m== true
31+ println (" convert to meters" )
3132 x = x.* 1000
3233 y = y.* 1000
3334 z = z.* 1000
3435 end
3536
3637 # Transfer data to a single array with NamedTuple entries
37- material = fields_to_namedtuple (Data. fields, selected_fields )
38+ material = fields_to_namedtuple (Data. fields, fields )
3839
3940 fname_asagi = fname* " _ASAGI.nc"
4041
0 commit comments