Commit a3d7c12c authored by Dorchies David's avatar Dorchies David
Browse files

feat!: Add source code v8 (2016/12/01)

parent 2f829b6e
......@@ -9,3 +9,5 @@
# Program outputs
/compteur
/*.TXT
/FiniFini
/*Optim
......@@ -16,13 +16,15 @@ At the root folder of this repository type the following command line (Adapt the
```
C:\FPC\bin\i386-win32\fpc.exe src\VGEST.PAS && move /Y src\VGEST.exe .
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 .
```
## 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].
Copy the files contained in the `example` directory to the root directory and run `VGEST.exe`.
Copy the files contained in the `example` directory to the root directory and run `SURVGEST.bat`.
## Known issues
......
# Ignore everything in this directory
*
# Except this file
!.gitignore
if exist FiniFini del FiniFini
echo off
if exist PasOptim del PasOptim
if exist FinOptim del FinOptim
if exist PARAMETR\reglage.txt del PARAMETR\reglage.txt
if exist PARAMETR\OUITRI.TXT del PARAMETR\OUITRI.TXT
if exist Temporai.re\etape del Temporai.re\etape
if exist Temporai.re\result0 del Temporai.re\result0;
if exist Suivopti\suivi del Suivopti\suivi
if exist Temporai.re\dichot1 del Temporai.re\dichot1
if exist Temporai.re\dichot2 del Temporai.re\dichot2
if exist Temporai.re\dichot3 del Temporai.re\dichot3
if exist Temporai.re\dichot4 del Temporai.re\dichot4
:NouveauCalcul
REGLAGE
if exist PasOptim goto FindesCalculs
VGEST
if exist FinOptim goto FinDesCalculs
goto NouveauCalcul
:FinDesCalculs
del PARAMETR\reglage.txt
ENDE
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Unit CALCULS4;
Unit CALCULS4; {JC Bader, nov 2016}
interface
uses Utilit,Declara;
uses Utilit,DECLARA;
procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZNbNul : longint; ZTouComNul : double;
var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
IMPLEMENTATION
{=======================================================================}
{==Tri des valeurs d'une chronique contenue dans le fichier Zfic et --}
{--criture de ces valeurs tries dans le fichier ZFicT, puis calcule --}
{--les valeurs dpasses ou non dpasses pour certaines frquences --}
{--prdfinies ainsi que min, max, mdiane et moyenne --}
{=======================================================================}
procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
procedure C4_TriChronique(var ZFic,ZFicT:YtypFod; ZNbNul : longint; ZTouComNul : double;
var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
const
XNomFicTri : string = 'TRI';
XNul : double = 0;
var
XFic : YTypFod;
XRang : longint;
......@@ -23,10 +31,10 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
XStop : boolean;
Xi : integer;
Xfreq : double;
begin
assign(XFic,YRepT+XNomFicTri);
rewrite(XFic);
reset(ZFic);
rewrite(ZFicT);
ZQmoy:=0;
repeat
read(ZFic,XQ);
......@@ -34,61 +42,55 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
if XQ>ZTouComNul then
begin
XStop:=false;
XRang:=filesize(XFic)-1;
seek(Xfic,amaxin(0,Xrang));
XRang:=filesize(ZFicT)-1;
seek(ZFicT,B_maxin(0,Xrang));
while (XRang>=0) and (not Xstop) do
begin
read(XFic,XQpred);
read(ZFicT,XQpred);
if XQPred>XQ then
XStop:=true
else
begin
write(XFic,XQPred);
write(ZFicT,XQPred);
XRang:=XRang-1;
seek(XFic,amaxin(0,XRang));
seek(ZFicT,B_maxin(0,XRang));
end;
end;
write(XFic,XQ);
write(ZFicT,XQ);
end;
until eof(ZFic);
seek(Xfic,filesize(XFic));
close(ZFic);
seek(ZFicT,filesize(ZFicT));
for XRang:=1 to ZNbNul do
write(XFic,XNul);
reset(XFic);
reset(Zfic);
repeat
read(XFic,XQ);
write(ZFic,XQ);
until eof(XFic);
close(XFic);
reset(ZFic);
read(ZFic,ZQmax);
XEffectif:=filesize(ZFic);
seek(ZFic,XEffectif-1);
read(Zfic,ZQmin);
write(ZFicT,XNul);
reset(ZFicT);
read(ZFicT,ZQmax);
XEffectif:=filesize(ZFicT);
seek(ZFicT,XEffectif-1);
read(ZFicT,ZQmin);
ZQmoy:=ZQmoy/XEffectif;
for Xi:=1 to YNbFreq do
begin
XFreq:=1/YTpsFreq[Xi];
XRang:=amaxlongint(1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFic,XRang-1);
read(ZFic,XQpred,XQ);
XRang:=B_maxlongint(1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFicT,XRang-1);
read(ZFicT,XQpred,XQ);
ZQRare[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
end;
XFreq:=0.5;
XRang:=amaxlongint(1,trunc((XEffectif+YB)*XFreq+YA));
seek(ZFic,XRang-1);
read(ZFic,XQpred,XQ);
XRang:=B_maxlongint(1,trunc((XEffectif+YB)*XFreq+YA));
seek(ZFicT,XRang-1);
read(ZFicT,XQpred,XQ);
ZQmed:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
for Xi:=1 to YNbFreq do
begin
XFreq:=1-1/YTpsFreq[YNbFreq+1-Xi];
XRang:=aminlongint(XEffectif-1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFic,XRang-1);
read(ZFic,XQpred,XQ);
XRang:=B_minlongint(XEffectif-1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFicT,XRang-1);
read(ZFicT,XQpred,XQ);
ZQFrequent[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
end;
close(ZFic);
close(ZFicT);
end;
{=======================================================================}
......
This diff is collapsed.
This diff is collapsed.
Program Ende;
{cration et fermeture du fichier marquant la fin de SURVGEST}
const
XNomFicFin = 'FiniFini';
var
XFitext : text;
begin
assign(XFitext,XNomFicFin);
rewrite(XFitext);
close(XFitext);
end.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment