1 | ! |
---|
2 | ! $Id: initphysto.f90 5268 2024-10-23 17:02:39Z evignon $ |
---|
3 | ! |
---|
4 | SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid) |
---|
5 | |
---|
6 | USE dimphy |
---|
7 | USE mod_phys_lmdz_para |
---|
8 | USE IOIPSL |
---|
9 | USE iophy |
---|
10 | USE indice_sol_mod |
---|
11 | USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev |
---|
12 | USE time_phylmdz_mod, ONLY: day_ref, annee_ref |
---|
13 | |
---|
14 | IMPLICIT NONE |
---|
15 | |
---|
16 | ! |
---|
17 | ! Routine d'initialisation des ecritures des fichiers histoires LMDZ |
---|
18 | ! au format IOIPSL |
---|
19 | ! |
---|
20 | ! Appels succesifs des routines: histbeg |
---|
21 | ! histhori |
---|
22 | ! histver |
---|
23 | ! histdef |
---|
24 | ! histend |
---|
25 | ! |
---|
26 | ! Entree: |
---|
27 | ! |
---|
28 | ! infile: nom du fichier histoire a creer |
---|
29 | ! day0,anne0: date de reference |
---|
30 | ! tstep: duree du pas de temps en seconde |
---|
31 | ! t_ops: frequence de l'operation pour IOIPSL |
---|
32 | ! t_wrt: frequence d'ecriture sur le fichier |
---|
33 | ! |
---|
34 | ! Sortie: |
---|
35 | ! fileid: ID du fichier netcdf cree |
---|
36 | ! |
---|
37 | ! L. Fairhead, LMD, 03/99 |
---|
38 | ! |
---|
39 | ! ===================================================================== |
---|
40 | |
---|
41 | ! Arguments |
---|
42 | CHARACTER(len=*), INTENT(IN) :: infile |
---|
43 | REAL, INTENT(IN) :: tstep |
---|
44 | REAL, INTENT(IN) :: t_ops |
---|
45 | REAL, INTENT(IN) :: t_wrt |
---|
46 | INTEGER, INTENT(OUT) :: fileid |
---|
47 | |
---|
48 | ! Variables locales |
---|
49 | INTEGER nhoriid, i |
---|
50 | INTEGER l,k |
---|
51 | REAL nivsigs(nbp_lev) |
---|
52 | INTEGER tau0 |
---|
53 | REAL zjulian |
---|
54 | INTEGER iq |
---|
55 | INTEGER uhoriid, vhoriid, thoriid, zvertiid |
---|
56 | INTEGER ii,jj |
---|
57 | INTEGER zan, idayref |
---|
58 | LOGICAL ok_sync |
---|
59 | REAL zx_lon(nbp_lon,nbp_lat), zx_lat(nbp_lon,nbp_lat) |
---|
60 | CHARACTER(len=12) :: nvar |
---|
61 | |
---|
62 | ! Initialisations |
---|
63 | ! |
---|
64 | ok_sync= .TRUE. |
---|
65 | ! |
---|
66 | ! Appel a histbeg: creation du fichier netcdf et initialisations diverses |
---|
67 | ! |
---|
68 | |
---|
69 | zan = annee_ref |
---|
70 | idayref = day_ref |
---|
71 | CALL ymds2ju(zan, 1, idayref, 0.0, zjulian) |
---|
72 | tau0 = 0 |
---|
73 | |
---|
74 | CALL histbeg_phy(infile,tau0, zjulian, tstep, & |
---|
75 | nhoriid, fileid) |
---|
76 | |
---|
77 | !$OMP MASTER |
---|
78 | ! Appel a histvert pour la grille verticale |
---|
79 | ! |
---|
80 | DO l=1,nbp_lev |
---|
81 | nivsigs(l)=REAL(l) |
---|
82 | ENDDO |
---|
83 | |
---|
84 | CALL histvert(fileid, 'sig_s', 'Niveaux sigma', & |
---|
85 | 'sigma_level', & |
---|
86 | nbp_lev, nivsigs, zvertiid) |
---|
87 | ! |
---|
88 | ! Appels a histdef pour la definition des variables a sauvegarder |
---|
89 | ! |
---|
90 | CALL histdef(fileid, "phis", "Surface geop. height", "-", & |
---|
91 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
92 | "once", t_ops, t_wrt) |
---|
93 | |
---|
94 | CALL histdef(fileid, "aire", "Grid area", "-", & |
---|
95 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
96 | "once", t_ops, t_wrt) |
---|
97 | |
---|
98 | CALL histdef(fileid, "longitudes", "longitudes", "-", & |
---|
99 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
100 | "once", t_ops, t_wrt) |
---|
101 | |
---|
102 | CALL histdef(fileid, "latitudes", "latitudes", "-", & |
---|
103 | nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, & |
---|
104 | "once", t_ops, t_wrt) |
---|
105 | ! T |
---|
106 | CALL histdef(fileid, 't', 'Temperature', 'K', nbp_lon, jj_nb, nhoriid, & |
---|
107 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
108 | ! mfu |
---|
109 | CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
110 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
111 | ! mfd |
---|
112 | CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
113 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
114 | ! en_u |
---|
115 | CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
116 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
117 | ! de_u |
---|
118 | CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, & |
---|
119 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
120 | ! en_d |
---|
121 | CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
122 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
123 | ! de_d |
---|
124 | CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, & |
---|
125 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
126 | ! coefh |
---|
127 | CALL histdef(fileid, "coefh", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
128 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
129 | ! fm_th |
---|
130 | CALL histdef(fileid, "fm_th", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
131 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
132 | ! en_th |
---|
133 | CALL histdef(fileid, "en_th", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
134 | nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt) |
---|
135 | ! frac_impa |
---|
136 | CALL histdef(fileid, 'frac_impa', ' ', ' ',nbp_lon, jj_nb, nhoriid, & |
---|
137 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
138 | ! frac_nucl |
---|
139 | CALL histdef(fileid, 'frac_nucl', ' ', ' ',nbp_lon, jj_nb, nhoriid, & |
---|
140 | nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt) |
---|
141 | ! pyu1 |
---|
142 | CALL histdef(fileid, "pyu1", " ", " ", nbp_lon,jj_nb,nhoriid, & |
---|
143 | 1,1,1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
144 | ! pyv1 |
---|
145 | CALL histdef(fileid, "pyv1", " ", " ", nbp_lon,jj_nb,nhoriid, & |
---|
146 | 1,1,1, -99, 32,"inst(X)", t_ops, t_wrt) |
---|
147 | ! ftsol1 |
---|
148 | CALL histdef(fileid, "ftsol1", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
149 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
150 | ! ftsol2 |
---|
151 | CALL histdef(fileid, "ftsol2", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
152 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
153 | ! ftsol3 |
---|
154 | CALL histdef(fileid, "ftsol3", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
155 | 1, 1,1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
156 | ! ftsol4 |
---|
157 | CALL histdef(fileid, "ftsol4", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
158 | 1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
159 | ! psrf1 |
---|
160 | CALL histdef(fileid, "psrf1", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
161 | 1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
162 | ! psrf2 |
---|
163 | CALL histdef(fileid, "psrf2", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
164 | 1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
165 | ! psrf3 |
---|
166 | CALL histdef(fileid, "psrf3", " ", " ",nbp_lon, jj_nb, nhoriid, & |
---|
167 | 1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt) |
---|
168 | ! psrf4 |
---|
169 | CALL histdef(fileid, "psrf4", " ", " ", nbp_lon, jj_nb, nhoriid, & |
---|
170 | 1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt) |
---|
171 | ! sh |
---|
172 | CALL histdef(fileid, 'sh', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
173 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
174 | ! da |
---|
175 | CALL histdef(fileid, 'da', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
176 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
177 | ! mp |
---|
178 | CALL histdef(fileid, 'mp', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
179 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
180 | ! upwd |
---|
181 | CALL histdef(fileid, 'upwd', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
182 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
183 | ! dnwd |
---|
184 | CALL histdef(fileid, 'dnwd', '', '', nbp_lon, jj_nb, nhoriid, & |
---|
185 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
186 | |
---|
187 | ! phi |
---|
188 | DO k=1,nbp_lev |
---|
189 | IF (k<10) THEN |
---|
190 | WRITE(nvar,'(i1)') k |
---|
191 | ELSE IF (k<100) THEN |
---|
192 | WRITE(nvar,'(i2)') k |
---|
193 | ELSE |
---|
194 | WRITE(nvar,'(i3)') k |
---|
195 | END IF |
---|
196 | nvar='phi_lev'//trim(nvar) |
---|
197 | |
---|
198 | CALL histdef(fileid, nvar, '', '', nbp_lon, jj_nb, nhoriid, & |
---|
199 | nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt) |
---|
200 | END DO |
---|
201 | |
---|
202 | CALL histend(fileid) |
---|
203 | IF (ok_sync) CALL histsync |
---|
204 | !$OMP END MASTER |
---|
205 | |
---|
206 | END SUBROUTINE initphysto |
---|