Index: /LMDZ4/branches/LMDZ4-dev/libf/dyn3d/guide_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/dyn3d/guide_mod.F90	(revision 1187)
+++ /LMDZ4/branches/LMDZ4-dev/libf/dyn3d/guide_mod.F90	(revision 1188)
@@ -11,4 +11,5 @@
   USE getparam
   USE Write_Field
+  use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close
 
   IMPLICIT NONE
@@ -140,14 +141,14 @@
     ncidpl=-99
     if (guide_modele) then
-       if (ncidpl.eq.-99) ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcod)
+       if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     else
          if (guide_u) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('u.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
          elseif (guide_v) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('v.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
          elseif (guide_T) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('T.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
          elseif (guide_Q) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('hur.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
          endif
     endif 
@@ -160,5 +161,5 @@
     error=NF_INQ_DIMLEN(ncidpl,rid,nlevnc)
     print *,'Guide: nombre niveaux vert. nlevnc', nlevnc 
-    CALL NCCLOS(ncidpl,rcod)
+    rcod = nf90_close(ncidpl)
 
 ! ---------------------------------------------
@@ -992,13 +993,13 @@
          if (guide_modele) then
              print *,'Lecture du guidage sur niveaux mod�le'
-             ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)
-             varidap=NCVID(ncidpl,'AP',rcode)
-             varidbp=NCVID(ncidpl,'BP',rcode)
+             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
+             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
+             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
              print*,'ncidpl,varidap',ncidpl,varidap
          endif
 ! Vent zonal
          if (guide_u) then
-             ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
-             varidu=NCVID(ncidu,'UWND',rcode)
+             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
+             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
              print*,'ncidu,varidu',ncidu,varidu
              if (ncidpl.eq.-99) ncidpl=ncidu
@@ -1006,6 +1007,6 @@
 ! Vent meridien
          if (guide_v) then
-             ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
-             varidv=NCVID(ncidv,'VWND',rcode)
+             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
+             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
              print*,'ncidv,varidv',ncidv,varidv
              if (ncidpl.eq.-99) ncidpl=ncidv
@@ -1013,6 +1014,6 @@
 ! Temperature
          if (guide_T) then
-             ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
-             varidt=NCVID(ncidt,'AIR',rcode)
+             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
+             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
              print*,'ncidT,varidT',ncidt,varidt
              if (ncidpl.eq.-99) ncidpl=ncidt
@@ -1020,6 +1021,6 @@
 ! Humidite
          if (guide_Q) then
-             ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
-             varidQ=NCVID(ncidQ,'RH',rcode)
+             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
+             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
              print*,'ncidQ,varidQ',ncidQ,varidQ
              if (ncidpl.eq.-99) ncidpl=ncidQ
@@ -1027,12 +1028,12 @@
 ! Pression de surface
          if ((guide_P).OR.(guide_modele)) then
-             ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
-             varidps=NCVID(ncidps,'SP',rcode)
+             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
+             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
              print*,'ncidps,varidps',ncidps,varidps
          endif
 ! Coordonnee verticale
          if (.not.guide_modele) then
-              rcode=NF_INQ_VARID(ncidpl,'LEVEL',varidpl)
-              IF (rcode.NE.0) rcode=NF_INQ_VARID(ncidpl,'PRESSURE',varidpl)
+              rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl)
+              IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl)
               print*,'ncidpl,varidpl',ncidpl,varidpl
          endif
@@ -1175,13 +1176,13 @@
          if (guide_modele) then
              print *,'Lecture du guidage sur niveaux mod�le'
-             ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)
-             varidap=NCVID(ncidpl,'AP',rcode)
-             varidbp=NCVID(ncidpl,'BP',rcode)
+             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
+             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
+             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
              print*,'ncidpl,varidap',ncidpl,varidap
          endif
 ! Vent zonal
          if (guide_u) then
-             ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
-             varidu=NCVID(ncidu,'UWND',rcode)
+             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
+             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
              print*,'ncidu,varidu',ncidu,varidu
              if (ncidpl.eq.-99) ncidpl=ncidu
@@ -1189,6 +1190,6 @@
 ! Vent meridien
          if (guide_v) then
-             ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
-             varidv=NCVID(ncidv,'VWND',rcode)
+             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
+             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
              print*,'ncidv,varidv',ncidv,varidv
              if (ncidpl.eq.-99) ncidpl=ncidv
@@ -1196,6 +1197,6 @@
 ! Temperature
          if (guide_T) then
