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

Contents of /trunk/dyn3d/divergf.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 254 - (show annotations)
Mon Feb 5 10:39:38 2018 UTC (6 years, 3 months ago) by guez
File size: 1497 byte(s)
Move Sources/* to root directory.
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_scal_m, ONLY: filtreg_scal
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_scal(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