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

Diff of /trunk/dyn3d/dynredem0.f

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

trunk/dyn3d/dynredem0.f revision 82 by guez, Wed Mar 5 14:57:53 2014 UTC trunk/Sources/dyn3d/dynredem0.f revision 134 by guez, Wed Apr 29 15:47:56 2015 UTC
# Line 10  CONTAINS Line 10  CONTAINS
10      ! Ecriture du fichier de redémarrage au format NetCDF (initialisation)      ! Ecriture du fichier de redémarrage au format NetCDF (initialisation)
11    
12      USE comconst, ONLY: cpp, daysec, dtvr, g, kappa, omeg, rad      USE comconst, ONLY: cpp, daysec, dtvr, g, kappa, omeg, rad
     USE disvert_m, ONLY: ap, bp, nivsig, nivsigs, pa, preff, presnivs  
13      USE comgeom, ONLY: aire_2d, cu_2d, cv_2d, rlatu, rlatv, rlonu, rlonv      USE comgeom, ONLY: aire_2d, cu_2d, cv_2d, rlatu, rlatv, rlonu, rlonv
14      USE dimens_m, ONLY: iim, jjm, llm, nqmx      USE dimens_m, ONLY: iim, jjm, llm, nqmx
15        USE disvert_m, ONLY: ap, bp, pa, preff, presnivs
16        use dynetat0_m, only: day_ref, annee_ref
17      USE ener, ONLY: ang0, etot0, ptot0, stot0, ztot0      USE ener, ONLY: ang0, etot0, ptot0, stot0, ztot0
     USE calendar, ONLY: ju2ymds, ymds2ju  
18      USE iniadvtrac_m, ONLY: tname, ttext      USE iniadvtrac_m, ONLY: tname, ttext
19      use conf_gcm_m, ONLY: fxyhypb, ysinus      USE ju2ymds_m, ONLY: ju2ymds
20        USE netcdf, ONLY: nf90_clobber, nf90_float, nf90_global, nf90_unlimited
21      USE netcdf95, ONLY: nf95_close, nf95_create, nf95_def_dim, nf95_def_var, &      USE netcdf95, ONLY: nf95_close, nf95_create, nf95_def_dim, nf95_def_var, &
22           nf95_enddef, nf95_inq_varid, nf95_put_att, nf95_put_var           nf95_enddef, nf95_inq_varid, nf95_put_att, nf95_put_var
     USE netcdf, ONLY: nf90_clobber, nf90_float, nf90_global, nf90_unlimited  
23      USE paramet_m, ONLY: iip1, jjp1, llmp1      USE paramet_m, ONLY: iip1, jjp1, llmp1
24      USE serre, ONLY: clat, clon, dzoomx, dzoomy, grossismx, grossismy, taux, &      USE serre, ONLY: clat, clon, dzoomx, dzoomy, grossismx, grossismy, taux, &
25           tauy           tauy
26      USE temps, ONLY: annee_ref, day_ref      use ymds2ju_m, only: ymds2ju
27    
28      CHARACTER(len=*), INTENT(IN):: fichnom      CHARACTER(len=*), INTENT(IN):: fichnom
29      INTEGER, INTENT(IN):: iday_end      INTEGER, INTENT(IN):: iday_end
# Line 35  CONTAINS Line 35  CONTAINS
35      INTEGER, PARAMETER:: length = 100      INTEGER, PARAMETER:: length = 100
36      REAL tab_cntrl(length) ! tableau des paramètres du run      REAL tab_cntrl(length) ! tableau des paramètres du run
37    
38      ! Variables locales pour NetCDF:      ! Pour NetCDF :
   
