/[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 97 by guez, Fri Apr 25 14:58:31 2014 UTC revision 98 by guez, Tue May 13 17:23:16 2014 UTC
# Line 20  contains Line 20  contains
20      use grid_change, only: dyn_phy      use grid_change, only: dyn_phy
21      use indicesol, only: epsfra, nbsrf, is_ter, is_oce, is_lic, is_sic      use indicesol, only: epsfra, nbsrf, is_ter, is_oce, is_lic, is_sic
22      use inter_barxy_m, only: inter_barxy      use inter_barxy_m, only: inter_barxy
23      use netcdf95, only: handle_err, NF95_CLOSE, NF95_CREATE, NF95_DEF_DIM, &      use netcdf95, only: NF95_CLOSE, NF95_CREATE, NF95_DEF_DIM, nf95_def_var, &
24           nf95_enddef, nf95_get_var, nf95_gw_var, nf95_inq_dimid, &           nf95_enddef, nf95_get_var, nf95_gw_var, nf95_inq_dimid, &
25           nf95_inq_varid, nf95_inquire_dimension, NF95_OPEN           nf95_inq_varid, nf95_inquire_dimension, NF95_OPEN, NF95_PUT_ATT, &
26      use netcdf, only: NF90_CLOBBER, nf90_def_var, NF90_FLOAT, NF90_GLOBAL, &           NF95_PUT_VAR
27           NF90_NOWRITE, NF90_PUT_ATT, NF90_PUT_VAR, NF90_UNLIMITED      use netcdf, only: NF90_CLOBBER, NF90_FLOAT, NF90_GLOBAL, NF90_NOWRITE, &
28             NF90_UNLIMITED
29      use numer_rec_95, only: spline, splint      use numer_rec_95, only: spline, splint
30      use start_init_orog_m, only: mask      use start_init_orog_m, only: mask
31      use unit_nml_m, only: unit_nml      use unit_nml_m, only: unit_nml
# Line 58  contains Line 59  contains
59      ! Pour l'inteprolation verticale :      ! Pour l'inteprolation verticale :
60      REAL, allocatable:: yder(:)      REAL, allocatable:: yder(:)
61    
     INTEGER ierr  
   
62      INTEGER nid, ndim, ntim      INTEGER nid, ndim, ntim
     INTEGER dims(2), debut(2)  
63      INTEGER id_tim      INTEGER id_tim
64      INTEGER id_SST, id_BILS, id_RUG, id_ALB      INTEGER id_SST, id_BILS, id_RUG, id_ALB
65      INTEGER id_FOCE, id_FSIC, id_FTER, id_FLIC      INTEGER id_FOCE, id_FSIC, id_FTER, id_FLIC
# Line 78  contains Line 76  contains
76      print *, "Call sequence information: limit"      print *, "Call sequence information: limit"
77    
78      print *, "Enter namelist 'limit_nml'."      print *, "Enter namelist 'limit_nml'."
79      read (unit=*, nml=limit_nml)      read(unit=*, nml=limit_nml)
80      write(unit_nml, nml=limit_nml)      write(unit_nml, nml=limit_nml)
81    
82      PRINT *, 'Processing rugosity...'      PRINT *, 'Processing rugosity...'
# Line 158  contains Line 156  contains
156      end IF      end IF
157    
158      ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))      ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))
159      ALLOCATE (dlon(imdep), dlat(jmdep))      ALLOCATE(dlon(imdep), dlat(jmdep))
160      call NF95_INQ_VARID(ncid, 'sicbcs', varid)      call NF95_INQ_VARID(ncid, 'sicbcs', varid)
161      DO l = 1, lmdep      DO l = 1, lmdep
162         call NF95_GET_VAR(ncid, varid, champ, start=(/1, 1, l/))         call NF95_GET_VAR(ncid, varid, champ, start=(/1, 1, l/))
163         CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ)         CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ)
164         CALL inter_barxy (dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, &         CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, &
165              champtime(:, :, l))              champtime(:, :, l))
166      ENDDO      ENDDO
167    
# Line 255  contains Line 253  contains
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)  THEN
256         ALLOCATE (work(imdep, jmdep))         ALLOCATE(work(imdep, jmdep))
257      ENDIF      ENDIF
258      ALLOCATE(dlon(imdep), dlat(jmdep))      ALLOCATE(dlon(imdep), dlat(jmdep))
259      call NF95_INQ_VARID(ncid, 'tosbcs', varid)      call NF95_INQ_VARID(ncid, 'tosbcs', varid)
# Line 267  contains Line 265  contains
265            CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work)            CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work)
266         ENDIF         ENDIF
267    
268         CALL inter_barxy (dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, &         CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, &
269              champtime(:, :, l))              champtime(:, :, l))
270      ENDDO      ENDDO
271    
# Line 317  contains Line 315  contains
315      call nf95_gw_var(ncid, varid, timeyear)      call nf95_gw_var(ncid, varid, timeyear)
316      lmdep = size(timeyear)      lmdep = size(timeyear)
317    
318      ALLOCATE (champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))      ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep))
319      ALLOCATE (dlon(imdep), dlat(jmdep))      ALLOCATE(dlon(imdep), dlat(jmdep))
320      call NF95_INQ_VARID(ncid, 'ALBEDO', varid)      call NF95_INQ_VARID(ncid, 'ALBEDO', varid)
321    
322      DO l = 1, lmdep      DO l = 1, lmdep
# Line 355  contains Line 353  contains
353         ENDDO         ENDDO
354      ENDDO      ENDDO
355    
356      PRINT *, 'Ecriture du fichier limit'      PRINT *, 'Ecriture du fichier limit.nc...'
357    
358      call NF95_CREATE("limit.nc", NF90_CLOBBER, nid)      call NF95_CREATE("limit.nc", NF90_CLOBBER, nid)
359    
360      ierr = NF90_PUT_ATT(nid, NF90_GLOBAL, "title", &      call NF95_PUT_ATT(nid, NF90_GLOBAL, "title", &
361           "Fichier conditions aux limites")           "Fichier conditions aux limites")
362      call NF95_DEF_DIM (nid, "points_physiques", klon, ndim)      call NF95_DEF_DIM(nid, "points_physiques", klon, ndim)
363      call NF95_DEF_DIM (nid, "time", NF90_UNLIMITED, ntim)      call NF95_DEF_DIM(nid, "time", NF90_UNLIMITED, ntim)
   
     dims(1) = ndim  
     dims(2) = ntim  
