[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 |
---|
| 66 | C |
---|
| 67 | C Initialisations |
---|
| 68 | C |
---|
| 69 | str='q ' |
---|
[29] | 70 | ndex3d = 0 |
---|
| 71 | ndex2d = 0 |
---|
[2] | 72 | ok_sync = .TRUE. |
---|
[295] | 73 | us = 999.999 |
---|
| 74 | vs = 999.999 |
---|
| 75 | tm = 999.999 |
---|
| 76 | vnat = 999.999 |
---|
| 77 | unat = 999.999 |
---|
[2] | 78 | |
---|
| 79 | C Passage aux composantes naturelles du vent |
---|
| 80 | call covnat(llm, ucov, vcov, unat, vnat) |
---|
| 81 | |
---|
| 82 | C |
---|
| 83 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 84 | C |
---|
| 85 | C Vents U scalaire |
---|
| 86 | C |
---|
| 87 | call gr_u_scal(llm, unat, us) |
---|
| 88 | call histwrite(histid, 'u', time, us, |
---|
[29] | 89 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 90 | C |
---|
| 91 | C Vents V scalaire |
---|
| 92 | C |
---|
| 93 | call gr_v_scal(llm, vnat, vs) |
---|
| 94 | call histwrite(histid, 'v', time, vs, |
---|
[29] | 95 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 96 | C |
---|
[295] | 97 | C Temperature potentielle moyennee |
---|
| 98 | C |
---|
| 99 | call histwrite(histid, 'theta', time, teta, |
---|
| 100 | . iip1*jjp1*llm, ndex3d) |
---|
| 101 | C |
---|
[2] | 102 | C Temperature moyennee |
---|
| 103 | C |
---|
| 104 | do ii = 1, ijp1llm |
---|
| 105 | tm(ii) = teta(ii) * ppk(ii)/cpp |
---|
| 106 | enddo |
---|
| 107 | call histwrite(histid, 'temp', time, tm, |
---|
[29] | 108 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 109 | C |
---|
| 110 | C Geopotentiel |
---|
| 111 | C |
---|
| 112 | call histwrite(histid, 'phi', time, phi, |
---|
[29] | 113 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 114 | C |
---|
| 115 | C Traceurs |
---|
| 116 | C |
---|
| 117 | IF(nq.GE.1) THEN |
---|
| 118 | DO iq=1,nq |
---|
| 119 | IF ( iq.LE.9 ) THEN |
---|
| 120 | WRITE(str(2:2),'(i1.1)') iq |
---|
| 121 | ELSE |
---|
| 122 | WRITE(str(2:3),'(i2.2)') iq |
---|
| 123 | ENDIF |
---|
| 124 | call histwrite(histid, str, time, q(:,:,iq), |
---|
[29] | 125 | . iip1*jjp1*llm, ndex3d) |
---|
[2] | 126 | enddo |
---|
| 127 | endif |
---|
| 128 | C |
---|
| 129 | C Masse |
---|
| 130 | C |
---|
[29] | 131 | call histwrite(histid, 'masse', time, masse, iip1*jjp1, ndex2d) |
---|
[2] | 132 | C |
---|
| 133 | C Pression au sol |
---|
| 134 | C |
---|
[29] | 135 | call histwrite(histid, 'ps', time, ps, iip1*jjp1, ndex2d) |
---|
[2] | 136 | C |
---|
| 137 | C Geopotentiel au sol |
---|
| 138 | C |
---|
[29] | 139 | call histwrite(histid, 'phis', time, phis, iip1*jjp1, ndex2d) |
---|
[2] | 140 | C |
---|
| 141 | C Fin |
---|
| 142 | C |
---|
[29] | 143 | if (ok_sync) call histsync(histid) |
---|
[2] | 144 | return |
---|
| 145 | end |
---|