Skip to content

Commit 2a9922b

Browse files
Merge branch 'ss-nc/fix-climatoloy-experiment' of github.com:CliMA/ClimaOcean.jl into ss-nc/fix-climatoloy-experiment
2 parents e1e64ba + 1e048c9 commit 2a9922b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

experiments/flux_climatology/flux_climatology.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,19 @@ on_architecture(arch, f::FluxStatistics) = FluxStatistics(on_architecture(arch,
6565
on_architecture(arch, f.min))
6666

6767
function update_stats!(stats::FluxStatistics, iteration)
68-
grid = flux.grid
68+
grid = stats.flux.grid
6969
arch = architecture(grid)
7070
launch!(arch, grid, :xy, _update_stats!, stats, iteration)
7171
return nothing
7272
end
7373

74+
function update_stats!(stats::NamedTuple, iteration)
75+
for stat in stats
76+
update_stats!(stat, iteration)
77+
end
78+
return nothing
79+
end
80+
7481
@kernel function _update_stats!(stats, iteration)
7582
i, j = @index(Global, NTuple)
7683

@@ -110,13 +117,7 @@ function compute_flux_climatology(earth)
110117

111118
function update_flux_stats!(earth)
112119
iteration = earth.model.clock.iteration
113-
update_stats!(τx, iteration)
114-
update_stats!(τy, iteration)
115-
update_stats!(Jᵀ, iteration)
116-
update_stats!(Jˢ, iteration)
117-
update_stats!(Qc, iteration)
118-
update_stats!(Qv, iteration)
119-
120+
update_stats!(stats, iteration)
120121
return nothing
121122
end
122123

0 commit comments

Comments
 (0)