...
 
Commits (3)
syntax: glob
# MADS files
*.mod
*/wells
*/wells_hw_exp
*/wells_hw_exp2
......
This diff is collapsed.
!**************************************************************************************
MODULE constants_NSWC
! Contains the NSWC functions IPMPAR, SPMPAR, DPMPAR, EPSLN, DEPSLN,
! EXPARG & DXPARG
!-----------------------------------------------------------------------
! WRITTEN using F90 intrinsics by
! Alan Miller
! CSIRO Mathematical & Information Sciences
! CLAYTON, VICTORIA, AUSTRALIA 3169
! Latest revision - 1 February 1997
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(15, 60)
CONTAINS
FUNCTION ipmpar (i) RESULT(fn_val)
!-----------------------------------------------------------------------
! IPMPAR PROVIDES THE INTEGER MACHINE CONSTANTS FOR THE COMPUTER
! THAT IS USED. IT IS ASSUMED THAT THE ARGUMENT I IS AN INTEGER
! HAVING ONE OF THE VALUES 1-10. IPMPAR(I) HAS THE VALUE ...
! INTEGERS.
! ASSUME INTEGERS ARE REPRESENTED IN THE N-DIGIT, BASE-A FORM
! SIGN ( X(N-1)*A**(N-1) + ... + X(1)*A + X(0) )
! WHERE 0 .LE. X(I) .LT. A FOR I=0,...,N-1.
! IPMPAR(1) = A, THE BASE (radix).
! IPMPAR(2) = N, THE NUMBER OF BASE-A DIGITS (digits).
! IPMPAR(3) = A**N - 1, THE LARGEST MAGNITUDE (huge).
! FLOATING-POINT NUMBERS.
! IT IS ASSUMED THAT THE SINGLE AND DOUBLE PRECISION FLOATING
! POINT ARITHMETICS HAVE THE SAME BASE, SAY B, AND THAT THE
! NONZERO NUMBERS ARE REPRESENTED IN THE FORM
! SIGN (B**E) * (X(1)/B + ... + X(M)/B**M)
! WHERE X(I) = 0,1,...,B-1 FOR I=1,...,M,
! X(1) .GE. 1, AND EMIN .LE. E .LE. EMAX.
! IPMPAR(4) = B, THE BASE.
! SINGLE-PRECISION
! IPMPAR(5) = M, THE NUMBER OF BASE-B DIGITS.
! IPMPAR(6) = EMIN, THE SMALLEST EXPONENT E.
! IPMPAR(7) = EMAX, THE LARGEST EXPONENT E.
! DOUBLE-PRECISION
! IPMPAR(8) = M, THE NUMBER OF BASE-B DIGITS.
! IPMPAR(9) = EMIN, THE SMALLEST EXPONENT E.
! IPMPAR(10) = EMAX, THE LARGEST EXPONENT E.
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: i
INTEGER :: fn_val
SELECT CASE(i)
CASE( 1)
fn_val = RADIX(i)
CASE( 2)
fn_val = DIGITS(i)
CASE( 3)
fn_val = HUGE(i)
CASE( 4)
fn_val = RADIX(1.0)
CASE( 5)
fn_val = DIGITS(1.0)
CASE( 6)
fn_val = MINEXPONENT(1.0)
CASE( 7)
fn_val = MAXEXPONENT(1.0)
CASE( 8)
fn_val = DIGITS(1.0D0)
CASE( 9)
fn_val = MINEXPONENT(1.0D0)
CASE(10)
fn_val = MAXEXPONENT(1.0D0)
CASE DEFAULT
RETURN
END SELECT
RETURN
END FUNCTION ipmpar
FUNCTION spmpar (i) RESULT(fn_val)
!-----------------------------------------------------------------------
! SPMPAR PROVIDES THE SINGLE PRECISION MACHINE CONSTANTS FOR
! THE COMPUTER BEING USED. IT IS ASSUMED THAT THE ARGUMENT
! I IS AN INTEGER HAVING ONE OF THE VALUES 1, 2, OR 3. IF THE
! SINGLE PRECISION ARITHMETIC BEING USED HAS M BASE B DIGITS AND
! ITS SMALLEST AND LARGEST EXPONENTS ARE EMIN AND EMAX, THEN
! SPMPAR(1) = B**(1 - M), THE MACHINE PRECISION,
! SPMPAR(2) = B**(EMIN - 1), THE SMALLEST MAGNITUDE,
! SPMPAR(3) = B**EMAX*(1 - B**(-M)), THE LARGEST MAGNITUDE.
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: i
REAL :: fn_val
! Local variable
REAL :: one = 1.0
SELECT CASE (i)
CASE (1)
fn_val = EPSILON(one)
CASE (2)
fn_val = TINY(one)
CASE (3)
fn_val = HUGE(one)
END SELECT
RETURN
END FUNCTION spmpar
FUNCTION dpmpar (i) RESULT(fn_val)
!-----------------------------------------------------------------------
! DPMPAR PROVIDES THE DOUBLE PRECISION MACHINE CONSTANTS FOR
! THE COMPUTER BEING USED. IT IS ASSUMED THAT THE ARGUMENT
! I IS AN INTEGER HAVING ONE OF THE VALUES 1, 2, OR 3. IF THE
! DOUBLE PRECISION ARITHMETIC BEING USED HAS M BASE B DIGITS AND
! ITS SMALLEST AND LARGEST EXPONENTS ARE EMIN AND EMAX, THEN
! DPMPAR(1) = B**(1 - M), THE MACHINE PRECISION,
! DPMPAR(2) = B**(EMIN - 1), THE SMALLEST MAGNITUDE,
! DPMPAR(3) = B**EMAX*(1 - B**(-M)), THE LARGEST MAGNITUDE.
!-----------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: i
REAL (dp) :: fn_val
! Local variable
REAL (dp) :: one = 1._dp
SELECT CASE (i)
CASE (1)
fn_val = EPSILON(one)
CASE (2)
fn_val = TINY(one)
CASE (3)
fn_val = HUGE(one)
END SELECT
RETURN
END FUNCTION dpmpar
FUNCTION epsln () RESULT(fn_val)
!--------------------------------------------------------------------
! THE EVALUATION OF LN(EPS) WHERE EPS IS THE SMALLEST NUMBER
! SUCH THAT 1.0 + EPS .GT. 1.0 . L IS A DUMMY ARGUMENT.
!--------------------------------------------------------------------
IMPLICIT NONE
REAL :: fn_val
! Local variable
REAL :: one = 1.0
fn_val = LOG( EPSILON(one) )
RETURN
END FUNCTION epsln
FUNCTION exparg (l) RESULT(fn_val)
!--------------------------------------------------------------------
! IF L = 0 THEN EXPARG(L) = THE LARGEST POSITIVE W FOR WHICH
! EXP(W) CAN BE COMPUTED.
!
! IF L IS NONZERO THEN EXPARG(L) = THE LARGEST NEGATIVE W FOR
! WHICH THE COMPUTED VALUE OF EXP(W) IS NONZERO.
!
! NOTE... ONLY AN APPROXIMATE VALUE FOR EXPARG(L) IS NEEDED.
!--------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: l
REAL :: fn_val
! Local variable
REAL :: one = 1.0
IF (l == 0) THEN
fn_val = LOG( HUGE(one) )
ELSE
fn_val = LOG( TINY(one) )
END IF
RETURN
END FUNCTION exparg
FUNCTION depsln () RESULT(fn_val)
!--------------------------------------------------------------------
! THE EVALUATION OF LN(EPS) WHERE EPS IS THE SMALLEST NUMBER
! SUCH THAT 1.D0 + EPS .GT. 1.D0 . L IS A DUMMY ARGUMENT.
!--------------------------------------------------------------------
IMPLICIT NONE
REAL (dp) :: fn_val
! Local variable
REAL (dp) :: one = 1._dp
fn_val = LOG( EPSILON(one) )
RETURN
END FUNCTION depsln
FUNCTION dxparg (l) RESULT(fn_val)
!--------------------------------------------------------------------
! IF L = 0 THEN DXPARG(L) = THE LARGEST POSITIVE W FOR WHICH
! DEXP(W) CAN BE COMPUTED.
!
! IF L IS NONZERO THEN DXPARG(L) = THE LARGEST NEGATIVE W FOR
! WHICH THE COMPUTED VALUE OF DEXP(W) IS NONZERO.
!
! NOTE... ONLY AN APPROXIMATE VALUE FOR DXPARG(L) IS NEEDED.
!--------------------------------------------------------------------
IMPLICIT NONE
INTEGER, INTENT(IN) :: l
REAL (dp) :: fn_val
! Local variable
REAL (dp) :: one = 1._dp
IF (l == 0) THEN
fn_val = LOG( HUGE(one) )
ELSE
fn_val = LOG( TINY(one) )
END IF
RETURN
END FUNCTION dxparg
END MODULE constants_NSWC
This diff is collapsed.
PROG = wells
# SPECIFY THE "C" and "Fortran" compilers
# Program needs GSLIB Library. Please specify the correct path where
# these libraries are installed.
ifeq ($(OSTYPE),linux)
ifeq ($(LANL_ROOT),/usr/lanl)
DIRS = -I/home/monty/local/include/ -L/home/monty/local/lib
GFORTRAN = /usr/lanl/bin/gfortran
CC = /usr/lanl/bin/gcc
LG = -lgfortran
else
DIRS = -I/usr/local/include/ -L/usr/local/lib
CC = gcc
LG = -lgfortran
endif
else
DIRS = -I/usr/local/include/ -L/usr/local/lib
CC = gcc
GFORTRAN = gfortran
endif
# Following flags are valid for gfortran 4.6 or higher
# CFLAGS = -O3 -msse2 -ftree-vectorize -ftree-vectorizer-verbose=4 -ffast-math -Wall $(DIRS)
CFLAGS = -static -Wall $(DIRS)
LDLIBS = -lgsl -lm -lgslcblas $(DIRS)
OBJ = wells.o invlap-lib.o complex_bessels.o
MOD = complex_bessel.mod
SOURCE = $(OBJ:%.o=%.c)
SOURCESTYLE = $(OBJ:%.o=%.c)
$(PROG): $(OBJ)
$(GFORTRAN) $(OBJ) -o wells $(LDLIBS)
wells.o: wells.c wells.h design.h
invlap-lib.o: invlap-lib.c wells.h design.h
complex_bessel.mod: complex_bessels.f90
complex_bessels.o: complex_bessels.f90
$(GFORTRAN) -c complex_bessels.f90
clean:
rm -f $(OBJ) $(MOD)
cleaner:
rm -f $(PROG) $(OBJ) $(MOD)
astyle:
astyle $(SOURCESTYLE)
rm -f $(SOURCESTYLE:%c=%c.orig)
tar:
tar -cvzf wells.tgz `hg st -c -m | awk '{print $$2}'` `find . \( -name "*.[ch]" -o -name "[Mm]akef*" -name "[Rr]eadme" \) -print | sed 's/\.\///'` .hg
tarf:
tar -cvzf wells.tgz `hg st -c -m | awk '{print $$2}'` `find . \( -name "*.[ch]" -o -name "[Mm]akef*" -name "[Rr]eadme" \) -print | sed 's/\.\///'`
PROG = wells
#CFLAGS = -Wall -I/home/monty/local/include
LDLIBS = -lm
OBJS = $(PROG).o
$(PROG) : $(OBJS)
clean:
rm -f $(PROG) $(OBJS)
This code computes drawdown due to pumping at multiple wells and a linear temporal trend.
The code expects consistent length and time units for all the parameters.
To compile:
A makefile is provided; typing make in this folder on Linux machines should produce the executable.
Otherwise, the following commands can be entered at the prompt:
cc wells.c -lm -o wells
substituting an appropriate compiler if cc is not available.
Example:
A simple example input file is provided.
Two pumping wells and one observation well are included.
To test the example, enter:
wells ex01.wells
at the prompt. If successful, the output file 'ex01.s_point' and a debug file 'ex01.wells_debug' will be created.
More elaborate examples can be created by modifying 'ex01.wells'. Comments in 'ex01.wells' provide information about
the input parameters.
\ No newline at end of file
Problem name: test
Aquifer type : 1
Boundary information: 1 1 0 0 0
--- Number of wells: 2
P1 0 0 0.5 10
Initial Head : 1000
Aquifer thickness : 1
Permeability : 3.0 1.0
Storage coefficient : -1.5 1.0
Leakage coefficient : -10
1 3000
2 0
3 3000
4 0
5 3000
6 0
7 3000
8 0
9 3000
10 0
P2 10 10 0.5 5
Initial Head : 900
Aquifer thickness : 1
Permeability : 4.0 1.0
Storage coefficient : -1.5 1.0
Leakage coefficient : -10
1 0
4 4000
6 0
8 4000
10 0
--- Number of points: 1
M1 0 10 10
Initial Head : 950
Temporal trend : -3.0
1
2
3
4
5
6
7
8
9
10
This diff is collapsed.
#define MAXNAME 1024
#define MAXFILENAME 1024
#define TRUE 1
#define FALSE 0
#define YES 1
#define NO 0
#define READ 0
#define WRITE 1
#define APPEND 2
enum AQUIFER_TYPE {CONFINED = 1, UNCONFINED, LEAKY, LEAKY_UNCONFINED};
enum BOUNDARY_TYPE {NO_BOUNDARY = 1, TYPE_1, TYPE_2};
struct Problem_Info
{
char file[MAXFILENAME];
char name[MAXNAME];
};
struct Aquifer_Data
{
int co_aquifer;
int co_x_axis;
int co_y_axis;
double origin_x;
double origin_y;
double origin_angle;
double h;
double m;
double **kobs;
double **k2obs;
double **kprod;
double **Sobs;
double **S2obs;
double **Sprod;
double B;
};
struct Well_Data
{
int nW;
char **id;
double *x;
double *y;
double *r;
double *h;
int *nQ;
double **Q;
double **t;
double **s;
double *m;
double *k;
double *k2;
double *S;
double *S2;
double *B;
double *sw;
int *kfcn;
int *Sfcn;
};
struct Point_Data
{
int nP;
char **id;
double *x;
double *y;
double *h;
double *c0;
double *c1;
int *nT;
double **t;
double **s;
int trnd;
};
struct Grid_Data
{
int nx; int ny;
double xmin; double xmax;
double ymin; double ymax;
};