[GRASS-user] The r.gmtg moduel for MODFLOW.

Hi

I just downloaded the r.gmtg module from
http://www.valledemexico.ambitiouslemon.com/gwmodelling.html for MODFLOW
integration within GRASS. However, I don't seem to understand how to
compile this module. I seem to understand that I should be using Gmake,
however, Debian doesn't seem to have such a package ...
What string should a give the compiler and what development packages
should be installed on my machine.

The above site is lacking documentation so I thought that some one in
the list might have had success with this in the past. I really keen to
get up and running with this

Cheers

Antonio
--
-------------------------------------
      Antonio Gennarini
  (Environmental Consultant)
-------------------------------------
ESI Ltd
Soil and Groundwater Specialists
New Zealand House
160, Abbey Foregate
Shrewsbury SY2 6FD
United Kingdom
Telephone: +44 (0)1743 276100 Direct Dial: +44 (0)1743 276145
Fax: +44 (0)1743 248600
Email antoniogennarini_AT_esinternational.com
<http://www.esinternational.com>

Antonio Gennarini wrote on 05/03/2007 10:17 AM:

Hi

I just downloaded the r.gmtg module from
http://www.valledemexico.ambitiouslemon.com/gwmodelling.html for MODFLOW
integration within GRASS. However, I don't seem to understand how to
compile this module. I seem to understand that I should be using Gmake,
  

If 'gmake' is asked, this indicates that the module was developed for
GRASS 4 or GRASS 5.
GRASS 6 is using the standard 'make'.

So you would need to write a new Makefile and most likely do other
changes in the source code to update it to GRASS 6.

however, Debian doesn't seem to have such a package ...
What string should a give the compiler and what development packages
should be installed on my machine.

The above site is lacking documentation so I thought that some one in
the list might have had success with this in the past. I really keen to
get up and running with this

Please contact the author for this.

Markus

------------------
ITC -> dall'1 marzo 2007 Fondazione Bruno Kessler
ITC -> since 1 March 2007 Fondazione Bruno Kessler
------------------

Antonio Gennarini wrote:

I just downloaded the r.gmtg module from
http://www.valledemexico.ambitiouslemon.com/gwmodelling.html for
MODFLOW integration within GRASS. However, I don't seem to understand
how to compile this module. I seem to understand that I should be
using Gmake, however, Debian doesn't seem to have such a package ...
What string should a give the compiler and what development packages
should be installed on my machine.

from the web page:
"The current version works with GRASS 5.4 and MODFLOW 96 (a recent
version, not the one from 1996) but current work is being done to
develop a new version for GRASS 6.0 and MODFLOW 2000."

"Gmakefile" was the name for GRASS 5 makefiles, to compile a module you
would run gmake5 instead of "make". In GRASS 6 it now uses normal
"make", but this means you need to use a normal Makefile too.

So you will need to port the module to GRASS 6 by writing a new Makefile
for it.

First you need to build all of grass from source code to get the correct
build environment set up.

- put the r.gmtg code into the raster/ dir in the grass source.
- copy a Makefile from another raster module into raster/r.gmtg dir.
  try to take it from a raster with similar needs (eg vector lib
  support?)
- edit the Makefile for the module name.
- move r.gmtg.html to r.gmtg/description.html
- run "make" in the raster/r.gmtg dir.

