/[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/Sources/dyn3d/leapfrog.f revision 138 by guez, Fri May 22 23:13:19 2015 UTC trunk/dyn3d/leapfrog.f revision 260 by guez, Tue Mar 6 17:18:33 2018 UTC
# Line 16  contains Line 16  contains
16      use caladvtrac_m, only: caladvtrac      use caladvtrac_m, only: caladvtrac
17      use caldyn_m, only: caldyn      use caldyn_m, only: caldyn
18      USE calfis_m, ONLY: calfis      USE calfis_m, ONLY: calfis
19      USE comconst, ONLY: daysec, dtvr      USE comconst, ONLY: 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, &
24           iflag_phys, iecri           iflag_phys, iecri
25      USE conf_guide_m, ONLY: ok_guide      USE conf_guide_m, ONLY: ok_guide
26      USE dimens_m, ONLY: iim, jjm, llm, nqmx      USE dimens_m, ONLY: iim, jjm, llm, nqmx
27      use dissip_m, only: dissip      use dissip_m, only: dissip
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 enercin_m, only: enercin
31      USE exner_hyb_m, ONLY: exner_hyb      USE exner_hyb_m, ONLY: exner_hyb
32      use filtreg_scal_m, only: filtreg_scal      use filtreg_scal_m, only: filtreg_scal
     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
35      use inidissip_m, only: idissip      use inidissip_m, only: idissip
36      use integrd_m, only: integrd      use integrd_m, only: integrd
37      use nr_util, only: assert      use nr_util, only: assert
     USE pressure_var, ONLY: p3d  
38      USE temps, ONLY: itau_dyn      USE temps, ONLY: itau_dyn
39      use writedynav_m, only: writedynav      use writedynav_m, only: writedynav
40      use writehist_m, only: writehist      use writehist_m, only: writehist
# Line 63  contains Line 63  contains
63      REAL phi(iim + 1, jjm + 1, llm) ! geopotential      REAL phi(iim + 1, jjm + 1, llm) ! geopotential
64      REAL w(iim + 1, jjm + 1, llm) ! vitesse verticale      REAL w(iim + 1, jjm + 1, llm) ! vitesse verticale
65    
66      ! Variables dynamiques intermediaire pour le transport      ! Variables dynamiques interm\'ediaires pour le transport
67      ! Flux de masse :      ! Flux de masse :
68      REAL pbaru(iim + 1, jjm + 1, llm), pbarv(iim + 1, jjm, llm)      REAL pbaru(iim + 1, jjm + 1, llm), pbarv(iim + 1, jjm, llm)
69    
# Line 73  contains Line 73  contains
73      REAL massem1(iim + 1, jjm + 1, llm)      REAL massem1(iim + 1, jjm + 1, llm)
74    
75      ! Tendances dynamiques      ! Tendances dynamiques
76      REAL dv((iim + 1) * jjm, llm), dudyn(iim + 1, jjm + 1, llm)      REAL dv((iim + 1) * jjm, llm), du(iim + 1, jjm + 1, llm)
77      REAL dteta(iim + 1, jjm + 1, llm)      REAL dteta(iim + 1, jjm + 1, llm)
78      real dp((iim + 1) * (jjm + 1))      real dp(iim + 1, jjm + 1)
79    
80      ! Tendances de la dissipation :      ! Tendances de la dissipation :
81      REAL dvdis(iim + 1, jjm, llm), dudis(iim + 1, jjm + 1, llm)      REAL dvdis(iim + 1, jjm, llm), dudis(iim + 1, jjm + 1, llm)
# Line 88  contains Line 88  contains
88      ! Variables pour le fichier histoire      ! Variables pour le fichier histoire
89      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
90      INTEGER itaufin      INTEGER itaufin
     real finvmaold(iim + 1, jjm + 1, llm)  
91      INTEGER l      INTEGER l
92    
93      ! Variables test conservation \'energie      ! Variables test conservation \'energie
# Line 98  contains Line 97  contains
97      logical leapf      logical leapf
98      real dt ! time step, in s      real dt ! time step, in s
99    
100        REAL p3d(iim + 1, jjm + 1, llm + 1) ! pressure at layer interfaces, in Pa
101        ! ("p3d(i, j, l)" is at longitude "rlonv(i)", latitude "rlatu(j)",
102        ! for interface "l")
103    
104      !---------------------------------------------------      !---------------------------------------------------
105    
106      print *, "Call sequence information: leapfrog"      print *, "Call sequence information: leapfrog"
# Line 125  contains Line 128  contains
128            tetam1 = teta            tetam1 = teta
129            massem1 = masse            massem1 = masse
130            psm1 = ps            psm1 = ps
           finvmaold = masse  
           CALL filtreg_scal(finvmaold, direct = .false., intensive = .false.)  
131         end if         end if
132    
133         ! Calcul des tendances dynamiques:         ! Calcul des tendances dynamiques:
134         CALL geopot(teta, pk, pks, phis, phi)         CALL geopot(teta, pk, pks, phis, phi)
135         CALL caldyn(itau, ucov, vcov, teta, ps, masse, pk, pkf, phis, phi, &         CALL caldyn(itau, ucov, vcov, teta, ps, masse, pk, pkf, phis, phi, &
136              dudyn, dv, dteta, dp, w, pbaru, pbarv, &              du, dv, dteta, dp, w, pbaru, pbarv, &
137              conser = MOD(itau, iconser) == 0)              conser = MOD(itau, iconser) == 0)
138    
139         CALL caladvtrac(q, pbaru, pbarv, p3d, masse, teta, pk)         CALL caladvtrac(q, pbaru, pbarv, p3d, masse, teta, pk)
140    
        ! Stokage du flux de masse pour traceurs offline:  
        IF (offline) CALL fluxstokenc(pbaru, pbarv, masse, teta, phi, phis, &  
             dtvr, itau)  
   
141         ! Int\'egrations dynamique et traceurs:         ! Int\'egrations dynamique et traceurs:
142         CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, dteta, &         CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, du, dteta, &
143              dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, finvmaold, dt, &              dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, dt, leapf)
             leapf)  
