source: CONFIG/IPSLCM/IPSLCM5B/piControl/COMP/pisces.driver @ 1511

Last change on this file since 1511 was 1511, checked in by lfairhead, 13 years ago

Changes to the IPSLCM5B picontrol configuration to:

  • update it with respect to the IPSLCM5A picontrol configuration
  • take into account the NP physics LMDZ package
File size: 2.5 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    ##--Variables used by OPA --
14
15
16    ##--Variables used by MBG --
17
18    # ln_rsttr  boolean term for tracer model restart (true or false)
19    # nrsttr    control of the time step (0, 1 or 2)
20   
21    ##--Variables used by PISCES --
22 
23    PAT_TOP_LRSTTR=$( supergrep ln_rsttr          ${SUBMIT_DIR}/PARAM/namelist_top_${RESOL_OCE} )
24    PAT_TOP_NRSTTR=$( supergrep nrsttr            ${SUBMIT_DIR}/PARAM/namelist_top_${RESOL_OCE} )
25    PAT_PIS_LRIVER=$( supergrep ln_river          ${SUBMIT_DIR}/PARAM/namelist_pisces_${RESOL_OCE} )
26
27    IGCM_debug_PopStack "MBG_Initialize"
28}
29
30#-----------------------------------
31function MBG_Update
32{
33    IGCM_debug_PushStack "MBG_Update"
34
35    ##-- Restart configuration
36    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
37
38        #echo "NO RESTART FOR TOP"
39        TOP_LRSTTR=.FALSE.
40        TOP_NRSTTR=0
41
42        PISCES_LRIVER=.FALSE.
43
44    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
45
46        #echo "RESTART TOP"
47        TOP_LRSTTR=.TRUE.
48        TOP_NRSTTR=0
49
50        PISCES_LRIVER=.TRUE.
51
52    else
53
54        #echo "RESTART TOP"
55        TOP_LRSTTR=.TRUE.
56        TOP_NRSTTR=2
57
58        PISCES_LRIVER=.TRUE.
59
60    fi
61
62    ##-- Enable dbio output file
63    DBIO_ENABLE=".FALSE." 
64    eval pisces_DBIO_ENABLE=\${pisces_UserChoices_DBIO_ENABLE} > /dev/null 2>&1
65    if [ "${pisces_DBIO_ENABLE}" = "y" ]; then
66        DBIO_ENABLE=".TRUE."
67    fi
68
69    # update iodef.xml
70
71    echo 'Informations into iodef.xml : DBIO_ENABLE'
72    echo ${DBIO_ENABLE}
73
74    sed -e "s/<DBIO_ENABLE>/${DBIO_ENABLE}/" \
75        iodef.xml > iodef.xml.tmp
76
77    IGCM_sys_Mv iodef.xml.tmp iodef.xml
78
79    ##-- Update namelist_top and namelist_pisces
80
81    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
82        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
83        namelist_top > namelist_top.tmp
84
85    IGCM_sys_Mv namelist_top.tmp namelist_top
86
87    sed -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
88        namelist_pisces > namelist_pisces.tmp
89
90    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
91
92
93    IGCM_debug_PopStack "MBG_Update"
94}
95
96#-----------------------------------
97function MBG_Finalize
98{
99    IGCM_debug_PushStack "MBG_Finalize"
100
101    echo FINALIZE MBG !!!
102
103    IGCM_debug_PopStack "MBG_Finalize"
104}
105
Note: See TracBrowser for help on using the repository browser.