39      INTEGER idim_index      INTEGER idim_index
40      INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv      INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv
41      INTEGER idim_s, idim_sig      INTEGER idim_s, idim_sig
42      INTEGER idim_tim      INTEGER dimid_temps
43      INTEGER ncid, varid      INTEGER ncid, varid
44    
45      REAL zjulian, hours      REAL zjulian, hours
# Line 57  CONTAINS Line 56  CONTAINS
56      DO l = 1, length      DO l = 1, length
57         tab_cntrl(l) = 0.         tab_cntrl(l) = 0.
58      END DO      END DO
59      tab_cntrl(1) = real(iim)      tab_cntrl(1) = iim
60      tab_cntrl(2) = real(jjm)      tab_cntrl(2) = jjm
61      tab_cntrl(3) = real(llm)      tab_cntrl(3) = llm
62      tab_cntrl(4) = real(day_ref)      tab_cntrl(4) = day_ref
63      tab_cntrl(5) = real(annee_ref)      tab_cntrl(5) = annee_ref
64      tab_cntrl(6) = rad      tab_cntrl(6) = rad
65      tab_cntrl(7) = omeg      tab_cntrl(7) = omeg
66      tab_cntrl(8) = g      tab_cntrl(8) = g
# Line 78  CONTAINS Line 77  CONTAINS
77      tab_cntrl(19) = preff      tab_cntrl(19) = preff
78    
79      ! Paramètres pour le zoom :      ! Paramètres pour le zoom :
   
80      tab_cntrl(20) = clon      tab_cntrl(20) = clon
81      tab_cntrl(21) = clat      tab_cntrl(21) = clat
82      tab_cntrl(22) = grossismx      tab_cntrl(22) = grossismx
83      tab_cntrl(23) = grossismy      tab_cntrl(23) = grossismy
84        tab_cntrl(24) = 1.
85        tab_cntrl(25) = dzoomx
86        tab_cntrl(26) = dzoomy
87        tab_cntrl(27) = 0.
88        tab_cntrl(28) = taux
89        tab_cntrl(29) = tauy
90    
91      IF (fxyhypb) THEN      tab_cntrl(30) = iday_end
        tab_cntrl(24) = 1.  
        tab_cntrl(25) = dzoomx  
        tab_cntrl(26) = dzoomy  
        tab_cntrl(27) = 0.  
        tab_cntrl(28) = taux  
        tab_cntrl(29) = tauy  
     ELSE  
        tab_cntrl(24) = 0.  
        tab_cntrl(25) = dzoomx  
        tab_cntrl(26) = dzoomy  
        tab_cntrl(27) = 0.  
        tab_cntrl(28) = 0.  
        tab_cntrl(29) = 0.  
        IF (ysinus) tab_cntrl(27) = 1.  
     END IF  
   
     tab_cntrl(30) = real(iday_end)  
