36 LOGICAL,
PARAMETER :: LPSTOPBALANCE = .FALSE.
38 LOGICAL :: LCRODAILYINFO = .FALSE.
39 LOGICAL :: LCRODEBUG = .FALSE.
40 LOGICAL :: LCRODEBUGDETAILS = .FALSE.
41 LOGICAL :: LCRODEBUGATM = .FALSE.
42 LOGICAL :: LPRINTGRAN = .FALSE.
43 LOGICAL :: LCONTROLBALANCE = .FALSE.
45 INTEGER :: NPOINTCRODEBUG = 1
46 INTEGER :: NTIMECRODEBUG = 0
47 INTEGER :: NENDCRODEBUG = 99999999
48 INTEGER :: NHOURCRODEBUG = 0
50 REAL :: XLATCRODEBUG = -999.
51 REAL :: XLONCRODEBUG = -999.
53 REAL :: XWARNING_MASSBALANCE=1.E-4
54 REAL :: XWARNING_ENERGYBALANCE=1.E-4
66 TYPE(isba_t
),
INTENT(INOUT) :: i
68 CHARACTER(1) :: ycrocus_info,ycrocus_debug,ycrocus_balance
69 CHARACTER(8) :: ycrocus_debug_time
70 CHARACTER(2) :: ycrocus_debug_hour
71 CHARACTER(6) :: ycrocus_debug_point
72 CHARACTER(12) :: ycrocus_debug_lat,ycrocus_debug_lon
74 IF (i%TSNOW%SCHEME==
'CRO')
THEN
76 CALL getenv(
"CROCUS_INFO",ycrocus_info)
77 SELECT CASE (ycrocus_info)
79 print*,
"CROCUS : print daily informations."
85 CALL getenv(
"CROCUS_DEBUG",ycrocus_debug)
86 SELECT CASE (ycrocus_debug)
88 print*,
"CROCUS DEBUGGING MODE : print snow profile at the end of each time step"
90 lcrodebugdetails=.false.
94 print*,
"CROCUS DEBUGGING MODE : print snow profile after each CROCUS routine"
96 lcrodebugdetails=.true.
100 print*,
"CROCUS DEBUGGING MODE : print snow profile at the end of each &
101 & time step and forcing data"
103 lcrodebugdetails=.false.
107 print*,
"CROCUS DEBUGGING MODE : print snow profile after each CROCUS routine &
110 lcrodebugdetails=.true.
114 print*,
"CROCUS DEBUGGING MODE : print everything"
116 lcrodebugdetails=.true.
121 lcrodebugdetails=.false.
126 CALL getenv(
"CROCUS_BALANCE",ycrocus_balance)
127 SELECT CASE (ycrocus_balance)
129 print*,
"CROCUS DEBUGGING MODE : print mass and energy balance diagnostics."
130 lcontrolbalance=.true.
132 lcontrolbalance=.false.
135 IF (lcrodebug .OR. lcontrolbalance)
THEN
137 CALL getenv(
"CROCUS_DEBUG_DATE",ycrocus_debug_time)
138 IF ( len_trim(ycrocus_debug_time)>0 )
THEN
139 READ(ycrocus_debug_time,
'(I8)')ntimecrodebug
140 print*,
"after the date : ",ntimecrodebug
145 CALL getenv(
"CROCUS_DEBUG_DATE_END",ycrocus_debug_time)
146 IF (len_trim(ycrocus_debug_time)>0)
THEN
147 READ(ycrocus_debug_time,
'(I8)')nendcrodebug
148 print*,
"before the date : ",nendcrodebug
150 nendcrodebug = 99999999
153 CALL getenv(
"CROCUS_DEBUG_HOUR",ycrocus_debug_hour)
154 IF (len_trim(ycrocus_debug_hour)>0)
THEN
155 READ(ycrocus_debug_hour,
'(I2)')nhourcrodebug
156 print*,
"after the hour : ",nhourcrodebug
161 CALL getenv(
"CROCUS_DEBUG_POINT",ycrocus_debug_point)
162 IF (len_trim(ycrocus_debug_point)>0)
THEN
163 READ(ycrocus_debug_point,
'(I6)')npointcrodebug
168 CALL getenv(
"CROCUS_DEBUG_LAT",ycrocus_debug_lat)
169 IF (len_trim(ycrocus_debug_lat)>0)
THEN
170 READ(ycrocus_debug_lat,*)xlatcrodebug
175 CALL getenv(
"CROCUS_DEBUG_LON",ycrocus_debug_lon)
176 IF (len_trim(ycrocus_debug_lon)>0)
THEN
177 READ(ycrocus_debug_lon,*)xloncrodebug
190 REAL,
DIMENSION(:),
INTENT(IN) :: plat,plon
191 INTEGER,
INTENT(OUT) :: kdebug
193 kdebug=minloc( (plat-xlatcrodebug)**2 + (plon-xloncrodebug)**2, 1 )
subroutine init_crodebug(I)
subroutine getpoint_crodebug(PLAT, PLON, KDEBUG)