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