/[lmdze]/trunk/dyn3d/limit.f
ViewVC logotype

Diff of /trunk/dyn3d/limit.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by guez, Mon Mar 31 12:24:17 2008 UTC revision 22 by guez, Fri Jul 31 15:18:47 2009 UTC
# Line 21  contains Line 21  contains
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, nf95_get_coord, NF95_CLOSE, NF95_DEF_DIM, &      use netcdf95, only: handle_err, nf95_gw_var, NF95_CLOSE, NF95_DEF_DIM, &
31           nf95_enddef, NF95_CREATE, nf95_inq_dimid, nf95_inquire_dimension, &           nf95_enddef, NF95_CREATE, nf95_inq_dimid, nf95_inquire_dimension, &
32           nf95_inq_varid, NF95_OPEN           nf95_inq_varid, NF95_OPEN
33      use netcdf, only: NF90_CLOBBER, nf90_def_var, NF90_FLOAT, NF90_GET_VAR, &      use netcdf, only: NF90_CLOBBER, nf90_def_var, NF90_FLOAT, NF90_GET_VAR, &
# Line 95  contains Line 95  contains
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      call nf95_get_coord(ncid, "longitude", dlon_ini)      ! Read coordinate variables:
99    
100        call nf95_inq_varid(ncid, "longitude", varid)
101        call nf95_gw_var(ncid, varid, dlon_ini)
102      imdep = size(dlon_ini)      imdep = size(dlon_ini)
103    
104      call nf95_get_coord(ncid, "latitude", dlat_ini)      call nf95_inq_varid(ncid, "latitude", varid)
105        call nf95_gw_var(ncid, varid, dlat_ini)
106      jmdep = size(dlat_ini)      jmdep = size(dlat_ini)
107    
108      call nf95_get_coord(ncid, "temps", timeyear)      call nf95_inq_varid(ncid, "temps", varid)
109        call nf95_gw_var(ncid, varid, timeyear)
110      lmdep = size(timeyear)      lmdep = size(timeyear)
111    
112      ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))      ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))
113      allocate(dlon(imdep), dlat(jmdep))      allocate(dlon(imdep), dlat(jmdep))
114      call NF95_INQ_VARID(ncid, 'RUGOS', varid)      call NF95_INQ_VARID(ncid, 'RUGOS', varid)
115    
116      ! Compute "champtime":      ! Read the primary variable day by day and regrid horizontally,
117        ! result in "champtime":
118      DO  l = 1, lmdep      DO  l = 1, lmdep
119         ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/))         ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/))
120         call handle_err("NF90_GET_VAR", ierr)         call handle_err("NF90_GET_VAR", ierr)
# Line 117  contains Line 123  contains
123         CALL inter_barxy(dlon, dlat(:jmdep -1), LOG(champ), rlonu(:iim), &         CALL inter_barxy(dlon, dlat(:jmdep -1), LOG(champ), rlonu(:iim), &
124              rlatv, champtime(:, :, l))              rlatv, champtime(:, :, l))
125         champtime(:, :, l) = EXP(champtime(:, :, l))         champtime(:, :, l) = EXP(champtime(:, :, l))
126         where (nint(masque(:iim, :)) /= 1) champtime(:, :, l) = 0.001         where (nint(mask(:iim, :)) /= 1) champtime(:, :, l) = 0.001
127      end do      end do
128    
129      call NF95_CLOSE(ncid)      call NF95_CLOSE(ncid)
# Line 125  contains Line 131  contains
131      DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini)      DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini)
132      allocate(yder(lmdep))      allocate(yder(lmdep))
133    
134        ! Interpolate monthly values to daily values, at each horizontal position:
135      DO j = 1, jjm + 1      DO j = 1, jjm + 1
136         DO i = 1, iim         DO i = 1, iim
137            yder(:) = SPLINE(timeyear, champtime(i, j, :))            yder(:) = SPLINE(timeyear, champtime(i, j, :))
# Line 144  contains Line 151  contains
151      PRINT *, 'Processing sea ice...'      PRINT *, 'Processing sea ice...'
152      call NF95_OPEN('amipbc_sic_1x1.nc', NF90_NOWRITE, ncid)      call NF95_OPEN('amipbc_sic_1x1.nc', NF90_NOWRITE, ncid)
153    
154      call nf95_get_coord(ncid, "longitude", dlon_ini)      call nf95_inq_varid(ncid, "longitude", varid)
155        call nf95_gw_var(ncid, varid, dlon_ini)
156      imdep = size(dlon_ini)      imdep = size(dlon_ini)
157    
158      call nf95_get_coord(ncid, "latitude", dlat_ini)      call nf95_inq_varid(ncid, "latitude", varid)
159        call nf95_gw_var(ncid, varid, dlat_ini)
160      jmdep = size(dlat_ini)      jmdep = size(dlat_ini)
161    
162      call nf95_inq_dimid(ncid, "time", dimid)      call nf95_inq_dimid(ncid, "time", dimid)
# Line 241  contains Line 250  contains
250      PRINT *, 'Traitement de la sst'      PRINT *, 'Traitement de la sst'
251      call NF95_OPEN('amipbc_sst_1x1.nc', NF90_NOWRITE, ncid)      call NF95_OPEN('amipbc_sst_1x1.nc', NF90_NOWRITE, ncid)
252    
253      call nf95_get_coord(ncid, "longitude", dlon_ini)      call nf95_inq_varid(ncid, "longitude", varid)
254        call nf95_gw_var(ncid, varid, dlon_ini)
255      imdep = size(dlon_ini)      imdep = size(dlon_ini)
256    
257      call nf95_get_coord(ncid, "latitude", dlat_ini)      call nf95_inq_varid(ncid, "latitude", varid)
258        call nf95_gw_var(ncid, varid, dlat_ini)
259      jmdep = size(dlat_ini)      jmdep = size(dlat_ini)
260    
261      call nf95_inq_dimid(ncid, "time", dimid)      call nf95_inq_dimid(ncid, "time", dimid)
# Line 310  contains Line 321  contains
321      PRINT *, 'Traitement de l albedo'      PRINT *, 'Traitement de l albedo'
322      call NF95_OPEN('Albedo.nc', NF90_NOWRITE, ncid)      call NF95_OPEN('Albedo.nc', NF90_NOWRITE, ncid)
323    
324      call nf95_get_coord(ncid, "longitude", dlon_ini)      call nf95_inq_varid(ncid, "longitude", varid)
325        call nf95_gw_var(ncid, varid, dlon_ini)
326      imdep = size(dlon_ini)      imdep = size(dlon_ini)
327    
328      call nf95_get_coord(ncid, "latitude", dlat_ini)      call nf95_inq_varid(ncid, "latitude", varid)
329        call nf95_gw_var(ncid, varid, dlat_ini)
330      jmdep = size(dlat_ini)      jmdep = size(dlat_ini)
331    
332      call nf95_get_coord(ncid, "temps", timeyear)      call nf95_inq_varid(ncid, "temps", varid)
333        call nf95_gw_var(ncid, varid, timeyear)
334      lmdep = size(timeyear)      lmdep = size(timeyear)
335    
336      ALLOCATE ( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))      ALLOCATE ( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))

Legend:
Removed from v.7  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.21