Skip to content

Commit

Permalink
Update fcm tutorial to add an new module file. #4
Browse files Browse the repository at this point in the history
  • Loading branch information
RosalynHatcher committed Oct 10, 2019
1 parent 3842478 commit 4f74a4a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Binary file modified practicals.pdf
Binary file not shown.
12 changes: 7 additions & 5 deletions practicals/source/fcm-tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,20 @@ Now make some code changes! Use the following scenario to take you through the b

**Adding a new file**

* Still in the ``src/control/top_level`` directory, add a new file with a subroutine in, called ``um_shell_sub.F90``. (An example file is available on PUMA: ``~um/um-training/um_shell_sub.F90``. The routine ``umPrint`` should be used for writing out messages rather than standard FORTRAN ``WRITE`` statements.)
* Still in the ``src/control/top_level`` directory, add a new FORTRAN module file (``um_shell_mod.F90``) containing a subroutine called ``um_shell_sub()``. (An example file is available on PUMA: ``~um/um-training/um_shell_mod.F90``. The routine ``umPrint`` should be used for writing out messages rather than standard FORTRAN ``WRITE`` statements.)
* Run **fcm add** on the command line, to let the repository know you're adding a new file at the next commit. Make sure you are still in ``src/control/top_level`` and then type: ::

fcm add um_shell_sub.F90
fcm add um_shell_mod.F90

at the command prompt.

* Amend ``um_shell.F90`` to call this new subroutine: ::
* Modify ``um_shell.F90`` to use this new module. You'll see lots of ``USE`` statements near the top of the file. Add the following to use our new one. ::

CALL um_shell_sub()
USE um_shell_mod

* Then add a line to call the ``um_shell_sub`` subroutine (suggest around line 375): ::

* Ensure you put a comment line **! DEPENDS ON: um_shell_sub** above the CALL statement to ensure the dependency on your new file is registered.
CALL um_shell_sub()

**Deleting a file**

Expand Down

0 comments on commit 4f74a4a

Please sign in to comment.