source: trunk/LMDZ.COMMON/libf/phy_common/ioipsl_getin_p_mod.F90 @ 3287

Last change on this file since 3287 was 2290, checked in by jvatant, 5 years ago

Add procedure for 1D-arrays of type character in getin_p
--JVO

File size: 4.2 KB
Line 
1!
2! $Id$
3!
4MODULE ioipsl_getin_p_mod
5! To use getin in a parallel context
6!---------------------------------------------------------------------
7#ifdef CPP_IOIPSL
8USE ioipsl, ONLY: getin
9#else
10USE ioipsl_getincom, ONLY: getin
11#endif
12USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
13USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
14USE mod_phys_lmdz_transfert_para, ONLY : bcast
15!-
16IMPLICIT NONE
17!-
18PRIVATE
19PUBLIC :: getin_p
20!-
21INTERFACE getin_p
22
23  MODULE PROCEDURE getinrs_p, getinr1d_p, getinr2d_p, &
24 &                 getinis_p, getini1d_p, getini2d_p, &
25 &                 getincs_p, getinc1d_p,             &
26 &                 getinls_p, getinl1d_p, getinl2d_p
27END INTERFACE
28!-
29CONTAINS
30
31
32!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
33!!   Definition des getin -> bcast      !!
34!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
35
36!! -- Les chaines de caracteres -- !!
37 
38  SUBROUTINE getincs_p(VarIn,VarOut)
39    IMPLICIT NONE   
40    CHARACTER(LEN=*),INTENT(IN) :: VarIn
41    CHARACTER(LEN=*),INTENT(INOUT) :: VarOut   
42
43!$OMP BARRIER
44    IF (is_mpi_root .AND. is_omp_root) THEN
45        CALL getin(VarIn,VarOut)
46    ENDIF
47    CALL bcast(VarOut)
48  END SUBROUTINE getincs_p
49
50  SUBROUTINE getinc1d_p(VarIn,VarOut)
51    IMPLICIT NONE   
52    CHARACTER(LEN=*),INTENT(IN) :: VarIn
53    CHARACTER(LEN=*),INTENT(INOUT) :: VarOut(:)   
54
55    INTEGER :: i
56
57!$OMP BARRIER
58    IF (is_mpi_root .AND. is_omp_root) THEN
59        CALL getin(VarIn,VarOut)
60    ENDIF
61    DO i=1,size(VarOut)
62      CALL bcast(VarOut(i))
63    ENDDO
64  END SUBROUTINE getinc1d_p
65
66!! -- Les entiers -- !!
67 
68  SUBROUTINE getinis_p(VarIn,VarOut)
69    IMPLICIT NONE   
70    CHARACTER(LEN=*),INTENT(IN) :: VarIn
71    INTEGER,INTENT(INOUT) :: VarOut   
72
73!$OMP BARRIER
74    IF (is_mpi_root .AND. is_omp_root) THEN
75        CALL getin(VarIn,VarOut)
76    ENDIF
77    CALL bcast(VarOut)
78  END SUBROUTINE getinis_p
79
80  SUBROUTINE getini1d_p(VarIn,VarOut)
81    IMPLICIT NONE   
82    CHARACTER(LEN=*),INTENT(IN) :: VarIn
83    INTEGER,INTENT(INOUT) :: VarOut(:)
84
85!$OMP BARRIER
86    IF (is_mpi_root .AND. is_omp_root) THEN
87        CALL getin(VarIn,VarOut)
88    ENDIF
89    CALL bcast(VarOut)
90  END SUBROUTINE getini1d_p
91
92  SUBROUTINE getini2d_p(VarIn,VarOut)
93    IMPLICIT NONE   
94    CHARACTER(LEN=*),INTENT(IN) :: VarIn
95    INTEGER,INTENT(INOUT) :: VarOut(:,:)
96
97!$OMP BARRIER
98    IF (is_mpi_root .AND. is_omp_root) THEN
99        CALL getin(VarIn,VarOut)
100    ENDIF
101    CALL bcast(VarOut)
102  END SUBROUTINE getini2d_p
103
104!! -- Les flottants -- !!
105 
106  SUBROUTINE getinrs_p(VarIn,VarOut)
107    IMPLICIT NONE   
108    CHARACTER(LEN=*),INTENT(IN) :: VarIn
109    REAL,INTENT(INOUT) :: VarOut
110
111!$OMP BARRIER
112    IF (is_mpi_root .AND. is_omp_root) THEN
113        CALL getin(VarIn,VarOut)
114    ENDIF
115    CALL bcast(VarOut)
116  END SUBROUTINE getinrs_p
117
118  SUBROUTINE getinr1d_p(VarIn,VarOut)
119    IMPLICIT NONE   
120    CHARACTER(LEN=*),INTENT(IN) :: VarIn
121    REAL,INTENT(INOUT) :: VarOut(:)
122
123!$OMP BARRIER
124    IF (is_mpi_root .AND. is_omp_root) THEN
125        CALL getin(VarIn,VarOut)
126    ENDIF
127    CALL bcast(VarOut)
128  END SUBROUTINE getinr1d_p
129
130  SUBROUTINE getinr2d_p(VarIn,VarOut)
131    IMPLICIT NONE   
132    CHARACTER(LEN=*),INTENT(IN) :: VarIn
133    REAL,INTENT(INOUT) :: VarOut(:,:)
134
135!$OMP BARRIER
136    IF (is_mpi_root .AND. is_omp_root) THEN
137        CALL getin(VarIn,VarOut)
138    ENDIF
139    CALL bcast(VarOut)
140  END SUBROUTINE getinr2d_p
141
142!! -- Les Booleens -- !!
143 
144  SUBROUTINE getinls_p(VarIn,VarOut)
145    IMPLICIT NONE   
146    CHARACTER(LEN=*),INTENT(IN) :: VarIn
147    LOGICAL,INTENT(INOUT) :: VarOut
148
149!$OMP BARRIER
150    IF (is_mpi_root .AND. is_omp_root) THEN
151        CALL getin(VarIn,VarOut)
152    ENDIF
153    CALL bcast(VarOut)
154  END SUBROUTINE getinls_p
155
156  SUBROUTINE getinl1d_p(VarIn,VarOut)
157    IMPLICIT NONE   
158    CHARACTER(LEN=*),INTENT(IN) :: VarIn
159    LOGICAL,INTENT(INOUT) :: VarOut(:)
160
161!$OMP BARRIER
162    IF (is_mpi_root .AND. is_omp_root) THEN
163        CALL getin(VarIn,VarOut)
164    ENDIF
165    CALL bcast(VarOut)
166  END SUBROUTINE getinl1d_p
167
168  SUBROUTINE getinl2d_p(VarIn,VarOut)
169    IMPLICIT NONE   
170    CHARACTER(LEN=*),INTENT(IN) :: VarIn
171    LOGICAL,INTENT(INOUT) :: VarOut(:,:)
172
173!$OMP BARRIER
174    IF (is_mpi_root .AND. is_omp_root) THEN
175        CALL getin(VarIn,VarOut)
176    ENDIF
177    CALL bcast(VarOut)
178  END SUBROUTINE getinl2d_p
179!-
180!-----------------------------
181!-----------------------------
182!-----------------------------
183
184END MODULE ioipsl_getin_p_mod
185
Note: See TracBrowser for help on using the repository browser.