U.S. Department of the Interior 

U.S. Geological Survey 

A Product of the Ground-Water Resources Program 

Prepared in Cooperation with the U.S. Department of Energy 

MODFLOW-2005, The U.S. Geological Survey Modular 

Ground-Water Model—Documentation of the MultipleRefined-Areas Capability of Local Grid Refinement (LGR) 

and the Boundary Flow and Head (BFH) Package 

Chapter 21 of 

Book 6, Modeling Techniques, Section A, Ground Water 

Techniques and Methods 6-A21 
Cover: Schematic of two locally refined grids embedded within a coarse grid with detailed area showing the grid 

structure along the boundaries of the local grids. 
MODFLOW-2005, The U.S. Geological Survey 

Modular Ground-Water Model—Documentation of 

the Multiple-Refined-Areas Capability of Local Grid 

Refinement (LGR) and the Boundary Flow and Head 

(BFH) Package 

By Steffen W. Mehl and Mary C. Hill 

 

 

 

 

 

 

 

 

 

A Product of the Ground-Water Resources Program 

Prepared in Cooperation with the U.S. Department of Energy 

 

Techniques and Methods 6-A21 

U.S. Department of the Interior 

U.S. Geological Survey 
U.S. Department of the Interior 

DIRK KEMPTHORNE, Secretary 

U.S. Geological Survey 

Mark D. Myers, Director 

U.S. Geological Survey, Reston, Virginia: 2007 

Any use of trade, firm, or product names is for descriptive purposes only and does not 

imply endorsement by the U.S. Government 

Although this report is in the public domain, permission must be secured from the individual copyright owners to reproduce any 

copyrighted material contained within this report. 

For more information about the USGS and its products: 

Telephone: 1-888-ASK-USGS 

World Wide Web: http://www.usgs.gov/ 

Suggested citation: 

Mehl, S.W., and Hill, M.C., 2007, MODFLOW-2005, The U.S. Geological Survey modular ground-water model—Documentation of 

the multiple-refined-areas capability of local grid refinement (LGR) and the boundary flow and head (BFH) package: U.S. 

Geological Survey Techniques and Methods 6-A21, 13 p. 
Preface 

This report describes an addition to the shared node Local Grid Refinement (LGR) for 

MODFLOW-2005, the U.S. Geological Survey’s three-dimensional finite-difference groundwater model. LGR is designed to allow users to create MODFLOW simulations by using a 

refined grid that is embedded within a coarser grid. This report extends that capability to allow 

multiple areas of refinement. 

This report also describes the Boundary Flow and Head (BFH) Package for MODFLOW2005, modified to accommodate the possibility of multiple areas of refinement. The BFH 

Package allows each refined grid to be run separately from the rest of the model, and the rest of 

the model to be run separately from the refined grids. 

The performance of the programs has been tested in a variety of applications. Future 

applications, however, might reveal errors that were not detected in the test simulations. Users 

are requested to notify the U.S. Geological Survey of any errors found in this document or the 

computer program by using the e-mail address available at the Web address below. Updates 

might occasionally be made to both this document and to LGR and the BFH Package. Users can 

check for updates on the Internet at URL http://water.usgs.gov/software/ground_water.html/. 

iii
CONTENTS 

Abstract........................................................................................................................................... 1 

Introduction..................................................................................................................................... 1 

Purpose and Scope ................................................................................................................. 2 

Acknowledgments.................................................................................................................. 2 

Highlights of New Capabilities....................................................................................................... 3 

Coupling Strategy, Opportunities for Parallelization, and Execution Time .......................... 3 

Model Grid Design ................................................................................................................ 5 

Multiple Refined Areas Example.................................................................................................... 5 

References....................................................................................................................................... 7 

Appendix 1: LGR Input Instructions .............................................................................................. 8 

Explanation of Variables Read by LGR ................................................................................ 8 

Appendix 2: LGR Input File for Multiple Refined Areas Example Shown in Figure 3............... 11 

