Input/Output

Artifact Wrappers

ClimateMachine.ArtifactWrappers.ArtifactFileType
ArtifactFile

A single data file to be downloaded, containing both the url and the name to use locally.

Fields

  • url

    URL pointing to data to be downloaded

  • filename

    Local name used for downloaded online data

source
ClimateMachine.ArtifactWrappers.ArtifactWrapperType
ArtifactWrapper

A set of data files to be downloaded, grouped by data_name. Example:

dataset = ArtifactWrapper(
    "Artifacts.toml",
    "MyDataSet",
    ArtifactFile[
        ArtifactFile(
            url="https://..../SomeNetCDF1.nc",
            filename="experiment1.nc",
        ),
        ArtifactFile(
            url="https://..../SomeNetCDF2.nc",
            filename="experiment2.nc",
        ),
    ]
)

Fields

  • artifact_toml

    Path to the used Artifacts.toml

  • data_name

    Unique name of dataset

  • artifact_files

    Array of ArtifactFile's, grouped by this dataset

source

VTK

ClimateMachine.VTK.writevtkFunction
writevtk(prefix, Q::MPIStateArray, dg::DGModel [, fieldnames]; number_sample_points)

Write a vtk file for all the fields in the state array Q using geometry and connectivity information from dg.grid. The filename will start with prefix which may also contain a directory path. The names used for each of the fields in the vtk file can be specified through the collection of strings fieldnames; if not specified the fields names will be "Q1" through "Qk" where k is the number of states in Q, i.e., k = size(Q,2).

If specified, fields are sampled on an equally spaced, tensor-product grid of points with 'numbersamplepoints' in each direction.

source
writevtk(prefix, Q::MPIStateArray, dg::DGModel, fieldnames,
         state_auxiliary::MPIStateArray, auxfieldnames)

Write a vtk file for all the fields in the state array Q and auxiliary state state_auxiliary using geometry and connectivity information from dg.grid. The filename will start with prefix which may also contain a directory path. The names used for each of the fields in the vtk file can be specified through the collection of strings fieldnames and auxfieldnames.

If fieldnames === nothing then the fields names will be "Q1" through "Qk" where k is the number of states in Q, i.e., k = size(Q,2).

If auxfieldnames === nothing then the fields names will be "aux1" through "auxk" where k is the number of states in state_auxiliary, i.e., k = size(state_auxiliary,2).

If specified, fields are sampled on an equally spaced, tensor-product grid of points with 'numbersamplepoints' in each direction.

source
writegrid(prefix, grid::DiscontinuousSpectralElementGrid)

Write a vtk file for the grid. The filename will start with prefix which may also contain a directory path.

source
ClimateMachine.VTK.writepvtuFunction
writepvtu(pvtuprefix, vtkprefixes, fieldnames, FT)

Write a pvtu file with the prefix 'pvtuprefix' for the collection of vtk files given by 'vtkprefixes' using names of fields 'fieldnames'. The data in the vtu files is of type FT.

source

Writers

ClimateMachine.Writers.init_dataFunction
init_data(
    writer,
    filename,
    dims,
    vars,
)

Creates the specified file, initializing it with the specified dimension information. An unlimited time dimension is implicitly created. The specified variables are also defined. This function must be called before append_data(). Specialized by every Writer subtype.

Arguments:

- writer: instance of a subtype of AbstractWriter.

- filename: into which to write data (without extension).

- dims: Dict of dimension name to 2-tuple of dimension values and Dict

of attributes.

- vars: Dict of variable name to 3-tuple of a k-tuple of dimension

names, variable type, and Dict of attributes.

source
ClimateMachine.Writers.append_dataFunction
append_data(
    writer,
    filename,
    varvals,
    simtime,
)

Appends the specified variables to the specified file. The file must have been previously created with init_data(). simtime is appended to the time dimension variable. Specialized by every Writer subtype.

Arguments:

- writer: instance of a subtype of AbstractWriter.

- filename: into which to write data (without extension).

- varvals: Dict of variable name to k-dimensional array of values.

- simtime: Current simulation time.

source