[1072] | 1 | ! |
---|
| 2 | ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/geo2atm.F90,v 1.1 2008-12-05 17:56:40 lsce Exp $ |
---|
| 3 | ! |
---|
| 4 | SUBROUTINE geo2atm(im, jm, px, py, pz, plon, plat, pu, pv, pr) |
---|
| 5 | USE dimphy |
---|
| 6 | USE mod_phys_lmdz_para |
---|
[1126] | 7 | |
---|
[1072] | 8 | IMPLICIT NONE |
---|
[1126] | 9 | INCLUDE 'dimensions.h' |
---|
| 10 | INCLUDE 'YOMCST.h' |
---|
[1072] | 11 | |
---|
[1126] | 12 | ! Change wind coordinates from cartesian geocentric to local spherical |
---|
[1072] | 13 | ! NB! Fonctionne probablement uniquement en MPI seul (sans OpenMP) |
---|
| 14 | ! |
---|
| 15 | INTEGER, INTENT (IN) :: im, jm |
---|
| 16 | REAL, DIMENSION (im,jm), INTENT(IN) :: px, py, pz |
---|
| 17 | REAL, DIMENSION (im,jm), INTENT(IN) :: plon, plat |
---|
| 18 | REAL, DIMENSION (im,jm), INTENT(OUT) :: pu, pv, pr |
---|
| 19 | |
---|
[1126] | 20 | REAL :: rad |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | rad = rpi / 180.0E0 |
---|
[1072] | 24 | |
---|
[1126] | 25 | pu(:,:) = & |
---|
| 26 | - px(:,:) * SIN(rad * plon(:,:)) & |
---|
| 27 | + py(:,:) * COS(rad * plon(:,:)) |
---|
[1072] | 28 | |
---|
[1126] | 29 | pv(:,:) = & |
---|
| 30 | - px(:,:) * SIN(rad * plat(:,:)) * COS(rad * plon(:,:)) & |
---|
| 31 | - py(:,:) * SIN(rad * plat(:,:)) * SIN(rad * plon(:,:)) & |
---|
| 32 | + pz(:,:) * COS(rad * plat(:,:)) |
---|
[1072] | 33 | |
---|
[1126] | 34 | pr(:,:) = & |
---|
| 35 | + px(:,:) * COS(rad * plat(:,:)) * COS(rad * plon(:,:)) & |
---|
| 36 | + py(:,:) * COS(rad * plat(:,:)) * SIN(rad * plon(:,:)) & |
---|
| 37 | + pz(:,:) * SIN(rad * plat(:,:)) |
---|
[1072] | 38 | |
---|
[1126] | 39 | ! Value at North Pole |
---|
[1072] | 40 | IF (is_north_pole) THEN |
---|
[1126] | 41 | pu(:, 1) = pu(1, 1) |
---|
| 42 | pv(:, 1) = pv(1, 1) |
---|
| 43 | pr(:, 1) = pr(1, 1) |
---|
[1072] | 44 | ENDIF |
---|
[1126] | 45 | |
---|
| 46 | ! Value at South Pole |
---|
[1072] | 47 | IF (is_south_pole) THEN |
---|
[1126] | 48 | pu(:,jm) = pu(1,jm) |
---|
| 49 | pv(:,jm) = pv(1,jm) |
---|
| 50 | pr(:,jm) = pr(1,jm) |
---|
[1072] | 51 | ENDIF |
---|
[1126] | 52 | |
---|
[1072] | 53 | END SUBROUTINE geo2atm |
---|