Skip to content

Commit

Permalink
Reverted to beta - added start time-of-day
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-boon committed Dec 6, 2018
1 parent a55a227 commit 3fdeb14
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.Macintosh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Building n on macOS-X requires :

3) If you want to use gfortran, make sure you have at least version 8.2. For MacPorts use :

sudo port install gcc-8
sudo port install gcc8
sudo port select gcc mp-gcc8

For homebrew
Expand Down
9 changes: 6 additions & 3 deletions build_glm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ if [ "$FC" = "" ] ; then
if [ $? != 0 ] ; then
export FC=ifort
else
export FC=gfortran
VERS=`gfortran -dumpversion | cut -d\. -f1`
if [ $VERS -ge 8 ] ; then
export FC=gfortran
else
export FC=ifort
fi
fi
else
export FC=gfortran-8
Expand Down Expand Up @@ -167,8 +172,6 @@ make || exit 1

cd ${CURDIR}

/bin/rm src/glm src/glm+

make || exit 1
if [ -d ${AED2PLS} ] ; then
make glm+ || exit 1
Expand Down
15 changes: 3 additions & 12 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
glm (3.0.0rc2-0) UNRELEASED; urgency=low
glm (3.0.0beta10-0) UNRELEASED; urgency=low

[ Casper Boon ]
* new version 3.0.0beta1
* new version 3.0.0beta2
* new version 3.0.0beta3
* new version 3.0.0beta4
* new version 3.0.0beta5
* new version 3.0.0beta6
* new version 3.0.0beta7
* new version 3.0.0beta8
* new version 3.0.0beta9
* new version 3.0.0rc1
* new version 3.0.0rc2
* new version 3.0.0beta10

-- Casper Boon <casper@shark> Fri, 30 Nov 2018 08:45:45 +0800
-- Casper Boon <casper@eridanus.aed-net.science.uwa.edu.au> Thu, 06 Dec 2018 12:28:55 +0800

glm (2.4.1-0) UNRELEASED; urgency=low

Expand Down
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=2017
version=3.0.0rc2
version=3.0.0beta10
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.0.0rc2"
#define GLM_VERSION "3.0.0beta10"

#define POINT 0
#define Z_SHAPE 1
Expand Down
13 changes: 8 additions & 5 deletions src/glm_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,11 @@ extern AED_REAL seepage_rate;
char glm_nml_file[256] = DEFAULT_GLM_NML;
char wq_lib[256] = DEFAULT_WQ_LIB;

extern int START_TOD;

static void create_lake(int namlst);
static void initialise_lake(int namlst);
static int init_time(char *start, char *stop, int timefmt, int *nDays);
static int init_time(const char *start, char *stop, int timefmt, int *startTOD, int *nDays);

/*############################################################################*/

Expand Down Expand Up @@ -930,7 +932,7 @@ for (i = 0; i < n_zones; i++) {

if ( timefmt != 2 ) *stop = 0;

julianday = init_time(start, stop, timefmt, &nDays);
julianday = init_time(start, stop, timefmt, &START_TOD, &nDays);
free(stop);
calendar_date(julianday, &jyear, &jmonth, &jday);
//# Days since start of the year, jyear
Expand Down Expand Up @@ -1436,9 +1438,9 @@ void initialise_lake(int namlst)
#define INIT_T_BEGIN_END 2
#define INIT_T_BEGIN_STEP 3

static int init_time(char *start, char *stop, int timefmt, int *nDays)
static int init_time(const char *start, char *stop, int timefmt, int *startTOD, int *nDays)
{
int jul1=0, secs1=0, jul2, secs2;
int jul1=0, secs1=0, jul2, secs2=0;
int nsecs;

switch (timefmt) {
Expand All @@ -1456,7 +1458,7 @@ static int init_time(char *start, char *stop, int timefmt, int *nDays)

*nDays = jul2-jul1;
if (nsecs < 86400 && jul1 != jul2) nDays = nDays-1;
nsecs = nsecs - 86400*(*nDays);
// CAB - usless code? nsecs = nsecs - 86400*(*nDays);
break;
case INIT_T_BEGIN_STEP:
read_time_string(start, &jul1, &secs1);
Expand All @@ -1473,6 +1475,7 @@ static int init_time(char *start, char *stop, int timefmt, int *nDays)
break;
}

*startTOD = secs1; /* also return time of day for first day */
return jul1;
}
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
8 changes: 6 additions & 2 deletions src/glm_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ int do_subdaily_loop(int stepnum, int jday, int nsave, AED_REAL SWold, AED_REAL

//int n_steps_done = 0;
//#define END_STEPS 30
static int START_ICLOCK = 0;
int START_TOD = 0;


/******************************************************************************
Expand Down Expand Up @@ -152,6 +154,7 @@ void init_model(int *jstart, int *nsave)
#endif

init_glm(jstart, out_dir, out_fn, nsave);
START_ICLOCK = (START_TOD + (timestep-1)) / timestep;

#if PLOTS
psubday = timestep * (*nsave) / SecsPerDay;
Expand Down Expand Up @@ -630,7 +633,7 @@ void calc_mass_temp(const char *msg)
******************************************************************************/
int do_subdaily_loop(int stepnum, int jday, int nsave, AED_REAL SWold, AED_REAL SWnew)
{
int iclock = 0; //# The seconds counter during a day
int iclock; //# The seconds counter during a day
AED_REAL Light_Surface; //# Light at the surface of the lake after do_surface

noSecs = timestep;
Expand All @@ -639,7 +642,8 @@ int do_subdaily_loop(int stepnum, int jday, int nsave, AED_REAL SWold, AED_REAL
/**************************************************************************
* Loop for each second in a day (86400 = #seconds in a day) *
**************************************************************************/
iclock = 0;
iclock = START_ICLOCK;
START_ICLOCK = 0; /* from now on start at the beginning of the day */
Benthic_Light_pcArea = 0.;
while (iclock < iSecsPerDay) { //# iclock = seconds counter
if ( subdaily ) {
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,0,0rc2
PRODUCTVERSION 3,0,0rc2
FILEVERSION 3,0,0beta10
PRODUCTVERSION 3,0,0beta10
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.0.0rc2
VALUE "FileVersion", 3.0.0beta10
VALUE "InternalName", "version.rc"
VALUE "LegalCopyright", "Copyright (C) 2018"
VALUE "OriginalFilename", "version.rc"
VALUE "ProductName", "GLM+"
VALUE "ProductVersion", 3.0.0rc2
VALUE "ProductVersion", 3.0.0beta10
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,0,0rc2
PRODUCTVERSION 3,0,0rc2
FILEVERSION 3,0,0beta10
PRODUCTVERSION 3,0,0beta10
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.0.0rc2
VALUE "FileVersion", 3.0.0beta10
VALUE "InternalName", "version.rc"
VALUE "LegalCopyright", "Copyright (C) 2018"
VALUE "OriginalFilename", "version.rc"
VALUE "ProductName", "GLM"
VALUE "ProductVersion", 3.0.0rc2
VALUE "ProductVersion", 3.0.0beta10
END
END
BLOCK "VarFileInfo"
Expand Down

0 comments on commit 3fdeb14

Please sign in to comment.