Reading and plotting the data in controlvect.nc

Reading and plotting the data in controlvect.nc#

Warning

To generate controlvect.nc files, use the option save_out_netcdf in controlvect.

NetCDF controlvect files are stored in $WORKDIR/controlvect/THE_VARIABLE, where THE_VARIABLE is one of flux, inicond, latcond, topcond, etc., depending on which components were selected for inversion in datavect (see the inversion tutorial).

Their format is as follows:

netcdf controlvect_inicond_CH4 {
dimensions:
	time = TT ;
	lev = NL ;
	lat = NLAT ;
	lon = NLON ;
	time_phys = PP ;
	latc = NLATC ;
	lonc = NLONC ;
variables:
	int64 time(time) ;
		time:units = "days since 2008-01-01 00:00:00" ;
		time:calendar = "proleptic_gregorian" ;
	int64 lev(lev) ;
	double x(time, lev, lat, lon) ;
		x:_FillValue = NaN ;
	double xb(time, lev, lat, lon) ;
		xb:_FillValue = NaN ;
	double b_std(time, lev, lat, lon) ;
		b_std:_FillValue = NaN ;
	int64 time_phys(time_phys) ;
		time_phys:units = "microseconds since 2008-01-01 00:00:00" ;
		time_phys:calendar = "proleptic_gregorian" ;
	double x_phys(time_phys, lev, lat, lon) ;
		x_phys:_FillValue = NaN ;
	double xb_phys(time_phys, lev, lat, lon) ;
		xb_phys:_FillValue = NaN ;
	double b_phys(time_phys, lev, lat, lon) ;
		b_phys:_FillValue = NaN ;
	float latitudes(lat, lon) ;
		latitudes:_FillValue = NaNf ;
	float longitudes(lat, lon) ;
		longitudes:_FillValue = NaNf ;
	double latitudes_corner(latc, lonc) ;
		latitudes_corner:_FillValue = NaN ;
	double longitudes_corner(latc, lonc) ;
		longitudes_corner:_FillValue = NaN ;
	double areas(lat, lon) ;
		areas:_FillValue = NaN ;

// global attributes:
		:_NCProperties = "version=2,netcdf=4.8.0,hdf5=1.10.6" ;
}

where:

  • TT: the number of time steps at the controlled resolution. For example, fluxes inverted at weekly resolution over two months give TT = 8.

  • NL, NLAT, NLON, NLATC, NLONC: the number of vertical levels, latitudes, longitudes, corner latitudes, and corner longitudes of the control vector’s physical grid.

  • PP: the number of time steps at the native resolution of THE_VARIABLE. For example, fluxes inverted at weekly resolution over March and April but provided at hourly resolution give PP = (31 + 30) × 24 = 1464.

  • x: the increments (posterior corrections)

  • xb: the prior increments (typically 1 for multiplicative corrections, 0 for additive ones)

  • b_std: the diagonal of the \(\mathbf{P}^\textrm{b}\) matrix (prior variances)

  • x_phys: the posterior physical field values

  • xb_phys: the prior physical field values

  • b_phys: the diagonal of the \(\mathbf{P}^\textrm{b}\) matrix in physical units.

Examples for reading and plotting controlvect.nc files are given in the VERIFY project.