/[lmdze]/trunk/Sources/dyn3d/init_dynzon.f
ViewVC logotype

Contents of /trunk/Sources/dyn3d/init_dynzon.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: 3984 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_dynzon_m
2
3 IMPLICIT NONE
4
5 integer, parameter:: ntr = 5
6 integer, parameter:: nQ = 7
7 integer ncum, fileid
8 character(len=10) znom(ntr, nQ)
9 character(len=4), parameter:: nom(nQ) = (/'T ', 'gz ', 'K ', 'ang ', &
10 'u ', 'ovap', 'un '/)
11
12 contains
13
14 SUBROUTINE init_dynzon(dt_app)
15
16 ! From LMDZ4/libf/dyn3d/bilan_dyn.F, version 1.5 2005/03/16 10:12:17
17
18 USE conf_gcm_m, ONLY: day_step, iperiod, periodav
19 USE dimens_m, ONLY: jjm, llm
20 USE disvert_m, ONLY: presnivs
21 use dynetat0_m, only: day_ref, annee_ref, rlatv
22 USE histbeg_totreg_m, ONLY: histbeg_totreg
23 USE histdef_m, ONLY: histdef
24 USE histend_m, ONLY: histend
25 USE histvert_m, ONLY: histvert
26 USE nr_util, ONLY: pi
27 USE temps, ONLY: itau_dyn
28 USE ymds2ju_m, ONLY: ymds2ju
29
30 real, intent(in):: dt_app
31
32 ! Local:
33
34 real dt_cum
35 character(len=5), parameter:: unites(nQ) = (/'K ', 'm2/s2', 'm2/s2', &
36 'ang ', 'm/s ', 'kg/kg', 'un '/)
37
38 ! Champs de tansport en moyenne zonale
39 integer itr
40 character(len=26) noml(ntr, nQ)
41 character(len=12) zunites(ntr, nQ)
42 character(len=3), parameter:: ctrs(ntr) = (/' ', 'TOT', 'MMC', 'TRS', &
43 'STN'/)
44 integer iQ
45
46 ! Initialisation du fichier contenant les moyennes zonales.
47
48 integer horiid, vertiid
49 real julian
50 real rlong(jjm), rlatg(jjm)
51
52 !-----------------------------------------------------------------
53
54 print *, "Call sequence information: init_dynzon"
55
56 ! Initialisation des fichiers
57 ! ncum est la frequence de stokage en pas de temps
58 ncum = day_step / iperiod * periodav
59 dt_cum = ncum * dt_app
60
61 ! Initialisation du fichier contenant les moyennes zonales
62
63 CALL ymds2ju(annee_ref, 1, day_ref, 0.0, julian)
64
65 rlong = 0.
66 rlatg = rlatv * 180. / pi
67
68 call histbeg_totreg('dynzon', rlong(:1), rlatg, 1, 1, 1, jjm, itau_dyn, &
69 julian, dt_cum, horiid, fileid)
70
71 ! Appel \`a histvert pour la grille verticale
72
73 call histvert(fileid, 'presnivs', 'Niveaux sigma', 'mb', presnivs, vertiid)
74
75 ! Appels \`a histdef pour la d\'efinition des variables \`a sauvegarder
76 do iQ = 1, nQ
77 do itr = 1, ntr
78 if (itr == 1) then
79 znom(itr, iQ) = nom(iQ)
80 noml(itr, iQ) = nom(iQ)
81 zunites(itr, iQ) = unites(iQ)
82 else
83 znom(itr, iQ) = ctrs(itr) // 'v' // nom(iQ)
84 noml(itr, iQ) = 'transport: v * ' // nom(iQ) // ' ' // ctrs(itr)
85 zunites(itr, iQ) = 'm/s * ' // unites(iQ)
86 endif
87 enddo
88 enddo
89
90 ! D\'eclarations des champs avec dimension verticale
91 do iQ = 1, nQ
92 do itr = 1, ntr
93 call histdef(fileid, znom(itr, iQ), noml(itr, iQ), &
94 zunites(itr, iQ), 1, jjm, horiid, llm, 1, llm, vertiid, &
95 'ave(X)', dt_cum, dt_cum)
96 enddo
97 ! D\'eclarations pour les fonctions de courant
98 call histdef(fileid, 'psi' // nom(iQ), 'stream fn. ' // noml(2, iQ), &
99 zunites(2, iQ), 1, jjm, horiid, llm, 1, llm, vertiid, &
100 'ave(X)', dt_cum, dt_cum)
101 enddo
102
103 ! D\'eclarations pour les champs de transport d'air
104 call histdef(fileid, 'masse', 'masse', 'kg', 1, jjm, horiid, llm, 1, &
105 llm, vertiid, 'ave(X)', dt_cum, dt_cum)
106 call histdef(fileid, 'v', 'v', 'm/s', 1, jjm, horiid, llm, 1, llm, &
107 vertiid, 'ave(X)', dt_cum, dt_cum)
108 ! D\'eclarations pour les fonctions de courant
109 call histdef(fileid, 'psi', 'stream fn. MMC ', 'mega t/s', 1, jjm, &
110 horiid, llm, 1, llm, vertiid, 'ave(X)', dt_cum, dt_cum)
111
112 ! D\'eclaration des champs 1D de transport en latitude
113 do iQ = 1, nQ
114 do itr = 2, ntr
115 call histdef(fileid, 'a' // znom(itr, iQ), noml(itr, iQ), &
116 zunites(itr, iQ), 1, jjm, horiid, 1, 1, 1, -99, 'ave(X)', &
117 dt_cum, dt_cum)
118 enddo
119 enddo
120
121 CALL histend(fileid)
122
123 end SUBROUTINE init_dynzon
124
125 end module init_dynzon_m

  ViewVC Help
Powered by ViewVC 1.1.21