Skip to content

Commit

Permalink
fix(fortran): turn on gfortran 2008 standard check
Browse files Browse the repository at this point in the history
  • Loading branch information
langevin-usgs committed Nov 6, 2019
1 parent ba0e394 commit a92bf82
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 41 deletions.
4 changes: 2 additions & 2 deletions autotest/test000_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_build_modflow6():
# some flags to check for errors in the code
# add -Werror for compilation to terminate if errors are found
fflags = ('-Wtabs -Wline-truncation -Wunused-label '
'-Wunused-variable')
'-Wunused-variable -pedantic -std=f2008')
#fflags = None

pymake.main(srcdir, target, fc=fc, cc=cc, include_subdirs=True,
Expand Down Expand Up @@ -231,7 +231,7 @@ def test_build_zonebudget():
# some flags to check for errors in the code
# add -Werror for compilation to terminate if errors are found
fflags = ('-Wtabs -Wline-truncation -Wunused-label '
'-Wunused-variable')
'-Wunused-variable -pedantic -std=f2008')
#fflags = None

pymake.main(srcdir, target, fc=fc, cc=cc, extrafiles=extrafiles,
Expand Down
2 changes: 1 addition & 1 deletion src/Exchange/GhostNode.f90
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ subroutine gnc_mc(this, iasln, jasln)
! -- formats
character(len=*),parameter :: fmterr = &
"('GHOST NODE ERROR. Cell ', i0, ' in model ', a, &
' is not connected to cell ', i0, ' in model ', a)"
&' is not connected to cell ', i0, ' in model ', a)"
! ------------------------------------------------------------------------------
!
! -- Find the location of Cnm in the global solution and store it in
Expand Down
6 changes: 3 additions & 3 deletions src/Model/GroundWaterFlow/gwf3hfb8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ subroutine hfb_ar(this, ibound, xt3d, dis)
class(DisBaseType), pointer, intent(inout) :: dis
! -- formats
character(len=*), parameter :: fmtheader = &
"(1x, /1x, 'HFB -- HORIZONTAL FLOW BARRIER PACKAGE, VERSION 8, ', &
'4/24/2015 INPUT READ FROM UNIT ', i4, //)"
&"(1x, /1x, 'HFB -- HORIZONTAL FLOW BARRIER PACKAGE, VERSION 8, ', &
&'4/24/2015 INPUT READ FROM UNIT ', i4, //)"
! ------------------------------------------------------------------------------
!
! -- Print a message identifying the node property flow package.
Expand Down Expand Up @@ -755,7 +755,7 @@ subroutine check_data(this)
logical :: found
! -- formats
character(len=*), parameter :: fmterr = "(1x, 'Error. HFB no. ',i0, &
' is between two unconnected cells: ', a, ' and ', a)"
&' is between two unconnected cells: ', a, ' and ', a)"
! ------------------------------------------------------------------------------
!
do ihfb = 1, this%nhfb
Expand Down
4 changes: 2 additions & 2 deletions src/Model/GroundWaterFlow/gwf3maw8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ subroutine maw_read_wells(this)
integer(I4B), dimension(:), pointer, contiguous :: nboundchk
! -- format
character(len=*),parameter :: fmthdbot = &
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0',).')"
"('well head (', G0, ') must be >= BOTTOM_ELEVATION (', G0, ').')"
! ------------------------------------------------------------------------------
!
! -- code
Expand Down Expand Up @@ -1113,7 +1113,7 @@ subroutine maw_set_stressperiod(this, imaw, line)
character(len=MAXCHARLEN) :: ermsg, ermsgr
! -- formats
character(len=*),parameter :: fmthdbot = &
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0',).')"
"('well head (',G0,') must be >= BOTTOM_ELEVATION (',G0, ').')"
! ------------------------------------------------------------------------------
!
! -- Find time interval of current stress period.
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3uzf8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ subroutine uzf_options(this, option, found)
"(4x, 'NO UZF OPTIONS WERE FOUND.')"
character(len=*),parameter :: fmtet = &
"(4x, 'ET WILL BE SIMULATED WITHIN UZ AND GW ZONES, WITH LINEAR ', &
'GWET IF OPTION NOT SPECIFIED OTHERWISE.')"
&'GWET IF OPTION NOT SPECIFIED OTHERWISE.')"
character(len=*),parameter :: fmtgwetlin = &
"(4x, 'GROUNDWATER ET FUNCTION WILL BE LINEAR.')"
character(len=*),parameter :: fmtgwetsquare = &
Expand Down
34 changes: 17 additions & 17 deletions src/Model/ModelUtilities/Connections.f90
Original file line number Diff line number Diff line change
Expand Up @@ -325,22 +325,22 @@ subroutine con_finalize(this, iout, ihctemp, cl12temp, hwvatemp, angldegx)
character(len=24),dimension(nname) :: aname(nname)
! -- formats
character(len=*),parameter :: fmtsymerr = &
"('Error in array: ',a,'.', &
' Array is not symmetric in positions: ',i0,' and ',i0,'.', &
' Values in these positions are: ',1pg15.6,' and ', 1pg15.6, &
' For node ',i0,' connected to node ',i0)"
&"('Error in array: ',a,'.', &
&' Array is not symmetric in positions: ',i0,' and ',i0,'.', &
&' Values in these positions are: ',1pg15.6,' and ', 1pg15.6, &
&' For node ',i0,' connected to node ',i0)"
character(len=*),parameter :: fmtsymerrja = &
"('Error in array: ',a,'.', &
' Array does not have symmetric counterpart in position ',i0, &
' for cell ',i0,' connected to cell ',i0)"
&"('Error in array: ',a,'.', &
&' Array does not have symmetric counterpart in position ',i0, &
&' for cell ',i0,' connected to cell ',i0)"
character(len=*),parameter :: fmtjanmerr = &
"('Error in array: ',a,'.', &
' First value for cell : ',i0,' must equal ',i0,'.', &
' Found ',i0,' instead.')"
&"('Error in array: ',a,'.', &
&' First value for cell : ',i0,' must equal ',i0,'.', &
&' Found ',i0,' instead.')"
character(len=*),parameter :: fmtjasorterr = &
"('Error in array: ',a,'.', &
' Entries not sorted for row: ',i0,'.', &
' Offending entries are: ',i0,' and ',i0)"
&"('Error in array: ',a,'.', &
&' Entries not sorted for row: ',i0,'.', &
&' Offending entries are: ',i0,' and ',i0)"
character(len=*),parameter :: fmtihcerr = &
"('IHC must be 0, 1, or 2. Found: ',i0)"
! -- data
Expand Down Expand Up @@ -514,11 +514,11 @@ subroutine read_connectivity_from_block(this, name_model, nodes, nja, iout)
character(len=300) :: ermsg
! -- formats
character(len=*),parameter :: fmtsymerr = &
"(/,'Error in array: ',(a),/, &
'Array is not symmetric in positions: ',2i9,/, &
'Values in these positions are: ', 2(1pg15.6))"
&"(/,'Error in array: ',(a),/, &
&'Array is not symmetric in positions: ',2i9,/, &
&'Values in these positions are: ', 2(1pg15.6))"
character(len=*),parameter :: fmtihcerr = &
"(/,'IHC must be 0, 1, or 2. Found: ',i0)"
&"(/,'IHC must be 0, 1, or 2. Found: ',i0)"
! -- data
data aname(1) /' IAC'/
data aname(2) /' JA'/
Expand Down
4 changes: 2 additions & 2 deletions src/Model/NumericalModel.f90
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ end subroutine model_cf
subroutine model_fc(this, kiter, amatsln, njasln, inwtflag)
class(NumericalModelType) :: this
integer(I4B),intent(in) :: kiter
real(DP),dimension(njasln),intent(inout) :: amatsln
integer(I4B),intent(in) :: njasln
real(DP),dimension(njasln),intent(inout) :: amatsln
integer(I4B), intent(in) :: inwtflag
end subroutine model_fc

Expand Down Expand Up @@ -145,8 +145,8 @@ end subroutine model_ptc
subroutine model_nr(this, kiter, amatsln, njasln, inwtflag)
class(NumericalModelType) :: this
integer(I4B),intent(in) :: kiter
real(DP),dimension(njasln),intent(inout) :: amatsln
integer(I4B),intent(in) :: njasln
real(DP),dimension(njasln),intent(inout) :: amatsln
integer(I4B), intent(in) :: inwtflag
end subroutine model_nr

Expand Down
4 changes: 2 additions & 2 deletions src/Solution/NumericalSolution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ subroutine sln_ca(this, kstp, kper, kpicard, isgcnvg, isuppress_output)
! -- formats
character(len=*), parameter :: fmtnocnvg = &
"(1X,'Solution ', i0, ' did not converge for stress period ', i0, &
' and time step ', i0)"
&' and time step ', i0)"
11 FORMAT(//1X,'OUTER ITERATION SUMMARY',/,1x,139('-'),/, &
18x,' OUTER INNER BACKTRACK BACKTRACK INCOMING ',&
'OUTGOING MAXIMUM MAXIMUM CHANGE',/, &
Expand Down Expand Up @@ -1914,7 +1914,7 @@ subroutine sln_ls(this, kiter, kstp, kper, in_iter, itersum, iptc, ptcf)
real(DP) :: bnorm
character(len=50) :: fname
character(len=*), parameter :: fmtfname = "('mf6mat_', i0, '_', i0, &
'_', i0, '_', i0, '.txt')"
&'_', i0, '_', i0, '.txt')"
! ------------------------------------------------------------------------------
!
! -- take care of loose ends for all nodes before call to solver
Expand Down
14 changes: 8 additions & 6 deletions src/Utilities/TimeSeries/TimeArraySeriesManager.f90
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ subroutine tasmgr_ad(this)
real(DP) :: begintime, endtime
character(len=MAXCHARLEN) :: ermsg
! formats
5 format(/,'Time-array-series controlled arrays' &
' in stress period ',i0,', time step ',i0,':')
10 format('"',a'" package: ',a,' array obtained from time-array series "',a,'"')
character(len=*),parameter :: fmt5 = &
"(/,'Time-array-series controlled arrays in stress period ', &
&i0, ', time step ', i0, ':')"
10 format('"',a, '" package: ',a,' array obtained from time-array series "',a,'"')
! ------------------------------------------------------------------------------
!
! -- Initialize time variables
Expand All @@ -137,7 +138,7 @@ subroutine tasmgr_ad(this)
do i = 1, nlinks
tasLink => GetTimeArraySeriesLinkFromList(this%boundTasLinks, i)
if (tasLink%Iprpak == 1 .and. i==1) then
write(this%iout,5)kper, kstp
write(this%iout, fmt5) kper, kstp
endif
if (tasLink%UseDefaultProc) then
timearrayseries => tasLink%timeArraySeries
Expand All @@ -155,8 +156,9 @@ subroutine tasmgr_ad(this)
! -- If PRINT_INPUT is specified, write information
! regarding source of time-array series data
if (tasLink%Iprpak == 1) then
write(this%iout,10)trim(tasLink%PackageName), trim(tasLink%Text), &
trim(tasLink%timeArraySeries%Name)
write(this%iout,10) trim(tasLink%PackageName), &
trim(tasLink%Text), &
trim(tasLink%timeArraySeries%Name)
endif
endif
if (i == nlinks) then
Expand Down
11 changes: 6 additions & 5 deletions src/Utilities/TimeSeries/TimeSeriesManager.f90
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ subroutine tsmgr_ad(this)
real(DP) :: begintime, endtime
character(len=LENPACKAGENAME+2) :: pkgID
! formats
5 format(/,'Time-series controlled values' &
' in stress period ',i0,', time step ',i0,':')
10 format(a,' package: Boundary ',i0,', entry ',i0,' value from time series "',a,'" = ',g12.5)
character(len=*),parameter :: fmt5 = &
&"(/,'Time-series controlled values in stress period: ', i0, &
&', time step ', i0, ':')"
10 format(a,' package: Boundary ',i0,', entry ',i0, ' value from time series "',a,'" = ',g12.5)
15 format(a,' package: Boundary ',i0,', entry ',i0,' value from time series "',a,'" = ',g12.5,' (',a,')')
20 format(a,' package: Boundary ',i0,', ',a,' value from time series "',a,'" = ',g12.5)
25 format(a,' package: Boundary ',i0,', ',a,' value from time series "',a,'" = ',g12.5,' (',a,')')
Expand All @@ -175,7 +176,7 @@ subroutine tsmgr_ad(this)
tsLink => GetTimeSeriesLinkFromList(this%boundTsLinks, i)
if (i == 1) then
if (tsLink%Iprpak == 1) then
write(this%iout,5)kper,kstp
write(this%iout, fmt5) kper, kstp
endif
endif
! this part needs to be different for MAW because MAW does not use
Expand Down Expand Up @@ -233,7 +234,7 @@ subroutine tsmgr_ad(this)
timeseries => tsLink%timeSeries
if (i==1 .and. nlinks==0) then
if (tsLink%Iprpak == 1) then
write(this%iout,5)kper,kstp
write(this%iout, fmt5) kper, kstp
endif
endif
tsLink%BndElement = timeseries%GetValue(begintime, endtime)
Expand Down

0 comments on commit a92bf82

Please sign in to comment.