[2] | 1 | subroutine writedynav( histid, nq, time, vcov, |
---|
| 2 | , ucov,teta,ppk,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 nqmx: nombre maxi de traceurs |
---|
| 15 | C time: temps de l'ecriture |
---|
| 16 | C vcov: vents v covariants |
---|
| 17 | C ucov: vents u covariants |
---|
| 18 | C teta: temperature potentielle |
---|
| 19 | C phi : geopotentiel instantane |
---|
| 20 | C q : traceurs |
---|
| 21 | C masse: masse |
---|
| 22 | C ps :pression au sol |
---|
| 23 | C phis : geopotentiel au sol |
---|
| 24 | C |
---|
| 25 | C |
---|
| 26 | C Sortie: |
---|
| 27 | C fileid: ID du fichier netcdf cree |
---|
| 28 | C |
---|
| 29 | C L. Fairhead, LMD, 03/99 |
---|
| 30 | C |
---|
| 31 | C ===================================================================== |
---|
| 32 | C |
---|
| 33 | C Declarations |
---|
| 34 | #include "dimensions.h" |
---|
| 35 | #include "paramet.h" |
---|
| 36 | #include "comconst.h" |
---|
| 37 | #include "comvert.h" |
---|
| 38 | #include "comgeom.h" |
---|
| 39 | #include "temps.h" |
---|
| 40 | #include "ener.h" |
---|
| 41 | #include "logic.h" |
---|
| 42 | #include "description.h" |
---|
| 43 | #include "serre.h" |
---|
| 44 | |
---|
| 45 | C |
---|
| 46 | C Arguments |
---|
| 47 | C |
---|
| 48 | |
---|
| 49 | INTEGER histid, nq |
---|
| 50 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
| 51 | REAL teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm) |
---|
| 52 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
| 53 | REAL phis(ip1jmp1) |
---|
| 54 | REAL q(ip1jmp1,llm,nq) |
---|
| 55 | integer time |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | C Variables locales |
---|
| 59 | C |
---|
[29] | 60 | integer ndex2d(iip1*jjp1),ndex3d(iip1*jjp1*llm),iq, ii, ll |
---|
[2] | 61 | character*3 str |
---|
| 62 | real us(ip1jmp1*llm), vs(ip1jmp1*llm) |
---|
| 63 | real tm(ip1jmp1*llm) |
---|
| 64 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
| 65 | logical ok_sync |
---|
[353] | 66 | integer itau_w |
---|
[2] | 67 | C |
---|
| 68 | C Initialisations |
---|
| 69 | C |
---|
| 70 | str='q ' |
---|
[29] | 71 | ndex3d = 0 |
---|
| 72 | ndex2d = 0 |
---|
[2] | 73 | ok_sync = .TRUE. |
---|
[295] | 74 | us = 999.999 |
---|
| 75 | vs = 999.999 |
---|
| 76 | tm = 999.999 |
---|
| 77 | vnat = 999.999 |
---|
| 78 | unat = 999.999 |
---|
[353] | 79 | itau_w = itau_dyn + time |
---|
[2] | 80 | |
---|
| 81 | C Passage aux composantes naturelles du vent |
---|
| 82 | call covnat(llm, ucov, vcov, unat, vnat) |
---|
| 83 | |
---|
| 84 | C |
---|
| 85 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 86 | C |
---|
| 87 | C Vents U scalaire |
---|
| 88 | C |
---|
| 89 | call gr_u_scal(llm, unat, us) |
---|
[353] | 90 | call histwrite(histid, 'u', itau_w, us, |
---|
[29] | 91 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 92 | C |
---|
| 93 | C Vents V scalaire |
---|
| 94 | C |
---|
| 95 | call gr_v_scal(llm, vnat, vs) |
---|
[353] | 96 | call histwrite(histid, 'v', itau_w, vs, |
---|
[29] | 97 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 98 | C |
---|
[295] | 99 | C Temperature potentielle moyennee |
---|
| 100 | C |
---|
[353] | 101 | call histwrite(histid, 'theta', itau_w, teta, |
---|
[295] | 102 | . iip1*jjp1*llm, ndex3d) |
---|
| 103 | C |
---|
[2] | 104 | C Temperature moyennee |
---|
| 105 | C |
---|
| 106 | do ii = 1, ijp1llm |
---|
| 107 | tm(ii) = teta(ii) * ppk(ii)/cpp |
---|
| 108 | enddo |
---|
[353] | 109 | call histwrite(histid, 'temp', itau_w, tm, |
---|
[29] | 110 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 111 | C |
---|
| 112 | C Geopotentiel |
---|
| 113 | C |
---|
[353] | 114 | call histwrite(histid, 'phi', itau_w, phi, |
---|
[29] | 115 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 116 | C |
---|
| 117 | C Traceurs |
---|
| 118 | C |
---|
| 119 | IF(nq.GE.1) THEN |
---|
| 120 | DO iq=1,nq |
---|
| 121 | IF ( iq.LE.9 ) THEN |
---|
| 122 | WRITE(str(2:2),'(i1.1)') iq |
---|
| 123 | ELSE |
---|
| 124 | WRITE(str(2:3),'(i2.2)') iq |
---|
| 125 | ENDIF |
---|
[353] | 126 | call histwrite(histid, str, itau_w, q(:,:,iq), |
---|
[29] | 127 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 128 | enddo |
---|
| 129 | endif |
---|
| 130 | C |
---|
| 131 | C Masse |
---|
| 132 | C |
---|
[353] | 133 | call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d) |
---|
[2] | 134 | C |
---|
| 135 | C Pression au sol |
---|
| 136 | C |
---|
[353] | 137 | call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
[2] | 138 | C |
---|
| 139 | C Geopotentiel au sol |
---|
| 140 | C |
---|
[353] | 141 | call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
[2] | 142 | C |
---|
| 143 | C Fin |
---|
| 144 | C |
---|
[29] | 145 | if (ok_sync) call histsync(histid) |
---|
[2] | 146 | return |
---|
| 147 | end |
---|