SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
get_size_fulln.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 get_size_full_n (U, &
7  hprogram,kdim_full,ksize_full)
8 ! #######################################################
9 !
10 !!**** *GET_SIZE_FULL_n* - get number of points for this proc
11 !!
12 !! PURPOSE
13 !! -------
14 !!
15 !!** METHOD
16 !! ------
17 !!
18 !! EXTERNAL
19 !! --------
20 !!
21 !!
22 !! IMPLICIT ARGUMENTS
23 !! ------------------
24 !!
25 !! REFERENCE
26 !! ---------
27 !!
28 !!
29 !! AUTHOR
30 !! ------
31 !! S.Malardel *Meteo France*
32 !!
33 !! MODIFICATIONS
34 !! -------------
35 !! Original 05/2004
36 !-------------------------------------------------------------------------------
37 !
38 !* 0. DECLARATIONS
39 ! ------------
40 !
41 !
42 USE modd_surf_atm_n, ONLY : surf_atm_t
43 !
44 USE modd_surfex_mpi, ONLY : wlog_mpi
45 !
46 USE modd_surf_par, ONLY : nundef
47 !
48 USE modd_surfex_mpi, ONLY : nindex, nrank, nproc
49 USE modd_surfex_omp, ONLY : nindx1sfx, nindx2sfx
50 !
51 #ifdef SFX_MNH
52 USE modi_mnhget_size_full_n
53 #endif
54 !
55 USE yomhook ,ONLY : lhook, dr_hook
56 USE parkind1 ,ONLY : jprb
57 !
58 IMPLICIT NONE
59 !
60 !* 0.1 Declarations of arguments
61 ! -------------------------
62 !
63 !
64 TYPE(surf_atm_t), INTENT(INOUT) :: u
65 !
66  CHARACTER(LEN=6), INTENT(IN) :: hprogram ! main program
67 INTEGER , INTENT(IN) :: kdim_full ! total number of points
68 INTEGER , INTENT(OUT) :: ksize_full ! total number of points on this proc
69 !
70 !* 0.2 Declarations of local variables
71 ! -------------------------------
72 !
73 INTEGER :: j
74 REAL(KIND=JPRB) :: zhook_handle
75 !-------------------------------------------------------------------------------
76 !
77 IF (lhook) CALL dr_hook('GET_SIZE_FULL_N',0,zhook_handle)
78 IF (hprogram=='MESONH') THEN
79 #ifdef SFX_MNH
80  CALL mnhget_size_full_n(hprogram,kdim_full,ksize_full)
81 #endif
82 END IF
83 !
84 IF ( hprogram=='OFFLIN' .OR. hprogram=='ASCII ' .OR. hprogram=='FA ' .OR. hprogram=='LFI ' .OR. &
85  hprogram=='TEXTE ' .OR. hprogram=='BINARY' .OR. hprogram=='NC ') THEN
86 #ifdef SFX_OL
87  IF (u%NSIZE_FULL/=nundef .AND. u%NSIZE_FULL/=0) THEN
88  ksize_full = u%NSIZE_FULL
89  ELSEIF (ALLOCATED(nindex)) THEN
90  ksize_full = 0
91  DO j=1,SIZE(nindex)
92  IF ( nindex(j)==mod(nrank,nproc) ) ksize_full = ksize_full + 1
93  ENDDO
94  ELSE
95  ksize_full = kdim_full
96  END IF
97  IF ( nindx2sfx/=kdim_full .OR. nindx1sfx/=1 ) ksize_full = min(ksize_full,nindx2sfx-nindx1sfx+1)
98 #endif
99 ENDIF
100 !
101 IF (hprogram=='AROME ') THEN
102 #ifdef SFX_ARO
103  CALL aroget_size_full_n(hprogram,kdim_full,ksize_full)
104 #endif
105 ENDIF
106 IF (lhook) CALL dr_hook('GET_SIZE_FULL_N',1,zhook_handle)
107 !
108 !-------------------------------------------------------------------------------
109 !
110 END SUBROUTINE get_size_full_n
subroutine wlog_mpi(HLOG, PLOG, KLOG, KLOG2, OLOG)
subroutine get_size_full_n(U, HPROGRAM, KDIM_FULL, KSIZE_FULL)