Emerging from NCAR/cesm_dev#344 - though this is something I've periodically remembered and later forgotten for a long time....
I believe that we need to add glacier surface mass balance (Flgl_qice / Flgl_qice_elev) to the budget tables. This is an output flux from lnd and an input flux to glc; there is a water flux and a corresponding heat flux.
A few things make this more challenging than other fluxes in the budget tables (and I think this is part of why we haven't already done this):
(1) In some configurations, there is a non-zero qice flux but it shouldn't be included in the budgets because it is just a diagnostic term that is already accounted for with other fluxes. This was the case for CISM in NOEVOLVE mode. Now that we're using DGLC for NOEVOLVE mode, this is less of an issue. It would still be an issue if running CISM in NOEVOLVE mode (though @mvertens is doing some work to make CISM in NOEVOLVE mode work more like DGLC's NOEVOLVE mode, in that it will handle these fluxes), or with some less common configurations (CISM options that we can perhaps ignore).
(2) Even in now-standard configurations, we still shouldn't be including qice in the budget tables for all grid cells: I think CTSM sends non-zero qice even in areas where GLC can't handle these fluxes (as determined by icemask_coupled_fluxes); in these places, CTSM also sends an equivalent flux to the river; so including qice in the budget tables in these locations would be double-counting.
(3) QICE from LND is broken down by elevation class, so requires some custom code to make global averages (weighting each elevation class appropriately). (This could possibly be worked around by using the field mapped to the GLC grid, and not trying to work with the field on the LND grid.)
My initial thought on how to handle all this is: compute this piece of the budgets on the GLC grid rather than the LND grid; that will deal with point (3) (this wouldn't allow us to check the conservation of the lnd->glc mapping with the budget tables, but I think that's a reasonable price to pay). Multiply the GLC grid cell values by Sg_icemask_coupled_fluxes in computing the budget numbers; this will deal with both points (1) and (2).
Emerging from NCAR/cesm_dev#344 - though this is something I've periodically remembered and later forgotten for a long time....
I believe that we need to add glacier surface mass balance (Flgl_qice / Flgl_qice_elev) to the budget tables. This is an output flux from lnd and an input flux to glc; there is a water flux and a corresponding heat flux.
A few things make this more challenging than other fluxes in the budget tables (and I think this is part of why we haven't already done this):
(1) In some configurations, there is a non-zero qice flux but it shouldn't be included in the budgets because it is just a diagnostic term that is already accounted for with other fluxes. This was the case for CISM in NOEVOLVE mode. Now that we're using DGLC for NOEVOLVE mode, this is less of an issue. It would still be an issue if running CISM in NOEVOLVE mode (though @mvertens is doing some work to make CISM in NOEVOLVE mode work more like DGLC's NOEVOLVE mode, in that it will handle these fluxes), or with some less common configurations (CISM options that we can perhaps ignore).
(2) Even in now-standard configurations, we still shouldn't be including qice in the budget tables for all grid cells: I think CTSM sends non-zero qice even in areas where GLC can't handle these fluxes (as determined by icemask_coupled_fluxes); in these places, CTSM also sends an equivalent flux to the river; so including qice in the budget tables in these locations would be double-counting.
(3) QICE from LND is broken down by elevation class, so requires some custom code to make global averages (weighting each elevation class appropriately). (This could possibly be worked around by using the field mapped to the GLC grid, and not trying to work with the field on the LND grid.)
My initial thought on how to handle all this is: compute this piece of the budgets on the GLC grid rather than the LND grid; that will deal with point (3) (this wouldn't allow us to check the conservation of the lnd->glc mapping with the budget tables, but I think that's a reasonable price to pay). Multiply the GLC grid cell values by Sg_icemask_coupled_fluxes in computing the budget numbers; this will deal with both points (1) and (2).