- Timestamp:
- Sep 11, 2024, 6:03:07 PM (2 months ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/lmdz_writehist.f90
r5185 r5186 1 ! $Id$ 1 MODULE lmdz_writehist 2 IMPLICIT NONE; PRIVATE 3 PUBLIC writehist 2 4 3 SUBROUTINE writehist(time, vcov, ucov, teta, phi, q, masse, ps, phis) 5 CONTAINS 4 6 5 USE ioipsl 6 USE lmdz_infotrac, ONLY: nqtot 7 USE com_io_dyn_mod, ONLY: histid, histvid, histuid 8 USE temps_mod, ONLY: itau_dyn 9 USE lmdz_description, ONLY: descript 10 USE lmdz_iniprint, ONLY: lunout, prt_level 11 USE lmdz_comgeom 7 SUBROUTINE writehist(time, vcov, ucov, teta, phi, q, masse, ps, phis) 12 8 13 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 14 USE lmdz_paramet 15 IMPLICIT NONE 9 USE ioipsl 10 USE lmdz_infotrac, ONLY: nqtot 11 USE com_io_dyn_mod, ONLY: histid, histvid, histuid 12 USE temps_mod, ONLY: itau_dyn 13 USE lmdz_description, ONLY: descript 14 USE lmdz_iniprint, ONLY: lunout, prt_level 15 USE lmdz_comgeom 16 17 USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm 18 USE lmdz_paramet 19 USE lmdz_covnat, ONLY: covnat 20 21 IMPLICIT NONE 16 22 17 23 18 ! Ecriture du fichier histoire au format IOIPSL24 ! Ecriture du fichier histoire au format IOIPSL 19 25 20 ! Appels succesifs des routines: histwrite26 ! Appels succesifs des routines: histwrite 21 27 22 ! Entree:23 ! time: temps de l'ecriture24 ! vcov: vents v covariants25 ! ucov: vents u covariants26 ! teta: temperature potentielle27 ! phi : geopotentiel instantane28 ! q : traceurs29 ! masse: masse30 ! ps :pression au sol31 ! phis : geopotentiel au sol28 ! Entree: 29 ! time: temps de l'ecriture 30 ! vcov: vents v covariants 31 ! ucov: vents u covariants 32 ! teta: temperature potentielle 33 ! phi : geopotentiel instantane 34 ! q : traceurs 35 ! masse: masse 36 ! ps :pression au sol 37 ! phis : geopotentiel au sol 32 38 33 39 34 ! L. Fairhead, LMD, 03/9940 ! L. Fairhead, LMD, 03/99 35 41 36 ! =====================================================================42 ! ===================================================================== 37 43 38 ! Declarations44 ! Declarations 39 45 40 46 41 47 42 48 43 ! Arguments44 !49 ! Arguments 50 ! 45 51 46 REAL :: vcov(ip1jm, llm), ucov(ip1jmp1, llm)47 REAL :: teta(ip1jmp1, llm), phi(ip1jmp1, llm)48 REAL :: ps(ip1jmp1), masse(ip1jmp1, llm)49 REAL :: phis(ip1jmp1)50 REAL :: q(ip1jmp1, llm, nqtot)51 INTEGER :: time52 REAL :: vcov(ip1jm, llm), ucov(ip1jmp1, llm) 53 REAL :: teta(ip1jmp1, llm), phi(ip1jmp1, llm) 54 REAL :: ps(ip1jmp1), masse(ip1jmp1, llm) 55 REAL :: phis(ip1jmp1) 56 REAL :: q(ip1jmp1, llm, nqtot) 57 INTEGER :: time 52 58 53 59 54 ! This routine needs IOIPSL to work55 ! Variables locales60 ! This routine needs IOIPSL to work 61 ! Variables locales 56 62 57 INTEGER :: iq, ii, ll58 INTEGER :: ndexu(ip1jmp1 * llm), ndexv(ip1jm * llm), ndex2d(ip1jmp1)59 LOGICAL :: ok_sync60 INTEGER :: itau_w61 REAL :: vnat(ip1jm, llm), unat(ip1jmp1, llm)63 INTEGER :: iq, ii, ll 64 INTEGER :: ndexu(ip1jmp1 * llm), ndexv(ip1jm * llm), ndex2d(ip1jmp1) 65 LOGICAL :: ok_sync 66 INTEGER :: itau_w 67 REAL :: vnat(ip1jm, llm), unat(ip1jmp1, llm) 62 68 63 69 64 ! Initialisations70 ! Initialisations 65 71 66 ndexu = 067 ndexv = 068 ndex2d = 069 ok_sync = .TRUE.70 itau_w = itau_dyn + time71 ! Passage aux composantes naturelles du vent72 CALL covnat(llm, ucov, vcov, unat, vnat)72 ndexu = 0 73 ndexv = 0 74 ndex2d = 0 75 ok_sync = .TRUE. 76 itau_w = itau_dyn + time 77 ! Passage aux composantes naturelles du vent 78 CALL covnat(llm, ucov, vcov, unat, vnat) 73 79 74 ! Appels a histwrite pour l'ecriture des variables a sauvegarder80 ! Appels a histwrite pour l'ecriture des variables a sauvegarder 75 81 76 ! Vents U82 ! Vents U 77 83 78 CALL histwrite(histuid, 'u', itau_w, unat, &79 iip1 * jjp1 * llm, ndexu)84 CALL histwrite(histuid, 'u', itau_w, unat, & 85 iip1 * jjp1 * llm, ndexu) 80 86 81 ! Vents V87 ! Vents V 82 88 83 CALL histwrite(histvid, 'v', itau_w, vnat, &84 iip1 * jjm * llm, ndexv)89 CALL histwrite(histvid, 'v', itau_w, vnat, & 90 iip1 * jjm * llm, ndexv) 85 91 86 92 87 ! Temperature potentielle93 ! Temperature potentielle 88 94 89 CALL histwrite(histid, 'teta', itau_w, teta, &90 iip1 * jjp1 * llm, ndexu)95 CALL histwrite(histid, 'teta', itau_w, teta, & 96 iip1 * jjp1 * llm, ndexu) 91 97 92 ! Geopotentiel98 ! Geopotentiel 93 99 94 CALL histwrite(histid, 'phi', itau_w, phi, &95 iip1 * jjp1 * llm, ndexu)100 CALL histwrite(histid, 'phi', itau_w, phi, & 101 iip1 * jjp1 * llm, ndexu) 96 102 97 ! Traceurs103 ! Traceurs 98 104 99 ! DO iq=1,nqtot100 ! CALL histwrite(histid, tracers(iq)%longName, itau_w,101 ! . q(:,:,iq), iip1*jjp1*llm, ndexu)102 ! enddo103 !C104 ! Masse105 ! DO iq=1,nqtot 106 ! CALL histwrite(histid, tracers(iq)%longName, itau_w, 107 ! . q(:,:,iq), iip1*jjp1*llm, ndexu) 108 ! enddo 109 !C 110 ! Masse 105 111 106 CALL histwrite(histid, 'masse', itau_w, masse, iip1 * jjp1 * llm, ndexu)112 CALL histwrite(histid, 'masse', itau_w, masse, iip1 * jjp1 * llm, ndexu) 107 113 108 ! Pression au sol114 ! Pression au sol 109 115 110 CALL histwrite(histid, 'ps', itau_w, ps, iip1 * jjp1, ndex2d)116 CALL histwrite(histid, 'ps', itau_w, ps, iip1 * jjp1, ndex2d) 111 117 112 ! Geopotentiel au sol118 ! Geopotentiel au sol 113 119 114 ! CALL histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d)120 ! CALL histwrite(histid, 'phis', itau_w, phis, iip1*jjp1, ndex2d) 115 121 116 ! Fin122 ! Fin 117 123 118 IF (ok_sync) THEN 119 CALL histsync(histid) 120 CALL histsync(histvid) 121 CALL histsync(histuid) 122 ENDIF 123 RETURN 124 END SUBROUTINE writehist 124 IF (ok_sync) THEN 125 CALL histsync(histid) 126 CALL histsync(histvid) 127 CALL histsync(histuid) 128 ENDIF 129 RETURN 130 END SUBROUTINE writehist 131 132 133 END MODULE lmdz_writehist
Note: See TracChangeset
for help on using the changeset viewer.