-             ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
-             varidt=NCVID(ncidt,'AIR',rcode)
+             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
+             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
              print*,'ncidT,varidT',ncidt,varidt
              if (ncidpl.eq.-99) ncidpl=ncidt
@@ -1203,6 +1204,6 @@
 ! Humidite
          if (guide_Q) then
-             ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
-             varidQ=NCVID(ncidQ,'RH',rcode)
+             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
+             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
              print*,'ncidQ,varidQ',ncidQ,varidQ
              if (ncidpl.eq.-99) ncidpl=ncidQ
@@ -1210,12 +1211,12 @@
 ! Pression de surface
          if ((guide_P).OR.(guide_modele)) then
-             ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
-             varidps=NCVID(ncidps,'SP',rcode)
+             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
+             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
              print*,'ncidps,varidps',ncidps,varidps
          endif
 ! Coordonnee verticale
          if (.not.guide_modele) then
-              rcode=NF_INQ_VARID(ncidpl,'LEVEL',varidpl)
-              IF (rcode.NE.0) rcode=NF_INQ_VARID(ncidpl,'PRESSURE',varidpl)
+              rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl)
+              IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl)
               print*,'ncidpl,varidpl',ncidpl,varidpl
          endif
Index: /LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/guide_p_mod.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/guide_p_mod.F90	(revision 1187)
+++ /LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/guide_p_mod.F90	(revision 1188)
@@ -12,4 +12,5 @@
   USE getparam
   USE Write_Field_p
+  use netcdf, only: nf90_nowrite, nf90_open, nf90_inq_varid, nf90_close
 
   IMPLICIT NONE
@@ -145,14 +146,14 @@
     ncidpl=-99
     if (guide_modele) then
-       if (ncidpl.eq.-99) ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcod)
+       if (ncidpl.eq.-99) rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
     else
          if (guide_u) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('u.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
          elseif (guide_v) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('v.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
          elseif (guide_T) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('T.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
          elseif (guide_Q) then
-           if (ncidpl.eq.-99) ncidpl=NCOPN('hur.nc',NCNOWRIT,rcod)
+           if (ncidpl.eq.-99) rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
          endif
     endif 
@@ -165,5 +166,5 @@
     error=NF_INQ_DIMLEN(ncidpl,rid,nlevnc)
     print *,'Guide: nombre niveaux vert. nlevnc', nlevnc 
-    CALL NCCLOS(ncidpl,rcod)
+    rcod = nf90_close(ncidpl)
 
 ! ---------------------------------------------
@@ -1071,13 +1072,13 @@
          if (guide_modele) then
              print *,'Lecture du guidage sur niveaux mod�le'
-             ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)
-             varidap=NCVID(ncidpl,'AP',rcode)
-             varidbp=NCVID(ncidpl,'BP',rcode)
+             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
+             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
+             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
              print*,'ncidpl,varidap',ncidpl,varidap
          endif
 ! Vent zonal
          if (guide_u) then
-             ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
-             varidu=NCVID(ncidu,'UWND',rcode)
+             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
+             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
              print*,'ncidu,varidu',ncidu,varidu
              if (ncidpl.eq.-99) ncidpl=ncidu
@@ -1085,6 +1086,6 @@
 ! Vent meridien
          if (guide_v) then
-             ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
-             varidv=NCVID(ncidv,'VWND',rcode)
+             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
+             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
              print*,'ncidv,varidv',ncidv,varidv
              if (ncidpl.eq.-99) ncidpl=ncidv
@@ -1092,6 +1093,6 @@
 ! Temperature
          if (guide_T) then
-             ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
-             varidt=NCVID(ncidt,'AIR',rcode)
+             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
+             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
              print*,'ncidT,varidT',ncidt,varidt
              if (ncidpl.eq.-99) ncidpl=ncidt
@@ -1099,6 +1100,6 @@
 ! Humidite
          if (guide_Q) then
-             ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
-             varidQ=NCVID(ncidQ,'RH',rcode)
+             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
+             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
              print*,'ncidQ,varidQ',ncidQ,varidQ
              if (ncidpl.eq.-99) ncidpl=ncidQ
@@ -1106,12 +1107,12 @@
 ! Pression de surface
          if ((guide_P).OR.(guide_modele)) then
-             ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
-             varidps=NCVID(ncidps,'SP',rcode)
+             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
+             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
              print*,'ncidps,varidps',ncidps,varidps
          endif
 ! Coordonnee verticale
          if (.not.guide_modele) then
-              rcode=NF_INQ_VARID(ncidpl,'LEVEL',varidpl)
-              IF (rcode.NE.0) rcode=NF_INQ_VARID(ncidpl,'PRESSURE',varidpl)
+              rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl)
+              IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl)
               print*,'ncidpl,varidpl',ncidpl,varidpl
          endif
