1 | function [ 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 | |
---|
12 | read_aviso( aviso_netcdf_file_bck, aviso_netcdf_file_next, Nlat, Nlong, nbofdays ) |
---|
13 | |
---|
14 | load ../obs_float/uzero.dat |
---|
15 | load ../obs_float/vzero.dat |
---|
16 | load ../obs_float/unext3d.dat |
---|
17 | load ../obs_float/vnext3d.dat |
---|
18 | |
---|
19 | |
---|
20 | outfile='../obs_float/vel_bck_all.dat'; |
---|
21 | format long |
---|
22 | uinit='../obs_float/uzero.dat'; |
---|
23 | vinit='../obs_float/vzero.dat'; |
---|
24 | ufin='../obs_float/unext3d.dat'; |
---|
25 | vfin='../obs_float/vnext3d.dat'; |
---|
26 | fid=fopen(outfile,'w'); |
---|
27 | |
---|
28 | count=nbofdays*24/steptime; |
---|
29 | |
---|
30 | for i=1:count |
---|
31 | |
---|
32 | |
---|
33 | time_step=i; |
---|
34 | ubck=load(uinit); |
---|
35 | vbck=load(vinit); |
---|
36 | unex=load(ufin); |
---|
37 | vnex=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 | |
---|
53 | end |
---|
54 | |
---|
55 | fclose(fid); |
---|
56 | |
---|
57 | |
---|
58 | end |
---|
59 | |
---|