PHYEX 0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
mode_compute_function_thermo_new_stat.F90
Go to the documentation of this file.
1!MNH_LIC Copyright 1994-2021 CNRS, Meteo-France and Universite Paul Sabatier
2!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4!MNH_LIC for details. version 1.
5!-----------------------------------------------------------------
7
8!$ACDC singlecolumn --dummy
9
10IMPLICIT NONE
11CONTAINS
12SUBROUTINE compute_function_thermo_new_stat (D, CST, PALP, PBETA, PGAM, PLTT, PC, PT, PEXN, PCP, &
13 & PLOCPEXN, PAMOIST, PATHETA, PPABST)
14 ! ########################################################################
15 !!
16 !!**** *COMPUTE_FUNCTION_THERMO* routine to compute several thermo functions
17 !
18 !! AUTHOR
19 !! ------
20 !!
21 !! JP Pinty *LA*
22 !!
23 !! MODIFICATIONS
24 !! -------------
25 !! Original 24/02/03
26 !! Modified: Wim de Rooy 06-02-2019
27 !!
28 !-------------------------------------------------------------------------------
29 !
30 !* 0. DECLARATIONS
31 ! ------------
32 !
33 USE yomhook, ONLY: lhook, dr_hook, jphook
34 USE modd_cst, ONLY: cst_t
35 USE modd_dimphyex, ONLY: dimphyex_t
36
37 IMPLICIT NONE
38 !
39 !* 0.1 Declarations of dummy arguments
40 !
41 TYPE(dimphyex_t), INTENT(IN) :: D ! PHYEX variables dimensions structure
42 REAL, INTENT(IN) :: PALP, PBETA, PGAM, PLTT, PC
43 REAL, INTENT(IN), DIMENSION(D%NIJT, D%NKT) :: PT, PEXN, PCP
44 !
45 REAL, INTENT(OUT), DIMENSION(D%NIJT, D%NKT) :: PLOCPEXN
46 REAL, INTENT(OUT), DIMENSION(D%NIJT, D%NKT) :: PAMOIST, PATHETA
47 TYPE(cst_t), INTENT(IN) :: CST
48 REAL, INTENT(IN) :: PPABST(D%NIJT, D%NKT)
49
50 REAL :: ZDRVSATDT(D%NIJT, D%NKT)
51 REAL :: ZRVSAT(D%NIJT, D%NKT)
52 REAL :: ZEPS
53 REAL(KIND=jphook) :: zhook_handle2
54 INTEGER :: JK, JIJ, IIJB, IIJE, IKT
55 !
56 !-------------------------------------------------------------------------------
57 !
58 IF (lhook) CALL dr_hook('TURB:COMPUTE_FUNCTION_THERMO_NEW_STAT', 0, zhook_handle2)
59
60 ikt = d%NKT
61 iije = d%NIJE
62 iijb = d%NIJB
63 zeps = cst%XMV / cst%XMD
64 !
65 !* 1.1 Lv/Cph at t
66 !
67!$acc kernels
68!$mnh_expand_array( JIJ=IIJB:IIJE,JK=1:IKT )
69 plocpexn(iijb:iije, 1:ikt) = (pltt + (cst%XCPV - pc)*(pt(iijb:iije, 1:ikt) - cst%XTT)) / pcp(iijb:iije, 1:ikt)
70 !
71 !* 1.2 Saturation vapor pressure at t
72 !
73 zrvsat(iijb:iije, 1:ikt) = exp(palp - pbeta / pt(iijb:iije, 1:ikt) - pgam*log(pt(iijb:iije, 1:ikt)))
74 !
75 !* 1.3 saturation mixing ratio at t
76 !
77 zrvsat(iijb:iije, 1:ikt) = zrvsat(iijb:iije, 1:ikt)*zeps / (ppabst(iijb:iije, 1:ikt) - zrvsat(iijb:iije, 1:ikt))
78 !
79 !* 1.4 compute the saturation mixing ratio derivative (rvs')
80 !
81 zdrvsatdt(iijb:iije, 1:ikt) = (pbeta / pt(iijb:iije, 1:ikt) - pgam) / pt(iijb:iije, 1:ikt)*zrvsat(iijb:iije, 1:ikt)*(1. + &
82 & zrvsat(iijb:iije, 1:ikt) / zeps)
83 !
84 !* 1.5 compute Amoist
85 !
86 pamoist(iijb:iije, 1:ikt) = 1.0 / (1.0 + zdrvsatdt(iijb:iije, 1:ikt)*plocpexn(iijb:iije, 1:ikt))
87 !
88 !* 1.6 compute Atheta
89 !
90 patheta(iijb:iije, 1:ikt) = pamoist(iijb:iije, 1:ikt)*pexn(iijb:iije, 1:ikt)*zdrvsatdt(iijb:iije, 1:ikt)
91 !
92 !* 1.7 Lv/Cph/Exner at t-1
93 !
94 plocpexn(iijb:iije, 1:ikt) = plocpexn(iijb:iije, 1:ikt) / pexn(iijb:iije, 1:ikt)
95!$mnh_end_expand_array ( JIJ=IIJB:IIJE,JK=1:IKT )
96!$acc end kernels
97 !
98 IF (lhook) CALL dr_hook('TURB:COMPUTE_FUNCTION_THERMO_NEW_STAT', 1, zhook_handle2)
subroutine compute_function_thermo_new_stat(d, cst, palp, pbeta, pgam, pltt, pc, pt, pexn, pcp, plocpexn, pamoist, patheta, ppabst)