Changeset 3762


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

Added a path to execute cv3a_driver without compression at all

+ fix : Compute coef_convective BEFORE cv3a_driver_compressed

File:
1 edited

Legend:

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

    r3761 r3762  
    288288    CHARACTER(LEN=80) :: abort_message
    289289
     290    INTEGER :: coef_convective(len)
     291    INTEGER :: k
     292    REAL, parameter :: Cin_noconv = -100000., Cape_noconv = -1
     293
    290294    INTEGER, SAVE :: igout = 1
    291295!$omp THREADPRIVATE(igout)
     
    407411! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    408412
    409     compress = .true.
     413    compress = .false.
    410414    if (compress) then
    411415      compress_mode = COMPRESS_MODE_COMPRESS
    412     else
    413       compress_mode = COMPRESS_MODE_COPY
    414     endif
    415 
    416     nloc = get_compress_size(len, (iflag1(:) == 0))
    417     block
    418       ! (local) compressed fields:
    419       INTEGER iflag(nloc), nk(nloc), icb(nloc)
    420       INTEGER nent(nloc, nd)
    421       INTEGER icbs(nloc)
    422       INTEGER inb(nloc)
    423 
    424       REAL cbmf(nloc), plcl(nloc), plfc(nloc), wbeff(nloc)
    425       REAL t(nloc, nd), q(nloc, nd), qs(nloc, nd)
    426       REAL t_wake(nloc, nd), q_wake(nloc, nd), qs_wake(nloc, nd)
    427       REAL s_wake(nloc)
    428       REAL u(nloc, nd), v(nloc, nd)
    429       REAL gz(nloc, nd), h(nloc, nd)
    430       REAL h_wake(nloc, nd)
    431       REAL lv(nloc, nd), lf(nloc, nd), cpn(nloc, nd)
    432       REAL lv_wake(nloc, nd), lf_wake(nloc, nd), cpn_wake(nloc, nd)
    433       REAL p(nloc, nd), ph(nloc, nd + 1), tv(nloc, nd), tp(nloc, nd)
    434       REAL tv_wake(nloc, nd)
    435       REAL clw(nloc, nd)
    436       REAL qta(nloc, nd), qpreca(nloc, nd)
    437       REAL pbase(nloc), buoybase(nloc), th(nloc, nd)
    438       REAL th_wake(nloc, nd)
    439       REAL tvp(nloc, nd)
    440       REAL sig(nloc, nd), w0(nloc, nd), ptop2(nloc)
    441       REAL hp(nloc, nd), ep(nloc, nd), sigp(nloc, nd)
    442       REAL buoy(nloc, nd)
    443       REAL cape(nloc)
    444       REAL cin(nloc)
    445       REAL m(nloc, nd)
    446       REAL mm(nloc, nd)
    447       REAL ment(nloc, nd, nd), sigij(nloc, nd, nd)
    448       REAL qent(nloc, nd, nd)
    449       REAL hent(nloc, nd, nd)
    450       REAL uent(nloc, nd, nd), vent(nloc, nd, nd)
    451       REAL ments(nloc, nd, nd), qents(nloc, nd, nd)
    452       REAL elij(nloc, nd, nd)
    453       REAL supmax(nloc, nd)
    454       REAL Ale(nloc), Alp(nloc), coef_clos(nloc)
    455       REAL omega(nloc, nd)
    456       REAL sigd(nloc)
    457       REAL, DIMENSION(nloc, nd)     :: mp, qp, up, vp
    458       REAL, DIMENSION(nloc, nd)     :: wt, water, evap
    459       REAL, DIMENSION(nloc, nd)     :: ice, fondue, b
    460       REAL, DIMENSION(nloc, nd)     :: frac_a, frac_s, faci
    461       REAL ft(nloc, nd), fq(nloc, nd)
    462       REAL ftd(nloc, nd), fqd(nloc, nd)
    463       REAL fu(nloc, nd), fv(nloc, nd)
    464       REAL upwd(nloc, nd), dnwd(nloc, nd), dnwd0(nloc, nd)
    465       REAL ma(nloc, nd), mip(nloc, nd)
    466       REAL precip(nloc)
    467       REAL vprecip(nloc, nd + 1)
    468       REAL vprecipi(nloc, nd + 1)
    469       REAL tra(nloc, nd, ntra), trap(nloc, nd, ntra)
    470       REAL ftra(nloc, nd, ntra), traent(nloc, nd, nd, ntra)
    471       REAL qcondc(nloc, nd)
    472       REAL wd(nloc)
    473       REAL Plim1(nloc), plim2(nloc)
    474       REAL asupmax(nloc, nd)
    475       REAL supmax0(nloc)
    476       REAL asupmaxmin(nloc)
    477 
    478       REAL tnk(nloc), qnk(nloc), gznk(nloc)
    479       REAL wghti(nloc, nd)
    480       REAL hnk(nloc), unk(nloc), vnk(nloc)
    481 
    482       REAL qtc(nloc, nd)
    483       REAL sigt(nloc, nd)
    484 
    485       REAL wdtrainA(nloc, nd), wdtrainS(nloc, nd), wdtrainM(nloc, nd)
    486       REAL da(nloc, nd), phi(nloc, nd, nd)
    487       REAL epmlmMm(nloc, nd, nd), eplaMm(nloc, nd)
    488       REAL phi2(nloc, nd, nd)
    489       REAL d1a(nloc, nd), dam(nloc, nd)
    490       REAL epmax_diag(nloc)
    491 
    492       LOGICAL ok_inhib ! True => possible inhibition of convection by dryness
    493       integer :: k
    494 
    495       integer :: ncum ! Number of convective cells
    496       type(compress_data_t) :: compress_data
    497       type(array_list) :: cv3a_compress_list, cv3a_uncompress_list
    498       logical, save :: timers_first = .true.
    499       !$omp threadprivate(timers_first)
    500 
    501       call enter_profile("cv3a_compress")
    502       call driver_log('cv3a_compress')
    503 
    504       call add_array_i1(cv3a_compress_list, iflag1, iflag)
    505       call add_array_i1(cv3a_compress_list, nk1, nk)
    506       call add_array_i1(cv3a_compress_list, kbas1, icb)
    507       call add_array_i1(cv3a_compress_list, icbs1, icbs)
    508       call add_array_r1(cv3a_compress_list, plcl1, plcl)
    509       call add_array_r1(cv3a_compress_list, tnk1, tnk)
    510       call add_array_r1(cv3a_compress_list, qnk1, qnk)
    511       call add_array_r1(cv3a_compress_list, gznk1, gznk)
    512       call add_array_r1(cv3a_compress_list, hnk1, hnk)
    513       call add_array_r1(cv3a_compress_list, unk1, unk)
    514       call add_array_r1(cv3a_compress_list, vnk1, vnk)
    515       call add_array_r2(cv3a_compress_list, wghti1, wghti)
    516       call add_array_r1(cv3a_compress_list, pbase1, pbase)
    517       call add_array_r1(cv3a_compress_list, buoybase1, buoybase)
    518       call add_array_r2(cv3a_compress_list, th1, th)
    519       call add_array_r2(cv3a_compress_list, t1, t)
    520       call add_array_r2(cv3a_compress_list, q1, q)
    521       call add_array_r2(cv3a_compress_list, qs1, qs)
    522       call add_array_r2(cv3a_compress_list, t1_wake, t_wake)
    523       call add_array_r2(cv3a_compress_list, q1_wake, q_wake)
    524       call add_array_r2(cv3a_compress_list, qs1_wake, qs_wake)
    525       call add_array_r1(cv3a_compress_list, s1_wake, s_wake)
    526       call add_array_r2(cv3a_compress_list, u1, u)
    527       call add_array_r2(cv3a_compress_list, v1, v)
    528       call add_array_r2(cv3a_compress_list, gz1, gz)
    529       call add_array_r2(cv3a_compress_list, h1, h)
    530       call add_array_r2(cv3a_compress_list, th1_wake, th_wake)
    531       call add_array_r2(cv3a_compress_list, lv1, lv)
    532       call add_array_r2(cv3a_compress_list, lf1, lf)
    533       call add_array_r2(cv3a_compress_list, cpn1, cpn)
    534       call add_array_r2(cv3a_compress_list, p1, p)
    535       call add_array_r2(cv3a_compress_list, ph1, ph)
    536       call add_array_r2(cv3a_compress_list, tv1, tv)
    537       call add_array_r2(cv3a_compress_list, tp1, tp)
    538       call add_array_r2(cv3a_compress_list, tvp1, tvp)
    539       call add_array_r2(cv3a_compress_list, clw1, clw)
    540       call add_array_r2(cv3a_compress_list, h1_wake, h_wake)
    541       call add_array_r2(cv3a_compress_list, lv1_wake, lv_wake)
    542       call add_array_r2(cv3a_compress_list, lf1_wake, lf_wake)
    543       call add_array_r2(cv3a_compress_list, cpn1_wake, cpn_wake)
    544       call add_array_r2(cv3a_compress_list, tv1_wake, tv_wake)
    545       call add_array_r2(cv3a_compress_list, sig1, sig)
    546       call add_array_r1(cv3a_compress_list, sig1(:, nd), sig(:, nd))
    547       call add_array_r2(cv3a_compress_list, w01, w0)
    548       call add_array_r1(cv3a_compress_list, Ale1, Ale)
    549       call add_array_r1(cv3a_compress_list, Alp1, Alp)
    550       call add_array_r2(cv3a_compress_list, omega1, omega)
    551 
    552       call cv3a_compress(len, (iflag1 == 0), cv3a_compress_list, compress_data)
    553       ncum = compress_data%ncum
    554       call exit_profile("cv3a_compress")
    555 
     416      !compress_mode = COMPRESS_MODE_COPY
     417
     418      nloc = get_compress_size(len, (iflag1(:) == 0))
     419
     420      block
     421        ! (local) compressed fields:
     422        INTEGER iflag(nloc), nk(nloc), icb(nloc)
     423        INTEGER nent(nloc, nd)
     424        INTEGER icbs(nloc)
     425        INTEGER inb(nloc)
     426
     427        REAL cbmf(nloc), plcl(nloc), plfc(nloc), wbeff(nloc)
     428        REAL t(nloc, nd), q(nloc, nd), qs(nloc, nd)
     429        REAL t_wake(nloc, nd), q_wake(nloc, nd), qs_wake(nloc, nd)
     430        REAL s_wake(nloc)
     431        REAL u(nloc, nd), v(nloc, nd)
     432        REAL gz(nloc, nd), h(nloc, nd)
     433        REAL h_wake(nloc, nd)
     434        REAL lv(nloc, nd), lf(nloc, nd), cpn(nloc, nd)
     435        REAL lv_wake(nloc, nd), lf_wake(nloc, nd), cpn_wake(nloc, nd)
     436        REAL p(nloc, nd), ph(nloc, nd + 1), tv(nloc, nd), tp(nloc, nd)
     437        REAL tv_wake(nloc, nd)
     438        REAL clw(nloc, nd)
     439        REAL qta(nloc, nd), qpreca(nloc, nd)
     440        REAL pbase(nloc), buoybase(nloc), th(nloc, nd)
     441        REAL th_wake(nloc, nd)
     442        REAL tvp(nloc, nd)
     443        REAL sig(nloc, nd), w0(nloc, nd), ptop2(nloc)
     444        REAL hp(nloc, nd), ep(nloc, nd), sigp(nloc, nd)
     445        REAL buoy(nloc, nd)
     446        REAL cape(nloc)
     447        REAL cin(nloc)
     448        REAL m(nloc, nd)
     449        REAL mm(nloc, nd)
     450        REAL ment(nloc, nd, nd), sigij(nloc, nd, nd)
     451        REAL qent(nloc, nd, nd)
     452        REAL hent(nloc, nd, nd)
     453        REAL uent(nloc, nd, nd), vent(nloc, nd, nd)
     454        REAL ments(nloc, nd, nd), qents(nloc, nd, nd)
     455        REAL elij(nloc, nd, nd)
     456        REAL supmax(nloc, nd)
     457        REAL Ale(nloc), Alp(nloc), coef_clos(nloc)
     458        REAL omega(nloc, nd)
     459        REAL sigd(nloc)
     460        REAL, DIMENSION(nloc, nd)     :: mp, qp, up, vp
     461        REAL, DIMENSION(nloc, nd)     :: wt, water, evap
     462        REAL, DIMENSION(nloc, nd)     :: ice, fondue, b
     463        REAL, DIMENSION(nloc, nd)     :: frac_a, frac_s, faci
     464        REAL ft(nloc, nd), fq(nloc, nd)
     465        REAL ftd(nloc, nd), fqd(nloc, nd)
     466        REAL fu(nloc, nd), fv(nloc, nd)
     467        REAL upwd(nloc, nd), dnwd(nloc, nd), dnwd0(nloc, nd)
     468        REAL ma(nloc, nd), mip(nloc, nd)
     469        REAL precip(nloc)
     470        REAL vprecip(nloc, nd + 1)
     471        REAL vprecipi(nloc, nd + 1)
     472        REAL tra(nloc, nd, ntra), trap(nloc, nd, ntra)
     473        REAL ftra(nloc, nd, ntra), traent(nloc, nd, nd, ntra)
     474        REAL qcondc(nloc, nd)
     475        REAL wd(nloc)
     476        REAL Plim1(nloc), plim2(nloc)
     477        REAL asupmax(nloc, nd)
     478        REAL supmax0(nloc)
     479        REAL asupmaxmin(nloc)
     480
     481        REAL tnk(nloc), qnk(nloc), gznk(nloc)
     482        REAL wghti(nloc, nd)
     483        REAL hnk(nloc), unk(nloc), vnk(nloc)
     484
     485        REAL qtc(nloc, nd)
     486        REAL sigt(nloc, nd)
     487
     488        REAL wdtrainA(nloc, nd), wdtrainS(nloc, nd), wdtrainM(nloc, nd)
     489        REAL da(nloc, nd), phi(nloc, nd, nd)
     490        REAL epmlmMm(nloc, nd, nd), eplaMm(nloc, nd)
     491        REAL phi2(nloc, nd, nd)
     492        REAL d1a(nloc, nd), dam(nloc, nd)
     493        REAL epmax_diag(nloc)
     494
     495        LOGICAL ok_inhib ! True => possible inhibition of convection by dryness
     496
     497        integer :: ncum ! Number of convective cells
     498        type(compress_data_t) :: compress_data
     499        type(array_list) :: cv3a_compress_list, cv3a_uncompress_list
     500        logical, save :: timers_first = .true.
     501        !$omp threadprivate(timers_first)
     502
     503        call enter_profile("cv3a_compress")
     504        call driver_log('cv3a_compress')
     505
     506        call add_array_i1(cv3a_compress_list, iflag1, iflag)
     507        call add_array_i1(cv3a_compress_list, nk1, nk)
     508        call add_array_i1(cv3a_compress_list, kbas1, icb)
     509        call add_array_i1(cv3a_compress_list, icbs1, icbs)
     510        call add_array_r1(cv3a_compress_list, plcl1, plcl)
     511        call add_array_r1(cv3a_compress_list, tnk1, tnk)
     512        call add_array_r1(cv3a_compress_list, qnk1, qnk)
     513        call add_array_r1(cv3a_compress_list, gznk1, gznk)
     514        call add_array_r1(cv3a_compress_list, hnk1, hnk)
     515        call add_array_r1(cv3a_compress_list, unk1, unk)
     516        call add_array_r1(cv3a_compress_list, vnk1, vnk)
     517        call add_array_r2(cv3a_compress_list, wghti1, wghti)
     518        call add_array_r1(cv3a_compress_list, pbase1, pbase)
     519        call add_array_r1(cv3a_compress_list, buoybase1, buoybase)
     520        call add_array_r2(cv3a_compress_list, th1, th)
     521        call add_array_r2(cv3a_compress_list, t1, t)
     522        call add_array_r2(cv3a_compress_list, q1, q)
     523        call add_array_r2(cv3a_compress_list, qs1, qs)
     524        call add_array_r2(cv3a_compress_list, t1_wake, t_wake)
     525        call add_array_r2(cv3a_compress_list, q1_wake, q_wake)
     526        call add_array_r2(cv3a_compress_list, qs1_wake, qs_wake)
     527        call add_array_r1(cv3a_compress_list, s1_wake, s_wake)
     528        call add_array_r2(cv3a_compress_list, u1, u)
     529        call add_array_r2(cv3a_compress_list, v1, v)
     530        call add_array_r2(cv3a_compress_list, gz1, gz)
     531        call add_array_r2(cv3a_compress_list, h1, h)
     532        call add_array_r2(cv3a_compress_list, th1_wake, th_wake)
     533        call add_array_r2(cv3a_compress_list, lv1, lv)
     534        call add_array_r2(cv3a_compress_list, lf1, lf)
     535        call add_array_r2(cv3a_compress_list, cpn1, cpn)
     536        call add_array_r2(cv3a_compress_list, p1, p)
     537        call add_array_r2(cv3a_compress_list, ph1, ph)
     538        call add_array_r2(cv3a_compress_list, tv1, tv)
     539        call add_array_r2(cv3a_compress_list, tp1, tp)
     540        call add_array_r2(cv3a_compress_list, tvp1, tvp)
     541        call add_array_r2(cv3a_compress_list, clw1, clw)
     542        call add_array_r2(cv3a_compress_list, h1_wake, h_wake)
     543        call add_array_r2(cv3a_compress_list, lv1_wake, lv_wake)
     544        call add_array_r2(cv3a_compress_list, lf1_wake, lf_wake)
     545        call add_array_r2(cv3a_compress_list, cpn1_wake, cpn_wake)
     546        call add_array_r2(cv3a_compress_list, tv1_wake, tv_wake)
     547        call add_array_r2(cv3a_compress_list, sig1, sig)
     548        call add_array_r1(cv3a_compress_list, sig1(:, nd), sig(:, nd))
     549        call add_array_r2(cv3a_compress_list, w01, w0)
     550        call add_array_r1(cv3a_compress_list, Ale1, Ale)
     551        call add_array_r1(cv3a_compress_list, Alp1, Alp)
     552        call add_array_r2(cv3a_compress_list, omega1, omega)
     553
     554        call cv3a_compress(len, (iflag1 == 0), cv3a_compress_list, compress_data)
     555        ncum = compress_data%ncum
     556        call exit_profile("cv3a_compress")
     557
     558        call cv3a_driver_compressed(nloc, nd, ntra, &
     559                                    debut, ok_conserv_q, iflag_mix, iflag_clos, prt_level, &
     560                                    ! Input fields
     561                                    delt, tau_cld_cv, coefw_cld_cv, nk, icbs, tnk, qnk, gznk, hnk, unk, vnk, pbase, buoybase, s_wake, Ale, Alp, wghti, th, t, q, qs, t_wake, q_wake, qs_wake, u, v, gz, h, th_wake, lv, lf, cpn, p, tv, tp, h_wake, lv_wake, lf_wake, cpn_wake, tv_wake, omega, ph, &
     562                                    ! Input/output
     563                                    iflag, icb, plcl, sig, w0, tvp, clw, &
     564                                    ! Output fields
     565                                    inb, precip, cbmf, plfc, wbeff, ptop2, sigd, wd, cape, cin, Plim1, plim2, supmax0, asupmaxmin, epmax_diag, ft, fq, fu, fv, ma, mip, upwd, dnwd, dnwd0, qcondc, ftd, fqd, asupmax, da, mp, d1a, dam, qta,  evap, ep, eplaMm, wdtrainA, wdtrainS, wdtrainM, qtc, sigt, vprecip, vprecipi, phi, phi2, sigij, elij, epmlmMm)
     566
     567        ! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     568        ! --- UNCOMPRESS THE FIELDS
     569        ! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     570        call enter_profile("cv3a_uncompress")
     571        call driver_log('cv3a_uncompress')
     572        call add_array_i1(cv3a_uncompress_list, iflag, iflag1, init=.false.)
     573        call add_array_i1(cv3a_uncompress_list, icb, kbas1)
     574        call add_array_i1(cv3a_uncompress_list, inb, ktop1)
     575        call add_array_r1(cv3a_uncompress_list, precip, precip1)
     576        call add_array_r1(cv3a_uncompress_list, cbmf, cbmf1)
     577        call add_array_r1(cv3a_uncompress_list, plcl, plcl1, init=.false.)
     578        call add_array_r1(cv3a_uncompress_list, plfc, plfc1)
     579        call add_array_r1(cv3a_uncompress_list, wbeff, wbeff1)
     580        call add_array_r2(cv3a_uncompress_list, sig, sig1)
     581        call add_array_r2(cv3a_uncompress_list, w0, w01)
     582        call add_array_r1(cv3a_uncompress_list, ptop2, ptop21)
     583        call add_array_r2(cv3a_uncompress_list, ft, ft1)
     584        call add_array_r2(cv3a_uncompress_list, fq, fq1)
     585        call add_array_r2(cv3a_uncompress_list, fu, fu1)
     586        call add_array_r2(cv3a_uncompress_list, fv, fv1)
     587        call add_array_r1(cv3a_uncompress_list, sigd, sigd1)
     588        call add_array_r2(cv3a_uncompress_list, ma, ma1)
     589        call add_array_r2(cv3a_uncompress_list, mip, mip1)
     590        call add_array_r2(cv3a_uncompress_list, vprecip, vprecip1)
     591        call add_array_r2(cv3a_uncompress_list, vprecipi, vprecipi1)
     592        call add_array_r2(cv3a_uncompress_list, upwd, upwd1)
     593        call add_array_r2(cv3a_uncompress_list, dnwd, dnwd1)
     594        call add_array_r2(cv3a_uncompress_list, dnwd0, dnwd01)
     595        call add_array_r2(cv3a_uncompress_list, qcondc, qcondc1)
     596        call add_array_r1(cv3a_uncompress_list, wd, wd1)
     597        cape1(:) = Cape_noconv
     598        call add_array_r1(cv3a_uncompress_list, cape, cape1, init=.false.)
     599        cin1(:) = Cin_noconv
     600        call add_array_r1(cv3a_uncompress_list, cin, cin1, init=.false.)
     601        call add_array_r2(cv3a_uncompress_list, tvp, tvp1, init=.false.)
     602        call add_array_r2(cv3a_uncompress_list, ftd, ftd1)
     603        call add_array_r2(cv3a_uncompress_list, fqd, fqd1)
     604        call add_array_r1(cv3a_uncompress_list, Plim1, Plim11)
     605        call add_array_r1(cv3a_uncompress_list, plim2, plim21)
     606        call add_array_r2(cv3a_uncompress_list, asupmax, asupmax1)
     607        call add_array_r1(cv3a_uncompress_list, supmax0, supmax01)
     608        call add_array_r1(cv3a_uncompress_list, asupmaxmin, asupmaxmin1)
     609        call add_array_r2(cv3a_uncompress_list, da, da1)
     610        call add_array_r3(cv3a_uncompress_list, phi, phi1)
     611        call add_array_r2(cv3a_uncompress_list, mp, mp1)
     612        call add_array_r3(cv3a_uncompress_list, phi2, phi21)
     613        call add_array_r2(cv3a_uncompress_list, d1a, d1a1)
     614        call add_array_r2(cv3a_uncompress_list, dam, dam1)
     615        call add_array_r3(cv3a_uncompress_list, sigij, sigij1)
     616        call add_array_r2(cv3a_uncompress_list, qta, qta1)
     617        call add_array_r2(cv3a_uncompress_list, clw, clw1, init=.false.)
     618        call add_array_r3(cv3a_uncompress_list, elij, elij1)
     619        call add_array_r2(cv3a_uncompress_list, evap, evap1)
     620        call add_array_r2(cv3a_uncompress_list, ep, ep1)
     621        call add_array_r3(cv3a_uncompress_list, epmlmMm, epmlmMm1)
     622        call add_array_r2(cv3a_uncompress_list, eplaMm, eplaMm1)
     623        call add_array_r2(cv3a_uncompress_list, wdtrainA, wdtrainA1)
     624        call add_array_r2(cv3a_uncompress_list, wdtrainS, wdtrainS1)
     625        call add_array_r2(cv3a_uncompress_list, wdtrainM, wdtrainM1)
     626        call add_array_r2(cv3a_uncompress_list, qtc, qtc1)
     627        call add_array_r2(cv3a_uncompress_list, sigt, sigt1)
     628        call add_array_r1(cv3a_uncompress_list, epmax_diag, epmax_diag1)
     629        call add_array_r1(cv3a_uncompress_list, sig(:, nd), sig1(:, nd))
     630        call cv3a_uncompress(len, compress_data, cv3a_uncompress_list)
     631        call exit_profile("cv3a_uncompress")
     632
     633      end block
     634    else !compress
     635      nloc = len
     636      ktop1 = 0
     637      precip1 = 0
     638      cbmf1 = 0
     639      plfc1 = 0
     640      wbeff1 = 0
     641      ptop21 = 0
     642      sigd1 = 0
     643      wd1 = 0
     644      cape1 = Cape_noconv
     645      cin1 = Cin_noconv
     646      Plim11 = 0
     647      plim21 = 0
     648      supmax01 = 0
     649      asupmaxmin1 = 0
     650      epmax_diag1 = 0
     651      ft1 = 0
     652      fq1 = 0
     653      fu1 = 0
     654      fv1 = 0
     655      ma1 = 0
     656      mip1 = 0
     657      upwd1 = 0
     658      dnwd1 = 0
     659      dnwd01 = 0
     660      qcondc1 = 0
     661      ftd1 = 0
     662      fqd1 = 0
     663      asupmax1 = 0
     664      da1 = 0
     665      mp1 = 0
     666      d1a1 = 0
     667      dam1 = 0
     668      qta1 = 0
     669      evap1 = 0
     670      ep1 = 0
     671      eplaMm1 = 0
     672      wdtrainA1 = 0
     673      wdtrainS1 = 0
     674      wdtrainM1 = 0
     675      qtc1 = 0
     676      sigt1 = 0
     677      vprecip1 = 0
     678      vprecipi1 = 0
     679      phi1 = 0
     680      phi21 = 0
     681      sigij1 = 0
     682      elij1 = 0
     683      epmlmMm1 = 0
     684      coef_convective(:) = merge(1, 0, iflag1(:) == 0)
    556685      call cv3a_driver_compressed(nloc, nd, ntra, &
    557686                                  debut, ok_conserv_q, iflag_mix, iflag_clos, prt_level, &
    558687                                  ! Input fields
    559                                   delt, tau_cld_cv, coefw_cld_cv, nk, icbs, tnk, qnk, gznk, hnk, unk, vnk, pbase, buoybase, s_wake, Ale, Alp, wghti, th, t, q, qs, t_wake, q_wake, qs_wake, u, v, gz, h, th_wake, lv, lf, cpn, p, tv, tp, h_wake, lv_wake, lf_wake, cpn_wake, tv_wake, omega, ph, &
     688                                  delt, tau_cld_cv, coefw_cld_cv, nk1, icbs1, tnk1, qnk1, gznk1, hnk1, unk1, vnk1, pbase1, buoybase1, s1_wake, Ale1, Alp1, wghti1, th1, t1, q1, qs1, t1_wake, q1_wake, qs1_wake, u1, v1, gz1, h1, th1_wake, lv1, lf1, cpn1, p1, tv1, tp1, h1_wake, lv1_wake, lf1_wake, cpn1_wake, tv1_wake, omega1, ph1, &
    560689                                  ! Input/output
    561                                   iflag, icb, plcl, sig, w0, tvp, clw, &
     690                                  iflag1, kbas1, plcl1, sig1, w01, tvp1, clw1, &
    562691                                  ! Output fields
    563                                   inb, precip, cbmf, plfc, wbeff, ptop2, sigd, wd, cape, cin, Plim1, plim2, supmax0, asupmaxmin, epmax_diag, ft, fq, fu, fv, ma, mip, upwd, dnwd, dnwd0, qcondc, ftd, fqd, asupmax, da, mp, d1a, dam, qta,  evap, ep, eplaMm, wdtrainA, wdtrainS, wdtrainM, qtc, sigt, vprecip, vprecipi, phi, phi2, sigij, elij, epmlmMm)
    564 
    565 ! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    566 ! --- UNCOMPRESS THE FIELDS
    567 ! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    568       call enter_profile("cv3a_uncompress")
    569       call driver_log('cv3a_uncompress')
    570       call add_array_i1(cv3a_uncompress_list, iflag, iflag1, init=.false.)
    571       call add_array_i1(cv3a_uncompress_list, icb, kbas1)
    572       call add_array_i1(cv3a_uncompress_list, inb, ktop1)
    573       call add_array_r1(cv3a_uncompress_list, precip, precip1)
    574       call add_array_r1(cv3a_uncompress_list, cbmf, cbmf1)
    575       call add_array_r1(cv3a_uncompress_list, plcl, plcl1, init=.false.)
    576       call add_array_r1(cv3a_uncompress_list, plfc, plfc1)
    577       call add_array_r1(cv3a_uncompress_list, wbeff, wbeff1)
    578       call add_array_r2(cv3a_uncompress_list, sig, sig1)
    579       call add_array_r2(cv3a_uncompress_list, w0, w01)
    580       call add_array_r1(cv3a_uncompress_list, ptop2, ptop21)
    581       call add_array_r2(cv3a_uncompress_list, ft, ft1)
    582       call add_array_r2(cv3a_uncompress_list, fq, fq1)
    583       call add_array_r2(cv3a_uncompress_list, fu, fu1)
    584       call add_array_r2(cv3a_uncompress_list, fv, fv1)
    585       call add_array_r1(cv3a_uncompress_list, sigd, sigd1)
    586       call add_array_r2(cv3a_uncompress_list, ma, ma1)
    587       call add_array_r2(cv3a_uncompress_list, mip, mip1)
    588       call add_array_r2(cv3a_uncompress_list, vprecip, vprecip1)
    589       call add_array_r2(cv3a_uncompress_list, vprecipi, vprecipi1)
    590       call add_array_r2(cv3a_uncompress_list, upwd, upwd1)
    591       call add_array_r2(cv3a_uncompress_list, dnwd, dnwd1)
    592       call add_array_r2(cv3a_uncompress_list, dnwd0, dnwd01)
    593       call add_array_r2(cv3a_uncompress_list, qcondc, qcondc1)
    594       call add_array_r1(cv3a_uncompress_list, wd, wd1)
    595       cape1(:) = -1.
    596       call add_array_r1(cv3a_uncompress_list, cape, cape1, init=.false.)
    597       cin1(:) = -100000.
    598       call add_array_r1(cv3a_uncompress_list, cin, cin1, init=.false.)
    599       call add_array_r2(cv3a_uncompress_list, tvp, tvp1, init=.false.)
    600       call add_array_r2(cv3a_uncompress_list, ftd, ftd1)
    601       call add_array_r2(cv3a_uncompress_list, fqd, fqd1)
    602       call add_array_r1(cv3a_uncompress_list, Plim1, Plim11)
    603       call add_array_r1(cv3a_uncompress_list, plim2, plim21)
    604       call add_array_r2(cv3a_uncompress_list, asupmax, asupmax1)
    605       call add_array_r1(cv3a_uncompress_list, supmax0, supmax01)
    606       call add_array_r1(cv3a_uncompress_list, asupmaxmin, asupmaxmin1)
    607       call add_array_r2(cv3a_uncompress_list, da, da1)
    608       call add_array_r3(cv3a_uncompress_list, phi, phi1)
    609       call add_array_r2(cv3a_uncompress_list, mp, mp1)
    610       call add_array_r3(cv3a_uncompress_list, phi2, phi21)
    611       call add_array_r2(cv3a_uncompress_list, d1a, d1a1)
    612       call add_array_r2(cv3a_uncompress_list, dam, dam1)
    613       call add_array_r3(cv3a_uncompress_list, sigij, sigij1)
    614       call add_array_r2(cv3a_uncompress_list, qta, qta1)
    615       call add_array_r2(cv3a_uncompress_list, clw, clw1, init=.false.)
    616       call add_array_r3(cv3a_uncompress_list, elij, elij1)
    617       call add_array_r2(cv3a_uncompress_list, evap, evap1)
    618       call add_array_r2(cv3a_uncompress_list, ep, ep1)
    619       call add_array_r3(cv3a_uncompress_list, epmlmMm, epmlmMm1)
    620       call add_array_r2(cv3a_uncompress_list, eplaMm, eplaMm1)
    621       call add_array_r2(cv3a_uncompress_list, wdtrainA, wdtrainA1)
    622       call add_array_r2(cv3a_uncompress_list, wdtrainS, wdtrainS1)
    623       call add_array_r2(cv3a_uncompress_list, wdtrainM, wdtrainM1)
    624       call add_array_r2(cv3a_uncompress_list, qtc, qtc1)
    625       call add_array_r2(cv3a_uncompress_list, sigt, sigt1)
    626       call add_array_r1(cv3a_uncompress_list, epmax_diag, epmax_diag1)
    627       call add_array_r1(cv3a_uncompress_list, sig(:, nd), sig1(:, nd))
    628       call cv3a_uncompress(len, compress_data, cv3a_uncompress_list)
    629       call exit_profile("cv3a_uncompress")
    630 
    631     end block
     692                                  ktop1, precip1, cbmf1, plfc1, wbeff1, ptop21, sigd1, wd1, cape1, cin1, Plim11, plim21, supmax01, asupmaxmin1, epmax_diag1, ft1, fq1, fu1, fv1, ma1, mip1, upwd1, dnwd1, dnwd01, qcondc1, ftd1, fqd1, asupmax1, da1, mp1, d1a1, dam1, qta1,  evap1, ep1, eplaMm1, wdtrainA1, wdtrainS1, wdtrainM1, qtc1, sigt1, vprecip1, vprecipi1, phi1, phi21, sigij1, elij1, epmlmMm1)
     693      !  Reset Cin1 and Cape1 to their default values for non-convective grid-points.
     694      Cin1(:) = Cin1(:)*coef_convective(:) + Cin_noconv*(1.-coef_convective(:))
     695      Cape1(:) = Cape1(:)*coef_convective(:) + Cape_noconv*(1.-coef_convective(:))
     696      precip1(:) = precip1(:)*coef_convective(:)
     697      kbas1(:) = kbas1(:)*coef_convective(:)
     698      ktop1(:) = ktop1(:)*coef_convective(:)
     699      sigd1(:) = sigd1(:)*coef_convective(:)
     700      wbeff1(:) = wbeff1(:)*coef_convective(:)
     701      DO k = 1, nd
     702        qcondc1(:, k) = qcondc1(:, k)*coef_convective(:)
     703        vprecip1(:, k) = vprecip1(:, k)*coef_convective(:)
     704        vprecipi1(:, k) = vprecipi1(:, k)*coef_convective(:)
     705      ENDDO
     706    endif
    632707
    633708    IF (prt_level >= 10) THEN
Note: See TracChangeset for help on using the changeset viewer.