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

Last change on this file since 4288 was 4288, checked in by jgipsl, 5 years ago
  • Moved variables related to the vertical discretization from run_dynamico.def to vert.def. Added comments in vert.def so it will be clear which variables are read by LMDZ and which are read by DYNMAICO.
  • Variables create_etat0_limit, etat0 and iflag_phys are now managed through dynamico.card and dynamico.driver. Default values are the same as before.
  • Removed read_start only read by the LMDZ/dynmaics.
File size: 3.8 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    # Change run_dynamico.def according to UserChoices options set in dynmaico.card
35   
36    # Activate create_etat0_limit
37    if [ X${dynamico_UserChoices_create_etat0_limit} = Xy ] ; then 
38        # create_etat0_limit is set in dynamcio.card to y
39        IGCM_comp_modifyDefFile nonblocker run_dynamico.def create_etat0_limit y
40
41        # Use iflag_phys=101 or higher to activate aquaplanet mode
42        if [ X${dynamico_UserChoices_iflag_phys} = X ] ||  X${dynamico_UserChoices_iflag_phys} = X1 ]; then 
43            # iflag_phys is not set or iflag_phys=1 => run is not an aquaplanet
44            IGCM_comp_modifyDefFile nonblocker run_dynamico.def etat0              database
45            IGCM_comp_modifyDefFile nonblocker run_dynamico.def iflag_phys         1
46        else
47            # This is an aquaplanet
48            IGCM_comp_modifyDefFile nonblocker run_dynamico.def etat0              held_suarez
49            IGCM_comp_modifyDefFile nonblocker run_dynamico.def iflag_phys         ${dynamico_UserChoices_iflag_phys}
50        fi
51    else
52        # Deactivate create_etat0_limit
53        IGCM_comp_modifyDefFile nonblocker run_dynamico.def create_etat0_limit   n
54        IGCM_comp_modifyDefFile nonblocker run_dynamico.def etat0                start_file
55        # iflag_phys is read but not used when running with DYNAMCIO and create_etat0_limit=n
56        IGCM_comp_modifyDefFile nonblocker run_dynamico.def iflag_phys           1
57    fi 
58
59
60    # Add include of context xml files for DYNAMICO in iodef.xml
61    # In iodef.xml add on the next line after "COMPONENT CONTEXT"
62    echo '<context id="icosagcm" src="./context_dynamico.xml"/>' >> add.tmp
63
64    # Add inclusion of file context_input_dynamico.xml if this file exists
65    if [ -f context_input_dynamico.xml ] ; then
66        echo '<context id="icosagcm" src="./context_input_dynamico.xml"/>' >> add.tmp
67    fi
68
69    # Include xml files for output configuration if running with workflow CMIP6
70    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then
71      if [ -f ping_dynamico.xml ] ; then
72        echo '<context id="icosagcm" src="./ping_dynamico.xml"/>' >> add.tmp
73        echo '<context id="icosagcm" src="./dr2xml_dynamico.xml"/>' >> add.tmp
74      fi
75    fi
76    cp iodef.xml iodef.xml.tmp
77    sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml
78    rm iodef.xml.tmp add.tmp
79
80    # Add a Long Name as global attribute in output files if LongName is set in config.card
81    if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then
82      listfile=$(ls file_def*dynamico.xml)
83      echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp
84      for file in ${listfile} ; do
85          cp ${file} ${file}.tmp
86          sed -e "/<file id/r add.tmp" \
87          ${file}.tmp > ${file}
88          rm ${file}.tmp
89      done
90      rm add.tmp
91    fi
92
93    IGCM_debug_PopStack "ICO_Update"
94}
95
96#-----------------------------------
97function ICO_Finalize
98{
99    IGCM_debug_PushStack "ICO_Finalize"
100
101    IGCM_debug_PopStack "ICO_Finalize"
102}
103
Note: See TracBrowser for help on using the repository browser.