ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_checkpoint_lsm_data Namespace Reference

Functions

bool is_separately_named (const std::vector< std::string > &names, const std::size_t ivar)
 
std::string file_stem (const std::vector< std::string > &names, const std::size_t ivar)
 
bool may_be_absent (const std::vector< std::string > &names, const std::size_t ivar)
 

Detailed Description

File names of the LSM data in a checkpoint.

lsm_data[i] is written as "LsmData<i>". The Noah-MP snow and snowh fields were added in the middle of that numbering, which would shift every later index (the soil fields) by two and make an older checkpoint restart with the wrong fields. They are therefore stored under their own names and left out of the numbering, so every other field keeps the index it always had. A restart from a checkpoint that predates them keeps their initial values.

Function Documentation

◆ file_stem()

std::string erf_checkpoint_lsm_data::file_stem ( const std::vector< std::string > &  names,
const std::size_t  ivar 
)
inline
29 {
30  if (is_separately_named(names, ivar)) {
31  return "LsmData_" + names[ivar];
32  }
33  std::size_t index = ivar;
34  for (std::size_t k = 0; k < ivar; ++k) {
35  if (is_separately_named(names, k)) { --index; }
36  }
37  return "LsmData" + std::to_string(index);
38 }
bool is_separately_named(const std::vector< std::string > &names, const std::size_t ivar)
Definition: ERF_CheckpointLsmData.H:21

Referenced by ERF::ReadCheckpointFile(), and ERF::WriteCheckpointFile().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_separately_named()

bool erf_checkpoint_lsm_data::is_separately_named ( const std::vector< std::string > &  names,
const std::size_t  ivar 
)
inline
22 {
23  return ivar < names.size() && (names[ivar] == "snow" || names[ivar] == "snowh");
24 }

Referenced by file_stem(), and may_be_absent().

Here is the caller graph for this function:

◆ may_be_absent()

bool erf_checkpoint_lsm_data::may_be_absent ( const std::vector< std::string > &  names,
const std::size_t  ivar 
)
inline
43 {
44  return is_separately_named(names, ivar);
45 }

Referenced by ERF::ReadCheckpointFile().

Here is the call graph for this function:
Here is the caller graph for this function: