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

Error with runoff_added_to_stf flag #278

Closed
sditkovsky opened this issue Dec 16, 2022 · 9 comments
Closed

Error with runoff_added_to_stf flag #278

sditkovsky opened this issue Dec 16, 2022 · 9 comments

Comments

@sditkovsky
Copy link

Hi,

I was updating our group's fork of MOM6 this morning. And I'm getting a compiler error from a recent commit:

/MOM6-examples-merge-12162022-2/src/MOM6/src/tracer/MOM_generic_tracer.F90(515): error #6460: This is not a field name that is defined in the encompassing structure. [RUNOFF_ADDED_TO_STF] if (allocated(g_tracer%trunoff) .and. (.NOT. g_tracer%runoff_added_to_stf)) then ------------------------------------------------------------^

I can see that runoff_added_to_stf was added to the g_tracer_type in /config_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90, so I'm not sure what the issue is.

Did anyone else experience this?

@kshedstrom
Copy link

Yes, I can confirm this. I did a "git fetch" on ocean_BGC and it didn't update from https://github.com/NOAA-GFDL/ocean_BGC.git (fetch)

@kshedstrom
Copy link

I should note that my Makefile builds three executables and the first two built fine: ocean_only, MOM6-SIS2, and MOM6-SIS2-COBALT.

@sditkovsky
Copy link
Author

Thanks @kshedstrom, I am indeed trying to compile MOM6-SIS2-COBALT

@sditkovsky
Copy link
Author

And MOM6-SIS2 compiles fine for me as well

@adcroft
Copy link
Member

adcroft commented Dec 16, 2022

It sounds like your version of COBALT needs updating with the same change in API. Is this due to #246 ? @andrew-c-ross is the API change already in COBALT ? Adding @nikizadehgfdl to thread. (edited)

@Hallberg-NOAA
Copy link
Member

Accepting PR #246 into dev/gfdl before github.com/NOAA-GFDL/ocean_BGC/pull/20 had been merged in was a mistake on my part. You should be able to get your code working by revsising the line ~515 of MOM_generic_tracer.F90 from
if (_ALLOCATED(g_tracer%trunoff) .and. (.NOT. g_tracer%runoff_added_to_stf)) then
back to
if (_ALLOCATED(g_tracer%trunoff)) then
and commenting out the line ~523 of the same file with
g_tracer%runoff_added_to_stf = .true..

@sditkovsky
Copy link
Author

Thanks everyone! Feel free to close this issue now, or we can leave it open until the ocean_BGC pr is merged

Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this issue Dec 16, 2022
  Added the new CPP macro _USE_OCEAN_BGC_PR20 to deal with the fact that the
recently added element runoff_added_to_stf does not yet exist within the
ocean_BGC version of the g_tracer_type, although it was added to the version in
confic_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90 as a part of
PR#246.  This caused the latest version of MOM6 to be unable to compile with the
ocean_BGC code.  With this new CPP macro, the code will once again compile, and
these bits of code can be enabled once the ocean_BGC code has this new element
in its version of the g_tracer_type.  Once there is sufficiently widespread
adoption of newer versions of the ocean_BGC code, these newly added macros can
be eliminated altogether.  This commit should address the issued documented
under github.com/NOAA-GFDL/issues/278.  Note that the use of CPP macros in
this way is generally strongly discouraged in MOM6, but it does seem like a
viable solution for addressing an interface change across two separately managed
code repositories.
@andrew-c-ross
Copy link

Sorry everyone---I shouldn't have marked the MOM6 PR as ready to review until the ocean_BGC PR was merged.

@Hallberg-NOAA
Copy link
Member

Now that NOAA-GFDL/ocean_BGC#20 has been merged into ocean_BGC repository, this should no longer be an issue, provided that contemporaneous versions of the MOM6 and ocean_BGC code are used. Accordingly, I am closing this issue.

Hallberg-NOAA added a commit to Hallberg-NOAA/MOM6 that referenced this issue Nov 27, 2023
  Added the new CPP macro _USE_OCEAN_BGC_PR20 to deal with the fact that the
recently added element runoff_added_to_stf does not yet exist within the
ocean_BGC version of the g_tracer_type, although it was added to the version in
confic_src/external/GFDL_ocean_BGC/generic_tracer_utils.F90 as a part of
PR#246.  This caused the latest version of MOM6 to be unable to compile with the
ocean_BGC code.  With this new CPP macro, the code will once again compile, and
these bits of code can be enabled once the ocean_BGC code has this new element
in its version of the g_tracer_type.  Once there is sufficiently widespread
adoption of newer versions of the ocean_BGC code, these newly added macros can
be eliminated altogether.  This commit should address the issued documented
under github.com/NOAA-GFDL/issues/278.  Note that the use of CPP macros in
this way is generally strongly discouraged in MOM6, but it does seem like a
viable solution for addressing an interface change across two separately managed
code repositories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants