Changeset 8801
- Timestamp:
- 2017-11-23T16:52:17+01:00 (7 years ago)
- Location:
- branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/CONFIG/SHARED/namelist_ref
r8800 r8801 54 54 nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 55 55 ln_xios_read = .FALSE. ! use XIOS to read restart file (only for a single file restart) 56 nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output 56 57 / 57 58 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
r8800 r8801 32 32 USE timing ! preformance summary 33 33 USE wrk_nemo ! work arrays 34 USE iom_def, ONLY : lxios_read 34 USE iom_def, ONLY : lwxios 35 USE iom_def, ONLY : lrxios 35 36 36 37 IMPLICIT NONE … … 256 257 IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp 257 258 IF(lwp) WRITE(numout,*) '~~~~~~~' 258 CALL iom_get( numror, 'frc_v', frc_v, ldxios = l xios_read)259 CALL iom_get( numror, 'frc_t', frc_t, ldxios = l xios_read)260 CALL iom_get( numror, 'frc_s', frc_s, ldxios = l xios_read)259 CALL iom_get( numror, 'frc_v', frc_v, ldxios = lrxios ) 260 CALL iom_get( numror, 'frc_t', frc_t, ldxios = lrxios ) 261 CALL iom_get( numror, 'frc_s', frc_s, ldxios = lrxios ) 261 262 IF( ln_linssh ) THEN 262 CALL iom_get( numror, 'frc_wn_t', frc_wn_t, ldxios = l xios_read)263 CALL iom_get( numror, 'frc_wn_s', frc_wn_s, ldxios = l xios_read)263 CALL iom_get( numror, 'frc_wn_t', frc_wn_t, ldxios = lrxios ) 264 CALL iom_get( numror, 'frc_wn_s', frc_wn_s, ldxios = lrxios ) 264 265 ENDIF 265 CALL iom_get( numror, jpdom_autoglo, 'surf_ini', surf_ini, ldxios = l xios_read) ! ice sheet coupling266 CALL iom_get( numror, jpdom_autoglo, 'ssh_ini', ssh_ini(:,:), ldxios = l xios_read)267 CALL iom_get( numror, jpdom_autoglo, 'e3t_ini', e3t_ini(:,:,:), ldxios = l xios_read)268 CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini(:,:,:), ldxios = l xios_read)269 CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini(:,:,:), ldxios = l xios_read)266 CALL iom_get( numror, jpdom_autoglo, 'surf_ini', surf_ini, ldxios = lrxios ) ! ice sheet coupling 267 CALL iom_get( numror, jpdom_autoglo, 'ssh_ini', ssh_ini(:,:), ldxios = lrxios ) 268 CALL iom_get( numror, jpdom_autoglo, 'e3t_ini', e3t_ini(:,:,:), ldxios = lrxios ) 269 CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini(:,:,:), ldxios = lrxios ) 270 CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini(:,:,:), ldxios = lrxios ) 270 271 IF( ln_linssh ) THEN 271 CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini(:,:), ldxios = l xios_read)272 CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini(:,:), ldxios = l xios_read)272 CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini(:,:), ldxios = lrxios ) 273 CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini(:,:), ldxios = lrxios ) 273 274 ENDIF 274 275 ELSE … … 309 310 IF(lwp) WRITE(numout,*) ' dia_hsb_rst at it= ', kt,' date= ', ndastp 310 311 IF(lwp) WRITE(numout,*) '~~~~~~~' 311 312 CALL iom_rstput( kt, nitrst, numrow, 'frc_v' , frc_v 313 CALL iom_rstput( kt, nitrst, numrow, 'frc_t' , frc_t 314 CALL iom_rstput( kt, nitrst, numrow, 'frc_s' , frc_s 312 IF( lwxios ) CALL iom_swap( cwxios_context ) 313 CALL iom_rstput( kt, nitrst, numrow, 'frc_v' , frc_v, ldxios = lwxios) 314 CALL iom_rstput( kt, nitrst, numrow, 'frc_t' , frc_t, ldxios = lwxios) 315 CALL iom_rstput( kt, nitrst, numrow, 'frc_s' , frc_s, ldxios = lwxios) 315 316 IF( ln_linssh ) THEN 316 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t 317 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s )317 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t, ldxios = lwxios) 318 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s, ldxios = lwxios ) 318 319 ENDIF 319 CALL iom_rstput( kt, nitrst, numrow, 'surf_ini', surf_ini ) ! ice sheet coupling320 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini', ssh_ini(:,:) )321 CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini', e3t_ini(:,:,:) )322 CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini(:,:,:) )323 CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini(:,:,:) )320 CALL iom_rstput( kt, nitrst, numrow, 'surf_ini', surf_ini, ldxios = lwxios ) ! ice sheet coupling 321 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini', ssh_ini(:,:), ldxios = lwxios ) 322 CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini', e3t_ini(:,:,:), ldxios = lwxios ) 323 CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini(:,:,:), ldxios = lwxios ) 324 CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini(:,:,:), ldxios = lwxios ) 324 325 IF( ln_linssh ) THEN 325 CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini(:,:) )326 CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini(:,:) )326 CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini(:,:), ldxios = lwxios ) 327 CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini(:,:), ldxios = lwxios ) 327 328 ENDIF 328 329 ! 330 IF( lwxios ) CALL iom_swap( cxios_context ) 329 331 ENDIF 330 332 ! … … 368 370 IF( .NOT. ln_diahsb ) RETURN 369 371 372 IF(lwxios) THEN 373 ! define variables in restart file when writing with XIOS 374 CALL iom_set_rstw_var_active('frc_v') 375 CALL iom_set_rstw_var_active('frc_t') 376 CALL iom_set_rstw_var_active('frc_s') 377 IF( ln_linssh ) THEN 378 CALL iom_set_rstw_var_active('frc_wn_t') 379 CALL iom_set_rstw_var_active('frc_wn_s') 380 ENDIF 381 CALL iom_set_rstw_var_active('surf_ini') 382 CALL iom_set_rstw_var_active('ssh_ini') 383 CALL iom_set_rstw_var_active('e3t_ini') 384 CALL iom_set_rstw_var_active('hc_loc_ini') 385 CALL iom_set_rstw_var_active('sc_loc_ini') 386 IF( ln_linssh ) THEN 387 CALL iom_set_rstw_var_active('ssh_hc_loc_ini') 388 CALL iom_set_rstw_var_active('ssh_sc_loc_ini') 389 ENDIF 390 ENDIF 370 391 ! ------------------- ! 371 392 ! 1 - Allocate memory ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/daymod.F90
r8800 r8801 33 33 USE timing ! Timing 34 34 USE restart ! restart 35 USE iom_def, ONLY : lxios_read 35 USE iom_def, ONLY : lwxios 36 USE iom_def, ONLY : lrxios 36 37 37 38 IMPLICIT NONE … … 144 145 CALL day( nit000 ) 145 146 ! 147 IF( lwxios ) THEN 148 ! define variables in restart file when writing with XIOS 149 CALL iom_set_rstw_var_active('kt') 150 CALL iom_set_rstw_var_active('ndastp') 151 CALL iom_set_rstw_var_active('adatrj') 152 CALL iom_set_rstw_var_active('ntime') 153 ENDIF 154 146 155 END SUBROUTINE day_init 147 156 … … 319 328 IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN 320 329 ! Get Calendar informations 321 CALL iom_get( numror, 'kt', zkt, ldxios = l xios_read) ! last time-step of previous run330 CALL iom_get( numror, 'kt', zkt, ldxios = lrxios ) ! last time-step of previous run 322 331 IF(lwp) THEN 323 332 WRITE(numout,*) ' *** Info read in restart : ' … … 338 347 IF ( nrstdt == 2 ) THEN 339 348 ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 340 CALL iom_get( numror, 'ndastp', zndastp, ldxios = l xios_read)349 CALL iom_get( numror, 'ndastp', zndastp, ldxios = lrxios ) 341 350 ndastp = NINT( zndastp ) 342 CALL iom_get( numror, 'adatrj', adatrj, ldxios = l xios_read)343 CALL iom_get( numror, 'ntime', ktime, ldxios = l xios_read)351 CALL iom_get( numror, 'adatrj', adatrj, ldxios = lrxios ) 352 CALL iom_get( numror, 'ntime', ktime, ldxios = lrxios ) 344 353 nn_time0=INT(ktime) 345 354 ! calculate start time in hours and minutes … … 400 409 ENDIF 401 410 ! calendar control 402 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 403 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date 404 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since 411 IF( lwxios ) CALL iom_swap( cwxios_context ) 412 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp), ldxios = lwxios ) ! time-step 413 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp), ldxios = lwxios ) ! date 414 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj, ldxios = lwxios ) ! number of elapsed days since 405 415 ! ! the begining of the run [s] 406 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp) ) ! time 416 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp), ldxios = lwxios ) ! time 417 IF( lwxios ) CALL iom_swap( cxios_context ) 407 418 ENDIF 408 419 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
r8800 r8801 47 47 USE wrk_nemo ! Memory Allocation 48 48 USE timing ! Timing 49 USE iom_def, ONLY : lxios_read 49 USE iom_def, ONLY:lwxios, nxioso, rst_wfields ! write restart flag and output type 50 USE iom, ONLY : iom_set_rst_vars, iom_set_rstw_core 51 USE iom_def, ONLY : lrxios 50 52 51 53 IMPLICIT NONE … … 129 131 CALL dom_glo ! global domain versus local domain 130 132 CALL dom_nam ! read namelist ( namrun, namdom ) 133 ! 134 IF( lwxios ) THEN 135 !define names for restart write and set core output (restart.F90) 136 CALL iom_set_rst_vars(rst_wfields) 137 CALL iom_set_rstw_core() 138 ENDIF 139 ! 131 140 CALL dom_clo( cn_cfg, nn_cfg ) ! Closed seas and lake 132 141 CALL dom_hgr ! Horizontal mesh … … 286 295 & nn_it000, nn_itend , nn_date0 , nn_time0 , nn_leapy , nn_istate , & 287 296 & nn_stock, nn_write , ln_mskland , ln_clobber , nn_chunksz, nn_euler , & 288 & ln_cfmeta, ln_iscpl, ln_xios_read 297 & ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 289 298 NAMELIST/namdom/ ln_linssh, nn_closea, nn_msh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs 290 299 #if defined key_netcdf4 … … 295 304 ! 296 305 ln_xios_read = .false. ! set in case ln_xios_read is not in namelist 306 nn_wxios = 0 297 307 REWIND( numnam_ref ) ! Namelist namrun in reference namelist : Parameters of the run 298 308 READ ( numnam_ref, namrun, IOSTAT = ios, ERR = 901) … … 336 346 WRITE(numout,*) ' IS coupling at the restart step ln_iscpl = ', ln_iscpl 337 347 WRITE(numout,*) ' READ restart for a single file using XIOS ln_xios_read =', ln_xios_read 338 IF( TRIM(Agrif_CFixed()) /= '0') THEN 339 WRITE(numout,*) ' READ restart for a single file using XIOS WILL not use AGRIF setting.' 340 ENDIF 348 IF( TRIM(Agrif_CFixed()) /= '0') & 349 & WRITE(numout,*) ' READ restart for a single file using XIOS WILL not use AGRIF setting.' 350 IF( TRIM(Agrif_CFixed()) == '0' ) & 351 & WRITE(numout,*) ' Write restart using XIOS nn_wxios = ', nn_wxios 341 352 ENDIF 342 353 … … 354 365 neuler = nn_euler 355 366 IF( TRIM(Agrif_CFixed()) == '0') THEN 356 l xios_read= ln_xios_read.AND.ln_rstart367 lrxios = ln_xios_read.AND.ln_rstart 357 368 ENDIF 358 369 IF ( neuler == 1 .AND. .NOT. ln_rstart ) THEN … … 422 433 rdt = rn_rdt 423 434 435 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 436 !set output file type for XIOS based on NEMO namelist 437 if (nn_wxios > 0) lwxios = .TRUE. 438 nxioso = nn_wxios 439 ELSE 440 IF(lwp) THEN 441 write(numout,*) 442 write(numout,*) "AGRIF: nn_wxios will be ingored. See setting for NEMO" 443 write(numout,*) 444 ENDIF 445 ENDIF 446 424 447 #if defined key_netcdf4 425 448 ! ! NetCDF 4 case ("key_netcdf4" defined) -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
r8800 r8801 33 33 USE wrk_nemo ! Memory allocation 34 34 USE timing ! Timing 35 USE iom_def, ONLY : l xios_read35 USE iom_def, ONLY : lrxios, lwxios 36 36 37 37 IMPLICIT NONE … … 243 243 ENDIF 244 244 ! 245 IF(lwxios) THEN 246 ! define variables in restart file when writing with XIOS 247 CALL iom_set_rstw_var_active('e3t_b') 248 CALL iom_set_rstw_var_active('e3t_n') 249 ! ! ----------------------- ! 250 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases ! 251 ! ! ----------------------- ! 252 CALL iom_set_rstw_var_active('tilde_e3t_b') 253 CALL iom_set_rstw_var_active('tilde_e3t_n') 254 END IF 255 ! ! -------------! 256 IF( ln_vvl_ztilde ) THEN ! z_tilde case ! 257 ! ! ------------ ! 258 CALL iom_set_rstw_var_active('hdiv_lf') 259 ENDIF 260 ! 261 ENDIF 262 245 263 IF( nn_timing == 1 ) CALL timing_stop('dom_vvl_init') 246 264 ! … … 800 818 IF( ln_rstart ) THEN !* Read the restart file 801 819 CALL rst_read_open ! open the restart file if necessary 802 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn, ldxios = l xios_read)820 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn, ldxios = lrxios ) 803 821 ! 804 822 id1 = iom_varid( numror, 'e3t_b', ldstop = .FALSE. ) … … 811 829 ! ! --------- ! 812 830 IF( MIN( id1, id2 ) > 0 ) THEN ! all required arrays exist 813 CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = l xios_read)814 CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = l xios_read)831 CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 832 CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 815 833 ! needed to restart if land processor not computed 816 834 IF(lwp) write(numout,*) 'dom_vvl_rst : e3t_b and e3t_n found in restart files' … … 826 844 IF(lwp) write(numout,*) 'e3t_n set equal to e3t_b.' 827 845 IF(lwp) write(numout,*) 'neuler is forced to 0' 828 CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = l xios_read)846 CALL iom_get( numror, jpdom_autoglo, 'e3t_b', e3t_b(:,:,:), ldxios = lrxios ) 829 847 e3t_n(:,:,:) = e3t_b(:,:,:) 830 848 neuler = 0 … … 833 851 IF(lwp) write(numout,*) 'e3t_b set equal to e3t_n.' 834 852 IF(lwp) write(numout,*) 'neuler is forced to 0' 835 CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = l xios_read)853 CALL iom_get( numror, jpdom_autoglo, 'e3t_n', e3t_n(:,:,:), ldxios = lrxios ) 836 854 e3t_b(:,:,:) = e3t_n(:,:,:) 837 855 neuler = 0 … … 858 876 ! ! ----------------------- ! 859 877 IF( MIN( id3, id4 ) > 0 ) THEN ! all required arrays exist 860 CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = l xios_read)861 CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = l xios_read)878 CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lrxios ) 879 CALL iom_get( numror, jpdom_autoglo, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lrxios ) 862 880 ELSE ! one at least array is missing 863 881 tilde_e3t_b(:,:,:) = 0.0_wp … … 868 886 ! ! ------------ ! 869 887 IF( id5 > 0 ) THEN ! required array exists 870 CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = l xios_read)888 CALL iom_get( numror, jpdom_autoglo, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lrxios ) 871 889 ELSE ! array is missing 872 890 hdiv_lf(:,:,:) = 0.0_wp … … 929 947 ! ! =================== 930 948 IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----' 949 IF( lwxios ) CALL iom_swap( cwxios_context ) 931 950 ! ! --------- ! 932 951 ! ! all cases ! 933 952 ! ! --------- ! 934 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:) )935 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:) )953 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t_b(:,:,:), ldxios = lwxios ) 954 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios ) 936 955 ! ! ----------------------- ! 937 956 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases ! 938 957 ! ! ----------------------- ! 939 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:) 940 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:) 958 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:), ldxios = lwxios) 959 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:), ldxios = lwxios) 941 960 END IF 942 961 ! ! -------------! 943 962 IF( ln_vvl_ztilde ) THEN ! z_tilde case ! 944 963 ! ! ------------ ! 945 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:) ) 946 ENDIF 947 ! 964 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:), ldxios = lwxios) 965 ENDIF 966 ! 967 IF( lwxios ) CALL iom_swap( cxios_context ) 948 968 ENDIF 949 969 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DOM/iscplrst.F90
r8800 r8801 25 25 USE iscplini ! ice sheet coupling: initialisation 26 26 USE iscplhsb ! ice sheet coupling: conservation 27 USE iom_def, ONLY : l xios_read27 USE iom_def, ONLY : lrxios 28 28 29 29 IMPLICIT NONE … … 65 65 66 66 !! get restart variable 67 CALL iom_get( numror, jpdom_autoglo, 'tmask' , ztmask_b, ldxios = l xios_read) ! need to extrapolate T/S68 CALL iom_get( numror, jpdom_autoglo, 'umask' , zumask_b, ldxios = l xios_read) ! need to correct barotropic velocity69 CALL iom_get( numror, jpdom_autoglo, 'vmask' , zvmask_b, ldxios = l xios_read) ! need to correct barotropic velocity70 CALL iom_get( numror, jpdom_autoglo, 'smask' , zsmask_b, ldxios = l xios_read) ! need to correct barotropic velocity71 CALL iom_get( numror, jpdom_autoglo, 'e3t_n' , ze3t_b(:,:,:), ldxios = l xios_read) ! need to compute temperature correction72 CALL iom_get( numror, jpdom_autoglo, 'e3u_n' , ze3u_b(:,:,:), ldxios = l xios_read) ! need to correct barotropic velocity73 CALL iom_get( numror, jpdom_autoglo, 'e3v_n' , ze3v_b(:,:,:), ldxios = l xios_read) ! need to correct barotropic velocity74 CALL iom_get( numror, jpdom_autoglo, 'gdepw_n', zdepw_b(:,:,:), ldxios = l xios_read) ! need to interpol vertical profile (vvl)67 CALL iom_get( numror, jpdom_autoglo, 'tmask' , ztmask_b, ldxios = lrxios ) ! need to extrapolate T/S 68 CALL iom_get( numror, jpdom_autoglo, 'umask' , zumask_b, ldxios = lrxios ) ! need to correct barotropic velocity 69 CALL iom_get( numror, jpdom_autoglo, 'vmask' , zvmask_b, ldxios = lrxios ) ! need to correct barotropic velocity 70 CALL iom_get( numror, jpdom_autoglo, 'smask' , zsmask_b, ldxios = lrxios ) ! need to correct barotropic velocity 71 CALL iom_get( numror, jpdom_autoglo, 'e3t_n' , ze3t_b(:,:,:), ldxios = lrxios ) ! need to compute temperature correction 72 CALL iom_get( numror, jpdom_autoglo, 'e3u_n' , ze3u_b(:,:,:), ldxios = lrxios ) ! need to correct barotropic velocity 73 CALL iom_get( numror, jpdom_autoglo, 'e3v_n' , ze3v_b(:,:,:), ldxios = lrxios ) ! need to correct barotropic velocity 74 CALL iom_get( numror, jpdom_autoglo, 'gdepw_n', zdepw_b(:,:,:), ldxios = lrxios ) ! need to interpol vertical profile (vvl) 75 75 76 76 !! read namelist -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
r8800 r8801 56 56 USE asminc ! Assimilation increment 57 57 #endif 58 USE iom_def, ONLY : l xios_read58 USE iom_def, ONLY : lrxios, lwxios 59 59 60 60 … … 1199 1199 ! 1200 1200 IF( TRIM(cdrw) == 'READ' ) THEN 1201 CALL iom_get( numror, jpdom_autoglo, 'ub2_b' , ub2_b (:,:), ldxios = l xios_read)1202 CALL iom_get( numror, jpdom_autoglo, 'vb2_b' , vb2_b (:,:), ldxios = l xios_read)1201 CALL iom_get( numror, jpdom_autoglo, 'ub2_b' , ub2_b (:,:), ldxios = lrxios ) 1202 CALL iom_get( numror, jpdom_autoglo, 'vb2_b' , vb2_b (:,:), ldxios = lrxios ) 1203 1203 IF( .NOT.ln_bt_av ) THEN 1204 CALL iom_get( numror, jpdom_autoglo, 'sshbb_e' , sshbb_e(:,:), ldxios = l xios_read)1205 CALL iom_get( numror, jpdom_autoglo, 'ubb_e' , ubb_e(:,:), ldxios = l xios_read)1206 CALL iom_get( numror, jpdom_autoglo, 'vbb_e' , vbb_e(:,:), ldxios = l xios_read)1207 CALL iom_get( numror, jpdom_autoglo, 'sshb_e' , sshb_e(:,:), ldxios = l xios_read)1208 CALL iom_get( numror, jpdom_autoglo, 'ub_e' , ub_e(:,:), ldxios = l xios_read)1209 CALL iom_get( numror, jpdom_autoglo, 'vb_e' , vb_e(:,:), ldxios = l xios_read)1204 CALL iom_get( numror, jpdom_autoglo, 'sshbb_e' , sshbb_e(:,:), ldxios = lrxios ) 1205 CALL iom_get( numror, jpdom_autoglo, 'ubb_e' , ubb_e(:,:), ldxios = lrxios ) 1206 CALL iom_get( numror, jpdom_autoglo, 'vbb_e' , vbb_e(:,:), ldxios = lrxios ) 1207 CALL iom_get( numror, jpdom_autoglo, 'sshb_e' , sshb_e(:,:), ldxios = lrxios ) 1208 CALL iom_get( numror, jpdom_autoglo, 'ub_e' , ub_e(:,:), ldxios = lrxios ) 1209 CALL iom_get( numror, jpdom_autoglo, 'vb_e' , vb_e(:,:), ldxios = lrxios ) 1210 1210 ENDIF 1211 1211 #if defined key_agrif 1212 1212 ! Read time integrated fluxes 1213 1213 IF ( .NOT.Agrif_Root() ) THEN 1214 CALL iom_get( numror, jpdom_autoglo, 'ub2_i_b' , ub2_i_b(:,:), ldxios = l xios_read)1215 CALL iom_get( numror, jpdom_autoglo, 'vb2_i_b' , vb2_i_b(:,:), ldxios = l xios_read)1214 CALL iom_get( numror, jpdom_autoglo, 'ub2_i_b' , ub2_i_b(:,:), ldxios = lrxios ) 1215 CALL iom_get( numror, jpdom_autoglo, 'vb2_i_b' , vb2_i_b(:,:), ldxios = lrxios ) 1216 1216 ENDIF 1217 1217 #endif 1218 1218 ! 1219 1219 ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN 1220 CALL iom_rstput( kt, nitrst, numrow, 'ub2_b' , ub2_b (:,:) ) 1221 CALL iom_rstput( kt, nitrst, numrow, 'vb2_b' , vb2_b (:,:) ) 1220 IF( lwxios ) CALL iom_swap( cwxios_context ) 1221 CALL iom_rstput( kt, nitrst, numrow, 'ub2_b' , ub2_b (:,:), ldxios = lwxios ) 1222 CALL iom_rstput( kt, nitrst, numrow, 'vb2_b' , vb2_b (:,:), ldxios = lwxios ) 1222 1223 ! 1223 1224 IF (.NOT.ln_bt_av) THEN 1224 CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e' , sshbb_e(:,:) )1225 CALL iom_rstput( kt, nitrst, numrow, 'ubb_e' , ubb_e(:,:) )1226 CALL iom_rstput( kt, nitrst, numrow, 'vbb_e' , vbb_e(:,:) )1227 CALL iom_rstput( kt, nitrst, numrow, 'sshb_e' , sshb_e(:,:) )1228 CALL iom_rstput( kt, nitrst, numrow, 'ub_e' , ub_e(:,:) )1229 CALL iom_rstput( kt, nitrst, numrow, 'vb_e' , vb_e(:,:) )1225 CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e' , sshbb_e(:,:), ldxios = lwxios ) 1226 CALL iom_rstput( kt, nitrst, numrow, 'ubb_e' , ubb_e(:,:), ldxios = lwxios ) 1227 CALL iom_rstput( kt, nitrst, numrow, 'vbb_e' , vbb_e(:,:), ldxios = lwxios ) 1228 CALL iom_rstput( kt, nitrst, numrow, 'sshb_e' , sshb_e(:,:), ldxios = lwxios ) 1229 CALL iom_rstput( kt, nitrst, numrow, 'ub_e' , ub_e(:,:), ldxios = lwxios ) 1230 CALL iom_rstput( kt, nitrst, numrow, 'vb_e' , vb_e(:,:), ldxios = lwxios ) 1230 1231 ENDIF 1231 1232 #if defined key_agrif 1232 1233 ! Save time integrated fluxes 1233 1234 IF ( .NOT.Agrif_Root() ) THEN 1234 CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b' , ub2_i_b(:,:) )1235 CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b' , vb2_i_b(:,:) )1235 CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b' , ub2_i_b(:,:), ldxios = lwxios ) 1236 CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b' , vb2_i_b(:,:), ldxios = lwxios ) 1236 1237 ENDIF 1237 1238 #endif 1239 IF( lwxios ) CALL iom_swap( cxios_context ) 1238 1240 ENDIF 1239 1241 ! … … 1323 1325 CALL wrk_dealloc( jpi,jpj, zcu ) 1324 1326 ! 1327 IF( lwxios ) THEN 1328 ! define variables in restart file when writing with XIOS 1329 CALL iom_set_rstw_var_active('ub2_b') 1330 CALL iom_set_rstw_var_active('vb2_b') 1331 ! 1332 IF (.NOT.ln_bt_av) THEN 1333 CALL iom_set_rstw_var_active('sshbb_e') 1334 CALL iom_set_rstw_var_active('ubb_e') 1335 CALL iom_set_rstw_var_active('vbb_e') 1336 CALL iom_set_rstw_var_active('sshb_e') 1337 CALL iom_set_rstw_var_active('ub_e') 1338 CALL iom_set_rstw_var_active('vb_e') 1339 ENDIF 1340 #if defined key_agrif 1341 ! Save time integrated fluxes 1342 IF ( .NOT.Agrif_Root() ) THEN 1343 CALL iom_set_rstw_var_active('ub2_i_b') 1344 CALL iom_set_rstw_var_active('vb2_i_b') 1345 ENDIF 1346 #endif 1347 ENDIF 1348 1325 1349 END SUBROUTINE dyn_spg_ts_init 1326 1350 -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
r8800 r8801 45 45 INTEGER :: nn_chunksz !: chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 46 46 LOGICAL :: ln_xios_read !: use xios to read single file restart 47 INTEGER :: nn_wxios !: write resart using xios 0 - no, 1 - single, 2 - multiple file output 47 48 48 49 #if defined key_netcdf4 … … 152 153 CHARACTER(lc) :: cxios_context !: context name used in xios 153 154 CHARACTER(lc) :: crxios_context !: context name used in xios to read restart 155 CHARACTER(lc) :: cwxios_context !: context name used in xios to write restart file 154 156 155 157 !!---------------------------------------------------------------------- -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90
r8800 r8801 41 41 USE dianam ! build name of file 42 42 USE xios 43 USE iom_def, ONLY : max_rst_fields, rst_ fields43 USE iom_def, ONLY : max_rst_fields, rst_rfields, rst_wfields, RST_FIELD 44 44 # endif 45 45 USE ioipsl, ONLY : ju2ymds ! for calendar 46 46 USE crs ! Grid coarsening 47 47 USE lib_fortran 48 USE diurnal_bulk, ONLY : ln_diurnal_only, ln_diurnal 48 49 49 50 IMPLICIT NONE … … 65 66 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 66 67 PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 67 PRIVATE set_rst_vars, set_rstr_active, set_rst_context 68 PRIVATE iom_set_rst_context, iom_set_rstw_active, iom_set_rstr_active 69 PUBLIC iom_set_rstw_var_active, iom_set_rst_vars 68 70 # endif 69 71 … … 92 94 CONTAINS 93 95 94 SUBROUTINE iom_init( cdname )96 SUBROUTINE iom_init( cdname, fname ) 95 97 !!---------------------------------------------------------------------- 96 98 !! *** ROUTINE *** … … 100 102 !!---------------------------------------------------------------------- 101 103 CHARACTER(len=*), INTENT(in) :: cdname 104 CHARACTER(len=*), OPTIONAL, INTENT(in) :: fname 102 105 #if defined key_iomput 103 106 104 107 TYPE(xios_duration) :: dtime = xios_duration(0, 0, 0, 0, 0, 0) 105 108 TYPE(xios_date) :: start_date 106 CHARACTER(len= 10) :: clname109 CHARACTER(len=lc) :: clname 107 110 INTEGER :: ji, jkmin 108 111 LOGICAL :: llrst_context ! is context related to restart … … 117 120 CALL xios_context_initialize(TRIM(clname), mpi_comm_opa) 118 121 CALL iom_swap( cdname ) 119 llrst_context = (TRIM(cdname) == TRIM(crxios_context) )122 llrst_context = (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context)) 120 123 121 124 ! Calendar type is now defined in xml file … … 162 165 CALL dom_grid_glo ! Return to parent grid domain 163 166 ! 164 IF( ln_cfmeta .AND. TRIM(cdname) .NE. TRIM(crxios_context)) THEN ! Add additional grid metadata167 IF( ln_cfmeta .AND. .NOT. llrst_context) THEN ! Add additional grid metadata 165 168 CALL iom_set_domain_attr("grid_T", area = e1e2t_crs(nldi:nlei, nldj:nlej)) 166 169 CALL iom_set_domain_attr("grid_U", area = e1u_crs(nldi:nlei, nldj:nlej) * e2u_crs(nldi:nlei, nldj:nlej)) … … 206 209 ENDIF 207 210 ! automatic definitions of some of the xml attributs 208 IF( llrst_context) THEN209 !set names of the fields in restart file IF using XIOS to read /writedata210 CALL set_rst_context()211 CALL set_rst_vars()211 IF( TRIM(cdname) == TRIM(crxios_context) ) THEN 212 !set names of the fields in restart file IF using XIOS to read data 213 CALL iom_set_rst_context() 214 CALL iom_set_rst_vars(rst_rfields) 212 215 !set which fields are to be read from restart file 213 CALL set_rstr_active() 216 CALL iom_set_rstr_active() 217 ELSE IF( TRIM(cdname) == TRIM(cwxios_context) ) THEN 218 !set names of the fields in restart file IF using XIOS to write data 219 CALL iom_set_rst_context() 220 CALL iom_set_rst_vars(rst_wfields) 221 !set which fields are to be read from restart file 222 CALL iom_set_rstw_active(fname) 214 223 ELSE 215 224 CALL set_xmlatt … … 229 238 END SUBROUTINE iom_init 230 239 231 232 SUBROUTINE set_rst_vars() 233 !set names for variables in restart file 240 SUBROUTINE iom_set_rstw_var_active(field) 241 CHARACTER(len = *), INTENT(IN) :: field 234 242 INTEGER :: i 235 rst_fields(:)%vname="NO_NAME"; rst_fields(:)%grid="NO_GRID" 236 i = 0 237 i = i + 1; rst_fields(i)%vname="rdt"; rst_fields(i)% grid="grid_scalar" 238 i = i + 1; rst_fields(i)%vname="un"; rst_fields(i)% grid="grid_N_3D" 239 i = i + 1; rst_fields(i)%vname="ub"; rst_fields(i)% grid="grid_N_3D" 240 i = i + 1; rst_fields(i)%vname="vn"; rst_fields(i)% grid="grid_N_3D" 241 i = i + 1; rst_fields(i)%vname="vb"; rst_fields(i)% grid="grid_N_3D" 242 i = i + 1; rst_fields(i)%vname="tn"; rst_fields(i)% grid="grid_N_3D" 243 i = i + 1; rst_fields(i)%vname="tb"; rst_fields(i)% grid="grid_N_3D" 244 i = i + 1; rst_fields(i)%vname="sn"; rst_fields(i)% grid="grid_N_3D" 245 i = i + 1; rst_fields(i)%vname="sb"; rst_fields(i)%grid="grid_N_3D" 246 i = i + 1; rst_fields(i)%vname="sshn"; rst_fields(i)%grid="grid_N" 247 i = i + 1; rst_fields(i)%vname="sshb"; rst_fields(i)%grid="grid_N" 248 i = i + 1; rst_fields(i)%vname="rhop"; rst_fields(i)%grid="grid_N_3D" 249 i = i + 1; rst_fields(i)%vname="kt"; rst_fields(i)%grid="grid_scalar" 250 i = i + 1; rst_fields(i)%vname="ndastp"; rst_fields(i)%grid="grid_scalar" 251 i = i + 1; rst_fields(i)%vname="adatrj"; rst_fields(i)%grid="grid_scalar" 252 i = i + 1; rst_fields(i)%vname="utau_b"; rst_fields(i)%grid="grid_N" 253 i = i + 1; rst_fields(i)%vname="vtau_b"; rst_fields(i)%grid="grid_N" 254 i = i + 1; rst_fields(i)%vname="qns_b"; rst_fields(i)%grid="grid_N" 255 i = i + 1; rst_fields(i)%vname="emp_b"; rst_fields(i)%grid="grid_N" 256 i = i + 1; rst_fields(i)%vname="sfx_b"; rst_fields(i)%grid="grid_N" 257 i = i + 1; rst_fields(i)%vname="en" ; rst_fields(i)%grid="grid_N_3D" 258 i = i + 1; rst_fields(i)%vname="avt"; rst_fields(i)%grid="grid_N_3D" 259 i = i + 1; rst_fields(i)%vname="avm"; rst_fields(i)%grid="grid_N_3D" 260 i = i + 1; rst_fields(i)%vname="avmu"; rst_fields(i)%grid="grid_N_3D" 261 i = i + 1; rst_fields(i)%vname="avmv"; rst_fields(i)%grid="grid_N_3D" 262 i = i + 1; rst_fields(i)%vname="dissl"; rst_fields(i)%grid="grid_N_3D" 263 i = i + 1; rst_fields(i)%vname="sbc_hc_b"; rst_fields(i)%grid="grid_N" 264 i = i + 1; rst_fields(i)%vname="sbc_sc_b"; rst_fields(i)%grid="grid_N" 265 i = i + 1; rst_fields(i)%vname="qsr_hc_b"; rst_fields(i)%grid="grid_N_3D" 266 i = i + 1; rst_fields(i)%vname="fraqsr_1lev"; rst_fields(i)%grid="grid_N" 267 i = i + 1; rst_fields(i)%vname="greenland_icesheet_mass" 268 rst_fields(i)%grid="grid_scalar" 269 i = i + 1; rst_fields(i)%vname="greenland_icesheet_timelapsed" 270 rst_fields(i)%grid="grid_scalar" 271 i = i + 1; rst_fields(i)%vname="greenland_icesheet_mass_roc" 272 rst_fields(i)%grid="grid_scalar" 273 i = i + 1; rst_fields(i)%vname="antarctica_icesheet_mass" 274 rst_fields(i)%grid="grid_scalar" 275 i = i + 1; rst_fields(i)%vname="antarctica_icesheet_timelapsed" 276 rst_fields(i)%grid="grid_scalar" 277 i = i + 1; rst_fields(i)%vname="antarctica_icesheet_mass_roc" 278 rst_fields(i)%grid="grid_scalar" 279 i = i + 1; rst_fields(i)%vname="frc_v"; rst_fields(i)%grid="grid_scalar" 280 i = i + 1; rst_fields(i)%vname="frc_t"; rst_fields(i)%grid="grid_scalar" 281 i = i + 1; rst_fields(i)%vname="frc_s"; rst_fields(i)%grid="grid_scalar" 282 i = i + 1; rst_fields(i)%vname="frc_wn_t"; rst_fields(i)%grid="grid_scalar" 283 i = i + 1; rst_fields(i)%vname="frc_wn_s"; rst_fields(i)%grid="grid_scalar" 284 i = i + 1; rst_fields(i)%vname="ssh_ini"; rst_fields(i)%grid="grid_N" 285 i = i + 1; rst_fields(i)%vname="e3t_ini"; rst_fields(i)%grid="grid_N_3D" 286 i = i + 1; rst_fields(i)%vname="hc_loc_ini"; rst_fields(i)%grid="grid_N_3D" 287 i = i + 1; rst_fields(i)%vname="sc_loc_ini"; rst_fields(i)%grid="grid_N_3D" 288 i = i + 1; rst_fields(i)%vname="ssh_hc_loc_ini"; rst_fields(i)%grid="grid_N" 289 i = i + 1; rst_fields(i)%vname="ssh_sc_loc_ini"; rst_fields(i)%grid="grid_N" 290 i = i + 1; rst_fields(i)%vname="tilde_e3t_b"; rst_fields(i)%grid="grid_N" 291 i = i + 1; rst_fields(i)%vname="tilde_e3t_n"; rst_fields(i)%grid="grid_N" 292 i = i + 1; rst_fields(i)%vname="hdiv_lf"; rst_fields(i)%grid="grid_N" 293 i = i + 1; rst_fields(i)%vname="ub2_b"; rst_fields(i)%grid="grid_N" 294 i = i + 1; rst_fields(i)%vname="vb2_b"; rst_fields(i)%grid="grid_N" 295 i = i + 1; rst_fields(i)%vname="sshbb_e"; rst_fields(i)%grid="grid_N" 296 i = i + 1; rst_fields(i)%vname="ubb_e"; rst_fields(i)%grid="grid_N" 297 i = i + 1; rst_fields(i)%vname="vbb_e"; rst_fields(i)%grid="grid_N" 298 i = i + 1; rst_fields(i)%vname="sshb_e"; rst_fields(i)%grid="grid_N" 299 i = i + 1; rst_fields(i)%vname="ub_e"; rst_fields(i)%grid="grid_N" 300 i = i + 1; rst_fields(i)%vname="vb_e"; rst_fields(i)%grid="grid_N" 301 i = i + 1; rst_fields(i)%vname="fwf_isf_b"; rst_fields(i)%grid="grid_N" 302 i = i + 1; rst_fields(i)%vname="isf_sc_b"; rst_fields(i)%grid="grid_N" 303 i = i + 1; rst_fields(i)%vname="isf_hc_b"; rst_fields(i)%grid="grid_N" 304 i = i + 1; rst_fields(i)%vname="ssh_ibb"; rst_fields(i)%grid="grid_N" 305 i = i + 1; rst_fields(i)%vname="rnf_b"; rst_fields(i)%grid="grid_N" 306 i = i + 1; rst_fields(i)%vname="rnf_hc_b"; rst_fields(i)%grid="grid_N" 307 i = i + 1; rst_fields(i)%vname="rnf_sc_b"; rst_fields(i)%grid="grid_N" 308 i = i + 1; rst_fields(i)%vname="nn_fsbc"; rst_fields(i)%grid="grid_scalar" 309 i = i + 1; rst_fields(i)%vname="ssu_m"; rst_fields(i)%grid="grid_N" 310 i = i + 1; rst_fields(i)%vname="ssv_m"; rst_fields(i)%grid="grid_N" 311 i = i + 1; rst_fields(i)%vname="sst_m"; rst_fields(i)%grid="grid_N" 312 i = i + 1; rst_fields(i)%vname="sss_m"; rst_fields(i)%grid="grid_N" 313 i = i + 1; rst_fields(i)%vname="ssh_m"; rst_fields(i)%grid="grid_N" 314 i = i + 1; rst_fields(i)%vname="e3t_m"; rst_fields(i)%grid="grid_N" 315 i = i + 1; rst_fields(i)%vname="frq_m"; rst_fields(i)%grid="grid_N" 316 i = i + 1; rst_fields(i)%vname="avmb"; rst_fields(i)%grid="grid_vector" 317 i = i + 1; rst_fields(i)%vname="avtb"; rst_fields(i)%grid="grid_vector" 318 i = i + 1; rst_fields(i)%vname="ub2_i_b"; rst_fields(i)%grid="grid_N" 319 i = i + 1; rst_fields(i)%vname="vb2_i_b"; rst_fields(i)%grid="grid_N" 320 i = i + 1; rst_fields(i)%vname="ntime"; rst_fields(i)%grid="grid_scalar" 321 i = i + 1; rst_fields(i)%vname="Dsst"; rst_fields(i)%grid="grid_scalar" 322 i = i + 1; rst_fields(i)%vname="tmask"; rst_fields(i)%grid="grid_N_3D" 323 i = i + 1; rst_fields(i)%vname="umask"; rst_fields(i)%grid="grid_N_3D" 324 i = i + 1; rst_fields(i)%vname="vmask"; rst_fields(i)%grid="grid_N_3D" 325 i = i + 1; rst_fields(i)%vname="smask"; rst_fields(i)%grid="grid_N_3D" 326 i = i + 1; rst_fields(i)%vname="gdepw_n"; rst_fields(i)%grid="grid_N_3D" 327 i = i + 1; rst_fields(i)%vname="e3t_n"; rst_fields(i)%grid="grid_N_3D" 328 i = i + 1; rst_fields(i)%vname="e3u_n"; rst_fields(i)%grid="grid_N_3D" 329 i = i + 1; rst_fields(i)%vname="e3v_n"; rst_fields(i)%grid="grid_N_3D" 330 i = i + 1; rst_fields(i)%vname="surf_ini"; rst_fields(i)%grid="grid_N" 331 i = i + 1; rst_fields(i)%vname="e3t_b"; rst_fields(i)%grid="grid_N_3D" 332 i = i + 1; rst_fields(i)%vname="e3t_n"; rst_fields(i)%grid="grid_N_3D" 333 i = i + 1; rst_fields(i)%vname="mxln"; rst_fields(i)%grid="grid_N_3D" 334 i = i + 1; rst_fields(i)%vname="e3t_m"; rst_fields(i)%grid="grid_N_3D" 335 END SUBROUTINE set_rst_vars 336 337 338 SUBROUTINE set_rstr_active() 243 LOGICAL :: llis_set 244 245 llis_set = .FALSE. 246 247 DO i = 1, max_rst_fields 248 IF(TRIM(rst_wfields(i)%vname) == field) THEN 249 rst_wfields(i)%active = .TRUE. 250 llis_set = .TRUE. 251 EXIT 252 ENDIF 253 ENDDO 254 !Warn if variable is not in defined in rst_wfields 255 IF(.NOT.llis_set) THEN 256 IF(lwp) THEN 257 write(numout,cform_err) 258 write(numout,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined' 259 ENDIF 260 nstop = nstop + 1 261 ENDIF 262 263 END SUBROUTINE iom_set_rstw_var_active 264 265 SUBROUTINE iom_set_rstr_active() 339 266 !sets enabled = .TRUE. for each field in restart file 340 267 CHARACTER(len=256) :: rst_file … … 361 288 !defin files for restart context 362 289 DO i = 1, max_rst_fields 363 IF( TRIM(rst_ fields(i)%vname) /= "NO_NAME") THEN364 IF( iom_varid( numror, TRIM(rst_ fields(i)%vname), ldstop = .FALSE. ) > 0 ) THEN365 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_ fields(i)%vname))366 SELECT CASE (TRIM(rst_ fields(i)%grid))290 IF( TRIM(rst_rfields(i)%vname) /= "NO_NAME") THEN 291 IF( iom_varid( numror, TRIM(rst_rfields(i)%vname), ldstop = .FALSE. ) > 0 ) THEN 292 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_rfields(i)%vname)) 293 SELECT CASE (TRIM(rst_rfields(i)%grid)) 367 294 CASE ("grid_N_3D") 368 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_ fields(i)%vname), &295 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 369 296 domain_ref="grid_N", axis_ref="deptht", operation = "instant") 370 297 CASE ("grid_N") 371 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_ fields(i)%vname), &298 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 372 299 domain_ref="grid_N", operation = "instant") 373 300 CASE ("grid_vector") 374 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_ fields(i)%vname), &301 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 375 302 axis_ref="deptht", operation = "instant") 376 303 CASE ("grid_scalar") 377 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_ fields(i)%vname), &304 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 378 305 scalar_ref = "grid_scalar", operation = "instant") 379 306 END SELECT 380 IF(lwp) WRITE(numout,*) 'XIOS read: ', TRIM(rst_ fields(i)%vname), ' enabled in ', TRIM(rst_file)307 IF(lwp) WRITE(numout,*) 'XIOS read: ', TRIM(rst_rfields(i)%vname), ' enabled in ', TRIM(rst_file) 381 308 ENDIF 382 309 ENDIF 383 310 END DO 384 END SUBROUTINE set_rstr_active 385 386 SUBROUTINE set_rst_context( ) 311 END SUBROUTINE iom_set_rstr_active 312 313 SUBROUTINE iom_set_rstw_core() 314 !from restart.F90 315 CALL iom_set_rstw_var_active("rdt") 316 IF ( .NOT. ln_diurnal_only ) THEN 317 CALL iom_set_rstw_var_active('ub' ) 318 CALL iom_set_rstw_var_active('vb' ) 319 CALL iom_set_rstw_var_active('tb' ) 320 CALL iom_set_rstw_var_active('sb' ) 321 CALL iom_set_rstw_var_active('sshb') 322 ! 323 CALL iom_set_rstw_var_active('un' ) 324 CALL iom_set_rstw_var_active('vn' ) 325 CALL iom_set_rstw_var_active('tn' ) 326 CALL iom_set_rstw_var_active('sn' ) 327 CALL iom_set_rstw_var_active('sshn') 328 CALL iom_set_rstw_var_active('rhop') 329 ! extra variable needed for the ice sheet coupling 330 IF ( ln_iscpl ) THEN 331 CALL iom_set_rstw_var_active('tmask') 332 CALL iom_set_rstw_var_active('umask') 333 CALL iom_set_rstw_var_active('vmask') 334 CALL iom_set_rstw_var_active('smask') 335 CALL iom_set_rstw_var_active('e3t_n') 336 CALL iom_set_rstw_var_active('e3u_n') 337 CALL iom_set_rstw_var_active('e3v_n') 338 CALL iom_set_rstw_var_active('gdepw_n') 339 END IF 340 ENDIF 341 IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst') 342 !from trasbc.F90 343 CALL iom_set_rstw_var_active('sbc_hc_b') 344 CALL iom_set_rstw_var_active('sbc_sc_b') 345 END SUBROUTINE iom_set_rstw_core 346 347 SUBROUTINE iom_set_rst_vars(fields) 348 !set names for variables in restart file 349 TYPE(RST_FIELD), INTENT(INOUT) :: fields(max_rst_fields) 350 INTEGER :: i 351 i = 0 352 i = i + 1; fields(i)%vname="rdt"; fields(i)%grid="grid_scalar" 353 i = i + 1; fields(i)%vname="un"; fields(i)%grid="grid_N_3D" 354 i = i + 1; fields(i)%vname="ub"; fields(i)%grid="grid_N_3D" 355 i = i + 1; fields(i)%vname="vn"; fields(i)%grid="grid_N_3D" 356 i = i + 1; fields(i)%vname="vb"; fields(i)%grid="grid_N_3D" 357 i = i + 1; fields(i)%vname="tn"; fields(i)%grid="grid_N_3D" 358 i = i + 1; fields(i)%vname="tb"; fields(i)%grid="grid_N_3D" 359 i = i + 1; fields(i)%vname="sn"; fields(i)%grid="grid_N_3D" 360 i = i + 1; fields(i)%vname="sb"; fields(i)%grid="grid_N_3D" 361 i = i + 1; fields(i)%vname="sshn"; fields(i)%grid="grid_N" 362 i = i + 1; fields(i)%vname="sshb"; fields(i)%grid="grid_N" 363 i = i + 1; fields(i)%vname="rhop"; fields(i)%grid="grid_N_3D" 364 i = i + 1; fields(i)%vname="kt"; fields(i)%grid="grid_scalar" 365 i = i + 1; fields(i)%vname="ndastp"; fields(i)%grid="grid_scalar" 366 i = i + 1; fields(i)%vname="adatrj"; fields(i)%grid="grid_scalar" 367 i = i + 1; fields(i)%vname="utau_b"; fields(i)%grid="grid_N" 368 i = i + 1; fields(i)%vname="vtau_b"; fields(i)%grid="grid_N" 369 i = i + 1; fields(i)%vname="qns_b"; fields(i)%grid="grid_N" 370 i = i + 1; fields(i)%vname="emp_b"; fields(i)%grid="grid_N" 371 i = i + 1; fields(i)%vname="sfx_b"; fields(i)%grid="grid_N" 372 i = i + 1; fields(i)%vname="en" ; fields(i)%grid="grid_N_3D" 373 i = i + 1; fields(i)%vname="avt"; fields(i)%grid="grid_N_3D" 374 i = i + 1; fields(i)%vname="avm"; fields(i)%grid="grid_N_3D" 375 i = i + 1; fields(i)%vname="avmu"; fields(i)%grid="grid_N_3D" 376 i = i + 1; fields(i)%vname="avmv"; fields(i)%grid="grid_N_3D" 377 i = i + 1; fields(i)%vname="dissl"; fields(i)%grid="grid_N_3D" 378 i = i + 1; fields(i)%vname="sbc_hc_b"; fields(i)%grid="grid_N" 379 i = i + 1; fields(i)%vname="sbc_sc_b"; fields(i)%grid="grid_N" 380 i = i + 1; fields(i)%vname="qsr_hc_b"; fields(i)%grid="grid_N_3D" 381 i = i + 1; fields(i)%vname="fraqsr_1lev"; fields(i)%grid="grid_N" 382 i = i + 1; fields(i)%vname="greenland_icesheet_mass" 383 fields(i)%grid="grid_scalar" 384 i = i + 1; fields(i)%vname="greenland_icesheet_timelapsed" 385 fields(i)%grid="grid_scalar" 386 i = i + 1; fields(i)%vname="greenland_icesheet_mass_roc" 387 fields(i)%grid="grid_scalar" 388 i = i + 1; fields(i)%vname="antarctica_icesheet_mass" 389 fields(i)%grid="grid_scalar" 390 i = i + 1; fields(i)%vname="antarctica_icesheet_timelapsed" 391 fields(i)%grid="grid_scalar" 392 i = i + 1; fields(i)%vname="antarctica_icesheet_mass_roc" 393 fields(i)%grid="grid_scalar" 394 i = i + 1; fields(i)%vname="frc_v"; fields(i)%grid="grid_scalar" 395 i = i + 1; fields(i)%vname="frc_t"; fields(i)%grid="grid_scalar" 396 i = i + 1; fields(i)%vname="frc_s"; fields(i)%grid="grid_scalar" 397 i = i + 1; fields(i)%vname="frc_wn_t"; fields(i)%grid="grid_scalar" 398 i = i + 1; fields(i)%vname="frc_wn_s"; fields(i)%grid="grid_scalar" 399 i = i + 1; fields(i)%vname="ssh_ini"; fields(i)%grid="grid_N" 400 i = i + 1; fields(i)%vname="e3t_ini"; fields(i)%grid="grid_N_3D" 401 i = i + 1; fields(i)%vname="hc_loc_ini"; fields(i)%grid="grid_N_3D" 402 i = i + 1; fields(i)%vname="sc_loc_ini"; fields(i)%grid="grid_N_3D" 403 i = i + 1; fields(i)%vname="ssh_hc_loc_ini"; fields(i)%grid="grid_N" 404 i = i + 1; fields(i)%vname="ssh_sc_loc_ini"; fields(i)%grid="grid_N" 405 i = i + 1; fields(i)%vname="tilde_e3t_b"; fields(i)%grid="grid_N" 406 i = i + 1; fields(i)%vname="tilde_e3t_n"; fields(i)%grid="grid_N" 407 i = i + 1; fields(i)%vname="hdiv_lf"; fields(i)%grid="grid_N" 408 i = i + 1; fields(i)%vname="ub2_b"; fields(i)%grid="grid_N" 409 i = i + 1; fields(i)%vname="vb2_b"; fields(i)%grid="grid_N" 410 i = i + 1; fields(i)%vname="sshbb_e"; fields(i)%grid="grid_N" 411 i = i + 1; fields(i)%vname="ubb_e"; fields(i)%grid="grid_N" 412 i = i + 1; fields(i)%vname="vbb_e"; fields(i)%grid="grid_N" 413 i = i + 1; fields(i)%vname="sshb_e"; fields(i)%grid="grid_N" 414 i = i + 1; fields(i)%vname="ub_e"; fields(i)%grid="grid_N" 415 i = i + 1; fields(i)%vname="vb_e"; fields(i)%grid="grid_N" 416 i = i + 1; fields(i)%vname="fwf_isf_b"; fields(i)%grid="grid_N" 417 i = i + 1; fields(i)%vname="isf_sc_b"; fields(i)%grid="grid_N" 418 i = i + 1; fields(i)%vname="isf_hc_b"; fields(i)%grid="grid_N" 419 i = i + 1; fields(i)%vname="ssh_ibb"; fields(i)%grid="grid_N" 420 i = i + 1; fields(i)%vname="rnf_b"; fields(i)%grid="grid_N" 421 i = i + 1; fields(i)%vname="rnf_hc_b"; fields(i)%grid="grid_N" 422 i = i + 1; fields(i)%vname="rnf_sc_b"; fields(i)%grid="grid_N" 423 i = i + 1; fields(i)%vname="nn_fsbc"; fields(i)%grid="grid_scalar" 424 i = i + 1; fields(i)%vname="ssu_m"; fields(i)%grid="grid_N" 425 i = i + 1; fields(i)%vname="ssv_m"; fields(i)%grid="grid_N" 426 i = i + 1; fields(i)%vname="sst_m"; fields(i)%grid="grid_N" 427 i = i + 1; fields(i)%vname="sss_m"; fields(i)%grid="grid_N" 428 i = i + 1; fields(i)%vname="ssh_m"; fields(i)%grid="grid_N" 429 i = i + 1; fields(i)%vname="e3t_m"; fields(i)%grid="grid_N" 430 i = i + 1; fields(i)%vname="frq_m"; fields(i)%grid="grid_N" 431 i = i + 1; fields(i)%vname="avmb"; fields(i)%grid="grid_vector" 432 i = i + 1; fields(i)%vname="avtb"; fields(i)%grid="grid_vector" 433 i = i + 1; fields(i)%vname="ub2_i_b"; fields(i)%grid="grid_N" 434 i = i + 1; fields(i)%vname="vb2_i_b"; fields(i)%grid="grid_N" 435 i = i + 1; fields(i)%vname="ntime"; fields(i)%grid="grid_scalar" 436 i = i + 1; fields(i)%vname="Dsst"; fields(i)%grid="grid_scalar" 437 i = i + 1; fields(i)%vname="tmask"; fields(i)%grid="grid_N_3D" 438 i = i + 1; fields(i)%vname="umask"; fields(i)%grid="grid_N_3D" 439 i = i + 1; fields(i)%vname="vmask"; fields(i)%grid="grid_N_3D" 440 i = i + 1; fields(i)%vname="smask"; fields(i)%grid="grid_N_3D" 441 i = i + 1; fields(i)%vname="gdepw_n"; fields(i)%grid="grid_N_3D" 442 i = i + 1; fields(i)%vname="e3t_n"; fields(i)%grid="grid_N_3D" 443 i = i + 1; fields(i)%vname="e3u_n"; fields(i)%grid="grid_N_3D" 444 i = i + 1; fields(i)%vname="e3v_n"; fields(i)%grid="grid_N_3D" 445 i = i + 1; fields(i)%vname="surf_ini"; fields(i)%grid="grid_N" 446 i = i + 1; fields(i)%vname="e3t_b"; fields(i)%grid="grid_N_3D" 447 i = i + 1; fields(i)%vname="mxln"; fields(i)%grid="grid_N_3D" 448 449 IF( i-1 > max_rst_fields) THEN 450 IF(lwp) write(numout,*) 'E R R O R : iom_set_rst_vars SIZE of RST_FIELD array is too small' 451 nstop = nstop + 1 452 ENDIF 453 454 END SUBROUTINE iom_set_rst_vars 455 456 457 SUBROUTINE iom_set_rstw_active(cdrst_file) 458 !sets enabled = .TRUE. for each field in restart file 459 CHARACTER(len=*) :: cdrst_file 460 #if defined key_iomput 461 TYPE(xios_field) :: field_hdl 462 TYPE(xios_file) :: file_hdl 463 TYPE(xios_filegroup) :: filegroup_hdl 464 INTEGER :: i 465 CHARACTER(lc) :: clpath 466 467 !set name of the restart file and enable available fields 468 IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file 469 CALL xios_get_handle("file_definition", filegroup_hdl ) 470 CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') 471 IF(nxioso.eq.1) THEN 472 CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 473 mode="write", output_freq=xios_timestep) 474 if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 475 ELSE 476 CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 477 mode="write", output_freq=xios_timestep) 478 if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 479 ENDIF 480 CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file)) 481 !defin files for restart context 482 DO i = 1, max_rst_fields 483 IF( rst_wfields(i)%active ) THEN 484 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_wfields(i)%vname)) 485 SELECT CASE (TRIM(rst_wfields(i)%grid)) 486 CASE ("grid_N_3D") 487 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 488 domain_ref="grid_N", axis_ref="deptht", prec = 8, operation = "instant") 489 CASE ("grid_N") 490 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 491 domain_ref="grid_N", prec = 8, operation = "instant") 492 CASE ("grid_vector") 493 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 494 axis_ref="deptht", prec = 8, operation = "instant") 495 CASE ("grid_scalar") 496 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 497 scalar_ref = "grid_scalar", prec = 8, operation = "instant") 498 END SELECT 499 ENDIF 500 END DO 501 #endif 502 END SUBROUTINE iom_set_rstw_active 503 504 SUBROUTINE iom_set_rst_context( ) 387 505 #if defined key_iomput 388 506 TYPE(xios_domaingroup) :: domaingroup_hdl … … 407 525 CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 408 526 #endif 409 END SUBROUTINE set_rst_context527 END SUBROUTINE iom_set_rst_context 410 528 411 529 SUBROUTINE iom_swap( cdname ) … … 418 536 #if defined key_iomput 419 537 TYPE(xios_context) :: nemo_hdl 420 421 538 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 422 539 CALL xios_get_handle(TRIM(cdname),nemo_hdl) … … 1363 1480 !! INTERFACE iom_rstput 1364 1481 !!---------------------------------------------------------------------- 1365 SUBROUTINE iom_rp0d( kt, kwrite, kiomid, cdvar, pvar, ktype )1482 SUBROUTINE iom_rp0d( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios ) 1366 1483 INTEGER , INTENT(in) :: kt ! ocean time-step 1367 1484 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1370 1487 REAL(wp) , INTENT(in) :: pvar ! written field 1371 1488 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1489 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1490 LOGICAL :: llx ! local xios write flag 1372 1491 INTEGER :: ivid ! variable id 1373 IF( kiomid > 0 ) THEN 1374 IF( iom_file(kiomid)%nfid > 0 ) THEN 1375 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1376 SELECT CASE (iom_file(kiomid)%iolib) 1377 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar ) 1378 CASE DEFAULT 1379 CALL ctl_stop( 'iom_rp0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1380 END SELECT 1492 1493 llx = .FALSE. 1494 IF(PRESENT(ldxios)) llx = ldxios 1495 IF( llx ) THEN 1496 #ifdef key_iomput 1497 IF( kt == kwrite ) THEN 1498 IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar) 1499 CALL xios_send_field(trim(cdvar), pvar) 1500 ENDIF 1501 #endif 1502 ELSE 1503 IF( kiomid > 0 ) THEN 1504 IF( iom_file(kiomid)%nfid > 0 ) THEN 1505 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1506 SELECT CASE (iom_file(kiomid)%iolib) 1507 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r0d = pvar ) 1508 CASE DEFAULT 1509 CALL ctl_stop( 'iom_rp0d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1510 END SELECT 1511 ENDIF 1381 1512 ENDIF 1382 1513 ENDIF 1383 1514 END SUBROUTINE iom_rp0d 1384 1515 1385 SUBROUTINE iom_rp1d( kt, kwrite, kiomid, cdvar, pvar, ktype )1516 SUBROUTINE iom_rp1d( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios ) 1386 1517 INTEGER , INTENT(in) :: kt ! ocean time-step 1387 1518 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1390 1521 REAL(wp) , INTENT(in), DIMENSION( :) :: pvar ! written field 1391 1522 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1523 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1524 LOGICAL :: llx ! local xios write flag 1392 1525 INTEGER :: ivid ! variable id 1393 IF( kiomid > 0 ) THEN 1394 IF( iom_file(kiomid)%nfid > 0 ) THEN 1395 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1396 SELECT CASE (iom_file(kiomid)%iolib) 1397 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar ) 1398 CASE DEFAULT 1399 CALL ctl_stop( 'iom_rp1d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1400 END SELECT 1526 1527 llx = .FALSE. 1528 IF(PRESENT(ldxios)) llx = ldxios 1529 IF( llx ) THEN 1530 #ifdef key_iomput 1531 IF( kt == kwrite ) THEN 1532 IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar) 1533 CALL xios_send_field(trim(cdvar), pvar) 1534 ENDIF 1535 #endif 1536 ELSE 1537 IF( kiomid > 0 ) THEN 1538 IF( iom_file(kiomid)%nfid > 0 ) THEN 1539 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1540 SELECT CASE (iom_file(kiomid)%iolib) 1541 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r1d = pvar ) 1542 CASE DEFAULT 1543 CALL ctl_stop( 'iom_rp1d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1544 END SELECT 1545 ENDIF 1401 1546 ENDIF 1402 1547 ENDIF 1403 1548 END SUBROUTINE iom_rp1d 1404 1549 1405 SUBROUTINE iom_rp2d( kt, kwrite, kiomid, cdvar, pvar, ktype )1550 SUBROUTINE iom_rp2d( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios ) 1406 1551 INTEGER , INTENT(in) :: kt ! ocean time-step 1407 1552 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1410 1555 REAL(wp) , INTENT(in), DIMENSION(:, : ) :: pvar ! written field 1411 1556 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1557 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1558 LOGICAL :: llx 1412 1559 INTEGER :: ivid ! variable id 1413 IF( kiomid > 0 ) THEN 1414 IF( iom_file(kiomid)%nfid > 0 ) THEN 1415 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1416 SELECT CASE (iom_file(kiomid)%iolib) 1417 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar ) 1418 CASE DEFAULT 1419 CALL ctl_stop( 'iom_rp2d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1420 END SELECT 1560 1561 llx = .FALSE. 1562 IF(PRESENT(ldxios)) llx = ldxios 1563 IF( llx ) THEN 1564 #ifdef key_iomput 1565 IF( kt == kwrite ) THEN 1566 IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar) 1567 CALL xios_send_field(trim(cdvar), pvar) 1568 ENDIF 1569 #endif 1570 ELSE 1571 IF( kiomid > 0 ) THEN 1572 IF( iom_file(kiomid)%nfid > 0 ) THEN 1573 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1574 SELECT CASE (iom_file(kiomid)%iolib) 1575 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r2d = pvar ) 1576 CASE DEFAULT 1577 CALL ctl_stop( 'iom_rp2d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1578 END SELECT 1579 ENDIF 1421 1580 ENDIF 1422 1581 ENDIF 1423 1582 END SUBROUTINE iom_rp2d 1424 1583 1425 SUBROUTINE iom_rp3d( kt, kwrite, kiomid, cdvar, pvar, ktype )1584 SUBROUTINE iom_rp3d( kt, kwrite, kiomid, cdvar, pvar, ktype, ldxios ) 1426 1585 INTEGER , INTENT(in) :: kt ! ocean time-step 1427 1586 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1430 1589 REAL(wp) , INTENT(in), DIMENSION(:,:,:) :: pvar ! written field 1431 1590 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1591 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1592 LOGICAL :: llx ! local xios write flag 1432 1593 INTEGER :: ivid ! variable id 1433 IF( kiomid > 0 ) THEN 1434 IF( iom_file(kiomid)%nfid > 0 ) THEN 1435 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1436 SELECT CASE (iom_file(kiomid)%iolib) 1437 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar ) 1438 CASE DEFAULT 1439 CALL ctl_stop( 'iom_rp3d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1440 END SELECT 1594 1595 llx = .FALSE. 1596 IF(PRESENT(ldxios)) llx = ldxios 1597 IF( llx ) THEN 1598 #ifdef key_iomput 1599 IF( kt == kwrite ) THEN 1600 IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar) 1601 CALL xios_send_field(trim(cdvar), pvar) 1602 ENDIF 1603 #endif 1604 ELSE 1605 IF( kiomid > 0 ) THEN 1606 IF( iom_file(kiomid)%nfid > 0 ) THEN 1607 ivid = iom_varid( kiomid, cdvar, ldstop = .FALSE. ) 1608 SELECT CASE (iom_file(kiomid)%iolib) 1609 CASE (jpnf90 ) ; CALL iom_nf90_rstput( kt, kwrite, kiomid, cdvar, ivid, ktype, pv_r3d = pvar ) 1610 CASE DEFAULT 1611 CALL ctl_stop( 'iom_rp3d: accepted IO library is only jpnf90 (jpioipsl option has been removed)' ) 1612 END SELECT 1613 ENDIF 1441 1614 ENDIF 1442 1615 ENDIF … … 1616 1789 SUBROUTINE iom_context_finalize( cdname ) 1617 1790 CHARACTER(LEN=*), INTENT(in) :: cdname 1618 ! 1619 IF( xios_is_valid_context(cdname) ) THEN 1791 CHARACTER(LEN=120) :: clname 1792 ! 1793 clname = cdname 1794 IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 1795 1796 IF( xios_is_valid_context(clname) ) THEN 1620 1797 CALL iom_swap( cdname ) ! swap to cdname context 1621 1798 CALL xios_context_finalize() ! finalize the context … … 1645 1822 CALL iom_set_domain_attr("grid_"//cdgrd, ni_glo=jpiglo, nj_glo=jpjglo, ibegin=nimpp+nldi-2, jbegin=njmpp+nldj-2, ni=ni, nj=nj) 1646 1823 CALL iom_set_domain_attr("grid_"//cdgrd, data_dim=2, data_ibegin = 1-nldi, data_ni = jpi, data_jbegin = 1-nldj, data_nj = jpj) 1647 CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)), &1824 if(.NOT.ldxios) CALL iom_set_domain_attr("grid_"//cdgrd, lonvalue = RESHAPE(plon(nldi:nlei, nldj:nlej),(/ ni*nj /)), & 1648 1825 & latvalue = RESHAPE(plat(nldi:nlei, nldj:nlej),(/ ni*nj /))) 1649 1826 -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/IOM/iom_def.F90
r8800 r8801 44 44 INTEGER, PARAMETER, PUBLIC :: jpmax_digits = 5 !: maximum number of digits for the cpu number in the file name 45 45 46 46 47 !$AGRIF_DO_NOT_TREAT 47 48 INTEGER, PUBLIC :: iom_open_init = 0 !: used to initialize iom_file(:)%nfid to 0 49 !XIOS write restart 50 LOGICAL, PUBLIC :: lwxios !: write single file restart using XIOS 51 INTEGER, PUBLIC :: nxioso !: type of restart file when writing using XIOS 1 - single, 2 - multiple 48 52 !XIOS read restart 49 LOGICAL, PUBLIC :: l xios_read!: read single file restart using XIOS53 LOGICAL, PUBLIC :: lrxios !: read single file restart using XIOS 50 54 LOGICAL, PUBLIC :: lxios_sini = .FALSE. ! is restart in a single file 51 55 LOGICAL, PUBLIC :: lxios_set = .FALSE. 56 57 52 58 53 59 TYPE, PUBLIC :: file_descriptor … … 70 76 END TYPE file_descriptor 71 77 TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC :: iom_file !: array containing the info for all opened files 72 73 78 INTEGER, PARAMETER, PUBLIC :: max_rst_fields = 95 74 79 TYPE, PUBLIC :: RST_FIELD 80 CHARACTER(len=30) :: vname = "NO_NAME" ! names of variables in restart file 81 CHARACTER(len=30) :: grid = "NO_GRID" 82 LOGICAL :: active =.FALSE. ! for restart write only: true - write field, false do not write field 83 END TYPE RST_FIELD 75 84 !$AGRIF_END_DO_NOT_TREAT 76 85 77 TYPE, PUBLIC :: RST_FIELD 78 CHARACTER(len=30) :: vname ! names of variables in restart file 79 CHARACTER(len=30) :: grid 80 END TYPE RST_FIELD 81 TYPE(RST_FIELD), PUBLIC :: rst_fields(max_rst_fields) 86 TYPE(RST_FIELD), PUBLIC :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields) 82 87 83 88 !!===================================================================== -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r8800 r8801 28 28 USE iom ! I/O module 29 29 USE diurnal_bulk 30 30 USE iom_def, ONLY : lwxios 31 31 32 IMPLICIT NONE 32 33 PRIVATE … … 61 62 CHARACTER(LEN=50) :: clname ! ocean output restart file name 62 63 CHARACTER(lc) :: clpath ! full path to ocean output restart file 64 CHARACTER(LEN=52) :: clpname ! ocean output restart file name including prefix for AGRIF 63 65 !!---------------------------------------------------------------------- 64 66 ! … … 94 96 IF(lwp) THEN 95 97 WRITE(numout,*) 96 SELECT CASE ( jprstlib ) 97 CASE DEFAULT ; WRITE(numout,*) & 98 ' open ocean restart NetCDF file: ',TRIM(clpath)//clname 99 END SELECT 100 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 101 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 102 ELSE ; WRITE(numout,*) ' kt = ' , kt 98 IF(.NOT.lwxios) THEN 99 SELECT CASE ( jprstlib ) 100 CASE DEFAULT ; WRITE(numout,*) & 101 ' open ocean restart NetCDF file: ',TRIM(clpath)//TRIM(clname) 102 END SELECT 103 IF ( snc4set%luse ) WRITE(numout,*) ' opened for NetCDF4 chunking and compression' 104 IF( kt == nitrst - 1 ) THEN ; WRITE(numout,*) ' kt = nitrst - 1 = ', kt 105 ELSE ; WRITE(numout,*) ' kt = ' , kt 106 ENDIF 103 107 ENDIF 104 108 ENDIF 105 109 ! 106 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 110 IF(.NOT.lwxios) THEN 111 CALL iom_open( TRIM(clpath)//TRIM(clname), numrow, ldwrt = .TRUE., kiolib = jprstlib ) 112 ELSE 113 cwxios_context = "rstw_"//TRIM(ADJUSTL(clkt)) 114 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 115 clpname = clname 116 ELSE 117 clpname = TRIM(Agrif_CFixed())//"_"//clname 118 ENDIF 119 CALL iom_init( cwxios_context, TRIM(clpath)//TRIM(clpname)) 120 CALL xios_update_calendar(nitrst) 121 CALL iom_swap( cxios_context ) 122 ENDIF 107 123 lrst_oce = .TRUE. 108 124 ENDIF … … 123 139 INTEGER, INTENT(in) :: kt ! ocean time-step 124 140 !!---------------------------------------------------------------------- 125 126 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt ) ! dynamics and tracertime step141 IF(lwxios) CALL iom_swap( cwxios_context ) 142 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rdt , ldxios = lwxios) ! dynamics time step 127 143 128 144 IF ( .NOT. ln_diurnal_only ) THEN 129 CALL iom_rstput( kt, nitrst, numrow, 'ub' , ub ) ! before fields130 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vb )131 CALL iom_rstput( kt, nitrst, numrow, 'tb' , tsb(:,:,:,jp_tem) )132 CALL iom_rstput( kt, nitrst, numrow, 'sb' , tsb(:,:,:,jp_sal) )133 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb )145 CALL iom_rstput( kt, nitrst, numrow, 'ub' , ub, ldxios = lwxios ) ! before fields 146 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vb, ldxios = lwxios ) 147 CALL iom_rstput( kt, nitrst, numrow, 'tb' , tsb(:,:,:,jp_tem), ldxios = lwxios ) 148 CALL iom_rstput( kt, nitrst, numrow, 'sb' , tsb(:,:,:,jp_sal), ldxios = lwxios ) 149 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , sshb, ldxios = lwxios ) 134 150 ! 135 CALL iom_rstput( kt, nitrst, numrow, 'un' , un ) ! now fields 136 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vn ) 137 CALL iom_rstput( kt, nitrst, numrow, 'tn' , tsn(:,:,:,jp_tem) ) 138 CALL iom_rstput( kt, nitrst, numrow, 'sn' , tsn(:,:,:,jp_sal) ) 139 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , sshn ) 140 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 141 151 CALL iom_rstput( kt, nitrst, numrow, 'un' , un, ldxios = lwxios ) ! now fields 152 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vn, ldxios = lwxios ) 153 CALL iom_rstput( kt, nitrst, numrow, 'tn' , tsn(:,:,:,jp_tem), ldxios = lwxios ) 154 CALL iom_rstput( kt, nitrst, numrow, 'sn' , tsn(:,:,:,jp_sal), ldxios = lwxios ) 155 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , sshn, ldxios = lwxios ) 156 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop, ldxios = lwxios ) 142 157 ! extra variable needed for the ice sheet coupling 143 158 IF ( ln_iscpl ) THEN 144 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask 145 CALL iom_rstput( kt, nitrst, numrow, 'umask' , umask 146 CALL iom_rstput( kt, nitrst, numrow, 'vmask' , vmask 147 CALL iom_rstput( kt, nitrst, numrow, 'smask' , ssmask 148 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:) ) ! need to compute temperature correction149 CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u_n(:,:,:) ) ! need to compute bt conservation150 CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v_n(:,:,:) ) ! need to compute bt conservation151 CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw_n(:,:,:) ) ! need to compute extrapolation if vvl159 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask, ldxios = lwxios ) ! need to extrapolate T/S 160 CALL iom_rstput( kt, nitrst, numrow, 'umask' , umask, ldxios = lwxios ) ! need to correct barotropic velocity 161 CALL iom_rstput( kt, nitrst, numrow, 'vmask' , vmask, ldxios = lwxios ) ! need to correct barotropic velocity 162 CALL iom_rstput( kt, nitrst, numrow, 'smask' , ssmask, ldxios = lwxios) ! need to correct barotropic velocity 163 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t_n(:,:,:), ldxios = lwxios ) ! need to compute temperature correction 164 CALL iom_rstput( kt, nitrst, numrow, 'e3u_n', e3u_n(:,:,:), ldxios = lwxios ) ! need to compute bt conservation 165 CALL iom_rstput( kt, nitrst, numrow, 'e3v_n', e3v_n(:,:,:), ldxios = lwxios ) ! need to compute bt conservation 166 CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', gdepw_n(:,:,:), ldxios = lwxios ) ! need to compute extrapolation if vvl 152 167 END IF 153 168 ENDIF 154 169 155 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst 156 170 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst, ldxios = lwxios ) 171 IF(lwxios) CALL iom_swap( cxios_context ) 157 172 IF( kt == nitrst ) THEN 158 CALL iom_close( numrow ) ! close the restart file (only at last time step) 173 IF(.NOT.lwxios) THEN 174 CALL iom_close( numrow ) ! close the restart file (only at last time step) 175 ELSE 176 CALL iom_context_finalize( cwxios_context ) 177 ENDIF 159 178 !!gm IF( .NOT. lk_trdmld ) lrst_oce = .FALSE. 160 179 !!gm not sure what to do here ===>>> ask to Sebastian … … 164 183 nitrst = nstocklist( nrst_lst ) 165 184 ENDIF 166 lrst_oce = .FALSE.167 185 ENDIF 168 186 ! … … 200 218 ! can handle checking if variable is in the restart file (there will be no need to open 201 219 ! restart) 202 IF(.NOT.lxios_set) l xios_read = lxios_read.AND.lxios_sini203 IF( l xios_read) THEN220 IF(.NOT.lxios_set) lrxios = lrxios.AND.lxios_sini 221 IF( lrxios) THEN 204 222 crxios_context = 'nemo_rst' 205 223 if(.NOT.lxios_set) then … … 209 227 endif 210 228 ENDIF 211 IF( TRIM(Agrif_CFixed()) /= '0' .AND. l xios_read) THEN229 IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios) THEN 212 230 CALL iom_init( crxios_context ) 213 231 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF' … … 231 249 TYPE(xios_duration):: dtime 232 250 integer::ni,nj,nk 251 REAL(wp), DIMENSION(jpi, jpj, jpk) :: w3d 233 252 !!---------------------------------------------------------------------- 234 253 … … 237 256 ! Check dynamics and tracer time-step consistency and force Euler restart if changed 238 257 IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 ) THEN 239 CALL iom_get( numror, 'rdt', zrdt, ldxios = l xios_read)258 CALL iom_get( numror, 'rdt', zrdt, ldxios = lrxios ) 240 259 IF( zrdt /= rdt ) neuler = 0 241 260 ENDIF 242 261 243 262 ! Diurnal DSST 244 IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = l xios_read)263 IF( ln_diurnal ) CALL iom_get( numror, jpdom_autoglo, 'Dsst' , x_dsst, ldxios = lrxios ) 245 264 IF ( ln_diurnal_only ) THEN 246 265 IF(lwp) WRITE( numout, * ) & 247 266 & "rst_read:- ln_diurnal_only set, setting rhop=rau0" 248 267 rhop = rau0 249 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,1,jp_tem), ldxios = lxios_read ) 268 CALL iom_get( numror, jpdom_autoglo, 'tn' , w3d, ldxios = lrxios ) 269 tsn(:,:,1,jp_tem) = w3d(:,:,1) 250 270 RETURN 251 271 ENDIF 252 272 253 273 IF( iom_varid( numror, 'ub', ldstop = .FALSE. ) > 0 ) THEN 254 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub, ldxios = l xios_read) ! before fields255 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb, ldxios = l xios_read)256 CALL iom_get( numror, jpdom_autoglo, 'tb' , tsb(:,:,:,jp_tem), ldxios = l xios_read)257 CALL iom_get( numror, jpdom_autoglo, 'sb' , tsb(:,:,:,jp_sal), ldxios = l xios_read)258 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb, ldxios = l xios_read)274 CALL iom_get( numror, jpdom_autoglo, 'ub' , ub, ldxios = lrxios ) ! before fields 275 CALL iom_get( numror, jpdom_autoglo, 'vb' , vb, ldxios = lrxios ) 276 CALL iom_get( numror, jpdom_autoglo, 'tb' , tsb(:,:,:,jp_tem), ldxios = lrxios ) 277 CALL iom_get( numror, jpdom_autoglo, 'sb' , tsb(:,:,:,jp_sal), ldxios = lrxios ) 278 CALL iom_get( numror, jpdom_autoglo, 'sshb' , sshb, ldxios = lrxios ) 259 279 ELSE 260 280 neuler = 0 261 281 ENDIF 262 282 ! 263 CALL iom_get( numror, jpdom_autoglo, 'un' , un, ldxios = l xios_read) ! now fields264 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn, ldxios = l xios_read)265 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,:,jp_tem), ldxios = l xios_read)266 CALL iom_get( numror, jpdom_autoglo, 'sn' , tsn(:,:,:,jp_sal), ldxios = l xios_read)267 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn, ldxios = l xios_read)283 CALL iom_get( numror, jpdom_autoglo, 'un' , un, ldxios = lrxios ) ! now fields 284 CALL iom_get( numror, jpdom_autoglo, 'vn' , vn, ldxios = lrxios ) 285 CALL iom_get( numror, jpdom_autoglo, 'tn' , tsn(:,:,:,jp_tem), ldxios = lrxios ) 286 CALL iom_get( numror, jpdom_autoglo, 'sn' , tsn(:,:,:,jp_sal), ldxios = lrxios ) 287 CALL iom_get( numror, jpdom_autoglo, 'sshn' , sshn, ldxios = lrxios ) 268 288 IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 269 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop, ldxios = l xios_read) ! now potential density289 CALL iom_get( numror, jpdom_autoglo, 'rhop' , rhop, ldxios = lrxios ) ! now potential density 270 290 ELSE 271 291 CALL eos( tsn, rhd, rhop, gdept_n(:,:,:) ) -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/SBC/sbcapr.F90
r8800 r8801 19 19 USE iom ! IOM library 20 20 USE lib_mpp ! MPP library 21 USE iom_def, ONLY : lwxios 21 22 22 23 IMPLICIT NONE … … 65 66 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 66 67 TYPE(FLD_N) :: sn_apr ! informations about the fields to be read 67 LOGICAL :: l xios_read! read restart using XIOS?68 LOGICAL :: lrxios ! read restart using XIOS? 68 69 !! 69 70 NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc … … 110 111 CALL ctl_warn( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' ) 111 112 ! 113 IF( lwxios ) THEN 114 CALL iom_set_rstw_var_active('ssh_ibb') 115 ENDIF 112 116 END SUBROUTINE sbc_apr_init 113 117 … … 153 157 IF( ln_rstart .AND. iom_varid( numror, 'ssh_ibb', ldstop = .FALSE. ) > 0 ) THEN 154 158 IF(lwp) WRITE(numout,*) 'sbc_apr: ssh_ibb read in the restart file' 155 CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb, ldxios = l xios_read) ! before inv. barometer ssh159 CALL iom_get( numror, jpdom_autoglo, 'ssh_ibb', ssh_ibb, ldxios = lrxios ) ! before inv. barometer ssh 156 160 ! 157 161 ELSE !* no restart: set from nit000 values … … 166 170 IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp 167 171 IF(lwp) WRITE(numout,*) '~~~~' 168 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib ) 172 IF( lwxios ) CALL iom_swap( cwxios_context ) 173 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib, ldxios = lwxios ) 174 IF( lwxios ) CALL iom_swap( cxios_context ) 169 175 ENDIF 170 176 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90
r8800 r8801 27 27 USE timing ! Timing 28 28 USE lib_fortran ! glob_sum 29 USE iom_def, ONLY : l xios_read29 USE iom_def, ONLY : lrxios, lwxios 30 30 31 31 IMPLICIT NONE … … 219 219 & iom_varid( numror, 'fwf_isf_b', ldstop = .FALSE. ) > 0 ) THEN 220 220 IF(lwp) WRITE(numout,*) ' nit000-1 isf tracer content forcing fields read in the restart file' 221 CALL iom_get( numror, jpdom_autoglo, 'fwf_isf_b', fwfisf_b(:,:), ldxios = l xios_read) ! before salt content isf_tsc trend222 CALL iom_get( numror, jpdom_autoglo, 'isf_sc_b', risf_tsc_b(:,:,jp_sal), ldxios = l xios_read) ! before salt content isf_tsc trend223 CALL iom_get( numror, jpdom_autoglo, 'isf_hc_b', risf_tsc_b(:,:,jp_tem), ldxios = l xios_read) ! before salt content isf_tsc trend221 CALL iom_get( numror, jpdom_autoglo, 'fwf_isf_b', fwfisf_b(:,:), ldxios = lrxios ) ! before salt content isf_tsc trend 222 CALL iom_get( numror, jpdom_autoglo, 'isf_sc_b', risf_tsc_b(:,:,jp_sal), ldxios = lrxios ) ! before salt content isf_tsc trend 223 CALL iom_get( numror, jpdom_autoglo, 'isf_hc_b', risf_tsc_b(:,:,jp_tem), ldxios = lrxios ) ! before salt content isf_tsc trend 224 224 ELSE 225 225 fwfisf_b(:,:) = fwfisf(:,:) … … 233 233 & 'at it= ', kt,' date= ', ndastp 234 234 IF(lwp) WRITE(numout,*) '~~~~' 235 CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:) ) 236 CALL iom_rstput( kt, nitrst, numrow, 'isf_hc_b' , risf_tsc(:,:,jp_tem) ) 237 CALL iom_rstput( kt, nitrst, numrow, 'isf_sc_b' , risf_tsc(:,:,jp_sal) ) 235 IF( lwxios ) CALL iom_swap( cwxios_context ) 236 CALL iom_rstput( kt, nitrst, numrow, 'fwf_isf_b', fwfisf(:,:), ldxios = lwxios ) 237 CALL iom_rstput( kt, nitrst, numrow, 'isf_hc_b' , risf_tsc(:,:,jp_tem), ldxios = lwxios ) 238 CALL iom_rstput( kt, nitrst, numrow, 'isf_sc_b' , risf_tsc(:,:,jp_sal), ldxios = lwxios ) 239 IF( lwxios ) CALL iom_swap( cxios_context ) 238 240 ENDIF 239 241 ! … … 394 396 END DO 395 397 398 IF( lwxios ) THEN 399 CALL iom_set_rstw_var_active('fwf_isf_b') 400 CALL iom_set_rstw_var_active('isf_hc_b') 401 CALL iom_set_rstw_var_active('isf_sc_b') 402 ENDIF 403 404 396 405 END SUBROUTINE sbc_isf_init 397 406 -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90
r8800 r8801 58 58 59 59 USE diurnal_bulk, ONLY: ln_diurnal_only ! diurnal SST diagnostic 60 USE iom_def, ONLY : l xios_read60 USE iom_def, ONLY : lrxios, lwxios 61 61 62 62 IMPLICIT NONE … … 342 342 IF( ln_wave ) CALL sbc_wave_init ! surface wave initialisation 343 343 ! 344 IF( lwxios ) THEN 345 CALL iom_set_rstw_var_active('utau_b') 346 CALL iom_set_rstw_var_active('vtau_b') 347 CALL iom_set_rstw_var_active('qns_b') 348 ! The 3D heat content due to qsr forcing is treated in traqsr 349 ! CALL iom_set_rstw_var_active('qsr_b') 350 CALL iom_set_rstw_var_active('emp_b') 351 CALL iom_set_rstw_var_active('sfx_b') 352 ENDIF 353 344 354 END SUBROUTINE sbc_init 345 355 … … 458 468 & iom_varid( numror, 'utau_b', ldstop = .FALSE. ) > 0 ) THEN 459 469 IF(lwp) WRITE(numout,*) ' nit000-1 surface forcing fields red in the restart file' 460 CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b, ldxios = l xios_read) ! before i-stress (U-point)461 CALL iom_get( numror, jpdom_autoglo, 'vtau_b', vtau_b, ldxios = l xios_read) ! before j-stress (V-point)462 CALL iom_get( numror, jpdom_autoglo, 'qns_b' , qns_b, ldxios = l xios_read) ! before non solar heat flux (T-point)470 CALL iom_get( numror, jpdom_autoglo, 'utau_b', utau_b, ldxios = lrxios ) ! before i-stress (U-point) 471 CALL iom_get( numror, jpdom_autoglo, 'vtau_b', vtau_b, ldxios = lrxios ) ! before j-stress (V-point) 472 CALL iom_get( numror, jpdom_autoglo, 'qns_b' , qns_b, ldxios = lrxios ) ! before non solar heat flux (T-point) 463 473 ! The 3D heat content due to qsr forcing is treated in traqsr 464 ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b, ldxios = l xios_read) ! before solar heat flux (T-point)465 CALL iom_get( numror, jpdom_autoglo, 'emp_b', emp_b, ldxios = l xios_read) ! before freshwater flux (T-point)474 ! CALL iom_get( numror, jpdom_autoglo, 'qsr_b' , qsr_b, ldxios = lrxios ) ! before solar heat flux (T-point) 475 CALL iom_get( numror, jpdom_autoglo, 'emp_b', emp_b, ldxios = lrxios ) ! before freshwater flux (T-point) 466 476 ! To ensure restart capability with 3.3x/3.4 restart files !! to be removed in v3.6 467 477 IF( iom_varid( numror, 'sfx_b', ldstop = .FALSE. ) > 0 ) THEN 468 CALL iom_get( numror, jpdom_autoglo, 'sfx_b', sfx_b, ldxios = l xios_read) ! before salt flux (T-point)478 CALL iom_get( numror, jpdom_autoglo, 'sfx_b', sfx_b, ldxios = lrxios ) ! before salt flux (T-point) 469 479 ELSE 470 480 sfx_b (:,:) = sfx(:,:) … … 486 496 & 'at it= ', kt,' date= ', ndastp 487 497 IF(lwp) WRITE(numout,*) '~~~~' 488 CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau ) 489 CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau ) 490 CALL iom_rstput( kt, nitrst, numrow, 'qns_b' , qns ) 498 IF( lwxios ) CALL iom_swap( cwxios_context ) 499 CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau, ldxios = lwxios ) 500 CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau, ldxios = lwxios ) 501 CALL iom_rstput( kt, nitrst, numrow, 'qns_b' , qns, ldxios = lwxios ) 491 502 ! The 3D heat content due to qsr forcing is treated in traqsr 492 503 ! CALL iom_rstput( kt, nitrst, numrow, 'qsr_b' , qsr ) 493 CALL iom_rstput( kt, nitrst, numrow, 'emp_b' , emp ) 494 CALL iom_rstput( kt, nitrst, numrow, 'sfx_b' , sfx ) 504 CALL iom_rstput( kt, nitrst, numrow, 'emp_b' , emp, ldxios = lwxios ) 505 CALL iom_rstput( kt, nitrst, numrow, 'sfx_b' , sfx, ldxios = lwxios ) 506 IF( lwxios ) CALL iom_swap( cxios_context ) 495 507 ENDIF 496 508 ! ! ---------------------------------------- ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
r8800 r8801 28 28 USE lib_mpp ! MPP library 29 29 USE wrk_nemo ! Memory allocation 30 USE iom_def, ONLY : l xios_read30 USE iom_def, ONLY : lrxios, lwxios 31 31 32 32 IMPLICIT NONE … … 148 148 IF( ln_rstart .AND. & !* Restart: read in restart file 149 149 & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 150 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields red in the restart file', l xios_read151 CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = l xios_read) ! before runoff152 CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = l xios_read) ! before heat content of runoff153 CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = l xios_read) ! before salinity content of runoff150 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields red in the restart file', lrxios 151 CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = lrxios ) ! before runoff 152 CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios ) ! before heat content of runoff 153 CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios ) ! before salinity content of runoff 154 154 ELSE !* no restart: set from nit000 values 155 155 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields set to nit000' … … 165 165 & 'at it= ', kt,' date= ', ndastp 166 166 IF(lwp) WRITE(numout,*) '~~~~' 167 CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf ) 168 CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem) ) 169 CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal) ) 167 IF( lwxios ) CALL iom_swap( cwxios_context ) 168 CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf, ldxios = lwxios ) 169 CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem), ldxios = lwxios ) 170 CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal), ldxios = lwxios ) 171 IF( lwxios ) CALL iom_swap( cxios_context ) 170 172 ENDIF 171 173 ! … … 473 475 ENDIF 474 476 ! 477 IF( lwxios ) THEN 478 CALL iom_set_rstw_var_active('rnf_b') 479 CALL iom_set_rstw_var_active('rnf_hc_b') 480 CALL iom_set_rstw_var_active('rnf_sc_b') 481 ENDIF 482 475 483 END SUBROUTINE sbc_rnf_init 476 484 -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
r8800 r8801 22 22 USE prtctl ! Print control 23 23 USE iom ! IOM library 24 USE iom_def, ONLY : l xios_read24 USE iom_def, ONLY : lrxios, lwxios 25 25 26 26 IMPLICIT NONE … … 156 156 IF(lwp) WRITE(numout,*) '~~~~~~~' 157 157 zf_sbc = REAL( nn_fsbc, wp ) 158 CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc ) ! sbc frequency 159 CALL iom_rstput( kt, nitrst, numrow, 'ssu_m' , ssu_m ) ! sea surface mean fields 160 CALL iom_rstput( kt, nitrst, numrow, 'ssv_m' , ssv_m ) 161 CALL iom_rstput( kt, nitrst, numrow, 'sst_m' , sst_m ) 162 CALL iom_rstput( kt, nitrst, numrow, 'sss_m' , sss_m ) 163 CALL iom_rstput( kt, nitrst, numrow, 'ssh_m' , ssh_m ) 164 CALL iom_rstput( kt, nitrst, numrow, 'e3t_m' , e3t_m ) 165 CALL iom_rstput( kt, nitrst, numrow, 'frq_m' , frq_m ) 166 ! 158 IF( lwxios ) CALL iom_swap( cwxios_context ) 159 CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc, ldxios = lwxios ) ! sbc frequency 160 CALL iom_rstput( kt, nitrst, numrow, 'ssu_m' , ssu_m, ldxios = lwxios ) ! sea surface mean fields 161 CALL iom_rstput( kt, nitrst, numrow, 'ssv_m' , ssv_m, ldxios = lwxios ) 162 CALL iom_rstput( kt, nitrst, numrow, 'sst_m' , sst_m, ldxios = lwxios ) 163 CALL iom_rstput( kt, nitrst, numrow, 'sss_m' , sss_m, ldxios = lwxios ) 164 CALL iom_rstput( kt, nitrst, numrow, 'ssh_m' , ssh_m, ldxios = lwxios ) 165 CALL iom_rstput( kt, nitrst, numrow, 'e3t_m' , e3t_m, ldxios = lwxios ) 166 CALL iom_rstput( kt, nitrst, numrow, 'frq_m' , frq_m, ldxios = lwxios ) 167 ! 168 IF( lwxios ) CALL iom_swap( cxios_context ) 167 169 ENDIF 168 170 ! … … 207 209 IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN 208 210 l_ssm_mean = .TRUE. 209 CALL iom_get( numror , 'nn_fsbc', zf_sbc, ldxios = l xios_read) ! sbc frequency of previous run210 CALL iom_get( numror, jpdom_autoglo, 'ssu_m' , ssu_m, ldxios = l xios_read) ! sea surface mean velocity (U-point)211 CALL iom_get( numror, jpdom_autoglo, 'ssv_m' , ssv_m, ldxios = l xios_read) ! " " velocity (V-point)212 CALL iom_get( numror, jpdom_autoglo, 'sst_m' , sst_m, ldxios = l xios_read) ! " " temperature (T-point)213 CALL iom_get( numror, jpdom_autoglo, 'sss_m' , sss_m, ldxios = l xios_read) ! " " salinity (T-point)214 CALL iom_get( numror, jpdom_autoglo, 'ssh_m' , ssh_m, ldxios = l xios_read) ! " " height (T-point)215 CALL iom_get( numror, jpdom_autoglo, 'e3t_m' , e3t_m, ldxios = l xios_read) ! 1st level thickness (T-point)216 CALL iom_get( numror, jpdom_autoglo, 'e3t_m', e3t_m, ldxios = l xios_read)211 CALL iom_get( numror , 'nn_fsbc', zf_sbc, ldxios = lrxios ) ! sbc frequency of previous run 212 CALL iom_get( numror, jpdom_autoglo, 'ssu_m' , ssu_m, ldxios = lrxios ) ! sea surface mean velocity (U-point) 213 CALL iom_get( numror, jpdom_autoglo, 'ssv_m' , ssv_m, ldxios = lrxios ) ! " " velocity (V-point) 214 CALL iom_get( numror, jpdom_autoglo, 'sst_m' , sst_m, ldxios = lrxios ) ! " " temperature (T-point) 215 CALL iom_get( numror, jpdom_autoglo, 'sss_m' , sss_m, ldxios = lrxios ) ! " " salinity (T-point) 216 CALL iom_get( numror, jpdom_autoglo, 'ssh_m' , ssh_m, ldxios = lrxios ) ! " " height (T-point) 217 CALL iom_get( numror, jpdom_autoglo, 'e3t_m' , e3t_m, ldxios = lrxios ) ! 1st level thickness (T-point) 218 CALL iom_get( numror, jpdom_autoglo, 'e3t_m', e3t_m, ldxios = lrxios ) 217 219 ! fraction of solar net radiation absorbed in 1st T level 218 220 IF( iom_varid( numror, 'frq_m', ldstop = .FALSE. ) > 0 ) THEN 219 CALL iom_get( numror, jpdom_autoglo, 'frq_m' , frq_m, ldxios = l xios_read)221 CALL iom_get( numror, jpdom_autoglo, 'frq_m' , frq_m, ldxios = lrxios ) 220 222 ELSE 221 223 frq_m(:,:) = 1._wp ! default definition … … 253 255 ENDIF 254 256 ! 257 IF( lwxios.AND.nn_fsbc > 1 ) THEN 258 CALL iom_set_rstw_var_active('nn_fsbc') 259 CALL iom_set_rstw_var_active('ssu_m') 260 CALL iom_set_rstw_var_active('ssv_m') 261 CALL iom_set_rstw_var_active('sst_m') 262 CALL iom_set_rstw_var_active('sss_m') 263 CALL iom_set_rstw_var_active('ssh_m') 264 CALL iom_set_rstw_var_active('e3t_m') 265 CALL iom_set_rstw_var_active('frq_m') 266 ENDIF 267 255 268 END SUBROUTINE sbc_ssm_init 256 269 -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
r8800 r8801 36 36 USE wrk_nemo ! Memory Allocation 37 37 USE timing ! Timing 38 USE iom_def, ONLY : l xios_read38 USE iom_def, ONLY : lrxios, lwxios 39 39 IMPLICIT NONE 40 40 PRIVATE … … 139 139 IF(lwp) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field read in the restart file' 140 140 z1_2 = 0.5_wp 141 CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = l xios_read) ! before heat content trend due to Qsr flux141 CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios ) ! before heat content trend due to Qsr flux 142 142 ELSE ! No restart or restart not found: Euler forward time stepping 143 143 z1_2 = 1._wp … … 294 294 ! 295 295 IF( lrst_oce ) THEN ! write in the ocean restart file 296 CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc ) 297 CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev ) 296 IF( lwxios ) CALL iom_swap( cwxios_context ) 297 CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc, ldxios = lwxios ) 298 CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev, ldxios = lwxios ) 299 IF( lwxios ) CALL iom_swap( cxios_context ) 298 300 ENDIF 299 301 ! … … 430 432 ! 1st ocean level attenuation coefficient (used in sbcssm) 431 433 IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN 432 CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev, ldxios = l xios_read)434 CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev, ldxios = lrxios ) 433 435 ELSE 434 436 fraqsr_1lev(:,:) = 1._wp ! default : no penetration 435 437 ENDIF 436 438 ! 439 IF( lwxios ) THEN 440 CALL iom_set_rstw_var_active('qsr_hc_b') 441 CALL iom_set_rstw_var_active('fraqsr_1lev') 442 ENDIF 437 443 IF( nn_timing == 1 ) CALL timing_stop('tra_qsr_init') 438 444 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
r8800 r8801 34 34 USE wrk_nemo ! Memory Allocation 35 35 USE timing ! Timing 36 USE iom_def, ONLY : l xios_read36 USE iom_def, ONLY : lrxios, lwxios 37 37 38 38 IMPLICIT NONE … … 109 109 zfact = 0.5_wp 110 110 sbc_tsc(:,:,:) = 0._wp 111 CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = l xios_read) ! before heat content sbc trend112 CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = l xios_read) ! before salt content sbc trend111 CALL iom_get( numror, jpdom_autoglo, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem), ldxios = lrxios ) ! before heat content sbc trend 112 CALL iom_get( numror, jpdom_autoglo, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal), ldxios = lrxios ) ! before salt content sbc trend 113 113 ELSE ! No restart or restart not found: Euler forward time stepping 114 114 zfact = 1._wp … … 147 147 ! 148 148 IF( lrst_oce ) THEN !== write sbc_tsc in the ocean restart file ==! 149 CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) ) 150 CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal) ) 149 IF( lwxios ) CALL iom_swap( cwxios_context ) 150 CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem), ldxios = lwxios ) 151 CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal), ldxios = lwxios ) 152 IF( lwxios ) CALL iom_swap( cxios_context ) 151 153 ENDIF 152 154 ! -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfgls.F90
r8800 r8801 34 34 USE timing ! Timing 35 35 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 36 USE iom_def, ONLY : l xios_read36 USE iom_def, ONLY : lrxios, lwxios 37 37 38 38 IMPLICIT NONE … … 1141 1141 CALL gls_rst( nit000, 'READ' ) !* read or initialize all required files 1142 1142 ! 1143 IF( lwxios ) THEN 1144 CALL iom_set_rstw_var_active('en') 1145 CALL iom_set_rstw_var_active('avt') 1146 CALL iom_set_rstw_var_active('avm') 1147 CALL iom_set_rstw_var_active('avmu') 1148 CALL iom_set_rstw_var_active('avmv') 1149 CALL iom_set_rstw_var_active('mxln') 1150 ENDIF 1151 1143 1152 IF( nn_timing == 1 ) CALL timing_stop('zdf_gls_init') 1144 1153 ! … … 1176 1185 ! 1177 1186 IF( MIN( id1, id2, id3, id4, id5, id6 ) > 0 ) THEN ! all required arrays exist 1178 CALL iom_get( numror, jpdom_autoglo, 'en' , en, ldxios = l xios_read)1179 CALL iom_get( numror, jpdom_autoglo, 'avt' , avt, ldxios = l xios_read)1180 CALL iom_get( numror, jpdom_autoglo, 'avm' , avm, ldxios = l xios_read)1181 CALL iom_get( numror, jpdom_autoglo, 'avmu' , avmu, ldxios = l xios_read)1182 CALL iom_get( numror, jpdom_autoglo, 'avmv' , avmv, ldxios = l xios_read)1183 CALL iom_get( numror, jpdom_autoglo, 'mxln' , mxln, ldxios = l xios_read)1187 CALL iom_get( numror, jpdom_autoglo, 'en' , en, ldxios = lrxios ) 1188 CALL iom_get( numror, jpdom_autoglo, 'avt' , avt, ldxios = lrxios ) 1189 CALL iom_get( numror, jpdom_autoglo, 'avm' , avm, ldxios = lrxios ) 1190 CALL iom_get( numror, jpdom_autoglo, 'avmu' , avmu, ldxios = lrxios ) 1191 CALL iom_get( numror, jpdom_autoglo, 'avmv' , avmv, ldxios = lrxios ) 1192 CALL iom_get( numror, jpdom_autoglo, 'mxln' , mxln, ldxios = lrxios ) 1184 1193 ELSE 1185 1194 IF(lwp) WRITE(numout,*) ' ===>>>> : previous run without gls scheme, en and mxln computed by iterative loop' … … 1201 1210 ! ! ------------------- 1202 1211 IF(lwp) WRITE(numout,*) '---- gls-rst ----' 1203 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 1204 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt_k ) 1205 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm_k ) 1206 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k ) 1207 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv_k ) 1208 CALL iom_rstput( kt, nitrst, numrow, 'mxln' , mxln ) 1212 IF( lwxios ) CALL iom_swap( cwxios_context ) 1213 CALL iom_rstput( kt, nitrst, numrow, 'en' , en, ldxios = lwxios ) 1214 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt_k, ldxios = lwxios ) 1215 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm_k, ldxios = lwxios ) 1216 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k, ldxios = lwxios ) 1217 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv_k, ldxios = lwxios ) 1218 CALL iom_rstput( kt, nitrst, numrow, 'mxln' , mxln, ldxios = lwxios ) 1219 IF( lwxios ) CALL iom_swap( cxios_context ) 1209 1220 ! 1210 1221 ENDIF -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
r8800 r8801 28 28 USE iom ! IOM library 29 29 USE lib_mpp ! distribued memory computing 30 USE iom_def, ONLY : l xios_read30 USE iom_def, ONLY : lrxios 31 31 32 32 IMPLICIT NONE … … 160 160 ! file in traadv_cen2 end read here. 161 161 IF( iom_varid( numror, 'avmb', ldstop = .FALSE. ) > 0 ) THEN 162 CALL iom_get( numror, jpdom_unknown, 'avmb', avmb, ldxios = l xios_read)163 CALL iom_get( numror, jpdom_unknown, 'avtb', avtb, ldxios = l xios_read)162 CALL iom_get( numror, jpdom_unknown, 'avmb', avmb, ldxios = lrxios ) 163 CALL iom_get( numror, jpdom_unknown, 'avtb', avtb, ldxios = lrxios ) 164 164 ENDIF 165 165 ENDIF -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftke.F90
r8800 r8801 53 53 USE timing ! Timing 54 54 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 55 USE iom_def, ONLY : lwxios 55 56 #if defined key_agrif 56 57 USE agrif_opa_interp 57 58 USE agrif_opa_update 58 59 #endif 59 USE iom_def, ONLY : l xios_read60 USE iom_def, ONLY : lrxios 60 61 61 62 IMPLICIT NONE … … 815 816 CALL tke_rst( nit000, 'READ' ) !* read or initialize all required files 816 817 ! 818 IF( lwxios ) THEN 819 CALL iom_set_rstw_var_active('en') 820 CALL iom_set_rstw_var_active('avt') 821 CALL iom_set_rstw_var_active('avm') 822 CALL iom_set_rstw_var_active('avmu') 823 CALL iom_set_rstw_var_active('avmv') 824 CALL iom_set_rstw_var_active('dissl') 825 ENDIF 826 817 827 END SUBROUTINE zdf_tke_init 818 828 … … 846 856 ! 847 857 IF( id1 > 0 ) THEN ! 'en' exists 848 CALL iom_get( numror, jpdom_autoglo, 'en', en, ldxios = l xios_read)858 CALL iom_get( numror, jpdom_autoglo, 'en', en, ldxios = lrxios ) 849 859 IF( MIN( id2, id3, id4, id5, id6 ) > 0 ) THEN ! all required arrays exist 850 CALL iom_get( numror, jpdom_autoglo, 'avt' , avt, ldxios = l xios_read)851 CALL iom_get( numror, jpdom_autoglo, 'avm' , avm, ldxios = l xios_read)852 CALL iom_get( numror, jpdom_autoglo, 'avmu' , avmu, ldxios = l xios_read)853 CALL iom_get( numror, jpdom_autoglo, 'avmv' , avmv, ldxios = l xios_read)854 CALL iom_get( numror, jpdom_autoglo, 'dissl', dissl, ldxios = l xios_read)860 CALL iom_get( numror, jpdom_autoglo, 'avt' , avt, ldxios = lrxios ) 861 CALL iom_get( numror, jpdom_autoglo, 'avm' , avm, ldxios = lrxios ) 862 CALL iom_get( numror, jpdom_autoglo, 'avmu' , avmu, ldxios = lrxios ) 863 CALL iom_get( numror, jpdom_autoglo, 'avmv' , avmv, ldxios = lrxios ) 864 CALL iom_get( numror, jpdom_autoglo, 'dissl', dissl, ldxios = lrxios ) 855 865 ELSE ! one at least array is missing 856 866 CALL tke_avn ! compute avt, avm, avmu, avmv and dissl (approximation) … … 881 891 ! ! ------------------- 882 892 IF(lwp) WRITE(numout,*) '---- tke-rst ----' 883 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 884 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt_k ) 885 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm_k ) 886 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k ) 887 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv_k ) 888 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl ) 893 IF( lwxios ) CALL iom_swap( cwxios_context ) 894 CALL iom_rstput( kt, nitrst, numrow, 'en' , en , ldxios = lwxios ) 895 CALL iom_rstput( kt, nitrst, numrow, 'avt' , avt_k , ldxios = lwxios ) 896 CALL iom_rstput( kt, nitrst, numrow, 'avm' , avm_k , ldxios = lwxios ) 897 CALL iom_rstput( kt, nitrst, numrow, 'avmu' , avmu_k, ldxios = lwxios ) 898 CALL iom_rstput( kt, nitrst, numrow, 'avmv' , avmv_k, ldxios = lwxios ) 899 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl , ldxios = lwxios ) 900 IF( lwxios ) CALL iom_swap( cxios_context ) 889 901 ! 890 902 ENDIF -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/OPA_SRC/step.F90
r8800 r8801 345 345 IF( kstp == nitend .OR. indic < 0 ) THEN 346 346 CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF 347 IF(l xios_read) CALL iom_context_finalize( crxios_context )347 IF(lrxios) CALL iom_context_finalize( crxios_context ) 348 348 IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 349 349 ENDIF -
branches/2017/dev_r8600_xios_read_write_v2/NEMOGCM/NEMO/SAS_SRC/daymod.F90
r8800 r8801 318 318 IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN 319 319 ! Get Calendar informations 320 CALL iom_get( numror, 'kt', zk , ldxios = lxios_read ) ! last time-step of previous run320 CALL iom_get( numror, 'kt', zkt, ldxios = lxios_read ) ! last time-step of previous run 321 321 IF(lwp) THEN 322 322 WRITE(numout,*) ' *** Info read in restart : '
Note: See TracChangeset
for help on using the changeset viewer.