[4] | 1 | !> \file dragging-vit_bil_CISM_gen_neem_mod.f90 |
---|
| 2 | !! Definition des zones de streams apres lecture d'une carte evaluee offline |
---|
| 3 | !< |
---|
| 4 | |
---|
| 5 | !> \namespace dragging_neem |
---|
| 6 | !! Definition zone stream. Input neem : critere sur vitesse de bilan et sur la 'courbure' |
---|
| 7 | !! \author ... |
---|
| 8 | !! \date ... |
---|
| 9 | !! @note Defini les zones de stream avec : |
---|
| 10 | !! @note - un critere sur la hauteur d'eau |
---|
| 11 | !! @note - un critere de fleuves actuels |
---|
| 12 | !! @note Attention il faut fonctionner en additionnant SIA et Stream pour éviter les pb |
---|
| 13 | !! de fleuves en pointille |
---|
| 14 | !! @note Used module |
---|
| 15 | !! @note - use module3D_phy |
---|
| 16 | !! @note - use param_phy_mod |
---|
| 17 | !< |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | module dragging_neem |
---|
| 21 | |
---|
| 22 | ! Defini les zones de stream avec : |
---|
| 23 | ! * un critere sur la hauteur d'eau |
---|
| 24 | ! * un critere de fleuves actuels |
---|
| 25 | ! attention il faut fonctionner en additionnant SIA et Stream pour éviter les pb |
---|
| 26 | ! de fleuves en pointille |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | use module3d_phy |
---|
| 30 | use param_phy_mod |
---|
| 31 | |
---|
| 32 | implicit none |
---|
[84] | 33 | !logical,dimension(nx,ny) :: fleuvemx !< fleuves sont les tableaux courants (dep. time) |
---|
| 34 | !logical,dimension(nx,ny) :: fleuvemy |
---|
[4] | 35 | logical,dimension(nx,ny) :: fleuve |
---|
| 36 | logical,dimension(nx,ny) :: cote |
---|
| 37 | real, dimension(nx,ny) :: Vcol_x !< uniquement pour compatibilite dans le spinup cat (aurel) |
---|
| 38 | real, dimension(nx,ny) :: Vcol_y !< uniquement pour compatibilite dans le spinup cat (aurel) |
---|
| 39 | real, dimension(nx,ny) :: Vsl_x !< pour compatibilite dragging beta (aurel) |
---|
| 40 | real, dimension(nx,ny) :: Vsl_y !< pour compatibilite dragging beta (aurel) |
---|
| 41 | |
---|
| 42 | logical :: corr_def = .false. !< for deformation correction, pour compatibilite beta (aurel) |
---|
| 43 | |
---|
| 44 | character(len=100) :: masque_stream !< file masque streams autorises |
---|
| 45 | |
---|
| 46 | real :: valmax |
---|
| 47 | integer :: imax,jmax |
---|
| 48 | integer :: i_moins1,i_plus1,j_moins1,j_plus1 |
---|
| 49 | integer :: lmax=20 |
---|
| 50 | integer :: idep,jdep,iloc,jloc |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | real :: tostick ! pour la glace posee |
---|
| 54 | real :: tob_ile ! pour les iles |
---|
| 55 | |
---|
| 56 | contains |
---|
| 57 | !------------------------------------------------------------------------------- |
---|
| 58 | |
---|
| 59 | |
---|
| 60 | !> SUBROUTINE: init_dragging |
---|
| 61 | !! Cette routine fait l'initialisation du dragging. |
---|
| 62 | !< |
---|
| 63 | |
---|
| 64 | subroutine init_dragging ! Cette routine fait l'initialisation du dragging. |
---|
| 65 | |
---|
| 66 | implicit none |
---|
| 67 | |
---|
| 68 | integer :: bidon |
---|
| 69 | |
---|
| 70 | |
---|
| 71 | namelist/drag_neem/hwatstream,cf,betamax,toblim,masque_stream |
---|
| 72 | |
---|
| 73 | if (itracebug.eq.1) write(num_tracebug,*)' init_dragging avec dragging_neem' |
---|
| 74 | |
---|
| 75 | |
---|
| 76 | ! formats pour les ecritures dans 42 |
---|
| 77 | 428 format(A) |
---|
| 78 | |
---|
| 79 | ! lecture des parametres du run |
---|
| 80 | !-------------------------------------------------------------------- |
---|
| 81 | |
---|
| 82 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
| 83 | read(num_param,drag_neem) |
---|
| 84 | |
---|
| 85 | write(num_rep_42,428) '!___________________________________________________________' |
---|
| 86 | write(num_rep_42,428) '! module dragging_neem ' |
---|
| 87 | write(num_rep_42,drag_neem) |
---|
| 88 | write(num_rep_42,428) '! hwatstream (m) : critere de passage en stream vitesses de bilan' |
---|
| 89 | write(num_rep_42,428) '! si hwater > hwatstream ' |
---|
| 90 | write(num_rep_42,428) '! cf coefficient de la loi de frottement fonction Neff' |
---|
| 91 | write(num_rep_42,428) '! seulement pour les points cotiers' |
---|
| 92 | write(num_rep_42,428) '! betamax : (Pa) frottement maxi sous les streams ' |
---|
| 93 | write(num_rep_42,428) '! toblim : (Pa) pour les iles ' |
---|
| 94 | write(num_rep_42,428) '! masque_stream : nom du fichier qui contient le masque de streams autorises' |
---|
| 95 | write(num_rep_42,*) |
---|
| 96 | |
---|
| 97 | tostick=1.e5 ! valeurs pour les points non flgzmx |
---|
| 98 | tob_ile=betamax/2. |
---|
| 99 | moteurmax=toblim |
---|
| 100 | !moteurmax=0. |
---|
| 101 | |
---|
| 102 | !------------------------------------------------------------------- |
---|
| 103 | ! masque stream : lecture du masque |
---|
| 104 | ! attention on prend la colonne 1 qui correspond aux noeuds majeurs |
---|
| 105 | masque_stream = trim(dirnameinp)//trim(masque_stream) |
---|
| 106 | print*, 'le fichier des streams ', masque_stream |
---|
| 107 | call lect_datfile(nx,ny,mstream,1,masque_stream) |
---|
| 108 | open (20,file=masque_stream) |
---|
| 109 | read(20,*) |
---|
| 110 | do j=1,ny |
---|
| 111 | do i=1,nx |
---|
| 112 | read(20,*) mstream(i,j),bidon, bidon! mstream_mx(i:i+1,j), mstream_my(i,j:j+1) |
---|
| 113 | end do |
---|
| 114 | end do |
---|
| 115 | close(20) |
---|
| 116 | |
---|
| 117 | do j=1,ny |
---|
| 118 | do i=1,nx |
---|
| 119 | if (mstream(i,j).eq.1) then ! allowed ice streams |
---|
| 120 | mstream_mx(i:i+1,j) = 1 |
---|
| 121 | mstream_my(i,j:j+1) = 1 |
---|
| 122 | end if |
---|
| 123 | end do |
---|
| 124 | end do |
---|
| 125 | |
---|
| 126 | |
---|
| 127 | debug_3D(:,:,25) = mstream(:,:) |
---|
| 128 | |
---|
| 129 | |
---|
| 130 | ! coefficient permettant de modifier le basal drag. |
---|
| 131 | drag_mx(:,:)=1. |
---|
| 132 | drag_my(:,:)=1. |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | return |
---|
| 136 | end subroutine init_dragging |
---|
| 137 | !________________________________________________________________________________ |
---|
| 138 | |
---|
| 139 | !> SUBROUTINE: dragging |
---|
| 140 | !! defini la localisation des streams et le frottement basal |
---|
| 141 | !< |
---|
| 142 | |
---|
| 143 | !------------------------------------------------------------------------- |
---|
| 144 | subroutine dragging ! defini la localisation des streams et le frottement basal |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | ! les iles n'ont pas de condition neff mais ont la condition toblim |
---|
| 148 | ! (ce bloc etait avant dans flottab) |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | do j=2,ny |
---|
| 152 | do i=2,nx |
---|
| 153 | ilemx(i,j)=ilemx(i,j).and.(abs(rog*Hmx(i,j)*sdx(i,j)).lt.toblim) |
---|
| 154 | ilemy(i,j)=ilemy(i,j).and.(abs(rog*Hmy(i,j)*sdy(i,j)).lt.toblim) |
---|
| 155 | end do |
---|
| 156 | end do |
---|
| 157 | |
---|
| 158 | fleuvemx(:,:)=.false. |
---|
| 159 | fleuvemy(:,:)=.false. |
---|
| 160 | fleuve(:,:)=.false. |
---|
| 161 | cote(:,:)=.false. |
---|
| 162 | cotemx(:,:)=.false. |
---|
| 163 | cotemy(:,:)=.false. |
---|
| 164 | |
---|
| 165 | ! detection des cotes |
---|
| 166 | do j=2,ny-1 |
---|
| 167 | do i=2,nx-1 |
---|
| 168 | if ((.not.flot(i,j)).and. & |
---|
| 169 | ((flot(i+1,j)).or.(flot(i,j+1)).or.(flot(i-1,j)).or.(flot(i,j-1)))) then |
---|
| 170 | cote(i,j)=.true. |
---|
| 171 | cotemx(i:i+1,j) = .true. |
---|
| 172 | cotemy(i,j:j+1) = .true. |
---|
| 173 | endif |
---|
| 174 | end do |
---|
| 175 | end do |
---|
| 176 | |
---|
| 177 | ! le calcul des fleuves se fait sur les mailles majeures |
---|
| 178 | ! normalement, les points cotiers sont deja tagges gzmx dans la routine flottab |
---|
| 179 | |
---|
| 180 | do j=2,ny-1 |
---|
| 181 | do i=2,nx-1 |
---|
| 182 | |
---|
| 183 | if ((hwater(i,j).gt.hwatstream).and.(mstream(i,j).eq.1).and.(.not.flot(i,j))) then |
---|
| 184 | fleuve(i,j)=.true. |
---|
| 185 | fleuvemx(i:i+1,j)=.true. |
---|
| 186 | fleuvemy(i,j:j+1)=.true. |
---|
| 187 | gzmx(i:i+1,j)=.true. |
---|
| 188 | gzmy(i,j:j+1)=.true. |
---|
| 189 | endif |
---|
| 190 | end do |
---|
| 191 | end do |
---|
| 192 | |
---|
| 193 | |
---|
| 194 | ! calcul du frottement basal (ce bloc etait avant dans neffect) |
---|
| 195 | |
---|
| 196 | drag_mx : do j=2,ny-1 |
---|
| 197 | do i=2,nx-1 |
---|
| 198 | |
---|
| 199 | if ((.not.ilemx(i,j)).and.(fleuvemx(i,j))) gzmx(i,j)=.true. |
---|
| 200 | |
---|
| 201 | if (cotemx(i,j)) then ! point cotier peut etre diminue si pression d'eau |
---|
| 202 | betamx(i,j)=cf*neffmx(i,j) |
---|
| 203 | betamx(i,j)=min(betamx(i,j),betamax) |
---|
| 204 | else if ((gzmx(i,j)).and.(.not.cotemx(i,j))) then ! stream -> betamax |
---|
| 205 | betamx(i,j)=betamax |
---|
| 206 | betamx(i,j)=min(betamx(i,j),betamax) |
---|
| 207 | betamx(i,j)=max(betamx(i,j),10.) |
---|
| 208 | |
---|
| 209 | ! if (cf*neffmx(i,j).gt.1500.) then |
---|
| 210 | ! gzmx(i,j)=.false. |
---|
| 211 | ! betamx(i,j)=tostick |
---|
| 212 | ! endif |
---|
| 213 | |
---|
| 214 | else if (ilemx(i,j)) then ! ile : tob_ile=betamax/2 + peut etre diminue si pression d'eau |
---|
| 215 | betamx(i,j)=cf*neffmx(i,j) |
---|
| 216 | betamx(i,j)=min(betamx(i,j),tob_ile) |
---|
| 217 | else if (flotmx(i,j)) then ! flottant ou ile |
---|
| 218 | betamx(i,j)=0. |
---|
| 219 | else ! grounded, SIA |
---|
| 220 | betamx(i,j)=tostick ! frottement glace posee (1 bar) |
---|
| 221 | endif |
---|
| 222 | |
---|
| 223 | end do |
---|
| 224 | end do drag_mx |
---|
| 225 | |
---|
| 226 | drag_my : do j=2,ny-1 |
---|
| 227 | do i=2,nx-1 |
---|
| 228 | |
---|
| 229 | if ((.not.ilemy(i,j)).and.(fleuvemy(i,j))) gzmy(i,j)=.true. |
---|
| 230 | |
---|
| 231 | if (cotemy(i,j)) then ! point cotier peut etre diminue si pression d'eau |
---|
| 232 | betamy(i,j)=cf*neffmy(i,j) |
---|
| 233 | betamy(i,j)=min(betamy(i,j),betamax) |
---|
| 234 | else if ((gzmy(i,j)).and.(.not.cotemy(i,j))) then ! stream -> betamax |
---|
| 235 | betamy(i,j)=betamax |
---|
| 236 | betamy(i,j)=min(betamy(i,j),betamax) |
---|
| 237 | betamy(i,j)=max(betamy(i,j),10.) |
---|
| 238 | |
---|
| 239 | ! if (cf*neffmy(i,j).gt.1500.) then |
---|
| 240 | ! gzmy(i,j)=.false. |
---|
| 241 | ! betamy(i,j)=tostick |
---|
| 242 | ! endif |
---|
| 243 | |
---|
| 244 | else if (ilemy(i,j)) then ! ile : tob_ile=betamax/2 + peut etre diminue si pression d'eau |
---|
| 245 | betamy(i,j)=cf*neffmy(i,j) |
---|
| 246 | betamy(i,j)=min(betamy(i,j),tob_ile) |
---|
| 247 | else if (flotmy(i,j)) then ! flottant ou ile |
---|
| 248 | betamy(i,j)=0. |
---|
| 249 | else ! grounded, SIA |
---|
| 250 | betamy(i,j)=tostick ! frottement glace posee (1 bar) |
---|
| 251 | endif |
---|
| 252 | |
---|
| 253 | end do |
---|
| 254 | end do drag_my |
---|
| 255 | |
---|
| 256 | |
---|
| 257 | where (fleuve(:,:)) |
---|
| 258 | debug_3D(:,:,1)=1 |
---|
| 259 | elsewhere (flot(:,:)) |
---|
| 260 | debug_3D(:,:,1)=2 |
---|
| 261 | elsewhere |
---|
| 262 | debug_3D(:,:,1)=0 |
---|
| 263 | endwhere |
---|
| 264 | |
---|
| 265 | where (cote(:,:)) |
---|
| 266 | debug_3D(:,:,2)=1 |
---|
| 267 | elsewhere |
---|
| 268 | debug_3D(:,:,2)=0 |
---|
| 269 | endwhere |
---|
| 270 | |
---|
| 271 | where (fleuvemx(:,:)) |
---|
| 272 | debug_3D(:,:,3)=1 |
---|
| 273 | elsewhere |
---|
| 274 | debug_3D(:,:,3)=0 |
---|
| 275 | endwhere |
---|
| 276 | |
---|
| 277 | where (flotmx(:,:)) |
---|
| 278 | debug_3D(:,:,3)=-1 |
---|
| 279 | endwhere |
---|
| 280 | |
---|
| 281 | !_____________________ |
---|
| 282 | |
---|
| 283 | |
---|
| 284 | where (fleuvemy(:,:)) |
---|
| 285 | debug_3D(:,:,4)=1 |
---|
| 286 | elsewhere |
---|
| 287 | debug_3D(:,:,4)=0 |
---|
| 288 | endwhere |
---|
| 289 | |
---|
| 290 | where (flotmy(:,:)) |
---|
| 291 | debug_3D(:,:,4)=-1 |
---|
| 292 | end where |
---|
| 293 | |
---|
| 294 | debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5) |
---|
| 295 | debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5) |
---|
| 296 | |
---|
| 297 | return |
---|
| 298 | end subroutine dragging |
---|
| 299 | |
---|
| 300 | end module dragging_neem |
---|
| 301 | |
---|