Changeset 12957
- Timestamp:
- 2020-05-20T18:53:27+02:00 (5 years ago)
- Location:
- NEMO/branches/2020/dev_12905_xios_restart/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedia.F90
r12489 r12957 221 221 IF( ln_rstart ) THEN !* Read the restart file 222 222 ! 223 CALL iom_get( numrir, 'kt_ice' , ziter ) 223 IF(lrxios) CALL iom_swap(crixios_context) 224 CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios ) 224 225 IF(lwp) WRITE(numout,*) 225 226 IF(lwp) WRITE(numout,*) 'ice_dia_rst read at time step = ', ziter 226 227 IF(lwp) WRITE(numout,*) '~~~~~~~~~~' 227 CALL iom_get( numrir, 'frc_voltop' , frc_voltop ) 228 CALL iom_get( numrir, 'frc_volbot' , frc_volbot ) 229 CALL iom_get( numrir, 'frc_temtop' , frc_temtop ) 230 CALL iom_get( numrir, 'frc_tembot' , frc_tembot ) 231 CALL iom_get( numrir, 'frc_sal' , frc_sal ) 232 CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini ) 233 CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini ) 234 CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini ) 228 CALL iom_get( numrir, 'frc_voltop' , frc_voltop, ldxios = lrxios ) 229 CALL iom_get( numrir, 'frc_volbot' , frc_volbot, ldxios = lrxios ) 230 CALL iom_get( numrir, 'frc_temtop' , frc_temtop, ldxios = lrxios ) 231 CALL iom_get( numrir, 'frc_tembot' , frc_tembot, ldxios = lrxios ) 232 CALL iom_get( numrir, 'frc_sal' , frc_sal, ldxios = lrxios ) 233 CALL iom_get( numrir, jpdom_autoglo, 'vol_loc_ini', vol_loc_ini, ldxios = lrxios ) 234 CALL iom_get( numrir, jpdom_autoglo, 'tem_loc_ini', tem_loc_ini, ldxios = lrxios ) 235 CALL iom_get( numrir, jpdom_autoglo, 'sal_loc_ini', sal_loc_ini, ldxios = lrxios ) 236 IF(lrxios) CALL iom_swap(cxios_context) 235 237 ELSE 236 238 IF(lwp) WRITE(numout,*) … … 261 263 ! Write in numriw (if iter == nitrst) 262 264 ! ------------------ 263 CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop ) 264 CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot ) 265 CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop ) 266 CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot ) 267 CALL iom_rstput( iter, nitrst, numriw, 'frc_sal' , frc_sal ) 268 CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini ) 269 CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini ) 270 CALL iom_rstput( iter, nitrst, numriw, 'sal_loc_ini', sal_loc_ini ) 265 IF( lwxios ) CALL iom_swap( cwixios_context ) 266 CALL iom_rstput( iter, nitrst, numriw, 'frc_voltop' , frc_voltop, ldxios = lwxios ) 267 CALL iom_rstput( iter, nitrst, numriw, 'frc_volbot' , frc_volbot, ldxios = lwxios ) 268 CALL iom_rstput( iter, nitrst, numriw, 'frc_temtop' , frc_temtop, ldxios = lwxios ) 269 CALL iom_rstput( iter, nitrst, numriw, 'frc_tembot' , frc_tembot, ldxios = lwxios ) 270 CALL iom_rstput( iter, nitrst, numriw, 'frc_sal' , frc_sal, ldxios = lwxios ) 271 CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini, ldxios = lwxios ) 272 CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini, ldxios = lwxios ) 273 CALL iom_rstput( iter, nitrst, numriw, 'sal_loc_ini', sal_loc_ini, ldxios = lwxios ) 274 IF( lwxios ) CALL iom_swap( cxios_context ) 271 275 ! 272 276 ENDIF -
NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_adv_pra.F90
r12489 r12957 770 770 ! 771 771 IF( id1 > 0 ) THEN !** Read the restart file **! 772 IF(lrxios) CALL iom_swap(crixios_context) 772 773 ! 773 774 ! ! ice thickness 774 CALL iom_get( numrir, jpdom_autoglo, 'sxice' , sxice )775 CALL iom_get( numrir, jpdom_autoglo, 'syice' , syice )776 CALL iom_get( numrir, jpdom_autoglo, 'sxxice', sxxice )777 CALL iom_get( numrir, jpdom_autoglo, 'syyice', syyice )778 CALL iom_get( numrir, jpdom_autoglo, 'sxyice', sxyice )775 CALL iom_get( numrir, jpdom_autoglo, 'sxice' , sxice, ldxios = lrxios ) 776 CALL iom_get( numrir, jpdom_autoglo, 'syice' , syice, ldxios = lrxios ) 777 CALL iom_get( numrir, jpdom_autoglo, 'sxxice', sxxice, ldxios = lrxios ) 778 CALL iom_get( numrir, jpdom_autoglo, 'syyice', syyice, ldxios = lrxios ) 779 CALL iom_get( numrir, jpdom_autoglo, 'sxyice', sxyice, ldxios = lrxios ) 779 780 ! ! snow thickness 780 CALL iom_get( numrir, jpdom_autoglo, 'sxsn' , sxsn )781 CALL iom_get( numrir, jpdom_autoglo, 'sysn' , sysn )782 CALL iom_get( numrir, jpdom_autoglo, 'sxxsn' , sxxsn )783 CALL iom_get( numrir, jpdom_autoglo, 'syysn' , syysn )784 CALL iom_get( numrir, jpdom_autoglo, 'sxysn' , sxysn )781 CALL iom_get( numrir, jpdom_autoglo, 'sxsn' , sxsn, ldxios = lrxios ) 782 CALL iom_get( numrir, jpdom_autoglo, 'sysn' , sysn, ldxios = lrxios ) 783 CALL iom_get( numrir, jpdom_autoglo, 'sxxsn' , sxxsn, ldxios = lrxios ) 784 CALL iom_get( numrir, jpdom_autoglo, 'syysn' , syysn, ldxios = lrxios ) 785 CALL iom_get( numrir, jpdom_autoglo, 'sxysn' , sxysn, ldxios = lrxios ) 785 786 ! ! ice concentration 786 CALL iom_get( numrir, jpdom_autoglo, 'sxa' , sxa )787 CALL iom_get( numrir, jpdom_autoglo, 'sya' , sya )788 CALL iom_get( numrir, jpdom_autoglo, 'sxxa' , sxxa )789 CALL iom_get( numrir, jpdom_autoglo, 'syya' , syya )790 CALL iom_get( numrir, jpdom_autoglo, 'sxya' , sxya )787 CALL iom_get( numrir, jpdom_autoglo, 'sxa' , sxa, ldxios = lrxios ) 788 CALL iom_get( numrir, jpdom_autoglo, 'sya' , sya, ldxios = lrxios ) 789 CALL iom_get( numrir, jpdom_autoglo, 'sxxa' , sxxa, ldxios = lrxios ) 790 CALL iom_get( numrir, jpdom_autoglo, 'syya' , syya, ldxios = lrxios ) 791 CALL iom_get( numrir, jpdom_autoglo, 'sxya' , sxya, ldxios = lrxios ) 791 792 ! ! ice salinity 792 CALL iom_get( numrir, jpdom_autoglo, 'sxsal' , sxsal )793 CALL iom_get( numrir, jpdom_autoglo, 'sysal' , sysal )794 CALL iom_get( numrir, jpdom_autoglo, 'sxxsal', sxxsal )795 CALL iom_get( numrir, jpdom_autoglo, 'syysal', syysal )796 CALL iom_get( numrir, jpdom_autoglo, 'sxysal', sxysal )793 CALL iom_get( numrir, jpdom_autoglo, 'sxsal' , sxsal, ldxios = lrxios ) 794 CALL iom_get( numrir, jpdom_autoglo, 'sysal' , sysal, ldxios = lrxios ) 795 CALL iom_get( numrir, jpdom_autoglo, 'sxxsal', sxxsal, ldxios = lrxios ) 796 CALL iom_get( numrir, jpdom_autoglo, 'syysal', syysal, ldxios = lrxios ) 797 CALL iom_get( numrir, jpdom_autoglo, 'sxysal', sxysal, ldxios = lrxios ) 797 798 ! ! ice age 798 CALL iom_get( numrir, jpdom_autoglo, 'sxage' , sxage )799 CALL iom_get( numrir, jpdom_autoglo, 'syage' , syage )800 CALL iom_get( numrir, jpdom_autoglo, 'sxxage', sxxage )801 CALL iom_get( numrir, jpdom_autoglo, 'syyage', syyage )802 CALL iom_get( numrir, jpdom_autoglo, 'sxyage', sxyage )799 CALL iom_get( numrir, jpdom_autoglo, 'sxage' , sxage, ldxios = lrxios ) 800 CALL iom_get( numrir, jpdom_autoglo, 'syage' , syage, ldxios = lrxios ) 801 CALL iom_get( numrir, jpdom_autoglo, 'sxxage', sxxage, ldxios = lrxios ) 802 CALL iom_get( numrir, jpdom_autoglo, 'syyage', syyage, ldxios = lrxios ) 803 CALL iom_get( numrir, jpdom_autoglo, 'sxyage', sxyage, ldxios = lrxios ) 803 804 ! ! snow layers heat content 804 805 DO jk = 1, nlay_s 805 806 WRITE(zchar1,'(I2.2)') jk 806 znam = 'sxc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxc0 (:,:,jk,:) = z3d(:,:,:) 807 znam = 'syc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; syc0 (:,:,jk,:) = z3d(:,:,:) 808 znam = 'sxxc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxxc0(:,:,jk,:) = z3d(:,:,:) 809 znam = 'syyc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; syyc0(:,:,jk,:) = z3d(:,:,:) 810 znam = 'sxyc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxyc0(:,:,jk,:) = z3d(:,:,:) 807 znam = 'sxc0'//'_l'//zchar1 808 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxc0 (:,:,jk,:) = z3d(:,:,:) 809 znam = 'syc0'//'_l'//zchar1 810 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; syc0 (:,:,jk,:) = z3d(:,:,:) 811 znam = 'sxxc0'//'_l'//zchar1 812 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxxc0(:,:,jk,:) = z3d(:,:,:) 813 znam = 'syyc0'//'_l'//zchar1 814 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; syyc0(:,:,jk,:) = z3d(:,:,:) 815 znam = 'sxyc0'//'_l'//zchar1 816 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxyc0(:,:,jk,:) = z3d(:,:,:) 811 817 END DO 812 818 ! ! ice layers heat content 813 819 DO jk = 1, nlay_i 814 820 WRITE(zchar1,'(I2.2)') jk 815 znam = 'sxe'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxe (:,:,jk,:) = z3d(:,:,:) 816 znam = 'sye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sye (:,:,jk,:) = z3d(:,:,:) 817 znam = 'sxxe'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxxe(:,:,jk,:) = z3d(:,:,:) 818 znam = 'syye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; syye(:,:,jk,:) = z3d(:,:,:) 819 znam = 'sxye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_autoglo, znam , z3d ) ; sxye(:,:,jk,:) = z3d(:,:,:) 821 znam = 'sxe'//'_l'//zchar1 822 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxe (:,:,jk,:) = z3d(:,:,:) 823 znam = 'sye'//'_l'//zchar1 824 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sye (:,:,jk,:) = z3d(:,:,:) 825 znam = 'sxxe'//'_l'//zchar1 826 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxxe(:,:,jk,:) = z3d(:,:,:) 827 znam = 'syye'//'_l'//zchar1 828 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; syye(:,:,jk,:) = z3d(:,:,:) 829 znam = 'sxye'//'_l'//zchar1 830 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) ; sxye(:,:,jk,:) = z3d(:,:,:) 820 831 END DO 821 832 ! 822 833 IF( ln_pnd_H12 ) THEN ! melt pond fraction 823 CALL iom_get( numrir, jpdom_autoglo, 'sxap' , sxap 824 CALL iom_get( numrir, jpdom_autoglo, 'syap' , syap 825 CALL iom_get( numrir, jpdom_autoglo, 'sxxap', sxxap )826 CALL iom_get( numrir, jpdom_autoglo, 'syyap', syyap )827 CALL iom_get( numrir, jpdom_autoglo, 'sxyap', sxyap )834 CALL iom_get( numrir, jpdom_autoglo, 'sxap' , sxap, ldxios = lrxios ) 835 CALL iom_get( numrir, jpdom_autoglo, 'syap' , syap, ldxios = lrxios ) 836 CALL iom_get( numrir, jpdom_autoglo, 'sxxap', sxxap, ldxios = lrxios ) 837 CALL iom_get( numrir, jpdom_autoglo, 'syyap', syyap, ldxios = lrxios ) 838 CALL iom_get( numrir, jpdom_autoglo, 'sxyap', sxyap, ldxios = lrxios ) 828 839 ! ! melt pond volume 829 CALL iom_get( numrir, jpdom_autoglo, 'sxvp' , sxvp 830 CALL iom_get( numrir, jpdom_autoglo, 'syvp' , syvp 831 CALL iom_get( numrir, jpdom_autoglo, 'sxxvp', sxxvp )832 CALL iom_get( numrir, jpdom_autoglo, 'syyvp', syyvp )833 CALL iom_get( numrir, jpdom_autoglo, 'sxyvp', sxyvp )840 CALL iom_get( numrir, jpdom_autoglo, 'sxvp' , sxvp, ldxios = lrxios ) 841 CALL iom_get( numrir, jpdom_autoglo, 'syvp' , syvp, ldxios = lrxios ) 842 CALL iom_get( numrir, jpdom_autoglo, 'sxxvp', sxxvp, ldxios = lrxios ) 843 CALL iom_get( numrir, jpdom_autoglo, 'syyvp', syyvp, ldxios = lrxios ) 844 CALL iom_get( numrir, jpdom_autoglo, 'sxyvp', sxyvp, ldxios = lrxios ) 834 845 ENDIF 846 IF(lrxios) CALL iom_swap(cxios_context) 835 847 ! 836 848 ELSE !** start rheology from rest **! … … 862 874 ! 863 875 ! ! ice thickness 864 CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice ) 865 CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice ) 866 CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice ) 867 CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice ) 868 CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice ) 876 IF( lwxios ) CALL iom_swap( cwixios_context ) 877 CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice, ldxios = lwxios) 878 CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice, ldxios = lwxios) 879 CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice, ldxios = lwxios) 880 CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice, ldxios = lwxios) 881 CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice, ldxios = lwxios) 869 882 ! ! snow thickness 870 CALL iom_rstput( iter, nitrst, numriw, 'sxsn' , sxsn 871 CALL iom_rstput( iter, nitrst, numriw, 'sysn' , sysn 872 CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn 873 CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn 874 CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn 883 CALL iom_rstput( iter, nitrst, numriw, 'sxsn' , sxsn, ldxios = lwxios ) 884 CALL iom_rstput( iter, nitrst, numriw, 'sysn' , sysn, ldxios = lwxios ) 885 CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn, ldxios = lwxios ) 886 CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn, ldxios = lwxios ) 887 CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn, ldxios = lwxios ) 875 888 ! ! ice concentration 876 CALL iom_rstput( iter, nitrst, numriw, 'sxa' , sxa 877 CALL iom_rstput( iter, nitrst, numriw, 'sya' , sya 878 CALL iom_rstput( iter, nitrst, numriw, 'sxxa' , sxxa 879 CALL iom_rstput( iter, nitrst, numriw, 'syya' , syya 880 CALL iom_rstput( iter, nitrst, numriw, 'sxya' , sxya 889 CALL iom_rstput( iter, nitrst, numriw, 'sxa' , sxa, ldxios = lwxios ) 890 CALL iom_rstput( iter, nitrst, numriw, 'sya' , sya, ldxios = lwxios ) 891 CALL iom_rstput( iter, nitrst, numriw, 'sxxa' , sxxa, ldxios = lwxios ) 892 CALL iom_rstput( iter, nitrst, numriw, 'syya' , syya, ldxios = lwxios ) 893 CALL iom_rstput( iter, nitrst, numriw, 'sxya' , sxya, ldxios = lwxios ) 881 894 ! ! ice salinity 882 CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal 883 CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal 884 CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal 885 CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal 886 CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal 895 CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal, ldxios = lwxios) 896 CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal, ldxios = lwxios) 897 CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal, ldxios = lwxios) 898 CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal, ldxios = lwxios) 899 CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal, ldxios = lwxios) 887 900 ! ! ice age 888 CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage 889 CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage 890 CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage 891 CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage 892 CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage 901 CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage, ldxios = lwxios) 902 CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage, ldxios = lwxios) 903 CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage, ldxios = lwxios) 904 CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage, ldxios = lwxios) 905 CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage, ldxios = lwxios) 893 906 ! ! snow layers heat content 894 907 DO jk = 1, nlay_s 895 908 WRITE(zchar1,'(I2.2)') jk 896 znam = 'sxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxc0 (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 897 znam = 'syc0'//'_l'//zchar1 ; z3d(:,:,:) = syc0 (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 898 znam = 'sxxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxxc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 899 znam = 'syyc0'//'_l'//zchar1 ; z3d(:,:,:) = syyc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 900 znam = 'sxyc0'//'_l'//zchar1 ; z3d(:,:,:) = sxyc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 909 znam = 'sxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxc0 (:,:,jk,:) 910 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 911 znam = 'syc0'//'_l'//zchar1 ; z3d(:,:,:) = syc0 (:,:,jk,:) 912 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 913 znam = 'sxxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxxc0(:,:,jk,:) 914 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 915 znam = 'syyc0'//'_l'//zchar1 ; z3d(:,:,:) = syyc0(:,:,jk,:) 916 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 917 znam = 'sxyc0'//'_l'//zchar1 ; z3d(:,:,:) = sxyc0(:,:,jk,:) 918 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 901 919 END DO 902 920 ! ! ice layers heat content 903 921 DO jk = 1, nlay_i 904 922 WRITE(zchar1,'(I2.2)') jk 905 znam = 'sxe'//'_l'//zchar1 ; z3d(:,:,:) = sxe (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 906 znam = 'sye'//'_l'//zchar1 ; z3d(:,:,:) = sye (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 907 znam = 'sxxe'//'_l'//zchar1 ; z3d(:,:,:) = sxxe(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 908 znam = 'syye'//'_l'//zchar1 ; z3d(:,:,:) = syye(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 909 znam = 'sxye'//'_l'//zchar1 ; z3d(:,:,:) = sxye(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 923 znam = 'sxe'//'_l'//zchar1 ; z3d(:,:,:) = sxe (:,:,jk,:) 924 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 925 znam = 'sye'//'_l'//zchar1 ; z3d(:,:,:) = sye (:,:,jk,:) 926 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 927 znam = 'sxxe'//'_l'//zchar1 ; z3d(:,:,:) = sxxe(:,:,jk,:) 928 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 929 znam = 'syye'//'_l'//zchar1 ; z3d(:,:,:) = syye(:,:,jk,:) 930 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 931 znam = 'sxye'//'_l'//zchar1 ; z3d(:,:,:) = sxye(:,:,jk,:) 932 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios) 910 933 END DO 911 934 ! 912 935 IF( ln_pnd_H12 ) THEN ! melt pond fraction 913 CALL iom_rstput( iter, nitrst, numriw, 'sxap' , sxap 914 CALL iom_rstput( iter, nitrst, numriw, 'syap' , syap 915 CALL iom_rstput( iter, nitrst, numriw, 'sxxap', sxxap 916 CALL iom_rstput( iter, nitrst, numriw, 'syyap', syyap 917 CALL iom_rstput( iter, nitrst, numriw, 'sxyap', sxyap 936 CALL iom_rstput( iter, nitrst, numriw, 'sxap' , sxap, ldxios = lwxios) 937 CALL iom_rstput( iter, nitrst, numriw, 'syap' , syap, ldxios = lwxios) 938 CALL iom_rstput( iter, nitrst, numriw, 'sxxap', sxxap, ldxios = lwxios) 939 CALL iom_rstput( iter, nitrst, numriw, 'syyap', syyap, ldxios = lwxios) 940 CALL iom_rstput( iter, nitrst, numriw, 'sxyap', sxyap, ldxios = lwxios) 918 941 ! ! melt pond volume 919 CALL iom_rstput( iter, nitrst, numriw, 'sxvp' , sxvp 920 CALL iom_rstput( iter, nitrst, numriw, 'syvp' , syvp 921 CALL iom_rstput( iter, nitrst, numriw, 'sxxvp', sxxvp 922 CALL iom_rstput( iter, nitrst, numriw, 'syyvp', syyvp 923 CALL iom_rstput( iter, nitrst, numriw, 'sxyvp', sxyvp 942 CALL iom_rstput( iter, nitrst, numriw, 'sxvp' , sxvp, ldxios = lwxios) 943 CALL iom_rstput( iter, nitrst, numriw, 'syvp' , syvp, ldxios = lwxios) 944 CALL iom_rstput( iter, nitrst, numriw, 'sxxvp', sxxvp, ldxios = lwxios) 945 CALL iom_rstput( iter, nitrst, numriw, 'syyvp', syyvp, ldxios = lwxios) 946 CALL iom_rstput( iter, nitrst, numriw, 'sxyvp', sxyvp, ldxios = lwxios) 924 947 ENDIF 948 IF( lwxios ) CALL iom_swap( cxios_context ) 925 949 ! 926 950 ENDIF -
NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icedyn_rhg_evp.F90
r12489 r12957 839 839 IF( ln_rstart ) THEN !* Read the restart file 840 840 ! 841 IF(lrxios) CALL iom_swap(crixios_context) 841 842 id1 = iom_varid( numrir, 'stress1_i' , ldstop = .FALSE. ) 842 843 id2 = iom_varid( numrir, 'stress2_i' , ldstop = .FALSE. ) … … 844 845 ! 845 846 IF( MIN( id1, id2, id3 ) > 0 ) THEN ! fields exist 846 CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i 847 CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i 848 CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i )847 CALL iom_get( numrir, jpdom_autoglo, 'stress1_i' , stress1_i, ldxios = lrxios ) 848 CALL iom_get( numrir, jpdom_autoglo, 'stress2_i' , stress2_i, ldxios = lrxios ) 849 CALL iom_get( numrir, jpdom_autoglo, 'stress12_i', stress12_i, ldxios = lrxios ) 849 850 ELSE ! start rheology from rest 850 851 IF(lwp) WRITE(numout,*) … … 854 855 stress12_i(:,:) = 0._wp 855 856 ENDIF 857 IF(lrxios) CALL iom_swap(cxios_context) 856 858 ELSE !* Start from rest 857 859 IF(lwp) WRITE(numout,*) … … 867 869 iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 868 870 ! 869 CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i ) 870 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) 871 CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i ) 871 IF( lwxios ) CALL iom_swap( cwixios_context ) 872 CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i, ldxios = lwxios ) 873 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i, ldxios = lwxios ) 874 CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i, ldxios = lwxios ) 875 IF( lwxios ) CALL iom_swap( cxios_context ) 872 876 ! 873 877 ENDIF -
NEMO/branches/2020/dev_12905_xios_restart/src/ICE/icerst.F90
r12649 r12957 51 51 CHARACTER(len=50) :: clname ! ice output restart file name 52 52 CHARACTER(len=256) :: clpath ! full path to ice output restart file 53 CHARACTER(LEN=52) :: clpname ! ocean output restart file name including prefix for AGRIF 53 54 !!---------------------------------------------------------------------- 54 55 ! … … 80 81 ENDIF 81 82 ! 82 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 83 IF(.NOT.lwxios) THEN 84 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 85 ELSE 86 #if defined key_iomput 87 cwixios_context = "rstwi_"//TRIM(ADJUSTL(clkt)) 88 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 89 clpname = clname 90 ELSE 91 clpname = TRIM(Agrif_CFixed())//"_"//clname 92 ENDIF 93 CALL iom_init( cwixios_context, TRIM(clpath)//TRIM(clpname), .false., ld_closedef = .FALSE. ) 94 CALL iom_swap( cxios_context ) 95 #else 96 clinfo = 'Can not use XIOS in rst_opn' 97 CALL ctl_stop(TRIM(clinfo)) 98 #endif 99 ENDIF 83 100 lrst_ice = .TRUE. 84 101 ENDIF … … 117 134 ! ------------------ 118 135 ! ! calendar control 119 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step 120 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ) ) ! date 136 IF( lwxios ) CALL iom_swap( cwixios_context ) 137 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ), ldxios = lwxios ) ! time-step 138 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ), ldxios = lwxios ) ! date 121 139 CALL iom_delay_rst( 'WRITE', 'ICE', numriw ) ! save only ice delayed global communication variables 122 140 123 141 ! Prognostic variables 124 CALL iom_rstput( iter, nitrst, numriw, 'v_i' , v_i 125 CALL iom_rstput( iter, nitrst, numriw, 'v_s' , v_s 126 CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i 127 CALL iom_rstput( iter, nitrst, numriw, 'a_i' , a_i 128 CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su 129 CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice )130 CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice )131 CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i 132 CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip 133 CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip 142 CALL iom_rstput( iter, nitrst, numriw, 'v_i' , v_i, ldxios = lwxios ) 143 CALL iom_rstput( iter, nitrst, numriw, 'v_s' , v_s, ldxios = lwxios ) 144 CALL iom_rstput( iter, nitrst, numriw, 'sv_i' , sv_i, ldxios = lwxios ) 145 CALL iom_rstput( iter, nitrst, numriw, 'a_i' , a_i, ldxios = lwxios ) 146 CALL iom_rstput( iter, nitrst, numriw, 't_su' , t_su, ldxios = lwxios ) 147 CALL iom_rstput( iter, nitrst, numriw, 'u_ice', u_ice, ldxios = lwxios ) 148 CALL iom_rstput( iter, nitrst, numriw, 'v_ice', v_ice, ldxios = lwxios ) 149 CALL iom_rstput( iter, nitrst, numriw, 'oa_i' , oa_i, ldxios = lwxios ) 150 CALL iom_rstput( iter, nitrst, numriw, 'a_ip' , a_ip, ldxios = lwxios ) 151 CALL iom_rstput( iter, nitrst, numriw, 'v_ip' , v_ip, ldxios = lwxios ) 134 152 ! Snow enthalpy 135 153 DO jk = 1, nlay_s … … 137 155 znam = 'e_s'//'_l'//zchar1 138 156 z3d(:,:,:) = e_s(:,:,jk,:) 139 CALL iom_rstput( iter, nitrst, numriw, znam , z3d )157 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios ) 140 158 END DO 141 159 ! Ice enthalpy … … 144 162 znam = 'e_i'//'_l'//zchar1 145 163 z3d(:,:,:) = e_i(:,:,jk,:) 146 CALL iom_rstput( iter, nitrst, numriw, znam , z3d )164 CALL iom_rstput( iter, nitrst, numriw, znam , z3d, ldxios = lwxios ) 147 165 END DO 148 166 ! fields needed for Met Office (Jules) coupling 149 167 IF( ln_cpl ) THEN 150 CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice ) 151 CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice ) 152 ENDIF 168 CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice, ldxios = lwxios ) 169 CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice, ldxios = lwxios ) 170 ENDIF 171 IF( lwxios ) CALL iom_swap( cxios_context ) 153 172 ! 154 173 … … 156 175 ! ------------------ 157 176 IF( iter == nitrst ) THEN 158 CALL iom_close( numriw ) 177 IF(.NOT.lwxios) THEN 178 CALL iom_close( numriw ) 179 ELSE 180 CALL iom_context_finalize( cwixios_context ) 181 ENDIF 159 182 lrst_ice = .FALSE. 160 183 ENDIF … … 176 199 CHARACTER(len=2) :: zchar, zchar1 177 200 REAL(wp) :: zfice, ziter 201 CHARACTER(lc) :: clpname 178 202 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z3d ! 3D workspace 179 203 !!---------------------------------------------------------------------- … … 185 209 ENDIF 186 210 211 lxios_sini = .FALSE. 187 212 CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir ) 213 214 IF( lrxios .AND. .NOT. lxios_sini) STOP 'OCE and ICE restart must be in a single file' 215 IF(lwp) write(numout, *) 'USE XIOS to read restart: ', lrxios 216 IF(lwp) CALL FLUSH(numout) 217 IF( lrxios) THEN 218 crixios_context = 'si3_rst' 219 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3' 220 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 221 clpname = cn_icerst_in 222 ELSE 223 clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in 224 ENDIF 225 CALL iom_init( crixios_context, fname = TRIM(cn_icerst_indir)//'/'//TRIM(clpname), ld_tmppatch = .TRUE. ) 226 ENDIF 188 227 189 228 ! test if v_i exists … … 193 232 IF( id0 > 0 ) THEN ! == case of a normal restart == ! 194 233 ! ! ------------------------------ ! 195 234 IF(lrxios) CALL iom_swap(crixios_context) 196 235 ! Time info 197 CALL iom_get( numrir, 'nn_fsbc', zfice )198 CALL iom_get( numrir, 'kt_ice' , ziter )236 CALL iom_get( numrir, 'nn_fsbc', zfice, ldxios = lrxios ) 237 CALL iom_get( numrir, 'kt_ice' , ziter, ldxios = lrxios ) 199 238 IF(lwp) WRITE(numout,*) ' read ice restart file at time step : ', ziter 200 239 IF(lwp) WRITE(numout,*) ' in any case we force it to nit000 - 1 : ', nit000 - 1 … … 211 250 212 251 ! --- mandatory fields --- ! 213 CALL iom_get( numrir, jpdom_autoglo, 'v_i' , v_i 214 CALL iom_get( numrir, jpdom_autoglo, 'v_s' , v_s 215 CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i 216 CALL iom_get( numrir, jpdom_autoglo, 'a_i' , a_i 217 CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su 218 CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice )219 CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice )252 CALL iom_get( numrir, jpdom_autoglo, 'v_i' , v_i, ldxios = lrxios ) 253 CALL iom_get( numrir, jpdom_autoglo, 'v_s' , v_s, ldxios = lrxios ) 254 CALL iom_get( numrir, jpdom_autoglo, 'sv_i' , sv_i, ldxios = lrxios ) 255 CALL iom_get( numrir, jpdom_autoglo, 'a_i' , a_i, ldxios = lrxios ) 256 CALL iom_get( numrir, jpdom_autoglo, 't_su' , t_su, ldxios = lrxios ) 257 CALL iom_get( numrir, jpdom_autoglo, 'u_ice', u_ice, ldxios = lrxios ) 258 CALL iom_get( numrir, jpdom_autoglo, 'v_ice', v_ice, ldxios = lrxios ) 220 259 ! Snow enthalpy 221 260 DO jk = 1, nlay_s 222 261 WRITE(zchar1,'(I2.2)') jk 223 262 znam = 'e_s'//'_l'//zchar1 224 CALL iom_get( numrir, jpdom_autoglo, znam , z3d )263 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) 225 264 e_s(:,:,jk,:) = z3d(:,:,:) 226 265 END DO … … 229 268 WRITE(zchar1,'(I2.2)') jk 230 269 znam = 'e_i'//'_l'//zchar1 231 CALL iom_get( numrir, jpdom_autoglo, znam , z3d )270 CALL iom_get( numrir, jpdom_autoglo, znam , z3d, ldxios = lrxios ) 232 271 e_i(:,:,jk,:) = z3d(:,:,:) 233 272 END DO … … 236 275 id1 = iom_varid( numrir, 'oa_i' , ldstop = .FALSE. ) 237 276 IF( id1 > 0 ) THEN ! fields exist 238 CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i )277 CALL iom_get( numrir, jpdom_autoglo, 'oa_i', oa_i, ldxios = lrxios ) 239 278 ELSE ! start from rest 240 279 IF(lwp) WRITE(numout,*) ' ==>> previous run without ice age output then set it to zero' … … 244 283 id2 = iom_varid( numrir, 'a_ip' , ldstop = .FALSE. ) 245 284 IF( id2 > 0 ) THEN ! fields exist 246 CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip )247 CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip )285 CALL iom_get( numrir, jpdom_autoglo, 'a_ip' , a_ip, ldxios = lrxios ) 286 CALL iom_get( numrir, jpdom_autoglo, 'v_ip' , v_ip, ldxios = lrxios ) 248 287 ELSE ! start from rest 249 288 IF(lwp) WRITE(numout,*) ' ==>> previous run without melt ponds output then set it to zero' … … 256 295 id4 = iom_varid( numrir, 't1_ice' , ldstop = .FALSE. ) 257 296 IF( id3 > 0 .AND. id4 > 0 ) THEN ! fields exist 258 CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice )259 CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice 297 CALL iom_get( numrir, jpdom_autoglo, 'cnd_ice', cnd_ice, ldxios = lrxios ) 298 CALL iom_get( numrir, jpdom_autoglo, 't1_ice' , t1_ice, ldxios = lrxios ) 260 299 ELSE ! start from rest 261 300 IF(lwp) WRITE(numout,*) ' ==>> previous run without conductivity output then set it to zero' … … 266 305 267 306 CALL iom_delay_rst( 'READ', 'ICE', numrir ) ! read only ice delayed global communication variables 268 307 IF(lrxios) CALL iom_swap(cxios_context) 269 308 ! ! ---------------------------------- ! 270 309 ELSE ! == case of a simplified restart == ! -
NEMO/branches/2020/dev_12905_xios_restart/src/ICE/iceupdate.F90
r12489 r12957 417 417 ! 418 418 IF( id1 > 0 ) THEN ! fields exist 419 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass ) 420 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b ) 419 IF(lrxios) CALL iom_swap(crixios_context) 420 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass' , snwice_mass, ldxios = lrxios ) 421 CALL iom_get( numrir, jpdom_autoglo, 'snwice_mass_b', snwice_mass_b, ldxios = lrxios ) 422 IF(lrxios) CALL iom_swap(cxios_context) 421 423 ELSE ! start from rest 422 424 IF(lwp) WRITE(numout,*) ' ==>> previous run without snow-ice mass output then set it' … … 435 437 iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 436 438 ! 437 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass ) 438 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b ) 439 IF( lwxios ) CALL iom_swap( cwixios_context ) 440 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass' , snwice_mass, ldxios = lwxios ) 441 CALL iom_rstput( iter, nitrst, numriw, 'snwice_mass_b', snwice_mass_b, ldxios = lwxios ) 442 IF( lwxios ) CALL iom_swap( cxios_context ) 439 443 ! 440 444 ENDIF -
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/DOM/daymod.F90
r12951 r12957 403 403 ! calendar control 404 404 IF( lwxios ) CALL iom_swap( cwxios_context ) 405 ENDIF406 405 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) , ldxios = lwxios ) ! time-step 407 406 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) , ldxios = lwxios ) ! date -
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/in_out_manager.F90
r12914 r12957 180 180 CHARACTER(lc) :: crxios_context !: context name used in xios to read restart 181 181 CHARACTER(lc) :: cwxios_context !: context name used in xios to write restart file 182 CHARACTER(lc) :: crixios_context !: context name used in xios to read SI3 restart 183 CHARACTER(lc) :: cwixios_context !: context name used in xios to write SI3 restart file 184 182 185 183 186 !! * Substitutions -
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/iom.F90
r12951 r12957 114 114 INTEGER :: irefyear, irefmonth, irefday 115 115 INTEGER :: ji 116 LOGICAL :: llrst_context ! is context related to restart 116 LOGICAL :: llrst_context ! is context related to restart 117 INTEGER :: inum 117 118 ! 118 119 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds … … 142 143 ALLOCATE( zt_bnds(2,jpk), zw_bnds(2,jpk) ) 143 144 ! 145 IF(lwp) write(numout, *) 'TEST IOM_INIT: ', TRIM(cdname),' File: ', TRIM(fname) 146 IF(lwp) CALL FLUSH(numout) 144 147 clname = cdname 145 148 IF( TRIM(Agrif_CFixed()) /= '0' ) clname = TRIM(Agrif_CFixed())//"_"//TRIM(cdname) 146 149 CALL xios_context_initialize(TRIM(clname), mpi_comm_oce) 147 150 CALL iom_swap( cdname ) 148 llrst_context = (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context)) 151 llrst_context = (TRIM(cdname) == TRIM(crxios_context)) .OR. (TRIM(cdname) == TRIM(cwxios_context)) 152 llrst_context = llrst_context .OR. (TRIM(cdname) == TRIM(crixios_context)) .OR. (TRIM(cdname) == TRIM(cwixios_context)) 149 153 150 154 ! Calendar type is now defined in xml file … … 260 264 ! 261 265 ! automatic definitions of some of the xml attributs 262 IF( TRIM(cdname) == TRIM(crxios_context) ) THEN 263 !set names of the fields in restart file IF using XIOS to read data 266 IF(lwp) write(numout, *) 'TEST IOM_INIT: ', TRIM(cdname), TRIM(cdname) == TRIM(crixios_context) 267 IF(lwp) CALL FLUSH(numout) 268 IF( TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(crixios_context)) THEN 269 IF(TRIM(cdname) == TRIM(crxios_context) ) THEN 270 inum = numror 271 ELSEIF(TRIM(cdname) == TRIM(crixios_context)) THEN 272 inum = numrir 273 ELSE 274 CALL ctl_stop( 'iom_init:', 'restart read with XIOS: Unknown restart context' ) 275 ENDIF 264 276 CALL iom_set_rst_context(.TRUE.) 265 !set which fields are tobe read from restart file266 CALL iom_set_rstr_active( )267 ELSE IF( TRIM(cdname) == TRIM(cwxios_context)) THEN277 !set which fields will be read from restart file 278 CALL iom_set_rstr_active(fname, inum) 279 ELSE IF( (TRIM(cdname) == TRIM(cwxios_context)) .OR. (TRIM(cdname) == TRIM(cwixios_context))) THEN 268 280 CALL iom_set_rstw_file(fname) 269 281 ELSE … … 298 310 CHARACTER(len=*), OPTIONAL, INTENT(IN) :: cdname 299 311 #if defined key_iomput 300 IF( TRIM(cdname) == TRIM(cwxios_context) ) THEN 312 LOGICAL :: llrstw 313 314 IF(lwp) write(numout, *) 'XIOS CLOSE definitions for: ', TRIM(cdname) 315 llrstw = .FALSE. 316 IF(PRESENT(cdname)) THEN 317 IF((TRIM(cdname) == TRIM(cwxios_context)) .OR. (TRIM(cdname) == TRIM(cwixios_context))) THEN 318 llrstw = .TRUE. 319 ENDIF 320 ENDIF 321 322 IF( llrstw ) THEN 301 323 !set names of the fields in restart file IF using XIOS to write data 302 324 CALL iom_set_rst_context(.FALSE.) … … 305 327 CALL xios_close_context_definition() 306 328 307 IF(.NOT. (TRIM(cdname) == TRIM(cwxios_context))) CALL xios_update_calendar( 0 )329 IF(.NOT. llrstw) CALL xios_update_calendar( 0 ) 308 330 309 331 #else … … 313 335 END SUBROUTINE iom_init_closedef 314 336 315 SUBROUTINE iom_set_rstr_active( )337 SUBROUTINE iom_set_rstr_active(cdfname, idnum) 316 338 !!--------------------------------------------------------------------- 317 339 !! *** SUBROUTINE iom_set_rstr_active *** … … 322 344 323 345 !sets enabled = .TRUE. for each field in restart file 324 CHARACTER(len=256) :: rst_file 346 CHARACTER(len=*), INTENT(IN) :: cdfname 347 INTEGER , INTENT(IN) :: idnum 325 348 #if defined key_iomput 326 349 INTEGER :: ndims, nvars, natts, unlimitedDimId, dimlen, xtype,mdims … … 329 352 TYPE(xios_filegroup) :: filegroup_hdl 330 353 INTEGER :: dimids(4), jv,i, idim 331 CHARACTER(LEN=lc) :: clpath332 354 CHARACTER(LEN=256) :: clinfo ! info character 333 355 INTEGER, ALLOCATABLE :: indimlens(:) … … 353 375 meta(10) = "numcat" 354 376 355 clpath = TRIM(cn_ocerst_indir) 356 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 357 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 358 rst_file = TRIM(clpath)//TRIM(cn_ocerst_in) 359 ELSE 360 rst_file = TRIM(clpath)//TRIM(Agrif_CFixed())//'_'//TRIM(cn_ocerst_in) 361 ENDIF 362 363 clinfo = ' iom_set_rstr_active, file: '//TRIM(rst_file) 364 377 clinfo = ' iom_set_rstr_active, file: '//TRIM(cdfname) 378 379 IF(lwp) write(numout, *) TRIM(clinfo) 380 IF(lwp) CALL FLUSH(numout) 365 381 !set name of the restart file and enable available fields 366 382 CALL xios_get_handle("file_definition", filegroup_hdl ) 367 383 CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart') 368 CALL xios_set_file_attr( "rrestart", name=trim( rst_file), type="one_file", &384 CALL xios_set_file_attr( "rrestart", name=trim(cdfname), type="one_file", & 369 385 par_access="collective", enabled=.TRUE., mode="read", & 370 386 output_freq=xios_timestep) 371 387 372 CALL iom_nf90_check( nf90_inquire( iom_file( numror)%nfid, ndims, nvars, natts ), clinfo )388 CALL iom_nf90_check( nf90_inquire( iom_file(idnum)%nfid, ndims, nvars, natts ), clinfo ) 373 389 ALLOCATE(indimlens(ndims), indimnames(ndims)) 374 CALL iom_nf90_check( nf90_inquire( iom_file( numror)%nfid, unlimitedDimId = unlimitedDimId ), clinfo )390 CALL iom_nf90_check( nf90_inquire( iom_file(idnum)%nfid, unlimitedDimId = unlimitedDimId ), clinfo ) 375 391 376 392 DO idim = 1, ndims 377 CALL iom_nf90_check( nf90_inquire_dimension( iom_file( numror)%nfid, idim, dimname, dimlen ), clinfo )393 CALL iom_nf90_check( nf90_inquire_dimension( iom_file(idnum)%nfid, idim, dimname, dimlen ), clinfo ) 378 394 indimlens(idim) = dimlen 379 395 indimnames(idim) = dimname … … 382 398 DO jv =1, nvars 383 399 lmeta = .FALSE. 384 CALL iom_nf90_check( nf90_inquire_variable( iom_file( numror)%nfid, jv, varname, xtype, ndims, dimids, natts ), clinfo )400 CALL iom_nf90_check( nf90_inquire_variable( iom_file(idnum)%nfid, jv, varname, xtype, ndims, dimids, natts ), clinfo ) 385 401 DO i = 1, NMETA 386 402 IF(TRIM(varname) == TRIM(meta(i))) THEN … … 390 406 IF(.NOT.lmeta) THEN 391 407 CALL xios_add_child(file_hdl, field_hdl, TRIM(varname)) 408 if(lwp) write(numout, *) 'ADD field: ', TRIM(varname) 409 IF(lwp) CALL FLUSH(numout) 392 410 mdims = ndims 393 411 … … 397 415 398 416 IF(mdims == 3) THEN 417 if(lwp) write(numout, *) '3D', indimlens(ndims) 418 IF(lwp) CALL FLUSH(numout) 419 399 420 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 400 421 domain_ref="grid_N", axis_ref=TRIM(iom_axis(indimlens(ndims))), & 401 422 prec = 8, operation = "instant") 402 423 ELSEIF(mdims == 2) THEN 424 if(lwp) write(numout, *) '2D' 425 IF(lwp) CALL FLUSH(numout) 426 403 427 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 404 428 domain_ref="grid_N", prec = 8, operation = "instant") 405 429 ELSEIF(mdims == 1) THEN 430 if(lwp) write(numout, *) '1D', indimlens(ndims) 431 IF(lwp) CALL FLUSH(numout) 432 406 433 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 407 434 axis_ref=TRIM(iom_axis(indimlens(ndims))), prec = 8, operation = "instant") 408 435 ELSEIF(mdims == 0) THEN 436 if(lwp) write(numout, *) '0D' 437 IF(lwp) CALL FLUSH(numout) 438 409 439 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(varname), & 410 440 scalar_ref = "grid_scalar", prec = 8, operation = "instant") 411 441 ELSE 412 WRITE(ctmp1,*) 'iom_set_rstr_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 413 CALL ctl_stop( 'iom_set_rstr_active:', ctmp1 ) 442 if(lwp) write(numout, *) 'WAHT?' 443 IF(lwp) CALL FLUSH(numout) 444 445 WRITE(ctmp1,*) 'iom_set_rstr_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 446 CALL ctl_stop( 'iom_set_rstr_active:', ctmp1 ) 414 447 ENDIF 415 448 ENDIF … … 434 467 !set name of the restart file and enable available fields 435 468 IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file 469 IF(lwp) CALL FLUSH(numout) 436 470 CALL xios_get_handle("file_definition", filegroup_hdl ) 437 471 CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') … … 1869 1903 !!---------------------------------------------------------------------- 1870 1904 clname = cdname 1905 IF(lwp) write(numout, *) 'Finalize: ', TRIM(cdname) 1871 1906 IF( TRIM(Agrif_CFixed()) .NE. '0' ) clname = TRIM(Agrif_CFixed())//"_"//clname 1872 1907 IF( xios_is_valid_context(clname) ) THEN -
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/IOM/restart.F90
r12950 r12957 190 190 !! the file has already been opened 191 191 !!---------------------------------------------------------------------- 192 LOGICAL :: llok 193 CHARACTER(lc) :: clpath ! full path to ocean output restart file 192 LOGICAL :: llok 193 CHARACTER(lc) :: clpath ! full path to ocean output restart file 194 CHARACTER(lc+2) :: clpname ! file name including agrif prefix 194 195 !!---------------------------------------------------------------------- 195 196 ! … … 209 210 ! restart) 210 211 IF(.NOT.lxios_set) lrxios = lrxios.AND.lxios_sini 212 211 213 IF( lrxios) THEN 212 crxios_context = ' nemo_rst'214 crxios_context = 'oce_rst' 213 215 IF( .NOT.lxios_set ) THEN 214 216 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS' 215 CALL iom_init( crxios_context, ld_tmppatch = .TRUE. ) 217 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 218 clpname = cn_ocerst_in 219 ELSE 220 clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in 221 ENDIF 222 CALL iom_init( crxios_context, fname = TRIM(clpath)//TRIM(clpname), ld_tmppatch = .TRUE. ) 216 223 lxios_set = .TRUE. 217 224 ENDIF 218 225 ENDIF 219 IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios) THEN 220 CALL iom_init( crxios_context, ld_tmppatch = .TRUE. ) 221 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF' 222 lxios_set = .TRUE. 223 ENDIF 226 224 227 ENDIF 225 228 -
NEMO/branches/2020/dev_12905_xios_restart/src/OCE/step.F90
r12950 r12957 122 122 CALL iom_init_closedef 123 123 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid 124 ELSEIF((kstp == nitrst) .AND. lwxios) THEN 124 ENDIF 125 IF((kstp == nitrst) .AND. lwxios) THEN 125 126 CALL iom_swap( cwxios_context ) 126 127 CALL iom_init_closedef(cwxios_context) 127 128 CALL iom_setkt( kstp - nit000 + 1, cwxios_context ) 128 CALL iom_swap( cwxios_context ) 129 ENDIF 129 ENDIF 130 #if defined key_si3 131 IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN 132 CALL iom_swap( cwixios_context ) 133 CALL iom_init_closedef(cwixios_context) 134 CALL iom_setkt( kstp - nit000 + 1, cwixios_context ) 135 ENDIF 136 #endif 130 137 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 131 138 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp … … 355 362 IF( kstp == nitend .OR. indic < 0 ) THEN 356 363 CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF 357 IF( lrxios ) CALL iom_context_finalize( crxios_context ) 364 IF( lrxios ) THEN 365 CALL iom_context_finalize( crxios_context ) 366 #if defined key_si3 367 CALL iom_context_finalize( crixios_context ) 368 #endif 369 ENDIF 358 370 IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 359 371 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.