SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_ver_watflux.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 prep_ver_watflux (W)
7 ! #################################################################################
8 !
9 !!**** *PREP_VER_WATFLUX* - change in WATFLUX var. due to altitude change
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! S. Malardel
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 01/2004
28 !!------------------------------------------------------------------
29 !
30 
31 !
32 !
33 USE modd_watflux_n, ONLY : watflux_t
34 !
35 USE modd_prep, ONLY : xzs_ls, xt_clim_grad
36 USE modd_csts, ONLY : xtt
37 !
38 !
39 USE yomhook ,ONLY : lhook, dr_hook
40 USE parkind1 ,ONLY : jprb
41 !
42 IMPLICIT NONE
43 !
44 !* 0.1 declarations of arguments
45 !
46 !
47 !* 0.2 declarations of local variables
48 !
49 !
50 TYPE(watflux_t), INTENT(INOUT) :: w
51 !
52 REAL, DIMENSION(:), ALLOCATABLE :: zts_ls ! large-scale water temperature
53 REAL(KIND=JPRB) :: zhook_handle
54 !
55 !-------------------------------------------------------------------------------------
56 !
57 !* 1. Surface temperature of water
58 !
59 IF (lhook) CALL dr_hook('PREP_VER_WATFLUX',0,zhook_handle)
60 ALLOCATE(zts_ls(SIZE(w%XTS)))
61 zts_ls = w%XTS
62 !
63 w%XTS = zts_ls + xt_clim_grad * (w%XZS - xzs_ls)
64 !
65 !-------------------------------------------------------------------------------------
66 !
67 !* 2. Limit on freezing
68 !
69 !* if water was already frozen, it can be considered liquid only for
70 ! temperatures that are larger than 4 C
71 !
72 WHERE (zts_ls < xtt .AND. w%XTS < xtt + 4.) w%XTS = min(w%XTS,xtt)
73 !
74 !* if water was liquid, it can be considered frozen only for
75 ! very cold temperatures, colder than 20 C. It should obviously
76 ! depend on the size of the lake. This cold limit is taken for
77 ! large lakes, as US great lakes, that take a long time to freeze.
78 !
79 ! 4 C is used here for the water of lowest density.
80 !
81 WHERE (zts_ls > xtt .AND. w%XTS > xtt - 20.) w%XTS = max(w%XTS,xtt+4.)
82 !
83 !-------------------------------------------------------------------------------------
84 !
85 !* 3. Deallocation of large-scale orography
86 !
87 DEALLOCATE(zts_ls)
88 IF (lhook) CALL dr_hook('PREP_VER_WATFLUX',1,zhook_handle)
89 !
90 !-------------------------------------------------------------------------------------
91 !
92 END SUBROUTINE prep_ver_watflux
subroutine prep_ver_watflux(W)