Browse Source

Move to the UCLouvain forge

Pierre-Yves Barriat 1 year ago
parent
commit
0b08d01826

+ 0 - 231
LICENSE

@@ -1,231 +0,0 @@
-GNU GENERAL PUBLIC LICENSE 
-Version 3, 29 June 2007
-Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
-
-Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
-
-Preamble
-
-The GNU General Public License is a free, copyleft license for software and other kinds of works.
-
-The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
-
-When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
-
-To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
-
-For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
-
-Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
-
-For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
-
-Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
-
-Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
-
-The precise terms and conditions for copying, distribution and modification follow.
-
-TERMS AND CONDITIONS
-
-0. Definitions.
-
-“This License” refers to version 3 of the GNU General Public License.
-
-“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
-
-“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
-
-To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
-
-A “covered work” means either the unmodified Program or a work based on the Program.
-
-To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
-
-To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
-
-An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
-
-1. Source Code. 
-The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
-
-A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
-
-The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
-
-The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
-
-The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
-
-The Corresponding Source for a work in source code form is that same work.
-
-2. Basic Permissions. 
-All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
-
-You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
-
-Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
-
-3. Protecting Users' Legal Rights From Anti-Circumvention Law. 
-No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
-
-When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
-
-4. Conveying Verbatim Copies. 
-You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
-
-You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
-
-5. Conveying Modified Source Versions. 
-You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
-
-a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
-
-b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
-
-c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
-
-d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
-
-A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
-
-6. Conveying Non-Source Forms. 
-You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
-
-a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
-
-b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
-
-c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
-
-d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
-
-e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
-
-A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
-
-A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
-
-“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
-
-If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
-
-The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
-
-Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
-
-7. Additional Terms. 
-“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
-
-When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
-
-Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
-
-a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
-
-b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
-
-c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
-
-d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
-
-e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
-
-f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
-
-All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
-
-If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
-
-Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
-
-8. Termination. 
-You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
-
-However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
-
-Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
-
-9. Acceptance Not Required for Having Copies. 
-You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
-
-10. Automatic Licensing of Downstream Recipients. 
-Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
-
-An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
-
-You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
-
-11. Patents. 
-A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
-
-A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
-
-Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
-
-In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
-
-If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
-
-If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
-
-A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
-
-Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
-
-12. No Surrender of Others' Freedom. 
-If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
-
-13. Use with the GNU Affero General Public License. 
-Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
-
-14. Revised Versions of this License. 
-The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
-
-If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
-
-Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
-
-15. Disclaimer of Warranty. 
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. Limitation of Liability. 
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-17. Interpretation of Sections 15 and 16. 
-If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
-
-END OF TERMS AND CONDITIONS
-
-How to Apply These Terms to Your New Programs
-
-If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
-
-To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
-
-<one line to give the program's name and a brief idea of what it does.> 
-Copyright (C) <year> <name of author>
-
-This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
-
-<program> Copyright (C) <year> <name of author> 
-This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 
-This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
-
-You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
-
-The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

+ 1 - 4
README.md

@@ -1,7 +1,4 @@
 # learning-fortran
 
