Ignore:
Timestamp:
Apr 22, 2015, 6:28:50 PM (10 years ago)
Author:
ymipsl
Message:

Removed all iim et jjm depedency. Replaced by nbp_lon and nbp_lat.
Supress gr_fi_ecrit, replaced by grid1dTo2d_glo

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/regr_lat_time_coefoz_m.F90

    r3816 r3819  
    4040    ! when we regrid in pressure).
    4141
     42    use mod_grid_phy_lmdz, ONLY : nbp_lat
    4243    use regr1_step_av_m, only: regr1_step_av
    4344    use regr3_lint_m, only: regr3_lint
     
    5152    ! Variables local to the procedure:
    5253
    53     include "dimensions.h"
    54     ! (for "jjm")
    55 
    5654    integer ncid_in, ncid_out ! NetCDF IDs for input and output files
    5755    integer n_plev ! number of pressure levels in the input data
     
    7371    ! level "plev(l)". "month" is between 1 and 12.)
    7472
    75     real, allocatable:: v_regr_lat(:, :, :) ! (jjm + 1, n_plev, 0:13)
     73    real, allocatable:: v_regr_lat(:, :, :) ! (nbp_lat, n_plev, 0:13)
    7674    ! (mean of a variable "v" over a latitude interval)
    7775    ! (First dimension is latitude interval.
    7876    ! The latitude interval for "v_regr_lat(j,:, :)" contains "rlatu(j)".
    79     ! If "j" is between 2 and "jjm" then the interval is:
     77    ! If "j" is between 2 and "nbp_lat-1" then the interval is:
    8078    ! [rlatv(j), rlatv(j-1)]
    81     ! If "j" is 1 or "jjm + 1" then the interval is:
     79    ! If "j" is 1 or "nbp_lat" then the interval is:
    8280    ! [rlatv(1), pi / 2]
    8381    ! or:
    84     ! [- pi / 2, rlatv(jjm)]
     82    ! [- pi / 2, rlatv(nbp_lat-1)]
    8583    ! respectively.
    8684    ! "v_regr_lat(:, l, :)" is for pressure level "plev(l)".
    8785    ! Last dimension is month number.)
    8886
    89     real, allocatable:: o3_par_out(:, :, :) ! (jjm + 1, n_plev, 360)
     87    real, allocatable:: o3_par_out(:, :, :) ! (nbp_lat, n_plev, 360)
    9088    ! (regridded ozone parameter)
    9189    ! ("o3_par_out(j, l, day)" is at latitude "rlatu(j)", pressure
     
    198196
    199197    allocate(o3_par_in(n_lat, n_plev, 12))
    200     allocate(v_regr_lat(jjm + 1, n_plev, 0:13))
    201     allocate(o3_par_out(jjm + 1, n_plev, 360))
     198    allocate(v_regr_lat(nbp_lat, n_plev, 0:13))
     199    allocate(o3_par_out(nbp_lat, n_plev, 360))
    202200
    203201    do i_v = 1, n_o3_param
     
    212210       ! We average with respect to sine of latitude, which is
    213211       ! equivalent to weighting by cosine of latitude:
    214        v_regr_lat(jjm+1:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
    215             xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(jjm:1:-1), pi / 2/)))
     212       v_regr_lat(nbp_lat:1:-1, :, 1:12) = regr1_step_av(o3_par_in, &
     213            xs=sin(lat_in_edg), xt=sin((/- pi / 2, rlatv(nbp_lat-1:1:-1), pi / 2/)))
    216214       ! (invert order of indices in "v_regr_lat" because "rlatu" is
    217215       ! in descending order)
     
    227225       ! Write to file:
    228226       call nf95_put_var(ncid_out, varid_out(i_v), &
    229             o3_par_out(jjm+1:1:-1, :, :))
     227            o3_par_out(nbp_lat:1:-1, :, :))
    230228       ! (The order of "rlatu" is inverted in the output file)
    231229    end do
     
    244242    ! dimensions and variables, and writes one of the coordinate variables.
    245243
     244    use mod_grid_phy_lmdz, ONLY : nbp_lat
    246245    use assert_eq_m, only: assert_eq
    247246
     
    260259    ! Variables local to the procedure:
    261260
    262     include "dimensions.h"
    263     ! (for "jjm")
    264261
    265262    integer ncerr
     
    279276    call nf95_def_dim(ncid_out, "time", 360, dimid_time)
    280277    call nf95_def_dim(ncid_out, "plev", n_plev, dimid_plev)
    281     call nf95_def_dim(ncid_out, "rlatu", jjm + 1, dimid_rlatu)
     278    call nf95_def_dim(ncid_out, "rlatu", nbp_lat, dimid_rlatu)
    282279
    283280    ! Define coordinate variables:
     
    329326
    330327    ! Write one of the coordinate variables:
    331     call nf95_put_var(ncid_out, varid_rlatu, rlatu(jjm+1:1:-1) / pi * 180.)
     328    call nf95_put_var(ncid_out, varid_rlatu, rlatu(nbp_lat:1:-1) / pi * 180.)
    332329    ! (convert from rad to degrees and sort in ascending order)
    333330
Note: See TracChangeset for help on using the changeset viewer.