! ! $Id: initdynav.F 1403 2010-07-01 09:02:53Z idelkadi $ ! subroutine initdynav(day0,anne0,tstep,t_ops,t_wrt) #ifdef CPP_IOIPSL USE IOIPSL #endif USE infotrac, ONLY : nqtot, ttext use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid, & & dynhistave_file,dynhistvave_file,dynhistuave_file implicit none C C Routine d'initialisation des ecritures des fichiers histoires LMDZ C au format IOIPSL. Initialisation du fichier histoire moyenne. C C Appels succesifs des routines: histbeg C histhori C histver C histdef C histend C C Entree: C C infile: nom du fichier histoire a creer C day0,anne0: date de reference C tstep : frequence d'ecriture C t_ops: frequence de l'operation pour IOIPSL C t_wrt: frequence d'ecriture sur le fichier C C C L. Fairhead, LMD, 03/99 C C ===================================================================== C C Declarations #include "dimensions.h" #include "paramet.h" #include "comconst.h" #include "comvert.h" #include "comgeom.h" #include "temps.h" #include "ener.h" #include "logic.h" #include "description.h" #include "serre.h" #include "iniprint.h" C Arguments C integer day0, anne0 real tstep, t_ops, t_wrt #ifdef CPP_IOIPSL ! This routine needs IOIPSL to work C Variables locales C integer tau0 real zjulian integer iq real rlong(iip1,jjp1), rlat(iip1,jjp1) integer uhoriid, vhoriid, thoriid, zvertiid integer ii,jj integer zan, dayref C C Initialisations C pi = 4. * atan (1.) C C Appel a histbeg: creation du fichier netcdf et initialisations diverses C zan = anne0 dayref = day0 CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) tau0 = itau_dyn do jj = 1, jjp1 do ii = 1, iip1 rlong(ii,jj) = rlonv(ii) * 180. / pi rlat(ii,jj) = rlatu(jj) * 180. / pi enddo enddo ! Creation de 3 fichiers pour les differentes grilles horizontales ! Restriction de IOIPSL: seulement 2 coordonnees dans le meme fichier ! Grille Scalaire call histbeg(dynhistave_file, iip1, rlong(:,1), jjp1, rlat(1,:), . 1, iip1, 1, jjp1, . tau0, zjulian, tstep, thoriid,histaveid) C Creation du fichier histoire pour les grilles en V et U (oblige pour l'instant, C IOIPSL ne permet pas de grilles avec des nombres de point differents dans C un meme fichier) ! Grille V do jj = 1, jjm do ii = 1, iip1 rlong(ii,jj) = rlonv(ii) * 180. / pi rlat(ii,jj) = rlatv(jj) * 180. / pi enddo enddo call histbeg(dynhistvave_file, iip1, rlong(:,1), jjm, rlat(1,:), . 1, iip1, 1, jjm, . tau0, zjulian, tstep, vhoriid,histvaveid) ! Grille U do jj = 1, jjp1 do ii = 1, iip1 rlong(ii,jj) = rlonu(ii) * 180. / pi rlat(ii,jj) = rlatu(jj) * 180. / pi enddo enddo call histbeg(dynhistuave_file, iip1, rlong(:,1),jjp1, rlat(1,:), . 1, iip1, 1, jjp1, . tau0, zjulian, tstep, uhoriid,histuaveid) C C Appel a histvert pour la grille verticale C call histvert(histaveid,'presnivs','Niveaux Pression & approximatifs','mb',llm, presnivs/100., zvertiid,'down') call histvert(histuaveid,'presnivs','Niveaux Pression & approximatifs','mb',llm, presnivs/100., zvertiid,'down') call histvert(histvaveid,'presnivs','Niveaux Pression & approximatifs','mb',llm, presnivs/100., zvertiid,'down') C C Appels a histdef pour la definition des variables a sauvegarder C C Vents U C ! write(6,*)'inithistave',tstep call histdef(histuaveid, 'u', 'vent u moyen ', . 'm/s', iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C Vents V C call histdef(histvaveid, 'v', 'vent v moyen', . 'm/s', iip1, jjm, vhoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C C Temperature C call histdef(histaveid, 'temp', 'temperature moyenne', 'K', . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C C Temperature potentielle C call histdef(histaveid, 'theta', 'temperature potentielle', 'K', . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C C Geopotentiel C call histdef(histaveid, 'phi', 'geopotentiel moyen', '-', . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C C Traceurs C ! DO iq=1,nqtot ! call histdef(histaveid, ttext(iq), ttext(iq), '-', ! . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, ! . 32, 'ave(X)', t_ops, t_wrt) ! enddo C C Masse C call histdef(histaveid, 'masse', 'masse', 'kg', . iip1, jjp1, thoriid, llm, 1, llm, zvertiid, . 32, 'ave(X)', t_ops, t_wrt) C C Pression au sol C call histdef(histaveid, 'ps', 'pression naturelle au sol', 'Pa', . iip1, jjp1, thoriid, 1, 1, 1, -99, . 32, 'ave(X)', t_ops, t_wrt) C C Geopotentiel au sol C ! call histdef(histaveid, 'phis', 'geopotentiel au sol', '-', ! . iip1, jjp1, thoriid, 1, 1, 1, -99, ! . 32, 'ave(X)', t_ops, t_wrt) !C C Fin C call histend(histaveid) call histend(histuaveid) call histend(histvaveid) #else ! tell the user this routine should be run with ioipsl write(lunout,*)"initdynav: Warning this routine should not be", & " used without ioipsl" #endif ! of #ifdef CPP_IOIPSL return end