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

Diff of /trunk/dyn3d/dynredem0.f

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

revision 57 by guez, Mon Jan 30 12:54:02 2012 UTC revision 62 by guez, Thu Jul 26 14:37:37 2012 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 comvert, ONLY: ap, bp, nivsig, nivsigs, pa, preff, presnivs
14      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
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 ener, ONLY: ang0, etot0, ptot0, stot0, ztot0
17      USE calendar, ONLY : ju2ymds, ymds2ju      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 conf_gcm_m, ONLY: fxyhypb, ysinus
20      USE netcdf95, ONLY : nf95_close, nf95_create, nf95_def_dim, &      USE netcdf95, ONLY: nf95_close, nf95_create, nf95_def_dim, nf95_def_var, &
21           nf95_def_var, nf95_enddef, nf95_inq_varid, nf95_put_att, &           nf95_enddef, nf95_inq_varid, nf95_put_att, nf95_put_var
22           nf95_put_var      USE netcdf, ONLY: nf90_clobber, nf90_float, nf90_global, nf90_unlimited
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  
28      USE temps, ONLY : annee_ref, day_ref      CHARACTER(len=*), INTENT(IN):: fichnom
29        INTEGER, INTENT(IN):: iday_end
30      CHARACTER (len=*), INTENT (IN) :: fichnom      REAL, INTENT(IN):: phis(:, :)
     INTEGER, INTENT (IN) :: iday_end  
     REAL, INTENT (IN) :: phis(:, :)  
31    
32      !   Local:      ! Local:
33    
34      INTEGER :: iq, l      INTEGER iq, l
35      INTEGER, PARAMETER:: length = 100      INTEGER, PARAMETER:: length = 100
36      REAL :: tab_cntrl(length) ! tableau des parametres du run      REAL tab_cntrl(length) ! tableau des paramètres du run
37    
38      !   Variables locales pour NetCDF:      ! Variables locales pour NetCDF:
39    
40      INTEGER :: dims2(2), dims3(3), dims4(4)      INTEGER idim_index
41      INTEGER :: idim_index      INTEGER idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv
42      INTEGER :: idim_rlonu, idim_rlonv, idim_rlatu, idim_rlatv      INTEGER idim_s, idim_sig
43      INTEGER :: idim_s, idim_sig      INTEGER idim_tim
44      INTEGER :: idim_tim      INTEGER ncid, varid
45      INTEGER :: ncid, varid  
46        REAL zjulian, hours
47      REAL :: zjulian, hours      INTEGER yyears0, jjour0, mmois0
48      INTEGER :: yyears0, jjour0, mmois0      CHARACTER(len=30) unites
     CHARACTER (len=30) :: unites  
49    
50      !-----------------------------------------------------------------------      !-----------------------------------------------------------------------
51    
# Line 80  CONTAINS Line 77  CONTAINS
77      tab_cntrl(18) = pa      tab_cntrl(18) = pa
78      tab_cntrl(19) = preff      tab_cntrl(19) = preff
79    
80      ! Paramètres  pour le zoom :      ! Paramètres pour le zoom :
81    
82      tab_cntrl(20) = clon      tab_cntrl(20) = clon
83      tab_cntrl(21) = clat      tab_cntrl(21) = clat
# Line 155  CONTAINS Line 152  CONTAINS
152    
153      ! Coefficients de passage cov. <-> contra. <--> naturel      ! Coefficients de passage cov. <-> contra. <--> naturel
154    
155      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)  
156      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')
157    
158      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)  
159      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')
160    
161      ! Aire de chaque maille:      ! Aire de chaque maille:
162    
163      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'aire', nf90_float, (/idim_rlonv, idim_rlatu/), &
164      dims2(2) = idim_rlatu           varid)
     CALL nf95_def_var(ncid, 'aire', nf90_float, dims2, varid)  
165      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')
166    
167      ! Geopentiel au sol:      ! Geopentiel au sol:
168    
169      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'phisinit', nf90_float, &
170      dims2(2) = idim_rlatu           (/idim_rlonv, idim_rlatu/), varid)
     CALL nf95_def_var(ncid, 'phisinit', nf90_float, dims2, varid)  
171      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')
172    
173      ! Definir les variables pour pouvoir les enregistrer plus tard:      ! Definir les variables pour pouvoir les enregistrer plus tard:
174    
175      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)
176      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')
177      WRITE (unites, 200) yyears0, mmois0, jjour0      WRITE(unites, 200) yyears0, mmois0, jjour0
178  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')
179      CALL nf95_put_att(ncid, varid, 'units', unites)      CALL nf95_put_att(ncid, varid, 'units', unites)
180    
181        CALL nf95_def_var(ncid, 'ucov', nf90_float, &
182      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)  
183      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')
184    
185      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'vcov', nf90_float, &
186      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)  
187      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')
188    
189      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'teta', nf90_float, &
190      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)  
191      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')
192    
     dims4(1) = idim_rlonv  
     dims4(2) = idim_rlatu  
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
193      DO iq = 1, nqmx      DO iq = 1, nqmx
194         CALL nf95_def_var(ncid, tname(iq), nf90_float, dims4, varid)         CALL nf95_def_var(ncid, tname(iq), nf90_float, &
195                (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)
196         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))
197      END DO      END DO
198    
199      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'masse', nf90_float, &
200      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)  
201      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')
202    
203      dims3(1) = idim_rlonv      CALL nf95_def_var(ncid, 'ps', nf90_float, &
204      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)  
205      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')
206    
207      CALL nf95_enddef(ncid)      CALL nf95_enddef(ncid)

Legend:
Removed from v.57  
changed lines
  Added in v.62

  ViewVC Help
Powered by ViewVC 1.1.21