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

bugfix for fgrg_rofi computation #295

Merged
merged 2 commits into from
Aug 11, 2024

Conversation

mvertens
Copy link
Collaborator

@mvertens mvertens commented Aug 11, 2024

Description of changes

bugfix for fgrg_rofi computation
Thanks to @billsacks who discovered this issue!

Specific notes

The current logic for DGCL%NOEVOLVE for exporting Fgrg_rofi is the following:

       if (initialized_noevolve) then
          ! Compute Fgrg_rofi
          do ns = 1,num_icesheets
              do ng = 1,size(Fgrg_rofi(ns)%ptr)
                 Fgrg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
              end do
           end do
         end if

However, what Fgrg_rofi should only be exported if is_in_active_grid(usrf(ng)) is true. And the code should be the following:

       if (initialized_noevolve) then
          ! Compute Fgrg_rofi
          do ns = 1,num_icesheets
             do ng = 1,lsize(Fgrg_rofi(ns)%ptr)
                if (is_in_active_grid(usrf(ng))) then
                   Fgrg_rofi(ns)%ptr(ng) = Flgl_qice(ns)%ptr(ng)
                else
                   Fgrg_rofi(ns)%ptr(ng) = 0._r8
                end if
             end do
          end do
       endif

Note - since by default in coupled runs DGC%NOEVOLVE only sends new Fgrg_rofi back yearly - comparisons with previous runs will show no answer changes until the second year of the run.

Contributors other than yourself, if any: @billsacks

CDEPS Issues Fixed: #294

Are there dependencies on other component PRs (if so list): No

Are changes expected to change answers: Answer will differ after the first coupling period where valid data is received by DGLC (by default this is one year).

Any User Interface Changes (namelist or namelist defaults changes): No

Testing performed (e.g. aux_cdeps, CESM prealpha, etc): This was discovered and resolved in a NorESM case using the compset and grid:

1850_CAM%DEV%LT%NORESM%CAMoslo_CLM51%SP_CICE_BLOM%ECO_MOSART_DGLC%NOEVOLVE_SWAV_SESP

a%ne30np4.pg3_l%ne30np4.pg3_oi%tnx1v4_r%r05_w%null_z%null_g%gris4_m%tnx1v4

So this should apply equally to CESM cases.

Hashes used for testing:
CDEPS: cdeps1.0.44 (with dglc_datamode_noevolve_mod.F90 bug fix)
CMEPS: cmeps1.0.13 (with med_diag_mod.F90 bug fix)

@mvertens mvertens added bug Something isn't working Critical labels Aug 11, 2024
Copy link
Member

@billsacks billsacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @mvertens !

@mvertens mvertens merged commit 66ce97d into ESCOMP:main Aug 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Critical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DGLC%NOEVOLVE sends too much Fgrg_rofi
2 participants