<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="fr">
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lfairhead</id>
		<title>LMDZPedia - Contributions de l’utilisateur [fr]</title>
		<link rel="self" type="application/atom+xml" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Lfairhead"/>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php/Sp%C3%A9cial:Contributions/Lfairhead"/>
		<updated>2026-05-30T02:47:47Z</updated>
		<subtitle>Contributions de l’utilisateur</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=516</id>
		<title>LMDZ Coding conventions and guidelines</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=516"/>
				<updated>2025-01-24T16:37:37Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
== Generalities ==&lt;br /&gt;
&lt;br /&gt;
* '''IMPLICT NONE'''&lt;br /&gt;
* useful comments in all files (of course)&lt;br /&gt;
* fortran keywords in fortran files will be in '''UPPER''' case&lt;br /&gt;
* in the physics module, all '''SAVE''' variables should be declared as '''THREADPRIVATE''' (this includes all variables that are initialized in their declaration)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  LOGICAL, SAVE :: first = .TRUE.&lt;br /&gt;
  !$OMP THREADPRIVATE(first)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* variables and functions included through modules should be explicitly defined through the '''USE ..., ONLY''' statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
USE ioipsl_getin_p_mod, ONLY : getin_p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming of modules ==&lt;br /&gt;
&lt;br /&gt;
Module names should have a '''lmdz_''' prefix. For example, the file '''lmdz_wave.F90''' would be a module containing one or more subroutines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  MODULE lmdz_wave&lt;br /&gt;
  IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
  CONTAINS&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_init (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_init&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_calc (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_calc&lt;br /&gt;
&lt;br /&gt;
  END MODULE lmdz_wave&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beware: the renaming of already existing parametrization modules (to the '''lmdz_''' format) should only occur once they have been re-written to adhere to the coding conventions for parametrizations (see below) as we use it as a marker that the recoding work on that particular parametrization has been done.&lt;br /&gt;
&lt;br /&gt;
== Coding conventions for parametrizations ==&lt;br /&gt;
&lt;br /&gt;
Following different discussions among LMDZ developpers (summarized in one of our weekly meetings [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/cr-de-reunions/poihl/compte-rendus-poihl-2022/2022-05-16 here]), the following coding rules apply to the development of LMDZ parametrizations:&lt;br /&gt;
&lt;br /&gt;
* constants and variables that need to be initialized for all routines of the parametrization '''''param''''' should be declared and initialized in a specific initialisation module called '''lmdz_''param''_ini'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param_ini&lt;br /&gt;
REAL, SAVE :: cst1&lt;br /&gt;
!$OMPTREADPRIVATE cst1&lt;br /&gt;
...&lt;br /&gt;
END MODULE lmdz_param_ini&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the routines associated to a parametrization can either be gathered in a unique module or each have their own module. The name of the module will reflect the parametrization the routine belongs to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param1_subroutine1&lt;br /&gt;
CONTAINS&lt;br /&gt;
SUBROUTINE param1_subroutine1&lt;br /&gt;
USE lmdz_param1_ini, ONLY : cst1&lt;br /&gt;
...&lt;br /&gt;
END SUBROUTINE param1_subroutine1&lt;br /&gt;
END MODULE lmdz_param1_subroutine1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the first arguments of parametrization routines should be the dimensions of the domain (e.g. '''klon, klev''')&lt;br /&gt;
* all the variables in a routine must be 'properly' declared with '''TYPE''', '''DIMENSION''' and '''INTENT''' for arguments to the routine&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param1_subroutine1&lt;br /&gt;
CONTAINS&lt;br /&gt;
SUBROUTINE param1_subroutine1(klon, klev, ..., dtdwn, dqdwn, ..., dth, ...)&lt;br /&gt;
! Input arguments to routine&lt;br /&gt;
INTEGER, INTENT(IN) :: klon,klev&lt;br /&gt;
REAL, DIMENSION (klon, klev),     INTENT(IN)          :: dtdwn, dqdwn&lt;br /&gt;
...&lt;br /&gt;
! Output arguments&lt;br /&gt;
REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: dth&lt;br /&gt;
...&lt;br /&gt;
! Local variables&lt;br /&gt;
REAL, DIMENSION(klon)                                 :: act&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* all dimensions of tables (e.g. '''nbsrf''') should be passed as arguments to the routine rather than passed through a module&lt;br /&gt;
&lt;br /&gt;
24 janvier 2025 à 17:37 (CET)&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:Notes Techniques]]&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=515</id>
		<title>LMDZ Coding conventions and guidelines</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=515"/>
				<updated>2025-01-24T16:30:13Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Generalities ==&lt;br /&gt;
&lt;br /&gt;
* '''IMPLICT NONE'''&lt;br /&gt;
* useful comments in all files (of course)&lt;br /&gt;
* fortran keywords in fortran files will be in '''UPPER''' case&lt;br /&gt;
* in the physics module, all '''SAVE''' variables should be declared as '''THREADPRIVATE''' (this includes all variables that are initialized in their declaration)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  LOGICAL, SAVE :: first = .TRUE.&lt;br /&gt;
  !$OMP THREADPRIVATE(first)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* variables and functions included through modules should be explicitly defined through the '''USE ..., ONLY''' statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
USE ioipsl_getin_p_mod, ONLY : getin_p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming of modules ==&lt;br /&gt;
&lt;br /&gt;
Module names should have a '''lmdz_''' prefix. For example, the file '''lmdz_wave.F90''' would be a module containing one or more subroutines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  MODULE lmdz_wave&lt;br /&gt;
  IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
  CONTAINS&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_init (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_init&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_calc (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_calc&lt;br /&gt;
&lt;br /&gt;
  END MODULE lmdz_wave&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beware: the renaming of already existing parametrization modules (to the '''lmdz_''' format) should only occur once they have been re-written to adhere to the coding conventions for parametrizations (see below) as we use it as a marker that the recoding work on that particular parametrization has been done.&lt;br /&gt;
&lt;br /&gt;
== Coding conventions for parametrizations ==&lt;br /&gt;
&lt;br /&gt;
Following different discussions among LMDZ developpers (summarized in one of our weekly meetings [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/cr-de-reunions/poihl/compte-rendus-poihl-2022/2022-05-16 here]), the following coding rules apply to the development of LMDZ parametrizations:&lt;br /&gt;
&lt;br /&gt;
* constants and variables that need to be initialized for all routines of the parametrization '''''param''''' should be declared and initialized in a specific initialisation module called '''lmdz_''param''_ini'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param_ini&lt;br /&gt;
REAL, SAVE :: cst1&lt;br /&gt;
!$OMPTREADPRIVATE cst1&lt;br /&gt;
...&lt;br /&gt;
END MODULE lmdz_param_ini&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the routines associated to a parametrization can either be gathered in a unique module or each have their own module. The name of the module will reflect the parametrization the routine belongs to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param1_subroutine1&lt;br /&gt;
CONTAINS&lt;br /&gt;
SUBROUTINE param1_subroutine1&lt;br /&gt;
USE lmdz_param1_ini, ONLY : cst1&lt;br /&gt;
...&lt;br /&gt;
END SUBROUTINE param1_subroutine1&lt;br /&gt;
END MODULE lmdz_param1_subroutine1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* the first arguments of parametrization routines should be the dimensions of the domain (e.g. '''klon, klev''')&lt;br /&gt;
* all the variables in a routine must be 'properly' declared with '''TYPE''', '''DIMENSION''' and '''INTENT''' for arguments to the routine&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
MODULE lmdz_param1_subroutine1&lt;br /&gt;
CONTAINS&lt;br /&gt;
SUBROUTINE param1_subroutine1(klon, klev, ..., dtdwn, dqdwn, ..., dth, ...)&lt;br /&gt;
! Input arguments to routine&lt;br /&gt;
INTEGER, INTENT(IN) :: klon,klev&lt;br /&gt;
REAL, DIMENSION (klon, klev),     INTENT(IN)          :: dtdwn, dqdwn&lt;br /&gt;
...&lt;br /&gt;
! Output arguments&lt;br /&gt;
REAL, DIMENSION (klon, klev),     INTENT(OUT)         :: dth&lt;br /&gt;
...&lt;br /&gt;
! Local variables&lt;br /&gt;
REAL, DIMENSION(klon)                                 :: act&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* all dimensions of tables (e.g. '''nbsrf''') should be passed as arguments to the routine rather than passed through a module&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:Notes Techniques]]&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=514</id>
		<title>LMDZ Coding conventions and guidelines</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=LMDZ_Coding_conventions_and_guidelines&amp;diff=514"/>
				<updated>2025-01-24T15:39:10Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : Page créée avec «  == Generalities ==  * fortran keywords in fortran files will be in UPPER case  == Naming of modules ==  Module names should have a '''lmdz_''' prefix. For example, the fi... »&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Generalities ==&lt;br /&gt;
