7       SUBROUTINE leapfrog_p(ucov,vcov,teta,ps,masse,phis,q,time_0)
 
   26      &                       iconser, iphysiq, iperiod, dissip_period,
 
   27      &                       iecri, ip_ebil_dyn, ok_dynzon, ok_dyn_ins,
 
   28      &                       periodav, ok_dyn_ave, output_grads_dyn,
 
   63 #include "dimensions.h" 
   66 #include "comdissnew.h" 
   72 #include "description.h" 
   78       REAL,
INTENT(IN) :: time_0 
 
   82       REAL,
INTENT(INOUT) :: vcov(
ip1jm,
llm)      
 
   84       REAL,
INTENT(INOUT) :: ps(
ip1jmp1)          
 
   86       REAL,
INTENT(INOUT) :: phis(
ip1jmp1)        
 
  109       REAL,
DIMENSION(:,:,:), 
ALLOCATABLE, 
SAVE :: dq
 
  119       REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: dqfi
 
  124       REAL tppn(
iim),tpps(
iim),tpn,tps
 
  126       INTEGER itau,itaufinp1,iav
 
  138       real time_step, t_wrt, t_ops
 
  142       REAL :: jD_cur, jH_cur
 
  143       INTEGER :: an, mois, jour
 
  147       LOGICAL first,callinigrads
 
  149       data callinigrads/.
true./
 
  150       character*10 string10
 
  162       REAL      d_h_vcol, d_qt, d_qw, d_ql, d_ec
 
  169       character*80 dynhist_file, dynhistave_file
 
  170       character(len=*),
parameter :: modname=
"leapfrog" 
  171       character*80 abort_message
 
  174       logical,
PARAMETER :: dissip_conservative=.
true.
 
  179       logical , 
parameter :: flag_verif = .
false.
 
  183       LOGICAL :: FirstCaldyn
 
  184       LOGICAL :: FirstPhysic
 
  185       INTEGER :: ijb,ije,j,i
 
  187       type(
request) :: Request_Dissip
 
  188       type(
request) :: Request_physic
 
  189       REAL,
SAVE :: dvfi_tmp(iip1,
llm),dufi_tmp(iip1,
llm)
 
  190       REAL,
SAVE :: dtetafi_tmp(iip1,
llm)
 
  191       REAL,
DIMENSION(:,:,:),
ALLOCATABLE,
SAVE :: dqfi_tmp
 
  192       REAL,
SAVE :: dpfi_tmp(iip1)
 
  196       INTEGER :: AdjustCount
 
  198       LOGICAL :: ok_start_timer=.
false.
 
  199       LOGICAL, 
SAVE :: firstcall=.
true.
 
  247       if (pressure_exner) 
then 
  267       if (jh_cur > 1.0 ) 
then 
  276         call guide_main(itau,ucov,vcov,teta,q,masse,ps)
 
  294        if (firstcaldyn) 
then 
  313          psm1(ijb:ije) = ps(ijb:ije)
 
  319            ucovm1(ijb:ije,l) = ucov(ijb:ije,l)
 
  320            tetam1(ijb:ije,l) = teta(ijb:ije,l)
 
  321            massem1(ijb:ije,l) = masse(ijb:ije,l)
 
  325            vcovm1(ijb:ije,l) = vcov(ijb:ije,l)
 
  369         if (jh_cur > 1.0 ) 
then 
  388          IF( mod(itau,dissip_period ).EQ.0.AND..NOT.
forward ) 
 
  390          IF( mod(itau,iphysiq ).EQ.0.AND..NOT.
forward  
  394          IF( mod(itau   ,iconser) .EQ. 0              ) 
conser = .
true.
 
  395          IF( mod(itau+1,dissip_period).EQ.0 .AND. .NOT. 
forward )
 
  397          IF( mod(itau+1,iphysiq).EQ.0.AND.physic) 
apphys=.
true.
 
  411       if (firstcaldyn) 
then 
  424       IF (ok_start_timer) 
THEN 
  426         ok_start_timer=.
false.
 
  432         adjustcount=adjustcount+1
 
  434      &         .and. itau/iphysiq>2 .and. adjustcount>30) 
then 
  440         print *,
'*********************************' 
  441         print *,
'******    TIMER CALDYN     ******' 
  444      &            
'  : temps moyen :',
 
  449         print *,
'*********************************' 
  450         print *,
'******    TIMER VANLEER    ******' 
  453      &            
'  : temps moyen :',
 
  458         print *,
'*********************************' 
  459         print *,
'******    TIMER DISSIP    ******' 
  462      &            
'  : temps moyen :',
 
  570      .                reshape(q(:,:,j),(/iip1,
jmp1,
llm/)))
 
  577       true_itau=true_itau+1
 
  581         WRITE(
lunout,*)
"leapfrog_p: Iteration No",true_itau
 
  597       time = jd_cur + jh_cur 
 
  599      $  ( itau,ucov,vcov,teta,ps,masse,pk,pkf,phis ,
 
  600      $    phi,
conser,du,dv,dteta,dp,w, pbaru,pbarv, time )
 
  629      *        p, masse, dq,  teta,
 
  659        CALL integrd_p ( 2,vcovm1,ucovm1,tetam1,psm1,massem1 ,
 
  660      $         dv,du,dteta,dq,dp,vcov,ucov,teta,q,ps,masse,phis )
 
  717      &   
'leapfrog_p: Entree dans la physique : Iteration No ',true_itau
 
  724          if (pressure_exner) 
then 
  745            if (jh_cur > 1.0 ) 
then 
  760       IF (ip_ebil_dyn.ge.1 ) 
THEN  
  765      &    , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
 
  774         call settag(request_physic,800)
 
  839         CALL calfis_p(lafin ,jd_cur, jh_cur,
 
  840      $               ucov,vcov,teta,q,masse,ps,p,pk,phis,phi ,
 
  842      $               flxw, dufi,dvfi,dtetafi,dqfi,dpfi  )
 
  850           dufi_tmp(1:iip1,l)   = dufi(ijb:ijb+
iim,l) 
 
  851           dvfi_tmp(1:iip1,l)   = dvfi(ijb:ijb+
iim,l)  
 
  852           dtetafi_tmp(1:iip1,l)= dtetafi(ijb:ijb+
iim,l)  
 
  853           dqfi_tmp(1:iip1,l,:) = dqfi(ijb:ijb+
iim,l,:)  
 
  858           dpfi_tmp(1:iip1)     = dpfi(ijb:ijb+
iim)  
 
  871      *                      1,0,0,1,request_physic)
 
  874      *                      1,0,0,1,request_physic)
 
  877      *                      1,0,0,1,request_physic)
 
  880      *                      1,0,0,1,request_physic)
 
  884      *                        1,0,0,1,request_physic)
 
  903             dufi(ijb:ijb+
iim,l) = dufi(ijb:ijb+
iim,l)+dufi_tmp(1:iip1,l)
 
  904             dvfi(ijb:ijb+
iim,l) = dvfi(ijb:ijb+
iim,l)+dvfi_tmp(1:iip1,l) 
 
  905             dtetafi(ijb:ijb+
iim,l) = dtetafi(ijb:ijb+
iim,l)
 
  906      &                              +dtetafi_tmp(1:iip1,l)
 
  907             dqfi(ijb:ijb+
iim,l,:) = dqfi(ijb:ijb+
iim,l,:)
 
  908      &                              + dqfi_tmp(1:iip1,l,:)
 
  913           dpfi(ijb:ijb+
iim)   = dpfi(ijb:ijb+
iim)+ dpfi_tmp(1:iip1)
 
  933      $                  ucov, vcov, teta , q   ,ps ,
 
  934      $                 dufi, dvfi, dtetafi , dqfi ,dpfi  )
 
  940           if (pressure_exner) 
then 
  958         call settag(request_physic,800)
 
 1008       IF (ip_ebil_dyn.ge.1 ) 
THEN  
 1011      e  , ucov    , vcov , ps, p ,pk , teta , q(:,:,1), q(:,:,2))
 
 1026          if (firstphysic) 
then 
 1027            ok_start_timer=.
true.
 
 1037          if (firstphysic) 
then 
 1038            ok_start_timer=.
