source: CONFIG/IPSLCM/IPSLCM5/branches/IPSLCM5_v3/EXP00/COMP/pisces.driver @ 972

Last change on this file since 972 was 972, checked in by cetlod, 12 years ago

Cleaning of card and driver for NEMO-TOP

  • deleting useless *.noiomput card and driver
  • simplification of pisces.driver and opa9.driver
  • update pisces.card to store new diag file ( *dbio_T.nc)
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 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    ##-- Update namelist_top and namelist_pisces
63
64    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
65        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
66        namelist_top > namelist_top.tmp
67
68    IGCM_sys_Mv namelist_top.tmp namelist_top
69
70    sed -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
71        namelist_pisces > namelist_pisces.tmp
72
73    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
74
75
76    IGCM_debug_PopStack "MBG_Update"
77}
78
79#-----------------------------------
80function MBG_Finalize
81{
82    IGCM_debug_PushStack "MBG_Finalize"
83
84    echo FINALIZE MBG !!!
85
86    IGCM_debug_PopStack "MBG_Finalize"
87}
88
Note: See TracBrowser for help on using the repository browser.