GCC Code Coverage Report


Directory: ./
File: phys/calcratqs_inter.f90
Date: 2022-01-11 19:19:34
Exec Total Coverage
Lines: 0 20 0.0%
Branches: 0 16 0.0%

Line Branch Exec Source
1 SUBROUTINE calcratqs_inter(klon,klev,pdtphys, &
2 ratqsbas, wake_deltaq, wake_s, q_seri, &
3 ratqs_inter)
4 USE ioipsl_getin_p_mod, ONLY : getin_p
5 implicit 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
16 LOGICAL, SAVE :: first = .TRUE.
17 !$OMP THREADPRIVATE(first)
18 ! Input
19 integer,intent(in) :: klon,klev
20 real,intent(in) :: pdtphys,ratqsbas
21 real, dimension(klon,klev),intent(in) :: wake_deltaq, q_seri
22 real, dimension(klon),intent(in) :: wake_s
23
24 ! Output
25 real, dimension(klon,klev),intent(inout) :: ratqs_inter
26
27 ! local
28 integer i,k
29 real, dimension(klon,klev) :: wake_dq
30 REAL, SAVE :: tau_ratqs_wake
31 !$OMP THREADPRIVATE(tau_ratqs_wake)
32 REAL, SAVE :: a_ratqs_wake
33 !$OMP THREADPRIVATE(a_ratqs_wake)
34 real, 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
68 return
69 end
70