SURFEX v8.1
General documentation of Surfex
minzs_vert_shift.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #########
6  SUBROUTINE minzs_vert_shift(D, PZS_MOY, PZS_MIN, PPS_MIN, PRHOA_2M_MIN )
7 ! #########################################
8 !
9 !
10 !!**** *MINZS_VERT_SHIFT* - routine to shift 2m variables to 2m variables
11 !! above the minimum orography of the grid mesh
12 !!
13 !!
14 !! PURPOSE
15 !! -------
16 !
17 !!** METHOD
18 !! ------
19 !!
20 !! Same method like in forcing_vert_shift.F90
21 !!
22 !! EXTERNAL
23 !! --------
24 !!
25 !! NONE
26 !!
27 !! IMPLICIT ARGUMENTS
28 !! ------------------
29 !!
30 !! REFERENCE
31 !! ---------
32 !!
33 !! AUTHOR
34 !! ------
35 !! B. Decharme
36 !!
37 !! MODIFICATIONS
38 !! -------------
39 !! Original 06/2013
40 !! ---------------------------------------------------------------------
41 !
42 !* 0. DECLARATIONS
43 !
44 USE modd_diag_n, ONLY : diag_t
45 !
46 USE modd_csts, ONLY : xrd, xg, xrv
47 USE modd_atm_cst, ONLY : xclim_t_grad
48 !
49 USE mode_thermos
50 !
51 !
52 USE yomhook ,ONLY : lhook, dr_hook
53 USE parkind1 ,ONLY : jprb
54 !
55 IMPLICIT NONE
56 !
57 !
58 !* 0.1 declarations of arguments
59 !
60 TYPE(diag_t), INTENT(INOUT) :: D
61 !
62 REAL, DIMENSION(:), INTENT(IN) :: PZS_MOY ! mean orography of atmospheric grid
63 REAL, DIMENSION(:), INTENT(IN) :: PZS_MIN ! min orography of atmospheric grid
64 !
65 REAL, DIMENSION(:), INTENT(OUT) :: PPS_MIN ! pressure at surface altitude
66 REAL, DIMENSION(:), INTENT(OUT) :: PRHOA_2M_MIN ! density at surface altitude
67 !
68 !* 0.2 declarations of local variables
69 !
70 REAL, DIMENSION(SIZE(D%XQ2M )) :: ZQA_2M ! air humidity (kg/kg)
71 REAL, DIMENSION(SIZE(D%XQ2M )) :: ZQA_2M_MIN ! air humidity (kg/kg)
72 REAL, DIMENSION(SIZE(D%XRHOA)) :: ZRHOA_2M ! approximated density
73 REAL, DIMENSION(SIZE(D%XRHOA)) :: ZRHOA_2M_MIN ! approximated density
74 !
75 REAL(KIND=JPRB) :: ZHOOK_HANDLE
76 !
77 ! ---------------------------------------------------------------------------
78 !
79 IF (lhook) CALL dr_hook('MINZS_VERT_SHIFT',0,zhook_handle)
80 !
81 zqa_2m = d%XQ2M / d%XRHOA
82 !
83 !* 1. climatological gradient for temperature
84 ! ---------------------------------------
85 !
86 d%XT2M_MIN_ZS = d%XT2M + xclim_t_grad * (pzs_min - pzs_moy)
87 !
88 !-------------------------------------------------------------------------------
89 !
90 !* 2. hydrostatism for pressure
91 ! -------------------------
92 !
93 pps_min = d%XPS * exp( - xg/xrd/(0.5*(d%XT2M+d%XT2M_MIN_ZS)*( 1.+((xrv/xrd)-1.)*zqa_2m(:) )) &
94  * (pzs_min-pzs_moy) )
95 !
96 !-------------------------------------------------------------------------------
97 !
98 !* 3. conservation of relative humidity for humidity
99 ! ----------------------------------------------
100 !
101 zqa_2m_min = zqa_2m / qsat(d%XT2M, d%XPS) * qsat(d%XT2M_MIN_ZS,pps_min)
102 !
103 !-------------------------------------------------------------------------------
104 !
105 !* 4. estimation of air density from temperature and humidity
106 ! -------------------------------------------------------
107 !
108 zrhoa_2m(:) = d%XPS (:) / xrd / d%XT2M (:) / ( 1.+((xrv/xrd)-1.)*zqa_2m(:) )
109 zrhoa_2m_min(:) = pps_min(:) / xrd / d%XT2M_MIN_ZS(:) / ( 1.+((xrv/xrd)-1.)*zqa_2m_min(:) )
110 !
111 prhoa_2m_min(:) = d%XRHOA(:) * zrhoa_2m_min(:) / zrhoa_2m(:)
112 !
113 !-------------------------------------------------------------------------------
114 !
115 !* 5. new humidity in kg/m3
116 ! ---------------------
117 !
118 d%XQ2M_MIN_ZS = zqa_2m_min * prhoa_2m_min
119 !
120 IF (lhook) CALL dr_hook('MINZS_VERT_SHIFT',1,zhook_handle)
121 !
122 !-------------------------------------------------------------------------------
123 !
124 END SUBROUTINE minzs_vert_shift
subroutine minzs_vert_shift(D, PZS_MOY, PZS_MIN, PPS_MIN, PRHOA_2M_MIN)
real, save xrd
Definition: modd_csts.F90:62
real, save xg
Definition: modd_csts.F90:55
integer, parameter jprb
Definition: parkind1.F90:32
real, save xrv
Definition: modd_csts.F90:62
logical lhook
Definition: yomhook.F90:15