#include <NCWriteScrip.hpp>
Inheritance diagram for moab::NCWriteScrip:
Collaboration diagram for moab::NCWriteScrip:Public Member Functions | |
| NCWriteScrip (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
| virtual | ~NCWriteScrip () override |
| ErrorCode | collect_mesh_info () override |
| Collect cells + compute SCRIP-ready center/corner lat/lon arrays. More... | |
| ErrorCode | init_file (std::vector< std::string > &var_names, std::vector< std::string > &desired_names, bool _append) override |
| Override: synthesize the SCRIP schema directly — no need for the climate var_names / dim plumbing that the base init_file walks through. More... | |
| ErrorCode | write_values (std::vector< std::string > &var_names, std::vector< int > &tstep_nums) override |
| Override: write SCRIP grid arrays (cells gathered to rank 0 and written serially via the dispatch layer). More... | |
Public Member Functions inherited from moab::NCWriteHelper | |
| NCWriteHelper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) | |
| virtual | ~NCWriteHelper () |
| virtual ErrorCode | collect_variable_data (std::vector< std::string > &var_names, std::vector< int > &tstep_nums) |
| Collect data for specified variables (partially implemented in child classes) More... | |
Protected Member Functions | |
| ErrorCode | write_nonset_variables (std::vector< WriteNC::VarData > &vdatas, std::vector< int > &tstep_nums) override |
| Required by the abstract base; no climate "nonset" variables exist in a SCRIP grid file, so this is a no-op. More... | |
Private Attributes | |
| long | mLocalCells |
| Per-rank cell count and the global total (set in collect_mesh_info). More... | |
| long | mGlobalCells |
| int | mMaxCornersGlobal |
| Global max corners per cell. Used to size the corner arrays. More... | |
| bool | mHasAreas |
| True if a cell-area tag was present on the input mesh and we'll emit grid_area; false otherwise. More... | |
| std::vector< int > | mLocalGids |
| Per-cell local data (size mLocalCells; corners are mLocalCells * mMaxCornersGlobal, row-major). More... | |
| std::vector< double > | mCenterLon |
| std::vector< double > | mCenterLat |
| std::vector< double > | mCornerLon |
| std::vector< double > | mCornerLat |
| std::vector< int > | mImask |
| std::vector< double > | mAreas |
| int | mDimGridSize |
| NetCDF dimension and variable handles populated by init_file(). More... | |
| int | mDimGridCorners |
| int | mDimGridRank |
| int | mVarGridDims |
| int | mVarCenterLon |
| int | mVarCenterLat |
| int | mVarCornerLon |
| int | mVarCornerLat |
| int | mVarImask |
| int | mVarArea |
Additional Inherited Members | |
Static Public Member Functions inherited from moab::NCWriteHelper | |
| static NCWriteHelper * | get_nc_helper (WriteNC *writeNC, int fileId, const FileOptions &opts, EntityHandle fileSet) |
| Get appropriate helper instance for WriteNC class based on some info in the file set. More... | |
Protected Attributes inherited from moab::NCWriteHelper | |
| WriteNC * | _writeNC |
| Allow NCWriteHelper to directly access members of WriteNC. More... | |
| int | _fileId |
| Cache some information from WriteNC. More... | |
| const FileOptions & | _opts |
| EntityHandle | _fileSet |
| int | nTimeSteps |
| Dimensions of time and level. More... | |
| int | nLevels |
| int | tDim |
| Dimension numbers for time and level. More... | |
| int | levDim |
| Range | localCellsOwned |
| Local owned cells, edges and vertices. More... | |
| Range | localEdgesOwned |
| Range | localVertsOwned |
| std::vector< double > | timeStepVals |
| Time values of output timesteps. More... | |
Definition at line 39 of file NCWriteScrip.hpp.
|
inline |
Definition at line 42 of file NCWriteScrip.hpp.
|
overridevirtual |
Definition at line 20 of file NCWriteScrip.cpp.
|
overridevirtual |
Collect cells + compute SCRIP-ready center/corner lat/lon arrays.
Implements moab::NCWriteHelper.
Definition at line 51 of file NCWriteScrip.cpp.
References moab::NCWriteHelper::_fileSet, moab::NCWriteHelper::_writeNC, moab::Range::begin(), moab::WriteNC::dbgOut, moab::Range::empty(), moab::Range::end(), ErrorCode, moab::ParallelComm::filter_pstatus(), moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::Interface::get_entities_by_dimension(), moab::WriteNC::isParallel, moab::NCWriteHelper::localCellsOwned, mAreas, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, MB_TYPE_DOUBLE, MB_TYPE_INTEGER, moab::WriteNC::mbImpl, mCenterLat, mCenterLon, mCornerLat, mCornerLon, mGlobalCells, moab::WriteNC::mGlobalIdTag, mHasAreas, mImask, mLocalCells, mLocalGids, mMaxCornersGlobal, moab::ParallelComm::proc_config(), moab::ProcConfig::proc_size(), PSTATUS_NOT, PSTATUS_NOT_OWNED, moab::Range::size(), moab::Interface::tag_get_data(), moab::Interface::tag_get_handle(), moab::DebugOutput::tprintf(), and moab::anonymous_namespace{NCWriteScrip.cpp}::xyz_to_latlon_deg().
|
overridevirtual |
Override: synthesize the SCRIP schema directly — no need for the climate var_names / dim plumbing that the base init_file walks through.
Reimplemented from moab::NCWriteHelper.
Definition at line 212 of file NCWriteScrip.cpp.
References moab::NCWriteHelper::_fileId, MB_CHK_SET_ERR, MB_SET_ERR, MB_SUCCESS, mDimGridCorners, mDimGridRank, mDimGridSize, mGlobalCells, mHasAreas, mMaxCornersGlobal, mVarArea, mVarCenterLat, mVarCenterLon, mVarCornerLat, mVarCornerLon, mVarGridDims, mVarImask, and NCFUNC.
|
overrideprotectedvirtual |
Required by the abstract base; no climate "nonset" variables exist in a SCRIP grid file, so this is a no-op.
Implements moab::NCWriteHelper.
Definition at line 457 of file NCWriteScrip.cpp.
References MB_SUCCESS.
|
overridevirtual |
Override: write SCRIP grid arrays (cells gathered to rank 0 and written serially via the dispatch layer).
Reimplemented from moab::NCWriteHelper.
Definition at line 299 of file NCWriteScrip.cpp.
References moab::NCWriteHelper::_fileId, moab::NCWriteHelper::_writeNC, moab::WriteNC::dbgOut, ErrorCode, moab::WriteNC::isParallel, mAreas, MB_SET_ERR, MB_SUCCESS, mCenterLat, mCenterLon, mCornerLat, mCornerLon, mGlobalCells, mHasAreas, mImask, mLocalCells, mLocalGids, mMaxCornersGlobal, mVarArea, mVarCenterLat, mVarCenterLon, mVarCornerLat, mVarCornerLon, mVarGridDims, mVarImask, NCFUNCAP, and moab::DebugOutput::tprintf().
|
private |
Definition at line 95 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Definition at line 91 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Definition at line 90 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Definition at line 93 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Definition at line 92 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Definition at line 99 of file NCWriteScrip.hpp.
Referenced by init_file().
|
private |
Definition at line 100 of file NCWriteScrip.hpp.
Referenced by init_file().
|
private |
NetCDF dimension and variable handles populated by init_file().
Definition at line 98 of file NCWriteScrip.hpp.
Referenced by init_file().
|
private |
Definition at line 78 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), init_file(), and write_values().
|
private |
True if a cell-area tag was present on the input mesh and we'll emit grid_area; false otherwise.
Definition at line 85 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), init_file(), and write_values().
|
private |
Definition at line 94 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Per-rank cell count and the global total (set in collect_mesh_info).
Definition at line 77 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Per-cell local data (size mLocalCells; corners are mLocalCells * mMaxCornersGlobal, row-major).
Definition at line 89 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), and write_values().
|
private |
Global max corners per cell. Used to size the corner arrays.
Definition at line 81 of file NCWriteScrip.hpp.
Referenced by collect_mesh_info(), init_file(), and write_values().
|
private |
Definition at line 107 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 103 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 102 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 105 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 104 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 101 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().
|
private |
Definition at line 106 of file NCWriteScrip.hpp.
Referenced by init_file(), and write_values().