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

Last change on this file since 3210 was 3210, checked in by cetlod, 7 years ago

Minor correction for NEMO_v6 configurations

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