[524] | 1 | ! |
---|
[1222] | 2 | ! $Id: writehist.F 1222 2009-08-07 11:48:33Z idelkadi $ |
---|
[524] | 3 | ! |
---|
[1114] | 4 | subroutine writehist( histid, histvid, time, vcov, |
---|
[524] | 5 | , ucov,teta,phi,q,masse,ps,phis) |
---|
| 6 | |
---|
[1222] | 7 | #ifdef CPP_IOIPSL |
---|
[524] | 8 | USE ioipsl |
---|
[1222] | 9 | #endif |
---|
[1114] | 10 | USE infotrac, ONLY : nqtot, ttext |
---|
[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 histid: ID du fichier histoire |
---|
| 20 | C histvid:ID du fichier histoire pour les vents V (appele a disparaitre) |
---|
| 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 Sortie: |
---|
| 33 | C fileid: ID du fichier netcdf cree |
---|
| 34 | C |
---|
| 35 | C L. Fairhead, LMD, 03/99 |
---|
| 36 | C |
---|
| 37 | C ===================================================================== |
---|
| 38 | C |
---|
| 39 | C Declarations |
---|
| 40 | #include "dimensions.h" |
---|
| 41 | #include "paramet.h" |
---|
| 42 | #include "comconst.h" |
---|
| 43 | #include "comvert.h" |
---|
| 44 | #include "comgeom.h" |
---|
| 45 | #include "temps.h" |
---|
| 46 | #include "ener.h" |
---|
| 47 | #include "logic.h" |
---|
| 48 | #include "description.h" |
---|
| 49 | #include "serre.h" |
---|
[1222] | 50 | #include "iniprint.h" |
---|
[524] | 51 | |
---|
| 52 | C |
---|
| 53 | C Arguments |
---|
| 54 | C |
---|
| 55 | |
---|
[1114] | 56 | INTEGER histid, histvid |
---|
[524] | 57 | REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) |
---|
| 58 | REAL teta(ip1jmp1,llm),phi(ip1jmp1,llm) |
---|
| 59 | REAL ps(ip1jmp1),masse(ip1jmp1,llm) |
---|
| 60 | REAL phis(ip1jmp1) |
---|
[1114] | 61 | REAL q(ip1jmp1,llm,nqtot) |
---|
[524] | 62 | integer time |
---|
| 63 | |
---|
| 64 | |
---|
[1222] | 65 | #ifdef CPP_IOIPSL |
---|
| 66 | ! This routine needs IOIPSL to work |
---|
[524] | 67 | C Variables locales |
---|
| 68 | C |
---|
| 69 | integer iq, ii, ll |
---|
| 70 | integer ndexu(ip1jmp1*llm),ndexv(ip1jm*llm),ndex2d(ip1jmp1) |
---|
| 71 | logical ok_sync |
---|
| 72 | integer itau_w |
---|
| 73 | C |
---|
| 74 | C Initialisations |
---|
| 75 | C |
---|
| 76 | ndexu = 0 |
---|
| 77 | ndexv = 0 |
---|
| 78 | ndex2d = 0 |
---|
| 79 | ok_sync =.TRUE. |
---|
| 80 | itau_w = itau_dyn + time |
---|
| 81 | C |
---|
| 82 | C Appels a histwrite pour l'ecriture des variables a sauvegarder |
---|
| 83 | C |
---|
| 84 | C Vents U |
---|
| 85 | C |
---|
| 86 | call histwrite(histid, 'ucov', itau_w, ucov, |
---|
| 87 | . iip1*jjp1*llm, ndexu) |
---|
| 88 | |
---|
| 89 | C |
---|
| 90 | C Vents V |
---|
| 91 | C |
---|
| 92 | call histwrite(histvid, 'vcov', itau_w, vcov, |
---|
| 93 | . iip1*jjm*llm, ndexv) |
---|
| 94 | |
---|
| 95 | C |
---|
| 96 | C Temperature potentielle |
---|
| 97 | C |
---|
| 98 | call histwrite(histid, 'teta', itau_w, teta, |
---|
| 99 | . iip1*jjp1*llm, ndexu) |
---|
| 100 | C |
---|
| 101 | C Geopotentiel |
---|
| 102 | C |
---|
| 103 | call histwrite(histid, 'phi', itau_w, phi, |
---|
| 104 | . iip1*jjp1*llm, ndexu) |
---|
| 105 | C |
---|
| 106 | C Traceurs |
---|
| 107 | C |
---|
[1114] | 108 | DO iq=1,nqtot |
---|
[524] | 109 | call histwrite(histid, ttext(iq), itau_w, q(:,:,iq), |
---|
| 110 | . iip1*jjp1*llm, ndexu) |
---|
| 111 | enddo |
---|
| 112 | C |
---|
| 113 | C Masse |
---|
| 114 | C |
---|
| 115 | call histwrite(histid, 'masse', itau_w, masse, iip1*jjp1, ndex2d) |
---|
| 116 | C |
---|
| 117 | C Pression au sol |
---|
| 118 | C |
---|
| 119 | call histwrite(histid, 'ps', itau_w, ps, iip1*jjp1, ndex2d) |
---|
| 120 | C |
---|
| 121 | C Geopotentiel au sol |
---|
| 122 | C |
---|
| 123 | call histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) |
---|
| 124 | C |
---|
| 125 | C Fin |
---|
| 126 | C |
---|
| 127 | if (ok_sync) then |
---|
| 128 | call histsync(histid) |
---|
| 129 | call histsync(histvid) |
---|
| 130 | endif |
---|
[1222] | 131 | #else |
---|
| 132 | ! tell the user this routine should be run with ioipsl |
---|
| 133 | write(lunout,*)"writehist: Warning this routine should not be", |
---|
| 134 | & " used without ioipsl" |
---|
| 135 | #endif |
---|
| 136 | ! of #ifdef CPP_IOIPSL |
---|
[524] | 137 | return |
---|
| 138 | end |
---|