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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 313 - (show annotations)
Mon Dec 10 15:54:30 2018 UTC (5 years, 5 months ago) by guez
File size: 2103 byte(s)
Remove module temps. Move variable itau_dyn from module temps to
module dynetat0_m, where it is defined.

Split module dynetat0_m into dynetat0_m and dynetat0_chosen_m. The
motivation is to create smaller modules. Procedures principal_cshift
and invert_zoomx had to stay in dynetat0_m because of circular
dependency. Now we will be able to move them away. Module variables
which are chosen by the user, not computed, in program ce0l go to
dynetat0_chosen_m: day_ref, annee_ref, clon, clat, grossismx,
grossismy, dzoomx, dzoomy, taux, tauy.

Move variable "pa" from module disvert_m to module
dynetat0_chosen_m. Define "pa" in dynetat0_chosen rather than etat0.

Define day_ref and annee_ref in procedure read_serre rather than
etat0.

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)
10
11 USE comgeom, ONLY: cu_2d, cv_2d
12 use coordij_m, only: coordij
13 USE dimensions, ONLY: jjm
14 USE dynetat0_m, ONLY: rlatu
15 USE dynetat0_chosen_m, ONLY: clat, clon, grossismx, grossismy
16 USE paramet_m, ONLY: iip1, jjp1
17 use writefield_m, only: writefield
18
19 REAL, intent(out):: dxdys(iip1, jjp1)
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 ! coordonnees du centre du zoom
55 CALL coordij(clon, clat, ilon, ilat)
56 ! aire de la maille au centre du zoom
57 dxdy_min = dxdys(ilon, ilat)
58 print *, "dxdy_min = ", dxdy_min
59
60 ! dxdy maximal de la maille :
61 dxdy_max = maxval(dxdys)
62 print *, "dxdy_max = ", dxdy_max
63
64 IF (abs(grossismx - 1.) < 0.1 .OR. abs(grossismy - 1.) < 0.1) THEN
65 PRINT *, 'Attention : modèle peu zoomé.'
66 PRINT *, 'On prend une constante de guidage constante.'
67 ELSE
68 gamma = (dxdy_max - 2. * dxdy_min) / (dxdy_max - dxdy_min)
69 IF (gamma < 1E-5) THEN
70 PRINT *, '(dxdy_max - 2. * dxdy_min) / (dxdy_max - dxdy_min) ' &
71 // '< 1e-5'
72 STOP 1
73 END IF
74 gamma = log(0.5) / log(gamma)
75 PRINT *, 'gamma=', gamma
76 END IF
77
78 END SUBROUTINE init_tau2alpha
79
80 end module init_tau2alpha_m

  ViewVC Help
Powered by ViewVC 1.1.21