source: trunk/LMDZ.GENERIC/libf/phy_common/geometry_mod.F90 @ 2176

Last change on this file since 2176 was 1682, checked in by emillour, 8 years ago

All GCMs: set things up to enable pluging physics with dynamico

  • dyn3d
  • gcm.F90 : move I/O initialization (dates) to be done before physics

initialization

  • dyn3dpar
  • gcm.F : move I/O initialization (dates) to be done before physics

initialization

  • dynphy_lonlat:
  • inigeomphy_mod.F90 : add ind_cell_glo computation and transfer

to init_geometry

  • phy_common:
  • geometry_mod.F90 : add ind_cell_glo module variable to store global

column index

  • print_control_mod.F90 : make initialization occur via init_print_control_mod

to avoid circular module dependencies

  • init_print_control_mod.F90 : added to initialize print_control_mod module

variables

  • mod_phys_lmdz_mpi_data.F90 : use print_control_mod (rather than iniprint.h)
  • mod_phys_lmdz_para.F90 : use print_control_mod (rather than iniprint.h)
  • mod_phys_lmdz_omp_data.F90 : add is_omp_master (alias of is_omp_root) module

variable and use print_control_mod (rather than
iniprint.h)

  • physics_distribution_mod.F90 : add call to init_dimphy in

init_physics_distribution

  • xios_writefield.F90 : generic routine to output field with XIOS (for debug)
  • misc:
  • handle_err_m.F90 : call abort_physic, rather than abort_gcm
  • wxios.F90 : updates to enable unstructured grids

set module variable g_ctx_name to "LMDZ"
wxios_init(): remove call to wxios_context_init
wxios_context_init(): call xios_context_initialize with COMM_LMDZ_PHY
add routine wxios_set_context() to get handle and set context to XIOS
wxios_domain_param(): change arguments and generate the domain in-place
add wxios_domain_param_unstructured(): generate domain for unstructured case

NB: access is via "domain group" (whereas it is via "domain" in

wxios_domain_param)

  • dynphy_lonlat/phy[std|mars|venus|titan]:
  • iniphysiq_mod.F90 : Remove call to init_dimphy (which is now done in

phy_common/physics_distribution_mod.F90)

EM

File size: 2.7 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  INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:)      ! global index of a local cell
33!$OMP THREADPRIVATE(ind_cell_glo)
34
35CONTAINS
36
37  SUBROUTINE init_geometry(klon,longitude_,latitude_, &
38                           boundslon_,boundslat_, &
39                           cell_area_,ind_cell_glo_,dx_,dy_)
40  USE mod_grid_phy_lmdz, ONLY: nvertex
41  USE nrtype, ONLY : PI
42  IMPLICIT NONE
43    INTEGER,INTENT(IN) :: klon ! number of columns for this MPI/OpenMP domain
44    REAL,INTENT(IN) :: longitude_(klon)
45    REAL,INTENT(IN) :: latitude_(klon)
46    REAL,INTENT(IN) :: boundslon_(klon,nvertex)
47    REAL,INTENT(IN) :: boundslat_(klon,nvertex)
48    REAL,INTENT(IN) :: cell_area_(klon)
49    INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon)
50    REAL,OPTIONAL,INTENT(IN) :: dx_(klon)
51    REAL,OPTIONAL,INTENT(IN) :: dy_(klon)
52   
53    ALLOCATE(longitude(klon))
54    ALLOCATE(latitude(klon))
55    ALLOCATE(longitude_deg(klon))
56    ALLOCATE(latitude_deg(klon))
57    ALLOCATE(boundslon(klon,nvertex))
58    ALLOCATE(boundslat(klon,nvertex))
59    ALLOCATE(cell_area(klon))
60    IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon))
61    IF (PRESENT(dx_)) ALLOCATE(dx(klon))
62    IF (PRESENT(dy_))ALLOCATE(dy(klon))
63   
64    longitude(:) = longitude_(:)
65    latitude(:) = latitude_(:)
66    longitude_deg(:) = longitude(:)*180./PI
67    latitude_deg(:) = latitude(:)*180./PI
68    boundslon(:,:) = boundslon_(:,:)
69    boundslat(:,:) = boundslat_(:,:)
70    cell_area(:) = cell_area_(:)
71    IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:)
72    IF (PRESENT(dx_)) dx(:) = dx_(:)
73    IF (PRESENT(dy_)) dy(:) = dy_(:)
74   
75  END SUBROUTINE init_geometry
76
77
78END MODULE geometry_mod
79
Note: See TracBrowser for help on using the repository browser.