New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 1631 for branches/libIGCM/ORCA2_LIM_PISCES/IGCM00/COMP/opa9.driver – NEMO

Ignore:
Timestamp:
2009-09-21T11:28:25+02:00 (15 years ago)
Author:
cetlod
Message:

Improvment of ORCA2_LIM_PISCES config in libIGCM, see ticket:546

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libIGCM/ORCA2_LIM_PISCES/IGCM00/COMP/opa9.driver

    r1379 r1631  
    77    JOB_NAME=${config_UserChoices_JobName} 
    88 
    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 
    1411 
    1512    ##--Variables used by OPA -- 
    1613 
    17     # cexper experience name for vairmer format 
    18     # nit000 number of the first time step 
    19     # nitend number of the last time step 
    20     # nleapy leap year calendar (0/1) (30 for 360d) 
    21     # nwrite frequency of OUTPUT file 
     14    # 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 
    2219    # 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 
    2727 
    2828# Local function to find namelists parameters 
     
    3232 
    3333 
    34     PAT_CEXPER=$( supergrep cexper    ${SUBMIT_DIR}/PARAM/namelist ) 
    35     PAT_NIT000=$( supergrep nit000    ${SUBMIT_DIR}/PARAM/namelist ) 
    36     PAT_NITEND=$( supergrep nitend    ${SUBMIT_DIR}/PARAM/namelist ) 
    37     PAT_NLEAPY=$( supergrep nleapy    ${SUBMIT_DIR}/PARAM/namelist ) 
    38     PAT_NWRITE=$( supergrep nwrite    ${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 ) 
    3939    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/\. *,//' ) 
    4648 
    4749    # Period Length In Days between DateBegin and first day of calendar 0001 01 01 
     
    4951    (( DaysSinceJC = $( IGCM_date_DaysSinceJC ${DateBegin} ) + 1 )) 
    5052 
     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 
    5159    IGCM_debug_PopStack "OCE_Initialize" 
    5260} 
     
    5563function OCE_Update 
    5664{ 
    57 ###    set -vx 
    5865    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 
    59136 
    60137    NbFreq=$( echo ${config_OCE_WriteFrequency} | wc -w ) 
     
    98175    OPA_NSTOCK="${OPA_NITEND}" 
    99176 
    100     ## Verification of number of time step in a day 
     177    ## Verification of number of time steps per day 
    101178    (( NB_SEC_DAY_MODEL = OPA_NDT_DAY * OPA_RDT )) 
    102179    (( NB_SEC_DAY = 60 * 60 * 24 )) 
     
    104181    if [ ${NB_SEC_DAY_MODEL} -ne ${NB_SEC_DAY} ] 
    105182   then 
    106         echo " VERIFIER OPA_NDT_DAY dans le job ${JOB} " 
     183        echo " VERIFY OPA_NDT_DAY in opa9.card " 
    107184        exit 
    108185    fi 
     
    111188    if ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_OCE_Restart}" = "n" ] ) ; then 
    112189 
    113         #echo "PAS DE RESTART OPA" 
     190        #echo "NO OPA RESTART" 
    114191   OPA_LRSTAR=.FALSE. 
    115192   OPA_NRSTDT=0 
    116         #echo pas de meshmask en parallele 
     193        #Put OPA_NMSH=0 when OPA runnig in parallel mode  
    117194   OPA_NMSH=1 
    118195   ( [ X${BATCH_NUM_PROC_TOT} != X ] && [ "${BATCH_NUM_PROC_TOT}" -gt 1 ] ) && OPA_NMSH=0 
     
    120197    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_OCE_Restart}" = "y" ] ) ; then 
    121198 
    122         #echo "RESTART OPA" 
     199        #echo "OPA RESTART" 
    123200   OPA_LRSTAR=.TRUE. 
    124201   OPA_NRSTDT=1 
     
    127204    else 
    128205 
    129         #echo "RESTART OPA" 
     206        #echo "OPA RESTART" 
    130207   OPA_LRSTAR=.TRUE. 
    131208   OPA_NRSTDT=2 
     
    133210 
    134211    fi 
    135  
     212    
     213     ## nleapy configuration 
    136214   case ${config_UserChoices_CalendarType} in 
    137215         leap) 
     
    147225   NEMO_END=$( echo $( awk "BEGIN { printf \"%0${PRECIS}d\",${OPA_NITEND} }" ) )  
    148226 
    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}%"                    \ 
    154231   -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}%"                \ 
    159238   namelist > namelist.tmp 
    160239 
     
    173252 
    174253    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 : 
    176255   DATE_OPA=$( cat date.file | \ 
    177256       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 ) 
    179258   MainPrefix=${config_UserChoices_JobName}_1d_${DATE_OPA} 
    180259   SecondPrefix=${config_UserChoices_JobName}_5d_${DATE_OPA} 
Note: See TracChangeset for help on using the changeset viewer.