true.
 
 1047         teta(ijb:ije,l)=teta(ijb:ije,l)-
dtvr*
 
 1048      &         (teta(ijb:ije,l)-tetarappel(ijb:ije,l))*
 
 1056          teta(ijb:ije,1) = teta(ijb:ije,1)
 
 1057      &        + 
dtvr * 
aire(ijb:ije) * ihf / 
cpp / masse(ijb:ije,1)
 
 1081         if (pressure_exner) 
then 
 1140         call enercin_p(vcov,ucov,vcont,ucont,ecin0)
 
 1145         CALL dissip_p(vcov,ucov,teta,p,dvdis,dudis,dtetadis)
 
 1152           ucov(ijb:ije,l)=ucov(ijb:ije,l)+dudis(ijb:ije,l)
 
 1158           vcov(ijb:ije,l)=vcov(ijb:ije,l)+dvdis(ijb:ije,l)
 
 1166         if (dissip_conservative) 
then 
 1185             call enercin_p(vcov,ucov,vcont,ucont,ecin)
 
 1192                 dtetaecdt(ij,l)= (ecin0(ij,l)-ecin(ij,l))/ pk(ij,l)
 
 1193                 dtetadis(ij,l)=dtetadis(ij,l)+dtetaecdt(ij,l)
 
 1204               teta(ij,l)=teta(ij,l)+dtetadis(ij,l)
 
 1222              tppn(ij)  = 
aire(  ij    ) * teta(  ij    ,l)
 
 1238             tppn(ij)  = 
aire(  ij    ) * ps(  ij    )
 
 1258              teta(ij+
ip1jm,l) = tps
 
 1344         print *,
'*********************************' 
 1345         print *,
'******    TIMER CALDYN     ******' 
 1348      &            
'  : temps moyen :',
 
 1352         print *,
'*********************************' 
 1353         print *,
'******    TIMER VANLEER    ******' 
 1356      &            
'  : temps moyen :',
 
 1360         print *,
'*********************************' 
 1361         print *,
'******    TIMER DISSIP    ******' 
 1364      &            
'  : temps moyen :',
 
 1368         print *,
'*********************************' 
 1369         print *,
'******    TIMER PHYSIC    ******' 
 1372      &            
'  : temps moyen :',
 
 1380       print *, 
'Temps total ecoule sur la parallelisation :',
difftime()
 
 1381       print *, 
'Temps CPU ecoule sur la parallelisation :',
diffcputime()
 
 1406             IF( itau. eq. itaufinp1 ) 
then 
 1408               if (flag_verif) 
then 
 1409                 write(79,*) 
'ucov',ucov
 
 1410                 write(80,*) 
'vcov',vcov
 
 1411                 write(81,*) 
'teta',teta
 
 1414                 WRITE(85,*) 
'q1 = ',q(:,:,1)
 
 1415                 WRITE(86,*) 
'q3 = ',q(:,:,3)
 
 1428               abort_message = 
'Simulation finished' 
 1436             IF(mod(itau,iperiod).EQ.0 .OR. itau.EQ.
itaufin) 
THEN 
 1446      ,             ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q) 
 
 1449                IF (ok_dyn_ave) 
THEN 
 1466      &                 ucov,teta,pk,phi,q,masse,ps,phis)
 
 1477             IF( mod(itau,iecri).EQ.0) 
THEN 
 1500                 unat(ijb:ije,l)=ucov(ijb:ije,l)/
cu(ijb:ije)
 
 1508                 vnat(ijb:ije,l)=vcov(ijb:ije,l)/
cv(ijb:ije)
 
 1512               if (ok_dyn_ins) 
then 
 1525                          CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
 
 1537               if (output_grads_dyn) 
then 
 1547 #include "write_grads_dyn.h" 
 1562      &                           vcov,ucov,teta,q,masse,ps)
 
 1573             IF( mod(itau,iperiod).EQ.0 )    
THEN 
 1575             ELSE IF ( mod(itau-1,iperiod). eq. 0 ) 
THEN 
 1619                IF( itau. eq. itaufinp1 ) 
then   
 1624                  abort_message = 
