[711] | 1 | c======================================================================= |
---|
| 2 | PROGRAM start2archive |
---|
| 3 | c======================================================================= |
---|
| 4 | c |
---|
| 5 | c |
---|
| 6 | c Date: 01/1997 |
---|
| 7 | c ---- |
---|
| 8 | c |
---|
| 9 | c |
---|
| 10 | c Objet: Passage des fichiers netcdf d'etat initial "start" et |
---|
| 11 | c ----- "startfi" a un fichier netcdf unique "start_archive" |
---|
| 12 | c |
---|
| 13 | c "start_archive" est une banque d'etats initiaux: |
---|
| 14 | c On peut stocker plusieurs etats initiaux dans un meme fichier "start_archive" |
---|
| 15 | c (Veiller dans ce cas avoir un day_ini different pour chacun des start) |
---|
| 16 | c |
---|
| 17 | c |
---|
| 18 | c |
---|
| 19 | c======================================================================= |
---|
| 20 | |
---|
[1415] | 21 | use infotrac, only: infotrac_init, nqtot, tname |
---|
[787] | 22 | USE comsoil_h |
---|
[1543] | 23 | |
---|
| 24 | ! USE comgeomfi_h, ONLY: lati, long, area |
---|
[1216] | 25 | ! use control_mod |
---|
[1543] | 26 | ! use comgeomphy, only: initcomgeomphy |
---|
[1297] | 27 | ! to use 'getin' |
---|
| 28 | USE ioipsl_getincom |
---|
[1316] | 29 | USE planete_mod, only: year_day |
---|
[1543] | 30 | USE mod_const_mpi, ONLY: COMM_LMDZ |
---|
[1415] | 31 | USE control_mod, only: planet_type |
---|
[1403] | 32 | use filtreg_mod, only: inifilr |
---|
[1422] | 33 | USE comvert_mod, ONLY: ap,bp |
---|
[1543] | 34 | USE comconst_mod, ONLY: daysec,dtphys,rad,g,r,cpp |
---|
[1422] | 35 | USE temps_mod, ONLY: day_ini |
---|
[1543] | 36 | USE iniphysiq_mod, ONLY: iniphysiq |
---|
[711] | 37 | implicit none |
---|
| 38 | |
---|
[1543] | 39 | include "dimensions.h" |
---|
[1308] | 40 | integer, parameter :: ngridmx = (2+(jjm-1)*iim - 1/jjm) |
---|
[1543] | 41 | include "paramet.h" |
---|
| 42 | include "comdissip.h" |
---|
| 43 | include "comgeom.h" |
---|
[1216] | 44 | !#include "control.h" |
---|
[711] | 45 | |
---|
[1308] | 46 | !#include "dimphys.h" |
---|
| 47 | !#include "planete.h" |
---|
[1216] | 48 | !#include"advtrac.h" |
---|
[1543] | 49 | include "netcdf.inc" |
---|
[711] | 50 | c----------------------------------------------------------------------- |
---|
| 51 | c Declarations |
---|
| 52 | c----------------------------------------------------------------------- |
---|
| 53 | |
---|
| 54 | c variables dynamiques du GCM |
---|
| 55 | c ----------------------------- |
---|
| 56 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants |
---|
| 57 | REAL teta(ip1jmp1,llm) ! temperature potentielle |
---|
[1216] | 58 | REAL,ALLOCATABLE :: q(:,:,:) ! champs advectes |
---|
[711] | 59 | REAL pks(ip1jmp1) ! exner (f pour filtre) |
---|
| 60 | REAL pk(ip1jmp1,llm) |
---|
| 61 | REAL pkf(ip1jmp1,llm) |
---|
| 62 | REAL beta(iip1,jjp1,llm) |
---|
| 63 | REAL phis(ip1jmp1) ! geopotentiel au sol |
---|
| 64 | REAL masse(ip1jmp1,llm) ! masse de l'atmosphere |
---|
| 65 | REAL ps(ip1jmp1) ! pression au sol |
---|
| 66 | REAL p3d(iip1, jjp1, llm+1) ! pression aux interfaces |
---|
| 67 | |
---|
| 68 | c Variable Physiques (grille physique) |
---|
| 69 | c ------------------------------------ |
---|
[1543] | 70 | REAL tsurf(ngridmx) ! Surface temperature |
---|
| 71 | REAL,ALLOCATABLE :: tsoil(:,:) ! Soil temperature |
---|
[1308] | 72 | REAL q2(ngridmx,llm+1) |
---|
[1216] | 73 | REAL,ALLOCATABLE :: qsurf(:,:) |
---|
[711] | 74 | REAL emis(ngridmx) |
---|
| 75 | INTEGER start,length |
---|
| 76 | PARAMETER (length = 100) |
---|
| 77 | REAL tab_cntrl_fi(length) ! tableau des parametres de startfi |
---|
| 78 | REAL tab_cntrl_dyn(length) ! tableau des parametres de start |
---|
| 79 | INTEGER*4 day_ini_fi |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | c Variable naturelle / grille scalaire |
---|
| 83 | c ------------------------------------ |
---|
| 84 | REAL T(ip1jmp1,llm),us(ip1jmp1,llm),vs(ip1jmp1,llm) |
---|
| 85 | REAL tsurfS(ip1jmp1) |
---|
[1543] | 86 | REAL,ALLOCATABLE :: tsoilS(:,:) |
---|
| 87 | REAL,ALLOCATABLE :: ithS(:,:) ! Soil Thermal Inertia |
---|
[1216] | 88 | REAL q2S(ip1jmp1,llm+1) |
---|
| 89 | REAL,ALLOCATABLE :: qsurfS(:,:) |
---|
[711] | 90 | REAL emisS(ip1jmp1) |
---|
| 91 | |
---|
| 92 | |
---|
| 93 | c Variables intermediaires : vent naturel, mais pas coord scalaire |
---|
| 94 | c---------------------------------------------------------------- |
---|
| 95 | REAL vn(ip1jm,llm),un(ip1jmp1,llm) |
---|
| 96 | |
---|
| 97 | c Autres variables |
---|
| 98 | c ----------------- |
---|
| 99 | LOGICAL startdrs |
---|
| 100 | INTEGER Lmodif |
---|
| 101 | |
---|
[1647] | 102 | REAL ptotal |
---|
[711] | 103 | REAL timedyn,timefi !fraction du jour dans start, startfi |
---|
| 104 | REAL date |
---|
| 105 | |
---|
| 106 | CHARACTER*2 str2 |
---|
| 107 | CHARACTER*80 fichier |
---|
| 108 | data fichier /'startfi'/ |
---|
| 109 | |
---|
| 110 | INTEGER ij, l,i,j,isoil,iq |
---|
| 111 | character*80 fichnom |
---|
| 112 | integer :: ierr,ntime |
---|
| 113 | integer :: nq,numvanle |
---|
| 114 | character(len=30) :: txt ! to store some text |
---|
| 115 | |
---|
| 116 | c Netcdf |
---|
| 117 | c------- |
---|
| 118 | integer varid,dimid,timelen |
---|
| 119 | INTEGER nid,nid1 |
---|
| 120 | |
---|
| 121 | c----------------------------------------------------------------------- |
---|
| 122 | c Initialisations |
---|
| 123 | c----------------------------------------------------------------------- |
---|
| 124 | |
---|
[1216] | 125 | CALL defrun_new(99, .TRUE. ) |
---|
[711] | 126 | |
---|
[1644] | 127 | planet_type="titan" |
---|
[1415] | 128 | |
---|
[711] | 129 | c======================================================================= |
---|
| 130 | c Lecture des donnees |
---|
| 131 | c======================================================================= |
---|
[1216] | 132 | ! Load tracer number and names: |
---|
[1415] | 133 | call infotrac_init |
---|
[711] | 134 | |
---|
[1216] | 135 | ! allocate arrays: |
---|
| 136 | allocate(q(ip1jmp1,llm,nqtot)) |
---|
| 137 | allocate(qsurf(ngridmx,nqtot)) |
---|
| 138 | allocate(qsurfS(ip1jmp1,nqtot)) |
---|
[1227] | 139 | ! other array allocations: |
---|
[1543] | 140 | ! call ini_comsoil_h(ngridmx) ! done via iniphysiq |
---|
[1216] | 141 | |
---|
[711] | 142 | fichnom = 'start.nc' |
---|
[1415] | 143 | CALL dynetat0(fichnom,vcov,ucov,teta,q,masse, |
---|
[711] | 144 | . ps,phis,timedyn) |
---|
| 145 | |
---|
| 146 | ! load 'controle' array from dynamics start file |
---|
| 147 | |
---|
| 148 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1) |
---|
| 149 | IF (ierr.NE.NF_NOERR) THEN |
---|
| 150 | write(6,*)' Pb d''ouverture du fichier'//trim(fichnom) |
---|
| 151 | CALL ABORT |
---|
| 152 | ENDIF |
---|
| 153 | |
---|
| 154 | ierr = NF_INQ_VARID (nid1, "controle", varid) |
---|
| 155 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 156 | PRINT*, "start2archive: Le champ <controle> est absent" |
---|
| 157 | CALL abort |
---|
| 158 | ENDIF |
---|
| 159 | #ifdef NC_DOUBLE |
---|
| 160 | ierr = NF_GET_VAR_DOUBLE(nid1, varid, tab_cntrl_dyn) |
---|
| 161 | #else |
---|
| 162 | ierr = NF_GET_VAR_REAL(nid1, varid, tab_cntrl_dyn) |
---|
| 163 | #endif |
---|
| 164 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 165 | PRINT*, "start2archive: Lecture echoue pour <controle>" |
---|
| 166 | CALL abort |
---|
| 167 | ENDIF |
---|
| 168 | |
---|
| 169 | ierr = NF_CLOSE(nid1) |
---|
[1543] | 170 | |
---|
| 171 | ! Get value of the "subsurface_layers" dimension from physics start file |
---|
| 172 | fichnom = 'startfi.nc' |
---|
| 173 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1) |
---|
| 174 | IF (ierr.NE.NF_NOERR) THEN |
---|
| 175 | write(6,*)' Pb d''ouverture du fichier'//trim(fichnom) |
---|
| 176 | CALL ABORT |
---|
| 177 | ENDIF |
---|
| 178 | ierr = NF_INQ_DIMID(nid1,"subsurface_layers",varid) |
---|
| 179 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 180 | PRINT*, "start2archive: No subsurface_layers dimension!!" |
---|
| 181 | CALL abort |
---|
| 182 | ENDIF |
---|
| 183 | ierr = NF_INQ_DIMLEN(nid1,varid,nsoilmx) |
---|
| 184 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 185 | PRINT*, "start2archive: Failed reading subsurface_layers value!!" |
---|
| 186 | CALL abort |
---|
| 187 | ENDIF |
---|
| 188 | ierr = NF_CLOSE(nid1) |
---|
[711] | 189 | |
---|
[1543] | 190 | ! allocate arrays of nsoilmx size |
---|
| 191 | allocate(tsoil(ngridmx,nsoilmx)) |
---|
| 192 | allocate(tsoilS(ip1jmp1,nsoilmx)) |
---|
| 193 | allocate(ithS(ip1jmp1,nsoilmx)) |
---|
[711] | 194 | |
---|
[1543] | 195 | c----------------------------------------------------------------------- |
---|
| 196 | c Initialisations |
---|
| 197 | c----------------------------------------------------------------------- |
---|
| 198 | |
---|
| 199 | CALL defrun_new(99, .FALSE. ) |
---|
| 200 | call iniconst |
---|
| 201 | call inigeom |
---|
| 202 | call inifilr |
---|
| 203 | |
---|
| 204 | ! Initialize the physics |
---|
| 205 | CALL iniphysiq(iim,jjm,llm, |
---|
| 206 | & (jjm-1)*iim+2,comm_lmdz, |
---|
| 207 | & daysec,day_ini,dtphys, |
---|
| 208 | & rlatu,rlatv,rlonu,rlonv, |
---|
| 209 | & aire,cu,cv,rad,g,r,cpp, |
---|
| 210 | & 1) |
---|
| 211 | |
---|
[711] | 212 | fichnom = 'startfi.nc' |
---|
| 213 | Lmodif=0 |
---|
| 214 | |
---|
[1297] | 215 | |
---|
[1308] | 216 | CALL phyetat0 (ngridmx,llm,fichnom,0,Lmodif,nsoilmx,nqtot, |
---|
| 217 | . day_ini_fi,timefi, |
---|
[1647] | 218 | . tsurf,tsoil,emis,q2,qsurf) |
---|
[711] | 219 | |
---|
| 220 | |
---|
[1297] | 221 | |
---|
[711] | 222 | ! load 'controle' array from physics start file |
---|
| 223 | |
---|
| 224 | ierr = NF_OPEN (fichnom, NF_NOWRITE,nid1) |
---|
| 225 | IF (ierr.NE.NF_NOERR) THEN |
---|
| 226 | write(6,*)' Pb d''ouverture du fichier'//trim(fichnom) |
---|
| 227 | CALL ABORT |
---|
| 228 | ENDIF |
---|
| 229 | |
---|
| 230 | ierr = NF_INQ_VARID (nid1, "controle", varid) |
---|
| 231 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 232 | PRINT*, "start2archive: Le champ <controle> est absent" |
---|
| 233 | CALL abort |
---|
| 234 | ENDIF |
---|
| 235 | #ifdef NC_DOUBLE |
---|
| 236 | ierr = NF_GET_VAR_DOUBLE(nid1, varid, tab_cntrl_fi) |
---|
| 237 | #else |
---|
| 238 | ierr = NF_GET_VAR_REAL(nid1, varid, tab_cntrl_fi) |
---|
| 239 | #endif |
---|
| 240 | IF (ierr .NE. NF_NOERR) THEN |
---|
| 241 | PRINT*, "start2archive: Lecture echoue pour <controle>" |
---|
| 242 | CALL abort |
---|
| 243 | ENDIF |
---|
| 244 | |
---|
| 245 | ierr = NF_CLOSE(nid1) |
---|
| 246 | |
---|
| 247 | |
---|
| 248 | c----------------------------------------------------------------------- |
---|
| 249 | c Controle de la synchro |
---|
| 250 | c----------------------------------------------------------------------- |
---|
| 251 | !mars a voir if ((day_ini_fi.ne.day_ini).or.(abs(timefi-timedyn).gt.1.e-10)) |
---|
| 252 | if ((day_ini_fi.ne.day_ini)) |
---|
| 253 | & stop ' Probleme de Synchro entre start et startfi !!!' |
---|
| 254 | |
---|
| 255 | |
---|
| 256 | c ***************************************************************** |
---|
| 257 | c Option : Reinitialisation des dates dans la premieres annees : |
---|
| 258 | do while (day_ini.ge.year_day) |
---|
| 259 | day_ini=day_ini-year_day |
---|
| 260 | enddo |
---|
| 261 | c ***************************************************************** |
---|
| 262 | |
---|
| 263 | CALL pression(ip1jmp1, ap, bp, ps, p3d) |
---|
| 264 | call exner_hyb(ip1jmp1, ps, p3d, beta, pks, pk, pkf) |
---|
| 265 | |
---|
| 266 | c======================================================================= |
---|
| 267 | c Transformation EN VARIABLE NATURELLE / GRILLE SCALAIRE si necessaire |
---|
| 268 | c======================================================================= |
---|
| 269 | c Les variables modeles dependent de la resolution. Il faut donc |
---|
| 270 | c eliminer les facteurs responsables de cette dependance |
---|
| 271 | c (pour utiliser newstart) |
---|
| 272 | c======================================================================= |
---|
| 273 | |
---|
| 274 | c----------------------------------------------------------------------- |
---|
| 275 | c Vent (depend de la resolution horizontale) |
---|
| 276 | c----------------------------------------------------------------------- |
---|
| 277 | c |
---|
| 278 | c ucov --> un et vcov --> vn |
---|
| 279 | c un --> us et vn --> vs |
---|
| 280 | c |
---|
| 281 | c----------------------------------------------------------------------- |
---|
| 282 | |
---|
| 283 | call covnat(llm,ucov, vcov, un, vn) |
---|
| 284 | call wind_scal(un,vn,us,vs) |
---|
| 285 | |
---|
| 286 | c----------------------------------------------------------------------- |
---|
| 287 | c Temperature (depend de la resolution verticale => de "sigma.def") |
---|
| 288 | c----------------------------------------------------------------------- |
---|
| 289 | c |
---|
| 290 | c h --> T |
---|
| 291 | c |
---|
| 292 | c----------------------------------------------------------------------- |
---|
| 293 | |
---|
| 294 | DO l=1,llm |
---|
| 295 | DO ij=1,ip1jmp1 |
---|
| 296 | T(ij,l)=teta(ij,l)*pk(ij,l)/cpp !mars deduit de l'equation dans newstart |
---|
| 297 | ENDDO |
---|
| 298 | ENDDO |
---|
| 299 | |
---|
| 300 | c----------------------------------------------------------------------- |
---|
| 301 | c Variable physique |
---|
| 302 | c----------------------------------------------------------------------- |
---|
| 303 | c |
---|
| 304 | c tsurf --> tsurfS |
---|
| 305 | c tsoil --> tsoilS |
---|
| 306 | c emis --> emisS |
---|
| 307 | c q2 --> q2S |
---|
| 308 | c qsurf --> qsurfS |
---|
| 309 | c |
---|
| 310 | c----------------------------------------------------------------------- |
---|
| 311 | |
---|
| 312 | call gr_fi_dyn(1,ngridmx,iip1,jjp1,tsurf,tsurfS) |
---|
| 313 | call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,tsoil,tsoilS) |
---|
| 314 | ! Note: thermal inertia "inertiedat" is in comsoil.h |
---|
| 315 | call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,inertiedat,ithS) |
---|
| 316 | call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis,emisS) |
---|
| 317 | call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S) |
---|
[1216] | 318 | call gr_fi_dyn(nqtot,ngridmx,iip1,jjp1,qsurf,qsurfS) |
---|
[711] | 319 | |
---|
| 320 | c======================================================================= |
---|
| 321 | c Info pour controler |
---|
| 322 | c======================================================================= |
---|
| 323 | |
---|
| 324 | ptotal = 0. |
---|
| 325 | DO j=1,jjp1 |
---|
| 326 | DO i=1,iim |
---|
| 327 | ptotal=ptotal+aire(i+(iim+1)*(j-1))*ps(i+(iim+1)*(j-1))/g |
---|
| 328 | ENDDO |
---|
| 329 | ENDDO |
---|
| 330 | write(*,*)'Ancienne grille : masse de l''atm :',ptotal |
---|
| 331 | |
---|
| 332 | c----------------------------------------------------------------------- |
---|
[1647] | 333 | c Passage de "ptotal" par tab_cntrl_fi |
---|
[711] | 334 | c----------------------------------------------------------------------- |
---|
| 335 | |
---|
| 336 | tab_cntrl_fi(49) = ptotal |
---|
[1647] | 337 | tab_cntrl_fi(50) = 0. |
---|
[711] | 338 | |
---|
| 339 | c======================================================================= |
---|
| 340 | c Ecriture dans le fichier "start_archive" |
---|
| 341 | c======================================================================= |
---|
| 342 | |
---|
| 343 | c----------------------------------------------------------------------- |
---|
| 344 | c Ouverture de "start_archive" |
---|
| 345 | c----------------------------------------------------------------------- |
---|
| 346 | |
---|
| 347 | ierr = NF_OPEN ('start_archive.nc', NF_WRITE,nid) |
---|
| 348 | |
---|
| 349 | c----------------------------------------------------------------------- |
---|
| 350 | c si "start_archive" n'existe pas: |
---|
| 351 | c 1_ ouverture |
---|
| 352 | c 2_ creation de l'entete dynamique ("ini_archive") |
---|
| 353 | c----------------------------------------------------------------------- |
---|
| 354 | c ini_archive: |
---|
| 355 | c On met dans l'entete le tab_cntrl dynamique (1 a 16) |
---|
| 356 | c On y ajoute les valeurs du tab_cntrl_fi (a partir de 51) |
---|
| 357 | c En plus les deux valeurs ptotal et co2icetotal (99 et 100) |
---|
| 358 | c----------------------------------------------------------------------- |
---|
| 359 | |
---|
| 360 | if (ierr.ne.NF_NOERR) then |
---|
| 361 | write(*,*)'OK, Could not open file "start_archive.nc"' |
---|
| 362 | write(*,*)'So let s create a new "start_archive"' |
---|
| 363 | ierr = NF_CREATE('start_archive.nc', NF_CLOBBER, nid) |
---|
| 364 | call ini_archive(nid,day_ini,phis,ithS,tab_cntrl_fi, |
---|
| 365 | & tab_cntrl_dyn) |
---|
| 366 | endif |
---|
| 367 | |
---|
| 368 | c----------------------------------------------------------------------- |
---|
| 369 | c Ecriture de la coordonnee temps (date en jours) |
---|
| 370 | c----------------------------------------------------------------------- |
---|
| 371 | |
---|
| 372 | date = day_ini |
---|
| 373 | ierr= NF_INQ_VARID(nid,"Time",varid) |
---|
| 374 | ierr= NF_INQ_DIMID(nid,"Time",dimid) |
---|
| 375 | ierr= NF_INQ_DIMLEN(nid,dimid,timelen) |
---|
| 376 | ntime=timelen+1 |
---|
| 377 | |
---|
| 378 | write(*,*) "******************" |
---|
| 379 | write(*,*) "ntime",ntime |
---|
| 380 | write(*,*) "******************" |
---|
| 381 | #ifdef NC_DOUBLE |
---|
| 382 | ierr= NF_PUT_VARA_DOUBLE(nid,varid,ntime,1,date) |
---|
| 383 | #else |
---|
| 384 | ierr= NF_PUT_VARA_REAL(nid,varid,ntime,1,date) |
---|
| 385 | #endif |
---|
| 386 | if (ierr.ne.NF_NOERR) then |
---|
| 387 | write(*,*) "time matter ",NF_STRERROR(ierr) |
---|
| 388 | stop |
---|
| 389 | endif |
---|
| 390 | |
---|
| 391 | c----------------------------------------------------------------------- |
---|
[1647] | 392 | c Ecriture des champs (emis,ps,Tsurf,T,u,v,q2,q,qsurf) |
---|
[711] | 393 | c----------------------------------------------------------------------- |
---|
| 394 | c ATTENTION: q2 a une couche de plus!!!! |
---|
| 395 | c Pour creer un fichier netcdf lisible par grads, |
---|
| 396 | c On passe donc une des couches de q2 a part |
---|
| 397 | c comme une variable 2D (la couche au sol: "q2surf") |
---|
| 398 | c Les lmm autres couches sont nommees "q2atm" (3D) |
---|
| 399 | c----------------------------------------------------------------------- |
---|
| 400 | |
---|
| 401 | call write_archive(nid,ntime,'emis','grd emis',' ',2,emisS) |
---|
| 402 | call write_archive(nid,ntime,'ps','Psurf','Pa',2,ps) |
---|
| 403 | call write_archive(nid,ntime,'tsurf','surf T','K',2,tsurfS) |
---|
| 404 | call write_archive(nid,ntime,'temp','temperature','K',3,t) |
---|
| 405 | call write_archive(nid,ntime,'u','Vent zonal','m.s-1',3,us) |
---|
| 406 | call write_archive(nid,ntime,'v','Vent merid','m.s-1',3,vs) |
---|
| 407 | call write_archive(nid,ntime,'q2surf','wind variance','m2.s-2',2, |
---|
| 408 | . q2S) |
---|
| 409 | call write_archive(nid,ntime,'q2atm','wind variance','m2.s-2',3, |
---|
| 410 | . q2S(1,2)) |
---|
| 411 | |
---|
| 412 | c----------------------------------------------------------------------- |
---|
[1216] | 413 | c Ecriture du champs q ( q[1,nqtot] ) |
---|
[711] | 414 | c----------------------------------------------------------------------- |
---|
[1216] | 415 | do iq=1,nqtot |
---|
| 416 | call write_archive(nid,ntime,tname(iq),'tracer','kg/kg', |
---|
[711] | 417 | & 3,q(1,1,iq)) |
---|
| 418 | end do |
---|
| 419 | c----------------------------------------------------------------------- |
---|
[1216] | 420 | c Ecriture du champs qsurf ( qsurf[1,nqtot] ) |
---|
[711] | 421 | c----------------------------------------------------------------------- |
---|
[1216] | 422 | do iq=1,nqtot |
---|
| 423 | txt=trim(tname(iq))//"_surf" |
---|
[711] | 424 | call write_archive(nid,ntime,txt,'Tracer on surface', |
---|
| 425 | & 'kg.m-2',2,qsurfS(1,iq)) |
---|
| 426 | enddo |
---|
| 427 | |
---|
| 428 | |
---|
| 429 | c----------------------------------------------------------------------- |
---|
| 430 | c Ecriture du champs tsoil ( Tg[1,10] ) |
---|
| 431 | c----------------------------------------------------------------------- |
---|
| 432 | c "tsoil" Temperature au sol definie dans 10 couches dans le sol |
---|
| 433 | c Les 10 couches sont lues comme 10 champs |
---|
| 434 | c nommees Tg[1,10] |
---|
| 435 | |
---|
| 436 | c do isoil=1,nsoilmx |
---|
| 437 | c write(str2,'(i2.2)') isoil |
---|
| 438 | c call write_archive(nid,ntime,'Tg'//str2,'Ground Temperature ', |
---|
| 439 | c . 'K',2,tsoilS(1,isoil)) |
---|
| 440 | c enddo |
---|
| 441 | |
---|
| 442 | ! Write soil temperatures tsoil |
---|
| 443 | call write_archive(nid,ntime,'tsoil','Soil temperature', |
---|
| 444 | & 'K',-3,tsoilS) |
---|
| 445 | |
---|
| 446 | ! Write soil thermal inertia |
---|
| 447 | call write_archive(nid,ntime,'inertiedat', |
---|
| 448 | & 'Soil thermal inertia', |
---|
| 449 | & 'J.s-1/2.m-2.K-1',-3,ithS) |
---|
| 450 | |
---|
| 451 | ! Write (0D) volumetric heat capacity (stored in comsoil.h) |
---|
| 452 | ! call write_archive(nid,ntime,'volcapa', |
---|
| 453 | ! & 'Soil volumetric heat capacity', |
---|
| 454 | ! & 'J.m-3.K-1',0,volcapa) |
---|
| 455 | ! Note: no need to write volcapa, it is stored in "controle" table |
---|
| 456 | |
---|
[1297] | 457 | |
---|
[711] | 458 | c Fin |
---|
| 459 | c----------------------------------------------------------------------- |
---|
| 460 | ierr=NF_CLOSE(nid) |
---|
| 461 | |
---|
[1216] | 462 | write(*,*) "start2archive: All is well that ends well." |
---|
| 463 | |
---|
[711] | 464 | end |
---|