source: LMDZ6/branches/LMDZ-QUEST/libf/phylmd/geo2atm.F90 @ 3740

Last change on this file since 3740 was 2429, checked in by Laurent Fairhead, 9 years ago

Correction on the calculation of the surface of the grid at the poles (problem was introduced
in r2222).
Due to the different distribution of OMP tasks in the dynamics and the physics, had to
introduce 2 new logical variables, is_pole_north_phy and is_pole_south_phy, and so decided
to rename the old is_north_pole/is_south_pole to is_north_pole_dyn/is_south_pole_dyn to
stay coherent and, hopefully, clear things up a bit.
LF

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