NetCDF: Difference between revisions

Jump to navigation Jump to search
267 bytes added ,  6 years ago
Marked this version for translation
(Mention PnetCDF)
(Marked this version for translation)
Line 2: Line 2:


<translate>
<translate>
<!--T:1-->
[[Category:Software]]
[[Category:Software]]


= General =
= General = <!--T:2-->


<!--T:3-->
NetCDF (Network Common Data Form) is:
NetCDF (Network Common Data Form) is:
* an interface for array-oriented data access, and  
* an interface for array-oriented data access, and  
Line 11: Line 13:
The NetCDF library also defines a machine-independent format for representing scientific data. Together, the interface, library, and format support the creation, access, and sharing of scientific data.
The NetCDF library also defines a machine-independent format for representing scientific data. Together, the interface, library, and format support the creation, access, and sharing of scientific data.


<!--T:4-->
There were significant changes to the library with the release of version 4.0. NetCDF 4.x is backwards compatible - it can read files produced by an earlier version but the opposite isn't true. Since 4.0 was released in 2008, we will not discuss earlier versions here.
There were significant changes to the library with the release of version 4.0. NetCDF 4.x is backwards compatible - it can read files produced by an earlier version but the opposite isn't true. Since 4.0 was released in 2008, we will not discuss earlier versions here.


<!--T:5-->
* Project web site : https://www.unidata.ucar.edu/software/netcdf
* Project web site : https://www.unidata.ucar.edu/software/netcdf
* Manual: https://www.unidata.ucar.edu/software/netcdf/docs
* Manual: https://www.unidata.ucar.edu/software/netcdf/docs
Line 18: Line 22:
* FAQ: https://www.unidata.ucar.edu/software/netcdf/docs/faq.html
* FAQ: https://www.unidata.ucar.edu/software/netcdf/docs/faq.html


