system("/bin/rm -f wrfbiochemi_d03_ZERO.nc") ; remove any pre-existing file fout = addfile ("wrfbiochemi_d03_ZERO.nc" , "c") f = addfile ("wrfbiochemi_d03.nc" , "r") vNames = getfilevarnames (f) ; get names of all variables on file nNames = dimsizes (vNames) ; number of variables on the file print (vNames) ; print all variable names on file do n=0,nNames-1 ; loop thru each variable v := f->$vNames(n)$ ; read the varible to memory vdim := dimsizes(v) ; dimension size of the variable vrank= dimsizes(vdim) ; rank [ie: number of dimensions] if (vrank.ge.3.and.(vNames(n).ne."XLAT" .and. vNames(n).ne."XLONG")) then vtype = typeof(v) if (vtype.eq."integer") then v = 0 elseif (vtype.eq."float") then v = 0.0 elseif (vtype.eq."double") then v = 0.0d0 end if end if fout->$vNames(n)$ = v end do