source: LMDZ.3.3/trunk/libf/dyn3d/ord_coordm.F @ 259

Last change on this file since 259 was 259, checked in by lmdz, 23 years ago

Nouveaux programmes pour la creation des etats initiaux et des conditions aux limites. Levan
LF

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1C
2C $Header$
3C
4       SUBROUTINE ord_coordm ( nmax, xi, xo, jjm, jmods, decrois )
5
6c   ....  Auteur :  P. Le Van  ....
7
8c   ... Reordonne eventuellement les coordonnees de la grille modele ...
9c
10       IMPLICIT NONE
11
12c    .....  Arguments  en entree  .....
13
14       INTEGER nmax
15       REAL xi(1)
16       INTEGER nscr
17       PARAMETER ( nscr = 4000 )
18       REAL xscr(nscr)
19
20c    .....  Arguments  en sortie  .....
21c
22       REAL xo(1)
23       LOGICAL decrois
24       INTEGER jmods
25
26c    .... Variables  locales  ....
27
28       INTEGER i,jjm
29       REAL pi, degres, chmin, chmax,mult
30c
31       DO i = 1, nmax
32        xo(i) = xi(i)
33       ENDDO
34
35       mult = 1.
36       IF( xo(1).GT.xo(nmax) )  mult = - 1.
37       IF( nmax.EQ.jjm    ) jmods = nmax +1
38       IF( nmax.EQ.jjm +1 ) jmods = nmax -1
39     
40       IF( nmax.GT.nscr )   THEN
41         PRINT *,' Dans ord_coord  , nmax = ',nmax, 'est plus grand que'
42     ,, ' nscr !  Mettre nscr a la valeur de nmax et repasser ! ' 
43         CALL ABORT
44       ENDIF
45
46       pi     = 2.*ASIN(1.)
47       degres = 180./pi
48       decrois = .FALSE.
49
50       CALL minmax(nmax,xo(1),chmin,chmax)
51
52       IF(chmax.LT.6.5 )  THEN
53          DO i = 1,nmax
54           xo(i) = xo(i) * degres
55          ENDDO
56       ENDIF
57
58       IF( nmax.EQ.jjm )   THEN
59         IF( xo(1).GT.xo(nmax) )   THEN
60           DO i = 1, nmax
61            xscr(i) = xo(i)
62           ENDDO
63           DO i = 1, nmax
64            xo(i+1) = xscr(i)
65           ENDDO
66            xo (   1    ) =   90.
67         ELSE
68            xo ( nmax+1 ) =   90.
69         ENDIF
70       ELSE
71          IF( nmax.NE.jjm +1 )   THEN
72             PRINT *,'  Dans la routine ord_coordm , l argument nmax '
73             PRINT *,'  n est pas egal a jjm ni a jjm +1 . Corriger !'
74             CALL ABORT
75          ELSE
76            IF( ABS( xo(1)+ mult * 90.).GT.0.01 )  THEN
77              PRINT *,' Avec nmax =',nmax,'on devrait avoir des',
78     ,    ' ordonnees = 90. deg pour j=1 ou jjm+1 ! '
79             CALL ABORT
80            ELSE
81               IF( xo(1).LT.xo(nmax) )  THEN
82                 DO i = 1, nmax
83                  xscr(i) = xo(i)
84                 ENDDO
85                 DO i = 1, nmax -1
86                  xo(i) = xscr(i+1)
87                 ENDDO
88               ENDIF
89            ENDIF
90          ENDIF
91       ENDIF
92
93       IF ( xo(2).LT.xo(1) ) decrois =.TRUE.
94
95       DO i = 3, nmax
96
97        IF(decrois.AND.xo(i).GT.xo(i-1) ) THEN
98         PRINT 1
99         CALL ABORT
100        ENDIF
101        IF(.NOT.decrois.AND.xo(i).LT.xo(i-1) ) THEN
102         PRINT 1
103         CALL ABORT
104        ENDIF
105
106       ENDDO
107       
108       IF( decrois )  THEN
109         CALL sort(jmods,xo(1))
110       ENDIF
111
112
1131      FORMAT(5x,' Incoherence dans les valeurs des latitudes de la ',
114     ,  'grille du modele ')
1152      FORMAT(1x,8f8.2)
116
117       RETURN
118       END
Note: See TracBrowser for help on using the repository browser.