LGR Input File Showing Available Flexibility ................................................................... 12 

LGR Output ......................................................................................................................... 13 

Appendix 3: Variables added to LGR to Simulate Multiple Areas of Refinement ...................... 13 

Additional Variables in Fortran Module LGRMODULE.................................................... 13 

Additional Variables in Fortran Module GWFBFHMODULE........................................... 13 

Figures 

Figure 1. Flow chart for the iteratively coupled procedure with the modifications for multiple 

areas of local grid refinement labeled as “For Each Child.”........................................................... 4 

Figure 2. Schematic of a coarse grid with two areas of local grid refinement separated by two 

parent grid cells............................................................................................................................... 5 

Figure 3. Example of grid refinement around two areas of pumping within a coarse-grid model. 

......................................................................................................................................................... 6 

Tables 

Table 1. Comparison of simulated hydraulic head at the wells and computer processing time for 

several grids. ................................................................................................................................... 6 

Table 2. Additional variables in Fortran module LGRMODULE............................................... 13 

Table 3. Additional variables in Fortran module GWFBFHMODULE. ..................................... 13 

iv
v

Conversion Factors 

Multiply By To obtain 

meter (m) 3.281 foot 

meter per second (m/s) 3.281 foot per second 

square meter per second (m2

/s) 10.76 square foot per second 

cubic meter per second (m3

/s) 35.31 cubic foot per second 

Acronyms 

LGR Local Grid Refinement 

BFH Boundary Flow and Head 
MODFLOW-2005, The U.S. Geological Survey 

Modular Ground-Water Model—Documentation 

of the Multiple-Refined-Areas Capability of 

Local Grid Refinement (LGR) and the Boundary 

Flow and Head (BFH) Package 

By Steffen W. Mehl and Mary C. Hill 

Abstract 

This report documents the addition of the multiple-refined-areas capability to shared node 

Local Grid Refinement (LGR) and Boundary Flow and Head (BFH) Package of MODFLOW2005, the U.S. Geological Survey modular, three-dimensional, finite-difference ground-water flow 

model. LGR now provides the capability to simulate ground-water flow by using one or more 

block-shaped, higher resolution local grids (child model) within a coarser grid (parent model). 

LGR accomplishes this by iteratively coupling separate MODFLOW-2005 models such that heads 

and fluxes are balanced across the shared interfacing boundaries. The ability to have multiple, 

nonoverlapping areas of refinement is important in situations where there is more than one area of 

concern within a regional model. In this circumstance, LGR can be used to simulate these distinct 

areas with higher resolution grids. LGR can be used in two-and three-dimensional, steady-state 

and transient simulations and for simulations of confined and unconfined ground-water systems. 

The BFH Package can be used to simulate these situations by using either the parent or child 

models independently. 

Introduction 

Simulations of ground-water flow and transport often need highly refined grids in local 

areas of interest to improve simulation accuracy. For example, refined grids may be needed: 

(1) in regions where hydraulic gradients change substantially over short distances, as would 

be common near pumping or injecting wells, rivers, drains, and focused recharge; (2) in regions of 

site-scale contamination within a regional aquifer where simulations of plume movement are of 

interest; and (3) in regions requiring detailed representation of (hydro)geologic heterogeneity. 

Often, it is advantageous to refine more than one area of the model grid. 

Refinement of the finite-difference grid used by MODFLOW-2005 (Harbaugh, 2005), the 

U.S. Geological Survey (USGS) modular three-dimensional, ground-water flow model, can be 

achieved by using globally refined grids, variably spaced grids, or locally refined grids, as 

discussed by Mehl and Hill (2005). The USGS Office of Ground Water and Ground-Water 

Resources Program, in cooperation with the Department of Energy, continued development of the 

shared-node local grid-refinement iterative method discussed by Mehl and Hill (2002, 2003, 2004) 

