


Extract the year from a give NCEP file name (either 'uwnd.sig995.YYYY.nc' or 'vwnd.sig995.YYYY.nc'). Files are those downloaded from ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis/surface/. INPUT: NCEP NetCDF filename (and path) OUTPUT: NCEP data year Author(s): Pierre Cazenave (Plymouth Marine Laboratory) Revision history: 2012-10-15 First version ==========================================================================


0001 function year = get_NCEP_year(file) 0002 % Extract the year from a give NCEP file name (either 'uwnd.sig995.YYYY.nc' 0003 % or 'vwnd.sig995.YYYY.nc'). Files are those downloaded from 0004 % ftp://ftp.cdc.noaa.gov/Datasets/ncep.reanalysis/surface/. 0005 % 0006 % INPUT: 0007 % NCEP NetCDF filename (and path) 0008 % 0009 % OUTPUT: 0010 % NCEP data year 0011 % 0012 % Author(s): 0013 % Pierre Cazenave (Plymouth Marine Laboratory) 0014 % 0015 % Revision history: 0016 % 2012-10-15 First version 0017 % 0018 %========================================================================== 0019 0020 [~, tmp_year, ~] = fileparts(file); 0021 tmp_year = regexp(tmp_year, '\.', 'split'); 0022 year = str2double(tmp_year(end));