[524] | 1 | ! |
---|
[1279] | 2 | ! $Id: writehist.F 2601 2016-07-24 09:51:55Z emillour $ |
---|
[524] | 3 | ! |
---|
[1403] | 4 | subroutine writehist(time,vcov,ucov,teta,phi,q,masse,ps,phis) |
---|
[524] | 5 | |
---|
[1279] | 6 | #ifdef CPP_IOIPSL |
---|
[524] | 7 | USE ioipsl |
---|
[1279] | 8 | #endif |
---|
[1146] | 9 | USE infotrac, ONLY : nqtot, ttext |
---|
[1403] | 10 | use com_io_dyn_mod, only : histid,histvid,histuid |
---|
[2601] | 11 | USE temps_mod, ONLY: itau_dyn |
---|
| 12 | |
---|
[524] | 13 | implicit none |
---|
| 14 | |
---|
| 15 | C |
---|
| 16 | C Ecriture du fichier histoire au format IOIPSL |
---|
| 17 | C |
---|
| 18 | C Appels succesifs des routines: histwrite |
---|
| 19 | C |
---|
| 20 | C Entree: |
---|
| 21 | C time: temps de l'ecriture |
---|
| 22 | C vcov: vents v covariants |
---|
| 23 | C ucov: vents u covariants |
---|
| 24 | C teta: temperature potentielle |
---|
| 25 | C phi : geopotentiel instantane |
---|
| 26 | C q : traceurs |
---|
| 27 | C masse: masse |
---|
| 28 | C ps :pression au sol |
---|
| 29 | C phis : geopotentiel au sol |
---|
| 30 | C |
---|
| 31 | C |
---|
| 32 | C L. Fairhead, LMD, 03/99 |
---|
| 33 | C |
---|
| 34 | C ===================================================================== |
---|
| 35 | C |
---|
| 36 | C Declarations |
---|
[2597] | 37 | include "dimensions.h" |
---|
| 38 | include "paramet.h" |
---|
| 39 | include "comgeom.h" |
---|
| 40 | include "ener.h" |
---|
| 41 | include "logic.h" |
---|
| 42 | include "description.h" |
---|
| 43 | include "iniprint.h" |
---|
[524] | 44 | |
---|
| 45 | C |
---|
| 46 | C Arguments |
---|
| 47 | C |
---|
| 48 | |
---|
| 49 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
| 50 | REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm) |
---|
| 51 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
| 52 | REAL phis(ip1jmp1) |
---|
[1146] | 53 | REAL q(ip1jmp1,llm,nqtot) |
---|
[524] | 54 | integer time |
---|
| 55 | |
---|
| 56 | |
---|
[1279] | 57 | #ifdef CPP_IOIPSL |
---|
| 58 | ! This routine needs IOIPSL to work |
---|
[524] | 59 | C Variables locales |
---|
| 60 | C |
---|
| 61 | integer iq, ii, ll |
---|
| 62 | integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1) |
---|
| 63 | logical ok_sync |
---|
| 64 | integer itau_w |
---|
[1403] | 65 | REAL vnat(ip1jm,llm),unat(ip1jmp1,llm) |
---|
| 66 | |
---|
[524] | 67 | C |
---|
| 68 | C Initialisations |
---|
| 69 | C |
---|
| 70 | ndexu = 0 |
---|
| 71 | ndexv = 0 |
---|
| 72 | ndex2d = 0 |
---|
| 73 | ok_sync =.TRUE. |
---|
| 74 | itau_w = itau_dyn + time |
---|
[1403] | 75 | ! Passage aux composantes naturelles du vent |
---|
| 76 | call covnat(llm, ucov, vcov, unat, vnat) |
---|
[524] | 77 | C |
---|
| 78 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 79 | C |
---|
| 80 | C Vents U |
---|
| 81 | C |
---|
[1403] | 82 | call histwrite(histuid, 'u', itau_w, unat, |
---|
[524] | 83 | . iip1*jjp1*llm, ndexu) |
---|
| 84 | C |
---|
| 85 | C Vents V |
---|
| 86 | C |
---|
[1403] | 87 | call histwrite(histvid, 'v', itau_w, vnat, |
---|
[524] | 88 | . iip1*jjm*llm, ndexv) |
---|
| 89 | |
---|
| 90 | C |
---|
| 91 | C Temperature potentielle |
---|
| 92 | C |
---|
| 93 | call histwrite(histid, 'teta', itau_w, teta, |
---|
| 94 | . iip1*jjp1*llm, ndexu) |
---|
| 95 | C |
---|
| 96 | C Geopotentiel |
---|
| 97 | C |
---|
| 98 | call histwrite(histid, 'phi', itau_w, phi, |
---|
| 99 | . iip1*jjp1*llm, ndexu) |
---|
| 100 | C |
---|
| 101 | C Traceurs |
---|
| 102 | C |
---|
[1403] | 103 | ! DO iq=1,nqtot |
---|
| 104 | ! call histwrite(histid, ttext(iq), itau_w, q(:,:,iq), |
---|
| 105 | ! . iip1*jjp1*llm, ndexu) |
---|
| 106 | ! enddo |
---|
| 107 | !C |
---|
[524] | 108 | C Masse |
---|
| 109 | C |
---|
[1403] | 110 | call histwrite(histid,'masse',itau_w, masse,iip1*jjp1*llm,ndexu) |
---|
[524] | 111 | C |
---|
| 112 | C Pression au sol |
---|
| 113 | C |
---|
| 114 | call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
| 115 | C |
---|
| 116 | C Geopotentiel au sol |
---|
| 117 | C |
---|
[1403] | 118 | ! call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
[524] | 119 | C |
---|
| 120 | C Fin |
---|
| 121 | C |
---|
| 122 | if (ok_sync) then |
---|
| 123 | call histsync(histid) |
---|
| 124 | call histsync(histvid) |
---|
[1403] | 125 | call histsync(histuid) |
---|
[524] | 126 | endif |
---|
[1279] | 127 | #else |
---|
| 128 | ! tell the user this routine should be run with ioipsl |
---|
| 129 | write(lunout,*)"writehist: Warning this routine should not be", |
---|
| 130 | & " used without ioipsl" |
---|
| 131 | #endif |
---|
| 132 | ! of #ifdef CPP_IOIPSL |
---|
[524] | 133 | return |
---|
| 134 | end |
---|