and Mehl and others (2006). One advantage of the shared-node local grid-refinement method is its 

ability to maintain continuity of flow and heads across the boundary between local (child) and 

regional (parent) grids without refining parts of the grid for which refinement is not desired. In 

1
addition, the parent and child models can be run either as a coupled system of models or 

separately, as independent models. The flexibility of being able to run the models separately can be 

very useful when, for example, solute transport within a refined grid is of interest. 

Purpose and Scope 

The purpose of this report is to document additions to MODFLOW-LGR and the Boundary 

Flow and Head (BFH) Package (Mehl and Hill, 2005). These additions allow users of 

MODFLOW-2005 (Harbaugh, 2005) to simulate multiple areas of grid refinement. This report first 

provides highlights of the new LGR (local grid refinement) capabilities. Next, the coupling 

strategy and opportunities for parallel execution are described and an example application is 

presented to demonstrate the performance of the program. Input instructions, example input and 

output, and important information to programmers are presented in the Appendix. 

Acknowledgments

LGR was developed with support from the USGS Office of Ground Water, the USGS 

Ground-Water Resources Program, and the U.S. Department of Energy through the Environmental 

Management Project and the USGS Yucca Mountain Project. Arlen Harbaugh designed the datastorage conventions of MODFLOW-2005 (Harbaugh, 2005) to allow for multiple grids. His 

careful organization was instrumental for making LGR possible and became even more important 

with the addition of multiple areas of refinement. We are grateful for the reviews and comments 

provided by Paul Barlow and Arlen Harbaugh of the Office of Ground Water and Wayne Belcher 

and Matt Ely, all of which greatly improved the quality of this report. 

2
Highlights of New Capabilities 

The updated version of LGR can simulate multiple areas of grid refinement, as shown in 

Figures 1 and 2. The following list of highlights is an addendum to those listed in the primary 

documentation of LGR (Mehl and Hill, 2005). 

Coupling Strategy, Opportunities for Parallelization, and Execution Time 

(1) In the iterative coupling strategy discussed in this report, all child grids are simulated 

before resimulating the parent grid with updated boundary conditions, as shown in 

Figure 1. That is, the effects of all child grids are accumulated and applied to the parent 

grid in a single parent simulation. In this approach, the ordering of the child-grid 

simulations does not affect the convergence or the results. An alternative coupling 

strategy would be to iterate between a parent-child pair before simulating the next 

parent-child pair. In this approach, the ordering of the parent-child simulations could 

affect model performance. It is conceivable that such a strategy might be advantageous 

in certain circumstances; however, such an iterative coupling strategy was not 

investigated and is not currently (2007) available. 

(2) In the iterative coupling strategy used in this report, child model simulations can be 

executed independently of each other and, therefore, could be executed in parallel. 

However, parallelization of the child grid solutions is currently (2007) not 

implemented. 

(3) LGR uses a solution method that iterates between the parent model and the child 

models. A single iteration requires one parent-model solution (execution time Tparent) 

and one child-model solution for each child model used (execution time •Tchild). The 

execution time per iteration is approximately the execution time of the parent grid, 

Tparent, plus the sum of the execution times for each child, •Tchild, which tends to cause a 

linear increase in execution time per iteration for each additional child model that is 

simulated. The number of LGR iterations required for convergence depends on the 

flow system being simulated. Experimentation so far has not indicated an increase in 

the number of LGR iterations when child grids are added. 

3
 

Figure 1. Flow chart for the iteratively coupled procedure with the modifications for multiple areas of local grid refinement labeled 

as “For Each Child.” 

For Each Child 

iter> maxiter

OR 

Head change

< tolerance 

AND 

Flux change 

< tolerance 

?

Calculate flux entering child grid

Under relax boundary flux change

Simulate parent model by using specifiedflux boundaries at child interface and 

inactive cells where covered by the child 

Calculate heads 

Under relax head change

Simulate child model by using specifiedhead boundaries at parent interface 

 S

