1 | ! |
---|
2 | ! $Id: writehist.F 2603 2016-07-25 09:31:56Z abarral $ |
---|
3 | ! |
---|
4 | subroutine writehist(time,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
5 | |
---|
6 | #ifdef CPP_IOIPSL |
---|
7 | USE ioipsl |
---|
8 | #endif |
---|
9 | USE infotrac, ONLY : nqtot, ttext |
---|
10 | use com_io_dyn_mod, only : histid,histvid,histuid |
---|
11 | USE temps_mod, ONLY: itau_dyn |
---|
12 | |
---|
13 | implicit none |
---|
14 | |
---|
15 | C |
---|
16 | C Ecriture du fichier histoire au format IOIPSL |
---|
17 | C |
---|
18 | C Appels succesifs des routines: histwrite |
---|
19 | C |
---|
20 | C Entree: |
---|
21 | C time: temps de l'ecriture |
---|
22 | C vcov: vents v covariants |
---|
23 | C ucov: vents u covariants |
---|
24 | C teta: temperature potentielle |
---|
25 | C phi : geopotentiel instantane |
---|
26 | C q : traceurs |
---|
27 | C masse: masse |
---|
28 | C ps :pression au sol |
---|
29 | C phis : geopotentiel au sol |
---|
30 | C |
---|
31 | C |
---|
32 | C L. Fairhead, LMD, 03/99 |
---|
33 | C |
---|
34 | C ===================================================================== |
---|
35 | C |
---|
36 | C Declarations |
---|
37 | include "dimensions.h" |
---|
38 | include "paramet.h" |
---|
39 | include "comgeom.h" |
---|
40 | include "ener.h" |
---|
41 | include "description.h" |
---|
42 | include "iniprint.h" |
---|
43 | |
---|
44 | C |
---|
45 | C Arguments |
---|
46 | C |
---|
47 | |
---|
48 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
49 | REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm) |
---|
50 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
51 | REAL phis(ip1jmp1) |
---|
52 | REAL q(ip1jmp1,llm,nqtot) |
---|
53 | integer time |
---|
54 | |
---|
55 | |
---|
56 | #ifdef CPP_IOIPSL |
---|
57 | ! This routine needs IOIPSL to work |
---|
58 | C Variables locales |
---|
59 | C |
---|
60 | integer iq, ii, ll |
---|
61 | integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1) |
---|
62 | logical ok_sync |
---|
63 | integer itau_w |
---|
64 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
65 | |
---|
66 | C |
---|
67 | C Initialisations |
---|
68 | C |
---|
69 | ndexu = 0 |
---|
70 | ndexv = 0 |
---|
71 | ndex2d = 0 |
---|
72 | ok_sync =.TRUE. |
---|
73 | itau_w = itau_dyn + time |
---|
74 | ! Passage aux composantes naturelles du vent |
---|
75 | call covnat(llm, ucov, vcov, unat, vnat) |
---|
76 | C |
---|
77 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
78 | C |
---|
79 | C Vents U |
---|
80 | C |
---|
81 | call histwrite(histuid, 'u', itau_w, unat, |
---|
82 | . iip1*jjp1*llm, ndexu) |
---|
83 | C |
---|
84 | C Vents V |
---|
85 | C |
---|
86 | call histwrite(histvid, 'v', itau_w, vnat, |
---|
87 | . iip1*jjm*llm, ndexv) |
---|
88 | |
---|
89 | C |
---|
90 | C Temperature potentielle |
---|
91 | C |
---|
92 | call histwrite(histid, 'teta', itau_w, teta, |
---|
93 | . iip1*jjp1*llm, ndexu) |
---|
94 | C |
---|
95 | C Geopotentiel |
---|
96 | C |
---|
97 | call histwrite(histid, 'phi', itau_w, phi, |
---|
98 | . iip1*jjp1*llm, ndexu) |
---|
99 | C |
---|
100 | C Traceurs |
---|
101 | C |
---|
102 | ! DO iq=1,nqtot |
---|
103 | ! call histwrite(histid, ttext(iq), itau_w, q(:,:,iq), |
---|
104 | ! . iip1*jjp1*llm, ndexu) |
---|
105 | ! enddo |
---|
106 | !C |
---|
107 | C Masse |
---|
108 | C |
---|
109 | call histwrite(histid,'masse',itau_w, masse,iip1*jjp1*llm,ndexu) |
---|
110 | C |
---|
111 | C Pression au sol |
---|
112 | C |
---|
113 | call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
114 | C |
---|
115 | C Geopotentiel au sol |
---|
116 | C |
---|
117 | ! call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
118 | C |
---|
119 | C Fin |
---|
120 | C |
---|
121 | if (ok_sync) then |
---|
122 | call histsync(histid) |
---|
123 | call histsync(histvid) |
---|
124 | call histsync(histuid) |
---|
125 | endif |
---|
126 | #else |
---|
127 | ! tell the user this routine should be run with ioipsl |
---|
128 | write(lunout,*)"writehist: Warning this routine should not be", |
---|
129 | & " used without ioipsl" |
---|
130 | #endif |
---|
131 | ! of #ifdef CPP_IOIPSL |
---|
132 | return |
---|
133 | end |
---|