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