Ignore:
Timestamp:
Dec 14, 2015, 11:43:09 AM (9 years ago)
Author:
Laurent Fairhead
Message:

Merged trunk changes r2298:2396 into testing branch

Location:
LMDZ5/branches/testing
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/branches/testing

  • LMDZ5/branches/testing/libf/phylmd/o3_chem_m.F90

    r1910 r2408  
    1414
    1515    ! All the 2-dimensional arrays are on the partial "physics" grid.
    16     ! Their shape is "(/klon, llm/)".
     16    ! Their shape is "(/klon, nbp_lev/)".
    1717    ! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)".
    1818
     
    2020    use dimphy, only: klon
    2121    use regr_pr_comb_coefoz_m, only: c_Mob, a4_mass, a2, r_het_interm
     22    use mod_grid_phy_lmdz, only: nbp_lev
     23    use nrtype, only: pi
    2224
    2325    integer, intent(in):: julien ! jour julien, 1 <= julien <= 360
    2426    real, intent(in):: gmtime ! heure de la journée en fraction de jour
    25     real, intent(in):: t_seri(:, :) ! (klon, llm) temperature, in K
     27    real, intent(in):: t_seri(:, :) ! (klon, nbp_lev) temperature, in K
    2628
    27     real, intent(in):: zmasse(:, :) ! (klon, llm)
     29    real, intent(in):: zmasse(:, :) ! (klon, nbp_lev)
    2830    ! (column-density of mass of air in a cell, in kg m-2)
    2931    ! "zmasse(:, k)" is for layer "k".)
     
    3436    ! (longitude and latitude of each horizontal position, in degrees)
    3537
    36     real, intent(inout):: q(:, :) ! (klon, llm) mass fraction of ozone
     38    real, intent(inout):: q(:, :) ! (klon, nbp_lev) mass fraction of ozone
    3739    ! "q(:, k)" is at middle of layer "k".)
    3840
    3941    ! Variables local to the procedure:
    40     include "dimensions.h"
    41     include "comconst.h"
    4242    ! (for "pi")
    4343    integer k
    4444
    45     real c(klon, llm)
     45    real c(klon, nbp_lev)
    4646    ! (constant term during a time step in the net mass production
    4747    ! rate of ozone by chemistry, per unit mass of air, in s-1)
    4848    ! "c(:, k)" is at middle of layer "k".)
    4949
    50     real b(klon, llm)
     50    real b(klon, nbp_lev)
    5151    ! (coefficient of "q" in the net mass production
    5252    ! rate of ozone by chemistry, per unit mass of air, in s-1)
    5353    ! "b(:, k)" is at middle of layer "k".)
    5454
    55     real dq_o3_chem(klon, llm)
     55    real dq_o3_chem(klon, nbp_lev)
    5656    ! (variation of ozone mass fraction due to chemistry during a time step)
    5757    ! "dq_o3_chem(:, k)" is at middle of layer "k".)
     
    6969    call assert(klon == (/size(q, 1), size(t_seri, 1), size(zmasse, 1), &
    7070         size(rlat), size(rlon)/), "o3_chem klon")
    71     call assert(llm == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), &
    72          "o3_chem llm")
     71    call assert(nbp_lev == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), &
     72         "o3_chem nbp_lev")
    7373
    7474    c = c_Mob + a4_mass * t_seri
     
    8686    call orbite(real(julien), earth_long, trash1)
    8787    call zenang(earth_long, gmtime, pdtphys, rlat, rlon, pmu0, trash2)
    88     forall (k = 1: llm)
     88    forall (k = 1: nbp_lev)
    8989       where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0.
    9090    end forall
     
    112112
    113113    ! All the 2-dimensional arrays are on the partial "physics" grid.
    114     ! Their shape is "(/klon, llm/)".
     114    ! Their shape is "(/klon, nbp_lev/)".
    115115    ! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)".
    116116
     
    118118    use assert_m, only: assert
    119119    use dimphy, only: klon
     120    use mod_grid_phy_lmdz, only: nbp_lev
    120121
    121122    real, intent(in):: q(:, :) ! mass fraction of ozone
     
    136137    ! ("b(:, k)" is at middle of layer "k".)
    137138
    138     include "dimensions.h"
    139 
    140     real o3_prod(klon, llm)
     139    real o3_prod(klon, nbp_lev)
    141140    ! (net mass production rate of ozone by chemistry, per unit mass
    142141    ! of air, in s-1)
     
    145144    ! Variables local to the procedure:
    146145
    147     real sigma_mass(klon, llm)
     146    real sigma_mass(klon, nbp_lev)
    148147    ! (mass column-density of ozone above point, in kg m-2)
    149148    ! ("sigma_mass(:, k)" is at middle of layer "k".)
     
    155154    call assert(klon == (/size(q, 1), size(zmasse, 1), size(c, 1), &
    156155         size(b, 1)/), "o3_prod 1")
    157     call assert(llm == (/size(q, 2), size(zmasse, 2), size(c, 2), &
     156    call assert(nbp_lev == (/size(q, 2), size(zmasse, 2), size(c, 2), &
    158157         size(b, 2)/), "o3_prod 2")
    159158
     
    161160    ! "k", and, as a first approximation, take it as column-density
    162161    ! above the middle of layer "k":
    163     sigma_mass(:, llm) = zmasse(:, llm) * q(:, llm) ! top layer
    164     do k =  llm - 1, 1, -1
     162    sigma_mass(:, nbp_lev) = zmasse(:, nbp_lev) * q(:, nbp_lev) ! top layer
     163    do k =  nbp_lev - 1, 1, -1
    165164       sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k)
    166165    end do
Note: See TracChangeset for help on using the changeset viewer.