Skip to content

Commit

Permalink
feat(compile): added gfortran compile flags to bomb if source code is…
Browse files Browse the repository at this point in the history
…n't clean (#105)

* refactor(pre-commit.py): use OrderdedDict to load and write code.json

Updated the code.json writer to use an ordered dictionary so that the order is always the same.  This will minimize the number of changes that appear in the changelog due to ordering changes that do not change content.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

The sign for the face normal needed to be flipped for model 2 so that specific discharge would be calculated correctly.  Added a test to make sure that the velocities are correct.  Addresses #51.

* fix(GwfGwfExchangeModule): specific discharge not updated correctly for LGR

Updated the release notes and added some docstrings to the autotest.

* docs(mf6ivar): readme.md needed a description of the valid keyword

* Corrected misspelling of execution in the release notes.

* feat(compile): added gfortran compile flags to bomb if source code isn't clean

* Updated MODFLOW-USG download link

* removed the character-truncation flag.  Not clear how to get this to work for the fpp file.

* Reverting the size of words in namefile

* Had to turn off extra code error checking; was getting an error on linux that couldn't be resolved.

* small latex change
  • Loading branch information
langevin-usgs committed Mar 7, 2019
2 parents c4be95a + fdcc3a9 commit 3348653
Show file tree
Hide file tree
Showing 20 changed files with 45 additions and 35 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Automated Testing Status on Travis-CI

