Documentation of newtime


Global Index (short | long) | Local contents | Local Index (short | long)


Help text

keep = find((newdate ~= 19851001) & (newdate ~= 19851101));
newdate = newdate(keep);

Cross-Reference Information

This script calls This script is called by

Listing of script newtime


cd /home/disk/hayes2/dvimont/ccm/data
filccm = ['ts.nc'];
nc = netcdf(filccm, 'nowrite')
date = nc{'date'}(:);
time = nc{'time'}(:);
nbdate = nc{'nbdate'}(:);
nc = close(nc) 
newdate = [];
for i = 2:16;
  for j = 1:12
    newdate = [newdate; (19800001 + i*10000 + j*100)];
  end
end
for j = 1:9
  newdate = [newdate; (19970001 + j*100)];
end

nc = netcdf(filccm, 'write')
nc{'date'}(:) = newdate;
nc = close(nc);

ccmid = ncmex('OPEN', filccm, 'NC_WRITE');

[datatype, len, status] = ncmex('ATTINQ', ccmid, 'time', 'units');
[value, status] = ncmex('ATTGET', ccmid, 'time', 1)
value_new = ['days since 1981-12-01 00:00:00']
status = ncmex('ATTPUT', ccmid, 'time', 'units', datatype, len+1, value_new)

ccmid = ncmex('CLOSE', ccmid);

day_num = [30    61    89   120   150   181   211   242   273   303   334   364]';

newtime = [];
for i = 1:15;
  newtime = [newtime; 365*(i-1)+day_num];
end;
newtime = [newtime; [365*15 + day_num(1:9)]];

nc = netcdf(filccm, 'write')
nc{'time'}(:) = newtime;
nc = close(nc);