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_lat_time_climoz_m.F90

    r1910 r2408  
    6666    ! year.
    6767
     68    use mod_grid_phy_lmdz, ONLY : nbp_lat
    6869    use regr1_step_av_m, only: regr1_step_av
    6970    use regr3_lint_m, only: regr3_lint
     
    7374    use netcdf, only: nf90_get_att, nf90_get_var, nf90_noerr, nf90_nowrite
    7475    use assert_m, only: assert
     76    use regular_lonlat_mod, only : boundslat_reg, south
     77    use nrtype, only: pi
    7578
    7679    integer, intent(in):: read_climoz ! read ozone climatology
     
    8184
    8285    ! Variables local to the procedure:
    83 
    84     include "dimensions.h"
    85     ! (for "jjm")
    86     include "paramet.h"
    87     ! (for the other included files)
    88     include "comgeom2.h"
    89     ! (for "rlatv")
    90     include "comconst.h"
    91     ! (for "pi")
    9286
    9387    integer n_plev ! number of pressure levels in the input data
     
    289283    call nf95_close(ncid_in)
    290284
    291     allocate(o3_regr_lat(jjm + 1, n_plev, 0:13, read_climoz))
    292     allocate(o3_out(jjm + 1, n_plev, 360, read_climoz))
     285    allocate(o3_regr_lat(nbp_lat, n_plev, 0:13, read_climoz))
     286    allocate(o3_out(nbp_lat, n_plev, 360, read_climoz))
    293287
    294288    ! Regrid in latitude:
     
    298292       print *, &
    299293            "Found 12 months in ozone climatologies, assuming periodicity..."
    300        o3_regr_lat(jjm+1:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
    301             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
     294       o3_regr_lat(nbp_lat:1:-1, :, 1:12, :) = regr1_step_av(o3_in, &
     295            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    302296       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    303297       ! in descending order)
     
    309303    else
    310304       print *, "Using 14 months in ozone climatologies..."
    311        o3_regr_lat(jjm+1:1:-1, :, :, :) = regr1_step_av(o3_in, &
    312             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
     305       o3_regr_lat(nbp_lat:1:-1, :, :, :) = regr1_step_av(o3_in, &
     306            xs=sin(lat_in_edg), xt=sin((/- pi / 2, boundslat_reg(nbp_lat-1:1:-1,south), pi / 2/)))
    313307       ! (invert order of indices in "o3_regr_lat" because "rlatu" is
    314308       ! in descending order)
     
    320314    ! Write to file:
    321315    do m = 1, read_climoz
    322        call nf95_put_var(ncid_out, varid_out(m), o3_out(jjm+1:1:-1, :, :, m))
     316       call nf95_put_var(ncid_out, varid_out(m), o3_out(nbp_lat:1:-1, :, :, m))
    323317       ! (The order of "rlatu" is inverted in the output file)
    324318    end do
     
    336330    ! dimensions and variables, and writes one of the coordinate variables.
    337331
     332    use mod_grid_phy_lmdz, ONLY : nbp_lat
    338333    use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, &
    339334         nf95_put_att, nf95_enddef, nf95_copy_att, nf95_put_var
    340335    use netcdf, only: nf90_clobber, nf90_float, nf90_global
     336    use nrtype, only: pi
     337    use regular_lonlat_mod, only : lat_reg
    341338
    342339    integer, intent(in):: ncid_in, n_plev
     
    349346    ! Variables local to the procedure:
    350347
    351     include "dimensions.h"
    352     ! (for "jjm")
    353     include "paramet.h"
    354     ! (for the other included files)
    355     include "comgeom2.h"
    356     ! (for "rlatu")
    357     include "comconst.h"
    358     ! (for "pi")
    359 
    360348    integer ncerr
    361349    integer dimid_rlatu, dimid_plev, dimid_time
     
    371359    call nf95_def_dim(ncid_out, "time", 360, dimid_time)
    372360    call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev)
    373     call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)
     361    call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu)
    374362
    375363    ! Define coordinate variables:
     
    432420
    433421    ! Write one of the coordinate variables:
    434     call nf95_put_var(ncid_out, varid_rlatu, rlatu(jjm+1:1:-1) / pi * 180.)
     422    call nf95_put_var(ncid_out, varid_rlatu, lat_reg(nbp_lat:1:-1) / pi * 180.)
    435423    ! (convert from rad to degrees and sort in ascending order)
    436424
Note: See TracChangeset for help on using the changeset viewer.