/[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 113 by guez, Thu Sep 18 19:56:46 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 dimens_m, ONLY: iim, jjm, llm, nqmx
15      USE dimens_m, ONLY : iim, jjm, llm, nqmx      USE disvert_m, ONLY: ap, bp, pa, preff, presnivs
16      USE ener, ONLY : ang0, etot0, ptot0, stot0, ztot0      USE ener, ONLY: ang0, etot0, ptot0, stot0, ztot0
17      USE calendar, ONLY : ju2ymds, ymds2ju      USE iniadvtrac_m, ONLY: tname, ttext
18      USE iniadvtrac_m, ONLY : tname, ttext      USE ju2ymds_m, ONLY: ju2ymds
19      USE logic, ONLY : fxyhypb, ysinus      USE netcdf, ONLY: nf90_clobber, nf90_float, nf90_global, nf90_unlimited
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 paramet_m, ONLY: iip1, jjp1, llmp1
23      USE netcdf, ONLY : nf90_clobber, nf90_float, nf90_global, &      USE serre, ONLY: clat, clon, dzoomx, dzoomy, grossismx, grossismy, taux, &
24           nf90_unlimited           tauy
25      USE paramet_m, ONLY : iip1, jjp1, llmp1      USE temps, ONLY: annee_ref, day_ref
26      USE serre, ONLY : clat, clon, dzoomx, dzoomy, grossismx, grossismy, &      use ymds2ju_m, only: ymds2ju
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
84      tab_cntrl(22) = grossismx      tab_cntrl(22) = grossismx
85      tab_cntrl(23) = grossismy      tab_cntrl(23) = grossismy
86        tab_cntrl(24) = 1.
87      IF (fxyhypb) THEN      tab_cntrl(25) = dzoomx
88         tab_cntrl(24) = 1.      tab_cntrl(26) = dzoomy
89         tab_cntrl(25) = dzoomx      tab_cntrl(27) = 0.
90         tab_cntrl(26) = dzoomy      tab_cntrl(28) = taux
91         tab_cntrl(27) = 0.      tab_cntrl(29) = tauy
        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  
92    
93      tab_cntrl(30) = real(iday_end)      tab_cntrl(30) = real(iday_end)
94    
# Line 138  CONTAINS Line 124  CONTAINS
124      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)      CALL nf95_def_var(ncid, 'rlatv', nf90_float, idim_rlatv, varid)
125      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')      CALL nf95_put_att(ncid, varid, 'title', 'Latitudes des points V')
126    
     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')  
   
127      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)      CALL nf95_def_var(ncid, 'ap', nf90_float, idim_sig, varid)
128      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient A pour hybride')
129    
# Line 155  CONTAINS Line 134  CONTAINS
134    
135      ! Coefficients de passage cov. <-> contra. <--> naturel      ! Coefficients de passage cov. <-> contra. <--> naturel
136    
137      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)  
138      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour U')
139    
140      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)  
141      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')      CALL nf95_put_att(ncid, varid, 'title', 'Coefficient de passage pour V')
142    
143      ! Aire de chaque maille:      ! Aire de chaque maille:
144    
145      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'aire', nf90_float, (/idim_rlonv, idim_rlatu/), &
146      dims2(2) = idim_rlatu           varid)
     CALL nf95_def_var(ncid, 'aire', nf90_float, dims2, varid)  
147      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')      CALL nf95_put_att(ncid, varid, 'title', 'Aires de chaque maille')
148    
149      ! Geopentiel au sol:      ! Geopentiel au sol:
150    
151      dims2(1) = idim_rlonv      CALL nf95_def_var(ncid, 'phisinit', nf90_float, &
152      dims2(2) = idim_rlatu           (/idim_rlonv, idim_rlatu/), varid)
     CALL nf95_def_var(ncid, 'phisinit', nf90_float, dims2, varid)  
153      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Geopotentiel au sol')
154    
155      ! Definir les variables pour pouvoir les enregistrer plus tard:      ! Definir les variables pour pouvoir les enregistrer plus tard:
156    
157      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)      CALL nf95_def_var(ncid, 'temps', nf90_float, idim_tim, varid)
158      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')      CALL nf95_put_att(ncid, varid, 'title', 'Temps de simulation')
159      WRITE (unites, 200) yyears0, mmois0, jjour0      WRITE(unites, 200) yyears0, mmois0, jjour0
160  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')  200 FORMAT ('days since ', I4, '-', I2.2, '-', I2.2, ' 00:00:00')
161      CALL nf95_put_att(ncid, varid, 'units', unites)      CALL nf95_put_att(ncid, varid, 'units', unites)
162    
163        CALL nf95_def_var(ncid, 'ucov', nf90_float, &
164      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)  
165      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse U')
166    
167      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'vcov', nf90_float, &
168      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)  
169      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')      CALL nf95_put_att(ncid, varid, 'title', 'Vitesse V')
170    
171      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'teta', nf90_float, &
172      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)  
173      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')      CALL nf95_put_att(ncid, varid, 'title', 'Temperature')
174    
     dims4(1) = idim_rlonv  
     dims4(2) = idim_rlatu  
     dims4(3) = idim_s  
     dims4(4) = idim_tim  
175      DO iq = 1, nqmx      DO iq = 1, nqmx
176         CALL nf95_def_var(ncid, tname(iq), nf90_float, dims4, varid)         CALL nf95_def_var(ncid, tname(iq), nf90_float, &
177                (/idim_rlonv, idim_rlatu, idim_s, idim_tim/), varid)
178         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))         CALL nf95_put_att(ncid, varid, 'title', ttext(iq))
179      END DO      END DO
180    
181      dims4(1) = idim_rlonv      CALL nf95_def_var(ncid, 'masse', nf90_float, &
182      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)  
183      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')      CALL nf95_put_att(ncid, varid, 'title', 'C est quoi ?')
184    
185      dims3(1) = idim_rlonv      CALL nf95_def_var(ncid, 'ps', nf90_float, &
186      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)  
187      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')      CALL nf95_put_att(ncid, varid, 'title', 'Pression au sol')
188    
189      CALL nf95_enddef(ncid)      CALL nf95_enddef(ncid)
# Line 248  CONTAINS Line 203  CONTAINS
203      CALL nf95_inq_varid(ncid, 'rlatv', varid)      CALL nf95_inq_varid(ncid, 'rlatv', varid)
204      CALL nf95_put_var(ncid, varid, rlatv)      CALL nf95_put_var(ncid, varid, rlatv)
205    
     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)  
   
206      CALL nf95_inq_varid(ncid, 'ap', varid)      CALL nf95_inq_varid(ncid, 'ap', varid)
207      CALL nf95_put_var(ncid, varid, ap)      CALL nf95_put_var(ncid, varid, ap)
208    

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

  ViewVC Help
Powered by ViewVC 1.1.21