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

Cleanup compiler warnings #3656

Merged
merged 3 commits into from
Jun 24, 2020
Merged

Cleanup compiler warnings #3656

merged 3 commits into from
Jun 24, 2020

Conversation

amametjanov
Copy link
Member

@amametjanov amametjanov commented Jun 19, 2020

Cleanup compiler warnings

Fixes #3624, #2250
Addresses #2247

[BFB]

@amametjanov amametjanov added the BFB PR leaves answers BFB label Jun 19, 2020
Comment on lines +593 to +595
#ifdef CPRCRAY
!DIR$ CONCURRENT
#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

Cray compiler directive that may be needed when porting and optimizing to Cray. CPRCRAY macro cleans up Intel compiler messages like

/qfs/people/mame117/repos/E3SM-tests/components/cam/src/physics/cam/check_energy.F90(593): remark #5140: Unrecognized directive
!DIR$ CONCURRENT
----------------^

Comment on lines -1020 to 1030
real(r8) heavy, heavym, a1, a2, heavyp, heavymp
heavy(a1,a2) = max(0._r8,sign(1._r8,a1-a2)) ! heavyside function
heavym(a1,a2) = max(0.01_r8,sign(1._r8,a1-a2)) ! modified heavyside function
real(r8) a1, a2, heavyp, heavymp
!real(r8) heavy, heavym
!heavy(a1,a2) = max(0._r8,sign(1._r8,a1-a2)) ! heavyside function
!heavym(a1,a2) = max(0.01_r8,sign(1._r8,a1-a2)) ! modified heavyside function
!
! New heavyside functions to perhaps address error growth problems
!
#ifdef PERGRO
heavyp(a1,a2) = a1/(a2+a1+1.e-36_r8)
#endif
heavymp(a1,a2) = (a1+0.01_r8*a2)/(a2+a1+1.e-36_r8)
Copy link
Member Author

Choose a reason for hiding this comment

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

Avoid

/qfs/people/mame117/repos/E3SM-tests/components/cam/src/physics/cam/cldwat.F90(1020): remark #7713: This statement function has not been used.   [HEAVY]
   real(r8) heavy, heavym, a1, a2, heavyp, heavymp
------------^
/qfs/people/mame117/repos/E3SM-tests/components/cam/src/physics/cam/cldwat.F90(1020): remark #7713: This statement function has not been used.   [HEAVYM]
   real(r8) heavy, heavym, a1, a2, heavyp, heavymp
-------------------^
/qfs/people/mame117/repos/E3SM-tests/components/cam/src/physics/cam/cldwat.F90(1020): remark #7713: This statement function has not been used.   [HEAVYP]
   real(r8) heavy, heavym, a1, a2, heavyp, heavymp
-----------------------------------^

Comment on lines +344 to +346
#else
sendsz = 0
recvsz = 0
Copy link
Member Author

Choose a reason for hiding this comment

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

/qfs/people/mame117/repos/E3SM-tests/components/homme/src/share/compose_mod.F90(334): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value.   [SENDSZ]
  subroutine compose_query_bufsz(sendsz, recvsz)
---------------------------------^
/qfs/people/mame117/repos/E3SM-tests/components/homme/src/share/compose_mod.F90(334): warning #6843: A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value.   [RECVSZ]
  subroutine compose_query_bufsz(sendsz, recvsz)
-----------------------------------------^

Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't looked at the code to know how these variables are being used. It is probably okay but @ambrad or @oksanaguba might know if it is okay to assign these to zero.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, these lines are fine. The subroutine isn't even called in this branch, but it's good to take care of compiler warnings. Thanks! (And thanks for tagging me @singhbalwinder.)

