I am not able to figure this out myself and thus was hoping for some ideas from your side.
I am trying to create a netCDF-4 file in R using the netcdf4 library. The nc-file should contain a variable, let's say temperature (ta), which has 4 dimensions: longitude, latitude, time, and pressure level.
Because of certain reasons I would like the last dimension "pressure level" to consist of character entries, like "upper level", "lower level". Unfortunately, the function ncdim_def() only allows numerical values and not characters.
I have looked into many things including nco/cdo commands, but did not find a solution. Does anybody have an idea?
Any help would be much appreciated!
I found a workaround for my question. So what you can do is:
Hope this helps.
You can code upper and lower levels in numeric form ie. 1 for upper and 0 for lower levels of pressure.
This may require decoding back to string at a later stage.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.