Skip to content

Commit

Permalink
update MEDUSA - adapt field and file def - forgot to link nemo in the…
Browse files Browse the repository at this point in the history
… slurm script ans adapt the storage script to flag the corrupted outputs
  • Loading branch information
jupalm committed Dec 19, 2024
1 parent 78ea481 commit 1233ce7
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 12 deletions.
2 changes: 1 addition & 1 deletion cfgs/GLOBAL_QCO_MEDUSA/eORCA025/axis_def_nemo-medusa.xml
33 changes: 30 additions & 3 deletions cfgs/GLOBAL_QCO_MEDUSA/eORCA025/e025tordf.slurm
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,32 @@ export OMP_NUM_THREADS=1
srcdir=${PWD}/OUTPUT/
dstroot=$1 ## target storing directory
ecount=0


# ========================================================
## module loads
module load cray-mpich/8.1.23
module load cray-hdf5-parallel/1.12.2.1
module load cray-netcdf-hdf5parallel/4.9.0.1


# ========================================================
# Define useful functions
get_time_count () {
VARNAME=time_counter
NAMNAME=$1
VAR=$(ncdump -h ${NAMNAME} | grep "time_counter = ")
VAR=${VAR%\ *}
VAR=${VAR#*\(}
echo "$VAR"
}


cd $srcdir

## fresh kill list
## refresh copied and corrupted list
rm to_be_deleted.txt
rm corrupted_list.txt
#
echo ptrc files to proceed :
ls *ptrc*nc
Expand All @@ -50,12 +72,14 @@ do
echo 'Transferring '${numfiles}' for '$g' at '${t}' interval:'
for f in $files
do
if [ ! -f $dstdir/$f ] ; then
time_c=$(get_time_count $f)
if [ ! -f $dstdir/$f ] && [ ${time_c} >= 1 ] ; then
## files not yet store and full --> copy them to storedir
echo rsync -vtpo $f $dstdir
rsync -vtpo $f $dstdir
#cp -p $f $dstdir
if [ $? -eq 0 ] ; then scount=$(( $scount + 1 )) ; fi
else
elif [ ! -f $dstdir/$f ] ; then
## file already there check if files are the same size :
heres=`wc -c $f | cut -d' ' -f1`
theres=`wc -c $dstdir/$f | cut -d' ' -f1`
Expand All @@ -70,6 +94,9 @@ do
echo rsync -vtpo --append $f $dstdir
rsync -vtpo --append $f $dstdir
fi
else
## file not stored because empty or corrupted : record them in corrupted list
echo $f >> corrupted_list.txt
fi
done
if [ $scount -ne $numfiles ] ; then echo 'Errors have occurred' ; ecount=$(( $ecount + 1 )) ; fi
Expand Down
2 changes: 1 addition & 1 deletion cfgs/GLOBAL_QCO_MEDUSA/eORCA025/grid_def_nemo-medusa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ mkdir -p {RESTARTS,OUTPUT}
cd "$NEMO_EXP_DIR"

# Link nemo
#echo ln -fs "$NEMO_EXP_DIR"/../BLD/bin/nemo.exe nemo
#ln -fs "$NEMO_EXP_DIR"/../BLD/bin/nemo.exe nemo
#cp -p "$XIO_HOME"/bin/xios_server.exe xios_server.exe
echo ln -fs "$NEMO_EXP_DIR"/../BLD/bin/nemo.exe nemo
ln -fs "$NEMO_EXP_DIR"/../BLD/bin/nemo.exe nemo
cp -p "$XIO_HOME"/bin/xios_server.exe xios_server.exe
# Run NEMO
sbcast --compress=none ./nemo /tmp/nemo
sbcast --compress=none ./xios_server.exe /tmp/xios_server.exe
Expand Down
2 changes: 1 addition & 1 deletion scripts/add_msa_to_NPD_nemo
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ msasrc=./cfgs/SHARED_MEDUSA/MY_SRC
nemosrc=./cfgs/GLOBAL_QCO_MEDUSA/MY_SRC
echo "updating MEDUSA - MY_SRC files"
#for bibi in cpl_oasis3.F90 oce.F90 par_trc.F90 sbccpl.F90 sbcrnf.F90 stpctl.F90 trcice.F90 trcini.F90 trcnam.F90 trcrst.F90 trcsbc.F90 trcsms.F90 trcwri.F90
for bibi in oce.F90 par_trc.F90 sbccpl.F90 stpctl.F90 trcice.F90 trcini.F90 trcnam.F90 trcrst.F90 trcsbc.F90 trcsms.F90 trcwri.F90 diawri.F90
for bibi in oce.F90 par_trc.F90 sbccpl.F90 stpctl.F90 traqsr.F90 trcice.F90 trcini.F90 trcnam.F90 trcrst.F90 trcsbc.F90 trcsms.F90 trcwri.F90 diawri.F90
do
echo copying ${msasrc}/${bibi} into ${nemosrc}/${bibi}
cp -d ${msasrc}/${bibi} ${nemosrc}/${bibi}
Expand Down

0 comments on commit 1233ce7

Please sign in to comment.