Unsupported grid type: generic
Added by Ali Hoshyaripour almost 7 years ago
Hello everyone
I have the outputs of an ICON simulation on a generic grid. Normally, I read this data together with the ICON grid (which is a separate file) and plot the results in NCL. But now I want the convert them to normal latlon grid. I do the following
To calculate the weights:
cdo -P 48 gennn,gridfile icon_grid_0024_R02B06_G.nc weights_r2b06.nc
to do the mapping:
cdo -P 48 remap, gridfile,weights_r2b06 icon_output.nc latlon_out1.nc
But I face an error: Unsupported grid type: generic
I guess the problem is that the output files and icon grid are separated files. I assume if they are in one file, conversion to a latlon grid is straightforward. I was wondering if someone has experience with this. Thanks in advance!
Cheers
Ali
Replies (7)
RE: Unsupported grid type: generic - Added by Karin Meier-Fleischer almost 7 years ago
Hi Ali,
without the data I can only guess that you have to merge the grid and the data file first to get a correct grid for your variable (see attribute coordinates).
cdo -f nc -merge gridfile.nc datafile.nc outfile.nc
-Karin
RE: Unsupported grid type: generic - Added by Ali Hoshyaripour almost 7 years ago
Hi Karin
Thanks a lot. The merge seems to be working. But wen I suue the remap command:
cdo -P 48 remap,era_griddes,weights_r2b06.nc outfile.nc latlon_out1.nc
cdo remap: Nearest neighbor weights from unstructured (491520) to lonlat (2880x1441) grid
cdo remap: Nearest neighbor weights from unstructured (163842) to lonlat (2880x1441) grid
cdo remap (Warning): Reference to horizontal grid not available!
cdo remap (Abort): Reference to source grid not found!
Any idea what is happening here? I put the grid and the generic output file in the following link:
https://bwsyncandshare.kit.edu/dl/fiLPDK6GpjQRphwCbAmTAsGM/.zip
thanks again
Ali
RE: Unsupported grid type: generic - Added by Karin Meier-Fleischer almost 7 years ago
The ouput_r2b06.nc file is written by NCL. You have to write the data in your NCL script more detailed (correct dimesnion names).
See [[http://ncl.ucar.edu/Applications/method_2.shtml]]
You have to name the dimensions in your data file correct. ncl3 seems to be ncells and ncl1 could be time, but this is what you should know.
-Karin
RE: Unsupported grid type: generic - Added by Karin Meier-Fleischer almost 7 years ago
To change the dimension names you can use also NCO's ncrename program:
assuming ncl1 = time, ncl2 = levels and ncl3 = ncells
ncrename -d ncl1,time -v ncl1,time -d ncl2,levels -v ncl2,levels -d ncl3,ncells -v ncl3,ncells infile outfile
You have to add the coordinates attribute to your variable, too:
ncatted -a coordinates,AOD_DUST,a,c,"clon clat" infile outfile
But it is always a good style and idea to write your NCL script in the correct way.
-Karin
RE: Unsupported grid type: generic - Added by Ali Hoshyaripour almost 7 years ago
Hi Karin,
thanks a lot for the detailed explanations. I will work on this and get back to this QA if there were any issues.
enjoy the holidays
Ali
RE: Unsupported grid type: generic - Added by Ali Hoshyaripour almost 7 years ago
Dear Karin,
I am back to this issue and still have the same problems. The files are created by my colleague using NCL so I cannot change the sources anymore. The dimensions are ncl1 = levels, ncl2 = time and ncl3 = ncells. I corrected these dimension names and followed your instructions but still have the following error:
cdo remap: Nearest neighbor weights from unstructured (491520) to lonlat (2880x1441) grid
cdo remap: Nearest neighbor weights from unstructured (163842) to lonlat (2880x1441) grid
cdo remap (Warning): Reference to horizontal grid not available!
cdo remap (Abort): Reference to source grid not found!
Did you use the data I shared with you? Did it work for you?
thanks in advance
Ali
RE: Unsupported grid type: generic - Added by Karin Meier-Fleischer almost 7 years ago
Hi Ali,
there is nothing else for it but to get the NCL script and modify it to get the right results. In the data file output_r2b06.nc not only the dimensions are incorrect named but also the time and levels variables are missing. By the way the dimensions are not in the correct order (time first), too.
-Karin