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

Code standardization and dOxyGenization of framework code #764

Merged
merged 32 commits into from
May 9, 2018

Conversation

Hallberg-NOAA
Copy link
Collaborator

Extensive dOxyGenization and cleanup of MOM6 code, including the following commits:

  Replaced 'end do' with 'enddo' and 'else if' with 'elseif', to follow typical
practice in MOM6.  Also adding spacing around the semicolons separating stacked
enddo statements in several places.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in MOM_coms.F90.  All
answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
MOM_spatial_means.F90.  All answers are bitwise identical.
  Fixed some of the new dOxygen comments in MOM_debugging.F90 to document only
one variable per comment and avoid excessively long lines.  All answers are
bitwise identical.
  Split several recently introduced excessively long lines in
MOM_open_boundary.F90.  All answers are bitwise identical.
  Split several recently introduced excessively long lines in
MOM_file_parser.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_diag_mediator.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_diag_remap.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_domains.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_intrinsic_functions.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_io.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_restart.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
MOM_string_functions.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
MOM_write_cputime.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_diagnostics.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_obsolete_diagnostics.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_wave_structure.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all remaining routines and arguments in
MOM_grid_initialization.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
MOM_sum_output.F90.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in the solo_driver
version of MOM_surface_forcing.F90.  Also replaced calls to alloc_if_needed with
calls to the functionally equivalent safe_alloc_ptr.  All answers are bitwise
identical.
  Added dOxyGen comments for all routines and arguments in
user_surface_forcing.F90.  Also replaced calls to alloc_if_needed with calls to
the functionally equivalent safe_alloc_ptr.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
MESO_surface_forcing.F90.  Also replaced calls to alloc_if_needed with calls to
the functionally equivalent safe_alloc_ptr.  All answers are bitwise identical.
  Added dOxyGen comments for all routines and arguments in
Neverland_surface_forcing.F90.  Also replaced calls to alloc_if_needed with
calls to the functionally equivalent safe_alloc_ptr.  All answers are bitwise
identical.
  Split lines exceeding 120 characters in the code in ice_solo_driver and
mct_driver to promote readability and compliance with MOM6 code standards.  All
answers are bitwise identical.
  Combined the maxvel and minvel arguments to write_[uv]_accel into vel_rpt.
Also turned the a and hv arguments from 2-d sliced to full 3-d arrays to avoid
doing an extra copy during the calls to write_[uv]_accel.  The calls inside of
vertvisc_limit_vel have been changed accordingly.  Also added dOxyGen comments
for all remaining arguments in MOM_PointAccel.F90.   All answers are bitwise
identical, but two public interfaces change.
@adcroft
Copy link
Collaborator

adcroft commented May 8, 2018

  A recent update intended to add a min of n and 3 to avoid segmentation faults,
but a max was added instead, triggering segmentation faults.  All answers are
still bitwise identical in the test cases, but this now passes a more sensitive
compiler's checks.
  Added dOxyGen comments for all subroutine arguments in
MOM_tracer_flow_control.F90.  All answers are bitwise identical.
  Added dOxyGen comments for many arguments in the tracer utility codes,
including MOM_neutral_diffusion.F90, MOM_neutral_diffusion_aux.F90,
MOM_tracer_advect.F90, MOM_tracer_hor_diff.F90, and MOM_tracer_diabatic.F90. All
answers are bitwise identical.
  Added dOxyGen comments for many arguments in the tracer packages in
src/tracer.  All answers are bitwise identical.
if (present(n_in)) n = n_in

i2s = ''
do i=1,max(n,3)
Copy link
Collaborator

Choose a reason for hiding this comment

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

do i=1,min(n,3) ?

@Hallberg-NOAA
Copy link
Collaborator Author

5 additional commits have corrected a bug (thanks @angus-g), merged in a recent commit to dev/gfdl, and added updates dOxyGenizing much of the MOM6 tracer code.

@adcroft
Copy link
Collaborator

adcroft commented May 9, 2018

@adcroft adcroft merged commit 12d2eff into mom-ocean:dev/gfdl May 9, 2018
Hallberg-NOAA pushed a commit to Hallberg-NOAA/MOM6 that referenced this pull request Dec 11, 2024
* Tidal angular frequency has units [rad s-1]

Tidal frequencies are always angular frequencies to simplify applying
sine and cosine.  These have MKS units [rad s-1] but they are all
currently listed as [s-1].

Updated dOxygen comments for variables, e.g. [T-1 ~> s-1] becomes
[rad T-1 ~> rad s-1].  Updated get_param units. e.g. units="s-1"
becomes units="rad s-1".

No answers are changed, but the logged parameter units are different.

There are frequencies in MOM_internal_tides.F90 but these have not
been updated because they may be specified incorrectly.  They are
used as if they are [T-1] but they are calculated as 2PI/period [rad T-1].

  real, allocatable, dimension(:) :: frequency  !< The frequency of each band [T-1 ~> s-1].

  real    :: period             ! A tidal period read from namelist [T ~> s]

  ! The periods of the tidal constituents for internal tides raytracing
  call read_param(param_file, "TIDAL_PERIODS", periods)

  do fr=1,num_freq
    period = US%s_to_T*extract_real(periods, " ,", fr, 0.)
    CS%frequency(fr) = 8.0*atan(1.0)/period
  enddo

All MOM6-examples cases have INTERNAL_TIDES=False and so can't
resolve this issue.

* fixed too-long line
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.

3 participants