1 |
|
|
MODULE MYRECVSET_MOD |
2 |
|
|
CONTAINS |
3 |
|
|
FUNCTION MYRECVSET(KSETS,KMYSET,KSET) |
4 |
|
|
|
5 |
|
|
#ifdef DOC |
6 |
|
|
|
7 |
|
|
!**** *MYRECVSET* RETURNS SET NUMBER TO SEND TO |
8 |
|
|
|
9 |
|
|
! Purpose. |
10 |
|
|
! -------- |
11 |
|
|
! |
12 |
|
|
|
13 |
|
|
!** Interface. |
14 |
|
|
! ---------- |
15 |
|
|
! ISENDSET = MYRECVSET(KSETS,KMYSET,KSET) |
16 |
|
|
|
17 |
|
|
! Explicit arguments : |
18 |
|
|
! -------------------- |
19 |
|
|
! input: KSETS |
20 |
|
|
|
21 |
|
|
! Implicit arguments : NONE |
22 |
|
|
! -------------------- |
23 |
|
|
! Method. |
24 |
|
|
! ------- |
25 |
|
|
|
26 |
|
|
! |
27 |
|
|
|
28 |
|
|
! Externals. |
29 |
|
|
! ---------- |
30 |
|
|
! NONE |
31 |
|
|
|
32 |
|
|
! Reference. |
33 |
|
|
! ---------- |
34 |
|
|
! ECMWF Research Department documentation of the IFS |
35 |
|
|
|
36 |
|
|
! Author. |
37 |
|
|
! ------- |
38 |
|
|
! Mats Hamrud *ECMWF* |
39 |
|
|
|
40 |
|
|
! Modifications. |
41 |
|
|
! -------------- |
42 |
|
|
! Original : 00-02-03 |
43 |
|
|
|
44 |
|
|
! ------------------------------------------------------------------ |
45 |
|
|
#endif |
46 |
|
|
|
47 |
|
|
USE PARKIND1 ,ONLY : JPIM ,JPRB |
48 |
|
|
USE ABORT_TRANS_MOD |
49 |
|
|
|
50 |
|
|
IMPLICIT NONE |
51 |
|
|
INTEGER(KIND=JPIM) :: MYRECVSET |
52 |
|
|
INTEGER(KIND=JPIM),INTENT(IN) :: KSETS,KMYSET,KSET |
53 |
|
|
|
54 |
|
|
|
55 |
|
|
! ------------------------------------------------------------------ |
56 |
|
|
|
57 |
|
|
!* 1. Check input argument for validity |
58 |
|
|
! --------------------------------- |
59 |
|
|
|
60 |
|
|
IF(KSETS < 1 .OR. KMYSET > KSETS .OR. KSET > KSETS-1) THEN |
61 |
|
|
|
62 |
|
|
CALL ABORT_TRANS(' MYRECVSET: INVALID ARGUMENT ') |
63 |
|
|
|
64 |
|
|
ELSE |
65 |
|
|
|
66 |
|
|
!* 2. Compute output parameters |
67 |
|
|
! ------------------------- |
68 |
|
|
|
69 |
|
|
MYRECVSET = MOD(-KSET-1+KMYSET+KSETS,KSETS)+1 |
70 |
|
|
|
71 |
|
|
ENDIF |
72 |
|
|
|
73 |
|
|
END FUNCTION MYRECVSET |
74 |
|
|
END MODULE MYRECVSET_MOD |