[524] | 1 | ! |
---|
| 2 | ! $Header$ |
---|
| 3 | ! |
---|
| 4 | C |
---|
| 5 | SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz ) |
---|
[766] | 6 | USE dimphy |
---|
[776] | 7 | USE mod_phys_lmdz_para |
---|
[766] | 8 | IMPLICIT NONE |
---|
| 9 | include 'dimensions90.h' |
---|
[524] | 10 | cc |
---|
| 11 | cc Change wind local atmospheric coordinates to |
---|
| 12 | cc geocentric |
---|
| 13 | cc |
---|
[766] | 14 | cxxx INCLUDE 'param.h' |
---|
[524] | 15 | c |
---|
| 16 | INTEGER, INTENT (in) :: im, jm |
---|
| 17 | REAL, DIMENSION (im,jm), INTENT (in) :: pte, ptn |
---|
| 18 | REAL, DIMENSION (im,jm), INTENT (in) :: plon, plat |
---|
| 19 | REAL, DIMENSION (im,jm), INTENT(out) :: pxx, pyy, pzz |
---|
| 20 | c |
---|
| 21 | REAL, PARAMETER :: rpi = 3.141592653E0 |
---|
| 22 | REAL, PARAMETER :: rad = rpi / 180.0E0 |
---|
| 23 | c |
---|
| 24 | REAL, DIMENSION (im,jm) :: zsinlon, zcoslon |
---|
| 25 | REAL, DIMENSION (im,jm) :: zsinlat, zcoslat |
---|
| 26 | c |
---|
| 27 | LOGICAL, SAVE :: linit = .FALSE. |
---|
[766] | 28 | c$OMP THREADPRIVATE(linit) |
---|
[776] | 29 | |
---|
| 30 | cym utilise pour le couple, ne fonctionne que en MPI seul |
---|
[524] | 31 | c |
---|
[766] | 32 | cxxx IF ( .NOT. linit ) THEN |
---|
[524] | 33 | zsinlon = SIN (rad * plon) |
---|
| 34 | zcoslon = COS (rad * plon) |
---|
| 35 | zsinlat = SIN (rad * plat) |
---|
| 36 | zcoslat = COS (rad * plat) |
---|
| 37 | linit = .TRUE. |
---|
[766] | 38 | cxxx ENDIF |
---|
[524] | 39 | c |
---|
| 40 | pxx = - zsinlon * pte - zsinlat * zcoslon * ptn |
---|
| 41 | pyy = zcoslon * pte - zsinlat * zsinlon * ptn |
---|
| 42 | pzz = zcoslat * ptn |
---|
[766] | 43 | |
---|
[524] | 44 | c |
---|
| 45 | c Value at North Pole |
---|
[776] | 46 | IF (is_north_pole) THEN |
---|
[766] | 47 | pxx ( :, 1) = - ptn ( 1, 1) |
---|
| 48 | pyy ( :, 1) = - pte ( 1, 1) |
---|
| 49 | pzz ( :, 1) = 0.0 |
---|
| 50 | ENDIF |
---|
[524] | 51 | c Value at South Pole |
---|
[766] | 52 | |
---|
[776] | 53 | IF (is_south_pole) THEN |
---|
[766] | 54 | pxx ( :, jm) = + ptn ( 1, jm) |
---|
| 55 | pyy ( :, jm) = + pte ( 1, jm) |
---|
| 56 | pzz ( :, jm) = 0.0 |
---|
| 57 | ENDIF |
---|
| 58 | |
---|
[524] | 59 | RETURN |
---|
| 60 | END SUBROUTINE atm2geo |
---|