SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
writesurf_sso_canopyn.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 writesurf_sso_canopy_n (DGU, U, &
7  sscp, &
8  hprogram,owrite)
9 ! ####################################
10 !
11 !!**** *WRITE_SSO_n* - writes SSO fields
12 !!
13 !! PURPOSE
14 !! -------
15 !!
16 !!** METHOD
17 !! ------
18 !!
19 !! EXTERNAL
20 !! --------
21 !!
22 !!
23 !! IMPLICIT ARGUMENTS
24 !! ------------------
25 !!
26 !! REFERENCE
27 !! ---------
28 !!
29 !!
30 !! AUTHOR
31 !! ------
32 !! V. Masson *Meteo France*
33 !!
34 !! MODIFICATIONS
35 !! -------------
36 !! Original 01/2003
37 !! E. Martin 01/2012 avoid write of XUNDEF fields
38 !-------------------------------------------------------------------------------
39 !
40 !* 0. DECLARATIONS
41 ! ------------
42 !
43 !
44 !
45 !
46 !
47 !
48 !
50 USE modd_surf_atm_n, ONLY : surf_atm_t
51 !
53 !
55 !
56 USE yomhook ,ONLY : lhook, dr_hook
57 USE parkind1 ,ONLY : jprb
58 !
59 IMPLICIT NONE
60 !
61 !* 0.1 Declarations of arguments
62 ! -------------------------
63 !
64 !
65 !
66 TYPE(diag_surf_atm_t), INTENT(INOUT) :: dgu
67 TYPE(surf_atm_t), INTENT(INOUT) :: u
68 !
69 TYPE(sso_canopy_t), INTENT(INOUT) :: sscp
70 !
71  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling
72 LOGICAL, INTENT(IN) :: owrite ! flag to write canopy terms
73 !
74 !* 0.2 Declarations of local variables
75 ! -------------------------------
76 !
77 INTEGER :: iresp ! IRESP : return-code if a problem appears
78  CHARACTER(LEN=12) :: yrecfm ! Name of the article to be read
79  CHARACTER(LEN=100):: ycomment ! Comment string
80 !
81 INTEGER :: jlayer ! loop counter on layers
82 REAL(KIND=JPRB) :: zhook_handle
83 !-------------------------------------------------------------------------------
84 !
85 !* 1. Prognostic fields:
86 ! -----------------
87 !
88 !
89 !* flag to define if canopy is computed
90 !
91 IF (lhook) CALL dr_hook('WRITESURF_SSO_CANOPY_N',0,zhook_handle)
92 yrecfm='SSO_CANOPY'
93 ycomment='flag to use canopy levels'
94  CALL write_surf(dgu, u, &
95  hprogram,yrecfm,owrite,iresp,hcomment=ycomment)
96 !
97 IF (.NOT. owrite .AND. lhook) CALL dr_hook('WRITESURF_SSO_CANOPY_N',1,zhook_handle)
98 IF (.NOT. owrite) RETURN
99 !
100 !* number of levels
101 !
102 yrecfm='SSO_CAN_LVL'
103 ycomment='number of canopy levels'
104  CALL write_surf(dgu, u, &
105  hprogram,yrecfm,sscp%NLVL,iresp,hcomment=ycomment)
106 !
107 !* altitudes
108 !
109 DO jlayer=1,sscp%NLVL
110  WRITE(yrecfm,'(A9,I2.2,A1)') 'SSO_CAN_Z',jlayer,' '
111  ycomment='altitudes of canopy levels (m)'
112  CALL write_surf(dgu, u, &
113  hprogram,yrecfm,sscp%XZ(:,jlayer),iresp,hcomment=ycomment)
114 END DO
115 !
116 !* wind in canopy
117 !
118 DO jlayer=1,sscp%NLVL
119  WRITE(yrecfm,'(A9,I2.2,A1)') 'SSO_CAN_U',jlayer,' '
120  ycomment='wind at canopy levels (m/s)'
121  CALL write_surf(dgu, u, &
122  hprogram,yrecfm,sscp%XU(:,jlayer),iresp,hcomment=ycomment)
123 END DO
124 !
125 !* Tke in canopy
126 !
127 DO jlayer=1,sscp%NLVL
128  WRITE(yrecfm,'(A9,I2.2,A1)') 'SSO_CAN_E',jlayer,' '
129  ycomment='Tke at canopy levels (m2/s2)'
130  CALL write_surf(dgu, u, &
131  hprogram,yrecfm,sscp%XTKE(:,jlayer),iresp,hcomment=ycomment)
132 END DO
133 !
134 IF (lhook) CALL dr_hook('WRITESURF_SSO_CANOPY_N',1,zhook_handle)
135 !
136 !-------------------------------------------------------------------------------
137 !
138 END SUBROUTINE writesurf_sso_canopy_n
subroutine writesurf_sso_canopy_n(DGU, U, SSCP, HPROGRAM, OWRITE)