begin ; ; Open netCDF file and print its contents. ; filedir = ncargpath("data") ncfilename = filedir + "/cdf/contour.cdf" netcdf_file = addfile(ncfilename,"r") print(netcdf_file) ; ; Open GRIB file and print its contents. ; grbfilename = filedir + "/grb/ced1.lf00.t00z.eta.grb" grib_file = addfile(grbfilename,"r") print(grib_file) ; ; Open a netCDF file called "data.nc" and write some of the GRIB contents ; to it. The "data.nc" file will contain variables "PRES," "HGT," ; "A_PCP," "NCPCP," "ACPCP," and "CAPE," which you can verify with: ; ; ncdump -h data.nc ; ncfile_out = addfile("data.nc","c") ncfile_out->PRES = grib_file->PRES_6_SFC ncfile_out->HGT = grib_file->HGT_6_SFC ncfile_out->A_PCP = grib_file->A_PCP_6_SFC_acc ncfile_out->NCPCP = grib_file->NCPCP_6_SFC_acc ncfile_out->ACPCP = grib_file->ACPCP_6_SFC_acc ncfile_out->CAPE = grib_file->CAPE_6_SFC end