SURFEX v8.1
General documentation of Surfex
writesurf_pgd_flaken.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_pgd_flake_n (HSELECT, G, F, HPROGRAM)
7 ! ###################################################
8 !
9 !!**** *WRITESURF_PGD_FLAKE_n* - writes FLAKE 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 !! B. Decharme 07/2011 : delete argument HWRITE
36 !! M. Moge 02/2015 parallelization using MPI_ALLREDUCE for mesonh
37 !-------------------------------------------------------------------------------
38 !
39 !* 0. DECLARATIONS
40 ! ------------
41 !
42 !
43 USE modd_sfx_grid_n, ONLY : grid_t
44 USE modd_flake_n, ONLY : flake_t
45 !
47 !
49 USE modi_write_grid
50 USE modi_write_lcover
51 !
52 USE yomhook ,ONLY : lhook, dr_hook
53 USE parkind1 ,ONLY : jprb
54 !
55 IMPLICIT NONE
56 !
57 !* 0.1 Declarations of arguments
58 ! -------------------------
59 !
60 !
61  CHARACTER(LEN=*), DIMENSION(:), INTENT(IN) :: HSELECT
62 !
63 TYPE(grid_t), INTENT(INOUT) :: G
64 TYPE(flake_t), INTENT(INOUT) :: F
65 !
66  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! program calling
67 
68 !
69 !* 0.2 Declarations of local variables
70 ! -------------------------------
71 !
72 INTEGER :: IRESP ! IRESP : return-code if a problem appears
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 !
79 !
80 !* 2. Physiographic data fields:
81 ! -------------------------
82 !
83 !* cover classes
84 !
85 IF (lhook) CALL dr_hook('WRITESURF_PGD_FLAKE_N',0,zhook_handle)
86 !
87  CALL write_lcover(hselect,hprogram,f%LCOVER)
88 !
89 !* orography
90 !
91 yrecfm='ZS'
92 ycomment='ZS'
93  CALL write_surf(hselect, &
94  hprogram,yrecfm,f%XZS(:),iresp,hcomment=ycomment)
95 !
96 !* latitude, longitude
97 !
98  CALL write_grid(hselect, &
99  hprogram,g%CGRID,g%XGRID_PAR,g%XLAT,g%XLON,g%XMESH_SIZE,iresp)
100 !
101 !* FLake parameters
102 !
103 yrecfm='WATER_DEPTH'
104 ycomment='X_Y_'//yrecfm//' (m)'
105  CALL write_surf(hselect, &
106  hprogram,yrecfm,f%XWATER_DEPTH(:),iresp,hcomment=ycomment)
107 !
108 yrecfm='WATER_FETCH'
109 ycomment='X_Y_'//yrecfm//' (m)'
110  CALL write_surf(hselect, &
111  hprogram,yrecfm,f%XWATER_FETCH(:),iresp,hcomment=ycomment)
112 !
113 yrecfm='T_BS'
114 ycomment='X_Y_'//yrecfm//' (K)'
115  CALL write_surf(hselect, &
116  hprogram,yrecfm,f%XT_BS(:),iresp,hcomment=ycomment)
117 !
118 yrecfm='DEPTH_BS'
119 ycomment='X_Y_'//yrecfm//' (m)'
120  CALL write_surf(hselect, &
121  hprogram,yrecfm,f%XDEPTH_BS(:),iresp,hcomment=ycomment)
122 !
123 yrecfm='EXTCOEF_WAT'
124 ycomment='X_Y_'//yrecfm//' '
125  CALL write_surf(hselect, &
126  hprogram,yrecfm,f%XEXTCOEF_WATER(:),iresp,hcomment=ycomment)
127 IF (lhook) CALL dr_hook('WRITESURF_PGD_FLAKE_N',1,zhook_handle)
128 !
129 !-------------------------------------------------------------------------------
130 !
131 END SUBROUTINE writesurf_pgd_flake_n
subroutine writesurf_pgd_flake_n(HSELECT, G, F, HPROGRAM)
integer, parameter jprb
Definition: parkind1.F90:32
subroutine write_grid(HSELECT, HPROGRAM, HGRID, PGRID_PAR, PLAT, PLON,
Definition: write_grid.F90:7
logical lhook
Definition: yomhook.F90:15
subroutine write_lcover(HSELECT, HPROGRAM, OCOVER)
Definition: write_lcover.F90:7