source: CONFIG/UNIFORM/v6/NEMO_v6/GENERAL/DRIVER/pisces.driver @ 2871

Last change on this file since 2871 was 2871, checked in by cetlod, 6 years ago

Change time-step for NEMO ORCA1 configuration

  • Property svn:executable set to *
File size: 4.9 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    if [ X"${pisces_UserChoices_Offline_Mode}" = X"y" ] ; then
14       RESOL_OCE=$( echo ${config_UserChoices_ExperimentName} | cut -c1-5 )
15       EXPTYPE=$( echo ${config_UserChoices_ExperimentName} | cut -c6- )
16       OPA_RDT=$( supergrep rn_rdt  ${SUBMIT_DIR}/PARAM/namelist_${RESOL_OCE}${EXPTYPE}_offline_cfg | sed 's/ *rn_rdt *=//' | sed 's/\. *,//' )
17       # Period Length In Days between DateBegin and first day of calendar 0001 01 01
18       # /!\ Needed by OPA namelist to compute file names /!\
19       (( DaysSinceJC = $( IGCM_date_DaysSinceJC ${DateBegin} ) + 1 ))
20
21       (( OPA_NDT_DAY  =  86400 / OPA_RDT ))
22       (( OPA_NPDT_YEAR  =  OPA_NPDT_DAY * 365     ))
23     fi
24
25    IGCM_debug_PopStack "MBG_Initialize"
26}
27
28#-----------------------------------
29function MBG_Update
30{
31    IGCM_debug_PushStack "MBG_Update"
32
33
34    ##--Write Frequency Purpose
35    Nbfreq=$( echo ${config_MBG_WriteFrequency} | wc -w )
36    typeset -Z1 i=1
37    while [ $i -le ${Nbfreq} ]; do
38       topfrequency=$( echo ${config_MBG_WriteFrequency} | awk -v var="$i" "-F " '{print $var}' )
39       topfactor=$( echo ${topfrequency} | sed -e "s/[yYmMdD]//" )
40       case ${topfrequency} in
41         *Y|*y)
42            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}y_${DatesPeriod} ;
43            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_Y} ;
44            eval WFT${i}=${topfactor}Y ;;
45         *M|*m)
46            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}m_${DatesPeriod} ;
47            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_M} ;
48            eval WFT${i}=${topfactor}M ;;
49         *D|*d)
50            eval PREFIX_WFT${i}=${config_UserChoices_JobName}_${topfactor}d_${DatesPeriod} ;
51            eval R_OUT_MBG_WFT${i}=${R_OUT_MBG_O_D} ;
52            eval WFT${i}=${topfactor}D ;;
53         *)
54      esac
55       let i=$i+1
56    done
57
58    if [ X"${pisces_UserChoices_Offline_Mode}" = X"y" ] ; then
59
60
61       # Period Length In Days between DateBegin and first day of calendar 0001 01 01
62       # Needed by OPA namelist to compute correct file names
63       (( PeriodDaysSinceJC =  $( IGCM_date_DaysSinceJC ${PeriodDateBegin} ) + 1  ))
64
65       ## Count of number of time steps from begin of OPA job
66       (( OPA_NIT000 = ( PeriodDaysSinceJC - DaysSinceJC ) * OPA_NDT_DAY + 1 ))
67       (( OPA_NDT   = PeriodLengthInDays * OPA_NDT_DAY ))
68       (( OPA_NITEND = OPA_NIT000 + OPA_NDT - 1))
69
70       ## Forcing to write one restart file at the end of period
71       OPA_NSTOCK="${OPA_NITEND}"
72
73       ## Verification of number of time steps per day
74       (( NB_SEC_DAY_MODEL = OPA_NDT_DAY * OPA_RDT ))
75       (( NB_SEC_DAY = 60 * 60 * 24 ))
76
77       if [ ${NB_SEC_DAY_MODEL} -ne ${NB_SEC_DAY} ] ; then
78           echo " NB_SEC_DAY_MODEL "${NB_SEC_DAY_MODEL} "NB_SEC_DAY" ${NB_SEC_DAY} "OPA_NDT_DAY" ${OPA_NDT_DAY} "OPA_RDT" ${OPA_RDT}
79           echo " VERIFY OPA_NDT_DAY in opa9.card "
80           exit
81       fi
82       
83       # nleapy configuration
84       case ${config_UserChoices_CalendarType} in
85           leap)
86               OPA_NLEAPY=1;;
87           noleap)
88               OPA_NLEAPY=0;;
89           360d)
90               OPA_NLEAPY=30;;
91       esac
92
93       typeset -r PRECIS=8
94       NEMO_END=$( echo $( awk "BEGIN { printf \"%0${PRECIS}d\",${OPA_NITEND} }" ) )
95    fi
96
97    ##-- Restart configuration
98    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "n" ] ) ; then
99
100        #echo "NO RESTART FOR TOP"
101        TOP_LRSTTR=.FALSE.
102        TOP_NRSTTR=0
103
104    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_MBG_Restart}" = "y" ] ) ; then
105
106        #echo "RESTART TOP"
107        TOP_LRSTTR=.TRUE.
108        TOP_NRSTTR=0
109
110    else
111
112        #echo "RESTART TOP"
113        TOP_LRSTTR=.TRUE.
114        TOP_NRSTTR=2
115
116    fi
117
118# on force les sorties PISCES comme les sorties OPA
119    if [ X"${pisces_UserChoices_Offline_Mode}" = X"y" ] ; then
120      IGCM_comp_modifyNamelist blocker    namelist_cfg cn_exp    ${config_UserChoices_JobName}
121      IGCM_comp_modifyNamelist blocker    namelist_cfg nn_it000  ${OPA_NIT000}
122      IGCM_comp_modifyNamelist blocker    namelist_cfg nn_itend  ${OPA_NITEND}
123      IGCM_comp_modifyNamelist blocker    namelist_cfg nn_stock ${OPA_NSTOCK}
124      IGCM_comp_modifyNamelist blocker    namelist_cfg nn_date0 ${PeriodDateBegin}
125      IGCM_comp_modifyNamelist blocker    namelist_cfg nn_leapy  ${OPA_NLEAPY}
126   fi
127
128   IGCM_comp_modifyNamelist blocker    namelist_top_cfg ln_rsttr  ${TOP_LRSTTR}
129   IGCM_comp_modifyNamelist blocker    namelist_top_cfg nn_rsttr  ${TOP_NRSTTR}
130   IGCM_comp_modifyNamelist blocker    namelist_pisces_cfg  nn_pisdmp  ${OPA_NPDT_YEAR}
131
132   IGCM_debug_PopStack "MBG_Update"
133}
134
135#-----------------------------------
136function MBG_Finalize
137{
138    IGCM_debug_PushStack "MBG_Finalize"
139
140    echo FINALIZE MBG !!!
141
142    IGCM_debug_PopStack "MBG_Finalize"
143}
144
Note: See TracBrowser for help on using the repository browser.