/[lmdze]/trunk/Sources/dyn3d/Guide/init_tau2alpha.f
ViewVC logotype

Contents of /trunk/Sources/dyn3d/Guide/init_tau2alpha.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 139 - (show annotations)
Tue May 26 17:46:03 2015 UTC (8 years, 11 months ago) by guez
File size: 2590 byte(s)
dynetat0 read rlonu, rlatu, rlonv, rlatv, cu_2d, cv_2d, aire_2d from
"start.nc" and then these variables were overwritten by
inigeom. Corrected this. Now, inigeom does not compute rlonu, rlatu,
rlonv and rlatv. Moreover, cu_2d, cv_2d, aire_2d are not written to
"restart.nc". Since xprimu, xprimv, xprimm025, xprimp025, rlatu1,
rlatu2, yprimu1, yprimu2 are computed at the same time as rlonu,
rlatu, rlonv, rlatv, and since it would not be convenient to separate
those computations, we decide to write xprimu, xprimv, xprimm025,
xprimp025, rlatu1, rlatu2, yprimu1, yprimu2 into "restart.nc", read
them from "start.nc" and not compute them in inigeom. So, in summary,
"start.nc" contains all the coordinates and their derivatives, and
inigeom only computes the 2D-variables.

Technical details:

Moved variables rlatu, rlonv, rlonu, rlatv, xprimu, xprimv from module
comgeom to module dynetat0_m. Upgraded local variables rlatu1,
yprimu1, rlatu2, yprimu2, xprimm025, xprimp025 of procedure inigeom to
variables of module dynetat0_m.

Removed unused local variable yprimu of procedure inigeom and
corresponding argument yyprimu of fyhyp.

Moved variables clat, clon, grossismx, grossismy, dzoomx, dzoomy,
taux, tauy from module serre to module dynetat0_m (since they are read
from "start.nc"). The default values are now defined in read_serre
instead of in the declarations. Changed name of module serre to
read_serre_m, no more module variable here.

The calls to fxhyp and fyhyp are moved from inigeom to etat0.

Side effects in programs other than gcm: etat0 and read_serre write
variables of module dynetat0; the programs test_fxyp and
test_inter_barxy need more source files.

Removed unused arguments len and nd of cv3_tracer. Removed unused
argument PPSOL of LWU.

Bug fix in test_inter_barxy: forgotten call to read_serre.

1 module init_tau2alpha_m
2
3 IMPLICIT NONE
4
5 REAL dxdy_min, dxdy_max, gamma
6
7 contains
8
9 SUBROUTINE init_tau2alpha(dxdys, dxdyu, dxdyv)
10
11 USE comgeom, ONLY: cu_2d, cv_2d
12 use conf_guide_m, only: guide_u, guide_v
13 use coordij_m, only: coordij
14 USE dimens_m, ONLY: iim, jjm
15 USE dynetat0_m, ONLY: clat, clon, grossismx, grossismy, rlatu
16 USE paramet_m, ONLY: iip1, jjp1
17 use writefield_m, only: writefield
18
19 REAL, intent(out):: dxdys(iip1, jjp1), dxdyu(iip1, jjp1), dxdyv(iip1, jjm)
20
21 ! Local:
22 INTEGER i, j, ilon, ilat
23 REAL dx(iip1, jjp1), dy(iip1, jjp1)
24
25 !------------------------------------------------------------
26
27 PRINT *, 'Call sequence information: init_tau2alpha'
28
29 DO j = 2, jjm
30 DO i = 2, iip1
31 dx(i, j) = 0.5 * (cu_2d(i - 1, j) + cu_2d(i, j)) / cos(rlatu(j))
32 END DO
33 dx(1, j) = dx(iip1, j)
34 END DO
35 DO j = 2, jjm
36 DO i = 1, iip1
37 dy(i, j) = 0.5 * (cv_2d(i, j - 1) + cv_2d(i, j))
38 END DO
39 END DO
40 DO i = 1, iip1
41 dx(i, 1) = dx(i, 2)
42 dx(i, jjp1) = dx(i, jjm)
43 dy(i, 1) = dy(i, 2)
44 dy(i, jjp1) = dy(i, jjm)
45 END DO
46
47 DO j = 1, jjp1
48 DO i = 1, iip1
49 dxdys(i, j) = sqrt(dx(i, j)**2 + dy(i, j)**2)
50 END DO
51 END DO
52 CALL writefield("dxdys", dxdys)
53
54 if (guide_u) then
55 DO j = 1, jjp1
56 DO i = 1, iim
57 dxdyu(i, j) = 0.5 * (dxdys(i, j) + dxdys(i + 1, j))
58 END DO
59 dxdyu(iip1, j) = dxdyu(1, j)
60 END DO
61 end if
62
63 if (guide_v) then
64 DO j = 1, jjm
65 DO i = 1, iip1
66 dxdyv(i, j) = 0.5 * (dxdys(i, j) + dxdys(i, j + 1))
67 END DO
68 END DO
69 end if
70
71 ! coordonnees du centre du zoom
72 CALL coordij(clon, clat, ilon, ilat)
73 ! aire de la maille au centre du zoom
74 dxdy_min = dxdys(ilon, ilat)
75
76 ! dxdy maximal de la maille :
77 dxdy_max = 0.
78 DO j = 1, jjp1
79 DO i = 1, iip1
80 dxdy_max = max(dxdy_max, dxdys(i, j))
81 END DO
82 END DO
83
84 IF (abs(grossismx - 1.) < 0.1 .OR. abs(grossismy - 1.) < 0.1) THEN
85 PRINT *, 'Attention : modèle peu zoomé.'
86 PRINT *, 'On prend une constante de guidage constante.'
87 ELSE
88 gamma = (dxdy_max - 2. * dxdy_min) / (dxdy_max - dxdy_min)
89 IF (gamma < 1E-5) THEN
90 PRINT *, '(dxdy_max - 2. * dxdy_min) / (dxdy_max - dxdy_min) ' &
91 // '< 1e-5'
92 STOP 1
93 END IF
94 gamma = log(0.5) / log(gamma)
95 PRINT *, 'gamma=', gamma
96 END IF
97
98 END SUBROUTINE init_tau2alpha
99
100 end module init_tau2alpha_m

  ViewVC Help
Powered by ViewVC 1.1.21