Skip to content

Commit

Permalink
Merge branch 'main' into orad/gnki-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
odunbar authored Dec 19, 2024
2 parents 751dc08 + 9f2975c commit ca2fcef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
tags: '*'
pull_request:

permissions:
contents: write

jobs:
docs-build:
runs-on: ubuntu-latest
Expand All @@ -17,7 +20,7 @@ jobs:
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/setup-julia@v2
with:
version: '1'
show-versioninfo: 'true'
Expand Down
7 changes: 3 additions & 4 deletions src/EnsembleTransformKalmanInversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function etki_update(
AV2 <: AbstractVector,
AV3 <: AbstractVector,
}

inv_noise_scaling = get_Δt(ekp)[end]
m = size(u, 2)
X = FT.((u .- mean(u, dims = 2)) / sqrt(m - 1))
Y = FT.((g .- mean(g, dims = 2)) / sqrt(m - 1))
Expand All @@ -100,9 +100,9 @@ function etki_update(
γ_inv = obs_noise_cov_inv[block_idx]
# This is cumbersome, but will retain e.g. diagonal type for matrix manipulations, else indexing converts back to matrix
if isa(γ_inv, Diagonal) #
tmp[1][1:ys2, global_idx] = (γ_inv.diag[local_idx] .* Y[global_idx, :])' # multiple each row of Y by γ_inv element
tmp[1][1:ys2, global_idx] = inv_noise_scaling * (γ_inv.diag[local_idx] .* Y[global_idx, :])' # multiple each row of Y by γ_inv element
else #much slower
tmp[1][1:ys2, global_idx] = (γ_inv[local_idx, local_idx] * Y[global_idx, :])' # NB: col(Y') * γ_inv = (γ_inv * row(Y))' row-mult is faster
tmp[1][1:ys2, global_idx] = inv_noise_scaling * (γ_inv[local_idx, local_idx] * Y[global_idx, :])' # NB: col(Y') * γ_inv = (γ_inv * row(Y))' row-mult is faster
end
end

Expand Down Expand Up @@ -172,7 +172,6 @@ function update_ensemble!(

fh = get_failure_handler(ekp)

# Scale noise using Δt
y = get_obs(ekp)

if isnothing(failed_ens)
Expand Down

0 comments on commit ca2fcef

Please sign in to comment.