Closed bouweandela closed 1 month ago
I'm not sure this is possible because the generic regridding schemes don't work for all models, you can get results such as this one using ESMFAreaWeighted:
Could you provide some more details on that image, to help me understand the issue?
It happens to models that have OceanGridFix applied to them. The generated bounds work fine to regrid with the non-lazy regridders, but for some reason when you call the lazy AreaWeighted scheme, this happens. You can check with the recipe below for instance:
documentation:
title: test regrid
description: |
Test regrid
authors:
- loosveldt-tomas_saskia
datasets:
- {dataset: FGOALS-g3, ensemble: r1i1p1f1, exp: historical, project: CMIP6, grid: gn, timerange: 1951/1951}
preprocessors:
pp:
regrid:
target_grid: 1.5x1.5
scheme:
reference: esmf_regrid.schemes:ESMFAreaWeighted
diagnostics:
test_regrid:
variables:
tos:
mip: Omon
preprocessor: pp
scripts: null
An overview of regridding a 2D ocean variable (sea surface temperature) for most models in CMIP6 to a 1x1 grid is available here and with xesmf here. Created with the debug-regrid branch which keeps going when a regridding error occurs and adds a bit of info.
A first inspection reveals the following issues:
use_src_mask: true
, 3D (i.e. with vertical dimension) variables not supported: CMCC-CM2-SR5, CMCC-ESM2, CNRM-CM6-1-HR, CNRM-CM6-1, CNRM-ESM2-1, CanESM5-1, CanESM5-CanOE, CanESM5, EC-Earth3-Veg-LR, EC-Earth3-Veg, EC-Earth3, GFDL-ESM4, IPSL-CM6A-LR, IPSL-CM6A-LR, MPI-ESM1-2-HR, MPI-ESM1-2-LR, MRI-ESM2-0, NESM3, TaiESM1use_src_mask: true
gives wrong results, see https://github.com/SciTools-incubator/iris-esmf-regrid/issues/368esmvalcore.preprocessor.regrid_schemes
:
It happens to models that have OceanGridFix applied to them.
@sloosvel I tried the recipe, but am getting poor results with all available regridders. Did I miss something? I ran this recipe and got the following images: Default built-in ESMPy based regridder iris-esmf-regrid regridder xesmf regridder from #2433
You are right, I don't know why I was under the impression it worked for the non-lazy schemes.
Through iris-esmf-regrid and the generic regridding schemes, it is possible to regrid grids with 2D latitude and 2D longitude coordinates lazily. However, these regridding schemes are not automatically selected and instead the non-lazy ESMPyLinear/ESMPyNearest/ESMPyAreaWeighted built-in schemes are selected. This results in poor computational performance by default.
@schlunma @sloosvel Do you think it would be possible to improve the default so we prefer lazy schemes and automatically select those when possible?