1 | #!/bin/bash |
---|
2 | |
---|
3 | cp essai_grid.nc essai1.nc |
---|
4 | |
---|
5 | cat <<EOF > add_bound.nco |
---|
6 | defdim ("nvertex_lmd", 4) ; |
---|
7 | delta_x = alon(0,1) - alon(0,0) ; |
---|
8 | delta_y = alat(1,0) - alat(0,0) ; |
---|
9 | // |
---|
10 | bounds_alon[nvertex_lmd,lat,lon] = 0.0 ; |
---|
11 | bounds_alat[nvertex_lmd,lat,lon] = 0.0 ; |
---|
12 | // |
---|
13 | bounds_alon (0,:,:) = alon + delta_x*0.5 ; |
---|
14 | bounds_alat (0,:,:) = alat + delta_y*0.5 ; |
---|
15 | bounds_alon (1,:,:) = alon + delta_x*0.5 ; |
---|
16 | bounds_alat (1,:,:) = alat - delta_y*0.5 ; |
---|
17 | bounds_alon (2,:,:) = alon - delta_x*0.5 ; |
---|
18 | bounds_alat (2,:,:) = alat - delta_y*0.5 ; |
---|
19 | bounds_alon (3,:,:) = alon - delta_x*0.5 ; |
---|
20 | bounds_alat (3,:,:) = alat + delta_y*0.5 ; |
---|
21 | // |
---|
22 | where (bounds_alat > 90.0 ) bounds_alat = 90.0 ;; |
---|
23 | where (bounds_alat < -90.0 ) bounds_alat = -90.0 ;; |
---|
24 | // |
---|
25 | EOF |
---|
26 | |
---|
27 | ncap2 -S add_bound.nco -O -h essai1.nc essai2.nc |
---|