source: branches/UKMO/r6232_tracer_advection/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/IGCM00/COMP/pisces.driver @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 3 years ago

Remove svn keywords

File size: 3.0 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    # lrsttr    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 )
21    PAT_TOP_NRSTTR=$( supergrep nrsttr                   ${SUBMIT_DIR}/PARAM/namelist_top )
22    PAT_PIS_LRIVER=$( supergrep ln_river                 ${SUBMIT_DIR}/PARAM/namelist_pisces )
23
24    IGCM_debug_PopStack "MBG_Initialize"
25}
26
27#-----------------------------------
28function MBG_Update
29{
30    IGCM_debug_PushStack "MBG_Update"
31
32
33    ##--Write Frequency Purpose
34    Nbfreq=$( echo ${config_MBG_WriteFrequency} | wc -w )
35    typeset -Z1 i=1
36    while [ $i -le ${Nbfreq} ]; do
37       topfrequency=$( echo ${config_MBG_WriteFrequency} | awk -v var="$i" "-F " '{print $var}' )
38       topfactor=$( echo ${topfrequency} | sed -e "s/[yYmMdD]//" )
39       case ${topfrequency} in
40         *Y|*y)
41            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}y_${DatesPeriod} ;
42            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_Y} ;
43            eval WFT${i}=${topfactor}Y ;;
44         *M|*m)
45            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}m_${DatesPeriod} ;
46            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_M} ;
47            eval WFT${i}=${topfactor}M ;;
48         *D|*d)
49            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}d_${DatesPeriod} ;
50            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_D} ;
51            eval WFT${i}=${topfactor}D ;;
52         *)
53      esac
54       let i=$i+1
55    done
56
57    ##-- Restart configuration
58    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
59
60        #echo "NO RESTART FOR TOP"
61        TOP_LRSTTR=.FALSE.
62        TOP_NRSTTR=0
63
64        PISCES_LRIVER=.FALSE.
65
66    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
67
68        #echo "RESTART TOP"
69        TOP_LRSTTR=.TRUE.
70        TOP_NRSTTR=0
71
72        PISCES_LRIVER=.TRUE.
73
74    else
75
76        #echo "RESTART TOP"
77        TOP_LRSTTR=.TRUE.
78        TOP_NRSTTR=2
79
80        PISCES_LRIVER=.TRUE.
81
82    fi
83
84# on force les sorties PISCES comme les sorties OPA
85
86    sed -e "s%${PAT_TOP_LRSTTR}%          ln_rsttr=${TOP_LRSTTR}%"                   \
87        -e "s%${PAT_TOP_NRSTTR}%          nrsttr=${TOP_NRSTTR}%"                   \
88        namelist_top > namelist_top.tmp
89
90    IGCM_sys_Mv namelist_top.tmp namelist_top
91
92    sed -e "s%${PAT_PIS_LRIVER}%          ln_river=${PISCES_LRIVER}%"                \
93        namelist_pisces > namelist_pisces.tmp
94
95    IGCM_sys_Mv namelist_pisces.tmp namelist_pisces
96
97
98    IGCM_debug_PopStack "MBG_Update"
99}
100
101#-----------------------------------
102function MBG_Finalize
103{
104    IGCM_debug_PushStack "MBG_Finalize"
105
106    echo FINALIZE MBG !!!
107
108    IGCM_debug_PopStack "MBG_Finalize"
109}
110
Note: See TracBrowser for help on using the repository browser.