/[lmdze]/trunk/dyn3d/inithist.f
ViewVC logotype

Diff of /trunk/dyn3d/inithist.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/libf/bibio/inithist.f90 revision 39 by guez, Tue Jan 25 15:11:05 2011 UTC trunk/dyn3d/inithist.f revision 254 by guez, Mon Feb 5 10:39:38 2018 UTC
# Line 1  Line 1 
1  module inithist_m  module inithist_m
2    
   ! This module is clean: no C preprocessor directive, no include line  
   
3    implicit none    implicit none
4    
5  contains    integer histid, histvid, histuid
   
   subroutine inithist(day0, anne0, tstep, nq, fileid, filevid, t_ops, t_wrt)  
6    
7      ! From inithist.F, version 1.1.1.1 2004/05/19 12:53:05  contains
8    
9      ! Routine d'initialisation des écritures des fichiers histoires LMDZ    subroutine inithist(tstep, nq, t_ops, t_wrt)
     ! au format IOIPSL  
     ! Appels successifs des routines : histbeg, histhori, histver,  
     ! histdef, histend  
   
     ! Entrées :  
     ! day0, anne0: date de référence  
     ! tstep : durée du pas de temps en secondes  
     ! t_ops : fréquence de l'opération pour IOIPSL  
     ! 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  
10    
11        ! From inithist.F, version 1.1.1.1, 2004/05/19 12:53:05
12      ! L. Fairhead, LMD, 03/99      ! L. Fairhead, LMD, 03/99
13    
14      USE calendar      ! Routine d'initialisation des écritures des fichiers histoires au
15      use histcom      ! format IOIPSL.
16      use dimens_m  
17      use paramet_m      USE dimens_m, ONLY: jjm, llm
18      use comconst      USE disvert_m, ONLY: presnivs
19      use comvert      use dynetat0_m, only: day_ref, annee_ref, rlatu, rlatv, rlonu, rlonv
20      use logic      use histbeg_totreg_m, only: histbeg_totreg
21      use comgeom      USE histdef_m, ONLY: histdef
22      use serre      USE histend_m, ONLY: histend
23      use temps      USE histvert_m, ONLY: histvert
24      use ener      USE iniadvtrac_m, ONLY: ttext
25      use iniadvtrac_m      USE nr_util, ONLY: pi
26      use nr_util, only: pi      USE paramet_m, ONLY: iip1, jjp1
27        USE temps, ONLY: itau_dyn
28      ! Arguments      use ymds2ju_m, ONLY: ymds2ju
29      integer day0, anne0  
30      real, intent(in):: tstep, t_ops, t_wrt      real, intent(in):: tstep ! durée du pas de temps en secondes
31      integer fileid, filevid      integer, intent(in):: nq ! nombre de traceurs
32      integer nq      real, intent(in):: t_ops ! fréquence de l'opération pour IOIPSL
33        real, intent(in):: t_wrt ! fréquence d'écriture sur le fichier
34    
35      ! Variables locales      ! Local:
36      real zjulian      real julian
37      integer iq      integer iq
     real rlong(iip1, jjp1), rlat(iip1, jjp1)  
38      integer uhoriid, vhoriid, thoriid, zvertiid      integer uhoriid, vhoriid, thoriid, zvertiid
     integer ii, jj  
     integer zan, dayref  
39    
40      !-----------------------------------------------------------------------      !-----------------------------------------------------------------------
41    
42      ! Appel a histbeg: creation du fichier netcdf et initialisations diverses      print *, "Call sequence information: inithist"
43        CALL ymds2ju(annee_ref, 1, day_ref, 0., julian)
44    
45      zan = anne0      call histbeg_totreg("dyn_histu.nc", rlonu * 180. / pi, rlatu * 180. / pi, &
46      dayref = day0           1, iip1, 1, jjp1, itau_dyn, julian, tstep, uhoriid, histuid)
     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  
47    
     call histbeg_totreg("dyn_hist.nc", rlong(:, 1), rlat(1, :), &  
          1, iip1, 1, jjp1, &  
          itau_dyn, zjulian, tstep, uhoriid, fileid)  
     !  
48      ! Creation du fichier histoire pour la grille en V (oblige pour l'instant,      ! Creation du fichier histoire pour la grille en V (oblige pour l'instant,
49      ! IOIPSL ne permet pas de grilles avec des nombres de point differents dans      ! IOIPSL ne permet pas de grilles avec des nombres de point differents dans
50      ! un meme fichier)      ! un meme fichier)
51    
52      do jj = 1, jjm      call histbeg_totreg('dyn_histv.nc', rlonv * 180. / pi, rlatv * 180. / pi, &
53         do ii = 1, iip1           1, iip1, 1, jjm, itau_dyn, julian, tstep, vhoriid, histvid)
           rlong(ii, jj) = rlonv(ii) * 180. / pi  
           rlat(ii, jj) = rlatv(jj) * 180. / pi  
        enddo  
     enddo  
