[38] | 1 | c======================================================================= |
---|
[2913] | 2 | subroutine ini_archive(nid,idayref,phis,ith,tab_cntrl_fi |
---|
| 3 | & ,def_slope,subslope_dist) |
---|
[38] | 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 | |
---|
[1047] | 37 | use comsoil_h, only: nsoilmx, mlayer |
---|
[1422] | 38 | USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff,presnivs,pseudoalt |
---|
| 39 | USE comconst_mod, ONLY: daysec,dtvr,rad,omeg,g,cpp,kappa,pi |
---|
| 40 | USE logic_mod, ONLY: fxyhypb,ysinus |
---|
| 41 | USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy |
---|
| 42 | USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 |
---|
[2913] | 43 | use comslope_mod, ONLY: nslope |
---|
[38] | 44 | implicit none |
---|
| 45 | |
---|
| 46 | #include "dimensions.h" |
---|
| 47 | #include "paramet.h" |
---|
| 48 | #include "comgeom.h" |
---|
| 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) |
---|
[2913] | 70 | real subslope_dist(ip1jmp1,nslope) |
---|
| 71 | real def_slope(nslope+1) |
---|
[38] | 72 | REAL tab_cntrl_fi(length) |
---|
| 73 | |
---|
| 74 | !Mars --------Ajouts----------- |
---|
| 75 | c Variables locales pour NetCDF: |
---|
| 76 | c |
---|
| 77 | INTEGER dims2(2), dims3(3) !, dims4(4) |
---|
| 78 | INTEGER idim_index |
---|
| 79 | INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv |
---|
| 80 | INTEGER idim_llmp1,idim_llm |
---|
| 81 | INTEGER idim_tim |
---|
| 82 | INTEGER idim_nsoilmx ! "subsurface_layers" dimension ID # |
---|
[2913] | 83 | INTEGER idim_nslope, idim_nslope_p1 |
---|
[38] | 84 | INTEGER nid,nvarid |
---|
| 85 | real sig_s(llm),s(llm) |
---|
| 86 | |
---|
| 87 | pi = 2. * ASIN(1.) |
---|
| 88 | |
---|
| 89 | |
---|
| 90 | c----------------------------------------------------------------------- |
---|
| 91 | c Remplissage du tableau des parametres de controle du RUN (dynamique) |
---|
| 92 | c----------------------------------------------------------------------- |
---|
| 93 | |
---|
| 94 | DO l=1,length |
---|
| 95 | tab_cntrl(l)=0. |
---|
| 96 | ENDDO |
---|
| 97 | |
---|
| 98 | ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
---|
| 99 | tab_cntrl(1) = REAL(iim) ! nombre de points en longitude |
---|
| 100 | tab_cntrl(2) = REAL(jjm) ! nombre de points en latitude |
---|
| 101 | tab_cntrl(3) = REAL(llm) ! nombre de couches |
---|
| 102 | tab_cntrl(4) = REAL(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 |
---|
| 118 | |
---|
| 119 | c ..... parametres pour le zoom ...... |
---|
| 120 | |
---|
| 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 |
---|
| 125 | |
---|
| 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 |
---|
| 137 | |
---|
| 138 | c----------------------------------------------------------------------- |
---|
| 139 | c Copie du tableau des parametres de controle du RUN (physique) |
---|
| 140 | c dans le tableau dynamique |
---|
| 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) |
---|
[2913] | 170 | ierr = NF_DEF_DIM (nid,"nslope", nslope, idim_nslope) |
---|
| 171 | ierr = NF_DEF_DIM (nid,"nslope_plus_1",nslope+1,idim_nslope_p1) |
---|
[38] | 172 | |
---|
| 173 | c |
---|
| 174 | ierr = NF_ENDDEF(nid) ! sortir du mode de definition |
---|
| 175 | |
---|
| 176 | c----------------------------------------------------------------------- |
---|
| 177 | c Ecriture du tableau des parametres du run |
---|
| 178 | c----------------------------------------------------------------------- |
---|
| 179 | |
---|
| 180 | call def_var(nid,"Time","Time","days since 00:00:00",1, |
---|
| 181 | . idim_tim,nvarid,ierr) |
---|
| 182 | |
---|
| 183 | ierr = NF_REDEF (nid) |
---|
| 184 | #ifdef NC_DOUBLE |
---|
[2573] | 185 | ierr = NF_DEF_VAR (nid,"controle",NF_DOUBLE,1,[idim_index],nvarid) |
---|
[38] | 186 | #else |
---|
[2573] | 187 | ierr = NF_DEF_VAR (nid,"controle",NF_FLOAT,1,[idim_index],nvarid) |
---|
[38] | 188 | #endif |
---|
| 189 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 190 | . "Parametres de controle") |
---|
| 191 | ierr = NF_ENDDEF(nid) |
---|
| 192 | #ifdef NC_DOUBLE |
---|
| 193 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,tab_cntrl) |
---|
| 194 | #else |
---|
| 195 | ierr = NF_PUT_VAR_REAL (nid,nvarid,tab_cntrl) |
---|
| 196 | #endif |
---|
| 197 | |
---|
| 198 | c----------------------------------------------------------------------- |
---|
| 199 | c Ecriture des longitudes et latitudes |
---|
| 200 | c----------------------------------------------------------------------- |
---|
| 201 | |
---|
| 202 | ierr = NF_REDEF (nid) |
---|
| 203 | #ifdef NC_DOUBLE |
---|
[2573] | 204 | ierr = NF_DEF_VAR (nid,"rlonu",NF_DOUBLE,1,[idim_rlonu],nvarid) |
---|
[38] | 205 | #else |
---|
[2573] | 206 | ierr = NF_DEF_VAR (nid,"rlonu",NF_FLOAT,1,[idim_rlonu],nvarid) |
---|
[38] | 207 | #endif |
---|
| 208 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
| 209 | . "Longitudes des points U") |
---|
| 210 | ierr = NF_ENDDEF(nid) |
---|
| 211 | #ifdef NC_DOUBLE |
---|
| 212 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonu) |
---|
| 213 | #else |
---|
| 214 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonu) |
---|
| 215 | #endif |
---|
| 216 | c |
---|
| 217 | ierr = NF_REDEF (nid) |
---|
| 218 | #ifdef NC_DOUBLE |
---|
[2573] | 219 | ierr = NF_DEF_VAR (nid,"rlatu",NF_DOUBLE,1,[idim_rlatu],nvarid) |
---|
[38] | 220 | #else |
---|
[2573] | 221 | ierr = NF_DEF_VAR (nid,"rlatu",NF_FLOAT,1,[idim_rlatu],nvarid) |
---|
[38] | 222 | #endif |
---|
| 223 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 224 | . "Latitudes des points U") |
---|
| 225 | ierr = NF_ENDDEF(nid) |
---|
| 226 | #ifdef NC_DOUBLE |
---|
| 227 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu) |
---|
| 228 | #else |
---|
| 229 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu) |
---|
| 230 | #endif |
---|
| 231 | c |
---|
| 232 | ierr = NF_REDEF (nid) |
---|
| 233 | #ifdef NC_DOUBLE |
---|
[2573] | 234 | ierr = NF_DEF_VAR (nid,"rlonv",NF_DOUBLE,1,[idim_rlonv],nvarid) |
---|
[38] | 235 | #else |
---|
[2573] | 236 | ierr = NF_DEF_VAR (nid,"rlonv",NF_FLOAT,1,[idim_rlonv],nvarid) |
---|
[38] | 237 | #endif |
---|
| 238 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 23, |
---|
| 239 | . "Longitudes des points V") |
---|
| 240 | ierr = NF_ENDDEF(nid) |
---|
| 241 | #ifdef NC_DOUBLE |
---|
| 242 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv) |
---|
| 243 | #else |
---|
| 244 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv) |
---|
| 245 | #endif |
---|
| 246 | c |
---|
| 247 | ierr = NF_REDEF (nid) |
---|
| 248 | #ifdef NC_DOUBLE |
---|
[2573] | 249 | ierr = NF_DEF_VAR (nid,"rlatv",NF_DOUBLE,1,[idim_rlatv],nvarid) |
---|
[38] | 250 | #else |
---|
[2573] | 251 | ierr = NF_DEF_VAR (nid,"rlatv",NF_FLOAT,1,[idim_rlatv],nvarid) |
---|
[38] | 252 | #endif |
---|
| 253 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 254 | . "Latitudes des points V") |
---|
| 255 | ierr = NF_ENDDEF(nid) |
---|
| 256 | #ifdef NC_DOUBLE |
---|
| 257 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatv) |
---|
| 258 | #else |
---|
| 259 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatv) |
---|
| 260 | #endif |
---|
| 261 | |
---|
| 262 | c----------------------------------------------------------------------- |
---|
| 263 | c Ecriture des niveaux verticaux |
---|
| 264 | c----------------------------------------------------------------------- |
---|
| 265 | |
---|
| 266 | c |
---|
| 267 | ierr = NF_REDEF (nid) |
---|
| 268 | #ifdef NC_DOUBLE |
---|
[2573] | 269 | ierr = NF_DEF_VAR (nid,"ap",NF_DOUBLE,1,[idim_llmp1],nvarid) |
---|
[38] | 270 | #else |
---|
[2573] | 271 | ierr = NF_DEF_VAR (nid,"ap",NF_FLOAT,1,[idim_llmp1],nvarid) |
---|
[38] | 272 | #endif |
---|
| 273 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 32, |
---|
| 274 | . "Coef A: niveaux pression hybride") |
---|
| 275 | ierr = NF_ENDDEF(nid) |
---|
| 276 | #ifdef NC_DOUBLE |
---|
| 277 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,ap) |
---|
| 278 | #else |
---|
| 279 | ierr = NF_PUT_VAR_REAL (nid,nvarid,ap) |
---|
| 280 | #endif |
---|
| 281 | c |
---|
| 282 | ierr = NF_REDEF (nid) |
---|
| 283 | #ifdef NC_DOUBLE |
---|
[2573] | 284 | ierr = NF_DEF_VAR (nid,"bp",NF_DOUBLE,1,[idim_llmp1],nvarid) |
---|
[38] | 285 | #else |
---|
[2573] | 286 | ierr = NF_DEF_VAR (nid,"bp",NF_FLOAT,1,[idim_llmp1],nvarid) |
---|
[38] | 287 | #endif |
---|
| 288 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 35, |
---|
| 289 | . "Coefficient B niveaux sigma hybride") |
---|
| 290 | ierr = NF_ENDDEF(nid) |
---|
| 291 | #ifdef NC_DOUBLE |
---|
| 292 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bp) |
---|
| 293 | #else |
---|
| 294 | ierr = NF_PUT_VAR_REAL (nid,nvarid,bp) |
---|
| 295 | #endif |
---|
| 296 | c |
---|
| 297 | c ---------------------- |
---|
| 298 | ierr = NF_REDEF (nid) |
---|
| 299 | #ifdef NC_DOUBLE |
---|
[2573] | 300 | ierr = NF_DEF_VAR (nid,"aps",NF_DOUBLE,1,[idim_llm],nvarid) |
---|
[38] | 301 | #else |
---|
[2573] | 302 | ierr = NF_DEF_VAR (nid,"aps",NF_FLOAT,1,[idim_llm],nvarid) |
---|
[38] | 303 | #endif |
---|
| 304 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 36, |
---|
| 305 | . "Coef AS: hybrid pressure in midlayers") |
---|
| 306 | ierr = NF_ENDDEF(nid) |
---|
| 307 | #ifdef NC_DOUBLE |
---|
| 308 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aps) |
---|
| 309 | #else |
---|
| 310 | ierr = NF_PUT_VAR_REAL (nid,nvarid,aps) |
---|
| 311 | #endif |
---|
| 312 | c |
---|
| 313 | c ---------------------- |
---|
| 314 | ierr = NF_REDEF (nid) |
---|
| 315 | #ifdef NC_DOUBLE |
---|
[2573] | 316 | ierr = NF_DEF_VAR (nid,"bps",NF_DOUBLE,1,[idim_llm],nvarid) |
---|
[38] | 317 | #else |
---|
[2573] | 318 | ierr = NF_DEF_VAR (nid,"bps",NF_FLOAT,1,[idim_llm],nvarid) |
---|
[38] | 319 | #endif |
---|
| 320 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 30, |
---|
| 321 | . "Coef BS: hybrid sigma midlayers") |
---|
| 322 | ierr = NF_ENDDEF(nid) |
---|
| 323 | #ifdef NC_DOUBLE |
---|
| 324 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,bps) |
---|
| 325 | #else |
---|
| 326 | ierr = NF_PUT_VAR_REAL (nid,nvarid,bps) |
---|
| 327 | #endif |
---|
| 328 | c |
---|
| 329 | c ---------------------- |
---|
| 330 | |
---|
| 331 | ierr = NF_REDEF (nid) |
---|
| 332 | #ifdef NC_DOUBLE |
---|
[2573] | 333 | ierr = NF_DEF_VAR (nid,"presnivs",NF_DOUBLE,1,[idim_llm],nvarid) |
---|
[38] | 334 | #else |
---|
[2573] | 335 | ierr = NF_DEF_VAR (nid,"presnivs",NF_FLOAT,1,[idim_llm],nvarid) |
---|
[38] | 336 | #endif |
---|
| 337 | ierr = NF_ENDDEF(nid) |
---|
| 338 | #ifdef NC_DOUBLE |
---|
| 339 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,presnivs) |
---|
| 340 | #else |
---|
| 341 | ierr = NF_PUT_VAR_REAL (nid,nvarid,presnivs) |
---|
| 342 | #endif |
---|
| 343 | c ------------------------------------------------------------------ |
---|
| 344 | c Variable uniquement pour visualisation avec Grads ou Ferret |
---|
| 345 | c ------------------------------------------------------------------ |
---|
| 346 | ierr = NF_REDEF (nid) |
---|
| 347 | #ifdef NC_DOUBLE |
---|
[2573] | 348 | ierr = NF_DEF_VAR (nid,"latitude",NF_DOUBLE,1,[idim_rlatu],nvarid) |
---|
[38] | 349 | #else |
---|
[2573] | 350 | ierr = NF_DEF_VAR (nid,"latitude",NF_FLOAT,1,[idim_rlatu],nvarid) |
---|
[38] | 351 | #endif |
---|
| 352 | ierr =NF_PUT_ATT_TEXT(nid,nvarid,'units',13,"degrees_north") |
---|
| 353 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, |
---|
| 354 | . "North latitude") |
---|
| 355 | ierr = NF_ENDDEF(nid) |
---|
| 356 | #ifdef NC_DOUBLE |
---|
| 357 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlatu/pi*180) |
---|
| 358 | #else |
---|
| 359 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlatu/pi*180) |
---|
| 360 | #endif |
---|
| 361 | c---------------------- |
---|
| 362 | ierr = NF_REDEF (nid) |
---|
| 363 | #ifdef NC_DOUBLE |
---|
[2573] | 364 | ierr=NF_DEF_VAR(nid,"longitude",NF_DOUBLE,1,[idim_rlonv],nvarid) |
---|
[38] | 365 | #else |
---|
[2573] | 366 | ierr=NF_DEF_VAR(nid,"longitude",NF_FLOAT,1,[idim_rlonv],nvarid) |
---|
[38] | 367 | #endif |
---|
| 368 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 14, |
---|
| 369 | . "East longitude") |
---|
| 370 | ierr = NF_PUT_ATT_TEXT(nid,nvarid,'units',12,"degrees_east") |
---|
| 371 | ierr = NF_ENDDEF(nid) |
---|
| 372 | #ifdef NC_DOUBLE |
---|
| 373 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,rlonv/pi*180) |
---|
| 374 | #else |
---|
| 375 | ierr = NF_PUT_VAR_REAL (nid,nvarid,rlonv/pi*180) |
---|
| 376 | #endif |
---|
| 377 | c-------------------------- |
---|
| 378 | ierr = NF_REDEF (nid) |
---|
| 379 | #ifdef NC_DOUBLE |
---|
| 380 | ierr = NF_DEF_VAR (nid, "altitude", NF_DOUBLE, 1, |
---|
[2573] | 381 | . [idim_llm],nvarid) |
---|
[38] | 382 | #else |
---|
| 383 | ierr = NF_DEF_VAR (nid, "altitude", NF_FLOAT, 1, |
---|
[2573] | 384 | . [idim_llm],nvarid) |
---|
[38] | 385 | #endif |
---|
| 386 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",10,"pseudo-alt") |
---|
| 387 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,'units',2,"km") |
---|
| 388 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,'positive',2,"up") |
---|
| 389 | |
---|
| 390 | ierr = NF_ENDDEF(nid) |
---|
| 391 | #ifdef NC_DOUBLE |
---|
| 392 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,pseudoalt) |
---|
| 393 | #else |
---|
| 394 | ierr = NF_PUT_VAR_REAL (nid,nvarid,pseudoalt) |
---|
| 395 | #endif |
---|
| 396 | |
---|
| 397 | !------------------------------- |
---|
| 398 | ! (soil) depth variable mlayer() (known from comsoil.h) |
---|
| 399 | !------------------------------- |
---|
| 400 | ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode |
---|
| 401 | ! define variable |
---|
| 402 | #ifdef NC_DOUBLE |
---|
[2573] | 403 | ierr=NF_DEF_VAR(nid,"soildepth",NF_DOUBLE,1,[idim_nsoilmx],nvarid) |
---|
[38] | 404 | #else |
---|
[2573] | 405 | ierr=NF_DEF_VAR(nid,"soildepth",NF_FLOAT,1,[idim_nsoilmx],nvarid) |
---|
[38] | 406 | #endif |
---|
| 407 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, |
---|
| 408 | . "Soil mid-layer depth") |
---|
| 409 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",1,"m") |
---|
| 410 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"positive",4,"down") |
---|
| 411 | ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode |
---|
| 412 | ! write variable |
---|
| 413 | #ifdef NC_DOUBLE |
---|
| 414 | ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,mlayer) |
---|
| 415 | #else |
---|
| 416 | ierr=NF_PUT_VAR_REAL (nid,nvarid,mlayer) |
---|
| 417 | #endif |
---|
| 418 | |
---|
| 419 | !--------------------- |
---|
| 420 | ! soil thermal inertia |
---|
| 421 | !--------------------- |
---|
| 422 | ierr=NF_REDEF (nid) ! Enter NetCDF (re-)define mode |
---|
| 423 | dims3(1)=idim_rlonv |
---|
| 424 | dims3(2)=idim_rlatu |
---|
| 425 | dims3(3)=idim_nsoilmx |
---|
| 426 | ! define variable |
---|
| 427 | #ifdef NC_DOUBLE |
---|
| 428 | ierr=NF_DEF_VAR(nid,"inertiedat",NF_DOUBLE,3,dims3,nvarid) |
---|
| 429 | #else |
---|
| 430 | ierr=NF_DEF_VAR(nid,"inertiedat",NF_FLOAT,3,dims3,nvarid) |
---|
| 431 | #endif |
---|
| 432 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"long_name", 20, |
---|
| 433 | & "Soil thermal inertia") |
---|
| 434 | ierr=NF_PUT_ATT_TEXT (nid,nvarid,"units",15, |
---|
| 435 | & "J.s-1/2.m-2.K-1") |
---|
| 436 | ierr=NF_ENDDEF(nid) ! Leave NetCDF define mode |
---|
| 437 | ! write variable |
---|
| 438 | #ifdef NC_DOUBLE |
---|
| 439 | ierr=NF_PUT_VAR_DOUBLE (nid,nvarid,ith) |
---|
| 440 | #else |
---|
| 441 | ierr=NF_PUT_VAR_REAL (nid,nvarid,ith) |
---|
| 442 | #endif |
---|
| 443 | |
---|
| 444 | c----------------------------------------------------------------------- |
---|
| 445 | c Ecriture aire et coefficients de passage cov. <-> contra. <--> naturel |
---|
| 446 | c----------------------------------------------------------------------- |
---|
| 447 | |
---|
| 448 | ierr = NF_REDEF (nid) |
---|
| 449 | dims2(1) = idim_rlonu |
---|
| 450 | dims2(2) = idim_rlatu |
---|
| 451 | #ifdef NC_DOUBLE |
---|
| 452 | ierr = NF_DEF_VAR (nid,"cu",NF_DOUBLE,2,dims2,nvarid) |
---|
| 453 | #else |
---|
| 454 | ierr = NF_DEF_VAR (nid,"cu",NF_FLOAT,2,dims2,nvarid) |
---|
| 455 | #endif |
---|
| 456 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
| 457 | . "Coefficient de passage pour U") |
---|
| 458 | ierr = NF_ENDDEF(nid) |
---|
| 459 | #ifdef NC_DOUBLE |
---|
| 460 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cu) |
---|
| 461 | #else |
---|
| 462 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cu) |
---|
| 463 | #endif |
---|
| 464 | c |
---|
| 465 | ierr = NF_REDEF (nid) |
---|
| 466 | dims2(1) = idim_rlonv |
---|
| 467 | dims2(2) = idim_rlatv |
---|
| 468 | #ifdef NC_DOUBLE |
---|
| 469 | ierr = NF_DEF_VAR (nid,"cv",NF_DOUBLE,2,dims2,nvarid) |
---|
| 470 | #else |
---|
| 471 | ierr = NF_DEF_VAR (nid,"cv",NF_FLOAT,2,dims2,nvarid) |
---|
| 472 | #endif |
---|
| 473 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 29, |
---|
| 474 | . "Coefficient de passage pour V") |
---|
| 475 | ierr = NF_ENDDEF(nid) |
---|
| 476 | #ifdef NC_DOUBLE |
---|
| 477 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,cv) |
---|
| 478 | #else |
---|
| 479 | ierr = NF_PUT_VAR_REAL (nid,nvarid,cv) |
---|
| 480 | #endif |
---|
| 481 | c |
---|
| 482 | c Aire de chaque maille: |
---|
| 483 | c |
---|
| 484 | ierr = NF_REDEF (nid) |
---|
| 485 | dims2(1) = idim_rlonv |
---|
| 486 | dims2(2) = idim_rlatu |
---|
| 487 | #ifdef NC_DOUBLE |
---|
| 488 | ierr = NF_DEF_VAR (nid,"aire",NF_DOUBLE,2,dims2,nvarid) |
---|
| 489 | #else |
---|
| 490 | ierr = NF_DEF_VAR (nid,"aire",NF_FLOAT,2,dims2,nvarid) |
---|
| 491 | #endif |
---|
| 492 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 22, |
---|
| 493 | . "Aires de chaque maille") |
---|
| 494 | ierr = NF_ENDDEF(nid) |
---|
| 495 | #ifdef NC_DOUBLE |
---|
| 496 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,aire) |
---|
| 497 | #else |
---|
| 498 | ierr = NF_PUT_VAR_REAL (nid,nvarid,aire) |
---|
| 499 | #endif |
---|
| 500 | |
---|
| 501 | c----------------------------------------------------------------------- |
---|
| 502 | c Ecriture du geopentiel au sol |
---|
| 503 | c----------------------------------------------------------------------- |
---|
| 504 | |
---|
| 505 | ierr = NF_REDEF (nid) |
---|
| 506 | dims2(1) = idim_rlonv |
---|
| 507 | dims2(2) = idim_rlatu |
---|
| 508 | #ifdef NC_DOUBLE |
---|
| 509 | ierr = NF_DEF_VAR (nid,"phisinit",NF_DOUBLE,2,dims2,nvarid) |
---|
| 510 | #else |
---|
| 511 | ierr = NF_DEF_VAR (nid,"phisinit",NF_FLOAT,2,dims2,nvarid) |
---|
| 512 | #endif |
---|
| 513 | ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 19, |
---|
| 514 | . "Geopotentiel au sol") |
---|
| 515 | ierr = NF_ENDDEF(nid) |
---|
| 516 | #ifdef NC_DOUBLE |
---|
| 517 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,phis) |
---|
| 518 | #else |
---|
| 519 | ierr = NF_PUT_VAR_REAL (nid,nvarid,phis) |
---|
| 520 | #endif |
---|
| 521 | |
---|
[2913] | 522 | c Put subslope dist |
---|
| 523 | dims3(1)=idim_rlonv |
---|
| 524 | dims3(2)=idim_rlatu |
---|
| 525 | dims3(3)=idim_nslope |
---|
| 526 | ierr = NF_REDEF (nid) |
---|
| 527 | #ifdef NC_DOUBLE |
---|
| 528 | ierr = NF_DEF_VAR (nid, "subslope_dist", NF_DOUBLE, 3, |
---|
| 529 | . dims3,nvarid) |
---|
| 530 | #else |
---|
| 531 | ierr = NF_DEF_VAR (nid, "subslope_dist", NF_FLOAT, 3, |
---|
| 532 | . dims3,nvarid) |
---|
| 533 | #endif |
---|
| 534 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",13, |
---|
| 535 | . "subslope_dist") |
---|
| 536 | |
---|
| 537 | ierr = NF_ENDDEF(nid) |
---|
| 538 | #ifdef NC_DOUBLE |
---|
| 539 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,subslope_dist) |
---|
| 540 | #else |
---|
| 541 | ierr = NF_PUT_VAR_REAL (nid,nvarid,subslope_dist) |
---|
| 542 | #endif |
---|
| 543 | |
---|
| 544 | c Put def_slope |
---|
| 545 | |
---|
| 546 | ierr = NF_REDEF (nid) |
---|
| 547 | #ifdef NC_DOUBLE |
---|
| 548 | ierr = NF_DEF_VAR (nid, "def_slope", NF_DOUBLE, 1, |
---|
| 549 | . [idim_nslope_p1],nvarid) |
---|
| 550 | #else |
---|
| 551 | ierr = NF_DEF_VAR (nid, "def_slope", NF_FLOAT, 1, |
---|
| 552 | . [idim_nslope_p1],nvarid) |
---|
| 553 | #endif |
---|
| 554 | ierr = NF_PUT_ATT_TEXT (nid,nvarid,"long_name",7,"def_slope") |
---|
| 555 | ierr = NF_ENDDEF(nid) |
---|
| 556 | #ifdef NC_DOUBLE |
---|
| 557 | ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,def_slope) |
---|
| 558 | #else |
---|
| 559 | ierr = NF_PUT_VAR_REAL (nid,nvarid,def_slope) |
---|
| 560 | #endif |
---|
| 561 | |
---|
[38] | 562 | PRINT*,'iim,jjm,llm,idayref',iim,jjm,llm,idayref |
---|
| 563 | PRINT*,'rad,omeg,g,mugaz,kappa', |
---|
| 564 | s rad,omeg,g,43.49,kappa !mars temporaire (ecrire mugaz ensuite) |
---|
| 565 | PRINT*,'daysec,dtvr',daysec,dtvr |
---|
| 566 | |
---|
| 567 | RETURN |
---|
| 568 | END |
---|