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

Diff of /trunk/dyn3d/gcm.f

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

revision 3 by guez, Wed Feb 27 13:16:39 2008 UTC revision 18 by guez, Thu Aug 7 12:29:13 2008 UTC
# Line 15  PROGRAM gcm Line 15  PROGRAM gcm
15    ! Pour Van-Leer plus vapeur d'eau saturée : iadv(1)=4    ! Pour Van-Leer plus vapeur d'eau saturée : iadv(1)=4
16    ! Pour Van-Leer : iadv=10    ! Pour Van-Leer : iadv=10
17    
18    USE IOIPSL, only: ioconf_calendar    USE IOIPSL, only: ioconf_calendar, histclo
19    use dimens_m, only: iim, jjm, llm, nqmx    use dimens_m, only: iim, jjm, llm, nqmx
20    use dimphy, only: klon    use dimphy, only: klon
21    use paramet_m, only: ip1jm, ip1jmp1    use paramet_m, only: ip1jm, ip1jmp1
# Line 29  PROGRAM gcm Line 29  PROGRAM gcm
29    
30    use logic, only: iflag_phys    use logic, only: iflag_phys
31    use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv    use comgeom, only: rlatu, aire_2d, cu_2d, cv_2d, rlonv
32    use temps, only: day_ref, annee_ref, day_ini, day_end, itau_phy, itau_dyn    use temps, only: day_ref, annee_ref, day_ini, day_end, itau_dyn
33    use com_io_dyn, only: histid, histvid, histaveid    use com_io_dyn, only: histid, histvid, histaveid
34    use tracstoke, only: istdyn, istphy    use tracstoke, only: istdyn, istphy
35    use abort_gcm_m, only: abort_gcm    use abort_gcm_m, only: abort_gcm
# Line 37  PROGRAM gcm Line 37  PROGRAM gcm
37    use initdynav_m, only: initdynav    use initdynav_m, only: initdynav
38    use dynetat0_m, only: dynetat0    use dynetat0_m, only: dynetat0
39    use grid_change, only: dyn_phy, init_dyn_phy    use grid_change, only: dyn_phy, init_dyn_phy
40    use advtrac_m, only: iniadvtrac    use iniadvtrac_m, only: iniadvtrac
41    use leapfrog_m, only: leapfrog    use leapfrog_m, only: leapfrog
42      use dynredem0_m, only: dynredem0
43      use clesphys2, only: read_clesphys2
44    
45    IMPLICIT NONE    IMPLICIT NONE
46    
   REAL clesphy0(20)  
47    REAL zdtvr ! time step for dynamics, in s    REAL zdtvr ! time step for dynamics, in s
48    
49    ! Variables dynamiques :    ! Variables dynamiques :
# Line 52  PROGRAM gcm Line 53  PROGRAM gcm
53    REAL ps(ip1jmp1) ! pression au sol (Pa)    REAL ps(ip1jmp1) ! pression au sol (Pa)
54    
55    REAL masse(ip1jmp1, llm) ! masse d'air    REAL masse(ip1jmp1, llm) ! masse d'air
56    REAL phis(ip1jmp1) ! géopotentiel au sol    REAL phis(iim + 1, jjm + 1) ! géopotentiel au sol
57    
58    ! Variables pour le fichier histoire :    ! Variables pour le fichier histoire :
59    REAL time_0    REAL time_0
# Line 91  PROGRAM gcm Line 92  PROGRAM gcm
92    endif    endif
93    
94    ! Lecture des fichiers "gcm.def" ou "run.def" :    ! Lecture des fichiers "gcm.def" ou "run.def" :
95    CALL conf_gcm(clesphy0)    call read_clesphys2
96      CALL conf_gcm
97    
98    ! Initialisation des traceurs    ! Initialisation des traceurs
99    ! Choix du schéma pour l'advection dans le fichier "traceur.def" ou via INCA    ! Choix du schéma pour l'advection dans le fichier "traceur.def" ou via INCA
# Line 99  PROGRAM gcm Line 101  PROGRAM gcm
101    
102    ! Lecture du fichier "start.nc" :    ! Lecture du fichier "start.nc" :
103    CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0)    CALL dynetat0(vcov, ucov, teta, q, masse, ps, phis, time_0)
   ! Begin special experiment  
 !!$     print *, "This is a special experiment."  
 !!$     print *, "We are setting:"  
 !!$     print *, "ucov = vcov = 0, q = 0, ps = 101325"  
 !!$     print *, "We are averaging 'teta' horizontally."  
 !!$     ucov = 0.  
 !!$     vcov = 0.  
 !!$     q = 0.  
 !!$     ps = 101325.  
   ! Average teta over all longitudes and latitudes:  
 !!$     forall(i = 1:llm) teta(:,i) = sum(teta(:,i)) / ip1jmp1  
   ! (it would be better to weight each element with an associated  
   ! surface area)  
   ! End special experiment  
