<p><b>dwj07@fsu.edu</b> 2012-03-15 09:31:20 -0600 (Thu, 15 Mar 2012)</p><p><br>
        -- BRANCH COMMIT --<br>
<br>
        Updating makeMeshes.sh to work with the current namelist files.<br>
        And to set up the ability for spatial convergence studies.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh
===================================================================
--- branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh        2012-03-15 01:42:47 UTC (rev 1644)
+++ branches/ocean_projects/ocean_test_cases_staging/ocean/advective_transport/makeMeshes.sh        2012-03-15 15:31:20 UTC (rev 1645)
@@ -2,17 +2,16 @@
 
 ########################################################################################
 ## Change the horizontal spacings, vertical levels, and cells in the x direction here ##
-## To start, grids are periodic in the x direction. This may change later                          ##
+## To start, grids are periodic in the x direction. This may change later             ##
 ########################################################################################
-
-SPACINGS=&quot;10 5 2 1&quot;
-VERTLEVS=&quot;1 10&quot;
+SPACINGS=&quot;1 2 4 8 16&quot;
+VERTLEVS=&quot;10&quot;
 TCNAME=&quot;advective_transport&quot;
 
 ###############################################################
 ## Change reference spacing, time_step, and viscosities here ##
 ###############################################################
-REF_TIME_STEP=&quot;5&quot;
+REF_TIME_STEP=&quot;15&quot;
 REF_VISC_H=&quot;0.0&quot;
 REF_VISC_V=&quot;0.0&quot;
 REF_SPACING=&quot;10.0&quot;
@@ -23,34 +22,44 @@
 CUR_DIR=`pwd`
 
 if [ -z &quot;$3&quot; ]; then
-        PROCS=&quot;2 4 8 16 32 64 128 256 512 1024 2048 4096&quot;
+        PROCS=&quot;2 4 8 16 32&quot;
 else
         PROCS=&quot;$3&quot;
 fi
 
-X_EXTENT=&quot;600&quot;
-Y_EXTENT=&quot;600&quot;
 X_EXTENT=&quot;460&quot;
 Y_EXTENT=&quot;460&quot;
 
+#######################################################
+## Setup Variables for different run initializations ##
+#######################################################
+ADVECTION_ROUTINES=&quot;std2 std3 std4 fct2 fct3 fct4&quot;
+TIME_STEPPERS=&quot;rk4 se1 se20 use&quot;
+TIME_STEPS=&quot;15&quot;
+
 ############################################################
 ## Setup Default namelist keys and values to update later ##
 ############################################################
+i=0
+KEYS[$i]=&quot;config_run_duration&quot;;           VALUES[$i]=&quot;'0000_00:02:40'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_input_name&quot;;             VALUES[$i]=&quot;'grid.nc'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_output_name&quot;;            VALUES[$i]=&quot;'output.nc'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_restart_name&quot;;           VALUES[$i]=&quot;'restart.nc'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_output_interval&quot;;        VALUES[$i]=&quot;'00_00:02:40'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_do_restart&quot;;             VALUES[$i]=&quot;.false.&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_grid_type&quot;;         VALUES[$i]=&quot;'zstar'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_rho0&quot;;                   VALUES[$i]=&quot;1000&quot;; i=$i+1;
+KEYS[$i]=&quot;config_bottom_drag_coeff&quot;;      VALUES[$i]=&quot;1.0e-3&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_visc_type&quot;;         VALUES[$i]=&quot;'const'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_diff_type&quot;;         VALUES[$i]=&quot;'const'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_eos_type&quot;;               VALUES[$i]=&quot;'linear'&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_tracer_adv_order&quot;;  VALUES[$i]=&quot;3&quot;; i=$i+1;
+KEYS[$i]=&quot;config_thickness_adv_order&quot;;    VALUES[$i]=&quot;3&quot;; i=$i+1;
+KEYS[$i]=&quot;config_h_mom_eddy_visc2&quot;;              VALUES[$i]=&quot;0.0&quot;; i=$i+1;
+KEYS[$i]=&quot;config_h_mom_eddy_diff2&quot;;              VALUES[$i]=&quot;0.0&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_visc&quot;;              VALUES[$i]=&quot;0.0&quot;; i=$i+1;
+KEYS[$i]=&quot;config_vert_diff&quot;;              VALUES[$i]=&quot;0.0&quot;; i=$i+1;
 
