Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/bump covariance #123

Merged
merged 48 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0a98ddb
Add 3DVar and error covariance toolbox (dirac test) main programs.
frld Jul 26, 2024
c252483
Add initial version of 3dvar and dirac ctest.
frld Jul 26, 2024
95f4279
Add saber to citest.
frld Jul 26, 2024
ed041af
Another attempt to fix CI test. Add state tofieldset test.
frld Jul 26, 2024
fd34d29
Fixes to yaml files. Dirac test working. 3DVar needs adjoint
frld Jul 29, 2024
fa7c893
Add interpolator increment apply and adjoint methods and add incremen…
frld Jul 30, 2024
a197c85
Merge branch 'develop' into feature/add_simple_dirac_3dvar
frld Aug 22, 2024
0f760ef
Initial attempt to implement an increment interpolator unit test.
frld Sep 13, 2024
da0ee33
Merge branch 'develop' into feature/add_simple_dirac_3dvar
frld Sep 13, 2024
7eab74e
Fixes to new interpolator unit tests.
frld Sep 13, 2024
a999325
interpolator adjoint deal with missing values.
frld Sep 13, 2024
df0992a
Add some additional code to respect fillvalues.
frld Sep 20, 2024
52ea581
Update ci container (#117)
twsearle Sep 24, 2024
f4e160f
Fix coding norms.
frld Sep 24, 2024
a7c038c
Merge branch 'develop' into feature/add_simple_dirac_3dvar
frld Sep 24, 2024
c8d3372
Tidying up.
frld Sep 24, 2024
cc01553
Merge branch 'develop' into feature/add_simple_dirac_3dvar
frld Sep 26, 2024
dade994
Fix a merge error.
frld Sep 26, 2024
d873f0a
Apply suggestions from code review
frld Oct 2, 2024
bbcb396
Update copyrights.
frld Oct 2, 2024
465dfab
Merge branch 'feature/add_simple_dirac_3dvar' of https://github.com/M…
frld Oct 2, 2024
6614b47
Add reference data for 3dvar and dirac application tests. Turn off
frld Oct 2, 2024
5591c76
Update 3dvar 3dvar 3dvar minimizer to DRPCG as recommended.
frld Oct 2, 2024
5d57b35
Rename ice to sic to match other tests etc.
frld Oct 9, 2024
6b1455b
Add BUMP NICA grid calculation. Change to use BUMP background error
frld Oct 15, 2024
4d0b8aa
Add BUMP NICA grid calculation. Change to use BUMP background error
frld Oct 15, 2024
8b1253b
Merge branch 'feature/bump_covariance' of https://github.com/MetOffic…
frld Oct 15, 2024
c56f2e4
Add BUMP NICA grid calculation. Change to use BUMP background error
frld Oct 15, 2024
ec5dcef
Add BUMP NICA grid calculation. Change to use BUMP background error
frld Oct 15, 2024
89ed2f7
Merge branch 'feature/bump_covariance' of https://github.com/MetOffic…
frld Oct 15, 2024
65a57b7
Remove old 3dvar yaml file.
frld Oct 15, 2024
e03d6e6
Changes to allow increments to deal with fillvalues produced by BUMP.
frld Oct 17, 2024
3177845
Temporary fix to new atlas error about non-linear interpolation. Add
frld Oct 18, 2024
c4f788b
Make masking out duplicate points for bump more generic.
frld Oct 19, 2024
5c12dd3
Merge branch 'develop' into feature/bump_covariance
frld Oct 23, 2024
6ab97f1
Change bump settings to make test for setting up grid quicker. Attempt
frld Oct 24, 2024
645410c
Filter out all observations with missing values in the innovations. T…
frld Oct 29, 2024
22d4084
Updates to fix atlas adjoint interpolation error message.
frld Oct 29, 2024
6bf5a8c
Add bump nicas test reference data. Add units tests. Tidy up
frld Oct 30, 2024
be5debc
Add support for missing values to more increment methods.
frld Nov 1, 2024
50d4dfc
Bug fix to missing value detection.
frld Nov 1, 2024
640ed8e
Add identity 3dvar test (old test). Add some halo exchanges when going
frld Nov 6, 2024
0886d66
Change fill value.
frld Nov 6, 2024
19b0728
Update fill value
frld Nov 6, 2024
ddf3e9a
Apply suggestions from code review
frld Nov 13, 2024
b8c6308
Changes in response to review. In particular removing the unneeded
frld Nov 13, 2024
8a71031
Add a bit more info to comment about extra field area.
frld Nov 15, 2024
e266363
Add a description to the set_gmask (set geometry mask) optional param…
frld Nov 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make masking out duplicate points for bump more generic.
frld committed Oct 19, 2024
commit c4f788bdf218734167985e06925ef7abe00f14a6
27 changes: 18 additions & 9 deletions src/orca-jedi/geometry/Geometry.cc
Original file line number Diff line number Diff line change
@@ -15,6 +15,8 @@
#include "atlas/meshgenerator.h"
#include "atlas/parallel/mpi/mpi.h"

#include "atlas-orca/grid/OrcaGrid.h"

#include "eckit/mpi/Comm.h"
#include "eckit/config/Configuration.h"
#include "eckit/exception/Exceptions.h"
@@ -114,6 +116,13 @@ Geometry::Geometry(const eckit::Configuration & config,
mesh_, atlas::option::halo(halo));
log_status();

atlas::OrcaGrid orcaGrid = mesh_.grid();
nx_ = orcaGrid.nx() + orcaGrid.haloWest() + orcaGrid.haloEast();
ny_ = orcaGrid.ny() + orcaGrid.haloNorth();

oops::Log::debug() << "nx_ " << nx_ << " ny_ " << ny_
<< std::endl;

// Fill extra geometry fields for BUMP / SABER
// these are area (DJL needed?), vunit, hmask, gmask
extraFields_ = atlas::FieldSet();
@@ -138,10 +147,10 @@ Geometry::Geometry(const eckit::Configuration & config,
for (atlas::idx_t j = 0; j < field_view1.shape(0); ++j) {
for (atlas::idx_t k = 0; k < field_view1.shape(1); ++k) {
int x, y;
std::tie(x, y) = xypt(j);
// DJL hardwired to orca2 needs generalising
std::tie(x, y) = xypt(j, nx_);
// 0 mask, 1 ocean
if (ghost(j) || x >= 181 || y >= 147 ) {field_view1(j, k) = 0;
// if (ghost(j) || x >= 181 || y >= 147 ) {field_view1(j, k) = 0; // DJL
if (ghost(j) || x >= nx_-1 || y >= ny_-1 ) {field_view1(j, k) = 0; // DJL
} else {field_view1(j, k) = 1;}
}
}
@@ -158,9 +167,10 @@ Geometry::Geometry(const eckit::Configuration & config,
for (atlas::idx_t j = 0; j < field_view2.shape(0); ++j) {
for (atlas::idx_t k = 0; k < field_view2.shape(1); ++k) {
int x, y;
std::tie(x, y) = xypt(j);
std::tie(x, y) = xypt(j, nx_);
// DJL hardwired to orca2 needs generalising
if (ghost(j) || x >= 181 || y >= 147 ) {field_view2(j, k) = 0;
// if (ghost(j) || x >= 181 || y >= 147 ) {field_view2(j, k) = 0; // DJL
if (ghost(j) || x >= nx_-1 || y >= ny_-1 ) {field_view2(j, k) = 0; // DJL
// 0 mask, 1 ocean
} else {field_view2(j, k) = 1;}
}
@@ -384,9 +394,8 @@ void Geometry::set_gmask(atlas::Field & field) const {
}

// Determine x,y location from jpt
// DJL hardwired to orca2 needs generalising
std::tuple<int, int> xypt(int jpt) {
int xwid = 182; int y = jpt / xwid;
int x = jpt - y*xwid;
std::tuple<int, int> xypt(int jpt, int nx) {
int y = jpt / nx;
int x = jpt - y*nx;
return std::make_tuple(x, y); }
} // namespace orcamodel
4 changes: 3 additions & 1 deletion src/orca-jedi/geometry/Geometry.h
Original file line number Diff line number Diff line change
@@ -89,9 +89,11 @@ class Geometry : public util::Printable {
atlas::FieldSet nofields_;
std::shared_ptr<eckit::Timer> eckit_timer_;
atlas::FieldSet extraFields_;
int nx_;
int ny_;
};

std::tuple<int, int> xypt(int jpt);
std::tuple<int, int> xypt(int, int);

// -----------------------------------------------------------------------------

2 changes: 1 addition & 1 deletion src/tests/testoutput/test_3dvar_sic.ref
Original file line number Diff line number Diff line change
@@ -21,6 +21,6 @@ CostFunction::addIncrement: Analysis:



CostJb : Nonlinear Jb = -2.51949e-03
CostJb : Nonlinear Jb = 0.00000e+00
CostJo : Nonlinear Jo(Sea Ice) = 1.00960e+08, nobs = 48, Jo/n = 2.10333e+06, err = 2.00000e+00
CostFunction: Nonlinear J = 1.00960e+08