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