-KEYS[0]=&quot;config_time_integration&quot;;   VALUES[0]=&quot;'RK4'&quot;;
-KEYS[1]=&quot;config_run_duration&quot;;       VALUES[1]=&quot;'0200_00:00:00'&quot;;
-KEYS[2]=&quot;config_input_name&quot;;         VALUES[2]=&quot;'grid.nc'&quot;;
-KEYS[3]=&quot;config_output_name&quot;;        VALUES[3]=&quot;'output.nc'&quot;;
-KEYS[4]=&quot;config_restart_name&quot;;       VALUES[4]=&quot;'restart.nc'&quot;;
-KEYS[5]=&quot;config_output_interval&quot;;    VALUES[5]=&quot;'01_00:00:00'&quot;;
-KEYS[6]=&quot;config_do_restart&quot;;         VALUES[6]=&quot;.false.&quot;;
-KEYS[7]=&quot;config_vert_grid_type&quot;;     VALUES[7]=&quot;'zlevel'&quot;;
-KEYS[8]=&quot;config_rho0&quot;;               VALUES[8]=&quot;1000&quot;;
-KEYS[9]=&quot;config_bottom_drag_coeff&quot;;  VALUES[9]=&quot;1.0e-3&quot;;
-KEYS[10]=&quot;config_vert_visc_type&quot;;    VALUES[10]=&quot;'const'&quot;;
-KEYS[11]=&quot;config_vert_diff_type&quot;;    VALUES[11]=&quot;'const'&quot;;
-
-
 #################################################
 ## Build perfect hex meshes using periodic_hex ##
 #################################################
@@ -106,16 +115,29 @@
         cp MPAS-namelist.input.default MPAS-namelist.input.temporary
 fi
 
