Changeset 13022
- Timestamp:
- 2020-06-03T16:20:56+02:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom.F90
r12977 r13022 67 67 PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr 68 68 PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_sdate 69 PRIVATE iom_set_rst_context, iom_set_ rstr_active69 PRIVATE iom_set_rst_context, iom_set_vars_active 70 70 # endif 71 71 PRIVATE iom_set_rstw_active … … 280 280 CALL iom_set_rst_context(.TRUE.) 281 281 !set which fields will be read from restart file 282 CALL iom_set_ rstr_active(fname, idfp)282 CALL iom_set_vars_active(fname, idfp) 283 283 ELSE 284 284 CALL ctl_stop( 'iom_init:', 'restart read with XIOS: missing pointer to NETCDF file' ) … … 342 342 END SUBROUTINE iom_init_closedef 343 343 344 SUBROUTINE iom_set_ rstr_active(cdfname, idnum)344 SUBROUTINE iom_set_vars_active(cdfname, idnum) 345 345 !!--------------------------------------------------------------------- 346 !! *** SUBROUTINE iom_set_rstr_active *** 347 !! 348 !! ** Purpose : define file name in XIOS context for reading restart file, 349 !! enable variables present in restart file for reading with XIOS 346 !! *** SUBROUTINE iom_set_vars_active *** 347 !! 348 !! ** Purpose : define filename in XIOS context for reading file, 349 !! enable variables present in a file for reading with XIOS 350 !! id of the file is assumed to be rrestart. 350 351 !!--------------------------------------------------------------------- 351 352 352 !sets enabled = .TRUE. for each field in restart file353 353 CHARACTER(len=*), INTENT(IN) :: cdfname 354 354 INTEGER , INTENT(IN) :: idnum … … 365 365 LOGICAL :: lmeta 366 366 367 !failed to build with AGRIF368 ! meta(1:NMETA) = ["nav_lat", &369 ! "nav_lon", "nav_lev", "time_instant", &370 ! "time_instant_bounds", "time_counter", &371 ! "time_counter_bounds", "x", "y", "numcat"]372 373 367 meta(1) = "nav_lat" 374 368 meta(2) = "nav_lon" … … 382 376 meta(10) = "numcat" 383 377 384 clinfo = ' iom_set_ rstr_active, file: '//TRIM(cdfname)378 clinfo = ' iom_set_vars_active, file: '//TRIM(cdfname) 385 379 386 380 IF(lwp) write(numout, *) TRIM(clinfo) … … 413 407 IF(.NOT.lmeta) THEN 414 408 CALL xios_add_child(file_hdl, field_hdl, TRIM(varname)) 415 if(lwp) write(numout, *) 'ADD field: ', TRIM(varname)416 IF(lwp) CALL FLUSH(numout)417 409 mdims = ndims 418 410 … … 422 414 423 415 IF(mdims == 3) THEN 424 if(lwp) write(numout, *) '3D', indimlens(ndims)425 IF(lwp) CALL FLUSH(numout)426 427 416 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 428 domain_ref="grid_N", axis_ref=TRIM(iom_axis(indimlens( ndims))), &417 domain_ref="grid_N", axis_ref=TRIM(iom_axis(indimlens(dimids(mdims)))), & 429 418 prec = 8, operation = "instant") 430 419 ELSEIF(mdims == 2) THEN 431 if(lwp) write(numout, *) '2D'432 IF(lwp) CALL FLUSH(numout)433 434 420 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 435 421 domain_ref="grid_N", prec = 8, operation = "instant") 436 422 ELSEIF(mdims == 1) THEN 437 if(lwp) write(numout, *) '1D', indimlens(ndims)438 IF(lwp) CALL FLUSH(numout)439 440 423 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 441 axis_ref=TRIM(iom_axis(indimlens( ndims))), prec = 8, operation = "instant")424 axis_ref=TRIM(iom_axis(indimlens(dimids(mdims)))), prec = 8, operation = "instant") 442 425 ELSEIF(mdims == 0) THEN 443 if(lwp) write(numout, *) '0D'444 IF(lwp) CALL FLUSH(numout)445 446 426 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 447 427 scalar_ref = "grid_scalar", prec = 8, operation = "instant") 448 428 ELSE 449 if(lwp) write(numout, *) 'WAHT?' 450 IF(lwp) CALL FLUSH(numout) 451 452 WRITE(ctmp1,*) 'iom_set_rstr_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 453 CALL ctl_stop( 'iom_set_rstr_active:', ctmp1 ) 429 WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 430 CALL ctl_stop( 'iom_set_vars_active:', ctmp1 ) 454 431 ENDIF 455 432 ENDIF … … 457 434 DEALLOCATE(indimlens, indimnames) 458 435 #endif 459 END SUBROUTINE iom_set_ rstr_active436 END SUBROUTINE iom_set_vars_active 460 437 461 438 SUBROUTINE iom_set_rstw_file(cdrst_file)
Note: See TracChangeset
for help on using the changeset viewer.