Skip to content

Commit

Permalink
fix segmentation fault issue and read in thermo params correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sjsprecious committed Jul 25, 2024
1 parent a3ba19f commit 9acdbb9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
38 changes: 19 additions & 19 deletions ncar_scripts/TDRP/beltramiTR.tdrp
Original file line number Diff line number Diff line change
Expand Up @@ -1237,114 +1237,114 @@ k_max_wavenumber = { -1, -1 };

//======================================================================
//
// VARIABLES NEEDED BY THERMO
// VARIABLES NEEDED BY THERMO.
//
//======================================================================

///////////// i_pip_bcL ///////////////////////////////
//
// Type: int

i_pip_bcL = 0;
i_pip_bcL = -1;

///////////// i_pip_bcR ///////////////////////////////
//
// Type: int

i_pip_bcR = 0;
i_pip_bcR = -1;

///////////// i_thetarhop_bcL ///////////////////////////////
//
// Type: int

i_thetarhop_bcL = 0;
i_thetarhop_bcL = -1;

///////////// i_thetarhop_bcR ///////////////////////////////
//
// Type: int

i_thetarhop_bcR = 0;
i_thetarhop_bcR = -1;

///////////// i_ftheta_bcL ///////////////////////////////
//
// Type: int

i_ftheta_bcL = 0;
i_ftheta_bcL = -1;

///////////// i_ftheta_bcR ///////////////////////////////
//
// Type: int

i_ftheta_bcR = 0;
i_ftheta_bcR = -1;

///////////// j_pip_bcL ///////////////////////////////
//
// Type: int

j_pip_bcL = 0;
j_pip_bcL = -1;

///////////// j_pip_bcR ///////////////////////////////
//
// Type: int

j_pip_bcR = 0;
j_pip_bcR = -1;

///////////// j_thetarhop_bcL ///////////////////////////////
//
// Type: int

j_thetarhop_bcL = 0;
j_thetarhop_bcL = -1;

///////////// j_thetarhop_bcR ///////////////////////////////
//
// Type: int

j_thetarhop_bcR = 0;
j_thetarhop_bcR = -1;

///////////// j_ftheta_bcL ///////////////////////////////
//
// Type: int

j_ftheta_bcL = 0;
j_ftheta_bcL = -1;

///////////// j_ftheta_bcR ///////////////////////////////
//
// Type: int

j_ftheta_bcR = 0;
j_ftheta_bcR = -1;

///////////// k_pip_bcL ///////////////////////////////
//
// Type: int

k_pip_bcL = 0;
k_pip_bcL = -1;

///////////// k_pip_bcR ///////////////////////////////
//
// Type: int

k_pip_bcR = 0;
k_pip_bcR = -1;

///////////// k_thetarhop_bcL ///////////////////////////////
//
// Type: int

k_thetarhop_bcL = 0;
k_thetarhop_bcL = -1;

///////////// k_thetarhop_bcR ///////////////////////////////
//
// Type: int

k_thetarhop_bcR = 0;
k_thetarhop_bcR = -1;

///////////// k_ftheta_bcL ///////////////////////////////
//
// Type: int

k_ftheta_bcL = 0;
k_ftheta_bcL = -1;

///////////// k_ftheta_bcR ///////////////////////////////
//
// Type: int

k_ftheta_bcR = 0;
k_ftheta_bcR = -1;
2 changes: 1 addition & 1 deletion src/Params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3209,7 +3209,7 @@
tt->val_offset = (char *) &k_ftheta_bcR - &_start_;
tt->single_val.i = -999;
tt++;

// trailing entry has param_name set to NULL

tt->param_name = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/Params.hh
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ private:

void _init();

mutable TDRPtable _table[191];
mutable TDRPtable _table[210];

const char *_className;

Expand Down
6 changes: 5 additions & 1 deletion src/VarDriver3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ bool VarDriver3D::validateDriver()

// Print the analysis_type from the TDRP config file
std::cout << "Analysis type: " << configHash["analysis_type"] << std::endl;
if(configHash["analysis_type"] != "WIND") {
if(configHash["analysis_type"] != "WIND")
{
std::cout << "i_pip_bcL = " << configHash["i_pip_bcL"] << std::endl;
std::cout << "j_pip_bcR = " << configHash["j_pip_bcR"] << std::endl;
std::cout << "k_ftheta_bcL = " << configHash["k_ftheta_bcL"] << std::endl;

Check warning on line 110 in src/VarDriver3D.cpp

View check run for this annotation

Codecov / codecov/patch

src/VarDriver3D.cpp#L108-L110

Added lines #L108 - L110 were not covered by tests
std::cout << "Currently unsupported Analysis type: " << configHash["analysis_type"] << ", Aborting..." << std::endl;
return false;
}
Expand Down

0 comments on commit 9acdbb9

Please sign in to comment.