I am trying to open a CLM restart file, retrieve its contents,
and write it again to a new identical file (later I will be modifying
a couple of the variables).
I tried the approach below. It creates a nearly identical file.
However, the levsoi and string_length dimensions (which
are unused by any variable) are lost.
I'm not sure if the model needs those to be present. Assuming
it does, how can I retrieve those dimensions from the first
file and pass them to the new file?
Thanks, Mike
a=addfile("b35.012mons1.clm2.r.2193-01-01-00000.nc","r")
system("rm b35.012mons1.clm2.r.2193-01-01-00000.new.nc")
out=addfile("b35.012mons1.clm2.r.2193-01-01-00000.new.nc","c")
names=getfilevarnames(a)
numb=dimsizes(names)
do i=0,numb-1
v = a->$names(i)$
out->$names(i)$ = v
delete(v)
end do
From ncdump...
dimensions:
gridcell = 5674 ;
landunit = 6080 ;
column = 6080 ;
pft = 41900 ;
levsoi = 10 ;
levlak = 10 ;
levsno = 5 ;
levtot = 15 ;
numrad = 2 ;
rtmlon = 720 ;
rtmlat = 360 ;
string_length = 64 ;
etc...
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue May 05 2009 - 12:38:05 MDT
This archive was generated by hypermail 2.2.0 : Wed May 06 2009 - 16:48:59 MDT