SURFEX v8.1
General documentation of Surfex
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 (HSELECT, W, HPROGRAM)
7 ! ########################################
8 !
9 !!**** *WRITESURF_WATFLUX_n* - writes WATFLUX fields
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !!** METHOD
15 !! ------
16 !!
17 !! EXTERNAL
18 !! --------
19 !!
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !!
28 !! AUTHOR
29 !! ------
30 !! V. Masson *Meteo France*
31 !!
32 !! MODIFICATIONS
33 !! -------------
34 !! Original 01/2003
35 !! S. Senesi 08/2015 Fix some units in HCOMMENTs
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 USE modd_surf_atm_n, ONLY : surf_atm_t
42 !
43 USE modd_watflux_n, ONLY : watflux_t
44 !
46 !
47 !
48 USE yomhook ,ONLY : lhook, dr_hook
49 USE parkind1 ,ONLY : jprb
50 !
51 IMPLICIT NONE
52 !
53 !* 0.1 Declarations of arguments
54 ! -------------------------
55 !
56 !
57  CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: HSELECT
58 !
59 TYPE(watflux_t), INTENT(INOUT) :: W
60 !
61  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling
62 
63 !
64 !* 0.2 Declarations of local variables
65 ! -------------------------------
66 !
67 INTEGER :: JMTH,INMTH
68  CHARACTER(LEN=2) :: YMTH
69 !
70 INTEGER :: IRESP ! IRESP : return-code if a problem appears
71  CHARACTER(LEN=12) :: YRECFM ! Name of the article to be read
72  CHARACTER(LEN=100):: YCOMMENT ! Comment string
73 REAL(KIND=JPRB) :: ZHOOK_HANDLE
74 !
75 !-------------------------------------------------------------------------------
76 !
77 !
78 !* 3. Prognostic fields:
79 ! -----------------
80 !
81 !* water temperature
82 !
83 IF (lhook) CALL dr_hook('WRITESURF_WATFLUX_N',0,zhook_handle)
84 IF(w%LINTERPOL_TS)THEN
85 !
86  inmth=SIZE(w%XTS_MTH,2)
87 !
88  DO jmth=1,inmth
89  WRITE(ymth,'(I2)') (jmth-1)
90  yrecfm='TS_WATER'//adjustl(ymth(:len_trim(ymth)))
91  ycomment='TS_WATER month t'//adjustl(ymth(:len_trim(ymth)))//' (K)'
92  CALL write_surf(hselect, hprogram,yrecfm,w%XTS_MTH(:,jmth),iresp,hcomment=ycomment)
93  ENDDO
94 !
95 ENDIF
96 !
97 yrecfm='TS_WATER'
98 ycomment='TS_WATER (K)'
99  CALL write_surf(hselect, hprogram,yrecfm,w%XTS(:),iresp,hcomment=ycomment)
100 !
101 !-------------------------------------------------------------------------------
102 !
103 !* 4. Semi-prognostic fields:
104 ! ----------------------
105 !
106 !* roughness length
107 !
108 yrecfm='Z0WATER'
109 ycomment='Z0WATER (m)'
110  CALL write_surf(hselect, hprogram,yrecfm,w%XZ0(:),iresp,hcomment=ycomment)
111 !
112 !
113 !-------------------------------------------------------------------------------
114 !
115 !* 5. Time
116 ! ----
117 !
118 yrecfm='DTCUR'
119 ycomment='s'
120  CALL write_surf(hselect, hprogram,yrecfm,w%TTIME,iresp,hcomment=ycomment)
121 IF (lhook) CALL dr_hook('WRITESURF_WATFLUX_N',1,zhook_handle)
122 !
123 
124 !-------------------------------------------------------------------------------
125 !
126 END SUBROUTINE writesurf_watflux_n
integer, parameter jprb
Definition: parkind1.F90:32
subroutine writesurf_watflux_n(HSELECT, W, HPROGRAM)
logical lhook
Definition: yomhook.F90:15