[2] | 1 | subroutine writehist( histid, histvid, nq, time, vcov, |
---|
| 2 | , ucov,teta,phi,q,masse,ps,phis) |
---|
| 3 | |
---|
| 4 | USE ioipsl |
---|
| 5 | implicit none |
---|
| 6 | |
---|
| 7 | C |
---|
| 8 | C Ecriture du fichier histoire au format IOIPSL |
---|
| 9 | C |
---|
| 10 | C Appels succesifs des routines: histwrite |
---|
| 11 | C |
---|
| 12 | C Entree: |
---|
| 13 | C histid: ID du fichier histoire |
---|
| 14 | C histvid:ID du fichier histoire pour les vents V (appele a disparaitre) |
---|
| 15 | C nqmx: nombre maxi de traceurs |
---|
| 16 | C time: temps de l'ecriture |
---|
| 17 | C vcov: vents v covariants |
---|
| 18 | C ucov: vents u covariants |
---|
| 19 | C teta: temperature potentielle |
---|
| 20 | C phi : geopotentiel instantane |
---|
| 21 | C q : traceurs |
---|
| 22 | C masse: masse |
---|
| 23 | C ps :pression au sol |
---|
| 24 | C phis : geopotentiel au sol |
---|
| 25 | C |
---|
| 26 | C |
---|
| 27 | C Sortie: |
---|
| 28 | C fileid: ID du fichier netcdf cree |
---|
| 29 | C |
---|
| 30 | C L. Fairhead, LMD, 03/99 |
---|
| 31 | C |
---|
| 32 | C ===================================================================== |
---|
| 33 | C |
---|
| 34 | C Declarations |
---|
| 35 | #include "dimensions.h" |
---|
| 36 | #include "paramet.h" |
---|
| 37 | #include "comconst.h" |
---|
| 38 | #include "comvert.h" |
---|
| 39 | #include "comgeom.h" |
---|
| 40 | #include "temps.h" |
---|
| 41 | #include "ener.h" |
---|
| 42 | #include "logic.h" |
---|
| 43 | #include "description.h" |
---|
| 44 | #include "serre.h" |
---|
| 45 | |
---|
| 46 | C |
---|
| 47 | C Arguments |
---|
| 48 | C |
---|
| 49 | |
---|
| 50 | INTEGER histid, nq, histvid |
---|
| 51 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
| 52 | REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm) |
---|
| 53 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
| 54 | REAL phis(ip1jmp1) |
---|
| 55 | REAL q(ip1jmp1,llm,nq) |
---|
| 56 | integer time |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | C Variables locales |
---|
| 60 | C |
---|
[29] | 61 | integer iq, ii, ll |
---|
[30] | 62 | integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1) |
---|
[2] | 63 | character*3 str |
---|
| 64 | logical ok_sync |
---|
[353] | 65 | integer itau_w |
---|
[2] | 66 | C |
---|
| 67 | C Initialisations |
---|
| 68 | C |
---|
| 69 | str='q ' |
---|
[29] | 70 | ndexu = 0 |
---|
| 71 | ndexv = 0 |
---|
| 72 | ndex2d = 0 |
---|
[2] | 73 | ok_sync =.TRUE. |
---|
[353] | 74 | itau_w = itau_dyn + time |
---|
[2] | 75 | C |
---|
| 76 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 77 | C |
---|
| 78 | C Vents U |
---|
| 79 | C |
---|
[353] | 80 | call histwrite(histid, 'ucov', itau_w, ucov, |
---|
[29] | 81 | . iip1*jjp1*llm, ndexu) |
---|
[2] | 82 | |
---|
| 83 | C |
---|
| 84 | C Vents V |
---|
| 85 | C |
---|
[353] | 86 | call histwrite(histvid, 'vcov', itau_w, vcov, |
---|
[29] | 87 | . iip1*jjm*llm, ndexv) |
---|
[2] | 88 | |
---|
| 89 | C |
---|
| 90 | C Temperature potentielle |
---|
| 91 | C |
---|
[353] | 92 | call histwrite(histid, 'teta', itau_w, teta, |
---|
[29] | 93 | . iip1*jjp1*llm, ndexu) |
---|
[2] | 94 | C |
---|
| 95 | C Geopotentiel |
---|
| 96 | C |
---|
[353] | 97 | call histwrite(histid, 'phi', itau_w, phi, |
---|
[29] | 98 | . iip1*jjp1*llm, ndexu) |
---|
[2] | 99 | C |
---|
| 100 | C Traceurs |
---|
| 101 | C |
---|
| 102 | IF(nq.GE.1) THEN |
---|
| 103 | DO iq=1,nq |
---|
| 104 | IF ( iq.LE.9 ) THEN |
---|
| 105 | WRITE(str(2:2),'(i1.1)') iq |
---|
| 106 | ELSE |
---|
| 107 | WRITE(str(2:3),'(i2.2)') iq |
---|
| 108 | ENDIF |
---|
[353] | 109 | call histwrite(histid, str, itau_w, q(:,:,iq), |
---|
[29] | 110 | . iip1*jjp1*llm, ndexu) |
---|
[2] | 111 | enddo |
---|
| 112 | endif |
---|
| 113 | C |
---|
| 114 | C Masse |
---|
| 115 | C |
---|
[353] | 116 | call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d) |
---|
[2] | 117 | C |
---|
| 118 | C Pression au sol |
---|
| 119 | C |
---|
[353] | 120 | call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
[2] | 121 | C |
---|
| 122 | C Geopotentiel au sol |
---|
| 123 | C |
---|
[353] | 124 | call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
[2] | 125 | C |
---|
| 126 | C Fin |
---|
| 127 | C |
---|
[29] | 128 | if (ok_sync) then |
---|
| 129 | call histsync(histid) |
---|
| 130 | call histsync(histvid) |
---|
| 131 | endif |
---|
[2] | 132 | return |
---|
| 133 | end |
---|