@@ -1255,13 +1256,13 @@
          if (guide_modele) then
              print *,'Lecture du guidage sur niveaux mod�le'
-             ncidpl=NCOPN('apbp.nc',NCNOWRIT,rcode)
-             varidap=NCVID(ncidpl,'AP',rcode)
-             varidbp=NCVID(ncidpl,'BP',rcode)
+             rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
+             rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
+             rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
              print*,'ncidpl,varidap',ncidpl,varidap
          endif
 ! Vent zonal
          if (guide_u) then
-             ncidu=NCOPN('u.nc',NCNOWRIT,rcode)
-             varidu=NCVID(ncidu,'UWND',rcode)
+             rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
+             rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
              print*,'ncidu,varidu',ncidu,varidu
              if (ncidpl.eq.-99) ncidpl=ncidu
@@ -1269,6 +1270,6 @@
 ! Vent meridien
          if (guide_v) then
-             ncidv=NCOPN('v.nc',NCNOWRIT,rcode)
-             varidv=NCVID(ncidv,'VWND',rcode)
+             rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
+             rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
              print*,'ncidv,varidv',ncidv,varidv
              if (ncidpl.eq.-99) ncidpl=ncidv
@@ -1276,6 +1277,6 @@
 ! Temperature
          if (guide_T) then
-             ncidt=NCOPN('T.nc',NCNOWRIT,rcode)
-             varidt=NCVID(ncidt,'AIR',rcode)
+             rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
+             rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
              print*,'ncidT,varidT',ncidt,varidt
              if (ncidpl.eq.-99) ncidpl=ncidt
@@ -1283,6 +1284,6 @@
 ! Humidite
          if (guide_Q) then
-             ncidQ=NCOPN('hur.nc',NCNOWRIT,rcode)
-             varidQ=NCVID(ncidQ,'RH',rcode)
+             rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
+             rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
              print*,'ncidQ,varidQ',ncidQ,varidQ
              if (ncidpl.eq.-99) ncidpl=ncidQ
@@ -1290,12 +1291,12 @@
 ! Pression de surface
          if ((guide_P).OR.(guide_modele)) then
-             ncidps=NCOPN('ps.nc',NCNOWRIT,rcode)
-             varidps=NCVID(ncidps,'SP',rcode)
+             rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
+             rcode = nf90_inq_varid(ncidps, 'SP', varidps)
              print*,'ncidps,varidps',ncidps,varidps
          endif
 ! Coordonnee verticale
          if (.not.guide_modele) then
-              rcode=NF_INQ_VARID(ncidpl,'LEVEL',varidpl)
-              IF (rcode.NE.0) rcode=NF_INQ_VARID(ncidpl,'PRESSURE',varidpl)
+              rcode = nf90_inq_varid(ncidpl, 'LEVEL', varidpl)
+              IF (rcode.NE.0) rcode = nf90_inq_varid(ncidpl, 'PRESSURE', varidpl)
               print*,'ncidpl,varidpl',ncidpl,varidpl
          endif
