[524] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | C |
---|
| 5 | SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz ) |
---|
[704] | 6 | USE dimphy |
---|
| 7 | IMPLICIT NONE |
---|
| 8 | include 'dimensions90.h' |
---|
[524] | 9 | cc |
---|
| 10 | cc Change wind local atmospheric coordinates to |
---|
| 11 | cc geocentric |
---|
| 12 | cc |
---|
[704] | 13 | cxxx INCLUDE 'param.h' |
---|
[524] | 14 | c |
---|
| 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 |
---|
| 19 | c |
---|
| 20 | REAL, PARAMETER :: rpi = 3.141592653E0 |
---|
| 21 | REAL, PARAMETER :: rad = rpi / 180.0E0 |
---|
| 22 | c |
---|
| 23 | REAL, DIMENSION (im,jm) :: zsinlon, zcoslon |
---|
| 24 | REAL, DIMENSION (im,jm) :: zsinlat, zcoslat |
---|
| 25 | c |
---|
| 26 | LOGICAL, SAVE :: linit = .FALSE. |
---|
[704] | 27 | c$OMP THREADPRIVATE(linit) |
---|
[524] | 28 | c |
---|
[704] | 29 | cxxx 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] | 35 | cxxx ENDIF |
---|
[524] | 36 | c |
---|
| 37 | pxx = - zsinlon * pte - zsinlat * zcoslon * ptn |
---|
| 38 | pyy = zcoslon * pte - zsinlat * zsinlon * ptn |
---|
| 39 | pzz = zcoslat * ptn |
---|
[704] | 40 | |
---|
[524] | 41 | c |
---|
| 42 | c 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] | 48 | c 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 |
---|