2 Commits 59455a0219 ... 259dac83e2

Autor SHA1 Mensaje Fecha
  Charles Pelletier 259dac83e2 simpler path hace 2 años
  Charles Pelletier f555b121b6 new special rs rebuilt flag hace 2 años
Se han modificado 2 ficheros con 56 adiciones y 45 borrados
  1. 30 25
      templates/scripts/skeleton.sh
  2. 26 20
      templates/scripts/skeleton_isfcpl.sh

+ 30 - 25
templates/scripts/skeleton.sh

@@ -193,7 +193,7 @@ do
             echo "special_restart_from: $special_restart_from"
 
             ### NEMO
-            indir="${run_dir}/../../${special_restart_from}/archive/restart/nemo/$(printf %03d $((special_restart_leg)))"
+            indir="${run_dir}/../../${special_restart_from}/archive/restart/$(printf %03d $((special_restart_leg)))"
             cd ${indir}
             for f in *.nc; do
                 nf=`echo "${f/$special_restart_from/$exp_name}"`
@@ -220,31 +220,36 @@ do
 
 	    dir_rs=`dirname ${special_rs_nemo_stencil}`
 	    base_rs=`basename ${special_rs_nemo_stencil}`
-	    
-	    n_oce_rs=`find ${dir_rs} -name "${base_rs}oce_????.nc" | wc -l`
-	    if(( n_oce_rs != nem_numproc )); then
-		echo "in special_rs_nemo, not the right amount of ocean restart files."
-		echo "${n_oce_rs} instead of ${nem_numproc}. exiting."
-		exit 2
-	    fi
 
-	    n_ice_rs=`find ${dir_rs} -name "${base_rs}ice_????.nc" | wc -l`
-	    if(( n_ice_rs != nem_numproc )); then
-		echo "in special_rs_nemo, not the right amount of ice restart files."
-		echo "${n_ice_rs} instead of ${nem_numproc}. exiting."
-		exit 2
+	    if ${special_rs_nemo_rebuilt}
+	    then
+
+		if [[ -f ${special_rs_nemo_stencil}oce.nc && -f ${special_rs_nemo_stencil}ice.nc ]]
+		then
+		    ln -fs ${special_rs_nemo_stencil}oce.nc restart_oce.nc
+		    ln -fs ${special_rs_nemo_stencil}ice.nc restart_ice.nc
+		else
+		    echo "EXITING. ${special_rs_nemo_stencil}oce.nc or ${special_rs_nemo_stencil}ice.nc not found"
+		    exit 2
+		fi
+
+	    else
+	        for (( n=0 ; n<nem_numproc ; n++ ))
+		do
+		    np=$(printf %04d ${n})
+		    if [[ -f ${special_rs_nemo_stencil}oce_${np}.nc && -f ${special_rs_nemo_stencil}ice_${np}.nc ]]
+		    then
+			ln -fs ${special_rs_nemo_stencil}oce_${np}.nc restart_oce_${np}.nc
+			ln -fs ${special_rs_nemo_stencil}ice_${np}.nc restart_ice_${np}.nc
+		    else
+			echo "EXITING. ${special_rs_nemo_stencil}oce_${np}.nc or ${special_rs_nemo_stencil}ice_${np}.nc not found"
+			exit 2
+		    fi
+		done
 	    fi
-	    
-            for (( n=0 ; n<nem_numproc ; n++ ))
-            do
-		np=$(printf %04d ${n})
-		ln -fs ${special_rs_nemo_stencil}oce_${np}.nc restart_oce_${np}.nc
-		ln -fs ${special_rs_nemo_stencil}ice_${np}.nc restart_ice_${np}.nc
-            done
 
         fi # if $special_restart
 
-
     else # if ! $leg_is_restart
 
         # ---------------------------------------------------------------------
@@ -257,7 +262,7 @@ do
         # ---------------------------------------------------------------------
         cd ${run_dir}
         ### NEMO
-        outdir="${archive_dir}/restart/nemo/$(printf %03d $((leg_number-1)))"
+        outdir="${archive_dir}/restart/$(printf %03d $((leg_number-1)))"
 
 	
         ns=$(printf %08d $(( leg_start_sec / nem_time_step_sec )))
