Changeset 1215 for LMDZ4


Ignore:
Timestamp:
Jul 23, 2009, 5:52:59 PM (15 years ago)
Author:
lguez
Message:

-- Made "ozonecm" a function instead of a subroutine. Used assumed shape
arguments in "ozonecm".

-- Corrected long name and computation of NetCDF variable "ozone" in
the files "hist*".

-- Corrected comments for ozone variables.

-- In the case "read_climoz", used variables "rmd" and "rmo3" from
"YOMCST.h" instead of writing approximate values.

-- Replaced "real*..." declarations (not conforming to Fortran standard)
by "real(kind=...)" declarations.

-- Replaced value "1./46.6968" in ozone computations by the equivalent
(but clearer) "dobson_u * 1e3" (relative difference ~ 1e-5).

Location:
LMDZ4/branches/LMDZ4-dev/libf/phylmd
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/ozonecm_m.F90

    r1188 r1215  
    66contains
    77
    8   SUBROUTINE ozonecm(rjour,rlat,paprs,o3)
     8  function ozonecm(rjour,rlat,paprs)
    99
    1010    ! The ozone climatology is based on an analytic formula which fits the
     
    2222
    2323    USE dimphy, only: klon, klev
     24    use assert_m, only: assert
    2425
    2526    REAL, INTENT (IN) :: rjour
    26     REAL, INTENT (IN) :: rlat(klon), paprs(klon,klev+1)
    27     REAL o3(klon,klev)
    28     ! "o3(j, k)" is the column-density of ozone in cell "(j, k)", that is
     27    REAL, INTENT (IN) :: rlat(:) ! (klon)
     28    REAL, INTENT (IN) :: paprs(:, :) ! (klon,klev+1)
     29
     30    REAL ozonecm(klon,klev)
     31    ! "ozonecm(j, k)" is the column-density of ozone in cell "(j, k)", that is
    2932    ! between interface "k" and interface "k + 1", in kDU.
    3033
     
    4750    !----------------------------------------------------------
    4851
     52    call assert((/size(rlat), size(paprs, 1)/) == klon, "ozonecm klon")
     53    call assert(size(paprs, 2) == klev + 1, "ozonecm klev")
     54
    4955    pi = 4. * atan(1.)
    5056    DO k = 1, klev
    5157       DO i = 1, klon
    5258          zslat = sin(pi / 180. * rlat(i))
    53           zsint = sin(2.*pi*(rjour+15.)/an)
    54           zcost = cos(2.*pi*(rjour+15.)/an)
     59          zsint = sin(2 * pi * (rjour + 15.) / an)
     60          zcost = cos(2 * pi * (rjour + 15.) / an)
    5561          z = 0.0531 + zsint * (-0.001595+0.009443*zslat) &
    5662               + zcost * (-0.001344-0.00346*zslat) &
     
    7985
    8086    field(:,klev+1) = 0.
    81     forall (k = 1: klev) o3(:,k) = field(:,k) - field(:,k+1)
     87    forall (k = 1: klev) ozonecm(:,k) = field(:,k) - field(:,k+1)
    8288
    83   END SUBROUTINE ozonecm
     89  END function ozonecm
    8490
    8591end module ozonecm_m
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_mod.F90

    r1214 r1215  
    907907 CALL histdef3d(iff,o_rnebcon%flag,o_rnebcon%name, "Convective Cloud Fraction", "-")
    908908 CALL histdef3d(iff,o_rhum%flag,o_rhum%name, "Relative humidity", "-")
    909  CALL histdef3d(iff,o_ozone%flag,o_ozone%name, "Ozone concentration", "ppmv")
     909 CALL histdef3d(iff,o_ozone%flag,o_ozone%name, "Ozone mole fraction", "-")
    910910 CALL histdef3d(iff,o_dtphy%flag,o_dtphy%name, "Physics dT", "K/s")
    911911 CALL histdef3d(iff,o_dqphy%flag,o_dqphy%name, "Physics dQ", "(kg/kg)/s")
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_output_write.h

    r1213 r1215  
    909909
    910910      IF (o_ozone%flag(iff)<=lev_files(iff)) THEN
    911       DO k=1, klev
    912        DO i=1, klon
    913          zx_tmp_fi3d(i,k)=wo(i,k)*RG/46.6968
    914      $                    /(paprs(i,k)-paprs(i,k+1))
    915      $                    *(paprs(i,1)/101325.0)
    916        ENDDO !i
    917       ENDDO !k
    918       CALL histwrite_phy(nid_files(iff),o_ozone%name,itau_w,zx_tmp_fi3d)
     911         CALL histwrite_phy(nid_files(iff), o_ozone%name, itau_w,
     912     $        wo * dobson_u * 1e3 / zmasse / rmo3 * rmd)
    919913      ENDIF
    920914
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/phys_state_var_mod.F90

    r1183 r1215  
    202202      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
    203203!$OMP THREADPRIVATE(albsol1,albsol2)
    204       REAL,ALLOCATABLE,SAVE :: wo(:,:)
    205 !$OMP THREADPRIVATE(wo)
    206 !
     204
     205      REAL, ALLOCATABLE, SAVE:: wo(:,:)
     206      ! column-density of ozone in a layer, in kilo-Dobsons
     207      !$OMP THREADPRIVATE(wo)
     208
    207209! heat : chauffage solaire
    208210! heat0: chauffage solaire ciel clair
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F

    r1213 r1215  
    17221722!           Convert from mole fraction of ozone to column density of ozone in a
    17231723!           cell, in kDU:
    1724             wo = wo * 48. / 29. * zmasse / dobson_u / 1e3
     1724            wo = wo * rmo3 / rmd * zmasse / dobson_u / 1e3
    17251725C           (By regridding ozone values for LMDZ only once per day, we
    17261726C           have already neglected the variation of pressure in one
     
    17281728C           "zmasse" changes a little.)
    17291729         else
    1730             CALL ozonecm(real(days_elapsed+1), rlat, paprs, wo)
    1731 
     1730            wo = ozonecm(real(days_elapsed+1), rlat, paprs)
    17321731         end if
    17331732      ENDIF
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/radiation_AR4.F

    r1106 r1215  
    8989C* LOCAL VARIABLES:
    9090C
    91       REAL*8 ZOZ(KDLON,KFLEV)
     91      real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
     92
     93      REAL(kind=8) ZOZ(KDLON,KFLEV)
     94!     column-density of ozone in layer, in kilo-Dobsons
     95
    9296      REAL*8 ZAKI(KDLON,2)     
    9397      REAL*8 ZCLD(KDLON,KFLEV)
     
    178182      DO JL = 1, KDLON
    179183         ZCLDSW0(JL,JK) = 0.0
    180          ZOZ(JL,JK) = POZON(JL,JK)*46.6968/RG
    181      .               *PDP(JL,JK)*(101325.0/PPSOL(JL))
     184         ZOZ(JL,JK) = POZON(JL,JK) / dobson_u / 1e3 / RG * PDP(JL,JK)
     185     $        * (101325. / PPSOL(JL))
    182186      ENDDO
    183187      ENDDO
     
    24772481      REAL*8 PPMB(KDLON,KFLEV+1)  ! HALF LEVEL PRESSURE (mb)
    24782482      REAL*8 PPSOL(KDLON)         ! SURFACE PRESSURE (Pa)
    2479       REAL*8 POZON(KDLON,KFLEV)   ! O3 CONCENTRATION (kg/kg)
     2483      REAL(kind=8) POZON(KDLON,KFLEV)   ! O3 mass fraction
    24802484      REAL*8 PTL(KDLON,KFLEV+1)   ! HALF LEVEL TEMPERATURE (K)
    24812485      REAL*8 PAER(KDLON,KFLEV,5)  ! OPTICAL THICKNESS OF THE AEROSOLS
     
    25032507C-------------------------------------------------------------------------
    25042508      REAL*8 ZABCU(KDLON,NUA,3*KFLEV+1)
    2505       REAL*8 ZOZ(KDLON,KFLEV)
    2506 c
     2509
     2510      REAL(kind=8) ZOZ(KDLON,KFLEV)
     2511!     equivalent pressure of ozone in a layer, in Pa
     2512
    25072513cym      REAL*8 ZFLUX(KDLON,2,KFLEV+1) ! RADIATIVE FLUXES (1:up; 2:down)
    25082514cym      REAL*8 ZFLUC(KDLON,2,KFLEV+1) ! CLEAR-SKY RADIATIVE FLUXES
     
    25502556C
    25512557      IF (MOD(itaplw0,lw0pas).EQ.0) THEN
    2552       DO k = 1, KFLEV  ! convertir ozone de kg/kg en pa/pa
    2553       DO i = 1, KDLON
    2554 c convertir ozone de kg/kg en pa (modif MPL 100505)
    2555          ZOZ(i,k) = POZON(i,k)*PDP(i,k) * RMD/RMO3
    2556 c        print *,'LW: ZOZ*10**6=',ZOZ(i,k)*1000000.
    2557       ENDDO
     2558c     Compute equivalent pressure of ozone from mass fraction:
     2559      DO k = 1, KFLEV
     2560         DO i = 1, KDLON
     2561            ZOZ(i,k) = POZON(i,k)*PDP(i,k) * RMD/RMO3
     2562         ENDDO
    25582563      ENDDO
    25592564cIM ctes ds clesphys.h   CALL LWU(RCO2,RCH4, RN2O, RCFC11, RCFC12,
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/radlwsw.F90

    r1160 r1215  
    4040  ! t--------input-R- temperature (K)
    4141  ! q--------input-R- vapeur d'eau (en kg/kg)
    42   ! wo-------input-R- contenu en ozone (en kg/kg) correction MPL 100505
    4342  ! cldfra---input-R- fraction nuageuse (entre 0 et 1)
    4443  ! cldtaupd---input-R- epaisseur optique des nuages dans le visible (present-day value)
     
    101100  REAL,    INTENT(in)  :: paprs(KLON,KLEV+1), pplay(KLON,KLEV)
    102101  REAL,    INTENT(in)  :: alb1(KLON), alb2(KLON), tsol(KLON)
    103   REAL,    INTENT(in)  :: t(KLON,KLEV), q(KLON,KLEV), wo(KLON,KLEV)
     102  REAL,    INTENT(in)  :: t(KLON,KLEV), q(KLON,KLEV)
     103
     104  REAL, INTENT(in)::wo(KLON,KLEV)
     105  ! column-density of ozone in a layer, in kilo-Dobsons
     106
    104107  LOGICAL, INTENT(in)  :: ok_ade, ok_aie                                 ! switches whether to use aerosol direct (indirect) effects or not
    105108  REAL,    INTENT(in)  :: cldfra(KLON,KLEV), cldemi(KLON,KLEV), cldtaupd(KLON,KLEV)
     
    150153  REAL*8 PTL(kdlon,kflev+1), PPMB(kdlon,kflev+1)
    151154  REAL*8 PTAVE(kdlon,kflev)
    152   REAL*8 PWV(kdlon,kflev), PQS(kdlon,kflev), POZON(kdlon,kflev)
     155  REAL*8 PWV(kdlon,kflev), PQS(kdlon,kflev)
     156  real(kind=8) POZON(kdlon,kflev) ! mass fraction of ozone
    153157  REAL*8 PAER(kdlon,kflev,5)
    154158  REAL*8 PCLDLD(kdlon,kflev)
     
    177181  REAL*8 ztopsw_aero(kdlon,9), ztopsw0_aero(kdlon,9)
    178182  REAL*8 zsolsw_aero(kdlon,9), zsolsw0_aero(kdlon,9)
     183  real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
     184
    179185
    180186  ! initialisation
     
    236242        PWV(i,k) = MAX (q(iof+i,k), 1.0e-12)
    237243        PQS(i,k) = PWV(i,k)
    238         ! wo:    cm.atm (epaisseur en cm dans la situation standard)
    239         ! POZON: kg/kg
    240         POZON(i,k) = MAX(wo(iof+i,k),1.0e-12)*RG/46.6968 &
    241            /(paprs(iof+i,k)-paprs(iof+i,k+1))&
    242            *(paprs(iof+i,1)/101325.0)
     244        POZON(i,k) = MAX(wo(iof+i, k), 1e-12) * RG * dobson_u * 1e3 &
     245             /(paprs(iof+i, k) - paprs(iof+i, k+1)) &
     246             * (paprs(iof+i, 1) / 101325.)
    243247        PCLDLD(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k)
    244248        PCLDLU(i,k) = cldfra(iof+i,k)*cldemi(iof+i,k)
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/sw_aeroAR4.F90

    r1159 r1215  
    8989  !* LOCAL VARIABLES:
    9090  !
    91   REAL*8 ZOZ(KDLON,KFLEV)
     91  real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
     92
     93  REAL(kind=8) ZOZ(KDLON,KFLEV)
     94  ! column-density of ozone in layer, in kilo-Dobsons
     95
    9296  REAL*8 ZAKI(KDLON,2)     
    9397  REAL*8 ZCLD(KDLON,KFLEV)
     
    203207        DO JL = 1, KDLON
    204208           ZCLDSW0(JL,JK) = 0.0
    205            ZOZ(JL,JK) = POZON(JL,JK)*46.6968/RG &
    206                 *PDP(JL,JK)*(101325.0/PPSOL(JL))
     209           ZOZ(JL,JK) = POZON(JL,JK) / dobson_u / 1e3 / RG * PDP(JL,JK) &
     210                * (101325. / PPSOL(JL))
    207211        ENDDO
    208212     ENDDO
Note: See TracChangeset for help on using the changeset viewer.