source: CMIP5/abrupt4xCO2/abrupt4xCO22/COMP/pisces.driver @ 1103

Last change on this file since 1103 was 1103, checked in by mafoipsl, 14 years ago

abrupt4xCO22 IPSL CMIP5 simulation registration.

File size: 2.1 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 MBG --
14
15    # ln_rsttr  boolean term for tracer model restart (true or false)
16    # nrsttr    control of the time step (0, 1 or 2)
17   
18    ##--Variables used by PISCES --
19 
20    PAT_TOP_LRSTTR=$( supergrep ln_rsttr          ${SUBMIT_DIR}/PARAM/namelist_top_${RESOL_OCE} )
21    PAT_TOP_NRSTTR=$( supergrep nrsttr            ${SUBMIT_DIR}/PARAM/namelist_top_${RESOL_OCE} )
22    PAT_PIS_LRIVER=$( supergrep ln_river          ${SUBMIT_DIR}/PARAM/namelist_pisces_${RESOL_OCE} )
23
24    IGCM_debug_PopStack "MBG_Initialize"
25}
26
27#-----------------------------------
28function MBG_Update
29{
30    IGCM_debug_PushStack "MBG_Update"
31
32    ##-- Restart configuration
33    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
34
35        #echo "NO RESTART FOR TOP"
36        TOP_LRSTTR=.FALSE.
37        TOP_NRSTTR=0
38
39        PISCES_LRIVER=.FALSE.
40
41    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
42
43        #echo "RESTART TOP"
44        TOP_LRSTTR=.TRUE.
45        TOP_NRSTTR=0
46
47        PISCES_LRIVER=.TRUE.
48
49    else
50
51        #echo "RESTART TOP"
52        TOP_LRSTTR=.TRUE.
53        TOP_NRSTTR=2
54
55        PISCES_LRIVER=.TRUE.
56
57    fi
58
59    ##-- Update namelist_top and namelist_pisces
60
61    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
62        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
63        namelist_top > namelist_top.tmp
64
65    IGCM_sys_Mv namelist_top.tmp namelist_top
66
67    sed -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
68        namelist_pisces > namelist_pisces.tmp
69
70    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
71
72
73    IGCM_debug_PopStack "MBG_Update"
74}
75
76#-----------------------------------
77function MBG_Finalize
78{
79    IGCM_debug_PushStack "MBG_Finalize"
80
81    echo FINALIZE MBG !!!
82
83    IGCM_debug_PopStack "MBG_Finalize"
84}
85
Note: See TracBrowser for help on using the repository browser.