Ignore:
Timestamp:
Jul 24, 2024, 4:23:34 PM (4 months ago)
Author:
abarral
Message:

rename modules properly lmdz_*
move some unused files to obsolete/
(lint) uppercase fortran keywords

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_down.F90

    r5116 r5117  
    2323    ! input/output
    2424
    25     integer, intent(in) :: ngrid ! number of horizontal grid points
    26     integer, intent(in) :: nlay  ! number of vertical layers
    27     real, intent(in) :: ptimestep ! time step of the physics [s]
    28     real, intent(in), dimension(ngrid, nlay) :: eup ! entrainment to updrafts * dz [same unit as flux]
    29     real, intent(in), dimension(ngrid, nlay) :: dup ! detrainment from updrafts * dz [same unit as flux]
    30     real, intent(in), dimension(ngrid, nlay) :: edn ! entrainment to downdrafts * dz [same unit as flux]
    31     real, intent(in), dimension(ngrid, nlay) :: ddn ! detrainment from downdrafts * dz [same unit as flux]
    32     real, intent(in), dimension(ngrid, nlay) :: masse ! mass of layers = rho dz
    33     real, intent(in), dimension(ngrid, nlay) :: trac ! tracer
    34     integer, intent(in), dimension(ngrid) :: lmax ! max level index at which downdraft are present
    35     real, intent(out), dimension(ngrid, nlay) :: dtrac ! tendance du traceur
     25    INTEGER, INTENT(IN) :: ngrid ! number of horizontal grid points
     26    INTEGER, INTENT(IN) :: nlay  ! number of vertical layers
     27    REAL, INTENT(IN) :: ptimestep ! time step of the physics [s]
     28    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: eup ! entrainment to updrafts * dz [same unit as flux]
     29    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: dup ! detrainment from updrafts * dz [same unit as flux]
     30    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: edn ! entrainment to downdrafts * dz [same unit as flux]
     31    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: ddn ! detrainment from downdrafts * dz [same unit as flux]
     32    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: masse ! mass of layers = rho dz
     33    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: trac ! tracer
     34    INTEGER, INTENT(IN), DIMENSION(ngrid) :: lmax ! max level index at which downdraft are present
     35    REAL, INTENT(OUT), DIMENSION(ngrid, nlay) :: dtrac ! tendance du traceur
    3636
    3737
    3838    ! Local
    3939
    40     real, dimension(ngrid, nlay + 1) :: fup, fdn, fc, fthu, fthd, fthe, fthtot
    41     real, dimension(ngrid, nlay) :: tracu, tracd, traci, tracold
     40    REAL, DIMENSION(ngrid, nlay + 1) :: fup, fdn, fc, fthu, fthd, fthe, fthtot
     41    REAL, DIMENSION(ngrid, nlay) :: tracu, tracd, traci, tracold
    4242    REAL :: www, mstar_inv
    43     integer ig, ilay
    44     real, dimension(ngrid, nlay) :: s1, s2, num !coefficients pour la resolution implicite
     43    INTEGER ig, ilay
     44    REAL, DIMENSION(ngrid, nlay) :: s1, s2, num !coefficients pour la resolution implicite
    4545    INTEGER :: iflag_impl = 1 ! 0 pour explicite, 1 pour implicite "classique", 2 pour implicite avec entrainement et detrainement
    4646
     
    6060    num(:, :) = 1.
    6161
    62     if (iflag_thermals_down < 10) THEN
     62    IF (iflag_thermals_down < 10) THEN
    6363      CALL abort_physic("thermcell_updown_dq", &
    6464              'thermcell_down_dq = 0 or >= 10', 1)
     
    7474      do ig = 1, ngrid
    7575        !if ( lmax(ig) > nlay - 2 ) stop "les thermiques montent trop haut"
    76         if (ilay<=lmax(ig) .and. lmax(ig)>1) THEN
     76        IF (ilay<=lmax(ig) .AND. lmax(ig)>1) THEN
    7777          fdn(ig, ilay) = fdn(ig, ilay + 1) + edn(ig, ilay) - ddn(ig, ilay)
    78           if (fdn(ig, ilay) + ddn(ig, ilay) > 0.) THEN
     78          IF (fdn(ig, ilay) + ddn(ig, ilay) > 0.) THEN
    7979            www = fdn(ig, ilay + 1) / (fdn(ig, ilay) + ddn(ig, ilay))
    8080          else
     
    9090    do ilay = 1, nlay, 1
    9191      do ig = 1, ngrid
    92         if (ilay<lmax(ig) .and. lmax(ig)>1) THEN
     92        IF (ilay<lmax(ig) .AND. lmax(ig)>1) THEN
    9393          fup(ig, ilay + 1) = fup(ig, ilay) + eup(ig, ilay) - dup(ig, ilay)
    94           if (fup(ig, ilay + 1) + dup(ig, ilay) > 0.) THEN
     94          IF (fup(ig, ilay + 1) + dup(ig, ilay) > 0.) THEN
    9595            www = fup(ig, ilay) / (fup(ig, ilay + 1) + dup(ig, ilay))
    9696          else
    9797            www = 0.
    9898          endif
    99           if (ilay == 1) THEN
     99          IF (ilay == 1) THEN
    100100            tracu(ig, ilay) = trac(ig, ilay)
    101101          else
     
    131131          !!!!ATTENTION HYPOTHESE de FLUX COMPENSATOIRE DESCENDANT ET DONC comme schema amont on va chercher trac au dessus!!!!!
    132132          !!!! tentative de prise en compte d'un flux compensatoire montant  !!!!
    133           if (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN
     133          IF (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN
    134134            CALL abort_physic("thermcell_updown_dq", 'flux compensatoire '&
    135135                    // 'montant, cas non traite par thermcell_updown_dq', 1)
     
    164164      do ilay = 2, nlay, 1
    165165        do ig = 1, ngrid
    166           if (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN
     166          IF (fup(ig, ilay) - fdn(ig, ilay) < 0.) THEN
    167167            CALL abort_physic("thermcell_updown_dq", 'flux compensatoire ' &
    168168                    // 'montant, cas non traite par thermcell_updown_dq', 1)
     
    183183      enddo !fin du calculer de la tendance du traceur avec la methode explicite
    184184
    185     else if (iflag_impl==1) THEN
     185    ELSE IF (iflag_impl==1) THEN
    186186      do ilay = 1, nlay
    187187        do ig = 1, ngrid
     
    193193      do ilay = nlay - 1, 1, -1
    194194        do ig = 1, ngrid
    195           if((fup(ig, ilay) - fdn(ig, ilay)) < 0) THEN
     195          IF((fup(ig, ilay) - fdn(ig, ilay)) < 0) THEN
    196196            WRITE(*, *) 'flux compensatoire montant, cas non traite par thermcell_updown_dq dans le cas d une resolution implicite, ilay : ', ilay
    197197            CALL abort_physic("thermcell_updown_dq", "", 1)
     
    230230    ! arguments
    231231
    232     integer, intent(in) :: ngrid, nlay
    233     real, intent(in), dimension(ngrid, nlay) :: po, pt, pu, pv, pplay, eup, dup
    234     real, intent(in), dimension(ngrid, nlay) :: theta
    235     real, intent(in), dimension(ngrid, nlay + 1) :: pplev, fup
    236     integer, intent(in), dimension(ngrid) :: lmax
     232    INTEGER, INTENT(IN) :: ngrid, nlay
     233    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: po, pt, pu, pv, pplay, eup, dup
     234    REAL, INTENT(IN), DIMENSION(ngrid, nlay) :: theta
     235    REAL, INTENT(IN), DIMENSION(ngrid, nlay + 1) :: pplev, fup
     236    INTEGER, INTENT(IN), DIMENSION(ngrid) :: lmax
    237237
    238238
     
    240240    ! Local
    241241
    242     real, dimension(ngrid, nlay) :: edn, ddn, thetad
    243     real, dimension(ngrid, nlay + 1) :: fdn
    244 
    245     integer ig, ilay
    246     real dqsat_dT
    247     logical mask(ngrid, nlay)
     242    REAL, DIMENSION(ngrid, nlay) :: edn, ddn, thetad
     243    REAL, DIMENSION(ngrid, nlay + 1) :: fdn
     244
     245    INTEGER ig, ilay
     246    REAL dqsat_dT
     247    LOGICAL mask(ngrid, nlay)
    248248
    249249    edn(:, :) = 0.
     
    271271    do ilay = nlay, 1, -1
    272272      do ig = 1, ngrid
    273         if (ilay<=lmax(ig).and.lmax(ig)>1) THEN
     273        IF (ilay<=lmax(ig).AND.lmax(ig)>1) THEN
    274274          edn(ig, ilay) = fact_thermals_down * dup(ig, ilay)
    275275          ddn(ig, ilay) = fact_thermals_down * eup(ig, ilay)
Note: See TracChangeset for help on using the changeset viewer.