-i=1
 for ((i=0; i&lt;${#KEYS[@]}; i++));
 do
         cat MPAS-namelist.input.temporary | sed &quot;s/${KEYS[$i]} .*/${KEYS[$i]} = ${VALUES[$i]}/g&quot; &gt; Temp
         mv Temp MPAS-namelist.input.temporary
 done
 
+NUM_LINES=`sed -n &quot;/_model/,/\//p&quot; MPAS-namelist.input.temporary | wc -l`
+NUM_LINES=`echo ${NUM_LINES}-1 | bc`
+
+sed -n &quot;/_model/,/\//p&quot; MPAS-namelist.input.temporary | head -n ${NUM_LINES} &gt; namelist.top 
+echo &quot;    config_prescribe_velocity = .true.&quot; &gt;&gt; namelist.top
+echo &quot;    config_prescribe_thickness = .true.&quot; &gt;&gt; namelist.top
+echo '/' &gt;&gt; namelist.top
+echo '' &gt;&gt; namelist.top
+sed '/_model/,/\//d' MPAS-namelist.input.temporary &gt; namelist.bottom
+
+cat namelist.top &gt; MPAS-namelist.input.temporary
+cat namelist.bottom &gt;&gt; MPAS-namelist.input.temporary
+
+rm -f namelist.top namelist.bottom
+
 mv MPAS-namelist.input.temporary MPAS-namelist.input.template
 
-
 touch run_paths
 
 #################################################################
@@ -158,21 +180,6 @@
                 NX=`echo &quot;(${X_EXTENT} / ${SPACING})&quot; | bc`
                 DC=`echo &quot;${SPACING}.0&quot;`
 
-                if [ $VERTLEV -eq 1 ]; then
-                        VERT_TYPE=&quot;isopycnal&quot;
-                else
-                        VERT_TYPE=&quot;zlevel&quot;
-                fi
-
-                ## Compute scaled spacing, time_step, and viscosities
-                D_SPACING=`echo &quot;scale=4; ${SPACING}/${REF_SPACING}&quot; | bc`
-                TIME_STEP=`echo &quot;scale=4; $D_SPACING * $REF_TIME_STEP&quot; | bc`
-                VISC_H=`echo &quot;scale=4; ($D_SPACING^4)*${REF_VISC_H}&quot; | bc`
-                TIME_STEP=`echo ${REF_TIME_STEP}`
-                VISC_H=`echo ${REF_VISC_H}`
-                VISC_V=`echo ${REF_VISC_V}`
-                STATS=`echo &quot; $TOTAL_TIME / $TIME_STEP / 10 &quot; | bc`
-
                 echo &quot;     Converting ${NAME} mesh to have ${VERTLEV} levels&quot;
 
                 ln -s ${TCNAME}_${NAME}.grid.nc grid.nc
@@ -186,45 +193,79 @@
                 mv ocean.nc ${TCNAME}_${NAME}_${VERTLEV}levs.grid.nc
                 mv graph.info ${TCNAME}_${NAME}_${VERTLEV}levs.graph.info
 
-                for PROC in $PROCS
+                for TIME_STEPPER in ${TIME_STEPPERS}
                 do
-                        mkdir -p ${NAME}_${VERTLEV}levs/${PROC}procs
+                        if [ ${TIME_STEPPER} == 'rk4' ]; then
+                                TIME_INTEGRATOR=&quot;'RK4'&quot;
+                        elif [ ${TIME_STEPPER:0:2} == &quot;se&quot; ]; then
+                                TIME_INTEGRATOR=&quot;'split_explicit'&quot;
+                                SUB_CYCLES=${TIME_STEPPER:2}
+                        elif [ ${TIME_STEPPER} == 'use' ]; then
+                                TIME_INTEGRATOR=&quot;'unsplit_explicit'&quot;
+                        fi
 
-                        pmetis ${TCNAME}_${NAME}_${VERTLEV}levs.graph.info $PROC &gt; /dev/null
+                        for TIME_STEP in ${TIME_STEPS}
+                        do
 
-                        ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.graph.info ${NAME}_${VERTLEV}levs/${PROC}procs/graph.info
-                        ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.graph.info.part.${PROC} ${NAME}_${VERTLEV}levs/${PROC}procs/graph.info.part.${PROC}
-                        ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.grid.nc ${NAME}_${VERTLEV}levs/${PROC}procs/grid.nc
-                        ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/namelist.input ${NAME}_${VERTLEV}levs/${PROC}procs/namelist.input
+                                for ADVECTION_ROUTINE in ${ADVECTION_ROUTINES}
+                                do
 
-                        ## Copy executable to run directory
-                        if [ $# -ge 1 ]; then
-                                if [ -e ${NAME}_${VERTLEV}levs/${PROC}procs/ocean_model.exe ]; then
-                                        unlink ${NAME}_${VERTLEV}levs/${PROC}procs/ocean_model.exe
-                                fi
-                                ln -s $1 ${NAME}_${VERTLEV}levs/${PROC}procs/ocean_model.exe
-                        fi
+                                        if [ ${ADVECTION_ROUTINE:0:3} == &quot;std&quot; ]; then
+                                                FCT_ON=&quot;.false.&quot;
+                                                ADV_ORDER=${ADVECTION_ROUTINE:3}
+                                        elif [ ${ADVECTION_ROUTINE:0:3} == &quot;fct&quot; ]; then
+                                                FCT_ON=&quot;.true.&quot;
+                                                ADV_ORDER=${ADVECTION_ROUTINE:3}
+                                        fi
 
-                        ## Copy run information to run directory
-                        if [ $# -ge 2 ]; then
-                                cp $2 ${NAME}_${VERTLEV}levs/${PROC}procs/.
-                        fi
+                                        for PROC in $PROCS
+                                        do
 
-                        echo &quot;${CUR_DIR}/${NAME}_${VERTLEV}levs/${PROC}procs&quot; &gt;&gt; run_paths
+                                                ## Compute scaled spacing, time_step, and viscosities
+                                                D_SPACING=`echo &quot;scale=4; ${SPACING}/${REF_SPACING}&quot; | bc`
+                                                STATS=`echo &quot; $TOTAL_TIME / $TIME_STEP / 10 &quot; | bc`
+
+                                                RUN_NAME=${NAME}_${VERTLEV}levs/${TIME_STEPPER}_${TIME_STEP}_${ADVECTION_ROUTINE}/${PROC}procs
+
+                                                mkdir -p ${RUN_NAME}
+
+                                                pmetis ${TCNAME}_${NAME}_${VERTLEV}levs.graph.info $PROC &gt; /dev/null
+
+                                                ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.graph.info ${RUN_NAME}/graph.info
+                                                ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.graph.info.part.${PROC} ${RUN_NAME}/graph.info.part.${PROC}
+                                                ln -f -s ${CUR_DIR}/${NAME}_${VERTLEV}levs/${TCNAME}_${NAME}_${VERTLEV}levs.grid.nc ${RUN_NAME}/grid.nc
+
+                                                ## Copy executable to run directory
+                                                if [ $# -ge 1  ]; then
+                                                        if [ -e ${RUN_NAME}/ocean_model.exe ]; then
+                                                                unlink ${RUN_NAME}/ocean_model.exe
+                                                        fi
+
+                                                        ln -s $1 ${RUN_NAME}/ocean_model.exe
+                                                fi
+
+                                                ## Copy run information to run directory
+                                                if [ $# -ge 2 ]; then
+                                                        cp $2 ${RUN_NAME}/.
+                                                fi
+
+                                                echo &quot;${CUR_DIR}/${RUN_NAME}&quot; &gt;&gt; run_paths
+
+                                                ## Generate new namelist.input file for test case
+                                                cat MPAS-namelist.input.template  \
+                                                        | sed &quot;s/config_time_integration .*/config_time_integration = ${TIME_INTEGRATOR}/g&quot; \
+                                                        | sed &quot;s/config_n_btr_subcycles .*/config_n_btr_subcycles = ${SUB_CYCLES}/g&quot; \
+                                                        | sed &quot;s/config_dt .*/config_dt = ${TIME_STEP}/g&quot; \
+                                                        | sed &quot;s/config_stats_interval .*/config_stats_interval = ${STATS}/g&quot; \
+                                                        | sed &quot;s/config_monotonic .*/config_monotonic = ${FCT_ON}/g&quot; \
+                                                        | sed &quot;s/config_horiz_tracer_adv_order .*/config_horiz_tracer_adv_order = ${ADV_ORDER}/g&quot; \
+                                                        &gt; ${RUN_NAME}/namelist.input
+                                        done
+                                done
+                        done
                 done
 
                 mv ${TCNAME}_${NAME}_${VERTLEV}levs* ${NAME}_${VERTLEV}levs/.
-
-                ## Generate new namelist.input file for test case
-                cat MPAS-namelist.input.template  \
-                    | sed &quot;s/config_h_mom_eddy_visc2 .*/config_h_mom_eddy_visc2 = ${VISC_H}/g&quot; \
-                    | sed &quot;s/config_h_tracer_eddy_diff2 .*/config_h_tracer_eddy_diff2 = ${VISC_H}/g&quot; \
-                        | sed &quot;s/config_vert_visc .*/config_vert_visc = ${VISC_V}/g&quot; \
-                        | sed &quot;s/config_vert_diff .*/config_vert_diff = ${VISC_V}/g&quot; \
-                        | sed &quot;s/config_dt .*/config_dt = ${TIME_STEP}/g&quot; \
-                        | sed &quot;s/config_stats_interval .*/config_stats_interval = ${STATS}/g&quot; \
-                        &gt; ${NAME}_${VERTLEV}levs/namelist.input
-
         done
 
         rm map

</font>
</pre>