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

Contents of /trunk/dyn3d/divergf.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 57 - (show annotations)
Mon Jan 30 12:54:02 2012 UTC (12 years, 4 months ago) by guez
Original Path: trunk/libf/dyn3d/divergf.f90
File size: 1820 byte(s)
Write used namelists to file "" instead of standard output.

Avoid aliasing in "inidissip" in calls to "divgrad2", "divgrad",
"gradiv2", "gradiv", "nxgraro2" and "nxgrarot". Add a degenerate
dimension to arrays so they have rank 3, like the dummy arguments in
"divgrad2", "divgrad", "gradiv2", "gradiv", "nxgraro2" and "nxgrarot".

Extract the initialization part from "bilan_dyn" and make a separate
procedure, "init_dynzon", from it.

Move variables from modules "iniprint" and "logic" to module
"conf_gcm_m".

Promote internal procedures of "fxy" to private procedures of module
"fxy_m".

Extracted documentation from "inigeom". Removed useless "save"
attributes. Removed useless intermediate variables. Extracted
processing of poles from loop on latitudes. Write coordinates to file
"longitude_latitude.txt" instead of standard output.

Do not use ozone tracer for radiative transfer.

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, v 1.1.1.1 2004/05/19 12:53:05
10
11 ! P. Le Van
12 ! Calcule la divergence à tous les niveaux d'un vecteur de
13 ! composantes x et y. x et y sont des composantes covariantes.
14
15 USE dimens_m, ONLY: iim
16 USE paramet_m, ONLY: iip1, iip2, ip1jm, ip1jmi1, ip1jmp1, jjp1
17 USE comgeom, ONLY: apoln, apols, cuvsurcv, cvusurcu, unsaire
18 USE filtreg_m, ONLY: filtreg
19
20 ! div est un argument de sortie pour le s-prog
21
22 ! variables en arguments
23
24 INTEGER, intent(in):: klevel
25 REAL, intent(in):: x(ip1jmp1, klevel), y(ip1jm, klevel)
26 real div(ip1jmp1, klevel)
27
28 ! variables locales
29
30 INTEGER l, ij
31 REAL aiy1(iip1) , aiy2(iip1)
32 REAL sumypn, sumyps
33
34 REAL SSUM
35
36 !------------------------------------------------------------
37
38 DO l = 1, klevel
39 DO ij = iip2, ip1jm - 1
40 div(ij + 1, l) = cvusurcu(ij+1) * x(ij+1, l) &
41 - cvusurcu(ij) * x(ij , l) + cuvsurcv(ij-iim) * y(ij-iim, l) &
42 - cuvsurcv(ij+1) * y(ij+1, l)
43 ENDDO
44
45 DO ij = iip2, ip1jm, iip1
46 div(ij, l) = div(ij + iim, l)
47 ENDDO
48
49 ! Calcul aux pôles
50
51 DO ij = 1, iim
52 aiy1(ij) = cuvsurcv(ij) * y(ij , l)
53 aiy2(ij) = cuvsurcv(ij+ ip1jmi1) * y(ij+ ip1jmi1, l)
54 ENDDO
55 sumypn = SSUM (iim, aiy1, 1) / apoln
56 sumyps = SSUM (iim, aiy2, 1) / apols
57
58 DO ij = 1, iip1
59 div(ij , l) = - sumypn
60 div(ij + ip1jm, l) = sumyps
61 ENDDO
62 end DO
63
64 CALL filtreg(div, jjp1, klevel, 2, 2, .TRUE., 1)
65
66 DO l = 1, klevel
67 DO ij = iip2, ip1jm
68 div(ij, l) = div(ij, l) * unsaire(ij)
69 ENDDO
70 ENDDO
71
72 END SUBROUTINE divergf
73
74 end module divergf_m

  ViewVC Help
Powered by ViewVC 1.1.21