Fortran utilities =================== .. csv-table:: "**Name**", "**Function**" "U2 MESS ", "Print a simple message" "U2 MESK ", "Print both a message and character values" "U2 MESI ", "Print both a message and integer values" "U2 MESR ", "Print both a message and real type values" "U2 MESG ", "Print a message, character, integer, and real values at the same time" Printing simple messages ------------------------------ **SUBROUTINE U2 MESS (TYPE, IDMESS)** .. csv-table:: "TYPE ", "IN", "Message type (E, F, A, I)" "IDMESS ", "IN", "message identifier" Example: .. code-block:: text CALL U2 MESS ('A', 'CHATON_1') Print the following message: .. code-block:: text The little cat is green Phew! Printing messages and character values -------------------------------------------------------- **SUBROUTINE U2 MESK (TYPE, IDMESS, NK, VALK)** .. csv-table:: "TYPE ", "IN", "Message type (E, F, A, I)" "IDMESS ", "IN", "Message ID" "NK", "IN", "Number of character parameters" "VALK ", "IN", "Character parameter values" Example: .. code-block:: text VALK = 'ROSE' CALL U2 MESK ('A', CHATON_2 ', 1, VALK)" Print the following message: .. code-block:: text The little cat is pink in color. Printing messages and integer values ----------------------------------------------------- **SUBROUTINE U2 MESI (TYPE, IDMESS, NI, VALI)** .. csv-table:: "TYPE ", "IN", "Message type (E, F, A, I)" "IDMESS ", "IN", "Message ID" "NI", "IN", "Number of integer parameters" "VALI ", "IN", "Integer parameter values" Example: .. code-block:: text VALI (1) = 4 VALI (2) = 2 CALL U2 MESI ('A', 'CHATON_3', 2, VALI)" Print the following message: .. code-block:: text The little cat has 4 legs and 2 eyes. Printing messages and values of real type -------------------------------------------------- **SUBROUTINE U2 MESR (TYPE, IDMESS, NR, VALR)** .. csv-table:: "TYPE ", "IN", "Message type (E, F, A, I)" "IDMES ", "IN", "Message ID" "NR", "IN", "Number of real type parameters" "VALR ", "IN", "Real type parameter values" Example: .. code-block:: text VALR (1) = 130. CALL U2 MESR ('A', 'CHATON_4', 1, VALR)" Print the following message: .. code-block:: text The little cat weighs 130.0 kilograms. Printing messages of character, integer and real values -------------------------------------------------------------------------- **SUBROUTINE U2 MESG (TYPE, IDMESS, NK, NK, VALK,, NI, VALI, NR, VALR)** .. csv-table:: "TYPE ", "IN", "Message type (E, F, A, I)" "IDMESS ", "IN", "Message ID" "NK", "IN", "Number of character parameters" "VALK ", "IN", "Character parameter values" "NI", "IN", "Number of integer parameters" "VALI ", "IN", "Integer parameter values" "NR", "IN", "Number of real type parameters" "VALR ", "IN", "Real type parameter values" Example: .. code-block:: text VALK (1) = 'blue' VALK (2) = 'pink' VALI = 5 VALR = 130. U2 MESG ('A', 'CHATON_5', 2, VALK, 1, VALI, 1, VALR)" Print the following message: .. code-block:: text ATTENTION: Your cat is weird, he: - has more than 4 legs, it has 5, - is blue and pink in color, - is too big, it weighs 130.0 kilograms. We stop the fees, it's not a cat!! Printing a message in several "pieces" ------------------------------------------------- It is sometimes practical to send a message "piecemeal", that is to say to call the U2 MESG routine several times. This is in principle impossible for fatal error messages (F/E) because the code stops at the first message! In addition, we want the complete message to appear to the user as a single message. In particular, we want it to appear in the same frame. To do this, we have the mechanism 'A+', 'F+',... The principle is to add a '+' to the message type as long as the message is not finished. The last message in the group (without the '+') ends the message. For example, you can write a message in 2 pieces by writing: CALL U2 MESK ('F+', 'FONCT0_11 ',1, NOMF) CALL U2 MESR ('F', 'FONCT0_26 '.3, VALR) This, combined with the following catalog: 11: _ (u" "" The interpolation of the function '% (k1) was not allowed. The interpolation type of the function is' NON ' -> Risk & Advice: See the INTERPOL keyword for commands that create functions. """), 26: _ (u" "" Requested abscissa:% (r1) f interval found: [:ref:`%(r2)f, %(r3)f <%(r2)f, %(r3)f>`] """), will lead to a message that looks like: .. code-block:: text ! ------------------------------------------------------! .. code-block:: text ! ! ! ! ! Interpolation of the func3 function is not allowed.! ! The interpolation type of the function is' NON '! ! ! ! -> Risk & Advice:! ! See the INTERPOL keyword for commands that create functions.! ! ! ! Requested abscissa: 105.! ! interval found: [:ref:`0., 100. <0., 100.>`]! ! ------------------------------------------------------! *Notes:* * In a message group that produces a message "piecemeal", the type of the different messages should be the same (F/A/I). * The printed message ID is that of the first message in the group.