SURFEX v8.1
General documentation of Surfex
diag_misc_flaken.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 diag_misc_flake_n (DMF, F)
7 ! ###############################################################################
8 !
9 !!**** *DIAG_MISC-FLAKE_n * - additional diagnostics for FLake
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! P. Le Moigne
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 10/2005
28 !!------------------------------------------------------------------
29 !
30 !
31 USE modd_flake_n, ONLY : flake_t
33 !
34 USE modd_surf_par, ONLY : xundef
35 !
36 !
37 USE yomhook ,ONLY : lhook, dr_hook
38 USE parkind1 ,ONLY : jprb
39 !
40 IMPLICIT NONE
41 !
42 !* 0.1 declarations of arguments
43 !
44 !
45 TYPE(flake_t), INTENT(INOUT) :: F
46 TYPE(diag_misc_flake_t), INTENT(INOUT) :: DMF
47 !
48 !* 0.2 declarations of local variables
49 !
50 REAL, DIMENSION(SIZE(DMF%XZW_PROFILE),SIZE(F%XT_WML)) :: ZCSI ! Vertical normalized coordinate
51 REAL, DIMENSION(SIZE(DMF%XZW_PROFILE),SIZE(F%XT_WML)) :: ZSHAPE ! Shape function
52 !
53 INTEGER :: IZW
54 REAL(KIND=JPRB) :: ZHOOK_HANDLE
55 !
56 !-------------------------------------------------------------------------------------
57 !
58 IF (lhook) CALL dr_hook('DIAG_MISC_FLAKE_N',0,zhook_handle)
59 !
60 !* Flake temperature profile
61 !
62 dmf%XTW_PROFILE(:,:) = xundef
63 !
64 IF (dmf%LWATER_PROFILE) THEN
65 !
66  DO izw=1,SIZE(dmf%XZW_PROFILE)
67  WHERE (f%XWATER_DEPTH(:)==f%XH_ML(:))
68  zcsi(izw,:) = 0.
69  ELSEWHERE
70  zcsi(izw,:) = (dmf%XZW_PROFILE(izw) - f%XH_ML(:))/(f%XWATER_DEPTH(:) - f%XH_ML(:))
71  END WHERE
72  zshape(izw,:) = (40./3.*f%XCT-20./3.)*zcsi(izw,:) + (18.-30.*f%XCT)*zcsi(izw,:)**2 &
73  + (20.*f%XCT-12.) *zcsi(izw,:)**3+(5./3.-10./3.*f%XCT)*zcsi(izw,:)**4
74  END DO
75 !
76  DO izw=1,SIZE(dmf%XZW_PROFILE)
77  WHERE (f%XH_ML(:) >= dmf%XZW_PROFILE(izw))
78  dmf%XTW_PROFILE(izw,:) = f%XT_WML(:)
79  ELSEWHERE (f%XWATER_DEPTH(:) >= dmf%XZW_PROFILE(izw))
80  dmf%XTW_PROFILE(izw,:) = f%XT_WML(:) - (f%XT_WML(:) - f%XT_BOT(:)) * zshape(izw,:)
81  END WHERE
82  END DO
83 !
84 END IF
85 !
86 IF (lhook) CALL dr_hook('DIAG_MISC_FLAKE_N',1,zhook_handle)
87 !
88 !-------------------------------------------------------------------------------------
89 !
90 END SUBROUTINE diag_misc_flake_n
subroutine diag_misc_flake_n(DMF, F)
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15