Changeset 14505
- Timestamp:
- 2021-02-19T10:38:42+01:00 (3 years ago)
- Location:
- NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src/ABL/ablrst.F90
r13286 r14505 45 45 CHARACTER(len=50) :: clname ! abl output restart file name 46 46 CHARACTER(len=256) :: clpath ! full path to abl output restart file 47 CHARACTER(LEN=52) :: clpname ! abl output restart file name including prefix for AGRIF 47 48 !!---------------------------------------------------------------------- 48 49 ! … … 74 75 ENDIF 75 76 ! 76 CALL iom_open( TRIM(clpath)//TRIM(clname), numraw, ldwrt = .TRUE., kdlev = jpka, cdcomp = 'ABL' ) 77 IF(.NOT.lwxios) THEN 78 CALL iom_open( TRIM(clpath)//TRIM(clname), numraw, ldwrt = .TRUE., kdlev = jpka, cdcomp = 'ABL' ) 79 ELSE 80 #if defined key_xios 81 cw_ablrst_cxt = "rstwa_"//TRIM(ADJUSTL(clkt)) 82 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 83 clpname = clname 84 ELSE 85 clpname = TRIM(Agrif_CFixed())//"_"//clname 86 ENDIF 87 numraw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 88 CALL iom_init( cw_ablrst_cxt, kdid = numraw, ld_closedef = .FALSE. ) 89 CALL iom_swap( cxios_context ) 90 #else 91 CALL ctl_stop( 'Can not use XIOS in rst_opn' ) 92 #endif 93 ENDIF 77 94 lrst_abl = .TRUE. 78 95 ENDIF … … 103 120 104 121 ! Write in numraw (if iter == nitrst) 105 ! ------------------ 122 ! ------------------ 106 123 ! ! calendar control 107 124 CALL iom_rstput( iter, nitrst, numraw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step 108 125 CALL iom_rstput( iter, nitrst, numraw, 'kt_abl' , REAL( iter , wp ) ) ! date 109 CALL iom_delay_rst( 'WRITE', 'ABL', numraw ) ! save only abl delayed global communication variables 126 127 IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ABL', numraw ) ! save only abl delayed global communication variables 110 128 111 129 ! Prognostic (after timestep + swap time indices = now timestep) variables … … 124 142 ! ------------------ 125 143 IF( iter == nitrst ) THEN 126 CALL iom_close( numraw ) 144 IF(.NOT.lwxios) THEN 145 CALL iom_close( numraw ) 146 ELSE 147 CALL iom_context_finalize( cw_ablrst_cxt ) 148 iom_file(numraw)%nfid = 0 149 numraw = 0 150 ENDIF 127 151 lrst_abl = .FALSE. 128 152 ENDIF … … 146 170 ENDIF 147 171 172 lxios_sini = .FALSE. 148 173 CALL iom_open ( TRIM(cn_ablrst_indir)//'/'//cn_ablrst_in, numrar ) 174 175 IF( lrxios) THEN 176 cr_ablrst_cxt = 'abl_rst' 177 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3' 178 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 179 ! clpname = cn_ablrst_in 180 ! ELSE 181 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_ablrst_in 182 ! ENDIF 183 CALL iom_init( cr_ablrst_cxt, kdid = numrar, ld_closedef = .TRUE. ) 184 ENDIF 149 185 150 186 ! Time info … … 174 210 CALL iom_get( numrar, jpdom_auto,'mxld_abl',mxld_abl(:,:,: ) ) 175 211 CALL iom_get( numrar, jpdom_auto, 'pblh', pblh(:,: ) ) 176 CALL iom_delay_rst( 'READ', 'ABL', numrar ) ! read only abl delayed global communication variables 212 213 IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ABL', numrar ) ! read only abl delayed global communication variables 177 214 178 215 END SUBROUTINE abl_rst_read -
NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src/OCE/IOM/in_out_manager.F90
r14072 r14505 175 175 CHARACTER(LEN=lc) :: cr_icerst_cxt !: context name used in xios to read SI3 restart 176 176 CHARACTER(LEN=lc) :: cw_icerst_cxt !: context name used in xios to write SI3 restart file 177 CHARACTER(LEN=lc) :: cr_ablrst_cxt !: context name used in xios to read ABL restart 178 CHARACTER(LEN=lc) :: cw_ablrst_cxt !: context name used in xios to write ABL restart file 177 179 CHARACTER(LEN=lc) :: cr_toprst_cxt !: context name used in xios to read TOP restart 178 180 CHARACTER(LEN=lc) :: cw_toprst_cxt !: context name used in xios to write TOP restart file -
NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src/OCE/IOM/iom.F90
r14239 r14505 143 143 144 144 llrstr = (cdname == cr_ocerst_cxt) .OR. (cdname == cr_icerst_cxt) 145 llrstr = llrstr .OR. (cdname == cr_ablrst_cxt) 145 146 llrstr = llrstr .OR. (cdname == cr_toprst_cxt) 146 147 llrstr = llrstr .OR. (cdname == cr_sedrst_cxt) 147 148 148 149 llrstw = (cdname == cw_ocerst_cxt) .OR. (cdname == cw_icerst_cxt) 150 llrstw = llrstw .OR. (cdname == cw_ablrst_cxt) 149 151 llrstw = llrstw .OR. (cdname == cw_toprst_cxt) 150 152 llrstw = llrstw .OR. (cdname == cw_sedrst_cxt) … … 315 317 llrstw = (cdname == cw_ocerst_cxt) 316 318 llrstw = llrstw .OR. (cdname == cw_icerst_cxt) 319 llrstw = llrstw .OR. (cdname == cw_ablrst_cxt) 317 320 llrstw = llrstw .OR. (cdname == cw_toprst_cxt) 318 321 llrstw = llrstw .OR. (cdname == cw_sedrst_cxt) … … 357 360 LOGICAL :: lmeta 358 361 !metadata in restart file for restart read with XIOS 359 INTEGER, PARAMETER :: NMETA = 1 0362 INTEGER, PARAMETER :: NMETA = 11 360 363 CHARACTER(LEN=lc) :: meta(NMETA) 361 364 … … 371 374 meta(9) = "y" 372 375 meta(10) = "numcat" 376 meta(11) = "nav_hgt" 373 377 374 378 clinfo = ' iom_set_vars_active, file: '//TRIM(iom_file(idnum)%name) … … 548 552 IF(idlev == jpk) THEN 549 553 axis_ref="nav_lev" 554 ELSEIF(idlev == jpka) THEN 555 axis_ref="nav_hgt" 550 556 #if defined key_si3 551 557 ELSEIF(idlev == jpl) THEN … … 615 621 CALL iom_set_axis_attr( "numcat", (/ (REAL(ji,wp), ji=1,jpl) /) ) 616 622 #endif 623 CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_hgt") 624 CALL iom_set_axis_attr( "nav_hgt", (/ (REAL(ji,wp), ji=1,jpka) /) ) 617 625 CALL xios_get_handle("scalar_definition", scalargroup_hdl) 618 626 CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") … … 638 646 ELSEIF(kdid == numrir) THEN 639 647 cdcont = cr_icerst_cxt 648 ELSEIF(kdid == numrar) THEN 649 cdcont = cr_ablrst_cxt 640 650 ELSEIF(kdid == numrtr) THEN 641 651 cdcont = cr_toprst_cxt … … 650 660 ELSEIF(kdid == numriw) THEN 651 661 cdcont = cw_icerst_cxt 662 ELSEIF(kdid == numraw) THEN 663 cdcont = cw_ablrst_cxt 652 664 ELSEIF(kdid == numrtw) THEN 653 665 cdcont = cw_toprst_cxt -
NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src/OCE/step.F90
r14239 r14505 133 133 #endif 134 134 ENDIF 135 IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN 135 136 #if defined key_si3 136 IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN137 137 CALL iom_swap( cw_icerst_cxt ) 138 138 CALL iom_init_closedef( cw_icerst_cxt ) 139 139 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 140 ENDIF 141 #endif 140 #endif 141 IF( ln_abl ) THEN 142 CALL iom_swap( cw_ablrst_cxt ) 143 CALL iom_init_closedef( cw_ablrst_cxt ) 144 CALL iom_setkt( kstp - nit000 + 1, cw_ablrst_cxt ) 145 ENDIF 146 ENDIF 142 147 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 143 148 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp -
NEMO/branches/2021/ticket2628_r14502_abl_restart_xios/src/OCE/stpmlf.F90
r14433 r14505 141 141 #endif 142 142 ENDIF 143 IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN 143 144 #if defined key_si3 144 IF( kstp + nn_fsbc - 1 == nitrst .AND. lwxios ) THEN145 145 CALL iom_swap( cw_icerst_cxt ) 146 146 CALL iom_init_closedef( cw_icerst_cxt ) 147 147 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 148 ENDIF 149 #endif 148 #endif 149 IF( ln_abl ) THEN 150 CALL iom_swap( cw_ablrst_cxt ) 151 CALL iom_init_closedef( cw_ablrst_cxt ) 152 CALL iom_setkt( kstp - nit000 + 1, cw_ablrst_cxt ) 153 ENDIF 154 ENDIF 150 155 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 151 156 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp
Note: See TracChangeset
for help on using the changeset viewer.