/[lmdze]/trunk/dyn3d/divergf.f
ViewVC logotype

Contents of /trunk/dyn3d/divergf.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 107 - (show annotations)
Thu Sep 11 15:09:15 2014 UTC (9 years, 8 months ago) by guez
File size: 1482 byte(s)
Imported procedure grilles_gcm_sub from LMDZ. Had then to transform
local variable phis of etat to argument.

Replaced calls to lnblnk by calls to trim.

Removed arguments nlat, klevel and griscal of filtreg. Replaced
integer arguments ifiltre and iaire by logical arguments direct and
intensive.

Changed default values of guide_t and guide_q to false.

1 module divergf_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE divergf(klevel, x, y, div)
8
9 ! From libf/dyn3d/divergf.F, version 1.1.1.1 2004/05/19 12:53:05
10
11 ! P. Le Van
12
13 ! Calcule la divergence à tous les niveaux d'un vecteur de
14 ! composantes x et y. x et y sont des composantes covariantes.
15
16 USE comgeom, ONLY: apoln, apols, cuvsurcv_2d, cvusurcu_2d, unsaire_2d
17 USE dimens_m, ONLY: iim, jjm
18 USE filtreg_m, ONLY: filtreg
19
20 INTEGER, intent(in):: klevel
21 REAL, intent(in):: x(iim + 1, jjm + 1, klevel), y(iim + 1, jjm, klevel)
22 real, intent(out):: div(iim + 1, jjm + 1, klevel) ! in (unit of x, y) m-2
23
24 ! Variables locales :
25
26 INTEGER l, i, j
27
28 !------------------------------------------------------------
29
30 DO l = 1, klevel
31 forall (i = 2:iim + 1, j = 2:jjm) div(i, j, l) = cvusurcu_2d(i, j) &
32 * x(i, j, l) - cvusurcu_2d(i - 1, j) * x(i - 1, j , l) &
33 + cuvsurcv_2d(i, j - 1) * y(i, j - 1, l) - cuvsurcv_2d(i, j) &
34 * y(i, j, l)
35
36 div(1, 2:jjm, l) = div(iim + 1, 2:jjm, l)
37
38 ! Calcul aux pôles
39 div(:, 1, l) = - SUM(cuvsurcv_2d(:iim, 1) * y(:iim, 1, l)) / apoln
40 div(:, jjm + 1, l) = SUM(cuvsurcv_2d(:iim, jjm) * y(:iim, jjm, l)) &
41 / apols
42 end DO
43
44 CALL filtreg(div, direct = .true., intensive = .false.)
45
46 DO l = 1, klevel
47 div(:, 2:jjm, l) = div(:, 2:jjm, l) * unsaire_2d(:, 2:jjm)
48 ENDDO
49
50 END SUBROUTINE divergf
51
52 end module divergf_m

  ViewVC Help
Powered by ViewVC 1.1.21