54    
55      call histbeg_totreg('dyn_histv.nc', rlong(:, 1), rlat(1, :jjm), &      call histbeg_totreg("dyn_hist.nc", rlonv * 180. / pi, rlatu * 180. / pi, &
56           1, iip1, 1, jjm, &           1, iip1, 1, jjp1, itau_dyn, julian, tstep, thoriid, histid)
57           itau_dyn, zjulian, tstep, vhoriid, filevid)  
58      !      call histvert(histid, 'presnivs', 'Niveaux pression', 'mb', presnivs/100., &
59      ! Appel a histhori pour rajouter les autres grilles horizontales           zvertiid, 'down')
60      !      call histvert(histvid, 'presnivs', 'Niveaux pression', 'mb', &
61      do jj = 1, jjp1           presnivs/100., zvertiid, 'down')
62         do ii = 1, iip1      call histvert(histuid, 'presnivs', 'Niveaux pression', 'mb', &
63            rlong(ii, jj) = rlonv(ii) * 180. / pi           presnivs/100., zvertiid, 'down')
64            rlat(ii, jj) = rlatu(jj) * 180. / pi  
65         enddo      call histdef(histuid, 'u', 'vent u', 'm/s', iip1, jjp1, uhoriid, llm, 1, &
66      enddo           llm, zvertiid, 'inst(X)', t_ops, t_wrt)
67        call histdef(histvid, 'v', 'vent v', 'm/s', iip1, jjm, vhoriid, llm, 1, &
68             llm, zvertiid, 'inst(X)', t_ops, t_wrt)
69        call histdef(histid, 'teta', 'temperature potentielle', '-', iip1, jjp1, &
70             thoriid, llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
71        call histdef(histid, 'phi', 'geopotentiel', '-', iip1, jjp1, thoriid, &
72             llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
73    
     call histhori_regular(fileid, iip1, rlong, jjp1, rlat, 'scalar', &  
          'Grille points scalaires', thoriid)  
     !  
     ! 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)  
     !  
     ! Appels a histdef pour la definition des variables a sauvegarder  
     !  
     ! Vents U  
     !  
     call histdef(fileid, 'ucov', 'vents u covariants', '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', &  
          iip1, jjm, vhoriid, llm, 1, llm, zvertiid, &  
          'inst(X)', t_ops, t_wrt)  
   
     !  
     ! Temperature potentielle  
     !  
     call histdef(fileid, 'teta', 'temperature potentielle', '-', &  
          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &  
          'inst(X)', t_ops, t_wrt)  
     !  
     ! Geopotentiel  
     !  
     call histdef(fileid, 'phi', 'geopotentiel instantane', '-', &  
          iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &  
          'inst(X)', t_ops, t_wrt)  
     !  
74      ! Traceurs      ! Traceurs
75      !      DO iq = 1, nq
76      DO iq=1, nq         call histdef(histid, ttext(iq), ttext(iq), '-', iip1, jjp1, thoriid, &
77         call histdef(fileid, ttext(iq), ttext(iq), '-', &              llm, 1, llm, zvertiid, 'inst(X)', t_ops, t_wrt)
             iip1, jjp1, thoriid, llm, 1, llm, zvertiid, &  
             'inst(X)', t_ops, t_wrt)  
78      enddo      enddo
79      !  
80      ! Masse      call histdef(histid, 'masse', 'masse', 'kg', iip1, jjp1, thoriid, llm, 1, &
81      !           llm, zvertiid, 'inst(X)', t_ops, t_wrt)
82      call histdef(fileid, 'masse', 'masse', 'kg', &      call histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', iip1, jjp1, &
83           iip1, jjp1, thoriid, 1, 1, 1, -99, &           thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt)
84           'inst(X)', t_ops, t_wrt)      call histdef(histid, 'phis', 'geopotentiel au sol', '-', iip1, jjp1, &
85      !           thoriid, 1, 1, 1, -99, 'inst(X)', t_ops, t_wrt)
86      ! Pression au sol  
87      !      call histend(histid)
88      call histdef(fileid, 'ps', 'pression naturelle au sol', 'Pa', &      call histend(histuid)
89           iip1, jjp1, thoriid, 1, 1, 1, -99, &      call histend(histvid)
          'inst(X)', t_ops, t_wrt)  
     !  
     ! Pression au sol  
     !  
     call histdef(fileid, 'phis', 'geopotentiel au sol', '-', &  
          iip1, jjp1, thoriid, 1, 1, 1, -99, &  
          'inst(X)', t_ops, t_wrt)  
     !  
     ! Fin  
     !  
     call histend(fileid)  
     call histend(filevid)  
90    
91    end subroutine inithist    end subroutine inithist
92    

Legend:
Removed from v.39  
changed lines
  Added in v.254

  ViewVC Help
Powered by ViewVC 1.1.21