Solve parent-grid model of the entire domain

tart

LGR Iteration Loop 

No 

 Yes 

Stop

Calculate specified-head boundaries at 

interface by using cage-shell interpolation

Calculate parent budget contribution from 

flux entering child grid

Calculate child budget contribution from 

interface specified-head boundaries 

iter > 1

? 

 Yes 

 No 

EXPLANATION 

iter, iteration number 

maxiter, maximum number of 

iterations 

<, less than 

4
Model Grid Design 

The program documented in this report can simulate one or more block-shaped volumes of 

local-grid refinement. The refined areas cannot overlap, and at least one parent cell is needed 

between refined areas. Figure 2 shows an example with two parent-model grid cells between the 

two child model grids. 

 

Figure 2. Schematic of a coarse grid with two areas of local grid refinement separated by two parent grid cells. At least one parent 

cell is required between child models. 

In three-dimensional models, different local grids can extend vertically to different levels 

of the parent grid. The vertical discretization needs to follow the same criteria described in Mehl 

and Hill (2006, p. 13). 

Multiple Refined Areas Example 

A two-dimensional example is used to illustrate the multiple-refined-areas capability. 

Hydraulic head contours from this example are shown in Figure 3. This example is a modification 

of “example 1” described by Mehl and Hill (2005, p. 30). The parent model grid cells are 9.25 m 

by 9.0 m, which produces a grid that has 50 rows and 108 columns. The grid cells for both child 

models are 1.028 m by 1.0 m, representing a 9:1 refinement ratio. The modifications include the 

addition of a second pumping well of identical pumping rate (5.5x10-3 m3/s), a homogeneous 

hydraulic conductivity field of 5.0×10-4 m/s, and constant-head boundaries of 10.0 m on the left 

and right sides. This test system was designed to have a symmetric flow field such that both child 

models have identical solutions while simulating different parts of the domain. This forms a test of 

the LGR program and, indeed, the solutions in the two grids were the same. 

5
9 8

6 5

3

2

3

2

1

4 6 7

8

9

4 7

1

5

X, meters

Y, meters

200 400 600 800

100

200

300

400 EXPLANATION 

–4– Simulated hydraulic head 

contour. Contour interval is 1 

meter. Arbitrary datum 

Pathline showing direction of 

particle movement 

 

 Locally refined area 

 

 

Figure 3. Example of grid refinement around two areas of pumping within a coarse-grid model. The system was designed to have a 

symmetric flow field. 

Table 1 shows a comparison of the simulated hydraulic head at the wells and the computer 

processing times required for: (1) the coarse grid only, (2) the coarse grid coupled to the locally 

refined grids by using LGR, and (3) a globally refined grid. The globally refined grid uses the 

same grid spacing over the entire domain as the locally refined grids. The coarse grid coupled to 

the local grid by using LGR simulates a hydraulic head at the well that is in good agreement with 

the globally refined grid and requires somewhat less computer processing time. Approximately 

half the computer processing time (2.52 seconds) is required if only one area of refinement is 

simulated. This example demonstrates that the locally refined grids can improve the simulated 

drawdowns near the pumping wells (compared to the coarse grid), which is expected, and the 

approximately linear scaling of computer processing time when additional areas are simulated. 

Though with the two local grids, the execution time is only reduced slightly in this 

problem; refining multiple areas in larger models is likely to be more computationally 

advantageous. Also, local refinement allows the rest of the model to remain unchanged. It also 

allows each of the models (here, the parent model or either of the child models) to be simulated 

independently, which can be advantageous when simulating computationally demanding transport 

processes. 

Table 1. Comparison of simulated hydraulic head at the wells and 

computer processing time for several grids. Only one well is reported 

because the flow field is symmetric, as shown in Figure 3. 

[ Computation times using a Linux workstation, Pentium IV – 3.0 gigahertz] 

Grid Head at wells 

(meters) 

Computer 

processing time 

(seconds) 

