Changeset 2426 for XIOS3/trunk/src/io/netCdfInterface.cpp
- Timestamp:
- 11/21/22 16:38:46 (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/io/netCdfInterface.cpp
r1957 r2426 10 10 #include "netCdfInterface.hpp" 11 11 #include "netCdfException.hpp" 12 #include "mem_checker.hpp" 12 13 13 14 namespace xios … … 22 23 int CNetCdfInterface::create(const StdString& fileName, int cMode, int& ncId) 23 24 { 25 CMemChecker::get("NetCDF create").resume(); 24 26 int status = nc_create(fileName.c_str(), cMode, &ncId); 25 27 if (NC_NOERR != status) … … 34 36 throw CNetCdfException(e); 35 37 } 38 CMemChecker::get("NetCDF create").suspend(); 36 39 37 40 return status; … … 49 52 int CNetCdfInterface::createPar(const StdString& fileName, int cMode, MPI_Comm comm, MPI_Info info, int& ncId) 50 53 { 54 CMemChecker::get("NetCDF create").resume(); 51 55 int status = xios::nc_create_par(fileName.c_str(), cMode, comm, info, &ncId); 52 56 if (NC_NOERR != status) … … 61 65 throw CNetCdfException(e); 62 66 } 67 CMemChecker::get("NetCDF create").suspend(); 63 68 64 69 return status; … … 74 79 int CNetCdfInterface::open(const StdString& fileName, int oMode, int& ncId) 75 80 { 81 CMemChecker::get("NetCDF open").resume(); 76 82 int status = nc_open(fileName.c_str(), oMode, &ncId); 77 83 if (NC_NOERR != status) … … 86 92 throw CNetCdfException(e); 87 93 } 94 CMemChecker::get("NetCDF open").suspend(); 88 95 89 96 return status; … … 102 109 int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId) 103 110 { 111 CMemChecker::get("NetCDF open").resume(); 104 112 int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); 105 113 if (NC_NOERR != status) … … 114 122 throw CNetCdfException(e); 115 123 } 124 CMemChecker::get("NetCDF open").suspend(); 116 125 117 126 return status; … … 125 134 int CNetCdfInterface::close(int ncId) 126 135 { 136 CMemChecker::get("NetCDF close").resume(); 127 137 int status = nc_close(ncId); 128 138 if (NC_NOERR != status) … … 136 146 throw CNetCdfException(e); 137 147 } 148 CMemChecker::get("NetCDF close").suspend(); 138 149 139 150 return status; … … 147 158 int CNetCdfInterface::reDef(int ncId) 148 159 { 160 CMemChecker::get("NetCDF other").resume(); 149 161 int status = nc_redef(ncId); 150 162 if (NC_NOERR != status) … … 158 170 throw CNetCdfException(e); 159 171 } 172 CMemChecker::get("NetCDF other").suspend(); 160 173 161 174 return status; … … 169 182 int CNetCdfInterface::endDef(int ncId) 170 183 { 184 CMemChecker::get("NetCDF other").resume(); 171 185 int status = nc_enddef(ncId); 172 186 if (NC_NOERR != status) … … 181 195 throw CNetCdfException(e); 182 196 } 197 CMemChecker::get("NetCDF other").suspend(); 183 198 184 199 return status; … … 773 788 int CNetCdfInterface::setFill(int ncid, bool fill) 774 789 { 790 CMemChecker::get("NetCDF other").resume(); 775 791 int old_fill_mode; 776 792 int status = nc_set_fill(ncid, fill ? NC_FILL: NC_NOFILL, &old_fill_mode); … … 786 802 throw CNetCdfException(e); 787 803 } 804 CMemChecker::get("NetCDF other").suspend(); 788 805 789 806 return status; … … 801 818 int CNetCdfInterface::defVarFill(int ncid, int varId, int noFill, void* fillValue) 802 819 { 820 CMemChecker::get("NetCDF other").resume(); 803 821 int status = nc_def_var_fill(ncid, varId, noFill, fillValue); 804 822 if (NC_NOERR != status) … … 814 832 throw CNetCdfException(e); 815 833 } 834 CMemChecker::get("NetCDF other").suspend(); 816 835 817 836 return status; … … 829 848 int CNetCdfInterface::varParAccess(int ncid, int varId, int access) 830 849 { 850 CMemChecker::get("NetCDF other").resume(); 831 851 int status = nc_var_par_access(ncid, varId, access); 832 852 if (NC_NOERR != status) … … 841 861 throw CNetCdfException(e); 842 862 } 863 CMemChecker::get("NetCDF other").suspend(); 843 864 844 865 return status; … … 852 873 int CNetCdfInterface::sync(int ncid) 853 874 { 875 CMemChecker::get("NetCDF other").resume(); 854 876 int status = nc_sync(ncid); 855 877 if (NC_NOERR != status) … … 864 886 throw CNetCdfException(e); 865 887 } 888 CMemChecker::get("NetCDF other").suspend(); 866 889 867 890 return status;
Note: See TracChangeset
for help on using the changeset viewer.