Open billsacks opened 9 months ago
@billsacks thanks for starting the discussion. I was going to create an issue for the mizuRoute problem, but this should cover it for us if we make this change. Those are the questions I want to know about as well, and right now I certainly do not.
Looking at the code the difference is in how the normalization is done. Here is med_map_mod.F90:
else if (mapindex == mapconsf .or. mapindex == mapnstod_consf) then
if (mastertask) then
write(logunit,'(A)') trim(subname)//' creating RH '//trim(mapname)//' for '//trim(string)
end if
call ESMF_FieldRegridStore(fldsrc, flddst, routehandle=routehandles(mapconsf), &
srcMaskValues=(/srcMaskValue/), &
dstMaskValues=(/dstMaskValue/), &
regridmethod=ESMF_REGRIDMETHOD_CONSERVE, &
normType=ESMF_NORMTYPE_FRACAREA, &
srcTermProcessing=srcTermProcessing_Value, &
ignoreDegenerate=.true., &
dstStatusField=dststatusfield, &
unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, &
rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
ldstprint = .true.
else if (mapindex == mapconsf_aofrac) then
.
.
.
else if (mapindex == mapconsd .or. mapindex == mapnstod_consd) then
if (mastertask) then
write(logunit,'(A)') trim(subname)//' creating RH '//trim(mapname)//' for '//trim(string)
end if
call ESMF_FieldRegridStore(fldsrc, flddst, routehandle=routehandles(mapconsd), &
srcMaskValues=(/srcMaskValue/), &
dstMaskValues=(/dstMaskValue/), &
regridmethod=ESMF_REGRIDMETHOD_CONSERVE, &
normType=ESMF_NORMTYPE_DSTAREA, &
srcTermProcessing=srcTermProcessing_Value, &
ignoreDegenerate=.true., &
dstStatusField=dststatusfield, &
unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, &
rc=rc)
if (chkerr(rc,__LINE__,u_FILE_u)) return
ldstprint = .true.
The difference is moving from normType=ESMF_NORMTYPE_FRACAREA to ESMF_NORMTYPE_DSTAREA. I would think this change would be greater than roundoff.
I think I'll need a temporary change for mizuRoute sooner than this change will happen so I'll make a separate issue for that.
@mvertens just clarified: "in terms of roundoff - I was only using that term lightly. What I really meant is that answers should just have very little differences."
Emerging from a discussion of https://github.com/ESCOMP/mizuRoute/issues/426, I talked with @mvertens a bit about the use of mapconsf vs. mapconsd. I found an email from her from Nov, 2020 - where the context was some changes she was making to the lnd <-> glc mapping - where she said:
However, it looks like many mappings still use mapconsf. I believe this is part of the problem behind https://github.com/ESCOMP/mizuRoute/issues/426: the main lnd -> rof mapping is treated as mapconsf, but the lnd -> rof mapping of lfrac uses mapconsd, and this discrepancy means that the user-provided lnd -> rof mapping file is ignored for the mapping of lfrac.
This morning, @mvertens told me that, although she, @oehmke and @DeniseWorthen came to agree that we should be using mapconsd (at least for global grids), at the time they wanted to avoid answer changes (and/or didn't have time to do the full validation this would require), so they did not make this change. @mvertens and I felt like it would be worth revisiting this to answer the following questions:
Things are pretty busy now both for @mvertens and the ESMF team, but maybe we could meet in a few weeks to discuss these things – or just have some discussion here.