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

fix(ArrayReaders): Fix issue reading binary 2d arrays #41

Merged
merged 11 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed compile issue with mf5to6...added contiguous to vectors/arrays
allocated using the memory manager. Also fixed issue with SEGFAULT in
mf5to6 that was related to a pointer in ChdPackageWriter that was not
pointed to null (=> null()) in definition.
  • Loading branch information
jdhughes-usgs committed Aug 29, 2018
commit 2b473cc77462e6d120b04c85c10e66b0350cc66e
4 changes: 2 additions & 2 deletions 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 7
### Version 6.0.3 develop — build 8
[![Build Status](https://travis-ci.org/MODFLOW-USGS/modflow6.svg?branch=develop)](https://travis-ci.org/MODFLOW-USGS/modflow6)

## Introduction
Expand All @@ -31,7 +31,7 @@ MODFLOW 6 is the latest core version of MODFLOW. It synthesizes many of the capa

#### ***Software/Code citation for MODFLOW 6:***

[Langevin, C.D., Hughes, J.D., Banta, E.R., Provost, A.M., Niswonger, R.G., and Panday, Sorab, 2018, MODFLOW 6 Modular Hydrologic Model version 6.0.3 — develop: U.S. Geological Survey Software Release, 28 August 2018, https://doi.org/10.5066/F76Q1VQV](https://doi.org/10.5066/F76Q1VQV)
[Langevin, C.D., Hughes, J.D., Banta, E.R., Provost, A.M., Niswonger, R.G., and Panday, Sorab, 2018, MODFLOW 6 Modular Hydrologic Model version 6.0.3 — develop: U.S. Geological Survey Software Release, 29 August 2018, https://doi.org/10.5066/F76Q1VQV](https://doi.org/10.5066/F76Q1VQV)


## Instructions for building definition files for new packages
Expand Down
18 changes: 9 additions & 9 deletions code.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[
{
"status": "Release Candidate",
"languages": [
"Fortran2008"
],
"downloadURL": "https://code.usgs.gov/usgs/modflow/modflow6/archive/master.zip",
"repositoryURL": "https://code.usgs.gov/usgs/modflow/modflow6.git",
"disclaimerURL": "https://code.usgs.gov/usgs/modflow/modflow6/blob/master/DISCLAIMER.md",
"tags": [
"MODFLOW",
"groundwater model"
],
"vcs": "git",
"name": "modflow6",
"downloadURL": "https://code.usgs.gov/usgs/modflow/modflow6/archive/master.zip",
"description": "MODFLOW is the USGS's modular hydrologic model. MODFLOW is considered an international standard for simulating and predicting groundwater conditions and groundwater/surface-water interactions.",
"contact": {
"name": "Christian D. Langevin",
"email": "[email protected]"
},
"languages": [
"Fortran2008"
],
"vcs": "git",
"laborHours": -1,
"version": "6.0.3.7",
"version": "6.0.3.8",
"date": {
"metadataLastUpdated": "2018-08-28"
"metadataLastUpdated": "2018-08-29"
},
"organization": "U.S. Geological Survey",
"permissions": {
Expand All @@ -33,6 +33,6 @@
"usageType": "openSource"
},
"homepageURL": "https://code.usgs.gov/usgs/modflow/modflow6/",
"description": "MODFLOW is the USGS's modular hydrologic model. MODFLOW is considered an international standard for simulating and predicting groundwater conditions and groundwater/surface-water interactions."
"name": "modflow6"
}
]
4 changes: 2 additions & 2 deletions doc/version.tex
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
\newcommand{\modflowversion}{mf6.0.3.7}
\newcommand{\modflowdate}{August 28, 2018}
\newcommand{\modflowversion}{mf6.0.3.8}
\newcommand{\modflowdate}{August 29, 2018}
\newcommand{\currentmodflowversion}{Version \modflowversion---\modflowdate}
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.7 08/28/2018'
character(len=40), parameter :: VERSION = '6.0.3.8 08/29/2018'
character(len=10), parameter :: MFVNAM = ' 6'
character(len=*), parameter :: MFTITLE = &
'U.S. GEOLOGICAL SURVEY MODULAR HYDROLOGIC MODEL'
Expand Down
14 changes: 7 additions & 7 deletions utils/mf5to6/src/ChdPackageWriter.f90
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ module ChdPackageWriterModule
integer :: kpercurrent
integer :: numtimeseries = 0
integer :: maxchds = 0
integer, dimension(:,:,:), pointer :: ibnd
integer, dimension(:,:,:), pointer :: ichdvar
double precision, dimension(:,:,:), pointer :: chdshead
double precision, dimension(:,:,:), pointer :: chdehead
type(ListType), pointer :: IbChdList => null() ! CHDs from IBOUND
type(ListType), pointer :: TvChdList => null() ! Time-variable CHDs from CHD package
type(ListType), pointer :: CnstChdList => null() ! Constant CHDs from CHD package
integer, dimension(:,:,:), pointer :: ibnd => null()
integer, dimension(:,:,:), pointer :: ichdvar => null()
double precision, dimension(:,:,:), pointer :: chdshead => null()
double precision, dimension(:,:,:), pointer :: chdehead => null()
type(ListType), pointer :: IbChdList => null() ! CHDs from IBOUND
type(ListType), pointer :: TvChdList => null() ! Time-variable CHDs from CHD package
type(ListType), pointer :: CnstChdList => null() ! Constant CHDs from CHD package
type(TimeSeriesFileType), pointer :: ChdTsGroup => null()
!type(ChdObsWriterType), pointer :: ChdObsWriter => null()
contains
Expand Down
2 changes: 1 addition & 1 deletion utils/mf5to6/src/ChdType.f90
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module ChdModule
character(len=MAXCHARLEN) :: tsfilename = ''
character(len=LENTIMESERIESNAME) :: AlternateTsName = ''
character(len=LENTIMESERIESNAME) :: OriginalTsName = ''
type(TimeSeriesType), pointer :: timeSeries
type(TimeSeriesType), pointer :: timeSeries => null()
contains
procedure :: CopyTo
end type ChdType
Expand Down
14 changes: 7 additions & 7 deletions utils/mf5to6/src/Preproc/Discretization3D.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ module DnmDis3dModule
public dis3d_cr, Dis3dType, CastAsDis3dType

type, extends(DisBaseType) :: Dis3dType
integer, pointer :: nlay !number of layers
integer, pointer :: nrow !number of rows
integer, pointer :: ncol !number of columns
integer, dimension(:), pointer :: nodereduced !(size:nodesuser) given user nodenumber provide the reduced nodenumber (size 0 if not reduced)
integer, dimension(:), pointer :: nodeuser !(size:nodes) given a reduced nodenumber, provide the user nodenumber (size 0 if not reduced)
integer, pointer :: nlay => null() !number of layers
integer, pointer :: nrow => null() !number of rows
integer, pointer :: ncol => null() !number of columns
integer, dimension(:), pointer, contiguous :: nodereduced => null() !(size:nodesuser) given user nodenumber provide the reduced nodenumber (size 0 if not reduced)
integer, dimension(:), pointer, contiguous :: nodeuser => null() !(size:nodes) given a reduced nodenumber, provide the user nodenumber (size 0 if not reduced)
! for PreHeadsMF
double precision :: gridXmax = DZERO
double precision :: gridYmin = DZERO
double precision :: gridXmax = DZERO
double precision :: gridYmin = DZERO
double precision, dimension(:), allocatable :: delr
double precision, dimension(:), allocatable :: delc
integer, dimension(:,:,:), allocatable :: idomain
Expand Down
30 changes: 15 additions & 15 deletions utils/mf5to6/src/Preproc/DiscretizationBasePHMF.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ module DnmDisBaseModule
public :: dis_cr

type :: DisBaseType
character(len=LENORIGIN), pointer :: origin => null() !origin name for mem allocation
character(len=LENMODELNAME), pointer :: name_model => null() !name of the model
integer, pointer :: inunit => null() !unit number for input file
integer, pointer :: iout => null() !unit number for output file
integer, pointer :: nodes => null() !number of nodes in solution
integer, pointer :: nodesuser => null() !number of user nodes (same as nodes for unstructured model)
integer, pointer :: ndim => null() !number of spatial model dimensions (1 for unstructured)
integer, pointer, dimension(:) :: mshape => null() !shape of the model; (nodes) for DisBaseType
integer, pointer :: nja => null() !number of connections plus number of nodes
integer, pointer :: njas => null() !(nja-nodes)/2
integer, pointer :: lenuni => null() !length unit
integer, pointer :: idsymrd => null() !indicates how symmetric arrays are read
double precision, dimension(:), pointer :: top => null() !(size:nodes) cell top elevation
double precision, dimension(:), pointer :: bot => null() !(size:nodes) cell bottom elevation
double precision, dimension(:), pointer :: area => null() !(size:nodes) cell area, in plan view
character(len=LENORIGIN), pointer :: origin => null() !origin name for mem allocation
character(len=LENMODELNAME), pointer :: name_model => null() !name of the model
integer, pointer :: inunit => null() !unit number for input file
integer, pointer :: iout => null() !unit number for output file
integer, pointer :: nodes => null() !number of nodes in solution
integer, pointer :: nodesuser => null() !number of user nodes (same as nodes for unstructured model)
integer, pointer :: ndim => null() !number of spatial model dimensions (1 for unstructured)
integer, pointer, dimension(:), contiguous :: mshape => null() !shape of the model; (nodes) for DisBaseType
integer, pointer :: nja => null() !number of connections plus number of nodes
integer, pointer :: njas => null() !(nja-nodes)/2
integer, pointer :: lenuni => null() !length unit
integer, pointer :: idsymrd => null() !indicates how symmetric arrays are read
double precision, dimension(:), pointer, contiguous :: top => null() !(size:nodes) cell top elevation
double precision, dimension(:), pointer, contiguous :: bot => null() !(size:nodes) cell bottom elevation
double precision, dimension(:), pointer, contiguous :: area => null() !(size:nodes) cell area, in plan view
! for PreHeadsMF
! For structured DIS, origin is outside corner of cell at row 1, column 1.
double precision :: Xorigin = DZERO ! X coordinate of grid origin
Expand Down
116 changes: 64 additions & 52 deletions utils/mf5to6/src/Preproc/Global.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,74 @@ MODULE GLOBAL
double precision, save, pointer :: constantdelc
character(len=MAXCHARLEN), save, pointer :: cbcfilename
! arrays
INTEGER, SAVE, DIMENSION(:), POINTER :: IUNIT(:)
DOUBLE PRECISION, SAVE, DIMENSION(:,:,:), POINTER :: HNEW
INTEGER, SAVE, DIMENSION(:), POINTER :: LBOTM
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYCBD
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYHDT
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYHDS
double precision, SAVE, DIMENSION(:), POINTER :: PERLEN
INTEGER, SAVE, DIMENSION(:), POINTER :: NSTP
double precision, SAVE, DIMENSION(:), POINTER :: TSMULT
INTEGER, SAVE, DIMENSION(:), POINTER :: ISSFLG
double precision, SAVE, DIMENSION(:), POINTER :: DELR
double precision, SAVE, DIMENSION(:), POINTER :: DELC
double precision, SAVE, DIMENSION(:,:,:), POINTER :: BOTM
double precision, SAVE, DIMENSION(:,:,:), POINTER :: HOLD
INTEGER, SAVE, DIMENSION(:,:,:), POINTER :: IBOUND
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CR
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CC
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CV
double precision, SAVE, DIMENSION(:,:,:), POINTER :: HCOF
double precision, SAVE, DIMENSION(:,:,:), POINTER :: RHS
double precision, SAVE, DIMENSION(:,:,:), POINTER :: BUFF
double precision, SAVE, DIMENSION(:,:,:), POINTER :: STRT
double precision, SAVE, DIMENSION(:,:,:), POINTER :: DDREF
INTEGER, SAVE, DIMENSION(:), POINTER :: IUNIT(:) => null()
DOUBLE PRECISION, SAVE, DIMENSION(:,:,:), POINTER :: HNEW => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: LBOTM => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYCBD => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYHDT => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: LAYHDS => null()
double precision, SAVE, DIMENSION(:), POINTER :: PERLEN => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: NSTP => null()
double precision, SAVE, DIMENSION(:), POINTER :: TSMULT => null()
INTEGER, SAVE, DIMENSION(:), POINTER :: ISSFLG => null()
double precision, SAVE, DIMENSION(:), POINTER :: DELR => null()
double precision, SAVE, DIMENSION(:), POINTER :: DELC => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: BOTM => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: HOLD => null()
INTEGER, SAVE, DIMENSION(:,:,:), POINTER :: IBOUND => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CR => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CC => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: CV => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: HCOF => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: RHS => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: BUFF => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: STRT => null()
double precision, SAVE, DIMENSION(:,:,:), POINTER :: DDREF => null()

TYPE GLOBALTYPE
! scalars
INTEGER, POINTER :: NCOL,NROW,NLAY,NPER,NBOTM,NCNFBD
INTEGER, POINTER :: ITMUNI,LENUNI,IXSEC,ITRSS,INBAS
INTEGER, POINTER :: IFREFM,NODES,IOUT,MXITER
double precision, pointer :: constantdelr
double precision, pointer :: constantdelc
character(len=MAXCHARLEN), pointer :: cbcfilename
INTEGER, POINTER :: NCOL => null()
INTEGER, POINTER :: NROW => null()
INTEGER, POINTER :: NLAY => null()
INTEGER, POINTER :: NPER => null()
INTEGER, POINTER :: NBOTM => null()
INTEGER, POINTER :: NCNFBD => null()
INTEGER, POINTER :: ITMUNI => null()
INTEGER, POINTER :: LENUNI => null()
INTEGER, POINTER :: IXSEC => null()
INTEGER, POINTER :: ITRSS => null()
INTEGER, POINTER :: INBAS => null()
INTEGER, POINTER :: IFREFM => null()
INTEGER, POINTER :: NODES => null()
INTEGER, POINTER :: IOUT => null()
INTEGER, POINTER :: MXITER => null()
double precision, pointer :: constantdelr => null()
double precision, pointer :: constantdelc => null()
character(len=MAXCHARLEN), pointer :: cbcfilename => null()
! arrays
INTEGER, DIMENSION(:), POINTER ::IUNIT
DOUBLE PRECISION, DIMENSION(:,:,:), POINTER ::HNEW
INTEGER, DIMENSION(:), POINTER ::LBOTM
INTEGER, DIMENSION(:), POINTER ::LAYCBD
INTEGER, DIMENSION(:), POINTER ::LAYHDT
INTEGER, DIMENSION(:), POINTER ::LAYHDS
double precision, DIMENSION(:), POINTER ::PERLEN
INTEGER, DIMENSION(:), POINTER ::NSTP
double precision, DIMENSION(:), POINTER ::TSMULT
INTEGER, DIMENSION(:), POINTER ::ISSFLG
double precision, DIMENSION(:), POINTER ::DELR
double precision, DIMENSION(:), POINTER ::DELC
double precision, DIMENSION(:,:,:), POINTER ::BOTM
double precision, DIMENSION(:,:,:), POINTER ::HOLD
INTEGER, DIMENSION(:,:,:), POINTER ::IBOUND
double precision, DIMENSION(:,:,:), POINTER ::CR
double precision, DIMENSION(:,:,:), POINTER ::CC
double precision, DIMENSION(:,:,:), POINTER ::CV
double precision, DIMENSION(:,:,:), POINTER ::HCOF
double precision, DIMENSION(:,:,:), POINTER ::RHS
double precision, DIMENSION(:,:,:), POINTER ::BUFF
double precision, DIMENSION(:,:,:), POINTER ::STRT
double precision, DIMENSION(:,:,:), POINTER ::DDREF
INTEGER, DIMENSION(:), POINTER ::IUNIT => null()
DOUBLE PRECISION, DIMENSION(:,:,:), POINTER ::HNEW => null()
INTEGER, DIMENSION(:), POINTER ::LBOTM => null()
INTEGER, DIMENSION(:), POINTER ::LAYCBD => null()
INTEGER, DIMENSION(:), POINTER ::LAYHDT => null()
INTEGER, DIMENSION(:), POINTER ::LAYHDS => null()
double precision, DIMENSION(:), POINTER ::PERLEN => null()
INTEGER, DIMENSION(:), POINTER ::NSTP => null()
double precision, DIMENSION(:), POINTER ::TSMULT => null()
INTEGER, DIMENSION(:), POINTER ::ISSFLG => null()
double precision, DIMENSION(:), POINTER ::DELR => null()
double precision, DIMENSION(:), POINTER ::DELC => null()
double precision, DIMENSION(:,:,:), POINTER ::BOTM => null()
double precision, DIMENSION(:,:,:), POINTER ::HOLD => null()
INTEGER, DIMENSION(:,:,:), POINTER ::IBOUND => null()
double precision, DIMENSION(:,:,:), POINTER ::CR => null()
double precision, DIMENSION(:,:,:), POINTER ::CC => null()
double precision, DIMENSION(:,:,:), POINTER ::CV => null()
double precision, DIMENSION(:,:,:), POINTER ::HCOF => null()
double precision, DIMENSION(:,:,:), POINTER ::RHS => null()
double precision, DIMENSION(:,:,:), POINTER ::BUFF => null()
double precision, DIMENSION(:,:,:), POINTER ::STRT => null()
double precision, DIMENSION(:,:,:), POINTER ::DDREF => null()
END TYPE GLOBALTYPE

TYPE(GLOBALTYPE),SAVE ::GLOBALDAT(10)
Expand Down
2 changes: 1 addition & 1 deletion utils/mf5to6/src/Preproc/SimVariables.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module SimVariablesModule
private
public :: ModelPacks, SimMovers, iout

type(ListType), pointer :: SimMovers
type(ListType), pointer :: SimMovers => null()
type(ListType) :: ModelPacks

end module SimVariablesModule
6 changes: 3 additions & 3 deletions utils/mf5to6/src/StoWriter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ module StoWriterModule
integer, pointer :: Nlaynew => null()
integer, dimension(:), pointer :: Layptr => null()
integer, pointer, dimension(:) :: Iconvert ! confined (0) or convertible (1), upstream (4)?
double precision, pointer, dimension(:,:,:) :: Ss ! specific storage (or storage coefficient)
double precision, pointer, dimension(:,:,:) :: Sy ! specific yield
logical, pointer, dimension(:) :: Transient
double precision, pointer, dimension(:,:,:) :: Ss => null() ! specific storage (or storage coefficient)
double precision, pointer, dimension(:,:,:) :: Sy => null() ! specific yield
logical, pointer, dimension(:) :: Transient => null()
logical :: Newton
contains
procedure :: AllocateArrays
Expand Down
2 changes: 1 addition & 1 deletion utils/mf5to6/src/TdisWriter.f90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module TdisWriterModule
type, extends(FileWriterType) :: TdisWriterType
character(len=10), private :: TimeUnit = 'UNDEFINED'
integer, private :: Nper = -1
type(StressPeriodType), dimension(:), pointer :: StressPeriods
type(StressPeriodType), dimension(:), pointer :: StressPeriods => null()
contains
procedure, public :: InitializeFile => initialize_tdis
procedure, public :: Alloc
Expand Down
2 changes: 1 addition & 1 deletion utils/mf5to6/src/mf5to6.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ program mf5to6
type(ExchangeType), pointer :: exchange => null()
type(SimFileWriterType) :: SimFileWriter
type(SfrPackageWriterType), pointer :: SfrWriter => null()
class(*), pointer :: obj
class(*), pointer :: obj => null()
character(len=MAXCHARLEN) :: fname, namfil, basnam, basnamtemp, msg
logical :: WriteDisFile
! formats
Expand Down
Loading