En raison du déménagement des baies serveurs, les services gitlab.irstea.fr et mattermost.irstea.fr seront interrompus le samedi 2 octobre 2021 au matin. Ils devraient revenir à la normale dans la journée.

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 @@ ...@@ -9,3 +9,5 @@
# Program outputs # Program outputs
/compteur /compteur
/*.TXT /*.TXT
/FiniFini
/*Optim
...@@ -16,13 +16,15 @@ At the root folder of this repository type the following command line (Adapt the ...@@ -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\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 ## 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]. 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 ## 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 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); var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
IMPLEMENTATION 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); var ZQmoy,ZQmed,ZQmax,ZQmin : double; var ZQRare,ZQfrequent : YtypFreq);
const const
XNomFicTri : string = 'TRI'; XNomFicTri : string = 'TRI';
XNul : double = 0; XNul : double = 0;
var var
XFic : YTypFod; XFic : YTypFod;
XRang : longint; XRang : longint;
...@@ -23,10 +31,10 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double; ...@@ -23,10 +31,10 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
XStop : boolean; XStop : boolean;
Xi : integer; Xi : integer;
Xfreq : double; Xfreq : double;
begin begin
assign(XFic,YRepT+XNomFicTri);
rewrite(XFic);
reset(ZFic); reset(ZFic);
rewrite(ZFicT);
ZQmoy:=0; ZQmoy:=0;
repeat repeat
read(ZFic,XQ); read(ZFic,XQ);
...@@ -34,61 +42,55 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double; ...@@ -34,61 +42,55 @@ procedure TriChronique(var ZFic:YtypFod; ZNbNul : longint; ZTouComNul : double;
if XQ>ZTouComNul then if XQ>ZTouComNul then
begin begin
XStop:=false; XStop:=false;
XRang:=filesize(XFic)-1; XRang:=filesize(ZFicT)-1;
seek(Xfic,amaxin(0,Xrang)); seek(ZFicT,B_maxin(0,Xrang));
while (XRang>=0) and (not Xstop) do while (XRang>=0) and (not Xstop) do
begin begin
read(XFic,XQpred); read(ZFicT,XQpred);
if XQPred>XQ then if XQPred>XQ then
XStop:=true XStop:=true
else else
begin begin
write(XFic,XQPred); write(ZFicT,XQPred);
XRang:=XRang-1; XRang:=XRang-1;
seek(XFic,amaxin(0,XRang)); seek(ZFicT,B_maxin(0,XRang));
end; end;
end; end;
write(XFic,XQ); write(ZFicT,XQ);
end; end;
until eof(ZFic); until eof(ZFic);
seek(Xfic,filesize(XFic)); close(ZFic);
seek(ZFicT,filesize(ZFicT));
for XRang:=1 to ZNbNul do for XRang:=1 to ZNbNul do
write(XFic,XNul); write(ZFicT,XNul);
reset(XFic); reset(ZFicT);
reset(Zfic); read(ZFicT,ZQmax);
repeat XEffectif:=filesize(ZFicT);
read(XFic,XQ); seek(ZFicT,XEffectif-1);
write(ZFic,XQ); read(ZFicT,ZQmin);
until eof(XFic);
close(XFic);
reset(ZFic);
read(ZFic,ZQmax);
XEffectif:=filesize(ZFic);
seek(ZFic,XEffectif-1);
read(Zfic,ZQmin);
ZQmoy:=ZQmoy/XEffectif; ZQmoy:=ZQmoy/XEffectif;
for Xi:=1 to YNbFreq do for Xi:=1 to YNbFreq do
begin begin
XFreq:=1/YTpsFreq[Xi]; XFreq:=1/YTpsFreq[Xi];
XRang:=amaxlongint(1,trunc((XEffectif+YB)*Xfreq+YA)); XRang:=B_maxlongint(1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFic,XRang-1); seek(ZFicT,XRang-1);
read(ZFic,XQpred,XQ); read(ZFicT,XQpred,XQ);
ZQRare[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB); ZQRare[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
end; end;
XFreq:=0.5; XFreq:=0.5;
XRang:=amaxlongint(1,trunc((XEffectif+YB)*XFreq+YA)); XRang:=B_maxlongint(1,trunc((XEffectif+YB)*XFreq+YA));
seek(ZFic,XRang-1); seek(ZFicT,XRang-1);
read(ZFic,XQpred,XQ); read(ZFicT,XQpred,XQ);
ZQmed:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB); ZQmed:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
for Xi:=1 to YNbFreq do for Xi:=1 to YNbFreq do
begin begin
XFreq:=1-1/YTpsFreq[YNbFreq+1-Xi]; XFreq:=1-1/YTpsFreq[YNbFreq+1-Xi];
XRang:=aminlongint(XEffectif-1,trunc((XEffectif+YB)*Xfreq+YA)); XRang:=B_minlongint(XEffectif-1,trunc((XEffectif+YB)*Xfreq+YA));
seek(ZFic,XRang-1); seek(ZFicT,XRang-1);
read(ZFic,XQpred,XQ); read(ZFicT,XQpred,XQ);
ZQFrequent[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB); ZQFrequent[Xi]:=XQPred+(XQ-XQpred)*(XFreq-(XRang-YA)/(XEffectif+YB))*(XEffectif+YB);
end; end;
close(ZFic); close(ZFicT);
end; 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