SURFEX v8.1
General documentation of Surfex
writesurf_cpl_gcmn.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_cpl_gcm_n (HSELECT, U, HPROGRAM)
7 ! #######################################
8 !
9 !!**** *WRITESURF_CPL_GCM_n* - routine to write physical fields into
10 !! the restart file for ARPEGE/ALADIN run
11 !!
12 !! PURPOSE
13 !! -------
14 !! The purpose of this routine is to store the
15 !! physical fields into the restart file . Indeed,
16 !! when ARPEGE/ALADIN is used, theses fields
17 !! are not initialized at the begin of a run.
18 !!
19 !!
20 !!** METHOD
21 !! ------
22 !!
23 !! EXTERNAL
24 !! --------
25 !!
26 !!
27 !!
28 !! IMPLICIT ARGUMENTS
29 !! ------------------
30 !!
31 !! REFERENCE
32 !! ---------
33 !!
34 !!
35 !! AUTHOR
36 !! ------
37 !! B. Decharme *Meteo France*
38 !!
39 !! MODIFICATIONS
40 !! -------------
41 !! Original 04/2013
42 !-------------------------------------------------------------------------------
43 !
44 !* 0. DECLARATIONS
45 ! ------------
46 !
47 !
48 USE modd_surf_atm_n, ONLY : surf_atm_t
49 !
50 USE modd_surf_atm, ONLY : lcpl_gcm
51 !
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  CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: HSELECT
63 !
64 TYPE(surf_atm_t), INTENT(INOUT) :: U
65 !
66  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! calling program
67 !
68 !* 0.2 Declarations of local variables
69 ! -------------------------------
70 !
71 !
72 INTEGER :: IRESP ! Error code after redding
73  CHARACTER(LEN=12) :: YRECFM ! Name of the article to be read
74  CHARACTER(LEN=100):: YCOMMENT ! Comment string
75 REAL(KIND=JPRB) :: ZHOOK_HANDLE
76 !
77 !-------------------------------------------------------------------------------
78 IF (lhook) CALL dr_hook('WRITESURF_PRECIP_N',0,zhook_handle)
79 !
80 yrecfm='LCPL_GCM'
81 ycomment='flag to store physical fields in restart file'
82  CALL write_surf(hselect,hprogram,yrecfm,lcpl_gcm,iresp,hcomment=ycomment)
83 !
84 IF(lcpl_gcm)THEN
85 !
86  yrecfm='RAIN_GCM'
87  ycomment='RAINFALL FOR RESTART (kg/m2/s)'
88  CALL write_surf(hselect,hprogram,yrecfm,u%XRAIN(:),iresp,hcomment=ycomment)
89 !
90  yrecfm='SNOW_GCM'
91  ycomment='SNOWFALL FOR RESTART (kg/m2/s)'
92  CALL write_surf(hselect,hprogram,yrecfm,u%XSNOW(:),iresp,hcomment=ycomment)
93 !
94  yrecfm='Z0_GCM'
95  ycomment='Z0 FOR RESTART (m)'
96  CALL write_surf(hselect,hprogram,yrecfm,u%XZ0(:),iresp,hcomment=ycomment)
97 !
98  yrecfm='Z0H_GCM'
99  ycomment='Z0H FOR RESTART (m)'
100  CALL write_surf(hselect,hprogram,yrecfm,u%XZ0H(:),iresp,hcomment=ycomment)
101 !
102  yrecfm='QS_GCM'
103  ycomment='QS FOR RESTART (kg/kg)'
104  CALL write_surf(hselect,hprogram,yrecfm,u%XQSURF(:),iresp,hcomment=ycomment)
105 !
106 ENDIF
107 !
108 IF (lhook) CALL dr_hook('WRITESURF_PRECIP_N',1,zhook_handle)
109 !-------------------------------------------------------------------------------
110 !
111 END SUBROUTINE writesurf_cpl_gcm_n
subroutine writesurf_cpl_gcm_n(HSELECT, U, HPROGRAM)
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15