source: LMDZ6/branches/contrails/libf/phylmd/freinage.f90 @ 5440

Last change on this file since 5440 was 5309, checked in by abarral, 7 weeks ago

Turn YOEGWD.h sisvat_weq into module

  • 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: 3.8 KB
Line 
1!
2! $Id$
3!
4  SUBROUTINE freinage(knon, uu, vv,  &
5       tt,veget,lai, height,ypaprs,ypplay,drag_pro,d_u,d_v)
6
7    !ONLINE:
8USE yoegwd_mod_h
9    USE dimpft_mod_h
10    USE compbl_mod_h
11        USE clesphys_mod_h
12    use dimphy, only: klon, klev
13!    USE control, ONLY: nvm
14!    USE indice_sol_mod, only : nvm_orch
15
16    USE yomcst_mod_h
17IMPLICIT NONE
18
19
20
21!FC
22
23    ! 0. DECLARATIONS:
24
25    ! 0.1 INPUTS
26
27    REAL, DIMENSION(klon,klev), INTENT(IN)         :: ypplay
28    REAL, DIMENSION(klon,klev+1), INTENT(IN)       :: ypaprs
29
30
31     REAL, DIMENSION(klon, klev), INTENT(IN)     :: uu
32     REAL, DIMENSION(klon, klev), INTENT(IN)     :: vv
33     REAL, DIMENSION(klon, klev), INTENT(IN)     :: tt
34     REAL, DIMENSION(klon,nvm_lmdz), INTENT(IN)          :: veget,lai
35     REAL, DIMENSION(klon,nvm_lmdz), INTENT(IN)          :: height
36
37     REAL, DIMENSION(klon,klev)         :: wind
38     REAL, DIMENSION(klon, klev)        :: yzlay
39     INTEGER knon
40
41    ! 0.2 OUTPUTS
42
43      REAL, DIMENSION(klon, klev),  INTENT(OUT)       :: d_v        ! change in v
44      REAL, DIMENSION(klon, klev),  INTENT(OUT)       :: d_u        ! change in v
45    !knon nombre de points concernes
46      REAL, DIMENSION(klon,klev)         :: sumveg        ! change in v
47   
48     REAL,  DIMENSION(klon,klev), INTENT(OUT)          :: drag_pro
49    ! (KLON, KLEV) tendencies on winds
50
51
52    INTEGER k,jv,i
53
54
55!FCCCC    REAL Cd_frein
56
57    ! 0.3.1 LOCAL VARIABLE
58
59
60    !-----------------------------------------------------------------
61
62    ! 1. INITIALISATIONS
63
64   
65!    Cd_frein = 7.5E-2 ! (0.075) ! Drag from MASSON 2009
66!FC ESSAI
67!    Cd_frein = 1.5E-2 ! (0.075) ! Drag from MASSON 2009
68!    Cd_frein = 0.005 ! (0.075) ! Drag from MASSON 2009
69
70! initialisation
71      d_u(:,:) =0.
72      d_v(:,:) =0.
73      drag_pro(:,:) =0.
74      sumveg(:,:) =0.
75!!        print*, "Cd_frein" , Cd_frein
76     
77       wind(:,:)= sqrt(uu(:,:)*uu(:,:)+vv(:,:)*vv(:,:))
78
79       yzlay(1:knon,1)= &
80            RD*tt(1:knon,1)/(0.5*(ypaprs(1:knon,1)+ypplay(1:knon,1))) &
81            *(ypaprs(1:knon,1)-ypplay(1:knon,1))/RG
82       DO k=2,klev
83             yzlay(1:knon,k)= &
84                  yzlay(1:knon,k-1)+RD*0.5*(tt(1:knon,k-1)+tt(1:knon,k)) &
85                  /ypaprs(1:knon,k)*(ypplay(1:knon,k-1)-ypplay(1:knon,k))/RG
86       END DO
87
88!    verifier les indexes .....
89!!       print*, " calcul de drag_pro FC "
90   
91      do k= 1,klev
92
93      do jv=2,nvm_lmdz   !   (on peut faire 9 ?)
94
95      do i=1,knon
96
97      sumveg(i,k)= sumveg(i,k)+ veget(i,jv)
98
99!      if  ( (height(i,jv) .gt. yzlay(i,k)) .AND. (height(i,jv) .gt. 0.1) .and. LAI(i,jv).gt.0. ) then                     
100      if  ( (height(i,jv) .gt. yzlay(i,k)) .AND. (height(i,jv) .gt. 0.1) ) then                     
101!FC attention veut on le test sur le LAI ?
102         if (ifl_pbltree.eq.1) then
103      drag_pro(i,k)= drag_pro(i,k)+ &
104      veget(i,jv)
105          elseif (ifl_pbltree.eq.2) then
106      drag_pro(i,k)= drag_pro(i,k)+ &
107      6*LAI(i,jv)*veget(i,jv)*( yzlay(i,k)*(height(i,jv)-yzlay(i,k))/(height(i,jv)*height(i,jv)+ 0.01))
108          elseif (ifl_pbltree.eq.3) then
109      drag_pro(i,k)= drag_pro(i,k)+ &
110      veget(i,jv)*( yzlay(i,k)*(height(i,jv)-yzlay(i,k))/(height(i,jv)*height(i,jv)+ 0.01))
111          elseif (ifl_pbltree.eq.0) then
112          drag_pro(i,k)=0.0
113           endif
114      else
115      drag_pro(i,k)= drag_pro(i,k)
116      endif
117
118
119      enddo
120      enddo
121     enddo
122      do k=1,klev
123        where (sumveg(1:knon,k) > 0.05 )
124!        drag_pro(1:knon,k)=Cd_frein*drag_pro(1:knon,k)/sumveg(1:knon,k)
125        drag_pro(1:knon,k)=Cd_frein*drag_pro(1:knon,k)
126        elsewhere
127        drag_pro(1:knon,k)=0.0
128       endwhere
129        d_u(1:knon,k) =(-1)*drag_pro(1:knon,k)*uu(1:knon,k)*wind(1:knon,k)
130        d_v(1:knon,k) =(-1)*drag_pro(1:knon,k)*vv(1:knon,k)*wind(1:knon,k)
131      enddo
132      return
133
134 END SUBROUTINE freinage
135
Note: See TracBrowser for help on using the repository browser.