1 | module lect_topo_eurasie |
---|
2 | |
---|
3 | use module3D_phy |
---|
4 | use interface_input |
---|
5 | use io_netcdf_grisli |
---|
6 | |
---|
7 | implicit none |
---|
8 | |
---|
9 | character(len=100) :: topo_dep ! Topo de départ |
---|
10 | character(len=100) :: topo_ref ! Topo de référence |
---|
11 | character(len=100) :: grid_topo ! fichier grille |
---|
12 | character(len=100) :: ghf_fich ! fichier grille |
---|
13 | character(len=80) :: filin |
---|
14 | real, dimension(nx,ny,5) :: bidon ! pour l'appel a courbure |
---|
15 | character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
16 | |
---|
17 | contains |
---|
18 | |
---|
19 | subroutine input_topo |
---|
20 | |
---|
21 | integer :: ios |
---|
22 | real, dimension(nx,ny) :: varloc |
---|
23 | |
---|
24 | namelist/topo_file/topo_ref,topo_dep,grid_topo,ghf_fich |
---|
25 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
26 | read(num_param,topo_file) |
---|
27 | |
---|
28 | write(num_rep_42,'(A)')'!___________________________________________________________' |
---|
29 | write(num_rep_42,'(A)') '&topo_file ! nom du bloc ' |
---|
30 | write(num_rep_42,*) |
---|
31 | write(num_rep_42,'(A,A,A)') 'topo_ref = "',trim(topo_ref),'"' |
---|
32 | write(num_rep_42,'(A,A,A)') 'topo_dep = "',trim(topo_dep),'"' |
---|
33 | write(num_rep_42,'(A,A,A)') 'grid_topo = "',trim(grid_topo),'"' |
---|
34 | write(num_rep_42,'(A,A,A)') 'ghf_fich = "',trim(ghf_fich),'"' |
---|
35 | write(num_rep_42,*)'/' |
---|
36 | write(num_rep_42,'(A)') '! topo_ref= topo ref isostasie' |
---|
37 | write(num_rep_42,'(A)') '! topo_dep= topo de depart' |
---|
38 | write(num_rep_42,'(A)') '! grid_topo : fichier i,j,x,y,lon,lat' |
---|
39 | write(num_rep_42,'(A)') '! ghf_fich : fichier flux geothermique' |
---|
40 | write(num_rep_42,*) |
---|
41 | |
---|
42 | topo_ref=trim(dirnameinp)//trim(topo_ref) |
---|
43 | topo_dep=trim(dirnameinp)//trim(topo_dep) |
---|
44 | grid_topo=trim(dirnameinp)//trim(grid_topo) |
---|
45 | ghf_fich=trim(dirnameinp)//trim(ghf_fich) |
---|
46 | |
---|
47 | !write(num_rep_42,*) 'file1 = ', file1 |
---|
48 | !write(num_rep_42,*) 'file2 = ', file2 |
---|
49 | !write(num_rep_42,*)'/' |
---|
50 | !write(num_rep_42,428) '! file1 : topo de depart' |
---|
51 | !write(num_rep_42,428) '! file2 : topo de reference' |
---|
52 | !write(num_rep_42,*) |
---|
53 | |
---|
54 | !====================================== La reponse est 42 =========== |
---|
55 | ! write(42,*) |
---|
56 | ! write(42,*)' Fichiers en entree' |
---|
57 | ! write(42,*)'----------------------' |
---|
58 | !==================================================================== |
---|
59 | |
---|
60 | ! dans param : |
---|
61 | ! file1=TRIM(DIRNAMEINP)//'topo-21k.g40' ! topo LGM ICE_5G (1=topo de depart) |
---|
62 | ! file1=TRIM(DIRNAMEINP)//'hemin2.g40' |
---|
63 | ! file2=TRIM(DIRNAMEINP)//'hemin2.g40' ! topo actuelle |
---|
64 | ! write(42,*) 'topo de depart', file1 |
---|
65 | ! write(42,*) 'topo reference', file2 |
---|
66 | |
---|
67 | |
---|
68 | !!$! lecture adaptee aux fichiers intercomparaison EISMINT |
---|
69 | !!$ nxx=nx |
---|
70 | !!$ nyy=ny |
---|
71 | |
---|
72 | !!$! lecture de la topo actuelle |
---|
73 | !!$! --------------------------- |
---|
74 | !!$ open (20,file=TRIM(DIRNAMEINP)//file2,status='old') |
---|
75 | !!$ |
---|
76 | !!$ read(20,'(A80)') TITRE |
---|
77 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
78 | !!$ read(20,*) |
---|
79 | !!$ do J=1,ny |
---|
80 | !!$ do I=1,nx |
---|
81 | !!$ read (20,*) S0(I,J),H0(I,J),BSOC0(I,J) |
---|
82 | !!$ S0(i,j)=max(S0(i,j),0.) |
---|
83 | !!$ end do |
---|
84 | !!$ end do |
---|
85 | !!$ close(20) |
---|
86 | !!$ |
---|
87 | !!$ |
---|
88 | !!$! lecture de la topo de depart |
---|
89 | !!$! --------------------------- |
---|
90 | !!$ open (20,file=TRIM(DIRNAMEINP)//file1,status='old') |
---|
91 | !!$! open (20,file='../INPUT-DATA/hemin.g50') |
---|
92 | !!$ read(20,'(A80)') TITRE |
---|
93 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
94 | !!$ read(20,*) |
---|
95 | !!$ do J=1,ny |
---|
96 | !!$ do I=1,nx |
---|
97 | !!$ read (20,*) S(I,J),H(I,J),BSOC(I,J) |
---|
98 | !!$ end do |
---|
99 | !!$ end do |
---|
100 | !!$ close(20) |
---|
101 | |
---|
102 | |
---|
103 | ! lecture de la topo de référence |
---|
104 | call lect_input(1,'Bsoc',1,varloc,topo_ref,file_ncdf) ! socle |
---|
105 | Bsoc0(:,:)=varloc(:,:) |
---|
106 | call lect_input(1,'S',1,varloc,topo_ref,file_ncdf) ! surface |
---|
107 | S0(:,:)=varloc(:,:) |
---|
108 | call lect_input(1,'H',1,varloc,topo_ref,file_ncdf) ! epaisseur |
---|
109 | H0(:,:)=varloc(:,:) |
---|
110 | |
---|
111 | ! lecture de la topo de départ |
---|
112 | call lect_input(1,'Bsoc',1,varloc,topo_dep,file_ncdf) ! socle |
---|
113 | Bsoc(:,:)=varloc(:,:) |
---|
114 | call lect_input(1,'S',1,varloc,topo_dep,file_ncdf) ! surface |
---|
115 | S(:,:)=varloc(:,:) |
---|
116 | call lect_input(1,'H',1,varloc,topo_dep,file_ncdf) ! epaisseur |
---|
117 | H(:,:)=varloc(:,:) |
---|
118 | |
---|
119 | |
---|
120 | ! calcul des courbures du socle |
---|
121 | ! call courbure(nx,ny,dx,Bsoc,bidon(:,:,1),bidon(:,:,2),bidon(:,:,3), & |
---|
122 | ! bidon(:,:,4),socle_cry,bidon(:,:,5)) |
---|
123 | ! socle_cry(:,:)=socle_cry(:,:)*dx*dx |
---|
124 | |
---|
125 | ! lecture des coordonnées geographiques |
---|
126 | |
---|
127 | ! filin=TRIM(DIRNAMEINP)//grid_topo |
---|
128 | |
---|
129 | ! les coordonnees sont calculees en °dec avec GMT, |
---|
130 | ! les longitudes sont comprises entre -180 et +180 (negative a l'Ouest de |
---|
131 | ! Greenwich et positive a l'Est) |
---|
132 | open(unit=2004,file=grid_topo,iostat=ios) |
---|
133 | do k=1,nx*ny |
---|
134 | read(2004,*) i,j,XCC(i,j),YCC(i,j),XLONG(i,j),YLAT(i,j) |
---|
135 | enddo |
---|
136 | close(2004) |
---|
137 | |
---|
138 | xmin=xcc(1,1)/1000. |
---|
139 | ymin=ycc(1,1)/1000. |
---|
140 | xmax=xcc(nx,ny)/1000. |
---|
141 | ymax=ycc(nx,ny)/1000. |
---|
142 | |
---|
143 | ! lecture du flux geothermique de Shapiro |
---|
144 | ! open(88,file=TRIM(DIRNAMEINP)//'ijphi_hemin40.dat') |
---|
145 | ! open(88,file=ghf_fich) |
---|
146 | |
---|
147 | !!$ write(42,*) 'flux geothermique Shapiro : ',TRIM(DIRNAMEINP)//'ijphi_hemin40.dat' |
---|
148 | !!$ do k=1,nx*ny |
---|
149 | !!$ read(88,*) i,j,ghf(i,j) |
---|
150 | !!$ end do |
---|
151 | !!$ close(88) |
---|
152 | |
---|
153 | call lect_input(1,'ghf',1,ghf,ghf_fich,file_ncdf) |
---|
154 | |
---|
155 | ! pour passer les flux des mW/m2 au J/m2/an |
---|
156 | ghf(:,:)=-SECYEAR/1000.*ghf(:,:) |
---|
157 | ! write(42,*) 'flux geothermique fixe : 55 mW/m2' |
---|
158 | ! ghf(:,:)=-SECYEAR/1000.*55. !B6norcg2 |
---|
159 | |
---|
160 | ! print*,'lect topo' |
---|
161 | ! print*,'shb',S(101,91),H(101,91),B(101,91) |
---|
162 | ! print*,'shb0',S0(101,91),H0(101,91),BSOC0(101,91) |
---|
163 | ! Initialisation du Masque |
---|
164 | !------------------------------------------------ |
---|
165 | ! pour l'Hemisphere Nord mko vrai partout (version 2006) |
---|
166 | MK0(:,:)=1 |
---|
167 | |
---|
168 | !------------------------------------------------ |
---|
169 | end subroutine input_topo |
---|
170 | |
---|
171 | end module lect_topo_eurasie |
---|