Skip to content
Snippets Groups Projects
Commit 23833171 authored by Stefan Hagemann's avatar Stefan Hagemann :soccer:
Browse files

convert_inflow.com: set river_mouth_mask for source grid

parent c3bc554a
No related branches found
No related tags found
No related merge requests found
......@@ -133,7 +133,8 @@ fi
#
# *** Is mask file for the mouths on the source grid provided.
if [ "$dn_src_mouth" = "" ]; then
echo " No mouth mask on source grid provided - defintion in script expected "
echo " No mouth mask on source grid provided "
echo " Mask is obtained from HD parameter variable FDIR, or it must be defined in the script"
else
if [ -s $dn_ocean ] ; then
echo " Mouth mask on source grid: " $dn_src_mouth
......@@ -514,7 +515,8 @@ esac
# *** Allocate HD mouths
${F90} ${DSRC}/mo_grid.f90 ${DSRC}/mo_time.f90 ${DSRC}/mo_flow_inout.f90 ${DSRC}/mo_interpol.f90 ${DSRC}/mo_convert.f90 ${DSRC}/convert_discharge.f90 -o convert.exe $NC_INCLUDE $NC_LIB
#
case $ISRC in
if [ "$dn_src_mouth" = "" ]; then
case $ISRC in
[123] ) cdo setctomiss,0. -eqc,0. -selvar,FDIR $DNHDPARA hdmouth_mask.nc
cdo setvar,FMOUTH hdmouth_mask.nc rivmouth_source.nc
rm hdmouth_mask.nc ;;
......@@ -533,7 +535,18 @@ case $ISRC in
rm t[12345].nc ;;
[67] ) cdo setvar,FMOUTH $DNHDPARA rivmouth_source.nc ;;
* ) echo 'Treatment of mouth mask needs to be specified -> STOP' ; exit ;;
esac
esac
else
case $ISRC in
[1234] ) cdo -selvar,FDIR $DNHDPARA ts.nc
cdo setvar,FMOUTH -setgrid,ts.nc $dn_src_mouth rivmouth_source.nc
rm ts.nc ;;
5 ) cdo -selvar,lon $DNHDPARA ts.nc
cdo setvar,FMOUTH -setgrid,ts.nc $dn_src_mouth rivmouth_source.nc
rm ts.nc ;;
* ) cdo setvar,FMOUTH $dn_src_mouth rivmouth_source.nc ;;
esac
fi
#
# *** Run the Program to create data that will be used for the remapping of mouth points
# *** --> Creates files hd_to_ocean_mouth.nc, hdmouth_on_oceangrid.nc
......@@ -549,7 +562,18 @@ fi
#
# Add script settings to coupling file
ncatted -O -h -a Settings,global,o,c,"IMODE = $IMODE, ISRC=$ISRC, IOCEAN=$IOCEAN, IBGC=$IBGC" $DNOUT
if [ "$dn_src_mouth" != "" ]; then
ncatted -O -h -a Source_mask,global,o,c,"River mouth mask on source grid: $dn_src_mouth" $DNOUT
fi
YEAR=$YBEG
while [ $YEAR -le $YEND ] ; do
DNOUTFLOW=${DATA_OUT}/${CFLOW}_${CDIS}_on_${OM}${OVS}_${YEAR}.nc
ncatted -O -h -a Settings,global,o,c,"IMODE = $IMODE, ISRC=$ISRC, IOCEAN=$IOCEAN, IBGC=$IBGC" $DNOUTFLOW
if [ "$dn_src_mouth" != "" ]; then
ncatted -O -h -a Source_mask,global,o,c,"River mouth mask on source grid: $dn_src_mouth" $DNOUTFLOW
fi
YEAR=`expr $YEAR + 1`
done
#
if [ $ISRC -eq 6 ] ; then
mv $DNOUT ${DIN}/${OM}/${EXP}_$DNOUT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment