#====================================================================== # Clear coupler log files for validation test #====================================================================== unsetenv CPLLOG_INIT #====================================================================== # do an initial run test with NINST 1, with length taken from compset default #====================================================================== cd $CASEROOT echo "doing an initial test with NINST 1, with length taken from compset default" >>& $TESTSTATUS_LOG source ./Tools/ccsm_getenv || exit -3 ./xmlchange -file env_run.xml -id CONTINUE_RUN -val FALSE ./xmlchange -file env_run.xml -id REST_OPTION -val none rm $EXEROOT/cesm.exe >& /dev/null cp -f $EXEROOT/cesm.exe.nck1 $EXEROOT/cesm.exe || exit -9 cp -f env_build.xml.nck1 env_build.xml cp -f env_mach_pes.xml.nck1 env_mach_pes.xml ./cesm_setup -clean ./cesm_setup cp -f env_build.xml.nck1 env_build.xml cp -f env_mach_pes.xml.nck1 env_mach_pes.xml cp -f env_build.xml LockedFiles/env_build.xml.locked cp -f env_mach_pes.xml LockedFiles/env_mach_pes.xml.locked ./$CASE.run gunzip $RUNDIR/cpl.log*.gz set CplLogFile = `ls -1t $RUNDIR/cpl.log* | head -1` setenv CPLLOG_INIT1 $CplLogFile setenv BASEGEN_FILE01 $CplLogFile echo "First Test log is $CPLLOG_INIT1" >>& $TESTSTATUS_LOG if ( $?CPLLOG_INIT1 ) then if ($CPLLOG_INIT1 == "") then echo "CPLLOG_INIT1 empty" set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif if (! -e $CPLLOG_INIT1) then echo "CPLLOG_INIT1 does not exist" set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif echo "Checking successful completion in cpl log file1" >>& $TESTSTATUS_LOG set pass = `grep "SUCCESSFUL TERM" $CPLLOG_INIT1 | wc -l` if ( $pass != 0 ) then set basestatus = "PASS " echo "$basestatus " >>& $TESTSTATUS_LOG else set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif else echo "ERROR in ${0}: initial coupler log file1 NOT set" >>& $TESTSTATUS_LOG set basestatus = "ERROR" echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif #====================================================================== # do an initial run test with NINST 2 # want to run on same pe counts per instance and same cpl pe count #====================================================================== cd $CASEROOT echo "doing an initial test with NINST 2" >>& $TESTSTATUS_LOG rm $EXEROOT/cesm.exe >& /dev/null cp -f $EXEROOT/cesm.exe.nck2 $EXEROOT/cesm.exe || exit -9 cp -f env_build.xml.nck2 env_build.xml cp -f env_mach_pes.xml.nck2 env_mach_pes.xml ./cesm_setup -clean ./cesm_setup cp -f env_build.xml.nck2 env_build.xml cp -f env_mach_pes.xml.nck2 env_mach_pes.xml cp -f env_build.xml LockedFiles/env_build.xml.locked cp -f env_mach_pes.xml LockedFiles/env_mach_pes.xml.locked ./$CASE.run gunzip $RUNDIR/cpl.log*.gz set CplLogFile = `ls -1t $RUNDIR/cpl.log* | head -1` setenv CPLLOG_INIT2 $CplLogFile setenv BASEGEN_FILE02 $CplLogFile echo "Second Test log is $CPLLOG_INIT2" >>& $TESTSTATUS_LOG #====================================================================== # runs complete, restore original settings #====================================================================== cp -f env_build.xml.nck1 env_build.xml cp -f env_mach_pes.xml.nck1 env_mach_pes.xml #====================================================================== # Check case validation first #====================================================================== setenv CPLLOG_GENCMP $CPLLOG_INIT2 set basestatus = "UNDEF" if ( $?CPLLOG_INIT2 ) then if ($CPLLOG_INIT1 == "") then echo "CPLLOG_INIT1 empty" set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif if (! -e $CPLLOG_INIT1) then echo "CPLLOG_INIT1 does not exist" set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif if ($CPLLOG_INIT1 == $CPLLOG_INIT2) then echo "logs files are same name" set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif echo "Checking successful completion in cpl log file2" >>& $TESTSTATUS_LOG set pass = `grep "SUCCESSFUL TERM" $CPLLOG_INIT2 | wc -l` if ( $pass != 0 ) then set basestatus = "PASS " echo "$basestatus " >>& $TESTSTATUS_LOG else set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif else echo "ERROR in ${0}: initial coupler log file2 NOT set" >>& $TESTSTATUS_LOG set basestatus = "ERROR" echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT exit endif # Compare the log files echo "diff log files " >>& $TESTSTATUS_LOG set basestatus = "PASS " set cfile1 = $RUNDIR/commdiag1 set cfile2 = $RUNDIR/commdiag2 echo "cfile1 = $cfile1" >>& $TESTSTATUS_LOG echo "cfile2 = $cfile2" >>& $TESTSTATUS_LOG rm -f $cfile1 rm -f $cfile2 grep -i comm_diag $CPLLOG_INIT1 >! $cfile1 grep -i comm_diag $CPLLOG_INIT2 | grep -i _0002 | sed 's/_0002//' >! $cfile2 set pass = `diff cfile1 cfile2 | grep -i comm_diag | wc -l` if ($pass != 0) set basestatus = "FAIL " echo "$basestatus " >>& $TESTSTATUS_LOG echo "$basestatus ${CASEBASEID} " >&! $TESTSTATUS_OUT