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

Ignore:
Timestamp:
2017-12-12T11:41:19+01:00 (6 years ago)
Author:
timgraham
Message:

Merge in XIOS read/write branch again

File:
1 edited

Legend:

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

    r8985 r8987  
    6161CONTAINS 
    6262 
    63    SUBROUTINE dom_init 
     63   SUBROUTINE dom_init(cdstr) 
    6464      !!---------------------------------------------------------------------- 
    6565      !!                  ***  ROUTINE dom_init  *** 
     
    7979      INTEGER ::   iconf = 0    ! local integers 
    8080      CHARACTER (len=64) ::   cform = "(A12, 3(A13, I7))"  
     81      CHARACTER (len=*), INTENT(IN) :: cdstr                  ! model: NEMO or SAS. Determines core restart variables 
    8182      INTEGER , DIMENSION(jpi,jpj) ::   ik_top , ik_bot       ! top and bottom ocean level 
    8283      REAL(wp), DIMENSION(jpi,jpj) ::   z1_hu_0, z1_hv_0 
     
    128129      CALL dom_glo                     ! global domain versus local domain 
    129130      CALL dom_nam                     ! read namelist ( namrun, namdom ) 
     131      ! 
     132      IF( lwxios ) THEN 
     133!define names for restart write and set core output (restart.F90) 
     134         CALL iom_set_rst_vars(rst_wfields) 
     135         CALL iom_set_rstw_core(cdstr) 
     136      ENDIF 
     137!reset namelist for SAS 
     138      IF(cdstr == 'SAS') THEN 
     139         IF(lrxios) THEN 
     140               IF(lwp) write(numout,*) 'Disable reading restart file using XIOS for SAS' 
     141               lrxios = .FALSE. 
     142         ENDIF 
     143      ENDIF 
     144      ! 
    130145      CALL dom_clo( cn_cfg, nn_cfg )   ! Closed seas and lake 
    131146      CALL dom_hgr                     ! Horizontal mesh 
     
    285300         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    286301         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    287          &             ln_cfmeta, ln_iscpl 
     302         &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 
    288303      NAMELIST/namdom/ ln_linssh, nn_closea, nn_msh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs 
    289304#if defined key_netcdf4 
     
    293308      !!---------------------------------------------------------------------- 
    294309      ! 
     310      ln_xios_read = .false.            ! set in case ln_xios_read is not in namelist 
     311      nn_wxios = 0 
    295312      REWIND( numnam_ref )              ! Namelist namrun in reference namelist : Parameters of the run 
    296313      READ  ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) 
     
    333350         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz = ', nn_chunksz 
    334351         WRITE(numout,*) '      IS coupling at the restart step ln_iscpl   = ', ln_iscpl 
     352         IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     353            WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
     354            WRITE(numout,*) '      Write restart using XIOS        nn_wxios   = ', nn_wxios 
     355         ELSE 
     356            WRITE(numout,*) "      AGRIF: nn_wxios will be ingored. See setting for parent" 
     357            WRITE(numout,*) "      AGRIF: ln_xios_read will be ingored. See setting for parent" 
     358         ENDIF 
    335359      ENDIF 
    336360 
     
    413437      rdt       = rn_rdt 
    414438 
     439      IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     440         lrxios = ln_xios_read.AND.ln_rstart 
     441!set output file type for XIOS based on NEMO namelist  
     442         IF (nn_wxios > 0) lwxios = .TRUE.  
     443         nxioso = nn_wxios 
     444      ENDIF 
     445 
    415446#if defined key_netcdf4 
    416447      !                             ! NetCDF 4 case   ("key_netcdf4" defined) 
Note: See TracChangeset for help on using the changeset viewer.