source: LMDZ6/branches/Amaury_dev/libf/phylmd/freinage.F90 @ 5185

Last change on this file since 5185 was 5158, checked in by abarral, 5 months ago

Add missing klon on strataer_emiss_mod.F90
Correct various missing explicit declarations
Replace tabs by spaces (tabs are not part of the fortran charset)
Continue cleaning modules
Removed unused arguments and variables

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 4.0 KB
Line 
1! $Id$
2
3SUBROUTINE freinage(knon, uu, vv, &
4        tt, veget, lai, height, ypaprs, ypplay, drag_pro, d_u, d_v)
5
6  !ONLINE:
7  USE dimphy, ONLY: klon, klev
8  USE lmdz_clesphys
9  USE lmdz_compbl, ONLY: iflag_pbl, iflag_pbl_split, iflag_order2_sollw, ifl_pbltree
10  USE lmdz_dimpft, ONLY: nvm_lmdz
11  !    USE control, ONLY: nvm
12  !    USE indice_sol_mod, ONLY: nvm_orch
13  USE lmdz_YOEGWD, ONLY: GFRCRIT, GKWAKE, GRCRIT, GVCRIT, GKDRAG, GKLIFT, GHMAX, GRAHILO, GSIGCR, NKTOPG, NSTRA, GSSEC, GTSEC, GVSEC, &
14          GWD_RANDO_RUWMAX, gwd_rando_sat, GWD_FRONT_RUWMAX, gwd_front_sat
15  USE lmdz_yomcst
16
17  IMPLICIT NONE
18
19  ! 0. DECLARATIONS:
20
21  ! 0.1 INPUTS
22
23  REAL, DIMENSION(klon, klev), INTENT(IN) :: ypplay
24  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: ypaprs
25
26  REAL, DIMENSION(klon, klev), INTENT(IN) :: uu
27  REAL, DIMENSION(klon, klev), INTENT(IN) :: vv
28  REAL, DIMENSION(klon, klev), INTENT(IN) :: tt
29  REAL, DIMENSION(klon, nvm_lmdz), INTENT(IN) :: veget, lai
30  REAL, DIMENSION(klon, nvm_lmdz), INTENT(IN) :: height
31
32  REAL, DIMENSION(klon, klev) :: wind
33  REAL, DIMENSION(klon, klev) :: yzlay
34  INTEGER knon
35
36  ! 0.2 OUTPUTS
37
38  REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_v        ! change in v
39  REAL, DIMENSION(klon, klev), INTENT(OUT) :: d_u        ! change in v
40  !knon nombre de points concernes
41  REAL, DIMENSION(klon, klev) :: sumveg        ! change in v
42
43  REAL, DIMENSION(klon, klev), INTENT(OUT) :: drag_pro
44  ! (KLON, KLEV) tendencies on winds
45
46  INTEGER k, jv, i
47
48
49  !FCCCC    REAL Cd_frein
50
51  ! 0.3.1 LOCAL VARIABLE
52
53
54  !-----------------------------------------------------------------
55
56  ! 1. INITIALISATIONS
57
58
59  !    Cd_frein = 7.5E-2 ! (0.075) ! Drag from MASSON 2009
60  !FC ESSAI
61  !    Cd_frein = 1.5E-2 ! (0.075) ! Drag from MASSON 2009
62  !    Cd_frein = 0.005 ! (0.075) ! Drag from MASSON 2009
63
64  ! initialisation
65  d_u(:, :) = 0.
66  d_v(:, :) = 0.
67  drag_pro(:, :) = 0.
68  sumveg(:, :) = 0.
69  !!        PRINT*, "Cd_frein" , Cd_frein
70
71  wind(:, :) = sqrt(uu(:, :) * uu(:, :) + vv(:, :) * vv(:, :))
72
73  yzlay(1:knon, 1) = &
74          RD * tt(1:knon, 1) / (0.5 * (ypaprs(1:knon, 1) + ypplay(1:knon, 1))) &
75                  * (ypaprs(1:knon, 1) - ypplay(1:knon, 1)) / RG
76  DO k = 2, klev
77    yzlay(1:knon, k) = &
78            yzlay(1:knon, k - 1) + RD * 0.5 * (tt(1:knon, k - 1) + tt(1:knon, k)) &
79                    / ypaprs(1:knon, k) * (ypplay(1:knon, k - 1) - ypplay(1:knon, k)) / RG
80  END DO
81
82  !    verifier les indexes .....
83  !!       PRINT*, " calcul de drag_pro FC "
84
85  DO k = 1, klev
86
87    DO jv = 2, nvm_lmdz   !   (on peut faire 9 ?)
88
89      DO i = 1, knon
90
91        sumveg(i, k) = sumveg(i, k) + veget(i, jv)
92
93        !      if  ( (height(i,jv) .gt. yzlay(i,k)) .AND. (height(i,jv) .gt. 0.1) .AND. LAI(i,jv).gt.0. ) THEN
94        IF  ((height(i, jv) > yzlay(i, k)) .AND. (height(i, jv) > 0.1)) THEN
95          !FC attention veut on le test sur le LAI ?
96          IF (ifl_pbltree==1) THEN
97            drag_pro(i, k) = drag_pro(i, k) + &
98                    veget(i, jv)
99          elseif (ifl_pbltree==2) THEN
100            drag_pro(i, k) = drag_pro(i, k) + &
101                    6 * LAI(i, jv) * veget(i, jv) * (yzlay(i, k) * (height(i, jv) - yzlay(i, k)) / (height(i, jv) * height(i, jv) + 0.01))
102          elseif (ifl_pbltree==3) THEN
103            drag_pro(i, k) = drag_pro(i, k) + &
104                    veget(i, jv) * (yzlay(i, k) * (height(i, jv) - yzlay(i, k)) / (height(i, jv) * height(i, jv) + 0.01))
105          elseif (ifl_pbltree==0) THEN
106            drag_pro(i, k) = 0.0
107          endif
108        else
109          drag_pro(i, k) = drag_pro(i, k)
110        endif
111
112      enddo
113    enddo
114  enddo
115  DO k = 1, klev
116    where (sumveg(1:knon, k) > 0.05)
117      !        drag_pro(1:knon,k)=Cd_frein*drag_pro(1:knon,k)/sumveg(1:knon,k)
118      drag_pro(1:knon, k) = Cd_frein * drag_pro(1:knon, k)
119    elsewhere
120      drag_pro(1:knon, k) = 0.0
121    endwhere
122    d_u(1:knon, k) = (-1) * drag_pro(1:knon, k) * uu(1:knon, k) * wind(1:knon, k)
123    d_v(1:knon, k) = (-1) * drag_pro(1:knon, k) * vv(1:knon, k) * wind(1:knon, k)
124  enddo
125
126END SUBROUTINE freinage
127
Note: See TracBrowser for help on using the repository browser.