Skip to content

Instantly share code, notes, and snippets.

@brews
Last active August 29, 2015 14:00
Show Gist options
  • Save brews/87dc9c6edd4be7ec6618 to your computer and use it in GitHub Desktop.
Save brews/87dc9c6edd4be7ec6618 to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
# 2014-05-02
# S. B. Malevich <malevich@email.arizona.edu>
# Dump netCDF files in CWD to a text CDF file. Change `time = 1 ;` dimension
# to `time = UNLIMITED`, and then convert the CDF back into a netCDF file,
# overwriting the original.
for f in *.nc; do
cp $f $f.original # Make copy for safety. Might want to comment this out.
ncdump $f | sed 's/time \= 1/time \= UNLIMITED/' | ncgen -o $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment