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

Fix issue with Ocean TerminateImport in Surf #789

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

mathomp4
Copy link
Member

Runs of the MAPL3 development code triggered a fault due to changes in #772 see:

Now, for reason as yet unknown (though @bena-nasa is investigating) MAPL2 doesn't seem to mind this, but MAPL3 does. However, I believe this is an issue with develop as well.

To wit, in GEOS_GcmGridComp.F90 we have:

    if (DO_CICE_THERMO == 2) then  
       call MAPL_AddConnectivity ( GC,                              &
            SHORT_NAME  = (/'SURFSTATE'/),                          &
            DST_ID = AGCM,                                          &
            SRC_ID = OGCM,                                          &
            RC=STATUS  )
       VERIFY_(STATUS)
    endif

and in GEOS_OgcmGridComp.F90

  if (DO_CICE_THERMO == 2) then
     call MAPL_AddExportSpec ( GC   ,                          &
          SHORT_NAME = 'SURFSTATE',                            &
          CHILD_ID   = SEAICE ,                                &
                                                           _RC )
  endif

In both cases the SURFSTATE code is protected with an if-block for DO_CICE_THERMO==2. But in GEOS_SurfaceGridComp.F90 we have:

   ! call MAPL_TerminateImport    ( GC, CHILD = OCEAN,   RC=STATUS  )
    call MAPL_TerminateImport    ( GC, SHORT_NAMES=['SURFSTATE'],    &
                                   CHILD_IDS=[OCEAN],  RC=STATUS  )

which seems to cause some issues when running in the plain DO_CICE_THERMO=0 way.

So my proposal is we only do the TerminateImport with SURFSTATE mentioned if we are running DO_CICE_THERMO=2 and if not, we use the "old" TerminateImport code which (I think?) terminates all of Ocean.

Since #772 was @zhaobin74 's code, I'll explicitly add him here. I think this is safe, but I want his blessing.

@mathomp4 mathomp4 added the 0 diff The changes in this pull request have verified to be zero-diff with the target branch. label Jul 28, 2023
@mathomp4 mathomp4 requested a review from zhaobin74 July 28, 2023 15:38
@mathomp4 mathomp4 requested a review from a team as a code owner July 28, 2023 15:39
@mathomp4 mathomp4 self-assigned this Jul 28, 2023
@mathomp4 mathomp4 requested review from a team as code owners July 28, 2023 15:39
Copy link
Contributor

@zhaobin74 zhaobin74 left a comment

Choose a reason for hiding this comment

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

Thanks for catching this. It was a bug of not protecting the MAPL_terminate call. Now this fix worked for both CICE4 and CICE6.

@sdrabenh sdrabenh merged commit c41a17a into develop Jul 28, 2023
@sdrabenh sdrabenh deleted the bugfix/mathomp4/surfstate-terminate-fix branch July 28, 2023 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 diff The changes in this pull request have verified to be zero-diff with the target branch.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants