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 8644 for branches/2017/dev_r8600_xios_write/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90 – NEMO

Ignore:
Timestamp:
2017-10-20T10:04:07+02:00 (7 years ago)
Author:
andmirek
Message:

ticket #1962 xios write functionality works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_r8600_xios_write/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90

    r8630 r8644  
    144144      CALL day( nit000 ) 
    145145      ! 
     146      IF( lwxios ) THEN 
     147! define variables in restart file when writing with XIOS 
     148          CALL set_rstw_var_active('kt') 
     149          CALL set_rstw_var_active('ndastp') 
     150          CALL set_rstw_var_active('adatrj') 
     151          CALL set_rstw_var_active('ntime') 
     152      ENDIF 
     153 
    146154   END SUBROUTINE day_init 
    147155 
     
    341349               ndastp = NINT( zndastp ) 
    342350               CALL iom_get( numror, 'adatrj', adatrj  ) 
    343           CALL iom_get( numror, 'ntime', ktime ) 
    344           nn_time0=INT(ktime) 
     351               CALL iom_get( numror, 'ntime', ktime ) 
     352               nn_time0=INT(ktime) 
    345353               ! calculate start time in hours and minutes 
    346           zdayfrac=adatrj-INT(adatrj) 
    347           ksecs = NINT(zdayfrac*86400)        ! Nearest second to catch rounding errors in adatrj          
    348           ihour = INT(ksecs/3600) 
    349           iminute = ksecs/60-ihour*60 
    350             
     354               zdayfrac=adatrj-INT(adatrj) 
     355               ksecs = NINT(zdayfrac*86400)       ! Nearest second to catch rounding errors in adatrj         
     356               ihour = INT(ksecs/3600) 
     357               iminute = ksecs/60-ihour*60 
     358                  
    351359               ! Add to nn_time0 
    352360               nhour   =   nn_time0 / 100 
    353361               nminute = ( nn_time0 - nhour * 100 ) 
    354           nminute=nminute+iminute 
    355            
    356           IF( nminute >= 60 ) THEN 
    357              nminute=nminute-60 
    358         nhour=nhour+1 
    359           ENDIF 
    360           nhour=nhour+ihour 
    361           IF( nhour >= 24 ) THEN 
    362         nhour=nhour-24 
    363              adatrj=adatrj+1 
    364           ENDIF           
    365           nn_time0 = nhour * 100 + nminute 
    366           adatrj = INT(adatrj)                    ! adatrj set to integer as nn_time0 updated           
     362               nminute=nminute+iminute 
     363                
     364               IF( nminute >= 60 ) THEN 
     365                  nminute=nminute-60 
     366                  nhour=nhour+1 
     367               ENDIF 
     368               nhour=nhour+ihour 
     369               IF( nhour >= 24 ) THEN 
     370                  nhour=nhour-24 
     371                  adatrj=adatrj+1 
     372               ENDIF       
     373               nn_time0 = nhour * 100 + nminute 
     374               adatrj = INT(adatrj)                    ! adatrj set to integer as nn_time0 updated         
    367375            ELSE 
    368376               ! parameters corresponding to nit000 - 1 (as we start the step loop with a call to day) 
     
    378386            ndastp = ndate0           ! ndate0 read in the namelist in dom_nam 
    379387            nhour   =   nn_time0 / 100 
    380        nminute = ( nn_time0 - nhour * 100 ) 
     388            nminute = ( nn_time0 - nhour * 100 ) 
    381389            IF( nhour*3600+nminute*60-ndt05 .lt. 0 )  ndastp=ndastp-1      ! Start hour is specified in the namelist (default 0) 
    382390            adatrj = ( REAL( nit000-1, wp ) * rdt ) / rday 
     
    388396            WRITE(numout,*) '   date ndastp                                      : ', ndastp 
    389397            WRITE(numout,*) '   number of elapsed days since the begining of run : ', adatrj 
    390        WRITE(numout,*) '   nn_time0                                         : ',nn_time0 
     398            WRITE(numout,*) '   nn_time0                                         : ',nn_time0 
    391399            WRITE(numout,*) 
    392400         ENDIF 
     
    405413         CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj, lxios = lwxios            )   ! number of elapsed days since 
    406414         !                                                                     ! the begining of the run [s] 
    407     CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp), lxios = lwxios ) ! time 
     415        CALL iom_rstput( kt, nitrst, numrow, 'ntime'  , REAL( nn_time0, wp), lxios = lwxios ) ! time 
    408416         IF( lwxios ) CALL iom_swap(      cxios_context          ) 
    409417      ENDIF 
Note: See TracChangeset for help on using the changeset viewer.