Index: LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90
===================================================================
--- LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90	(revision 1237)
+++ LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90	(revision 1239)
@@ -146,5 +146,4 @@
   LOGICAL,SAVE :: ok_strato_omp
   LOGICAL,SAVE :: ok_hines_omp
-  LOGICAL      :: read_climoz_omp
   LOGICAL      :: carbon_cycle_tr_omp
   LOGICAL      :: carbon_cycle_cpl_omp
@@ -1282,6 +1281,6 @@
   call getin('ecrit_LES', ecrit_LES_omp)
 !
-  read_climoz_omp = .false. ! default value
-  call getin('read_climoz', read_climoz_omp)
+  read_climoz = .false. ! default value
+  call getin('read_climoz', read_climoz)
 
   carbon_cycle_tr_omp=.FALSE.
@@ -1421,5 +1420,4 @@
     ok_LES = ok_LES_omp
     ecrit_LES = ecrit_LES_omp
-    read_climoz = read_climoz_omp
     carbon_cycle_tr = carbon_cycle_tr_omp
     carbon_cycle_cpl = carbon_cycle_cpl_omp
Index: LMDZ4/branches/LMDZ4-dev/libf/phylmd/regr_lat_time_climoz_m.F90
===================================================================
--- LMDZ4/branches/LMDZ4-dev/libf/phylmd/regr_lat_time_climoz_m.F90	(revision 1237)
+++ LMDZ4/branches/LMDZ4-dev/libf/phylmd/regr_lat_time_climoz_m.F90	(revision 1239)
@@ -21,4 +21,10 @@
 
     ! The input field depends on time, pressure level and latitude.
+
+    ! If the input field has missing values, they must be signaled by
+    ! the "missing_value" attribute. At each latitude and each date, the
+    ! missing values are replaced by the lowest valid value above missing
+    ! values.
+
     ! We assume that the input field is a step function of latitude
     ! and that the input latitude coordinate gives the centers of steps.
@@ -52,4 +58,7 @@
     ! -- time increases (even though we do not use values of the input
     ! time coordinate);
+    ! -- missing values are vertically contiguous, at the bottom of
+    ! the vertical domain;
+    ! -- there is no missing value at the top level of the atmosphere.
 
     use regr1_step_av_m, only: regr1_step_av
@@ -57,5 +66,5 @@
     use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, handle_err, &
          nf95_put_var, nf95_gw_var
-    use netcdf, only: nf90_nowrite, nf90_get_var
+    use netcdf, only: nf90_nowrite, nf90_get_att, nf90_noerr
 
     ! Variables local to the procedure:
@@ -89,6 +98,8 @@
     real, pointer:: o3_in(:, :, :) ! (n_lat, n_plev, 12 or 0:13)
     ! (ozone climatology from the input file)
-    ! ("o3_in(j, l, month)" is at latitude "latitude(j)" and pressure
-    ! level "plev(l)". "month" is between 1 and 12 or between 0 and 13)
+    ! ("o3_in(j, k, l)" is at latitude "latitude(j)" and pressure
+    ! level "plev(k)". "l" is between 1 and 12 or between 0 and 13)
+
+    real missing_value
 
     real, allocatable:: o3_regr_lat(:, :, :) ! (jjm + 1, n_plev, 0:13)
@@ -103,17 +114,19 @@
     ! [- pi / 2, rlatv(jjm)]
     ! respectively.
-    ! "o3_regr_lat(:, l, :)" is for pressure level "plev(l)".
+    ! "o3_regr_lat(:, k, :)" is for pressure level "plev(k)".
     ! Last dimension is month number.)
 
     real, allocatable:: o3_out(:, :, :) ! (jjm + 1, n_plev, 360)
     ! (regridded ozone climatology)
-    ! ("o3_out(j, l, day)" is at latitude "rlatu(j)", pressure
-    ! level "plev(l)" and date "January 1st 0h" + "tmidday(day)", in a
+    ! ("o3_out(j, k, l)" is at latitude "rlatu(j)", pressure
+    ! level "plev(k)" and date "January 1st 0h" + "tmidday(l)", in a
     ! 360-day calendar.)
 
-    integer j
-    integer varid_in, varid_out, varid_plev, varid_time, varid ! (for NetCDF)
-
-    real, parameter:: tmidmonth(0:13) = (/(-15. + 30. * j, j = 0, 13)/)
+    integer j, k, l
+
+    ! For NetCDF:
+    integer varid_in, varid_out, varid_plev, varid_time, varid, ncerr
+
+    real, parameter:: tmidmonth(0:13) = (/(-15. + 30. * l, l = 0, 13)/)
     ! (time to middle of month, in days since January 1st 0h, in a
     ! 360-day calendar)
@@ -121,5 +134,5 @@
     ! interpolated between the December and the January value.)
 
-    real, parameter:: tmidday(360) = (/(j + 0.5, j = 0, 359)/)
+    real, parameter:: tmidday(360) = (/(l + 0.5, l = 0, 359)/)
     ! (time to middle of day, in days since January 1st 0h, in a
     ! 360-day calendar)
@@ -175,4 +188,26 @@
     if (desc_plev) o3_in = o3_in(:, n_plev:1:-1, :)
 
+    ncerr = nf90_get_att(ncid_in, varid_in, "missing_value", missing_value)
+    if (ncerr == nf90_noerr) then
+       do l = 1, size(o3_in, 3)
+          do j = 1, n_lat
+             ! Find missing values, starting from top of atmosphere
+             ! and going down.
+             ! We assume that the highest level contains no missing value.
+             k = 2
+             do
+                if (o3_in(j, k, l) == missing_value .or. k == n_plev) exit
+                k = k + 1
+             end do
+             ! Replace missing values with the valid value at the
+             ! lowest level above missing values:
+             if (o3_in(j, k, l) == missing_value) &
+                  o3_in(j, k:n_plev, l) = o3_in(j, k-1, l)
+          end do
+       end do
+    else
+       print *, "regr_lat_time_climoz: no missing value attribute"
+    end if
+    
     call nf95_close(ncid_in)
 
