| Directory: | ./ |
|---|---|
| File: | phy_common/geometry_mod.f90 |
| Date: | 2022-01-11 19:19:34 |
| Exec | Total | Coverage | |
|---|---|---|---|
| Lines: | 24 | 24 | 100.0% |
| Branches: | 60 | 96 | 62.5% |
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | MODULE 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 indice of a local cell | ||
| 33 | !$OMP THREADPRIVATE(ind_cell_glo) | ||
| 34 | |||
| 35 | CONTAINS | ||
| 36 | |||
| 37 | 2 | SUBROUTINE init_geometry(klon,longitude_,latitude_, & | |
| 38 | 1 | boundslon_,boundslat_, & | |
| 39 | 3 | 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 |
3/6✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
|
1 | ALLOCATE(longitude(klon)) |
| 54 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | ALLOCATE(latitude(klon)) |
| 55 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | ALLOCATE(longitude_deg(klon)) |
| 56 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | ALLOCATE(latitude_deg(klon)) |
| 57 |
5/10✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 times.
|
2 | ALLOCATE(boundslon(klon,nvertex)) |
| 58 |
4/8✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
|
2 | ALLOCATE(boundslat(klon,nvertex)) |
| 59 |
2/4✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
|
1 | ALLOCATE(cell_area(klon)) |
| 60 |
4/8✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
|
1 | IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) |
| 61 |
3/6✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
|
1 | IF (PRESENT(dx_)) ALLOCATE(dx(klon)) |
| 62 |
3/6✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
|
1 | IF (PRESENT(dy_))ALLOCATE(dy(klon)) |
| 63 | |||
| 64 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 994 times.
|
995 | longitude(:) = longitude_(:) |
| 65 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 994 times.
|
995 | latitude(:) = latitude_(:) |
| 66 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 994 times.
|
995 | longitude_deg(:) = longitude(:)*180./PI |
| 67 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 994 times.
|
995 | latitude_deg(:) = latitude(:)*180./PI |
| 68 |
4/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 3976 times.
✓ Branch 3 taken 4 times.
|
3981 | boundslon(:,:) = boundslon_(:,:) |
| 69 |
4/4✓ Branch 0 taken 1 times.
✓ Branch 1 taken 4 times.
✓ Branch 2 taken 3976 times.
✓ Branch 3 taken 4 times.
|
3981 | boundslat(:,:) = boundslat_(:,:) |
| 70 |
2/2✓ Branch 0 taken 994 times.
✓ Branch 1 taken 1 times.
|
995 | cell_area(:) = cell_area_(:) |
| 71 |
3/4✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 994 times.
✓ Branch 3 taken 1 times.
|
995 | IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) |
| 72 |
3/4✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 994 times.
✓ Branch 3 taken 1 times.
|
995 | IF (PRESENT(dx_)) dx(:) = dx_(:) |
| 73 |
3/4✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 994 times.
✓ Branch 3 taken 1 times.
|
995 | IF (PRESENT(dy_)) dy(:) = dy_(:) |
| 74 | |||
| 75 |
3/6✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
|
3 | END SUBROUTINE init_geometry |
| 76 | |||
| 77 | |||
| 78 | END MODULE geometry_mod | ||
| 79 | |||
| 80 |