Skip to content

Commit ccc1c28

Browse files
committed
Debug code that will be deleted later.
1 parent 11ef9d5 commit ccc1c28

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

components/omega/configs/Default.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ Omega:
3232
Density0: 1026.0
3333
BottomDragTendencyEnable: false
3434
BottomDragCoeff: 0.0
35-
TracerHorzAdvTendencyEnable: true
35+
TracerHorzAdvTendencyEnable: false
36+
TracerHighOrderHorzAdvTendencyEnable: true
3637
TracerDiffTendencyEnable: true
3738
EddyDiff2: 10.0
3839
TracerHyperDiffTendencyEnable: true

components/omega/src/ocn/OceanInit.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929
#include "mpi.h"
3030

31+
#include <iostream>
32+
3133
namespace OMEGA {
3234

3335
int ocnInit(MPI_Comm Comm ///< [in] ocean MPI communicator
@@ -58,7 +60,9 @@ int ocnInit(MPI_Comm Comm ///< [in] ocean MPI communicator
5860

5961
// Call init routines for remaining Omega modules
6062
int initOmegaModules(MPI_Comm Comm) {
61-
63+
int MyTask=0;
64+
MPI_Comm_rank(Comm, &MyTask);
65+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
6266
// error and return codes
6367
int Err = 0;
6468

@@ -133,21 +137,25 @@ int initOmegaModules(MPI_Comm Comm) {
133137
int Err1 = IOStream::Success;
134138
int Err2 = IOStream::Success;
135139

140+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
136141
// read from initial state if this is starting a new simulation
137142
Metadata ReqMeta; // no requested metadata for initial state
138143
Err1 = IOStream::read("InitialState", ModelClock, ReqMeta);
139144

145+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
140146
// read restart if starting from restart
141147
SimTimeStr = " ";
142148
ReqMeta["SimulationTime"] = SimTimeStr;
143149
Err2 = IOStream::read("RestartRead", ModelClock, ReqMeta);
144150

151+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
145152
// One of the above two streams must be successful to initialize the
146153
// state and other fields used in the model
147154
if (Err1 != IOStream::Success and Err2 != IOStream::Success) {
148155
ABORT_ERROR("Error initializing ocean variables from input streams");
149156
}
150157

158+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
151159
// If reading from restart, reset the current time to the input time
152160
if (SimTimeStr != " ") {
153161
TimeInstant NewCurrentTime(SimTimeStr);
@@ -178,6 +186,7 @@ int initOmegaModules(MPI_Comm Comm) {
178186
ABORT_ERROR("Error updating tracer device arrays after restart");
179187
}
180188

189+
std::cout<<__FILE__<<":"<<__LINE__<<":"<<MyTask<<std::endl;
181190
return Err;
182191

183192
} // end initOmegaModules

components/omega/src/ocn/Tendencies.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include "Error.h"
1414
#include "Tracers.h"
1515

16+
#include <iostream>
17+
1618
namespace OMEGA {
1719

1820
Tendencies *Tendencies::DefaultTendencies = nullptr;
@@ -165,11 +167,16 @@ void Tendencies::readTendConfig(
165167
if (TendConfig->existsVar("TracerHorzAdvTendencyEnable")) {
166168
TendConfig->get("TracerHorzAdvTendencyEnable",
167169
this->TracerHorzAdv.Enabled);
168-
} else if (TendConfig->existsVar("TracerHighOrderHorzAdvTendencyEnable")) {
170+
std::cout<<__FILE__<<":"<<__LINE__<<" Using TracerHorzAdvTendencyEnable:"<<this->TracerHorzAdv.Enabled<<std::endl;
171+
}
172+
if (TendConfig->existsVar("TracerHighOrderHorzAdvTendencyEnable")) {
169173
TendConfig->get("TracerHighOrderHorzAdvTendencyEnable",
170174
this->TracerHighOrderHorzAdv.Enabled);
171175
this->TracerHighOrderHorzAdv.init();
172-
} else {
176+
std::cout<<__FILE__<<":"<<__LINE__<<" Using TracerHighOrderHorzAdvTendencyEnable"<<this->TracerHighOrderHorzAdv.Enabled<<std::endl;
177+
}
178+
if (!TendConfig->existsVar("TracerHorzAdvTendencyEnable") && !TendConfig->existsVar("TracerHighOrderHorzAdvTendencyEnable")) {
179+
std::cout<<__FILE__<<":"<<__LINE__<<" Neigher TracerHorzAdvTendencyEnable nor TracerHighOrderHorzAdvTendencyEnable found"<<std::endl;
173180
Err += TendConfig->get("TracerHorzAdvTendencyEnable",
174181
this->TracerHorzAdv.Enabled);
175182
Err += TendConfig->get("TracerHighOrderHorzAdvTendencyEnable",
@@ -178,6 +185,12 @@ void Tendencies::readTendConfig(
178185
Err, "Tendencies: Neither TracerHorzAdvTendencyEnable nor "
179186
"TracerHighOrderHorzAdvTendencyEnable found in TendConfig");
180187
}
188+
if (this->TracerHorzAdv.Enabled && this->TracerHighOrderHorzAdv.Enabled) {
189+
Err += Error(ErrorCode::Fail);
190+
CHECK_ERROR_ABORT(
191+
Err, "Tendencies: Both TracerHorzAdvTendencyEnable and "
192+
"TracerHighOrderHorzAdvTendencyEnable set to true in TendConfig. Only one should be set to true.");
193+
}
181194

182195
Err += TendConfig->get("TracerDiffTendencyEnable",
183196
this->TracerDiffusion.Enabled);

0 commit comments

Comments
 (0)