1 | program recomp_donnees_bamber |
---|
2 | implicit none |
---|
3 | |
---|
4 | integer,parameter :: nx= 301 ! nombre de noeuds selon x (nb colonnes) |
---|
5 | integer,parameter :: ny= 561 ! nombre de noeuds selon y (nb lignes) |
---|
6 | integer,parameter :: pasx = 5000 ! pas selon x : 5km |
---|
7 | integer,parameter :: pasy = 5000 ! pas selon y : 5km |
---|
8 | |
---|
9 | integer i,j ! entiers de boucle |
---|
10 | |
---|
11 | real,dimension(nx,ny) :: Surf ! matrice contenant l'altitude de surface |
---|
12 | real,dimension(nx,ny) :: Bed ! matrice contenant l'altitude du socle |
---|
13 | real,dimension(nx,ny) :: Thick ! matrice contenant l'epaisseur de la glace |
---|
14 | |
---|
15 | integer xi ! position selon x (en metre) dans la projection |
---|
16 | integer yj ! position selon y (en metre) dans la projection |
---|
17 | integer xmin ! coin inferieur gauche, selon x |
---|
18 | integer ymin ! coin inferieur gauche, selon y |
---|
19 | |
---|
20 | character(len=55) :: dir_input |
---|
21 | character(len=55) :: dir_output |
---|
22 | dir_input='/pc96/work250g/aquiquet/DATA/BASE_PROPRE/IN_OUTPUT' |
---|
23 | dir_output='/pc96/work250g/aquiquet/DATA/BASE_PROPRE/IN_OUTPUT' |
---|
24 | |
---|
25 | 700 format(10(f9.1)) ! fichiers originels composes de lignes de 10 elements |
---|
26 | 800 format(2(i4),2(i7),f9.1) |
---|
27 | 900 format(2(i7),f9.1) |
---|
28 | |
---|
29 | open(20, file=trim(dir_input)//'/IN_INIT/surface_5km_corrected.txt',form='formatted',status='old') |
---|
30 | do j=1,ny ! on boucle sur le nombre de ligne |
---|
31 | read(20,700) Surf(:,j) ! pour eviter la ligne avec un seul element |
---|
32 | end do |
---|
33 | close(20) |
---|
34 | |
---|
35 | open(21, file=trim(dir_input)//'/IN_INIT/bed_5km_corrected.txt', form='formatted',status='old') |
---|
36 | do j=1,ny |
---|
37 | read(21,700) Bed(:,j) |
---|
38 | end do |
---|
39 | close(21) |
---|
40 | |
---|
41 | open(22, file=trim(dir_input)//'/IN_INIT/thick_5km_corrected.txt',form='formatted',status='old') |
---|
42 | do j=1,ny |
---|
43 | read(22,700) Thick(:,j) |
---|
44 | end do |
---|
45 | close(22) |
---|
46 | |
---|
47 | ! on cree les nouveux fichiers : |
---|
48 | ! type matrice : |
---|
49 | open(30, file=trim(dir_output)//'/TEMP/bamber_surface_mat.txt',form='formatted',status='unknown') |
---|
50 | open(31, file=trim(dir_output)//'/TEMP/bamber_bed_mat.txt',form='formatted',status='unknown') |
---|
51 | open(32, file=trim(dir_output)//'/TEMP/bamber_thick_mat.txt',form='formatted',status='unknown') |
---|
52 | do j=1,ny |
---|
53 | write(30,*) Surf(:,j) |
---|
54 | write(31,*) Bed(:,j) |
---|
55 | write(32,*) Thick(:,j) |
---|
56 | enddo |
---|
57 | close(30) |
---|
58 | close(31) |
---|
59 | close(32) |
---|
60 | |
---|
61 | ! type ijxyz |
---|
62 | open(40, file=trim(dir_output)//'/TEMP/bamber_surface_ijxyz.txt',form='formatted',status='unknown') |
---|
63 | open(41, file=trim(dir_output)//'/TEMP/bamber_bed_ijxyz.txt',form='formatted',status='unknown') |
---|
64 | open(42, file=trim(dir_output)//'/TEMP/bamber_thick_ijxyz.txt',form='formatted',status='unknown') |
---|
65 | xmin = -800000 |
---|
66 | ymin = -3400000 |
---|
67 | do j=1,ny |
---|
68 | do i=1,nx |
---|
69 | xi=xmin+(i-1)*pasx |
---|
70 | yj=ymin+(j-1)*pasy |
---|
71 | write(40,800) i,j,xi/1000,yj/1000,Surf(i,j) |
---|
72 | write(41,800) i,j,xi/1000,yj/1000,Bed(i,j) |
---|
73 | write(42,800) i,j,xi/1000,yj/1000,Thick(i,j) |
---|
74 | enddo |
---|
75 | enddo |
---|
76 | close(40) |
---|
77 | close(41) |
---|
78 | close(42) |
---|
79 | |
---|
80 | ! type xyz |
---|
81 | open(50, file=trim(dir_output)//'/TEMP/bamber_surface_xyz.txt',form='formatted',status='unknown') |
---|
82 | open(51, file=trim(dir_output)//'/TEMP/bamber_bed_xyz.txt',form='formatted',status='unknown') |
---|
83 | open(52, file=trim(dir_output)//'/TEMP/bamber_thick_xyz.txt',form='formatted',status='unknown') |
---|
84 | xmin = -800000 |
---|
85 | ymin = -3400000 |
---|
86 | do j=1,ny |
---|
87 | do i=1,nx |
---|
88 | xi=xmin+(i-1)*pasx |
---|
89 | yj=ymin+(j-1)*pasy |
---|
90 | write(50,900) xi/1000,yj/1000,Surf(i,j) |
---|
91 | write(51,900) xi/1000,yj/1000,Bed(i,j) |
---|
92 | write(52,900) xi/1000,yj/1000,Thick(i,j) |
---|
93 | enddo |
---|
94 | enddo |
---|
95 | close(50) |
---|
96 | close(51) |
---|
97 | close(52) |
---|
98 | |
---|
99 | end program recomp_donnees_bamber |
---|
100 | |
---|