5 Coupling field declaration
All processes of a component that send or receive a coupling field, or a part of it, needs to declare the coupling field.
Processes not implied in the
coupling do not have to call this routine at all (for backward
compatibility with OASIS3-MCT_2.0, they may still call it with any name and il_part_id).
- CALL oasis_def_var (var_id, name, il_part_id,
var_nodims, kinout,
var_type,
kinfo) or
- CALL oasis_def_var (var_id, name, il_part_id,
var_nodims, kinout,
var_actual_shape, var_type,
kinfo) or
- CALL prism_def_var_proto(var_id, name, il_part_id,
var_nodims, kinout, var_type, kinfo) or
- CALL prism_def_var_proto(var_id, name, il_part_id,
var_nodims, kinout, var_actual_shape, var_type, kinfo)
- var_id [INTEGER; OUT]: coupling field ID. Note that all
coupling fields appearing in the namcouple must be defined with
a call to oasis_def_var; not doing so would lead to an abort.
But all fields defined with a call to oasis_def_var must not necessarily
appear in the namcouple. If a field does not appear in the namcouple,
the var_id returned by the oasis_def_var will be equal to -1;
the value of the var_id should be tested and the corresponding
oasis_put and oasis_get should not be called if var_id
equals -1. These constraints are imposed to avoid that a typo in the namcouple
would lead to coupling exchanges not corresponding to what the user intends to activate.
- name [CHARACTER; IN]: field symbolic name (as in the
namcouple); maximum length of 80 characters
- il_part_id [INTEGER; IN]: partition ID returned from oasis_def_partition (see section
2.2.3)
- var_nodims [INTEGER, DIMENSION(2); IN]: is an integer array of size two.
The first element, var_nodims(1), is not used anymore in OASIS3-MCT, so
its value can be anything; The second element, var_nodims(2),
is the number of fields in a bundle (this will be 1 for unbundle
fields or greater than 1 for fields that are bundled; note that
if var_nodims(2)=0, it will be automatically reset to 1 in the
routine, to ensure backward compatibility).
- kinout [INTEGER; IN]: OASIS_In or PRISM_In
(i.e. = 21) for fields received by the component; OASIS_Out,
PRISM_Out (i.e. = 20) for fields sent by the component
4.
- var_actual_shape [INTEGER, DIMENSION(:) or DIMENSION(:,:), IN]:
is not used anymore. The interface is overloaded to support a
1d or 2d array, but for
backwards compatibility, it can still be passed; if so, it can be
a 1d or 2d array of integers of any length.
- var_type [INTEGER; IN]: type of coupling field array;
put OASIS_Real or PRISM_Real (i.e. = 4) for single
or double precision real arrays. All coupling data is treated as
double precision in the coupling layer, but conversion to or from
single precision data is supported in the interface.
- kinfo [INTEGER; OUT]: returned error code.
Footnotes
- ... component4
- Parameters OASIS_In, PRISM_In, OASIS_Out, PRISM_Out
are defined in
oasis3-mct/lib/psmile/src/mod_oasis_parameters.F90