Domain.lyx 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  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. Domain
  74. \end_layout
  75. \begin_layout Standard
  76. Domain is a two dimensional coordinates, which can be considered to be composed
  77. of two axis: y-axis and x-axis.
  78. However, different from two axis composed mechanically, a domain contains
  79. more typical information which play an important role in specific cases.
  80. Very often, in meteorological applications, domain represents a surface
  81. with latitude and longitude.
  82. \end_layout
  83. \begin_layout Section
  84. Working with configuration file
  85. \end_layout
  86. \begin_layout Subsection
  87. Basic configuration
  88. \end_layout
  89. \begin_layout Standard
  90. Similar to Grid as well as other components in XIOS, a domain is defined
  91. inside its definition part with the tag
  92. \series bold
  93. \color black
  94. domain_definition
  95. \series default
  96. \color inherit
  97. .
  98. \begin_inset listings
  99. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  100. inline false
  101. status open
  102. \begin_layout Plain Layout
  103. <domain_definition>
  104. \end_layout
  105. \begin_layout Plain Layout
  106. <domain id="domain_A" />
  107. \end_layout
  108. \begin_layout Plain Layout
  109. <domain domain_ref="domain_A" />
  110. \end_layout
  111. \begin_layout Plain Layout
  112. </domain_definition>
  113. \end_layout
  114. \end_inset
  115. \end_layout
  116. \begin_layout Standard
  117. The first one is to specify explicitly identification of a domain with an
  118. id.
  119. One repetition, id of any component in XIOS are
  120. \shape italic
  121. \color black
  122. unique
  123. \shape default
  124. \color inherit
  125. among this kind of components.
  126. It is not allowed to have two domains with a same id, but it is permitted
  127. a domain and a grid, for example, to share a same one.
  128. \end_layout
  129. \begin_layout Standard
  130. \begin_inset listings
  131. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  132. inline false
  133. status open
  134. \begin_layout Plain Layout
  135. <domain_definition>
  136. \end_layout
  137. \begin_layout Plain Layout
  138. <domain id="domain_A" />
  139. \end_layout
  140. \begin_layout Plain Layout
  141. </domain_definition>
  142. \end_layout
  143. \end_inset
  144. \end_layout
  145. \begin_layout Standard
  146. In this way, with id, the domain can be processed, e.x modified its attributes,
  147. with Fortran interface; besides, it is only possible to reference to a
  148. domain whose id is explicitly defined.
  149. \end_layout
  150. \begin_layout Standard
  151. Very often, after a domain is defined, it may be referenced many times.
  152. To make a reference to a domain, we use domain_ref
  153. \end_layout
  154. \begin_layout Standard
  155. \begin_inset listings
  156. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  157. inline false
  158. status open
  159. \begin_layout Plain Layout
  160. <domain_definition>
  161. \end_layout
  162. \begin_layout Plain Layout
  163. <domain domain_ref="domain_A" />
  164. \end_layout
  165. \begin_layout Plain Layout
  166. </domain_definition>
  167. \end_layout
  168. \end_inset
  169. \end_layout
  170. \begin_layout Standard
  171. A domain defined by domain_ref will inherit all attributes of the referenced
  172. one, except its id attribute.
  173. If there is no id specified, an implicit one is assigned to this new domain.
  174. The domain with implicit id can only be used inside the scope where it
  175. is defined, it can not be referenced, nor be processed.
  176. It is rare to define a domain without id inside domain_definition.
  177. However, the domain_ref is utilized widely outside the scope of domain_definiti
  178. on.
  179. \end_layout
  180. \begin_layout Standard
  181. Because a domain is a sub component of grid, it is possible to define a
  182. new domain inside a grid with the tag
  183. \series bold
  184. \color black
  185. domain.
  186. \series default
  187. \color inherit
  188. Moreover it is the only region where we can define a new domain outside
  189. domain_definition.
  190. \end_layout
  191. \begin_layout Standard
  192. \begin_inset listings
  193. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  194. inline false
  195. status open
  196. \begin_layout Plain Layout
  197. <grid id="grid_A">
  198. \end_layout
  199. \begin_layout Plain Layout
  200. <domain domain_ref="domain_A" />
  201. \end_layout
  202. \begin_layout Plain Layout
  203. </grid>
  204. \end_layout
  205. \end_inset
  206. \end_layout
  207. \begin_layout Standard
  208. The xml lines above can be translated as: the grid_A composed of a domain_A
  209. that is defined somewhere else before.
  210. More precisely, the grid grid_A is constituted of a
  211. \begin_inset Quotes eld
  212. \end_inset
  213. unknown id
  214. \begin_inset Quotes erd
  215. \end_inset
  216. domain which has inherited all attributes (and their values) from domain
  217. A (name, long name, i_index, j_index, ...
  218. etc).
  219. \end_layout
  220. \begin_layout Standard
  221. With this approach, we only define a domain once but reuse it as many time
  222. as we like in different configurations.
  223. \end_layout
  224. \begin_layout Subsection
  225. Advanced configuration
  226. \end_layout
  227. \begin_layout Standard
  228. One of a new concept which differenciates XIOS 2.0 from its precedent is
  229. transformation.
  230. In a simple case, zoom feature is now considered to be a transformation.
  231. It can be more complicated for other geometric transformation such as inversion
  232. or interpolation.
  233. All transformation are taken place on grid level.
  234. It means that it is neccessary to define a grid source and a grid destination
  235. as well as a transformation or list of transformation which we'd like to
  236. have.
  237. In order to transform a grid to one another, we need to specify a transformatio
  238. n on its sub-component: domain or axis.
  239. \end_layout
  240. \begin_layout Standard
  241. Because transformation on a domain is different from one on an axis, we
  242. differenciate two categories of transformation: transformation_domain and
  243. transformation_axis.
  244. \end_layout
  245. \begin_layout Standard
  246. Till now, XIOS supports the following transformation on domain:
  247. \end_layout
  248. \begin_layout Itemize
  249. zoom_domain: Like zoom functionality in XIOS 1.0, the destination grid is
  250. the zoomed region of the source grid.
  251. \end_layout
  252. \begin_layout Itemize
  253. interpolation_domain: Implement interpolation from a domain to one another,
  254. for now XIOS can only do interpolation by reading calculated weight values
  255. from a file or calculate the weights on the fly.
  256. \end_layout
  257. \begin_layout Itemize
  258. generate_rectilinear_domain: auto generating, distributing a rectilinear
  259. domain then filling all mandatory attributes.
  260. \end_layout
  261. \begin_layout Standard
  262. It is not difficult to define a transformation: Include type of transformation
  263. inside domain definition, as the following
  264. \end_layout
  265. \begin_layout Standard
  266. \begin_inset listings
  267. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  268. inline false
  269. status open
  270. \begin_layout Plain Layout
  271. <domain_definition>
  272. \end_layout
  273. \begin_layout Plain Layout
  274. <domain id="domain_A" />
  275. \end_layout
  276. \begin_layout Plain Layout
  277. <domain id="domain_A_zoom" domain_ref="domain_A">
  278. \end_layout
  279. \begin_layout Plain Layout
  280. <zoom_domain zoom_ibegin="1" zoom_ni="3" zoom_jbegin="0" zoom_nj="2"/>
  281. \end_layout
  282. \begin_layout Plain Layout
  283. </domain>
  284. \end_layout
  285. \begin_layout Plain Layout
  286. </domain_definition>
  287. \end_layout
  288. \end_inset
  289. \end_layout
  290. \begin_layout Standard
  291. The concrete example above tells many things: a domain named domain_A_zoom
  292. is transformed from domain name domain_A with a zoom activity.
  293. The domain_A_zoom is the zoomed region of domain_A.
  294. The detailed attributes of zoom_domain can be found in reference document,
  295. but simply it contains the begining and size of zoomed region.
  296. \end_layout
  297. \begin_layout Standard
  298. One remark is the transformed domain SHOULD have an id, in this case, it's
  299. domain_A_zoom.
  300. As mentioned before, a no-id domain or any no-id component of XIOS can
  301. only be used inside its definition scope.
  302. It exists but is useless.
  303. So care about that.
  304. \end_layout
  305. \begin_layout Standard
  306. To make use of transformation, the grid must contain domains which reference
  307. to transformed ones.
  308. \end_layout
  309. \begin_layout Standard
  310. \begin_inset listings
  311. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  312. inline false
  313. status open
  314. \begin_layout Plain Layout
  315. <grid id="grid_A">
  316. \end_layout
  317. \begin_layout Plain Layout
  318. <domain domain_ref="domain_A" />
  319. \end_layout
  320. \begin_layout Plain Layout
  321. </grid>
  322. \end_layout
  323. \begin_layout Plain Layout
  324. <grid id="grid_A_zoom">
  325. \end_layout
  326. \begin_layout Plain Layout
  327. <domain domain_ref="domain_A_zoom" />
  328. \end_layout
  329. \begin_layout Plain Layout
  330. </grid>
  331. \end_layout
  332. \end_inset
  333. \end_layout
  334. \begin_layout Standard
  335. On defining this way, we tell XIOS to establish a connection between two
  336. grids by a transformation (zoom) with: grid source - grid_A, grid destination
  337. - grid_A_zoom.
  338. \end_layout
  339. \begin_layout Standard
  340. As mentioned in Grid Chapter, in order to use transformed grid, just reference
  341. to it in field_definition
  342. \end_layout
  343. \begin_layout Standard
  344. \begin_inset listings
  345. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  346. inline false
  347. status open
  348. \begin_layout Plain Layout
  349. <field_definition level="1" enabled=".TRUE." default_value="9.96921e+36">
  350. \end_layout
  351. \begin_layout Plain Layout
  352. <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"
  353. />
  354. \end_layout
  355. \begin_layout Plain Layout
  356. <field id="field_A_zoom" operation="average" freq_op="3600s" grid_ref="grid_A
  357. _zoom" />
  358. \end_layout
  359. \begin_layout Plain Layout
  360. </field_definition>
  361. \end_layout
  362. \end_inset
  363. \end_layout
  364. \begin_layout Standard
  365. Although xml is helpful to define several configurations, it is not convenient
  366. to customize attributes of domain.
  367. So it's the turn of Fortran interface.
  368. \end_layout
  369. \begin_layout Section
  370. Working with FORTRAN code
  371. \end_layout
  372. \begin_layout Standard
  373. One of the important concepts to grasp in mind in using FORTRAN interface
  374. is the data distribution.
  375. With a distributed-memory XIOS, data are broken into disjoint blocks, one
  376. per client process.
  377. In the next sections, local describes everything related to a client process,
  378. whereas global means global data.
  379. The followings describe the essential parts of domain.
  380. Details of its attributes and operations can be found in XIOS reference
  381. guide
  382. \end_layout
  383. \begin_layout Subsection
  384. Domain type
  385. \end_layout
  386. \begin_layout Standard
  387. Domain is a two dimensional coordinates, which can be considered to be composed
  388. of two axis: y-axis and x-axis.
  389. However, different from two axis composed mechanically, a domain contains
  390. more typical information which play an important role in specific cases.
  391. Very often, in meteorological applications, domain represents a surface
  392. with latitude and longitude.
  393. Because these properties change from one domain type to another, it is
  394. recommended to use domain in case of representing a surface.
  395. \end_layout
  396. \begin_layout Standard
  397. In XIOS, a domain can be represented by one of three different types of
  398. coordinate system which also differentiate the way to represent latitude
  399. and longitude correspondingly.
  400. \end_layout
  401. \begin_layout Itemize
  402. rectilinear: a simple 2-dimensional Cartesian coordinates with two perpendicular
  403. axes.
  404. Latitude represents the y-axe while longitude represents the x-axe.
  405. \end_layout
  406. \begin_layout Itemize
  407. curvilinear: a 2-dimensional coordinates allows the generality of two axes
  408. not perpendicular to each other.
  409. Latitude and longitude have the size equivalent to size of local domain.
  410. \end_layout
  411. \begin_layout Itemize
  412. unstructured: not any of two above, the latitutude and longitude, as curvilinear
  413. , are reprensented with the help of boundaries.
  414. \end_layout
  415. \begin_layout Standard
  416. Different from XIOS 1.0, in this new version, users must explicitly specify
  417. the type of domain which they would like to use
  418. \end_layout
  419. \begin_layout Standard
  420. \begin_inset listings
  421. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  422. inline false
  423. status open
  424. \begin_layout Plain Layout
  425. CALL xios_set_domain_attr("domain_A",type='rectilinear')
  426. \end_layout
  427. \end_inset
  428. \end_layout
  429. \begin_layout Standard
  430. Althoug there are different domain types, they share the similar patterns
  431. to settle local data on a client process: There are some essential attributes
  432. to define.
  433. The next sections describe their meanings and how to specify correctly
  434. data for a local domain.
  435. \end_layout
  436. \begin_layout Subsection
  437. Local domain index
  438. \end_layout
  439. \begin_layout Standard
  440. It is not uncommon that a global domain is broken into several pieces, each
  441. of which is distributed to one process.
  442. Following we consider a simple case: a domain of rectilinear type with
  443. global size 9 x 9 and its data is distributed evenly among 9 client processes,
  444. each of which has 3x3.
  445. \end_layout
  446. \begin_layout Standard
  447. \begin_inset Float figure
  448. placement !tbph
  449. wide false
  450. sideways false
  451. status open
  452. \begin_layout Plain Layout
  453. \begin_inset Graphics
  454. filename ../images/Distributed_Domain.pdf
  455. lyxscale 50
  456. scale 60
  457. \end_inset
  458. \end_layout
  459. \begin_layout Plain Layout
  460. \begin_inset Caption Standard
  461. \begin_layout Plain Layout
  462. Global domain data
  463. \end_layout
  464. \end_inset
  465. \begin_inset CommandInset label
  466. LatexCommand label
  467. name "globalDomain"
  468. \end_inset
  469. \end_layout
  470. \end_inset
  471. \end_layout
  472. \begin_layout Standard
  473. The region of local domain can be described by one of the following way.
  474. \end_layout
  475. \begin_layout Standard
  476. Specify the the beginning and size of local domain with:
  477. \end_layout
  478. \begin_layout Itemize
  479. ni_glo, nj_glo: global size of x-axis and y-axis correspondingly.
  480. \end_layout
  481. \begin_layout Itemize
  482. ibegin, jbegin: global position on x-axis and y-axis where a local domain
  483. begin
  484. \end_layout
  485. \begin_layout Itemize
  486. ni, nj: local size of domain of each process on x-axis and y-axis
  487. \end_layout
  488. \begin_layout Standard
  489. Or tell XIOS exactly the global position of each point in the local domain,
  490. from left to right, top to bottom with:
  491. \end_layout
  492. \begin_layout Itemize
  493. i_index, j_index: array of global position of every point in the local domain.
  494. It is very useful when local domains do not align with each other.
  495. \end_layout
  496. \begin_layout Standard
  497. For example, with the first method, the local domain in the middle (the
  498. blue one) can be specified with:
  499. \end_layout
  500. \begin_layout Standard
  501. \begin_inset listings
  502. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  503. inline false
  504. status open
  505. \begin_layout Plain Layout
  506. CALL xios_set_domain_attr("domain_A",ni_glo=9, nj_glo=9, ibegin=3, ni=3,
  507. jbegin=3, nj=3)
  508. \end_layout
  509. \end_inset
  510. \end_layout
  511. \begin_layout Standard
  512. The second method demands only two arrays:
  513. \end_layout
  514. \begin_layout Standard
  515. \begin_inset listings
  516. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  517. inline false
  518. status open
  519. \begin_layout Plain Layout
  520. CALL xios_set_domain_attr("domain_A",ni_glo=9, nj_glo=9, i_index=iIndex,
  521. j_index=jIndex)
  522. \end_layout
  523. \end_inset
  524. \end_layout
  525. \begin_layout Standard
  526. and
  527. \end_layout
  528. \begin_layout Itemize
  529. iIndex={3,4,5,3,4,5,3,4,5}, jIndex = {3,3,3,4,4,4,5,5,5}
  530. \end_layout
  531. \begin_layout Subsection
  532. Local domain data
  533. \end_layout
  534. \begin_layout Standard
  535. Similar to define local index, local data can be done in two ways.
  536. \end_layout
  537. \begin_layout Standard
  538. Specify the begining and size of data on the local domain:
  539. \end_layout
  540. \begin_layout Itemize
  541. data_ibegin, data_jbegin: the local position of data on x-axis and y-axis
  542. where data begins
  543. \end_layout
  544. \begin_layout Itemize
  545. data_ni, data_nj: size of data on each axis
  546. \end_layout
  547. \begin_layout Standard
  548. Or specify data with its position in the local domain, from left to right,
  549. top to bottom with
  550. \end_layout
  551. \begin_layout Itemize
  552. data_i_index, data_j_index: array of local position of data in the local
  553. domain.
  554. \end_layout
  555. \begin_layout Standard
  556. Beside the attributes above, one of the essential attributes to define is
  557. dimensional size of data - data_dim.
  558. Although domain has two dimensions, data are not required to be 2-dimensional.
  559. In particular, for case of data_dim == 1, XIOS uses an
  560. \shape italic
  561. 1-dimensional block distribution
  562. \shape default
  563. of data, distributed along the first dimension, the x-axis.
  564. \end_layout
  565. \begin_layout Standard
  566. With the first way to define data on a local domain, we can use:
  567. \end_layout
  568. \begin_layout Standard
  569. \begin_inset listings
  570. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  571. inline false
  572. status open
  573. \begin_layout Plain Layout
  574. CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2,
  575. data_jbegin=-1, data_nj=nj+2)
  576. \end_layout
  577. \end_inset
  578. \end_layout
  579. \begin_layout Standard
  580. In order to be processed correctly, data must be specified with the begining
  581. and size of its block .
  582. For two-dimensional data, it can be done with data_ibegin, data_ni for
  583. the first dimension and data_jbegin, data_nj for the second dimension.
  584. In case of one-dimensional data, it is only necessary to determine data_ibegin
  585. and data_ni.
  586. Although the valid data must be inside a local domain, it is not neccessary
  587. for data to have same size as local domain.
  588. In fact, data can have larger size than domain on each dimension, this
  589. is often the case of
  590. \begin_inset Quotes eld
  591. \end_inset
  592. ghost cell
  593. \begin_inset Quotes erd
  594. \end_inset
  595. .
  596. The attributes data_ibegin and data_jbegin specify the offset of data from
  597. local domain.
  598. For local domain_A, the negative value indicates that data is larger than
  599. local domain, the valid part of data needs extracted from the real data.
  600. A positive value indicates data is smaller than local domain.
  601. The default value of data_ibegin/data_jbegin is 0, which implies that data
  602. fit into local domain properly.
  603. \end_layout
  604. \begin_layout Standard
  605. \begin_inset Float figure
  606. placement !tbph
  607. wide false
  608. sideways false
  609. status open
  610. \begin_layout Plain Layout
  611. \begin_inset Graphics
  612. filename ../images/Domain.pdf
  613. lyxscale 50
  614. scale 60
  615. \end_inset
  616. \end_layout
  617. \begin_layout Plain Layout
  618. \begin_inset Caption Standard
  619. \begin_layout Plain Layout
  620. Local domain with data
  621. \end_layout
  622. \end_inset
  623. \begin_inset CommandInset label
  624. LatexCommand label
  625. name "localDomain"
  626. \end_inset
  627. \end_layout
  628. \end_inset
  629. \end_layout
  630. \begin_layout Standard
  631. On Figure
  632. \begin_inset CommandInset ref
  633. LatexCommand ref
  634. reference "localDomain"
  635. \end_inset
  636. , local domain occupies the center of the global domain, where real data
  637. fill up a larger region.
  638. Only data inside the local domain, represented by blue cells, are valid.
  639. \end_layout
  640. \begin_layout Standard
  641. With the secon way, data can be represented with:
  642. \end_layout
  643. \begin_layout Standard
  644. \begin_inset listings
  645. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  646. inline false
  647. status open
  648. \begin_layout Plain Layout
  649. CALL xios_set_domain_attr("domain_A",data_dim=2, data_i_index=dataI, data_j_inde
  650. x=dataJ)
  651. \end_layout
  652. \end_inset
  653. \end_layout
  654. \begin_layout Standard
  655. with
  656. \end_layout
  657. \begin_layout Itemize
  658. dataJ = {-1,-1,-1,-1,-1,0,0,0,0,0,1,1,1,1,1,2,2,2,3,3,3,3,3}
  659. \end_layout
  660. \begin_layout Itemize
  661. dataI = {-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3}
  662. \end_layout
  663. \begin_layout Standard
  664. As mentioned, data on a domain are two-dimensional but in some cases, there
  665. is a need to write data continously, there comes one-dimensional data.
  666. With the precedent example, we can define one dimensional data with:
  667. \end_layout
  668. \begin_layout Standard
  669. \begin_inset listings
  670. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  671. inline false
  672. status open
  673. \begin_layout Plain Layout
  674. CALL xios_set_domain_attr("domain_A",data_dim=1, data_i_index=dataI)
  675. \end_layout
  676. \end_inset
  677. \end_layout
  678. \begin_layout Standard
  679. and
  680. \end_layout
  681. \begin_layout Itemize
  682. dataI = {-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}
  683. \end_layout
  684. \begin_layout Standard
  685. Above are the mandatory attributes to define local domain.
  686. There are some auxilliary attributes which make data meaningful, especially
  687. for meteorological one.
  688. The next section disscuses these attributes.
  689. \end_layout
  690. \begin_layout Subsection
  691. Longitude and latitude
  692. \end_layout
  693. \begin_layout Standard
  694. Different from the previous version, in XIOS 2.0, lonngitude and latitude
  695. are optional.
  696. Moreover, to be coherent to the data_dim concept, there are more ways to
  697. input longitude and latitude values.
  698. \end_layout
  699. \begin_layout Standard
  700. Like data, longitude and latitude values can be one or two dimension.
  701. The first ones are represented with lonvalue_1d, latvalue_1d; the second
  702. ones are specified with lonvalue_2d and latvalue_2d.
  703. \end_layout
  704. \begin_layout Standard
  705. With the same domain_A, we can set longitude and latitude values by calling:
  706. \end_layout
  707. \begin_layout Standard
  708. \begin_inset listings
  709. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  710. inline false
  711. status open
  712. \begin_layout Plain Layout
  713. CALL xios_set_domain_attr("domain_A",lonvalue_1d=lon1D, latvalue_1d=lat1D)
  714. \end_layout
  715. \end_inset
  716. \end_layout
  717. \begin_layout Standard
  718. with
  719. \end_layout
  720. \begin_layout Itemize
  721. lon1D = {30, 40, 50, 30, 40, 50, 30, 40, 50}
  722. \end_layout
  723. \begin_layout Itemize
  724. lat1D = {30, 30, 30, 40, 40, 40, 50, 50, 50}
  725. \end_layout
  726. \begin_layout Standard
  727. Or by using two-dimension longitude and latitude
  728. \end_layout
  729. \begin_layout Standard
  730. \begin_inset listings
  731. lstparams "language=XML,breaklines=true,tabsize=2,frame=tb,postbreak={\raisebox{0ex}[0ex][0ex]{\ensuremath{\rcurvearrowse\space}}}"
  732. inline false
  733. status open
  734. \begin_layout Plain Layout
  735. CALL xios_set_domain_attr("domain_A",lonvalue_2d=lon2D, latvalue_1d=lat2D)
  736. \end_layout
  737. \end_inset
  738. \end_layout
  739. \begin_layout Standard
  740. with
  741. \end_layout
  742. \begin_layout Itemize
  743. lon2D = {
  744. \begin_inset Formula $\begin{array}{ccc}
  745. 30 & 40 & 50\\
  746. 30 & 40 & 50\\
  747. 30 & 40 & 50
  748. \end{array}$
  749. \end_inset
  750. }
  751. \end_layout
  752. \begin_layout Itemize
  753. lat1D = {
  754. \begin_inset Formula $\begin{array}{ccc}
  755. 30 & 30 & 30\\
  756. 40 & 40 & 40\\
  757. 50 & 50 & 50
  758. \end{array}$
  759. \end_inset
  760. }
  761. \end_layout
  762. \begin_layout Standard
  763. For unstructured mesh, a cell can have different number of vertices than
  764. rectinlinear, in this case, longitude and latitude value of the vertex
  765. of cell are specified with bounds_lon_1d and bounds_lat_1d.
  766. \end_layout
  767. \begin_layout Standard
  768. For curvilinear mesh, bounds_lon_2d and bounds_lat_2d provide a convenient
  769. way to define longitude and latitude value for the vertex of the cell.
  770. However, it is possible to use bounds_lon_1d and bounds_lat_1d to describe
  771. these values.
  772. \end_layout
  773. \begin_layout Standard
  774. One thing to remind, only *_1d or *_2d attributes are used, if *_1d and
  775. *_2d of a same attribute are provides, there will be runtime error.
  776. \end_layout
  777. \begin_layout Standard
  778. All attributes of domain can be found in Reference Guide.
  779. \end_layout
  780. \end_body
  781. \end_document