call endrun('nudging_init error: nudge method should &
be either Step, Linear or IMT...')
call endrun('nudging_init error: nudge method should be either Step, Linear or IMT...')
Copy link
Member Author

Choose a reason for hiding this comment

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

"/autofs/nccs-svm1_home1/azamat/repos/E3SM-tests/components/cam/src/physics/cam/nudging.F90", line 1181.1: 1515-021 (E) Syntax error: Token " & " is expected.

else where
elsewhere
Copy link
Member Author

Choose a reason for hiding this comment

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

"/autofs/nccs-svm1_home1/azamat/repos/E3SM-tests/components/cam/src/physics/clubb/advance_clubb_core_module.F90", line 1615.16: 1511-077 (E) ELSEWHERE statement is in error.  ELSEWHERE statement is assumed.
"/autofs/nccs-svm1_home1/azamat/repos/E3SM-tests/components/cam/src/physics/clubb/advance_clubb_core_module.F90", line 1637.16: 1511-077 (E) ELSEWHERE statement is in error.  ELSEWHERE statement is assumed.

character(len=32) :: subname = 'clmfates_interface::ReadParameters'
character(len=40) :: subname = 'clmfates_interface::ReadParameters'
Copy link
Member Author

Choose a reason for hiding this comment

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

"/autofs/nccs-svm1_home1/azamat/repos/E3SM-tests/components/clm/src/main/clmfates_paraminterfaceMod.F90", line 191.26: 1514-038 (W) The literal string has length 34 which is longer than 32, the length of the variable being initialized.  The string will be truncated.

Comment on lines -1181 to +1182
#endif ! #ifdef USE_PETSC_LIB
#endif
!^ifdef USE_PETSC_LIB
Copy link
Member Author

Choose a reason for hiding this comment

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

"/autofs/nccs-svm1_home1/azamat/repos/E3SM-tests/components/clm/src/main/initGridCellsMod.F90", line 1181.8: 1506-234 (W) Expecting a new-line character on #endif directive.

@amametjanov
Copy link
Member Author

A related PR in FATES submodule: NGEET/fates#666

Comment on lines -929 to +932
IF (IYYY.EQ.0) PAUSE 'There is no Year Zero.'
IF (IYYY.EQ.0) THEN
call endrun('There is no Year Zero.')
ENDIF
Copy link
Member Author

Choose a reason for hiding this comment

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

/lcrc/group/acme/azamat/repos/E3SM-tests/components/cam/src/chemistry/mozart/wei96.F90:929:51:

       IF (IYYY.EQ.0) PAUSE 'There is no Year Zero.'
                                                   1
Warning: Deleted feature: PAUSE statement at (1)

Comment on lines -2928 to 2930
integer (int_kind), dimension(:), allocatable, save :: &
integer (int_kind), dimension(:), allocatable :: &
sndRequest, &! MPI request ids
rcvRequest ! MPI request ids
Copy link
Member Author

Choose a reason for hiding this comment

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

/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/mpi/ice_boundary.F90:2958:22:

       bufSend, bufRecv            ! 3d send,recv buffers
                      1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)
/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/mpi/ice_boundary.F90:2958:13:

       bufSend, bufRecv            ! 3d send,recv buffers
             1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)
/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/mpi/ice_boundary.F90:2961:16:

       bufTripole                  ! 3d tripole buffer
                1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)
/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/mpi/ice_boundary.F90:2930:16:

       rcvRequest        ! MPI request ids
                1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)
/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/mpi/ice_boundary.F90:2929:16:

       sndRequest,      &! MPI request ids
                1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)

Comment on lines -3251 to +3256
! 3 hbl------depth---------------------------------(m) \\
! 3 hbl------depth---------------------------------(m) \\
! 4 u--------surface u current---------------------(m/s) \\
! 5 v--------surface v current---------------------(m/s) \\
! 6 dhdx-----surface tilt x direction--------------(m/m) \\
! 7 dhdy-----surface tilt y direction--------------(m/m) \\
! 8 qdp------ocean sub-mixed layer heat flux-------(W/m2)\\
! 8 qdp------ocean sub-mixed layer heat flux-------(W/m2)\\
Copy link
Member Author

Choose a reason for hiding this comment

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

/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/source/ice_forcing.F90:3251:60:

 ! 3  hbl------depth---------------------------------(m)   \\

Warning: backslash and newline separated by space
/lcrc/group/acme/azamat/repos/E3SM-tests/components/cice/src/source/ice_forcing.F90:3256:60:

 ! 8  qdp------ocean sub-mixed layer heat flux-------(W/m2)\\

Warning: backslash and newline separated by space

Comment on lines -108 to -109
logical,save :: first_time = .true.

Copy link
Member Author

Choose a reason for hiding this comment

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

/lcrc/group/acme/azamat/repos/E3SM-tests/components/clm/src/biogeophys/WaterBudgetMod.F90:108:28:

   logical,save :: first_time = .true.
                            1
Warning: Legacy Extension: Duplicate SAVE attribute specified at (1)

This var isn't used anywhere.

Copy link
Contributor

@singhbalwinder singhbalwinder left a comment

Choose a reason for hiding this comment

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

Thanks @amametjanov for working on this. This will take care of a lot of warnings.

Comment on lines +344 to +346
#else
sendsz = 0
recvsz = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't looked at the code to know how these variables are being used. It is probably okay but @ambrad or @oksanaguba might know if it is okay to assign these to zero.

@singhbalwinder
Copy link
Contributor

Do we know if the CRAY specific directives are still useful? If not, we can simply remove them.

@amametjanov
Copy link
Member Author

Someone identified these loops for optimization and these will be good starting points when optimizing for newer Cray compiler versions.

@AaronDonahue
Copy link
Contributor

It looks like this PR is ready to go, I'm going to start the integration process.

AaronDonahue added a commit that referenced this pull request Jun 23, 2020
Cleanup compiler warnings

Fixes #3624, #2250
Addresses #2247

[BFB]
@AaronDonahue AaronDonahue merged commit 86f18ad into master Jun 24, 2020
@amametjanov amametjanov deleted the azamat/comps/rm-warnings branch June 24, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

building warnings of ice_shortwave.F90
6 participants