fname_in = "ts_Amon_CESM1-CAM5_historical_r1i1p1_185001-200512.nc" fname_out = "new.nc" f_in = addfile(fname_in,"r") ; Open file for reading t_degk = f_in->ts ; read "ts" off the file and call it "t_degk" t_degc = t_degk - 273.15 ; convert from Kelvin to Celsius ;printVarSummary(t_degk) ; Look at the new variable ;printMinMax(t_degk,0) ; min/max ;exit ; leave the script this point copy_VarMeta(t_degk,t_degc) printVarSummary(t_degc) ; Look at the new variable printMinMax(t_degc,0) ; min/max t_degc@long_name = t_degk@long_name ; use same long_name as original variable t_degc@units = "degC" ; add the units printVarSummary(t_degc) ; Look at the new variable system("rm " + fname_out) ; just in case, remove file before you ; create it. f_out = addfile(fname_out,"c") ; open file in "create" mode ;----Write t_degc to file and call it "surface_temperature" f_out->surface_temperature = t_degc