1 | module lect_topo_greeneem |
---|
2 | |
---|
3 | use module3D_phy |
---|
4 | use param_phy_mod |
---|
5 | !cdc |
---|
6 | use interface_input |
---|
7 | use io_netcdf_grisli |
---|
8 | |
---|
9 | implicit none |
---|
10 | |
---|
11 | character(len=100) :: topo_dep ! Topo de départ |
---|
12 | character(len=100) :: topo_ref ! Topo de référence |
---|
13 | character(len=100) :: grid_topo ! fichier grille |
---|
14 | character(len=100) :: ghf_fich ! fichier grille |
---|
15 | character(len=100) :: filin |
---|
16 | real, dimension(nx,ny,5) :: bidon ! pour l'appel a courbure |
---|
17 | !real :: ghf0 ! flux geothermique constant en mW/m2 |
---|
18 | |
---|
19 | real, dimension(nx,ny) :: Bsoc_bamber, S_bamber, Bsoc_new |
---|
20 | character(len=100) :: topo_surf !< surface file name |
---|
21 | character(len=100) :: topo_bed !< bedrock file name |
---|
22 | character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
23 | |
---|
24 | integer :: n1,n2,ndx |
---|
25 | real :: sealevel0 |
---|
26 | |
---|
27 | contains |
---|
28 | |
---|
29 | subroutine input_topo |
---|
30 | |
---|
31 | namelist/toponeem/topo_ref,topo_dep,grid_topo,ghf_fich |
---|
32 | |
---|
33 | 428 format(A) |
---|
34 | |
---|
35 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
36 | |
---|
37 | read(num_param,toponeem) |
---|
38 | |
---|
39 | write(num_rep_42,428)'!___________________________________________________________' |
---|
40 | write(num_rep_42,428) '&toponeen ! module lect_topo_greeneem' |
---|
41 | write(num_rep_42,'(A,A)') 'topo_ref =', topo_ref |
---|
42 | write(num_rep_42,'(A,A)') 'topo_dep =', topo_dep |
---|
43 | write(num_rep_42,'(A,A)') 'grid_topo =', grid_topo |
---|
44 | write(num_rep_42,*) 'ghf_fich =', ghf_fich |
---|
45 | write(num_rep_42,*)'/' |
---|
46 | write(num_rep_42,428) '! topo_ref= topo actuelle' |
---|
47 | write(num_rep_42,428) '! topo_dep= topo de depart' |
---|
48 | write(num_rep_42,428) '! grid_topo : fichier i,j,x,y,lon,lat' |
---|
49 | write(num_rep_42,428) '! ghf_fich : fichier flux geothermique' |
---|
50 | write(num_rep_42,*) |
---|
51 | |
---|
52 | |
---|
53 | topo_ref=trim(dirnameinp)//trim(topo_ref) |
---|
54 | topo_dep=trim(dirnameinp)//trim(topo_dep) |
---|
55 | grid_topo=trim(dirnameinp)//trim(grid_topo) |
---|
56 | ghf_fich=trim(dirnameinp)//trim(ghf_fich)!trim(ghf0) |
---|
57 | |
---|
58 | sealevel0=0. ! voir a passer dans le fichier parametre |
---|
59 | |
---|
60 | ! lecture de la topo de référence |
---|
61 | ! ------------------------------- |
---|
62 | ! Cette topo sert a calculer le socle de reference pour l'isostasie |
---|
63 | ! voir init_iso et a avoir une surface de reference pour les temperatures |
---|
64 | ! lecture adaptee aux fichiers ZBL.dat ou netcdf ou grd |
---|
65 | call lect_input(1,'Bsoc',1,Bsoc0,topo_ref,file_ncdf) ! socle |
---|
66 | call lect_input(1,'S',1,S0,topo_ref,file_ncdf) ! surface |
---|
67 | call lect_input(1,'H',1,H0,topo_ref,file_ncdf) ! epaisseur |
---|
68 | |
---|
69 | S0(:,:)=max(S0(:,:),sealevel0) ! pour etre au niveau des mers : ATTENTION si SEALEV <0 |
---|
70 | mk0(:,:) = 1 ! mk0=0 pour les zones interdites |
---|
71 | |
---|
72 | ! lecture de la topo de depart |
---|
73 | ! --------------------------- |
---|
74 | ! lecture adaptee aux fichiers ZBL.dat ou netcdf ou grd |
---|
75 | call lect_input(1,'Bsoc',1,Bsoc,topo_dep,file_ncdf) ! socle |
---|
76 | call lect_input(1,'S',1,S,topo_dep,file_ncdf) ! surface |
---|
77 | call lect_input(1,'H',1,H,topo_dep,file_ncdf) ! epaisseur |
---|
78 | S(:,:)=max(S(:,:),0.) ! pour etre au niveau des mers : ATTENTION si SEALEV <0 |
---|
79 | H(:,:)=max(H(:,:),1.) ! pour avoir au moins 1 m |
---|
80 | |
---|
81 | |
---|
82 | ! calcul de flottaison |
---|
83 | do j=1,ny |
---|
84 | do i=1,nx |
---|
85 | |
---|
86 | archim = Bsoc(i,j)+H(i,j)*ro/row -sealevel |
---|
87 | |
---|
88 | if ((ARCHIM.LT.0.).and.(H(I,J).gt.1.E-3)) then ! le point flotte |
---|
89 | flot(i,j)=.true. |
---|
90 | else |
---|
91 | flot(i,j)=.false. |
---|
92 | end if |
---|
93 | |
---|
94 | end do |
---|
95 | end do |
---|
96 | |
---|
97 | ! lecture des coordonnées geographiques |
---|
98 | |
---|
99 | |
---|
100 | ! les fichiers EISMINT etaient ranges i,j,lat,lon |
---|
101 | ! je n'arrive pas a retrouver la projection exacte. |
---|
102 | ! le x est donc calcule en partant de 0, 0 |
---|
103 | |
---|
104 | open(unit=20,file=grid_topo,iostat=ios) |
---|
105 | read(20,*) |
---|
106 | read(20,*) |
---|
107 | read(20,*) n1,n2,ndx |
---|
108 | read(20,*) |
---|
109 | |
---|
110 | if ((n1.eq.nx).and.(n2.eq.ny).and.(ndx.eq.nint(dx/1000.))) then |
---|
111 | ! le fichier correspond bien a |
---|
112 | ! la grille definie dans paradim |
---|
113 | |
---|
114 | do k=1,nx*ny |
---|
115 | read(20,*) i,j,xcc(i,j),ycc(i,j),xlong(i,j),ylat(i,j) |
---|
116 | enddo |
---|
117 | ! pour assurer la continuite des temperatures parametrees : |
---|
118 | where(xlong(:,:).lt.100.) |
---|
119 | xlong(:,:)=xlong(:,:)+360. |
---|
120 | end where |
---|
121 | |
---|
122 | else |
---|
123 | write(6,*) 'le fichier ne correspond pas a la grille definie' |
---|
124 | STOP |
---|
125 | end if |
---|
126 | close(20) |
---|
127 | |
---|
128 | ! xcc est en m |
---|
129 | xmin=xcc(1,1) |
---|
130 | ymin=ycc(1,1) |
---|
131 | do j=1,ny |
---|
132 | do i=1,nx |
---|
133 | xcc(i,j)=xcc(i,j)*1000. |
---|
134 | ycc(i,j)=ycc(i,j)*1000. |
---|
135 | end do |
---|
136 | end do |
---|
137 | xmax=xcc(nx,ny)/1000 |
---|
138 | ymax=ycc(nx,ny)/1000 |
---|
139 | |
---|
140 | ! lecture de la carte de flux geothermique |
---|
141 | open (20,file=ghf_fich) |
---|
142 | read(20,*) n1,n2,ndx |
---|
143 | if ((n1.eq.nx).and.(n2.eq.ny).and.(ndx.eq.nint(dx/1000.))) then |
---|
144 | ! le fichier correspond bien a |
---|
145 | ! la grille definie dans paradim |
---|
146 | do j=1,ny |
---|
147 | do i=1,nx |
---|
148 | read(20,*) ghf(i,j) |
---|
149 | end do |
---|
150 | end do |
---|
151 | close(20) |
---|
152 | else |
---|
153 | write(6,*) 'le fichier ne correspond pas a la grille definie' |
---|
154 | STOP |
---|
155 | end if |
---|
156 | |
---|
157 | |
---|
158 | ! flux geothermique : pour passer les flux des mW/m2 aux J/m2/an |
---|
159 | ghf(:,:)=-secyear*ghf(:,:) |
---|
160 | !ghf(:,:)=-secyear*50.0/1000. !ghf0 ! pour flux constant |
---|
161 | |
---|
162 | |
---|
163 | |
---|
164 | ! calcul des courbures du socle |
---|
165 | call courbure(nx,ny,dx,Bsoc,bidon(:,:,1),bidon(:,:,2),bidon(:,:,3), & |
---|
166 | bidon(:,:,4),socle_cry,bidon(:,:,5)) |
---|
167 | socle_cry(:,:)=socle_cry(:,:)*dx*dx |
---|
168 | |
---|
169 | !------------------------------------------------ |
---|
170 | end subroutine input_topo |
---|
171 | |
---|
172 | |
---|
173 | end module lect_topo_greeneem |
---|