[135] | 1 | c======================================================================= |
---|
[711] | 2 | subroutine ini_archive(nid,idayref,phis,ith,tab_cntrl_fi, |
---|
| 3 | & tab_cntrl_dyn) |
---|
[135] | 4 | c======================================================================= |
---|
| 5 | c |
---|
| 6 | c |
---|
| 7 | c Date: 01/1997 |
---|
| 8 | c ---- |
---|
| 9 | c |
---|
| 10 | c Objet: ecriture de l'entete du fichier "start_archive" |
---|
| 11 | c ----- |
---|
| 12 | c |
---|
| 13 | c Proche de iniwrite.F |
---|
| 14 | c |
---|
| 15 | c On ajoute dans le tableau "tab_cntrl" (dynamique), a partir de 51, |
---|
| 16 | c les valeurs de tab_cntrl_fi (les 38 parametres de controle physiques |
---|
| 17 | c du RUN + ptotal et cotoicetotal) |
---|
| 18 | c |
---|
| 19 | c tab_cntrl(50+l)=tab_cntrl_fi(l) |
---|
| 20 | c |
---|
| 21 | c Arguments: |
---|
| 22 | c --------- |
---|
| 23 | c |
---|
| 24 | c Inputs: |
---|
| 25 | c ------ |
---|
| 26 | c |
---|
| 27 | c nid unite logique du fichier "start_archive" |
---|
| 28 | c idayref Valeur du jour initial a mettre dans |
---|
| 29 | c l'entete du fichier "start_archive" |
---|
| 30 | c phis geopotentiel au sol |
---|
| 31 | c ith soil thermal inertia |
---|
| 32 | c tab_cntrl_fi tableau des param physiques |
---|
| 33 | c |
---|
| 34 | |
---|
| 35 | c======================================================================= |
---|
| 36 | |
---|
| 37 | implicit none |
---|
| 38 | |
---|
| 39 | #include "dimensions.h" |
---|
| 40 | #include "dimphys.h" |
---|
| 41 | #include "paramet.h" |
---|
| 42 | #include "comconst.h" |
---|
| 43 | #include "comvert.h" |
---|
| 44 | #include "comgeom.h" |
---|
| 45 | #include "temps.h" |
---|
| 46 | #include "ener.h" |
---|
| 47 | #include "logic.h" |
---|
| 48 | #include "description.h" |
---|
| 49 | #include "serre.h" |
---|
| 50 | #include "control.h" |
---|
| 51 | #include"comsoil.h" |
---|
| 52 | |
---|
| 53 | #include "netcdf.inc" |
---|
| 54 | |
---|
| 55 | c----------------------------------------------------------------------- |
---|
| 56 | c Declarations |
---|
| 57 | c----------------------------------------------------------------------- |
---|
| 58 | |
---|
| 59 | c Local: |
---|
| 60 | c ------ |
---|
| 61 | INTEGER length,l |
---|
| 62 | parameter (length = 100) |
---|
| 63 | REAL tab_cntrl(length) ! tableau des parametres du run |
---|
| 64 | INTEGER loop |
---|
| 65 | INTEGER ierr, setvdim, putvdim, putdat, setname,cluvdb |
---|
| 66 | INTEGER setdim |
---|
| 67 | INTEGER ind1,indlast |
---|
| 68 | |
---|
| 69 | c Arguments: |
---|
| 70 | c ---------- |
---|
| 71 | INTEGER*4 idayref |
---|
| 72 | REAL phis(ip1jmp1) |
---|
| 73 | real ith(ip1jmp1,nsoilmx) |
---|
| 74 | REAL tab_cntrl_fi(length) |
---|
[711] | 75 | REAL tab_cntrl_dyn(length) |
---|
[135] | 76 | |
---|
| 77 | !Mars --------Ajouts----------- |
---|
| 78 | c Variables locales pour NetCDF: |
---|
| 79 | c |
---|
| 80 | INTEGER dims2(2), dims3(3) !, dims4(4) |
---|
| 81 | INTEGER idim_index |
---|
| 82 | INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv |
---|
| 83 | INTEGER idim_llmp1,idim_llm |
---|
| 84 | INTEGER idim_tim |
---|
| 85 | INTEGER idim_nsoilmx ! "subsurface_layers" dimension ID # |
---|
| 86 | INTEGER nid,nvarid |
---|
| 87 | real sig_s(llm),s(llm) |
---|
| 88 | |
---|
| 89 | pi = 2. * ASIN(1.) |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | c----------------------------------------------------------------------- |
---|
| 93 | c Remplissage du tableau des parametres de controle du RUN (dynamique) |
---|
| 94 | c----------------------------------------------------------------------- |
---|
| 95 | |
---|
| 96 | DO l=1,length |
---|
| 97 | tab_cntrl(l)=0. |
---|
| 98 | ENDDO |
---|
[711] | 99 | |
---|
| 100 | tab_cntrl(1:50)=tab_cntrl_dyn(1:50) |
---|
[135] | 101 | |
---|
| 102 | ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
[711] | 103 | ! tab_cntrl(1) = FLOAT(iim) ! nombre de points en longitude |
---|
| 104 | ! tab_cntrl(2) = FLOAT(jjm) ! nombre de points en latitude |
---|
| 105 | ! tab_cntrl(3) = FLOAT(llm) ! nombre de couches |
---|
| 106 | ! tab_cntrl(4) = FLOAT(idayref) ! jour 0 |
---|
| 107 | ! tab_cntrl(5) = rad ! rayon de mars(m) ~3397200 |
---|
| 108 | ! tab_cntrl(6) = omeg ! vitesse de rotation (rad.s-1) |
---|
| 109 | ! tab_cntrl(7) = g ! gravite (m.s-2) ~3.72 |
---|
| 110 | ! tab_cntrl(8) = cpp |
---|
| 111 | ! tab_cntrl(8) = 43.49 !mars temporaire Masse molaire de l''atm (g.mol-1) ~43.49 |
---|
| 112 | ! tab_cntrl(9) = kappa ! = r/cp ~0.256793 (=rcp dans physique) |
---|
| 113 | ! tab_cntrl(10) = daysec ! duree du sol (s) ~88775 |
---|
| 114 | ! tab_cntrl(11) = dtvr ! pas de temps de la dynamique (s) |
---|
| 115 | ! tab_cntrl(12) = etot0 ! energie totale ! |
---|
| 116 | ! tab_cntrl(13) = ptot0 ! pression totalei ! variables |
---|
| 117 | ! tab_cntrl(14) = ztot0 ! enstrophie totale ! de controle |
---|
| 118 | ! tab_cntrl(15) = stot0 ! enthalpie totale ! globales |
---|
| 119 | ! tab_cntrl(16) = ang0 ! moment cinetique ! |
---|
| 120 | ! tab_cntrl(17) = pa |
---|
| 121 | ! tab_cntrl(18) = preff |
---|
[135] | 122 | |
---|
| 123 | c ..... parametres pour le zoom ...... |
---|
| 124 | |
---|
[711] | 125 | ! tab_cntrl(19) = clon ! longitude en degres du centre du zoom |
---|
| 126 | ! tab_cntrl(20) = clat ! latitude en degres du centre du zoom |
---|
| 127 | ! tab_cntrl(21) = grossismx ! facteur de grossissement du zoom,selon longitude |
---|
| 128 | ! tab_cntrl(22) = grossismy ! facteur de grossissement du zoom ,selon latitude |
---|
[135] | 129 | |
---|
[711] | 130 | ! IF ( fxyhypb ) THEN |
---|
| 131 | ! tab_cntrl(23) = 1. |
---|
| 132 | ! tab_cntrl(24) = dzoomx ! extension en longitude de la zone du zoom |
---|
| 133 | ! tab_cntrl(25) = dzoomy ! extension en latitude de la zone du zoom |
---|
| 134 | ! ELSE |
---|
| 135 | ! tab_cntrl(23) = 0. |
---|
| 136 | ! tab_cntrl(24) = dzoomx ! extension en longitude de la zone du zoom |
---|
| 137 | ! tab_cntrl(25) = dzoomy ! extension en latitude de la zone du zoom |
---|
| 138 | ! tab_cntrl(26) = 0. |
---|
| 139 | ! IF ( ysinus) tab_cntrl(26) = 1. |
---|
| 140 | ! ENDIF |
---|
[135] | 141 | |
---|
| 142 | c----------------------------------------------------------------------- |
---|
| 143 | c Copie du tableau des parametres de controle du RUN (physique) |
---|
[711] | 144 | c dans le tableau tab_cntrl |
---|
[135] | 145 | c----------------------------------------------------------------------- |
---|
| 146 | |
---|
| 147 | DO l=1,50 |
---|
| 148 | tab_cntrl(50+l)=tab_cntrl_fi(l) |
---|
| 149 | ENDDO |
---|
| 150 | |
---|
| 151 | c======================================================================= |
---|
| 152 | c Ecriture NetCDF de l''entete du fichier "start_archive" |
---|
| 153 | c======================================================================= |
---|
| 154 | |
---|
| 155 | c |
---|
| 156 | c Preciser quelques attributs globaux: |
---|
| 157 | c |
---|
| 158 | ierr = NF_PUT_ATT_TEXT (nid, NF_GLOBAL, "title", 21, |
---|
| 159 | & "Fichier start_archive") |
---|
| 160 | c |
---|
| 161 | c Definir les dimensions du fichiers: |
---|
| 162 | c |
---|
| 163 | c CHAMPS AJOUTES POUR LA VISUALISATION T,ps, etc... avec Grads ou ferret: |
---|
| 164 | ierr = NF_DEF_DIM (nid, "latitude", jjp1, idim_rlatu) |
---|
| 165 | ierr = NF_DEF_DIM (nid, "longitude", iip1, idim_rlonv) |
---|
| 166 | ierr = NF_DEF_DIM (nid, "altitude", llm, idim_llm) |
---|
| 167 | ierr = NF_DEF_DIM (nid,"subsurface_layers",nsoilmx,idim_nsoilmx) |
---|
| 168 | |
---|
| 169 | ierr = NF_DEF_DIM (nid,"index", length, idim_index) |
---|
| 170 | ierr = NF_DEF_DIM (nid,"rlonu", iip1, idim_rlonu) |
---|
| 171 | ierr = NF_DEF_DIM (nid,"rlatv", jjm, idim_rlatv) |
---|
| 172 | ierr = NF_DEF_DIM (nid,"interlayer", llmp1, idim_llmp1) |
---|
| 173 | ierr = NF_DEF_DIM (nid,"Time", NF_UNLIMITED, idim_tim) |
---|
| 174 | |
---|
| 175 | c |
---|
| 176 | ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
---|
| 177 | |
---|
| 178 | c----------------------------------------------------------------------- |
---|
| 179 | c Ecriture du tableau des parametres du run |
---|
| 180 | c----------------------------------------------------------------------- |
---|
| 181 | |
---|
| 182 | call def_var(nid,"Time","Time","days since 00:00:00",1, |
---|
| 183 | . idim_tim,nvarid,ierr) |
---|
| 184 | |
---|
| 185 | ierr = NF_REDEF (nid) |
---|
| 186 | #ifdef NC_DOUBLE |
---|
| 187 | ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1,idim_index,nvarid) |
---|
| 188 | #else |
---|
| 189 | ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1,idim_index,nvarid) |
---|
| 190 | #endif |
---|
| 191 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 192 | . "Parametres de controle") |
---|
| 193 | ierr = NF_ENDDEF(nid) |
---|
| 194 | #ifdef NC_DOUBLE |
---|
| 195 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
| 196 | #else |
---|
| 197 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
| 198 | #endif |
---|
| 199 | |
---|
| 200 | c----------------------------------------------------------------------- |
---|
| 201 | c Ecriture des longitudes et latitudes |
---|
| 202 | c----------------------------------------------------------------------- |
---|
| 203 | |
---|
| 204 | ierr = NF_REDEF (nid) |
---|
| 205 | #ifdef NC_DOUBLE |
---|
| 206 | ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1,idim_rlonu,nvarid) |
---|
| 207 | #else |
---|
| 208 | ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1,idim_rlonu,nvarid) |
---|
| 209 | #endif |
---|
| 210 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
| 211 | . "Longitudes des points U") |
---|
| 212 | ierr = NF_ENDDEF(nid) |
---|
| 213 | #ifdef NC_DOUBLE |
---|
| 214 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) |
---|
| 215 | #else |
---|
| 216 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) |
---|
| 217 | #endif |
---|
| 218 | c |
---|
| 219 | ierr = NF_REDEF (nid) |
---|
| 220 | #ifdef NC_DOUBLE |
---|
| 221 | ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1,idim_rlatu,nvarid) |
---|
| 222 | #else |
---|
| 223 | ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1,idim_rlatu,nvarid) |
---|
| 224 | #endif |
---|
| 225 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 226 | . "Latitudes des points U") |
---|
| 227 | ierr = NF_ENDDEF(nid) |
---|
| 228 | #ifdef NC_DOUBLE |
---|
| 229 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) |
---|
| 230 | #else |
---|
| 231 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) |
---|
| 232 | #endif |
---|
| 233 | c |
---|
| 234 | ierr = NF_REDEF (nid) |
---|
| 235 | #ifdef NC_DOUBLE |
---|
| 236 | ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1,idim_rlonv,nvarid) |
---|
| 237 | #else |
---|
| 238 | ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1,idim_rlonv,nvarid) |
---|
| 239 | #endif |
---|
| 240 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
| 241 | . "Longitudes des points V") |
---|
| 242 | ierr = NF_ENDDEF(nid) |
---|
| 243 | #ifdef NC_DOUBLE |
---|
| 244 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) |
---|
| 245 | #else |
---|
| 246 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) |
---|
| 247 | #endif |
---|
| 248 | c |
---|
| 249 | ierr = NF_REDEF (nid) |
---|
| 250 | #ifdef NC_DOUBLE |
---|
| 251 | ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1,idim_rlatv,nvarid) |
---|
| 252 | #else |
---|
| 253 | ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1,idim_rlatv,nvarid) |
---|
| 254 | #endif |
---|
| 255 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 256 | . "Latitudes des points V") |
---|
| 257 | ierr = NF_ENDDEF(nid) |
---|
| 258 | #ifdef NC_DOUBLE |
---|
| 259 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) |
---|
| 260 | #else |
---|
| 261 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) |
---|
| 262 | #endif |
---|
| 263 | |
---|
| 264 | c----------------------------------------------------------------------- |
---|
| 265 | c Ecriture des niveaux verticaux |
---|
| 266 | c----------------------------------------------------------------------- |
---|
| 267 | |
---|
| 268 | c |
---|
| 269 | ierr = NF_REDEF (nid) |
---|
| 270 | #ifdef NC_DOUBLE |
---|
| 271 | ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1,idim_llmp1,nvarid) |
---|
| 272 | #else |
---|
| 273 | ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1,idim_llmp1,nvarid) |
---|
| 274 | #endif |
---|
| 275 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, |
---|
| 276 | . "Coef A: niveaux pression hybride") |
---|
| 277 | ierr = NF_ENDDEF(nid) |
---|
| 278 | #ifdef NC_DOUBLE |
---|
| 279 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) |
---|
| 280 | #else |
---|
| 281 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) |
---|
| 282 | #endif |
---|
| 283 | c |
---|
| 284 | ierr = NF_REDEF (nid) |
---|
| 285 | #ifdef NC_DOUBLE |
---|
| 286 | ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1,idim_llmp1,nvarid) |
---|
| 287 | #else |
---|
| 288 | ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1,idim_llmp1,nvarid) |
---|
| 289 | #endif |
---|
| 290 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 35, |
---|
| 291 | . "Coefficient B niveaux sigma hybride") |
---|
| 292 | ierr = NF_ENDDEF(nid) |
---|
| 293 | #ifdef NC_DOUBLE |
---|
| 294 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) |
---|
| 295 | #else |
---|
| 296 | ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) |
---|
| 297 | #endif |
---|
| 298 | c |
---|
| 299 | c ---------------------- |
---|
| 300 | ierr = NF_REDEF (nid) |
---|
| 301 | #ifdef NC_DOUBLE |
---|
| 302 | ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,idim_llm,nvarid) |
---|
| 303 | #else |
---|
| 304 | ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,idim_llm,nvarid) |
---|
| 305 | #endif |
---|
| 306 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 36, |
---|
| 307 | . "Coef AS: hybrid pressure in midlayers") |
---|
| 308 | ierr = NF_ENDDEF(nid) |
---|
| 309 | #ifdef NC_DOUBLE |
---|
| 310 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aps) |
---|
| 311 | #else |
---|
| 312 | ierr = NF_PUT_VAR_REAL (nid,nvarid,aps) |
---|
| 313 | #endif |
---|
| 314 | c |
---|
| 315 | c ---------------------- |
---|
| 316 | ierr = NF_REDEF (nid) |
---|
| 317 | #ifdef NC_DOUBLE |
---|
| 318 | ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,idim_llm,nvarid) |
---|
| 319 | #else |
---|
| 320 | ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,idim_llm,nvarid) |
---|
| 321 | #endif |
---|
| 322 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 30, |
---|
| 323 | . "Coef BS: hybrid sigma midlayers") |
---|
| 324 | ierr = NF_ENDDEF(nid) |
---|
| 325 | #ifdef NC_DOUBLE |
---|
| 326 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bps) |
---|
| 327 | #else |
---|
| 328 | ierr = NF_PUT_VAR_REAL (nid,nvarid,bps) |
---|
| 329 | #endif |
---|
| 330 | c |
---|
| 331 | c ---------------------- |
---|
| 332 | |
---|
| 333 | ierr = NF_REDEF (nid) |
---|
| 334 | #ifdef NC_DOUBLE |
---|
| 335 | ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1,idim_llm,nvarid) |
---|
| 336 | #else |
---|
| 337 | ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1,idim_llm,nvarid) |
---|
| 338 | #endif |
---|
| 339 | ierr = NF_ENDDEF(nid) |
---|
| 340 | #ifdef NC_DOUBLE |
---|
| 341 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) |
---|
| 342 | #else |
---|
| 343 | ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) |
---|
| 344 | #endif |
---|
| 345 | c ------------------------------------------------------------------ |
---|
| 346 | c Variable uniquement pour visualisation avec Grads ou Ferret |
---|
| 347 | c ------------------------------------------------------------------ |
---|
| 348 | ierr = NF_REDEF (nid) |
---|
| 349 | #ifdef NC_DOUBLE |
---|
| 350 | ierr = NF_DEF_VAR (nid,"latitude",NF_DOUBLE,1,idim_rlatu,nvarid) |
---|
| 351 | #else |
---|
| 352 | ierr = NF_DEF_VAR (nid,"latitude",NF_FLOAT,1,idim_rlatu,nvarid) |
---|
| 353 | #endif |
---|
| 354 | ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") |
---|
| 355 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, |
---|
| 356 | . "North latitude") |
---|
| 357 | ierr = NF_ENDDEF(nid) |
---|
| 358 | #ifdef NC_DOUBLE |
---|
| 359 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu/pi*180) |
---|
| 360 | #else |
---|
| 361 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu/pi*180) |
---|
| 362 | #endif |
---|
| 363 | c---------------------- |
---|
| 364 | ierr = NF_REDEF (nid) |
---|
| 365 | #ifdef NC_DOUBLE |
---|
| 366 | ierr =NF_DEF_VAR(nid,"longitude", NF_DOUBLE, 1, idim_rlonv,nvarid) |
---|
| 367 | #else |
---|
| 368 | ierr = NF_DEF_VAR(nid,"longitude", NF_FLOAT, 1, idim_rlonv,nvarid) |
---|
| 369 | #endif |
---|
| 370 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, |
---|
| 371 | . "East longitude") |
---|
| 372 | ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") |
---|
| 373 | ierr = NF_ENDDEF(nid) |
---|
| 374 | #ifdef NC_DOUBLE |
---|
| 375 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv/pi*180) |
---|
| 376 | #else |
---|
| 377 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv/pi*180) |
---|
| 378 | #endif |
---|
| 379 | c-------------------------- |
---|
| 380 | ierr = NF_REDEF (nid) |
---|
| 381 | #ifdef NC_DOUBLE |
---|
| 382 | ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, |
---|
| 383 | . idim_llm,nvarid) |
---|
| 384 | #else |
---|
| 385 | ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, |
---|
| 386 | . idim_llm,nvarid) |
---|
| 387 | #endif |
---|
| 388 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",10,"pseudo-alt") |
---|
| 389 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km") |
---|
| 390 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up") |
---|
| 391 | |
---|
| 392 | ierr = NF_ENDDEF(nid) |
---|
| 393 | #ifdef NC_DOUBLE |
---|
| 394 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pseudoalt) |
---|
| 395 | #else |
---|
| 396 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pseudoalt) |
---|
| 397 | #endif |
---|
| 398 | |
---|
| 399 | !------------------------------- |
---|
| 400 | ! (soil) depth variable mlayer() (known from comsoil.h) |
---|
| 401 | !------------------------------- |
---|
| 402 | ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode |
---|
| 403 | ! define variable |
---|
| 404 | #ifdef NC_DOUBLE |
---|
| 405 | ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1,idim_nsoilmx,nvarid) |
---|
| 406 | #else |
---|
| 407 | ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1,idim_nsoilmx,nvarid) |
---|
| 408 | #endif |
---|
| 409 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, |
---|
| 410 | . "Soil mid-layer depth") |
---|
| 411 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",1,"m") |
---|
| 412 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"positive",4,"down") |
---|
| 413 | ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode |
---|
| 414 | ! write variable |
---|
| 415 | #ifdef NC_DOUBLE |
---|
| 416 | ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,mlayer) |
---|
| 417 | #else |
---|
| 418 | ierr=NF_PUT_VAR_REAL (nid,nvarid,mlayer) |
---|
| 419 | #endif |
---|
| 420 | |
---|
| 421 | !--------------------- |
---|
| 422 | ! soil thermal inertia |
---|
| 423 | !--------------------- |
---|
| 424 | ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode |
---|
| 425 | dims3(1)=idim_rlonv |
---|
| 426 | dims3(2)=idim_rlatu |
---|
| 427 | dims3(3)=idim_nsoilmx |
---|
| 428 | ! define variable |
---|
| 429 | #ifdef NC_DOUBLE |
---|
| 430 | ierr=NF_DEF_VAR(nid,"inertiedat",NF_DOUBLE,3,dims3,nvarid) |
---|
| 431 | #else |
---|
| 432 | ierr=NF_DEF_VAR(nid,"inertiedat",NF_FLOAT,3,dims3,nvarid) |
---|
| 433 | #endif |
---|
| 434 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, |
---|
| 435 | & "Soil thermal inertia") |
---|
| 436 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",15, |
---|
| 437 | & "J.s-1/2.m-2.K-1") |
---|
| 438 | ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode |
---|
| 439 | ! write variable |
---|
| 440 | #ifdef NC_DOUBLE |
---|
| 441 | ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,ith) |
---|
| 442 | #else |
---|
| 443 | ierr=NF_PUT_VAR_REAL (nid,nvarid,ith) |
---|
| 444 | #endif |
---|
| 445 | |
---|
| 446 | c----------------------------------------------------------------------- |
---|
| 447 | c Ecriture aire et coefficients de passage cov. <-> contra. <--> naturel |
---|
| 448 | c----------------------------------------------------------------------- |
---|
| 449 | |
---|
| 450 | ierr = NF_REDEF (nid) |
---|
| 451 | dims2(1) = idim_rlonu |
---|
| 452 | dims2(2) = idim_rlatu |
---|
| 453 | #ifdef NC_DOUBLE |
---|
| 454 | ierr = NF_DEF_VAR (nid,"cu",NF_DOUBLE,2,dims2,nvarid) |
---|
| 455 | #else |
---|
| 456 | ierr = NF_DEF_VAR (nid,"cu",NF_FLOAT,2,dims2,nvarid) |
---|
| 457 | #endif |
---|
| 458 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
| 459 | . "Coefficient de passage pour U") |
---|
| 460 | ierr = NF_ENDDEF(nid) |
---|
| 461 | #ifdef NC_DOUBLE |
---|
| 462 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) |
---|
| 463 | #else |
---|
| 464 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) |
---|
| 465 | #endif |
---|
| 466 | c |
---|
| 467 | ierr = NF_REDEF (nid) |
---|
| 468 | dims2(1) = idim_rlonv |
---|
| 469 | dims2(2) = idim_rlatv |
---|
| 470 | #ifdef NC_DOUBLE |
---|
| 471 | ierr = NF_DEF_VAR (nid,"cv",NF_DOUBLE,2,dims2,nvarid) |
---|
| 472 | #else |
---|
| 473 | ierr = NF_DEF_VAR (nid,"cv",NF_FLOAT,2,dims2,nvarid) |
---|
| 474 | #endif |
---|
| 475 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
| 476 | . "Coefficient de passage pour V") |
---|
| 477 | ierr = NF_ENDDEF(nid) |
---|
| 478 | #ifdef NC_DOUBLE |
---|
| 479 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) |
---|
| 480 | #else |
---|
| 481 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) |
---|
| 482 | #endif |
---|
| 483 | c |
---|
| 484 | c Aire de chaque maille: |
---|
| 485 | c |
---|
| 486 | ierr = NF_REDEF (nid) |
---|
| 487 | dims2(1) = idim_rlonv |
---|
| 488 | dims2(2) = idim_rlatu |
---|
| 489 | #ifdef NC_DOUBLE |
---|
| 490 | ierr = NF_DEF_VAR (nid,"aire",NF_DOUBLE,2,dims2,nvarid) |
---|
| 491 | #else |
---|
| 492 | ierr = NF_DEF_VAR (nid,"aire",NF_FLOAT,2,dims2,nvarid) |
---|
| 493 | #endif |
---|
| 494 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 495 | . "Aires de chaque maille") |
---|
| 496 | ierr = NF_ENDDEF(nid) |
---|
| 497 | #ifdef NC_DOUBLE |
---|
| 498 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) |
---|
| 499 | #else |
---|
| 500 | ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) |
---|
| 501 | #endif |
---|
| 502 | |
---|
| 503 | c----------------------------------------------------------------------- |
---|
| 504 | c Ecriture du geopentiel au sol |
---|
| 505 | c----------------------------------------------------------------------- |
---|
| 506 | |
---|
| 507 | ierr = NF_REDEF (nid) |
---|
| 508 | dims2(1) = idim_rlonv |
---|
| 509 | dims2(2) = idim_rlatu |
---|
| 510 | #ifdef NC_DOUBLE |
---|
| 511 | ierr = NF_DEF_VAR (nid,"phisinit",NF_DOUBLE,2,dims2,nvarid) |
---|
| 512 | #else |
---|
| 513 | ierr = NF_DEF_VAR (nid,"phisinit",NF_FLOAT,2,dims2,nvarid) |
---|
| 514 | #endif |
---|
| 515 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, |
---|
| 516 | . "Geopotentiel au sol") |
---|
| 517 | ierr = NF_ENDDEF(nid) |
---|
| 518 | #ifdef NC_DOUBLE |
---|
| 519 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) |
---|
| 520 | #else |
---|
| 521 | ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) |
---|
| 522 | #endif |
---|
| 523 | |
---|
[711] | 524 | PRINT*,'ini_archive: iim,jjm,llm,idayref',iim,jjm,llm,idayref |
---|
| 525 | PRINT*,'ini_archive: rad,omeg,g,mugaz,kappa', |
---|
| 526 | s rad,omeg,g,tab_cntrl_fi(8),kappa |
---|
| 527 | PRINT*,'ini_archive: daysec,dtvr',daysec,dtvr |
---|
[135] | 528 | |
---|
| 529 | RETURN |
---|
| 530 | END |
---|