Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ subroutine cutcell_list(n12, jamasks)

jastored = 0

inquire (FILE=md_cutcelllist, EXIST=JAWEL)
inquire (FILE=trim(md_cutcelllist), EXIST=JAWEL)
NUMFIL = 0
if (JAWEL) then
call OLDFIL(MLIST, md_cutcelllist)
Expand Down
10 changes: 2 additions & 8 deletions src/engines_gpl/dimr/packages/dimr_lib/include/dimr.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,7 @@ class Log;
class Dimr
{
public:
static Dimr* GetInstance()
{
if (instance == NULL) instance = new Dimr();
return instance;
}
static Dimr* GetInstance();

void scanConfigFile(void);
void connectLibs(void);
Expand Down Expand Up @@ -144,16 +140,14 @@ class Dimr
Level feedbackLevel;
const char* configfile; // name of configuration file
bool done; // set to true when it's time to stop
bool logIsOwned; // false when log was injected via set_dimr_logger (owned by the caller)
char* redirectFile; // Name of file to redirect stdout/stderr to
// Default: Off when started via dimr-exe, On otherwise

char* dimrWorkingDirectory; // File path where dimr configuration file is
const char* dirSeparator;
// String constants; initialized below, outside class definition
private:
// static Dimr *m_pInstance;
static Dimr* instance;

Dimr();
~Dimr();
Dimr(Dimr const&) = delete; // Don't Implement.
Expand Down
18 changes: 9 additions & 9 deletions src/engines_gpl/dimr/packages/dimr_lib/include/dimr_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,20 @@ typedef void(CDECLOPT* BMI_GETVARSHAPE)(const char*, int*);
typedef struct dimr_component dimr_component;
struct dimr_component
{
const char* name; // Component name: must be unique in the config.xml file (e.g. myNameFlow)
char* library; // Component library name, without extension/prefix
int type; // COMP_TYPE_FM, COMP_TYPE_RTC or COMP_TYPE_WAVE
const char* name; // Component name: must be unique in the config.xml file (e.g. myNameFlow)
const char* library; // Component library name, without extension/prefix
int type; // COMP_TYPE_FM, COMP_TYPE_RTC or COMP_TYPE_WAVE
#ifdef _WIN32
HINSTANCE libHandle; // (Windows) Handle to the loaded library for this component.
#else
void* libHandle; // (Linux) Handle to the loaded library for this component.
#endif
char* inputFile; // Component inputFile name
char* workingDir; // Component working directory
int* processes; // (Optional) list of processes ranks that this component needs to run in.
int numProcesses; // Count of processes array.
bool onThisRank; // Whether this component needs to run on current process rank.
char* mpiCommVar; // (Optional) Variable name for component's MPI communicator (must be accesible via BMI).
const char* inputFile; // Component inputFile name
char* workingDir; // Component working directory (owned, heap-allocated)
int* processes; // (Optional) list of processes ranks that this component needs to run in.
int numProcesses; // Count of processes array.
bool onThisRank; // Whether this component needs to run on current process rank.
const char* mpiCommVar; // (Optional) Variable name for component's MPI communicator (must be accesible via BMI).
MPI_Comm mpiComm; // An MPI communicator specific for this component (may run on less processes than master dimr).
BMI_INITIALIZE dllInitialize; // entry point in dll
BMI_UPDATE dllUpdate; // entry point in dll
Expand Down
4 changes: 2 additions & 2 deletions src/engines_gpl/dimr/packages/dimr_lib/include/dimr_coupler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ typedef struct dimr_coupler dimr_coupler;
struct dimr_coupler
{
const char* name; // Coupler name: must be unique in the config.xml file (e.g. rtc2flow)
char* sourceComponentName; // Name of the component providing data to be communicated by the coupler
char* targetComponentName; // Name of the component receiving data to be communicated by the coupler
const char* sourceComponentName; // Name of the component providing data to be communicated by the coupler
const char* targetComponentName; // Name of the component receiving data to be communicated by the coupler
dimr_component* sourceComponent; // Pointer to the related component
dimr_component* targetComponent; // idem
unsigned int numItems;
Expand Down
25 changes: 8 additions & 17 deletions src/engines_gpl/dimr/packages/dimr_lib/include/xmltree.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class XmlTree

void Print(void);

std::string charData;
XmlTree* parent;
std::vector<XmlTree*> children;
std::string name;

private:
void init(void);

Expand All @@ -107,21 +112,7 @@ class XmlTree

static std::string EnvSubst(std::string instr);

public:
static const int maxCharData = 1000000; // maximum size of an XML character data block
static const int maxPathname = 2560; // maximum length of a full path name

XmlTree* parent;
char* name;
char* pathname;

std::vector<char*> attribNames;
std::vector<char*> attribValues;

std::vector<XmlTree*> children;

char* charData;
int charDataLen;

private:
std::string pathname;
std::vector<std::string> attribNames;
std::vector<std::string> attribValues;
};
5 changes: 5 additions & 0 deletions src/engines_gpl/dimr/packages/dimr_lib/src/bmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ BMI_API void set_dimr_logger(Log* loggerFromDimrExe)
{
thisDimr = Dimr::GetInstance();
}
if (thisDimr->logIsOwned)
{
delete thisDimr->log; // owned by Dimr; replaced by the caller's logger
thisDimr->logIsOwned = false;
}
thisDimr->log = loggerFromDimrExe;
}

Expand Down
Loading
Loading