'Simulation finished' 
 1632               IF(mod(itau,iperiod).EQ.0 .OR. itau.EQ.
itaufin) 
THEN 
 1641      ,           ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)
 
 1644                IF (ok_dyn_ave) 
THEN 
 1661      &                 ucov,teta,pk,phi,q,masse,ps,phis)
 
 1670                IF(mod(itau,iecri         ).EQ.0) 
THEN 
 1691                   unat(ijb:ije,l)=ucov(ijb:ije,l)/
cu(ijb:ije)
 
 1699                   vnat(ijb:ije,l)=vcov(ijb:ije,l)/
cv(ijb:ije)
 
 1703               if (ok_dyn_ins) 
then 
 1716                  CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
 
 1723                 if (output_grads_dyn) 
then 
 1733 #include "write_grads_dyn.h" 
 1744      .                               vcov,ucov,teta,q,masse,ps)
 
subroutine diagedyn(tit, iprt, idiag, idiag2, dtime, ucov, vcov, ps, p, pk, teta, q, ql)
 
integer, save maxbuffersize_used
 
subroutine fluxstokenc_p(pbaru, pbarv, masse, teta, phi, phis, time_step, itau)
 
!$Header llmm1 INTEGER ip1jmp1
 
subroutine gather_field(Field, ij, ll, rank)
 
integer, parameter timer_physic
 
subroutine exner_milieu_p(ngrid, ps, p, pks, pk, pkf)
 
!$Header!CDK comgeom COMMON comgeom apols
 
subroutine massdair_p(p, masse)
 
subroutine calfis_p(lafin, jD_cur, jH_cur, pucov, pvcov, pteta, pq, pmasse, pps, pp, ppk, pphis, pphi, pducov, pdvcov, pdteta, pdq, flxw, pdufi, pdvfi, pdhfi, pdqfi, pdpsfi)
 
integer, dimension(:), allocatable jj_nb_caldyn
 
subroutine adjustbands_dissip(new_dist)
 
subroutine register_hallo(Field, ij, ll, RUp, Rdown, SUp, SDown, a_request)
 
subroutine stop_timer(no_timer)
 
subroutine exner_hyb(ngrid, ps, p, pks, pk, pkf)
 
double precision function difftime()
 
real, dimension(:,:,:), allocatable timer_average
 
!$Id calend INTEGER itaufin INTEGER itau_phy INTEGER day_ref REAL dt
 
subroutine exner_milieu(ngrid, ps, p, pks, pk, pkf)
 
character(len=10), save planet_type
 
subroutine abort_gcm(modname, message, ierr)
 
!$Id Turb_fcg_gcssold get_uvd hqturb_gcssold endif!large scale llm day day1 day day1 *dt_toga endif!time annee_ref dt_toga u_toga vq_toga w_prof vq_prof llm day day1 day day1 *dt_dice endif!time annee_ref dt_dice swup_dice vg_dice omega_dice tg_prof vg_profd w_profd omega_profd!do llm!print llm l llm
 
integer, parameter vtintegre
 
!$Header!CDK comgeom COMMON comgeom aire
 
integer, dimension(:), allocatable jj_nb_dissip
 
!$Id ysinus ok_gradsfile hybrid COMMON logici iflag_phys
 
subroutine leapfrog_p(ucov, vcov, teta, ps, masse, phis, q, time_0)
 
integer, parameter timer_caldyn
 
subroutine resume_timer(no_timer)
 
subroutine allgather_timer_average
 
subroutine pression_p(ngrid, ap, bp, ps, p)
 
subroutine writehist(time, vcov, ucov, teta, phi, q, masse, ps, phis)
 
!$Header llmm1 INTEGER ip1jm
 
subroutine pression(ngrid, ap, bp, ps, p)
 
integer, parameter timer_dissip
 
subroutine register_swapfieldhallo(FieldS, FieldR, ij, ll, jj_Nb_New, Up, Down, a_request)
 
!$Id mode_top_bound COMMON comconstr dtphys
 
!$Header!CDK comgeom COMMON comgeom apoln
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL false
 
integer, save maxbuffersize
 
real, dimension(:,:,:), allocatable timer_delta
 
subroutine finalize_parallel
 
