Legacy Metgrid SST/TSK arrays are absolute temperature, whereas current Metgrid initialization stores the SurfaceLayer representation (theta). Without the marker there is no pressure in a checkpoint with which to reinterpret those legacy arrays safely.
105 constexpr
const char* key =
"erf.init_type";
106 constexpr std::size_t key_length = 13;
110 while (std::getline(input, line)) {
112 while (pos < line.size() &&
113 std::isspace(
static_cast<unsigned char>(line[pos]))) {
116 if (line.compare(pos, key_length, key) != 0) {
120 if (pos < line.size() && !std::isspace(
static_cast<unsigned char>(line[pos])) &&
124 while (pos < line.size() &&
125 std::isspace(
static_cast<unsigned char>(line[pos]))) {
128 if (pos == line.size() || line[pos] !=
'=') {
129 result = LegacyInitType::Unknown;
133 while (pos < line.size() &&
134 std::isspace(
static_cast<unsigned char>(line[pos]))) {
139 bool malformed = (pos == line.size());
140 if (!malformed && line[pos] ==
'"') {
142 const std::size_t end_quote = line.find(
'"', pos);
143 if (end_quote == std::string::npos) {
146 value = line.substr(pos, end_quote - pos);
149 }
else if (!malformed) {
150 const std::size_t value_begin = pos;
151 while (pos < line.size() &&
152 !std::isspace(
static_cast<unsigned char>(line[pos]))) {
155 value = line.substr(value_begin, pos - value_begin);
158 while (pos < line.size() &&
159 std::isspace(
static_cast<unsigned char>(line[pos]))) {
162 if (malformed || pos != line.size()) {
163 result = LegacyInitType::Unknown;
LegacyInitType parse_legacy_init_type_value(std::string value)
Definition: ERF_CheckpointSurfaceTemperature.H:63
LegacyInitType
Definition: ERF_CheckpointSurfaceTemperature.H:50