Changeset 14018
- Timestamp:
- 2020-12-02T18:22:24+01:00 (4 years ago)
- Location:
- NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3
- Files:
-
- 56 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3
- Property svn:externals
-
old new 8 8 9 9 # SETTE 10 ^/utils/CI/sette@13 559sette10 ^/utils/CI/sette@13795 sette
-
- Property svn:externals
-
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/latex/NEMO/main/bibliography.bib
r12377 r14018 1906 1906 } 1907 1907 1908 @Article{ love_PRSLA1909, 1909 author = "A. E. H. Love", 1910 title = "The Yielding of the Earth to Disturbing Forces", 1911 journal = "Proc. R. Soc. Lond. A", 1912 year = "1909", 1913 volume = "82", 1914 pages = "73-88", 1915 doi = "10.1098/rspa.1909.0008" 1916 } 1917 1908 1918 @article{ losch_JGR08, 1909 1919 title = "Modeling ice shelf cavities in a z coordinate Ocean -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/latex/NEMO/subfiles/chap_DIA.tex
r12377 r14018 119 119 \subsection{XIOS: Reading and writing restart file} 120 120 121 XIOS may be used to read single file restart produced by \NEMO. Currently only the variables written to 122 file \forcode{numror} can be handled by XIOS. To activate restart reading using XIOS, set \np[=.true. ]{ln_xios_read}{ln\_xios\_read} 121 XIOS may be used to read single file restart produced by \NEMO. The variables written to 122 file \forcode{numror} (OCE), \forcode{numrir} (SI3), \forcode{numrtr} (TOP), \forcode{numrsr} (SED) can be handled by XIOS. 123 To activate restart reading using XIOS, set \np[=.true. ]{ln_xios_read}{ln\_xios\_read} 123 124 in \textit{namelist\_cfg}. This setting will be ignored when multiple restart files are present, and default \NEMO 124 125 functionality will be used for reading. There is no need to change iodef.xml file to use XIOS to read … … 142 143 have to be rebuild before continuing the run. This option aims to reduce number of restart files generated by \NEMO\ only, 143 144 and may be useful when there is a need to change number of processors used to run simulation. 144 145 If an additional variable must be written to a restart file, the following steps are needed:146 \begin{enumerate}147 \item Add variable name to a list of restart variables (in subroutine \rou{iom\_set\_rst\_vars,} \mdl{iom}) and148 define correct grid for the variable (\forcode{grid_N_3D} - 3D variable, \forcode{grid_N} - 2D variable, \forcode{grid_vector} -149 1D variable, \forcode{grid_scalar} - scalar),150 \item Add variable to the list of fields written by restart. This can be done either in subroutine151 \rou{iom\_set\_rstw\_core} (\mdl{iom}) or by calling \rou{iom\_set\_rstw\_active} (\mdl{iom}) with the name of a variable152 as an argument. This convention follows approach for writing restart using iom, where variables are153 written either by \rou{rst\_write} or by calling \rou{iom\_rstput} from individual routines.154 \end{enumerate}155 145 156 146 An older versions of XIOS do not support reading functionality. It's recommended to use at least XIOS2@1451. -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/latex/NEMO/subfiles/chap_DYN.tex
r11693 r14018 1245 1245 the atmospheric pressure is taken into account when computing the surface pressure gradient. 1246 1246 1247 (2) When \np[=.true.]{ln_tide_pot}{ln\_tide\_pot} and \np[=.true.]{ln_tide}{ln\_tide} (see \autoref{sec:SBC_ tide}),1247 (2) When \np[=.true.]{ln_tide_pot}{ln\_tide\_pot} and \np[=.true.]{ln_tide}{ln\_tide} (see \autoref{sec:SBC_TDE}), 1248 1248 the tidal potential is taken into account when computing the surface pressure gradient. 1249 1249 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/latex/NEMO/subfiles/chap_LBC.tex
r11693 r14018 16 16 Release & Author(s) & Modifications \\ 17 17 \hline 18 {\em next} & {\em Simon M{\" u}ller} & {\em Minor update of \autoref{subsec:LBC_bdy_tides}} \\[2mm] 18 19 {\em 4.0} & {\em ...} & {\em ...} \\ 19 20 {\em 3.6} & {\em ...} & {\em ...} \\ … … 665 666 666 667 Tidal forcing at open boundaries requires the activation of surface 667 tides (i.e., in \nam{_tide}{\_tide}, \np{ln_tide}{ln\_tide} needs to be set to 668 \forcode{.true.} and the required constituents need to be activated by 669 including their names in the \np{clname}{clname} array; see 670 \autoref{sec:SBC_tide}). Specific options related to the reading in of 668 tides (i.e., in \nam{_tide}{\_tide}, \np[=.true.]{ln_tide}{ln\_tide} with the active tidal 669 constituents listed in the \np{sn_tide_cnames}{sn\_tide\_cnames} array; see 670 \autoref{sec:SBC_TDE}). The specific options related to the reading in of 671 671 the complex harmonic amplitudes of elevation (SSH) and barotropic 672 velocity (u,v) atopen boundaries are defined through the673 \nam{bdy_tide}{bdy\_tide} namelist parameters.\ \672 velocity components (u,v) at the open boundaries are defined through the 673 \nam{bdy_tide}{bdy\_tide} namelist parameters.\par 674 674 675 675 The tidal harmonic data at open boundaries can be specified in two 676 676 different ways, either on a two-dimensional grid covering the entire 677 677 model domain or along open boundary segments; these two variants can 678 be selected by setting \np{ln_bdytide_2ddta }{ln\_bdytide\_2ddta } to \forcode{.true.} or 679 \forcode{.false.}, respectively. In either case, the real and 680 imaginary parts of SSH and the two barotropic velocity components for 681 each activated tidal constituent \textit{tcname} have to be provided 682 separately: when two-dimensional data is used, variables 683 \textit{tcname\_z1} and \textit{tcname\_z2} for real and imaginary SSH, 684 respectively, are expected in input file \np{filtide}{filtide} with suffix 685 \ifile{\_grid\_T}, variables \textit{tcname\_u1} and 686 \textit{tcname\_u2} for real and imaginary u, respectively, are 687 expected in input file \np{filtide}{filtide} with suffix \ifile{\_grid\_U}, and 688 \textit{tcname\_v1} and \textit{tcname\_v2} for real and imaginary v, 689 respectively, are expected in input file \np{filtide}{filtide} with suffix 690 \ifile{\_grid\_V}; when data along open boundary segments is used, 691 variables \textit{z1} and \textit{z2} (real and imaginary part of SSH) 692 are expected to be available from file \np{filtide}{filtide} with suffix 693 \ifile{tcname\_grid\_T}, variables \textit{u1} and \textit{u2} (real 694 and imaginary part of u) are expected to be available from file 695 \np{filtide}{filtide} with suffix \ifile{tcname\_grid\_U}, and variables 696 \textit{v1} and \textit{v2} (real and imaginary part of v) are 697 expected to be available from file \np{filtide}{filtide} with suffix 698 \ifile{tcname\_grid\_V}. If \np{ln_bdytide_conj}{ln\_bdytide\_conj} is set to 699 \forcode{.true.}, the data is expected to be in complex conjugate 700 form. 678 be selected by setting \np[=.true.]{ln_bdytide_2ddta}{ln\_bdytide\_2ddta} or 679 \np[=.false.]{ln_bdytide_2ddta}{ln\_bdytide\_2ddta}, respectively. In either 680 case, the real and imaginary parts of SSH, u, and v amplitudes associated with 681 each activated tidal constituent \texttt{<constituent>} have to be provided 682 separately as fields in input files with names based on 683 \np[=<input>]{filtide}{filtide}: when two-dimensional data is used, variables 684 \texttt{<constituent>\_z1} and \texttt{<constituent>\_z2} for the real and imaginary parts of 685 SSH, respectively, are expected to be available in file 686 \ifile{<input>\_grid\_T}, variables \texttt{<constituent>\_u1} and 687 \texttt{<constituent>\_u2} for the real and imaginary parts of u, respectively, in file 688 \ifile{<input>\_grid\_U}, and \texttt{<constituent>\_v1} and 689 \texttt{<constituent>\_v2} for the real and imaginary parts of v, respectively, in file 690 \ifile{<input>\_grid\_V}; when data along open boundary segments is used, 691 variables \texttt{z1} and \texttt{z2} (real and imaginary part of SSH) are 692 expected to be available in file \ifile{<input><constituent>\_grid\_T}, 693 variables \texttt{u1} and \texttt{u2} (real and imaginary part of u) in file 694 \ifile{<input><constituent>\_grid\_U}, and variables \texttt{v1} and \texttt{v2} 695 (real and imaginary part of v) in file 696 \ifile{<input><constituent>\_grid\_V}.\par 701 697 702 698 Note that the barotropic velocity components are assumed to be defined -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/latex/NEMO/subfiles/chap_SBC.tex
r13165 r14018 5 5 \begin{document} 6 6 7 \chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB )}7 \chapter{Surface Boundary Condition (SBC, SAS, ISF, ICB, TDE)} 8 8 \label{chap:SBC} 9 9 … … 18 18 Release & Author(s) & Modifications \\ 19 19 \hline 20 {\em next} & {\em Simon M{\" u}ller} & {\em Update of \autoref{sec:SBC_TDE}}\\[2mm] 20 21 {\em 4.0} & {\em ...} & {\em ...} \\ 21 22 {\em 3.6} & {\em ...} & {\em ...} \\ … … 1013 1014 1014 1015 %% ================================================================================================= 1015 \section [Surface tides (\textit{sbctide.F90})]{Surface tides (\protect\mdl{sbctide})}1016 \label{sec:SBC_ tide}1016 \section{Surface tides (TDE)} 1017 \label{sec:SBC_TDE} 1017 1018 1018 1019 \begin{listing} … … 1022 1023 \end{listing} 1023 1024 1024 The tidal forcing, generated by the gravity forces of the Earth-Moon and Earth-Sun sytems, 1025 is activated if \np{ln_tide}{ln\_tide} and \np{ln_tide_pot}{ln\_tide\_pot} are both set to \forcode{.true.} in \nam{_tide}{\_tide}. 1026 This translates as an additional barotropic force in the momentum \autoref{eq:MB_PE_dyn} such that: 1025 \subsection{Tidal constituents} 1026 Ocean model component TDE provides the common functionality for tidal forcing 1027 and tidal analysis in the model framework. This includes the computation of the gravitational 1028 surface forcing, as well as support for lateral forcing at open boundaries (see 1029 \autoref{subsec:LBC_bdy_tides}) and tidal harmonic analysis (see 1030 \autoref{subsec:DIA_diamlr} and \autoref{subsec:DIA_diadetide}). The module is 1031 activated with \np[=.true.]{ln_tide}{ln\_tide} in namelist 1032 \nam{_tide}{\_tide}. It provides the same 34 tidal constituents that are 1033 included in the 1034 \href{https://www.aviso.altimetry.fr/en/data/products/auxiliary-products/global-tide-fes.html}{FES2014 1035 ocean tide model}: Mf, Mm, Ssa, Mtm, Msf, Msqm, Sa, K1, O1, P1, Q1, J1, S1, 1036 M2, S2, N2, K2, nu2, mu2, 2N2, L2, T2, eps2, lam2, R2, M3, MKS2, MN4, MS4, M4, 1037 N4, S4, M6, and M8; see file \hf{tide} and \mdl{tide\_mod} for further 1038 information and references\footnote{As a legacy option \np{ln_tide_var} can be 1039 set to \forcode{0}, in which case the 19 tidal constituents (M2, N2, 2N2, S2, 1040 K2, K1, O1, Q1, P1, M4, Mf, Mm, Msqm, Mtm, S1, MU2, NU2, L2, and T2; see file 1041 \hf{tide}) and associated parameters that have been available in NEMO version 1042 4.0 and earlier are available}. Constituents to be included in the tidal forcing 1043 (surface and lateral boundaries) are selected by enumerating their respective 1044 names in namelist array \np{sn_tide_cnames}{sn\_tide\_cnames}.\par 1045 1046 \subsection{Surface tidal forcing} 1047 Surface tidal forcing can be represented in the model through an additional 1048 barotropic force in the momentum equation (\autoref{eq:MB_PE_dyn}) such that: 1027 1049 \[ 1028 % \label{eq:SBC_PE_dyn_tides} 1029 \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t}= ... 1030 +g\nabla (\Pi_{eq} + \Pi_{sal}) 1050 \frac{\partial {\mathrm {\mathbf U}}_h }{\partial t} = \ldots +g\nabla (\gamma 1051 \Pi_{eq} + \Pi_{sal}) 1031 1052 \] 1032 where $\Pi_{eq}$ stands for the equilibrium tidal forcing and 1033 $\Pi_{sal}$ is a self-attraction and loading term (SAL). 1034 1035 The equilibrium tidal forcing is expressed as a sum over a subset of 1036 constituents chosen from the set of available tidal constituents 1037 defined in file \hf{SBC/tide} (this comprises the tidal 1038 constituents \textit{M2, N2, 2N2, S2, K2, K1, O1, Q1, P1, M4, Mf, Mm, 1039 Msqm, Mtm, S1, MU2, NU2, L2}, and \textit{T2}). Individual 1040 constituents are selected by including their names in the array 1041 \np{clname}{clname} in \nam{_tide}{\_tide} (e.g., \np{clname}{clname}\forcode{(1)='M2', } 1042 \np{clname}{clname}\forcode{(2)='S2'} to select solely the tidal consituents \textit{M2} 1043 and \textit{S2}). Optionally, when \np{ln_tide_ramp}{ln\_tide\_ramp} is set to 1044 \forcode{.true.}, the equilibrium tidal forcing can be ramped up 1045 linearly from zero during the initial \np{rdttideramp}{rdttideramp} days of the 1046 model run. 1053 where $\gamma \Pi_{eq}$ stands for the equilibrium tidal forcing scaled by a spatially 1054 uniform tilt factor $\gamma$, and $\Pi_{sal}$ is an optional 1055 self-attraction and loading term (SAL). These additional terms are enabled when, 1056 in addition to \np[=.true.]{ln_tide}{ln\_tide}), 1057 \np[=.true.]{ln_tide_pot}{ln\_tide\_pot}.\par 1058 1059 The equilibrium tidal forcing is expressed as a sum over the subset of 1060 constituents listed in \np{sn_tide_cnames}{sn\_tide\_cnames} of 1061 \nam{_tide} (e.g., 1062 \begin{forlines} 1063 sn_tide_cnames(1) = 'M2' 1064 sn_tide_cnames(2) = 'K1' 1065 sn_tide_cnames(3) = 'S2' 1066 sn_tide_cnames(4) = 'O1' 1067 \end{forlines} 1068 to select the four tidal constituents of strongest equilibrium tidal 1069 potential). The tidal tilt factor $\gamma = 1 + k - h$ includes the 1070 Love numbers $k$ and $h$ \citep{love_prsla1909}; this factor is 1071 configurable using \np{rn_tide_gamma} (default value 0.7). Optionally, 1072 when \np[=.true.]{ln_tide_ramp}{ln\_tide\_ramp}, the equilibrium tidal 1073 forcing can be ramped up linearly from zero during the initial 1074 \np{rn_tide_ramp_dt}{rn\_tide\_ramp\_dt} days of the model run.\par 1047 1075 1048 1076 The SAL term should in principle be computed online as it depends on 1049 1077 the model tidal prediction itself (see \citet{arbic.garner.ea_DSR04} for a 1050 discussion about the practical implementation of this term). 1051 Nevertheless, the complex calculations involved would make this 1052 computationally too expensive. Here, two options are available: 1053 $\Pi_{sal}$ generated by an external model can be read in 1054 (\np[=.true.]{ln_read_load}{ln\_read\_load}), or a ``scalar approximation'' can be 1055 used (\np[=.true.]{ln_scal_load}{ln\_scal\_load}). In the latter case 1078 discussion about the practical implementation of this term). The complex 1079 calculations involved in such computations, however, are computationally very 1080 expensive. Here, two mutually exclusive simpler variants are available: 1081 amplitudes generated by an external model for oscillatory $\Pi_{sal}$ 1082 contributions from each of the selected tidal constituents can be read in 1083 (\np[=.true.]{ln_read_load}{ln\_read\_load}) from the file specified in 1084 \np{cn_tide_load}{cn\_tide\_load} (the variable names are comprised of the 1085 tidal-constituent name and suffixes \forcode{_z1} and \forcode{_z2} for the two 1086 orthogonal components, respectively); alternatively, a ``scalar approximation'' 1087 can be used (\np[=.true.]{ln_scal_load}{ln\_scal\_load}), where 1056 1088 \[ 1057 1089 \Pi_{sal} = \beta \eta, 1058 1090 \] 1059 where $\beta$ (\np{rn_scal_load}{rn\_scal\_load} with a default value of 0.094) is a 1060 spatially constant scalar, often chosen to minimize tidal prediction 1061 errors. Setting both \np{ln_read_load}{ln\_read\_load} and \np{ln_scal_load}{ln\_scal\_load} to 1062 \forcode{.false.} removes the SAL contribution. 1091 with a spatially uniform coefficient $\beta$, which can be configured 1092 via \np{rn_scal_load}{rn\_scal\_load} (default value 0.094) and is 1093 often tuned to minimize tidal prediction errors.\par 1094 1095 For diagnostic purposes, the forcing potential of the individual tidal 1096 constituents (incl. load ptential, if activated) and the total forcing 1097 potential (incl. load potential, if activated) can be made available 1098 as diagnostic output by setting 1099 \np[=.true.]{ln_tide_dia}{ln\_tide\_dia} (fields 1100 \forcode{tide_pot_<constituent>} and \forcode{tide_pot}).\par 1063 1101 1064 1102 %% ================================================================================================= -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/namelists/nam_tide
r10075 r14018 3 3 !----------------------------------------------------------------------- 4 4 ln_tide = .false. ! Activate tides 5 ln_tide_pot = .true. ! use tidal potential forcing 5 nn_tide_var = 1 ! Variant of tidal parameter set and tide-potential computation 6 ! ! (1: default; 0: compatibility with previous versions) 7 ln_tide_dia = .false. ! Enable tidal diagnostic output 8 ln_tide_pot = .false. ! use tidal potential forcing 9 rn_tide_gamma = 0.7 ! Tidal tilt factor 6 10 ln_scal_load = .false. ! Use scalar approximation for 7 11 rn_scal_load = 0.094 ! load potential 8 12 ln_read_load = .false. ! Or read load potential from file 9 13 cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential 10 ! 14 ! 11 15 ln_tide_ramp = .false. ! Use linear ramp for tides at startup 12 r dttideramp = 0.! ramp duration in days13 clname(1)= 'DUMMY' ! name of constituent - all tidal components must be set in namelist_cfg16 rn_tide_ramp_dt = 0. ! ramp duration in days 17 sn_tide_cnames(1) = 'DUMMY' ! name of constituent - all tidal components must be set in namelist_cfg 14 18 / -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/doc/namelists/nambdy_tide
r10075 r14018 4 4 filtide = 'bdydta/amm12_bdytide_' ! file name root of tidal forcing files 5 5 ln_bdytide_2ddta = .false. ! 6 ln_bdytide_conj = .false. !7 6 / -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/ICE/icedia.F90
r13286 r14018 261 261 ! Write in numriw (if iter == nitrst) 262 262 ! ------------------ 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 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 268 CALL iom_rstput( iter, nitrst, numriw, 'vol_loc_ini', vol_loc_ini ) 269 269 CALL iom_rstput( iter, nitrst, numriw, 'tem_loc_ini', tem_loc_ini ) -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/ICE/icedyn_adv_pra.F90
r13998 r14018 989 989 DO jk = 1, nlay_s 990 990 WRITE(zchar1,'(I2.2)') jk 991 znam = 'sxc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sxc0 (:,:,jk,:) = z3d(:,:,:) 992 znam = 'syc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; syc0 (:,:,jk,:) = z3d(:,:,:) 993 znam = 'sxxc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxxc0(:,:,jk,:) = z3d(:,:,:) 994 znam = 'syyc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; syyc0(:,:,jk,:) = z3d(:,:,:) 995 znam = 'sxyc0'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxyc0(:,:,jk,:) = z3d(:,:,:) 991 znam = 'sxc0'//'_l'//zchar1 992 CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sxc0 (:,:,jk,:) = z3d(:,:,:) 993 znam = 'syc0'//'_l'//zchar1 994 CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; syc0 (:,:,jk,:) = z3d(:,:,:) 995 znam = 'sxxc0'//'_l'//zchar1 996 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxxc0(:,:,jk,:) = z3d(:,:,:) 997 znam = 'syyc0'//'_l'//zchar1 998 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; syyc0(:,:,jk,:) = z3d(:,:,:) 999 znam = 'sxyc0'//'_l'//zchar1 1000 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxyc0(:,:,jk,:) = z3d(:,:,:) 996 1001 END DO 997 1002 ! ! ice layers heat content 998 1003 DO jk = 1, nlay_i 999 1004 WRITE(zchar1,'(I2.2)') jk 1000 znam = 'sxe'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sxe (:,:,jk,:) = z3d(:,:,:) 1001 znam = 'sye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sye (:,:,jk,:) = z3d(:,:,:) 1002 znam = 'sxxe'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxxe(:,:,jk,:) = z3d(:,:,:) 1003 znam = 'syye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; syye(:,:,jk,:) = z3d(:,:,:) 1004 znam = 'sxye'//'_l'//zchar1 ; CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxye(:,:,jk,:) = z3d(:,:,:) 1005 znam = 'sxe'//'_l'//zchar1 1006 CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sxe (:,:,jk,:) = z3d(:,:,:) 1007 znam = 'sye'//'_l'//zchar1 1008 CALL iom_get( numrir, jpdom_auto, znam , z3d, psgn = -1._wp ) ; sye (:,:,jk,:) = z3d(:,:,:) 1009 znam = 'sxxe'//'_l'//zchar1 1010 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxxe(:,:,jk,:) = z3d(:,:,:) 1011 znam = 'syye'//'_l'//zchar1 1012 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; syye(:,:,jk,:) = z3d(:,:,:) 1013 znam = 'sxye'//'_l'//zchar1 1014 CALL iom_get( numrir, jpdom_auto, znam , z3d ) ; sxye(:,:,jk,:) = z3d(:,:,:) 1005 1015 END DO 1006 1016 ! … … 1067 1077 ! 1068 1078 ! ! ice thickness 1069 CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice 1070 CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice 1071 CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice 1072 CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice 1073 CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice 1079 CALL iom_rstput( iter, nitrst, numriw, 'sxice' , sxice) 1080 CALL iom_rstput( iter, nitrst, numriw, 'syice' , syice) 1081 CALL iom_rstput( iter, nitrst, numriw, 'sxxice', sxxice) 1082 CALL iom_rstput( iter, nitrst, numriw, 'syyice', syyice) 1083 CALL iom_rstput( iter, nitrst, numriw, 'sxyice', sxyice) 1074 1084 ! ! snow thickness 1075 CALL iom_rstput( iter, nitrst, numriw, 'sxsn' , sxsn 1076 CALL iom_rstput( iter, nitrst, numriw, 'sysn' , sysn 1077 CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn 1078 CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn 1079 CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn 1085 CALL iom_rstput( iter, nitrst, numriw, 'sxsn' , sxsn ) 1086 CALL iom_rstput( iter, nitrst, numriw, 'sysn' , sysn ) 1087 CALL iom_rstput( iter, nitrst, numriw, 'sxxsn' , sxxsn ) 1088 CALL iom_rstput( iter, nitrst, numriw, 'syysn' , syysn ) 1089 CALL iom_rstput( iter, nitrst, numriw, 'sxysn' , sxysn ) 1080 1090 ! ! ice concentration 1081 CALL iom_rstput( iter, nitrst, numriw, 'sxa' , sxa 1082 CALL iom_rstput( iter, nitrst, numriw, 'sya' , sya 1083 CALL iom_rstput( iter, nitrst, numriw, 'sxxa' , sxxa 1084 CALL iom_rstput( iter, nitrst, numriw, 'syya' , syya 1085 CALL iom_rstput( iter, nitrst, numriw, 'sxya' , sxya 1091 CALL iom_rstput( iter, nitrst, numriw, 'sxa' , sxa ) 1092 CALL iom_rstput( iter, nitrst, numriw, 'sya' , sya ) 1093 CALL iom_rstput( iter, nitrst, numriw, 'sxxa' , sxxa ) 1094 CALL iom_rstput( iter, nitrst, numriw, 'syya' , syya ) 1095 CALL iom_rstput( iter, nitrst, numriw, 'sxya' , sxya ) 1086 1096 ! ! ice salinity 1087 CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal 1088 CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal 1089 CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal 1090 CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal 1091 CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal 1097 CALL iom_rstput( iter, nitrst, numriw, 'sxsal' , sxsal) 1098 CALL iom_rstput( iter, nitrst, numriw, 'sysal' , sysal) 1099 CALL iom_rstput( iter, nitrst, numriw, 'sxxsal', sxxsal) 1100 CALL iom_rstput( iter, nitrst, numriw, 'syysal', syysal) 1101 CALL iom_rstput( iter, nitrst, numriw, 'sxysal', sxysal) 1092 1102 ! ! ice age 1093 CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage 1094 CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage 1095 CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage 1096 CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage 1097 CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage 1103 CALL iom_rstput( iter, nitrst, numriw, 'sxage' , sxage) 1104 CALL iom_rstput( iter, nitrst, numriw, 'syage' , syage) 1105 CALL iom_rstput( iter, nitrst, numriw, 'sxxage', sxxage) 1106 CALL iom_rstput( iter, nitrst, numriw, 'syyage', syyage) 1107 CALL iom_rstput( iter, nitrst, numriw, 'sxyage', sxyage) 1098 1108 ! ! snow layers heat content 1099 1109 DO jk = 1, nlay_s 1100 1110 WRITE(zchar1,'(I2.2)') jk 1101 znam = 'sxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxc0 (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1102 znam = 'syc0'//'_l'//zchar1 ; z3d(:,:,:) = syc0 (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1103 znam = 'sxxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxxc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1104 znam = 'syyc0'//'_l'//zchar1 ; z3d(:,:,:) = syyc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1105 znam = 'sxyc0'//'_l'//zchar1 ; z3d(:,:,:) = sxyc0(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1111 znam = 'sxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxc0 (:,:,jk,:) 1112 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1113 znam = 'syc0'//'_l'//zchar1 ; z3d(:,:,:) = syc0 (:,:,jk,:) 1114 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1115 znam = 'sxxc0'//'_l'//zchar1 ; z3d(:,:,:) = sxxc0(:,:,jk,:) 1116 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1117 znam = 'syyc0'//'_l'//zchar1 ; z3d(:,:,:) = syyc0(:,:,jk,:) 1118 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1119 znam = 'sxyc0'//'_l'//zchar1 ; z3d(:,:,:) = sxyc0(:,:,jk,:) 1120 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1106 1121 END DO 1107 1122 ! ! ice layers heat content 1108 1123 DO jk = 1, nlay_i 1109 1124 WRITE(zchar1,'(I2.2)') jk 1110 znam = 'sxe'//'_l'//zchar1 ; z3d(:,:,:) = sxe (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1111 znam = 'sye'//'_l'//zchar1 ; z3d(:,:,:) = sye (:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1112 znam = 'sxxe'//'_l'//zchar1 ; z3d(:,:,:) = sxxe(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1113 znam = 'syye'//'_l'//zchar1 ; z3d(:,:,:) = syye(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1114 znam = 'sxye'//'_l'//zchar1 ; z3d(:,:,:) = sxye(:,:,jk,:) ; CALL iom_rstput( iter, nitrst, numriw, znam , z3d ) 1125 znam = 'sxe'//'_l'//zchar1 ; z3d(:,:,:) = sxe (:,:,jk,:) 1126 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1127 znam = 'sye'//'_l'//zchar1 ; z3d(:,:,:) = sye (:,:,jk,:) 1128 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1129 znam = 'sxxe'//'_l'//zchar1 ; z3d(:,:,:) = sxxe(:,:,jk,:) 1130 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1131 znam = 'syye'//'_l'//zchar1 ; z3d(:,:,:) = syye(:,:,jk,:) 1132 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1133 znam = 'sxye'//'_l'//zchar1 ; z3d(:,:,:) = sxye(:,:,jk,:) 1134 CALL iom_rstput( iter, nitrst, numriw, znam , z3d) 1115 1135 END DO 1116 1136 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/ICE/icedyn_rhg_evp.F90
r13998 r14018 1033 1033 iter = kt + nn_fsbc - 1 ! ice restarts are written at kt == nitrst - nn_fsbc + 1 1034 1034 ! 1035 CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i 1036 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i 1035 CALL iom_rstput( iter, nitrst, numriw, 'stress1_i' , stress1_i ) 1036 CALL iom_rstput( iter, nitrst, numriw, 'stress2_i' , stress2_i ) 1037 1037 CALL iom_rstput( iter, nitrst, numriw, 'stress12_i', stress12_i ) 1038 1038 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/ICE/icerst.F90
r13998 r14018 55 55 CHARACTER(len=50) :: clname ! ice output restart file name 56 56 CHARACTER(len=256) :: clpath ! full path to ice output restart file 57 CHARACTER(LEN=52) :: clpname ! ocean output restart file name including prefix for AGRIF 57 58 !!---------------------------------------------------------------------- 58 59 ! … … 84 85 ENDIF 85 86 ! 86 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 87 IF(.NOT.lwxios) THEN 88 CALL iom_open( TRIM(clpath)//TRIM(clname), numriw, ldwrt = .TRUE., kdlev = jpl, cdcomp = 'ICE' ) 89 ELSE 90 #if defined key_iomput 91 cw_icerst_cxt = "rstwi_"//TRIM(ADJUSTL(clkt)) 92 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 93 clpname = clname 94 ELSE 95 clpname = TRIM(Agrif_CFixed())//"_"//clname 96 ENDIF 97 numriw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 98 CALL iom_init( cw_icerst_cxt, kdid = numriw, ld_closedef = .FALSE. ) 99 CALL iom_swap( cxios_context ) 100 #else 101 clinfo = 'Can not use XIOS in rst_opn' 102 CALL ctl_stop(TRIM(clinfo)) 103 #endif 104 ENDIF 87 105 lrst_ice = .TRUE. 88 106 ENDIF … … 117 135 IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~' 118 136 ENDIF 119 137 120 138 ! Write in numriw (if iter == nitrst) 121 139 ! ------------------ … … 123 141 CALL iom_rstput( iter, nitrst, numriw, 'nn_fsbc', REAL( nn_fsbc, wp ) ) ! time-step 124 142 CALL iom_rstput( iter, nitrst, numriw, 'kt_ice' , REAL( iter , wp ) ) ! date 125 CALL iom_delay_rst( 'WRITE', 'ICE', numriw ) ! save only ice delayed global communication variables 143 144 IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'ICE', numriw ) ! save only ice delayed global communication variables 126 145 127 146 ! Prognostic variables … … 154 173 IF( ln_cpl ) THEN 155 174 CALL iom_rstput( iter, nitrst, numriw, 'cnd_ice', cnd_ice ) 156 CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice 175 CALL iom_rstput( iter, nitrst, numriw, 't1_ice' , t1_ice ) 157 176 ENDIF 158 177 ! … … 161 180 ! ------------------ 162 181 IF( iter == nitrst ) THEN 163 CALL iom_close( numriw ) 182 IF(.NOT.lwxios) THEN 183 CALL iom_close( numriw ) 184 ELSE 185 CALL iom_context_finalize( cw_icerst_cxt ) 186 iom_file(numriw)%nfid = 0 187 numriw = 0 188 ENDIF 164 189 lrst_ice = .FALSE. 165 190 ENDIF … … 181 206 CHARACTER(len=2) :: zchar, zchar1 182 207 REAL(wp) :: zfice, ziter 208 CHARACTER(lc) :: clpname 183 209 REAL(wp), DIMENSION(jpi,jpj,jpl) :: z3d ! 3D workspace 184 210 !!---------------------------------------------------------------------- … … 190 216 ENDIF 191 217 218 lxios_sini = .FALSE. 192 219 CALL iom_open ( TRIM(cn_icerst_indir)//'/'//cn_icerst_in, numrir ) 220 221 IF( lrxios) THEN 222 cr_icerst_cxt = 'si3_rst' 223 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SI3' 224 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 225 ! clpname = cn_icerst_in 226 ! ELSE 227 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_icerst_in 228 ! ENDIF 229 CALL iom_init( cr_icerst_cxt, kdid = numrir, ld_closedef = .TRUE. ) 230 ENDIF 193 231 194 232 ! test if v_i exists … … 198 236 IF( id0 > 0 ) THEN ! == case of a normal restart == ! 199 237 ! ! ------------------------------ ! 200 201 238 ! Time info 202 239 CALL iom_get( numrir, 'nn_fsbc', zfice ) … … 278 315 ENDIF 279 316 280 CALL iom_delay_rst( 'READ', 'ICE', numrir ) ! read only ice delayed global communication variables 281 317 IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'ICE', numrir ) ! read only ice delayed global communication variables 282 318 ! ! ---------------------------------- ! 283 319 ELSE ! == case of a simplified restart == ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/ICE/icestp.F90
r13998 r14018 291 291 tn_ice(:,:,:) = t_su(:,:,:) ! initialisation of surface temp for coupled simu 292 292 ! 293 IF( ln_rstart ) CALL iom_close( numrir ) ! close input ice restart file 293 IF( ln_rstart ) THEN 294 CALL iom_close( numrir ) ! close input ice restart file 295 IF(lrxios) CALL iom_context_finalize( cr_icerst_cxt ) 296 ENDIF 294 297 ! 295 298 END SUBROUTINE ice_init -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/C1D/step_c1d.F90
r13237 r14018 122 122 CALL dyn_atf ( kstp, Nbb, Nnn, Naa , uu, vv, e3t, e3u, e3v ) ! time filtering of "now" fields 123 123 IF(.NOT.ln_linssh)CALL ssh_atf ( kstp, Nbb, Nnn, Naa , ssh ) ! time filtering of "now" sea surface height 124 IF( kstp == nit000 .AND. ln_linssh) THEN 125 ssh(:,:,Naa) = ssh(:,:,Nnn) ! init ssh after in ln_linssh case 126 ENDIF 124 127 ! 125 128 ! Swap time levels -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DIA/diahsb.F90
r13286 r14018 267 267 IF(lwp) WRITE(numout,*) ' dia_hsb_rst : read hsb restart at it= ', kt,' date= ', ndastp 268 268 IF(lwp) WRITE(numout,*) 269 CALL iom_get( numror, 'frc_v', frc_v , ldxios = lrxios)270 CALL iom_get( numror, 'frc_t', frc_t , ldxios = lrxios)271 CALL iom_get( numror, 'frc_s', frc_s , ldxios = lrxios)269 CALL iom_get( numror, 'frc_v', frc_v ) 270 CALL iom_get( numror, 'frc_t', frc_t ) 271 CALL iom_get( numror, 'frc_s', frc_s ) 272 272 IF( ln_linssh ) THEN 273 CALL iom_get( numror, 'frc_wn_t', frc_wn_t , ldxios = lrxios)274 CALL iom_get( numror, 'frc_wn_s', frc_wn_s , ldxios = lrxios)273 CALL iom_get( numror, 'frc_wn_t', frc_wn_t ) 274 CALL iom_get( numror, 'frc_wn_s', frc_wn_s ) 275 275 ENDIF 276 CALL iom_get( numror, jpdom_auto, 'surf_ini' , surf_ini , ldxios = lrxios) ! ice sheet coupling277 CALL iom_get( numror, jpdom_auto, 'ssh_ini' , ssh_ini , ldxios = lrxios)278 CALL iom_get( numror, jpdom_auto, 'e3t_ini' , e3t_ini , ldxios = lrxios)279 CALL iom_get( numror, jpdom_auto, 'tmask_ini' , tmask_ini , ldxios = lrxios)280 CALL iom_get( numror, jpdom_auto, 'hc_loc_ini', hc_loc_ini , ldxios = lrxios)281 CALL iom_get( numror, jpdom_auto, 'sc_loc_ini', sc_loc_ini , ldxios = lrxios)276 CALL iom_get( numror, jpdom_auto, 'surf_ini' , surf_ini ) ! ice sheet coupling 277 CALL iom_get( numror, jpdom_auto, 'ssh_ini' , ssh_ini ) 278 CALL iom_get( numror, jpdom_auto, 'e3t_ini' , e3t_ini ) 279 CALL iom_get( numror, jpdom_auto, 'tmask_ini' , tmask_ini ) 280 CALL iom_get( numror, jpdom_auto, 'hc_loc_ini', hc_loc_ini ) 281 CALL iom_get( numror, jpdom_auto, 'sc_loc_ini', sc_loc_ini ) 282 282 IF( ln_linssh ) THEN 283 CALL iom_get( numror, jpdom_auto, 'ssh_hc_loc_ini', ssh_hc_loc_ini , ldxios = lrxios)284 CALL iom_get( numror, jpdom_auto, 'ssh_sc_loc_ini', ssh_sc_loc_ini , ldxios = lrxios)283 CALL iom_get( numror, jpdom_auto, 'ssh_hc_loc_ini', ssh_hc_loc_ini ) 284 CALL iom_get( numror, jpdom_auto, 'ssh_sc_loc_ini', ssh_sc_loc_ini ) 285 285 ENDIF 286 286 ELSE … … 323 323 IF(lwp) WRITE(numout,*) 324 324 ! 325 IF( lwxios ) CALL iom_swap( cwxios_context ) 326 CALL iom_rstput( kt, nitrst, numrow, 'frc_v', frc_v, ldxios = lwxios ) 327 CALL iom_rstput( kt, nitrst, numrow, 'frc_t', frc_t, ldxios = lwxios ) 328 CALL iom_rstput( kt, nitrst, numrow, 'frc_s', frc_s, ldxios = lwxios ) 325 CALL iom_rstput( kt, nitrst, numrow, 'frc_v', frc_v ) 326 CALL iom_rstput( kt, nitrst, numrow, 'frc_t', frc_t ) 327 CALL iom_rstput( kt, nitrst, numrow, 'frc_s', frc_s ) 329 328 IF( ln_linssh ) THEN 330 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t , ldxios = lwxios)331 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s , ldxios = lwxios)329 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t ) 330 CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s ) 332 331 ENDIF 333 CALL iom_rstput( kt, nitrst, numrow, 'surf_ini' , surf_ini , ldxios = lwxios) ! ice sheet coupling334 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini' , ssh_ini , ldxios = lwxios)335 CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini' , e3t_ini , ldxios = lwxios)336 CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini , ldxios = lwxios)337 CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini , ldxios = lwxios)338 CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini , ldxios = lwxios)332 CALL iom_rstput( kt, nitrst, numrow, 'surf_ini' , surf_ini ) ! ice sheet coupling 333 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ini' , ssh_ini ) 334 CALL iom_rstput( kt, nitrst, numrow, 'e3t_ini' , e3t_ini ) 335 CALL iom_rstput( kt, nitrst, numrow, 'tmask_ini' , tmask_ini ) 336 CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini ) 337 CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini ) 339 338 IF( ln_linssh ) THEN 340 CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini , ldxios = lwxios)341 CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini , ldxios = lwxios)339 CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini ) 340 CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini ) 342 341 ENDIF 343 IF( lwxios ) CALL iom_swap( cxios_context )344 342 ! 345 343 ENDIF … … 385 383 IF( .NOT. ln_diahsb ) RETURN 386 384 387 IF(lwxios) THEN388 ! define variables in restart file when writing with XIOS389 CALL iom_set_rstw_var_active('frc_v')390 CALL iom_set_rstw_var_active('frc_t')391 CALL iom_set_rstw_var_active('frc_s')392 CALL iom_set_rstw_var_active('surf_ini')393 CALL iom_set_rstw_var_active('ssh_ini')394 CALL iom_set_rstw_var_active('e3t_ini')395 CALL iom_set_rstw_var_active('hc_loc_ini')396 CALL iom_set_rstw_var_active('sc_loc_ini')397 IF( ln_linssh ) THEN398 CALL iom_set_rstw_var_active('ssh_hc_loc_ini')399 CALL iom_set_rstw_var_active('ssh_sc_loc_ini')400 CALL iom_set_rstw_var_active('frc_wn_t')401 CALL iom_set_rstw_var_active('frc_wn_s')402 ENDIF403 ENDIF404 385 ! ------------------- ! 405 386 ! 1 - Allocate memory ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DOM/daymod.F90
r13998 r14018 149 149 CALL day( nit000 ) 150 150 ! 151 IF( lwxios ) THEN152 ! define variables in restart file when writing with XIOS153 CALL iom_set_rstw_var_active('kt')154 CALL iom_set_rstw_var_active('ndastp')155 CALL iom_set_rstw_var_active('adatrj')156 CALL iom_set_rstw_var_active('ntime')157 ENDIF158 159 151 END SUBROUTINE day_init 160 152 … … 324 316 325 317 IF( TRIM(cdrw) == 'READ' ) THEN 326 327 318 IF( iom_varid( numror, 'kt', ldstop = .FALSE. ) > 0 ) THEN 328 319 ! Get Calendar informations 329 CALL iom_get( numror, 'kt', zkt , ldxios = lrxios) ! last time-step of previous run320 CALL iom_get( numror, 'kt', zkt ) ! last time-step of previous run 330 321 IF(lwp) THEN 331 322 WRITE(numout,*) ' *** Info read in restart : ' … … 346 337 IF ( nrstdt == 2 ) THEN 347 338 ! read the parameters corresponding to nit000 - 1 (last time step of previous run) 348 CALL iom_get( numror, 'ndastp', zndastp , ldxios = lrxios)339 CALL iom_get( numror, 'ndastp', zndastp ) 349 340 ndastp = NINT( zndastp ) 350 CALL iom_get( numror, 'adatrj', adatrj , ldxios = lrxios)351 CALL iom_get( numror, 'ntime' , ktime , ldxios = lrxios)341 CALL iom_get( numror, 'adatrj', adatrj ) 342 CALL iom_get( numror, 'ntime' , ktime ) 352 343 nn_time0 = NINT(ktime) 353 344 ! calculate start time in hours and minutes … … 410 401 ENDIF 411 402 ! calendar control 412 IF( lwxios ) CALL iom_swap( cwxios_context ) 413 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) , ldxios = lwxios ) ! time-step 414 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) , ldxios = lwxios ) ! date 415 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj , ldxios = lwxios ) ! number of elapsed days since 403 CALL iom_rstput( kt, nitrst, numrow, 'kt' , REAL( kt , wp) ) ! time-step 404 CALL iom_rstput( kt, nitrst, numrow, 'ndastp' , REAL( ndastp, wp) ) ! date 405 CALL iom_rstput( kt, nitrst, numrow, 'adatrj' , adatrj ) ! number of elapsed days since 416 406 ! ! the begining of the run [s] 417 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp), ldxios = lwxios ) ! time 418 IF( lwxios ) CALL iom_swap( cxios_context ) 407 CALL iom_rstput( kt, nitrst, numrow, 'ntime' , REAL( nn_time0, wp) ) ! time 419 408 ENDIF 420 409 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DOM/domain.F90
r13998 r14018 67 67 CONTAINS 68 68 69 SUBROUTINE dom_init( Kbb, Kmm, Kaa , cdstr)69 SUBROUTINE dom_init( Kbb, Kmm, Kaa ) 70 70 !!---------------------------------------------------------------------- 71 71 !! *** ROUTINE dom_init *** … … 83 83 !!---------------------------------------------------------------------- 84 84 INTEGER , INTENT(in) :: Kbb, Kmm, Kaa ! ocean time level indices 85 CHARACTER (len=*), INTENT(in) :: cdstr ! model: NEMO or SAS. Determines core restart variables86 85 ! 87 86 INTEGER :: ji, jj, jk, jt ! dummy loop indices … … 129 128 ! !== Reference coordinate system ==! 130 129 ! 131 CALL dom_glo ! global domain versus local domain132 CALL dom_nam ( cdstr )! read namelist ( namrun, namdom )130 CALL dom_glo ! global domain versus local domain 131 CALL dom_nam ! read namelist ( namrun, namdom ) 133 132 ! 134 133 CALL dom_hgr ! Horizontal mesh … … 175 174 ! 176 175 ! != ssh initialization 177 IF( cdstr /= 'SAS') THEN176 IF( .NOT.l_offline .AND. .NOT.l_SAS ) THEN 178 177 CALL ssh_init_rst( Kbb, Kmm, Kaa ) 178 ELSE 179 ssh(:,:,:) = 0._wp 179 180 ENDIF 180 181 ! … … 296 297 297 298 298 SUBROUTINE dom_nam ( cdstr )299 SUBROUTINE dom_nam 299 300 !!---------------------------------------------------------------------- 300 301 !! *** ROUTINE dom_nam *** … … 308 309 USE ioipsl 309 310 !! 310 CHARACTER (len=*), INTENT(in) :: cdstr ! model: NEMO or SAS. Determines core restart variables311 !312 311 INTEGER :: ios ! Local integer 313 312 REAL(wp):: zrdt … … 360 359 rDt = 2._wp * rn_Dt 361 360 r1_Dt = 1._wp / rDt 361 ! 362 IF( l_SAS .AND. .NOT.ln_linssh ) THEN 363 CALL ctl_warn( 'SAS requires linear ssh : force ln_linssh = T' ) 364 ln_linssh = .TRUE. 365 ENDIF 362 366 ! 363 367 #if defined key_qco … … 429 433 ! 430 434 ! !== Set parameters for restart reading using xIOS ==! 431 lwxios = .FALSE.432 435 ! 433 436 IF( TRIM(Agrif_CFixed()) == '0' ) THEN … … 436 439 nxioso = nn_wxios 437 440 ENDIF 438 !439 IF( lwxios ) THEN !* define names for restart write and set core output (restart.F90)440 CALL iom_set_rst_vars ( rst_wfields )441 CALL iom_set_rstw_core( cdstr )442 ENDIF443 !444 IF( cdstr == 'SAS' ) THEN !* reset namelist for SAS445 IF( lrxios ) THEN446 IF(lwp) WRITE(numout,*) 'Disable reading restart file using XIOS for SAS'447 lrxios = .FALSE.448 ENDIF449 ENDIF450 !451 441 ! !== Check consistency between ln_rstart and ln_1st_euler ==! (i.e. set l_1st_euler) 452 442 l_1st_euler = ln_1st_euler … … 459 449 ! 460 450 IF( iom_varid( numror, 'rdt', ldstop = .FALSE. ) > 0 ) THEN !- Check time-step consistency and force Euler restart if changed 461 CALL iom_get( numror, 'rdt', zrdt , ldxios = lrxios)451 CALL iom_get( numror, 'rdt', zrdt ) 462 452 IF( zrdt /= rn_Dt ) THEN 463 453 IF(lwp) WRITE( numout,*) … … 469 459 ENDIF 470 460 ! 471 IF( iom_varid( numror, 'sshb', ldstop = .FALSE. ) <= 0 ) THEN !- Check absence of one of the Kbb field (here sshb)472 ! ! (any Kbb field is missing ==> all Kbb fields are missing)461 IF( .NOT.l_SAS .AND. iom_varid( numror, 'sshb', ldstop = .FALSE. ) <= 0 ) THEN !- Check absence of one of the Kbb field (here sshb) 462 ! ! (any Kbb field is missing ==> all Kbb fields are missing) 473 463 IF( .NOT.l_1st_euler ) THEN 474 464 CALL ctl_warn('dom_nam : ssh at Kbb not found in restart files ', & … … 484 474 l_1st_euler = .TRUE. 485 475 ENDIF 486 487 476 ! 488 477 ! !== control of output frequency ==! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DOM/domqco.F90
r13874 r14018 95 95 r3v(:,:,Kaa) = r3v(:,:,Kmm) 96 96 #endif 97 !98 IF(lwxios) THEN ! define variables in restart file when writing with XIOS99 CALL iom_set_rstw_var_active('sshb')100 CALL iom_set_rstw_var_active('sshn')101 ENDIF102 97 ! 103 98 END SUBROUTINE dom_qco_init -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DOM/domvvl.F90
r13998 r14018 282 282 ENDIF 283 283 ! 284 IF(lwxios) THEN285 ! define variables in restart file when writing with XIOS286 CALL iom_set_rstw_var_active('e3t_b')287 CALL iom_set_rstw_var_active('e3t_n')288 ! ! ----------------------- !289 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases !290 ! ! ----------------------- !291 CALL iom_set_rstw_var_active('tilde_e3t_b')292 CALL iom_set_rstw_var_active('tilde_e3t_n')293 END IF294 ! ! -------------!295 IF( ln_vvl_ztilde ) THEN ! z_tilde case !296 ! ! ------------ !297 CALL iom_set_rstw_var_active('hdiv_lf')298 ENDIF299 !300 ENDIF301 !302 284 END SUBROUTINE dom_vvl_zgr 303 285 … … 825 807 ! !* scale factors 826 808 IF(lwp) WRITE(numout,*) ' Kmm scale factor read in the restart file' 827 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) , ldxios = lrxios)809 CALL iom_get( numror, jpdom_auto, 'e3t_n', e3t(:,:,:,Kmm) ) 828 810 WHERE ( tmask(:,:,:) == 0.0_wp ) 829 811 e3t(:,:,:,Kmm) = e3t_0(:,:,:) … … 834 816 ELSE ! leap frog 835 817 IF(lwp) WRITE(numout,*) ' Kbb scale factor read in the restart file' 836 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) , ldxios = lrxios)818 CALL iom_get( numror, jpdom_auto, 'e3t_b', e3t(:,:,:,Kbb) ) 837 819 WHERE ( tmask(:,:,:) == 0.0_wp ) 838 820 e3t(:,:,:,Kbb) = e3t_0(:,:,:) … … 851 833 IF( id4 > 0 ) THEN !* scale factor increments 852 834 IF(lwp) WRITE(numout,*) ' Kmm scale factor increments read in the restart file' 853 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) , ldxios = lrxios)835 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_n', tilde_e3t_n(:,:,:) ) 854 836 IF( l_1st_euler ) THEN ! euler 855 837 IF(lwp) WRITE(numout,*) ' Euler first time step : tilde_e3t(Kbb) = tilde_e3t(Kmm)' … … 857 839 ELSE ! leap frog 858 840 IF(lwp) WRITE(numout,*) ' Kbb scale factor increments read in the restart file' 859 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) , ldxios = lrxios)841 CALL iom_get( numror, jpdom_auto, 'tilde_e3t_b', tilde_e3t_b(:,:,:) ) 860 842 ENDIF 861 843 ELSE … … 867 849 ! ! ------------ ! 868 850 IF( id5 > 0 ) THEN ! required array exists 869 CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) , ldxios = lrxios)851 CALL iom_get( numror, jpdom_auto, 'hdiv_lf', hdiv_lf(:,:,:) ) 870 852 ELSE ! array is missing 871 853 hdiv_lf(:,:,:) = 0.0_wp … … 892 874 ! 893 875 IF(lwp) WRITE(numout,*) '---- dom_vvl_rst ----' 894 IF( lwxios ) CALL iom_swap( cwxios_context )895 876 ! ! --------- ! 896 877 ! ! all cases ! 897 878 ! ! --------- ! 898 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) , ldxios = lwxios)899 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) , ldxios = lwxios)879 CALL iom_rstput( kt, nitrst, numrow, 'e3t_b', e3t(:,:,:,Kbb) ) 880 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n', e3t(:,:,:,Kmm) ) 900 881 ! ! ----------------------- ! 901 882 IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN ! z_tilde and layer cases ! 902 883 ! ! ----------------------- ! 903 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:) , ldxios = lwxios)904 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:) , ldxios = lwxios)884 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_b', tilde_e3t_b(:,:,:)) 885 CALL iom_rstput( kt, nitrst, numrow, 'tilde_e3t_n', tilde_e3t_n(:,:,:)) 905 886 END IF 906 887 ! ! -------------! 907 888 IF( ln_vvl_ztilde ) THEN ! z_tilde case ! 908 889 ! ! ------------ ! 909 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:) , ldxios = lwxios)890 CALL iom_rstput( kt, nitrst, numrow, 'hdiv_lf', hdiv_lf(:,:,:)) 910 891 ENDIF 911 892 ! 912 IF( lwxios ) CALL iom_swap( cxios_context )913 893 ENDIF 914 894 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DYN/dynspg_ts.F90
r13998 r14018 933 933 ! ! --------------- 934 934 IF( ln_rstart .AND. ln_bt_fw .AND. .NOT.l_1st_euler ) THEN !* Read the restart file 935 CALL iom_get( numror, jpdom_auto, 'ub2_b' , ub2_b (:,:), cd_type = 'U', psgn = -1._wp , ldxios = lrxios)936 CALL iom_get( numror, jpdom_auto, 'vb2_b' , vb2_b (:,:), cd_type = 'V', psgn = -1._wp , ldxios = lrxios)937 CALL iom_get( numror, jpdom_auto, 'un_bf' , un_bf (:,:), cd_type = 'U', psgn = -1._wp , ldxios = lrxios)938 CALL iom_get( numror, jpdom_auto, 'vn_bf' , vn_bf (:,:), cd_type = 'V', psgn = -1._wp , ldxios = lrxios)935 CALL iom_get( numror, jpdom_auto, 'ub2_b' , ub2_b (:,:), cd_type = 'U', psgn = -1._wp ) 936 CALL iom_get( numror, jpdom_auto, 'vb2_b' , vb2_b (:,:), cd_type = 'V', psgn = -1._wp ) 937 CALL iom_get( numror, jpdom_auto, 'un_bf' , un_bf (:,:), cd_type = 'U', psgn = -1._wp ) 938 CALL iom_get( numror, jpdom_auto, 'vn_bf' , vn_bf (:,:), cd_type = 'V', psgn = -1._wp ) 939 939 IF( .NOT.ln_bt_av ) THEN 940 CALL iom_get( numror, jpdom_auto, 'sshbb_e' , sshbb_e(:,:), cd_type = 'T', psgn = 1._wp , ldxios = lrxios)941 CALL iom_get( numror, jpdom_auto, 'ubb_e' , ubb_e(:,:), cd_type = 'U', psgn = -1._wp , ldxios = lrxios)942 CALL iom_get( numror, jpdom_auto, 'vbb_e' , vbb_e(:,:), cd_type = 'V', psgn = -1._wp , ldxios = lrxios)943 CALL iom_get( numror, jpdom_auto, 'sshb_e' , sshb_e(:,:), cd_type = 'T', psgn = 1._wp , ldxios = lrxios)944 CALL iom_get( numror, jpdom_auto, 'ub_e' , ub_e(:,:), cd_type = 'U', psgn = -1._wp , ldxios = lrxios)945 CALL iom_get( numror, jpdom_auto, 'vb_e' , vb_e(:,:), cd_type = 'V', psgn = -1._wp , ldxios = lrxios)940 CALL iom_get( numror, jpdom_auto, 'sshbb_e' , sshbb_e(:,:), cd_type = 'T', psgn = 1._wp ) 941 CALL iom_get( numror, jpdom_auto, 'ubb_e' , ubb_e(:,:), cd_type = 'U', psgn = -1._wp ) 942 CALL iom_get( numror, jpdom_auto, 'vbb_e' , vbb_e(:,:), cd_type = 'V', psgn = -1._wp ) 943 CALL iom_get( numror, jpdom_auto, 'sshb_e' , sshb_e(:,:), cd_type = 'T', psgn = 1._wp ) 944 CALL iom_get( numror, jpdom_auto, 'ub_e' , ub_e(:,:), cd_type = 'U', psgn = -1._wp ) 945 CALL iom_get( numror, jpdom_auto, 'vb_e' , vb_e(:,:), cd_type = 'V', psgn = -1._wp ) 946 946 ENDIF 947 947 #if defined key_agrif 948 948 ! Read time integrated fluxes 949 949 IF ( .NOT.Agrif_Root() ) THEN 950 CALL iom_get( numror, jpdom_auto, 'ub2_i_b' , ub2_i_b(:,:), cd_type = 'U', psgn = -1._wp , ldxios = lrxios)951 CALL iom_get( numror, jpdom_auto, 'vb2_i_b' , vb2_i_b(:,:), cd_type = 'V', psgn = -1._wp , ldxios = lrxios)950 CALL iom_get( numror, jpdom_auto, 'ub2_i_b' , ub2_i_b(:,:), cd_type = 'U', psgn = -1._wp ) 951 CALL iom_get( numror, jpdom_auto, 'vb2_i_b' , vb2_i_b(:,:), cd_type = 'V', psgn = -1._wp ) 952 952 ELSE 953 953 ub2_i_b(:,:) = 0._wp ; vb2_i_b(:,:) = 0._wp ! used in the 1st update of agrif … … 968 968 ! ! ------------------- 969 969 IF(lwp) WRITE(numout,*) '---- ts_rst ----' 970 IF( lwxios ) CALL iom_swap( cwxios_context ) 971 CALL iom_rstput( kt, nitrst, numrow, 'ub2_b' , ub2_b (:,:), ldxios = lwxios ) 972 CALL iom_rstput( kt, nitrst, numrow, 'vb2_b' , vb2_b (:,:), ldxios = lwxios ) 973 CALL iom_rstput( kt, nitrst, numrow, 'un_bf' , un_bf (:,:), ldxios = lwxios ) 974 CALL iom_rstput( kt, nitrst, numrow, 'vn_bf' , vn_bf (:,:), ldxios = lwxios ) 970 CALL iom_rstput( kt, nitrst, numrow, 'ub2_b' , ub2_b (:,:) ) 971 CALL iom_rstput( kt, nitrst, numrow, 'vb2_b' , vb2_b (:,:) ) 972 CALL iom_rstput( kt, nitrst, numrow, 'un_bf' , un_bf (:,:) ) 973 CALL iom_rstput( kt, nitrst, numrow, 'vn_bf' , vn_bf (:,:) ) 975 974 ! 976 975 IF (.NOT.ln_bt_av) THEN 977 CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e' , sshbb_e(:,:) , ldxios = lwxios)978 CALL iom_rstput( kt, nitrst, numrow, 'ubb_e' , ubb_e(:,:) , ldxios = lwxios)979 CALL iom_rstput( kt, nitrst, numrow, 'vbb_e' , vbb_e(:,:) , ldxios = lwxios)980 CALL iom_rstput( kt, nitrst, numrow, 'sshb_e' , sshb_e(:,:) , ldxios = lwxios)981 CALL iom_rstput( kt, nitrst, numrow, 'ub_e' , ub_e(:,:) , ldxios = lwxios)982 CALL iom_rstput( kt, nitrst, numrow, 'vb_e' , vb_e(:,:) , ldxios = lwxios)976 CALL iom_rstput( kt, nitrst, numrow, 'sshbb_e' , sshbb_e(:,:) ) 977 CALL iom_rstput( kt, nitrst, numrow, 'ubb_e' , ubb_e(:,:) ) 978 CALL iom_rstput( kt, nitrst, numrow, 'vbb_e' , vbb_e(:,:) ) 979 CALL iom_rstput( kt, nitrst, numrow, 'sshb_e' , sshb_e(:,:) ) 980 CALL iom_rstput( kt, nitrst, numrow, 'ub_e' , ub_e(:,:) ) 981 CALL iom_rstput( kt, nitrst, numrow, 'vb_e' , vb_e(:,:) ) 983 982 ENDIF 984 983 #if defined key_agrif 985 984 ! Save time integrated fluxes 986 985 IF ( .NOT.Agrif_Root() ) THEN 987 CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b' , ub2_i_b(:,:) , ldxios = lwxios)988 CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b' , vb2_i_b(:,:) , ldxios = lwxios)986 CALL iom_rstput( kt, nitrst, numrow, 'ub2_i_b' , ub2_i_b(:,:) ) 987 CALL iom_rstput( kt, nitrst, numrow, 'vb2_i_b' , vb2_i_b(:,:) ) 989 988 ENDIF 990 989 #endif 991 IF( lwxios ) CALL iom_swap( cxios_context )992 990 ENDIF 993 991 ! … … 1081 1079 ! ! read restart when needed 1082 1080 CALL ts_rst( nit000, 'READ' ) 1083 !1084 IF( lwxios ) THEN1085 ! define variables in restart file when writing with XIOS1086 CALL iom_set_rstw_var_active('ub2_b')1087 CALL iom_set_rstw_var_active('vb2_b')1088 CALL iom_set_rstw_var_active('un_bf')1089 CALL iom_set_rstw_var_active('vn_bf')1090 !1091 IF (.NOT.ln_bt_av) THEN1092 CALL iom_set_rstw_var_active('sshbb_e')1093 CALL iom_set_rstw_var_active('ubb_e')1094 CALL iom_set_rstw_var_active('vbb_e')1095 CALL iom_set_rstw_var_active('sshb_e')1096 CALL iom_set_rstw_var_active('ub_e')1097 CALL iom_set_rstw_var_active('vb_e')1098 ENDIF1099 #if defined key_agrif1100 ! Save time integrated fluxes1101 IF ( .NOT.Agrif_Root() ) THEN1102 CALL iom_set_rstw_var_active('ub2_i_b')1103 CALL iom_set_rstw_var_active('vb2_i_b')1104 ENDIF1105 #endif1106 ENDIF1107 1081 ! 1108 1082 END SUBROUTINE dyn_spg_ts_init -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DYN/sshwzv.F90
r13998 r14018 473 473 IF(lwp) WRITE(numout,*) 474 474 IF(lwp) WRITE(numout,*) ' Kmm sea surface height read in the restart file' 475 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) , ldxios = lrxios)475 CALL iom_get( numror, jpdom_auto, 'sshn' , ssh(:,:,Kmm) ) 476 476 ! 477 477 IF( l_1st_euler ) THEN !* Euler at first time-step … … 483 483 IF(lwp) WRITE(numout,*) 484 484 IF(lwp) WRITE(numout,*) ' Kbb sea surface height read in the restart file' 485 CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) , ldxios = lrxios)485 CALL iom_get( numror, jpdom_auto, 'sshb', ssh(:,:,Kbb) ) 486 486 ENDIF 487 487 ! !============================! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/IOM/in_out_manager.F90
r13286 r14018 89 89 LOGICAL :: lrst_abl !: logical to control the abl restart write 90 90 INTEGER :: numror = 0 !: logical unit for ocean restart (read). Init to 0 is needed for SAS (in daymod.F90) 91 INTEGER :: numrir !: logical unit for ice restart (read) 92 INTEGER :: numrar !: logical unit for abl restart (read) 93 INTEGER :: numrow !: logical unit for ocean restart (write) 94 INTEGER :: numriw !: logical unit for ice restart (write) 95 INTEGER :: numraw !: logical unit for abl restart (write) 91 INTEGER :: numrir = 0 !: logical unit for ice restart (read) 92 INTEGER :: numrar = 0 !: logical unit for abl restart (read) 93 INTEGER :: numrow = 0 !: logical unit for ocean restart (write) 94 INTEGER :: numriw = 0 !: logical unit for ice restart (write) 95 INTEGER :: numraw = 0 !: logical unit for abl restart (write) 96 INTEGER :: numrtr = 0 !: trc restart (read ) 97 INTEGER :: numrtw = 0 !: trc restart (write ) 98 INTEGER :: numrsr = 0 !: logical unit for sed restart (read) 99 INTEGER :: numrsw = 0 !: logical unit for sed restart (write) 100 96 101 INTEGER :: nrst_lst !: number of restart to output next 97 102 … … 165 170 LOGICAL :: lwp = .FALSE. !: boolean : true on the 1st processor only .OR. sn_cfctl%l_oceout=T 166 171 LOGICAL :: lsp_area = .TRUE. !: to make a control print over a specific area 167 CHARACTER(lc) :: cxios_context !: context name used in xios 168 CHARACTER(lc) :: crxios_context !: context name used in xios to read restart 169 CHARACTER(lc) :: cwxios_context !: context name used in xios to write restart file 172 CHARACTER(LEN=lc) :: cxios_context !: context name used in xios 173 CHARACTER(LEN=lc) :: cr_ocerst_cxt !: context name used in xios to read OCE restart 174 CHARACTER(LEN=lc) :: cw_ocerst_cxt !: context name used in xios to write OCE restart file 175 CHARACTER(LEN=lc) :: cr_icerst_cxt !: context name used in xios to read SI3 restart 176 CHARACTER(LEN=lc) :: cw_icerst_cxt !: context name used in xios to write SI3 restart file 177 CHARACTER(LEN=lc) :: cr_toprst_cxt !: context name used in xios to read TOP restart 178 CHARACTER(LEN=lc) :: cw_toprst_cxt !: context name used in xios to write TOP restart file 179 CHARACTER(LEN=lc) :: cr_sedrst_cxt !: context name used in xios to read SEDIMENT restart 180 CHARACTER(LEN=lc) :: cw_sedrst_cxt !: context name used in xios to write SEDIMENT restart file 181 182 183 170 184 171 185 !! * Substitutions -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/IOM/iom.F90
r13998 r14018 46 46 USE lib_fortran 47 47 USE diu_bulk, ONLY : ln_diurnal_only, ln_diurnal 48 USE iom_nf90 49 USE netcdf 48 50 49 51 IMPLICIT NONE … … 58 60 PUBLIC iom_chkatt, iom_getatt, iom_putatt, iom_getszuld, iom_rstput, iom_delay_rst, iom_put 59 61 PUBLIC iom_use, iom_context_finalize, iom_update_file_name, iom_miss_val 62 PUBLIC iom_xios_setid 60 63 61 64 PRIVATE iom_rp0d_sp, iom_rp1d_sp, iom_rp2d_sp, iom_rp3d_sp … … 69 72 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 70 73 PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_sdate 71 PRIVATE iom_set_rst_context, iom_set_ rstw_active, iom_set_rstr_active74 PRIVATE iom_set_rst_context, iom_set_vars_active 72 75 # endif 73 PUBLIC iom_set_rstw_var_active, iom_set_rstw_core, iom_set_rst_vars 76 PRIVATE set_xios_context 77 PRIVATE iom_set_rstw_active 74 78 75 79 INTERFACE iom_get … … 101 105 CONTAINS 102 106 103 SUBROUTINE iom_init( cdname, fname, ld_closedef )107 SUBROUTINE iom_init( cdname, kdid, ld_closedef ) 104 108 !!---------------------------------------------------------------------- 105 109 !! *** ROUTINE *** … … 109 113 !!---------------------------------------------------------------------- 110 114 CHARACTER(len=*), INTENT(in) :: cdname 111 CHARACTER(len=*), OPTIONAL, INTENT(in) :: fname115 INTEGER , OPTIONAL, INTENT(in) :: kdid 112 116 LOGICAL , OPTIONAL, INTENT(in) :: ld_closedef 113 117 #if defined key_iomput … … 118 122 INTEGER :: irefyear, irefmonth, irefday 119 123 INTEGER :: ji 120 LOGICAL :: llrst_context ! is context related to restart 124 LOGICAL :: llrst_context ! is context related to restart 125 LOGICAL :: llrstr, llrstw 126 INTEGER :: inum 121 127 ! 122 128 REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zt_bnds, zw_bnds 123 129 REAL(wp), DIMENSION(2,jpkam1) :: za_bnds ! ABL vertical boundaries 124 LOGICAL :: ll_closedef = .TRUE.130 LOGICAL :: ll_closedef 125 131 LOGICAL :: ll_exist 126 132 !!---------------------------------------------------------------------- 127 133 ! 134 ll_closedef = .TRUE. 128 135 IF ( PRESENT(ld_closedef) ) ll_closedef = ld_closedef 129 136 ! … … 134 141 CALL xios_context_initialize(TRIM(clname), mpi_comm_oce) 135 142 CALL iom_swap( cdname ) 136 llrst_context = (TRIM(cdname) == TRIM(crxios_context) .OR. TRIM(cdname) == TRIM(cwxios_context)) 143 144 llrstr = (cdname == cr_ocerst_cxt) .OR. (cdname == cr_icerst_cxt) 145 llrstr = llrstr .OR. (cdname == cr_toprst_cxt) 146 llrstr = llrstr .OR. (cdname == cr_sedrst_cxt) 147 148 llrstw = (cdname == cw_ocerst_cxt) .OR. (cdname == cw_icerst_cxt) 149 llrstw = llrstw .OR. (cdname == cw_toprst_cxt) 150 llrstw = llrstw .OR. (cdname == cw_sedrst_cxt) 151 152 llrst_context = llrstr .OR. llrstw 137 153 138 154 ! Calendar type is now defined in xml file … … 153 169 IF(.NOT.llrst_context) CALL set_scalar 154 170 ! 155 IF( TRIM(cdname) == TRIM(cxios_context)) THEN171 IF( cdname == cxios_context ) THEN 156 172 CALL set_grid( "T", glamt, gphit, .FALSE., .FALSE. ) 157 173 CALL set_grid( "U", glamu, gphiu, .FALSE., .FALSE. ) … … 200 216 ! vertical grid definition 201 217 IF(.NOT.llrst_context) THEN 202 203 204 205 218 CALL iom_set_axis_attr( "deptht", paxis = gdept_1d ) 219 CALL iom_set_axis_attr( "depthu", paxis = gdept_1d ) 220 CALL iom_set_axis_attr( "depthv", paxis = gdept_1d ) 221 CALL iom_set_axis_attr( "depthw", paxis = gdepw_1d ) 206 222 CALL iom_set_axis_attr( "depthf", paxis = gdept_1d ) 207 223 208 224 ! ABL 209 210 211 212 213 214 215 225 IF( .NOT. ALLOCATED(ght_abl) ) THEN ! force definition for xml files (xios) 226 ALLOCATE( ght_abl(jpka), ghw_abl(jpka), e3t_abl(jpka), e3w_abl(jpka) ) ! default allocation needed by iom 227 ght_abl(:) = -1._wp ; ghw_abl(:) = -1._wp 228 e3t_abl(:) = -1._wp ; e3w_abl(:) = -1._wp 229 ENDIF 230 CALL iom_set_axis_attr( "ght_abl", ght_abl(2:jpka) ) 231 CALL iom_set_axis_attr( "ghw_abl", ghw_abl(2:jpka) ) 216 232 217 218 219 220 221 222 223 224 225 226 227 233 ! Add vertical grid bounds 234 zt_bnds(2,: ) = gdept_1d(:) 235 zt_bnds(1,2:jpk ) = gdept_1d(1:jpkm1) 236 zt_bnds(1,1 ) = gdept_1d(1) - e3w_1d(1) 237 zw_bnds(1,: ) = gdepw_1d(:) 238 zw_bnds(2,1:jpkm1) = gdepw_1d(2:jpk) 239 zw_bnds(2,jpk: ) = gdepw_1d(jpk) + e3t_1d(jpk) 240 CALL iom_set_axis_attr( "deptht", bounds=zw_bnds ) 241 CALL iom_set_axis_attr( "depthu", bounds=zw_bnds ) 242 CALL iom_set_axis_attr( "depthv", bounds=zw_bnds ) 243 CALL iom_set_axis_attr( "depthw", bounds=zt_bnds ) 228 244 CALL iom_set_axis_attr( "depthf", bounds=zw_bnds ) 229 245 230 231 232 233 234 235 236 237 238 246 ! ABL 247 za_bnds(1,:) = ghw_abl(1:jpkam1) 248 za_bnds(2,:) = ghw_abl(2:jpka ) 249 CALL iom_set_axis_attr( "ght_abl", bounds=za_bnds ) 250 za_bnds(1,:) = ght_abl(2:jpka ) 251 za_bnds(2,:) = ght_abl(2:jpka ) + e3w_abl(2:jpka) 252 CALL iom_set_axis_attr( "ghw_abl", bounds=za_bnds ) 253 254 CALL iom_set_axis_attr( "nfloat", (/ (REAL(ji,wp), ji=1,jpnfl) /) ) 239 255 # if defined key_si3 240 241 242 256 CALL iom_set_axis_attr( "ncatice", (/ (REAL(ji,wp), ji=1,jpl) /) ) 257 ! SIMIP diagnostics (4 main arctic straits) 258 CALL iom_set_axis_attr( "nstrait", (/ (REAL(ji,wp), ji=1,4) /) ) 243 259 # endif 244 260 #if defined key_top 245 246 #endif 247 248 249 250 251 252 253 254 261 IF( ALLOCATED(profsed) ) CALL iom_set_axis_attr( "profsed", paxis = profsed ) 262 #endif 263 CALL iom_set_axis_attr( "icbcla", class_num ) 264 CALL iom_set_axis_attr( "iax_20C", (/ REAL(20,wp) /) ) ! strange syntaxe and idea... 265 CALL iom_set_axis_attr( "iax_26C", (/ REAL(26,wp) /) ) ! strange syntaxe and idea... 266 CALL iom_set_axis_attr( "iax_28C", (/ REAL(28,wp) /) ) ! strange syntaxe and idea... 267 ! for diaprt, we need to define an axis which size can be 1 (default) or 5 (if the file subbasins.nc exists) 268 INQUIRE( FILE = 'subbasins.nc', EXIST = ll_exist ) 269 nbasin = 1 + 4 * COUNT( (/ll_exist/) ) 270 CALL iom_set_axis_attr( "basin" , (/ (REAL(ji,wp), ji=1,nbasin) /) ) 255 271 ENDIF 256 272 ! 257 273 ! automatic definitions of some of the xml attributs 258 IF( TRIM(cdname) == TRIM(crxios_context) ) THEN 259 !set names of the fields in restart file IF using XIOS to read data 260 CALL iom_set_rst_context(.TRUE.) 261 CALL iom_set_rst_vars(rst_rfields) 262 !set which fields are to be read from restart file 263 CALL iom_set_rstr_active() 264 ELSE IF( TRIM(cdname) == TRIM(cwxios_context) ) THEN 265 !set names of the fields in restart file IF using XIOS to write data 266 CALL iom_set_rst_context(.FALSE.) 267 CALL iom_set_rst_vars(rst_wfields) 268 !set which fields are to be written to a restart file 269 CALL iom_set_rstw_active(fname) 274 IF(llrstr) THEN 275 IF(PRESENT(kdid)) THEN 276 CALL iom_set_rst_context(.TRUE.) 277 !set which fields will be read from restart file 278 CALL iom_set_vars_active(kdid) 279 ELSE 280 CALL ctl_stop( 'iom_init:', 'restart read with XIOS: missing pointer to NETCDF file' ) 281 ENDIF 282 ELSE IF(llrstw) THEN 283 CALL iom_set_rstw_file(iom_file(kdid)%name) 270 284 ELSE 271 285 CALL set_xmlatt 272 286 ENDIF 273 287 ! … … 285 299 END SUBROUTINE iom_init 286 300 287 SUBROUTINE iom_init_closedef 301 SUBROUTINE iom_init_closedef(cdname) 288 302 !!---------------------------------------------------------------------- 289 303 !! *** SUBROUTINE iom_init_closedef *** … … 293 307 !! 294 308 !!---------------------------------------------------------------------- 295 309 CHARACTER(len=*), OPTIONAL, INTENT(IN) :: cdname 296 310 #if defined key_iomput 297 CALL xios_close_context_definition() 298 CALL xios_update_calendar( 0 ) 311 LOGICAL :: llrstw 312 313 llrstw = .FALSE. 314 IF(PRESENT(cdname)) THEN 315 llrstw = (cdname == cw_ocerst_cxt) 316 llrstw = llrstw .OR. (cdname == cw_icerst_cxt) 317 llrstw = llrstw .OR. (cdname == cw_toprst_cxt) 318 llrstw = llrstw .OR. (cdname == cw_sedrst_cxt) 319 ENDIF 320 321 IF( llrstw ) THEN 322 !set names of the fields in restart file IF using XIOS to write data 323 CALL iom_set_rst_context(.FALSE.) 324 CALL xios_close_context_definition() 325 ELSE 326 CALL xios_close_context_definition() 327 CALL xios_update_calendar( 0 ) 328 ENDIF 299 329 #else 300 330 IF( .FALSE. ) WRITE(numout,*) 'iom_init_closedef: should not see this' ! useless statement to avoid compilation warnings … … 303 333 END SUBROUTINE iom_init_closedef 304 334 305 SUBROUTINE iom_set_ rstw_var_active(field)335 SUBROUTINE iom_set_vars_active(idnum) 306 336 !!--------------------------------------------------------------------- 307 !! *** SUBROUTINE iom_set_rstw_var_active *** 308 !! 309 !! ** Purpose : enable variable in restart file when writing with XIOS 337 !! *** SUBROUTINE iom_set_vars_active *** 338 !! 339 !! ** Purpose : define filename in XIOS context for reading file, 340 !! enable variables present in a file for reading with XIOS 341 !! id of the file is assumed to be rrestart. 310 342 !!--------------------------------------------------------------------- 311 CHARACTER(len = *), INTENT(IN) :: field 312 INTEGER :: i 313 LOGICAL :: llis_set 314 CHARACTER(LEN=256) :: clinfo ! info character 315 343 INTEGER, INTENT(IN) :: idnum 344 316 345 #if defined key_iomput 317 llis_set = .FALSE. 318 319 DO i = 1, max_rst_fields 320 IF(TRIM(rst_wfields(i)%vname) == field) THEN 321 rst_wfields(i)%active = .TRUE. 322 llis_set = .TRUE. 323 EXIT 324 ENDIF 325 ENDDO 326 !Warn if variable is not in defined in rst_wfields 327 IF(.NOT.llis_set) THEN 328 WRITE(ctmp1,*) 'iom_set_rstw_var_active: variable ', field ,' is available for writing but not defined' 329 CALL ctl_stop( 'iom_set_rstw_var_active:', ctmp1 ) 330 ENDIF 331 #else 332 clinfo = 'iom_set_rstw_var_active: key_iomput is needed to use XIOS restart read/write functionality' 333 CALL ctl_stop('STOP', TRIM(clinfo)) 334 #endif 335 336 END SUBROUTINE iom_set_rstw_var_active 337 338 SUBROUTINE iom_set_rstr_active() 346 INTEGER :: ndims, nvars, natts, unlimitedDimId, dimlen, xtype,mdims 347 TYPE(xios_field) :: field_hdl 348 TYPE(xios_file) :: file_hdl 349 TYPE(xios_filegroup) :: filegroup_hdl 350 INTEGER :: dimids(4), jv,i, idim 351 CHARACTER(LEN=256) :: clinfo ! info character 352 INTEGER, ALLOCATABLE :: indimlens(:) 353 CHARACTER(LEN=nf90_max_name), ALLOCATABLE :: indimnames(:) 354 CHARACTER(LEN=nf90_max_name) :: dimname, varname 355 INTEGER :: iln 356 CHARACTER(LEN=lc) :: fname 357 LOGICAL :: lmeta 358 !metadata in restart file for restart read with XIOS 359 INTEGER, PARAMETER :: NMETA = 10 360 CHARACTER(LEN=lc) :: meta(NMETA) 361 362 363 meta(1) = "nav_lat" 364 meta(2) = "nav_lon" 365 meta(3) = "nav_lev" 366 meta(4) = "time_instant" 367 meta(5) = "time_instant_bounds" 368 meta(6) = "time_counter" 369 meta(7) = "time_counter_bounds" 370 meta(8) = "x" 371 meta(9) = "y" 372 meta(10) = "numcat" 373 374 clinfo = ' iom_set_vars_active, file: '//TRIM(iom_file(idnum)%name) 375 376 iln = INDEX( iom_file(idnum)%name, '.nc' ) 377 !XIOS doee not need .nc 378 IF(iln > 0) THEN 379 fname = iom_file(idnum)%name(1:iln-1) 380 ELSE 381 fname = iom_file(idnum)%name 382 ENDIF 383 384 !set name of the restart file and enable available fields 385 CALL xios_get_handle("file_definition", filegroup_hdl ) 386 CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart') 387 CALL xios_set_file_attr( "rrestart", name=fname, type="one_file", & 388 par_access="collective", enabled=.TRUE., mode="read", & 389 output_freq=xios_timestep ) 390 391 CALL iom_nf90_check( nf90_inquire(iom_file(idnum)%nfid, ndims, nvars, natts ), clinfo ) 392 ALLOCATE(indimlens(ndims), indimnames(ndims)) 393 CALL iom_nf90_check( nf90_inquire(iom_file(idnum)%nfid, unlimitedDimId = unlimitedDimId ), clinfo ) 394 395 DO idim = 1, ndims 396 CALL iom_nf90_check( nf90_inquire_dimension(iom_file(idnum)%nfid, idim, dimname, dimlen ), clinfo ) 397 indimlens(idim) = dimlen 398 indimnames(idim) = dimname 399 ENDDO 400 401 DO jv =1, nvars 402 lmeta = .FALSE. 403 CALL iom_nf90_check( nf90_inquire_variable(iom_file(idnum)%nfid, jv, varname, xtype, ndims, dimids, natts ), clinfo ) 404 DO i = 1, NMETA 405 IF(varname == meta(i)) THEN 406 lmeta = .TRUE. 407 ENDIF 408 ENDDO 409 IF(.NOT.lmeta) THEN 410 CALL xios_add_child(file_hdl, field_hdl, varname) 411 mdims = ndims 412 413 IF(ANY(dimids(1:ndims) == unlimitedDimId)) THEN 414 mdims = mdims - 1 415 ENDIF 416 417 IF(mdims == 3) THEN 418 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, & 419 domain_ref="grid_N", & 420 axis_ref=iom_axis(indimlens(dimids(mdims))), & 421 prec = 8, operation = "instant" ) 422 ELSEIF(mdims == 2) THEN 423 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, & 424 domain_ref="grid_N", prec = 8, & 425 operation = "instant" ) 426 ELSEIF(mdims == 1) THEN 427 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, & 428 axis_ref=iom_axis(indimlens(dimids(mdims))), & 429 prec = 8, operation = "instant" ) 430 ELSEIF(mdims == 0) THEN 431 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = varname, & 432 scalar_ref = "grid_scalar", prec = 8, & 433 operation = "instant" ) 434 ELSE 435 WRITE(ctmp1,*) 'iom_set_vars_active: variable ', TRIM(varname) ,' incorrect number of dimensions' 436 CALL ctl_stop( 'iom_set_vars_active:', ctmp1 ) 437 ENDIF 438 ENDIF 439 ENDDO 440 DEALLOCATE(indimlens, indimnames) 441 #endif 442 END SUBROUTINE iom_set_vars_active 443 444 SUBROUTINE iom_set_rstw_file(cdrst_file) 339 445 !!--------------------------------------------------------------------- 340 !! *** SUBROUTINE iom_set_rstr_active *** 341 !! 342 !! ** Purpose : define file name in XIOS context for reading restart file, 343 !! enable variables present in restart file for reading with XIOS 446 !! *** SUBROUTINE iom_set_rstw_file *** 447 !! 448 !! ** Purpose : define file name in XIOS context for writing restart 344 449 !!--------------------------------------------------------------------- 345 346 !sets enabled = .TRUE. for each field in restart file 347 CHARACTER(len=256) :: rst_file 348 450 CHARACTER(len=*) :: cdrst_file 349 451 #if defined key_iomput 350 TYPE(xios_field) :: field_hdl 351 TYPE(xios_file) :: file_hdl 352 TYPE(xios_filegroup) :: filegroup_hdl 353 INTEGER :: i 354 CHARACTER(lc) :: clpath 355 356 clpath = TRIM(cn_ocerst_indir) 357 IF( clpath(LEN_TRIM(clpath):) /= '/' ) clpath = TRIM(clpath) // '/' 358 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 359 rst_file = TRIM(clpath)//TRIM(cn_ocerst_in) 360 ELSE 361 rst_file = TRIM(clpath)//TRIM(Agrif_CFixed())//'_'//TRIM(cn_ocerst_in) 362 ENDIF 452 TYPE(xios_file) :: file_hdl 453 TYPE(xios_filegroup) :: filegroup_hdl 454 363 455 !set name of the restart file and enable available fields 364 if(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file 365 CALL xios_get_handle("file_definition", filegroup_hdl ) 366 CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart') 367 CALL xios_set_file_attr( "rrestart", name=trim(rst_file), type="one_file", & 368 par_access="collective", enabled=.TRUE., mode="read", & 369 output_freq=xios_timestep) 370 !define variables for restart context 371 DO i = 1, max_rst_fields 372 IF( TRIM(rst_rfields(i)%vname) /= "NO_NAME") THEN 373 IF( iom_varid( numror, TRIM(rst_rfields(i)%vname), ldstop = .FALSE. ) > 0 ) THEN 374 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_rfields(i)%vname)) 375 SELECT CASE (TRIM(rst_rfields(i)%grid)) 376 CASE ("grid_N_3D") 377 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 378 domain_ref="grid_N", axis_ref="nav_lev", operation = "instant") 379 CASE ("grid_N") 380 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 381 domain_ref="grid_N", operation = "instant") 382 CASE ("grid_vector") 383 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 384 axis_ref="nav_lev", operation = "instant") 385 CASE ("grid_scalar") 386 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_rfields(i)%vname), & 387 scalar_ref = "grid_scalar", operation = "instant") 388 END SELECT 389 IF(lwp) WRITE(numout,*) 'XIOS read: ', TRIM(rst_rfields(i)%vname), ' enabled in ', TRIM(rst_file) 390 ENDIF 391 ENDIF 392 END DO 393 #endif 394 END SUBROUTINE iom_set_rstr_active 395 396 SUBROUTINE iom_set_rstw_core(cdmdl) 397 !!--------------------------------------------------------------------- 398 !! *** SUBROUTINE iom_set_rstw_core *** 399 !! 400 !! ** Purpose : set variables which are always in restart file 401 !!--------------------------------------------------------------------- 402 CHARACTER (len=*), INTENT (IN) :: cdmdl ! model OPA or SAS 403 CHARACTER(LEN=256) :: clinfo ! info character 404 #if defined key_iomput 405 IF(cdmdl == "OPA") THEN 406 !from restart.F90 407 CALL iom_set_rstw_var_active("rn_Dt") 408 IF ( .NOT. ln_diurnal_only ) THEN 409 CALL iom_set_rstw_var_active('ub' ) 410 CALL iom_set_rstw_var_active('vb' ) 411 CALL iom_set_rstw_var_active('tb' ) 412 CALL iom_set_rstw_var_active('sb' ) 413 CALL iom_set_rstw_var_active('sshb') 414 ! 415 CALL iom_set_rstw_var_active('un' ) 416 CALL iom_set_rstw_var_active('vn' ) 417 CALL iom_set_rstw_var_active('tn' ) 418 CALL iom_set_rstw_var_active('sn' ) 419 CALL iom_set_rstw_var_active('sshn') 420 CALL iom_set_rstw_var_active('rhop') 421 ENDIF 422 IF(ln_diurnal) CALL iom_set_rstw_var_active('Dsst') 423 !from trasbc.F90 424 CALL iom_set_rstw_var_active('sbc_hc_b') 425 CALL iom_set_rstw_var_active('sbc_sc_b') 426 ENDIF 427 #else 428 clinfo = 'iom_set_rstw_core: key_iomput is needed to use XIOS restart read/write functionality' 429 CALL ctl_stop('STOP', TRIM(clinfo)) 430 #endif 431 END SUBROUTINE iom_set_rstw_core 432 433 SUBROUTINE iom_set_rst_vars(fields) 434 !!--------------------------------------------------------------------- 435 !! *** SUBROUTINE iom_set_rst_vars *** 436 !! 437 !! ** Purpose : Fill array fields with the information about all 438 !! possible variables and corresponding grids definition 439 !! for reading/writing restart with XIOS 440 !!--------------------------------------------------------------------- 441 TYPE(RST_FIELD), INTENT(INOUT) :: fields(max_rst_fields) 442 INTEGER :: i 443 444 i = 0 445 i = i + 1; fields(i)%vname="rn_Dt"; fields(i)%grid="grid_scalar" 446 i = i + 1; fields(i)%vname="un"; fields(i)%grid="grid_N_3D" 447 i = i + 1; fields(i)%vname="ub"; fields(i)%grid="grid_N_3D" 448 i = i + 1; fields(i)%vname="vn"; fields(i)%grid="grid_N_3D" 449 i = i + 1; fields(i)%vname="vb"; fields(i)%grid="grid_N_3D" 450 i = i + 1; fields(i)%vname="tn"; fields(i)%grid="grid_N_3D" 451 i = i + 1; fields(i)%vname="tb"; fields(i)%grid="grid_N_3D" 452 i = i + 1; fields(i)%vname="sn"; fields(i)%grid="grid_N_3D" 453 i = i + 1; fields(i)%vname="sb"; fields(i)%grid="grid_N_3D" 454 i = i + 1; fields(i)%vname="sshn"; fields(i)%grid="grid_N" 455 i = i + 1; fields(i)%vname="sshb"; fields(i)%grid="grid_N" 456 i = i + 1; fields(i)%vname="rhop"; fields(i)%grid="grid_N_3D" 457 i = i + 1; fields(i)%vname="kt"; fields(i)%grid="grid_scalar" 458 i = i + 1; fields(i)%vname="ndastp"; fields(i)%grid="grid_scalar" 459 i = i + 1; fields(i)%vname="adatrj"; fields(i)%grid="grid_scalar" 460 i = i + 1; fields(i)%vname="utau_b"; fields(i)%grid="grid_N" 461 i = i + 1; fields(i)%vname="vtau_b"; fields(i)%grid="grid_N" 462 i = i + 1; fields(i)%vname="qns_b"; fields(i)%grid="grid_N" 463 i = i + 1; fields(i)%vname="emp_b"; fields(i)%grid="grid_N" 464 i = i + 1; fields(i)%vname="sfx_b"; fields(i)%grid="grid_N" 465 i = i + 1; fields(i)%vname="en" ; fields(i)%grid="grid_N_3D" 466 i = i + 1; fields(i)%vname="avt_k"; fields(i)%grid="grid_N_3D" 467 i = i + 1; fields(i)%vname="avm_k"; fields(i)%grid="grid_N_3D" 468 i = i + 1; fields(i)%vname="dissl"; fields(i)%grid="grid_N_3D" 469 i = i + 1; fields(i)%vname="sbc_hc_b"; fields(i)%grid="grid_N" 470 i = i + 1; fields(i)%vname="sbc_sc_b"; fields(i)%grid="grid_N" 471 i = i + 1; fields(i)%vname="qsr_hc_b"; fields(i)%grid="grid_N_3D" 472 i = i + 1; fields(i)%vname="fraqsr_1lev"; fields(i)%grid="grid_N" 473 i = i + 1; fields(i)%vname="greenland_icesheet_mass" 474 fields(i)%grid="grid_scalar" 475 i = i + 1; fields(i)%vname="greenland_icesheet_timelapsed" 476 fields(i)%grid="grid_scalar" 477 i = i + 1; fields(i)%vname="greenland_icesheet_mass_roc" 478 fields(i)%grid="grid_scalar" 479 i = i + 1; fields(i)%vname="antarctica_icesheet_mass" 480 fields(i)%grid="grid_scalar" 481 i = i + 1; fields(i)%vname="antarctica_icesheet_timelapsed" 482 fields(i)%grid="grid_scalar" 483 i = i + 1; fields(i)%vname="antarctica_icesheet_mass_roc" 484 fields(i)%grid="grid_scalar" 485 i = i + 1; fields(i)%vname="frc_v"; fields(i)%grid="grid_scalar" 486 i = i + 1; fields(i)%vname="frc_t"; fields(i)%grid="grid_scalar" 487 i = i + 1; fields(i)%vname="frc_s"; fields(i)%grid="grid_scalar" 488 i = i + 1; fields(i)%vname="frc_wn_t"; fields(i)%grid="grid_scalar" 489 i = i + 1; fields(i)%vname="frc_wn_s"; fields(i)%grid="grid_scalar" 490 i = i + 1; fields(i)%vname="ssh_ini"; fields(i)%grid="grid_N" 491 i = i + 1; fields(i)%vname="e3t_ini"; fields(i)%grid="grid_N_3D" 492 i = i + 1; fields(i)%vname="hc_loc_ini"; fields(i)%grid="grid_N_3D" 493 i = i + 1; fields(i)%vname="sc_loc_ini"; fields(i)%grid="grid_N_3D" 494 i = i + 1; fields(i)%vname="ssh_hc_loc_ini"; fields(i)%grid="grid_N" 495 i = i + 1; fields(i)%vname="ssh_sc_loc_ini"; fields(i)%grid="grid_N" 496 i = i + 1; fields(i)%vname="tilde_e3t_b"; fields(i)%grid="grid_N" 497 i = i + 1; fields(i)%vname="tilde_e3t_n"; fields(i)%grid="grid_N" 498 i = i + 1; fields(i)%vname="hdiv_lf"; fields(i)%grid="grid_N" 499 i = i + 1; fields(i)%vname="ub2_b"; fields(i)%grid="grid_N" 500 i = i + 1; fields(i)%vname="vb2_b"; fields(i)%grid="grid_N" 501 i = i + 1; fields(i)%vname="sshbb_e"; fields(i)%grid="grid_N" 502 i = i + 1; fields(i)%vname="ubb_e"; fields(i)%grid="grid_N" 503 i = i + 1; fields(i)%vname="vbb_e"; fields(i)%grid="grid_N" 504 i = i + 1; fields(i)%vname="sshb_e"; fields(i)%grid="grid_N" 505 i = i + 1; fields(i)%vname="ub_e"; fields(i)%grid="grid_N" 506 i = i + 1; fields(i)%vname="vb_e"; fields(i)%grid="grid_N" 507 i = i + 1; fields(i)%vname="fwf_isf_b"; fields(i)%grid="grid_N" 508 i = i + 1; fields(i)%vname="isf_sc_b"; fields(i)%grid="grid_N" 509 i = i + 1; fields(i)%vname="isf_hc_b"; fields(i)%grid="grid_N" 510 i = i + 1; fields(i)%vname="ssh_ibb"; fields(i)%grid="grid_N" 511 i = i + 1; fields(i)%vname="rnf_b"; fields(i)%grid="grid_N" 512 i = i + 1; fields(i)%vname="rnf_hc_b"; fields(i)%grid="grid_N" 513 i = i + 1; fields(i)%vname="rnf_sc_b"; fields(i)%grid="grid_N" 514 i = i + 1; fields(i)%vname="nn_fsbc"; fields(i)%grid="grid_scalar" 515 i = i + 1; fields(i)%vname="ssu_m"; fields(i)%grid="grid_N" 516 i = i + 1; fields(i)%vname="ssv_m"; fields(i)%grid="grid_N" 517 i = i + 1; fields(i)%vname="sst_m"; fields(i)%grid="grid_N" 518 i = i + 1; fields(i)%vname="sss_m"; fields(i)%grid="grid_N" 519 i = i + 1; fields(i)%vname="ssh_m"; fields(i)%grid="grid_N" 520 i = i + 1; fields(i)%vname="e3t_m"; fields(i)%grid="grid_N" 521 i = i + 1; fields(i)%vname="frq_m"; fields(i)%grid="grid_N" 522 i = i + 1; fields(i)%vname="avmb"; fields(i)%grid="grid_vector" 523 i = i + 1; fields(i)%vname="avtb"; fields(i)%grid="grid_vector" 524 i = i + 1; fields(i)%vname="ub2_i_b"; fields(i)%grid="grid_N" 525 i = i + 1; fields(i)%vname="vb2_i_b"; fields(i)%grid="grid_N" 526 i = i + 1; fields(i)%vname="ntime"; fields(i)%grid="grid_scalar" 527 i = i + 1; fields(i)%vname="Dsst"; fields(i)%grid="grid_scalar" 528 i = i + 1; fields(i)%vname="tmask"; fields(i)%grid="grid_N_3D" 529 i = i + 1; fields(i)%vname="umask"; fields(i)%grid="grid_N_3D" 530 i = i + 1; fields(i)%vname="vmask"; fields(i)%grid="grid_N_3D" 531 i = i + 1; fields(i)%vname="smask"; fields(i)%grid="grid_N_3D" 532 i = i + 1; fields(i)%vname="gdepw_n"; fields(i)%grid="grid_N_3D" 533 i = i + 1; fields(i)%vname="e3t_n"; fields(i)%grid="grid_N_3D" 534 i = i + 1; fields(i)%vname="e3u_n"; fields(i)%grid="grid_N_3D" 535 i = i + 1; fields(i)%vname="e3v_n"; fields(i)%grid="grid_N_3D" 536 i = i + 1; fields(i)%vname="surf_ini"; fields(i)%grid="grid_N" 537 i = i + 1; fields(i)%vname="e3t_b"; fields(i)%grid="grid_N_3D" 538 i = i + 1; fields(i)%vname="hmxl_n"; fields(i)%grid="grid_N_3D" 539 i = i + 1; fields(i)%vname="un_bf"; fields(i)%grid="grid_N" 540 i = i + 1; fields(i)%vname="vn_bf"; fields(i)%grid="grid_N" 541 i = i + 1; fields(i)%vname="hbl"; fields(i)%grid="grid_N" 542 i = i + 1; fields(i)%vname="hbli"; fields(i)%grid="grid_N" 543 i = i + 1; fields(i)%vname="wn"; fields(i)%grid="grid_N_3D" 544 545 IF( i-1 > max_rst_fields) THEN 546 WRITE(ctmp1,*) 'E R R O R : iom_set_rst_vars SIZE of RST_FIELD array is too small' 547 CALL ctl_stop( 'iom_set_rst_vars:', ctmp1 ) 548 ENDIF 549 END SUBROUTINE iom_set_rst_vars 550 551 552 SUBROUTINE iom_set_rstw_active(cdrst_file) 456 IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ', TRIM(cdrst_file) 457 CALL xios_get_handle("file_definition", filegroup_hdl ) 458 CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') 459 IF(nxioso.eq.1) THEN 460 CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 461 mode="write", output_freq=xios_timestep) 462 IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 463 ELSE 464 CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 465 mode="write", output_freq=xios_timestep) 466 IF(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 467 ENDIF 468 CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file)) 469 #endif 470 END SUBROUTINE iom_set_rstw_file 471 472 473 SUBROUTINE iom_set_rstw_active(sdfield, rd0, rs0, rd1, rs1, rd2, rs2, rd3, rs3) 553 474 !!--------------------------------------------------------------------- 554 475 !! *** SUBROUTINE iom_set_rstw_active *** … … 558 479 !!--------------------------------------------------------------------- 559 480 !sets enabled = .TRUE. for each field in restart file 560 CHARACTER(len=*) :: cdrst_file 481 CHARACTER(len = *), INTENT(IN) :: sdfield 482 REAL(dp), OPTIONAL, INTENT(IN) :: rd0 483 REAL(sp), OPTIONAL, INTENT(IN) :: rs0 484 REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:) :: rd1 485 REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:) :: rs1 486 REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :) :: rd2 487 REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :) :: rs2 488 REAL(dp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rd3 489 REAL(sp), OPTIONAL, INTENT(IN), DIMENSION(:, :, :) :: rs3 561 490 #if defined key_iomput 562 TYPE(xios_field) :: field_hdl 563 TYPE(xios_file) :: file_hdl 564 TYPE(xios_filegroup) :: filegroup_hdl 565 INTEGER :: i 566 CHARACTER(lc) :: clpath 567 568 !set name of the restart file and enable available fields 569 IF(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS write) to: ',cdrst_file 570 CALL xios_get_handle("file_definition", filegroup_hdl ) 571 CALL xios_add_child(filegroup_hdl, file_hdl, 'wrestart') 572 IF(nxioso.eq.1) THEN 573 CALL xios_set_file_attr( "wrestart", type="one_file", enabled=.TRUE.,& 574 mode="write", output_freq=xios_timestep) 575 if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in one_file mode' 576 ELSE 577 CALL xios_set_file_attr( "wrestart", type="multiple_file", enabled=.TRUE.,& 578 mode="write", output_freq=xios_timestep) 579 if(lwp) write(numout,*) 'OPEN ', trim(cdrst_file), ' in multiple_file mode' 580 ENDIF 581 CALL xios_set_file_attr( "wrestart", name=trim(cdrst_file)) 491 TYPE(xios_field) :: field_hdl 492 TYPE(xios_file) :: file_hdl 493 494 CALL xios_get_handle("wrestart", file_hdl) 582 495 !define fields for restart context 583 DO i = 1, max_rst_fields 584 IF( rst_wfields(i)%active ) THEN 585 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_wfields(i)%vname)) 586 SELECT CASE (TRIM(rst_wfields(i)%grid)) 587 CASE ("grid_N_3D") 588 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 589 domain_ref="grid_N", axis_ref="nav_lev", prec = 8, operation = "instant") 590 CASE ("grid_N") 591 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 592 domain_ref="grid_N", prec = 8, operation = "instant") 593 CASE ("grid_vector") 594 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 595 axis_ref="nav_lev", prec = 8, operation = "instant") 596 CASE ("grid_scalar") 597 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_wfields(i)%vname), & 598 scalar_ref = "grid_scalar", prec = 8, operation = "instant") 599 END SELECT 600 ENDIF 601 END DO 496 CALL xios_add_child(file_hdl, field_hdl, sdfield) 497 498 IF(PRESENT(rd3)) THEN 499 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 500 domain_ref = "grid_N", & 501 axis_ref = iom_axis(size(rd3, 3)), & 502 prec = 8, operation = "instant" ) 503 ELSEIF(PRESENT(rs3)) THEN 504 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 505 domain_ref = "grid_N", & 506 axis_ref = iom_axis(size(rd3, 3)), & 507 prec = 4, operation = "instant" ) 508 ELSEIF(PRESENT(rd2)) THEN 509 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 510 domain_ref = "grid_N", prec = 8, & 511 operation = "instant" ) 512 ELSEIF(PRESENT(rs2)) THEN 513 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 514 domain_ref = "grid_N", prec = 4, & 515 operation = "instant" ) 516 ELSEIF(PRESENT(rd1)) THEN 517 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 518 axis_ref = iom_axis(size(rd1, 1)), & 519 prec = 8, operation = "instant" ) 520 ELSEIF(PRESENT(rs1)) THEN 521 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 522 axis_ref = iom_axis(size(rd1, 1)), & 523 prec = 4, operation = "instant" ) 524 ELSEIF(PRESENT(rd0)) THEN 525 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 526 scalar_ref = "grid_scalar", prec = 8, & 527 operation = "instant" ) 528 ELSEIF(PRESENT(rs0)) THEN 529 CALL xios_set_attr (field_hdl, enabled = .TRUE., name = sdfield, & 530 scalar_ref = "grid_scalar", prec = 4, & 531 operation = "instant" ) 532 ENDIF 602 533 #endif 603 534 END SUBROUTINE iom_set_rstw_active 604 535 536 FUNCTION iom_axis(idlev) result(axis_ref) 537 !!--------------------------------------------------------------------- 538 !! *** FUNCTION iom_axis *** 539 !! 540 !! ** Purpose : Used for grid definition when XIOS is used to read/write 541 !! restart. Returns axis corresponding to the number of levels 542 !! given as an input variable. Axes are defined in routine 543 !! iom_set_rst_context 544 !!--------------------------------------------------------------------- 545 INTEGER, INTENT(IN) :: idlev 546 CHARACTER(len=lc) :: axis_ref 547 CHARACTER(len=12) :: str 548 IF(idlev == jpk) THEN 549 axis_ref="nav_lev" 550 #if defined key_si3 551 ELSEIF(idlev == jpl) THEN 552 axis_ref="numcat" 553 #endif 554 ELSE 555 write(str, *) idlev 556 CALL ctl_stop( 'iom_axis', 'Definition for axis with '//TRIM(ADJUSTL(str))//' levels missing') 557 ENDIF 558 END FUNCTION iom_axis 559 560 FUNCTION iom_xios_setid(cdname) result(kid) 561 !!--------------------------------------------------------------------- 562 !! *** FUNCTION *** 563 !! 564 !! ** Purpose : this function returns first available id to keep information about file 565 !! sets filename in iom_file structure and sets name 566 !! of XIOS context depending on cdcomp 567 !! corresponds to iom_nf90_open 568 !!--------------------------------------------------------------------- 569 CHARACTER(len=*), INTENT(in ) :: cdname ! File name 570 INTEGER :: kid ! identifier of the opened file 571 INTEGER :: jl 572 573 kid = 0 574 DO jl = jpmax_files, 1, -1 575 IF( iom_file(jl)%nfid == 0 ) kid = jl 576 ENDDO 577 578 iom_file(kid)%name = TRIM(cdname) 579 iom_file(kid)%nfid = 1 580 iom_file(kid)%nvars = 0 581 iom_file(kid)%irec = -1 582 583 END FUNCTION iom_xios_setid 584 605 585 SUBROUTINE iom_set_rst_context(ld_rstr) 606 !!---------------------------------------------------------------------586 !!--------------------------------------------------------------------- 607 587 !! *** SUBROUTINE iom_set_rst_context *** 608 588 !! … … 611 591 !! 612 592 !!--------------------------------------------------------------------- 613 LOGICAL, INTENT(IN) :: ld_rstr 614 !ld_rstr is true for restart context. There is no need to define grid for 615 !restart read, because it's read from file 593 LOGICAL, INTENT(IN) :: ld_rstr 594 INTEGER :: ji 616 595 #if defined key_iomput 617 TYPE(xios_domaingroup) :: domaingroup_hdl618 TYPE(xios_domain) :: domain_hdl619 TYPE(xios_axisgroup) :: axisgroup_hdl620 TYPE(xios_axis) :: axis_hdl621 TYPE(xios_scalar) :: scalar_hdl622 TYPE(xios_scalargroup) :: scalargroup_hdl623 624 CALL xios_get_handle("domain_definition",domaingroup_hdl)625 CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N")626 CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr)596 TYPE(xios_domaingroup) :: domaingroup_hdl 597 TYPE(xios_domain) :: domain_hdl 598 TYPE(xios_axisgroup) :: axisgroup_hdl 599 TYPE(xios_axis) :: axis_hdl 600 TYPE(xios_scalar) :: scalar_hdl 601 TYPE(xios_scalargroup) :: scalargroup_hdl 602 603 CALL xios_get_handle("domain_definition",domaingroup_hdl) 604 CALL xios_add_child(domaingroup_hdl, domain_hdl, "grid_N") 605 CALL set_grid("N", glamt, gphit, .TRUE., ld_rstr) 627 606 628 CALL xios_get_handle("axis_definition",axisgroup_hdl)629 CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev")607 CALL xios_get_handle("axis_definition",axisgroup_hdl) 608 CALL xios_add_child(axisgroup_hdl, axis_hdl, "nav_lev") 630 609 !AGRIF fails to compile when unit= is in call to xios_set_axis_attr 631 ! CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels", unit="m", positive="down") 632 CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels in meters", positive="down") 633 CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 634 635 CALL xios_get_handle("scalar_definition", scalargroup_hdl) 636 CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 610 ! CALL xios_set_axis_attr( "nav_lev", long_name="Vertical levels", unit="m", positive="down") 611 CALL xios_set_axis_attr( "nav_lev", long_name = "Vertical levels in meters", positive = "down") 612 CALL iom_set_axis_attr( "nav_lev", paxis = gdept_1d ) 613 #if defined key_si3 614 CALL xios_add_child(axisgroup_hdl, axis_hdl, "numcat") 615 CALL iom_set_axis_attr( "numcat", (/ (REAL(ji,wp), ji=1,jpl) /) ) 616 #endif 617 CALL xios_get_handle("scalar_definition", scalargroup_hdl) 618 CALL xios_add_child(scalargroup_hdl, scalar_hdl, "grid_scalar") 637 619 #endif 638 620 END SUBROUTINE iom_set_rst_context 621 622 623 SUBROUTINE set_xios_context(kdid, cdcont) 624 !!--------------------------------------------------------------------- 625 !! *** SUBROUTINE iom_set_rst_context *** 626 !! 627 !! ** Purpose : set correct XIOS context based on kdid 628 !! 629 !!--------------------------------------------------------------------- 630 INTEGER, INTENT(IN) :: kdid ! Identifier of the file 631 CHARACTER(LEN=lc), INTENT(OUT) :: cdcont ! name of the context for XIOS read/write 632 633 cdcont = "NONE" 634 635 IF(lrxios) THEN 636 IF(kdid == numror) THEN 637 cdcont = cr_ocerst_cxt 638 ELSEIF(kdid == numrir) THEN 639 cdcont = cr_icerst_cxt 640 ELSEIF(kdid == numrtr) THEN 641 cdcont = cr_toprst_cxt 642 ELSEIF(kdid == numrsr) THEN 643 cdcont = cr_sedrst_cxt 644 ENDIF 645 ENDIF 646 647 IF(lwxios) THEN 648 IF(kdid == numrow) THEN 649 cdcont = cw_ocerst_cxt 650 ELSEIF(kdid == numriw) THEN 651 cdcont = cw_icerst_cxt 652 ELSEIF(kdid == numrtw) THEN 653 cdcont = cw_toprst_cxt 654 ELSEIF(kdid == numrsw) THEN 655 cdcont = cw_sedrst_cxt 656 ENDIF 657 ENDIF 658 END SUBROUTINE set_xios_context 659 639 660 640 661 SUBROUTINE iom_swap( cdname ) … … 647 668 #if defined key_iomput 648 669 TYPE(xios_context) :: nemo_hdl 649 650 670 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 651 671 CALL xios_get_handle(TRIM(cdname),nemo_hdl) … … 897 917 !! INTERFACE iom_get 898 918 !!---------------------------------------------------------------------- 899 SUBROUTINE iom_g0d_sp( kiomid, cdvar, pvar, ktime , ldxios)919 SUBROUTINE iom_g0d_sp( kiomid, cdvar, pvar, ktime ) 900 920 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 901 921 CHARACTER(len=*), INTENT(in ) :: cdvar ! Name of the variable … … 903 923 REAL(dp) :: ztmp_pvar ! tmp var to read field 904 924 INTEGER , INTENT(in ), OPTIONAL :: ktime ! record number 905 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! use xios to read restart906 925 ! 907 926 INTEGER :: idvar ! variable id … … 911 930 CHARACTER(LEN=100) :: clname ! file name 912 931 CHARACTER(LEN=1) :: cldmspc ! 913 LOGICAL :: llxios 914 ! 915 llxios = .FALSE. 916 IF( PRESENT(ldxios) ) llxios = ldxios 917 918 IF(.NOT.llxios) THEN ! read data using default library 932 CHARACTER(LEN=lc) :: context 933 ! 934 CALL set_xios_context(kiomid, context) 935 936 IF(context == "NONE") THEN ! read data using default library 919 937 itime = 1 920 938 IF( PRESENT(ktime) ) itime = ktime … … 939 957 #if defined key_iomput 940 958 IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar) 941 CALL iom_swap( TRIM(crxios_context))959 CALL iom_swap(context) 942 960 CALL xios_recv_field( trim(cdvar), pvar) 943 CALL iom_swap( TRIM(cxios_context))961 CALL iom_swap(cxios_context) 944 962 #else 945 963 WRITE(ctmp1,*) 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar) … … 949 967 END SUBROUTINE iom_g0d_sp 950 968 951 SUBROUTINE iom_g0d_dp( kiomid, cdvar, pvar, ktime , ldxios)969 SUBROUTINE iom_g0d_dp( kiomid, cdvar, pvar, ktime ) 952 970 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 953 971 CHARACTER(len=*), INTENT(in ) :: cdvar ! Name of the variable 954 972 REAL(dp) , INTENT( out) :: pvar ! read field 955 973 INTEGER , INTENT(in ), OPTIONAL :: ktime ! record number 956 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! use xios to read restart957 974 ! 958 975 INTEGER :: idvar ! variable id … … 962 979 CHARACTER(LEN=100) :: clname ! file name 963 980 CHARACTER(LEN=1) :: cldmspc ! 964 LOGICAL :: llxios 965 ! 966 llxios = .FALSE. 967 IF( PRESENT(ldxios) ) llxios = ldxios 968 969 IF(.NOT.llxios) THEN ! read data using default library 981 CHARACTER(LEN=lc) :: context 982 ! 983 CALL set_xios_context(kiomid, context) 984 985 IF(context == "NONE") THEN ! read data using default library 970 986 itime = 1 971 987 IF( PRESENT(ktime) ) itime = ktime … … 989 1005 #if defined key_iomput 990 1006 IF(lwp) WRITE(numout,*) 'XIOS RST READ (0D): ', trim(cdvar) 991 CALL iom_swap( TRIM(crxios_context))1007 CALL iom_swap(context) 992 1008 CALL xios_recv_field( trim(cdvar), pvar) 993 CALL iom_swap( TRIM(cxios_context))1009 CALL iom_swap(cxios_context) 994 1010 #else 995 1011 WRITE(ctmp1,*) 'Can not use XIOS in iom_g0d, file: '//trim(clname)//', var:'//trim(cdvar) … … 999 1015 END SUBROUTINE iom_g0d_dp 1000 1016 1001 SUBROUTINE iom_g1d_sp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount , ldxios)1017 SUBROUTINE iom_g1d_sp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount ) 1002 1018 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1003 1019 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1008 1024 INTEGER , INTENT(in ), DIMENSION(1), OPTIONAL :: kstart ! start axis position of the reading 1009 1025 INTEGER , INTENT(in ), DIMENSION(1), OPTIONAL :: kcount ! number of points in each axis 1010 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1011 1026 ! 1012 1027 IF( kiomid > 0 ) THEN … … 1014 1029 ALLOCATE(ztmp_pvar(size(pvar,1))) 1015 1030 CALL iom_get_123d( kiomid, kdom , cdvar , pv_r1d=ztmp_pvar, & 1016 & ktime=ktime, kstart=kstart, kcount=kcount, & 1017 & ldxios=ldxios ) 1031 & ktime=ktime, kstart=kstart, kcount=kcount ) 1018 1032 pvar = ztmp_pvar 1019 1033 DEALLOCATE(ztmp_pvar) … … 1023 1037 1024 1038 1025 SUBROUTINE iom_g1d_dp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount , ldxios)1039 SUBROUTINE iom_g1d_dp( kiomid, kdom, cdvar, pvar, ktime, kstart, kcount ) 1026 1040 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1027 1041 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1031 1045 INTEGER , INTENT(in ), DIMENSION(1), OPTIONAL :: kstart ! start axis position of the reading 1032 1046 INTEGER , INTENT(in ), DIMENSION(1), OPTIONAL :: kcount ! number of points in each axis 1033 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1034 1047 ! 1035 1048 IF( kiomid > 0 ) THEN 1036 1049 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom , cdvar , pv_r1d=pvar, & 1037 & ktime=ktime, kstart=kstart, kcount=kcount, & 1038 & ldxios=ldxios ) 1050 & ktime=ktime, kstart=kstart, kcount=kcount) 1039 1051 ENDIF 1040 1052 END SUBROUTINE iom_g1d_dp 1041 1053 1042 SUBROUTINE iom_g2d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount , ldxios)1054 SUBROUTINE iom_g2d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount) 1043 1055 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1044 1056 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1052 1064 INTEGER , INTENT(in ), DIMENSION(2), OPTIONAL :: kstart ! start axis position of the reading 1053 1065 INTEGER , INTENT(in ), DIMENSION(2), OPTIONAL :: kcount ! number of points in each axis 1054 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1055 1066 ! 1056 1067 IF( kiomid > 0 ) THEN … … 1059 1070 CALL iom_get_123d( kiomid, kdom, cdvar , pv_r2d = ztmp_pvar , ktime = ktime, & 1060 1071 & cd_type = cd_type, psgn = psgn , kfill = kfill, & 1061 & kstart = kstart , kcount = kcount , ldxios=ldxios)1072 & kstart = kstart , kcount = kcount ) 1062 1073 pvar = ztmp_pvar 1063 1074 DEALLOCATE(ztmp_pvar) … … 1066 1077 END SUBROUTINE iom_g2d_sp 1067 1078 1068 SUBROUTINE iom_g2d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount , ldxios)1079 SUBROUTINE iom_g2d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount) 1069 1080 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1070 1081 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1077 1088 INTEGER , INTENT(in ), DIMENSION(2), OPTIONAL :: kstart ! start axis position of the reading 1078 1089 INTEGER , INTENT(in ), DIMENSION(2), OPTIONAL :: kcount ! number of points in each axis 1079 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1080 1090 ! 1081 1091 IF( kiomid > 0 ) THEN 1082 1092 IF( iom_file(kiomid)%nfid > 0 ) CALL iom_get_123d( kiomid, kdom, cdvar , pv_r2d = pvar , ktime = ktime, & 1083 1093 & cd_type = cd_type, psgn = psgn , kfill = kfill, & 1084 & kstart = kstart , kcount = kcount , ldxios=ldxios)1094 & kstart = kstart , kcount = kcount ) 1085 1095 ENDIF 1086 1096 END SUBROUTINE iom_g2d_dp 1087 1097 1088 SUBROUTINE iom_g3d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount , ldxios)1098 SUBROUTINE iom_g3d_sp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount ) 1089 1099 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1090 1100 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1098 1108 INTEGER , INTENT(in ), DIMENSION(3), OPTIONAL :: kstart ! start axis position of the reading 1099 1109 INTEGER , INTENT(in ), DIMENSION(3), OPTIONAL :: kcount ! number of points in each axis 1100 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1101 1110 ! 1102 1111 IF( kiomid > 0 ) THEN … … 1105 1114 CALL iom_get_123d( kiomid, kdom, cdvar , pv_r3d = ztmp_pvar , ktime = ktime, & 1106 1115 & cd_type = cd_type, psgn = psgn , kfill = kfill, & 1107 & kstart = kstart , kcount = kcount , ldxios=ldxios)1116 & kstart = kstart , kcount = kcount ) 1108 1117 pvar = ztmp_pvar 1109 1118 DEALLOCATE(ztmp_pvar) … … 1112 1121 END SUBROUTINE iom_g3d_sp 1113 1122 1114 SUBROUTINE iom_g3d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount , ldxios)1123 SUBROUTINE iom_g3d_dp( kiomid, kdom, cdvar, pvar, ktime, cd_type, psgn, kfill, kstart, kcount ) 1115 1124 INTEGER , INTENT(in ) :: kiomid ! Identifier of the file 1116 1125 INTEGER , INTENT(in ) :: kdom ! Type of domain to be read … … 1123 1132 INTEGER , INTENT(in ), DIMENSION(3), OPTIONAL :: kstart ! start axis position of the reading 1124 1133 INTEGER , INTENT(in ), DIMENSION(3), OPTIONAL :: kcount ! number of points in each axis 1125 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! read data using XIOS1126 1134 ! 1127 1135 IF( kiomid > 0 ) THEN … … 1129 1137 CALL iom_get_123d( kiomid, kdom, cdvar , pv_r3d = pvar , ktime = ktime, & 1130 1138 & cd_type = cd_type, psgn = psgn , kfill = kfill, & 1131 & kstart = kstart , kcount = kcount , ldxios=ldxios)1139 & kstart = kstart , kcount = kcount ) 1132 1140 END IF 1133 1141 ENDIF … … 1137 1145 1138 1146 SUBROUTINE iom_get_123d( kiomid , kdom, cdvar, pv_r1d, pv_r2d, pv_r3d, ktime , & 1139 & cd_type, psgn, kfill, kstart, kcount , ldxios)1147 & cd_type, psgn, kfill, kstart, kcount ) 1140 1148 !!----------------------------------------------------------------------- 1141 1149 !! *** ROUTINE iom_get_123d *** … … 1157 1165 INTEGER , DIMENSION(:) , INTENT(in ), OPTIONAL :: kstart ! start position of the reading in each axis 1158 1166 INTEGER , DIMENSION(:) , INTENT(in ), OPTIONAL :: kcount ! number of points to be read in each axis 1159 LOGICAL , INTENT(in ), OPTIONAL :: ldxios ! use XIOS to read restart1160 1167 ! 1161 1168 LOGICAL :: llok ! true if ok! 1162 LOGICAL :: llxios ! local definition for XIOS read1163 1169 INTEGER :: jl ! loop on number of dimension 1164 1170 INTEGER :: idom ! type of domain … … 1187 1193 REAL(dp) :: gma, gmi 1188 1194 !--------------------------------------------------------------------- 1189 ! 1195 CHARACTER(LEN=lc) :: context 1196 ! 1197 CALL set_xios_context(kiomid, context) 1190 1198 inlev = -1 1191 1199 IF( PRESENT(pv_r3d) ) inlev = SIZE(pv_r3d, 3) 1192 1200 ! 1193 llxios = .FALSE.1194 IF( PRESENT(ldxios) ) llxios = ldxios1195 !1196 1201 idom = kdom 1197 1202 istop = nstop 1198 1203 ! 1199 IF( .NOT.llxios) THEN1204 IF(context == "NONE") THEN 1200 1205 clname = iom_file(kiomid)%name ! esier to read 1201 1206 clinfo = ' iom_get_123d, file: '//trim(clname)//', var: '//trim(cdvar) … … 1364 1369 #if defined key_iomput 1365 1370 !would be good to be able to check which context is active and swap only if current is not restart 1366 CALL iom_swap( TRIM(crxios_context) ) 1371 idvar = iom_varid( kiomid, cdvar ) 1372 CALL iom_swap(context) 1373 zsgn = 1._wp 1374 IF( PRESENT(psgn ) ) zsgn = psgn 1375 cl_type = 'T' 1376 IF( PRESENT(cd_type) ) cl_type = cd_type 1377 1367 1378 IF( PRESENT(pv_r3d) ) THEN 1368 1379 IF(lwp) WRITE(numout,*) 'XIOS RST READ (3D): ',TRIM(cdvar) 1369 CALL xios_recv_field( trim(cdvar), pv_r3d) 1370 IF(idom /= jpdom_unknown ) CALL lbc_lnk( 'iom', pv_r3d,'Z', -999., kfillmode = jpfillnothing) 1380 CALL xios_recv_field( trim(cdvar), pv_r3d(:, :, :)) 1381 IF(idom /= jpdom_unknown .AND. cl_type /= 'Z' ) THEN 1382 CALL lbc_lnk( 'iom', pv_r3d, cl_type, zsgn, kfillmode = kfill) 1383 ENDIF 1371 1384 ELSEIF( PRESENT(pv_r2d) ) THEN 1372 1385 IF(lwp) WRITE(numout,*) 'XIOS RST READ (2D): ', TRIM(cdvar) 1373 CALL xios_recv_field( trim(cdvar), pv_r2d) 1374 IF(idom /= jpdom_unknown ) CALL lbc_lnk('iom', pv_r2d,'Z',-999., kfillmode = jpfillnothing) 1386 CALL xios_recv_field( trim(cdvar), pv_r2d(:, :)) 1387 IF(idom /= jpdom_unknown .AND. cl_type /= 'Z' ) THEN 1388 CALL lbc_lnk('iom', pv_r2d, cl_type, zsgn, kfillmode = kfill) 1389 ENDIF 1375 1390 ELSEIF( PRESENT(pv_r1d) ) THEN 1376 1391 IF(lwp) WRITE(numout,*) 'XIOS RST READ (1D): ', TRIM(cdvar) 1377 1392 CALL xios_recv_field( trim(cdvar), pv_r1d) 1378 1393 ENDIF 1379 CALL iom_swap( TRIM(cxios_context))1394 CALL iom_swap(cxios_context) 1380 1395 #else 1381 1396 istop = istop + 1 … … 1392 1407 zofs = iom_file(kiomid)%ofs(idvar) ! offset 1393 1408 IF( PRESENT(pv_r1d) ) THEN 1394 IF( zscf /= 1. ) pv_r1d(:) = pv_r1d(:) * zscf1395 IF( zofs /= 0. ) pv_r1d(:) = pv_r1d(:) + zofs1409 IF( zscf /= 1._wp ) pv_r1d(:) = pv_r1d(:) * zscf 1410 IF( zofs /= 0._wp ) pv_r1d(:) = pv_r1d(:) + zofs 1396 1411 ELSEIF( PRESENT(pv_r2d) ) THEN 1397 IF( zscf /= 1. ) pv_r2d(:,:) = pv_r2d(:,:) * zscf1398 IF( zofs /= 0. ) pv_r2d(:,:) = pv_r2d(:,:) + zofs1412 IF( zscf /= 1._wp) pv_r2d(:,:) = pv_r2d(:,:) * zscf 1413 IF( zofs /= 0._wp) pv_r2d(:,:) = pv_r2d(:,:) + zofs 1399 1414 ELSEIF( PRESENT(pv_r3d) ) THEN 1400 IF( zscf /= 1. ) pv_r3d(:,:,:) = pv_r3d(:,:,:) * zscf1401 IF( zofs /= 0. ) pv_r3d(:,:,:) = pv_r3d(:,:,:) + zofs1415 IF( zscf /= 1._wp) pv_r3d(:,:,:) = pv_r3d(:,:,:) * zscf 1416 IF( zofs /= 0._wp) pv_r3d(:,:,:) = pv_r3d(:,:,:) + zofs 1402 1417 ENDIF 1403 1418 ! … … 1573 1588 !! INTERFACE iom_rstput 1574 1589 !!---------------------------------------------------------------------- 1575 SUBROUTINE iom_rp0d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1590 SUBROUTINE iom_rp0d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1576 1591 INTEGER , INTENT(in) :: kt ! ocean time-step 1577 1592 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1580 1595 REAL(sp) , INTENT(in) :: pvar ! written field 1581 1596 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1582 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1583 LOGICAL :: llx ! local xios write flag 1584 INTEGER :: ivid ! variable id 1585 1586 llx = .FALSE. 1587 IF(PRESENT(ldxios)) llx = ldxios 1597 ! 1598 LOGICAL :: llx ! local xios write flag 1599 INTEGER :: ivid ! variable id 1600 CHARACTER(LEN=lc) :: context 1601 ! 1602 CALL set_xios_context(kiomid, context) 1603 1604 llx = .NOT. (context == "NONE") 1605 1588 1606 IF( llx ) THEN 1589 1607 #ifdef key_iomput 1590 IF( kt == kwrite ) THEN 1591 IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar) 1592 CALL xios_send_field(trim(cdvar), pvar) 1593 ENDIF 1608 IF( kt == kwrite ) THEN 1609 IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar) 1610 CALL iom_swap(context) 1611 CALL iom_put(trim(cdvar), pvar) 1612 CALL iom_swap(cxios_context) 1613 ELSE 1614 IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar) 1615 CALL iom_swap(context) 1616 CALL iom_set_rstw_active( trim(cdvar), rs0 = pvar ) 1617 CALL iom_swap(cxios_context) 1618 ENDIF 1594 1619 #endif 1595 1620 ELSE … … 1603 1628 END SUBROUTINE iom_rp0d_sp 1604 1629 1605 SUBROUTINE iom_rp0d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1630 SUBROUTINE iom_rp0d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1606 1631 INTEGER , INTENT(in) :: kt ! ocean time-step 1607 1632 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1610 1635 REAL(dp) , INTENT(in) :: pvar ! written field 1611 1636 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1612 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1613 LOGICAL :: llx ! local xios write flag 1614 INTEGER :: ivid ! variable id 1615 1616 llx = .FALSE. 1617 IF(PRESENT(ldxios)) llx = ldxios 1637 ! 1638 LOGICAL :: llx ! local xios write flag 1639 INTEGER :: ivid ! variable id 1640 CHARACTER(LEN=lc) :: context 1641 ! 1642 CALL set_xios_context(kiomid, context) 1643 1644 llx = .NOT. (context == "NONE") 1645 1618 1646 IF( llx ) THEN 1619 1647 #ifdef key_iomput 1620 IF( kt == kwrite ) THEN 1621 IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar) 1622 CALL xios_send_field(trim(cdvar), pvar) 1623 ENDIF 1648 IF( kt == kwrite ) THEN 1649 IF(lwp) write(numout,*) 'RESTART: write (XIOS 0D) ',trim(cdvar) 1650 CALL iom_swap(context) 1651 CALL iom_put(trim(cdvar), pvar) 1652 CALL iom_swap(cxios_context) 1653 ELSE 1654 IF(lwp) write(numout,*) 'RESTART: define (XIOS 0D) ',trim(cdvar) 1655 CALL iom_swap(context) 1656 CALL iom_set_rstw_active( trim(cdvar), rd0 = pvar ) 1657 CALL iom_swap(cxios_context) 1658 ENDIF 1624 1659 #endif 1625 1660 ELSE … … 1634 1669 1635 1670 1636 SUBROUTINE iom_rp1d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1671 SUBROUTINE iom_rp1d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1637 1672 INTEGER , INTENT(in) :: kt ! ocean time-step 1638 1673 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1641 1676 REAL(sp) , INTENT(in), DIMENSION( :) :: pvar ! written field 1642 1677 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1643 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1644 LOGICAL :: llx ! local xios write flag 1645 INTEGER :: ivid ! variable id 1646 1647 llx = .FALSE. 1648 IF(PRESENT(ldxios)) llx = ldxios 1678 ! 1679 LOGICAL :: llx ! local xios write flag 1680 INTEGER :: ivid ! variable id 1681 CHARACTER(LEN=lc) :: context 1682 ! 1683 CALL set_xios_context(kiomid, context) 1684 1685 llx = .NOT. (context == "NONE") 1686 1649 1687 IF( llx ) THEN 1650 1688 #ifdef key_iomput 1651 IF( kt == kwrite ) THEN 1652 IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar) 1653 CALL xios_send_field(trim(cdvar), pvar) 1654 ENDIF 1689 IF( kt == kwrite ) THEN 1690 IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar) 1691 CALL iom_swap(context) 1692 CALL iom_put(trim(cdvar), pvar) 1693 CALL iom_swap(cxios_context) 1694 ELSE 1695 IF(lwp) write(numout,*) 'RESTART: define (XIOS 1D)',trim(cdvar) 1696 CALL iom_swap(context) 1697 CALL iom_set_rstw_active( trim(cdvar), rs1 = pvar ) 1698 CALL iom_swap(cxios_context) 1699 ENDIF 1655 1700 #endif 1656 1701 ELSE … … 1664 1709 END SUBROUTINE iom_rp1d_sp 1665 1710 1666 SUBROUTINE iom_rp1d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1711 SUBROUTINE iom_rp1d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1667 1712 INTEGER , INTENT(in) :: kt ! ocean time-step 1668 1713 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1671 1716 REAL(dp) , INTENT(in), DIMENSION( :) :: pvar ! written field 1672 1717 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1673 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1674 LOGICAL :: llx ! local xios write flag 1675 INTEGER :: ivid ! variable id 1676 1677 llx = .FALSE. 1678 IF(PRESENT(ldxios)) llx = ldxios 1718 ! 1719 LOGICAL :: llx ! local xios write flag 1720 INTEGER :: ivid ! variable id 1721 CHARACTER(LEN=lc) :: context 1722 ! 1723 CALL set_xios_context(kiomid, context) 1724 1725 llx = .NOT. (context == "NONE") 1726 1679 1727 IF( llx ) THEN 1680 1728 #ifdef key_iomput 1681 IF( kt == kwrite ) THEN 1682 IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar) 1683 CALL xios_send_field(trim(cdvar), pvar) 1684 ENDIF 1729 IF( kt == kwrite ) THEN 1730 IF(lwp) write(numout,*) 'RESTART: write (XIOS 1D) ',trim(cdvar) 1731 CALL iom_swap(context) 1732 CALL iom_put(trim(cdvar), pvar) 1733 CALL iom_swap(cxios_context) 1734 ELSE 1735 IF(lwp) write(numout,*) 'RESTART: define (XIOS 1D)',trim(cdvar) 1736 CALL iom_swap(context) 1737 CALL iom_set_rstw_active( trim(cdvar), rd1 = pvar ) 1738 CALL iom_swap(cxios_context) 1739 ENDIF 1685 1740 #endif 1686 1741 ELSE … … 1695 1750 1696 1751 1697 SUBROUTINE iom_rp2d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1752 SUBROUTINE iom_rp2d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1698 1753 INTEGER , INTENT(in) :: kt ! ocean time-step 1699 1754 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1702 1757 REAL(sp) , INTENT(in), DIMENSION(:, : ) :: pvar ! written field 1703 1758 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1704 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1705 LOGICAL :: llx 1706 INTEGER :: ivid ! variable id 1707 1708 llx = .FALSE. 1709 IF(PRESENT(ldxios)) llx = ldxios 1759 ! 1760 LOGICAL :: llx 1761 INTEGER :: ivid ! variable id 1762 CHARACTER(LEN=lc) :: context 1763 ! 1764 CALL set_xios_context(kiomid, context) 1765 1766 llx = .NOT. (context == "NONE") 1767 1710 1768 IF( llx ) THEN 1711 1769 #ifdef key_iomput 1712 IF( kt == kwrite ) THEN 1713 IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar) 1714 CALL xios_send_field(trim(cdvar), pvar) 1715 ENDIF 1770 IF( kt == kwrite ) THEN 1771 IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar) 1772 CALL iom_swap(context) 1773 CALL iom_put(trim(cdvar), pvar) 1774 CALL iom_swap(cxios_context) 1775 ELSE 1776 IF(lwp) write(numout,*) 'RESTART: define (XIOS 2D)',trim(cdvar) 1777 CALL iom_swap(context) 1778 CALL iom_set_rstw_active( trim(cdvar), rs2 = pvar ) 1779 CALL iom_swap(cxios_context) 1780 ENDIF 1716 1781 #endif 1717 1782 ELSE … … 1725 1790 END SUBROUTINE iom_rp2d_sp 1726 1791 1727 SUBROUTINE iom_rp2d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1792 SUBROUTINE iom_rp2d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1728 1793 INTEGER , INTENT(in) :: kt ! ocean time-step 1729 1794 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1732 1797 REAL(dp) , INTENT(in), DIMENSION(:, : ) :: pvar ! written field 1733 1798 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1734 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1735 LOGICAL :: llx 1736 INTEGER :: ivid ! variable id 1737 1738 llx = .FALSE. 1739 IF(PRESENT(ldxios)) llx = ldxios 1799 ! 1800 LOGICAL :: llx 1801 INTEGER :: ivid ! variable id 1802 CHARACTER(LEN=lc) :: context 1803 ! 1804 CALL set_xios_context(kiomid, context) 1805 1806 llx = .NOT. (context == "NONE") 1807 1740 1808 IF( llx ) THEN 1741 1809 #ifdef key_iomput 1742 IF( kt == kwrite ) THEN 1743 IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar) 1744 CALL xios_send_field(trim(cdvar), pvar) 1745 ENDIF 1810 IF( kt == kwrite ) THEN 1811 IF(lwp) write(numout,*) 'RESTART: write (XIOS 2D) ',trim(cdvar) 1812 CALL iom_swap(context) 1813 CALL iom_put(trim(cdvar), pvar) 1814 CALL iom_swap(cxios_context) 1815 ELSE 1816 IF(lwp) write(numout,*) 'RESTART: define (XIOS 2D)',trim(cdvar) 1817 CALL iom_swap(context) 1818 CALL iom_set_rstw_active( trim(cdvar), rd2 = pvar ) 1819 CALL iom_swap(cxios_context) 1820 ENDIF 1746 1821 #endif 1747 1822 ELSE … … 1756 1831 1757 1832 1758 SUBROUTINE iom_rp3d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1833 SUBROUTINE iom_rp3d_sp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1759 1834 INTEGER , INTENT(in) :: kt ! ocean time-step 1760 1835 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1763 1838 REAL(sp) , INTENT(in), DIMENSION(:,:,:) :: pvar ! written field 1764 1839 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1765 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1766 LOGICAL :: llx ! local xios write flag 1767 INTEGER :: ivid ! variable id 1768 1769 llx = .FALSE. 1770 IF(PRESENT(ldxios)) llx = ldxios 1840 ! 1841 LOGICAL :: llx ! local xios write flag 1842 INTEGER :: ivid ! variable id 1843 CHARACTER(LEN=lc) :: context 1844 ! 1845 CALL set_xios_context(kiomid, context) 1846 1847 llx = .NOT. (context == "NONE") 1848 1771 1849 IF( llx ) THEN 1772 1850 #ifdef key_iomput 1773 IF( kt == kwrite ) THEN 1774 IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar) 1775 CALL xios_send_field(trim(cdvar), pvar) 1776 ENDIF 1851 IF( kt == kwrite ) THEN 1852 IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar) 1853 CALL iom_swap(context) 1854 CALL iom_put(trim(cdvar), pvar) 1855 CALL iom_swap(cxios_context) 1856 ELSE 1857 IF(lwp) write(numout,*) 'RESTART: define (XIOS 3D)',trim(cdvar) 1858 CALL iom_swap(context) 1859 CALL iom_set_rstw_active( trim(cdvar), rs3 = pvar ) 1860 CALL iom_swap(cxios_context) 1861 ENDIF 1777 1862 #endif 1778 1863 ELSE … … 1786 1871 END SUBROUTINE iom_rp3d_sp 1787 1872 1788 SUBROUTINE iom_rp3d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype , ldxios)1873 SUBROUTINE iom_rp3d_dp( kt, kwrite, kiomid, cdvar, pvar, ktype ) 1789 1874 INTEGER , INTENT(in) :: kt ! ocean time-step 1790 1875 INTEGER , INTENT(in) :: kwrite ! writing time-step … … 1793 1878 REAL(dp) , INTENT(in), DIMENSION(:,:,:) :: pvar ! written field 1794 1879 INTEGER , INTENT(in), OPTIONAL :: ktype ! variable external type 1795 LOGICAL, OPTIONAL :: ldxios ! xios write flag 1796 LOGICAL :: llx ! local xios write flag 1797 INTEGER :: ivid ! variable id 1798 1799 llx = .FALSE. 1800 IF(PRESENT(ldxios)) llx = ldxios 1880 ! 1881 LOGICAL :: llx ! local xios write flag 1882 INTEGER :: ivid ! variable id 1883 CHARACTER(LEN=lc) :: context 1884 ! 1885 CALL set_xios_context(kiomid, context) 1886 1887 llx = .NOT. (context == "NONE") 1888 1801 1889 IF( llx ) THEN 1802 1890 #ifdef key_iomput 1803 IF( kt == kwrite ) THEN 1804 IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar) 1805 CALL xios_send_field(trim(cdvar), pvar) 1806 ENDIF 1891 IF( kt == kwrite ) THEN 1892 IF(lwp) write(numout,*) 'RESTART: write (XIOS 3D) ',trim(cdvar) 1893 CALL iom_swap(context) 1894 CALL iom_put(trim(cdvar), pvar) 1895 CALL iom_swap(cxios_context) 1896 ELSE 1897 IF(lwp) write(numout,*) 'RESTART: define (XIOS 3D)',trim(cdvar) 1898 CALL iom_swap(context) 1899 CALL iom_set_rstw_active( trim(cdvar), rd3 = pvar ) 1900 CALL iom_swap(cxios_context) 1901 ENDIF 1807 1902 #endif 1808 1903 ELSE … … 2150 2245 CALL iom_swap( cdname ) ! swap to cdname context 2151 2246 CALL xios_update_calendar(kt) 2152 IF( cdname /= TRIM(cxios_context) ) CALL iom_swap( TRIM(cxios_context)) ! return back to nemo context2247 IF( cdname /= TRIM(cxios_context) ) CALL iom_swap( cxios_context ) ! return back to nemo context 2153 2248 END SUBROUTINE iom_setkt 2154 2249 … … 2164 2259 CALL iom_swap( cdname ) ! swap to cdname context 2165 2260 CALL xios_context_finalize() ! finalize the context 2166 IF( cdname /= TRIM(cxios_context) ) CALL iom_swap( TRIM(cxios_context)) ! return back to nemo context2261 IF( cdname /= cxios_context ) CALL iom_swap( cxios_context ) ! return back to nemo context 2167 2262 ENDIF 2168 2263 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/IOM/iom_def.F90
r13998 r14018 9 9 !!---------------------------------------------------------------------- 10 10 USE par_kind 11 USE netcdf 11 12 12 13 IMPLICIT NONE … … 36 37 INTEGER, PUBLIC :: nxioso = 0 !: type of restart file when writing using XIOS 1 - single, 2 - multiple 37 38 !XIOS read restart 38 LOGICAL, PUBLIC :: lrxios = .FALSE. !: read single file restart using XIOS 39 LOGICAL, PUBLIC :: lrxios = .FALSE. !: read single file restart using XIOS main switch 39 40 LOGICAL, PUBLIC :: lxios_sini = .FALSE. ! is restart in a single file 40 LOGICAL, PUBLIC :: lxios_set = .FALSE. 41 42 41 43 42 44 TYPE, PUBLIC :: file_descriptor … … 59 61 END TYPE file_descriptor 60 62 TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC :: iom_file !: array containing the info for all opened files 61 INTEGER, PARAMETER, PUBLIC :: max_rst_fields = 95 !: maximum number of restart variables defined in iom_set_rst_vars62 TYPE, PUBLIC :: RST_FIELD63 CHARACTER(len=30) :: vname = "NO_NAME" ! names of variables in restart file64 CHARACTER(len=30) :: grid = "NO_GRID"65 LOGICAL :: active =.FALSE. ! for restart write only: true - write field, false do not write field66 END TYPE RST_FIELD67 63 !$AGRIF_END_DO_NOT_TREAT 68 !69 TYPE(RST_FIELD), PUBLIC, SAVE :: rst_wfields(max_rst_fields), rst_rfields(max_rst_fields)70 64 ! 71 65 !! * Substitutions -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/IOM/iom_nf90.F90
r13286 r14018 31 31 PUBLIC iom_nf90_open , iom_nf90_close, iom_nf90_varid, iom_nf90_get, iom_nf90_rstput 32 32 PUBLIC iom_nf90_chkatt, iom_nf90_getatt, iom_nf90_putatt 33 PUBLIC iom_nf90_check 33 34 34 35 INTERFACE iom_nf90_get -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/IOM/restart.F90
r13895 r14018 111 111 ELSE 112 112 #if defined key_iomput 113 cw xios_context = "rstw_"//TRIM(ADJUSTL(clkt))113 cw_ocerst_cxt = "rstw_"//TRIM(ADJUSTL(clkt)) 114 114 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 115 115 clpname = clname … … 117 117 clpname = TRIM(Agrif_CFixed())//"_"//clname 118 118 ENDIF 119 CALL iom_init( cwxios_context, TRIM(clpath)//TRIM(clpname), .false.)120 CALL xios_update_calendar(nitrst)119 numrow = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 120 CALL iom_init( cw_ocerst_cxt, kdid = numrow, ld_closedef = .false. ) 121 121 CALL iom_swap( cxios_context ) 122 122 #else … … 147 147 INTEGER, INTENT(in) :: Kbb, Kmm ! ocean time level indices 148 148 !!---------------------------------------------------------------------- 149 IF(lwxios) CALL iom_swap( cwxios_context ) 150 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rn_Dt , ldxios = lwxios) ! dynamics time step 151 CALL iom_delay_rst( 'WRITE', 'OCE', numrow ) ! save only ocean delayed global communication variables 149 CALL iom_rstput( kt, nitrst, numrow, 'rdt' , rn_Dt ) ! dynamics time step 150 IF(.NOT.lwxios) CALL iom_delay_rst( 'WRITE', 'OCE', numrow ) ! save only ocean delayed global communication variables 152 151 153 152 IF ( .NOT. ln_diurnal_only ) THEN 154 CALL iom_rstput( kt, nitrst, numrow, 'ub' , uu(:,:,: ,Kbb) , ldxios = lwxios) ! before fields155 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vv(:,:,: ,Kbb) , ldxios = lwxios)156 CALL iom_rstput( kt, nitrst, numrow, 'tb' , ts(:,:,:,jp_tem,Kbb) , ldxios = lwxios)157 CALL iom_rstput( kt, nitrst, numrow, 'sb' , ts(:,:,:,jp_sal,Kbb) , ldxios = lwxios)158 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , ssh(:,: ,Kbb), ldxios = lwxios)153 CALL iom_rstput( kt, nitrst, numrow, 'ub' , uu(:,:,: ,Kbb) ) ! before fields 154 CALL iom_rstput( kt, nitrst, numrow, 'vb' , vv(:,:,: ,Kbb) ) 155 CALL iom_rstput( kt, nitrst, numrow, 'tb' , ts(:,:,:,jp_tem,Kbb) ) 156 CALL iom_rstput( kt, nitrst, numrow, 'sb' , ts(:,:,:,jp_sal,Kbb) ) 157 CALL iom_rstput( kt, nitrst, numrow, 'sshb' , ssh(:,: ,Kbb)) 159 158 ! 160 CALL iom_rstput( kt, nitrst, numrow, 'un' , uu(:,:,: ,Kmm) , ldxios = lwxios) ! now fields161 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vv(:,:,: ,Kmm) , ldxios = lwxios)162 CALL iom_rstput( kt, nitrst, numrow, 'tn' , ts(:,:,:,jp_tem,Kmm) , ldxios = lwxios)163 CALL iom_rstput( kt, nitrst, numrow, 'sn' , ts(:,:,:,jp_sal,Kmm) , ldxios = lwxios)164 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , ssh(:,: ,Kmm), ldxios = lwxios)165 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop , ldxios = lwxios)159 CALL iom_rstput( kt, nitrst, numrow, 'un' , uu(:,:,: ,Kmm) ) ! now fields 160 CALL iom_rstput( kt, nitrst, numrow, 'vn' , vv(:,:,: ,Kmm) ) 161 CALL iom_rstput( kt, nitrst, numrow, 'tn' , ts(:,:,:,jp_tem,Kmm) ) 162 CALL iom_rstput( kt, nitrst, numrow, 'sn' , ts(:,:,:,jp_sal,Kmm) ) 163 CALL iom_rstput( kt, nitrst, numrow, 'sshn' , ssh(:,: ,Kmm)) 164 CALL iom_rstput( kt, nitrst, numrow, 'rhop' , rhop ) 166 165 ENDIF 167 166 168 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst, ldxios = lwxios ) 169 IF(lwxios) CALL iom_swap( cxios_context ) 167 IF (ln_diurnal) CALL iom_rstput( kt, nitrst, numrow, 'Dsst', x_dsst ) 170 168 IF( kt == nitrst ) THEN 171 169 IF(.NOT.lwxios) THEN 172 170 CALL iom_close( numrow ) ! close the restart file (only at last time step) 173 171 ELSE 174 CALL iom_context_finalize( cwxios_context ) 172 CALL iom_context_finalize( cw_ocerst_cxt ) 173 iom_file(numrow)%nfid = 0 174 numrow = 0 175 175 ENDIF 176 176 !!gm IF( .NOT. lk_trdmld ) lrst_oce = .FALSE. … … 195 195 !! the file has already been opened 196 196 !!---------------------------------------------------------------------- 197 LOGICAL :: llok 198 CHARACTER(lc) :: clpath ! full path to ocean output restart file 197 LOGICAL :: llok 198 CHARACTER(len=lc) :: clpath ! full path to ocean output restart file 199 CHARACTER(len=lc+2) :: clpname ! file name including agrif prefix 199 200 !!---------------------------------------------------------------------- 200 201 ! … … 213 214 ! can handle checking if variable is in the restart file (there will be no need to open 214 215 ! restart) 215 IF( .NOT.lxios_set )lrxios = lrxios.AND.lxios_sini216 IF( lrxios ) THEN 217 crxios_context = 'nemo_rst'218 IF( .NOT.lxios_set ) THEN219 220 CALL iom_init( crxios_context ) 221 lxios_set = .TRUE. 222 ENDIF 223 ENDIF 224 IF( TRIM(Agrif_CFixed()) /= '0' .AND. lrxios ) THEN 225 CALL iom_init( cr xios_context)226 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for AGRIF'227 lxios_set = .TRUE.228 ENDIF 216 lrxios = lrxios.AND.lxios_sini 217 218 IF( lrxios) THEN 219 cr_ocerst_cxt = 'oce_rst' 220 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS' 221 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 222 ! clpname = cn_ocerst_in 223 ! ELSE 224 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_ocerst_in 225 ! ENDIF 226 CALL iom_init( cr_ocerst_cxt, kdid = numror, ld_closedef = .TRUE. ) 227 CALL iom_swap( cxios_context ) 228 ENDIF 229 229 230 ENDIF 230 231 … … 252 253 !!---------------------------------------------------------------------- 253 254 ! 254 CALL iom_delay_rst( 'READ', 'OCE', numror ) ! read only ocean delayed global communication variables255 IF(.NOT.lrxios ) CALL iom_delay_rst( 'READ', 'OCE', numror ) ! read only ocean delayed global communication variables 255 256 ! 256 257 ! !* Diurnal DSST 257 IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst , ldxios = lrxios)258 IF( ln_diurnal ) CALL iom_get( numror, jpdom_auto, 'Dsst' , x_dsst ) 258 259 IF ( ln_diurnal_only ) THEN 259 260 IF(lwp) WRITE( numout, * ) & 260 261 & "rst_read:- ln_diurnal_only set, setting rhop=rho0" 261 262 rhop = rho0 262 CALL iom_get( numror, jpdom_auto, 'tn' , w3d , ldxios = lrxios)263 CALL iom_get( numror, jpdom_auto, 'tn' , w3d ) 263 264 ts(:,:,1,jp_tem,Kmm) = w3d(:,:,1) 264 265 RETURN … … 267 268 ! !* Read Kmm fields 268 269 IF(lwp) WRITE(numout,*) ' Kmm u, v and T-S fields read in the restart file' 269 CALL iom_get( numror, jpdom_auto, 'un' , uu(:,:,: ,Kmm), ldxios = lrxios,cd_type = 'U', psgn = -1._wp )270 CALL iom_get( numror, jpdom_auto, 'vn' , vv(:,:,: ,Kmm), ldxios = lrxios,cd_type = 'V', psgn = -1._wp )271 CALL iom_get( numror, jpdom_auto, 'tn' , ts(:,:,:,jp_tem,Kmm) , ldxios = lrxios)272 CALL iom_get( numror, jpdom_auto, 'sn' , ts(:,:,:,jp_sal,Kmm) , ldxios = lrxios)270 CALL iom_get( numror, jpdom_auto, 'un' , uu(:,:,: ,Kmm), cd_type = 'U', psgn = -1._wp ) 271 CALL iom_get( numror, jpdom_auto, 'vn' , vv(:,:,: ,Kmm), cd_type = 'V', psgn = -1._wp ) 272 CALL iom_get( numror, jpdom_auto, 'tn' , ts(:,:,:,jp_tem,Kmm) ) 273 CALL iom_get( numror, jpdom_auto, 'sn' , ts(:,:,:,jp_sal,Kmm) ) 273 274 ! 274 275 IF( l_1st_euler ) THEN !* Euler restart … … 279 280 ELSE !* Leap frog restart 280 281 IF(lwp) WRITE(numout,*) ' Kbb u, v and T-S fields read in the restart file' 281 CALL iom_get( numror, jpdom_auto, 'ub' , uu(:,:,: ,Kbb), ldxios = lrxios,cd_type = 'U', psgn = -1._wp )282 CALL iom_get( numror, jpdom_auto, 'vb' , vv(:,:,: ,Kbb), ldxios = lrxios,cd_type = 'V', psgn = -1._wp )283 CALL iom_get( numror, jpdom_auto, 'tb' , ts(:,:,:,jp_tem,Kbb) , ldxios = lrxios)284 CALL iom_get( numror, jpdom_auto, 'sb' , ts(:,:,:,jp_sal,Kbb) , ldxios = lrxios)282 CALL iom_get( numror, jpdom_auto, 'ub' , uu(:,:,: ,Kbb), cd_type = 'U', psgn = -1._wp ) 283 CALL iom_get( numror, jpdom_auto, 'vb' , vv(:,:,: ,Kbb), cd_type = 'V', psgn = -1._wp ) 284 CALL iom_get( numror, jpdom_auto, 'tb' , ts(:,:,:,jp_tem,Kbb) ) 285 CALL iom_get( numror, jpdom_auto, 'sb' , ts(:,:,:,jp_sal,Kbb) ) 285 286 ENDIF 286 287 ! 287 288 IF( iom_varid( numror, 'rhop', ldstop = .FALSE. ) > 0 ) THEN 288 CALL iom_get( numror, jpdom_auto, 'rhop' , rhop , ldxios = lrxios) ! now potential density289 CALL iom_get( numror, jpdom_auto, 'rhop' , rhop ) ! now potential density 289 290 ELSE 290 291 CALL eos( ts(:,:,:,:,Kmm), rhd, rhop, gdept(:,:,:,Kmm) ) -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ISF/isfcav.F90
r13226 r14018 183 183 ! cavity mask 184 184 mskisf_cav(:,:) = (1._wp - tmask(:,:,1)) * ssmask(:,:) 185 ! 186 !================ 187 ! 2: read restart 185 !================ 186 ! 2: activate restart 187 !================ 188 ! 189 !================ 190 ! 3: read restart 188 191 !================ 189 192 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ISF/isfcpl.F90
r13895 r14018 120 120 e3t(:,:,:,Kbb) = e3t(:,:,:,Kmm) 121 121 #endif 122 ! prepare writing restart123 IF( lwxios ) THEN124 CALL iom_set_rstw_var_active('ssmask')125 CALL iom_set_rstw_var_active('tmask')126 CALL iom_set_rstw_var_active('e3t_n')127 CALL iom_set_rstw_var_active('e3u_n')128 CALL iom_set_rstw_var_active('e3v_n')129 END IF130 !131 122 END SUBROUTINE isfcpl_init 132 123 … … 154 145 END DO 155 146 ! 156 IF( lwxios ) CALL iom_swap( cwxios_context ) 157 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask , ldxios = lwxios ) 158 CALL iom_rstput( kt, nitrst, numrow, 'ssmask' , ssmask, ldxios = lwxios ) 159 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n' , ze3t , ldxios = lwxios ) 160 CALL iom_rstput( kt, nitrst, numrow, 'e3u_n' , ze3u , ldxios = lwxios ) 161 CALL iom_rstput( kt, nitrst, numrow, 'e3v_n' , ze3v , ldxios = lwxios ) 162 CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', zgdepw , ldxios = lwxios ) 163 IF( lwxios ) CALL iom_swap( cxios_context ) 147 CALL iom_rstput( kt, nitrst, numrow, 'tmask' , tmask ) 148 CALL iom_rstput( kt, nitrst, numrow, 'ssmask' , ssmask ) 149 CALL iom_rstput( kt, nitrst, numrow, 'e3t_n' , ze3t ) 150 CALL iom_rstput( kt, nitrst, numrow, 'e3u_n' , ze3u ) 151 CALL iom_rstput( kt, nitrst, numrow, 'e3v_n' , ze3v ) 152 CALL iom_rstput( kt, nitrst, numrow, 'gdepw_n', zgdepw ) 164 153 ! 165 154 END SUBROUTINE isfcpl_rst_write … … 185 174 !!---------------------------------------------------------------------- 186 175 ! 187 CALL iom_get( numror, jpdom_auto, 'ssmask' , zssmask_b , ldxios = lrxios) ! need to extrapolate T/S176 CALL iom_get( numror, jpdom_auto, 'ssmask' , zssmask_b ) ! need to extrapolate T/S 188 177 189 178 ! compute new ssh if we open a full water column … … 267 256 !!---------------------------------------------------------------------- 268 257 ! 269 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b , ldxios = lrxios) ! need to extrapolate T/S270 !CALL iom_get( numror, jpdom_auto, 'wmask' , zwmask_b , ldxios = lrxios) ! need to extrapolate T/S271 !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:) , ldxios = lrxios) ! need to interpol vertical profile (vvl)258 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b ) ! need to extrapolate T/S 259 !CALL iom_get( numror, jpdom_auto, 'wmask' , zwmask_b ) ! need to extrapolate T/S 260 !CALL iom_get( numror, jpdom_auto, 'gdepw_n', zdepw_b(:,:,:) ) ! need to interpol vertical profile (vvl) 272 261 ! 273 262 ! … … 414 403 !!---------------------------------------------------------------------- 415 404 ! 416 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b , ldxios = lrxios)417 CALL iom_get( numror, jpdom_auto, 'e3u_n' , ze3u_b , ldxios = lrxios)418 CALL iom_get( numror, jpdom_auto, 'e3v_n' , ze3v_b , ldxios = lrxios)405 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b ) 406 CALL iom_get( numror, jpdom_auto, 'e3u_n' , ze3u_b ) 407 CALL iom_get( numror, jpdom_auto, 'e3v_n' , ze3v_b ) 419 408 ! 420 409 ! 1.0: compute horizontal volume flux divergence difference before-after coupling … … 525 514 526 515 ! get restart variable 527 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b(:,:,:) , ldxios = lrxios) ! need to extrapolate T/S528 CALL iom_get( numror, jpdom_auto, 'e3t_n' , ze3t_b(:,:,:) , ldxios = lrxios)529 CALL iom_get( numror, jpdom_auto, 'tn' , zt_b(:,:,:) , ldxios = lrxios)530 CALL iom_get( numror, jpdom_auto, 'sn' , zs_b(:,:,:) , ldxios = lrxios)516 CALL iom_get( numror, jpdom_auto, 'tmask' , ztmask_b(:,:,:) ) ! need to extrapolate T/S 517 CALL iom_get( numror, jpdom_auto, 'e3t_n' , ze3t_b(:,:,:) ) 518 CALL iom_get( numror, jpdom_auto, 'tn' , zt_b(:,:,:) ) 519 CALL iom_get( numror, jpdom_auto, 'sn' , zs_b(:,:,:) ) 531 520 532 521 ! compute run length -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ISF/isfrst.F90
r13895 r14018 53 53 IF( .NOT.l_1st_euler ) THEN 54 54 IF(lwp) WRITE(numout,*) ' nit000-1 isf tracer content forcing fields read in the restart file' 55 CALL iom_get( numror, jpdom_auto, cfwf_b, pfwf_b(:,:) , ldxios = lrxios) ! before ice shelf melt56 CALL iom_get( numror, jpdom_auto, chc_b , ptsc_b (:,:,jp_tem) , ldxios = lrxios) ! before ice shelf heat flux57 CALL iom_get( numror, jpdom_auto, csc_b , ptsc_b (:,:,jp_sal) , ldxios = lrxios) ! before ice shelf heat flux55 CALL iom_get( numror, jpdom_auto, cfwf_b, pfwf_b(:,:) ) ! before ice shelf melt 56 CALL iom_get( numror, jpdom_auto, chc_b , ptsc_b (:,:,jp_tem) ) ! before ice shelf heat flux 57 CALL iom_get( numror, jpdom_auto, csc_b , ptsc_b (:,:,jp_sal) ) ! before ice shelf heat flux 58 58 ELSE 59 59 pfwf_b(:,:) = pfwf(:,:) 60 60 ptsc_b(:,:,:) = ptsc(:,:,:) 61 ENDIF62 !63 IF( lwxios ) THEN64 CALL iom_set_rstw_var_active( TRIM(chc_b ) )65 CALL iom_set_rstw_var_active( TRIM(csc_b ) )66 CALL iom_set_rstw_var_active( TRIM(cfwf_b) )67 61 ENDIF 68 62 ! … … 96 90 ! 97 91 ! write restart variable 98 IF( lwxios ) CALL iom_swap( cwxios_context ) 99 CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:) , ldxios = lwxios ) 100 CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem), ldxios = lwxios ) 101 CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal), ldxios = lwxios ) 102 IF( lwxios ) CALL iom_swap( cxios_context ) 92 CALL iom_rstput( kt, nitrst, numrow, cfwf_b, pfwf(:,:) ) 93 CALL iom_rstput( kt, nitrst, numrow, chc_b , ptsc(:,:,jp_tem) ) 94 CALL iom_rstput( kt, nitrst, numrow, csc_b , ptsc(:,:,jp_sal) ) 103 95 ! 104 96 END SUBROUTINE isfrst_write -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/SBC/sbcapr.F90
r13895 r14018 65 65 CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files 66 66 TYPE(FLD_N) :: sn_apr ! informations about the fields to be read 67 LOGICAL :: lrxios ! read restart using XIOS?68 67 !! 69 68 NAMELIST/namsbc_apr/ cn_dir, sn_apr, ln_ref_apr, rn_pref, ln_apr_obc … … 108 107 CALL ctl_warn( 'sbc_apr: use inverse barometer ssh at open boundary ONLY requires ln_apr_dyn=T' ) 109 108 ! 110 IF( lwxios ) THEN111 CALL iom_set_rstw_var_active('ssh_ibb')112 ENDIF113 109 END SUBROUTINE sbc_apr_init 114 110 … … 154 150 IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN 155 151 IF(lwp) WRITE(numout,*) 'sbc_apr: ssh_ibb read in the restart file' 156 CALL iom_get( numror, jpdom_auto, 'ssh_ibb', ssh_ibb , ldxios = lrxios) ! before inv. barometer ssh152 CALL iom_get( numror, jpdom_auto, 'ssh_ibb', ssh_ibb ) ! before inv. barometer ssh 157 153 ! 158 154 ELSE !* no restart: set from nit000 values … … 167 163 IF(lwp) WRITE(numout,*) 'sbc_apr : ssh_ib written in ocean restart file at it= ', kt,' date= ', ndastp 168 164 IF(lwp) WRITE(numout,*) '~~~~' 169 IF( lwxios ) CALL iom_swap( cwxios_context ) 170 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib, ldxios = lwxios ) 171 IF( lwxios ) CALL iom_swap( cxios_context ) 165 CALL iom_rstput( kt, nitrst, numrow, 'ssh_ibb' , ssh_ib ) 172 166 ENDIF 173 167 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/SBC/sbcmod.F90
r13998 r14018 359 359 IF( ln_wave ) CALL sbc_wave_init ! surface wave initialisation 360 360 ! 361 IF( lwxios ) THEN362 CALL iom_set_rstw_var_active('utau_b')363 CALL iom_set_rstw_var_active('vtau_b')364 CALL iom_set_rstw_var_active('qns_b')365 ! The 3D heat content due to qsr forcing is treated in traqsr366 ! CALL iom_set_rstw_var_active('qsr_b')367 CALL iom_set_rstw_var_active('emp_b')368 CALL iom_set_rstw_var_active('sfx_b')369 ENDIF370 371 361 END SUBROUTINE sbc_init 372 362 … … 509 499 IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN !* Restart: read in restart file 510 500 IF(lwp) WRITE(numout,*) ' nit000-1 surface forcing fields read in the restart file' 511 CALL iom_get( numror, jpdom_auto, 'utau_b', utau_b , ldxios = lrxios, cd_type = 'U', psgn = -1._wp) ! i-stress512 CALL iom_get( numror, jpdom_auto, 'vtau_b', vtau_b , ldxios = lrxios, cd_type = 'V', psgn = -1._wp) ! j-stress513 CALL iom_get( numror, jpdom_auto, 'qns_b', qns_b , ldxios = lrxios) ! non solar heat flux514 CALL iom_get( numror, jpdom_auto, 'emp_b', emp_b , ldxios = lrxios) ! freshwater flux501 CALL iom_get( numror, jpdom_auto, 'utau_b', utau_b ) ! i-stress 502 CALL iom_get( numror, jpdom_auto, 'vtau_b', vtau_b ) ! j-stress 503 CALL iom_get( numror, jpdom_auto, 'qns_b', qns_b ) ! non solar heat flux 504 CALL iom_get( numror, jpdom_auto, 'emp_b', emp_b ) ! freshwater flux 515 505 ! NB: The 3D heat content due to qsr forcing (qsr_hc_b) is treated in traqsr 516 506 ! To ensure restart capability with 3.3x/3.4 restart files !! to be removed in v3.6 517 507 IF( iom_varid( numror, 'sfx_b', ldstop = .FALSE. ) > 0 ) THEN 518 CALL iom_get( numror, jpdom_auto, 'sfx_b', sfx_b , ldxios = lrxios) ! before salt flux (T-point)508 CALL iom_get( numror, jpdom_auto, 'sfx_b', sfx_b ) ! before salt flux (T-point) 519 509 ELSE 520 510 sfx_b (:,:) = sfx(:,:) … … 536 526 & 'at it= ', kt,' date= ', ndastp 537 527 IF(lwp) WRITE(numout,*) '~~~~' 538 IF( lwxios ) CALL iom_swap( cwxios_context ) 539 CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau, ldxios = lwxios ) 540 CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau, ldxios = lwxios ) 541 CALL iom_rstput( kt, nitrst, numrow, 'qns_b' , qns, ldxios = lwxios ) 528 CALL iom_rstput( kt, nitrst, numrow, 'utau_b' , utau ) 529 CALL iom_rstput( kt, nitrst, numrow, 'vtau_b' , vtau ) 530 CALL iom_rstput( kt, nitrst, numrow, 'qns_b' , qns ) 542 531 ! The 3D heat content due to qsr forcing is treated in traqsr 543 532 ! CALL iom_rstput( kt, nitrst, numrow, 'qsr_b' , qsr ) 544 CALL iom_rstput( kt, nitrst, numrow, 'emp_b' , emp, ldxios = lwxios ) 545 CALL iom_rstput( kt, nitrst, numrow, 'sfx_b' , sfx, ldxios = lwxios ) 546 IF( lwxios ) CALL iom_swap( cxios_context ) 533 CALL iom_rstput( kt, nitrst, numrow, 'emp_b' , emp ) 534 CALL iom_rstput( kt, nitrst, numrow, 'sfx_b' , sfx ) 547 535 ENDIF 548 536 ! ! ---------------------------------------- ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/SBC/sbcrnf.F90
r13998 r14018 159 159 IF( ln_rstart .AND. .NOT.l_1st_euler ) THEN !* Restart: read in restart file 160 160 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields red in the restart file', lrxios 161 CALL iom_get( numror, jpdom_auto, 'rnf_b' , rnf_b , ldxios = lrxios) ! before runoff162 CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem) , ldxios = lrxios) ! before heat content of runoff163 CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal) , ldxios = lrxios) ! before salinity content of runoff161 CALL iom_get( numror, jpdom_auto, 'rnf_b' , rnf_b ) ! before runoff 162 CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem) ) ! before heat content of runoff 163 CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal) ) ! before salinity content of runoff 164 164 ELSE !* no restart: set from nit000 values 165 165 IF(lwp) WRITE(numout,*) ' nit000-1 runoff forcing fields set to nit000' … … 175 175 & 'at it= ', kt,' date= ', ndastp 176 176 IF(lwp) WRITE(numout,*) '~~~~' 177 IF( lwxios ) CALL iom_swap( cwxios_context ) 178 CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf , ldxios = lwxios ) 179 CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem), ldxios = lwxios ) 180 CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal), ldxios = lwxios ) 181 IF( lwxios ) CALL iom_swap( cxios_context ) 177 CALL iom_rstput( kt, nitrst, numrow, 'rnf_b' , rnf ) 178 CALL iom_rstput( kt, nitrst, numrow, 'rnf_hc_b', rnf_tsc(:,:,jp_tem) ) 179 CALL iom_rstput( kt, nitrst, numrow, 'rnf_sc_b', rnf_tsc(:,:,jp_sal) ) 182 180 ENDIF 183 181 ! … … 479 477 ENDIF 480 478 ! 481 IF( lwxios ) THEN482 CALL iom_set_rstw_var_active('rnf_b')483 CALL iom_set_rstw_var_active('rnf_hc_b')484 CALL iom_set_rstw_var_active('rnf_sc_b')485 ENDIF486 487 479 END SUBROUTINE sbc_rnf_init 488 480 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/SBC/sbcssm.F90
r13286 r14018 154 154 IF(lwp) WRITE(numout,*) '~~~~~~~' 155 155 zf_sbc = REAL( nn_fsbc, wp ) 156 IF( lwxios ) CALL iom_swap( cwxios_context ) 157 CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc, ldxios = lwxios ) ! sbc frequency 158 CALL iom_rstput( kt, nitrst, numrow, 'ssu_m' , ssu_m, ldxios = lwxios ) ! sea surface mean fields 159 CALL iom_rstput( kt, nitrst, numrow, 'ssv_m' , ssv_m, ldxios = lwxios ) 160 CALL iom_rstput( kt, nitrst, numrow, 'sst_m' , sst_m, ldxios = lwxios ) 161 CALL iom_rstput( kt, nitrst, numrow, 'sss_m' , sss_m, ldxios = lwxios ) 162 CALL iom_rstput( kt, nitrst, numrow, 'ssh_m' , ssh_m, ldxios = lwxios ) 163 CALL iom_rstput( kt, nitrst, numrow, 'e3t_m' , e3t_m, ldxios = lwxios ) 164 CALL iom_rstput( kt, nitrst, numrow, 'frq_m' , frq_m, ldxios = lwxios ) 165 ! 166 IF( lwxios ) CALL iom_swap( cxios_context ) 156 CALL iom_rstput( kt, nitrst, numrow, 'nn_fsbc', zf_sbc ) ! sbc frequency 157 CALL iom_rstput( kt, nitrst, numrow, 'ssu_m' , ssu_m ) ! sea surface mean fields 158 CALL iom_rstput( kt, nitrst, numrow, 'ssv_m' , ssv_m ) 159 CALL iom_rstput( kt, nitrst, numrow, 'sst_m' , sst_m ) 160 CALL iom_rstput( kt, nitrst, numrow, 'sss_m' , sss_m ) 161 CALL iom_rstput( kt, nitrst, numrow, 'ssh_m' , ssh_m ) 162 CALL iom_rstput( kt, nitrst, numrow, 'e3t_m' , e3t_m ) 163 CALL iom_rstput( kt, nitrst, numrow, 'frq_m' , frq_m ) 164 ! 167 165 ENDIF 168 166 ! … … 208 206 IF( ln_rstart .AND. iom_varid( numror, 'nn_fsbc', ldstop = .FALSE. ) > 0 ) THEN 209 207 l_ssm_mean = .TRUE. 210 CALL iom_get( numror , 'nn_fsbc', zf_sbc ,ldxios = lrxios) ! sbc frequency of previous run211 CALL iom_get( numror, jpdom_auto, 'ssu_m' , ssu_m, ldxios = lrxios,cd_type = 'U', psgn = -1._wp ) ! sea surface mean velocity (U-point)212 CALL iom_get( numror, jpdom_auto, 'ssv_m' , ssv_m, ldxios = lrxios,cd_type = 'V', psgn = -1._wp ) ! " " velocity (V-point)213 CALL iom_get( numror, jpdom_auto, 'sst_m' , sst_m , ldxios = lrxios) ! " " temperature (T-point)214 CALL iom_get( numror, jpdom_auto, 'sss_m' , sss_m , ldxios = lrxios) ! " " salinity (T-point)215 CALL iom_get( numror, jpdom_auto, 'ssh_m' , ssh_m , ldxios = lrxios) ! " " height (T-point)216 CALL iom_get( numror, jpdom_auto, 'e3t_m' , e3t_m , ldxios = lrxios) ! 1st level thickness (T-point)208 CALL iom_get( numror , 'nn_fsbc', zf_sbc ) ! sbc frequency of previous run 209 CALL iom_get( numror, jpdom_auto, 'ssu_m' , ssu_m, cd_type = 'U', psgn = -1._wp ) ! sea surface mean velocity (U-point) 210 CALL iom_get( numror, jpdom_auto, 'ssv_m' , ssv_m, cd_type = 'V', psgn = -1._wp ) ! " " velocity (V-point) 211 CALL iom_get( numror, jpdom_auto, 'sst_m' , sst_m ) ! " " temperature (T-point) 212 CALL iom_get( numror, jpdom_auto, 'sss_m' , sss_m ) ! " " salinity (T-point) 213 CALL iom_get( numror, jpdom_auto, 'ssh_m' , ssh_m ) ! " " height (T-point) 214 CALL iom_get( numror, jpdom_auto, 'e3t_m' , e3t_m ) ! 1st level thickness (T-point) 217 215 ! fraction of solar net radiation absorbed in 1st T level 218 216 IF( iom_varid( numror, 'frq_m', ldstop = .FALSE. ) > 0 ) THEN 219 CALL iom_get( numror, jpdom_auto, 'frq_m' , frq_m , ldxios = lrxios)217 CALL iom_get( numror, jpdom_auto, 'frq_m' , frq_m ) 220 218 ELSE 221 219 frq_m(:,:) = 1._wp ! default definition … … 255 253 IF( .NOT. ln_traqsr ) fraqsr_1lev(:,:) = 1._wp ! default definition: qsr 100% in the fisrt level 256 254 ! 257 IF( lwxios.AND.nn_fsbc > 1 ) THEN258 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 ENDIF267 268 255 END SUBROUTINE sbc_ssm_init 269 256 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/TRA/traqsr.F90
r13998 r14018 138 138 IF(lwp) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field read in the restart file' 139 139 z1_2 = 0.5_wp 140 CALL iom_get( numror, jpdom_auto, 'qsr_hc_b', qsr_hc_b , ldxios = lrxios) ! before heat content trend due to Qsr flux140 CALL iom_get( numror, jpdom_auto, 'qsr_hc_b', qsr_hc_b ) ! before heat content trend due to Qsr flux 141 141 ELSE ! No restart or Euler forward at 1st time step 142 142 z1_2 = 1._wp … … 292 292 ! 293 293 IF( lrst_oce ) THEN ! write in the ocean restart file 294 IF( lwxios ) CALL iom_swap( cwxios_context ) 295 CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc , ldxios = lwxios ) 296 CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev, ldxios = lwxios ) 297 IF( lwxios ) CALL iom_swap( cxios_context ) 294 CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc ) 295 CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev ) 298 296 ENDIF 299 297 ! … … 431 429 ! 1st ocean level attenuation coefficient (used in sbcssm) 432 430 IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN 433 CALL iom_get( numror, jpdom_auto, 'fraqsr_1lev' , fraqsr_1lev , ldxios = lrxios)431 CALL iom_get( numror, jpdom_auto, 'fraqsr_1lev' , fraqsr_1lev ) 434 432 ELSE 435 433 fraqsr_1lev(:,:) = 1._wp ! default : no penetration 436 434 ENDIF 437 435 ! 438 IF( lwxios ) THEN439 CALL iom_set_rstw_var_active('qsr_hc_b')440 CALL iom_set_rstw_var_active('fraqsr_1lev')441 ENDIF442 !443 436 END SUBROUTINE tra_qsr_init 444 437 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/TRA/trasbc.F90
r13998 r14018 111 111 zfact = 0.5_wp 112 112 sbc_tsc(:,:,:) = 0._wp ! CAUTION: here only the halos should be set to 0 due to rst_put 113 CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) , ldxios = lrxios) ! before heat content sbc trend114 CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) , ldxios = lrxios) ! before salt content sbc trend113 CALL iom_get( numror, jpdom_auto, 'sbc_hc_b', sbc_tsc_b(:,:,jp_tem) ) ! before heat content sbc trend 114 CALL iom_get( numror, jpdom_auto, 'sbc_sc_b', sbc_tsc_b(:,:,jp_sal) ) ! before salt content sbc trend 115 115 ELSE ! No restart or restart not found: Euler forward time stepping 116 116 zfact = 1._wp … … 144 144 ! 145 145 IF( lrst_oce ) THEN !== write sbc_tsc in the ocean restart file ==! 146 IF( lwxios ) CALL iom_swap( cwxios_context ) 147 CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem), ldxios = lwxios ) 148 CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal), ldxios = lwxios ) 149 IF( lwxios ) CALL iom_swap( cxios_context ) 146 CALL iom_rstput( kt, nitrst, numrow, 'sbc_hc_b', sbc_tsc(:,:,jp_tem) ) 147 CALL iom_rstput( kt, nitrst, numrow, 'sbc_sc_b', sbc_tsc(:,:,jp_sal) ) 150 148 ENDIF 151 149 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ZDF/zdfgls.F90
r13998 r14018 1057 1057 CALL gls_rst( nit000, 'READ' ) ! (en, avt_k, avm_k, hmxl_n) 1058 1058 ! 1059 IF( lwxios ) THEN1060 CALL iom_set_rstw_var_active('en')1061 CALL iom_set_rstw_var_active('avt_k')1062 CALL iom_set_rstw_var_active('avm_k')1063 CALL iom_set_rstw_var_active('hmxl_n')1064 ENDIF1065 !1066 1059 END SUBROUTINE zdf_gls_init 1067 1060 … … 1097 1090 ! 1098 1091 IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN ! all required arrays exist 1099 CALL iom_get( numror, jpdom_auto, 'en' , en , ldxios = lrxios)1100 CALL iom_get( numror, jpdom_auto, 'avt_k' , avt_k , ldxios = lrxios)1101 CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k , ldxios = lrxios)1102 CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n , ldxios = lrxios)1092 CALL iom_get( numror, jpdom_auto, 'en' , en ) 1093 CALL iom_get( numror, jpdom_auto, 'avt_k' , avt_k ) 1094 CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k ) 1095 CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n ) 1103 1096 ELSE 1104 1097 IF(lwp) WRITE(numout,*) … … 1119 1112 ! ! ------------------- 1120 1113 IF(lwp) WRITE(numout,*) '---- gls-rst ----' 1121 IF( lwxios ) CALL iom_swap( cwxios_context ) 1122 CALL iom_rstput( kt, nitrst, numrow, 'en' , en , ldxios = lwxios ) 1123 CALL iom_rstput( kt, nitrst, numrow, 'avt_k' , avt_k , ldxios = lwxios ) 1124 CALL iom_rstput( kt, nitrst, numrow, 'avm_k' , avm_k , ldxios = lwxios ) 1125 CALL iom_rstput( kt, nitrst, numrow, 'hmxl_n', hmxl_n, ldxios = lwxios ) 1126 IF( lwxios ) CALL iom_swap( cxios_context ) 1114 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 1115 CALL iom_rstput( kt, nitrst, numrow, 'avt_k' , avt_k ) 1116 CALL iom_rstput( kt, nitrst, numrow, 'avm_k' , avm_k ) 1117 CALL iom_rstput( kt, nitrst, numrow, 'hmxl_n', hmxl_n ) 1127 1118 ! 1128 1119 ENDIF -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ZDF/zdfosm.F90
r13998 r14018 1437 1437 ghamv(:,:,:) = 0. 1438 1438 ! 1439 IF( lwxios ) THEN1440 CALL iom_set_rstw_var_active('wn')1441 CALL iom_set_rstw_var_active('hbl')1442 CALL iom_set_rstw_var_active('hbli')1443 ENDIF1444 1439 END SUBROUTINE zdf_osm_init 1445 1440 … … 1474 1469 id1 = iom_varid( numror, 'wn' , ldstop = .FALSE. ) 1475 1470 IF( id1 > 0 ) THEN ! 'wn' exists; read 1476 CALL iom_get( numror, jpdom_auto, 'wn', ww , ldxios = lrxios)1471 CALL iom_get( numror, jpdom_auto, 'wn', ww ) 1477 1472 WRITE(numout,*) ' ===>>>> : ww read from restart file' 1478 1473 ELSE … … 1483 1478 id2 = iom_varid( numror, 'hbli' , ldstop = .FALSE. ) 1484 1479 IF( id1 > 0 .AND. id2 > 0) THEN ! 'hbl' exists; read and return 1485 CALL iom_get( numror, jpdom_auto, 'hbl' , hbl , ldxios = lrxios)1486 CALL iom_get( numror, jpdom_auto, 'hbli', hbli , ldxios = lrxios)1480 CALL iom_get( numror, jpdom_auto, 'hbl' , hbl ) 1481 CALL iom_get( numror, jpdom_auto, 'hbli', hbli ) 1487 1482 WRITE(numout,*) ' ===>>>> : hbl & hbli read from restart file' 1488 1483 RETURN … … 1497 1492 IF( TRIM(cdrw) == 'WRITE') THEN !* Write hbli into the restart file, then return 1498 1493 IF(lwp) WRITE(numout,*) '---- osm-rst ----' 1499 CALL iom_rstput( kt, nitrst, numrow, 'wn' , ww , ldxios = lwxios)1500 CALL iom_rstput( kt, nitrst, numrow, 'hbl' , hbl , ldxios = lwxios)1501 CALL iom_rstput( kt, nitrst, numrow, 'hbli' , hbli , ldxios = lwxios)1494 CALL iom_rstput( kt, nitrst, numrow, 'wn' , ww ) 1495 CALL iom_rstput( kt, nitrst, numrow, 'hbl' , hbl ) 1496 CALL iom_rstput( kt, nitrst, numrow, 'hbli' , hbli ) 1502 1497 RETURN 1503 1498 END IF -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ZDF/zdfric.F90
r13998 r14018 103 103 CALL ric_rst( nit000, 'READ' ) !* read or initialize all required files 104 104 ! 105 IF( lwxios ) THEN106 CALL iom_set_rstw_var_active('avt_k')107 CALL iom_set_rstw_var_active('avm_k')108 ENDIF109 105 END SUBROUTINE zdf_ric_init 110 106 … … 214 210 ! 215 211 IF( MIN( id1, id2 ) > 0 ) THEN ! restart exists => read it 216 CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k , ldxios = lrxios)217 CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k , ldxios = lrxios)212 CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k ) 213 CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k ) 218 214 ENDIF 219 215 ENDIF … … 223 219 ! ! ------------------- 224 220 IF(lwp) WRITE(numout,*) '---- ric-rst ----' 225 IF( lwxios ) CALL iom_swap( cwxios_context ) 226 CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k, ldxios = lwxios ) 227 CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k, ldxios = lwxios) 228 IF( lwxios ) CALL iom_swap( cxios_context ) 221 CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k ) 222 CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k) 229 223 ! 230 224 ENDIF -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/ZDF/zdftke.F90
r13998 r14018 721 721 CALL tke_rst( nit000, 'READ' ) ! (en, avt_k, avm_k, dissl) 722 722 ! 723 IF( lwxios ) THEN724 CALL iom_set_rstw_var_active('en')725 CALL iom_set_rstw_var_active('avt_k')726 CALL iom_set_rstw_var_active('avm_k')727 CALL iom_set_rstw_var_active('dissl')728 ENDIF729 723 END SUBROUTINE zdf_tke_init 730 724 … … 758 752 ! 759 753 IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN ! fields exist 760 CALL iom_get( numror, jpdom_auto, 'en' , en , ldxios = lrxios)761 CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k , ldxios = lrxios)762 CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k , ldxios = lrxios)763 CALL iom_get( numror, jpdom_auto, 'dissl', dissl , ldxios = lrxios)754 CALL iom_get( numror, jpdom_auto, 'en' , en ) 755 CALL iom_get( numror, jpdom_auto, 'avt_k', avt_k ) 756 CALL iom_get( numror, jpdom_auto, 'avm_k', avm_k ) 757 CALL iom_get( numror, jpdom_auto, 'dissl', dissl ) 764 758 ELSE ! start TKE from rest 765 759 IF(lwp) WRITE(numout,*) … … 780 774 ! ! ------------------- 781 775 IF(lwp) WRITE(numout,*) '---- tke_rst ----' 782 IF( lwxios ) CALL iom_swap( cwxios_context ) 783 CALL iom_rstput( kt, nitrst, numrow, 'en' , en , ldxios = lwxios ) 784 CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k, ldxios = lwxios ) 785 CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k, ldxios = lwxios ) 786 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl, ldxios = lwxios ) 787 IF( lwxios ) CALL iom_swap( cxios_context ) 776 CALL iom_rstput( kt, nitrst, numrow, 'en' , en ) 777 CALL iom_rstput( kt, nitrst, numrow, 'avt_k', avt_k ) 778 CALL iom_rstput( kt, nitrst, numrow, 'avm_k', avm_k ) 779 CALL iom_rstput( kt, nitrst, numrow, 'dissl', dissl ) 788 780 ! 789 781 ENDIF -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/nemogcm.F90
r13998 r14018 415 415 CALL Agrif_Declare_Var_ini ! " " " " " DOM 416 416 #endif 417 CALL dom_init( Nbb, Nnn, Naa , "OCE") ! Domain418 IF( ln_crs ) CALL crs_init( Nnn 417 CALL dom_init( Nbb, Nnn, Naa ) ! Domain 418 IF( ln_crs ) CALL crs_init( Nnn ) ! coarsened grid: domain initialization 419 419 IF( sn_cfctl%l_prtctl ) & 420 420 & CALL prt_ctl_init ! Print control -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/oce.F90
r13608 r14018 71 71 !! Shallow Water Eq. case (SWE) 72 72 LOGICAL, PUBLIC :: lk_SWE = .FALSE. !: shallow water flag =T in SWE configurations only 73 74 !! Stand-Alone Surface module (SAS) 75 LOGICAL, PUBLIC :: l_SAS = .FALSE. !: SAS flag =T in SAS configurations only 76 73 77 74 78 !!---------------------------------------------------------------------- -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/step.F90
r13915 r14018 122 122 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid 123 123 ENDIF 124 IF((kstp == nitrst) .AND. lwxios) THEN 125 CALL iom_swap( cw_ocerst_cxt ) 126 CALL iom_init_closedef(cw_ocerst_cxt) 127 CALL iom_setkt( kstp - nit000 + 1, cw_ocerst_cxt ) 128 #if defined key_top 129 CALL iom_swap( cw_toprst_cxt ) 130 CALL iom_init_closedef(cw_toprst_cxt) 131 CALL iom_setkt( kstp - nit000 + 1, cw_toprst_cxt ) 132 #endif 133 ENDIF 134 #if defined key_si3 135 IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN 136 CALL iom_swap( cw_icerst_cxt ) 137 CALL iom_init_closedef(cw_icerst_cxt) 138 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 139 ENDIF 140 #endif 124 141 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 125 142 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp … … 336 353 IF( kstp == nit000 ) THEN ! 1st time step only 337 354 CALL iom_close( numror ) ! close input ocean restart file 355 IF( lrxios ) CALL iom_context_finalize( cr_ocerst_cxt ) 338 356 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 339 357 IF(lwm .AND. numoni /= -1 ) CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) … … 351 369 IF( kstp == nitend .OR. nstop > 0 ) THEN 352 370 CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF 353 IF( lrxios ) CALL iom_context_finalize( crxios_context )354 371 IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 355 372 ENDIF -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OFF/dtadyn.F90
r13998 r14018 46 46 USE fldread ! read input fields 47 47 USE timing ! Timing 48 USE trc, ONLY : ln_rsttr, numrtr, numrtw,lrst_trc48 USE trc, ONLY : ln_rsttr, lrst_trc 49 49 50 50 IMPLICIT NONE -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OFF/nemogcm.F90
r13998 r14018 130 130 ENDIF 131 131 ! 132 IF((istp == nitrst) .AND. lwxios) THEN 133 CALL iom_swap( cw_toprst_cxt ) 134 CALL iom_init_closedef(cw_toprst_cxt) 135 CALL iom_setkt( istp - nit000 + 1, cw_toprst_cxt ) 136 ENDIF 137 132 138 IF( istp /= nit000 ) CALL day ( istp ) ! Calendar (day was already called at nit000 in day_init) 133 139 CALL iom_setkt ( istp - nit000 + 1, cxios_context ) ! say to iom that we are at time step kstp … … 344 350 CALL eos_init ! Equation of state 345 351 IF( lk_c1d ) CALL c1d_init ! 1D column configuration 346 CALL dom_init( Nbb, Nnn, Naa , "OPA") ! Domain352 CALL dom_init( Nbb, Nnn, Naa ) ! Domain 347 353 IF( sn_cfctl%l_prtctl ) & 348 354 & CALL prt_ctl_init ! Print control -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/SAO/nemogcm.F90
r13286 r14018 235 235 CALL phy_cst ! Physical constants 236 236 CALL eos_init ! Equation of state 237 CALL dom_init( Nbb, Nnn, Naa , 'SAO') ! Domain237 CALL dom_init( Nbb, Nnn, Naa ) ! Domain 238 238 239 239 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/SAS/nemogcm.F90
r13998 r14018 215 215 !!---------------------------------------------------------------------- 216 216 ! 217 IF( lk_oasis ) THEN ; cxios_context = 'sas' 218 ELSE ; cxios_context = 'nemo' 217 IF( lk_oasis ) THEN ; cxios_context = 'sas' ! when coupling SAS to OCE 218 ELSE ; cxios_context = 'nemo' ! 219 219 ENDIF 220 220 nn_hls = 1 221 ! 222 l_SAS = .TRUE. ! used in domain:dom_nam 221 223 ! 222 224 ! !-------------------------------------------------! … … 374 376 CALL Agrif_Declare_Var_ini ! " " " " " DOM 375 377 #endif 376 CALL dom_init( Nbb, Nnn, Naa , 'SAS') ! Domain378 CALL dom_init( Nbb, Nnn, Naa ) ! Domain 377 379 IF( sn_cfctl%l_prtctl ) & 378 380 & CALL prt_ctl_init ! Print control -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/SAS/step.F90
r12933 r14018 89 89 #endif 90 90 IF( kstp == nit000 ) CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS) 91 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell iom we are at time step kstp 92 IF((kstp == nitrst) .AND. lwxios) THEN 93 CALL iom_swap( cw_ocerst_cxt ) 94 CALL iom_init_closedef(cw_ocerst_cxt) 95 CALL iom_setkt( kstp - nit000 + 1, cw_ocerst_cxt ) 96 #if defined key_top 97 CALL iom_swap( cw_toprst_cxt ) 98 CALL iom_init_closedef(cw_toprst_cxt) 99 CALL iom_setkt( kstp - nit000 + 1, cw_toprst_cxt ) 100 #endif 101 ENDIF 91 102 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 92 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell iom we are at time step kstp 103 104 #if defined key_si3 105 IF(((kstp + nn_fsbc - 1) == nitrst) .AND. lwxios) THEN 106 CALL iom_swap( cw_icerst_cxt ) 107 CALL iom_init_closedef(cw_icerst_cxt) 108 CALL iom_setkt( kstp - nit000 + 1, cw_icerst_cxt ) 109 ENDIF 110 #endif 93 111 94 112 ! ==> clem: open boundaries is mandatory for sea-ice because ice BDY is not decoupled from … … 128 146 ! File manipulation at the end of the first time step 129 147 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 130 IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file 148 IF( kstp == nit000 ) THEN 149 CALL iom_close( numror ) ! close input ocean restart file 150 IF( lrxios ) CALL iom_context_finalize( cr_ocerst_cxt ) 151 ENDIF 131 152 132 153 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 140 161 CALL iom_close( numrow ) 141 162 ELSE 142 CALL iom_context_finalize( cwxios_context ) 163 CALL iom_context_finalize( cw_ocerst_cxt ) 164 iom_file(numrow)%nfid = 0 165 numrow = 0 143 166 ENDIF 144 167 lrst_oce = .FALSE. -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/SWE/nemogcm.F90
r13769 r14018 296 296 r1_rho0_rcp = 1._wp / rho0_rcp 297 297 ! 298 CALL dom_init( Nbb, Nnn, Naa , "OPA") ! Domain298 CALL dom_init( Nbb, Nnn, Naa ) ! Domain 299 299 300 300 IF( sn_cfctl%l_prtctl ) & -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/C14/trcsms_c14.F90
r13295 r14018 144 144 IF(lwp) WRITE(numout,*) ' ~~~~~~~~~~~~~~' 145 145 ! 146 CALL iom_rstput( kt, nitrst, numrtw, 'co2sbc', co2sbc ) 147 CALL iom_rstput( kt, nitrst, numrtw, 'c14sbc', c14sbc ) 146 CALL iom_rstput( kt, nitrst, numrtw, 'co2sbc', co2sbc ) ! These five need & 147 CALL iom_rstput( kt, nitrst, numrtw, 'c14sbc', c14sbc ) ! & to be written & 148 148 CALL iom_rstput( kt, nitrst, numrtw, 'exch_co2', exch_co2 ) ! & for temporal & 149 149 CALL iom_rstput( kt, nitrst, numrtw, 'exch_c14', exch_c14 ) ! & averages & 150 CALL iom_rstput( kt, nitrst, numrtw, 'qtr_c14', qtr_c14 )! & to be coherent.150 CALL iom_rstput( kt, nitrst, numrtw, 'qtr_c14', qtr_c14 ) ! & to be coherent. 151 151 CALL iom_rstput( kt, nitrst, numrtw, 'qint_c14', qint_c14 ) ! Cumulative 152 152 ! -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/PISCES/P4Z/p4zsms.F90
r13998 r14018 369 369 IF(lwp) WRITE(numout,*) '~~~~~~~' 370 370 ENDIF 371 CALL iom_rstput( kt, nitrst, numrtw, 'PH', hi(:,:,:) )372 CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) )371 CALL iom_rstput( kt, nitrst, numrtw, 'PH', hi(:,:,:) ) 372 CALL iom_rstput( kt, nitrst, numrtw, 'Silicalim', xksi(:,:) ) 373 373 CALL iom_rstput( kt, nitrst, numrtw, 'Silicamax', xksimax(:,:) ) 374 374 CALL iom_rstput( kt, nitrst, numrtw, 'tcflxcum', t_oce_co2_flx_cum ) -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/PISCES/SED/sed.F90
r10425 r14018 44 44 REAL , PUBLIC :: sedmask 45 45 REAL(wp), PUBLIC :: denssol !: density of solid material 46 INTEGER , PUBLIC :: numrsr, numrsw !: logical unit for sed restart (read and write)47 46 LOGICAL , PUBLIC :: lrst_sed !: logical to control the trc restart write 48 47 LOGICAL , PUBLIC :: ln_rst_sed = .TRUE. !: initialisation from a restart file or not -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/PISCES/SED/sedrst.F90
r13286 r14018 42 42 CHARACTER(LEN=50) :: clname ! trc output restart file name 43 43 CHARACTER(LEN=256) :: clpath ! full path to ocean output restart file 44 CHARACTER(LEN=52) :: clpname ! trc output restart file name including AGRIF 44 45 !!---------------------------------------------------------------------- 45 46 ! … … 80 81 IF(lwp) WRITE(numsed,*) & 81 82 ' open sed restart.output NetCDF file: ',TRIM(clpath)//clname 82 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' ) 83 IF(.NOT.lwxios) THEN 84 CALL iom_open( TRIM(clpath)//TRIM(clname), numrsw, ldwrt = .TRUE., kdlev = jpksed, cdcomp = 'SED' ) 85 ELSE 86 #if defined key_iomput 87 cw_sedrst_cxt = "rstws_"//TRIM(ADJUSTL(clkt)) 88 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 89 clpname = clname 90 ELSE 91 clpname = TRIM(Agrif_CFixed())//"_"//clname 92 ENDIF 93 numrsw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 94 CALL iom_init( cw_sedrst_cxt, kdid = numrsw, ld_closedef = .FALSE. ) 95 #else 96 clinfo = 'Can not use XIOS in trc_rst_opn' 97 CALL ctl_stop(TRIM(clinfo)) 98 #endif 99 ENDIF 100 83 101 lrst_sed = .TRUE. 84 102 ENDIF … … 196 214 CALL pack_arr( jpoce, sedligand(1:jpoce,1:jpksed), & 197 215 & zdta2(1:jpi,1:jpj,1:jpksed), iarroce(1:jpoce) ) 198 199 216 IF( ln_timing ) CALL timing_stop('sed_rst_read') 200 217 … … 240 257 !! 1. WRITE in nutwrs 241 258 !! ------------------ 242 243 zinfo(1) = REAL( kt) 244 CALL iom_rstput( kt, nitrst, numrsw, 'kt', zinfo ) 259 ! zinfo(1) = REAL( kt) 260 CALL iom_rstput( kt, nitrst, numrsw, 'kt', REAL( kt , wp) ) 245 261 246 262 ! Back to 2D geometry … … 299 315 300 316 IF( kt == nitrst ) THEN 301 CALL iom_close( numrsw ) ! close the restart file (only at last time step) 317 IF(.NOT.lwxios) THEN 318 CALL iom_close( numrsw ) ! close the restart file (only at last time step) 319 ELSE 320 CALL iom_context_finalize( cw_sedrst_cxt ) 321 iom_file(numrsw)%nfid = 0 322 numrsw = 0 323 ENDIF 302 324 IF( l_offline .AND. ln_rst_list ) THEN 303 325 nrst_lst = nrst_lst + 1 … … 342 364 REAL(wp) :: zkt, zrdttrc1 343 365 REAL(wp) :: zndastp 366 CHARACTER(len = 82) :: clpname 344 367 345 368 ! Time domain : restart … … 353 376 354 377 IF( ln_rst_sed ) THEN 378 lxios_sini = .FALSE. 355 379 CALL iom_open( TRIM(cn_sedrst_indir)//'/'//cn_sedrst_in, numrsr ) 380 381 IF( lrxios) THEN 382 cr_sedrst_cxt = 'sed_rst' 383 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for SED' 384 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 385 ! clpname = cn_sedrst_in 386 ! ELSE 387 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_sedrst_in 388 ! ENDIF 389 CALL iom_init( cr_sedrst_cxt, kdid = numrsr, ld_closedef = .TRUE. ) 390 ENDIF 356 391 CALL iom_get ( numrsr, 'kt', zkt ) ! last time-step of previous run 357 358 392 IF(lwp) THEN 359 393 WRITE(numsed,*) ' *** Info read in restart : ' … … 402 436 IF(lwp) WRITE(numsed,*) 'trc_wri : write the TOP restart file (NetCDF) at it= ', kt, ' date= ', ndastp 403 437 IF(lwp) WRITE(numsed,*) '~~~~~~~' 438 IF( lwxios ) CALL iom_init_closedef(cw_sedrst_cxt) 404 439 ENDIF 405 440 CALL iom_rstput( kt, nitrst, numrsw, 'kt' , REAL( kt , wp) ) ! time-step 406 441 CALL iom_rstput( kt, nitrst, numrsw, 'ndastp' , REAL( ndastp, wp) ) ! date 407 CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj 408 ! ! the begining of the run [s]442 CALL iom_rstput( kt, nitrst, numrsw, 'adatrj' , adatrj ) ! number of elapsed days since 443 ! ! the begining of the run [s] 409 444 ENDIF 410 445 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/PISCES/SED/sedstp.F90
r12489 r14018 86 86 IF( kt == nitsed000 ) THEN 87 87 CALL iom_close( numrsr ) ! close input tracer restart file 88 ! IF(lwm) CALL FLUSH( numont ) ! flush namelist output 88 IF(lrxios) CALL iom_context_finalize( cr_sedrst_cxt ) 89 ! IF(lwm) CALL FLUSH( numont ) ! flush namelist output 89 90 ENDIF 90 91 IF( lrst_sed ) CALL sed_rst_wri( kt ) ! restart file output -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/trc.F90
r13998 r14018 21 21 INTEGER, PUBLIC :: numonr = -1 !: reference passive tracer namelist output output.namelist.top 22 22 INTEGER, PUBLIC :: numstr !: tracer statistics 23 INTEGER, PUBLIC :: numrtr = -1 !: trc restart (read )24 INTEGER, PUBLIC :: numrtw !: trc restart ( write )25 23 CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_ref !: character buffer for reference passive tracer namelist_top_ref 26 24 CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_cfg !: character buffer for configuration specific passive tracer namelist_top_cfg -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/trcrst.F90
r13998 r14018 52 52 CHARACTER(LEN=50) :: clname ! trc output restart file name 53 53 CHARACTER(LEN=256) :: clpath ! full path to ocean output restart file 54 CHARACTER(LEN=50) :: clpname ! trc output restart file name including AGRIF 54 55 !!---------------------------------------------------------------------- 55 56 ! … … 91 92 IF(lwp) WRITE(numout,*) & 92 93 ' open trc restart.output NetCDF file: ',TRIM(clpath)//clname 93 CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. ) 94 IF(.NOT.lwxios) THEN 95 CALL iom_open( TRIM(clpath)//TRIM(clname), numrtw, ldwrt = .TRUE. ) 96 ELSE 97 #if defined key_iomput 98 cw_toprst_cxt = "rstwt_"//TRIM(ADJUSTL(clkt)) 99 IF( TRIM(Agrif_CFixed()) == '0' ) THEN 100 clpname = clname 101 ELSE 102 clpname = TRIM(Agrif_CFixed())//"_"//clname 103 ENDIF 104 numrtw = iom_xios_setid(TRIM(clpath)//TRIM(clpname)) 105 CALL iom_init( cw_toprst_cxt, kdid = numrtw, ld_closedef = .FALSE. ) 106 #else 107 clinfo = 'Can not use XIOS in trc_rst_opn' 108 CALL ctl_stop(TRIM(clinfo)) 109 #endif 110 ENDIF 94 111 lrst_trc = .TRUE. 95 112 ENDIF … … 121 138 END DO 122 139 ! 123 CALL iom_delay_rst( 'READ', 'TOP', numrtr ) ! read only TOP delayed global communication variables 124 140 IF(.NOT.lrxios) CALL iom_delay_rst( 'READ', 'TOP', numrtr ) ! read only TOP delayed global communication variables 125 141 END SUBROUTINE trc_rst_read 126 142 … … 147 163 CALL iom_rstput( kt, nitrst, numrtw, 'TRB'//ctrcnm(jn), tr(:,:,:,jn,Kbb) ) 148 164 END DO 149 ! 150 CALL iom_delay_rst( 'WRITE', 'TOP', numrtw ) ! save only TOP delayed global communication variables165 166 IF( .NOT. lwxios ) CALL iom_delay_rst( 'WRITE', 'TOP', numrtw ) ! save only TOP delayed global communication variables 151 167 152 168 IF( kt == nitrst ) THEN 153 169 CALL trc_rst_stat( Kmm, Krhs ) ! statistics 154 CALL iom_close( numrtw ) ! close the restart file (only at last time step) 170 IF(lwxios) THEN 171 CALL iom_context_finalize( cw_toprst_cxt ) 172 iom_file(numrtw)%nfid = 0 173 numrtw = 0 174 ELSE 175 CALL iom_close( numrtw ) ! close the restart file (only at last time step) 176 ENDIF 155 177 #if ! defined key_trdmxl_trc 156 178 lrst_trc = .FALSE. … … 196 218 REAL(wp) :: zrdttrc1, zkt, zndastp, zdayfrac, ksecs, ktime 197 219 INTEGER :: ihour, iminute 220 CHARACTER(len=82) :: clpname 198 221 199 222 ! Time domain : restart … … 207 230 208 231 IF( ln_rsttr ) THEN 232 lxios_sini = .FALSE. 209 233 CALL iom_open( TRIM(cn_trcrst_indir)//'/'//cn_trcrst_in, numrtr ) 234 IF( lrxios) THEN 235 cr_toprst_cxt = 'top_rst' 236 IF(lwp) WRITE(numout,*) 'Enable restart reading by XIOS for TOP' 237 ! IF( TRIM(Agrif_CFixed()) == '0' ) THEN 238 ! clpname = cn_trcrst_in 239 ! ELSE 240 ! clpname = TRIM(Agrif_CFixed())//"_"//cn_trcrst_in 241 ! ENDIF 242 CALL iom_init( cr_toprst_cxt, kdid = numrtr, ld_closedef = .TRUE. ) 243 ENDIF 244 210 245 CALL iom_get ( numrtr, 'kt', zkt ) ! last time-step of previous run 211 246 … … 293 328 IF(lwp) WRITE(numout,*) '~~~~~~~' 294 329 ENDIF 295 CALL iom_rstput( kt, nitrst, numrtw, 'kt' , REAL( kt , wp) ) ! time-step296 CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp) ) ! date297 CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj ) ! number of elapsed days since330 CALL iom_rstput( kt, nitrst, numrtw, 'kt' , REAL( kt , wp) ) ! time-step 331 CALL iom_rstput( kt, nitrst, numrtw, 'ndastp' , REAL( ndastp, wp) ) ! date 332 CALL iom_rstput( kt, nitrst, numrtw, 'adatrj' , adatrj ) ! number of elapsed days since 298 333 ! ! the begining of the run [s] 299 CALL iom_rstput( kt, nitrst, numrtw, 'ntime' , REAL( nn_time0, wp) ) ! time334 CALL iom_rstput( kt, nitrst, numrtw, 'ntime' , REAL( nn_time0, wp) ) ! time 300 335 ENDIF 301 336 -
NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/TOP/trcstp.F90
r13286 r14018 110 110 IF( kt == nittrc000 ) THEN 111 111 CALL iom_close( numrtr ) ! close input tracer restart file 112 IF(lrxios) CALL iom_context_finalize( cr_toprst_cxt ) 112 113 IF(lwm) CALL FLUSH( numont ) ! flush namelist output 113 114 ENDIF … … 196 197 & .AND. iom_varid( numrtr, 'ktdcy' , ldstop = .FALSE. ) > 0 & 197 198 & .AND. iom_varid( numrtr, 'nrdcy' , ldstop = .FALSE. ) > 0 ) THEN 198 199 199 CALL iom_get( numrtr, 'ktdcy', zkt ) 200 200 rsecfst = INT( zkt ) * rn_Dt
Note: See TracChangeset
for help on using the changeset viewer.