-
Notifications
You must be signed in to change notification settings - Fork 79
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
Nearest neighbor destination to source interpolation for runoff #334
Comments
@billsacks @mvertens any thoughts on this? |
@dazlich - thanks for looking into this and proposing a fix. Several points:
|
@mvertens - thanks for your comments!
|
@mvertens @jedwards4b @billsacks Thanks for the help! |
@mvertens , @jedwards4b , @gustavo-marques and I met to discuss this on Friday. I should have written up some notes from that meeting at the time, because now that I'm returning to it after the weekend, my memory has gotten very cloudy on what exactly we decided... here is my best recollection but others, please correct me if you remember differently... some of this is probably just restating what @dazlich has already come to realize: Currently, our standard procedure in CESM is to provide offline-generated runoff mapping files; these do a nearest neighbor mapping but (we think) with an area correction to ensure conservation; then, in some cases, there is an extra horizontal smoothing applied to this nearest neighbor mapping. If you don't provide a runoff mapping file, then the current (untested, in a scientific sense!) behavior is to fall back to a conservative mapping. This is implemented here: CMEPS/mediator/esmFldsExchange_cesm_mod.F90 Line 2137 in 6d4c1ff
and here: CMEPS/mediator/esmFldsExchange_cesm_mod.F90 Line 2161 in 6d4c1ff
However, this probably isn't an appropriate option for this mapping, because – as @dazlich mentioned – there can be runoff in rof gridcells that don't overlap with the ocean grid. Alternative options that are already implemented would be to use mapnstod (nearest source to destination), mapnstod_consd (nearest source to destination followed by conservative dst) or mapnstod_consf (nearest source to destination followed by conservative frac). (None of these include the smoothing option that we often use in CESM.) At first we thought that mapnstod_consd (or maybe mapnstod_consf) might be an appropriate option, but from looking at how it's implemented, our best sense is that this effectively does a conservative mapping in areas of overlap between the rof and ocn grids and a nearest neighbor (nstod) mapping for ocn cells that are outside the rof grid, and our sense is that this won't actually conserve globally. I believe that two points would need to be addressed to have global conservation: (1) As @dazlich pointed out in the initial issue comment, mapnstod doesn't seem like the correct nearest neighbor approach. (We didn't discuss this in our meeting Friday, but I'm coming to see this as I come back to it more carefully today.) Instead, I agree with @dazlich that we would need to use mapndtos (which is not yet implemented in CMEPS) so that each source point goes to exactly one destination point (but a given destination point can receive input from multiple source points). See http://earthsystemmodeling.org/docs/nightly/develop/ESMF_refdoc/node9.html#opt:regridmethod for details. (2) From the discussion Friday, we think that, for nearest neighbor to conserve, you would need to do area normalizations before and after the mapping. In effect, you need to transform the per-area flux fields on the runoff grid (specified in mm/s or, equivalently, kg / m^2 / s) into volumetric quantities (specified as kg / s), do the nearest neighbor mapping, then re-transform the mapped fields into per-area fluxes on the ocean grid. I should say: we're pretty sure that this transformation is needed for conservation; what we're less sure of is whether it is already done somewhere (in either CMEPS or ESMF). I was asked to give some guidance to @gustavo-marques as to what simple changes he could make to test if any of the existing options might conserve, but as I have reflected on this and re-read @dazlich 's initial comment, I doubt that there are any currently-available mapping options in CMEPS that will conserve, so I don't think it's worth @gustavo-marques doing any quick tests right now. Based on this, my recommendation is as follows; do others agree with this?
|
@billsacks - regarding your point 2, I should have mentioned that after I generated the weights I multiplied them by the src area and divided by the dst area, accomplishing the transformation to volumetric quantities for the remapping. |
Thanks for the clarification, @dazlich - sounds great. I also asked Bob Oehmke:
He replied:
|
The port of mpas-ocean into the CESM framework is not getting all of the runoff (rofl) from DROF. I believe this is due to the mpas-ocean grid not being global - only defined where there is active ocean. With offline testing I have found that a nearest neighbor destination to source interpolation will conservatively interpolate the runoff to the ocean grid. Currently, I do not see this option in med_internalstate_mod.F90.
Right now, as I see it I need to:
Add a nearest neighbor d to s option in med_internalstate_mod.F90 based on ESMF_REGRIDMETHOD_NEAREST_DTOS (I propose mapndtos).
Add a block to med_map_mod.F90 to call ESMF_FieldRegridStore for this interpolation.
define rof2ocn_liq_rmap somewhere so that it is not 'unset' in esmFldsExchange_cesm_mod.F90, but is set to mapndtos.
I've likely oversimplified and am missing things as well.
The text was updated successfully, but these errors were encountered: