From 066070ecef5081f68313ab7b1185e4184640cef2 Mon Sep 17 00:00:00 2001 From: Tony Craig Date: Mon, 23 Nov 2020 17:49:50 -0800 Subject: [PATCH] Fix minor issues in documentation, key_ CPPs, bfbcomp return codes (#532) * Fix minor issues in documentation, key_ CPPs, bfbcomp return codes quickstart documentation points to porting (#529) check additional return codes in the bfbcomp tool (#524) fix undefined variable in ice_init output (#520) add documentation about aliases (#523) remove key_ CPPS, can be handled by passing communicator thru interface (#498) * update alias documentation --- cicecore/cicedynB/general/ice_init.F90 | 1 + .../comm/mpi/ice_communicate.F90 | 18 ------- .../scripts/tests/test_decomp.script | 10 +++- doc/source/intro/quickstart.rst | 10 ++-- doc/source/user_guide/ug_case_settings.rst | 4 -- doc/source/user_guide/ug_running.rst | 54 ++++++++++++++++--- 6 files changed, 63 insertions(+), 34 deletions(-) diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index fb9c45978..42a96ad78 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -1169,6 +1169,7 @@ subroutine input_data if (trim(grid_type) == 'tripole') then write(nu_diag,*) 'grid_type = ', & trim(grid_type),': user-defined grid with northern hemisphere zipper' + tmpstr2 = ' ' if (trim(ns_boundary_type) == 'tripole') then tmpstr2 = ' on U points (nodes)' elseif (trim(ns_boundary_type) == 'tripoleT') then diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 index a7d186083..1c369ef93 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 @@ -13,18 +13,6 @@ module ice_communicate use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted -#if defined key_oasis3 || key_oasis3mct - use cpl_oasis3 -#endif - -#if defined key_oasis4 - use cpl_oasis4 -#endif - -#if defined key_iomput - use lib_mpp, only: mpi_comm_opa ! MPP library -#endif - implicit none private @@ -83,13 +71,7 @@ subroutine init_communicate(mpicom) if (present(mpicom)) then ice_comm = mpicom else -#if (defined key_oasis3 || defined key_oasis3mct || defined key_oasis4) - ice_comm = localComm ! communicator from NEMO/OASISn -#elif defined key_iomput - ice_comm = mpi_comm_opa ! communicator from NEMO/XIOS -#else ice_comm = MPI_COMM_WORLD ! Global communicator -#endif endif call MPI_INITIALIZED(flag,ierr) diff --git a/configuration/scripts/tests/test_decomp.script b/configuration/scripts/tests/test_decomp.script index 70d7cd24a..40b84d08e 100644 --- a/configuration/scripts/tests/test_decomp.script +++ b/configuration/scripts/tests/test_decomp.script @@ -75,10 +75,16 @@ foreach decomp (${decomps}) set bfbstatus = $status if ($bfbstatus == 0) then set grade = PASS - echo "bfb baseline and test dataset are identical" + echo "bfbcomp baseline and test dataset are identical" + else if ( ${bfbstatus} == 1 ) then + set grade = FAIL + echo "bfbcomp baseline and test dataset are different" + else if ( ${bfbstatus} == 2 ) then + set grade = FAIL + echo "bfbcomp baseline missing data" else set grade = FAIL - echo "bfbcomp and test dataset are different" + echo "bfbcomp script failed" endif echo "$grade ${ICE_TESTNAME}_${decomp} bfbcomp ${base_case}" >> ${ICE_CASEDIR}/test_output endif diff --git a/doc/source/intro/quickstart.rst b/doc/source/intro/quickstart.rst index 547d6ef20..56d19ee70 100644 --- a/doc/source/intro/quickstart.rst +++ b/doc/source/intro/quickstart.rst @@ -16,6 +16,9 @@ You will probably have to download some inputdata, see the `CICE wiki `_ environment file is available at : ``configuration/scripts/machines/environment.yml``. @@ -837,6 +835,50 @@ modify the scripts and input settings in the case directory, NOT the run directo In general, files in the run directory are overwritten by versions in the case directory when the model is built, submitted, and run. +.. _aliases: + +Use of Shell Aliases +------------------------- + +This section provides a list of some potentially useful shell aliases that leverage the CICE +scripts. These are not defined by CICE and are not required for using CICE. They +are provided as an example of what can be done by users. +The current **ice_in**, **cice.settings**, and **env.[machine]** files are copied from +the case directory into the run directory when the model is run. Users can create aliases +leveraging the variables in these files. Aliases like the following can be established +in shell startup files or otherwise at users discretion: + +.. code-block:: bash + + #!/bin/tcsh + # From a case or run directory, source the necessary environment files to run CICE + alias cice_env 'source env.*; source cice.settings' + # Go from case directory to run directory and back (see https://stackoverflow.com/a/34874698/) + alias cdrun 'set rundir=`\grep "setenv ICE_RUNDIR" cice.settings | awk "{print "\$"NF}"` && cd $rundir' + alias cdcase 'set casedir=`\grep "setenv ICE_CASEDIR" cice.settings | awk "{print "\$"NF}"` && cd $casedir' + + #!/bin/bash + # From case/test directory, go to run directory + alias cdrun='cd $(cice_var ICE_RUNDIR)' + # From run directory, go to case/test directory + alias cdcase='cd $(cice_var ICE_CASEDIR)' + # monitor current cice run (from ICE_RUNDIR directory) + alias cice_tail='tail -f $(ls -1t cice.runlog.* |head -1)' + # open log from last CICE run (from ICE_CASEDIR directory) + alias cice_lastrun='$EDITOR $(ls -1t logs/cice.runlog.* |head -1)' + # open log from last CICE build (from ICE_CASEDIR directory) + alias cice_lastbuild='$EDITOR $(ls -1t logs/cice.bldlog.* |head -1)' + # show CICE run directory when run in the case directory + alias cice_rundir='cice_var ICE_RUNDIR' + # open a tcsh shell and source env.* and cice.settings (useful for launching CICE in a debugger) + alias cice_shell='tcsh -c "cice_env; tcsh"' + + ## Functions + # Print the value of a CICE variable ($1) from cice.settings + cice_var() { + \grep "setenv $1" cice.settings | awk "{print "\$"3}" + } + .. _timeseries: Timeseries Plotting