[1056] | 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(:) |
---|
[1126] | 26 | REAL,ALLOCATABLE,SAVE :: zlevmoy(:),zlaymoy(:),phimoy(:) |
---|
[1056] | 27 | REAL,ALLOCATABLE,SAVE :: tmoy(:),tetamoy(:),pkmoy(:) |
---|
| 28 | INTEGER,ALLOCATABLE,SAVE :: klat(:) |
---|
| 29 | |
---|
| 30 | CONTAINS |
---|
| 31 | |
---|
| 32 | !====================================================================== |
---|
[1251] | 33 | SUBROUTINE moyzon_init(klon,llm,nqtot) |
---|
[1107] | 34 | #ifdef CPP_PHYS |
---|
[1251] | 35 | !! This routine needs physics |
---|
[1056] | 36 | IMPLICIT NONE |
---|
[1251] | 37 | INTEGER :: klon,llm,nqtot |
---|
[1056] | 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)) |
---|
[1107] | 43 | #endif |
---|
[1056] | 44 | END SUBROUTINE moyzon_init |
---|
| 45 | |
---|
| 46 | !====================================================================== |
---|
[1251] | 47 | SUBROUTINE moyzon_init_omp(nlon,llm,nqtot) |
---|
[1107] | 48 | #ifdef CPP_PHYS |
---|
[1056] | 49 | IMPLICIT NONE |
---|
| 50 | |
---|
[1251] | 51 | INTEGER :: nlon,llm,nqtot |
---|
[1056] | 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)) |
---|
[1107] | 57 | #endif |
---|
[1056] | 58 | END SUBROUTINE moyzon_init_omp |
---|
| 59 | |
---|
| 60 | !====================================================================== |
---|
| 61 | SUBROUTINE moyzon(nlev,var,varbar) |
---|
| 62 | |
---|
| 63 | IMPLICIT 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 |
---|
| 79 | END SUBROUTINE moyzon |
---|
| 80 | |
---|
| 81 | !====================================================================== |
---|
| 82 | END MODULE moyzon_mod |
---|