Skip to content

API

ReefModEngine.DataCube Method
julia
DataCube(data::AbstractArray; kwargs...)::YAXArray

Constructor for YAXArray. When used with axes_names, the axes labels will be UnitRanges from 1 up to that axis length.

Arguments

  • data : Array of data to be used when building the YAXArray

  • axes_names :

source

ReefModEngine.append_scenarios! Method
julia
append_scenarios!(rs::ResultStore, reps::Int)::Nothing

Add rows to scenario dataframe in result store.

source

ReefModEngine.area_needed Method
julia
area_needed(n_corals::Int64, density::Union{Float64,Vector{Float64}})::Union{Vector{Float64},Float64}

Determine area (in km²) needed to deploy the given the number of corals at the specified density.

source

ReefModEngine.concat_results! Method
julia
concat_results!(rs::ResultStore, start_year::Int64, end_year::Int64, reps::Int64)::Nothing

Append results for all runs/replicates.

Arguments

  • rs : Result store to save data to

  • start_year : Collect data from this year

  • end_year : Collect data to this year

  • reps : Total number of expected replicates

source

ReefModEngine.create_dataset Method
julia
create_dataset(start_year::Int, end_year::Int, n_reefs::Int, reps::Int)::Dataset

Preallocate and create dataset for result variables. Only constructed when the first results are collected.

source

ReefModEngine.deployment_area Method
julia
deployment_area(n_corals::Int64, max_n_corals::Int64, density::Union{Float64, Vector{Float64}}, target_areas::Vector{Float64})::Union{Tuple{Float64,Float64},Tuple{Float64,Vector{Float64}}}

Determine deployment area for the expected number of corals to be deployed.

Arguments

  • n_corals : Number of corals,

  • max_n_corals : Expected maximum deployment effort (total number of corals in intervention set)

  • density : Stocking density per m². In RME versions higher than v1.0.28 density needs to be a vector with each element representing the density per functional group

  • target_areas : Available area at target location(s)

Returns

Tuple

  • Percent area of deployment

  • modified stocking density [currently no modifications are made]

source

ReefModEngine.deployment_area Method
julia
deployment_area(max_n_corals::Int64, target_areas::Vector{Float64})::Union{Tuple{Float64,Float64}, Tuple{Float64,Vector{Float64}}}

Determine deployment area for given number of corals and target area, calculating the appropriate deployment density to maintain the specified grid size.

source

ReefModEngine.init_rme Method
julia
init_rme(rme_path::String)::Nothing

Initialize ReefMod Engine for use.

source

ReefModEngine.match_id Method
julia
match_id(id::String)::Int64
match_ids(ids::Vector{String})::Vector{Int64}

Find matching index position for the given ID(s) according to ReefMod Engine's reef list.

Note

ReefMod Engine's reef list is in all upper case. The provided IDs are converted to upper case to ensure a match.

Examples

julia
julia> reef_ids()
# 3806-element Vector{String}:
#  "10-330"
#  "10-331"
#  ⋮
#  "23-048"
#  "23-049"

julia> match_id("10-330")
#  1

julia> match_id("23-049")
#  3806

julia> match_ids(["23-048", "10-331"])
#  3805
#  2

source

ReefModEngine.preallocate_concat! Method
julia
preallocate_concat(rs, start_year, end_year, reps::Int64)::Nothing

Allocate additional memory before adding an additional result set. Result sets must have the same time frame.

source

ReefModEngine.reef_areas Method
julia
reef_areas(id_list)

Retrieve reef areas in km² for specified locations.

source

ReefModEngine.reef_areas Method
julia
reef_areas()

Retrieve all reef areas in km²

source

ReefModEngine.reef_ids Method
julia
reef_ids()::Vector{String}

Get list of reef ids in the order expected by ReefMod Engine.

source

ReefModEngine.reset_rme Method
julia
reset_rme()

Reset ReefModEngine, clearing any and all interventions and reef sets.

source

ReefModEngine.rme_version_info Method
julia
rme_version_info()::@NamedTuple{major::Int64, minor::Int64, patch::Int64}

Get RME version

source

ReefModEngine.run_init Method
julia
run_init()::Nothing

Convenience function to initialize RME runs.

source

ReefModEngine.save_result_store Method
julia
save_result_store(dir_name::String, result_store::ResultStore)::Nothing

Save results to a netcdf file and a dataframe containing the scenario runs. Saved to the given directory. The directory is created if it does not exit.

source

ReefModEngine.set_enrichment_deployment! Method
julia
set_enrichment_deployment!(name::String, reefset::String, n_larvae::Int64, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64}, density::Float64)::Nothing

Set deployment for multiple years at a given frequency.

source

ReefModEngine.set_enrichment_deployment! Method
julia
set_enrichment_deployment!(name::String, reefset::String, n_larvae::Int64, year::Int64, area_km2::Vector{Float64}, density::Float64)::Nothing

As set_seeding_deployment() but for larvae enrichment (also known as assisted migration). Set deployment for a single target year.

source

ReefModEngine.set_option Method
julia
set_option(opt::String, val::Float64)
set_option(opt::String, val::Int)
set_option(opt::String, val::String)

Set RME option.

See RME documentation for full list of available options.

source

ReefModEngine.set_outplant_deployment! Method
julia
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64}, density::Union{Vector{Float64}, Float})::Nothing

Set outplanting deployments across a range of years.

Arguments

  • name : Name to assign intervention event

  • reefset : Name of pre-defined list of reefs to intervene on

  • n_corals : Number of corals to outplant for a given year

  • max_effort : Total number of corals to outplant

  • first_year : First year to start interventions

  • last_year : Final year of interventions

  • year_step : Frequency of intervention (1 = every year, 2 = every second year, etc)

  • area_km2 : Intervention area [km²]

  • density : Stocking density of intervention [corals / m²]

source

ReefModEngine.set_outplant_deployment! Method
julia
set_outplant_deployment!(name::String, reefset::String, max_effort::Int64, first_year::Int64, last_year::Int64, year_step::Int64, area_km2::Vector{Float64})::Nothing

Set outplanting deployments across a range of years, automatically determining the coral deployment density to maintain the set grid size.

source

ReefModEngine.set_outplant_deployment! Method
julia
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, year::Int64, area_km2::Vector{Float64}, density::Union{Float64, Vector{Float64}})::Nothing

Set outplanting deployments for a single year.

Arguments

  • name : Name to assign intervention event

  • reefset : Name of pre-defined list of reefs to intervene on

  • n_corals : Number of corals to outplant

  • year : Year to intervene

  • area_km2 : Area to intervene [km²]

  • density : Stocking density of intervention [corals / m²]

source

ReefModEngine.set_outplant_deployment! Method
julia
set_outplant_deployment!(name::String, reefset::String, n_corals::Int64, year::Int64, area_km2::Vector{Float64})::Nothing

Set outplanting deployments for a single year, automatically determining the coral deployment density to maintain the set grid size.

Arguments

  • name : Name to assign intervention event

  • reefset : Name of pre-defined list of reefs to intervene on

  • n_corals : Number of corals to outplant

  • year : Year to intervene

  • area_km2 : Area to intervene [km²]

source

ReefModEngine.@getRME Macro

Only for use when RME functions return non-error numeric results.

Examples

julia
count_per_m2::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble

source