SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_ver_flake.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_flake (F)
7 ! #################################################################################
8 !
9 !!**** *PREP_VER_FLAKE* - change in FLAKE 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 !! 09.2010, E. Kourzeneva: Make not possible to shift the lake profile
29 !! in vertical, just to shift the lake surface
30 !! temperature and then to set the default lake profile
31 !!------------------------------------------------------------------
32 !
33 
34 !
35 !
36 !
37 USE modd_flake_n, ONLY : flake_t
38 !
39 USE modd_prep, ONLY : xzs_ls, xt_clim_grad
40 !
41 USE yomhook ,ONLY : lhook, dr_hook
42 USE parkind1 ,ONLY : jprb
43 !
44 IMPLICIT NONE
45 !
46 !* 0.1 declarations of arguments
47 !
48 !* 0.2 declarations of local variables
49 !
50 !
51 TYPE(flake_t), INTENT(INOUT) :: f
52 !
53 REAL, DIMENSION(:), ALLOCATABLE :: zts_ls ! large-scale water temperature
54 REAL(KIND=JPRB) :: zhook_handle
55 !
56 !-------------------------------------------------------------------------------------
57 IF (lhook) CALL dr_hook('PREP_VER_FLAKE',0,zhook_handle)
58 
59 ! 1. Check if the shift is needed at all
60 IF((abs(maxval(f%XZS)) < 0.001).AND.(abs(minval(f%XZS))< 0.001)) &
61  CALL dr_hook('PREP_VER_FLAKE',1,zhook_handle)
62 IF((abs(maxval(f%XZS)) < 0.001).AND.(abs(minval(f%XZS))< 0.001)) RETURN
63 !
64 !* 2. Shift surface temperature of water
65 !
66 ALLOCATE(zts_ls(SIZE(f%XTS)))
67 !
68 zts_ls = f%XTS
69 !
70 f%XTS = zts_ls + xt_clim_grad * (f%XZS - xzs_ls)
71 !
72 DEALLOCATE(zts_ls)
73 !
74 IF (lhook) CALL dr_hook('PREP_VER_FLAKE',1,zhook_handle)
75 !-------------------------------------------------------------------------------------
76 !
77 END SUBROUTINE prep_ver_flake
subroutine prep_ver_flake(F)