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 8801 for branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90 – NEMO

Ignore:
Timestamp:
2017-11-23T16:52:17+01:00 (6 years ago)
Author:
andmirek
Message:

#1953 and #1962 merge dev_r8600_xios_read_write r8793

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90

    r8800 r8801  
    3333   USE wrk_nemo        ! Memory allocation 
    3434   USE timing          ! Timing 
    35    USE iom_def, ONLY : lxios_read 
     35   USE iom_def, ONLY : lrxios, lwxios 
    3636 
    3737   IMPLICIT NONE 
     
    243243      ENDIF 
    244244      ! 
     245      IF(lwxios) THEN 
     246! define variables in restart file when writing with XIOS 
     247         CALL iom_set_rstw_var_active('e3t_b') 
     248         CALL iom_set_rstw_var_active('e3t_n') 
     249         !                                           ! ----------------------- ! 
     250         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     251            !                                        ! ----------------------- ! 
     252            CALL iom_set_rstw_var_active('tilde_e3t_b') 
     253            CALL iom_set_rstw_var_active('tilde_e3t_n') 
     254         END IF 
     255         !                                           ! -------------!     
     256         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case ! 
     257            !                                        ! ------------ ! 
     258            CALL iom_set_rstw_var_active('hdiv_lf') 
     259         ENDIF 
     260         ! 
     261      ENDIF 
     262 
    245263      IF( nn_timing == 1 )  CALL timing_stop('dom_vvl_init') 
    246264      ! 
     
    800818         IF( ln_rstart ) THEN                   !* Read the restart file 
    801819            CALL rst_read_open                  !  open the restart file if necessary 
    802             CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lxios_read    ) 
     820            CALL iom_get( numror, jpdom_autoglo, 'sshn'   , sshn, ldxios = lrxios    ) 
    803821            ! 
    804822            id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) 
     
    811829            !                             ! --------- ! 
    812830            IF( MIN( id1, id2 ) > 0 ) THEN       ! all required arrays exist 
    813                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lxios_read ) 
    814                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lxios_read ) 
     831               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
     832               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
    815833               ! needed to restart if land processor not computed  
    816834               IF(lwp) write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files' 
     
    826844               IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.' 
    827845               IF(lwp) write(numout,*) 'neuler is forced to 0' 
    828                CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lxios_read ) 
     846               CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 
    829847               e3t_n(:,:,:) = e3t_b(:,:,:) 
    830848               neuler = 0 
     
    833851               IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.' 
    834852               IF(lwp) write(numout,*) 'neuler is forced to 0' 
    835                CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lxios_read ) 
     853               CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 
    836854               e3t_b(:,:,:) = e3t_n(:,:,:) 
    837855               neuler = 0 
     
    858876               !                          ! ----------------------- ! 
    859877               IF( MIN( id3, id4 ) > 0 ) THEN  ! all required arrays exist 
    860                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lxios_read ) 
    861                   CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lxios_read ) 
     878                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 
     879                  CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 
    862880               ELSE                            ! one at least array is missing 
    863881                  tilde_e3t_b(:,:,:) = 0.0_wp 
     
    868886                  !                       ! ------------ ! 
    869887                  IF( id5 > 0 ) THEN  ! required array exists 
    870                      CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lxios_read ) 
     888                     CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 
    871889                  ELSE                ! array is missing 
    872890                     hdiv_lf(:,:,:) = 0.0_wp 
     
    929947         !                                   ! =================== 
    930948         IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----' 
     949         IF( lwxios ) CALL iom_swap(      cwxios_context          ) 
    931950         !                                           ! --------- ! 
    932951         !                                           ! all cases ! 
    933952         !                                           ! --------- ! 
    934          CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:) ) 
    935          CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:) ) 
     953         CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:), ldxios = lwxios ) 
     954         CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios ) 
    936955         !                                           ! ----------------------- ! 
    937956         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
    938957            !                                        ! ----------------------- ! 
    939             CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:) ) 
    940             CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:) ) 
     958            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios) 
     959            CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios) 
    941960         END IF 
    942961         !                                           ! -------------!     
    943962         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case ! 
    944963            !                                        ! ------------ ! 
    945             CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:) ) 
    946          ENDIF 
    947          ! 
     964            CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios) 
     965         ENDIF 
     966         ! 
     967         IF( lwxios ) CALL iom_swap(      cxios_context          ) 
    948968      ENDIF 
    949969      ! 
Note: See TracChangeset for help on using the changeset viewer.