Changeset 9984


Ignore:
Timestamp:
2018-07-20T15:46:02+02:00 (2 years ago)
Author:
andmirek
Message:

#1953 fix issues with domain definition for restart read with XIOS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/IOM/iom.F90

    r9930 r9984  
    150150      ! 
    151151      IF( TRIM(cdname) == TRIM(cxios_context) ) THEN   
    152          CALL set_grid( "T", glamt, gphit, .FALSE. )  
    153          CALL set_grid( "U", glamu, gphiu, .FALSE. ) 
    154          CALL set_grid( "V", glamv, gphiv, .FALSE. ) 
    155          CALL set_grid( "W", glamt, gphit, .FALSE. ) 
     152         CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. )  
     153         CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) 
     154         CALL set_grid( "V", glamv, gphiv, .FALSE., .FALSE. ) 
     155         CALL set_grid( "W", glamt, gphit, .FALSE., .FALSE. ) 
    156156         CALL set_grid_znl( gphit ) 
    157157         ! 
     
    171171         CALL dom_grid_crs   ! Save the parent grid information  & Switch to coarse grid domain 
    172172         ! 
    173          CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE. )  
    174          CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE. )  
    175          CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE. )  
    176          CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE. )  
     173         CALL set_grid( "T", glamt_crs, gphit_crs, .FALSE., .FALSE. )  
     174         CALL set_grid( "U", glamu_crs, gphiu_crs, .FALSE., .FALSE. )  
     175         CALL set_grid( "V", glamv_crs, gphiv_crs, .FALSE., .FALSE. )  
     176         CALL set_grid( "W", glamt_crs, gphit_crs, .FALSE., .FALSE. )  
    177177         CALL set_grid_znl( gphit_crs ) 
    178178          ! 
     
    227227      IF( TRIM(cdname) == TRIM(crxios_context) ) THEN 
    228228!set names of the fields in restart file IF using XIOS to read data 
    229           CALL iom_set_rst_context() 
     229          CALL iom_set_rst_context(.TRUE.) 
    230230          CALL iom_set_rst_vars(rst_rfields) 
    231231!set which fields are to be read from restart file 
     
    233233      ELSE IF( TRIM(cdname) == TRIM(cwxios_context) ) THEN 
    234234!set names of the fields in restart file IF using XIOS to write data 
    235           CALL iom_set_rst_context() 
     235          CALL iom_set_rst_context(.FALSE.) 
    236236          CALL iom_set_rst_vars(rst_wfields) 
    237237!set which fields are to be written to a restart file 
     
    571571   END SUBROUTINE iom_set_rstw_active 
    572572 
    573    SUBROUTINE iom_set_rst_context( )  
     573   SUBROUTINE iom_set_rst_context(ld_rstr)  
    574574     !!--------------------------------------------------------------------- 
    575575      !!                   ***  SUBROUTINE  iom_set_rst_context  *** 
     
    579579      !!                
    580580      !!--------------------------------------------------------------------- 
     581   LOGICAL, INTENT(IN)               :: ld_rstr 
     582!ld_rstr is true for restart context. There is no need to define grid for  
     583!restart read, because it's read from file 
    581584#if defined key_iomput 
    582585   TYPE(xios_domaingroup)            :: domaingroup_hdl  
     
    589592     CALL xios_get_handle("domain_definition",domaingroup_hdl)  
    590593     CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")  
    591      CALL set_grid("N", glamt, gphit, .TRUE.)  
     594     CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)  
    592595  
    593596     CALL xios_get_handle("axis_definition",axisgroup_hdl)  
     
    19351938 
    19361939 
    1937    SUBROUTINE set_grid( cdgrd, plon, plat, ldxios ) 
     1940   SUBROUTINE set_grid( cdgrd, plon, plat, ldxios, ldrxios ) 
    19381941      !!---------------------------------------------------------------------- 
    19391942      !!                     ***  ROUTINE set_grid  *** 
     
    19471950      INTEGER  :: ni, nj 
    19481951      REAL(wp), DIMENSION(jpi,jpj,jpk) ::   zmask 
    1949       LOGICAL, INTENT(IN) :: ldxios 
     1952      LOGICAL, INTENT(IN) :: ldxios, ldrxios 
    19501953      !!---------------------------------------------------------------------- 
    19511954      ! 
     
    19551958      CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 
    19561959      CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 
    1957       CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
     1960!don't define lon and lat for restart reading context.  
     1961      IF ( .NOT.ldrxios ) & 
     1962         CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)),   & 
    19581963         &                                     latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /)))   
    19591964      ! 
Note: See TracChangeset for help on using the changeset viewer.