&lt;br /&gt;
* fortran keywords in fortran files will be in UPPER case&lt;br /&gt;
&lt;br /&gt;
== Naming of modules ==&lt;br /&gt;
&lt;br /&gt;
Module names should have a '''lmdz_''' prefix. For example, the file '''lmdz_wave.F90''' would be a module containing one or more subroutines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  MODULE lmdz_wave&lt;br /&gt;
  IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
  CONTAINS&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_init (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_init&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_calc (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_calc&lt;br /&gt;
&lt;br /&gt;
  END MODULE lmdz_wave&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beware: the renaming of already existing parametrization modules (to the '''lmdz_''' format) should only occur once they have been re-written to adhere to the coding conventions for parametrizations (see below) as we use it as a marker that the recoding work on that particular parametrization has been done.&lt;br /&gt;
&lt;br /&gt;
== Coding conventions for parametrizations ==&lt;br /&gt;
&lt;br /&gt;
Following different discussions among LMDZ developpers (summarized in one of our weekly meetings [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/cr-de-reunions/poihl/compte-rendus-poihl-2022/2022-05-16 here], the following coding rules apply to the development of LMDZ parametrizations:&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_LMDZ_code_guidelines&amp;diff=513</id>
		<title>HowTo: LMDZ code guidelines</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_LMDZ_code_guidelines&amp;diff=513"/>
				<updated>2025-01-23T11:50:13Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;  /!\ This page is a WORK IN PROGRESS. Nothing in this page should be considered correct or consensual for now. /!\&lt;br /&gt;
&lt;br /&gt;
''Note: this documents draws from various sources, including [http://broken.link.todo.replace the OPA guidelines], [https://fortranwiki.org/fortran/show/Modernizing+Old+Fortran Modernizing Old Fortran], [http://pages.swcp.com/~walt/F/F_bnf.html F syntax rules], [https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md the stdlib style guide], [https://github.com/codee-com/fortran-modernization CODEE Fortran recommendations].&lt;br /&gt;
&lt;br /&gt;
== Code guidelines and conventions ==&lt;br /&gt;
&lt;br /&gt;
=== Generalities ===&lt;br /&gt;
&lt;br /&gt;
* fortran keywords in fortran files will be in UPPER case&lt;br /&gt;
&lt;br /&gt;
=== Naming of modules ===&lt;br /&gt;
&lt;br /&gt;
Module names should have a '''lmdz_''' prefix. For example, the file '''lmdz_wave.F90''' would be a module containing one or more subroutines:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
  MODULE lmdz_wave&lt;br /&gt;
  IMPLICIT NONE&lt;br /&gt;
&lt;br /&gt;
  CONTAINS&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_init (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_init&lt;br /&gt;
&lt;br /&gt;
  SUBROUTINE wave_calc (...)&lt;br /&gt;
  ...&lt;br /&gt;
  END SUBROUTINE wave_calc&lt;br /&gt;
&lt;br /&gt;
  END MODULE lmdz_wave&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example code ==&lt;br /&gt;
&lt;br /&gt;
''Note: in this example, we added &amp;quot;meta-comments&amp;quot; indicated by &amp;lt;code&amp;gt;!!&amp;lt;/code&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Note: of course, there's always exceptions to &amp;quot;Always&amp;quot;, but they should '''systematically''' documented by a comment, with a proper explanation.''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
!! File: lmdz_mymodule.f90&lt;br /&gt;
!!         ^ all module files should start with their component name, (e.g. &amp;quot;lmdz&amp;quot;)&lt;br /&gt;
!!                      ^ use &amp;quot;.f90&amp;quot; for all free-form files, unless they contain preprocessor directives (then use &amp;quot;.F90&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
!! At the top of the file, we provide a comment to explain what this modules does&lt;br /&gt;
! implementation of my_useful_stuff.&lt;br /&gt;
! ----------------------------------&lt;br /&gt;
&lt;br /&gt;
!! Unless specified otherwise, all files should contain a single module with the same name which encapsulates all their content&lt;br /&gt;
MODULE lmdz_mymodule&lt;br /&gt;
!!  ^ all Fortran keywords are in CAPS, everything else is in lowercase.&lt;br /&gt;
  USE my_other_module, ONLY: function_a, function_b&lt;br /&gt;
  !!                     ^ Always specify explicitely which functions you use from a module.&lt;br /&gt;
!!^ use indentation (2 spaces) to provide visual clarity&lt;br /&gt;
  IMPLICIT NONE; PRIVATE&lt;br /&gt;
  !!                ^ Always make your module private, and expose explicitely which functions are public&lt;br /&gt;
  !!    ^ Always use IMPLICIT NONE at the module-level&lt;br /&gt;
  PUBLIC my_var, my_subroutine&lt;br /&gt;
&lt;br /&gt;
  REAL, PARAMETER :: my_var&lt;br /&gt;
  REAL            :: a, b, c, d, e, f&lt;br /&gt;
  !!               ^ use &amp;quot;::&amp;quot; even if it's not strictly necessary&lt;br /&gt;
  !!       ^ Alignment of &amp;quot;::&amp;quot; is not necessary, but should be attempted whenever it provides readability and is relevant (e.g. there's some link between the aligned variables)&lt;br /&gt;
        &lt;br /&gt;
CONTAINS&lt;br /&gt;
  &lt;br /&gt;
 !! Put at least a blank line before/after each function/subroutine2&lt;br /&gt;
 !! A routine should have a clear, unambiguous name, describing what the routine does.&lt;br /&gt;
  SUBROUTINE my_subroutine(arg1, arg2, arg3) ! handle event xxxx&lt;br /&gt;
  !!                            ^ comments should always be right before, or on the same line as what they're commenting&lt;br /&gt;
  !!                            ^ as for modules, all functions should be documented in a comment&lt;br /&gt;
    INTEGER, INTENT(IN) :: arg1&lt;br /&gt;
    !!          ^ Always provide intent &lt;br /&gt;
    REAL, INTENT(IN)    :: arg2&lt;br /&gt;
&lt;br /&gt;
    INTEGER, INTENT(INOUT) :: arg3&lt;br /&gt;
&lt;br /&gt;
    REAl, INTENT(OUT) :: out1&lt;br /&gt;
    !!^ Group together IN, then INOUT, then OUT&lt;br /&gt;
&lt;br /&gt;
    IF (arg2 &amp;gt; arg1) THEN&lt;br /&gt;
    !!       ^ .ge., .le., etc are deprecated. Use &amp;gt;, &amp;lt;, ==, etc instead&lt;br /&gt;
      ! ...&lt;br /&gt;
    END IF&lt;br /&gt;
    !! ^ Use END IF, END DO rather than ENDIF, ENDDO (coherence with fortran-lang.org)&lt;br /&gt;
  END SUBROUTINE my_subroutine&lt;br /&gt;
!!         ^ always use named blocks for END&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
END MODULE my_module&lt;br /&gt;
!!       ^ always use named blocks for END&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comments and Documentation ==&lt;br /&gt;
&lt;br /&gt;
Documentation consists of putting information both inside and outside the source code. On large, formal projects, most of the documentation is outside the source code. However because the internal documentation is most closely associated with the code, it is the part most likely to remain correct as the code is modified. The thing to be really careful with is that misleading comments are even worse than having no comments at all. So, please report any misleading comments you found.&lt;br /&gt;
&lt;br /&gt;
Try to avoid having superfluous comments such as: &amp;lt;code&amp;gt;A = A + 1 ! Increment A by one.&amp;lt;/code&amp;gt; This is not adding anything that is not immediately obvious. A person looking through your code should only have to scan your comments to be able to get a good idea of what the code does and where to look for any special activity.&lt;br /&gt;
&lt;br /&gt;
Good comments do not just repeat verbally what is happening in the code or just explain it. They clarify its intent. They should explain at a higher level of abstraction what the code or what you are trying to do. In addition, you should comment:&lt;br /&gt;
* Everything that gets around an error or an undocumented feature in a language or environment.&lt;br /&gt;
* Any violations of good programming style should be justified. This will ensure that any well-intentioned programmer does not break your code by changing the source to implement a “better” style.&lt;br /&gt;
* The lines before a control structure, e.g. IF, CASE, loop, etc. are a natural spot to comment and explain what these constructs are about to do.&lt;br /&gt;
* The start of '''any''' subroutine or function whose usage is not downright obvious.&lt;br /&gt;
&lt;br /&gt;
== Misc ==&lt;br /&gt;
&lt;br /&gt;
=== Fortran standard ===&lt;br /&gt;
&lt;br /&gt;
Fortran 2008 is now widely supported on all [https://fortranwiki.org/fortran/show/Fortran+2008+status major compilers], and should be taken as a reference.&lt;br /&gt;
&lt;br /&gt;
=== Allocatable arrays ===&lt;br /&gt;
&lt;br /&gt;
Allocatable arrays can be relevant, but should be substituted by automatic arrays (= passing the array size as an argument) whenever possible, for performance and debugging reasons.&lt;br /&gt;
&lt;br /&gt;
=== Compiler warnings ===&lt;br /&gt;
&lt;br /&gt;
Compiler warnings are useful - unless there's too many of them. Effort should be made such that during the compiling phase, no warning appears, so that user can be easily alerted of potential bugs.&lt;br /&gt;
when some appear in their configuration.&lt;br /&gt;
&lt;br /&gt;
In particular, all component must be able to run when a compile-time and/or run-time array bounds checking option is enabled.&lt;br /&gt;
Use of the (*) construct in array dimensioning to circumvent this problem is forbidden because it effectively disables array bounds checking.&lt;br /&gt;
&lt;br /&gt;
=== Side effects ===&lt;br /&gt;
&lt;br /&gt;
Whenever possible, write functions without side-effects, and label them accordingly as &amp;lt;code&amp;gt;PURE&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;ELEMENTAL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== SAVE ===&lt;br /&gt;
&lt;br /&gt;
Since all files contain a &amp;lt;code&amp;gt;MODULE&amp;lt;/code&amp;gt;, attribute &amp;lt;code&amp;gt;SAVE&amp;lt;/code&amp;gt; is banned. Variables whose value have to be preserved between two calls should be declared at the module level.&lt;br /&gt;
&lt;br /&gt;
=== Deprecated features ===&lt;br /&gt;
&lt;br /&gt;
In terms of keeping code up to date and easier to maintain the code should always follow the current standards of FORTRAN and ANSI C. We decide to restrict the languages use to the elements, which are not obsolete or deleted -- even if they are still available with almost all compilers.&lt;br /&gt;
&lt;br /&gt;
''Note: just because a feature is deprecated doesn't mean it '''must''' be converted in old, working code - this can be tricky and bug-prone in complex instances.''&lt;br /&gt;
&lt;br /&gt;
Some notable deprecated features:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;COMMON&amp;lt;/code&amp;gt; blocks. Instead, use &amp;lt;code&amp;gt;MODULE&amp;lt;/code&amp;gt; initialisation.&lt;br /&gt;
* &amp;lt;code&amp;gt;EQUIVALENCE&amp;lt;/code&amp;gt; should be replaced by pointers or derived data types.&lt;br /&gt;
* Any kind of &amp;lt;code&amp;gt;GOTO&amp;lt;/code&amp;gt; has absolutely no place in modern programming. Use &amp;lt;code&amp;gt;CASE&amp;lt;/code&amp;gt; whenever relevant rather than &amp;lt;code&amp;gt;IF&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Arithmetic &amp;lt;code&amp;gt;IF&amp;lt;/code&amp;gt; statements. Use block &amp;lt;code&amp;gt;IF&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;CASE&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;CONTINUE&amp;lt;/code&amp;gt; statement:  use &amp;lt;code&amp;gt;IF, CASE, DO WHILE, EXIT, CYCLE&amp;lt;/code&amp;gt; statements or a contained &amp;lt;code&amp;gt;SUBROUTINE&amp;lt;/code&amp;gt; instead.&lt;br /&gt;
* I/O routines &amp;lt;code&amp;gt;END&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;ERR&amp;lt;/code&amp;gt; - use &amp;lt;code&amp;gt;IOSTAT&amp;lt;/code&amp;gt; instead&lt;br /&gt;
* &amp;lt;code&amp;gt;FORMAT&amp;lt;/code&amp;gt; statements: use character parameters or explicit format- specifiers inside the &amp;lt;code&amp;gt;READ&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;WRITE&amp;lt;/code&amp;gt; statement instead.&lt;br /&gt;
* &amp;lt;code&amp;gt;ENTRY&amp;lt;/code&amp;gt; statements: a subprogram must only have one entry point&lt;br /&gt;
* ''Alternate'' &amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; is obsolescent, and &amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt; at the end of a function is useless clutter.&lt;br /&gt;
* Statement functions have been replaced by corresponding functions or subroutines in the &amp;lt;code&amp;gt;CONTAIN&amp;lt;/code&amp;gt; block of the current scope.&lt;br /&gt;
* &amp;lt;code&amp;gt;DATA&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;BLOCK DATA&amp;lt;/code&amp;gt; should be replaced by initializers.&lt;br /&gt;
&lt;br /&gt;
=== Preprocessor ===&lt;br /&gt;
&lt;br /&gt;
Limit '''to the bare minimum''' the use of preprocessor &amp;lt;code&amp;gt;#ifdef&amp;lt;/code&amp;gt; keys. Those decrease lisibility, disable automatic code analysis, and generally make code a pain to manage and read. Ideally, a given preprocessor key should be used only once, or if not possible, in a single module for the entire codebase.&lt;br /&gt;
&lt;br /&gt;
=== INCLUDE ===&lt;br /&gt;
&lt;br /&gt;
Limit the use of &amp;lt;code&amp;gt;include&amp;lt;/code&amp;gt; headers to the bare minimum. Whenever not possible, wrap those include in a module, and import that module instead. This provides much more flexibility, e.g. when using &amp;lt;code&amp;gt;ONLY: ...&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Recent examples of improper LMDZ code ==&lt;br /&gt;
&lt;br /&gt;
''Note: The purpose of this section is '''obviously not''' to blame anyone, but to stress that &amp;quot;bad&amp;quot;/perfectible code in LMDZ isn't limited to old legacy code, and that even current code is being written in a way that can be greatly improved.''&lt;br /&gt;
&lt;br /&gt;
==== 07/24: Unhelpful comment ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
IF (iflag_ice_thermo == 0) THEN   &lt;br /&gt;
           !pas necessaire a priori&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This comment fails to convey a clear indication. What is necessary or not ? In which condition ? &amp;quot;A priori&amp;quot; further conveys a sense of uncertainty that may make sense to the writer, but certainly not to an external reader.&lt;br /&gt;
&lt;br /&gt;
==== 07/24: Unclear conventions, no PURE, useless RETURN ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
function grid_index(lon_deg,lat_deg)&lt;br /&gt;
!--------------------------------------------------------------------------------&lt;br /&gt;
! Get local index of grid point of longitude,latitude lon_deg,lat_deg&lt;br /&gt;
! Author : XXX 2024/07/XX&lt;br /&gt;
! Please do not put this function in a m*odule not to complexify the replay script&lt;br /&gt;
!--------------------------------------------------------------------------------&lt;br /&gt;
USE dimphy, only : klon&lt;br /&gt;
USE geometry_mod, ONLY: latitude_deg, longitude_deg&lt;br /&gt;
implicit none&lt;br /&gt;
real, intent(in) :: lon_deg,lat_deg&lt;br /&gt;
integer :: grid_index&lt;br /&gt;
integer i&lt;br /&gt;
grid_index=0&lt;br /&gt;
do i=1,klon&lt;br /&gt;
   if ( abs(lon_deg-longitude_deg(i)) &amp;lt; 0.02 .and.  abs(lat_deg-latitude_deg(i)) &amp;lt; 0.02 ) then&lt;br /&gt;
        grid_index=i&lt;br /&gt;
        exit&lt;br /&gt;
   endif&lt;br /&gt;
enddo&lt;br /&gt;
return&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is actually mostly great ! It is documented, the author put a clear statement to indicate a deviation from standards (no module), &amp;lt;code&amp;gt;USE&amp;lt;/code&amp;gt; is used in conjuction with &amp;lt;code&amp;gt;ONLY&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;INTENT&amp;lt;/code&amp;gt; is declared.&lt;br /&gt;
However, it is also lacking in some areas, notably:&lt;br /&gt;
* This function should be declared as &amp;lt;code&amp;gt;PURE&amp;lt;/code&amp;gt;&lt;br /&gt;
* This function has inconsistent syntax: mix of uppercase and lowercase for Fortran keywords, sometimes uses &amp;lt;code&amp;gt;::&amp;lt;/code&amp;gt; in declarations and sometimes not&lt;br /&gt;
* The function ends with a useless &amp;lt;code&amp;gt;RETURN&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== 07/24: Duplicated, uncommented code ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
          zx_tmp_fi3d=0.&lt;br /&gt;
          IF (vars_defined) THEN&lt;br /&gt;
             DO nsrf=1,nbsrf&lt;br /&gt;
                DO k=1,klev&lt;br /&gt;
                   zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k) &amp;amp;&lt;br /&gt;
                        +pctsrf(:,nsrf)*tke_shear(:,k,nsrf)&lt;br /&gt;
                ENDDO&lt;br /&gt;
             ENDDO&lt;br /&gt;
          ENDIF&lt;br /&gt;
&lt;br /&gt;
          CALL histwrite_phy(o_tke_shear, zx_tmp_fi3d)&lt;br /&gt;
&lt;br /&gt;
          zx_tmp_fi3d=0.&lt;br /&gt;
          IF (vars_defined) THEN&lt;br /&gt;
             DO nsrf=1,nbsrf&lt;br /&gt;
                DO k=1,klev&lt;br /&gt;
                   zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k) &amp;amp;&lt;br /&gt;
                        +pctsrf(:,nsrf)*tke_buoy(:,k,nsrf)&lt;br /&gt;
                ENDDO&lt;br /&gt;
             ENDDO&lt;br /&gt;
          ENDIF&lt;br /&gt;
&lt;br /&gt;
          CALL histwrite_phy(o_tke_buoy, zx_tmp_fi3d)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
          zx_tmp_fi3d=0.&lt;br /&gt;
          IF (vars_defined) THEN&lt;br /&gt;
             DO nsrf=1,nbsrf&lt;br /&gt;
                DO k=1,klev&lt;br /&gt;
                   zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k) &amp;amp;&lt;br /&gt;
                        +pctsrf(:,nsrf)*tke_trans(:,k,nsrf)&lt;br /&gt;
                ENDDO&lt;br /&gt;
             ENDDO&lt;br /&gt;
          ENDIF&lt;br /&gt;
&lt;br /&gt;
          CALL histwrite_phy(o_tke_trans, zx_tmp_fi3d)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code:&lt;br /&gt;
* Duplicates three times essentially the same code. Refactoring into a routine would be much more readable and reduce the potential of typos.&lt;br /&gt;
* Contains no comment justifying such behavior, or what is even being done here, which to an external reader is fairly obscure.&lt;br /&gt;
&lt;br /&gt;
==== 06/24: Undocumented variable ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
INTEGER                               :: nsrf, k, iq, iff, i, j, ilev, itr, itrb&lt;br /&gt;
!!                                                                           ^ Added this&lt;br /&gt;
!! (...)&lt;br /&gt;
itrb = 0&lt;br /&gt;
!! (...)&lt;br /&gt;
if(tracers(iq)%name(1:3)=='BIN') then&lt;br /&gt;
               itrb = itrb + 1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Just because a variable is a &amp;quot;dumb&amp;quot; counter doesn't mean it shouldn't be documented. In this particular example, the variable name is devoid of any obvious meaning.&lt;br /&gt;
Properly documenting this variable would also make it clear to others whether it would make sense to reuse it later on in the code.&lt;br /&gt;
&lt;br /&gt;
==== 06/24: Comments as code storage ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot; line&amp;gt;&lt;br /&gt;
!CALL writefield_phy('latitude',latitude_deg,1)&lt;br /&gt;
!CALL writefield_phy('pressure_hl',pressure_hl,klev+1)&lt;br /&gt;
!CALL writefield_phy('Ldecorel',PDECORR_LEN_EDGES_M,klev)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Comments are ''NOT'' for code storage'''. Unfortunately, the LMDZ code is ''littered'' with bits of commented code without any indication of when or why the code was commented.&lt;br /&gt;
As a result, there are in a lot of places such comments, many dating from 20+ years ago, for which we have no clue whether we can remove them or not. This greatly hinders readability and maintainability.&lt;br /&gt;
&lt;br /&gt;
Of course, in ''some'' cases, it is warranted to keep some code at hand, e.g. for diagnostic purpose. In such case, please '''make sure to always clearly document ''why, when and by whom'' the code was commented out''', so that it can be cleaned up at a later date when it becomes irrelevant.&lt;br /&gt;
&lt;br /&gt;
== Questions à élucider ==&lt;br /&gt;
&lt;br /&gt;
* Prescrit-on une langue (Français / Anglais) ?&lt;br /&gt;
* Longueur des lignes: dans la limite du raisonable, pourquoi se limiter à 100-140 chars ? Le wrapping fonctionne très bien.&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=416</id>
		<title>HowTo: debug the quality control</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=416"/>
				<updated>2023-07-12T10:58:28Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As explained on the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité], a number of quality control checks of the code are run every night to ensure that nothing was broken by the most recent commits to the svn depository (note that only the trunk version of the code is tested by this procedure).&lt;br /&gt;
&lt;br /&gt;
This note explains what to do if those regular tests reveal that the code is broken.&lt;br /&gt;
&lt;br /&gt;
The checks are launched by the script [https://web.lmd.jussieu.fr/~lmdz/Distrib/creation_modipsl.sh creation_modipsl.sh] which prepares the distribution version of the code and then lauches [https://web.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh], which actually launches the quality checks. The results of the tests are synthesized in one line and recorded in the file [https://web.lmd.jussieu.fr/~lmdz/pub/src_archives/Readme Readme]. Each line of this file (besides the comments) gives the version of the code being tested, its corresponding svn revision number and the results of the different checks (as explained in the file and the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité]).&lt;br /&gt;
&lt;br /&gt;
=== How to debug a failed quality check ===&lt;br /&gt;
&lt;br /&gt;
Once a failed quality check is established, one should look in the file [https://web.lmd.jussieu.fr/~lmdz/pub/LISMOI.trunk LISMOI.trunk] to find out which version of the code caused a problem (for example 20211105.trunk). One can then find the output of the quality control check in the directory:&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:/home/lmdz/tmp/LMDZ[version_number]&lt;br /&gt;
&lt;br /&gt;
with the actual output file of the check_version.sh script in&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.[version_number]&lt;br /&gt;
&lt;br /&gt;
('''''lmdz-cq:/tmp/lmdz/LMDZ20211105.trunk''''' and '''''lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.20211105.trunk''''' respectively in our example). This output file is also [https://lmdz.lmd.jussieu.fr/Distrib/WORK accessible on internet].&lt;br /&gt;
&lt;br /&gt;
One can then go through the script [https://www.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh] comparing with the different output to find out what went wrong. Tests of correction can actually be done in the &lt;br /&gt;
  lmdz-cq:/home/lmdz/tmp/LMDZ[version_number]&lt;br /&gt;
directory.&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:ExpertDev]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=415</id>
		<title>HowTo: debug the quality control</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=415"/>
				<updated>2023-07-12T10:56:40Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As explained on the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité], a number of quality control checks of the code are run every night to ensure that nothing was broken by the most recent commits to the svn depository (note that only the trunk version of the code is tested by this procedure).&lt;br /&gt;
&lt;br /&gt;
This note explains what to do if those regular tests reveal that the code is broken.&lt;br /&gt;
&lt;br /&gt;
The checks are launched by the script [https://www.lmd.jussieu.fr/~lmdz/Distrib/creation_modipsl.sh creation_modipsl.sh] which prepares the distribution version of the code and then lauches [https://www.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh], which actually launches the quality checks. The results of the tests are synthesized in one line and recorded in the file [https://web.lmd.jussieu.fr/~lmdz/pub/src_archives/Readme Readme]. Each line of this file (besides the comments) gives the version of the code being tested, its corresponding svn revision number and the results of the different checks (as explained in the file and the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité]).&lt;br /&gt;
&lt;br /&gt;
=== How to debug a failed quality check ===&lt;br /&gt;
&lt;br /&gt;
Once a failed quality check is established, one should look in the file [https://www.lmd.jussieu.fr/~lmdz/pub/LISMOI.trunk LISMOI.trunk] to find out which version of the code caused a problem (for example 20211105.trunk). One can then find the output of the quality control check in the directory:&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:/home/lmdz/tmp/LMDZ[version_number]&lt;br /&gt;
&lt;br /&gt;
with the actual output file of the check_version.sh script in&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.[version_number]&lt;br /&gt;
&lt;br /&gt;
('''''lmdz-cq:/tmp/lmdz/LMDZ20211105.trunk''''' and '''''lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.20211105.trunk''''' respectively in our example). This output file is also [https://lmdz.lmd.jussieu.fr/Distrib/WORK accessible on internet].&lt;br /&gt;
&lt;br /&gt;
One can then go through the script [https://www.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh] comparing with the different output to find out what went wrong. Tests of correction can actually be done in the &lt;br /&gt;
  lmdz-cq:/home/lmdz/tmp/LMDZ[version_number]&lt;br /&gt;
directory.&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:ExpertDev]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=323</id>
		<title>HowTo: debug the quality control</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_debug_the_quality_control&amp;diff=323"/>
				<updated>2023-02-07T14:27:39Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;As explained on the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité], a number of quality control checks of the code are run every night to ensure that nothing was broken by the most recent commits to the svn depository (note that only the trunk version of the code is tested by this procedure).&lt;br /&gt;
&lt;br /&gt;
This note explains what to do if those regular tests reveal that the code is broken.&lt;br /&gt;
&lt;br /&gt;
The checks are launched by the script [https://www.lmd.jussieu.fr/~lmdz/Distrib/creation_modipsl.sh creation_modipsl.sh] which prepares the distribution version of the code and then lauches [https://www.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh], which actually launches the quality checks. The results of the tests are synthesized in one line and recorded in the file [https://web.lmd.jussieu.fr/~lmdz/pub/src_archives/Readme Readme]. Each line of this file (besides the comments) gives the version of the code being tested, its corresponding svn revision number and the results of the different checks (as explained in the file and the page [https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/controle-qualite Contrôle qualité]).&lt;br /&gt;
&lt;br /&gt;
=== How to debug a failed quality check ===&lt;br /&gt;
&lt;br /&gt;
Once a failed quality check is established, one should look in the file [https://www.lmd.jussieu.fr/~lmdz/pub/LISMOI.trunk LISMOI.trunk] to find out which version of the code caused a problem (for example 20211105.trunk). One can then find the output of the quality control check in the directory:&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:/tmp/lmdz/LMDZ[version_number]&lt;br /&gt;
&lt;br /&gt;
with the actual output file of the check_version.sh script in&lt;br /&gt;
&lt;br /&gt;
 lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.[version_number]&lt;br /&gt;
&lt;br /&gt;
('''''lmdz-cq:/tmp/lmdz/LMDZ20211105.trunk''''' and '''''lmdz-cq:~lmdz/WWW/Distrib/WORK/check.out.20211105.trunk''''' respectively in our example). This output file is also [https://lmdz.lmd.jussieu.fr/Distrib/WORK accessible on internet].&lt;br /&gt;
&lt;br /&gt;
One can then go through the script [https://www.lmd.jussieu.fr/~lmdz/Distrib/check_version.sh check_version.sh] comparing with the different output to find out what went wrong. Tests of correction can actually be done in the &lt;br /&gt;
  lmdz-cq:/tmp/lmdz/LMDZ[version_number]&lt;br /&gt;
directory.&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
[[Category:ExpertDev]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cosp&amp;diff=322</id>
		<title>Cosp</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cosp&amp;diff=322"/>
				<updated>2023-01-27T15:30:22Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A quoi correspondent les différents répertoires cosp dans le répertoire libf/phylmd?&lt;br /&gt;
&lt;br /&gt;
* Le répertoire cosp correspond à la version cospv1 que nous avons utilisée pour les simulations CMIP6.&lt;br /&gt;
* Le répertoire cospv2 correspond à la version récente cospv2 de Cosp. La différence entre les 2 versions est la réécriture avec du fortran récent et l'ajout de nouveaux diagnostics.&lt;br /&gt;
* Le répertoire cosp2 est une version intermédiaire avec des développement d'un doctorant de Jean-Louis qu'on voulait conserver et qui n'est pas maintenue.&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cosp&amp;diff=321</id>
		<title>Cosp</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cosp&amp;diff=321"/>
				<updated>2023-01-27T15:28:25Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Le répertoire cosp correspond à la version cospv1 que nous avons utilisée pour les simulations CMIP6.&lt;br /&gt;
* Le répertoire cospv2 correspond à la version récente cospv2 de Cosp. La différence entre les 2 versions est la réécriture avec du fortran récent et l'ajout de nouveaux diagnostics.&lt;br /&gt;
* Le répertoire cosp2 est une version intermédiaire avec des développement d'un doctorant de Jean-Louis qu'on voulait conserver et qui n'est pas maintenue.&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=319</id>
		<title>HowTo: Create a Trac ticket</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=319"/>
				<updated>2023-01-25T18:57:37Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== HowTo: Create a Trac ticket == &lt;br /&gt;
&lt;br /&gt;
To create a trac ticket, first check that you are allowed to login to the trac server (so that you can actually write something). If you have a LMDZ svn account, you can use that account to login to the trac server. Head to&lt;br /&gt;
&lt;br /&gt;
https://trac.lmd.jussieu.fr/LMDZ&lt;br /&gt;
&lt;br /&gt;
Connect to your account, the connection link is in the red menu line on the upper left:&lt;br /&gt;
[[Fichier:Connexion.png|vignette|none]]&lt;br /&gt;
&lt;br /&gt;
Once connected, you should see a new button appear in the main menu line 'Nouveau ticket':&lt;br /&gt;
[[Fichier:Nouveau ticket.png|vignette|néant]]&lt;br /&gt;
&lt;br /&gt;
After clicking the 'Nouveau ticket' button, you will be taken to the following forms page&lt;br /&gt;
[[Fichier:Ticket.png|vignette|néant]]&lt;br /&gt;
which you need to fill out to create your ticket. Items to fill out are&lt;br /&gt;
&lt;br /&gt;
* ''Résumé'' : a one-line description of the problem/bug/enhancement you want the ticket for&lt;br /&gt;
* ''Description'' : a longer description of the problem/bug/enhancement&lt;br /&gt;
* ''Type'' : describes the type of ticket you want to create. Possible values are&lt;br /&gt;
** plantage / defect&lt;br /&gt;
** incoherences&lt;br /&gt;
** vérifications&lt;br /&gt;
** améliorations / enhancements&lt;br /&gt;
** formation / documentation&lt;br /&gt;
* ''Priorité'' : describes the severity or priority you want to assign to your ticket. Possible values are&lt;br /&gt;
** blocker&lt;br /&gt;
** critical&lt;br /&gt;
** major&lt;br /&gt;
** minor&lt;br /&gt;
** trivial&lt;br /&gt;
* ''Composant'' : gives an indication of the LMDZ component that is involved in your report. Possible values are&lt;br /&gt;
** Consolidation&lt;br /&gt;
** Documentation&lt;br /&gt;
** Dynamic core&lt;br /&gt;
** Environnement&lt;br /&gt;
** I/O&lt;br /&gt;
** LMDZ&lt;br /&gt;
** Optimisation&lt;br /&gt;
** Parallelisation&lt;br /&gt;
** Terrestrial Physics&lt;br /&gt;
** Tracers&lt;br /&gt;
&lt;br /&gt;
You can add some keywords in the 'Mots-clés' field and inform other members of the LMDZ team directly of your ticket by inserting their username in the 'Copie à' field. You can also attach some files explaining your problem to your ticket. You can finally assign your new ticket to some other member of the team by switching on the 'assign' button rather than the 'create' button and providing their username in the 'Action' grey box.&lt;br /&gt;
&lt;br /&gt;
Once you've filled out all these informations, you can go ahead and click the 'Création d'un nouveau ticket' button to create you ticket and voilà !&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=318</id>
		<title>HowTo: Create a Trac ticket</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=318"/>
				<updated>2023-01-25T16:42:21Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== HowTo: Create a Trac ticket == &lt;br /&gt;
&lt;br /&gt;
To create a trac ticket, first check that you are allowed to login to the trac server (so that you can actually write something) then head to&lt;br /&gt;
&lt;br /&gt;
https://trac.lmd.jussieu.fr/LMDZ&lt;br /&gt;
&lt;br /&gt;
Connect to your account, the connection link is in the red menu line on the upper left:&lt;br /&gt;
[[Fichier:Connexion.png|vignette|none]]&lt;br /&gt;
&lt;br /&gt;
Once connected, you should see a new button appear in the main menu line 'Nouveau ticket':&lt;br /&gt;
[[Fichier:Nouveau ticket.png|vignette|néant]]&lt;br /&gt;
&lt;br /&gt;
After clicking the 'Nouveau ticket' button, you will be taken to the following forms page&lt;br /&gt;
[[Fichier:Ticket.png|vignette|néant]]&lt;br /&gt;
which you need to fill out to create your ticket. Items to fill out are&lt;br /&gt;
&lt;br /&gt;
* ''Résumé'' : a one-line description of the problem/bug/enhancement you want the ticket for&lt;br /&gt;
* ''Description'' : a longer description of the problem/bug/enhancement&lt;br /&gt;
* ''Type'' : describes the type of ticket you want to create. Possible values are&lt;br /&gt;
** plantage / defect&lt;br /&gt;
** incoherences&lt;br /&gt;
** vérifications&lt;br /&gt;
** améliorations / enhancements&lt;br /&gt;
** formation / documentation&lt;br /&gt;
* ''Priorité'' : describes the severity or priority you want to assign to your ticket. Possible values are&lt;br /&gt;
** blocker&lt;br /&gt;
** critical&lt;br /&gt;
** major&lt;br /&gt;
** minor&lt;br /&gt;
** trivial&lt;br /&gt;
* ''Composant'' : gives an indication of the LMDZ component that is involved in your report. Possible values are&lt;br /&gt;
** Consolidation&lt;br /&gt;
** Documentation&lt;br /&gt;
** Dynamic core&lt;br /&gt;
** Environnement&lt;br /&gt;
** I/O&lt;br /&gt;
** LMDZ&lt;br /&gt;
** Optimisation&lt;br /&gt;
** Parallelisation&lt;br /&gt;
** Terrestrial Physics&lt;br /&gt;
** Tracers&lt;br /&gt;
&lt;br /&gt;
You can add some keywords in the 'Mots-clés' field and inform other members of the LMDZ team directly of your ticket by inserting their username in the 'Copie à' field. You can also attach some files explaining your problem to your ticket. You can finally assign your new ticket to some other member of the team by switching on the 'assign' button rather than the 'create' button and providing their username in the 'Action' grey box.&lt;br /&gt;
&lt;br /&gt;
Once you've filled out all these informations, you can go ahead and click the 'Création d'un nouveau ticket' button to create you ticket and voilà !&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Ticket.png&amp;diff=317</id>
		<title>Fichier:Ticket.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Ticket.png&amp;diff=317"/>
				<updated>2023-01-25T16:13:02Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Description du formulaire de création d'un nouveau ticket&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Nouveau_ticket.png&amp;diff=316</id>
		<title>Fichier:Nouveau ticket.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Nouveau_ticket.png&amp;diff=316"/>
				<updated>2023-01-25T16:10:15Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Le bouton pour rajouter les tickets&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=315</id>
		<title>HowTo: Create a Trac ticket</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Create_a_Trac_ticket&amp;diff=315"/>
				<updated>2023-01-25T16:07:21Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : Page créée avec « == HowTo: Create a Trac ticket ==   To create a trac ticket, first check that you are allowed to login to the trac server (so that you can actually write something) then h... »&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== HowTo: Create a Trac ticket == &lt;br /&gt;
&lt;br /&gt;
To create a trac ticket, first check that you are allowed to login to the trac server (so that you can actually write something) then head to&lt;br /&gt;
&lt;br /&gt;
https://trac.lmd.jussieu.fr/LMDZ&lt;br /&gt;
&lt;br /&gt;
Connect to your account, the connection link is in the red menu line on the upper left:&lt;br /&gt;
[[Fichier:Connexion.png|vignette]]&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Connexion.png&amp;diff=314</id>
		<title>Fichier:Connexion.png</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Fichier:Connexion.png&amp;diff=314"/>
				<updated>2023-01-25T16:03:31Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Connection to the trac server&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=280</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=280"/>
				<updated>2022-11-16T15:54:32Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=279</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=279"/>
				<updated>2022-11-16T15:52:26Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
*** informatique&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=278</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=278"/>
				<updated>2022-11-16T15:49:08Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
# informatique&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=277</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=277"/>
				<updated>2022-11-16T15:47:21Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
*** informatique&lt;br /&gt;
*** administratif&lt;br /&gt;
*** utilisateur&lt;br /&gt;
*** FAQs&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=258</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=258"/>
				<updated>2022-05-16T13:29:30Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : /* Nudging files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
''For indepth theoretical explanations, see this doc in French (dated 2009, some code détails are obsolete): https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/notes-techniques/ressources/guidage_LMDZ.pdf''&lt;br /&gt;
 &lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
'''''Caution''''': &lt;br /&gt;
&lt;br /&gt;
==== Ne pas confondre constante de rappel et fréquence d'appel au guidage ====&lt;br /&gt;
&lt;br /&gt;
Quand on guide :&lt;br /&gt;
&lt;br /&gt;
# On lit les champs typiquement toutes les 6 heures (suivant la disponibiité des champs de guidage).&lt;br /&gt;
# On interpole linéairement en temps les champs de guidage.&lt;br /&gt;
# On rappelle à chaque pas de temps vers ces champs interpolés avec une constante définie dans guide.def avec les tau_min tau_max.&lt;br /&gt;
&lt;br /&gt;
mais &amp;quot;je nudge à chaque pas de temps&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
To create these files see [[Création des fichiers de guidage et adaptation de l'exécution]]&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
==== Nudging towards the wind zonal mean ====&lt;br /&gt;
&lt;br /&gt;
Quelques précisions :&lt;br /&gt;
&lt;br /&gt;
* Par défaut, on lit un état de guidage 4x / jour, pareil pour l'interpolation sur les niveaux du modèle. Mais ça peut être modifié (paramètres iguide_read, iguide_int).&lt;br /&gt;
* Il y a une option au cas où (guide_2D) pour lire un état de guidage 2D (latitude - Pression) et pas 3D.&lt;br /&gt;
* L'option guide_zon veut dire qu'on a un terme de rappel qui est uniforme suivant les longitudes :&lt;br /&gt;
** on calcule (u-ug) en chaque point&lt;br /&gt;
** puis on fait la moyenne zonale de ce nudging. ug n'est pas forcément symétrique ici, mais comme c'est linéaire...&lt;br /&gt;
Attention aux interférences avec guide_reg, le plus simple étant peut-être&lt;br /&gt;
de commenter les lignes &amp;quot;if guide_reg...&amp;quot; dans la routine guide_zonave.&lt;br /&gt;
Ne pas confondre constante de rappel et fréquence d'appel au guidage&lt;br /&gt;
&lt;br /&gt;
==== Nudging towards surface pressure ====&lt;br /&gt;
&lt;br /&gt;
Il faut probablement restreindre le guidage en pression de surface à l'océan pour éviter d'injecter plein de modes de gravités liés au déséquilibre hydrostatique qui sera nécessairement engendré par le fait que le relief vu par les analyses est différent de celui du modèle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Nudging]]&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=257</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=257"/>
				<updated>2022-05-16T13:27:38Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidage ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE&lt;br /&gt;
 ou (avec ID et mdp) :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/INTERP_NUDGE&lt;br /&gt;
On utilisera interp_from_era.ksh pour fichiers ERA*, ou interp_from_TS.ksh pour séries de temps sorties du modèle.&lt;br /&gt;
Les choix de l'utilisateur se font dans ces scripts, qui lancent automatiquement era2gcm.ksh pour l'interpolation.&lt;br /&gt;
&lt;br /&gt;
(un exemple d'utilisation de CDO pour interpoler les champs se trouve [[https://lmdz.lmd.jussieu.fr/utilisateurs/ressources/interp_from_era_nudging_with_cdo.sh ici]])&lt;br /&gt;
&lt;br /&gt;
3 =&amp;gt; Vérifier l'emplacement, la disponibilité et le droit d'accès aux fichiers non-interpolés (ERA* ou TS). Télécharger les fichiers si besoin.&lt;br /&gt;
&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_*.ksh :&lt;br /&gt;
  4.a =&amp;gt; Adapter les variables en tête du script, dans la section &amp;quot;USER DEFINITION&amp;quot;:&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; etc : les variables a interpoler&lt;br /&gt;
 outdir= répertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= répertoire temporaire&lt;br /&gt;
 (for ERA*) : OutFreq='monthly' ou 'yearly' : fichiers de sortie par mois ou par année&lt;br /&gt;
&lt;br /&gt;
  4.b =&amp;gt; Lancer le script ; par ex :&lt;br /&gt;
   ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Créer/adapter le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activés.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille régulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'intérieur de la zone du zoom et tau_min à l'extérieur de la zone du zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tête de run.def la prise en compte du fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier (ou créer des liens vers) les fichier de guidage interpolés dans le répertoire où le modèle sera lancé, avec des noms génériques : u.nc, v.nc, T.nc, hur.nc ;&lt;br /&gt;
Exemple :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l’exécution ; exemple :&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
2022 mai 13&lt;br /&gt;
[[Category:Guidage]][[Category:Nudging]][[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=256</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=256"/>
				<updated>2022-05-16T13:27:04Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidage ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE&lt;br /&gt;
 ou (avec ID et mdp) :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/INTERP_NUDGE&lt;br /&gt;
On utilisera interp_from_era.ksh pour fichiers ERA*, ou interp_from_TS.ksh pour séries de temps sorties du modèle.&lt;br /&gt;
Les choix de l'utilisateur se font dans ces scripts, qui lancent automatiquement era2gcm.ksh pour l'interpolation.&lt;br /&gt;
&lt;br /&gt;
(un exemple d'utilisation de CDO pour interpoler les champs se trouve [[https://lmdz.lmd.jussieu.fr/utilisateurs/ressources/interp_from_era_nudging_with_cdo.sh/view ici]])&lt;br /&gt;
&lt;br /&gt;
3 =&amp;gt; Vérifier l'emplacement, la disponibilité et le droit d'accès aux fichiers non-interpolés (ERA* ou TS). Télécharger les fichiers si besoin.&lt;br /&gt;
&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_*.ksh :&lt;br /&gt;
  4.a =&amp;gt; Adapter les variables en tête du script, dans la section &amp;quot;USER DEFINITION&amp;quot;:&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; etc : les variables a interpoler&lt;br /&gt;
 outdir= répertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= répertoire temporaire&lt;br /&gt;
 (for ERA*) : OutFreq='monthly' ou 'yearly' : fichiers de sortie par mois ou par année&lt;br /&gt;
&lt;br /&gt;
  4.b =&amp;gt; Lancer le script ; par ex :&lt;br /&gt;
   ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Créer/adapter le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activés.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille régulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'intérieur de la zone du zoom et tau_min à l'extérieur de la zone du zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tête de run.def la prise en compte du fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier (ou créer des liens vers) les fichier de guidage interpolés dans le répertoire où le modèle sera lancé, avec des noms génériques : u.nc, v.nc, T.nc, hur.nc ;&lt;br /&gt;
Exemple :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l’exécution ; exemple :&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
2022 mai 13&lt;br /&gt;
[[Category:Guidage]][[Category:Nudging]][[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=255</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=255"/>
				<updated>2022-05-16T13:21:04Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidage ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE&lt;br /&gt;
 ou (avec ID et mdp) :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/INTERP_NUDGE&lt;br /&gt;
On utilisera interp_from_era.ksh pour fichiers ERA*, ou interp_from_TS.ksh pour séries de temps sorties du modèle.&lt;br /&gt;
Les choix de l'utilisateur se font dans ces scripts, qui lancent automatiquement era2gcm.ksh pour l'interpolation.&lt;br /&gt;
&lt;br /&gt;
3 =&amp;gt; Vérifier l'emplacement, la disponibilité et le droit d'accès aux fichiers non-interpolés (ERA* ou TS). Télécharger les fichiers si besoin.&lt;br /&gt;
&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_*.ksh :&lt;br /&gt;
  4.a =&amp;gt; Adapter les variables en tête du script, dans la section &amp;quot;USER DEFINITION&amp;quot;:&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; etc : les variables a interpoler&lt;br /&gt;
 outdir= répertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= répertoire temporaire&lt;br /&gt;
 (for ERA*) : OutFreq='monthly' ou 'yearly' : fichiers de sortie par mois ou par année&lt;br /&gt;
&lt;br /&gt;
  4.b =&amp;gt; Lancer le script ; par ex :&lt;br /&gt;
   ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Créer/adapter le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activés.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille régulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'intérieur de la zone du zoom et tau_min à l'extérieur de la zone du zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tête de run.def la prise en compte du fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier (ou créer des liens vers) les fichier de guidage interpolés dans le répertoire où le modèle sera lancé, avec des noms génériques : u.nc, v.nc, T.nc, hur.nc ;&lt;br /&gt;
Exemple :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l’exécution ; exemple :&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
2022 mai 13&lt;br /&gt;
[[Category:Guidage]][[Category:Nudging]][[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=254</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=254"/>
				<updated>2022-05-16T13:19:33Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidage ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE&lt;br /&gt;
 ou (avec ID et mdp) :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/INTERP_NUDGE&lt;br /&gt;
On utilisera interp_from_era.ksh pour fichiers ERA*, ou interp_from_TS.ksh pour séries de temps sorties du modèle.&lt;br /&gt;
Les choix de l'utilisateur se font dans ces scripts, qui lancent automatiquement era2gcm.ksh pour l'interpolation.&lt;br /&gt;
&lt;br /&gt;
3 =&amp;gt; Vérifier l'emplacement, la disponibilité et le droit d'accès aux fichiers non-interpolés (ERA* ou TS). Télécharger les fichiers si besoin.&lt;br /&gt;
&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_*.ksh :&lt;br /&gt;
  4.a =&amp;gt; Adapter les variables en tête du script, dans la section &amp;quot;USER DEFINITION&amp;quot;:&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; etc : les variables a interpoler&lt;br /&gt;
 outdir= répertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= répertoire temporaire&lt;br /&gt;
 (for ERA*) : OutFreq='monthly' ou 'yearly' : fichiers de sortie par mois ou par année&lt;br /&gt;
&lt;br /&gt;
  4.b =&amp;gt; Lancer le script ; par ex :&lt;br /&gt;
   ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Créer/adapter le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activés.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille régulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'intérieur de la zone du zoom et tau_min à l'extérieur de la zone du zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tête de run.def la prise en compte du fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier (ou créer des liens vers) les fichier de guidage interpolés dans le répertoire où le modèle sera lancé, avec des noms génériques : u.nc, v.nc, T.nc, hur.nc ;&lt;br /&gt;
Exemple :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l’exécution ; exemple :&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
2022 mai 13&lt;br /&gt;
[[Category:Guidage]][[Category:Nudging]][[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=253</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=253"/>
				<updated>2022-05-16T13:18:16Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidage ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 wget http://forge.ipsl.jussieu.fr/igcmg/browser/TOOLS/INTERP_NUDGE&lt;br /&gt;
 ou (avec ID et mdp) :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/TOOLS/INTERP_NUDGE&lt;br /&gt;
On utilisera interp_from_era.ksh pour fichiers ERA*, ou interp_from_TS.ksh pour séries de temps sorties du modèle.&lt;br /&gt;
Les choix de l'utilisateur se font dans ces scripts, qui lancent automatiquement era2gcm.ksh pour l'interpolation.&lt;br /&gt;
&lt;br /&gt;
3 =&amp;gt; Vérifier l'emplacement, la disponibilité et le droit d'accès aux fichiers non-interpolés (ERA* ou TS). Télécharger les fichiers si besoin.&lt;br /&gt;
&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_*.ksh :&lt;br /&gt;
  4.a =&amp;gt; Adapter les variables en tête du script, dans la section &amp;quot;USER DEFINITION&amp;quot;:&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; etc : les variables a interpoler&lt;br /&gt;
 outdir= répertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= répertoire temporaire&lt;br /&gt;
 (for ERA*) : OutFreq='monthly' ou 'yearly' : fichiers de sortie par mois ou par année&lt;br /&gt;
&lt;br /&gt;
  4.b =&amp;gt; Lancer le script ; par ex :&lt;br /&gt;
   ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Créer/adapter le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
&lt;br /&gt;
[[Category:guidage]]&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activés.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille régulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'intérieur de la zone du zoom et tau_min à l'extérieur de la zone du zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tête de run.def la prise en compte du fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier (ou créer des liens vers) les fichier de guidage interpolés dans le répertoire où le modèle sera lancé, avec des noms génériques : u.nc, v.nc, T.nc, hur.nc ;&lt;br /&gt;
Exemple :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l’exécution ; exemple :&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
2022 mai 13&lt;br /&gt;
[[Category:Guidage]][[Category:Nudging]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=252</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=252"/>
				<updated>2022-05-16T13:16:36Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
''For indepth theoretical explanations, see this doc in French (dated 2009, some code détails are obsolete): https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/notes-techniques/ressources/guidage_LMDZ.pdf''&lt;br /&gt;
 &lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
'''''Caution''''': &lt;br /&gt;
&lt;br /&gt;
==== Ne pas confondre constante de rappel et fréquence d'appel au guidage ====&lt;br /&gt;
&lt;br /&gt;
Quand on guide :&lt;br /&gt;
&lt;br /&gt;
# On lit les champs typiquement toutes les 6 heures (suivant la disponibiité des champs de guidage).&lt;br /&gt;
# On interpole linéairement en temps les champs de guidage.&lt;br /&gt;
# On rappelle à chaque pas de temps vers ces champs interpolés avec une constante définie dans guide.def avec les tau_min tau_max.&lt;br /&gt;
&lt;br /&gt;
mais &amp;quot;je nudge à chaque pas de temps&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
==== Nudging towards the wind zonal mean ====&lt;br /&gt;
&lt;br /&gt;
Quelques précisions :&lt;br /&gt;
&lt;br /&gt;
* Par défaut, on lit un état de guidage 4x / jour, pareil pour l'interpolation sur les niveaux du modèle. Mais ça peut être modifié (paramètres iguide_read, iguide_int).&lt;br /&gt;
* Il y a une option au cas où (guide_2D) pour lire un état de guidage 2D (latitude - Pression) et pas 3D.&lt;br /&gt;
* L'option guide_zon veut dire qu'on a un terme de rappel qui est uniforme suivant les longitudes :&lt;br /&gt;
** on calcule (u-ug) en chaque point&lt;br /&gt;
** puis on fait la moyenne zonale de ce nudging. ug n'est pas forcément symétrique ici, mais comme c'est linéaire...&lt;br /&gt;
Attention aux interférences avec guide_reg, le plus simple étant peut-être&lt;br /&gt;
de commenter les lignes &amp;quot;if guide_reg...&amp;quot; dans la routine guide_zonave.&lt;br /&gt;
Ne pas confondre constante de rappel et fréquence d'appel au guidage&lt;br /&gt;
&lt;br /&gt;
==== Nudging towards surface pressure ====&lt;br /&gt;
&lt;br /&gt;
Il faut probablement restreindre le guidage en pression de surface à l'océan pour éviter d'injecter plein de modes de gravités liés au déséquilibre hydrostatique qui sera nécessairement engendré par le fait que le relief vu par les analyses est différent de celui du modèle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Nudging]]&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=251</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=251"/>
				<updated>2022-05-16T13:13:02Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
''For indepth theoretical explanations, see this doc in French (dated 2009, some code détails are obsolete): https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/notes-techniques/ressources/guidage_LMDZ.pdf''&lt;br /&gt;
 &lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
'''''Caution''''': &lt;br /&gt;
&lt;br /&gt;
==== Ne pas confondre constante de rappel et fréquence d'appel au guidage ====&lt;br /&gt;
&lt;br /&gt;
Quand on guide :&lt;br /&gt;
&lt;br /&gt;
# On lit les champs typiquement toutes les 6 heures (suivant la disponibiité des champs de guidage).&lt;br /&gt;
# On interpole linéairement en temps les champs de guidage.&lt;br /&gt;
# On rappelle à chaque pas de temps vers ces champs interpolés avec une constante définie dans guide.def avec les tau_min tau_max.&lt;br /&gt;
&lt;br /&gt;
mais &amp;quot;je nudge à chaque pas de temps&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Nudging towards the wind zonal mean ==&lt;br /&gt;
&lt;br /&gt;
Quelques précisions :&lt;br /&gt;
&lt;br /&gt;
* Par défaut, on lit un état de guidage 4x / jour, pareil pour l'interpolation sur les niveaux du modèle. Mais ça peut être modifié (paramètres iguide_read, iguide_int).&lt;br /&gt;
* Il y a une option au cas où (guide_2D) pour lire un état de guidage 2D (latitude - Pression) et pas 3D.&lt;br /&gt;
* L'option guide_zon veut dire qu'on a un terme de rappel qui est uniforme suivant les longitudes :&lt;br /&gt;
** on calcule (u-ug) en chaque point&lt;br /&gt;
** puis on fait la moyenne zonale de ce nudging. ug n'est pas forcément symétrique ici, mais comme c'est linéaire...&lt;br /&gt;
Attention aux interférences avec guide_reg, le plus simple étant peut-être&lt;br /&gt;
de commenter les lignes &amp;quot;if guide_reg...&amp;quot; dans la routine guide_zonave.&lt;br /&gt;
Ne pas confondre constante de rappel et fréquence d'appel au guidage&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Nudging]]&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=250</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=250"/>
				<updated>2022-05-16T13:06:05Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
''For indepth theoretical explanations, see this doc in French (dated 2009, some code détails are obsolete): https://lmdz.lmd.jussieu.fr/le-coin-des-developpeurs/notes-techniques/ressources/guidage_LMDZ.pdf''&lt;br /&gt;
 &lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
'''''Caution''''': &lt;br /&gt;
&lt;br /&gt;
=== Ne pas confondre constante de rappel et fréquence d'appel au guidage ===&lt;br /&gt;
&lt;br /&gt;
Quand on guide :&lt;br /&gt;
&lt;br /&gt;
# On lit les champs typiquement toutes les 6 heures (suivant la disponibiité des champs de guidage).&lt;br /&gt;
# On interpole linéairement en temps les champs de guidage.&lt;br /&gt;
# On rappelle à chaque pas de temps vers ces champs interpolés avec une constante définie dans guide.def avec les tau_min tau_max.&lt;br /&gt;
&lt;br /&gt;
mais &amp;quot;je nudge à chaque pas de temps&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Nudging]]&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=227</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=227"/>
				<updated>2022-05-02T08:58:14Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data files created in the previous step to analyze the code coverage&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types of outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
  ....&lt;br /&gt;
  %BASE_LD              -Wl,-rpath=/data/fairhead/Test_coverage/LMDZ20211102.trunk/netcdf-4.0.1/lib  '''-pg -lgcov'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler. They're created where the source files were actually compiled.&lt;br /&gt;
            &lt;br /&gt;
to create html files with the prefix &amp;lt;code&amp;gt;gcm_details&amp;lt;/code&amp;gt;  and the name of the routine included in the file. Each file in your code will have a corresponding html file giving the usage for each line of the routine included in that file.&lt;br /&gt;
&lt;br /&gt;
You'll find [[https://web.lmd.jussieu.fr/~fairhead/Labo/LMDZ_Coverage/sequential/example-html-details.html here]] an example of the output for the actual LMDZ code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=226</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=226"/>
				<updated>2022-04-29T11:56:58Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data files created in the previous step to analyze the code coverage&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types of outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler. They're created where the source files were actually compiled.&lt;br /&gt;
            &lt;br /&gt;
to create html files with the prefix &amp;lt;code&amp;gt;gcm_details&amp;lt;/code&amp;gt;  and the name of the routine included in the file. Each file in your code will have a corresponding html file giving the usage for each line of the routine included in that file.&lt;br /&gt;
&lt;br /&gt;
You'll find [[https://web.lmd.jussieu.fr/~fairhead/Labo/LMDZ_Coverage/sequential/example-html-details.html here]] an example of the output for the actual LMDZ code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=225</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=225"/>
				<updated>2022-04-29T11:54:29Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data files created in the previous step to analyze the code coverage&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types of outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler. They're created where the source files were actually compiled             &lt;br /&gt;
to create html files with the prefix &amp;lt;code&amp;gt;gcm_details&amp;lt;/code&amp;gt;  and the name of the routine included in the file. Each file in your code will have a corresponding html file giving the usage for each line of the routine included in that file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=224</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=224"/>
				<updated>2022-04-29T11:53:05Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data files created in the previous step to analyze the code coverage&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types of outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler               &lt;br /&gt;
to create html files with the prefix &amp;lt;code&amp;gt;gcm_details&amp;lt;/code&amp;gt;  and the name of the routine included in the file. Each file in your code will have a corresponding html file giving the usage for each line of the routine included in that file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=223</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=223"/>
				<updated>2022-04-28T15:41:19Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : /* HowTo: Using the GNU coverage tool gcov with LMDZ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data file created in the previous step&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types os outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler               &lt;br /&gt;
to create html files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=222</id>
		<title>HowTo: Using gcov (the GNU coverage tool) with LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=HowTo:_Using_gcov_(the_GNU_coverage_tool)_with_LMDZ&amp;diff=222"/>
				<updated>2022-04-28T15:41:02Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : Page créée avec « == HowTo: Using the GNU coverage tool gcov with LMDZ ==  If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU h... »&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== HowTo: Using the GNU coverage tool gcov with LMDZ ==&lt;br /&gt;
&lt;br /&gt;
If you want a summary of the lines (and branches) in your code that are actually executed, you can use the GNU [[https://gcc.gnu.org/onlinedocs/gcc/Gcov.html coverage tool]]. This entails the following three steps:&lt;br /&gt;
&lt;br /&gt;
# compiling your code with the right options&lt;br /&gt;
# running the code to output the statistics that gcov will analyze&lt;br /&gt;
# running gcov on the data file created in the previous step&lt;br /&gt;
&lt;br /&gt;
=== Running gcov on LMDZ ===&lt;br /&gt;
&lt;br /&gt;
We will be using [[https://gcovr.com/en/stable/ gcovr]] a utility using gcov and providing different types os outputs&lt;br /&gt;
&lt;br /&gt;
'''''Compiling LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You will need to add the following flags to your compilation flags in the arch.fcm.file:&lt;br /&gt;
&lt;br /&gt;
  %BASE_FFLAGS          -cpp -ffree-line-length-0 -fdefault-real-8 -DNC_DOUBLE '''-pg --coverage -fprofile-arcs -ftest-coverage -fprofile-abs-path'''&lt;br /&gt;
&lt;br /&gt;
'''''Running LMDZ'''''&lt;br /&gt;
&lt;br /&gt;
You just run gcm.e as you usually do. This will create a bunch of gcda and gcno files that are used by gcov in the following step&lt;br /&gt;
&lt;br /&gt;
'''''Running gcovr'''''&lt;br /&gt;
&lt;br /&gt;
You then launch the gcovr command as &lt;br /&gt;
 gcovr -r . -v --html-details gcm_details libo/local_32x32x39_phylmd_seq.e/.config/tmp/&lt;br /&gt;
                                          ^&lt;br /&gt;
                                          this is where the gcda and gcno files are saved by the compiler               &lt;br /&gt;
to create html files&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HowTo]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=ExempleMaths&amp;diff=219</id>
		<title>ExempleMaths</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=ExempleMaths&amp;diff=219"/>
				<updated>2022-04-06T15:16:30Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- some LaTeX macros we want to use: --&amp;gt;&lt;br /&gt;
$$\newcommand{\Re}{\mathrm{Re}\,}&lt;br /&gt;
\newcommand{\pFq}[5]{{}_{#1}\mathrm{F}_{#2} \left( \genfrac{}{}{0pt}{}{#3}{#4} \bigg| {#5} \right)}$$&lt;br /&gt;
&lt;br /&gt;
We consider, for various values of $$s$$, the $$n$$-dimensional integral&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{def:Wns}&lt;br /&gt;
  W_n (s)&lt;br /&gt;
  &amp;amp;:= &lt;br /&gt;
  \int_{[0, 1]^n} &lt;br /&gt;
    \left| \sum_{k = 1}^n \mathrm{e}^{2 \pi \mathrm{i} \, x_k} \right|^s \mathrm{d}\boldsymbol{x}&lt;br /&gt;
\end{align}&lt;br /&gt;
which occurs in the theory of uniform random walk integrals in the plane, &lt;br /&gt;
where at each step a unit-step is taken in a random direction.  As such, &lt;br /&gt;
the integral \eqref{def:Wns} expresses the $$s$$-th moment of the distance &lt;br /&gt;
to the origin after $$n$$ steps.&lt;br /&gt;
&lt;br /&gt;
By experimentation and some sketchy arguments we quickly conjectured and &lt;br /&gt;
strongly believed that, for $$k$$ a nonnegative integer&lt;br /&gt;
\begin{align}&lt;br /&gt;
  \label{eq:W3k}&lt;br /&gt;
  W_3(k) &amp;amp;= \Re \, \pFq32{\frac12, -\frac k2, -\frac k2}{1, 1}{4}.&lt;br /&gt;
\end{align}&lt;br /&gt;
Appropriately defined, \eqref{eq:W3k} also holds for negative odd integers. &lt;br /&gt;
The reason for \eqref{eq:W3k} was  long a mystery, but it will be explained &lt;br /&gt;
at the end of the paper.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;fortran&amp;quot;&amp;gt;&lt;br /&gt;
   PROGRAM Truc&lt;br /&gt;
   IMPLICIT NONE&lt;br /&gt;
   DO i = 1, iim&lt;br /&gt;
     DO j = 1, jjm&lt;br /&gt;
       .....&lt;br /&gt;
     END DO&lt;br /&gt;
   END DO&lt;br /&gt;
   END PROGRAM&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=218</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=218"/>
				<updated>2022-04-04T08:47:23Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=217</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=217"/>
				<updated>2022-04-04T08:44:04Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* TRUCMUCH&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
* SEARCH&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=216</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=216"/>
				<updated>2022-04-04T08:43:37Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* trucmuch&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
* SEARCH&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=215</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=215"/>
				<updated>2022-04-04T08:43:03Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* trucmuch&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
* search&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=214</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=214"/>
				<updated>2022-04-04T08:42:22Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* search&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=213</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=213"/>
				<updated>2022-04-04T08:42:09Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=212</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=212"/>
				<updated>2022-04-04T08:41:34Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
** trucmuche&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=211</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=211"/>
				<updated>2022-04-04T08:41:04Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=210</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=210"/>
				<updated>2022-04-04T08:40:33Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* trucmuche&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=209</id>
		<title>MediaWiki:Sidebar</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=MediaWiki:Sidebar&amp;diff=209"/>
				<updated>2022-04-04T08:39:55Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : Page créée avec «  * SEARCH * navigation ** mainpage|mainpage-description ** recentchanges-url|recentchanges ** randompage-url|randompage ** helppage|help-mediawiki * SEARCH * TOOLBOX * LAN... »&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
* SEARCH&lt;br /&gt;
* navigation&lt;br /&gt;
** mainpage|mainpage-description&lt;br /&gt;
** recentchanges-url|recentchanges&lt;br /&gt;
** randompage-url|randompage&lt;br /&gt;
** helppage|help-mediawiki&lt;br /&gt;
* SEARCH&lt;br /&gt;
* TOOLBOX&lt;br /&gt;
* LANGUAGES&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=206</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=206"/>
				<updated>2022-03-28T09:05:52Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Guidage]][[Category:Nuging]][[Category:Guidage/Nuging]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=205</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=205"/>
				<updated>2022-03-28T09:05:00Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Guidage]][[Category:Nuging]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=204</id>
		<title>Nudging in LMDZ</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Nudging_in_LMDZ&amp;diff=204"/>
				<updated>2022-03-28T08:57:51Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The concept ==&lt;br /&gt;
Nudging is simply adding a forcing term to the GFD equation governing a variable $$V$$ to drive it towards a known value $$V_{analysis}$$ over a given time scale $$\tau$$:&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{\partial V}{\partial t} = \frac{\partial V}{\partial t}_{GCM} + \frac{V_{analysis}-V}{\tau}&lt;br /&gt;
\end{align}&lt;br /&gt;
Where $$V$$ can be zonal wind u, meridional wind v, relative humidity Q, pressure P or temperature T&lt;br /&gt;
&lt;br /&gt;
Nudging is often used in conjunction with zoomed configurations, where strong nudging towards reanalyses in enforced outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging parameters in LMDZ ==&lt;br /&gt;
The master parameter to turn nudging on is ''ok_guide'' (most often all nudging parameters are put in a '''guide.def''' file included in '''run.def''') which must be set to &amp;quot;y&amp;quot; (or equivalently &amp;quot;.true.&amp;quot;):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ok_guide = y&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(&amp;quot;guide&amp;quot; means &amp;quot;nudge&amp;quot; in French).&lt;br /&gt;
&lt;br /&gt;
Then one must select which fields will be nudged via the ''guide_*'' parameters:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_u=y&lt;br /&gt;
guide_v=y&lt;br /&gt;
guide_T=y&lt;br /&gt;
guide_P=n&lt;br /&gt;
guide_Q=n&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the example above, nudging is done on horizontal winds (u,v) and on temperature (T) only.&lt;br /&gt;
&lt;br /&gt;
In addition, the user must provide two time scales $\tau$, for each of the nudged variables; one for the inner zoom area ''tau_max_*'' and another relative to outside the zoomed area ''tau_min_*''. These time scales are stated in unit of days, e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tau_min_u= 0.0208333&lt;br /&gt;
tau_max_u= 10.&lt;br /&gt;
tau_min_v= 0.0208333&lt;br /&gt;
tau_max_v= 10.&lt;br /&gt;
tau_min_T= 0.0208333&lt;br /&gt;
tau_max_T= 10.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this example all 3 variables are nudged with a time scale of 10 days, i.e very loosely, within the zoomed region and a time scale of 30 minutes (30.*60/86400.= 0.0208333), i.e. very strongly, outside the zoomed region.&lt;br /&gt;
&lt;br /&gt;
== Nudging files ==&lt;br /&gt;
In addition to stating which variable is nudged and the related time scales, one must provide the fields towards which to nudge (these must be on the same grid as the simulation and must be created separately, e.g. using a re-interpolation of ERA-interim files). These files must be in the directory where LMDZ runs and must be called ''u.nc'', ''v.nc'', ''T.nc'', etc.&lt;br /&gt;
&lt;br /&gt;
== Nudging contribution output ==&lt;br /&gt;
One can request that the nudging term be stored in an output file, '''guide_ins.nc''' by setting (in guide.def):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
guide_sav=y&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
14/12/2021&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=201</id>
		<title>Création des fichiers de guidage et adaptation de l'exécution</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cr%C3%A9ation_des_fichiers_de_guidage_et_adaptation_de_l%27ex%C3%A9cution&amp;diff=201"/>
				<updated>2022-03-28T08:44:36Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Créer les fichiers de guidages ==&lt;br /&gt;
&lt;br /&gt;
1 =&amp;gt; Créer le fichier grilles_gcm.nc avec ce0l. Pour cela, avant de lancer ce0l, ajouter dans run.def :&lt;br /&gt;
 grilles_gcm_netcdf=y&lt;br /&gt;
2 =&amp;gt; Extraire les scripts pour interpolation de fichiers de guidage :&lt;br /&gt;
 svn co http://forge.ipsl.jussieu.fr/igcmg/svn/CONFIG/LMDZOR/branches/LMDZOR_v4/CREATE/SCRIPT&lt;br /&gt;
3 =&amp;gt; Recuperer les fichiers ERAI non-interpolé&lt;br /&gt;
4 =&amp;gt; Interpoler avec interp_from_era.ksh. D'abord adapter qq variables en tete du script :&lt;br /&gt;
 gridfile=chemin pour grilles_gcm.nc&lt;br /&gt;
 indir= ou se trouver les fichier era-i&lt;br /&gt;
 varlist=&amp;quot;u v&amp;quot; : les variables a interpoler&lt;br /&gt;
 outdir= repertoire de resultats&lt;br /&gt;
 first_year=2011&lt;br /&gt;
 last_year=2011&lt;br /&gt;
 rundir= repertoire temporaire&lt;br /&gt;
  &lt;br /&gt;
 ./interp_from_era.ksh&lt;br /&gt;
&lt;br /&gt;
== Adapter le run ==&lt;br /&gt;
&lt;br /&gt;
5 =&amp;gt; Crée le fichier guide.def, par exemple :&lt;br /&gt;
 ## debut guide.def&lt;br /&gt;
 # ok_guide=y : guidage active&lt;br /&gt;
 ok_guide=y&lt;br /&gt;
&lt;br /&gt;
[[Category:guidage]]&lt;br /&gt;
[[Category:HowTo]]&lt;br /&gt;
 &lt;br /&gt;
 guide_u= y&lt;br /&gt;
 guide_v= y&lt;br /&gt;
 guide_T= n&lt;br /&gt;
 guide_P= n&lt;br /&gt;
 guide_Q= n&lt;br /&gt;
 &lt;br /&gt;
 tau_min_u=0.0208333&lt;br /&gt;
 tau_max_u=0.125&lt;br /&gt;
 tau_min_v=0.0208333&lt;br /&gt;
 tau_max_v=0.125&lt;br /&gt;
 ## fin guide.def&lt;br /&gt;
&lt;br /&gt;
Remarque :&amp;lt;br/&amp;gt;&lt;br /&gt;
Ici, dans ce guide.def, uniquement le guidage des variables u et v sont activé.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille regulière, la valeur tau_max est utilisé, ici tau_max=0.125 =&amp;gt; 3H.&amp;lt;br/&amp;gt;&lt;br /&gt;
Temps de relaxation, pour une grille zoomée, la valeur tau_max est utilisé à l'interieure de la zoom et tau_min à l'exterieur de la zoom, ici tau_min=0.0208333 =&amp;gt; 30min.&amp;lt;br/&amp;gt;&lt;br /&gt;
Plus le temps de relaxation(tau) est petit, plus le guidage est fort..&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
6 =&amp;gt; Ajouter en tete de run.def la prise en compte de la fichier guide.def :&lt;br /&gt;
 INCLUDEDEF=guide.def&lt;br /&gt;
&lt;br /&gt;
7 =&amp;gt; Copier les fichier interpolé u_201101_erai.nc en u.nc et v_201101_erai.nc v.nc dans le repertoire où le modèle sera lancer :&lt;br /&gt;
 ln -s ERAI_interp/2011/u_201101_erai.nc u.nc&lt;br /&gt;
 ln -s ERAI_interp/2011/v_201101_erai.nc v.nc&lt;br /&gt;
&lt;br /&gt;
8 =&amp;gt; Lancer l'execution&lt;br /&gt;
 ./gcm.e &amp;gt; out_guide 2&amp;gt;&amp;amp;1&lt;br /&gt;
&lt;br /&gt;
[[Category:Guidage]]&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	<entry>
		<id>http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cat%C3%A9gorie:ExpertDev&amp;diff=145</id>
		<title>Catégorie:ExpertDev</title>
		<link rel="alternate" type="text/html" href="http://lmdz-forge.lmd.jussieu.fr/mediawiki/LMDZPedia/index.php?title=Cat%C3%A9gorie:ExpertDev&amp;diff=145"/>
				<updated>2021-11-16T14:36:50Z</updated>
		
		<summary type="html">&lt;p&gt;Lfairhead : Page créée avec « Useful information for experts and developpers »&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Useful information for experts and developpers&lt;/div&gt;</summary>
		<author><name>Lfairhead</name></author>	</entry>

	</feed>