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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 137 - (hide annotations)
Wed May 6 15:51:03 2015 UTC (9 years ago) by guez
File size: 1992 byte(s)
Removed unused argument missval in ma_fucoll_r[1-3]1, ma_fufill_r[1-3]1.

Split filtreg into two procedures: filtreg_scal and filtreg_v. I did
not like the test on the extent of the argument and there was no
common code between the two cases: jjm and jjm + 1. Also, it is
simpler now to just remove the argument "direct" from filtreg_v instead
of allowing it and then stopping the program if it is false.

Removed the computation of pkf in reanalyse2nat, was not used.

As a consequence of the split of filtreg, had to extract the
computation of pkf out of exner_hyb. This is clearer anyway because we
want to be able to call exner_hyb with any size in the first two
dimensions (as in test_disvert). But at the same time exner_hyb
required particular sizes for the computation of pkf. It was
awkward. The only computation of pkf is now in leapfrog.

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

  ViewVC Help
Powered by ViewVC 1.1.21