Skip to content

Conversation

@jiandewang
Copy link
Collaborator

The nuopc_cap and mom_cap_methods.F90 are revised to convert imported Stokes drift
components from a missing value (9.99e20) to zero. This update doesn't have any impacts on
global applications and are only needed when the ocean model domain is greater
than the wave model domain while the wave model cannot provide Stokes drift components
for the entire ocean model domain.

Thanks for @alperaltuntas to do a pre-test for this PR.

sanAkel and others added 12 commits April 18, 2025 08:10
  * in order to do clean test for GFDL-20250423 PR
  * revert ISO feature in MOM_sum_output.F90
…0250527

update MOM6 to its main repo. 20250527 commit.
…0250801

update MOM6 to its main repo. 20250801 commit
…rted Stokes drift components

* The mom_cap_methods.F90 file is revised to convert imported Stokes drift components
 from a missing value (9.99e20) to zero. This update doesn't have any impacts on global
 applications.These updates are only needed when the ocean model domain is greater than 
the wave model domain and the wave model cannot provide Stokes drift components
for the entire ocean model domain.
@jiandewang
Copy link
Collaborator Author

We apologize for some extra commits in this PR. What happened is we had an internal updating on ISO code which happened right before GFDL's 20250423 PR (#1664). In GFDL's PR one variable was removed and unfortunately that variable was being used/modified in EMC's ISO code. During the test and merging time we found there is no simply way to solve the code conflict. As a consequence we had to manually changed back (git revert is not allowed in UFS as it will have big negative impact for all UFS developers' onging work) our ISO code in order to merge GFDL's PR. We added ISO code updating back after GFDL's PR was merged in dev/emc.

we had an internal discussion on this extra commits issue but found there is no simply way to handle it, so please treat this case as an exception and we will make sure to follow "one updating, one hash" style as close as possible.

Copy link
Collaborator

@mathomp4 mathomp4 left a comment

Choose a reason for hiding this comment

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

GEOS does not even compile these files, so easy approval from GMAO.

Copy link
Collaborator

@abozec abozec left a comment

Choose a reason for hiding this comment

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

We do not use these routines either at COAPS so we approve.

Copy link
Collaborator

@kshedstrom kshedstrom left a comment

Choose a reason for hiding this comment

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

I'm not using these files either. Approve!

Copy link
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

These changes will not impact GFDL, and they look to me like they are properly implemented.

I would note that the comparison with a missing value of 9.99e20 on line 546 of mom_cap_methods.F90 to within a tolerance of 0.01 is effectively an '==' because the least bit in a change from 9.99e20 for a real*8 number is about 1e5. However, this construct might be a deliberate attempt to avoid complier warnings about checking for exact equality between real numbers.

There are also several points where these proposed change deviate from the style set out in the MOM style guide at https://github.com/mom-ocean/MOM6/wiki/Code-style-guide, which discourages the use of if( ...) in favor of if (...), and encourages the use of enddo and endif instead of end do and end if. If we were following the style guide, the continuation lines at lines 551 and 553 would use at least a 4 point indent, rather than the 2 point indent used here.

@jiandewang
Copy link
Collaborator Author

@Hallberg-NOAA Thanks for the code stlye catching, just modified them

Copy link
Collaborator

@dougiesquire dougiesquire left a comment

Choose a reason for hiding this comment

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

ACCESS-NRI do use these routines, but we retain previous behaviour by default (set_missing_stks_to_zero = .false.)

Copy link
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

GFDL does not use the NUOPC driver, but from visual inspection these changes look like they should be work as intended.

@jiandewang
Copy link
Collaborator Author

@alperaltuntas can you review it ?

@jiandewang
Copy link
Collaborator Author

thanks for everybody's time to review this PR.
one question: in the past whenever we have PR to main, it is always in parallel with current MOM6 main repository plus some changes in the PR. But in this PR my branch is behind main as the previous change deafult parameter code is not in dev/emc yet. Shall I simply click merge here ?

@marshallward
Copy link
Collaborator

There is no problem merging this commit. We often have to make revisions to the PRs which are not part of our development branches.

EMC will pick up d6d211f when you merge main back into dev/emc.

@jiandewang jiandewang merged commit d68ff12 into mom-ocean:main Aug 22, 2025
52 checks passed
@jiandewang
Copy link
Collaborator Author

thanks @marshallward just merged

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

Successfully merging this pull request may close these issues.

10 participants