- Timestamp:
- 2010-11-19T21:36:45+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/nemo_v3_3_beta/DOC/TexFiles/Chapters/Chap_MISC.tex
r2376 r2414 521 521 and compression can lead to significant reductions in file sizes for a small 522 522 runtime overhead. For a fuller discussion on chunking and other performance 523 issues the reader is referred to the NetCDF4 documentation :524 http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html\#Chunking 523 issues the reader is referred to the NetCDF4 documentation found 524 \href{http://www.unidata.ucar.edu/software/netcdf/docs/netcdf.html#Chunking}{here}. 525 525 526 526 The new features are only available when the code has been linked with a … … 562 562 domain size in any dimension. The algorithm used is: 563 563 564 \begin{alltt} {{\ tiny564 \begin{alltt} {{\scriptsize 565 565 \begin{verbatim} 566 566 ichunksz(1) = MIN( idomain_size,MAX( (idomain_size-1)/nn_nchunks_i + 1 ,16 ) ) … … 573 573 \noindent As an example, setting: 574 574 \vspace{-20pt} 575 \begin{alltt} {{\ tiny575 \begin{alltt} {{\scriptsize 576 576 \begin{verbatim} 577 577 nn_nchunks_i=4, nn_nchunks_j=4 and nn_nchunks_k=31 … … 671 671 The units in the output file can be changed using the \np{nn\_ucf} namelist parameter. 672 672 For example, in case of salinity tendency the units are given by PSU/s/\np{nn\_ucf}. 673 Setting \np{nn\_ucf}=86400 provides the tendencies in PSU/d.673 Setting \np{nn\_ucf}=86400 ($i.e.$ the number of second in a day) provides the tendencies in PSU/d. 674 674 675 675 When \key{trdmld} is defined, two time averaging procedure are proposed. … … 684 684 685 685 Note that the mixed layer tendency diagnostic can also be used on biogeochemical models 686 via Êthe \key{trdtrc} and \key{trdmld\_trc} CPP keys.686 via the \key{trdtrc} and \key{trdmld\_trc} CPP keys. 687 687 688 688 % ------------------------------------------------------------------------------------------------------------- 689 689 % On-line Floats trajectories 690 690 % ------------------------------------------------------------------------------------------------------------- 691 \subsection{On-line Floats trajectories (FLO) (\key{floats} }691 \subsection{On-line Floats trajectories (FLO) (\key{floats})} 692 692 \label{FLO} 693 693 %--------------------------------------------namflo------------------------------------------------------- … … 703 703 numeric of the code, so that the trajectories never intercept the bathymetry. 704 704 705 See also the web site describing the off-line use of this marvellous diagnostic tool706 (http://stockage.univ-brest.fr/~grima/Ariane/).705 See also \href{http://stockage.univ-brest.fr/~grima/Ariane/}{here} the web site describing 706 the off-line use of this marvellous diagnostic tool. 707 707 708 708 % ------------------------------------------------------------------------------------------------------------- … … 912 912 913 913 914 % ================================================================ 914 915 \gmcomment{ % start of gmcomment 916 917 918 % ================================================================ 919 % Diagnostics 920 % ================================================================ 921 \section{Standard model Output (IOM)} 922 \label{MISC_iom} 923 924 % ------------------------------------------------------------------------------------------------------------- 925 % Standard Model Output 926 % ------------------------------------------------------------------------------------------------------------- 927 %\subsection{Model Output (default or \key{iomput} } 928 %\label{MISC_iom} 929 930 931 932 \subsection{Basic knowledge} 933 934 935 \subsubsection{ XML basic rules} 936 937 XML tags begin with the less-than character ("$<$") and end with the greater-than character (''$>$''). 938 You use tags to mark the start and end of elements, which are the logical units of information 939 in an XML document. In addition to marking the beginning of an element, XML start tags also 940 provide a place to specify attributes. An attribute specifies a single property for an element, 941 using a name/value pair, for example: $<$a b="x" c="y" b="z"$>$ ... $<$/a$>$. 942 See \href{http://www.xmlnews.org/docs/xml-basics.html}{here} for more details. 943 944 \subsubsection{Structure of the xml file used in NEMO} 945 946 The xml file is split into 3 parts: 947 948 \textbf{field definition}: define all variables that can be output (all lines between 949 \texttt{$<$field\_definition$>$} and \texttt{$<$/field\_definition$>$}) 950 951 \textbf{file definition}: define the netcdf files to be created and the variables they will contain 952 (all lines between \texttt{ $<$file\_definition$>$} and \texttt{$<$/file\_definition$>$}) 953 954 \textbf{axis and grid definitions}: define the horizontal and vertical grids (all lines between 955 \texttt{$<$axis\_definition$>$} and \texttt{$<$/axis\_definition$>$} and all lines between 956 \texttt{$<$grid\_definition$>$} and \texttt{$<$/grid\_definition$>$}) 957 958 \subsubsection{Inheritance and group } 959 960 Xml extensively uses the concept of inheritance. \\ 961 \\ 962 example 1: \\ 963 \vspace{-30pt} 964 \begin{alltt} {{\scriptsize 965 \begin{verbatim} 966 <field_definition operation="ave(X)" > 967 <field id="sst" /> <!-- averaged sst --> 968 <field id="sss" operation="inst(X)"/> <!-- instantaneous sss --> 969 </field_definition> 970 \end{verbatim} 971 }}\end{alltt} 972 973 The field ''sst'' which is part (or a child) of the field\_definition will inherit the value ''ave(X)'' 974 of the attribute ''operation'' from its parent ''field definition''. Note that a child can overwrite 975 the attribute definition inherited from its parents. In the example above, the field ''sss'' will 976 therefore output instantaneous values instead of average values. 977 978 example 2: Use (or overwrite) attributes value of a field when listing the variables included in a file 979 \vspace{-20pt} 980 \begin{alltt} {{\scriptsize 981 \begin{verbatim} 982 <field_definition> 983 <field id="sst" description="sea surface temperature" /> 984 <field id="sss" description="sea surface salinity" /> 985 </field_definition> 986 987 <file_definition> 988 <file id="file_1" /> 989 <field ref="sst" /> <!-- default def --> 990 <field ref="sss" description="my description" /> <!-- overwrite --> 991 </file> 992 </file_definition> 993 \end{verbatim} 994 }}\end{alltt} 995 996 With the help of the inheritance, the concept of group allow to define a set of attributes 997 for several fields or files. 998 999 example 3, group of fields: define a group ''T\_grid\_variables'' identified with the name 1000 ''grid\_T''. By default variables of this group have no vertical axis but, following inheritance 1001 rules, ''axis\_ref'' can be redefined for the field ''toce'' that is a 3D variable. 1002 \vspace{-30pt} 1003 \begin{alltt} {{\scriptsize 1004 \begin{verbatim} 1005 <field_definition> 1006 <group id="grid_T" axis_ref="none" grid_ref="T_grid_variables"> 1007 <field id="sst"/> 1008 <field id="sss"/> 1009 <field id="toce" axis_ref="deptht"/> <!-- overwrite axis def --> 1010 </group> 1011 </field_definition> 1012 \end{verbatim} 1013 }}\end{alltt} 1014 1015 example 4, group of files: define a group of file with the attribute output\_freq equal to 432000 (5 days) 1016 \vspace{-30pt} 1017 \begin{alltt} {{\scriptsize 1018 \begin{verbatim} 1019 <file_definition> 1020 <group id="5d" output_freq="432000"> <!-- 5d files --> 1021 <file id="5d_grid_T" name="auto"> <!-- T grid file --> 1022 ... 1023 </file> 1024 <file id="5d_grid_U" name="auto"> <!-- U grid file --> 1025 ... 1026 </file> 1027 </group> 1028 </file_definition> 1029 \end{verbatim} 1030 }}\end{alltt} 1031 1032 \subsubsection{Control of the xml attributes from NEMO} 1033 1034 The values of some attributes are automatically defined by NEMO (and any definition 1035 given in the xml file is overwritten). By convention, these attributes are defined to ''auto'' 1036 (for string) or ''0000'' (for integer) in the xml file (but this is not necessary). 1037 1038 Here is the list of these attributes: \\ 1039 1040 %table to be created here.... 1041 1042 tag ids affected by automatic definition of some of their attributes 1043 1044 name attribute 1045 attribute value 1046 field\_definition 1047 freq\_op 1048 \np{rn\_rdt} (namelist) 1049 SBC 1050 freq\_op 1051 \np{rn\_rdt} $\times$ \np{nn\_fsbc} (namelist) 1052 1h, 2h, 3h, 4h, 6h, 12h 1053 1d, 3d, 5d 1054 1m, 2m, 3m, 4m, 6m 1055 1y, 2y, 5y, 10y 1056 \_grid\_T, \_grid\_U, \_grid\_V, \_grid\_W, \_icemod, \_ptrc\_T, \_diad\_T, \_scalar 1057 name 1058 filename defined by a call to rou{dia\_nam} following NEMO nomenclature 1059 EqT, EqU, EqW 1060 jbegin, ni, name\_suffix 1061 according to the grid 1062 TAO, RAMA and PIRATA moorings 1063 ibegin, jbegin, name\_suffix 1064 according to the grid 1065 1066 1067 \subsection{ Detailed functionalities } 1068 1069 \subsubsection{Tag list} 1070 1071 1072 Table might be easier to read: % table to create 1073 1074 Tag 1075 Description 1076 Accepted attribute 1077 Accepted attribute value(s) 1078 Parent tag 1079 context 1080 define the model using the xml file 1081 id 1082 "nemo" or "n\_nemo" for the nth AGRIF zoom. 1083 simulation 1084 1085 What do you think, Seb? 1086 1087 1088 \begin{description} 1089 1090 \item[context]: define the model using the xml file. Id is the only attribute accepted. 1091 Its value must be ''nemo'' or ''n\_nemo'' for the nth AGRIF zoom. Child of simulation tag. 1092 1093 \item[field]: define the field to be output. Accepted attributes are axis\_ref, description, enable, 1094 freq\_op, grid\_ref, id (if child of field\_definition), level, operation, name, ref (if child of file), 1095 unit, zoom\_ref. Child of field\_definition, file or group of fields tag. 1096 1097 \item[field\_definition]: definition of the part of the xml file corresponding to the field definition. 1098 Accept the same attributes as field tag. Child of context tag. 1099 1100 \item[group]: define a group of file or field. Accept the same attributes as file or field. 1101 1102 \item[file]: define the output fileÕs characteristics. Accepted attributes are description, enable, 1103 output\_freq, output\_level, id, name, name\_suffix. Child of file\_definition or group of files tag. 1104 1105 \item[file\_definition]: definition of the part of the xml file corresponding to the file definition. 1106 Accept the same attributes as file tag. Child of context tag. 1107 1108 \item[axis]: definition of the vertical axis. Accepted attributes are description, id, positive, size, unit. 1109 Child of axis\_definition tag. 1110 1111 \item[axis\_definition]: definition of the part of the xml file corresponding to the vertical axis definition. 1112 Accept the same attributes as axis tag. Child of context tag 1113 1114 \item[grid]: definition of the horizontal grid. Accepted attributes are description and id. 1115 Child of axis\_definition tag. 1116 1117 \item[grid\_definition]: definition of the part of the xml file corresponding to the horizontal grid definition. 1118 Accept the same attributes as grid tag. Child of context tag 1119 1120 \item[zoom]: definition of a subdomain of an horizontal grid. Accepted attributes are description, id, 1121 i/jbegin, ni/j. Child of grid tag. 1122 1123 \end{description} 1124 1125 1126 \subsubsection{Attributes list} 1127 1128 Applied to a tag or a group of tags. 1129 1130 % table to be added ? 1131 Another table, perhaps? 1132 1133 %%%% 1134 1135 Attribute 1136 Applied to? 1137 Definition 1138 Comment 1139 axis\_ref 1140 field 1141 String defining the vertical axis of the variable. It refers to the id of the vertical axis defined in the axis tag. 1142 Use ''non'' if the variable has no vertical axis 1143 1144 %%%%%% 1145 1146 \begin{description} 1147 1148 \item[axis\_ref]: field attribute. String defining the vertical axis of the variable. 1149 It refers to the id of the vertical axis defined in the axis tag. 1150 Use ''none'' if the variable has no vertical axis 1151 1152 \item[description]: this attribute can be applied to all tags but it is used only with the field tag. 1153 In this case, the value of description will be used to define, in the output netcdf file, 1154 the attributes long\_name and standard\_name of the variable. 1155 1156 \item[enabled]: field and file attribute. Logical to switch on/off the output of a field or a file. 1157 1158 \item[freq\_op]: field attribute (automatically defined, see part 1.4 (''control of the xml attributes'')). 1159 An integer defining the frequency in seconds at which NEMO is calling iom\_put for this variable. 1160 It corresponds to the model time step (rn\_rdt in the namelist) except for the variables computed 1161 at the frequency of the surface boundary condition (rn\_rdt ? nn\_fsbc in the namelist). 1162 1163 \item[grid\_ref]: field attribute. String defining the horizontal grid of the variable. 1164 It refers to the id of the grid tag. 1165 1166 \item[ibegin]: zoom attribute. Integer defining the zoom starting point along x direction. 1167 Automatically defined for TAO/RAMA/PIRATA moorings (see part 1.4). 1168 1169 \item[id]: exists for all tag. This is a string defining the name to a specific tag that will be used 1170 later to refer to this tag. Tags of the same category must have different ids. 1171 1172 \item[jbegin]: zoom attribute. Integer defining the zoom starting point along y direction. 1173 Automatically defined for TAO/RAMA/PIRATA moorings and equatorial section (see part 1.4). 1174 1175 \item[level]: field attribute. Integer from 0 to 10 defining the output priority of a field. 1176 See output\_level attribute definition 1177 1178 \item[operation]: field attribute. String defining the type of temporal operation to perform on a variable. 1179 Possible choices are ''ave(X)'' for temporal mean, ''inst(X)'' for instantaneous, ''t\_min(X)'' for temporal min 1180 and ''t\_max(X)'' for temporal max. 1181 1182 \item[output\_freq]: file attribute. Integer defining the operation frequency in seconds. 1183 For example 86400 for daily mean. 1184 1185 \item[output\_level]: file attribute. Integer from 0 to 10 defining the output priority of variables in a file: 1186 all variables listed in the file with a level smaller or equal to output\_level will be output. 1187 Other variables wonÕt be output even if they are listed in the file. 1188 1189 \item[positive]: axis attribute (always .FALSE.). Logical defining the vertical axis convention used 1190 in \NEMO (positive downward). Define the attribute positive of the variable in the netcdf output file. 1191 1192 \item[prec]: field attribute. Integer defining the output precision. 1193 Not implemented, we always output real4 arrays. 1194 1195 \item[name]: field or file attribute. String defining the name of a variable or a file. 1196 If the name of a file is undefined, its id is used as a name. 2 files must have different names. 1197 Files with specific ids will have their name automatically defined (see part 1.4). 1198 Note that is name will be automatically completed by the cpu number (if needed) and ''.nc'' 1199 1200 \item[name\_suffix]: file attribute. String defining a suffix to be inserted after the name 1201 and before the cpu number and the ''.nc'' termination. Files with specific ids have an 1202 automatic definition of their suffix (see part 1.4). 1203 1204 \item[ni]: zoom attribute. Integer defining the zoom extent along x direction. 1205 Automatically defined for equatorial sections (see part 1.4). 1206 1207 \item[nj]: zoom attribute. Integer defining the zoom extent along x direction. 1208 1209 \item[ref]: field attribute. String referring to the id of the field we want to add in a file. 1210 1211 \item[size]: axis attribute. use unknown... 1212 1213 \item[unit]: field attribute. String defining the unit of a variable and the associated 1214 attribute in the netcdf output file. 1215 1216 \item[zoom\_ref]: field attribute. String defining the subdomain of data on which 1217 the file should be written (to ouput data only in a limited area). 1218 It refers to the id of a zoom defined in the zoom tag. 1219 \end{description} 1220 1221 1222 \subsection{IO\_SERVER} 1223 1224 \subsubsection{Attached or detached mode?} 1225 1226 Iom\_put is based on the io\_server developed by Yann Meurdesoif from IPSL 1227 (see \href{http://forge.ipsl.jussieu.fr/ioserver/browser}{here} for the source code or 1228 see its copy in NEMOGCM/EXTERNAL directory). 1229 This server can be used in ''attached mode'' (as a library) or in ''detached mode'' 1230 (as an external executable on n cpus). In attached mode, each cpu of NEMO will output 1231 its own subdomain. In detached mode, the io\_server will gather data from NEMO 1232 and output them split over n files with n the number of cpu dedicated to the io\_server. 1233 1234 \subsubsection{Control the io\_server: the namelist file xmlio\_server.def} 1235 1236 % 1237 %Again, a small table might be more readable? 1238 %Name 1239 %Type 1240 %Description 1241 %Comment 1242 %Using_server 1243 %Logical 1244 %Switch to use the server in attached or detached mode 1245 %(.TRUE. corresponding to detached mode). 1246 1247 The control of the use of the io\_server is done through the namelist file of the io\_server 1248 called xmlio\_server.def. 1249 1250 \textbf{using\_server}: logical, switch to use the server in attached or detached mode 1251 (.TRUE. corresponding to detached mode). 1252 1253 \textbf{using\_oasis}: logical, set to .TRUE. if NEMO is used in coupled mode. 1254 1255 \textbf{client\_id} = ''oceanx'' : character, used only in coupled mode. 1256 Specify the id used in OASIS to refer to NEMO. The same id must be used to refer to NEMO 1257 in the \$NBMODEL part of OASIS namcouple in the call of prim\_init\_comp\_proto in cpl\_oasis3f90 1258 1259 \textbf{server\_id} = ''ionemo'' : character, used only in coupled mode. 1260 Specify the id used in OASIS to refer to the IO\_SERVER when used in detached mode. 1261 Use the same id to refer to the io\_server in the \$NBMODEL part of OASIS namcouple. 1262 1263 \textbf{global\_mpi\_buffer\_size}: integer; define the size in Mb of the MPI buffer used by the io\_server. 1264 1265 \subsubsection{Number of cpu used by the io\_server in detached mode} 1266 1267 The number of cpu used by the io\_server is specified only when launching the model. 1268 Here is an example of 2 cpus for the io\_server and 6 cpu for opa using mpirun: 1269 1270 \texttt{ -p 2 -e ./ioserver} 1271 1272 \texttt{ -p 6 -e ./opa } 1273 1274 1275 \subsection{Practical issues} 1276 1277 \subsubsection{Add your own outputs} 1278 1279 It is very easy to add you own outputs with iom\_put. 4 points must be followed. 1280 \begin{description} 1281 \item[1-] in NEMO code, add a \\ 1282 \texttt{ CALL iom\_put( 'identifier', array ) } \\ 1283 where you want to output a 2D or 3D array. 1284 1285 \item[2-] don't forget to add \\ 1286 \texttt{ USE iom ! I/O manager library } \\ 1287 in the list of used modules in the upper part of your module. 1288 1289 \item[3-] in the file\_definition part of the xml file, add the definition of your variable using the same identifier you used in the f90 code. 1290 \vspace{-20pt} 1291 \begin{alltt} {{\scriptsize 1292 \begin{verbatim} 1293 <field_definition> 1294 ... 1295 <field id="identifier" description="blabla" /> 1296 ... 1297 </field_definition> 1298 \end{verbatim} 1299 }}\end{alltt} 1300 attributes axis\_ref and grid\_ref must be consistent with the size of the array to pass to iom\_put. 1301 if your array is computed within the surface module each nn\_fsbc time\_step, 1302 add the field definition within the group defined with the id ''SBC'': $<$group id=''SBC''...$>$ 1303 1304 \item[4-] add your field in one of the output files \\ 1305 \vspace{-20pt} 1306 \begin{alltt} {{\scriptsize 1307 \begin{verbatim} 1308 <file id="file_1" .../> 1309 ... 1310 <field ref="identifier" /> 1311 ... 1312 </file> 1313 \end{verbatim} 1314 }}\end{alltt} 1315 1316 \end{description} 1317 1318 \subsubsection{Several time axes in the output file} 1319 1320 If your output file contains variables with different operations (see operation definition), 1321 IOIPSL will create one specific time axis for each operation. Note that inst(X) will have 1322 a time axis corresponding to the end each output period whereas all other operators 1323 will have a time axis centred in the middle of the output periods. 1324 1325 \subsubsection{Error/bug messages from IOIPSL} 1326 1327 If you get the following error in the standard output file: 1328 \vspace{-20pt} 1329 \begin{alltt} {{\scriptsize 1330 \begin{verbatim} 1331 FATAL ERROR FROM ROUTINE flio_dom_set 1332 --> too many domains simultaneously defined 1333 --> please unset useless domains 1334 --> by calling flio_dom_unset 1335 \end{verbatim} 1336 }}\end{alltt} 1337 1338 You must increase the value of dom\_max\_nb in fliocom.f90 (multiply it by 10 for example). 1339 1340 If you mix, in the same file, variables with different freq\_op (see definition above), 1341 like for example variables from the surface module with other variables, 1342 IOIPSL will print in the standard output file warning messages saying there may be a bug. 1343 \vspace{-20pt} 1344 \begin{alltt} {{\scriptsize 1345 \begin{verbatim} 1346 WARNING FROM ROUTINE histvar_seq 1347 --> There were 10 errors in the learned sequence of variables 1348 --> for file 4 1349 --> This looks like a bug, please report it. 1350 \end{verbatim} 1351 }}\end{alltt} 1352 1353 Don't worry, there is no bug, everything is properly working! 1354 1355 } %end \gmcomment 1356 % ================================================================ 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368
Note: See TracChangeset
for help on using the changeset viewer.