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

Fixing some doxygen documentation - first pass #918

Draft
wants to merge 33 commits into
base: develop
Choose a base branch
from

Conversation

edwardhartnett
Copy link
Collaborator

Description

Fixing some doxygen documentation

Issue(s) addressed

Link the issues to be closed with this PR, whether in this repository, or in another repository.
(Remember, issues should always be created before starting work on a PR branch!)

Testing

How were these changes tested?
What compilers / HPCs was it tested with?
Are the changes covered by regression tests? (If not, why? Do new tests need to be added?)
Have the ufs-weather-model regression test been run? On what platform?

  • Will the code updates change regression test baseline? If yes, why? Please show the baseline directory below.
  • Please commit the regression test log files in your ufs-weather-model branch

Dependencies

If testing this branch requires non-default branches in other repositories, list them.
Those branches should have matching names (ideally)

@edwardhartnett edwardhartnett changed the title Fixing some doxygen documentation Fixing some doxygen documentation - first pass Feb 4, 2025
@@ -1,3 +1,6 @@
!> @file
!> @brief ???
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rmontuoro can you please fill in what all the "???" documentation should be in this file? According to github, you originally added this file.


!> ???
!>
!> @param[in] gcomp ???
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@junwang-noaa can you please tell us what the ??? should be in this documentation?

integer, public :: nvar_before_lake = 0

! The lsoil flag is only meaningful when reading:;
integer, public :: nvar2o = 0 !< ???
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@SamuelTrahanNOAA can you please tell us what the ??? in this documentation should be?

@@ -64,7 +70,12 @@ subroutine fill_bbox_r4_2d(out_bbox, in_grid)
out_bbox%je = ubound(in_grid, 2)
end subroutine fill_bbox_r4_2d


!> ???
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@wramstrom can you please tell us what should replace the ??? in this documentation?

real(kind=kind_phys), dimension(:,:,:), allocatable, save :: smc
real(kind=kind_phys), dimension(:,:,:), allocatable, save :: stc
real(kind=kind_phys), dimension(:,:,:), allocatable, save :: slc
real(kind=kind_phys), dimension(:,:), allocatable, save :: xlat !< ???
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@climbfuji can you tell us what should replace the ??? in this documentation?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would check GFS_typedefs.F90/GFS_typedefs.meta for the variable with the same name

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is your code right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wrote some of this many years ago, then @pjpegion and @lisa-bengtsson updated some of it, and recently I had to modify those fields when moving from blocked data structures to contiguous arrays. The code further down in the file unambiguously relates these local variables with variables in GFS_typedefs.F90, for example:

call transfer_field_to_stochastics(GFS_Control%blksz, GFS_Grid%xlat, xlat)

In GFS_typedefs.F90,

type GFS_grid_type
real (kind=kind_phys), pointer :: xlon (:) !< grid longitude in radians, ok for both 0->2pi
!! or -pi -> +pi ranges
real (kind=kind_phys), pointer :: xlat (:) !< grid latitude in radians, default to pi/2 ->
!! -pi/2 range, otherwise adj in subr called
real (kind=kind_phys), pointer :: xlat_d (:) !< grid latitude in degrees, default to 90 ->
:

Thus, xlat here should be the same, I suppose.

!< grid latitude in radians, default to pi/2 ->
!! -pi/2 range, otherwise adj in subr called

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think all module variables in this file can be (and probably should be) declared as private. Doxygen should not complain about undocumented private (and local) variables.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Private and public module vars need to be documented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm sure we all agree that this is important code and should be documented. In addition, NCO has documentation requirements which are not being met by this code.

@climbfuji since you are the original author, could you do a PR against the ejh_doxygen branch with the missing documentation from the module variables and all of the subroutines?

Presumably the meaning of this code is obvious to you, but that needs to be documented. We are intending to write unit tests for the code in fv3atm, and that will be mostly impossible without documentation of the code. Since you have an understanding of what this code is, that shouldn't take more than a few minutes of your time...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you provide a link to NCO's documentation requirements document where the requirement that all private and local variables are documented using doxygen is specified?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm sure we all agree that this is important code and should be documented. In addition, NCO has documentation requirements which are not being met by this code.

@climbfuji since you are the original author, could you do a PR against the ejh_doxygen branch with the missing documentation from the module variables and all of the subroutines?

Presumably the meaning of this code is obvious to you, but that needs to be documented. We are intending to write unit tests for the code in fv3atm, and that will be mostly impossible without documentation of the code. Since you have an understanding of what this code is, that shouldn't take more than a few minutes of your time...

I won't have time for this for several weeks if not months, sorry. It's all in GFS_typedefs and can be taken from there if someone wants to do this in the meantime.

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.

4 participants