== Strengths ==
== Strengths == <!--T:6-->
* The data are independent of the processor architecture ([https://en.wikipedia.org/wiki/Endianness endianness]).
* The data are independent of the processor architecture ([https://en.wikipedia.org/wiki/Endianness endianness]).
* The data are structured in a way that keeps track of all the pertinent information, e.g. physical units.
* The data are structured in a way that keeps track of all the pertinent information, e.g. physical units.
Line 26: Line 30:
* It's free software for most platforms.
* It's free software for most platforms.


== Weak points ==
== Weak points == <!--T:7-->
* The Python interface doesn't support parallelism (version 1.0.5)
* The Python interface doesn't support parallelism (version 1.0.5)
* Certain files produced with [[HDF5]] cannot be read using NetCDF
* Certain files produced with [[HDF5]] cannot be read using NetCDF


= Quickstart guide =
= Quickstart guide = <!--T:8-->
This section summarizes configuration details.
This section summarizes configuration details.


== Environment modules ==
== Environment modules == <!--T:9-->


<!--T:10-->
The following [[Utiliser des modules/en|modules]] providing NetCDF are available on Compute Canada systems via CVMFS:
The following [[Utiliser des modules/en|modules]] providing NetCDF are available on Compute Canada systems via CVMFS:
* '''netcdf'''
* '''netcdf'''
Line 43: Line 48:
** for linking with programs containing Fortran instructions
** for linking with programs containing Fortran instructions


<!--T:11-->
There is also a set of NetCDF modules compiled with [[MPI]] support for parallel I/O:
There is also a set of NetCDF modules compiled with [[MPI]] support for parallel I/O:
* '''netcdf-mpi'''
* '''netcdf-mpi'''
Line 51: Line 57:
** for linking with programs containing Fortran instructions and calling MPI
** for linking with programs containing Fortran instructions and calling MPI


<!--T:12-->
Run <code>module avail netcdf</code> to see what versions are currently available with the compiler and MPI modules you have loaded. For a comprehensive list of NetCDF modules, run <code>module -r spider '.*netcdf.*'</code>.
Run <code>module avail netcdf</code> to see what versions are currently available with the compiler and MPI modules you have loaded. For a comprehensive list of NetCDF modules, run <code>module -r spider '.*netcdf.*'</code>.


<!--T:13-->
Use <code>module load netcdf/version</code> to set your environment to use your chosen version. For example, to load the NetCDF version 4.1.3 C-based library, do:
Use <code>module load netcdf/version</code> to set your environment to use your chosen version. For example, to load the NetCDF version 4.1.3 C-based library, do:


<!--T:14-->
{{Command|module load netcdf/4.1.3}}
{{Command|module load netcdf/4.1.3}}


== Submission scripts ==
== Submission scripts == <!--T:15-->
Please refer to the page "[[Running_jobs|Running jobs]]" for examples of job scripts for the Slurm workload manager. We recommend you include the <code>module load ...</code> command in your job script.
Please refer to the page "[[Running_jobs|Running jobs]]" for examples of job scripts for the Slurm workload manager. We recommend you include the <code>module load ...</code> command in your job script.


== Linking code to NetCDF libraries ==
== Linking code to NetCDF libraries == <!--T:16-->
Below are a few examples showing how to link NetCDF libraries to C and Fortran code:
Below are a few examples showing how to link NetCDF libraries to C and Fortran code:


=== Serial NetCDF ===
=== Serial NetCDF === <!--T:17-->
For C code,
For C code,
{{Commands
{{Commands
Line 70: Line 79:
}}
}}


<!--T:18-->
For Fortran code, notice that two libraries are required and their order matters:
For Fortran code, notice that two libraries are required and their order matters:
{{Commands
{{Commands
Line 76: Line 86:
}}
}}


=== Parallel NetCDF ===
=== Parallel NetCDF === <!--T:19-->
For C code which calls MPI,
For C code which calls MPI,
{{Commands
{{Commands
Line 83: Line 93:
}}
}}


=== Example ===
=== Example === <!--T:20-->
An example demonstrating the use of the NetCDF can be found at the following [https://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf-tutorial/simple_005fxy_005fwr_002ec.html#simple_005fxy_005fwr_002ec link]. The example program creates a NetCDF file containing a single two-dimensional variable called "data", and labels the two dimensions "x" and "y".  
An example demonstrating the use of the NetCDF can be found at the following [https://www.unidata.ucar.edu/software/netcdf/netcdf-4/newdocs/netcdf-tutorial/simple_005fxy_005fwr_002ec.html#simple_005fxy_005fwr_002ec link]. The example program creates a NetCDF file containing a single two-dimensional variable called "data", and labels the two dimensions "x" and "y".  
   
   
Line 92: Line 102:
}}
}}


== NetCDF utilities ==
== NetCDF utilities == <!--T:21-->
There are several utilities that read or write files in different formats.
There are several utilities that read or write files in different formats.
* ncdump
* ncdump
Line 101: Line 111:
: Copies a netCDF file and can change binary format, chunk sizes, compression, and other storage settings. See [https://www.unidata.ucar.edu/software/netcdf/workshops/2011/utilities/Nccopy.html nccopy] for more.
: Copies a netCDF file and can change binary format, chunk sizes, compression, and other storage settings. See [https://www.unidata.ucar.edu/software/netcdf/workshops/2011/utilities/Nccopy.html nccopy] for more.


= PnetCDF =
= PnetCDF = <!--T:22-->


<!--T:23-->
PnetCDF is another library for reading and writing NetCDF-format files. It uses different procedure names than NetCDF and provides non-blocking procedures. See the [https://trac.mcs.anl.gov/projects/parallel-netcdf PnetCDF web site] for a detailed discussion.
PnetCDF is another library for reading and writing NetCDF-format files. It uses different procedure names than NetCDF and provides non-blocking procedures. See the [https://trac.mcs.anl.gov/projects/parallel-netcdf PnetCDF web site] for a detailed discussion.


</translate>
</translate>
Bureaucrats, cc_docs_admin, cc_staff
2,879

edits

Navigation menu