Axis.lyx 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. #LyX 2.1 created this file. For more info see http://www.lyx.org/
  2. \lyxformat 474
  3. \begin_document
  4. \begin_header
  5. \textclass book
  6. \use_default_options true
  7. \master ../../XIOS_user_guide.lyx
  8. \maintain_unincluded_children false
  9. \language english
  10. \language_package default
  11. \inputencoding auto
  12. \fontencoding global
  13. \font_roman default
  14. \font_sans default
  15. \font_typewriter default
  16. \font_math auto
  17. \font_default_family default
  18. \use_non_tex_fonts false
  19. \font_sc false
  20. \font_osf false
  21. \font_sf_scale 100
  22. \font_tt_scale 100
  23. \graphics default
  24. \default_output_format default
  25. \output_sync 0
  26. \bibtex_command default
  27. \index_command default
  28. \float_placement !tph
  29. \paperfontsize default
  30. \spacing single
  31. \use_hyperref false
  32. \papersize a4paper
  33. \use_geometry false
  34. \use_package amsmath 1
  35. \use_package amssymb 1
  36. \use_package cancel 1
  37. \use_package esint 1
  38. \use_package mathdots 1
  39. \use_package mathtools 1
  40. \use_package mhchem 1
  41. \use_package stackrel 1
  42. \use_package stmaryrd 1
  43. \use_package undertilde 1
  44. \cite_engine basic
  45. \cite_engine_type default
  46. \biblio_style plain
  47. \use_bibtopic false
  48. \use_indices false
  49. \paperorientation portrait
  50. \suppress_date false
  51. \justification true
  52. \use_refstyle 1
  53. \index Index
  54. \shortcut idx
  55. \color #008000
  56. \end_index
  57. \secnumdepth 3
  58. \tocdepth 3
  59. \paragraph_separation indent
  60. \paragraph_indentation default
  61. \quotes_language english
  62. \papercolumns 1
  63. \papersides 1
  64. \paperpagestyle default
  65. \tracking_changes false
  66. \output_changes false
  67. \html_math_output 0
  68. \html_css_as_file 0
  69. \html_be_strict false
  70. \end_header
  71. \begin_body
  72. \begin_layout Chapter
  73. Axis
  74. \end_layout
  75. \begin_layout Standard
  76. Like Domain, Axis is a sub-component of Grid but is one dimension.
  77. In meteorological applications, axis represents a vertical line with different
  78. levels.
  79. \end_layout
  80. \begin_layout Section
  81. Working with configuration file
  82. \end_layout
  83. \begin_layout Standard
  84. The way to define an axis with configuration file is similar to define a
  85. domain.
  86. \end_layout
  87. \begin_layout Subsection
  88. Basic configuration
  89. \end_layout
  90. \begin_layout Standard
  91. Similar to domain, an axis is defined inside its definition part with the
  92. tag
  93. \series bold
  94. \color black
  95. axis_definition
  96. \series default
  97. \color inherit
  98. .
  99. \begin_inset listings
  100. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  101. inline false
  102. status open
  103. \begin_layout Plain Layout
  104. <axis_definition>
  105. \end_layout
  106. \begin_layout Plain Layout
  107. <axis id="axis_A" />
  108. \end_layout
  109. \begin_layout Plain Layout
  110. <axis axis_ref="axis_A" />
  111. \end_layout
  112. \begin_layout Plain Layout
  113. </axis_definition>
  114. \end_layout
  115. \end_inset
  116. \end_layout
  117. \begin_layout Standard
  118. The first one is to specify explicitly identification of an axis with an
  119. id.
  120. \end_layout
  121. \begin_layout Standard
  122. \begin_inset listings
  123. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  124. inline false
  125. status open
  126. \begin_layout Plain Layout
  127. <axis_definition>
  128. \end_layout
  129. \begin_layout Plain Layout
  130. <axis id="axis_A" />
  131. \end_layout
  132. \begin_layout Plain Layout
  133. </axis_definition>
  134. \end_layout
  135. \end_inset
  136. \end_layout
  137. \begin_layout Standard
  138. In this way, with id, the axis can be processed, e.x modified its attributes,
  139. with Fortran interface; besides, it is only possible to reference to a
  140. axis whose id is explicitly defined.
  141. \end_layout
  142. \begin_layout Standard
  143. To make a reference to an axis, we use axis_ref
  144. \end_layout
  145. \begin_layout Standard
  146. \begin_inset listings
  147. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  148. inline false
  149. status open
  150. \begin_layout Plain Layout
  151. <axis_definition>
  152. \end_layout
  153. \begin_layout Plain Layout
  154. <axis axis_ref="axis_A" />
  155. \end_layout
  156. \begin_layout Plain Layout
  157. </axis_definition>
  158. \end_layout
  159. \end_inset
  160. \end_layout
  161. \begin_layout Standard
  162. An axis defined by axis_ref will inherit all attributes of the referenced
  163. one, except its id attribute.
  164. If there is no id specified, an implicit one is assigned to this new axis.
  165. The axis with implicit id can only be used inside the scope where it is
  166. defined, it can not be referenced, nor be processed.
  167. It is rare to define an axis without id inside axis_definition.
  168. \end_layout
  169. \begin_layout Standard
  170. To define a new axis inside a grid, we use the tag
  171. \series bold
  172. \color black
  173. axis.
  174. \end_layout
  175. \begin_layout Standard
  176. \begin_inset listings
  177. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  178. inline false
  179. status open
  180. \begin_layout Plain Layout
  181. <grid id="grid_A">
  182. \end_layout
  183. \begin_layout Plain Layout
  184. <axis axis_ref="axis_A" />
  185. \end_layout
  186. \begin_layout Plain Layout
  187. </grid>
  188. \end_layout
  189. \end_inset
  190. \end_layout
  191. \begin_layout Standard
  192. The xml lines above can be translated as: the grid_A composed of an axis_A
  193. that is defined somewhere else before.
  194. More precisely, the grid grid_A is constituted of a
  195. \begin_inset Quotes eld
  196. \end_inset
  197. unknown id
  198. \begin_inset Quotes erd
  199. \end_inset
  200. axis which has inherited all attributes (and their values) from axis A
  201. (name, long name, i_index, j_index, ...
  202. etc).
  203. \end_layout
  204. \begin_layout Subsection
  205. Advanced configuration
  206. \end_layout
  207. \begin_layout Standard
  208. Like domain, there are several transformation which can be defined with
  209. configuration file.
  210. All transformations on an axis have form *_axis.
  211. \end_layout
  212. \begin_layout Standard
  213. Till now, XIOS supports the following transformation on axis:
  214. \end_layout
  215. \begin_layout Itemize
  216. zoom_axis: Like zoom functionality in XIOS 1.0, the destination grid is the
  217. zoomed region of the source grid.
  218. \end_layout
  219. \begin_layout Itemize
  220. interpolation_axis: Implement interpolation from an axis to one another.
  221. For now, only polynominal interpolation is available.
  222. \end_layout
  223. \begin_layout Itemize
  224. inverse_axis: Inverse an axis
  225. \end_layout
  226. \begin_layout Standard
  227. It is not difficult to define a transformation: Include type of transformation
  228. inside axis definition, as the following
  229. \end_layout
  230. \begin_layout Standard
  231. \begin_inset listings
  232. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  233. inline false
  234. status open
  235. \begin_layout Plain Layout
  236. <axis_definition>
  237. \end_layout
  238. \begin_layout Plain Layout
  239. <axis id="axis_A" />
  240. \end_layout
  241. \begin_layout Plain Layout
  242. <axis id="axis_A_zoom" axis_ref="axis_A">
  243. \end_layout
  244. \begin_layout Plain Layout
  245. <zoom_axis zoom_begin="1" zoom_n="3"/>
  246. \end_layout
  247. \begin_layout Plain Layout
  248. </axis>
  249. \end_layout
  250. \begin_layout Plain Layout
  251. </axis_definition>
  252. \end_layout
  253. \end_inset
  254. \end_layout
  255. \begin_layout Standard
  256. The concrete example is translated as: the axis named axis_A_zoom is transformed
  257. from axis name axis_A with a zoom activity.
  258. The detailed attributes of zoom_axis can be found in reference document,
  259. but simply it contains the begining and size of zoomed region.
  260. \end_layout
  261. \begin_layout Standard
  262. One remark is the transformed axis SHOULD have an id, in this case, it's
  263. axis_A_zoom.
  264. As mentioned before, a no-id axis or any no-id component of XIOS can only
  265. be used inside its definition scope.
  266. \end_layout
  267. \begin_layout Standard
  268. To make use of transformation, the grid must contain axis which references
  269. to transformed ones.
  270. \end_layout
  271. \begin_layout Standard
  272. \begin_inset listings
  273. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  274. inline false
  275. status open
  276. \begin_layout Plain Layout
  277. <grid id="grid_A">
  278. \end_layout
  279. \begin_layout Plain Layout
  280. <axis axis_ref="axis_A" />
  281. \end_layout
  282. \begin_layout Plain Layout
  283. </grid>
  284. \end_layout
  285. \begin_layout Plain Layout
  286. <grid id="grid_A_zoom">
  287. \end_layout
  288. \begin_layout Plain Layout
  289. <axis axis_ref="axis_A_zoom" />
  290. \end_layout
  291. \begin_layout Plain Layout
  292. </grid>
  293. \end_layout
  294. \end_inset
  295. \end_layout
  296. \begin_layout Standard
  297. On defining this way, we tell XIOS to establish a connection between two
  298. grids by a transformation (zoom) with: grid source - grid_A, grid destination
  299. - grid_A_zoom.
  300. \end_layout
  301. \begin_layout Standard
  302. As mentioned in Grid Chapter, in order to use transformed grid, just reference
  303. to it in field_definition
  304. \end_layout
  305. \begin_layout Standard
  306. \begin_inset listings
  307. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  308. inline false
  309. status open
  310. \begin_layout Plain Layout
  311. <field_definition level="1" enabled=".TRUE." default_value="9.96921e+36">
  312. \end_layout
  313. \begin_layout Plain Layout
  314. <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"
  315. />
  316. \end_layout
  317. \begin_layout Plain Layout
  318. <field id="field_A_zoom" operation="average" freq_op="3600s" grid_ref="grid_A
  319. _zoom" />
  320. \end_layout
  321. \begin_layout Plain Layout
  322. </field_definition>
  323. \end_layout
  324. \end_inset
  325. \end_layout
  326. \begin_layout Standard
  327. Although xml is helpful to define several configurations, it can not be
  328. used to customize attributes of axis.
  329. So it's the turn of Fortran interface.
  330. \end_layout
  331. \begin_layout Section
  332. Working with FORTRAN code
  333. \end_layout
  334. \begin_layout Standard
  335. Although axis is not as complexe as domain, there are some mandatory attributes
  336. to define.
  337. Different from precedent version, XIOS 2.0 supports distribution of data
  338. on a axis.
  339. The followings describe the essential parts of axis.
  340. Details of its attributes and operations can be found in XIOS reference
  341. guide.
  342. \end_layout
  343. \begin_layout Subsection
  344. Local axis index
  345. \end_layout
  346. \begin_layout Standard
  347. Axis is often used with domain, which is broken into several distributed
  348. pieces, to make a 3 dimension grid.
  349. However, there are cases in which data on axis are distributed among processes.
  350. Following we consider a simple case: a axis with global size 9 and its
  351. data are distributed evenly among 3 client processes, each of which has
  352. size 3.
  353. \end_layout
  354. \begin_layout Standard
  355. \begin_inset Float figure
  356. placement !tbph
  357. wide false
  358. sideways false
  359. status open
  360. \begin_layout Plain Layout
  361. \begin_inset Graphics
  362. filename ../images/Distributed_Axis.pdf
  363. lyxscale 50
  364. scale 60
  365. \end_inset
  366. \end_layout
  367. \begin_layout Plain Layout
  368. \begin_inset Caption Standard
  369. \begin_layout Plain Layout
  370. Global axis data
  371. \end_layout
  372. \end_inset
  373. \begin_inset CommandInset label
  374. LatexCommand label
  375. name "globalAxis"
  376. \end_inset
  377. \end_layout
  378. \end_inset
  379. \end_layout
  380. \begin_layout Standard
  381. The local axis can be described by the following way.
  382. \end_layout
  383. \begin_layout Standard
  384. Specify the the beginning and size of local axis with:
  385. \end_layout
  386. \begin_layout Itemize
  387. n_glo: global size of axis.
  388. \end_layout
  389. \begin_layout Itemize
  390. begin: global position where a local axis begin
  391. \end_layout
  392. \begin_layout Itemize
  393. n: local size of axis on each process
  394. \end_layout
  395. \begin_layout Standard
  396. For example, the local axis in the middle (the yellow one) can be specified
  397. with:
  398. \end_layout
  399. \begin_layout Standard
  400. \begin_inset listings
  401. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  402. inline false
  403. status open
  404. \begin_layout Plain Layout
  405. CALL xios_set_axis_attr("axis_A",n_glo=9, begin=3, n=3)
  406. \end_layout
  407. \end_inset
  408. \end_layout
  409. \begin_layout Subsection
  410. Local axis data
  411. \end_layout
  412. \begin_layout Standard
  413. Simpler than local domain data, data on axis is always on-dimension.
  414. Like local domain data, local axis data represent the data offset from
  415. local axis, and it can be defined in two ways.
  416. \end_layout
  417. \begin_layout Standard
  418. Specify the begining and size of data on the local axis:
  419. \end_layout
  420. \begin_layout Itemize
  421. data_begin: the local position of data on axis where data begins
  422. \end_layout
  423. \begin_layout Itemize
  424. data_n: size of data on each local axis
  425. \end_layout
  426. \begin_layout Standard
  427. Or specify data with its position in the local axis:
  428. \end_layout
  429. \begin_layout Itemize
  430. data_index: array of local position of data in the local axis.
  431. \end_layout
  432. \begin_layout Standard
  433. Although the valid data must be inside a local axis, it is not neccessary
  434. for data to have same size.
  435. In fact, data can have larger size than local axis.
  436. \end_layout
  437. \begin_layout Standard
  438. \begin_inset listings
  439. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  440. inline false
  441. status open
  442. \begin_layout Plain Layout
  443. CALL xios_set_axis_attr("axis_A", data_begin=-1, data_n=n+2)
  444. \end_layout
  445. \end_inset
  446. \end_layout
  447. \begin_layout Standard
  448. For local axis_A, the negative value of data_begin indicates that data is
  449. larger than local axis, the valid part of data needs extracted from the
  450. real data.
  451. If data_begin has a positive value, that means data size is smaller than
  452. local axis.
  453. The default value of data_begin is 0, which implies that local data fit
  454. into local axis properly.
  455. \end_layout
  456. \begin_layout Standard
  457. Loal data can be defined with:
  458. \end_layout
  459. \begin_layout Standard
  460. \begin_inset listings
  461. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  462. inline false
  463. status open
  464. \begin_layout Plain Layout
  465. CALL xios_set_axis_attr("axis_A",data_index=data)
  466. \end_layout
  467. \end_inset
  468. \end_layout
  469. \begin_layout Standard
  470. with
  471. \end_layout
  472. \begin_layout Itemize
  473. data = {-1,0,1,2,3}
  474. \end_layout
  475. \begin_layout Subsection
  476. Value
  477. \end_layout
  478. \begin_layout Standard
  479. Value of axis plays a same role as longitude and latitude of domain.
  480. As local data, it can be distributed among processes.
  481. \end_layout
  482. \begin_layout Standard
  483. \begin_inset listings
  484. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  485. inline false
  486. status open
  487. \begin_layout Plain Layout
  488. CALL xios_set_axis_attr("axis_A", value=valueAxis)
  489. \end_layout
  490. \end_inset
  491. \end_layout
  492. \begin_layout Standard
  493. with
  494. \end_layout
  495. \begin_layout Itemize
  496. valueAxis = {30, 40, 50}
  497. \end_layout
  498. \begin_layout Standard
  499. Because there is a need of direction of an axis, then comes the attribute
  500. positive
  501. \end_layout
  502. \begin_layout Standard
  503. \begin_inset listings
  504. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  505. inline false
  506. status open
  507. \begin_layout Plain Layout
  508. CALL xios_set_axis_attr("axis_A", positive='up')
  509. \end_layout
  510. \end_inset
  511. \end_layout
  512. \begin_layout Standard
  513. All attributes of axis can be found in Reference Guide.
  514. \end_layout
  515. \begin_layout Standard
  516. \end_layout
  517. \end_body
  518. \end_document