From: Nate Mikle <natemikle_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 14 2013 - 10:29:13 MDT


I'm trying to write a simple script to output a new .nc file at each
timestep. The data is 3 dimensional (time-365, lat-354, lon-720). I am
able to take a timeslice one at a time with the following script. The
output has no metadata. How can I change this? Also, what would a "do
loop" look like that would output a new file(365 files) with different
names for every time (0:364)?


  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl
  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
  load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
  a =
  b = a->GPP(0,:,:)

  c = ndtooned(b)
  system("/bin/rm -f day1.nc") ; remove any pre-exist file
  cout = addfile("day1.nc", "c") ; new netCDF file
  cout@title = "day1"
  cout->c = c

ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Thu Mar 14 10:29:42 2013

This archive was generated by hypermail 2.1.8 : Tue Mar 19 2013 - 16:31:18 MDT