1 | ! |
---|
2 | ! $Id: adaptdt.f90 5282 2024-10-28 12:11:48Z abarral $ |
---|
3 | ! |
---|
4 | subroutine adaptdt(nadv,dtbon,n,pbaru, & |
---|
5 | masse) |
---|
6 | |
---|
7 | USE comgeom2_mod_h |
---|
8 | USE comdissip_mod_h |
---|
9 | USE comconst_mod, ONLY: dtvr |
---|
10 | USE dimensions_mod, ONLY: iim, jjm, llm, ndm |
---|
11 | USE paramet_mod_h, ONLY: iip1, iip2, iip3, jjp1, llmp1, llmp2, llmm1, kftd, ip1jm, ip1jmp1, & |
---|
12 | ip1jmi1, ijp1llm, ijmllm, mvar, jcfil, jcfllm |
---|
13 | IMPLICIT NONE |
---|
14 | |
---|
15 | |
---|
16 | |
---|
17 | !---------------------------------------------------------- |
---|
18 | ! Arguments |
---|
19 | !---------------------------------------------------------- |
---|
20 | INTEGER :: n,nadv |
---|
21 | REAL :: dtbon |
---|
22 | REAL :: pbaru(iip1,jjp1,llm) |
---|
23 | REAL :: masse(iip1,jjp1,llm) |
---|
24 | !---------------------------------------------------------- |
---|
25 | ! Local |
---|
26 | !---------------------------------------------------------- |
---|
27 | INTEGER :: i,j,l |
---|
28 | REAL :: CFLmax,aaa,bbb |
---|
29 | |
---|
30 | CFLmax=0. |
---|
31 | do l=1,llm |
---|
32 | do j=2,jjm |
---|
33 | do i=1,iim |
---|
34 | aaa=pbaru(i,j,l)*dtvr/masse(i,j,l) |
---|
35 | CFLmax=max(CFLmax,aaa) |
---|
36 | bbb=-pbaru(i,j,l)*dtvr/masse(i+1,j,l) |
---|
37 | CFLmax=max(CFLmax,bbb) |
---|
38 | enddo |
---|
39 | enddo |
---|
40 | enddo |
---|
41 | n=int(CFLmax)+1 |
---|
42 | ! pour reproduire cas VL du code qui appele x,y,z,y,x |
---|
43 | ! if (nadv.eq.30) n=n/2 ! Pour Prather |
---|
44 | dtbon=dtvr/n |
---|
45 | |
---|
46 | return |
---|
47 | end subroutine adaptdt |
---|
48 | |
---|
49 | |
---|
50 | |
---|
51 | |
---|
52 | |
---|
53 | |
---|
54 | |
---|