[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: writedynav.F 1403 2010-07-01 09:02:53Z fairhead $ |
---|
[524] | 3 | ! |
---|
[1403] | 4 | subroutine writedynav(time, vcov, |
---|
| 5 | , ucov,teta,ppk,phi,q,masse,ps,phis) |
---|
[524] | 6 | |
---|
[1279] | 7 | #ifdef CPP_IOIPSL |
---|
[524] | 8 | USE ioipsl |
---|
[1279] | 9 | #endif |
---|
[1146] | 10 | USE infotrac, ONLY : nqtot, ttext |
---|
[1403] | 11 | use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid |
---|
[524] | 12 | implicit none |
---|
| 13 | |
---|
| 14 | C |
---|
| 15 | C Ecriture du fichier histoire au format IOIPSL |
---|
| 16 | C |
---|
| 17 | C Appels succesifs des routines: histwrite |
---|
| 18 | C |
---|
| 19 | C Entree: |
---|
| 20 | C time: temps de l'ecriture |
---|
| 21 | C vcov: vents v covariants |
---|
| 22 | C ucov: vents u covariants |
---|
| 23 | C teta: temperature potentielle |
---|
| 24 | C phi : geopotentiel instantane |
---|
| 25 | C q : traceurs |
---|
| 26 | C masse: masse |
---|
| 27 | C ps :pression au sol |
---|
| 28 | C phis : geopotentiel au sol |
---|
| 29 | C |
---|
| 30 | C |
---|
| 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" |
---|
[1279] | 47 | #include "iniprint.h" |
---|
[524] | 48 | |
---|
| 49 | C |
---|
| 50 | C Arguments |
---|
| 51 | C |
---|
| 52 | |
---|
| 53 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
[1403] | 54 | REAL teta(ip1jmp1*llm),phi(ip1jmp1,llm),ppk(ip1jmp1*llm) |
---|
[524] | 55 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
| 56 | REAL phis(ip1jmp1) |
---|
[1146] | 57 | REAL q(ip1jmp1,llm,nqtot) |
---|
[524] | 58 | integer time |
---|
| 59 | |
---|
| 60 | |
---|
[1279] | 61 | #ifdef CPP_IOIPSL |
---|
| 62 | ! This routine needs IOIPSL to work |
---|
[524] | 63 | C Variables locales |
---|
| 64 | C |
---|
[1403] | 65 | integer ndex2d(ip1jmp1),ndexu(ip1jmp1*llm),ndexv(ip1jm*llm) |
---|
| 66 | INTEGER iq, ii, ll |
---|
[524] | 67 | real tm(ip1jmp1*llm) |
---|
| 68 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
| 69 | logical ok_sync |
---|
| 70 | integer itau_w |
---|
| 71 | C |
---|
| 72 | C Initialisations |
---|
| 73 | C |
---|
[1403] | 74 | ndexu = 0 |
---|
| 75 | ndexv = 0 |
---|
[524] | 76 | ndex2d = 0 |
---|
| 77 | ok_sync = .TRUE. |
---|
| 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 |
---|
[1403] | 89 | C Vents U |
---|
[524] | 90 | C |
---|
[1403] | 91 | call histwrite(histuaveid, 'u', itau_w, unat, |
---|
| 92 | . iip1*jjp1*llm, ndexu) |
---|
[524] | 93 | C |
---|
[1403] | 94 | C Vents V |
---|
[524] | 95 | C |
---|
[1403] | 96 | call histwrite(histvaveid, 'v', itau_w, vnat, |
---|
| 97 | . iip1*jjm*llm, ndexv) |
---|
[524] | 98 | C |
---|
| 99 | C Temperature potentielle moyennee |
---|
| 100 | C |
---|
[1403] | 101 | call histwrite(histaveid, 'theta', itau_w, teta, |
---|
| 102 | . iip1*jjp1*llm, ndexu) |
---|
[524] | 103 | C |
---|
| 104 | C Temperature moyennee |
---|
| 105 | C |
---|
| 106 | do ii = 1, ijp1llm |
---|
| 107 | tm(ii) = teta(ii) * ppk(ii)/cpp |
---|
| 108 | enddo |
---|
[1403] | 109 | call histwrite(histaveid, 'temp', itau_w, tm, |
---|
| 110 | . iip1*jjp1*llm, ndexu) |
---|
[524] | 111 | C |
---|
| 112 | C Geopotentiel |
---|
| 113 | C |
---|
[1403] | 114 | call histwrite(histaveid, 'phi', itau_w, phi, |
---|
| 115 | . iip1*jjp1*llm, ndexu) |
---|
[524] | 116 | C |
---|
| 117 | C Traceurs |
---|
| 118 | C |
---|
[1403] | 119 | ! DO iq=1,nqtot |
---|
| 120 | ! call histwrite(histaveid, ttext(iq), itau_w, q(:,:,iq), |
---|
| 121 | ! . iip1*jjp1*llm, ndexu) |
---|
| 122 | ! enddo |
---|
[524] | 123 | C |
---|
| 124 | C Masse |
---|
| 125 | C |
---|
[1403] | 126 | call histwrite(histaveid, 'masse', itau_w, masse, |
---|
| 127 | $ iip1*jjp1*llm, ndexu) |
---|
[524] | 128 | C |
---|
| 129 | C Pression au sol |
---|
| 130 | C |
---|
[1403] | 131 | call histwrite(histaveid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
[524] | 132 | C |
---|
| 133 | C Geopotentiel au sol |
---|
| 134 | C |
---|
[1403] | 135 | ! call histwrite(histaveid,'phis',itau_w, phis,iip1*jjp1, ndex2d) |
---|
[524] | 136 | C |
---|
| 137 | C Fin |
---|
| 138 | C |
---|
[1403] | 139 | if (ok_sync) then |
---|
| 140 | call histsync(histaveid) |
---|
| 141 | call histsync(histvaveid) |
---|
| 142 | call histsync(histuaveid) |
---|
| 143 | ENDIF |
---|
[1279] | 144 | |
---|
| 145 | #else |
---|
| 146 | ! tell the user this routine should be run with ioipsl |
---|
| 147 | write(lunout,*)"writedynav: Warning this routine should not be", |
---|
| 148 | & " used without ioipsl" |
---|
| 149 | #endif |
---|
| 150 | ! of #ifdef CPP_IOIPSL |
---|
[524] | 151 | return |
---|
| 152 | end |
---|