SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
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 (DGMF, &
7  pt_wml,pt_bot,ph_ml,pct,pwater_depth)
8 ! ###############################################################################
9 !
10 !!**** *DIAG_MISC-FLAKE_n * - additional diagnostics for FLake
11 !!
12 !! PURPOSE
13 !! -------
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !! REFERENCE
19 !! ---------
20 !!
21 !!
22 !! AUTHOR
23 !! ------
24 !! P. Le Moigne
25 !!
26 !! MODIFICATIONS
27 !! -------------
28 !! Original 10/2005
29 !!------------------------------------------------------------------
30 !
31 !
32 !
33 !
35 !
36 USE modd_surf_par, ONLY : xundef
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 TYPE(diag_misc_flake_t), INTENT(INOUT) :: dgmf
48 !
49  REAL, DIMENSION(:), INTENT(IN) :: pt_wml ! Mixed-layer temperature [K]
50  REAL, DIMENSION(:), INTENT(IN) :: pt_bot ! Temperature at the water-bottom sediment
51  REAL, DIMENSION(:), INTENT(IN) :: ph_ml ! Thickness of the mixed-layer [m]
52  REAL, DIMENSION(:), INTENT(IN) :: pct ! Shape factor (thermocline)
53  REAL, DIMENSION(:), INTENT(IN) :: pwater_depth ! Lake depth
54 !
55 !* 0.2 declarations of local variables
56 !
57  REAL, DIMENSION(SIZE(DGMF%XZW_PROFILE),SIZE(PT_WML)) :: zcsi ! Vertical normalized coordinate
58  REAL, DIMENSION(SIZE(DGMF%XZW_PROFILE),SIZE(PT_WML)) :: zshape ! Shape function
59 !
60  INTEGER :: izw
61  REAL(KIND=JPRB) :: zhook_handle
62 !
63 !-------------------------------------------------------------------------------------
64 !
65 IF (lhook) CALL dr_hook('DIAG_MISC_FLAKE_N',0,zhook_handle)
66 !
67 !* Flake temperature profile
68 !
69 dgmf%XTW_PROFILE(:,:) = xundef
70 !
71 IF (dgmf%LWATER_PROFILE) THEN
72 !
73  DO izw=1,SIZE(dgmf%XZW_PROFILE)
74  WHERE (pwater_depth(:)==ph_ml(:))
75  zcsi(izw,:) = 0.
76  ELSEWHERE
77  zcsi(izw,:) = (dgmf%XZW_PROFILE(izw) - ph_ml(:))/(pwater_depth(:) - ph_ml(:))
78  END WHERE
79  zshape(izw,:) = (40./3.*pct-20./3.)*zcsi(izw,:)+(18.-30.*pct)*zcsi(izw,:)**2 &
80  + (20.*pct-12.)*zcsi(izw,:)**3+(5./3.-10./3.*pct)*zcsi(izw,:)**4
81  END DO
82 !
83  DO izw=1,SIZE(dgmf%XZW_PROFILE)
84  WHERE (ph_ml(:) >= dgmf%XZW_PROFILE(izw))
85  dgmf%XTW_PROFILE(izw,:) = pt_wml(:)
86  ELSEWHERE (pwater_depth(:) >= dgmf%XZW_PROFILE(izw))
87  dgmf%XTW_PROFILE(izw,:) = pt_wml(:) - (pt_wml(:) - pt_bot(:)) * zshape(izw,:)
88  END WHERE
89  END DO
90 !
91 END IF
92 !
93 IF (lhook) CALL dr_hook('DIAG_MISC_FLAKE_N',1,zhook_handle)
94 !
95 !-------------------------------------------------------------------------------------
96 !
97 END SUBROUTINE diag_misc_flake_n
subroutine diag_misc_flake_n(DGMF, PT_WML, PT_BOT, PH_ML, PCT, PWATER_DEPTH)