7 |
subroutine inithist(day0, anne0, tstep, nq, t_ops, t_wrt) |
subroutine inithist(day0, anne0, tstep, nq, t_ops, t_wrt) |
8 |
|
|
9 |
! From inithist.F, version 1.1.1.1 2004/05/19 12:53:05 |
! From inithist.F, version 1.1.1.1 2004/05/19 12:53:05 |
|
|
|
|
! Routine d'initialisation des écritures des fichiers histoires LMDZ |
|
|
! au format IOIPSL |
|
|
! Appels successifs des routines : histbeg, histhori, histver, |
|
|
! histdef, histend |
|
|
|
|
|
! Entrées : |
|
|
! day0, anne0: date de référence |
|
|
! tstep : durée du pas de temps en secondes |
|
|
! t_ops : fréquence de l'opération pour IOIPSL |
|
|
! t_wrt : fréquence d'écriture sur le fichier |
|
|
! nq : nombre de traceurs |
|
|
|
|
10 |
! L. Fairhead, LMD, 03/99 |
! L. Fairhead, LMD, 03/99 |
11 |
|
|
12 |
USE calendar |
! Routine d'initialisation des écritures des fichiers histoires |
13 |
use com_io_dyn, only: histid, histvid, histuid |
! LMDZ au format IOIPSL. |
14 |
use histcom |
|
15 |
use dimens_m |
USE comgeom, ONLY: rlatu, rlatv, rlonu, rlonv |
16 |
use paramet_m |
USE com_io_dyn, ONLY: histid, histuid, histvid |
17 |
use comconst |
USE dimens_m, ONLY: jjm, llm |
18 |
use comvert |
USE disvert_m, ONLY: presnivs |
19 |
use logic |
USE histbeg_totreg_m, ONLY : histbeg_totreg |
20 |
use comgeom |
USE histdef_m, ONLY : histdef |
21 |
use serre |
USE histend_m, ONLY : histend |
22 |
use temps |
USE histvert_m, ONLY : histvert |
23 |
use ener |
USE iniadvtrac_m, ONLY: ttext |
24 |
use iniadvtrac_m |
USE nr_util, ONLY: pi |
25 |
use nr_util, only: pi |
USE paramet_m, ONLY: iip1, jjp1 |
26 |
|
USE temps, ONLY: itau_dyn |
27 |
! Arguments |
USE ymds2ju_m, ONLY: ymds2ju |
28 |
integer day0, anne0 |
|
29 |
real, intent(in):: tstep, t_ops, t_wrt |
integer, intent(in):: day0, anne0 ! date de référence |
30 |
integer nq |
real, intent(in):: tstep ! durée du pas de temps en secondes |
31 |
|
integer, intent(in):: nq ! nombre de traceurs |
32 |
|
real, intent(in):: t_ops ! fréquence de l'opération pour IOIPSL |
33 |
|
real, intent(in):: t_wrt ! fréquence d'écriture sur le fichier |
34 |
|
|
35 |
! Variables locales |
! Variables locales: |
36 |
real zjulian |
real zjulian |
37 |
integer iq |
integer iq |
38 |
real rlong(iip1, jjp1), rlat(iip1, jjp1) |
real rlong(iip1, jjp1), rlat(iip1, jjp1) |
42 |
|
|
43 |
!----------------------------------------------------------------------- |
!----------------------------------------------------------------------- |
44 |
|
|
|
! Appel a histbeg: creation du fichier netcdf et initialisations diverses |
|
|
|
|
45 |
zan = anne0 |
zan = anne0 |
46 |
dayref = day0 |
dayref = day0 |
47 |
CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) |
CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) |
67 |
! IOIPSL ne permet pas de grilles avec des nombres de point differents dans |
! IOIPSL ne permet pas de grilles avec des nombres de point differents dans |
68 |
! un meme fichier) |
! un meme fichier) |
69 |
|
|
70 |
call histbeg_totreg('dyn_histv.nc', rlong(:, 1), rlat(1, :jjm), & |
call histbeg_totreg('dyn_histv.nc', rlong(:, 1), rlat(1, :jjm), 1, iip1, & |
71 |
1, iip1, 1, jjm, & |
1, jjm, itau_dyn, zjulian, tstep, vhoriid, histvid) |
72 |
itau_dyn, zjulian, tstep, vhoriid, histvid) |
|
|
! |
|
|
! Appel a histhori pour rajouter les autres grilles horizontales |
|
|
! |
|
73 |
do jj = 1, jjp1 |
do jj = 1, jjp1 |
74 |
do ii = 1, iip1 |
do ii = 1, iip1 |
75 |
rlong(ii, jj) = rlonv(ii) * 180. / pi |
rlong(ii, jj) = rlonv(ii) * 180. / pi |
79 |
|
|
80 |
call histbeg_totreg("dyn_hist.nc", rlong(:, 1), rlat(1, :), 1, iip1, 1, & |
call histbeg_totreg("dyn_hist.nc", rlong(:, 1), rlat(1, :), 1, iip1, 1, & |
81 |
jjp1, itau_dyn, zjulian, tstep, thoriid, histid) |
jjp1, itau_dyn, zjulian, tstep, thoriid, histid) |
82 |
! |
|
83 |
! Appel a histvert pour la grille verticale |
! Appel a histvert pour la grille verticale |
84 |
! |
|
85 |
call histvert(histid, 'presnivs', 'Niveaux pression','mb', llm, & |
call histvert(histid, 'presnivs', 'Niveaux pression','mb', presnivs/100., & |
86 |
presnivs/100., zvertiid,'down') |
zvertiid,'down') |
87 |
call histvert(histvid, 'presnivs', 'Niveaux pression','mb', llm, & |
call histvert(histvid, 'presnivs', 'Niveaux pression','mb', & |
88 |
presnivs/100., zvertiid,'down') |
presnivs/100., zvertiid,'down') |
89 |
call histvert(histuid, 'presnivs', 'Niveaux pression','mb', llm, & |
call histvert(histuid, 'presnivs', 'Niveaux pression','mb', & |
90 |
presnivs/100., zvertiid,'down') |
presnivs/100., zvertiid,'down') |
91 |
! |
|
92 |
! Appels a histdef pour la definition des variables a sauvegarder |
! Appels a histdef pour la definition des variables a sauvegarder |
93 |
! |
|
94 |
! Vents U |
call histdef(histuid, 'u', 'vent u', 'm/s', iip1, jjp1, uhoriid, llm, 1, & |
95 |
! |
llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
96 |
call histdef(histuid, 'u', 'vent u', 'm/s', & |
call histdef(histvid, 'v', 'vent v', 'm/s', iip1, jjm, vhoriid, llm, 1, & |
97 |
iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, & |
llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
98 |
'inst(X)', t_ops, t_wrt) |
call histdef(histid, 'teta', 'temperature potentielle', '-', iip1, jjp1, & |
99 |
! |
thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
100 |
! Vents V |
call histdef(histid, 'phi', 'geopotentiel', '-', iip1, jjp1, thoriid, & |
101 |
! |
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
102 |
call histdef(histvid, 'v', 'vent v', 'm/s', & |
|
|
iip1, jjm, vhoriid, llm, 1, llm, zvertiid, & |
|
|
'inst(X)', t_ops, t_wrt) |
|
|
|
|
|
! |
|
|
! Temperature potentielle |
|
|
! |
|
|
call histdef(histid, 'teta', 'temperature potentielle', '-', & |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
|
|
'inst(X)', t_ops, t_wrt) |
|
|
! |
|
|
! Geopotentiel |
|
|
! |
|
|
call histdef(histid, 'phi', 'geopotentiel', '-', & |
|
|
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
|
|
'inst(X)', t_ops, t_wrt) |
|
|
! |
|
103 |
! Traceurs |
! Traceurs |
|
! |
|
104 |
DO iq=1, nq |
DO iq=1, nq |
105 |
call histdef(histid, ttext(iq), ttext(iq), '-', & |
call histdef(histid, ttext(iq), ttext(iq), '-', iip1, jjp1, thoriid, & |
106 |
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
|
'inst(X)', t_ops, t_wrt) |
|
107 |
enddo |
enddo |
108 |
! |
|
109 |
! Masse |
call histdef(histid, 'masse', 'masse', 'kg', iip1, jjp1, thoriid, llm, 1, & |
110 |
! |
llm, zvertiid, 'inst(X)', t_ops, t_wrt) |
111 |
call histdef(histid, 'masse', 'masse', 'kg', & |
call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', iip1, jjp1, & |
112 |
iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & |
thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt) |
113 |
'inst(X)', t_ops, t_wrt) |
call histdef(histid, 'phis', 'geopotentiel au sol', '-', iip1, jjp1, & |
114 |
! |
thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt) |
115 |
! Pression au sol |
|
|
! |
|
|
call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', & |
|
|
iip1, jjp1, thoriid, 1, 1, 1, -99, & |
|
|
'inst(X)', t_ops, t_wrt) |
|
|
! |
|
|
! Geopotentiel au sol |
|
|
! |
|
|
call histdef(histid, 'phis', 'geopotentiel au sol', '-', & |
|
|
iip1, jjp1, thoriid, 1, 1, 1, -99, & |
|
|
'inst(X)', t_ops, t_wrt) |
|
|
! |
|
|
! Fin |
|
|
! |
|
116 |
call histend(histid) |
call histend(histid) |
117 |
call histend(histuid) |
call histend(histuid) |
118 |
call histend(histvid) |
call histend(histvid) |