source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/dyn3dpar/moyzon_mod.F90 @ 298

Last change on this file since 298 was 222, checked in by ymipsl, 10 years ago

Creating temporary dynamico/lmdz/saturn branche

YM

File size: 2.6 KB
Line 
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
30CONTAINS
31
32!======================================================================
33SUBROUTINE moyzon_init(klon,llm,nqtot)
34#ifdef CPP_PHYS
35!! This routine needs physics
36IMPLICIT NONE
37       INTEGER :: klon,llm,nqtot
38
39      ALLOCATE(zplevbar_mpi(klon,llm+1),zplaybar_mpi(klon,llm))
40      ALLOCATE(zphibar_mpi(klon,llm),zphisbar_mpi(klon))
41      ALLOCATE(ztfibar_mpi(klon,llm),zqfibar_mpi(klon,llm,nqtot))
42      ALLOCATE(zpkbar_mpi(klon,llm),ztetabar_mpi(klon,llm))
43#endif
44END SUBROUTINE moyzon_init
45
46!======================================================================
47SUBROUTINE moyzon_init_omp(nlon,llm,nqtot)
48#ifdef CPP_PHYS
49IMPLICIT NONE
50
51      INTEGER :: nlon,llm,nqtot
52
53      ALLOCATE(zplevbar(nlon,llm+1),zplaybar(nlon,llm))
54      ALLOCATE(zphibar(nlon,llm),zphisbar(nlon))
55      ALLOCATE(ztfibar(nlon,llm),zqfibar(nlon,llm,nqtot))
56      ALLOCATE(zzlevbar(nlon,llm+1),zzlaybar(nlon,llm))
57#endif
58END SUBROUTINE moyzon_init_omp
59
60!======================================================================
61SUBROUTINE moyzon(nlev,var,varbar)
62
63IMPLICIT NONE
64#include "dimensions.h"
65#include "paramet.h"
66
67      INTEGER :: nlev
68      REAL,dimension(iip1,nlev) :: var
69      REAL,dimension(nlev)      :: varbar
70
71      INTEGER :: i
72
73      varbar(:) = 0.
74      do i=1,iim
75        varbar(:)=varbar(:)+var(i,:)/iim
76      enddo
77
78      return
79END SUBROUTINE moyzon
80
81!======================================================================
82      END MODULE moyzon_mod
Note: See TracBrowser for help on using the repository browser.