-This is the repository for the training Learning Fortran
+This repository has been moved to [the UCLouvain forge](https://forge.uclouvain.be/barriat/learning-fortran)
 
-You can find the slides [here](./slides.pdf).
-
-Presentation is [here](https://www.elic.ucl.ac.be/users/pbarriat/slides/fortran.html)

BIN
assets/back.png


BIN
assets/build_fortran.png


BIN
assets/f77_format.png


BIN
assets/fortran_logo.png


BIN
assets/garde.png


+ 0 - 5
assets/marp.config.js

@@ -1,5 +0,0 @@
-const marpKrokiPlugin = require('./kroki-plugin')
-
-module.exports = {
-  engine: ({ marp }) => marp.use(marpKrokiPlugin)
-}

BIN
assets/poly.png


BIN
assets/sin.png


+ 0 - 55
assets/tum.css

@@ -1,55 +0,0 @@
-/* @theme tum */
-
-@import 'default';
-
-section {
-  /*background-color: #fff;
-  color: #000;
-  background-image: url('images/TUM_Logo_blau_rgb_s.svg');
-  background-repeat: no-repeat;
-  background-position: right 40px top 40px;
-  background-size: 8%;*/
-}
-
-section.lead {
-  /*background-image: url('images/TUM_Uhrenturm.png');
-  background-position: right;
-  background-size: 45%;*/
-}
-
-section h1,
-section h2 {
-  color: #1f315c;
-}
-section a {
-  color: #5fb2e6;
-}
-section footer,
-section::after {
-  color: #9cb7d4;
-}
-
-section.invert {
-  background-color: #003359;
-  color: #fff;
-  /*background-image: url('images/TUM_Logo_weiss_rgb_s.svg');*/
-}
-
-section.lead.invert {
-  /*background-image: url('images/TUM_Uhrenturm_w.png');*/
-}
-
-section.invert h1,
-section.invert footer,
-section.invert::after {
-  color: #fff;
-}
-
-section.invert a {
-  color: #e37222;
-}
-
-/* Add "Page" prefix and total page number */
-section::after {
-  content: attr(data-marpit-pagination) ' / ' attr(data-marpit-pagination-total);
-}

+ 0 - 10
compile.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-#
-# PY Barriat, October 2022
-#
-# Download and install marp (MarkDown slides extension) from here:
-# https://github.com/marp-team/marp-cli/releases
-#
-
-marp --allow-local-files --theme ./assets/tum.css slides.md -o slides.pdf
-marp --template bespoke --bespoke.progress --allow-local-files --theme ./assets/tum.css slides.md -o fortran.html

+ 0 - 746
notebooks/sandbox.ipynb

@@ -1,746 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "id": "10d0e3c5",
-   "metadata": {},
-   "source": [
-    "## Introduction to structured programming with Fortran\n",
-    "\n",
-    "### Why to learn Fortran ?\n",
-    "\n",
-    "* Because of the execution speed of a program\n",
-    "* Well suited for numerical computations : more than **45% of scientific applications** are in Fortran\n",
-    "\n",
-    "## Getting started\n",
-    "\n",
-    "### Hello World"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "00ec1776",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program hello_world\n",
-    "\n",
-    "  implicit none ! important\n",
-    "\n",
-    "  print *, \"Hello World!\"\n",
-    "\n",
-    "end program hello_world"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "c4b788f0",
-   "metadata": {},
-   "source": [
-    "### Data Type Declarations and Assignments"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "ffd3f0c3",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program data_type\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real x, y\n",
-    "  integer i, j\n",
-    "  logical flag\n",
-    "  \n",
-    "  integer matrix(2,2) \n",
-    "  character(80) month\n",
-    "  character(len=80) months(12)\n",
-    "  \n",
-    "  character family*16\n",
-    "  \n",
-    "  real, dimension(12) :: small_array\n",
-    "  character(len=80), dimension(24) :: screen\n",
-    "  \n",
-    "  integer, parameter :: it = 100\n",
-    "  \n",
-    "  i = 1\n",
-    "  j = i+2\n",
-    "  x = 85.8\n",
-    "  y = 3.5*cos(x)\n",
-    "\n",
-    "  month=\"december\"\n",
-    "  \n",
-    "  months(:)=\"empty\"\n",
-    "  \n",
-    "  months(12)=month\n",
-    "  \n",
-    "  flag = .TRUE.\n",
-    "  \n",
-    "  family = \"GEORGE P. BURDELL\"\n",
-    "  print*,family(:6)\n",
-    "  print*,family(8:9)\n",
-    "  print*,family(11:)\n",
-    "  print*,family(:6)//FAMILY(10:)\n",
-    "  \n",
-    "end"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "133046ed",
-   "metadata": {},
-   "source": [
-    "### Arithmetic Assignments\n",
-    "\n",
-    "The result of any integer divide is truncated to the integer value less than the correct decimal answer for the division. The result of this is that changing the order of operations can make a big difference in the answers.  Notice how parentheses force more expected results."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "13343800",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "  \n",
-    "  ians1=i2*i3/i5\n",
-    "  ians2=i3/i5*i2\n",
-    "  ians3=i2*(i3/i5)\n",
-    "  ians4=(i3/i5)*i2\n",
-    "  print *, '2*3/5 =', ians1, ', 3/5*2 =',ians2,', 2*(3/5) =',ians3 ,', (3/5)*2 =',ians4\n",
-    "  \n",
-    "end program arith"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "cabea667",
-   "metadata": {},
-   "source": [
-    "Real arithmetic behaves more uniformly:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "e1de5730",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "  \n",
-    "  ans1=r2*r3/r5\n",
-    "  ans2=r3/r5*r2\n",
-    "  ans3=(r3/r5)*r2\n",
-    "  print *, '2.0*3.0/5.0 =', ans1, ', 3.0/5.0*2.0 =',ans2,', (3.0/5.0)*2.0 =',ans3\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "f18b85ec",
-   "metadata": {},
-   "source": [
-    "Watch how precedence of operations effects the following:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "9a362858",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ians1=i2+i5*i3**i2\n",
-    "  ians2=i5*i3**i2+i2\n",
-    "  ians3=i3**i2*i5+i2\n",
-    "  print *, '2+5*3**2 =',ians1,', 5*3**2+2 =',ians2, ', 3**2*5+2 =',ians3\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "5297b017",
-   "metadata": {},
-   "source": [
-    "You can mix real and integers, but watch what happens"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "7d50669e",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ans1=r5+i3/i2\n",
-    "  ans2=5.0+3/2\n",
-    "  print *, '5.0+3/2 =',ans1\n",
-    "  print *, '5.0+3/2 =',ans2\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "222cabbc",
-   "metadata": {},
-   "source": [
-    "Look at what happens when I put a real in either the numerator or denominator of the division term"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "78929c6e",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ans1=r5+i3/r2\n",
-    "  ans2=r5+r3/i2\n",
-    "  print *, '5.0+3/2.0 =',ans1, ', 5.0+3.0/2 =', ans2\n",
-    "      \n",
-    "end program arith           "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "a7d37bc2",
-   "metadata": {},
-   "source": [
-    "Although Fortran normally works from left to right at a given level of precedence (does all multiply and divide from left to right before moving on to adds and subtracts). It works exponentiation from right to left when it hits 2 or more sequential exponentiation operations"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "3c2da1a9",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ians1= i5**i3**i2\n",
-    "  ians2= (i5**i3)**i2\n",
-    "  ians3= i5**(i3**i2)\n",
-    "  print *, '5**3**2 =',ians1, ', (5**3)**2 =',ians2,  ', 5**(3**2) =',ians3\n",
-    "      \n",
-    "end program arith           "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "8387be7a",
-   "metadata": {},
-   "source": [
-    "When in doubt use parentheses to get the answer that you really want.\n",
-    "\n",
-    "### Assignments exercise"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "14f6e7e2",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program sphere  \n",
-    "\n",
-    "  implicit none\n",
-    "      \n",
-    "  real pi,radius,volume,area  \n",
-    "          \n",
-    "  radius = 1.0\n",
-    "  pi = 0.0\n",
-    "      \n",
-    "  write(*,*) 'The value of pi is ', pi\n",
-    "  write(*,*) \n",
-    "\n",
-    "  area = 0.0\n",
-    "  volume = 0.0\n",
-    "      \n",
-    "  write(*,*) 'For a radius ', radius \n",
-    "  write(*,*) 'the area of a sphere is ', area\n",
-    "  write(*,*) 'and the volume is ', volume\n",
-    "      \n",
-    "end "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "9a1702f7",
-   "metadata": {},
-   "source": [
-    "### Execution Control"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "41f9a8f0",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "PROGRAM gcd\n",
-    "  ! Computes the greatest common divisor, Euclidean algorithm\n",
-    "  IMPLICIT NONE\n",
-    "  INTEGER :: m, n, t\n",
-    "  WRITE(*,*) \"Give positive integers m and n :\"\n",
-    "  m=5464\n",
-    "  n=484682\n",
-    "  WRITE(*,*) 'm:', m,' n:', n\n",
-    "  positive_check: IF (m > 0 .AND. n > 0) THEN\n",
-    "    main_algorithm: DO WHILE (n /= 0)\n",
-    "      t = MOD(m,n)\n",
-    "      m = n\n",
-    "      n = t\n",
-    "    END DO main_algorithm\n",
-    "    WRITE(*,*) \"Greatest common divisor: \",m\n",
-    "  ELSE\n",
-    "    WRITE(*,*) 'Negative value entered'\n",
-    "  END IF positive_check\n",
-    "END PROGRAM gcd"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "cef2ad42",
-   "metadata": {},
-   "source": [
-    "### File-Directed Input and Output"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "8fd042c4",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program plot\n",
-    "\n",
-    "  ! Program to provide plots of Sin(x)\n",
-    "\n",
-    "  implicit none\n",
-    "  character label*150\n",
-    "  real x\n",
-    "  integer i\n",
-    "  character xlabel*32,ylabel*32,title*32\n",
-    "  real fx\n",
-    "  !\n",
-    "  ! label   -   Character string \n",
-    "  ! xlabel  -   Contains a label for the x-axis\n",
-    "  ! ylabel  -   Contains a label for the y-axis\n",
-    "  ! title   -   Contains a title for the plot\n",
-    "  !\n",
-    "  ! Drive a separate true graphics program (gnuplot)\n",
-    "  !\n",
-    "  ! First set up the command file for gnuplot\n",
-    "  !\n",
-    "  xlabel=\"'x'\"\n",
-    "  ylabel=\"'y'\"\n",
-    "  title=\"'sin(x)'\"\n",
-    "  open (112,file='03_gnuxy')\n",
-    "  !\n",
-    "  label='set xlabel '//xlabel\n",
-    "  write(112,*)label\n",
-    "  write(112,*)'set xrange [0:6]'\n",
-    "  label='set ylabel '//ylabel\n",
-    "  write(112,*)label\n",
-    "  write(112,*)'set yrange [-1.2:1.2]'\n",
-    "  label='plot \"03_dataxy\" using 1:2 title '//title\n",
-    "  label=trim(label)//' with lines lt rgb \"red\"'\n",
-    "  write(112,*) label\n",
-    "  write (112,*) 'pause -1'\n",
-    "  close(112)\n",
-    "  !\n",
-    "  !   Generate x-y pairs for the graph\n",
-    "  !\n",
-    "  open (112,file='03_dataxy')\n",
-    "  do i=0,60\n",
-    "    x=.1*i\n",
-    "    fx=sin(x)\n",
-    "    write(112,*) x,fx\n",
-    "  enddo\n",
-    "  close(112)\n",
-    "  !\n",
-    "end program"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "059d5e2a",
-   "metadata": {},
-   "source": [
-    "This code is going to create 2 files: \"03_dataxy\" and \"03_gnuxy\".\n",
-    "\n",
-    "The idea is to use a linux plotting tool called \"GNUplot\" to make a graph: the first file is the data for the graph, the second one is the gnuplot script using these data.\n",
-    "\n",
-    "```bash\n",
-    "gnuplot 03_gnuxy\n",
-    "```\n",
-    "\n",
-    "<img src=\"https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/raw/master/assets/sin.png\">\n",
-    "\n",
-    "#### Format controlled IO"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "a26b3cc5",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program format\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real(4) A\n",
-    "  real(8) B\n",
-    "  integer I, KEY\n",
-    "\n",
-    "  A= 1500.*acos(0.)\n",
-    "  B= 4e3*dcos(16.5d0)\n",
-    "  KEY= 884\n",
-    "  \n",
-    "  write(*,*) A,B,KEY\n",
-    "  write(*,*)\n",
-    "  \n",
-    "  write(*,1000) A,B,KEY\n",
-    "  write(*,1001) (\"-\",I=1,38)\n",
-    "  \n",
-    "  1000 FORMAT(F18.10,E14.5,I6)\n",
-    "  1001 FORMAT(38A1)\n",
-    "      \n",
-    "end program format  "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "31f27416",
-   "metadata": {},
-   "source": [
-    "### Hands on learning: numerical analysis\n",
-    "\n",
-    "Apply the Newton's method to find the root(s) of a polynomial function.\n",
-    "\n",
-    "<img src=\"https://wikimedia.org/api/rest_v1/media/math/render/svg/6929060731e351c465426e37567abe5ee13d65d9\">"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "df362a1a",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program newton\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "  ! Use a Newton iteration to solve a polynomial equation\n",
-    "\n",
-    "  integer :: i\n",
-    "\n",
-    "  write(*,*) 'Try to solve \"x**3+x-10=0\"'  \n",
-    "  write(*,*) 'What is your initial guess for the solution?'\n",
-    "\n",
-    "  do while( .TRUE. )\n",
-    "  \n",
-    "    write(*,*)\n",
-    "    exit\n",
-    "\n",
-    "  end do\n",
-    "\n",
-    "end program\n",
-    "\n",
-    "! ******************************************************************************************\n",
-    "\n",
-    "subroutine derivate()\n",
-    "\n",
-    "! Evaluate the function f(x)=x**3+x-10\n",
-    "! also return the derivative of the function\n",
-    "\n",
-    "\n",
-    "end subroutine\n"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "919d1d4f",
-   "metadata": {},
-   "source": [
-    "### COMMON Statement (F77)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "4b517d6b",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "      PROGRAM test_arg\n",
-    "\n",
-    "        implicit none\n",
-    "        integer a,b,c\n",
-    "\n",
-    "        common /arg/ a,b,c\n",
-    "\n",
-    "        a = 2\n",
-    "        c = 1\n",
-    "\n",
-    "        print *, 'Before the call:'\n",
-    "        print *, 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "        call sub\n",
-    "\n",
-    "        print *, 'After the call:'\n",
-    "        print *, 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "      END PROGRAM\n",
-    "\n",
-    "      SUBROUTINE sub\n",
-    "\n",
-    "        implicit none\n",
-    "\n",
-    "        integer a,b,c\n",
-    "        common /arg/ a,b,c\n",
-    "\n",
-    "        b = a + c\n",
-    "        c = c + 1\n",
-    "       \n",
-    "      END SUBROUTINE"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "1e457015",
-   "metadata": {},
-   "source": [
-    "### MODULE Statement (F90)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "71f26006",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "MODULE arg\n",
-    " implicit none\n",
-    " integer :: a,b,c\n",
-    " real(8) :: x\n",
-    "END MODULE arg\n",
-    "\n",
-    "! * * * * * * * \n",
-    "\n",
-    "PROGRAM test_arg\n",
-    " USE arg\n",
-    " implicit none\n",
-    "\n",
-    " a = 2\n",
-    " c = 1\n",
-    "\n",
-    " write(*,*) 'Before the call:'\n",
-    " write(*,'(3(A5,I3))') ' a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    " call sub\n",
-    "\n",
-    " write(*,*) 'After the call:'\n",
-    " write(*,'(3(A5,I3))') 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "END PROGRAM test_arg\n",
-    "\n",
-    "! * * * * * * * \n",
-    "\n",
-    "SUBROUTINE sub\n",
-    " USE arg, only : a,b,c    ! seuls a b et c sont utiles\n",
-    " implicit none\n",
-    "\n",
-    " b = a + c\n",
-    " c = c + 1\n",
-    "\n",
-    "END SUBROUTINE sub"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "a0900a54",
-   "metadata": {},
-   "source": [
-    "### NAMELIST (F90)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "e3791d4f",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "PROGRAM test_namelist\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "  real(8) lon_min, lon_max, lat_min, lat_max\n",
-    "\n",
-    "  NAMELIST/namlon/ lon_min, lon_max\n",
-    "  NAMELIST/namlat/ lat_min, lat_max\n",
-    "\n",
-    "  write(*,*) 'Before:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "  open(161,file='../src/07_namelist.def',status='old',form='formatted')\n",
-    "  read(161,NML=namlon)\n",
-    "\n",
-    "  write(*,*) 'Between:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "  read(161,NML=namlat)\n",
-    "  close (161)\n",
-    "\n",
-    "  write(*,*) 'After:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "END\n",
-    "\n",
-    "SUBROUTINE print_res(a,b,c,d)\n",
-    "  implicit none\n",
-    "  real(8), intent(in) :: a,b,c,d\n",
-    "  write(*,'(4(A12,F6.2))') '  lon_min = ',a,', lon_max = ',b, &\n",
-    "                          ', lat_min = ',c,', lat_max = ',d\n",
-    "  RETURN\n",
-    "END"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "c0b0a801",
-   "metadata": {},
-   "source": [
-    "### Hands on learning: structure\n",
-    "\n",
-    "The aim of this exercise is to work with loops (for or while) in order to draw in a terminal a Christmas tree with its balls.\n",
-    "\n",
-    "The program must be carried out in Fortran 90. It will take as argument the height of the tree which is a variable of the problem:\n",
-    "\n",
-    "Height=7\n",
-    "```\n",
-    "      #\n",
-    "     ###\n",
-    "    #o###\n",
-    "   ##o####\n",
-    "  #o#####o#\n",
-    " ####o#####o\n",
-    "#####o#####o#\n",
-    "```\n",
-    "This parameter must be supplied at the command line when the program (for example './tree 10'). \n",
-    "\n",
-    "Balls must be positioned all 6 sharps."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "930eedf9",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program ChristmasTree\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "\n",
-    "\n",
-    "end program"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "6362d74e",
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Fortran",
-   "language": "Fortran",
-   "name": "fortran_spec"
-  },
-  "language_info": {
-   "file_extension": "f90",
-   "mimetype": "text/plain",
-   "name": "fortran"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}

+ 0 - 746
notebooks/training_fortran.ipynb

@@ -1,746 +0,0 @@
-{
- "cells": [
-  {
-   "cell_type": "markdown",
-   "id": "10d0e3c5",
-   "metadata": {},
-   "source": [
-    "## Introduction to structured programming with Fortran\n",
-    "\n",
-    "### Why to learn Fortran ?\n",
-    "\n",
-    "* Because of the execution speed of a program\n",
-    "* Well suited for numerical computations : more than **45% of scientific applications** are in Fortran\n",
-    "\n",
-    "## Getting started\n",
-    "\n",
-    "### Hello World"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "00ec1776",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program hello_world\n",
-    "\n",
-    "  implicit none ! important\n",
-    "\n",
-    "  print *, \"Hello World!\"\n",
-    "\n",
-    "end program hello_world"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "c4b788f0",
-   "metadata": {},
-   "source": [
-    "### Data Type Declarations and Assignments"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "ffd3f0c3",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program data_type\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real x, y\n",
-    "  integer i, j\n",
-    "  logical flag\n",
-    "  \n",
-    "  integer matrix(2,2) \n",
-    "  character(80) month\n",
-    "  character(len=80) months(12)\n",
-    "  \n",
-    "  character family*16\n",
-    "  \n",
-    "  real, dimension(12) :: small_array\n",
-    "  character(len=80), dimension(24) :: screen\n",
-    "  \n",
-    "  integer, parameter :: it = 100\n",
-    "  \n",
-    "  i = 1\n",
-    "  j = i+2\n",
-    "  x = 85.8\n",
-    "  y = 3.5*cos(x)\n",
-    "\n",
-    "  month=\"december\"\n",
-    "  \n",
-    "  months(:)=\"empty\"\n",
-    "  \n",
-    "  months(12)=month\n",
-    "  \n",
-    "  flag = .TRUE.\n",
-    "  \n",
-    "  family = \"GEORGE P. BURDELL\"\n",
-    "  print*,family(:6)\n",
-    "  print*,family(8:9)\n",
-    "  print*,family(11:)\n",
-    "  print*,family(:6)//FAMILY(10:)\n",
-    "  \n",
-    "end"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "133046ed",
-   "metadata": {},
-   "source": [
-    "### Arithmetic Assignments\n",
-    "\n",
-    "The result of any integer divide is truncated to the integer value less than the correct decimal answer for the division. The result of this is that changing the order of operations can make a big difference in the answers.  Notice how parentheses force more expected results."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "13343800",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "  \n",
-    "  ians1=i2*i3/i5\n",
-    "  ians2=i3/i5*i2\n",
-    "  ians3=i2*(i3/i5)\n",
-    "  ians4=(i3/i5)*i2\n",
-    "  print *, '2*3/5 =', ians1, ', 3/5*2 =',ians2,', 2*(3/5) =',ians3 ,', (3/5)*2 =',ians4\n",
-    "  \n",
-    "end program arith"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "cabea667",
-   "metadata": {},
-   "source": [
-    "Real arithmetic behaves more uniformly:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "e1de5730",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "  \n",
-    "  ans1=r2*r3/r5\n",
-    "  ans2=r3/r5*r2\n",
-    "  ans3=(r3/r5)*r2\n",
-    "  print *, '2.0*3.0/5.0 =', ans1, ', 3.0/5.0*2.0 =',ans2,', (3.0/5.0)*2.0 =',ans3\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "f18b85ec",
-   "metadata": {},
-   "source": [
-    "Watch how precedence of operations effects the following:"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "9a362858",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ians1=i2+i5*i3**i2\n",
-    "  ians2=i5*i3**i2+i2\n",
-    "  ians3=i3**i2*i5+i2\n",
-    "  print *, '2+5*3**2 =',ians1,', 5*3**2+2 =',ians2, ', 3**2*5+2 =',ians3\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "5297b017",
-   "metadata": {},
-   "source": [
-    "You can mix real and integers, but watch what happens"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "7d50669e",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ans1=r5+i3/i2\n",
-    "  ans2=5.0+3/2\n",
-    "  print *, '5.0+3/2 =',ans1\n",
-    "  print *, '5.0+3/2 =',ans2\n",
-    "      \n",
-    "end program arith      "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "222cabbc",
-   "metadata": {},
-   "source": [
-    "Look at what happens when I put a real in either the numerator or denominator of the division term"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "78929c6e",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ans1=r5+i3/r2\n",
-    "  ans2=r5+r3/i2\n",
-    "  print *, '5.0+3/2.0 =',ans1, ', 5.0+3.0/2 =', ans2\n",
-    "      \n",
-    "end program arith           "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "a7d37bc2",
-   "metadata": {},
-   "source": [
-    "Although Fortran normally works from left to right at a given level of precedence (does all multiply and divide from left to right before moving on to adds and subtracts). It works exponentiation from right to left when it hits 2 or more sequential exponentiation operations"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "3c2da1a9",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program arith\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real r2,r3,r4,r5,r6,ans1,ans2,ans3\n",
-    "  integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4\n",
-    "  \n",
-    "  data r2/2./,r3/3./,r4/4.0/,r5/5.0/\n",
-    "  data i2,i3,i4,i5/2,3,4,5/\n",
-    "\n",
-    "  ians1= i5**i3**i2\n",
-    "  ians2= (i5**i3)**i2\n",
-    "  ians3= i5**(i3**i2)\n",
-    "  print *, '5**3**2 =',ians1, ', (5**3)**2 =',ians2,  ', 5**(3**2) =',ians3\n",
-    "      \n",
-    "end program arith           "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "8387be7a",
-   "metadata": {},
-   "source": [
-    "When in doubt use parentheses to get the answer that you really want.\n",
-    "\n",
-    "### Assignments exercise"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "14f6e7e2",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program sphere  \n",
-    "\n",
-    "  implicit none\n",
-    "      \n",
-    "  real pi,radius,volume,area  \n",
-    "          \n",
-    "  radius = 1.0\n",
-    "  pi = 0.0\n",
-    "      \n",
-    "  write(*,*) 'The value of pi is ', pi\n",
-    "  write(*,*) \n",
-    "\n",
-    "  area = 0.0\n",
-    "  volume = 0.0\n",
-    "      \n",
-    "  write(*,*) 'For a radius ', radius \n",
-    "  write(*,*) 'the area of a sphere is ', area\n",
-    "  write(*,*) 'and the volume is ', volume\n",
-    "      \n",
-    "end "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "9a1702f7",
-   "metadata": {},
-   "source": [
-    "### Execution Control"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "41f9a8f0",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "PROGRAM gcd\n",
-    "  ! Computes the greatest common divisor, Euclidean algorithm\n",
-    "  IMPLICIT NONE\n",
-    "  INTEGER :: m, n, t\n",
-    "  WRITE(*,*) \"Give positive integers m and n :\"\n",
-    "  m=5464\n",
-    "  n=484682\n",
-    "  WRITE(*,*) 'm:', m,' n:', n\n",
-    "  positive_check: IF (m > 0 .AND. n > 0) THEN\n",
-    "    main_algorithm: DO WHILE (n /= 0)\n",
-    "      t = MOD(m,n)\n",
-    "      m = n\n",
-    "      n = t\n",
-    "    END DO main_algorithm\n",
-    "    WRITE(*,*) \"Greatest common divisor: \",m\n",
-    "  ELSE\n",
-    "    WRITE(*,*) 'Negative value entered'\n",
-    "  END IF positive_check\n",
-    "END PROGRAM gcd"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "cef2ad42",
-   "metadata": {},
-   "source": [
-    "### File-Directed Input and Output"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "8fd042c4",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program plot\n",
-    "\n",
-    "  ! Program to provide plots of Sin(x)\n",
-    "\n",
-    "  implicit none\n",
-    "  character label*150\n",
-    "  real x\n",
-    "  integer i\n",
-    "  character xlabel*32,ylabel*32,title*32\n",
-    "  real fx\n",
-    "  !\n",
-    "  ! label   -   Character string \n",
-    "  ! xlabel  -   Contains a label for the x-axis\n",
-    "  ! ylabel  -   Contains a label for the y-axis\n",
-    "  ! title   -   Contains a title for the plot\n",
-    "  !\n",
-    "  ! Drive a separate true graphics program (gnuplot)\n",
-    "  !\n",
-    "  ! First set up the command file for gnuplot\n",
-    "  !\n",
-    "  xlabel=\"'x'\"\n",
-    "  ylabel=\"'y'\"\n",
-    "  title=\"'sin(x)'\"\n",
-    "  open (112,file='03_gnuxy')\n",
-    "  !\n",
-    "  label='set xlabel '//xlabel\n",
-    "  write(112,*)label\n",
-    "  write(112,*)'set xrange [0:6]'\n",
-    "  label='set ylabel '//ylabel\n",
-    "  write(112,*)label\n",
-    "  write(112,*)'set yrange [-1.2:1.2]'\n",
-    "  label='plot \"03_dataxy\" using 1:2 title '//title\n",
-    "  label=trim(label)//' with lines lt rgb \"red\"'\n",
-    "  write(112,*) label\n",
-    "  write (112,*) 'pause -1'\n",
-    "  close(112)\n",
-    "  !\n",
-    "  !   Generate x-y pairs for the graph\n",
-    "  !\n",
-    "  open (112,file='03_dataxy')\n",
-    "  do i=0,60\n",
-    "    x=.1*i\n",
-    "    fx=sin(x)\n",
-    "    write(112,*) x,fx\n",
-    "  enddo\n",
-    "  close(112)\n",
-    "  !\n",
-    "end program"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "059d5e2a",
-   "metadata": {},
-   "source": [
-    "This code is going to create 2 files: \"03_dataxy\" and \"03_gnuxy\".\n",
-    "\n",
-    "The idea is to use a linux plotting tool called \"GNUplot\" to make a graph: the first file is the data for the graph, the second one is the gnuplot script using these data.\n",
-    "\n",
-    "```bash\n",
-    "gnuplot 03_gnuxy\n",
-    "```\n",
-    "\n",
-    "<img src=\"https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/raw/master/assets/sin.png\">\n",
-    "\n",
-    "#### Format controlled IO"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "a26b3cc5",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program format\n",
-    "\n",
-    "  implicit none\n",
-    "  \n",
-    "  real(4) A\n",
-    "  real(8) B\n",
-    "  integer I, KEY\n",
-    "\n",
-    "  A= 1500.*acos(0.)\n",
-    "  B= 4e3*dcos(16.5d0)\n",
-    "  KEY= 884\n",
-    "  \n",
-    "  write(*,*) A,B,KEY\n",
-    "  write(*,*)\n",
-    "  \n",
-    "  write(*,1000) A,B,KEY\n",
-    "  write(*,1001) (\"-\",I=1,38)\n",
-    "  \n",
-    "  1000 FORMAT(F18.10,E14.5,I6)\n",
-    "  1001 FORMAT(38A1)\n",
-    "      \n",
-    "end program format  "
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "31f27416",
-   "metadata": {},
-   "source": [
-    "### Hands on learning: numerical analysis\n",
-    "\n",
-    "Apply the Newton's method to find the root(s) of a polynomial function.\n",
-    "\n",
-    "<img src=\"https://wikimedia.org/api/rest_v1/media/math/render/svg/6929060731e351c465426e37567abe5ee13d65d9\">"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "df362a1a",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program newton\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "  ! Use a Newton iteration to solve a polynomial equation\n",
-    "\n",
-    "  integer :: i\n",
-    "\n",
-    "  write(*,*) 'Try to solve \"x**3+x-10=0\"'  \n",
-    "  write(*,*) 'What is your initial guess for the solution?'\n",
-    "\n",
-    "  do while( .TRUE. )\n",
-    "  \n",
-    "    write(*,*)\n",
-    "    exit\n",
-    "\n",
-    "  end do\n",
-    "\n",
-    "end program\n",
-    "\n",
-    "! ******************************************************************************************\n",
-    "\n",
-    "subroutine derivate()\n",
-    "\n",
-    "! Evaluate the function f(x)=x**3+x-10\n",
-    "! also return the derivative of the function\n",
-    "\n",
-    "\n",
-    "end subroutine\n"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "919d1d4f",
-   "metadata": {},
-   "source": [
-    "### COMMON Statement (F77)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "4b517d6b",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "      PROGRAM test_arg\n",
-    "\n",
-    "        implicit none\n",
-    "        integer a,b,c\n",
-    "\n",
-    "        common /arg/ a,b,c\n",
-    "\n",
-    "        a = 2\n",
-    "        c = 1\n",
-    "\n",
-    "        print *, 'Before the call:'\n",
-    "        print *, 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "        call sub\n",
-    "\n",
-    "        print *, 'After the call:'\n",
-    "        print *, 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "      END PROGRAM\n",
-    "\n",
-    "      SUBROUTINE sub\n",
-    "\n",
-    "        implicit none\n",
-    "\n",
-    "        integer a,b,c\n",
-    "        common /arg/ a,b,c\n",
-    "\n",
-    "        b = a + c\n",
-    "        c = c + 1\n",
-    "       \n",
-    "      END SUBROUTINE"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "1e457015",
-   "metadata": {},
-   "source": [
-    "### MODULE Statement (F90)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "71f26006",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "MODULE arg\n",
-    " implicit none\n",
-    " integer :: a,b,c\n",
-    " real(8) :: x\n",
-    "END MODULE arg\n",
-    "\n",
-    "! * * * * * * * \n",
-    "\n",
-    "PROGRAM test_arg\n",
-    " USE arg\n",
-    " implicit none\n",
-    "\n",
-    " a = 2\n",
-    " c = 1\n",
-    "\n",
-    " write(*,*) 'Before the call:'\n",
-    " write(*,'(3(A5,I3))') ' a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    " call sub\n",
-    "\n",
-    " write(*,*) 'After the call:'\n",
-    " write(*,'(3(A5,I3))') 'a = ',a,', b = ',b,', c = ',c\n",
-    "\n",
-    "END PROGRAM test_arg\n",
-    "\n",
-    "! * * * * * * * \n",
-    "\n",
-    "SUBROUTINE sub\n",
-    " USE arg, only : a,b,c    ! seuls a b et c sont utiles\n",
-    " implicit none\n",
-    "\n",
-    " b = a + c\n",
-    " c = c + 1\n",
-    "\n",
-    "END SUBROUTINE sub"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "a0900a54",
-   "metadata": {},
-   "source": [
-    "### NAMELIST (F90)"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "e3791d4f",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "PROGRAM test_namelist\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "  real(8) lon_min, lon_max, lat_min, lat_max\n",
-    "\n",
-    "  NAMELIST/namlon/ lon_min, lon_max\n",
-    "  NAMELIST/namlat/ lat_min, lat_max\n",
-    "\n",
-    "  write(*,*) 'Before:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "  open(161,file='../src/07_namelist.def',status='old',form='formatted')\n",
-    "  read(161,NML=namlon)\n",
-    "\n",
-    "  write(*,*) 'Between:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "  read(161,NML=namlat)\n",
-    "  close (161)\n",
-    "\n",
-    "  write(*,*) 'After:'\n",
-    "  call print_res(lon_min, lon_max, lat_min, lat_max)\n",
-    "\n",
-    "END\n",
-    "\n",
-    "SUBROUTINE print_res(a,b,c,d)\n",
-    "  implicit none\n",
-    "  real(8), intent(in) :: a,b,c,d\n",
-    "  write(*,'(4(A12,F6.2))') '  lon_min = ',a,', lon_max = ',b, &\n",
-    "                          ', lat_min = ',c,', lat_max = ',d\n",
-    "  RETURN\n",
-    "END"
-   ]
-  },
-  {
-   "cell_type": "markdown",
-   "id": "c0b0a801",
-   "metadata": {},
-   "source": [
-    "### Hands on learning: structure\n",
-    "\n",
-    "The aim of this exercise is to work with loops (for or while) in order to draw in a terminal a Christmas tree with its balls.\n",
-    "\n",
-    "The program must be carried out in Fortran 90. It will take as argument the height of the tree which is a variable of the problem:\n",
-    "\n",
-    "Height=7\n",
-    "```\n",
-    "      #\n",
-    "     ###\n",
-    "    #o###\n",
-    "   ##o####\n",
-    "  #o#####o#\n",
-    " ####o#####o\n",
-    "#####o#####o#\n",
-    "```\n",
-    "This parameter must be supplied at the command line when the program (for example './tree 10'). \n",
-    "\n",
-    "Balls must be positioned all 6 sharps."
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "930eedf9",
-   "metadata": {},
-   "outputs": [],
-   "source": [
-    "program ChristmasTree\n",
-    "\n",
-    "  implicit none\n",
-    "\n",
-    "\n",
-    "\n",
-    "end program"
-   ]
-  },
-  {
-   "cell_type": "code",
-   "execution_count": null,
-   "id": "6362d74e",
-   "metadata": {},
-   "outputs": [],
-   "source": []
-  }
- ],
- "metadata": {
-  "kernelspec": {
-   "display_name": "Fortran",
-   "language": "Fortran",
-   "name": "fortran_spec"
-  },
-  "language_info": {
-   "file_extension": "f90",
-   "mimetype": "text/plain",
-   "name": "fortran"
-  }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}

+ 0 - 1138
slides.md

@@ -1,1138 +0,0 @@
----
-marp: true
-title: Introduction to structured programming with Fortran
-author: P.Y. Barriat
-description: https://dev.to/nikolab/complete-list-of-github-markdown-emoji-markup-5aia
-backgroundImage: url('assets/back.png')
-_backgroundImage: url('assets/garde.png')
-footer: 09/11/2023 | Introduction to structured programming with Fortran
-_footer: ""
-paginate: true
-_paginate: false
----
-
-Introduction to structured programming with `Fortran`<!--fit-->
-===
-
-https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran
-
-![h:150](assets/fortran_logo.png)
-
-### Pierre-Yves Barriat
-
-##### November 09, 2023
-
-###### CISM/CÉCI Training Sessions
-
----
-
-# Fortran : shall we start ?
-
-- You know already one computer language ?
-- You understand the very basic programming concepts :
-  - What is a variable, an assignment, function call, etc.?
-  - Why do I have to compile my code?
-  - What is an executable?
-- You (may) already know some Fortran ?
-- How to proceed from old Fortran, to much more modern languages like Fortran 90/2003 ?
-
----
-
-# Why to learn Fortran ?
-
-- Because of the execution `speed` of a program
-- Well suited for numerical computations :
-more than 45% of scientific applications are in Fortran
-- `Fast` code : compilers can optimize well
-- Optimized `numerical libraries` available
-- Fortran is a `simple` langage and it is (kind-of) `easy to learn`
-
----
-
-# Fortran is simple
-
-- **We want to get our science done! Not learn languages!**
-- How easy/difficult is it really to learn Fortran ?
-- The concept is easy:
-*variables, operators, controls, loops, subroutines/functions*
-- **Invest some time now, gain big later!**
-
----
-
-# History
-
-**FOR**mula **TRAN**slation
-> invented 1954-8 by John Backus and his team at IBM
-
-- FORTRAN 66 (ISO Standard 1972)
-- FORTRAN 77 (1978)
-- Fortran 90 (1991)
-- Fortran 95 (1997)
-- Fortran 2003 (2004) → `"standard" version`
-- Fortran 2008 (2010)
-- Fortran 2018 (11/2018)
-
----
-
-# Starting with Fortran 77
-
-- Old Fortran provides only the absolute minimum!
-- Basic features :
-data containers (integer, float, ...), arrays, basic operators, loops, I/O, subroutines and functions
-- But this version has flaws:
-no dynamic memory allocation, old & obsolete constructs, “spaghetti” code, etc.
-- Is that enough to write code ?
-
----
-
-# Fortran 77 → Fortran >90
-
-- If Fortran 77 is so simple, why is it then so difficult to write good code?
-- Is simple really better?
-⇒ Using a language allows us to express our thoughts (on a computer)
-- A more sophisticated language allows for more complex thoughts
-- More language elements to get organized
-⇒ Fortran 90/95/2003 (recursive, OOP, etc)
-
----
-
-# How to Build a FORTRAN Program
-
-FORTRAN is a compiled language (like C) so the source code (what you write) must be converted into machine code before it can be executed (e.g. Make command)
-
-![h:350](assets/build_fortran.png)
-
-> Fortran 77 source code [hello_world.f](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/00_hello_world.f)
-
----
-
-# FORTRAN 77 Format
-
-This version requires a fixed format for programs
-
-![h:300](assets/f77_format.png)
-
-- max length variable names is 6 characters
-- alphanumeric only, must start with a letter
-- character strings are case sensitive
-
----
-
-# FORTRAN >90 Format
-
-Versions >90 relaxe these requirements:
-
-- comments following statements (! delimiter)
-- long variable names (31 characters)
-- containing only letters, digits or underscore
-- max row length is 132 characters
-- can be max 39 continuation lines
-- if a line is ended with ampersand (&), the line continues onto the next line
-- semicolon (;) as a separator between statements on a single line
-
----
-
-# Program Organization
-
-Most FORTRAN programs consist of a main program and one or more subprograms
-
-There is a fixed order:
-
-```Fortran90
-Heading
-Declarations
-Variable initializations
-Program code
-Format statements
-
-Subprogram definitions
-(functions & subroutines)
-```
-
----
-
-# Data Type Declarations
-
-Basic data types are :
-
-- `INTEGER` : integer numbers (+/-)
-- `REAL` : floating point numbers
-- `DOUBLE PRECISION` : extended precision floating point
-- `CHARACTER*n` : string with up to **n** characters
-- `LOGICAL` : takes on values `.TRUE.` or `.FALSE.`
-
----
-
-# Data Type Declarations
-
-`INTEGER` and `REAL` can specify number of bytes to use
-
-- Default is: `INTEGER*4` and `REAL*4`
-- `DOUBLE PRECISION` is same as `REAL*8`
-
-Arrays of any type must be declared:
-
-- `DIMENSION A(3,5)` - declares a 3 x 5 array
-- `CHARACTER*30 NAME(50)` - directly declares a `character` array with 30 `character` strings in each element
-
----
-
-# Implicit vs Explicit Declarations
-
-By default, an implicit type is assumed depending on the first letter of the variable name:
-
-- `A-H, O-Z` define REAL variables
-- `I-N` define INTEGER variables
-
-Can use the IMPLICIT statement:
-
-```fortran
-IMPLICIT REAL (A-Z) 
-```
-
-> makes all variables REAL if not declared
-
----
-
-# Implicit vs Explicit Declarations
-
-```fortran
-IMPLICIT CHARACTER*2 (W)
-```
-
-> makes variables starting with W be 2-character strings
-
-```fortran
-IMPLICIT DOUBLE PRECISION (D)
-```
-
-> makes variables starting with D be double precision
-
-**Good habit**: force explicit type declarations
-
-```fortran
-IMPLICIT NONE
-```
-
-> user must explicitly declare all variable types
-
----
-
-# Assignment Statements
-
-**Old** assignment statement: `<label>` `<variable>` = `<expression>`
-
-- `<label>` : statement label number (1 to 99999)
-- `<variable>` : FORTRAN variable
-(max 6 characters, alphanumeric only for standard FORTRAN 77)
-
-**Expression**:
-
-- Numeric expressions: `VAR = 3.5*COS(THETA)`
-- Character expressions: `DAY(1:3) = 'TUE'`
-- Relational expressions: `FLAG = ANS .GT. 0`
-- Logical expressions: `FLAG = F1 .OR. F2`
-
----
-
-# Numeric Expressions
-
-Arithmetic operators: precedence: `**` *(high)* → `-` *(low)*
-
-|   Operator   | Function        |
-| ------------ | --------------- |
-|     `**`     |  exponentiation |
-|     `*`     |  multiplication |
-|     `/`     |  division |
-|     `+`     |  addition |
-|     `-`     |  subtraction |
-
----
-
-# Numeric Expressions
-
-Numeric expressions are up-cast to the highest data type in the expression according to the precedence:
-
-*(low)* logical → integer → real → complex *(high)*
-
-and smaller byte size *(low)* to larger byte size *(high)*
-
-## Examples:
-
-> Fortran 77 source code [arith.f](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/01_arith.f)
-> Fortran 77 source code [sphere.f](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/02_sphere.f)
-
----
-
-# Character Expressions
-
-Only built-in operator is **Concatenation** defined by `//`
-
-```fortran
-'ILL'//'-'//'ADVISED'
-```
-
-`character` arrays are most commonly encountered
-
-- treated like any array (indexed using : notation)
-- fixed length (usually padded with blanks)
-
----
-
-# Character Expressions
-
-Example:
-
-```fortran
-CHARACTER FAMILY*16
-FAMILY = ‘GEORGE P. BURDELL’
-
-PRINT*,FAMILY(:6)
-PRINT*,FAMILY(8:9)
-PRINT*,FAMILY(11:)
-PRINT*,FAMILY(:6)//FAMILY(10:)
-```
-
-```fortran
-GEORGE
-P.
-BURDELL
-GEORGE BURDELL
-```
-
----
-
-# Relational Expressions
-
-Two expressions whose values are compared to determine whether the relation is true or false
-
-- may be numeric (common) or non-numeric
-
-`character`  strings can be compared
-
-- done character by character
-- shorter string is padded with blanks for comparison
-
----
-
-# Relational Expressions
-
-|   Operator   | Relationship        |
-| ------------ | --------------- |
-|     `.LT.` or `<`    |  less than |
-|     `.LE.` or `<=`    |  less than or equal to |
-|     `.EQ.` or `==`    |  equal to |
-|     `.NE.` or `/=`    |  not equal to |
-|     `.GT.` or `>`    |  greater than |
-|     `.GE.` or `>=`    |  greater than or equal to |
-
----
-
-# Logical Expressions
-
-Consists of one or more logical operators and logical, numeric or relational operands
-
-- values are `.TRUE.` or `.FALSE.`
-- need to consider overall operator precedence
-
-> can combine logical and integer data with logical operators but this is tricky (**avoid!**)
-
----
-
-# Logical Expressions
-
-|   F77 Operator  |   >F90 Operator |   Example   | Meaning        |
-| --------------- | --------------- | ------------ | --------------- |
-|     `.AND.`     |     `&&`     |     `A .AND. B`     |  logical `AND` |
-|     `.OR.`      |     `\|\|`      |     `A .OR. B`      |  logical `OR` |
-|     `.EQV.`     |     `==`     |     `A .EQV. B`      |  logical equivalence |
-|     `.NEQV.`    |     `/=`    |     `A .NEQV. B`      |  logical inequivalence |
-|     `.XOR.`     |     `/=`     |     `A .XOR. B`      |  exclusive `OR` (same as `.NEQV.`) |
-|     `.NOT.`     |     `!`     |     `.NOT. A`      |  logical negation |
-
----
-
-# Arrays in FORTRAN
-
-Arrays can be multi-dimensional (up to 7 in F77) and are indexed using `( )`:
-
-- `TEST(3)` or `FORCE(4,2)`
-
-> Indices are by default defined as `1...N`
-
-We can specify index range in declaration
-
-- `INTEGER K(0:11)` : `K` is dimensioned from `0-11` (12 elements)
-
-Arrays are stored in column order (1st column, 2nd column, etc) so accessing by **incrementing row index first** usually is **fastest** (see later)
-
-Whole array reference (only in >F90): `K(:)=-8` assigns 8 to all elements in K
-
-> Avoid `K=-8` assignement
-
----
-
-# Unconditional `GO TO` in F77
-
-This is the only GOTO in FORTRAN 77
-
-- Syntax: `GO TO label`
-- Unconditional transfer to labeled statement
-
-```fortran
-  10  -code-
-      GO TO 30
-      -code that is bypassed-
-  30  -code that is target of GOTO-
-      -more code-
-      GO TO 10
-```
-
-- **Problem** : leads to confusing *"spaghetti code"* :boom:
-
----
-
-# `IF ELSE IF` Statement
-
-Basic version:
-
-```fortran
-IF (KSTAT.EQ.1) THEN
-  CLASS='FRESHMAN'
-ELSE IF (KSTAT.EQ.2) THEN
-  CLASS='SOPHOMORE'
-ELSE IF (KSTAT.EQ.3) THEN
-  CLASS='JUNIOR'
-ELSE IF (KSTAT.EQ.4) THEN
-  CLASS='SENIOR'
-ELSE
-  CLASS='UNKNOWN'
-ENDIF
-```
-
----
-
-# Spaghetti Code in F77 (and before)
-
-Use of `GO TO` and arithmetic `IF`'s leads to bad code that is very hard to maintain
-
-Here is the equivalent of an `IF-THEN-ELSE` statement:
-
-```fortran
-  10  IF (KEY.LT.0) GO TO 20
-      TEST=TEST-1
-      THETA=ATAN(X,Y)
-      GO TO 30
-  20  TEST=TEST+1
-      THETA=ATAN(-X,Y)
-  30  CONTINUE
-```
-
-Now try to figure out what a complex `IF ELSE IF` statement would look like coded with this kind of simple `IF`...
-
----
-
-# Loop Statements (old versions)
-
-`DO` loop: structure that executes a specified number of times
-
-*Spaghetti Code Version*
-
-```fortran
-      K=2
-  10  PRINT*,A(K)
-      K=K+2
-      IF (K.LE.11) GO TO 10
-  20  CONTINUE
-```
-
-*F77 Version*
-
-```fortran
-      DO 100 K=2,10,2
-      PRINT*,A(K)
- 100  CONTINUE
-```
-
----
-
-# Loop Statements (>F90)
-
-```fortran
-DO K=2,10,2
-  WRITE(*,*) A(K)
-END DO
-```
-
-- `loop_control` can include variables and a third parameter to specify increments, including negative values
-- loop always executes ONCE before testing for end condition
-
-```fortran
-READ(*,*) R
-DO WHILE (R.GE.0) 
-  VOL=2*PI*R**2*CLEN
-  READ(*,*) R
-END DO
-```
-
-- Loop will not execute at all if `logical_expr` is not true at start
-
----
-
-# Comments on Loop Statements
-
-In old versions:
-
-- to transfer out (exit loop), use a `GO TO`
-- to skip to next loop, use `GO TO` terminating statement (this is a good reason to always make this a `CONTINUE` statement)
-
-In new versions:
-
-- to transfer out (exit loop), use `EXIT` statement and control is transferred to statement following loop end. This means you cannot transfer out of multiple nested loops with a single `EXIT` statement (use named loops if needed - `myloop : do i=1,n`). This is much like a `BREAK` statement in other languages.
-- to skip to next loop cycle, use `CYCLE` statement in loop.
-
----
-
-# File-Directed Input and Output
-
-Much of early FORTRAN was devoted to reading input data
-from "cards" and writing to a line printer
-
-Today, most I/O is to and from a file: it requires more extensive I/O capabilities standardized until FORTRAN 77
-
-**I/O** = communication between a program and the outside world
-
-- opening and closing a file with `OPEN` & `CLOSE`
-- data reading & writing with `READ` & `WRITE`
-- can use **unformatted** `READ` & `WRITE` if no human readable data are involved (much faster access, smaller files)
-
-> Fortran 77 source code [plot.f](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/03_plot.f)
-
----
-
-# `READ` Statement
-
-- syntax: `READ(dev_no, format_label) variable_list`
-- read a record from `dev_no` using `format_label` and assign results to variables in `variable_list`
-
-```fortran
-      READ(105,1000) A,B,C
- 1000 FORMAT(3F12.4)
-```
-
-> device numbers 1-7 are defined as standard I/O devices
-
-- each `READ` reads one or more lines of data and any remaining data in a line that is read is dropped if not translated to one of the variables in the `variable_list`
-- `variable_list` can include implied `DO` such as: `READ(105,1000)(A(I),I=1,10)`
-
----
-
-# `READ` Statement - cont'd
-
-- input items can be integer, real or character
-- characters must be enclosed in `' '` (or `" "`)
-- input items are separated by commas
-- input items must agree in type with variables in `variable_list`
-- each `READ` processes a new record (line)
-
-```fortran
-INTEGER K
-REAL(8) A,B
-OPEN(105,FILE='path_to_existing_file')
-READ(105,*) A,B,K
-```
-
-> read one line and look for floating point values for A and B and an integer for K
-
----
-
-# `WRITE` Statement
-
-- syntax: `WRITE(dev_no, format_label) variable_list`
-- write variables in `variable_list` to output `dev_no` using format specified in format statement with  `format_label`
-
-```fortran
-      WRITE(*,1000) A,B,KEY
- 1000 FORMAT(F12.4,E14.5,I6)
-```
-
-```fortran
-|----+----o----+----o----+----o----+----|
-    1234.5678  -0.12345E+02    12
-```
-
-- device number `*` is by default the screen (or *standard output* - also 6)
-- each `WRITE` produces one or more output lines as needed to write out `variable_list` using `format` statement
-- `variable_list` can include implied `DO` such as: `WRITE(*,2000)(A(I),I=1,10)`
-
-<!-- _footer: "" -->
-
----
-
-# `FORMAT` Statement
-
-|   data type  |   format descriptors |   example   |
-| --------------- | --------------- | ------------ |
-|     `integer`     |     `iw`     |     `write(*,'(i5)') int`     |
-|     `real` (*decimal*)      |     `fw.d`      |     `write(*,'(f7.4)') x`      |
-|     `real` (*exponential*)     |     `ew.d`     |     `write(*,'(e12.3)') y`      |
-|     `character`    |     `a, aw`    |     `write(*,'(a)') string`      |
-|     `logical`     |     `lw`     |     `write(*,'(l2)') test`      |
-|     spaces & tabs     |     `wx` & `tw`     |     `write (*,'(i3,2x,f6.3)') i, x`      |
-|     linebreak     |     `/`     |     `write (*,'(f6.3,/,f6.3)') x, y`      |
-
----
-
-# `OPEN` & `CLOSE` example (>F90)
-
-Once opened, file is referred to by an assigned device number (a unique id)
-
-```fortran
-character(len=*) :: x_name
-integer          :: ierr, iSize, guess_unit
-logical          :: itsopen, itexists
-!
-inquire(file=trim(x_name), size=iSize, number=guess_unit, opened=itsopen, exist=itexists)
-if ( itsopen ) close(guess_unit, status='delete')
-!
-open(902,file=trim(x_name),status='new',iostat=ierr)
-!
-if (iSize <= 0 .OR. .NOT.itexists) then
-  open(902,file=trim(x_name),status='new',iostat=ierr)
-  if (ierr /= 0) then
-    ...
-    close(902)
-  endif
-  ...
-endif
-```
-
----
-
-# `NAMELIST`
-
-It is possible to pre-define the structure of input and output data using `NAMELIST` in order to make it easier to process with `READ` and `WRITE` statements
-
-- Use `NAMELIST` to define the data structure
-- Use `READ` or `WRITE` with reference to `NAMELIST` to handle the data in the specified format
-
-> This is not part of standard F77 but it is included in >F90
-
----
-
-# `NAMELIST` - cont'd
-
-On input, the `NAMELIST` data must be structured as follows:
-
-```fortran
-&INPUT
-  THICK=0.245,
-  LENGTH=12.34,
-  WIDTH=2.34,
-  DENSITY=0.0034
-/
-```
-
-> Fortran 90 source code [namelist.f90](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/04_namelist.f90)
-> Namelist file [namelist.def](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/04_namelist.def)
-
----
-
-# Internal `WRITE` Statement
-
-Internal `WRITE` does same as `ENCODE` in F77 : **a cast to string**
-> `WRITE (dev_no, format_label) var_list`
-> write variables in `var_list` to internal storage defined by character variable used as `dev_no` = default character variable (not an array)
-
-```fortran
-INTEGER*4 J,K
-CHARACTER*50 CHAR50
-DATA J,K/1,2/
-...
-WRITE(CHAR50,*) J,K
-```
-
-Results:
-
-```fortran
-CHAR50='    1     2'
-```
-
----
-
-# Internal `READ` Statement
-
-Internal `READ` does same as `DECODE` in F77 : **a cast from string**
-> `READ (dev_no, format_label) var_list`
-> read variables from internal storage specified by character variable used as `dev_no` = default character variable (not an array)
-
-```fortran
-INTEGER K
-REAL A,B
-CHARACTER*80 REC80
-DATA REC80/'1.2, 2.3, -5'/
-...
-READ(REC80,*) A,B,K
-```
-
-Results:
-
-```fortran
-A=1.2, B=2.3, K=-5
-```
-
-<!-- _footer: "" -->
-
----
-
-# Structured programming
-
-Structured programming is based on subprograms (functions and subroutines) and control statements (like `IF` statements or loops) :
-
-- structure the control-flow of your programs (e.g. give up the `GO TO`)
-- improved readability
-- lower level aspect of coding in a smart way
-
-It is a **programming paradigm** aimed at improving the quality, clarity, and access time of a computer program
-
----
-
-# Functions and Subroutines
-
-`FUNCTION` & `SUBROUTINE` are subprograms that allow structured coding
-
-- `FUNCTION`: returns a single explicit function value for given function arguments
-  It’s also a variable → so must be declared !
-- `SUBROUTINE`: any values returned must be returned through the arguments (no explicit subroutine value is returned)
-- functions and subroutines are **not recursive in F77**
-
-Subprograms use a separate namespace for each subprogram so that variables are local to the subprogram
-
-- variables are passed to subprogram through argument list and returned in function value or through arguments
-- variables stored in `COMMON` may be shared between namespaces
-
-<!-- _footer: "" -->
-
----
-
-#  Functions and Subroutines - cont'd
-
-Subprograms must (should) include at least one `RETURN` (can have more) and be terminated by an `END` statement
-
-`FUNCTION` example:
-
-```fortran
-REAL FUNCTION AVG3(A,B,C)
-AVG3=(A+B+C)/3
-RETURN
-END
-```
-
-Use:
-
-```fortran
-AV = WEIGHT*AVG3(A1,F2,B2)
-```
-
-> `FUNCTION` type is implicitly defined as REAL
-
----
-
-# Functions and Subroutines - cont'd
-
-Subroutine is invoked using the `CALL` statement
-
-```fortran
-SUBROUTINE AVG3S(A,B,C,AVERAGE)
-AVERAGE=(A+B+C)/3
-RETURN
-END
-```
-
-Use:
-
-```fortran
-CALL AVG3S(A1,F2,B2,AVR)
-RESULT = WEIGHT*AVR
-```
-
-Any returned values must be returned through argument list
-
-> Fortran 90 source code [newton.f90](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/05_newton.f90)
-
----
-
-# Arguments
-
-Arguments in subprogram are `dummy` arguments used in place of the real arguments
-
-- arguments are passed by **reference** (memory address) if given as *symbolic*
-  >the subprogram can then alter the actual argument value since it can access it by reference
-- arguments are passed by **value** if given as *literal* (so cannot be modified)
-
-```fortran
-CALL AVG3S(A1,3.4,C1,QAV)
-```
-
-> 2nd argument is passed by value - QAV contains result
-
-```fortran
-CALL AVG3S(A,C,B,4.1)
-```
-
-> no return value is available since "4.1" is a value and not a reference to a variable!
-
----
-
-# Arguments - cont'd
-
-- `dummy` arguments appearing in a subprogram declaration cannot be an individual array element reference, e.g., `A(2)`, or a *literal*, for obvious reasons!
-- arguments used in invocation (by calling program) may be *variables*, *subscripted variables*, *array names*, *literals*, *expressions* or *function names*
-- using symbolic arguments (variables or array names) is the **only way** to return a value (result) from a  `SUBROUTINE`
-
-> It is considered **BAD coding practice**, but functions can return values by changing the value of arguments
-  This type of use should be strictly **avoided**!
-
----
-
-# Arguments - cont'd
-
-The `INTENT` keyword (>F90) increases readability and enables better compile-time error checking
-
-```fortran
-SUBROUTINE AVG3S(A,B,C,AVERAGE)
-  IMPLICIT NONE
-  REAL, INTENT(IN)    :: A, B
-  REAL, INTENT(INOUT) :: C        ! default
-  REAL, INTENT(OUT)   :: AVERAGE
-  
-  A = 10                          ! Compilation error
-  C = 10                          ! Correct
-  AVERAGE=(A+B+C)/3               ! Correct
-END
-```
-
-> Compiler uses `INTENT` for error checking and optimization
-
----
-
-# `FUNCTION` versus Array
-
-`REMAINDER(4,3)` could be a 2D array or it could be a reference to a function
-
-If the name, including arguments, **matches an array declaration**, then it is taken to be an array, **otherwise**, it is assumed to be a `FUNCTION`
-
-Be careful about `implicit` versus `explicit` type declarations with `FUNCTION`
-
-```fortran
-PROGRAM MAIN
-  INTEGER REMAINDER
-  ...
-  KR = REMAINDER(4,3)
-  ...
-END
-
-INTEGER FUNCTION REMAINDER(INUM,IDEN)
-  ...
-END
-```
-
-<!-- _footer: "" -->
-
----
-
-# Arrays with Subprograms
-
-Arrays present special problems in subprograms
-
-- must pass by reference to subprogram since there is no way to list array values explicitly as literals
-- how do you tell subprogram how large the array is ?
-
-> Answer varies with FORTRAN version and vendor (dialect)...
-
-When an array element, e.g. `A(1)`, is used in a subprogram invocation (in calling program), it is passed as a reference (address), just like a simple variable
-
-When an array is used by name in a subprogram invocation (in calling program), it is passed as a reference to the entire array. In this case the array must be appropriately dimensioned in the subroutine (and this can be tricky...)
-
----
-
-# Arrays - cont'd
-
-### Data layout in multi-dimensional arrays
-
-- always increment the left-most index of multi-dimensional arrays in the innermost loop (i.e. fastest)
-- **column major** ordering in Fortran vs. **row major** ordering in C
-- a compiler (with sufficient optimization flags) may re-order loops automatically
-
-```fortran
-do j=1,M
-  do i=1,N ! innermost loop
-    y(i) = y(i)+ a(i,j)*x(j) ! left-most index is i
-  end do
-end do
-```
-
----
-
-# Arrays - cont'd
-
-- dynamically allocate memory for arrays using `ALLOCATABLE` on declaration
-- memory is allocated through `ALLOCATE` statement in the code and is deallocated through `DEALLOCATE` statement
-
-```fortran
-integer :: m, n
-integer, allocatable :: idx(:)
-real, allocatable :: mat(:,:)
-m = 100 ; n = 200
-allocate( idx(0:m-1))
-allocate( mat(m, n))
-...
-deallocate(idx , mat)
-```
-
-> It exists many array intrinsic functions: SIZE, SHAPE, SUM, ANY, MINVAL, MAXLOC, RESHAPE, DOT_PRODUCT, TRANSPOSE, WHERE, FORALL, etc
-
----
-
-# `COMMON` & `MODULE` Statement
-
-The `COMMON` statement allows variables to have a more extensive scope than otherwise
-
-- a variable declared in a `Main Program` can be made accessible to subprograms (without appearing in argument lists of a calling statement)
-- this can be selective (don't have to share all everywhere) with `ONLY`
-- **placement**: among type declarations, after `IMPLICIT` or `EXPLICIT`, before `DATA` statements
-- can group into **labeled** `COMMON`
-
-With > F90, it's better to use the `MODULE` subprogram instead of the `COMMON` statement
-
-> Fortran 77 source code [common.f](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/06_common.f) - Fortran 90 source code [module.f90](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/06_module.f90)
-
----
-
-# Modular programming (>F90)
-
-Modular programming is about separating parts of programs into independent and interchangeable modules :
-
-- improve testability
-- improve maintainability
-- re-use of code
-- higher level aspect of coding in a smart way
-- *separation of concerns*
-
-The principle is that making significant parts of the code independent, replaceable and independently testable makes your programs **more maintainable**
-
----
-
-# Data Type Declarations
-
-FORTRAN >90 allows user derived types
-
-```fortran
-TYPE my_variable
-  character(30)           :: name
-  integer                 :: id
-  real(8)                 :: value
-  integer, dimension(3,3) :: dimIndex
-END TYPE variable
-
-type(my_variable) var
-var%name = "salinity"
-var%id   = 1
-```
-
----
-
-# Subprograms type
-
-`MODULE` are subprograms that allow modular coding and data encapsulation
-
-The interface of a subprogram type is **explicit** or **implicit**
-
-Several types of subprograms:
-
-- `intrinsic`: explicit - defined by Fortran itself (trignonometric functions, etc)
-- `module`: explicit - defined with `MODULE` statement and used with `USE`
-- `internal`: explicit - defined with `CONTAINS` statement inside (sub)programs
-- `external`: implicit (but can be manually (re)defined explicit) - e.g. **libraries**
-
-Differ with the **scope**: what data and other subprograms a subprogram can access
-
----
-
-# `MODULE` type
-
-```fortran
-MODULE example
-  IMPLICIT NONE
-  INTEGER, PARAMETER :: index = 10
-  REAL(8), SAVE      :: latitude
-CONTAINS
-  FUNCTION check(x) RESULT(z)
-  INTEGER :: x, z
-  ...
-  END FUNCTION check
-END MODULE example
-```
-
-```fortran
-PROGRAM myprog
-  USE example, ONLY: check, latitude
-  IMPLICIT NONE
-  ...
-  test = check(a)
-  ...
-END PROGRAM myprog
-```
-
-<!-- _footer: "" -->
-
-<!-- Notes for presenter. -->
-<!-- 
-```fortran
-module subs
-
-contains
-
-subroutine asub (i, control)
-
-   implicit none
-
-   integer, intent (in) :: i
-   logical, intent (in) :: control
-
-   integer, save :: j = 0
-   integer :: k
-
-   j = j + i
-   if ( control ) k = 0
-   k = k + i
-
-   write (*, *) 'i, j, k=', i, j, k
-
-end subroutine asub
-
-end module subs
-
-program test_saves
-
-   use subs
-   implicit none
-
-   call asub ( 3, .TRUE. )
-   call asub ( 4, .FALSE. )
-
-end program test_saves
-```
-
-Local variable k of the subroutine is intentionally misused -- in this program it is initialized in the first call since control is TRUE, but on the second call control is FALSE, so k is not redefined. But without the save attribute k is undefined, so the using its value is illegal.
-
-```fortran
- i, j, k=           3           3           3
- i, j, k=           4           7           7
-```
-
-Compiling the program with ifort and aggressive optimization options, k lost its value:
-
-```fortran
- i, j, k=           3           3           3
- i, j, k=           4           7           4
-```
--->
-
----
-
-# `internal` subprogams
-
-```fortran
-program main
-  implicit none
-  integer N
-  real X(20)
-  ...
-  write(*,*), 'Processing x...', process()
-  ...
-contains
-  logical function process()
-    ! in this function N and X can be accessed directly (scope of main)
-    ! Please not that this method is not recommended:
-    ! it would be better to pass X as an argument of process
-    implicit none
-    if (sum(x) > 5.) then
-       process = .FALSE.
-    else
-       process = .TRUE.
-    endif
-  end function process
-end program
-```
-
-<!-- _footer: "" -->
-
----
-
-# `external` subprogams
-
-- `external` subprogams are defined in a separate program unit
-- to use them in another program unit, refer with the `EXTERNAL` statement
-- compiled separately and linked
-
-**!!! DO NOT USE THEM**: modules are much easier and more robust :exclamation:
-
-They are only needed when subprogams are written with different programming language or when using external libraries (such as BLAS)
-
-> It's **highly** recommended to construct `INTERFACE` blocks for any external subprogams used
-
----
-
-# `interface` statement
-
-```fortran
-SUBROUTINE nag_rand(table)
-  INTERFACE 
-    SUBROUTINE g05faf(a,b,n,x)
-      REAL, INTENT(IN)    :: a, b
-      INTEGER, INTENT(IN) :: n
-      REAL, INTENT(OUT)   :: x(n)
-    END SUBROUTINE g05faf
-  END INTERFACE
-  !
-  REAL, DIMENSION(:), INTENT(OUT) :: table
-  !
-  call g05faf(-1.0,-1.0, SIZE(table), table)
-END SUBROUTINE nag_rand
-```
-
-<!-- _footer: "" -->
-
----
-
-# Fortran Compiler and libraries
-
-Examples:
-
-```bash
-module load netCDF-Fortran/4.5.3-gompi-2021b
-gfortran -ffree-line-length-none \
--o OceanGrideChange.exe 07_OceanGrideChange.f90 \
--I${EBROOTNETCDFMINFORTRAN}/include -L${EBROOTNETCDFMINFORTRAN}/lib -lnetcdff
-```
-
-```bash
-module load netCDF-Fortran/4.5.3-iimpi-2021b
-ifort -O3 \
--o OceanGrideChange.exe 07_OceanGrideChange.f90 \
--I${EBROOTNETCDFMINFORTRAN}/include -L${EBROOTNETCDFMINFORTRAN}/lib -lnetcdff
-```
-
-> Fortran 90 source code [OceanGrideChange.f90](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/07_OceanGrideChange.f90) with the input file [input.nc](https://gogs.elic.ucl.ac.be/pbarriat/learning-fortran/src/master/src/07_input.nc)
-
----
-
-# Conclusions
-
-- Fortran in all its standard versions and vendor-specific dialects is a rich but confusing language
-- Fortran is a modern language that continues to evolve
-
-- Fortran is still ideally suited for numerical computations in engineering and science
-  - most new language features have been added since F95
-  - "High Performance Fortran" includes capabilities designed for parallel processing

BIN
slides.pdf


+ 0 - 9
src/00_hello_world.f

@@ -1,9 +0,0 @@
-C     Display "Hello world!"
-C
-      program hello_world
-
-         implicit none
-
-         print *, "Hello world!"
-
-      end program hello_world

+ 0 - 96
src/01_arith.f

@@ -1,96 +0,0 @@
-c
-c   Program to demonstrate Arithmetic Assignments
-c
-      program arith
-      implicit none
-c
-c     declare the data types for all Fortran variables
-c
-      real r2,r3,r4,r5,r6,ans1,ans2,ans3
-      integer i2,i3,i4,i5,i6,ians1,ians2,ians3,ians4
-c
-c     r2 thru r6 take on the real values 2.0 thru 6.0
-c
-c     i2 thru i6 take on the integer values 2 thru 6
-c
-c     ans1, ans2, and ans3 will contain the answers from
-c     real arithmetic
-c
-c     ians1 thru ians4 will contain the answers from
-c     integer arithmetic
-c
-c
-c     Set initial values of the variables with 2 valid forms
-c     of data statements
-      data r2/2./,r3/3./,r4/4.0/,r5/5.0/
-      data i2,i3,i4,i5/2,3,4,5/
-c
-c     This ends the non-executable statements, nothing above
-c     this point results in a machine instruction to perform
-c     some operation.
-c     Executable statements follow.
-c
-c     The result of any integer divide is truncated to the integer
-c     value less than the correct decimal answer for the division
-c     The result of this is that changing the order of operations
-c     can make a big difference in the answers.  Notice how parentheses
-c     force more expected results
-c
-      ians1=i2*i3/i5
-      ians2=i3/i5*i2
-      ians3=i2*(i3/i5)
-      ians4=(i3/i5)*i2
-      print *, '2*3/5 =', ians1, ', 3/5*2 =',ians2,
-     &  ', 2*(3/5) =',ians3 ,', (3/5)*2 =',ians4
-c
-c     Real arithmetic behaves more uniformly
-c
-      ans1=r2*r3/r5
-      ans2=r3/r5*r2
-      ans3=(r3/r5)*r2
-      print *, '2.0*3.0/5.0 =', ans1, ', 3.0/5.0*2.0 =',ans2,
-     &  ', (3.0/5.0)*2.0 =',ans3
-c
-c     Watch how precedence of operations effects the following:
-c
-      ians1=i2+i5*i3**i2
-      ians2=i5*i3**i2+i2
-      ians3=i3**i2*i5+i2
-      print *, '2+5*3**2 =',ians1,', 5*3**2+2 =',ians2,
-     & ', 3**2*5+2 =',ians3
-c
-c     You can mix real and integers, but watch what happens
-c
-      ans1=r5+i3/i2
-      print *, '5.0+3/2 =',ans1
-
-c
-c     You can do the same thing with constants in the expression
-c
-      ans2=5.0+3/2
-      print *, '5.0+3/2 =',ans2
-c
-c     Look at what happens when I put a real in either the numerator
-c     or denominator of the division term
-      ans1=r5+i3/r2
-      ans2=r5+r3/i2
-      print *, '5.0+3/2.0 =',ans1, ', 5.0+3.0/2 =', ans2
-c
-
-c     Although Fortran normally works from left to right at a given
-c     level of precedence (does all multiply and divide from left to
-c     right before moving on to adds and subtracts).  It works
-c     exponentiation from right to left when it hits 2 or more
-c     sequential exponentiation operations
-c
-      ians1= i5**i3**i2
-      ians2= (i5**i3)**i2
-      ians3= i5**(i3**i2)
-      print *, '5**3**2 =',ians1, ', (5**3)**2 =',ians2,
-     &  ', 5**(3**2) =',ians3
-c
-c    When in doubt use parentheses to get the answer that you
-c    really want.
-c
-      stop
-      end

+ 0 - 24
src/02_sphere.f

@@ -1,24 +0,0 @@
-      PROGRAM sphere    
-      implicit none
-      
-      real pi,radius,volume,area  
-          
-      WRITE(*,*) 'Enter the value for the radius of a sphere.'
-      READ(*,*) radius
- 
-ccccc PI value
-      pi =
-ccccc PI value
-      WRITE(*,*) 'The value of pi is ', pi
-
-ccccc Air & volume       
-      area =
-      volume =
-ccccc Air & volume 
-      
-      WRITE(*,*) 'For a radius ', radius 
-      WRITE(*,*) 'the area of a sphere is ', area
-      WRITE(*,*) 'and the volume is ', volume
-      
-      STOP
-      END

+ 0 - 59
src/03_plot.f

@@ -1,59 +0,0 @@
-      program plot
-c
-c    Program to provide plots of Sin(x)
-c
-      implicit none
-      character label*150
-      real x
-      integer i
-      character xlabel*32,ylabel*32,title*32
-      real fx
-c
-c   label   -   Character string 
-c   xlabel  -   Contains a label for the x-axis
-c   ylabel  -   Contains a label for the y-axis
-c   title   -   Contains a title for the plot
-c
-c   Drive a separate true graphics program (gnuplot)
-c
-c   First set up the command file for gnuplot
-c
-      xlabel='''x'''
-      ylabel='''y'''
-      title="'sin(x)'"
-      open (112,file='03_gnuxy')
-c
-c     write(112,*) 'set term wxt size 800, 800'
-c
-      label='set xlabel '//xlabel
-      write(112,*)label
-      write(112,*)'set xrange [0:6]'
-      label='set ylabel '//ylabel
-      write(112,*)label
-      write(112,*)'set yrange [-1.2:1.2]'
-      label='plot "03_dataxy" using 1:2 title '//title
-      label=trim(label)//' with lines lt rgb "red"'
-      write(112,*) label
-      write (112,*) 'pause -1'
-      close(112)
-c
-c   Generate x-y pairs for the graph
-c
-      open (112,file='03_dataxy')
-      do 100 i=0,60
-         x=.1*i
-         fx=sin(x)
-         write(112,*) x,fx
-  100 continue
-      close(112)
-c
-      print *, ' Hit the Return (Enter) key to continue'
-c
-c   Tell the system to run the program gnuplot
-c   This call works on either IBM RS6000 or Sun, but is not part of
-c   the Fortran standard.
-c   Comment out the line if you aren't at a terminal with graphics
-c
-      call system ('gnuplot 03_gnuxy')
-      stop
-      end

+ 0 - 11
src/04_namelist.def

@@ -1,11 +0,0 @@
-! Namelist definition
-
-&namlon   ! limitation on the longitude
-   lon_min   =        0   
-   lon_max   =      360 
-/
-
-&namlat   ! limitation on the latitude
-   lat_min   =      -90 
-   lat_max   =       90  
-/

+ 0 - 33
src/04_namelist.f90

@@ -1,33 +0,0 @@
-PROGRAM test_namelist
-
-  implicit none
-
-  real*8 lon_min, lon_max, lat_min, lat_max
-
-  NAMELIST/namlon/ lon_min, lon_max
-  NAMELIST/namlat/ lat_min, lat_max
-
-  write(*,*) 'Before:'
-  call print_res(lon_min, lon_max, lat_min, lat_max)
-
-  open(161,file='04_namelist.def',status='old',form='formatted')
-  read(161,NML=namlon)
-
-  write(*,*) 'Between:'
-  call print_res(lon_min, lon_max, lat_min, lat_max)
-
-  read(161,NML=namlat)
-  close (161)
-
-  write(*,*) 'After:'
-  call print_res(lon_min, lon_max, lat_min, lat_max)
-
-END
-
-SUBROUTINE print_res(a,b,c,d)
-  implicit none
-  real*8, intent(in) :: a,b,c,d
-  write(*,'(4(A12,F6.2))') '  lon_min = ',a,', lon_max = ',b, &
-                          ', lat_min = ',c,', lat_max = ',d
-  RETURN
-END

+ 0 - 54
src/05_newton.f90

@@ -1,54 +0,0 @@
-program newton
-
-  implicit none
-
-! Use a Newton iteration to solve the equation --> x**3+x-10
-!
-!  x     -    current approximation to the solution
-!  f(x)  -    polynomial function
-!  df    -    derivative of f with respect to x
-!  xo    -    previous guess for solution
-!  eps   -    convergence criterion
-!  dx    -    change in solution approximation
-!  it    -    number of iterations
-!  itmax -    maximum number of iterations
-
-  integer, parameter :: itmax = 1000 
-  real(8), parameter :: eps   = 1.e-6
-
-  integer :: it
-  real(8) :: x,f,df,xo
-
-  it = 0
-  f  = 1d0
-
-  write(*,*) 'Try to solve "x**3+x-10=0"'
-  write(*,*) 'What is your initial guess for the solution?'
-  read(*,*) x
-
-  do while( dabs(f)>eps .and. it<=itmax )
-    it=it+1
-    xo=x
-    call derivate(xo,f,df)
-    x = xo -f/df
-    write(*,*) 'it = ',it,', x = ',x,', f(x) = ',f
-  end do
-
-end program
-
-! ******************************************************************************************
-
-subroutine derivate(x,f,d)
-
-! Evaluate the function f(x)=x**3+x-10
-! also return the derivative of the function
-                                             
-   implicit none
-
-   real(8), intent(in)  :: x
-   real(8), intent(out) :: f, d
-
-   d = 3*x**2 + 1d0
-   f = x**3 + x - 10d0
-
-end subroutine

+ 0 - 50
src/05_newton_plot.f90

@@ -1,50 +0,0 @@
-program plot
-
-  implicit none
-      
-  real(4) :: fx, x
-  integer :: i
-
-  open (112,file='05_gnuxy.gpl')
-
-  write(112,*) 'set grid'
-  write(112,*) 'set xzeroaxis'
-  write(112,*) 'set yzeroaxis'
-  write(112,*) 'set border 0          # remove frame'
-  write(112,*) 'set xtics axis        # place tics on axis rather than on border'
-  write(112,*) 'set ytics axis'
-  write(112,*) 'set ticscale 0        # [optional] labels only, no tics'
-  write(112,*) 'set xtics add ("" 0)  # suppress origin label that lies on top of axis'
-  write(112,*) 'set ytics add ("" 0)  # suppress origin label that lies on top of axis'
-  write(112,*) ''
-  write(112,*) '# if arrows are wanted only in the positive direction'
-  write(112,*) 'set arrow 1 from 0,0 to graph 1, first 0 filled head'
-  write(112,*) 'set arrow 2 from 0,0 to first 0, graph 1 filled head'
-  write(112,*) ''
-  write(112,*) '# if arrows in both directions from the origin are wanted'
-  write(112,*) 'set arrow 3 from 0,0 to graph 0, first 0 filled head'
-  write(112,*) 'set arrow 4 from 0,0 to first 0, graph 0 filled head'
-  write(112,*) ''
-  write(112,*) 'set nokey'
-  write(112,*) 'set xrange [-4:4]'
-  write(112,*) 'plot "04_dataxy_1" using 1:2 with lines lt rgb "blue"'
-  write(112,*) 'pause -1'
-
-  close(112)
-
-  ! Generate x-y pairs for the graph
-
-  open (112,file='05_dataxy.dat')
-  do i=-40,40
-    x  = .1*i
-    fx = x**3+x-10.0
-    write(112,*) x, fx
-  end do
-  close(112)
-
-  print *, ' Hit the Return (Enter) key to continue'
-
-  call system ('gnuplot 05_gnuxy.gpl')
-  stop
-
-end

+ 0 - 36
src/06_common.f

@@ -1,36 +0,0 @@
-c * * * *
-c syntaxe common
-c common /nom de la zone commune/ liste des variables
-c * * * * 
-
-      PROGRAM test_arg
-
-        implicit none
-        integer a,b,c
-
-        common /arg/ a,b,c
-
-        a = 2
-        c = 1
-
-        print *, 'Before the call:'
-        print *, 'a = ',a,', b = ',b,', c = ',c
-
-        call sub
-
-        print *, 'After the call:'
-        print *, 'a = ',a,', b = ',b,', c = ',c
-
-      END PROGRAM
-
-      SUBROUTINE sub
-
-        implicit none
-
-        integer a,b,c
-        common /arg/ a,b,c
-
-        b = a + c
-        c = c + 1
-       
-      END SUBROUTINE

+ 0 - 35
src/06_module.f90

@@ -1,35 +0,0 @@
-MODULE arg
- implicit none
- integer :: a,b,c
- real(8) :: x
-END MODULE arg
-
-! * * * * * * * 
-
-PROGRAM test_arg
- USE arg
- implicit none
-
- a = 2
- c = 1
-
- write(*,*) 'Before the call:'
- write(*,'(3(A5,I3))') ' a = ',a,', b = ',b,', c = ',c
-
- call sub
-
- write(*,*) 'After the call:'
- write(*,'(3(A5,I3))') 'a = ',a,', b = ',b,', c = ',c
-
-END PROGRAM test_arg
-
-! * * * * * * * 
-
-SUBROUTINE sub
- USE arg, only : a,b,c    ! seuls a b et c sont utiles
- implicit none
-
- b = a + c
- c = c + 1
-
-END SUBROUTINE sub

+ 0 - 1353
src/07_OceanGrideChange.f90

@@ -1,1353 +0,0 @@
-module bloc_commun
-  implicit double precision (a-h,o-z)
-  integer, parameter :: imax=122
-  integer, parameter :: jmax=65
-  integer, parameter :: jsepar=50
-  integer, parameter :: jeq=28
-  real, parameter :: spv=-1.e+32
-  real, parameter :: spvMin=-1.5e+32
-  real, parameter :: spvMax=-0.5e+32
-  integer, parameter :: jmtt=60
-  integer, parameter :: imtt=120
-  real*4 wdata3D(imax,jmax,2) !2 parce qu'au pire c'est un vecteur (2 dimensions)
-  real*4 wdatai3D(imtt,jmtt,2)
-  REAL, PARAMETER :: xi1 = 28.500, dxi = 3.00
-  REAL, PARAMETER :: yj1 =-79.500, dyj = 3.00
-  integer, PARAMETER :: iberp =56 , ibera = 103
-  real xlon1, ylat1, dlat, dlong
-
-  !--DEFINITION OF CONSTANTS.
-  !  pi    : pi
-  !  radian: value of one radian in degrees.
-  !  degre : value of one degre in radian .
-  !  separ : facteur de separation entre spv / normal value.
-  real*4, parameter :: pi     = 4.0d0 * atan(1.0d0)
-  real*4, parameter :: radian = pi/180.0
-  real*4, parameter :: degre  = 180.0/pi
-  real*4, parameter :: untour = 360.0d0
-  real*4, parameter :: epsil = 0.1d-9
-  real*4, parameter :: zero = 0.0
-  real*4, parameter ::  one  = 1.0
-  real*4, parameter :: separ = 0.5 + epsil
-
-  !--DEFINITION OF ROTATION ANGLES
-
-  real*4, parameter :: alpha =    0.0
-  real*4, parameter :: beta  = -111.0
-
-  save
-end module bloc_commun
-
-subroutine check(status)
-  USE NETCDF
-  IMPLICIT NONE
-
-  INTEGER, INTENT (IN) :: status
-  if(status /= nf90_noerr) then 
-    write(*,*)"Error : ", trim(nf90_strerror(status))
-    stop 
-  end if
-end subroutine check  
-
-
-program OceanGrideChange
-  USE NETCDF
-  USE bloc_commun
-  IMPLICIT NONE
-
-  TYPE variable
-    CHARACTER(nf90_max_name) :: name
-    integer :: itype
-    integer :: netcdfId
-    integer :: OutnetcdfId
-    integer, dimension(:), allocatable :: dimIndex
-    integer, dimension(:), allocatable :: OutdimIndex
-    integer, dimension(:), allocatable :: dimSize
-    integer, dimension(:), allocatable :: dimStart
-    integer :: nbdim
-  END TYPE variable
-
-  integer, parameter :: mx=120
-  integer, parameter :: my=65
-  integer, parameter :: mz=20
-  real*4 wdatx(imax,jmax), wdaty(imax,jmax)
-  real*4 valgu(imtt,jmtt), valgv(imtt,jmtt)
-  real*4 :: ttlon(imtt)
-  real*4 :: ttlat(jmtt)
-  integer t, ii, n, k, l
-  integer :: j, i, jmin
-  integer :: returnval
-  character(nf90_max_name) :: inputfile, outputfile, ifnocompress_char
-  real ylon1,dylon,xlat1,dxlat
-
-  integer nio0p, njo0p
-
-  type(variable), dimension(:), allocatable :: listVariable, listVariable2
-  double precision, dimension(:,:,:), allocatable :: Value3D
-  double precision, dimension(:,:,:,:), allocatable :: Value4Du
-  double precision, dimension(:,:,:,:), allocatable :: Value4Dv
-  double precision, dimension(:,:,:,:), allocatable :: Value4Dalbq
-  double precision, dimension(:,:), allocatable :: Valueh
-  double precision, dimension(:), allocatable :: ValueVar
-
-  !variable pour l'ouverture ecriture du netcdf
-  integer :: intputID, outputID, outdimid, RecordDimID
-  integer :: unlimDimID, nbDim, nbVar, nbAtt
-  integer :: nbvarDim, dimSize, varID
-  integer :: variableType, outvarid
-  integer, dimension(nf90_max_var_dims) :: varDimID
-  character(nf90_max_name) :: varName, dimName, attName
-  integer, dimension(nf90_max_var_dims) :: CorrespTabDimID, InverseCorrespTabDimID
-  integer :: nbOutDim, nbOutVar
-  double precision, dimension(:), allocatable :: valueDbl
-  integer :: totaltime, nbexistvariable
-  integer :: deflate_level, ifnocompress_int
-  logical :: ifnocompress
-  deflate_level=1
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  !!!!              VARIABLE LIST            !!!!
-  !!!! Becarefull albq need to be at the top !!!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-  allocate(listVariable(29))
-  !averaged lead fraction
-  listVariable(1)%name="albq"!(time, ptlat, ptlon) ;
-  listVariable(1)%itype=1
-  !averaged salinity
-  listVariable(2)%name="salt"!(time, tdepth, ptlat, ptlon)
-  listVariable(2)%itype=1
-  !averaged zonal velocity component
-  listVariable(3)%name="u"!(time, tdepth, pulat, pulon)
-  listVariable(3)%itype=2
-  !averaged meridional velocity component
-  listVariable(4)%name="v"!(time, tdepth, pulat, pulon) ;
-  listVariable(4)%itype=2
-  !averaged vertical velocity component
-  listVariable(5)%name="w"!(time, wdepth, ptlat, ptlon) ;
-  listVariable(5)%itype=1
-  !averaged zonal barotropic momentum
-  listVariable(6)%name="ubar"!(time, pulat, pulon) ;
-  listVariable(6)%itype=2
-  !averaged meridional barotropic momentum
-  listVariable(7)%name="vbar"!(time, pulat, pulon) ;
-  listVariable(7)%itype=2
-  !averaged sea surface height
-  listVariable(8)%name="ssh"!(time, ptlat, ptlon) ;
-  listVariable(8)%itype=1
-  !averaged SST
-  listVariable(9)%name="sst"!(time, ptlat, ptlon) ;
-  listVariable(9)%itype=1
-  !averaged sea surface salinity
-  listVariable(10)%name="sss"!(time, ptlat, ptlon) ;
-  listVariable(10)%itype=1
-  !averaged surface heat flux
-  listVariable(11)%name="shflx"!(time, ptlat, ptlon) ;
-  listVariable(11)%itype=1
-  !averaged surface freshwater flux
-  listVariable(12)%name="sfflx"!(time, ptlat, ptlon) ;
-  listVariable(12)%itype=1
-  !averaged depth of ocean surface mixed layer
-  listVariable(13)%name="zmix"!(time, ptlat, ptlon) ;
-  listVariable(13)%itype=1
-  !averaged depth of convection
-  listVariable(14)%name="zcnv"!(time, ptlat, ptlon) ;
-  listVariable(14)%itype=1
-  !averaged G-M slope
-  listVariable(15)%name="msl"!(time, ptlat, ptlon) ;
-  listVariable(15)%itype=1
-  !averaged ice thickness
-  listVariable(16)%name="hice"!(time, ptlat, ptlon) ;
-  listVariable(16)%itype=1
-  !averaged ice production
-  listVariable(17)%name="hicp"!(time, ptlat, ptlon) ;
-  listVariable(17)%itype=1
-  !averaged snow thickness
-  listVariable(18)%name="hsn"!(time, ptlat, ptlon) ;
-  listVariable(18)%itype=1
-  !averaged snow precipitation
-  listVariable(19)%name="snow"!(time, ptlat, ptlon) ;
-  listVariable(19)%itype=1
-  !averaged ice temperature
-  listVariable(20)%name="tice"!(time, ptlat, ptlon) ;
-  listVariable(20)%itype=1
-  !averaged heat flux at ice base
-  listVariable(21)%name="fb"!(time, ptlat, ptlon) ;
-  listVariable(21)%itype=1
-  !averaged zonal ice velocity
-  listVariable(22)%name="uice"!(time, pulat, pulon) ;
-  listVariable(22)%itype=2
-  !averaged meridional ice velocity
-  listVariable(23)%name="vice"!(time, pulat, pulon) ;
-  listVariable(23)%itype=2
-  !averaged zonal wind stress
-  listVariable(24)%name="wsx"!(time, pulat, pulon) ;
-  listVariable(24)%itype=1
-  !averaged meridional wind stress
-  listVariable(25)%name="wsy"!(time, pulat, pulon) ;
-  listVariable(25)%itype=1
-  !meridional overturning streamfunction
-  listVariable(26)%name="moc"!(time, sfdepth, sflat, basidx) ;
-  listVariable(26)%itype=0
-  !meridional heat transport
-  listVariable(27)%name="mht"!(time, sflat, basidx) ;
-  listVariable(27)%itype=0
-  !meridional salt transport
-  listVariable(28)%name="mst"!(time, sflat, basidx) ;
-  listVariable(28)%itype=0
-  !averaged potential temperature
-  listVariable(29)%name="temp"!(time, tdepth, ptlat, ptlon)
-  listVariable(29)%itype=1
-
-  !get argument for filename
-  ifnocompress=.FALSE.
-  call getarg(1,inputfile)
-  call getarg(2,outputfile)
-  call getarg(3,ifnocompress_char)
-  read (ifnocompress_char,'(I1)') ifnocompress_int
-  if(ifnocompress_int.eq.1) then
-    ifnocompress=.TRUE.
-  endif
-  write(*,'(A,L)') "No compression = ",ifnocompress
-
-
-
-
-  dlat=dyj
-  dlong=dxi
-  xlon1=xi1
-  ylat1=yj1
-  nio0p=imtt
-  njo0p=jmtt
-  call gridtt(ttlon,ttlat,imtt,jmtt)
-  xlat1=ttlat(1)
-  dxlat=ttlat(2)-ttlat(1)
-  ylon1=ttlon(1)
-  dylon=ttlon(2)-ttlon(1)
-
-
-
-
-
-  !!!!!!!!!!!!!!!!!!!!!!!!!
-  !!!! OPEN INPUT FILE !!!!
-  !!!!!!!!!!!!!!!!!!!!!!!!!
-  call check(nf90_open(inputfile, nf90_nowrite, intputID))
-  call check(nf90_inquire(intputID, nbDim, nbVar,  unlimitedDimId = unlimDimID))
-
-  !get totaltime
-  call check(nf90_inquire(intputID, unlimitedDimId = RecordDimID))
-  call check(nf90_inquire_dimension(intputID, RecordDimID, len = dimSize))
-  totaltime=dimSize
-  write(*,'(A,I2)') "Total time in the file = ", totaltime
-
-  !compte combien de variable de la la liste existe dans le fichier input
-  nbexistvariable=0
-  do i=1, size(listVariable)
-    if(nf90_inq_varid(intputID, listVariable(i)%name, varID).eq.nf90_noerr) nbexistvariable=nbexistvariable+1
-  enddo
-
-  !load variable architecture
-  write(*,'(A)') "Variable find in the input file ( idx) name ):"
-  allocate(listVariable2(nbexistvariable))
-  j=1
-  do i=1, size(listVariable)
-    if(nf90_inq_varid(intputID, listVariable(i)%name, varID).eq.nf90_noerr) then
-      listVariable2(j)%name=listVariable(i)%name
-      listVariable2(j)%itype=listVariable(i)%itype
-      call check(nf90_inquire_variable(intputID, varID, varName, ndims = nbvarDim, dimids = varDimID))
-      if(varName.eq.listVariable2(j)%name) then
-        listVariable2(j)%netcdfId=varID
-        allocate(listVariable2(j)%dimIndex(nbvarDim))
-        listVariable2(j)%dimIndex(:)=varDimID(1:nbvarDim)
-        allocate(listVariable2(j)%dimSize(nbvarDim))
-        allocate(listVariable2(j)%dimStart(nbvarDim))
-        do k=1, nbvarDim
-          call check(nf90_inquire_dimension(intputID, varDimID(k), len = dimSize))
-          listVariable2(j)%dimSize(k)=dimSize
-          listVariable2(j)%dimStart(k)=1
-        enddo
-        listVariable2(j)%nbdim=nbvarDim
-        write(*,'(A3,I3,A2,A)') '   ', listVariable2(j)%netcdfId, ') ', trim(listVariable2(j)%name)
-        !write(*,'(4(I3))')listVariable2(j)%dimIndex
-        j=j+1
-      endif
-    endif
-  enddo
-
-
-  !constuire le tableau de correspondance d'index de dimension entre le fichier d'entree et de sortie
-  write(*,'(A)',ADVANCE='NO') "Construct index table..."
-  CorrespTabDimID=-1
-  InverseCorrespTabDimID=0
-  l=3 !commence à trois parce que 1 et 2 sont le nouveau lon et lat
-  do i=1,size(listVariable2)
-    if(listVariable(i)%itype.ne.0) then
-      jmin=3
-      InverseCorrespTabDimID(listVariable2(i)%dimIndex(1))=1
-      InverseCorrespTabDimID(listVariable2(i)%dimIndex(2))=2
-    else
-      jmin=1
-    endif
-    do j=jmin, size(listVariable2(i)%dimIndex)
-      k=1
-      do while(CorrespTabDimID(k).ne.listVariable2(i)%dimIndex(j))
-        k=k+1
-        if(k.gt.nf90_max_var_dims) exit
-      enddo
-      if(k.eq.nf90_max_var_dims+1) then
-        CorrespTabDimID(l)=listVariable2(i)%dimIndex(j)
-        InverseCorrespTabDimID(listVariable2(i)%dimIndex(j))=l
-        l=l+1
-      endif
-    enddo
-  enddo
-  nbOutDim=l-1
-  nbOutVar=0
-  write(*,*) "OK"
-
-
-  write(*,'(A)') "Create output file header :"
-  !write target file
-  if(ifnocompress) then
-    call check(nf90_create(trim(outputfile), NF90_CLASSIC_MODEL, outputID))
-  else
-    call check(nf90_create(trim(outputfile), nf90_hdf5, outputID))
-  endif
-
-  !define dimension, variable associated and attribut
-  write(*,'(A)',ADVANCE='NO') "   Define dimensions and copy attributs..."
-  call check(nf90_inquire(intputID, unlimitedDimId = RecordDimID))
-  do i=1, nbOutDim
-    !get name and size of dimension
-    if(i.eq.1) then
-      dimName="lon"
-      dimSize=120
-    elseif(i.eq.2) then
-      dimName="lat"
-      dimSize=60
-    else
-      call check(nf90_inquire_dimension(intputID, CorrespTabDimID(i), name = dimName, len = dimSize))
-    endif
-
-    !define dimension with separation between unlimited and normal dimension
-    if(CorrespTabDimID(i).eq.RecordDimID) then
-      call check(nf90_def_dim(outputID, dimName, NF90_UNLIMITED, outdimid))
-    else
-      call check(nf90_def_dim(outputID, dimName, dimSize, outdimid))
-    endif
-
-    !define variable associate to dimension and copy/create attribus
-    if(i.eq.1) then
-      if(ifnocompress) then
-        call check(nf90_def_var(outputID, "lon", NF90_FLOAT, (/ 1 /), outvarid))
-      else
-        call check(nf90_def_var(outputID, "lon", NF90_FLOAT, (/ 1 /), outvarid, shuffle = .TRUE., deflate_level=deflate_level))
-      endif
-      call check(nf90_put_att(outputID, outvarid, "long_name", "longitude coordinate"))
-      call check(nf90_put_att(outputID, outvarid, "standard_name", "longitude"))
-      call check(nf90_put_att(outputID, outvarid, "units", "degrees_east"))
-      call check(nf90_put_att(outputID, outvarid, "axis", "X"))
-      nbOutVar=nbOutVar+1
-    elseif(i.eq.2) then
-      if(ifnocompress) then
-        call check(nf90_def_var(outputID, "lat", NF90_FLOAT, (/ 2 /), outvarid))
-      else
-        call check(nf90_def_var(outputID, "lat", NF90_FLOAT, (/ 2 /), outvarid, shuffle = .TRUE., deflate_level=deflate_level))
-      endif
-      call check(nf90_put_att(outputID, outvarid, "long_name", "latitude coordinate"))
-      call check(nf90_put_att(outputID, outvarid, "standard_name", "latitude"))
-      call check(nf90_put_att(outputID, outvarid, "units", "degrees_north"))
-      call check(nf90_put_att(outputID, outvarid, "axis", "Y"))
-      nbOutVar=nbOutVar+1
-    else
-      call check(nf90_inq_varid(intputID, dimName, varID))
-      call check(nf90_inquire_variable(intputID, varID, xtype = variableType, nAtts =nbAtt))
-      if(ifnocompress) then
-        call check(nf90_def_var(outputID, dimName, variableType, (/ i /), outvarid))
-      else
-        call check(nf90_def_var(outputID, dimName, variableType, (/ i /), outvarid, shuffle = .TRUE., deflate_level=deflate_level))
-      endif
-      do j=1, nbAtt
-        call check(nf90_inq_attname(intputID, varID, j, attName))
-        call check(nf90_copy_att(intputID, varID, attName, outputID, outvarid))
-      enddo
-      nbOutVar=nbOutVar+1
-    endif
-  enddo
-  write(*,*) "OK"
-
-
-  !define variable from the list
-  write(*,'(A)',ADVANCE='NO') "   Define variables and copy attributs..."
-  do i=1, size(listVariable2)
-    allocate(listVariable2(i)%OutdimIndex(size(listVariable2(i)%dimIndex)))
-    do j=1, size(listVariable2(i)%dimIndex)
-      listVariable2(i)%OutdimIndex(j)=InverseCorrespTabDimID(listVariable2(i)%dimIndex(j))
-    enddo
-
-    call check(nf90_inquire_variable(intputID, listVariable2(i)%netcdfId, nAtts =nbAtt))
-    if(ifnocompress) then
-      call check(nf90_def_var(outputID, listVariable2(i)%name, NF90_DOUBLE, listVariable2(i)%OutdimIndex, outvarid))
-    else
-      call check(nf90_def_var(outputID, listVariable2(i)%name, NF90_DOUBLE, listVariable2(i)%OutdimIndex, outvarid, shuffle = .TRUE., deflate_level=deflate_level))
-    endif
-    listVariable2(i)%OutnetcdfId=outvarid
-    !and copy attribus
-    do j=1, nbAtt
-      call check(nf90_inq_attname(intputID, listVariable2(i)%netcdfId, j, attName))
-      call check(nf90_copy_att(intputID, listVariable2(i)%netcdfId, attName, outputID, listVariable2(i)%OutnetcdfId))
-    enddo
-  enddo
-  nbOutVar=nbOutVar+size(listVariable2)
-  write(*,*) "OK"
-
-
-  !finish the configuration of the output file and starting put data
-  write(*,'(A)',ADVANCE='NO') "   Close definition mode..."
-  call check(nf90_enddef(outputID))
-  write(*,*) "OK"
-
-  !copy dimension data
-  write(*,'(A)',ADVANCE='NO') "Copy dimensions in output file..."
-  call check(nf90_inquire(intputID, unlimitedDimId = RecordDimID))
-  do i=1, nbOutDim
-    if(i.eq.1) then
-      call check(nf90_put_var(outputID, i, ttlon, (/ 1 /), (/ 120 /)))
-    elseif(i.eq.2) then
-      call check(nf90_put_var(outputID, i, ttlat, (/ 1 /), (/ 60 /)))
-    else
-      call check(nf90_inquire_dimension(intputID, CorrespTabDimID(i), name = dimName, len = dimSize))
-      call check(nf90_inq_varid(intputID, dimName, varID))
-      call check(nf90_inquire_variable(intputID, varID, xtype = variableType, nAtts =nbAtt))
-      do j=1, nbOutVar
-        returnval=nf90_inq_varid(outputID, dimName, outvarid)
-        if(outvarid.ne.-1) exit
-      enddo
-      allocate(valueDbl(dimSize))
-      call check(nf90_get_var(intputID, varID, valueDbl, (/ 1 /), (/ dimSize /)))
-      call check(nf90_put_var(outputID, outvarid, valueDbl, (/ 1 /), (/ dimSize /)))
-      deallocate(valueDbl)
-    endif
-  enddo
-  write(*,*) "OK"
-
-
-  !copy data already interpolate
-  write(*,'(A)',ADVANCE='NO') "Copy variable already interpolate..."
-  do n=1, size(listVariable2)
-    if(listVariable2(n)%itype.eq.0) then
-      call check(nf90_inq_varid(intputID, listVariable2(n)%name, varID))
-      call check(nf90_inquire_variable(intputID, listVariable2(n)%netcdfId, xtype = variableType, nAtts =nbAtt))
-      listVariable2(n)%dimSize(listVariable2(n)%nbdim)=1
-      allocate(valueDbl(product(listVariable2(n)%dimSize)))
-      do t=1, totaltime
-        listVariable2(n)%dimStart(listVariable2(n)%nbdim)=t
-        call check(nf90_get_var(intputID, varID, valueDbl, listVariable2(n)%dimStart, listVariable2(n)%dimSize))
-        call check(nf90_put_var(outputID, listVariable2(n)%OutnetcdfId, valueDbl, listVariable2(n)%dimStart, listVariable2(n)%dimSize))
-      enddo
-      deallocate(valueDbl)
-    endif
-  enddo
-  write(*,*) "OK"
-
-
-  !get h value for undef verification
-  write(*,'(A)') "Get undef zone..."
-  call check(nf90_inq_varid(intputID, "h", varID))
-  allocate(ValueVar(120*65))
-  call check(nf90_get_var(intputID, varID, ValueVar, start = (/1,1/), count = (/120,65/)))
-  allocate(Valueh(120,65))
-  Valueh=reshape(ValueVar, (/120,65/))
-  deallocate(ValueVar)
-  write(*,*) "OK"
-
-  !Open data time by time and process
-  write(*,'(A)') "Processing..."
-  allocate(Value4Dalbq(120, 65, 1, 1))
-  allocate(Value3D(120, 65, 1))
-  do t=1,totaltime
-    write(*,'(A,I5,A,I5,A)',ADVANCE='NO') "   t = ", t, '/', totaltime, ' '
-    n=1
-    do while(n.le.size(listVariable2))
-
-      !affichage de progression
-      if(listVariable2(n)%itype.eq.0) then
-        write(*,'(A)',ADVANCE='NO') '*'
-      elseif(listVariable2(n)%itype.eq.1) then
-        write(*,'(A)',ADVANCE='NO') '.'
-      else
-        write(*,'(A)',ADVANCE='NO') '^'
-      endif
-
-
-      if (listVariable2(n)%itype.ne.0) then !n'interpole pas le type 0
-        varName=listVariable2(n)%name
-
-        !call CF_READ2D(TRIM(name, varName, tk, imax-2, jmax, 1, w1)
-        !limite la dimension temporelle pour lire pas de temps par pas de temps
-        listVariable2(n)%dimStart(listVariable2(n)%nbdim)=t
-        listVariable2(n)%dimSize(listVariable2(n)%nbdim)=1
-
-        !initialise le pointeur de donnee monodimensionnel
-        allocate(ValueVar(product(listVariable2(n)%dimSize)))
-
-        !lit la variable
-        call check(nf90_get_var(intputID, listVariable2(n)%netcdfId, ValueVar, start = listVariable2(n)%dimStart, count = listVariable2(n)%dimSize))
-
-        !verifie si 3D ou 4D et reshape en conséquense pour stoquer dans value4D
-        if(listVariable2(n)%nbdim.eq.3) then
-          allocate(Value4Du(120, 65, 1, 1))
-          Value3D=reshape(ValueVar, (/120,65,1/))
-          Value4Du(:,:,1,:)=Value3D(:,:,:)
-        else
-          allocate(Value4Du(120, 65, listVariable2(n)%dimSize(3), 1))
-          Value4Du=reshape(ValueVar, (/120,65,listVariable2(n)%dimSize(3),1/))
-        endif
-        deallocate(ValueVar)
-
-        !storage albq like reference variable for other
-        if(varName.eq."albq") then
-          Value4Dalbq=Value4Du
-        endif
-
-        !open also the next variable if it's a vector type
-        if (listVariable2(n)%itype.eq.2) then
-          varName=listVariable2(n+1)%name
-          listVariable2(n+1)%dimStart(listVariable2(n+1)%nbdim)=t
-          listVariable2(n+1)%dimSize(listVariable2(n+1)%nbdim)=1
-          allocate(ValueVar(product(listVariable2(n+1)%dimSize)))
-          call check(nf90_get_var(intputID, listVariable2(n+1)%netcdfId, ValueVar, start = listVariable2(n+1)%dimStart, count = listVariable2(n+1)%dimSize))
-
-          if(listVariable2(n+1)%nbdim.eq.3) then
-            allocate(Value4Dv(120, 65, 1, 1))
-            Value3D=reshape(ValueVar, (/120,65,1/))
-            Value4Dv(:,:,1,:)=Value3D(:,:,:)
-          else
-            allocate(Value4Dv(120, 65, listVariable2(n)%dimSize(3), 1))
-            Value4Dv=reshape(ValueVar, (/120,65,listVariable2(n)%dimSize(3),1/))
-          endif
-          deallocate(ValueVar)
-        endif
-
-        !chaque profondeur est traité indépendament
-        do k=1, size(Value4Du,3)
-
-          !si pas assez de glace met à zero et verifie les valeurs undef
-          do i=1,120
-            do j=1,65
-              if(Valueh(i,j).lt.-0.9e+32) then
-                Value4Du(i,j,k,1)=spv
-                if(allocated(Value4Dv)) Value4Dv(i,j,k,1)=spv
-              elseif(Value4Dalbq(i,j,1,1).lt.0.05) then !! si pas assez glace on met à zero
-                if( (varName.eq."hice").or.(varName.eq."hicp").or.(varName.eq."hsn").or.(varName.eq."snow").or.(varName.eq."tice").or.(varName.eq."uice").or.(varName.eq."vice") ) then
-                  Value4Du(i,j,k,1)=0.0
-                  if(allocated(Value4Dv)) Value4Dv(i,j,k,1)=0.0
-                endif
-              endif
-            enddo
-          enddo
-
-          wdata3D(:,:,1)=Value4Du(:,:,k,1)
-          wdata3D(121,:,1)=Value4Du(1,:,k,1)
-          wdata3D(122,:,1)=Value4Du(2,:,k,1)
-          if(allocated(Value4Dv)) then
-            wdata3D(:,:,2)=Value4Dv(:,:,k,1)
-            wdata3D(121,:,2)=Value4Dv(1,:,k,1)
-            wdata3D(122,:,2)=Value4Dv(2,:,k,1)
-          else
-            wdata3D(:,:,2)=0.0
-          endif
-
-
-          !cyclic correspondance
-          do j=2,jeq
-            wdata3D(1,j,:) = wdata3D(imax-1,j,:) !1<-121 (grille 120 65)
-            wdata3D(imax,j,:) = wdata3D(2,j,:)
-            do ii=ibera-5,ibera+5
-              wdata3D(ii,jmax,:) = spv
-            enddo
-            do ii=iberp-5,iberp+5
-              wdata3D(ii,jsepar,:) = spv
-            enddo
-          enddo
-
-
-          !
-          ! Interpolation
-          !
-          if (listVariable2(n)%itype.eq.2) then
-            do i=1,imax
-              do j=1,jmax
-                wdatx(i,j)=wdata3D(i,j,1) !composante 1 vecteur
-                wdaty(i,j)=wdata3D(i,j,2) !composante 2 vecteur
-              enddo
-            enddo
-            call mercatv(ttlon,ttlat,wdatx,wdaty,valgu,valgv) 
-            do i=1,imtt
-              do j=1,jmtt
-                wdatai3D(i,j,1)=valgu(i,j)
-                wdatai3D(i,j,2)=valgv(i,j)
-              enddo
-            enddo
-
-            !Put interpolate data in output file
-            if(listVariable2(n)%nbdim.eq.3) then
-              call check(nf90_put_var(outputID, listVariable2(n)%OutnetcdfId, wdatai3D(:,:,1), (/1,1,t/),  (/imtt,jmtt,1/)))
-              call check(nf90_put_var(outputID, listVariable2(n+1)%OutnetcdfId, wdatai3D(:,:,2), (/1,1,t/),  (/imtt,jmtt,1/)))
-            else
-              call check(nf90_put_var(outputID, listVariable2(n)%OutnetcdfId, wdatai3D(:,:,1), (/1,1,k,t/),  (/imtt,jmtt,1,1/)))
-              call check(nf90_put_var(outputID, listVariable2(n+1)%OutnetcdfId, wdatai3D(:,:,2), (/1,1,k,t/),  (/imtt,jmtt,1,1/)))
-            endif
-          else
-            call mercat(ttlon,ttlat)
-            !Put interpolate data in output file
-            if(listVariable2(n)%nbdim.eq.3) then
-              call check(nf90_put_var(outputID, listVariable2(n)%OutnetcdfId, wdatai3D(:,:,1), (/1,1,t/),  (/imtt,jmtt,1/)))
-            else
-              call check(nf90_put_var(outputID, listVariable2(n)%OutnetcdfId, wdatai3D(:,:,1), (/1,1,k,t/),  (/imtt,jmtt,1,1/)))
-            endif
-          endif
-
-
-
-        enddo
-        deallocate(Value4Du)
-        if(allocated(Value4Dv)) deallocate(Value4Dv)
-      endif
-      if (listVariable2(n)%itype.eq.2) then
-        n=n+2
-      else
-        n=n+1
-      endif
-    enddo
-    write(*,*)
-  enddo
-
-
-  !close output file
-  call check(nf90_close(outputID))
-
-  write(*,*)'End of OceanGrideChange'
-  write(*,*)'--------------------------------------'
-end program OceanGrideChange
-
-subroutine mercat(ttlon,ttlat)
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !--INTERPOLATION OF SCALAR DATA PLACED AT THE CENTER OF THE
-  !--ELEMENTS OF A TWO RECTANGULAR GRID ONTO ONE GRID.
-  !--LONGITUDE-LATITUDE COORDINATES FOR BOTH GRIDS.
-  !--DATA ARE OUTPUTS OF THE PROGRAM OTI.
-  !--This subroutine is identical to mercat.f except for input and ouputs
-  !
-  !--M.A.Morales Maqueda, 11-IV-1994.
-  !--modified by H.GOOSSE 15-IV-1994
-  !--modified by H.GOOSSE + M.A.M. Maqueda 15-IV-1994
-  !--modified by H.GOOSSE 16-V-1994
-  !  modif : 14/10/94
-
-  !--(alpha,beta): (latitude,longitude) of the north pole of the new grid.
-  !
-  USE bloc_commun
-
-  integer, parameter :: nsmax = 2
-  integer :: jm, i, j
-
-  real*4 :: ttlon(imtt)
-  real*4 :: ttlat(jmtt)
-
-  integer :: gxw, iwp, jwp, nprt
-  real*4 ::  xaj1, yai1, dxaj, dyai, dxw, dyw, xxx, yyy, du, dd, dr, dl
-  real*4 :: dsxw, dsyw, dcxw, dcyw, dxa, dya, nn0, nn1, xw, yw, rd, ru, rr, rl, unsdtx, unsdty
-  real*4 :: gwlon(0:imax), galat(0:imax)
-  real*4 :: gwlat(0:jmax+1), galon(0:jmax+1)
-  real*4 :: valad, valcd, valau, valc, valcu, valcl, valcr
-  real*4 :: val(0:imax,0:jmax+1)
-  real*4 :: whigri(imtt,jmtt)
-
-
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-  1001  format(A32,1x,E13.6,1x,I6,1x,I6,1x,I6,1x,I6)
-  1000  format(A30,1x,E13.6,1x,I6,1x,I6,1x,I6,1x,I6)
-  1111  format(3(F7.2,1X,F7.3,1X),I3,A)
-
-  jm=jmax
-
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !  3 ) definition de la nouvelle grille .                              |
-  !-----------------------------------------------------------------------
-
-  !-----
-  !--DEFINE INTERPOLATING GRID WW.
-  !
-  !     call gridtt(ttlon,ttlat,imtt,jmtt)
-
-  !--DEFINE ORIGINAL GRIDS.
-  !----
-  xaj1 =  90. + yj1
-  yai1 =  90. + beta + untour - xi1
-  dxaj = dyj
-  dyai = -dxi
-  do i=0,imax
-    gwlon(i) = xi1 + dxi * DFLOAT(i-1)
-    galat(i) = 90. + beta + untour - gwlon(i)
-  enddo
-  do j=0,jmax+1
-    gwlat(j) = yj1 + dyj * DFLOAT(j-1)
-    galon(j) = 90. + gwlat(j)
-  enddo
-
-  !        write(6,*) 'galon :'
-  !        write(6,'(20F6.1)') (galon(j),j=0,jmax+1)
-  !        write(6,*) 'galat :'
-  !        write(6,'(20F6.1)') (galat(i),i=0,imax)
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-  !--COOMPUTE DE CORRESPONDANCE BETWEEN GRIDS
-
-  call choiceg(ttlat,ttlon,imtt,jmtt,whigri)
-
-  !       open (15,file='choiceg.dat')
-  !       do 350 j=1,jmtt
-  ! !       write(15,'(122(F8.3))') (whigri(i,j),i=1,imtt)
-  !         write(15,'(122(i1))') (int(whigri(i,j)),i=1,imtt)
-  !  350  continue
-  !       close (15)
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !  4 ) Traitement de la nouvelle grille colonne par colonne .          |
-  !-----------------------------------------------------------------------
-
-  !--MAIN DO-LOOP.
-
-  do j=1,jmtt
-    do i=1,imtt
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !--debut du traitement de la colonne (i,j) :
-      if (whigri(i,j).eq.1.) then
-        dxw = ttlon(i)
-        dyw = ttlat(j)
-        gxw = xi1 + mod(dxw-xi1+untour, untour)
-        xxx = ( gxw - xi1 ) / dxi + 0.5
-        iwp = nint(xxx) 
-        iwp = max(0,min(imax-1,iwp))
-        dr = gwlon(iwp+1) - gxw
-        dl = gxw - gwlon(iwp)
-        yyy = ( dyw - yj1 ) / dyj + 0.5
-        jwp = nint(yyy) 
-        jwp = max(1,min(jmax,jwp))
-        du = gwlat(jwp+1) - dyw
-        dd = dyw - gwlat(jwp)
-      else
-        !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-        yw   = ttlat(j)
-        dyw  = yw*radian
-        dsyw = sin(dyw)
-        dcyw = cos(dyw)
-        xw   = mod(ttlon(i)-beta, untour)
-        dxw  = xw*radian
-        dsxw = sin(dxw)
-        dcxw = cos(dxw)
-        !--COMPUTE COORDINATES ON THE SS GRID OF A POINT OF THE AA GRID.
-        dya = asin(dcyw*dcxw) * degre
-        dxa = atan2(dcyw*dsxw,-dsyw) * degre
-        dxa = mod(dxa+untour, untour)
-        !---
-        yyy = ( dxa - xaj1 ) / dxaj + 0.5
-        jwp = nint(yyy) 
-        jwp = max(0,min(jmax,jwp))
-        du = galon(jwp+1) - dxa
-        dd = dxa - galon(jwp)
-        xxx = ( dya - yai1 ) / dyai + 0.5
-        iwp = nint(xxx) 
-        iwp = max(0,min(imax-1,iwp))
-        dr = galat(iwp+1) - dya
-        dl = dya - galat(iwp)
-
-      endif
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-      !--Pour verification :
-      !        goto 550
-      nn0=999999.99
-      nn1=999999.99
-      if (ttlon(i).ge.369. .or. ttlon(i).le.-1. ) then
-        nprt = nprt + 1
-        if (nprt.ge.nn0 .and.  nprt.le.nn1 ) then
-          write(99,*) 'nprt, whigri(i,j) :', nprt, whigri(i,j)
-          write(99,*) 'i,j, iwp, jwp :'
-          write(99,*)  i,j, iwp, jwp
-          write(99,*) 'dl, dr, dd, du :'
-          write(99,*)  dl, dr, dd, du
-          if ( whigri(i,j).eq.1.0d0) then
-            write(99,*) 'dxw, dyw :'
-            write(99,*)  dxw, dyw
-          else
-            write(99,*) 'dxa, dya :'
-            write(99,*)  dxa, dya 
-          endif
-          !            write(99,*) ' ttlon, ttlat :', ttlon(i), ttlat(j)
-          !            write(99,*) ' gwlon, gwlat :', gwlon(iwp), gwlat(jwp)
-          !            write(99,*) ' galon, galat :', galon(jwp), galat(iwp)
-        endif
-      endif
-
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !   5 ) Interpolation a partir des 4 voisins iwp/iwp+1,jwp/jwp+1 .     |
-      !-----------------------------------------------------------------------
-
-      !--POINT (i,j). A POINT IS CONSIDERED TO BE A LAND POINT 
-      !--IF THE NEAREST DATA POINT IS A LAND POINT.
-
-      unsdtx = 1.0 / (dl + dr)
-      rl = dl * unsdtx
-      rr = dr * unsdtx
-      unsdty = 1.0 / (dd + du)
-      rd = dd * unsdty
-      ru = du * unsdty
-
-      !--debut du traitement du point (i,j) :
-      valcl = wdata3D(iwp,jwp,1)
-      valcr = wdata3D(iwp+1,jwp,1)
-      !if (valcl.eq.spv) then
-      if ((valcl.gt.spvMin).and.(valcl.lt.spvMax).or.(valcl.eq.0.0)) then
-        if (rl.le.0.5) then
-          valad = valcl
-        else
-          valad = valcr
-          valcd = valcr
-        endif
-      else
-        if ((valcr.gt.spvMin).and.(valcr.lt.spvMax).or.(valcr.eq.0.0)) then
-          !if (valcr.eq.spv) then
-          if (rr.le.0.5) then
-            valad = valcr
-          else
-            valad = valcl
-            valcd = valcl
-          endif
-        else
-          valad = valcl * rr + valcr * rl
-          valcd = valad
-        endif
-      endif
-
-      valcl = wdata3D(iwp,jwp+1,1)
-      valcr = wdata3D(iwp+1,jwp+1,1)
-      !if (valcl.eq.spv) then
-      if ((valcl.gt.spvMin).and.(valcl.lt.spvMax).or.(valcl.eq.0.0)) then
-        if (rl.le.0.5) then
-          valau = valcl
-        else
-          valau = valcr
-          valcu = valcr
-        endif
-      else
-        if ((valcr.gt.spvMin).and.(valcr.lt.spvMax).or.(valcr.eq.0.0)) then
-          !if (valcr.eq.spv) then
-          if (rr.le.0.5) then
-            valau = valcr
-          else
-            valau = valcl
-            valcu = valcl
-          endif
-        else
-          valau = valcl * rr + valcr * rl
-          valcu = valau
-        endif
-      endif
-
-      if ((valad.gt.spvMin).and.(valad.lt.spvMax).or.(valad.eq.0.0)) then
-        !if (valad.eq.spv) then
-        if (rd.le.0.5) then
-          wdatai3D(i,j,1)  = spv
-        else
-          if ((valau.gt.spvMin).and.(valau.lt.spvMax).or.(valau.eq.0.0)) then
-            !if (valau.eq.spv) then
-            wdatai3D(i,j,1) = spv
-          else
-            valc        = valcu
-            wdatai3D(i,j,1) = valcu
-          endif
-        endif
-      else
-        if ((valau.gt.spvMin).and.(valau.lt.spvMax).or.(valau.eq.0.0)) then
-          !if (valau.eq.spv) then
-          if (ru.le.0.5) then
-            wdatai3D(i,j,1) = spv
-          else
-            valc        = valcd
-            wdatai3D(i,j,1) = valcd
-          endif
-        else
-          valc        = valcd * ru + valcu * rd
-          wdatai3D(i,j,1) = valc
-        endif
-      endif
-
-
-      !--Pour verification : 
-      nn0=999999.99
-      nn1=999999.99
-      if (ttlon(i).ge.369. .or. ttlon(i).le.-1. ) then
-        if (nprt.ge.nn0 .and.  nprt.le.nn1 ) then
-          write(99,*) 'val(i,i+1,/j,j+1) ='
-          write(99,'(4F10.4)') val(iwp,jwp), val(iwp+1,jwp), val(iwp,jwp+1), val(iwp+1,jwp+1)
-          !            write(99,*) 'vala(i,j,1) =', vala(i,j,1)
-          write(99,*) 'wdatai3D(i,j,1) =', wdatai3D(i,j,1)
-        endif
-      endif
-
-    enddo
-  enddo
-
-  return
-
-end
-
-subroutine gridtt(ttlon,ttlat,imtt,jmtt)
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !
-  !--DEFINE INTERPOLATING GRID TT.
-  !--LATITUDES AND LONGITUDES CORRESPOND TO THE CENTERS OF THE GRID ELEMENTS.
-  !
-  implicit double precision (a-h,o-z)
-  !
-  integer :: imtt, jmtt,i, j
-  real*4 :: xlong1, delx, dely
-  real*4 :: ttlon(imtt),ttlat(jmtt)
-  !     xlong1 = 23
-  xlong1 = 0.0
-  delx=360.0/real(imtt)
-  dely=180.0/real(jmtt)
-  do i=1,imtt
-    !       ttlon(i)=xlong1+real(i-1)*delx+0.5*delx
-    ttlon(i)=xlong1+real(i-1)*delx
-    ttlon(i)=mod(ttlon(i),360.0d0)
-  enddo
-  do j=1,jmtt
-    ttlat(j)=-90.+real(j-1)*dely+0.5*dely
-  enddo
-  return
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-end
-
-subroutine choiceg(ttlat,ttlong,imtt,jmtt,whigri)
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !
-  !               THIS ROUTINE DETERMINE AT WHICH ORIGINAL GRID (AA OR WW)
-  !               EACH POINT OF TT CORRESPOND.
-  !
-  implicit double precision (a-h,o-z)
-  !
-  integer :: imtt, jmtt, i,j
-  real*4 :: whigri(imtt,jmtt)
-  real*4 :: ttlat(jmtt),ttlong(imtt)
-  real*4 :: xoncri
-  !     
-  !     write(6,*) 'begining of choiceg'
-  do i=1,imtt
-    do j=1,jmtt
-      whigri(i,j)=1.
-    enddo
-  enddo
-  !
-  !     write(6,*) 'after 10'
-  do i=1,imtt
-    do j=1,jmtt
-      if (ttlat(j).gt.0.0.and.ttlat(j).le.8.0) then
-        if ((ttlong(i).ge.290.).or.(ttlong(i).lt.30.)) then
-          whigri(i,j)=2.
-          !             write(10,*) ttlat(j),ttlong(i)
-        endif
-      endif
-      if ((ttlat(j).gt.8.).and.(ttlat(j).le.10.)) then
-        xoncri=281.+(ttlat(j)-8.)/(10.-8.)*(276.-281.)
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.30.) whigri(i,j)=2.
-      endif
-      if ((ttlat(j).gt.10.).and.(ttlat(j).le.15.)) then
-        xoncri=276.+(ttlat(j)-10.)/(15.-10.)*(270.-276.)
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.30.) whigri(i,j)=2.
-      endif
-      if ((ttlat(j).gt.15.).and.(ttlat(j).le.20.)) then
-        xoncri=270.+(ttlat(j)-15.)/(20.-15.)*(260.-270.)
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.30) whigri(i,j)=2.
-      endif
-      if ((ttlat(j).gt.20.).and.(ttlat(j).le.30.)) then
-        xoncri=260.+(ttlat(j)-20.)/(30.-20.)*(260.-260.)
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.30.) whigri(i,j)=2.
-      endif
-      if ((ttlat(j).gt.30.).and.(ttlat(j).le.68.)) then
-        xoncri=260.+(ttlat(j)-30.)/(65.-30.)*(260.-260.)
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.50.) whigri(i,j)=2.
-      endif
-      if ((ttlat(j).gt.67.).and.(ttlat(j).le.90.)) then
-        xoncri=0
-        if (ttlong(i).ge.xoncri.or.ttlong(i).lt.360.) whigri(i,j)=2.
-      endif
-      !
-    enddo
-  enddo
-  !
-  !     write(6,*) 'end of choiceg'
-  return
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-end
-  !
-subroutine mercatv(ttlon,ttlat,wdatx,wdaty,valgu,valgv)
-  !
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !--INTERPOLATION OF SCALAR DATA PLACED AT THE CENTER OF THE
-  !--ELEMENTS OF A TWO RECTANGULAR GRID ONTO ONE GRID.
-  !--LONGITUDE-LATITUDE COORDINATES FOR BOTH GRIDS.
-  !--DATA ARE OUTPUTS OF THE PROGRAM OTI.
-  !
-  !--M.A.Morales Maqueda, 11-IV-1994.
-  !--modified by H.GOOSSE 15-IV-1994
-  !--modified by H.GOOSSE + M.A.M. Maqueda 15-IV-1994
-  !--modified by H.GOOSSE 16-V-1994
-  !--modified by JMC 19/09/95, adapted for vector, (derived from "provect").
-  !  modif : 21/09/95
-
-  !--(alpha,beta): (latitude,longitude) of the north pole of the new grid.
-  !
-  USE bloc_commun
-
-  integer, parameter :: nsmax = 2
-
-  real*4 :: ttlon(imtt)
-  real*4 :: ttlat(jmtt)
-
-  real*4 :: galat(0:imax), gwlon(0:imax)
-  real*4 :: gwlat(0:imax), galon(0:jmax+1)
-  real*4 :: cxw(0:imax), sxw(0:imax), cyw(0:jmax+1), syw(0:jmax+1)
-  real*4 :: cya(0:imax), sya(0:imax), cxa(0:jmax+1), sxa(0:jmax+1)
-
-  real*4 :: wdatx(imax,jmax), wdaty(imax,jmax)
-  real*4 :: valx(0:imax,0:jmax+1), valy(0:imax,0:jmax+1), valz(0:imax,0:jmax+1)
-
-  real*4 :: valgu(imtt,jmtt), valgv(imtt,jmtt)
-  real*4 :: cxt(imtt), sxt(imtt)
-  real*4 :: cyt(jmtt), syt(jmtt)
-  real*4 :: whigri(imtt,jmtt)
-
-  integer :: im, jm, i, j, gxw, iwp, jwp, nprt, nncrv
-  real*4 ::  xaj1, yai1, dxaj, dyai, dxw, dyw, xxx, yyy, du, dd, dr, dl, unsdtx, unsdty, valdw, valxd, valzd, valup, valxu, valyu, valyd, valzu
-  real*4 :: dxa, dya, nn0, nn1, rd, ru, rr, rl, ylim, ylim1, ylim2, valg, vvx, vvy, vvz
-
-
-
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-  1001 format(A32,1x,E13.6,1x,I6,1x,I6,1x,I6,1x,I6)
-  1000 format(A30,1x,E13.6,1x,I6,1x,I6,1x,I6,1x,I6)
-  1111 format(3(F7.2,1X,F7.3,1X),I3,A)
-
-  !--READ DATA.
-  im=imax
-  jm=jmax
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-  !--Initialisation :
-  do j=0,jmax+1
-    do i=0,imax
-      !        valu(i,j) = spv
-      !        valv(i,j) = spv
-      valx(i,j) = 0.
-      valy(i,j) = 0.
-      valz(i,j) = 0.
-    enddo
-  enddo
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !  3 ) definition de la nouvelle grille .                              |
-  !-----------------------------------------------------------------------
-
-  !-----
-  !--DEFINE INTERPOLATING GRID WW.
-  !
-  call gridtt(ttlon,ttlat,imtt,jmtt)
-  do i=1,imtt
-    cxt(i) = cos(radian*(ttlon(i)-beta))
-    sxt(i) = sin(radian*(ttlon(i)-beta))
-  enddo
-  do j=1,jmtt
-    cyt(j) = cos(radian*ttlat(j))
-    syt(j) = sin(radian*ttlat(j))
-  enddo
-
-  !--DEFINE ORIGINAL GRIDS.
-  !----
-  !     xi1=xlon1
-  !     dxi=dlong
-  !     yj1=ylat1
-  !     dyj=dlat
-
-  xaj1 =  90. + yj1
-  yai1 =  90. + beta + untour - xi1
-  dxaj = dyj
-  dyai = -dxi
-  do i=0,imax
-    gwlon(i) = xi1 + dxi * DFLOAT(i-1)
-    galat(i) = 90. + beta + untour - gwlon(i)
-    cxw(i) = cos(radian*(gwlon(i)-beta))
-    sxw(i) = sin(radian*(gwlon(i)-beta))
-    cya(i) = cos(radian*galat(i))
-    sya(i) = sin(radian*galat(i))
-  enddo
-  do j=0,jmax+1
-    gwlat(j) = yj1 + dyj * DFLOAT(j-1)
-    galon(j) = 90. + gwlat(j)
-    cyw(j) = cos(radian*gwlat(j))
-    syw(j) = sin(radian*gwlat(j))
-    cxa(j) = cos(radian*galon(j))
-    sxa(j) = sin(radian*galon(j))
-  enddo
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-  !--COOMPUTE DE CORRESPONDANCE BETWEEN GRIDS
-
-  call choiceg(ttlat,ttlon,imtt,jmtt,whigri)
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !--calcul des 3 composantes dans le repere fixe .
-
-  ylim1 = 69.0
-  ylim2 = 294.0
-  !- critere d'apartenace a Grille AA : y > min[ 69., max(0., 294. - x) ]
-  do j=1,jm
-    do i=1,im
-      ylim = min(ylim1, max(zero, ylim2-gwlon(i)) )
-      if (gwlat(j).le.ylim) then
-        !- WW :
-        valx(i,j) = -sxw(i)*wdatx(i,j)-syw(j)*cxw(i)*wdaty(i,j)
-        valy(i,j) =  cxw(i)*wdatx(i,j)-syw(j)*sxw(i)*wdaty(i,j)
-        valz(i,j) =  cyw(j)*wdaty(i,j)
-
-      else
-        !- AA :
-        valz(i,j) =  sxa(j)*wdaty(i,j)-sya(i)*cxa(j)*wdatx(i,j)
-        valy(i,j) =  cxa(j)*wdaty(i,j)+sya(i)*sxa(j)*wdatx(i,j)
-        valx(i,j) = -cya(i)*wdatx(i,j)
-      endif
-    enddo
-  enddo
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-  !  4 ) Traitement de la nouvelle grille colonne par colonne .          |
-  !-----------------------------------------------------------------------
-
-  !--MAIN DO-LOOP.
-
-  do j=1,jmtt
-    do i=1,imtt
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !--debut du traitement de la colonne (i,j) :
-      if (whigri(i,j).eq.1.) then
-        dxw = ttlon(i)
-        dyw = ttlat(j)
-        gxw = xi1 + mod(dxw-xi1+untour, untour)
-        xxx = ( gxw - xi1 ) / dxi + 0.5
-        iwp = nint(xxx)
-        iwp = max(0,min(imax-1,iwp))
-        dr = gwlon(iwp+1) - gxw
-        dl = gxw - gwlon(iwp)
-        yyy = ( dyw - yj1 ) / dyj + 0.5
-        jwp = nint(yyy)
-        jwp = max(0,min(jmax,jwp))
-        du = gwlat(jwp+1) - dyw
-        dd = dyw - gwlat(jwp)
-      else
-        !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-        !--COMPUTE COORDINATES ON THE SS GRID OF A POINT OF THE AA GRID.
-        dya = asin(cyt(j)*cxt(i)) * degre
-        dxa = atan2(cyt(j)*sxt(i),-syt(j)) * degre
-        dxa = mod(dxa+untour, untour)
-        !---
-        yyy = ( dxa - xaj1 ) / dxaj + 0.5
-        jwp = nint(yyy)
-        jwp = max(0,min(jmax,jwp))
-        du = galon(jwp+1) - dxa
-        dd = dxa - galon(jwp)
-        xxx = ( dya - yai1 ) / dyai + 0.5
-        iwp = nint(xxx)
-        iwp = max(0,min(imax-1,iwp))
-        dr = galat(iwp+1) - dya
-        dl = dya - galat(iwp)
-
-      endif
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-
-      !--Pour verification :
-      !        goto 550
-      nn0=999999.99
-      nn1=999999.99
-      if (ttlon(i).ge.369. .or. ttlon(i).le.-1. ) then
-        nprt = nprt + 1
-        if (nprt.ge.nn0 .and.  nprt.le.nn1 ) then
-          write(99,*) 'nprt, whigri(i,j) :', nprt, whigri(i,j)
-          write(99,*) 'i,j, iwp, jwp :'
-          write(99,*)  i,j, iwp, jwp
-          write(99,*) 'dl, dr, dd, du :'
-          write(99,*)  dl, dr, dd, du
-          if ( whigri(i,j).eq.1.0d0) then
-            write(99,*) 'dxw, dyw :'
-            write(99,*)  dxw, dyw
-          else
-            write(99,*) 'dxa, dya :'
-            write(99,*)  dxa, dya
-          endif
-          !            write(99,*) ' ttlon, ttlat :', ttlon(i), ttlat(j)
-          !            write(99,*) ' gwlon, gwlat :', gwlon(iwp), gwlat(jwp)
-          !            write(99,*) ' galon, galat :', galon(jwp), galat(iwp)
-        endif
-      endif
-
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !   5 ) Interpolation a partir des 4 voisins iwp/iwp+1,jwp/jwp+1 .     |
-      !-----------------------------------------------------------------------
-
-      !--POINT (i,j). A POINT IS CONSIDERED TO BE A LAND POINT
-      !--IF THE NEAREST DATA POINT IS A LAND POINT.
-
-      unsdtx = 1.0 / (dl + dr)
-      rl = dl * unsdtx
-      rr = dr * unsdtx
-      unsdty = 1.0 / (dd + du)
-      rd = dd * unsdty
-      ru = du * unsdty
-
-      !--debut du traitement du point (i,j,k) :
-
-      if ((wdatx(iwp,jwp).gt.spvMin).and.(wdatx(iwp,jwp).lt.spvMax).or.(wdatx(iwp,jwp).eq.0.0)) then
-        !if (wdatx(iwp,jwp).eq.spv) then
-        if (rl.le.separ) then
-          valdw = spv
-        else
-          valdw = wdatx(iwp+1,jwp)
-          valxd = valx(iwp+1,jwp)
-          valyd = valy(iwp+1,jwp)
-          valzd = valz(iwp+1,jwp)
-        endif
-      else
-        if ((wdatx(iwp+1,jwp).gt.spvMin).and.(wdatx(iwp+1,jwp).lt.spvMax).or.(wdatx(iwp+1,jwp).eq.0.0)) then
-          !if (wdatx(iwp+1,jwp).eq.spv) then
-          if (rr.le.separ) then
-            valdw = spv
-          else
-            valdw = wdatx(iwp,jwp)
-            valxd = valx(iwp,jwp)
-            valyd = valy(iwp,jwp)
-            valzd = valz(iwp,jwp)
-          endif
-        else
-          valdw = rr*wdatx(iwp,jwp)+rl*wdatx(iwp+1,jwp)
-          valxd = rr*valx(iwp,jwp) + rl*valx(iwp+1,jwp)
-          valyd = rr*valy(iwp,jwp) + rl*valy(iwp+1,jwp)
-          valzd = rr*valz(iwp,jwp) + rl*valz(iwp+1,jwp)
-        endif
-      endif
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !
-      if ((wdatx(iwp,jwp+1).gt.spvMin).and.(wdatx(iwp,jwp+1).lt.spvMax).or.(wdatx(iwp,jwp+1).eq.0.0)) then
-        !if (wdatx(iwp,jwp+1).eq.spv) then
-        if (rl.le.separ) then
-          valup = spv
-        else
-          valup = wdatx(iwp+1,jwp+1)
-          valxu = valx(iwp+1,jwp+1)
-          valyu = valy(iwp+1,jwp+1)
-          valzu = valz(iwp+1,jwp+1)
-        endif
-      else
-        if ((wdatx(iwp+1,jwp+1).gt.spvMin).and.(wdatx(iwp+1,jwp+1).lt.spvMax).or.(wdatx(iwp+1,jwp+1).eq.0.0)) then
-          !if (wdatx(iwp+1,jwp+1).eq.spv) then
-          if (rr.le.separ) then
-            valup = spv
-          else
-            valup = wdatx(iwp,jwp+1)
-            valxu = valx(iwp,jwp+1)
-            valyu = valy(iwp,jwp+1)
-            valzu = valz(iwp,jwp+1)
-          endif
-        else
-          valup = rr*wdatx(iwp,jwp+1)+rl*wdatx(iwp+1,jwp+1)
-          valxu = rr*valx(iwp,jwp+1) + rl*valx(iwp+1,jwp+1)
-          valyu = rr*valy(iwp,jwp+1) + rl*valy(iwp+1,jwp+1)
-          valzu = rr*valz(iwp,jwp+1) + rl*valz(iwp+1,jwp+1)
-        endif
-      endif
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      !
-      if ((valdw.gt.spvMin).and.(valdw.lt.spvMax).or.(valdw.eq.0.0)) then
-        !if (valdw.eq.spv) then
-        if (rd.le.separ) then
-          valg  = spv
-          valgu(i,j)  = spv
-          valgv(i,j)  = spv
-        else
-          if ((valup.gt.spvMin).and.(valup.lt.spvMax).or.(valup.eq.0.0)) then
-            !if (valup.eq.spv) then
-            valg  = spv
-            valgu(i,j)  = spv
-            valgv(i,j)  = spv
-          else
-            valg = valup
-            valgu(i,j) = -sxt(i)*valxu + cxt(i)*valyu
-            valgv(i,j) =  cyt(j)*valzu - syt(j) * ( cxt(i)*valxu + sxt(i)*valyu )
-            !               valgv(i,j,k) =  valzu / cyt(j)
-          endif
-        endif
-      else
-        !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-        if ((valup.gt.spvMin).and.(valup.lt.spvMax).or.(valup.eq.0.0)) then
-          !if (valup.eq.spv) then
-          if (ru.le.separ) then
-            valg  = spv
-            valgu(i,j)  = spv
-            valgv(i,j)  = spv
-          else
-            valg = valdw
-            valgu(i,j) = -sxt(i)*valxd + cxt(i)*valyd
-            valgv(i,j) =  cyt(j)*valzd - syt(j) * ( cxt(i)*valxd + sxt(i)*valyd )
-            !               valgv(i,j,k) =  valzd / cyt(j)
-          endif
-        else
-          valg  = rd*valup + ru*valdw
-          vvx = rd*valxu + ru*valxd
-          vvy = rd*valyu + ru*valyd
-          vvz = rd*valzu + ru*valzd
-          valgu(i,j) = -sxt(i)*vvx + cxt(i)*vvy
-          valgv(i,j) =  cyt(j)*vvz - syt(j) * ( cxt(i)*vvx + sxt(i)*vvy )
-          !               valgv(i,j,k) =  vvz / cyt(j)
-        endif
-      endif
-      !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-      nncrv=1
-      if (nncrv.eq.0) valgu(i,j) = valg
-
-      !         if (whigri(i,j).eq.2) write(6,*) valgu(i,j,k)
-      !--Pour verification :
-      if (ttlon(i).ge.369. .or. ttlon(i).le.-1. ) then
-        if (nprt.ge.nn0 .and.  nprt.le.nn1 ) then
-          !            write(99,*) 'valu(i,i+1,/j,j+1) ='
-          !            write(99,'(4F10.4)') valu(iwp,jwp,1), valu(iwp+1,jwp,1),
-          !    &                          valu(iwp,jwp+1,1), valu(iwp+1,jwp+1,1)
-          write(99,*) 'valgu(i,j) =', valgu(i,j)
-        endif
-      endif
-
-      !--fin du traitement de la colonne (i,j) .
-    enddo
-  enddo
-  !
-  return
-
-  !---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
-end

BIN
src/07_input.nc


+ 0 - 63
src/08_ChristmasTree.txt

@@ -1,63 +0,0 @@
-CHRISTMAS TREE
---------------
-
-The aim of this exercise is to work with loops (for or while) in order to draw in a terminal a Christmas tree with its balls:
-
-Height=10
-
-         #
-        ###
-       #o###
-      ##o####
-     #o#####o#
-    ####o#####o
-   #####o#####o#
-  ####o#####o####
- #o#####o#####o###
-##o#####o#####o####
-
-The program must be carried out in Fortran 90. It will take as argument the height of the tree which is a variable of the problem:
-
-Height=7
-
-      #
-     ###
-    #o###
-   ##o####
-  #o#####o#
- ####o#####o
-#####o#####o#
-
-This parameter must be supplied at the command line when the program (for example './tree 10'). 
-
-Balls must be positioned all 6 sharps as shown below:
-
-Height=7
-
-      1
-     234
-    5!123
-   45!1234
-  5!12345!1
- 2345!12345!
-12345!12345!1
-
-
-Usefull commands:
------------------
-
-Read a parameter in the program argument:
-call getarg (1, param)
-where param is a string of sufficient length to contain the value supplied as argument
-
-Convert a character string to integer or float:
-read (mychar, *) myinteger
-
-Write a character on the screen:
-write (*, '(A)') "#"
-
-Write a character on the screen without going back to the line:
-write (*, '(A)', advance = 'no') "#"
-
-Make a modulo:
-myModulo = mod (10,3)

+ 0 - 711
src/10_OLD.FOR

@@ -1,711 +0,0 @@
-C
-C******************************************************************************
-C
-C      VERSION FEVRIER 1986                                             TEQ00070
-C                                                                       TEQ00080
-C  LINKEE POUR LE VAX 3800 LE 10/10/89
-C
-      INTEGER TITRE(74),ESP(8),PIED(9),KART(80)                         TEQ00110
-      INTEGER DICO(215)                                                 TEQ00120
-      INTEGER JDIN(14),JNUAN(2)                                         TEQ00130
-      INTEGER TEQ0,TEQ1,TEQ2,TEQ3,TEQ4,TEQ5,TEQ6,TEQ7,TEQ8,TEQ9         TEQ00140
-      INTEGER TEQA,TEQB,TEQC,TEQD,TEQE,TEQF,TEQG,TEQH,TEQI,TEQJ,TEQK    TEQ00150
-      INTEGER TEQW,TEQZ,TEQL,TEQM                                       TEQ00160
-      INTEGER ITOUT(11)                                                 TEQ00170
-      INTEGER ILABEL(10)                                                TEQ00180
-C                                                                       TEQ00190
-C                                                                       TEQ00240
-      DIMENSION IBUF(1804),Z(500),LABEL(4,200)                          TEQ00250
-      DIMENSION LLOAD(32)                                               TEQ00260
-      COMMON /POTBIA/ WWWW(1500)                                        TEQ00280
-      COMMON /TITRES/ITITR(21,50)                                       TEQ00290
-      COMMON /UNIT/IUNIT(20)                                            TEQ00300
-      COMMON /RECORD/PLA33(173)                                         TEQ00310
-      COMMON /ESPION/ IESP,LLNOM,ILIST,INORD,NCREP                      TEQ00320
-      COMMON /DESSIN/ IBUF                                              TEQ00330
-      COMMON /OPTCD/ IFEET,ITEST,INUAN(2),IRAIDS                        TEQ00340
-      COMMON /MARQ/ PLA21(6000)                                         TEQ00350
-      COMMON /BUFFER/ PLA13(2400)                                       TEQ00360
-      COMMON /TECK/IC14,IC13,IECHW,INOM,IATA,IBART,IQUAL                TEQ00370
-      COMMON /PLACE/ KART,PLA1(9)                                       TEQ00380
-      COMMON E,N,X(500),Y(500),IX(4,500),PLA(6000)                      TEQ00390
-      COMMON /WORK/ IY(4,500),JBJ(2400)                                 TEQ00400
-      COMMON /CANAD/ KX(500),KY(500),PLA20(624) ,ICANAD(200)            TEQ00410
-C      DORBYL 6000---->300000                                           TEQ00420
-      COMMON /PER/ NPER,PLA2(6000)                                      TEQ00430
-      COMMON /IPERM/ NPERM,PLA3(1000)                                   TEQ00440
-      COMMON /DIVER/ ISUP,ILANG,IW28,PLA4(6),IDIN,KLAS(4),JPROJ         TEQ00450
-      COMMON /SORTI/ PLA6(80)                                           TEQ00460
-      COMMON /ENTREE/IPLA7(42)                                          TEQ00470
-      COMMON /SOMEL/ PLA8(2)                                            TEQ00480
-      COMMON /SUITW/ PLA10(8),MARG                                      TEQ00490
-      COMMON /GOUSD/ PLA11(6)                                           TEQ00500
-      COMMON /CARTO/ ICAS,XCAR(3,8),TITRE                               TEQ00510
-      COMMON /DORBYL/NSTUD,ISTUD(2000)                                  TEQ00520
-      COMMON /DOUBL/NDUP,IRED1(2,80),IRED2(2,80),NDUPL(80),IOPD(80)     TEQ00530
-      COMMON /RAIDIS/NBRD(400)                                          TEQ00540
-      COMMON /REJCOM/LABEL,NLABEL                                       TEQ00550
-C                                                                       TEQ00560
-C                                                                       TEQ00570
-      EQUIVALENCE (PLA13(1101),Z(1))                                    TEQ00580
-      EQUIVALENCE (IUNIT(1),INPUT)                                      TEQ00590
-      EQUIVALENCE (IUNIT(3),IUNI3)                                      TEQ00600
-      EQUIVALENCE (IUNIT(6),IUNI6)                                      TEQ00610
-      EQUIVALENCE (IUNIT(7),IUNI7)                                      TEQ00620
-      EQUIVALENCE (IUNIT(13),IUNI13)                                    TEQ00630
-      EQUIVALENCE (IUNIT(17),IUNI17)                                    TEQ00640
-C                                                                       TEQ00650
-C                                                                       TEQ00730
-C==========================================================I            TEQ00740
-C  OVERLAY          6                 7             8      I            TEQ00750
-C==========================================================I            TEQ00760
-C  BARRES       TEQ1 DIMEN     TEQ3 BARRE     TEQ4 IMETA   I            TEQ00770
-C               TEQ5 TABAR                                 I            TEQ00780
-C==========================================================I            TEQ00790
-C  NOEUDS       TEQ1 DIMEN     TEQ2 TOPOL                  I            TEQ00800
-C                                   TOFF                   I            TEQ00810
-C==========================================================I            TEQ00820
-C  FLECHE       TEQ1 DIMEN                    TEQZ KFLCH   I            TEQ00830
-C==========================================================I            TEQ00840
-C  BOULON/STUDS TEQW BOUDEZ                                I            TEQ00850
-C               DUPLN STUDS                                I            TEQ00860
-C==========================================================I            TEQ00870
-C  MONTAGE      TEQ1 DIMEN     TEQ9 MONTA                  I            TEQ00880
-C  EPURE        TEQ1 DIMEN     TEQ8 EPURE                  I            TEQ00890
-C==========================================================I            TEQ00900
-C  ARCHI        TEQI ARCHI                                 I            TEQ00910
-C==========================================================I            TEQ00920
-C  DIVERS                                  TEQ0 AMETA      I            TEQ00930
-C                                          TREMY COTAT..   I            TEQ00940
-C==========================================================I            TEQ00950
-C  DETAIL        TEQ6 NABLA    TEQJ PROCU   TEQ7 PROCT     I            TEQ00960
-C==========================================================I            TEQ00970
-C  NOMENCLATURE  TEQ6 REWRX    TEQK CBOUL   TEQH MAYEN     I            TEQ00980
-C                     TEQTI    TBOUL BULET  TEQE MAYAN     I            TEQ00990
-C                                           TEQG BULON     I            TEQ01000
-C==========================================================I            TEQ01010
-C  GRUGE         TEQB GRUG4    TEQF TROUA   TEQM GRUG3/SED.I            TEQ01020
-C  FICHE         TEQC GRUGA    TEQD GRUF/2  TEQL DUPLI/GU  I            TEQ01030
-C==========================================================I            TEQ01040
-C                                                                       TEQ01050
-      DATA TEQ0/'TEQ0'/,TEQ1/'TEQ1'/,TEQ2/'TEQ2'/,TEQ3/'TEQ3'/          TEQ01060
-      DATA TEQ4/'TEQ4'/,TEQ5/'TEQ5'/,TEQ6/'TEQ6'/,TEQ7/'TEQ7'/          TEQ01070
-      DATA TEQ8/'TEQ8'/,TEQ9/'TEQ9'/,TEQA/'TEQA'/,TEQB/'TEQB'/          TEQ01080
-      DATA TEQC/'TEQC'/,TEQD/'TEQD'/,TEQE/'TEQE'/,TEQF/'TEQF'/          TEQ01090
-      DATA TEQG/'TEQG'/,TEQH/'TEQH'/,TEQI/'TEQI'/,TEQJ/'TEQJ'/          TEQ01100
-      DATA TEQK/'TEQK'/,TEQW/'TEQW'/,TEQZ/'TEQZ'/,TEQL/'TEQL'/          TEQ01110
-      DATA TEQM/'TEQM'/                                                 TEQ01120
-C                                                                       TEQ01130
-C    0 RIEN          1 NOEUDS/POTEAU    2 BARRE/EPURE/MONTAGE           TEQ01140
-C    3 DIVERS        4 ARCHI            5 DETAIL                        TEQ01150
-C    6 BOULON/GOUJON/OFF                                                TEQ01160
-C                                                                       TEQ01170
-      DATA LLOAD/1,1,2,8*3,0,0,3,4,2*2,3,5,3,0,3,1,6,6,0,7,4*0,6/       TEQ01180
-      DATA ESP/6,'E','S','P','I','O','N',0/                             TEQ01190
-      DATA PIED/4,'P','I','E','D',2,'C','M',0/                          TEQ01200
-      DATA JDIN/8,'D','I','N',' ','7','9','9','0',3,'E','D','F',0/      TEQ01210
-      DATA DICO/5,'N','O','E','U','D',4,'P','O','T','E',3,'B','A','R',4 TEQ01220
-     *,'T','R','E','M',3,'P','E','R', 3,'C','O','M',3,'C','O','T',3,'R',TEQ01230
-     *'E','P',4,'N','O','T','A',3,'A','X','E',4,'T','R','O','U',3,'F','ITEQ01240
-     *','N',5,'N','O','M','E','N',5,'C','O','N','T','O',5,'A','R','C','HTEQ01250
-     *','I',5,'E','P','U','R','E',5,'M','O','N','T','A',4,'A','J','O','UTEQ01260
-     *',6,'D','E','T','A','I','L',3,'A','R','C',4,'C','L','O','U',      TEQ01270
-     *4,'C','A','R','T',6,'F','L','E','C','H','E',8,'*','*','B','O','U',TEQ01280
-     *'L','O','N',4,'G','O','U','J',4,'T','E','S','T',5,'*','*','O','F',TEQ01290
-     &'F',4,'D','A','T','A',4,'N','O','R','D',                          TEQ01300
-     *9,'E','N','T','R','E',' ','A','X','E',6,'N','U','A','N','C','E',  TEQ01310
-     *11,'D','U','P','L','I','C','A','T','I','O','N',                   TEQ01320
-     *6,'C','L','A','S','S','E',7,'P','R','O','J','E','C','T',          TEQ01330
-     *5,'M','A','R','G','E',5,'S','T','A','R','T',5,'R','E','J','E','T',TEQ01340
-     *0/                                                                TEQ01350
-      DATA ITOUT /4,'T','O','U','T','OU',3,'A','L','L',0/               TEQ01360
-      DATA IBL/'    '/                                                  TEQ01370
-      DATA JNUAN/'E242','    '/                                         TEQ01380
-      DATA ILABEL/'DRAW','N BY',' TEQ','UILA',' SYS','TEM ','ALBI',     TEQ01390
-     *' 63.','42.0','7.55'/                                             TEQ01400
-C
-C      VAX                                                              TEQ01560
-C                                                                       TEQ01570
-      OPEN(FILE='AKJ7.KIR',UNIT=1,STATUS='OLD')
-C      DEFINE FILE 10(810,200,U,IC10)                                    TEQ01580
-      OPEN (FILE='CODEBAR.DAT',UNIT=10,RECL=400,FORM='UNFORMATTED',
-     * ACCESS='DIRECT',STATUS='OLD')
-C      DEFINE FILE 11(10000,346,U,IUUU)                                  TEQ01590
-C      DEFINE FILE 11(30000,346,U,IUUU)                                  TEQ01590
-      OPEN(UNIT=11,FILE='ZNOMEN.DAT',ACCESS='DIRECT',
-     * RECL=692,STATUS='OLD',FORM='UNFORMATTED')
-C      DEFINE FILE 12(400,1584,U,IC12)                                   TEQ01600
-      OPEN(UNIT=12,FILE='MAT.SOM',ACCESS='DIRECT',
-     * RECL=3168,STATUS='OLD',FORM='UNFORMATTED')
-C      DEFINE FILE 13(4000,52,U,IC13)                                    TEQ01610
-      OPEN(UNIT=13,FILE='ATA.SOM',ACCESS='DIRECT',
-     * RECL=104,STATUS='OLD',FORM='UNFORMATTED')
-C      DEFINE FILE 15(1100,1600,U,IC15)                                  TEQ01620
-      OPEN(UNIT=15,FILE='PRO.SOM',ACCESS='DIRECT',
-     * STATUS='OLD',FORM='UNFORMATTED',RECL=3200)
-C      DEFINE FILE 16(2000,40,U,IC16)                                    TEQ01630
-      OPEN (FILE='FER.SOM',UNIT=16,RECL=80,FORM='UNFORMATTED',
-     * ACCESS='DIRECT',STATUS='OLD')
-      DEFINE FILE 17(600,1240,U,IC17)                                   TEQ01640
-C      OPEN (FILE='RONDELLE.DAT',UNIT=17,RECL=2480,FORM='UNFORMATTED',
-C     * ACCESS='DIRECT',STATUS='OLD')
-                                                                        TEQ01650
- 2000 FORMAT(80A1)                                                      TEQ02300
- 3002 FORMAT(10X,80A1)                                                  TEQ02310
- 3000 FORMAT('1C8:  NOMBRE D UNITES TEQUILA ',I4,' NOEUDS',I4,' BARRES')TEQ02320
- 3001 FORMAT(' C9:',2F10.2,F10.6,2F10.2,'HORS DESSIN',F10.2,' TOTAL ',  TEQ02330
-     *F10.2)                                                            TEQ02340
-
-C      CALL DAREAD(IBUF,80,200,15)
-C      write(*,*) IBUF(1:80)
-C      write(*,*) "PEDRO"
-C                                                                       TEQ02350
-      DO 9999 I=1,20                                                    TEQ02360
-      IUNIT(I)=I                                                        TEQ02370
- 9999 CONTINUE                                                          TEQ02380
-      IESP=0                                                            TEQ02430
-      IQUAL=0                                                           TEQ02440
-      IARCH=0                                                           TEQ02450
-      ICAS=0                                                            TEQ02460
-      ISUP=0                                                            TEQ02470
-      INORD=0                                                           TEQ02480
-      IDIN=0                                                            TEQ02490
-      INTAX=0                                                           TEQ02500
-      IBART=2                                                           TEQ02510
-      IBUF(1)=3                                                         TEQ02520
-      ILANG=0                                                           TEQ02530
-      ITEST=0                                                           TEQ02540
-      MPER=0                                                            TEQ02550
-      IFEET=0                                                           TEQ02560
-      NSTUD=0                                                           TEQ02570
-      NPERM=0                                                           TEQ02580
-      IATA=1                                                            TEQ02590
-      JPROJ=0                                                           TEQ02600
-      KLAS(1)=0                                                         TEQ02610
-      MARG=0                                                            TEQ02620
-      NLABEL=0                                                          TEQ02630
-      INUAN(1)=JNUAN(1)                                                 TEQ02640
-      INUAN(2)=JNUAN(2)                                                 TEQ02650
-C                                                                       TEQ02660
-      ILIST=0                                                           TEQ02670
-      NDUP=0                                                            TEQ02680
-      CALL TAB(NBRD,1,400,0,0)                                          TEQ02690
-      IRAIDS=1                                                          TEQ02700
-      CALL OVLY(TEQ1,IRC)                                               TEQ02710
-      CALL OVLY(TEQ2,IRC)                                               TEQ02720
-      CALL OVLY(TEQZ,IRC)                                               TEQ02730
-C                                                                       TEQ02740
-C                                                                       TEQ02830
-      CALL IBENA(IBUF,270,IUNI7)                                        TEQ02840
-      CALL TAB(IBUF,301,1804,0,0)                                       TEQ02850
-      PO=60.                                                            TEQ02860
-      PA=0.                                                             TEQ02870
-      P2=0.0005                                                         TEQ02880
-      M=0                                                               TEQ02890
-      INOM=0                                                            TEQ02900
-      CALL PNUMA(0.,0.,M,-0.5,-0.5)                                     TEQ02910
-      CALL PCARA(-.1,1.8,0,ILABEL,                                      TEQ02920
-     *40,0.2,0.3,0.,1.)                                                 TEQ02930
-      IU17=-IUNI17                                                      TEQ02940
-      CALL DAWRIT(IBUF,2480,IC17,IU17)                                  TEQ02950
-C      write(*,*) INPUT, IUNIT(:)
-      CALL CARTOU                                                       TEQ02960
-CDH
-      DO I=1,7
-C         CALL DROOG2
-      END DO
-      CALL TAB(KX,1,500,0.,0)                                           TEQ02970
-      N=0                                                               TEQ02980
-      KLOAD=1                                                           TEQ02990
-    1 ILOAD=KLOAD                                                       TEQ03000
-      READ(INPUT,2000,END=115)KART                                      TEQ03010
-      WRITE(IUNI3,3002)KART                                             TEQ03030
-      KI=1                                                              TEQ03040
-      KF=80                                                             TEQ03050
-      CALL TEXTZ(KART,KI,80,ESP,JOB)                                    TEQ03060
-      IF(JOB    .EQ.0)GO TO  777                                        TEQ03070
-      IF(JOB.EQ.1)IESP=1                                                TEQ03080
-  777 CONTINUE                                                          TEQ03090
-      CALL TEXTZ(KART,KI,80,PIED,JOB)                                   TEQ03100
-      IF(JOB    .EQ.0)GO TO  1                                          TEQ03110
-      IF(JOB.LT.3)IFEET=JOB                                             TEQ03120
-      CALL TEXTZ(KART,KI,80,JDIN,KOD0)                                  TEQ03130
-      IF(KOD0.EQ.1)IDIN=1                                               TEQ03140
-      IF(KOD0.EQ.2)IDIN=2                                               TEQ03150
-      CALL TEXTZ(KART,KI,80,DICO,JOB)                                   TEQ03160
-      IF(JOB    .EQ.0)GO TO  1                                          TEQ03170
-C                                                                       TEQ03180
-C        1 NOEUD   2 POTEAU  3 BARRE                                    TEQ03190
-C        4 TREMY   5 PERCA   6 COMMENTAIRES                             TEQ03200
-C        7 COTAT   8 REPERAGE9 NOTA                                     TEQ03210
-C       10 AXE    11 TROU   12 FIN                                      TEQ03220
-C       13 NOMEN  14 CONTOUR15 ARCHI                                    TEQ03230
-C       16 EPURE  17 MONTA  18 AJOUTER                                  TEQ03240
-C       19 DETAIL 20 ARC    21 CLOU                                     TEQ03250
-C       22 CARTOU 23 FLECHE 24 **BOULON                                 TEQ03260
-C       25 GOUJON 26 TEST   27 **OFF                                    TEQ03270
-C       28 LISTER 29 NORD  30 ENTRE AXE                                 TEQ03280
-C       31 NUANCE 32 DUPLICATION                                        TEQ03290
-C       33 CLASSE 34 PROJET 35 MARGE                                    TEQ03300
-C       36 START  37 REJET                                              TEQ03310
-C                                                                       TEQ03320
-C      NOMBRE MAXI DE MOTS CLEFS                                        TEQ03330
-C                                                                       TEQ03340
-      IF(JOB.EQ.35)MARG=1                                               TEQ03350
-      IF(JOB.GT.37)GO TO 1                                              TEQ03360
-      KLOAD=LLOAD(JOB)                                                  TEQ03370
-      IF(JOB.LE.3)GO TO(2,14,3),JOB                                     TEQ03380
-      IF(JOB.EQ.12)GO TO 15                                             TEQ03390
-      IF(JOB.EQ.13)GO TO 16                                             TEQ03400
-      IF(JOB.EQ.15)GO TO 22                                             TEQ03410
-      IF(JOB.EQ.16)GO TO 18                                             TEQ03420
-      IF(JOB.EQ.17)GO TO 20                                             TEQ03430
-      IF(JOB.EQ.19)GO TO 109                                            TEQ03440
-      IF(JOB.EQ.21)GO TO 51                                             TEQ03450
-      IF(JOB.GE.23)GO TO 100                                            TEQ03460
-      CALL OVLY(TEQ0,IRC)                                               TEQ03470
-      CALL OVLY(TEQJ,IRC)                                               TEQ03480
-  100 CONTINUE                                                          TEQ03490
-      GO TO(2,14,3,4,5,6,7,8,9,12,13,15,16,17,22,18,19,21,109,19,51,52, TEQ03500
-     *53,54,55,56,57,58,59,60,61,62,63,64,1,66,37,1),JOB                TEQ03510
-   66 CALL LYS(KART,KI,80,R,IRAIDS,KOD)                                 TEQ03520
-      GO TO 1                                                           TEQ03530
-C                                                                       TEQ03540
-C      DUPLICATION                                                      TEQ03550
-C                                                                       TEQ03560
-   62 CALL OVLY(TEQW,IRC)                                               TEQ03570
-      CALL DUPLC(0)                                                     TEQ03580
-       GO TO 1                                                          TEQ03590
-   61 IF(KART(KI).NE.IBL)GO TO 161                                      TEQ03600
-      KI=KI+1                                                           TEQ03610
-      GO TO 61                                                          TEQ03620
-  161 CALL PACKN(INUAN,4,KART(KI),1,8)                                  TEQ03630
-      GO TO 1                                                           TEQ03640
-   60 INTAX=1                                                           TEQ03650
-      GO TO 1                                                           TEQ03660
-   59 CALL LYS(KART,KI,80,RR,INORD,KOD)                                 TEQ03670
-      IF(INORD.LT.0.OR.INORD.GT.4)INORD=0                               TEQ03680
-      GO TO 1                                                           TEQ03690
-   58 ILIST=1                                                           TEQ03700
-      CALL TEXTZ(KART,KI,80,ITOUT,KOD)                                  TEQ03710
-      IF(KOD.EQ.1)ILIST=2                                               TEQ03720
-      GO TO 1                                                           TEQ03730
-   63 DO 635 I=1,4                                                      TEQ03740
-      KLAS(I)=0                                                         TEQ03750
-      CALL LYS(KART,KI,80,RR,KLAS(I),KOD)                               TEQ03760
-      IF(KOD.EQ.3)KLAS(I)=RR                                            TEQ03770
-  635 CONTINUE                                                          TEQ03780
-      GO TO 1                                                           TEQ03790
-   64 JPROJ=1                                                           TEQ03800
-      GO TO 1                                                           TEQ03810
-C                                                                       TEQ03820
-C      NOEUD                                                            TEQ03830
-C                                                                       TEQ03840
-    2 CONTINUE                                                          TEQ03850
-      IF(KLOAD.EQ.0)KLOAD=ILOAD                                         TEQ03860
-      IF(ILOAD.NE.1)CALL OVLY(TEQ2,IRC)                                 TEQ03870
-      CALL OVLY(TEQZ,IRC)                                               TEQ03880
-      KENTRY=1                                                          TEQ03890
-      CALL TOPOL (KENTRY)                                               TEQ03900
-      GO TO 1                                                           TEQ03910
-C                                                                       TEQ03920
-C      POTEAU                                                           TEQ03930
-C                                                                       TEQ03940
-   14 CONTINUE                                                          TEQ03950
-      IF(ILOAD.GT.2)CALL OVLY(TEQ1,IRC)                                 TEQ03960
-      IF(ILOAD.NE.1)CALL OVLY(TEQ2,IRC)                                 TEQ03970
-      CALL OVLY(TEQZ,IRC)                                               TEQ03980
-      KENTRY=2                                                          TEQ03990
-      CALL TOPOL (KENTRY)                                               TEQ04000
-      GO TO 1                                                           TEQ04010
-C                                                                       TEQ04020
-C      FLECHE                                                           TEQ04030
-C                                                                       TEQ04040
-   53 CONTINUE                                                          TEQ04050
-      IF(ILOAD.GT.2)CALL OVLY(TEQ1,IRC)                                 TEQ04060
-      IF(ILOAD.NE.1)CALL OVLY(TEQ2,IRC)                                 TEQ04070
-      CALL OVLY(TEQZ,IRC)                                               TEQ04080
-      CALL KFLCH(0,N,X,Y,Z)                                             TEQ04090
-      GO TO 1                                                           TEQ04100
-C                                                                       TEQ04110
-C      **OFFSET (COMPATIBILITE KIR)                                     TEQ04120
-C                                                                       TEQ04130
-   57 CONTINUE                                                          TEQ04140
-      IF(ILOAD.NE.1)CALL OVLY(TEQ2,IRC)                                 TEQ04150
-      CALL OVLY(TEQZ,IRC)                                               TEQ04160
-      CALL TOFF                                                         TEQ04170
-      GO TO 1                                                           TEQ04180
-C                                                                       TEQ04190
-C      BARRE                                                            TEQ04200
-C                                                                       TEQ04210
-    3 CONTINUE                                                          TEQ04220
-      IF(ILOAD.GT.2)CALL OVLY(TEQ1,IRC)                                 TEQ04230
-      CALL OVLY(TEQ3,IRC)                                               TEQ04240
-      CALL OVLY(TEQ4,IRC)                                               TEQ04250
-      CALL BARRE                                                        TEQ04260
-      P1=0.38                                                           TEQ04270
-      P3=1.                                                             TEQ04280
-      KP=2                                                              TEQ04290
-      KMETR=1                                                           TEQ04300
-      CALL SISSY(1,IUNI13)                                              TEQ04310
-      CALL OVLY(TEQ5,IRC)                                               TEQ04320
-      KLOAD=8                                                           TEQ04330
-      CALL TABAR                                                        TEQ04340
-  555 CONTINUE                                                          TEQ04350
-      GO TO 1                                                           TEQ04360
-C                                                                       TEQ04370
-C      EPURE                                                            TEQ04380
-C                                                                       TEQ04390
-   18 CONTINUE                                                          TEQ04400
-      IF(ILOAD.GT.2)CALL OVLY(TEQ1,IRC)                                 TEQ04410
-      CALL OVLY(TEQ8,IRC)                                               TEQ04420
-      CALL EPURE                                                        TEQ04430
-      CALL SISSY(1,IUNI13)                                              TEQ04440
-      P1=0.38                                                           TEQ04450
-      P3=1.                                                             TEQ04460
-  107 KMETR=2                                                           TEQ04470
-      GO TO 555                                                         TEQ04480
-C                                                                       TEQ04490
-C      MONTAGE                                                          TEQ04500
-C                                                                       TEQ04510
-   20 CONTINUE                                                          TEQ04520
-      IF(ILOAD.GT.2)CALL OVLY(TEQ1,IRC)                                 TEQ04530
-      CALL OVLY(TEQ9,IRC)                                               TEQ04540
-      CALL MONTA                                                        TEQ04550
-      P1=0.22                                                           TEQ04560
-      CALL SISSY(1,IUNI13)                                              TEQ04570
-      KMETR=2                                                           TEQ04580
-      P2=0.                                                             TEQ04590
-      P3=0.65                                                           TEQ04600
-      GO TO 107                                                         TEQ04610
-C                                                                       TEQ04620
-C      DETAIL (PUNCH)                                                   TEQ04630
-C                                                                       TEQ04640
-  109 CONTINUE                                                          TEQ04650
-C                                                                       TEQ04660
-C      VERIFICATION PUBLIC PRIVE                                        TEQ04670
-C                                                                       TEQ04680
-C                                                                       TEQ04740
-      CALL OVLY(TEQ6,IRC)                                               TEQ04750
-      CALL OVLY(TEQJ,IRC)                                               TEQ04760
-      CALL OVLY(TEQ7,IRC)                                               TEQ04770
-      CALL DTATQ                                                        TEQ04780
-      GO TO 1                                                           TEQ04800
-C                                                                       TEQ04810
-C      DIVERS .......                                                   TEQ04820
-C                                                                       TEQ04830
-    4 KENTRY=1                                                          TEQ04840
-      CALL TREMY (KENTRY)                                               TEQ04850
-      PO=PO+15.                                                         TEQ04860
-      GO TO 1                                                           TEQ04870
-    5 CALL PERCA                                                        TEQ04880
-      PO=PO+3.                                                          TEQ04890
-      GO TO 1                                                           TEQ04900
-    6 CALL TEXTZ(KART,KI,80,DICO,JOB)                                   TEQ04910
-      IF(JOB    .EQ.0)GO TO  1                                          TEQ04920
-      IF(JOB.GT.3)GO TO 7666                                            TEQ04930
-      GO TO(10,6,11),JOB                                                TEQ04940
- 7666 CONTINUE                                                          TEQ04950
-      KI=KI+1                                                           TEQ04960
-      GO TO 6                                                           TEQ04970
-   10 CALL CONOE                                                        TEQ04980
-      PO=PO+3.                                                          TEQ04990
-      GO TO 1                                                           TEQ05000
-   11 CALL COBAR                                                        TEQ05010
-      PO=PO+3.                                                          TEQ05020
-      GO TO 1                                                           TEQ05030
-    7 CALL COTAT                                                        TEQ05040
-      PO=PO+N*0.05*400.*E                                               TEQ05050
-      GO TO 1                                                           TEQ05060
-    8 CONTINUE                                                          TEQ05070
-C                                                                       TEQ05080
-C      ELIMINER MODULE REPPORT EVENTUEL                                 TEQ05090
-C                                                                       TEQ05100
-      IF(KART(KI).EQ.DICO(3))GO TO 1                                    TEQ05110
-      CALL FILES                                                        TEQ05120
-      PO=PO+N*0.02*400.*E                                               TEQ05130
-      GO TO 1                                                           TEQ05140
-    9 CALL NOTA                                                         TEQ05150
-      PO=PO+3.                                                          TEQ05160
-      GO TO 1                                                           TEQ05170
-   12 CALL AXES(KART,KI,KF)                                             TEQ05180
-      PO=PO+10.                                                         TEQ05190
-      GO TO 1                                                           TEQ05200
-   13 KENTRY=2                                                          TEQ05210
-      CALL TREMY (KENTRY)                                               TEQ05220
-      PO=PO+10.                                                         TEQ05230
-      GO TO 1                                                           TEQ05240
-C                                                                       TEQ05250
-C      CLOU                                                             TEQ05260
-C                                                                       TEQ05270
-   51 CALL LYS(KART,KI,80,R,IBART,KOD)                                  TEQ05280
-      KI=KI+1                                                           TEQ05290
-      IF(KOD.EQ.4)GO TO 51                                              TEQ05300
-      IPH5=0                                                            TEQ05310
-      KI=KI-1                                                           TEQ05320
-  151 CALL LYS(KART,KI,80,R,IPH5,KOD)                                   TEQ05330
-      IF(KOD.NE.2)GO TO 1                                               TEQ05340
-      IBART=IBART+10*IPH5                                               TEQ05350
-      CALL LYS(KART,KI,80,R,IQUAL,KOD)                                  TEQ05360
-      IF(KOD.NE.2)IQUAL=0                                               TEQ05370
-      GO TO 1                                                           TEQ05380
-C                                                                       TEQ05390
-C      CARTOUCHE SPECIAL                                                TEQ05400
-C                                                                       TEQ05410
-   52 CALL CARLC(0)                                                     TEQ05420
-      GO TO 1                                                           TEQ05430
-C                                                                       TEQ05440
-C      NOMENCLATURE                                                     TEQ05450
-C                                                                       TEQ05460
-   16 INOM=1                                                            TEQ05470
-   50 CALL LYS(KART,KI,80,R,INOM,KOD)                                   TEQ05480
-      KI=KI+1                                                           TEQ05490
-      IF(KOD-2)1,1,50                                                   TEQ05500
-   17 CALL BMETA                                                        TEQ05510
-      PO=PO+30.                                                         TEQ05520
-      GO TO 1                                                           TEQ05530
-   19 CALL AMETA                                                        TEQ05540
-      PO=PO+30.                                                         TEQ05550
-      GO TO 1                                                           TEQ05560
-   21 CONTINUE                                                          TEQ05570
-      NPER=MPER                                                         TEQ05580
-      CALL PERRA                                                        TEQ05590
-      MPER=NPER                                                         TEQ05600
-      GO TO 1                                                           TEQ05610
-   22 IARCH=1                                                           TEQ05620
-      GO TO 1                                                           TEQ05630
-C                                                                       TEQ05640
-C     **BOULON   (COMPATIBILITE KIR)                                    TEQ05650
-C                                                                       TEQ05660
-   54 CONTINUE                                                          TEQ05670
-      CALL OVLY(TEQW,IRC)                                               TEQ05680
-      CALL BOUDES(KART,KI)                                              TEQ05690
-      GOTO 1                                                            TEQ05700
-C                                                                       TEQ05710
-C      GOUJON                                                           TEQ05720
-C                                                                       TEQ05730
-   55 CONTINUE                                                          TEQ05740
-      CALL OVLY(TEQW,IRC)                                               TEQ05750
-      CALL STUDS(NSTUD,ISTUD)                                           TEQ05760
-      GO TO 1                                                           TEQ05770
-   56 ITEST=1                                                           TEQ05780
-      GO TO 1                                                           TEQ05790
-C                                                                       TEQ05800
-C      REJET                                                            TEQ05810
-C                                                                       TEQ05820
-   37  CALL REJET                                                       TEQ05830
-       write(*,*) "PEDRO: REJET fini"
-       GO TO 1                                                          TEQ05840
-C                                                                       TEQ05850
-C                                                                       TEQ05860
-  115 IATA=2                                                            TEQ05870
-C                                                                       TEQ05880
-C      FIN DU DESSIN,DEBUT DU TRAITEMENT DES FICHES ET DES NOMENCLATURESTEQ05890
-C                                                                       TEQ05900
-   15 CALL POSA(U,V)                                                    TEQ05910
-      IN=N                                                              TEQ05920
-      IP=IC14-6                                                         TEQ05930
-      CALL OVLY(TEQ0,IRC)                                               TEQ05940
-      CALL OVLY(TEQ2,IRC)                                               TEQ05950
-      CALL TPOS                                                         TEQ05960
-      N99=999                                                           TEQ05970
-      CALL PNUMA(0.,0.,N99,0.,0.)                                       TEQ05980
-C                                                                       TEQ05990
-C      FIN SI PASSAGE DE TEST SANS NOMENCLATURE OU FICHE                TEQ06000
-C                                                                       TEQ06010
-C                                                                       TEQ06060
-      IF(ITEST.EQ.1)STOP                                                TEQ06070
-      CALL OVLY(TEQI,IRC)                                               TEQ06080
-      IF(IARCH.EQ.1)CALL ARCHI                                          TEQ06100
-      INOM1=INOM                                                        TEQ06120
-      IF(INOM.EQ.0)INOM=1                                               TEQ06130
-      IF(INOM)35,35,34                                                  TEQ06140
-   34 CONTINUE                                                          TEQ06150
-      IF(KMETR.EQ.2)GO TO 134                                           TEQ06160
-      N=IN                                                              TEQ06170
-      CALL OVLY(TEQB,IRC)                                               TEQ06180
-      CALL OVLY(TEQF,IRC)                                               TEQ06190
-      CALL OVLY(TEQM,IRC)                                               TEQ06200
-      NPER=MPER                                                         TEQ06210
-      ITEST=INTAX                                                       TEQ06220
-      CALL GRUGE                                                        TEQ06230
-      CALL OVLY(TEQC,IRC)                                               TEQ06240
-      CALL OVLY(TEQD,IRC)                                               TEQ06250
-      CALL OVLY(TEQL,IRC)                                               TEQ06260
-      KARM=0                                                            TEQ06270
-      CALL GRUF(KARM)                                                   TEQ06280
-      PA=1.0+0.7*IW28                                                   TEQ06290
-      N=IN                                                              TEQ06300
-      IECHW=2-KMETR                                                     TEQ06310
-      INOM=INOM1                                                        TEQ06320
-  134 CONTINUE                                                          TEQ06330
-      IF(INOM1.EQ.0)GOTO 33                                             TEQ06340
-      CALL OVLY(TEQA,IRC)                                               TEQ06350
-      CALL OVLY(TEQK,IRC)                                               TEQ06360
-      CALL OVLY(TEQE,IRC)                                               TEQ06370
-C                                                                       TEQ06400
-      IBUF(1)=0                                                         TEQ06410
-      CALL POUT(IBUF)                                                   TEQ06420
-      CALL MAYAN                                                        TEQ06430
-      PA=PA+0.05                                                        TEQ06440
-      IF(KMETR.EQ.2)GO TO 33                                            TEQ06450
-      IF((NPER+NPERM).GT.0)GO TO 133                                    TEQ06460
-      IF(IC13)33,33,133                                                 TEQ06470
-  133 CONTINUE                                                          TEQ06480
-      CALL OVLY(TEQG,IRC)                                               TEQ06490
-      CALL BULON                                                        TEQ06500
-      CALL OVLY(TEQH,IRC)                                               TEQ06510
-      PA=PA+0.25                                                        TEQ06520
-      CALL MAYEN                                                        TEQ06530
-      GOTO 33                                                           TEQ06550
- 35   IF(IW28.NE.0)GOTO 34                                              TEQ06560
- 33   N=IN                                                              TEQ06570
-      STOP                                                              TEQ06680
-      END                                                               TEQ06690
-      SUBROUTINE TPOS                                                   TEQ06700
-C                                                                       TEQ06710
-C      VERSION FEVRIER 1986                                             TEQ06720
-C        TEQ.FT0                                                        TEQ06730
-C                                                                       TEQ06740
-      COMMON /SUITW/ XW,YW,XNIV,INIVO,IOP,IQT,XBAR,ICADR                TEQ06750
-      COMMON /DIVER/ ISUP,ILANG,IW28,W1,IKOT(5)                         TEQ06760
-      COMMON /RAIDIS/NBRE(400)                                                  
-      COMMON /OPTCD/IDUM,ITEST,VBD(2),IRAIDS                            TEQ06780
-      COMMON /CARTO/ICAS,XCAR(3,8),ITTRR(74)                            TEQ06790
-      COMMON /PLACE/IPPAG,ICLIEN(56),IDAT(2),IAFF(2),NUMRO(7)           TEQ06800
-C                                                                       TEQ06810
-      DIM=80.+2.*IKOT(4)                                                TEQ06820
-      NCASE=3                                                           TEQ06830
-      IF(DIM.LT.90.)NCASE=2                                             TEQ06840
-      XECR=138.+21.*ICADR-XW                                            TEQ06850
-      CALL CARTC(0,XECR-20.,-YW)                                        TEQ06860
-      CALL PLUME(0)                                                     TEQ06870
-      NB=99                                                             TEQ06880
-      IDXX=0                                                            TEQ06890
-C     IF(NRAID.GT.0)NB=NB-1                                             TEQ06900
-      CALL PNUMA(XECR,-YW,NB,0.,0.)                                     TEQ06910
-C     WRITE(6,7786)ITEST                                                        
-C7786 FORMAT(' ITEST=',I12)                                                     
-      IF(ITEST.EQ.1)GO TO 1                                             TEQ06930
-      CALL PACKN(IAFF,4,ITTRR(1),2,4)                                   TEQ06940
-      CALL PACKN(IDAT,4,ITTRR(64),2,4)                                  TEQ06950
-      DO 2 I=1,56                                                       TEQ06960
-    2 ICLIEN(I)=ITTRR(I+4)                                              TEQ06970
-      DO 3 I=1,7                                                        TEQ06980
-    3 NUMRO(I)=ITTRR(I+67)                                              TEQ06990
-      CALL RAIDF(-10.,0.,NCASE,NRAID)                                         TE
-      IDXX=(NRAID+NCASE-1)/NCASE                                        TEQ07010
-    1 CONTINUE                                                          TEQ07020
-      DXX=IDXX*21.+IDXX/5*1.                                            TEQ07030
-      CALL PNUMA(DXX,0.,NB,0.,0.)                                       TEQ07040
-      RETURN                                                            TEQ07050
-      END                                                               TEQ07060
-      SUBROUTINE REJET                                                  TEQ07070
-C                                                                       TEQ07080
-C                                                                       TEQ07090
-C     COMMANDE REJET                                                    TEQ07100
-C                                                                       TEQ07110
-C      VERSION JUIN 1984 PARIS                                          TEQ07120
-C                                                                       TEQ07130
-      INTEGER DICO(25),KART(80),IREP(2),LABEL(4,200),OUT                TEQ07140
-      DIMENSION RLABEL(4,200)                                           TEQ07150
-      COMMON /REJCOM/LABEL,NLABEL                                       TEQ07160
-      EQUIVALENCE (LABEL(1,1),RLABEL(1,1))                              TEQ07170
-      COMMON/UNIT/INPUT,IDUMMY,OUT                                      TEQ07180
-      DATA DICO /5,'R','E','J','E','T',3,'F','I','N',                   TEQ07190
-     *2,'D','X',2,'D','Y',7,'P','A','R','T','I','E','L',0/              TEQ07200
-      DATA IBL/'    '/,ICOT/''''/,IEGAL/'='/                            TEQ07210
-      INUM=0                                                            TEQ07220
-C                                                                       TEQ07230
-C    DECODAGE CARTE REJET                                               TEQ07240
-C                                                                       TEQ07250
-      INUM=0                                                            TEQ07260
-      KNUM=1                                                            TEQ07270
-  20  READ(INPUT,2000)KART                                              TEQ07280
-      IREJET=0                                                          TEQ07290
-      DX=9999.                                                          TEQ07300
-      DY=9999.                                                          TEQ07310
- 2000 FORMAT(80A1)                                                      TEQ07320
-      LDEB=1                                                            TEQ07330
-  40  CALL TEXTZ(KART,LDEB,80,DICO,KOD)                                 TEQ07340
-      KI=LDEB                                                           TEQ07350
-      IF(KOD.EQ.2.AND.IREJET.EQ.0)GO TO 500                             TEQ07360
-      IF(KOD.EQ.0)GO TO 20                                              TEQ07370
-      IF(KOD.LE.5)GO TO 10                                              TEQ07380
-      DO 1 I=LDEB,80                                                    TEQ07390
-      IF(KART(I)-ICOT)1,2,1                                             TEQ07400
-    1 CONTINUE                                                          TEQ07410
-    2 I=I+1                                                             TEQ07420
-      IF(I.GT.80)GO TO 20                                               TEQ07430
-      DO 3 J=I,80                                                       TEQ07440
-      IF(KART(J)-ICOT)3,4,3                                             TEQ07450
-    3 CONTINUE                                                          TEQ07460
-      RETURN                                                            TEQ07470
-    4 DO 6 L=1,2                                                        TEQ07480
-    6 IREP(L)=IBL                                                       TEQ07490
-      KK=J-I                                                            TEQ07500
-      CALL PACKN(IREP,4,KART(I),1,KK)                                   TEQ07510
-      INUM=INUM+1                                                       TEQ07520
-      IF(INUM.GT.200)GO TO 333                                          TEQ07530
-      LABEL(1,INUM)=IREP(1)                                             TEQ07540
-      LABEL(2,INUM)=IREP(2)                                             TEQ07550
-C                                                                       TEQ07560
-C                                                                       TEQ07570
-      LDEB=J+1                                                          TEQ07580
-      IF(LDEB.GE.80)GO TO 20                                            TEQ07590
- 700  DX=9999.                                                          TEQ07600
-      DY=9999.                                                          TEQ07610
-      GO TO 40                                                          TEQ07620
-C                                                                       TEQ07630
-C                                                                       TEQ07640
-C                                                                       TEQ07650
-   10 GO TO (100,200,300,400,110),KOD                                   TEQ07660
-100   CONTINUE                                                          TEQ07670
-      DX=9999.                                                          TEQ07680
-      DY=9999.                                                          TEQ07690
-      CALL TEXTZ(KART,KI,80,DICO,KOD)                                   TEQ07700
-      IF(KOD.NE.5)GO TO 130                                             TEQ07710
- 110  DX=-9999.                                                         TEQ07720
-      DY=-9999.                                                         TEQ07730
- 130  IREJET=1                                                          TEQ07740
-      LDEB=KI                                                           TEQ07750
-      GO TO 500                                                         TEQ07760
-200   CONTINUE                                                          TEQ07770
-      NLABEL=INUM                                                       TEQ07780
-      RETURN                                                            TEQ07790
-300   CONTINUE                                                          TEQ07800
-340   CALL LYS(KART,KI,80,R,I,KODE)                                     TEQ07810
-      IF(KODE.EQ.1)GO TO 700                                            TEQ07820
-      IF(KODE.EQ.4.AND.KART(KI).EQ.IEGAL)GO TO 320                      TEQ07830
-      DX=R                                                              TEQ07840
-      IF(KODE.EQ.2)DX=I                                                 TEQ07850
-      LDEB=KI                                                           TEQ07860
-      GO TO 40                                                          TEQ07870
-320   KI=KI+1                                                           TEQ07880
-      GO TO 340                                                         TEQ07890
-C                                                                       TEQ07900
-400   CONTINUE                                                          TEQ07910
-440   CALL LYS(KART,KI,80,R,I,KODE)                                     TEQ07920
-      IF(KODE.EQ.4.AND.KART(KI).EQ.IEGAL)GO TO 420                      TEQ07930
-      DY=R                                                              TEQ07940
-      IF(KODE.EQ.2)DY=I                                                 TEQ07950
-      LDEB=KI                                                           TEQ07960
-      GO TO 500                                                         TEQ07970
-420   KI=KI+1                                                           TEQ07980
-      GO TO 440                                                         TEQ07990
-C                                                                       TEQ08000
-C   MISE A JOUR TABLEAU LABEL                                           TEQ08010
-C                                                                       TEQ08020
-500    DO 501 LN=KNUM,INUM                                              TEQ08030
-       RLABEL(3,LN)=DX                                                  TEQ08040
-       RLABEL(4,LN)=DY                                                  TEQ08050
-501    CONTINUE                                                         TEQ08060
-       KNUM=INUM+1                                                      TEQ08070
-       IF(KOD.EQ.2)GO TO 200                                            TEQ08080
-       GO TO 40                                                         TEQ08090
- 333   WRITE(OUT,633)                                                   TEQ08100
- 633   FORMAT('  E : PLUS DE 200 REPERES ')                             TEQ08110
-       WRITE(2,634)                                                     TEQ08100
- 634   FORMAT('  E : PLUS DE 200 REPERES ')                             TEQ08110
-       RETURN                                                           TEQ08120
-      END                                                               TEQ08130