--- trunk/libf/bibio/inithist.f90 2012/10/02 15:50:56 67 +++ trunk/dyn3d/inithist.f 2018/12/10 15:54:30 313 @@ -2,106 +2,78 @@ implicit none + integer histid, histvid, histuid + contains - subroutine inithist(day0, anne0, tstep, nq, t_ops, t_wrt) + subroutine inithist(t_ops, t_wrt) - ! From inithist.F, version 1.1.1.1 2004/05/19 12:53:05 + ! From inithist.F, version 1.1.1.1, 2004/05/19 12:53:05 ! L. Fairhead, LMD, 03/99 - ! Routine d'initialisation des écritures des fichiers histoires - ! LMDZ au format IOIPSL. + ! Routine d'initialisation des écritures des fichiers histoires au + ! format IOIPSL. - USE calendar, ONLY: ymds2ju - USE com_io_dyn, ONLY: histid, histuid, histvid - USE histbeg_totreg_m, ONLY : histbeg_totreg - USE histdef_m, ONLY : histdef - USE histend_m, ONLY : histend - USE histvert_m, ONLY : histvert - USE dimens_m, ONLY: jjm, llm - USE paramet_m, ONLY: iip1, jjp1 + use comconst, only: dtvr + USE dimensions, ONLY: jjm, llm, nqmx USE disvert_m, ONLY: presnivs - USE comgeom, ONLY: rlatu, rlatv, rlonu, rlonv - USE temps, ONLY: itau_dyn + use dynetat0_m, only: itau_dyn, rlatu, rlatv, rlonu, rlonv + USE dynetat0_chosen_m, ONLY: day_ref, annee_ref + use histbeg_totreg_m, only: histbeg_totreg + USE histdef_m, ONLY: histdef + USE histend_m, ONLY: histend + USE histvert_m, ONLY: histvert USE iniadvtrac_m, ONLY: ttext USE nr_util, ONLY: pi + USE paramet_m, ONLY: iip1, jjp1 + use ymds2ju_m, ONLY: ymds2ju - integer, intent(in):: day0, anne0 ! date de référence - real, intent(in):: tstep ! durée du pas de temps en secondes - integer, intent(in):: nq ! nombre de traceurs real, intent(in):: t_ops ! fréquence de l'opération pour IOIPSL real, intent(in):: t_wrt ! fréquence d'écriture sur le fichier - ! Variables locales: - real zjulian + ! Local: + real julian integer iq - real rlong(iip1, jjp1), rlat(iip1, jjp1) integer uhoriid, vhoriid, thoriid, zvertiid - integer ii, jj - integer zan, dayref !----------------------------------------------------------------------- - zan = anne0 - dayref = day0 - CALL ymds2ju(zan, 1, dayref, 0.0, zjulian) - - 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_totreg("dyn_histu.nc", rlong(:,1), rlat(1,:), 1, iip1, 1, & - jjp1, itau_dyn, zjulian, tstep, uhoriid, histuid) + print *, "Call sequence information: inithist" + CALL ymds2ju(annee_ref, 1, day_ref, 0., julian) - 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_totreg("dyn_histu.nc", rlonu * 180. / pi, rlatu * 180. / pi, & + 1, iip1, 1, jjp1, itau_dyn, julian, dtvr, uhoriid, histuid) ! 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, histvid) + call histbeg_totreg('dyn_histv.nc', rlonv * 180. / pi, rlatv * 180. / pi, & + 1, iip1, 1, jjm, itau_dyn, julian, dtvr, vhoriid, histvid) - do jj = 1, jjp1 - do ii = 1, iip1 - rlong(ii, jj) = rlonv(ii) * 180. / pi - rlat(ii, jj) = rlatu(jj) * 180. / pi - enddo - enddo - - 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 histbeg_totreg("dyn_hist.nc", rlonv * 180. / pi, rlatu * 180. / pi, & + 1, iip1, 1, jjp1, itau_dyn, julian, dtvr, thoriid, histid) - call histvert(histid, 'presnivs', 'Niveaux pression','mb', presnivs/100., & - zvertiid,'down') - call histvert(histvid, 'presnivs', 'Niveaux pression','mb', & - presnivs/100., zvertiid,'down') - call histvert(histuid, 'presnivs', 'Niveaux pression','mb', & - presnivs/100., zvertiid,'down') - - ! Appels a histdef pour la definition des variables a sauvegarder + call histvert(histid, 'presnivs', 'Niveaux pression', 'mb', presnivs/100., & + zvertiid, 'down') + call histvert(histvid, 'presnivs', 'Niveaux pression', 'mb', & + presnivs/100., zvertiid, 'down') + call histvert(histuid, 'presnivs', 'Niveaux pression', 'mb', & + presnivs/100., zvertiid, 'down') call histdef(histuid, 'u', 'vent u', 'm/s', iip1, jjp1, uhoriid, llm, 1, & llm, zvertiid, 'inst(X)', t_ops, t_wrt) call histdef(histvid, 'v', 'vent v', 'm/s', iip1, jjm, vhoriid, llm, 1, & llm, zvertiid, 'inst(X)', t_ops, t_wrt) - call histdef(histid, 'teta', 'temperature potentielle', '-', iip1, jjp1, & + call histdef(histid, 'temp', 'temperature', 'K', iip1, jjp1, & + thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) + call histdef(histid, 'theta', 'temperature potentielle', 'K', iip1, jjp1, & thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) - call histdef(histid, 'phi', 'geopotentiel', '-', iip1, jjp1, thoriid, & + call histdef(histid, 'phi', 'geopotential', 'm2 s-2', iip1, jjp1, thoriid, & llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) ! Traceurs - DO iq=1, nq + DO iq = 1, nqmx call histdef(histid, ttext(iq), ttext(iq), '-', iip1, jjp1, thoriid, & llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt) enddo @@ -110,8 +82,6 @@ llm, zvertiid, 'inst(X)', t_ops, t_wrt) call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', iip1, jjp1, & thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt) - call histdef(histid, 'phis', 'geopotentiel au sol', '-', iip1, jjp1, & - thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt) call histend(histid) call histend(histuid)