source: trunk/LMDZ.MARS/libf/phy_common/geometry_mod.F90 @ 1621

Last change on this file since 1621 was 1543, checked in by emillour, 9 years ago

All models: Further adaptations to keep up with changes in LMDZ5 concerning
physics/dynamics separation:

  • dyn3d:
  • adapted gcm.F so that all physics initializations are now done in iniphysiq.
  • dyn3dpar:
  • adapted gcm.F so that all physics initializations are now done in iniphysiq.
  • updated calfis_p.F to follow up with changes.
  • copied over updated "bands.F90" from LMDZ5.
  • dynphy_lonlat:
  • calfis_p.F90, mod_interface_dyn_phys.F90, follow up of changes in phy_common/mod_* routines
  • phy_common:
  • added "geometry_mod.F90" to store information about the grid (replaces phy*/comgeomphy.F90) and give variables friendlier names: rlond => longitude , rlatd => latitude, airephy => cell_area, cuphy => dx , cvphy => dy
  • added "physics_distribution_mod.F90"
  • updated "mod_grid_phy_lmdz.F90", "mod_phys_lmdz_mpi_data.F90", "mod_phys_lmdz_para.F90", "mod_phys_lmdz_mpi_transfert.F90", "mod_grid_phy_lmdz.F90", "mod_phys_lmdz_omp_data.F90", "mod_phys_lmdz_omp_transfert.F90", "write_field_phy.F90" and "ioipsl_getin_p_mod.F90" to LMDZ5 versions.
  • phy[venus/titan/mars/std]:
  • removed "init_phys_lmdz.F90", "comgeomphy.F90"; adapted routines to use geometry_mod (longitude, latitude, cell_area, etc.)

EM

File size: 2.3 KB
Line 
1MODULE geometry_mod
2
3! Store informations concerning the local (to MPI/OpenMP core) geometry
4
5  REAL,SAVE,ALLOCATABLE :: longitude(:) ! longitude of the cell (rad)
6!$OMP THREADPRIVATE(longitude)
7
8  REAL,SAVE,ALLOCATABLE :: latitude(:)! latitude of the cell (rad)
9!$OMP THREADPRIVATE(latitude)
10
11  REAL,SAVE,ALLOCATABLE :: longitude_deg(:) ! longitude of the cell (degree)
12!$OMP THREADPRIVATE(longitude_deg)
13
14  REAL,SAVE,ALLOCATABLE :: latitude_deg(:)! latitude of the cell (degree)
15!$OMP THREADPRIVATE(latitude_deg)
16
17  REAL,SAVE,ALLOCATABLE :: boundslon(:,:)  ! boundaries of the cell (rad)
18!$OMP THREADPRIVATE(boundslon)
19
20  REAL,SAVE,ALLOCATABLE :: boundslat(:,:) ! boundaries of the cell (rad)
21!$OMP THREADPRIVATE(boundslat)
22
23  REAL,SAVE,ALLOCATABLE :: dx(:)      ! resolution of longitude cell (valid only for 2D grid)
24!$OMP THREADPRIVATE(dx)
25 
26  REAL,SAVE,ALLOCATABLE :: dy(:)      ! resolution of latitude cell (valid only for 2D grid)
27!$OMP THREADPRIVATE(dy)
28
29  REAL,SAVE,ALLOCATABLE :: cell_area(:)      ! area of the cell
30!$OMP THREADPRIVATE(cell_area)
31
32
33CONTAINS
34
35  SUBROUTINE init_geometry(klon,longitude_,latitude_, &
36                           boundslon_,boundslat_, &
37                           cell_area_,dx_,dy_)
38  USE mod_grid_phy_lmdz, ONLY: nvertex
39  USE nrtype, ONLY : PI
40  IMPLICIT NONE
41    INTEGER,INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
42    REAL,INTENT(IN) :: longitude_(klon)
43    REAL,INTENT(IN) :: latitude_(klon)
44    REAL,INTENT(IN) :: boundslon_(klon,nvertex)
45    REAL,INTENT(IN) :: boundslat_(klon,nvertex)
46    REAL,INTENT(IN) :: cell_area_(klon)
47    REAL,OPTIONAL,INTENT(IN) :: dx_(klon)
48    REAL,OPTIONAL,INTENT(IN) :: dy_(klon)
49   
50    ALLOCATE(longitude(klon))
51    ALLOCATE(latitude(klon))
52    ALLOCATE(longitude_deg(klon))
53    ALLOCATE(latitude_deg(klon))
54    ALLOCATE(boundslon(klon,nvertex))
55    ALLOCATE(boundslat(klon,nvertex))
56    ALLOCATE(cell_area(klon))
57    IF (PRESENT(dx_)) ALLOCATE(dx(klon))
58    IF (PRESENT(dy_))ALLOCATE(dy(klon))
59   
60    longitude(:) = longitude_(:)
61    latitude(:) = latitude_(:)
62    longitude_deg(:) = longitude(:)*180./PI
63    latitude_deg(:) = latitude(:)*180./PI
64    boundslon(:,:) = boundslon_(:,:)
65    boundslat(:,:) = boundslat_(:,:)
66    cell_area(:) = cell_area_(:)
67    IF (PRESENT(dx_)) dx(:) = dx_(:)
68    IF (PRESENT(dy_)) dy(:) = dy_(:)
69   
70  END SUBROUTINE init_geometry
71
72
73END MODULE geometry_mod
74
Note: See TracBrowser for help on using the repository browser.