220 likes | 342 Views
File Handling with CMPS. Sylvia Murphy National Center for Atmospheric Research. http://www.cgd.ucar.edu/csm/support/FH/CMPS. Getting Started. Utilities located on dataproc only. Put /contrib in your PATH Execute script in local directory or include full path. Concatenated File.
E N D
File Handling with CMPS Sylvia Murphy National Center for Atmospheric Research http://www.cgd.ucar.edu/csm/support/FH/CMPS
Getting Started • Utilities located on dataproc only. • Put /contrib in your PATH • Execute script in local directory or include full path
Concatenated File ESVC • Extract variables from a GROUP of netCDF files • Will process ALL *.nc files in the directory. • Each file must have anUNLIMITED record dimension. • Output file is esvc.nc U V U V U V usage: esvc.scp v1,v2,…,vN
20 m Single Level Extraction • Extract a single layer from variables in a netCDF file. • Output file is topbot.nc • Required modifiers: • name of the dimension to be indexed • array index to be extracted • variables to extract 20 m usage:topbot.scp dim inx v1,v2,…,vN filename
Extract 2D Variables • extract ALL 2D variables in a netCDF file. • output file is filename_2d.nc usage: e2d.scp file.nc
Subregion Extraction • Extract a subregion from variables in a netCDF file. • Several required modifiers: • latmin and latmax • lonmin and lonmax • “-o” option indicates an oceanic file usage: subext.scp latmin latmax lonmin lonmax [-o] [-v v1,v2,…,vN] file
Weighted Horizontal Average • Calculates weighted horizontal average • Can average over an oceanic basin or subregion • Output file is filename_have.nc Uses Gaussian weights (gw) Uses ocean area calculation usage: have.scp [-m int] [-sr latmin,latmax,lonmin,lonmax] [-v v1,v2,…,vN] file
Weighted Volume Average • Weighted volume average of variables in a netCDF file. • Can average over oceanic basin or over a subregion • Output file is filename_volave.nc Uses gw and delta pressure (dp) Uses ocean volume calculation usage: volave.scp [-m int] [-sr latmin,latmax,lonmin,lonmax] [-v v1,v2,…,vN] file
Zonal Average • Calculates zonal average of variables in a netCDF file. • Output file is filename_zonal.nc • Can average over an oceanic basin usage: zave.scp [-m int] [-v v1,v2,…,vN] file
Difference/Anomalies • Calculate difference between variables in two netCDF files • Time dimension removed automatically from mean files • “-m” option indicates an anomaly calculation • Output file is cmps_anom.nc if one file is a mean file,otherwise it is cmps_diff.nc. usage: diff.scp [-m int] [-v v1,v2,…,vN] file1 file2
Root Mean Squared Error • Calculate weighted RMSE variables in netCDF files. • Output is rmse.nc • Can be calculated over an ocean basin or subregion • “-l” option calculates a volume RMSE for 3D variables. usage: rmse.scp [-m int] [-sr latmin,latmax,lonmin,lonmax] [-v v1,v2,…,vN] file
Multiplication • Multiply variables in the variable list by the set of constants and output results to a netCDF file • At least one variable and corresponding factor must be provided. • Can calculate over an oceanic basin usage: mult.scp -v v1,v2,v3 -f f1,f2,f3 [-m int] filename
Addition • Adds variables in list and outputs results to netCDF file. • Name of resultant calculation is required • Can calculate over ocean basin. • If LSM file, then all ocean points are excluded regardless of basin index listed. usage: add.scp -v v1,v2,…,vN -n name [-m int] filename
20 C Level Latitude Longitude Isolevel Extraction • Extracts iso surface of a given value from a netCDF file • Output file is iso_filename.nc • Variable and value to be extracted must be specified • Works with variables that either increase or decrease with depth usage: iso.scp T 20 ocean_1.nc
CFC 20 C Level Level Latitude Longitude Latitude Longitude Isolevel Interpolation • Extracts iso surface of a given value from a netCDF file • Interpolates a second variable to that iso surface • Output file is iso_interp_filename.nc • Variable and value to be extracted plus variable to be interpolated must be specified usage: iso_interp.scp T CFC 20 ocean_1.nc
Transect • Calculate the great circle path between two points, and interpolate model data to path. • -p produces a plot in addition to file • Output is filename_title.nc • Number of points (npts) to interpolate is required usage: trans.scp leftlat,leftlon,rightlat,rightlon npts, title [-p] [-v v1,v2,…,vN] filename
Time Series Extraction • Extracts a time series from each point given. • Output file is filename_tsext.nc • -a option will output individual ascii files Time Time usage: tsext.scp latarray lonarray [-a] [-v v1,v2,…,vN] file
Vertical Average • Weighted vertical average of variables in a NCOM netCDF file. • Can average over oceanic basin or over a subregion • Output file is filename_vertave.nc NCOM Ocean files only usage: vertave.scp [-m int] [-sr latmin,latmax,lonmin,lonmax] [-v v1,v2,…,vN] file
Resources Downloadable users manual: http://www.cgd.ucar.edu/csm/support/Document/manual.shtml On-line version of this presentation: http://www.cgd.ucar.edu/csm/support/Document/shows.shtml On-line home page: http://www.cgd.ucar.edu/csm/support/FH/CMPS/