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