SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
permafrost_depth.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 permafrost_depth (KNI,KPATCH,PPERM,PSOILDEPTH)
7 ! ###################################################
8 !
9 !!**** *PERMAFROST_DEPTH*
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 ! Extended ground depth to 12m over permafrost area
15 !
16 !!** METHOD
17 !! ------
18 !
19 ! Direct calculation
20 !
21 !! EXTERNAL
22 !! --------
23 !
24 ! None
25 !!
26 !! IMPLICIT ARGUMENTS
27 !! ------------------
28 !!
29 !!
30 !! REFERENCE
31 !! ---------
32 !!
33 !! AUTHOR
34 !! ------
35 !! B. Decharme
36 !!
37 !! MODIFICATIONS
38 !! -------------
39 !! Original 30/08/12
40 !-------------------------------------------------------------------------------
41 !
42 USE modd_surf_par, ONLY : xundef
43 USE modd_isba_par, ONLY : xpermfrac, xpermdepth
44 !
45 USE yomhook ,ONLY : lhook, dr_hook
46 USE parkind1 ,ONLY : jprb
47 !
48 !* 0.1 declarations of arguments
49 !
50 IMPLICIT NONE
51 !
52 INTEGER, INTENT(IN ) :: kni ! number of point
53 !
54 INTEGER, INTENT(IN ) :: kpatch ! patch number
55 !
56 REAL, DIMENSION(:), INTENT(IN ) :: pperm ! permafrost area (fraction)
57 !
58 REAL, DIMENSION(:,:),INTENT(INOUT) :: psoildepth ! output soil depth distribution (m)
59 !
60 !* 0.2 declarations of local variables
61 !
62 REAL, DIMENSION(KNI) :: zperm
63 !
64 INTEGER :: jj, jpatch
65 !
66 REAL(KIND=JPRB) :: zhook_handle
67 !
68 !-------------------------------------------------------------------------------
69 !
70 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH',0,zhook_handle)
71 !
72 zperm(:)=0.0
73 WHERE(pperm(:)/=xundef)zperm(:)=pperm(:)
74 !
75 DO jpatch=1,kpatch
76  DO jj=1,kni
77  IF(zperm(jj)>=xpermfrac.AND.psoildepth(jj,jpatch)/=xundef)THEN
78  psoildepth(jj,jpatch)=max(psoildepth(jj,jpatch),xpermdepth)
79  ENDIF
80  ENDDO
81 ENDDO
82 
83 !
84 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH',1,zhook_handle)
85 !
86 END SUBROUTINE permafrost_depth
87 
88 
89 
90 
91 
subroutine permafrost_depth(KNI, KPATCH, PPERM, PSOILDEPTH)