source: CONFIG/UNIFORM/v7/ICOLMDZOR_v7/GENERAL/DRIVER/dynamico.driver @ 4281

Last change on this file since 4281 was 4281, checked in by jgipsl, 2 years ago

Update config:

  • Before the component ATM was used for DYNAMCIO-LMDZphysics together. Now they have been seperated in 2 components: ICO for the icosahedral part which is here DYNAMCIO. ATM is kept for LMDZ phyiscs. Note that when running without DYNMACIO, the component ICO is not present and the component ATM represents both LMDZ dynamics and physics.
  • lmdz.driver and lmdz.card are copied from LMDZOR_v6.2. Small changes are done to work with or without DYNAMCIO.
  • .def files for LMDZ are copied from LMDZOR_v6.2
File size: 3.2 KB
Line 
1#!/bin/ksh
2#-----------------------------------------------------------------
3function ICO_Initialize
4{
5    IGCM_debug_PushStack "ICO_Initialize"
6
7    ##- Horizontal resolution read from dynamic.card
8    if [ ! X${dynamico_UserChoices_RESOL_NBP} = X ] ; then
9        RESOL_NBP=${dynamico_UserChoices_RESOL_NBP}
10    else
11        # Set default resolution
12        RESOL_NBP=20
13    fi
14
15    ##- Horizontal resolution read from dynamico.card
16    if [ ! X${dynamico_UserChoices_RESOL_ATM_Z} = X ] ; then
17        RESOL_ATM_Z=${dynamico_UserChoices_RESOL_ATM_Z}
18    else
19        # RESOL_ATM_Z is not set in dynamico.card but this is needed
20        IGCM_debug_Exit "RESOL_ATM_Z must be set in dynamico.card UserSection"
21        IGCM_debug_Verif_Exit
22    fi
23
24    IGCM_debug_PopStack "ICO_Initialize"
25}
26
27#-----------------------------------------------------------------
28function ICO_Update
29{
30    IGCM_debug_PushStack "ICO_Update"
31
32    IGCM_comp_modifyDefFile blocker run_icosa.def run_length $(( ${PeriodLengthInDays} * 86400 ))
33
34    if [ X${RESOL_NBP} == X40 ] || [ X${RESOL_NBP} == X20 ]; then
35      IGCM_comp_modifyDefFile nonblocker run_icosa.def   nbp       ${RESOL_NBP}
36      IGCM_comp_modifyDefFile nonblocker run_icosa.def   nsplit_i  $(( ${RESOL_NBP} / 10 ))
37      IGCM_comp_modifyDefFile nonblocker run_icosa.def   nsplit_j  $(( ${RESOL_NBP} / 10 ))
38      IGCM_comp_modifyDefFile nonblocker run_icosa.def   llm       79
39      IGCM_debug_Print 1 "Maximum nubmer of MPI for resolution nbp=${RESOL_NBP} is $(( ${RESOL_NBP} * ${RESOL_NBP} / 10 ))"
40    else
41      IGCM_debug_Print 1 "nbp=${RESOL_NBP} is set in dynamico.card"
42      IGCM_debug_Exit "This resolution has not been prepared in dynamico.driver" 
43      IGCM_debug_Verif_Exit
44    fi
45
46
47    # Add include of context xml files for DYNAMICO in iodef.xml
48    # In iodef.xml add on the next line after "COMPONENT CONTEXT"
49    echo '<context id="icosagcm" src="./context_dynamico.xml"/>' >> add.tmp
50
51    # Add inclusion of file context_input_dynamico.xml if this file exists
52    if [ -f context_input_dynamico.xml ] ; then
53        echo '<context id="icosagcm" src="./context_input_dynamico.xml"/>' >> add.tmp
54    fi
55
56    # Include xml files for output configuration if running with workflow CMIP6
57    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then
58      if [ -f ping_dynamico.xml ] ; then
59        echo '<context id="icosagcm" src="./ping_dynamico.xml"/>' >> add.tmp
60        echo '<context id="icosagcm" src="./dr2xml_dynamico.xml"/>' >> add.tmp
61      fi
62    fi
63    cp iodef.xml iodef.xml.tmp
64    sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml
65    rm iodef.xml.tmp add.tmp
66
67    # Add a Long Name as global attribute in output files if LongName is set in config.card
68    if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then
69      listfile=$(ls file_def*dynamico.xml)
70      echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp
71      for file in ${listfile} ; do
72          cp ${file} ${file}.tmp
73          sed -e "/<file id/r add.tmp" \
74          ${file}.tmp > ${file}
75          rm ${file}.tmp
76      done
77      rm add.tmp
78    fi
79
80    IGCM_debug_PopStack "ICO_Update"
81}
82
83#-----------------------------------
84function ICO_Finalize
85{
86    IGCM_debug_PushStack "ICO_Finalize"
87
88    IGCM_debug_PopStack "ICO_Finalize"
89}
90
Note: See TracBrowser for help on using the repository browser.