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 1157 for trunk/NVTK/INSTALL/JOBS/assessment.ksh – NEMO

Ignore:
Timestamp:
2008-06-27T10:15:05+02:00 (16 years ago)
Author:
ctlod
Message:

trunk: improve NVTK diagnostic in checking number of time steps performed from solver.stat file, see ticket: #225

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NVTK/INSTALL/JOBS/assessment.ksh

    r1155 r1157  
    8181#    - zoutfile : output file name to print results 
    8282#    - zwork    : kind of prints to perform 
    83 #    - zreprint : (optional) to avoid printing twice a message 
     83#    - zreprint : print a message once (yes/no) 
     84#    - ziter    : (optional) print time steps number (yes/no) 
    8485########################################################### 
    8586################ Begin checkfile function ################# 
     
    9495# Print a message only once 
    9596zreprint=$4 
     97# Print iterations number 
     98ziter=$5 
    9699 
    97100#set -x  
    98101 
    99 test -n "${zreprint}" 
    100 zrep=$? 
     102test -n "${ziter}" 
     103zrepiter=$? 
    101104 
    102105 
     
    112115if [ -a ${zf2check} ] ; then 
    113116    fmes1=" List ${genf} files and check date creation:   " 
    114     fmes2=" `ls -l ${zf2check}`           " 
     117    fmes2=" `ls -o ${zf2check}`           " 
    115118    fmes3=" - file ${zf2check} is empty  " 
    116     [ ${zrep} == 0 ] && echo "${blnk}${fmes1}"  >> ${zoutfile} 
     119    fmes4="       Num. time steps:   done  /  expected " 
     120    if [ ${zreprint} = 'yes' ] ; then  
     121        if [ ${zrepiter} == 0 ] ; then  
     122            echo "${blnk}${fmes1}" "${fmes4}" >> ${zoutfile} 
     123        else 
     124            echo "${blnk}${fmes1}"          >> ${zoutfile} 
     125        fi 
     126    fi 
    117127 
    118128   # Check file is not empty 
    119129   if [ -s ${zf2check} ] ; then 
    120        [ ${zoutfile} ] && echo "${blnk}${fmes2}" >> ${zoutfile} 
    121        xist=0 ; return ${xist} 
     130       if [ ${zrepiter} == 0 ] ; then 
     131           # Check run's iterations number from solver.stat 
     132           basedir="`dirname ${zf2check}`" 
     133           echo "`tail -1 ${zf2check}`" > temp1 
     134           echo "`grep nitend ${basedir}/namelist`" > temp2 
     135           typeset -Z4 ziter_run 
     136           typeset -Z4 ziter_ask 
     137           ziter_run="`awk '{print $3}' temp1`" 
     138           ziter_ask="`awk '{print $3}' temp2`" 
     139           \rm temp1 temp2 
     140           [ ${zoutfile} ] && echo "${blnk}${fmes2}" "   ${ziter_run}  /   ${ziter_ask}" >> ${zoutfile} 
     141           xist=0 ; return ${xist} 
     142       else 
     143           [ ${zoutfile} ] && echo "${blnk}${fmes2}" >> ${zoutfile} 
     144           xist=0 ; return ${xist} 
     145       fi 
    122146   else 
    123147       [ ${zoutfile} ] &&  echo "${blnk}${fmes3}" >> ${zoutfile} 
     
    348372#-------- 
    349373checkfile ${filecs} 'endjob.txt' DIFF yes ; xfilecs=$? 
    350 checkfile ${filers} 'endjob.txt' DIFF     ; xfilers=$? 
    351 checkfile ${filecm} 'endjob.txt' DIFF     ; xfilecm=$? 
    352 checkfile ${filerm} 'endjob.txt' DIFF     ; xfilerm=$? 
     374checkfile ${filers} 'endjob.txt' DIFF no  ; xfilers=$? 
     375checkfile ${filecm} 'endjob.txt' DIFF no  ; xfilecm=$? 
     376checkfile ${filerm} 'endjob.txt' DIFF no  ; xfilerm=$? 
    353377 
    354378# If current version files exist 
     
    396420        # Check that timing file for the ${runt} reference version exist 
    397421        filerv="${runt}/GTIME/REF/${runt}${CONF}_err"  
    398         checkfile ${filerv} 'endjob.txt' NORM ; xfilerv=$? 
     422        checkfile ${filerv} 'endjob.txt' NORM no ; xfilerv=$? 
    399423        echo "                                                             " >> endjob.txt 
    400424 
     
    432456        xfilemon=0 
    433457 
    434         checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$? 
    435         checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$? 
     458        checkfile ${filemon} 'endjob.txt' NORM yes yes ; xfilemon=$? 
     459        checkfile ${filexxx} 'endjob.txt' NORM no  yes ; xfilemon=$? 
    436460         
    437461        mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro 
     
    447471 
    448472            checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$? 
    449             checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$? 
     473            checkfile ${filexxx} 'endjob.txt' NORM no  ; xfilemon=$? 
    450474             
    451475            # check that tracer.stat files have been built based on ocean.output ones 
     
    456480 
    457481            checkfile ${filemon} 'endjob.txt' NORM yes ; xfilemon=$? 
    458             checkfile ${filexxx} 'endjob.txt' NORM ; xfilemon=$? 
     482            checkfile ${filexxx} 'endjob.txt' NORM no  ; xfilemon=$? 
    459483             
    460484            mak_diff_file -x ${xfilemon} -a ${filemon} -b ${filexxx} -r ${runt} -s LONG -k repro 
     
    483507    xfile1=0 
    484508    #------- 
    485     checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$? 
    486     checkfile ${file2} 'endjob.txt' NORM ; xfile1=$? 
     509    checkfile ${file1} 'endjob.txt' NORM yes yes ; xfile1=$? 
     510    checkfile ${file2} 'endjob.txt' NORM no  yes ; xfile1=$? 
    487511    # 
    488512    cat ${file1} ${file2}  > short_solver_${runt}.stat 
     
    502526 
    503527        checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$? 
    504         checkfile ${file2} 'endjob.txt' NORM     ; xfile1=$? 
     528        checkfile ${file2} 'endjob.txt' NORM no  ; xfile1=$? 
    505529             
    506530        # check that tracer.stat files have been built based on ocean.output ones 
     
    511535 
    512536        checkfile ${file1} 'endjob.txt' NORM yes ; xfile1=$? 
    513         checkfile ${file2} 'endjob.txt' NORM     ; xfile1=$? 
     537        checkfile ${file2} 'endjob.txt' NORM no  ; xfile1=$? 
    514538        # 
    515539        mak_diff_file -x ${xfile1} -a ${file2} -b ${file1} -r ${runt} -k resta 
     
    554578        # solver.stat STREAM 1 
    555579        checkfile ${file1}  'endjob.txt' NORM yes ; xfilev1=$? 
    556         checkfile ${filev1} 'endjob.txt' NORM ; xfilev1=$? 
     580        checkfile ${filev1} 'endjob.txt' NORM no  ; xfilev1=$? 
    557581     
    558582        mak_diff_file -x ${xfilev1} -a ${file1} -b ${filev1} -r ${runt} -s STREAM_1 -t ${REF_TAG} 
     
    561585        # ocean.output STREAM 1 
    562586        checkfile ${file_oc1}  'endjob.txt' NORM yes ; xfile_oc1=$? 
    563         checkfile ${file_roc1} 'endjob.txt' NORM ; xfile_oc1=$? 
     587        checkfile ${file_roc1} 'endjob.txt' NORM no  ; xfile_oc1=$? 
    564588     
    565589        mak_diff_file -x ${xfile_oc1} -a ${file_oc1} -b ${file_roc1} -r ${runt} -s STREAM_1 -t ${REF_TAG} 
     
    572596        # solver.stat STREAM 2 
    573597        checkfile ${file2}  'endjob.txt' NORM yes ; xfilev2=$? 
    574         checkfile ${filev2} 'endjob.txt' NORM ; xfilev2=$? 
     598        checkfile ${filev2} 'endjob.txt' NORM no  ; xfilev2=$? 
    575599     
    576600        mak_diff_file -x ${xfilev2} -a ${file2} -b ${filev2} -r ${runt} -s STREAM_2 -t ${REF_TAG} 
     
    579603        # ocean.output STREAM 2 
    580604        checkfile ${file_oc2}  'endjob.txt' NORM yes ; xfile_oc2=$? 
    581         checkfile ${file_roc2} 'endjob.txt' NORM ; xfile_oc2=$? 
     605        checkfile ${file_roc2} 'endjob.txt' NORM no  ; xfile_oc2=$? 
    582606     
    583607        mak_diff_file -x ${xfile_oc2} -a ${file_oc2} -b ${file_roc2} -r ${runt} -s STREAM_2 -t ${REF_TAG} 
Note: See TracChangeset for help on using the changeset viewer.