Per my previous discussion post:
Regional Ensemble Spin-up Error: "Attempt to use feature that was not turned on when netCDF was built"
I am now attempting to use the ncks command to subset the surface and domain data to my region of interest. Using the following command:
ncks -d LONGXY,21.,52. -d LATIXY,-12.,24. /glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc /glade/scratch/anthholmes/regional/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_E.Africa_ncks.nc
I receive the error:
Running ncdump -h and looking at the variable keys in Python, it is clear this variable exists, but has two dimensions: lsmlat, and lsmlon. The ./subset_surfdata python tool deals with this by converting the variables to a 1D array as follows:
How would one accomplish this using NCO? What other tools are people using to subset surface datasets?
Regional Ensemble Spin-up Error: "Attempt to use feature that was not turned on when netCDF was built"
I am now attempting to use the ncks command to subset the surface and domain data to my region of interest. Using the following command:
ncks -d LONGXY,21.,52. -d LATIXY,-12.,24. /glade/p/cesmdata/cseg/inputdata/lnd/clm2/surfdata_map/release-clm5.0.18/surfdata_0.9x1.25_hist_78pfts_CMIP6_simyr2000_c190214.nc /glade/scratch/anthholmes/regional/surfdata_0.9x1.25_78pfts_CMIP6_simyr2000_E.Africa_ncks.nc
I receive the error:
Code:
ncks: ERROR dimension LONGXY is not in input file
Running ncdump -h and looking at the variable keys in Python, it is clear this variable exists, but has two dimensions: lsmlat, and lsmlon. The ./subset_surfdata python tool deals with this by converting the variables to a 1D array as follows:
Code:
# create 1d variables
lon0=np.asarray(f1['LONGXY'][0,:])
lon=xr.DataArray(lon0,name='lon',dims='lsmlon',coords={'lsmlon':lon0})
lat0=np.asarray(f1['LATIXY'][:,0])
lat=xr.DataArray(lat0,name='lat',dims='lsmlat',coords={'lsmlat':lat0})
How would one accomplish this using NCO? What other tools are people using to subset surface datasets?