Coarse -3.11 0.055 

Locally refined -6.95 1

4.82 (2.52)

Globally refined -6.96 5.00 

1

With one area of refinement. 

6
References 

Harbaugh, A.W., 2005, MODFLOW-2005, The U.S. Geological Survey modular ground-water model—

the Ground-Water Flow Process: U.S. Geological Survey Techniques and Methods 6-A16, 9 

chapters. 

Mehl, S., and Hill, M.C., 2002, Development and evaluation of a local grid refinement method for 

block-centered finite-difference groundwater models using shared nodes: Advances in 

Water Resources, v. 25, no. 5, p. 497–511. 

Mehl, S., and Hill, M.C., 2003, Locally refined block-centered finite-difference groundwater 

models—Evaluation of parameter sensitivity and the consequences for inverse modeling, in

Kovar, K., and Hrkal, Z.: IAHS Publication no. 277, p. 227–232. 

Mehl, S., and Hill, M.C., 2004, Three-dimensional local grid refinement for block-centered finitedifference groundwater models using iteratively coupled shared nodes—A new method of 

interpolation and analysis of errors: Advances in Water Resources, v. 27, no. 9, p. 899–912. 

Mehl, S.W., and Hill, M.C., 2005, MODFLOW-2005, the U.S. Geological Survey modular ground-water 

model—Documentation of shared node local grid refinement (LGR) and the boundary flow 

and head (BFH) package: U.S. Geological Survey Techniques and Methods 6-A12, 68 p. 

Mehl, S.W., Hill, M.C., and Leake, S.A., 2006, Comparison of local grid refinement methods for 

MODFLOW: Ground Water, v. 44, no. 6, p. 792–796. 

7
Appendix 1: LGR Input Instructions 

When executed, MODFLOW-2005 prompts for the name of a file (the Name File; 

Harbaugh, 2005, p. 4-1 and 8-10). If a Name File is entered at the initial prompt, LGR is not used. 

To use LGR, enter the name of the LGR Control File at the initial prompt. The contents of this file 

are described here in full and are largely the same as the original input instructions described in 

Mehl and Hill (2005). Bold-face type is used to indicate relevant changes from the original input 

instructions. 

The LGR Control File is distinguished from a Name File by the presence of a keyword 

“LGR” as the first non-commented input. LGR reads its input data from this file. Input for LGR 

is defined by using 15 items. Each item is read free format. 

FOR EACH SIMULATION 

