[1279] | 1 | ! $Id: writedynav.F90 5136 2024-07-28 14:17:54Z abarral $ |
---|
[524] | 2 | |
---|
[5103] | 3 | SUBROUTINE writedynav(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis) |
---|
[1612] | 4 | |
---|
| 5 | USE ioipsl |
---|
[5101] | 6 | USE infotrac, ONLY: nqtot |
---|
[5117] | 7 | USE com_io_dyn_mod, ONLY: histaveid, histvaveid, histuaveid |
---|
[2597] | 8 | USE comconst_mod, ONLY: cpp |
---|
[2601] | 9 | USE temps_mod, ONLY: itau_dyn |
---|
[5114] | 10 | USE lmdz_description, ONLY: descript |
---|
[5118] | 11 | USE lmdz_iniprint, ONLY: lunout, prt_level |
---|
[5136] | 12 | USE lmdz_comgeom |
---|
[524] | 13 | |
---|
[5113] | 14 | IMPLICIT NONE |
---|
[524] | 15 | |
---|
[1612] | 16 | ! Ecriture du fichier histoire au format IOIPSL |
---|
[524] | 17 | |
---|
[1612] | 18 | ! Appels succesifs des routines: histwrite |
---|
[524] | 19 | |
---|
[1612] | 20 | ! Entree: |
---|
| 21 | ! time: temps de l'ecriture |
---|
| 22 | ! vcov: vents v covariants |
---|
| 23 | ! ucov: vents u covariants |
---|
| 24 | ! teta: temperature potentielle |
---|
| 25 | ! phi : geopotentiel instantane |
---|
| 26 | ! q : traceurs |
---|
| 27 | ! masse: masse |
---|
| 28 | ! ps :pression au sol |
---|
| 29 | ! phis : geopotentiel au sol |
---|
[524] | 30 | |
---|
[1612] | 31 | ! L. Fairhead, LMD, 03/99 |
---|
| 32 | |
---|
| 33 | ! Declarations |
---|
[5134] | 34 | INCLUDE "dimensions.h" |
---|
| 35 | INCLUDE "paramet.h" |
---|
[1612] | 36 | ! Arguments |
---|
| 37 | |
---|
[5118] | 38 | REAL vcov(ip1jm, llm), ucov(ip1jmp1, llm) |
---|
| 39 | REAL teta(ip1jmp1 * llm), phi(ip1jmp1, llm), ppk(ip1jmp1 * llm) |
---|
| 40 | REAL ps(ip1jmp1), masse(ip1jmp1, llm) |
---|
| 41 | REAL phis(ip1jmp1) |
---|
[1612] | 42 | REAL q(ip1jmp1, llm, nqtot) |
---|
[5114] | 43 | INTEGER time |
---|
[1612] | 44 | |
---|
| 45 | ! This routine needs IOIPSL to work |
---|
| 46 | ! Variables locales |
---|
[524] | 47 | |
---|
[5118] | 48 | INTEGER ndex2d(ip1jmp1), ndexu(ip1jmp1 * llm), ndexv(ip1jm * llm) |
---|
[1612] | 49 | INTEGER iq, ii, ll |
---|
[5118] | 50 | REAL tm(ip1jmp1 * llm) |
---|
[5103] | 51 | REAL vnat(ip1jm, llm), unat(ip1jmp1, llm) |
---|
[5117] | 52 | LOGICAL ok_sync |
---|
| 53 | INTEGER itau_w |
---|
[524] | 54 | |
---|
[1612] | 55 | !----------------------------------------------------------------- |
---|
[1279] | 56 | |
---|
[1612] | 57 | ! Initialisations |
---|
| 58 | |
---|
| 59 | ndexu = 0 |
---|
| 60 | ndexv = 0 |
---|
| 61 | ndex2d = 0 |
---|
| 62 | ok_sync = .TRUE. |
---|
| 63 | tm = 999.999 |
---|
| 64 | vnat = 999.999 |
---|
| 65 | unat = 999.999 |
---|
| 66 | itau_w = itau_dyn + time |
---|
| 67 | |
---|
| 68 | ! Passage aux composantes naturelles du vent |
---|
[5101] | 69 | CALL covnat(llm, ucov, vcov, unat, vnat) |
---|
[1612] | 70 | |
---|
| 71 | ! Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 72 | |
---|
[5103] | 73 | ! Vents U |
---|
[1612] | 74 | |
---|
[5118] | 75 | CALL histwrite(histuaveid, 'u', itau_w, unat, & |
---|
| 76 | iip1 * jjp1 * llm, ndexu) |
---|
[1612] | 77 | |
---|
| 78 | ! Vents V |
---|
| 79 | |
---|
[5118] | 80 | CALL histwrite(histvaveid, 'v', itau_w, vnat, & |
---|
| 81 | iip1 * jjm * llm, ndexv) |
---|
[1612] | 82 | |
---|
| 83 | ! Temperature potentielle moyennee |
---|
| 84 | |
---|
[5118] | 85 | CALL histwrite(histaveid, 'theta', itau_w, teta, & |
---|
| 86 | iip1 * jjp1 * llm, ndexu) |
---|
[1612] | 87 | |
---|
| 88 | ! Temperature moyennee |
---|
| 89 | |
---|
| 90 | do ii = 1, ijp1llm |
---|
[5118] | 91 | tm(ii) = teta(ii) * ppk(ii) / cpp |
---|
[1612] | 92 | enddo |
---|
[5118] | 93 | CALL histwrite(histaveid, 'temp', itau_w, tm, & |
---|
| 94 | iip1 * jjp1 * llm, ndexu) |
---|
[1612] | 95 | |
---|
| 96 | ! Geopotentiel |
---|
| 97 | |
---|
[5118] | 98 | CALL histwrite(histaveid, 'phi', itau_w, phi, & |
---|
| 99 | iip1 * jjp1 * llm, ndexu) |
---|
[1612] | 100 | |
---|
| 101 | ! Traceurs |
---|
| 102 | |
---|
| 103 | ! DO iq=1, nqtot |
---|
[5101] | 104 | ! CALL histwrite(histaveid, tracers(iq)%longName, itau_w, & |
---|
[4046] | 105 | ! q(:, :, iq), iip1*jjp1*llm, ndexu) |
---|
[1612] | 106 | ! enddo |
---|
| 107 | |
---|
| 108 | ! Masse |
---|
| 109 | |
---|
[5118] | 110 | CALL histwrite(histaveid, 'masse', itau_w, masse, & |
---|
| 111 | iip1 * jjp1 * llm, ndexu) |
---|
[1612] | 112 | |
---|
| 113 | ! Pression au sol |
---|
| 114 | |
---|
[5118] | 115 | CALL histwrite(histaveid, 'ps', itau_w, ps, iip1 * jjp1, ndex2d) |
---|
[1612] | 116 | |
---|
| 117 | ! Geopotentiel au sol |
---|
| 118 | |
---|
[5101] | 119 | ! CALL histwrite(histaveid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
[1612] | 120 | |
---|
[5117] | 121 | IF (ok_sync) THEN |
---|
[5118] | 122 | CALL histsync(histaveid) |
---|
| 123 | CALL histsync(histvaveid) |
---|
| 124 | CALL histsync(histuaveid) |
---|
[1612] | 125 | ENDIF |
---|
| 126 | |
---|
[5103] | 127 | END SUBROUTINE writedynav |
---|