1 | ! |
---|
2 | ! $Id: gcm.F 1446 2010-10-22 09:27:25Z emillour $ |
---|
3 | ! |
---|
4 | c |
---|
5 | c |
---|
6 | PROGRAM gcm |
---|
7 | |
---|
8 | #ifdef CPP_IOIPSL |
---|
9 | USE IOIPSL |
---|
10 | #endif |
---|
11 | |
---|
12 | USE mod_const_mpi, ONLY: init_const_mpi |
---|
13 | USE parallel |
---|
14 | USE infotrac |
---|
15 | USE mod_interface_dyn_phys |
---|
16 | USE mod_hallo |
---|
17 | USE Bands |
---|
18 | USE getparam |
---|
19 | USE filtreg_mod |
---|
20 | USE control_mod |
---|
21 | |
---|
22 | ! Ehouarn: for now these only apply to Earth: |
---|
23 | #ifdef CPP_EARTH |
---|
24 | USE mod_grid_phy_lmdz |
---|
25 | USE mod_phys_lmdz_para, ONLY : klon_mpi_para_nb |
---|
26 | USE mod_phys_lmdz_omp_data, ONLY: klon_omp |
---|
27 | USE dimphy |
---|
28 | USE comgeomphy |
---|
29 | #endif |
---|
30 | IMPLICIT NONE |
---|
31 | |
---|
32 | c ...... Version du 10/01/98 .......... |
---|
33 | |
---|
34 | c avec coordonnees verticales hybrides |
---|
35 | c avec nouveaux operat. dissipation * ( gradiv2,divgrad2,nxgraro2 ) |
---|
36 | |
---|
37 | c======================================================================= |
---|
38 | c |
---|
39 | c Auteur: P. Le Van /L. Fairhead/F.Hourdin |
---|
40 | c ------- |
---|
41 | c |
---|
42 | c Objet: |
---|
43 | c ------ |
---|
44 | c |
---|
45 | c GCM LMD nouvelle grille |
---|
46 | c |
---|
47 | c======================================================================= |
---|
48 | c |
---|
49 | c ... Dans inigeom , nouveaux calculs pour les elongations cu , cv |
---|
50 | c et possibilite d'appeler une fonction f(y) a derivee tangente |
---|
51 | c hyperbolique a la place de la fonction a derivee sinusoidale. |
---|
52 | c ... Possibilite de choisir le schema pour l'advection de |
---|
53 | c q , en modifiant iadv dans traceur.def (MAF,10/02) . |
---|
54 | c |
---|
55 | c Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99) |
---|
56 | c Pour Van-Leer iadv=10 |
---|
57 | c |
---|
58 | c----------------------------------------------------------------------- |
---|
59 | c Declarations: |
---|
60 | c ------------- |
---|
61 | |
---|
62 | #include "dimensions.h" |
---|
63 | #include "paramet.h" |
---|
64 | #include "comconst.h" |
---|
65 | #include "comdissnew.h" |
---|
66 | #include "comvert.h" |
---|
67 | #include "comgeom.h" |
---|
68 | #include "logic.h" |
---|
69 | #include "temps.h" |
---|
70 | !!!!!!!!!!!#include "control.h" |
---|
71 | #include "ener.h" |
---|
72 | #include "description.h" |
---|
73 | #include "serre.h" |
---|
74 | !#include "com_io_dyn.h" |
---|
75 | #include "iniprint.h" |
---|
76 | #include "tracstoke.h" |
---|
77 | #ifdef INCA |
---|
78 | ! Only INCA needs these informations (from the Earth's physics) |
---|
79 | #include "indicesol.h" |
---|
80 | #endif |
---|
81 | INTEGER longcles |
---|
82 | PARAMETER ( longcles = 20 ) |
---|
83 | REAL clesphy0( longcles ) |
---|
84 | SAVE clesphy0 |
---|
85 | |
---|
86 | |
---|
87 | |
---|
88 | REAL zdtvr |
---|
89 | c INTEGER nbetatmoy, nbetatdem,nbetat |
---|
90 | INTEGER nbetatmoy, nbetatdem |
---|
91 | |
---|
92 | c variables dynamiques |
---|
93 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
---|
94 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
---|
95 | REAL, ALLOCATABLE, DIMENSION(:,:,:):: q! champs advectes |
---|
96 | REAL ps(ip1jmp1) ! pression au sol |
---|
97 | c REAL p (ip1jmp1,llmp1 ) ! pression aux interfac.des couches |
---|
98 | c REAL pks(ip1jmp1) ! exner au sol |
---|
99 | c REAL pk(ip1jmp1,llm) ! exner au milieu des couches |
---|
100 | c REAL pkf(ip1jmp1,llm) ! exner filt.au milieu des couches |
---|
101 | REAL masse(ip1jmp1,llm) ! masse d'air |
---|
102 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
103 | c REAL phi(ip1jmp1,llm) ! geopotentiel |
---|
104 | c REAL w(ip1jmp1,llm) ! vitesse verticale |
---|
105 | |
---|
106 | c variables dynamiques intermediaire pour le transport |
---|
107 | |
---|
108 | c variables pour le fichier histoire |
---|
109 | REAL dtav ! intervalle de temps elementaire |
---|
110 | |
---|
111 | REAL time_0 |
---|
112 | |
---|
113 | LOGICAL lafin |
---|
114 | c INTEGER ij,iq,l,i,j |
---|
115 | INTEGER i,j |
---|
116 | |
---|
117 | |
---|
118 | real time_step, t_wrt, t_ops |
---|
119 | |
---|
120 | |
---|
121 | LOGICAL call_iniphys |
---|
122 | data call_iniphys/.true./ |
---|
123 | |
---|
124 | c REAL alpha(ip1jmp1,llm),beta(ip1jmp1,llm) |
---|
125 | c+jld variables test conservation energie |
---|
126 | c REAL ecin(ip1jmp1,llm),ecin0(ip1jmp1,llm) |
---|
127 | C Tendance de la temp. potentiel d (theta)/ d t due a la |
---|
128 | C tansformation d'energie cinetique en energie thermique |
---|
129 | C cree par la dissipation |
---|
130 | c REAL dhecdt(ip1jmp1,llm) |
---|
131 | c REAL vcont(ip1jm,llm),ucont(ip1jmp1,llm) |
---|
132 | c REAL d_h_vcol, d_qt, d_qw, d_ql, d_ec |
---|
133 | c CHARACTER (len=15) :: ztit |
---|
134 | c-jld |
---|
135 | |
---|
136 | |
---|
137 | character (len=80) :: dynhist_file, dynhistave_file |
---|
138 | character (len=20) :: modname |
---|
139 | character (len=80) :: abort_message |
---|
140 | ! locales pour gestion du temps |
---|
141 | INTEGER :: an, mois, jour |
---|
142 | REAL :: heure |
---|
143 | |
---|
144 | |
---|
145 | c----------------------------------------------------------------------- |
---|
146 | c variables pour l'initialisation de la physique : |
---|
147 | c ------------------------------------------------ |
---|
148 | INTEGER ngridmx |
---|
149 | PARAMETER( ngridmx = 2+(jjm-1)*iim - 1/jjm ) |
---|
150 | REAL zcufi(ngridmx),zcvfi(ngridmx) |
---|
151 | REAL latfi(ngridmx),lonfi(ngridmx) |
---|
152 | REAL airefi(ngridmx) |
---|
153 | SAVE latfi, lonfi, airefi |
---|
154 | |
---|
155 | INTEGER :: ierr |
---|
156 | |
---|
157 | |
---|
158 | c----------------------------------------------------------------------- |
---|
159 | c Initialisations: |
---|
160 | c ---------------- |
---|
161 | |
---|
162 | abort_message = 'last timestep reached' |
---|
163 | modname = 'gcm' |
---|
164 | descript = 'Run GCM LMDZ' |
---|
165 | lafin = .FALSE. |
---|
166 | dynhist_file = 'dyn_hist' |
---|
167 | dynhistave_file = 'dyn_hist_ave' |
---|
168 | |
---|
169 | |
---|
170 | |
---|
171 | c---------------------------------------------------------------------- |
---|
172 | c lecture des fichiers gcm.def ou run.def |
---|
173 | c --------------------------------------- |
---|
174 | c |
---|
175 | ! Ehouarn: dump possibility of using defrun |
---|
176 | !#ifdef CPP_IOIPSL |
---|
177 | CALL conf_gcm( 99, .TRUE. , clesphy0 ) |
---|
178 | !#else |
---|
179 | ! CALL defrun( 99, .TRUE. , clesphy0 ) |
---|
180 | !#endif |
---|
181 | c |
---|
182 | c |
---|
183 | c------------------------------------ |
---|
184 | c Initialisation partie parallele |
---|
185 | c------------------------------------ |
---|
186 | CALL init_const_mpi |
---|
187 | |
---|
188 | call init_parallel |
---|
189 | call ini_getparam("out.def") |
---|
190 | call Read_Distrib |
---|
191 | ! Ehouarn : temporarily (?) keep this only for Earth |
---|
192 | ! if (planet_type.eq."earth") then |
---|
193 | !#ifdef CPP_EARTH |
---|
194 | #ifdef CPP_PHYS |
---|
195 | CALL Init_Phys_lmdz(iim,jjp1,llm,mpi_size,distrib_phys) |
---|
196 | #endif |
---|
197 | ! endif ! of if (planet_type.eq."earth") |
---|
198 | CALL set_bands |
---|
199 | #ifdef CPP_PHYS |
---|
200 | ! Ehouarn: NB: For now only Earth physics is parallel |
---|
201 | CALL Init_interface_dyn_phys |
---|
202 | #endif |
---|
203 | CALL barrier |
---|
204 | |
---|
205 | if (mpi_rank==0) call WriteBands |
---|
206 | call SetDistrib(jj_Nb_Caldyn) |
---|
207 | |
---|
208 | c$OMP PARALLEL |
---|
209 | call Init_Mod_hallo |
---|
210 | c$OMP END PARALLEL |
---|
211 | |
---|
212 | ! Ehouarn : temporarily (?) keep this only for Earth |
---|
213 | ! if (planet_type.eq."earth") then |
---|
214 | !#ifdef CPP_EARTH |
---|
215 | #ifdef CPP_PHYS |
---|
216 | c$OMP PARALLEL |
---|
217 | call InitComgeomphy |
---|
218 | c$OMP END PARALLEL |
---|
219 | #endif |
---|
220 | ! endif ! of if (planet_type.eq."earth") |
---|
221 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
222 | c |
---|
223 | c Initialisations pour Cp(T) Venus |
---|
224 | call ini_cpdet |
---|
225 | c |
---|
226 | c----------------------------------------------------------------------- |
---|
227 | c Choix du calendrier |
---|
228 | c ------------------- |
---|
229 | |
---|
230 | c calend = 'earth_365d' |
---|
231 | |
---|
232 | #ifdef CPP_IOIPSL |
---|
233 | if (calend == 'earth_360d') then |
---|
234 | call ioconf_calendar('360d') |
---|
235 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 360 jours/an' |
---|
236 | else if (calend == 'earth_365d') then |
---|
237 | call ioconf_calendar('noleap') |
---|
238 | write(lunout,*)'CALENDRIER CHOISI: Terrestre a 365 jours/an' |
---|
239 | else if (calend == 'earth_366d') then |
---|
240 | call ioconf_calendar('gregorian') |
---|
241 | write(lunout,*)'CALENDRIER CHOISI: Terrestre bissextile' |
---|
242 | else |
---|
243 | abort_message = 'Mauvais choix de calendrier' |
---|
244 | call abort_gcm(modname,abort_message,1) |
---|
245 | endif |
---|
246 | #endif |
---|
247 | c----------------------------------------------------------------------- |
---|
248 | |
---|
249 | IF (config_inca /= 'none') THEN |
---|
250 | #ifdef INCA |
---|
251 | call init_const_lmdz( |
---|
252 | $ nbtr,anneeref,dayref, |
---|
253 | $ iphysiq,day_step,nday, |
---|
254 | $ nbsrf, is_oce,is_sic, |
---|
255 | $ is_ter,is_lic) |
---|
256 | |
---|
257 | call init_inca_para( |
---|
258 | $ iim,jjm+1,llm,klon_glo,mpi_size, |
---|
259 | $ distrib_phys,COMM_LMDZ) |
---|
260 | #endif |
---|
261 | END IF |
---|
262 | |
---|
263 | c----------------------------------------------------------------------- |
---|
264 | c Initialisation des traceurs |
---|
265 | c --------------------------- |
---|
266 | c Choix du nombre de traceurs et du schema pour l'advection |
---|
267 | c dans fichier traceur.def, par default ou via INCA |
---|
268 | call infotrac_init |
---|
269 | |
---|
270 | c Allocation de la tableau q : champs advectes |
---|
271 | ALLOCATE(q(ip1jmp1,llm,nqtot)) |
---|
272 | |
---|
273 | c----------------------------------------------------------------------- |
---|
274 | c Lecture de l'etat initial : |
---|
275 | c --------------------------- |
---|
276 | |
---|
277 | c lecture du fichier start.nc |
---|
278 | if (read_start) then |
---|
279 | ! we still need to run iniacademic to initialize some |
---|
280 | ! constants & fields, if we run the 'newtonian' or 'SW' cases: |
---|
281 | if (iflag_phys.ne.1) then |
---|
282 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
283 | endif |
---|
284 | |
---|
285 | if (planet_type.eq."mars") then |
---|
286 | ! POUR MARS, METTRE UNE FONCTION A PART, genre dynetat0_mars |
---|
287 | abort_message = 'dynetat0_mars A FAIRE' |
---|
288 | call abort_gcm(modname,abort_message,0) |
---|
289 | else |
---|
290 | CALL dynetat0("start.nc",vcov,ucov, |
---|
291 | & teta,q,masse,ps,phis, time_0) |
---|
292 | endif ! of if (planet_type.eq."mars") |
---|
293 | |
---|
294 | c write(73,*) 'ucov',ucov |
---|
295 | c write(74,*) 'vcov',vcov |
---|
296 | c write(75,*) 'teta',teta |
---|
297 | c write(76,*) 'ps',ps |
---|
298 | c write(77,*) 'q',q |
---|
299 | |
---|
300 | endif ! of if (read_start) |
---|
301 | |
---|
302 | c le cas echeant, creation d un etat initial |
---|
303 | IF (prt_level > 9) WRITE(lunout,*) |
---|
304 | . 'GCM: AVANT iniacademic AVANT AVANT AVANT AVANT' |
---|
305 | if (.not.read_start) then |
---|
306 | CALL iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0) |
---|
307 | endif |
---|
308 | |
---|
309 | |
---|
310 | c----------------------------------------------------------------------- |
---|
311 | c Lecture des parametres de controle pour la simulation : |
---|
312 | c ------------------------------------------------------- |
---|
313 | c on recalcule eventuellement le pas de temps |
---|
314 | |
---|
315 | IF(MOD(day_step,iperiod).NE.0) THEN |
---|
316 | abort_message = |
---|
317 | . 'Il faut choisir un nb de pas par jour multiple de iperiod' |
---|
318 | call abort_gcm(modname,abort_message,1) |
---|
319 | ENDIF |
---|
320 | |
---|
321 | IF(MOD(day_step,iphysiq).NE.0) THEN |
---|
322 | abort_message = |
---|
323 | * 'Il faut choisir un nb de pas par jour multiple de iphysiq' |
---|
324 | call abort_gcm(modname,abort_message,1) |
---|
325 | ENDIF |
---|
326 | |
---|
327 | zdtvr = daysec/REAL(day_step) |
---|
328 | IF(dtvr.NE.zdtvr) THEN |
---|
329 | WRITE(lunout,*) |
---|
330 | . 'WARNING!!! changement de pas de temps',dtvr,'>',zdtvr |
---|
331 | ENDIF |
---|
332 | |
---|
333 | C |
---|
334 | C on remet le calendrier à zero si demande |
---|
335 | c |
---|
336 | IF (raz_date == 1) THEN |
---|
337 | annee_ref = anneeref |
---|
338 | day_ref = dayref |
---|
339 | day_ini = dayref |
---|
340 | itau_dyn = 0 |
---|
341 | itau_phy = 0 |
---|
342 | time_0 = 0. |
---|
343 | write(lunout,*) |
---|
344 | . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
345 | ELSE IF (annee_ref .ne. anneeref .or. day_ref .ne. dayref) THEN |
---|
346 | write(lunout,*) |
---|
347 | . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
348 | write(lunout,*) |
---|
349 | . ' restart ne correspondent pas a celles lues dans ' |
---|
350 | write(lunout,*)' gcm.def' |
---|
351 | write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
352 | write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
353 | write(lunout,*)' Pas de remise a zero' |
---|
354 | ENDIF |
---|
355 | |
---|
356 | c if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then |
---|
357 | c write(lunout,*) |
---|
358 | c . 'GCM: Attention les dates initiales lues dans le fichier' |
---|
359 | c write(lunout,*) |
---|
360 | c . ' restart ne correspondent pas a celles lues dans ' |
---|
361 | c write(lunout,*)' gcm.def' |
---|
362 | c write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref |
---|
363 | c write(lunout,*)' day_ref=',day_ref," dayref=",dayref |
---|
364 | c if (raz_date .ne. 1) then |
---|
365 | c write(lunout,*) |
---|
366 | c . 'GCM: On garde les dates du fichier restart' |
---|
367 | c else |
---|
368 | c annee_ref = anneeref |
---|
369 | c day_ref = dayref |
---|
370 | c day_ini = dayref |
---|
371 | c itau_dyn = 0 |
---|
372 | c itau_phy = 0 |
---|
373 | c time_0 = 0. |
---|
374 | c write(lunout,*) |
---|
375 | c . 'GCM: On reinitialise a la date lue dans gcm.def' |
---|
376 | c endif |
---|
377 | c ELSE |
---|
378 | c raz_date = 0 |
---|
379 | c endif |
---|
380 | |
---|
381 | #ifdef CPP_IOIPSL |
---|
382 | mois = 1 |
---|
383 | heure = 0. |
---|
384 | call ymds2ju(annee_ref, mois, day_ref, heure, jD_ref) |
---|
385 | jH_ref = jD_ref - int(jD_ref) |
---|
386 | jD_ref = int(jD_ref) |
---|
387 | |
---|
388 | call ioconf_startdate(INT(jD_ref), jH_ref) |
---|
389 | |
---|
390 | write(lunout,*)'DEBUG' |
---|
391 | write(lunout,*)'annee_ref, mois, day_ref, heure, jD_ref' |
---|
392 | write(lunout,*)annee_ref, mois, day_ref, heure, jD_ref |
---|
393 | call ju2ymds(jD_ref+jH_ref,an, mois, jour, heure) |
---|
394 | write(lunout,*)'jD_ref+jH_ref,an, mois, jour, heure' |
---|
395 | write(lunout,*)jD_ref+jH_ref,an, mois, jour, heure |
---|
396 | #else |
---|
397 | ! Ehouarn: we still need to define JD_ref and JH_ref |
---|
398 | ! and since we don't know how many days there are in a year |
---|
399 | ! we set JD_ref to 0 (this should be improved ...) |
---|
400 | jD_ref=0 |
---|
401 | jH_ref=0 |
---|
402 | #endif |
---|
403 | |
---|
404 | c nombre d'etats dans les fichiers demarrage et histoire |
---|
405 | nbetatdem = nday / iecri |
---|
406 | nbetatmoy = nday / periodav + 1 |
---|
407 | |
---|
408 | if (iflag_phys.eq.1) then |
---|
409 | ! these initialisations have already been done (via iniacademic) |
---|
410 | ! if running in SW or Newtonian mode |
---|
411 | c----------------------------------------------------------------------- |
---|
412 | c Initialisation des constantes dynamiques : |
---|
413 | c ------------------------------------------ |
---|
414 | dtvr = zdtvr |
---|
415 | CALL iniconst |
---|
416 | |
---|
417 | c----------------------------------------------------------------------- |
---|
418 | c Initialisation de la geometrie : |
---|
419 | c -------------------------------- |
---|
420 | CALL inigeom |
---|
421 | |
---|
422 | c----------------------------------------------------------------------- |
---|
423 | c Initialisation du filtre : |
---|
424 | c -------------------------- |
---|
425 | CALL inifilr |
---|
426 | endif ! of if (iflag_phys.eq.1) |
---|
427 | c |
---|
428 | c----------------------------------------------------------------------- |
---|
429 | c Initialisation de la dissipation : |
---|
430 | c ---------------------------------- |
---|
431 | |
---|
432 | CALL inidissip( lstardis, nitergdiv, nitergrot, niterh , |
---|
433 | * tetagdiv, tetagrot , tetatemp ) |
---|
434 | |
---|
435 | c----------------------------------------------------------------------- |
---|
436 | c Initialisation de la physique : |
---|
437 | c ------------------------------- |
---|
438 | |
---|
439 | IF (call_iniphys.and.(iflag_phys.eq.1)) THEN |
---|
440 | latfi(1)=rlatu(1) |
---|
441 | lonfi(1)=0. |
---|
442 | zcufi(1) = cu(1) |
---|
443 | zcvfi(1) = cv(1) |
---|
444 | DO j=2,jjm |
---|
445 | DO i=1,iim |
---|
446 | latfi((j-2)*iim+1+i)= rlatu(j) |
---|
447 | lonfi((j-2)*iim+1+i)= rlonv(i) |
---|
448 | zcufi((j-2)*iim+1+i) = cu((j-1)*iip1+i) |
---|
449 | zcvfi((j-2)*iim+1+i) = cv((j-1)*iip1+i) |
---|
450 | ENDDO |
---|
451 | ENDDO |
---|
452 | latfi(ngridmx)= rlatu(jjp1) |
---|
453 | lonfi(ngridmx)= 0. |
---|
454 | zcufi(ngridmx) = cu(ip1jm+1) |
---|
455 | zcvfi(ngridmx) = cv(ip1jm-iim) |
---|
456 | CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,aire,airefi) |
---|
457 | WRITE(lunout,*) |
---|
458 | . 'GCM: WARNING!!! vitesse verticale nulle dans la physique' |
---|
459 | |
---|
460 | ! Initialisation de la physique: pose probleme quand on tourne |
---|
461 | ! SANS physique, car iniphysiq.F est dans le repertoire phy[]... |
---|
462 | ! Il faut une cle CPP_PHYS |
---|
463 | #ifdef CPP_PHYS |
---|
464 | CALL iniphysiq(ngridmx,llm,daysec,day_ini,dtphys/nsplit_phys , |
---|
465 | , latfi,lonfi,airefi,zcufi,zcvfi,rad,g,r,cpp ) |
---|
466 | #endif ! CPP_PHYS |
---|
467 | call_iniphys=.false. |
---|
468 | ENDIF ! of IF (call_iniphys.and.(iflag_phys.eq.1)) |
---|
469 | !#endif |
---|
470 | |
---|
471 | c----------------------------------------------------------------------- |
---|
472 | c Initialisation des dimensions d'INCA : |
---|
473 | c -------------------------------------- |
---|
474 | IF (config_inca /= 'none') THEN |
---|
475 | !$OMP PARALLEL |
---|
476 | #ifdef INCA |
---|
477 | CALL init_inca_dim(klon_omp,llm,iim,jjm, |
---|
478 | $ rlonu,rlatu,rlonv,rlatv) |
---|
479 | #endif |
---|
480 | !$OMP END PARALLEL |
---|
481 | END IF |
---|
482 | |
---|
483 | c----------------------------------------------------------------------- |
---|
484 | c Initialisation des I/O : |
---|
485 | c ------------------------ |
---|
486 | |
---|
487 | |
---|
488 | day_end = day_ini + nday |
---|
489 | WRITE(lunout,300)day_ini,day_end |
---|
490 | 300 FORMAT('1'/,15x,'run du jour',i7,2x,'au jour',i7//) |
---|
491 | |
---|
492 | #ifdef CPP_IOIPSL |
---|
493 | call ju2ymds(jD_ref + day_ini - day_ref, an, mois, jour, heure) |
---|
494 | write (lunout,301)jour, mois, an |
---|
495 | call ju2ymds(jD_ref + day_end - day_ref, an, mois, jour, heure) |
---|
496 | write (lunout,302)jour, mois, an |
---|
497 | 301 FORMAT('1'/,15x,'run du ', i2,'/',i2,'/',i4) |
---|
498 | 302 FORMAT('1'/,15x,' au ', i2,'/',i2,'/',i4) |
---|
499 | #endif |
---|
500 | |
---|
501 | if (planet_type.eq."mars") then |
---|
502 | ! POUR MARS, METTRE UNE FONCTION A PART, genre dynredem0_mars |
---|
503 | abort_message = 'dynredem0_mars A FAIRE' |
---|
504 | call abort_gcm(modname,abort_message,0) |
---|
505 | else |
---|
506 | CALL dynredem0_p("restart.nc", day_end, phis) |
---|
507 | endif ! of if (planet_type.eq."mars") |
---|
508 | |
---|
509 | ecripar = .TRUE. |
---|
510 | |
---|
511 | #ifdef CPP_IOIPSL |
---|
512 | time_step = zdtvr |
---|
513 | IF (mpi_rank==0) then |
---|
514 | if (ok_dyn_ins) then |
---|
515 | ! initialize output file for instantaneous outputs |
---|
516 | ! t_ops = iecri * daysec ! do operations every t_ops |
---|
517 | t_ops =((1.0*iecri)/day_step) * daysec |
---|
518 | t_wrt = daysec ! iecri * daysec ! write output every t_wrt |
---|
519 | CALL inithist(day_ref,annee_ref,time_step, |
---|
520 | & t_ops,t_wrt) |
---|
521 | endif |
---|
522 | |
---|
523 | IF (ok_dyn_ave) THEN |
---|
524 | ! initialize output file for averaged outputs |
---|
525 | t_ops = iperiod * time_step ! do operations every t_ops |
---|
526 | t_wrt = periodav * daysec ! write output every t_wrt |
---|
527 | CALL initdynav(day_ref,annee_ref,time_step, |
---|
528 | & t_ops,t_wrt) |
---|
529 | ! CALL initdynav_p(dynhistave_file,day_ref,annee_ref,time_step, |
---|
530 | ! . t_ops, t_wrt, histaveid) |
---|
531 | END IF |
---|
532 | ENDIF |
---|
533 | dtav = iperiod*dtvr/daysec |
---|
534 | #endif |
---|
535 | ! #endif of #ifdef CPP_IOIPSL |
---|
536 | |
---|
537 | c Choix des frequences de stokage pour le offline |
---|
538 | c istdyn=day_step/4 ! stockage toutes les 6h=1jour/4 |
---|
539 | c istdyn=day_step/12 ! stockage toutes les 2h=1jour/12 |
---|
540 | istdyn=day_step/4 ! stockage toutes les 6h=1jour/12 |
---|
541 | istphy=istdyn/iphysiq |
---|
542 | |
---|
543 | |
---|
544 | c |
---|
545 | c----------------------------------------------------------------------- |
---|
546 | c Integration temporelle du modele : |
---|
547 | c ---------------------------------- |
---|
548 | |
---|
549 | c write(78,*) 'ucov',ucov |
---|
550 | c write(78,*) 'vcov',vcov |
---|
551 | c write(78,*) 'teta',teta |
---|
552 | c write(78,*) 'ps',ps |
---|
553 | c write(78,*) 'q',q |
---|
554 | |
---|
555 | c$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/,/logic/) |
---|
556 | CALL leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,clesphy0, |
---|
557 | . time_0) |
---|
558 | c$OMP END PARALLEL |
---|
559 | |
---|
560 | |
---|
561 | END |
---|
562 | |
---|