Philippe 23/02/2016: lfi2cdf: modif for JPHEXT/=1
[MNH-git_open_source-lfs.git] / LIBTOOLS / tools / diachro / src / DIAPRO / resolv_nijinf_nijsup.f90
1 !     ######spl
2       SUBROUTINE RESOLV_NIJINF_NIJSUP
3 !     ###############################
4 !
5 !!****  *RESOLV_NIJINF_NIJSUP* -  Affectation des valeurs de NIINF, NISUP,
6 !!                                NJINF et NJSUP dans les 2 cas CH et CV
7 !!
8 !!    PURPOSE
9 !!    -------
10 !
11 !!**  METHOD
12 !!    ------
13 !!     
14 !!
15 !!    EXTERNAL
16 !!    --------
17 !!
18 !!    IMPLICIT ARGUMENTS
19 !!    ------------------
20 !!
21 !!      None
22 !!
23 !!    REFERENCE
24 !!    ---------
25 !!
26 !!
27 !!    AUTHOR
28 !!    ------
29 !!      
30 !!      J. Duron    * Laboratoire d'Aerologie *
31 !!
32 !!    MODIFICATIONS
33 !!    -------------
34 !!      Original       16/01/95
35 !!      Updated   PM 
36 !-------------------------------------------------------------------------------
37 USE MODD_DIM1
38 USE MODD_TYPE_AND_LH
39 USE MODD_PARAMETERS
40 USE MODD_RESOLVCAR
41 USE MODN_PARA
42 !
43 !*       0.    DECLARATIONS
44 !              ------------
45 !
46 IMPLICIT NONE
47 !
48 !-------------------------------------------------------------------------------
49 ! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
50 ! CH Positionnement NIINF, NJINF, NISUP, NJSUP
51 ! Defaut : NIINF=NIL, NJINF=NJL, NISUP=NIH, NJSUP=NJH
52 ! Sinon valeurs fournies par l'utilisateur dans les limites (NIL,NJL NIH,
53 ! NJH)
54 ! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
55                 if(nverbia > 0)then
56                   print *,' **resolv_ni... LCH LCV LCHXY LFT LPVKT ',LCH,LCV,LCHXY,LFT,LPVKT
57                 endif
58
59                 IF((LCH.AND..NOT.LCV) .OR. (LCHXY.AND..NOT.LCV))THEN
60
61                   IF(NIINF == 0)THEN
62                     NIINF=NIL
63                     IF(NIINF == 1)NIINF=NIINF+JPHEXT
64                   ELSE IF(NIINF /=0)THEN
65                     print *,' NIINF DEMANDE NIL NIH ', &
66                                 NIINF,NIL,NIH
67                     IF(NIINF < NIL .OR. NIINF > NIH)THEN
68                       NIINF=NIL
69                       IF(NIINF == 1)THEN
70                         NIINF=NIINF+JPHEXT
71                       ENDIF
72                       print *,' NIINF MODIFIE ', NIINF
73                     ENDIF
74                   ENDIF
75
76                   IF(NJINF == 0)THEN
77                     NJINF=NJL
78                     IF(NJINF == 1)NJINF=NJINF+JPHEXT
79                   ELSE IF(NJINF /=0)THEN
80                     print *,' NJINF DEMANDE NJL NJH ', &
81                                 NJINF,NJL,NJH
82                     IF(NJINF < NJL .OR. NJINF > NJH)THEN
83                       NJINF=NJL
84                       IF(NJINF == 1)THEN
85                         NJINF=NJINF+JPHEXT
86                       ENDIF
87                       print *,' NJINF MODIFIE ', NJINF
88                     ENDIF
89                   ENDIF
90
91                   IF(NISUP == 0)THEN
92                     NISUP=NIH
93                     IF(NISUP > NIMAX+JPHEXT)NISUP=NIMAX+JPHEXT
94                   ELSE IF(NISUP /=0)THEN
95                     print *,' NISUP DEMANDE NIL NIH ', &
96                         NISUP,NIL,NIH
97                     IF(NISUP < NIL .OR. NISUP > NIH)THEN
98                       NISUP=NIH
99                       IF(NISUP > NIMAX+JPHEXT)THEN
100                         NISUP=NIMAX+JPHEXT
101                       ENDIF
102                       print *,' NISUP MODIFIE ', NISUP
103                     ENDIF
104                   ENDIF
105
106                   IF(NJSUP == 0)THEN
107                     NJSUP=NJH
108                     IF(NJSUP > NJMAX+JPHEXT)NJSUP=NJMAX+JPHEXT
109                   ELSE IF(NJSUP /=0)THEN
110                     print *,' NJSUP DEMANDE NJL NJH ', &
111                                NJSUP,NJL,NJH
112                     IF(NJSUP < NJL .OR. NJSUP > NJH)THEN
113                       NJSUP=NJH
114                       IF(NJSUP > NJMAX+JPHEXT)THEN
115                         NJSUP=NJMAX+JPHEXT
116                       ENDIF
117                       print *,' NJSUP MODIFIE ', NJSUP
118                     ENDIF
119                   ENDIF
120
121 !                 print *,' NIINF,NISUP,NJINF,NJSUP,NKL,NKH ', &
122 !                           NIINF,NISUP,NJINF,NJSUP,NKL,NKH
123     
124 ! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
125 ! CV Positionnement NIINF, NJINF, NISUP, NJSUP
126 ! CV Positionnement LHORIZ et LVERTI
127 ! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
128
129                 ELSE IF(LCV)THEN
130                   LHORIZ=.FALSE.; LVERTI=.TRUE.
131                   NIINF=NIL
132                   NJINF=NJL
133                   NISUP=NIH
134                   NJSUP=NJH
135
136 !                 print *,' NIINF,NISUP,NJINF,NJSUP,NKL,NKH ', &
137 !                           NIINF,NISUP,NJINF,NJSUP,NKL,NKH
138                 ENDIF
139     
140                 if(nverbia > 0)then
141                   print *,' **resolv_nii.. NIINF,NISUP,NJINF,NJSUP,NIL,NIH,NJL,NJH,NKL,NKH ', &
142                             NIINF,NISUP,NJINF,NJSUP,NIL,NIH,NJL,NJH,NKL,NKH
143                 endif
144 ! +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
145 !
146 !
147 !
148 RETURN
149 END SUBROUTINE  RESOLV_NIJINF_NIJSUP