1 |
guez |
3 |
module hgardfou_m |
2 |
|
|
|
3 |
|
|
IMPLICIT none |
4 |
|
|
|
5 |
|
|
contains |
6 |
|
|
|
7 |
|
|
SUBROUTINE hgardfou(t, tsol) |
8 |
|
|
|
9 |
|
|
! From phylmd/hgardfou.F, v 1.1.1.1 2004/05/19 12:53:07 |
10 |
|
|
|
11 |
|
|
! This procedure aborts the program if the temperature gets out of range. |
12 |
|
|
|
13 |
guez |
69 |
USE indicesol, ONLY: nbsrf |
14 |
|
|
USE dimphy, ONLY: klev, klon |
15 |
guez |
70 |
use nr_util, only: ifirstloc |
16 |
guez |
3 |
|
17 |
|
|
REAL, intent(in):: t(klon, klev), tsol(klon, nbsrf) |
18 |
|
|
|
19 |
|
|
! Variables local to the procedure: |
20 |
|
|
|
21 |
|
|
real, parameter:: temp_min = 50., temp_max = 370. ! temperature range, in K |
22 |
guez |
70 |
INTEGER k, nsrf, jbad |
23 |
guez |
3 |
|
24 |
|
|
!---------------------------------------------------------- |
25 |
|
|
|
26 |
|
|
DO k = 1, klev |
27 |
guez |
70 |
jbad = ifirstloc(t(:, k) > temp_max .or. t(:, k) < temp_min) |
28 |
|
|
if (jbad <= klon) then |
29 |
|
|
PRINT *, 'hgardfou: temperature out of range' |
30 |
|
|
print *, "t(", jbad, ", ", k, ") = ", t(jbad, k) |
31 |
|
|
stop 1 |
32 |
|
|
end if |
33 |
guez |
3 |
ENDDO |
34 |
|
|
|
35 |
|
|
DO nsrf = 1, nbsrf |
36 |
guez |
70 |
jbad = ifirstloc(tsol(:, nsrf) > temp_max .or. tsol(:, nsrf) < temp_min) |
37 |
|
|
if (jbad <= klon) then |
38 |
|
|
PRINT *, 'hgardfou: temperature out of range' |
39 |
|
|
print *, "tsol(", jbad, ", ", nsrf, ") = ", tsol(jbad, nsrf) |
40 |
|
|
stop 1 |
41 |
guez |
3 |
ENDIF |
42 |
|
|
ENDDO |
43 |
|
|
|
44 |
|
|
END SUBROUTINE hgardfou |
45 |
|
|
|
46 |
|
|
end module hgardfou_m |