92    
93      CALL nf95_create(fichnom, nf90_clobber, ncid)      CALL nf95_create(fichnom, nf90_clobber, ncid)
94      CALL nf95_put_att(ncid, nf90_global, 'title', &      CALL nf95_put_att(ncid, nf90_global, 'title', &
# Line 116  CONTAINS Line 103  CONTAINS
103      CALL nf95_def_dim(ncid, 'rlatv', jjm, idim_rlatv)      CALL nf95_def_dim(ncid, 'rlatv', jjm, idim_rlatv)
104      CALL nf95_def_dim(ncid, 'sigs', llm, idim_s)      CALL nf95_def_dim(ncid, 'sigs', llm, idim_s)
105      CALL nf95_def_dim(ncid, 'sig', llmp1, idim_sig)      CALL nf95_def_dim(ncid, 'sig', llmp1, idim_sig)
106      CALL nf95_def_dim(ncid, 'temps', nf90_unlimited, idim_tim)      CALL nf95_def_dim(ncid, 'temps', nf90_unlimited, dimid_temps)
107    
108      ! Definir et enregistrer certains champs invariants:      ! Definir et enregistrer certains champs invariants:
109    
# Line 135  CONTAINS Line 122  CONTAINS
122      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)
123      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')
124    
     CALL nf95_def_var(ncid, 'nivsigs', nf90_float, idim_s, varid)  
     CALL nf95_put_att(ncid, varid, 'title', 'Numero naturel des couches s')  
   
     CALL nf95_def_var(ncid, 'nivsig', nf90_float, idim_sig, varid)  
     CALL nf95_put_att(ncid, varid, 'title', &  
          'Numero naturel des couches sigma')  
   
125      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)
126      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')
127    
# Line 172  CONTAINS Line 152  CONTAINS
152    
153      ! Definir les variables pour pouvoir les enregistrer plus tard:      ! Definir les variables pour pouvoir les enregistrer plus tard:
154    
155      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)      CALL nf95_def_var(ncid, 'temps', nf90_float, dimid_temps, varid)
156      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')
157      WRITE(unites, 200) yyears0, mmois0, jjour0      WRITE(unites, fmt = 200) yyears0, mmois0, jjour0
158  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')
159      CALL nf95_put_att(ncid, varid, 'units', unites)      CALL nf95_put_att(ncid, varid, 'units', unites)
160    
161      CALL nf95_def_var(ncid, 'ucov', nf90_float, &      CALL nf95_def_var(ncid, 'ucov', nf90_float, &
162           (/idim_rlonu, idim_rlatu, idim_s, idim_tim/), varid)           (/idim_rlonu, idim_rlatu, idim_s, dimid_temps/), varid)
163      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')
164    
165      CALL nf95_def_var(ncid, 'vcov', nf90_float, &      CALL nf95_def_var(ncid, 'vcov', nf90_float, &
166           (/idim_rlonv, idim_rlatv, idim_s, idim_tim/), varid)           (/idim_rlonv, idim_rlatv, idim_s, dimid_temps/), varid)
167      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')
168    
169      CALL nf95_def_var(ncid, 'teta', nf90_float, &      CALL nf95_def_var(ncid, 'teta', nf90_float, &
170           (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)           (/idim_rlonv, idim_rlatu, idim_s, dimid_temps/), varid)
171      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')
172    
173      DO iq = 1, nqmx      DO iq = 1, nqmx
174         CALL nf95_def_var(ncid, tname(iq), nf90_float, &         CALL nf95_def_var(ncid, tname(iq), nf90_float, &
175              (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)              (/idim_rlonv, idim_rlatu, idim_s, dimid_temps/), varid)
176         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))
177      END DO      END DO
178    
179      CALL nf95_def_var(ncid, 'masse', nf90_float, &      CALL nf95_def_var(ncid, 'masse', nf90_float, &
180           (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)           (/idim_rlonv, idim_rlatu, idim_s, dimid_temps/), varid)
181      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')
182    
183      CALL nf95_def_var(ncid, 'ps', nf90_float, &      CALL nf95_def_var(ncid, 'ps', nf90_float, &
184           (/idim_rlonv, idim_rlatu, idim_tim/), varid)           (/idim_rlonv, idim_rlatu, dimid_temps/), varid)
185      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')
186    
187      CALL nf95_enddef(ncid)      CALL nf95_enddef(ncid)
# Line 221  CONTAINS Line 201  CONTAINS
201      CALL nf95_inq_varid(ncid, 'rlatv', varid)      CALL nf95_inq_varid(ncid, 'rlatv', varid)
202      CALL nf95_put_var(ncid, varid, rlatv)      CALL nf95_put_var(ncid, varid, rlatv)
203    
     CALL nf95_inq_varid(ncid, 'nivsigs', varid)  
     CALL nf95_put_var(ncid, varid, nivsigs)  
   
     CALL nf95_inq_varid(ncid, 'nivsig', varid)  
     CALL nf95_put_var(ncid, varid, nivsig)  
   
204      CALL nf95_inq_varid(ncid, 'ap', varid)      CALL nf95_inq_varid(ncid, 'ap', varid)
205      CALL nf95_put_var(ncid, varid, ap)      CALL nf95_put_var(ncid, varid, ap)
206    

Legend:
Removed from v.82  
changed lines
  Added in v.134

  ViewVC Help
Powered by ViewVC 1.1.21