1 |
module regr_pr_int_m |
module regr_pr_int_m |
2 |
|
|
3 |
|
! Author: Lionel GUEZ |
4 |
|
|
5 |
implicit none |
implicit none |
6 |
|
|
7 |
contains |
contains |
19 |
! that the input data is already on the LMDZ "rlatu" latitude |
! that the input data is already on the LMDZ "rlatu" latitude |
20 |
! grid. |
! grid. |
21 |
|
|
22 |
! The target vertical LMDZ grid is the grid of mid-layers. |
! The target vertical LMDZ grid is the grid of mid-layers. The |
23 |
! The input data does not depend on longitude, but the pressure |
! input data does not depend on longitude, but the pressure at |
24 |
! at LMDZ mid-layers does. |
! LMDZ mid-layers does. Therefore, the values on the LMDZ grid do |
25 |
! Therefore, the values on the LMDZ grid do depend on longitude. |
! depend on longitude. Regridding is by linear interpolation. |
|
! Regridding is by linear interpolation. |
|
26 |
|
|
27 |
use dimens_m, only: iim, jjm, llm |
use dimensions, only: iim, jjm, llm |
28 |
use dimphy, only: klon |
use dimphy, only: klon |
29 |
use grid_change, only: dyn_phy |
use grid_change, only: gr_dyn_phy |
30 |
use netcdf95, only: nf95_inq_varid, nf95_get_var |
use netcdf95, only: nf95_inq_varid, nf95_get_var |
31 |
use nr_util, only: assert |
use nr_util, only: assert |
32 |
use numer_rec_95, only: regr1_lint |
use numer_rec_95, only: regr1_lint |
58 |
! Field on the "physics" horizontal grid. "v2(i, k >= 1)" is at |
! Field on the "physics" horizontal grid. "v2(i, k >= 1)" is at |
59 |
! longitude "xlon(i)", latitude "xlat(i)" and pressure "plev(k)".) |
! longitude "xlon(i)", latitude "xlat(i)" and pressure "plev(k)".) |
60 |
|
|
61 |
integer i, k |
integer i |
62 |
|
|
63 |
!-------------------------------------------- |
!-------------------------------------------- |
64 |
|
|
75 |
! Complete "v1" with the value at 0 pressure: |
! Complete "v1" with the value at 0 pressure: |
76 |
v1(:, 0) = top_value |
v1(:, 0) = top_value |
77 |
|
|
78 |
forall (k = 0:size(plev)) v2(:, k) = pack(spread(v1(:, k), dim = 1, & |
v2 = gr_dyn_phy(spread(v1, dim = 1, ncopies = iim + 1)) |
|
ncopies = iim + 1), dyn_phy) |
|
79 |
|
|
80 |
! Regrid in pressure at each horizontal position: |
! Regrid in pressure at each horizontal position: |
81 |
do i = 1, klon |
do i = 1, klon |