Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate weighting file with full variable list #69

Open
bradyrx opened this issue Oct 16, 2019 · 1 comment
Open

Generate weighting file with full variable list #69

bradyrx opened this issue Oct 16, 2019 · 1 comment

Comments

@bradyrx
Copy link

bradyrx commented Oct 16, 2019

The current weight file that is saved out by xESMF.Regridder() only has S, col, and row:

Screen Shot 2019-10-16 at 4 10 42 PM

However, standard ESMF weight files seem to have way more information. Here's an intermediate weighting file saved out by NCL:

Screen Shot 2019-10-16 at 4 01 37 PM

Is there any way to save out this fully detailed weighting file? This might be relevant to #11 to produce a SCRIP file following 12.8 here.

I'm looking to use frac_b to deal with partial area cells when doing conservative remapping to get a conservative integral. This is how it was done for NCAR's CMIP6 remapping here.

@JiaweiZhuang
Copy link
Owner

I don't think ESMPy has the option to output frac_a and frac_b. In ESCOMP/CTSM#643 (comment) where the regridding script was switched from NCL to the ESMPy-based OCGIS CLI, only the weights were kept, while frac_a/frac_b were removed.

This request can be raised upstream to ESMPy, but I wonder whether you really need frac_b to calculate the integral? From ESMF docs:

The grid frac arrays (frac_a and frac_b) are calculated by ESMF_RegridWeightGen. For conservative remapping, the grid frac array returns the area fraction of the grid cell which participates in the remapping. For bilinear and patch remapping, the destination grid frac array is one where the grid point participates in the remapping and zero otherwise. For bilinear and patch remapping, the source grid frac array is always set to zero.

By default, the integral sum(field * area) is conserved after xesmf's conservative regridding, unless a renormalization is applied on purpose (#17, not implemented yet). You don't need to know the grid fraction to compute the correct integral. Destination cells at the domain edges will be "diluted" so that the total mass is still the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants