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