SURFEX v8.1
General documentation of Surfex
flag_gr_snow.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 flag_gr_snow(KFLAG,OMASK,TPSNOW)
7 ! ##########################################################
8 !
9 !!**** *FLAG_GR_SNOW* - routine to flag snow surface fields
10 !!
11 !! PURPOSE
12 !! -------
13 ! Initialize snow surface fields.
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !!
19 !!
20 !! EXTERNAL
21 !! --------
22 !!
23 !!
24 !! IMPLICIT ARGUMENTS
25 !! ------------------
26 !!
27 !! REFERENCE
28 !! ---------
29 !!
30 !!
31 !!
32 !! AUTHOR
33 !! ------
34 !! V. Masson * Meteo France *
35 !!
36 !! MODIFICATIONS
37 !! -------------
38 !! Original 10/2011
39 !! P. Samuelsson 07/2014 Added snow albedos
40 !-----------------------------------------------------------------------------
41 !
42 !* 0. DECLARATIONS
43 !
45 !
46 USE modd_surf_par, ONLY : xundef
47 !
48 USE yomhook ,ONLY : lhook, dr_hook
49 USE parkind1 ,ONLY : jprb
50 !
51 IMPLICIT NONE
52 !
53 !* 0.1 declarations of arguments
54 !
55 INTEGER, INTENT(IN) :: KFLAG ! 1 : to put physical values to run ISBA afterwards
56 ! ! 2 : to flag with XUNDEF value for points wihtout
57 LOGICAL, DIMENSION(:), INTENT(IN) :: OMASK ! T: points where snow values
58 ! ! must be flagged
59 TYPE(surf_snow), INTENT(INOUT) :: TPSNOW ! snow characteristics
60 !
61 !* 0.2 declarations of local variables
62 !
63 REAL :: ZVAL
64 INTEGER :: JLAYER
65 REAL(KIND=JPRB) :: ZHOOK_HANDLE
66 !-------------------------------------------------------------------------------
67 IF (lhook) CALL dr_hook('FLAG_GR_SNOW',0,zhook_handle)
68 !
69 IF (kflag==1) THEN
70  zval = 0.
71 ELSEIF (kflag==2) THEN
72  zval = xundef
73 ENDIF
74 !
75  DO jlayer = 1,tpsnow%NLAYER
76  !
77  WHERE(omask(:)) tpsnow%WSNOW(:,jlayer) = zval
78  !
79  IF (kflag==1) THEN
80  !
81  WHERE(omask(:)) tpsnow%RHO (:,jlayer) = xundef
82  !
83  IF (SIZE(tpsnow%TEMP ) >0) THEN
84  WHERE(omask(:))
85  tpsnow%TEMP (:,jlayer) = xundef
86  tpsnow%HEAT (:,jlayer) = xundef
87  END WHERE
88  ENDIF
89  !
90  IF (SIZE(tpsnow%T ) >0) WHERE(omask(:)) tpsnow%T(:,jlayer) = xundef
91  !
92  IF (SIZE(tpsnow%GRAN1) >0) THEN
93  WHERE(omask(:))
94  tpsnow%GRAN1(:,jlayer) = xundef
95  tpsnow%GRAN2(:,jlayer) = xundef
96  tpsnow%HIST (:,jlayer) = xundef
97  tpsnow%AGE (:,jlayer) = xundef
98  END WHERE
99  END IF
100  !
101  ENDIF
102  !
103  ENDDO
104  !
105  IF (kflag==1) THEN
106  !
107  WHERE(omask(:)) tpsnow%ALB (:) = xundef
108  WHERE(omask(:)) tpsnow%ALBVIS (:) = xundef
109  WHERE(omask(:)) tpsnow%ALBNIR (:) = xundef
110  WHERE(omask(:)) tpsnow%ALBFIR (:) = xundef
111  !
112  IF (SIZE(tpsnow%EMIS ) >0) THEN
113  WHERE(omask(:))
114  tpsnow%EMIS (:) = xundef
115  tpsnow%TS (:) = xundef
116  END WHERE
117  END IF
118  !
119  ENDIF
120 !
121 IF (lhook) CALL dr_hook('FLAG_GR_SNOW',1,zhook_handle)
122 !
123 !-------------------------------------------------------------------------------
124 !
125 END SUBROUTINE flag_gr_snow
subroutine flag_gr_snow(KFLAG, OMASK, TPSNOW)
Definition: flag_gr_snow.F90:7
real, parameter xundef
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15