NEP 1.7.0
NetCDF Extension Pack: compression extensions for NetCDF
Loading...
Searching...
No Matches
Functions/Subroutines
f_quickstart.f90 File Reference

Minimal introduction to NetCDF from Fortran - the simplest starting point. More...

Functions/Subroutines

program f_quickstart
 
subroutine check (status, context)
 Error handling subroutine.
 

Detailed Description

Minimal introduction to NetCDF from Fortran - the simplest starting point.

This is the Fortran equivalent of quickstart.c, demonstrating the essential NetCDF operations using the Fortran 90 NetCDF API (nf90_* functions). The program creates a tiny 2D array (2x3) with 6 integer values, adds descriptive attributes, writes it to a file, then reopens the file to verify everything was stored correctly.

Learning Objectives:

Key Concepts:

Fortran vs C Differences:

Prerequisites: Basic Fortran 90 programming knowledge

Related Examples:

Compilation:

gfortran -o f_quickstart f_quickstart.f90 -lnetcdff -lnetcdf
program f_quickstart
Definition f_quickstart.f90:60

Usage:

Expected Output: Creates f_quickstart.nc containing:

Author
Edward Hartnett
Date
2026-01-29

Function/Subroutine Documentation

◆ check()

subroutine f_quickstart::check ( integer, intent(in)  status,
character(len=*), intent(in)  context 
)

Error handling subroutine.

Parameters
statusNetCDF return status code
contextDescriptive message about the operation

◆ f_quickstart()

program f_quickstart