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