0. [#Text] 

Item 0 is optional – # must appear in column 1. Item 0 can be repeated multiple times. 

1. LGR 

2. NGRIDS 

FOR THE PARENT GRID (the parent grid needs to be listed before the child grid) 

3. NAME FILE 

4. GRIDSTATUS 

5. IUPBHSV IUPBFSV 

FOR EACH CHILD GRID [repeat items 6 through 15 for each grid with the exception of 

the parent grid. That is, repeat these items a total of (NGRIDS - 1) times] 

6. NAME FILE 

7. GRIDSTATUS 

8. ISHFLG IBFLG IUCBHSV IUCBFSV 

9. MXLGRITER IOUTLGR 

10. RELAXH RELAXF 

11. HCLOSELGR FCLOSELGR 

12. NPLBEG NPRBEG NPCBEG 

13. NPLEND NPREND NPCEND 

14. NCPP 

15. NCPPL [Repeat NCPPL a total of (NPLEND +1 – NPLBEG) 

times] 

Explanation of Variables Read by LGR 

LGR – the text “LGR” needs to be entered in the first item to indicate to MODFLOW-2005 that 

the LGR capability is used. 

8
NGRIDS – is the total number of grids used in this simulation, including the parent grid and all of 

the child grids. 

NAME FILE– is the name of the Name File for either the parent or child grid. The name can 

include the file path and is limited to 200 characters. 

GRIDSTATUS – is a character variable and indicates whether the file listed in NAME FILE 

corresponds to a parent or child grid. 

If GRIDSTATUS = PARENTONLY, then it is a parent grid Name File. 

If GRIDSTATUS = CHILDONLY, then it is a child grid Name File. 

IUPBHSV – A number greater than zero that corresponds to the unit number where the boundary 

heads are saved for later use by the BFH Package for independent simulations. A file with this 

unit number needs to be opened in the Name File of the parent model. A value of zero indicates 

that the file is not written. For the parent model, these are the complementary boundary conditions 

(see Appendix 2 of Mehl and Hill, 2005). 

IUPBFSV – A number greater than zero that corresponds to the unit number where the boundary 

fluxes are saved for later use by the BFH Package for independent simulations. A file with this 

unit number needs to be opened in the Name File of the parent model. A value of zero indicates 

that the file is not written. For the parent model, these are the coupling boundary conditions (see 

Appendix 2 of Mehl and Hill, 2005). 

ISHFLG – is a flag indicating whether heads from the parent grid simulation should be used as the 

starting head for the child grid simulation. These heads apply to the interior of the child, not the 

boundary. 

If ISHFLG = 1, then use results of the parent grid simulation as the starting head for the 

child grid. In the cells of the child grid that overlap the parent grid, the heads of the 

corresponding parent cell are used. No interpolation is applied. For steady-state 

simulations, this can provide a good initial guess which can reduce computational 

time. For transient simulations, this overwrites the initial condition of the child 

model defined in STRT of the Basic Package input file (Harbaugh, 2005) and, 

therefore, is not recommended. 

If ISHFLG = 0, then use the heads defined in STRT of the Basic Package for the child grid. 

IBFLG – is a negative integer used to define the interface of the child grid with the parent. Use 

this value around the perimeter of the child model IBOUND array. Do not use IBFLG or -

IBFLG anywhere else in the parent or child IBOUND arrays. Use a unique value for each child 

grid.

IUCBHSV – A number greater than zero that corresponds to the unit number where the boundary 

heads are saved for later use by the BFH Package for independent simulations. A file with this 

unit number needs to be opened in the Name File of the child model. A value of zero indicates that 

the file is not written. For the child model, these are the coupling boundary conditions (see 

Appendix 2 of Mehl and Hill, 2005). 

IUCBFSV – A number greater than zero that corresponds to the unit number where the boundary 

fluxes are saved for later use by the BFH Package for independent simulations. A file with this 

unit number needs to be opened in the Name File of the child model. A value of zero indicates that 

the file is not written. For the child model, these are the complementary boundary conditions (see 

Appendix 2 of Mehl and Hill, 2005). 

MXLGRITER – is the maximum number of LGR iterations; 20 iterations are sufficient for most 

problems. See Closure Criteria for LGR Iterations section of the report by Mehl and Hill (2005). 

Set MXLGRITER to 1 for a one-way coupling. 

IOUTLGR – is a flag that controls printing from LGR iterations of the maximum head and flux 

change. For the maximum head change, the head value and corresponding layer, row, and column 

9
of the child grid is listed. For the maximum flux change, the flux value and corresponding layer, 

row, and column of the parent grid is listed. If IOUTLGR < 0, output is written to the screen. If 

IOUTLGR > 0, output is written to the child listing file. If IOUTLGR = 0, no results are written. 

RELAXH – is the relaxation factor for heads. 

RELAXF – is the relaxation factor for fluxes. 

Values of RELAXH and RELAXF less than 1 and greater than zero are needed for convergence of 

the LGR iterations. Typically, values around 0.5 produce convergent solutions. Values less than 

0.5 may be needed when the LGR iterations have difficulty converging. In cases in which the 

LGR iterations exhibit no convergence difficulties, values greater than 0.5 may reduce the number 

of iterations needed for convergence. Convergence difficulties can be diagnosed by printing the 

maximum head and flux changes (IOUTLGR ≠ 0) to determine if the head and flux changes are 

decreasing (converging) or increasing (diverging) as the LGR iterations proceed. 

HCLOSELGR – is the head closure criterion for the LGR iterations. The closure criterion is based 

on heads of the child-interface nodes. This closure criterion is satisfied when the maximum 

absolute head change between successive LGR iterations is less than HCLOSELGR (see equation 

8b of the LGR documentation, Mehl and Hill, 2005). 

FCLOSELGR – is the flux closure criterion for the LGR iterations. The closure criterion is based 

on fluxes into the parent-interface nodes. This closure criterion is satisfied when the maximum 

absolute relative flux change between successive LGR iterations is less than FCLOSELGR (see 

equation 8a of the LGR documentation, Mehl and Hill, 2005). 

NPLBEG – is the number of the topmost layer of the parent grid where the child model begins. 

Currently (2007), refinement must begin at the top of the model so NPLBEG = 1. 

NPRBEG – is the row number of the parent grid where the refinement begins (cannot equal 1). 

NPCBEG – is the column number of the parent grid where the refinement begins (cannot equal 1). 

NPLEND – is the number of the lowest layer of the parent grid where the refinement ends. 

NPLEND ≥ NPLBEG 

NPREND – is the row number of the parent grid where the refinement ends. NPREND > 

NPRBEG and NPREND cannot equal the number of rows in the parent grid. 

NPCEND – is the column number of the parent grid where the refinement ends. NPCEND > 

NPCBEG and NPCEND cannot equal the number of columns in the parent grid. 

NCPP – The number of child cells that span the width of a single parent cell along rows and 

columns. This must be an odd integer number > 1 and is applied to rows and columns. 

NCPPL – is the number of child cells that span the depth of a single parent layer. This must be an 

odd integer number ≥ 1. Read one value for each refined parent layer. The number of values 

needs to equals NPLEND +1 minus NPLBEG. Values can be 1, which results in no vertical 

refinement for the layer, only in layers above the bottom of the child grid, unless the refinement 

extends all the way to the bottom of the parent model (see The Top and Bottom of the Child Grid 

section of Mehl and Hill, 2005). For refinement that does not extend to the bottom of the parent 

model, the refinement terminates at the shared node; for example, in Figure 5b of LGR 

documentation (Mehl and Hill, 2005) the values 5 3 would be needed. 

10
Appendix 2: LGR Input File for Multiple Refined Areas Example Shown in 

Figure 3 

The sample data inputs listed below are for the two-dimensional example described in the 

Multiple Refined Areas Example section of this report, and shown in Figure 3. This example has 

two local areas of refinement, both with 9:1 refinement ratios. The first area of refinement begins 

in layer 1, row 20, column 22 and ends in layer 1, row 31, column 39 of the parent grid. The 

second area of refinement begins layer 1, row 20, column 70 and ends in layer 1, row 31, column 

87. The annotated LGR input file is: 

LGR #LGR Keyword

3 #NGRIDS

parent.nam #NAME FILE

PARENTONLY #GRIDSTATUS

70 71 #Unit #’s for complementary and coupling B.C.

child1.nam #NAME FILE for the first child grid

CHILDONLY #GRIDSTATUS

1 -59 80 81 #ISHFLG, IBFLG, Unit #’s for complementary and coupling B.C.

15 0 #MXLGRITER, IOUTLGR

0.50 0.50 #RELAXH, RELAXF

1.0E-5 1.0E-5 #HCLOSELGR, FCLOSELGR

1 20 22 #Beginning layer, row, and column

1 31 39 #Ending layer, row, and column

9 #Horizontal refinement ratio

1 #Vertical refinement ratio by Parent layer

child2.nam #NAME FILE for the second child grid

CHILDONLY #GRIDSTATUS

1 -39 90 91 #ISHFLG, IBFLG, Unit #’s for complementary and coupling B.C.

15 0 #MXLGRITER, IOUTLGR

0.50 0.50 #RELAXH, RELAXF

1.0E-5 1.0E-5 #HCLOSELGR, FCLOSELGR

1 20 70 #Beginning layer, row, and column

1 31 87 #Ending layer, row, and column

9 #Horizontal refinement ratio

1 #Vertical refinement ratio by Parent layer

11
LGR Input File Showing Available Flexibility 

The sample data inputs listed below are for a three-dimensional example with two areas of 

refinement. This example demonstrates the available flexibility in that refinement ratios and 

convergence criteria can be different for each child grid. The first area of refinement begins in 

layer 1, row 20, column 22 and ends in layer 2, row 31, column 39 of the parent grid and uses a 9:1 

refinement ratio horizontally and a 5:1 ratio of refinement vertically. The second area of 

refinement begins layer 1, row 6, column 22 and ends in layer 2, row 17, column 39 and uses a 3:1 

refinement ratio horizontally and a 5:1 and 3:1 ratio of refinement vertically for the first and 

second parent layers, respectively. The annotated LGR input file is: 

LGR #LGR Keyword

3 #NGRIDS

ex2_parent.nam #NAME FILE

PARENTONLY #GRIDSTATUS

70 71 #Unit #’s for complementary and coupling B.C.

ex2_child1.nam #NAME FILE for the first child grid

CHILDONLY #GRIDSTATUS

1 -59 80 81 #ISHFLG, IBFLG, Unit #’s for complementary and coupling B.C.

25 -1 #MXLGRITER, IOUTLGR

0.50 0.50 #RELAXH, RELAXF

1.0E-5 1.0E-5 #HCLOSELGR, FCLOSELGR

1 20 22 #Beginning layer, row, and column

2 31 39 #Ending layer, row, and column

9 #Horizontal refinement ratio

5 5 #Vertical refinement ratio by Parent layer

ex2_child2.nam #NAME FILE for the second child grid

CHILDONLY #GRIDSTATUS

1 -39 90 91 #ISHFLG, IBFLG, Unit #’s for complementary and coupling B.C.

15 0 #MXLGRITER, IOUTLGR

0.40 0.30 #RELAXH, RELAXF

1.0E-4 1.0E-4 #HCLOSELGR, FCLOSELGR

1 6 22 #Beginning layer, row, and column

2 17 39 #Ending layer, row, and column

3 #Horizontal refinement ratio

5 3 #Vertical refinement ratio by Parent layer

12
13

LGR Output 

The output for each grid is the same as that shown by Mehl and Hill (2005, p. 56-58) for 

the case of a single refined area. 

Appendix 3: Variables added to LGR to Simulate Multiple Areas of 

Refinement 

Additional Variables in Fortran Module LGRMODULE 

There are three new variables in LGRMODULE. They are listed in Table 2. 

Table 2. Additional variables in Fortran module LGRMODULE. 

Variable Name Size Description 

NPLAY Scalar Number of layers in the parent grid 

IBSHRD Number of child boundary 

nodes 

Array of flags for the child interface cells that indicates if the cell is a shared 

node (IBSHRD = 1) or not (IBSHRD = 0). The index is defined by looping 

through the child interface cells in the order of columns, rows, and layers. 

IBPFLG Number of grids A list of IBOUND flags (IBFLG) used within this grid. 

Additional Variables in Fortran Module GWFBFHMODULE 

There are three new variables in GWFBFHMODULE. They are listed in Table 3. 

Table 3. Additional variables in Fortran module GWFBFHMODULE. 

Variable Name Size Description 

NGRIDS Scalar Number of grids simulated. 

IBSHRD Number of child boundary 

nodes 

Array of flags for the child interface cells that indicates if the cell is a shared 

node (IBSHRD = 1) or not (IBSHRD = 0). The index is defined by looping 

through the child interface cells in the order of columns, rows, and layers. 

IBPFLG Number of grids -1 A list of IBOUND flags (IBFLG) used within this grid.