Ignore:
Timestamp:
Dec 17, 2025, 7:33:39 PM (4 weeks ago)
Author:
yann meurdesoif
Message:

Separate pbl_surface into 3 subroutines for GPU port

pbl_surface_uncompress_pre : prepare computation for sub subsurface before compressing
pbl_surface_subsrf : each sub-surface is called one after other (horizontal = knon)
pbl_surface_uncompress_post : sub-surface are uncompressed, computation is done on whole domain (horizontal = klon)

pbl_surface_main becomes the driver, calling pbl_surface_uncompress_pre, and then looping under sub-surface (and calling pbl_surface_subsrf) and then calling pbl_surface_uncompress_post.

merge of commit r5868

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/hbtm_mod.f90

    r5285 r5942  
    4949    INTEGER knon ! nombre de points a calculer
    5050    ! AM
    51     REAL t2m(klon), t10m(klon) ! temperature a 2 et 10m
    52     REAL q2m(klon), q10m(klon) ! q a 2 et 10m
    53     REAL ustar(klon)
    54     REAL wstar(klon) ! w*, convective velocity scale
    55     REAL paprs(klon, klev+1) ! pression a inter-couche (Pa)
    56     REAL pplay(klon, klev) ! pression au milieu de couche (Pa)
    57     REAL flux_t(klon, klev), flux_q(klon, klev) ! Flux
    58     REAL u(klon, klev) ! vitesse U (m/s)
    59     REAL v(klon, klev) ! vitesse V (m/s)
    60     REAL t(klon, klev) ! temperature (K)
    61     REAL q(klon, klev) ! vapeur d'eau (kg/kg)
     51    REAL t2m(knon), t10m(knon) ! temperature a 2 et 10m
     52    REAL q2m(knon), q10m(knon) ! q a 2 et 10m
     53    REAL ustar(knon)
     54    REAL wstar(knon) ! w*, convective velocity scale
     55    REAL paprs(knon, klev+1) ! pression a inter-couche (Pa)
     56    REAL pplay(knon, klev) ! pression au milieu de couche (Pa)
     57    REAL flux_t(knon, klev), flux_q(knon, klev) ! Flux
     58    REAL u(knon, klev) ! vitesse U (m/s)
     59    REAL v(knon, klev) ! vitesse V (m/s)
     60    REAL t(knon, klev) ! temperature (K)
     61    REAL q(knon, klev) ! vapeur d'eau (kg/kg)
    6262    ! AM      REAL cd_h(klon) ! coefficient de friction au sol pour chaleur
    6363    ! AM      REAL cd_m(klon) ! coefficient de friction au sol pour vitesse
     
    8989    REAL b212, b2sr ! Lambert correlations T' q' avec T* q*
    9090
    91     REAL z(klon, klev)
     91    REAL z(knon, klev)
    9292    ! AM      REAL pcfm(klon,klev), pcfh(klon,klev)
    9393    INTEGER i, k, j
     
    9595    ! AM      REAL zxt, zxq, zxu, zxv, zxmod, taux, tauy
    9696    ! AM      REAL zx_alf1, zx_alf2 ! parametres pour extrapolation
    97     REAL khfs(klon) ! surface kinematic heat flux [mK/s]
    98     REAL kqfs(klon) ! sfc kinematic constituent flux [m/s]
    99     REAL heatv(klon) ! surface virtual heat flux
    100     REAL rhino(klon, klev) ! bulk Richardon no. mais en Theta_v
    101     LOGICAL unstbl(klon) ! pts w/unstbl pbl (positive virtual ht flx)
    102     LOGICAL stblev(klon) ! stable pbl with levels within pbl
    103     LOGICAL unslev(klon) ! unstbl pbl with levels within pbl
    104     LOGICAL unssrf(klon) ! unstb pbl w/lvls within srf pbl lyr
    105     LOGICAL unsout(klon) ! unstb pbl w/lvls in outer pbl lyr
    106     LOGICAL check(klon) ! True=>chk if Richardson no.>critcal
    107     LOGICAL omegafl(klon) ! flag de prolongerment cape pour pt Omega
    108     REAL pblh(klon)
    109     REAL pblt(klon)
    110     REAL plcl(klon)
     97    REAL khfs(knon) ! surface kinematic heat flux [mK/s]
     98    REAL kqfs(knon) ! sfc kinematic constituent flux [m/s]
     99    REAL heatv(knon) ! surface virtual heat flux
     100    REAL rhino(knon, klev) ! bulk Richardon no. mais en Theta_v
     101    LOGICAL unstbl(knon) ! pts w/unstbl pbl (positive virtual ht flx)
     102    LOGICAL stblev(knon) ! stable pbl with levels within pbl
     103    LOGICAL unslev(knon) ! unstbl pbl with levels within pbl
     104    LOGICAL unssrf(knon) ! unstb pbl w/lvls within srf pbl lyr
     105    LOGICAL unsout(knon) ! unstb pbl w/lvls in outer pbl lyr
     106    LOGICAL check(knon) ! True=>chk if Richardson no.>critcal
     107    LOGICAL omegafl(knon) ! flag de prolongerment cape pour pt Omega
     108    REAL pblh(knon)
     109    REAL pblt(knon)
     110    REAL plcl(knon)
    111111    ! AM      REAL cgh(klon,2:klev) ! counter-gradient term for heat [K/m]
    112112    ! AM      REAL cgq(klon,2:klev) ! counter-gradient term for constituents
    113113    ! AM      REAL cgs(klon,2:klev) ! counter-gradient star (cg/flux)
    114     REAL unsobklen(klon) ! Monin-Obukhov lengh
     114    REAL unsobklen(knon) ! Monin-Obukhov lengh
    115115    ! AM      REAL ztvd, ztvu,
    116116    REAL zdu2
    117     REAL, intent(out):: therm(:) ! (klon) thermal virtual temperature excess
    118     REAL trmb1(klon), trmb2(klon), trmb3(klon)
     117    REAL, intent(out):: therm(knon) ! (klon) thermal virtual temperature excess
     118    REAL trmb1(knon), trmb2(knon), trmb3(knon)
    119119    ! Algorithme thermique
    120     REAL s(klon, klev) ! [P/Po]^Kappa milieux couches
    121     REAL th_th(klon) ! potential temperature of thermal
    122     REAL the_th(klon) ! equivalent potential temperature of thermal
    123     REAL qt_th(klon) ! total water  of thermal
    124     REAL tbef(klon) ! T thermique niveau precedent
    125     REAL qsatbef(klon)
    126     LOGICAL zsat(klon) ! le thermique est sature
    127     REAL cape(klon) ! Cape du thermique
    128     REAL kape(klon) ! Cape locale
    129     REAL eauliq(klon) ! Eau liqu integr du thermique
    130     REAL ctei(klon) ! Critere d'instab d'entrainmt des nuages de CL
     120    REAL s(knon, klev) ! [P/Po]^Kappa milieux couches
     121    REAL th_th(knon) ! potential temperature of thermal
     122    REAL the_th(knon) ! equivalent potential temperature of thermal
     123    REAL qt_th(knon) ! total water  of thermal
     124    REAL tbef(knon) ! T thermique niveau precedent
     125    REAL qsatbef(knon)
     126    LOGICAL zsat(knon) ! le thermique est sature
     127    REAL cape(knon) ! Cape du thermique
     128    REAL kape(knon) ! Cape locale
     129    REAL eauliq(knon) ! Eau liqu integr du thermique
     130    REAL ctei(knon) ! Critere d'instab d'entrainmt des nuages de CL
    131131    REAL the1, the2, aa, bb, zthvd, zthvu, xintpos, qqsat
    132132    ! IM 091204 BEG
     
    137137    REAL delt_qt, delt_2, quadsat, spblh, reduc
    138138
    139     REAL phiminv(klon) ! inverse phi function for momentum
    140     REAL phihinv(klon) ! inverse phi function for heat
    141     REAL wm(klon) ! turbulent velocity scale for momentum
    142     REAL fak1(klon) ! k*ustar*pblh
    143     REAL fak2(klon) ! k*wm*pblh
    144     REAL fak3(klon) ! fakn*wstar/wm
    145     REAL pblk(klon) ! level eddy diffusivity for momentum
    146     REAL pr(klon) ! Prandtl number for eddy diffusivities
    147     REAL zl(klon) ! zmzp / Obukhov length
    148     REAL zh(klon) ! zmzp / pblh
    149     REAL zzh(klon) ! (1-(zmzp/pblh))**2
    150     REAL zm(klon) ! current level height
    151     REAL zp(klon) ! current level height + one level up
     139    REAL phiminv(knon) ! inverse phi function for momentum
     140    REAL phihinv(knon) ! inverse phi function for heat
     141    REAL wm(knon) ! turbulent velocity scale for momentum
     142    REAL fak1(knon) ! k*ustar*pblh
     143    REAL fak2(knon) ! k*wm*pblh
     144    REAL fak3(knon) ! fakn*wstar/wm
     145    REAL pblk(knon) ! level eddy diffusivity for momentum
     146    REAL pr(knon) ! Prandtl number for eddy diffusivities
     147    REAL zl(knon) ! zmzp / Obukhov length
     148    REAL zh(knon) ! zmzp / pblh
     149    REAL zzh(knon) ! (1-(zmzp/pblh))**2
     150    REAL zm(knon) ! current level height
     151    REAL zp(knon) ! current level height + one level up
    152152    REAL zcor, zdelta, zcvm5
    153153    ! AM      REAL zxqs
Note: See TracChangeset for help on using the changeset viewer.