- Timestamp:
- 04/30/15 11:39:49 (9 years ago)
- Location:
- altifloat
- Files:
-
- 28 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
altifloat/matlab_toolbox/script_perso.m
r145 r147 1 1 close all 2 2 clear all 3 indir='../exp_ forw_dan/';3 indir='../exp_twin_aviso/'; 4 4 %indir='../../code_leila/altifloat/obs_float/'; 5 5 %indir='../obs_float/'; … … 8 8 robs=load([ indir 'obs_jum.dat']); 9 9 rsim=load([ indir 'rfloat_total_jum1.dat']); 10 uvb=load([ indir 'uv_bck _dan_s.dat']);11 uvt=load([ indir 'uv_ bck_dan.dat']);10 uvb=load([ indir 'uv_bck.dat']); 11 uvt=load([ indir 'uv_truth.dat']); 12 12 uvr=load([indir 'uv_total_jum1.dat']); 13 meshg=load([indir 'meshgrid_dan.dat']); 14 drifterdir='../altifloat/'; 15 fname={'a300234011043340.mat','a300234011120770.mat','a300234011249440.mat'}; 13 meshg=load([indir 'meshgrid_aviso.dat']); 14 15 %drifterdir='../altifloat/'; 16 %fname={'a300234011043340.mat','a300234011120770.mat','a300234011249440.mat'}; 16 17 %X1=ut(:,end-3); 17 18 %Y1=ut(:,end-2); 18 iech= 3;19 jech= 3;20 LIM=[34. 8 35.3 33.2 33.6];19 iech=1; 20 jech=1; 21 LIM=[34.5 36 32.5 35]; 21 22 %Format : t/s, ilon, ilat, val 22 23 … … 66 67 67 68 for j=1:nfloat 68 data= load([drifterdir fname{j}]); 69 70 71 69 70 71 72 72 rfloat=rsim(rsim(:,2)==j-1&rsim(:,end)>0,[end-1 end]); 73 73 rfloat_lon=interp1(1:nlon,lon,rfloat(:,2)+1); 74 74 rfloat_lat=interp1(1:nlat,lat',rfloat(:,1)+1); 75 Hsim=plot( [data.lon(1);rfloat_lon],[data.lat(1);rfloat_lat],'.-r');75 Hsim=plot(rfloat_lon,rfloat_lat,'.-r'); 76 76 rfloat=robs(robs(:,2)==j-1&robs(:,end)>0,[end-1 end]); 77 77 rfloat_lon=interp1(1:nlon,lon,rfloat(:,2)+1); 78 78 rfloat_lat=interp1(1:nlat,lat',rfloat(:,1)+1); 79 Hobs=plot( [data.lon(1);rfloat_lon],[data.lat(1);rfloat_lat],'.-m');79 Hobs=plot(rfloat_lon,rfloat_lat,'.-m'); 80 80 81 81 % plot(rfloat(:,2)+1,rfloat(:,1)+1,'.-m'); … … 95 95 96 96 %legend([Hb Hr],'background','retrieved','Location','SouthEast'); 97 legend([Hb Hr Ht],'background.','retrieved','truth' );97 legend([Hb Hr Ht],'background.','retrieved','truth','Location','SouthEast'); 98 98 99 99 %print -dpng ../exp_forw_dan/simu_drifter_dan.png 100 100 101 101 102 102 if (false) 103 103 delta_b=sqrt(mean((Ut(:,:,1:end-1)-Ub(:,:,1:end-1)),3).^2+mean((Vt(:,:,1:end-1)-Vb(:,:,1:end-1)),3).^2); 104 104 delta_r=sqrt(mean((Ut(:,:,1:end-1)-Ur(:,:,1:end-1)),3).^2+mean((Vt(:,:,1:end-1)-Vr(:,:,1:end-1)),3).^2); … … 155 155 %print -f1 -dpng ../exp_forw_dan/twin_exp_uv_field.png 156 156 %print -f2 -dpng ../exp_forw_dan/twin_exp_errors.png 157 end 158 157 159 158 160 %% Erreur le long du trajet … … 171 173 end %id 172 174 end %if false 175 176 %% Divergence 177 load ../exp_twin_aviso/Div_ana.dat 178 load ../exp_twin_aviso/Div_fg.dat 179 180 Div2_ana=reshape(Div_ana(:,end),nlat,nlon,ntime-1); 181 Div2_fg=reshape(Div_fg(:,end),nlat,nlon,ntime-1); 182 183 figure(3) 184 subplot(3,1,1) 185 imagesc(lon,lat,mean(Div2_fg,3),[-2 2]*1e-5); 186 axis xy; 187 axis(LIM); 188 title('Mean divergence Background'); 189 colorbar 190 191 192 figure(3) 193 subplot(3,1,3) 194 imagesc(lon,lat,mean(Div2_ana,3),[-2 2]*1e-5); 195 axis xy; 196 axis(LIM); 197 title('Mean divergence Analyse'); 198 colorbar 199 200 subplot(3,1,2); 201 imagesc(lon,lat,mean(Div2_ana,3)-mean(Div2_fg,3),[-2 2]*1e-5); 202 axis xy; 203 axis(LIM); 204 title('Mean difference'); 205 colorbar -
altifloat/src/Makefile
r109 r147 1 GENOPT= - E1 GENOPT= -DINC_FIL -DINC_GRID -E 2 2 YAOPT= +g -x floater_delta 3 3 #YAOBIN=${YAODIR}/etc/YaoI -
altifloat/src/floater.h
r144 r147 40 40 //YREAL dtfil=26042000; 41 41 //YREAL dtfil=2.604166666666667e+07; 42 43 #ifdef INC_FIL 44 #include "fil_def.h" 45 #else 42 46 YREAL dtfil=200000; 43 47 #endif 48 #endif 44 49 45 50 //Options du run incr士ental 46 int nb_extiter= 4;51 int nb_extiter=8; 47 52 short inc_save=0; 48 53 char dirsave[50]="../obs_float/"; … … 55 60 extern int Yobs_insert_data (char *nmmod, int sortie, int iaxe, int jaxe, int kaxe,int pdt, YREAL val); 56 61 void run_inc(int argv, char *argc[]); 62 void div_init(); 57 63 58 64 void appli_start(int argc, char *argv[]){ … … 81 87 pmask[i][j]=0; 82 88 } 89 90 83 91 /* 84 92 char L1[50]="read_obs"; … … 274 282 Column 1 (%d) : time step (from 0 to jptfl-1) 275 283 Column 2 (%d) : idfloat (from 0 to jpnfl-1) 276 Column 3 (%f) : grid point piret (l on)277 Column 4 (%f) : grid point pjret (l at)284 Column 3 (%f) : grid point piret (lat) 285 Column 4 (%f) : grid point pjret (lon) 278 286 */ 279 287 if (argv!=2) { … … 476 484 477 485 fclose(fid); 486 487 } 488 489 void div_init() { 490 //Make pseudo-obs of divergence to constrain 491 int i,j,it; 492 for (it=0;it<jtlag;it++) 493 for (j=0;j<nlon;j++) 494 for (i=0;i<nlat;i++) { 495 Yobs_insert_data("cout_div",0,j,i,0,it,0); 496 } 478 497 479 498 } … … 535 554 load_init(niti); 536 555 556 //obs pour divergence 557 div_init(); 558 537 559 //Réglage de l'ébauche 538 560 load_eb(niti,nitn); … … 563 585 // Chargement de toutes les init et obs dans les bon pas de temps 564 586 load_init(niti); 587 588 589 //obs pour divergence 590 div_init(); 565 591 566 592 // Réglage de l'ébauche -
altifloat/src/floater_delta.d
r144 r147 1 1 #define FILTER 2 2 3 defval jtlag 24//nombre de pas de temps Delta t/ delta t4 5 6 7 defval jptfl 25//Nombre total de pas de temps8 defval jpnfl 3//nombre total de flotteurs3 defval jtlag 48//nombre de pas de temps Delta t/ delta t 4 5 6 7 defval jptfl 49 //Nombre total de pas de temps 8 defval jpnfl 5 //nombre total de flotteurs 9 9 10 10 11 11 //defval nlon 87 //nbre de points de grilles en longitude 12 12 //defval nlat 58 //nbre de points de grilles en latitude 13 //defval nlon 489 14 //defval nlat 438 15 16 #ifdef INC_GRID 17 #include "grid_def.d" 18 #else 13 19 defval nlon 489 14 20 defval nlat 438 21 #endif 15 22 16 23 defval nfloat 5 //nbre de flotteurs max par assim … … 18 25 #ifdef FILTER 19 26 defval K_FILTER //create a define K_FILTER in the source code 27 28 #ifdef INC_FIL 29 #include "fil_def.d" 30 #else 20 31 defval OFIL 5 //order of the filter 32 #endif 21 33 #else 22 34 defval OFIL 0 //Offtime of the main trajectory (0 since there is no filter) … … 36 48 #endif 37 49 38 // name M upt offtdt nbstep39 traj T_float M 1 OFIL 1jtlag //trajectoire pour r40 traj T_euler M 0 OFIL 1jtlag //trajectoire pour u et v50 // name M upt offt dt nbstep 51 traj T_float M 1 OFIL 1 jtlag //trajectoire pour r 52 traj T_euler M 0 OFIL 1 jtlag //trajectoire pour u et v 41 53 //for varibale u, put under nb step jtlag 42 54 43 55 //deltas 44 traj T_euler_d D 0 OFIL 1 145 traj T_float_d D1 OFIL 1 jtlag //trajectoires type modele ou tangent. permet de controler quel type activer dans le i46 56 traj T_euler_d D 0 OFIL 1 1 57 traj T_float_d D 1 OFIL 1 jtlag //trajectoires type modele ou tangent. permet de controler quel type activer dans le i 58 //traj T_euler_d_t D 0 OFIL 1 jtlag 47 59 48 60 #ifdef FILTER … … 59 71 space S_euler_d M nlon nlat T_euler_d 60 72 space S_eulerlocate_d M nfloat nlon nlat T_float_d 61 73 space S_euler_dt M nlon nlat T_float_d // for div calculation 62 74 63 75 modul r_float space S_float input 4 output 2 tempo … … 68 80 69 81 70 modul u space S_euler noward output 1 tempo //noward veut dire pas de calcul 71 modul v space S_euler noward output 1 tempo 72 modul locate space S_eulerlocate input 2 output 1 tempo 73 modul mask space S_euler noward output 1 74 82 modul u space S_euler noward output 1 tempo //noward veut dire pas de calcul 83 modul v space S_euler noward output 1 tempo 84 modul locate space S_eulerlocate input 2 output 1 tempo 85 modul mask space S_euler noward output 1 86 modul Div space S_euler input 4 output 1 tempo 87 modul Div_d space S_euler_d clonol Div 75 88 76 89 //deltas … … 102 115 103 116 modul locate_d space S_eulerlocate_d input 2 output 1 tempo 104 modul r_cout_d space S_float_d input 2 output 2 tempo cout 117 modul r_cout_d space S_float_d input 2 output 2 tempo cout 118 modul cout_div space S_euler_dt input 1 output 1 tempo cout 105 119 106 120 //Filter modules … … 113 127 ctin r_float 1..2 from r_float 1..2 i t-1 // i par default est la premier dimension, ici i=1 floater 114 128 ctin r_float 3..4 from ur 1..2 i t // comme c'est un calcul, il depend pas de la valeur initiale 129 130 ctin Div 1 from u 1 i+1 j t 131 ctin Div 2 from u 1 i-1 j t 132 ctin Div 3 from v 1 i j-1 t 133 ctin Div 4 from v 1 i j+1 t 134 135 ctin Div_d 1 from u_d 1 i+1 j 136 ctin Div_d 2 from u_d 1 i-1 j 137 ctin Div_d 3 from v_d 1 i j-1 138 ctin Div_d 4 from v_d 1 i j+1 139 140 ctin cout_div 1 from Div_d 1 i j t 115 141 116 142 ctin ur 1..8 from uinter 1..8 i t … … 171 197 exec disp_ct_in //afficher les connexions 172 198 199 order modinspace S_euler 200 order YA1 YA2 201 Div 202 forder 203 forder 204 173 205 #ifdef FILTER 174 206 order modinspace S_euler_df_t … … 180 212 order modinspace S_euler_d 181 213 order YA1 YA2 182 u_d v_d 214 u_d v_d Div_d 183 215 forder 184 216 forder … … 197 229 forder 198 230 231 order spaceintraj T_euler 232 S_euler 233 forder 199 234 200 235 order spaceintraj T_float … … 216 251 forder 217 252 218 253 order modinspace S_euler_dt 254 order YA1 YA2 255 cout_div 256 forder 257 forder 219 258 220 259 #ifdef FILTER … … 229 268 230 269 order spaceintraj T_float_d 231 S_eulerlocate_d S_float_d 232 forder 233 270 S_eulerlocate_d S_float_d S_euler_dt 271 forder 272 273 234 274 235 275 //insert_fct arg load_aviso
Note: See TracChangeset
for help on using the changeset viewer.