ReferenceModels

CalibrateEDMF.ReferenceModels.ReferenceModelType
ReferenceModel{FT <: Real}

A structure containing information about the 'true' reference model and the observation map used to compare the parameterized and reference models.

Fields

  • y_names::Vector{String}: Vector of reference variable names

  • y_dir::String: Directory for reference data to compute y mean vector

  • Σ_dir::String: Directory for reference data to compute Σ covariance matrix

  • case_name::String: Name of case

  • y_t_start::Real: Start time for computing mean statistics over

  • y_t_end::Real: End time for computing mean statistics over

  • Σ_t_start::Real: Start time for computing covariance statistics over

  • Σ_t_end::Real: End time for computing covariance statistics over

  • z_obs::Vector{FT} where FT<:Real: Vector of observed vertical locations

  • namelist::Dict: TurbulenceConvection namelist

  • y_type::CalibrateEDMF.ModelTypes.ModelType: Type of model used to generate mean observations

  • Σ_type::CalibrateEDMF.ModelTypes.ModelType: Type of model used to generate observational noise

Constructors

ReferenceModel(y_names, y_dir, case_name, t_start, t_end; [Σ_dir, Σ_t_start, Σ_t_end, y_type, Σ_type, n_obs, namelist_args, seed])

A ReferenceModel can be defined for a case case_name, provided the location of the data, y_dir, the reference variable names y_names, and the averaging interval (t_start, t_end) is provided.

If data and/or averaging intervals for the empirical covariance matrix Σ is different than the mean observations y, this is specified with Σ_dir, Σ_t_start, and Σ_t_end.

ReferenceModel constructor allowing for any or all of Σ_dir, Σ_t_start, Σ_t_end to be unspecified, in which case they take their values from y_dir, t_start and t_end, respectively.

A tuple of namelist_args can be specified to overwrite default arguments for the case in TurbulenceConvection.jl.

Mainly for testing purposes, a seed can also be specified to avoid randomness during namelist generation.

source
CalibrateEDMF.ReferenceModels.get_ref_model_kwargsFunction
get_ref_model_kwargs(ref_config::Dict; [global_namelist_args])

Extract fields from the reference config necessary to construct ReferenceModels.

The namelist that defines a case is fetched from TC.jl for each case defined in ref_config["case_name"]. These can be overwritten in one of two ways;

  1. Define case-by-case overwrite entries in ref_config["namelist_args"]
  2. Define global overwrite entries with the keyword argument global_namelist_args (Vector of Tuples). These entries apply to all cases, training, validation, testing, etc.

Note that the case-by-case namelist_args supersede both TC.jl defaults and global namelist_args entries.

See also construct_reference_models.

source
CalibrateEDMF.ReferenceModels.construct_reference_modelsFunction
construct_reference_models(kwarg_ld::Dict; [seed])::Vector{ReferenceModel}

Returns a vector of ReferenceModels given a dictionary of keyword argument lists.

See also get_ref_model_kwargs.

Inputs:

  • kwarg_ld :: Dictionary of keyword argument lists
  • seed :: If set, seed is an integer, and is the seed value to generate a TC namelist for each case

Outputs:

  • ref_models :: Vector where the i-th ReferenceModel is constructed from the i-th element of every keyword argument list of the dictionary.
source
CalibrateEDMF.ReferenceModels.time_shift_reference_modelFunction
time_shift_reference_model(m::ReferenceModel, time_shift::FT) where {FT <: Real}

Returns a time-shifted ReferenceModel, considering an interval relative to the last available time step of the original model. Only LES data (from ydir or Σdir) are time shifted.

Inputs:

  • m :: A ReferenceModel.
  • time_shift :: [LES last time - SCM start time (LES timeframe)]

Outputs:

  • The time-shifted ReferenceModel.
source
CalibrateEDMF.ReferenceModels.get_scm_namelistFunction
get_scm_namelist(case_name; [les_dir, overwrite, namelist_args, seed])

Returns a TurbulenceConvection.jl namelist, given a case and a list of namelist arguments.

Inputs:

  • case_name :: Name of the TurbulenceConvection.jl case considered.
  • les_dir :: Directory with LES data to drive the SCM with, if case_name is LES_driven_SCM.
  • namelist_args :: Vector of non-default arguments to be used in the namelist, defined as a vector of tuples.
  • seed :: If set, seed is an integer, and is the seed value to generate a TC namelist.

Outputs:

  • namelist :: The TurbulenceConvection.jl namelist.
source
CalibrateEDMF.ReferenceModels.ReferenceModelBatchType
struct ReferenceModelBatch

A structure containing a batch of ReferenceModels and an evaluation order for ReferenceModels within the current epoch.

Fields

  • ref_models::Vector{CalibrateEDMF.ReferenceModels.ReferenceModel}: Vector containing all reference models

  • eval_order::Vector{Int64}: Vector of indices defining the ReferenceModel evaluation order when batching

Constructors

ReferenceModelBatch(ref_models::Vector{ReferenceModel}, shuffling::Bool = true)

ReferenceModelBatch constructor given a vector of ReferenceModels.

ReferenceModelBatch(kwarg_ld::Dict, shuffling::Bool = true)

ReferenceModelBatch constructor given a dictionary of keyword argument lists.

Inputs:

  • kwarg_ld :: Dictionary of keyword argument lists
  • shuffling :: Whether to shuffle the order of ReferenceModels.
source
CalibrateEDMF.ReferenceModels.get_minibatch!Function
get_minibatch!(ref_models::ReferenceModelBatch, batch_size::Int)

Returns a minibatch of ReferenceModels from a ReferenceModelBatch and updates the eval order.

The size of the minibatch is either the requested size, or the remainder of the elements in the eval_order for this epoch.

Inputs:

  • ref_model_batch :: A ReferenceModelBatch.
  • batch_size :: The number of ReferenceModels to retrieve.

Outputs:

  • A vector of ReferenceModels.
  • The indices of the returned ReferenceModels.
source