/[lmdze]/trunk/dyn3d/conf_dat3d.f
ViewVC logotype

Diff of /trunk/dyn3d/conf_dat3d.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 13 by guez, Fri Jul 25 19:59:34 2008 UTC revision 24 by guez, Wed Mar 3 13:23:49 2010 UTC
# Line 17  contains Line 17  contains
17      use comconst, only: pi      use comconst, only: pi
18      use numer_rec, only: assert_eq      use numer_rec, only: assert_eq
19    
20      REAL, intent(in):: xd(:), yd(:) ! longitudes et latitudes initiales      REAL, intent(in):: xd(:), yd(:) ! longitudes et latitudes initiales, en rad
21      REAL, intent(in):: zd(:) ! pressure levels, in Pa or hPa      REAL, intent(in):: zd(:) ! pressure levels, in Pa or hPa
22    
23      REAL, intent(out):: xf(:) ! longitude, in rad, - pi to pi      REAL, intent(out):: xf(:) ! longitude, in rad, - pi to pi
# Line 28  contains Line 28  contains
28      ! Variables locales :      ! Variables locales :
29    
30      INTEGER lons, lats, levs      INTEGER lons, lats, levs
31      LOGICAL radianlon, invlon , radianlat      LOGICAL invlon
32      REAL rlatmin, rlatmax, oldxd1      REAL rlatmin, rlatmax, oldxd1
33      INTEGER i      INTEGER i
34    
# Line 39  contains Line 39  contains
39      levs = assert_eq(size(zd), size(zf), size(champd, 3), "conf_dat3d levs")      levs = assert_eq(size(zd), size(zf), size(champd, 3), "conf_dat3d levs")
40    
41      IF (xd(1) >= - pi - 0.5 .AND. xd(lons) <=  pi + 0.5) THEN      IF (xd(1) >= - pi - 0.5 .AND. xd(lons) <=  pi + 0.5) THEN
        radianlon = .TRUE.  
42         invlon    = .FALSE.         invlon    = .FALSE.
43      ELSE IF (xd(1) >= -0.5 .AND. xd(lons) <= 2 * pi+0.5) THEN      ELSE IF (xd(1) >= -0.5 .AND. xd(lons) <= 2 * pi+0.5) THEN
        radianlon = .TRUE.  
        invlon    = .TRUE.  
     ELSE IF (xd(1) >= -180.5 .AND. xd(lons) <= 180.5) THEN  
        radianlon = .FALSE.  
        invlon    = .FALSE.  
     ELSE IF (xd(1) >= -0.5 .AND. xd(lons) <= 360.5) THEN  
        radianlon = .FALSE.  
44         invlon    = .TRUE.         invlon    = .TRUE.
45      ELSE      ELSE
46         print *, 'Problème sur les longitudes des données'         print *, 'Problème sur les longitudes des données'
# Line 58  contains Line 50  contains
50      rlatmin = MIN(yd(1), yd(lats))      rlatmin = MIN(yd(1), yd(lats))
51      rlatmax = MAX(yd(1), yd(lats))      rlatmax = MAX(yd(1), yd(lats))
52    
53      IF (rlatmin >= -pi / 2 - 0.5 .AND. rlatmax <= pi / 2 + 0.5) THEN      IF (rlatmin < -pi / 2 - 0.5 .or. rlatmax > pi / 2 + 0.5) THEN
        radianlat = .TRUE.  
     ELSE IF (rlatmin >= - 90. - 0.5 .AND. rlatmax <= 90. + 0.5) THEN  
        radianlat = .FALSE.  
     ELSE  
54         print *, ' Problème sur les latitudes des données'         print *, ' Problème sur les latitudes des données'
55         stop 1         stop 1
56      ENDIF      ENDIF
57    
58      IF (radianlon) THEN      xf(:) = xd(:)
59         xf(:) = xd(:)      yf(:) = yd(:)
     else  
        xf(:) = xd(:) * pi / 180.  
     ENDIF  
   
     IF (radianlat) THEN  
        yf(:) = yd(:)  
     else  
        yf(:) = yd(:) * pi / 180.  
     ENDIF  
60    
61      IF (invlon) THEN      IF (invlon) THEN
62         ! On tourne les longitudes pour avoir - pi  à pi         ! On tourne les longitudes pour avoir - pi  à pi

Legend:
Removed from v.13  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.21