Staggered Grid Initialization

EarthBox.StaggeredGrid.initialize!Function
initialize!(
    model::ModelData; 
    grid_type::Union{Int, String, Symbol, Nothing}=nothing, 
    parameters::Union{Dict{String, <:Union{Float64, Int64, String}}, Nothing}=nothing
)::Nothing

Initialize staggered grid with the specified grid type and parameters.

Arguments

  • model::ModelData
    • The model data object containing model parameters and arrays.
  • grid_type
    • Controls the type of grid. The grid_type argument can be an integer ID, a string, a symbol, or nothing. Grid type is stored in the model data container as an integer ID (itype_grid) and a corresponding string name (stype_grid). If grid_type is nothing the current grid type defined in the model data container will be used. Grid type parameters can be accessed from the model data container as follows:
      • itype_grid = model.grids.parameters.grid_options.itype_grid.value
      • stype_grid = model.grids.parameters.grid_options.stype_grid.value
  • parameters
    • Dictionary of parameters used to define the grid type. Currently this is only used for grid_type = :TtypeRefinedGrid. See the section below called Parameter Dictionary Keys for more information.

Returns

  • Nothing

Grid Types

Available grid types (string, symbol, or integer ID) are as follows:

  • UniformGrid
    • grid_type value: "UniformGrid", :UniformGrid, or 0
    • Uniform basic grid.
  • TtypeRefinedGrid
    • grid_type value: "TtypeRefinedGrid", :TtypeRefinedGrid, or 1
    • Basic grid has lateral refinement in the central part of the model and vertical refinement in the upper part of the model (i.e. T-type).
  • Grid51x51UniformRefinementAlongSides
    • grid_type value: "Grid51x51UniformRefinementAlongSides", :Grid51x51UniformRefinementAlongSides, or 2
    • 51x51 basic grid with high-resolution along sides. This type is used for convection in a box benchmarks.
  • Grid51x51SmoothedRefinementAlongSides
    • grid_type value: "Grid51x51SmoothedRefinementAlongSides", :Grid51x51SmoothedRefinementAlongSides, or 3
    • 51x51 basic grid with smoothed high-resolution zones along sides. This grid is used for convection in a box benchmarks.

Parameter Dictionary Keys

Required parameter keys for grid type :TtypeRefinedGrid:

  • "xo_highres": Starting x-coordinate of high resolution region in meters
  • "xf_highres": Ending x-coordinate of high resolution region in meters
  • "yf_highres": Ending y-coordinate of high resolution region in meters
  • "dx_highres": Grid spacing in x-direction for high resolution region in meters
  • "dy_highres": Grid spacing in y-direction for high resolution region in meters

Optional parameter keys for grid type :TtypeRefinedGrid:

  • "iuse_trench": Flag to enable trench-based refinement (0 or 1)
  • "iuse_refinement_delay": Flag to enable delayed refinement (0 or 1)
  • "refinement_time": Time in Myr when refinement should occur

Notes:

  • T-type parameters do not need to be provided as input if they were previously defined when initializing the model using EarthBoxState.
source

Accessing Option Names

Available option names for grid_type can be accessed as follows:

  • StaggeredGrid.option_names.UniformGrid
  • StaggeredGrid.option_names.TtypeRefinedGrid
  • StaggeredGrid.option_names.Grid51x51UniformRefinementAlongSides
  • StaggeredGrid.option_names.Grid51x51SmoothedRefinementAlongSides