104    
105    ! Lecture des paramètres de contrôle pour la simulation :    ! Lecture des paramètres de contrôle pour la simulation :
106    ! on recalcule éventuellement le pas de temps    ! on recalcule éventuellement le pas de temps
# Line 132  PROGRAM gcm Line 120  PROGRAM gcm
120    if (annee_ref /= anneeref .or. day_ref /= dayref) then    if (annee_ref /= anneeref .or. day_ref /= dayref) then
121       print *, 'Attention : les dates initiales lues dans le fichier ' // &       print *, 'Attention : les dates initiales lues dans le fichier ' // &
122            '"start" ne correspondent pas à celles lues dans "gcm.def".'            '"start" ne correspondent pas à celles lues dans "gcm.def".'
123       if (raz_date /= 1) then       if (raz_date) then
         print *, 'On garde les dates du fichier "start".'  
      else  
124          print *, 'On réinitialise à la date lue dans "gcm.def".'          print *, 'On réinitialise à la date lue dans "gcm.def".'
125          annee_ref = anneeref          annee_ref = anneeref
126          day_ref = dayref          day_ref = dayref
127          day_ini = dayref          day_ini = dayref
128          itau_dyn = 0          itau_dyn = 0
         itau_phy = 0  
129          time_0 = 0.          time_0 = 0.
130         else
131            print *, 'On garde les dates du fichier "start".'
132       endif       endif
133    ELSE    ELSE
134       raz_date = 0       raz_date = .false.
135    endif    endif
136    
137    ! Initialisation des constantes dynamiques :    ! Initialisation des constantes dynamiques :
# Line 194  PROGRAM gcm Line 181  PROGRAM gcm
181    
182       airefi = pack(aire_2d, dyn_phy)       airefi = pack(aire_2d, dyn_phy)
183       print *, 'Attention : vitesse verticale nulle dans la physique.'       print *, 'Attention : vitesse verticale nulle dans la physique.'
184       CALL iniphysiq(klon, llm, daysec, day_ini, dtphys, latfi, lonfi, airefi, &       CALL iniphysiq(klon, llm, latfi, lonfi, airefi, &
185            zcufi, zcvfi, rad, g, r, cpp)            zcufi, zcvfi, rad, g, r, cpp)
186    ENDIF    ENDIF
187    
# Line 204  PROGRAM gcm Line 191  PROGRAM gcm
191    print *, "day_ini = ", day_ini    print *, "day_ini = ", day_ini
192    print *, "day_end = ", day_end    print *, "day_end = ", day_end
193    
194    CALL dynredem0("restart.nc", day_end, phis, nqmx)    CALL dynredem0("restart.nc", day_end, phis)
195    CALL inithist(day_ref, annee_ref, zdtvr, nqmx, histid, histvid, &    CALL inithist(day_ref, annee_ref, zdtvr, nqmx, histid, histvid, &
196         infile="dyn_hist.nc", t_ops = iecri * daysec, t_wrt = iecri * daysec)         infile="dyn_hist.nc", t_ops = iecri * daysec, t_wrt = iecri * daysec)
197    CALL initdynav(day_ref, annee_ref, zdtvr, nqmx, histaveid, &    CALL initdynav(day_ref, annee_ref, zdtvr, nqmx, histaveid, &
# Line 216  PROGRAM gcm Line 203  PROGRAM gcm
203    istphy = istdyn / iphysiq        istphy = istdyn / iphysiq    
204    
205    ! Intégration temporelle du modèle :    ! Intégration temporelle du modèle :
206    CALL leapfrog(ucov, vcov, teta, ps, masse, phis, nq, q, clesphy0, time_0)    CALL leapfrog(ucov, vcov, teta, ps, masse, phis, nq, q, time_0)
207    
208      call histclo
209      print *, 'Simulation finished'
210      print *, 'Everything is cool'
211    
212  END PROGRAM gcm  END PROGRAM gcm

Legend:
Removed from v.3  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.21