Commit 3977e225 authored by Olivier Bonnefon's avatar Olivier Bonnefon
Browse files

add useful readme

parent f00cd612
......@@ -3,6 +3,7 @@ include "defUsedDep.edp";
BSScore=0;
indexYear=LASTYEAR-2003;
cout<<"indexYear="<<indexYear<<endl;
cmpData=0;
for (int i=0;i<114;i++){
if (useDep[i]==0)
......
rm resBS.txt
FreeFem++-nw loopOnSimuNK.edp 2009 1
FreeFem++-nw loopOnSimuNK.edp 2010 1
FreeFem++-nw loopOnSimuNK.edp 2011 1
FreeFem++-nw loopOnSimuNK.edp 2012 1
FreeFem++-nw loopOnSimuNK.edp 2013 1
FreeFem++-nw loopOnSimuNK.edp 2014 1
FreeFem++-nw loopOnSimuNK.edp 2015 1
FreeFem++-nw loopOnSimuNK.edp 2016 1
FreeFem++-nw loopOnSimuNK.edp 2017 1
FreeFem++-nw loopOnSimuNK.edp 2018 1
FreeFem++-nw loopOnSimuNK.edp 2019 1
FreeFem++-nw loopOnSimuNK.edp 2009 2
FreeFem++-nw loopOnSimuNK.edp 2010 2
FreeFem++-nw loopOnSimuNK.edp 2011 2
FreeFem++-nw loopOnSimuNK.edp 2012 2
FreeFem++-nw loopOnSimuNK.edp 2013 2
FreeFem++-nw loopOnSimuNK.edp 2014 2
FreeFem++-nw loopOnSimuNK.edp 2015 2
FreeFem++-nw loopOnSimuNK.edp 2016 2
FreeFem++-nw loopOnSimuNK.edp 2017 2
FreeFem++-nw loopOnSimuNK.edp 2018 2
FreeFem++-nw loopOnSimuNK.edp 2009 3
FreeFem++-nw loopOnSimuNK.edp 2010 3
FreeFem++-nw loopOnSimuNK.edp 2011 3
FreeFem++-nw loopOnSimuNK.edp 2012 3
FreeFem++-nw loopOnSimuNK.edp 2013 3
FreeFem++-nw loopOnSimuNK.edp 2014 3
FreeFem++-nw loopOnSimuNK.edp 2015 3
FreeFem++-nw loopOnSimuNK.edp 2016 3
FreeFem++-nw loopOnSimuNK.edp 2017 3
FreeFem++-nw loopOnSimuNK.edp 2009 4
FreeFem++-nw loopOnSimuNK.edp 2010 4
FreeFem++-nw loopOnSimuNK.edp 2011 4
FreeFem++-nw loopOnSimuNK.edp 2012 4
FreeFem++-nw loopOnSimuNK.edp 2013 4
FreeFem++-nw loopOnSimuNK.edp 2014 4
FreeFem++-nw loopOnSimuNK.edp 2015 4
FreeFem++-nw loopOnSimuNK.edp 2016 4
FreeFem++-nw loopOnSimuNK.edp 2009 5
FreeFem++-nw loopOnSimuNK.edp 2010 5
FreeFem++-nw loopOnSimuNK.edp 2011 5
FreeFem++-nw loopOnSimuNK.edp 2012 5
FreeFem++-nw loopOnSimuNK.edp 2013 5
FreeFem++-nw loopOnSimuNK.edp 2014 5
FreeFem++-nw loopOnSimuNK.edp 2015 5
FreeFem++-nw loopOnSimuNK.edp 2009 6
FreeFem++-nw loopOnSimuNK.edp 2010 6
FreeFem++-nw loopOnSimuNK.edp 2011 6
FreeFem++-nw loopOnSimuNK.edp 2012 6
FreeFem++-nw loopOnSimuNK.edp 2013 6
FreeFem++-nw loopOnSimuNK.edp 2014 6
FreeFem++-nw loopOnSimuNK.edp 2009 7
FreeFem++-nw loopOnSimuNK.edp 2010 7
FreeFem++-nw loopOnSimuNK.edp 2011 7
FreeFem++-nw loopOnSimuNK.edp 2012 7
FreeFem++-nw loopOnSimuNK.edp 2013 7
FreeFem++-nw loopOnSimuNK.edp 2009 8
FreeFem++-nw loopOnSimuNK.edp 2010 8
FreeFem++-nw loopOnSimuNK.edp 2011 8
FreeFem++-nw loopOnSimuNK.edp 2012 8
FreeFem++-nw loopOnSimuNK.edp 2009 9
FreeFem++-nw loopOnSimuNK.edp 2010 9
FreeFem++-nw loopOnSimuNK.edp 2011 9
FreeFem++-nw loopOnSimuNK.edp 2009 10
FreeFem++-nw loopOnSimuNK.edp 2010 10
FreeFem++-nw loopOnSimuNK.edp 2009 11
grep " 1 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' > bsModel.txt
grep " 2 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 3 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 4 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 5 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 6 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 7 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 8 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 9 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 10 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 11 " resBS.txt | awk '{print $3}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsModel.txt
grep " 1 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' > bsNull.txt
grep " 2 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 3 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 4 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 5 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 6 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 7 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 8 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 9 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 10 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
grep " 11 " resBS.txt | awk '{print $4}' | awk 'BEGIN {FS = "|"} ; {sum+=$1} END {print sum/NR}' >> bsNull.txt
paste -d ' ' bsModel.txt bsNull.txt > bsModelNullAux.txt
awk '{print NR" "$0}' bsModelNullAux.txt >averageBSModelNull.txt
#plot 'averageBSModelNull.txt' u 1:($2/$3) w l t "(Brier score moyen model)/(Brier score moyen null) en fonction de K"
This file is copied during the execution of the C prog gen2speciesNL.c.
It contains the command that must be done to allow the simulation.
Programme pricipale FF: cas1.edp avec commentaires
This commands are necessary to run the simulation:
1) more userFDef0.txt
Just to check the dynamic on each patch
2) chmod +x genSetFunc.sh
3) ./genSetFunc.sh
To generate the dynamic on each patch
usage :
simulation avec assimilations: Freefem++ cas1.edp
-----------------------------
simule sur la periode 2008--2019 en utilisant la procedure d'assimilation
T0 de 2008 est 1-122/365 ie 1 septembre
T0 de 2009-2019 est 59/365 ie 1 mars
construction de la donnee initiale
en 2008 la donne init est nulle, puis le 1 septembre assimilation des donnees 2008 avec thetaAssim=1
en y=2009 .. 2019 la donnee est contenue dans la variable w0s2d0.
Sauvegarde des oeux pour curyear ds {2008,..,2019}:
w1s2d(i=0)_(n=numrun)_(y=curyear) : etat des oeux a la fin de l'annee curyear
w0s2d(i=0)_(n=numrun)_(y=curyear) : etat des oeux ayant passe l'hiver de [dec curyear, fev curyear+1] (a utiliser pour la donnee initial de l'annee curyear+1
simulation sans assimilation: Freefem++ FIRSTYEAR NBPREDYEAR
-----------------------------
simule sur la periode [1 fev FIRSTYEAR +(NBPREDYEAR-1), dec FIRSTYEAR +NBPREDYEAR]
il s'agit ici de mesurer la qualite predictive du modele avec assimilation prealable simile (voir ci-dessus).
FIRSTYEAR ds {2009,2018}
NBPREDYEAR tel que FIRSTYEAR+NBPREDYEAR <= 2019
ATTENTION: suppose que Freefem++ FIRSTYEAR NBPREDYEAR-1, avec NBPREDYEAR-1 >0 a ete joue
construction de la donnee initiale:
* NBPREDYEAR=1: on va chercher les oeux ayant passe l'hiver [dec FIRSTYEAR-1,fev FIRSTYEAR] lors de la simu avec assimilation, cela revient a charger w0s2d(i=0)_(n=numrun)_(FIRSTYEAR-1)
* NBPREDYEAR>1: on va chercher l'etat final de l'appel Freefem++ FIRSTYEAR NBPREDYEAR-1, cela revient a charger w0s2d_(NBPREDYEAR-1)_FIRSTYEAR
sauvegarde tout les jours simulés:
u2d0_NBPREDYEAR_FIRSTYEAR_rep_(n=numRun) sauvegarde des 365 jours simulé, utile pour le calcul du BS
sauvegarde en fin de simu
w1s2d0_(n=numrun)_(NBPREDYEAR)_(FIRSTYEAR) : oeux diaposant en dec FIRSTYEAR +NBPREDYEAR
w0s2d0_(n=numrun)_(NBPREDYEAR)_(FIRSTYEAR) : oeux en fev FIRSTYEAR +NBPREDYEAR+1 ayant passe l'hiver, sera utilisé comme donnée initiale pour Freefem++ FIRSTYEAR NBPREDYEAR+1.
The simuated must be ready to run:
FreeFem++ cas1.edp
Finaly, visualized with 'python vtktopng.py'
......@@ -30,6 +30,8 @@ if (ARGV.n>3){
w1: oeuf diaposant en début d'hier
w0: oeuf ayant passe l'hiver
voir Readme.txt, les commentaire ci-dessous sont obsoletes
Simulation avec assimilation de 2008 a 1019
---------------------------------------------
* 2008 --> 2009
......@@ -43,7 +45,7 @@ if (ARGV.n>3){
sauvegarde de w1 dans SAVE/w1s2d0_0_2008
sauvegarde de w0 dans SAVE/w0s2d0_0_2008
* 2009 --> 2010
T0 = 1 fev 2008
T0 = 1 fev 2009
u=0 w1=0 ou touche pas a w0
simulation Sauvegarde ds SAVE/u2d0_2009_rep_0
sauvegarde de w1 dans SAVE/w1s2d0_0_2009
......@@ -106,7 +108,7 @@ if (ARGV.n>3){
int scenarioLow=0;
int scenarioMedian=1;
int scenarioHight=2;
int scenario=scenarioMedian;
int scenario=scenarioHight;
int seed = 1234+numRun;
int callSolver=1;
randinit ( seed );
......@@ -219,6 +221,7 @@ func real J(real[int] & u)
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;
include "defVarfGen.edp";
//Loadind w0 state
include "defIC.edp";
include "defIC1dNull.edp";
include "defMatGen.edp";
......
real thetaAssim=0.5;
real thetaAssim=1;
//end of august
int assimNumDay=240;
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