source: CMIP5/rcp45/v5.rcp85NP1/COMP/pisces.driver @ 1656

Last change on this file since 1656 was 1656, checked in by lfairhead, 12 years ago

v5.rcp45NP1 registration of CMIP5 IPSL
IPSLCM5B configuration rcp85 simulation

File size: 2.4 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_ATCCO2=$( supergrep atcco2            ${SUBMIT_DIR}/PARAM/namelist_pisces_${RESOL_OCE} )
26    PAT_PIS_LRIVER=$( supergrep ln_river          ${SUBMIT_DIR}/PARAM/namelist_pisces_${RESOL_OCE} )
27
28    IGCM_debug_PopStack "MBG_Initialize"
29}
30
31#-----------------------------------
32function MBG_Update
33{
34    IGCM_debug_PushStack "MBG_Update"
35
36    ##-- Restart configuration
37    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
38
39        #echo "NO RESTART FOR TOP"
40        TOP_LRSTTR=.FALSE.
41        TOP_NRSTTR=0
42
43        PISCES_LRIVER=.FALSE.
44
45    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
46
47        #echo "RESTART TOP"
48        TOP_LRSTTR=.TRUE.
49        TOP_NRSTTR=0
50
51        PISCES_LRIVER=.TRUE.
52
53    else
54
55        #echo "RESTART TOP"
56        TOP_LRSTTR=.TRUE.
57        TOP_NRSTTR=2
58
59        PISCES_LRIVER=.TRUE.
60
61    fi
62
63    ##-- GHG forcing for the current year
64    IPCC_PIS_CO2=`grep Annee_${year} CO2_1765_2500.txt | awk -F= '{print $2}'`
65
66    ##-- Update namelist_top and namelist_pisces
67
68    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
69        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
70        namelist_top > namelist_top.tmp
71
72    IGCM_sys_Mv namelist_top.tmp namelist_top
73
74    sed -e "s%${PAT_PIS_ATCCO2}%          atcco2=${IPCC_PIS_CO2}%"                \
75        -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
76        namelist_pisces > namelist_pisces.tmp
77
78    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
79
80
81    IGCM_debug_PopStack "MBG_Update"
82}
83
84#-----------------------------------
85function MBG_Finalize
86{
87    IGCM_debug_PushStack "MBG_Finalize"
88
89    echo FINALIZE MBG !!!
90
91    IGCM_debug_PopStack "MBG_Finalize"
92}
93
Note: See TracBrowser for help on using the repository browser.