Ignore:
Timestamp:
Aug 21, 2015, 5:13:46 PM (9 years ago)
Author:
Ehouarn Millour
Message:

Physics/dynamics separation:

  • remove all references to dimensions.h from physics. nbp_lon (==iim) , nbp_lat (==jjm+1) and nbp_lev (==llm) from mod_grid_phy_lmdz should be used instead.
  • added module regular_lonlat_mod in phy_common to store information about the global (lon-lat) grid cell boundaries and centers.

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/phylmd/regr_pr_int_m.F90

    r1907 r2346  
    3030    use regr1_lint_m, only: regr1_lint
    3131    use mod_phys_lmdz_mpi_data, only: is_mpi_root
    32 
     32    use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat, nbp_lev
    3333    use mod_phys_lmdz_transfert_para, only: scatter2d
    3434    ! (pack to the LMDZ horizontal "physics" grid and scatter)
     
    4141    ! (pressure level of input data, in Pa, in strictly ascending order)
    4242
    43     real, intent(in):: pplay(:, :) ! (klon, llm)
     43    real, intent(in):: pplay(:, :) ! (klon, nbp_lev)
    4444    ! (pression pour le mileu de chaque couche, en Pa)
    4545
     
    4747    ! (extra value of field at 0 pressure)
    4848
    49     real, intent(out):: v3(:, :) ! (klon, llm)
     49    real, intent(out):: v3(:, :) ! (klon, nbp_lev)
    5050    ! (regridded field on the partial "physics" grid)
    5151    ! ("v3(i, k)" is at longitude "xlon(i)", latitude
     
    5454    ! Variables local to the procedure:
    5555
    56     include "dimensions.h"
    5756    integer varid, ncerr ! for NetCDF
    5857
    59     real  v1(iim, jjm + 1, 0:size(plev))
     58    real  v1(nbp_lon, nbp_lat, 0:size(plev))
    6059    ! (input field at day "julien", on the global "dynamics" horizontal grid)
    6160    ! (First dimension is for longitude.
     
    7271    !--------------------------------------------
    7372
    74     call assert(shape(v3) == (/klon, llm/), "regr_pr_int v3")
    75     call assert(shape(pplay) == (/klon, llm/), "regr_pr_int pplay")
     73    call assert(shape(v3) == (/klon, nbp_lev/), "regr_pr_int v3")
     74    call assert(shape(pplay) == (/klon, nbp_lev/), "regr_pr_int pplay")
    7675
    7776    !$omp master
     
    8483       ! Latitudes are in ascending order in the input file while
    8584       ! "rlatu" is in descending order so we need to invert order:
    86        v1(1, :, 1:) = v1(1, jjm+1:1:-1, 1:)
     85       v1(1, :, 1:) = v1(1, nbp_lat:1:-1, 1:)
    8786
    8887       ! Complete "v1" with the value at 0 pressure:
     
    9089
    9190       ! Duplicate on all longitudes:
    92        v1(2:, :, :) = spread(v1(1, :, :), dim=1, ncopies=iim-1)
     91       v1(2:, :, :) = spread(v1(1, :, :), dim=1, ncopies=nbp_lon-1)
    9392    end if
    9493    !$omp end master
     
    9897    ! Regrid in pressure at each horizontal position:
    9998    do i = 1, klon
    100        v3(i, llm:1:-1) = regr1_lint(v2(i, :), (/0., plev/), pplay(i, llm:1:-1))
     99       v3(i, nbp_lev:1:-1) = regr1_lint(v2(i, :), (/0., plev/), pplay(i, nbp_lev:1:-1))
    101100       ! (invert order of indices because "pplay" is in descending order)
    102101    end do
Note: See TracChangeset for help on using the changeset viewer.