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

Diff of /trunk/dyn3d/leapfrog.f

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

trunk/dyn3d/leapfrog.f revision 129 by guez, Fri Feb 13 18:22:38 2015 UTC trunk/Sources/dyn3d/leapfrog.f revision 161 by guez, Fri Jul 24 14:27:59 2015 UTC
# Line 18  contains Line 18  contains
18      USE calfis_m, ONLY: calfis      USE calfis_m, ONLY: calfis
19      USE comconst, ONLY: daysec, dtvr      USE comconst, ONLY: daysec, dtvr
20      USE comgeom, ONLY: aire_2d, apoln, apols      USE comgeom, ONLY: aire_2d, apoln, apols
21        use covcont_m, only: covcont
22      USE disvert_m, ONLY: ap, bp      USE disvert_m, ONLY: ap, bp
23      USE conf_gcm_m, ONLY: day_step, iconser, iperiod, iphysiq, nday, offline, &      USE conf_gcm_m, ONLY: day_step, iconser, iperiod, iphysiq, nday, offline, &
24           iflag_phys, iecri           iflag_phys, iecri
# Line 27  contains Line 28  contains
28      USE dynetat0_m, ONLY: day_ini      USE dynetat0_m, ONLY: day_ini
29      use dynredem1_m, only: dynredem1      use dynredem1_m, only: dynredem1
30      USE exner_hyb_m, ONLY: exner_hyb      USE exner_hyb_m, ONLY: exner_hyb
31      use filtreg_m, only: filtreg      use filtreg_scal_m, only: filtreg_scal
32      use fluxstokenc_m, only: fluxstokenc      use fluxstokenc_m, only: fluxstokenc
33      use geopot_m, only: geopot      use geopot_m, only: geopot
34      USE guide_m, ONLY: guide      USE guide_m, ONLY: guide
# Line 88  contains Line 89  contains
89      ! Variables pour le fichier histoire      ! Variables pour le fichier histoire
90      INTEGER itau ! index of the time step of the dynamics, starts at 0      INTEGER itau ! index of the time step of the dynamics, starts at 0
91      INTEGER itaufin      INTEGER itaufin
     REAL time ! time of day, as a fraction of day length  
     real finvmaold(iim + 1, jjm + 1, llm)  
92      INTEGER l      INTEGER l
93    
94      ! Variables test conservation \'energie      ! Variables test conservation \'energie
# Line 109  contains Line 108  contains
108    
109      ! On initialise la pression et la fonction d'Exner :      ! On initialise la pression et la fonction d'Exner :
110      forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps      forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps
111      CALL exner_hyb(ps, p3d, pks, pk, pkf)      CALL exner_hyb(ps, p3d, pks, pk)
112        pkf = pk
113        CALL filtreg_scal(pkf, direct = .true., intensive = .true.)
114    
115      time_integration: do itau = 0, itaufin - 1      time_integration: do itau = 0, itaufin - 1
116         leapf = mod(itau, iperiod) /= 0         leapf = mod(itau, iperiod) /= 0
# Line 124  contains Line 125  contains
125            tetam1 = teta            tetam1 = teta
126            massem1 = masse            massem1 = masse
127            psm1 = ps            psm1 = ps
           finvmaold = masse  
           CALL filtreg(finvmaold, direct = .false., intensive = .false.)  
128         end if         end if
129    
130         ! Calcul des tendances dynamiques:         ! Calcul des tendances dynamiques:
# Line 142  contains Line 141  contains
141    
142         ! Int\'egrations dynamique et traceurs:         ! Int\'egrations dynamique et traceurs:
143         CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, dteta, &         CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, dteta, &
144              dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, finvmaold, dt, &              dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, dt, leapf)
             leapf)  
145    
146         forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps         forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps
147         CALL exner_hyb(ps, p3d, pks, pk, pkf)         CALL exner_hyb(ps, p3d, pks, pk)
148           pkf = pk
149           CALL filtreg_scal(pkf, direct = .true., intensive = .true.)
150    
151         if (.not. leapf) then         if (.not. leapf) then
152            ! Matsuno backward            ! Matsuno backward
# Line 157  contains Line 157  contains
157    
158            ! integrations dynamique et traceurs:            ! integrations dynamique et traceurs:
159            CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, &            CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, &
160                 dteta, dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, &                 dteta, dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, dtvr, &
161                 finvmaold, dtvr, leapf=.false.)                 leapf=.false.)
162    
163            forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps            forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps
164            CALL exner_hyb(ps, p3d, pks, pk, pkf)            CALL exner_hyb(ps, p3d, pks, pk)
165              pkf = pk
166              CALL filtreg_scal(pkf, direct = .true., intensive = .true.)
167         end if         end if
168    
169         IF (MOD(itau + 1, iphysiq) == 0 .AND. iflag_phys /= 0) THEN         IF (MOD(itau + 1, iphysiq) == 0 .AND. iflag_phys /= 0) THEN
170            ! Calcul des tendances physiques :            CALL calfis(ucov, vcov, teta, q, pk, phis, phi, w, dufi, dvfi, &
171            time = REAL(mod(itau, day_step)) / day_step                 dtetafi, dqfi, dayvrai = itau / day_step + day_ini, &
172            IF (time > 1.) time = time - 1.                 time = REAL(mod(itau, day_step)) / day_step, &
           CALL calfis(itau * dtvr / daysec + day_ini, time, ucov, vcov, teta, &  
                q, pk, phis, phi, w, dufi, dvfi, dtetafi, dqfi, &  
173                 lafin = itau + 1 == itaufin)                 lafin = itau + 1 == itaufin)
174    
175            CALL addfi(ucov, vcov, teta, q, dufi, dvfi, dtetafi, dqfi)            CALL addfi(ucov, vcov, teta, q, dufi, dvfi, dtetafi, dqfi)
# Line 213  contains Line 213  contains
213    
214         IF (MOD(itau + 1, iecri * day_step) == 0) THEN         IF (MOD(itau + 1, iecri * day_step) == 0) THEN
215            CALL geopot(teta, pk, pks, phis, phi)            CALL geopot(teta, pk, pks, phis, phi)
216            CALL writehist(itau, vcov, ucov, teta, phi, q, masse, ps)            CALL writehist(itau, vcov, ucov, teta, phi, masse, ps)
217         END IF         END IF
218      end do time_integration      end do time_integration
219    
220      CALL dynredem1("restart.nc", vcov, ucov, teta, q, masse, ps, &      CALL dynredem1(vcov, ucov, teta, q, masse, ps, itau = itau_dyn + itaufin)
          itau = itau_dyn + itaufin)  
221    
222      ! Calcul des tendances dynamiques:      ! Calcul des tendances dynamiques:
223      CALL geopot(teta, pk, pks, phis, phi)      CALL geopot(teta, pk, pks, phis, phi)

Legend:
Removed from v.129  
changed lines
  Added in v.161

  ViewVC Help
Powered by ViewVC 1.1.21