Full Subzero API documentation
This page is still very much WIP!
Documentation for Subzero's full API (only for reference!).
Subzero.Subzero
Subzero.AbstractBoundary
Subzero.AbstractDirection
Subzero.AbstractDomainElement
Subzero.AbstractFractureCriteria
Subzero.AbstractGrid
Subzero.AbstractOutputWriter
Subzero.AbstractStressCalculator
Subzero.AbstractSubFloePointsGenerator
Subzero.Atmos
Subzero.Atmos
Subzero.Atmos
Subzero.Atmos
Subzero.CellFloes
Subzero.CellFloes
Subzero.CheckpointOutputWriter
Subzero.CheckpointOutputWriter
Subzero.CheckpointOutputWriter
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionSettings
Subzero.CollisionSettings
Subzero.Constants
Subzero.Constants
Subzero.CouplingSettings
Subzero.DamageStressCalculator
Subzero.DamageStressCalculator
Subzero.DamageStressCalculator
Subzero.DecayAreaScaledCalculator
Subzero.DecayAreaScaledCalculator
Subzero.DecayAreaScaledCalculator
Subzero.Domain
Subzero.Domain
Subzero.East
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.FloeOutputWriter
Subzero.FloeOutputWriter
Subzero.FloeOutputWriter
Subzero.FloeSettings
Subzero.FloeSettings
Subzero.FractureSettings
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.IceStressCell
Subzero.IceStressCell
Subzero.InitialStateOutputWriter
Subzero.InitialStateOutputWriter
Subzero.InitialStateOutputWriter
Subzero.InteractionFields
Subzero.Model
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MonteCarloPointsGenerator
Subzero.MonteCarloPointsGenerator
Subzero.MonteCarloPointsGenerator
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.NoFracture
Subzero.NonPeriodicBoundary
Subzero.North
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OutputWriters
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PolyVec
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RidgeRaftSettings
Subzero.RidgeRaftSettings
Subzero.RingVec
Subzero.SimplificationSettings
Subzero.SimplificationSettings
Subzero.Simulation
Subzero.South
Subzero.StatusTag
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubzeroLogger
Subzero.SubzeroLogger
Subzero.SubzeroLogger
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.WeldSettings
Subzero.WeldSettings
Subzero.West
Base.::
Base.empty!
Base.empty!
Base.to_index
Logging.handle_message
Subzero._calculate_hibler
Subzero._calculate_mohrs
Subzero._calculate_mohrs
Subzero._initialize_floe_field
Subzero._initialize_floe_field
Subzero.add_floe_ghosts!
Subzero.add_floe_volume!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_point!
Subzero.add_point!
Subzero.auto_extension
Subzero.bin_floe_centroids
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.calc_angular_momentum
Subzero.calc_atmosphere_forcing
Subzero.calc_elastic_forces
Subzero.calc_eulerian_data!
Subzero.calc_friction_forces
Subzero.calc_kinetic_energy
Subzero.calc_linear_momentum
Subzero.calc_normal_force
Subzero.calc_ocean_forcing!
Subzero.calc_one_way_coupling!
Subzero.calc_strain!
Subzero.calc_stress!
Subzero.calc_subfloe_values!
Subzero.calc_torque!
Subzero.calc_two_way_coupling!
Subzero.center_cell_coords
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_energy_momentum_conservation_julia
Subzero.check_energy_momentum_conservation_matlab
Subzero.check_for_edge_mid
Subzero.compare_floe_data
Subzero.compare_grid_data
Subzero.compare_oa_checkpointer_data
Subzero.conserve_momentum_change_floe_shape!
Subzero.conserve_momentum_fracture_floe!
Subzero.conserve_momentum_transfer_mass!
Subzero.deepcopy_floe
Subzero.deform_floe!
Subzero.determine_fractures
Subzero.dissolve_floe!
Subzero.domain_in_grid
Subzero.euclidian_dist
Subzero.find_center_cell_index
Subzero.find_ghosts!
Subzero.find_ghosts!
Subzero.find_grid_cell_index
Subzero.find_interp_knots
Subzero.find_interp_knots
Subzero.find_poly_coords
Subzero.find_shared_edges_midpoint
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_interaction!
Subzero.floe_domain_raft!
Subzero.floe_domain_ridge!
Subzero.floe_floe_interaction!
Subzero.floe_floe_raft!
Subzero.floe_floe_ridge!
Subzero.floe_to_grid_info!
Subzero.fracture_floes!
Subzero.fuse_floes!
Subzero.fuse_two_floes!
Subzero.generate_subfloe_points
Subzero.generate_subfloe_points
Subzero.generate_voronoi_coords
Subzero.get_known_grid_outputs
Subzero.get_velocity
Subzero.get_velocity
Subzero.getattrs
Subzero.ghosts_on_bounds!
Subzero.grid_cell_index
Subzero.grid_line_index
Subzero.grid_xc_index
Subzero.grid_xg_index
Subzero.grid_yc_index
Subzero.grid_yg_index
Subzero.grids_from_lines
Subzero.hashole
Subzero.hashole
Subzero.in_bounds
Subzero.in_bounds
Subzero.in_bounds
Subzero.in_bounds
Subzero.initialize_floe_field
Subzero.initialize_floe_field
Subzero.initialize_jld2_file!
Subzero.initialize_netcdf_file!
Subzero.initialize_topography_field
Subzero.initialize_topography_field
Subzero.intersect_polys
Subzero.level_to_string
Subzero.mc_interpolation
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.periodic_compat
Subzero.plot_conservation
Subzero.poly_to_floes!
Subzero.potential_interaction
Subzero.prettytime
Subzero.remove_floe_overlap!
Subzero.remove_floes!
Subzero.replace_floe!
Subzero.restart!
Subzero.rotate_radians!
Subzero.run!
Subzero.shift_cell_idx
Subzero.shift_cell_idx
Subzero.simplify_floes!
Subzero.smooth_floes!
Subzero.split_floe
Subzero.startup_sim
Subzero.teardown_sim
Subzero.timestep_collisions!
Subzero.timestep_coupling!
Subzero.timestep_floe_properties!
Subzero.timestep_ridging_rafting!
Subzero.timestep_sim!
Subzero.timestep_welding!
Subzero.translate
Subzero.translate!
Subzero.update_boundaries!
Subzero.update_boundary!
Subzero.update_boundary!
Subzero.update_boundary!
Subzero.update_criteria!
Subzero.update_criteria!
Subzero.update_ghost_timestep_vals!
Subzero.update_new_rotation_conserve!
Subzero.valid_polyvec!
Subzero.valid_ringvec!
Subzero.which_points_on_edges
Subzero.which_vertices_match_points
Subzero.write_checkpoint_data!
Subzero.write_data!
Subzero.write_floe_data!
Subzero.write_grid_data!
Subzero.write_init_state_data!
All methods
Subzero.Subzero
— ModuleModule Subzero.jl
- UW's sea ice model ported from MATLAB to Julia
Subzero.NonPeriodicBoundary
— TypeNonPeriodicBoundary
Union of all non-peridic boundary types to use as shorthand for dispatch.
Subzero.AbstractBoundary
— TypeAbstractBoundary{D<:AbstractDirection, FT}<:AbstractDomainElement{FT}
An abstract type for the types of boundaries at the edges of the model domain. Boundary types will control behavior of sea ice floes at edges of domain. The direction given by type D denotes which edge of a domain this boundary could be and type FT is the simulation float type (e.g. Float64 or Float32).
Each boundary type has the coordinates of the boudnary as a field. These should be shapes that completely seal the domain, and should overlap on the corners as seen in the example below: ________________ ||____val___|| <- North coordinates include corners | | | | | | | | <- East and west coordinates ALSO include corners | | | | Each bounday type also has a field called "val" that holds value that defines the line y = val or x = val (depending on boundary direction), such that if the floe crosses that line it would be partially within the boundary.
Subzero.AbstractDirection
— TypeAbstractDirection
An abstract type for the boundary cardinal directions within model domain. Boundary direction will control behavior of sea ice floes at edges of domain.
Subzero.AbstractDomainElement
— TypeAbstractDomainElement{FT<:AbstractFloat}
An abstract type for all of the element that create the shape of the domain: the 4 boundary walls that make up the rectangular domain and the topography within the domain.
Subzero.AbstractFractureCriteria
— TypeAbstractFractureCriteria
Abstract type for fracture criteria. Each struct of this type must have a vertices field representing the criteria in principal stress space. For a given polygon, the minimum and maximum eigenvalues of its stress field will be its location in principal stress space. If that stress point falls outside of the criteria-verticies defined polygon it is a stress great enough to fracture the floe. Otherwise the floe will not be fractured. Each fracture criteria type must also have an update_criteria! function defined that is used to update the criteria each timestep. If the criteria does not need to be updated, this function can be empty.
Subzero.AbstractGrid
— TypeAbstractGrid
An abstract type for the grid that model will be simulated on. Affects calculation on the grid.
Subzero.AbstractOutputWriter
— TypeAbstractOutputWriter
An abstract type for output writers that provide data from simulation runs.
Subzero.AbstractStressCalculator
— Typeabstract type AbstractStressCalculator{FT <: AbstractFloat}
Abstract super type for stress calculators, which calculate a floe's stress from floe interactions. The subtypes serve as dispatch types for the following three calculation methods.
API
The following methods must be implemented for all subtypes:
_update_stress_accum!(stress_calculator::AbstractStressCalculator{FT}, curr_stress::Matrix{FT} , floe::FloeType{FT})
_scale_principal_stress!(stress_calculator::AbstractStressCalculator{FT}, σvals::Matrix{FT}, floe::FloeType{FT}, floe_settings::FloeSettings)
_update_stress_accum!
is called in the calc_stress!
function and takes the stress calculator, the floe
's instantatious stress at the current timestep, and the floe
itself and updates the floe
's stress_accum
field, which is used when determining floe fracture based off of stress. Within the function, other floe fields can be updated as needed.
_scale_principal_stress!
is called within the find_σpoint
function which is called within the determine_fractures
function. This function takes the stress calculator, the floe
's accumulated stress in prinicpal stress space (σvals = eigvals(stress_accum)
), the floe
itself, and the floe_settings
and scales σvals
by some values/ratio using physical properties within floe
and floe_settings
. This is done to approximate changing the polygon defining the floe's fracture criteria without having to redefine the fracture criteria for each floe. This is almost like a proxy for damage.
Subzero.AbstractSubFloePointsGenerator
— TypeAbstractSubFloePointsGenerator
Abstract type for parameters determining generation of sub-floe points used for interpolation. The points generated using these parameters will be used to find stresses on each floe from the ocean and the atmosphere. There must be a generate_subfloe_points
function that dispatches off of the subtype of AbstractSubFloePointsGenerator to generate the points for a given floe. Points generated must all be within a given floe.
Subzero.Atmos
— TypeAtmos velocities in the x-direction (u) and y-direction (v). u and v should match the size of the corresponding model grid so that there is one x and y velocity value for each grid cell. Atmos also needs temperature at the atmosphere/ice interface in each grid cell. Model cannot be constructed if size of atmos fields and grid do not match.
Subzero.Atmos
— MethodAtmos(args...)
If a type isn't specified, Atmos will be of type Float64 and the correct constructor will be called with all other arguments.
Subzero.Atmos
— MethodAtmos{FT}(grid, u, v)
Construct model atmosphere of type FT. Inputs: grid <AbstractGrid> model's grid u <Real> Atmos x-velocity for each grid cell v <Real> Atmos y-velocity for each grid cell temp <Real> temperature at atmopshere/ice interface per grid cell Output: Atmosphere of type FT with constant velocity and temperature over domain.
Subzero.Atmos
— MethodAtmos(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Atmos constructor. An Atmos of type FT will be created by passing all other arguments to the correct constructor.
Subzero.CellFloes
— TypeCellFloes{FT<:AbstractFloat}
Struct that tracks which floes are within given cell, as well as the translation vector needed to move floe each from current postion into cell if it is in cell due to periodic boundaries. Each index in floeidx is the index of a floe within the cell and the Δx and Δy with the same index are that floe's translation vector. Note: the floeidx is the index of grid cells centered on grid lines, not on the grid cells defined by the regular, rectilinear grid.
Subzero.CellFloes
— MethodCellFloes{FT}()
Constructs an CellFloes object with empty lists for fields.
Subzero.CheckpointOutputWriter
— TypeCheckpointOutputWriter(writer::CheckpointOutputWriter, [Δtout]; kwargs...)
Creates an checkpoint writer from an existing writer, copying all fields unless new field values are explicity provided either as the optional argument Δtout or through keyword arguments.
Subzero.CheckpointOutputWriter
— TypeCheckpointOutputWriter(Δtout, fn){ST<:AbstractString}<:AbstractOutputWriter
Checkpoint subtype of AbstractOutputWriter that holds information for outputting checkpoint information used for restarting the simulation from a point where the writer saved data. Checkpoint data is saved every Δtout timesteps to filepath. If the given file doesn't end in ".jld2" the extension will be appended. If overwrite is true then if there is already a file of the given name, it will be overwriten. Else it will thrown an error.
Subzero.CheckpointOutputWriter
— MethodCheckpointOutputWriter(
+API Reference · Subzero.jl Full Subzero API documentation
Warning This page is still very much WIP!
Documentation for Subzero's full API (only for reference!).
Subzero
Subzero.Subzero
Subzero.AbstractBoundary
Subzero.AbstractDirection
Subzero.AbstractDomainElement
Subzero.AbstractFractureCriteria
Subzero.AbstractGrid
Subzero.AbstractOutputWriter
Subzero.AbstractStressCalculator
Subzero.AbstractSubFloePointsGenerator
Subzero.Atmos
Subzero.Atmos
Subzero.Atmos
Subzero.Atmos
Subzero.CellFloes
Subzero.CellFloes
Subzero.CheckpointOutputWriter
Subzero.CheckpointOutputWriter
Subzero.CheckpointOutputWriter
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionBoundary
Subzero.CollisionSettings
Subzero.CollisionSettings
Subzero.Constants
Subzero.Constants
Subzero.CouplingSettings
Subzero.DamageStressCalculator
Subzero.DamageStressCalculator
Subzero.DamageStressCalculator
Subzero.DecayAreaScaledCalculator
Subzero.DecayAreaScaledCalculator
Subzero.DecayAreaScaledCalculator
Subzero.Domain
Subzero.Domain
Subzero.East
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.Floe
Subzero.FloeOutputWriter
Subzero.FloeOutputWriter
Subzero.FloeOutputWriter
Subzero.FloeSettings
Subzero.FloeSettings
Subzero.FractureSettings
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.GridOutputWriter
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.HiblerYieldCurve
Subzero.IceStressCell
Subzero.IceStressCell
Subzero.InitialStateOutputWriter
Subzero.InitialStateOutputWriter
Subzero.InitialStateOutputWriter
Subzero.InteractionFields
Subzero.Model
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MohrsCone
Subzero.MonteCarloPointsGenerator
Subzero.MonteCarloPointsGenerator
Subzero.MonteCarloPointsGenerator
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.MovingBoundary
Subzero.NoFracture
Subzero.NonPeriodicBoundary
Subzero.North
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.Ocean
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OpenBoundary
Subzero.OutputWriters
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PeriodicBoundary
Subzero.PolyVec
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RegRectilinearGrid
Subzero.RidgeRaftSettings
Subzero.RidgeRaftSettings
Subzero.RingVec
Subzero.SimplificationSettings
Subzero.SimplificationSettings
Subzero.Simulation
Subzero.South
Subzero.StatusTag
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubGridPointsGenerator
Subzero.SubzeroLogger
Subzero.SubzeroLogger
Subzero.SubzeroLogger
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.TopographyElement
Subzero.WeldSettings
Subzero.WeldSettings
Subzero.West
Base.::
Base.empty!
Base.empty!
Base.to_index
Logging.handle_message
Subzero._calculate_hibler
Subzero._calculate_mohrs
Subzero._calculate_mohrs
Subzero._initialize_floe_field
Subzero._initialize_floe_field
Subzero.add_floe_ghosts!
Subzero.add_floe_volume!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_ghosts!
Subzero.add_point!
Subzero.add_point!
Subzero.auto_extension
Subzero.bin_floe_centroids
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.boundary_coords
Subzero.calc_angular_momentum
Subzero.calc_atmosphere_forcing
Subzero.calc_elastic_forces
Subzero.calc_eulerian_data!
Subzero.calc_friction_forces
Subzero.calc_kinetic_energy
Subzero.calc_linear_momentum
Subzero.calc_normal_force
Subzero.calc_ocean_forcing!
Subzero.calc_one_way_coupling!
Subzero.calc_strain!
Subzero.calc_stress!
Subzero.calc_subfloe_values!
Subzero.calc_torque!
Subzero.calc_two_way_coupling!
Subzero.center_cell_coords
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_cell_bounds
Subzero.check_energy_momentum_conservation_julia
Subzero.check_energy_momentum_conservation_matlab
Subzero.check_for_edge_mid
Subzero.compare_floe_data
Subzero.compare_grid_data
Subzero.compare_oa_checkpointer_data
Subzero.conserve_momentum_change_floe_shape!
Subzero.conserve_momentum_fracture_floe!
Subzero.conserve_momentum_transfer_mass!
Subzero.deepcopy_floe
Subzero.deform_floe!
Subzero.determine_fractures
Subzero.dissolve_floe!
Subzero.domain_in_grid
Subzero.euclidian_dist
Subzero.find_center_cell_index
Subzero.find_ghosts!
Subzero.find_ghosts!
Subzero.find_grid_cell_index
Subzero.find_interp_knots
Subzero.find_interp_knots
Subzero.find_poly_coords
Subzero.find_shared_edges_midpoint
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_element_interaction!
Subzero.floe_domain_interaction!
Subzero.floe_domain_raft!
Subzero.floe_domain_ridge!
Subzero.floe_floe_interaction!
Subzero.floe_floe_raft!
Subzero.floe_floe_ridge!
Subzero.floe_to_grid_info!
Subzero.fracture_floes!
Subzero.fuse_floes!
Subzero.fuse_two_floes!
Subzero.generate_subfloe_points
Subzero.generate_subfloe_points
Subzero.generate_voronoi_coords
Subzero.get_known_grid_outputs
Subzero.get_velocity
Subzero.get_velocity
Subzero.getattrs
Subzero.ghosts_on_bounds!
Subzero.grid_cell_index
Subzero.grid_line_index
Subzero.grid_xc_index
Subzero.grid_xg_index
Subzero.grid_yc_index
Subzero.grid_yg_index
Subzero.grids_from_lines
Subzero.hashole
Subzero.hashole
Subzero.in_bounds
Subzero.in_bounds
Subzero.in_bounds
Subzero.in_bounds
Subzero.initialize_floe_field
Subzero.initialize_floe_field
Subzero.initialize_jld2_file!
Subzero.initialize_netcdf_file!
Subzero.initialize_topography_field
Subzero.initialize_topography_field
Subzero.intersect_polys
Subzero.level_to_string
Subzero.mc_interpolation
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.normal_direction_correct!
Subzero.periodic_compat
Subzero.plot_conservation
Subzero.poly_to_floes!
Subzero.potential_interaction
Subzero.prettytime
Subzero.remove_floe_overlap!
Subzero.remove_floes!
Subzero.replace_floe!
Subzero.restart!
Subzero.rotate_radians!
Subzero.run!
Subzero.shift_cell_idx
Subzero.shift_cell_idx
Subzero.simplify_floes!
Subzero.smooth_floes!
Subzero.split_floe
Subzero.startup_sim
Subzero.teardown_sim
Subzero.timestep_collisions!
Subzero.timestep_coupling!
Subzero.timestep_floe_properties!
Subzero.timestep_ridging_rafting!
Subzero.timestep_sim!
Subzero.timestep_welding!
Subzero.translate
Subzero.translate!
Subzero.update_boundaries!
Subzero.update_boundary!
Subzero.update_boundary!
Subzero.update_boundary!
Subzero.update_criteria!
Subzero.update_criteria!
Subzero.update_ghost_timestep_vals!
Subzero.update_new_rotation_conserve!
Subzero.valid_polyvec!
Subzero.valid_ringvec!
Subzero.which_points_on_edges
Subzero.which_vertices_match_points
Subzero.write_checkpoint_data!
Subzero.write_data!
Subzero.write_floe_data!
Subzero.write_grid_data!
Subzero.write_init_state_data!
All methods
Subzero.Subzero
— ModuleFast and Flexible Sea Ice Dynamics
Subzero.jl is a native Julia discrete-element model (DEM) for exploring fine-scale sea ice dynamics, reimplementing MATLAB model SubZero by Manucharyan and Montemuro.
- 🚀 Runs over 35 times faster that original MATLAB model for title simulation!
- 🧩 Modular simulation model makes it easy to customize simulations!
- Enable and disable physical processes such as fracturing, ridging, and welding
- Choose algorithms for key processes (or add your own!)
Documentation
To learn how to build and run simulations, check out our documentation and tutorials!
Installation
Subzero is a registered Julia package. So to install it,
Download Julia (version 1.9 or later).
Launch Julia and type
julia> using Pkg
+
+julia> Pkg.add("Subzero")
Citing
If you use Subzero.jl as part of your research, teaching, or other activities, we would be grateful if you could cite our work. We are currently working on a JOSS paper, which will be linked here. If you are ready to publish before that, please reach out to us to discuss citations.
Contributing
If you’re interested in contributing to the development Subzero, we would love to have you! We welcome all kinds of contributions from bug reports, to documentation, to features, and suggestions. We can't wait to talk to you.
Please check out our contributers' guide for more details.
Authors
- Primary Author: Skylar Gering (@skygering)
The list of Subzero contributors:
sourceSubzero.NonPeriodicBoundary
— TypeNonPeriodicBoundary
Union of all non-peridic boundary types to use as shorthand for dispatch.
sourceSubzero.AbstractBoundary
— TypeAbstractBoundary{D<:AbstractDirection, FT}<:AbstractDomainElement{FT}
An abstract type for the types of boundaries at the edges of the model domain. Boundary types will control behavior of sea ice floes at edges of domain. The direction given by type D denotes which edge of a domain this boundary could be and type FT is the simulation float type (e.g. Float64 or Float32).
Each boundary type has the coordinates of the boudnary as a field. These should be shapes that completely seal the domain, and should overlap on the corners as seen in the example below: ________________ ||____val___|| <- North coordinates include corners | | | | | | | | <- East and west coordinates ALSO include corners | | | | Each bounday type also has a field called "val" that holds value that defines the line y = val or x = val (depending on boundary direction), such that if the floe crosses that line it would be partially within the boundary.
sourceSubzero.AbstractDirection
— TypeAbstractDirection
An abstract type for the boundary cardinal directions within model domain. Boundary direction will control behavior of sea ice floes at edges of domain.
sourceSubzero.AbstractDomainElement
— TypeAbstractDomainElement{FT<:AbstractFloat}
An abstract type for all of the element that create the shape of the domain: the 4 boundary walls that make up the rectangular domain and the topography within the domain.
sourceSubzero.AbstractFractureCriteria
— TypeAbstractFractureCriteria
Abstract type for fracture criteria. Each struct of this type must have a vertices field representing the criteria in principal stress space. For a given polygon, the minimum and maximum eigenvalues of its stress field will be its location in principal stress space. If that stress point falls outside of the criteria-verticies defined polygon it is a stress great enough to fracture the floe. Otherwise the floe will not be fractured. Each fracture criteria type must also have an update_criteria! function defined that is used to update the criteria each timestep. If the criteria does not need to be updated, this function can be empty.
sourceSubzero.AbstractGrid
— TypeAbstractGrid
An abstract type for the grid that model will be simulated on. Affects calculation on the grid.
sourceSubzero.AbstractOutputWriter
— TypeAbstractOutputWriter
An abstract type for output writers that provide data from simulation runs.
sourceSubzero.AbstractStressCalculator
— Typeabstract type AbstractStressCalculator{FT <: AbstractFloat}
Abstract super type for stress calculators, which calculate a floe's stress from floe interactions. The subtypes serve as dispatch types for the following three calculation methods.
API
The following methods must be implemented for all subtypes:
_update_stress_accum!(stress_calculator::AbstractStressCalculator{FT}, curr_stress::Matrix{FT} , floe::FloeType{FT})
_scale_principal_stress!(stress_calculator::AbstractStressCalculator{FT}, σvals::Matrix{FT}, floe::FloeType{FT}, floe_settings::FloeSettings)
_update_stress_accum!
is called in the calc_stress!
function and takes the stress calculator, the floe
's instantatious stress at the current timestep, and the floe
itself and updates the floe
's stress_accum
field, which is used when determining floe fracture based off of stress. Within the function, other floe fields can be updated as needed.
_scale_principal_stress!
is called within the find_σpoint
function which is called within the determine_fractures
function. This function takes the stress calculator, the floe
's accumulated stress in prinicpal stress space (σvals = eigvals(stress_accum)
), the floe
itself, and the floe_settings
and scales σvals
by some values/ratio using physical properties within floe
and floe_settings
. This is done to approximate changing the polygon defining the floe's fracture criteria without having to redefine the fracture criteria for each floe. This is almost like a proxy for damage.
sourceSubzero.AbstractSubFloePointsGenerator
— TypeAbstractSubFloePointsGenerator
Abstract type for parameters determining generation of sub-floe points used for interpolation. The points generated using these parameters will be used to find stresses on each floe from the ocean and the atmosphere. There must be a generate_subfloe_points
function that dispatches off of the subtype of AbstractSubFloePointsGenerator to generate the points for a given floe. Points generated must all be within a given floe.
sourceSubzero.Atmos
— TypeAtmos velocities in the x-direction (u) and y-direction (v). u and v should match the size of the corresponding model grid so that there is one x and y velocity value for each grid cell. Atmos also needs temperature at the atmosphere/ice interface in each grid cell. Model cannot be constructed if size of atmos fields and grid do not match.
sourceSubzero.Atmos
— MethodAtmos(args...)
If a type isn't specified, Atmos will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Atmos
— MethodAtmos{FT}(grid, u, v)
Construct model atmosphere of type FT. Inputs: grid <AbstractGrid> model's grid u <Real> Atmos x-velocity for each grid cell v <Real> Atmos y-velocity for each grid cell temp <Real> temperature at atmopshere/ice interface per grid cell Output: Atmosphere of type FT with constant velocity and temperature over domain.
sourceSubzero.Atmos
— MethodAtmos(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Atmos constructor. An Atmos of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.CellFloes
— TypeCellFloes{FT<:AbstractFloat}
Struct that tracks which floes are within given cell, as well as the translation vector needed to move floe each from current postion into cell if it is in cell due to periodic boundaries. Each index in floeidx is the index of a floe within the cell and the Δx and Δy with the same index are that floe's translation vector. Note: the floeidx is the index of grid cells centered on grid lines, not on the grid cells defined by the regular, rectilinear grid.
sourceSubzero.CellFloes
— MethodCellFloes{FT}()
Constructs an CellFloes object with empty lists for fields.
sourceSubzero.CheckpointOutputWriter
— TypeCheckpointOutputWriter(writer::CheckpointOutputWriter, [Δtout]; kwargs...)
Creates an checkpoint writer from an existing writer, copying all fields unless new field values are explicity provided either as the optional argument Δtout or through keyword arguments.
sourceSubzero.CheckpointOutputWriter
— TypeCheckpointOutputWriter(Δtout, fn){ST<:AbstractString}<:AbstractOutputWriter
Checkpoint subtype of AbstractOutputWriter that holds information for outputting checkpoint information used for restarting the simulation from a point where the writer saved data. Checkpoint data is saved every Δtout timesteps to filepath. If the given file doesn't end in ".jld2" the extension will be appended. If overwrite is true then if there is already a file of the given name, it will be overwriten. Else it will thrown an error.
sourceSubzero.CheckpointOutputWriter
— MethodCheckpointOutputWriter(
Δtout;
dir = ".",
filename = "checkpoint.jld2",
overwrite = false,
jld2_kw = Dict{Symbol, Any}(),
-)
CheckpointOutputWriter writer that outputs need data to restart simulation at given timesteps Δtout. Inputs: Δtout <Int> number of timesteps between output dir <String> Directory to save output to - default is "." (current working directory). filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: CheckpointOutputWriter that outputs floes, ocean, and atmosphere states at desired timesteps.
sourceSubzero.CollisionBoundary
— TypeCollisionBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that stops a floe from exiting the domain by having the floe collide with the boundary. The boundary acts as an immovable, unbreakable ice floe in the collision.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary{D, FT}(grid)
Creates collision boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid direction <AbstractDirection> direction of boundary wall Outputs: Collision Boundary on edge of grid given by direction.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any CollisionBoundary constructor. The second argument D is the directional type of the boundary. A CollisionBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary(::Type{D}, args...)
If a float type isn't specified, CollisionBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.CollisionSettings
— TypeCollisionSettings{FT<:AbstractFloat}
Settings needed for collisions within the model. If collisionson is true, collisions will occur, else they will not. The floefloemaxoverlap defines the percentage of overlap allowed between floes before marking them for ridging/rafting. The floedomainmaxoverlap defines the percentage of overlap allowed between floes and the domain (collision boundaries and topography) before removing the floe from the simulation. Both floefloemaxoverlap and floedomainmaxoverlap should be between 0-1 and if a value < 0 is given or a value > 1 is given when collisionson is true they will be set to 0 and 1 respectively.
sourceSubzero.CollisionSettings
— MethodCollisionSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any CollisionSettings constructor. A CollisionSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.Constants
— MethodConstants(args...)
If a type isn't specified, Constants will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Constants
— MethodConstants(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Constants constructor. A Constants of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.CouplingSettings
— TypeCouplingSettings
Settings needed for coupling within the model. If couplingon is true, the model will be coupled with the simulation's ocean and atmosphere. The Δt determines how many simulation timesteps between calculating ocean and atmospheric forces on the floes. Δd number of buffer grid cells on each side of floe for monte carlo interpolation and mcn is the number of monte carlo points to attempt to generage for each floe. If twowaycoupling_on is true then the simulation calculates the stress the ice/atmosphere put on the ocean.
sourceSubzero.DamageStressCalculator
— TypeDamageStressCalculator{FT<:AbstractFloat} <: AbstractStressCalculator{FT}
Type of AbstractStressCalculator that calculates stress with each timestep with damage * stress_instant
, as suggested by Mukund Gupta. This method could keep track of damage directly within each floe using the damage
floe field, perhapes as a value between 0-1, and rather than calculating an "accumulated stress" to store damage, as done in DecayAreaScaledCalculator
.
In this calculator, the floe's damage
field keeps track of an explicit parameter.
Fields:
Note:
This method is not implemented and thus throws an error upon creation. The infrastructure for the damage calculator is provided, but functions that depend on this calculator need to be implemented as detailed in the AbstractStressCalculator
API.
sourceSubzero.DamageStressCalculator
— MethodDamageStressCalculator(; kwargs...)
If type isn't specified, DamageStressCalculator
(; kwargs...) will be of type Float64
and the correct constructor will be called with all other arguments.
sourceSubzero.DamageStressCalculator
— MethodDamageStressCalculator(::Type{FT}; kwargs...)
A float type FT
can be provided as the first argument of any DamageStressCalculator
constructor. A DamageStressCalculator
of type FT
will be created by passing all other arguments to the correct constructor.
sourceSubzero.DecayAreaScaledCalculator
— TypeDecayAreaScaledCalculator{FT<:AbstractFloat} <: AbstractStressCalculator{FT}
Type of AbstractStressCalculator that implements stress calculations by accumulating each timestep of stress using a decay equation. The decay aspect increases importance placed on new damage. The decay equation is as follows:
`stressaccum = stressaccum(1-λ) + stress_instant(λ)
The area-scaling part of the stress calculations comes into play when deciding if a floe will be fractured. The accumulated stress can be scaled by a ratio of (floe.area/minfloearea)^α. By changing the α value, either larger or smaller floes fracture more eassily. The scaled value will not be saved as this is equivalent to scaling the simulation fracture criteria (morh's cone or hibler's ellipse, etc.), but it is less computationally intensive. By leaving the default α = 0
, this extra scaling will not take place.
Fields:
λ::AbstractFloat
: decay parameter used when calculating accumulated stress. Should be between 0 - 1.α::AbstractFloat
: Adjusts ellipse in stress space by raising the ratio to the floe's area over the simulation minimum floe size to α
.
Note:
λ
is used in _update_stress_accum!
, whereas α is used in _scale_principal_stress!
.
sourceSubzero.DecayAreaScaledCalculator
— MethodDecayAreaScaledCalculator(; kwargs...)
If type isn't specified as the first argument, DecayAreaScaledCalculator
(; kwargs...) will be of type Float64
and the correct constructor will be called with all other arguments.
sourceSubzero.DecayAreaScaledCalculator
— MethodDecayAreaScaledCalculator(::Type{FT}; kwargs...)
A float type FT
can be provided as the first argument of any DecayAreaScaledCalculator
constructor. A DecayAreaScaledCalculator
of type FT
will be created by passing all other arguments to the correct constructor.
sourceSubzero.Domain
— TypeDomain that holds 4 Boundary elements, forming a rectangle bounding the model during the simulation, and a list of topography elements.
In order to create a Domain, three conditions need to be met. First, if needs to be periodically compatible. This means that pairs of opposite boundaries both need to be periodic if one of them is periodic. Next, the value in the north boundary must be greater than the south boundary and the value in the east boundary must be greater than the west in order to form a valid rectangle.
Note: The code depends on the boundaries forming a rectangle oriented along the cartesian grid. Other shapes/orientations are not supported at this time.
sourceSubzero.Domain
— MethodDomain(north, south, east, west)
Creates domain with empty list of topography and given boundaries. Inputs: north <AbstractBoundary> north boundary south <AbstractBoundary> south boundary east <AbstractBoundary> east boundary west <AbstractBoundary> west boundary
sourceSubzero.East
— TypeEast<:AbstractDirection
A simple direction type representing if a boundary is the eastern boundary in a rectangular domain.
sourceSubzero.Floe
— TypeSingular sea ice floe with fields describing current state.
sourceSubzero.Floe
— MethodFloe(args...)
If a type isn't specified, Floe will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Floe
— MethodFloe{FT}(
+)
CheckpointOutputWriter writer that outputs need data to restart simulation at given timesteps Δtout. Inputs: Δtout <Int> number of timesteps between output dir <String> Directory to save output to - default is "." (current working directory). filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: CheckpointOutputWriter that outputs floes, ocean, and atmosphere states at desired timesteps.
sourceSubzero.CollisionBoundary
— TypeCollisionBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that stops a floe from exiting the domain by having the floe collide with the boundary. The boundary acts as an immovable, unbreakable ice floe in the collision.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary{D, FT}(grid)
Creates collision boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid direction <AbstractDirection> direction of boundary wall Outputs: Collision Boundary on edge of grid given by direction.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any CollisionBoundary constructor. The second argument D is the directional type of the boundary. A CollisionBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.CollisionBoundary
— MethodCollisionBoundary(::Type{D}, args...)
If a float type isn't specified, CollisionBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.CollisionSettings
— TypeCollisionSettings{FT<:AbstractFloat}
Settings needed for collisions within the model. If collisionson is true, collisions will occur, else they will not. The floefloemaxoverlap defines the percentage of overlap allowed between floes before marking them for ridging/rafting. The floedomainmaxoverlap defines the percentage of overlap allowed between floes and the domain (collision boundaries and topography) before removing the floe from the simulation. Both floefloemaxoverlap and floedomainmaxoverlap should be between 0-1 and if a value < 0 is given or a value > 1 is given when collisionson is true they will be set to 0 and 1 respectively.
sourceSubzero.CollisionSettings
— MethodCollisionSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any CollisionSettings constructor. A CollisionSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.Constants
— MethodConstants(args...)
If a type isn't specified, Constants will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Constants
— MethodConstants(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Constants constructor. A Constants of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.CouplingSettings
— TypeCouplingSettings
Settings needed for coupling within the model. If couplingon is true, the model will be coupled with the simulation's ocean and atmosphere. The Δt determines how many simulation timesteps between calculating ocean and atmospheric forces on the floes. Δd number of buffer grid cells on each side of floe for monte carlo interpolation and mcn is the number of monte carlo points to attempt to generage for each floe. If twowaycoupling_on is true then the simulation calculates the stress the ice/atmosphere put on the ocean.
sourceSubzero.DamageStressCalculator
— TypeDamageStressCalculator{FT<:AbstractFloat} <: AbstractStressCalculator{FT}
Type of AbstractStressCalculator that calculates stress with each timestep with damage * stress_instant
, as suggested by Mukund Gupta. This method could keep track of damage directly within each floe using the damage
floe field, perhapes as a value between 0-1, and rather than calculating an "accumulated stress" to store damage, as done in DecayAreaScaledCalculator
.
In this calculator, the floe's damage
field keeps track of an explicit parameter.
Fields:
Note:
This method is not implemented and thus throws an error upon creation. The infrastructure for the damage calculator is provided, but functions that depend on this calculator need to be implemented as detailed in the AbstractStressCalculator
API.
sourceSubzero.DamageStressCalculator
— MethodDamageStressCalculator(; kwargs...)
If type isn't specified, DamageStressCalculator
(; kwargs...) will be of type Float64
and the correct constructor will be called with all other arguments.
sourceSubzero.DamageStressCalculator
— MethodDamageStressCalculator(::Type{FT}; kwargs...)
A float type FT
can be provided as the first argument of any DamageStressCalculator
constructor. A DamageStressCalculator
of type FT
will be created by passing all other arguments to the correct constructor.
sourceSubzero.DecayAreaScaledCalculator
— TypeDecayAreaScaledCalculator{FT<:AbstractFloat} <: AbstractStressCalculator{FT}
Type of AbstractStressCalculator that implements stress calculations by accumulating each timestep of stress using a decay equation. The decay aspect increases importance placed on new damage. The decay equation is as follows:
`stressaccum = stressaccum(1-λ) + stress_instant(λ)
The area-scaling part of the stress calculations comes into play when deciding if a floe will be fractured. The accumulated stress can be scaled by a ratio of (floe.area/minfloearea)^α. By changing the α value, either larger or smaller floes fracture more eassily. The scaled value will not be saved as this is equivalent to scaling the simulation fracture criteria (morh's cone or hibler's ellipse, etc.), but it is less computationally intensive. By leaving the default α = 0
, this extra scaling will not take place.
Fields:
λ::AbstractFloat
: decay parameter used when calculating accumulated stress. Should be between 0 - 1.α::AbstractFloat
: Adjusts ellipse in stress space by raising the ratio to the floe's area over the simulation minimum floe size to α
.
Note:
λ
is used in _update_stress_accum!
, whereas α is used in _scale_principal_stress!
.
sourceSubzero.DecayAreaScaledCalculator
— MethodDecayAreaScaledCalculator(; kwargs...)
If type isn't specified as the first argument, DecayAreaScaledCalculator
(; kwargs...) will be of type Float64
and the correct constructor will be called with all other arguments.
sourceSubzero.DecayAreaScaledCalculator
— MethodDecayAreaScaledCalculator(::Type{FT}; kwargs...)
A float type FT
can be provided as the first argument of any DecayAreaScaledCalculator
constructor. A DecayAreaScaledCalculator
of type FT
will be created by passing all other arguments to the correct constructor.
sourceSubzero.Domain
— TypeDomain that holds 4 Boundary elements, forming a rectangle bounding the model during the simulation, and a list of topography elements.
In order to create a Domain, three conditions need to be met. First, if needs to be periodically compatible. This means that pairs of opposite boundaries both need to be periodic if one of them is periodic. Next, the value in the north boundary must be greater than the south boundary and the value in the east boundary must be greater than the west in order to form a valid rectangle.
Note: The code depends on the boundaries forming a rectangle oriented along the cartesian grid. Other shapes/orientations are not supported at this time.
sourceSubzero.Domain
— MethodDomain(north, south, east, west)
Creates domain with empty list of topography and given boundaries. Inputs: north <AbstractBoundary> north boundary south <AbstractBoundary> south boundary east <AbstractBoundary> east boundary west <AbstractBoundary> west boundary
sourceSubzero.East
— TypeEast<:AbstractDirection
A simple direction type representing if a boundary is the eastern boundary in a rectangular domain.
sourceSubzero.Floe
— TypeSingular sea ice floe with fields describing current state.
sourceSubzero.Floe
— MethodFloe(args...)
If a type isn't specified, Floe will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Floe
— MethodFloe{FT}(
coords::PolyVec,
hmean,
Δh;
@@ -13,37 +15,37 @@
mc_n = 1000,
rng = Xoshiro(),
kwargs...,
-)
Floe constructor with PolyVec coordinates Inputs: coords <Vector{Vector{Vector{Float64}}}> floe coordinates hmean <Real> mean height for floes Δh <Real> variability in height for floes floe_settings <FloeSettings> settings needed to initialize floe rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm kwargs Any other floe fields to set as keyword arguments Output: <Floe> with needed fields defined - all default field values used so all forcings start at 0 and floe's status is "active" as long as monte carlo points were able to be generated.
sourceSubzero.Floe
— MethodFloe{FT}(
+)
Floe constructor with PolyVec coordinates Inputs: coords <Vector{Vector{Vector{Float64}}}> floe coordinates hmean <Real> mean height for floes Δh <Real> variability in height for floes floe_settings <FloeSettings> settings needed to initialize floe rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm kwargs Any other floe fields to set as keyword arguments Output: <Floe> with needed fields defined - all default field values used so all forcings start at 0 and floe's status is "active" as long as monte carlo points were able to be generated.
sourceSubzero.Floe
— MethodFloe{FT}(
poly::Polys,
hmean,
Δh;
floe_settings = FloeSettings(),
rng = Xoshiro(),
kwargs...
-)
Constructor for floe with a polygon Inputs: poly <Polygon> hmean <Real> mean height for floes Δh <Real> variability in height for floes floe_settings <FloeSettings> settings needed to initialize floe rng <RNG> random number generator to generate floe attributes - default is Xoshiro256++ algorithm kwargs Any other floe fields to set as keyword arguments Output: <Floe> with needed fields defined - all default field values used so all forcings start at 0 and floe's status is "active" as long as monte carlo points were able to be generated.
sourceSubzero.Floe
— MethodFloe(::Type{FT}, args...; kwargs...)
A float type FT can be provided as the first argument of any Floe constructor. A Floe of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.FloeOutputWriter
— TypeFloeOutputWriter(writer::FloeOutputWriter, [Δtout]; kwargs...)
Creates an floe output writer from an existing writer, copying all fields unless new field values are explicity provided either as the optional argument Δtout or through keyword arguments.
sourceSubzero.FloeOutputWriter
— TypeFloeOutputWriter{ST<:AbstractString}<:AbstractOutputWriter
Floe subtype of AbstractOutputWriter that holds information for outputting floe information from model throughout simulation. Output will be saved to the file defined by fn every Δtout timesteps. Only outputs within the outputs list will be saved. File will be saved as a JLD2 file to filepath. If the given file doesn't end in ".jld2" the extension will be appended. If overwrite is true then if there is already a file of the given name, it will be overwriten. Else it will thrown an error.
sourceSubzero.FloeOutputWriter
— Methodfunction FloeOutputWriter(
+)
Constructor for floe with a polygon Inputs: poly <Polygon> hmean <Real> mean height for floes Δh <Real> variability in height for floes floe_settings <FloeSettings> settings needed to initialize floe rng <RNG> random number generator to generate floe attributes - default is Xoshiro256++ algorithm kwargs Any other floe fields to set as keyword arguments Output: <Floe> with needed fields defined - all default field values used so all forcings start at 0 and floe's status is "active" as long as monte carlo points were able to be generated.
sourceSubzero.Floe
— MethodFloe(::Type{FT}, args...; kwargs...)
A float type FT can be provided as the first argument of any Floe constructor. A Floe of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.FloeOutputWriter
— TypeFloeOutputWriter(writer::FloeOutputWriter, [Δtout]; kwargs...)
Creates an floe output writer from an existing writer, copying all fields unless new field values are explicity provided either as the optional argument Δtout or through keyword arguments.
sourceSubzero.FloeOutputWriter
— TypeFloeOutputWriter{ST<:AbstractString}<:AbstractOutputWriter
Floe subtype of AbstractOutputWriter that holds information for outputting floe information from model throughout simulation. Output will be saved to the file defined by fn every Δtout timesteps. Only outputs within the outputs list will be saved. File will be saved as a JLD2 file to filepath. If the given file doesn't end in ".jld2" the extension will be appended. If overwrite is true then if there is already a file of the given name, it will be overwriten. Else it will thrown an error.
sourceSubzero.FloeOutputWriter
— Methodfunction FloeOutputWriter(
Δtout;
outputs = collect(fieldnames(Floe)),
dir = ".",
filename = "floes.jld2",
overwrite = false,
jld2_kw = Dict{Symbol, Any}(),
-)
FloeOutput writer that outputs provided Floe fields at given timesteps Δtout and saves the information in a file of the provided name. Inputs: Δtout <Int> number of timesteps between output outputs <Vector{Symbols}> list of floe fields to output dir <String> Directory to save output to - default is "." (current working directory) filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: FloeOutputWriter that outputs provided Floe fields every Δtout timesteps to filename Note: If floe field's are not specified using outputs
, all Floe fields will be saved
sourceSubzero.FloeSettings
— TypeFloeSettings
Settings needed to create floes within the model.
- ρi is the density of all floes within the model
- minfloearea is the minimum floe area within the model before removal
- minfloeheight is the minimum floe height within the model before removal
- maxfloeheight is the maximum floe height within the model before the height can't increase any further
- minaspectratio is the minimum ratio between the x-length and y-length of any floe prior to removal
- subfloepointgenerator is the method of subfloe point generation for each floe within the model
- stress_calculator is the method of calculating current stress of floe
sourceSubzero.FloeSettings
— MethodFloeSettings(::Type{FT}; subfloe_point_generator, kwargs...)
A float type FT can be provided as the first argument of any FloeSettings constructor. A FloeSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.FractureSettings
— TypeFractureSettings{CT<:AbstractFractureCriteria}
Settings needed for fractures within the model. If fractureson is true, fractures will occur, else they will not. The criteria defines which fracture criteria are used to determine which floes to fracture. The Δt determines how many simulation timesteps between fracturing floes. If deformon is true, then the floe will be deformed around floe primarily causing the fracture, identified by the largest overlap area on the most recent set of collisions. Npieces denotes how many pieces to try to split a fractured floe into - 3 is suggested value.
sourceSubzero.GridOutputWriter
— TypeGridOutputWriter{FT<:AbstractFloat}<:AbstractOutputWriter
Grid subtype of AbstractOutputWriter that holds information for outputting floe data on the grid. This output does not need to be the grid defined for the model. This grid can be coarser, or more fine, as defined by the xg and yg fields. Output on this scale will be saved to the file defined by filepath every Δtout timesteps. Data will be collected in the data field during calculation for easier writing to the NetCDF file. Only outputs within the outputs list will be saved. There is a limited number of floe outputs that can be calculated by the GridOutputWriter.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(args...; kwargs...)
If a type isn't specified, GridOutputWriter will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(writer::GridOutputWriter, [Δtout]; kwargs...)
Creates an grid output writer from an existing writer, copying all fields unless new field values are explicity provided through keyword arguments.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter{FT}( outputs::Vector{Symbol}, Δtout, grid::AbstractGrid, dims; dir = ".", filename = "gridded_data.nc", overwrite = false, average = false,
Create GridOutputWriter for grid of given dimensions to output floe data averaged on this re-gridded gird at given frequency of timesteps. Only outputs provided outputs. Inputs: outputs <Vector{Symbols}> list of grid outputs desired Δtout <Int> number of timesteps between output grid <Grid> original grid, which we are re-gridding dims <(Int, Int)> output new grid dimensions for these calculations - rows -> ny, cols -> nx dir <String> Directory to save output to - default is "." (current working directory) filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exist average <Bool> if true, average gridded data over timesteps between outputs, else just calculate at output timestep Output: GridOutputWriter that re-grids grid to given dimensions, and saves floe information averaged on this new grid.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(::Type{FT}, args...; kwargs...)
A float type FT can be provided as the first argument of any GridOutputWriter constructor. A GridOutputWriter of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.HiblerYieldCurve
— TypeHiblerYieldCurve{FT<:AbstractFloat}<:AbstractFractureCriteria
Type of AbstractFractureCriteria that creates a yield curve that determines if a floe fractures based off if its stress in principal stress space is inside or outside of the yield curve. Fields: pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing verticies <PolyVec> vertices of criteria in principal stress space Note: Hibler's paper says that: Both pstar and c relate the ice strength to the ice thickness and compactness. c is determined to that 10% open water reduces the strength substantially and pstar is considered a free parameter
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(args...)
If a type isn't specified, HiblerYieldCurve will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(::Type{FT}, args...)
A float type FT can be provided as the first argument of any HiblerYieldCurve constructor. A HiblerYieldCurve of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(floes, pstar = 2.25e5, c = 20.0)
Calculates Hibler's Elliptical Yield curve using parameters pstar, c, and the current floe field. Inputs: floes <StructArray{Floes}> model's list of floes pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing Outputs: HiblerYieldCurve struct with vertices determined using the calculatehibler function.
sourceSubzero.IceStressCell
— TypeIceStressCell{FT<:AbstractFloat}
Struct to collect stress from ice floes on ocean grid cells. One IceStressCell corresponds to one grid cell. It holds a list of running totals of stress on the cell, and a running list of the number of points making up those running totals. Each element in the list corresponds to one floe, which is denoted in the corresponding CellFloes matrix within the grid.
sourceSubzero.IceStressCell
— MethodIceStressCell{FT}()
Constructs an IceStressCell object with empty lists for fields.
sourceSubzero.InitialStateOutputWriter
— TypeInitialStateOuputWriter<:AbstractOutputWriter
Basic type of AbstractOutputWriter that records the intial state of the simulation. Writes JLD2 file with initial simulation state to the filepath specified. If overwrite is true, and there is a file of the given name at the filepath, that file will be overwritten.
sourceSubzero.InitialStateOutputWriter
— MethodInitialStateOutputWriter(writer::InitialStateOutputWriter; kwargs...)
Creates an initial state output writer from an existing writer, copying all fields unless new field values are explicity provided through keyword arguments.
sourceSubzero.InitialStateOutputWriter
— MethodInitialStateOutputWriter(
+)
FloeOutput writer that outputs provided Floe fields at given timesteps Δtout and saves the information in a file of the provided name. Inputs: Δtout <Int> number of timesteps between output outputs <Vector{Symbols}> list of floe fields to output dir <String> Directory to save output to - default is "." (current working directory) filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: FloeOutputWriter that outputs provided Floe fields every Δtout timesteps to filename Note: If floe field's are not specified using outputs
, all Floe fields will be saved
sourceSubzero.FloeSettings
— TypeFloeSettings
Settings needed to create floes within the model.
- ρi is the density of all floes within the model
- minfloearea is the minimum floe area within the model before removal
- minfloeheight is the minimum floe height within the model before removal
- maxfloeheight is the maximum floe height within the model before the height can't increase any further
- minaspectratio is the minimum ratio between the x-length and y-length of any floe prior to removal
- subfloepointgenerator is the method of subfloe point generation for each floe within the model
- stress_calculator is the method of calculating current stress of floe
sourceSubzero.FloeSettings
— MethodFloeSettings(::Type{FT}; subfloe_point_generator, kwargs...)
A float type FT can be provided as the first argument of any FloeSettings constructor. A FloeSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.FractureSettings
— TypeFractureSettings{CT<:AbstractFractureCriteria}
Settings needed for fractures within the model. If fractureson is true, fractures will occur, else they will not. The criteria defines which fracture criteria are used to determine which floes to fracture. The Δt determines how many simulation timesteps between fracturing floes. If deformon is true, then the floe will be deformed around floe primarily causing the fracture, identified by the largest overlap area on the most recent set of collisions. Npieces denotes how many pieces to try to split a fractured floe into - 3 is suggested value.
sourceSubzero.GridOutputWriter
— TypeGridOutputWriter{FT<:AbstractFloat}<:AbstractOutputWriter
Grid subtype of AbstractOutputWriter that holds information for outputting floe data on the grid. This output does not need to be the grid defined for the model. This grid can be coarser, or more fine, as defined by the xg and yg fields. Output on this scale will be saved to the file defined by filepath every Δtout timesteps. Data will be collected in the data field during calculation for easier writing to the NetCDF file. Only outputs within the outputs list will be saved. There is a limited number of floe outputs that can be calculated by the GridOutputWriter.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(args...; kwargs...)
If a type isn't specified, GridOutputWriter will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(writer::GridOutputWriter, [Δtout]; kwargs...)
Creates an grid output writer from an existing writer, copying all fields unless new field values are explicity provided through keyword arguments.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter{FT}( outputs::Vector{Symbol}, Δtout, grid::AbstractGrid, dims; dir = ".", filename = "gridded_data.nc", overwrite = false, average = false,
Create GridOutputWriter for grid of given dimensions to output floe data averaged on this re-gridded gird at given frequency of timesteps. Only outputs provided outputs. Inputs: outputs <Vector{Symbols}> list of grid outputs desired Δtout <Int> number of timesteps between output grid <Grid> original grid, which we are re-gridding dims <(Int, Int)> output new grid dimensions for these calculations - rows -> ny, cols -> nx dir <String> Directory to save output to - default is "." (current working directory) filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exist average <Bool> if true, average gridded data over timesteps between outputs, else just calculate at output timestep Output: GridOutputWriter that re-grids grid to given dimensions, and saves floe information averaged on this new grid.
sourceSubzero.GridOutputWriter
— MethodGridOutputWriter(::Type{FT}, args...; kwargs...)
A float type FT can be provided as the first argument of any GridOutputWriter constructor. A GridOutputWriter of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.HiblerYieldCurve
— TypeHiblerYieldCurve{FT<:AbstractFloat}<:AbstractFractureCriteria
Type of AbstractFractureCriteria that creates a yield curve that determines if a floe fractures based off if its stress in principal stress space is inside or outside of the yield curve. Fields: pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing verticies <PolyVec> vertices of criteria in principal stress space Note: Hibler's paper says that: Both pstar and c relate the ice strength to the ice thickness and compactness. c is determined to that 10% open water reduces the strength substantially and pstar is considered a free parameter
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(args...)
If a type isn't specified, HiblerYieldCurve will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(::Type{FT}, args...)
A float type FT can be provided as the first argument of any HiblerYieldCurve constructor. A HiblerYieldCurve of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.HiblerYieldCurve
— MethodHiblerYieldCurve(floes, pstar = 2.25e5, c = 20.0)
Calculates Hibler's Elliptical Yield curve using parameters pstar, c, and the current floe field. Inputs: floes <StructArray{Floes}> model's list of floes pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing Outputs: HiblerYieldCurve struct with vertices determined using the calculatehibler function.
sourceSubzero.IceStressCell
— TypeIceStressCell{FT<:AbstractFloat}
Struct to collect stress from ice floes on ocean grid cells. One IceStressCell corresponds to one grid cell. It holds a list of running totals of stress on the cell, and a running list of the number of points making up those running totals. Each element in the list corresponds to one floe, which is denoted in the corresponding CellFloes matrix within the grid.
sourceSubzero.IceStressCell
— MethodIceStressCell{FT}()
Constructs an IceStressCell object with empty lists for fields.
sourceSubzero.InitialStateOutputWriter
— TypeInitialStateOuputWriter<:AbstractOutputWriter
Basic type of AbstractOutputWriter that records the intial state of the simulation. Writes JLD2 file with initial simulation state to the filepath specified. If overwrite is true, and there is a file of the given name at the filepath, that file will be overwritten.
sourceSubzero.InitialStateOutputWriter
— MethodInitialStateOutputWriter(writer::InitialStateOutputWriter; kwargs...)
Creates an initial state output writer from an existing writer, copying all fields unless new field values are explicity provided through keyword arguments.
sourceSubzero.InitialStateOutputWriter
— MethodInitialStateOutputWriter(
;
dir = ".",
filename = "initial_state.jld2",
overwrite = false,
jld2_kw = Dict{Symbol, Any}(),
-)
Creates an initial state output writer. Inputs: dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: Creates InitialStateOutputWriter that will write simulation's initial state.
sourceSubzero.InteractionFields
— TypeEnum to index into floe interactions field with more intuituve names
sourceSubzero.Model
— TypeModel which holds grid, ocean, atmos structs, each with the same underlying float type (either Float32 of Float64) and size. It also holds the domain information, which includes the topography and the boundaries. It holds a StructArray of floe structs, again each relying on the same underlying float type. Finally, it also holds the maximum floe id used thus far in the simulation. This should be the length of the floes array at the beginning of the run.
sourceSubzero.MohrsCone
— TypeMohrsCone{FT<:AbstractFloat}<:AbstractFractureCriteria
Type of AbstractFractureCriteria that creates a cone in principal stress space that determines if a floe fractures based off if its stress in principal stress space is inside or outside of the cone. Fields: verticies <PolyVec> vertices of criteria in principal stress space Note: Concepts from the following papter - Weiss, Jérôme, and Erland M. Schulson. "Coulombic faulting from the grain scale to the geophysical scale: lessons from ice." Journal of Physics D: Applied Physics 42.21 (2009): 214017.
sourceSubzero.MohrsCone
— MethodMohrsCone(args...)
If a type isn't specified, MohrsCone will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MohrsCone
— MethodMohrsCone{FT}(val::AbstractFloat, args...)
Calculate Mohr's Cone vertices given calculatemohrs arguments.
sourceSubzero.MohrsCone
— MethodMohrsCone(::Type{FT}, args...)
A float type FT can be provided as the first argument of any MohrsCone constructor. A MohrsCone of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.MonteCarloPointsGenerator
— TypeMonteCarloPointsGenerator
Subtype of AbstractSubFloePointsGenerator that defines parameters needed to generate a set of random monte carlo points within a given floe. npoints
is the number of monte carlo points to generate within the floe's bounding box - the floe will not end up with this many points as all points outside of the floe will be removed. ntries
is the number of tries to generate a set of points within the floe that have a smaller error than err
.
sourceSubzero.MonteCarloPointsGenerator
— MethodMonteCarloPointsGenerator(; kwargs...)
If type isn't specified, MonteCarloPointsGenerator(; kwargs...) will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MonteCarloPointsGenerator
— MethodMonteCarloPointsGenerator(::Type{FT}; kwargs...)
A float type FT can be provided as the first argument of any MonteCarloPointsGenerator constructor. A MonteCarloPointsGenerato of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.MovingBoundary
— TypeMovingBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that creates a floe along the boundary that moves towards the center of the domain at the given velocity, compressing the ice within the domain. This subtype is a mutable struct so that the coordinates and val can be changed as the boundary moves. The u and v velocities are in [m/s].
Note that with a u-velocity, east and west walls move towards the center of the domain, providing compressive stress, and with a v-velocity, the bounday creates a shear stress by incorporating the velocity into friction calculations but doesn't actually move. This means that the boundaries cannot move at an angle, distorting the shape of the domain regardless the the combination of u and v velocities. The same, but opposite is true for the north and south walls.
sourceSubzero.MovingBoundary
— MethodMovingBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any MovingBoundary constructor. The second argument D is the directional type of the boundary. A MovingBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.MovingBoundary
— MethodMovingBoundary(::Type{D}, args...)
If a float type isn't specified, MovingBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MovingBoundary
— MethodMovingBoundary{D, FT}(grid, velocity)
Creates compression boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid u <AbstractFloat> u velocity of boundary v <AbstractFloat> v velocity of boundary Outputs: MovingBoundary on edge of grid given by direction.
sourceSubzero.NoFracture
— TypeNoFracture<:AbstractFractureCriteria
Simple AbstractFractureCriteria type representing when fracturing functionality is turned off. If this is the type provided to the simulation's FractureSettings then fractures will not occur.
sourceSubzero.North
— TypeNorth<:AbstractDirection
A simple direction type representing if a boundary is the northern boundary in a rectangular domain.
sourceSubzero.Ocean
— TypeOcean{FT<:AbstractFloat}
Simulation ocean holding ocean values on the grid-scale with matricies of the same size as the model's grid. The struct has the following fields:
- u is the ocean velocities in the x-direction for each grid cell
- v is the ocean velocities in the y-direction for each grid cell
- temp is the ocean temperature for each grid cell
- hflx_factor is a factor to calculate the ocean-atmosphere heat flux for a cell in that grid cell by multiplying by its height
- si_frac is the fraction of area in each grid cell that is covered in sea-ice
Ocean fields must all be matricies with dimensions equal to the number of grid lines in the model's grid. Note: If a periodic boundary is used in the domain, the last grid cell in that direction will not be used as it is equivalent to the first grid cell. Thus, for all of these fields, the first and last value in the x and/or y direction should be equal if the east-west or north-south boundary pair are periodic respectively.
sourceSubzero.Ocean
— MethodOcean(args...)
If a type isn't specified, Ocean will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Ocean
— MethodOcean{FT}(grid, u, v, temp)
Construct model's ocean. Inputs: grid <AbstractGrid> model grid u <Real> ocean x-velocity for each grid line v <Real> ocean y-velocity for each grid line temp <Real> temperature at ocean/ice interface per grid cell Output: Ocean with constant velocity and temperature on each grid line.
sourceSubzero.Ocean
— MethodOcean{FT}(u, v, temp)
Construct model ocean. Inputs: u <Matrix> ocean x-velocity matrix with u for each grid line v <Matrix> ocean y-velocity matrix with u for each grid line temp <Matrix> temperature matrix with ocean/ice interface temperature for each grid line Output: Model ocean with given velocity and temperature fields on each grid line.
sourceSubzero.Ocean
— MethodOcean(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Ocean constructor. An Ocean of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.OpenBoundary
— TypeOpenBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that allows a floe to pass out of the domain edge without any effects on the floe.
sourceSubzero.OpenBoundary
— MethodOpenBoundary{D, FT}(grid)
Creates open boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid Outputs: Open Boundary on edge of grid given by direction and type.
sourceSubzero.OpenBoundary
— MethodOpenBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any OpenBoundary constructor. The second argument D is the directional type of the boundary. An OpenBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.OpenBoundary
— MethodOpenBoundary(::Type{D}, args...)
If a float type isn't specified, OpenBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.OutputWriters
— TypeOutputWriters{FT<:AbstractFloat}
Structure to hold all types of output writers a user might want. All fields are vectors so that more than one of each type of output writer can be defined, and so that a default OutputWriter object doesn't create default output writer fields, which would create files, but rather empty lists of output writers. If any of the fields is not provided, the default is just an empty list.
sourceSubzero.PeriodicBoundary
— TypePeriodicBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that moves a floe from one side of the domain to the opposite side of the domain when it crosses the boundary, bringing the floe back into the domain.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary{D, FT}(grid)
Creates periodic boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid Outputs: Periodic Boundary on edge of grid given by direction and type.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any PeriodicBoundary constructor. The second argument D is the directional type of the boundary. A PeriodicBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary(::Type{D}, args...)
If a float type isn't specified, PeriodicBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.PolyVec
— TypeCoordinates are vector of vector of vector of points of the form: [[[x1, y1], [x2, y2], ..., [xn, yn], [x1, y1]], [[w1, z1], [w2, z2], ..., [wn, zn], [w1, z1]], ...] where the xy coordinates are the exterior border of the floe and the wz coordinates, or any other following sets of coordinates, describe holes within the floe. This form is for easy conversion to polygons.
sourceSubzero.RegRectilinearGrid
— TypeRegRectilinearGrid{FT<:AbstractFloat}<:AbstractGrid
Tessellation of 2-dimensional Euclidean space into n-by-m congruent rectangles.
- Nx: number of grid cells in the x-direction
- Ny: number of grid cells in the y-direction
- x0: value of first x grid line
- xf: value of final x grid line
- y0: value of first y grid line
- yf: value of final y grid line
- Δx: grid cell width
- Δy: grid cell height
- floe_locations: matrix of CellFloes, which keep track of which floes are in each cell
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid(args...)
If a type isn't specified, RegRectilinearGrid will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid{FT}(
+)
Creates an initial state output writer. Inputs: dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists jld2_kw list of JLD2 keywords for the jldopen function Outputs: Creates InitialStateOutputWriter that will write simulation's initial state.
sourceSubzero.InteractionFields
— TypeEnum to index into floe interactions field with more intuituve names
sourceSubzero.Model
— TypeModel which holds grid, ocean, atmos structs, each with the same underlying float type (either Float32 of Float64) and size. It also holds the domain information, which includes the topography and the boundaries. It holds a StructArray of floe structs, again each relying on the same underlying float type. Finally, it also holds the maximum floe id used thus far in the simulation. This should be the length of the floes array at the beginning of the run.
sourceSubzero.MohrsCone
— TypeMohrsCone{FT<:AbstractFloat}<:AbstractFractureCriteria
Type of AbstractFractureCriteria that creates a cone in principal stress space that determines if a floe fractures based off if its stress in principal stress space is inside or outside of the cone. Fields: verticies <PolyVec> vertices of criteria in principal stress space Note: Concepts from the following papter - Weiss, Jérôme, and Erland M. Schulson. "Coulombic faulting from the grain scale to the geophysical scale: lessons from ice." Journal of Physics D: Applied Physics 42.21 (2009): 214017.
sourceSubzero.MohrsCone
— MethodMohrsCone(args...)
If a type isn't specified, MohrsCone will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MohrsCone
— MethodMohrsCone{FT}(val::AbstractFloat, args...)
Calculate Mohr's Cone vertices given calculatemohrs arguments.
sourceSubzero.MohrsCone
— MethodMohrsCone(::Type{FT}, args...)
A float type FT can be provided as the first argument of any MohrsCone constructor. A MohrsCone of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.MonteCarloPointsGenerator
— TypeMonteCarloPointsGenerator
Subtype of AbstractSubFloePointsGenerator that defines parameters needed to generate a set of random monte carlo points within a given floe. npoints
is the number of monte carlo points to generate within the floe's bounding box - the floe will not end up with this many points as all points outside of the floe will be removed. ntries
is the number of tries to generate a set of points within the floe that have a smaller error than err
.
sourceSubzero.MonteCarloPointsGenerator
— MethodMonteCarloPointsGenerator(; kwargs...)
If type isn't specified, MonteCarloPointsGenerator(; kwargs...) will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MonteCarloPointsGenerator
— MethodMonteCarloPointsGenerator(::Type{FT}; kwargs...)
A float type FT can be provided as the first argument of any MonteCarloPointsGenerator constructor. A MonteCarloPointsGenerato of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.MovingBoundary
— TypeMovingBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that creates a floe along the boundary that moves towards the center of the domain at the given velocity, compressing the ice within the domain. This subtype is a mutable struct so that the coordinates and val can be changed as the boundary moves. The u and v velocities are in [m/s].
Note that with a u-velocity, east and west walls move towards the center of the domain, providing compressive stress, and with a v-velocity, the bounday creates a shear stress by incorporating the velocity into friction calculations but doesn't actually move. This means that the boundaries cannot move at an angle, distorting the shape of the domain regardless the the combination of u and v velocities. The same, but opposite is true for the north and south walls.
sourceSubzero.MovingBoundary
— MethodMovingBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any MovingBoundary constructor. The second argument D is the directional type of the boundary. A MovingBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.MovingBoundary
— MethodMovingBoundary(::Type{D}, args...)
If a float type isn't specified, MovingBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.MovingBoundary
— MethodMovingBoundary{D, FT}(grid, velocity)
Creates compression boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid u <AbstractFloat> u velocity of boundary v <AbstractFloat> v velocity of boundary Outputs: MovingBoundary on edge of grid given by direction.
sourceSubzero.NoFracture
— TypeNoFracture<:AbstractFractureCriteria
Simple AbstractFractureCriteria type representing when fracturing functionality is turned off. If this is the type provided to the simulation's FractureSettings then fractures will not occur.
sourceSubzero.North
— TypeNorth<:AbstractDirection
A simple direction type representing if a boundary is the northern boundary in a rectangular domain.
sourceSubzero.Ocean
— TypeOcean{FT<:AbstractFloat}
Simulation ocean holding ocean values on the grid-scale with matricies of the same size as the model's grid. The struct has the following fields:
- u is the ocean velocities in the x-direction for each grid cell
- v is the ocean velocities in the y-direction for each grid cell
- temp is the ocean temperature for each grid cell
- hflx_factor is a factor to calculate the ocean-atmosphere heat flux for a cell in that grid cell by multiplying by its height
- si_frac is the fraction of area in each grid cell that is covered in sea-ice
Ocean fields must all be matricies with dimensions equal to the number of grid lines in the model's grid. Note: If a periodic boundary is used in the domain, the last grid cell in that direction will not be used as it is equivalent to the first grid cell. Thus, for all of these fields, the first and last value in the x and/or y direction should be equal if the east-west or north-south boundary pair are periodic respectively.
sourceSubzero.Ocean
— MethodOcean(args...)
If a type isn't specified, Ocean will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.Ocean
— MethodOcean{FT}(grid, u, v, temp)
Construct model's ocean. Inputs: grid <AbstractGrid> model grid u <Real> ocean x-velocity for each grid line v <Real> ocean y-velocity for each grid line temp <Real> temperature at ocean/ice interface per grid cell Output: Ocean with constant velocity and temperature on each grid line.
sourceSubzero.Ocean
— MethodOcean{FT}(u, v, temp)
Construct model ocean. Inputs: u <Matrix> ocean x-velocity matrix with u for each grid line v <Matrix> ocean y-velocity matrix with u for each grid line temp <Matrix> temperature matrix with ocean/ice interface temperature for each grid line Output: Model ocean with given velocity and temperature fields on each grid line.
sourceSubzero.Ocean
— MethodOcean(::Type{FT}, args...)
A float type FT can be provided as the first argument of any Ocean constructor. An Ocean of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.OpenBoundary
— TypeOpenBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that allows a floe to pass out of the domain edge without any effects on the floe.
sourceSubzero.OpenBoundary
— MethodOpenBoundary{D, FT}(grid)
Creates open boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid Outputs: Open Boundary on edge of grid given by direction and type.
sourceSubzero.OpenBoundary
— MethodOpenBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any OpenBoundary constructor. The second argument D is the directional type of the boundary. An OpenBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.OpenBoundary
— MethodOpenBoundary(::Type{D}, args...)
If a float type isn't specified, OpenBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.OutputWriters
— TypeOutputWriters{FT<:AbstractFloat}
Structure to hold all types of output writers a user might want. All fields are vectors so that more than one of each type of output writer can be defined, and so that a default OutputWriter object doesn't create default output writer fields, which would create files, but rather empty lists of output writers. If any of the fields is not provided, the default is just an empty list.
sourceSubzero.PeriodicBoundary
— TypePeriodicBoundary <: AbstractBoundary
A sub-type of AbstractBoundary that moves a floe from one side of the domain to the opposite side of the domain when it crosses the boundary, bringing the floe back into the domain.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary{D, FT}(grid)
Creates periodic boundary on the edge of the grid, and with the direction as a type. Edge is determined by direction. Inputs: grid <AbstractGrid> model grid Outputs: Periodic Boundary on edge of grid given by direction and type.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary(::Type{FT}, ::Type{D}, args...)
A float type FT can be provided as the first argument of any PeriodicBoundary constructor. The second argument D is the directional type of the boundary. A PeriodicBoundary of type FT and D will be created by passing all other arguments to the correct constructor.
sourceSubzero.PeriodicBoundary
— MethodPeriodicBoundary(::Type{D}, args...)
If a float type isn't specified, PeriodicBoundary will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.PolyVec
— TypeCoordinates are vector of vector of vector of points of the form: [[[x1, y1], [x2, y2], ..., [xn, yn], [x1, y1]], [[w1, z1], [w2, z2], ..., [wn, zn], [w1, z1]], ...] where the xy coordinates are the exterior border of the floe and the wz coordinates, or any other following sets of coordinates, describe holes within the floe. This form is for easy conversion to polygons.
sourceSubzero.RegRectilinearGrid
— TypeRegRectilinearGrid{FT<:AbstractFloat}<:AbstractGrid
Tessellation of 2-dimensional Euclidean space into n-by-m congruent rectangles.
- Nx: number of grid cells in the x-direction
- Ny: number of grid cells in the y-direction
- x0: value of first x grid line
- xf: value of final x grid line
- y0: value of first y grid line
- yf: value of final y grid line
- Δx: grid cell width
- Δy: grid cell height
- floe_locations: matrix of CellFloes, which keep track of which floes are in each cell
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid(args...)
If a type isn't specified, RegRectilinearGrid will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid{FT}(
Nx,
Ny,
xbounds::Tuple{Real, Real},
ybounds::Tuple{Real, Real},
-) where {FT <: AbstractFloat}
Construct a RegRectilinearGrid for model given bounds for grid x and y and the number of grid cells in both the x and y direction. Inputs: Nx <Int> number of grid cells in the x-direction Ny <Int> number of grid cells in the y-direction xbounds <Tuple{Real, Real}> bound of grid x-direction in form (left, right) ybounds <Tuple{Real, Real}> bound of grid y-direction in form (bottom, top) Output: RegRectilinearGrid with width and height determined by xbound and ybounds and the number of grid cells in the x-direction and y-direction determined by dims.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid{FT}(
+) where {FT <: AbstractFloat}
Construct a RegRectilinearGrid for model given bounds for grid x and y and the number of grid cells in both the x and y direction. Inputs: Nx <Int> number of grid cells in the x-direction Ny <Int> number of grid cells in the y-direction xbounds <Tuple{Real, Real}> bound of grid x-direction in form (left, right) ybounds <Tuple{Real, Real}> bound of grid y-direction in form (bottom, top) Output: RegRectilinearGrid with width and height determined by xbound and ybounds and the number of grid cells in the x-direction and y-direction determined by dims.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid{FT}(
xbounds::Tuple,
ybounds::Tuple,
Δx,
Δy,
-)
Construct a RegRectilinearGrid for model given bounds for grid x and y and grid cell dimensions in meters. Inputs: xbounds <Tuple{Real, Real}> bound of grid x-direction in form (left, right) ybounds <Tuple{Real, Real}> bound of grid y-direction in form (bottom, top) Δx <Real> length/height of grid cells in x-direction Δy <Real> length/height of grid cells in y-direction Output: RegRectilinearGrid from lx to ux and height from ly to uy with grid squares of size Δx by Δy Warning: If Δx doesn't evenly divide x length (lu-lx) or Δy doesn't evenly divide y length (uy-ly) you won't get full size grid. The grid will be "trimmed" to the nearest full grid square in both directions.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid(::Type{FT}, args...)
A float type FT can be provided as the first argument of any RegRectilinearGrid constructor. A RegRectilinearGrid of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.RidgeRaftSettings
— TypeRidgeRaftSettings{FT <: AbstractFloat}
Settings needed for ridging and rafting within the model. The fields have the following meanings:
- ridgerafton: a boolean flag for if ridging and rafting should be turned on in the simulation
- Δt: multiple of timesteps during which ridging and rafting code will run
- ridge_probability: the probability a floe ridges with another floe/domain if it meets all other criteria
- raft_probability: the probability a floe rafts with another floe/domain if it meets all other criteria
- minoverlapfrac: the minimum overlap area fraction between a floe and another floe/domain for that floe to ridge or raft
- minridgeheight: the minimum floe height to ridge with a floe/domain
- maxfloeridge_height: the maximum floe height to ridge with another floe
- maxdomainrdige_height: maximum floe height to ridge with a domain element
- maxfloeraft_height: maximum floe height to raft with another floe
- maxdomainraft_height: maximum floe height to raft with a domain element
- domaingainprobability: the probalility that a floe that rafts with a domain element keeps all of its mass (0) or if that mass is removed and lost to the domain element (1).
sourceSubzero.RidgeRaftSettings
— MethodRidgeRaftSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any RidgeRaftSettings constructor. A RidgeRaftSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.RingVec
— TypeCoordinates are vector of vector of points of the form: [[x1, y1], [x2, y2], ..., [xn, yn], [x1, y1]] where the xy coordinates form a closed ring. PolyVec objects can be made out RingVec objects. This form is for each conversion to LinearRings, which can also be made into Polygons.
sourceSubzero.SimplificationSettings
— Typestruct SimplificationSettings{FT<:AbstractFloat}
If smoothverticeson is true then floe's with more vertices than maxvertices will be simplified every Δtsmooth timesteps. The tolerance is the Douglas–Peucker algorithm tolerance in (m).
sourceSubzero.SimplificationSettings
— MethodSimplificationSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any SimplificationSettings constructor. A SimplificationSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.Simulation
— TypeSimulation{FT<:AbstractFloat, DT<:Domain{FT}}
Simulation which holds a model and parameters needed for running the simulation. This includes physical constants (consts), a random number generator (rng), the number of seconds in a timestep (Δt), and the number of timesteps to run (nΔt). We also have a flag for verbose, which will print out the number of timesteps every 50 timesteps and a simulation name, which can be used when saving files. The user can also define settings for each physical process.
sourceSubzero.South
— TypeSouth<:AbstractDirection
A simple direction type representing if a boundary is the southern boundary in a rectangular domain.
sourceSubzero.StatusTag
— TypeEnum for differnt floe status
sourceSubzero.SubGridPointsGenerator
— TypeSubGridPointsGenerator
Subtype of AbstractSubFloePointsGenerator that defines parameters needed to generate a set of points on a "subgrid" within the floe where the subgrid is a regular rectilinar grid with cells of size Δg
in both width and height. If two-way coupling, Δg
should be smaller than the grid's Δx and Δy so that there is at least one point in each grid cell that the floe occupies.
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator(; kwargs...)
If type isn't specified, SubGridPointsGenerator(; kwargs...) will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator{FT}(grid, npoint_per_cell)
SubGridPointsGenerator constructor that uses the simulation grid and the desired number of sub-floe points per simulation grid cell to determine the correct value of Δg Inputs: grid <RegRectilinearGrid> simulation's grid npointpercell <Int> number of points per grid cell, where the grid is redefined to have width and height equal to the minimum of Δx and Δy Output: SubGridPointsGenerator with Δg defined to be the minimum of Δx and Δy over the number of desired points per grid cell
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator(::Type{FT}; kwargs...)
A float type FT can be provided as the first argument of any SubGridPointsGenerator constructor. A SubGridPointsGenerator of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger(sim; messages_per_tstep = 1)
Created Subzero logger and writes log events to log file in current directory to file with the same name as the simulation's name field. Inputs: sim <Simulation> messagespertstep <Int> maximum number of times a given message should be written per timestep Outputs: Subzero logger that saves log to file with the same name as the simulation's name field and optional keyword arguments set.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger(sim, messages_per_tstep = 1)
Constructor from Subzero logger. Inputs: filename <String> file path to file to write log events into messagespertstep <Int> maximum number of times a given message should be written per timestep Outputs: Subzero logger that saves log to file with the same name as the simulation's name field and optional keyword arguments set.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger
Logger for Subzero. Logs unique messages messages_per_tstep
times per timestep to prevent overwhelming number of messages timesteps from multiple floes triggering the same log event. Fields:
- stream: ogs are written to this IO
- min_level: minimum log event level to write
- message_limits: dictionary with message IDs for key whose values are the number of times that message can still be written in current timestep - current timestep is stored in same dictionary under key 'tstep'
- messagespertstep: maximum number of times a given message should be written per timestep
sourceSubzero.TopographyElement
— TypeTopographyElement{FT}<:AbstractDomainElement{FT}
Singular topographic element with coordinates field storing where the element is within the grid. These are used to create the desired topography within the simulation and will be treated as islands or coastline within the model in that they will not move or break due to floe interactions, but they will affect floes.
sourceSubzero.TopographyElement
— MethodTopographyElement(args...)
If a type isn't specified, TopographyElement will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.TopographyElement
— MethodTopographyElement{FT}(coords)
Constructor for topographic element with PolyVec coordinates Inputs: coords <PolyVec> Output: Topographic element of abstract float type FT
sourceSubzero.TopographyElement
— MethodTopographyElement(::Type{FT}, args...)
A float type FT can be provided as the first argument of any TopographyElement constructor. A TopographyElement of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.TopographyElement
— MethodTopographyElement{FT}(poly)
Constructor for topographic element with Polygon Inputs: poly <Polygon> Output: Topographic element of abstract float type FT
sourceSubzero.WeldSettings
— TypeWeldSettings{FT<:AbstractFloat}
Settings needed for welding within the model. The fields have the following meanings:
- weld_on: a boolean flag for if welding should be turned on in the simulation
- Δts: a list of multiples of timesteps during which welding code will run, welding will be run at multiples of all elements, each with domain split into corresponding Nx and Ny values
- Nxs: a list of number of x-directional bins to split the domain into at corresponding timesteps
- Nys: a list of number of x-directional bins to split the domain into at corresponding timesteps
- minweldarea: minimum area a weld can create for two floes to weld
- maxweldarea: maximum area a weld can create for two floes to weld
- weldingcoeff: non-dimensional parameter, multiplied by ratio of overlap between two floes to original floe area to determin probability that a floe will merge. The larger this is, the more likely floes are to weld. Probability with 5% overlap is `weldingcoeff * (0.05) > rand()`
sourceSubzero.WeldSettings
— MethodWeldSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any WeldSettings constructor. A WeldSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.West
— TypeWest<:AbstractDirection
A simple direction type representing if a boundary is the western boundary in a rectangular domain.
sourceBase.::
— MethodCreate a range of interactions field columns with InteractionFields enum objects
sourceBase.empty!
— Methodempty!(cell::CellFloes)
Empties the vectors within a CellFloes object
sourceBase.empty!
— Methodempty!(cell::IceStressCell)
Empties the vectors within an IceStressCell
sourceBase.to_index
— MethodIndex into interactions field with InteractionFields enum objects
sourceLogging.handle_message
— Methodhandle_message(
+)
Construct a RegRectilinearGrid for model given bounds for grid x and y and grid cell dimensions in meters. Inputs: xbounds <Tuple{Real, Real}> bound of grid x-direction in form (left, right) ybounds <Tuple{Real, Real}> bound of grid y-direction in form (bottom, top) Δx <Real> length/height of grid cells in x-direction Δy <Real> length/height of grid cells in y-direction Output: RegRectilinearGrid from lx to ux and height from ly to uy with grid squares of size Δx by Δy Warning: If Δx doesn't evenly divide x length (lu-lx) or Δy doesn't evenly divide y length (uy-ly) you won't get full size grid. The grid will be "trimmed" to the nearest full grid square in both directions.
sourceSubzero.RegRectilinearGrid
— MethodRegRectilinearGrid(::Type{FT}, args...)
A float type FT can be provided as the first argument of any RegRectilinearGrid constructor. A RegRectilinearGrid of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.RidgeRaftSettings
— TypeRidgeRaftSettings{FT <: AbstractFloat}
Settings needed for ridging and rafting within the model. The fields have the following meanings:
- ridgerafton: a boolean flag for if ridging and rafting should be turned on in the simulation
- Δt: multiple of timesteps during which ridging and rafting code will run
- ridge_probability: the probability a floe ridges with another floe/domain if it meets all other criteria
- raft_probability: the probability a floe rafts with another floe/domain if it meets all other criteria
- minoverlapfrac: the minimum overlap area fraction between a floe and another floe/domain for that floe to ridge or raft
- minridgeheight: the minimum floe height to ridge with a floe/domain
- maxfloeridge_height: the maximum floe height to ridge with another floe
- maxdomainrdige_height: maximum floe height to ridge with a domain element
- maxfloeraft_height: maximum floe height to raft with another floe
- maxdomainraft_height: maximum floe height to raft with a domain element
- domaingainprobability: the probalility that a floe that rafts with a domain element keeps all of its mass (0) or if that mass is removed and lost to the domain element (1).
sourceSubzero.RidgeRaftSettings
— MethodRidgeRaftSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any RidgeRaftSettings constructor. A RidgeRaftSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.RingVec
— TypeCoordinates are vector of vector of points of the form: [[x1, y1], [x2, y2], ..., [xn, yn], [x1, y1]] where the xy coordinates form a closed ring. PolyVec objects can be made out RingVec objects. This form is for each conversion to LinearRings, which can also be made into Polygons.
sourceSubzero.SimplificationSettings
— Typestruct SimplificationSettings{FT<:AbstractFloat}
If smoothverticeson is true then floe's with more vertices than maxvertices will be simplified every Δtsmooth timesteps. The tolerance is the Douglas–Peucker algorithm tolerance in (m).
sourceSubzero.SimplificationSettings
— MethodSimplificationSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any SimplificationSettings constructor. A SimplificationSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.Simulation
— TypeSimulation{FT<:AbstractFloat, DT<:Domain{FT}}
Simulation which holds a model and parameters needed for running the simulation. This includes physical constants (consts), a random number generator (rng), the number of seconds in a timestep (Δt), and the number of timesteps to run (nΔt). We also have a flag for verbose, which will print out the number of timesteps every 50 timesteps and a simulation name, which can be used when saving files. The user can also define settings for each physical process.
sourceSubzero.South
— TypeSouth<:AbstractDirection
A simple direction type representing if a boundary is the southern boundary in a rectangular domain.
sourceSubzero.StatusTag
— TypeEnum for differnt floe status
sourceSubzero.SubGridPointsGenerator
— TypeSubGridPointsGenerator
Subtype of AbstractSubFloePointsGenerator that defines parameters needed to generate a set of points on a "subgrid" within the floe where the subgrid is a regular rectilinar grid with cells of size Δg
in both width and height. If two-way coupling, Δg
should be smaller than the grid's Δx and Δy so that there is at least one point in each grid cell that the floe occupies.
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator(; kwargs...)
If type isn't specified, SubGridPointsGenerator(; kwargs...) will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator{FT}(grid, npoint_per_cell)
SubGridPointsGenerator constructor that uses the simulation grid and the desired number of sub-floe points per simulation grid cell to determine the correct value of Δg Inputs: grid <RegRectilinearGrid> simulation's grid npointpercell <Int> number of points per grid cell, where the grid is redefined to have width and height equal to the minimum of Δx and Δy Output: SubGridPointsGenerator with Δg defined to be the minimum of Δx and Δy over the number of desired points per grid cell
sourceSubzero.SubGridPointsGenerator
— MethodSubGridPointsGenerator(::Type{FT}; kwargs...)
A float type FT can be provided as the first argument of any SubGridPointsGenerator constructor. A SubGridPointsGenerator of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger(sim; messages_per_tstep = 1)
Created Subzero logger and writes log events to log file in current directory to file with the same name as the simulation's name field. Inputs: sim <Simulation> messagespertstep <Int> maximum number of times a given message should be written per timestep Outputs: Subzero logger that saves log to file with the same name as the simulation's name field and optional keyword arguments set.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger(sim, messages_per_tstep = 1)
Constructor from Subzero logger. Inputs: filename <String> file path to file to write log events into messagespertstep <Int> maximum number of times a given message should be written per timestep Outputs: Subzero logger that saves log to file with the same name as the simulation's name field and optional keyword arguments set.
sourceSubzero.SubzeroLogger
— TypeSubzeroLogger
Logger for Subzero. Logs unique messages messages_per_tstep
times per timestep to prevent overwhelming number of messages timesteps from multiple floes triggering the same log event. Fields:
- stream: ogs are written to this IO
- min_level: minimum log event level to write
- message_limits: dictionary with message IDs for key whose values are the number of times that message can still be written in current timestep - current timestep is stored in same dictionary under key 'tstep'
- messagespertstep: maximum number of times a given message should be written per timestep
sourceSubzero.TopographyElement
— TypeTopographyElement{FT}<:AbstractDomainElement{FT}
Singular topographic element with coordinates field storing where the element is within the grid. These are used to create the desired topography within the simulation and will be treated as islands or coastline within the model in that they will not move or break due to floe interactions, but they will affect floes.
sourceSubzero.TopographyElement
— MethodTopographyElement(args...)
If a type isn't specified, TopographyElement will be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.TopographyElement
— MethodTopographyElement{FT}(coords)
Constructor for topographic element with PolyVec coordinates Inputs: coords <PolyVec> Output: Topographic element of abstract float type FT
sourceSubzero.TopographyElement
— MethodTopographyElement(::Type{FT}, args...)
A float type FT can be provided as the first argument of any TopographyElement constructor. A TopographyElement of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.TopographyElement
— MethodTopographyElement{FT}(poly)
Constructor for topographic element with Polygon Inputs: poly <Polygon> Output: Topographic element of abstract float type FT
sourceSubzero.WeldSettings
— TypeWeldSettings{FT<:AbstractFloat}
Settings needed for welding within the model. The fields have the following meanings:
- weld_on: a boolean flag for if welding should be turned on in the simulation
- Δts: a list of multiples of timesteps during which welding code will run, welding will be run at multiples of all elements, each with domain split into corresponding Nx and Ny values
- Nxs: a list of number of x-directional bins to split the domain into at corresponding timesteps
- Nys: a list of number of x-directional bins to split the domain into at corresponding timesteps
- minweldarea: minimum area a weld can create for two floes to weld
- maxweldarea: maximum area a weld can create for two floes to weld
- weldingcoeff: non-dimensional parameter, multiplied by ratio of overlap between two floes to original floe area to determin probability that a floe will merge. The larger this is, the more likely floes are to weld. Probability with 5% overlap is `weldingcoeff * (0.05) > rand()`
sourceSubzero.WeldSettings
— MethodWeldSettings(::Type{FT}, kwargs...)
A float type FT can be provided as the first argument of any WeldSettings constructor. A WeldSettings of type FT will be created by passing all other arguments to the correct constructor.
sourceSubzero.West
— TypeWest<:AbstractDirection
A simple direction type representing if a boundary is the western boundary in a rectangular domain.
sourceBase.::
— MethodCreate a range of interactions field columns with InteractionFields enum objects
sourceBase.empty!
— Methodempty!(cell::CellFloes)
Empties the vectors within a CellFloes object
sourceBase.empty!
— Methodempty!(cell::IceStressCell)
Empties the vectors within an IceStressCell
sourceBase.to_index
— MethodIndex into interactions field with InteractionFields enum objects
sourceLogging.handle_message
— Methodhandle_message(
logger::SubzeroLogger,
level,
message,
@@ -54,7 +56,7 @@
line;
tstep = nothing,
kwargs...,
-)
Function that determines if log event should be written to file depending on how many times that event has been written to file in current timestep.
Note: This is called when a log macro is called (e.g. @warn), not explicitly by the user. Additionally, it is not threadsafe so a message may be written more times than messages_per_tstep
, but it should be in the ballpark. Putting a lock would slow down logging and isn't worth it given that this problem only records a few extra log events.
sourceSubzero._calculate_hibler
— Method_calculate_hibler(FT, floes, pstar, c)
Calculate Hibler's Elliptical Yield Curve as described in his 1979 paper "A Dynamic Thermodynamic Sea Ice Model". Inputs: floes <StructArray{Floes}> model's list of floes pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing Outputs: vertices <PolyVec{AbstractFloat}> vertices of elliptical yield curve Note: Hibler's paper says that: Both pstar and c relate the ice strength to the ice thickness and compactness. c is determined to that 10% open water reduces the strength substantially and pstar is considered a free parameter.
sourceSubzero._calculate_mohrs
— Method_calculate_mohrs(FT, σ1, σ2, σ11, σ22)
Creates PolyVec from vertex values for Mohr's Cone (triangle in 2D) Inputs: σ1 <AbstractFloat> x-coordiante of first point in cone σ2 <AbstractFloat> y-coordiante of first point in cone σ11 <AbstractFloat> x-coordinate of one vertex of cone and negative of the y-coordinate of adjacend vertex in principal stress space σ22 <AbstractFloat> y-coordinate of one vertex of cone and negative of the x-coordinate of adjacend vertex in principal stress space Output: Mohr's Cone vertices (triangle since we are in 2D) in principal stress space
sourceSubzero._calculate_mohrs
— Method_calculate_mohrs(
+)
Function that determines if log event should be written to file depending on how many times that event has been written to file in current timestep.
Note: This is called when a log macro is called (e.g. @warn), not explicitly by the user. Additionally, it is not threadsafe so a message may be written more times than messages_per_tstep
, but it should be in the ballpark. Putting a lock would slow down logging and isn't worth it given that this problem only records a few extra log events.
sourceSubzero._calculate_hibler
— Method_calculate_hibler(FT, floes, pstar, c)
Calculate Hibler's Elliptical Yield Curve as described in his 1979 paper "A Dynamic Thermodynamic Sea Ice Model". Inputs: floes <StructArray{Floes}> model's list of floes pstar <AbstractFloat> used to tune ellipse for optimal fracturing c <AbstractFloat> used to tune ellipse for optimal fracturing Outputs: vertices <PolyVec{AbstractFloat}> vertices of elliptical yield curve Note: Hibler's paper says that: Both pstar and c relate the ice strength to the ice thickness and compactness. c is determined to that 10% open water reduces the strength substantially and pstar is considered a free parameter.
sourceSubzero._calculate_mohrs
— Method_calculate_mohrs(FT, σ1, σ2, σ11, σ22)
Creates PolyVec from vertex values for Mohr's Cone (triangle in 2D) Inputs: σ1 <AbstractFloat> x-coordiante of first point in cone σ2 <AbstractFloat> y-coordiante of first point in cone σ11 <AbstractFloat> x-coordinate of one vertex of cone and negative of the y-coordinate of adjacend vertex in principal stress space σ22 <AbstractFloat> y-coordinate of one vertex of cone and negative of the x-coordinate of adjacend vertex in principal stress space Output: Mohr's Cone vertices (triangle since we are in 2D) in principal stress space
sourceSubzero._calculate_mohrs
— Method_calculate_mohrs(
FT,
q,
σc,
@@ -62,7 +64,7 @@
σ1 = nothing,
σ2 = nothing,
σ22 = nothing,
-)
Calculate Mohr's Cone coordinates in principal stress space. Inputs: q <AbstractFloat> based on the coefficient of internal friction (µi) by ((μi^2 + 1)^(1/2) + μi^2 σc <AbstractFloat> uniaxial compressive strength σ11 <AbstractFloat> negative of the x-coordinate of one vertex of cone (triangle in 2D) and negative of the y-coordinate of adjacend vertex in principal stress space Outputs: Mohr's Cone vertices (triangle since we are in 2D) in principal stress space Note: Concepts from the following papter - Weiss, Jérôme, and Erland M. Schulson. "Coulombic faulting from the grain scale to the geophysical scale: lessons from ice." Journal of Physics D: Applied Physics 42.21 (2009): 214017. Equations taken from original version of Subzero written in MATLAB
sourceSubzero._initialize_floe_field
— Method_initialize_floe_field(
+)
Calculate Mohr's Cone coordinates in principal stress space. Inputs: q <AbstractFloat> based on the coefficient of internal friction (µi) by ((μi^2 + 1)^(1/2) + μi^2 σc <AbstractFloat> uniaxial compressive strength σ11 <AbstractFloat> negative of the x-coordinate of one vertex of cone (triangle in 2D) and negative of the y-coordinate of adjacend vertex in principal stress space Outputs: Mohr's Cone vertices (triangle since we are in 2D) in principal stress space Note: Concepts from the following papter - Weiss, Jérôme, and Erland M. Schulson. "Coulombic faulting from the grain scale to the geophysical scale: lessons from ice." Journal of Physics D: Applied Physics 42.21 (2009): 214017. Equations taken from original version of Subzero written in MATLAB
sourceSubzero._initialize_floe_field
— Method_initialize_floe_field(
::Type{FT},
nfloes,
concentrations,
@@ -71,7 +73,7 @@
Δh;
floe_settings,
rng,
-)
Create a field of floes using Voronoi Tesselation. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type nfloes <Int> number of floes to try to create - note you might not end up with this number of floes - topography in domain and multiple concentrations can decrease number of floes created concentrations <Matrix> matrix of concentrations to fill domain. If size(concentrations) = N, M then split the domain into NxM cells, each to be filled with the corresponding concentration. If concentration is below 0, it will default to 0. If it is above 1, it will default to 1 domain <Domain> model domain hmean <Float> average floe height Δh <Float> height range - floes will range in height from hmean - Δh to hmean + Δh floebounds <PolyVec> coordinates of boundary within which to populate floes. This can be smaller that the domain, but will be limited to open space within the domain floesettings <FloeSettings> settings needed to initialize floes rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ Output: floe_arr <StructArray> list of floes created using Voronoi Tesselation of the domain with given concentrations.
sourceSubzero._initialize_floe_field
— Method_initialize_floe_field(
+)
Create a field of floes using Voronoi Tesselation. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type nfloes <Int> number of floes to try to create - note you might not end up with this number of floes - topography in domain and multiple concentrations can decrease number of floes created concentrations <Matrix> matrix of concentrations to fill domain. If size(concentrations) = N, M then split the domain into NxM cells, each to be filled with the corresponding concentration. If concentration is below 0, it will default to 0. If it is above 1, it will default to 1 domain <Domain> model domain hmean <Float> average floe height Δh <Float> height range - floes will range in height from hmean - Δh to hmean + Δh floebounds <PolyVec> coordinates of boundary within which to populate floes. This can be smaller that the domain, but will be limited to open space within the domain floesettings <FloeSettings> settings needed to initialize floes rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ Output: floe_arr <StructArray> list of floes created using Voronoi Tesselation of the domain with given concentrations.
sourceSubzero._initialize_floe_field
— Method_initialize_floe_field(
::Type{FT},
coords,
domain,
@@ -79,29 +81,29 @@
Δh;
floe_settings,
rng,
-)
Create a field of floes from a list of polygon coordiantes. User is wanrned if floe's do not meet minimum size requirment. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type coords <Vector{PolyVec}> list of polygon coords to make into floes domain <Domain> model domain hmean <Float> average floe height Δh <Float> height range - floes will range in height from hmean ± Δh floesettings <FloeSettings> settings needed to initialize floes rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm Output: floearr <StructArray{Floe}> list of floes created from given polygon coordinates
sourceSubzero.add_floe_ghosts!
— Methodadd_floe_ghosts!(floes, max_boundary, min_boundary)
Add ghosts of all of the given floes passing through the two given boundaries to the list of floes. Inputs: floes <StructArray{Floe{FT}}> list of floes to find ghosts for maxboundary <PeriodicBoundary> northern or eastern boundary of domain minboundary <PeriodicBoundary> southern or western boundary of domain Outputs: None. Ghosts of floes are added to floe list.
sourceSubzero.add_floe_volume!
— Methodadd_floe_volume!(
+)
Create a field of floes from a list of polygon coordiantes. User is wanrned if floe's do not meet minimum size requirment. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type coords <Vector{PolyVec}> list of polygon coords to make into floes domain <Domain> model domain hmean <Float> average floe height Δh <Float> height range - floes will range in height from hmean ± Δh floesettings <FloeSettings> settings needed to initialize floes rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm Output: floearr <StructArray{Floe}> list of floes created from given polygon coordinates
sourceSubzero.add_floe_ghosts!
— Methodadd_floe_ghosts!(floes, max_boundary, min_boundary)
Add ghosts of all of the given floes passing through the two given boundaries to the list of floes. Inputs: floes <StructArray{Floe{FT}}> list of floes to find ghosts for maxboundary <PeriodicBoundary> northern or eastern boundary of domain minboundary <PeriodicBoundary> southern or western boundary of domain Outputs: None. Ghosts of floes are added to floe list.
sourceSubzero.add_floe_volume!
— Methodadd_floe_volume!(
floes,
idx,
vol,
floe_settings,
-)
Add volume to existing floe and update fields that depend on the volume. Inputs: floes <StructArray{Frloe}> list of floes idx <Int> index of floe to add volume to vol <AbstractFloat> volume to add to floe floe_settings <FloeSettings> simulation's settings for making floes Outputs: Nothing. Floe's fields are updated to reflect increase in volume.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
+)
Add volume to existing floe and update fields that depend on the volume. Inputs: floes <StructArray{Frloe}> list of floes idx <Int> index of floe to add volume to vol <AbstractFloat> volume to add to floe floe_settings <FloeSettings> simulation's settings for making floes Outputs: Nothing. Floe's fields are updated to reflect increase in volume.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
elems,
domain,
-)
Add ghosts for elements that pass through any of the boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ AbstractFloat, PeriodicBoundary, PeriodicBoundary, PeriodicBoundary, PeriodicBoundary, }> domain with all boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
+)
Add ghosts for elements that pass through any of the boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ AbstractFloat, PeriodicBoundary, PeriodicBoundary, PeriodicBoundary, PeriodicBoundary, }> domain with all boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
elems,
domain,
-)
Add ghosts for elements that pass through the northern or southern boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ Float, PeriodicBoundary, PeriodicBoundary, NonPeriodicBoundary, NonPeriodicBoundary, }> domain with northern and southern periodic boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
+)
Add ghosts for elements that pass through the northern or southern boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ Float, PeriodicBoundary, PeriodicBoundary, NonPeriodicBoundary, NonPeriodicBoundary, }> domain with northern and southern periodic boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
elems,
domain,
-)
Add ghosts for elements that pass through the eastern or western boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ Float, NonPeriodicBoundary, NonPeriodicBoundary, PeriodicBoundary, PeriodicBoundary, }> domain with eastern and western periodic boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
+)
Add ghosts for elements that pass through the eastern or western boundaries. Inputs: elems <StructArray{Floe} or StructArray{TopographyElement}> list of elements to add ghosts to domain <Domain{ Float, NonPeriodicBoundary, NonPeriodicBoundary, PeriodicBoundary, PeriodicBoundary, }> domain with eastern and western periodic boundaries Outputs: None. Ghosts are added to list of elements.
sourceSubzero.add_ghosts!
— Methodadd_ghosts!(
elems,
domain,
-)
When there are no periodic boundaries, no ghosts should be added. Inputs: None are used. Outputs: None.
sourceSubzero.add_point!
— Methodadd_point!(
+)
When there are no periodic boundaries, no ghosts should be added. Inputs: None are used. Outputs: None.
sourceSubzero.add_point!
— Methodadd_point!(
cfloes::CellFloes,
floeidx,
Δx,
Δy,
-)
Add floe to CellFloes list of floes within that grid cell and aggragate the stress caused by monte carlo point in floe into IceStressCell object. Inputs: cfloes <CellFloes> CellFloes object representing one grid cell (centered on model's grid lines) floeidx <Int> floe index within model's list of floes Δx <AbstractFloat> x-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Δy <AbstractFloat> y-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Outputs: None. Add information to both cfloes to record where floe is on model grid.
sourceSubzero.add_point!
— Methodadd_point!(
+)
Add floe to CellFloes list of floes within that grid cell and aggragate the stress caused by monte carlo point in floe into IceStressCell object. Inputs: cfloes <CellFloes> CellFloes object representing one grid cell (centered on model's grid lines) floeidx <Int> floe index within model's list of floes Δx <AbstractFloat> x-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Δy <AbstractFloat> y-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Outputs: None. Add information to both cfloes to record where floe is on model grid.
sourceSubzero.add_point!
— Methodadd_point!(
cfloes::CellFloes,
scell::IceStressCell,
floeidx,
@@ -109,7 +111,7 @@
τy,
Δx,
Δy,
-)
Add floe to CellFloes list of floes within that grid cell and aggragate the stress caused by monte carlo point in floe into IceStressCell object. Inputs: cfloes <CellFloes> CellFloes object representing one grid cell (centered on model's grid lines) scell <IceStressCell> IceStressCell aggragating stresses from floes within grid cell from each floes' monte carlo points floeidx <Int> floe index within model's list of floes τx <AbstractFloat> x-directional stress from monte carlo point on ocean τy <AbstractFloat> y-directional stress from monte carlo point on ocean Δx <AbstractFloat> x-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Δy <AbstractFloat> y-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Outputs: None. Add information to both cfloes and scell to aggregate stress on ocean grid cell and record where floe is on model grid.
sourceSubzero.auto_extension
— Methodauto_extension(filename, ext)
If filename
ends in ext
, return filename
. Otherwise return filename * ext
.
sourceSubzero.bin_floe_centroids
— Methodbin_floe_centroids(floes, grid, domain, Nx, Ny)
Split floe locations into a grid of Nx by Ny by floe centroid location Inputs: floes <StructArray{Floe}> simulation's list of floes grid <RegRectilinearGrid> simulation's grid domain <Domain> simulation's domain Nx <Int> number of grid cells in the x-direction to split domain into for welding groups Ny <Int> number of grid cells in the y-direction to split domain into for welding groups Outputs: floebins <Matrix{Vector{Int}}> Nx by Ny matrix where each element is a list of floe indices whose centroids are in the corresponding section of the grid. May also have elements of value 0 if there are less than average number of floes in the section. nfloes <Maxtrix{Int}> Nx by Ny matrix where each element is the total number of indices within floebins[Nx, Ny] that are non-zeros and represent a floe within the grid section.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{East})
Determine coordinates of eastern-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{East}> boundary direction type Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{North})
Determine coordinates of northen-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{North}> boundary direction type Output: PolyVec of boundary coordinates. These coordinates describe a rectangle that has a length 2-times the length of the grid in the x-direction, centered on the grid so that there is a buffer of half of the grid on either side. The height is half of the grid in the y-direction. This buffer prevents pieces of floes from passing outside the boundary before the next timestep - possibly too cautious. If boundary_coords methods are used for each direction, corners will be shared between adjacent boundaries.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{South})
Determine coordinates of southern-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{South}> boundary direction type Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{West})
Determine coordinates of western-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{West}> boundary direction Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.calc_angular_momentum
— Methodcalc_angular_momentum(u, v, mass, ξ, moment, x, y)
Calculates angular momentum for one timestep given the floe's velocities, mass, moment of intertia, and centroid position. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses ξ <Vector{Real}> list of floes' angular velocities moment <Vector{Real}> list of floes' moments of intertia x <Vector{Real}> list of floes' centroid x-value y <Vector{Real}> list of floes' centroid y-value Outputs: <Real> total spin angular momentum from the floes <Real> total orbital angular momentum from the floes
sourceSubzero.calc_atmosphere_forcing
— Methodcalc_atmosphere_forcing(
+)
Add floe to CellFloes list of floes within that grid cell and aggragate the stress caused by monte carlo point in floe into IceStressCell object. Inputs: cfloes <CellFloes> CellFloes object representing one grid cell (centered on model's grid lines) scell <IceStressCell> IceStressCell aggragating stresses from floes within grid cell from each floes' monte carlo points floeidx <Int> floe index within model's list of floes τx <AbstractFloat> x-directional stress from monte carlo point on ocean τy <AbstractFloat> y-directional stress from monte carlo point on ocean Δx <AbstractFloat> x-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Δy <AbstractFloat> y-translation to move floe from current position into given grid cell if shifted due to periodic boundaries Outputs: None. Add information to both cfloes and scell to aggregate stress on ocean grid cell and record where floe is on model grid.
sourceSubzero.auto_extension
— Methodauto_extension(filename, ext)
If filename
ends in ext
, return filename
. Otherwise return filename * ext
.
sourceSubzero.bin_floe_centroids
— Methodbin_floe_centroids(floes, grid, domain, Nx, Ny)
Split floe locations into a grid of Nx by Ny by floe centroid location Inputs: floes <StructArray{Floe}> simulation's list of floes grid <RegRectilinearGrid> simulation's grid domain <Domain> simulation's domain Nx <Int> number of grid cells in the x-direction to split domain into for welding groups Ny <Int> number of grid cells in the y-direction to split domain into for welding groups Outputs: floebins <Matrix{Vector{Int}}> Nx by Ny matrix where each element is a list of floe indices whose centroids are in the corresponding section of the grid. May also have elements of value 0 if there are less than average number of floes in the section. nfloes <Maxtrix{Int}> Nx by Ny matrix where each element is the total number of indices within floebins[Nx, Ny] that are non-zeros and represent a floe within the grid section.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{East})
Determine coordinates of eastern-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{East}> boundary direction type Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{North})
Determine coordinates of northen-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{North}> boundary direction type Output: PolyVec of boundary coordinates. These coordinates describe a rectangle that has a length 2-times the length of the grid in the x-direction, centered on the grid so that there is a buffer of half of the grid on either side. The height is half of the grid in the y-direction. This buffer prevents pieces of floes from passing outside the boundary before the next timestep - possibly too cautious. If boundary_coords methods are used for each direction, corners will be shared between adjacent boundaries.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{South})
Determine coordinates of southern-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{South}> boundary direction type Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.boundary_coords
— Methodboundary_coords(grid, ::Type{West})
Determine coordinates of western-most boundary of domain if around the edge of the grid. Inputs: grid <AbstractGrid> model grid <Type{West}> boundary direction Output: PolyVec of boundary coordinates. See documentation of North method of this function for more details.
sourceSubzero.calc_angular_momentum
— Methodcalc_angular_momentum(u, v, mass, ξ, moment, x, y)
Calculates angular momentum for one timestep given the floe's velocities, mass, moment of intertia, and centroid position. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses ξ <Vector{Real}> list of floes' angular velocities moment <Vector{Real}> list of floes' moments of intertia x <Vector{Real}> list of floes' centroid x-value y <Vector{Real}> list of floes' centroid y-value Outputs: <Real> total spin angular momentum from the floes <Real> total orbital angular momentum from the floes
sourceSubzero.calc_atmosphere_forcing
— Methodcalc_atmosphere_forcing(
mc_xr,
mc_yr,
upoint,
@@ -117,14 +119,14 @@
uatm_interp,
vatm_interp,
c,
-)
Calculates the stresses on a floe from the atmosphere above at given monte carlo point. Inputs: mcxr <AbstractFloat> monte carlo point x-coordinate mcyr <AbstractFloat> monte carlo point y-coordinate upoint <AbstractFloat> u velocity of floe at monte carlo point vpoint <AbstractFloat> v velocity of floe at monte carlo point uatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere u velocity onto point vatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere v velocity onto point c <Constants> simulation's constants Outputs: τxatm <AbstractFloat> stress from atmosphere on floe in x-direction at given monte carlo point τyatm <AbstractFloat> stress from atmosphere on floe in y-direction at given monte carlo point
sourceSubzero.calc_elastic_forces
— Methodcalc_elastic_forces(
+)
Calculates the stresses on a floe from the atmosphere above at given monte carlo point. Inputs: mcxr <AbstractFloat> monte carlo point x-coordinate mcyr <AbstractFloat> monte carlo point y-coordinate upoint <AbstractFloat> u velocity of floe at monte carlo point vpoint <AbstractFloat> v velocity of floe at monte carlo point uatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere u velocity onto point vatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere v velocity onto point c <Constants> simulation's constants Outputs: τxatm <AbstractFloat> stress from atmosphere on floe in x-direction at given monte carlo point τyatm <AbstractFloat> stress from atmosphere on floe in y-direction at given monte carlo point
sourceSubzero.calc_elastic_forces
— Methodcalc_elastic_forces(
p1,
p2,
regions,
region_areas,
force_factor,
consts,
-)
Calculate normal forces, the point the force is applied, and the overlap area of regions created from floe collisions Inputs: p1 <Polygon> first floe's polygon in collision p2 <Polygon> second floe's polygon in collision regions <Vector{Polygon}> polygon regions of overlap during collision regionareas <Vector{Float}> area of each polygon in regions forcefactor <Float> Spring constant equivalent for collisions Outputs: force <Array{Float, n, 2}> normal forces on each of the n regions greater than a minimum area fpoint <Array{Float, n, 2}> point force is applied on each of the n regions greater than a minimum area overlap <Array{Float, n, 2}> area of each of the n regions greater than a minimum area Δl <Float> mean length of distance between intersection points
sourceSubzero.calc_eulerian_data!
— Methodcalc_eulerian_data!(floes, topography, writer, istep)
Calculate floe data averaged on grid defined by GridOutputWriter for current timestep (istep). Inputs: floes <StructArray{Floe}> array of model's floes topography <StructArray{Topography} array of model's topography writer <GridOutputWriter> istep <Int> current simulation timestep Output: Floe data averaged on eularian grid provided and saved in writer.data field
sourceSubzero.calc_friction_forces
— Methodcalc_friction_forces(
+)
Calculate normal forces, the point the force is applied, and the overlap area of regions created from floe collisions Inputs: p1 <Polygon> first floe's polygon in collision p2 <Polygon> second floe's polygon in collision regions <Vector{Polygon}> polygon regions of overlap during collision regionareas <Vector{Float}> area of each polygon in regions forcefactor <Float> Spring constant equivalent for collisions Outputs: force <Array{Float, n, 2}> normal forces on each of the n regions greater than a minimum area fpoint <Array{Float, n, 2}> point force is applied on each of the n regions greater than a minimum area overlap <Array{Float, n, 2}> area of each of the n regions greater than a minimum area Δl <Float> mean length of distance between intersection points
sourceSubzero.calc_eulerian_data!
— Methodcalc_eulerian_data!(floes, topography, writer, istep)
Calculate floe data averaged on grid defined by GridOutputWriter for current timestep (istep). Inputs: floes <StructArray{Floe}> array of model's floes topography <StructArray{Topography} array of model's topography writer <GridOutputWriter> istep <Int> current simulation timestep Output: Floe data averaged on eularian grid provided and saved in writer.data field
sourceSubzero.calc_friction_forces
— Methodcalc_friction_forces(
ifloe,
jfloe,
fpoints,
@@ -132,14 +134,14 @@
Δl,
consts,
Δt,
-)
Calculate frictional force for collision between two floes or a floe and a domain element. Input: ifloe <Floe> first floe in collsion jfloe <Union{Floe, DomainElement}> either second floe or topography element/boundary element fpoints <Array{Float, N, 2}> x,y-coordinates of the point the force is applied on floe overlap region normal <Array{Float, N, 2}> x,y normal force applied on fpoint on floe overlap region Δl <Vector> mean length of distance between intersection points consts <Constants> model constants needed for calculations Δt <AbstractFloat> simulation's timestep Outputs: force <Array{Float, N, 2}> frictional/tangential force of the collision in x and y (each row) for each collision (each column)
sourceSubzero.calc_kinetic_energy
— Methodcalc_total_energy(u, v, mass, ξ, moment)
Calculates linear and rotational energy for one timestep given the floe's velocities, mass, and moment of intertia. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses ξ <Vector{Real}> list of floes' angular velocities moment <Vector{Real}> list of floes' moments of intertia Outputs: linear <Real> total linear kinetic energy generated by the floes rotational <Real> total rotational kinetic energy generated by the floes
sourceSubzero.calc_linear_momentum
— Methodcalc_linear_momentum(u, v, mass)
Calculates linear momentum for one timestep given the floe's velocities and mass. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses Outputs: <Real> total linear momentum in the x-direction from floes <Real> total linear momentum in the y-direction from floes
sourceSubzero.calc_normal_force
— Methodcalc_normal_force(
+)
Calculate frictional force for collision between two floes or a floe and a domain element. Input: ifloe <Floe> first floe in collsion jfloe <Union{Floe, DomainElement}> either second floe or topography element/boundary element fpoints <Array{Float, N, 2}> x,y-coordinates of the point the force is applied on floe overlap region normal <Array{Float, N, 2}> x,y normal force applied on fpoint on floe overlap region Δl <Vector> mean length of distance between intersection points consts <Constants> model constants needed for calculations Δt <AbstractFloat> simulation's timestep Outputs: force <Array{Float, N, 2}> frictional/tangential force of the collision in x and y (each row) for each collision (each column)
sourceSubzero.calc_kinetic_energy
— Methodcalc_total_energy(u, v, mass, ξ, moment)
Calculates linear and rotational energy for one timestep given the floe's velocities, mass, and moment of intertia. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses ξ <Vector{Real}> list of floes' angular velocities moment <Vector{Real}> list of floes' moments of intertia Outputs: linear <Real> total linear kinetic energy generated by the floes rotational <Real> total rotational kinetic energy generated by the floes
sourceSubzero.calc_linear_momentum
— Methodcalc_linear_momentum(u, v, mass)
Calculates linear momentum for one timestep given the floe's velocities and mass. Inputs: u <Vector{Real}> list of floes' u velocities v <Vector{Real}> list of floes' v velocities mass <Vector{Real}> list of floes' masses Outputs: <Real> total linear momentum in the x-direction from floes <Real> total linear momentum in the y-direction from floes
sourceSubzero.calc_normal_force
— Methodcalc_normal_force(
c1,
c2,
region,
area,
ipoints,
force_factor,
-)
Calculate normal force for collision between polygons p1 and p2 given an overlapping region, the area of that region, their intersection points in the region, and a force factor. Inputs: p1 <Polys> first polygon p2 <Polys> second polygon region <PolyVec{Float64}> coordiantes for one region of intersection between the polygons area <Float> area of region ipoints <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> Points of intersection between polygon 1 and 2 force_factor <Float> Spring constant equivalent for collisions Outputs: <Float> normal force of collision Δl <Float> mean length of distance between intersection points
sourceSubzero.calc_ocean_forcing!
— Methodcalc_ocean_forcing!(
+)
Calculate normal force for collision between polygons p1 and p2 given an overlapping region, the area of that region, their intersection points in the region, and a force factor. Inputs: p1 <Polys> first polygon p2 <Polys> second polygon region <PolyVec{Float64}> coordiantes for one region of intersection between the polygons area <Float> area of region ipoints <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> Points of intersection between polygon 1 and 2 force_factor <Float> Spring constant equivalent for collisions Outputs: <Float> normal force of collision Δl <Float> mean length of distance between intersection points
sourceSubzero.calc_ocean_forcing!
— Methodcalc_ocean_forcing!(
mc_xr,
mc_yr,
upoint,
@@ -149,7 +151,7 @@
hflx_interp,
ma_ratio,
c,
-)
Calculates the stresses on a floe from the ocean above at given monte carlo point. Inputs: mcxr <AbstractFloat> monte carlo point x-coordinate mcyr <AbstractFloat> monte carlo point y-coordinate upoint <AbstractFloat> u velocity of floe at monte carlo point vpoint <AbstractFloat> v velocity of floe at monte carlo point uocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean u velocity onto point vocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean v velocity onto point hflxinterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean heatflux factor velocity onto point maratio <AbstractFloat> floe's mass to area ratio c <Constants> simulation's constants Outputs: τxocn <AbstractFloat> stress from ocean velocity on floe in x-direction at given monte carlo point τyocn <AbstractFloat> stress from ocean velocity on floe in y-direction at given monte carlo point τxpressure∇ <AbstractFloat> stress from ocean pressure gradient on floe in x-direction at given monte carlo point τypressure∇ <AbstractFloat> stress from ocean pressure gradient on floe in y-direction at given monte carlo point hflx_factor <AbstractFloat> heatflux factor at given monte carlo point from the heatflux factors of ocean below floe
sourceSubzero.calc_one_way_coupling!
— Methodcalc_one_way_coupling!(
+)
Calculates the stresses on a floe from the ocean above at given monte carlo point. Inputs: mcxr <AbstractFloat> monte carlo point x-coordinate mcyr <AbstractFloat> monte carlo point y-coordinate upoint <AbstractFloat> u velocity of floe at monte carlo point vpoint <AbstractFloat> v velocity of floe at monte carlo point uocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean u velocity onto point vocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean v velocity onto point hflxinterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean heatflux factor velocity onto point maratio <AbstractFloat> floe's mass to area ratio c <Constants> simulation's constants Outputs: τxocn <AbstractFloat> stress from ocean velocity on floe in x-direction at given monte carlo point τyocn <AbstractFloat> stress from ocean velocity on floe in y-direction at given monte carlo point τxpressure∇ <AbstractFloat> stress from ocean pressure gradient on floe in x-direction at given monte carlo point τypressure∇ <AbstractFloat> stress from ocean pressure gradient on floe in y-direction at given monte carlo point hflx_factor <AbstractFloat> heatflux factor at given monte carlo point from the heatflux factors of ocean below floe
sourceSubzero.calc_one_way_coupling!
— Methodcalc_one_way_coupling!(
floes::StructArray{Floe{FT}},
grid,
atmos,
@@ -157,13 +159,13 @@
domain,
coupling_settings,
consts,
-)
Preforms calculations needed for one way coupling by calculating floe's forcings from ocean and atmosphere as well as the heatflux below a given floe.
Floe location on grid is also recorded. If two-way coupling is on, total stress on each grid cell per-floe in grid cell is also recorded for use in calctwowaycoupling! Inputs: floes <StructArray{Floe{FT}}> model's floe list grid <AbstractGrid> model's grid atmos <Ocean> model's atmosphere ocean <Ocean> model's ocean domain <Domain> model's domain couplingsettings <CouplingSettings> simulation coupling settings consts <Constants> simulation's constants Ouputs: None. Update each floe's forces, torque, and heatflux factor from ocean/atmosphere. Determine location of floe within grid and if two-way coupling in enabled, save floe stress on grid.
sourceSubzero.calc_strain!
— Methodcalc_strain!(coords, centroid, u, v, ξ, area)
Calculates the strain on a floe given the velocity at each vertex Inputs: floe <Floe{AbstractFloat}> a floe Outputs: strain <Matrix{AbstractFloat}> 2x2 matrix for floe strain
sourceSubzero.calc_stress!
— Methodcalc_stress!(floe)
Calculates the stress on a floe for current collisions given interactions and floe properties. Inputs: floe <Union{LazyRow{Floe{AbstractFloat}}, Floe{AbstractFloat}> properties of floe floesettings <FloeSettings{AbstractFloat}> Settings to create floes within model Δt <AbstractFloat> Simulation timestep in seconds Outputs: Does not return anything, but updates floe.stressaccum and floe.stress_instant
sourceSubzero.calc_subfloe_values!
— Methodcalc_subfloe_values!(
+)
Preforms calculations needed for one way coupling by calculating floe's forcings from ocean and atmosphere as well as the heatflux below a given floe.
Floe location on grid is also recorded. If two-way coupling is on, total stress on each grid cell per-floe in grid cell is also recorded for use in calctwowaycoupling! Inputs: floes <StructArray{Floe{FT}}> model's floe list grid <AbstractGrid> model's grid atmos <Ocean> model's atmosphere ocean <Ocean> model's ocean domain <Domain> model's domain couplingsettings <CouplingSettings> simulation coupling settings consts <Constants> simulation's constants Ouputs: None. Update each floe's forces, torque, and heatflux factor from ocean/atmosphere. Determine location of floe within grid and if two-way coupling in enabled, save floe stress on grid.
sourceSubzero.calc_strain!
— Methodcalc_strain!(coords, centroid, u, v, ξ, area)
Calculates the strain on a floe given the velocity at each vertex Inputs: floe <Floe{AbstractFloat}> a floe Outputs: strain <Matrix{AbstractFloat}> 2x2 matrix for floe strain
sourceSubzero.calc_stress!
— Methodcalc_stress!(floe)
Calculates the stress on a floe for current collisions given interactions and floe properties. Inputs: floe <Union{LazyRow{Floe{AbstractFloat}}, Floe{AbstractFloat}> properties of floe floesettings <FloeSettings{AbstractFloat}> Settings to create floes within model Δt <AbstractFloat> Simulation timestep in seconds Outputs: Does not return anything, but updates floe.stressaccum and floe.stress_instant
sourceSubzero.calc_subfloe_values!
— Methodcalc_subfloe_values!(
floe::Union{Floe{FT}, LazyRow{Floe{FT}}},
grid,
domain,
mc_cart,
mc_grid_idx,
-)
Calculates subfloe point's cartesian coordiantes, polar coordiantes, velocity and index within the grid. Inputs: floe <Union{Floe{AbstractFloat}, LazyRow{Floe{AbstractFloat}}}> floe grid <AbstractGrid> model's grid domain <Domain> model's domain mccart <Matrix{AbstractFloat}> pre-allocated nx2 matrix for floe's monte carlo point's cartesian coordinates where the first column is x and second is y mcgrididx <Matrix{AbstractFloat}> pre-allocated nx2 matrix for floe's monte carlo point's grid indices where the first column is the column and the second is the row that the point is in on the grid split into cells centered on grid lines. Outputs: j <Int> last element in mccart and mcgrididx that holds monte carlo point information for given floe. mccart and mcgrid_idx filled with data for given floe's monte carlo points up to row j.
sourceSubzero.calc_torque!
— Methodcalc_torque!(floe)
Calculate a floe's torque based on the interactions. Inputs: floe <Floe> floe in model Outputs: None. Floe's interactions field is updated with calculated torque.
sourceSubzero.calc_two_way_coupling!
— Methodcalc_two_way_coupling!(
+)
Calculates subfloe point's cartesian coordiantes, polar coordiantes, velocity and index within the grid. Inputs: floe <Union{Floe{AbstractFloat}, LazyRow{Floe{AbstractFloat}}}> floe grid <AbstractGrid> model's grid domain <Domain> model's domain mccart <Matrix{AbstractFloat}> pre-allocated nx2 matrix for floe's monte carlo point's cartesian coordinates where the first column is x and second is y mcgrididx <Matrix{AbstractFloat}> pre-allocated nx2 matrix for floe's monte carlo point's grid indices where the first column is the column and the second is the row that the point is in on the grid split into cells centered on grid lines. Outputs: j <Int> last element in mccart and mcgrididx that holds monte carlo point information for given floe. mccart and mcgrid_idx filled with data for given floe's monte carlo points up to row j.
sourceSubzero.calc_torque!
— Methodcalc_torque!(floe)
Calculate a floe's torque based on the interactions. Inputs: floe <Floe> floe in model Outputs: None. Floe's interactions field is updated with calculated torque.
sourceSubzero.calc_two_way_coupling!
— Methodcalc_two_way_coupling!(
floes::StructArray{Floe{FT}},
grid::RegRectilinearGrid,
atmos,
@@ -172,13 +174,13 @@
floe_settings,
consts,
Δt,
-)
Calculate effects of ice and atmosphere on the ocean and update ocean stress fields and sea ice fraction. Inputs: floes <StructArray{Floe}> model's floes grid <AbstractGrid> model's grid atmos <Atmos> model's atmosphere ocean <Ocean> model's ocean domain <Domain> model's domain floe_settings <FloeSettings> simulation's floe settings consts <Constants> model's constants Δt <Int> simulation's timestep in seconds Output: None. Update's ocean's stress fields and heatflux factor field.
sourceSubzero.center_cell_coords
— Methodcenter_cell_coords(
+)
Calculate effects of ice and atmosphere on the ocean and update ocean stress fields and sea ice fraction. Inputs: floes <StructArray{Floe}> model's floes grid <AbstractGrid> model's grid atmos <Atmos> model's atmosphere ocean <Ocean> model's ocean domain <Domain> model's domain floe_settings <FloeSettings> simulation's floe settings consts <Constants> model's constants Δt <Int> simulation's timestep in seconds Output: None. Update's ocean's stress fields and heatflux factor field.
sourceSubzero.center_cell_coords
— Methodcenter_cell_coords(
xidx::Int,
yidx::Int,
grid::RegRectilinearGrid,
ns_bound,
ew_bound,
-)
Find the coordinates of a given grid cell, centered on a grid line with row yidx and column xidx. This is offset from the cells within the regular rectilinear grid by half of a grid cell. Inputs: xidx <Int> x index of grid line within list of gridlines (cell column) yidx <Int> y index of grid line within list of gridlines (cell row) grid <RegRectilinearGrid> model's grid nsbound <AbstractBoundary> type of either north or south boundary - for checking if periodic ewbound <AbstractBoundary> type of either east or west boundary - for checking if perioidic Output: <PolyVec> coordinates for cell centered on grid line with given indices. Note that cell bounds will be adjusted depending on if the bounds are periodic. Cells cannot extend outside of non-periodic boundaries and thus will be trimmed at boundaries. Therefore, if indices place cell completely outside of grid, could return a line at the edge of the boundary.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
+)
Find the coordinates of a given grid cell, centered on a grid line with row yidx and column xidx. This is offset from the cells within the regular rectilinear grid by half of a grid cell. Inputs: xidx <Int> x index of grid line within list of gridlines (cell column) yidx <Int> y index of grid line within list of gridlines (cell row) grid <RegRectilinearGrid> model's grid nsbound <AbstractBoundary> type of either north or south boundary - for checking if periodic ewbound <AbstractBoundary> type of either east or west boundary - for checking if perioidic Output: <PolyVec> coordinates for cell centered on grid line with given indices. Note that cell bounds will be adjusted depending on if the bounds are periodic. Cells cannot extend outside of non-periodic boundaries and thus will be trimmed at boundaries. Therefore, if indices place cell completely outside of grid, could return a line at the edge of the boundary.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
xmin,
xmax,
ymin,
@@ -186,7 +188,7 @@
grid,
::PeriodicBoundary,
::PeriodicBoundary,
-)
Return cell bounding values as is given the domain is doubley periodic and thus the cell can extend beyond the grid as it will simply wrap back around into grid through opposite periodic boundary. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> model's grid <PeriodicBoundary> type of north or south boundary - periodic pair <PeriodicBoundary> type of east or west boundary - periodic pair Output: x and y minimums and maximums as given since they can extend past the grid due to periodic boundaries.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
+)
Return cell bounding values as is given the domain is doubley periodic and thus the cell can extend beyond the grid as it will simply wrap back around into grid through opposite periodic boundary. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> model's grid <PeriodicBoundary> type of north or south boundary - periodic pair <PeriodicBoundary> type of east or west boundary - periodic pair Output: x and y minimums and maximums as given since they can extend past the grid due to periodic boundaries.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
xmin,
xmax,
ymin,
@@ -194,7 +196,7 @@
grid,
::PeriodicBoundary,
::NonPeriodicBoundary,
-)
Trim cell bound in the east-west direction if it exends past grid due to non-periodic boundary pair. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <PeriodicBoundary> type of either north or south boundary - periodic pair <NonPeriodicBoundary> type of either east or west boundary - not a periodic pair Output: Potentially trimmed x min and max if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
+)
Trim cell bound in the east-west direction if it exends past grid due to non-periodic boundary pair. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <PeriodicBoundary> type of either north or south boundary - periodic pair <NonPeriodicBoundary> type of either east or west boundary - not a periodic pair Output: Potentially trimmed x min and max if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
xmin,
xmax,
ymin,
@@ -202,7 +204,7 @@
grid,
::NonPeriodicBoundary,
::PeriodicBoundary,
-)
Trim cell bound in the north-south direction if it exends past grid due to non-periodic boundary pair. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <NonPeriodicBoundary> type of either north or south boundary - not a periodic pair <PeriodicBoundary> type of either east or west boundary - periodic pair Output: Potentially trimmed y min and y max if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
+)
Trim cell bound in the north-south direction if it exends past grid due to non-periodic boundary pair. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <NonPeriodicBoundary> type of either north or south boundary - not a periodic pair <PeriodicBoundary> type of either east or west boundary - periodic pair Output: Potentially trimmed y min and y max if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_cell_bounds
— Methodcheck_cell_bounds(
xmin,
xmax,
ymin,
@@ -210,7 +212,7 @@
grid,
::NonPeriodicBoundary,
::NonPeriodicBoundary,
-)
Trim cell bounds in the east-west and north-south direction if they exend past grid due to non-periodic boundary pairs. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <NonPeriodicBoundary> type of either north or south boundary - not a periodic pair <NonPeriodicBoundary> type of either east or west boundary - not a periodic pair Output: Potentially trimmed x and y minimums and maximums if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_energy_momentum_conservation_julia
— Functioncheck_energy_momentum_conservation_julia(filename, dir, verbose)
Calculates total kinetic energy and momentum at each timestep and plots the output to check for conservation from floe outputwriter file. Also gives percent change in energy and momentum from first to last timestep in terminal. Inputs: filename <String> floe outputwriter filename + path dir <String> directory to save total energy and momentum conservation plots plot <Bool> plots energy and momentum over time if true Outputs: Δenergy <Float> percentage change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory if plots is true
sourceSubzero.check_energy_momentum_conservation_matlab
— Functioncheck_energy_momentum_conservation_matlab(mat_path, dir, plot)
Calculates total kinetic energy and momentum at each timestep and plots the output to check for conservation from MATLAB verion of model output. The matpath should lead to the Floes file within the MATLAB version of the model. Also givesnpercent change in energy and momentum from first to last timestep in terminal. Inputs: matpath <String> path to MATLAB version's Floe folder dir <String> directory to save total energy and momentum conservation plots plot <Bool> plots energy and momentum over time if true Outputs: Δenergy <Float> percentage change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory if plots is true
sourceSubzero.check_for_edge_mid
— Methodcheck_for_edge_mid(c, start, stop, shared_idx, shared_dist, running_dist)
Check if indices from start to stop index of given coords includes midpoint given the shared distance and return midpoint if it exists in given range. Inputs: c <PolyVec> floe coordinates start <Int> index of sharedindex list to start search from stop <Int> index of sharedindex list to stop search at sharedidx <Vector{Int}> list of indices of c used to calculate midpoint shareddist <Float> total length of edges considered from sharedidx runningdist <Float> total length of edges traveled along in midpoint search so far Outputs: midx <Float> x-coordinate of midpoint, Inf if midpoint not in given range midy <Float> y-coordinate of midpoint, Inf if midpoint not in given range running_dist <Float> sum of distances travelled along shared edges
sourceSubzero.compare_floe_data
— Methodcompare_floe_data(filename1, filename2)
Compare two files output by the floe output writer. Prints out first instances of not matching per timestep and field. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print time and index of floes that don't match
sourceSubzero.compare_grid_data
— Methodcompare_grid_data(filename1, filename2)
Compare two files output by the grid output writer. Prints out first instances of not matching per field. All timesteps are compared at once. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print the field that has discrepancies.
sourceSubzero.compare_oa_checkpointer_data
— Methodcompare_checkpointer_data(filename1, filename2)
Compare two files output by the checkpointer output writer. Compares ocean and atmosphere. If there are discrepancies between the files, it will timesteps and field. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print the field and timesteps that have discrepancies.
sourceSubzero.conserve_momentum_change_floe_shape!
— Functionconserve_momentum_change_floe_shape!(
+)
Trim cell bounds in the east-west and north-south direction if they exend past grid due to non-periodic boundary pairs. Inputs: xmin <Float> center cell minimum x value xmax <Float> center cell maxumum x value ymin <Float> center cell minimum y value ymax <Float> center cell maximum y value grid <AbstractGrid> <NonPeriodicBoundary> type of either north or south boundary - not a periodic pair <NonPeriodicBoundary> type of either east or west boundary - not a periodic pair Output: Potentially trimmed x and y minimums and maximums if these values extend beyond grid values. Else returned unchanged.
sourceSubzero.check_energy_momentum_conservation_julia
— Functioncheck_energy_momentum_conservation_julia(filename, dir, verbose)
Calculates total kinetic energy and momentum at each timestep and plots the output to check for conservation from floe outputwriter file. Also gives percent change in energy and momentum from first to last timestep in terminal. Inputs: filename <String> floe outputwriter filename + path dir <String> directory to save total energy and momentum conservation plots plot <Bool> plots energy and momentum over time if true Outputs: Δenergy <Float> percentage change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory if plots is true
sourceSubzero.check_energy_momentum_conservation_matlab
— Functioncheck_energy_momentum_conservation_matlab(mat_path, dir, plot)
Calculates total kinetic energy and momentum at each timestep and plots the output to check for conservation from MATLAB verion of model output. The matpath should lead to the Floes file within the MATLAB version of the model. Also givesnpercent change in energy and momentum from first to last timestep in terminal. Inputs: matpath <String> path to MATLAB version's Floe folder dir <String> directory to save total energy and momentum conservation plots plot <Bool> plots energy and momentum over time if true Outputs: Δenergy <Float> percentage change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory if plots is true
sourceSubzero.check_for_edge_mid
— Methodcheck_for_edge_mid(c, start, stop, shared_idx, shared_dist, running_dist)
Check if indices from start to stop index of given coords includes midpoint given the shared distance and return midpoint if it exists in given range. Inputs: c <PolyVec> floe coordinates start <Int> index of sharedindex list to start search from stop <Int> index of sharedindex list to stop search at sharedidx <Vector{Int}> list of indices of c used to calculate midpoint shareddist <Float> total length of edges considered from sharedidx runningdist <Float> total length of edges traveled along in midpoint search so far Outputs: midx <Float> x-coordinate of midpoint, Inf if midpoint not in given range midy <Float> y-coordinate of midpoint, Inf if midpoint not in given range running_dist <Float> sum of distances travelled along shared edges
sourceSubzero.compare_floe_data
— Methodcompare_floe_data(filename1, filename2)
Compare two files output by the floe output writer. Prints out first instances of not matching per timestep and field. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print time and index of floes that don't match
sourceSubzero.compare_grid_data
— Methodcompare_grid_data(filename1, filename2)
Compare two files output by the grid output writer. Prints out first instances of not matching per field. All timesteps are compared at once. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print the field that has discrepancies.
sourceSubzero.compare_oa_checkpointer_data
— Methodcompare_checkpointer_data(filename1, filename2)
Compare two files output by the checkpointer output writer. Compares ocean and atmosphere. If there are discrepancies between the files, it will timesteps and field. Inputs: filename1 <String> filename and path of first file filename2 <String> filename and path of second file Outputs: If there are instances of differences, function will print the field and timesteps that have discrepancies.
sourceSubzero.conserve_momentum_change_floe_shape!
— Functionconserve_momentum_change_floe_shape!(
mass_tmp,
moment_tmp,
x_tmp,
@@ -218,11 +220,11 @@
Δt,
keep_floe,
combine_floe = nothing,
-)
Update current and previous velocity/acceleration fields to conserve momentum of a floe whose shape has been changed, given the previous mass, momentum, and centroid. Inputs: masstmp <AbstractFloat> original mass of floe before shape change momenttmp <AbstractFloat> original moment of intertia of floe before shape change xtmp <AbstractFloat> original x-coordinate of centroid of floe before shape change ytmp <AbstractFloat> original y-coordinate of centroid of floe before shape change Δt <Int> timestep of simulation in seconds keepfloe <Union{Floe, LazyRow{Floe}}> floe whose shape has been changed combinefloe <Union{Floe, LazyRow{Floe}}> if keepfloe's shape has been changed due to an interaction with another floe, combinefloe is that floe - optional parameter Output: None. keepfloe's u, v, ξ, pdxdt, pdydt, pdαdt, pdudt, pdvdt, and p_dξdt fields all updated to preserve momentum. Note: Function does not depend on conservation of mass
sourceSubzero.conserve_momentum_fracture_floe!
— Methodconserve_momentum_fracture_floe!(
+)
Update current and previous velocity/acceleration fields to conserve momentum of a floe whose shape has been changed, given the previous mass, momentum, and centroid. Inputs: masstmp <AbstractFloat> original mass of floe before shape change momenttmp <AbstractFloat> original moment of intertia of floe before shape change xtmp <AbstractFloat> original x-coordinate of centroid of floe before shape change ytmp <AbstractFloat> original y-coordinate of centroid of floe before shape change Δt <Int> timestep of simulation in seconds keepfloe <Union{Floe, LazyRow{Floe}}> floe whose shape has been changed combinefloe <Union{Floe, LazyRow{Floe}}> if keepfloe's shape has been changed due to an interaction with another floe, combinefloe is that floe - optional parameter Output: None. keepfloe's u, v, ξ, pdxdt, pdydt, pdαdt, pdudt, pdvdt, and p_dξdt fields all updated to preserve momentum. Note: Function does not depend on conservation of mass
sourceSubzero.conserve_momentum_fracture_floe!
— Methodconserve_momentum_fracture_floe!(
init_floe,
new_floes,
Δt,
-)
Update newfloes's current and previous velocity/acceleration fields to conserve momentum when a floe has been fractured into several new floes, given the previous mass, momentum, and centroid. The assumption is made that each new floe has the same velocities/accelerations Inputs: initfloe <Union{Floe, LazyRow{Floe}}> original floe newfloes <StructArray{Floe}> fractured pieces of original floe Δt <Int> simulation's timestep in seconds Output: None. newfloes velocities and accelerations are updated for current and previous timestep to conserve momentum. Note: Depends on conservation of mass.
sourceSubzero.conserve_momentum_transfer_mass!
— Functionconserve_momentum_transfer_mass!(
+)
Update newfloes's current and previous velocity/acceleration fields to conserve momentum when a floe has been fractured into several new floes, given the previous mass, momentum, and centroid. The assumption is made that each new floe has the same velocities/accelerations Inputs: initfloe <Union{Floe, LazyRow{Floe}}> original floe newfloes <StructArray{Floe}> fractured pieces of original floe Δt <Int> simulation's timestep in seconds Output: None. newfloes velocities and accelerations are updated for current and previous timestep to conserve momentum. Note: Depends on conservation of mass.
sourceSubzero.conserve_momentum_transfer_mass!
— Functionconserve_momentum_transfer_mass!(
floes,
idx1, idx2,
m1, m2,
@@ -232,25 +234,25 @@
Δt,
pieces_list = nothing,
pieces_idx = 0,
-)
Conserve linear momentum when mass is transfered from one floe to another floe. Inputs: floes <StructArray{Floes}> list of floes idx1 <Int> index of first floe in floes list idx2 <Int> index of second floe in floes list m1 <Float> initial mass of first floe before mass transfer m2 <Float> initial mass of second floe before mass transfer Δt <Int> timestep of simulation in seconds pieceslist <Union{nothing, Vector{Floe}}> list of floes created from floes breaking during ridging and rafting piecesidx <Int> start index of pieces included in conservation calculations within the pieces_list Outputs: Nothing. Update floes' velocities and accelerations to conserve linear momentum.
sourceSubzero.deepcopy_floe
— Methoddeepcopy_floe(floe::LazyRow{Floe{FT}})
Deepcopy of a floe by creating a new floe and copying all fields. Inputs: floe <Floe> Outputs: New floe with floes that are equal in value. Any vector fields are copies so they share values, but not referance.
sourceSubzero.deform_floe!
— Methoddeform_floe!(
+)
Conserve linear momentum when mass is transfered from one floe to another floe. Inputs: floes <StructArray{Floes}> list of floes idx1 <Int> index of first floe in floes list idx2 <Int> index of second floe in floes list m1 <Float> initial mass of first floe before mass transfer m2 <Float> initial mass of second floe before mass transfer Δt <Int> timestep of simulation in seconds pieceslist <Union{nothing, Vector{Floe}}> list of floes created from floes breaking during ridging and rafting piecesidx <Int> start index of pieces included in conservation calculations within the pieces_list Outputs: Nothing. Update floes' velocities and accelerations to conserve linear momentum.
sourceSubzero.deepcopy_floe
— Methoddeepcopy_floe(floe::LazyRow{Floe{FT}})
Deepcopy of a floe by creating a new floe and copying all fields. Inputs: floe <Floe> Outputs: New floe with floes that are equal in value. Any vector fields are copies so they share values, but not referance.
sourceSubzero.deform_floe!
— Methoddeform_floe!(
floe,
deformer_poly,
deforming_forces,
-)
Deform a floe around the area of its collision with largest area overlap within the last timestep. Inputs: floe <Floe> floe to deform deformercoords <PolyVec> coords of floe that is deforming floe argument deformingforces <Vector{AbstractFloat}> 1x2 matrix of forces between floe and the deforming floe from floe's interactions - of the form: [xforce yforce] Outputs: None. The input floe's centroid, coordinates, and area are updated to reflect a deformation due to the collision with the deforming floe.
sourceSubzero.determine_fractures
— Methoddetermine_fractures(
+)
Deform a floe around the area of its collision with largest area overlap within the last timestep. Inputs: floe <Floe> floe to deform deformercoords <PolyVec> coords of floe that is deforming floe argument deformingforces <Vector{AbstractFloat}> 1x2 matrix of forces between floe and the deforming floe from floe's interactions - of the form: [xforce yforce] Outputs: None. The input floe's centroid, coordinates, and area are updated to reflect a deformation due to the collision with the deforming floe.
sourceSubzero.determine_fractures
— Methoddetermine_fractures(
floes,
criteria,
min_floe_area,
-)
Determines which floes will fracture depending on the principal stress criteria. Inputs: floes <StructArray{Floe}> model's list of floes criteria <AbstractFractureCriteria> fracture criteria floe_settings <FloeSettings> Floe settings. Contains Floe properties and stress calculator. Outputs: <Vector{Int}> list of indices of floes to fracture
sourceSubzero.dissolve_floe!
— Methoddissolve_floe(floe, grid, dissolved)
Dissolve given floe into dissolved ocean matrix. Inputs: floe <Union{Floe, LazyRow{Floe}}> single floe grid <RegRectilinearGrid> model's grid domain <Domain> model's domain dissolved <Matrix{AbstractFloat}> ocean's dissolved field Outputs: None. Update dissolved matrix with given floe's mass and mark floe for removal.
sourceSubzero.domain_in_grid
— Methoddomain_in_grid(domain, grid)
Checks if given rectangular domain is within given grid and gives user a warning if domain is not of maximum possible size given grid dimensions. Inputs: domain <RectangularDomain> grid <AbstractGrid> Outputs: <Boolean> true if domain is within grid bounds, else false
sourceSubzero.euclidian_dist
— Methodeuclidian_dist(c, idx2, idx1)
Calculate euclidean distance between two points within given coordinates
sourceSubzero.find_center_cell_index
— Methodfind_center_cell_index(xp, yp, grid::RegRectilinearGrid)
Find index of the cell centered on grid lines of the given RegRectilinearGrid that the given x-coordinate and y-coordinate falls within. This cell is centered around the grid lines, so it is a shifted grid cell by half a cell. Method depends on grid being a regular rectilinear grid. Inputs: xp <AbstractFloat> x-coordinates of point yp <AbstractFloat> y-coordinate of point grid <RegRectilinearGrid> simulation grid Outputs: xidx <AbstractFloat> x-index of grid cell (cented on grid lines) x-point is within - this is the column yidx <AbstractFloat> y-index of grid cell (cented on grid lines) y-point is within - this is the row Note: Points can be outside of the grid, so index can be less than 1 or greater than the number of grid lines in a given direction.
sourceSubzero.find_ghosts!
— Methodfind_ghosts!(
+)
Determines which floes will fracture depending on the principal stress criteria. Inputs: floes <StructArray{Floe}> model's list of floes criteria <AbstractFractureCriteria> fracture criteria floe_settings <FloeSettings> Floe settings. Contains Floe properties and stress calculator. Outputs: <Vector{Int}> list of indices of floes to fracture
sourceSubzero.dissolve_floe!
— Methoddissolve_floe(floe, grid, dissolved)
Dissolve given floe into dissolved ocean matrix. Inputs: floe <Union{Floe, LazyRow{Floe}}> single floe grid <RegRectilinearGrid> model's grid domain <Domain> model's domain dissolved <Matrix{AbstractFloat}> ocean's dissolved field Outputs: None. Update dissolved matrix with given floe's mass and mark floe for removal.
sourceSubzero.domain_in_grid
— Methoddomain_in_grid(domain, grid)
Checks if given rectangular domain is within given grid and gives user a warning if domain is not of maximum possible size given grid dimensions. Inputs: domain <RectangularDomain> grid <AbstractGrid> Outputs: <Boolean> true if domain is within grid bounds, else false
sourceSubzero.euclidian_dist
— Methodeuclidian_dist(c, idx2, idx1)
Calculate euclidean distance between two points within given coordinates
sourceSubzero.find_center_cell_index
— Methodfind_center_cell_index(xp, yp, grid::RegRectilinearGrid)
Find index of the cell centered on grid lines of the given RegRectilinearGrid that the given x-coordinate and y-coordinate falls within. This cell is centered around the grid lines, so it is a shifted grid cell by half a cell. Method depends on grid being a regular rectilinear grid. Inputs: xp <AbstractFloat> x-coordinates of point yp <AbstractFloat> y-coordinate of point grid <RegRectilinearGrid> simulation grid Outputs: xidx <AbstractFloat> x-index of grid cell (cented on grid lines) x-point is within - this is the column yidx <AbstractFloat> y-index of grid cell (cented on grid lines) y-point is within - this is the row Note: Points can be outside of the grid, so index can be less than 1 or greater than the number of grid lines in a given direction.
sourceSubzero.find_ghosts!
— Methodfind_ghosts!(
floes,
elem_idx,
ebound::PeriodicBoundary,
wbound::PeriodicBoundary,
-)
Find ghosts of given element and its known ghosts through an eastern or western periodic boundary. If element's centroid isn't within the domain in the east/west direction, swap it with its ghost since the ghost's centroid must then be within the domain. Inputs: floes <StructArray{Floe}> model's list of floes elem_idx <Int> floe of interest's index within the floe list eboundary <PeriodicBoundary{East, Float}> domain's eastern boundary wboundary <PeriodicBoundary{West, Float}> domain's western boundary Outputs: None. Ghosts added to the floe list. Primary floe always has centroid within the domain, else it is swapped with one of its ghost's which has a centroid within the domain.
sourceSubzero.find_ghosts!
— Methodfind_ghosts!(
+)
Find ghosts of given element and its known ghosts through an eastern or western periodic boundary. If element's centroid isn't within the domain in the east/west direction, swap it with its ghost since the ghost's centroid must then be within the domain. Inputs: floes <StructArray{Floe}> model's list of floes elem_idx <Int> floe of interest's index within the floe list eboundary <PeriodicBoundary{East, Float}> domain's eastern boundary wboundary <PeriodicBoundary{West, Float}> domain's western boundary Outputs: None. Ghosts added to the floe list. Primary floe always has centroid within the domain, else it is swapped with one of its ghost's which has a centroid within the domain.
sourceSubzero.find_ghosts!
— Methodfind_ghosts!(
floes,
elem_idx,
nbound::PeriodicBoundary{North, <:AbstractFloat},
sbound::PeriodicBoundary{South, <:AbstractFloat},
-)
Find ghosts of given element and its known ghosts through an northern or southern periodic boundary. If element's centroid isn't within the domain in the north/south direction, swap it with its ghost since the ghost's centroid must then be within the domain. Inputs: floes <StructArray{Floe}> model's list of floes elem_idx <Int> floe of interest's index within the floe list nboundary <PeriodicBoundary{North, Float}> domain's northern boundary sboundary <PeriodicBoundary{South, Float}> domain's southern boundary Outputs: None. Ghosts added to the floe list. Primary floe always has centroid within the domain, else it is swapped with one of its ghost's which has a centroid within the domain.
sourceSubzero.find_grid_cell_index
— Methodfind_grid_cell_index(xp, yp, grid::RegRectilinearGrid)
Find index of the grid cell of the given RegRectilinearGrid that the given x-coordinate and y-coordinate falls within. Method depends on grid being a regular rectilinear grid. Inputs: xp <AbstractFloat> x-coordinates of point yp <AbstractFloat> y-coordinate of point grid <RegRectilinearGrid> simulation grid Outputs: xidx <AbstractFloat> x-index of grid cell x-point is within - this is the column yidx <AbstractFloat> y-index of grid cell y-point is within - this is the row Note: Points can be outside of the grid, so index can be less than 1 or greater than the number of grid cells
sourceSubzero.find_interp_knots
— Methodfind_interp_knots(
+)
Find ghosts of given element and its known ghosts through an northern or southern periodic boundary. If element's centroid isn't within the domain in the north/south direction, swap it with its ghost since the ghost's centroid must then be within the domain. Inputs: floes <StructArray{Floe}> model's list of floes elem_idx <Int> floe of interest's index within the floe list nboundary <PeriodicBoundary{North, Float}> domain's northern boundary sboundary <PeriodicBoundary{South, Float}> domain's southern boundary Outputs: None. Ghosts added to the floe list. Primary floe always has centroid within the domain, else it is swapped with one of its ghost's which has a centroid within the domain.
sourceSubzero.find_grid_cell_index
— Methodfind_grid_cell_index(xp, yp, grid::RegRectilinearGrid)
Find index of the grid cell of the given RegRectilinearGrid that the given x-coordinate and y-coordinate falls within. Method depends on grid being a regular rectilinear grid. Inputs: xp <AbstractFloat> x-coordinates of point yp <AbstractFloat> y-coordinate of point grid <RegRectilinearGrid> simulation grid Outputs: xidx <AbstractFloat> x-index of grid cell x-point is within - this is the column yidx <AbstractFloat> y-index of grid cell y-point is within - this is the row Note: Points can be outside of the grid, so index can be less than 1 or greater than the number of grid cells
sourceSubzero.find_interp_knots
— Methodfind_interp_knots(
point_idx,
ncells,
L,
@@ -260,30 +262,30 @@
We assume that first grid line and the last grid line are the same, and have
the same values within the ocean/atmosphere. These are not repeated in the
knots, but rather only one is used. So if there are 10 grid lines, grid line
-1 and 10 are the equivalent and we use grid line 1 exclusively.
sourceSubzero.find_interp_knots
— Methodfind_interp_knots(
+1 and 10 are the equivalent and we use grid line 1 exclusively.
sourceSubzero.find_interp_knots
— Methodfind_interp_knots(
point_idx,
ncells,
L,
Δd::Int,
::NonPeriodicBoundary,
-)
Find indicies in list of grid lines that surround points with indicies 'pointidx' with a buffer of Δd indices on each side of the points. In this case, the points are being considered near a NON-periodic boundary, so we cut off the possible indices past the edge of the grid. Inputs: pointidx <Vector{Int}> vector of indices representing the grid line they are nearest ncells <Int> number of grid cells in given dimension glines <Vector or Range> grid line values L <AbstractFloat> length of grid in given dimension Δd <Int> number of buffer grid cells to include on either side of the provided indicies <PeriodicBoundary> dispatching on periodic boundary Outputs: knots <Vector{AbstractFloat}> interpolation knots - grid line values knot_idx <Vector{Int}> - indices of grid line values within grid list of grid lines. Note: Only knots within the grid will be returned since this is a non-periodic boundary.
sourceSubzero.find_poly_coords
— Methodfind_poly_coords(poly)
Syntactic sugar for to find a polygon's coordinates Input: poly <Polygon> Output: <PolyVec> representing the floe's coordinates xy plane
sourceSubzero.find_shared_edges_midpoint
— Methodfind_shared_edges_midpoint(c1, c2)
Find "midpoint" of shared polygon edges by distance Inputs: c1 <PolVec> polygon coordinates for floe 1 c2 <PolVec> polygon coordinates for floe 2 Outputs: midx <Float> x-coordinate of midpoint midy <Float> y-coordinate of midpoint
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(
+)
Find indicies in list of grid lines that surround points with indicies 'pointidx' with a buffer of Δd indices on each side of the points. In this case, the points are being considered near a NON-periodic boundary, so we cut off the possible indices past the edge of the grid. Inputs: pointidx <Vector{Int}> vector of indices representing the grid line they are nearest ncells <Int> number of grid cells in given dimension glines <Vector or Range> grid line values L <AbstractFloat> length of grid in given dimension Δd <Int> number of buffer grid cells to include on either side of the provided indicies <PeriodicBoundary> dispatching on periodic boundary Outputs: knots <Vector{AbstractFloat}> interpolation knots - grid line values knot_idx <Vector{Int}> - indices of grid line values within grid list of grid lines. Note: Only knots within the grid will be returned since this is a non-periodic boundary.
sourceSubzero.find_poly_coords
— Methodfind_poly_coords(poly)
Syntactic sugar for to find a polygon's coordinates Input: poly <Polygon> Output: <PolyVec> representing the floe's coordinates xy plane
sourceSubzero.find_shared_edges_midpoint
— Methodfind_shared_edges_midpoint(c1, c2)
Find "midpoint" of shared polygon edges by distance Inputs: c1 <PolVec> polygon coordinates for floe 1 c2 <PolVec> polygon coordinates for floe 2 Outputs: midx <Float> x-coordinate of midpoint midy <Float> y-coordinate of midpoint
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(
floe,
::PeriodicBoundary,
element_idx,
consts,
Δt,
-)
If a given floe intersects with a periodic boundary, nothing happens at this point. Periodic floes pass through boundaries using ghost floes. Inputs: None are used. Output: None. This function does not do anyting.
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(
+)
If a given floe intersects with a periodic boundary, nothing happens at this point. Periodic floes pass through boundaries using ghost floes. Inputs: None are used. Output: None. This function does not do anyting.
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(
floe,
element,
element_idx,
consts,
Δt,
-)
If floe intersects with given element (either collision boundary or topography element), floe interactions field and overarea field are updated. Inputs: floe <Floe> floe interacting with element element <Union{CollisionBoundary, TopographyElement}> coordinates of element consts <Constants> model constants needed for calculations Δt <Int> current simulation timestep max_overlap <Float> Percent a floe can overlap with a collision wall or topography before being killed/removed Outputs: None. If floe interacts, the floe's interactions field is updated with the details of each region of overlap. The interactions field will have the following form for each region of overlap with the element: [Inf, xforce, yforce, xfpoints, yfpoints, overlaps] where the xforce and yforce are the forces, xfpoints and yfpoints are the location of the force and overlaps is the overlap between the floe and element. The overlaps field is also added to the floe's overarea field that describes the total overlapping area at any timestep.
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(floe, boundary, _, _,)
If given floe insersects with an open boundary, the floe is set to be removed from the simulation. Inputs: floe <Floe> floe interacting with boundary boundary <OpenBoundary> coordinates of boundary _ <Constants> model constants needed in other methods of this function - not needed here _ <Int> current simulation timestep - not needed here - <Float> maximum overlap between floe and domain elements - not needed here Output: None. If floe is interacting with the boundary, floe's status is set to remove. Else, nothing is changed.
sourceSubzero.floe_domain_interaction!
— Methodfloe_domain_interaction!(
+)
If floe intersects with given element (either collision boundary or topography element), floe interactions field and overarea field are updated. Inputs: floe <Floe> floe interacting with element element <Union{CollisionBoundary, TopographyElement}> coordinates of element consts <Constants> model constants needed for calculations Δt <Int> current simulation timestep max_overlap <Float> Percent a floe can overlap with a collision wall or topography before being killed/removed Outputs: None. If floe interacts, the floe's interactions field is updated with the details of each region of overlap. The interactions field will have the following form for each region of overlap with the element: [Inf, xforce, yforce, xfpoints, yfpoints, overlaps] where the xforce and yforce are the forces, xfpoints and yfpoints are the location of the force and overlaps is the overlap between the floe and element. The overlaps field is also added to the floe's overarea field that describes the total overlapping area at any timestep.
sourceSubzero.floe_domain_element_interaction!
— Methodfloe_domain_element_interaction!(floe, boundary, _, _,)
If given floe insersects with an open boundary, the floe is set to be removed from the simulation. Inputs: floe <Floe> floe interacting with boundary boundary <OpenBoundary> coordinates of boundary _ <Constants> model constants needed in other methods of this function - not needed here _ <Int> current simulation timestep - not needed here - <Float> maximum overlap between floe and domain elements - not needed here Output: None. If floe is interacting with the boundary, floe's status is set to remove. Else, nothing is changed.
sourceSubzero.floe_domain_interaction!
— Methodfloe_domain_interaction!(
floe,
domain::DT,
consts,
max_overlap,
-)
If the floe interacts with the domain, update the floe accordingly. Dispatches on different boundary types within the domain. Inputs: floe <Floe> floe interacting with boundary domain <Domain> model domain consts <Constants> model constants needed for calculations Δt <Int> current simulation timestep max_overlap <Float> Percent a floe can overlap with a collision wall or topography before being killed/removed Outputs: None. Floe is updated according to which boundaries it interacts with and the types of those boundaries.
sourceSubzero.floe_domain_raft!
— Methodfloe_domain_raft!(
+)
If the floe interacts with the domain, update the floe accordingly. Dispatches on different boundary types within the domain. Inputs: floe <Floe> floe interacting with boundary domain <Domain> model domain consts <Constants> model constants needed for calculations Δt <Int> current simulation timestep max_overlap <Float> Percent a floe can overlap with a collision wall or topography before being killed/removed Outputs: None. Floe is updated according to which boundaries it interacts with and the types of those boundaries.
sourceSubzero.floe_domain_raft!
— Methodfloe_domain_raft!(
floes,
idx1,
domain_element,
@@ -295,7 +297,7 @@
simp_settings,
Δt
rng,
-)
Raft a floe against a boundary or a topography element and return any excess floes created by the rafting. This is equivalent to ridging. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe domainelement <AbstractDomainElement> boundary or topography element piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simp_settings <SimplificationSettings> simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: floe1 is updated with new shape. If any new floes are created by rafting they are returned, else nothing.
sourceSubzero.floe_domain_ridge!
— Methodfloe_domain_ridge!(
+)
Raft a floe against a boundary or a topography element and return any excess floes created by the rafting. This is equivalent to ridging. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe domainelement <AbstractDomainElement> boundary or topography element piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simp_settings <SimplificationSettings> simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: floe1 is updated with new shape. If any new floes are created by rafting they are returned, else nothing.
sourceSubzero.floe_domain_ridge!
— Methodfloe_domain_ridge!(
floes,
idx,
domain_element,
@@ -307,7 +309,7 @@
simp_settings,
Δt,
rng,
-)
Ridge a floe against a boundary or a topography element and return any excess floes created by the ridging. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe domainelement <AbstractDomainElement> boundary or topography element piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's settings for ridge/raft floesettings <FloeSettings> simulation's settings for making floes simp_settings <SimplificationSettings> simulation's settings for simplification Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: floe1 is updated with new shape. Return maximum floe id of floes created
sourceSubzero.floe_floe_interaction!
— Methodfloe_floe_interaction!(
+)
Ridge a floe against a boundary or a topography element and return any excess floes created by the ridging. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe domainelement <AbstractDomainElement> boundary or topography element piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's settings for ridge/raft floesettings <FloeSettings> simulation's settings for making floes simp_settings <SimplificationSettings> simulation's settings for simplification Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: floe1 is updated with new shape. Return maximum floe id of floes created
sourceSubzero.floe_floe_interaction!
— Methodfloe_floe_interaction!(
ifloe,
i,
jfloe,
@@ -315,7 +317,7 @@
nfloes,
consts,
Δt,
-)
If the two floes interact, update floe i's interactions accordingly. Floe j is not update here so that the function can be parallelized. Inputs: ifloe <Floe> first floe in potential interaction i <Int> index of ifloe in model's list of floes jfloe <Floe> second floe in potential interaction j <Int> index of jfloe in model's list of floes nfloes <Int> number of non-ghost floes in the simulation this timestep consts <Constants> model constants needed for calculations Δt <Int> Simulation's current timestep maxoverlap <Float> Percent two floes can overlap before marking them for fusion Outputs: None. Updates floes interactions fields. If floes overlap by more than the maxoverlap fraction, they will be marked for fusion. Note: If ifloe interacts with jfloe, only ifloe's interactions field is updated with the details of each region of overlap. The interactions field will have the following form for each region of overlap with the boundary: [Inf, xforce, yforce, xfpoints, yfpoints, overlaps] where the xforce and yforce are the forces, xfpoints and yfpoints are the location of the force and overlaps is the overlap between the floe and boundary. The overlaps field is also added to the floe's overarea field that describes the total overlapping area at any timestep.
sourceSubzero.floe_floe_raft!
— Methodfloe_floe_raft!(
+)
If the two floes interact, update floe i's interactions accordingly. Floe j is not update here so that the function can be parallelized. Inputs: ifloe <Floe> first floe in potential interaction i <Int> index of ifloe in model's list of floes jfloe <Floe> second floe in potential interaction j <Int> index of jfloe in model's list of floes nfloes <Int> number of non-ghost floes in the simulation this timestep consts <Constants> model constants needed for calculations Δt <Int> Simulation's current timestep maxoverlap <Float> Percent two floes can overlap before marking them for fusion Outputs: None. Updates floes interactions fields. If floes overlap by more than the maxoverlap fraction, they will be marked for fusion. Note: If ifloe interacts with jfloe, only ifloe's interactions field is updated with the details of each region of overlap. The interactions field will have the following form for each region of overlap with the boundary: [Inf, xforce, yforce, xfpoints, yfpoints, overlaps] where the xforce and yforce are the forces, xfpoints and yfpoints are the location of the force and overlaps is the overlap between the floe and boundary. The overlaps field is also added to the floe's overarea field that describes the total overlapping area at any timestep.
sourceSubzero.floe_floe_raft!
— Methodfloe_floe_raft!(
floes,
idx1,
idx2,
@@ -327,7 +329,7 @@
simp_settings,
Δt,
rng,
-)
Raft two floes, updating both in-place and returning any new floes that resulting from the rafting event. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe idx2 <Int> index of second floe piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's ridge/raft settings floesettings <FloeSettings> simultion's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: Updates floe1 and floe2 and returns any new floes created by rafting
sourceSubzero.floe_floe_ridge!
— Methodfloe_floe_ridge!(
+)
Raft two floes, updating both in-place and returning any new floes that resulting from the rafting event. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe idx2 <Int> index of second floe piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's ridge/raft settings floesettings <FloeSettings> simultion's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: Updates floe1 and floe2 and returns any new floes created by rafting
sourceSubzero.floe_floe_ridge!
— Methodfloe_floe_ridge!(
floes,
idx1,
idx2,
@@ -337,7 +339,7 @@
simp_settings,
Δt,
rng
-)
Ridge two floes, updating both in-place and returning any new floes that resulting from the ridging event. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe idx2 <Int> index of second floe piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's settings for ridging and rafting floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: Updates floe1 and floe2 and returns any new floes created by ridging
sourceSubzero.floe_to_grid_info!
— Methodfloe_to_grid_info!(
+)
Ridge two floes, updating both in-place and returning any new floes that resulting from the ridging event. Inputs: floes <StructArray{Floe}> floe list idx1 <Int> index of first floe idx2 <Int> index of second floe piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's settings for ridging and rafting floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings Δt <Int> simulation timestep in seconds rng <RandomNumberGenerator> simulation's random number generator Outputs: Updates floe1 and floe2 and returns any new floes created by ridging
sourceSubzero.floe_to_grid_info!
— Methodfloe_to_grid_info!(
floeidx,
xidx,
yidx,
@@ -346,80 +348,80 @@
grid,
domain,
scells,
-)
Add force from the ice on ocean to ocean force fields (fx & fy) for each grid cell and update ocean sea ice area fraction (siarea), representing total area of sea ice in a given cell. Function is called for each monte carlo point. Inputs: floeidx <Int> index of floe within model's floe array xidx <Int> grid x index that floe's point is within for grid centered on grid lines yidx <Int> grid column that floe's point is within for grid centered on grid lines τxocn <AbstractFloat> x-stress caused by ocean on point τyocn <AbstractFloat> y-stress caused by ocean on point grid <AbstractGrid> model's grid domain <Domain> model's domain cellfloes <Matrix{CellFloes}> matrix of CellFloes, one for each grid cell scells <Matrix{IceStressCell}> matrix of IceStressCells, one for each grid cell coupling_settings <CouplingSettings> simulation's coupling settings
sourceSubzero.fracture_floes!
— Methodfracture_floes!(
+)
Add force from the ice on ocean to ocean force fields (fx & fy) for each grid cell and update ocean sea ice area fraction (siarea), representing total area of sea ice in a given cell. Function is called for each monte carlo point. Inputs: floeidx <Int> index of floe within model's floe array xidx <Int> grid x index that floe's point is within for grid centered on grid lines yidx <Int> grid column that floe's point is within for grid centered on grid lines τxocn <AbstractFloat> x-stress caused by ocean on point τyocn <AbstractFloat> y-stress caused by ocean on point grid <AbstractGrid> model's grid domain <Domain> model's domain cellfloes <Matrix{CellFloes}> matrix of CellFloes, one for each grid cell scells <Matrix{IceStressCell}> matrix of IceStressCells, one for each grid cell coupling_settings <CouplingSettings> simulation's coupling settings
sourceSubzero.fracture_floes!
— Methodfracture_floes!(
floes,
max_floe_id,
rng,
fracture_settings,
floe_settings,
Δt,
-)
Fractures floes that meet the criteria defined in the fracture settings. Inputs: floes <StructArray{Floe}> model's list of floes maxfloeid <Int> maximum ID of any floe created so far in simulation rng <RNG> random number generator fracturesettings <FractureSettings> sim's fracture settings floesettings <FloeSettings> sim's settings to make floes Δtout <Int> length of simulation timestep in seconds Outputs: maxfloeid <Int> new highest floe ID after adding new floes to floe array. Floe pieces added to floe array and original fractured floes removed.
sourceSubzero.fuse_floes!
— Methodfuse_floes!(
+)
Fractures floes that meet the criteria defined in the fracture settings. Inputs: floes <StructArray{Floe}> model's list of floes maxfloeid <Int> maximum ID of any floe created so far in simulation rng <RNG> random number generator fracturesettings <FractureSettings> sim's fracture settings floesettings <FloeSettings> sim's settings to make floes Δtout <Int> length of simulation timestep in seconds Outputs: maxfloeid <Int> new highest floe ID after adding new floes to floe array. Floe pieces added to floe array and original fractured floes removed.
sourceSubzero.fuse_floes!
— Methodfuse_floes!(
floes,
max_floe_id,
floe_settings,
Δt,
rng,
-)
Fuse all floes marked for fusion. Inputs: floes <StructArray{Floe}> model's floes maxfloeid <Int> maximum floe ID created yet floe_settings <FloeSettings> simulation's settings for making floes Δt <Int> simulation timestep in seconds rng <RNG> random number generator Outputs: None. Fuses floes marked for fusion. Marks floes fused into another floe for removal.
sourceSubzero.fuse_two_floes!
— Methodfuse_two_floes!(
+)
Fuse all floes marked for fusion. Inputs: floes <StructArray{Floe}> model's floes maxfloeid <Int> maximum floe ID created yet floe_settings <FloeSettings> simulation's settings for making floes Δt <Int> simulation timestep in seconds rng <RNG> random number generator Outputs: None. Fuses floes marked for fusion. Marks floes fused into another floe for removal.
sourceSubzero.fuse_two_floes!
— Methodfuse_two_floes!(
keep_floe,
remove_floe,
Δt,
floe_settings,
max_floe_id,
rng,
-)
Fuses two floes together if they intersect and replaces the larger of the two floes with their union. Mass and momentum are conserved. Inputs: keepfloe <Union{Floe, LazyRow{Floe}}> first floe removefloe <Union{Floe, LazyRow{Floe}}> second floe floesettings <FloeSettings> simulation's settings to make new floes prefusemaxfloeid <Int> maximum floe ID used yet in simulation rng <RNG> random number generator Outputs: If floes are not intersecting, no changes. If intersecing, the fused floe replaces the larger of the two floes and the smaller floe is marked for removal. Note that the smaller floe's ID is NOT updated!
sourceSubzero.generate_subfloe_points
— Methodgenerate_subfloe_points(
+)
Fuses two floes together if they intersect and replaces the larger of the two floes with their union. Mass and momentum are conserved. Inputs: keepfloe <Union{Floe, LazyRow{Floe}}> first floe removefloe <Union{Floe, LazyRow{Floe}}> second floe floesettings <FloeSettings> simulation's settings to make new floes prefusemaxfloeid <Int> maximum floe ID used yet in simulation rng <RNG> random number generator Outputs: If floes are not intersecting, no changes. If intersecing, the fused floe replaces the larger of the two floes and the smaller floe is marked for removal. Note that the smaller floe's ID is NOT updated!
sourceSubzero.generate_subfloe_points
— Methodgenerate_subfloe_points(
point_generator
poly,
centroid,
area,
status,
rng
-)
Generate monte carlo points centered on the origin within the floe according to parameters defined in the pointgenerator argument. Inputs: pointgenerator <MonteCarloPointsGenerator> monte carlo point generator poly <Polygon> Polygon representing floe shape centroid <Matrix> floe's centroid area <AbstractFloat> floe's area status <Status> floe status (i.e. active, fuse in simulation) rng <AbstractRNG> random number generator to generate monte carlo points Ouputs: xsubfloe <Vector{FT}> vector of sub-floe grid points x-coords within floe ysubfloe <Vector{FT}> vector of sub-floe grid points y-coords within floe status <Status> floe's status post generation, changed to remove if generation is unsuccessful
sourceSubzero.generate_subfloe_points
— Methodgenerate_subfloe_points(
+)
Generate monte carlo points centered on the origin within the floe according to parameters defined in the pointgenerator argument. Inputs: pointgenerator <MonteCarloPointsGenerator> monte carlo point generator poly <Polygon> Polygon representing floe shape centroid <Matrix> floe's centroid area <AbstractFloat> floe's area status <Status> floe status (i.e. active, fuse in simulation) rng <AbstractRNG> random number generator to generate monte carlo points Ouputs: xsubfloe <Vector{FT}> vector of sub-floe grid points x-coords within floe ysubfloe <Vector{FT}> vector of sub-floe grid points y-coords within floe status <Status> floe's status post generation, changed to remove if generation is unsuccessful
sourceSubzero.generate_subfloe_points
— Methodgenerate_subfloe_points(
point_generator,
poly,
centroid,
area,
status,
rng
-)
Generate evenly spaced points within given floe coordinates to be used for coupling. If only one point falls within the floe, return the floe's centroid. Inputs: pointgenerator <SubGridPointsGenerator> sub-grid point generator poly <Polygon> Polygon representing floe shape centroid <Matrix> floe's centroid area <AbstractFloat> floe's area status <Status> floe status (i.e. active, fuse in simulation) rng <AbstractRNG> random number generator is not used in this generation method Ouputs: xsubfloe <Vector{FT}> vector of sub-floe grid points x-coords within floe ysub_floe <Vector{FT}> vector of sub-floe grid points y-coords within floe status <Status> tag isn't changed with this generation method
sourceSubzero.generate_voronoi_coords
— Methodgenerate_voronoi_coords(
+)
Generate evenly spaced points within given floe coordinates to be used for coupling. If only one point falls within the floe, return the floe's centroid. Inputs: pointgenerator <SubGridPointsGenerator> sub-grid point generator poly <Polygon> Polygon representing floe shape centroid <Matrix> floe's centroid area <AbstractFloat> floe's area status <Status> floe status (i.e. active, fuse in simulation) rng <AbstractRNG> random number generator is not used in this generation method Ouputs: xsubfloe <Vector{FT}> vector of sub-floe grid points x-coords within floe ysub_floe <Vector{FT}> vector of sub-floe grid points y-coords within floe status <Status> tag isn't changed with this generation method
sourceSubzero.generate_voronoi_coords
— Methodgenerate_voronoi_coords(
desired_points,
scale_fac,
trans_vec,
domain_coords,
rng;
max_tries = 10,
-)
Generate voronoi coords within a bounding box defined by its lower left corner and its height and width. Attempt to generate npieces
cells within the box. Inputs: desiredpoints <Int> desired number of voronoi cells scalefac <Vector{AbstractFloat}> width and height of bounding box - formatted as [w, h] transvec <Vector{AbstractFloat}> lower left corner of bounding box - formatted as [x, y] domaincoords <Vector{PolyVec{AbstractFloat}}> multipolygon that will eventually be filled with/intersected with the voronoi cells - such as topography rng <RNG> random number generator to generate voronoi cells mintowarn <Int> minimum number of points to warn if not generated to seed voronoi maxtries <Int> number of tires to generate desired number of points within domaincoords to seed voronoi cell creation Outputs: coords <Vector{PolyVec{Float}}> vector of polygon coordinates generated by voronoi tesselation. These polygons all fall within the space defined by the domaincoords. If less polygons than minto_warn are generated, the user will be warned.
sourceSubzero.get_known_grid_outputs
— Methodget_known_grid_outputs()
Returns list of symbols that represent calculations available in calceulariangrid to average floe data.
sourceSubzero.get_velocity
— Methodget_velocity(
+)
Generate voronoi coords within a bounding box defined by its lower left corner and its height and width. Attempt to generate npieces
cells within the box. Inputs: desiredpoints <Int> desired number of voronoi cells scalefac <Vector{AbstractFloat}> width and height of bounding box - formatted as [w, h] transvec <Vector{AbstractFloat}> lower left corner of bounding box - formatted as [x, y] domaincoords <Vector{PolyVec{AbstractFloat}}> multipolygon that will eventually be filled with/intersected with the voronoi cells - such as topography rng <RNG> random number generator to generate voronoi cells mintowarn <Int> minimum number of points to warn if not generated to seed voronoi maxtries <Int> number of tires to generate desired number of points within domaincoords to seed voronoi cell creation Outputs: coords <Vector{PolyVec{Float}}> vector of polygon coordinates generated by voronoi tesselation. These polygons all fall within the space defined by the domaincoords. If less polygons than minto_warn are generated, the user will be warned.
sourceSubzero.get_known_grid_outputs
— Methodget_known_grid_outputs()
Returns list of symbols that represent calculations available in calceulariangrid to average floe data.
sourceSubzero.get_velocity
— Methodget_velocity(
element::AbstractDomainElement{FT},
x,
y,
-)
Get velocity, which is 0m/s by default, of a point on topography element or boundary.
sourceSubzero.get_velocity
— Methodget_velocity(
+)
Get velocity, which is 0m/s by default, of a point on topography element or boundary.
sourceSubzero.get_velocity
— Methodget_velocity(
floe,
x,
y,
-)
Get velocity of a point, assumed to be on given floe. Inputs: floe <Union{LazyRow{Floe}, Floe}> floe x <AbstractFloat> x-coordinate of point to find velocity at y <AbstractFloat> y-coordinate of point to find velocity at Outputs: u <AbstractFloat> u velocity at point (x, y) assuming it is on given floe v <AbstractFloat> v velocity at point (x, y) assuming it is on given floe
sourceSubzero.getattrs
— Methodgetattrs(output::FloeOutput)
Returns unit and comment attributes for each output type to be saved within output NetCDF file Input: output<FloeOutput> Output: <Tuple(String, String)> tuple of string units and comments to be saved to output NetCDF file
sourceSubzero.ghosts_on_bounds!
— Methodghosts_on_bounds(element, ghosts, boundary, trans_vec)
If the given element intersects with the boundary, add ghosts of the element and any of its existing ghosts. Inputs: floes <StructArray{Floe}> model's list of floes elemidx <Int> floe of interest's index within the floe list boundary <PeriodicBoundary> boundary to translate element through transvec <Matrix{Float}> 1x2 matrix of form [x y] to translate element through the boundary Outputs: Nothing. New ghosts created by the given element, or its current ghosts, are added to the floe list
sourceSubzero.grid_cell_index
— Methodgrid_cell_index(p, Δg, g0)
Find the index of given point's cartesian value (in either the x or y direction) within the simulation grid. Inputs: p <Real> point's cartesian value in either x or y direction Δg <Real> simulation grid's cell width or height g0 <Real> simulation grid's first grid line value in either x or y direction Output: Point's grid cell index within the simulation grid, as specified by the grid cell dimension and grid line starting value, in either the x or y direction
sourceSubzero.grid_line_index
— Methodgrid_line_index(p, Δg, g0)
Find the index of given point's cartesian value (in either the x or y direction) within grid with cells centered on simulation grid's grid lines. Thus these cells are shifted from simulation's grid cells by half of a grid cell to the left. Inputs: p <Real> point's cartesian value in either x or y direction Δg <Real> grid's cell width or height g0 <Real> grid's first grid line value in either x or y direction Output: Point's grid cell index within the shifted simulation grid, as specified by the grid cell dimension and grid line starting value, in either the x or y direction
sourceSubzero.grid_xc_index
— Methodgrid_xc_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's xc-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within xc-grid Note: This is equivalent fo the yc-grid
sourceSubzero.grid_xg_index
— Methodgrid_xg_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's xg-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within xg-grid
sourceSubzero.grid_yc_index
— Methodgrid_yc_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's yc-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within yc-grid Note: This is equivalent fo the xc-grid
sourceSubzero.grid_yg_index
— Methodgrid_yg_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's yg-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within yg-grid
sourceSubzero.grids_from_lines
— Methodgridsfromlines(xlines, ylines)
Creates x-grid and y-grid. Assume xlines has length n and ylines has length m. xgrid is the grid's xline vector repeated m times as rows in a mxn array and ygrid is the yline vector repeated n times as columns in a mxn vector. xlines and ylines are typically either xg and yg or xc and yc.
sourceSubzero.hashole
— Methodhashole(poly::Polys)
Determine if polygon has one or more holes Inputs: poly <Polygon> polygon Outputs: <Bool> true if there is a hole in the polygons, else false
sourceSubzero.hashole
— Methodhashole(coords::PolyVec{FT})
Determine if polygon coordinates have one or more holes Inputs: coords <PolyVec{Float}> Outputs: <Bool>
sourceSubzero.in_bounds
— Methodfunction in_bounds(
+)
Get velocity of a point, assumed to be on given floe. Inputs: floe <Union{LazyRow{Floe}, Floe}> floe x <AbstractFloat> x-coordinate of point to find velocity at y <AbstractFloat> y-coordinate of point to find velocity at Outputs: u <AbstractFloat> u velocity at point (x, y) assuming it is on given floe v <AbstractFloat> v velocity at point (x, y) assuming it is on given floe
sourceSubzero.getattrs
— Methodgetattrs(output::FloeOutput)
Returns unit and comment attributes for each output type to be saved within output NetCDF file Input: output<FloeOutput> Output: <Tuple(String, String)> tuple of string units and comments to be saved to output NetCDF file
sourceSubzero.ghosts_on_bounds!
— Methodghosts_on_bounds(element, ghosts, boundary, trans_vec)
If the given element intersects with the boundary, add ghosts of the element and any of its existing ghosts. Inputs: floes <StructArray{Floe}> model's list of floes elemidx <Int> floe of interest's index within the floe list boundary <PeriodicBoundary> boundary to translate element through transvec <Matrix{Float}> 1x2 matrix of form [x y] to translate element through the boundary Outputs: Nothing. New ghosts created by the given element, or its current ghosts, are added to the floe list
sourceSubzero.grid_cell_index
— Methodgrid_cell_index(p, Δg, g0)
Find the index of given point's cartesian value (in either the x or y direction) within the simulation grid. Inputs: p <Real> point's cartesian value in either x or y direction Δg <Real> simulation grid's cell width or height g0 <Real> simulation grid's first grid line value in either x or y direction Output: Point's grid cell index within the simulation grid, as specified by the grid cell dimension and grid line starting value, in either the x or y direction
sourceSubzero.grid_line_index
— Methodgrid_line_index(p, Δg, g0)
Find the index of given point's cartesian value (in either the x or y direction) within grid with cells centered on simulation grid's grid lines. Thus these cells are shifted from simulation's grid cells by half of a grid cell to the left. Inputs: p <Real> point's cartesian value in either x or y direction Δg <Real> grid's cell width or height g0 <Real> grid's first grid line value in either x or y direction Output: Point's grid cell index within the shifted simulation grid, as specified by the grid cell dimension and grid line starting value, in either the x or y direction
sourceSubzero.grid_xc_index
— Methodgrid_xc_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's xc-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within xc-grid Note: This is equivalent fo the yc-grid
sourceSubzero.grid_xg_index
— Methodgrid_xg_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's xg-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within xg-grid
sourceSubzero.grid_yc_index
— Methodgrid_yc_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's yc-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within yc-grid Note: This is equivalent fo the xc-grid
sourceSubzero.grid_yg_index
— Methodgrid_yg_index(xp, yp, grid::RegRectilinearGrid)
Find indices of given cartesian point within simulation's yg-grid. Inputs: xp <Real> point's x-cartesian value yp <Real> point's y-cartesian value grid <RegRectilinearGrid> simulation's grid Outputs: x index and y indices within yg-grid
sourceSubzero.grids_from_lines
— Methodgridsfromlines(xlines, ylines)
Creates x-grid and y-grid. Assume xlines has length n and ylines has length m. xgrid is the grid's xline vector repeated m times as rows in a mxn array and ygrid is the yline vector repeated n times as columns in a mxn vector. xlines and ylines are typically either xg and yg or xc and yc.
sourceSubzero.hashole
— Methodhashole(poly::Polys)
Determine if polygon has one or more holes Inputs: poly <Polygon> polygon Outputs: <Bool> true if there is a hole in the polygons, else false
sourceSubzero.hashole
— Methodhashole(coords::PolyVec{FT})
Determine if polygon coordinates have one or more holes Inputs: coords <PolyVec{Float}> Outputs: <Bool>
sourceSubzero.in_bounds
— Methodfunction in_bounds(
xr,
yr,
grid,
::PeriodicBoundary,
::PeriodicBoundary,
-)
With all periodic boundaries, all points are considered to be in-bounds. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::PeriodicBoundary> type of either north or south boundary - checking if periodic pair <::PeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true regardless of point values.
sourceSubzero.in_bounds
— Methodfunction in_bounds(
+)
With all periodic boundaries, all points are considered to be in-bounds. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::PeriodicBoundary> type of either north or south boundary - checking if periodic pair <::PeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true regardless of point values.
sourceSubzero.in_bounds
— Methodfunction in_bounds(
xr,
yr,
grid,
::PeriodicBoundary,
::NonPeriodicBoundary,
-)
With the east/west non-periodic boundaries, points outside of the grid in the x-direction are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::PeriodicBoundary> type of either north or south boundary - checking if periodic pair <::NonPeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if xr is within domain boundaries, and false otherwise.
sourceSubzero.in_bounds
— Methodfunction in_bounds(
+)
With the east/west non-periodic boundaries, points outside of the grid in the x-direction are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::PeriodicBoundary> type of either north or south boundary - checking if periodic pair <::NonPeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if xr is within domain boundaries, and false otherwise.
sourceSubzero.in_bounds
— Methodfunction in_bounds(
xr,
yr,
grid,
::NonPeriodicBoundary,
::PeriodicBoundary,
-)
With the north/south non-periodic boundaries, points outside of the grid in the y-direction are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::NonPeriodicBoundary> type of either north or south boundary - checking if periodic pair <::PeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if yr is within domain boundaries, and false otherwise.
sourceSubzero.in_bounds
— Methodin_bounds(
+)
With the north/south non-periodic boundaries, points outside of the grid in the y-direction are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::NonPeriodicBoundary> type of either north or south boundary - checking if periodic pair <::PeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if yr is within domain boundaries, and false otherwise.
sourceSubzero.in_bounds
— Methodin_bounds(
xr,
yr,
grid,
::NonPeriodicBoundary,
::NonPeriodicBoundary,
-)
With all non-periodic boundaries, points outside of the grid in both the x and y are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::NonPeriodicBoundary> type of either north or south boundary - checking if periodic pair <::NonPeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if both xr and yr are within domain boundaries, and false otherwise.
sourceSubzero.initialize_floe_field
— Methodinitialize_floe_field(args...)
A float type FT can be provided as the first argument of the initializefloefield constructor. A field of floes of type FT will be created by passing all other arguments to the correct method.
sourceSubzero.initialize_floe_field
— Methodinitialize_floe_field(args...)
If a type isn't specified, the field of Floes will each be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.initialize_jld2_file!
— Methodinitialize_jld2_file!(dir, filename, overwrite, outputs, jld2_kw)
Initializes a JLD2 file in the given directory with the given filename. Setup file to write given outputs. Inputs: dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists outputs <Vector{Symbol}> list of symbols to save as a group within the file jld2_kw list of JLD2 keywords for the jldopen function Outputs: Create JLD2 file dir/filename where each output is a group within the file
sourceSubzero.initialize_netcdf_file!
— Methodfunction initialize_netcdf_file!(
+)
With all non-periodic boundaries, points outside of the grid in both the x and y are defined to be out of bounds since these points can't be interpolated as we don't have any information on the ocean outside of the grid. Inputs: xr <AbstractFloat> point x-coordinate yr <AbstractFloat> point y-coordinate <::NonPeriodicBoundary> type of either north or south boundary - checking if periodic pair <::NonPeriodicBoundary> type of either east or west boundary - checking if periodic pair Output: Boolean that is true if both xr and yr are within domain boundaries, and false otherwise.
sourceSubzero.initialize_floe_field
— Methodinitialize_floe_field(args...)
A float type FT can be provided as the first argument of the initializefloefield constructor. A field of floes of type FT will be created by passing all other arguments to the correct method.
sourceSubzero.initialize_floe_field
— Methodinitialize_floe_field(args...)
If a type isn't specified, the field of Floes will each be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.initialize_jld2_file!
— Methodinitialize_jld2_file!(dir, filename, overwrite, outputs, jld2_kw)
Initializes a JLD2 file in the given directory with the given filename. Setup file to write given outputs. Inputs: dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists outputs <Vector{Symbol}> list of symbols to save as a group within the file jld2_kw list of JLD2 keywords for the jldopen function Outputs: Create JLD2 file dir/filename where each output is a group within the file
sourceSubzero.initialize_netcdf_file!
— Methodfunction initialize_netcdf_file!(
::Type{FT},
dir,
filename,
@@ -427,10 +429,10 @@
outputs,
xg,
yg,
-)
Initializes a NetCDF file in the given directory with the given filename. Setup file to write given outputs. Inputs: Type{FT} <Type{AbstractFloat}> type of float to run simulation calculations using dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists outputs <Vector{Symbol}> list of symbols to save as a group within the file xg <Vector{AbstractFloat}> list of x grid lines yg <Vector{AbstractFloat}> list of y grid lines Outputs: Create NetCDF file dir/filename with each output added as a variable and with the dimensions time, x, and y.
sourceSubzero.initialize_topography_field
— Methodinitialize_topography_field(args...)
If a type isn't specified, the list of TopographyElements will each be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.initialize_topography_field
— Methodinitialize_topography_field(
+)
Initializes a NetCDF file in the given directory with the given filename. Setup file to write given outputs. Inputs: Type{FT} <Type{AbstractFloat}> type of float to run simulation calculations using dir <String> path to directory filename <String> filename to save file to overwrite <Bool> if true, exit file of the same name will be deleted, else an error will be thrown if other file exists outputs <Vector{Symbol}> list of symbols to save as a group within the file xg <Vector{AbstractFloat}> list of x grid lines yg <Vector{AbstractFloat}> list of y grid lines Outputs: Create NetCDF file dir/filename with each output added as a variable and with the dimensions time, x, and y.
sourceSubzero.initialize_topography_field
— Methodinitialize_topography_field(args...)
If a type isn't specified, the list of TopographyElements will each be of type Float64 and the correct constructor will be called with all other arguments.
sourceSubzero.initialize_topography_field
— Methodinitialize_topography_field(
::Type{FT},
coords,
-)
Create a field of topography from a list of polygon coordiantes. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type coords <Vector{PolyVec}> list of polygon coords to make into floes Outputs: topo_arr <StructArray{TopographyElement}> list of topography elements created from given polygon coordinates
sourceSubzero.intersect_polys
— Methodintersect_polys(p1, p2)
Intersect two geometries and return a list of polygons resulting. Inputs: p1 <AbstractGeometry> p2 <AbstractGeometry> Output: Vector of Polygons
sourceSubzero.level_to_string
— Methodlevel_to_string(level)
Returns string with log event name given log event level
sourceSubzero.mc_interpolation
— Methodmc_interpolation(
+)
Create a field of topography from a list of polygon coordiantes. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type coords <Vector{PolyVec}> list of polygon coords to make into floes Outputs: topo_arr <StructArray{TopographyElement}> list of topography elements created from given polygon coordinates
sourceSubzero.intersect_polys
— Methodintersect_polys(p1, p2)
Intersect two geometries and return a list of polygons resulting. Inputs: p1 <AbstractGeometry> p2 <AbstractGeometry> Output: Vector of Polygons
sourceSubzero.level_to_string
— Methodlevel_to_string(level)
Returns string with log event name given log event level
sourceSubzero.mc_interpolation
— Methodmc_interpolation(
mc_cart,
mc_grid_idx,
grid,
@@ -438,27 +440,27 @@
atmos,
ocean,
coupling_settings,
-)
Create and returns interpolation objects for atmosphere u and v velocities, and ocean u and v velocities, in addition to ocean's heatflux factor. Inputs: npoints <Int> number of monte carlo points to consider - the number of rows to use in mccart and mcgrididx mccart <Matrix{AbstractFloat}> cartesian coordinates for model coordinates - nx2 matrix of monte carlo coordinates where first column is the x-coords and the second column is the y-coords mcgrididx <Matrix{Int}> index of monte carlo points within the grid - nx2 matrix of indices where the first column is the grid column index and the second column is the grid row index for cells centered on grid lines grid <AbstractGrid> model grid domain <Domain> model domain atmos <Atmos> model atmosphere ocean <Ocean> model ocean couplingsettings <CouplingSettings> simulation's coupling settings Outputs: uatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere u velocity onto point vatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere v velocity onto point uocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean u velocity onto point vocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean v velocity onto point hflxinterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean heatflux factor velocity onto point
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
+)
Create and returns interpolation objects for atmosphere u and v velocities, and ocean u and v velocities, in addition to ocean's heatflux factor. Inputs: npoints <Int> number of monte carlo points to consider - the number of rows to use in mccart and mcgrididx mccart <Matrix{AbstractFloat}> cartesian coordinates for model coordinates - nx2 matrix of monte carlo coordinates where first column is the x-coords and the second column is the y-coords mcgrididx <Matrix{Int}> index of monte carlo points within the grid - nx2 matrix of indices where the first column is the grid column index and the second column is the grid row index for cells centered on grid lines grid <AbstractGrid> model grid domain <Domain> model domain atmos <Atmos> model atmosphere ocean <Ocean> model ocean couplingsettings <CouplingSettings> simulation's coupling settings Outputs: uatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere u velocity onto point vatminterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the atompshere v velocity onto point uocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean u velocity onto point vocninterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean v velocity onto point hflxinterp <Interplations object> linear interpolation function from Interpolations.jl that takes in two arguments (x, y) and interpolates the ocean heatflux factor velocity onto point
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
forces,
fpoints,
::TopographyElement,
-)
No forces should be zero-ed out in collidions with topography elements. Inputs: None used. Outputs: None.
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
+)
No forces should be zero-ed out in collidions with topography elements. Inputs: None used. Outputs: None.
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
forces,
fpoints,
boundary::AbstractBoundary{East, <:AbstractFloat},
-)
Zero-out forces that point in direction not perpendicular to East boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
+)
Zero-out forces that point in direction not perpendicular to East boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
forces,
fpoints,
boundary::AbstractBoundary{North, <:AbstractFloat},
-)
Zero-out forces that point in direction not perpendicular to North boundary wall. Inputs: force <Array{Float, n, 2}> normal forces on each of the n regions greater than a minimum area fpoint <Array{Float, n, 2}> point force is applied on each of the n regions greater than a minimum area boundary <AbstractBoundary{North, <:AbstractFloat}> domain's northern boundary Outputs: None. All forces in the x direction set to 0 if the point the force is applied to is in the northern boundary.
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
+)
Zero-out forces that point in direction not perpendicular to North boundary wall. Inputs: force <Array{Float, n, 2}> normal forces on each of the n regions greater than a minimum area fpoint <Array{Float, n, 2}> point force is applied on each of the n regions greater than a minimum area boundary <AbstractBoundary{North, <:AbstractFloat}> domain's northern boundary Outputs: None. All forces in the x direction set to 0 if the point the force is applied to is in the northern boundary.
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
forces,
fpoints,
boundary::AbstractBoundary{South, <:AbstractFloat},
-)
Zero-out forces that point in direction not perpendicular to South boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
+)
Zero-out forces that point in direction not perpendicular to South boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.normal_direction_correct!
— Methodnormal_direction_correct!(
forces,
fpoints,
boundary::AbstractBoundary{<:AbstractFloat, West},
-)
Zero-out forces that point in direction not perpendicular to West boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.periodic_compat
— Methodperiodic_compat(b1, b2)
Checks if two boundaries are compatible as a periodic pair. This is true if they are both periodic, or if neither are periodic. Otherwise, it is false.
sourceSubzero.plot_conservation
— Methodplot_conservation(
+)
Zero-out forces that point in direction not perpendicular to West boundary wall. See normaldirectioncorrect! on northern wall for more information
sourceSubzero.periodic_compat
— Methodperiodic_compat(b1, b2)
Checks if two boundaries are compatible as a periodic pair. This is true if they are both periodic, or if neither are periodic. Otherwise, it is false.
sourceSubzero.plot_conservation
— Methodplot_conservation(
linear_energy,
rotational_energy,
linear_x_momentum,
@@ -466,7 +468,7 @@
angular_spin_momentum,
angular_orbital_momentum,
dir,
-)
Takes in vectors of energy and momentum at each simulation timestep and plots conservation over time. Plots are saved to given directory. Also prints total change in both kinetic energy and momentum from beginning to end of simulation to terminal. Inputs: linearenergy <Vector{Real}> list of total energy from x and y motion per timestep rotationalenergy <Vector{Real}> list of total energy from rotational motion per timestep linearxmomentum <Vector{Real}> list of total momentum from x motion per timestep linearymomentum <Vector{Real}> list of total momentum from y motion per timestep angularspinmomentum <Vector{Real}> list of total momentum from floes spinning around their own center of masses per timestep angularorbitalmomentum <Vector{Real}> list of total momentum from floes spinning around origin per timestep dir <String> directory to save images to Outputs: Δenergy <Float> % change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory
sourceSubzero.poly_to_floes!
— Methodpoly_to_floes!(
+)
Takes in vectors of energy and momentum at each simulation timestep and plots conservation over time. Plots are saved to given directory. Also prints total change in both kinetic energy and momentum from beginning to end of simulation to terminal. Inputs: linearenergy <Vector{Real}> list of total energy from x and y motion per timestep rotationalenergy <Vector{Real}> list of total energy from rotational motion per timestep linearxmomentum <Vector{Real}> list of total momentum from x motion per timestep linearymomentum <Vector{Real}> list of total momentum from y motion per timestep angularspinmomentum <Vector{Real}> list of total momentum from floes spinning around their own center of masses per timestep angularorbitalmomentum <Vector{Real}> list of total momentum from floes spinning around origin per timestep dir <String> directory to save images to Outputs: Δenergy <Float> % change in energy from first to last timestep Δxmomentum <Float> % change in x momentum from first to last timestep Δymomentum <Float> % change in y momentum from first to last timestep Δangularmomentum <Float> % change in angular momentum from first to last timestep Also saves energy and momentum plots over time to given directory
sourceSubzero.poly_to_floes!
— Methodpoly_to_floes!(
::Type{FT},
floes,
poly,
@@ -476,12 +478,12 @@
floe_settings,
rng = Xoshiro(),
kwargs...
-)
Split a given polygon around any holes before turning each region with an area greater than the minimum floe area into a floe. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type floes <StructArray{Floe}> vector of floes to add new floes to poly <Polygon> polygons to turn into floes hmean <AbstratFloat> average floe height Δh <AbstratFloat> height range - floes will range in height from hmean - Δh to hmean + Δh rmax <AbstractFloat> maximum radius of floe (could be larger given context) floe_settings <FloeSettings> settings needed to initialize floe settings rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm kwargs... Any additional keywords to pass to floe constructor
sourceSubzero.potential_interaction
— Methodpotential_interaction(
+)
Split a given polygon around any holes before turning each region with an area greater than the minimum floe area into a floe. Inputs: Type{FT} <AbstractFloat> Type for grid's numberical fields - determines simulation run type floes <StructArray{Floe}> vector of floes to add new floes to poly <Polygon> polygons to turn into floes hmean <AbstratFloat> average floe height Δh <AbstratFloat> height range - floes will range in height from hmean - Δh to hmean + Δh rmax <AbstractFloat> maximum radius of floe (could be larger given context) floe_settings <FloeSettings> settings needed to initialize floe settings rng <RNG> random number generator to generate random floe attributes - default uses Xoshiro256++ algorithm kwargs... Any additional keywords to pass to floe constructor
sourceSubzero.potential_interaction
— Methodpotential_interaction(
centroid1,
centroid2,
rmax1,
rmax2,
-)
Determine if two floes could potentially interact using the two centroid and two radii to form a bounding circle. Inputs: centroid1 <Vector> first floe's centroid [x, y] centroid2 <Vector> second floe's centroid [x, y] rmax1 <Float> first floe's maximum radius rmax2 <Float> second floe's maximum radius Outputs: <Bool> true if floes could potentially interact, false otherwise
sourceSubzero.prettytime
— Methodprettytime(t)
Turn time in seconds into units of minutes, hours, days, or years as appropriate
Aguments:
t::Real
: number of seconds
Returns:
::String
: number of seconds converted to a string value in minutes, hours, days, or years with units
Note:
This code was modified from the this [source code](https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/src/trials.jl).
sourceSubzero.remove_floe_overlap!
— Methodremove_floe_overlap!(
+)
Determine if two floes could potentially interact using the two centroid and two radii to form a bounding circle. Inputs: centroid1 <Vector> first floe's centroid [x, y] centroid2 <Vector> second floe's centroid [x, y] rmax1 <Float> first floe's maximum radius rmax2 <Float> second floe's maximum radius Outputs: <Bool> true if floes could potentially interact, false otherwise
sourceSubzero.prettytime
— Methodprettytime(t)
Turn time in seconds into units of minutes, hours, days, or years as appropriate
Aguments:
t::Real
: number of seconds
Returns:
::String
: number of seconds converted to a string value in minutes, hours, days, or years with units
Note:
This code was modified from the this [source code](https://github.com/JuliaCI/BenchmarkTools.jl/blob/master/src/trials.jl).
sourceSubzero.remove_floe_overlap!
— Methodremove_floe_overlap!(
floes,
shrink_idx,
grow_floe_poly,
@@ -491,39 +493,39 @@
ridgeraft_settings,
floe_settings,
rng,
-)
Removes area/volume of overlap from floe that loses area during ridging/rafting Inputs: floes <StructArray{Floe}> list of floes shrinkidx <Int> index of floe that loses area growfloepoly <Polys> polygon of floe/domain that subsumes area piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings rng <AbstractRNG> random number generator Outputs: transfervol <Float> total volume to transfer away from floe maxfloeid <Int> maximum floe id of floe created during overlap removal floe_num <Int> total number of floes created from origianl floe -> one if floe doesn't break, more otherwise
sourceSubzero.remove_floes!
— Methodremove_floes!(
+)
Removes area/volume of overlap from floe that loses area during ridging/rafting Inputs: floes <StructArray{Floe}> list of floes shrinkidx <Int> index of floe that loses area growfloepoly <Polys> polygon of floe/domain that subsumes area piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes maxfloeid <Int> maximum floe ID before this ridging/rafting broken <Vector{Bool}> floe index is true if that floe has broken in a previous ridge/raft interaction ridgeraftsettings <RidgeRaftSettings> simulation's ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simulation's simplification settings rng <AbstractRNG> random number generator Outputs: transfervol <Float> total volume to transfer away from floe maxfloeid <Int> maximum floe id of floe created during overlap removal floe_num <Int> total number of floes created from origianl floe -> one if floe doesn't break, more otherwise
sourceSubzero.remove_floes!
— Methodremove_floes!(
floes,
grid,
domain,
dissolved,
floe_settings
-)
Remove floes marked for removal and dissolve floes smaller than minimum floe area if the dissolve setting is on. Inputs: floes <StructArray{Floe}> model's floes grid <AbstractGrid> model's grid domain <Domain> model's domain dissolved <Matrix{AbstractFloat}> ocean's dissolved field floe_settings <FloeSettings> simulation's settings for making floes Outputs: None. Removes floes that do not continue to the next timestep and reset all continuing floes status to active.
sourceSubzero.replace_floe!
— Methodreplace_floe!(
+)
Remove floes marked for removal and dissolve floes smaller than minimum floe area if the dissolve setting is on. Inputs: floes <StructArray{Floe}> model's floes grid <AbstractGrid> model's grid domain <Domain> model's domain dissolved <Matrix{AbstractFloat}> ocean's dissolved field floe_settings <FloeSettings> simulation's settings for making floes Outputs: None. Removes floes that do not continue to the next timestep and reset all continuing floes status to active.
sourceSubzero.replace_floe!
— Methodreplace_floe!(
floe::Union{Floe{FT}, LazyRow{Floe{FT}}},
new_poly,
new_mass,
floe_settings,
rng,
-)
Updates existing floe shape and related physical properties based of the polygon defining the floe. Inputs: floe <Union{Floe, LazyRow{Floe}}> floe to update newpoly <Polygon> polygon representing new outline of floe newmass <AbstractFloat> mass of floe floe_settings <FloeSettings> simulation's settings for making floes rng <RNG> random number generator Ouputs: Updates a given floe's physical properties given new shape and total mass.
sourceSubzero.restart!
— Methodrestart!(initial_state_fn, checkpointer_fn, new_nΔt, new_output_writers; start_tstep = 0)
Continue the simulation run started with the given initial state and floe file for an additional new_nΔt
timesteps and with the new outputwriters provided. The simulation will restart with a recorded timestep of `starttstep`.
Note that this restart!
function may not fit your needs and you may need to write your own. This function is meant to act as a simplest case and as a template for users to write their own restart functions.
sourceSubzero.rotate_radians!
— Methodrotate_radians!(coords::PolyVec, α)
Rotate a polygon's coordinates by α radians around the origin. Inputs: coords <PolyVec{AbstractFloat}> polygon coordinates α <Real> radians to rotate the coordinates Outputs: Updates coordinates in place
sourceSubzero.run!
— Methodrun!(sim; logger = nothing, messages_per_tstep = 1, start_tstep = 0)
Run given simulation and generate output for given writers. Simulation calculations will be done with Floats of type T (Float64 of Float32).
Inputs: sim <Simulation> simulation to Run logger <AbstractLogger> logger for simulation - default is Subzero logger messagespertstep <Int> number of messages to print per timestep if using default SubzeroLogger, else not needed start_tstep <Int> which timestep to start the simulation on Outputs: None. The simulation will be run and outputs will be saved in the output folder.
sourceSubzero.shift_cell_idx
— Methodshift_cell_idx(idx, nlines, ::PeriodicBoundary)
If index is greater than or equal to the grid lines, shift index to equivalent grid line on opposite side of grid due to periodic boundary. Similarly if given index is less than 1, shift index to equivalent grid line on opposite side of grid due to periodic boundary. Inputs: idx <Int> grid line index in either x or y nlines <Int> number of grid lines in model grid in either x or y direction <PeriodicBoundary> boundary pair is periodic Output: <Int> if given index is greater than or equal to number of grid lines, shift index. If given index is less than 1, shift grid index. For example, the last grid index, nlines, is equivalent to the 1st grid line. The nlines+1 grid line is equivalent to the 2nd grid line.
sourceSubzero.shift_cell_idx
— Methodshift_cell_idx(idx, nlines, ::NonPeriodicBoundary)
Return index as is given non-periodic boundary pair in either x or y direction. Inputs: idx <Int> grid line index in either x or y nlines <Int> number of grid lines in model grid in either x or y direction <NonPeriodicBoundary> boundary pair is non-periodic Ouput: idx <Int> as given. Can include the index nlines, unlike with the periodic case, which will use the first index instead.
sourceSubzero.simplify_floes!
— Methodsimplify_floes!(
+)
Updates existing floe shape and related physical properties based of the polygon defining the floe. Inputs: floe <Union{Floe, LazyRow{Floe}}> floe to update newpoly <Polygon> polygon representing new outline of floe newmass <AbstractFloat> mass of floe floe_settings <FloeSettings> simulation's settings for making floes rng <RNG> random number generator Ouputs: Updates a given floe's physical properties given new shape and total mass.
sourceSubzero.restart!
— Methodrestart!(initial_state_fn, checkpointer_fn, new_nΔt, new_output_writers; start_tstep = 0)
Continue the simulation run started with the given initial state and floe file for an additional new_nΔt
timesteps and with the new outputwriters provided. The simulation will restart with a recorded timestep of `starttstep`.
Note that this restart!
function may not fit your needs and you may need to write your own. This function is meant to act as a simplest case and as a template for users to write their own restart functions.
sourceSubzero.rotate_radians!
— Methodrotate_radians!(coords::PolyVec, α)
Rotate a polygon's coordinates by α radians around the origin. Inputs: coords <PolyVec{AbstractFloat}> polygon coordinates α <Real> radians to rotate the coordinates Outputs: Updates coordinates in place
sourceSubzero.run!
— Methodrun!(sim; logger = nothing, messages_per_tstep = 1, start_tstep = 0)
Run given simulation and generate output for given writers. Simulation calculations will be done with Floats of type T (Float64 of Float32).
Inputs: sim <Simulation> simulation to Run logger <AbstractLogger> logger for simulation - default is Subzero logger messagespertstep <Int> number of messages to print per timestep if using default SubzeroLogger, else not needed start_tstep <Int> which timestep to start the simulation on Outputs: None. The simulation will be run and outputs will be saved in the output folder.
sourceSubzero.shift_cell_idx
— Methodshift_cell_idx(idx, nlines, ::PeriodicBoundary)
If index is greater than or equal to the grid lines, shift index to equivalent grid line on opposite side of grid due to periodic boundary. Similarly if given index is less than 1, shift index to equivalent grid line on opposite side of grid due to periodic boundary. Inputs: idx <Int> grid line index in either x or y nlines <Int> number of grid lines in model grid in either x or y direction <PeriodicBoundary> boundary pair is periodic Output: <Int> if given index is greater than or equal to number of grid lines, shift index. If given index is less than 1, shift grid index. For example, the last grid index, nlines, is equivalent to the 1st grid line. The nlines+1 grid line is equivalent to the 2nd grid line.
sourceSubzero.shift_cell_idx
— Methodshift_cell_idx(idx, nlines, ::NonPeriodicBoundary)
Return index as is given non-periodic boundary pair in either x or y direction. Inputs: idx <Int> grid line index in either x or y nlines <Int> number of grid lines in model grid in either x or y direction <NonPeriodicBoundary> boundary pair is non-periodic Ouput: idx <Int> as given. Can include the index nlines, unlike with the periodic case, which will use the first index instead.
sourceSubzero.simplify_floes!
— Methodsimplify_floes!(
model,
simp_settings,
collision_settings,
floe_settings,
Δt,
rng,
-)
Simplify the floe list be smoothing vertices, fusing floes, dissolving floes, and removing floes as needed. Inputs: model <Model> model maxfloeid <Int> maximum floe id in simulation simpsettings <SimplificationSettings> simulation's simplification settings collisionsettings <CollisionSettings> simulation's collision settings floe_settings <FloeSettings> simulation's settings for making floes Δt <Int> simulation timestep in seconds rng <RNG> random number generator Outputs: Updates floe list and removes floe that won't continue to the next timestep
sourceSubzero.smooth_floes!
— Methodsmooth_floes!(
+)
Simplify the floe list be smoothing vertices, fusing floes, dissolving floes, and removing floes as needed. Inputs: model <Model> model maxfloeid <Int> maximum floe id in simulation simpsettings <SimplificationSettings> simulation's simplification settings collisionsettings <CollisionSettings> simulation's collision settings floe_settings <FloeSettings> simulation's settings for making floes Δt <Int> simulation timestep in seconds rng <RNG> random number generator Outputs: Updates floe list and removes floe that won't continue to the next timestep
sourceSubzero.smooth_floes!
— Methodsmooth_floes!(
floes,
topography,
simp_settings,
collision_settings,
Δt,
rng,
-)
Smooths floe coordinates for floes with more vertices than the maximum allowed number. Uses Ramer–Douglas–Peucker algorithm with a user-defined tolerance. If new shape causes overlap greater with another floe greater than the maximum percentage allowed, mark the two floes for fusion. Inputs: floes <StructArray{Floe}> model's floes topography <StructArray{TopographyElement}> domain's topography simpsettings <SimplificationSettings> simulation's simplification settings collisionsettings <CollisionSettings> simulation's collision settings Δt <Int> length of simulation timestep in seconds rng <RNG> random number generator for new monte carlo points
sourceSubzero.split_floe
— Methodsplit_floe(
+)
Smooths floe coordinates for floes with more vertices than the maximum allowed number. Uses Ramer–Douglas–Peucker algorithm with a user-defined tolerance. If new shape causes overlap greater with another floe greater than the maximum percentage allowed, mark the two floes for fusion. Inputs: floes <StructArray{Floe}> model's floes topography <StructArray{TopographyElement}> domain's topography simpsettings <SimplificationSettings> simulation's simplification settings collisionsettings <CollisionSettings> simulation's collision settings Δt <Int> length of simulation timestep in seconds rng <RNG> random number generator for new monte carlo points
sourceSubzero.split_floe
— Methodsplit_floe(
floe,
rng,
fracture_settings,
floe_settings,
Δt,
-)
Splits a given floe into pieces using voronoi tesselation. User will recieve a warning if floe isn't split. Inputs: floe <Floe> floe in simulation rng <RNG> random number generator used for voronoi tesselation fracturesettings <FractureSettings> simulation's fracture settings floesettings <FloeSettings> simulation's settings for making floes Δt <Int> length of simulation timesteps in seconds Outputs: new_floes <StructArray{Floes}> list of pieces floe is split into, each of which is a new floe
sourceSubzero.startup_sim
— Functionstartup_sim(sim)
Required actions to setup simulation. For example, setting up the simulation logger. Inputs: sim <Simulation> logger <AbstractLogger> logger for simulation - default is Subzero logger messagespertstep <Int> number of messages to print per timestep if using default SubzeroLogger, else not needed Outputs: None.
sourceSubzero.teardown_sim
— Methodteardown_sim(sim)
Required actions to tear down simulation. For example, flushing the simulation's logger and closing the stream. Inputs: sim <Simulation> Outputs: None.
sourceSubzero.timestep_collisions!
— Methodtimestep_collisions!(
+)
Splits a given floe into pieces using voronoi tesselation. User will recieve a warning if floe isn't split. Inputs: floe <Floe> floe in simulation rng <RNG> random number generator used for voronoi tesselation fracturesettings <FractureSettings> simulation's fracture settings floesettings <FloeSettings> simulation's settings for making floes Δt <Int> length of simulation timesteps in seconds Outputs: new_floes <StructArray{Floes}> list of pieces floe is split into, each of which is a new floe
sourceSubzero.startup_sim
— Functionstartup_sim(sim)
Required actions to setup simulation. For example, setting up the simulation logger. Inputs: sim <Simulation> logger <AbstractLogger> logger for simulation - default is Subzero logger messagespertstep <Int> number of messages to print per timestep if using default SubzeroLogger, else not needed Outputs: None.
sourceSubzero.teardown_sim
— Methodteardown_sim(sim)
Required actions to tear down simulation. For example, flushing the simulation's logger and closing the stream. Inputs: sim <Simulation> Outputs: None.
sourceSubzero.timestep_collisions!
— Methodtimestep_collisions!(
floes,
n_init_floes,
domain,
@@ -531,13 +533,13 @@
Δt,
collision_settings,
spinlock,
-)
Resolves collisions between pairs of floes and calculates the forces and torques caused by those collisions. Inputs: floes <StructArray{Floe}> model's list of floes ninitfloes <Int> number of floes without ghost floes domain <Domain> model's domain consts <Constants> simulation constants Δt <Int> length of simulation timestep in seconds collision_settings <CollisionSettings> simulation collision settings spinlock <Thread.SpinLock>
sourceSubzero.timestep_coupling!
— Methodtimestep_coupling!(
+)
Resolves collisions between pairs of floes and calculates the forces and torques caused by those collisions. Inputs: floes <StructArray{Floe}> model's list of floes ninitfloes <Int> number of floes without ghost floes domain <Domain> model's domain consts <Constants> simulation constants Δt <Int> length of simulation timestep in seconds collision_settings <CollisionSettings> simulation collision settings spinlock <Thread.SpinLock>
sourceSubzero.timestep_coupling!
— Methodtimestep_coupling!(
model,
Δt,
consts,
coupling_settings,
floe_settings,
-)
Calculates the effects of the ocean and atmosphere on the ice and the effects of the ice and atmosphere on the ocean if the coupling is two-way. Inputs: model <Model> model Δt <Int> length of timestep in seconds consts <Constants> constants used in simulation couplingsettings <CouplingSettings> settings for coupling floesettings <FloeSettings> settings for basic floe properties Outputs: None. Updates each floe's ocean/atmosphere forcings (fxOA, fyOA, torqueOA) and calculates stresses on each ocean grid cell from ice and atmosphere if two-way coupling is enabled in coupling_settings
sourceSubzero.timestep_floe_properties!
— Methodtimestep_floe(floe)
Update floe position and velocities using second-order time stepping with tendencies calculated at previous timesteps. Height, mass, stress, and strain also updated based on previous timestep thermodynamics and interactions with other floes. Input: floe <Floe> Δt <Int> simulation timestep in second floe_settings <FloeSettings> simulation floe settings Output: None. Floe's fields are updated with values.
sourceSubzero.timestep_ridging_rafting!
— Methodtimestep_ridging_rafting!(
+)
Calculates the effects of the ocean and atmosphere on the ice and the effects of the ice and atmosphere on the ocean if the coupling is two-way. Inputs: model <Model> model Δt <Int> length of timestep in seconds consts <Constants> constants used in simulation couplingsettings <CouplingSettings> settings for coupling floesettings <FloeSettings> settings for basic floe properties Outputs: None. Updates each floe's ocean/atmosphere forcings (fxOA, fyOA, torqueOA) and calculates stresses on each ocean grid cell from ice and atmosphere if two-way coupling is enabled in coupling_settings
sourceSubzero.timestep_floe_properties!
— Methodtimestep_floe(floe)
Update floe position and velocities using second-order time stepping with tendencies calculated at previous timesteps. Height, mass, stress, and strain also updated based on previous timestep thermodynamics and interactions with other floes. Input: floe <Floe> Δt <Int> simulation timestep in second floe_settings <FloeSettings> simulation floe settings Output: None. Floe's fields are updated with values.
sourceSubzero.timestep_ridging_rafting!
— Methodtimestep_ridging_rafting!(
floes,
pieces_buffer,
domain,
@@ -547,7 +549,7 @@
simp_settings,
Δt,
rng,
-)
Ridge and raft floes that meet probability and height criteria. Inputs: floes <StructArray{Floe}> simulation's list of floes piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes domain <Domain> simulation's domain maxfloeid <Int> maximum floe ID before this ridging/rafting ridgeraftsettings <RidgeRaftSettings> ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simplification settings Δt <Int> length of timestep in seconds rng <RandomNumberGenerator> simulation's rng Outputs: Updates floes post ridging and rafting and adds any new pieces to the pieces buffer to be made into new floes.
sourceSubzero.timestep_sim!
— Functiontimestepsim!(sim, tstep, starttstep)
Run one step of the simulation and write output. Inputs: sim <Simulation> simulation to advance tstep <Int> current timestep start_tstep <Int> timestep simulation started on Outputs: None. Simulation advances by one timestep.
sourceSubzero.timestep_welding!
— Methodtimestep_welding!(
+)
Ridge and raft floes that meet probability and height criteria. Inputs: floes <StructArray{Floe}> simulation's list of floes piecesbuffer <StructArray{Floe}> list of new floe pieces caused by breakage of floes domain <Domain> simulation's domain maxfloeid <Int> maximum floe ID before this ridging/rafting ridgeraftsettings <RidgeRaftSettings> ridge/raft settings floesettings <FloeSettings> simulation's settings for making floes simpsettings <SimplificationSettings> simplification settings Δt <Int> length of timestep in seconds rng <RandomNumberGenerator> simulation's rng Outputs: Updates floes post ridging and rafting and adds any new pieces to the pieces buffer to be made into new floes.
sourceSubzero.timestep_sim!
— Functiontimestepsim!(sim, tstep, starttstep)
Run one step of the simulation and write output. Inputs: sim <Simulation> simulation to advance tstep <Int> current timestep start_tstep <Int> timestep simulation started on Outputs: None. Simulation advances by one timestep.
sourceSubzero.timestep_welding!
— Methodtimestep_welding!(
floes,
max_floe_id,
grid,
@@ -558,10 +560,10 @@
floe_settings
Δt,
rng,
-)
Weld floes within sections of the domain that meet overlap and size criteria together, ensuring resulting floe doesn't surpass maximum floe area. Inputs: floes <StructArray{Floe}> simulation's list of floes maxfloeid <Int> maximum floe ID before this welding grid <RegRectilinearGrid> simulation's grid domain <Domain> simulation's domain Nx <Int> number of grid cells in the x-direction to split domain into for welding groups Ny <Int> number of grid cells in the y-direction to split domain into for welding groups weldsettings <WeldSettings> welding settings floesettings <FloeSettings> sim's settings for making new floes consts <Consts> simulation's constants Δt <Int> length of timestep in seconds rng <RandomNumberGenerator> simulation's rng Outputs: Returns nothing. Welds groups of floes together that meet requirments. Floes that are fused into other floes are marked for removal.
sourceSubzero.translate!
— Methodtranslate!(coords, Δx, Δy)
Translate each of the given coodinates by given deltas in place Inputs: coords PolyVec{Float} vec <Vector{Real}> Output: Updates given coords
sourceSubzero.translate
— Methodtranslate!(coords, Δx, Δy)
Make a copy of given coordinates and translate by given deltas. Inputs: coords PolyVec{Float} vec <Vector{Real}> Output: Updates given coords
sourceSubzero.update_boundaries!
— Methodupdate_boundaries!(domain)
Update each boundary in the domain. For now, this simply means moving compression boundaries by their velocities.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(args...)
No updates to boundaries that aren't compression boundaries.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(boundary, Δt)
Move East/West compression boundaries by given velocity. Update coords and val fields to reflect new position. Inputs: boundary <MovingBoundary{Union{East, West}, AbstractFloat}> domain compression boundary Δt <Int> number of seconds in a timestep Outputs: None. Move boundary East/West depending on velocity.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(boundary, Δt)
Move North/South compression boundaries by given velocity. Update coords and val fields to reflect new position. Inputs: boundary <MovingBoundary{Union{North, South}, AbstractFloat}> domain compression boundary Δt <Int> number of seconds in a timestep Outputs: None. Move boundary North or South depending on velocity.
sourceSubzero.update_criteria!
— Methodupdate_criteria!(::MohrsCone, floes)
Mohr's cone is not time or floe dependent so it doesn't need to be updates.
sourceSubzero.update_criteria!
— Methodupdate_criteria!(criteria::HiblerYieldCurve, floes)
Update the Hibler Yield Curve vertices based on the current set of floes. The criteria changes based off of the average height of the floes. Inputs: criteria <HiblerYieldCurve> simulation's fracture criteria floes <StructArray{Floe}> model's list of floes Outputs: None. Updates the criteria's vertices field to update new criteria.
sourceSubzero.update_ghost_timestep_vals!
— Methodupdate_ghost_timestep_vals!(floes, idx, parent_idx)
Update a parent floes and its ghosts to match velocities and accelerations at given index. Inputs: floes <StructArray{Floe}> list of floes in the simulation idx <Int> index of floe within floes list to copy to floe and ghosts parent_idx <Int> index of parent floe to update, along with its ghosts Outputs: Nothing. Update floe values.
sourceSubzero.update_new_rotation_conserve!
— Methodupdate_new_rotation_conserve!(
+)
Weld floes within sections of the domain that meet overlap and size criteria together, ensuring resulting floe doesn't surpass maximum floe area. Inputs: floes <StructArray{Floe}> simulation's list of floes maxfloeid <Int> maximum floe ID before this welding grid <RegRectilinearGrid> simulation's grid domain <Domain> simulation's domain Nx <Int> number of grid cells in the x-direction to split domain into for welding groups Ny <Int> number of grid cells in the y-direction to split domain into for welding groups weldsettings <WeldSettings> welding settings floesettings <FloeSettings> sim's settings for making new floes consts <Consts> simulation's constants Δt <Int> length of timestep in seconds rng <RandomNumberGenerator> simulation's rng Outputs: Returns nothing. Welds groups of floes together that meet requirments. Floes that are fused into other floes are marked for removal.
sourceSubzero.translate!
— Methodtranslate!(coords, Δx, Δy)
Translate each of the given coodinates by given deltas in place Inputs: coords PolyVec{Float} vec <Vector{Real}> Output: Updates given coords
sourceSubzero.translate
— Methodtranslate!(coords, Δx, Δy)
Make a copy of given coordinates and translate by given deltas. Inputs: coords PolyVec{Float} vec <Vector{Real}> Output: Updates given coords
sourceSubzero.update_boundaries!
— Methodupdate_boundaries!(domain)
Update each boundary in the domain. For now, this simply means moving compression boundaries by their velocities.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(args...)
No updates to boundaries that aren't compression boundaries.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(boundary, Δt)
Move East/West compression boundaries by given velocity. Update coords and val fields to reflect new position. Inputs: boundary <MovingBoundary{Union{East, West}, AbstractFloat}> domain compression boundary Δt <Int> number of seconds in a timestep Outputs: None. Move boundary East/West depending on velocity.
sourceSubzero.update_boundary!
— Methodupdate_boundary!(boundary, Δt)
Move North/South compression boundaries by given velocity. Update coords and val fields to reflect new position. Inputs: boundary <MovingBoundary{Union{North, South}, AbstractFloat}> domain compression boundary Δt <Int> number of seconds in a timestep Outputs: None. Move boundary North or South depending on velocity.
sourceSubzero.update_criteria!
— Methodupdate_criteria!(::MohrsCone, floes)
Mohr's cone is not time or floe dependent so it doesn't need to be updates.
sourceSubzero.update_criteria!
— Methodupdate_criteria!(criteria::HiblerYieldCurve, floes)
Update the Hibler Yield Curve vertices based on the current set of floes. The criteria changes based off of the average height of the floes. Inputs: criteria <HiblerYieldCurve> simulation's fracture criteria floes <StructArray{Floe}> model's list of floes Outputs: None. Updates the criteria's vertices field to update new criteria.
sourceSubzero.update_ghost_timestep_vals!
— Methodupdate_ghost_timestep_vals!(floes, idx, parent_idx)
Update a parent floes and its ghosts to match velocities and accelerations at given index. Inputs: floes <StructArray{Floe}> list of floes in the simulation idx <Int> index of floe within floes list to copy to floe and ghosts parent_idx <Int> index of parent floe to update, along with its ghosts Outputs: Nothing. Update floe values.
sourceSubzero.update_new_rotation_conserve!
— Methodupdate_new_rotation_conserve!(
x, y,
floe1, floe2,
init_rot_momentum, init_p_rot_momentum,
diff_orbital, diff_p_orbital,
Δt,
-)
Update rotational velocities of two floes whose shapes may have changed to maintain conservation of momentum given the floes' intial roational momentums and the change in orbital momentum between their original shape and new shapes. Additionally, both floes will have the same velocity at a given (x,y) point. Inputs: x <Float> x-coordinate of point where floes share same rotational velocity y <Float> y-coordinate of point where floes share same rotational velocity floe1 <Union{Floe, LazyRow{Floe}}> first floe in pair floe2 <Union{Floe, LazyRow{Floe}}> second floe in pair initrotmomentum <Float> initial rotational momentum of floe 1 before shape change initprotmomentum <Float> initial rotational momentum of floe 2 before shape change difforbital <Float> change in floe 1's orbital velocity after shape change diffporbital <Float> change in floe 1's orbital velocity after shape change Δt <Int> length of timestep in seconds Output: Nothing. Update both floes' rotational velocity, previous rotational velocity, and rotational acceleration to conserve angular momentum.
sourceSubzero.valid_polyvec!
— Methodvalid_polyvec(coords::PolyVec{FT})
Takes a PolyVec object and make sure that the last element of each "ring" (vector of vector of floats) has the same first element as last element and has not duplicate adjacent elements. Also asserts that each "ring" as at least three distinct elements or else it is not a valid ring, but rather a line segment.
sourceSubzero.valid_ringvec!
— Methodvalid_ringvec(coords::RingVec{FT})
Takes a RingVec object and make sure that the last element has the same first element as last element and that other than these two elements there are no duplicate, adjacent vertices. Also asserts that the ring as at least three elements or else it cannot be made into a valid ring as it is a line segment.
sourceSubzero.which_points_on_edges
— Methodwhich_points_on_edges(points, coords; atol = 1e-1)
Find which points are on the coordinates of the given polygon. Inputs: points <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> points to match to edges within polygon coords <PolVec> polygon coordinates atol <Float> distance target point can be from an edge before being classified as not on the edge
sourceSubzero.which_vertices_match_points
— Methodwhich_vertices_match_points(ipoints, coords, atol)
Find which vertices in coords match given points Inputs: points <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> points to match to vertices within polygon region <Polygon> polygon atol <Float> distance vertex can be away from target point before being classified as different points Output: Vector{Int} indices of points in polygon that match the intersection points Note: If last coordinate is a repeat of first coordinate, last coordinate index is NOT recorded.
sourceSubzero.write_checkpoint_data!
— Methodwrite_checkpoint_data!(sim, tstep)
Writes model's floe, ocean, and atmosphere data to JLD2 file. Data can be used to restart simulation run. Inputs: sim <Simulation> simulation to run tstep <Int> simulation timestep Output: Writes floes, ocean, and atmosphere to JLD2 file with name writer.fn for current timestep, which will be the group in the JLD2 file.
sourceSubzero.write_data!
— Methodwrite_data!(sim, tstep, start_tstep)
Writes data for the simulation's writers that are due to write at given tstep. Inputs: sim <Simulation> simulation to run tstep <Int> simulation timestep start_tstep <Int> starting timestep of the simulation Output: Saves writer requested data to files specified in each writer.
sourceSubzero.write_floe_data!
— Methodwrite_floe_data!(sim, tstep)
Writes desired FloeOutputWriter data to JLD2 file.
Inputs: writers <StructArray{FloeWriter}> list of floe writers floes <StructArray{Floe}> list of floes tstep <Int> simulation timestep Output: Writes desired fields writer.outputs to JLD2 file with name writer.fn for current timestep, which will be the group in the JLD2 file.
sourceSubzero.write_grid_data!
— Methodwrite_grid_data!(sim, tstep)
Writes desired GridOutputWriter data to NetCDF file. Inputs: writers <StructArray{GridWriter}> list of grid writers floes <StructArray{Floe}> list of floes topography <StructArray{TopographyElement}> list of topography elements tstep <Int> simulation timestep Output: Writes desired fields writer.outputs to file with name writer.fn for current timestep.
sourceSubzero.write_init_state_data!
— Methodwrite_init_state_data!(sim, tstep)
Save initial simulation state. Inputs: sim <Simulation> simulation to run tstep <Int> timestep - not used Outputs: Saves simulation state to file.
sourceSettings
This document was generated with Documenter.jl version 1.5.0 on Thursday 8 August 2024. Using Julia version 1.10.4.
+)
Update rotational velocities of two floes whose shapes may have changed to maintain conservation of momentum given the floes' intial roational momentums and the change in orbital momentum between their original shape and new shapes. Additionally, both floes will have the same velocity at a given (x,y) point. Inputs: x <Float> x-coordinate of point where floes share same rotational velocity y <Float> y-coordinate of point where floes share same rotational velocity floe1 <Union{Floe, LazyRow{Floe}}> first floe in pair floe2 <Union{Floe, LazyRow{Floe}}> second floe in pair initrotmomentum <Float> initial rotational momentum of floe 1 before shape change initprotmomentum <Float> initial rotational momentum of floe 2 before shape change difforbital <Float> change in floe 1's orbital velocity after shape change diffporbital <Float> change in floe 1's orbital velocity after shape change Δt <Int> length of timestep in seconds Output: Nothing. Update both floes' rotational velocity, previous rotational velocity, and rotational acceleration to conserve angular momentum.
Subzero.valid_polyvec!
— Methodvalid_polyvec(coords::PolyVec{FT})
Takes a PolyVec object and make sure that the last element of each "ring" (vector of vector of floats) has the same first element as last element and has not duplicate adjacent elements. Also asserts that each "ring" as at least three distinct elements or else it is not a valid ring, but rather a line segment.
Subzero.valid_ringvec!
— Methodvalid_ringvec(coords::RingVec{FT})
Takes a RingVec object and make sure that the last element has the same first element as last element and that other than these two elements there are no duplicate, adjacent vertices. Also asserts that the ring as at least three elements or else it cannot be made into a valid ring as it is a line segment.
Subzero.which_points_on_edges
— Methodwhich_points_on_edges(points, coords; atol = 1e-1)
Find which points are on the coordinates of the given polygon. Inputs: points <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> points to match to edges within polygon coords <PolVec> polygon coordinates atol <Float> distance target point can be from an edge before being classified as not on the edge
Subzero.which_vertices_match_points
— Methodwhich_vertices_match_points(ipoints, coords, atol)
Find which vertices in coords match given points Inputs: points <Vector{Tuple{Float, Float} or Vector{Vector{Float}}}> points to match to vertices within polygon region <Polygon> polygon atol <Float> distance vertex can be away from target point before being classified as different points Output: Vector{Int} indices of points in polygon that match the intersection points Note: If last coordinate is a repeat of first coordinate, last coordinate index is NOT recorded.
Subzero.write_checkpoint_data!
— Methodwrite_checkpoint_data!(sim, tstep)
Writes model's floe, ocean, and atmosphere data to JLD2 file. Data can be used to restart simulation run. Inputs: sim <Simulation> simulation to run tstep <Int> simulation timestep Output: Writes floes, ocean, and atmosphere to JLD2 file with name writer.fn for current timestep, which will be the group in the JLD2 file.
Subzero.write_data!
— Methodwrite_data!(sim, tstep, start_tstep)
Writes data for the simulation's writers that are due to write at given tstep. Inputs: sim <Simulation> simulation to run tstep <Int> simulation timestep start_tstep <Int> starting timestep of the simulation Output: Saves writer requested data to files specified in each writer.
Subzero.write_floe_data!
— Methodwrite_floe_data!(sim, tstep)
Writes desired FloeOutputWriter data to JLD2 file.
Inputs: writers <StructArray{FloeWriter}> list of floe writers floes <StructArray{Floe}> list of floes tstep <Int> simulation timestep Output: Writes desired fields writer.outputs to JLD2 file with name writer.fn for current timestep, which will be the group in the JLD2 file.
Subzero.write_grid_data!
— Methodwrite_grid_data!(sim, tstep)
Writes desired GridOutputWriter data to NetCDF file. Inputs: writers <StructArray{GridWriter}> list of grid writers floes <StructArray{Floe}> list of floes topography <StructArray{TopographyElement}> list of topography elements tstep <Int> simulation timestep Output: Writes desired fields writer.outputs to file with name writer.fn for current timestep.
Subzero.write_init_state_data!
— Methodwrite_init_state_data!(sim, tstep)
Save initial simulation state. Inputs: sim <Simulation> simulation to run tstep <Int> timestep - not used Outputs: Saves simulation state to file.