@@ -279,6 +284,7 @@ do
     # -------------------------------------------------------------------------
     # *** Update ocean namelist
     # -------------------------------------------------------------------------
+    
     source build_namelist_cfg.sh > namelist_cfg
 
 
@@ -286,7 +292,6 @@ do
     # *** Launch experiment
     # -------------------------------------------------------------------------
 
-    
     echo "START of mpirun"
     time_begin=$(date +%s)
     mpirun -np "${xio_numproc:?}" "${xio_exe_file:?}" : -np "${nem_numproc:?}" "${nem_exe_file:?}"
@@ -297,7 +302,7 @@ do
     # *** Move output files to archive directory
     # -------------------------------------------------------------------------
     ### NEMO
-    outdir="${archive_dir}/output/nemo/$(printf %03d $((leg_number)))"
+    outdir="${archive_dir}/output/$(printf %03d $((leg_number)))"
     mkdir -p ${outdir}
 
     for v in grid_U grid_V grid_W grid_T icemod SBC scalar SBC_scalar diad_T \
@@ -317,7 +322,7 @@ do
     # *** Move restart files to archive directory
     # -------------------------------------------------------------------------
     ### NEMO
-    outdir="${archive_dir}/restart/nemo/$(printf %03d $((leg_number)))"
+    outdir="${archive_dir}/restart/$(printf %03d $((leg_number)))"
     mkdir -p ${outdir}
 
     ns=$(printf %08d $(( leg_end_sec / nem_time_step_sec )))

+ 26 - 20
templates/scripts/skeleton_isfcpl.sh

@@ -414,31 +414,37 @@ do
 
 	    dir_rs=`dirname ${special_rs_nemo_stencil}`
 	    base_rs=`basename ${special_rs_nemo_stencil}`
-	    
-	    n_oce_rs=`find ${dir_rs} -name "${base_rs}oce_????.nc" | wc -l`
-	    if(( n_oce_rs != nem_numproc )); then
-		echo "in special_rs_nemo, not the right amount of ocean restart files."
-		echo "${n_oce_rs} instead of ${nem_numproc}. exiting."
-		exit 2
-	    fi
 
-	    n_ice_rs=`find ${dir_rs} -name "${base_rs}ice_????.nc" | wc -l`
-	    if(( n_ice_rs != nem_numproc )); then
-		echo "in special_rs_nemo, not the right amount of ice restart files."
-		echo "${n_ice_rs} instead of ${nem_numproc}. exiting."
-		exit 2
+
+	    if ${special_rs_nemo_rebuilt}
+	    then
+
+		if [[ -f ${special_rs_nemo_stencil}oce.nc && -f ${special_rs_nemo_stencil}ice.nc ]]
+		then
+		    ln -fs ${special_rs_nemo_stencil}oce.nc restart_oce.nc
+		    ln -fs ${special_rs_nemo_stencil}ice.nc restart_ice.nc
+		else
+		    echo "EXITING. ${special_rs_nemo_stencil}oce.nc or ${special_rs_nemo_stencil}ice.nc not found"
+		    exit 2
+		fi
+
+	    else
+	        for (( n=0 ; n<nem_numproc ; n++ ))
+		do
+		    np=$(printf %04d ${n})
+		    if [[ -f ${special_rs_nemo_stencil}oce_${np}.nc && -f ${special_rs_nemo_stencil}ice_${np}.nc ]]
+		    then
+			ln -fs ${special_rs_nemo_stencil}oce_${np}.nc restart_oce_${np}.nc
+			ln -fs ${special_rs_nemo_stencil}ice_${np}.nc restart_ice_${np}.nc
+		    else
+			echo "EXITING. ${special_rs_nemo_stencil}oce_${np}.nc or ${special_rs_nemo_stencil}ice_${np}.nc not found"
+			exit 2
+		    fi
+		done
 	    fi
-	    
-            for (( n=0 ; n<nem_numproc ; n++ ))
-            do
-		np=$(printf %04d ${n})
-		ln -fs ${special_rs_nemo_stencil}oce_${np}.nc restart_oce_${np}.nc
-		ln -fs ${special_rs_nemo_stencil}ice_${np}.nc restart_ice_${np}.nc
-            done
 
         fi # if $special_restart
 
-
     else # if ! $leg_is_restart
 
         # ---------------------------------------------------------------------