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 13970 for NEMO/trunk/src/ICE/icerst.F90 – NEMO

Ignore:
Timestamp:
2020-12-02T10:56:33+01:00 (3 years ago)
Author:
andmirek
Message:

Ticket #2462 into the trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/ICE/icerst.F90

    r13472 r13970  
    5555      CHARACTER(len=50)   ::   clname   ! ice output restart file name 
    5656      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file  
     57      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    5758      !!---------------------------------------------------------------------- 
    5859      ! 
     
    8485            ENDIF 
    8586            ! 
    86             CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
     87            IF(.NOT.lwxios) THEN 
     88               CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 
     89            ELSE 
     90#if defined key_iomput 
     91               cw_icerst_cxt = "rstwi_"//TRIM(ADJUSTL(clkt)) 
     92               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     93                  clpname = clname 
     94               ELSE 
     95                  clpname = TRIM(Agrif_CFixed())//"_"//clname 
     96               ENDIF 
     97               numriw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 
     98               CALL iom_init( cw_icerst_cxt, kdid = numriw, ld_closedef = .FALSE. ) 
     99               CALL iom_swap( cxios_context ) 
     100#else 
     101               clinfo = 'Can not use XIOS in rst_opn' 
     102               CALL ctl_stop(TRIM(clinfo)) 
     103#endif 
     104            ENDIF 
    87105            lrst_ice = .TRUE. 
    88106         ENDIF 
     
    117135         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~'          
    118136      ENDIF 
    119  
     137       
    120138      ! Write in numriw (if iter == nitrst) 
    121139      ! ------------------  
     
    123141      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step  
    124142      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date 
    125       CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
     143       
     144      IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
    126145 
    127146      ! Prognostic variables 
     
    154173      IF( ln_cpl ) THEN 
    155174         CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice ) 
    156          CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice  ) 
     175         CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice ) 
    157176      ENDIF 
    158177      ! 
     
    161180      ! ------------------ 
    162181      IF( iter == nitrst ) THEN 
    163          CALL iom_close( numriw ) 
     182         IF(.NOT.lwxios) THEN 
     183            CALL iom_close( numriw ) 
     184         ELSE 
     185            CALL iom_context_finalize(      cw_icerst_cxt          ) 
     186            iom_file(numriw)%nfid       = 0 
     187            numriw = 0 
     188         ENDIF 
    164189         lrst_ice = .FALSE. 
    165190      ENDIF 
     
    181206      CHARACTER(len=2)  ::   zchar, zchar1 
    182207      REAL(wp)          ::   zfice, ziter 
     208      CHARACTER(lc)     ::   clpname 
    183209      REAL(wp), DIMENSION(jpi,jpj,jpl) ::   z3d   ! 3D workspace 
    184210      !!---------------------------------------------------------------------- 
     
    190216      ENDIF 
    191217 
     218      lxios_sini = .FALSE. 
    192219      CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir ) 
     220 
     221      IF( lrxios) THEN 
     222          cr_icerst_cxt = 'si3_rst' 
     223          IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3' 
     224!         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     225!            clpname = cn_icerst_in 
     226!         ELSE 
     227!            clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in    
     228!         ENDIF 
     229          CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. ) 
     230      ENDIF 
    193231 
    194232      ! test if v_i exists  
     
    198236      IF( id0 > 0 ) THEN   ! == case of a normal restart == ! 
    199237         !                 ! ------------------------------ ! 
    200           
    201238         ! Time info 
    202239         CALL iom_get( numrir, 'nn_fsbc', zfice ) 
     
    278315         ENDIF 
    279316 
    280          CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    281  
     317         IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ICE', numrir )   ! read only ice delayed global communication variables 
    282318         !                 ! ---------------------------------- ! 
    283319      ELSE                 ! == case of a simplified restart == ! 
Note: See TracChangeset for help on using the changeset viewer.