NEP 2.7.0
NetCDF Extension Pack
Loading...
Searching...
No Matches
Functions/Subroutines
f_dump_classic_metadata.f90 File Reference

Read a NetCDF file and print all metadata (Fortran) More...

Functions/Subroutines

program f_dump_classic_metadata
 
character(len=10) function type_name (xtype)
 

Detailed Description

Read a NetCDF file and print all metadata (Fortran)

This example demonstrates how to use the NetCDF Fortran inquiry functions to discover and print all metadata in a NetCDF file without prior knowledge of its contents. It reads a filename from the command line, opens the file, and prints:

This is a useful pattern for building tools that inspect arbitrary NetCDF files.

Learning Objectives:

Key Concepts:

Prerequisites:

Related Examples:

Compilation:

f_dump_classic_metadata.f90 -lnetcdff -lnetcdf
program f_dump_classic_metadata
Definition f_dump_classic_metadata.f90:78

Usage:

program f_coord_vars
Definition f_coord_vars.f90:51

Expected Output: Prints all metadata from the specified file:

Note
Companion code for "The NetCDF Developer's Handbook: The Authoritative Guide to Writing High-Performance Programs for Scientific Data Management, Second Edition" (https://www.amazon.com/dp/B0H7Q1Z75L)
Author
Edward Hartnett, Intelligent Data Design, Inc.
Date
2026

Function/Subroutine Documentation

◆ f_dump_classic_metadata()

program f_dump_classic_metadata

◆ type_name()

character(len=10) function f_dump_classic_metadata::type_name ( integer, intent(in)  xtype)