9 |
! Authors: L. Fairhead, Z. X. Li, P. Le Van |
! Authors: L. Fairhead, Z. X. Li, P. Le Van |
10 |
|
|
11 |
! This subroutine creates files containing boundary conditions. |
! This subroutine creates files containing boundary conditions. |
12 |
! It uses files with climatological data. |
! It uses files with climatological data. Both grids must be |
13 |
! Both grids must be regular. |
! regular. |
14 |
|
|
15 |
use conf_dat2d_m, only: conf_dat2d |
use conf_dat2d_m, only: conf_dat2d |
16 |
use dimens_m, only: iim, jjm |
use dimens_m, only: iim, jjm |
26 |
NF95_PUT_VAR |
NF95_PUT_VAR |
27 |
use netcdf, only: NF90_CLOBBER, NF90_FLOAT, NF90_GLOBAL, NF90_NOWRITE, & |
use netcdf, only: NF90_CLOBBER, NF90_FLOAT, NF90_GLOBAL, NF90_NOWRITE, & |
28 |
NF90_UNLIMITED |
NF90_UNLIMITED |
29 |
|
use nr_util, only: assert |
30 |
use numer_rec_95, only: spline, splint |
use numer_rec_95, only: spline, splint |
31 |
use start_init_orog_m, only: mask |
use start_init_orog_m, only: mask |
32 |
use unit_nml_m, only: unit_nml |
use unit_nml_m, only: unit_nml |
33 |
|
|
34 |
! Variables local to the procedure: |
! Local: |
35 |
|
|
36 |
LOGICAL:: extrap = .FALSE. |
LOGICAL:: extrap = .FALSE. |
37 |
! (extrapolation de donn\'ees, comme pour les SST lorsque le fichier |
! (extrapolation de donn\'ees, comme pour les SST lorsque le fichier |
248 |
call nf95_inq_dimid(ncid, "time", dimid) |
call nf95_inq_dimid(ncid, "time", dimid) |
249 |
call NF95_INQuire_DIMension(ncid, dimid, nclen=lmdep) |
call NF95_INQuire_DIMension(ncid, dimid, nclen=lmdep) |
250 |
print *, 'lmdep = ', lmdep |
print *, 'lmdep = ', lmdep |
251 |
!PM28/02/2002 : nouvelle coord temporelle fichiers AMIP pas en jours |
! Ici on suppose qu'on a 12 mois (de 30 jours). |
252 |
! Ici on suppose qu'on a 12 mois (de 30 jours). |
call assert(lmdep == 12, 'limit: AMIP file does not contain 12 months') |
|
IF (lmdep /= 12) stop 'Unknown AMIP file: not 12 months?' |
|
253 |
|
|
254 |
ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |
ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) |
255 |
IF(extrap) THEN |
IF (extrap) ALLOCATE(work(imdep, jmdep)) |
|
ALLOCATE(work(imdep, jmdep)) |
|
|
ENDIF |
|
256 |
ALLOCATE(dlon(imdep), dlat(jmdep)) |
ALLOCATE(dlon(imdep), dlat(jmdep)) |
257 |
call NF95_INQ_VARID(ncid, 'tosbcs', varid) |
call NF95_INQ_VARID(ncid, 'tosbcs', varid) |
258 |
|
|
259 |
DO l = 1, lmdep |
DO l = 1, lmdep |
260 |
call NF95_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) |
call NF95_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) |
261 |
CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) |
CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) |
262 |
IF (extrap) THEN |
IF (extrap) & |
263 |
CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work) |
CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work) |
|
ENDIF |
|
|
|
|
264 |
CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & |
CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & |
265 |
champtime(:, :, l)) |
champtime(:, :, l)) |
266 |
ENDDO |
ENDDO |
267 |
|
|
268 |
call NF95_CLOSE(ncid) |
call NF95_CLOSE(ncid) |
|
|
|
269 |
DEALLOCATE(dlon, dlat, champ) |
DEALLOCATE(dlon, dlat, champ) |
270 |
allocate(yder(lmdep)) |
allocate(yder(lmdep)) |
271 |
|
|
284 |
champan(iim + 1, :, :) = champan(1, :, :) |
champan(iim + 1, :, :) = champan(1, :, :) |
285 |
|
|
286 |
!IM14/03/2002 : SST amipbc greater then 271.38 |
!IM14/03/2002 : SST amipbc greater then 271.38 |
287 |
PRINT *, 'SUB. limit_netcdf.F IM : SST Amipbc >= 271.38 ' |
PRINT *, 'limit: SST Amipbc >= 271.38 ' |
288 |
|
|
289 |
DO k = 1, 360 |
DO k = 1, 360 |
290 |
DO j = 1, jjm + 1 |
DO j = 1, jjm + 1 |
291 |
DO i = 1, iim |
DO i = 1, iim |
292 |
champan(i, j, k) = amax1(champan(i, j, k), 271.38) |
champan(i, j, k) = max(champan(i, j, k), 271.38) |
293 |
ENDDO |
ENDDO |
294 |
|
|
295 |
champan(iim + 1, j, k) = champan(1, j, k) |
champan(iim + 1, j, k) = champan(1, j, k) |
296 |
ENDDO |
ENDDO |
297 |
ENDDO |
ENDDO |
298 |
|
|
299 |
forall (k = 1:360) phy_sst(:, k) = pack(champan(:, :, k), dyn_phy) |
forall (k = 1:360) phy_sst(:, k) = pack(champan(:, :, k), dyn_phy) |
300 |
|
|
301 |
PRINT *, "Traitement de l'albedo..." |
PRINT *, "Traitement de l'albedo..." |