From 5f6fdd14e830c3c9337a74c1f6fd2a25d740570e Mon Sep 17 00:00:00 2001
From: Dorchies David <david.dorchies@irstea.fr>
Date: Thu, 12 Nov 2020 16:31:41 +0100
Subject: [PATCH] fix: Crash with 1000 years database

- Add details for 64 bits compilation and debugging in REAMD.md

Fix #5
---
 README.md       | 5 +++++
 src/DECLARA.PAS | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 053ae3d..fb27ed3 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,7 @@ VGEST is software developped in Pascal by Jean-Claude Bader [^Bader2016]. It ser
 VGEST has only been tested on Windows XP or superior.
 
 * Download Free Pascal I386 for Windows 32 bits: https://www.freepascal.org/down/i386/win32.html
+* For compilation in 64 bits, download the x86_64 cross compiler: https://www.freepascal.org/down/x86_64/win64.var
 * Install it by running the downloaded executable
 
 ## Compilation
@@ -20,6 +21,10 @@ C:\FPC\bin\i386-win32\fpc.exe src\ENDE.PAS && move /Y src\ENDE.exe .
 C:\FPC\bin\i386-win32\fpc.exe src\REGLAGE.PAS && move /Y src\REGLAGE.exe .
 ```
 
+For 64 bits compilation, add `-Px86_64` parameter between `fpc.exe`  and the source file on each line.
+
+For debugging, in case of a crash of the application, add the parameter `-gl` to the compilation command line in order to get the file and the line number where the crash occurs.
+
 ## Get started with the example
 
 The `example` directory contains all the configuration for calculating statistics about respecting a maximum flow of 110 m<sup>3</sup>/s at Paris. These statistics are calculated from the Seine River Basin naturalised flow database between 1993/01/01 and 2009/12/31 [^Hydratec2011].
diff --git a/src/DECLARA.PAS b/src/DECLARA.PAS
index 02a9919..76ab027 100644
--- a/src/DECLARA.PAS
+++ b/src/DECLARA.PAS
@@ -13,7 +13,7 @@ CONST  {valeurs}
  YInterpolPermi= true;     {pour autoriser reconst des lacunes isol‚es de d‚bits stations}
  YLacune       = -99;      {code lacune de d‚bit}
  YNbfreq       = 8;
- YNbmaxAn      = 250;      {nombre maximal d'ann‚es pouvant ˆtre trait‚es dans le calcul … rebours}
+ YNbmaxAn      = 10000;      {nombre maximal d'ann‚es pouvant ˆtre trait‚es dans le calcul … rebours}
  YNbmaxIter    = 400;      {nombre max d'it‚rations pour obtenir la norme de d‚bit stock‚ … r‚partir}
  YNbmaxIterVol = 100;      {nombre max d'it‚rations pour obtention des bons volumes conditionnant la r‚partition}
  YNbmaxIterVolInit = 50;   {Nombre max d'it‚rations pour obtenir le bon jeu de volumes initiaux}
-- 
GitLab