integer, dimension(:), allocatable jj_nb_physic
 
subroutine enercin_p(vcov, ucov, vcont, ucont, ecin)
 
subroutine addfi_p(pdt, leapf, forward, pucov, pvcov, pteta, pq, pps, pdufi, pdvfi, pdhfi, pdqfi, pdpfi)
 
subroutine dynredem1_p(fichnom, time, vcov, ucov, teta, q, masse, ps)
 
!$Id mode_top_bound COMMON comconstr cpp
 
subroutine, public print_filtre_timer
 
subroutine writedynav(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis)
 
subroutine friction_p(ucov, vcov, pdt)
 
real function diffcputime()
 
!FH On elimine toutes les clefs physiques dans la dynamique prt_level
 
integer, parameter vtcaldyn
 
integer, parameter vthallo
 
!$Header!integer nvarmx parameter(nfmx=10, imx=200, jmx=150, lmx=200, nvarmx=1000) real xd(imx
 
subroutine top_bound_p(vcov, ucov, teta, masse, dt)
 
subroutine sendrequest(a_Request)
 
!$Id itapm1 ENDIF!IM on interpole les champs sur les niveaux STD de pression!IM a chaque pas de temps de la physique c!positionnement de l argument logique a false c!pour ne pas recalculer deux fois la meme chose!c!a cet effet un appel a plevel_new a ete deplace c!a la fin de la serie d appels c!la boucle DO nlevSTD a ete internalisee c!dans d ou la creation de cette routine c c!CALL ulevSTD CALL &zphi philevSTD CALL &zx_rh rhlevSTD!DO klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon klev DO klon du jour ou toutes les read_climoz CALL true
 
subroutine exner_hyb_p(ngrid, ps, p, pks, pk, pkf)
 
!$Id!Parameters for parameters that control the rate of approach!to quasi equilibrium noff nlm real tlcrit real entp real sigd real coeffs real dtmax real cu real betad real damp real delta COMMON cvparam nlm tlcrit sigd coeffs cu
 
!$Id ysinus ok_gradsfile hybrid COMMON logici iflag_trac LOGICAL purmats
 
subroutine bilan_dyn_p(ntrac, dt_app, dt_cum, ps, masse, pk, flux_u, flux_v, teta, phi, ucov, vcov, trac)
 
subroutine setdistrib(jj_Nb_New)
 
subroutine covcont_p(klevel, ucov, vcov, ucont, vcont)
 
!$Id mode_top_bound COMMON comconstr dtvr
 
subroutine suspend_timer(no_timer)
 
c c zjulian c cym CALL iim cym klev iim
 
subroutine start_timer(no_timer)
 
integer, dimension(:), allocatable jj_nb_physic_bis
 
subroutine adjustbands_caldyn(new_dist)
 
character(len=maxlen) function int2str(int)
 
subroutine dissip_p(vcov, ucov, teta, p, dv, du, dh)
 
subroutine register_swapfield(FieldS, FieldR, ij, ll, jj_Nb_New, a_request)
 
subroutine settag(a_request, tag)
 
subroutine guide_main(itau, ucov, vcov, teta, q, masse, ps)
 
subroutine geopot_p(ngrid, teta, pk, pks, phis, phi)
 
!$Header!CDK comgeom COMMON comgeom cv
 
integer, parameter timer_vanleer
 
subroutine caldyn_p(itau, ucov, vcov, teta, ps, masse, pk, pkf, phis, phi, conser, du, dv, dteta, dp, w, pbaru, pbarv, time)
 
integer, dimension(:), allocatable jj_nb_vanleer
 
integer, parameter vtdissipation
 
subroutine waitrequest(a_Request)
 
subroutine caladvtrac_p(q, pbaru, pbarv, p, masse, dq, teta, flxw, pk, iapptrac)
 
!$Header!gestion des impressions de sorties et de débogage la sortie standard prt_level COMMON comprint lunout
 
subroutine adjustbands_physic
 
subroutine integrd_p(nq, vcovm1, ucovm1, tetam1, psm1, massem1, dv, du, dteta, dq, dp, vcov, ucov, teta, q, ps0, masse, phis)
 
integer, parameter vtphysiq