I have a netcdf file A.nc containing monthly data from 2011 to 2020. Say the main data is for specific humidity. The variables are :
time
Size: 432x1
Dimensions: time
Datatype: double
Attributes:
bounds = 'time_bnds'
axis = 'T'
long_name = 'time'
standard_name = 'time'
units = 'days since 1850-01-01'
calendar = 'julian'
time_bnds
Size: 2x432
Dimensions: bnds,time
Datatype: double
plev
Size: 19x1
Dimensions: plev
Datatype: double
Attributes:
units = 'Pa'
axis = 'Z'
positive = 'down'
long_name = 'pressure'
standard_name = 'air_pressure'
lat
Size: 32x1
Dimensions: lat
Datatype: double
Attributes:
bounds = 'lat_bnds'
units = 'degrees_north'
axis = 'Y'
long_name = 'Latitude'
standard_name = 'latitude'
lat_bnds
Size: 2x32x432
Dimensions: bnds,lat,time
Datatype: double
lon
Size: 192x1
Dimensions: lon
Datatype: double
Attributes:
bounds = 'lon_bnds'
units = 'degrees_east'
axis = 'X'
long_name = 'Longitude'
standard_name = 'longitude'
lon_bnds
Size: 2x192x432
Dimensions: bnds,lon,time
Datatype: double
hus
Size: 192x32x19x432
Dimensions: lon,lat,plev,time
Datatype: single
Attributes:
_FillValue = 1.000000020040877e+20
standard_name = 'specific_humidity'
long_name = 'Specific Humidity'
comment = 'Specific humidity is the mass fraction of water vapor in (moist) air.'
units = '1'
original_units = '1.0'
javaaddpath('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdfAll-4.2.jar');
javaaddpath('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\snctools\classes');
addpath ('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\snctools');
addpath ('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\mexnc');
addpath ('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdf_toolbox')
addpath ('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdf_toolbox\netcdf\ncsource')
addpath('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdf_toolbox\netcdf\nctype')
addpath('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdf_toolbox\netcdf\ncutility')
addpath('D:\SHUM\NetCDF file read\netcdf souceforge\mexcdf\netcdf_toolbox\netcdf')
data_Wwind=netcdf('J:\JOYDEB_All_Data\SNSR\SH300\hus_Amon_IITM-ESM_ssp585_r1i1p1f1_gn_20150116-20501216_v20200915.nc');
ncid = netcdf.open('hus_Amon_IITM-ESM_ssp585_r1i1p1f1_gn_20150116-20501216_v20200915.nc','NC_NOWRITE');
lat_Wwind=data_Wwind{'lat'}(:);
lon_Wwind=data_Wwind{'lon'}(:);
time_Wwind=data_Wwind{'time'}(:);
winddata_Wwind=data_Wwind{'hus'}(:);
time_datenum_Wwind = time_Wwind / 24 + datenum('1800-01-01 00:00:0');
Time_Wwind=datevec(time_datenum_Wwind);
>> How can I have the specific humidity data in 120x1 matrix, all months for this 10 years (monthly averaged for 10 years)? I have attached the code as far I could write.