Commit e7f2480b authored by Anthony's avatar Anthony
Browse files

Merge branch 'newdivbas' of gitlab.in2p3.fr:ipsl/lmd/intro/routingpp into newdivbas

parents 56479af2 711f4d63
......@@ -17,7 +17,7 @@ MODULE routing_reg
REAL(r_std), SAVE :: hydro_meandz = 0.0
REAL(r_std), SAVE :: hydro_mindz = 0.0
REAL(r_std), SAVE :: hydro_dzprecision = 0.1
REAL(r_std), SAVE :: hydro_dzprecision = 0.05
REAL(r_std), SAVE, ALLOCATABLE, DIMENSION(:,:) :: routing_area_glo !! Surface of basin (m^2)
REAL(r_std), SAVE, ALLOCATABLE, DIMENSION(:,:) :: routing_orog_mean_glo !! Mean topography (m)
......@@ -2151,7 +2151,9 @@ SUBROUTINE routing_reg_divbas_divide(nb_htu, nbv,nbi,nbj, ijdimmax, tbname, tsz,
!
LOGICAL :: okpoint=.TRUE.
LOGICAL :: debug =.FALSE.
LOGICAL :: Limitdz = .TRUE.
! If Limitdz=.TRUE. then the dz will be limited to hydro_dzprecision.
! Else it will just be limited to zero.
LOGICAL :: Limitdz = .FALSE.
!
!
INTEGER(i_std) :: main_loc(nbv,2), tri_loc(nbne,nbv,2)
......@@ -2356,6 +2358,8 @@ SUBROUTINE routing_reg_divbas_divide(nb_htu, nbv,nbi,nbj, ijdimmax, tbname, tsz,
!
IF ( Limitdz ) THEN
dorog = MAX(hydro_dzprecision, dorog)
ELSE
dorog = MAX(0.0, dorog)
ENDIF
distance = SUM(main_len(:cnt))
! topoindex is in km while distance and dorog are in meters
......
......@@ -277,12 +277,12 @@ class HydroGraph :
ncvar.units = "count"
ncvar[:] = thist[:]
#
maxtstep = weighted_quantile(gvar[~np.isnan(gvar)]*usedtcst, 0.50, sample_weight=garea[~np.isnan(gvar)])
maxtstep = weighted_quantile(gvar[~np.isnan(gvar)]*usedtcst, 0.25, sample_weight=garea[~np.isnan(gvar)])
mtstep = outnf.createVariable("MaxTimeStep"+addname, vtyp, ('dimpara'), fill_value=NCFillValue)
if addname.lower() == "stream" :
mtstep.title = "Maximum time-step for the HTU's stream reservoir"
mtstep.title = "Maximum time-step for stream reservoir of HTUs"
else :
mtstep.title = "Maximum time-step for the HTU's fast reservoir"
mtstep.title = "Maximum time-step for fast reservoir of HTUs"
mtstep.units = "s"
mtstep[:] = maxtstep
return
......@@ -394,7 +394,7 @@ class HydroGraph :
"topoindex_stream", "Topographic index of the retention time for stream res.", "km", self.topo_resid_stream[:,:], vtyp)
# Add another distribution ? Or replace the other ?
self.add_tstepdistrib(outnf, procgrid, NCFillValue, part, self.topo_resid_stream[:,:], self.routing_area[:,:], \
self.route_innum[:,:], vtyp, nbbins, tcst, addname = "stream")
self.route_innum[:,:], vtyp, nbbins, tcst, addname = "Stream")
#
# Geometric properties of HTU
......
......@@ -19,7 +19,7 @@ log_master, log_world = getargs.getLogger(__name__)
INFO, DEBUG, ERROR = log_master.info, log_master.debug, log_world.error
INFO_ALL, DEBUG_ALL = log_world.info, log_world.debug
#
elevation_precision=0.1
elevation_precision=0.05
#
def getbox(ncdf, corners) :
#
......
......@@ -3,22 +3,25 @@
#PBS -N BuildHTUs_EuroSW
#
#PBS -j oe
#PBS -l nodes=2:ppn=32
#PBS -l walltime=42:00:00
#PBS -l vmem=500g,mem=240g
#PBS -l nodes=1:ppn=64
#PBS -l walltime=24:00:00
#PBS -l vmem=250g,mem=250g
#
cd ${PBS_O_WORKDIR}
echo "PPN = ${PBS_NUM_PPN} NODES = ${PBS_NUM_NODES}"
export NSLOTS=$(($PBS_NUM_NODES*$PBS_NUM_PPN))
#
# Set the right Python 3 Anaconda environment
#
date
source ../../Environment
module load python/3.6-anaconda50
python --version
#
# Clean-up. Weights are kept for future runs.
#
/bin/rm -f DocumentationInterface *.txt check.out
WF=$(grep WeightFile run.def.ref | cut -d"=" -f 2 | sed -e's/ //g')
/bin/rm -f DocumentationInterface Out_*.txt Weight_*.txt check.out
WF=$(grep WeightFile run.def | cut -d"=" -f 2 | sed -e's/ //g')
#
# If weights file does not exist, then compute it quickly
#
......@@ -39,13 +42,13 @@ fi
mpirun -n ${NSLOTS} python ../../RoutingPreProc.py
if [ $? -gt 0 ] ; then
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
echo "X Run on EuroSW failed X"
echo "X Run on EuroSW failed ${NB} X"
echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
exit
else
echo "======================================="
echo "= Run on EuroSW successful ="
echo "= Run on EuroSW successful ${NB} ="
echo "======================================="
fi
#
date
ls -l
......@@ -2,25 +2,27 @@
#
#
#
EarthRadius = 6378000.
#
ModelGridFile = /bdd/MEDI/workspaces/polcher/NewDivBas/EuroSW/geo_EuroSW.nc
HydroFile = /bdd/ORCHIDEE_Forcing/Routing/Hydro4ORCH/HydroSHEDS_MED.nc
#
WeightFile = /bdd/MEDI/workspaces/polcher/NewDivBas/EuroSW/Weights_EuroSW.nc
HydroFile = /bdd/ORCHIDEE_Forcing/Routing/Hydro4ORCH/HydroSHEDS_qGlobal.nc
#
# Configuration for the graph to be generated
#
nbasmax = 5
nbasmax = 7
#
# Number of operation of simplification performed together
#
numop = 100
#
# Output
#
GraphFile = /bdd/MEDI/workspaces/polcher/NewDivBas/EuroSW/EuroSW_HydroSHEDS_graph.nc
#
WeightFile = /bdd/MEDI/workspaces/polcher/NewDivBas/EuroSW/Weights_EuroSW.nc
#
#
# File containing infrastructures to be placed.
# Maximum error in the distance of the station in km
MaxDistErr = 50.0
# Maximum error in the distance of the station in km^2
MaxDistErr = 25.0
# Maximum error in the upstream area in %
MaxUpstrErr = 25.0
GRDCFile = /bdd/ORCHIDEE_Forcing/Validation/GRDC/GRDC_Monthly_Jan21_v2.nc
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment