23 |
! The target vertical LMDZ grid is the grid of layer boundaries. |
! The target vertical LMDZ grid is the grid of layer boundaries. |
24 |
! Regridding in pressure is done by averaging a step function of pressure. |
! Regridding in pressure is done by averaging a step function of pressure. |
25 |
|
|
26 |
use dimens_m, only: iim, jjm, llm |
use dimensions, only: iim, jjm, llm |
27 |
use dimphy, only: klon |
use dimphy, only: klon |
28 |
use grid_change, only: dyn_phy |
use grid_change, only: gr_dyn_phy |
29 |
use netcdf95, only: nf95_inq_varid, nf95_get_var |
use netcdf95, only: nf95_inq_varid, nf95_get_var |
30 |
use nr_util, only: assert |
use nr_util, only: assert |
31 |
use numer_rec_95, only: regr1_step_av |
use numer_rec_95, only: regr1_step_av |
57 |
! longitude "xlon(i)", latitude "xlat(i)" and for pressure |
! longitude "xlon(i)", latitude "xlat(i)" and for pressure |
58 |
! interval "[press_in_edg(k), press_in_edg(k+1)]".) |
! interval "[press_in_edg(k), press_in_edg(k+1)]".) |
59 |
|
|
60 |
integer i, k |
integer i |
61 |
|
|
62 |
!-------------------------------------------- |
!-------------------------------------------- |
63 |
|
|
72 |
! "rlatu" is in descending order so we need to invert order: |
! "rlatu" is in descending order so we need to invert order: |
73 |
v1 = v1(jjm+1:1:-1, :) |
v1 = v1(jjm+1:1:-1, :) |
74 |
|
|
75 |
forall (k = 1:size(press_in_edg) - 1) v2(:, k) = pack(spread(v1(:, k), & |
v2 = gr_dyn_phy(spread(v1, dim = 1, ncopies = iim + 1)) |
|
dim = 1, ncopies = iim + 1), dyn_phy) |
|
76 |
|
|
77 |
! Regrid in pressure at each horizontal position: |
! Regrid in pressure at each horizontal position: |
78 |
do i = 1, klon |
do i = 1, klon |