/[lmdze]/trunk/phylmd/phyredem.f
ViewVC logotype

Diff of /trunk/phylmd/phyredem.f

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

revision 138 by guez, Fri May 22 23:13:19 2015 UTC revision 155 by guez, Wed Jul 8 17:03:45 2015 UTC
# Line 5  module phyredem_m Line 5  module phyredem_m
5  contains  contains
6    
7    SUBROUTINE phyredem(fichnom, pctsrf, tsol, tsoil, tslab, seaice, qsurf, &    SUBROUTINE phyredem(fichnom, pctsrf, tsol, tsoil, tslab, seaice, qsurf, &
8         qsol, snow, albedo, alblw, evap, rain_fall, snow_fall, solsw, sollw, &         qsol, snow, albedo, evap, rain_fall, snow_fall, solsw, sollw, &
9         fder, radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, &         fder, radsol, frugs, agesno, zmea, zstd, zsig, zgam, zthe, zpic, zval, &
10         t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01)         t_ancien, q_ancien, rnebcon, ratqs, clwcon, run_off_lic_0, sig1, w01)
11    
# Line 37  contains Line 37  contains
37    
38      REAL, INTENT(IN):: snow(klon, nbsrf)      REAL, INTENT(IN):: snow(klon, nbsrf)
39      REAL, INTENT(IN):: albedo(klon, nbsrf)      REAL, INTENT(IN):: albedo(klon, nbsrf)
     REAL, INTENT(IN):: alblw(klon, nbsrf)  
40      REAL, INTENT(IN):: evap(klon, nbsrf)      REAL, INTENT(IN):: evap(klon, nbsrf)
41      REAL, INTENT(IN):: rain_fall(klon)      REAL, INTENT(IN):: rain_fall(klon)
42      REAL, INTENT(IN):: snow_fall(klon)      REAL, INTENT(IN):: snow_fall(klon)
# Line 65  contains Line 64  contains
64    
65      ! Local:      ! Local:
66    
67      INTEGER ncid, idim2, idim3, dimid_nbsrf      INTEGER ncid, idim2, idim3, dimid_nbsrf, dimid_nsoilmx
68      integer varid, varid_run_off_lic_0, varid_sig1, varid_w01, varid_rlon      integer varid, varid_run_off_lic_0, varid_sig1, varid_w01, varid_rlon
69      integer varid_rlat, varid_zmasq, varid_fter, varid_flic, varid_foce      integer varid_rlat, varid_zmasq, varid_fter, varid_flic, varid_foce
70      integer varid_fsic      integer varid_fsic, varid_ts, varid_tsoil
71      INTEGER isoil, nsrf      INTEGER nsrf
     CHARACTER(len=7) str7  
