source: LMDZ4/branches/V3_test/libf/phylmd/atm2geo.F @ 5373

Last change on this file since 5373 was 704, checked in by Laurent Fairhead, 18 years ago

Inclusion des modifs de Y. Meurdesoif pour la version V3
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.5 KB
Line 
1!
2! $Header$
3!
4C
5      SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz )
6      USE dimphy
7      IMPLICIT NONE
8      include 'dimensions90.h'
9cc
10cc Change wind local atmospheric coordinates to
11cc geocentric
12cc
13cxxx      INCLUDE 'param.h'
14c
15      INTEGER, INTENT (in)              :: im, jm
16      REAL, DIMENSION (im,jm), INTENT (in) :: pte, ptn
17      REAL, DIMENSION (im,jm), INTENT (in) :: plon, plat
18      REAL, DIMENSION (im,jm), INTENT(out) :: pxx, pyy, pzz
19c
20      REAL, PARAMETER :: rpi = 3.141592653E0
21      REAL, PARAMETER :: rad = rpi / 180.0E0
22c
23      REAL, DIMENSION (im,jm) :: zsinlon, zcoslon
24      REAL, DIMENSION (im,jm) :: zsinlat, zcoslat
25c
26      LOGICAL, SAVE :: linit = .FALSE.
27c$OMP THREADPRIVATE(linit)
28c
29cxxx      IF ( .NOT. linit ) THEN
30          zsinlon = SIN (rad * plon)
31          zcoslon = COS (rad * plon)
32          zsinlat = SIN (rad * plat)
33          zcoslat = COS (rad * plat)
34          linit = .TRUE.
35cxxx      ENDIF
36c
37      pxx = - zsinlon * pte - zsinlat * zcoslon * ptn
38      pyy =   zcoslon * pte - zsinlat * zsinlon * ptn
39      pzz =   zcoslat * ptn
40
41c
42c Value at North Pole
43      IF (jjphy_begin==1) THEN
44        pxx ( :,  1) = - ptn ( 1, 1)
45        pyy ( :,  1) = - pte ( 1, 1)
46        pzz ( :,  1) = 0.0
47      ENDIF
48c Value at South Pole
49     
50      IF (jjphy_end==jjm+1) THEN
51        pxx ( :, jm) = + ptn ( 1, jm)
52        pyy ( :, jm) = + pte ( 1, jm)
53        pzz ( :, jm) = 0.0
54      ENDIF
55 
56      RETURN
57      END SUBROUTINE atm2geo
Note: See TracBrowser for help on using the repository browser.