source: LMDZ6/trunk/libf/phylmd/calcratqs_inter.F90 @ 3858

Last change on this file since 3858 was 3858, checked in by fhourdin, 3 years ago

Missing routine in rev 3856
Fredho

File size: 2.2 KB
Line 
1SUBROUTINE calcratqs_inter(klon,klev,pdtphys, &
2           ratqsbas, wake_deltaq, wake_s, q_seri,     &
3           ratqs_inter)
4USE ioipsl_getin_p_mod, ONLY : getin_p
5implicit none
6
7!========================================================================
8! Subroutine écrite par L. d'Alençon le 25/02/2021
9! Cette subroutine calcule une valeur de ratqsbas interactive dépendant de la présence de poches froides dans l'environnement.
10! Elle est appelée par la subroutine calcratqs lorsque iflag_ratqs = 10.
11!========================================================================
12
13! Declarations
14
15
16LOGICAL, SAVE :: first = .TRUE.
17!$OMP THREADPRIVATE(first)
18! Input
19integer,intent(in) :: klon,klev
20real,intent(in) :: pdtphys,ratqsbas
21real, dimension(klon,klev),intent(in) :: wake_deltaq, q_seri
22real, dimension(klon),intent(in) :: wake_s
23
24! Output
25real, dimension(klon,klev),intent(inout) :: ratqs_inter
26
27! local
28integer i,k
29real, dimension(klon,klev) :: wake_dq
30REAL, SAVE             :: tau_ratqs_wake
31!$OMP THREADPRIVATE(tau_ratqs_wake)
32REAL, SAVE             :: a_ratqs_wake
33!$OMP THREADPRIVATE(a_ratqs_wake)
34real, dimension(klon) :: max_wake_dq, max_dqconv
35!-------------------------------------------------------------------------
36!  Caclul de ratqs_inter
37!-------------------------------------------------------------------------
38
39
40      if (first) then
41         tau_ratqs_wake = 3600. ! temps de relaxation de la variabilité
42         a_ratqs_wake = 1.85    ! paramètre pilotant l'importance du terme dépendant des poches froides
43         CALL getin_p('tau_ratqs_wake', tau_ratqs_wake)
44         CALL getin_p('a_ratqs_wake', a_ratqs_wake)         
45         first=.false.
46      endif       
47      max_wake_dq(:) = 0.
48      max_dqconv (:) = 0
49     
50      do k=1,klev
51        do i=1,klon
52         max_wake_dq(i) = max(abs(wake_deltaq(i,k)),max_wake_dq(i))
53        enddo
54      enddo
55     
56      do k=1,klev
57        do i=1,klon
58         ratqs_inter(i,k)= ratqs_inter(i,k)*exp(-pdtphys/tau_ratqs_wake) +   &
59         a_ratqs_wake*(max_wake_dq(i)*(wake_s(i)**0.5/(1.-wake_s(i))))*(1.-exp(-pdtphys/tau_ratqs_wake))/q_seri(i,1)   
60         if (ratqs_inter(i,k)<ratqsbas) then
61            ratqs_inter(i,k) = ratqsbas
62         endif       
63        enddo
64      enddo
65
66
67
68return
69end
Note: See TracBrowser for help on using the repository browser.