From ff64aac0e068fc14b251f5b361513d44084c99c4 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Tue, 25 Jun 2024 20:50:08 +0000 Subject: [PATCH 01/11] Initial commit to work on mega exe following GDASApp --- CMakeLists.txt | 5 ++ build.sh | 2 +- mains/CMakeLists.txt | 6 +++ mains/rdas.cc | 116 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 mains/CMakeLists.txt create mode 100644 mains/rdas.cc diff --git a/CMakeLists.txt b/CMakeLists.txt index 318a8edc..296c6462 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,6 +41,11 @@ option(WORKFLOW_TESTS "Include regional-workflow dependent tests" OFF) option(MPAS_DYCORE "Use MPAS" OFF) option(FV3_DYCORE "Use FV3" ON) +if( BUILD_RDASBUNDLE ) + find_package( fv3jedi REQUIRED ) + add_subdirectory( mains ) +endif() + # Install utility scripts. #add_subdirectory(ush) diff --git a/build.sh b/build.sh index 6b1ff932..82986a8d 100755 --- a/build.sh +++ b/build.sh @@ -131,7 +131,7 @@ elif [[ $DYCORE == 'MPAS' ]]; then builddirs="mpas-jedi iodaconv" elif [[ $DYCORE == 'FV3andMPAS' ]]; then CMAKE_OPTS+=" -DFV3_DYCORE=ON -DMPAS_DYCORE=ON" - builddirs="fv3-jedi mpas-jedi iodaconv" + builddirs="rdas fv3-jedi mpas-jedi iodaconv" else echo "$DYCORE is not a valid dycore option. Valid options are FV3 or MPAS" exit 1 diff --git a/mains/CMakeLists.txt b/mains/CMakeLists.txt new file mode 100644 index 00000000..dcc0d527 --- /dev/null +++ b/mains/CMakeLists.txt @@ -0,0 +1,6 @@ +# Build the big rdas executable used for all generic JEDI applications +# -------------------------------------------------------------------- +ecbuild_add_executable( TARGET rdas.x + SOURCES rdas.cc + LIBS fv3jedi + ) diff --git a/mains/rdas.cc b/mains/rdas.cc new file mode 100644 index 00000000..5524fa0b --- /dev/null +++ b/mains/rdas.cc @@ -0,0 +1,116 @@ +// ------------------------------------------------------------------------------------------------- + +#include +#include + +#include "fv3jedi/ObsLocalization/instantiateObsLocFactory.h" +#include "fv3jedi/Utilities/Traits.h" + +#include "oops/generic/instantiateModelFactory.h" +#include "saber/oops/instantiateCovarFactory.h" +#include "ufo/instantiateObsErrorFactory.h" +#include "ufo/instantiateObsFilterFactory.h" +#include "ufo/ObsTraits.h" + +#include "oops/runs/ConvertState.h" +#include "oops/runs/HofX4D.h" +#include "oops/runs/LocalEnsembleDA.h" +#include "oops/runs/Run.h" +#include "oops/runs/Variational.h" + +// ------------------------------------------------------------------------------------------------- + +template +int runApp(int argc, char** argv, const std::string traits, const std::string appName) { + // Create the Run object + oops::Run run(argc, argv); + + // Instantiate oops factories + oops::instantiateModelFactory(); + + // Instantiate saber factories + saber::instantiateCovarFactory(); + + // Intantiate ufo factories + ufo::instantiateObsErrorFactory(); + ufo::instantiateObsFilterFactory(); + + // Localization for ensemble DA + if (appName == "localensembleda") { + if (traits == "fv3jedi") { + fv3jedi::instantiateObsLocFactory(); + } + } + + // Application pointer + std::unique_ptr app; + + // Define a map from app names to lambda functions that create unique_ptr to Applications + std::map()>> apps; + + apps["convertstate"] = []() { + return std::make_unique>(); + }; + apps["hofx4d"] = []() { + return std::make_unique>(); + }; + apps["localensembleda"] = []() { + return std::make_unique>(); + }; + apps["variational"] = []() { + return std::make_unique>(); + }; + + // Create application object and point to it + auto it = apps.find(appName); + + // Run the application + return run.execute(*(it->second())); +} + +// ------------------------------------------------------------------------------------------------- + +int main(int argc, char ** argv) { + // Check that the number of arguments is correct + // ---------------------------------------------- + ASSERT_MSG(argc >= 3, "Usage: " + std::string(argv[0]) + " "); + + // Get traits from second argument passed to executable + // ---------------------------------------------------- + std::string traits = argv[1]; + for (char &c : traits) {c = std::tolower(c);} + + // Get the application to be run + std::string app = argv[2]; + for (char &c : app) {c = std::tolower(c);} + + // Check that the traits are recognized + // ------------------------------------ + const std::set validTraits = {"fv3jedi"}; + ASSERT_MSG(validTraits.find(traits) != validTraits.end(), "Traits not recognized: " + traits); + + // Check that the application is recognized + // ---------------------------------------- + const std::set validApps = { + "convertstate", + "hofx4d", + "localensembleda", + "variational" + }; + ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); + + // Remove traits and program from argc and argv + // -------------------------------------------- + argv[2] = argv[0]; // Move executable name to third position + argv += 2; // Move pointer up two + argc -= 2; // Remove 2 from count + + // Call application specific main functions + // ---------------------------------------- + if (traits == "fv3jedi") { + fv3jedi::instantiateObsLocFactory(); + return runApp(argc, argv, traits, app); + } +} + +// ------------------------------------------------------------------------------------------------- From c16b0afa8bb7873b190624388fa6103490a92d5b Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Fri, 28 Jun 2024 14:34:22 +0000 Subject: [PATCH 02/11] First working version - now building through bundle/CMakeLists.txt --- CMakeLists.txt | 5 ----- build.sh | 2 +- bundle/CMakeLists.txt | 7 +++++++ 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 296c6462..318a8edc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,11 +41,6 @@ option(WORKFLOW_TESTS "Include regional-workflow dependent tests" OFF) option(MPAS_DYCORE "Use MPAS" OFF) option(FV3_DYCORE "Use FV3" ON) -if( BUILD_RDASBUNDLE ) - find_package( fv3jedi REQUIRED ) - add_subdirectory( mains ) -endif() - # Install utility scripts. #add_subdirectory(ush) diff --git a/build.sh b/build.sh index 82986a8d..6b1ff932 100755 --- a/build.sh +++ b/build.sh @@ -131,7 +131,7 @@ elif [[ $DYCORE == 'MPAS' ]]; then builddirs="mpas-jedi iodaconv" elif [[ $DYCORE == 'FV3andMPAS' ]]; then CMAKE_OPTS+=" -DFV3_DYCORE=ON -DMPAS_DYCORE=ON" - builddirs="rdas fv3-jedi mpas-jedi iodaconv" + builddirs="fv3-jedi mpas-jedi iodaconv" else echo "$DYCORE is not a valid dycore option. Valid options are FV3 or MPAS" exit 1 diff --git a/bundle/CMakeLists.txt b/bundle/CMakeLists.txt index 9559db59..c3cd95ac 100644 --- a/bundle/CMakeLists.txt +++ b/bundle/CMakeLists.txt @@ -107,6 +107,12 @@ endif() ecbuild_bundle( PROJECT iodaconv SOURCE "../sorc/iodaconv" ) endif() +# rdas mega executable +#--------------------------------- + find_package( fv3jedi REQUIRED ) + ecbuild_bundle( PROJECT rdas SOURCE "../mains" ) + #add_subdirectory( "../mains" "." ) + # ioda, ufo, fv3-jedi, and saber test data #--------------------------------- if(CLONE_JCSDADATA) @@ -140,6 +146,7 @@ endif() ecbuild_bundle( PROJECT rrfs-test SOURCE "../rrfs-test" ) endif(CLONE_RRFSDATA) + endif(BUILD_RDASBUNDLE) # Finalize bundle From 88b0bf83420f8e15fa3f4e3e2c0a1efb1b291e87 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Fri, 28 Jun 2024 14:35:58 +0000 Subject: [PATCH 03/11] Remove old comments --- bundle/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bundle/CMakeLists.txt b/bundle/CMakeLists.txt index c3cd95ac..ccc1e02c 100644 --- a/bundle/CMakeLists.txt +++ b/bundle/CMakeLists.txt @@ -107,11 +107,10 @@ endif() ecbuild_bundle( PROJECT iodaconv SOURCE "../sorc/iodaconv" ) endif() -# rdas mega executable +# rdas mega executable - move down once ready #--------------------------------- find_package( fv3jedi REQUIRED ) ecbuild_bundle( PROJECT rdas SOURCE "../mains" ) - #add_subdirectory( "../mains" "." ) # ioda, ufo, fv3-jedi, and saber test data #--------------------------------- From d09a75941b21306dddf3c3e71fca4862edfb64df Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Fri, 28 Jun 2024 18:23:25 +0000 Subject: [PATCH 04/11] Added bump option to rdas.x --- mains/rdas.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mains/rdas.cc b/mains/rdas.cc index 5524fa0b..355c93f7 100644 --- a/mains/rdas.cc +++ b/mains/rdas.cc @@ -8,6 +8,7 @@ #include "oops/generic/instantiateModelFactory.h" #include "saber/oops/instantiateCovarFactory.h" +#include "saber/oops/ErrorCovarianceToolbox.h" #include "ufo/instantiateObsErrorFactory.h" #include "ufo/instantiateObsFilterFactory.h" #include "ufo/ObsTraits.h" @@ -22,6 +23,7 @@ template int runApp(int argc, char** argv, const std::string traits, const std::string appName) { + // Create the Run object oops::Run run(argc, argv); @@ -51,6 +53,9 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap apps["convertstate"] = []() { return std::make_unique>(); }; + apps["bump"] = []() { + return std::make_unique>(); + }; apps["hofx4d"] = []() { return std::make_unique>(); }; @@ -93,6 +98,7 @@ int main(int argc, char ** argv) { // ---------------------------------------- const std::set validApps = { "convertstate", + "bump", "hofx4d", "localensembleda", "variational" From f86a6efa32d1a03be98cfd8515c4e238eb614654 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 01:43:22 +0000 Subject: [PATCH 05/11] Added mpas-jedi and split into rdas_fv3jedi and rdas_mpasjedi exes --- bundle/CMakeLists.txt | 4 +- mains/CMakeLists.txt | 28 +++++- mains/{rdas.cc => rdas_fv3jedi.cc} | 0 mains/rdas_mpasjedi.cc | 132 +++++++++++++++++++++++++++++ 4 files changed, 157 insertions(+), 7 deletions(-) rename mains/{rdas.cc => rdas_fv3jedi.cc} (100%) create mode 100644 mains/rdas_mpasjedi.cc diff --git a/bundle/CMakeLists.txt b/bundle/CMakeLists.txt index ccc1e02c..ff11b5a2 100644 --- a/bundle/CMakeLists.txt +++ b/bundle/CMakeLists.txt @@ -107,9 +107,7 @@ endif() ecbuild_bundle( PROJECT iodaconv SOURCE "../sorc/iodaconv" ) endif() -# rdas mega executable - move down once ready -#--------------------------------- - find_package( fv3jedi REQUIRED ) +# rdas mega executable ecbuild_bundle( PROJECT rdas SOURCE "../mains" ) # ioda, ufo, fv3-jedi, and saber test data diff --git a/mains/CMakeLists.txt b/mains/CMakeLists.txt index dcc0d527..c11f3012 100644 --- a/mains/CMakeLists.txt +++ b/mains/CMakeLists.txt @@ -1,6 +1,26 @@ # Build the big rdas executable used for all generic JEDI applications # -------------------------------------------------------------------- -ecbuild_add_executable( TARGET rdas.x - SOURCES rdas.cc - LIBS fv3jedi - ) + +#--------------------------------- + +set(CMAKE_CXX_STANDARD 17) + +if ( FV3_DYCORE ) + + find_package( fv3jedi REQUIRED ) + ecbuild_add_executable( TARGET rdas_fv3jedi.x + SOURCES rdas_fv3jedi.cc + LIBS fv3jedi + ) + +endif() + +if ( MPAS_DYCORE ) + + find_package( mpasjedi REQUIRED ) + ecbuild_add_executable( TARGET rdas_mpasjedi.x + SOURCES rdas_mpasjedi.cc + LIBS mpasjedi + ) + +endif() diff --git a/mains/rdas.cc b/mains/rdas_fv3jedi.cc similarity index 100% rename from mains/rdas.cc rename to mains/rdas_fv3jedi.cc diff --git a/mains/rdas_mpasjedi.cc b/mains/rdas_mpasjedi.cc new file mode 100644 index 00000000..314051c6 --- /dev/null +++ b/mains/rdas_mpasjedi.cc @@ -0,0 +1,132 @@ +// ------------------------------------------------------------------------------------------------- + +#include +#include + +#include "oops/generic/instantiateModelFactory.h" +#include "saber/oops/instantiateCovarFactory.h" +#include "saber/oops/ErrorCovarianceToolbox.h" +#include "saber/oops/instantiateLocalizationFactory.h" +#include "ufo/instantiateObsErrorFactory.h" +#include "ufo/instantiateObsFilterFactory.h" +#include "ufo/instantiateObsLocFactory.h" +#include "ufo/ObsTraits.h" + +#include "oops/runs/ConvertState.h" +#include "oops/runs/HofX4D.h" +#include "oops/runs/LocalEnsembleDA.h" +#include "oops/runs/Run.h" +#include "oops/runs/Variational.h" +#include "mpasjedi/Traits.h" + +// ------------------------------------------------------------------------------------------------- + +template +int runApp(int argc, char** argv, const std::string traits, const std::string appName) { + + // Create the Run object + oops::Run run(argc, argv); + + // Instantiate oops factories + oops::instantiateModelFactory(); + + // Instantiate saber factories + saber::instantiateCovarFactory(); + + // Intantiate ufo factories + ufo::instantiateObsErrorFactory(); + ufo::instantiateObsFilterFactory(); + + // Localization for ensemble DA + if (appName == "localensembleda") { + if (traits == "mpasjedi") { + ufo::instantiateObsLocFactory(); + } + } + + // Localization for variational DA + if (appName == "variational") { + if (traits == "mpasjedi") { + saber::instantiateLocalizationFactory(); + } + } + + // Intantiate ufo factories + ufo::instantiateObsErrorFactory(); + ufo::instantiateObsFilterFactory(); + + // Application pointer + std::unique_ptr app; + + // Define a map from app names to lambda functions that create unique_ptr to Applications + std::map()>> apps; + + apps["convertstate"] = []() { + return std::make_unique>(); + }; + apps["bump"] = []() { + return std::make_unique>(); + }; + apps["hofx4d"] = []() { + return std::make_unique>(); + }; + apps["localensembleda"] = []() { + return std::make_unique>(); + }; + apps["variational"] = []() { + return std::make_unique>(); + }; + + // Create application object and point to it + auto it = apps.find(appName); + + // Run the application + return run.execute(*(it->second())); +} + +// ------------------------------------------------------------------------------------------------- + +int main(int argc, char ** argv) { + // Check that the number of arguments is correct + // ---------------------------------------------- + ASSERT_MSG(argc >= 3, "Usage: " + std::string(argv[0]) + " "); + + // Get traits from second argument passed to executable + // ---------------------------------------------------- + std::string traits = argv[1]; + for (char &c : traits) {c = std::tolower(c);} + + // Get the application to be run + std::string app = argv[2]; + for (char &c : app) {c = std::tolower(c);} + + // Check that the traits are recognized + // ------------------------------------ + const std::set validTraits = {"mpasjedi"}; + ASSERT_MSG(validTraits.find(traits) != validTraits.end(), "Traits not recognized: " + traits); + + // Check that the application is recognized + // ---------------------------------------- + const std::set validApps = { + "convertstate", + "bump", + "hofx4d", + "localensembleda", + "variational" + }; + ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); + + // Remove traits and program from argc and argv + // -------------------------------------------- + argv[2] = argv[0]; // Move executable name to third position + argv += 2; // Move pointer up two + argc -= 2; // Remove 2 from count + + // Call application specific main functions + // ---------------------------------------- + if (traits == "mpasjedi") { + return runApp(argc, argv, traits, app); + } +} + +// ------------------------------------------------------------------------------------------------- From 562a0fcba7429dc5aee91b6cbd13f12c6f68ce49 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 02:31:06 +0000 Subject: [PATCH 06/11] Got rid of redundant trait argument now that we split into dyncore exes --- mains/rdas_fv3jedi.cc | 34 ++++++++++------------------------ mains/rdas_mpasjedi.cc | 36 ++++++++++-------------------------- 2 files changed, 20 insertions(+), 50 deletions(-) diff --git a/mains/rdas_fv3jedi.cc b/mains/rdas_fv3jedi.cc index 355c93f7..2150dd9d 100644 --- a/mains/rdas_fv3jedi.cc +++ b/mains/rdas_fv3jedi.cc @@ -22,7 +22,7 @@ // ------------------------------------------------------------------------------------------------- template -int runApp(int argc, char** argv, const std::string traits, const std::string appName) { +int runApp(int argc, char** argv, const std::string appName) { // Create the Run object oops::Run run(argc, argv); @@ -39,9 +39,7 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap // Localization for ensemble DA if (appName == "localensembleda") { - if (traits == "fv3jedi") { - fv3jedi::instantiateObsLocFactory(); - } + fv3jedi::instantiateObsLocFactory(); } // Application pointer @@ -78,22 +76,12 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap int main(int argc, char ** argv) { // Check that the number of arguments is correct // ---------------------------------------------- - ASSERT_MSG(argc >= 3, "Usage: " + std::string(argv[0]) + " "); - - // Get traits from second argument passed to executable - // ---------------------------------------------------- - std::string traits = argv[1]; - for (char &c : traits) {c = std::tolower(c);} + ASSERT_MSG(argc >= 2, "Usage: " + std::string(argv[0]) + " "); // Get the application to be run - std::string app = argv[2]; + std::string app = argv[1]; for (char &c : app) {c = std::tolower(c);} - // Check that the traits are recognized - // ------------------------------------ - const std::set validTraits = {"fv3jedi"}; - ASSERT_MSG(validTraits.find(traits) != validTraits.end(), "Traits not recognized: " + traits); - // Check that the application is recognized // ---------------------------------------- const std::set validApps = { @@ -105,18 +93,16 @@ int main(int argc, char ** argv) { }; ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); - // Remove traits and program from argc and argv + // Remove program from argc and argv // -------------------------------------------- - argv[2] = argv[0]; // Move executable name to third position - argv += 2; // Move pointer up two - argc -= 2; // Remove 2 from count + argv[1] = argv[0]; // Move executable name to second position + argv += 1; // Move pointer up two + argc -= 1; // Remove 1 from count // Call application specific main functions // ---------------------------------------- - if (traits == "fv3jedi") { - fv3jedi::instantiateObsLocFactory(); - return runApp(argc, argv, traits, app); - } + fv3jedi::instantiateObsLocFactory(); + return runApp(argc, argv, app); } // ------------------------------------------------------------------------------------------------- diff --git a/mains/rdas_mpasjedi.cc b/mains/rdas_mpasjedi.cc index 314051c6..6fafb08d 100644 --- a/mains/rdas_mpasjedi.cc +++ b/mains/rdas_mpasjedi.cc @@ -22,7 +22,7 @@ // ------------------------------------------------------------------------------------------------- template -int runApp(int argc, char** argv, const std::string traits, const std::string appName) { +int runApp(int argc, char** argv, const std::string appName) { // Create the Run object oops::Run run(argc, argv); @@ -39,16 +39,12 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap // Localization for ensemble DA if (appName == "localensembleda") { - if (traits == "mpasjedi") { - ufo::instantiateObsLocFactory(); - } + ufo::instantiateObsLocFactory(); } // Localization for variational DA if (appName == "variational") { - if (traits == "mpasjedi") { - saber::instantiateLocalizationFactory(); - } + saber::instantiateLocalizationFactory(); } // Intantiate ufo factories @@ -89,22 +85,12 @@ int runApp(int argc, char** argv, const std::string traits, const std::string ap int main(int argc, char ** argv) { // Check that the number of arguments is correct // ---------------------------------------------- - ASSERT_MSG(argc >= 3, "Usage: " + std::string(argv[0]) + " "); - - // Get traits from second argument passed to executable - // ---------------------------------------------------- - std::string traits = argv[1]; - for (char &c : traits) {c = std::tolower(c);} + ASSERT_MSG(argc >= 2, "Usage: " + std::string(argv[0]) + " "); // Get the application to be run - std::string app = argv[2]; + std::string app = argv[1]; for (char &c : app) {c = std::tolower(c);} - // Check that the traits are recognized - // ------------------------------------ - const std::set validTraits = {"mpasjedi"}; - ASSERT_MSG(validTraits.find(traits) != validTraits.end(), "Traits not recognized: " + traits); - // Check that the application is recognized // ---------------------------------------- const std::set validApps = { @@ -116,17 +102,15 @@ int main(int argc, char ** argv) { }; ASSERT_MSG(validApps.find(app) != validApps.end(), "Application not recognized: " + app); - // Remove traits and program from argc and argv + // Remove program from argc and argv // -------------------------------------------- - argv[2] = argv[0]; // Move executable name to third position - argv += 2; // Move pointer up two - argc -= 2; // Remove 2 from count + argv[1] = argv[0]; // Move executable name to second position + argv += 1; // Move pointer up two + argc -= 1; // Remove 1 from count // Call application specific main functions // ---------------------------------------- - if (traits == "mpasjedi") { - return runApp(argc, argv, traits, app); - } + return runApp(argc, argv, app); } // ------------------------------------------------------------------------------------------------- From 82c71e18924c15437d8ca2373a9d23fcccbc3480 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 02:50:24 +0000 Subject: [PATCH 07/11] rdas_mpasjedi.cc now more consistent with rdas_fv3jedi.cc --- mains/rdas_mpasjedi.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mains/rdas_mpasjedi.cc b/mains/rdas_mpasjedi.cc index 6fafb08d..1fdb22ba 100644 --- a/mains/rdas_mpasjedi.cc +++ b/mains/rdas_mpasjedi.cc @@ -28,10 +28,10 @@ int runApp(int argc, char** argv, const std::string appName) { oops::Run run(argc, argv); // Instantiate oops factories - oops::instantiateModelFactory(); + oops::instantiateModelFactory(); // Instantiate saber factories - saber::instantiateCovarFactory(); + saber::instantiateCovarFactory(); // Intantiate ufo factories ufo::instantiateObsErrorFactory(); @@ -39,12 +39,12 @@ int runApp(int argc, char** argv, const std::string appName) { // Localization for ensemble DA if (appName == "localensembleda") { - ufo::instantiateObsLocFactory(); + ufo::instantiateObsLocFactory(); } // Localization for variational DA if (appName == "variational") { - saber::instantiateLocalizationFactory(); + saber::instantiateLocalizationFactory(); } // Intantiate ufo factories @@ -58,19 +58,19 @@ int runApp(int argc, char** argv, const std::string appName) { std::map()>> apps; apps["convertstate"] = []() { - return std::make_unique>(); + return std::make_unique>(); }; apps["bump"] = []() { - return std::make_unique>(); + return std::make_unique>(); }; apps["hofx4d"] = []() { - return std::make_unique>(); + return std::make_unique>(); }; apps["localensembleda"] = []() { return std::make_unique>(); }; apps["variational"] = []() { - return std::make_unique>(); + return std::make_unique>(); }; // Create application object and point to it From 35b9b8b165d40cfbb12c85493e977f0e6de6e85d Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 03:10:16 +0000 Subject: [PATCH 08/11] Update ctests for new executable and argument structure --- rrfs-test/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/rrfs-test/CMakeLists.txt b/rrfs-test/CMakeLists.txt index 5294f134..66405f58 100644 --- a/rrfs-test/CMakeLists.txt +++ b/rrfs-test/CMakeLists.txt @@ -8,14 +8,14 @@ include(funcs.cmake) # FV3-JEDI tests set(rrfs_fv3jedi_tests) -add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_hyb_2022052619" "fv3jedi_var.x") -add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_letkf_2022052619" "fv3jedi_letkf.x") +add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_hyb_2022052619" "variational") +add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_letkf_2022052619" "localensembleda") # MPAS-JEDI tests set(rrfs_mpasjedi_tests) -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_Ens3Dvar" "mpasjedi_variational.x") -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_atms_npp_qc" "mpasjedi_variational.x") -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_letkf" "mpasjedi_enkf.x") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_Ens3Dvar" "variational") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_atms_npp_qc" "variational") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_letkf" "localensembleda") # rrfs data - from rrfs-test-data repo if found, from local directory, or from tarball @@ -40,7 +40,7 @@ if (CLONE_RRFSDATA) get_all_keys(rrfs_fv3jedi_tests caselist) foreach(case ${caselist}) - get_from_dictionary(rrfs_fv3jedi_tests case exe) + get_from_dictionary(rrfs_fv3jedi_tests case application) set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}") set(src_casedir "${rrfs-test_data_local}/rrfs-data_fv3jedi_2022052619") if (NOT EXISTS "${casedir}") @@ -55,8 +55,8 @@ if (CLONE_RRFSDATA) ecbuild_add_test( TARGET ${target_test} MPI 80 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test} - ARGS ${target_test}.yaml - COMMAND ${exe} ) + ARGS ${application} ${target_test}.yaml + COMMAND rdas_fv3jedi.x ) endforeach() if("${MACHINE_ID}" STREQUAL "orion") @@ -76,7 +76,7 @@ if (CLONE_RRFSDATA) get_all_keys(rrfs_mpasjedi_tests caselist) foreach(case ${caselist}) - get_from_dictionary(rrfs_mpasjedi_tests case exe) + get_from_dictionary(rrfs_mpasjedi_tests case application) set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}") set(src_casedir "${rrfs-test_data_local}/rrfs-data_mpasjedi_2022052619") if (NOT EXISTS "${casedir}") @@ -99,8 +99,8 @@ if (CLONE_RRFSDATA) ecbuild_add_test( TARGET ${target_test} MPI 36 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test} - ARGS ${target_test}.yaml - COMMAND ${exe} ) + ARGS ${application} ${target_test}.yaml + COMMAND rdas_mpasjedi.x ) endforeach() if("${MACHINE_ID}" STREQUAL "orion") From 003fba878af93e1a4b1533472b94cb2a462d7365 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 03:22:50 +0000 Subject: [PATCH 09/11] Updated template scripts for running experiments --- rrfs-test/scripts/templates/run_fv3jedi_template.sh | 2 +- rrfs-test/scripts/templates/run_mpasjedi_template.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rrfs-test/scripts/templates/run_fv3jedi_template.sh b/rrfs-test/scripts/templates/run_fv3jedi_template.sh index c30bd349..3759ed84 100755 --- a/rrfs-test/scripts/templates/run_fv3jedi_template.sh +++ b/rrfs-test/scripts/templates/run_fv3jedi_template.sh @@ -34,5 +34,5 @@ fi jedibin="@YOUR_PATH_TO_RDASAPP@/build/bin" # Run JEDI - currently cannot change processor count -srun -l -n 80 $jedibin/fv3jedi_var.x ./$inputfile out.log +srun -l -n 80 $jedibin/rdas_fv3jedi.x variational ./$inputfile out.log diff --git a/rrfs-test/scripts/templates/run_mpasjedi_template.sh b/rrfs-test/scripts/templates/run_mpasjedi_template.sh index a15138be..a956c992 100755 --- a/rrfs-test/scripts/templates/run_mpasjedi_template.sh +++ b/rrfs-test/scripts/templates/run_mpasjedi_template.sh @@ -34,5 +34,5 @@ fi jedibin="@YOUR_PATH_TO_RDASAPP@/build/bin" # Run JEDI - currently cannot change processor count -srun -l -n 36 $jedibin/mpasjedi_variational.x ./$inputfile out.log +srun -l -n 36 $jedibin/rdas_mpasjedi.x variational ./$inputfile out.log From f038dad1531036f31f90fece0cee9d58f1b24de3 Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Thu, 4 Jul 2024 18:28:33 +0000 Subject: [PATCH 10/11] Now using 2 nodes for mpas-jedi ctests --- mains/CMakeLists.txt | 9 +++++++++ rrfs-test/CMakeLists.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/mains/CMakeLists.txt b/mains/CMakeLists.txt index c11f3012..8f01690f 100644 --- a/mains/CMakeLists.txt +++ b/mains/CMakeLists.txt @@ -3,7 +3,16 @@ #--------------------------------- +# Standard compiler flags set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_C_EXTENSIONS OFF) +set(CMAKE_FORTRAN_STANDARD 08) +set(CMAKE_FORTRAN_STANDARD_REQUIRED ON) +set(CMAKE_FORTRAN_EXTENSIONS OFF) if ( FV3_DYCORE ) diff --git a/rrfs-test/CMakeLists.txt b/rrfs-test/CMakeLists.txt index 66405f58..a8438d21 100644 --- a/rrfs-test/CMakeLists.txt +++ b/rrfs-test/CMakeLists.txt @@ -73,6 +73,7 @@ if (CLONE_RRFSDATA) set(RESTORE_MPI_ARGS ${MPI_ARGS}) set(MPI_ARGS "${MPI_ARGS} --exclusive") endif() + set(MPI_ARGS "${MPI_ARGS} --ntasks-per-node=18") get_all_keys(rrfs_mpasjedi_tests caselist) foreach(case ${caselist}) From ee8939539fffc086b84f6945a23a127864ee881a Mon Sep 17 00:00:00 2001 From: SamuelDegelia-NOAA Date: Mon, 15 Jul 2024 14:44:50 +0000 Subject: [PATCH 11/11] No longer using mega exe for ctests or experiment scripts --- rrfs-test/CMakeLists.txt | 22 +++++++++---------- .../scripts/templates/run_fv3jedi_template.sh | 2 +- .../templates/run_mpasjedi_template.sh | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/rrfs-test/CMakeLists.txt b/rrfs-test/CMakeLists.txt index a8438d21..e5659d06 100644 --- a/rrfs-test/CMakeLists.txt +++ b/rrfs-test/CMakeLists.txt @@ -8,14 +8,14 @@ include(funcs.cmake) # FV3-JEDI tests set(rrfs_fv3jedi_tests) -add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_hyb_2022052619" "variational") -add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_letkf_2022052619" "localensembleda") +add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_hyb_2022052619" "fv3jedi_var.x") +add_to_dictionary(rrfs_fv3jedi_tests "rrfs_fv3jedi_letkf_2022052619" "fv3jedi_letkf.x") # MPAS-JEDI tests set(rrfs_mpasjedi_tests) -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_Ens3Dvar" "variational") -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_atms_npp_qc" "variational") -add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_letkf" "localensembleda") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_Ens3Dvar" "mpasjedi_variational.x") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_atms_npp_qc" "mpasjedi_variational.x") +add_to_dictionary(rrfs_mpasjedi_tests "rrfs_mpasjedi_2022052619_letkf" "mpasjedi_enkf.x") # rrfs data - from rrfs-test-data repo if found, from local directory, or from tarball @@ -40,7 +40,7 @@ if (CLONE_RRFSDATA) get_all_keys(rrfs_fv3jedi_tests caselist) foreach(case ${caselist}) - get_from_dictionary(rrfs_fv3jedi_tests case application) + get_from_dictionary(rrfs_fv3jedi_tests case exe) set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}") set(src_casedir "${rrfs-test_data_local}/rrfs-data_fv3jedi_2022052619") if (NOT EXISTS "${casedir}") @@ -55,8 +55,8 @@ if (CLONE_RRFSDATA) ecbuild_add_test( TARGET ${target_test} MPI 80 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test} - ARGS ${application} ${target_test}.yaml - COMMAND rdas_fv3jedi.x ) + ARGS ${target_test}.yaml + COMMAND ${exe} ) endforeach() if("${MACHINE_ID}" STREQUAL "orion") @@ -77,7 +77,7 @@ if (CLONE_RRFSDATA) get_all_keys(rrfs_mpasjedi_tests caselist) foreach(case ${caselist}) - get_from_dictionary(rrfs_mpasjedi_tests case application) + get_from_dictionary(rrfs_mpasjedi_tests case exe) set(casedir "${CMAKE_CURRENT_BINARY_DIR}/rundir-${case}") set(src_casedir "${rrfs-test_data_local}/rrfs-data_mpasjedi_2022052619") if (NOT EXISTS "${casedir}") @@ -100,8 +100,8 @@ if (CLONE_RRFSDATA) ecbuild_add_test( TARGET ${target_test} MPI 36 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rundir-${target_test} - ARGS ${application} ${target_test}.yaml - COMMAND rdas_mpasjedi.x ) + ARGS ${target_test}.yaml + COMMAND ${exe} ) endforeach() if("${MACHINE_ID}" STREQUAL "orion") diff --git a/rrfs-test/scripts/templates/run_fv3jedi_template.sh b/rrfs-test/scripts/templates/run_fv3jedi_template.sh index 3759ed84..c30bd349 100755 --- a/rrfs-test/scripts/templates/run_fv3jedi_template.sh +++ b/rrfs-test/scripts/templates/run_fv3jedi_template.sh @@ -34,5 +34,5 @@ fi jedibin="@YOUR_PATH_TO_RDASAPP@/build/bin" # Run JEDI - currently cannot change processor count -srun -l -n 80 $jedibin/rdas_fv3jedi.x variational ./$inputfile out.log +srun -l -n 80 $jedibin/fv3jedi_var.x ./$inputfile out.log diff --git a/rrfs-test/scripts/templates/run_mpasjedi_template.sh b/rrfs-test/scripts/templates/run_mpasjedi_template.sh index a956c992..a15138be 100755 --- a/rrfs-test/scripts/templates/run_mpasjedi_template.sh +++ b/rrfs-test/scripts/templates/run_mpasjedi_template.sh @@ -34,5 +34,5 @@ fi jedibin="@YOUR_PATH_TO_RDASAPP@/build/bin" # Run JEDI - currently cannot change processor count -srun -l -n 36 $jedibin/rdas_mpasjedi.x variational ./$inputfile out.log +srun -l -n 36 $jedibin/mpasjedi_variational.x ./$inputfile out.log