NEDAS.assim_tools.assimilators.DART.core module

NEDAS.assim_tools.assimilators.DART.core.default_lib_path() → str[source]
NEDAS.assim_tools.assimilators.DART.core.load_dart_filter(lib_path: str) → CDLL[source]
NEDAS.assim_tools.assimilators.DART.core.nml_value(v) → str[source]
NEDAS.assim_tools.assimilators.DART.core.dart_time(t: datetime) → tuple[int, int][source]
class NEDAS.assim_tools.assimilators.DART.core.DARTAssimilator(c: Context)[source]

Bases: Assimilator

DART’s own filter_main (libdartfilter.so), with its file I/O replaced by NEDAS memory.

NEDAS does the state/obs preparation, the transpose to ensemble-complete blocks and H(x); DART runs inflation, QC, QCEFF and the serial filter_assim on NEDAS’s communicator. See build_dart_filter.sh and nedas_hooks_mod.f90.

assim_mode: str = 'batch'
init_partitions(c: Context) → list

Generate spatial partitioning of the domain

assign_obs(c: Context)

Assign the observation sequence to each partition par_id

Parameters:

c (Context) – the runtime context object

Returns:

Indices in the full obs_seq for the subset of obs that belongs to partition par_id

Return type:

dict[ObsRecordID, dict[PartitionID, np.ndarray]]

distribute_partitions(c: Context)

Distribute partitions across processors

check(c: Context) → None[source]
compute_posterior(c: Context) → bool[source]
slots(c: Context) → dict[source]

DART quantity/type slot (1-based) for each (variable name, component)

slot_name(key) → str[source]
transpose_to_ensemble_complete(c: Context) → None[source]

Communicate among mpi ranks and transpose the locally-stored state/obs chunks to ensemble-complete

assimilation_algorithm(c: Context) → None[source]

The main assimilation algorithm will be implemented by subclasses

static fortran_comm(c: Context) → int[source]
collect_obs(c: Context, slots: dict) → dict[source]

Obs metadata on every rank (DART’s serial loop needs it), sorted by time; the H(x) ensemble only for the obs this rank owns in DART (sorted position j, owner j % nproc)

static num_owned(c: Context, nobs: int) → int[source]
static to_owners(c: Context, ens: dict, obs: dict, buf: ndarray) → ndarray[source]

Send NEDAS’s (member, record) obs ensembles to their DART owners, into buf (nens, nowned)

posterior_obs(c: Context, par_id, data, state, obs, post) → None[source]

Called from inside filter_main: H(x_post) with NEDAS’s own obs operators

load_inflation(c: Context, nk: int)[source]

Inflation fields from the previous cycle (this rank’s block), else namelist values

cyclic(c: Context)[source]
periodic(c: Context) → tuple[source]

(x_on, xmin, xmax, y_on, ymin, ymax) for DART’s set_periodic

write_input_nml(c: Context, workdir: str, slots: dict, obs: dict, from_restart: dict) → None[source]
write_qceff_table(c: Context, workdir: str, slots: dict) → str[source]

QCEFF table from filter_kind/probit_dist and per-variable qceff entries; ‘’ = all defaults