Convert file types in Parflow - Wei64380/Parflow-CLM GitHub Wiki
-
#Import the ParFlow TCL package
-
lappend auto_path $env(PARFLOW_DIR)/bin
-
package require parflow
-
namespace import Parflow::*
-
set tcl_precision 16
-
#-----------------------------------------------------------------------------
-
#File input version number
-
#-----------------------------------------------------------------------------
-
pfset FileVersion 4
-
set runname LW
-
#-----------------------------------------------------------------------------
-
#Process Topology
-
#-----------------------------------------------------------------------------
-
pfset Process.Topology.P 2
-
pfset Process.Topology.Q 1
-
pfset Process.Topology.R 1
-
#-----------------------------------------------------------------------------
-
#Computational Grid
-
#-----------------------------------------------------------------------------
-
pfset ComputationalGrid.Lower.X 0.0
-
pfset ComputationalGrid.Lower.Y 0.0
-
pfset ComputationalGrid.Lower.Z 0.0
-
pfset ComputationalGrid.DX 1000.0
-
pfset ComputationalGrid.DY 1000.0
-
pfset ComputationalGrid.DZ 2.0
-
pfset ComputationalGrid.NX 41
-
pfset ComputationalGrid.NY 41
-
pfset ComputationalGrid.NZ 50
-
#-----------------------------------------------------------------------------
-
#Names of the GeomInputs
-
#-----------------------------------------------------------------------------
-
pfset GeomInput.Names "box_input indi_input"
-
#-----------------------------------------------------------------------------
-
#Domain Geometry Input
-
#-----------------------------------------------------------------------------
-
pfset GeomInput.box_input.InputType Box
-
pfset GeomInput.box_input.GeomName domain
-
#-----------------------------------------------------------------------------
-
#Domain Geometry
-
#-----------------------------------------------------------------------------
-
pfset Geom.domain.Lower.X 0.0
-
pfset Geom.domain.Lower.Y 0.0
-
pfset Geom.domain.Lower.Z 0.0
-
pfset Geom.domain.Upper.X 41000.0
-
pfset Geom.domain.Upper.Y 41000.0
-
pfset Geom.domain.Upper.Z 100.0
-
pfset Geom.domain.Patches "x-lower x-upper y-lower y-upper z-lower z-upper"
-
#-----------------------------------------------------------------------------
-
Domain
-
#-----------------------------------------------------------------------------
-
pfset Domain.GeomName "domain"
-
pfundist $runname
-
pfundist $runname.out.manning.pfb
-
set mask [pfload $runname.out.mask.pfb]
-
set slope_x [pfload LW.slopex.pfb]
-
set slope_y [pfload LW.slopey.pfb]
-
set top [Parflow::pfcomputetop $mask]
-
set bottom [Parflow::pfcomputebottom $mask]
-
set silonamemask [format "%s.mask.silo" $runname]
-
set silonameslopex [format "%s.xslope.silo" $runname]
-
set silonameslopey [format "%s.yslope.silo" $runname]
-
pfsave $mask -silo $silonamemask
-
pfsave $slope_x -silo $silonameslopex
-
pfsave $slope_y -silo $silonameslopey
-
set runnumb 73
-
set verbose 1
-
for {set i 1} {$i <= $runnumb} {incr i*5} {
-
set pfbnamesaturation [format "%s.out.satur.%05d.pfb" $runname $i]
-
set silonamesaturation [format "%s.out.satur.%05d.silo" $runname $i]
-
set topsilonamesaturation [format "%s.out.satur.top.%05d.silo" $runname $i]
-
set bottomsilonamesaturation [format "%s.out.satur.bottom.%05d.silo" $runname $i]
-
set toptextsaturation [format "%s.out.satur.top.%05d.txt" $runname $i]
-
set bottomtextsaturation [format "%s.out.satur.bottom.%05d.txt" $runname $i]
-
set saturation [pfload $pfbnamesaturation]
-
pfsave $saturation -silo $silonamesaturation
-
set top_saturation [Parflow::pfextracttop $top $saturation]
-
set bottom_saturation [Parflow::pfcomputebottom $bottom $saturation]
-
pfsave $top_saturation -silo $topsilonamesaturation
-
pfsave $bottom_saturation -silo $bottomsilonamesaturation
-
pfsave $top_saturation -sa $toptextsaturation
-
pfsave $bottom_saturation -sa $bottomtextsaturation
-
}