[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: inithist.F 2600 2016-07-23 05:45:38Z emillour $ |
---|
[524] | 3 | ! |
---|
[1403] | 4 | subroutine inithist(day0,anne0,tstep,t_ops,t_wrt) |
---|
[524] | 5 | |
---|
[1279] | 6 | #ifdef CPP_IOIPSL |
---|
[524] | 7 | USE IOIPSL |
---|
[1279] | 8 | #endif |
---|
[1146] | 9 | USE infotrac, ONLY : nqtot, ttext |
---|
[1403] | 10 | use com_io_dyn_mod, only : histid,histvid,histuid, & |
---|
| 11 | & dynhist_file,dynhistv_file,dynhistu_file |
---|
[2597] | 12 | USE comconst_mod, ONLY: pi |
---|
[2600] | 13 | USE comvert_mod, ONLY: presnivs |
---|
[524] | 14 | implicit none |
---|
| 15 | |
---|
| 16 | C |
---|
| 17 | C Routine d'initialisation des ecritures des fichiers histoires LMDZ |
---|
| 18 | C au format IOIPSL |
---|
| 19 | C |
---|
| 20 | C Appels succesifs des routines: histbeg |
---|
| 21 | C histhori |
---|
| 22 | C histver |
---|
| 23 | C histdef |
---|
| 24 | C histend |
---|
| 25 | C |
---|
| 26 | C Entree: |
---|
| 27 | C |
---|
| 28 | C infile: nom du fichier histoire a creer |
---|
| 29 | C day0,anne0: date de reference |
---|
| 30 | C tstep: duree du pas de temps en seconde |
---|
| 31 | C t_ops: frequence de l'operation pour IOIPSL |
---|
| 32 | C t_wrt: frequence d'ecriture sur le fichier |
---|
| 33 | C nq: nombre de traceurs |
---|
| 34 | C |
---|
| 35 | C |
---|
| 36 | C L. Fairhead, LMD, 03/99 |
---|
| 37 | C |
---|
| 38 | C ===================================================================== |
---|
| 39 | C |
---|
| 40 | C Declarations |
---|
[2597] | 41 | include "dimensions.h" |
---|
| 42 | include "paramet.h" |
---|
| 43 | include "comgeom.h" |
---|
| 44 | include "temps.h" |
---|
| 45 | include "ener.h" |
---|
| 46 | include "logic.h" |
---|
| 47 | include "description.h" |
---|
| 48 | include "iniprint.h" |
---|
[524] | 49 | |
---|
| 50 | C Arguments |
---|
| 51 | C |
---|
[1279] | 52 | integer day0, anne0 |
---|
[524] | 53 | real tstep, t_ops, t_wrt |
---|
| 54 | |
---|
[1279] | 55 | #ifdef CPP_IOIPSL |
---|
| 56 | ! This routine needs IOIPSL to work |
---|
[524] | 57 | C Variables locales |
---|
| 58 | C |
---|
| 59 | integer tau0 |
---|
| 60 | real zjulian |
---|
| 61 | integer iq |
---|
| 62 | real rlong(iip1,jjp1), rlat(iip1,jjp1) |
---|
| 63 | integer uhoriid, vhoriid, thoriid, zvertiid |
---|
| 64 | integer ii,jj |
---|
| 65 | integer zan, dayref |
---|
| 66 | C |
---|
| 67 | C Initialisations |
---|
| 68 | C |
---|
| 69 | pi = 4. * atan (1.) |
---|
| 70 | C |
---|
| 71 | C Appel a histbeg: creation du fichier netcdf et initialisations diverses |
---|
| 72 | C |
---|
| 73 | |
---|
| 74 | zan = anne0 |
---|
| 75 | dayref = day0 |
---|
| 76 | CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) |
---|
| 77 | tau0 = itau_dyn |
---|
| 78 | |
---|
[1403] | 79 | ! ------------------------------------------------------------- |
---|
| 80 | ! Creation des 3 fichiers pour les grilles horizontales U,V,Scal |
---|
| 81 | ! ------------------------------------------------------------- |
---|
| 82 | !Grille U |
---|
[524] | 83 | do jj = 1, jjp1 |
---|
| 84 | do ii = 1, iip1 |
---|
| 85 | rlong(ii,jj) = rlonu(ii) * 180. / pi |
---|
| 86 | rlat(ii,jj) = rlatu(jj) * 180. / pi |
---|
| 87 | enddo |
---|
| 88 | enddo |
---|
| 89 | |
---|
[1403] | 90 | call histbeg(dynhistu_file, iip1, rlong(:,1), jjp1, rlat(1,:), |
---|
[524] | 91 | . 1, iip1, 1, jjp1, |
---|
[1403] | 92 | . tau0, zjulian, tstep, uhoriid, histuid) |
---|
[524] | 93 | |
---|
[1403] | 94 | ! Grille V |
---|
[524] | 95 | do jj = 1, jjm |
---|
| 96 | do ii = 1, iip1 |
---|
| 97 | rlong(ii,jj) = rlonv(ii) * 180. / pi |
---|
| 98 | rlat(ii,jj) = rlatv(jj) * 180. / pi |
---|
| 99 | enddo |
---|
| 100 | enddo |
---|
| 101 | |
---|
[1403] | 102 | call histbeg(dynhistv_file, iip1, rlong(:,1), jjm, rlat(1,:), |
---|
[524] | 103 | . 1, iip1, 1, jjm, |
---|
[1403] | 104 | . tau0, zjulian, tstep, vhoriid, histvid) |
---|
| 105 | |
---|
| 106 | !Grille Scalaire |
---|
[524] | 107 | do jj = 1, jjp1 |
---|
| 108 | do ii = 1, iip1 |
---|
| 109 | rlong(ii,jj) = rlonv(ii) * 180. / pi |
---|
| 110 | rlat(ii,jj) = rlatu(jj) * 180. / pi |
---|
| 111 | enddo |
---|
| 112 | enddo |
---|
| 113 | |
---|
[1403] | 114 | call histbeg(dynhist_file, iip1, rlong(:,1), jjp1, rlat(1,:), |
---|
| 115 | . 1, iip1, 1, jjp1, |
---|
| 116 | . tau0, zjulian, tstep, thoriid, histid) |
---|
| 117 | ! ------------------------------------------------------------- |
---|
[524] | 118 | C Appel a histvert pour la grille verticale |
---|
[1403] | 119 | ! ------------------------------------------------------------- |
---|
| 120 | call histvert(histid, 'presnivs', 'Niveaux pression','mb', |
---|
| 121 | . llm, presnivs/100., zvertiid,'down') |
---|
| 122 | call histvert(histvid, 'presnivs', 'Niveaux pression','mb', |
---|
| 123 | . llm, presnivs/100., zvertiid,'down') |
---|
| 124 | call histvert(histuid, 'presnivs', 'Niveaux pression','mb', |
---|
| 125 | . llm, presnivs/100., zvertiid,'down') |
---|
[524] | 126 | C |
---|
[1403] | 127 | ! ------------------------------------------------------------- |
---|
[524] | 128 | C Appels a histdef pour la definition des variables a sauvegarder |
---|
[1403] | 129 | ! ------------------------------------------------------------- |
---|
[524] | 130 | C |
---|
| 131 | C Vents U |
---|
| 132 | C |
---|
[1403] | 133 | call histdef(histuid, 'u', 'vent u', 'm/s', |
---|
[524] | 134 | . iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, |
---|
| 135 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 136 | C |
---|
| 137 | C Vents V |
---|
| 138 | C |
---|
[1403] | 139 | call histdef(histvid, 'v', 'vent v', 'm/s', |
---|
[524] | 140 | . iip1, jjm, vhoriid, llm, 1, llm, zvertiid, |
---|
| 141 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 142 | |
---|
| 143 | C |
---|
| 144 | C Temperature potentielle |
---|
| 145 | C |
---|
[1403] | 146 | call histdef(histid, 'teta', 'temperature potentielle', '-', |
---|
[524] | 147 | . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, |
---|
| 148 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 149 | C |
---|
| 150 | C Geopotentiel |
---|
| 151 | C |
---|
[1403] | 152 | call histdef(histid, 'phi', 'geopotentiel', '-', |
---|
[524] | 153 | . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, |
---|
| 154 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 155 | C |
---|
| 156 | C Traceurs |
---|
| 157 | C |
---|
[1403] | 158 | ! |
---|
| 159 | ! DO iq=1,nqtot |
---|
| 160 | ! call histdef(histid, ttext(iq), ttext(iq), '-', |
---|
| 161 | ! . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, |
---|
| 162 | ! . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 163 | ! enddo |
---|
| 164 | !C |
---|
[524] | 165 | C Masse |
---|
| 166 | C |
---|
[1403] | 167 | call histdef(histid, 'masse', 'masse', 'kg', |
---|
| 168 | . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, |
---|
[524] | 169 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 170 | C |
---|
| 171 | C Pression au sol |
---|
| 172 | C |
---|
[1403] | 173 | call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', |
---|
[524] | 174 | . iip1, jjp1, thoriid, 1, 1, 1, -99, |
---|
| 175 | . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 176 | C |
---|
[1403] | 177 | C Geopotentiel au sol |
---|
| 178 | !C |
---|
| 179 | ! call histdef(histid, 'phis', 'geopotentiel au sol', '-', |
---|
| 180 | ! . iip1, jjp1, thoriid, 1, 1, 1, -99, |
---|
| 181 | ! . 32, 'inst(X)', t_ops, t_wrt) |
---|
| 182 | !C |
---|
[524] | 183 | C Fin |
---|
| 184 | C |
---|
[1403] | 185 | call histend(histid) |
---|
| 186 | call histend(histuid) |
---|
| 187 | call histend(histvid) |
---|
[1279] | 188 | #else |
---|
| 189 | ! tell the user this routine should be run with ioipsl |
---|
| 190 | write(lunout,*)"inithist: Warning this routine should not be", |
---|
| 191 | & " used without ioipsl" |
---|
| 192 | #endif |
---|
| 193 | ! of #ifdef CPP_IOIPSL |
---|
[524] | 194 | return |
---|
| 195 | end |
---|