PISM, A Parallel Ice Sheet Model  stable v2.1.1 committed by Constantine Khrulev on 2024-12-04 13:36:58 -0900
Classes | Enumerations | Functions
pism::io Namespace Reference

Input and output code (NetCDF wrappers, etc) More...

Classes

class  Default
 
struct  StartCountInfo
 
class  NC4_Par
 
class  NC4_Serial
 
class  NC4File
 
class  NC_Serial
 
class  NCFile
 The PISM wrapper for a subset of the NetCDF C API. More...
 
class  ParallelIO
 
class  PNCFile
 PISM's PnetCDF I/O wrapper. More...
 

Enumerations

enum  Type : int {
  PISM_NAT = 0 , PISM_BYTE = 1 , PISM_CHAR = 2 , PISM_SHORT = 3 ,
  PISM_INT = 4 , PISM_FLOAT = 5 , PISM_DOUBLE = 6
}
 
enum  Backend : int {
  PISM_GUESS , PISM_NETCDF3 , PISM_NETCDF4_SERIAL , PISM_NETCDF4_PARALLEL ,
  PISM_PNETCDF , PISM_PIO_PNETCDF , PISM_PIO_NETCDF , PISM_PIO_NETCDF4C ,
  PISM_PIO_NETCDF4P
}
 
enum  Mode : int { PISM_READONLY = 7 , PISM_READWRITE = 8 , PISM_READWRITE_CLOBBER = 9 , PISM_READWRITE_MOVE = 10 }
 
enum  Dim_Length : int { PISM_UNLIMITED = 0 }
 
enum  Fill_Mode : int { PISM_FILL = 0 , PISM_NOFILL = 0x100 }
 

Functions

static void regrid (const Grid &grid, const LocalInterpCtx &lic, double const *input_array, double *output_array)
 Bi-(or tri-)linear interpolation. More...
 
static StartCountInfo compute_start_and_count (std::vector< AxisType > &dim_types, std::array< int, 4 > start_in, std::array< int, 4 > count_in)
 
void define_dimension (const File &file, unsigned long int length, const VariableMetadata &metadata)
 Define a dimension and the associated coordinate variable. Set attributes. More...
 
void define_time (const File &file, const Context &ctx)
 Prepare a file for output. More...
 
void define_time (const File &file, const std::string &name, const std::string &calendar, const std::string &units, units::System::Ptr unit_system)
 
void append_time (const File &file, const Config &config, double time_seconds)
 Prepare a file for output. More...
 
void append_time (const File &file, const std::string &name, double value)
 Append to the time dimension. More...
 
static void define_dimensions (const SpatialVariableMetadata &var, const Grid &grid, const File &file)
 Define dimensions a variable depends on. More...
 
static void write_dimension_data (const File &file, const std::string &name, const std::vector< double > &data)
 
void write_dimensions (const SpatialVariableMetadata &var, const Grid &grid, const File &file)
 
static bool use_transposed_io (std::vector< AxisType > dimension_types)
 
static std::vector< AxisTypedimension_types (const File &file, const std::string &var_name, std::shared_ptr< units::System > unit_system)
 
static void read_distributed_array (const File &file, const Grid &grid, const std::string &var_name, unsigned int z_count, unsigned int t_start, double *output)
 Read an array distributed according to the grid. More...
 
static std::vector< double > read_for_interpolation (const File &file, const std::string &variable_name, const Grid &internal_grid, const LocalInterpCtx &lic)
 
void define_spatial_variable (const SpatialVariableMetadata &metadata, const Grid &grid, const File &file, io::Type default_type)
 Define a NetCDF variable corresponding to a VariableMetadata object. More...
 
void read_spatial_variable (const SpatialVariableMetadata &variable, const Grid &grid, const File &file, unsigned int time, double *output)
 Read a variable from a file into an array output. More...
 
void write_spatial_variable (const SpatialVariableMetadata &metadata, const Grid &grid, const File &file, const double *input)
 Write a double array to a file. More...
 
static void check_grid_overlap (const grid::InputGridInfo &input, const Grid &internal, const std::vector< double > &z_internal)
 
void check_input_grid (const grid::InputGridInfo &input_grid, const Grid &internal_grid, const std::vector< double > &internal_z_levels)
 Check that x, y, and z coordinates of the input grid are strictly increasing. More...
 
void regrid_spatial_variable (SpatialVariableMetadata &variable, const Grid &internal_grid, const LocalInterpCtx &lic, const File &file, double *output)
 Regrid from a NetCDF file into a distributed array output. More...
 
void define_timeseries (const VariableMetadata &var, const std::string &dimension_name, const File &file, io::Type nctype)
 Define a NetCDF variable corresponding to a time-series. More...
 
void read_timeseries (const File &file, const VariableMetadata &metadata, const Logger &log, std::vector< double > &data)
 Read a time-series variable from a NetCDF file to a vector of doubles. More...
 
void write_timeseries (const File &file, const VariableMetadata &metadata, size_t t_start, const std::vector< double > &data)
 Write a time-series data to a file. More...
 
void define_time_bounds (const VariableMetadata &var, const std::string &dimension_name, const std::string &bounds_name, const File &file, io::Type nctype)
 
void read_time_bounds (const File &file, const VariableMetadata &metadata, const Logger &log, std::vector< double > &data)
 
void write_time_bounds (const File &file, const VariableMetadata &metadata, size_t t_start, const std::vector< double > &data)
 
void read_time_info (const Logger &log, std::shared_ptr< units::System > unit_system, const File &file, const std::string &time_name, const std::string &time_units, std::vector< double > &times, std::vector< double > &bounds)
 
bool file_exists (MPI_Comm com, const std::string &filename)
 
void read_attributes (const File &file, const std::string &variable_name, VariableMetadata &variable)
 
void write_attributes (const File &file, const VariableMetadata &variable, io::Type nctype)
 Write variable attributes to a NetCDF file. More...
 
void read_valid_range (const File &file, const std::string &name, VariableMetadata &variable)
 Read the valid range information from a file. More...
 
std::string time_dimension (units::System::Ptr unit_system, const File &file, const std::string &variable_name)
 
void move_if_exists (MPI_Comm com, const std::string &file_to_move, int rank_to_use)
 Moves the file aside (file.nc -> file.nc~). More...
 
void remove_if_exists (MPI_Comm com, const std::string &file_to_remove, int rank_to_use)
 Check if a file is present are remove it. More...
 
static void check (const ErrorLocation &where, int return_code)
 Prints an error message; for debugging. More...
 
static void check (const ErrorLocation &where, int return_code)
 Prints an error message; for debugging. More...
 
static void check (const ErrorLocation &where, int return_code)
 Prints an error message; for debugging. More...
 
static void get_att_text (int ncid, int varid, const std::string &att_name, std::string &result)
 
static void get_att_string (int ncid, int varid, const std::string &att_name, std::string &result)
 
static void check (const ErrorLocation &where, int return_code)
 Prints an error message; for debugging. More...
 
static void check_and_abort (MPI_Comm com, const ErrorLocation &where, int return_code)
 call MPI_Abort() if a NetCDF call failed More...
 
static int get_att_text (int ncid, int varid, const std::string &att_name, std::string &result)
 
static int get_att_string (int ncid, int varid, const std::string &att_name, std::string &result)
 
static void check (const ErrorLocation &where, int return_code)
 
template<typename T >
std::vector< T > convert_data (const double *input, size_t length)
 
static void check (const ErrorLocation &where, int return_code)
 

Detailed Description

Input and output code (NetCDF wrappers, etc)