/[lmdze]/trunk/libf/dyn3d/dissip.f90
ViewVC logotype

Contents of /trunk/libf/dyn3d/dissip.f90

Parent Directory Parent Directory | Revision Log Revision Log


Revision 54 - (show annotations)
Tue Dec 6 15:07:04 2011 UTC (12 years, 5 months ago) by guez
File size: 2801 byte(s)
Removed Numerical Recipes procedure "ran1". Replaced calls to "ran1"
in "inidissip" by calls to intrinsic procedures.

Split file "interface_surf.f90" into a file with a module containing
only variables, "interface_surf", and single-procedure files. Gathered
files into directory "Interface_surf".

Added argument "cdivu" to "gradiv" and "gradiv2", "cdivh" to
"divgrad2" and "divgrad", and "crot" to "nxgraro2" and
"nxgrarot". "dissip" now uses variables "cdivu", "cdivh" and "crot"
from module "inidissip_m", so it can pass them to "gradiv2",
etc. Thanks to this modification, we avoid a circular dependency
betwwen "inidissip.f90" and "gradiv2.f90", etc. The value -1. used by
"gradiv2", for instance, during computation of eigenvalues is not the
value "cdivu" computed by "inidissip".

Extracted procedure "start_inter_3d" from module "startdyn", to its
own module.

In "inidissip", unrolled loop on "ii". I find it clearer now.

Moved variables "matriceun", "matriceus", "matricevn", "matricevs",
"matrinvn" and "matrinvs" from module "parafilt" to module
"inifilr_m". Moved variables "jfiltnu", "jfiltnv", "jfiltsu",
"jfiltsv" from module "coefils" to module "inifilr_m".

1 module dissip_m
2
3 IMPLICIT NONE
4
5 contains
6
7 SUBROUTINE dissip(vcov, ucov, teta, p, dv, du, dh)
8
9 ! From dyn3d/dissip.F, version 1.1.1.1 2004/05/19 12:53:05
10 ! Avec nouveaux opérateurs star : gradiv2, divgrad2, nxgraro2
11 ! Author: P. Le Van
12 ! Objet : dissipation horizontale
13
14 USE dimens_m, ONLY : iim, jjm, llm
15 USE paramet_m, ONLY : iip1, iip2, ip1jmp1, llmp1
16 USE comdissnew, ONLY : lstardis, nitergdiv, nitergrot, niterh
17 USE inidissip_m, ONLY : dtdiss, tetah, tetaudiv, tetaurot, cdivu, crot, &
18 cdivh
19 use gradiv2_m, only: gradiv2
20
21 ! Arguments:
22 REAL vcov((iim + 1) * jjm, llm), ucov(ip1jmp1, llm), teta(ip1jmp1, llm)
23 REAL, INTENT (IN) :: p(ip1jmp1, llmp1)
24 REAL dv((iim + 1) * jjm, llm), du(ip1jmp1, llm), dh(ip1jmp1, llm)
25
26 ! Local:
27 REAL gdx(ip1jmp1, llm), gdy((iim + 1) * jjm, llm)
28 REAL grx(ip1jmp1, llm), gry((iim + 1) * jjm, llm)
29 REAL te1dt(llm), te2dt(llm), te3dt(llm)
30 REAL deltapres(ip1jmp1, llm)
31
32 INTEGER l, ij
33
34 !-----------------------------------------------------------------------
35
36 ! Initializations:
37 te1dt = tetaudiv * dtdiss
38 te2dt = tetaurot * dtdiss
39 te3dt = tetah * dtdiss
40 du = 0.
41 dv = 0.
42 dh = 0.
43
44 ! Calcul de la dissipation:
45
46 ! Calcul de la partie grad (div) :
47
48 IF (lstardis) THEN
49 CALL gradiv2(llm, ucov, vcov, nitergdiv, gdx, gdy, cdivu)
50 ELSE
51 CALL gradiv(llm, ucov, vcov, nitergdiv, gdx, gdy, cdivu)
52 END IF
53
54 DO l = 1, llm
55 DO ij = 1, iip1
56 gdx(ij, l) = 0.
57 gdx(ij+(iim + 1) * jjm, l) = 0.
58 END DO
59
60 DO ij = iip2, (iim + 1) * jjm
61 du(ij, l) = du(ij, l) - te1dt(l) * gdx(ij, l)
62 END DO
63 DO ij = 1, (iim + 1) * jjm
64 dv(ij, l) = dv(ij, l) - te1dt(l) * gdy(ij, l)
65 END DO
66 END DO
67
68 ! calcul de la partie n X grad (rot) :
69
70 IF (lstardis) THEN
71 CALL nxgraro2(llm, ucov, vcov, nitergrot, grx, gry, crot)
72 ELSE
73 CALL nxgrarot(llm, ucov, vcov, nitergrot, grx, gry, crot)
74 END IF
75
76
77 DO l = 1, llm
78 DO ij = 1, iip1
79 grx(ij, l) = 0.
80 END DO
81
82 DO ij = iip2, (iim + 1) * jjm
83 du(ij, l) = du(ij, l) - te2dt(l) * grx(ij, l)
84 END DO
85 DO ij = 1, (iim + 1) * jjm
86 dv(ij, l) = dv(ij, l) - te2dt(l) * gry(ij, l)
87 END DO
88 END DO
89
90 ! calcul de la partie div (grad) :
91
92 IF (lstardis) THEN
93 DO l = 1, llm
94 DO ij = 1, ip1jmp1
95 deltapres(ij, l) = max(0., p(ij, l) - p(ij, l + 1))
96 END DO
97 END DO
98
99 CALL divgrad2(llm, teta, deltapres, niterh, gdx, cdivh)
100 ELSE
101 CALL divgrad(llm, teta, niterh, gdx, cdivh)
102 END IF
103
104 forall (l = 1: llm) dh(:, l) = dh(:, l) - te3dt(l) * gdx(:, l)
105
106 END SUBROUTINE dissip
107
108 end module dissip_m

  ViewVC Help
Powered by ViewVC 1.1.21