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/OCE/IOM – NEMO

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

Ticket #2323 write SI3 restart with XIOS

Location:
NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/in_out_manager.F90

    r11837 r11840  
    171171   CHARACTER(lc) ::   cwxios_context        !: context name used in xios to write NEMO restart file 
    172172   CHARACTER(lc) ::   crixios_context       !: context name used in xios to read SI3 restart 
     173   CHARACTER(lc) ::   cwixios_context       !: context name used in xios to write SI3 restart 
    173174   LOGICAL       ::   lrsi3_nemo            !: is SI3 irestart in nemo format 
    174175 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/iom.F90

    r11837 r11840  
    244244!set names of the fields in restart file IF using XIOS to write data 
    245245          CALL iom_set_rst_context(.FALSE.) 
    246           CALL iom_set_rst_vars(rst_wfields) 
    247246!set which fields are to be written to a restart file 
    248247          CALL iom_set_rstw_active(rst_wfields, fname) 
     248      ELSE IF( TRIM(cdname) == TRIM(cwixios_context) ) THEN 
     249!set names of the fields in restart file IF using XIOS to write data 
     250          CALL iom_set_rst_context(.FALSE.) 
     251!set which fields are to be written to a restart file 
     252          CALL iom_set_rstw_active(rsti_wfields, fname) 
    249253      ELSE 
    250254          CALL set_xmlatt 
     
    361365   END SUBROUTINE iom_set_rstr_active 
    362366 
    363    SUBROUTINE iom_set_rstw_core(cdmdl) 
     367   SUBROUTINE iom_set_rstw_core(drst_wfields, cdmdl) 
    364368      !!--------------------------------------------------------------------- 
    365369      !!                   ***  SUBROUTINE  iom_set_rstw_core  *** 
     
    367371      !! ** Purpose :  set variables which are always in restart file  
    368372      !!--------------------------------------------------------------------- 
    369    CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS 
    370    CHARACTER(LEN=256)             :: clinfo    ! info character 
     373   CHARACTER (len=*), INTENT (IN)   :: cdmdl ! model OPA, SAS or SI3 
     374   TYPE(RST_FIELD),   INTENT(INOUT) :: drst_wfields(max_rst_fields) 
     375   CHARACTER(LEN=256)               :: clinfo    ! info character 
     376   CHARACTER(len=25) ::   znam 
     377   CHARACTER(len=2)  ::   zchar1 
     378   INTEGER           ::   jk 
    371379#if defined key_iomput 
    372380   IF(cdmdl == "OPA") THEN 
    373381!from restart.F90 
    374    CALL iom_set_rstw_var_active(rst_wfields, "rdt") 
     382   CALL iom_set_rstw_var_active(drst_wfields, "rdt") 
    375383   IF ( .NOT. ln_diurnal_only ) THEN 
    376         CALL iom_set_rstw_var_active(rst_wfields, 'ub'  ) 
    377         CALL iom_set_rstw_var_active(rst_wfields, 'vb'  ) 
    378         CALL iom_set_rstw_var_active(rst_wfields, 'tb'  ) 
    379         CALL iom_set_rstw_var_active(rst_wfields, 'sb'  ) 
    380         CALL iom_set_rstw_var_active(rst_wfields, 'sshb') 
     384        CALL iom_set_rstw_var_active(drst_wfields, 'ub'  ) 
     385        CALL iom_set_rstw_var_active(drst_wfields, 'vb'  ) 
     386        CALL iom_set_rstw_var_active(drst_wfields, 'tb'  ) 
     387        CALL iom_set_rstw_var_active(drst_wfields, 'sb'  ) 
     388        CALL iom_set_rstw_var_active(drst_wfields, 'sshb') 
    381389        ! 
    382         CALL iom_set_rstw_var_active(rst_wfields, 'un'  ) 
    383         CALL iom_set_rstw_var_active(rst_wfields, 'vn'  ) 
    384         CALL iom_set_rstw_var_active(rst_wfields, 'tn'  ) 
    385         CALL iom_set_rstw_var_active(rst_wfields, 'sn'  ) 
    386         CALL iom_set_rstw_var_active(rst_wfields, 'sshn') 
    387         CALL iom_set_rstw_var_active(rst_wfields, 'rhop') 
     390        CALL iom_set_rstw_var_active(drst_wfields, 'un'  ) 
     391        CALL iom_set_rstw_var_active(drst_wfields, 'vn'  ) 
     392        CALL iom_set_rstw_var_active(drst_wfields, 'tn'  ) 
     393        CALL iom_set_rstw_var_active(drst_wfields, 'sn'  ) 
     394        CALL iom_set_rstw_var_active(drst_wfields, 'sshn') 
     395        CALL iom_set_rstw_var_active(drst_wfields, 'rhop') 
    388396     ! extra variable needed for the ice sheet coupling 
    389397        IF ( ln_iscpl ) THEN 
    390              CALL iom_set_rstw_var_active(rst_wfields, 'tmask') 
    391              CALL iom_set_rstw_var_active(rst_wfields, 'umask') 
    392              CALL iom_set_rstw_var_active(rst_wfields, 'vmask') 
    393              CALL iom_set_rstw_var_active(rst_wfields, 'smask') 
    394              CALL iom_set_rstw_var_active(rst_wfields, 'e3t_n') 
    395              CALL iom_set_rstw_var_active(rst_wfields, 'e3u_n') 
    396              CALL iom_set_rstw_var_active(rst_wfields, 'e3v_n') 
    397              CALL iom_set_rstw_var_active(rst_wfields, 'gdepw_n') 
     398             CALL iom_set_rstw_var_active(drst_wfields, 'tmask') 
     399             CALL iom_set_rstw_var_active(drst_wfields, 'umask') 
     400             CALL iom_set_rstw_var_active(drst_wfields, 'vmask') 
     401             CALL iom_set_rstw_var_active(drst_wfields, 'smask') 
     402             CALL iom_set_rstw_var_active(drst_wfields, 'e3t_n') 
     403             CALL iom_set_rstw_var_active(drst_wfields, 'e3u_n') 
     404             CALL iom_set_rstw_var_active(drst_wfields, 'e3v_n') 
     405             CALL iom_set_rstw_var_active(drst_wfields, 'gdepw_n') 
    398406        END IF 
    399407      ENDIF 
    400       IF(ln_diurnal) CALL iom_set_rstw_var_active(rst_wfields, 'Dsst') 
     408      IF(ln_diurnal) CALL iom_set_rstw_var_active(drst_wfields, 'Dsst') 
    401409!from trasbc.F90 
    402          CALL iom_set_rstw_var_active(rst_wfields, 'sbc_hc_b') 
    403          CALL iom_set_rstw_var_active(rst_wfields, 'sbc_sc_b') 
     410         CALL iom_set_rstw_var_active(drst_wfields, 'sbc_hc_b') 
     411         CALL iom_set_rstw_var_active(drst_wfields, 'sbc_sc_b') 
     412   ELSE IF(cdmdl == "SI3") THEN 
     413      CALL iom_set_rstw_var_active(drst_wfields, 'nn_fsbc') 
     414      CALL iom_set_rstw_var_active(drst_wfields, 'kt_ice') 
     415      CALL iom_set_rstw_var_active(drst_wfields, 'v_i') 
     416      CALL iom_set_rstw_var_active(drst_wfields, 'v_s') 
     417      CALL iom_set_rstw_var_active(drst_wfields, 'sv_i') 
     418      CALL iom_set_rstw_var_active(drst_wfields, 'a_i') 
     419      CALL iom_set_rstw_var_active(drst_wfields, 't_su') 
     420      CALL iom_set_rstw_var_active(drst_wfields, 'u_ice') 
     421      CALL iom_set_rstw_var_active(drst_wfields, 'v_ice') 
     422      CALL iom_set_rstw_var_active(drst_wfields, 'oa_i') 
     423      CALL iom_set_rstw_var_active(drst_wfields, 'a_ip') 
     424      CALL iom_set_rstw_var_active(drst_wfields, 'v_ip') 
     425      DO jk = 1, nlay_s  
     426         WRITE(zchar1,'(I2.2)') jk 
     427         znam = 'e_s'//'_l'//zchar1 
     428         CALL iom_set_rstw_var_active(drst_wfields, znam ) 
     429      END DO 
     430      ! Ice enthalpy 
     431      DO jk = 1, nlay_i  
     432         WRITE(zchar1,'(I2.2)') jk 
     433         znam = 'e_i'//'_l'//zchar1 
     434         CALL iom_set_rstw_var_active(drst_wfields, znam ) 
     435      END DO 
    404436   ENDIF 
    405437#else 
     
    689721                CALL xios_add_child(file_hdl, field_hdl, TRIM(drst_wfields(i)%vname)) 
    690722                SELECT CASE (TRIM(drst_wfields(i)%grid)) 
     723                 CASE ("grid_Ni_3D") 
     724                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(drst_wfields(i)%vname), & 
     725                        domain_ref="grid_N", axis_ref="numcat", prec = 8, operation = "instant") 
    691726                 CASE ("grid_N_3D") 
    692727                    CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(drst_wfields(i)%vname), & 
  • NEMO/branches/2019/dev_r11756_SI3restart_XIOS/src/OCE/IOM/iom_def.F90

    r11837 r11840  
    6767   END TYPE file_descriptor 
    6868   TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC ::   iom_file !: array containing the info for all opened files 
    69    INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 360!: maximum number of restart variables defined in iom_set_rst_vars 
     69   INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 190!: maximum number of restart variables defined in iom_set_rst_vars 
    7070   TYPE, PUBLIC :: RST_FIELD   
    7171    CHARACTER(len=30) :: vname = "NO_NAME" ! names of variables in restart file 
     
    7575!$AGRIF_END_DO_NOT_TREAT 
    7676   ! 
    77    TYPE(RST_FIELD), PUBLIC, SAVE :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields) 
     77   TYPE(RST_FIELD), PUBLIC, SAVE :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields), rsti_wfields(max_rst_fields) 
    7878   ! 
    7979   !!---------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.