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

Last change on this file since 3947 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
RevLine 
[524]1!
2! $Header$
3!
4C
5      SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz )
[704]6      USE dimphy
7      IMPLICIT NONE
8      include 'dimensions90.h'
[524]9cc
10cc Change wind local atmospheric coordinates to
11cc geocentric
12cc
[704]13cxxx      INCLUDE 'param.h'
[524]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.
[704]27c$OMP THREADPRIVATE(linit)
[524]28c
[704]29cxxx      IF ( .NOT. linit ) THEN
[524]30          zsinlon = SIN (rad * plon)
31          zcoslon = COS (rad * plon)
32          zsinlat = SIN (rad * plat)
33          zcoslat = COS (rad * plat)
34          linit = .TRUE.
[704]35cxxx      ENDIF
[524]36c
37      pxx = - zsinlon * pte - zsinlat * zcoslon * ptn
38      pyy =   zcoslon * pte - zsinlat * zsinlon * ptn
39      pzz =   zcoslat * ptn
[704]40
[524]41c
42c Value at North Pole
[704]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
[524]48c Value at South Pole
[704]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 
[524]56      RETURN
57      END SUBROUTINE atm2geo
Note: See TracBrowser for help on using the repository browser.