Commit 5cf08f3c authored by Olivier Bonnefon's avatar Olivier Bonnefon
Browse files

update pretraiment for data until 2019

parent 2d93c64a
load "BinaryIO"; load "BinaryIO";
include "paramsTS.edp"; include "paramsTS.edp";
//string BASEREP="../SAVE/MEDIAN/"; string BASEREP="../SAVE_HIGHT/";
string BASEREP="../SAVE/HIGHT/"; //string BASEREP="/mnt/BIGDATA/PUBLIC/olivierB/AEDESINTER_AUTOROUTES_14_05/SAVE_HIGHT/";
int curStep=0; int curStep=0;
verbosity=0; verbosity=0;
int failed=0;
int[int] sizeBinary(15); int[int] sizeBinary(15);
for (int ii=0;ii<15;ii++) for (int ii=0;ii<15;ii++)
sizeBinary[ii]=0; sizeBinary[ii]=0;
int sizeBinaryAux=0; int sizeBinaryAux=0;
macro checkFile(XXINT){ macro checkFile(XXINT){
string FILENAME=BASEREP+"u2d"+string(XXINT)+"__rep_"+string(numRun); string FILENAME=BASEREP+"u2d"+string(XXINT)+"__rep_"+string(numRun);
failed=0;
if (exec("ls "+FILENAME+" 2>/dev/null >/dev/null")){ if (exec("ls "+FILENAME+" 2>/dev/null >/dev/null")){
nofile=1; cout<<"missing file "<<FILENAME<<endl;
failed=1;
}else{ }else{
if (!sizeBinary[XXINT]){ if (!sizeBinary[XXINT]){
GetSizeVec(sizeBinary[XXINT],FILENAME); GetSizeVec(sizeBinary[XXINT],FILENAME);
}else{ }else{
GetSizeVec(sizeBinaryAux,FILENAME); GetSizeVec(sizeBinaryAux,FILENAME);
if (sizeBinaryAux != sizeBinary[XXINT]) if (sizeBinaryAux != sizeBinary[XXINT]){
cout<<"ERROR "+FILENAME+" size is "<<sizeBinaryAux<<" and should be "<<sizeBinary[XXINT]<<endl; cout<<"ERROR "+FILENAME+" size is "<<sizeBinaryAux<<" and should be "<<sizeBinary[XXINT]<<endl;
failed=1;
}
} }
} }
}// }//
int numMissing=0;
int nbSub=0;
int batchSize=100;
for( int numRun=0;numRun<100;numRun++){ for( int numRun=0;numRun<100;numRun++){
int nofile=0;
//for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){ //for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){
// for ( curStep=0;curStep<nbSteps;curStep++){ // for ( curStep=0;curStep<nbSteps;curStep++){
for (int ii=0;ii<15;ii++) for (int ii=0;ii<15;ii++){
checkFile(ii); checkFile(ii);
if (!nofile){ if (failed)
break;
}
if (!failed){
cout<<"numRun="<<numRun<<" ok"<<endl; cout<<"numRun="<<numRun<<" ok"<<endl;
}else{ }else{
cout<<"numRun="<<numRun<<" missing"<<endl; cout<<"numRun="<<numRun<<" failed"<<endl;
if (nbSub==batchSize){
nbSub=0;
numMissing+=1;
}
if (nbSub==0){
ofstream pF("runMissing"+string(numMissing)+".sh");
pF<<"#!/bin/bash"<<endl;
pF<<"#$ -S /bin/bash"<<endl;
pF<<"#$ -N Amissing"<<endl;
pF<<"#$ -V"<<endl;
pF<<"#$ -cwd"<<endl;
}
ofstream pF("runMissing"+string(numMissing)+".sh",append);
pF<<"/opt/freefem++-3.58/src/nw/FreeFem++-nw cas1.edp "<<numRun<<" 1"<<endl;
nbSub+=1;
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
using namespace std; using namespace std;
#define BASEREP "../SAVE/HIGHT/" #define BASEREP "../SAVE_LOW/"
long int GetSizeVec(char* name){ long int GetSizeVec(char* name){
std::ifstream infile (name,ios_base::binary); std::ifstream infile (name,ios_base::binary);
...@@ -43,7 +43,7 @@ void SaveVec(double * pD, long int N, char* name) ...@@ -43,7 +43,7 @@ void SaveVec(double * pD, long int N, char* name)
int main(){ int main(){
char filename[256]; char filename[256];
int N=4; int N=100;
double * pBufTraj[15]; double * pBufTraj[15];
double * pMaxTraj[15]; double * pMaxTraj[15];
double * pMinTraj[15]; double * pMinTraj[15];
......
savevtk(OUTPUTDIR+"D2/u"+maxormin+"0s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th0,utm12d0,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"0s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th0,utm12d0,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"1s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th1,utm12d1,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"1s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th1,utm12d1,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"2s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th2,utm12d2,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"2s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th2,utm12d2,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"3s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th3,utm12d3,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"3s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th3,utm12d3,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"4s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th4,utm12d4,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"4s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th4,utm12d4,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"5s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th5,utm12d5,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"5s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th5,utm12d5,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"6s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th6,utm12d6,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"6s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th6,utm12d6,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"7s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th7,utm12d7,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"7s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th7,utm12d7,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"8s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th8,utm12d8,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"8s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th8,utm12d8,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"9s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th9,utm12d9,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"9s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th9,utm12d9,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"10s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th10,utm12d10,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"10s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th10,utm12d10,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"11s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th11,utm12d11,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"11s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th11,utm12d11,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"12s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th12,utm12d12,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"12s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th12,utm12d12,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"13s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th13,utm12d13,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"13s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th13,utm12d13,dataname="UU");
savevtk(OUTPUTDIR+"D2/u"+maxormin+"14s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th14,utm12d14,dataname="UU"); savevtk(OUTPUTDIR+"D2/u"+SENARIO+"_"+maxormin+"14s"+string(CURYEAR)+"_"+string(curStep)+".vtk",Th14,utm12d14,dataname="UU");
...@@ -4,75 +4,109 @@ include "myMacro.edp"; ...@@ -4,75 +4,109 @@ include "myMacro.edp";
include "defGeomGen.edp" include "defGeomGen.edp"
include "defDofsGen.edp" include "defDofsGen.edp"
int curStep=0; int curStep=0;
int numRun=0; int numRun=99;
int size; int size;
{ {
GetSizeVec(size,"../SAVE/u2d0__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d0__rep_"+string(numRun));
cout<<size<<endl;
// cout<<Vh0.ndof<<endl;
// cout<<((364-58)*Vh0.ndof)<<endl;
// cout<<"utm12d0.n "<<utm12d0.n<<endl;
int saux=(364-58)*7*utm12d0.n;
cout<<"saux="<<saux<<endl;
// SetSizeVec(saux,"../SAVE/u2d0_"+"_rep_"+string(numRun));
// GetSizeVec(size,"../SAVE/u2d0__rep_"+string(numRun));
// cout<<size<<endl;
real[int] u0(size); real[int] u0(size);
LoadVec(u0,"../SAVE/u2d0__rep_"+string(numRun)); LoadVec(u0,"../SAVE/u2d0__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d1__rep_"+string(numRun)); saux=(364-58)*7*utm12d1.n;
GetSizeVec(size,"../SAVE/u2d1__rep_"+string(numRun));cout<<size<<" "<<saux<<endl;
real[int] u1(size); real[int] u1(size);
LoadVec(u1,"../SAVE/u2d1__rep_"+string(numRun)); LoadVec(u1,"../SAVE/u2d1__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d2__rep_"+string(numRun)); saux=(364-58)*7*utm12d2.n;
GetSizeVec(size,"../SAVE/u2d2__rep_"+string(numRun));cout<<size<<" "<<saux<<endl;
real[int] u2(size); real[int] u2(size);
LoadVec(u2,"../SAVE/u2d2__rep_"+string(numRun)); LoadVec(u2,"../SAVE/u2d2__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d3__rep_"+string(numRun)); saux=(364-58)*7*utm12d3.n;
GetSizeVec(size,"../SAVE/u2d3__rep_"+string(numRun));cout<<size<<" "<<saux<<endl;
real[int] u3(size); real[int] u3(size);
LoadVec(u3,"../SAVE/u2d3__rep_"+string(numRun)); LoadVec(u3,"../SAVE/u2d3__rep_"+string(numRun));
saux=(364-58)*7*utm12d4.n;
SetSizeVec(saux,"../SAVE/u2d4_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d4__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d4__rep_"+string(numRun));
real[int] u4(size); real[int] u4(size);
LoadVec(u4,"../SAVE/u2d4__rep_"+string(numRun)); LoadVec(u4,"../SAVE/u2d4__rep_"+string(numRun));
saux=(364-58)*7*utm12d5.n;
SetSizeVec(saux,"../SAVE/u2d5_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d5__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d5__rep_"+string(numRun));
real[int] u5(size); real[int] u5(size);
LoadVec(u5,"../SAVE/u2d5__rep_"+string(numRun)); LoadVec(u5,"../SAVE/u2d5__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d6__rep_"+string(numRun)); saux=(364-58)*7*utm12d6.n;
SetSizeVec(saux,"../SAVE/u2d6_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d6__rep_"+string(numRun));
real[int] u6(size); real[int] u6(size);
LoadVec(u6,"../SAVE/u2d6__rep_"+string(numRun)); LoadVec(u6,"../SAVE/u2d6__rep_"+string(numRun));
saux=(364-58)*7*utm12d7.n;
SetSizeVec(saux,"../SAVE/u2d7_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d7__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d7__rep_"+string(numRun));
real[int] u7(size); real[int] u7(size);
LoadVec(u7,"../SAVE/u2d7__rep_"+string(numRun)); LoadVec(u7,"../SAVE/u2d7__rep_"+string(numRun));
saux=(364-58)*7*utm12d8.n;
SetSizeVec(saux,"../SAVE/u2d8_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d8__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d8__rep_"+string(numRun));
real[int] u8(size); real[int] u8(size);
LoadVec(u8,"../SAVE/u2d8__rep_"+string(numRun)); LoadVec(u8,"../SAVE/u2d8__rep_"+string(numRun));
saux=(364-58)*7*utm12d9.n;
SetSizeVec(saux,"../SAVE/u2d9_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d9__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d9__rep_"+string(numRun));
real[int] u9(size); real[int] u9(size);
LoadVec(u9,"../SAVE/u2d9__rep_"+string(numRun)); LoadVec(u9,"../SAVE/u2d9__rep_"+string(numRun));
saux=(364-58)*7*utm12d10.n;
SetSizeVec(saux,"../SAVE/u2d10_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d10__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d10__rep_"+string(numRun));
real[int] u10(size); real[int] u10(size);
LoadVec(u10,"../SAVE/u2d10__rep_"+string(numRun)); LoadVec(u10,"../SAVE/u2d10__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d11__rep_"+string(numRun)); saux=(364-58)*7*utm12d11.n;
SetSizeVec(saux,"../SAVE/u2d11_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d11__rep_"+string(numRun));
real[int] u11(size); real[int] u11(size);
LoadVec(u11,"../SAVE/u2d11__rep_"+string(numRun)); LoadVec(u11,"../SAVE/u2d11__rep_"+string(numRun));
saux=(364-58)*7*utm12d12.n;
SetSizeVec(saux,"../SAVE/u2d12_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d12__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d12__rep_"+string(numRun));
real[int] u12(size); real[int] u12(size);
LoadVec(u12,"../SAVE/u2d12__rep_"+string(numRun)); LoadVec(u12,"../SAVE/u2d12__rep_"+string(numRun));
saux=(364-58)*7*utm12d13.n;
SetSizeVec(saux,"../SAVE/u2d13_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d13__rep_"+string(numRun)); GetSizeVec(size,"../SAVE/u2d13__rep_"+string(numRun));
real[int] u13(size); real[int] u13(size);
LoadVec(u13,"../SAVE/u2d13__rep_"+string(numRun)); LoadVec(u13,"../SAVE/u2d13__rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d14__rep_"+string(numRun)); saux=(364-58)*7*utm12d14.n;
SetSizeVec(saux,"../SAVE/u2d14_"+"_rep_"+string(numRun));
GetSizeVec(size,"../SAVE/u2d14__rep_"+string(numRun));
real[int] u14(size); real[int] u14(size);
LoadVec(u14,"../SAVE/u2d14__rep_"+string(numRun)); LoadVec(u14,"../SAVE/u2d14__rep_"+string(numRun));
int nbCallSave=0; int nbCallSave=0;
for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){ for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){
int firstStep=0; int firstStep=59;
if (CURYEAR==2011) if (CURYEAR==2011)
firstStep=362-122; firstStep=362-122;
for ( curStep=firstStep;curStep<nbSteps;curStep++){ for ( curStep=firstStep;curStep<365;curStep++){
utm12d0[]=u0(nbCallSave*utm12d0.n:(nbCallSave+1)*utm12d0.n); utm12d0[]=u0(nbCallSave*utm12d0.n:(nbCallSave+1)*utm12d0.n);
utm12d1[]=u1(nbCallSave*utm12d1.n:(nbCallSave+1)*utm12d1.n); utm12d1[]=u1(nbCallSave*utm12d1.n:(nbCallSave+1)*utm12d1.n);
utm12d2[]=u2(nbCallSave*utm12d2.n:(nbCallSave+1)*utm12d2.n); utm12d2[]=u2(nbCallSave*utm12d2.n:(nbCallSave+1)*utm12d2.n);
......
...@@ -7,9 +7,10 @@ include "defDofsGen.edp" ...@@ -7,9 +7,10 @@ include "defDofsGen.edp"
int curStep=0; int curStep=0;
int numRun=0; int numRun=0;
int size; int size;
string BASEREP="../SAVE/HIGHT/"; string SENARIO="LOW";
string BASEREP="../SAVE_"+SENARIO+"/";
int u0size; int u0size;
string maxormin="min"; string maxormin="max";
string OUTPUTDIR=BASEREP; string OUTPUTDIR=BASEREP;
{ {
...@@ -74,12 +75,12 @@ string OUTPUTDIR=BASEREP; ...@@ -74,12 +75,12 @@ string OUTPUTDIR=BASEREP;
LoadVec(u14,BASEREP+"u2d14__"+maxormin); LoadVec(u14,BASEREP+"u2d14__"+maxormin);
int nbCallSave=0; int nbCallSave=0;
for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){ for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){
for ( curStep=0;curStep<nbSteps;curStep++){ int firstStep=59;
if (CURYEAR==2011)
firstStep=362-122;
for ( curStep=firstStep;curStep<365;curStep++){
//check over date //check over date
if (u0size < (nbCallSave+1)*utm12d0.n){
cout<<CURYEAR<<" "<<curStep<<": u0size="<<u0size<<" "<<(nbCallSave+1)*utm12d0.n<<endl;;
continue;
}
if (curStep > 100 ){ if (curStep > 100 ){
utm12d0[]=u0(nbCallSave*utm12d0.n:(nbCallSave+1)*utm12d0.n); utm12d0[]=u0(nbCallSave*utm12d0.n:(nbCallSave+1)*utm12d0.n);
utm12d1[]=u1(nbCallSave*utm12d1.n:(nbCallSave+1)*utm12d1.n); utm12d1[]=u1(nbCallSave*utm12d1.n:(nbCallSave+1)*utm12d1.n);
...@@ -99,10 +100,11 @@ string OUTPUTDIR=BASEREP; ...@@ -99,10 +100,11 @@ string OUTPUTDIR=BASEREP;
bool waitt=true; bool waitt=true;
//if (curStep%15) //if (curStep%15)
// waitt=false; // waitt=false;
if (curStep%15==0) if (curStep==195 && CURYEAR==LASTYEAR){
plot(utm12d0,utm12d1,utm12d2,utm12d3,utm12d4,utm12d5,utm12d6,utm12d7,utm12d8,utm12d9,utm12d10,utm12d11,utm12d12,utm12d13,utm12d14, plot(utm12d0,utm12d1,utm12d2,utm12d3,utm12d4,utm12d5,utm12d6,utm12d7,utm12d8,utm12d9,utm12d10,utm12d11,utm12d12,utm12d13,utm12d14,
cmm="rep "+string(numRun)+" year="+string(CURYEAR)+" step="+string(curStep),value=true,fill=true,wait=waitt); cmm=SENARIO+"_"+maxormin+" year="+string(CURYEAR)+" step="+string(curStep),value=true,fill=true,wait=waitt,ps=SENARIO+"_"+maxormin+"_year="+string(CURYEAR)+"_step="+string(curStep)+".eps");
//include "saveVtk.edp"; include "saveVtk.edp";
}
} }
nbCallSave++; nbCallSave++;
} }
......
...@@ -8,8 +8,10 @@ include "defDofsGen.edp" ...@@ -8,8 +8,10 @@ include "defDofsGen.edp"
include "defTigerVar.edp" include "defTigerVar.edp"
include "defSimuParamsGen.edp"; include "defSimuParamsGen.edp";
include "paramsTS.edp"; include "paramsTS.edp";
include "buildTobs.edp";
int numRun=0; int numRun=0;
int NnumRun=10; int NnumRun=10;
string SAVEDIR="/home/olivierb/aedes/AEDESINTER_AUTOROUTES_ADAPTIV/SAVE/WORK_VERSION/";
if (ARGV.n>2){ if (ARGV.n>2){
numRun=atoi(ARGV[2]); numRun=atoi(ARGV[2]);
NnumRun=10; NnumRun=10;
...@@ -20,8 +22,9 @@ if (ARGV.n>3){ ...@@ -20,8 +22,9 @@ if (ARGV.n>3){
int scenarioLow=0; int scenarioLow=0;
int scenarioMedian=1; int scenarioMedian=1;
int scenarioHight=2; int scenarioHight=2;
int scenario=scenarioHight; int scenario=scenarioLow;
int seed = 1234+numRun; int seed = 1234+numRun;
int callSolver=1;
randinit ( seed ); randinit ( seed );
//include "defPluginVaraibleGen.edp" //include "defPluginVaraibleGen.edp"
//real nu=0.0;//1.0;//2D to 1D //real nu=0.0;//1.0;//2D to 1D
...@@ -54,12 +57,13 @@ if (scenario==scenarioLow){ ...@@ -54,12 +57,13 @@ if (scenario==scenarioLow){
Rstar=0.12*365; Rstar=0.12*365;
Tw=2; Tw=2;
GDDTHRESHOLD="GDD_294/"; GDDTHRESHOLD="GDD_294/";
SAVEDIR="/home/olivierb/aedes/AEDESINTER_AUTOROUTES_ADAPTIV/SAVE/LOW/";
} }
if (scenario==scenarioHight){ if (scenario==scenarioHight){
Rstar=0.15*365; Rstar=0.15*365;
Tw=0; Tw=0;
GDDTHRESHOLD="GDD_246/"; GDDTHRESHOLD="GDD_246/";
SAVEDIR="/home/olivierb/aedes/AEDESINTER_AUTOROUTES_ADAPTIV/SAVE/HIGHT/";
} }
real K=1.0; real K=1.0;
...@@ -112,96 +116,98 @@ int nbCallSave; ...@@ -112,96 +116,98 @@ int nbCallSave;
int numDay=0; int numDay=0;
int lastRRPlot=0; int lastRRPlot=0;
func real J(real[int] & u) func real J(real[int] & u)
{ {
real coefLength=969000/12; real coefLength=969000/12;
//real coefExpo=2*log(coefLength)/log(10.0); //real coefExpo=2*log(coefLength)/log(10.0);
D2DXu0=pow(10,u[0])*coefLength*coefLength; D2DXu0=pow(10,u[0])*coefLength*coefLength;
D2DYu0=D2DXu0; D2DYu0=D2DXu0;
D1Du1=pow(10,u[1])*coefLength*coefLength; D1Du1=pow(10,u[1])*coefLength*coefLength;
D1Du0=D1Du1; D1Du0=D1Du1;
real R=pow(10,u[2]); real R=pow(10,u[2]);
muu1=u[3]*u[3]; muu1=u[3]*u[3];
nuu1=coefLength*u[4]*u[4]; nuu1=coefLength*u[4]*u[4];
dirichlet0=0.1*u[5]*u[5]/coefLength; dirichlet0=0.1*u[5]*u[5]/coefLength;
betamodel=coefLength*coefLength; betamodel=coefLength*coefLength;
RR0=R;RR1=R;RR2=R;RR3=R;RR4=R;RR5=R;RR6=R;RR7=R;RR8=R;RR9=R;RR10=R;RR11=R;RR12=R;RR13=R;RR14=R; RR0=R;RR1=R;RR2=R;RR3=R;RR4=R;RR5=R;RR6=R;RR7=R;RR8=R;RR9=R;RR10=R;RR11=R;RR12=R;RR13=R;RR14=R;
cout<<"PostTrait u("<<u[0]<<","<<u[1]<<","<<u[2]<<","<<u[3]<<","<<u[4]<<","<<u[5]<<")"<<endl; cout<<"PostTrait u("<<u[0]<<","<<u[1]<<","<<u[2]<<","<<u[3]<<","<<u[4]<<","<<u[5]<<")"<<endl;
cout<<"PostTrait J("<<D2DXu0<<","<<D2DYu0<<","<<D1Du1<<","<<R<<","<<muu1<<","<<nuu1<<","<<dirichlet0<<")"<<endl; cout<<"PostTrait J("<<D2DXu0<<","<<D2DYu0<<","<<D1Du1<<","<<R<<","<<muu1<<","<<nuu1<<","<<dirichlet0<<")"<<endl;
include "defVarfGen.edp"; include "defVarfGen.edp";
include "defIC.edp"; include "defIC.edp";
include "defIC1dNull.edp"; include "defIC1dNull.edp";
include "defMatGen.edp"; include "defMatGen.edp";
//include "buildMatGenW01.edp"; //include "buildMatGenW01.edp";
cout<<"end ic\n"; cout<<"end ic\n";
ofstream infoFileNull("infosimu.txt"); ofstream infoFileNull("infosimu.txt");
nbCallSave=0; nbCallSave=0;
cout<<"begin loop\n"; cout<<"begin loop\n";
for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){ for (CURYEAR=FIRSTYEAR; CURYEAR<=LASTYEAR; CURYEAR++){
if (CURYEAR>2016){ if (CURYEAR>2019){
real p; real p;
p=randreal1(); p=randreal1();
int rg=p/0.2+1; int rg=p/0.2+1;
CURYEARRAND=2011+rg; CURYEARRAND=2011+rg;
if (CURYEARRAND>2016) if (CURYEARRAND>2016)
CURYEARRAND=2016; CURYEARRAND=2016;
cout<<"CURYEAR "<<CURYEAR<<" use data "<<CURYEARRAND<<endl; cout<<"CURYEAR "<<CURYEAR<<" use data "<<CURYEARRAND<<endl;
} }
ofstream infoFile("infosimu.txt",append); ofstream infoFile("infosimu.txt",append);
if (CURYEAR==2011){ if (CURYEAR==2011){
//nbSteps=nbSteps2011; //nbSteps=nbSteps2011;
T0=1-122.0/365.0; T0=1-122.0/365.0;
}else{ }else{
//nbSteps=nbStepsByYear; //nbSteps=nbStepsByYear;
T0=59.0/365.0; T0=59.0/365.0;
} }
curT=T0; curT=T0;
gamma0min=100000; gamma0min=100000;
gamma0max=-100000; gamma0max=-100000;
gamma1min=100000; gamma1min=100000;
gamma1max=-100000; gamma1max=-100000;
w0min=100000; w0min=100000;
w0max=-100000; w0max=-100000;
w1min=100000; w1min=100000;
w1max=-100000; w1max=-100000;
RRmin=100000; RRmin=100000;
RRmax=-100000; RRmax=-100000;
if (CURYEAR!=FIRSTYEAR){ if (CURYEAR!=FIRSTYEAR){
include "zeroAdultAndW1.edp"; include "zeroAdultAndW1.edp";
} }