Skip to content

Commit 9883696

Browse files
Mark Mieschbenjaminmenetrierfabiolrdinizshlyaeva
authored
Feature/doxygen cleanup (#1367)
* ATLAS interfaces test working for ATLAS-based models (#1366) * ATLAS interfaces test working for ATLAS-based models * Fix coding norms * Clean up doxygen landing page * fix for name of l95 simplified tests (#1365) Co-authored-by: Anna Shlyaeva <shlyaeva@gmail.com> * typos * update license * update doxyfile * review comments Co-authored-by: Benjamin Menetrier <30638301+benjaminmenetrier@users.noreply.github.com> Co-authored-by: Fabio L R Diniz <45880035+fabiolrdiniz@users.noreply.github.com> Co-authored-by: Anna Shlyaeva <shlyaeva@gmail.com>
1 parent 43cc6d9 commit 9883696

7 files changed

Lines changed: 59 additions & 31 deletions

File tree

LICENSE renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
identification within third-party archives.
189189

190190
Copyright 2009-2016 European Centre for Medium-Range Weather Forecasts (ECMWF)
191-
Copyright 2017-2020 University Corporation for Atmospheric Research (UCAR)
191+
Copyright 2017-2021 University Corporation for Atmospheric Research (UCAR)
192192

193193
Licensed under the Apache License, Version 2.0 (the "License");
194194
you may not use this file except in compliance with the License.

docs/Doxyfile.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,13 +1127,6 @@ VERBATIM_HEADERS = YES
11271127

11281128
ALPHABETICAL_INDEX = YES
11291129

1130-
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
1131-
# which the alphabetical index list will be split.
1132-
# Minimum value: 1, maximum value: 20, default value: 5.
1133-
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
1134-
1135-
COLS_IN_ALPHA_INDEX = 5
1136-
11371130
# In case all classes in a project start with a common prefix, all classes will
11381131
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
11391132
# can be used to specify a prefix (or a list of prefixes) that should be ignored

docs/mainpage.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#pragma once
2+
3+
// This file defines what appears on the Main Page of the documentation
4+
// generated by doxygen. The file contains no code, and does not appear
5+
// in any cpp include statement.
6+
//
7+
/*!
8+
* \mainpage Object Oriented Prediction System (OOPS)
9+
*
10+
* OOPS is the top level of JEDI that orchestrates the configuration and execution of applications. This is where DA applications are implemented. OOPS also includes the Lorenz 95 and Quasi-geostrophic toy models that can used to run many of the DA applications.
11+
*/
File renamed without changes.

l95/test/CMakeLists.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ ecbuild_add_test( TARGET test_l95_simplifiedl95_DRIPCG
781781
COMMAND l95_4dvar.x
782782
ARGS testinput/simplifiedl95_DRIPCG.yaml )
783783

784-
785784
ecbuild_add_test( TARGET test_l95_simplifiedl95_DRPCG
786785
COMMAND l95_4dvar.x
787786
ARGS testinput/simplifiedl95_DRPCG.yaml )
@@ -790,42 +789,42 @@ ecbuild_add_test( TARGET test_l95_simplifiedl95_DRPFOM
790789
COMMAND l95_4dvar.x
791790
ARGS testinput/simplifiedl95_DRPFOM.yaml )
792791

793-
ecbuild_add_test( TARGET simplifiedl95_DRPLanczos
792+
ecbuild_add_test( TARGET test_l95_simplifiedl95_DRPLanczos
794793
COMMAND l95_4dvar.x
795794
ARGS testinput/simplifiedl95_DRPLanczos.yaml )
796795

797-
ecbuild_add_test( TARGET simplifiedl95_FGMRES
796+
ecbuild_add_test( TARGET test_l95_simplifiedl95_FGMRES
798797
COMMAND l95_4dvar.x
799798
ARGS testinput/simplifiedl95_FGMRES.yaml )
800799

801-
ecbuild_add_test( TARGET simplifiedl95_GMRESR
800+
ecbuild_add_test( TARGET test_l95_simplifiedl95_GMRESR
802801
COMMAND l95_4dvar.x
803802
ARGS testinput/simplifiedl95_GMRESR.yaml )
804803

805-
ecbuild_add_test( TARGET simplifiedl95_IPCG
804+
ecbuild_add_test( TARGET test_l95_simplifiedl95_IPCG
806805
COMMAND l95_4dvar.x
807806
ARGS testinput/simplifiedl95_IPCG.yaml )
808807

809-
ecbuild_add_test( TARGET simplifiedl95_LBGMRESR
808+
ecbuild_add_test( TARGET test_l95_simplifiedl95_LBGMRESR
810809
COMMAND l95_4dvar.x
811810
ARGS testinput/simplifiedl95_LBGMRESR.yaml )
812811

813-
ecbuild_add_test( TARGET simplifiedl95_MINRES
812+
ecbuild_add_test( TARGET test_l95_simplifiedl95_MINRES
814813
COMMAND l95_4dvar.x
815814
ARGS testinput/simplifiedl95_MINRES.yaml )
816815

817-
ecbuild_add_test( TARGET simplifiedl95_PCG
816+
ecbuild_add_test( TARGET test_l95_simplifiedl95_PCG
818817
COMMAND l95_4dvar.x
819818
ARGS testinput/simplifiedl95_PCG.yaml )
820819

821-
ecbuild_add_test( TARGET simplifiedl95_PLanczos
820+
ecbuild_add_test( TARGET test_l95_simplifiedl95_PLanczos
822821
COMMAND l95_4dvar.x
823822
ARGS testinput/simplifiedl95_PLanczos.yaml )
824823

825-
ecbuild_add_test( TARGET simplifiedl95_RPCG
824+
ecbuild_add_test( TARGET test_l95_simplifiedl95_RPCG
826825
COMMAND l95_4dvar.x
827826
ARGS testinput/simplifiedl95_RPCG.yaml )
828827

829-
ecbuild_add_test( TARGET simplifiedl95_RPLanczos
828+
ecbuild_add_test( TARGET test_l95_simplifiedl95_RPLanczos
830829
COMMAND l95_4dvar.x
831830
ARGS testinput/simplifiedl95_RPLanczos.yaml )
File renamed without changes.

src/test/interface/Increment.h

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "oops/util/Logger.h"
3737
#include "test/TestEnvironment.h"
3838

39-
4039
namespace test {
4140

4241
// =============================================================================
@@ -361,19 +360,45 @@ template <typename MODEL> void testIncrementAtlas() {
361360
typedef oops::Increment<MODEL> Increment_;
362361

363362
if (Test_::skipAtlas() == 0) {
364-
// Create random increment and copy it
363+
// Create random increment
365364
Increment_ dx1(Test_::resol(), Test_::ctlvars(), Test_::time());
366365
dx1.random();
367-
Increment_ dx2(dx1);
368-
369-
// Create ATLAS fieldset
370-
std::unique_ptr<atlas::FieldSet> atlasFieldSet(new atlas::FieldSet());
371-
372-
// Test setAtlas-toAtlas-fromAtlas
373-
dx1.setAtlas(atlasFieldSet.get());
374-
dx1.toAtlas(atlasFieldSet.get());
375-
dx1.zero();
376-
dx1.fromAtlas(atlasFieldSet.get());
366+
std::unique_ptr<atlas::FieldSet> atlasFieldSet1(new atlas::FieldSet());
367+
dx1.setAtlas(atlasFieldSet1.get());
368+
dx1.toAtlas(atlasFieldSet1.get());
369+
370+
// Create zero increment
371+
Increment_ dx2(Test_::resol(), Test_::ctlvars(), Test_::time());
372+
dx2.zero();
373+
std::unique_ptr<atlas::FieldSet> atlasFieldSet2(new atlas::FieldSet());
374+
dx2.setAtlas(atlasFieldSet2.get());
375+
376+
// Copy ATLAS fieldset content
377+
for ( atlas::FieldSet::const_iterator field1 = atlasFieldSet1->cbegin();
378+
field1 != atlasFieldSet1->cend(); ++field1 ) {
379+
atlas::Field field2 = atlasFieldSet2->field(field1->name());
380+
if (field1->rank() == 1) {
381+
auto array1 = atlas::array::make_view<double, 1>(*field1);
382+
auto array2 = atlas::array::make_view<double, 1>(field2);
383+
for (int i1 = 0; i1 < array1.shape(0); ++i1) {
384+
array2(i1) = array1(i1);
385+
}
386+
}
387+
if (field1->rank() == 2) {
388+
auto array1 = atlas::array::make_view<double, 2>(*field1);
389+
auto array2 = atlas::array::make_view<double, 2>(field2);
390+
for (int i1 = 0; i1 < array1.shape(0); ++i1) {
391+
for (int i2 = 0; i2 < array1.shape(1); ++i2) {
392+
array2(i1, i2) = array1(i1, i2);
393+
}
394+
}
395+
}
396+
}
397+
398+
// Copy back to increment
399+
dx2.fromAtlas(atlasFieldSet2.get());
400+
401+
// Check increment difference
377402
dx2 -= dx1;
378403
EXPECT(dx2.norm() == 0.0);
379404
}

0 commit comments

Comments
 (0)