Because it uses FORTRAN, maybe rewriting the Makefile is difficult
without more help and you should just try building it with the old GRASS
5.4 for which it was written? (ie I'm no make expert)

In GRASS 6 there is a new "GEM" system for building modules without
first having to build all of grass yourself:
  http://grass.ibiblio.org/grass63/manuals/html63_user/gem/index.html

I see r.gmtg is for ground water flow modelling (MODFLOW). Maybe Soeren
has some new and interesting module for GRASS 6.3 you could try?

Hamish

Hi,

Hamish schrieb:

Antonio Gennarini wrote:

I just downloaded the r.gmtg module from
http://www.valledemexico.ambitiouslemon.com/gwmodelling.html for
MODFLOW integration within GRASS. However, I don't seem to understand
how to compile this module. I seem to understand that I should be
using Gmake, however, Debian doesn't seem to have such a package ... What string should a give the compiler and what development packages
should be installed on my machine.

.....

I see r.gmtg is for ground water flow modelling (MODFLOW). Maybe Soeren
has some new and interesting module for GRASS 6.3 you could try?

There is a module called r.gwflow in CVS, but it is not that powerful
as MODFLOW. E.g: Leakage/Cauchy boundary conditions are missing.
Two scripts are included in the source directory which will help to understand
how to use this module.

If you want to try it, you need to check out the latest cvs version.
And there is currently no guarantee of correct calculation.

This is a sample script (included in the sources) computing steady state, unconfined
groundwater flow:

#!/bin/sh
# Shell script to verify r.gwflow calculation, this calculation is based on
# the example at page 167 of the following book:
# author = "Kinzelbach, W. and Rausch, R.",
# title = "Grundwassermodellierung",
# publisher = "Gebr{\"u}der Borntraeger (Berlin, Stuttgart)",
# year = "1995"
#
# set the region
g.region res=50 n=950 s=0 w=0 e=2000

r.mapcalc "phead= if(row() == 19, 5, 3)"
r.mapcalc "status=if((col() == 1 && row() == 13) ||\
                      (col() == 1 && row() == 14) ||\
                      (col() == 2 && row() == 13) ||\
                      (col() == 2 && row() == 14) ||\
                      (row() == 19), 2, 1)"

r.mapcalc "well=0.0"
r.mapcalc "hydcond=0.001"
r.mapcalc "reacharge=0.000000006"
r.mapcalc "top=20"
r.mapcalc "bottom=0"
r.mapcalc "syield=0.001"
r.mapcalc "null=0.0"

#compute a steady state groundwater flow
r.gwflow --o -s solver=cg top=top bottom=bottom phead=phead \
  status=status hc_x=hydcond hc_y=hydcond q=well s=syield \
  r=reacharge output=gwresult dt=864000000000 type=unconfined

# create contour lines
r.contour input=gwresult output=gwresult_contour step=0.2 --o
#create flow lines
r.flow elevin=gwresult flout=gwresult_flow skip=3 --o

#create the visualization
d.mon start=x0
d.mon select=x0
d.erase
d.rast gwresult
d.vect gwresult_flow render=l color=grey
d.vect gwresult_contour render=l color=black display=attr,shape attrcol=level lsize=16 lcolor=black
d.legend at=8,12,15,85 map=gwresult
d.barscale at=1,10
echo "Groundwater flow steady state" | d.text size=6 color=black

best regards
Soeren

Well, as it has already been said, gmake is provided by compiling grass5.4 from source.
The web page contains both the GRASS module and a modified version of MODFLOW-96. The grass module is installed using gmake while MODFLOW needs to be compiled separately.
As pointed out on the module’s web page, I’m planning to update it MODFLOW 2000 and GRASS 6*. Unfortunately I haven’t had much free time in order to do this, but I’ll manage to finish within the next month. The main difference is regarding well data, as the current version reads GRASS 5.4 site files and it needs to be changed to read GRASS 6* vector files. I’ve already done this, but still the module needs some polishing as I want it to be able to determine from which model layer the wells are extracting (injecting) water from, based on the well’s screen depth.
the module is described in a paper published in computers and geosciences (which I can e-mail in case someone interested can’t access it):

http://dx.doi.org/10.1016/j.cageo.2005.06.018

A tutorial on r.gmtg is available here:
http://www.valledemexico.ambitiouslemon.com/gwmodelling/tutorial1.pdf

Jaime


Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/

Well, as it has already been said, gmake is provided by compiling grass5.4 from source.
The web page contains both the GRASS module and a modified version of MODFLOW-96. The grass module is installed using gmake while MODFLOW needs to be compiled separately.
As pointed out on the module’s web page, I’m planning to update it MODFLOW 2000 and GRASS 6*. Unfortunately I haven’t had much free time in order to do this, but I’ll manage to finish within the next month. The main difference is regarding well data, as the current version reads GRASS 5.4 site files and it needs to be changed to read GRASS 6* vector files. I’ve already done this, but still the module needs some polishing as I want it to be able to determine from which model layer the wells are extracting (injecting) water from, based on the well’s screen depth.
the module is described in a paper published in computers and geosciences (which I can e-mail in case someone interested can’t access it):

http://dx.doi.org/10.1016/j.cageo.2005.06.018

A tutorial on r.gmtg is available here:
http://www.valledemexico.ambitiouslemon.com/gwmodelling/tutorial1.pdf

Jaime


Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.espanol.yahoo.com/