SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
diag_surf_budget_ideal.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 diag_surf_budget_ideal (PRHOA, PSFTH, &
7  pdir_sw, psca_sw, plw, &
8  pdir_alb, psca_alb, plwup, &
9  psfzon, psfmer, ple, &
10  prn, ph, pgflux, &
11  pswd, pswu, pswbd, pswbu, plwd, plwu, &
12  pfmu, pfmv )
13 ! ###############################################################################
14 !
15 !!**** *DIAG_SURF_BUDGET_IDEAL * - Computes diagnostics over lake
16 !!
17 !! PURPOSE
18 !! -------
19 !
20 !!** METHOD
21 !! ------
22 !!
23 !! REFERENCE
24 !! ---------
25 !!
26 !!
27 !! AUTHOR
28 !! ------
29 !! P. Le Moigne
30 !!
31 !! MODIFICATIONS
32 !! -------------
33 !! Original 03/2015
34 !!------------------------------------------------------------------
35 !
36 USE yomhook ,ONLY : lhook, dr_hook
37 USE parkind1 ,ONLY : jprb
38 !
39 IMPLICIT NONE
40 !
41 !* 0.1 declarations of arguments
42 !
43 REAL, DIMENSION(:), INTENT(IN) :: prhoa ! air density
44 REAL, DIMENSION(:), INTENT(IN) :: psfth ! heat flux
45 REAL, DIMENSION(:,:),INTENT(IN):: pdir_sw ! direct solar radiation (on horizontal surf.)
46 ! ! (W/m2)
47 REAL, DIMENSION(:,:),INTENT(IN):: psca_sw ! diffuse solar radiation (on horizontal surf.)
48 ! ! (W/m2)
49 REAL, DIMENSION(:), INTENT(IN) :: plw ! longwave radiation (on horizontal surf.)
50 REAL, DIMENSION(:), INTENT(IN) :: plwup ! upward longwave radiation (W/m2)
51 REAL, DIMENSION(:,:),INTENT(IN):: pdir_alb ! direct albedo for each spectral band (-)
52 REAL, DIMENSION(:,:),INTENT(IN):: psca_alb ! diffuse albedo for each spectral band (-)
53 REAL, DIMENSION(:), INTENT(IN) :: psfzon ! zonal friction
54 REAL, DIMENSION(:), INTENT(IN) :: psfmer ! meridional friction
55 !
56 REAL, DIMENSION(:), INTENT(IN) :: ple ! total latent heat flux (W/m2)
57 !
58 REAL, DIMENSION(:), INTENT(OUT):: prn ! net radiation (W/m2)
59 REAL, DIMENSION(:), INTENT(OUT):: ph ! sensible heat flux (W/m2)
60 REAL, DIMENSION(:), INTENT(OUT):: pgflux ! storage flux (W/m2)
61 !
62 REAL, DIMENSION(:,:), INTENT(OUT):: pswbd ! incoming short wave radiation by spectral band (W/m2)
63 REAL, DIMENSION(:,:), INTENT(OUT):: pswbu ! upward short wave radiation by spectral band (W/m2)
64 REAL, DIMENSION(:), INTENT(OUT):: pswd ! total incoming short wave radiation (W/m2)
65 REAL, DIMENSION(:), INTENT(OUT):: pswu ! total upward short wave radiation (W/m2)
66 REAL, DIMENSION(:), INTENT(OUT):: plwd ! Downward long wave radiation (W/m2)
67 REAL, DIMENSION(:), INTENT(OUT):: plwu ! upward long wave radiation (W/m2)
68 !
69 REAL, DIMENSION(:), INTENT(OUT):: pfmu ! zonal friction
70 REAL, DIMENSION(:), INTENT(OUT):: pfmv ! meridional friction
71 !
72 !* 0.2 declarations of local variables
73 !
74 INTEGER :: iswb ! number of SW bands
75 INTEGER :: jswb ! loop counter on number of SW bands
76 REAL(KIND=JPRB) :: zhook_handle
77 !-------------------------------------------------------------------------------------
78 !
79 !
80 IF (lhook) CALL dr_hook('DIAG_SURF_BUDGET_IDEAL',0,zhook_handle)
81 iswb = SIZE(pdir_sw,2)
82 !
83 !* total incoming and outgoing SW
84 !
85 DO jswb=1,iswb
86  pswbd(:,jswb) = pdir_sw(:,jswb) + psca_sw(:,jswb)
87  pswbu(:,jswb) = pdir_sw(:,jswb) * pdir_alb(:,jswb) + psca_sw(:,jswb) * psca_alb(:,jswb)
88 ENDDO
89 !
90 pswd(:) = 0.
91 pswu(:) = 0.
92 DO jswb=1,iswb
93  pswd(:)=pswd(:)+pswbd(:,jswb)
94  pswu(:)=pswu(:)+pswbu(:,jswb)
95 ENDDO
96 !
97 !*incoming outgoing LW
98 !
99 plwd(:)=plw(:)
100 plwu(:)=plwup(:)
101 !
102 !* net radiation
103 !
104 prn = pswd(:) - pswu(:) + plwd(:) - plwu(:)
105 !
106 !* sensible heat flux
107 !
108 ph = psfth(:)
109 !
110 !* storage flux
111 !
112 pgflux = prn - ph - ple
113 !
114 !* wind stress
115 !
116 pfmu = psfzon
117 !
118 pfmv = psfmer
119 IF (lhook) CALL dr_hook('DIAG_SURF_BUDGET_IDEAL',1,zhook_handle)
120 !
121 !-------------------------------------------------------------------------------------
122 !
123 END SUBROUTINE diag_surf_budget_ideal
subroutine diag_surf_budget_ideal(PRHOA, PSFTH, PDIR_SW, PSCA_SW, PLW, PDIR_ALB, PSCA_ALB, PLWUP, PSFZON, PSFMER, PLE, PRN, PH, PGFLUX, PSWD, PSWU, PSWBD, PSWBU, PLWD, PLWU, PFMU, PFMV)