364    
365      ierr = NF90_DEF_VAR (nid, "TEMPS", NF90_FLOAT, ntim, id_tim)      call NF95_DEF_VAR(nid, "TEMPS", NF90_FLOAT, ntim, id_tim)
366      ierr = NF90_PUT_ATT (nid, id_tim, "title", "Jour dans l annee")      call NF95_PUT_ATT(nid, id_tim, "title", "Jour dans l annee")
     ierr = NF90_DEF_VAR (nid, "FOCE", NF90_FLOAT, dims, id_FOCE)  
     ierr = NF90_PUT_ATT (nid, id_FOCE, "title", "Fraction ocean")  
367    
368      ierr = NF90_DEF_VAR (nid, "FSIC", NF90_FLOAT, dims, id_FSIC)      call NF95_DEF_VAR(nid, "FOCE", NF90_FLOAT, dimids=(/ndim, ntim/), &
369      ierr = NF90_PUT_ATT (nid, id_FSIC, "title", "Fraction glace de mer")           varid=id_foce)
370        call NF95_PUT_ATT(nid, id_FOCE, "title", "Fraction ocean")
371      ierr = NF90_DEF_VAR (nid, "FTER", NF90_FLOAT, dims, id_FTER)  
372      ierr = NF90_PUT_ATT (nid, id_FTER, "title", "Fraction terre")      call NF95_DEF_VAR(nid, "FSIC", NF90_FLOAT, dimids=(/ndim, ntim/), &
373             varid=id_FSIC)
374      ierr = NF90_DEF_VAR (nid, "FLIC", NF90_FLOAT, dims, id_FLIC)      call NF95_PUT_ATT(nid, id_FSIC, "title", "Fraction glace de mer")
375      ierr = NF90_PUT_ATT (nid, id_FLIC, "title", "Fraction land ice")  
376        call NF95_DEF_VAR(nid, "FTER", NF90_FLOAT, dimids=(/ndim, ntim/), &
377      ierr = NF90_DEF_VAR (nid, "SST", NF90_FLOAT, dims, id_SST)           varid=id_FTER)
378      ierr = NF90_PUT_ATT (nid, id_SST, "title",  &      call NF95_PUT_ATT(nid, id_FTER, "title", "Fraction terre")
379    
380        call NF95_DEF_VAR(nid, "FLIC", NF90_FLOAT, dimids=(/ndim, ntim/), &
381             varid=id_FLIC)
382        call NF95_PUT_ATT(nid, id_FLIC, "title", "Fraction land ice")
383    
384        call NF95_DEF_VAR(nid, "SST", NF90_FLOAT, dimids=(/ndim, ntim/), &
385             varid=id_SST)
386        call NF95_PUT_ATT(nid, id_SST, "title",  &
387           "Temperature superficielle de la mer")           "Temperature superficielle de la mer")
388      ierr = NF90_DEF_VAR (nid, "BILS", NF90_FLOAT, dims, id_BILS)  
389      ierr = NF90_PUT_ATT (nid, id_BILS, "title", &      call NF95_DEF_VAR(nid, "BILS", NF90_FLOAT, dimids=(/ndim, ntim/), &
390           "Reference flux de chaleur au sol")           varid=id_BILS)
391      ierr = NF90_DEF_VAR (nid, "ALB", NF90_FLOAT, dims, id_ALB)      call NF95_PUT_ATT(nid, id_BILS, "title", "Reference flux de chaleur au sol")
392      ierr = NF90_PUT_ATT (nid, id_ALB, "title", "Albedo a la surface")  
393      ierr = NF90_DEF_VAR (nid, "RUG", NF90_FLOAT, dims, id_RUG)      call NF95_DEF_VAR(nid, "ALB", NF90_FLOAT, dimids=(/ndim, ntim/), &
394      ierr = NF90_PUT_ATT (nid, id_RUG, "title", "Rugosite")           varid=id_ALB)
395        call NF95_PUT_ATT(nid, id_ALB, "title", "Albedo a la surface")
396    
397        call NF95_DEF_VAR(nid, "RUG", NF90_FLOAT, dimids=(/ndim, ntim/), &
398             varid=id_RUG)
399        call NF95_PUT_ATT(nid, id_RUG, "title", "Rugosite")
400    
401      call NF95_ENDDEF(nid)      call NF95_ENDDEF(nid)
402    
403      DO k = 1, 360      DO k = 1, 360
404         debut(1) = 1         call NF95_PUT_VAR(nid, id_tim, REAL(k), (/k/))
405         debut(2) = k         call NF95_PUT_VAR(nid, id_FOCE, pctsrf_t(:, is_oce, k), start=(/1, k/))
406           call NF95_PUT_VAR(nid, id_FSIC, pctsrf_t(:, is_sic, k), start=(/1, k/))
407         ierr = NF90_PUT_VAR(nid, id_tim, REAL(k), (/k/))         call NF95_PUT_VAR(nid, id_FTER, pctsrf_t(:, is_ter, k), start=(/1, k/))
408         ierr = NF90_PUT_VAR(nid, id_FOCE, pctsrf_t(:, is_oce, k), debut)         call NF95_PUT_VAR(nid, id_FLIC, pctsrf_t(:, is_lic, k), start=(/1, k/))
409         ierr = NF90_PUT_VAR (nid, id_FSIC, pctsrf_t(:, is_sic, k), debut)         call NF95_PUT_VAR(nid, id_SST, phy_sst(:, k), start=(/1, k/))
410         ierr = NF90_PUT_VAR (nid, id_FTER, pctsrf_t(:, is_ter, k), debut)         call NF95_PUT_VAR(nid, id_BILS, phy_bil(:, k), start=(/1, k/))
411         ierr = NF90_PUT_VAR (nid, id_FLIC, pctsrf_t(:, is_lic, k), debut)         call NF95_PUT_VAR(nid, id_ALB, phy_alb(:, k), start=(/1, k/))
412         ierr = NF90_PUT_VAR (nid, id_SST, phy_sst(:, k), debut)         call NF95_PUT_VAR(nid, id_RUG, phy_rug(:, k), start=(/1, k/))
        ierr = NF90_PUT_VAR (nid, id_BILS, phy_bil(:, k), debut)  
        ierr = NF90_PUT_VAR (nid, id_ALB, phy_alb(:, k), debut)  
        ierr = NF90_PUT_VAR (nid, id_RUG, phy_rug(:, k), debut)  
413      ENDDO      ENDDO
414    
415      call NF95_CLOSE(nid)      call NF95_CLOSE(nid)

Legend:
Removed from v.97  
changed lines
  Added in v.98

  ViewVC Help
Powered by ViewVC 1.1.21