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 9535 for branches/2017/dev_merge_2017/NEMOGCM – NEMO

Ignore:
Timestamp:
2018-05-01T13:22:33+02:00 (6 years ago)
Author:
andmirek
Message:

#1953 and #1962 disable XIOS related calls when key_iomput is not set

Location:
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r9437 r9535  
    6565   PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 
    6666   PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active 
    67    PUBLIC iom_set_rstw_var_active, iom_set_rst_vars 
    6867# endif 
     68   PUBLIC iom_set_rstw_var_active, iom_set_rstw_core, iom_set_rst_vars 
    6969 
    7070   INTERFACE iom_get 
     
    245245   INTEGER :: i 
    246246   LOGICAL :: llis_set 
    247  
     247   CHARACTER(LEN=256) :: clinfo    ! info character 
     248 
     249#if defined key_iomput 
    248250   llis_set = .FALSE. 
    249251 
     
    263265        nstop = nstop + 1 
    264266   ENDIF 
     267#else 
     268        clinfo = 'key_iomput is needed to use XIOS restart read/write functionality' 
     269        CALL ctl_stop(TRIM(clinfo)) 
     270#endif 
    265271 
    266272   END SUBROUTINE iom_set_rstw_var_active 
     
    276282!sets enabled = .TRUE. for each field in restart file 
    277283   CHARACTER(len=256) :: rst_file 
     284 
     285#if defined key_iomput 
    278286   TYPE(xios_field) :: field_hdl 
    279287   TYPE(xios_file) :: file_hdl 
     
    319327         ENDIF 
    320328        END DO 
     329#endif 
    321330   END SUBROUTINE iom_set_rstr_active 
    322331 
     
    328337      !!--------------------------------------------------------------------- 
    329338   CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS 
    330     
     339   CHARACTER(LEN=256)             :: clinfo    ! info character 
     340#if defined key_iomput 
    331341   IF(cdmdl == "OPA") THEN 
    332342!from restart.F90 
     
    362372         CALL iom_set_rstw_var_active('sbc_sc_b') 
    363373   ENDIF 
     374#else 
     375        clinfo = 'key_iomput is needed to use XIOS restart read/write functionality' 
     376        CALL ctl_stop(TRIM(clinfo)) 
     377#endif 
    364378   END SUBROUTINE iom_set_rstw_core 
    365379 
    366380   SUBROUTINE iom_set_rst_vars(fields) 
    367381      !!--------------------------------------------------------------------- 
    368       !!                   ***  SUBROUTINE  iom_set_rstr_active  *** 
     382      !!                   ***  SUBROUTINE iom_set_rst_vars   *** 
    369383      !! 
    370384      !! ** Purpose :  Fill array fields with the information about all  
     
    373387      !!--------------------------------------------------------------------- 
    374388   TYPE(RST_FIELD), INTENT(INOUT) :: fields(max_rst_fields) 
    375  
    376389   INTEGER :: i 
     390 
    377391        i = 0 
    378392        i = i + 1; fields(i)%vname="rdt";            fields(i)%grid="grid_scalar" 
     
    480494        nstop = nstop + 1 
    481495        ENDIF 
    482  
    483496   END SUBROUTINE iom_set_rst_vars 
    484497 
     
    486499   SUBROUTINE iom_set_rstw_active(cdrst_file) 
    487500      !!--------------------------------------------------------------------- 
    488       !!                   ***  SUBROUTINE  iom_set_rstr_active  *** 
     501      !!                   ***  SUBROUTINE iom_set_rstw_active   *** 
    489502      !! 
    490503      !! ** Purpose :  define file name in XIOS context for writing restart 
     
    539552   SUBROUTINE iom_set_rst_context( )  
    540553     !!--------------------------------------------------------------------- 
    541       !!                   ***  SUBROUTINE  iom_set_rstr_active  *** 
     554      !!                   ***  SUBROUTINE  iom_set_rst_context  *** 
    542555      !! 
    543556      !! ** Purpose : Define domain, axis and grid for restart (read/write)  
     
    929942         ENDIF 
    930943      ELSE 
     944#if defined key_iomput 
    931945         IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar) 
    932946         CALL iom_swap( TRIM(crxios_context) ) 
    933947         CALL xios_recv_field( trim(cdvar), pvar) 
    934948         CALL iom_swap( TRIM(cxios_context) ) 
     949#else 
     950         nstop = nstop + 1  
     951         clinfo = 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar) 
     952#endif 
    935953      ENDIF 
    936954   END SUBROUTINE iom_g0d 
     
    12921310         CALL iom_swap( TRIM(crxios_context) )  
    12931311         IF( PRESENT(pv_r3d) ) THEN 
     1312            pv_r3d(:, :, :) = 0. 
    12941313            if(lwp) write(numout,*) 'XIOS RST READ (3D): ',trim(cdvar) 
    12951314            CALL xios_recv_field( trim(cdvar), pv_r3d) 
     
    12981317            ENDIF 
    12991318         ELSEIF( PRESENT(pv_r2d) ) THEN 
     1319            pv_r2d(:, :) = 0. 
    13001320            if(lwp) write(numout,*) 'XIOS RST READ (2D): ', trim(cdvar) 
    13011321            CALL xios_recv_field( trim(cdvar), pv_r2d) 
     
    13041324            ENDIF 
    13051325         ELSEIF( PRESENT(pv_r1d) ) THEN 
     1326            pv_r1d(:) = 0. 
    13061327            if(lwp) write(numout,*) 'XIOS RST READ (1D): ', trim(cdvar) 
    13071328            CALL xios_recv_field( trim(cdvar), pv_r1d) 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r9367 r9535  
    6262      CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
    6363      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
     64      CHARACTER(LEN=256)  ::   clinfo    ! info character 
    6465      !!---------------------------------------------------------------------- 
    6566      ! 
     
    110111               CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 
    111112            ELSE 
     113#if defined key_iomput 
    112114               cwxios_context = "rstw_"//TRIM(ADJUSTL(clkt)) 
    113115               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     
    119121               CALL xios_update_calendar(nitrst) 
    120122               CALL iom_swap(      cxios_context          ) 
     123#else 
     124               clinfo = 'Can not use XIOS in rst_opn' 
     125               CALL ctl_stop(TRIM(clinfo)) 
     126#endif 
    121127            ENDIF 
    122128            lrst_oce = .TRUE. 
Note: See TracChangeset for help on using the changeset viewer.