72      CHARACTER(len=2) str2      CHARACTER(len=2) str2
73    
74      !------------------------------------------------------------      !------------------------------------------------------------
# Line 85  contains Line 83  contains
83      call nf95_def_dim(ncid, 'points_physiques', klon, idim2)      call nf95_def_dim(ncid, 'points_physiques', klon, idim2)
84      call nf95_def_dim(ncid, 'klev', klev, idim3)      call nf95_def_dim(ncid, 'klev', klev, idim3)
85      call nf95_def_dim(ncid, 'nbsrf', nbsrf, dimid_nbsrf)      call nf95_def_dim(ncid, 'nbsrf', nbsrf, dimid_nbsrf)
86        call nf95_def_dim(ncid, 'nsoilmx', nsoilmx, dimid_nsoilmx)
87    
88      call nf95_def_var(ncid, 'longitude', nf90_float, idim2, varid_rlon)      call nf95_def_var(ncid, 'longitude', nf90_float, idim2, varid_rlon)
89      call nf95_def_var(ncid, 'latitude', nf90_float, idim2, varid_rlat)      call nf95_def_var(ncid, 'latitude', nf90_float, idim2, varid_rlat)
# Line 106  contains Line 105  contains
105      call nf95_def_var(ncid, 'FSIC', nf90_float, idim2, varid_fsic)      call nf95_def_var(ncid, 'FSIC', nf90_float, idim2, varid_fsic)
106      call nf95_put_att(ncid, varid_fsic, 'title', 'fraction glace mer')      call nf95_put_att(ncid, varid_fsic, 'title', 'fraction glace mer')
107    
108        call nf95_def_var(ncid, 'TS', nf90_float, (/idim2, dimid_nbsrf/), varid_ts)
109        call nf95_put_att(ncid, varid_ts, 'title', 'surface temperature')
110    
111        call nf95_def_var(ncid, 'Tsoil', nf90_float, (/idim2, dimid_nsoilmx, &
112             dimid_nbsrf/), varid_tsoil)
113        call nf95_put_att(ncid, varid_tsoil, 'title', 'soil temperature')
114    
115      call nf95_enddef(ncid)      call nf95_enddef(ncid)
116    
117      call nf95_put_var(ncid, varid_rlon, rlon)      call nf95_put_var(ncid, varid_rlon, rlon)
# Line 115  contains Line 121  contains
121      call nf95_put_var(ncid, varid_flic, pctsrf(:, is_lic))      call nf95_put_var(ncid, varid_flic, pctsrf(:, is_lic))
122      call nf95_put_var(ncid, varid_foce, pctsrf(:, is_oce))      call nf95_put_var(ncid, varid_foce, pctsrf(:, is_oce))
123      call nf95_put_var(ncid, varid_fsic, pctsrf(:, is_sic))      call nf95_put_var(ncid, varid_fsic, pctsrf(:, is_sic))
124        call nf95_put_var(ncid, varid_ts, tsol)
125      call nf95_redef(ncid)      call nf95_put_var(ncid, varid_tsoil, tsoil)
     call nf95_def_var(ncid, 'TS', nf90_float, (/idim2, dimid_nbsrf/), varid)  
     call nf95_put_att(ncid, varid, 'title', 'surface temperature')  
     call nf95_enddef(ncid)  
     call nf95_put_var(ncid, varid, tsol)  
   
     DO nsrf = 1, nbsrf  
        DO isoil = 1, nsoilmx  
           IF (isoil<=99 .AND. nsrf<=99) THEN  
              WRITE (str7, '(i2.2, "srf", i2.2)') isoil, nsrf  
              call nf95_redef(ncid)  
              call nf95_def_var(ncid, 'Tsoil'//str7, nf90_float, idim2, varid)  
              call nf95_put_att(ncid, varid, 'title', &  
                   'Temperature du sol No.'//str7)  
              call nf95_enddef(ncid)  
           ELSE  
              PRINT *, 'Trop de couches'  
              STOP 1  
           END IF  
           call nf95_put_var(ncid, varid, tsoil(:, isoil, nsrf))  
        END DO  
     END DO  
126    
127      !IM "slab" ocean      !IM "slab" ocean
128      call nf95_redef(ncid)      call nf95_redef(ncid)
# Line 190  contains Line 175  contains
175         call nf95_put_var(ncid, varid, albedo(:, nsrf))         call nf95_put_var(ncid, varid, albedo(:, nsrf))
176      END DO      END DO
177    
     !IM BEG albedo LW  
     DO nsrf = 1, nbsrf  
        IF (nsrf<=99) THEN  
           WRITE (str2, '(i2.2)') nsrf  
           call nf95_redef(ncid)  
           call nf95_def_var(ncid, 'ALBLW'//str2, nf90_float, idim2, varid)  
           call nf95_put_att(ncid, varid, 'title', &  
                'albedo LW de surface No.'//str2)  
           call nf95_enddef(ncid)  
        ELSE  
           PRINT *, 'Trop de sous-mailles'  
           STOP 1  
        END IF  
        call nf95_put_var(ncid, varid, alblw(:, nsrf))  
     END DO  
     !IM END albedo LW  
   
178      DO nsrf = 1, nbsrf      DO nsrf = 1, nbsrf
179         IF (nsrf<=99) THEN         IF (nsrf<=99) THEN
180            WRITE (str2, '(i2.2)') nsrf            WRITE (str2, '(i2.2)') nsrf

Legend:
Removed from v.138  
changed lines
  Added in v.155

  ViewVC Help
Powered by ViewVC 1.1.21