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 interpolation, only: spline, splint |
use numer_rec, only: spline, splint |
28 |
use grid_change, only: dyn_phy |
use grid_change, only: dyn_phy |
29 |
|
|
30 |
use netcdf95, only: handle_err, coordin, & |
use netcdf95, only: handle_err, nf95_get_coord, NF95_CLOSE, NF95_DEF_DIM, & |
31 |
NF90_CLOBBER, NF95_CLOSE, NF95_DEF_DIM, nf90_def_var, nf95_enddef, & |
nf95_enddef, NF95_CREATE, nf95_inq_dimid, nf95_inquire_dimension, & |
32 |
NF90_FLOAT, NF90_GET_VAR, NF90_GLOBAL, NF90_NOWRITE, NF90_PUT_ATT, & |
nf95_inq_varid, NF95_OPEN |
33 |
NF90_PUT_VAR, NF90_UNLIMITED, & |
use netcdf, only: NF90_CLOBBER, nf90_def_var, NF90_FLOAT, NF90_GET_VAR, & |
34 |
NF95_CREATE, nf95_inq_dimid, nf95_inquire_dimension, nf95_inq_varid, & |
NF90_GLOBAL, NF90_NOWRITE, NF90_PUT_ATT, NF90_PUT_VAR, & |
35 |
nf95_open |
NF90_UNLIMITED |
36 |
|
|
37 |
! Variables local to the procedure: |
! Variables local to the procedure: |
38 |
|
|
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 |
dlon_ini => coordin(ncid, "longitude") |
! Read coordinate variables: |
99 |
|
|
100 |
|
call nf95_get_coord(ncid, "longitude", dlon_ini) |
101 |
imdep = size(dlon_ini) |
imdep = size(dlon_ini) |
102 |
|
|
103 |
dlat_ini => coordin(ncid, "latitude") |
call nf95_get_coord(ncid, "latitude", dlat_ini) |
104 |
jmdep = size(dlat_ini) |
jmdep = size(dlat_ini) |
105 |
|
|
106 |
timeyear => coordin(ncid, "temps") |
call nf95_get_coord(ncid, "temps", timeyear) |
107 |
lmdep = size(timeyear) |
lmdep = size(timeyear) |
108 |
|
|
109 |
ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |
ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |
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, :)) |
148 |
PRINT *, 'Processing sea ice...' |
PRINT *, 'Processing sea ice...' |
149 |
call NF95_OPEN('amipbc_sic_1x1.nc', NF90_NOWRITE, ncid) |
call NF95_OPEN('amipbc_sic_1x1.nc', NF90_NOWRITE, ncid) |
150 |
|
|
151 |
dlon_ini => coordin(ncid, "longitude") |
call nf95_get_coord(ncid, "longitude", dlon_ini) |
152 |
imdep = size(dlon_ini) |
imdep = size(dlon_ini) |
153 |
|
|
154 |
dlat_ini => coordin(ncid, "latitude") |
call nf95_get_coord(ncid, "latitude", dlat_ini) |
155 |
jmdep = size(dlat_ini) |
jmdep = size(dlat_ini) |
156 |
|
|
157 |
call nf95_inq_dimid(ncid, "time", dimid) |
call nf95_inq_dimid(ncid, "time", dimid) |
245 |
PRINT *, 'Traitement de la sst' |
PRINT *, 'Traitement de la sst' |
246 |
call NF95_OPEN('amipbc_sst_1x1.nc', NF90_NOWRITE, ncid) |
call NF95_OPEN('amipbc_sst_1x1.nc', NF90_NOWRITE, ncid) |
247 |
|
|
248 |
dlon_ini => coordin(ncid, "longitude") |
call nf95_get_coord(ncid, "longitude", dlon_ini) |
249 |
imdep = size(dlon_ini) |
imdep = size(dlon_ini) |
250 |
|
|
251 |
dlat_ini => coordin(ncid, "latitude") |
call nf95_get_coord(ncid, "latitude", dlat_ini) |
252 |
jmdep = size(dlat_ini) |
jmdep = size(dlat_ini) |
253 |
|
|
254 |
call nf95_inq_dimid(ncid, "time", dimid) |
call nf95_inq_dimid(ncid, "time", dimid) |
314 |
PRINT *, 'Traitement de l albedo' |
PRINT *, 'Traitement de l albedo' |
315 |
call NF95_OPEN('Albedo.nc', NF90_NOWRITE, ncid) |
call NF95_OPEN('Albedo.nc', NF90_NOWRITE, ncid) |
316 |
|
|
317 |
dlon_ini => coordin(ncid, "longitude") |
call nf95_get_coord(ncid, "longitude", dlon_ini) |
318 |
imdep = size(dlon_ini) |
imdep = size(dlon_ini) |
319 |
|
|
320 |
dlat_ini => coordin(ncid, "latitude") |
call nf95_get_coord(ncid, "latitude", dlat_ini) |
321 |
jmdep = size(dlat_ini) |
jmdep = size(dlat_ini) |
322 |
|
|
323 |
timeyear => coordin(ncid, "temps") |
call nf95_get_coord(ncid, "temps", timeyear) |
324 |
lmdep = size(timeyear) |
lmdep = size(timeyear) |
325 |
|
|
326 |
ALLOCATE ( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |
ALLOCATE ( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |