--- trunk/libf/bibio/inithist.f90 2011/09/23 12:28:01 52 +++ trunk/libf/bibio/inithist.f90 2012/01/30 12:54:02 57 @@ -4,7 +4,7 @@ contains - subroutine inithist(day0, anne0, tstep, nq, fileid, filevid, t_ops, t_wrt) + subroutine inithist(day0, anne0, tstep, nq, t_ops, t_wrt) ! From inithist.F, version 1.1.1.1 2004/05/19 12:53:05 @@ -20,19 +20,15 @@ ! t_wrt : fréquence d'écriture sur le fichier ! nq : nombre de traceurs - ! Sorties : - ! fileid : ID du fichier Netcdf créé - ! filevid : ID du fichier Netcdf pour la grille v - ! L. Fairhead, LMD, 03/99 USE calendar + use com_io_dyn, only: histid, histvid, histuid use histcom use dimens_m use paramet_m use comconst use comvert - use logic use comgeom use serre use temps @@ -43,7 +39,6 @@ ! Arguments integer day0, anne0 real, intent(in):: tstep, t_ops, t_wrt - integer fileid, filevid integer nq ! Variables locales @@ -69,13 +64,8 @@ enddo enddo - call histbeg_totreg("dyn_hist.nc", rlong(:, 1), rlat(1, :), & - 1, iip1, 1, jjp1, & - itau_dyn, zjulian, tstep, uhoriid, fileid) - ! - ! Creation du fichier histoire pour la grille en V (oblige pour l'instant, - ! IOIPSL ne permet pas de grilles avec des nombres de point differents dans - ! un meme fichier) + call histbeg_totreg("dyn_histu.nc", rlong(:,1), rlat(1,:), 1, iip1, 1, & + jjp1, itau_dyn, zjulian, tstep, uhoriid, histuid) do jj = 1, jjm do ii = 1, iip1 @@ -84,9 +74,13 @@ enddo enddo + ! Creation du fichier histoire pour la grille en V (oblige pour l'instant, + ! IOIPSL ne permet pas de grilles avec des nombres de point differents dans + ! un meme fichier) + call histbeg_totreg('dyn_histv.nc', rlong(:, 1), rlat(1, :jjm), & 1, iip1, 1, jjm, & - itau_dyn, zjulian, tstep, vhoriid, filevid) + itau_dyn, zjulian, tstep, vhoriid, histvid) ! ! Appel a histhori pour rajouter les autres grilles horizontales ! @@ -97,74 +91,76 @@ enddo enddo - call histhori_regular(fileid, iip1, rlong, jjp1, rlat, 'scalar', & - 'Grille points scalaires', thoriid) + call histbeg_totreg("dyn_hist.nc", rlong(:, 1), rlat(1, :), 1, iip1, 1, & + jjp1, itau_dyn, zjulian, tstep, thoriid, histid) ! ! Appel a histvert pour la grille verticale ! - call histvert(fileid, 'sig_s', 'Niveaux sigma', '-', & - llm, nivsigs, zvertiid) - ! Pour le fichier V - call histvert(filevid, 'sig_s', 'Niveaux sigma', '-', & - llm, nivsigs, zvertiid) + call histvert(histid, 'presnivs', 'Niveaux pression','mb', llm, & + presnivs/100., zvertiid,'down') + call histvert(histvid, 'presnivs', 'Niveaux pression','mb', llm, & + presnivs/100., zvertiid,'down') + call histvert(histuid, 'presnivs', 'Niveaux pression','mb', llm, & + presnivs/100., zvertiid,'down') ! ! Appels a histdef pour la definition des variables a sauvegarder ! ! Vents U ! - call histdef(fileid, 'ucov', 'vents u covariants', 'm/s', & + call histdef(histuid, 'u', 'vent u', 'm/s', & iip1, jjp1, uhoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) ! ! Vents V ! - call histdef(filevid, 'vcov', 'vents v covariants', 'm/s', & + call histdef(histvid, 'v', 'vent v', 'm/s', & iip1, jjm, vhoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) ! ! Temperature potentielle ! - call histdef(fileid, 'teta', 'temperature potentielle', '-', & + call histdef(histid, 'teta', 'temperature potentielle', '-', & iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) ! ! Geopotentiel ! - call histdef(fileid, 'phi', 'geopotentiel instantane', '-', & + call histdef(histid, 'phi', 'geopotentiel', '-', & iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) ! ! Traceurs ! DO iq=1, nq - call histdef(fileid, ttext(iq), ttext(iq), '-', & + call histdef(histid, ttext(iq), ttext(iq), '-', & iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) enddo ! ! Masse ! - call histdef(fileid, 'masse', 'masse', 'kg', & - iip1, jjp1, thoriid, 1, 1, 1, -99, & + call histdef(histid, 'masse', 'masse', 'kg', & + iip1, jjp1, thoriid, llm, 1, llm, zvertiid, & 'inst(X)', t_ops, t_wrt) ! ! Pression au sol ! - call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa', & + call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', & iip1, jjp1, thoriid, 1, 1, 1, -99, & 'inst(X)', t_ops, t_wrt) ! - ! Pression au sol + ! Geopotentiel au sol ! - call histdef(fileid, 'phis', 'geopotentiel au sol', '-', & + call histdef(histid, 'phis', 'geopotentiel au sol', '-', & iip1, jjp1, thoriid, 1, 1, 1, -99, & 'inst(X)', t_ops, t_wrt) ! ! Fin ! - call histend(fileid) - call histend(filevid) + call histend(histid) + call histend(histuid) + call histend(histvid) end subroutine inithist