[4] | 1 | !> \file lect-anteis_mod.f90 |
---|
| 2 | !!Module pour la lecture de la topographie |
---|
| 3 | !< |
---|
| 4 | |
---|
| 5 | !> \namespace lect_topo_anteis |
---|
| 6 | !! Module pour la lecture de la topographie |
---|
| 7 | !! \author ... |
---|
| 8 | !! \date ... |
---|
| 9 | !! @note Used module |
---|
| 10 | !! @note - use module3D_phy |
---|
| 11 | !! @note - use param_phy_mod |
---|
| 12 | !< |
---|
| 13 | module lect_topo_anteis |
---|
| 14 | |
---|
| 15 | use module3D_phy |
---|
[27] | 16 | use interface_input |
---|
| 17 | use io_netcdf_grisli |
---|
| 18 | |
---|
| 19 | implicit none |
---|
| 20 | |
---|
| 21 | character(len=100) :: topo_dep ! Topo de départ |
---|
| 22 | character(len=100) :: topo_ref ! Topo de référence |
---|
| 23 | character(len=100) :: grid_topo ! fichier grille |
---|
| 24 | character(len=100) :: ghf_fich ! fichier grille |
---|
| 25 | character(len=100) :: filin |
---|
| 26 | character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
| 27 | |
---|
| 28 | ! character(len=100) :: file1 |
---|
| 29 | ! character(len=100) :: file2 |
---|
| 30 | |
---|
| 31 | real, dimension(nx,ny,5) :: bidon ! pour l'appel a courbure |
---|
[244] | 32 | ! afq 8/1/19: real :: sealevel0 |
---|
[27] | 33 | |
---|
[4] | 34 | contains |
---|
| 35 | |
---|
| 36 | subroutine input_topo |
---|
| 37 | |
---|
[27] | 38 | integer :: ios |
---|
[77] | 39 | ! pour les lectures ncdf |
---|
| 40 | real*8, dimension(:,:), pointer :: tab !< tableau 2d real pointer |
---|
[27] | 41 | |
---|
| 42 | namelist/topo_file/topo_ref,topo_dep,grid_topo,ghf_fich |
---|
| 43 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
| 44 | read(num_param,topo_file) |
---|
| 45 | ! formats pour les ecritures dans 42 |
---|
| 46 | 428 format(A) |
---|
| 47 | write(num_rep_42,428)'!___________________________________________________________' |
---|
| 48 | write(num_rep_42,428) '&topo_file ! input_topo ' |
---|
| 49 | write(num_rep_42,'(A,A)') 'topo_ref = ', topo_ref |
---|
| 50 | write(num_rep_42,'(A,A)') 'topo_dep = ', topo_dep |
---|
| 51 | write(num_rep_42,'(A,A)') 'grid_topo =', grid_topo |
---|
| 52 | write(num_rep_42,'(A,A)') 'ghf_fich = ', ghf_fich |
---|
| 53 | write(num_rep_42,*)'/' |
---|
| 54 | write(num_rep_42,428) '! topo_ref= topo ref isostasie' |
---|
| 55 | write(num_rep_42,428) '! topo_dep= topo de depart' |
---|
| 56 | write(num_rep_42,428) '! grid_topo : fichier i,j,x,y,lon,lat' |
---|
| 57 | write(num_rep_42,428) '! ghf_fich : fichier flux geothermique' |
---|
[4] | 58 | write(num_rep_42,*) |
---|
| 59 | |
---|
[27] | 60 | topo_ref=trim(dirnameinp)//trim(topo_ref) |
---|
| 61 | topo_dep=trim(dirnameinp)//trim(topo_dep) |
---|
| 62 | grid_topo=trim(dirnameinp)//trim(grid_topo) |
---|
| 63 | ghf_fich=trim(dirnameinp)//trim(ghf_fich) |
---|
| 64 | |
---|
| 65 | |
---|
[4] | 66 | ! lecture adaptee aux fichiers intercomparaison EISMINT |
---|
| 67 | nxx=nx |
---|
| 68 | nyy=ny |
---|
| 69 | |
---|
[27] | 70 | !!$! lecture de la topo actuelle |
---|
| 71 | !!$! --------------------------- |
---|
| 72 | !!$ open (20,file=TRIM(DIRNAMEINP)//file2,status='old') |
---|
| 73 | !!$ |
---|
| 74 | !!$ read(20,'(A80)') TITRE |
---|
| 75 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 76 | !!$ read(20,*) |
---|
| 77 | !!$ do J=1,ny |
---|
| 78 | !!$ do I=1,nx |
---|
| 79 | !!$ read (20,*) S0(I,J),H0(I,J),BSOC0(I,J) |
---|
| 80 | !!$ S0(i,j)=max(S0(i,j),0.) |
---|
| 81 | !!$ end do |
---|
| 82 | !!$ end do |
---|
| 83 | !!$ close(20) |
---|
| 84 | !!$ |
---|
| 85 | !!$ |
---|
| 86 | !!$! lecture de la topo de depart |
---|
| 87 | !!$! --------------------------- |
---|
| 88 | !!$ open (20,file=TRIM(DIRNAMEINP)//file1,status='old') |
---|
| 89 | !!$! open (20,file='../INPUT-DATA/hemin.g50') |
---|
| 90 | !!$ read(20,'(A80)') TITRE |
---|
| 91 | !!$ read(20,*) NI,NJ,NXX,NYY,STEP |
---|
| 92 | !!$ read(20,*) |
---|
| 93 | !!$ do J=1,ny |
---|
| 94 | !!$ do I=1,nx |
---|
| 95 | !!$ read (20,*) S(I,J),H(I,J),BSOC(I,J) |
---|
| 96 | !!$ end do |
---|
| 97 | !!$ end do |
---|
| 98 | !!$ close(20) |
---|
[4] | 99 | |
---|
[27] | 100 | ! lecture de la topo de référence |
---|
| 101 | ! ------------------------------- |
---|
| 102 | ! Cette topo sert a calculer le socle de reference pour l'isostasie |
---|
| 103 | ! voir init_iso et a avoir une surface de reference pour les temperatures |
---|
| 104 | ! lecture adaptee aux fichiers ZBL.dat ou netcdf ou grd |
---|
[77] | 105 | ! call lect_input(1,'Bsoc',1,Bsoc0,topo_ref,file_ncdf) ! socle |
---|
| 106 | ! call lect_input(1,'S',1,S0,topo_ref,file_ncdf) ! surface |
---|
| 107 | ! call lect_input(1,'H',1,H0,topo_ref,file_ncdf) ! epaisseur |
---|
| 108 | |
---|
| 109 | ! lecture pour eviter plantage avec compile -O0 |
---|
| 110 | call Read_Ncdf_var('Bsoc',topo_ref,tab) |
---|
| 111 | Bsoc0(:,:) = tab(:,:) |
---|
| 112 | call Read_Ncdf_var('S',topo_ref,tab) |
---|
| 113 | S0(:,:) = tab(:,:) |
---|
| 114 | call Read_Ncdf_var('H',topo_ref,tab) |
---|
| 115 | H0(:,:) = tab(:,:) |
---|
[88] | 116 | !~ !cdc correction de 3 pts qui posent probleme (pente tres forte): |
---|
| 117 | !~ S0(38,53)=1400. |
---|
| 118 | !~ Bsoc0(38,53)=-1000. |
---|
| 119 | !~ H0(38,53)=S0(38,53)-Bsoc0(38,53) |
---|
| 120 | !~ |
---|
| 121 | !~ S0(35,53)=1300. |
---|
| 122 | !~ Bsoc0(35,53)=-1000. |
---|
| 123 | !~ H0(35,53)=S0(35,53)-Bsoc0(35,53) |
---|
| 124 | !~ |
---|
| 125 | !~ S0(35,56)=1200. |
---|
| 126 | !~ Bsoc0(35,56)=-1000. |
---|
| 127 | !~ H0(35,56)=S0(35,56)-Bsoc0(35,56) |
---|
| 128 | |
---|
[27] | 129 | !cdc correction point pole sud : |
---|
| 130 | ! S0(71,71)=(S0(71,70)+S0(71,72)+S0(70,71)+S0(72,71))/4. |
---|
| 131 | ! Bsoc0(71,71)=(Bsoc0(71,70)+Bsoc0(71,72)+Bsoc0(70,71)+Bsoc0(72,71))/4. |
---|
[4] | 132 | |
---|
| 133 | |
---|
[27] | 134 | ! where (S0(:,:).GT.0) |
---|
| 135 | ! H0(:,:)=S0(:,:)-BSOC0(:,:) |
---|
| 136 | ! elsewhere |
---|
| 137 | ! H0(:,:)=1. |
---|
| 138 | ! endwhere |
---|
| 139 | |
---|
[35] | 140 | |
---|
| 141 | where (BSOC(:,:).LT.-9999.) |
---|
| 142 | BSOC(:,:)=-9999. |
---|
| 143 | endwhere |
---|
| 144 | |
---|
[244] | 145 | ! afq 8/1/19: sealevel0=0. ! voir a passer dans le fichier parametre |
---|
| 146 | ! afq 8/1/19: S0(:,:)=max(S0(:,:),sealevel0) ! pour etre au niveau des mers : ATTENTION si SEALEV <0 |
---|
[27] | 147 | mk0(:,:) = 1 ! mk0=0 pour les zones interdites |
---|
| 148 | |
---|
| 149 | ! lecture de la topo de depart |
---|
| 150 | ! --------------------------- |
---|
| 151 | ! lecture adaptee aux fichiers ZBL.dat ou netcdf ou grd |
---|
[77] | 152 | ! call lect_input(1,'Bsoc',1,Bsoc,topo_dep,file_ncdf) ! socle |
---|
| 153 | ! call lect_input(1,'S',1,S,topo_dep,file_ncdf) ! surface |
---|
| 154 | ! call lect_input(1,'H',1,H,topo_dep,file_ncdf) ! epaisseur |
---|
| 155 | ! lecture pour eviter plantage avec compile -O0 |
---|
| 156 | call Read_Ncdf_var('Bsoc',topo_dep,tab) |
---|
| 157 | Bsoc(:,:) = tab(:,:) |
---|
| 158 | call Read_Ncdf_var('S',topo_dep,tab) |
---|
| 159 | S(:,:) = tab(:,:) |
---|
| 160 | call Read_Ncdf_var('H',topo_dep,tab) |
---|
| 161 | H(:,:) = tab(:,:) |
---|
[88] | 162 | |
---|
| 163 | !~ !cdc correction de 3 pts qui posent probleme (pente tres forte): |
---|
| 164 | !~ S(39,54)=1400. |
---|
| 165 | !~ Bsoc(39,54)=-1000. |
---|
| 166 | !~ H(39,54)=S(39,54)-Bsoc(39,54) |
---|
| 167 | !~ |
---|
| 168 | !~ S(36,54)=1300. |
---|
| 169 | !~ Bsoc(36,54)=-1000. |
---|
| 170 | !~ H(36,54)=S(36,54)-Bsoc(36,54) |
---|
| 171 | !~ |
---|
| 172 | !~ S(36,57)=1200. |
---|
| 173 | !~ Bsoc(36,57)=-1000. |
---|
| 174 | !~ H(36,57)=S(36,57)-Bsoc(36,57) |
---|
[77] | 175 | |
---|
[27] | 176 | ! S(71,71)=(S(71,70)+S(71,72)+S(70,71)+S(72,71))/4. |
---|
| 177 | ! Bsoc(71,71)=(Bsoc(71,70)+Bsoc(71,72)+Bsoc(70,71)+Bsoc(72,71))/4. |
---|
| 178 | ! where (S(:,:).GT.0) |
---|
| 179 | ! H(:,:)=S(:,:)-BSOC(:,:) |
---|
| 180 | ! elsewhere |
---|
| 181 | ! H(:,:)=1. |
---|
| 182 | ! endwhere |
---|
[244] | 183 | ! afq 8/1/19: S(:,:)=max(S(:,:),0.) ! pour etre au niveau des mers : ATTENTION si SEALEV <0 |
---|
[123] | 184 | H(:,:)=max(H(:,:),0.) ! pas d epaisseurs negatives |
---|
[27] | 185 | |
---|
| 186 | |
---|
[4] | 187 | !!$ |
---|
[27] | 188 | !!$ ! socle |
---|
| 189 | !!$ filin='bedelev-2000-40km.dat' |
---|
| 190 | !!$ call lect_eis(nx,ny,BSOC,filin,DIRNAMEINP) |
---|
| 191 | !!$ write(num_rep_42,*) 'fichier BSOC (socle) : ', filin |
---|
| 192 | !!$ Bsoc0(:,:)=Bsoc(:,:) |
---|
| 193 | !!$ ! surface |
---|
| 194 | !!$ filin='surface-2000-40km.dat' |
---|
| 195 | !!$ call lect_eis(nx,ny,S,filin,DIRNAMEINP) |
---|
| 196 | !!$ write(num_rep_42,*) 'fichier surface : ', filin |
---|
[4] | 197 | !!$ |
---|
[27] | 198 | !!$ ! epaisseur |
---|
| 199 | !!$ filin='icethic-2000-40km.dat' |
---|
| 200 | !!$ call lect_eis(nx,ny,H,filin,DIRNAMEINP) |
---|
| 201 | !!$ write(num_rep_42,*) 'fichier epaisseur : ', filin |
---|
| 202 | !!$ H0(:,:)=H(:,:) |
---|
[4] | 203 | !!$ |
---|
| 204 | !!$ |
---|
[27] | 205 | !!$ ! masque |
---|
| 206 | !!$ filin='maskHUY40km.dat' |
---|
| 207 | !!$ call lect_ieis(nx,ny,MK0,filin,DIRNAMEINP) |
---|
| 208 | !!$ write(num_rep_42,*) 'fichier masque : ', filin |
---|
| 209 | !!$ |
---|
| 210 | !!$ ! enlever les epaisseurs fictives de Philippe |
---|
| 211 | !!$ do I=1,NX |
---|
| 212 | !!$ do J=1,NY |
---|
| 213 | !!$ ! attention les valeurs de masque de Philippe sont differentes |
---|
| 214 | !!$ if ((MK0(I,J).gt.1).and.(H(i,j).le.218.00)) then ! mer libre |
---|
| 215 | !!$ H(i,j)=1. |
---|
| 216 | !!$ S(I,J)=H(i,j)-(RO/ROW)*H(i,j) |
---|
| 217 | !!$ endif |
---|
| 218 | !!$ end do |
---|
[4] | 219 | !!$ end do |
---|
| 220 | |
---|
| 221 | |
---|
[27] | 222 | ! S0(:,:)=S(:,:) |
---|
[4] | 223 | |
---|
| 224 | ! pour l'Antarctique masque mko vrai partout (version 2006) |
---|
| 225 | MK0(:,:)=1 |
---|
| 226 | |
---|
| 227 | ! determination des flot |
---|
| 228 | do J=1,NY |
---|
| 229 | do I=1,NX |
---|
[244] | 230 | if ((BSOC(I,J)+H(I,J)*RO/ROW -sealevel_2d(i,j)).LT.0.) then |
---|
[4] | 231 | FLOT(I,J)=.TRUE. |
---|
| 232 | else |
---|
| 233 | FLOT(I,J)=.FALSE. |
---|
| 234 | endif |
---|
| 235 | enddo |
---|
| 236 | enddo |
---|
| 237 | |
---|
| 238 | |
---|
[27] | 239 | ! calcul des courbures du socle |
---|
[4] | 240 | |
---|
[88] | 241 | ! call courbure(nx,ny,dx,Bsoc,bidon(:,:,1),bidon(:,:,2),bidon(:,:,3), & |
---|
| 242 | ! bidon(:,:,4),socle_cry,bidon(:,:,5)) |
---|
| 243 | ! socle_cry(:,:)=socle_cry(:,:)*dx*dx |
---|
[4] | 244 | |
---|
| 245 | ! lecture des coordonnées geographiques |
---|
[27] | 246 | ! filin=TRIM(DIRNAMEINP)//'coord-Ant-40km.dat' |
---|
[4] | 247 | |
---|
| 248 | ! les coordonnees sont calculees en °dec avec GMT, |
---|
| 249 | ! les longitudes sont comprises entre -180 et +180 (negative a l'Ouest de |
---|
| 250 | ! Greenwich et positive a l'Est) |
---|
[27] | 251 | open(unit=2004,file=grid_topo,iostat=ios) |
---|
[4] | 252 | do k=1,nx*ny |
---|
[27] | 253 | read(2004,*) i,j,xcc(i,j),ycc(i,j),Xlong(i,j),Ylat(i,j) |
---|
[4] | 254 | enddo |
---|
| 255 | close(2004) |
---|
| 256 | |
---|
| 257 | xmin=xcc(1,1)/1000. |
---|
| 258 | ymin=ycc(1,1)/1000. |
---|
| 259 | xmax=xcc(nx,ny)/1000. |
---|
| 260 | ymax=ycc(nx,ny)/1000. |
---|
| 261 | |
---|
| 262 | ! lecture du flux geothermique de Shapiro |
---|
[27] | 263 | open(88,file=ghf_fich) |
---|
[4] | 264 | |
---|
[35] | 265 | ! write(num_rep_42,*) 'flux geothermique Shapiro : ', TRIM(DIRNAMEINP)//'ijphi-40km-ant.dat' |
---|
| 266 | ! do k=1,nx*ny |
---|
| 267 | ! read(88,*) i,j,ghf(i,j) |
---|
| 268 | ! end do |
---|
| 269 | ! close(88) |
---|
[4] | 270 | |
---|
[77] | 271 | ! call lect_input(1,'ghf',1,ghf,ghf_fich,file_ncdf) |
---|
| 272 | ! pour eviter plantage -O0 |
---|
| 273 | call Read_Ncdf_var('ghf',ghf_fich,tab) |
---|
| 274 | ghf(:,:) = tab(:,:) |
---|
[4] | 275 | |
---|
| 276 | ! pour passer les flux des mW/m2 au J/m2/an |
---|
| 277 | ghf(:,:)=-SECYEAR/1000.*ghf(:,:) |
---|
| 278 | |
---|
[27] | 279 | !------------------------------------------------ |
---|
| 280 | ! mko vrai partout (version 2006) |
---|
| 281 | MK0(:,:)=1 |
---|
[4] | 282 | |
---|
[27] | 283 | !------------------------------------------------ |
---|
[4] | 284 | |
---|
| 285 | |
---|
| 286 | end subroutine input_topo |
---|
| 287 | |
---|
| 288 | |
---|
| 289 | end module lect_topo_anteis |
---|