Hi Khaled,
What error message do you get? can you share the code you are using?
Thanks,
Kevin
Dear Kevin,
here is the code I wrote..
=========
pro Open_read_ERA5_nc
filename='C:\Users\Khaled Tahoon\Desktop\NC\Era5_Reanalysis_hourly_19-7-2012.nc'failname = NCDF_EXISTS()help,filename, /structure; Open the netCDF file:id = NCDF_OPEN('filename'); Get the variable ID for variable "Era5_Reanalysis_hourly_19-7-2012":varid = NCDF_VARID(filename, 'Era5_Reanalysis_hourly_19-7-2012')d_lev= ncdf_varid(varid,"lev")print, d_levprint, n_elements(filename.lev), n_elements(filename.lat), n_elements(filename.lon), n_elements(filename.time)print, filename.levelprint, filename.dataprint, filename.lonprint, filename.latNCDF_CLOSE, filename
end
===========
this is the following error
Compiled module: OPEN_READ_ERA5_NCIDL> .CONTINUENCDF_VARID: 1 is not a valid cdfid.Execution halted at: OPEN_READ_ERA5
7 C:\Users\Khaled Tahoon\Desktop\NC\open_read_era5.pro $MAIN$
=======
Khaled
2 Comments
Kevin Marsh
Hi Khaled,
What error message do you get? can you share the code you are using?
Thanks,
Kevin
Khaled Megahed
Dear Kevin,
here is the code I wrote..
=========
pro Open_read_ERA5_nc
filename='C:\Users\Khaled Tahoon\Desktop\NC\Era5_Reanalysis_hourly_19-7-2012.nc'
failname = NCDF_EXISTS()
help,filename, /structure
; Open the netCDF file:
id = NCDF_OPEN('filename')
; Get the variable ID for variable "Era5_Reanalysis_hourly_19-7-2012":
varid = NCDF_VARID(filename, 'Era5_Reanalysis_hourly_19-7-2012')
d_lev= ncdf_varid(varid,"lev")
print, d_lev
print, n_elements(filename.lev), n_elements(filename.lat), n_elements(filename.lon), n_elements(filename.time)
print, filename.level
print, filename.data
print, filename.lon
print, filename.lat
NCDF_CLOSE, filename
end
===========
this is the following error
Compiled module: OPEN_READ_ERA5_NC
IDL> .CONTINUE
NCDF_VARID: 1 is not a valid cdfid.
Execution halted at: OPEN_READ_ERA5
7 C:\Users\Khaled Tahoon\Desktop\NC\open_read_era5.pro
$MAIN$
=======
Khaled