SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
hydro_glacier.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 hydro_glacier (I, &
7  ptstep,psr,psnowrho,psnowswe,pglasto,piceflux)
8 ! ########################################################################
9 !
10 !!**** *HYDRO_GLACIER*
11 !!
12 !! PURPOSE
13 !! -------
14 !
15 ! Calculate the ice runoff fluxes over permanent snow area with LGLACIER
16 ! option
17 !
18 !!** METHOD
19 !! ------
20 !
21 ! Direct calculation
22 !
23 !! EXTERNAL
24 !! --------
25 !
26 ! None
27 !!
28 !! IMPLICIT ARGUMENTS
29 !! ------------------
30 !!
31 !!
32 !! REFERENCE
33 !! ---------
34 !!
35 !! AUTHOR
36 !! ------
37 !! B. Decharme
38 !!
39 !! MODIFICATIONS
40 !! -------------
41 !! Original 09/09
42 !-------------------------------------------------------------------------------
43 !
44 !* 0. DECLARATIONS
45 ! ------------
46 !
47 !
48 USE modd_isba_n, ONLY : isba_t
49 !
50 USE modd_csts, ONLY : xday
51 USE modd_snow_par, ONLY : xrhosmax, xhgla, xsnowdmin, xrhosmax_es
52 !
53 !
54 USE yomhook ,ONLY : lhook, dr_hook
55 USE parkind1 ,ONLY : jprb
56 !
57 IMPLICIT NONE
58 !
59 !* 0.1 declarations of arguments
60 !
61 !
62 TYPE(isba_t), INTENT(INOUT) :: i
63 !
64 REAL, INTENT(IN) :: ptstep
65 ! KTSTEP = timestep [s]
66 !
67 REAL, DIMENSION(:), INTENT(IN) :: psr
68 ! PSR = Snowfall [kg/m²s]
69 !
70 REAL, DIMENSION(:,:), INTENT(INOUT) :: psnowrho
71 ! PSNOWRHO = Snow density [kg/m3]
72 !
73 REAL, DIMENSION(:,:), INTENT(INOUT) :: psnowswe
74 ! PSNOWSWE = Snow water equivalent [kg/m²]
75 !
76 REAL, DIMENSION(:), INTENT(INOUT) :: pglasto
77 ! PGLASTO = Glacier storage [kg/m²]
78 !
79 REAL, DIMENSION(:), INTENT(OUT) :: piceflux
80 ! PICEFLUX = Ice flux from the Snowfall reservoir [kg/m²s]
81 !
82 !
83 !* 0.2 declarations of local variables
84 !
85 REAL, PARAMETER :: ztau=365.25 !days
86 !
87 REAL, DIMENSION(SIZE(PSR)) :: zglasto,zstomax,zflux,zsr,zswe
88 REAL, DIMENSION(SIZE(PSR)) :: zsnowd
89 !
90 REAL ::zrhosmax
91 !
92 INTEGER :: jwrk
93 REAL(KIND=JPRB) :: zhook_handle
94 !
95 !-------------------------------------------------------------------------------
96 !
97 !-------------------------------------------------------------------------------
98 !
99 IF (lhook) CALL dr_hook('HYDRO_GLACIER',0,zhook_handle)
100 !
101 zglasto(:) = pglasto(:)
102 zstomax(:) = 0.0
103 zflux(:) = 0.0
104 zsr(:) = 0.0
105 zswe(:) = 0.0
106 !
107 piceflux(:) = 0.0
108 !
109 !-------------------------------------------------------------------------------
110 !Ice accumulation only if snow amount is > to 33.3 meters of aged snow
111 !
112 IF(i%TSNOW%SCHEME/='3-L' .AND. i%TSNOW%SCHEME/='CRO')THEN
113  zrhosmax=xrhosmax
114  zswe(:)=psnowswe(:,1)
115 ELSE
116  zrhosmax=xrhosmax_es
117  DO jwrk=1,SIZE(psnowswe,2)
118  zswe(:) = zswe(:) + psnowswe(:,jwrk)
119  END DO
120 ENDIF
121 !
122 WHERE(zswe(:)>xhgla*zrhosmax)
123  zsr(:) = psr(:)
124 ELSEWHERE
125  zsr(:) = 0.0
126 ENDWHERE
127 !
128 !Snow storage calculation
129 !
130 pglasto(:)=(zglasto(:)+ptstep*zsr(:))/(1.0+ptstep/(ztau*xday))
131 !
132 !supress numerical artifacs
133 !
134 zstomax(:)=zsr(:)*ptstep+zglasto(:)
135 !
136 pglasto(:)=min(zstomax(:),pglasto(:))
137 !
138 !Ice flux calculation
139 !
140 zflux(:)=(zglasto(:)-pglasto(:))/ptstep+zsr(:)
141 !
142 !supress numerical artifacs
143 !
144 piceflux(:) = max(0.0,zflux(:))
145 pglasto(:) = pglasto(:) + piceflux(:)-zflux(:)
146 !
147 WHERE(pglasto(:)<=1.e-10)pglasto(:)=0.0
148 !
149 !-------------------------------------------------------------------------------
150 !Snow pack update
151 !
152 IF(i%TSNOW%SCHEME/='3-L' .AND. i%TSNOW%SCHEME/='CRO')THEN
153 !
154  WHERE(psnowswe(:,1)<=xhgla*zrhosmax)piceflux(:)=0.0
155  psnowswe(:,1)=psnowswe(:,1)-piceflux(:)*ptstep
156 !
157 ELSE
158 !
159  WHERE(zswe(:)<=xhgla*zrhosmax)piceflux(:)=0.0
160 !
161 ! Snow total depth
162  zsnowd(:) = 0.
163  DO jwrk=1,SIZE(psnowswe,2)
164  zsnowd(:) = zsnowd(:) + psnowswe(:,jwrk)/psnowrho(:,jwrk)
165  END DO
166 !
167 ! Flux
168  DO jwrk=1,SIZE(psnowswe,2)
169  zflux(:) = piceflux(:)*(psnowswe(:,jwrk)/psnowrho(:,jwrk)) &
170  /max(zsnowd(:),0.0001)
171  psnowswe(:,jwrk)=psnowswe(:,jwrk)-zflux(:)*ptstep
172  END DO
173 !
174 ENDIF
175 !-------------------------------------------------------------------------------
176 IF (lhook) CALL dr_hook('HYDRO_GLACIER',1,zhook_handle)
177 !-------------------------------------------------------------------------------
178 END SUBROUTINE hydro_glacier
subroutine hydro_glacier(I, PTSTEP, PSR, PSNOWRHO, PSNOWSWE, PGLASTO, PICEFLUX)