[2429] | 1 | ! $Id: atm2geo.F90 5144 2024-07-29 21:01:04Z fhourdin $ |
---|
[5099] | 2 | |
---|
[5144] | 3 | SUBROUTINE atm2geo(im, jm, pte, ptn, plon, plat, pxx, pyy, pzz) |
---|
[1126] | 4 | USE dimphy |
---|
[5110] | 5 | USE lmdz_phys_para |
---|
[5116] | 6 | USE lmdz_grid_phy, ONLY: grid_type, unstructured, regular_lonlat |
---|
[5111] | 7 | USE lmdz_abort_physic, ONLY: abort_physic |
---|
[5144] | 8 | USE lmdz_yomcst |
---|
| 9 | |
---|
[1126] | 10 | IMPLICIT NONE |
---|
[3465] | 11 | |
---|
[5144] | 12 | CHARACTER (len = 6) :: clmodnam |
---|
| 13 | CHARACTER (len = 20) :: modname = 'atm2geo' |
---|
| 14 | CHARACTER (len = 80) :: abort_message |
---|
[3465] | 15 | |
---|
[5144] | 16 | ! Change wind local atmospheric coordinates to geocentric |
---|
[5099] | 17 | |
---|
[5144] | 18 | ! Geocentric : |
---|
| 19 | ! axe x is eastward : crosses (0 N, 0 E) point. |
---|
| 20 | ! axe y crosses (0 N, 90 E) point. |
---|
| 21 | ! axe z is 'up' : crosses north pole |
---|
| 22 | INTEGER, INTENT (IN) :: im, jm |
---|
| 23 | REAL, DIMENSION (im, jm), INTENT (IN) :: pte ! Eastward vector component |
---|
| 24 | REAL, DIMENSION (im, jm), INTENT (IN) :: ptn ! Northward vector component |
---|
| 25 | REAL, DIMENSION (im, jm), INTENT (IN) :: plon, plat |
---|
| 26 | REAL, DIMENSION (im, jm), INTENT(OUT) :: pxx, pyy, pzz ! Component in the geocentric referential |
---|
[3465] | 27 | REAL :: rad, reps |
---|
[776] | 28 | |
---|
[1126] | 29 | rad = rpi / 180.0E0 |
---|
[3465] | 30 | reps = 1.0e-5 |
---|
[1126] | 31 | |
---|
[5144] | 32 | pxx(:, :) = & |
---|
| 33 | - pte(:, :) * SIN(rad * plon(:, :)) & |
---|
| 34 | - ptn(:, :) * SIN(rad * plat(:, :)) * COS(rad * plon(:, :)) |
---|
| 35 | |
---|
| 36 | pyy(:, :) = & |
---|
| 37 | + pte(:, :) * COS(rad * plon(:, :)) & |
---|
| 38 | - ptn(:, :) * SIN(rad * plat(:, :)) * SIN(rad * plon(:, :)) |
---|
| 39 | |
---|
| 40 | pzz(:, :) = & |
---|
| 41 | + ptn(:, :) * COS(rad * plat (:, :)) |
---|
| 42 | |
---|
[3465] | 43 | IF (grid_type==regular_lonlat) THEN |
---|
[5144] | 44 | ! Value at North Pole |
---|
[3465] | 45 | IF (is_north_pole_dyn) THEN |
---|
[5144] | 46 | pxx(:, 1) = - pte (1, 1) |
---|
| 47 | pyy(:, 1) = - ptn (1, 1) |
---|
| 48 | pzz(:, 1) = pzz(1, 1) ! => 0 |
---|
[3465] | 49 | ENDIF |
---|
[1126] | 50 | |
---|
[5144] | 51 | ! Value at South Pole |
---|
[3465] | 52 | IF (is_south_pole_dyn) THEN |
---|
[5144] | 53 | pxx(:, jm) = pxx(1, jm) |
---|
| 54 | pyy(:, jm) = pyy(1, jm) |
---|
| 55 | pzz(:, jm) = pzz(1, jm) ! => 0 |
---|
[3465] | 56 | ENDIF |
---|
[5144] | 57 | |
---|
[3465] | 58 | ELSE IF (grid_type==unstructured) THEN |
---|
[5144] | 59 | ! Pole nord pour Dynamico |
---|
| 60 | WHERE (plat(:, :) >= 90.0d+0 - reps) |
---|
| 61 | pxx (:, :) = -ptn (:, :) |
---|
| 62 | pyy (:, :) = pte (:, :) |
---|
| 63 | pzz (:, :) = 0.0e0 |
---|
| 64 | END WHERE |
---|
[3465] | 65 | |
---|
| 66 | ELSE |
---|
[5144] | 67 | abort_message = 'Problem: unknown grid type' |
---|
| 68 | CALL abort_physic(modname, abort_message, 1) |
---|
[3465] | 69 | END IF |
---|
| 70 | |
---|
[1126] | 71 | END SUBROUTINE atm2geo |
---|