SURFEX v8.1
General documentation of Surfex
pack_pgd_seaflux.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 pack_pgd_seaflux (DTCO, KDIM, S, U, HPROGRAM,PSEABATHY)
7 ! ##############################################################
8 !
9 !!**** *PACK_PGD_SEAFLUX* packs SEAFLUX physiographic fields from all surface points to SEAFLUX points
10 !!
11 !! PURPOSE
12 !! -------
13 !!
14 !! METHOD
15 !! ------
16 !!
17 !
18 !! EXTERNAL
19 !! --------
20 !!
21 !! IMPLICIT ARGUMENTS
22 !! ------------------
23 !!
24 !! REFERENCE
25 !! ---------
26 !!
27 !! AUTHOR
28 !! ------
29 !!
30 !! P. Le Moigne Meteo-France
31 !!
32 !! MODIFICATION
33 !! ------------
34 !!
35 !! Original 09/2007
36 !! Lebeaupin-B C. 01/2008 : include bathymetry
37 !!
38 !----------------------------------------------------------------------------
39 !
40 !* 0. DECLARATION
41 ! -----------
42 !
43 !
44 !
45 !
47 USE modd_seaflux_n, ONLY : seaflux_t
48 USE modd_surf_atm_n, ONLY : surf_atm_t
49 !
51 !
52 USE yomhook ,ONLY : lhook, dr_hook
53 USE parkind1 ,ONLY : jprb
54 !
55 USE modi_get_surf_mask_n
56 !
57 USE modi_get_type_dim_n
58 !
59 USE modi_get_luout
60 !
61 IMPLICIT NONE
62 !
63 !* 0.1 Declaration of arguments
64 ! ------------------------
65 !
66 !
67 TYPE(data_cover_t), INTENT(INOUT) :: DTCO
68 INTEGER, INTENT(INOUT) :: KDIM
69 TYPE(seaflux_t), INTENT(INOUT) :: S
70 TYPE(surf_atm_t), INTENT(INOUT) :: U
71 !
72  CHARACTER(LEN=6), INTENT(IN) :: HPROGRAM ! Type of program
73 REAL, DIMENSION(:), INTENT(IN) :: PSEABATHY ! bathymetry
74 !
75 !* 0.2 Declaration of local variables
76 ! ------------------------------
77 !
78 INTEGER :: ILU ! expected physical size of full surface array
79 INTEGER :: ILUOUT ! output listing logical unit
80 INTEGER, DIMENSION(:), POINTER :: IMASK ! mask for packing from complete field to nature field
81 REAL(KIND=JPRB) :: ZHOOK_HANDLE
82 !
83 !-------------------------------------------------------------------------------
84 !
85 IF (lhook) CALL dr_hook('PACK_PGD_SEAFLUX',0,zhook_handle)
86  CALL get_luout(hprogram,iluout)
87 !
88 !* 1. Number of points and packing
89 ! ----------------------------
90 !
91  CALL get_type_dim_n(dtco, u, 'SEA ',kdim)
92 ALLOCATE(imask(kdim))
93 ilu=0
94  CALL get_surf_mask_n(dtco, u, 'SEA ',kdim,imask,ilu,iluout)
95 !
96 !
97 !-------------------------------------------------------------------------------
98 !
99 !* 2. Packing of fields
100 ! -----------------
101 !
102 ALLOCATE(s%XSEABATHY(kdim))
103  CALL pack_same_rank(imask,pseabathy(:),s%XSEABATHY(:))
104 IF (lhook) CALL dr_hook('PACK_PGD_SEAFLUX',1,zhook_handle)
105 !
106 !-------------------------------------------------------------------------------
107 !
108 END SUBROUTINE pack_pgd_seaflux
subroutine get_type_dim_n(DTCO, U, HTYPE, KDIM)
subroutine get_surf_mask_n(DTCO, U, HTYPE, KDIM, KMASK, KLU, KLUOUT)
integer, parameter jprb
Definition: parkind1.F90:32
subroutine get_luout(HPROGRAM, KLUOUT)
Definition: get_luout.F90:7
subroutine pack_pgd_seaflux(DTCO, KDIM, S, U, HPROGRAM, PSEABATHY)
logical lhook
Definition: yomhook.F90:15