21 |
use conf_gcm_m, only: day_step |
use conf_gcm_m, only: day_step |
22 |
use comgeom, only: rlonu, rlatv |
use comgeom, only: rlonu, rlatv |
23 |
use etat0_mod, only: pctsrf |
use etat0_mod, only: pctsrf |
24 |
use start_init_orog_m, only: masque |
use start_init_orog_m, only: mask |
25 |
use conf_dat2d_m, only: conf_dat2d |
use conf_dat2d_m, only: conf_dat2d |
26 |
use inter_barxy_m, only: inter_barxy |
use inter_barxy_m, only: inter_barxy |
27 |
use numer_rec, only: spline, splint |
use numer_rec, only: spline, splint |
95 |
PRINT *, 'Processing rugosity...' |
PRINT *, 'Processing rugosity...' |
96 |
call NF95_OPEN('Rugos.nc', NF90_NOWRITE, ncid) |
call NF95_OPEN('Rugos.nc', NF90_NOWRITE, ncid) |
97 |
|
|
98 |
|
! Read coordinate variables: |
99 |
|
|
100 |
call nf95_get_coord(ncid, "longitude", dlon_ini) |
call nf95_get_coord(ncid, "longitude", dlon_ini) |
101 |
imdep = size(dlon_ini) |
imdep = size(dlon_ini) |
102 |
|
|
110 |
allocate(dlon(imdep), dlat(jmdep)) |
allocate(dlon(imdep), dlat(jmdep)) |
111 |
call NF95_INQ_VARID(ncid, 'RUGOS', varid) |
call NF95_INQ_VARID(ncid, 'RUGOS', varid) |
112 |
|
|
113 |
! Compute "champtime": |
! Read the primary variable day by day and regrid horizontally, |
114 |
|
! result in "champtime": |
115 |
DO l = 1, lmdep |
DO l = 1, lmdep |
116 |
ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) |
ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) |
117 |
call handle_err("NF90_GET_VAR", ierr) |
call handle_err("NF90_GET_VAR", ierr) |
120 |
CALL inter_barxy(dlon, dlat(:jmdep -1), LOG(champ), rlonu(:iim), & |
CALL inter_barxy(dlon, dlat(:jmdep -1), LOG(champ), rlonu(:iim), & |
121 |
rlatv, champtime(:, :, l)) |
rlatv, champtime(:, :, l)) |
122 |
champtime(:, :, l) = EXP(champtime(:, :, l)) |
champtime(:, :, l) = EXP(champtime(:, :, l)) |
123 |
where (nint(masque(:iim, :)) /= 1) champtime(:, :, l) = 0.001 |
where (nint(mask(:iim, :)) /= 1) champtime(:, :, l) = 0.001 |
124 |
end do |
end do |
125 |
|
|
126 |
call NF95_CLOSE(ncid) |
call NF95_CLOSE(ncid) |
128 |
DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini) |
DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini) |
129 |
allocate(yder(lmdep)) |
allocate(yder(lmdep)) |
130 |
|
|
131 |
|
! Interpolate monthly values to daily values, at each horizontal position: |
132 |
DO j = 1, jjm + 1 |
DO j = 1, jjm + 1 |
133 |
DO i = 1, iim |
DO i = 1, iim |
134 |
yder(:) = SPLINE(timeyear, champtime(i, j, :)) |
yder(:) = SPLINE(timeyear, champtime(i, j, :)) |