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

Read a NetCDF-4 file and print all metadata including user-defined types. More...

Functions/Subroutines

program f_dump_nc4_metadata
 
character(len=nf90_max_name) function type_name (ncid, xtype)
 

Detailed Description

Read a NetCDF-4 file and print all metadata including user-defined types.

Fortran equivalent of dump_nc4_metadata.c. Reads a filename from the command line, opens the file, and prints all metadata:

Note: Fortran does not handle VLEN, String, or Compound types portably, so those type classes are reported by name only without detail.

Learning Objectives:

Key Concepts:

Prerequisites:

Related Examples:

Compilation:

gfortran -o f_dump_nc4_metadata f_dump_nc4_metadata.f90 -lnetcdff -lnetcdf
program f_dump_nc4_metadata
Definition f_dump_nc4_metadata.f90:75

Usage:

program f_user_types
Definition f_user_types.f90:52

Expected Output: Prints all metadata from the specified NetCDF-4 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_nc4_metadata()

program f_dump_nc4_metadata

◆ type_name()

character(len=nf90_max_name) function f_dump_nc4_metadata::type_name ( integer, intent(in)  ncid,
integer, intent(in)  xtype 
)