|
TECA
The Toolkit for Extreme Climate Analysis
|
A writer for Cartesian meshes in NetCDF CF2 format. More...
#include <teca_cf_writer.h>
Public Member Functions | |
| std::shared_ptr< teca_cf_writer > | shared_from_this () |
| std::shared_ptr< teca_cf_writer const > | shared_from_this () const |
| teca_cf_writer (const teca_cf_writer &src)=delete | |
| teca_cf_writer (teca_cf_writer &&src)=delete | |
| teca_cf_writer & | operator= (const teca_cf_writer &src)=delete |
| teca_cf_writer & | operator= (teca_cf_writer &&src)=delete |
| const char * | get_class_name () const override |
file_name | |
Set the output filename. For time series the substring t% is replaced with the current time step or date. See comments on date_format below for info about date formatting. | |
| void | set_file_name (const std::string &v) |
| const std::string & | get_file_name () const |
date_format | |
set the format for the date to write in the filename. this requires the input dataset to have unit/calendar information if none are available, the time index is used instead. (F-HZ) | |
| void | set_date_format (const std::string &v) |
| const std::string & | get_date_format () const |
first_step | |
Set the first step in the range of time step to process. | |
| void | set_first_step (const long &v) |
| const long & | get_first_step () const |
last_step | |
Set the last step in the range of time step to process. | |
| void | set_last_step (const long &v) |
| const long & | get_last_step () const |
steps_per_file | |
Set how many time steps are written to each file when the layout mode is set to number_of_steps. | |
| void | set_steps_per_file (const unsigned int &v) |
| const unsigned int & | get_steps_per_file () const |
mode_flags | |
sets the flags passed to NetCDF during file creation. (NC_CLOBBER) | |
| void | set_mode_flags (const int &v) |
| const int & | get_mode_flags () const |
use_unlimited_dim | |
if set the slowest varying dimension is specified to be NC_UNLIMITED. This has a negative impact on performance when reading the values in a single pass. However, unlimited dimensions are used ubiquitously thus by default it is set. For data being consumed by TECA performance will be better when using fixed dimensions. (1) This feature requires collective writes and is incompatible with out of order execution, and hence currently not supported. | |
| void | set_use_unlimited_dim (const int &v) |
| const int & | get_use_unlimited_dim () const |
compression_level | |
sets the compression level used for each variable compression is not used if the value is less than or equal to 0. This feature requires collective writes and is incompatible with out of order execution, and hence currently not supported. | |
| void | set_compression_level (const int &v) |
| const int & | get_compression_level () const |
flush_files | |
Flush files before closing them, this may be necessary if accessing data immediately. | |
| void | set_flush_files (const int &v) |
| const int & | get_flush_files () const |
point_array | |
Specify the arrays to write. A data array is only written to disk if it is included in this list. It is an error to not specify at least one point centered array to write | |
| size_t | get_number_of_point_arrays () |
| void | append_point_array (const std::string &v) |
| void | set_point_array (size_t i, const std::string &v) |
| void | set_point_arrays (const std::vector< std::string > &v) |
| void | set_point_arrays (const std::initializer_list< std::string > &&l) |
| const std::string & | get_point_array (size_t i) const |
| const std::vector< std::string > & | get_point_arrays () const |
| void | clear_point_arrays () |
information_array | |
Set the list of non-geometric arrays to write. | |
| size_t | get_number_of_information_arrays () |
| void | append_information_array (const std::string &v) |
| void | set_information_array (size_t i, const std::string &v) |
| void | set_information_arrays (const std::vector< std::string > &v) |
| void | set_information_arrays (const std::initializer_list< std::string > &&l) |
| const std::string & | get_information_array (size_t i) const |
| const std::vector< std::string > & | get_information_arrays () const |
| void | clear_information_arrays () |
Public Member Functions inherited from teca_threaded_algorithm | |
| std::shared_ptr< teca_threaded_algorithm > | shared_from_this () |
| std::shared_ptr< teca_threaded_algorithm const > | shared_from_this () const |
| teca_threaded_algorithm (const teca_threaded_algorithm &src)=delete | |
| teca_threaded_algorithm (teca_threaded_algorithm &&src)=delete | |
| teca_threaded_algorithm & | operator= (const teca_threaded_algorithm &src)=delete |
| teca_threaded_algorithm & | operator= (teca_threaded_algorithm &&src)=delete |
| void | set_thread_pool_size (int n_threads) |
| unsigned int | get_thread_pool_size () const noexcept |
| Get the number of threads in the pool. More... | |
| void | set_data_request_queue (const p_teca_data_request_queue &queue) |
| void | set_verbose (const int &v) |
| const int & | get_verbose () const |
| void | set_bind_threads (const int &v) |
| const int & | get_bind_threads () const |
| void | set_stream_size (const int &v) |
| const int & | get_stream_size () const |
| void | set_poll_interval (const long long &v) |
| const long long & | get_poll_interval () const |
Public Member Functions inherited from teca_algorithm | |
| teca_algorithm (const teca_algorithm &src)=delete | |
| teca_algorithm (teca_algorithm &&src)=delete | |
| teca_algorithm & | operator= (const teca_algorithm &src)=delete |
| teca_algorithm & | operator= (teca_algorithm &&src)=delete |
| void | set_communicator (MPI_Comm comm) |
| MPI_Comm | get_communicator () |
| get the active communicator More... | |
| virtual teca_algorithm_output_port | get_output_port (unsigned int port=0) |
| void | set_input_connection (const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | set_input_connection (unsigned int id, const teca_algorithm_output_port &port) |
| set an input to this algorithm More... | |
| virtual void | remove_input_connection (unsigned int id) |
| remove input connections More... | |
| void | clear_input_connections () |
| remove all input connections More... | |
| const_p_teca_dataset | get_output_data (unsigned int port=0) |
| void | pop_cache (unsigned int port=0, int top=0) |
| void | set_cache_size (unsigned int n) |
| set the cache size. the default is 1. (threadsafe) More... | |
| virtual int | update () |
| execute the pipeline from this instance up. More... | |
| virtual int | update (unsigned int port) |
| execute the pipeline from this instance up. More... | |
| virtual teca_metadata | update_metadata (unsigned int port=0) |
| get meta data considering this instance up. More... | |
| void | set_executive (p_teca_algorithm_executive exe) |
| set the executive More... | |
| p_teca_algorithm_executive | get_executive () |
| get the executive More... | |
| virtual void | to_stream (std::ostream &s) const |
| virtual void | from_stream (std::istream &s) |
| deserialize from the stream. More... | |
| void | set_verbose (const int &v) |
| const int & | get_verbose () const |
Static Public Member Functions | |
| static p_teca_cf_writer | New () |
Static Public Member Functions inherited from teca_threaded_algorithm | |
| static p_teca_threaded_algorithm | New () |
layout | |
Set the layout mode to one of : number_of_steps, daily, monthly, seasonal, or yearly. This controls the size of the files written. In daily, monthly, seasonal, and yearly modes each file will contain the steps spanning the given duration. The number_of_steps mode writes a fixed number of steps per file which can be set using the steps_per_file property. | |
| enum | { invalid =0, number_of_steps =1, daily =2, monthly =3, seasonal =4, yearly =5 } |
| void | set_layout (const int &v) |
| const int & | get_layout () const |
| void | set_layout_to_number_of_steps () |
| void | set_layout_to_daily () |
| void | set_layout_to_monthly () |
| void | set_layout_to_seasonal () |
| void | set_layout_to_yearly () |
| int | set_layout (const std::string &layout) |
| set the layout mode from a string. More... | |
| int | validate_layout (int mode) |
Additional Inherited Members | |
Protected Member Functions inherited from teca_threaded_algorithm | |
| const_p_teca_dataset | execute (unsigned int port, const std::vector< const_p_teca_dataset > &input_data, const teca_metadata &request) override |
| const_p_teca_dataset | request_data (teca_algorithm_output_port &port, const teca_metadata &request) override |
Protected Member Functions inherited from teca_algorithm | |
| void | set_number_of_input_connections (unsigned int n) |
| void | set_number_of_output_ports (unsigned int n) |
| virtual void | set_modified () |
| void | set_modified (unsigned int port) |
| an overload to set_modified by port More... | |
| virtual teca_metadata | get_cache_key (unsigned int port, const teca_metadata &request) const |
| virtual teca_metadata | get_output_metadata (teca_algorithm_output_port ¤t) |
| virtual int | validate_cache (teca_algorithm_output_port ¤t) |
| virtual void | clear_modified (teca_algorithm_output_port current) |
| const_p_teca_dataset | get_output_data (unsigned int port, const teca_metadata &request) |
| int | cache_output_data (unsigned int port, const teca_metadata &request, const_p_teca_dataset &data) |
| void | clear_cache (unsigned int port) |
| clear the cache on the given output port More... | |
| unsigned int | get_number_of_input_connections () |
| get the number of input connections More... | |
| teca_algorithm_output_port & | get_input_connection (unsigned int i) |
| void | clear_modified (unsigned int port) |
| clear the modified flag on the i'th output More... | |
| int | get_modified (unsigned int port) const |
| return the output port's modified flag value More... | |
Protected Attributes inherited from teca_algorithm | |
| int | verbose |
A writer for Cartesian meshes in NetCDF CF2 format.
Writes data to NetCDF CF2 format. This algorithm is conceptually an execution engine capable of driving the above pipeline with our without threads and stream results in the order that they are generated placing them in the correct location in the output dataset. The output dataset is a collection of files each with a user specified number of time steps per file. The output dataset may be arranged using a fixed number of steps per file or daily, monthly, seasonal, or yearly file layouts. The total number of time steps in the output dataset is determined by the combination of the number of time steps in the input dataset and user defined subsetting if any. The writer uses MPI collective I/O to produce the files. In parallel time steps are mapped to ranks such that each rank has approximately the same number of time steps. Incoming steps are mapped to files. A given MPI rank may be writing to multiple files. The use of MPI collectives implies care must be taken in its use to avoid deadlocks.
Due to the use of MPI collectives I/O certain information must be known during the report phase of pipeline execution, before the execute phase of pipeline execution begins. The information that is needed is:
|
inline |
append to the information_array algorithm vector property
|
inline |
append to the point_array algorithm vector property
|
inline |
clear the information_array algorithm vector property
|
inline |
clear the point_array algorithm vector property
|
inlineoverridevirtual |
returns the name of the class
Reimplemented from teca_threaded_algorithm.
|
inline |
Get the value of the compression_level algorithm property
|
inline |
Get the value of the date_format algorithm property
|
inline |
Get the value of the file_name algorithm property
|
inline |
Get the value of the first_step algorithm property
|
inline |
Get the value of the flush_files algorithm property
|
inline |
get the i-th element of the information_array algorithm vector property
|
inline |
get the information_array algorithm vector property
|
inline |
Get the value of the last_step algorithm property
|
inline |
Get the value of the layout algorithm property
|
inline |
Get the value of the mode_flags algorithm property
|
inline |
get the size of the information_array algorithm vector property
|
inline |
get the size of the point_array algorithm vector property
|
inline |
get the i-th element of the point_array algorithm vector property
|
inline |
get the point_array algorithm vector property
|
inline |
Get the value of the steps_per_file algorithm property
|
inline |
Get the value of the use_unlimited_dim algorithm property
|
inlinestatic |
Returns an instance of teca_cf_writer
|
inline |
Set the value of the compression_level algorithm property
|
inline |
Set the value of the date_format algorithm property
|
inline |
Set the value of the file_name algorithm property
|
inline |
Set the value of the first_step algorithm property
|
inline |
Set the value of the flush_files algorithm property
|
inline |
set the i-th element of the information_array algorithm vector property
|
inline |
set the information_array algorithm vector property
|
inline |
set the information_array algorithm vector property
|
inline |
Set the value of the last_step algorithm property
|
inline |
Set the value of the layout algorithm property
| int teca_cf_writer::set_layout | ( | const std::string & | layout | ) |
set the layout mode from a string.
|
inline |
Set the value of the mode_flags algorithm property
|
inline |
set the i-th element of the point_array algorithm vector property
|
inline |
set the point_array algorithm vector property
|
inline |
set the point_array algorithm vector property
|
inline |
Set the value of the steps_per_file algorithm property
|
inline |
Set the value of the use_unlimited_dim algorithm property
|
inline |
Enables the static constructor
|
inline |
Enables the static constructor
|
inline |