From e1c74864de0793a15476de9c8c19938e729178fa Mon Sep 17 00:00:00 2001 From: rosscastle <43442986+rosscastle@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:21:25 +0100 Subject: [PATCH 1/3] Create debug.rst Created debug page to be added to by others. I have put my brief thoughts in. --- docs/source/debug.rst | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 docs/source/debug.rst diff --git a/docs/source/debug.rst b/docs/source/debug.rst new file mode 100644 index 000000000..7ca53839a --- /dev/null +++ b/docs/source/debug.rst @@ -0,0 +1,47 @@ +Ideas for ‘debugging’ problems in Isca +====================================== + +When Isca runs crash it can be difficult to diagnose the problem. We suggest trying these steps below in order to work out where the crash is happening. Not all may be applicable to your problem. + +Write Statements +---------------- +Add in some write commands into the Fortran files you suspect are causing trouble. These can be either to print out values to check if they seem sensible, or periodic statements (e.g. every 100 lines or after every major function) so see how far the code is running. + +Running on 1 core +----------------- +A lot of issues on Isca can stem from parallelisation across multiple computing cores. If you run a job on 1 core and it works, you know that the problem lies here. Quite often it can be the allocation of the start/end integers ``is, ie, js, je`` + +Column Model +------------ +Using the column model can be useful to test that parameterisations like convection and radiation are working properly as you don’t have horizontal dynamics complicating things. + +1 Change At A Time +------------------ +Generally when building a model, it is a good idea to create it iteratively. Start from somewhere you know works, for example one of our test cases, and make 1 or 2 changes at a time towards your ideal set up. Then you will know what change is causing the crash. + +Diagnostics +----------- +Be sure to output diagnostics that can help you diagnose the problem. That said, sometimes turning off diagnostics can stop model crashes. If this is the case, your problem is likely data related. + +Recompile +--------- +Ensure that you are recompiling the Fortran each time. + +Timestep +-------- +The usual quickest fix when you have a model run that is crashing part way through is to increase the timestep. Your timestep must obey the CFL criterion. + +Check you’ve allocated large enough variable size +------------------------------------------------- +Particularly important when using an uncommon diagnostic. + + +Increase the stack size +----------------------- +Ensure there is enough temporary memory to hold the run and data created. + + +Authors +------- +This documentation was put together by the Isca team from their experience with using Isca. +Last updated 07/10/2021 From 2c009d6a107fc40f92e15c94adcb255c7773aac4 Mon Sep 17 00:00:00 2001 From: rosscastle <43442986+rosscastle@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:22:06 +0100 Subject: [PATCH 2/3] Update index.rst Added debug into index. --- docs/source/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/index.rst b/docs/source/index.rst index 569933c35..aaa4579ea 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -131,6 +131,7 @@ Contents changelog contributing testing/index.rst + debug references remote_access From 88ad77cdab438ac3b28371293030dcfa0d6aa142 Mon Sep 17 00:00:00 2001 From: daw538 <40756463+daw538@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:55:20 +0100 Subject: [PATCH 3/3] Updated debug doc Extra embellishments --- docs/source/debug.rst | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/source/debug.rst b/docs/source/debug.rst index 7ca53839a..597f464df 100644 --- a/docs/source/debug.rst +++ b/docs/source/debug.rst @@ -5,7 +5,13 @@ When Isca runs crash it can be difficult to diagnose the problem. We suggest try Write Statements ---------------- -Add in some write commands into the Fortran files you suspect are causing trouble. These can be either to print out values to check if they seem sensible, or periodic statements (e.g. every 100 lines or after every major function) so see how far the code is running. +Add in some write commands into the Fortran files you suspect are causing trouble. These can be either to print out values to check if they seem sensible, or periodic statements (e.g. every 100 lines or after every major function) so see how far the code is running. A quick and dirty way of printing variables directly to the terminal is to use a command in the code like this (note this will print every timestep without further conditions): + +.. code-block:: fortran + + write(6,*) ": ", + +Alternatively variables can be written to files, such as this `example `_. Running on 1 core ----------------- @@ -15,7 +21,7 @@ Column Model ------------ Using the column model can be useful to test that parameterisations like convection and radiation are working properly as you don’t have horizontal dynamics complicating things. -1 Change At A Time +One Change At A Time ------------------ Generally when building a model, it is a good idea to create it iteratively. Start from somewhere you know works, for example one of our test cases, and make 1 or 2 changes at a time towards your ideal set up. Then you will know what change is causing the crash. @@ -29,7 +35,7 @@ Ensure that you are recompiling the Fortran each time. Timestep -------- -The usual quickest fix when you have a model run that is crashing part way through is to increase the timestep. Your timestep must obey the CFL criterion. +The usual quickest fix when you have a model run that is crashing part way through is to increase the timestep. Your timestep must obey the `CFL criterion `_. Check you’ve allocated large enough variable size ------------------------------------------------- @@ -44,4 +50,4 @@ Ensure there is enough temporary memory to hold the run and data created. Authors ------- This documentation was put together by the Isca team from their experience with using Isca. -Last updated 07/10/2021 +Last updated 08/10/2021