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

Possible correction to declaration intent for diagnostic variables in drag_suite.F90 #37

Closed
mdtoyNOAA opened this issue Feb 3, 2023 · 0 comments · Fixed by #40 or NOAA-EMC/fv3atm#627
Labels
bug Something isn't working

Comments

@mdtoyNOAA
Copy link
Collaborator

Description

The UGWP diagnostic variables listed below are declared with "intent(out)" in unified_ugwp.F90 (subroutine "unified_ugwp_run") and are initialized in the same subroutine. These variables are then passed to subroutine "drag_suite_run". In subroutine "drag_suite_run" (in drag_suite.F90), these variables are declared with "intent(out)", and then calculations are performed on most of the grid points. If a grid point is skipped (mainly ocean points), then the initialized value holds. Because of this, I believe the variables should be declared with "intent(inout)" instead of "intent(out)" in "drag_suite_run".

List of effected diagnostic variables:
dusfc_ms(:),dvsfc_ms(:), dusfc_bl(:),dvsfc_bl(:), dusfc_ss(:),dvsfc_ss(:), dusfc_fd(:),dvsfc_fd(:)
dtaux2d_ms(:,:),dtauy2d_ms(:,:), dtaux2d_bl(:,:),dtauy2d_bl(:,:),dtaux2d_ss(:,:),dtauy2d_ss(:,:), dtaux2d_fd(:,:),dtauy2d_fd(:,:),

Steps to Reproduce

This "bug" does not appear to be causing any issues. I changed the declaration in drag_suite.F90 from intent "out" to "inout", and there was no change in the results. I'm not a computer scientist, but I believe the correct way is to declare the variables in drag_suite.F90 as "inout", since they come in to the subroutine already initialized.

Please let me know if this should indeed be changed and I can issue a PR with this minor change.

Additional Context

  • Machine: Hera
  • Compiler: Intel
  • Suite Definition File or Scheme: unified_ugwp

Output

N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment