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 1804 for branches/dev_005_AWL/NEMO/OPA_SRC/IOM/iom.F90 – NEMO

Ignore:
Timestamp:
2010-02-08T11:51:02+01:00 (14 years ago)
Author:
sga
Message:

merge of trunk changes from r1782 to r1802 into NEMO branch dev_005_AWL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev_005_AWL/NEMO/OPA_SRC/IOM/iom.F90

    r1743 r1804  
    4343   LOGICAL, PUBLIC, PARAMETER ::   lk_iomput = .FALSE.       !: iom_put flag 
    4444#endif 
    45    PUBLIC iom_init, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
     45   PUBLIC iom_init, iom_swap, iom_open, iom_close, iom_setkt, iom_varid, iom_get, iom_gettime, iom_rstput, iom_put 
    4646 
    4747   PRIVATE iom_rp0d, iom_rp1d, iom_rp2d, iom_rp3d 
     
    8686      !!---------------------------------------------------------------------- 
    8787      ! read the xml file 
    88       CALL event__parse_xml_file( 'iodef.xml' )   ! <- to get from the nameliste (namrun)... 
     88      IF( Agrif_Root() ) CALL event__parse_xml_file( 'iodef.xml' )   ! <- to get from the nameliste (namrun)... 
     89      CALL iom_swap 
    8990 
    9091      ! calendar parameters 
     
    119120 
    120121   END SUBROUTINE iom_init 
     122 
     123 
     124   SUBROUTINE iom_swap 
     125      !!--------------------------------------------------------------------- 
     126      !!                   ***  SUBROUTINE  iom_swap  *** 
     127      !! 
     128      !! ** Purpose :  swap context between different agrif grid for xmlio_server 
     129      !!--------------------------------------------------------------------- 
     130#if defined key_iomput 
     131 
     132     IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     133        CALL event__swap_context("nemo") 
     134     ELSE 
     135        CALL event__swap_context(TRIM(Agrif_CFixed())//"_nemo") 
     136     ENDIF 
     137 
     138#endif 
     139   END SUBROUTINE iom_swap 
    121140 
    122141 
     
    164183      ! if iom_open is called for the first time: initialize iom_file(:)%nfid to 0 
    165184      ! (could be done when defining iom_file in f95 but not in f90) 
    166 #if ! defined key_agrif 
    167       IF( iom_open_init == 0 ) THEN 
    168          iom_file(:)%nfid = 0 
    169          iom_open_init = 1 
    170       ENDIF 
    171 #else 
    172185      IF( Agrif_Root() ) THEN 
    173186         IF( iom_open_init == 0 ) THEN 
     
    176189         ENDIF 
    177190      ENDIF 
    178 #endif 
    179191      ! do we read or write the file? 
    180192      IF( PRESENT(ldwrt) ) THEN   ;   llwrt = ldwrt 
     
    199211      ! ============= 
    200212      clname   = trim(cdname) 
    201 #if defined key_agrif 
    202213      IF ( .NOT. Agrif_Root() .AND. .NOT. lliof ) THEN 
    203214         iln    = INDEX(clname,'/')  
     
    206217         clname=TRIM(cltmpn)//TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
    207218      ENDIF 
    208 #endif     
    209219      ! which suffix should we use? 
    210220      SELECT CASE (iolib) 
Note: See TracChangeset for help on using the changeset viewer.