/[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/libf/dyn3d/dynredem0.f90 revision 39 by guez, Tue Jan 25 15:11:05 2011 UTC trunk/dyn3d/dynredem0.f revision 92 by guez, Wed Mar 26 18:16:05 2014 UTC
# Line 9  CONTAINS Line 9  CONTAINS
9      ! From dyn3d/dynredem.F, version 1.2 2004/06/22 11:45:30      ! From dyn3d/dynredem.F, version 1.2 2004/06/22 11:45:30
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
13      USE comvert, ONLY : ap, bp, nivsig, nivsigs, pa, preff, presnivs      USE comgeom, ONLY: aire_2d, cu_2d, cv_2d, rlatu, rlatv, rlonu, rlonv
14      USE comgeom, ONLY : aire_2d, cu_2d, cv_2d, rlatu, rlatv, rlonu, rlonv      use conf_gcm_m, ONLY: fxyhypb, ysinus
15      USE dimens_m, ONLY : iim, jjm, llm, nqmx      USE dimens_m, ONLY: iim, jjm, llm, nqmx
16      USE ener, ONLY : ang0, etot0, ptot0, stot0, ztot0      USE disvert_m, ONLY: ap, bp, pa, preff, presnivs
17      USE calendar, ONLY : ju2ymds, ymds2ju      USE ener, ONLY: ang0, etot0, ptot0, stot0, ztot0
18      USE iniadvtrac_m, ONLY : tname, ttext      USE iniadvtrac_m, ONLY: tname, ttext
19      USE logic, ONLY : fxyhypb, ysinus      USE ju2ymds_m, ONLY: ju2ymds
20      USE netcdf95, ONLY : nf95_close, nf95_create, nf95_def_dim, &      USE netcdf, ONLY: nf90_clobber, nf90_float, nf90_global, nf90_unlimited
21           nf95_def_var, nf95_enddef, nf95_inq_varid, nf95_put_att, &      USE netcdf95, ONLY: nf95_close, nf95_create, nf95_def_dim, nf95_def_var, &
22           nf95_put_var           nf95_enddef, nf95_inq_varid, nf95_put_att, nf95_put_var
23      USE netcdf, ONLY : nf90_clobber, nf90_float, nf90_global, &      USE paramet_m, ONLY: iip1, jjp1, llmp1
24           nf90_unlimited      USE serre, ONLY: clat, clon, dzoomx, dzoomy, grossismx, grossismy, taux, &
25      USE paramet_m, ONLY : iip1, jjp1, llmp1           tauy
26      USE serre, ONLY : clat, clon, dzoomx, dzoomy, grossismx, grossismy, &      USE temps, ONLY: annee_ref, day_ref
27           taux, tauy      use ymds2ju_m, only: ymds2ju
28      USE temps, ONLY : annee_ref, day_ref  
29        CHARACTER(len=*), INTENT(IN):: fichnom
30      CHARACTER (len=*), INTENT (IN) :: fichnom      INTEGER, INTENT(IN):: iday_end
31      INTEGER, INTENT (IN) :: iday_end      REAL, INTENT(IN):: phis(:, :)
     REAL, INTENT (IN) :: phis(:, :)  
32    
33      !   Local:      ! Local:
34    
35      INTEGER :: iq, l      INTEGER iq, l
36      INTEGER, PARAMETER:: length = 100      INTEGER, PARAMETER:: length = 100
37      REAL :: tab_cntrl(length) ! tableau des parametres du run      REAL tab_cntrl(length) ! tableau des paramètres du run
38    
39      !   Variables locales pour NetCDF:      ! Variables locales pour NetCDF:
40    
41      INTEGER :: dims2(2), dims3(3), dims4(4)      INTEGER idim_index
42      INTEGER :: idim_index      INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv
43      INTEGER :: idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv      INTEGER idim_s, idim_sig
44      INTEGER :: idim_s, idim_sig      INTEGER idim_tim
45      INTEGER :: idim_tim      INTEGER ncid, varid
46      INTEGER :: ncid, varid  
47        REAL zjulian, hours
48      REAL :: zjulian, hours      INTEGER yyears0, jjour0, mmois0
49      INTEGER :: yyears0, jjour0, mmois0      CHARACTER(len=30) unites
     CHARACTER (len=30) :: unites  
50    
51      !-----------------------------------------------------------------------      !-----------------------------------------------------------------------
52    
# Line 80  CONTAINS Line 78  CONTAINS
78      tab_cntrl(18) = pa      tab_cntrl(18) = pa
79      tab_cntrl(19) = preff      tab_cntrl(19) = preff
80    
81      ! Paramètres  pour le zoom :      ! Paramètres pour le zoom :
82    
83      tab_cntrl(20) = clon      tab_cntrl(20) = clon
84      tab_cntrl(21) = clat      tab_cntrl(21) = clat
# Line 138  CONTAINS Line 136  CONTAINS
136      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)
137      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')
138    
     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')  
   
