- Timestamp:
- 2009-09-21T11:28:25+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libIGCM/ORCA2_LIM_PISCES/IGCM00/COMP/opa9.driver
r1379 r1631 7 7 JOB_NAME=${config_UserChoices_JobName} 8 8 9 if [ -z "${opa_UserChoices_OPA_NDT_DAY}" ] ; then 10 OPA_NDT_DAY=15 11 else 12 OPA_NDT_DAY=${opa_UserChoices_OPA_NDT_DAY} 13 fi 9 OPA_NDT_DAY=${opa_UserChoices_OPA_NDT_DAY:=15} 10 14 11 15 12 ##--Variables used by OPA -- 16 13 17 # c experexperience name for vairmer format18 # n it000 number of the first time step19 # n itend number of the last time step20 # n leapy leap year calendar (0/1) (30 for 360d)21 # n write frequency of OUTPUT file14 # cn_exp experience name for vairmer format 15 # nn_it000 number of the first time step 16 # nn_itend number of the last time step 17 # nn_leapy leap year calendar (0/1) (30 for 360d) 18 # nn_write frequency of OUTPUT file 22 19 # ln_rstart boolean term for restart (true or false) 23 # nstock frequency of restart file 24 # nrstdt control of the time step (0, 1 or 2) 25 # ndate0 initial calendar date aammjj 26 # nmsh =1 create a mesh file (coordinates, scale factors, masks) 20 # nn_stock frequency of restart file 21 # nn_rstctl control of the time step (0, 1 or 2) 22 # nn_date0 initial calendar date aammjj 23 # nn_msh =1 create a mesh file (coordinates, scale factors, masks) 24 # rn_rdt time step in seconds (coming from namelist) 25 # nf_ptr_wri frequency of zonal means and transport output 26 27 27 28 28 # Local function to find namelists parameters … … 32 32 33 33 34 PAT_CEXPER=$( supergrep c exper${SUBMIT_DIR}/PARAM/namelist )35 PAT_NIT000=$( supergrep n it000 ${SUBMIT_DIR}/PARAM/namelist )36 PAT_NITEND=$( supergrep n itend ${SUBMIT_DIR}/PARAM/namelist )37 PAT_NLEAPY=$( supergrep n leapy ${SUBMIT_DIR}/PARAM/namelist )38 PAT_NWRITE=$( supergrep n write ${SUBMIT_DIR}/PARAM/namelist )34 PAT_CEXPER=$( supergrep cn_exp ${SUBMIT_DIR}/PARAM/namelist ) 35 PAT_NIT000=$( supergrep nn_it000 ${SUBMIT_DIR}/PARAM/namelist ) 36 PAT_NITEND=$( supergrep nn_itend ${SUBMIT_DIR}/PARAM/namelist ) 37 PAT_NLEAPY=$( supergrep nn_leapy ${SUBMIT_DIR}/PARAM/namelist ) 38 PAT_NWRITE=$( supergrep nn_write ${SUBMIT_DIR}/PARAM/namelist ) 39 39 PAT_RESTAR=$( supergrep ln_rstart ${SUBMIT_DIR}/PARAM/namelist ) 40 PAT_NSTOCK=$( supergrep nstock ${SUBMIT_DIR}/PARAM/namelist ) 41 PAT_NRSTAR=$( supergrep nrstdt ${SUBMIT_DIR}/PARAM/namelist ) 42 PAT_NDATE0=$( supergrep ndate0 ${SUBMIT_DIR}/PARAM/namelist ) 43 PAT_NMSH=$( supergrep nmsh ${SUBMIT_DIR}/PARAM/namelist ) 44 45 OPA_RDT=$( supergrep rdt ${SUBMIT_DIR}/PARAM/namelist | sed 's/ *rdt *=//' | sed 's/\. *,//' ) 40 PAT_NSTOCK=$( supergrep nn_stock ${SUBMIT_DIR}/PARAM/namelist ) 41 PAT_NRSTAR=$( supergrep nn_rstctl ${SUBMIT_DIR}/PARAM/namelist ) 42 PAT_NDATE0=$( supergrep nn_date0 ${SUBMIT_DIR}/PARAM/namelist ) 43 PAT_NMSH=$( supergrep nn_msh ${SUBMIT_DIR}/PARAM/namelist ) 44 PAT_NF_PTR=$( supergrep nf_ptr_wri ${SUBMIT_DIR}/PARAM/namelist ) 45 46 47 OPA_RDT=$( supergrep rn_rdt ${SUBMIT_DIR}/PARAM/namelist | sed 's/ *rn_rdt *=//' | sed 's/\. *,//' ) 46 48 47 49 # Period Length In Days between DateBegin and first day of calendar 0001 01 01 … … 49 51 (( DaysSinceJC = $( IGCM_date_DaysSinceJC ${DateBegin} ) + 1 )) 50 52 53 # Definition from opa9.card of List_jobsbc and List_runsbc used to do to interannual and climatological runs 54 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/COMP/opa9.card Interannual List_jobsbc 55 IGCM_card_DefineArrayFromOption ${SUBMIT_DIR}/COMP/opa9.card Interannual List_runsbc 56 set -A ListFormulationJobsbc -- \${opa9_Interannual_Listjobsc${opa9_Interannual_List_jobsbc}[*]} 57 set -A ListFormulationRunsbc -- \${opa9_Interannual_Listrunsbc${opa9_Interannual_List_runsbc}[*]} 58 51 59 IGCM_debug_PopStack "OCE_Initialize" 52 60 } … … 55 63 function OCE_Update 56 64 { 57 ### set -vx58 65 IGCM_debug_PushStack "OCE_Update" 66 67 # Interannual run 68 # In this case job need to calculate previous and following year and give, and if every run needs to add "_y" before every year 69 if [ X${opa9_UserChoices_Interannual_Run} = Xy ] ; then 70 71 typeset file fileo 72 73 eval NbFileInter=${#opa9_Interannual_List_jobsbc[*]} 74 75 (( i = 0 )) 76 while [ $i -lt ${NbFileInter} ] ; do 77 eval file=${opa9_Interannual_List_jobsbc[$i]} 78 eval jobsbc_file_ym1=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_$(( year - 1 )).nc 79 eval jobsbc_file_y=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_${year}.nc 80 eval jobsbc_file_yp1=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}_$(( year + 1 )).nc 81 # Copy of List_jobsbc in List_runsbc if this last one is empty 82 if [ X${opa9_Interannual_List_runsbc[0]} = X${NULL_STR} ] ; then 83 eval fileo=${opa9_Interannual_List_jobsbc[$i]} 84 eval runsbc_file_ym1=${file}_y$(( year - 1 )).nc 85 eval runsbc_file_y=${file}_y${year}.nc 86 eval runsbc_file_yp1=${file}_y$(( year + 1 )).nc 87 else 88 eval fileo=${opa9_Interannual_List_runsbc[$i]} 89 eval runsbc_file_ym1=${fileo}_y$(( year - 1 )).nc 90 eval runsbc_file_y=${fileo}_y${year}.nc 91 eval runsbc_file_yp1=${fileo}_y$(( year + 1 )).nc 92 fi 93 94 if [ X${Period} = X1 ] ; then 95 if [ ${month} -eq 01 ] ; then 96 IGCM_sys_Get ${jobsbc_file_ym1} ${runsbc_file_ym1} 97 fi 98 if [ ! -f ${runsbc_file_y} ] ; then 99 IGCM_sys_Get ${jobsbc_file_y} ${runsbc_file_y} 100 fi 101 if [ ! -f ${runsbc_file_yp1} ] ; then 102 IGCM_sys_Get ${jobsbc_file_yp1} ${runsbc_file_yp1} 103 fi 104 else 105 if [ ! -f ${runsbc_file_yp1} ] ; then 106 IGCM_sys_Get ${jobsbc_file_yp1} ${runsbc_file_yp1} 107 fi 108 fi 109 110 (( i = i + 1 )) 111 done 112 # End interannual 113 elif [ X${opa9_UserChoices_Interannual_Run} = Xn ] ; then 114 # Climatological run 115 typeset file fileo 116 117 eval NbFileInter=${#opa9_Interannual_List_jobsbc[*]} 118 119 (( i = 0 )) 120 while [ $i -lt ${NbFileInter} ] ; do 121 eval file=${opa9_Interannual_List_jobsbc[$i]} 122 eval jobsbc_file=${R_BC}/OCE/${config_UserChoices_TagName}/${opa9_UserChoices_OPA_version}/${file}.nc 123 if [ X${opa9_Interannual_List_runsbc[0]} = X${NULL_STR} ] ; then 124 eval fileo=${opa9_Interannual_List_jobsbc[$i]} 125 eval runsbc_file=${fileo}.nc 126 else 127 eval fileo=${opa9_Interannual_List_runsbc[$i]} 128 eval runsbc_file=${fileo}.nc 129 fi 130 131 IGCM_sys_Get ${jobsbc_file} ${runsbc_file} 132 (( i = i + 1 )) 133 done 134 fi 135 # End climatological 59 136 60 137 NbFreq=$( echo ${config_OCE_WriteFrequency} | wc -w ) … … 98 175 OPA_NSTOCK="${OPA_NITEND}" 99 176 100 ## Verification of number of time step in aday177 ## Verification of number of time steps per day 101 178 (( NB_SEC_DAY_MODEL = OPA_NDT_DAY * OPA_RDT )) 102 179 (( NB_SEC_DAY = 60 * 60 * 24 )) … … 104 181 if [ ${NB_SEC_DAY_MODEL} -ne ${NB_SEC_DAY} ] 105 182 then 106 echo " VERIF IER OPA_NDT_DAY dans le job ${JOB}"183 echo " VERIFY OPA_NDT_DAY in opa9.card " 107 184 exit 108 185 fi … … 111 188 if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_OCE_Restart}" = "n" ] ) ; then 112 189 113 #echo " PAS DE RESTART OPA"190 #echo "NO OPA RESTART" 114 191 OPA_LRSTAR=.FALSE. 115 192 OPA_NRSTDT=0 116 # echo pas de meshmask en parallele193 #Put OPA_NMSH=0 when OPA runnig in parallel mode 117 194 OPA_NMSH=1 118 195 ( [ X${BATCH_NUM_PROC_TOT} != X ] && [ "${BATCH_NUM_PROC_TOT}" -gt 1 ] ) && OPA_NMSH=0 … … 120 197 elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_OCE_Restart}" = "y" ] ) ; then 121 198 122 #echo " RESTART OPA"199 #echo "OPA RESTART" 123 200 OPA_LRSTAR=.TRUE. 124 201 OPA_NRSTDT=1 … … 127 204 else 128 205 129 #echo " RESTART OPA"206 #echo "OPA RESTART" 130 207 OPA_LRSTAR=.TRUE. 131 208 OPA_NRSTDT=2 … … 133 210 134 211 fi 135 212 213 ## nleapy configuration 136 214 case ${config_UserChoices_CalendarType} in 137 215 leap) … … 147 225 NEMO_END=$( echo $( awk "BEGIN { printf \"%0${PRECIS}d\",${OPA_NITEND} }" ) ) 148 226 149 sed -e "s%${PAT_CEXPER}% cexper=\"${config_UserChoices_JobName}\"%" \ 150 -e "s%${PAT_NIT000}% nit000=${OPA_NIT000}%" \ 151 -e "s%${PAT_NITEND}% nitend=${OPA_NITEND}%" \ 152 -e "s%${PAT_NLEAPY}% nleapy=${OPA_NLEAPY}%" \ 153 -e "s%${PAT_NWRITE}% nwrite=${OPA_NWRITE}%" \ 227 sed -e "s%${PAT_CEXPER}% cn_exp=\"${config_UserChoices_JobName}\"%" \ 228 -e "s%${PAT_NIT000}% nn_it000=${OPA_NIT000}%" \ 229 -e "s%${PAT_NITEND}% nn_itend=${OPA_NITEND}%" \ 230 -e "s%${PAT_NWRITE}% nn_write=${OPA_NWRITE}%" \ 154 231 -e "s%${PAT_RESTAR}% ln_rstart=${OPA_LRSTAR}%" \ 155 -e "s%${PAT_NSTOCK}% nstock=${OPA_NSTOCK}%" \ 156 -e "s%${PAT_NRSTAR}% nrstdt=${OPA_NRSTDT}%" \ 157 -e "s%${PAT_NDATE0}% ndate0=${PeriodDateBegin}%" \ 158 -e "s%${PAT_NMSH}% nmsh=${OPA_NMSH}%" \ 232 -e "s%${PAT_NSTOCK}% nn_stock=${OPA_NSTOCK}%" \ 233 -e "s%${PAT_NRSTAR}% nn_rstctl=${OPA_NRSTDT}%" \ 234 -e "s%${PAT_NDATE0}% nn_date0=${PeriodDateBegin}%" \ 235 -e "s%${PAT_NMSH}% nn_msh=${OPA_NMSH}%" \ 236 -e "s%${PAT_NLEAPY}% nn_leapy=${OPA_NLEAPY}%" \ 237 -e "s%${PAT_NF_PTR}% nf_ptr_wri=${OPA_NWRITE}%" \ 159 238 namelist > namelist.tmp 160 239 … … 173 252 174 253 if [ -f date.file ] ; then 175 # Prefix use in opa.card AND in lim .card :254 # Prefix use in opa.card AND in lim2.card : 176 255 DATE_OPA=$( cat date.file | \ 177 256 sed "s/\ ${config_UserChoices_JobName}_[0-9]*[a-z]_\([0-9]*_[0-9]*\)_\ */\1/g" ) 178 ###DATE_OPA=$( $DATE_OPABF | cut -c1-30 )257 ###DATE_OPA=$( $DATE_OPABF | cut -c1-30 ) 179 258 MainPrefix=${config_UserChoices_JobName}_1d_${DATE_OPA} 180 259 SecondPrefix=${config_UserChoices_JobName}_5d_${DATE_OPA}
Note: See TracChangeset
for help on using the changeset viewer.