Ignore:
Timestamp:
Jul 15, 2020, 10:14:34 PM (4 years ago)
Author:
adurocher
Message:

Use blocks to allocate compressed arrays to the right size

Location:
LMDZ6/branches/Optimisation_LMDZ/libf/phylmd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Optimisation_LMDZ/libf/phylmd/cv3a_compress.f90

    r3758 r3760  
    3434 
    3535  public :: array_list, add_array_i1, add_array_r1, add_array_r2, add_array_r3, &
    36             cv3a_compress, cv3a_uncompress, compress_data_t
     36            get_compress_size, cv3a_compress, cv3a_uncompress, compress_data_t
    3737 
    3838  contains
     
    9393    arrays%arrays_r(1,c)%buf => array_in
    9494    arrays%arrays_r(2,c)%buf => array_out
    95   end subroutine
     95  end subroutine
     96
     97  function get_compress_size(len, mask) result(ncum)
     98    use mod_phys_lmdz_omp_data, only : omp_rank
     99    integer, INTENT (IN) :: len ! lenght of the contiguous dimension of arrays to compress
     100    logical, INTENT (IN) :: mask(len) ! Mask of convective cells
     101    integer :: ncum ! Number of cells in compressed arrays (first dimension)
     102   
     103    select case (compress_mode)
     104      case (COMPRESS_MODE_COMPRESS)
     105          ncum = count(mask)
     106      case (COMPRESS_MODE_COPY)
     107          ncum = len
     108      case default
     109        call abort_physic("get_compress_size", "Unknown compress mode", 1)
     110    end select
     111  end function
    96112   
    97113  ! Compress arrays from 'arrays' according to 'mask'.
  • LMDZ6/branches/Optimisation_LMDZ/libf/phylmd/cv3a_driver.f90

    r3758 r3760  
    165165    USE cv3a_compress_mod
    166166    USE cv3p_mixing_mod, ONLY : cv3p_mixing
     167    USE profiling_physic_mod
    167168    IMPLICIT NONE
    168169! Input
     
    171172    INTEGER, INTENT(IN)                               :: ndp1 ! nd + 1
    172173    INTEGER, INTENT(IN)                               :: ntra ! number of tracors
    173     INTEGER, INTENT(IN)                                :: nloc ! dimension of arrays for compressed fields (nloc=len) pour l'instant
    174174    INTEGER, INTENT(IN)                               :: k_upper ! upmost level for vertical loops
    175175    INTEGER, INTENT(IN)                               :: iflag_con ! version of convect (3)
     
    261261
    262262! Local (non compressed) arrays
    263     INTEGER i, k, il
    264     INTEGER icbmax
    265263    INTEGER nk1(len)
    266264    INTEGER icb1(len)
    267265    INTEGER icbs1(len)
    268266
    269     LOGICAL ok_inhib ! True => possible inhibition of convection by dryness
    270267    LOGICAL, SAVE :: debut = .TRUE.
    271268!$omp THREADPRIVATE(debut)
    272269
    273270    REAL tnk1(len)
    274     REAL thnk1(len)
    275271    REAL qnk1(len)
    276272    REAL gznk1(len)
    277     REAL qsnk1(len)
    278273    REAL unk1(len)
    279274    REAL vnk1(len)
    280     REAL cpnk1(len)
    281275    REAL hnk1(len)
    282276    REAL pbase1(len)
     
    288282    REAL tv1(len, nd), tv1_wake(len, nd)
    289283    REAL gz1(len, nd), gz1_wake(len, nd)
    290     REAL hm1(len, nd)
    291284    REAL h1(len, nd), h1_wake(len, nd)
    292285    REAL tp1(len, nd)
    293286    REAL th1(len, nd), th1_wake(len, nd)
    294287
    295     REAL bid(len, nd) ! dummy array
    296 
    297     INTEGER ncum
    298 
    299     REAL p1feed1(len) ! pressure at lower bound of feeding layer
    300     REAL p2feed1(len) ! pressure at upper bound of feeding layer
    301 
    302 ! (local) compressed fields:
    303     LOGICAL compress    ! True if compression occurs
    304     INTEGER iflag(nloc), nk(nloc), icb(nloc)
    305     INTEGER nent(nloc, nd)
    306     INTEGER icbs(nloc)
    307     INTEGER inb(nloc)
    308 
    309     REAL cbmf(nloc), plcl(nloc), plfc(nloc), wbeff(nloc)
    310     REAL t(nloc, nd), q(nloc, nd), qs(nloc, nd)
    311     REAL t_wake(nloc, nd), q_wake(nloc, nd), qs_wake(nloc, nd)
    312     REAL s_wake(nloc)
    313     REAL u(nloc, nd), v(nloc, nd)
    314     REAL gz(nloc, nd), h(nloc, nd)
    315     REAL h_wake(nloc, nd)
    316     REAL lv(nloc, nd), lf(nloc, nd), cpn(nloc, nd)
    317     REAL lv_wake(nloc, nd), lf_wake(nloc, nd), cpn_wake(nloc, nd)
    318     REAL p(nloc, nd), ph(nloc, nd + 1), tv(nloc, nd), tp(nloc, nd)
    319     REAL tv_wake(nloc, nd)
    320     REAL clw(nloc, nd)
    321     REAL, DIMENSION(nloc, nd)    :: qta, qpreca
    322     REAL pbase(nloc), buoybase(nloc), th(nloc, nd)
    323     REAL th_wake(nloc, nd)
    324     REAL tvp(nloc, nd)
    325     REAL sig(nloc, nd), w0(nloc, nd), ptop2(nloc)
    326     REAL hp(nloc, nd), ep(nloc, nd), sigp(nloc, nd)
    327     REAL buoy(nloc, nd)
    328     REAL cape(nloc)
    329     REAL cin(nloc)
    330     REAL m(nloc, nd)
    331     REAL mm(nloc, nd)
    332     REAL ment(nloc, nd, nd), sigij(nloc, nd, nd)
    333     REAL qent(nloc, nd, nd)
    334     REAL hent(nloc, nd, nd)
    335     REAL uent(nloc, nd, nd), vent(nloc, nd, nd)
    336     REAL ments(nloc, nd, nd), qents(nloc, nd, nd)
    337     REAL elij(nloc, nd, nd)
    338     REAL supmax(nloc, nd)
    339     REAL Ale(nloc), Alp(nloc), coef_clos(nloc)
    340     REAL omega(nloc, nd)
    341     REAL sigd(nloc)
    342     REAL, DIMENSION(len, nd)     :: mp, qp, up, vp
    343     REAL, DIMENSION(len, nd)     :: wt, water, evap
    344     REAL, DIMENSION(len, nd)     :: ice, fondue, b
    345     REAL, DIMENSION(len, nd)     :: frac_a, frac_s, faci
    346     REAL ft(nloc, nd), fq(nloc, nd)
    347     REAL ftd(nloc, nd), fqd(nloc, nd)
    348     REAL fu(nloc, nd), fv(nloc, nd)
    349     REAL upwd(nloc, nd), dnwd(nloc, nd), dnwd0(nloc, nd)
    350     REAL ma(nloc, nd), mip(nloc, nd)
    351     REAL precip(nloc)
    352     REAL vprecip(nloc, nd + 1)
    353     REAL vprecipi(nloc, nd + 1)
    354     REAL tra(nloc, nd, ntra), trap(nloc, nd, ntra)
    355     REAL ftra(nloc, nd, ntra), traent(nloc, nd, nd, ntra)
    356     REAL qcondc(nloc, nd)
    357     REAL wd(nloc)
    358     REAL Plim1(nloc), plim2(nloc)
    359     REAL asupmax(nloc, nd)
    360     REAL supmax0(nloc)
    361     REAL asupmaxmin(nloc)
    362 
    363     REAL tnk(nloc), qnk(nloc), gznk(nloc)
    364     REAL wghti(nloc, nd)
    365     REAL hnk(nloc), unk(nloc), vnk(nloc)
    366 
    367     REAL qtc(nloc, nd)
    368     REAL sigt(nloc, nd)
    369 
    370     REAL wdtrainA(nloc, nd), wdtrainS(nloc, nd), wdtrainM(nloc, nd)
    371     REAL da(len, nd), phi(len, nd, nd)
    372     REAL epmlmMm(nloc, nd, nd), eplaMm(nloc, nd)
    373     REAL phi2(len, nd, nd)
    374     REAL d1a(len, nd), dam(len, nd)
    375     REAL epmax_diag(nloc) ! epmax_cape
    376 
    377288    CHARACTER(LEN=20) :: modname = 'cva_driver'
    378289    CHARACTER(LEN=80) :: abort_message
     
    381292!$omp THREADPRIVATE(igout)
    382293
    383     type(compress_data_t) :: compress_data
    384     type(array_list) :: cv3a_compress_list, cv3a_uncompress_list
     294    INTEGER nloc ! Allocation size for compressed arrays
     295    logical :: compress
     296
     297    call enter_profile("cv3a_driver")
    385298
    386299    if (iflag_con /= 3) call abort_physic("cv3a_driver", "iflag_con must be 3", 1)
    387300
     301    call enter_profile("cv3a_params")
    388302! -------------------------------------------------------------------
    389303! --- SET CONSTANTS AND PARAMETERS
     
    402316
    403317    CALL cv3_incrcount(len, nd, delt, sig1)
    404 
    405 ! ---------------------------------------------------------------------
    406 ! --- INITIALIZE LOCAL ARRAYS AND PARAMETERS
    407 ! ---------------------------------------------------------------------
    408 
    409     DO il = 1, nloc
    410       coef_clos(il) = 1.
    411     END DO
     318    call exit_profile("cv3a_params")
    412319
    413320! --------------------------------------------------------------------
     
    417324    IF (debut) PRINT *, 'Emanuel version 3 nouvelle'
    418325
    419     call driver_log('cv3_prelim')
    420     CALL cv3_prelim(len, nd, ndp1, t1, q1, p1, ph1, &
    421                     lv1, lf1, cpn1, tv1, gz1, h1, hm1, th1)
    422 
    423     call driver_log('cv3_prelim')
    424     CALL cv3_prelim(len, nd, ndp1, t1_wake, q1_wake, p1, ph1, &
    425                     lv1_wake, lf1_wake, cpn1_wake, tv1_wake, gz1_wake, &
    426                     h1_wake, bid, th1_wake)
     326    block
     327      REAL thnk1(len)
     328      REAL qsnk1(len)
     329      REAL cpnk1(len)
     330      REAL hm1(len, nd)
     331      REAL bid(len, nd) ! dummy array
     332      REAL p1feed1(len) ! pressure at lower bound of feeding layer
     333      REAL p2feed1(len) ! pressure at upper bound of feeding layer
     334
     335      integer :: i, icbmax
     336
     337      call enter_profile("cv3a_uncompressed")
     338
     339      call driver_log('cv3_prelim')
     340      CALL cv3_prelim(len, nd, ndp1, t1, q1, p1, ph1, &
     341                      lv1, lf1, cpn1, tv1, gz1, h1, hm1, th1)
     342
     343      call driver_log('cv3_prelim')
     344      CALL cv3_prelim(len, nd, ndp1, t1_wake, q1_wake, p1, ph1, &
     345                      lv1_wake, lf1_wake, cpn1_wake, tv1_wake, gz1_wake, &
     346                      h1_wake, bid, th1_wake)
    427347
    428348! --------------------------------------------------------------------
     
    432352! get bounds of feeding layer
    433353! test niveaux couche alimentation KE
    434     IF (sig1feed1 == sig2feed1) THEN
    435       WRITE (lunout, *) 'impossible de choisir sig1feed=sig2feed'
    436       WRITE (lunout, *) 'changer la valeur de sig2feed dans physiq.def'
    437       abort_message = ''
    438       CALL abort_physic(modname, abort_message, 1)
    439     END IF
    440 
    441     DO i = 1, len
    442       p1feed1(i) = sig1feed1*ph1(i, 1)
    443       p2feed1(i) = sig2feed1*ph1(i, 1)
    444     END DO
    445 
    446     call driver_log('cv3_feed')
    447 
    448     ! GLITCHY : arrays are set to zero but are intent(out) in call to cv3_feed
    449     iflag1(:) = 0
    450     plcl1(:) = 0.
    451     wghti1(:, :) = 0.
    452     CALL cv3_feed(len, nd, ok_conserv_q, &
    453                   t1, q1, u1, v1, p1, ph1, h1, gz1, &
    454                   p1feed1, p2feed1, wght1, &
    455                   wghti1, tnk1, thnk1, qnk1, qsnk1, unk1, vnk1, &
    456                   cpnk1, hnk1, nk1, icb1, icbmax, iflag1, gznk1, plcl1)
     354      IF (sig1feed1 == sig2feed1) THEN
     355        WRITE (lunout, *) 'impossible de choisir sig1feed=sig2feed'
     356        WRITE (lunout, *) 'changer la valeur de sig2feed dans physiq.def'
     357        abort_message = ''
     358        CALL abort_physic(modname, abort_message, 1)
     359      END IF
     360
     361      DO i = 1, len
     362        p1feed1(i) = sig1feed1*ph1(i, 1)
     363        p2feed1(i) = sig2feed1*ph1(i, 1)
     364      END DO
     365
     366      call driver_log('cv3_feed')
     367
     368      ! GLITCHY : arrays are set to zero but are intent(out) in call to cv3_feed
     369      iflag1(:) = 0
     370      plcl1(:) = 0.
     371      wghti1(:, :) = 0.
     372      CALL cv3_feed(len, nd, ok_conserv_q, &
     373                    t1, q1, u1, v1, p1, ph1, h1, gz1, &
     374                    p1feed1, p2feed1, wght1, &
     375                    wghti1, tnk1, thnk1, qnk1, qsnk1, unk1, vnk1, &
     376                    cpnk1, hnk1, nk1, icb1, icbmax, iflag1, gznk1, plcl1)
    457377
    458378! --------------------------------------------------------------------
     
    462382! actual temperature, and the adiabatic liquid water content.
    463383! --------------------------------------------------------------------
    464     call driver_log('cv3_undilute1')
    465     ! GLITCHY : arrays are set to zero but are intent(out) in call to cv3_feed
    466     tvp1(:, :) = 0.
    467     clw1(:, :) = 0.
    468     CALL cv3_undilute1(len, nd, t1, qs1, gz1, plcl1, p1, icb1, tnk1, qnk1, & ! nd->na
    469                        gznk1, tp1, tvp1, clw1, icbs1)
     384      call driver_log('cv3_undilute1')
     385      ! GLITCHY : arrays are set to zero but are intent(out) in call to cv3_feed
     386      tvp1(:, :) = 0.
     387      clw1(:, :) = 0.
     388      CALL cv3_undilute1(len, nd, t1, qs1, gz1, plcl1, p1, icb1, tnk1, qnk1, & ! nd->na
     389                         gznk1, tp1, tvp1, clw1, icbs1)
    470390
    471391! -------------------------------------------------------------------
     
    473393! -------------------------------------------------------------------
    474394
    475     call driver_log('cv3_trigger')
    476     CALL cv3_trigger(len, nd, icb1, plcl1, p1, th1, tv1, tvp1, thnk1, & ! nd->na
    477                      pbase1, buoybase1, iflag1, sig1, w01)
     395      call driver_log('cv3_trigger')
     396      CALL cv3_trigger(len, nd, icb1, plcl1, p1, th1, tv1, tvp1, thnk1, & ! nd->na
     397                       pbase1, buoybase1, iflag1, sig1, w01)
     398      call exit_profile("cv3a_uncompressed")
     399    end block
    478400
    479401! =====================================================================
     
    485407!       (-> vectorization over convective gridpoints)
    486408! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     409
    487410    compress = .true.
    488411    if (compress) then
     
    492415    endif
    493416
    494     call driver_log('cv3a_compress')
    495 
    496     call add_array_i1(cv3a_compress_list, iflag1, iflag)
    497     call add_array_i1(cv3a_compress_list, nk1, nk)
    498     call add_array_i1(cv3a_compress_list, icb1, icb)
    499     call add_array_i1(cv3a_compress_list, icbs1, icbs)
    500     call add_array_r1(cv3a_compress_list, plcl1, plcl)
    501     call add_array_r1(cv3a_compress_list, tnk1, tnk)
    502     call add_array_r1(cv3a_compress_list, qnk1, qnk)
    503     call add_array_r1(cv3a_compress_list, gznk1, gznk)
    504     call add_array_r1(cv3a_compress_list, hnk1, hnk)
    505     call add_array_r1(cv3a_compress_list, unk1, unk)
    506     call add_array_r1(cv3a_compress_list, vnk1, vnk)
    507     call add_array_r2(cv3a_compress_list, wghti1, wghti)
    508     call add_array_r1(cv3a_compress_list, pbase1, pbase)
    509     call add_array_r1(cv3a_compress_list, buoybase1, buoybase)
    510     call add_array_r2(cv3a_compress_list, th1, th)
    511     call add_array_r2(cv3a_compress_list, t1, t)
    512     call add_array_r2(cv3a_compress_list, q1, q)
    513     call add_array_r2(cv3a_compress_list, qs1, qs)
    514     call add_array_r2(cv3a_compress_list, t1_wake, t_wake)
    515     call add_array_r2(cv3a_compress_list, q1_wake, q_wake)
    516     call add_array_r2(cv3a_compress_list, qs1_wake, qs_wake)
    517     call add_array_r1(cv3a_compress_list, s1_wake, s_wake)
    518     call add_array_r2(cv3a_compress_list, u1, u)
    519     call add_array_r2(cv3a_compress_list, v1, v)
    520     call add_array_r2(cv3a_compress_list, gz1, gz)
    521     call add_array_r2(cv3a_compress_list, h1, h)
    522     call add_array_r2(cv3a_compress_list, th1_wake, th_wake)
    523     call add_array_r2(cv3a_compress_list, lv1, lv)
    524     call add_array_r2(cv3a_compress_list, lf1, lf)
    525     call add_array_r2(cv3a_compress_list, cpn1, cpn)
    526     call add_array_r2(cv3a_compress_list, p1, p)
    527     call add_array_r2(cv3a_compress_list, ph1, ph)
    528     call add_array_r2(cv3a_compress_list, tv1, tv)
    529     call add_array_r2(cv3a_compress_list, tp1, tp)
    530     call add_array_r2(cv3a_compress_list, tvp1, tvp)
    531     call add_array_r2(cv3a_compress_list, clw1, clw)
    532     call add_array_r2(cv3a_compress_list, h1_wake, h_wake)
    533     call add_array_r2(cv3a_compress_list, lv1_wake, lv_wake)
    534     call add_array_r2(cv3a_compress_list, lf1_wake, lf_wake)
    535     call add_array_r2(cv3a_compress_list, cpn1_wake, cpn_wake)
    536     call add_array_r2(cv3a_compress_list, tv1_wake, tv_wake)
    537     call add_array_r2(cv3a_compress_list, sig1, sig)
    538     call add_array_r1(cv3a_compress_list, sig1(:, nd), sig(:, nd))
    539     call add_array_r2(cv3a_compress_list, w01, w0)
    540     call add_array_r1(cv3a_compress_list, Ale1, Ale)
    541     call add_array_r1(cv3a_compress_list, Alp1, Alp)
    542     call add_array_r2(cv3a_compress_list, omega1, omega)
    543 
    544     call cv3a_compress(len, (iflag1 == 0), cv3a_compress_list, compress_data)
    545     ncum = compress_data%ncum
    546 
    547     IF (ncum > 0) THEN
     417    nloc = get_compress_size(len, (iflag1(:) == 0))
     418    block
     419      ! (local) compressed fields:
     420      INTEGER iflag(nloc), nk(nloc), icb(nloc)
     421      INTEGER nent(nloc, nd)
     422      INTEGER icbs(nloc)
     423      INTEGER inb(nloc)
     424
     425      REAL cbmf(nloc), plcl(nloc), plfc(nloc), wbeff(nloc)
     426      REAL t(nloc, nd), q(nloc, nd), qs(nloc, nd)
     427      REAL t_wake(nloc, nd), q_wake(nloc, nd), qs_wake(nloc, nd)
     428      REAL s_wake(nloc)
     429      REAL u(nloc, nd), v(nloc, nd)
     430      REAL gz(nloc, nd), h(nloc, nd)
     431      REAL h_wake(nloc, nd)
     432      REAL lv(nloc, nd), lf(nloc, nd), cpn(nloc, nd)
     433      REAL lv_wake(nloc, nd), lf_wake(nloc, nd), cpn_wake(nloc, nd)
     434      REAL p(nloc, nd), ph(nloc, nd + 1), tv(nloc, nd), tp(nloc, nd)
     435      REAL tv_wake(nloc, nd)
     436      REAL clw(nloc, nd)
     437      REAL qta(nloc, nd), qpreca(nloc, nd)
     438      REAL pbase(nloc), buoybase(nloc), th(nloc, nd)
     439      REAL th_wake(nloc, nd)
     440      REAL tvp(nloc, nd)
     441      REAL sig(nloc, nd), w0(nloc, nd), ptop2(nloc)
     442      REAL hp(nloc, nd), ep(nloc, nd), sigp(nloc, nd)
     443      REAL buoy(nloc, nd)
     444      REAL cape(nloc)
     445      REAL cin(nloc)
     446      REAL m(nloc, nd)
     447      REAL mm(nloc, nd)
     448      REAL ment(nloc, nd, nd), sigij(nloc, nd, nd)
     449      REAL qent(nloc, nd, nd)
     450      REAL hent(nloc, nd, nd)
     451      REAL uent(nloc, nd, nd), vent(nloc, nd, nd)
     452      REAL ments(nloc, nd, nd), qents(nloc, nd, nd)
     453      REAL elij(nloc, nd, nd)
     454      REAL supmax(nloc, nd)
     455      REAL Ale(nloc), Alp(nloc), coef_clos(nloc)
     456      REAL omega(nloc, nd)
     457      REAL sigd(nloc)
     458      REAL, DIMENSION(nloc, nd)     :: mp, qp, up, vp
     459      REAL, DIMENSION(nloc, nd)     :: wt, water, evap
     460      REAL, DIMENSION(nloc, nd)     :: ice, fondue, b
     461      REAL, DIMENSION(nloc, nd)     :: frac_a, frac_s, faci
     462      REAL ft(nloc, nd), fq(nloc, nd)
     463      REAL ftd(nloc, nd), fqd(nloc, nd)
     464      REAL fu(nloc, nd), fv(nloc, nd)
     465      REAL upwd(nloc, nd), dnwd(nloc, nd), dnwd0(nloc, nd)
     466      REAL ma(nloc, nd), mip(nloc, nd)
     467      REAL precip(nloc)
     468      REAL vprecip(nloc, nd + 1)
     469      REAL vprecipi(nloc, nd + 1)
     470      REAL tra(nloc, nd, ntra), trap(nloc, nd, ntra)
     471      REAL ftra(nloc, nd, ntra), traent(nloc, nd, nd, ntra)
     472      REAL qcondc(nloc, nd)
     473      REAL wd(nloc)
     474      REAL Plim1(nloc), plim2(nloc)
     475      REAL asupmax(nloc, nd)
     476      REAL supmax0(nloc)
     477      REAL asupmaxmin(nloc)
     478
     479      REAL tnk(nloc), qnk(nloc), gznk(nloc)
     480      REAL wghti(nloc, nd)
     481      REAL hnk(nloc), unk(nloc), vnk(nloc)
     482
     483      REAL qtc(nloc, nd)
     484      REAL sigt(nloc, nd)
     485
     486      REAL wdtrainA(nloc, nd), wdtrainS(nloc, nd), wdtrainM(nloc, nd)
     487      REAL da(nloc, nd), phi(nloc, nd, nd)
     488      REAL epmlmMm(nloc, nd, nd), eplaMm(nloc, nd)
     489      REAL phi2(nloc, nd, nd)
     490      REAL d1a(nloc, nd), dam(nloc, nd)
     491      REAL epmax_diag(nloc)
     492
     493      LOGICAL ok_inhib ! True => possible inhibition of convection by dryness
     494      integer :: k
     495
     496      integer :: ncum ! Number of convective cells
     497      type(compress_data_t) :: compress_data
     498      type(array_list) :: cv3a_compress_list, cv3a_uncompress_list
     499      logical, save :: timers_first = .true.
     500      !$omp threadprivate(timers_first)
     501
     502      call enter_profile("cv3a_compress")
     503      call driver_log('cv3a_compress')
     504
     505      call add_array_i1(cv3a_compress_list, iflag1, iflag)
     506      call add_array_i1(cv3a_compress_list, nk1, nk)
     507      call add_array_i1(cv3a_compress_list, icb1, icb)
     508      call add_array_i1(cv3a_compress_list, icbs1, icbs)
     509      call add_array_r1(cv3a_compress_list, plcl1, plcl)
     510      call add_array_r1(cv3a_compress_list, tnk1, tnk)
     511      call add_array_r1(cv3a_compress_list, qnk1, qnk)
     512      call add_array_r1(cv3a_compress_list, gznk1, gznk)
     513      call add_array_r1(cv3a_compress_list, hnk1, hnk)
     514      call add_array_r1(cv3a_compress_list, unk1, unk)
     515      call add_array_r1(cv3a_compress_list, vnk1, vnk)
     516      call add_array_r2(cv3a_compress_list, wghti1, wghti)
     517      call add_array_r1(cv3a_compress_list, pbase1, pbase)
     518      call add_array_r1(cv3a_compress_list, buoybase1, buoybase)
     519      call add_array_r2(cv3a_compress_list, th1, th)
     520      call add_array_r2(cv3a_compress_list, t1, t)
     521      call add_array_r2(cv3a_compress_list, q1, q)
     522      call add_array_r2(cv3a_compress_list, qs1, qs)
     523      call add_array_r2(cv3a_compress_list, t1_wake, t_wake)
     524      call add_array_r2(cv3a_compress_list, q1_wake, q_wake)
     525      call add_array_r2(cv3a_compress_list, qs1_wake, qs_wake)
     526      call add_array_r1(cv3a_compress_list, s1_wake, s_wake)
     527      call add_array_r2(cv3a_compress_list, u1, u)
     528      call add_array_r2(cv3a_compress_list, v1, v)
     529      call add_array_r2(cv3a_compress_list, gz1, gz)
     530      call add_array_r2(cv3a_compress_list, h1, h)
     531      call add_array_r2(cv3a_compress_list, th1_wake, th_wake)
     532      call add_array_r2(cv3a_compress_list, lv1, lv)
     533      call add_array_r2(cv3a_compress_list, lf1, lf)
     534      call add_array_r2(cv3a_compress_list, cpn1, cpn)
     535      call add_array_r2(cv3a_compress_list, p1, p)
     536      call add_array_r2(cv3a_compress_list, ph1, ph)
     537      call add_array_r2(cv3a_compress_list, tv1, tv)
     538      call add_array_r2(cv3a_compress_list, tp1, tp)
     539      call add_array_r2(cv3a_compress_list, tvp1, tvp)
     540      call add_array_r2(cv3a_compress_list, clw1, clw)
     541      call add_array_r2(cv3a_compress_list, h1_wake, h_wake)
     542      call add_array_r2(cv3a_compress_list, lv1_wake, lv_wake)
     543      call add_array_r2(cv3a_compress_list, lf1_wake, lf_wake)
     544      call add_array_r2(cv3a_compress_list, cpn1_wake, cpn_wake)
     545      call add_array_r2(cv3a_compress_list, tv1_wake, tv_wake)
     546      call add_array_r2(cv3a_compress_list, sig1, sig)
     547      call add_array_r1(cv3a_compress_list, sig1(:, nd), sig(:, nd))
     548      call add_array_r2(cv3a_compress_list, w01, w0)
     549      call add_array_r1(cv3a_compress_list, Ale1, Ale)
     550      call add_array_r1(cv3a_compress_list, Alp1, Alp)
     551      call add_array_r2(cv3a_compress_list, omega1, omega)
     552
     553      call cv3a_compress(len, (iflag1 == 0), cv3a_compress_list, compress_data)
     554      ncum = compress_data%ncum
     555      call exit_profile("cv3a_compress")
     556
     557      if( timers_first ) then
     558        call enter_profile("cv3p_mixing")
     559        call exit_profile("cv3p_mixing")
     560        call enter_profile("cv3_yield")
     561        call exit_profile("cv3_yield")
     562        call enter_profile("cv3_tracer")       
     563        call exit_profile("cv3_tracer")
     564
     565        timers_first = .false.
     566      endif
     567
     568      call enter_profile("cv3a_compressed")
     569      IF (ncum > 0) THEN
    548570
    549571! -------------------------------------------------------------------
     
    557579! -------------------------------------------------------------------
    558580
    559       call driver_log('cv3_undilute2')
    560       CALL cv3_undilute2(nloc, ncum, nd, iflag, icb, icbs, nk, &
    561                          tnk, qnk, gznk, hnk, t, q, qs, gz, &
    562                          p, ph, h, tv, lv, lf, pbase, buoybase, plcl, &
    563                          inb, tp, tvp, clw, hp, ep, sigp, buoy, &
    564                          frac_a, frac_s, qpreca, qta)
     581        call driver_log('cv3_undilute2')
     582        CALL cv3_undilute2(nloc, ncum, nd, iflag, icb, icbs, nk, &
     583                           tnk, qnk, gznk, hnk, t, q, qs, gz, &
     584                           p, ph, h, tv, lv, lf, pbase, buoybase, plcl, &
     585                           inb, tp, tvp, clw, hp, ep, sigp, buoy, &
     586                           frac_a, frac_s, qpreca, qta)
    565587
    566588! epmax_cape
    567589! on recalcule ep et hp
    568       call driver_log('cv3_epmax_cape')
    569       call cv3_epmax_fn_cape(nloc, ncum, nd &
    570                              , ep, hp, icb, inb, clw, nk, t, h, hnk, lv, lf, frac_s &
    571                              , pbase, p, ph, tv, buoy, sig, w0, iflag &
    572                              , epmax_diag)
     590        call driver_log('cv3_epmax_cape')
     591        call cv3_epmax_fn_cape(nloc, ncum, nd &
     592                               , ep, hp, icb, inb, clw, nk, t, h, hnk, lv, lf, frac_s &
     593                               , pbase, p, ph, tv, buoy, sig, w0, iflag &
     594                               , epmax_diag)
    573595
    574596! -------------------------------------------------------------------
    575597! --- MIXING(1)   (if iflag_mix .ge. 1)
    576598! -------------------------------------------------------------------
    577 
    578       IF (iflag_mix >= 1) THEN
    579         CALL zilch(supmax, nloc*nd)
    580         call driver_log('cv3p_mixing')
    581         CALL cv3p_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &
    582                          ph, t, q, qs, u, v, tra, h, lv, lf, frac_s, qta, &
    583                          unk, vnk, hp, tv, tvp, ep, clw, sig, &
    584                          ment, qent, hent, uent, vent, nent, &
    585                          sigij, elij, supmax, ments, qents, traent)
    586       ELSE
    587         CALL zilch(supmax, nloc*nd)
    588       END IF
     599        call enter_profile("cv3p_mixing")
     600        IF (iflag_mix >= 1) THEN
     601          CALL zilch(supmax, nloc*nd)
     602          call driver_log('cv3p_mixing')
     603          CALL cv3p_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &
     604                           ph, t, q, qs, u, v, tra, h, lv, lf, frac_s, qta, &
     605                           unk, vnk, hp, tv, tvp, ep, clw, sig, &
     606                           ment, qent, hent, uent, vent, nent, &
     607                           sigij, elij, supmax, ments, qents, traent)
     608        ELSE
     609          CALL zilch(supmax, nloc*nd)
     610        END IF
     611        call exit_profile("cv3p_mixing")
    589612
    590613! -------------------------------------------------------------------
     
    592615! -------------------------------------------------------------------
    593616
    594       ptop2(:) = 0
    595       IF (iflag_clos == 0) THEN
    596         call driver_log('cv3_closure')
    597         CALL cv3_closure(nloc, ncum, nd, icb, inb, &
    598                          pbase, p, ph, tv, buoy, &
    599                          sig, w0, cape, m, iflag)
    600       END IF   ! iflag_clos==0
    601 
    602       ok_inhib = iflag_mix == 2
    603 
    604       IF (iflag_clos == 1) PRINT *, ' pas d appel cv3p_closure'
    605 
    606       IF (iflag_clos == 2) THEN
    607         call driver_log('cv3p1_closure')
    608         CALL cv3p1_closure(nloc, ncum, nd, icb, inb, &
    609                            pbase, plcl, p, ph, tv, tvp, buoy, &
    610                            supmax, ok_inhib, Ale, Alp, omega, &
    611                            sig, w0, ptop2, cape, cin, m, iflag, coef_clos, &
    612                            Plim1, plim2, asupmax, supmax0, &
    613                            asupmaxmin, cbmf, plfc, wbeff)
    614         if (prt_level >= 10) PRINT *, 'cv3p1_closure-> plfc,wbeff ', plfc(1), wbeff(1)
    615       END IF ! iflag_clos==2
    616 
    617       IF (iflag_clos == 3) THEN
    618         call driver_log('cv3p2_closure')
    619         CALL cv3p2_closure(nloc, ncum, nd, icb, inb, &
    620                            pbase, plcl, p, ph, tv, tvp, buoy, &
    621                            supmax, ok_inhib, Ale, Alp, omega, &
    622                            sig, w0, ptop2, cape, cin, m, iflag, coef_clos, &
    623                            Plim1, plim2, asupmax, supmax0, &
    624                            asupmaxmin, cbmf, plfc, wbeff)
    625         if (prt_level >= 10) PRINT *, 'cv3p2_closure-> plfc,wbeff ', plfc(1), wbeff(1)
    626       END IF ! iflag_clos==3
     617        ptop2(:) = 0
     618        coef_clos(:) = 1.
     619        IF (iflag_clos == 0) THEN
     620          call driver_log('cv3_closure')
     621          CALL cv3_closure(nloc, ncum, nd, icb, inb, &
     622                           pbase, p, ph, tv, buoy, &
     623                           sig, w0, cape, m, iflag)
     624        END IF   ! iflag_clos==0
     625
     626        ok_inhib = iflag_mix == 2
     627
     628        IF (iflag_clos == 1) PRINT *, ' pas d appel cv3p_closure'
     629
     630        IF (iflag_clos == 2) THEN
     631          call driver_log('cv3p1_closure')
     632          CALL cv3p1_closure(nloc, ncum, nd, icb, inb, &
     633                             pbase, plcl, p, ph, tv, tvp, buoy, &
     634                             supmax, ok_inhib, Ale, Alp, omega, &
     635                             sig, w0, ptop2, cape, cin, m, iflag, coef_clos, &
     636                             Plim1, plim2, asupmax, supmax0, &
     637                             asupmaxmin, cbmf, plfc, wbeff)
     638          if (prt_level >= 10) PRINT *, 'cv3p1_closure-> plfc,wbeff ', plfc(1), wbeff(1)
     639        END IF ! iflag_clos==2
     640
     641        IF (iflag_clos == 3) THEN
     642          call driver_log('cv3p2_closure')
     643          CALL cv3p2_closure(nloc, ncum, nd, icb, inb, &
     644                             pbase, plcl, p, ph, tv, tvp, buoy, &
     645                             supmax, ok_inhib, Ale, Alp, omega, &
     646                             sig, w0, ptop2, cape, cin, m, iflag, coef_clos, &
     647                             Plim1, plim2, asupmax, supmax0, &
     648                             asupmaxmin, cbmf, plfc, wbeff)
     649          if (prt_level >= 10) PRINT *, 'cv3p2_closure-> plfc,wbeff ', plfc(1), wbeff(1)
     650        END IF ! iflag_clos==3
    627651
    628652! -------------------------------------------------------------------
     
    630654! -------------------------------------------------------------------
    631655
    632       IF (iflag_mix == 0) THEN
    633         call driver_log('cv3_mixing')
    634         CALL cv3_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &             ! na->nd
    635                         ph, t, q, qs, u, v, tra, h, lv, lf, frac_s, qnk, &
    636                         unk, vnk, hp, tv, tvp, ep, clw, m, sig, &
    637                         ment, qent, uent, vent, nent, sigij, elij, ments, qents, traent)
    638         CALL zilch(hent, nloc*nd*nd)
    639       ELSE
    640         mm(:, :) = m(:, :)
    641         CALL cv3_mixscale(nloc, ncum, nd, ment, mm)
    642         IF (debut) PRINT *, ' cv3_mixscale-> '
    643       END IF
    644 
    645       IF (debut) PRINT *, ' cv_mixing ->'
     656        IF (iflag_mix == 0) THEN
     657          call driver_log('cv3_mixing')
     658          CALL cv3_mixing(nloc, ncum, nd, nd, ntra, icb, nk, inb, &             ! na->nd
     659                          ph, t, q, qs, u, v, tra, h, lv, lf, frac_s, qnk, &
     660                          unk, vnk, hp, tv, tvp, ep, clw, m, sig, &
     661                          ment, qent, uent, vent, nent, sigij, elij, ments, qents, traent)
     662          CALL zilch(hent, nloc*nd*nd)
     663        ELSE
     664          mm(:, :) = m(:, :)
     665          CALL cv3_mixscale(nloc, ncum, nd, ment, mm)
     666          IF (debut) PRINT *, ' cv3_mixscale-> '
     667        END IF
     668
     669        IF (debut) PRINT *, ' cv_mixing ->'
    646670
    647671! -------------------------------------------------------------------
    648672! --- UNSATURATED (PRECIPITATING) DOWNDRAFTS
    649673! -------------------------------------------------------------------
    650       IF (debut) PRINT *, ' cva_driver -> cv3_unsat '
    651 
    652       call driver_log('cv3_unsat')
    653       CALL cv3_unsat(nloc, ncum, nd, nd, ntra, icb, inb, iflag, &
    654                      t_wake, q_wake, qs_wake, gz, u, v, tra, p, ph, &
    655                      th_wake, tv_wake, lv_wake, lf_wake, cpn_wake, &
    656                      ep, sigp, clw, frac_s, qpreca, frac_a, qta, &
    657                      m, ment, elij, delt, plcl, coef_clos, &
    658                      mp, qp, up, vp, trap, wt, water, evap, fondue, ice, &
    659                      faci, b, sigd, &
    660                      wdtrainA, wdtrainS, wdtrainM)
    661       IF (prt_level >= 10) THEN
    662         Print *, 'cva_driver after cv3_unsat:mp , water, ice, evap, fondue '
    663         DO k = 1, nd
    664           write (6, '(i4,5(1x,e13.6))'), &
    665             k, mp(igout, k), water(igout, k), ice(igout, k), &
    666             evap(igout, k), fondue(igout, k)
    667         ENDDO
    668         Print *, 'cva_driver after cv3_unsat: wdtrainA, wdtrainS, wdtrainM '
    669         DO k = 1, nd
    670           write (6, '(i4,3(1x,e13.6))'), &
    671             k, wdtrainA(igout, k), wdtrainS(igout, k), wdtrainM(igout, k)
    672         ENDDO
    673       ENDIF
    674 
    675       IF (debut) PRINT *, 'cv_unsat-> '
     674        IF (debut) PRINT *, ' cva_driver -> cv3_unsat '
     675
     676        call driver_log('cv3_unsat')
     677        CALL cv3_unsat(nloc, ncum, nd, nd, ntra, icb, inb, iflag, &
     678                       t_wake, q_wake, qs_wake, gz, u, v, tra, p, ph, &
     679                       th_wake, tv_wake, lv_wake, lf_wake, cpn_wake, &
     680                       ep, sigp, clw, frac_s, qpreca, frac_a, qta, &
     681                       m, ment, elij, delt, plcl, coef_clos, &
     682                       mp, qp, up, vp, trap, wt, water, evap, fondue, ice, &
     683                       faci, b, sigd, &
     684                       wdtrainA, wdtrainS, wdtrainM)
     685        IF (prt_level >= 10) THEN
     686          Print *, 'cva_driver after cv3_unsat:mp , water, ice, evap, fondue '
     687          DO k = 1, nd
     688            write (6, '(i4,5(1x,e13.6))'), &
     689              k, mp(igout, k), water(igout, k), ice(igout, k), &
     690              evap(igout, k), fondue(igout, k)
     691          ENDDO
     692          Print *, 'cva_driver after cv3_unsat: wdtrainA, wdtrainS, wdtrainM '
     693          DO k = 1, nd
     694            write (6, '(i4,3(1x,e13.6))'), &
     695              k, wdtrainA(igout, k), wdtrainS(igout, k), wdtrainM(igout, k)
     696          ENDDO
     697        ENDIF
     698
     699        IF (debut) PRINT *, 'cv_unsat-> '
    676700! -------------------------------------------------------------------
    677701! YIELD
     
    679703! -------------------------------------------------------------------
    680704
    681       call driver_log('cv3_yield')
    682       CALL cv3_yield(nloc, ncum, nd, nd, ntra, ok_conserv_q, &
    683                      icb, inb, delt, &
    684                      t, q, t_wake, q_wake, s_wake, u, v, tra, &
    685                      gz, p, ph, h, hp, lv, lf, cpn, th, th_wake, &
    686                      ep, clw, qpreca, m, tp, mp, qp, up, vp, trap, &
    687                      wt, water, ice, evap, fondue, faci, b, sigd, &
    688                      ment, qent, hent, iflag_mix, uent, vent, &
    689                      nent, elij, traent, sig, &
    690                      tv, tvp, wghti, &
    691                      iflag, precip, Vprecip, Vprecipi, ft, fq, fu, fv, ftra, &
    692                      cbmf, upwd, dnwd, dnwd0, ma, mip, &
    693                      qcondc, wd, &
    694                      ftd, fqd, qta, qtc, sigt, tau_cld_cv, coefw_cld_cv)
    695 
    696       ! Test conseravtion de l'eau
    697       IF (debut) PRINT *, ' cv3_yield -> fqd(1) = ', fqd(igout, 1)
    698       IF (prt_level >= 10) THEN
    699         Print *, 'cva_driver after cv3_yield:ft(1) , ftd(1) ', &
    700           ft(igout, 1), ftd(igout, 1)
    701         Print *, 'cva_driver after cv3_yield:fq(1) , fqd(1) ', &
    702           fq(igout, 1), fqd(igout, 1)
    703       ENDIF
     705        call driver_log('cv3_yield')
     706        call enter_profile("cv3_yield")
     707        CALL cv3_yield(nloc, ncum, nd, nd, ntra, ok_conserv_q, &
     708                       icb, inb, delt, &
     709                       t, q, t_wake, q_wake, s_wake, u, v, tra, &
     710                       gz, p, ph, h, hp, lv, lf, cpn, th, th_wake, &
     711                       ep, clw, qpreca, m, tp, mp, qp, up, vp, trap, &
     712                       wt, water, ice, evap, fondue, faci, b, sigd, &
     713                       ment, qent, hent, iflag_mix, uent, vent, &
     714                       nent, elij, traent, sig, &
     715                       tv, tvp, wghti, &
     716                       iflag, precip, Vprecip, Vprecipi, ft, fq, fu, fv, ftra, &
     717                       cbmf, upwd, dnwd, dnwd0, ma, mip, &
     718                       qcondc, wd, &
     719                       ftd, fqd, qta, qtc, sigt, tau_cld_cv, coefw_cld_cv)
     720        call exit_profile("cv3_yield")
     721        ! Test conseravtion de l'eau
     722        IF (debut) PRINT *, ' cv3_yield -> fqd(1) = ', fqd(igout, 1)
     723        IF (prt_level >= 10) THEN
     724          Print *, 'cva_driver after cv3_yield:ft(1) , ftd(1) ', &
     725            ft(igout, 1), ftd(igout, 1)
     726          Print *, 'cva_driver after cv3_yield:fq(1) , fqd(1) ', &
     727            fq(igout, 1), fqd(igout, 1)
     728        ENDIF
    704729
    705730!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     
    707732!^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    708733
    709       call driver_log('cv3_tracer')
    710       CALL cv3_tracer(nloc, len, ncum, nd, nd, &
    711                       ment, sigij, da, phi, phi2, d1a, dam, &
    712                       ep, vprecip, elij, clw, epmlmMm, eplaMm, &
    713                       icb, inb)
    714     END IF ! ncum>0
     734        call driver_log('cv3_tracer')
     735        call enter_profile("cv3_tracer")
     736        CALL cv3_tracer(nloc, len, ncum, nd, nd, &
     737                        ment, sigij, da, phi, phi2, d1a, dam, &
     738                        ep, vprecip, elij, clw, epmlmMm, eplaMm, &
     739                        icb, inb)
     740        call exit_profile("cv3_tracer")
     741      END IF ! ncum>0
     742      call exit_profile("cv3a_compressed")
    715743
    716744! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    717745! --- UNCOMPRESS THE FIELDS
    718746! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    719     call driver_log('cv3a_uncompress')
    720     call add_array_i1(cv3a_uncompress_list, iflag, iflag1, init=.false.)
    721     call add_array_i1(cv3a_uncompress_list, icb, kbas1)
    722     call add_array_i1(cv3a_uncompress_list, inb, ktop1)
    723     call add_array_r1(cv3a_uncompress_list, precip, precip1)
    724     call add_array_r1(cv3a_uncompress_list, cbmf, cbmf1)
    725     call add_array_r1(cv3a_uncompress_list, plcl, plcl1, init=.false.)
    726     call add_array_r1(cv3a_uncompress_list, plfc, plfc1)
    727     call add_array_r1(cv3a_uncompress_list, wbeff, wbeff1)
    728     call add_array_r2(cv3a_uncompress_list, sig, sig1)
    729     call add_array_r2(cv3a_uncompress_list, w0, w01)
    730     call add_array_r1(cv3a_uncompress_list, ptop2, ptop21)
    731     call add_array_r2(cv3a_uncompress_list, ft, ft1)
    732     call add_array_r2(cv3a_uncompress_list, fq, fq1)
    733     call add_array_r2(cv3a_uncompress_list, fu, fu1)
    734     call add_array_r2(cv3a_uncompress_list, fv, fv1)
    735     call add_array_r1(cv3a_uncompress_list, sigd, sigd1)
    736     call add_array_r2(cv3a_uncompress_list, ma, ma1)
    737     call add_array_r2(cv3a_uncompress_list, mip, mip1)
    738     call add_array_r2(cv3a_uncompress_list, vprecip, vprecip1)
    739     call add_array_r2(cv3a_uncompress_list, vprecipi, vprecipi1)
    740     call add_array_r2(cv3a_uncompress_list, upwd, upwd1)
    741     call add_array_r2(cv3a_uncompress_list, dnwd, dnwd1)
    742     call add_array_r2(cv3a_uncompress_list, dnwd0, dnwd01)
    743     call add_array_r2(cv3a_uncompress_list, qcondc, qcondc1)
    744     call add_array_r1(cv3a_uncompress_list, wd, wd1)
    745     cape1(:) = -1.
    746     call add_array_r1(cv3a_uncompress_list, cape, cape1, init=.false.)
    747     cin1(:) = -100000.
    748     call add_array_r1(cv3a_uncompress_list, cin, cin1, init=.false.)
    749     call add_array_r2(cv3a_uncompress_list, tvp, tvp1, init=.false.)
    750     call add_array_r2(cv3a_uncompress_list, ftd, ftd1)
    751     call add_array_r2(cv3a_uncompress_list, fqd, fqd1)
    752     call add_array_r1(cv3a_uncompress_list, Plim1, Plim11)
    753     call add_array_r1(cv3a_uncompress_list, plim2, plim21)
    754     call add_array_r2(cv3a_uncompress_list, asupmax, asupmax1)
    755     call add_array_r1(cv3a_uncompress_list, supmax0, supmax01)
    756     call add_array_r1(cv3a_uncompress_list, asupmaxmin, asupmaxmin1)
    757     call add_array_r2(cv3a_uncompress_list, da, da1)
    758     call add_array_r3(cv3a_uncompress_list, phi, phi1)
    759     call add_array_r2(cv3a_uncompress_list, mp, mp1)
    760     call add_array_r3(cv3a_uncompress_list, phi2, phi21)
    761     call add_array_r2(cv3a_uncompress_list, d1a, d1a1)
    762     call add_array_r2(cv3a_uncompress_list, dam, dam1)
    763     call add_array_r3(cv3a_uncompress_list, sigij, sigij1)
    764     call add_array_r2(cv3a_uncompress_list, qta, qta1)
    765     call add_array_r2(cv3a_uncompress_list, clw, clw1, init=.false.)
    766     call add_array_r3(cv3a_uncompress_list, elij, elij1)
    767     call add_array_r2(cv3a_uncompress_list, evap, evap1)
    768     call add_array_r2(cv3a_uncompress_list, ep, ep1)
    769     call add_array_r3(cv3a_uncompress_list, epmlmMm, epmlmMm1)
    770     call add_array_r2(cv3a_uncompress_list, eplaMm, eplaMm1)
    771     call add_array_r2(cv3a_uncompress_list, wdtrainA, wdtrainA1)
    772     call add_array_r2(cv3a_uncompress_list, wdtrainS, wdtrainS1)
    773     call add_array_r2(cv3a_uncompress_list, wdtrainM, wdtrainM1)
    774     call add_array_r2(cv3a_uncompress_list, qtc, qtc1)
    775     call add_array_r2(cv3a_uncompress_list, sigt, sigt1)
    776     call add_array_r1(cv3a_uncompress_list, epmax_diag, epmax_diag1)
    777     call add_array_r1(cv3a_uncompress_list, sig(:, nd), sig1(:, nd))
    778     call cv3a_uncompress(len, compress_data, cv3a_uncompress_list)
     747      call enter_profile("cv3a_uncompress")
     748      call driver_log('cv3a_uncompress')
     749      call add_array_i1(cv3a_uncompress_list, iflag, iflag1, init=.false.)
     750      call add_array_i1(cv3a_uncompress_list, icb, kbas1)
     751      call add_array_i1(cv3a_uncompress_list, inb, ktop1)
     752      call add_array_r1(cv3a_uncompress_list, precip, precip1)
     753      call add_array_r1(cv3a_uncompress_list, cbmf, cbmf1)
     754      call add_array_r1(cv3a_uncompress_list, plcl, plcl1, init=.false.)
     755      call add_array_r1(cv3a_uncompress_list, plfc, plfc1)
     756      call add_array_r1(cv3a_uncompress_list, wbeff, wbeff1)
     757      call add_array_r2(cv3a_uncompress_list, sig, sig1)
     758      call add_array_r2(cv3a_uncompress_list, w0, w01)
     759      call add_array_r1(cv3a_uncompress_list, ptop2, ptop21)
     760      call add_array_r2(cv3a_uncompress_list, ft, ft1)
     761      call add_array_r2(cv3a_uncompress_list, fq, fq1)
     762      call add_array_r2(cv3a_uncompress_list, fu, fu1)
     763      call add_array_r2(cv3a_uncompress_list, fv, fv1)
     764      call add_array_r1(cv3a_uncompress_list, sigd, sigd1)
     765      call add_array_r2(cv3a_uncompress_list, ma, ma1)
     766      call add_array_r2(cv3a_uncompress_list, mip, mip1)
     767      call add_array_r2(cv3a_uncompress_list, vprecip, vprecip1)
     768      call add_array_r2(cv3a_uncompress_list, vprecipi, vprecipi1)
     769      call add_array_r2(cv3a_uncompress_list, upwd, upwd1)
     770      call add_array_r2(cv3a_uncompress_list, dnwd, dnwd1)
     771      call add_array_r2(cv3a_uncompress_list, dnwd0, dnwd01)
     772      call add_array_r2(cv3a_uncompress_list, qcondc, qcondc1)
     773      call add_array_r1(cv3a_uncompress_list, wd, wd1)
     774      cape1(:) = -1.
     775      call add_array_r1(cv3a_uncompress_list, cape, cape1, init=.false.)
     776      cin1(:) = -100000.
     777      call add_array_r1(cv3a_uncompress_list, cin, cin1, init=.false.)
     778      call add_array_r2(cv3a_uncompress_list, tvp, tvp1, init=.false.)
     779      call add_array_r2(cv3a_uncompress_list, ftd, ftd1)
     780      call add_array_r2(cv3a_uncompress_list, fqd, fqd1)
     781      call add_array_r1(cv3a_uncompress_list, Plim1, Plim11)
     782      call add_array_r1(cv3a_uncompress_list, plim2, plim21)
     783      call add_array_r2(cv3a_uncompress_list, asupmax, asupmax1)
     784      call add_array_r1(cv3a_uncompress_list, supmax0, supmax01)
     785      call add_array_r1(cv3a_uncompress_list, asupmaxmin, asupmaxmin1)
     786      call add_array_r2(cv3a_uncompress_list, da, da1)
     787      call add_array_r3(cv3a_uncompress_list, phi, phi1)
     788      call add_array_r2(cv3a_uncompress_list, mp, mp1)
     789      call add_array_r3(cv3a_uncompress_list, phi2, phi21)
     790      call add_array_r2(cv3a_uncompress_list, d1a, d1a1)
     791      call add_array_r2(cv3a_uncompress_list, dam, dam1)
     792      call add_array_r3(cv3a_uncompress_list, sigij, sigij1)
     793      call add_array_r2(cv3a_uncompress_list, qta, qta1)
     794      call add_array_r2(cv3a_uncompress_list, clw, clw1, init=.false.)
     795      call add_array_r3(cv3a_uncompress_list, elij, elij1)
     796      call add_array_r2(cv3a_uncompress_list, evap, evap1)
     797      call add_array_r2(cv3a_uncompress_list, ep, ep1)
     798      call add_array_r3(cv3a_uncompress_list, epmlmMm, epmlmMm1)
     799      call add_array_r2(cv3a_uncompress_list, eplaMm, eplaMm1)
     800      call add_array_r2(cv3a_uncompress_list, wdtrainA, wdtrainA1)
     801      call add_array_r2(cv3a_uncompress_list, wdtrainS, wdtrainS1)
     802      call add_array_r2(cv3a_uncompress_list, wdtrainM, wdtrainM1)
     803      call add_array_r2(cv3a_uncompress_list, qtc, qtc1)
     804      call add_array_r2(cv3a_uncompress_list, sigt, sigt1)
     805      call add_array_r1(cv3a_uncompress_list, epmax_diag, epmax_diag1)
     806      call add_array_r1(cv3a_uncompress_list, sig(:, nd), sig1(:, nd))
     807      call cv3a_uncompress(len, compress_data, cv3a_uncompress_list)
     808      call exit_profile("cv3a_uncompress")
     809
     810    end block
    779811
    780812    IF (prt_level >= 10) THEN
     
    789821    END IF
    790822
    791     ftra1(:,:,:) = 0
    792 
     823    ftra1(:, :, :) = 0
     824
     825    call exit_profile("cv3a_driver")
    793826  END SUBROUTINE
    794827
Note: See TracChangeset for help on using the changeset viewer.