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