Changes between Version 45 and Version 46 of Doc/Config/LMDZORINCA


Ignore:
Timestamp:
02/15/24 17:11:30 (4 months ago)
Author:
klaurent
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Doc/Config/LMDZORINCA

    v45 v46  
    241241Do not forget to install a new Job (command ins_job) in order to take into account these modifications. 
    242242 
     243## How to add a parameter in the inca.card and use it in the code ## 
     244If you want to add a parameter in COMP/inca.card, you have to add lines at two different places. 
     245 
     2461. In your configuration repository (for example, modipsl/config/LMDZORINCA/) 
     247  a. First, change the driver file (GENERAL/DRIVER/inca.driver ou name_of_your_simulation/DRIVER/inca.driver) by adding these lines in the group {{{function CHM_Update}}}: 
     248{{{ 
     249    if [ ! X${inca_UserChoices_NameOfParameter} = X ] ; then 
     250        IGCM_comp_modifyDefFile nonblocker inca.def  NameOfParameter ${inca_UserChoices_NameOfParameter} 
     251    else 
     252        IGCM_comp_modifyDefFile nonblocker inca.def  NameOfParameter DEFAULT 
     253    fi 
     254}}} 
     255  b. Then, you can add the parameter in the PARAM/inca.def:  
     256{{{ 
     257NameOfParameter=_AUTO_: DEFAULT =1.0 
     258}}} 
     259  c. Finally, you can add it in the file COMP/inca.card: 
     260{{{ 
     261NameOfParameter=1.2 
     262}}} 
     263 
     2642. In the source code of INCA (modipsl/modeles/INCA/src) 
     265  a. In INCA_MOD/param_chem_mod.F90, add two lines at the end as follow: 
     266{{{ 
     267  REAL, SAVE :: NameOfParameter    !! add a comment if needed 
     268!$OMP THREADPRIVATE(NameOfParameter)  
     269}}} 
     270  b. In INCA_SRC/conf_chem.F90, add these lines: 
     271    * In the beginning: 
     272{{{ 
     273  REAL :: NameOfParameter_omp 
     274}}} 
     275    * In the {{{!$OMP MASTER}}} part 
     276{{{ 
     277  ! default value for NameOfParameter 
     278  NameOfParameter_omp=1.0 
     279  ! reading in inca.def if define 
     280  CALL getin('NameOfParameter', NameOfParameter_omp) 
     281}}} 
     282    * After the {{{!$OMP BARRIER}}} line 
     283{{{ 
     284  CALL bcast(NameOfParameter_omp) 
     285  NameOfParameter = NameOfParameter_omp 
     286}}} 
     287  c. Now, you can use your parameter in the code. Make sure that the module {{{PARAM_CHEM}}} is used at the beginning of your subroutine.