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 14553 for NEMO/trunk/src/ABL/ablrst.F90 – NEMO

Ignore:
Timestamp:
2021-02-26T18:01:43+01:00 (3 years ago)
Author:
gsamson
Message:

merge ticket2628_r14502_abl_restart_xios branch into trunk; sette identical between r14502 and r14544; ticket #2628

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/ABL/ablrst.F90

    r13286 r14553  
    4545      CHARACTER(len=50)   ::   clname   ! abl output restart file name 
    4646      CHARACTER(len=256)  ::   clpath   ! full path to abl output restart file  
     47      CHARACTER(LEN=52)   ::   clpname  ! abl output restart file name including prefix for AGRIF 
    4748      !!---------------------------------------------------------------------- 
    4849      ! 
     
    7475            ENDIF 
    7576            ! 
    76             CALL iom_open( TRIM(clpath)//TRIM(clname), numraw, ldwrt = .TRUE., kdlev = jpka, cdcomp = 'ABL' ) 
     77            IF(.NOT.lwxios) THEN 
     78               CALL iom_open( TRIM(clpath)//TRIM(clname), numraw, ldwrt = .TRUE., kdlev = jpka, cdcomp = 'ABL' ) 
     79            ELSE 
     80#if defined key_xios 
     81               cw_ablrst_cxt = "rstwa_"//TRIM(ADJUSTL(clkt)) 
     82               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     83                  clpname = clname 
     84               ELSE 
     85                  clpname = TRIM(Agrif_CFixed())//"_"//clname 
     86               ENDIF 
     87               numraw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 
     88               CALL iom_init( cw_ablrst_cxt, kdid = numraw, ld_closedef = .FALSE. ) 
     89               CALL iom_swap( cxios_context ) 
     90#else 
     91               CALL ctl_stop( 'Can not use XIOS in rst_opn' ) 
     92#endif 
     93            ENDIF 
    7794            lrst_abl = .TRUE. 
    7895         ENDIF 
     
    103120 
    104121      ! Write in numraw (if iter == nitrst) 
    105       ! ------------------  
     122      ! ------------------ 
    106123      !                                                                        ! calendar control 
    107124      CALL iom_rstput( iter, nitrst, numraw, 'nn_fsbc', REAL( nn_fsbc, wp ) )      ! time-step  
    108125      CALL iom_rstput( iter, nitrst, numraw, 'kt_abl' , REAL( iter   , wp ) )      ! date 
    109       CALL iom_delay_rst( 'WRITE', 'ABL', numraw )   ! save only abl delayed global communication variables 
     126 
     127      IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ABL', numraw )   ! save only abl delayed global communication variables 
    110128 
    111129      ! Prognostic (after timestep + swap time indices = now timestep) variables 
     
    124142      ! ------------------ 
    125143      IF( iter == nitrst ) THEN 
    126          CALL iom_close( numraw ) 
     144         IF(.NOT.lwxios) THEN 
     145            CALL iom_close( numraw ) 
     146         ELSE 
     147            CALL iom_context_finalize(      cw_ablrst_cxt          ) 
     148            iom_file(numraw)%nfid       = 0 
     149            numraw = 0 
     150         ENDIF 
    127151         lrst_abl = .FALSE. 
    128152      ENDIF 
     
    146170      ENDIF 
    147171 
     172      lxios_sini = .FALSE. 
    148173      CALL iom_open ( TRIM(cn_ablrst_indir)//'/'//cn_ablrst_in, numrar ) 
     174 
     175      IF( lrxios) THEN 
     176          cr_ablrst_cxt = 'abl_rst' 
     177          IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for ABL' 
     178!         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     179!            clpname = cn_ablrst_in 
     180!         ELSE 
     181!            clpname = TRIM(Agrif_CFixed())//"_"//cn_ablrst_in 
     182!         ENDIF 
     183          CALL iom_init( cr_ablrst_cxt, kdid = numrar, ld_closedef = .TRUE. ) 
     184      ENDIF 
    149185 
    150186      ! Time info 
     
    174210      CALL iom_get( numrar, jpdom_auto,'mxld_abl',mxld_abl(:,:,:           ) ) 
    175211      CALL iom_get( numrar, jpdom_auto,    'pblh',    pblh(:,:             ) ) 
    176       CALL iom_delay_rst( 'READ', 'ABL', numrar )   ! read only abl delayed global communication variables 
     212 
     213      IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ABL', numrar )   ! read only abl delayed global communication variables 
    177214 
    178215   END SUBROUTINE abl_rst_read 
Note: See TracChangeset for help on using the changeset viewer.