/[lmdze]/trunk/Sources/dyn3d/Dissipation/gradiv2.f
ViewVC logotype

Contents of /trunk/Sources/dyn3d/Dissipation/gradiv2.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 207 - (show annotations)
Thu Sep 1 10:30:53 2016 UTC (7 years, 8 months ago) by guez
File size: 2037 byte(s)
New philosophy on compiler options.

Removed source code for thermcep = f. (Not used in LMDZ either.)

1 module gradiv2_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE gradiv2(xcov, ycov, ld, gdx, gdy, cdivu)
8
9 ! From LMDZ4/libf/dyn3d/gradiv2.F, version 1.1.1.1 2004/05/19 12:53:07
10 ! P. Le Van
11 ! Calcul du gradient de la divergence du vecteur v.
12
13 USE comgeom, ONLY: cuvscvgam1, cvuscugam1, unsair_gam1, unsapolnga1, &
14 unsapolsga1
15 USE dimens_m, ONLY: iim, jjm
16 use divergf_m, only: divergf
17 USE filtreg_scal_m, ONLY: filtreg_scal
18 use grad_m, only: grad
19 use laplacien_gam_m, only: laplacien_gam
20 use laplacien_m, only: laplacien
21 use nr_util, only: assert_eq, assert
22
23 ! Composantes covariantes de v :
24 REAL, intent(in):: xcov(:, :, :) ! (iim + 1, jjm + 1, klevel)
25 REAL, intent(in):: ycov(:, :, :) ! (iim + 1, jjm, klevel)
26
27 integer, intent(in):: ld
28 REAL, intent(out):: gdx(:, :, :) ! (iim + 1, jjm + 1, klevel)
29 REAL, intent(out):: gdy(:, :, :) ! (iim + 1, jjm, klevel)
30 real, intent(in):: cdivu
31
32 ! Variables locales :
33 REAL nugrads, div(iim + 1, jjm + 1, size(xcov, 3))
34 INTEGER iter, klevel
35
36 !--------------------------------------------------------------
37
38 call assert((/size(xcov, 1), size(ycov, 1), size(gdx, 1), size(gdy, 1)/) &
39 == iim + 1, "gradiv2 iim")
40 call assert((/size(xcov, 2) - 1, size(ycov, 2), size(gdx, 2) - 1, &
41 size(gdy, 2)/) == jjm, "gradiv2 iim")
42 klevel = assert_eq(size(xcov, 3), size(ycov, 3), size(gdx, 3), &
43 size(gdy, 3), "gradiv2 klevel")
44
45 CALL divergf(klevel, xcov, ycov, div)
46
47 IF (ld > 1) THEN
48 CALL laplacien(klevel, div)
49
50 ! Itération de l'opérateur laplacien_gam
51 DO iter = 1, ld - 2
52 CALL laplacien_gam(klevel, cuvscvgam1, cvuscugam1, unsair_gam1, &
53 unsapolnga1, unsapolsga1, div, div)
54 END DO
55 ENDIF
56
57 CALL filtreg_scal(div, direct = .true., intensive = .true.)
58 CALL grad(klevel, div, gdx, gdy)
59 nugrads = (-1.)**ld * cdivu
60
61 gdx = gdx * nugrads
62 gdy = gdy * nugrads
63
64 END SUBROUTINE gradiv2
65
66 end module gradiv2_m

  ViewVC Help
Powered by ViewVC 1.1.21