1 | MODULE moyzon_mod |
---|
2 | ! Moyennes zonales pour transmission a la physique |
---|
3 | !====================================================================== |
---|
4 | ! Specifique a Titan |
---|
5 | ! |
---|
6 | !====================================================================== |
---|
7 | ! Declaration des variables |
---|
8 | |
---|
9 | REAL,ALLOCATABLE,SAVE :: zplevbar_mpi(:,:),zplaybar_mpi(:,:) |
---|
10 | REAL,ALLOCATABLE,SAVE :: ztfibar_mpi(:,:),zqfibar_mpi(:,:,:) |
---|
11 | REAL,ALLOCATABLE,SAVE :: zphibar_mpi(:,:),zphisbar_mpi(:) |
---|
12 | REAL,ALLOCATABLE,SAVE :: zpkbar_mpi(:,:),ztetabar_mpi(:,:) |
---|
13 | |
---|
14 | REAL,ALLOCATABLE,SAVE :: zplevbar(:,:),zplaybar(:,:) |
---|
15 | REAL,ALLOCATABLE,SAVE :: ztfibar(:,:),zqfibar(:,:,:) |
---|
16 | REAL,ALLOCATABLE,SAVE :: zphibar(:,:),zphisbar(:) |
---|
17 | REAL,ALLOCATABLE,SAVE :: zzlevbar(:,:),zzlaybar(:,:) |
---|
18 | !$OMP THREADPRIVATE(zplevbar,zplaybar,ztfibar,zqfibar) |
---|
19 | !$OMP THREADPRIVATE(zphibar,zphisbar,zzlevbar,zzlaybar) |
---|
20 | |
---|
21 | ! pmoy: global averaged pressure... |
---|
22 | ! tmoy: global averaged temperature... |
---|
23 | ! put here to be transfered to Titan routines... |
---|
24 | ! to be changed... |
---|
25 | REAL,ALLOCATABLE,SAVE :: plevmoy(:),playmoy(:) |
---|
26 | REAL,ALLOCATABLE,SAVE :: zlevmoy(:),zlaymoy(:),phimoy(:) |
---|
27 | REAL,ALLOCATABLE,SAVE :: tmoy(:),tetamoy(:),pkmoy(:) |
---|
28 | INTEGER,ALLOCATABLE,SAVE :: klat(:) |
---|
29 | |
---|
30 | CONTAINS |
---|
31 | |
---|
32 | !====================================================================== |
---|
33 | SUBROUTINE moyzon_init |
---|
34 | #ifdef CPP_PHYS |
---|
35 | ! This routine needs physics |
---|
36 | USE dimphy |
---|
37 | USE infotrac, only: nqtot |
---|
38 | IMPLICIT NONE |
---|
39 | INCLUDE "dimensions.h" |
---|
40 | |
---|
41 | ALLOCATE(zplevbar_mpi(klon,llm+1),zplaybar_mpi(klon,llm)) |
---|
42 | ALLOCATE(zphibar_mpi(klon,llm),zphisbar_mpi(klon)) |
---|
43 | ALLOCATE(ztfibar_mpi(klon,llm),zqfibar_mpi(klon,llm,nqtot)) |
---|
44 | ALLOCATE(zpkbar_mpi(klon,llm),ztetabar_mpi(klon,llm)) |
---|
45 | #endif |
---|
46 | END SUBROUTINE moyzon_init |
---|
47 | |
---|
48 | !====================================================================== |
---|
49 | SUBROUTINE moyzon_init_omp(nlon) |
---|
50 | #ifdef CPP_PHYS |
---|
51 | ! This routine needs physics |
---|
52 | USE dimphy |
---|
53 | USE infotrac, only: nqtot |
---|
54 | IMPLICIT NONE |
---|
55 | INCLUDE "dimensions.h" |
---|
56 | |
---|
57 | INTEGER :: nlon |
---|
58 | |
---|
59 | ALLOCATE(zplevbar(nlon,llm+1),zplaybar(nlon,llm)) |
---|
60 | ALLOCATE(zphibar(nlon,llm),zphisbar(nlon)) |
---|
61 | ALLOCATE(ztfibar(nlon,llm),zqfibar(nlon,llm,nqtot)) |
---|
62 | ALLOCATE(zzlevbar(nlon,llm+1),zzlaybar(nlon,llm)) |
---|
63 | #endif |
---|
64 | END SUBROUTINE moyzon_init_omp |
---|
65 | |
---|
66 | !====================================================================== |
---|
67 | SUBROUTINE moyzon(nlev,var,varbar) |
---|
68 | |
---|
69 | IMPLICIT NONE |
---|
70 | #include "dimensions.h" |
---|
71 | #include "paramet.h" |
---|
72 | |
---|
73 | INTEGER :: nlev |
---|
74 | REAL,dimension(iip1,nlev) :: var |
---|
75 | REAL,dimension(nlev) :: varbar |
---|
76 | |
---|
77 | INTEGER :: i |
---|
78 | |
---|
79 | varbar(:) = 0. |
---|
80 | do i=1,iim |
---|
81 | varbar(:)=varbar(:)+var(i,:)/iim |
---|
82 | enddo |
---|
83 | |
---|
84 | return |
---|
85 | END SUBROUTINE moyzon |
---|
86 | |
---|
87 | !====================================================================== |
---|
88 | END MODULE moyzon_mod |
---|