diff --git a/ChangeLog b/ChangeLog index c77170b31eb220e16b7c86a968c95bd0337b17e7..258953d0d7df6635e9061ea812fe308d2c0a497c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,10 @@ * Using CDI library version 2.5.1 * Version 2.5.1 release +2025-01-10 Uwe Schulzweida + + * enable NETCDF_LAZY_GRID_LOAD for operators without output stream + 2024-11-28 Uwe Schulzweida * Using CDI library version 2.5.0 diff --git a/src/Diff.cc b/src/Diff.cc index 17d60eb1107245a12284ecdd126c126097b105a2..e139f4c6c84a9bdcffea39b485d007eee04a89c2 100644 --- a/src/Diff.cc +++ b/src/Diff.cc @@ -356,6 +356,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto operatorID = cdo_operator_id(); operfunc = cdo_operator_f1(operatorID); operfunc2 = cdo_operator_f2(operatorID); diff --git a/src/Filedes.cc b/src/Filedes.cc index a37a7bdf26fd9028e40cf5d4e07a886fc03d215a..cd143cb6a01f0b62c05ef8501277de9e2826e64f 100644 --- a/src/Filedes.cc +++ b/src/Filedes.cc @@ -272,6 +272,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto GRIDDES = module.get_id("griddes"); auto GRIDDES2 = module.get_id("griddes2"); auto ZAXISDES = module.get_id("zaxisdes"); diff --git a/src/Getgridcell.cc b/src/Getgridcell.cc index ed04cd35744a12ee1c99debad52351fca82b3b1f..5f54166d5494f619af4aa6c4a256eae7ff104c92 100644 --- a/src/Getgridcell.cc +++ b/src/Getgridcell.cc @@ -132,6 +132,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + gridPoint = get_parameter(); check_radius_range(gridPoint.radius, "radius"); diff --git a/src/Info.cc b/src/Info.cc index 125dfa733d2a98f5855fef78d3910f55419d67ad..27a27a6beecf2ee8e21eeff0c9410320f4c28c04 100644 --- a/src/Info.cc +++ b/src/Info.cc @@ -158,7 +158,7 @@ char_to_mode_and_color(unsigned char c, int &blinkMin, int &blinkMax) TextColor color(BLACK); switch (c) { - // clang-format off + // clang-format off case '0': mode = BRIGHT ; color = BLUE ; break; case '1': mode = MODELESS; color = BLUE ; break; case '2': mode = BRIGHT ; color = CYAN ; break; @@ -478,6 +478,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto VINFON = module.get_id("vinfon"); auto XINFON = module.get_id("xinfon"); auto MAP = module.get_id("map"); diff --git a/src/Longinfo.cc b/src/Longinfo.cc index 88794146a4396cde90eabf7be786c6389e7f9333..ba157d8178d73ff1458f021f7d0902ed7bc7b321 100644 --- a/src/Longinfo.cc +++ b/src/Longinfo.cc @@ -178,6 +178,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + operator_check_argc(0); streamID = cdo_open_read(0); @@ -215,8 +217,8 @@ public: if (runAsync && numSets > 0) { task->wait(); } - std::function<void()> long_info_func - = std::bind(long_info, std::ref(field), tsID, vDateTime, numFields, fieldID, varID, levelID, vlistID, std::cref(var)); + std::function<void()> long_info_func = std::bind(long_info, std::ref(field), tsID, vDateTime, numFields, fieldID, varID, + levelID, vlistID, std::cref(var)); runAsync ? task->doAsync(long_info_func) : long_info_func(); diff --git a/src/Ninfo.cc b/src/Ninfo.cc index 078e5e55571db0abc3128b137665fa7e756ba0ea..35a5c041a9e44df1fb1bcdd3cfc7934093831c8e 100644 --- a/src/Ninfo.cc +++ b/src/Ninfo.cc @@ -68,6 +68,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto operatorID = cdo_operator_id(); operfunc = cdo_operator_f1(operatorID); diff --git a/src/Showattribute.cc b/src/Showattribute.cc index a9f61510962198355755b69b947f5cac5d8e823c..a7f61b6ef022c63e7bf5bfb81507c34f16a26c14 100644 --- a/src/Showattribute.cc +++ b/src/Showattribute.cc @@ -238,6 +238,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + SHOWATTRIBUTE = module.get_id("showattribute"); SHOWATTSVAR = module.get_id("showattsvar"); diff --git a/src/Showinfo.cc b/src/Showinfo.cc index d089acd38131d804e8b6e2e664b57a8e8f5acb32..35b194edfaab84c2a0a368ad12e8772d56c4a5aa 100644 --- a/src/Showinfo.cc +++ b/src/Showinfo.cc @@ -360,6 +360,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto SHOWYEAR = module.get_id("showyear"); auto SHOWMON = module.get_id("showmon"); auto SHOWDATE = module.get_id("showdate"); diff --git a/src/Sinfo.cc b/src/Sinfo.cc index 12b44015cf21ecadb4b609510af7d257648be568..49ac21dbe005355ed67b22de47daf4d09dfcc343 100644 --- a/src/Sinfo.cc +++ b/src/Sinfo.cc @@ -400,6 +400,8 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } + auto operatorID = cdo_operator_id(); operfunc = cdo_operator_f1(operatorID); diff --git a/src/Tinfo.cc b/src/Tinfo.cc index da9520ee5d51cc1e3088cf0027484e2cc5513b5e..fa3d2246bc5a63e515dad882f16d7c8e436eb0f4 100644 --- a/src/Tinfo.cc +++ b/src/Tinfo.cc @@ -114,7 +114,7 @@ public: using Process::Process; inline static CdoModule module = { .name = "Tinfo", - .operators = { { "tinfo"} }, + .operators = { { "tinfo" } }, .aliases = {}, .mode = EXPOSED, // Module mode: 0:intern 1:extern .number = CDI_BOTH, // Allowed number type @@ -148,6 +148,7 @@ public: void init() override { + if (this_is_the_only_process()) { cdiDefGlobal("NETCDF_LAZY_GRID_LOAD", true); } operator_check_argc(0);