Skip to content

Commit

Permalink
fix segfault when processing inflow_update
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-boon committed Mar 15, 2023
1 parent e8e02cb commit 0768d79
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 21 deletions.
5 changes: 3 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
glm (3.3.1a6-0) UNRELEASED; urgency=low
glm (3.3.1a7-0) UNRELEASED; urgency=low

* new version 3.2.0a1
* new version 3.2.0a8
Expand All @@ -18,8 +18,9 @@ glm (3.3.1a6-0) UNRELEASED; urgency=low
* new version 3.3.1a4
* new version 3.3.1a5
* new version 3.3.1a6
* new version 3.3.1a7

-- Casper Boon <hydro@AED.UWA> Wed, 22 Feb 2023 10:30:28 +0800
-- Casper Boon <casper@oldmail.local.ambinet.com.au> Wed, 15 Mar 2023 11:59:18 +0800

glm (3.1.0-0) UNRELEASED; urgency=low

Expand Down
9 changes: 0 additions & 9 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,3 @@ Depends: ${misc:Depends},
libgd-dev
Description: General Lake Model
Model the bio-geo-chemical processes in lakes.

Package: glm+
Architecture: any
Depends: ${misc:Depends},
libgfortran-8-dev,
libnetcdff-dev,
libgd-dev
Description: General Lake Model Plus
Advanced modelling of the bio-geo-chemical processes in lakes.
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package=glm
year=2021
version=3.3.1a6
version=3.3.1a7
release=0.0

#export DH_VERBOSE=1
Expand Down
2 changes: 1 addition & 1 deletion src/glm.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#endif
#define USE_FILLVALUE 1

#define GLM_VERSION "3.3.1a6"
#define GLM_VERSION "3.3.1a7"

#define POINT 0
#define Z_SHAPE 1
Expand Down
6 changes: 6 additions & 0 deletions src/glm_wqual.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ void dummyZSoilTemp(ZoneType *zone)
{
}
#endif
static void dummy_inflow_update(AED_REAL *wqinf, int *nwqVars, AED_REAL *temp, AED_REAL *salt)
{
}

/******************************************************************************
* *
Expand Down Expand Up @@ -138,6 +141,7 @@ int prime_wq(const char *which)
p_wq_set_glm_zones = (wq_set_glm_zones_t) find_entry(glm_wq_handle, "wq_set_glm_zones");
p_wq_ZSoilTemp = (wq_ZSoilTemp_t) find_entry(glm_wq_handle, "zZSoilTemp");
if ( p_wq_ZSoilTemp == NULL ) p_wq_ZSoilTemp = (wq_ZSoilTemp_t) dummyZSoilTemp;
p_wq_inflow_update = (wq_inflow_update_t) find_entry(glm_wq_handle, "wq_inflow_update");
#ifdef _WIN32
p_set_funcs = (set_funcs_t) find_entry(glm_wq_handle, "set_funcs");

Expand Down Expand Up @@ -193,6 +197,7 @@ int prime_wq(const char *which)
p_wq_var_index_c = (wq_var_index_c_t) aed_var_index_c;
p_wq_set_flags = (wq_set_flags_t) aed_set_flags;
p_wq_is_var = (wq_is_var_t) aed_is_var;
p_wq_inflow_update = (wq_inflow_update_t) aed_update_inflow_wq;
#else
fprintf(stderr, "AED not supported in this build\n");
exit(1);
Expand All @@ -201,6 +206,7 @@ int prime_wq(const char *which)
p_wq_ZSoilTemp = (wq_ZSoilTemp_t) zZSoilTemp;
}
#endif
if ( p_wq_inflow_update == NULL ) p_wq_inflow_update = (wq_inflow_update_t) dummy_inflow_update;

// This is weird. Comment out the debug fprintf below and the flags come out wrong, leave the debug in and
// they are OK ....
Expand Down
8 changes: 4 additions & 4 deletions win/glm+.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ END

//==============================================================================
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,3,1,0xa6
PRODUCTVERSION 3,3,1,0xa6
FILEVERSION 3,3,1,0xa7
PRODUCTVERSION 3,3,1,0xa7
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "AED Group; University of Western Australia"
VALUE "FileDescription", "General Lake Model (GLM) with AED+"
VALUE "FileVersion", "3.3.1a6 \0"
VALUE "FileVersion", "3.3.1a7 \0"
VALUE "InternalName", "version.rc"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "version.rc"
VALUE "ProductName", "GLM+"
VALUE "ProductVersion", "3.3.1a6 \0"
VALUE "ProductVersion", "3.3.1a7 \0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions win/glm.rc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ END

//==============================================================================
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,3,1,0xa6
PRODUCTVERSION 3,3,1,0xa6
FILEVERSION 3,3,1,0xa7
PRODUCTVERSION 3,3,1,0xa7
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -45,12 +45,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "AED Group; University of Western Australia"
VALUE "FileDescription", "General Lake Model (GLM)"
VALUE "FileVersion", "3.3.1a6 \0"
VALUE "FileVersion", "3.3.1a7 \0"
VALUE "InternalName", "version.rc"
VALUE "LegalCopyright", "Copyright (C) 2023"
VALUE "OriginalFilename", "version.rc"
VALUE "ProductName", "GLM"
VALUE "ProductVersion", "3.3.1a6 \0"
VALUE "ProductVersion", "3.3.1a7 \0"
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 0768d79

Please sign in to comment.