SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
diag_isba_to_rout.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 ! ############################
7  SUBROUTINE diag_isba_to_rout (UG, &
8  pvarc,pvarcp,pvarrout)
9 ! ############################
10 !
11 !!**** *DIAG_ISBA_TO_ROUT*
12 !!
13 !! PURPOSE
14 !! -------
15 !
16 !!** METHOD
17 !! ------
18 !
19 !! EXTERNAL
20 !! --------
21 !!
22 !! none
23 !!
24 !! IMPLICIT ARGUMENTS
25 !! ------------------
26 !!
27 !!
28 !!
29 !!
30 !!
31 !! REFERENCE
32 !! ---------
33 !!
34 !!
35 !!
36 !! AUTHOR
37 !! ------
38 !!
39 !! K. Chancibault * Meteo-France *
40 !!
41 !! MODIFICATIONS
42 !! -------------
43 !!
44 !! Original 10/11/2006
45 !-------------------------------------------------------------------------------
46 !
47 !* 0. DECLARATIONS
48 ! ------------
49 !
50 !
52 !
53 USE modd_surf_par, ONLY: xundef
54 USE modd_csts, ONLY: xrholw
55 USE modd_topodyn, ONLY : xtopd_step
56 !
57 USE modi_abor1_sfx
58 !
59 USE yomhook ,ONLY : lhook, dr_hook
60 USE parkind1 ,ONLY : jprb
61 !
62 IMPLICIT NONE
63 !
64 !* 0.1 declarations of arguments
65 !
66 !
67 !
68 TYPE(surf_atm_grid_t), INTENT(INOUT) :: ug
69 !
70 REAL,DIMENSION(:),INTENT(IN) :: pvarc ! Current time step cumulated diagnostic from SurfEx
71 REAL,DIMENSION(:),INTENT(IN) :: pvarcp ! Previous time step cumulated diagnostic from SurfEx
72 REAL,DIMENSION(:),INTENT(OUT) :: pvarrout ! Not cumulated diagnostic (m3/s)
73 !
74 !* 0.2 declarations of local variables
75 !
76 REAL(KIND=JPRB) :: zhook_handle
77 !-------------------------------------------------------------------------------
78 IF (lhook) CALL dr_hook('DIAG_ISBA_TO_ROUT',0,zhook_handle)
79 !
80 !* 0. Initialization:
81 ! ---------------
82 pvarrout=xundef
83 !
84 IF ( SIZE(pvarc,1)==SIZE(pvarcp,1) ) THEN
85  !
86  WHERE ( pvarc/=xundef )
87  pvarrout = pvarc - pvarcp
88  pvarrout = pvarrout / xtopd_step
89  pvarrout = pvarrout * ug%XMESH_SIZE / xrholw
90  ENDWHERE
91  !
92 ELSE
93  !
94  WRITE(*,*) 'Pb with diagnostic to rout'
95  CALL abor1_sfx("DIAG_ISBA_TO_ROUT: PB WITH DIAGNOSTIC TO ROUT ")
96  !
97 ENDIF
98 !
99 WHERE (pvarrout<0.) pvarrout = 0.
100 !
101 IF (lhook) CALL dr_hook('DIAG_ISBA_TO_ROUT',1,zhook_handle)
102 !
103 END SUBROUTINE diag_isba_to_rout
subroutine abor1_sfx(YTEXT)
Definition: abor1_sfx.F90:6
subroutine diag_isba_to_rout(UG, PVARC, PVARCP, PVARROUT)