Coastline disappears after regridding with remapbil
Added by Margarida Samso over 2 years ago
Dear CDO Support Team,
I contact you because when regridding with remapbil, the coastline disappears for the CMIP6 model CanESM5-CanOE. The command used to regrid is the next one:
cdo -L -remapbil,tos_Omon_CanESM5-CanOE_piControl_r1i1p2f1_gn_580101-600012.nc -selname,baresoilFrac baresoilFrac_Lmon_CanESM5-CanOE_piControl_r1i1p2f1_gn_555001-560012.nc-ts0 test_gr-ts0.nc
I attach the input, output and grid files and the map. How could the input file be regridded without removing the coastline?
Thank you very much in advance.
Best regards,
Marga
Replies (8)
RE: Coastline disappears after regridding with remapbil - Added by Karin Meier-Fleischer over 2 years ago
Hi Margarida,
what do you mean with the coastlines disappear? There are no coastlines stored in the file, I think what you mean are the white grid cells colored by ncview.
Original file
Remapped data
-Karin
barsoilFrac_original_data.png (363 KB) barsoilFrac_original_data.png | original data | ||
baresoilFrac_remap_data.png (375 KB) baresoilFrac_remap_data.png | remapped data |
RE: Coastline disappears after regridding with remapbil - Added by Margarida Samso over 2 years ago
Hi Karin,
Thank you very much for your prompt answer. Yes, sorry for the explanation, I refer to the white grid cells colored by ncview.
Kind regards,
Marga
RE: Coastline disappears after regridding with remapbil - Added by Margarida Samso over 2 years ago
Hello Karin,
Sorry I forgot to activate the Opt option in ncview so the coastline is shown, so this issue is solved. Thank you very much for your attention!
Best regards,
Marga
RE: Coastline disappears after regridding with remapbil - Added by Margarida Samso over 2 years ago
Hello again Karin,
Sorry for re-opening this issue. Do you know how could the white line be removed? I tried with different values of selindexbox but I didn't achieve to solve it. For example -selindexbox,1,192,2,145:
cdo -L remapbil,tos_Omon_ACCESS-ESM1-5_piControl_r1i1p1f1_gn_010101-060012.nc -selindexbox,1,192,2,145 baresoilFrac_Lmon_ACCESS-ESM1-5_piControl_r1i1p1f1_gn_010101-060012.nc baresoilFrac_Lmon_ACCESS-ESM1-5_piControl_r1i1p1f1_gr_010101-060012.nc
Thank you very much in advance.
Best regards,
Marga
RE: Coastline disappears after regridding with remapbil - Added by Karin Meier-Fleischer over 2 years ago
I think you mean something that is call 'missing cyclic point'. If you want to plot the data most vis tools can handle that.
RE: Coastline disappears after regridding with remapbil - Added by Margarida Samso over 2 years ago
Hi Karin,
You're right, I see it is due to the missing cyclic point in the longitudes. I tried with cdo -sethalo, but the white line still appears, is this command all right?
cdo -sethalo,0,1 test_gr-ts0.nc test_gr-ts0.nc-cycliclon
Many thanks!
Best regards,
Marga
RE: Coastline disappears after regridding with remapbil - Added by Karin Meier-Fleischer over 2 years ago
I would say yes.
cdo -remapbil,tos_Omon_CanESM5-CanOE_piControl_r1i1p2f1_gn_580101-600012.nc-ts0 baresoilFrac_Lmon_CanESM5-CanOE_piControl_r1i1p2f1_gn_555001-560012.nc-ts0 outfile.nc
cdo sinfon outfile.nc File format : NetCDF4 classic -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown CanESM5-CanOE v instant 1 1 104760 1 F32 : baresoilFrac Grid coordinates : 1 : curvilinear : points=104760 (360x291) longitude : 0.04980133 to 359.9949 degrees_east latitude : -78.3935 to 89.74177 degrees_north available : cellbounds mapping : undefined i : 0 to 359 by 1 1 j : 0 to 290 by 1 1 Vertical coordinates : 1 : surface : levels=1 Time coordinate : time : 1 step RefTime = 1850-01-01 00:00:00 Units = days Calendar = 365_day Bounds = true YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss 5550-01-16 12:00:00
cdo -sethalo,0,1 outfile.nc outfile_sethalo.nc
After the sethalo use, CDO sinfon tells you that the Grid coordinates longitude are now circular.
cdo sinfon outfile_sethalo.nc File format : NetCDF4 classic -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown CanESM5-CanOE v instant 1 1 105051 1 F32 : baresoilFrac Grid coordinates : 1 : curvilinear : points=105051 (361x291) longitude : 0.04980133 to 359.9949 degrees_east circular latitude : -78.3935 to 89.74177 degrees_north available : cellbounds Vertical coordinates : 1 : surface : levels=1 Time coordinate : time : 1 step RefTime = 1850-01-01 00:00:00 Units = days Calendar = 365_day Bounds = true YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss 5550-01-16 12:00:00
RE: Coastline disappears after regridding with remapbil - Added by Margarida Samso over 2 years ago
Hi Karin,
Now I see how cdo -sethalo works, thank you very much for the explanation.
For the white line, I contacted the author of the ncview program and he told me that the code should be updated because ncview has some sort of bug with the map projection of this file, as the 0 degree longitude line is in the middle of the image, rather than at the edge. Then this message can be marked as solved.
Thank you very much for attention.
Best wishes,
Marga