SURFEX v8.1
General documentation of Surfex
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.
6 !
7 INTERFACE permafrost_depth
8 !
9 SUBROUTINE permafrost_depth_1d (KNI,KPATCH,PPERM,PSOILDEPTH)
10 !
11 IMPLICIT NONE
12 !
13 INTEGER, INTENT(IN ) :: KNI ! number of point
14 !
15 INTEGER, INTENT(IN ) :: KPATCH ! patch number
16 !
17 REAL, DIMENSION(:), INTENT(IN ) :: PPERM ! permafrost area (fraction)
18 !
19 REAL, DIMENSION(:),INTENT(INOUT) :: PSOILDEPTH ! output soil depth distribution (m)
20 !
21 END SUBROUTINE permafrost_depth_1d
22 !
23 SUBROUTINE permafrost_depth_2d (KNI,KPATCH,PPERM,PSOILDEPTH)
24 !
25 IMPLICIT NONE
26 !
27 INTEGER, INTENT(IN ) :: KNI ! number of point
28 !
29 INTEGER, INTENT(IN ) :: KPATCH ! patch number
30 !
31 REAL, DIMENSION(:), INTENT(IN ) :: PPERM ! permafrost area (fraction)
32 !
33 REAL, DIMENSION(:,:),INTENT(INOUT) :: PSOILDEPTH ! output soil depth distribution (m)
34 !
35 END SUBROUTINE permafrost_depth_2d
36 !
37 END INTERFACE permafrost_depth
38 !
39 END MODULE modi_permafrost_depth
40 !
41 ! #########################
42 SUBROUTINE permafrost_depth_1d (KNI,KPATCH,PPERM,PSOILDEPTH)
43 ! ###################################################
44 !
45 !!**** *PERMAFROST_DEPTH*
46 !!
47 !! PURPOSE
48 !! -------
49 !
50 ! Extended ground depth to 12m over permafrost area
51 !
52 !!** METHOD
53 !! ------
54 !
55 ! Direct calculation
56 !
57 !! EXTERNAL
58 !! --------
59 !
60 ! None
61 !!
62 !! IMPLICIT ARGUMENTS
63 !! ------------------
64 !!
65 !!
66 !! REFERENCE
67 !! ---------
68 !!
69 !! AUTHOR
70 !! ------
71 !! B. Decharme
72 !!
73 !! MODIFICATIONS
74 !! -------------
75 !! Original 30/08/12
76 !-------------------------------------------------------------------------------
77 !
78 USE modd_surf_par, ONLY : xundef
79 USE modd_isba_par, ONLY : xpermfrac, xpermdepth
80 !
81 USE yomhook ,ONLY : lhook, dr_hook
82 USE parkind1 ,ONLY : jprb
83 !
84 !* 0.1 declarations of arguments
85 !
86 IMPLICIT NONE
87 !
88 INTEGER, INTENT(IN ) :: KNI ! number of point
89 !
90 INTEGER, INTENT(IN ) :: KPATCH ! patch number
91 !
92 REAL, DIMENSION(:), INTENT(IN ) :: PPERM ! permafrost area (fraction)
93 !
94 REAL, DIMENSION(:),INTENT(INOUT) :: PSOILDEPTH ! output soil depth distribution (m)
95 !
96 !* 0.2 declarations of local variables
97 !
98 REAL, DIMENSION(KNI) :: ZPERM
99 !
100 INTEGER :: JJ, JPATCH
101 !
102 REAL(KIND=JPRB) :: ZHOOK_HANDLE
103 !
104 !-------------------------------------------------------------------------------
105 !
106 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH_1D',0,zhook_handle)
107 !
108 zperm(:)=0.0
109 WHERE(pperm(:)/=xundef)zperm(:)=pperm(:)
110 !
111 DO jj=1,kni
112  IF(zperm(jj)>=xpermfrac.AND.psoildepth(jj)/=xundef)THEN
113  psoildepth(jj)=max(psoildepth(jj),xpermdepth)
114  ENDIF
115 ENDDO
116 
117 !
118 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH_1D',1,zhook_handle)
119 !
120 END SUBROUTINE permafrost_depth_1d
121 !
122 ! #########################
123 SUBROUTINE permafrost_depth_2d (KNI,KPATCH,PPERM,PSOILDEPTH)
124 ! ###################################################
125 !
126 !!**** *PERMAFROST_DEPTH*
127 !!
128 !! PURPOSE
129 !! -------
130 !
131 ! Extended ground depth to 12m over permafrost area
132 !
133 !!** METHOD
134 !! ------
135 !
136 ! Direct calculation
137 !
138 !! EXTERNAL
139 !! --------
140 !
141 ! None
142 !!
143 !! IMPLICIT ARGUMENTS
144 !! ------------------
145 !!
146 !!
147 !! REFERENCE
148 !! ---------
149 !!
150 !! AUTHOR
151 !! ------
152 !! B. Decharme
153 !!
154 !! MODIFICATIONS
155 !! -------------
156 !! Original 30/08/12
157 !-------------------------------------------------------------------------------
158 !
159 USE modd_surf_par, ONLY : xundef
160 USE modd_isba_par, ONLY : xpermfrac, xpermdepth
161 !
162 USE yomhook ,ONLY : lhook, dr_hook
163 USE parkind1 ,ONLY : jprb
164 !
165 !* 0.1 declarations of arguments
166 !
167 IMPLICIT NONE
168 !
169 INTEGER, INTENT(IN ) :: KNI ! number of point
170 !
171 INTEGER, INTENT(IN ) :: KPATCH ! patch number
172 !
173 REAL, DIMENSION(:), INTENT(IN ) :: PPERM ! permafrost area (fraction)
174 !
175 REAL, DIMENSION(:,:),INTENT(INOUT) :: PSOILDEPTH ! output soil depth distribution (m)
176 !
177 !* 0.2 declarations of local variables
178 !
179 REAL, DIMENSION(KNI) :: ZPERM
180 !
181 INTEGER :: JJ, JPATCH
182 !
183 REAL(KIND=JPRB) :: ZHOOK_HANDLE
184 !
185 !-------------------------------------------------------------------------------
186 !
187 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH_2D',0,zhook_handle)
188 !
189 zperm(:)=0.0
190 WHERE(pperm(:)/=xundef)zperm(:)=pperm(:)
191 !
192 DO jpatch=1,kpatch
193  DO jj=1,kni
194  IF(zperm(jj)>=xpermfrac.AND.psoildepth(jj,jpatch)/=xundef)THEN
195  psoildepth(jj,jpatch)=max(psoildepth(jj,jpatch),xpermdepth)
196  ENDIF
197  ENDDO
198 ENDDO
199 
200 !
201 IF (lhook) CALL dr_hook('PERMAFROST_DEPTH_2D',1,zhook_handle)
202 !
203 END SUBROUTINE permafrost_depth_2d
204 
205 
206 
207 
208 
subroutine permafrost_depth_2d(KNI, KPATCH, PPERM, PSOILDEPTH)
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine permafrost_depth_1d(KNI, KPATCH, PPERM, PSOILDEPTH)