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 11840 for NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icerst.F90 – NEMO

Ignore:
Timestamp:
2019-10-31T16:30:50+01:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2323 write SI3 restart with XIOS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icerst.F90

    r11839 r11840  
    5151      CHARACTER(len=50)   ::   clname   ! ice output restart file name 
    5252      CHARACTER(len=256)  ::   clpath   ! full path to ice output restart file  
     53      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    5354      !!---------------------------------------------------------------------- 
    5455      ! 
     
    8081            ENDIF 
    8182            ! 
    82             CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl ) 
     83            IF(.NOT.lwxios) THEN 
     84               CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl ) 
     85            ELSE 
     86#if defined key_iomput 
     87               cwixios_context = "si3_rstw_"//TRIM(ADJUSTL(clkt)) 
     88               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     89                  clpname = clname 
     90               ELSE 
     91                  clpname = TRIM(Agrif_CFixed())//"_"//clname 
     92               ENDIF 
     93               CALL iom_init( cwixios_context, TRIM(clpath)//TRIM(clpname), .false. ) 
     94               CALL xios_update_calendar(nitrst) 
     95               CALL iom_swap(      cxios_context          ) 
     96#else 
     97               clinfo = 'Can not use XIOS in rst_opn' 
     98               CALL ctl_stop(TRIM(clinfo)) 
     99#endif 
     100            ENDIF 
    83101            lrst_ice = .TRUE. 
    84102         ENDIF 
     
    117135      ! ------------------  
    118136      !                                                                        ! calendar control 
    119       CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step  
    120       CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ) )      ! date 
     137      IF(lwxios) CALL iom_swap(      cwixios_context          ) 
     138      CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ), ldxios = lwxios )      ! time-step  
     139      CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter   , wp ), ldxios = lwxios )      ! date 
    121140      CALL iom_delay_rst( 'WRITE', 'ICE', numriw )   ! save only ice delayed global communication variables 
    122141 
    123142      ! Prognostic variables 
    124       CALL iom_rstput( iter, nitrst, numriw, 'v_i'  , v_i   ) 
    125       CALL iom_rstput( iter, nitrst, numriw, 'v_s'  , v_s   ) 
    126       CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i  ) 
    127       CALL iom_rstput( iter, nitrst, numriw, 'a_i'  , a_i   ) 
    128       CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su  ) 
    129       CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice ) 
    130       CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice ) 
    131       CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i  ) 
    132       CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip  ) 
    133       CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip  ) 
     143      CALL iom_rstput( iter, nitrst, numriw, 'v_i'  , v_i, ldxios = lwxios   ) 
     144      CALL iom_rstput( iter, nitrst, numriw, 'v_s'  , v_s, ldxios = lwxios   ) 
     145      CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i, ldxios = lwxios  ) 
     146      CALL iom_rstput( iter, nitrst, numriw, 'a_i'  , a_i, ldxios = lwxios   ) 
     147      CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su, ldxios = lwxios  ) 
     148      CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice, ldxios = lwxios ) 
     149      CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice, ldxios = lwxios ) 
     150      CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i, ldxios = lwxios  ) 
     151      CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip, ldxios = lwxios  ) 
     152      CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip, ldxios = lwxios  ) 
    134153      ! Snow enthalpy 
    135154      DO jk = 1, nlay_s  
     
    137156         znam = 'e_s'//'_l'//zchar1 
    138157         z3d(:,:,:) = e_s(:,:,jk,:) 
    139          CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 
     158         CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios ) 
    140159      END DO 
    141160      ! Ice enthalpy 
     
    144163         znam = 'e_i'//'_l'//zchar1 
    145164         z3d(:,:,:) = e_i(:,:,jk,:) 
    146          CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 
     165         CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios ) 
    147166      END DO 
    148167      ! fields needed for Met Office (Jules) coupling 
    149168      IF( ln_cpl ) THEN 
    150          CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice ) 
    151          CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice  ) 
    152       ENDIF 
     169         CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice, ldxios = lwxios ) 
     170         CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice, ldxios = lwxios  ) 
     171      ENDIF 
     172      IF(lwxios) CALL iom_swap(      cxios_context          ) 
    153173      ! 
    154174 
     
    156176      ! ------------------ 
    157177      IF( iter == nitrst ) THEN 
    158          CALL iom_close( numriw ) 
     178         IF(lwxios) THEN 
     179            CALL iom_context_finalize(      cwixios_context          ) 
     180         ELSE 
     181            CALL iom_close( numriw ) 
     182         ENDIF 
    159183         lrst_ice = .FALSE. 
    160184      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.