SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
writesurf_watfluxn.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_watflux_n (DGU, U, &
7  w, &
8  hprogram)
9 ! ########################################
10 !
11 !!**** *WRITESURF_WATFLUX_n* - writes WATFLUX 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 !-------------------------------------------------------------------------------
38 !
39 !* 0. DECLARATIONS
40 ! ------------
41 !
42 !
43 !
44 !
45 !
47 USE modd_surf_atm_n, ONLY : surf_atm_t
48 !
49 USE modd_watflux_n, ONLY : watflux_t
50 !
52 !
53 !
54 USE yomhook ,ONLY : lhook, dr_hook
55 USE parkind1 ,ONLY : jprb
56 !
57 IMPLICIT NONE
58 !
59 !* 0.1 Declarations of arguments
60 ! -------------------------
61 !
62 !
63 !
64 TYPE(diag_surf_atm_t), INTENT(INOUT) :: dgu
65 TYPE(surf_atm_t), INTENT(INOUT) :: u
66 !
67 TYPE(watflux_t), INTENT(INOUT) :: w
68 !
69  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! program calling
70 
71 !
72 !* 0.2 Declarations of local variables
73 ! -------------------------------
74 !
75 INTEGER :: jmth,inmth
76  CHARACTER(LEN=2) :: ymth
77 !
78 INTEGER :: iresp ! IRESP : return-code if a problem appears
79  CHARACTER(LEN=12) :: yrecfm ! Name of the article to be read
80  CHARACTER(LEN=100):: ycomment ! Comment string
81 REAL(KIND=JPRB) :: zhook_handle
82 !
83 !-------------------------------------------------------------------------------
84 !
85 !
86 !* 3. Prognostic fields:
87 ! -----------------
88 !
89 !* water temperature
90 !
91 IF (lhook) CALL dr_hook('WRITESURF_WATFLUX_N',0,zhook_handle)
92 IF(w%LINTERPOL_TS)THEN
93 !
94  inmth=SIZE(w%XTS_MTH,2)
95 !
96  DO jmth=1,inmth
97  WRITE(ymth,'(I2)') (jmth-1)
98  yrecfm='TS_WATER'//adjustl(ymth(:len_trim(ymth)))
99  ycomment='TS_WATER month t'//adjustl(ymth(:len_trim(ymth)))
100  CALL write_surf(dgu, u, &
101  hprogram,yrecfm,w%XTS_MTH(:,jmth),iresp,hcomment=ycomment)
102  ENDDO
103 !
104 ENDIF
105 !
106 yrecfm='TS_WATER'
107 ycomment='TS_WATER (K)'
108  CALL write_surf(dgu, u, &
109  hprogram,yrecfm,w%XTS(:),iresp,hcomment=ycomment)
110 !
111 !-------------------------------------------------------------------------------
112 !
113 !* 4. Semi-prognostic fields:
114 ! ----------------------
115 !
116 !* roughness length
117 !
118 yrecfm='Z0WATER'
119 ycomment='Z0WATER (m)'
120  CALL write_surf(dgu, u, &
121  hprogram,yrecfm,w%XZ0(:),iresp,hcomment=ycomment)
122 !
123 !
124 !-------------------------------------------------------------------------------
125 !
126 !* 5. Time
127 ! ----
128 !
129 yrecfm='DTCUR'
130 ycomment='s'
131  CALL write_surf(dgu, u, &
132  hprogram,yrecfm,w%TTIME,iresp,hcomment=ycomment)
133 IF (lhook) CALL dr_hook('WRITESURF_WATFLUX_N',1,zhook_handle)
134 !
135 
136 !-------------------------------------------------------------------------------
137 !
138 END SUBROUTINE writesurf_watflux_n
subroutine writesurf_watflux_n(DGU, U, W, HPROGRAM)