source: altifloat/matlab_toolbox/make_bck.m @ 160

Last change on this file since 160 was 129, checked in by jbrlod, 10 years ago

last version of Varanth

File size: 1.4 KB
Line 
1function [ output_args ] = make_bck( aviso_netcdf_file_bck, aviso_netcdf_file_next, Nlat, Nlong, nbofdays, steptime )
2
3%%%%%%%%%% This code takes the date of the biginning and the end of the
4%%%%%%%%%% assimilation and gets the velocity fields at the beginning and
5%%%%%%%%%% the end times. It also takes the nb of step times in HOURS and it
6%%%%%%%%%% interpolates between the the first and the last time to get the
7%%%%%%%%%% velocity field at each step time. Finally, it gives  a file
8%%%%%%%%%% containing a list of the velocity fields at each time so we can
9%%%%%%%%%% use it in our YAO code afterwards.
10
11
12read_aviso( aviso_netcdf_file_bck, aviso_netcdf_file_next, Nlat, Nlong, nbofdays )
13
14load ../obs_float/uzero.dat
15load ../obs_float/vzero.dat
16load ../obs_float/unext3d.dat
17load ../obs_float/vnext3d.dat
18
19
20outfile='../obs_float/vel_bck_all.dat';
21format long
22uinit='../obs_float/uzero.dat';
23vinit='../obs_float/vzero.dat';
24ufin='../obs_float/unext3d.dat';
25vfin='../obs_float/vnext3d.dat';
26fid=fopen(outfile,'w');
27
28count=nbofdays*24/steptime;
29
30for i=1:count
31   
32   
33    time_step=i;
34ubck=load(uinit);
35vbck=load(vinit);
36unex=load(ufin);
37vnex=load(vfin);
38
39 vel_bck=zeros(size(ubck,1),5);
40
41 vel_bck(:,1)=time_step;
42 vel_bck(:,2)=ubck(:,2);
43 vel_bck(:,3)=ubck(:,3);
44 vel_bck(:,4)=ubck(:,4)+(unex(:,4)-ubck(:,4))*i/count;
45 vel_bck(:,5)=vbck(:,4)+(vnex(:,4)-vbck(:,4))*i/count;
46
47
48
49 fprintf(fid,'%d %d %d %f %f\n',vel_bck');
50
51 
52
53end
54
55 fclose(fid);
56
57
58end
59
Note: See TracBrowser for help on using the repository browser.