1 |
module conf_dat2d_m |
module conf_dat2d_m |
2 |
|
|
|
! From conf_dat2d.F, version 1.2 2006/01/27 15:14:22 |
|
|
|
|
3 |
IMPLICIT NONE |
IMPLICIT NONE |
4 |
|
|
5 |
contains |
contains |
6 |
|
|
7 |
SUBROUTINE conf_dat2d(xd, yd, xf, yf, champd, interbar) |
SUBROUTINE conf_dat2d(xd, yd, xf, yf, champd, interbar) |
8 |
|
|
9 |
! Auteur : P. Le Van |
! From conf_dat2d.F, version 1.2 2006/01/27 15:14:22 |
10 |
|
! Author : P. Le Van |
11 |
|
|
12 |
! Ce sous-programme configure le champ de données 2D 'champd' et |
! Ce sous-programme configure le champ de données 2D 'champd' et |
13 |
! les longitudes et latitudes de telle façon qu'on ait - pi à pi |
! les longitudes et latitudes de telle façon qu'on ait - pi à pi |
26 |
! If required, the longitudes and latitudes are finally replaced |
! If required, the longitudes and latitudes are finally replaced |
27 |
! by their mid-values. |
! by their mid-values. |
28 |
|
|
29 |
use numer_rec, only: assert_eq |
use nr_util, only: assert_eq, pi |
|
use comconst, only: pi |
|
30 |
|
|
31 |
REAL, intent(in):: xd(:) |
REAL, intent(in):: xd(:) |
32 |
! (longitudes, in degrees or radians, in increasing order, from 0° |
! (longitudes, in degrees or radians, in increasing order, from 0° |
36 |
! (latitudes, in degrees or radians, in increasing or decreasing |
! (latitudes, in degrees or radians, in increasing or decreasing |
37 |
! order, from pole to pole) |
! order, from pole to pole) |
38 |
|
|
|
LOGICAL, intent(in), optional:: interbar |
|
39 |
REAL, intent(out):: xf(:), yf(:) ! longitudes and latitudes, in rad |
REAL, intent(out):: xf(:), yf(:) ! longitudes and latitudes, in rad |
40 |
REAL, intent(inout):: champd(:, :) |
REAL, intent(inout):: champd(:, :) |
41 |
|
LOGICAL, intent(in), optional:: interbar |
42 |
|
|
43 |
! Variables locales: |
! Local: |
|
|
|
44 |
INTEGER lons, lats |
INTEGER lons, lats |
45 |
LOGICAL radianlon ! "xd" is in degrees |
LOGICAL radianlon ! "xd" is in degrees |
46 |
logical invlon ! "xd" contains longitudes between 0 and 2 pi |
logical invlon ! "xd" contains longitudes between 0 and 2 pi |
103 |
end do |
end do |
104 |
|
|
105 |
xf(i:) = xf(i:) - 2 * pi |
xf(i:) = xf(i:) - 2 * pi |
106 |
xf(:) = cshift(xf, shift=i - 1) |
xf(:) = cshift(xf, shift = i - 1) |
107 |
champd(:, :) = cshift(champd, shift=i - 1) |
champd(:, :) = cshift(champd, shift = i - 1) |
108 |
ENDIF |
ENDIF |
109 |
|
|
110 |
IF (yd(1) < yd(lats)) THEN |
IF (yd(1) < yd(lats)) THEN |