### Version 6.0.3 develop — build 86
### Version 6.0.3 develop — build 93
[![Build Status](https://travis-ci.org/MODFLOW-USGS/modflow6.svg?branch=develop)](https://travis-ci.org/MODFLOW-USGS/modflow6)

## Introduction
Expand Down
22 changes: 16 additions & 6 deletions autotest/test000_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
mf2005url = "https://water.usgs.gov/ogw/modflow/MODFLOW-2005_v1.12.00/{}.zip".format(mf2005dir)
mfnwtdir = 'MODFLOW-NWT_1.1.3'
mfnwturl = "https://water.usgs.gov/ogw/modflow-nwt/{0}.zip".format(mfnwtdir)
mfusgdir = 'mfusg.1_4'
mfusgurl = 'https://water.usgs.gov/ogw/mfusg/{0}.zip'.format(mfusgdir)
mfusgdir = 'mfusg1_5'
mfusgurl = 'https://water.usgs.gov/water-resources/software/MODFLOW-USG/{0}.zip'.format(mfusgdir)
mflgrdir = 'mflgr.2_0'
mflgrurl = 'https://water.usgs.gov/ogw/modflow-lgr/modflow-lgr-v2.0.0/mflgrv2_0_00.zip'

Expand Down Expand Up @@ -302,7 +302,15 @@ def test_build_modflow6():
target += eext
srcdir2 = None

build(srcdir, srcdir2, target, 'MODFLOW 6')
fflags = None
fct, cct = set_compiler()
if fct == 'gfortran':
# some flags to check for errors in the code
# but they are not working yet, so had to deactivate
fflags = 'Werror Wtabs Wline-truncation'
fflags = None

build(srcdir, srcdir2, target, 'MODFLOW 6', fflags=fflags)

msg = '{} does not exist.'.format(os.path.relpath(target))
assert os.path.isfile(target), msg
Expand Down Expand Up @@ -366,12 +374,11 @@ def rebuild_exe(target, starget):
return rebuild


def build(srcdir, srcdir2, target, starget, extrafiles=None):
def build(srcdir, srcdir2, target, starget, extrafiles=None, fflags=None):
"""
Build a specified target
"""
debug = False
fflags = None

fct, cct = set_compiler()

Expand All @@ -385,8 +392,11 @@ def build(srcdir, srcdir2, target, starget, extrafiles=None):
'{} will be built with debug flags.'.format(starget)
elif arg.lower() == '--fflags':
if len(sys.argv) > idx + 1:
if fflags is None:
fflags = ''
else:
fflags += ' '
t = sys.argv[idx + 1:]
fflags = ''
for tt in t:
fflags += tt + ' '
break
Expand Down
2 changes: 1 addition & 1 deletion code.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"email": "[email protected]"
},
"laborHours": -1,
"version": "6.0.3.86",
"version": "6.0.3.93",
"date": {
"metadataLastUpdated": "2019-03-07"
},
Expand Down
8 changes: 4 additions & 4 deletions doc/ReleaseNotes/ReleaseNotes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@ \section{History}
\item Added a new error check for very small time steps. If the value of the starting time is equal to the ending time (starting time plus the time step length), then the time step is too small to be differentiated by the program based on the precision of floating point numbers. The program will terminate with an error in this case. The program will also terminate if the storage package with a transient stress period has a time step length of zero.
\item The observation package was modified to use non-advancing output instead of fixed length strings when writing ascii output. The previous use of fixed length strings resulted in truncation of ascii observation output when the product of user-specified \texttt{digits} + 7 and the number of observations exceeded 5000.
\item Corrected an error in the GWF-GWF Exchange module that caused the specific discharge values in the child model to be calculated incorrectly. The calculation was incorrect because the face normal for the child model was pointing toward the center of the cell instead of outward.
\item - Minor refactoring to improve code clarity.
\item Minor refactoring to improve code clarity.
\end{itemize}

\underline{STRESS PACKAGES}
\begin{itemize}
\item - Minor refactoring to improve code clarity.
\item Minor refactoring to improve code clarity.
\end{itemize}

\underline{ADVANCED STRESS PACKAGES}
Expand All @@ -139,7 +139,7 @@ \section{History}
\item Added stage and residual convergence checks to the SFR package to make sure that stage and upstream flow changes between successive outer iterations are less than OUTER\_HCLOSE and OUTER\_RCLOSEBND, respectively. This addition is expected to be useful for steady-state simulations with complicated networks and simple reaches.
\item Modified the final convergence check for the LAK package to use OUTER\_HCLOSE when evaluating lake stage changes between successive outer iterations.
\item Modified the final convergence check for the UZF package to use OUTER\_RCLOSEBND when evaluating rejected infiltration, groundwater recharge, and groundwater seepage changes between successive outer iterations.
\item - Minor refactoring to improve code clarity.
\item Minor refactoring to improve code clarity.
\end{itemize}

\underline{SOLUTION}
Expand All @@ -148,7 +148,7 @@ \section{History}
\item Added NO\_PTC option to disable PTC for problems where PTC degrades/prevents model convergence. Option only applies to steady-state stress periods for models using the Newton-Raphson formulation. For many problems, PTC can significantly improve convergence behavior for steady-state simulations, and for this reason it is active by default. In some cases, however, PTC can worsen the convergence behavior, especially when the initial conditions are similar to the solution. When the initial conditions are similar to, or exactly the same as, the solution and convergence is slow, then this NO\_PTC option should be used to deactivate PTC. This NO\_PTC option should also be used in order to compare convergence behavior with other MODFLOW versions, as PTC is only available in MODFLOW 6.
\item Small improvements to PTC to reduce the initial PTCDEL value loaded on the diagonal. This reduces the number of iterations required to achieve convergence for steady-state stress periods for most problems.
\item Added OUTER\_RCLOSEBND variable that is used when performing final convergence checks on model packages that solve a separate equation not solved by the IMS linear solver. This value represents the maximum allowable residual at any single model package element between successive outer iterations. An example of a model package that would use OUTER\_RCLOSEBND to evaluate convergence is the SFR package which solves a continuity equation for each reach.
\item - Minor refactoring to improve code clarity.
\item Minor refactoring to improve code clarity.
\end{itemize}

\item Version mf6.0.3--Aug. 9, 2018
Expand Down
2 changes: 1 addition & 1 deletion doc/version.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\newcommand{\modflowversion}{mf6.0.3.86}
\newcommand{\modflowversion}{mf6.0.3.93}
\newcommand{\modflowdate}{March 07, 2019}
\newcommand{\currentmodflowversion}{Version \modflowversion---\modflowdate}
6 changes: 3 additions & 3 deletions src/Exchange/GwfGwfExchange.f90
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ subroutine gwf_gwf_bd(this, icnvg, isuppress_output, isolnid)
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
! -- modules
use ConstantsModule, only: DZERO, LENBUDTXT, LENMODELNAME
use ConstantsModule, only: DZERO, LENBUDTXT, LENPACKAGENAME
use TdisModule, only: kstp, kper
! -- dummy
class(GwfExchangeType) :: this
Expand All @@ -838,8 +838,8 @@ subroutine gwf_gwf_bd(this, icnvg, isuppress_output, isolnid)
integer(I4B), intent(in) :: isolnid
! -- local
character(len=LENBOUNDNAME) :: bname
character(len=LENMODELNAME) :: packname1
character(len=LENMODELNAME) :: packname2
character(len=LENPACKAGENAME+4) :: packname1
character(len=LENPACKAGENAME+4) :: packname2
character(len=LENBUDTXT), dimension(1) :: budtxt
real(DP), dimension(2, 1) :: budterm
integer(I4B) :: i, n1, n2, n1u, n2u
Expand Down
3 changes: 1 addition & 2 deletions src/Model/GroundWaterFlow/gwf3evt8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,8 @@ subroutine evt_rp_array(this, line, inrate, insurf, indepth, &
integer(I4B) :: indx, ipos
integer(I4B) :: jcol, jauxcol, lpos, ivarsread
character(len=LENTIMESERIESNAME) :: tasName
character(len=24) :: atemp
character(len=24), dimension(6) :: aname
character(len=100) :: ermsg, keyword
character(len=100) :: ermsg, keyword, atemp
logical :: found, endOfBlock
logical :: convertFlux
!
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3lak8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2998,7 +2998,7 @@ subroutine lak_set_stressperiod(this, itemno, line)
!bndName = this%boundname(itemno)
call urword(line, lloc, istart, istop, 1, ival, rval, this%iout, this%inunit)
text = line(istart:istop)
this%status(itmp) = text
this%status(itmp) = text(1:8)
if (text == 'CONSTANT') then
this%iboundpak(itmp) = -1
else if (text == 'INACTIVE') then
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3maw8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1145,7 +1145,7 @@ subroutine maw_set_stressperiod(this, imaw, line)
case ('STATUS')
call urword(line, lloc, istart, istop, 1, ival, rval, this%iout, this%inunit)
text = line(istart:istop)
this%mawwells(imaw)%status = text
this%mawwells(imaw)%status = text(1:8)
if (text == 'CONSTANT') then
this%iboundpak(imaw) = -1
else if (text == 'INACTIVE') then
Expand Down
3 changes: 1 addition & 2 deletions src/Model/GroundWaterFlow/gwf3rch8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,8 @@ subroutine rch_rp_array(this, line, inrech)
integer(I4B) :: ipos
integer(I4B) :: jcol, jauxcol, lpos, ivarsread
character(len=LENTIMESERIESNAME) :: tasName
character(len=24) :: atemp
character(len=24), dimension(2) :: aname
character(len=LINELENGTH) :: keyword
character(len=LINELENGTH) :: keyword, atemp
logical :: found, endOfBlock
logical :: convertFlux
!
Expand Down
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3sfr8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ subroutine sfr_set_stressperiod(this, n, line, ichkustrm)
ichkustrm = 1
call urword(line, lloc, istart, istop, 1, ival, rval, this%iout, this%inunit)
text = line(istart:istop)
this%reaches(n)%status = text
this%reaches(n)%status = text(1:8)
if (text == 'INACTIVE') then
this%reaches(n)%iboundpak = 0
else if (text == 'ACTIVE') then
Expand Down
4 changes: 2 additions & 2 deletions src/Model/ModelUtilities/BoundaryPackage.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module BndModule
use ConstantsModule, only: LENAUXNAME, LENBOUNDNAME, LENFTYPE, &
DZERO, LENMODELNAME, LENPACKAGENAME, &
LENORIGIN, MAXCHARLEN, LINELENGTH, &
DNODATA
DNODATA, LENLISTLABEL
use SimModule, only: count_errors, store_error, ustop, &
store_error_unit
use NumericalPackageModule, only: NumericalPackageType
Expand All @@ -29,7 +29,7 @@ module BndModule

type, extends(NumericalPackageType) :: BndType
! -- characters
character(len=500) :: listlabel = '' !title of table written for RP
character(len=LENLISTLABEL) :: listlabel = '' !title of table written for RP
character(len=LENPACKAGENAME) :: text = ''
character(len=LENAUXNAME), allocatable, dimension(:) :: auxname !name for each auxiliary variable
character(len=LENBOUNDNAME), dimension(:), pointer, &
Expand Down
2 changes: 1 addition & 1 deletion src/Model/ModelUtilities/DiscretizationBase.f90
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ subroutine read_list(this, in, iout, iprpak, nlist, inamedbound, &
character(len=16), dimension(:), intent(inout) :: auxname
character(len=LENBOUNDNAME), dimension(:), pointer, contiguous, &
intent(inout) :: boundname
character(len=500), intent(in) :: label
character(len=*), intent(in) :: label
character(len=*), intent(in) :: pkgName
type(TimeSeriesManagerType) :: tsManager
integer(I4B), intent(in) :: iscloc
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/Constants.f90
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module ConstantsModule
integer(I4B), parameter :: LENTIMESERIESTEXT = 12
integer(I4B), parameter :: LENDATETIME = 30
integer(I4B), parameter :: LINELENGTH = 300
integer(I4B), parameter :: LENLISTLABEL = 500
integer(I4B), parameter :: MAXCHARLEN = 1000
integer(I4B), parameter :: MAXOBSTYPES = 100
integer(I4B), parameter :: NAMEDBOUNDFLAG = -9
Expand Down
5 changes: 3 additions & 2 deletions src/Utilities/ListReader.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
module ListReaderModule

use KindModule, only: DP, I4B
use ConstantsModule, only: LINELENGTH, LENBOUNDNAME, LENTIMESERIESNAME, DONE
use ConstantsModule, only: LINELENGTH, LENBOUNDNAME, LENTIMESERIESNAME, &
LENLISTLABEL, DONE
use SimModule, only: store_error_unit
implicit none
private
Expand All @@ -23,7 +24,7 @@ module ListReaderModule
integer(I4B) :: ndim ! number of dimensions in model
integer(I4B) :: ntxtrlist ! number of text entries found in rlist
integer(I4B) :: ntxtauxvar ! number of text entries found in auxvar
character(len=LINELENGTH) :: label ! label for printing list
character(len=LENLISTLABEL) :: label ! label for printing list
character(len=LINELENGTH) :: line ! line string for reading file
integer(I4B), dimension(:), pointer, contiguous :: mshape => null() ! pointer to model shape
integer(I4B), dimension(:), pointer, contiguous :: nodelist => null() ! pointer to nodelist
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/NameFile.f90
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ subroutine namefile_openfiles(this, iout)
! -- Parse the line and set defaults
call ParseLine(this%input_files(i), nwords, words)
call upcase(words(1))
ftype = words(1)
ftype = words(1)(1:20)
accarg = 'SEQUENTIAL'
fmtarg = 'FORMATTED'
filstat = 'OLD'
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Observation/Obs3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ module ObsModule
integer(I4B), private :: iprecision = 2 ! 2=double; 1=single
integer(I4B), private :: idigits = 5
character(len=LINELENGTH), private :: outputFilename = ''
character(len=20), private :: blockTypeFound = ''
character(len=LINELENGTH), private :: blockTypeFound = ''
character(len=20), private:: obsfmtcont = ''
logical, private :: echo = .false.
logical, private :: more
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/OutputControl/OutputControl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ subroutine oc_rp(this)
logical :: isfound, found, endOfBlock
character(len=LINELENGTH) :: line
character(len=LINELENGTH) :: ermsg, keyword1, keyword2
character(len=5) :: printsave
character(len=LINELENGTH) :: printsave
class(OutputControlDataType), pointer :: ocdobjptr
! -- formats
character(len=*), parameter :: fmtboc = &
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/version.f90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module VersionModule
public
! -- modflow 6 version
integer(I4B), parameter :: IDEVELOPMODE = 1
character(len=40), parameter :: VERSION = '6.0.3.86 03/07/2019'
character(len=40), parameter :: VERSION = '6.0.3.93 03/07/2019'
character(len=10), parameter :: MFVNAM = ' 6'
character(len=*), parameter :: MFTITLE = &
'U.S. GEOLOGICAL SURVEY MODULAR HYDROLOGIC MODEL'
Expand Down
6 changes: 3 additions & 3 deletions version.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# MODFLOW 6 version file automatically created using...pre-commit.py
# created on...March 07, 2019 08:50:56
# created on...March 07, 2019 17:03:57

# add some comments on how this version file
# should be manually updated and used

major = 6
minor = 0
micro = 3
build = 86
commit = 187
build = 93
commit = 194

0 comments on commit 3348653

Please sign in to comment.