| [524] | 1 | ! |
|---|
| 2 | ! $Header$ |
|---|
| 3 | ! |
|---|
| 4 | C |
|---|
| 5 | C |
|---|
| 6 | subroutine initphysto |
|---|
| 7 | . (infile, |
|---|
| 8 | . rlon, rlat, tstep,t_ops,t_wrt,nq,fileid) |
|---|
| 9 | |
|---|
| 10 | USE IOIPSL |
|---|
| 11 | |
|---|
| 12 | implicit none |
|---|
| 13 | |
|---|
| 14 | C |
|---|
| 15 | C Routine d'initialisation des ecritures des fichiers histoires LMDZ |
|---|
| 16 | C au format IOIPSL |
|---|
| 17 | C |
|---|
| 18 | C Appels succesifs des routines: histbeg |
|---|
| 19 | C histhori |
|---|
| 20 | C histver |
|---|
| 21 | C histdef |
|---|
| 22 | C histend |
|---|
| 23 | C |
|---|
| 24 | C Entree: |
|---|
| 25 | C |
|---|
| 26 | C infile: nom du fichier histoire a creer |
|---|
| 27 | C day0,anne0: date de reference |
|---|
| 28 | C tstep: duree du pas de temps en seconde |
|---|
| 29 | C t_ops: frequence de l'operation pour IOIPSL |
|---|
| 30 | C t_wrt: frequence d'ecriture sur le fichier |
|---|
| 31 | C nq: nombre de traceurs |
|---|
| 32 | C |
|---|
| 33 | C Sortie: |
|---|
| 34 | C fileid: ID du fichier netcdf cree |
|---|
| 35 | C filevid:ID du fichier netcdf pour la grille v |
|---|
| 36 | C |
|---|
| 37 | C L. Fairhead, LMD, 03/99 |
|---|
| 38 | C |
|---|
| 39 | C ===================================================================== |
|---|
| 40 | C |
|---|
| 41 | C Declarations |
|---|
| 42 | #include "dimensions.h" |
|---|
| 43 | #include "paramet.h" |
|---|
| 44 | #include "comconst.h" |
|---|
| 45 | #include "comgeom.h" |
|---|
| 46 | #include "temps.h" |
|---|
| 47 | #include "ener.h" |
|---|
| 48 | #include "logic.h" |
|---|
| 49 | #include "description.h" |
|---|
| 50 | #include "serre.h" |
|---|
| 51 | #include "indicesol.h" |
|---|
| 52 | #include "control.h" |
|---|
| 53 | #include "dimphy.h" |
|---|
| 54 | |
|---|
| 55 | C Arguments |
|---|
| 56 | character*(*) infile |
|---|
| 57 | integer*4 nhoriid, i |
|---|
| 58 | real tstep, t_ops, t_wrt |
|---|
| 59 | integer fileid, filevid |
|---|
| 60 | integer nq,l |
|---|
| 61 | real nivsigs(llm) |
|---|
| 62 | |
|---|
| 63 | C Variables locales |
|---|
| 64 | C |
|---|
| 65 | integer tau0 |
|---|
| 66 | real zjulian |
|---|
| 67 | character*3 str |
|---|
| 68 | character*10 ctrac |
|---|
| 69 | integer iq |
|---|
| 70 | integer uhoriid, vhoriid, thoriid, zvertiid |
|---|
| 71 | integer ii,jj |
|---|
| 72 | integer zan, idayref |
|---|
| 73 | logical ok_sync |
|---|
| 74 | REAL zx_lon(iim,jjm+1), zx_lat(iim,jjm+1) |
|---|
| 75 | C |
|---|
| 76 | REAL rlon(klon), rlat(klon) |
|---|
| 77 | |
|---|
| 78 | C Initialisations |
|---|
| 79 | C |
|---|
| 80 | pi = 4. * atan (1.) |
|---|
| 81 | str='q ' |
|---|
| 82 | ctrac = 'traceur ' |
|---|
| 83 | ok_sync= .true. |
|---|
| 84 | C |
|---|
| 85 | C Appel a histbeg: creation du fichier netcdf et initialisations diverses |
|---|
| 86 | C |
|---|
| 87 | |
|---|
| 88 | zan = annee_ref |
|---|
| 89 | idayref = day_ref |
|---|
| 90 | CALL ymds2ju(zan, 1, idayref, 0.0, zjulian) |
|---|
| 91 | tau0 = 0 |
|---|
| 92 | |
|---|
| 93 | CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlon,zx_lon) |
|---|
| 94 | DO i = 1, iim |
|---|
| 95 | zx_lon(i,1) = rlon(i+1) |
|---|
| 96 | zx_lon(i,jjm+1) = rlon(i+1) |
|---|
| 97 | ENDDO |
|---|
| 98 | CALL gr_fi_ecrit(1,klon,iim,jjm+1,rlat,zx_lat) |
|---|
| 99 | |
|---|
| 100 | |
|---|
| 101 | call histbeg(infile, iim, zx_lon(:,1), jjm+1, zx_lat(1,:), |
|---|
| 102 | . 1, iim, 1, jjm+1, |
|---|
| 103 | . tau0, zjulian, tstep, nhoriid, fileid) |
|---|
| 104 | |
|---|
| 105 | C Appel a histvert pour la grille verticale |
|---|
| 106 | C |
|---|
| 107 | DO l=1,llm |
|---|
| 108 | nivsigs(l)=float(l) |
|---|
| 109 | ENDDO |
|---|
| 110 | |
|---|
| 111 | write(*,*) 'avant histvert ds initphysto' |
|---|
| 112 | |
|---|
| 113 | call histvert(fileid, 'sig_s', 'Niveaux sigma', |
|---|
| 114 | . 'sigma_level', |
|---|
| 115 | . llm, nivsigs, zvertiid) |
|---|
| 116 | C |
|---|
| 117 | C Appels a histdef pour la definition des variables a sauvegarder |
|---|
| 118 | C |
|---|
| 119 | write(*,*) 'apres histvert ds initphysto' |
|---|
| 120 | |
|---|
| 121 | CALL histdef(fileid, "phis", "Surface geop. height", "-", |
|---|
| 122 | . iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
|---|
| 123 | . "once", t_ops, t_wrt) |
|---|
| 124 | c |
|---|
| 125 | write(*,*) 'apres phis ds initphysto' |
|---|
| 126 | |
|---|
| 127 | CALL histdef(fileid, "aire", "Grid area", "-", |
|---|
| 128 | . iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
|---|
| 129 | . "once", t_ops, t_wrt) |
|---|
| 130 | write(*,*) 'apres aire ds initphysto' |
|---|
| 131 | |
|---|
| 132 | CALL histdef(fileid, "dtime", "tps phys ", "s", |
|---|
| 133 | . 1,1,nhoriid, 1,1,1, -99, 32, |
|---|
| 134 | . "once", t_ops, t_wrt) |
|---|
| 135 | |
|---|
| 136 | CALL histdef(fileid, "istphy", "tps stock", "s", |
|---|
| 137 | . 1,1,nhoriid, 1,1,1, -99, 32, |
|---|
| 138 | . "once", t_ops, t_wrt) |
|---|
| 139 | |
|---|
| 140 | C T |
|---|
| 141 | C |
|---|
| 142 | call histdef(fileid, 't', 'Temperature', 'K', |
|---|
| 143 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 144 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 145 | write(*,*) 'apres t ds initphysto' |
|---|
| 146 | C mfu |
|---|
| 147 | C |
|---|
| 148 | call histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s', |
|---|
| 149 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 150 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 151 | write(*,*) 'apres mfu ds initphysto' |
|---|
| 152 | C |
|---|
| 153 | C mfd |
|---|
| 154 | C |
|---|
| 155 | call histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s', |
|---|
| 156 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 157 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 158 | |
|---|
| 159 | C |
|---|
| 160 | C en_u |
|---|
| 161 | C |
|---|
| 162 | call histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', |
|---|
| 163 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 164 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 165 | write(*,*) 'apres en_u ds initphysto' |
|---|
| 166 | C |
|---|
| 167 | C de_u |
|---|
| 168 | C |
|---|
| 169 | call histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s', |
|---|
| 170 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 171 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 172 | |
|---|
| 173 | C |
|---|
| 174 | C en_d |
|---|
| 175 | C |
|---|
| 176 | call histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', |
|---|
| 177 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 178 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 179 | C |
|---|
| 180 | |
|---|
| 181 | C |
|---|
| 182 | C de_d |
|---|
| 183 | C |
|---|
| 184 | call histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', |
|---|
| 185 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 186 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 187 | |
|---|
| 188 | c coefh frac_impa,frac_nucl |
|---|
| 189 | |
|---|
| [541] | 190 | call histdef(fileid, "coefh", " ", " ", |
|---|
| [524] | 191 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| [541] | 192 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 193 | |
|---|
| 194 | c abderrahmane le 16 09 02 |
|---|
| 195 | call histdef(fileid, "fm_th", " ", " ", |
|---|
| 196 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 197 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 198 | |
|---|
| 199 | call histdef(fileid, "en_th", " ", " ", |
|---|
| 200 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 201 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 202 | c fin aj |
|---|
| [524] | 203 | |
|---|
| 204 | write(*,*) 'apres coefh ds initphysto' |
|---|
| 205 | |
|---|
| 206 | call histdef(fileid, 'frac_impa', ' ', ' ', |
|---|
| 207 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 208 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 209 | |
|---|
| 210 | call histdef(fileid, 'frac_nucl', ' ', ' ', |
|---|
| 211 | . iim, jjm+1, nhoriid, llm, 1, llm, zvertiid, |
|---|
| 212 | . 32, 'inst(X)', t_ops, t_wrt) |
|---|
| 213 | |
|---|
| 214 | c |
|---|
| 215 | c pyu1 |
|---|
| 216 | c |
|---|
| 217 | CALL histdef(fileid, "pyu1", " ", " ", |
|---|
| 218 | . iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
|---|
| 219 | . "inst(X)", t_ops, t_wrt) |
|---|
| 220 | |
|---|
| 221 | c |
|---|
| 222 | c pyv1 |
|---|
| 223 | c |
|---|
| 224 | CALL histdef(fileid, "pyv1", " ", " ", |
|---|
| 225 | . iim,jjm+1,nhoriid, 1,1,1, -99, 32, |
|---|
| 226 | . "inst(X)", t_ops, t_wrt) |
|---|
| 227 | |
|---|
| 228 | write(*,*) 'apres pyv1 ds initphysto' |
|---|
| 229 | c |
|---|
| 230 | c ftsol1 |
|---|
| 231 | c |
|---|
| 232 | call histdef(fileid, "ftsol1", " ", " ", |
|---|
| 233 | . iim, jjm+1, nhoriid, 1, 1,1, -99,32, |
|---|
| 234 | . "inst(X)", t_ops, t_wrt) |
|---|
| 235 | |
|---|
| 236 | c |
|---|
| 237 | c ftsol2 |
|---|
| 238 | c |
|---|
| 239 | call histdef(fileid, "ftsol2", " ", " ", |
|---|
| 240 | . iim, jjm+1, nhoriid, 1, 1,1, -99,32, |
|---|
| 241 | . "inst(X)", t_ops, t_wrt) |
|---|
| 242 | |
|---|
| 243 | c |
|---|
| 244 | c ftsol3 |
|---|
| 245 | c |
|---|
| 246 | call histdef(fileid, "ftsol3", " ", " ", |
|---|
| 247 | . iim, jjm+1, nhoriid, 1, 1,1, -99, |
|---|
| 248 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 249 | |
|---|
| 250 | c |
|---|
| 251 | c ftsol4 |
|---|
| 252 | c |
|---|
| 253 | call histdef(fileid, "ftsol4", " ", " ", |
|---|
| 254 | . iim, jjm+1, nhoriid, 1, 1,1, -99, |
|---|
| 255 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 256 | |
|---|
| 257 | c |
|---|
| 258 | c rain |
|---|
| 259 | c |
|---|
| 260 | call histdef(fileid, "rain", " ", " ", |
|---|
| 261 | . iim, jjm+1, nhoriid, 1, 1,1, -99, |
|---|
| 262 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 263 | |
|---|
| 264 | c |
|---|
| 265 | c psrf1 |
|---|
| 266 | c |
|---|
| 267 | call histdef(fileid, "psrf1", " ", " ", |
|---|
| 268 | . iim, jjm+1, nhoriid, 1, 1, 1, -99, |
|---|
| 269 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 270 | |
|---|
| 271 | c |
|---|
| 272 | c psrf2 |
|---|
| 273 | c |
|---|
| 274 | call histdef(fileid, "psrf2", " ", " ", |
|---|
| 275 | . iim, jjm+1, nhoriid, 1, 1, 1, -99, |
|---|
| 276 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 277 | |
|---|
| 278 | c |
|---|
| 279 | c psrf3 |
|---|
| 280 | c |
|---|
| 281 | call histdef(fileid, "psrf3", " ", " ", |
|---|
| 282 | . iim, jjm+1, nhoriid, 1, 1, 1, -99, |
|---|
| 283 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 284 | |
|---|
| 285 | c |
|---|
| 286 | c psrf4 |
|---|
| 287 | c |
|---|
| 288 | call histdef(fileid, "psrf4", " ", " ", |
|---|
| 289 | . iim, jjm+1, nhoriid, 1, 1, 1, -99, |
|---|
| 290 | . 32, "inst(X)", t_ops, t_wrt) |
|---|
| 291 | |
|---|
| 292 | write(*,*) 'avant histend ds initphysto' |
|---|
| 293 | |
|---|
| 294 | call histend(fileid) |
|---|
| [541] | 295 | c if (ok_sync) call histsync(fileid) |
|---|
| 296 | if (ok_sync) call histsync |
|---|
| [524] | 297 | |
|---|
| 298 | |
|---|
| 299 | |
|---|
| 300 | return |
|---|
| 301 | end |
|---|