144    
145         forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps         forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps
146         CALL exner_hyb(ps, p3d, pks, pk)         CALL exner_hyb(ps, p3d, pks, pk)
# Line 156  contains Line 152  contains
152            ! Calcul des tendances dynamiques:            ! Calcul des tendances dynamiques:
153            CALL geopot(teta, pk, pks, phis, phi)            CALL geopot(teta, pk, pks, phis, phi)
154            CALL caldyn(itau + 1, ucov, vcov, teta, ps, masse, pk, pkf, phis, &            CALL caldyn(itau + 1, ucov, vcov, teta, ps, masse, pk, pkf, phis, &
155                 phi, dudyn, dv, dteta, dp, w, pbaru, pbarv, conser = .false.)                 phi, du, dv, dteta, dp, w, pbaru, pbarv, conser = .false.)
156    
157            ! integrations dynamique et traceurs:            ! integrations dynamique et traceurs:
158            CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, dudyn, &            CALL integrd(vcovm1, ucovm1, tetam1, psm1, massem1, dv, du, &
159                 dteta, dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, &                 dteta, dp, vcov, ucov, teta, q(:, :, :, :2), ps, masse, dtvr, &
160                 finvmaold, dtvr, leapf=.false.)                 leapf=.false.)
161    
162            forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps            forall (l = 1: llm + 1) p3d(:, :, l) = ap(l) + bp(l) * ps
163            CALL exner_hyb(ps, p3d, pks, pk)            CALL exner_hyb(ps, p3d, pks, pk)
# Line 169  contains Line 165  contains
165            CALL filtreg_scal(pkf, direct = .true., intensive = .true.)            CALL filtreg_scal(pkf, direct = .true., intensive = .true.)
166         end if         end if
167    
168         IF (MOD(itau + 1, iphysiq) == 0 .AND. iflag_phys /= 0) THEN         IF (MOD(itau + 1, iphysiq) == 0 .AND. iflag_phys) THEN
169            CALL calfis(itau / day_step + day_ini, &            CALL calfis(ucov, vcov, teta, q, p3d, pk, phis, phi, w, dufi, dvfi, &
170                 REAL(mod(itau, day_step)) / day_step, ucov, vcov, teta, q, pk, &                 dtetafi, dqfi, dayvrai = itau / day_step + day_ini, &
171                 phis, phi, w, dufi, dvfi, dtetafi, dqfi, &                 time = REAL(mod(itau, day_step)) / day_step, &
172                 lafin = itau + 1 == itaufin)                 lafin = itau + 1 == itaufin)
173    
174            CALL addfi(ucov, vcov, teta, q, dufi, dvfi, dtetafi, dqfi)            CALL addfi(ucov, vcov, teta, q, dufi, dvfi, dtetafi, dqfi)
# Line 201  contains Line 197  contains
197            forall (l = 1: llm)            forall (l = 1: llm)
198               teta(:, 1, l) = SUM(aire_2d(:iim, 1) * teta(:iim, 1, l)) &               teta(:, 1, l) = SUM(aire_2d(:iim, 1) * teta(:iim, 1, l)) &
199                    / apoln                    / apoln
200               teta(:, jjm + 1, l) = SUM(aire_2d(:iim, jjm+1) &               teta(:, jjm + 1, l) = SUM(aire_2d(:iim, jjm + 1) &
201                    * teta(:iim, jjm + 1, l)) / apols                    * teta(:iim, jjm + 1, l)) / apols
202            END forall            END forall
203         END IF         END IF
# Line 220  contains Line 216  contains
216         END IF         END IF
217      end do time_integration      end do time_integration
218    
219      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)  
220    
221      ! Calcul des tendances dynamiques:      ! Calcul des tendances dynamiques:
222      CALL geopot(teta, pk, pks, phis, phi)      CALL geopot(teta, pk, pks, phis, phi)
223      CALL caldyn(itaufin, ucov, vcov, teta, ps, masse, pk, pkf, phis, phi, &      CALL caldyn(itaufin, ucov, vcov, teta, ps, masse, pk, pkf, phis, phi, &
224           dudyn, dv, dteta, dp, w, pbaru, pbarv, &           du, dv, dteta, dp, w, pbaru, pbarv, &
225           conser = MOD(itaufin, iconser) == 0)           conser = MOD(itaufin, iconser) == 0)
226    
227    END SUBROUTINE leapfrog    END SUBROUTINE leapfrog

Legend:
Removed from v.138  
changed lines
  Added in v.260

  ViewVC Help
Powered by ViewVC 1.1.21