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

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

Now have one run_icosa.def per resolution of NBP.

File size: 2.5 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    # Add include of context xml files for DYNAMICO in iodef.xml
35    # In iodef.xml add on the next line after "COMPONENT CONTEXT"
36    echo '<context id="icosagcm" src="./context_dynamico.xml"/>' >> add.tmp
37
38    # Add inclusion of file context_input_dynamico.xml if this file exists
39    if [ -f context_input_dynamico.xml ] ; then
40        echo '<context id="icosagcm" src="./context_input_dynamico.xml"/>' >> add.tmp
41    fi
42
43    # Include xml files for output configuration if running with workflow CMIP6
44    if [ X"$( echo ${config_UserChoices_ExpType} | grep CMIP6 )" != "X" ] ; then
45      if [ -f ping_dynamico.xml ] ; then
46        echo '<context id="icosagcm" src="./ping_dynamico.xml"/>' >> add.tmp
47        echo '<context id="icosagcm" src="./dr2xml_dynamico.xml"/>' >> add.tmp
48      fi
49    fi
50    cp iodef.xml iodef.xml.tmp
51    sed -e "/COMPONENT CONTEXT/r add.tmp" iodef.xml.tmp > iodef.xml
52    rm iodef.xml.tmp add.tmp
53
54    # Add a Long Name as global attribute in output files if LongName is set in config.card
55    if [ ! "X${config_UserChoices_LongName}" = "X" ] ; then
56      listfile=$(ls file_def*dynamico.xml)
57      echo "<variable id=\"LongName\" type=\"string\">${config_UserChoices_LongName}</variable>" > add.tmp
58      for file in ${listfile} ; do
59          cp ${file} ${file}.tmp
60          sed -e "/<file id/r add.tmp" \
61          ${file}.tmp > ${file}
62          rm ${file}.tmp
63      done
64      rm add.tmp
65    fi
66
67    IGCM_debug_PopStack "ICO_Update"
68}
69
70#-----------------------------------
71function ICO_Finalize
72{
73    IGCM_debug_PushStack "ICO_Finalize"
74
75    IGCM_debug_PopStack "ICO_Finalize"
76}
77
Note: See TracBrowser for help on using the repository browser.