Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update scripts, gnu compiler flags #125

Merged
merged 14 commits into from
Apr 18, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 110 additions & 50 deletions cice.setup
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/csh -f

set ICE_SANDBOX = `pwd`
set ICE_VERSION = `cat cicecore/version.txt | sed -e 's/ /_/g'`
set ICE_VERSION = unknown
if (-e cicecore/version.txt) then
set ICE_VERSION = `head -1 cicecore/version.txt | sed -e 's/ /_/g'`
endif
set ICE_SCRIPTS = "${ICE_SANDBOX}/configuration/scripts"
set initargv = ( $argv[*] )

Expand All @@ -24,23 +27,11 @@ set baseCom = $spval # Baseline compare
set baseGen = $spval # Baseline generate
set bfbcomp = $spval # BFB compare
set report = 0 # test results reporting
set versno = `grep "release =" doc/source/conf.py | cut -d \' -f 2`

if ($#argv < 1) then
set helpheader = 1
endif

set argv = ( $initargv[*] )
# check for --version
while (1)
if ($#argv < 1) break;
if ("$argv[1]" =~ "--version" ) then
echo "This is CICE ${versno}"
exit -1
endif
shift argv
end

set argv = ( $initargv[*] )
# check for -h
while (1)
Expand All @@ -64,6 +55,12 @@ NAME
cice.setup

SYNOPSIS
-h || --help

--version

--setvers versno

--case CASE -m MACH
[-e ENV][-p MxN][-g GRID][-s SET1,SET2][--acct ACCT]

Expand All @@ -78,12 +75,13 @@ SYNOPSIS
DESCRIPTION
--help, -h : help
--version : generates cice version number
--setvers : updates cice version number in sandbox
--case, -c : case, case directory/name (not with --test or --suite)
--mach, -m : machine, machine name (required)
--env, -e : compiler(s), comma separated (default = "intel")
--pes, -p : tasks x threads or "m"x"n" (default is 1x1)
--env, -e : compiler(s), comma separated (default = $compilers)
--pes, -p : tasks x threads [x blocksize_x x blocksize_y [x maxblocks]] (default is $pesx)
--acct : account number for the batch submission
--grid, -g : grid, grid (default = col)
--grid, -g : grid, grid (default = $grid)
--set, -s : case option setting(s), comma separated (default = " ")

For testing
Expand All @@ -98,9 +96,11 @@ DESCRIPTION
--report : automatically post results when tests are complete

EXAMPLES
cice.setup --version
cice.setup --setvers 6.0.2
cice.setup -c caseB -m gordon -e cray -s diag1,debug
cice.setup --case ~/caseA --mach cheyenne --env intel --set diag24
cice.setup --test restart -m onyx -e gnu -s debug -testid myid
cice.setup --test restart -m onyx -e gnu -s debug -testid myid -p 8x4
cice.setup --suite base_suite -m conrad --env intel,cray --testid myv1 --bgen myv1
cice.setup --suite quick_suite -m cheyenne --testid myv1 --bgen myv1
cice.setup --suite quick_suite -m cheyenne --testid myv2 --bgen myv2 --bcmp myv1
Expand Down Expand Up @@ -162,7 +162,40 @@ echo " "
echo "${0}:"

set argv = ( $initargv[*] )
# check for --version
while (1)
if ($#argv < 1) break;
if ("$argv[1]" =~ "--version" ) then
echo "${0}: This is ${ICE_VERSION}"
exit -1
endif
shift argv
end

set argv = ( $initargv[*] )
# check for --setvers
while (1)
if ($#argv < 1) break;
if ("$argv[1]" =~ "--setvers" ) then
shift argv
if ( $#argv < 1 ) then
echo "${0}: ERROR in --setvers argument"
exit -1
endif
set versno = $argv[1]
${ICE_SCRIPTS}/set_version_number.csh $versno
if ($status != 0) then
echo "${0} ERROR in set_version_numbers.csh"
exit -1
endif
echo "Setting CICE version to ${versno} and exiting"
exit -1
endif
shift argv
end

set argv = ( $initargv[*] )
# read in all options
while (1)
if ( $#argv < 1 ) break;
set option = $argv[1];
Expand Down Expand Up @@ -269,26 +302,32 @@ if (($testsuite != $spval || $test != $spval) && $testid == $spval) then
exit -1
endif

#Update version.txt
echo "CICE ${versno}" >! cicecore/version.txt

# Check to see if this is a test-suite run. If so, loop through the various
# tests and create a separate folder for each
if ( $testsuite != $spval ) then
set tsdir = "${testsuite}.${testid}"
if (-e ${testsuite}) then
set tsfile = "${testsuite}"
else if (-e ${testsuite}.ts) then
set tsfile = "${testsuite}.ts"
else
if (-e ${ICE_SCRIPTS}/tests/${testsuite}.ts) then
set tsfile = "${ICE_SCRIPTS}/tests/${testsuite}.ts"
else
echo "${0}: ERROR, cannot find testsuite file ${testsuite}, also checked ${ICE_SCRIPTS}/tests/${testsuite}.ts"
exit -1
set tsdir = "testsuitedir.${testid}"
set tsfile = "testsuitelist.${testid}"
rm -f $tsfile
set tarrays = `echo ${testsuite} | sed 's/,/ /g' | fmt -1 | sort -u`
foreach tarray ( ${tarrays} )
if (-e ${tarray}) then
cat ${tarray} >> $tsfile
else if (-e ${tarray}.ts) then
cat ${tarray.ts} >> $tsfile
else
if (-e ${ICE_SCRIPTS}/tests/${tarray}.ts) then
cat ${ICE_SCRIPTS}/tests/${tarray}.ts >> $tsfile
else
echo "${0}: ERROR, cannot find testsuite file ${tarray}, also checked ${ICE_SCRIPTS}/tests/${tarray}.ts"
exit -1
endif
endif
endif
end

if (-e ./${tsdir}) then
echo "${0}: ERROR, ${tsdir} already exists"
exit -1
endif
mkdir ./${tsdir}
cp -f ${ICE_SCRIPTS}/tests/report_results.csh ./${tsdir}
cp -f ${ICE_SCRIPTS}/tests/timeseries.csh ./${tsdir}
Expand All @@ -308,11 +347,8 @@ EOF0
set hashdate = `git log | grep -i date | head -1 | cut -d : -f 2-`
set cdate = `date -u "+%Y-%m-%d"`
set ctime = `date -u "+%H:%M:%S"`
set vers = "unknown"
set vers = ${ICE_VERSION}
set shhash = `echo ${hash} | cut -c 1-10`
if (-e cicecore/version.txt) then
set vers = `head -1 cicecore/version.txt`
endif

cat >! ./${tsdir}/results.csh << EOF0
#!/bin/csh -f
Expand Down Expand Up @@ -421,7 +457,7 @@ set casescr = "${casedir}/casescripts"
if !( -d ${casescr}) mkdir ${casescr}

# from basic script dir to case
foreach file (cice.build cice.settings Makefile ice_in makdep.c)
foreach file (cice.build cice.settings Makefile ice_in makdep.c setup_run_dirs.csh)
if !(-e ${ICE_SCRIPTS}/$file) then
echo "${0}: ERROR, ${ICE_SCRIPTS}/$file not found"
exit -1
Expand Down Expand Up @@ -456,34 +492,60 @@ endif
cd ${casedir}
source ./env.${machcomp} || exit 2

echo ICE_SANDBOX = ${ICE_SANDBOX}
echo ICE_CASENAME = ${casename}
echo ICE_CASEDIR = ${casedir}
echo ICE_MACHINE = ${machine}
echo ICE_COMPILER = ${compiler}

#------------------------------------------------------------
# Compute a default blocksize

set chck = `echo ${pesx} | sed 's/^[0-9][0-9]*x[0-9][0-9]*$/OK/'`
set chck = `echo ${pesx} | sed 's/^[0-9][0-9]*x[0-9][0-9]*x[0-9][0-9]*x[0-9][0-9]*x[0-9][0-9]*$/OK/'`
if (${chck} == OK) then
set task = `echo ${pesx} | sed s/x.\*//`
set thrd = `echo ${pesx} | sed s/.\*x//`
set task = `echo ${pesx} | cut -d x -f 1`
set thrd = `echo ${pesx} | cut -d x -f 2`
set blckx = `echo ${pesx} | cut -d x -f 3`
set blcky = `echo ${pesx} | cut -d x -f 4`
set mblck = `echo ${pesx} | cut -d x -f 5`
else
echo "${0}: ERROR in -p argument, ${pesx}, must be mxn"
exit -1
set chck = `echo ${pesx} | sed 's/^[0-9][0-9]*x[0-9][0-9]*x[0-9][0-9]*x[0-9][0-9]*$/OK/'`
if (${chck} == OK) then
set task = `echo ${pesx} | cut -d x -f 1`
set thrd = `echo ${pesx} | cut -d x -f 2`
set blckx = `echo ${pesx} | cut -d x -f 3`
set blcky = `echo ${pesx} | cut -d x -f 4`
set mblck = 0
else
set chck = `echo ${pesx} | sed 's/^[0-9][0-9]*x[0-9][0-9]*$/OK/'`
if (${chck} == OK) then
set task = `echo ${pesx} | cut -d x -f 1`
set thrd = `echo ${pesx} | cut -d x -f 2`
set blckx = 0
set blcky = 0
set mblck = 0
else
echo "${0}: ERROR in -p argument, ${pesx}, must be [m]x[n], [m]x[n]x[bx]x[by], or [m]x[n]x[bx]x[by]x[mb] "
exit -1
endif
endif
endif

setenv ICE_DECOMP_GRID ${grid}
setenv ICE_DECOMP_NTASK ${task}
setenv ICE_DECOMP_NTHRD ${thrd}
setenv ICE_DECOMP_BLCKX ${blckx}
setenv ICE_DECOMP_BLCKY ${blcky}
setenv ICE_DECOMP_MXBLCKS ${mblck}

source ${casescr}/cice_decomp.csh
if ($status != 0) then
echo "${0}: ERROR, cice_decomp.csh aborted"
exit -1
endif

echo "ICE_SANDBOX = ${ICE_SANDBOX}"
echo "ICE_CASENAME = ${casename}"
echo "ICE_CASEDIR = ${casedir}"
echo "ICE_MACHINE = ${machine}"
echo "ICE_COMPILER = ${compiler}"
echo "ICE_PES = ${task}x${thrd}"
echo "ICE_GRID = ${grid} (${ICE_DECOMP_NXGLOB}x${ICE_DECOMP_NYGLOB}) blocksize=${ICE_DECOMP_BLCKX}x${ICE_DECOMP_BLCKY}x${ICE_DECOMP_MXBLCKS}"

#------------------------------------------------------------
# Copy in and update cice.settings and ice_in files

Expand Down Expand Up @@ -536,8 +598,6 @@ setenv ICE_NXGLOB ${ICE_DECOMP_NXGLOB}
setenv ICE_NYGLOB ${ICE_DECOMP_NYGLOB}
setenv ICE_NTASKS ${task}
setenv ICE_NTHRDS ${thrd}
setenv ICE_DECOMP ${ICE_DECOMP_DECOMP}
setenv ICE_DSHAPE ${ICE_DECOMP_DSHAPE}
setenv ICE_MXBLCKS ${ICE_DECOMP_MXBLCKS}
setenv ICE_BLCKX ${ICE_DECOMP_BLCKX}
setenv ICE_BLCKY ${ICE_DECOMP_BLCKY}
Expand Down
8 changes: 7 additions & 1 deletion cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module ice_dyn_evp
use ice_fileunits, only: nu_diag
use ice_exit, only: abort_ice
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_ice_strength
use icepack_intfc, only: icepack_ice_strength, icepack_query_parameters
#ifdef CICE_IN_NEMO
use icepack_intfc, only: calc_strair
#endif
Expand Down Expand Up @@ -606,6 +606,7 @@ subroutine stress (nx_block, ny_block, &
tensionne, tensionnw, tensionse, tensionsw, & ! tension
shearne, shearnw, shearse, shearsw , & ! shearing
Deltane, Deltanw, Deltase, Deltasw , & ! Delt
puny , & ! puny
c0ne, c0nw, c0se, c0sw , & ! useful combinations
c1ne, c1nw, c1se, c1sw , &
ssigpn, ssigps, ssigpe, ssigpw , &
Expand Down Expand Up @@ -741,6 +742,11 @@ subroutine stress (nx_block, ny_block, &
! phrase "flush to zero".
!-----------------------------------------------------------------

! call icepack_query_parameters(puny_out=puny)
! call icepack_warnings_flush(nu_diag)
! if (icepack_warnings_aborted()) call abort_ice(error_message="subname", &
! file=__FILE__, line=__LINE__)

! stressp_1(i,j) = sign(max(abs(stressp_1(i,j)),puny),stressp_1(i,j))
! stressp_2(i,j) = sign(max(abs(stressp_2(i,j)),puny),stressp_2(i,j))
! stressp_3(i,j) = sign(max(abs(stressp_3(i,j)),puny),stressp_3(i,j))
Expand Down
Loading