139      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)
140      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')
141    
# Line 155  CONTAINS Line 146  CONTAINS
146    
147      ! Coefficients de passage cov. <-> contra. <--> naturel      ! Coefficients de passage cov. <-> contra. <--> naturel
148    
149      dims2(1) = idim_rlonu      CALL nf95_def_var(ncid, 'cu', nf90_float, (/idim_rlonu, idim_rlatu/), varid)
     dims2(2) = idim_rlatu  
     CALL nf95_def_var(ncid, 'cu', nf90_float, dims2, varid)  
150      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')
151    
152      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'cv', nf90_float, (/idim_rlonv, idim_rlatv/), varid)
     dims2(2) = idim_rlatv  
     CALL nf95_def_var(ncid, 'cv', nf90_float, dims2, varid)  
153      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')
154    
155      ! Aire de chaque maille:      ! Aire de chaque maille:
156    
157      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'aire', nf90_float, (/idim_rlonv, idim_rlatu/), &
158      dims2(2) = idim_rlatu           varid)
     CALL nf95_def_var(ncid, 'aire', nf90_float, dims2, varid)  
159      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')
160    
161      ! Geopentiel au sol:      ! Geopentiel au sol:
162    
163      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'phisinit', nf90_float, &
164      dims2(2) = idim_rlatu           (/idim_rlonv, idim_rlatu/), varid)
     CALL nf95_def_var(ncid, 'phisinit', nf90_float, dims2, varid)  
165      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')
166    
167      ! Definir les variables pour pouvoir les enregistrer plus tard:      ! Definir les variables pour pouvoir les enregistrer plus tard:
168    
169      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)
170      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')
171      WRITE (unites, 200) yyears0, mmois0, jjour0      WRITE(unites, 200) yyears0, mmois0, jjour0
172  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')
173      CALL nf95_put_att(ncid, varid, 'units', unites)      CALL nf95_put_att(ncid, varid, 'units', unites)
174    
175        CALL nf95_def_var(ncid, 'ucov', nf90_float, &
176      dims4(1) = idim_rlonu           (/idim_rlonu, idim_rlatu, idim_s, idim_tim/), varid)
     dims4(2) = idim_rlatu  
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
     CALL nf95_def_var(ncid, 'ucov', nf90_float, dims4, varid)  
177      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')
178    
179      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'vcov', nf90_float, &
180      dims4(2) = idim_rlatv           (/idim_rlonv, idim_rlatv, idim_s, idim_tim/), varid)
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
     CALL nf95_def_var(ncid, 'vcov', nf90_float, dims4, varid)  
181      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')
182    
183      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'teta', nf90_float, &
184      dims4(2) = idim_rlatu           (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
     CALL nf95_def_var(ncid, 'teta', nf90_float, dims4, varid)  
185      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')
186    
     dims4(1) = idim_rlonv  
     dims4(2) = idim_rlatu  
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
187      DO iq = 1, nqmx      DO iq = 1, nqmx
188         CALL nf95_def_var(ncid, tname(iq), nf90_float, dims4, varid)         CALL nf95_def_var(ncid, tname(iq), nf90_float, &
189                (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)
190         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))
191      END DO      END DO
192    
193      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'masse', nf90_float, &
194      dims4(2) = idim_rlatu           (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
     CALL nf95_def_var(ncid, 'masse', nf90_float, dims4, varid)  
195      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')
196    
197      dims3(1) = idim_rlonv      CALL nf95_def_var(ncid, 'ps', nf90_float, &
198      dims3(2) = idim_rlatu           (/idim_rlonv, idim_rlatu, idim_tim/), varid)
     dims3(3) = idim_tim  
     CALL nf95_def_var(ncid, 'ps', nf90_float, dims3, varid)  
199      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')
200    
201      CALL nf95_enddef(ncid)      CALL nf95_enddef(ncid)
# Line 248  CONTAINS Line 215  CONTAINS
215      CALL nf95_inq_varid(ncid, 'rlatv', varid)      CALL nf95_inq_varid(ncid, 'rlatv', varid)
216      CALL nf95_put_var(ncid, varid, rlatv)      CALL nf95_put_var(ncid, varid, rlatv)
217    
     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)  
   
218      CALL nf95_inq_varid(ncid, 'ap', varid)      CALL nf95_inq_varid(ncid, 'ap', varid)
219      CALL nf95_put_var(ncid, varid, ap)      CALL nf95_put_var(ncid, varid, ap)
220    

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

  ViewVC Help
Powered by ViewVC 1.1.21