Changeset 13970 for NEMO/trunk/src/TOP/PISCES/SED/sedrst.F90
- Timestamp:
- 2020-12-02T10:56:33+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/trunk/src/TOP/PISCES/SED/sedrst.F90
r13286 r13970 42 42 CHARACTER(LEN=50) :: clname ! trc output restart file name 43 43 CHARACTER(LEN=256) :: clpath ! full path to ocean output restart file 44 CHARACTER(LEN=52) :: clpname ! trc output restart file name including AGRIF 44 45 !!---------------------------------------------------------------------- 45 46 ! … … 80 81 IF(lwp) WRITE(numsed,*) & 81 82 ' open sed restart.output NetCDF file: ',TRIM(clpath)//clname 82 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' ) 83 IF(.NOT.lwxios) THEN 84 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' ) 85 ELSE 86 #if defined key_iomput 87 cw_sedrst_cxt = "rstws_"//TRIM(ADJUSTL(clkt)) 88 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 89 clpname = clname 90 ELSE 91 clpname = TRIM(Agrif_CFixed())//"_"//clname 92 ENDIF 93 numrsw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 94 CALL iom_init( cw_sedrst_cxt, kdid = numrsw, ld_closedef = .FALSE. ) 95 #else 96 clinfo = 'Can not use XIOS in trc_rst_opn' 97 CALL ctl_stop(TRIM(clinfo)) 98 #endif 99 ENDIF 100 83 101 lrst_sed = .TRUE. 84 102 ENDIF … … 196 214 CALL pack_arr( jpoce, sedligand(1:jpoce,1:jpksed), & 197 215 & zdta2(1:jpi,1:jpj,1:jpksed), iarroce(1:jpoce) ) 198 199 216 IF( ln_timing ) CALL timing_stop('sed_rst_read') 200 217 … … 240 257 !! 1. WRITE in nutwrs 241 258 !! ------------------ 242 243 zinfo(1) = REAL( kt) 244 CALL iom_rstput( kt, nitrst, numrsw, 'kt', zinfo ) 259 ! zinfo(1) = REAL( kt) 260 CALL iom_rstput( kt, nitrst, numrsw, 'kt', REAL( kt , wp) ) 245 261 246 262 ! Back to 2D geometry … … 299 315 300 316 IF( kt == nitrst ) THEN 301 CALL iom_close( numrsw ) ! close the restart file (only at last time step) 317 IF(.NOT.lwxios) THEN 318 CALL iom_close( numrsw ) ! close the restart file (only at last time step) 319 ELSE 320 CALL iom_context_finalize( cw_sedrst_cxt ) 321 iom_file(numrsw)%nfid = 0 322 numrsw = 0 323 ENDIF 302 324 IF( l_offline .AND. ln_rst_list ) THEN 303 325 nrst_lst = nrst_lst + 1 … … 342 364 REAL(wp) :: zkt, zrdttrc1 343 365 REAL(wp) :: zndastp 366 CHARACTER(len = 82) :: clpname 344 367 345 368 ! Time domain : restart … … 353 376 354 377 IF( ln_rst_sed ) THEN 378 lxios_sini = .FALSE. 355 379 CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr ) 380 381 IF( lrxios) THEN 382 cr_sedrst_cxt = 'sed_rst' 383 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SED' 384 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 385 ! clpname = cn_sedrst_in 386 ! ELSE 387 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_sedrst_in 388 ! ENDIF 389 CALL iom_init( cr_sedrst_cxt, kdid = numrsr, ld_closedef = .TRUE. ) 390 ENDIF 356 391 CALL iom_get ( numrsr, 'kt', zkt ) ! last time-step of previous run 357 358 392 IF(lwp) THEN 359 393 WRITE(numsed,*) ' *** Info read in restart : ' … … 402 436 IF(lwp) WRITE(numsed,*) 'trc_wri : write the TOP restart file (NetCDF) at it= ', kt, ' date= ', ndastp 403 437 IF(lwp) WRITE(numsed,*) '~~~~~~~' 438 IF( lwxios ) CALL iom_init_closedef(cw_sedrst_cxt) 404 439 ENDIF 405 440 CALL iom_rstput( kt, nitrst, numrsw, 'kt' , REAL( kt , wp) ) ! time-step 406 441 CALL iom_rstput( kt, nitrst, numrsw, 'ndastp' , REAL( ndastp, wp) ) ! date 407 CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj 408 ! ! the begining of the run [s]442 CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj ) ! number of elapsed days since 443 ! ! the begining of the run [s] 409 444 ENDIF 410 445
Note: See TracChangeset
for help on using the changeset viewer.