Ignore:
Timestamp:
Mar 17, 2026, 11:12:37 AM (12 days ago)
Author:
jbclement
Message:

PEM:

  • Temporary memory load reduced in "xios_data".
  • Rename local variables in procedures to avoid masking variables in parent scope.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/geometry.F90

    r4134 r4136  
    153153
    154154!=======================================================================
    155 SUBROUTINE lonlat2vect(nlon,nlat,ngrid,v_ll,v_vect)
     155SUBROUTINE lonlat2vect(nlon_in,nlat_in,ngrid_in,v_ll,v_vect)
    156156!-----------------------------------------------------------------------
    157157! NAME
     
    180180! ARGUMENTS
    181181!----------
    182 integer(di),                    intent(in)  :: nlon, nlat, ngrid
    183 real(dp), dimension(nlon,nlat), intent(in)  :: v_ll
    184 real(dp), dimension(ngrid),     intent(out) :: v_vect
     182integer(di),                          intent(in)  :: nlon_in, nlat_in, ngrid_in
     183real(dp), dimension(nlon_in,nlat_in), intent(in)  :: v_ll
     184real(dp), dimension(ngrid_in),        intent(out) :: v_vect
    185185
    186186! LOCAL VARIABLES
     
    190190! CODE
    191191!-----
    192 if (ngrid == 1) then ! 1D case
     192if (ngrid_in == 1) then ! 1D case
    193193    v_vect(1) = v_ll(1,1)
    194194    return
    195195else ! 3D
    196196    ! Check
    197     if (ngrid /= nlon*(nlat - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
     197    if (ngrid_in /= nlon_in*(nlat_in - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
    198198
    199199    ! Initialization
     
    202202    ! Treatment of the poles
    203203    v_vect(1) = v_ll(1,1)
    204     v_vect(ngrid) = v_ll(1,nlat)
     204    v_vect(ngrid_in) = v_ll(1,nlat_in)
    205205
    206206    ! Treatment of regular points
    207     do j = 2,nlat - 1
    208         do i = 1,nlon
    209             v_vect(1 + i + (j - 2)*nlon) = v_ll(i,j)
     207    do j = 2,nlat_in - 1
     208        do i = 1,nlon_in
     209            v_vect(1 + i + (j - 2)*nlon_in) = v_ll(i,j)
    210210        end do
    211211    end do
     
    216216
    217217!=======================================================================
    218 SUBROUTINE vect2lonlat(nlon,nlat,ngrid,v_vect,v_ll)
     218SUBROUTINE vect2lonlat(nlon_in,nlat_in,ngrid_in,v_vect,v_ll)
    219219!-----------------------------------------------------------------------
    220220! NAME
     
    243243! ARGUMENTS
    244244!----------
    245 integer(di),                    intent(in)  :: nlon, nlat, ngrid
    246 real(dp), dimension(ngrid),     intent(in)  :: v_vect
    247 real(dp), dimension(nlon,nlat), intent(out) :: v_ll
     245integer(di),                          intent(in)  :: nlon_in, nlat_in, ngrid_in
     246real(dp), dimension(ngrid_in),        intent(in)  :: v_vect
     247real(dp), dimension(nlon_in,nlat_in), intent(out) :: v_ll
    248248
    249249! LOCAL VARIABLES
     
    253253! CODE
    254254!-----
    255 if (ngrid == 1) then ! 1D case
     255if (ngrid_in == 1) then ! 1D case
    256256    v_ll(1,1) = v_vect(1)
    257257    return
    258258else ! 3D
    259259    ! Check
    260     if (ngrid /= nlon*(nlat - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
     260    if (ngrid_in /= nlon_in*(nlat_in - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
    261261
    262262    ! Initialization
     
    265265    ! Treatment of the poles
    266266    v_ll(:,1) = v_vect(1)
    267     v_ll(:,nlat) = v_vect(ngrid)
     267    v_ll(:,nlat_in) = v_vect(ngrid_in)
    268268
    269269    ! Treatment of regular points
    270     do j = 2,nlat - 1
    271         do i = 1,nlon
    272             v_ll(i,j) = v_vect(1 + i + (j - 2)*nlon)
     270    do j = 2,nlat_in - 1
     271        do i = 1,nlon_in
     272            v_ll(i,j) = v_vect(1 + i + (j - 2)*nlon_in)
    273273        end do
    274274    end do
     
    279279
    280280!=======================================================================
    281 SUBROUTINE dyngrd2vect(ni,nj,ngrid,v_dyn,v_vect)
     281SUBROUTINE dyngrd2vect(ni,nj,ngrid_in,v_dyn,v_vect)
    282282!-----------------------------------------------------------------------
    283283! NAME
     
    306306! ARGUMENTS
    307307!----------
    308 integer(di),                intent(in)  :: ni, nj, ngrid
    309 real(dp), dimension(ni,nj), intent(in)  :: v_dyn
    310 real(dp), dimension(ngrid), intent(out) :: v_vect
     308integer(di),                   intent(in)  :: ni, nj, ngrid_in
     309real(dp), dimension(ni,nj),    intent(in)  :: v_dyn
     310real(dp), dimension(ngrid_in), intent(out) :: v_vect
    311311
    312312! LOCAL VARIABLES
     
    316316! CODE
    317317!-----
    318 if (ngrid == 1) then ! 1D case
     318if (ngrid_in == 1) then ! 1D case
    319319    v_vect(1) = v_dyn(1,1)
    320320    return
    321321else ! 3D
    322322    ! Check
    323     if (ngrid /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
     323    if (ngrid_in /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
    324324
    325325    ! Initialization
     
    328328    ! Treatment of the poles
    329329    v_vect(1) = v_dyn(1,1)
    330     v_vect(ngrid) = v_dyn(1,nj)
     330    v_vect(ngrid_in) = v_dyn(1,nj)
    331331
    332332    ! Treatment of regular points
     
    342342
    343343!=======================================================================
    344 SUBROUTINE vect2dyngrd(ni,nj,ngrid,v_vect,v_dyn)
     344SUBROUTINE vect2dyngrd(ni,nj,ngrid_in,v_vect,v_dyn)
    345345!-----------------------------------------------------------------------
    346346! NAME
     
    369369! ARGUMENTS
    370370!----------
    371 integer(di),                intent(in)  :: ni, nj, ngrid
    372 real(dp), dimension(ngrid), intent(in)  :: v_vect
    373 real(dp), dimension(ni,nj), intent(out) :: v_dyn
     371integer(di),                   intent(in)  :: ni, nj, ngrid_in
     372real(dp), dimension(ngrid_in), intent(in)  :: v_vect
     373real(dp), dimension(ni,nj),    intent(out) :: v_dyn
    374374
    375375! LOCAL VARIABLES
     
    379379! CODE
    380380!-----
    381 if (ngrid == 1) then ! 1D case
     381if (ngrid_in == 1) then ! 1D case
    382382    v_dyn(1,1) = v_vect(1)
    383383    return
    384384else ! 3D
    385385    ! Check
    386     if (ngrid /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
     386    if (ngrid_in /= (ni - 1)*(nj - 2) + 2) call stop_clean(__FILE__,__LINE__,'problem of dimensions!',1)
    387387
    388388    ! Initialization
     
    391391    ! Treatment of the poles
    392392    v_dyn(:,1) = v_vect(1)
    393     v_dyn(:,nj) = v_vect(ngrid)
     393    v_dyn(:,nj) = v_vect(ngrid_in)
    394394
    395395    ! Treatment of regular points
Note: See TracChangeset for help on using the changeset viewer.