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