1 |
SUBROUTINE dynredem0(fichnom, iday_end, phis) |
MODULE dynredem0_m |
2 |
|
|
3 |
! From dyn3d/dynredem.F, v 1.2 2004/06/22 11:45:30 |
IMPLICIT NONE |
4 |
|
|
5 |
! Ecriture du fichier de redémarrage au format NetCDF (initialisation) |
CONTAINS |
6 |
|
|
7 |
USE IOIPSL, only: ymds2ju, ju2ymds |
SUBROUTINE dynredem0(fichnom, iday_end, phis) |
|
use dimens_m, only: iim, jjm, llm, nqmx |
|
|
use paramet_m, only: ip1jmp1, iip1, jjp1, llmp1 |
|
|
use comconst, only: rad, cpp, daysec, dtvr, kappa, g, omeg |
|
|
use comvert, only: pa, bp, ap, nivsigs, preff, presnivs, nivsig |
|
|
use logic |
|
|
use comgeom |
|
|
use serre |
|
|
use temps, only: annee_ref, day_ref, itaufin, itau_dyn |
|
|
use ener |
|
|
use advtrac_m, only: tname, ttext |
|
|
use netcdf95, only: nf95_create, NF90_CLOBBER, nf95_put_att, NF90_GLOBAL, & |
|
|
nf95_def_dim, NF90_UNLIMITED |
|
8 |
|
|
9 |
IMPLICIT NONE |
! From dyn3d/dynredem.F, v 1.2 2004/06/22 11:45:30 |
10 |
|
! Ecriture du fichier de redémarrage au format NetCDF (initialisation) |
11 |
|
|
12 |
|
USE ioipsl, ONLY : ju2ymds, ymds2ju |
13 |
|
USE dimens_m, ONLY : iim, jjm, llm, nqmx |
14 |
|
USE paramet_m, ONLY : iip1, jjp1, llmp1 |
15 |
|
USE comconst, ONLY : cpp, daysec, dtvr, g, kappa, omeg, rad |
16 |
|
USE comvert, ONLY : ap, bp, nivsig, nivsigs, pa, preff, presnivs |
17 |
|
USE logic, ONLY : fxyhypb, ysinus |
18 |
|
USE comgeom, ONLY : aire_2d, cu_2d, cv_2d, rlatu, rlatv, rlonu, rlonv |
19 |
|
USE serre, ONLY : clat, clon, dzoomx, dzoomy, grossismx, grossismy, & |
20 |
|
taux, tauy |
21 |
|
USE temps, ONLY : annee_ref, day_ref, itaufin, itau_dyn |
22 |
|
USE ener, ONLY : ang0, etot0, ptot0, stot0, ztot0 |
23 |
|
USE iniadvtrac_m, ONLY : tname, ttext |
24 |
|
USE netcdf95, ONLY : nf95_close, nf95_create, nf95_def_dim, & |
25 |
|
nf95_def_var, nf95_enddef, nf95_inq_varid, nf95_put_att, & |
26 |
|
nf95_put_var |
27 |
|
USE netcdf, ONLY : nf90_clobber, nf90_float, nf90_global, & |
28 |
|
nf90_unlimited |
29 |
|
|
30 |
|
CHARACTER (len=*), INTENT (IN) :: fichnom |
31 |
|
INTEGER, INTENT (IN) :: iday_end |
32 |
|
REAL, INTENT (IN) :: phis(:, :) |
33 |
|
|
34 |
|
! Local: |
35 |
|
|
36 |
|
INTEGER :: iq, l |
37 |
|
INTEGER, PARAMETER:: length = 100 |
38 |
|
REAL :: tab_cntrl(length) ! tableau des parametres du run |
39 |
|
|
40 |
|
! Variables locales pour NetCDF: |
41 |
|
|
42 |
|
INTEGER :: dims2(2), dims3(3), dims4(4) |
43 |
|
INTEGER :: idim_index |
44 |
|
INTEGER :: idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv |
45 |
|
INTEGER :: idim_s, idim_sig |
46 |
|
INTEGER :: idim_tim |
47 |
|
INTEGER :: nid, nvarid |
48 |
|
|
49 |
|
REAL :: zjulian, hours |
50 |
|
INTEGER :: yyears0, jjour0, mmois0 |
51 |
|
CHARACTER (len=30) :: unites |
52 |
|
|
53 |
|
!----------------------------------------------------------------------- |
54 |
|
|
55 |
|
PRINT *, 'Call sequence information: dynredem0' |
56 |
|
|
57 |
|
CALL ymds2ju(annee_ref, 1, iday_end, 0.0, zjulian) |
58 |
|
CALL ju2ymds(zjulian, yyears0, mmois0, jjour0, hours) |
59 |
|
|
60 |
|
DO l = 1, length |
61 |
|
tab_cntrl(l) = 0. |
62 |
|
END DO |
63 |
|
tab_cntrl(1) = real(iim) |
64 |
|
tab_cntrl(2) = real(jjm) |
65 |
|
tab_cntrl(3) = real(llm) |
66 |
|
tab_cntrl(4) = real(day_ref) |
67 |
|
tab_cntrl(5) = real(annee_ref) |
68 |
|
tab_cntrl(6) = rad |
69 |
|
tab_cntrl(7) = omeg |
70 |
|
tab_cntrl(8) = g |
71 |
|
tab_cntrl(9) = cpp |
72 |
|
tab_cntrl(10) = kappa |
73 |
|
tab_cntrl(11) = daysec |
74 |
|
tab_cntrl(12) = dtvr |
75 |
|
tab_cntrl(13) = etot0 |
76 |
|
tab_cntrl(14) = ptot0 |
77 |
|
tab_cntrl(15) = ztot0 |
78 |
|
tab_cntrl(16) = stot0 |
79 |
|
tab_cntrl(17) = ang0 |
80 |
|
tab_cntrl(18) = pa |
81 |
|
tab_cntrl(19) = preff |
82 |
|
|
83 |
|
! Paramètres pour le zoom : |
84 |
|
|
85 |
|
tab_cntrl(20) = clon |
86 |
|
tab_cntrl(21) = clat |
87 |
|
tab_cntrl(22) = grossismx |
88 |
|
tab_cntrl(23) = grossismy |
89 |
|
|
90 |
|
IF (fxyhypb) THEN |
91 |
|
tab_cntrl(24) = 1. |
92 |
|
tab_cntrl(25) = dzoomx |
93 |
|
tab_cntrl(26) = dzoomy |
94 |
|
tab_cntrl(27) = 0. |
95 |
|
tab_cntrl(28) = taux |
96 |
|
tab_cntrl(29) = tauy |
97 |
|
ELSE |
98 |
|
tab_cntrl(24) = 0. |
99 |
|
tab_cntrl(25) = dzoomx |
100 |
|
tab_cntrl(26) = dzoomy |
101 |
|
tab_cntrl(27) = 0. |
102 |
|
tab_cntrl(28) = 0. |
103 |
|
tab_cntrl(29) = 0. |
104 |
|
IF (ysinus) tab_cntrl(27) = 1. |
105 |
|
END IF |
106 |
|
|
107 |
|
tab_cntrl(30) = real(iday_end) |
108 |
|
tab_cntrl(31) = real(itau_dyn+itaufin) |
109 |
|
|
110 |
|
CALL nf95_create(fichnom, nf90_clobber, nid) |
111 |
|
CALL nf95_put_att(nid, nf90_global, 'title', & |
112 |
|
'Fichier de démarrage dynamique') |
113 |
|
|
114 |
|
! Definir les dimensions du fichiers: |
115 |
|
|
116 |
|
CALL nf95_def_dim(nid, 'index', length, idim_index) |
117 |
|
CALL nf95_def_dim(nid, 'rlonu', iip1, idim_rlonu) |
118 |
|
CALL nf95_def_dim(nid, 'rlatu', jjp1, idim_rlatu) |
119 |
|
CALL nf95_def_dim(nid, 'rlonv', iip1, idim_rlonv) |
120 |
|
CALL nf95_def_dim(nid, 'rlatv', jjm, idim_rlatv) |
121 |
|
CALL nf95_def_dim(nid, 'sigs', llm, idim_s) |
122 |
|
CALL nf95_def_dim(nid, 'sig', llmp1, idim_sig) |
123 |
|
CALL nf95_def_dim(nid, 'temps', nf90_unlimited, idim_tim) |
124 |
|
|
125 |
|
! Definir et enregistrer certains champs invariants: |
126 |
|
|
127 |
|
CALL nf95_def_var(nid, 'controle', nf90_float, idim_index, nvarid) |
128 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Parametres de controle') |
129 |
|
|
130 |
|
CALL nf95_def_var(nid, 'rlonu', nf90_float, idim_rlonu, nvarid) |
131 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Longitudes des points U') |
132 |
|
|
133 |
|
CALL nf95_def_var(nid, 'rlatu', nf90_float, idim_rlatu, nvarid) |
134 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Latitudes des points U') |
135 |
|
|
136 |
|
CALL nf95_def_var(nid, 'rlonv', nf90_float, idim_rlonv, nvarid) |
137 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Longitudes des points V') |
138 |
|
|
139 |
|
CALL nf95_def_var(nid, 'rlatv', nf90_float, idim_rlatv, nvarid) |
140 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Latitudes des points V') |
141 |
|
|
142 |
|
CALL nf95_def_var(nid, 'nivsigs', nf90_float, idim_s, nvarid) |
143 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Numero naturel des couches s') |
144 |
|
|
145 |
|
CALL nf95_def_var(nid, 'nivsig', nf90_float, idim_sig, nvarid) |
146 |
|
CALL nf95_put_att(nid, nvarid, 'title', & |
147 |
|
'Numero naturel des couches sigma') |
148 |
|
|
149 |
|
CALL nf95_def_var(nid, 'ap', nf90_float, idim_sig, nvarid) |
150 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Coefficient A pour hybride') |
151 |
|
|
152 |
|
CALL nf95_def_var(nid, 'bp', nf90_float, idim_sig, nvarid) |
153 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Coefficient B pour hybride') |
154 |
|
|
155 |
|
CALL nf95_def_var(nid, 'presnivs', nf90_float, idim_s, nvarid) |
156 |
|
|
157 |
|
! Coefficients de passage cov. <-> contra. <--> naturel |
158 |
|
|
159 |
|
dims2(1) = idim_rlonu |
160 |
|
dims2(2) = idim_rlatu |
161 |
|
CALL nf95_def_var(nid, 'cu', nf90_float, dims2, nvarid) |
162 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Coefficient de passage pour U') |
163 |
|
|
164 |
|
dims2(1) = idim_rlonv |
165 |
|
dims2(2) = idim_rlatv |
166 |
|
CALL nf95_def_var(nid, 'cv', nf90_float, dims2, nvarid) |
167 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Coefficient de passage pour V') |
168 |
|
|
169 |
|
! Aire de chaque maille: |
170 |
|
|
171 |
|
dims2(1) = idim_rlonv |
172 |
|
dims2(2) = idim_rlatu |
173 |
|
CALL nf95_def_var(nid, 'aire', nf90_float, dims2, nvarid) |
174 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Aires de chaque maille') |
175 |
|
|
176 |
|
! Geopentiel au sol: |
177 |
|
|
178 |
|
dims2(1) = idim_rlonv |
179 |
|
dims2(2) = idim_rlatu |
180 |
|
CALL nf95_def_var(nid, 'phisinit', nf90_float, dims2, nvarid) |
181 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Geopotentiel au sol') |
182 |
|
|
183 |
|
! Definir les variables pour pouvoir les enregistrer plus tard: |
184 |
|
|
185 |
|
CALL nf95_def_var(nid, 'temps', nf90_float, idim_tim, nvarid) |
186 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Temps de simulation') |
187 |
|
WRITE (unites, 200) yyears0, mmois0, jjour0 |
188 |
|
200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00') |
189 |
|
CALL nf95_put_att(nid, nvarid, 'units', unites) |
190 |
|
|
191 |
|
|
192 |
|
dims4(1) = idim_rlonu |
193 |
|
dims4(2) = idim_rlatu |
194 |
|
dims4(3) = idim_s |
195 |
|
dims4(4) = idim_tim |
196 |
|
CALL nf95_def_var(nid, 'ucov', nf90_float, dims4, nvarid) |
197 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Vitesse U') |
198 |
|
|
199 |
|
dims4(1) = idim_rlonv |
200 |
|
dims4(2) = idim_rlatv |
201 |
|
dims4(3) = idim_s |
202 |
|
dims4(4) = idim_tim |
203 |
|
CALL nf95_def_var(nid, 'vcov', nf90_float, dims4, nvarid) |
204 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Vitesse V') |
205 |
|
|
206 |
|
dims4(1) = idim_rlonv |
207 |
|
dims4(2) = idim_rlatu |
208 |
|
dims4(3) = idim_s |
209 |
|
dims4(4) = idim_tim |
210 |
|
CALL nf95_def_var(nid, 'teta', nf90_float, dims4, nvarid) |
211 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Temperature') |
212 |
|
|
213 |
|
dims4(1) = idim_rlonv |
214 |
|
dims4(2) = idim_rlatu |
215 |
|
dims4(3) = idim_s |
216 |
|
dims4(4) = idim_tim |
217 |
|
DO iq = 1, nqmx |
218 |
|
CALL nf95_def_var(nid, tname(iq), nf90_float, dims4, nvarid) |
219 |
|
CALL nf95_put_att(nid, nvarid, 'title', ttext(iq)) |
220 |
|
END DO |
221 |
|
|
222 |
|
dims4(1) = idim_rlonv |
223 |
|
dims4(2) = idim_rlatu |
224 |
|
dims4(3) = idim_s |
225 |
|
dims4(4) = idim_tim |
226 |
|
CALL nf95_def_var(nid, 'masse', nf90_float, dims4, nvarid) |
227 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'C est quoi ?') |
228 |
|
|
229 |
|
dims3(1) = idim_rlonv |
230 |
|
dims3(2) = idim_rlatu |
231 |
|
dims3(3) = idim_tim |
232 |
|
CALL nf95_def_var(nid, 'ps', nf90_float, dims3, nvarid) |
233 |
|
CALL nf95_put_att(nid, nvarid, 'title', 'Pression au sol') |
234 |
|
|
235 |
|
CALL nf95_enddef(nid) |
236 |
|
|
237 |
|
CALL nf95_inq_varid(nid, 'controle', nvarid) |
238 |
|
CALL nf95_put_var(nid, nvarid, tab_cntrl) |
239 |
|
|
240 |
|
CALL nf95_inq_varid(nid, 'rlonu', nvarid) |
241 |
|
CALL nf95_put_var(nid, nvarid, rlonu) |
242 |
|
|
243 |
|
CALL nf95_inq_varid(nid, 'rlatu', nvarid) |
244 |
|
CALL nf95_put_var(nid, nvarid, rlatu) |
245 |
|
|
246 |
|
CALL nf95_inq_varid(nid, 'rlonv', nvarid) |
247 |
|
CALL nf95_put_var(nid, nvarid, rlonv) |
248 |
|
|
249 |
|
CALL nf95_inq_varid(nid, 'rlatv', nvarid) |
250 |
|
CALL nf95_put_var(nid, nvarid, rlatv) |
251 |
|
|
252 |
|
CALL nf95_inq_varid(nid, 'nivsigs', nvarid) |
253 |
|
CALL nf95_put_var(nid, nvarid, nivsigs) |
254 |
|
|
255 |
|
CALL nf95_inq_varid(nid, 'nivsig', nvarid) |
256 |
|
CALL nf95_put_var(nid, nvarid, nivsig) |
257 |
|
|
258 |
|
CALL nf95_inq_varid(nid, 'ap', nvarid) |
259 |
|
CALL nf95_put_var(nid, nvarid, ap) |
260 |
|
|
261 |
|
CALL nf95_inq_varid(nid, 'bp', nvarid) |
262 |
|
CALL nf95_put_var(nid, nvarid, bp) |
263 |
|
|
264 |
|
CALL nf95_inq_varid(nid, 'presnivs', nvarid) |
265 |
|
CALL nf95_put_var(nid, nvarid, presnivs) |
266 |
|
|
267 |
|
CALL nf95_inq_varid(nid, 'cu', nvarid) |
268 |
|
CALL nf95_put_var(nid, nvarid, cu_2d) |
269 |
|
|
270 |
|
CALL nf95_inq_varid(nid, 'cv', nvarid) |
271 |
|
CALL nf95_put_var(nid, nvarid, cv_2d) |
272 |
|
|
273 |
|
CALL nf95_inq_varid(nid, 'aire', nvarid) |
274 |
|
CALL nf95_put_var(nid, nvarid, aire_2d) |
275 |
|
|
276 |
|
CALL nf95_inq_varid(nid, 'phisinit', nvarid) |
277 |
|
CALL nf95_put_var(nid, nvarid, phis) |
278 |
|
|
279 |
CHARACTER(len=*), intent(in):: fichnom |
CALL nf95_close(nid) ! fermer le fichier |
|
INTEGER, intent(in):: iday_end |
|
|
REAL, intent(in):: phis(ip1jmp1) |
|
|
|
|
|
! Local: |
|
|
|
|
|
include "netcdf.inc" |
|
|
|
|
|
INTEGER iq, l |
|
|
INTEGER length |
|
|
PARAMETER (length = 100) |
|
|
REAL tab_cntrl(length) ! tableau des parametres du run |
|
|
INTEGER ierr |
|
|
|
|
|
! Variables locales pour NetCDF: |
|
|
|
|
|
INTEGER dims2(2), dims3(3), dims4(4) |
|
|
INTEGER idim_index |
|
|
INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv |
|
|
INTEGER idim_s, idim_sig |
|
|
INTEGER idim_tim |
|
|
INTEGER nid, nvarid |
|
|
|
|
|
REAL zjulian, hours |
|
|
INTEGER yyears0, jjour0, mmois0 |
|
|
character(len=30) unites |
|
|
|
|
|
!----------------------------------------------------------------------- |
|
|
|
|
|
print *, "Call sequence information: dynredem0" |
|
|
|
|
|
call ymds2ju(annee_ref, 1, iday_end, 0.0, zjulian) |
|
|
call ju2ymds(zjulian, yyears0, mmois0, jjour0, hours) |
|
|
|
|
|
DO l=1, length |
|
|
tab_cntrl(l) = 0. |
|
|
ENDDO |
|
|
tab_cntrl(1) = REAL(iim) |
|
|
tab_cntrl(2) = REAL(jjm) |
|
|
tab_cntrl(3) = REAL(llm) |
|
|
tab_cntrl(4) = REAL(day_ref) |
|
|
tab_cntrl(5) = REAL(annee_ref) |
|
|
tab_cntrl(6) = rad |
|
|
tab_cntrl(7) = omeg |
|
|
tab_cntrl(8) = g |
|
|
tab_cntrl(9) = cpp |
|
|
tab_cntrl(10) = kappa |
|
|
tab_cntrl(11) = daysec |
|
|
tab_cntrl(12) = dtvr |
|
|
tab_cntrl(13) = etot0 |
|
|
tab_cntrl(14) = ptot0 |
|
|
tab_cntrl(15) = ztot0 |
|
|
tab_cntrl(16) = stot0 |
|
|
tab_cntrl(17) = ang0 |
|
|
tab_cntrl(18) = pa |
|
|
tab_cntrl(19) = preff |
|
|
|
|
|
! Paramètres pour le zoom : |
|
|
|
|
|
tab_cntrl(20) = clon |
|
|
tab_cntrl(21) = clat |
|
|
tab_cntrl(22) = grossismx |
|
|
tab_cntrl(23) = grossismy |
|
|
|
|
|
IF ( fxyhypb ) THEN |
|
|
tab_cntrl(24) = 1. |
|
|
tab_cntrl(25) = dzoomx |
|
|
tab_cntrl(26) = dzoomy |
|
|
tab_cntrl(27) = 0. |
|
|
tab_cntrl(28) = taux |
|
|
tab_cntrl(29) = tauy |
|
|
ELSE |
|
|
tab_cntrl(24) = 0. |
|
|
tab_cntrl(25) = dzoomx |
|
|
tab_cntrl(26) = dzoomy |
|
|
tab_cntrl(27) = 0. |
|
|
tab_cntrl(28) = 0. |
|
|
tab_cntrl(29) = 0. |
|
|
IF( ysinus ) tab_cntrl(27) = 1. |
|
|
ENDIF |
|
|
|
|
|
tab_cntrl(30) = REAL(iday_end) |
|
|
tab_cntrl(31) = REAL(itau_dyn + itaufin) |
|
|
|
|
|
call nf95_create(fichnom, NF90_CLOBBER, nid) |
|
|
call nf95_put_att(nid, NF90_GLOBAL, "title", & |
|
|
"Fichier de démarrage dynamique") |
|
|
|
|
|
! Definir les dimensions du fichiers: |
|
|
|
|
|
call nf95_def_dim(nid, "index", length, idim_index) |
|
|
call NF95_DEF_DIM(nid, "rlonu", iip1, idim_rlonu) |
|
|
call NF95_DEF_DIM(nid, "rlatu", jjp1, idim_rlatu) |
|
|
call NF95_DEF_DIM(nid, "rlonv", iip1, idim_rlonv) |
|
|
call NF95_DEF_DIM(nid, "rlatv", jjm, idim_rlatv) |
|
|
call NF95_DEF_DIM(nid, "sigs", llm, idim_s) |
|
|
call NF95_DEF_DIM(nid, "sig", llmp1, idim_sig) |
|
|
call NF95_DEF_DIM(nid, "temps", NF90_UNLIMITED, idim_tim) |
|
|
|
|
|
ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
|
|
|
|
|
! Definir et enregistrer certains champs invariants: |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "controle", NF_FLOAT, 1, idim_index, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Parametres de controle") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, tab_cntrl) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "rlonu", NF_FLOAT, 1, idim_rlonu, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Longitudes des points U") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, rlonu) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "rlatu", NF_FLOAT, 1, idim_rlatu, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Latitudes des points U") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, rlatu) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "rlonv", NF_FLOAT, 1, idim_rlonv, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Longitudes des points V") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, rlonv) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "rlatv", NF_FLOAT, 1, idim_rlatv, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Latitudes des points V") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, rlatv) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "nivsigs", NF_FLOAT, 1, idim_s, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Numero naturel des couches s") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, nivsigs) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "nivsig", NF_FLOAT, 1, idim_sig, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Numero naturel des couches sigma") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, nivsig) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "ap", NF_FLOAT, 1, idim_sig, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Coefficient A pour hybride") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, ap) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "bp", NF_FLOAT, 1, idim_sig, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Coefficient B pour hybride") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, bp) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
ierr = NF_DEF_VAR (nid, "presnivs", NF_FLOAT, 1, idim_s, nvarid) |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, presnivs) |
|
|
|
|
|
! Coefficients de passage cov. <-> contra. <--> naturel |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
dims2(1) = idim_rlonu |
|
|
dims2(2) = idim_rlatu |
|
|
ierr = NF_DEF_VAR (nid, "cu", NF_FLOAT, 2, dims2, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Coefficient de passage pour U") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, cu) |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
dims2(1) = idim_rlonv |
|
|
dims2(2) = idim_rlatv |
|
|
ierr = NF_DEF_VAR (nid, "cv", NF_FLOAT, 2, dims2, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Coefficient de passage pour V") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, cv) |
|
|
|
|
|
! Aire de chaque maille: |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
dims2(1) = idim_rlonv |
|
|
dims2(2) = idim_rlatu |
|
|
ierr = NF_DEF_VAR (nid, "aire", NF_FLOAT, 2, dims2, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Aires de chaque maille") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, aire) |
|
|
|
|
|
! Geopentiel au sol: |
|
|
|
|
|
ierr = NF_REDEF (nid) |
|
|
dims2(1) = idim_rlonv |
|
|
dims2(2) = idim_rlatu |
|
|
ierr = NF_DEF_VAR (nid, "phisinit", NF_FLOAT, 2, dims2, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Geopotentiel au sol") |
|
|
ierr = NF_ENDDEF(nid) |
|
|
ierr = NF_PUT_VAR_REAL (nid, nvarid, phis) |
|
|
|
|
|
! Definir les variables pour pouvoir les enregistrer plus tard: |
|
|
|
|
|
ierr = NF_REDEF (nid) ! entrer dans le mode de definition |
|
|
|
|
|
ierr = NF_DEF_VAR (nid, "temps", NF_FLOAT, 1, idim_tim, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Temps de simulation") |
|
|
write(unites, 200)yyears0, mmois0, jjour0 |
|
|
200 format('days since ', i4, '-', i2.2, '-', i2.2, ' 00:00:00') |
|
|
call nf95_put_att(nid, nvarid, "units", unites) |
|
|
|
|
|
|
|
|
dims4(1) = idim_rlonu |
|
|
dims4(2) = idim_rlatu |
|
|
dims4(3) = idim_s |
|
|
dims4(4) = idim_tim |
|
|
ierr = NF_DEF_VAR (nid, "ucov", NF_FLOAT, 4, dims4, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Vitesse U") |
|
|
|
|
|
dims4(1) = idim_rlonv |
|
|
dims4(2) = idim_rlatv |
|
|
dims4(3) = idim_s |
|
|
dims4(4) = idim_tim |
|
|
ierr = NF_DEF_VAR (nid, "vcov", NF_FLOAT, 4, dims4, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Vitesse V") |
|
|
|
|
|
dims4(1) = idim_rlonv |
|
|
dims4(2) = idim_rlatu |
|
|
dims4(3) = idim_s |
|
|
dims4(4) = idim_tim |
|
|
ierr = NF_DEF_VAR (nid, "teta", NF_FLOAT, 4, dims4, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Temperature") |
|
|
|
|
|
dims4(1) = idim_rlonv |
|
|
dims4(2) = idim_rlatu |
|
|
dims4(3) = idim_s |
|
|
dims4(4) = idim_tim |
|
|
DO iq=1, nqmx |
|
|
ierr = NF_DEF_VAR (nid, tname(iq), NF_FLOAT, 4, dims4, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", ttext(iq)) |
|
|
ENDDO |
|
|
|
|
|
dims4(1) = idim_rlonv |
|
|
dims4(2) = idim_rlatu |
|
|
dims4(3) = idim_s |
|
|
dims4(4) = idim_tim |
|
|
ierr = NF_DEF_VAR (nid, "masse", NF_FLOAT, 4, dims4, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "C est quoi ?") |
|
|
|
|
|
dims3(1) = idim_rlonv |
|
|
dims3(2) = idim_rlatu |
|
|
dims3(3) = idim_tim |
|
|
ierr = NF_DEF_VAR (nid, "ps", NF_FLOAT, 3, dims3, nvarid) |
|
|
call nf95_put_att(nid, nvarid, "title", "Pression au sol") |
|
280 |
|
|
281 |
ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
PRINT *, 'iim, jjm, llm, iday_end', iim, jjm, llm, iday_end |
282 |
ierr = NF_CLOSE(nid) ! fermer le fichier |
PRINT *, 'rad, omeg, g, cpp, kappa', rad, omeg, g, cpp, kappa |
283 |
|
|
284 |
PRINT*, 'iim, jjm, llm, iday_end', iim, jjm, llm, iday_end |
END SUBROUTINE dynredem0 |
|
PRINT*, 'rad, omeg, g, cpp, kappa', rad, omeg, g, cpp, kappa |
|
285 |
|
|
286 |
END SUBROUTINE dynredem0 |
END MODULE dynredem0_m |