[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203
Stephane Popinet
popinet at users.sf.net
Fri May 15 02:56:04 UTC 2009
The following commit has been merged in the upstream branch:
commit 88454f6cc0c9bb9034ccceead4b4217ce6c31e41
Author: Stephane Popinet <popinet at users.sf.net>
Date: Tue May 6 09:11:31 2008 +1000
Added GFS_FES2004 environment variable
darcs-hash:20080505231131-d4795-737c18b8c462592fe7d7946d8103f4dfe59861fd.gz
diff --git a/modules/tide.mod b/modules/tide.mod
index f7aec29..15d8ffa 100644
--- a/modules/tide.mod
+++ b/modules/tide.mod
@@ -21,6 +21,7 @@
#include <string.h>
#include <errno.h>
#include <time.h>
+#include <stdlib.h>
#include "fes2004/fes2004_lib.h"
#include "gfsconfig.h"
#include "variable.h"
@@ -168,10 +169,14 @@ static void bc_tide_read (GtsObject ** o, GtsFile * fp)
}
else {
/* extract FES2004 tidal coefficients */
- gchar * fname = g_strjoin ("/", GFS_MODULES_DIR, "tide.fes2004.nc", NULL);
+ gchar * fname = getenv ("GFS_FES2004") ?
+ g_strdup (getenv ("GFS_FES2004"))
+ :
+ g_strjoin ("/", GFS_MODULES_DIR, "tide.fes2004.nc", NULL);
FILE * f = fopen (fname, "r");
if (f == NULL) {
gts_file_error (fp, "cannot open file `%s': %s", fname, strerror (errno));
+ g_free (fname);
return;
}
fclose (f);
@@ -187,6 +192,7 @@ static void bc_tide_read (GtsObject ** o, GtsFile * fp)
fes2004_extraction (fname, N, lat, lon, bc->amplitude, bc->phase, 1);
+ g_free (fname);
g_free (lon);
g_free (lat);
}
--
Gerris Flow Solver
More information about the debian-science-commits
mailing list