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 9367 for branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90 – NEMO

Ignore:
Timestamp:
2018-02-28T17:23:20+01:00 (6 years ago)
Author:
mathiot
Message:

Add restart read/write via XIOS capability (#1953 and #1962 and twiki: 2017WP/Met_Office-1_Mirek_XIOSread). WARNING: need to upgrade XIOS to r1296 to compile

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90

    r9209 r9367  
    5858CONTAINS 
    5959 
    60    SUBROUTINE dom_init 
     60   SUBROUTINE dom_init(cdstr) 
    6161      !!---------------------------------------------------------------------- 
    6262      !!                  ***  ROUTINE dom_init  *** 
     
    7676      INTEGER ::   iconf = 0    ! local integers 
    7777      CHARACTER (len=64) ::   cform = "(A12, 3(A13, I7))"  
     78      CHARACTER (len=*), INTENT(IN) :: cdstr                  ! model: NEMO or SAS. Determines core restart variables 
    7879      INTEGER , DIMENSION(jpi,jpj) ::   ik_top , ik_bot       ! top and bottom ocean level 
    7980      REAL(wp), DIMENSION(jpi,jpj) ::   z1_hu_0, z1_hv_0 
     
    117118      CALL dom_glo                     ! global domain versus local domain 
    118119      CALL dom_nam                     ! read namelist ( namrun, namdom ) 
     120      ! 
     121      IF( lwxios ) THEN 
     122!define names for restart write and set core output (restart.F90) 
     123         CALL iom_set_rst_vars(rst_wfields) 
     124         CALL iom_set_rstw_core(cdstr) 
     125      ENDIF 
     126!reset namelist for SAS 
     127      IF(cdstr == 'SAS') THEN 
     128         IF(lrxios) THEN 
     129               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS' 
     130               lrxios = .FALSE. 
     131         ENDIF 
     132      ENDIF 
     133      ! 
    119134      CALL dom_hgr                     ! Horizontal mesh 
    120135      CALL dom_zgr( ik_top, ik_bot )   ! Vertical mesh and bathymetry 
     
    275290         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    276291         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    277          &             ln_cfmeta, ln_iscpl 
     292         &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 
    278293      NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
    279294#if defined key_netcdf4 
     
    287302         WRITE(numout,*) '~~~~~~~ ' 
    288303      ENDIF 
     304      ! 
    289305      ! 
    290306      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run 
     
    324340         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz 
    325341         WRITE(numout,*) '      IS coupling at the restart step ln_iscpl        = ', ln_iscpl 
     342         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     343            WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
     344            WRITE(numout,*) '      Write restart using XIOS        nn_wxios   = ', nn_wxios 
     345         ELSE 
     346            WRITE(numout,*) "      AGRIF: nn_wxios will be ingored. See setting for parent" 
     347            WRITE(numout,*) "      AGRIF: ln_xios_read will be ingored. See setting for parent" 
     348         ENDIF 
    326349      ENDIF 
    327350 
     
    398421      rdt  = rn_rdt 
    399422 
     423      IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     424         lrxios = ln_xios_read.AND.ln_rstart 
     425!set output file type for XIOS based on NEMO namelist  
     426         IF (nn_wxios > 0) lwxios = .TRUE.  
     427         nxioso = nn_wxios 
     428      ENDIF 
     429 
    400430#if defined key_netcdf4 
    401431      !                             ! NetCDF 4 case   ("key_netcdf4" defined) 
Note: See TracChangeset for help on using the changeset viewer.