Changeset 617
- Timestamp:
- 06/11/15 15:25:47 (8 years ago)
- Location:
- XIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-1.0/src/output/nc4_data_output.cpp
r616 r617 94 94 break; 95 95 } 96 97 StdString dimVertId = StdString("nvertex").append(appendDomid); 96 98 97 99 string lonid,latid,bounds_lonid,bounds_latid ; … … 135 137 } 136 138 139 bounds_lonid = StdString("bounds_lon").append(appendDomid); 140 bounds_latid = StdString("bounds_lat").append(appendDomid); 141 137 142 SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv); 138 143 SuperClassWriter::addDimension(dimYid, domain->zoom_nj_srv); 144 145 if (domain->hasBounds) 146 SuperClassWriter::addDimension(dimVertId, domain->nvertex); 139 147 140 148 if (server->intraCommSize > 1) … … 168 176 this->writeAxisAttributes(lonid, isRegularDomain ? "X" : "", "longitude", "Longitude", "degrees_east", domid); 169 177 this->writeAxisAttributes(latid, isRegularDomain ? "Y" : "", "latitude", "Latitude", "degrees_north", domid); 178 179 if (domain->hasBounds) 180 { 181 SuperClassWriter::addAttribute("bounds", bounds_lonid, &lonid); 182 SuperClassWriter::addAttribute("bounds", bounds_latid, &latid); 183 184 dim0.clear(); 185 dim0.push_back(dimYid); 186 dim0.push_back(dimXid); 187 dim0.push_back(dimVertId); 188 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 189 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 190 } 170 191 171 192 dim0.clear(); … … 211 232 } 212 233 234 if (domain->hasBounds) 235 { 236 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0); 237 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0); 238 } 239 213 240 if (domain->hasArea) 214 241 SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0); … … 222 249 SuperClassWriter::addDimension(dimXid, domain->zoom_ni.getValue()); 223 250 SuperClassWriter::addDimension(dimYid, domain->zoom_nj.getValue()); 251 252 if (domain->hasBounds) 253 SuperClassWriter::addDimension(dimVertId, domain->nvertex); 224 254 225 255 switch (domain->type) … … 243 273 } 244 274 275 bounds_lonid = StdString("bounds_lon").append(appendDomid); 276 bounds_latid = StdString("bounds_lat").append(appendDomid); 277 245 278 if (domain->hasArea) 246 279 { … … 257 290 this->writeAxisAttributes 258 291 (latid, isRegularDomain ? "Y" : "", "latitude", "Latitude", "degrees_north", domid); 292 293 if (domain->hasBounds) 294 { 295 SuperClassWriter::addAttribute("bounds", bounds_lonid, &lonid); 296 SuperClassWriter::addAttribute("bounds", bounds_latid, &latid); 297 298 dim0.clear(); 299 dim0.push_back(dimYid); 300 dim0.push_back(dimXid); 301 dim0.push_back(dimVertId); 302 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 303 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 304 } 259 305 260 306 SuperClassWriter::definition_end(); … … 305 351 break; 306 352 } 353 } 354 355 if (domain->hasBounds) 356 { 357 std::vector<StdSize> start(3); 358 std::vector<StdSize> count(3); 359 if (domain->isEmpty()) 360 { 361 start[2] = start[1] = start[0] = 0; 362 count[2] = count[1] = count[0] = 0; 363 } 364 else 365 { 366 start[2] = 0; 367 start[1] = domain->zoom_ibegin_srv - domain->zoom_ibegin.getValue(); 368 start[0] = domain->zoom_jbegin_srv - domain->zoom_jbegin.getValue(); 369 count[2] = domain->nvertex; 370 count[1] = domain->zoom_ni_srv; 371 count[0] = domain->zoom_nj_srv; 372 } 373 374 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0, &start, &count); 375 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0, &start, &count); 307 376 } 308 377 -
XIOS/trunk/src/output/nc4_data_output.cpp
r616 r617 96 96 } 97 97 98 StdString dimVertId = StdString("nvertex").append(appendDomid); 99 98 100 string lonid,latid,bounds_lonid,bounds_latid ; 99 101 string areaId = "area" + appendDomid; … … 136 138 } 137 139 140 bounds_lonid = StdString("bounds_lon").append(appendDomid); 141 bounds_latid = StdString("bounds_lat").append(appendDomid); 142 138 143 SuperClassWriter::addDimension(dimXid, domain->zoom_ni_srv); 139 144 SuperClassWriter::addDimension(dimYid, domain->zoom_nj_srv); 145 146 if (domain->hasBounds) 147 SuperClassWriter::addDimension(dimVertId, domain->nvertex); 140 148 141 149 if (server->intraCommSize > 1) … … 169 177 this->writeAxisAttributes(lonid, isRegularDomain ? "X" : "", "longitude", "Longitude", "degrees_east", domid); 170 178 this->writeAxisAttributes(latid, isRegularDomain ? "Y" : "", "latitude", "Latitude", "degrees_north", domid); 179 180 if (domain->hasBounds) 181 { 182 SuperClassWriter::addAttribute("bounds", bounds_lonid, &lonid); 183 SuperClassWriter::addAttribute("bounds", bounds_latid, &latid); 184 185 dim0.clear(); 186 dim0.push_back(dimYid); 187 dim0.push_back(dimXid); 188 dim0.push_back(dimVertId); 189 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 190 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 191 } 171 192 172 193 dim0.clear(); … … 212 233 } 213 234 235 if (domain->hasBounds) 236 { 237 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0); 238 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0); 239 } 240 214 241 if (domain->hasArea) 215 242 SuperClassWriter::writeData(domain->area_srv, areaId, isCollective, 0); … … 223 250 SuperClassWriter::addDimension(dimXid, domain->zoom_ni.getValue()); 224 251 SuperClassWriter::addDimension(dimYid, domain->zoom_nj.getValue()); 252 253 if (domain->hasBounds) 254 SuperClassWriter::addDimension(dimVertId, domain->nvertex); 225 255 226 256 switch (domain->type) … … 244 274 } 245 275 276 bounds_lonid = StdString("bounds_lon").append(appendDomid); 277 bounds_latid = StdString("bounds_lat").append(appendDomid); 278 246 279 if (domain->hasArea) 247 280 { … … 258 291 this->writeAxisAttributes 259 292 (latid, isRegularDomain ? "Y" : "", "latitude", "Latitude", "degrees_north", domid); 293 294 if (domain->hasBounds) 295 { 296 SuperClassWriter::addAttribute("bounds", bounds_lonid, &lonid); 297 SuperClassWriter::addAttribute("bounds", bounds_latid, &latid); 298 299 dim0.clear(); 300 dim0.push_back(dimYid); 301 dim0.push_back(dimXid); 302 dim0.push_back(dimVertId); 303 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0); 304 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0); 305 } 260 306 261 307 SuperClassWriter::definition_end(); … … 306 352 break; 307 353 } 354 } 355 356 if (domain->hasBounds) 357 { 358 std::vector<StdSize> start(3); 359 std::vector<StdSize> count(3); 360 if (domain->isEmpty()) 361 { 362 start[2] = start[1] = start[0] = 0; 363 count[2] = count[1] = count[0] = 0; 364 } 365 else 366 { 367 start[2] = 0; 368 start[1] = domain->zoom_ibegin_srv - domain->zoom_ibegin.getValue(); 369 start[0] = domain->zoom_jbegin_srv - domain->zoom_jbegin.getValue(); 370 count[2] = domain->nvertex; 371 count[1] = domain->zoom_ni_srv; 372 count[0] = domain->zoom_nj_srv; 373 } 374 375 SuperClassWriter::writeData(domain->bounds_lon_srv, bounds_lonid, isCollective, 0, &start, &count); 376 SuperClassWriter::writeData(domain->bounds_lat_srv, bounds_latid, isCollective, 0, &start, &count); 308 377 } 309 378
Note: See TracChangeset
for help on using the changeset viewer.