[5099] | 1 | |
---|
[524] | 2 | ! $Header$ |
---|
[5099] | 3 | |
---|
[5105] | 4 | SUBROUTINE diverg_gam(klevel,cuvscvgam,cvuscugam,unsairegam , & |
---|
| 5 | unsapolnga,unsapolsga, x, y, div ) |
---|
[5159] | 6 | |
---|
[5105] | 7 | ! P. Le Van |
---|
[5159] | 8 | |
---|
[5105] | 9 | ! ********************************************************************* |
---|
| 10 | ! ... calcule la divergence a tous les niveaux d'1 vecteur de compos. |
---|
| 11 | ! x et y... |
---|
| 12 | ! x et y etant des composantes covariantes ... |
---|
| 13 | ! ********************************************************************* |
---|
[5123] | 14 | USE lmdz_ssum_scopy, ONLY: ssum |
---|
[5136] | 15 | USE lmdz_comgeom |
---|
[5123] | 16 | |
---|
[5159] | 17 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
| 18 | USE lmdz_paramet |
---|
[5105] | 19 | IMPLICIT NONE |
---|
[5159] | 20 | |
---|
[5105] | 21 | ! x et y sont des arguments d'entree pour le s-prog |
---|
| 22 | ! div est un argument de sortie pour le s-prog |
---|
| 23 | ! |
---|
[5159] | 24 | |
---|
| 25 | |
---|
| 26 | |
---|
[5105] | 27 | ! .......... variables en arguments ................... |
---|
[5159] | 28 | |
---|
[5105] | 29 | INTEGER :: klevel |
---|
| 30 | REAL :: x( ip1jmp1,klevel ),y( ip1jm,klevel ),div( ip1jmp1,klevel ) |
---|
| 31 | REAL :: cuvscvgam(ip1jm),cvuscugam(ip1jmp1),unsairegam(ip1jmp1) |
---|
| 32 | REAL :: unsapolnga,unsapolsga |
---|
[5159] | 33 | |
---|
[5105] | 34 | ! ............... variables locales ......................... |
---|
[524] | 35 | |
---|
[5105] | 36 | REAL :: aiy1( iip1 ) , aiy2( iip1 ) |
---|
| 37 | REAL :: sumypn,sumyps |
---|
| 38 | INTEGER :: l,ij |
---|
| 39 | ! ................................................................... |
---|
[5123] | 40 | |
---|
[5159] | 41 | |
---|
[5105] | 42 | DO l = 1,klevel |
---|
[5159] | 43 | |
---|
[5105] | 44 | DO ij = iip2, ip1jm - 1 |
---|
| 45 | div( ij + 1, l ) = ( & |
---|
| 46 | cvuscugam( ij+1 ) * x( ij+1,l ) - cvuscugam( ij ) * x( ij , l) + & |
---|
| 47 | cuvscvgam(ij-iim) * y(ij-iim,l) - cuvscvgam(ij+1) * y(ij+1,l) )* & |
---|
| 48 | unsairegam( ij+1 ) |
---|
| 49 | ENDDO |
---|
[5159] | 50 | |
---|
[5105] | 51 | ! .... correction pour div( 1,j,l) ...... |
---|
| 52 | ! .... div(1,j,l)= div(iip1,j,l) .... |
---|
[5159] | 53 | |
---|
[5105] | 54 | !DIR$ IVDEP |
---|
| 55 | DO ij = iip2,ip1jm,iip1 |
---|
| 56 | div( ij,l ) = div( ij + iim,l ) |
---|
| 57 | ENDDO |
---|
[5159] | 58 | |
---|
[5105] | 59 | ! .... calcul aux poles ..... |
---|
[5159] | 60 | |
---|
[5105] | 61 | DO ij = 1,iim |
---|
| 62 | aiy1(ij) = cuvscvgam( ij ) * y( ij , l ) |
---|
| 63 | aiy2(ij) = cuvscvgam( ij+ ip1jmi1 ) * y( ij+ ip1jmi1, l ) |
---|
| 64 | ENDDO |
---|
| 65 | sumypn = SSUM ( iim,aiy1,1 ) * unsapolnga |
---|
| 66 | sumyps = SSUM ( iim,aiy2,1 ) * unsapolsga |
---|
[5159] | 67 | |
---|
[5105] | 68 | DO ij = 1,iip1 |
---|
| 69 | div( ij , l ) = - sumypn |
---|
| 70 | div( ij + ip1jm, l ) = sumyps |
---|
| 71 | ENDDO |
---|
| 72 | END DO |
---|
| 73 | ! |
---|
[524] | 74 | |
---|
[5105] | 75 | RETURN |
---|
| 76 | END SUBROUTINE diverg_gam |
---|