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 14037 for NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/TOP/trcrst.F90 – NEMO

Ignore:
Timestamp:
2020-12-03T12:20:38+01:00 (3 years ago)
Author:
ayoung
Message:

Updated to trunk at 14020. Sette tests passed with change of results for configurations with non-linear ssh. Ticket #2506.

Location:
NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG

    • Property svn:externals
      •  

        old new  
        88 
        99# SETTE 
        10 ^/utils/CI/sette@13292        sette 
         10^/utils/CI/sette_wave@13990         sette 
  • NEMO/branches/2020/dev_r13333_KERNEL-08_techene_gm_HPG_SPG/src/TOP/trcrst.F90

    r13286 r14037  
    5252      CHARACTER(LEN=50)   ::   clname   ! trc output restart file name 
    5353      CHARACTER(LEN=256)  ::   clpath   ! full path to ocean output restart file 
     54      CHARACTER(LEN=50)   ::   clpname  ! trc output restart file name including AGRIF 
    5455      !!---------------------------------------------------------------------- 
    5556      ! 
     
    9192         IF(lwp) WRITE(numout,*) & 
    9293             '             open trc restart.output NetCDF file: ',TRIM(clpath)//clname 
    93          CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. ) 
     94         IF(.NOT.lwxios) THEN 
     95            CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. ) 
     96         ELSE 
     97#if defined key_iomput 
     98            cw_toprst_cxt = "rstwt_"//TRIM(ADJUSTL(clkt)) 
     99            IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     100               clpname = clname 
     101            ELSE 
     102               clpname = TRIM(Agrif_CFixed())//"_"//clname 
     103            ENDIF 
     104            numrtw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 
     105            CALL iom_init( cw_toprst_cxt, kdid = numrtw, ld_closedef = .FALSE. ) 
     106#else 
     107               clinfo = 'Can not use XIOS in trc_rst_opn' 
     108               CALL ctl_stop(TRIM(clinfo)) 
     109#endif 
     110            ENDIF 
    94111         lrst_trc = .TRUE. 
    95112      ENDIF 
     
    121138      END DO 
    122139      ! 
    123       CALL iom_delay_rst( 'READ', 'TOP', numrtr )   ! read only TOP delayed global communication variables 
    124        
     140      IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'TOP', numrtr )   ! read only TOP delayed global communication variables 
    125141   END SUBROUTINE trc_rst_read 
    126142 
     
    147163         CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 
    148164      END DO 
    149       ! 
    150       CALL iom_delay_rst( 'WRITE', 'TOP', numrtw )   ! save only TOP delayed global communication variables 
     165 
     166      IF( .NOT. lwxios ) CALL iom_delay_rst( 'WRITE', 'TOP', numrtw )   ! save only TOP delayed global communication variables 
    151167     
    152168      IF( kt == nitrst ) THEN 
    153169          CALL trc_rst_stat( Kmm, Krhs )             ! statistics 
    154           CALL iom_close( numrtw )     ! close the restart file (only at last time step) 
     170          IF(lwxios) THEN 
     171             CALL iom_context_finalize(      cw_toprst_cxt          ) 
     172             iom_file(numrtw)%nfid       = 0 
     173             numrtw = 0 
     174          ELSE 
     175             CALL iom_close( numrtw )     ! close the restart file (only at last time step) 
     176          ENDIF 
    155177#if ! defined key_trdmxl_trc 
    156178          lrst_trc = .FALSE. 
     
    196218      REAL(wp) ::  zrdttrc1, zkt, zndastp, zdayfrac, ksecs, ktime 
    197219      INTEGER  ::   ihour, iminute 
     220      CHARACTER(len=82) :: clpname 
    198221 
    199222      ! Time domain : restart 
     
    207230 
    208231         IF( ln_rsttr ) THEN 
     232            lxios_sini = .FALSE. 
    209233            CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr ) 
     234            IF( lrxios) THEN 
     235                cr_toprst_cxt = 'top_rst' 
     236                IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for TOP' 
     237!               IF( TRIM(Agrif_CFixed()) == '0' ) THEN 
     238!                  clpname = cn_trcrst_in 
     239!               ELSE 
     240!                  clpname = TRIM(Agrif_CFixed())//"_"//cn_trcrst_in    
     241!               ENDIF 
     242                CALL iom_init( cr_toprst_cxt, kdid = numrtr, ld_closedef = .TRUE. ) 
     243            ENDIF 
     244 
    210245            CALL iom_get ( numrtr, 'kt', zkt )   ! last time-step of previous run 
    211246 
     
    237272               ! calculate start time in hours and minutes 
    238273               zdayfrac=adatrj-INT(adatrj) 
    239                ksecs = NINT(zdayfrac*86400)            ! Nearest second to catch rounding errors in adatrj               
     274               ksecs = NINT(zdayfrac*86400)            ! Nearest second to catch rounding errors in adatrj 
    240275               ihour = INT(ksecs/3600) 
    241276               iminute = ksecs/60-ihour*60 
     
    258293               adatrj = INT(adatrj)                    ! adatrj set to integer as nn_time0 updated             
    259294             ELSE 
     295               ndt05 = NINT( 0.5 * rn_Dt  )   !  --- WARNING --- not defined yet are we did not go through day_init 
    260296               ! parameters corresponding to nit000 - 1 (as we start the step 
    261297               ! loop with a call to day) 
    262                ndastp = ndate0 - 1       ! ndate0 read in the namelist in dom_nam 
     298               ndastp = ndate0        ! ndate0 read in the namelist in dom_nam 
    263299               nhour   =   nn_time0 / 100 
    264300               nminute = ( nn_time0 - nhour * 100 ) 
     
    292328            IF(lwp) WRITE(numout,*) '~~~~~~~' 
    293329         ENDIF 
    294          CALL iom_rstput( kt, nitrst, numrtw, 'kt'     , REAL( kt    , wp) )   ! time-step 
    295          CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp) )   ! date 
    296          CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj            )   ! number of elapsed days since 
     330         CALL iom_rstput( kt, nitrst, numrtw, 'kt'     , REAL( kt    , wp)   )   ! time-step 
     331         CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp)   )   ! date 
     332         CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj              )   ! number of elapsed days since 
    297333         !                                                                     ! the begining of the run [s] 
    298          CALL iom_rstput( kt, nitrst, numrtw, 'ntime'  , REAL( nn_time0, wp)) ! time 
     334         CALL iom_rstput( kt, nitrst, numrtw, 'ntime'  , REAL( nn_time0, wp) ) ! time 
    299335      ENDIF 
    300336 
Note: See TracChangeset for help on using the changeset viewer.