Index: DZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm.F
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm.F	(revision 1187)
+++ 	(revision )
@@ -1,89 +1,0 @@
-!
-! $Header$
-!
-      SUBROUTINE ozonecm(rjour, rlat, paprs, o3)
-      USE dimphy
-      IMPLICIT none
-C
-C The ozone climatology is based on an analytic formula which fits the
-C Krueger and Mintzner (1976) profile, as well as the variations with
-C altitude and latitude of the maximum ozone concentrations and the total
-C column ozone concentration of Keating and Young (1986). The analytic
-C formula have been established by J-F Royer (CRNM, Meteo France), who
-C also provided us the code.
-C
-C A. J. Krueger and R. A. Minzner, A Mid-Latitude Ozone Model for the
-C 1976 U.S. Standard Atmosphere, J. Geophys. Res., 81, 4477, (1976).
-C
-C Keating, G. M. and D. F. Young, 1985: Interim reference models for the
-C middle atmosphere, Handbook for MAP, vol. 16, 205-229.
-C
-
-cym#include "dimensions.h"
-cym#include "dimphy.h"
-#include "clesphys.h"
-#include "YOMCST.h"
-      REAL rlat(klon), paprs(klon,klev+1)
-      REAL o3(klon,klev)   ! ozone concentration in kg/kg
-      REAL tozon, rjour, pi, pl
-      INTEGER i, k
-C----------------------------------------------------------
-      REAL field(klon,klev+1)
-      REAL ps
-      PARAMETER (ps=101325.0)
-      REAL an, unit, zo3q3
-      SAVE an, unit, zo3q3
-c$OMP THREADPRIVATE(an, unit, zo3q3)
-      REAL mu,gms, zslat, zsint, zcost, z, ppm, qpm, a
-      REAL asec, bsec, aprim, zo3a3
-C----------------------------------------------------------
-c         data an /365.25/   (meteo)
-      DATA an /360.00/
-      DATA unit /2.1415e-05/
-      DATA zo3q3 /4.0e-08/
-
-      pi = 4.0 * ATAN(1.0)
-      DO k = 1, klev
-      DO i = 1, klon
-      zslat = SIN(pi/180.*rlat(i))
-      zsint = SIN(2.*pi*(rjour+15.)/an)
-      zcost = COS(2.*pi*(rjour+15.)/an)
-      z = 0.0531+zsint*(-0.001595+0.009443*zslat) +
-     .  zcost*(-0.001344-0.00346*zslat) +
-     .  zslat**2*(.056222+zslat**2*(-.037609
-     . +.012248*zsint+.00521*zcost+.008890*zslat))
-      zo3a3 = zo3q3/ps/2.
-      z = z-zo3q3*ps
-      gms = z
-      mu = ABS(sin(pi/180.*rlat(i)))
-      ppm = 800.-(500.*zslat+150.*zcost)*zslat
-      qpm = 1.74e-5-(7.5e-6*zslat+1.7e-6*zcost)*zslat
-      bsec = 2650.+5000.*zslat**2
-      a = 4.0*(bsec)**(3./2.)*(ppm)**(3./2.)*(1.0+(bsec/ps)**(3./2.))
-      a = a/(bsec**(3./2.)+ppm**(3./2.))**2
-      aprim = (2.666666*qpm*ppm-a*gms)/(1.0-a)
-      aprim = amax1(0.,aprim)
-      asec = (gms-aprim)*(1.0+(bsec/ps)**(3./2.))
-      asec = AMAX1(0.0,asec)
-      aprim = gms-asec/(1.+(bsec/ps)**(3./2.))
-      pl = paprs(i,k)
-      tozon = aprim/(1.+3.*(ppm/pl)**2)+asec/(1.+(bsec/pl)**(3./2.))
-     .  + zo3a3*pl*pl
-      tozon = tozon / 9.81  ! en kg/m**2
-      tozon = tozon / unit  ! en kg/m**2  > u dobson (10e-5 m)
-      tozon = tozon / 1000. ! en cm
-      field(i,k) = tozon
-      ENDDO
-      ENDDO
-c
-      DO i = 1, klon
-         field(i,klev+1) = 0.0
-      ENDDO
-      DO k = 1, klev
-        DO i = 1, klon
-          o3(i,k) = field(i,k) - field(i,k+1)
-        ENDDO
-      ENDDO
-c
-      RETURN
-      END
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm_m.F90
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm_m.F90	(revision 1188)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm_m.F90	(revision 1188)
@@ -0,0 +1,85 @@
+! $Header$
+module ozonecm_m
+
+  IMPLICIT NONE
+
+contains
+
+  SUBROUTINE ozonecm(rjour,rlat,paprs,o3)
+
+    ! The ozone climatology is based on an analytic formula which fits the
+    ! Krueger and Mintzner (1976) profile, as well as the variations with
+    ! altitude and latitude of the maximum ozone concentrations and the total
+    ! column ozone concentration of Keating and Young (1986). The analytic
+    ! formula have been established by J.-F. Royer (CRNM, Meteo France), who
+    ! also provided us the code.
+
+    ! A. J. Krueger and R. A. Minzner, A Mid-Latitude Ozone Model for the
+    ! 1976 U.S. Standard Atmosphere, J. Geophys. Res., 81, 4477, (1976).
+
+    ! Keating, G. M. and D. F. Young, 1985: Interim reference models for the
+    ! middle atmosphere, Handbook for MAP, vol. 16, 205-229.
+
+    USE dimphy, only: klon, klev
+
+    REAL, INTENT (IN) :: rjour
+    REAL, INTENT (IN) :: rlat(klon), paprs(klon,klev+1)
+    REAL o3(klon,klev)
+    ! "o3(j, k)" is the column-density of ozone in cell "(j, k)", that is
+    ! between interface "k" and interface "k + 1", in kDU.
+
+    ! Variables local to the procedure:
+
+    REAL tozon ! equivalent pressure of ozone above interface "k", in Pa
+    real pi, pl
+    INTEGER i, k
+
+    REAL field(klon,klev+1)
+    ! "field(:, k)" is the column-density of ozone between interface
+    ! "k" and the top of the atmosphere (interface "llm + 1"), in kDU.
+
+    real, PARAMETER:: ps=101325.
+    REAL, parameter:: an = 360., zo3q3 = 4E-8
+    REAL, parameter:: dobson_unit = 2.1415E-5 ! in kg m-2
+    REAL gms, zslat, zsint, zcost, z, ppm, qpm, a
+    REAL asec, bsec, aprim, zo3a3
+
+    !----------------------------------------------------------
+
+    pi = 4. * atan(1.)
+    DO k = 1, klev
+       DO i = 1, klon
+          zslat = sin(pi / 180. * rlat(i))
+          zsint = sin(2.*pi*(rjour+15.)/an)
+          zcost = cos(2.*pi*(rjour+15.)/an)
+          z = 0.0531 + zsint * (-0.001595+0.009443*zslat) &
+               + zcost * (-0.001344-0.00346*zslat) &
+               + zslat**2 * (.056222 + zslat**2 &
+               * (-.037609+.012248*zsint+.00521*zcost+.008890*zslat))
+          zo3a3 = zo3q3/ps/2.
+          z = z - zo3q3*ps
+          gms = z
+          ppm = 800. - (500.*zslat+150.*zcost)*zslat
+          qpm = 1.74E-5 - (7.5E-6*zslat+1.7E-6*zcost)*zslat
+          bsec = 2650. + 5000.*zslat**2
+          a = 4.0*(bsec)**(3./2.)*(ppm)**(3./2.)*(1.0+(bsec/ps)**(3./2.))
+          a = a/(bsec**(3./2.)+ppm**(3./2.))**2
+          aprim = (2.666666*qpm*ppm-a*gms)/(1.0-a)
+          aprim = amax1(0., aprim)
+          asec = (gms-aprim)*(1.0+(bsec/ps)**(3./2.))
+          asec = amax1(0.0, asec)
+          aprim = gms - asec/(1.+(bsec/ps)**(3./2.))
+          pl = paprs(i, k)
+          tozon = aprim / (1. + 3. * (ppm / pl)**2) &
+               + asec / (1. + (bsec / pl)**(3./2.)) + zo3a3 * pl * pl
+          ! Convert from Pa to kDU:
+          field(i, k) = tozon / 9.81 / dobson_unit / 1e3
+       END DO
+    END DO
+
+    field(:,klev+1) = 0.
+    forall (k = 1: klev) o3(:,k) = field(:,k) - field(:,k+1)
+
+  END SUBROUTINE ozonecm
+
+end module ozonecm_m
Index: /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F	(revision 1187)
+++ /LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F	(revision 1188)
@@ -34,4 +34,5 @@
       use mod_phys_lmdz_mpi_data, only: is_mpi_root
       USE aero_mod
+      use ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
 
       IMPLICIT none
@@ -735,5 +736,4 @@
       EXTERNAL o3cm      ! initialiser l'ozone
       EXTERNAL orbite    ! calculer l'orbite terrestre
-      EXTERNAL ozonecm   ! prescrire l'ozone
       EXTERNAL phyetat0  ! lire l'etat initial de la physique
       EXTERNAL phyredem  ! ecrire l'etat de redemarrage de la physique
Index: /LMDZ4/branches/LMDZ4-dev/output.def
===================================================================
--- /LMDZ4/branches/LMDZ4-dev/output.def	(revision 1187)
+++ /LMDZ4/branches/LMDZ4-dev/output.def	(revision 1188)
@@ -591,8 +591,11 @@
 flag_ovap         =  2, 3, 4, 1, 1    
 name_ovap         =  ovap
-# Geopotential height
+# ?
+flag_ovapinit     =  2, 3, 4, 1, 1
+name_ovapinit     =  ovapinit
+# ?
 flag_wvapp        =  2, 10, 10, 10, 10    
 name_wvapp        =  wvapp
-# Zonal wind
+# Geopotential height
 flag_geop         =  2, 3, 10, 1, 1    
 name_geop         =  geop
