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

Clean up all gfortran warnings #302

Merged

Conversation

mnlevy1981
Copy link
Collaborator

Also elevate warnings -> errors to prevent future warnings from creeping in. Tested with gfortran 4.8.4 and 8.1.0

GNU no longer warns about code in
* marbl_interface_private_types.F90
* marbl_settings_mod.F90
* marbl_utils_mod.F90
GNU no longer warns about code in
* marbl_ciso_mod.F90
* marbl_diagnostics_mod.F90
GNU no longer warns about code in
* marbl_co2calc_mod.F90
* marbl_init_mod.F90
* marbl_restore_mod.F90
Makefile can now turn on -Werror
Fixed one more warning in marbl_utils_mod
Also update the Makefile to elevate warnings to errors.
@mnlevy1981
Copy link
Collaborator Author

mnlevy1981 commented Jul 21, 2018

Tested with more versions of gfortran. Full list:

  • 4.8.4
  • 4.9.2
  • 6.2.0
  • 6.3.0
  • 6.4.0
  • 7.1.0
  • 7.2.0
  • 7.3.0
  • 8.1.0

There are still some warnings (labeled "Extension") about lines
exceeding 132 characters that I will clean in the next commit. There are
also some warnings (labeled "Questionable") about variables being set
but never referenced.
marbl_mod.F90 is using autotrophs, autotroph_cnt, zooplankton, zooplankton_cnt,
and max_grazer_prey_cnt at the module level, so those variables don't need to
be passed through the interface of private subroutines.
@mnlevy1981
Copy link
Collaborator Author

mnlevy1981 commented Jul 25, 2018

Addresses #276: commits 13c2ea3 to 4fdc89f allow us to build with gfortran -Wall -Werror; 9d3635b addresses the original comment about removing NAG warnings; c02db73 cleans up instances in marbl_mod where we were passing module variables to private subroutines (does not cause warnings in either compiler but I wanted to clean it anyway).

Testing: aux_pop_MARBL on hobart and cheyenne, all tests pass (BASELINE and NLCOMP compared to cesm_pop_2_1_20180716 tag)

Also renamed some arguments to match what MPI calls them (e.g. receiver -> dest
in marbl_mpi_send) and fixed a bug where dest was hard-coded to 0 in MPI_Send
call.
Hopefully mpif90 works out-of-the-box with Travis CI, but I may need to update
.travis.yml as well.
1. Add comments to variables that are initialized solely to avoid gfortran
warnings
2. use c0 instead of 0 when initializing linear_root
3. initialize scale_len to c1 instead of c0
4. Align '!' instead of '&' in a block of code in marbl_ciso_mod.F90 (i.e. undo
   a "clean-up" from one of my previous commits)
@mnlevy1981 mnlevy1981 merged commit e07b02e into marbl-ecosys:development Jul 26, 2018
@mnlevy1981 mnlevy1981 deleted the enhancement/no_gnu_warnings branch July 26, 2018 21:08
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.

1 participant