/[lmdze]/trunk/dyn3d/Dissipation/inidissip.f
ViewVC logotype

Contents of /trunk/dyn3d/Dissipation/inidissip.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (show annotations)
Wed Aug 29 14:47:17 2012 UTC (11 years, 9 months ago) by guez
Original Path: trunk/libf/dyn3d/Dissipation/inidissip.f90
File size: 3567 byte(s)
Removed variable lstardis in module comdissnew and procedures gradiv
and nxgrarot. lstardir had to be true. gradiv and nxgrarot were called
if lstardis was false. Removed argument iter of procedure
filtreg. iter had to be 1. gradiv and nxgrarot called filtreg with
iter == 2.

Moved procedure flxsetup into module yoecumf. Module yoecumf is only
used in program units of directory Conflx, moved it there.

1 module inidissip_m
2
3 use dimens_m, only: llm
4
5 IMPLICIT NONE
6
7 private llm
8
9 REAL dtdiss ! in s
10 integer idissip ! période de la dissipation (en pas de temps)
11 real tetaudiv(llm), tetaurot(llm), tetah(llm) ! in s
12 real cdivu, crot, cdivh
13
14 contains
15
16 SUBROUTINE inidissip
17
18 ! From dyn3d/inidissip.F, version 1.1.1.1 2004/05/19 12:53:06
19
20 ! Initialisation de la dissipation horizontale. Calcul des valeurs
21 ! propres des opérateurs par méthode itérative.
22
23 USE comconst, ONLY: dtvr
24 use comdissnew, only: nitergdiv, nitergrot, niterh, tetagdiv, tetagrot, &
25 tetatemp
26 USE comvert, ONLY: preff, presnivs
27 USE conf_gcm_m, ONLY: iperiod
28 USE dimens_m, ONLY: iim, jjm
29 use filtreg_m, only: filtreg
30 use gradiv2_m, only: gradiv2
31 use jumble, only: new_unit
32 USE paramet_m, ONLY: jjp1
33
34 ! Variables local to the procedure:
35 REAL zvert(llm), max_zvert ! no dimension
36 REAL, dimension(iim + 1, jjm + 1, 1):: zh, zu, gx, divgra, deltap
37 real zv(iim + 1, jjm, 1), gy(iim + 1, jjm, 1)
38 REAL zllm
39 INTEGER l, seed_size, ii, unit
40 REAL tetamin ! in s
41
42 !-----------------------------------------------------------------------
43
44 PRINT *, 'Call sequence information: inidissip'
45 call random_seed(size=seed_size)
46 call random_seed(put=(/(0, ii = 1, seed_size)/))
47
48 PRINT *, 'Calcul des valeurs propres de divgrad'
49 deltap = 1.
50 call random_number(zh)
51 zh = zh - 0.5
52 CALL filtreg(zh, jjp1, 1, 2, 1, .TRUE.)
53
54 DO l = 1, 50
55 CALL divgrad2(1, zh, deltap, niterh, divgra, -1.)
56 zllm = abs(maxval(divgra))
57 zh = divgra / zllm
58 END DO
59
60 cdivh = 1. / zllm
61 PRINT *, 'cdivh = ', cdivh
62
63 PRINT *, 'Calcul des valeurs propres de gradiv'
64 call random_number(zu)
65 zu = zu - 0.5
66 CALL filtreg(zu, jjp1, 1, 2, 1, .TRUE.)
67 call random_number(zv)
68 zv = zv - 0.5
69 CALL filtreg(zv, jjm, 1, 2, 1, .FALSE.)
70
71 DO l = 1, 50
72 CALL gradiv2(zu, zv, nitergdiv, gx, gy, -1.)
73 zllm = max(abs(maxval(gx)), abs(maxval(gy)))
74 zu = gx / zllm
75 zv = gy / zllm
76 end DO
77
78 cdivu = 1. / zllm
79 PRINT *, 'cdivu = ', cdivu
80
81 PRINT *, 'Calcul des valeurs propres de nxgrarot'
82 call random_number(zu)
83 zu = zu - 0.5
84 CALL filtreg(zu, jjp1, 1, 2, 1, .TRUE.)
85 call random_number(zv)
86 zv = zv - 0.5
87 CALL filtreg(zv, jjm, 1, 2, 1, .FALSE.)
88
89 DO l = 1, 50
90 CALL nxgraro2(1, zu, zv, nitergrot, gx, gy, -1.)
91 zllm = max(abs(maxval(gx)), abs(maxval(gy)))
92 zu = gx / zllm
93 zv = gy / zllm
94 end DO
95
96 crot = 1. / zllm
97 PRINT *, 'crot = ', crot
98
99 ! Variation verticale du coefficient de dissipation :
100 zvert = 2. - 1. / (1. + (preff / presnivs - 1.)**2)
101 ! (between 1 and 2)
102
103 tetaudiv = zvert / tetagdiv
104 tetaurot = zvert / tetagrot
105 tetah = zvert / tetatemp
106
107 call new_unit(unit)
108 open(unit, file="inidissip.csv", status="replace", action="write")
109 write(unit, fmt=*) '"tetaudiv (s)" "tetaurot (s)" "tetah (s)"' ! title line
110 do l = 1, llm
111 write(unit, fmt=*) tetaudiv(l), tetaurot(l), tetah(l)
112 end do
113 close(unit)
114 print *, 'Created file "inidissip.csv".'
115
116 max_zvert = maxval(zvert)
117 tetamin = min(1e6, tetagdiv / max_zvert, tetagrot / max_zvert, &
118 tetatemp / max_zvert)
119 PRINT *, 'tetamin = ', tetamin
120 idissip = max(1, int(tetamin / (2 * dtvr * iperiod))) * iperiod
121 PRINT *, 'idissip = ', idissip
122 dtdiss = idissip * dtvr
123 PRINT *, 'dtdiss = ', dtdiss, "s"
124
125 END SUBROUTINE inidissip
126
127 end module inidissip_m

  ViewVC Help
Powered by ViewVC 1.1.21