;This script reads in a series of files and makes the ;time attribute "unlimited" in each file. Time must ;be unlimited for certain NCO commands to work. ;In this case, the input files were 131 files named ;"gisst.1871.nc" to "gisst.2001.nc". The program ;rifles through the files and re-writes the data ;contained in each file to a new file, and makes ;the time variable unlimited. ;author: Sara Rauscher ;date: 10.22.02 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" begin ;go through all files in a do loop do i = 1871,2001 ;open data files to read from and write to year = i infile = addfile("gisst."+year+".nc","r") outfile = addfile("new/gisst."+year+".nc","c") ;get needed variables from file sst = infile->sst ;assign coordinate var data so grads can read it later sst!0 = "time" sst&time = infile->time sst!1 = "latitude" sst&latitude = infile->latitude sst!2 = "longitude" sst&longitude = infile->longitude ;make time unlimited in file filedimdef(outfile,"time",-1,True) ;write out vars to file outfile->sst = sst outfile->latitude = infile->latitude outfile->longitude = infile->longitude outfile->time = infile->time ;delete vars used delete(sst) end do end