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