source: CONFIG/UNIFORM/v6/NEMO_v6.5/GENERAL/DRIVER/trc.driver

Last change on this file was 6601, checked in by cetlod, 10 months ago

NEMOv6.5 : Update config to switch to NEMOv4.2.1 and PISCES gas

File size: 4.2 KB
Line 
1#!/bin/ksh
2
3#-----------------------------------
4function MBG_Initialize
5{ 
6    IGCM_debug_PushStack "MBG_Initialize"
7
8# Local function to find namelists parameters
9supergrep () {
10    grep "^ *$1 *=" $2 | sed -e "s% *\!.*%%"
11}
12
13    IGCM_debug_PopStack "MBG_Initialize"
14}
15
16#-----------------------------------
17function MBG_Update
18{
19    IGCM_debug_PushStack "MBG_Update"
20
21   
22    ##--Write Frequency for iomput
23    ## Differents frequencies are allowed for MBG files
24
25    VT1D_ENABLE=".FALSE."
26    VT5D_ENABLE=".FALSE."
27    VT1M_ENABLE=".FALSE."
28    VT1Y_ENABLE=".FALSE."
29
30    for frequency in ${config_MBG_WriteFrequency} ; do
31        case ${frequency} in
32            ( 1D|1d ) VT1D_ENABLE=".TRUE." ;;
33            ( 5D|5d ) VT5D_ENABLE=".TRUE." ;;
34            ( 1M|1m ) VT1M_ENABLE=".TRUE." ;;
35            ( *[yY] ) VT1Y_ENABLE=".TRUE." ;;
36        esac
37    done
38
39    ##-- Restart configuration
40    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
41
42        #echo "NO RESTART FOR TOP"
43        TOP_LRSTTR=.FALSE.
44        TOP_NRSTTR=0
45
46    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
47
48        #echo "RESTART TOP"
49        TOP_LRSTTR=.TRUE.
50        TOP_NRSTTR=0
51
52    else
53
54        #echo "RESTART TOP"
55        TOP_LRSTTR=.TRUE.
56        TOP_NRSTTR=2
57    fi
58
59   if [ X"${trc_UserChoices_age}" = X"y" ] ; then
60      echo "Activate age tracer"
61      TOP_AGE=.TRUE.
62      IGCM_comp_modifyXmlFile force file_def_nemo-top.xml file38 enabled .TRUE.
63   else
64      TOP_AGE=.FALSE.
65   fi
66##
67   if [ X"${trc_UserChoices_cfc11}" = X"y" ] ; then
68      echo "Activate CFC11  tracer"
69      TOP_CFC11=.TRUE.
70      IGCM_comp_modifyXmlFile force file_def_nemo-top.xml file39 enabled .TRUE.
71   else
72      TOP_CFC11=.FALSE.
73   fi
74##
75   if [ X"${trc_UserChoices_cfc12}" = X"y" ] ; then
76      echo "Activate CFC12  tracer"
77      TOP_CFC12=.TRUE.
78      IGCM_comp_modifyXmlFile force file_def_nemo-top.xml file40 enabled .TRUE.
79   else
80      TOP_CFC12=.FALSE.
81   fi
82##
83   if [ X"${trc_UserChoices_sf6}" = X"y" ] ; then
84      echo "Activate SF6  tracer"
85      TOP_SF6=.TRUE.
86      IGCM_comp_modifyXmlFile force file_def_nemo-top.xml file41 enabled .TRUE.
87   else
88      TOP_SF6=.FALSE.
89   fi
90##
91  if [ X"${trc_UserChoices_c14}" = X"y" ] ; then
92      echo "Activate RC14  tracer"
93      TOP_C14=.TRUE.
94      IGCM_comp_modifyXmlFile force file_def_nemo-top.xml file42 enabled .TRUE.
95   else
96      TOP_C14=.FALSE.
97   fi
98
99##
100   ##-- Update namelist_top_cfg and namelist_trc_cfg
101    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_rsttr  ${TOP_LRSTTR}
102    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     nn_rsttr  ${TOP_NRSTTR}
103    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_age    ${TOP_AGE}
104    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_cfc11  ${TOP_CFC11}
105    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_cfc12  ${TOP_CFC12}
106    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_sf6    ${TOP_SF6}
107    IGCM_comp_modifyNamelist blocker    namelist_top_cfg     ln_c14    ${TOP_C14}
108 
109    # Update iodef.xml
110
111    IGCM_debug_Print 1 'Informations into iodef.xml : VT1D_ENABLE VT5D_ENABLE VT1M_ENABLE VT1Y_ENABLE '
112    IGCM_debug_Print 1 ${VT1D_ENABLE}  ${VT5D_ENABLE} ${VT1M_ENABLE} ${VT1Y_ENABLE}
113
114    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1d_pis enabled ${VT1D_ENABLE}
115    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 5d_pis enabled ${VT5D_ENABLE}
116    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1m_pis enabled ${VT1M_ENABLE}
117    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1y_pis enabled ${VT1Y_ENABLE}
118
119    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1d_pis output_level ${trc_UserChoices_OutputLevel}
120    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 5d_pis output_level ${trc_UserChoices_OutputLevel}
121    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1m_pis output_level ${trc_UserChoices_OutputLevel}
122    IGCM_comp_modifyXmlFile nonblocker file_def_nemo-top.xml 1y_pis output_level ${trc_UserChoices_OutputLevel}
123
124
125
126   IGCM_debug_PopStack "MBG_Update"
127}
128
129#-----------------------------------
130function MBG_Finalize
131{
132    IGCM_debug_PushStack "MBG_Finalize"
133
134    echo FINALIZE MBG !!!
135
136    IGCM_debug_PopStack "MBG_Finalize"
137}
138
Note: See TracBrowser for help on using the repository browser.