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 11901 for NEMO – NEMO

Changeset 11901 for NEMO


Ignore:
Timestamp:
2019-11-13T18:27:42+01:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2323 SI3 restart read/write with XIOS for AGRIF

Location:
NEMO/branches/2019/dev_r11756_SI3restart_XIOS
Files:
8 added
6 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/cfgs/AGRIF_DEMO/EXPREF/iodef.xml

    r9770 r11901  
    2626  <context id="2_nemo" src="./2_context_nemo.xml"/>   <!--  NEMO       --> 
    2727  <context id="3_nemo" src="./3_context_nemo.xml"/>   <!--  NEMO       --> 
     28  <context id="nemo_rstw" src="./nemo_rstw.xml"/>       <!--  NEMO RESTART --> 
     29  <context id="1_nemo_rstw" src="./1_nemo_rstw.xml"/>   <!--  NEMO RESTART --> 
     30  <context id="2_nemo_rstw" src="./2_nemo_rstw.xml"/>   <!--  NEMO RESTART --> 
     31  <context id="3_nemo_rstw" src="./3_nemo_rstw.xml"/>   <!--  NEMO RESTART --> 
     32  <context id="si3_rst" src="./si3_rst.xml"/>       <!--  SI3 restart      --> 
     33  <context id="1_si3_rst" src="./1_si3_rst.xml"/>   <!--  SI3 restart      --> 
     34  <context id="2_si3_rst" src="./2_si3_rst.xml"/>   <!--  SI3 restart      --> 
     35  <context id="3_si3_rst" src="./3_si3_rst.xml"/>   <!--  SI3 restart      --> 
    2836</simulation> 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/ICE/icerst.F90

    r11893 r11901  
    220220         IF(lrxios) THEN 
    221221           crixios_context = 'si3_rst' 
    222            CALL iom_init( crixios_context, TRIM(cn_icerst_indir)//'/'//cn_icerst_in, ld_tmppatch = .false. ) 
    223222           lxios_set = .TRUE. 
     223           IF( TRIM(Agrif_CFixed()) /= '0') THEN 
     224              IF(lwp) WRITE(numout,*) 'Enable SI3 restart reading by XIOS for AGRIF' 
     225              CALL iom_init( crixios_context, & 
     226                   TRIM(cn_icerst_indir)//'/'//TRIM(Agrif_CFixed())//"_"//cn_icerst_in, ld_tmppatch = .false. ) 
     227           ELSE 
     228              IF(lwp) WRITE(numout,*) 'Enable SI3 restart reading by XIOS for AGRIF' 
     229              CALL iom_init( crixios_context, TRIM(cn_icerst_indir)//'/'//cn_icerst_in, ld_tmppatch = .false. ) 
     230           ENDIF 
    224231         ENDIF 
    225232 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/DOM/domain.F90

    r11840 r11901  
    344344         WRITE(numout,*) '      NetCDF chunksize (bytes)        nn_chunksz      = ', nn_chunksz 
    345345         WRITE(numout,*) '      IS coupling at the restart step ln_iscpl        = ', ln_iscpl 
    346          IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    347             WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
    348             WRITE(numout,*) '      Write restart using XIOS        nn_wxios   = ', nn_wxios 
    349          ELSE 
    350             WRITE(numout,*) "      AGRIF: nn_wxios will be ingored. See setting for parent" 
    351             WRITE(numout,*) "      AGRIF: ln_xios_read will be ingored. See setting for parent" 
    352          ENDIF 
     346         WRITE(numout,*) '      READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 
     347         WRITE(numout,*) '      Write restart using XIOS        nn_wxios   = ', nn_wxios 
    353348      ENDIF 
    354349 
     
    427422      rdt  = rn_rdt 
    428423 
    429       IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
    430          lrxios = ln_xios_read.AND.ln_rstart 
     424      lrxios = ln_xios_read.AND.ln_rstart 
    431425!set output file type for XIOS based on NEMO namelist  
    432          IF (nn_wxios > 0) lwxios = .TRUE.  
    433          nxioso = nn_wxios 
    434       ENDIF 
     426      IF (nn_wxios > 0) lwxios = .TRUE.  
     427      nxioso = nn_wxios 
    435428 
    436429#if defined key_netcdf4 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/iom.F90

    r11893 r11901  
    309309               ! create the file 
    310310               clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_ocerst_out) 
     311!handle AGRIF 
     312               IF ( .NOT. Agrif_Root() ) clname=TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
     313 
    311314               clpath = TRIM(cn_ocerst_outdir) 
    312315               IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 
    313316               IF(lwp) THEN 
    314                   write(numout, *) 'Create restart file at the step: ', kt 
     317                  write(numout, *) 'Create restart file for the step: ', kt 
    315318               ENDIF 
    316319               CALL iom_set_rstw_active(rst_wfields, TRIM(clpath)//TRIM(clname), nitrstx) 
     
    327330               ! create the file 
    328331               clname = TRIM(cexper)//"_"//TRIM(ADJUSTL(clkt))//"_"//TRIM(cn_icerst_out) 
     332!handle AGRIF 
     333               IF ( .NOT. Agrif_Root() ) clname=TRIM(Agrif_CFixed())//'_'//TRIM(clname) 
     334 
    329335               clpath = TRIM(cn_icerst_outdir)  
    330336               IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath)//'/' 
     
    438444 
    439445!set name of the restart file and enable available fields 
    440         if(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file 
     446        if(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ', TRIM(rst_file) 
    441447        CALL xios_get_handle("file_definition", filegroup_hdl ) 
    442448        CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart') 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/iom_def.F90

    r11893 r11901  
    3535   INTEGER, PARAMETER, PUBLIC ::   jpmax_digits =  5   !: maximum number of digits for the cpu number in the file name 
    3636 
    37  
    38 !$AGRIF_DO_NOT_TREAT 
    39    INTEGER, PUBLIC            ::   iom_open_init = 0   !: used to initialize iom_file(:)%nfid to 0 
    4037!XIOS write restart    
    4138   LOGICAL, PUBLIC            ::   lwxios          !: write single file restart using XIOS 
     
    4441   LOGICAL, PUBLIC            ::   lrxios          !: read single file restart using XIOS 
    4542   LOGICAL, PUBLIC            ::   lxios_sini = .FALSE. ! is restart in a single file 
    46    LOGICAL, PUBLIC            ::   lxios_set  = .FALSE.  
     43   LOGICAL, PUBLIC            ::   lxios_set  = .FALSE. 
    4744 
    48  
     45!$AGRIF_DO_NOT_TREAT 
     46   INTEGER, PUBLIC            ::   iom_open_init = 0   !: used to initialize iom_file(:)%nfid to 0 
    4947 
    5048   TYPE, PUBLIC ::   file_descriptor 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/restart.F90

    r11870 r11901  
    131131      INTEGER, INTENT(in) ::   kt   ! ocean time-step 
    132132      !!---------------------------------------------------------------------- 
     133 
    133134                     IF(lwxios) CALL iom_swap(      cwxios_context          ) 
    134135                     CALL iom_rstput( kt, nitrst, numrow, 'rdt'    , rdt       , ldxios = lwxios)   ! dynamics time step 
     
    207208! restart) 
    208209         IF(.NOT.lxios_set) lrxios = lrxios.AND.lxios_sini 
    209          IF( lrxios) THEN 
     210         IF( lrxios .AND. (.NOT. lxios_set)) THEN 
    210211             crxios_context = 'nemo_rst' 
    211              IF( .NOT. lxios_set ) THEN 
    212                  IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS' 
    213                  CALL iom_init( crxios_context, TRIM(clpath)//cn_ocerst_in, ld_tmppatch = .false. ) 
    214                  lxios_set = .TRUE. 
     212             lxios_set = .TRUE. 
     213             IF( TRIM(Agrif_CFixed()) /= '0') THEN 
     214                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF' 
     215                CALL iom_init( crxios_context, TRIM(clpath)//TRIM(Agrif_CFixed())//"_"//cn_ocerst_in, ld_tmppatch = .false. ) 
     216             ELSE 
     217                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS' 
     218                CALL iom_init( crxios_context, TRIM(clpath)//cn_ocerst_in, ld_tmppatch = .false. ) 
    215219             ENDIF 
    216          ENDIF 
    217          IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios) THEN 
    218              CALL iom_init( crxios_context, TRIM(clpath)//cn_ocerst_in, ld_tmppatch = .false. ) 
    219              IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF' 
    220              lxios_set = .TRUE. 
    221220         ENDIF  
    222221      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.