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