Changeset 73
- Timestamp:
- 06/22/16 15:43:40 (8 years ago)
- Location:
- trunk/SOURCES
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/Temperature-routines/advec_icetemp.f90
r24 r73 14 14 !> 15 15 16 Subroutine Advec_icetemp(Ii,Jj,Prodq_m,Cro_m,Advecx_m,Advecy_m,Advec_m,Ct_m) 16 Subroutine Advec_icetemp(Nz,Nzm,Nn,Prodq_m,Cro_m,Advecx_m,Advecy_m,Advec_m,Ct_m,Iadvec_w,Iadvec_e,Iadvec_s,Iadvec_n, & 17 Uxij,Uxi_plus_un,Uyij,Uyj_plus_un,Tij,Ti_moins_un,Ti_plus_un,Tj_moins_un,Tj_plus_un,Hij,Tsij,Aa,Bb,Cc,Rr, & 18 Dx11,Dou,DTT,Dee,Uzrij,Dttdx) 17 19 18 use icetemp_declar20 ! use icetemp_declar 19 21 20 22 Implicit None 21 23 !< Arguments 22 Integer, Intent(In) :: Ii,Jj !< Indice Selon X Et Y 23 Real, Dimension(Nz), Intent(In) :: Prodq_m !< Tableau 1d Vert. heat production 24 Real, Dimension(Nz), Intent(In) :: Cro_m !< Tableau 1d Vert. heat capcity 25 Real, Dimension(Nz), Intent(Inout):: Advecx_m !< Advection selon x 26 Real, Dimension(Nz), Intent(Inout):: Advecy_m !< Advection selon y 27 Real, Dimension(Nz), Intent(Inout):: Advec_m !< Advection total 28 Real, Dimension(Nz), Intent(In) :: Ct_m !< Tableau 1d Vert. thermal cond. 24 Integer, intent(in) :: Nz,Nzm,Nn !< Taille des tableaux 25 Real, Dimension(Nz), intent(in) :: Prodq_m !< Tableau 1d Vert. heat production 26 Real, Dimension(Nz), intent(in) :: Cro_m !< Tableau 1d Vert. heat capcity 27 Real, Dimension(Nz), intent(inout):: Advecx_m !< Advection selon x 28 Real, Dimension(Nz), intent(inout):: Advecy_m !< Advection selon y 29 Real, Dimension(Nz), intent(inout):: Advec_m !< Advection total 30 Real, Dimension(Nz), intent(in) :: Ct_m !< Tableau 1d Vert. thermal cond. 31 32 Integer, intent(in) :: Iadvec_w,Iadvec_e,Iadvec_s,Iadvec_n 33 real, dimension(Nz), Intent(in) :: Uxij, Uxi_plus_un 34 real, dimension(Nz), Intent(in) :: Uyij, Uyj_plus_un 35 real, dimension(Nz+Nzm), Intent(inout) :: Tij 36 real, dimension(Nz+Nzm), Intent(in) :: Ti_moins_un,Ti_plus_un,Tj_moins_un,Tj_plus_un 37 real, intent(in) :: Hij 38 real,intent(in) :: Tsij 39 Real,Dimension(Nn),intent(inout) :: Aa !< Work Arrays For Tridiag !Dim Nn 40 Real,Dimension(Nn),intent(inout) :: Bb !< Work Arrays For Tridiag !Dim Nn 41 Real,Dimension(Nn),intent(inout) :: Cc !< Work Arrays For Tridiag !Dim Nn 42 Real,Dimension(Nn),intent(inout) :: Rr !< Work Arrays For Tridiag !Dim Nn 43 Real, intent(in) :: Dx11 44 Real, intent(inout) :: Dou 45 real, intent(in) :: DTT 46 real, intent(in) :: Dee 47 real, dimension(Nz) :: Uzrij 48 real :: Dttdx 49 50 51 52 ! variables locales 53 Integer :: K 54 Real :: Dzz,Dah,Ct_haut,Ct_bas 29 55 30 56 … … 35 61 ! Avection Selon X (advecx_m en general > 0) 36 62 ! ---------------- 37 Advecx_m(K) = Iadvec_w (Ii,Jj) * Ux(Ii,Jj,K) * & ! ux west if upwind38 (T (Ii,Jj,K) - T(Ii-1,Jj,K)) & ! west T gradient63 Advecx_m(K) = Iadvec_w * Uxij(K) * & ! ux west if upwind 64 (Tij(K) - Ti_moins_un(K)) & ! west T gradient 39 65 40 + Iadvec_e (Ii+1,Jj)* Ux(Ii+1,Jj,K)* & ! ux east if upwind41 (T (Ii+1,Jj,K)-T(Ii,Jj,K)) ! east T gradient66 + Iadvec_e * Uxi_plus_un(K)* & ! ux east if upwind 67 (Ti_plus_un(K)-Tij(K)) ! east T gradient 42 68 43 69 Advecx_m(K) = Advecx_m(K) * Dx11 !Dx11=1/Dx … … 46 72 ! Avection Selon Y 47 73 ! ---------------- 48 Advecy_m(K) = Iadvec_s (Ii,Jj) * Uy(Ii,Jj,K) * & ! uy sud if upwind49 (T (Ii,Jj,K) - T(Ii,Jj-1,K))& ! south T gradient74 Advecy_m(K) = Iadvec_s * Uyij(K) * & ! uy sud if upwind 75 (Tij(K) - Tj_moins_un(K))& ! south T gradient 50 76 51 + Iadvec_n (Ii,Jj+1) * Uy(Ii,Jj+1,K) * & ! uy nord is upwind52 (T (Ii,Jj+1,K)-T(Ii,Jj,K)) ! north T gradient77 + Iadvec_n * Uyj_plus_un(K) * & ! uy nord is upwind 78 (Tj_plus_un(K)-Tij(K)) ! north T gradient 53 79 54 80 Advecy_m(K) = Advecy_m(K) * Dx11 … … 62 88 63 89 ! -----------------------------Cas General (H>10m) 64 thick_ice: If (H (Ii,Jj).Gt.10.) Then90 thick_ice: If (Hij.Gt.10.) Then 65 91 66 92 ! Variables De Calcul Dans La Glace 67 93 ! dou = dtt/dz^2 68 Dou=Dtt/Dee/Dee/ H (Ii,Jj) / H(Ii,Jj)94 Dou=Dtt/Dee/Dee/ Hij / Hij 69 95 70 96 ! Dah = dtt/dz 71 Dah=Dtt /Dee /H (Ii,Jj)97 Dah=Dtt /Dee /Hij 72 98 73 99 ! thermal conductivity at mid point just below the surface … … 75 101 76 102 ! surface temperature : cannot go above 0 celsius 77 T (Ii,Jj,1)=Min(0.,Ts(Ii,Jj))103 Tij(1)=Min(0.,Tsij) 78 104 79 105 ! surface boundary condition … … 81 107 Bb(1)=1. 82 108 Cc(1)=0. 83 Rr(1)=T (Ii,Jj,1)109 Rr(1)=Tij(1) 84 110 85 111 Do K=2,Nz-1 … … 91 117 92 118 ! Advection Verticale Centree 93 Aa(K) = -Dzz * Ct_haut - Uzr (Ii,Jj,K) * Dah / 2. ! lower diag94 Cc(K) = -Dzz * Ct_bas + Uzr (Ii,Jj,K) * Dah / 2. ! upper diag119 Aa(K) = -Dzz * Ct_haut - Uzrij(K) * Dah / 2. ! lower diag 120 Cc(K) = -Dzz * Ct_bas + Uzrij(K) * Dah / 2. ! upper diag 95 121 Bb(K) = 1.+ Dzz * (Ct_haut+Ct_bas) ! diag 96 122 97 Rr(K) = T (Ii,Jj,K) + Prodq_m(K) * Dtt ! vector123 Rr(K) = Tij(K) + Prodq_m(K) * Dtt ! vector 98 124 Rr(K) = Rr(K)- Dttdx * (Advec_m(K)) 99 125 -
trunk/SOURCES/Temperature-routines/icetemp_declar_mod.f90
r71 r73 22 22 Integer :: Nfracq !< Exposant Fracq 23 23 Integer :: Iq !< Choix Du Type De Routine Chaleur 24 Real :: Sx,Sy,Sx2,Sy2,Deh22 ,Tss25 Real :: Dou,D ah,Duu,Dzz,Dzi,Chalbed,Ct_bas,Ct_haut24 Real :: Sx,Sy,Sx2,Sy2,Deh22 ! ,Tss 25 Real :: Dou,Duu,Chalbed ! ,Dah,Dzz,Dzi,Ct_bas,Ct_haut 26 26 27 27 Real,Parameter :: Acof1=-0.0575 !< Pour La Temperature De L'Eau De Mer … … 40 40 ! _______________ 41 41 42 Real, allocatable,Dimension(:) :: Aa !< Work Arrays For Tridiag !Dim Nn43 Real, allocatable,Dimension(:) :: Bb !< Work Arrays For Tridiag !Dim Nn44 Real, allocatable,Dimension(:) :: Cc !< Work Arrays For Tridiag !Dim Nn45 Real, allocatable,Dimension(:) :: Rr !< Work Arrays For Tridiag !Dim Nn46 Real, allocatable,Dimension(:) :: Hh !< Work Arrays For Tridiag !Dim Nn42 Real,Dimension(Nn) :: Aa !< Work Arrays For Tridiag !Dim Nn 43 Real,Dimension(Nn) :: Bb !< Work Arrays For Tridiag !Dim Nn 44 Real,Dimension(Nn) :: Cc !< Work Arrays For Tridiag !Dim Nn 45 Real,Dimension(Nn) :: Rr !< Work Arrays For Tridiag !Dim Nn 46 Real,Dimension(Nn) :: Hh !< Work Arrays For Tridiag !Dim Nn 47 47 48 Real, allocatable,Dimension(:) :: Tdot !< Temperature Time Derivative*Dtt49 Real,allocatable,Dimension(:) :: Abis,Bbis,Cbis,Rbis,Hbis50 Real, allocatable,Dimension(:) :: Ee !< Vertical Coordinate In Ice, Scaled To H Zeta48 Real,Dimension(Nz+Nzm) :: Tdot !< Temperature Time Derivative*Dtt 49 ! Real,allocatable,Dimension(:) :: Abis,Bbis,Cbis,Rbis,Hbis 50 Real,Dimension(Nz) :: Ee !< Vertical Coordinate In Ice, Scaled To H Zeta 51 51 52 52 ! Tableaux De Travail 2d 53 53 ! ___________________________ 54 Real, allocatable,Dimension(:,:):: Tbmer !< Temperature De La Mer A La Base De L'Ice Shelf55 Real, allocatable,Dimension(:,:) :: Chalglissx,Chalglissy !< Chaleur De Glissement56 Integer, allocatable,Dimension(:,:) :: Iadvec_w,Iadvec_e,Iadvec_s,Iadvec_n54 Real,Dimension(Nx,Ny):: Tbmer !< Temperature De La Mer A La Base De L'Ice Shelf 55 Real,Dimension(Nx,Ny) :: Chalglissx,Chalglissy !< Chaleur De Glissement 56 Integer,Dimension(Nx,Ny) :: Iadvec_w,Iadvec_e,Iadvec_s,Iadvec_n 57 57 ! Pour L'Advection 58 58 59 59 ! Tableaux De Travail 3d 60 60 ! __________________________ 61 Real, allocatable,Dimension(:,:,:,:) :: Chalx, Chaly !Dim Nx,Ny,Nz,N1poly:N2poly61 Real,Dimension(Nx,Ny,Nz,size(Btt,4)) :: Chalx, Chaly !Dim Nx,Ny,Nz,N1poly:N2poly 62 62 ! Utilise Pour Calculer La Chaleur De Deformation Selon Xx Yy Zz Et Xy 63 Real, allocatable,Dimension(:,:,:) :: Ffx,Ffy64 Real, allocatable,Dimension(:,:,:) :: T3d_new65 Real, allocatable,Dimension(:,:,:) :: Chal2_x, Chal2_y, Chal2_z, Chal2_xy66 Real, allocatable,Dimension(:,:,:) :: Chaldef_maj !< Chaleur De Deformation67 Real, allocatable,Dimension(:,:,:) :: Advecx,Advecy,Advec63 Real,Dimension(Nx,Ny,size(Btt,4)) :: Ffx,Ffy 64 Real,Dimension(Nx,Ny,Nz+Nzm) :: T3d_new 65 Real,Dimension(Nx,Ny,Nz) :: Chal2_x, Chal2_y, Chal2_z, Chal2_xy 66 Real,Dimension(Nx,Ny,Nz) :: Chaldef_maj !< Chaleur De Deformation 67 Real,Dimension(Nx,Ny,Nz) :: Advecx,Advecy,Advec 68 68 Real,Dimension(Nx,Ny,Nz) :: Cp !< Specific Heat Capacity (J/(M-3)/K)=Ro Cp 69 69 Real,Dimension(Nx,Ny,Nz) :: Ct !< Thermal Conductivity (J/M/K/A) -
trunk/SOURCES/Temperature-routines/icetemp_mod.f90
r29 r73 66 66 67 67 subroutine icetemp 68 68 !$ use OMP_LIB 69 69 use Icetemp_declar 70 70 71 71 72 72 Implicit None 73 74 ! Allocation de la memoire pour les tableaux dans icetemp_declar 75 76 If (.Not. Allocated(Aa)) then 77 ! tab Nn 78 Allocate (Aa(Nn),Bb(Nn),Cc(Nn),Rr(Nn),Hh(Nn)) 79 ! tab NzNzm_m 80 Allocate(Tdot(Nz+Nzm)) 81 ! tab Nzm+1 82 Allocate(Abis(Nzm+1),Bbis(Nzm+1),Cbis(Nzm+1),Rbis(Nzm+1),Hbis(Nzm+1)) 83 ! tab nz_m 84 Allocate(Ee(Nz)) 85 !Tab Nx,Ny 86 Allocate(Tbmer(Nx,Ny),& 87 Chalglissx(Nx,Ny),& 88 Chalglissy(Nx,Ny),& 89 Iadvec_w(Nx,Ny),& 90 Iadvec_e(Nx,Ny),& 91 Iadvec_s(Nx,Ny),& 92 Iadvec_n(Nx,Ny) ) 93 ! Tab Nx,Ny,Nz 94 Allocate(Chal2_x(Nx,Ny,Nz),& 95 Chal2_y(Nx,Ny,Nz),& 96 Chal2_z(Nx,Ny,Nz),& 97 Chal2_xy(Nx,Ny,Nz),& 98 Chaldef_maj(Nx,Ny,Nz),& 99 Advecx(Nx,Ny,Nz),& 100 Advecy(Nx,Ny,Nz),& 101 Advec(Nx,Ny,Nz)) 102 ! Tab Nx,Ny,Nz,N1poly:N2poly 103 Allocate(Chalx(Nx,Ny,Nz,size(Btt,4)),& 104 Chaly(Nx,Ny,Nz,size(Btt,4))) 105 ! Tab Nx,Ny,N1poly:N2poly 106 Allocate(Ffx( Nx,Ny,size(Btt,4)),& 107 Ffy( Nx,Ny,size(Btt,4))) 108 ! Tab Nx,Ny,NzNzm 109 Allocate( T3d_new (Nx,Ny,Nz+Nzm)) 110 end If 111 73 74 !~ integer :: t1,t2,ir 75 !~ real :: temps, t_cpu_0, t_cpu_1, t_cpu, norme 76 !~ 77 !~ ! Temps CPU de calcul initial. 78 !~ call cpu_time(t_cpu_0) 79 !~ ! Temps elapsed de reference. 80 !~ call system_clock(count=t1, count_rate=ir) 81 82 83 !$OMP PARALLEL 84 !$OMP WORKSHARE 112 85 ! init 113 86 Aa=0. … … 124 97 Chalglissx=0. 125 98 Chalglissy=0. 99 126 100 !Instruction 127 101 Dee=1./(Nz-1) … … 130 104 Ee(1)=0. 131 105 Ee(Nz)=1. 106 !$OMP END WORKSHARE 107 108 !$OMP DO 132 109 Do K=1,Nz 133 110 If ((K.Ne.1).And.(K.Ne.Nz)) Ee(K)=(K-1.)/(Nz-1.) 134 111 End Do 112 !$OMP END DO 113 !$OMP END PARALLEL 135 114 136 115 ! Variables Dependant Du Pas De Temps Dtt … … 156 135 Call Qprod_ice(Iq) 157 136 158 137 159 138 ! Dans Le Socle : Les elements de La Matrice Tridiag Sont Invariants Dans L'Espace 139 !$OMP PARALLEL 140 !$OMP DO 160 141 Do K=Nz+1,nz+nzm-1 161 142 Aa(K)=-Ctm … … 163 144 Cc(K)=-Ctm 164 145 End Do 146 !$OMP END DO 165 147 166 148 ! Conditions Aux Limites Pour Le Socle … … 174 156 ! Advection Selon X 175 157 ! ----------------- 176 158 !$OMP WORKSHARE 177 159 Iadvec_w(:,:)=Nint(Max(Sign(1.0,Uxbar(:,:)),0.0)) 178 160 Iadvec_e(:,:)=Nint(Abs(Min(Sign(1.0,Uxbar(:,:)),0.0))) … … 183 165 Iadvec_s(:,:)=Nint(Max(Sign(1.0,Uybar(:,:)),0.0)) 184 166 Iadvec_n(:,:)=Nint(Abs(Min(Sign(1.0,Uybar(:,:)),0.0))) 185 167 !$OMP END WORKSHARE 186 168 ! Boucle De Resolution Des Temperatures Colonne Par Colonne 187 169 !$OMP SINGLE 188 170 If (Itracebug.Eq.1) Write(num_tracebug,*)' avant appel boucle Advec_icetemp' 189 171 !$OMP END SINGLE 172 173 !$OMP DO PRIVATE(Deh22,Duu,Aa,Bb,Cc,Rr,Hh,Dou) 190 174 Do J=2,Ny-1 191 175 Do I=2,Nx-1 192 176 193 177 ! If (Itracebug.Eq.1) Write(num_tracebug,*)' avant appel Advect_icetemp i,j', i,j 194 call Advec_icetemp(I,J,Chaldef_maj(I,J,:),Cp(I,J,:),& 195 Advecx(I,J,:),Advecy(I,J,:),Advec(I,J,:),Ct(I,J,:)) 178 call Advec_icetemp(Nz,Nzm,Nn,Chaldef_maj(I,J,:),Cp(I,J,:),& 179 Advecx(I,J,:),Advecy(I,J,:),Advec(I,J,:),Ct(I,J,:),Iadvec_w(I,J),Iadvec_e(I+1,J),Iadvec_s(I,J),Iadvec_n(I,J+1), & 180 Ux(i,j,:),Ux(i+1,j,:),Uy(i,j,:),Uy(i,j+1,:),T(i,j,:),T(i-1,j,:),T(i+1,j,:),T(i,j-1,:),T(i,j+1,:), & 181 H(i,j),Ts(i,j),Aa,Bb,Cc,Rr,Dx11,Dou,DTT,Dee,Uzr(i,j,:),Dttdx) 196 182 197 183 ! variables de calcul dans la glace … … 201 187 202 188 ! If (Itracebug.Eq.1) Write(num_tracebug,*)' avant appel temp_col i,j', i,j 203 Call temp_col(I,J,T3d_new,Ct(I,J,:),& 204 flot(I,J),H(I,J),Tbmer(I,J)) 189 Call temp_col(Nz,Nzm,Nn,T3d_new(i,j,:),Ct(i,j,:),& 190 flot(i,j),H(i,j),Tbmer(i,j),Ibase(i,j),T(i,j,:),Tpmp(i,j,:),Aa,Bb,Cc,Rr,Hh,Ncond,Dee,Cm,& 191 Dzm,Phid(i,j),Ghf(i,j),Ifail1,Tbdot(i,j),DTT,Dou,Ts(i,j),Bmelt(i,j)) 205 192 206 193 ! Test Permettant D'Ecrire Les Variables Quand Il Y A Une Erreur … … 218 205 End Do 219 206 End Do 220 207 !$OMP END DO 208 209 !$OMP DO 221 210 Do J=1,Ny 222 211 Do I=1,Nx … … 226 215 End Do 227 216 End Do 217 !$OMP END DO 228 218 229 219 ! Attribution Finale De La Temperature 230 220 ! Limitation a 3 deg De Variation Par Dtt Et Pas Plus Froid Que -70 231 221 !$OMP DO COLLAPSE(2) PRIVATE(Tdot) 232 222 Do K=1,nz+nzm 233 223 Do J=1,Ny … … 250 240 End Do 251 241 End Do 252 253 242 !$OMP END DO 243 244 !$OMP DO COLLAPSE(2) 254 245 Do K=2,Nz 255 246 Do J=1,Ny … … 262 253 End Do 263 254 End Do 255 !$OMP END DO 264 256 265 257 ! Temperature Sur Les Bords : 266 258 ! ------------------------- 267 259 260 !$OMP DO COLLAPSE(2) 268 261 Do K=1,Nz 269 262 Do J=1,Ny … … 281 274 End Do 282 275 End Do 283 284 276 !$OMP END DO 277 278 !$OMP DO COLLAPSE(2) 285 279 Do K=1,Nz 286 280 Do J=1,Ny … … 294 288 End Do 295 289 End Do 296 297 Deallocate (Aa,Bb,Cc,Rr,Hh,Tdot,Abis,Bbis,Cbis,Rbis,Hbis,Ee,Tbmer, & 298 Chalglissx,Chalglissy,Iadvec_w,Iadvec_e, & 299 Iadvec_s,Iadvec_n,Chal2_x,Chal2_y,Chal2_z,Chal2_xy,Chaldef_maj, & 300 Advecx,Advecy,Advec,Chalx,Chaly,Ffx,Ffy,T3d_new) 290 !$OMP END DO 291 !$OMP END PARALLEL 292 293 !~ ! Temps elapsed final 294 !~ call system_clock(count=t2, count_rate=ir) 295 !~ temps=real(t2 - t1,kind=4)/real(ir,kind=4) 296 !~ ! Temps CPU de calcul final 297 !~ call cpu_time(t_cpu_1) 298 !~ t_cpu = t_cpu_1 - t_cpu_0 299 300 !~ ! Impression du resultat. 301 !~ print '(//,3X,"Valeurs de nx et ny : ",I5,I5/, & 302 !~ & 3X,"Temps elapsed : ",1PE10.3," sec.",/, & 303 !~ & 3X,"Temps CPU : ",1PE10.3," sec.",/, & 304 !~ & 3X,"Norme (PB si /= 0) : ",1PE10.3,//)', & 305 !~ nx,ny,temps,t_cpu,norme 306 301 307 302 308 If (Itracebug.Eq.1) Write(num_tracebug,*)' fin routine icetemp' -
trunk/SOURCES/Temperature-routines/temp_col.f90
r24 r73 14 14 !> 15 15 16 Subroutine Temp_col(Ii,Jj,Newtempcol_m,Ct_m,Flot_m,H_m,Tbmer_m) 17 18 Use Icetemp_declar 16 Subroutine Temp_col(Nz,Nzm,Nn,Newtempcol,Ctij,Flotij,Hij,Tbmerij,Ibase,Tij,Tpmpij,Aa,Bb,Cc,Rr,Hh,Ncond,Dee,Cm, & 17 Dzm,Phidij,Ghfij,Ifail1,Tbdotij,DTT,Dou,Tsij,Bmeltij) 18 19 ! Use Icetemp_declar 19 20 Use Tridiagmod 20 21 21 22 22 23 Implicit None 23 integer :: Ii,Jj 24 Real,Dimension(Nx,Ny,Nz+Nzm),Intent(Out) :: Newtempcol_m !< Tableau 1d Vert. Des Temperatures En Sortie 25 Real,Dimension(Nz),Intent(In) :: Ct_m !< Tableau 1d Vert. Conductivite Thermique 26 Logical,Intent(In) :: Flot_m !< Vrai Si Flot_mtant (Test D'Archimede) 'O' 27 Real,Intent(In) :: H_m !< Ice Thickness 'O' 28 Real,Intent(In) :: Tbmer_m !< Temperature De La Mer A La Base De L'Ice Shelf 29 30 31 If (H_m.Gt.10.) Then 24 integer,intent(in) :: Nz,Nzm,Nn 25 Real,Dimension(Nz+Nzm),Intent(Out) :: Newtempcol !< Tableau 1d Vert. Des Temperatures En Sortie 26 Real,Dimension(Nz),Intent(In) :: Ctij !< Tableau 1d Vert. Conductivite Thermique 27 Logical,Intent(In) :: Flotij !< Vrai Si Flotijtant (Test D'Archimede) 'O' 28 Real,Intent(In) :: Hij !< Ice Thickness 'O' 29 Real,Intent(In) :: Tbmerij !< Temperature De La Mer A La Base De L'Ice Shelf 30 integer,intent(inout) :: Ibase 31 real,dimension(Nz+Nzm),intent(inout) :: Tij !< Temperature sur la colonne 32 real,dimension(Nz),intent(in) :: Tpmpij !< pressure melting point temperature in ice sheet 'o' 33 Real,Dimension(Nn),intent(inout) :: Aa !< Work Arrays For Tridiag !Dim Nn 34 Real,Dimension(Nn),intent(inout) :: Bb !< Work Arrays For Tridiag !Dim Nn 35 Real,Dimension(Nn),intent(inout) :: Cc !< Work Arrays For Tridiag !Dim Nn 36 Real,Dimension(Nn),intent(inout) :: Rr !< Work Arrays For Tridiag !Dim Nn 37 Real,Dimension(Nn),intent(inout) :: Hh !< Work Arrays For Tridiag !Dim Nn 38 Integer,intent(in) :: Ncond !< Switch : Ncond=1 Thermal Conductivity In Mantle 39 real, intent(in) :: Dee 40 real,intent(in) :: Cm 41 real,intent(in) :: Dzm 42 real,intent(inout) :: Phidij !< flux de chaleur lie a la deformation et glissement basal 43 real,intent(in) :: Ghfij !< flux geothermique 44 integer,intent(out) :: Ifail1 !< Diagnostique erreur dans Tridiag 45 real, intent(out) :: Tbdotij !< variation in time of basal temperature 46 real, intent(in) :: DTT 47 Real, intent(inout) :: Dou 48 real, intent(in) :: Tsij !< surface ice temperature 'o' 49 real, intent(out) :: Bmeltij !< fonte basale 50 51 52 53 ! variables locales 54 integer :: K 55 Real :: Dzi,Tss 56 Real,Dimension(Nzm+1) :: Abis,Bbis,Cbis,Rbis,Hbis 57 58 If (Hij.Gt.10.) Then 32 59 33 60 ! Conditions Aux Limites a La Base De La Glace … … 35 62 36 63 ! Base Froide 37 If ( ((Ibase (Ii,Jj).Eq.1).Or.(Ibase(Ii,Jj).Eq.4) &38 .Or. ((Ibase (Ii,Jj).Eq.5).And.(T(Ii,Jj,Nz).Lt.Tpmp(Ii,Jj,Nz)))) &39 .And..Not.Flot _m) Then40 41 Ibase (Ii,Jj)=164 If ( ((Ibase.Eq.1).Or.(Ibase.Eq.4) & 65 .Or. ((Ibase.Eq.5).And.(Tij(Nz).Lt.Tpmpij(Nz)))) & 66 .And..Not.Flotij) Then 67 68 Ibase=1 42 69 Bb(Nz)=1. 43 70 44 71 If (Ncond.Eq.1) Then ! Avec Socle 45 Dzi=H _m*Dee*Cm/Ct_m(Nz)72 Dzi=Hij*Dee*Cm/Ctij(Nz) 46 73 Aa(Nz)=-Dzm/(Dzm+Dzi) 47 74 Cc(Nz)=-Dzi/(Dzm+Dzi) 48 Rr(Nz)=H _m*Dee*Phid(Ii,Jj)*Dzm/Ct_m(Nz)/(Dzm+Dzi)75 Rr(Nz)=Hij*Dee*Phidij*Dzm/Ctij(Nz)/(Dzm+Dzi) 49 76 Else ! Sans Socle 50 77 Aa(Nz)=-1. 51 78 Cc(Nz)=0. 52 Rr(Nz)=-(Ghf (Ii,Jj)-Phid(Ii,Jj))/Ct_m(Nz)*H_m*Dee79 Rr(Nz)=-(Ghfij-Phidij)/Ctij(Nz)*Hij*Dee 53 80 Endif 54 81 … … 57 84 ! Base Temperee Ou Shelf 58 85 ! ---------------------- 59 If (Ibase (Ii,Jj).Eq.5) Ibase(Ii,Jj)=260 Ibase (Ii,Jj)=Max(Ibase(Ii,Jj),2)86 If (Ibase.Eq.5) Ibase=2 87 Ibase=Max(Ibase,2) 61 88 Aa(Nz)=0. 62 89 Bb(Nz)=1. 63 90 Cc(Nz)=0. 64 91 65 If (.Not.Flot _m) Then66 Rr(Nz)=Tpmp (Ii,Jj,Nz)67 Else 68 Rr(Nz)=Tbmer _m92 If (.Not.Flotij) Then 93 Rr(Nz)=Tpmpij(Nz) 94 Else 95 Rr(Nz)=Tbmerij 69 96 End If 70 97 … … 74 101 If (Ncond.Eq.1) Then ! Avec Socle 75 102 Do K=Nz+1,nz+nzm-1 76 Rr(K)=T (Ii,Jj,K)103 Rr(K)=Tij(K) 77 104 End Do 78 105 Call Tridiag (Aa,Bb,Cc,Rr,Hh,nz+nzm,Ifail1) … … 87 114 If (Ncond.Eq.0) Then 88 115 Do K=Nz+1,nz+nzm 89 Hh(K)=Hh(Nz)-Dzm*(K-Nz)*Ghf (Ii,Jj)/Cm116 Hh(K)=Hh(Nz)-Dzm*(K-Nz)*Ghfij/Cm 90 117 End Do 91 118 Endif 92 119 93 120 Do K=1,nz+nzm 94 Newtempcol _m(Ii,Jj,K)=Hh(K)121 Newtempcol(K)=Hh(K) 95 122 End Do 96 Tbdot (Ii,Jj)=(Newtempcol_m(Ii,Jj,Nz)-T(Ii,Jj,Nz))/Dtt123 Tbdotij=(Newtempcol(Nz)-Tij(Nz))/Dtt 97 124 98 125 ! ------------------------------------------------- Glace Tres Fine (H<10m Ou H=0) 99 Else If (H _m.Le.10.) Then126 Else If (Hij.Le.10.) Then 100 127 101 128 ! Pour Eviter Des Problemes Lorsque H Est Inferieur A 10 M … … 104 131 105 132 ! ........................................ Avec Calcul Dans Le Socle 106 If (Ncond.Eq.1.And..Not.Flot _m) Then107 If (H _m.Gt.0.) Then133 If (Ncond.Eq.1.And..Not.Flotij) Then 134 If (Hij.Gt.0.) Then 108 135 ! Gradient Dans Le Socle 109 Dou=(T (Ii,Jj,Nz+1)-T(Ii,Jj,Nz))/Dzm*Cm110 Dou=Dou/Ct _m(Nz)*Dee*H_m111 112 Tss=Min(0.,Ts (Ii,Jj))113 Do K=1,Nz 114 Newtempcol _m(Ii,Jj,K)=Tss+Dou*(K-1.)136 Dou=(Tij(Nz+1)-Tij(Nz))/Dzm*Cm 137 Dou=Dou/Ctij(Nz)*Dee*Hij 138 139 Tss=Min(0.,Tsij) 140 Do K=1,Nz 141 Newtempcol(K)=Tss+Dou*(K-1.) 115 142 End Do 116 143 117 144 Else 118 145 ! Pas De Glace 119 Tss=Ts (Ii,Jj)120 Do K=1,Nz 121 Newtempcol _m(Ii,Jj,K)=Tss146 Tss=Tsij 147 Do K=1,Nz 148 Newtempcol(K)=Tss 122 149 End Do 123 150 End If 124 151 125 152 ! Calcul Dans Le Socle Meme S'Il N'Y A Pas De Glace 126 Rr(Nz)=Newtempcol _m(Ii,Jj,Nz)153 Rr(Nz)=Newtempcol(Nz) 127 154 Aa(Nz)=0 128 155 Bb(Nz)=1 … … 130 157 131 158 Do K=Nz+1,nz+nzm-1 132 Rr(K)=T (Ii,Jj,K)159 Rr(K)=Tij(K) 133 160 End Do 134 161 … … 150 177 Else 151 178 ! Calotte Posee 152 If ((H _m.Gt.0.).And..Not.Flot_m) Then153 Dou=-Ghf (Ii,Jj)/Ct_m(Nz)*Dee*H_m154 Tss=Min(0.,Ts (Ii,Jj))155 Do K=1,Nz 156 Newtempcol _m(Ii,Jj,K)=Tss+Dou*(K-1.)179 If ((Hij.Gt.0.).And..Not.Flotij) Then 180 Dou=-Ghfij/Ctij(Nz)*Dee*Hij 181 Tss=Min(0.,Tsij) 182 Do K=1,Nz 183 Newtempcol(K)=Tss+Dou*(K-1.) 157 184 End Do 158 185 159 186 ! Shelf 160 Else If ((H _m.Gt.0.).And.Flot_m) Then161 Tss=Min(0.,Ts (Ii,Jj))162 Dou=(Tbmer _m-Tss)*Dee163 Do K=1,Nz 164 Newtempcol _m(Ii,Jj,K)=Tss+Dou*(K-1.)187 Else If ((Hij.Gt.0.).And.Flotij) Then 188 Tss=Min(0.,Tsij) 189 Dou=(Tbmerij-Tss)*Dee 190 Do K=1,Nz 191 Newtempcol(K)=Tss+Dou*(K-1.) 165 192 End Do 166 193 167 194 ! Pas De Glace 168 195 Else 169 Tss=Ts (Ii,Jj)170 Do K=1,Nz 171 Newtempcol _m(Ii,Jj,K)=Tss196 Tss=Tsij 197 Do K=1,Nz 198 Newtempcol(K)=Tss 172 199 End Do 173 200 End If 174 201 175 202 ! Temperature Dans Le Socle, Lineaire Avec Le Gradient Ghf 176 If (.Not.Flot _m) Then203 If (.Not.Flotij) Then 177 204 Do K=Nz+1,nz+nzm 178 Hh(K)=Newtempcol _m(Ii,Jj,Nz)-Dzm*(K-Nz)*Ghf(Ii,Jj)/Cm205 Hh(K)=Newtempcol(Nz)-Dzm*(K-Nz)*Ghfij/Cm 179 206 End Do 180 207 Else 181 208 Do K=Nz+1,nz+nzm 182 Hh(K)=Tbmer _m-Dzm*(K-Nz)*Ghf(Ii,Jj)/Cm209 Hh(K)=Tbmerij-Dzm*(K-Nz)*Ghfij/Cm 183 210 End Do 184 211 End If … … 189 216 190 217 Do K=Nz+1,nz+nzm 191 Newtempcol _m(Ii,Jj,K)=Hh(K)218 Newtempcol(K)=Hh(K) 192 219 End Do 193 220 194 Tbdot (Ii,Jj)=(Newtempcol_m(Ii,Jj,Nz)-T(Ii,Jj,Nz))/Dtt195 Bmelt (Ii,Jj)=0.196 Ibase (Ii,Jj)=5197 Phid (Ii,Jj)=0.221 Tbdotij=(Newtempcol(Nz)-Tij(Nz))/Dtt 222 Bmeltij=0. 223 Ibase=5 224 Phidij=0. 198 225 199 226 -
trunk/SOURCES/deformation_mod_2lois.f90
r71 r73 468 468 !debug_3d(:,:,90+iiglen-1) = s2a(:,:,1,iiglen) 469 469 470 471 !~ ! Temps elapsed final472 !~ call system_clock(count=t2, count_rate=ir)473 !~ temps=real(t2 - t1,kind=4)/real(ir,kind=4)474 !~ ! Temps CPU de calcul final475 !~ call cpu_time(t_cpu_1)476 !~ t_cpu = t_cpu_1 - t_cpu_0477 478 !~ ! Impression du resultat.479 !~ print '(//,3X,"Valeurs de nx et ny : ",I5,I5/, &480 !~ & 3X,"Temps elapsed : ",1PE10.3," sec.",/, &481 !~ & 3X,"Temps CPU : ",1PE10.3," sec.",/, &482 !~ & 3X,"Norme (PB si /= 0) : ",1PE10.3,//)', &483 !~ nx,ny,temps,t_cpu,norme484 485 470 end subroutine flowlaw 486 471 -
trunk/SOURCES/flottab2-0.7.f90
r72 r73 105 105 106 106 107 !~ integer :: t1,t2,ir108 !~ real :: temps, t_cpu_0, t_cpu_1, t_cpu, norme109 110 !~ ! Temps CPU de calcul initial.111 !~ call cpu_time(t_cpu_0)112 !~ ! Temps elapsed de reference.113 !~ call system_clock(count=t1, count_rate=ir)114 115 107 116 108 if (itracebug.eq.1) call tracebug(' Entree dans routine flottab') … … 725 717 !fin de routine flottab2 726 718 !print*, 'front',front(50,30),ice(50,30),flotmx(i,j),uxbar(i,j) 727 728 !~ ! Temps elapsed final729 !~ call system_clock(count=t2, count_rate=ir)730 !~ temps=real(t2 - t1,kind=4)/real(ir,kind=4)731 !~ ! Temps CPU de calcul final732 !~ call cpu_time(t_cpu_1)733 !~ t_cpu = t_cpu_1 - t_cpu_0734 735 !~ ! Impression du resultat.736 !~ print '(//,3X,"Valeurs de nx et ny : ",I5,I5/, &737 !~ & 3X,"Temps elapsed : ",1PE10.3," sec.",/, &738 !~ & 3X,"Temps CPU : ",1PE10.3," sec.",/, &739 !~ & 3X,"Norme (PB si /= 0) : ",1PE10.3,//)', &740 !~ nx,ny,temps,t_cpu,norme741 719 742 720 end subroutine flottab -
trunk/SOURCES/resol_adv_diff_2D-sept2009.f90
r65 r73 101 101 subroutine resol_adv_diff_2D_vect(Dfx,Dfy,advx,advy,H_presc,i_Hpresc,bil,vieuxH,newH) 102 102 103 !$ USE OMP_LIB 103 104 implicit none 104 105 … … 148 149 if (itracebug.eq.1) call tracebug(' Entree dans routine resolution_diffusion') 149 150 150 151 !$OMP PARALLEL 152 !$OMP WORKSHARE 151 153 ! calcul de bdx et hdx 152 154 hdx(:,:)=dx1*(vieuxH(:,:)-eoshift(vieuxH(:,:),shift=-1,boundary=0.,dim=1)) … … 164 166 Frelax(:,:)=0. 165 167 DeltaH(:,:)=0. 166 168 !$OMP END WORKSHARE 167 169 168 170 ! schema spatial 169 171 170 172 if (upwind.eq.1.) then !schema amont 171 173 !$OMP WORKSHARE 172 174 where (Advx(:,:).ge.0.) 173 175 c_west(:,:)=1. … … 185 187 c_north(:,:)=1. 186 188 end where 187 189 !$OMP END WORKSHARE 188 190 else if (upwind.lt.1.) then ! schema centre 191 !$OMP WORKSHARE 189 192 c_west(:,:)=0.5 190 193 c_east(:,:)=0.5 191 194 c_south(:,:)=0.5 192 195 c_north(:,:)=0.5 196 !$OMP END WORKSHARE 193 197 end if 194 198 199 195 200 ! attribution des elements des diagonales 201 !$OMP DO PRIVATE(frdx,frdy,fraxw,fraxe,frays,frayn) 196 202 do j=2,ny-1 197 203 do i=2,nx-1 … … 254 260 end do 255 261 end do 256 257 262 !$OMP END DO 263 264 !$OMP WORKSHARE 258 265 where (i_hpresc(:,:) .eq.1) ! thickness prescribed 259 266 frelax(:,:) = H_presc(:,:) … … 264 271 erelax(:,:) = 0. 265 272 end where 273 !$OMP END WORKSHARE 274 !$OMP END PARALLEL 266 275 267 276 stopp = .false. 268 277 ntour=0 269 278 270 271 272 279 relax_loop: do while(.not.stopp) 273 280 ntour=ntour+1 274 275 281 !$OMP PARALLEL 282 !$OMP DO PRIVATE(reste) 276 283 do j=2,ny-1 277 284 do i=2,nx-1 … … 281 288 + crelax(i,j)*newH(i,j))- frelax(i,j) 282 289 283 if (ntour.eq.1) debug_3D(i,j,49)=(((arelax(i,j)*newH(i-1,j) +drelax(i,j)*newH(i,j-1)) &284 + (brelax(i,j)*newH(i+1,j) + erelax(i,j)*newH(i,j+1))) &285 + crelax(i,j)*newH(i,j))290 !if (ntour.eq.1) debug_3D(i,j,49)=(((arelax(i,j)*newH(i-1,j) +drelax(i,j)*newH(i,j-1)) & 291 ! + (brelax(i,j)*newH(i+1,j) + erelax(i,j)*newH(i,j+1))) & 292 ! + crelax(i,j)*newH(i,j)) 286 293 287 294 … … 290 297 end do 291 298 end do 292 293 debug_3D(:,:,50)=arelax(:,:) 294 debug_3D(:,:,51)=brelax(:,:) 295 debug_3D(:,:,52)=crelax(:,:) 296 debug_3D(:,:,53)=drelax(:,:) 297 debug_3D(:,:,54)=erelax(:,:) 298 debug_3D(:,:,55)=frelax(:,:) 299 300 301 299 !$OMP END DO 300 301 !debug_3D(:,:,50)=arelax(:,:) 302 !debug_3D(:,:,51)=brelax(:,:) 303 !debug_3D(:,:,52)=crelax(:,:) 304 !debug_3D(:,:,53)=drelax(:,:) 305 !debug_3D(:,:,54)=erelax(:,:) 306 !debug_3D(:,:,55)=frelax(:,:) 307 308 309 !$OMP WORKSHARE 302 310 newH(:,:)=newH(:,:)-deltaH(:,:) 303 304 311 !$OMP END WORKSHARE 312 !$OMP END PARALLEL 305 313 306 314 … … 310 318 delh=0 311 319 312 320 !$OMP PARALLEL 321 !$OMP DO REDUCTION(+:delh) 313 322 do j=2,ny-1 314 323 do i=2,nx-1 … … 316 325 end do 317 326 end do 327 !$OMP END DO 328 !$OMP END PARALLEL 318 329 319 330 if (delh.gt.0.) then … … 330 341 331 342 ! thickness at the upwind node 332 do j = 1, ny 333 do i = 2, nx 334 debug_3D(i,j,92) = c_west(i,j) * newH(i-1,j) + c_east(i,j) * newH(i,j) 335 end do 336 end do 337 do j = 2, ny 338 do i = 1, nx 339 debug_3D(i,j,93) = c_south(i,j) * newH(i,j-1) + c_north(i,j) * newH(i,j) 340 end do 341 end do 342 343 if (itracebug.eq.1) call tracebug(' fin routine resolution_diffusion') 343 !do j = 1, ny 344 ! do i = 2, nx 345 ! debug_3D(i,j,92) = c_west(i,j) * newH(i-1,j) + c_east(i,j) * newH(i,j) 346 ! end do 347 !end do 348 !do j = 2, ny 349 ! do i = 1, nx 350 ! debug_3D(i,j,93) = c_south(i,j) * newH(i,j-1) + c_north(i,j) * newH(i,j) 351 ! end do 352 !end do 353 354 if (itracebug.eq.1) call tracebug(' fin routine resolution_diffusion') 355 356 344 357 return 345 358
Note: See TracChangeset
for help on using the changeset viewer.