source: LMDZ6/branches/Ocean_skin/libf/phylmd/atm2geo.F90 @ 3747

Last change on this file since 3747 was 3605, checked in by lguez, 5 years ago

Merge revisions 3427:3600 of trunk into branch Ocean_skin

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.0 KB
RevLine 
[524]1!
[2429]2! $Id: atm2geo.F90 3605 2019-11-21 15:43:45Z lguez $
[524]3!
[1126]4SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz )
5  USE dimphy
6  USE mod_phys_lmdz_para
[3605]7  USE mod_grid_phy_lmdz, only: grid_type, unstructured, regular_lonlat
[1126]8  IMPLICIT NONE
9  INCLUDE 'YOMCST.h'
[3605]10
11  CHARACTER (len = 6)                :: clmodnam
12  CHARACTER (len = 20)               :: modname = 'atm2geo'
13  CHARACTER (len = 80)               :: abort_message
14
[1126]15!
16! Change wind local atmospheric coordinates to geocentric
17!
[3605]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
[1126]22  INTEGER, INTENT (in)                 :: im, jm
[3605]23  REAL, DIMENSION (im,jm), INTENT (in) :: pte  ! Eastward vector component
24  REAL, DIMENSION (im,jm), INTENT (in) :: ptn  ! Northward vector component
[1126]25  REAL, DIMENSION (im,jm), INTENT (in) :: plon, plat
[3605]26  REAL, DIMENSION (im,jm), INTENT(out) :: pxx, pyy, pzz  ! Component in the geocentric referential
27  REAL :: rad, reps
[776]28
[1126]29  rad = rpi / 180.0E0
[3605]30  reps = 1.0e-5
[1126]31 
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 
[3605]43  IF (grid_type==regular_lonlat) THEN
44  ! Value at North Pole 
45    IF (is_north_pole_dyn) THEN
46       pxx(:, 1) = - pte (1, 1)
47       pyy(:, 1) = - ptn (1, 1)
48       pzz(:, 1) = pzz(1,1) ! => 0
49    ENDIF
[1126]50
[3605]51  ! Value at South Pole
52    IF (is_south_pole_dyn) THEN
53      pxx(:,jm) = pxx(1,jm)
54       pyy(:,jm) = pyy(1,jm)
55       pzz(:,jm) = pzz(1,jm) ! => 0
56    ENDIF
57 
58  ELSE IF (grid_type==unstructured) THEN
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
65
66  ELSE
67     abort_message='Problem: unknown grid type'
68     CALL abort_physic(modname,abort_message,1)
69  END IF
70
[1126]71 
72END SUBROUTINE atm2geo
Note: See TracBrowser for help on using the repository browser.