source: LMDZ.3.3/tags/IPSL-CM4_IPCC_v0x9/libf/dyn3d/ord_coord.F @ 538

Last change on this file since 538 was 538, checked in by (none), 20 years ago

This commit was manufactured by cvs2svn to create tag
'IPSL-CM4_IPCC_v0x9'.

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1       SUBROUTINE ord_coord ( nmax, xi, xo, decrois )
2
3c   .... Auteur :  P. Le Van  ....
4c
5c   ... Reordonne eventuellement les coordonnees de la grille donnees ...
6c
7       IMPLICIT NONE
8
9c    .....  Arguments  en entree  .....
10
11       INTEGER nmax
12       REAL xi(nmax)
13
14c    .....  Arguments  en sortie  .....
15c
16       REAL xo(nmax+1)
17       LOGICAL decrois
18
19c    .... Variables  locales  ....
20
21       REAL xscr(nmax)
22       INTEGER i,ii
23       REAL pi, degres, chmin, chmax, mult
24c
25
26       pi     = 2.*ASIN(1.)
27       degres = 180./pi
28       decrois = .FALSE.
29
30       DO i = 1, nmax
31        xo(i) = xi(i)
32       ENDDO
33     
34       mult = 1.
35       IF( xo(1).GT.xo(nmax) ) mult = -1.
36
37       CALL minmax(nmax,xo(1),chmin,chmax)
38
39       IF(chmax.LT.6.5 )  THEN
40          DO i = 1,nmax
41           xo(i) = xo(i) * degres
42          ENDDO
43       ENDIF
44
45       IF( ABS( xo( 1  ) + mult* 90. ). LT .0.001. OR .
46     ,     ABS( xo(nmax) - mult* 90. ). LT .0.001      )  THEN
47        PRINT *,' Reverifier les valeurs de  xidat  pour les donnees .'
48        PRINT *,' Elles doivent correspondre aux interfaces et non aux',
49     , 'ordonnees des donnees,egales a -90. et 90.deg aux 2 extremites '
50         CALL ABORT
51       ENDIF
52
53       IF( xo(1).GT.xo(nmax) )   THEN
54          DO i = 1, nmax
55            xscr(i) = xo(i)
56          ENDDO
57          DO i = 1, nmax
58            xo(i+1) = xscr(i)
59          ENDDO
60            xo (   1    ) =   90.
61       ELSE
62            xo ( nmax +1) =   90.
63       ENDIF
64
65       IF ( xo(2).LT.xo(1) ) decrois =.TRUE.
66
67       DO i = 3, nmax
68
69        IF(decrois.AND.xo(i).GT.xo(i-1) ) THEN
70         PRINT 1
71         PRINT 2,(xo(ii),ii=1,nmax)
72         CALL ABORT
73        ENDIF
74        IF(.NOT.decrois.AND.xo(i).LT.xo(i-1) ) THEN
75         PRINT 1
76         PRINT 2,(xo(ii),ii=1,nmax)
77         CALL ABORT
78        ENDIF
79
80       ENDDO
81       
82       IF( decrois )  THEN
83c         CALL sort(nmax+1,xo(1))
84        CALL sort(nmax+1,xo)
85       ENDIF
86
871      FORMAT(5x,' Incoherence dans les valeurs des latitudes de la ',
88     ,  'grille du modele ')
892      FORMAT(1x,8f8.2)
90
91       RETURN
92       END
Note: See TracBrowser for help on using the repository browser.