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 10397 for NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2018-12-14T17:27:24+01:00 (5 years ago)
Author:
smasson
Message:

dev_r10164_HPC09_ESIWACE_PREP_MERGE: action 5 introduce mpp_delay_sum, see #2133

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/src/OCE/IOM/iom.F90

    r10380 r10397  
    5858#endif 
    5959   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get 
    60    PUBLIC iom_getatt, iom_putatt, iom_gettime, iom_rstput, iom_put 
     60   PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_gettime, iom_rstput, iom_delay_rst, iom_put 
    6161   PUBLIC iom_use, iom_context_finalize 
    6262 
     
    14011401   END SUBROUTINE iom_gettime 
    14021402 
     1403   !!---------------------------------------------------------------------- 
     1404   !!                   INTERFACE iom_chkatt 
     1405   !!---------------------------------------------------------------------- 
     1406   SUBROUTINE iom_chkatt( kiomid, cdatt, llok, ksize, cdvar ) 
     1407      INTEGER         , INTENT(in   )                 ::   kiomid    ! Identifier of the file 
     1408      CHARACTER(len=*), INTENT(in   )                 ::   cdatt     ! Name of the attribute 
     1409      LOGICAL         , INTENT(  out)                 ::   llok      ! Error code 
     1410      INTEGER         , INTENT(  out), OPTIONAL       ::   ksize     ! Size of the attribute array 
     1411      CHARACTER(len=*), INTENT(in   ), OPTIONAL       ::   cdvar     ! Name of the variable 
     1412      ! 
     1413      IF( kiomid > 0 ) THEN 
     1414         IF( iom_file(kiomid)%nfid > 0 )   CALL iom_nf90_chkatt( kiomid, cdatt, llok, ksize=ksize, cdvar=cdvar ) 
     1415      ENDIF 
     1416      ! 
     1417   END SUBROUTINE iom_chkatt 
    14031418 
    14041419   !!---------------------------------------------------------------------- 
     
    16431658   END SUBROUTINE iom_rp3d 
    16441659 
     1660 
     1661  SUBROUTINE iom_delay_rst( cdaction, cdcpnt, kncid ) 
     1662      !!--------------------------------------------------------------------- 
     1663      !!   Routine iom_delay_rst: used read/write restart related to mpp_delay 
     1664      !! 
     1665      !!--------------------------------------------------------------------- 
     1666      CHARACTER(len=*), INTENT(in   ) ::   cdaction        ! 
     1667      CHARACTER(len=*), INTENT(in   ) ::   cdcpnt 
     1668      INTEGER         , INTENT(in   ) ::   kncid 
     1669      ! 
     1670      INTEGER  :: ji 
     1671      INTEGER  :: indim 
     1672      LOGICAL  :: llattexist 
     1673      REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zreal1d 
     1674      !!--------------------------------------------------------------------- 
     1675      ! 
     1676      !                                      =================================== 
     1677      IF( TRIM(cdaction) == 'READ' ) THEN   ! read restart related to mpp_delay ! 
     1678         !                                   =================================== 
     1679         DO ji = 1, nbdelay 
     1680            IF ( c_delaycpnt(ji) == cdcpnt ) THEN 
     1681               CALL iom_chkatt( kncid, 'DELAY_'//c_delaylist(ji), llattexist, indim ) 
     1682               IF( llattexist )  THEN 
     1683                  ALLOCATE( todelay(ji)%z1d(indim) ) 
     1684                  CALL iom_getatt( kncid, 'DELAY_'//c_delaylist(ji), todelay(ji)%z1d(:) ) 
     1685                  ndelayid(ji) = 0   ! set to 0 to specify that the value was read in the restart 
     1686               ENDIF 
     1687           ENDIF 
     1688         END DO 
     1689         !                                   ==================================== 
     1690      ELSE                                  ! write restart related to mpp_delay ! 
     1691         !                                   ==================================== 
     1692         DO ji = 1, nbdelay   ! save only ocean delayed global communication variables 
     1693            IF ( c_delaycpnt(ji) == cdcpnt ) THEN 
     1694               IF( ASSOCIATED(todelay(ji)%z1d) ) THEN 
     1695                  CALL mpp_delay_rcv(ji)   ! make sure %z1d is received 
     1696                  CALL iom_putatt( kncid, 'DELAY_'//c_delaylist(ji), todelay(ji)%z1d(:) ) 
     1697               ENDIF 
     1698            ENDIF 
     1699         END DO 
     1700         ! 
     1701      ENDIF 
     1702       
     1703   END SUBROUTINE iom_delay_rst 
     1704   
     1705    
    16451706 
    16461707   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.