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/regr_pr_o3_m.F90

    r1910 r2408  
    3030    use regr1_step_av_m, only: regr1_step_av
    3131    use press_coefoz_m, only: press_in_edg
    32     use control_mod, only: dayref
     32    use time_phylmdz_mod, only: day_ref
     33    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
    3334
    3435    REAL, intent(in):: p3d(:, :, :) ! pressure at layer interfaces, in Pa
     
    4344    ! Variables local to the procedure:
    4445
    45     include "dimensions.h"
    46 
    4746    integer ncid, varid, ncerr ! for NetCDF
    4847    integer i, j
    4948
    50     real r_mob(jjm + 1, size(press_in_edg) - 1)
    51     ! (ozone mole fraction from Mobidic at day "dayref")
     49    real r_mob(nbp_lat, size(press_in_edg) - 1)
     50    ! (ozone mole fraction from Mobidic at day "day_ref")
    5251    ! (r_mob(j, k) is at latitude "rlatu(j)", in pressure interval
    5352    ! "[press_in_edg(k), press_in_edg(k+1)]".)
     
    5655
    5756    print *, "Call sequence information: regr_pr_o3"
    58     call assert(shape(o3_mob_regr) == (/iim + 1, jjm + 1, llm/), &
     57    call assert(shape(o3_mob_regr) == (/nbp_lon + 1, nbp_lat, nbp_lev/), &
    5958         "regr_pr_o3 o3_mob_regr")
    60     call assert(shape(p3d) == (/iim + 1, jjm + 1, llm + 1/), "regr_pr_o3 p3d")
     59    call assert(shape(p3d) == (/nbp_lon + 1, nbp_lat, nbp_lev + 1/), "regr_pr_o3 p3d")
    6160
    6261    call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid)
     
    6463    call nf95_inq_varid(ncid, "r_Mob", varid)
    6564    ! Get data at the right day from the input file:
    66     ncerr = nf90_get_var(ncid, varid, r_mob, start=(/1, 1, dayref/))
     65    ncerr = nf90_get_var(ncid, varid, r_mob, start=(/1, 1, day_ref/))
    6766    call handle_err("nf90_get_var r_Mob", ncerr)
    6867    ! Latitudes are in ascending order in the input file while
    6968    ! "rlatu" is in descending order so we need to invert order:
    70     r_mob = r_mob(jjm+1:1:-1, :)
     69    r_mob = r_mob(nbp_lat:1:-1, :)
    7170
    7271    call nf95_close(ncid)
     
    7574
    7675    ! Poles:
    77     do j = 1, jjm + 1, jjm
    78        o3_mob_regr(1, j, llm:1:-1) &
    79             = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, llm+1:1:-1))
     76    do j = 1, nbp_lat, nbp_lat-1
     77       o3_mob_regr(1, j, nbp_lev:1:-1) &
     78            = regr1_step_av(r_mob(j, :), press_in_edg, p3d(1, j, nbp_lev+1:1:-1))
    8079       ! (invert order of indices because "p3d" is in descending order)
    8180    end do
    8281
    8382    ! Other latitudes:
    84     do j = 2, jjm
    85        do i = 1, iim
    86           o3_mob_regr(i, j, llm:1:-1) &
     83    do j = 2, nbp_lat-1
     84       do i = 1, nbp_lon
     85          o3_mob_regr(i, j, nbp_lev:1:-1) &
    8786               = regr1_step_av(r_mob(j, :), press_in_edg, &
    88                p3d(i, j, llm+1:1:-1))
     87               p3d(i, j, nbp_lev+1:1:-1))
    8988             ! (invert order of indices because "p3d" is in descending order)
    9089       end do
     
    9291
    9392    ! Duplicate pole values on all longitudes:
    94     o3_mob_regr(2:, 1, :) = spread(o3_mob_regr(1, 1, :), dim=1, ncopies=iim)
    95     o3_mob_regr(2:, jjm + 1, :) &
    96          = spread(o3_mob_regr(1, jjm + 1, :), dim=1, ncopies=iim)
     93    o3_mob_regr(2:, 1, :) = spread(o3_mob_regr(1, 1, :), dim=1, ncopies=nbp_lon)
     94    o3_mob_regr(2:, nbp_lat, :) &
     95         = spread(o3_mob_regr(1, nbp_lat, :), dim=1, ncopies=nbp_lon)
    9796
    9897    ! Duplicate first longitude to last longitude:
    99     o3_mob_regr(iim + 1, 2:jjm, :) = o3_mob_regr(1, 2:jjm, :)
     98    o3_mob_regr(nbp_lon + 1, 2:nbp_lat-1, :) = o3_mob_regr(1, 2:nbp_lat-1, :)
    10099
    101100  end subroutine regr_pr_o3
Note: See TracChangeset for help on using the changeset viewer.