New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 13747 – NEMO

Changeset 13747


Ignore:
Timestamp:
2020-11-09T09:08:14+01:00 (3 years ago)
Author:
smasson
Message:

trunk: remove array copy when calling xios_send_field in iom_put interfaces, see #2563

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/IOM/iom.F90

    r13716 r13747  
    19141914      IF( iom_use(cdname) ) THEN 
    19151915#if defined key_iomput 
    1916          IF( SIZE(pfield2d, dim=1) == jpi .AND. SIZE(pfield2d, dim=2) == jpj ) THEN 
    1917             CALL xios_send_field( cdname, pfield2d(Nis0:Nie0, Njs0:Nje0) )       ! this extraction will create a copy of pfield2d 
    1918          ELSE 
    1919             CALL xios_send_field( cdname, pfield2d ) 
    1920          ENDIF 
     1916         CALL xios_send_field( cdname, pfield2d ) 
    19211917#else 
    19221918         WRITE(numout,*) pfield2d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    19301926      IF( iom_use(cdname) ) THEN 
    19311927#if defined key_iomput 
    1932          IF( SIZE(pfield2d, dim=1) == jpi .AND. SIZE(pfield2d, dim=2) == jpj ) THEN 
    1933             CALL xios_send_field( cdname, pfield2d(Nis0:Nie0, Njs0:Nje0) )       ! this extraction will create a copy of pfield2d 
    1934          ELSE 
    1935             CALL xios_send_field( cdname, pfield2d ) 
    1936          ENDIF 
     1928         CALL xios_send_field( cdname, pfield2d ) 
    19371929#else 
    19381930         WRITE(numout,*) pfield2d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    19461938      IF( iom_use(cdname) ) THEN 
    19471939#if defined key_iomput 
    1948          IF( SIZE(pfield3d, dim=1) == jpi .AND. SIZE(pfield3d, dim=2) == jpj ) THEN 
    1949             CALL xios_send_field( cdname, pfield3d(Nis0:Nie0, Njs0:Nje0,:) )     ! this extraction will create a copy of pfield3d 
    1950          ELSE 
    1951             CALL xios_send_field( cdname, pfield3d ) 
    1952          ENDIF 
     1940         CALL xios_send_field( cdname, pfield3d ) 
    19531941#else 
    19541942         WRITE(numout,*) pfield3d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    19621950      IF( iom_use(cdname) ) THEN 
    19631951#if defined key_iomput 
    1964          IF( SIZE(pfield3d, dim=1) == jpi .AND. SIZE(pfield3d, dim=2) == jpj ) THEN 
    1965             CALL xios_send_field( cdname, pfield3d(Nis0:Nie0, Njs0:Nje0,:) )     ! this extraction will create a copy of pfield3d 
    1966          ELSE 
    1967             CALL xios_send_field( cdname, pfield3d ) 
    1968          ENDIF 
     1952         CALL xios_send_field( cdname, pfield3d ) 
    19691953#else 
    19701954         WRITE(numout,*) pfield3d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    19781962      IF( iom_use(cdname) ) THEN 
    19791963#if defined key_iomput 
    1980          IF( SIZE(pfield4d, dim=1) == jpi .AND. SIZE(pfield4d, dim=2) == jpj ) THEN 
    1981             CALL xios_send_field( cdname, pfield4d(Nis0:Nie0, Njs0:Nje0,:,:) )   ! this extraction will create a copy of pfield4d 
    1982          ELSE 
    1983             CALL xios_send_field (cdname, pfield4d ) 
    1984          ENDIF 
     1964         CALL xios_send_field (cdname, pfield4d ) 
    19851965#else 
    19861966         WRITE(numout,*) pfield4d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    19941974      IF( iom_use(cdname) ) THEN 
    19951975#if defined key_iomput 
    1996          IF( SIZE(pfield4d, dim=1) == jpi .AND. SIZE(pfield4d, dim=2) == jpj ) THEN 
    1997             CALL xios_send_field( cdname, pfield4d(Nis0:Nie0, Njs0:Nje0,:,:) )   ! this extraction will create a copy of pfield4d 
    1998          ELSE 
    1999             CALL xios_send_field (cdname, pfield4d ) 
    2000          ENDIF 
     1976         CALL xios_send_field (cdname, pfield4d ) 
    20011977#else 
    20021978         WRITE(numout,*) pfield4d   ! iom_use(cdname) = .F. -> useless test to avoid compilation warnings 
     
    22042180      ! 
    22052181      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=Ni0glo,nj_glo=Nj0glo,ibegin=mig0(Nis0)-1,jbegin=mjg0(Njs0)-1,ni=Ni_0,nj=Nj_0) 
    2206       CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 0, data_ni = Ni_0, data_jbegin = 0, data_nj = Nj_0) 
     2182      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj) 
    22072183!don't define lon and lat for restart reading context.  
    22082184      IF ( .NOT.ldrxios ) & 
     
    23032279      CALL dom_ngb( 180.0_wp, 90.0_wp, ix, iy, 'T' ) !  i-line that passes near the North Pole : Reference latitude (used in plots) 
    23042280      CALL iom_set_domain_attr("gznl", ni_glo=Ni0glo, nj_glo=Nj0glo, ibegin=mig0(Nis0)-1, jbegin=mjg0(Njs0)-1, ni=Ni_0, nj=Nj_0) 
    2305       CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = 0, data_ni = Ni_0, data_jbegin = 0, data_nj = Nj_0) 
     2281      CALL iom_set_domain_attr("gznl", data_dim=2, data_ibegin = -nn_hls, data_ni = jpi, data_jbegin = -nn_hls, data_nj = jpj) 
    23062282      CALL iom_set_domain_attr("gznl", lonvalue = real(zlon, dp),   & 
    23072283         &                             latvalue = real(RESHAPE(plat(Nis0:Nie0, Njs0:Nje0),(/ Ni_0*Nj_0 /)),dp))   
Note: See TracChangeset for help on using the changeset viewer.