Error using the matlab.internal.imagesci.net cdflib NetCDF library encounters an error during the execution of 'open' function - 'Unknown file format (NC ENOTNC)'.

Error netcdf. Open (line 67) [varargout {that}] = matlab.internal.imagesci.net cdflib (' open ', filename, varargin {1});

Error Internal.matlab.Imagesci. Nc/openToRead (line 1280) enclosing ncRootid = netcdf. Open (this Filename, 'NOWRITE');

Error Internal.matlab. Imagesci. Nc (line 124) enclosing openToRead ();

Error ncdisp (line 62) ncObj = internal. Matlab. Imagesci. Nc (ncFile);



when  i downloaded files of 'lnsp,specific humidity' from ERA5-complete, these files can not be opend. and the wrong messages in matlab are listed as above.

I wonder is there any problem with data after the move of dataset.


the download script in python is listed as follow:

Or is there any wrong with my request code.

Help, please.

Yours,

David.

2022.11.27

Kevin Marsh 

Thanks Kevin.

import cdsapi
from subprocess import call
import calendar


def IdmDownloader(request_url, storage_path, file_name):
idm_engine = "C:\\Program Files (x86)\\Internet Download Manager\\IDMan.exe"
call([idm_engine, '/d', request_url, '/p', storage_path, '/f', file_name, '/a']
call([idm_engine, '/s'])

if __name__ == '__main__':
c = cdsapi.Client()
KeyWordsDic = {
'date': '20190101',
'levelist': '1/to/137',
'levtype': 'ml',
'param': '133',
'stream': 'oper',
'time': '00/to/23/by/6',
'type': 'an',
'area': '90/-180/-90/180',
'format': 'nc',
'grid': '1.0/1.0',
}
for y in range(2021, 2022):
for m in range(9, 10):
d_ym = calendar.monthrange(y, m)[1] #
for d in range(26, 31): # d_ym + 1
date = str(y) + str(m).zfill(2) + str(d).zfill(2)
print("%d %d" % (m, d))
KeyWordsDic['date'] = date
r = c.retrieve('reanalysis-era5-complete', KeyWordsDic, ) # , File_Name
Request_url = r.location
# path = "E:\\XDW\\Atm_RawData\\ERA5_DATA_nc\\Single_day\\t"
path = "E:\\"
File_Name = 'ERA5_' + 't' + '_' + date + '.nc'
IdmDownloader(Request_url, path, File_Name)




5 Comments

  1. is the netcdf type  of ERA5-complete is NETCDF3 or any other kind?

    I mean, NETCDF4 nc file can be successfully opened, such as ERA-Interim monthly mean surface preesure I download.

  2. Because all the data i download is available in netcdf format as I check in ERA5 Parameter databaseECMWF | Parameter database.

  3. Ok  this problem has been solved, grib files are successfully opend.

  4. Hi David, glad you are able to access the data; for reference in your script, you should use :

        'format'  : 'netcdf',    

    to request the data in netCDF,

    Thanks,

    Kevin

    1. Hi, Kevin!

      Thanks for your answering  :D!

      I will get it corrected next time when I retrieve ERA5 Data!

      Wish you a good day!

      ^^