diff --git a/flash2d/compile/Makefiles/Makefile.common b/flash2d/compile/Makefiles/Makefile.common new file mode 100644 index 0000000000000000000000000000000000000000..761efc798b5877b329a63a0da755818a4c71b1fd --- /dev/null +++ b/flash2d/compile/Makefiles/Makefile.common @@ -0,0 +1,266 @@ +#------------------------------------------------------------------------# +# +--------------------------------------------------------------------+ # +# | common stuff (this file must be included from individual Makefile) | # +# +--------------------------------------------------------------------+ # +#------------------------------------------------------------------------# + +#----------------------------------------------------------------# +# OBJECTS # +#----------------------------------------------------------------# +MAINOBJ = \ +FLASH_parameters.o \ +MISC_timing.o \ +MISC_system.o \ +IO_utils.o \ +MISC_outputdata.o \ +IO_vtu.o \ +IO_vtuplot.o + +ifneq ($(strip $(NO_NETCDF)), yes) +MAINOBJ += \ +IO_netcdfplot.o +endif + +MAINOBJ += \ +ADV_wind.o \ +SLM_initial.o \ +SLM_errorestimate.o \ +ADV_rhs.o \ +SLM_simple.o \ +SLM_advanced.o \ +ADV_semilagrange.o \ +Flash90.o + +#----------------------------------------------------------------# +# COMPILE STEP # +#----------------------------------------------------------------# + +.SUFFIXES: .F90 .f90 $(SUFFIXES) + +.F90.o: + @echo "make: Building object module from "$< + $(F90) $(FFLAGS) $(INCS) -c $< + +.f90.o: + @echo "make: Building object module from "$< + $(F90) $(FFLAGS) $(INCS) -c $< + +.c.o: + @echo "make: Building object module from "$< + $(CC) $(CFLAGS) $(INCS) -D$(MACHINE) -c $< + +clearsrc:: + @rm -f *.f90 *.h *.F90 + +clearex:: + @rm -f $(MAKETHING) Flash90* fort.* + +cleardat:: + @rm -f *.dat *.ftf + +clean:: + @rm -f *.o *.i90 *.$(MODEND) core + +tidy:: + make clean + make clearex + make cleardat + make clearsrc + +#----------------------------------------------------------------# +# THIS COPIES REQUIRED DATA FILES # +#----------------------------------------------------------------# + +datacopy:: + @cp $(DATDIR)/Domain.dat . + @cp $(DATDIR)/Initial.dat . + @cp $(DATDIR)/Land.dat . + @cp $(DATDIR)/Triang.dat . + @cp $(DATDIR)/Parameters.dat . + @cp $(DATDIR)/default.ftf . + +datasphere:: + @make datacopy + @cp $(DATDIR)/DomainSph.global.dat Domain.dat + @cp $(DATDIR)/TriangSph.ico.dat Triang.dat + + +avisocopy:: + @cp $(DATDIR)/Domain_aviso.dat . + @cp $(DATDIR)/Initial.dat . + @cp $(DATDIR)/Land.dat . + @cp $(DATDIR)/Triang_aviso.dat . + @cp $(DATDIR)/Parameters_aviso.dat . + @cp $(DATDIR)/Wind_aviso.dat . + @cp $(DATDIR)/default.ftf . + +ShallowWaterCopy:: + @cp $(DATDIR)/Domain.SWCosine.dat Domain.dat + @cp $(DATDIR)/Triang.SWCosine.dat Triang.dat + @cp $(DATDIR)/Parameters.SW.dat Parameters.dat + +#----------------------------------------------------------------# +# THIS CREATES PREDEFINED OPTIONS # +#----------------------------------------------------------------# + +maincopy:: + @cp $(SRCDIR)/*.f90 . + @cp $(SRCDIR)/*.F90 . + @cp $(SYSDIR)/*.f90 . + @cp $(TIMDIR)/*.f90 . + +Slot:: + @make maincopy + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + +Potsdam:: + @cp $(OPTDIR)/ADV_wind.file.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.file.f90 SLM_initial.f90 + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual.f90 SLM_advanced.f90 + +Analytic:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.analytic.f90 SLM_advanced.f90 + +Bar:: + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/ADV_wind.bar.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.bar.f90 SLM_initial.f90 + +Conservative:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cons.f90 SLM_advanced.f90 + +Dual:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual.f90 SLM_advanced.f90 + +Cellintegrated:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cellint.f90 SLM_advanced.f90 + +Quadrature:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature.f90 SLM_advanced.f90 + +Quadrature7:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature7.f90 SLM_advanced.f90 + +MPSLM:: + @cp $(OPTDIR)/ADV_semilagrange.adv.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.mpslm.f90 SLM_advanced.f90 + +ConvWind:: + @cp $(OPTDIR)/ADV_wind.conv.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.conv.f90 SLM_initial.f90 + +DiagWind:: + @cp $(OPTDIR)/ADV_wind.diag.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.diag.f90 SLM_initial.f90 + +Kaeser:: + @cp $(OPTDIR)/ADV_wind.kaeser.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.kaeser.f90 SLM_initial.f90 + +CircWind:: + @cp $(OPTDIR)/ADV_wind.circ.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.circ.f90 SLM_initial.f90 + +NoWind:: + @cp $(OPTDIR)/ADV_wind.nowind.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.nowind.f90 SLM_initial.f90 + +LeVeque: + @cp $(OPTDIR)/ADV_wind.leveque.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.leveque.f90 SLM_initial.f90 + +Aviso: + @make Slot + @make Dual + @cp $(OPTDIR)/ADV_wind_aviso.file.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.aviso.f90 SLM_initial.f90 + +Algae: + @make Slot + @make Dual + @cp $(OPTDIR)/ADV_rhs.algae.f90 ADV_rhs.f90 + @cp $(OPTDIR)/SLM_simple.algae.f90 SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.algae.f90 SLM_advanced.f90 + @cp $(OPTDIR)/ADV_wind.circ.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.algae.f90 SLM_initial.f90 + @cp $(OPTDIR)/ADV_semilagrange.algae.F90 ADV_semilagrange.F90 + +AlgaeBaltic: + @make Algae + @cp $(OPTDIR)/ADV_wind.algae.f90 ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.algaeBaltic.f90 SLM_initial.f90 + @cp $(DATDIR)/Wind_algae.dat Windparam.dat + @cp $(DATDIR)/Triang_algaeBaltic.dat Triang.dat + +Diffusion:: + @make Slot + @make Dual + @make LeVeque + @rm SLM_advanced.f90 + @cp $(OPTDIR)/SLM_advanced.dualdiffusion.F90 SLM_advanced.F90 + +DiffusionNoWindTest:: + @make Slot + @make Dual + @make NoWind + @cp $(OPTDIR)/SLM_initial.circ SLM_initial.f90 + @rm SLM_advanced.f90 + @cp $(OPTDIR)/SLM_advanced.dualdiffusion.F90 SLM_advanced.F90 + +AdvDifErf:: + @make Slot + @make Dual + @cp $(OPTDIR)/ADV_wind.zonal.f90 ADV_wind.f90 + @rm SLM_initial.f90 + @cp $(OPTDIR)/SLM_initial.advdiff.f90 SLM_initial.F90 + @rm SLM_advanced.f90 + @cp $(OPTDIR)/SLM_advanced.dualdiffusion.F90 SLM_advanced.F90 + +ShallowWater: + @make Slot + @cp $(OPTDIR)/FLASH_parameters.SW.f90 FLASH_parameters.f90 + @cp $(OPTDIR)/ADV_semilagrange.SW.F90 ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_advanced.dualSWCosine.f90 SLM_advanced.f90 + @cp $(OPTDIR)/SLM_initial.SWCosine.f90 SLM_initial.f90 + @cp $(OPTDIR)/IO_vtuplot.SW.F90 IO_vtuplot.F90 + +#----------------------------------------------------------------# +# THIS COMPILES THE MAIN PROGRAM # +#----------------------------------------------------------------# + +executable: $(MAINOBJ) + @echo "make: Linking object modules and libraries" + $(LOADER) $(LDFLAGS) -o $(MAKETHING) $(MAINOBJ) $(LIBS) + + +$(MAKETHING):: + @make maincopy +ifneq ($(strip $(NO_MPSLM)),yes) + @make MPSLM +endif + @make executable + +all:: + @make maincopy + @make executable + @make clearsrc + @make clean + +#----------------------------------------------------------------# +# DEPENDENCIES ON INCLUDE FILES # +#----------------------------------------------------------------# diff --git a/flash2d/compile/Makefiles/Makefile_gfortran_plane b/flash2d/compile/Makefiles/Makefile_gfortran_plane new file mode 100644 index 0000000000000000000000000000000000000000..b99e55695573326f38dc973eab9e0c82133bca78 --- /dev/null +++ b/flash2d/compile/Makefiles/Makefile_gfortran_plane @@ -0,0 +1,145 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_gfortran + +# SYSTEM +SYSTEM = gfortran + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = +LAPACKLIB = -framework Accelerate + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = -L/usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/sw2/lib -lnetcdff -lnetcdf +INCNETCDF = -I/sw2/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = -L$(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = gfortran +cc = gcc +CC = g++ +LOADER = gfortran + +# --------------------- next are for debugging ------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -fbounds-check -ggdb -fpic -funderscoring # -C + CFLAGS = -ggdb -fpic + LDFLAGS = -ggdb +endif +# --------------------- next are for normal compilation ---------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -fPIC -funderscoring + CFLAGS = -fpic + LDFLAGS = +endif +# --------------------- next are for optimization ---------------# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O3 -fPIC -funderscoring + CFLAGS = -O3 -fpic + LDFLAGS = -O3 +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +FFLAGS += -D$(MACHINE) +CFLAGS += -D$(MACHINE) + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) $(BLASDIR) $(BLASLIB) \ + $(LAPACKDIR) $(LAPACKLIB) \ + $(VISNETDIR) $(VISNETLIB) \ + $(LIBNETCDF) $(CCLIBDIR) $(CCLIB)\ + -lamatos -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/Makefiles/Makefile_gfortran_sphere b/flash2d/compile/Makefiles/Makefile_gfortran_sphere new file mode 100644 index 0000000000000000000000000000000000000000..7b58fd417218f1e963dcf9e936e5b07a145a3fca --- /dev/null +++ b/flash2d/compile/Makefiles/Makefile_gfortran_sphere @@ -0,0 +1,145 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_gfortran + +# SYSTEM +SYSTEM = gfortran + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = +LAPACKLIB = -framework Accelerate + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = -L/usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash-sphere +OPTDIR = $(MAINDIR)/src/options-sphere +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/sw2/lib -lnetcdff -lnetcdf +INCNETCDF = -I/sw2/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = -L$(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = gfortran +cc = gcc +CC = g++ +LOADER = gfortran + +# --------------------- next are for debugging ------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -fbounds-check -ggdb -fpic -funderscoring # -C + CFLAGS = -ggdb -fpic + LDFLAGS = -ggdb +endif +# --------------------- next are for normal compilation ---------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -fPIC -funderscoring + CFLAGS = -fpic + LDFLAGS = +endif +# --------------------- next are for optimization ---------------# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O3 -fPIC -funderscoring + CFLAGS = -O3 -fpic + LDFLAGS = -O3 +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +FFLAGS += -D$(MACHINE) +CFLAGS += -D$(MACHINE) + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) $(BLASDIR) $(BLASLIB) \ + $(LAPACKDIR) $(LAPACKLIB) \ + $(VISNETDIR) $(VISNETLIB) \ + $(LIBNETCDF) $(CCLIBDIR) $(CCLIB)\ + -lsamatos -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/Makefiles/Makefile_intel_plane b/flash2d/compile/Makefiles/Makefile_intel_plane new file mode 100644 index 0000000000000000000000000000000000000000..6015e80e1f067f321e57ed19f008b8a529e6b805 --- /dev/null +++ b/flash2d/compile/Makefiles/Makefile_intel_plane @@ -0,0 +1,144 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_intel + +# SYSTEM +SYSTEM = std-f90 + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = $(MKLROOT)/lib +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = $(MKLROOT)/lib #-L$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95 +LAPACKLIB = -I${MKLROOT}/include/lp64 -I${MKLROOT}/include ${MKLROOT}/lib/libmkl_blas95_lp64.a \ + ${MKLROOT}/lib/libmkl_lapack95_lp64.a ${MKLROOT}/lib/libmkl_intel_lp64.a \ + ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_sequential.a \ + -lpthread -lm # -llapack95 + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = /usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/usr/local/lib -lnetcdff -lnetcdf +INCNETCDF = -I/usr/local/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = ifort +cc = gcc +CC = g++ +LOADER = ifort + +# -------------- next for debugging -----------------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -g -fpic -Wl,-no_pie -DLAPACK95 -DUSE_MKL -check all #none # all + CFLAGS = -g -m64 -check + LDFLAGS = -g -save-temps -static-intel -fpic -Wl,-no_pie -check all #none # all +endif +# -------------- next for normal compilation --------------------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -DLAPACK95 -DUSE_MKL + CFLAGS = + LDFLAGS = -ifport +endif +# -------------- next with aggresive optimization (Pentium M) ---# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O -DLAPACK95 -DUSE_MKL + CFLAGS = -O + LDFLAGS = -O -ifport +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +# -------- next flag for using dummy graphics library -----------# +LIBS = -lamatos $(LIBNETCDF) -L$(LIBDIR) -I$(MODDIR) -L$(BLASDIR) $(BLASLIB) \ + -L$(LAPACKDIR) $(LAPACKLIB) $(BLASLIB) $(VISNETLIB) \ + $(CCLIB) -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) -I$(MKLROOT)/include/intel64/lp64 #\ +# -I$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95/lapack95_modules + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/Makefiles/Makefile_intel_sphere b/flash2d/compile/Makefiles/Makefile_intel_sphere new file mode 100644 index 0000000000000000000000000000000000000000..17ce4448098bb4b9a01c0e3a72e66e375ab4df4d --- /dev/null +++ b/flash2d/compile/Makefiles/Makefile_intel_sphere @@ -0,0 +1,152 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_intel + +# SYSTEM +SYSTEM = std-f90 + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = $(MKLROOT)/lib +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = $(MKLROOT)/lib #-L$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95 +LAPACKLIB = -I${MKLROOT}/include/lp64 -I${MKLROOT}/include ${MKLROOT}/lib/libmkl_blas95_lp64.a \ + ${MKLROOT}/lib/libmkl_lapack95_lp64.a ${MKLROOT}/lib/libmkl_intel_lp64.a \ + ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_sequential.a \ + -lpthread -lm # -llapack95 + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = -L/usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash-sphere +OPTDIR = $(MAINDIR)/src/options-sphere +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/usr/local/lib -lnetcdff -lnetcdf +INCNETCDF = -I/usr/local/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = ifort +cc = gcc +CC = g++ +LOADER = ifort + +# -------------- next for debugging -----------------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -g -fpic -Wl,-no_pie -DLAPACK95 -DUSE_MKL -check all #none # all + CFLAGS = -g -m64 -check + LDFLAGS = -g -save-temps -static-intel -fpic -Wl,-no_pie -check all #none # all +endif +# -------------- next for normal compilation --------------------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -DLAPACK95 -DUSE_MKL + CFLAGS = + LDFLAGS = -ifport +endif +# -------------- next with aggresive optimization (Pentium M) ---# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O -DLAPACK95 -DUSE_MKL + CFLAGS = -O + LDFLAGS = -O -ifport +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +FFLAGS += -D$(MACHINE) +CFLAGS += -D$(MACHINE) + +# -------- next flag for using dummy graphics library -----------# +LIBS = -lsamatos $(LIBNETCDF) -L$(LIBDIR) -I$(MODDIR) -L$(BLASDIR) $(BLASLIB) \ + -L$(LAPACKDIR) $(LAPACKLIB) $(BLASLIB) $(VISNETLIB) \ + $(CCLIB) -lm +#LIBS = -lsamatos -lm -L$(LIBDIR) $(BLASDIR) $(BLASLIB) \ +# $(LAPACKDIR) $(LAPACKLIB) \ +# $(VISNETDIR) $(VISNETLIB) \ +# $(LIBNETCDF) $(CCLIBDIR) $(CCLIB)\ + + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) #-I$(MKLROOT)/include/intel64/lp64 #\ +# -I$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95/lapack95_modules + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/irix/Makefile b/flash2d/compile/irix/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c179729b8b959c373d196f205b2bfb0c2a5f68f2 --- /dev/null +++ b/flash2d/compile/irix/Makefile @@ -0,0 +1,264 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# --- this is for irix --- # +################################################################## + +# MACHINE +MACHINE = irix + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Development + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = + +# SET LAPACK DIRECTORY PATH +# !! This has to be alterd by user !! +LAPACKDIR = +LAPACKLIB = -lscs + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff \ + -lXmu -lX11 + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = +CCLIB = -lpthread -lC + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/lib/SINGLE +INCDIR = $(ROOTDIR)/include +MODDIR = $(ROOTDIR)/include/SINGLE +MAINDIR = $(ROOTDIR)/flash2d + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/std-f90 +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/$(MACHINE) + +# SET LIBRARY PATHS +LIBNETCDF = -L/home/bornemann/m3/lib/IRIX -lnetcdf + +# SET INCLUDE PATHS +INCNETCDF = /home/bornemann/m3/include +AMATOS = $(MODDIR)/GRID_API.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR SGI # +#----------------------------------------------------------------# + +F90 = f90 +CC = cc +LOADER = f90 +# --------------------- next three for debugging ----------------# +# FFLAGS = -n32 -g -check_bounds -DEBUG:div_check=3:trap_uninitialized=ON:verbose_runtime=ON +# CFLAGS = -g +# LDFLAGS = -n32 -g +# --------------------- next three for optimized debugging ------# +FFLAGS = -n32 -O1 -OPT:Olimit=2069 -g3 +CFLAGS = -O1 -g3 +LDFLAGS = -n32 -O1 -OPT:Olimit=2069 -g3 +# --------------------- next three with optimization ------------# +# FFLAGS = -O3 -n32 +# CFLAGS = -O +# LDFLAGS = -O3 -n32 +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(BLASDIR) -L$(LAPACKDIR) -L/usr/lib32/internal -L$(LIBDIR) \ + -L$(VISNETDIR) -L$(CCLIBDIR) -rpath$(LIBDIR) \ + -lamatos $(LAPACKLIB) $(BLASLIB) $(LIBNETCDF) $(VISNETLIB) \ + $(CCLIB) -lm +INCS = -I$(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +################################################################## +# AFTER THIS LINE, NO CHANGES SHOULD BE NECESSARY # +################################################################## + +#----------------------------------------------------------------# +# OBJECTS # +#----------------------------------------------------------------# +MAINOBJ = \ +FLASH_parameters.o \ +MISC_timing.o \ +MISC_system.o \ +IO_utils.o \ +IO_matlabplot.o \ +IO_gmvplot.o \ +VisNET4Flash.o \ +IO_visnetplot.o \ +IO_netcdfplot.o \ +SLM_initial.o \ +SLM_errorestimate.o \ +ADV_wind.o \ +ADV_rhs.o \ +SLM_simple.o \ +SLM_advanced.o \ +ADV_semilagrange.o \ +Flash90.o + +#----------------------------------------------------------------# +# COMPILE STEP # +#----------------------------------------------------------------# + +.SUFFIXES: .F90 .f90 $(SUFFIXES) + +.F90.o: + @echo "make: Building object module from "$< + $(F90) $(FFLAGS) $(INCS) -c $< + +.f90.o: + @echo "make: Building object module from "$< + $(F90) $(FFLAGS) $(INCS) -c $< + +.c.o: + @echo "make: Building object module from "$< + $(CC) $(CFLAGS) $(INCS) -D$(MACHINE) -c $< + +clearsrc:: + @rm -f *.f90 *.h *.F90 + +clearex:: + @rm -f $(MAKETHING) Flash90* fort.* + +cleardat:: + @rm -f *.dat + +clean:: + @rm -f *.o *.$(MODEND) core + +tidy:: + make clean + make clearex + make cleardat + make clearsrc + +#----------------------------------------------------------------# +# THIS COPIES REQUIRED DATA FILES # +#----------------------------------------------------------------# + +datacopy:: + @cp $(DATDIR)/Domain.dat . + @cp $(DATDIR)/Initial.dat . + @cp $(DATDIR)/Land.dat . + @cp $(DATDIR)/Triang.dat . + @cp $(DATDIR)/Parameters.dat . + +#----------------------------------------------------------------# +# THIS CREATES PREDEFINED OPTIONS # +#----------------------------------------------------------------# + +maincopy:: + @cp $(SRCDIR)/*.f90 . + @cp $(SRCDIR)/*.F90 . + @cp $(SYSDIR)/*.f90 . + @cp $(TIMDIR)/*.f90 . + +Slot:: + @make maincopy + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Potsdam:: + @cp $(OPTDIR)/ADV_wind.file ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.file SLM_initial.f90 + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual SLM_advanced.f90 + +Analytic:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.analytic SLM_advanced.f90 + +Bar:: + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/ADV_wind.bar ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.bar SLM_initial.f90 + +Conservative:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cons SLM_advanced.f90 + +Dual:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual SLM_advanced.f90 + +Cellintegrated:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cellint SLM_advanced.f90 + +Quadrature:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature SLM_advanced.f90 + +Quadrature7:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature7 SLM_advanced.f90 + +MPSLM:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.mpslm SLM_advanced.f90 + +ConvWind:: + @cp $(OPTDIR)/ADV_wind.conv ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.conv SLM_initial.f90 + +DiagWind:: + @cp $(OPTDIR)/ADV_wind.diag ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.diag SLM_initial.f90 + +Kaeser:: + @cp $(OPTDIR)/ADV_wind.kaeser ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.kaeser SLM_initial.f90 + +CircWind:: + @cp $(OPTDIR)/ADV_wind.circ ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.circ SLM_initial.f90 + +#----------------------------------------------------------------# +# THIS COMPILES THE MAIN PROGRAM # +#----------------------------------------------------------------# + +executable: $(MAINOBJ) + @echo "make: Linking object modules and libraries" + $(LOADER) $(LDFLAGS) -o $(MAKETHING) $(MAINOBJ) $(LIBS) + +$(MAKETHING):: + @make maincopy + @make executable + +all:: + @make maincopy + @make executable + @make clearsrc + @make clean + +#----------------------------------------------------------------# +# DEPENDENCIES ON INCLUDE FILES # +#----------------------------------------------------------------# diff --git a/flash2d/compile/irix/Makefile.sam b/flash2d/compile/irix/Makefile.sam new file mode 100644 index 0000000000000000000000000000000000000000..c73a28bb79fc2212d4b33e295ab8841f59a8ff05 --- /dev/null +++ b/flash2d/compile/irix/Makefile.sam @@ -0,0 +1,232 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# --- this is for irix --- # +################################################################## + +# MACHINE +MACHINE = irix + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# SET MAIN DIRECTORY PATH +MAINDIR = $(PWD)/.. + +# SET MORE DIRECTORY PATHS +SRCDIR = $(MAINDIR)/src/flash-sphere +OPTDIR = $(MAINDIR)/src/options +LIBDIR = /home/bornemann/behrens/Development/amatos20/lib +# LIBDIR = /home/bornemann/behrens/lib/IRIX_DEBUG/SAMATOS +SYSDIR = $(MAINDIR)/src/system/std-f90 +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +INCDIR = /home/bornemann/behrens/include +MODDIR = /home/bornemann/behrens/Development/amatos20/ +# MODDIR = /home/bornemann/behrens/lib/IRIX_DEBUG/SAMATOS +BUILDIR = $(MAINDIR)/$(MACHINE) + +# SET LIBRARY PATHS +LIBNETCDF = -L/home/bornemann/m3/lib/IRIX -lnetcdf + +# SET INCLUDE PATHS +INCNETCDF = /home/bornemann/m3/include +AMATOS = $(MODDIR)/GRID_API.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR SUN # +#----------------------------------------------------------------# + +F90 = f90 +CC = cc +LOADER = f90 +# --------------------- next three for debugging ----------------# +FFLAGS = -n32 -g -DNO_NETCDF -check_bounds -DEBUG:div_check=3:trap_uninitialized=ON:verbose_runtime=ON +CFLAGS = -g +LDFLAGS = -n32 -g +# --------------------- next three for optimized debugging ------# +# FFLAGS = -n32 -O1 -OPT:Olimit=2069 -g3 +# CFLAGS = -O1 -g3 +# LDFLAGS = -n32 -O1 -OPT:Olimit=2069 -g3 +# ARFLAGS = vru +# --------------------- next three for profiling ----------------# +# FFLAGS = -n32 -p +# CFLAGS = -p +# LDFLAGS = -n32 -p +# ARFLAGS = vru +# --------------------- next three with optimization ------------# +# FFLAGS = -O3 -n32 +# CFLAGS = -O +# LDFLAGS = -O3 -n32 +# ARFLAGS = vru +# -------- next flag for using dummy graphics library -----------# +#LIBS = -L$(LIBDIR) -rpath$(LIBDIR) -L/usr/lib32/internal \ +# -lBJUGL -lBUI -lamatos -lgpc $(LIBNETCDF) +LIBS = -L$(LIBDIR) -rpath$(LIBDIR) -L/usr/lib32/internal \ + -lamatos $(LIBNETCDF) +INCS = -I$(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +################################################################## +# AFTER THIS LINE, NO CHANGES SHOULD BE NECESSARY # +################################################################## + +#----------------------------------------------------------------# +# OBJECTS # +#----------------------------------------------------------------# +MAINOBJ = \ +FLASH_parameters.o \ +MISC_timing.o \ +MISC_system.o \ +IO_plotdefine.o \ +IO_utils.o \ +IO_matlabplot.o \ +IO_gmvplot.o \ +IO_griddedplot.o \ +SLM_initial.o \ +SLM_errorestimate.o \ +ADV_wind.o \ +ADV_rhs.o \ +SLM_simple.o \ +SLM_advanced.o \ +ADV_semilagrange.o \ +Flash90.o + +#----------------------------------------------------------------# +# COMPILE STEP # +#----------------------------------------------------------------# + +.F90.o: + @echo "make: Building object module from "$< + @$(F90) $(FFLAGS) $(INCS) -c $< + +.f90.o: + @echo "make: Building object module from "$< + @$(F90) $(FFLAGS) $(INCS) -c $< + +.c.o: + @echo "make: Building object module from "$< + @$(CC) $(CFLAGS) $(INCS) -D$(MACHINE) -c $< + +clearsrc:: + @rm -f *.f90 *.h *.F90 + +clearex:: + @rm -f $(MAKETHING) Flash90* fort.* + +cleardat:: + @rm -f *.dat + +clean:: + @rm -f *.o *.$(MODEND) core + +tidy:: + make clean + make clearex + make cleardat + make clearsrc + +#----------------------------------------------------------------# +# THIS COPIES REQUIRED DATA FILES # +#----------------------------------------------------------------# + +datacopy:: + @cp $(DATDIR)/*.dat . + +#----------------------------------------------------------------# +# THIS CREATES THE MAIN PROGRAM # +#----------------------------------------------------------------# + +maincopy:: + @cp $(SRCDIR)/*.f90 . + @cp $(SRCDIR)/*.F90 . + @cp $(SYSDIR)/*.f90 . + @cp $(TIMDIR)/*.f90 . +# @cp $(INCDIR)/BJUGL.f90 . + +Slot:: + @make maincopy + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Potsdam:: + @cp $(OPTDIR)/ADV_wind.file ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.file SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Gerrits:: + @cp $(OPTDIR)/ADV_wind.file ADV_wind.f90 + @cp $(OPTDIR)/ADV_rhs.gerrit ADV_rhs.f90 + @cp $(OPTDIR)/SLM_initial.gerrit SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Burgers:: + @cp $(OPTDIR)/ADV_rhs.burgers ADV_rhs.f90 + @cp $(OPTDIR)/ADV_semilagrange.burgers ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_initial.burgers SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Bar:: + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(SRCDIR)/ADV_wind.bar ADV_wind.f90 + @cp $(SRCDIR)/SLM_initial.bar SLM_initial.f90 + +Conservative:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cons SLM_advanced.f90 + +Dual:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual SLM_advanced.f90 + +Cellintegrated:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cellint SLM_advanced.f90 + +Quadrature:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature SLM_advanced.f90 + +Quadrature7:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature7 SLM_advanced.f90 + +ConvWind:: + @cp $(OPTDIR)/ADV_wind.convergent ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +DivWind:: + @cp $(OPTDIR)/ADV_wind.divergent ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +DiagonalWind:: + @cp $(OPTDIR)/ADV_wind.diagonal ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +executable: $(MAINOBJ) + @echo "make: Linking object modules and libraries" + @$(LOADER) $(LDFLAGS) -o $(MAKETHING) $(MAINOBJ) $(LIBS) + +$(MAKETHING):: + @make maincopy + @make executable + +all:: + @make maincopy + @make executable + @make clearsrc + @make clean + +#----------------------------------------------------------------# +# DEPENDENCIES ON INCLUDE FILES # +#----------------------------------------------------------------# diff --git a/flash2d/compile/linux_g64/Makefile b/flash2d/compile/linux_g64/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..336624dfed8af0cf922414bd0dfcda517b49c9e8 --- /dev/null +++ b/flash2d/compile/linux_g64/Makefile @@ -0,0 +1,141 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = linux_g64 + +# SYSTEM +SYSTEM = gfortran + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Development + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = -L/usr/lib -l:libblas.so.3gf + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = +LAPACKLIB = -L/usr/lib -l:liblapack.so.3gf -lpthread -lc +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = /usr/lib/ +CCLIB = # -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/usr/lib -lnetcdff -lnetcdf +INCNETCDF = -I/usr/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = gfortran +cc = gcc +CC = g++ +LOADER = gfortran + +# --------------------- next are for debugging ------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -fbounds-check -ggdb -fpic -funderscoring # -C + CFLAGS = -ggdb -fpic + LDFLAGS = -ggdb +endif +# --------------------- next are for normal compilation ---------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -fPIC -funderscoring + CFLAGS = -fpic + LDFLAGS = +endif +# --------------------- next are for optimization ---------------# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O3 -fPIC -funderscoring + CFLAGS = -O3 -fpic + LDFLAGS = -O3 +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) -lamatos -L$(BLASDIR) $(BLASLIB) \ + -L$(LAPACKDIR) $(LAPACKLIB) \ + -L$(VISNETDIR) $(VISNETLIB) \ + $(LIBNETCDF) -L$(CCLIBDIR) $(CCLIB)\ + -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/linux_g64/Makefile.sphere b/flash2d/compile/linux_g64/Makefile.sphere new file mode 100644 index 0000000000000000000000000000000000000000..f115f19d5327e7c588d57a920db4af0a6aa7aa2f --- /dev/null +++ b/flash2d/compile/linux_g64/Makefile.sphere @@ -0,0 +1,227 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = linux + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# SET MAIN DIRECTORY PATH +MAINDIR = $(PWD)/.. + +# SET MORE DIRECTORY PATHS +SRCDIR = $(MAINDIR)/src/flash-sphere +OPTDIR = $(MAINDIR)/src/options +LIBDIR = /home/behrens/lib/SAMATOS +SYSDIR = $(MAINDIR)/src/system/nag-f90 +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +INCDIR = /home/behrens/include +MODDIR = /home/behrens/lib/SAMATOS +BUILDIR = $(MAINDIR)/$(MACHINE) + +# SET LIBRARY PATHS +LIBNETCDF = +# LIBNETCDF = -L/usr/local/lib -lnetcdf + +# SET INCLUDE PATHS +INCNETCDF = +# INCNETCDF = -I/usr/local/include +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX # +#----------------------------------------------------------------# + +F90 = f95 +CC = cc +LOADER = f95 +# --------------------- next three for debugging ----------------# +FFLAGS = -g -g90 -C=all -DNO_NETCDF +CFLAGS = -g +LDFLAGS = -g -g90 +# --------------------- next three with optimization ------------# +# FFLAGS = -O3 -DNO_NETCDF +# CFLAGS = -O3 +# LDFLAGS = -O3 +# -------- next flag for using dummy graphics library -----------# +#LIBS = -L$(LIBDIR) -L/usr/X11R6/lib $(NAGLIBS) \ +# -lBJUGL -lBUI -lamatos -llapack $(LIBNETCDF) -lm +LIBS = -L$(LIBDIR) -L/usr/X11R6/lib \ + -lamatos -lPMLAPACK -lgpc $(LIBNETCDF) -lm +# -luGL -L. -lgapi $(LIBGLUT) -lGLU -lGL $(LIBMUI) -lmui -ltiff -lglut -L$(LIBNETCDF) -lnetcdf -lXmu -lXi -lXext -lX11 -lm +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +################################################################## +# AFTER THIS LINE, NO CHANGES SHOULD BE NECESSARY # +################################################################## + +#----------------------------------------------------------------# +# OBJECTS # +#----------------------------------------------------------------# +MAINOBJ = \ +FLASH_parameters.o \ +MISC_timing.o \ +MISC_system.o \ +IO_plotdefine.o \ +IO_utils.o \ +IO_matlabplot.o \ +IO_gmvplot.o \ +IO_griddedplot.o \ +SLM_initial.o \ +SLM_errorestimate.o \ +ADV_wind.o \ +ADV_rhs.o \ +SLM_simple.o \ +SLM_advanced.o \ +ADV_semilagrange.o \ +Flash90.o + +# BJUGL.o \ +# IO_bjuglplot.o \ + +#----------------------------------------------------------------# +# COMPILE STEP # +#----------------------------------------------------------------# + +.SUFFIXES: .F90 .f90 $(SUFFIXES) + +.F90.o: + @echo "make: Building object module from "$< + @$(F90) $(FFLAGS) $(INCS) -c $< + +.f90.o: + @echo "make: Building object module from "$< + $(F90) $(FFLAGS) $(INCS) -c $< + +.c.o: + @echo "make: Building object module from "$< + @$(CC) $(CFLAGS) $(INCS) -D$(MACHINE) -c $< + +clearsrc:: + @rm -f *.f90 *.h *.F90 + +clearex:: + @rm -f $(MAKETHING) Flash90* fort.* + +cleardat:: + @rm -f *.dat + +clean:: + @rm -f *.o *.$(MODEND) *.g90 core + +tidy:: + make clean + make clearex + make cleardat + make clearsrc + +#----------------------------------------------------------------# +# THIS COPIES REQUIRED DATA FILES # +#----------------------------------------------------------------# + +datacopy:: + @cp $(DATDIR)/*.dat . + +#----------------------------------------------------------------# +# THIS CREATES THE MAIN PROGRAM # +#----------------------------------------------------------------# + +maincopy:: + @cp $(SRCDIR)/*.f90 . + @cp $(SRCDIR)/*.F90 . + @cp $(SYSDIR)/*.f90 . + @cp $(TIMDIR)/*.f90 . + @cp $(INCDIR)/BJUGL.f90 . + +Slot:: + @make maincopy + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Potsdam:: + @cp $(OPTDIR)/ADV_wind.file ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.file SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Gerrits:: + @cp $(OPTDIR)/ADV_wind.file ADV_wind.f90 + @cp $(OPTDIR)/ADV_rhs.gerrit ADV_rhs.f90 + @cp $(OPTDIR)/SLM_initial.gerrit SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Burgers:: + @cp $(OPTDIR)/ADV_rhs.burgers ADV_rhs.f90 + @cp $(OPTDIR)/ADV_semilagrange.burgers ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_initial.burgers SLM_initial.f90 + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + +Bar:: + @cp $(OPTDIR)/SLM_simple.clip SLM_simple.f90 + @cp $(SRCDIR)/ADV_wind.bar ADV_wind.f90 + @cp $(SRCDIR)/SLM_initial.bar SLM_initial.f90 + +Conservative:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cons SLM_advanced.f90 + +Dual:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.dual SLM_advanced.f90 + +Cellintegrated:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.cellint SLM_advanced.f90 + +Quadrature:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature SLM_advanced.f90 + +Quadrature7:: + @cp $(OPTDIR)/ADV_semilagrange.adv ADV_semilagrange.F90 + @cp $(OPTDIR)/SLM_simple.plain SLM_simple.f90 + @cp $(OPTDIR)/SLM_advanced.quadrature7 SLM_advanced.f90 + +ConvWind:: + @cp $(OPTDIR)/ADV_wind.convergent ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +DivWind:: + @cp $(OPTDIR)/ADV_wind.divergent ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +DiagonalWind:: + @cp $(OPTDIR)/ADV_wind.diagonal ADV_wind.f90 + @cp $(OPTDIR)/SLM_initial.divergent SLM_initial.f90 + +executable: $(MAINOBJ) + @echo "make: Linking object modules and libraries" + @$(LOADER) $(LDFLAGS) -o $(MAKETHING) $(LIBS) $(MAINOBJ) + +$(MAKETHING):: + @make maincopy + @make executable + +all:: + @make maincopy + @make executable + @make clearsrc + @make clean + +#----------------------------------------------------------------# +# DEPENDENCIES ON INCLUDE FILES # +#----------------------------------------------------------------# diff --git a/flash2d/compile/linux_g64/README b/flash2d/compile/linux_g64/README new file mode 100644 index 0000000000000000000000000000000000000000..3bd4da784cb502c5b57cb29399909437fd4f2e67 --- /dev/null +++ b/flash2d/compile/linux_g64/README @@ -0,0 +1,68 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/linux" + +Makefile - Makefile +Makefile.nogr - Makefile (for non-OpenGL machine) +Parameters.dat - Input data +README - this file + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +In order to create and run an executable there are severel steps to be taken: + +FIRST: If not already done, go to directory $(FLASHDIR)/lib to create a +library libuGL.a. The steps are described there. + +SECOND: Build a grid generator library libgapi.a: Type + make serialcopy + make seriallib + +THIRD: create a taylored executable. The simplest way to do so is: + make maincopy + make executable +See for the alternatives below. + +FOURTH: Copy data files to run the executable: + make datacopy + +FIFTH: To run the executable, type + FLASH -h +This will print out a help screen describing the options of FLASH + FLASH -b -f Parameters.dat +will run FLASH in batch mode, where the input parameters are read from +Parameters.dat. + FLASH -i +will run FLASH in interactive input mode, opening an input window where every +input parameter has to be set manually. + +ALTERNATIVES: + +You may choose different taylored Executables. In the THIRD Step you may type +one of the following instead of "make maincopy": + +1. make Slot + this will create an executable calculating the Slotted Cylinder Test Case + +2. make Dual + this has to be called additionally to any of the others. It creates an + executable with the dual grid interpolation approach. + +3. make Gerrit + this will create an executable suitable for the Aerosol Experiment with + Gerrit Lohmann. + +4. Make Potsdam + this will create an executable for the Tracer Experiments with Klaus Dethloff + and Annette Rinke. + +************************************************************************** + j. behrens, 8/98, 3/99 +************************************************************************** diff --git a/flash2d/compile/linux_ia64/Makefile b/flash2d/compile/linux_ia64/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..c23a3bfcd808fc6c525e185a6549ad4f1e7492f8 --- /dev/null +++ b/flash2d/compile/linux_ia64/Makefile @@ -0,0 +1,139 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = linux + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := yes +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Development + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = $(MKL_LIBDIR) +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = $(MKL_LIBDIR) +LAPACKLIB = $(MKL_SHLIB) + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = /usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/lib/linux_ia64 +INCDIR = $(ROOTDIR)/amatos2d/include/linux_ia64 +MODDIR = $(ROOTDIR)/amatos2d/include/linux_ia64 +MAINDIR = $(ROOTDIR)/flash2d + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/posix-f90 +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L/usr/local/lib -lnetcdf +INCNETCDF = -I/usr/local/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = ifort +cc = gcc +CC = g++ +LOADER = ifort -i_dynamic + +# -------------- next for debugging -----------------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -g -w90 -C -DNO_BASIC_REDEF + CFLAGS = -g + LDFLAGS = -g -Vaxlib -posixlib +endif +# -------------- next for normal compilation --------------------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -w90 -DNO_BASIC_REDEF + CFLAGS = + LDFLAGS = -Vaxlib -posixlib +endif +# -------------- next with aggresive optimization (Pentium M) ---# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O3 -axB -tpp7 -fpic -w90 -DNO_BASIC_REDEF + CFLAGS = -O3 + LDFLAGS = -O3 -Vaxlib -posixlib +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) -L$(BLASDIR) $(BLASLIB) \ + -L$(LAPACKDIR) $(LAPACKLIB) \ + -L$(VISNETDIR) $(VISNETLIB) \ + $(LIBNETCDF) -L$(CCLIBDIR) $(CCLIB)\ + -lamatos -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/macosx_gfortran/Makefile b/flash2d/compile/macosx_gfortran/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7b58fd417218f1e963dcf9e936e5b07a145a3fca --- /dev/null +++ b/flash2d/compile/macosx_gfortran/Makefile @@ -0,0 +1,145 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_gfortran + +# SYSTEM +SYSTEM = gfortran + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = +LAPACKLIB = -framework Accelerate + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = -L/usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash-sphere +OPTDIR = $(MAINDIR)/src/options-sphere +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/sw2/lib -lnetcdff -lnetcdf +INCNETCDF = -I/sw2/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = -L$(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = gfortran +cc = gcc +CC = g++ +LOADER = gfortran + +# --------------------- next are for debugging ------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -fbounds-check -ggdb -fpic -funderscoring # -C + CFLAGS = -ggdb -fpic + LDFLAGS = -ggdb +endif +# --------------------- next are for normal compilation ---------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -fPIC -funderscoring + CFLAGS = -fpic + LDFLAGS = +endif +# --------------------- next are for optimization ---------------# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O3 -fPIC -funderscoring + CFLAGS = -O3 -fpic + LDFLAGS = -O3 +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +FFLAGS += -D$(MACHINE) +CFLAGS += -D$(MACHINE) + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) $(BLASDIR) $(BLASLIB) \ + $(LAPACKDIR) $(LAPACKLIB) \ + $(VISNETDIR) $(VISNETLIB) \ + $(LIBNETCDF) $(CCLIBDIR) $(CCLIB)\ + -lsamatos -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/macosx_intel/Makefile b/flash2d/compile/macosx_intel/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..6015e80e1f067f321e57ed19f008b8a529e6b805 --- /dev/null +++ b/flash2d/compile/macosx_intel/Makefile @@ -0,0 +1,144 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96, 8/98 # +# l. mentrup 7/05 # +# --- this is for linux --- # +################################################################## + +# MACHINE +MACHINE = macosx_intel + +# SYSTEM +SYSTEM = std-f90 + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Documents/Development/amatos + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = $(MKLROOT)/lib +BLASLIB = + +# SET LAPACK DIRECTORY PATH/BLAS INCLUDED IN INTEL MKL +# !! This has to be alterd by user !! +LAPACKDIR = $(MKLROOT)/lib #-L$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95 +LAPACKLIB = -I${MKLROOT}/include/lp64 -I${MKLROOT}/include ${MKLROOT}/lib/libmkl_blas95_lp64.a \ + ${MKLROOT}/lib/libmkl_lapack95_lp64.a ${MKLROOT}/lib/libmkl_intel_lp64.a \ + ${MKLROOT}/lib/libmkl_core.a ${MKLROOT}/lib/libmkl_sequential.a \ + -lpthread -lm # -llapack95 + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = /usr/lib/ +CCLIB = -lstdc++ + +# SET MORE DIRECTORY PATHS +LIBDIR = $(ROOTDIR)/amatos2d/trunk/lib/$(MACHINE) +INCDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MODDIR = $(ROOTDIR)/amatos2d/trunk/include/$(MACHINE) +MAINDIR = $(ROOTDIR)/flash2d/trunk + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/$(SYSTEM) +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/usr/local/lib -lnetcdff -lnetcdf +INCNETCDF = -I/usr/local/include +endif + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +VISNETDIR = +VISNETLIB = +ifneq ($(strip $(NO_VISNET)),yes) +VISNETDIR = $(ROOTDIR)/lib/SINGLE +VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR LINUX / Intel Fortran Compiler # +#----------------------------------------------------------------# +F90 = ifort +cc = gcc +CC = g++ +LOADER = ifort + +# -------------- next for debugging -----------------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -g -fpic -Wl,-no_pie -DLAPACK95 -DUSE_MKL -check all #none # all + CFLAGS = -g -m64 -check + LDFLAGS = -g -save-temps -static-intel -fpic -Wl,-no_pie -check all #none # all +endif +# -------------- next for normal compilation --------------------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -DLAPACK95 -DUSE_MKL + CFLAGS = + LDFLAGS = -ifport +endif +# -------------- next with aggresive optimization (Pentium M) ---# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O -DLAPACK95 -DUSE_MKL + CFLAGS = -O + LDFLAGS = -O -ifport +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +# -------- next flag for using dummy graphics library -----------# +LIBS = -lamatos $(LIBNETCDF) -L$(LIBDIR) -I$(MODDIR) -L$(BLASDIR) $(BLASLIB) \ + -L$(LAPACKDIR) $(LAPACKLIB) $(BLASLIB) $(VISNETLIB) \ + $(CCLIB) -lm + +INCS = $(INCNETCDF) -I$(INCDIR) -I$(MODDIR) -I$(MKLROOT)/include/intel64/lp64 #\ +# -I$($ROOTDIR)/amatos2d/trunk/3rdparty/LAPACK95/lapack95_modules + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/compile/solaris_sparc/Makefile b/flash2d/compile/solaris_sparc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4d4a4c844901bd1a00bde3306c171ede834f5daa --- /dev/null +++ b/flash2d/compile/solaris_sparc/Makefile @@ -0,0 +1,135 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# makefile to build FLASH # +# j. behrens 2/95, 3/96 # +# --- this is for Solaris --- # +################################################################## + +# MACHINE +MACHINE = solaris_sparc + +# SET MAKETHING CORRESPONDING TO MACHINE: +MAKETHING= FLASH + +# OPTIMIZATION SETTINGS [debug|norm|opt] +MODE := debug + +# LIBRARY SETTINGS [yes|no] +# Useage: make NO_NETCDF=yes NO_VISNET=yes +NO_NETCDF := no +NO_VISNET := yes + +# Use Method MPSLM [yes|no] +NO_MPSLM := yes + +# SET MAIN DIRECTORY PATH +ROOTDIR = $(HOME)/development + +# SET atlas/blas DIRECTORY PATH +# !! This has to be alterd by user !! +BLASDIR = +BLASLIB = + +# SET LAPACK DIRECTORY PATH +# !! This has to be alterd by user !! +LAPACKDIR = -L/sw/solaris10/SunStudio-12u1/lib -R/sw/solaris10/SunStudio-12u1/lib +LAPACKLIB = -xlic_lib=sunperf + +# SET VISNET DIRECTORY PATH +# !! This has to be alterd by user !! +ifneq ($(strip $(NO_VISNET)),yes) + VISNETDIR = $(ROOTDIR)/lib + VISNETLIB = -lvisnet4flash -lm3tv -ldelaunay \ + -ldetri -llia -lsos -lbasic \ + $(VISNETDIR)/SINGLE/fortify.o \ + -lglut -lGLU -lGL -ltiff +endif + +# SET C++ DIRECTORY PATH +# !! This has to be alterd by user !! +CCLIBDIR = /usr/lib/ +CCLIB = -mt -lrt -lCstd + +# SET MORE DIRECTORY PATHS +MAINDIR = $(ROOTDIR)/flash2d +LIBDIR = $(ROOTDIR)/amatos2d/lib/solaris_sparc +INCDIR = $(ROOTDIR)/amatos2d/include/solaris_sparc +MODDIR = $(ROOTDIR)/amatos2d/include/solaris_sparc + +SRCDIR = $(MAINDIR)/src/flash +OPTDIR = $(MAINDIR)/src/options +SYSDIR = $(MAINDIR)/src/system/std-f90 +TIMDIR = $(MAINDIR)/src/timing +DATDIR = $(MAINDIR)/data +BUILDIR = $(MAINDIR)/compile/$(MACHINE) + +# SET NETCDF PATHS +LIBNETCDF = +INCNETCDF = +ifneq ($(strip $(NO_NETCDF)), yes) +LIBNETCDF = -L$(LIBDIR) -lncugrid -L/sw/solaris10/netcdf-4.1.2-sun12/lib -R/sw/solaris10/netcdf-4.1.2-sun12/lib -lnetcdff -lnetcdf +INCNETCDF = -I/sw/solaris10/netcdf-4.1.2-sun12/include -M/sw/solaris10/netcdf-4.1.2-sun12/include +endif + +# SET PATH TO GRID_API.mod +AMATOS = $(MODDIR)/grid_api.mod + +# SET THE ENDING OF MODULE FILES +MODEND = mod + +#----------------------------------------------------------------# +# FLAGS FOR SUN # +#----------------------------------------------------------------# + +MAKE = gmake +F77 = f77 +F90 = f90 +CC = cc +LOADER = f90 + +# --------------------- next are for debugging ------------------# +ifeq ($(strip $(MODE)),debug) + FFLAGS = -g -KPIC # -ext_names=plain + CFLAGS = -g + LDFLAGS = -g -z nodefs +endif +# --------------------- next are for normal compilation ---------# +ifeq ($(strip $(MODE)),norm) + FFLAGS = -KPIC # -ext_names=plain + CFLAGS = + LDFLAGS = -z nodefs +endif +# --------------------- next are for optimization ---------------# +ifeq ($(strip $(MODE)),opt) + FFLAGS = -O -KPIC # -ext_names=plain + CFLAGS = -O + LDFLAGS = -O -z nodefs +endif + +# --------------------- include Visnet/NetCDF or not ------------# +ifeq ($(strip $(NO_VISNET)),yes) +FFLAGS += -DNO_VISNET +endif +ifeq ($(strip $(NO_NETCDF)),yes) +FFLAGS += -DNO_NETCDF +endif + +# -------- next flag for using dummy graphics library -----------# +LIBS = -L$(LIBDIR) -R$(LIBDIR) -L$(LAPACKDIR) -R$(LAPACKDIR) -L$(VISNETDIR) \ + -L$(CCLIBDIR) \ + -lamatos $(LAPACKLIB) $(BLASLIB) $(LIBNETCDF) $(VISNETLIB) \ + $(CCLIB) -lm +INCS = $(INCNETCDF) -I$(INCDIR) -M$(MODDIR) -I. -M. + +#----------------------------------------------------------------# +# common stuff # +#----------------------------------------------------------------# + +include $(MAINDIR)/compile/Makefiles/Makefile.common + +#----------------------------------------------------------------# +# END of Makefile # +#----------------------------------------------------------------# diff --git a/flash2d/data/Domain.SWCosine.dat b/flash2d/data/Domain.SWCosine.dat new file mode 100644 index 0000000000000000000000000000000000000000..379c8680f0d843390f052fbcea0d081b9c82e5de --- /dev/null +++ b/flash2d/data/Domain.SWCosine.dat @@ -0,0 +1,47 @@ +Domain.dat!------------------------------------------------------------------- +! this file defines as an example a simple computational domain +! let 1 pi space outside 0 +! j. behrens, 11/97 +! +! this describes the conventions for the data format: +! COMMENTS: +! each line beginning with a '!' or a '#' is a comment line +! KEYWORDS +! there are several keywords which have to start in the first +! collumn and have to be written in CAPITAL LETTERS. the line +! immediately following the keyword line holds the required +! information and must not contain a comment! +! DATA +! has to be written according to the information given by the +! keywords. ok, look at the example :-) +!------------------------------------------------------------------- +# define the number of dimensions: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_DIMENSIONS +2 +# ok, we made this one. +# now define the number of polygons for the domain: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_POLYGONS +1 +# this is going to be a really complicated domain... +# now we deliver the number of vertices of the polygonal line: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_VERTICES +4 +# guess, this is going to be a square! +# finally we give the coordinate data: +# NUMBER_OF_DIMENSIONS * NUMBER_OF_VERTICES + 1 lines: +# 1. keyword line, after that data lines (only one collumn) +VERTEX_DATA +0000000.0 +0000000.0 +25000.0 +0000000.0 +25000.0 +25000.0 +0000000.0 +25000.0 +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/Domain.dat b/flash2d/data/Domain.dat new file mode 100644 index 0000000000000000000000000000000000000000..c89b6f1b9ec93c4bba5edcaa5d148e343e164130 --- /dev/null +++ b/flash2d/data/Domain.dat @@ -0,0 +1,48 @@ +!------------------------------------------------------------------- +! this file defines as an example a simple computational domain +! i.e. the unit square, moved by the vector (-0.5,-0.5) +! +! j. behrens, 11/97 +! +! this describes the conventions for the data format: +! COMMENTS: +! each line beginning with a '!' or a '#' is a comment line +! KEYWORDS +! there are several keywords which have to start in the first +! collumn and have to be written in CAPITAL LETTERS. the line +! immediately following the keyword line holds the required +! information and must not contain a comment! +! DATA +! has to be written according to the information given by the +! keywords. ok, look at the example :-) +!------------------------------------------------------------------- +# define the number of dimensions: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_DIMENSIONS +2 +# ok, we made this one. +# now define the number of polygons for the domain: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_POLYGONS +1 +# this is going to be a really complicated domain... +# now we deliver the number of vertices of the polygonal line: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_VERTICES +4 +# guess, this is going to be a square! +# finally we give the coordinate data: +# NUMBER_OF_DIMENSIONS * NUMBER_OF_VERTICES + 1 lines: +# 1. keyword line, after that data lines (only one collumn) +VERTEX_DATA +-0.5 +-0.5 +0.5 +-0.5 +0.5 +0.5 +-0.5 +0.5 +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/DomainSph.global.dat b/flash2d/data/DomainSph.global.dat new file mode 100644 index 0000000000000000000000000000000000000000..02c5d625e7be004f8f0799ddd7ed5bf5687285db --- /dev/null +++ b/flash2d/data/DomainSph.global.dat @@ -0,0 +1,13 @@ +!------------------------------------------------------------------- +! this file defines the whole of the sphere as domain, by not defining any boundaries +! +! f. klaschka, 11/97 +! +!------------------------------------------------------------------- +NUMBER_OF_DIMENSIONS +3 +NUMBER_OF_POLYGONS +0 +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/Domain_aviso.dat b/flash2d/data/Domain_aviso.dat new file mode 100644 index 0000000000000000000000000000000000000000..fcfbba3ac746d66cead70788ebbffec170e8f7dc --- /dev/null +++ b/flash2d/data/Domain_aviso.dat @@ -0,0 +1,48 @@ +!------------------------------------------------------------------- +! this file defines as an example a simple computational domain +! i.e. the unit square, moved by the vector (-0.5,-0.5) +! +! j. behrens, 11/97 +! +! this describes the conventions for the data format: +! COMMENTS: +! each line beginning with a '!' or a '#' is a comment line +! KEYWORDS +! there are several keywords which have to start in the first +! collumn and have to be written in CAPITAL LETTERS. the line +! immediately following the keyword line holds the required +! information and must not contain a comment! +! DATA +! has to be written according to the information given by the +! keywords. ok, look at the example :-) +!------------------------------------------------------------------- +# define the number of dimensions: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_DIMENSIONS +2 +# ok, we made this one. +# now define the number of polygons for the domain: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_POLYGONS +1 +# this is going to be a really complicated domain... +# now we deliver the number of vertices of the polygonal line: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_VERTICES +4 +# guess, this is going to be a square! +# finally we give the coordinate data: +# NUMBER_OF_DIMENSIONS * NUMBER_OF_VERTICES + 1 lines: +# 1. keyword line, after that data lines (only one collumn) +VERTEX_DATA +120.0 +-20.0 +260.0 +-20.0 +260.0 +60.0 +120.0 +60.0 +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/Domain_periodic_pi.dat b/flash2d/data/Domain_periodic_pi.dat new file mode 100644 index 0000000000000000000000000000000000000000..c740faf3767c148011c17eb0e1b2d8192eeb8624 --- /dev/null +++ b/flash2d/data/Domain_periodic_pi.dat @@ -0,0 +1,48 @@ +!------------------------------------------------------------------- +! this file defines as an example a simple computational domain +! i.e. the unit square, moved by the vector (-0.5,-0.5) +! +! j. behrens, 11/97 +! +! this describes the conventions for the data format: +! COMMENTS: +! each line beginning with a '!' or a '#' is a comment line +! KEYWORDS +! there are several keywords which have to start in the first +! collumn and have to be written in CAPITAL LETTERS. the line +! immediately following the keyword line holds the required +! information and must not contain a comment! +! DATA +! has to be written according to the information given by the +! keywords. ok, look at the example :-) +!------------------------------------------------------------------- +# define the number of dimensions: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_DIMENSIONS +2 +# ok, we made this one. +# now define the number of polygons for the domain: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_POLYGONS +1 +# this is going to be a really complicated domain... +# now we deliver the number of vertices of the polygonal line: two lines: +# 1. keyword line, 2. single integer +NUMBER_OF_VERTICES +4 +# guess, this is going to be a square! +# finally we give the coordinate data: +# NUMBER_OF_DIMENSIONS * NUMBER_OF_VERTICES + 1 lines: +# 1. keyword line, after that data lines (only one collumn) +VERTEX_DATA +-3.141592653589793 +-1.570796326794897 +3.141592653589793 +-1.570796326794897 +3.141592653589793 +1.570796326794897 +-3.141592653589793 +1.570796326794897 +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/Initial.dat b/flash2d/data/Initial.dat new file mode 100644 index 0000000000000000000000000000000000000000..cdee4c1a0604b22f6e806ae670fb1885c9d89316 --- /dev/null +++ b/flash2d/data/Initial.dat @@ -0,0 +1,30 @@ +!----------------------------------------------------------------- +! this file contains input data for the initial field +! in the tracer advection experiment +! again, keywords control the input data +! +! j. behrens, 12/97 +!----------------------------------------------------------------- +# on of two main keywords must appear at the beginning +# CIRCLES_INPUT or FILES_INPUT +CIRCLES_INPUT +# the CIRCLES_INPUT keywords follow +# give the number of circles +NUMBER_OF_CIRCLES +1 +# for each circle give the coordinates and the concentration +CIRCLE_COORDINATES +17.3 +10.5 +CIRCLE_DIAMETER +2.1 +CIRCLE_CONCENTRATION +1. +!----------------------------------------------------------------- +# for the FILES_INPUT there are (not yet implemented) some +# keywords: +# INPUT_FILE_NAME, X_POINT_NUMBER, Y_POINT_NUMBER, NUMBER_OF_WATERMARKS, +# WATERMARK_LEVEL, WATERMARK_CONCENTRATION +!----------------------------------------------------------------- +! and this is the end of the file +!----------------------------------------------------------------- diff --git a/flash2d/data/Land.dat b/flash2d/data/Land.dat new file mode 100644 index 0000000000000000000000000000000000000000..daf510ddf56711b8ddf3ba76cb6d54e91365ee14 --- /dev/null +++ b/flash2d/data/Land.dat @@ -0,0 +1,10 @@ +# Number of polylines +1 +# 1. polygon, number of points +5 +# coordinate pairs +0.1 0.1 +0.4 0.1 +0.4 0.4 +0.1 0.4 +0.1 0.1 diff --git a/flash2d/data/Parambench.dat b/flash2d/data/Parambench.dat new file mode 100644 index 0000000000000000000000000000000000000000..4c8c104fb7edc3744add21d971c5f566f7b89fb5 --- /dev/null +++ b/flash2d/data/Parambench.dat @@ -0,0 +1,69 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# j. behrens 12/96 +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +16 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +4 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +1800. +# first timestep [integer] +BEGINNING_TIMESTEP +1 +# last timestep [integer] +FINISHING_TIMESTEP +5 +# plot in matlab style to file (no plot = 0) [integer] +MATLAB_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +GMV_FILE_PLOTTING +1 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# plot a polygonal line from file (if given) [character] +POLYGON_FILE_NAME +Land.dat +# take advecting wind from file (if given) [character] +WIND_FILE_NAME +Windparam.dat +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/Parameters.SW.dat b/flash2d/data/Parameters.SW.dat new file mode 100644 index 0000000000000000000000000000000000000000..5be800780679595be653a85f0dbd46e8cafcd9d7 --- /dev/null +++ b/flash2d/data/Parameters.SW.dat @@ -0,0 +1,75 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# j. behrens 12/96 +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +9 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +9 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +20. +# first timestep [integer] +BEGINNING_TIMESTEP +1 +# last timestep [integer] +FINISHING_TIMESTEP +10 +# plot in matlab style to file (no plot = 0) [integer] +MATLAB_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +GMV_FILE_PLOTTING +1 +# plot in VisNET window (no plot = 0) [integer] +VISNET_PLOTTING +1 +# screenshot VisNET window (no plot = 0) [integer] +VISNET_SCREENSHOT +1 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# plot a polygonal line from file (if given) [character] +POLYGON_FILE_NAME +Land.dat +# take advecting wind from file (if given) [character] +WIND_FILE_NAME +Windparam.dat +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/Parameters.dat b/flash2d/data/Parameters.dat new file mode 100644 index 0000000000000000000000000000000000000000..f867f03904ccefe3e446361ba0ce189ca7251527 --- /dev/null +++ b/flash2d/data/Parameters.dat @@ -0,0 +1,77 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# new version with generic input metadata involved +# +# j. behrens 05/2016 +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# switch diagnostics on (1) or off (0) [integer] +SWITCH_ON_DIAGNOSTICS +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +11 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +11 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +1800. +# starting time [real] +TIMESTEPPING_START_TIME +0.0 +# final time [real] +TIMESTEPPING_END_TIME +18000. +# plot in matlab style to file (no plot = 0) [integer] +NETCDF_FILE_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +VTU_FILE_PLOTTING +1 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# take advecting wind from file (if given) [character] +WIND_FILE_NAME +Windparam.dat +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +# for advection diffusion test case: coefficient [real] +DIFFUSION_COEFFICIENT +0.3 +# for scaling the wind strength [real] +WIND_COEFFICIENT +1.0 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/Parameters.generic b/flash2d/data/Parameters.generic new file mode 100644 index 0000000000000000000000000000000000000000..e3029669045b6a2164629c1de55842512997816f --- /dev/null +++ b/flash2d/data/Parameters.generic @@ -0,0 +1,77 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# new version with generic input metadata involved +# +# j. behrens 05/2016 +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# switch diagnostics on (1) or off (0) [integer] +SWITCH_ON_DIAGNOSTICS +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +15 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +4 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +1800. +# starting time [real] +TIMESTEPPING_START_TIME +0.0 +# final time [real] +TIMESTEPPING_END_TIME +18000. +# plot in matlab style to file (no plot = 0) [integer] +NETCDF_FILE_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +VTU_FILE_PLOTTING +1 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# take advecting wind from file (if given) [character] +WIND_FILE_NAME +Windparam.dat +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +# for advection diffusion test case: coefficient [real] +DIFFUSION_COEFFICIENT +0.3 +# for scaling the wind strength [real] +WIND_COEFFICIENT +1.0 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/Parameters.new.dat b/flash2d/data/Parameters.new.dat new file mode 100644 index 0000000000000000000000000000000000000000..9392272adb01f18bc87d64d4680f261e355b8cbd --- /dev/null +++ b/flash2d/data/Parameters.new.dat @@ -0,0 +1,114 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# new version with generic input metadata involved +# +# j. behrens 05/2016 +#----------------------------------------------------------- +# 1. Section: +# This section contains all standard parameters +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# switch diagnostics on (1) or off (0) [integer] +SWITCH_ON_DIAGNOSTICS +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +17 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +9 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +1800. +# starting time [real] +TIMESTEPPING_START_TIME +0.0 +# final time [real] +TIMESTEPPING_END_TIME +72000. +# plot in matlab style to file (no plot = 0) [integer] +NETCDF_FILE_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +VTU_FILE_PLOTTING +1 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +#----------------------------------------------------------- +# 2. Section: +# This section contains parameters specific to the +# test cases considered. +# +# NOTE: the structure is always (more or less) the same: +# If a parameter type is used, then the number of +# corresponding parameters needs to be given, immediately +# followed by the keywords and values. So, if two params +# of integer type are used, TST_INT_PARAMETERS is 2, and +# four lines would follow with +# KEYWORD +# i value +# KEYWORD +# k l values +# entries. In fact, for integer and real types, there +# also vector-valued parameters are allowed. So, the +# two lines preceeding the KEYWORD line above would read +# TST_INT_STRUCTURE +# 1 2 +# The KEYWORD strings should be at least 14 characters +# long. +#----------------------------------------------------------- +# do we use integer parameters? (0=no, how many?) [integer] +TST_INT_PARAMETERS +0 +# do we use character parameters? (0=no, how many?)[integer] +TST_CHAR_PARAMETERS +1 +WIND_FILE_NAME +Windparam.dat +# do we use real parameters? (0=no, how many?) [integer] +# both are scalar values +# for advection diffusion test case: coefficient [real] +# for scaling the wind strength [real] +TST_REAL_PARAMETERS +2 +TST_REAL_STRUCTURE +1 1 +DIFFUSION_COEFFICIENT +0.3 +WIND_COEFFICIENT +1.0 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/Parameters_aviso.dat b/flash2d/data/Parameters_aviso.dat new file mode 100644 index 0000000000000000000000000000000000000000..c8b3c1134eeb5573c32022eaa4b17ec821f258cb --- /dev/null +++ b/flash2d/data/Parameters_aviso.dat @@ -0,0 +1,76 @@ +#----------------------------------------------------------- +# Input file for batch mode input +# input is controlled via keywords +# +# j. behrens 12/96 +#----------------------------------------------------------- +# the experiment no. (0 for a new experiment) [integer] +EXPERIMENT_NUMBER +0 +# desired maximum level of refinements [integer] +FINE_GRID_LEVEL +17 +# minimum level of refinements [integer] +COARSE_GRID_LEVEL +11 +# tolerance for refinement [real] +TOLERANCE_OF_REFINEMENT +0.2 +# tolerance for coarsening [real] +TOLERANCE_OF_COARSENING +0.1 +# watermark for refinement [real] +WATERMARK_OF_REFINEMENT +0.01 +# watermark for coarsening [real] +WATERMARK_OF_COARSENING +0.01 +# timestep length [real] +TIMESTEP_LENGTH +3600. +# first timestep [integer] +BEGINNING_TIMESTEP +1 +# last timestep [integer] +FINISHING_TIMESTEP +48 +# plot in matlab style to file (no plot = 0) [integer] +MATLAB_PLOTTING +0 +# plot in gmv style to file (no plot = 0) [integer] +GMV_FILE_PLOTTING +1 +# plot in VisNET window (no plot = 0) [integer] +VISNET_PLOTTING +0 +# screenshot VisNET window (no plot = 0) [integer] +VISNET_SCREENSHOT +0 +# timesteps between plots [integer] +STEPS_BTW_PLOTS +1 +# timesteps between saves [integer] +STEPS_BTW_SAVES +500 +# save last timestep for next experiment (no = 0) [integer] +SAVE_FINISH_CONFIGURATION +0 +# plot a polygonal line from file (if given) [character] +POLYGON_FILE_NAME +Land.dat +# take advecting wind from file (if given) [character] +WIND_FILE_NAME +Wind_aviso.dat +#testdata.nc +# file defining the domain [character] +DOMAIN_FILE_NAME +Domain_aviso.dat +# file defining the initial triangulation [character] +TRIANG_FILE_NAME +Triang_aviso.dat +# number of iterations in trajectory estimation [integer] +SLM_ITERATION_NUMBER +4 +#----------------------------------------------------------- +# END OF FILE +#----------------------------------------------------------- diff --git a/flash2d/data/PotsdamInput/Domain.windxxx b/flash2d/data/PotsdamInput/Domain.windxxx new file mode 100644 index 0000000000000000000000000000000000000000..0cabc12c7a8cbb18932fccd448b79d39b518c10a --- /dev/null +++ b/flash2d/data/PotsdamInput/Domain.windxxx @@ -0,0 +1,24 @@ +!------------------------------------------------------------------- +! this file defines a square for the domain given in the Potsdam +! examples. +! +! j. behrens, 12/97 +!------------------------------------------------------------------- +NUMBER_OF_DIMENSIONS +2 +NUMBER_OF_POLYGONS +1 +NUMBER_OF_VERTICES +4 +VERTEX_DATA +1. +1. +110. +1. +110. +100. +1. +100. +!------------------------------------------------------------------- +! end of file +!------------------------------------------------------------------- diff --git a/flash2d/data/PotsdamInput/Initial.windxxx b/flash2d/data/PotsdamInput/Initial.windxxx new file mode 100644 index 0000000000000000000000000000000000000000..5ee03c2a23dcba2e969631e3bb1117f92a20ce6a --- /dev/null +++ b/flash2d/data/PotsdamInput/Initial.windxxx @@ -0,0 +1,51 @@ +!----------------------------------------------------------------- +! this file contains input data for the initial field +! in the tracer advection experiment +! again, keywords control the input data +! +! j. behrens, 12/97 +!----------------------------------------------------------------- +# on of two main keywords must appear at the beginning +# CIRCLES_INPUT or FILES_INPUT +CIRCLES_INPUT +# the CIRCLES_INPUT keywords follow +# give the number of circles +NUMBER_OF_CIRCLES +4 +# for each circle give the coordinates and the concentration +CIRCLE_COORDINATES +35. +40. +CIRCLE_DIAMETER +7. +CIRCLE_CONCENTRATION +1. +CIRCLE_COORDINATES +40. +50. +CIRCLE_DIAMETER +8. +CIRCLE_CONCENTRATION +1. +CIRCLE_COORDINATES +45. +55. +CIRCLE_DIAMETER +8. +CIRCLE_CONCENTRATION +2. +CIRCLE_COORDINATES +55. +65. +CIRCLE_DIAMETER +8. +CIRCLE_CONCENTRATION +2. +!----------------------------------------------------------------- +# for the FILES_INPUT there are (not yet implemented) some +# keywords: +# INPUT_FILE_NAME, X_POINT_NUMBER, Y_POINT_NUMBER, NUMBER_OF_WATERMARKS, +# WATERMARK_LEVEL, WATERMARK_CONCENTRATION +!----------------------------------------------------------------- +! and this is the end of the file +!----------------------------------------------------------------- diff --git a/flash2d/data/PotsdamInput/Input.windxxx b/flash2d/data/PotsdamInput/Input.windxxx new file mode 100644 index 0000000000000000000000000000000000000000..ee0ff9bbc483cfb76387abeb300d648ba80959e4 --- /dev/null +++ b/flash2d/data/PotsdamInput/Input.windxxx @@ -0,0 +1,33 @@ +# --- --- Sample parameter file Test.in --- --- +# care has to be taken for the sequence of values +# by j. behrens 11/96 +# +# the experiment no. (0 for a new experiment) [integer] +0 +# desired maximum level of refinements [integer] +16 +# minimum level of refinements [integer] +5 +# tolerance for refinement [real] +0.2 +# tolerance for coarsening [real] +0.1 +# watermark for refinement [real] +0.01 +# watermark for coarsening [real] +0.01 +# timestep length [real] +3600. +# first timestep [integer] +1 +# last timestep [integer] +97 +# timesteps between saves [integer] +50 +# timesteps between plots [integer] +1 +# save last timestep for next experiment (no = 0) [integer] +0 +# number of iterations in trajectory estimation [integer] +4 +# --- --- end of input file Test.in --- --- diff --git a/flash2d/data/PotsdamInput/Land.dat b/flash2d/data/PotsdamInput/Land.dat new file mode 100644 index 0000000000000000000000000000000000000000..d8e78786f40994a2b25c94c6082ceda997571d61 --- /dev/null +++ b/flash2d/data/PotsdamInput/Land.dat @@ -0,0 +1,326 @@ +# Number of polylines +12 +# 1. polygon, number of points +77 +# coordinate pairs +1.0 54.0 +4.0 52.0 +5.0 52.0 +5.0 50.0 +9.0 48.0 +9.0 46.0 +11.0 45.0 +14.0 46.0 +15.0 46.0 +16.0 47.0 +17.0 44.0 +18.0 43.0 +14.0 38.0 +10.0 38.0 +9.0 37.0 +7.0 40.0 +6.0 40.0 +7.0 37.0 +5.0 34.0 +5.0 31.0 +6.0 32.0 +7.0 29.0 +8.0 29.0 +11.0 34.0 +12.0 33.0 +13.0 30.0 +14.0 30.0 +16.0 36.0 +18.0 36.0 +22.0 43.0 +21.0 45.0 +22.0 45.0 +23.0 44.0 +23.0 48.0 +21.0 49.0 +23.0 49.0 +23.0 50.0 +20.0 51.0 +18.0 51.0 +16.0 48.0 +12.0 48.0 +11.0 49.0 +14.0 50.0 +15.0 53.0 +20.0 54.0 +18.0 55.0 +16.0 55.0 +15.0 54.0 +13.0 54.0 +11.0 55.0 +13.0 56.0 +13.0 60.0 +14.0 62.0 +14.0 64.0 +12.0 65.0 +14.0 66.0 +14.0 68.0 +16.0 70.0 +17.0 69.0 +18.0 70.0 +21.0 72.0 +21.0 74.0 +24.0 75.0 +26.0 80.0 +25.0 81.0 +38.0 86.0 +40.0 86.0 +43.0 88.0 +43.0 91.0 +45.0 92.0 +45.0 93.0 +42.0 94.0 +39.0 95.0 +41.0 97.0 +43.0 97.0 +44.0 98.0 +43.0 100.0 +# 2. polygon, number of points +74 +# coordinate pairs +66.0 1.0 +68.0 4.0 +69.0 8.0 +68.0 10.0 +70.0 12.0 +74.0 17.0 +76.0 17.0 +77.0 16.0 +82.0 17.0 +86.0 17.0 +87.0 16.0 +86.0 14.0 +82.0 12.0 +88.0 9.0 +89.0 10.0 +89.0 12.0 +90.0 13.0 +89.0 14.0 +89.0 16.0 +90.0 18.0 +89.0 19.0 +91.0 20.0 +91.0 26.0 +92.0 26.0 +94.0 30.0 +92.0 32.0 +97.0 35.0 +97.0 36.0 +93.0 36.0 +88.0 40.0 +90.0 40.0 +98.0 38.0 +101.0 36.0 +101.0 38.0 +98.0 40.0 +97.0 42.0 +96.0 40.0 +92.0 42.0 +91.0 44.0 +93.0 46.0 +89.0 46.0 +89.0 50.0 +86.0 50.0 +85.0 52.0 +84.0 56.0 +80.0 57.0 +82.0 59.0 +82.0 62.0 +84.0 62.0 +88.0 61.0 +86.0 66.0 +86.0 69.0 +83.0 70.0 +83.0 72.0 +85.0 74.0 +85.0 76.0 +84.0 76.0 +82.0 78.0 +78.0 78.0 +76.0 80.0 +74.0 86.0 +71.0 86.0 +71.0 90.0 +68.0 90.0 +65.0 91.0 +65.0 93.0 +63.0 93.0 +62.0 91.0 +58.0 92.0 +52.0 96.0 +51.0 98.0 +50.0 97.0 +48.0 98.0 +50.0 100.0 +# 3. polygon, number of points +8 +# coordinate pairs +88.0 30.0 +86.0 30.0 +82.0 36.0 +81.0 40.0 +81.0 36.0 +85.0 29.0 +87.0 29.0 +88.0 30.0 +# 4. polygon, number of points +7 +# coordinate pairs +63.0 26.0 +64.0 30.0 +65.0 32.0 +64.0 33.0 +61.0 30.0 +61.0 28.0 +63.0 26.0 +# 5. polygon, number of points +7 +# coordinate pairs +74.0 1.0 +75.0 2.0 +75.0 6.0 +77.0 7.0 +79.0 6.0 +79.0 4.0 +78.0 1.0 +# 6. polygon, number of points +8 +# coordinate pairs +38.0 1.0 +42.0 1.0 +43.0 3.0 +43.0 5.0 +38.0 6.0 +36.0 7.0 +36.0 3.0 +38.0 1.0 +# 7. polygon, number of points +46 +# coordinate pairs +13.0 9.0 +16.0 10.0 +18.0 12.0 +20.0 12.0 +22.0 14.0 +24.0 14.0 +26.0 13.0 +28.0 13.0 +32.0 14.0 +39.0 14.0 +39.0 15.0 +38.0 16.0 +40.0 17.0 +41.0 16.0 +42.0 18.0 +42.0 20.0 +44.0 21.0 +47.0 26.0 +47.0 30.0 +51.0 34.0 +51.0 35.0 +50.0 35.0 +49.0 37.0 +50.0 38.0 +49.0 40.0 +46.0 41.0 +43.0 41.0 +43.0 42.0 +39.0 43.0 +37.0 42.0 +34.0 44.0 +31.0 42.0 +31.0 40.0 +32.0 38.0 +32.0 36.0 +28.0 32.0 +26.0 30.0 +26.0 28.0 +22.0 24.0 +18.0 24.0 +16.0 22.0 +14.0 18.0 +12.0 16.0 +11.0 12.0 +13.0 11.0 +13.0 9.0 +# 8. polygon, number of points +11 +# coordinate pairs +1.0 95.0 +3.0 96.0 +3.0 95.0 +5.0 96.0 +6.0 94.0 +10.0 94.0 +11.0 96.0 +16.0 96.0 +18.0 98.0 +22.0 98.0 +24.0 100.0 +# 9. polygon, number of points +20 +# coordinate pairs +30.0 68.0 +27.0 71.0 +25.0 71.0 +24.0 70.0 +26.0 68.0 +22.0 68.0 +20.0 66.0 +20.0 68.0 +19.0 69.0 +16.0 67.0 +16.0 64.0 +17.0 62.0 +16.0 60.0 +17.0 59.0 +19.0 60.0 +24.0 60.0 +22.0 62.0 +26.0 66.0 +28.0 66.0 +30.0 68.0 +# 10. polygon, number of points +18 +# coordinate pairs +42.0 44.0 +43.0 46.0 +42.0 48.0 +40.0 50.0 +38.0 50.0 +38.0 48.0 +37.0 50.0 +38.0 52.0 +36.0 53.0 +33.0 52.0 +33.0 50.0 +32.0 49.0 +30.0 50.0 +30.0 46.0 +31.0 47.0 +34.0 46.0 +38.0 46.0 +42.0 44.0 +# 11. polygon, number of points +6 +# coordinate pairs +26.0 46.0 +28.0 46.0 +27.0 50.0 +29.0 53.0 +26.0 52.0 +26.0 46.0 +# 12. polygon, number of points +6 +# coordinate pairs +24.0 52.0 +24.0 56.0 +21.0 57.0 +20.0 56.0 +22.0 52.0 +24.0 52.0 diff --git a/flash2d/data/PotsdamInput/Windparam.windxxx b/flash2d/data/PotsdamInput/Windparam.windxxx new file mode 100644 index 0000000000000000000000000000000000000000..3b007f4b260003a05bcd95e0497aead6f4d3e8cf --- /dev/null +++ b/flash2d/data/PotsdamInput/Windparam.windxxx @@ -0,0 +1,33 @@ +!------------------------------------------------------------------------- +! Windparam.dat +! this file contains data for the processing of wind data given in files +! +! j. behrens, 12/97 +!------------------------------------------------------------------------- +# here we read the prefix/postfix for the x/y file +X_PREFIX +windx. +Y_PREFIX +windy. +# now we read a time factor this is hours +TIME_FACTOR +21600.0 +# we give the intervallength and the first interval +# this is somehow cryptic... +NUMBER_OF_INTERVALS +1 +UPSET_OF_INTERVALS +0 +# the number of x/y coordinates in the field +X_NUMBER_OF_POINTS +110 +Y_NUMBER_OF_POINTS +100 +# scaling factors for fitting the domain scales... +X_SCALE_FACTOR +50000.0 +Y_SCALE_FACTOR +50000.0 +!------------------------------------------------------------------------- +! END OF FILE +!------------------------------------------------------------------------- diff --git a/flash2d/data/README b/flash2d/data/README new file mode 100644 index 0000000000000000000000000000000000000000..edb1ce50dfd02365604751ec9dde375e8b127948 --- /dev/null +++ b/flash2d/data/README @@ -0,0 +1,26 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/data" + +README - this file +PotsdamInput - Directory containing specially taylored data files +Domain.dat - Domain description data file +Initial.dat - Data for initial tracer distribution +Land.dat - Data for a land mask +Triang.dat - Initial triangulation data file + + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +nothing. just leave this directory untouched for further reference :-) + +************************************************************************** + j. behrens, 3/99 +************************************************************************** diff --git a/flash2d/data/Triang.SWCosine.dat b/flash2d/data/Triang.SWCosine.dat new file mode 100644 index 0000000000000000000000000000000000000000..7be36f23bd2b6e0426b7b833de4905dcbc4f08b4 --- /dev/null +++ b/flash2d/data/Triang.SWCosine.dat @@ -0,0 +1,189 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +5 +!--- total number of edges +NUMBER_OF_EDGES +8 +!--- total number of elements +NUMBER_OF_ELEMENTS +4 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +0.0 +0.0 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +25000.0 +0.0 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +25000.0 +25000.0 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +0.0 +25000.0 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +12500.0 +12500.0 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +3 +4 +EDGE_ELEMENTINDICES +3 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +1 +EDGE_ELEMENTINDICES +4 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +5 +EDGE_ELEMENTINDICES +1 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +2 +3 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +1 +5 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +5 +ELEMENT_EDGEINDICES +5 +8 +1 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +3 +5 +ELEMENT_EDGEINDICES +6 +5 +2 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +3 +4 +5 +ELEMENT_EDGEINDICES +7 +6 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +4 +1 +5 +ELEMENT_EDGEINDICES +8 +7 +4 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang.dat b/flash2d/data/Triang.dat new file mode 100644 index 0000000000000000000000000000000000000000..96798bc47a608d7b3660b220620a903ca0de5fce --- /dev/null +++ b/flash2d/data/Triang.dat @@ -0,0 +1,189 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +5 +!--- total number of edges +NUMBER_OF_EDGES +8 +!--- total number of elements +NUMBER_OF_ELEMENTS +4 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +-0.5 +-0.5 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +0.5 +-0.5 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +0.5 +0.5 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +-0.5 +0.5 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +0.0 +0.0 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +3 +4 +EDGE_ELEMENTINDICES +3 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +1 +EDGE_ELEMENTINDICES +4 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +5 +EDGE_ELEMENTINDICES +1 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +2 +3 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +1 +5 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +5 +ELEMENT_EDGEINDICES +5 +8 +1 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +3 +5 +ELEMENT_EDGEINDICES +6 +5 +2 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +3 +4 +5 +ELEMENT_EDGEINDICES +7 +6 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +4 +1 +5 +ELEMENT_EDGEINDICES +8 +7 +4 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang12.dat b/flash2d/data/Triang12.dat new file mode 100644 index 0000000000000000000000000000000000000000..01ebb90f9e2b3adfb382ffab5442505cae222467 --- /dev/null +++ b/flash2d/data/Triang12.dat @@ -0,0 +1,88 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +12 +!--- total number of edges +NUMBER_OF_EDGES +24 +!--- total number of elements +NUMBER_OF_ELEMENTS +12 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODES_DESCRIPTION + 1 -0.5 0.5 + 2 0.0 0.5 + 3 0.5 0.5 + 4 0.5 0.0 + 5 0.5 -0.5 + 6 0.0 -0.5 + 7 -0.5 -0.5 + 8 -0.5 0.0 + 9 -0.2 0.2 +10 0.2 0.2 +11 0.2 -0.2 +12 -0.2 -0.2 +!--- define the edges +EDGES_DESCRIPTION + 1 1 2 -1 + 2 2 3 -1 + 3 3 4 -1 + 4 4 5 -1 + 5 5 6 -1 + 6 6 7 -1 + 7 7 8 -1 + 8 8 1 -1 + 9 2 10 0 +10 10 4 0 +11 4 11 0 +12 11 6 0 +13 6 12 0 +14 12 8 0 +15 8 9 0 +16 9 2 0 +17 9 10 -1 +18 10 11 -1 +19 11 12 -1 +20 12 9 -1 +21 1 9 0 +22 3 10 0 +23 5 11 0 +24 7 12 0 +!--- define the elements +! edges in counter clockwise order +ELEMENTS_DESCRIPTION + 1 1 21 16 1 + 2 17 9 16 1 + 3 2 9 22 1 + 4 3 22 10 1 + 5 18 11 10 1 + 6 4 11 23 1 + 7 5 23 12 1 + 8 19 13 12 1 + 9 6 13 24 1 +10 7 24 14 1 +11 20 15 14 1 +12 8 15 21 1 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/TriangSph.ico.dat b/flash2d/data/TriangSph.ico.dat new file mode 100644 index 0000000000000000000000000000000000000000..37ecf8b65e5e7fb890476757e7a919a9cf997849 --- /dev/null +++ b/flash2d/data/TriangSph.ico.dat @@ -0,0 +1,78 @@ +#------------------------------------------------------------------- +# this file contains definitions for a initial triangulation +# i.e. the globe derived from a icosaeder +# with regular refinement until level 0 +# +# Matthias Laeuter, Potsdam, 4/2002 +# +# History: +# 1. original Version m.laeuter 4.2002 +# 2. corrected initial SFC orientation f.klaschka 7.2006 +#------------------------------------------------------------------- +# first give the global defining parameters +!!--- dimension of the grid coordinates +GRID_DIMENSION +3 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +12 +!--- total number of edges +NUMBER_OF_EDGES +30 +!--- total number of elements +NUMBER_OF_ELEMENTS +20 +!# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODES_DESCRIPTION +1 0.000000 0.000000 -1.000000 +2 0.894427 0.000000 -0.447214 +3 0.276393 0.850651 -0.447214 +4 -0.723607 0.525731 -0.447214 +5 -0.723607 -0.525731 -0.447214 +6 0.276393 -0.850651 -0.447214 +7 0.723607 0.525731 0.447214 +8 -0.276393 0.850651 0.447214 +9 -0.894427 0.000000 0.447214 +10 -0.276393 -0.850651 0.447214 +11 0.723607 -0.525731 0.447214 +12 0.000000 0.000000 1.000000 +!--- define the elements +ELEMENTS_DESCRIPTION +1 1 5 4 1 0 0 0 +2 1 4 3 1 0 0 0 +3 1 3 2 1 0 0 0 +4 1 2 6 1 0 0 0 +5 1 6 5 1 0 0 0 + +6 5 6 10 3 0 0 0 +7 6 2 11 3 0 0 0 +8 2 3 7 3 0 0 0 +9 3 4 8 3 0 0 0 +10 4 5 9 3 0 0 0 + +11 4 9 8 1 0 0 0 +12 3 8 7 1 0 0 0 +13 2 7 11 1 0 0 0 +14 6 11 10 1 0 0 0 +15 5 10 9 1 0 0 0 + +16 9 10 12 3 0 0 0 +17 10 11 12 3 0 0 0 +18 11 7 12 3 0 0 0 +19 7 8 12 3 0 0 0 +20 8 9 12 3 0 0 0 + +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang_algaeBaltic.dat b/flash2d/data/Triang_algaeBaltic.dat new file mode 100644 index 0000000000000000000000000000000000000000..938311977e239637707f4b5b80d894419426bbae --- /dev/null +++ b/flash2d/data/Triang_algaeBaltic.dat @@ -0,0 +1,189 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +5 +!--- total number of edges +NUMBER_OF_EDGES +8 +!--- total number of elements +NUMBER_OF_ELEMENTS +4 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +-3.95 +48.6 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +30.325 +48.6 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +30.325 +65.825 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +-3.95 +65.825 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +13.1875 +57.2125 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +3 +4 +EDGE_ELEMENTINDICES +3 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +1 +EDGE_ELEMENTINDICES +4 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +5 +EDGE_ELEMENTINDICES +1 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +2 +3 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +1 +5 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +5 +ELEMENT_EDGEINDICES +5 +8 +1 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +3 +5 +ELEMENT_EDGEINDICES +6 +5 +2 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +3 +4 +5 +ELEMENT_EDGEINDICES +7 +6 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +4 +1 +5 +ELEMENT_EDGEINDICES +8 +7 +4 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang_aviso.dat b/flash2d/data/Triang_aviso.dat new file mode 100644 index 0000000000000000000000000000000000000000..65db3d87d96bfa16438e8049723df0d1b8e0c886 --- /dev/null +++ b/flash2d/data/Triang_aviso.dat @@ -0,0 +1,189 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +5 +!--- total number of edges +NUMBER_OF_EDGES +8 +!--- total number of elements +NUMBER_OF_ELEMENTS +4 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +120.0 +-20.0 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +260.0 +-20.0 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +260.0 +60.0 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +120.0 +60.0 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +190.0 +20.0 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +3 +4 +EDGE_ELEMENTINDICES +3 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +1 +EDGE_ELEMENTINDICES +4 +0 +EDGE_BOUNDARYCONDITION +-1 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +5 +EDGE_ELEMENTINDICES +1 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +2 +3 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +1 +5 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +5 +ELEMENT_EDGEINDICES +5 +8 +1 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +3 +5 +ELEMENT_EDGEINDICES +6 +5 +2 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +3 +4 +5 +ELEMENT_EDGEINDICES +7 +6 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +4 +1 +5 +ELEMENT_EDGEINDICES +8 +7 +4 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang_periodic.dat b/flash2d/data/Triang_periodic.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1863fe6eced6c6c6b8042aef68f4156c300e762 --- /dev/null +++ b/flash2d/data/Triang_periodic.dat @@ -0,0 +1,189 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# i.e. the unit square moved by the vector (-0.5,-0.5). +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +5 +!--- total number of edges +NUMBER_OF_EDGES +8 +!--- total number of elements +NUMBER_OF_ELEMENTS +4 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +-0.5 +-0.5 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +0.5 +-0.5 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +0.5 +0.5 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +-0.5 +0.5 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +0.0 +0.0 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +3 +EDGE_BOUNDARYCONDITION +1 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +4 +EDGE_BOUNDARYCONDITION +2 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +3 +4 +EDGE_ELEMENTINDICES +3 +1 +EDGE_BOUNDARYCONDITION +1 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +1 +EDGE_ELEMENTINDICES +4 +2 +EDGE_BOUNDARYCONDITION +2 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +5 +EDGE_ELEMENTINDICES +1 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +2 +3 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +1 +5 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +5 +ELEMENT_EDGEINDICES +5 +8 +1 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +3 +5 +ELEMENT_EDGEINDICES +6 +5 +2 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +3 +4 +5 +ELEMENT_EDGEINDICES +7 +6 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +4 +1 +5 +ELEMENT_EDGEINDICES +8 +7 +4 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Triang_periodic_pi.dat b/flash2d/data/Triang_periodic_pi.dat new file mode 100644 index 0000000000000000000000000000000000000000..3b1b9d842583679683b155f2120e4ff254e1b278 --- /dev/null +++ b/flash2d/data/Triang_periodic_pi.dat @@ -0,0 +1,324 @@ +#------------------------------------------------------------------- +# this file contains definitions for a simple initial triangulation +# A square domain [-pi,pi]x[-pi/2,pi/2] made out of 8 triangles. +# pi = 3.141592653589793 +# pi/2= 1.570796326794897 +# +# j. behrens, 12/97 +#------------------------------------------------------------------- +# first give the global defining parameters +!--- dimension of the grid coordinates +GRID_DIMENSION +2 +!--- number of vertices in each element (3: triangular, 4: quadrilateral) +ELEMENT_VERTICES +3 +!--- total number of nodes +NUMBER_OF_NODES +8 +!--- total number of edges +NUMBER_OF_EDGES +15 +!--- total number of elements +NUMBER_OF_ELEMENTS +8 +# now define the boundary condition flags +DEF_INNERITEM +0 +DEF_DIRICHLETBOUNDARY +-1 +DEF_NEUMANNBOUNDARY +-2 +# now define the grid items like nodes, edges, elements +!--- define the nodes +NODE_INDEXNUMBER +1 +NODE_COORDINATES +0.0 +1.570796326794897 +NODE_INDEXNUMBER +2 +NODE_COORDINATES +-3.141592653589793 +1.570796326794897 +NODE_INDEXNUMBER +3 +NODE_COORDINATES +-1.570796326794897 +0.0 +NODE_INDEXNUMBER +4 +NODE_COORDINATES +-3.141592653589793 +-1.570796326794897 +NODE_INDEXNUMBER +5 +NODE_COORDINATES +0.0 +-1.570796326794897 +NODE_INDEXNUMBER +6 +NODE_COORDINATES +1.570796326794897 +0.0 +NODE_INDEXNUMBER +7 +NODE_COORDINATES +3.141592653589793 +-1.570796326794897 +NODE_INDEXNUMBER +8 +NODE_COORDINATES +3.141592653589793 +1.570796326794897 +!--- define the edges +EDGE_INDEXNUMBER +1 +EDGE_NODEINDICES +2 +3 +EDGE_ELEMENTINDICES +2 +1 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +2 +EDGE_NODEINDICES +3 +1 +EDGE_ELEMENTINDICES +4 +1 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +3 +EDGE_NODEINDICES +1 +2 +EDGE_ELEMENTINDICES +1 +3 +EDGE_BOUNDARYCONDITION +3 +EDGE_INDEXNUMBER +4 +EDGE_NODEINDICES +4 +3 +EDGE_ELEMENTINDICES +3 +2 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +5 +EDGE_NODEINDICES +2 +4 +EDGE_ELEMENTINDICES +2 +7 +EDGE_BOUNDARYCONDITION +5 +EDGE_INDEXNUMBER +6 +EDGE_NODEINDICES +3 +5 +EDGE_ELEMENTINDICES +3 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +7 +EDGE_NODEINDICES +4 +5 +EDGE_ELEMENTINDICES +3 +1 +EDGE_BOUNDARYCONDITION +3 +EDGE_INDEXNUMBER +8 +EDGE_NODEINDICES +5 +1 +EDGE_ELEMENTINDICES +5 +4 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +9 +EDGE_NODEINDICES +5 +6 +EDGE_ELEMENTINDICES +6 +5 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +10 +EDGE_NODEINDICES +6 +1 +EDGE_ELEMENTINDICES +8 +5 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +11 +EDGE_NODEINDICES +7 +6 +EDGE_ELEMENTINDICES +7 +6 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +12 +EDGE_NODEINDICES +5 +7 +EDGE_ELEMENTINDICES +8 +6 +EDGE_BOUNDARYCONDITION +12 +EDGE_INDEXNUMBER +13 +EDGE_NODEINDICES +8 +6 +EDGE_ELEMENTINDICES +8 +7 +EDGE_BOUNDARYCONDITION +0 +EDGE_INDEXNUMBER +14 +EDGE_NODEINDICES +7 +8 +EDGE_ELEMENTINDICES +2 +7 +EDGE_BOUNDARYCONDITION +5 +EDGE_INDEXNUMBER +15 +EDGE_NODEINDICES +8 +1 +EDGE_ELEMENTINDICES +6 +8 +EDGE_BOUNDARYCONDITION +12 +!--- define the elements +ELEMENT_INDEXNUMBER +1 +ELEMENT_NODEINDICES +1 +2 +3 +ELEMENT_EDGEINDICES +1 +2 +3 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +2 +ELEMENT_NODEINDICES +2 +4 +3 +ELEMENT_EDGEINDICES +4 +1 +5 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +3 +ELEMENT_NODEINDICES +4 +5 +3 +ELEMENT_EDGEINDICES +6 +4 +7 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +4 +ELEMENT_NODEINDICES +5 +1 +3 +ELEMENT_EDGEINDICES +2 +6 +8 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +5 +ELEMENT_NODEINDICES +1 +5 +6 +ELEMENT_EDGEINDICES +9 +10 +8 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +6 +ELEMENT_NODEINDICES +5 +7 +6 +ELEMENT_EDGEINDICES +11 +9 +12 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +7 +ELEMENT_NODEINDICES +7 +8 +6 +ELEMENT_EDGEINDICES +13 +11 +14 +ELEMENT_MARKEDEDGE +3 +ELEMENT_INDEXNUMBER +8 +ELEMENT_NODEINDICES +8 +1 +6 +ELEMENT_EDGEINDICES +10 +13 +15 +ELEMENT_MARKEDEDGE +3 +#------------------------------------------------------------------- +# end of file +#------------------------------------------------------------------- diff --git a/flash2d/data/Wind_algae.dat b/flash2d/data/Wind_algae.dat new file mode 100644 index 0000000000000000000000000000000000000000..bd22ef6d72a2a49911fe85d4155b26a7c684b665 --- /dev/null +++ b/flash2d/data/Wind_algae.dat @@ -0,0 +1,31 @@ +!------------------------------------------------------------------------- +! Wind_algae.dat +! this file contains data for the processing of wind data given in files +! it is part of the package for the 2015-2016 Tracer Transport course +! and allows for simulation of algae growth in the Baltic Sea. +! +! j. behrens, 2/2015 +!------------------------------------------------------------------------- +# the number of seconds contained in each stored wind data time step +SEC_PER_STEP +900. +# the number of wind data time steps per file +STEPS_PER_FILE +96 +# this is the path to the input file directory +ABS_PATH +/Users/behrens/Documents/Teaching/WS1516/Transport/Software/flash2d/data/ +# this is the number of input files following in the list +INFILE_NUMBER +3 +# and here follows the list of current input files +WIND_FILE_LIST +s2015082500_no.nc +s2015082600_no.nc +s2015082700_no.nc +# and the temperature file +TEMP_FILE +t2015082500_no.nc +!------------------------------------------------------------------------- +! END OF FILE +!------------------------------------------------------------------------- diff --git a/flash2d/data/Wind_aviso.dat b/flash2d/data/Wind_aviso.dat new file mode 100644 index 0000000000000000000000000000000000000000..d9ccbc08981eb62e1bd0ef0cb9ba8ebc848b0817 --- /dev/null +++ b/flash2d/data/Wind_aviso.dat @@ -0,0 +1,25 @@ +!------------------------------------------------------------------------- +! Wind_aviso.dat +! this file contains data for the processing of wind data given in files +! +! j. behrens, 2/2015 +!------------------------------------------------------------------------- +# the number of seconds contained in each stored wind data time step +SEC_PER_STEP +86400. +# the number of wind data time steps per file +STEPS_PER_FILE +1 +# this is the path to the input file directory +ABS_PATH +./testaviso/ +# this is the number of input files following in the list +INFILE_NUMBER +2 +# and here follows the list of input files +FILE_LIST +dt_global_twosat_madt_uv_20110311_20140106.nc +dt_global_twosat_madt_uv_20110312_20140106.nc +!------------------------------------------------------------------------- +! END OF FILE +!------------------------------------------------------------------------- diff --git a/flash2d/data/default.ftf b/flash2d/data/default.ftf new file mode 100644 index 0000000000000000000000000000000000000000..f9f7a46a7092aecd1968c5c87f463432a1cec200 --- /dev/null +++ b/flash2d/data/default.ftf @@ -0,0 +1,71 @@ +###################################################################### +# +# FILENAME: fem_default.ftf +# +# FUNCTION: definitions for fem type +# +# DESCRIPTION: this file contains defining data for a Lagrange FEM +# of order 1 (linear finite element with Lagrange basis) +# +# REFERENCES: original data from A. Riedm�ller (TU M�nchen) +# +# VERSION: 1. original version, j. behrens (09/2004) +# +# CAUTION: Due to some redefinitions in the signature code of amatos, +# this definition might contain some errors! +# +###################################################################### +!--- name of fem/describing string (< 32 characters) +SIGNATURE_DESCRIPTION +linear Lagrange +!--- Order of finite element +POLY_DEGREE + 1 +!--- Entry point in calc_fembasis +ANALYTICBASIS_HANDLE + 1 +!--- number of unknowns per vertex +NODE_DOFS + 1 +!--- number of unknowns per edge +EDGE_DOFS + 0 +!--- number of unknowns per face/interior +ELMT_DOFS + 0 +!--- number of quadrature points for corresponding (exact) quadrature scheme +ELMT_QUADPOINTS + 3 + +!--- for each quadrature point the (3) barycentric coordinate of its position +ELMT_QUADCOORDINATES +1 1.0 0.0 0.0 +2 0.0 1.0 0.0 +3 0.0 0.0 1.0 + +!--- for each face unknown the weights +ELMT_QUADWEIGHTS +1 0.333333333333333 +2 0.333333333333333 +3 0.333333333333334 + +!--- basis function evaluations at elmt quad points +ELMT_PSIQUADPOINTS +1 1.0 0.0 0.0 +2 0.0 1.0 0.0 +3 0.0 0.0 1.0 + +!--- coefficients for polynomial quadrature of a scalar derivative +!--- d psi/d xi at each unknown +DPSIDXI_MATRIX +-1.0 1.0 0.0 +-1.0 1.0 0.0 +-1.0 1.0 0.0 + +!--- coefficients for polynomial quadrature of a scalar derivative +!--- d psi/d eta at each unknown +DPSIDETA_MATRIX +-1.0 0.0 1.0 +-1.0 0.0 1.0 +-1.0 0.0 1.0 +### END OF FILE ###################################################### diff --git a/flash2d/data/elch.pbm b/flash2d/data/elch.pbm new file mode 100644 index 0000000000000000000000000000000000000000..2aafd1cc5379b3e0f5ac3a3ca87405dc018807c3 --- /dev/null +++ b/flash2d/data/elch.pbm @@ -0,0 +1,1609 @@ +P1 +# CREATOR: GIMP PNM Filter Version 1.1 +400 281 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111110111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111110000000 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111000001111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111110000000001111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111000000000111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111100000000011 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1000000000011111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111100000000000111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111110000000000011111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111110000000000011111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111000000000001111111111001111111111111111 +1111111111111111111111111111111111111111111111111111111001111111111100 +0000000000111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111100000000000111111111000001111111111111111111111111111111111 +1111111111111111111111111111111111000001111111110000000000001111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111110000000000 +0011111111000000011111111111111111111111111111111111111111111111111111 +1111111111111000000011111111000000000000111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111000000000000111111110000000111 +1111111111111111111111111111111111111111111111111111111111111110000000 +0111111100000000000011111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111100000000000011111110000000011111111111111111111111 +1111111111111111111111111111111111111111111000000001111111000000000000 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +0000000000000111110000000001111111111111111111111111111111111111111111 +1111111111111111111111100000000011111100000000000011111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111100000000000001111000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1110000000000011100000000000001111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111110000000000000000000000000001111111111111 +1111111111111111111111111111111111111111111111111111100000000000000000 +0000000000111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111100011111110000000000000000000000000001111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111110000000000 +0000000000000000011111100000111111111111111111111111111111111111111111 +1000000111111000000000000000000000000000111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111000000000000000000000000000011 +1000000001111111111111111111111111111111111111111110000000011110000000 +0000000000000000000011111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111100000000000000000000000000000000000000001111111111 +1111111111111111111111111111110000000000000000000000000000000000000001 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +0000000000000000000000000000000000000000111111111111111111111111111111 +1111111111000000000000000000000000000000000000000111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111110000000000000000000 +0000000000000000000011111111111111111111111111111111111111110000000000 +0000000000000000000000000000011111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111000000000000000000000000000000000000000 +1111111111111111111111111111111111111111100000000000000000000000000000 +0000000001111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111100000000000000000000000000000000000000111111111111111111111 +1111111111111111111110000000000000000000000000000000000000111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111100000000 +0000000000000000000000000000011100001111111111110000011111111111100011 +1000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111000000000000000000000000000 +0000000000000000011111111000000000000011111100000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111100000000000000000000000000000000000000000000111 +1110000000000000000011100000000000000000000000000000000000000000001111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000000000000011110000000000000000000 +0110000000000000000000000000000000000000000001111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111000000000000000 +0000000000000000000000000000110000000000000000000000000000000000000000 +0000000000000000000000001111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111110000000000000000000000000000000000 +0000000010000000000000000000000000000000000000000000000000000000000000 +0001111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111110000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000001111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000011111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111100000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000011111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111100000000000000000000000000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111100000000000000000000000000000111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111000000000000000000000000000111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111110000000000000 +0000000000000011111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111000000000000000000000000000111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111110000000000000000000000000111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111100 +0000000000000000000000011111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111110000000000000000000000 +0001111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111000000000000000000000000011111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111110000000000000000000000011111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111100000000000 +0000000000001111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111110000000000000000000000011111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111110000000000000000000000000111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111100 +0000000000000000000000011111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111100000000000000000000000 +0001111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111110000000000000000000000000001111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111100000000000000000000000000000011111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000000000111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111110000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111110000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111000000000 +0000000000000000000000000000111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111000000000000000000000000000000 +0000000001111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111100000000000000000000000000000000000000001111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111110 +0000000000000000000000000000000000000000011111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111110000000000000000000011 +1100000000000000000000111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111000000000000000000011111100000000000000000 +0011111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111100000000000000000011111111000000000000000000111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111110000000000000 +0000001111111100000000000000000001111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111000000000000000000011111111000000 +0000000000000111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111100000000000000000000111111000000000000000000001111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111000 +0000000000000000001111000000000000000000000111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111110000000000000000000000 +0000000000000000000000011111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111000000000000000000000000000000000000000000 +0011111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111100000000000000000000000000000000000000000000111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111000000000000 +0000000000000000000000000000000011111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111110000000000000000000000000000000 +0000000000011111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111100000000000000000000000000000000000000001111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1000000000000000000000000000000000000000111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111000000000000000000 +0000000000000000000111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111110000000000000000000000000000000000011 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111110000000000000000000000000000000111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111000 +0000000000000000000000001111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111110000000000000000000000 +0011111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111110000000000000000000011111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111100000000000000000001111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111000000000 +0000000001111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111110000000000000000011111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111000000000000000011111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1100000000000000001111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111000000000000000011 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111100000000000000001111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111110000000000000000111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111100000000 +0000000001111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111110000000000000000011111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111110000000000000000000111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111110 +0000000000000000000001111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111110000000000000000000000 +0001111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111100000000000000000000000000000111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111000000000000000000 +0000000000000000000111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111000000000000000000000000000000000000000 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111000000000000000000000000000000000000000001111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111000000000000 +0000000000000000000000000000000011111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111100000000000000000000000000000000 +0000000000000111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111100000000000000000000000000000000000000000000000111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111110000 +0000000000000000000000000000000000000000000011111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111000000000000000000000000 +0000000000000000000000000111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111100000000000000000000000000000000000000000000 +0000011111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111100000000000000000000000000000000000000000000000000111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111000000000000000 +0000000000000000000000000000000000011111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111100000000000000000000000000000000000 +0000000000000000111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111110000000000000000000000000000000000000000000000000001111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111000000 +0000000000000000000000000000000000000000000000111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000000000 +0000000000000000000000000011111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000001111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000000000000000000000011111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111000000000000000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000000000000000000000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111000000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000000000000000000000001111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111000000000000000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000000000000000000000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111000000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000000000000000000000001111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111000000000000000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000000000000000000000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111000000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111000000000000000000000000000000000000000000000000000001111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111110000000000000000 +0000000000000000000000000000000000000111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111000000000000000000000000000000000000 +0000000000000000011111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111100000000000000000000000000000000000000000000000000000111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111000000 +0000000000000000000000000000000000000000000000011111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111100000000000000000000000000 +0000000000000000000000000001111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111110000000000000000000000000000000000000000000000 +0000000111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +1111111111111111111111111111111111111111111111111111111111111111111111 +11111111111111111111111111111111111111111111111110 \ No newline at end of file diff --git a/flash2d/doc/Dataflow.eps b/flash2d/doc/Dataflow.eps new file mode 100644 index 0000000000000000000000000000000000000000..1202c1d97a29e0f278b3802c304e7281b398183e --- /dev/null +++ b/flash2d/doc/Dataflow.eps @@ -0,0 +1,904 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%BoundingBox: 10 150 471 681 +%%Title: /tmpdir/jbehrens/JB-Local/Flash/doc/Dataflow-new.eps +%%CreationDate: 1:09 PM January 21, 1998 +%%Pages: 1 +%%EndComments +%%BeginProlog +%%BeginResource ShowcaseResource +1 setlinejoin +/M { moveto } bind def /S { show } bind def +/R { rmoveto } bind def /L { lineto } bind def +/B { newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath } bind def +/CS { closepath stroke } bind def +/S { + /fixwidth exch def + dup length /nchars exch def + dup stringwidth pop + fixwidth exch sub nchars div + exch 0 exch ashow +} def +/bwproc { + rgbproc + dup length 3 idiv string 0 3 0 + 5 -1 roll { + add 2 1 roll 1 sub dup 0 eq + { pop 3 idiv 3 -1 roll dup 4 -1 roll dup + 3 1 roll 5 -1 roll put 1 add 3 0 } + { 2 1 roll } ifelse + } forall + pop pop pop +} def +systemdict /colorimage known not { + /colorimage { + pop + pop + /rgbproc exch def + { bwproc } image + } def +} if +1 1 scale +0 setlinewidth +/drawtri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +stroke +} bind def +/filltri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +fill +} bind def +/cliptri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +clip +} bind def +/imgscanrgb { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx 3 mul string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +false 3 +colorimage +grestore +} bind def +/imgscanbw { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +image +grestore +} bind def +/showcaseisoencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft +/bar /braceright /asciitilde /guilsinglright +/fraction /florin /quotesingle /quotedblleft +/guilsinglleft /fi /fl /endash +/dagger /daggerdbl /bullet /quotesinglbase +/quotedblbase /quotedblright /ellipsis /trademark +/dotlessi /grave /acute /circumflex +/tilde /macron /breve /dotaccent +/dieresis /perthousand /ring /cedilla +/Ydieresis /hungarumlaut /ogonek /caron +/emdash /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis ] def +/showcasedingbatencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /a1 /a2 /a202 /a3 /a4 /a5 /a119 /a118 /a117 +/a11 /a12 /a13 /a14 /a15 /a16 /a105 /a17 /a18 /a19 +/a20 /a21 /a22 /a23 /a24 /a25 /a26 /a27 /a28 /a6 /a7 +/a8 /a9 /a10 /a29 +/a30 /a31 /a32 /a33 /a34 /a35 /a36 /a37 /a38 /a39 +/a40 /a41 /a42 /a43 /a44 /a45 /a46 /a47 /a48 /a49 +/a50 /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 /a59 +/a60 /a61 /a62 /a63 /a64 /a65 /a66 /a67 /a68 /a69 +/a70 /a71 /a72 /a73 /a74 /a203 /a75 /a204 /a76 /a77 /a78 +/a79 /a81 /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef +/a205 /a85 /a206 /a86 /a87 /a88 /a89 /a90 /a91 /a92 /a93 +/a94 /a95 /a96 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 +/a112 /a111 /a110 /a109 +/a120 /a121 /a122 /a123 /a124 /a125 /a126 /a127 /a128 /a129 +/a130 /a131 /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 +/a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 /a148 /a149 +/a150 /a151 /a152 /a153 /a154 /a155 /a156 /a157 /a158 /a159 +/a160 /a161 /a163 /a164 /a196 /a165 /a192 /a166 /a167 /a168 +/a169 /a170 /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 +/a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 /.notdef +/a201 /a183 /a184 /a197 /a185 /a194 /a198 /a186 /a195 /a187 +/a188 /a189 /a190 /a191 /.notdef +] def +/Courier-Bold findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/Courier-Bold-SHOWISO exch definefont pop +/newfont 10 dict def +newfont begin + + /FontType 3 def + /FontMatrix [1 0 0 1 0 0] def + /FontBBox [0 0 1 1] def + /Encoding 256 array def + 0 1 255 {Encoding exch /.notdef put} for + + /CharProcs 1 dict def + CharProcs begin + /.notdef {} def + +end + + /BuildChar { + 1 0 + 0 0 1 1 + setcachedevice + exch begin + Encoding exch get + CharProcs exch get + end + exec + } def +end +/PatternFont newfont definefont pop + +%%EndResource +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: label 1 +gsave +/saveit save def +gsave +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +189.5 459 M +229.5 459 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283.125 422.5 M +283.125 396.25 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283.125 480.625 M +283.125 451.875 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 198.431 693.556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +215.394 665.926 M +244.394 665.926 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 216.131 671.057] concat +newpath +0 0 M 0 17 L 134.6 17 L 134.6 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +212.631 667.557 M 212.631 691.557 L 354.231 691.557 L 354.231 667.557 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 216.131 671.057] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (io_getcmdline) 132.6 S +setmatrix +grestore +gsave +matrix currentmatrix +[170 0 0 -28 87.0139 635.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +103.977 635.889 M +132.977 635.889 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 89.4139 613.278] concat +newpath +0 0 M 0 17 L 165.2 17 L 165.2 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +85.9139 609.778 M 85.9139 633.778 L 258.114 633.778 L 258.114 609.778 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 89.4139 613.278] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (io_getbatchinput) 163.2 S +setmatrix +grestore +gsave +matrix currentmatrix +[170 0 0 -28 308.058 635.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +325.021 635.889 M +354.021 635.889 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 310.458 613.278] concat +newpath +0 0 M 0 17 L 165.2 17 L 165.2 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +306.958 609.778 M 306.958 633.778 L 479.158 633.778 L 479.158 609.778 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 310.458 613.278] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (io_getinterinput) 163.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.6 487.129] concat +newpath +0 0 M 0 17 L 144.8 17 L 144.8 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +208.1 483.629 M 208.1 507.629 L 359.9 507.629 L 359.9 483.629 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.6 487.129] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (slm_initialize) 142.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 82.1694 439.353] concat +newpath +0 0 M 0 17 L 42.8 17 L 42.8 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +78.6694 435.853 M 78.6694 459.853 L 128.469 459.853 L 128.469 435.853 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 82.1694 439.353] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (plot) 40.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 201.4 428.121] concat +newpath +0 0 M 0 17 L 165.2 17 L 165.2 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +197.9 424.621 M 197.9 448.621 L 370.1 448.621 L 370.1 424.621 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 201.4 428.121] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (slm_timestepping) 163.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 232 374.129] concat +newpath +0 0 M 0 17 L 104 17 L 104 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +228.5 370.629 M 228.5 394.629 L 339.5 394.629 L 339.5 370.629 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 232 374.129] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (slm_finish) 102 S +setmatrix +grestore +gsave +0 1 1 setrgbcolor +1.000000 setlinewidth +newpath +21.1111 865.556 M +34.4444 871.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283.125 543.125 M +283.125 510 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283.625 461.853 M +189.5 461.853 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283 666 M +170 636 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +283 665 M +396 636 L +stroke +grestore +gsave +0 0 1 setrgbcolor +7.000000 setlinewidth +newpath +261.5 471.5 M +79.5 471.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +170 608 M +283 571 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +396 608 M +283 571 L +stroke +grestore +gsave +0 0 1 setrgbcolor +7.000000 setlinewidth +newpath +261.5 480 M +261.5 451 L +stroke +grestore +gsave +0 0 1 setrgbcolor +7.000000 setlinewidth +newpath +261.5 422 M +261.5 396 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 201.4 547.999] concat +newpath +0 0 M 0 17 L 165.2 17 L 165.2 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +197.9 544.499 M 197.9 568.499 L 370.1 568.499 L 370.1 544.499 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 201.4 547.999] concat +/Courier-Bold-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 3 M (io_putparameters) 163.2 S +setmatrix +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +230 665 M +230 648.769 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +47 648 M +337 648 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +119 648 M +119 636 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +339 651.231 M +339 635 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +50 647 M +50 462 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +112.111 309.556 M +135.444 309.556 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 152.222 301.109] concat +newpath +0 0 M 0 17 L 180.84 17 L 180.84 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +150.222 299.109 M 150.222 320.109 L 335.062 320.109 L 335.062 299.109 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 152.222 301.109] concat +/AvantGarde-Demi-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 4 M (C) 13.26 S +13.26 4 M (ontrol data structu) 149.26 S +162.52 4 M (re) 16.32 S +setmatrix +grestore +gsave +0 0 1 setrgbcolor +7.000000 setlinewidth +newpath +112.111 331 M +135.444 331 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 152.222 322.559] concat +newpath +0 0 M 0 17 L 156.02 17 L 156.02 0 L +closepath setmatrix +0 1 1 setrgbcolor +grestore +newpath +150.222 320.559 M 150.222 341.559 L 310.242 341.559 L 310.242 320.559 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 152.222 322.559] concat +/AvantGarde-Demi-SHOWISO findfont 17 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Grid data structure) 154.02 S +setmatrix +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +105 607.5 M +134 607.5 L +stroke +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +325 608.148 M +354 608.148 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 199 570.5] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +215.963 570.611 M +244.963 570.611 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 199 509.63] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +215.963 509.741 M +244.963 509.741 L +stroke +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +247.296 481.5 M +276.296 481.5 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 199 450.63] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +246.796 450.741 M +275.796 450.741 L +stroke +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +215.963 450.741 M +244.963 450.741 L +stroke +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +247.296 422.5 M +276.296 422.5 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 199 396.63] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +246.796 396.741 M +275.796 396.741 L +stroke +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +215.963 396.741 M +244.963 396.741 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +119 607 M +119 595 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +339 607.5 M +339 595.5 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +48 595 M +343 595 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +230 583 M +230 571 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +230 521.5 M +230 509.5 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +230 409 M +230 397 L +stroke +grestore +gsave +matrix currentmatrix +[170 0 0 -28 18.5694 461.853] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +66.3657 461.964 M +95.3658 461.964 L +stroke +grestore +gsave +1 0 1 setrgbcolor +4.000000 setlinewidth +newpath +35.5324 461.964 M +64.5324 461.964 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +230 462 M +230 450 L +stroke +grestore +gsave +0 0 1 setrgbcolor +7.000000 setlinewidth +newpath +79.5 474 M +79.5 462 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +50 580.5 M +232.5 580.5 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +49.5 519.5 M +232 519.5 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +50 433.5 M +50 404 L +stroke +grestore +gsave +1 0 1 setrgbcolor +7.000000 setlinewidth +newpath +50 407 M +232.5 407 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%EOF diff --git a/flash2d/doc/Datastruct.eps b/flash2d/doc/Datastruct.eps new file mode 100644 index 0000000000000000000000000000000000000000..3b31fb419c9d3f2cf178d84fc374ccb163c23627 --- /dev/null +++ b/flash2d/doc/Datastruct.eps @@ -0,0 +1,855 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%BoundingBox: 46 50 791 560 +%%Title: /home/bornemann/behrens/Development/Flash-0.7/doc/sources/Datastruct.eps +%%CreationDate: 8:16 AM May 16, 2001 +%%Pages: 1 +%%EndComments +%%BeginProlog +%%BeginResource ShowcaseResource +1 setlinejoin +/M { moveto } bind def /S { show } bind def +/R { rmoveto } bind def /L { lineto } bind def +/B { newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath } bind def +/CS { closepath stroke } bind def +/S { + /fixwidth exch def + dup length /nchars exch def + dup stringwidth pop + fixwidth exch sub nchars div + exch 0 exch ashow +} def +/bwproc { + rgbproc + dup length 3 idiv string 0 3 0 + 5 -1 roll { + add 2 1 roll 1 sub dup 0 eq + { pop 3 idiv 3 -1 roll dup 4 -1 roll dup + 3 1 roll 5 -1 roll put 1 add 3 0 } + { 2 1 roll } ifelse + } forall + pop pop pop +} def +systemdict /colorimage known not { + /colorimage { + pop + pop + /rgbproc exch def + { bwproc } image + } def +} if +1 1 scale +0 setlinewidth +/drawtri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +stroke +} bind def +/filltri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +fill +} bind def +/cliptri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +clip +} bind def +/imgscanrgb { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx 3 mul string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +false 3 +colorimage +grestore +} bind def +/imgscanbw { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +image +grestore +} bind def +/showcaseisoencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft +/bar /braceright /asciitilde /guilsinglright +/fraction /florin /quotesingle /quotedblleft +/guilsinglleft /fi /fl /endash +/dagger /daggerdbl /bullet /quotesinglbase +/quotedblbase /quotedblright /ellipsis /trademark +/dotlessi /grave /acute /circumflex +/tilde /macron /breve /dotaccent +/dieresis /perthousand /ring /cedilla +/Ydieresis /hungarumlaut /ogonek /caron +/emdash /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis ] def +/showcasedingbatencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /a1 /a2 /a202 /a3 /a4 /a5 /a119 /a118 /a117 +/a11 /a12 /a13 /a14 /a15 /a16 /a105 /a17 /a18 /a19 +/a20 /a21 /a22 /a23 /a24 /a25 /a26 /a27 /a28 /a6 /a7 +/a8 /a9 /a10 /a29 +/a30 /a31 /a32 /a33 /a34 /a35 /a36 /a37 /a38 /a39 +/a40 /a41 /a42 /a43 /a44 /a45 /a46 /a47 /a48 /a49 +/a50 /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 /a59 +/a60 /a61 /a62 /a63 /a64 /a65 /a66 /a67 /a68 /a69 +/a70 /a71 /a72 /a73 /a74 /a203 /a75 /a204 /a76 /a77 /a78 +/a79 /a81 /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef +/a205 /a85 /a206 /a86 /a87 /a88 /a89 /a90 /a91 /a92 /a93 +/a94 /a95 /a96 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 +/a112 /a111 /a110 /a109 +/a120 /a121 /a122 /a123 /a124 /a125 /a126 /a127 /a128 /a129 +/a130 /a131 /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 +/a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 /a148 /a149 +/a150 /a151 /a152 /a153 /a154 /a155 /a156 /a157 /a158 /a159 +/a160 /a161 /a163 /a164 /a196 /a165 /a192 /a166 /a167 /a168 +/a169 /a170 /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 +/a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 /.notdef +/a201 /a183 /a184 /a197 /a185 /a194 /a198 /a186 /a195 /a187 +/a188 /a189 /a190 /a191 /.notdef +] def +/newfont 10 dict def +newfont begin + + /FontType 3 def + /FontMatrix [1 0 0 1 0 0] def + /FontBBox [0 0 1 1] def + /Encoding 256 array def + 0 1 255 {Encoding exch /.notdef put} for + + /CharProcs 1 dict def + CharProcs begin + /.notdef {} def + +end + + /BuildChar { + 1 0 + 0 0 1 1 + setcachedevice + exch begin + Encoding exch get + CharProcs exch get + end + exec + } def +end +/PatternFont newfont definefont pop + +%%EndResource +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: label 1 +gsave +/saveit save def +gsave +gsave +matrix currentmatrix +[20.5183 0 0 20.5183 414.302 520.222] concat +newpath +0 0 1 0 360 arc +setmatrix +0.219608 0.556863 0.556863 setrgbcolor +closepath fill +grestore +gsave +matrix currentmatrix +[9.82344 9.82344 -9.82344 9.82344 414.195 520.115] concat +newpath +0 0 1 0 360 arc +setmatrix +1 0 1 setrgbcolor +closepath fill +grestore +gsave +matrix currentmatrix +[9.82344 9.82344 -9.82344 9.82344 415.302 309.222] concat +newpath +0 0 1 0 360 arc +setmatrix +1 0 1 setrgbcolor +closepath fill +grestore +gsave +0 0 1 setrgbcolor +4.000000 setlinewidth +newpath +270.302 523.222 M +558.302 523.222 L +414.302 307.222 L +closepath +270.302 522.222 M +stroke +grestore +gsave +1 0 1 setrgbcolor +2.000000 setlinewidth +newpath +414.302 523.222 M +414.302 307.222 L +stroke +grestore +gsave +matrix currentmatrix +[8.06226 0 0 8.06226 560.302 523.222] concat +newpath +0 0 1 0 360 arc +setmatrix +0 0 1 setrgbcolor +closepath fill +grestore +gsave +matrix currentmatrix +[8.06226 0 0 8.06226 268.365 524.284] concat +newpath +0 0 1 0 360 arc +setmatrix +0 0 1 setrgbcolor +closepath fill +grestore +gsave +matrix currentmatrix +[8.06226 0 0 8.06226 415.365 309.284] concat +newpath +0 0 1 0 360 arc +setmatrix +0 0 1 setrgbcolor +closepath fill +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 350.302 498.222] concat +newpath +0 0 M 0 18 L 126.2 18 L 126.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +346.802 494.722 M 346.802 519.722 L 480.002 519.722 L 480.002 494.722 L +closepath clip newpath +0 0 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 350.302 498.222] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 1 setrgbcolor +0 4 M (Element Index) 124.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[0 1 -1 0 435.302 362.222] concat +newpath +0 0 M 0 18 L 101 18 L 101 0 L +closepath setmatrix +1 0 1 setrgbcolor +grestore +newpath +414.802 359.722 M 414.802 465.722 L 437.802 465.722 L 437.802 359.722 L +closepath clip newpath +1 0 1 setrgbcolor +matrix currentmatrix +[0 1 -1 0 435.302 362.222] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +1 0 1 setrgbcolor +0 4 M (Edge Index) 99 S +setmatrix +grestore +gsave +1 0 1 setrgbcolor +/PatternFont findfont 16.08 scalefont setfont +newpath +271.302 522.222 M +415.302 307.222 L +559.302 523.222 L +closepath +eoclip +288 16.08 528 { +240 exch M +(BBBBBBBBBBBBBBBBBBBBB) +show +} for +1 0 1 setrgbcolor +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 356.302 541.222] concat +newpath +0 0 M 0 18 L 104.6 18 L 104.6 0 L +closepath setmatrix +1 0 1 setrgbcolor +grestore +newpath +353.802 538.722 M 353.802 561.722 L 463.402 561.722 L 463.402 538.722 L +closepath clip newpath +0.219608 0.556863 0.556863 setrgbcolor +matrix currentmatrix +[1 0 0 1 356.302 541.222] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0.219608 0.556863 0.556863 setrgbcolor +0 4 M (Node Index) 102.6 S +setmatrix +grestore +gsave +matrix currentmatrix +[220 0 0 -33 46.2222 274.222] concat +B +setmatrix +0 0 1 setrgbcolor +gsave fill grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 56.2222 248.722] concat +newpath +0 0 M 0 18 L 200 18 L 200 0 L +closepath setmatrix +1 1 1 setrgbcolor +grestore +newpath +52.7222 245.222 M 52.7222 270.222 L 259.722 270.222 L 259.722 245.222 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 56.2222 248.722] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +1 1 1 setrgbcolor +0 4 M (Element Data Struct) 169.92 S +169.92 4 M (ure) 28.08 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 46.2222 210.651] concat +newpath +0 0 M 0 18 L 32.6 18 L 32.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +42.7222 207.151 M 42.7222 232.151 L 82.3222 232.151 L 82.3222 207.151 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 46.2222 210.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (DEF) 30.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 46.2222 150.651] concat +newpath +0 0 M 0 18 L 30.44 18 L 30.44 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +42.7222 147.151 M 42.7222 172.151 L 80.1622 172.151 L 80.1622 147.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 46.2222 150.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (ATT) 28.44 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 141.822 174.651] concat +newpath +0 0 M 0 54 L 74 54 L 74 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +138.322 171.151 M 138.322 232.151 L 219.322 232.151 L 219.322 171.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 141.822 174.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 40 M (Index) 49.32 S +0 22 M (Node\(3\)) 72 S +0 4 M (Edge\(3\)) 68.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 141.822 96.6508] concat +newpath +0 0 M 0 72 L 69.68 72 L 69.68 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +138.322 93.1508 M 138.322 172.151 L 215.002 172.151 L 215.002 93.1508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 141.822 96.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 58 M (Marked) 67.68 S +0 40 M (Level) 45.36 S +0 22 M (State) 43.56 S +0 4 M (...) 15.12 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 46.2222 68.6508] concat +newpath +0 0 M 0 18 L 34.4 18 L 34.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +42.7222 65.1508 M 42.7222 90.1508 L 84.1222 90.1508 L 84.1222 65.1508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 46.2222 68.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (LNK) 32.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 141.822 68.6508] concat +newpath +0 0 M 0 18 L 112.88 18 L 112.88 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +139.822 66.6508 M 139.822 88.6508 L 256.702 88.6508 L 256.702 66.6508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 141.822 68.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Parent, Child) 110.88 S +setmatrix +grestore +gsave +matrix currentmatrix +[220 0 0 -33 308.222 274.222] concat +B +setmatrix +1 0 1 setrgbcolor +gsave fill grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 330.822 248.722] concat +newpath +0 0 M 0 18 L 174.8 18 L 174.8 0 L +closepath setmatrix +1 1 1 setrgbcolor +grestore +newpath +327.322 245.222 M 327.322 270.222 L 509.122 270.222 L 509.122 245.222 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 330.822 248.722] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +1 1 1 setrgbcolor +0 4 M (Edge Data Structure) 172.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 308.222 210.651] concat +newpath +0 0 M 0 18 L 32.6 18 L 32.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +304.722 207.151 M 304.722 232.151 L 344.322 232.151 L 344.322 207.151 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 308.222 210.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (DEF) 30.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 308.222 150.651] concat +newpath +0 0 M 0 18 L 30.44 18 L 30.44 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +304.722 147.151 M 304.722 172.151 L 342.162 172.151 L 342.162 147.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 308.222 150.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (ATT) 28.44 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 408.862 192.651] concat +newpath +0 0 M 0 36 L 74 36 L 74 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +405.362 189.151 M 405.362 232.151 L 486.362 232.151 L 486.362 189.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 408.862 192.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 22 M (Index) 49.32 S +0 4 M (Node\(2\)) 72 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 408.862 96.6507] concat +newpath +0 0 M 0 72 L 100.28 72 L 100.28 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +405.362 93.1507 M 405.362 172.151 L 512.642 172.151 L 512.642 93.1507 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 408.862 96.6507] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 58 M (Neig. Elem.) 98.28 S +0 40 M (Boundary) 83.52 S +0 22 M (State) 43.56 S +0 4 M (...) 15.12 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 308.222 68.6508] concat +newpath +0 0 M 0 18 L 34.4 18 L 34.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +304.722 65.1508 M 304.722 90.1508 L 346.122 90.1508 L 346.122 65.1508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 308.222 68.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (LNK) 32.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 408.862 50.6508] concat +newpath +0 0 M 0 36 L 112.88 36 L 112.88 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +406.862 48.6508 M 406.862 88.6508 L 523.742 88.6508 L 523.742 48.6508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 408.862 50.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 22 M (Parent, Child) 110.88 S +0 4 M (Periodic) 70.92 S +setmatrix +grestore +gsave +matrix currentmatrix +[220 0 0 -33 570.222 274.222] concat +B +setmatrix +0.219608 0.556863 0.556863 setrgbcolor +gsave fill grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 591.022 248.722] concat +newpath +0 0 M 0 18 L 178.4 18 L 178.4 0 L +closepath setmatrix +1 1 1 setrgbcolor +grestore +newpath +587.522 245.222 M 587.522 270.222 L 772.922 270.222 L 772.922 245.222 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 591.022 248.722] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +1 1 1 setrgbcolor +0 4 M (Node Data Structure) 176.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 570.222 210.651] concat +newpath +0 0 M 0 18 L 32.6 18 L 32.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +566.722 207.151 M 566.722 232.151 L 606.322 232.151 L 606.322 207.151 L +closepath clip newpath +1 1 1 setrgbcolor +matrix currentmatrix +[1 0 0 1 570.222 210.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (DEF) 30.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 0.999999 570.222 150.651] concat +newpath +0 0 M 0 18 L 30.44 18 L 30.44 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +566.722 147.151 M 566.722 172.151 L 604.162 172.151 L 604.162 147.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 0.999999 570.222 150.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (ATT) 28.44 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 665.822 192.651] concat +newpath +0 0 M 0 36 L 124.4 36 L 124.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +662.322 189.151 M 662.322 232.151 L 793.722 232.151 L 793.722 189.151 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 665.822 192.651] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 22 M (Index) 49.32 S +0 4 M (Coordinate\(2\)) 122.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 665.822 96.6507] concat +newpath +0 0 M 0 72 L 61.04 72 L 61.04 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +662.322 93.1507 M 662.322 172.151 L 730.362 172.151 L 730.362 93.1507 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 665.822 96.6507] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 58 M (Patch) 49.68 S +0 40 M (State) 43.56 S +0 22 M (Values) 59.04 S +0 4 M (...) 15.12 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 570.222 68.6507] concat +newpath +0 0 M 0 18 L 34.4 18 L 34.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +566.722 65.1507 M 566.722 90.1507 L 608.122 90.1507 L 608.122 65.1507 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 570.222 68.6507] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (LNK) 32.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 665.822 68.6508] concat +newpath +0 0 M 0 18 L 72.92 18 L 72.92 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +663.822 66.6508 M 663.822 88.6508 L 740.742 88.6508 L 740.742 66.6508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 665.822 68.6508] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Periodic) 70.92 S +setmatrix +grestore +grestore +showpage +saveit restore +grestore +%%EOF diff --git a/flash2d/doc/FlashRef.bib b/flash2d/doc/FlashRef.bib new file mode 100644 index 0000000000000000000000000000000000000000..5251d2123d042a0082d929bc975568fd0990a22f --- /dev/null +++ b/flash2d/doc/FlashRef.bib @@ -0,0 +1,47 @@ +%% This BibTeX bibliography file was created using BibDesk. +%% http://bibdesk.sourceforge.net/ + + +%% Created for Jörn Behrens at 2016-02-04 14:27:47 +0100 + + +%% Saved with string encoding Unicode (UTF-8) + + + +@article{Behrens1996, + Author = {Behrens, J.}, + Date-Added = {2016-02-04 13:26:18 +0000}, + Date-Modified = {2016-02-04 13:27:43 +0000}, + Journal = {Mon. Wea. Rev.}, + Keywords = {semi lagrange adaptive mesh refinement advection}, + Mynumber = {Oce Num 109}, + Number = {10}, + Pages = {2386--2395}, + Title = {An Adaptive Semi-{L}agrangian Advection Scheme and its Parallelization}, + Volume = {124}, + Year = {1996}} + +@book{Behrens2006, + Address = {Heidelberg, Berlin}, + Author = {Behrens, J.}, + Date-Added = {2016-02-04 13:23:48 +0000}, + Date-Modified = {2016-02-04 13:23:48 +0000}, + Doi = {10.1007/3-540-33383-5}, + Local-Url = {file://localhost/Users/jbehrens/Documents/Projects/Habil/Buch/Proof/3540333827_lncse54_020606.pdf}, + Publisher = {Springer Verlag}, + Series = {LNCSE}, + Title = {Adaptive Atmospheric Modeling -- Key techniques in grid generation, data structures, and numerical operations with applications}, + Volume = {54}, + Year = {2006}, + Bdsk-File-1 = {YnBsaXN0MDDUAQIDBAUGJCVYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3ASAAGGoKgHCBMUFRYaIVUkb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EAARgBNAFUAYABnAGoAbABuAHEAcwB1AHcAhACOANcA3ADkAuoC7ALxAvwDBQMTAxcDHgMnAywDOQM8A04DUQNWAAAAAAAAAgEAAAAAAAAAKAAAAAAAAAAAAAAAAAAAA1g=}, + Bdsk-Url-1 = {http://www.springer.com/math/cse/book/978-3-540-33382-1}} + +@article{Behrens2005, + Author = {Behrens, J. and Rakowsky, N. and Hiller, W. and Handorf, D. and L{\"a}uter, M. and P{\"a}pke, J. and Dethloff, K.}, + Journal = {Ocean Modelling}, + Number = {1--2}, + Pages = {171--183}, + Title = {{amatos}: Parallel Adaptive Mesh Generator for Atmospheric and Oceanic Simulation}, + Volume = {10}, + Year = {2005}} diff --git a/flash2d/doc/Flash_doxyfile.mac b/flash2d/doc/Flash_doxyfile.mac new file mode 100644 index 0000000000000000000000000000000000000000..0353fa295e1bcb531662f56c309c8c94af0c5afb --- /dev/null +++ b/flash2d/doc/Flash_doxyfile.mac @@ -0,0 +1,2440 @@ +# Doxyfile 1.8.11 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Flash 2D - Adaptive Semi-Lagrangian Advection" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "Flash2d is a semi-Lagrangian advection code, based on amatos" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = /Users/behrens/Documents/Development/amatos/flash2d/trunk/doc/flash.png + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = /Users/behrens/Documents/Development/amatos/flash2d/trunk/doc/doxygen + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = YES + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if <section_label> ... \endif and \cond <section_label> +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = /Users/behrens/Documents/Development/amatos/flash2d/trunk/doc/FlashRef.bib + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = /Users/behrens/Documents/Development/amatos/flash2d/trunk/src/flash \ + /Users/behrens/Documents/Development/amatos/flash2d/trunk/src/options \ + /Users/behrens/Documents/Development/amatos/flash2d/trunk/doc/mainpage.txt + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, +# *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. + +FILE_PATTERNS = *.f90 \ + *.f \ + *.F90 \ + *.c + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# <filter> <input-file> +# +# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = YES + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse-libclang=ON option for CMake. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = NO + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the master .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = YES + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use <access key> + S +# (what the <access key> is depends on the OS and browser, but it is typically +# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down +# key> to jump into the search results window, the results can be navigated +# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel +# the search. The filter options can be selected when the cursor is inside the +# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys> +# to select a filter and <Enter> or <escape> to activate or cancel the filter +# option. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a web server instead of a web client using Javascript. There +# are two flavors of web server based searching depending on the EXTERNAL_SEARCH +# setting. When disabled, doxygen will generate a PHP script for searching and +# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing +# and searching needs to be provided by external tools. See the section +# "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SERVER_BASED_SEARCH = NO + +# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP +# script for searching. Instead the search results are written to an XML file +# which needs to be processed by an external indexer. Doxygen will invoke an +# external search engine pointed to by the SEARCHENGINE_URL option to obtain the +# search results. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: http://xapian.org/). +# +# See the section "External Indexing and Searching" for details. +# The default value is: NO. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH = NO + +# The SEARCHENGINE_URL should point to a search engine hosted by a web server +# which will return the search results when EXTERNAL_SEARCH is enabled. +# +# Doxygen ships with an example indexer (doxyindexer) and search engine +# (doxysearch.cgi) which are based on the open source search engine library +# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Searching" for details. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHENGINE_URL = + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed +# search data is written to a file for indexing by an external tool. With the +# SEARCHDATA_FILE tag the name of this file can be specified. +# The default file is: searchdata.xml. +# This tag requires that the tag SEARCHENGINE is set to YES. + +SEARCHDATA_FILE = searchdata.xml + +# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the +# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is +# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple +# projects and redirect the results back to the right project. +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTERNAL_SEARCH_ID = + +# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen +# projects other than the one defined by this configuration file, but that are +# all added to the same external search index. Each project needs to have a +# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of +# to a relative location where the documentation can be found. The format is: +# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... +# This tag requires that the tag SEARCHENGINE is set to YES. + +EXTRA_SEARCH_MAPPINGS = + +#--------------------------------------------------------------------------- +# Configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output. +# The default value is: YES. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. +# +# Note that when enabling USE_PDFLATEX this option is only used for generating +# bitmaps for formulas in the HTML output, but not in the Makefile that is +# written to the output directory. +# The default file is: latex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate +# index for LaTeX. +# The default file is: makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used by the +# printer. +# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x +# 14 inches) and executive (7.25 x 10.5 inches). +# The default value is: a4. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names +# that should be included in the LaTeX output. The package can be specified just +# by its name or with the correct syntax as to be used with the LaTeX +# \usepackage command. To get the times font for instance you can specify : +# EXTRA_PACKAGES=times or EXTRA_PACKAGES={times} +# To use the option intlimits with the amsmath package you can specify: +# EXTRA_PACKAGES=[intlimits]{amsmath} +# If left blank no extra packages will be included. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the +# generated LaTeX document. The header should contain everything until the first +# chapter. If it is left blank doxygen will generate a standard header. See +# section "Doxygen usage" for information on how to let doxygen write the +# default header to a separate file. +# +# Note: Only use a user-defined header if you know what you are doing! The +# following commands have a special meaning inside the header: $title, +# $datetime, $date, $doxygenversion, $projectname, $projectnumber, +# $projectbrief, $projectlogo. Doxygen will replace $title with the empty +# string, for the replacement values of the other commands the user is referred +# to HTML_HEADER. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the +# generated LaTeX document. The footer should contain everything after the last +# chapter. If it is left blank doxygen will generate a standard footer. See +# LATEX_HEADER for more information on how to generate a default footer and what +# special commands can be used inside the footer. +# +# Note: Only use a user-defined footer if you know what you are doing! +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_FOOTER = + +# The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# LaTeX style sheets that are included after the standard style sheets created +# by doxygen. Using this option one can overrule certain style aspects. Doxygen +# will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_STYLESHEET = + +# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the LATEX_OUTPUT output +# directory. Note that the files will be copied as-is; there are no commands or +# markers available. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EXTRA_FILES = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is +# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will +# contain links (just like the HTML output) instead of page references. This +# makes the output suitable for online browsing using a PDF viewer. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate +# the PDF file directly from the LaTeX files. Set this option to YES, to get a +# higher quality PDF documentation. +# The default value is: YES. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode +# command to the generated LaTeX files. This will instruct LaTeX to keep running +# if errors occur, instead of asking the user for help. This option is also used +# when generating formulas in HTML. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BATCHMODE = NO + +# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the +# index chapters (such as File Index, Compound Index, etc.) in the output. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_HIDE_INDICES = NO + +# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source +# code with syntax highlighting in the LaTeX output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_SOURCE_CODE = NO + +# The LATEX_BIB_STYLE tag can be used to specify the style to use for the +# bibliography, e.g. plainnat, or ieeetr. See +# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# The default value is: plain. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_BIB_STYLE = plain + +# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: NO. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES, doxygen will generate RTF output. The +# RTF output is optimized for Word 97 and may not look too pretty with other RTF +# readers/editors. +# The default value is: NO. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: rtf. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES, doxygen generates more compact RTF +# documents. This may be useful for small projects and may help to save some +# trees in general. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will +# contain hyperlink fields. The RTF file will contain links (just like the HTML +# output) instead of page references. This makes the output suitable for online +# browsing using Word or some other Word compatible readers that support those +# fields. +# +# Note: WordPad (write) and others do not support links. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's config +# file, i.e. a series of assignments. You only have to provide replacements, +# missing definitions are set to their default value. +# +# See also section "Doxygen usage" for information on how to generate the +# default style sheet that doxygen normally uses. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an RTF document. Syntax is +# similar to doxygen's config file. A template extensions file can be generated +# using doxygen -e rtf extensionFile. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_EXTENSIONS_FILE = + +# If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code +# with syntax highlighting in the RTF output. +# +# Note that which sources are shown also depends on other settings such as +# SOURCE_BROWSER. +# The default value is: NO. +# This tag requires that the tag GENERATE_RTF is set to YES. + +RTF_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES, doxygen will generate man pages for +# classes and files. +# The default value is: NO. + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. A directory man3 will be created inside the directory specified by +# MAN_OUTPUT. +# The default directory is: man. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to the generated +# man pages. In case the manual section does not start with a number, the number +# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is +# optional. +# The default value is: .3. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_EXTENSION = .3 + +# The MAN_SUBDIR tag determines the name of the directory created within +# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by +# MAN_EXTENSION with the initial . removed. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_SUBDIR = + +# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it +# will generate one additional man file for each entity documented in the real +# man page(s). These additional files only source the real man page, but without +# them the man command would be unable to find the correct page. +# The default value is: NO. +# This tag requires that the tag GENERATE_MAN is set to YES. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES, doxygen will generate an XML file that +# captures the structure of the code including all documentation. +# The default value is: NO. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: xml. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_OUTPUT = xml + +# If the XML_PROGRAMLISTING tag is set to YES, doxygen will dump the program +# listings (including syntax highlighting and cross-referencing information) to +# the XML output. Note that enabling this will significantly increase the size +# of the XML output. +# The default value is: YES. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the DOCBOOK output +#--------------------------------------------------------------------------- + +# If the GENERATE_DOCBOOK tag is set to YES, doxygen will generate Docbook files +# that can be used to generate PDF. +# The default value is: NO. + +GENERATE_DOCBOOK = NO + +# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in +# front of it. +# The default directory is: docbook. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_OUTPUT = docbook + +# If the DOCBOOK_PROGRAMLISTING tag is set to YES, doxygen will include the +# program listings (including syntax highlighting and cross-referencing +# information) to the DOCBOOK output. Note that enabling this will significantly +# increase the size of the DOCBOOK output. +# The default value is: NO. +# This tag requires that the tag GENERATE_DOCBOOK is set to YES. + +DOCBOOK_PROGRAMLISTING = NO + +#--------------------------------------------------------------------------- +# Configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an +# AutoGen Definitions (see http://autogen.sf.net) file that captures the +# structure of the code including all documentation. Note that this feature is +# still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES, doxygen will generate a Perl module +# file that captures the structure of the code including all documentation. +# +# Note that this feature is still experimental and incomplete at the moment. +# The default value is: NO. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES, doxygen will generate the necessary +# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI +# output from the Perl module output. +# The default value is: NO. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES, the Perl module output will be nicely +# formatted so it can be parsed by a human reader. This is useful if you want to +# understand what is going on. On the other hand, if this tag is set to NO, the +# size of the Perl module output will be much smaller and Perl will parse it +# just the same. +# The default value is: YES. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file are +# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful +# so different doxyrules.make files included by the same Makefile don't +# overwrite each other's variables. +# This tag requires that the tag GENERATE_PERLMOD is set to YES. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# C-preprocessor directives found in the sources and include files. +# The default value is: YES. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be +# performed. Macro expansion can be done in a controlled way by setting +# EXPAND_ONLY_PREDEF to YES. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then +# the macro expansion is limited to the macros specified with the PREDEFINED and +# EXPAND_AS_DEFINED tags. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# INCLUDE_PATH will be searched if a #include is found. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by the +# preprocessor. +# This tag requires that the tag SEARCH_INCLUDES is set to YES. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will be +# used. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this +# tag can be used to specify a list of macro names that should be expanded. The +# macro definition that is found in the sources will be used. Use the PREDEFINED +# tag if you want to use a different macro definition that overrules the +# definition found in the source code. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not +# removed. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES tag can be used to specify one or more tag files. For each tag +# file the location of the external documentation should be added. The format of +# a tag file without this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where loc1 and loc2 can be relative or absolute paths or URLs. See the +# section "Linking to external documentation" for more information about the use +# of tag files. +# Note: Each tag file must have a unique name (where the name does NOT include +# the path). If a tag file is not located in the directory in which doxygen is +# run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create a +# tag file that is based on the input files it reads. See section "Linking to +# external documentation" for more information about the usage of tag files. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES, all external class will be listed in +# the class index. If set to NO, only the inherited external classes will be +# listed. +# The default value is: NO. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES, all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will be +# listed. +# The default value is: YES. + +EXTERNAL_GROUPS = YES + +# If the EXTERNAL_PAGES tag is set to YES, all external pages will be listed in +# the related pages index. If set to NO, only the current project's pages will +# be listed. +# The default value is: YES. + +EXTERNAL_PAGES = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of 'which perl'). +# The default file (with absolute path) is: /usr/bin/perl. + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES, doxygen will generate a class diagram +# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to +# NO turns the diagrams off. Note that this option also works with HAVE_DOT +# disabled, but it is recommended to install and use dot, since it yields more +# powerful graphs. +# The default value is: YES. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see: +# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# You can include diagrams made with dia in doxygen documentation. Doxygen will +# then run dia to produce the diagram and insert it in the documentation. The +# DIA_PATH tag allows you to specify the directory where the dia binary resides. +# If left empty dia is assumed to be found in the default search path. + +DIA_PATH = + +# If set to YES the inheritance and collaboration graphs will hide inheritance +# and usage relations if the target is undocumented or is not a class. +# The default value is: YES. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz (see: +# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent +# Bell Labs. The other options in this section have no effect if this option is +# set to NO +# The default value is: NO. + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed +# to run in parallel. When set to 0 doxygen will base this on the number of +# processors available in the system. You can set it explicitly to a value +# larger than 0 to get control over the balance between CPU load and processing +# speed. +# Minimum value: 0, maximum value: 32, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_NUM_THREADS = 0 + +# When you want a differently looking font in the dot files that doxygen +# generates you can specify the font name using DOT_FONTNAME. You need to make +# sure dot is able to find the font, which can be done by putting it in a +# standard location or by setting the DOTFONTPATH environment variable or by +# setting DOT_FONTPATH to the directory containing the font. +# The default value is: Helvetica. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of +# dot graphs. +# Minimum value: 4, maximum value: 24, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the default font as specified with +# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set +# the path where dot can find it using this tag. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_FONTPATH = + +# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for +# each documented class showing the direct and indirect inheritance relations. +# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a +# graph for each documented class showing the direct and indirect implementation +# dependencies (inheritance, containment, and class references variables) of the +# class with other documented classes. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for +# groups, showing the direct groups dependencies. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES, doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LOOK = NO + +# If the UML_LOOK tag is enabled, the fields and methods are shown inside the +# class node. If there are many fields or methods and many nodes the graph may +# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the +# number of items for each type to make the size more manageable. Set this to 0 +# for no limit. Note that the threshold may be exceeded by 50% before the limit +# is enforced. So when you set the threshold to 10, up to 15 fields may appear, +# but if the number exceeds 15, the total amount of fields shown is limited to +# 10. +# Minimum value: 0, maximum value: 100, default value: 10. +# This tag requires that the tag HAVE_DOT is set to YES. + +UML_LIMIT_NUM_FIELDS = 10 + +# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and +# collaboration graphs will show the relations between templates and their +# instances. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +TEMPLATE_RELATIONS = NO + +# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to +# YES then doxygen will generate a graph for each documented file showing the +# direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDE_GRAPH = YES + +# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are +# set to YES then doxygen will generate a graph for each documented file showing +# the direct and indirect include dependencies of the file with other documented +# files. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH tag is set to YES then doxygen will generate a call +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable call graphs for selected +# functions only using the \callgraph command. Disabling a call graph can be +# accomplished by means of the command \hidecallgraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller +# dependency graph for every global function or class method. +# +# Note that enabling this option will significantly increase the time of a run. +# So in most cases it will be better to enable caller graphs for selected +# functions only using the \callergraph command. Disabling a caller graph can be +# accomplished by means of the command \hidecallergraph. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical +# hierarchy of all classes instead of a textual one. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the +# dependencies a directory has on other directories in a graphical way. The +# dependency relations are determined by the #include relations between the +# files in the directories. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. For an explanation of the image formats see the section +# output formats in the documentation of the dot tool (Graphviz (see: +# http://www.graphviz.org/)). +# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order +# to make the SVG files visible in IE 9+ (other browsers do not have this +# requirement). +# Possible values are: png, jpg, gif, svg, png:gd, png:gd:gd, png:cairo, +# png:cairo:gd, png:cairo:cairo, png:cairo:gdiplus, png:gdiplus and +# png:gdiplus:gdiplus. +# The default value is: png. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_IMAGE_FORMAT = png + +# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to +# enable generation of interactive SVG images that allow zooming and panning. +# +# Note that this requires a modern browser other than Internet Explorer. Tested +# and working are Firefox, Chrome, Safari, and Opera. +# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make +# the SVG files visible. Older versions of IE do not have SVG support. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +INTERACTIVE_SVG = NO + +# The DOT_PATH tag can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_PATH = /sw2/bin + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the \dotfile +# command). +# This tag requires that the tag HAVE_DOT is set to YES. + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the \mscfile +# command). + +MSCFILE_DIRS = + +# The DIAFILE_DIRS tag can be used to specify one or more directories that +# contain dia files that are included in the documentation (see the \diafile +# command). + +DIAFILE_DIRS = + +# When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the +# path where java can find the plantuml.jar file. If left blank, it is assumed +# PlantUML is not used or called during a preprocessing step. Doxygen will +# generate a warning when it encounters a \startuml command in this case and +# will not generate output for the diagram. + +PLANTUML_JAR_PATH = + +# When using plantuml, the specified paths are searched for files specified by +# the !include statement in a plantuml block. + +PLANTUML_INCLUDE_PATH = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes +# that will be shown in the graph. If the number of nodes in a graph becomes +# larger than this value, doxygen will truncate the graph, which is visualized +# by representing a node as a red box. Note that doxygen if the number of direct +# children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that +# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. +# Minimum value: 0, maximum value: 10000, default value: 50. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs +# generated by dot. A depth value of 3 means that only nodes reachable from the +# root by following a path via at most 3 edges will be shown. Nodes that lay +# further from the root node will be omitted. Note that setting this option to 1 +# or 2 may greatly reduce the computation time needed for large code bases. Also +# note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. +# Minimum value: 0, maximum value: 1000, default value: 0. +# This tag requires that the tag HAVE_DOT is set to YES. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not seem +# to support this out of the box. +# +# Warning: Depending on the platform used, enabling this option may lead to +# badly anti-aliased labels on the edges of a graph (i.e. they become hard to +# read). +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) support +# this, this feature is disabled by default. +# The default value is: NO. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page +# explaining the meaning of the various boxes and arrows in the dot generated +# graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES, doxygen will remove the intermediate dot +# files that are used to generate the various graphs. +# The default value is: YES. +# This tag requires that the tag HAVE_DOT is set to YES. + +DOT_CLEANUP = YES diff --git a/flash2d/doc/GridFlow.ps b/flash2d/doc/GridFlow.ps new file mode 100644 index 0000000000000000000000000000000000000000..4ec4e40f09e53baffabc8f6925234700f4b94c0e --- /dev/null +++ b/flash2d/doc/GridFlow.ps @@ -0,0 +1,6258 @@ +%!PS-Adobe-2.0 +%%BoundingBox: 166 31 448 811 +%%Title: /tmpdir/jbehrens/JB-Local/Flash/doc/GridFlow.ps +%%CreationDate: 5:03 PM August 7, 1997 +%%Pages: 8 +%%EndComments +%%BeginProlog +%%BeginResource ShowcaseResource +1 setlinejoin +/M { moveto } bind def /S { show } bind def +/R { rmoveto } bind def /L { lineto } bind def +/B { newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath } bind def +/CS { closepath stroke } bind def +/S { + /fixwidth exch def + dup length /nchars exch def + dup stringwidth pop + fixwidth exch sub nchars div + exch 0 exch ashow +} def +/bwproc { + rgbproc + dup length 3 idiv string 0 3 0 + 5 -1 roll { + add 2 1 roll 1 sub dup 0 eq + { pop 3 idiv 3 -1 roll dup 4 -1 roll dup + 3 1 roll 5 -1 roll put 1 add 3 0 } + { 2 1 roll } ifelse + } forall + pop pop pop +} def +systemdict /colorimage known not { + /colorimage { + pop + pop + /rgbproc exch def + { bwproc } image + } def +} if +1 1 scale +0 setlinewidth +/drawtri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +stroke +} bind def +/filltri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +fill +} bind def +/cliptri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +clip +} bind def +/imgscanrgb { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx 3 mul string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +false 3 +colorimage +grestore +} bind def +/imgscanbw { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +image +grestore +} bind def +/showcaseisoencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft +/bar /braceright /asciitilde /guilsinglright +/fraction /florin /quotesingle /quotedblleft +/guilsinglleft /fi /fl /endash +/dagger /daggerdbl /bullet /quotesinglbase +/quotedblbase /quotedblright /ellipsis /trademark +/dotlessi /grave /acute /circumflex +/tilde /macron /breve /dotaccent +/dieresis /perthousand /ring /cedilla +/Ydieresis /hungarumlaut /ogonek /caron +/emdash /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis ] def +/showcasedingbatencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /a1 /a2 /a202 /a3 /a4 /a5 /a119 /a118 /a117 +/a11 /a12 /a13 /a14 /a15 /a16 /a105 /a17 /a18 /a19 +/a20 /a21 /a22 /a23 /a24 /a25 /a26 /a27 /a28 /a6 /a7 +/a8 /a9 /a10 /a29 +/a30 /a31 /a32 /a33 /a34 /a35 /a36 /a37 /a38 /a39 +/a40 /a41 /a42 /a43 /a44 /a45 /a46 /a47 /a48 /a49 +/a50 /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 /a59 +/a60 /a61 /a62 /a63 /a64 /a65 /a66 /a67 /a68 /a69 +/a70 /a71 /a72 /a73 /a74 /a203 /a75 /a204 /a76 /a77 /a78 +/a79 /a81 /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef +/a205 /a85 /a206 /a86 /a87 /a88 /a89 /a90 /a91 /a92 /a93 +/a94 /a95 /a96 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 +/a112 /a111 /a110 /a109 +/a120 /a121 /a122 /a123 /a124 /a125 /a126 /a127 /a128 /a129 +/a130 /a131 /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 +/a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 /a148 /a149 +/a150 /a151 /a152 /a153 /a154 /a155 /a156 /a157 /a158 /a159 +/a160 /a161 /a163 /a164 /a196 /a165 /a192 /a166 /a167 /a168 +/a169 /a170 /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 +/a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 /.notdef +/a201 /a183 /a184 /a197 /a185 /a194 /a198 /a186 /a195 /a187 +/a188 /a189 /a190 /a191 /.notdef +] def +/Courier-Bold findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/Courier-Bold-SHOWISO exch definefont pop +/AvantGarde-Demi findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/AvantGarde-Demi-SHOWISO exch definefont pop +/Courier findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/Courier-SHOWISO exch definefont pop +/AvantGarde-Book findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/AvantGarde-Book-SHOWISO exch definefont pop +/newfont 10 dict def +newfont begin + + /FontType 3 def + /FontMatrix [1 0 0 1 0 0] def + /FontBBox [0 0 1 1] def + /Encoding 256 array def + 0 1 255 {Encoding exch /.notdef put} for + + /CharProcs 1 dict def + CharProcs begin + /.notdef {} def + +end + + /BuildChar { + 1 0 + 0 0 1 1 + setcachedevice + exch begin + Encoding exch get + CharProcs exch get + end + exec + } def +end +/PatternFont newfont definefont pop + +%%EndResource +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: label 1 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 71.5555 755] concat +newpath +0 0 M 0 18 L 210.08 18 L 210.08 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +69.5555 753 M 69.5555 775 L 283.636 775 L 283.636 753 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 71.5555 755] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Adaptation \(slm_ada) 183.96 S +183.96 4 M (pt\)) 24.12 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +71.5555 749 M +281.636 749 L +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 720] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +89.5555 666 M +71.5555 648 L +71.5555 630 L +287.556 630 L +287.556 666 L +closepath +89.5555 666 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 612] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 540] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 486] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 432] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +89.5555 378 M +71.5555 360 L +89.5555 342 L +269.556 342 L +287.556 360 L +269.556 378 L +closepath +89.5555 378 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 324] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +89.5555 270 M +71.5555 252 L +89.5555 234 L +269.556 234 L +287.556 252 L +269.556 270 L +closepath +89.5555 270 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 216] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 160.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.5555 106.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +341.778 160.667 M +323.778 142.667 L +341.778 124.667 L +521.778 124.667 L +539.778 142.667 L +521.778 160.667 L +closepath +341.778 160.667 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 323.778 106.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 74.1555 690] concat +newpath +0 0 M 0 24 L 210.8 24 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +72.1555 688 M 72.1555 716 L 286.956 716 L 286.956 688 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 74.1555 690] concat +8.2 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +8.2 14.5714 M (Initialize \(waterma) 136.8 S +145 14.5714 M (rk, grid) 57.6 S +1 2.57143 M 1 2.57143 M (change indicator, a) 136.8 S +137.8 2.57143 M (ux arrays\)) 72 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 92.1555 636] concat +newpath +0 0 M 0 24 L 174.8 24 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +90.1555 634 M 90.1555 662 L 268.956 662 L 268.956 634 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 92.1555 636] concat +4.6 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +4.6 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +26.2 14.5714 M ( all elements of th) 136.8 S +163 14.5714 M (e ) 14.4 S +33.4 2.57143 M 33.4 2.57143 M (finest level ) 93.6 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +127 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 95.7555 582] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +93.7555 580 M 93.7555 608 L 265.356 608 L 265.356 580 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 95.7555 582] concat +8.2 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +8.2 14.5714 M (Estimate local erro) 136.8 S +145 14.5714 M (r,) 14.4 S +1 2.57143 M 1 2.57143 M (save value in aux a) 136.8 S +137.8 2.57143 M (rray) 28.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 81.3555 510] concat +newpath +0 0 M 0 24 L 196.4 24 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +79.3555 508 M 79.3555 536 L 279.756 536 L 279.756 508 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 81.3555 510] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Estimate max-norm o) 136.8 S +137.8 14.5714 M (f error,) 57.6 S +8.2 2.57143 M 8.2 2.57143 M (calculate error cri) 136.8 S +145 2.57143 M (terion) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 77.7555 456] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +75.7555 454 M 75.7555 482 L 283.356 482 L 283.356 454 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 77.7555 456] concat +8.2 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +8.2 14.5714 M (Extract level infor) 136.8 S +145 14.5714 M (mation,) 50.4 S +1 2.57143 M 1 2.57143 M (define marks corres) 136.8 S +137.8 2.57143 M (pondingly) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 74.1555 402] concat +newpath +0 0 M 0 24 L 210.8 24 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +72.1555 400 M 72.1555 428 L 286.956 428 L 286.956 400 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 74.1555 402] concat +33.4 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +33.4 14.5714 M (Check watermarks fo) 136.8 S +170.2 14.5714 M (r ) 14.4 S +1 2.57143 M 1 2.57143 M (refinement, coarsen) 136.8 S +137.8 2.57143 M (ing, resp.) 72 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 106.556 354] concat +newpath +0 0 M 0 12 L 146 12 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +104.556 352 M 104.556 368 L 254.556 368 L 254.556 352 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 106.556 354] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Something to refine) 136.8 S +137.8 2.57143 M (?) 7.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 102.956 246] concat +newpath +0 0 M 0 12 L 153.2 12 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +100.956 244 M 100.956 260 L 258.156 260 L 258.156 244 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 102.956 246] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Something to coarse) 136.8 S +137.8 2.57143 M (n?) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 92.1555 300] concat +newpath +0 0 M 0 12 L 174.8 12 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +90.1555 298 M 90.1555 314 L 268.956 314 L 268.956 298 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 92.1555 300] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Set marks for refin) 136.8 S +137.8 2.57143 M (ement) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 92.1555 192] concat +newpath +0 0 M 0 12 L 174.8 12 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +90.1555 190 M 90.1555 206 L 268.956 206 L 268.956 190 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 92.1555 192] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Set marks for coars) 136.8 S +137.8 2.57143 M (ening) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 84.9556 136.664] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +82.9556 134.664 M 82.9556 150.664 L 276.156 150.664 L 276.156 134.664 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 84.9556 136.664] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Call) 28.8 S +/Courier-SHOWISO findfont 12 scalefont setfont +29.8 2.57143 M ( routine "grid_refi) 136.8 S +166.6 2.57143 M (ne") 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 84.9556 82.6641] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +82.9556 80.6641 M 82.9556 96.6641 L 276.156 96.6641 L 276.156 80.6641 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 84.9556 82.6641] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Call) 28.8 S +/Courier-SHOWISO findfont 12 scalefont setfont +29.8 2.57143 M ( routine "grid_coar) 136.8 S +166.6 2.57143 M (se") 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 358.778 136.667] concat +newpath +0 0 M 0 12 L 146 12 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +356.778 134.667 M 356.778 150.667 L 506.778 150.667 L 506.778 134.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 358.778 136.667] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Did the grid change) 136.8 S +137.8 2.57143 M (?) 7.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 340.778 76.6667] concat +newpath +0 0 M 0 24 L 182 24 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +338.778 74.6667 M 338.778 102.667 L 524.778 102.667 L 524.778 74.6667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 340.778 76.6667] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Set grid change ind) 136.8 S +137.8 14.5714 M (icator) 43.2 S +58.6 2.57143 M 58.6 2.57143 M (to "true") 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 186.778 328.539] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +184.778 326.539 M 184.778 342.539 L 212.378 342.539 L 212.378 326.539 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 186.778 328.539] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 287.111 366.766] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +285.111 364.766 M 285.111 380.766 L 305.511 380.766 L 305.511 364.766 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 287.111 366.766] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 684.444 M +180 665.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 630 M +180 611.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 504.444 M +180 485.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 450 M +180 431.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 396.667 M +180 377.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 342.222 M +180 323.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 288.889 M +180 270 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 234.444 M +180 215.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 125.556 M +180 106.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +431.111 178.889 M +431.111 160 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +431.111 125.556 M +431.111 106.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 71.1111 M +180 52.2222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 52.2222 M +305.556 52.2222 L +305.556 177.778 L +431.429 177.619 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 180 M +180 161.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +287.778 360 M +296.667 360 L +296.667 280 L +180 280 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +287.778 251.111 M +296.667 251.111 L +296.667 171.111 L +180 171.111 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 286 258] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +284 256 M 284 272 L 304.4 272 L 304.4 256 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 286 258] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 185.5 219.5] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +183.5 217.5 M 183.5 233.5 L 211.1 233.5 L 211.1 217.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 185.5 219.5] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 435 109.5] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +433 107.5 M 433 123.5 L 460.6 123.5 L 460.6 107.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 435 109.5] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 539.5 148] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +537.5 146 M 537.5 162 L 557.9 162 L 557.9 146 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 539.5 148] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +538.889 142.222 M +547.778 142.222 L +547.778 62.2222 L +431.111 62.2222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +431.111 71.1594 M +431.111 52.2705 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 575.556 M +180 567.778 L +62.2222 567.778 L +62.2222 647.778 L +71.1111 647.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +287.778 647.778 M +296.667 647.778 L +296.667 548.889 L +180 548.889 L +180 540 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 2 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 197.778 725.999] concat +newpath +0 0 M 0 18 L 210.8 18 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +195.778 723.999 M 195.778 745.999 L 410.578 745.999 L 410.578 723.999 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 197.778 725.999] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Refinement \(grid_re) 170.28 S +170.28 4 M (fine\)) 38.52 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +197.778 720 M +408.578 720 L +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 679.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 626] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 572.667 M +197.778 554.667 L +197.778 536.667 L +413.778 536.667 L +413.778 572.667 L +closepath +215.778 572.667 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 518.222 M +197.778 500.222 L +197.778 482.222 L +413.778 482.222 L +413.778 518.222 L +closepath +215.778 518.222 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 463.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 320.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 267.111] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 218.378 655.333] concat +newpath +0 0 M 0 12 L 174.8 12 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +216.378 653.333 M 216.378 669.333 L 395.178 669.333 L 395.178 653.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 218.378 655.333] concat +/Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +0 2.57143 M (Count elements to r) 136.8 S +136.8 2.57143 M (efine) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 203.978 596] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +201.978 594 M 201.978 622 L 409.578 622 L 409.578 594 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 203.978 596] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (If there is somethi) 136.8 S +137.8 14.5714 M (ng to do,) 64.8 S +8.2 2.57143 M 8.2 2.57143 M (set "nonconforming") 136.8 S +145 2.57143 M (=.TRUE.) 50.4 S +setmatrix +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 392.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 225.578 542.667] concat +newpath +0 0 M 0 24 L 160.4 24 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +223.578 540.667 M 223.578 568.667 L 387.978 568.667 L 387.978 540.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 225.578 542.667] concat +51.4 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +51.4 14.5714 M (Do while) 57.6 S +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +1 2.57143 M ("nonconforming"=.TR) 136.8 S +137.8 2.57143 M (UE.) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 203.978 488.222] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +201.978 486.222 M 201.978 514.222 L 409.578 514.222 L 409.578 486.222 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 203.978 488.222] concat +4.6 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +4.6 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +26.2 14.5714 M ( all elements marke) 136.8 S +163 14.5714 M (d for ) 43.2 S +55 2.57143 M 55 2.57143 M (refinement ) 79.2 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +134.2 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 200.378 439.777] concat +newpath +0 0 M 0 12 L 210.8 12 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +198.378 437.777 M 198.378 453.777 L 413.178 453.777 L 413.178 437.777 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 200.378 439.777] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Call) 28.8 S +/Courier-SHOWISO findfont 12 scalefont setfont +29.8 2.57143 M ( routine "refine_el) 136.8 S +166.6 2.57143 M (ement") 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 200.378 362.667] concat +newpath +0 0 M 0 24 L 210.8 24 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +198.378 360.667 M 198.378 388.667 L 413.178 388.667 L 413.178 360.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 200.378 362.667] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Check resulting tri) 136.8 S +137.8 14.5714 M (angulation) 72 S +22.6 2.57143 M 22.6 2.57143 M (result: "nonconform) 136.8 S +159.4 2.57143 M (ing") 28.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 239.978 296.445] concat +newpath +0 0 M 0 12 L 131.6 12 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +237.978 294.445 M 237.978 310.445 L 373.578 310.445 L 373.578 294.445 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 239.978 296.445] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Set unique indices) 129.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 207.578 243.111] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +205.578 241.111 M 205.578 257.111 L 405.978 257.111 L 405.978 241.111 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 207.578 243.111] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update info on node) 136.8 S +137.8 2.57143 M ( patches) 57.6 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 644.444 M +306.667 626.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 590 M +306.667 572.222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 535.555 M +306.667 517.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 481.111 M +306.667 463.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 284.444 M +306.667 266.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 427.778 M +306.667 418.889 L +188.889 418.889 L +188.889 500 L +197.778 500 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 500 M +423.333 500 L +423.333 401.111 L +306.667 401.111 L +306.667 391.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 356.667 M +306.667 347.778 L +180 347.778 L +180 554.444 L +197.778 554.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 554.444 M +432.222 554.444 L +432.222 328.889 L +306.667 328.889 L +306.667 320 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 230 M +306.667 212.222 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 3 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 218.589 688.889] concat +newpath +0 0 M 0 18 L 176.6 18 L 176.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +216.589 686.889 M 216.589 708.889 L 397.189 708.889 L 397.189 686.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 218.589 688.889] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Check Triangulation) 174.6 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +218.589 682.89 M +395.189 682.89 L +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 639.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 584.889 M +197.778 566.889 L +197.778 548.889 L +413.778 548.889 L +413.778 584.889 L +closepath +215.778 584.889 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 531.556 M +197.778 513.556 L +197.778 495.556 L +413.778 495.556 L +413.778 531.556 L +closepath +215.778 531.556 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 477.111 M +197.778 459.111 L +215.778 441.111 L +395.778 441.111 L +413.778 459.111 L +395.778 477.111 L +closepath +215.778 477.111 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 422.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 369.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 603.333 M +306.667 585.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 548.889 M +306.667 531.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 494.444 M +306.667 476.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 440 M +306.667 422.222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 385.556 M +306.667 367.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 333.333 M +306.667 324.444 L +188.889 324.444 L +188.889 513.333 L +197.778 513.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +197.778 458.889 M +188.889 458.889 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 513.333 M +423.333 513.333 L +423.333 315.556 L +180 315.556 L +180 566.667 L +197.778 566.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 566.667 M +432.222 566.667 L +432.222 306.667 L +306.667 306.667 L +306.667 296.667 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.178 609.333] concat +newpath +0 0 M 0 24 L 189.2 24 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.178 607.333 M 209.178 635.333 L 402.378 635.333 L 402.378 607.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.178 609.333] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Initialize "nonconf) 136.8 S +137.8 14.5714 M (orming") 50.4 S +62.2 2.57143 M 62.2 2.57143 M (\(.FALSE.\)) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 218.378 554.889] concat +newpath +0 0 M 0 24 L 174.8 24 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +216.378 552.889 M 216.378 580.889 L 395.178 580.889 L 395.178 552.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 218.378 554.889] concat +4.6 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +4.6 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +26.2 14.5714 M ( all elements of th) 136.8 S +163 14.5714 M (e ) 14.4 S +33.4 2.57143 M 33.4 2.57143 M (finest level ) 93.6 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +127 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 232.778 501.556] concat +newpath +0 0 M 0 24 L 146 24 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +230.778 499.556 M 230.778 527.556 L 380.778 527.556 L 380.778 499.556 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 232.778 501.556] concat +1 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +22.6 14.5714 M ( all edges of the) 122.4 S +37 2.57143 M 37 2.57143 M (element ) 57.6 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +94.6 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 229.178 453.112] concat +newpath +0 0 M 0 12 L 153.2 12 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +227.178 451.112 M 227.178 467.112 L 384.378 467.112 L 384.378 451.112 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 229.178 453.112] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Is this edge refine) 136.8 S +137.8 2.57143 M (d?) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 313.444 427.431] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +311.444 425.431 M 311.444 441.431 L 339.044 441.431 L 339.044 425.431 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 313.444 427.431] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 192.333 468.54] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +190.333 466.54 M 190.333 482.54 L 210.733 482.54 L 210.733 466.54 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 192.333 468.54] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.178 392.667] concat +newpath +0 0 M 0 24 L 189.2 24 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.178 390.667 M 209.178 418.667 L 402.378 418.667 L 402.378 390.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.178 392.667] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Mark corresponding ) 136.8 S +137.8 14.5714 M (element) 50.4 S +44.2 2.57143 M 44.2 2.57143 M (for refinement) 100.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.178 345.333] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.178 343.333 M 209.178 359.333 L 402.378 359.333 L 402.378 343.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.178 345.333] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Set "nonconforming") 136.8 S +137.8 2.57143 M (=.TRUE.) 50.4 S +setmatrix +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 4 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 193.718 740.001] concat +newpath +0 0 M 0 18 L 224.12 18 L 224.12 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +191.718 738.001 M 191.718 760.001 L 419.838 760.001 L 419.838 738.001 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 193.718 740.001] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Coarsening \(grid_co) 178.2 S +178.2 4 M (arse\)) 43.92 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +193.718 734.001 M +417.838 734.001 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +209.778 617.778 M +204.528 618.528 L +200.778 620.778 L +198.528 624.528 L +197.778 629.778 L +197.778 629.778 L +197.778 631.232 L +197.778 633.961 L +197.778 637.2 L +197.778 640.184 L +197.778 642.148 L +197.778 642.444 L +197.778 642.444 L +198.528 647.694 L +200.778 651.444 L +204.528 653.694 L +209.778 654.444 L +209.778 654.444 L +210.421 654.444 L +212.117 654.444 L +214.795 654.444 L +218.385 654.444 L +222.815 654.444 L +228.015 654.444 L +233.915 654.445 L +240.444 654.444 L +247.532 654.444 L +255.108 654.444 L +263.102 654.444 L +271.442 654.444 L +280.058 654.444 L +288.881 654.444 L +297.839 654.444 L +306.861 654.444 L +315.878 654.444 L +324.818 654.444 L +333.611 654.444 L +342.187 654.444 L +350.474 654.444 L +358.403 654.444 L +365.903 654.444 L +372.903 654.444 L +379.332 654.444 L +385.121 654.444 L +390.199 654.444 L +394.494 654.444 L +397.937 654.444 L +400.456 654.444 L +401.983 654.444 L +402.444 654.444 L +402.444 654.444 L +407.694 653.694 L +411.444 651.444 L +413.694 647.694 L +414.444 642.444 L +414.444 642.444 L +414.444 640.99 L +414.444 638.261 L +414.444 635.022 L +414.444 632.038 L +414.444 630.074 L +414.444 629.778 L +414.444 629.778 L +413.694 624.528 L +411.444 620.778 L +407.694 618.528 L +402.444 617.778 L +402.444 617.778 L +401.807 617.778 L +400.127 617.778 L +397.475 617.778 L +393.92 617.778 L +389.531 617.778 L +384.379 617.778 L +378.531 617.778 L +372.059 617.778 L +365.031 617.778 L +357.517 617.778 L +349.586 617.778 L +341.308 617.778 L +332.752 617.778 L +323.987 617.778 L +315.084 617.778 L +306.111 617.778 L +297.138 617.778 L +288.235 617.778 L +279.471 617.778 L +270.914 617.778 L +262.636 617.778 L +254.705 617.778 L +247.191 617.778 L +240.163 617.778 L +233.691 617.778 L +227.844 617.778 L +222.691 617.778 L +218.303 617.778 L +214.747 617.778 L +212.095 617.778 L +210.416 617.778 L +209.778 617.778 L +closepath +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 708.222 M +197.778 690.222 L +197.778 672.222 L +413.778 672.222 L +413.778 708.222 L +closepath +215.778 708.222 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 582.667 M +197.778 564.667 L +215.778 546.667 L +395.778 546.667 L +413.778 564.667 L +395.778 582.667 L +closepath +215.778 582.667 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 528.222 M +197.778 510.222 L +197.778 492.222 L +413.778 492.222 L +413.778 528.222 L +closepath +215.778 528.222 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 473.778 M +197.778 455.778 L +215.778 437.778 L +395.778 437.778 L +413.778 455.778 L +395.778 473.778 L +closepath +215.778 473.778 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215.778 420.444 M +197.778 402.444 L +197.778 384.444 L +413.778 384.444 L +413.778 420.444 L +closepath +215.778 420.444 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 366] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 293.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 222.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 114.889] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 -232.222 -452.889] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197.778 168.222] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 672.222 M +306.667 654.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 545.556 M +306.667 527.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 492.222 M +306.667 474.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 438.889 M +306.667 421.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 385.556 M +306.667 367.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 185.556 M +306.667 167.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 132.222 M +306.667 114.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 -127.778 M +180 -145.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 77.7778 M +306.667 60 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 617.778 M +306.667 608.889 L +188.889 608.889 L +188.889 690 L +196.667 690 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 690 M +423.333 690 L +423.333 591.111 L +306.667 591.111 L +306.667 582.222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 330 M +306.667 321.111 L +188.889 321.111 L +188.889 402.222 L +197.778 402.222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 402.222 M +423.333 402.222 L +423.333 303.333 L +306.667 303.333 L +306.667 294.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306.667 257.778 M +306.667 248.889 L +180 248.889 L +180 510 L +197.778 510 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 510 M +432.222 510 L +432.222 231.111 L +306.667 231.111 L +306.667 222.222 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414.444 565.556 M +441.111 565.556 L +441.111 68.8889 L +306.667 68.8889 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 218.378 678.222] concat +newpath +0 0 M 0 24 L 174.8 24 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +216.378 676.222 M 216.378 704.222 L 395.178 704.222 L 395.178 676.222 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 218.378 678.222] concat +4.6 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +4.6 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +26.2 14.5714 M ( all elements of th) 136.8 S +163 14.5714 M (e ) 14.4 S +33.4 2.57143 M 33.4 2.57143 M (finest level ) 93.6 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +127 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 207.911 624.111] concat +newpath +0 0 M 0 24 L 196.4 24 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +205.911 622.111 M 205.911 650.111 L 406.311 650.111 L 406.311 622.111 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 207.911 624.111] concat +/Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +0 14.5714 M (Find resolvable pat) 136.8 S +136.8 14.5714 M (ches and) 57.6 S +8.2 2.57143 M 8.2 2.57143 M (mark edges for coar) 136.8 S +145 2.57143 M (sening) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 232.778 552.667] concat +newpath +0 0 M 0 24 L 146 24 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +230.778 550.667 M 230.778 578.667 L 380.778 578.667 L 380.778 550.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 232.778 552.667] concat +/Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +0 14.5714 M (Are there resolvabl) 136.8 S +136.8 14.5714 M (e) 7.2 S +44.2 2.57143 M 44.2 2.57143 M (patches?) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 415.667 570.76] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +413.667 568.76 M 413.667 584.76 L 434.067 584.76 L 434.067 568.76 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 415.667 570.76] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 311.222 531.87] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +309.222 529.87 M 309.222 545.87 L 336.822 545.87 L 336.822 529.87 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 311.222 531.87] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 247.178 504.223] concat +newpath +0 0 M 0 12 L 117.2 12 L 117.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +245.178 502.223 M 245.178 518.223 L 366.378 518.223 L 366.378 502.223 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 247.178 504.223] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +22.6 2.57143 M ( all edges ) 79.2 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +101.8 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 239.978 443.777] concat +newpath +0 0 M 0 24 L 131.6 24 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +237.978 441.777 M 237.978 469.777 L 373.578 469.777 L 373.578 441.777 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 239.978 443.777] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is edge marked for) 129.6 S +26.2 2.57143 M 26.2 2.57143 M (coarsening?) 79.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 312.333 426.315] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +310.333 424.315 M 310.333 440.315 L 337.933 440.315 L 337.933 424.315 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 312.333 426.315] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 456.667 M +197.778 456.667 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 183.444 462.987] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +181.444 460.987 M 181.444 476.987 L 201.844 476.987 L 201.844 460.987 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 183.444 462.987] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 214.778 390.444] concat +newpath +0 0 M 0 24 L 182 24 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +212.778 388.444 M 212.778 416.444 L 398.778 416.444 L 398.778 388.444 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 214.778 390.444] concat +1 14.5714 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (For) 21.6 S +/Courier-SHOWISO findfont 12 scalefont setfont +22.6 14.5714 M ( all elements corre) 136.8 S +159.4 14.5714 M (sp.) 21.6 S +37 2.57143 M 37 2.57143 M (to this edge ) 93.6 S +/Courier-Bold-SHOWISO findfont 12 scalefont setfont +130.6 2.57143 M (do) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 200.378 342] concat +newpath +0 0 M 0 12 L 210.8 12 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +198.378 340 M 198.378 356 L 413.178 356 L 413.178 340 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 200.378 342] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Call) 28.8 S +/Courier-SHOWISO findfont 12 scalefont setfont +29.8 2.57143 M ( routine "coarse_el) 136.8 S +166.6 2.57143 M (ement") 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.178 269.778] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.178 267.778 M 209.178 283.778 L 402.378 283.778 L 402.378 267.778 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.178 269.778] concat +1 2.57143 M /Courier-Bold-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Call) 28.8 S +/Courier-SHOWISO findfont 12 scalefont setfont +29.8 2.57143 M ( routine "coarse_ed) 136.8 S +166.6 2.57143 M (ge") 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 243.578 192.667] concat +newpath +0 0 M 0 24 L 124.4 24 L 124.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +241.578 190.667 M 241.578 218.667 L 369.978 218.667 L 369.978 190.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 243.578 192.667] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Remove obsolecent) 122.4 S +19 2.57143 M 19 2.57143 M (grid objects) 86.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 239.978 144.222] concat +newpath +0 0 M 0 12 L 131.6 12 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +237.978 142.222 M 237.978 158.222 L 373.578 158.222 L 373.578 142.222 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 239.978 144.222] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Set unique indices) 129.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 207.578 90.8889] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +205.578 88.8889 M 205.578 104.889 L 405.978 104.889 L 405.978 88.8889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 207.578 90.8889] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update info on node) 136.8 S +137.8 2.57143 M ( patches) 57.6 S +setmatrix +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 5 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 67.2222 763.75] concat +newpath +0 0 M 0 18 L 224.12 18 L 224.12 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +65.2222 761.75 M 65.2222 783.75 L 293.342 783.75 L 293.342 761.75 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 67.2222 763.75] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Coarsening \(grid_co) 178.2 S +178.2 4 M (arse\)) 43.92 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +67.2222 757.75 M +291.342 757.75 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 69.2562 732.284] concat +newpath +0 0 M 0 18 L 220.052 18 L 220.052 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +67.2562 730.284 M 67.2562 752.284 L 291.308 752.284 L 291.308 730.284 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 69.2562 732.284] concat +1 4.23529 M /AvantGarde-Book-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +1 4.23529 M ("Find resolvable pa) 165.078 S +166.078 4.23529 M (tches") 52.974 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 725.306 M +56.1111 707.306 L +74.1111 689.306 L +254.111 689.306 L +272.111 707.306 L +254.111 725.306 L +closepath +74.1111 725.306 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 681.972 M +56.1111 663.972 L +74.1111 645.972 L +254.111 645.972 L +272.111 663.972 L +254.111 681.972 L +closepath +74.1111 681.972 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 56.1111 635.306] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 590.861 M +56.1111 572.861 L +74.1111 554.861 L +254.111 554.861 L +272.111 572.861 L +254.111 590.861 L +closepath +74.1111 590.861 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 56.1111 545.306] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 500.861 M +56.1111 482.861 L +74.1111 464.861 L +254.111 464.861 L +272.111 482.861 L +254.111 500.861 L +closepath +74.1111 500.861 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 20.5556 455.306] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 56.1111 410.861] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +363 410.861 M +345 392.861 L +363 374.861 L +543 374.861 L +561 392.861 L +543 410.861 L +closepath +363 410.861 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 365.306 M +56.1111 347.306 L +74.1111 329.306 L +254.111 329.306 L +272.111 347.306 L +254.111 365.306 L +closepath +74.1111 365.306 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 38.3333 320.861] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 56.1111 275.306] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 230.861 M +56.1111 212.861 L +74.1111 194.861 L +254.111 194.861 L +272.111 212.861 L +254.111 230.861 L +closepath +74.1111 230.861 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +74.1111 185.306 M +56.1111 167.306 L +74.1111 149.306 L +254.111 149.306 L +272.111 167.306 L +254.111 185.306 L +closepath +74.1111 185.306 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 56.1111 140.861] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 345 365.306] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +363 320.861 M +345 302.861 L +363 284.861 L +543 284.861 L +561 302.861 L +543 320.861 L +closepath +363 320.861 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +363 275.306 M +345 257.306 L +363 239.306 L +543 239.306 L +561 257.306 L +543 275.306 L +closepath +363 275.306 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 345 230.861] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 200.556 86.4167] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 689.306 M +165 681.451 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 645.551 M +165 635.972 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 599.727 M +165 590.838 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 554.593 M +165 545.704 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165.345 509.459 M +165.345 500.57 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 374.401 M +165 365.512 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 239.344 M +165 230.455 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 194.555 M +165 185.666 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 149.765 M +165 140.876 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +453.333 239.305 M +453.333 230.417 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 83.9111 695.306] concat +newpath +0 0 M 0 24 L 160.4 24 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +81.9111 693.306 M 81.9111 721.306 L 246.311 721.306 L 246.311 693.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 83.9111 695.306] concat +4.6 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +4.6 14.5714 M (Is the element mark) 136.8 S +141.4 14.5714 M (ed ) 21.6 S +26.2 2.57143 M 26.2 2.57143 M (for coarsening?) 108 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 170.667 678.953] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +168.667 676.953 M 168.667 692.953 L 196.267 692.953 L 196.267 676.953 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 170.667 678.953] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 272.889 715.625] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +270.889 713.625 M 270.889 729.625 L 291.289 729.625 L 291.289 713.625 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 272.889 715.625] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 83.9111 651.971] concat +newpath +0 0 M 0 24 L 160.4 24 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +81.9111 649.971 M 81.9111 677.971 L 246.311 677.971 L 246.311 649.971 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 83.9111 651.971] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is the element not ) 136.8 S +137.8 14.5714 M (too) 21.6 S +26.2 2.57143 M 26.2 2.57143 M (coarse already?) 108 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 171.778 635.625] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +169.778 633.625 M 169.778 649.625 L 197.378 649.625 L 197.378 633.625 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 171.778 635.625] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 272.889 672.289] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +270.889 670.289 M 270.889 686.289 L 291.289 686.289 L 291.289 670.289 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 272.889 672.289] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 83.9111 611.307] concat +newpath +0 0 M 0 12 L 160.4 12 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +81.9111 609.307 M 81.9111 625.307 L 246.311 625.307 L 246.311 609.307 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 83.9111 611.307] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find mother and sis) 136.8 S +137.8 2.57143 M (ter) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 91.1111 560.861] concat +newpath +0 0 M 0 24 L 146 24 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +89.1111 558.861 M 89.1111 586.861 L 239.111 586.861 L 239.111 558.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 91.1111 560.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is the sister marke) 136.8 S +137.8 14.5714 M (d) 7.2 S +19 2.57143 M 19 2.57143 M (for coarsening?) 108 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 171.778 545.625] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +169.778 543.625 M 169.778 559.625 L 197.378 559.625 L 197.378 543.625 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 171.778 545.625] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 272.889 577.844] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +270.889 575.844 M 270.889 591.844 L 291.289 591.844 L 291.289 575.844 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 272.889 577.844] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 105.511 521.306] concat +newpath +0 0 M 0 12 L 117.2 12 L 117.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +103.511 519.306 M 103.511 535.306 L 224.711 535.306 L 224.711 519.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 105.511 521.306] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find marked edge) 115.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 76.7111 476.862] concat +newpath +0 0 M 0 12 L 174.8 12 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +74.7111 474.862 M 74.7111 490.862 L 253.511 490.862 L 253.511 474.862 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 76.7111 476.862] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (What type of edge i) 136.8 S +137.8 2.57143 M (s it?) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 51.7778 454.513] concat +newpath +0 0 M 0 12 L 59.6 12 L 59.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +49.7778 452.513 M 49.7778 468.513 L 113.378 468.513 L 113.378 452.513 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 51.7778 454.513] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Boundary) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 249.556 454.514] concat +newpath +0 0 M 0 12 L 124.4 12 L 124.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +247.556 452.514 M 247.556 468.514 L 375.956 468.514 L 375.956 452.514 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 249.556 454.514] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Periodic boundary) 122.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 457.333 454.514] concat +newpath +0 0 M 0 12 L 38 12 L 38 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +455.333 452.514 M 455.333 468.514 L 497.333 468.514 L 497.333 452.514 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 457.333 454.514] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Inner) 36 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +56.1111 481.528 M +38.3333 481.528 L +38.3333 454.861 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +245 464.861 M +245 410.417 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +272.778 482.639 M +452.778 482.639 L +452.778 410.417 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 26.7556 425.305] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +24.7556 423.305 M 24.7556 451.305 L 232.356 451.305 L 232.356 423.305 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 26.7556 425.305] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Resolvable patch fo) 136.8 S +137.8 14.5714 M (und, mark) 64.8 S +1 2.57143 M 1 2.57143 M (and countedge for c) 136.8 S +137.8 2.57143 M (oarsening) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 44.5334 290.861] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +42.5334 288.861 M 42.5334 316.861 L 250.133 316.861 L 250.133 288.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 44.5334 290.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Resolvable patch fo) 136.8 S +137.8 14.5714 M (und, mark) 64.8 S +1 2.57143 M 1 2.57143 M (and countedge for c) 136.8 S +137.8 2.57143 M (oarsening) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 69.5111 386.861] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +67.5111 384.861 M 67.5111 400.861 L 260.711 400.861 L 260.711 384.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 69.5111 386.861] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find periodic partn) 136.8 S +137.8 2.57143 M (er edge) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 69.5111 335.306] concat +newpath +0 0 M 0 24 L 189.2 24 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +67.5111 333.306 M 67.5111 361.306 L 260.711 361.306 L 260.711 333.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 69.5111 335.306] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is periodic partner) 136.8 S +137.8 14.5714 M ( marked) 50.4 S +40.6 2.57143 M 40.6 2.57143 M (for coarsening?) 108 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 44 355.625] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +42 353.625 M 42 369.625 L 69.6 369.625 L 69.6 353.625 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 44 355.625] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 267.333 355.625] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +265.333 353.625 M 265.333 369.625 L 285.733 369.625 L 285.733 353.625 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 267.333 355.625] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +56.1111 347.083 M +47.2222 347.083 L +47.2222 320.417 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +272.778 347.083 M +272.778 274.861 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 87.5111 245.305] concat +newpath +0 0 M 0 24 L 153.2 24 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +85.5111 243.305 M 85.5111 271.305 L 242.711 271.305 L 242.711 243.305 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 87.5111 245.305] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Find neighbor and h) 136.8 S +137.8 14.5714 M (is) 14.4 S +4.6 2.57143 M 4.6 2.57143 M (children \("cousins") 136.8 S +141.4 2.57143 M (\)) 7.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 91.1111 200.861] concat +newpath +0 0 M 0 24 L 146 24 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +89.1111 198.861 M 89.1111 226.861 L 239.111 226.861 L 239.111 198.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 91.1111 200.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Are both cousins NO) 136.8 S +137.8 14.5714 M (T) 7.2 S +44.2 2.57143 M 44.2 2.57143 M (refined?) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 80.3111 155.306] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +78.3111 153.306 M 78.3111 181.306 L 249.911 181.306 L 249.911 153.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 80.3111 155.306] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is at least one of ) 136.8 S +137.8 14.5714 M (them) 28.8 S +4.60001 2.57143 M 4.60001 2.57143 M (marked for coarseni) 136.8 S +141.4 2.57143 M (ng?) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 62.3111 110.861] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +60.3111 108.861 M 60.3111 136.861 L 267.911 136.861 L 267.911 108.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 62.3111 110.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Resolvable patch fo) 136.8 S +137.8 14.5714 M (und, mark) 64.8 S +1 2.57143 M 1 2.57143 M (and countedge for c) 136.8 S +137.8 2.57143 M (oarsening) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 376.4 335.305] concat +newpath +0 0 M 0 24 L 153.2 24 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +374.4 333.305 M 374.4 361.305 L 531.6 361.305 L 531.6 333.305 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 376.4 335.305] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Find neighbor and h) 136.8 S +137.8 14.5714 M (is) 14.4 S +4.6 2.57143 M 4.6 2.57143 M (children \("cousins") 136.8 S +141.4 2.57143 M (\)) 7.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 380 290.861] concat +newpath +0 0 M 0 24 L 146 24 L 146 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +378 288.861 M 378 316.861 L 528 316.861 L 528 288.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 380 290.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Are both cousins NO) 136.8 S +137.8 14.5714 M (T) 7.2 S +44.2 2.57143 M 44.2 2.57143 M (refined?) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 369.2 245.306] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +367.2 243.306 M 367.2 271.306 L 538.8 271.306 L 538.8 243.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 369.2 245.306] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is at least one of ) 136.8 S +137.8 14.5714 M (them) 28.8 S +4.60001 2.57143 M 4.60001 2.57143 M (marked for coarseni) 136.8 S +141.4 2.57143 M (ng?) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 351.2 200.861] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +349.2 198.861 M 349.2 226.861 L 556.8 226.861 L 556.8 198.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 351.2 200.861] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Resolvable patch fo) 136.8 S +137.8 14.5714 M (und, mark) 64.8 S +1 2.57143 M 1 2.57143 M (and countedge for c) 136.8 S +137.8 2.57143 M (oarsening) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 376.4 386.862] concat +newpath +0 0 M 0 12 L 153.2 12 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +374.4 384.862 M 374.4 400.862 L 531.6 400.862 L 531.6 384.862 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 376.4 386.862] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Edge not refined ye) 136.8 S +137.8 2.57143 M (t?) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 373.75 M +452.778 364.861 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 328.961 M +452.778 320.072 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 284.171 M +452.778 275.283 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 242.756 56.4167] concat +newpath +0 0 M 0 24 L 131.6 24 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +240.756 54.4167 M 240.756 82.4167 L 376.356 82.4167 L 376.356 54.4167 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 242.756 56.4167] concat +26.2 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +26.2 14.5714 M (Reset mark,) 79.2 S +1 2.57143 M 1 2.57143 M (nothing to be done) 129.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 169.797 184.321] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +167.797 182.321 M 167.797 198.321 L 195.397 198.321 L 195.397 182.321 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 169.797 184.321] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 169.797 139.306] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +167.797 137.306 M 167.797 153.306 L 195.397 153.306 L 195.397 137.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 169.797 139.306] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 458.333 273.75] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +456.333 271.75 M 456.333 287.75 L 483.933 287.75 L 483.933 271.75 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 458.333 273.75] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 458.333 229.306] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +456.333 227.306 M 456.333 243.306 L 483.933 243.306 L 483.933 227.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 458.333 229.306] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 272.889 220.07] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +270.889 218.07 M 270.889 234.07 L 291.289 234.07 L 291.289 218.07 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 272.889 220.07] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 270.556 174.861] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +268.556 172.861 M 268.556 188.861 L 288.956 188.861 L 288.956 172.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 270.556 174.861] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 556.111 309.306] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +554.111 307.306 M 554.111 323.306 L 574.511 323.306 L 574.511 307.306 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 556.111 309.306] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 556.111 264.861] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +554.111 262.861 M 554.111 278.861 L 574.511 278.861 L 574.511 262.861 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 556.111 264.861] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +569.444 707.083 M +569.444 104.861 L +308.333 104.861 L +308.333 85.9722 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +272.778 707.083 M +569.444 707.083 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +272.778 662.639 M +569.444 662.639 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +272.778 572.639 M +569.444 572.639 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +273.889 212.639 M +290.556 212.639 L +290.556 167.083 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +273.889 167.083 M +570.556 167.083 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +560.556 257.083 M +569.444 257.083 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +560.556 302.639 M +569.444 302.639 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +307.222 41.5278 M +29.4444 41.5278 L +29.4444 419.306 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +47.2222 284.861 M +47.2222 41.5278 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +165 104.861 M +165 41.5278 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.333 49.3056 M +308.333 33.75 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 194.861 M +452.778 170.417 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 163.75 M +452.778 109.306 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +452.778 100.417 M +452.778 41.5278 L +308.333 41.5278 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 6 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +216.889 736 M +198.889 718 L +216.889 700 L +396.889 700 L +414.889 718 L +396.889 736 L +closepath +216.889 736 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +90.2222 690.444 M +72.2222 672.444 L +90.2222 654.444 L +270.222 654.444 L +288.222 672.444 L +270.222 690.444 L +closepath +90.2222 690.444 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +341.333 690.444 M +323.333 672.444 L +341.333 654.444 L +521.333 654.444 L +539.333 672.444 L +521.333 690.444 L +closepath +341.333 690.444 M +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +71.3333 646 M +53.3333 628 L +71.3333 610 L +251.333 610 L +269.333 628 L +251.333 646 L +closepath +71.3333 646 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 35.5556 600.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 53.3333 556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 53.3333 511.556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 53.3333 467.111] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 53.3333 422.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 53.3334 377.111] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.1111 330.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.1111 284.889] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.1111 239.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 71.1111 193.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 305.556 646] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 305.556 600.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 226.689 706] concat +newpath +0 0 M 0 24 L 160.4 24 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +224.689 704 M 224.689 732 L 389.089 732 L 389.089 704 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 226.689 706] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is the refinement e) 136.8 S +137.8 14.5714 M (dge) 21.6 S +22.6 2.57143 M 22.6 2.57143 M (a boundary edge?) 115.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 114.422 660.444] concat +newpath +0 0 M 0 24 L 131.6 24 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +112.422 658.444 M 112.422 686.444 L 248.022 686.444 L 248.022 658.444 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 114.422 660.444] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is this a periodic) 129.6 S +33.4 2.57143 M 33.4 2.57143 M (boundary?) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 81.1334 616] concat +newpath +0 0 M 0 24 L 160.4 24 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +79.1334 614 M 79.1334 642 L 243.533 642 L 243.533 614 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 81.1334 616] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Is my periodic part) 136.8 S +137.8 14.5714 M (ner) 21.6 S +51.4 2.57143 M 51.4 2.57143 M (refined?) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 48.9556 576.443] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +46.9556 574.443 M 46.9556 590.443 L 240.156 590.443 L 240.156 574.443 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 48.9556 576.443] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find periodic partn) 136.8 S +137.8 2.57143 M (er node) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 66.7334 532] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +64.7334 530 M 64.7334 546 L 257.933 546 L 257.933 530 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 66.7334 532] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new \(periodi) 136.8 S +137.8 2.57143 M (c\) node) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 84.7334 481.556] concat +newpath +0 0 M 0 24 L 153.2 24 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +82.7334 479.556 M 82.7334 507.556 L 239.933 507.556 L 239.933 479.556 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 84.7334 481.556] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Find periodic partn) 136.8 S +137.8 14.5714 M (er) 14.4 S +51.4 2.57143 M 51.4 2.57143 M (edge\(s\)) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 63.1333 443.111] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +61.1333 441.111 M 61.1333 457.111 L 261.533 457.111 L 261.533 441.111 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 63.1333 443.111] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new \(periodi) 136.8 S +137.8 2.57143 M (c\) edges) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 70.3333 398.667] concat +newpath +0 0 M 0 12 L 182 12 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +68.3333 396.667 M 68.3333 412.667 L 254.333 412.667 L 254.333 396.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 70.3333 398.667] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update mother infor) 136.8 S +137.8 2.57143 M (mation) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 63.1334 353.111] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +61.1334 351.111 M 61.1334 367.111 L 261.533 367.111 L 261.533 351.111 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 63.1334 353.111] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update links in lin) 136.8 S +137.8 2.57143 M (ked List) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 120.511 260.889] concat +newpath +0 0 M 0 12 L 117.2 12 L 117.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +118.511 258.889 M 118.511 274.889 L 239.711 274.889 L 239.711 258.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 120.511 260.889] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new edges) 115.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 88.1111 215.333] concat +newpath +0 0 M 0 12 L 182 12 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +86.1111 213.333 M 86.1111 229.333 L 272.111 229.333 L 272.111 213.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 88.1111 215.333] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update mother infor) 136.8 S +137.8 2.57143 M (mation) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 80.9111 169.778] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +78.9111 167.778 M 78.9111 183.778 L 279.311 183.778 L 279.311 167.778 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 80.9111 169.778] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update links in lin) 136.8 S +137.8 2.57143 M (ked List) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 124.111 306.445] concat +newpath +0 0 M 0 12 L 110 12 L 110 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +122.111 304.445 M 122.111 320.445 L 236.111 320.445 L 236.111 304.445 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 124.111 306.445] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new node) 108 S +setmatrix +grestore +gsave +matrix currentmatrix +[216 0 0 -36 323.333 556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 323.333 510.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 323.333 464.889] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 323.333 419.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 372.733 486.444] concat +newpath +0 0 M 0 12 L 117.2 12 L 117.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +370.733 484.444 M 370.733 500.444 L 491.933 500.444 L 491.933 484.444 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 372.733 486.444] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new edges) 115.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 340.333 440.889] concat +newpath +0 0 M 0 12 L 182 12 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +338.333 438.889 M 338.333 454.889 L 524.333 454.889 L 524.333 438.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 340.333 440.889] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update mother infor) 136.8 S +137.8 2.57143 M (mation) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 333.133 395.333] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +331.133 393.333 M 331.133 409.333 L 531.533 409.333 L 531.533 393.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 333.133 395.333] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update links in lin) 136.8 S +137.8 2.57143 M (ked List) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 376.333 532] concat +newpath +0 0 M 0 12 L 110 12 L 110 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +374.333 530 M 374.333 546 L 488.333 546 L 488.333 530 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 376.333 532] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new node) 108 S +setmatrix +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 339.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 294.889] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 250.444] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 206] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 161.556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 341.111 117.111] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 354.733 666.445] concat +newpath +0 0 M 0 12 L 153.2 12 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +352.733 664.445 M 352.733 680.445 L 509.933 680.445 L 509.933 664.445 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 354.733 666.445] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Is this edge refine) 136.8 S +137.8 2.57143 M (d?) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 333.356 622] concat +newpath +0 0 M 0 12 L 160.4 12 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +331.356 620 M 331.356 636 L 495.756 636 L 495.756 620 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 333.356 622] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find neighbor eleme) 136.8 S +137.8 2.57143 M (nts) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 347.756 576.445] concat +newpath +0 0 M 0 12 L 131.6 12 L 131.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +345.756 574.445 M 345.756 590.445 L 481.356 590.445 L 481.356 574.445 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 347.756 576.445] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Find existing node) 129.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 365.311 309.333] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +363.311 307.333 M 363.311 335.333 L 534.911 335.333 L 534.911 307.333 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 365.311 309.333] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Create new edge bet) 136.8 S +137.8 14.5714 M (ween) 28.8 S +55 2.57143 M 55 2.57143 M (children) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 386.911 270.889] concat +newpath +0 0 M 0 12 L 124.4 12 L 124.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +384.911 268.889 M 384.911 284.889 L 513.311 284.889 L 513.311 268.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 386.911 270.889] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update edge links) 122.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 347.311 226.444] concat +newpath +0 0 M 0 12 L 203.6 12 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +345.311 224.444 M 345.311 240.444 L 552.911 240.444 L 552.911 224.444 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 347.311 226.444] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Create new children) 136.8 S +137.8 2.57143 M ( elements) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 358.111 182] concat +newpath +0 0 M 0 12 L 182 12 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +356.111 180 M 356.111 196 L 542.111 196 L 542.111 180 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 358.111 182] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update mother infor) 136.8 S +137.8 2.57143 M (mation) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 350.911 137.556] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +348.911 135.556 M 348.911 151.556 L 549.311 151.556 L 549.311 135.556 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 350.911 137.556] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update links in lin) 136.8 S +137.8 2.57143 M (ked List) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 365.311 93.111] concat +newpath +0 0 M 0 12 L 167.6 12 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +363.311 91.111 M 363.311 107.111 L 534.911 107.111 L 534.911 91.111 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 365.311 93.111] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update edge informa) 136.8 S +137.8 2.57143 M (tion) 28.8 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +197.778 717.778 M +197.778 691.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +413.333 717.778 M +413.333 691.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +287.778 672.222 M +287.778 331.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +71.1111 672.222 M +71.1111 645.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +161.111 520 M +161.111 511.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +161.111 474.444 M +161.111 465.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +161.111 430.389 M +161.111 421.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +161.111 386.333 M +161.111 377.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 294.444 M +180 285.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 249 M +180 240.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 203.056 M +180 194.167 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +413.333 610 M +413.333 601.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +432.222 520 M +432.222 511.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +431.111 474.444 M +431.111 465.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +430 428.889 M +430 420 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 303.333 M +450 294.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 260 M +450 251.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 215.167 M +450 206.278 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 170.333 M +450 161.444 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 126 M +450 117.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +450 80.1666 M +450 71.2777 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +270 627.778 M +270 555.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +143.333 564.444 M +143.333 555.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +53.3333 340 M +53.3333 141.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +180 157.778 M +180 141.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +53.3333 141.111 M +305.556 141.111 L +305.556 348.889 L +450 348.889 L +450 340 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +305.556 564.444 M +305.556 348.889 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +431.111 383.333 M +431.111 348.889 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +540 672.222 M +540 555.556 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +323.333 672.222 M +323.333 645.556 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 170 705.43] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +168 703.43 M 168 719.43 L 195.6 719.43 L 195.6 703.43 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 170 705.43] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 428.5 706.43] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +426.5 704.43 M 426.5 720.43 L 446.9 720.43 L 446.9 704.43 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 428.5 706.43] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 311.5 679.93] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +309.5 677.93 M 309.5 693.93 L 337.1 693.93 L 337.1 677.93 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 311.5 679.93] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 535 679.5] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +533 677.5 M 533 693.5 L 553.4 693.5 L 553.4 677.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 535 679.5] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 280.5 680] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +278.5 678 M 278.5 694 L 298.9 694 L 298.9 678 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 280.5 680] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +54 627.167 M +54 600.5 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 54 679] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +52 677 M 52 693 L 79.6 693 L 79.6 677 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 54 679] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 35.5 634.5] concat +newpath +0 0 M 0 12 L 23.6 12 L 23.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +33.5 632.5 M 33.5 648.5 L 61.1 648.5 L 61.1 632.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 35.5 634.5] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Yes) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 263 634.5] concat +newpath +0 0 M 0 12 L 16.4 12 L 16.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +261 632.5 M 261 648.5 L 281.4 648.5 L 281.4 632.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 263 634.5] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (No) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 210 752.219] concat +newpath +0 0 M 0 18 L 191 18 L 191 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +208 750.219 M 208 772.219 L 403 772.219 L 403 750.219 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 210 752.219] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Refinement \(element) 182.16 S +182.16 4 M (\)) 6.84 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +210 746.222 M +401 746.222 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 7 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +matrix currentmatrix +[216 0 0 -36 200 701.556] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 200 657.111] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 200 612.667] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 200 568.222] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 200 523.778] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 202.6 671.556] concat +newpath +0 0 M 0 24 L 210.8 24 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +200.6 669.556 M 200.6 697.556 L 415.4 697.556 L 415.4 669.556 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 202.6 671.556] concat +44.2 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +44.2 14.5714 M (Save pointers for) 122.4 S +1 2.57143 M 1 2.57143 M (reconstruction of l) 136.8 S +137.8 2.57143 M (inked list) 72 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 209.8 633.112] concat +newpath +0 0 M 0 12 L 196.4 12 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +207.8 631.112 M 207.8 647.112 L 408.2 647.112 L 408.2 631.112 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 209.8 633.112] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Update left and rig) 136.8 S +137.8 2.57143 M (ht edges) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 231.4 588.667] concat +newpath +0 0 M 0 12 L 153.2 12 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +229.4 586.667 M 229.4 602.667 L 386.6 602.667 L 386.6 586.667 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 231.4 588.667] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Remove child elemen) 136.8 S +137.8 2.57143 M (ts) 14.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 231.4 538.221] concat +newpath +0 0 M 0 24 L 153.2 24 L 153.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +229.4 536.221 M 229.4 564.221 L 386.6 564.221 L 386.6 536.221 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 231.4 538.221] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Remove remeining ed) 136.8 S +137.8 14.5714 M (ge) 14.4 S +19 2.57143 M 19 2.57143 M (between children) 115.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 220.6 499.777] concat +newpath +0 0 M 0 12 L 174.8 12 L 174.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +218.6 497.777 M 218.6 513.777 L 397.4 513.777 L 397.4 497.777 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 220.6 499.777] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Reconstruct linked ) 136.8 S +137.8 2.57143 M (lists) 36 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.889 666.667 M +308.889 657.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.889 621.833 M +308.889 612.944 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.889 577 M +308.889 568.111 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.889 532.667 M +308.889 523.778 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +308.889 486.833 M +308.889 477.944 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.111 728.889] concat +newpath +0 0 M 0 18 L 193.16 18 L 193.16 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.111 726.889 M 209.111 748.889 L 406.271 748.889 L 406.271 726.889 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.111 728.889] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Coarsening \(element) 184.32 S +184.32 4 M (\)) 6.84 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +211.111 722.889 M +404.271 722.889 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%Page: label 8 +gsave +newpath clippath pathbbox +/URy exch def +/URx exch def +/LLy exch def +/LLx exch def +/Width URx LLx sub 0.005 sub def +/Height URy LLy sub 0.005 sub def +LLx LLy translate +Width 595 div Height 841 div gt + { /Y_size Height def + /X_size 595 841 div Y_size mul def + /Scale Height 841 div def } + { /X_size Width def + /Y_size 841 595 div X_size mul def + /Scale Width 595 div def } ifelse +Width X_size sub 2 div +Height Y_size sub 2 div translate +Scale Scale scale +/saveit save def +gsave +gsave +gsave +matrix currentmatrix +[1 0 0 1 166 793] concat +newpath +0 0 M 0 18 L 281 18 L 281 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +164 791 M 164 813 L 449 813 L 449 791 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 166 793] concat +/AvantGarde-Demi-SHOWISO findfont 18 scalefont setfont +0 0 0 setrgbcolor +0 4 M (Main routine \(slm_t) 163.8 S +163.8 4 M (imestepping\)) 115.2 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +2.000000 setlinewidth +newpath +166 787 M +447 787 L +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 769] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 221.2 739] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +219.2 737 M 219.2 765 L 390.8 765 L 390.8 737 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 221.2 739] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Initialization: tim) 136.8 S +137.8 14.5714 M (ing,) 28.8 S +22.6 2.57143 M 22.6 2.57143 M (diagnostics, etc.) 122.4 S +setmatrix +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 724] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 196 694] concat +newpath +0 0 M 0 24 L 218 24 L 218 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +194 692 M 194 720 L 416 720 L 416 692 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 196 694] concat +11.8 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +11.8 14.5714 M (Plot initial config) 136.8 S +148.6 14.5714 M (uration,) 57.6 S +1 2.57143 M 1 2.57143 M (print charact. numb) 136.8 S +137.8 2.57143 M (ers of grid) 79.2 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +215 679 M +197 661 L +197 643 L +413 643 L +413 679 L +closepath +215 679 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 634] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +216 589 M +198 571 L +198 553 L +414 553 L +414 589 L +closepath +216 589 M +stroke +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 544] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 499] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 454] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 409] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 364] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 319] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 274] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 198 229] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 175] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 130] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[216 0 0 -36 197 85] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 221.2 655] concat +newpath +0 0 M 0 12 L 167.6 12 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +219.2 653 M 219.2 669 L 390.8 669 L 390.8 653 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 221.2 655] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Loop over all times) 136.8 S +137.8 2.57143 M (teps) 28.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.4 514] concat +newpath +0 0 M 0 24 L 189.2 24 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.4 512 M 209.4 540 L 402.6 540 L 402.6 512 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.4 514] concat +22.6 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +22.6 14.5714 M (Allocate work array) 136.8 S +159.4 14.5714 M (s) 7.2 S +1 2.57143 M 1 2.57143 M (\(for numerical oper) 136.8 S +137.8 2.57143 M (ations\)) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 211.4 565] concat +newpath +0 0 M 0 12 L 189.2 12 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +209.4 563 M 209.4 579 L 402.6 579 L 402.6 563 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 211.4 565] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (While new grid has ) 136.8 S +137.8 2.57143 M (changed) 50.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 203.2 604] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +201.2 602 M 201.2 630 L 408.8 630 L 408.8 602 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 203.2 604] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Duplicate grid \(use) 136.8 S +137.8 14.5714 M ( old grid) 64.8 S +4.60001 2.57143 M 4.60001 2.57143 M (as init. guess for ) 136.8 S +141.4 2.57143 M (new one\)) 57.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 200.6 469] concat +newpath +0 0 M 0 24 L 210.8 24 L 210.8 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +198.6 467 M 198.6 495 L 413.4 495 L 413.4 467 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 200.6 469] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Extract coordinates) 136.8 S +137.8 14.5714 M ( from grid) 72 S +15.4 2.57143 M 15.4 2.57143 M (data structure into) 136.8 S +152.2 2.57143 M ( array) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 222.2 424] concat +newpath +0 0 M 0 24 L 167.6 24 L 167.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +220.2 422 M 220.2 450 L 391.8 450 L 391.8 422 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 222.2 424] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Calculate displacem) 136.8 S +137.8 14.5714 M (ents) 28.8 S +65.8 2.57143 M 65.8 2.57143 M (\(SLM\)) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 215 379] concat +newpath +0 0 M 0 24 L 182 24 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +213 377 M 213 405 L 399 405 L 399 377 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 215 379] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Calculate upstream ) 136.8 S +137.8 14.5714 M (values) 43.2 S +73 2.57143 M 73 2.57143 M (\(SLM\)) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 215 334] concat +newpath +0 0 M 0 24 L 182 24 L 182 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +213 332 M 213 360 L 399 360 L 399 332 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 215 334] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Calculate new grid ) 136.8 S +137.8 14.5714 M (values) 43.2 S +73 2.57143 M 73 2.57143 M (\(SLM\)) 36 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 204.2 289] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +202.2 287 M 202.2 315 L 409.8 315 L 409.8 287 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 204.2 289] concat +11.8 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +11.8 14.5714 M (Distribute values i) 136.8 S +148.6 14.5714 M (n work) 43.2 S +1 2.57143 M 1 2.57143 M (array to grid data ) 136.8 S +137.8 2.57143 M (structure) 64.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 225.8 250] concat +newpath +0 0 M 0 12 L 160.4 12 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +223.8 248 M 223.8 264 L 388.2 264 L 388.2 248 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 225.8 250] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Deallocate work arr) 136.8 S +137.8 2.57143 M (ays) 21.6 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 207.8 199] concat +newpath +0 0 M 0 24 L 196.4 24 L 196.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +205.8 197 M 205.8 225 L 406.2 225 L 406.2 197 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 207.8 199] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Adapt the grid acco) 136.8 S +137.8 14.5714 M (rding to) 57.6 S +29.8 2.57143 M 29.8 2.57143 M (an error estimation) 136.8 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 203.2 145] concat +newpath +0 0 M 0 24 L 203.6 24 L 203.6 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +201.2 143 M 201.2 171 L 408.8 171 L 408.8 143 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 203.2 145] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Calculate diagnosti) 136.8 S +137.8 14.5714 M (cs, plot,) 64.8 S +11.8 2.57143 M 11.8 2.57143 M (write saveset, prin) 136.8 S +148.6 2.57143 M (t info) 43.2 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 210.4 100] concat +newpath +0 0 M 0 24 L 189.2 24 L 189.2 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +208.4 98 M 208.4 126 L 401.6 126 L 401.6 98 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 210.4 100] concat +1 14.5714 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 14.5714 M (Remove obsolete gri) 136.8 S +137.8 14.5714 M (d items) 50.4 S +51.4 2.57143 M 51.4 2.57143 M (\(clear grid\)) 86.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 224.8 61] concat +newpath +0 0 M 0 12 L 160.4 12 L 160.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +222.8 59 M 222.8 75 L 387.2 75 L 387.2 59 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 224.8 61] concat +1 2.57143 M /Courier-SHOWISO findfont 12 scalefont setfont +0 0 0 setrgbcolor +1 2.57143 M (Toggle timestep han) 136.8 S +137.8 2.57143 M (dle) 21.6 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 733.333 M +306 724.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 688 M +306 679.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 642.667 M +306 634 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 597.333 M +306 588.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 552 M +306 543.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 506.666 M +306 498 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 461.333 M +306 452.666 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 417.333 M +306 408.666 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 373.333 M +306 364.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +305.333 328 M +305.333 319.334 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 282.667 M +306 274 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 238 M +306 229.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 139.333 M +306 130.667 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 94 M +306 85.3333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 192.667 M +306 187.333 L +188.667 187.333 L +188.667 571.333 L +198 571.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414 571.333 M +422.667 571.333 L +422.667 182 L +306 182 L +306 175.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +306 49.3333 M +306 42.6667 L +180 42.6667 L +180 661.333 L +198 661.333 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +414 661.333 M +432 661.333 L +432 37.3333 L +306 37.3333 L +306 31.3333 L +stroke +grestore +grestore +showpage +saveit restore +grestore +%%EOF diff --git a/flash2d/doc/InputDok.ps b/flash2d/doc/InputDok.ps new file mode 100644 index 0000000000000000000000000000000000000000..902f77227993db5f5092468359df24f0b57f4e22 --- /dev/null +++ b/flash2d/doc/InputDok.ps @@ -0,0 +1,1359 @@ +%!PS-Adobe-2.0 +%%Creator: dvipsk 5.58f Copyright 1986, 1994 Radical Eye Software +%%Title: InputDok.dvi +%%Pages: 6 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentPaperSizes: A4 +%%EndComments +%DVIPSCommandLine: dvips InputDok +%DVIPSParameters: dpi=600, compressed, comments removed +%DVIPSSource: TeX output 1998.03.20:1528 +%%BeginProcSet: texc.pro +/TeXDict 250 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N +/cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id +gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp +add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add +/gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ +dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 +adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 +idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string +putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval +adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} +{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ +adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 +chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] +}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict +/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 0 1 255{IE S 1 string dup 0 3 index put cvn put}for +65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N /RMat[1 0 0 -1 0 +0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley X /rulex X V}B /V +{}B /RV statusdict begin /product where{pop product dup length 7 ge{0 7 +getinterval dup(Display)eq exch 0 4 getinterval(NeXT)eq or}{pop false} +ifelse}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end +%%EndProcSet +TeXDict begin 39158280 55380996 1000 600 600 (InputDok.dvi) +@start /Fa 1 3 df<0060150600F8150F6C151F007E153F6C157E6C6C14FC6C6CEB01F8 +6C6CEB03F06C6CEB07E06C6CEB0FC06C6CEB1F80017EEB3F006D137E6D6C5A90380FC1F8 +903807E3F0903803F7E06DB45A6D5B6EC7FCA24A7E497F903803F7E0903807E3F090380F +C1F890381F80FC90383F007E017E7F49EB1F804848EB0FC04848EB07E04848EB03F04848 +EB01F84848EB00FC48C8127E007E153F48151F48150F00601506282874A841>2 +D E /Fb 13 119 df<1418A214381430A21438EC1BFCEC1FFFEC3C0391B5FC903801E3FC +903803C00049C7FC130E5B133C5B5B485AA2485A485AA248C8FCA2121EA25AA3127C1278 +A312F8A25AA37EA47E7E127EEA7F807FEA3FF86CB4FC6C13E06C13F8000113FE6C6C7E01 +0F138013019038003FC0141F140F1407A21580A29038200F001330EB3C1EEB0FF8EB03E0 +20447DB322>16 D<3903E001FC390FF807FF3A1C7C1E0FC0001890387807E039383EE003 +38303FC0D97F8013F0127000601300137E00E01407D8C0FE14E0EA40FC1200150F120149 +14C0A2151F1203491480A2153F1207491400A25D120F49137EA215FE121F495B0007C7FC +C71201A25DA21403A25DA21407A25DA2140FA25DEC038024327EA026>I<EC1F80EC7FC0 +903801F0F0EB03E0903807C078EB0F8090381F003C133EA249133E5BA2485A1203A2485A +A249137E120FA2485AA215FE003F14FC90C7FC90B5FCA25A15F8387E0001140300FE14F0 +5AA2EC07E0A215C048130FA2EC1F80A21500143EA25C00785BA2495A6C485A495A6C485A +49C7FCEA07FCEA03F01F367DB424>I<17E001C0EC01F00001ED03F8485A90C8FC481501 +00061500000E1678120C001C163812180038010314300030497EA217700070010F146000 +6091C7FC17E0A2021EEB01C012E0EE0380021C13076C013C1400027E5B6C01FE133E2678 +01FF137ED87E07EB81FC3A7FFFEFFFF802CF5B6C018F5B261FFE075B6C486C90C7FC3903 +F000FC2D2280A030>33 D<123C127EB4FCA21380A2127F123D1201A412031300A25A1206 +120E120C121C5A5A126009177A8715>59 D<171C177EEE01FEEE07FCEE1FF0EE7FC09238 +01FF00ED07FCED1FF0ED7FC04A48C7FCEC07FCEC1FF0EC7FC04948C8FCEB07FCEB1FF0EB +7FC04848C9FCEA07FCEA1FF0EA7FC048CAFCA2EA7FC0EA1FF0EA07FCEA01FF38007FC0EB +1FF0EB07FCEB01FF9038007FC0EC1FF0EC07FCEC01FF9138007FC0ED1FF0ED07FCED01FF +9238007FC0EE1FF0EE07FCEE01FEEE007E171C2F2E7AA93C>I<010FB5D8C03FB5FCA390 +26003FE0C713804B1500A24B5CA2027F14016092C7FCA24A1403605CA201011507605CA2 +0103150F605C91B7FC5B6002F0C7121FA2010F153F605CA2011F157F95C7FC5CA2013F5D +5F5CA2017F14015F91C7FCA24914035F5B00011507B5D8FC03B512F0A340337DB240>72 +D<147F903803FFC090380FC0F090383F0038137C4913F83801F0013803E0031207EA0FC0 +90388001F0001F90C7FC123F90C8FCA25A127EA45AA3127C150C151C15386C147015E06C +EB03C0390F800F003807C07E3801FFF038007F801E227EA021>99 +D<151C157E15FEA315FC15781500AA143FECFFC0903801C3E0EB038390380701F0130EEB +0C03131C1338133014071370012013E01300140FA215C0A2141FA21580A2143FA21500A2 +5CA2147EA214FEA25CA21301A25CA21303001C5B127F495AA238FE0FC0495AD8783FC7FC +EA707CEA3FF0EA0FC01F4281B11F>106 D<EB07E0EA03FFA25CEA001FA35CA3133F91C8 +FCA35B137EA313FE49131FED7FC0EC01E0000190380383E09038F8070F140E141C000301 +3813C0EBF0709138E00700D9F1C0C7FC3807F78001EEC8FC13FC7F380FFFE0EBC7F8EBC1 +FEEBC07E001F7F1380ED8080ED81C0003FEC01801300A21503481500007EEB3E071506EC +1F0E00FE5C48EB07F80038EB03E023357DB328>I<D801E013FE3A07F803FF803A0E3E0F +07E0001C90383C03F039181F7001003813E026303FC07F12700060138014001503D8E07F +5CEA407E1200150701FE5C5B150F5E120149131FEE8080EE81C00003023F138049140116 +03037F13000007147E495CED3E0E5E000FEC1E3849EB0FF0D80380EB03C02A227EA02E> +110 D<13F8D803FEEB01C0D8070FEB03E0000EEB8007121C001813C00038140FEA301F00 +70018013C01260013F131F00E0130000401580C65A017E133F13FE491400A25D12014913 +7E1602EDFE0716064913FCA2160E0201130C9039F803F81C1618000090380F7C38D97C1C +137090393FF81FE0903907E0078028227EA02C>117 D<01F0130ED803FC131FD8071EEB +3F80EA0E1F121C0038EB801F0030140F013F130700701300006014035BD8E07E14001240 +EA00FE495B000114065BA2150E0003140C5B151C15181538491330157015606D13E04A5A +0001495A6D48C7FC3800FC1EEB3FF8EB07E021227EA025>I E /Fc +2 50 df<0060153000F815F86C1401007EEC03F06CEC07E06C6CEB0FC06C6CEB1F806C6C +EB3F006C6C137E6C6C5B6C6C485A90387E03F06D485A90381F8FC090380FDF806DB4C7FC +6D5A6D5AA2497E497E90380FDF8090381F8FC090383F07E090387E03F0496C7E48486C7E +4848137E48487F4848EB1F804848EB0FC048C7EA07E0007EEC03F048EC01F84814000060 +1530252475A43C>2 D<D91FE0ED3F80D97FFC913801FFE048B5020713F8486E90381F80 +3C2707C03FE090383E000F48C66C6C01F87F001E902707F801F0EB0380486D6C4848EB01 +C00038D901FE491300486D6C484814E0DB7F8FC812600060EC3FDE00E01970DB1FFC1530 +486E5A15076F7EA26F7E824B6D14706C913807BFC00060196092260F1FE014E000709138 +1E0FF000304A6C6CEB01C0003891267C03FC13036C4A6C6CEB07806C903C01F000FF800F +00000FD907C090387FC03E2703C01F8090381FFFFC2601FFFEC76C5B26007FF8020313E0 +D91FC09138007F8044227CA04D>49 D E /Fd 12 121 df<140C141C143C1438A2147814 +7014F014E0130114C0A21303148013071400A25B130E131E131CA2133C13381378137013 +F05BA212015B12035BA2120790C7FC5A120EA2121E121C123C123812781270A212F05AA2 +16317CA420>61 D<131FEBFF8C3801E0DE3803807E3807007C48133C121E123E003C5B12 +7CA3485BA215401560903801E0C012781303393807E180391C1CF300380FF87F3807E03C +1B177E9522>97 D<EB0FE0EB7FF83801F03C3803C01C3807803C380F007C121E003E1338 +14005AA35AA400781304140C00381338003C1370381F03E0380FFF803801FC0016177E95 +1C>99 D<EB1F80EBFFE03803E07038078030EA1F00123E123C007C1360387807C0B51280 +EBF80000F8C7FC5AA41408141800781370003813E0381E07C0380FFF00EA03F815177D95 +1D>101 D<140FEC3FC0EC71E014E3A2010113C0ECE180ECE000495AA5495AA2EBFFFEA2 +EB0780A249C7FCA5131EA65BA55BA31370A2EA38F0EA78E012F8EAF9C0EA7180007FC8FC +121E1B2F7CA31E>I<1418143C147CA214381400A7EB0780EB1FE01338EB60F013C0A2EA +0180A2380001E0A4EB03C0A4EB0780A4EB0F00A4131EA21238EA783CEAF8381378EA70F0 +EA7FC0001FC7FC162D81A119>106 D<EA01F0EA1FE0A21201A2EA03C0A4EA0780A4EA0F +00A4121EA45AA45AA213401360EAF0C0A3EAF1801271EA3F00121E0C247DA214>108 +D<000F017E13FC3A1F81FF83FF3B31C383C707803A61EE03CC039026EC01F813C0D8C1F8 +13F013F001E013E00003903903C0078013C0A2EE0F003907800780A2EE1E041706270F00 +0F00130C163C1718A2001E011EEB1C70EE1FE0000C010CEB07802F177D9536>I<380F01 +F0381FC7F83831CE1CEA61F8EBF03C00C1137C13E014383803C000A4485AA448C7FCA412 +1EA2120C16177D951D>114 D<EB3F80EBFFE03801E0F038038030EB00704813F0A2EB80 +40EBC00013FE3803FF806C13C038003FE0EB03F0EA3000127800F813E0A24813C0EA6001 +38780F80383FFE00EA07F814177D951D>I<133013785BA4485AA4485AB51280A23803C0 +00485AA448C7FCA4121EA25B1480383C03001306A25BEA1C38EA0FF0EA07C011217D9F18 +>I<3801F01E3907FC7F80390E1CE1C038180F8100301383007013071260EC0380D8001E +C7FCA45BA21580003014C0397878018012F8EC030038F0FC0638E19C1C387F0FF8381E03 +E01A177D9523>120 D E /Fe 5 51 df<130C1338137013E0EA01C0EA038013005A120E +A25AA25AA312781270A312F0AB1270A312781238A37EA27EA27E7E1380EA01C0EA00E013 +701338130C0E317AA418>40 D<12C012707E7E7E7E7E1380EA01C0A2EA00E0A21370A313 +781338A3133CAB1338A313781370A313E0A2EA01C0A2EA038013005A120E5A5A5A12C00E +317CA418>I<1438B2B712FEA3C70038C7FCB227277C9F2F>43 D<13E01201120712FF12 +F91201B3A7487EB512C0A212217AA01E>49 D<EA01FC3807FF80381C0FC0383003E03860 +01F0EB00F812F86C13FCA2147C1278003013FCC7FC14F8A2EB01F0EB03E014C0EB0780EB +0F00131E13385B5B3801C00CEA0380380600185A5A383FFFF85AB512F0A216217CA01E> +I E /Ff 1 1 df<B712C0A322037A8D30>0 D E /Fg 26 121 df<120FEA3FC0EA7FE0EA +FFF0A213F8A4127F123FEA0F3812001378A21370A213F013E01201EA03C0A2EA0780EA0F +00121E5A12180D1B7AB319>39 D<B512FCA816087F931D>45 D<120FEA3FC0EA7FE0EAFF +F0A6EA7FE0EA3FC0EA0F000C0C7A8B19>I<EB03FE90383FFFE090B512F848EB07FC3903 +FC01FE48486C7E4848EB7F8049133F001F15C0A2003F15E049131F007F15F0A500FF15F8 +B1007F15F0A4003F15E06D133FA2001F15C0A26C6CEB7F806C6CEBFF006C6C485A3901FF +07FC6CEBFFF8013F13E0D903FEC7FC25327DB02C>48 D<147814F81303131FEA03FFB5FC +A3EAFC1F1200B3B2007FB512FEA41F317AB02C>I<EB1FFC90B57E000314E0000F14F839 +1FE03FFC393F800FFF48487E6D6C1380D8FFC014C06D7E16E080A36C5A6C5A6CC7FCC8FC +16C05C16805C16004A5A4A5A5D4A5AEC3FC04A5A02FEC7FC495A495A903907E001E0EB0F +C0EB1F8090383E00034914C05B4848130748B6FC5A5A5A5A5AB71280A423317CB02C>I< +EB7FF80003B51280000F14E0391FC03FF0393E000FF8007FEB07FCD8FF8013FE13C0A539 +7F800FFCEA3F00C7EA1FF8EC3FF0EC7FC0ECFF80903801FE005C495A5C495A5CA2495AA2 +91C7FCA790C8FCA6EB1F80497E497E497EA66D5A6D5A6D5A1F347BB32A>63 +D<B712FCEEFFC017F817FEC69039E0003FFF040313C004007F717EEF1FF8717E84170784 +8319808319C0A419E0AB19C0A419805FA219004D5A170F604D5A4D5AEFFFE004035B041F +5BB848C7FC17F817C004FCC8FC3B337DB244>68 D<EAFFFEA5EAF800B3B3B3ABEAFFFEA5 +0F4B78B719>91 D<EAFFFEA5EA003EB3B3B3ABEAFFFEA50F4B7FB719>93 +D<EB7FFE0003B512E04814F8390FF00FFC391FF803FF806E138016C0157F6C5A6C5AEA01 +80C8FCEC7FFF010FB5FC90B6FC0003EBF07F000F1300EA1FF8485A485A485A5BA315FF7F +007F5B6D4813E03A3FF80FBFFF000FB5121F0003EBFC0F39007FE00728217EA02B>97 +D<ED01FC15FFA4150F1507ADEB07FE90383FFFC790B512F70003EB01FF3907FC003F4848 +131F4848130F48481307A2127F5BA212FFA9127FA27F123F150F6C6C131F6C6C133F6C6C +497E2603FE03B512E0C6B512E7013F1387903807FC072B347DB331>100 +D<903803FF80013F13F090B512FC48EB03FE3907FC007F4848EB3F804848EB1FC05B003F +EC0FE0127F5B16F012FF150790B6FCA301C0C8FCA4127F7F123F16F06C7E000F14016C6C +EB03E0D803FEEB0FC03A01FF807F806C6CB51200011F13FC010313E024217EA029>I<EC +3FE0903803FFF8010F13FC90383FF1FE90387FC3FFEBFF83481303A2EA03FEEC01FEA2EC +00781500A7B512FEA4D803FEC7FCB3A7387FFFF8A420347EB31B>I<EA03F0487E487E48 +7EA66C5A6C5A6C5AC8FCA8EA01FC12FFA4120F1207B3A5B512C0A412357DB418>105 +D<EA01FC12FFA4120F1207B3B3A6B512E0A413347DB318>108 D<2703F803FEEB03FE00 +FF903B1FFFC01FFFC0027FD9E07F7F913BF81FF0F81FF0903CF9E00FF9E00FF8260FFBC0 +EBFBC06CB4486CB4486C7E02001400495CA3495CB2B500E0B500E0B512E0A443217CA04A +>I<3901F803FF00FF010F13C0023F13F09138FC0FF89039F9E007FC380FFBC06CB4486C +7E1400A25BA25BB2B539E07FFFF0A42C217DA031>I<903803FF80011F13F090B512FE48 +EB01FF3A07FC007FC0D80FF0EB1FE0001F15F049130F003F15F8491307007F15FCA300FF +15FEA8007F15FCA26D130F003F15F8001F15F06D131F6C6CEB3FE06C6CEB7FC03A01FF01 +FF006CEBFFFE013F13F80103138027217EA02C>I<3901FC07FC00FF90387FFF8001FDB5 +12E09039FFF01FF89138C007FC000790380003FE4980496D1380A26F13C0A3EE7FE0A9EE +FFC0A34B1380A26D4913006D495A9138C00FFC9138F03FF801FDB512E0D9FC7F1380DA0F +F8C7FC91C9FCABB512E0A42B307EA031>I<D903FC133C90393FFF807C90B5EAE0FC0003 +EB81F83907FE007D4848133F4848131F4848130FA248481307A3485AA96C7EA36C7E150F +6C6C131F000F143F6C6C13FF3903FF03F7C6EBFFE7013F1387903807FC0790C7FCAB92B5 +12E0A42B307DA02F>I<3901F81F8000FFEB7FF0ECFFF89038F9E3FC9038FBC7FE380FFF +876C1307A213FEEC03FCEC01F8EC0060491300B1B512F0A41F217EA024>I<9038FFE1C0 +000713FF5A383F803F387E000F14075A14037EA26C6CC7FC13FCEBFFE06C13FC806CEBFF +80000F14C06C14E0C6FC010F13F0EB007F140F00F0130714037EA26C14E06C13076CEB0F +C09038C01F8090B5120000F913FC38E03FE01C217DA023>I<133CA5137CA313FCA21201 +A212031207001FB51280B6FCA3D807FCC7FCB0EC03C0A79038FE078012033901FF0F006C +13FEEB3FFCEB0FF01A2F7EAE22>I<D801FC14FE00FF147FA4000F140700071403B21507 +A2150F151F6C6C497E6C6C01FB13F06CEBFFF3013F13C3903807FE032C217DA031>I<B5 +39C03FFF80A400039039000FC0006C01805B6C4AC7FC90387FC03E6D6C5A6E5A90381FF9 +F0EB0FFF6D5B6D5B6D5B7F816E7E4A7E497FEB03EF903807C7FC90380FC3FE90381F83FF +D93F017FD97E007F496D7E496D7E4848131FD8FFFE90387FFFC0A42A217EA02F>120 +D E /Fh 74 123 df<011FB512F0A39026001FF0C7FC6E5AA7EC7FF80107B57E90393FCF +EFF09039FE0FE1FCD803F8EBE07FD807E0EC1F80D80FC0EC0FC0001F16E0D83F80EC07F0 +007F16F8010014034816FCA76C16F801801407003F16F0D81FC0EC0FE0000F16C0D807E0 +EC1F80D803F8EC7F00D800FEEBE1FC90393FCFEFF00107B512809026007FF8C7FCEC0FE0 +A74A7E011FB512F0A32E337CB237>8 D<91393FE00FE0903A01FFF83FF8903A07E01EF8 +3C903A1F800FF07E903A3F001FE0FE017E133F4914C0485A1738484890381F8000ACB812 +C0A33B03F0001F8000B3A7486C497EB50083B5FCA32F357FB42D>11 +D<EC1FE0ECFFFC903803F01E90390FC00780EB1F8090393F000FC0017E131F5BA2485AED +0F8092C7FCA9ED0FC0B7FCA33901F8001F150FB3A6486CEB1FE0267FFFC1B5FCA328357F +B42B>I<123C127EB4FCA21380A2127F123D1201A412031300A25A1206120E120C121C5A +5A126009177AB315>39 D<14C01301EB0380EB0F00130E5B133C5B5BA2485A485AA21207 +5B120F90C7FC5AA2121E123EA3123C127CA55AB0127CA5123C123EA3121E121FA27E7F12 +077F1203A26C7E6C7EA213787F131C7F130FEB0380EB01C01300124A79B71E>I<12C07E +1270123C121C7E120F6C7E6C7EA26C7E6C7EA27F1378137C133C133EA2131E131FA37F14 +80A5EB07C0B0EB0F80A514005BA3131E133EA2133C137C137813F85BA2485A485AA2485A +48C7FC120E5A123C12705A5A124A7CB71E>I<156015F0B3A4007FB812C0B912E0A26C17 +C0C800F0C8FCB3A4156033327CAB3C>43 D<123C127EB4FCA21380A2127F123D1201A412 +031300A25A1206120E120C121C5A5A126009177A8715>I<B512F0A514057F921A>I<123C +127E12FFA4127E123C08087A8715>I<1530157815F8A215F01401A215E01403A215C014 +07A21580140FA215005CA2143EA2143C147CA2147814F8A25C1301A25C1303A25C1307A2 +495AA291C7FC5BA2131E133EA2133C137CA2137813F8A25B1201A25B1203A2485AA25B12 +0FA290C8FC5AA2121E123EA2123C127CA2127812F8A25A12601D4B7CB726>I<EB0FE0EB +7FFCEBF83E3903E00F803907C007C0EB8003000F14E0391F0001F0A24814F8A2003E1300 +007E14FCA500FE14FEB2007E14FCA56CEB01F8A36C14F0A2390F8003E03907C007C0A239 +03E00F803900F83E00EB7FFCEB0FE01F347DB126>I<13075B5B137FEA07FFB5FC13BFEA +F83F1200B3B3A2497E007FB51280A319327AB126>I<EB3FC0EBFFF0000313FC380F80FF +391E007F80001CEB3FC048EB1FE048130F15F00060130712FC6C14F87E1403A3007E1307 +123CC7FC15F0A2140F15E0EC1FC0A2EC3F801500147E5C495A5C495A495A495A49C7FC13 +3E133C4913185B485A48481330485A48C7FC001C1470001FB512F05A5AB612E0A31D327C +B126>I<EB1FE0EBFFFC4813FF3907E03F80390F001FC0001EEB0FE0001CEB07F0123F01 +8013F8140313C01380A2381F0007C7FC15F0A2EC0FE015C0141FEC3F80EC7E00EB01F8EB +7FE014FCEB003FEC1FC0EC0FE0EC07F015F8140315FC140115FEA3127EB4FCA415FC4813 +0312780070EB07F86C14F0003C130F001FEB1FE0390FE03F800003B51200C613FCEB1FE0 +1F347DB126>I<EC01C0A214031407A2140F141FA2143F147F146F14CF1301EB038F140F +1307130E130C131C13381330137013E013C0EA0180120313001206120E120C5A12381230 +5A12E0B71280A3C7380FC000A94A7E0107B51280A321337EB226>I<000C14C0380FC00F +90B5128015005C5C14F014C0D80C18C7FC90C8FCA9EB0FC0EB7FF8EBF07C380FC03F9038 +001F80EC0FC0120E000CEB07E0A2C713F01403A215F8A41218127E12FEA315F0140712F8 +006014E01270EC0FC06C131F003C14806CEB7F00380F80FE3807FFF8000113E038003F80 +1D347CB126>I<14FE903807FF80011F13E090383F00F0017C13703901F801F8EBF003EA +03E01207EA0FC0EC01F04848C7FCA248C8FCA35A127EEB07F0EB1FFC38FE381F9038700F +809038E007C039FFC003E0018013F0EC01F8130015FC1400A24814FEA5127EA4127F6C14 +FCA26C1301018013F8000F14F0EBC0030007EB07E03903E00FC03901F81F806CB51200EB +3FFCEB0FE01F347DB126>I<1230123C003FB6FCA34814FEA215FC0070C7123800601430 +157015E04814C01401EC0380C7EA07001406140E5C141814385CA25CA2495A1303A3495A +A2130FA3131F91C7FCA25BA55BA9131C20347CB126>I<EB0FE0EB7FFC90B5FC3903F01F +803907C007C0390F0003E0000EEB01F0001E1300001C14F8003C1478A3123EA2003F14F8 +6D13F0EBC001D81FF013E09038F803C0390FFE07803907FF0F006C13DE6C13F87EEB3FFE +8001F713C0D803E313E0D8078013F0390F007FF8001E131F003EEB07FC003C1303481301 +EC007E12F848143EA2151EA37E153C1278007C14787E6C14F0390F8003E03907F01FC000 +01B5120038007FFCEB1FE01F347DB126>I<EB0FE0EB7FF8EBFFFE3803F83F3907E00F80 +390FC007C0D81F8013E0EC03F0EA3F0048EB01F8127EA200FE14FC1400A415FEA5007E13 +01A2127F7E1403EA1F80000F13073807C00E3803E01C3801F03838007FF090381FC0FC90 +C7FC1401A215F8A215F01403001F14E0383F800715C0140FEC1F809038003F00001C137E +381F01FC380FFFF0000313C0C690C7FC1F347DB126>I<123C127E12FFA4127E123C1200 +B0123C127E12FFA4127E123C08207A9F15>I<007FB812C0B912E0A26C17C0CCFCAC007F +B812C0B912E0A26C17C033147C9C3C>61 D<15E0A34A7EA24A7EA34A7EA3EC0DFE140CA2 +EC187FA34A6C7EA202707FEC601FA202E07FECC00FA2D901807F1507A249486C7EA30106 +6D7EA2010E80010FB5FCA249800118C77EA24981163FA2496E7EA3496E7EA20001821607 +487ED81FF04A7ED8FFFE49B512E0A333367DB53A>65 D<B7FC16E016F83A03FC0003FE00 +01EC00FFEE7F80EE3FC0161F17E0160F17F0A617E0161F17C0EE3F80EE7F0016FEED03FC +90B612F05E9039FC0007FCED00FEEE3F80EE1FC0EE0FE017F0160717F8160317FCA617F8 +1607A2EE0FF0EE1FE0163FEE7FC00003913803FF00B75A16F816C02E337DB236>I<DA03 +FE130C91393FFF801C91B512E0903A03FE01F83C903A0FF0003C7CD91FC0EB0EFCD97F80 +130701FEC7120348481401000315005B4848157C485A173C485A171C123F5B007F160CA3 +90C9FC481600AB7E6D150CA3123F7F001F161C17186C7E17386C6C15306C6C15706D15E0 +12016C6CEC01C0D97F80EB0380D91FC0EB0F00D90FF0131ED903FE13FC0100B512F0023F +13C0DA03FEC7FC2E377CB437>I<B77E16F016FE3A01FE0001FF00009138003FC0EE0FE0 +707E707E707E707E177E177FEF3F80A2EF1FC0A3EF0FE0A418F0AA18E0A3171F18C0A218 +80173F18005F17FE5F4C5AEE07F04C5AEE3FC000014AB45AB748C7FC16F8168034337EB2 +3B>I<B812C0A3D803FCC7127F0001150FEE03E01601A21600A21760A403061330A41700 +150EA2151E157E90B512FEA39038FC007E151E150EA21506170CA3171892C7FCA41738A2 +1770A217F01601160316070003157FB812E0A32E337DB234>I<B81280A3D803FCC7FC00 +01151FEE07C01603A21601A21600A41760150CA31700A2151CA2153C15FC90B5FCA3EBFC +00153C151CA2150CA592C8FCAB487EB512FEA32B337DB232>I<DA03FE130C91393FFF80 +1C91B512E0903A03FE01F83C903A0FF0003C7CD91FC0EB0EFCD97F80130701FEC7120348 +481401000315005B4848157C485A173C485A171C123F5B007F160CA390C9FC4893C7FCAA +0303B512E07E7F92390003FE00705A123F7F121FA26C7E7F12076C7E7F6C6C14036C7E6D +6C1307D91FC0EB0E7CD90FF0EB1C3CD903FEEBF81C0100B5EAF00C023F01C0C7FCDA03FE +C8FC33377CB43C>I<B5D8FE03B512F8A3000190C73807FC006C486E5AB390B7FCA349C7 +1203B3A3486C4A7EB5D8FE03B512F8A335337EB23A>I<B512FEA3000113006C5AB3B3A7 +487EB512FEA317337EB21C>I<B500FE903807FFF8A3000190C7000113006C48EC00FC17 +F04C5A4C5A4CC7FC160E5E5E5E5E4B5A4B5A4BC8FC150E5D5D15F84A7E14034A7EEC0EFF +5C4A6C7E4A6C7EECE01FD9FFC07F4A6C7E4A6C7E5B6F7E6F7EA26F7E707EA2707E707E16 +0F83707E707EA283486C913807FF80B500FE013F13FCA336337EB23C>75 +D<B512FEA3D803FEC9FC6C5AB3A9EE0180A416031700A45EA25E5E5E5E16FE00031407B7 +FCA329337DB230>I<D8FFFC923801FFF86D5DA20003EFFE00D801BFED06FCA3D99F8014 +0CA2D98FC01418A3D987E01430A2D983F01460A3D981F814C0A3D980FCEB0180A2027EEB +0300A36E1306A26E6C5AA36E6C5AA36E6C5AA26E6C5AA36E6C5AA3913800FD80A2037FC7 +FCA3486C133ED80FF04B7EB5011C90387FFFF8A33D337CB246>I<D8FFFE91381FFFF87F +80C6030013006E143CD9DFE01418EBCFF0A2EBC7F8EBC3FCA2EBC1FEEBC0FF6E7EA26E7E +6E7EA26E7E6E7E6E7EA26E7E6E7EA2ED7F80ED3FC0ED1FE0A2ED0FF0ED07F8A2ED03FCED +01FEED00FFA2EE7F98EE3FD8A2EE1FF8160F1607A216031601A2486C1400D807F81578B5 +00C01438A2171835337EB23A>I<EC07FC91387FFFC0903901FC07F0903907E000FCD90F +80133E013FC76C7E017E6E7E496E7E48486E7E48486E7EA248486E7E000F8249157E001F +167FA24848ED3F80A2007F17C0A290C9121FA24817E0AB6C17C06D153FA3003F17806D15 +7FA2001F17006D5D000F5E6C6C4A5AA26C6C4A5A00015E6C6C4A5A017E4A5A6D4A5AD91F +C0017FC7FCD907E013FC903901FC07F09039007FFFC0DA07FCC8FC33377CB43C>I<B612 +FEEDFFC016F03A03FC0007FC0001EC00FE167FEE3F80EE1FC017E0160FA217F0A617E0A2 +EE1FC0A2EE3F80EE7F0016FEED07F890B65A168001FCC9FCB3A2487EB512F8A32C337DB2 +34>I<B612FCEDFF8016F03A01FE0007FC0000EC01FEED007F707E707E83160F83A65FA2 +4C5AA24C5A047EC7FC4B5AED0FF090B612C093C8FC9039FE001FC0ED07F06F7E6F7E1500 +82167E167FA583A5180C17C0A2043F131C486C1618B500FEEB1FE0040F1338933807F070 +C93801FFE09338003F8036357EB239>82 D<90381FE00390387FFC0748B5FC3907F01FCF +390F8003FF48C7FC003E80814880A200788000F880A46C80A27E92C7FC127F13C0EA3FF0 +13FF6C13F06C13FF6C14C06C14F0C680013F7F01037F9038003FFF140302001380157F15 +3FED1FC0150F12C0A21507A37EA26CEC0F80A26C15006C5C6C143E6C147E01C05B39F1FC +03F800E0B512E0011F138026C003FEC7FC22377CB42B>I<007FB712FEA390398007F001 +D87C00EC003E0078161E0070160EA20060160600E01607A3481603A6C71500B3AB4A7E01 +1FB512FCA330337DB237>I<B500FE90381FFFF8A3000190C813006C48153C1718B3AF17 +38017F1530A217706D6C1460011F15E06E495A010F14036D6C495A6D6C49C7FCD901FC13 +1E6DB413FC91383FFFF0020F13C0020190C8FC35357EB23A>I<B500F0903803FFF8A3D8 +07FEC8EA7FC06C48ED1F000001161E6D151C00001618A26D15386D1530A26D6C5CA26E14 +E0011F5DA26D6C495AA28001074AC7FCA26D6C1306A28001015CA26E131C01001418806E +5BA2ED8070023F1360A26E6C5AA215E1020F5BA2DA07F3C8FCA215FBEC03FEA36E5AA26E +5AA31570A235357EB23A>I<B5D8F007B539800FFFF0A3000390C7273FF000011300D801 +FC6E48EB007C1A386D140F00001930836D020715706D1860A26E496C14E0013F60A26ED9 +19FC1301011F60A26ED930FE1303010F95C7FCA26ED9607F5B01071706A26E9039C03F80 +0E0103170CA2913BFC01801FC01C01011718A2913BFE03000FE03801001730A2DAFF06EB +07F0027F5EA2038CEB03F8023F5EA203D8EB01FC021FEDFD80A203F0EB00FF020F93C8FC +A24B800207157EA24B143E0203153CA24B141C020115184C357FB24F>I<267FFFFC90B5 +12C0A3000101E090381FF80026007F80EB0FC0013F6E5A6E91C7FC6D6C130E010F140C6E +5B6D6C133801035C6E13606D6C13E06D6C485A5EDA7F83C8FCEC3FC715C6EC1FECEC0FFC +5D14076E7EA26E7E815C6F7E9138063FC0140E4A6C7E9138180FF0EC380702707F913860 +03FCECC0010101804A6C7E49C77E4981010E6E7E010C6E7E131C496E7E01786E7E13FCD8 +07FEEC1FFEB56C90B512F8A335337EB23A>I<B500F8ECFFFEA300030180EC3FE06C90C8 +EA1F806CEE0E006D6C5C6D6C141817386D6C14305F6D6C14E06D6C5C16016D6C5C6D6C49 +C7FC5E6D6C13065E91387F801C91383FC018163891381FE0306E6C5A16E06E6C5AEDF980 +EC03FF6E90C8FC5D1400B14A7E91B512FCA337337FB23A>I<EAFFF0A4EAF000B3B3B3AD +EAFFF0A40C4B79B715>91 D<EAFFF0A41200B3B3B3AD12FFA40C4B7FB715>93 +D<EB7F803803FFF0380F80FC381C003E003F133F6D6C7E6E7EA26E7EEA1F00C7FCA4EB01 +FF131FEBFF873803FC07EA0FF0EA1FC0EA3F80127F13004815C05AA3140FA26C131F6C13 +3B3A3F8071F180391FC1E1FF2607FFC013003900FE003C22237DA126>97 +D<EA03F012FFA312071203AEEC3F80ECFFE09038F3C0F89038F7007E01FE7F49EB1F8049 +EB0FC05BED07E016F0A2150316F8AA16F0150716E0A2ED0FC07F6DEB1F8001ECEB3F0001 +CF137C90388381F8903801FFE0C76CC7FC25357EB32B>I<EB07F8EB3FFF9038FC07C039 +01F000E03903E003F03807C007120FEA1F80123F90380003E04890C7FCA2127E12FEAA12 +7FA26C14187F001F14386D1330000F14706C6C13E03903F001C03900FC0F8090383FFE00 +EB07F01D237EA122>I<153FEC0FFFA3EC007F81AEEB07F0EB3FFCEBFC0F3901F003BF39 +07E001FF48487E48487F8148C7FCA25A127E12FEAA127E127FA27E6C6C5BA26C6C5B6C6C +4813803A03F007BFFC3900F81E3FEB3FFCD90FE0130026357DB32B>I<EB0FE0EB7FFCEB +F83F3903F00F80D807E013C0390FC007E0381F800315F0EA3F0014014814F8127EA212FE +A2B6FCA248C8FCA5127E127FA26C1418A26C6C1338000F14306D13706C6C13E03901F003 +C03900FC0F00EB3FFEEB07F01D237EA122>I<EB01FCEB07FF90381F078090383E0FC0EB +7C1F13FCEA01F8A20003EB070049C7FCACB512F0A3D803F0C7FCB3A7487E387FFFE0A31A +357FB417>I<151F90391FC07F809039FFF8E3C03901F07FC73907E03F033A0FC01F8380 +9039800F8000001F80EB00074880A66C5CEB800F000F5CEBC01F6C6C48C7FCEBF07C380E +FFF8380C1FC0001CC9FCA3121EA2121F380FFFFEECFFC06C14F06C14FC4880381F000100 +3EEB007F4880ED1F8048140FA56C141F007C15006C143E6C5C390FC001F83903F007E0C6 +B51280D91FFCC7FC22337EA126>I<EA03F012FFA312071203AEEC1FC0EC7FF09038F1E0 +FC9038F3807C9038F7007E13FE497FA25BA25BB3486CEB7F80B538C7FFFCA326347EB32B +>I<EA0780EA0FC0EA1FE0A4EA0FC0EA0780C7FCAAEA07E012FFA3120F1207B3A6EA0FF0 +B5FCA310337EB215>I<EB03C0EB07E0EB0FF0A4EB07E0EB03C090C7FCAAEB03F013FFA3 +13071303B3B01238127C00FE13E0130714C0130F007C138038381F00EA1FFCEA07F01443 +84B217>I<EA03F012FFA312071203AF913803FFE0A36E1300EC00F8EC01E05D4A5A020F +C7FC141C5C5C14F0EBF3F8EBF7FC13FEEBFC7EEBF87F496C7E141F6E7E8114076E7E8114 +016E7E81486CEBFF80B500C313F0A324347EB329>I<EA07E012FFA3120F1207B3B3A7EA +0FF0B5FCA310347EB315>I<2703F01FE013FF00FF90267FF80313C0903BF1E07C0F03E0 +903BF3803E1C01F02807F7003F387FD803FE1470496D486C7EA2495CA2495CB3486C496C +487EB53BC7FFFE3FFFF0A33C217EA041>I<3903F01FC000FFEB7FF09038F1E0FC9038F3 +807C3907F7007EEA03FE497FA25BA25BB3486CEB7F80B538C7FFFCA326217EA02B>I<EB +07F0EB3FFE9038FC1F803901F007C03903C001E000078048486C7E48C7127CA248147E00 +3E143E007E143FA300FE1580A8007E1500A36C147EA26C147C6D13FC6C6C485A00075C39 +03F007E03900FC1F80D93FFEC7FCEB07F021237EA126>I<3903F03F8000FFEBFFE09038 +F3C0F89038F7007ED807FE7F6C48EB1F804914C049130F16E0ED07F0A3ED03F8A9150716 +F0A216E0150F16C06D131F6DEB3F80160001FF13FC9038F381F89038F1FFE0D9F07FC7FC +91C8FCAA487EB512C0A325307EA02B>I<903807F00390383FFC07EBFC0F3901F8038F38 +07E001000F14DF48486CB4FC497F123F90C77E5AA25A5AA9127FA36C6C5B121F6D5B000F +5B3907E003BF3903F0073F3800F81EEB3FF8EB0FE090C7FCAAED7F8091380FFFFCA32630 +7DA029>I<3803E07C38FFE1FF9038E38F809038E71FC0EA07EEEA03ECA29038FC0F8049 +C7FCA35BB2487EB512E0A31A217FA01E>I<EBFF06000713CE381F00FE003C133E48131E +140E5A1406A27EA200FE90C7FC6C7EEA7FFC383FFFC014F0000F7F6C7FC67FEB0FFF1300 +EC3F8000C0131F140F6C1307A37E15006C5B6C130E6C5B38F7807838E1FFE038C07F8019 +237EA11E>I<1330A51370A313F0A21201A212031207381FFFFEB5FCA23803F000AF1403 +A814073801F806A23800FC0EEB7E1CEB1FF8EB07E0182F7FAD1E>I<D803F0133F00FFEB +0FFFA30007EB007F000380B35DA35D12016D4813800000903803BFFC90387E073FEB1FFE +D907F8130026227EA02B>I<B5EBFFF0A3D80FF0EB3F800007EC1F000003140E150C6D13 +1C00011418A26C6C5BA26D1370017E1360137F6D5BA290381F8180A214C3010F90C7FCA2 +EB07E6A214FE6D5AA26D5AA36D5AA2146024217E9F29>I<B53A1FFF81FFF0A33C07F801 +FC003F8001F049EB1E0000030100141C816C6C017C1318A26D017E1338000002FE1330A2 +90267E01FF5B159F168090263F030F5BA216C0903A1F8607C180A202C613E390260FCC03 +90C7FCA2D907FC13F6ECF80116FE6D486C5AA36D481378A36D48133034217F9F37>I<B5 +3801FFF8A32603FE0013806C48EB7C0000001478017E1370017F5B90383F81C090381F83 +80D90FC3C7FCEB07E614FE6D5A6D5A6D7E80805B9038039F809038071FC09038060FE0EB +0C0790381C03F0496C7E01707FEBF000000180000FECFF8026FFFC0313FCA326207F9F29 +>I<3A7FFF807FF8A33A07F8001FC00003EC0F800001EC070015066C6C5BA26D131C017E +1318A26D5BA2EC8070011F1360ECC0E0010F5BA2903807E180A214F3010390C7FC14FBEB +01FEA26D5AA31478A21430A25CA214E05CA2495A1278D8FC03C8FCA21306130EEA701CEA +7838EA1FF0EA0FC025307F9F29>I<003FB512F0A2EB000F003C14E00038EB1FC00030EB +3F800070137F1500006013FE495A13035CC6485A495AA2495A495A49C7FC153013FE485A +12035B48481370485A001F14604913E0485A387F000348130F90B5FCA21C207E9F22>I +E /Fi 27 117 df<B61280A819087F9620>45 D<EA0F80EA3FE0EA7FF0A2EAFFF8A5EA7F +F0A2EA3FE0EA0F80C7FCABEA0F80EA3FE0EA7FF0A2EAFFF8A5EA7FF0A2EA3FE0EA0F800D +2579A41B>58 D<DB3FFCEB01C00203B5EAC003021FECF00791B6EAFC0F01039039FC00FF +3F4901C0EB1FFFD91FFEC77E49481403D97FF080494880485B48177F4849153F4890C9FC +181F485A180F123F5B1807127FA24993C7FC12FFAD127F7FF003C0123FA27F001F1707A2 +6C6C1780180F6C6D16006C6D5D6C173E6C6D157ED97FF85D6D6C4A5A6DB44A5A010701C0 +EB0FE06D01FCEBFF80010090B548C7FC021F14F8020314E09126003FFEC8FC3A3B7BB945 +>67 D<B87E17F817FF18C028007FF8000713F09338007FF8EF1FFE717E050313807113C0 +A27113E0F07FF0A2F03FF8A219FC181FA219FEA419FFAC19FEA419FC183FA219F8187F19 +F0F0FFE0A24D13C04D13804D1300EF1FFEEF7FFC933807FFF0B912C095C7FC17FC178040 +397DB849>I<B912F0A426007FF8C7FCEF1FF8170717031701A21700A21878A3043C137C +183CA41800167CA216FC150391B5FCA4ECF8031500167CA2163C180FA3181EA293C7FCA2 +183EA2183C187CA218FCA2EF01F81703170F173FEE01FFB9FC18F0A338397DB83F>I<B9 +12C0A43A007FF800039338007FE0171F170F1707A21703A21701A318F0EE7800A41800A2 +16F8A21501150791B5FCA4ECF80715011500A21678A693C8FCADB7FCA434397DB83C>I< +B612FCA439007FF800B3B3ADB612FCA41E397DB824>73 D<B600FC0103B512C0A426007F +F8C8381FE00019804EC7FC18FEEF01F84D5A4D5A4D5AEF3F80057EC8FC5F4C5A4C5AEE0F +E0EE1F804CC9FC167E5EED03F84B7E4B7E4B7E4B7F5D02F9B57EDAFBF77FDAFFE37F15C1 +03807F4A487F4A6D7E4A133F707E707F8482707F707F8482717E717E8483717F717F8583 +85B600FC017FEBFFE0A443397DB84B>75 D<B500FC0203B512F0A28080C66C6D90390003 +F0006F6E5A81017B7F13798101787F6E7E6E7E6E7F6E7FA26E7F6E7F6E7F6E7F6F7E153F +826F13806F13C06F13E06F13F06F13F88117FCEE7FFEEE3FFF7013817013C17013E18218 +F17013F97013FDEF7FFF8383A28383838383187FA2183F181F01FC160FB500FC15071803 +1801A244397DB84B>78 D<EDFFF8020FEBFF80027F14F0903A01FFC01FFC010790380007 +FFD91FFC010113C0D93FF06D6C7E49486E7E49486E7E48496E7E48834890C86C7EA24848 +6F1380A248486F13C0A2003F18E0A348486F13F0A400FF18F8AC007F18F06D5DA3003F18 +E0A26D5D001F18C0A26C6C4B13806C18006E5C6C6D4A5A6C5F6C6D4A5A6D6C4A5AD93FFC +49485A6DB401075B0107D9C01F90C7FC010190B512FC6D6C14F0020F1480020001F8C8FC +3D3B7BB948>I<B8FC17F017FEEFFF8028007FF8000F13C0040113E07013F0EF7FF8EF3F +FCA2EF1FFEA218FFA818FEA2EF3FFCA2EF7FF8EFFFF04C13E0040F13C091B7120017FC17 +E002F8C9FCB3A4B612FCA438397DB841>I<B712FCEEFFE017FC17FF28007FF8000F13C0 +04017F707F717E717EA2717EA284A760A24D5A604D5A4D5A04035B041F90C8FC91B612FC +17E0839139F8003FFCEE0FFF707F707F8284A2707FA584A51A601AF084177F1901DD3FFE +13E0B600FC011F130394390FFF87C071EBFF8005011400CBEA1FFC443A7DB848>82 +D<D907FF130E013FEBE01E90B5EAF83E0003ECFE7E3A07FC01FFFE390FF0001F4848130F +48481303491301007F140090C8FC167E5A163EA27F161E7F7F6D91C7FC13FC387FFFE014 +FEECFFF06C14FE6F7E6C816C15F06C816C81C681133F010F801301D9000F1480EC007F03 +0F13C01503818100F0157FA3163FA27E17807E167F6C16007E6D14FE01E0495A01F81303 +9039FF801FF800FC90B512E0D8F83F5CD8F00749C7FC39E0007FF02A3B7BB935>I<003F +B91280A4D9F800EBF003D87FC09238007FC049161F007EC7150FA2007C1707A200781703 +A400F818E0481701A4C892C7FCB3AE010FB7FCA43B387DB742>I<B6D8E01FB500FC9038 +3FFFFCA4000101F0C7D83FFCC8EA7E006C71153C171F6E197C017F701578836E7014F801 +3F6F5E6E1801011F4B6D5CA26E18036D4B6D5CA26D6D496D495A173C6F170F6D037C6D91 +C7FCEF787F6F5F6D4B6C6C131E816D02016E5BEFE01F03F8177C027F01036E13784D7E03 +FCEE80F8023F49486C5C15FE021F010FEDC1E04D7E03FF16C36E49EDE3C0041E7F049E15 +F76E01BC6D5C04FC15FF6E95C8FC4C80A26E5F4C143F6E5F4C141FA2037F5E4C140FA26F +486E5AA2031F5E93C812036F5E5E3A7EB863>87 D<B600F049B512E0A4C601FCC8380FF0 +00017F705A6E4B5A6D6C4B5A6D7F4EC7FC6D6D147E6D7F606D6D495A6D7F4D5A6D6D495A +6E7E4D5A6E6C495A6E13804DC8FC6EEBC07E6E13E05F6EEBF1F86E13F9EEFBF06EEBFFE0 +815F6F5B816F90C9FCB3A2021FB6FCA443397EB848>89 D<903801FFC0010F13FC017F13 +FFD9FF8013802603FE0013C048485AEA0FF8121F13F0123F6E13804848EB7F00151C92C7 +FC12FFA9127FA27F123FED01E06C7E15036C6CEB07C06C6C14806C6C131FC69038C07E00 +6DB45A010F13F00101138023257DA42A>99 D<903803FF80011F13F0017F13FC3901FF83 +FE3A03FE007F804848133F484814C0001FEC1FE05B003FEC0FF0A2485A16F8150712FFA2 +90B6FCA301E0C8FCA4127FA36C7E1678121F6C6C14F86D14F000071403D801FFEB0FE06C +9038C07FC06DB51200010F13FC010113E025257DA42C>101 D<13FFB5FCA412077EAFED +7FC0913803FFF8020F13FE91381F03FFDA3C01138014784A7E4A14C05CA25CA291C7FCB3 +A3B5D8FC3F13FFA4303A7DB935>104 D<EA01F0EA07FC487EA2487EA56C5AA26C5AEA01 +F0C8FCA913FF127FA412077EB3A9B512F8A4153B7DBA1B>I<13FFB5FCA412077EB3B3AC +B512FCA4163A7DB91B>108 D<01FED97FE0EB0FFC00FF902601FFFC90383FFF80020701 +FF90B512E0DA1F81903983F03FF0DA3C00903887801F000749DACF007F00034914DE6D48 +D97FFC6D7E4A5CA24A5CA291C75BB3A3B5D8FC1FB50083B512F0A44C257DA451>I<01FE +EB7FC000FF903803FFF8020F13FE91381F03FFDA3C011380000713780003497E6D4814C0 +5CA25CA291C7FCB3A3B5D8FC3F13FFA430257DA435>I<903801FFC0010F13F8017F13FF +D9FF807F3A03FE003FE048486D7E48486D7E48486D7EA2003F81491303007F81A300FF16 +80A9007F1600A3003F5D6D1307001F5DA26C6C495A6C6C495A6C6C495A6C6C6CB45A6C6C +B5C7FC011F13FC010113C029257DA430>I<9038FE03F000FFEB0FFEEC3FFF91387C7F80 +9138F8FFC000075B6C6C5A5CA29138807F80ED3F00150C92C7FC91C8FCB3A2B512FEA422 +257EA427>114 D<90383FF0383903FFFEF8000F13FF381FC00F383F0003007E1301007C +130012FC15787E7E6D130013FCEBFFE06C13FCECFF806C14C06C14F06C14F81203C614FC +131F9038007FFE140700F0130114007E157E7E157C6C14FC6C14F8EB80019038F007F090 +B512C000F8140038E01FF81F257DA426>I<130FA55BA45BA25B5BA25A1207001FEBFFE0 +B6FCA3000390C7FCB21578A815F86CEB80F014816CEBC3E090383FFFC06D1380903803FE +001D357EB425>I E /Fj 23 117 df<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA +3FF8EA1FF0EA07C00F0F788E1F>46 D<EA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA +3FF8EA1FF0EA07C0C7FCAEEA07C0EA1FF0EA3FF8EA7FFCEAFFFEA7EA7FFCEA3FF8EA1FF0 +EA07C00F2C78AB1F>58 D<B9FC18F018FE727E19E026003FFEC7001F13F805017F943800 +3FFF060F7F727F727F727F84737E737EA2737EA2737EA21B80A2851BC0A51BE0AD1BC0A5 +1B8061A21B006162193F624F5A19FF624E5B06075B4E5B063F90C7FC4DB45A050F13F8BA +5A19C04EC8FC18F095C9FC4B447CC356>68 D<BA12F8A485D8001F90C71201EF003F180F +180318011800A2197E193EA3191EA21778A285A405F890C7FCA316011603161F92B5FCA5 +ED001F160316011600A2F101E01778A2F103C0A494C7FC1907A21A80A2190FA2191FA219 +3FF17F0061601807181F4DB5FCBBFC61A443447DC34A>I<BA1280A419C026003FFEC712 +1F1701EF007F183F181F180F180719E01803A31801A3EE01E0F000F0A419001603A31607 +160F167F91B6FCA59138FE007F160F16071603A31601A693C9FCAFB712F0A53C447CC346 +>I<B712E0A5D8001F90C7FCB3B3B3A4B712E0A523447DC32A>73 +D<B712F0A526003FFECAFCB3B1F00780A4180F1900A460A360A2187EA218FE1701170317 +07171F177FEE03FFB95AA539447CC343>76 D<B9FC18F018FE727E19E0D8001F90C7000F +7F05017F716C7E727E727E721380A21AC084A21AE0A91AC0A24E1380A21A00604E5A4E5A +4D485A050F5B92B712C096C7FC18FC18C092CBFCB3A7B712E0A543447DC34D>80 +D<003FBA12E0A59026FE000FEB8003D87FE09338003FF049171F90C71607A2007E180300 +7C1801A300781800A400F819F8481978A5C81700B3B3A20107B8FCA545437CC24E>84 +D<B600FE017FB691B512FEA526007FFCC8D83FFEC9EA7C006E82013F701778807415F86D +705F6F7014016D705FA26F7014036D64814E6D14076D646F70140F6D041E94C7FCA26F02 +3E6D5C6DDC3C7F151E81027F037C6D5CF0783F6F70147C023F4B6C1578A26F01016F13F8 +6E4B6C5D16806E02036F485A4E7E04C0EEE0036E4A486C5DA2DCE00FEDF0076E4B6C5D16 +F06E4A6F48C8FC051E7F04F8705A6E4A027F131EA2DCFC7CEDFE3E037F0178023F133C04 +FE16FF033F01F85E4D8004FF17F86F496E5BA36F496E5BA26F604D80A26F90C86C5BA36F +486F90C9FCA26F48167EA30478163C6F457EC374>87 D<903801FFE0011F13FE017F6D7E +48B612E03A03FE007FF84848EB1FFC6D6D7E486C6D7EA26F7FA36F7F6C5A6C5AEA00F090 +C7FCA40203B5FC91B6FC1307013F13F19038FFFC01000313E0000F1380381FFE00485A5B +127F5B12FF5BA35DA26D5B6C6C5B4B13F0D83FFE013EEBFFC03A1FFF80FC7F0007EBFFF8 +6CECE01FC66CEB8007D90FFCC9FC322F7DAD36>97 D<EE03FEED07FFA5ED001F160FB1EC +3FE0903803FFFC010FEBFF8F013F14CF9039FFF807FF48EBC00148903880007F4890C712 +3F4848141F49140F121F485AA3127F5BA212FFAC127FA37F123FA26C6C141FA26C6C143F +0007157F6C6C91B5FC6CD9C00314FC6C9038F01FEF6DB5128F011FEBFE0F010713F89026 +007FC0EBF80036467CC43E>100 D<EC3FF80103B57E010F14E0013F8090397FF83FF890 +39FFC007FC48496C7E48496C7E48486D1380485A001FED7FC05B003FED3FE0A2127F5B17 +F0161F12FFA290B7FCA401F0C9FCA5127FA27FA2123F17F06C7E16016C6C15E06C6C1403 +6C6DEB07C06C6DEB0F806C01F0EB3F0090397FFE01FE011FB55A010714F0010114C09026 +001FFEC7FC2C2F7DAD33>I<DAFFE0137E010F9039FE03FF80013FEBFF8F90B812C048D9 +C07F133F489038001FF84848EB0FFC4848903907FE1F80001F9238FF0F00496D90C7FCA2 +003F82A8001F93C7FCA26D5B000F5D6C6C495A6C6C495A6C9038C07FF04890B55A1680D8 +078F49C8FC018013E0000F90CAFCA47F7F7F90B612C016FC6CEDFF8017E06C826C16FC7E +000382000F82D81FF0C77ED83FC014074848020113808248C9FC177FA46D15FF007F1700 +6D5C6C6C4A5A6C6C4A5AD80FFEEC3FF83B07FFC001FFF0000190B612C06C6C92C7FC010F +14F8D9007F90C8FC32427DAC38>103 D<137C48B4FC4813804813C0A24813E0A56C13C0 +A26C13806C1300EA007C90C7FCAAEB7FC0EA7FFFA512037EB3AFB6FCA518467CC520> +105 D<EB7FC0B5FCA512037EB3B3B3A3B61280A519457CC420>108 +D<90277F8007FEEC0FFCB590263FFFC090387FFF8092B5D8F001B512E002816E4880913D +87F01FFC0FE03FF8913D8FC00FFE1F801FFC0003D99F009026FF3E007F6C019E6D013C13 +0F02BC5D02F86D496D7EA24A5D4A5DA34A5DB3A7B60081B60003B512FEA5572D7CAC5E> +I<90397F8007FEB590383FFF8092B512E0028114F8913987F03FFC91388F801F00039039 +9F000FFE6C139E14BC02F86D7E5CA25CA35CB3A7B60083B512FEA5372D7CAC3E>I<EC1F +FC49B512C0010714F0011F14FC90397FF80FFF9026FFC0017F48496C7F4848C7EA3FE000 +078248486E7E49140F001F82A2003F82491407007F82A400FF1780AA007F1700A46C6C4A +5AA2001F5E6D141F000F5E6C6C4A5AA26C6C6CEBFFE06C6D485B27007FF80F90C7FC6DB5 +5A010F14F8010114C09026001FFCC8FC312F7DAD38>I<90397FC00FF8B590B57E02C314 +E002CF14F89139DFC03FFC9139FF001FFE000301FCEB07FF6C496D13804A15C04A6D13E0 +5C7013F0A2EF7FF8A4EF3FFCACEF7FF8A318F017FFA24C13E06E15C06E5B6E4913806E49 +13006E495A9139DFC07FFC02CFB512F002C314C002C091C7FCED1FF092C9FCADB67EA536 +407DAC3E>I<90387F807FB53881FFE0028313F0028F13F8ED8FFC91389F1FFE000313BE +6C13BC14F8A214F0ED0FFC9138E007F8ED01E092C7FCA35CB3A5B612E0A5272D7DAC2E> +114 D<90391FFC038090B51287000314FF120F381FF003383FC00049133F48C7121F127E +00FE140FA215077EA27F01E090C7FC13FE387FFFF014FF6C14C015F06C14FC6C80000380 +6C15806C7E010F14C0EB003F020313E0140000F0143FA26C141F150FA27EA26C15C06C14 +1FA26DEB3F8001E0EB7F009038F803FE90B55A00FC5CD8F03F13E026E007FEC7FC232F7C +AD2C>I<EB01E0A51303A41307A2130FA2131FA2133F137F13FF1203000F90B51280B7FC +A4C601E0C7FCB3A3ED01E0A9150302F013C0137F150790393FF80F8090391FFC1F006DB5 +FC6D13FC01015B9038003FE023407EBE2C>I E /Fk 69 123 df<DA0FF813FC91397FFF +07FF903B01F807DF83C0903A07E001FF0F903B1F8007FE1FE090393F000FFC137E16F85B +9338F007804848010790C7FC1503ACB812F8A32801F80003F0C7FCB3AB486C497E267FFF +E0B512F0A3333B7FBA30>11 D<EC0FF8EC7FFE903901F80780903907E001C090391F8000 +E090383F0007017E497EA25BA2485A6F5AED018092C8FCA9ED03F0B7FCA33901F8000F15 +03B3AA486C497E267FFFE0B512C0A32A3B7FBA2E>I<EC0FFC91387FFF70903901F803F0 +903807E00790381F800FEB3F00137EA25B150748481303ADB7FCA33901F80003B3AB486C +497E267FFFE0B512C0A32A3B7FBA2E>I<121C127FEAFF80A8EA7F00AB123EAB121CABC7 +FCA8121C127FEAFF80A5EA7F00121C093C79BB17>33 D<001C131C007F137F39FF80FF80 +A26D13C0A3007F137F001C131C00001300A40001130101801380A2000313030100130048 +5B00061306000E130E485B485B485B006013601A197DB92A>I<030C1303031E497EA203 +3E130FA2033C91C7FCA2037C5BA20378131EA303F8133EA24B133CA20201147CA24B1378 +A2020314F8A24B5BA302071301007FB91280BA12C0A26C1880C7271F0007C0C7FC021E5C +A3023E130FA2023C91C8FCA2027C5BA20278131EA302F8133E007FB91280BA12C0A26C18 +80280003E000F8C8FC4A5BA301071301A202805BA2010F1303A202005BA2491307A2011E +5CA3013E130FA2013C91C9FCA2017C5BA20178131EA20130130C3A4A7BB945>I<121C12 +7FEAFF80A213C0A3127F121C1200A412011380A2120313005A1206120E5A5A5A12600A19 +79B917>39 D<146014E0EB01C0EB0380EB0700130E131E5B5BA25B485AA2485AA212075B +120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA3121EA2121F7EA27F12077F1203A2 +6C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E01460135278BD20>I<12C07E1270 +7E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E131EA2131F7FA21480A3EB07 +C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C137C1378A25BA2485A485A +A2485A48C7FC120E5A5A5A5A5A13527CBD20>I<121C127FEAFF80A213C0A3127F121C12 +00A412011380A2120313005A1206120E5A5A5A12600A19798817>44 +D<B512FCA516057F941C>I<121C127FEAFF80A5EA7F00121C0909798817>I<150C151E15 +3EA2153C157CA2157815F8A215F01401A215E01403A215C01407A21580140FA215005CA2 +141E143EA2143C147CA2147814F8A25C1301A25C1303A2495AA25C130FA291C7FC5BA213 +1E133EA2133C137CA2137813F8A25B1201A25B1203A25B1207A25B120FA290C8FC5AA212 +1E123EA2123C127CA2127812F8A25A12601F537BBD2A>I<EB03F8EB1FFF90387E0FC090 +38F803E03901E000F0484813780007147C48487FA248C77EA2481580A3007EEC0FC0A600 +FE15E0B3007E15C0A4007F141F6C1580A36C15006D5B000F143EA26C6C5B6C6C5B6C6C48 +5A6C6C485A90387E0FC0D91FFFC7FCEB03F8233A7DB72A>I<EB01C013031307131F13FF +B5FCA2131F1200B3B3A8497E007FB512F0A31C3879B72A>I<EB0FF0EB7FFE48B57E3903 +E03FE0390F000FF0000E6D7E486D7E486D7E123000706D7E126012FCB4EC7F807FA56CC7 +FC121CC8FCEDFF00A34A5A5D14035D4A5A5D140F4A5A4A5A92C7FC147C5C495A495A495A +495A91C8FC011EEB01805B5B49130348481400485A485A000EC75A000FB6FC5A5A485CB6 +FCA321387CB72A>I<EB07F8EB3FFF4913C03901F80FF03903C007F848486C7E380E0001 +000F80381FE0006D7FA56C5A6C5AC85A1401A25D4A5AA24A5A5DEC0F80027EC7FCEB1FFC +ECFF809038000FE06E7EEC01FC816E7EED7F80A216C0A2153F16E0A2121EEA7F80487EA4 +16C049137F007F1580007EC7FC0070ECFF006C495A121E390F8003F83907F00FF00001B5 +12C06C6C90C7FCEB0FF8233A7DB72A>I<1538A2157815F8A2140114031407A2140F141F +141B14331473146314C313011483EB030313071306130C131C131813301370136013C012 +01EA038013005A120E120C5A123812305A12E0B712F8A3C73803F800AB4A7E0103B512F8 +A325397EB82A>I<0006140CD80780133C9038F003F890B5FC5D5D158092C7FC14FC3806 +7FE090C9FCABEB07F8EB3FFE9038780F803907E007E090388003F0496C7E12066E7EC87E +A28181A21680A4123E127F487EA490C71300485C12E000605C12700030495A00385C6C13 +03001E495A6C6C485A3907E03F800001B5C7FC38007FFCEB1FE0213A7CB72A>I<EC3FC0 +903801FFF0010713FC90380FE03E90383F800790387E001F49EB3F804848137F485AA248 +5A000FEC3F0049131E001F91C7FCA2485AA3127F90C9FCEB01FC903807FF8039FF1E07E0 +90383801F0496C7E01607F01E0137E497FA249148016C0151FA290C713E0A57EA56C7E16 +C0A2121FED3F807F000F15006C6C5B15FE6C6C5B6C6C485A3900FE07F090383FFFC06D90 +C7FCEB03FC233A7DB72A>I<EB03F8EB1FFF017F13C09038FC07F03901E001F848486C7E +4848137C90C77E48141E000E141F001E80A3121FA27F5D01E0131E6C6C133E01FC133C6D +5B6C6C6C5AECC1E06CEBF3C06C01FFC7FC6C5BEB3FFF6D13C081017F13F801F07F3903E0 +7FFE3907801FFF48486C1380481303003E6D13C0003CEB007F007C143F0078EC0FE000F8 +14075A1503A21501A36C15C012781503007C15806CEC07006C5C6C6C131ED807E0137C39 +03F803F0C6B55A013F1380D907FCC7FC233A7DB72A>56 D<EB03F8EB1FFF017F13C09038 +FC07E03903F803F048486C7E48486C7E49137E121F48487FA2007F158090C7FCA248EC1F +C0A616E0A56C143FA27F123F001F147FA26C6C13FF6C6C13DF000313013901F0039F3900 +FC0F1FD93FFC13C0EB07F090C7FC153F1680A316005D000F147E487E486C5BA24A5A4A5A +49485A6C48485A001C495A260F807FC7FC3807FFFC000113F038003FC0233A7DB72A>I< +121C127FEAFF80A5EA7F00121CC7FCB2121C127FEAFF80A5EA7F00121C092479A317>I< +1538A3157CA315FEA34A7EA34A6C7EA202077FEC063FA2020E7FEC0C1FA2021C7FEC180F +A202387FEC3007A202707FEC6003A202C07F1501A2D901807F81A249C77F167FA2010681 +0107B6FCA24981010CC7121FA2496E7EA3496E7EA3496E7EA213E0707E1201486C81D80F +FC02071380B56C90B512FEA3373C7DBB3E>65 D<B712E016FC16FF0001903980007FC06C +90C7EA1FE0707E707E707EA2707EA283A75F16035F4C5A4C5A4C5A4C5AEEFF8091B500FC +C7FCA291C7EA7F80EE1FE0EE07F0707E707E83707EA21880177F18C0A7188017FFA24C13 +005F16034C5AEE1FF8486DEB7FF0B812C094C7FC16F832397DB83B>I<913A01FF800180 +020FEBE003027F13F8903A01FF807E07903A03FC000F0FD90FF0EB039F4948EB01DFD93F +80EB00FF49C8127F01FE153F12014848151F4848150FA248481507A2485A1703123F5B00 +7F1601A35B00FF93C7FCAD127F6DED0180A3123F7F001F160318006C7E5F6C7E17066C6C +150E6C6C5D00001618017F15386D6C5CD91FE05C6D6CEB03C0D903FCEB0F80902701FF80 +3FC7FC9039007FFFFC020F13F002011380313D7BBA3C>I<B712C016F816FE0001903980 +01FF806C90C7EA3FE0EE0FF0EE03F8707E707E177FA2EF3F8018C0171F18E0170F18F0A3 +EF07F8A418FCAC18F8A4EF0FF0A218E0A2171F18C0EF3F80A2EF7F0017FE4C5A4C5AEE0F +F0EE3FE0486DEBFF80B8C7FC16F816C036397DB83F>I<B812FCA30001903880000F6C90 +C71201EE007E173E171E170EA31706A317078316C0A394C7FCA31501A21503150F91B5FC +A3EC000F15031501A21500A21860A318E093C712C0A41701A3EF0380A21707A2170F173F +177F486D903807FF00B9FCA333397DB839>I<B812F8A30001903880001F6C90C71201EE +00FC177C173C171CA2170CA4170E1706A2ED0180A21700A41503A21507151F91B5FCA3EC +001F15071503A21501A692C8FCAD4813C0B612C0A32F397DB836>I<B648B512FEA30001 +902680000313006C90C76C5AB3A491B6FCA391C71201B3A6486D497EB648B512FEA33739 +7DB83E>72 D<B612C0A3C6EBC0006D5AB3B3AD497EB612C0A31A397EB81E>I<013FB512 +E0A39039001FFC00EC07F8B3B3A3123FEA7F80EAFFC0A44A5A1380D87F005B0070131F6C +5C6C495A6C49C7FC380781FC3801FFF038007F80233B7DB82B>I<B649B5FCA300010180 +9038007FF06C90C8EA3F80053EC7FC173C17385F5F4C5A4C5A4CC8FC160E5E5E5E5E4B5A +ED0780030EC9FC5D153E157E15FF5C4A7F4A6C7E140E4A6C7E4A6C7E14704A6C7E4A6C7E +14804A6C7E6F7EA26F7F707EA2707E707EA2707EA2707E707EA2707E707F8484486D497F +B6011FEBFF80A339397DB841>I<B612E0A3000101C0C8FC6C90C9FCB3AD1718A5173817 +30A31770A317F0A216011603160FEE1FE0486D13FFB8FCA32D397DB834>I<B5933807FF +F86E5DA20001F0FC002600DFC0ED1BF8A2D9CFE01533A3D9C7F01563A3D9C3F815C3A2D9 +C1FCEC0183A3D9C0FEEC0303A2027F1406A36E6C130CA36E6C1318A26E6C1330A36E6C13 +60A26E6C13C0A3913901FC0180A3913900FE0300A2ED7F06A3ED3F8CA2ED1FD8A3ED0FF0 +A3486C6D5A487ED80FFC6D48497EB500C00203B512F8A2ED018045397DB84C>I<B59138 +07FFFE8080C69238007FE06EEC1F80D9DFF0EC0F001706EBCFF8EBC7FCA2EBC3FEEBC1FF +A201C07F6E7EA26E7E6E7E81140F6E7E8114036E7E168080ED7FC016E0153FED1FF0ED0F +F8A2ED07FCED03FEA2ED01FF6F1386A2EE7FC6EE3FE6A2EE1FF6EE0FFEA216071603A216 +011600A2177E486C153E487ED80FFC151EB500C0140EA2170637397DB83E>I<EC03FF02 +1F13E09138FE01FC903901F8007ED907E0EB1F8049486D7ED93F80EB07F049C76C7E01FE +6E7E48486E7E49157E0003167F4848ED3F80A24848ED1FC0A2001F17E049150F003F17F0 +A3007F17F8491507A300FF17FCAC007F17F86D150FA3003F17F0A26C6CED1FE0A36C6CED +3FC0000717806D157F000317006C6C15FEA26C6C4A5A017F4A5A6D6C495A6D6C495AD907 +E0EB1F80D903F8017FC7FC903900FE01FC91381FFFE0020390C8FC363D7BBA41>I<B712 +C016F816FE000190398001FF806C90C7EA3FC0EE0FE0EE07F0EE03F817FC17FE1601A217 +FFA717FEA2EE03FCA2EE07F817F0EE0FE0EE3FC0923801FF0091B512FC16F091C9FCB3A5 +487FB6FCA330397DB839>I<B612FEEDFFE016F8000190388007FE6C90C76C7EEE3FC070 +7E707E707EA2707EA283A65FA24C5AA24C5A4C5AEE3F8004FFC8FCED07FC91B512E05E91 +38000FF0ED03F8ED00FE82707E707EA2161F83A583A6F00180A217F8160F1803486D0107 +1400B66D6C5A04011306933800FE0ECAEA3FFCEF07F0393B7DB83D>82 +D<D90FF813C090383FFE0190B512813903F807E33907E000F74848137F4848133F48C712 +1F003E140F007E1407A2007C140312FC1501A36C1400A37E6D14006C7E7F13F86CB47E6C +13F8ECFF806C14E06C14F86C14FEC680013F1480010714C0EB007F020713E0EC007FED3F +F0151F150FED07F8A200C01403A21501A37EA216F07E15036C15E06C14076C15C06C140F +6DEB1F80D8FBF0EB3F00D8F0FE13FE39E03FFFF8010F13E0D8C00190C7FC253D7CBA2E> +I<003FB812E0A3D9C003EB001F273E0001FE130348EE01F00078160000701770A3006017 +30A400E01738481718A4C71600B3B0913807FF80011FB612E0A335397DB83C>I<B69038 +07FFFEA3000101809038007FE06C90C8EA1F80EF0F001706B3B2170E6D150C80171C133F +17186D6C14385F6D6C14F06D6C5C6D6C495A6D6CEB07806D6C49C7FC91387F807E91381F +FFF8020713E09138007F80373B7DB83E>I<B500FC91387FFF80A30003018091380FFC00 +6C90C8EA07E0715A6C705A6E1403017F93C7FCA280013F1506A26E140E011F150C80010F +5DA28001075DA26E147001031560A26D6C5CA2806D4A5AA2ED8003027F91C8FCA291383F +C006A215E0021F5BA2EDF01C020F1318A26E6C5AA215FC02035BA2EDFEE002015BA26E6C +5AA36FC9FCA3153EA2151CA3393B7EB83E>I<B5D8FC07B5D8F001B5FCA3000790278000 +1FFEC7EA1FF86C48C7D80FF8EC07E000010307ED03C01B807F6C6F6C1500A26E5F017F6E +6C1406A280013F4A6C5CA280011F4A6D5BEE067FA26D6C010E6D5BEE0C3FA26D6C011C6D +5BEE181FA26D6C6F5BEE300FA26D6C6F485AEE6007A26D6C4CC7FC9338C003FCA203805D +913B7F818001FE06A203C1150EDA3FC3C7EAFF0CA203E3151CDA1FE6EC7F98A215F6DA0F +FCEC3FF0A302075E4B141FA202035E4B140FA202015E4B1407A2020093C8FC4B80503B7E +B855>I<B500FE91383FFFE0A3000301E0913807FE00C649EC03F0017F6F5A606D6C5D6D +6C140395C7FC6D6C1406A26D6C5C6D6C141C17186D6C143817306D6D5B6E6C13E05F9138 +3FE0015F91381FF003DA0FF890C8FC1606913807FC0E160C913803FE1C913801FF185E6E +13B016E0157F6F5AB3A24B7E023FB512C0A33B397FB83E>89 D<EB1FE0EBFFFC3803E03F +3907000F80390F8007E0486C6C7E13E06E7EA26E7E6C5A6C5AC8FCA4147FEB07FFEB3FE0 +EBFE00EA03F8EA0FF0EA1FC0123F485A90C7FC160C12FEA31401A26C13036CEB077C9039 +80063E18383FC01E3A0FE0781FF03A03FFF00FE03A007F8007C026277DA52A>97 +D<EA03F012FFA3120F1203B0EC1FE0EC7FF89038F1E03E9039F3801F809039F7000FC001 +FEEB07E049EB03F049EB01F85BED00FCA216FEA2167E167FAA167E16FEA216FC15016D14 +F8ED03F07F01EEEB07E001C6EB0FC09039C7801F00903881E07E903800FFF8C7EA1FC028 +3B7EB92E>I<EB03FC90381FFF8090387E03E03901F80070484813F83907E001FC380FC0 +03A2EA1F80123F90380001F848EB00F01500A2127E12FEAA127E127FA26C14067F001F14 +0E6D130C000F141C6C6C13386C6C13706C6C13E039007C07C090381FFF00EB07F81F277D +A525>I<ED0FC0EC03FFA3EC003F150FB0EB03F8EB1FFF90387E078F9038F801EF3903F0 +007F4848133F4848131FA24848130F123F90C7FC5AA2127E12FEAA127E127FA27EA26C6C +131FA26C6C133F6C6C137F6C6CEBEFF03A01F801CFFF39007C078F90381FFE0FD907F813 +C0283B7DB92E>I<EB07F8EB1FFF90387C0FC03901F803E03903F001F0D807E013F8380F +C0004848137CA248C7127E153E5A153F127E12FEA3B7FCA248C8FCA5127EA2127FA26C14 +037F001F14076C6C13060007140E6D131CD801F013386C6C137090387E03E090381FFF80 +903803FC0020277EA525>I<147E903803FF8090380FC1E0EB1F8790383F0FF0137EA213 +FCA23901F803C091C7FCADB512FCA3D801F8C7FCB3AB487E387FFFF8A31C3B7FBA19>I< +ED03F090390FF00FF890393FFC3C3C9039F81F707C3901F00FE03903E007C03A07C003E0 +10000FECF000A248486C7EA86C6C485AA200075C6C6C485A6D485A6D48C7FC38073FFC38 +060FF0000EC9FCA4120FA213C06CB512C015F86C14FE6CECFF804815C03A0F80007FE048 +C7EA0FF0003E140348140116F8481400A56C1401007C15F06CEC03E0003F1407D80F80EB +0F80D807E0EB3F003901FC01FC39007FFFF0010790C7FC26387EA52A>I<EA03F012FFA3 +120F1203B0EC0FF0EC3FFCECF03F9039F1C01F809039F3800FC0EBF70013FE496D7EA25B +A35BB3A3486C497EB500C1B51280A3293A7EB92E>I<EA0380EA0FE0487EA56C5AEA0380 +C8FCAAEA03F012FFA312071203B3AA487EB512C0A312387EB717>I<EA03F012FFA3120F +1203B1913801FFFCA39138007FC01600157C15705D4A5A4A5A4AC7FC141E1438147814FC +13F1EBF3FEEBF73F01FE7FEBF81F496C7E8114076E7E6E7E811400157E157F811680ED1F +C0486CEB3FF0B500C0B5FCA3283A7EB92C>107 D<EA03F012FFA3120F1203B3B3AD487E +B512C0A3123A7EB917>I<2703F00FF0EB1FE000FFD93FFCEB7FF8913AF03F01E07E903B +F1C01F83803F3D0FF3800FC7001F802603F70013CE01FE14DC49D907F8EB0FC0A2495CA3 +495CB3A3486C496CEB1FE0B500C1B50083B5FCA340257EA445>I<3903F00FF000FFEB3F +FCECF03F9039F1C01F803A0FF3800FC03803F70013FE496D7EA25BA35BB3A3486C497EB5 +00C1B51280A329257EA42E>I<EB03FE90380FFF8090383E03E09038F800F84848137C48 +487F48487F4848EB0F80001F15C090C712074815E0A2007EEC03F0A400FE15F8A9007E15 +F0A2007F14076C15E0A26C6CEB0FC0000F15806D131F6C6CEB3F006C6C137EC66C13F890 +387E03F090381FFFC0D903FEC7FC25277EA52A>I<3903F01FE000FFEB7FF89038F1E07E +9039F3801F803A07F7000FC0D803FEEB07E049EB03F04914F849130116FC150016FEA316 +7FAA16FEA3ED01FCA26DEB03F816F06D13076DEB0FE001F614C09039F7803F009038F1E0 +7E9038F0FFF8EC1FC091C8FCAB487EB512C0A328357EA42E>I<3807E01F00FFEB7FC090 +38E1E3E09038E387F0380FE707EA03E613EE9038EC03E09038FC0080491300A45BB3A248 +7EB512F0A31C257EA421>114 D<EBFF03000313E7380F80FF381E003F487F487F00707F +12F0A2807EA27EB490C7FCEA7FE013FF6C13E06C13F86C7F00037FC67F01071380EB007F +141F00C0EB0FC01407A26C1303A37E15806C13077EEC0F00B4131E38F3C07C38E1FFF038 +C03F801A277DA521>I<1318A51338A31378A313F8120112031207001FB5FCB6FCA2D801 +F8C7FCB215C0A93800FC011580EB7C03017E13006D5AEB0FFEEB01F81A347FB220>I<D8 +03F0EB07E000FFEB01FFA3000FEB001F00031407B3A4150FA3151F12016D133F0000EC77 +F86D9038E7FF8090383F03C790381FFF87903A03FC07E00029267EA42E>I<B538803FFE +A33A0FF8000FF06C48EB07E00003EC03C06D148000011500A26C6C1306A26D130E017E13 +0CA26D5BA2EC8038011F1330A26D6C5AA214E001075BA2903803F180A3D901FBC7FCA214 +FF6D5AA2147CA31438A227257EA32C>I<B53A1FFFE03FFEA3260FF8009038000FF86C48 +017EEB03E018C00003023EEB0180A26C6C013FEB0300A36C6CEC8006156FA2017E9038EF +C00C15C7A2D93F016D5A15830281EBF038D91F831430150102C3EBF87090260FC6001360 +A2D907E66D5A02EC137CA2D903FCEB7F804A133FA2010192C7FC4A7FA20100141E4A130E +0260130C37257EA33C>I<B538807FFFA33A03FE003FF00001EC1F80000092C7FC017E13 +1C6D13186D6C5AECC070010F5B6D6C5AECF180EB03FB6DB4C8FC6D5AA2147F804A7E8114 +CF903801C7E090380383F090380703F8EB0601496C7E011C137E49137F01787F496D7E48 +6C80000FEC3FF0D8FFFE90B51280A329247FA32C>I<B538803FFEA33A0FF8000FF06C48 +EB07C00003EC03806C7E16007F00001406A2017E5BA2137F6D5BA26D6C5AA2ECC070010F +1360A26D6C5AA214F101035BA2D901FBC7FCA214FF6D5AA2147CA31438A21430A2147014 +60A25CA2EA7C0100FE5B130391C8FC1306EAFC0EEA701C6C5AEA1FF0EA0FC027357EA32C +>I<003FB512FCA2EB8003D83E0013F8003CEB07F00038EB0FE012300070EB1FC0EC3F80 +0060137F150014FE495AA2C6485A495AA2495A495A495AA290387F000613FEA2485A485A +0007140E5B4848130C4848131CA24848133C48C7127C48EB03FC90B5FCA21F247EA325> +I E /Fl 19 118 df<177017F84C7EA34C7EA34C7EA34C7FA24C7FA34C7F163CA2047C7F +EE787FA204F07F173F030180EEE01FA2030380EEC00FA20307804C7EA2DB0F0080834B81 +031E7FA2033E81033C7FA2037C810378147FA24B81183F0201824B141FA20203824B140F +A20207824B80A24AB87EA24A83A2021EC81201023E83023C81A2027C830278167FA24A83 +193F0101844A161FA20103844A160FA20107844A82130F6E84011F83496C4C7FD9FFF084 +000701FC043F13F8B600C0020FB612F8A455567AD561>65 D<BB12F0A4C66C90C8120FD9 +1FFE9238007FF8010F171F1907190319011900A21A78A21A3CA31A1CA61A0EA2EF01C0A2 +1A00A51703A31707170F171F17FF91B7FCA44AC7FC171F170F17071703A31701A794C9FC +B3497E017F13C0B712FCA4475279D155>70 D<B700E090B712E0A4C66C01C0C86CEBC000 +011F90C9001F90C7FC6D48705AB3AD91B9FCA44AC9120FB3B1496C4C7E017F01C0037F13 +C0B700E090B712E0A4535279D161>72 D<B712E0A4C66CEBC000011F90C7FC6D5AB3B3B3 +B0497E017F13C0B712E0A4235279D130>I<B712FCA4C66C01C0CAFC011F90CBFC6D5AB3 +B3A91A70A51AE0A51901A419031AC01907A2190F191FA2193F19FF601807011F161FD97F +FF0203B51280BBFCA4445279D152>76 D<DA1FFC147091B512C0010702F013F049ECFC01 +90393FF003FF903A7F80003F83D801FEC7EA0FC74848EC03F74848EC01FF49804848157F +4848153F171F4848150F1707127F90C91203A2481601A31700A27FA218707FA27F6C6C16 +007F7F6C7E6D7E6C13F0ECFF806C14F86CECFF8016F86C15FF6C16C06C6C15F06D816D81 +010715FF01001680141F020115C0DA001F14E0030014F0160F040313F81600177FEF3FFC +171F170F18FE170712E01703A31701A27EA318FC7EA26C160318F87E6CEE07F0A26DED0F +E06D151F01F016C06DED3F80D8FEFEED7F00D93F80EB01FE26FC1FF0495A26F807FFEB1F +F8010190B512E0486C6C148048010F49C7FC020013F0375877D449>83 +D<4B7E4B7E4B7EA34B7EA34B7EA24B7EA3ED77FE1573EDF3FF15E1A202018015C0A24A48 +6C7EA2020780ED003FA24A80020E131FA24A6D7EA2023C8002381307A24A801603A24A6D +7EA201018291B7FCA249820280C7127F01078291C8123FA24982010E151FA2496F7EA201 +3C8217075B017C8213FC000183486C1780D81FFF031F13C0B500E049B6FCA3403F7CBE49 +>97 D<B912FCA3000101E0C7123F6C491407017FED01FEEF007EA2183E181EA2180EA418 +0F84A2160EA295C7FCA3161EA3163EED01FE91B5FCA3ECC001ED003E161EA3160EA2F001 +C0A393C7FCF00380A51807A2190060A26060606001FF1503486DEC3FFEB9FCA33A3D7CBC +43>101 D<B912E0A300039038C000016C49EB001F6CEE07F017031701A21700A21870A4 +18781838A3161C1800A4163CA3167CED03FC91B5FCA3EC8003ED007C163CA3161CA593C8 +FCAE487F4813F0B612F0A3353D7BBC40>I<B612E0A30001EBF0006C5B6D5AB3B3AF497E +487FB612E0A31B3D7CBC24>105 D<B612F0A3000301F0C9FC6C13C06C5BB3AFEF01C0A5 +17031880A31707A3170FA2171F173F177FEFFF00481503486D133FB9FCA3323D7BBC3D> +108 D<B500C093380FFFFC6E5E6E5E0001F1FE006C61D977F8EE77F8A2D973FC16E7A3D9 +71FEED01C7A2D970FFED0387A36E6CEC0707A26E6C140EA36E6C141CA26E6C1438A36E6C +1470A26E6C14E0A36E6CEB01C0A26E6CEB0380A392397F800700A292383FC00EA36F6C5A +A26F6C5AA36F6C5AA26F6C5AA36FB45AA26F5B13F8A2486C6EC7FC486C4D7E260FFF8001 +3E4A7EB500F8030FB512FCA2161C4E3D7BBC59>I<B500C0021FB5FC80A2C66D020113F0 +6D6C9138007FC06EED3F80F01F00EB77FED973FF150E01717FA201707F6E7E143F816E7E +6E7EA26E7E6E7E6E7FA26E7F6F7E6F7EA26F7E6F7E6F7EA26F7E6F13806F13C0A2EE7FE0 +EE3FF0EE1FF8A2EE0FFCEE07FEEE03FFA270138E7013CE177F18EEEF3FFE171FA2170F17 +071703A201F815011700486C167E487E260FFF80153EB500F8151E180EA2403D7CBC49> +I<ED3FF80203B57E021F14F091397FE00FFC9139FF0001FED903FE6D6C7ED907F8EC3FC0 +D91FF0EC1FF049486E7E49486E7E49486E7E91C8120148486F7E000318804848EE7FC0A2 +4848EE3FE0A2001F18F049161F003F18F8A3007F18FC49160FA300FF18FEAC6C6CEE1FFC +A4003F18F86D163F001F18F0A36C6CEE7FE0000718C06D16FF000318806C6C4B13006E5C +6C5F6D6C4A5A6D6C4A5A6D6C4A5AD907F8EC3FC0D903FEECFF80902701FF800390C7FC90 +3A007FF01FFC021FB512F0020314809126003FF8C8FC3F417ABE4C>I<B712FEEEFFE017 +F800019039E0000FFE6C49903801FF80017F9138007FC0EF3FE0EF1FF0EF0FF818FCA2EF +07FEA218FFA718FEA2EF0FFCA218F8EF1FF0EF3FE0EF7FC0933801FF8093380FFE0091B6 +12F817E04CC7FC02C0C9FCB3A5497E487FB612E0A3383D7CBC43>I<B712F016FF17E000 +019039E0003FF86C49EB07FC017FEC01FF707F717E717E84A2717EA284A660A24D5AA260 +4D5A4D5A4C90C8FCEE07FCEE3FF891B612E094C9FCA2DAC00013C0EE1FE0EE0FF8707E16 +03707E838284A484A384A49538F001C0A3177FF0F803496C023F1480486D91381FFC07B6 +00E01600943807FE1F943803FFFECB5BF01FF0423F7CBC48>114 +D<D903FE130690391FFFE00E017FEBF81E3A01FE01FC3E3A03F0003F7E4848EB0FFED80F +801307001F140190C7FC003E1400007E157E127C163E12FC161EA36C150EA27EA26D91C7 +FC6C7E13F013FC6CB47E14FC6CEBFFC06C14FC6C14FF6C15C06C816C6C80011F80010380 +D9003F7F14039138003FFF03071380150181EE7FC0163FA200E0151FA2160FA37EA21780 +7E161F6C16006C5D163E6C6C5C6D14FC6D495AD8FDFC495A3AF87FC01FC0D8F01FB55AD8 +E00349C7FC39C0003FF02A417ABE37>I<003FB912F0A3903BF0003FF8003F01806D4813 +0748C7ED01F8007C1700A200781878A219381270A400F0183C48181CA4C81600B3B14B7E +EDFFFE49B7FCA33E3C7CBB47>I<B600E0011FB5FCA3000101F0C7000113F06C49913800 +7FC06D48ED3F80F01F00A2180EB3B3013F161E6E151CA2183C011F16386E1578010F1670 +6D6C15F04D5A6D6C5D6D6C14076D6C4A5A6E6C013FC7FCDA1FE013FC91390FFC07F80203 +B512E002001480DB0FFCC8FC403F7CBC49>I E end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%PaperSize: A4 +%%BeginPaperSize: A4 +/setpagedevice where { +pop 1 dict dup /PageSize [ 595 842 ] put setpagedevice +} { +statusdict /a4tray known { +statusdict begin a4tray end +/a4 where { pop a4 } if +} { +/a4 where { +pop a4 +} { +statusdict /setpage known { +statusdict begin +595 842 0 setpage +end +} if +} ifelse +} ifelse +} ifelse +%%EndPaperSize + +%%EndSetup +%%Page: 1 1 +1 0 bop 954 390 a Fl(Input)46 b(File)g(F)m(orma)-8 b(ts)44 +b(f)m(or)i(FLASH)1571 490 y Fk(V)-7 b(ersion)27 b(0.4.3,)f(3/98)150 +726 y(All)g(the)g(input)g(\014les)f(are)g(constructed)g(in)h(the)f +(same)g(w)n(a)n(y:)35 b(KEYW)n(ORDS)25 b(precede)g(the)h(v)-5 +b(alues)25 b(for)g(sp)r(eci\014ed)150 826 y(input)34 +b(parameters,)e(COMMENTS)h(are)f(mark)n(ed)f(b)n(y)i(a)f(')9 +b(!')53 b(or)32 b('#')i(in)f(the)g(\014rst)g(line.)53 +b(There)32 b(are)g(\014v)n(e)g(six)150 925 y(whic)n(h)e(migh)n(t)f(b)r +(e)i(imp)r(ortan)n(t:)40 b(P)n(arameters.dat,)28 b(Windparam.dat,)i +(Land.dat,)g(T)-7 b(riang.dat,)29 b(Domain.dat,)150 1025 +y(and)e(Initial.dat.)150 1296 y Fj(FILE:)38 b(P)m(arameters.dat)150 +1450 y Fi(DESCRIPTION:)150 1603 y Fk(This)26 b(\014le)h(de\014nes)g +(the)f(b)r(eha)n(viour)g(of)g(FLASH.)h(It)g(also)f(con)n(tains)f(the)i +(main)f(ph)n(ysical)g(parameters,)f(the)i(user)150 1702 +y(can)g(in\015uence.)150 1856 y Fi(KEYW)m(ORDS:)p 150 +1921 3653 4 v 148 2104 4 183 v 200 1985 a Fh(Keyw)n(ord)p +1475 2104 V 1028 w(Description)p 2874 2104 V 1016 w(Range)168 +b(of)h(V)-6 b(alues)2926 2076 y Fg([Default])p 3801 2104 +V 150 2107 3653 4 v 150 2124 V 148 2489 4 366 v 200 2187 +a Fh(EXPERIMENT)p 739 2187 24 4 v 28 w(NUMBER)p 1475 +2489 4 366 v 416 w(This)41 b(is)g(the)f(exp)r(erimen)n(t)f(n)n(um)n(b)r +(er,)j(nor-)1527 2279 y(mally)27 b(set)i(to)f(0)g(\(for)h(a)f(new)g +(exp)r(erimen)n(t\),)1527 2370 y(if)22 b(an)f(exp)r(erimen)n(t)f(is)i +(con)n(tin)n(ued,)g(then)f(it)g(is)1527 2461 y(set)26 +b(to)g(the)f(con)n(tin)n(ued)g(coun)n(ter.)p 2874 2489 +V 2926 2187 a(0)h(to)f(999)i Fg([required])p 3801 2489 +V 150 2492 3653 4 v 148 2857 4 366 v 200 2556 a Fh(FINE)p +393 2556 24 4 v 27 w(GRID)p 624 2556 V 27 w(LEVEL)p 1475 +2857 4 366 v 623 w(Sets)19 b(the)h(\014nest)f(grid)h(lev)n(el.)33 +b(The)19 b(mesh)g(size)1527 2647 y(is)34 b(giv)n(en)g(b)n(y)f(2)1974 +2616 y Ff(\000)p Fe(\()p Fd(j)s Fe(+1\))p Fd(=)p Fe(2)2265 +2647 y Fc(\002)22 b Fb(H)6 b Fh(,)36 b(where)f Fb(j)j +Fh(is)1527 2739 y(the)19 b(re\014nemen)n(t)e(lev)n(el)i(and)g +Fb(H)25 b Fh(is)20 b(the)f(coarse)1527 2830 y(mesh)24 +b(size.)p 2874 2857 V 2926 2556 a(1)i(to)f Fc(1)h Fg([required])p +3801 2857 V 150 2861 3653 4 v 148 3226 4 366 v 200 2925 +a Fh(CO)n(ARSE)p 528 2925 24 4 v 27 w(GRID)p 759 2925 +V 26 w(LEVEL)p 1475 3226 4 366 v 489 w(The)j(coarse)h(grid)g(lev)n(el)f +(\(or)g(minim)n(um)d(re-)1527 3016 y(\014nemen)n(t)d(lev)n(el\))p +2874 3226 V 2926 2925 a(1)e(to)h Fc(1)f Fh(should)h(b)r(e)f(smaller) +2926 3016 y(than)2926 3107 y(FINE)p 3119 3107 24 4 v +27 w(GRID)p 3350 3107 V 27 w(LEVEL)2926 3199 y Fg([required])p +3801 3226 4 366 v 150 3229 3653 4 v 148 3595 4 366 v +200 3293 a Fh(TOLERANCE)p 700 3293 24 4 v 27 w(OF)p 837 +3293 V 28 w(REFINEMENT)p 1475 3595 4 366 v 135 w(A)g(global)i +(re\014nemen)n(t)c(tolerance)k(\()p Fb(\022)2592 3302 +y Fd(r)r(ef)2692 3293 y Fh(\):)32 b(If)1527 3385 y(the)18 +b(lo)r(cal)j(error)e(estimate)g Fb(\021)2347 3394 y Fd(l)2391 +3385 y Fh(is)g(larger)h(than)1527 3476 y Fb(\022)1563 +3485 y Fd(r)r(ef)1689 3476 y Fc(\002)26 b Fb(\021)1813 +3484 y Fd(max)1980 3476 y Fh(then)39 b(an)h(elemen)n(t)f(will)i(b)r(e) +1527 3567 y(re\014ned.)p 2874 3595 V 2926 3293 a(0.0)26 +b(to)g(1.0)h Fg([required])p 3801 3595 V 150 3598 3653 +4 v 148 3963 4 366 v 200 3662 a Fh(TOLERANCE)p 700 3662 +24 4 v 27 w(OF)p 837 3662 V 28 w(CO)n(ARSENING)p 1475 +3963 4 366 v 140 w(A)h(global)j(coarsening)f(tolerance\()p +Fb(\022)2590 3670 y Fd(cr)r(s)2683 3662 y Fh(\):)41 b(If)1527 +3753 y(the)e(lo)r(cal)j(error)e(estimate)g Fb(\021)2431 +3762 y Fd(l)2495 3753 y Fh(is)g(smaller)1527 3845 y(than)29 +b Fb(\022)1746 3853 y Fd(cr)r(s)1857 3845 y Fc(\002)19 +b Fb(\021)1974 3853 y Fd(max)2130 3845 y Fh(then)29 b(an)g(elemen)n(t)g +(will)1527 3936 y(b)r(e)c(coarsened.)p 2874 3963 V 2926 +3662 a(0.0)84 b(to)f(1.0)i Fb(<)117 b(\022)3653 3671 +y Fd(r)r(ef)2926 3753 y Fg([required])p 3801 3963 V 150 +3967 3653 4 v 148 4332 4 366 v 200 4031 a Fh(W)-9 b(A)j(TERMARK)p +736 4031 24 4 v 26 w(OF)p 872 4031 V 28 w(REFINEMENT)p +1475 4332 4 366 v 100 w(A)17 b(p)r(ercen)n(tage)h(of)g(c)n(hanges)f(\() +p Fb(!)2410 4040 y Fd(r)r(ef)2510 4031 y Fh(\):)30 b(If)17 +b(more)1527 4122 y(than)26 b Fb(!)1755 4131 y Fd(r)r(ef)1881 +4122 y Fh(p)r(ercen)n(t)h(of)h(the)e(grid)h(elemen)n(ts)1527 +4213 y(are)f(mark)n(ed)f(for)h(re\014nemen)n(t,)f(then)g(re\014ne,)1527 +4304 y(otherwise)i(lea)n(v)n(e)f(the)f(grid)h(unc)n(hanged)p +2874 4332 V 2926 4031 a(0.0)g(to)g(1.0)h Fg([required])p +3801 4332 V 150 4335 3653 4 v 148 4792 4 457 v 200 4399 +a Fh(W)-9 b(A)j(TERMARK)p 736 4399 24 4 v 26 w(OF)p 872 +4399 V 28 w(CO)n(ARSENING)p 1475 4792 4 457 v 105 w(A)51 +b(p)r(ercen)n(tage)h(of)g(c)n(hanges)g(\()p Fb(!)2547 +4407 y Fd(cr)r(s)2638 4399 y Fh(\):)86 b(If)1527 4490 +y(more)48 b(than)g Fb(!)1992 4498 y Fd(cr)r(s)2132 4490 +y Fh(p)r(ercen)n(t)g(of)h(the)g(grid)1527 4582 y(elemen)n(ts)f(are)i +(mark)n(ed)e(for)i(coarsening,)1527 4673 y(then)31 b(coarsen,)k +(otherwise)e(lea)n(v)n(e)f(the)g(grid)1527 4764 y(unc)n(hanged)p +2874 4792 V 2926 4399 a(0.0)26 b(to)g(1.0)h Fg([required])p +3801 4792 V 150 4795 3653 4 v 148 4886 4 92 v 200 4859 +a Fh(TIMESTEP)p 612 4859 24 4 v 29 w(LENGTH)p 1475 4886 +4 92 v 560 w(This)f(is)g(the)g(time)f(step)g(lengh)n(t)h(in)f(seconds)p +2874 4886 V 103 w(0.0)h(to)g Fc(1)g Fg([required])p 3801 +4886 V 150 4890 3653 4 v 148 5072 4 183 v 200 4954 a +Fh(BEGINNING)p 661 4954 24 4 v 27 w(TIMESTEP)p 1475 5072 +4 183 v 437 w(This)h(is)h(the)e(\014rst)h(timestep)f(coun)n(t)h(for)g +(the)1527 5045 y(exp)r(erimen)n(t.)p 2874 5072 V 2926 +4954 a(1)f(to)g(99999)i Fg([1)i(if)g(exp)r(eri-)2926 +5045 y(men)n(t)e(is)i(0])p 3801 5072 V 150 5076 3653 +4 v 148 5532 4 457 v 200 5140 a Fh(FINISHING)p 616 5140 +24 4 v 25 w(TIMESTEP)p 1475 5532 4 457 v 484 w(The)40 +b(last)g(timestep)f(of)h(the)f(exp)r(erimen)n(t,)1527 +5231 y(th)n(us)829 b(mo)r(delling)1527 5322 y(in)n(terv)l(al)26 +b(time)g(is)h(TIMESTEP)p 2471 5322 24 4 v 29 w(LENGTH)1527 +5414 y Fc(\002)j Fh(FINISHING)p 2033 5414 V 25 w(TIMESTEP)i(-)e(BEGIN-) +1527 5505 y(NING)p 1736 5505 V 27 w(TIMESTEP)-6 b(.)p +2874 5532 4 457 v 2926 5140 a(1)26 b(to)f(99999)j Fg([required])p +3801 5532 V 150 5536 3653 4 v 1892 5919 a Fk(1)p eop +%%Page: 2 2 +2 1 bop 150 390 a Fk(T)-7 b(able)27 b(con)n(tin)n(ued)p +150 455 3622 4 v 148 638 4 183 v 200 519 a Fh(Keyw)n(ord)p +1445 638 V 997 w(Description)p 2844 638 V 1016 w(Range)169 +b(of)g(V)-6 b(alues)2895 611 y Fg([Default])p 3770 638 +V 150 641 3622 4 v 150 658 V 148 1571 4 914 v 200 722 +a Fh(TYPE)p 422 722 24 4 v 28 w(OF)p 560 722 V 28 w(PLOTTING)p +1445 1571 4 914 v 497 w(There)53 b(are)h(di\013eren)n(t)e(options)h +(for)h(real)1496 813 y(time)j(\(online\))h(vizualization:)100 +b(the)57 b(x-)1496 905 y(comp)r(onen)n(t)63 b(of)h(wind)f +Fb(u)g Fh([1],)75 b(the)62 b(y-)1496 996 y(comp)r(onen)n(t)21 +b(of)i(wind)f Fb(v)j Fh([2],)f(the)e(geop)r(oten-)1496 +1087 y(tial)i(heigh)n(t)f(\010)g([3],)i Fb(u)e Fh(with)g(grid)g([4],)i +Fb(v)g Fh(with)1496 1179 y(grid)i([5],)h(\010)f(with)f(grid)h([6],)h +(the)e(grid)h(alone)1496 1270 y([7],)j(the)d(wind)h(v)n(ector)g +(\014eld)f(\()p Fb(u;)14 b(v)s Fh(\))27 b([8],)j(the)1496 +1361 y(v)n(orticit)n(y)24 b Fb(\020)k Fh([9],)e(the)d(tracer)h(concen)n +(tration)1496 1453 y Fb(c)1529 1461 y Fd(t)1583 1453 +y Fh([10],)j Fb(c)1782 1461 y Fd(t)1835 1453 y Fh(with)e(grid)h([11],)h +(no)e(visual)h(out-)1496 1544 y(put)f([0].)p 2844 1571 +V 2895 722 a(0)h(to)g(11)g Fg([0])p 3770 1571 V 150 1575 +3622 4 v 148 1849 4 274 v 200 1639 a Fh(PLOT)p 420 1639 +24 4 v 28 w(TIFF)p 631 1639 V 28 w(FILE)p 1445 1849 4 +274 v 664 w(Eac)n(h)f(visual)g(output)f(can)h(b)r(e)g(prin)n(ted)e(in)n +(to)1496 1730 y(a)k(ti\013)f(\(tagged)h(image)g(\014le)f(format\))h +(\014le.)36 b(If)1496 1821 y(v)l(alue)17 b(is)h(0)g(than)e(no)i(prin)n +(ting)f(is)h(p)r(erformed.)p 2844 1849 V 2895 1639 a(0)26 +b(to)g Fc(1)f Fg([?])p 3770 1849 V 150 1852 3622 4 v +148 2217 4 366 v 200 1916 a Fh(MA)-6 b(TLAB)p 542 1916 +24 4 v 27 w(PLOTTING)p 1445 2217 4 366 v 516 w(Matlab)20 +b(output)e(can)h(b)r(e)g(generated)g(in)g(case)1496 2007 +y(no)39 b(Op)r(enGL)f(library)g(for)i(the)e(visualiza-)1496 +2098 y(tion)30 b(is)f(supp)r(orted)f(If)i(v)l(alue)e(is)i(0)f(than)g +(no)1496 2190 y(prin)n(ting)d(is)g(p)r(erformed.)p 2844 +2217 V 2895 1916 a(0)g(to)g Fc(1)f Fg([?])p 3770 2217 +V 150 2220 3622 4 v 148 2494 4 274 v 200 2284 a Fh(STEPS)p +450 2284 24 4 v 28 w(BTW)p 666 2284 V 28 w(PLOTS)p 1445 +2494 4 274 v 549 w(Timesteps)34 b(b)r(et)n(w)n(een)g(plots.)60 +b(If)34 b(a)h(plot)f(is)1496 2376 y(required)26 b(only)f(ev)n(ery)h +Fb(n)p Fh(-th)f(step)h(set)g(v)l(alue)1496 2467 y(to)g +Fb(n)p Fh(.)p 2844 2494 V 2895 2284 a(1)g(to)g Fc(1)f +Fg([?])p 3770 2494 V 150 2498 3622 4 v 148 2954 4 457 +v 200 2562 a Fh(STEPS)p 450 2562 24 4 v 28 w(BTW)p 666 +2562 V 28 w(SA)-9 b(VES)p 1445 2954 4 457 v 562 w(If)19 +b(an)f(o\013set)h(\014le)g(has)g(to)f(b)r(e)h(written,)h(in)f(case)1496 +2653 y(the)26 b(computer)g(fails)i(or)e(in)h(case)g(the)f(sim)n(u-)1496 +2744 y(lation)21 b(shall)h(b)r(e)e(initialized)h(from)f(a)h(certain) +1496 2836 y(time.)34 b(The)24 b(o\013set)g(\014le)g(is)g(written)h(ev)n +(ery)e Fb(n)p Fh(-)1496 2927 y(th)i(step.)p 2844 2954 +V 2895 2562 a(1)h(to)g Fc(1)f Fg([?])p 3770 2954 V 150 +2958 3622 4 v 148 3323 4 366 v 200 3022 a Fh(SA)-9 b(VE)p +407 3022 24 4 v 27 w(FINISH)p 699 3022 V 26 w(CONFIGURA)j(TION)p +1445 3323 4 366 v 97 w(The)63 b(\014nishing)g(con\014guration)h(can)f +(b)r(e)1496 3113 y(sa)n(v)n(ed)31 b(to)h(disk)f(in)g(order)h(to)f(con)n +(tin)n(ue)g(the)1496 3204 y(exp)r(erimen)n(t)d(at)h(a)h(later)g(time.) +44 b(If)29 b(v)l(alue)g(is)1496 3296 y(0)d(than)g(sa)n(v)n(e)f(\014le)h +(will)h(b)r(e)f(written.)p 2844 3323 V 2895 3022 a(0)g(to)g +Fc(1)f Fg([?])p 3770 3323 V 150 3326 3622 4 v 148 3509 +4 183 v 200 3390 a Fh(POL)-6 b(YGON)p 595 3390 24 4 v +26 w(FILE)p 799 3390 V 28 w(NAME)p 1445 3509 4 183 v +436 w(T)g(ak)n(e)21 b(the)f(p)r(olygons)h(de\014ned)f(in)h(this)f +(\014le)h(as)1496 3482 y(a)26 b(land)g(mask)f(\(for)h(example\).)p +2844 3509 V 2895 3390 a(c)n(haracter)19 b(string)f(of)h(length)2895 +3482 y(32)27 b Fg(['land.dat')i(?])p 3770 3509 V 150 +3512 3622 4 v 148 3695 4 183 v 200 3576 a Fh(WIND)p 429 +3576 24 4 v 26 w(FILE)p 633 3576 V 28 w(NAME)p 1445 3695 +4 183 v 602 w(If)37 b(wind)f(data)g(shall)h(b)r(e)f(read)h(from)f +(\014les,)1496 3668 y(this)26 b(de\014nes)f(the)h(mo)r(de)f(ho)n(w)h +(to)f(do)h(it.)p 2844 3695 V 2895 3576 a(c)n(haracter)19 +b(string)f(of)h(length)2895 3668 y(32)27 b Fg([?])p 3770 +3695 V 150 3698 3622 4 v 148 3881 4 183 v 200 3762 a +Fh(DOMAIN)p 538 3762 24 4 v 26 w(FILE)p 742 3762 V 28 +w(NAME)p 1445 3881 4 183 v 493 w(The)c(domain)e(outline)i(is)g(giv)n +(en)f(in)g(this)g(\014le.)p 2844 3881 V 100 w(c)n(haracter)d(string)f +(of)h(length)2895 3854 y(32)27 b Fg([?])p 3770 3881 V +150 3884 3622 4 v 148 4067 4 183 v 200 3948 a Fh(TRIANG)p +521 3948 24 4 v 27 w(FILE)p 726 3948 V 27 w(NAME)p 1445 +4067 4 183 v 510 w(The)21 b(initial)g(triangulation)h(is)e(giv)n(en)g +(in)g(this)1496 4040 y(\014le.)p 2844 4067 V 2895 3948 +a(c)n(haracter)f(string)f(of)h(length)2895 4040 y(32)27 +b Fg([?])p 3770 4067 V 150 4070 3622 4 v 148 4436 4 366 +v 200 4134 a Fh(SLM)p 366 4134 24 4 v 27 w(ITERA)-6 b(TION)p +838 4134 V 27 w(NUMBER)p 1445 4436 4 366 v 287 w(The)29 +b(n)n(um)n(b)r(er)d(of)i(iterations)i(in)e(the)f(calcu-)1496 +4225 y(lation)20 b(of)f(the)g(semi-Lagrangian)g(upstream)1496 +4317 y(displacemen)n(ts)29 b(is)h(de\014ned)e(b)n(y)g(this)h(v)l(alue.) +1496 4408 y(A)d(go)r(o)r(d)g(v)l(alue)g(is)g(4.)p 2844 +4436 V 2895 4134 a(1)g(to)g Fc(1)f Fg([required])p 3770 +4436 V 150 4439 3622 4 v 1892 5919 a Fk(2)p eop +%%Page: 3 3 +3 2 bop 150 390 a Fj(FILE:)38 b(Domain.dat)150 543 y +Fi(DESCRIPTION:)150 697 y Fk(This)29 b(\014le)g(de\014nes)g(domain)f +(of)h(the)g(calculation.)40 b(It)30 b(is)e(used)h(b)n(y)g(the)g(grid)f +(generator)f(and)i(the)g(visualization)150 796 y(utilit)n(y)-7 +b(.)150 950 y Fi(KEYW)m(ORDS:)p 150 1015 3436 4 v 148 +1197 4 183 v 200 1079 a Fh(Keyw)n(ord)p 1259 1197 V 811 +w(Description)p 2658 1197 V 1016 w(Range)169 b(of)g(V)-6 +b(alues)2709 1170 y Fg([Default])p 3584 1197 V 150 1201 +3436 4 v 150 1217 V 148 1309 4 92 v 200 1281 a Fh(NUMBER)p +554 1281 24 4 v 27 w(OF)p 691 1281 V 28 w(DIMENSIONS)p +1259 1309 4 92 v 97 w(The)26 b(n)n(um)n(b)r(er)e(of)i(space)h +(dimensions)p 2658 1309 V 300 w(1)f(to)g(3)g Fg([2])p +3584 1309 V 150 1312 3436 4 v 148 1495 4 183 v 200 1376 +a Fh(NUMBER)p 554 1376 24 4 v 27 w(OF)p 691 1376 V 28 +w(POL)-6 b(YGONS)p 1259 1495 4 183 v 163 w(The)38 b(n)n(um)n(b)r(er)d +(of)i(p)r(olygons)h(de\014ning)f(the)1310 1467 y(domain)25 +b(\(think)g(of)h(islands\).)p 2658 1495 V 2709 1376 a(1)g(to)g +Fc(1)f Fg([1])p 3584 1495 V 150 1498 3436 4 v 148 1863 +4 366 v 200 1562 a Fh(NUMBER)p 554 1562 24 4 v 27 w(OF)p +691 1562 V 28 w(VER)-6 b(TICES)p 1259 1863 4 366 v 202 +w(This)28 b(Keyw)n(ord)f(o)r(ccurs)h(as)g(often)f(as)h(p)r(oly-)1310 +1653 y(gons)h(are)f(giv)n(en)f(\(previous)h(v)l(alue\).)40 +b(It)27 b(de-)1310 1745 y(\014nes)44 b(the)g(n)n(um)n(b)r(er)e(of)k(v)n +(ertices)e(of)h(eac)n(h)1310 1836 y(p)r(olygon)p 2658 +1863 V 2709 1562 a(1)26 b(to)g Fc(1)f Fg([required])p +3584 1863 V 150 1867 3436 4 v 148 2323 4 457 v 200 1931 +a Fh(VER)-6 b(TEX)p 531 1931 24 4 v 27 w(D)n(A)g(T)g(A)p +1259 2323 4 457 v 541 w(This)36 b(blo)r(c)n(k)f(of)g(data)g(o)r(ccurs)h +(as)f(often)h(as)1310 2022 y(p)r(olygons)j(are)f(giv)n(en.)72 +b(Eac)n(h)38 b(blo)r(c)n(k)g(con-)1310 2113 y(tains)c(NUMBER)p +1860 2113 24 4 v 27 w(OF)p 1997 2113 V 28 w(DIMENSIONS)d +Fc(\002)1310 2205 y Fh(NUMBER)p 1664 2205 V 28 w(OF)p +1802 2205 V 27 w(VER)-6 b(TICES)46 b(lines)h(with)1310 +2296 y(co)r(ordinates)27 b(of)g(eac)n(h)f(v)n(ertex.)p +2658 2323 4 457 v 2709 1931 a(-)48 b(real)h(range)g(to)g(+)f(real)2709 +2022 y(range)26 b Fg([required])p 3584 2323 V 150 2327 +3436 4 v 150 2576 a Fj(FILE:)38 b(Land.dat)150 2729 y +Fi(DESCRIPTION:)150 2882 y Fk(This)31 b(\014le)f(is)h(for)f(con)n(v)n +(enience)f(only)h(and)h(has)f(no)g(meaning)g(to)g(the)h(mo)r(del)g +(itself.)46 b(It)31 b(is)g(safely)f(omitted.)46 b(It)150 +2982 y(de\014nes)28 b(p)r(olygonal)e(lines)h(plotted)h(b)n(y)g(the)g +(online)f(visualization)g(utilit)n(y)-7 b(.)150 3135 +y(CA)n(UTION:)25 b(Lnad.dat)g(has)g(a)f(di\013eren)n(t)i(syn)n(tax,)e +(as)h(there)g(are)f(no)h(k)n(eyw)n(ords)e(supp)r(orted,)i(but)h(the)f +(order)f(of)150 3235 y(argumen)n(ts)29 b(is)i(imp)r(ortan)n(t.)46 +b(Moreo)n(v)n(er,)29 b(only)h(the)i('#')f(c)n(haracter)e(is)h(allo)n(w) +n(ed)g(for)g(a)g(commen)n(t)h(line)g(\(this)g(is)150 +3334 y(for)26 b(historical)g(reasons)f(only)h(and)g(migh)n(t)h(b)r(e)g +(c)n(hanged)f(in)h(later)f(releases\).)35 b(Only)27 b(t)n(w)n +(o-dimenional)e(data)h(are)150 3434 y(allo)n(w)n(ed.)150 +3587 y Fi(First)32 b(non-commen)m(t)d(line:)35 b Fk(Num)n(b)r(er)28 +b(of)f(P)n(olygons)150 3740 y Fi(Then:)50 b Fk(eac)n(h)34 +b(blo)r(c)n(k)g(with)g(p)r(olygon)g(data)g(b)r(egins)g(with)h(an)f(in)n +(teger)f(v)-5 b(alue)34 b(in)h(a)f(single)g(line)g(de\014ning)h(the)150 +3840 y(n)n(um)n(b)r(er)27 b(of)h(v)n(ertices,)e(then)j(2)e +Fa(\002)g Fk(no.-of-v)n(ertices)e(co)r(ordinates)i(v)-5 +b(alues)27 b(follo)n(w.)1892 5919 y(3)p eop +%%Page: 4 4 +4 3 bop 150 390 a Fj(FILE:)38 b(T)-9 b(riang.dat)150 +543 y Fi(DESCRIPTION:)150 697 y Fk(This)29 b(\014le)g(de\014nes)g(the)g +(initial)g(triangulation.)40 b(The)29 b(coarsest)e(triangulation)h(has) +g(to)h(b)r(e)h(giv)n(en)e(b)n(y)g(the)i(user,)150 796 +y(it)e(is)g(not)f(generated)g(automattically)f(from)i(the)g(domain)f +(data.)150 950 y Fi(KEYW)m(ORDS:)p 150 1015 3587 4 v +148 1197 4 183 v 200 1079 a Fh(Keyw)n(ord)p 1410 1197 +V 962 w(Description)p 2809 1197 V 1016 w(Range)169 b(of)g(V)-6 +b(alues)2860 1170 y Fg([Default])p 3735 1197 V 150 1201 +3587 4 v 150 1217 V 148 1400 4 183 v 200 1281 a Fh(GRID)p +409 1281 24 4 v 27 w(DIMENSION)p 1410 1400 4 183 v 574 +w(Global)47 b(parameter)d(de\014ning)h(the)f(grid's)1461 +1373 y(space)27 b(dimensions.)p 2809 1400 V 2860 1281 +a(1)f(to)g(3)g Fg([2])p 3735 1400 V 150 1403 3587 4 v +148 1677 4 274 v 200 1467 a Fh(ELEMENT)p 592 1467 24 +4 v 29 w(VER)-6 b(TICES)p 1410 1677 4 274 v 451 w(Global)24 +b(parameter)e(de\014ning)g(the)g(shap)r(e)h(of)1461 1559 +y(elemen)n(ts.)50 b(In)30 b(2D)h(for)h(example,)g(3)f(is)h(tri-)1461 +1650 y(angular)27 b(mesh,)e(4)h(quadrilateral,)h(etc.)p +2809 1677 V 2860 1467 a(3)f(to)g(4...)35 b Fg([?])p 3735 +1677 V 150 1681 3587 4 v 148 1863 4 183 v 200 1745 a +Fh(NUMBER)p 554 1745 24 4 v 27 w(OF)p 691 1745 V 28 w(NODES)p +1410 1863 4 183 v 475 w(This)26 b(de\014nes)f(the)g(total)i(n)n(um)n(b) +r(er)c(of)j(no)r(des)1461 1836 y(in)g(the)f(inital)i(mesh.)p +2809 1863 V 2860 1745 a(1)103 b(to)g(in)n(teger)g(range)2860 +1836 y Fg([required])p 3735 1863 V 150 1867 3587 4 v +148 2049 4 183 v 200 1931 a Fh(NUMBER)p 554 1931 24 4 +v 27 w(OF)p 691 1931 V 28 w(EDGES)p 1410 2049 4 183 v +481 w(This)28 b(de\014nes)f(the)g(total)h(n)n(um)n(b)r(er)d(of)j(edges) +1461 2022 y(in)e(the)f(inital)i(mesh.)p 2809 2049 V 2860 +1931 a(1)103 b(to)g(in)n(teger)g(range)2860 2022 y Fg([required])p +3735 2049 V 150 2053 3587 4 v 148 2235 4 183 v 200 2117 +a Fh(NUMBER)p 554 2117 24 4 v 27 w(OF)p 691 2117 V 28 +w(ELEMENTS)p 1410 2235 4 183 v 317 w(This)39 b(de\014nes)e(the)h(total) +h(n)n(um)n(b)r(er)d(of)i(ele-)1461 2208 y(men)n(ts)25 +b(in)g(the)h(inital)g(mesh.)p 2809 2235 V 2860 2117 a(1)103 +b(to)g(in)n(teger)g(range)2860 2208 y Fg([required])p +3735 2235 V 150 2239 3587 4 v 148 2513 4 274 v 200 2302 +a Fh(DEF)p 366 2302 24 4 v 27 w(INNERITEM)p 1410 2513 +4 274 v 615 w(This)30 b(global)g(v)l(alue)f(de\014nes)f(the)h +(attribute)1461 2394 y(v)l(alue)21 b(for)h(a)f(grid)h(item)e(within)h +(the)g(domain)1461 2485 y(\(no)26 b(b)r(oundary\).)p +2809 2513 V 2860 2302 a(-)70 b(in)n(teger)h(range)h(to)e(0)2860 +2394 y Fg([required])p 3735 2513 V 150 2516 3587 4 v +148 2790 4 274 v 200 2580 a Fh(DEF)p 366 2580 24 4 v +27 w(DIRICHLETBOUND)n(AR)-6 b(Y)p 1410 2790 4 274 v 179 +w(This)30 b(global)g(v)l(alue)f(de\014nes)f(the)h(attribute)1461 +2671 y(v)l(alue)43 b(for)i(a)e(grid)h(item)f(on)g(a)h(Diric)n(hlet)1461 +2762 y(b)r(oundary)25 b(section)h(of)h(the)e(domain.)p +2809 2790 V 2860 2580 a(-)70 b(in)n(teger)h(range)h(to)e(0)2860 +2671 y Fg([required])p 3735 2790 V 150 2793 3587 4 v +148 3432 4 640 v 200 2857 a Fh(DEF)p 366 2857 24 4 v +27 w(NEUMANNBOUND)n(AR)-6 b(Y)p 1410 3432 4 640 v 207 +w(This)30 b(global)g(v)l(alue)f(de\014nes)f(the)h(attribute)1461 +2948 y(v)l(alue)39 b(for)h(a)f(grid)h(item)e(on)h(a)g(Neumann)1461 +3040 y(b)r(oundary)18 b(section)i(of)g(the)f(domain.)32 +b([Note:)1461 3131 y(p)r(erio)r(dic)42 b(b)r(oundary)e(conditions)i +(are)f(de-)1461 3222 y(\014ned)e(b)n(y)f(the)h(\(p)r(ositiv)n(e\))g +(index)f(n)n(um)n(b)r(er)1461 3314 y(of)g(the)e(corresp)r(onding)h(p)r +(erio)r(dic)h(partner)1461 3405 y(item)25 b(in)h(the)f(grid.])p +2809 3432 V 2860 2857 a(-)70 b(in)n(teger)h(range)h(to)e(0)2860 +2948 y Fg([required])p 3735 3432 V 150 3436 3587 4 v +148 3801 4 366 v 200 3500 a Fh(NODE)p 434 3500 24 4 v +27 w(INDEXNUMBER)p 1410 3801 4 366 v 401 w(De\014nes)34 +b(the)f(\(unique\))g(index)g(of)i(a)f(no)r(de.)1461 3591 +y(This)72 b(k)n(eyw)n(ord)e(o)r(ccurs)i(as)f(often)h(as)1461 +3682 y(the)58 b(v)l(alue)f(of)i(NUMBER)p 2330 3682 24 +4 v 27 w(OF)p 2467 3682 V 28 w(NODES)1461 3774 y(indicates.)p +2809 3801 4 366 v 2860 3500 a(1)103 b(to)g(in)n(teger)g(range)2860 +3591 y Fg([required])p 3735 3801 V 150 3804 3587 4 v +148 3987 4 183 v 200 3868 a Fh(NODE)p 434 3868 24 4 v +27 w(COORDINA)-6 b(TES)p 1410 3987 4 183 v 426 w(De\014nes)23 +b(a)h(blo)r(c)n(k)g(of)g(GRID)p 2284 3868 24 4 v 27 w(DIMENSION)1461 +3960 y(co)r(ordinates)j(of)g(the)e(no)r(de.)p 2809 3987 +4 183 v 2860 3868 a(-)48 b(real)h(range)g(to)g(+)f(real)2860 +3960 y(range)26 b Fg([required])p 3735 3987 V 150 3990 +3587 4 v 148 4356 4 366 v 200 4054 a Fh(EDGE)p 428 4054 +24 4 v 28 w(INDEXNUMBER)p 1410 4356 4 366 v 406 w(De\014nes)68 +b(the)g(\(unique\))f(index)h(of)h(an)1461 4146 y(edge.)85 +b(This)43 b(k)n(eyw)n(ord)e(o)r(ccurs)i(as)g(often)1461 +4237 y(as)28 b(the)f(v)l(alue)g(of)i(NUMBER)p 2335 4237 +24 4 v 27 w(OF)p 2472 4237 V 27 w(EDGES)1461 4328 y(indicates.)p +2809 4356 4 366 v 2860 4054 a(1)103 b(to)g(in)n(teger)g(range)2860 +4146 y Fg([required])p 3735 4356 V 150 4359 3587 4 v +148 4542 4 183 v 200 4423 a Fh(EDGE)p 428 4423 24 4 v +28 w(NODEINDICES)p 1410 4542 4 183 v 458 w(Tw)n(o)40 +b(indices)g(of)g(no)r(des)f(\(de\014ned)f(in)h(the)1461 +4514 y(previous)26 b(section\))g(whic)n(h)g(span)g(the)f(edge.)p +2809 4542 V 2860 4423 a(1)103 b(to)g(in)n(teger)g(range)2860 +4514 y Fg([required])p 3735 4542 V 150 4545 3587 4 v +148 4819 4 274 v 200 4609 a Fh(EDGE)p 428 4609 24 4 v +28 w(ELEMENTINDICES)p 1410 4819 4 274 v 300 w(Tw)n(o)21 +b(indices)g(of)f(elemen)n(ts)f(adjacen)n(t)i(to)f(the)1461 +4700 y(edge.)43 b(0)28 b(for)h(one)g(side)f(if)h(the)f(edge)h(is)g(at)f +(a)1461 4791 y(\(non-p)r(erio)r(dic\))e(b)r(oundary)-6 +b(.)p 2809 4819 V 2860 4609 a(1)103 b(to)g(in)n(teger)g(range)2860 +4700 y Fg([required])p 3735 4819 V 150 4822 3587 4 v +148 5187 4 366 v 200 4886 a Fh(EDGE)p 428 4886 24 4 v +28 w(BOUND)n(AR)-6 b(YCONDITION)p 1410 5187 4 366 v 95 +w(De\014nes)55 b(the)g(b)r(oundary)f(condition)h(ac-)1461 +4977 y(cording)44 b(to)g(the)f(previosly)h(de\014ned)e(v)l(al-)1461 +5069 y(ues)21 b(for)h(Diric)n(hlet,)h(Neumann,)d(or)i(p)r(erio)r(dic) +1461 5160 y(b)r(oundary)j(conditions.)p 2809 5187 V 2860 +4886 a(-)d(in)n(teger)g(range)h(to)f(+)f(in)n(te-)2860 +4977 y(ger)26 b(range)h Fg([required])p 3735 5187 V 150 +5191 3587 4 v 1892 5919 a Fk(4)p eop +%%Page: 5 5 +5 4 bop 150 390 a Fk(T)-7 b(able)27 b(con)n(tin)n(ued)p +150 455 3444 4 v 148 638 4 183 v 200 519 a Fh(Keyw)n(ord)p +1266 638 V 819 w(Description)p 2665 638 V 1016 w(Range)168 +b(of)h(V)-6 b(alues)2717 611 y Fg([Default])p 3592 638 +V 150 641 3444 4 v 150 658 V 148 1023 4 366 v 200 722 +a Fh(ELEMENT)p 592 722 24 4 v 29 w(INDEXNUMBER)p 1266 +1023 4 366 v 98 w(De\014nes)37 b(the)h(\(unique\))e(index)h(of)i(an)f +(ele-)1318 813 y(men)n(t.)500 b(This)182 b(k)n(eyw)n(ord)1318 +905 y(o)r(ccurs)33 b(as)h(often)f(as)g(the)g(v)l(alue)f(of)i(NUM-)1318 +996 y(BER)p 1486 996 24 4 v 28 w(OF)p 1624 996 V 27 w(ELEMENTS)27 +b(indicates.)p 2665 1023 4 366 v 2717 722 a(1)103 b(to)g(in)n(teger)g +(range)2717 813 y Fg([required])p 3592 1023 V 150 1027 +3444 4 v 148 1209 4 183 v 200 1091 a Fh(ELEMENT)p 592 +1091 24 4 v 29 w(NODEINDICES)p 1266 1209 4 183 v 150 +w(Three)28 b(indices)h(of)g(no)r(des)g(whic)n(h)f(span)g(the)1318 +1182 y(elemen)n(t.)p 2665 1209 V 2717 1091 a(1)103 b(to)g(in)n(teger)g +(range)2717 1182 y Fg([required])p 3592 1209 V 150 1213 +3444 4 v 148 1395 4 183 v 200 1277 a Fh(ELEMENT)p 592 +1277 24 4 v 29 w(EDGEINDICES)p 1266 1395 4 183 v 156 +w(Three)30 b(indices)h(of)g(edges)f(whic)n(h)g(span)g(the)1318 +1368 y(elemen)n(t.)p 2665 1395 V 2717 1277 a(1)103 b(to)g(in)n(teger)g +(range)2717 1368 y Fg([required])p 3592 1395 V 150 1399 +3444 4 v 148 1581 4 183 v 200 1463 a Fh(ELEMENT)p 592 +1463 24 4 v 29 w(MARKEDEDGE)p 1266 1581 4 183 v 123 w(The)28 +b(lo)r(cal)i(edge)e(n)n(um)n(b)r(er)e(that)i(is)g(mark)n(ed)1318 +1554 y(for)e(re\014nemen)n(t)e(\(b)n(y)h(bisection\).)p +2665 1581 V 2717 1463 a(1)h(to)g(3)f Fg([required])p +3592 1581 V 150 1585 3444 4 v 150 1834 a Fj(FILE:)38 +b(Windparam.dat)150 1987 y Fi(DESCRIPTION:)150 2140 y +Fk(This)28 b(\014le)f(de\014nes)h(the)g(b)r(eha)n(viour)e(of)i(FLASH)g +(when)g(it)g(comes)f(to)g(reading)g(winddata.)150 2293 +y Fi(KEYW)m(ORDS:)p 150 2359 3378 4 v 148 2541 4 183 +v 200 2423 a Fh(Keyw)n(ord)p 1200 2541 V 753 w(Description)p +2599 2541 V 1015 w(Range)169 b(of)g(V)-6 b(alues)2650 +2514 y Fg([Default])p 3525 2541 V 150 2545 3378 4 v 150 +2561 V 148 2927 4 366 v 200 2625 a Fh(X)p 263 2625 24 +4 v 27 w(PREFIX)p 1200 2927 4 366 v 670 w(This)20 b(is)g(a)g(pre\014x)f +(for)h(the)g(x-data)f(\014le)g(name.)1252 2717 y(A)35 +b(\014le)h(name)f(is)h(constructed)f(from)h([pre-)1252 +2808 y(\014x][coun)n(ter][p)r(ost\014x],)f(where)f(pre\014x)e(and)1252 +2899 y(p)r(ost\014x)25 b(can)h(b)r(e)f(empt)n(y)-6 b(.)p +2599 2927 V 2650 2625 a(c)n(haracter)19 b(string)f(of)h(length)2650 +2717 y(32)27 b Fg([no)i(default])p 3525 2927 V 150 2930 +3378 4 v 148 3113 4 183 v 200 2994 a Fh(Y)p 263 2994 +24 4 v 27 w(PREFIX)p 1200 3113 4 183 v 670 w(This)20 +b(is)g(a)g(pre\014x)f(for)h(the)g(y-data)f(\014le)g(name.)p +2599 3113 V 99 w(c)n(haracter)g(string)f(of)h(length)2650 +3085 y(32)27 b Fg([no)i(default])p 3525 3113 V 150 3116 +3378 4 v 148 3299 4 183 v 200 3180 a Fh(X)p 263 3180 +24 4 v 27 w(POSTFIX)p 1200 3299 4 183 v 621 w(This)46 +b(is)h(a)f(p)r(ost\014x)f(for)i(the)e(x-data)h(\014le)1252 +3271 y(name.)p 2599 3299 V 2650 3180 a(c)n(haracter)19 +b(string)f(of)h(length)2650 3271 y(32)27 b Fg([no)i(default])p +3525 3299 V 150 3302 3378 4 v 148 3485 4 183 v 200 3366 +a Fh(Y)p 263 3366 24 4 v 27 w(POSTFIX)p 1200 3485 4 183 +v 621 w(This)46 b(is)h(a)f(p)r(ost\014x)f(for)i(the)e(y-data)h(\014le) +1252 3457 y(name.)p 2599 3485 V 2650 3366 a(c)n(haracter)19 +b(string)f(of)h(length)2650 3457 y(32)27 b Fg([no)i(default])p +3525 3485 V 150 3488 3378 4 v 148 3670 4 183 v 200 3552 +a Fh(TIME)p 410 3552 24 4 v 28 w(F)-9 b(A)n(CTOR)p 1200 +3670 4 183 v 495 w(This)39 b(de\014nes)f(the)h(mo)r(del)f(time)g(b)r +(et)n(w)n(een)1252 3643 y(the)25 b(incremen)n(ts/)g(wind)h(data)g(up)r +(dates)p 2599 3670 V 2650 3552 a(0.0)h(to)f(real)h(range)f +Fg([?])p 3525 3670 V 150 3674 3378 4 v 148 3856 4 183 +v 200 3738 a Fh(NUMBER)p 554 3738 24 4 v 27 w(OF)p 691 +3738 V 28 w(INTER)-9 b(V)g(ALS)p 1200 3856 4 183 v 99 +w(This)58 b(de\014nes)f(the)g(incremen)n(t)f(for)i(the)1252 +3829 y(coun)n(ter)25 b(in)h(the)f(\014le)h(name)e(construction.)p +2599 3856 V 2650 3738 a(0)48 b(to)g(in)n(teger)g(range)g +Fg([no)2650 3829 y(default])p 3525 3856 V 150 3860 3378 +4 v 148 4590 4 731 v 200 3924 a Fh(UPSET)p 465 3924 24 +4 v 28 w(OF)p 603 3924 V 27 w(INTER)-9 b(V)g(ALS)p 1200 +4590 4 731 v 188 w(This)55 b(is)h(the)e(o\013set)i(for)f(the)g(\014rst) +g(\014le)1252 4015 y(coun)n(ter.)40 b(Th)n(us)28 b(a)g(x-data)f(\014le) +h(with)g(name)1252 4106 y([X)p 1336 4106 24 4 v 27 w(PREFIX][)p +Fb(n)p Fh(][X)p 1848 4106 V 29 w(POSTFIX],)c(where)h +Fb(n)1252 4198 y Fh(=)157 b(UPSET)p 1734 4198 V 28 w(OF)p +1872 4198 V 28 w(INTER)-9 b(V)g(ALS)157 b(+)1252 4289 +y Fb(k)25 b Fc(\002)e Fh(NUMBER)p 1754 4289 V 27 w(OF)p +1891 4289 V 28 w(INTER)-9 b(V)g(ALS)22 b(holds)1252 4380 +y(data)249 b(for)i(the)e(mo)r(del)1252 4472 y(time)31 +b Fb(k)j Fc(\002)e Fh(NUMBER)p 1953 4472 V 27 w(OF)p +2090 4472 V 28 w(INTER)-9 b(V)g(ALS)1252 4563 y Fc(\002)25 +b Fh(TIME)p 1547 4563 V 28 w(F)-9 b(A)n(CTOR.)p 2599 +4590 4 731 v 2650 3924 a(0)48 b(to)g(in)n(teger)g(range)g +Fg([no)2650 4015 y(default])p 3525 4590 V 150 4594 3378 +4 v 148 4868 4 274 v 200 4658 a Fh(X)p 263 4658 24 4 +v 27 w(NUMBER)p 639 4658 V 27 w(OF)p 776 4658 V 28 w(POINTS)p +1200 4868 4 274 v 157 w(Num)n(b)r(er)22 b(of)i(p)r(oin)n(ts)h(in)f +(x-direction.)33 b(Wind)1252 4749 y(data)21 b(are)h(assumed)f(to)g(b)r +(e)g(giv)n(en)g(on)g(a)h(rect-)1252 4840 y(angular)k(uniform)f(grid.)p +2599 4868 V 2650 4658 a(0)48 b(to)g(in)n(teger)g(range)g +Fg([no)2650 4749 y(default])p 3525 4868 V 150 4871 3378 +4 v 148 5145 4 274 v 200 4935 a Fh(Y)p 263 4935 24 4 +v 27 w(NUMBER)p 639 4935 V 27 w(OF)p 776 4935 V 28 w(POINTS)p +1200 5145 4 274 v 157 w(Num)n(b)r(er)22 b(of)i(p)r(oin)n(ts)h(in)f +(x-direction.)33 b(Wind)1252 5026 y(data)21 b(are)h(assumed)f(to)g(b)r +(e)g(giv)n(en)g(on)g(a)h(rect-)1252 5118 y(angular)k(uniform)f(grid.)p +2599 5145 V 2650 4935 a(0)48 b(to)g(in)n(teger)g(range)g +Fg([no)2650 5026 y(default])p 3525 5145 V 150 5148 3378 +4 v 1892 5919 a Fk(5)p eop +%%Page: 6 6 +6 5 bop 150 390 a Fk(T)-7 b(able)27 b(con)n(tin)n(ued)p +150 455 3118 4 v 148 638 4 183 v 200 519 a Fh(Keyw)n(ord)p +941 638 V 493 w(Description)p 2340 638 V 1016 w(Range)169 +b(of)g(V)-6 b(alues)2391 611 y Fg([Default])p 3266 638 +V 150 641 3118 4 v 150 658 V 148 1115 4 457 v 200 722 +a Fh(X)p 263 722 24 4 v 27 w(SCALE)p 546 722 V 28 w(F)d(A)n(CTOR)p +941 1115 4 457 v 99 w(A)23 b(scaling)h(factor)h(de\014ning)d(the)g +(mesh)g(size.)992 813 y(When)27 b(wind)h(is)g(giv)n(en)g(in)f(meters)g +(p)r(er)h(sec-)992 905 y(ond,)g(then)f(the)g(scaling)i(factor)g(is)f +(just)g(the)992 996 y(grid)d(spacing)g(for)g(the)e(rectangular)i(grid)g +(in)992 1087 y(meters.)p 2340 1115 V 2391 722 a(0.0)60 +b(to)f(real)h(range)f Fg([no)2391 813 y(default])p 3266 +1115 V 150 1118 3118 4 v 148 1301 4 183 v 200 1182 a +Fh(Y)p 263 1182 24 4 v 27 w(SCALE)p 546 1182 V 28 w(F)-9 +b(A)n(CTOR)p 941 1301 4 183 v 99 w(The)26 b(analog)i(of)e(X)p +1544 1182 24 4 v 27 w(SCALE)p 1827 1182 V 28 w(F)-9 b(A)n(CTOR)26 +b(for)992 1273 y(the)g(y-direction.)p 2340 1301 4 183 +v 2391 1182 a(0.0)60 b(to)f(real)h(range)f Fg([no)2391 +1273 y(default])p 3266 1301 V 150 1304 3118 4 v 150 1553 +a Fj(FILE:)38 b(Initial.dat)150 1706 y Fi(DESCRIPTION:)150 +1860 y Fk(This)28 b(\014le)f(de\014nes)h(in)g(a)f(crude)g(w)n(a)n(y)-7 +b(,)27 b(where)g(to)g(initialize)h(a)f(tracer.)150 2013 +y Fi(KEYW)m(ORDS:)p 150 2078 3448 4 v 148 2261 4 183 +v 200 2142 a Fh(Keyw)n(ord)p 1271 2261 V 823 w(Description)p +2669 2261 V 1016 w(Range)168 b(of)i(V)-6 b(alues)2721 +2233 y Fg([Default])p 3596 2261 V 150 2264 3448 4 v 150 +2281 V 148 2463 4 183 v 200 2345 a Fh(CIR)n(CLES)p 541 +2345 24 4 v 27 w(INPUT)p 1271 2463 4 183 v 508 w(Has)20 +b(no)f(v)l(alue)g(and)f(is)i(required.)32 b(Don't)19 +b(ask)1322 2436 y(for)27 b(more)e(explanations.)p 2669 +2463 V 3596 2463 V 150 2467 3448 4 v 148 2649 4 183 v +200 2531 a(NUMBER)p 554 2531 24 4 v 27 w(OF)p 691 2531 +V 28 w(CIR)n(CLES)p 1271 2649 4 183 v 272 w(This)39 b(is)f(the)g(n)n +(um)n(b)r(er)e(of)i(initial)h(circular)1322 2622 y(concen)n(trations.)p +2669 2649 V 2721 2531 a(0)48 b(to)g(in)n(teger)g(range)g +Fg([no)2721 2622 y(default])p 3596 2649 V 150 2653 3448 +4 v 148 3018 4 366 v 200 2717 a Fh(CIR)n(CLE)p 498 2717 +24 4 v 28 w(COORDINA)-6 b(TES)p 1271 3018 4 366 v 222 +w(This)23 b(blo)r(c)n(k)f(of)h(t)n(w)n(o)g(co)r(ordinate)h(v)l(alues)e +(de-)1322 2808 y(\014nes)46 b(the)g(cen)n(ter)f(of)i(the)f(circle.)97 +b(This)1322 2899 y(k)n(eyw)n(ord)58 b(o)r(ccurs)i(as)f(often)g(as)g +(NUM-)1322 2991 y(BER)p 1490 2991 24 4 v 28 w(OF)p 1628 +2991 V 27 w(CIR)n(CLES)26 b(indicates.)p 2669 3018 4 +366 v 2721 2717 a(-)48 b(real)h(range)g(to)g(+)f(real)2721 +2808 y(range)26 b Fg([no)k(default])p 3596 3018 V 150 +3021 3448 4 v 148 3204 4 183 v 200 3085 a Fh(CIR)n(CLE)p +498 3085 24 4 v 28 w(DIAMETER)p 1271 3204 4 183 v 370 +w(De\014nes)25 b(the)h(diameter)f(of)h(the)g(circle.)p +2669 3204 V 263 w(0.0)36 b(to)f(+)g(real)h(range)g Fg([no)2721 +3177 y(default])p 3596 3204 V 150 3207 3448 4 v 148 3390 +4 183 v 200 3271 a Fh(CIR)n(CLE)p 498 3271 24 4 v 28 +w(CONCENTRA)-6 b(TION)p 1271 3390 4 183 v 98 w(This)22 +b(de\014nes)e(the)g(initial)i(concen)n(tration)f(of)1322 +3362 y(the)k(tracer.)p 2669 3390 V 2721 3271 a(0.0)36 +b(to)f(+)g(real)h(range)g Fg([no)2721 3362 y(default])p +3596 3390 V 150 3393 3448 4 v 2544 3632 a Fk(J"orn)26 +b(Behrens,)h(Marc)n(h)f(20,)h(1998)1892 5919 y(6)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/flash2d/doc/README b/flash2d/doc/README new file mode 100644 index 0000000000000000000000000000000000000000..c13a87e888fc589864800a71a6f625999876eabf --- /dev/null +++ b/flash2d/doc/README @@ -0,0 +1,30 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/doc" + +README - this file +sources - Directory containing the editable sources to some ps files +Dataflow.eps - Diagram showing the main dataflow structure +Datastruct.eps - Grid data structure (nodes, edges, elements) +GridFlow.ps - Flow Diagrams of the main routines +InputDok.ps - Input file formats for FLASH +Triang.ps - Initial triangulation example +grids.ps - grids, distorted grids nd their duals +netcdf.doc - some remarks on netcdf +para-grid.eps - Idea of the parallel grid generator +structure.ps - Main structure of cfiles.c (graphics) + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +enjoy the documentation as it is... :-) + +************************************************************************** + j. behrens, 3/99 +************************************************************************** diff --git a/flash2d/doc/Triang.ps b/flash2d/doc/Triang.ps new file mode 100644 index 0000000000000000000000000000000000000000..d8cddb67954361d45c5dad2285c7b649236dc6bd --- /dev/null +++ b/flash2d/doc/Triang.ps @@ -0,0 +1,922 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%BoundingBox: 193 366 455 704 +%%Title: /tmpdir/jbehrens/JB-Local/Flash/doc/Triang.ps +%%CreationDate: 1:29 PM December 15, 1997 +%%Pages: 1 +%%EndComments +%%BeginProlog +%%BeginResource ShowcaseResource +1 setlinejoin +/M { moveto } bind def /S { show } bind def +/R { rmoveto } bind def /L { lineto } bind def +/B { newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath } bind def +/CS { closepath stroke } bind def +/S { + /fixwidth exch def + dup length /nchars exch def + dup stringwidth pop + fixwidth exch sub nchars div + exch 0 exch ashow +} def +/bwproc { + rgbproc + dup length 3 idiv string 0 3 0 + 5 -1 roll { + add 2 1 roll 1 sub dup 0 eq + { pop 3 idiv 3 -1 roll dup 4 -1 roll dup + 3 1 roll 5 -1 roll put 1 add 3 0 } + { 2 1 roll } ifelse + } forall + pop pop pop +} def +systemdict /colorimage known not { + /colorimage { + pop + pop + /rgbproc exch def + { bwproc } image + } def +} if +1 1 scale +0 setlinewidth +/drawtri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +stroke +} bind def +/filltri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +fill +} bind def +/cliptri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +clip +} bind def +/imgscanrgb { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx 3 mul string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +false 3 +colorimage +grestore +} bind def +/imgscanbw { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +image +grestore +} bind def +/showcaseisoencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft +/bar /braceright /asciitilde /guilsinglright +/fraction /florin /quotesingle /quotedblleft +/guilsinglleft /fi /fl /endash +/dagger /daggerdbl /bullet /quotesinglbase +/quotedblbase /quotedblright /ellipsis /trademark +/dotlessi /grave /acute /circumflex +/tilde /macron /breve /dotaccent +/dieresis /perthousand /ring /cedilla +/Ydieresis /hungarumlaut /ogonek /caron +/emdash /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis ] def +/showcasedingbatencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /a1 /a2 /a202 /a3 /a4 /a5 /a119 /a118 /a117 +/a11 /a12 /a13 /a14 /a15 /a16 /a105 /a17 /a18 /a19 +/a20 /a21 /a22 /a23 /a24 /a25 /a26 /a27 /a28 /a6 /a7 +/a8 /a9 /a10 /a29 +/a30 /a31 /a32 /a33 /a34 /a35 /a36 /a37 /a38 /a39 +/a40 /a41 /a42 /a43 /a44 /a45 /a46 /a47 /a48 /a49 +/a50 /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 /a59 +/a60 /a61 /a62 /a63 /a64 /a65 /a66 /a67 /a68 /a69 +/a70 /a71 /a72 /a73 /a74 /a203 /a75 /a204 /a76 /a77 /a78 +/a79 /a81 /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef +/a205 /a85 /a206 /a86 /a87 /a88 /a89 /a90 /a91 /a92 /a93 +/a94 /a95 /a96 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 +/a112 /a111 /a110 /a109 +/a120 /a121 /a122 /a123 /a124 /a125 /a126 /a127 /a128 /a129 +/a130 /a131 /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 +/a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 /a148 /a149 +/a150 /a151 /a152 /a153 /a154 /a155 /a156 /a157 /a158 /a159 +/a160 /a161 /a163 /a164 /a196 /a165 /a192 /a166 /a167 /a168 +/a169 /a170 /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 +/a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 /.notdef +/a201 /a183 /a184 /a197 /a185 /a194 /a198 /a186 /a195 /a187 +/a188 /a189 /a190 /a191 /.notdef +] def +/newfont 10 dict def +newfont begin + + /FontType 3 def + /FontMatrix [1 0 0 1 0 0] def + /FontBBox [0 0 1 1] def + /Encoding 256 array def + 0 1 255 {Encoding exch /.notdef put} for + + /CharProcs 1 dict def + CharProcs begin + /.notdef {} def + +end + + /BuildChar { + 1 0 + 0 0 1 1 + setcachedevice + exch begin + Encoding exch get + CharProcs exch get + end + exec + } def +end +/PatternFont newfont definefont pop + +%%EndResource +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: label 1 +gsave +/saveit save def +gsave +gsave +matrix currentmatrix +[255.333 0 0 -255.333 193.667 685.333] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +193.667 685.333 M +449 430 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +449 685.333 M +194.333 430 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 224.5 406] concat +newpath +0 0 M 0 14 L 44 14 L 44 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +222.5 404 M 222.5 422 L 270.5 422 L 270.5 404 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 224.5 406] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (Nodes) 42 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 194 411.164] concat +newpath +0 0 M 0 14 L 10.4 14 L 10.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +192 409.164 M 192 427.164 L 206.4 427.164 L 206.4 409.164 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 194 411.164] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (1) 8.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 444 410.497] concat +newpath +0 0 M 0 14 L 10.4 14 L 10.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +442 408.497 M 442 426.497 L 456.4 426.497 L 456.4 408.497 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 444 410.497] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (2) 8.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 0.999996 444 689.167] concat +newpath +0 0 M 0 14 L 10.4 14 L 10.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +442 687.167 M 442 705.167 L 456.4 705.167 L 456.4 687.167 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 0.999996 444 689.167] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (3) 8.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 194 689.167] concat +newpath +0 0 M 0 14 L 10.4 14 L 10.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +192 687.167 M 192 705.167 L 206.4 705.167 L 206.4 687.167 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 194 689.167] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (4) 8.4 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 224.5 388.365] concat +newpath +0 0 M 0 14 L 44.014 14 L 44.014 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +222.5 386.365 M 222.5 404.835 L 270.514 404.835 L 270.514 386.365 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 224.5 388.365] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (Edges) 42.014 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 321.833 436.031] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +319.833 434.031 M 319.833 452.502 L 333.617 452.502 L 333.617 434.031 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 321.833 436.031] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (1) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 434.5 555.531] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +432.5 553.531 M 432.5 572.002 L 446.284 572.002 L 446.284 553.531 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 434.5 555.531] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (2) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 317.667 664.195] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +315.667 662.195 M 315.667 680.666 L 329.451 680.666 L 329.451 662.195 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 317.667 664.195] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (3) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 202.667 549.531] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +200.667 547.531 M 200.667 566.002 L 214.451 566.002 L 214.451 547.531 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 202.667 549.531] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (4) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 385.167 495.031] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +383.167 493.031 M 383.167 511.502 L 396.951 511.502 L 396.951 493.031 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 385.167 495.031] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (5) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 369.167 616.031] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +367.167 614.031 M 367.167 632.502 L 380.951 632.502 L 380.951 614.031 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 369.167 616.031] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (6) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 250.333 602.859] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +248.333 600.859 M 248.333 619.33 L 262.117 619.33 L 262.117 600.859 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 250.333 602.859] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (7) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 256.333 477.195] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +254.333 475.195 M 254.333 493.666 L 268.117 493.666 L 268.117 475.195 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 256.333 477.195] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (8) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 225.167 368.362] concat +newpath +0 0 M 0 14 L 60.352 14 L 60.352 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +223.167 366.362 M 223.167 384.833 L 287.519 384.833 L 287.519 366.362 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 225.167 368.362] concat +/Helvetica-Oblique-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (Elements) 58.352 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 320 471.529] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +318 469.529 M 318 487.999 L 331.784 487.999 L 331.784 469.529 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 320 471.529] concat +/Helvetica-Oblique-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (1) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 388 552.195] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +386 550.195 M 386 568.666 L 399.784 568.666 L 399.784 550.195 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 388 552.195] concat +/Helvetica-Oblique-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (2) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 317.333 628.859] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +315.333 626.859 M 315.333 645.33 L 329.117 645.33 L 329.117 626.859 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 317.333 628.859] concat +/Helvetica-Oblique-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (3) 7.784 S +setmatrix +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 242 552.195] concat +newpath +0 0 M 0 14 L 9.784 14 L 9.784 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +240 550.195 M 240 568.666 L 253.784 568.666 L 253.784 550.195 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 242 552.195] concat +/Helvetica-Oblique-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (4) 7.784 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +229.5 366.833 M +224.625 367.958 L +222 371.333 L +221.5 374.833 L +221.5 374.833 L +221.5 374.833 L +221.5 374.833 L +222.625 379.708 L +226 382.333 L +229.5 382.833 L +229.5 382.833 L +230.237 382.833 L +231.977 382.833 L +234.571 382.833 L +237.875 382.833 L +241.741 382.833 L +246.023 382.833 L +250.575 382.833 L +255.25 382.833 L +259.901 382.833 L +264.383 382.833 L +268.548 382.833 L +272.25 382.833 L +275.343 382.833 L +277.68 382.833 L +279.114 382.833 L +279.5 382.833 L +279.5 382.833 L +284.375 381.708 L +287 378.333 L +287.5 374.833 L +287.5 374.833 L +287.5 374.833 L +287.5 374.833 L +286.375 369.958 L +283 367.333 L +279.5 366.833 L +279.5 366.833 L +278.785 366.833 L +277.105 366.833 L +274.6 366.833 L +271.406 366.833 L +267.662 366.833 L +263.504 366.833 L +259.071 366.833 L +254.5 366.833 L +249.929 366.833 L +245.496 366.833 L +241.338 366.833 L +237.594 366.833 L +234.4 366.833 L +231.895 366.833 L +230.215 366.833 L +229.5 366.833 L +closepath +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +323.667 470.667 M +318.894 471.838 L +316.576 475.353 L +316.333 477.667 L +316.333 477.667 L +316.333 479 L +316.333 479 L +317.561 483.556 L +321.242 485.769 L +323.667 486 L +323.667 486 L +323.667 486 L +323.667 486 L +328.439 484.828 L +330.758 481.314 L +331 479 L +331 479 L +331 477.667 L +331 477.667 L +329.773 473.111 L +326.091 470.898 L +323.667 470.667 L +323.667 470.667 L +323.791 470.667 L +closepath +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +391.667 550.667 M +386.894 551.838 L +384.576 555.353 L +384.333 557.667 L +384.333 557.667 L +384.333 559 L +384.333 559 L +385.561 563.556 L +389.242 565.769 L +391.667 566 L +391.667 566 L +391.667 566 L +391.667 566 L +396.439 564.829 L +398.758 561.314 L +399 559 L +399 559 L +399 557.667 L +399 557.667 L +397.773 553.111 L +394.091 550.898 L +391.667 550.667 L +391.667 550.667 L +391.791 550.667 L +closepath +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +321 628 M +316.227 629.172 L +313.909 632.686 L +313.667 635 L +313.667 635 L +313.667 636.333 L +313.667 636.333 L +314.894 640.889 L +318.576 643.102 L +321 643.333 L +321 643.333 L +321 643.333 L +321 643.333 L +325.773 642.162 L +328.091 638.647 L +328.333 636.333 L +328.333 636.333 L +328.333 635 L +328.333 635 L +327.106 630.444 L +323.424 628.231 L +321 628 L +321 628 L +321.124 628 L +closepath +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +newpath +246.333 550.667 M +241.561 551.838 L +239.242 555.353 L +239 557.667 L +239 557.667 L +239 559 L +239 559 L +240.227 563.556 L +243.909 565.769 L +246.333 566 L +246.333 566 L +246.333 566 L +246.333 566 L +251.106 564.829 L +253.424 561.314 L +253.667 559 L +253.667 559 L +253.667 557.667 L +253.667 557.667 L +252.439 553.111 L +248.758 550.898 L +246.333 550.667 L +246.333 550.667 L +246.457 550.667 L +closepath +stroke +grestore +gsave +gsave +matrix currentmatrix +[0.951923 0 0 1 317 536] concat +newpath +0 0 M 0 14 L 10.4 14 L 10.4 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +315.096 534 M 315.096 552 L 328.804 552 L 328.804 534 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[0.951923 0 0 1 317 536] concat +/Courier-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 3.5 M (5) 8.4 S +setmatrix +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +[2] 0 setdash +newpath +201 433.5 M +442.5 433.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +[2] 0 setdash +newpath +201.5 681.5 M +443 681.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +[2] 0 setdash +newpath +197.5 678 M +197.5 436.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +[2] 0 setdash +newpath +446 679 M +446 437.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +1.000000 setlinewidth +[2] 0 setdash +newpath +312 413 M +346 413 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 352 406.5] concat +newpath +0 0 M 0 14 L 83.704 14 L 83.704 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +350 404.5 M 350 422.971 L 437.704 422.971 L 437.704 404.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 352 406.5] concat +/Helvetica-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (marked edge) 81.704 S +setmatrix +grestore +grestore +showpage +saveit restore +grestore +%%EOF diff --git a/flash2d/doc/flash.png b/flash2d/doc/flash.png new file mode 100644 index 0000000000000000000000000000000000000000..c2ec60c772065d0a44de01b1d13d38f3e67ef50a Binary files /dev/null and b/flash2d/doc/flash.png differ diff --git a/flash2d/doc/grids.ps b/flash2d/doc/grids.ps new file mode 100644 index 0000000000000000000000000000000000000000..e494720fd2197e95972028773e84e495efeedb8a --- /dev/null +++ b/flash2d/doc/grids.ps @@ -0,0 +1,337 @@ +%!PS-Adobe-2.0 +%%Title: grids.ps +%%Creator: fig2dev Version 3.2 Patchlevel 1 +%%CreationDate: Wed Aug 19 11:39:22 1998 +%%For: behrens@sunbornemann3 (Joern Behrens) +%%Orientation: Portrait +%%BoundingBox: 160 136 435 706 +%%Pages: 1 +%%BeginSetup +%%IncludeFeature: *PageSize A4 +%%EndSetup +%%Magnification: 1.0000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +133.0 762.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +10 setmiterlimit +n -1000 10928 m -1000 -1000 l 5781 -1000 l 5781 10928 l cp clip + 0.06299 0.06299 sc +%%Page: 1 1 +% Polyline +7.500 slw +n 3153 1186 m 3153 1411 l 2928 1636 l 2703 1636 l gs col0 s gr +% Polyline +n 2928 1636 m 3153 1861 l 3153 2311 l 2928 2536 l 2703 2536 l gs col0 s gr +% Polyline +n 2928 2536 m 3153 2761 l 3153 2986 l gs col0 s gr +% Polyline +n 3153 2761 m 3378 2536 l 3873 2716 l 4053 2986 l gs col0 s gr +% Polyline +n 3873 2716 m 4233 2356 l 4503 2536 l gs col0 s gr +% Polyline +n 4233 2356 m 4233 1816 l 4503 1636 l gs col0 s gr +% Polyline +n 4233 1816 m 3873 1456 l 4053 1186 l gs col0 s gr +% Polyline +n 3153 1411 m 3378 1636 l 3873 1456 l gs col0 s gr +% Polyline +n 3378 1636 m 3153 1861 l gs col0 s gr +% Polyline +n 3153 2311 m 3378 2536 l gs col0 s gr +% Polyline +n 2703 4786 m 2928 4786 l 3153 5011 l 3153 5236 l gs col0 s gr +% Polyline +n 3153 5011 m 3378 4786 l 3828 4786 l 4053 5011 l 4053 5236 l gs col0 s gr +% Polyline +n 4053 5011 m 4278 4786 l 4503 4786 l gs col0 s gr +% Polyline +n 4278 4786 m 4053 4561 l 4233 4066 l 4503 3886 l gs col0 s gr +% Polyline +n 4233 4066 m 3873 3706 l 4053 3436 l gs col0 s gr +% Polyline +n 3873 3706 m 3333 3706 l 3153 3436 l gs col0 s gr +% Polyline +n 3333 3706 m 2973 4066 l 2703 3886 l gs col0 s gr +% Polyline +n 2928 4786 m 3153 4561 l 2973 4066 l gs col0 s gr +% Polyline +n 3153 4561 m 3378 4786 l gs col0 s gr +% Polyline +n 3828 4786 m 4053 4561 l gs col0 s gr +% Polyline +n 453 3436 m 453 5236 l 1353 4336 l 453 3436 l cp gs col0 s gr +% Polyline +n 453 4336 m 1353 4336 l gs col0 s gr +% Polyline +n 1353 4336 m 1353 3436 l gs col0 s gr +% Polyline +n 1353 4336 m 2253 4336 l gs col0 s gr +% Polyline +n 1353 4336 m 1353 5236 l gs col0 s gr +% Polyline +n 453 4336 m 1353 5236 l gs col0 s gr +% Polyline +n 2253 4336 m 1353 5236 l gs col0 s gr +% Polyline +n 2253 3436 m 453 3436 l 1353 4336 l 2253 3436 l cp gs col0 s gr +% Polyline +n 453 5236 m 2253 5236 l 1353 4336 l 453 5236 l cp gs col0 s gr +% Polyline +n 2253 5236 m 2253 3436 l 1353 4336 l 2253 5236 l cp gs col0 s gr +% Polyline +n 2253 2986 m 2253 1186 l 1353 2086 l 2253 2986 l cp gs col0 s gr +% Polyline +n 453 1186 m 453 2986 l 1353 2086 l 453 1186 l cp gs col0 s gr +% Polyline +n 453 2986 m 2253 2986 l 1353 2086 l 453 2986 l cp gs col0 s gr +% Polyline +n 2253 1186 m 453 1186 l 1353 2086 l 2253 1186 l cp gs col0 s gr +% Polyline +n 453 2086 m 1353 2086 l gs col0 s gr +% Polyline +n 1353 2086 m 1353 1186 l gs col0 s gr +% Polyline +n 1353 2086 m 2253 2086 l gs col0 s gr +% Polyline +n 1353 2086 m 1353 2986 l gs col0 s gr +% Polyline +n 1353 1186 m 453 2086 l gs col0 s gr +% Polyline +n 453 2086 m 1353 2986 l gs col0 s gr +% Polyline +n 543 5596 m 633 6586 l 1083 6136 l 543 5596 l cp gs col0 s gr +% Polyline +n 1443 5596 m 2343 5506 l 1623 6586 l cp gs col0 s gr +% Polyline +n 1623 6586 m 2523 6586 l 2343 5506 l cp gs col0 s gr +% Polyline +n 2523 6586 m 2433 7666 l 1623 6586 l cp gs col0 s gr +% Polyline +n 1623 6586 m 1533 7666 l 2433 7666 l cp gs col0 s gr +% Polyline +n 1623 6586 m 1083 6136 l 633 6586 l cp gs col0 s gr +% Polyline +n 633 6586 m 543 7666 l 993 7126 l cp gs col0 s gr +% Polyline +n 993 7126 m 543 7666 l 1533 7666 l cp gs col0 s gr +% Polyline +n 1533 7666 m 1623 6586 l 993 7126 l cp gs col0 s gr +% Polyline +n 543 5596 m 1443 5596 l 1083 6136 l cp gs col0 s gr +% Polyline +n 1083 6136 m 1623 6586 l 1443 5596 l cp gs col0 s gr +% Polyline +n 993 9376 m 1533 9916 l 543 9916 l cp gs col0 s gr +% Polyline +n 1443 7846 m 2343 7756 l 1623 8836 l cp gs col0 s gr +% Polyline +n 2523 8836 m 2433 9916 l 1983 9376 l cp gs col0 s gr +% Polyline +n 543 9916 m 993 9376 l 633 8836 l cp gs col0 s gr +% Polyline +n 543 7846 m 1623 8836 l 1443 7846 l cp gs col0 s gr +% Polyline +n 543 7846 m 633 8836 l 1623 8836 l cp gs col0 s gr +% Polyline +n 1623 8836 m 2343 7756 l 2523 8836 l cp gs col0 s gr +% Polyline +n 1623 8836 m 633 8836 l 993 9376 l cp gs col0 s gr +% Polyline +n 1983 9376 m 2433 9916 l 1533 9916 l cp gs col0 s gr +% Polyline +n 1533 9916 m 1983 9376 l 1623 8836 l cp gs col0 s gr +% Polyline +n 2804 6069 m 2991 6095 l 3242 5818 l 3216 5570 l gs col0 s gr +% Polyline +n 2999 6099 m 3284 6384 l 3254 6770 l 2965 7067 l 2796 7097 l gs col0 s gr +% Polyline +n 2965 7078 m 3205 7412 l 3246 7633 l gs col0 s gr +% Polyline +n 3212 7419 m 3554 7127 l 4060 7318 l 4214 7637 l gs col0 s gr +% Polyline +n 4067 7325 m 4412 6875 l 4679 7097 l gs col0 s gr +% Polyline +n 4416 6875 m 4405 6234 l 4634 6017 l gs col0 s gr +% Polyline +n 4409 6238 m 3974 5825 l 4116 5525 l gs col0 s gr +% Polyline +n 3974 5833 m 3561 6084 l 3246 5822 l gs col0 s gr +% Polyline +n 3554 6092 m 3284 6384 l gs col0 s gr +% Polyline +n 3257 6774 m 3554 7127 l gs col0 s gr +% Polyline +n 3291 7829 m 3437 8084 l 3130 8481 l 2834 8309 l gs col0 s gr +% Polyline +n 3130 8485 m 3291 9029 l 2999 9325 l 2826 9392 l gs col0 s gr +% Polyline +n 2999 9332 m 3254 9662 l 3310 9887 l gs col0 s gr +% Polyline +n 3261 9666 m 3599 9385 l 3981 9362 l 4240 9677 l 4247 9884 l gs col0 s gr +% Polyline +n 4247 9681 m 4532 9374 l 4716 9366 l gs col0 s gr +% Polyline +n 4532 9370 m 4251 9010 l 4412 8466 l 4671 8275 l gs col0 s gr +% Polyline +n 4412 8474 m 4026 8084 l 4116 7780 l gs col0 s gr +% Polyline +n 4022 8084 m 3449 8087 l gs col0 s gr +% Polyline +n 3291 9032 m 3599 9374 l gs col0 s gr +% Polyline +n 3989 9362 m 4247 9014 l gs col0 s gr +% Polyline + [60] 0 sd +n 453 1186 m 543 1006 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 1186 m 1443 1006 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 1186 m 2343 916 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 903 1636 m 1083 1546 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 2086 m 1623 1996 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 2086 m 2523 1996 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 453 2086 m 633 1996 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 903 2536 m 993 2536 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 453 2986 m 543 3076 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 2986 m 1533 3076 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 2986 m 2433 3076 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 453 3436 m 543 3256 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 453 4336 m 633 4246 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 453 5236 m 543 5326 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 903 4786 m 993 4786 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 3436 m 1443 3256 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 4336 m 1623 4246 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1353 5236 m 1533 5326 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 5236 m 2433 5326 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 4336 m 2523 4246 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 2253 3436 m 2343 3166 l gs col0 s gr [] 0 sd +% Polyline + [60] 0 sd +n 1803 4786 m 1983 4786 l gs col0 s gr [] 0 sd +% Polyline +n 2700 1187 m 4500 1187 l 4500 2987 l 2700 2987 l cp gs col0 s gr +% Polyline +n 2700 3435 m 4500 3435 l 4500 5235 l 2700 5235 l cp gs col0 s gr +% Polyline +n 2748 5567 m 2838 6553 l 2748 7637 l 4642 7637 l 4731 6549 l 4555 5477 l + 3648 5563 l cp gs col0 s gr +% Polyline +n 2786 7822 m 2876 8808 l 2786 9892 l 4680 9892 l 4769 8804 l 4593 7732 l + 3686 7818 l cp gs col0 s gr +$F2psEnd +rs +showpage diff --git a/flash2d/doc/mainpage.txt b/flash2d/doc/mainpage.txt new file mode 100644 index 0000000000000000000000000000000000000000..e24e7dc31008358494f260618e36ce4af0e61b89 --- /dev/null +++ b/flash2d/doc/mainpage.txt @@ -0,0 +1,38 @@ +/** + +@mainpage Introduction + +<tt><b>Flash2d</b></tt> - a Flexible and Adaptive Semi-Lagrangian Hack - is the original +adaptive advection software, based on the grid generation +library <tt><b>amatos</b></tt>. It was implemented in the late 1990ies to demonstrate and +test adaptive semi-Lagrangian advection schemes for further usage in non-linear (shallow +water equation) solvers for atmospheric and oceanic applications. A publication describing +the main functionality (where the results of that publication were generated with a +predecessor of <tt><b>Flash2d</b></tt>, called <tt><b>STASL</b></tt>) can be found in +\cite Behrens1996. + +<tt><b>Flash2d</b></tt> solves the linear advection equation in a Cartesian or spherical domain. +\f[ + \frac{d \rho}{d t} = r(\rho), +\f] +where \f$\rho\f$ is a (possibly multi-component) constituent that is advected and +\f[ + \frac{d \rho}{d t} = \frac{\partial \rho}{\partial t}+ \vec{v}\frac{\partial \rho}{\partial x} +\f] +is the material (or total) derivative. In <tt><b>Flash2d</b></tt> there are a number of +conservative semi-Lagrangian methods implemented, as described in \cite Behrens2006. + +The method uses an adaptively refined mesh, generated by the mesh generation library +<tt><b>amatos</b></tt> \cite Behrens2005. During run-time the sea surface anomaly is +monitored and the mesh is refined, whenever the sea surface height exceeds a given +threshold. Other refinement criteria can also be employed. + + +### Acknowledgements ### + +The original implementation was solely achieved by J. Behrens. Extension in terms of conservative +semi-Lagrangian methods were introduced by L. Mentrup. Further development regarding meshless +methods was performed by F. Klaschka. S. Reinert introduced an oil dispersion module. S. Paruszewski +extended the pure advection code to also solve non-linear shallow water equations. + +*/ diff --git a/flash2d/doc/modifikationen.txt b/flash2d/doc/modifikationen.txt new file mode 100644 index 0000000000000000000000000000000000000000..bd67710440437ca49d040fd092ed8c99f9053729 --- /dev/null +++ b/flash2d/doc/modifikationen.txt @@ -0,0 +1,126 @@ + +Stand 14.10.99 + +Ziemlich viel ausprobiert habe ich an folgenden routinen/funktionen + + +*) FEM_interpolation.f90, function estmt_gradient + + Schleife neu strukturiert (gute "ubung, um datenstrukturen und + vorgehensweisen nachzuvollziehen), pointer-zuweisungen ersetzt + durch direktes rausschreiben der ben"otigeten daten. + + Performancegewinn durch bessere cachenutzung und eingesparte + operationen (gilt auch f"ur andere routinen, siehe unten. Effekt + auf der t3e deutlich. Das ging so schritt f"ur schritt, ich muss + mal mit der originalversion vergleichen. W"urde sch"atzen, das + ganze modell ist jetzt in etwa doppelt so schnell.) + + +*) GRID_api.f90, function grid_domaincheck + + Ebenfalls: direktes "ubernehmen der daten statt pointer. + + +*) FEM_utils.f90, function in_out + + Pointer: s.o. Die berechnung der vier dreiecksfl"achen ist + zusammengefasst, um rechenoperationen zu sparen. (Kein aufruf von + dcalc_area mehr) + Alternativ (auskommentiert): entscheidung durch vergleich punkt + links-rechts bzgl aller dreiecksseiten (Das klappt, wenn man bei + der urspr. triangulierung darauf achtet, alle kanten von elementen + gegen den urzeigersinn anzugeben. Der gittergenerator erh"alt diese + eigenschaft) + + +*) GRID_api.f90, function grid_coordvalue + + Hier wird zu anfang gecheckt, ob der punkt im inneren des gebietes + liegt (grid_domaincheck). Bei aufruf von slm_interpolate aus ist die + antwort aber bereits bekannt, grid_domaincheck zuvor aufgerufen + worden. Also: ist das ergebnis bekannt, kann es grid_coordvalue + "ubergeben werden. + + SLM_interpolation.f90, subroutine slm_interpolate, + SLM_interpolation.clip, subroutine slm_interpolate + + Aufruf von grid_coordvalue entsprechend erg"anzt. + + +*) FEM_utils.f90, function edge_intersect + (auf englisch, weil ich irgendwann angefangen habe, meinen + schmierzettel-file auf englisch zu schreiben) + + Check, wether the nodes of the boundary edge lay on the same side + of the line r_check--r_outer => no intersection. In the same way: + r_check, r_outer on the same side of the boundary edge => no + intersection. + + These tests can easily be performed by calculating the + crossproducts. If they are of equal sign => same side => no + intersection. + X + \ + A________________B \ + \ + Y + + crossproducts (B-A)x(X-A) (B-A)x(Y-A) have different sign => X, Y on + different sides of A--B => intersection possible + + crossproducts (Y-X)x(B-X) (Y-X)x(A-X) have equal sign => A, B on the + same side of X--Y => no intersection + + Remark: If (and only if !) one of these crossproducts is equal (close + to) zero, we have a degenerate case. Using this information, the + following calculations can be simplified. + + + +*) FEM_gridmanag.f90, FUNCTION grid_findelement + + Loop restructered, less pointers. + Less calls to in_out in the hierarchical search: If the point belongs + to the parent element, it also has to belong to one of the + children. Therefore, it is sufficient to test all children except of + one. + + +*) FEM_saveset.f90, subroutine grid_readdomain + FEM_inittriang.f90, grid_create + Domain.dat, Triang.dat + + Reduced format for input of the triangulation. + + Im beispielfile Triang.dat ist eine triangulierung f"ur ein quadrat + mit quadratischer insel beschrieben. + ______________ Redundante daten werden jetzt berechnet, es reicht, + |\ /\ /| die knoten mit koordinaten, + | \ / \ / | die kanten mit zugeh. knoten und randbedg, + | \/___ \/ | die elemente mit kanten (gegen den uhrzeiger) und + | /| |\ | markierten kanten + | / | | \ | zeilenweise einzugeben. + |/ | | \| + |\ | | /| Sobald es wirklich kompliziert wird, ist es + | \ | | / | so viieel angenehmer. + | \|____|/ | + | /\ /\ | + | / \ / \ | + |/____\/____\| + + + Die grafik-schnittstelle weiss mit der insel nix anzufange. Zugleich +ist sie bisher die einzige, die den berandenden polygonzug +braucht. Also gibt's in Domain.dat einfach nur den "ausseren rand. + + +F"ur landmasken ist wahrscheinlich eine bitmap am einfachsten zu +handhaben... und auch nicht ungenauer, als ein polygonzug, den man in +endlicher zeit eingeben kann. Mal ein bischen gr"ubeln und +ausprobieren. + + + + + diff --git a/flash2d/doc/netcdf.doc b/flash2d/doc/netcdf.doc new file mode 100644 index 0000000000000000000000000000000000000000..3ea960f8b7fb11c8a915b12c79074aea042db7c2 --- /dev/null +++ b/flash2d/doc/netcdf.doc @@ -0,0 +1,57 @@ +Reihenfolge der Array-Indices in C/C++ + +Beitrag von U. G�bel: C and C++ interface to netcdf (version 3.3.1): + +With using the C or C++ interface to netcdf there often arises the question in +which order the data of multidimensional arrays is returned by calls to +functions like + + nc_get_varx_type(...,type * data) + +where x is in {1, s, a, , m} and type in {float,double, ....}. The natural +order returned by the netcdf interface is with the last dimensions varying +fastest. E.g. if temperature is a 3 dimensional array of type float +temperature[5][6][4] then a call like nc_get_varx_float(....,temp_arr) returns +the data in float *temp_arr in the form + + { [0][0][0], [0][0][1], [0][0][2], ..... ,[0][0][4], + [0][1][0], [0][1][1], [0][1][2], ..... ,[0][1][4], + [0][2][0], [0][2][1], [0][2][2], ..... ,[0][2][4], + . + . + . + [1][0][0], [1][0][1], [1][0][2], ......,[1][0][4] + . + . + [5][6][0], [5][6][1],[5][6][2], ......,[5][6][4] + } + + nc_get_varm_type( int ncid, int varid,const size_t *startp, + const size_t *countp, const ptrdiff_t *stridep, + const ptrdiff_t *imapp, const float *op); + +Instead of giving a detailed explanation of mapping I will simply show how to +specify reverse order: If your multidimensional array has d dimensions with +length dim1, dim2, ..., dimd (e.g. float +temperature[dim1][dim2][dim3]...[dimd]) specify a d dimensional vector imapp of +type ptrdiff_t (defined in stddef.h usually an unsigned int or long) with the +following entries: + + ptrdiff_t imapp[d]={1, dim1, dim1*dim2, dim1*dim2*dim3, ..., dim1*dim2*dim3*...*dim(d-1)} + +(Note that the last dimension dimd does not appear anywhere.) Unfortunately the +C++ interface does not implement the mapped access, so you have to rely on the +C interface (which is automatically included in netcdf.hh). Using the NcFile +and NcVar classes the access could look like this: + + NcFile *NcFile; + NcVar *NcVar; + int num_of_var; + + NcFile = new NcFile("myfile"); + NcVar = NcFile->get_var(num_of_var); + + nc_get_varm_float(NcFile->id(),NcVar->id(),start,counts,stride,imap,data); + +For further explanation of mapped access refer to the netcdf manual sections +3.2.3, 7.9 and 7.14 (not very elucidating). diff --git a/flash2d/doc/para-grid.eps b/flash2d/doc/para-grid.eps new file mode 100644 index 0000000000000000000000000000000000000000..91404451dbf144666f95164ddd207f42dd3651e5 --- /dev/null +++ b/flash2d/doc/para-grid.eps @@ -0,0 +1,858 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%BoundingBox: 14 523 298 754 +%%Title: /tmpdir/jbehrens/JB-Local/TeX/GAMM/Vort198/para-grid.eps +%%CreationDate: 5:15 PM January 21, 1998 +%%Pages: 1 +%%EndComments +%%BeginProlog +%%BeginResource ShowcaseResource +1 setlinejoin +/M { moveto } bind def /S { show } bind def +/R { rmoveto } bind def /L { lineto } bind def +/B { newpath 0 0 M 0 1 L 1 1 L 1 0 L closepath } bind def +/CS { closepath stroke } bind def +/S { + /fixwidth exch def + dup length /nchars exch def + dup stringwidth pop + fixwidth exch sub nchars div + exch 0 exch ashow +} def +/bwproc { + rgbproc + dup length 3 idiv string 0 3 0 + 5 -1 roll { + add 2 1 roll 1 sub dup 0 eq + { pop 3 idiv 3 -1 roll dup 4 -1 roll dup + 3 1 roll 5 -1 roll put 1 add 3 0 } + { 2 1 roll } ifelse + } forall + pop pop pop +} def +systemdict /colorimage known not { + /colorimage { + pop + pop + /rgbproc exch def + { bwproc } image + } def +} if +1 1 scale +0 setlinewidth +/drawtri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +stroke +} bind def +/filltri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +fill +} bind def +/cliptri { +/y3 exch def +/x3 exch def +/y2 exch def +/x2 exch def +/y1 exch def +/x1 exch def +0 setgray +newpath +x1 y1 moveto +x2 y2 lineto +x3 y3 lineto +closepath +clip +} bind def +/imgscanrgb { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx 3 mul string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +false 3 +colorimage +grestore +} bind def +/imgscanbw { +gsave +translate +/scandy exch def +/scandx exch def +/istr scandx string def +scandx scandy scale +scandx scandy 8 +[scandx 0 0 scandy neg 0 scandy] +{currentfile istr readhexstring pop} +image +grestore +} bind def +/showcaseisoencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/space /exclam /quotedbl /numbersign +/dollar /percent /ampersand /quoteright +/parenleft /parenright /asterisk /plus +/comma /minus /period /slash +/zero /one /two /three /four /five /six /seven +/eight /nine /colon /semicolon +/less /equal /greater /question +/at /A /B /C /D /E /F /G +/H /I /J /K /L /M /N /O +/P /Q /R /S /T /U /V /W +/X /Y /Z /bracketleft +/backslash /bracketright /asciicircum /underscore +/quoteleft /a /b /c /d /e /f /g +/h /i /j /k /l /m /n /o +/p /q /r /s /t /u /v /w +/x /y /z /braceleft +/bar /braceright /asciitilde /guilsinglright +/fraction /florin /quotesingle /quotedblleft +/guilsinglleft /fi /fl /endash +/dagger /daggerdbl /bullet /quotesinglbase +/quotedblbase /quotedblright /ellipsis /trademark +/dotlessi /grave /acute /circumflex +/tilde /macron /breve /dotaccent +/dieresis /perthousand /ring /cedilla +/Ydieresis /hungarumlaut /ogonek /caron +/emdash /exclamdown /cent /sterling +/currency /yen /brokenbar /section +/dieresis /copyright /ordfeminine /guillemotleft +/logicalnot /hyphen /registered /macron +/degree /plusminus /twosuperior /threesuperior +/acute /mu /paragraph /periodcentered +/cedilla /onesuperior /ordmasculine /guillemotright +/onequarter /onehalf /threequarters /questiondown +/Agrave /Aacute /Acircumflex /Atilde +/Adieresis /Aring /AE /Ccedilla +/Egrave /Eacute /Ecircumflex /Edieresis +/Igrave /Iacute /Icircumflex /Idieresis +/Eth /Ntilde /Ograve /Oacute +/Ocircumflex /Otilde /Odieresis /multiply +/Oslash /Ugrave /Uacute /Ucircumflex +/Udieresis /Yacute /Thorn /germandbls +/agrave /aacute /acircumflex /atilde +/adieresis /aring /ae /ccedilla +/egrave /eacute /ecircumflex /edieresis +/igrave /iacute /icircumflex /idieresis +/eth /ntilde /ograve /oacute +/ocircumflex /otilde /odieresis /divide +/oslash /ugrave /uacute /ucircumflex +/udieresis /yacute /thorn /ydieresis ] def +/showcasedingbatencoding [ +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef +/.notdef /a1 /a2 /a202 /a3 /a4 /a5 /a119 /a118 /a117 +/a11 /a12 /a13 /a14 /a15 /a16 /a105 /a17 /a18 /a19 +/a20 /a21 /a22 /a23 /a24 /a25 /a26 /a27 /a28 /a6 /a7 +/a8 /a9 /a10 /a29 +/a30 /a31 /a32 /a33 /a34 /a35 /a36 /a37 /a38 /a39 +/a40 /a41 /a42 /a43 /a44 /a45 /a46 /a47 /a48 /a49 +/a50 /a51 /a52 /a53 /a54 /a55 /a56 /a57 /a58 /a59 +/a60 /a61 /a62 /a63 /a64 /a65 /a66 /a67 /a68 /a69 +/a70 /a71 /a72 /a73 /a74 /a203 /a75 /a204 /a76 /a77 /a78 +/a79 /a81 /a82 /a83 /a84 /a97 /a98 /a99 /a100 /.notdef +/a205 /a85 /a206 /a86 /a87 /a88 /a89 /a90 /a91 /a92 /a93 +/a94 /a95 /a96 +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /a101 /a102 /a103 /a104 /a106 /a107 /a108 +/a112 /a111 /a110 /a109 +/a120 /a121 /a122 /a123 /a124 /a125 /a126 /a127 /a128 /a129 +/a130 /a131 /a132 /a133 /a134 /a135 /a136 /a137 /a138 /a139 +/a140 /a141 /a142 /a143 /a144 /a145 /a146 /a147 /a148 /a149 +/a150 /a151 /a152 /a153 /a154 /a155 /a156 /a157 /a158 /a159 +/a160 /a161 /a163 /a164 /a196 /a165 /a192 /a166 /a167 /a168 +/a169 /a170 /a171 /a172 /a173 /a162 /a174 /a175 /a176 /a177 +/a178 /a179 /a193 /a180 /a199 /a181 /a200 /a182 /.notdef +/a201 /a183 /a184 /a197 /a185 /a194 /a198 /a186 /a195 /a187 +/a188 /a189 /a190 /a191 /.notdef +] def +/Helvetica-Bold findfont +dup length dict begin + {1 index /FID ne {def} {pop pop} ifelse} forall + /Encoding showcaseisoencoding def + currentdict +end +/Helvetica-Bold-SHOWISO exch definefont pop +/newfont 10 dict def +newfont begin + + /FontType 3 def + /FontMatrix [1 0 0 1 0 0] def + /FontBBox [0 0 1 1] def + /Encoding 256 array def + 0 1 255 {Encoding exch /.notdef put} for + + /CharProcs 1 dict def + CharProcs begin + /.notdef {} def + +end + + /BuildChar { + 1 0 + 0 0 1 1 + setcachedevice + exch begin + Encoding exch get + CharProcs exch get + end + exec + } def +end +/PatternFont newfont definefont pop + +%%EndResource +%%EndProlog +%%BeginSetup +%%EndSetup +%%Page: label 1 +gsave +/saveit save def +gsave +gsave +matrix currentmatrix +[283.5 0 0 -170 14 693] concat +B +setmatrix +0.219608 0.556863 0.556863 setrgbcolor +gsave fill grestore +grestore +gsave +matrix currentmatrix +[113.5 0 0 -113.5 28.5 651.5] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +28.5 651.5 M +142 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +142 651 M +28.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +85.5 651.5 M +85.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +28.5 594.5 M +142 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +85.5 651.5 M +28.5 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +85.5 651.5 M +142 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +142.5 595 M +85.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +28.5 595 M +85 538 L +stroke +grestore +gsave +matrix currentmatrix +[113.5 0 0 -113.5 170.5 651.5] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +170.5 651.5 M +284 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +284 651 M +170.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +227.5 651.5 M +227.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +170.5 594.5 M +284 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +227.5 651.5 M +170.5 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +227.5 651.5 M +284 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +284.5 595 M +227.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +170.5 595 M +227 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +113.5 623 M +113.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +57 566.5 M +113.5 566.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +113.5 594.5 M +85.5 566.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +85.5 566.5 M +113.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +99.5 580.5 M +99.5 552 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +198.5 651.5 M +198.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +255.5 651.5 M +255.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +170.5 566.5 M +284 566.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +170.5 623 M +284 623 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +226.5 622.5 M +198.5 594.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +255 594.5 M +227 566.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +283.5 566 M +255.5 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +199 594.5 M +255 538 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +227 623 M +283 566.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +213 580.5 M +269.5 580.5 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +241 552 M +283.5 552 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +241 609 M +241 552 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +269.5 580.5 M +269.5 552 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +227 580.5 M +255.5 552 L +stroke +grestore +gsave +0 0 0 setrgbcolor +0.500000 setlinewidth +newpath +255.5 580 M +241 566.5 L +stroke +grestore +gsave +1 0 0 setrgbcolor +2.000000 setlinewidth +newpath +227 651.5 M +227 594.5 L +241 580.5 L +241 566.5 L +255.5 552 L +269.5 552 L +283.5 538 L +stroke +grestore +gsave +matrix currentmatrix +[113.5 0 0 -14.5 28 679] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 194.243 664.75] concat +newpath +0 0 M 0 14 L 65.014 14 L 65.014 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +191.743 662.25 M 191.743 681.25 L 261.757 681.25 L 261.757 662.25 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 194.243 664.75] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (GRID_api) 63.014 S +setmatrix +grestore +gsave +1 0 0 setrgbcolor +2.000000 setlinewidth +newpath +226.5 679 M +226.5 664.5 L +stroke +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 52.243 664.75] concat +newpath +0 0 M 0 14 L 65.014 14 L 65.014 0 L +closepath setmatrix +0 0 0 setrgbcolor +grestore +newpath +49.743 662.25 M 49.743 681.25 L 119.757 681.25 L 119.757 662.25 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 52.243 664.75] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (GRID_api) 63.014 S +setmatrix +grestore +gsave +matrix currentmatrix +[283.5 0 0 -42.5 14 749.5] concat +B +setmatrix +0.556863 0.219608 0.556863 setrgbcolor +gsave fill grestore +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 91.479 721.5] concat +newpath +0 0 M 0 14 L 128.042 14 L 128.042 0 L +closepath setmatrix +0.776471 0.439216 0.439216 setrgbcolor +grestore +newpath +88.979 719 M 88.979 738 L 222.021 738 L 222.021 719 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 91.479 721.5] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (SLM, Solv, VisOGL) 126.042 S +setmatrix +grestore +gsave +0.776471 0.439216 0.439216 setrgbcolor +2.000000 setlinewidth +newpath +155.5 735.5 M +155.5 721.5 L +stroke +grestore +gsave +matrix currentmatrix +[113.5 0 0 -14.5 170 679] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +matrix currentmatrix +[255 0 0 -14 28 735.5] concat +B +setmatrix +0 0 0 setrgbcolor +1.000000 setlinewidth +gsave stroke grestore +grestore +gsave +0.666667 0.666667 0.666667 setrgbcolor +newpath +123.469 740 M +118.329 740.575 L +114.908 742.299 L +113.206 745.173 L +113 747 L +113 747 L +113 747 L +113 747 L +113.86 750.437 L +116.439 752.724 L +120.737 753.862 L +123.469 754 L +123.469 754 L +124.446 754 L +126.691 754 L +130.018 754 L +134.242 754 L +139.175 754 L +144.632 754 L +150.426 754 L +156.372 754 L +162.282 754 L +167.971 754 L +173.253 754 L +177.941 754 L +181.849 754 L +184.791 754 L +186.58 754 L +187.031 754 L +187.031 754 L +192.171 753.425 L +195.592 751.701 L +197.294 748.827 L +197.5 747 L +197.5 747 L +197.5 747 L +197.5 747 L +196.64 743.563 L +194.061 741.276 L +189.763 740.138 L +187.031 740 L +187.031 740 L +186.087 740 L +183.932 740 L +180.738 740 L +176.679 740 L +171.927 740 L +166.657 740 L +161.04 740 L +155.25 740 L +149.46 740 L +143.843 740 L +138.573 740 L +133.821 740 L +129.762 740 L +126.568 740 L +124.413 740 L +123.469 740 L +closepath +eofill +0.776471 0.439216 0.439216 setrgbcolor +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 116.135 740] concat +newpath +0 0 M 0 14 L 78.23 14 L 78.23 0 L +closepath setmatrix +0.776471 0.439216 0.439216 setrgbcolor +grestore +newpath +113.635 737.5 M 113.635 756.5 L 196.865 756.5 L 196.865 737.5 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 116.135 740] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (Application) 76.23 S +setmatrix +grestore +gsave +0.666667 0.666667 0.666667 setrgbcolor +newpath +123.969 684.5 M +116.919 685.786 L +113.714 689.643 L +113.5 691.5 L +113.5 691.5 L +113.5 691.5 L +113.5 691.5 L +115.423 696.214 L +121.191 698.357 L +123.969 698.5 L +123.969 698.5 L +124.946 698.5 L +127.191 698.5 L +130.518 698.5 L +134.742 698.5 L +139.675 698.5 L +145.132 698.5 L +150.926 698.5 L +156.872 698.5 L +162.782 698.5 L +168.471 698.5 L +173.753 698.5 L +178.441 698.5 L +182.349 698.5 L +185.291 698.5 L +187.08 698.5 L +187.531 698.5 L +187.531 698.5 L +194.582 697.214 L +197.786 693.357 L +198 691.5 L +198 691.5 L +198 691.5 L +198 691.5 L +196.077 686.786 L +190.309 684.643 L +187.531 684.5 L +187.531 684.5 L +186.587 684.5 L +184.432 684.5 L +181.238 684.5 L +177.179 684.5 L +172.427 684.5 L +167.157 684.5 L +161.54 684.5 L +155.75 684.5 L +149.96 684.5 L +144.343 684.5 L +139.073 684.5 L +134.321 684.5 L +130.262 684.5 L +127.068 684.5 L +124.913 684.5 L +123.969 684.5 L +closepath +eofill +0.776471 0.439216 0.439216 setrgbcolor +grestore +gsave +gsave +matrix currentmatrix +[1 0 0 1 126.743 684.5] concat +newpath +0 0 M 0 14 L 58.014 14 L 58.014 0 L +closepath setmatrix +0.776471 0.439216 0.439216 setrgbcolor +grestore +newpath +124.243 682 M 124.243 701 L 187.257 701 L 187.257 682 L +closepath clip newpath +0 0 0 setrgbcolor +matrix currentmatrix +[1 0 0 1 126.743 684.5] concat +/Helvetica-Bold-SHOWISO findfont 14 scalefont setfont +0 0 0 setrgbcolor +0 2.47059 M (GridGen) 56.014 S +setmatrix +grestore +grestore +showpage +saveit restore +grestore +%%EOF diff --git a/flash2d/doc/sources/Callingtree.sc b/flash2d/doc/sources/Callingtree.sc new file mode 100644 index 0000000000000000000000000000000000000000..7665e78004fb7438f3ac82b919f62b10c8e16413 Binary files /dev/null and b/flash2d/doc/sources/Callingtree.sc differ diff --git a/flash2d/doc/sources/Dataflow.sc b/flash2d/doc/sources/Dataflow.sc new file mode 100644 index 0000000000000000000000000000000000000000..10bbc225a9434c605de0892d5023dc10e5ebc432 Binary files /dev/null and b/flash2d/doc/sources/Dataflow.sc differ diff --git a/flash2d/doc/sources/Datastruct.old.sc b/flash2d/doc/sources/Datastruct.old.sc new file mode 100644 index 0000000000000000000000000000000000000000..a441838b7277bf764c9de928100c57ac4862290c Binary files /dev/null and b/flash2d/doc/sources/Datastruct.old.sc differ diff --git a/flash2d/doc/sources/Datastruct.sc b/flash2d/doc/sources/Datastruct.sc new file mode 100644 index 0000000000000000000000000000000000000000..2bdf293b40d9c6207efdd23540c02ff26a26609c Binary files /dev/null and b/flash2d/doc/sources/Datastruct.sc differ diff --git a/flash2d/doc/sources/FlowTempl.sc b/flash2d/doc/sources/FlowTempl.sc new file mode 100644 index 0000000000000000000000000000000000000000..ac3df7cd4e818282cb76932d6498703221a8eeb7 Binary files /dev/null and b/flash2d/doc/sources/FlowTempl.sc differ diff --git a/flash2d/doc/sources/GridFlow.sc b/flash2d/doc/sources/GridFlow.sc new file mode 100644 index 0000000000000000000000000000000000000000..d2fde3099608ff19c7f87c258cef4a109fe2fcce Binary files /dev/null and b/flash2d/doc/sources/GridFlow.sc differ diff --git a/flash2d/doc/sources/InputDok.tex b/flash2d/doc/sources/InputDok.tex new file mode 100644 index 0000000000000000000000000000000000000000..c707ece32bfb6d6ac4ff675606c5eb3e66d10d78 --- /dev/null +++ b/flash2d/doc/sources/InputDok.tex @@ -0,0 +1,406 @@ +% +% FILENAME: InputDoc.tex +% +% CONTENTS: Dokumentation of input data file formats for FLASH +% +% DATE: 3/98 +% +% AUTHOR: j. behrens + + +\documentstyle[a4wide]{article} +\sloppy +\parindent0em +\parskip1.5ex plus0.2ex minus0.2ex + +\begin{document} + +% PostScript Graphik einbinden --- --- --- +%\epsfysize 3cm +%\epsfxsize 14cm +%\begin{figure}[t] +%\begin{center} +%\leavevmode\epsfbox{FILE.eps} +%\end{center} +%\caption{... TEXT ...} +%\protect\label{fig1} +%\end{figure} + + +% Ueberschrift --- --- --- +\begin{center} +{\Large {\sc Input File Formats for FLASH}} +\\ Version 0.4.3, 3/98 +\end{center} + +All the input files are constructed in the same way: KEYWORDS precede +the values for specified input parameters, COMMENTS are marked by a '!' +or '\#' in the first line. There are five six which might be +important: Parameters.dat, Windparam.dat, Land.dat, Triang.dat, +Domain.dat, and Initial.dat. + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Parameters.dat}} + +{\bf DESCRIPTION:} + +This file defines the behaviour of FLASH. It also contains the main +physical parameters, the user can influence. + +{\bf KEYWORDS:} + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +EXPERIMENT\_NUMBER & +This is the experiment number, normally set to 0 (for a new experiment), +if an experiment is continued, then it is set to the continued counter. & +0 to 999 {\bf [required]}\\ \hline +FINE\_GRID\_LEVEL & +Sets the finest grid level. The mesh size is given by $2^{-(j+1)/2} \times H$, +where $j$ is the refinement level and $H$ is the coarse mesh size.& +1 to $\infty$ {\bf [required]} \\ \hline +COARSE\_GRID\_LEVEL & +The coarse grid level (or minimum refinement level) & +1 to $\infty$ should be smaller than FINE\_GRID\_LEVEL +{\bf [required]} \\ \hline +TOLERANCE\_OF\_REFINEMENT & +A global refinement tolerance ($\theta_{ref}$): If the local error estimate $\eta_{l}$ is larger +than $\theta_{ref} \times \eta_{max}$ then an element will be refined. & +0.0 to 1.0 {\bf [required]} \\ \hline +TOLERANCE\_OF\_COARSENING & +A global coarsening tolerance($\theta_{crs}$): If the local error estimate $\eta_{l}$ is smaller +than $\theta_{crs} \times \eta_{max}$ then an element will be coarsened. & +0.0 to 1.0 $< \theta_{ref}$ {\bf [required]} \\ \hline +WATERMARK\_OF\_REFINEMENT & +A percentage of changes ($\omega_{ref}$): If more than $\omega_{ref}$ percent +of the grid elements are marked for refinement, then refine, otherwise leave +the grid unchanged & +0.0 to 1.0 {\bf [required]} \\ \hline +WATERMARK\_OF\_COARSENING & +A percentage of changes ($\omega_{crs}$): If more than $\omega_{crs}$ percent +of the grid elements are marked for coarsening, then coarsen, otherwise leave +the grid unchanged & +0.0 to 1.0 {\bf [required]} \\ \hline +TIMESTEP\_LENGTH & +This is the time step lenght in seconds & +0.0 to $\infty$ {\bf [required]} \\ \hline +BEGINNING\_TIMESTEP & +This is the first timestep count for the experiment. & +1 to 99999 {\bf [1 if experiment is 0]} \\ \hline +FINISHING\_TIMESTEP & +The last timestep of the experiment, thus modelling interval time is +TIMESTEP\_LENGTH $\times$ FINISHING\_TIMESTEP - BEGINNING\_TIMESTEP. & +1 to 99999 {\bf [required]} \\ \hline +\end{tabular} +\end{small} +\pagebreak + +Table continued + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +TYPE\_OF\_PLOTTING & +There are different options for real time (online) vizualization: the +x-component of wind $u$ [1], the y-component of wind $v$ [2], the +geopotential height $\Phi$ [3], $u$ with grid [4], $v$ with grid [5], +$\Phi$ with grid [6], the grid alone [7], the wind vector field $(u,v)$ [8], +the vorticity $\zeta$ [9], the tracer concentration $c_t$ [10], $c_t$ with +grid [11], no visual output [0]. & +0 to 11 {\bf [0]} \\ \hline +PLOT\_TIFF\_FILE & +Each visual output can be printed into a tiff (tagged image file format) file. +If value is 0 than no printing is performed. & +0 to $\infty$ {\bf [?]} \\ \hline +MATLAB\_PLOTTING & +Matlab output can be generated in case no OpenGL library for the visualization +is supported If value is 0 than no printing is performed. & +0 to $\infty$ {\bf [?]} \\ \hline +STEPS\_BTW\_PLOTS & +Timesteps between plots. If a plot is required only every $n$-th step set value +to $n$. & +1 to $\infty$ {\bf [?]} \\ \hline +STEPS\_BTW\_SAVES & +If an offset file has to be written, in case the computer fails or in case the +simulation shall be initialized from a certain time. The offset file is written +every $n$-th step. & +1 to $\infty$ {\bf [?]} \\ \hline +SAVE\_FINISH\_CONFIGURATION & +The finishing configuration can be saved to disk in order to continue the +experiment at a later time. If value is 0 than save file will be written. & +0 to $\infty$ {\bf [?]} \\ \hline +POLYGON\_FILE\_NAME & +Take the polygons defined in this file as a land mask (for example). & +character string of length 32 {\bf ['land.dat' ?]} \\ \hline +WIND\_FILE\_NAME & +If wind data shall be read from files, this defines the mode how to do it. & +character string of length 32 {\bf [?]} \\ \hline +DOMAIN\_FILE\_NAME & +The domain outline is given in this file. & +character string of length 32 {\bf [?]} \\ \hline +TRIANG\_FILE\_NAME & +The initial triangulation is given in this file. & +character string of length 32 {\bf [?]} \\ \hline +SLM\_ITERATION\_NUMBER & +The number of iterations in the calculation of the semi-Lagrangian upstream +displacements is defined by this value. A good value is 4. & +1 to $\infty$ {\bf [required]} \\ \hline +\end{tabular} +\end{small} +\pagebreak + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Domain.dat}} + +{\bf DESCRIPTION:} + +This file defines domain of the calculation. It is used by the grid +generator and the visualization utility. + +{\bf KEYWORDS:} + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +NUMBER\_OF\_DIMENSIONS & +The number of space dimensions & +1 to 3 {\bf [2]} \\ \hline +NUMBER\_OF\_POLYGONS & +The number of polygons defining the domain (think of islands). & +1 to $\infty$ {\bf [1]} \\ \hline +NUMBER\_OF\_VERTICES & +This Keyword occurs as often as polygons are given (previous value). It +defines the number of vertices of each polygon & +1 to $\infty$ {\bf [required]} \\ \hline +VERTEX\_DATA & +This block of data occurs as often as polygons are given. Each block contains +NUMBER\_OF\_DIMENSIONS $\times$ NUMBER\_OF\_VERTICES lines with coordinates +of each vertex. & +- real range to + real range {\bf [required]} \\ \hline +\end{tabular} +\end{small} + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Land.dat}} + +{\bf DESCRIPTION:} + +This file is for convenience only and has no meaning to the model +itself. It is safely omitted. It defines polygonal lines plotted by the +online visualization utility. + +CAUTION: Lnad.dat has a different syntax, as there are no keywords +supported, but the order of arguments is important. Moreover, only the +'\#' character is allowed for a comment line (this is for historical +reasons only and might be changed in later releases). Only +two-dimenional data are allowed. + +{\bf First non-comment line:} Number of Polygons + +{\bf Then:} each block with polygon data begins with an integer value in a +single line defining the number of vertices, then 2 $\times$ +no.-of-vertices coordinates values follow. +\pagebreak + + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Triang.dat}} + +{\bf DESCRIPTION:} + +This file defines the initial triangulation. The coarsest triangulation +has to be given by the user, it is not generated automattically from the +domain data. + +{\bf KEYWORDS:} + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +GRID\_DIMENSION & +Global parameter defining the grid's space dimensions. & +1 to 3 {\bf [2]} \\ \hline +ELEMENT\_VERTICES & +Global parameter defining the shape of elements. In 2D for example, 3 +is triangular mesh, 4 quadrilateral, etc. & +3 to 4... {\bf [?]} \\ \hline +NUMBER\_OF\_NODES & +This defines the total number of nodes in the inital mesh. & +1 to integer range {\bf [required]} \\ \hline +NUMBER\_OF\_EDGES & +This defines the total number of edges in the inital mesh. & +1 to integer range {\bf [required]} \\ \hline +NUMBER\_OF\_ELEMENTS & +This defines the total number of elements in the inital mesh. & +1 to integer range {\bf [required]} \\ \hline +DEF\_INNERITEM & +This global value defines the attribute value for a grid item within +the domain (no boundary). & +- integer range to 0 {\bf [required]} \\ \hline +DEF\_DIRICHLETBOUNDARY & +This global value defines the attribute value for a grid item on a +Dirichlet boundary section of the domain. & +- integer range to 0 {\bf [required]} \\ \hline +DEF\_NEUMANNBOUNDARY & +This global value defines the attribute value for a grid item on a +Neumann boundary section of the domain. [Note: periodic boundary conditions +are defined by the (positive) index number of the corresponding periodic +partner item in the grid.] & +- integer range to 0 {\bf [required]} \\ \hline +NODE\_INDEXNUMBER & +Defines the (unique) index of a node. This keyword occurs as often as the +value of NUMBER\_OF\_NODES indicates. & +1 to integer range {\bf [required]} \\ \hline +NODE\_COORDINATES & +Defines a block of GRID\_DIMENSION coordinates of the node. & +- real range to + real range {\bf [required]} \\ \hline +EDGE\_INDEXNUMBER & +Defines the (unique) index of an edge. This keyword occurs as often as the +value of NUMBER\_OF\_EDGES indicates. & +1 to integer range {\bf [required]} \\ \hline +EDGE\_NODEINDICES & +Two indices of nodes (defined in the previous section) which span the edge. & +1 to integer range {\bf [required]} \\ \hline +EDGE\_ELEMENTINDICES & +Two indices of elements adjacent to the edge. 0 for one side if the edge is at +a (non-periodic) boundary. & +1 to integer range {\bf [required]} \\ \hline +EDGE\_BOUNDARYCONDITION & +Defines the boundary condition according to the previosly defined values for +Dirichlet, Neumann, or periodic boundary conditions. & +- integer range to + integer range {\bf [required]} \\ \hline +\end{tabular} +\end{small} +\pagebreak + +Table continued + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +ELEMENT\_INDEXNUMBER & +Defines the (unique) index of an element. This keyword occurs as often as the +value of NUMBER\_OF\_ELEMENTS indicates. & +1 to integer range {\bf [required]} \\ \hline +ELEMENT\_NODEINDICES & +Three indices of nodes which span the element. & +1 to integer range {\bf [required]} \\ \hline +ELEMENT\_EDGEINDICES & +Three indices of edges which span the element. & +1 to integer range {\bf [required]} \\ \hline +ELEMENT\_MARKEDEDGE & +The local edge number that is marked for refinement (by bisection). & +1 to 3 {\bf [required]} \\ \hline +\end{tabular} +\end{small} + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Windparam.dat}} + +{\bf DESCRIPTION:} + +This file defines the behaviour of FLASH when it comes to reading winddata. + +{\bf KEYWORDS:} + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +X\_PREFIX & +This is a prefix for the x-data file name. A file name is constructed from +[prefix][counter][postfix], where prefix and postfix can be empty. & +character string of length 32 {\bf [no default]} \\ \hline +Y\_PREFIX & +This is a prefix for the y-data file name. & +character string of length 32 {\bf [no default]} \\ \hline +X\_POSTFIX & +This is a postfix for the x-data file name. & +character string of length 32 {\bf [no default]} \\ \hline +Y\_POSTFIX & +This is a postfix for the y-data file name. & +character string of length 32 {\bf [no default]} \\ \hline +TIME\_FACTOR & +This defines the model time between the increments/ wind data updates & +0.0 to real range {\bf [?]} \\ \hline +NUMBER\_OF\_INTERVALS & +This defines the increment for the counter in the file name construction. & +0 to integer range {\bf [no default]} \\ \hline +UPSET\_OF\_INTERVALS & +This is the offset for the first file counter. Thus a x-data file with name +[X\_PREFIX][$n$][X\_POSTFIX], where $n$ = UPSET\_OF\_INTERVALS + $k$ $\times$ +NUMBER\_OF\_INTERVALS holds data for the model time +$k$ $\times$ NUMBER\_OF\_INTERVALS $\times$ TIME\_FACTOR. & +0 to integer range {\bf [no default]} \\ \hline +X\_NUMBER\_OF\_POINTS & +Number of points in x-direction. Wind data are assumed to be given on a +rectangular uniform grid. & +0 to integer range {\bf [no default]} \\ \hline +Y\_NUMBER\_OF\_POINTS & +Number of points in x-direction. Wind data are assumed to be given on a +rectangular uniform grid. & +0 to integer range {\bf [no default]} \\ \hline +\end{tabular} +\end{small} +\pagebreak + +Table continued + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +X\_SCALE\_FACTOR & +A scaling factor defining the mesh size. When wind is given in meters per second, +then the scaling factor is just the grid spacing for the rectangular grid in +meters. & +0.0 to real range {\bf [no default]} \\ \hline +Y\_SCALE\_FACTOR & +The analog of X\_SCALE\_FACTOR for the y-direction. & +0.0 to real range {\bf [no default]} \\ \hline +\end{tabular} +\end{small} + +% Zwischenueberschrift --- --- --- +\vspace{5mm} +{\large {\bf FILE: Initial.dat}} + +{\bf DESCRIPTION:} + +This file defines in a crude way, where to initialize a tracer. + +{\bf KEYWORDS:} + +\begin{small} +\begin{tabular}{|l|p{55mm}|p{35mm}|} \hline +Keyword & Description & Range of Values {\bf [Default]}\\ \hline \hline +CIRCLES\_INPUT & +Has no value and is required. Don't ask for more explanations. & +\ \\ \hline +NUMBER\_OF\_CIRCLES & +This is the number of initial circular concentrations. & +0 to integer range {\bf [no default]} \\ \hline +CIRCLE\_COORDINATES & +This block of two coordinate values defines the center of the circle. This +keyword occurs as often as NUMBER\_OF\_CIRCLES indicates. & +- real range to + real range {\bf [no default]} \\ \hline +CIRCLE\_DIAMETER & +Defines the diameter of the circle. & +0.0 to + real range {\bf [no default]} \\ \hline +CIRCLE\_CONCENTRATION & +This defines the initial concentration of the tracer. & +0.0 to + real range {\bf [no default]} \\ \hline +\end{tabular} +\end{small} + +\vspace{1ex} +% Unterschrift --- --- --- +\begin{flushright} +J"orn Behrens, \today +\end{flushright} + +\end{document} diff --git a/flash2d/doc/sources/Triang.sc b/flash2d/doc/sources/Triang.sc new file mode 100644 index 0000000000000000000000000000000000000000..602c36e8572e822378ee087c344211a5dc059ecb Binary files /dev/null and b/flash2d/doc/sources/Triang.sc differ diff --git a/flash2d/doc/sources/grids.fig b/flash2d/doc/sources/grids.fig new file mode 100644 index 0000000000000000000000000000000000000000..1c8f068b51d71034f690290218909fb3bc073729 --- /dev/null +++ b/flash2d/doc/sources/grids.fig @@ -0,0 +1,245 @@ +#FIG 3.2 +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +6 453 916 4716 9916 +6 2703 1186 4503 2986 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 3153 1186 3153 1411 2928 1636 2703 1636 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2928 1636 3153 1861 3153 2311 2928 2536 2703 2536 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2928 2536 3153 2761 3153 2986 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 3153 2761 3378 2536 3873 2716 4053 2986 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3873 2716 4233 2356 4503 2536 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4233 2356 4233 1816 4503 1636 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4233 1816 3873 1456 4053 1186 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3153 1411 3378 1636 3873 1456 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3378 1636 3153 1861 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3153 2311 3378 2536 +-6 +6 2703 3436 4503 5236 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 2703 4786 2928 4786 3153 5011 3153 5236 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 3153 5011 3378 4786 3828 4786 4053 5011 4053 5236 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4053 5011 4278 4786 4503 4786 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 + 4278 4786 4053 4561 4233 4066 4503 3886 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 4233 4066 3873 3706 4053 3436 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3873 3706 3333 3706 3153 3436 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 3333 3706 2973 4066 2703 3886 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 3 + 2928 4786 3153 4561 2973 4066 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3153 4561 3378 4786 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 3828 4786 4053 4561 +-6 +6 453 3436 2253 5236 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 453 3436 453 5236 1353 4336 453 3436 453 3436 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 453 4336 1353 4336 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 4336 1353 3436 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 4336 2253 4336 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 4336 1353 5236 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 453 4336 1353 5236 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 2253 4336 1353 5236 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2253 3436 453 3436 1353 4336 2253 3436 2253 3436 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 453 5236 2253 5236 1353 4336 453 5236 453 5236 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2253 5236 2253 3436 1353 4336 2253 5236 2253 5236 +-6 +6 453 1186 2253 2986 +6 453 1186 2253 2986 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2253 2986 2253 1186 1353 2086 2253 2986 2253 2986 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 453 1186 453 2986 1353 2086 453 1186 453 1186 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 453 2986 2253 2986 1353 2086 453 2986 453 2986 +2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 + 2253 1186 453 1186 1353 2086 2253 1186 2253 1186 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 453 2086 1353 2086 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 2086 1353 1186 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 2086 2253 2086 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 2086 1353 2986 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 1353 1186 453 2086 +2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 + 453 2086 1353 2986 +-6 +-6 +6 543 5506 2523 7666 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5 + 543 5596 633 6586 1083 6136 543 5596 543 5596 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1443 5596 2343 5506 1623 6586 1443 5596 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1623 6586 2523 6586 2343 5506 1623 6586 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 2523 6586 2433 7666 1623 6586 2523 6586 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1623 6586 1533 7666 2433 7666 1623 6586 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1623 6586 1083 6136 633 6586 1623 6586 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 633 6586 543 7666 993 7126 633 6586 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 993 7126 543 7666 1533 7666 993 7126 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1533 7666 1623 6586 993 7126 1533 7666 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 543 5596 1443 5596 1083 6136 543 5596 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1083 6136 1623 6586 1443 5596 1083 6136 +-6 +6 543 7756 2523 9916 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 993 9376 1533 9916 543 9916 993 9376 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1443 7846 2343 7756 1623 8836 1443 7846 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 2523 8836 2433 9916 1983 9376 2523 8836 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 543 9916 993 9376 633 8836 543 9916 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 543 7846 1623 8836 1443 7846 543 7846 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 543 7846 633 8836 1623 8836 543 7846 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1623 8836 2343 7756 2523 8836 1623 8836 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1623 8836 633 8836 993 9376 1623 8836 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1983 9376 2433 9916 1533 9916 1983 9376 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 1533 9916 1983 9376 1623 8836 1533 9916 +-6 +6 2796 5525 4679 7637 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 2804 6069 2991 6095 3242 5818 3216 5570 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5 + 2999 6099 3284 6384 3254 6770 2965 7067 2796 7097 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 2965 7078 3205 7412 3246 7633 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 3212 7419 3554 7127 4060 7318 4214 7637 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 4067 7325 4412 6875 4679 7097 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 4416 6875 4405 6234 4634 6017 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 4409 6238 3974 5825 4116 5525 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 3974 5833 3561 6084 3246 5822 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 3554 6092 3284 6384 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 3257 6774 3554 7127 +-6 +6 2826 7780 4716 9887 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 3291 7829 3437 8084 3130 8481 2834 8309 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 3130 8485 3291 9029 2999 9325 2826 9392 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 2999 9332 3254 9662 3310 9887 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5 + 3261 9666 3599 9385 3981 9362 4240 9677 4247 9884 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 4247 9681 4532 9374 4716 9366 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 4 + 4532 9370 4251 9010 4412 8466 4671 8275 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 3 + 4412 8474 4026 8084 4116 7780 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 4022 8084 3449 8087 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 3291 9032 3599 9374 +2 1 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 3989 9362 4247 9014 +-6 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 1186 543 1006 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 1186 1443 1006 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 1186 2343 916 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 903 1636 1083 1546 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 2086 1623 1996 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 2086 2523 1996 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 2086 633 1996 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 903 2536 993 2536 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 2986 543 3076 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 2986 1533 3076 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 2986 2433 3076 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 3436 543 3256 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 4336 633 4246 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 453 5236 543 5326 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 903 4786 993 4786 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 3436 1443 3256 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 4336 1623 4246 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1353 5236 1533 5326 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 5236 2433 5326 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 4336 2523 4246 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 2253 3436 2343 3166 +2 1 1 1 0 7 100 0 -1 4.000 0 0 -1 0 0 2 + 1803 4786 1983 4786 +-6 +2 2 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5 + 2700 1187 4500 1187 4500 2987 2700 2987 2700 1187 +2 2 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 5 + 2700 3435 4500 3435 4500 5235 2700 5235 2700 3435 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 8 + 2748 5567 2838 6553 2748 7637 4642 7637 4731 6549 4555 5477 + 3648 5563 2748 5567 +2 3 0 1 0 7 100 0 -1 4.000 0 0 -1 0 0 8 + 2786 7822 2876 8808 2786 9892 4680 9892 4769 8804 4593 7732 + 3686 7818 2786 7822 diff --git a/flash2d/doc/sources/para-grid.sc b/flash2d/doc/sources/para-grid.sc new file mode 100644 index 0000000000000000000000000000000000000000..08410ffda394f4cb8f6f21639191db9feb7d7b59 Binary files /dev/null and b/flash2d/doc/sources/para-grid.sc differ diff --git a/flash2d/doc/sources/structure.fig b/flash2d/doc/sources/structure.fig new file mode 100644 index 0000000000000000000000000000000000000000..5b5cc7c8ae37c51d04be3c751250c738e45a7325 --- /dev/null +++ b/flash2d/doc/sources/structure.fig @@ -0,0 +1,100 @@ +#FIG 2.1 +80 2 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 379 119 379 99 119 99 119 119 379 119 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 119 179 119 119 239 119 239 179 119 179 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 179 319 179 219 119 219 119 319 179 319 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 379 179 379 59 119 59 119 179 379 179 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 379 259 379 219 219 219 219 259 379 259 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 379 319 379 279 219 279 219 319 379 319 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 599 319 599 279 419 279 419 319 599 319 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 299 459 299 359 119 359 119 459 299 459 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 79 39 249 39 249 59 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 139 179 139 199 79 199 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 309 179 309 199 159 199 159 219 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 179 239 219 239 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 179 299 219 299 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 379 299 419 299 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 79 339 209 339 209 359 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 209 459 209 479 79 479 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 299 559 299 519 119 519 119 559 299 559 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 79 499 209 499 209 519 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 209 559 209 579 79 579 9999 9999 +2 2 0 1 -1 0 0 0 0.000 0 0 0 + 79 599 79 19 19 19 19 599 79 599 9999 9999 +2 1 1 1 -1 0 0 0 4.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 299 539 319 539 319 319 9999 9999 +2 1 1 1 -1 0 0 0 4.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 279 359 279 319 9999 9999 +2 1 0 1 -1 0 0 0 0.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 439 79 499 79 9999 9999 +2 1 1 1 -1 0 0 0 4.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 439 119 499 119 9999 9999 +2 1 2 1 -1 0 0 0 3.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 299 399 359 399 9999 9999 +2 1 2 1 -1 0 0 0 3.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 459 354 459 319 9999 9999 +2 2 2 1 -1 0 0 0 3.000 0 0 0 + 479 459 359 459 359 359 479 359 479 459 9999 9999 +2 1 2 1 -1 0 0 0 3.000 -1 1 0 + 0 0 1.000 4.000 8.000 + 439 159 499 159 9999 9999 +4 0 0 12 0 -1 0 0.00000 4 15 35 139 134 parent: +4 0 0 12 0 -1 0 0.00000 4 15 93 139 154 return to main part +4 0 0 12 0 -1 0 0.00000 4 15 26 259 134 child: +4 0 0 12 0 -1 0 0.00000 4 15 96 259 152 open GL-windows +4 0 0 12 0 -1 0 0.00000 4 15 99 259 170 enter glutMainLoop +4 0 0 12 0 -1 0 0.00000 4 15 19 234 114 fork +4 0 0 12 0 -1 0 0.00000 4 15 70 204 84 graphics_init_ +4 0 0 12 0 -1 0 0.00000 4 15 131 239 244 button and menu functions +4 0 0 12 0 -1 0 0.00000 4 15 31 134 274 GLUT +4 0 0 12 0 -1 0 0.00000 4 15 73 139 384 graphics_draw +4 0 0 12 0 -1 0 0.00000 4 15 132 139 404 copy graphics data to child +4 0 0 12 0 -1 0 0.00000 4 15 100 139 422 process and set flag +4 0 0 12 0 -1 0 0.00000 4 15 67 139 544 graphics_quit +4 0 0 12 0 -1 0 0.00000 4 15 59 519 84 function call +4 0 0 12 0 -1 0 0.00000 4 15 18 519 124 flag +4 0 0 12 0 -1 0 0.00000 4 15 67 379 384 graphics data +4 0 0 12 0 -1 0 0.00000 4 15 89 379 402 in shared memory +4 0 0 12 0 -1 0 0.00000 4 15 46 519 164 data flow +4 0 0 12 0 -1 0 0.00000 4 15 145 439 304 draw_it (main draw function) +4 0 0 24 0 -1 0 0.00000 4 28 177 379 534 Main structure of +4 0 0 24 0 -1 0 0.00000 4 28 68 419 569 cfiles.c +4 1 0 12 0 -1 0 0.00000 4 15 125 449 594 30.7.98 bertram lueckehe +4 0 0 12 0 -1 0 0.00000 4 15 26 29 304 Main +4 0 0 12 0 -1 0 0.00000 4 15 41 29 324 program +4 0 0 12 0 -1 0 0.00000 4 15 52 239 304 chkfordata diff --git a/flash2d/doc/structure.ps b/flash2d/doc/structure.ps new file mode 100644 index 0000000000000000000000000000000000000000..9ecc399404b2ced56dcc1caca32d1c9de27acc47 --- /dev/null +++ b/flash2d/doc/structure.ps @@ -0,0 +1,211 @@ +%!PS-Adobe-2.0 +%%Title: /tmp/xfig-fig016113 +%%Creator: fig2dev Version 2.1.8 Patchlevel 0 +%%CreationDate: Thu Jul 30 10:22:40 1998 +%%For: bertram@hpux05 (Bertram Lueckehe,FB08,,) +%%Orientation: Portrait +%%BoundingBox: 36 160 558 682 +%%Pages: 1 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/l {lineto} bind def +/m {moveto} bind def +/s {stroke} bind def +/n {newpath} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/clp {closepath} bind def +/graycol {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul +4 -2 roll mul setrgbcolor} bind def +/col-1 {} def +/col0 {0 0 0 setrgbcolor} bind def +/col1 {0 0 1 setrgbcolor} bind def +/col2 {0 1 0 setrgbcolor} bind def +/col3 {0 1 1 setrgbcolor} bind def +/col4 {1 0 0 setrgbcolor} bind def +/col5 {1 0 1 setrgbcolor} bind def +/col6 {1 1 0 setrgbcolor} bind def +/col7 {1 1 1 setrgbcolor} bind def +/col8 {.68 .85 .9 setrgbcolor} bind def +/col9 {0 .39 0 setrgbcolor} bind def +/col10 {.65 .17 .17 setrgbcolor} bind def +/col11 {1 .51 0 setrgbcolor} bind def +/col12 {.63 .13 .94 setrgbcolor} bind def +/col13 {1 .75 .8 setrgbcolor} bind def +/col14 {.7 .13 .13 setrgbcolor} bind def +/col15 {1 .84 0 setrgbcolor} bind def + end +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def +%%EndProlog + +$F2psBegin +0 setlinecap 0 setlinejoin +18.5 700.0 translate 0.900 -0.900 scale +0.500 setlinewidth +% Polyline +n 119 179 m 119 119 l 239 119 l 239 179 l clp gs col-1 s gr +% Polyline +n 179 319 m 179 219 l 119 219 l 119 319 l clp gs col-1 s gr +% Polyline +n 379 179 m 379 59 l 119 59 l 119 179 l clp gs col-1 s gr +% Polyline +n 379 259 m 379 219 l 219 219 l 219 259 l clp gs col-1 s gr +% Polyline +n 379 319 m 379 279 l 219 279 l 219 319 l clp gs col-1 s gr +% Polyline +n 599 319 m 599 279 l 419 279 l 419 319 l clp gs col-1 s gr +% Polyline +n 299 459 m 299 359 l 119 359 l 119 459 l clp gs col-1 s gr +% Polyline +n 79 39 m 249 39 l 249 59 l gs col-1 s gr +n 251.000 51.000 m 249.000 59.000 l 247.000 51.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 139 179 m 139 199 l 79 199 l gs col-1 s gr +n 87.000 201.000 m 79.000 199.000 l 87.000 197.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 309 179 m 309 199 l 159 199 l 159 219 l gs col-1 s gr +n 161.000 211.000 m 159.000 219.000 l 157.000 211.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 179 239 m 219 239 l gs col-1 s gr +n 211.000 237.000 m 219.000 239.000 l 211.000 241.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 179 299 m 219 299 l gs col-1 s gr +n 211.000 297.000 m 219.000 299.000 l 211.000 301.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 379 299 m 419 299 l gs col-1 s gr +n 411.000 297.000 m 419.000 299.000 l 411.000 301.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 79 339 m 209 339 l 209 359 l gs col-1 s gr +n 211.000 351.000 m 209.000 359.000 l 207.000 351.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 209 459 m 209 479 l 79 479 l gs col-1 s gr +n 87.000 481.000 m 79.000 479.000 l 87.000 477.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 299 559 m 299 519 l 119 519 l 119 559 l clp gs col-1 s gr +% Polyline +n 79 499 m 209 499 l 209 519 l gs col-1 s gr +n 211.000 511.000 m 209.000 519.000 l 207.000 511.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 209 559 m 209 579 l 79 579 l gs col-1 s gr +n 87.000 581.000 m 79.000 579.000 l 87.000 577.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 79 599 m 79 19 l 19 19 l 19 599 l clp gs col-1 s gr + [4.000000] 0 setdash +% Polyline +n 299 539 m 319 539 l 319 319 l gs col-1 s gr + [] 0 setdash +n 317.000 327.000 m 319.000 319.000 l 321.000 327.000 l gs 2 setlinejoin col-1 s gr + [4.000000] 0 setdash +% Polyline +n 279 359 m 279 319 l gs col-1 s gr + [] 0 setdash +n 277.000 327.000 m 279.000 319.000 l 281.000 327.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 439 79 m 499 79 l gs col-1 s gr +n 491.000 77.000 m 499.000 79.000 l 491.000 81.000 l gs 2 setlinejoin col-1 s gr + [4.000000] 0 setdash +% Polyline +n 439 119 m 499 119 l gs col-1 s gr + [] 0 setdash +n 491.000 117.000 m 499.000 119.000 l 491.000 121.000 l gs 2 setlinejoin col-1 s gr + 1 setlinecap [1 3.000000] 3.000000 setdash +% Polyline +n 299 399 m 359 399 l gs col-1 s gr + [] 0 setdash 0 setlinecap +n 351.000 397.000 m 359.000 399.000 l 351.000 401.000 l gs 2 setlinejoin col-1 s gr + 1 setlinecap [1 3.000000] 3.000000 setdash +% Polyline +n 459 354 m 459 319 l gs col-1 s gr + [] 0 setdash 0 setlinecap +n 457.000 327.000 m 459.000 319.000 l 461.000 327.000 l gs 2 setlinejoin col-1 s gr +% Polyline +n 379 119 m 379 99 l 119 99 l 119 119 l clp gs col-1 s gr + 1 setlinecap [1 3.000000] 3.000000 setdash +% Polyline +n 479 459 m 359 459 l 359 359 l 479 359 l clp gs col-1 s gr + [] 0 setdash 0 setlinecap +/Times-Roman findfont 12.00 scalefont setfont +239 304 m +gs 1 -1 scale (chkfordata) col-1 show gr + 1 setlinecap [1 3.000000] 3.000000 setdash +% Polyline +n 439 159 m 499 159 l gs col-1 s gr + [] 0 setdash 0 setlinecap +n 491.000 157.000 m 499.000 159.000 l 491.000 161.000 l gs 2 setlinejoin col-1 s gr +/Times-Roman findfont 12.00 scalefont setfont +139 134 m +gs 1 -1 scale (parent:) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +139 154 m +gs 1 -1 scale (return to main part) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +259 134 m +gs 1 -1 scale (child:) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +259 152 m +gs 1 -1 scale (open GL-windows) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +259 170 m +gs 1 -1 scale (enter glutMainLoop) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +234 114 m +gs 1 -1 scale (fork) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +204 84 m +gs 1 -1 scale (graphics_init_) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +239 244 m +gs 1 -1 scale (button and menu functions) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +134 274 m +gs 1 -1 scale (GLUT) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +139 384 m +gs 1 -1 scale (graphics_draw) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +139 404 m +gs 1 -1 scale (copy graphics data to child) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +139 422 m +gs 1 -1 scale (process and set flag) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +139 544 m +gs 1 -1 scale (graphics_quit) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +519 84 m +gs 1 -1 scale (function call) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +519 124 m +gs 1 -1 scale (flag) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +379 384 m +gs 1 -1 scale (graphics data) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +379 402 m +gs 1 -1 scale (in shared memory) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +519 164 m +gs 1 -1 scale (data flow) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +439 304 m +gs 1 -1 scale (draw_it \(main draw function\)) col-1 show gr +/Times-Roman findfont 24.00 scalefont setfont +379 534 m +gs 1 -1 scale (Main structure of ) col-1 show gr +/Times-Roman findfont 24.00 scalefont setfont +419 569 m +gs 1 -1 scale (cfiles.c) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +449 594 m +gs 1 -1 scale (30.7.98 bertram lueckehe) dup stringwidth pop 2 div neg 0 rmoveto col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +29 304 m +gs 1 -1 scale (Main) col-1 show gr +/Times-Roman findfont 12.00 scalefont setfont +29 324 m +gs 1 -1 scale (program) col-1 show gr +showpage +$F2psEnd diff --git a/flash2d/eval/diagfile.gnu b/flash2d/eval/diagfile.gnu new file mode 100644 index 0000000000000000000000000000000000000000..0e30720801e9eba4cbbcd3a231ad6848c2e8563c --- /dev/null +++ b/flash2d/eval/diagfile.gnu @@ -0,0 +1,112 @@ +# script for visualizing diagnostic output +# for gnuplot 3.5 (linux version) +# j. behrens 7/94, 5/97 +# +# no. of elements +set term pbm color medium +set autoscale; +set title "Flash90 total No. of Elements"; +set xlabel "timestep no."; +set ylabel "no. of elements"; +set output "elements.ppm" +plot 'Flash90_diag.0000' us 1:2 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of elements +set title "Flash90 No. of Elements (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of elmnts"; +set output "fine-elements.ppm" +plot 'Flash90_diag.0000' us 1:3 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 total No. of Edges"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +set output "edges.ppm" +plot 'Flash90_diag.0000' us 1:4 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 No. of Edges (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +set output "fine-edges.ppm" +plot 'Flash90_diag.0000' us 1:5 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of nodes +set title "Flash90 No. of Nodes"; +set xlabel "timestep no."; +set ylabel "no. of nodes"; +set output "nodes.ppm" +plot 'Flash90_diag.0000' us 1:6 wi lines; +# pause -1 "ENTER to continue"; +# +# Min +set title "Flash90 Minimum of u"; +set xlabel "timestep no."; +set ylabel "Min."; +set output "minimum.ppm" +plot 'Flash90_diag.0000' us 1:7 wi lines; +# pause -1 "ENTER to continue"; +# +# Max +set title "Flash90 Maximum of u"; +set xlabel "timestep no."; +set ylabel "Max."; +set output "maximum.ppm" +plot 'Flash90_diag.0000' us 1:8 wi lines; +# pause -1 "ENTER to continue"; +# +# rfm +set title "Flash90 RFM"; +set xlabel "timestep no."; +set ylabel "rfm"; +#set noautoscale y; +#set yrange [0.95:1.05]; +set output "rfm.ppm" +plot 'Flash90_diag.0000' us 1:9 wi lines; +# pause -1 "ENTER to continue"; +# +# rsm +set title "Flash90 RSM"; +set xlabel "timestep no."; +set ylabel "rsm"; +#set autoscale; +set output "rsm.ppm" +plot 'Flash90_diag.0000' us 1:10 wi lines; +# pause -1 "ENTER to continue"; +# +# Max Norm Error +set title "Flash90 Error (Max-Norm)"; +set xlabel "timestep no."; +set ylabel "maximum norm"; +set output "maxnorm.ppm" +plot 'Flash90_diag.0000' us 1:11 wi lines; +# pause -1 "ENTER to continue"; +# +# L2 Norm Error +set title "Flash90 Error (L2-Norm)"; +set xlabel "timestep no."; +set ylabel "L2 norm"; +set output "l2norm.ppm" +plot 'Flash90_diag.0000' us 1:12 wi lines; +# pause -1 "ENTER to continue"; +# +# Diffusion Error +set title "Flash90 Diffusion Error"; +set xlabel "timestep no."; +set ylabel "diff. error"; +set output "diffusion.ppm" +plot 'Flash90_diag.0000' us 1:13 wi lines; +# pause -1 "ENTER to continue"; +# +# Dispersion Error +set title "Flash90 Dispersion Error"; +set xlabel "timestep no."; +set ylabel "disp. error"; +set output "dispersion.ppm" +plot 'Flash90_diag.0000' us 1:14 wi lines; +# pause -1 "ENTER to continue"; diff --git a/flash2d/eval/diagmulti.m b/flash2d/eval/diagmulti.m new file mode 100644 index 0000000000000000000000000000000000000000..351eb397a6d57c3d92c8f72e72b7350b2dc07c3b --- /dev/null +++ b/flash2d/eval/diagmulti.m @@ -0,0 +1,149 @@ +function diags(file) +% An M-File to postprocess data written by Flash90 +% j. behrens 03/2002 +% +% clear old data structures and initialize +%clear; + +% set constants +LW=2; +TF=14; +AF=12; +% +% open file and read data +file1=sprintf('%s%s',file,'.clip'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW1 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +file1=sprintf('%s%s',file,'.dual'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW2 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +file1=sprintf('%s%s',file,'.cons'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW3 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +file1=sprintf('%s%s',file,'.quad'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW4 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +file1=sprintf('%s%s',file,'.quad7'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW5 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +file1=sprintf('%s%s',file,'.machenh'); +disp(sprintf('%s%s\n','reading data from ',file1)); +iou = fopen(file1); +RAW6 = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f',[14,inf]); +stat = fclose(iou); +disp('... done, now processing grid ...'); +% +% determine sizes +[n,m]= size(RAW1); +step=RAW1(1,1:m); +p1=plot(step,RAW1(2,1:m),'r-',step,RAW2(2,1:m),'b--',step,RAW3(2,1:m),'co-',step,RAW4(2,1:m),'y*-',step,RAW5(2,1:m),'gd-',step,RAW6(2,1:m),'m:'); +t1=title('No. of total elements'); +x1=xlabel('time step'); y1=ylabel('elements'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(3,1:m),'r-',step,RAW2(3,1:m),'b--',step,RAW3(3,1:m),'co-',step,RAW4(3,1:m),'y*-',step,RAW5(3,1:m),'gd-',step,RAW6(3,1:m),'m:'); +t1=title('No. of fine grid elements'); +x1=xlabel('time step'); y1=ylabel('elements'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(4,1:m),'r-',step,RAW2(4,1:m),'b--',step,RAW3(4,1:m),'co-',step,RAW4(4,1:m),'y*-',step,RAW5(4,1:m),'gd-',step,RAW6(4,1:m),'m:'); +t1=title('No. of total edges'); +x1=xlabel('time step'); y1=ylabel('edges'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(5,1:m),'r-',step,RAW2(5,1:m),'b--',step,RAW3(5,1:m),'co-',step,RAW4(5,1:m),'y*-',step,RAW5(5,1:m),'gd-',step,RAW6(5,1:m),'m:'); +t1=title('No. of fine grid edges'); +x1=xlabel('time step'); y1=ylabel('edges'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(6,1:m),'r-',step,RAW2(6,1:m),'b--',step,RAW3(6,1:m),'co-',step,RAW4(6,1:m),'y*-',step,RAW5(6,1:m),'gd-',step,RAW6(6,1:m),'m:'); +t1=title('No. of nodes'); +x1=xlabel('time step'); y1=ylabel('nodes'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(7,1:m),'r-',step,RAW2(7,1:m),'b--',step,RAW3(7,1:m),'co-',step,RAW4(7,1:m),'y*-',step,RAW5(7,1:m),'gd-',step,RAW6(7,1:m),'m:'); +t1=title('Minimum tracer concentration'); +x1=xlabel('time step'); y1=ylabel('minimum'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(8,1:m),'r-',step,RAW2(8,1:m),'b--',step,RAW3(8,1:m),'co-',step,RAW4(8,1:m),'y*-',step,RAW5(8,1:m),'gd-',step,RAW6(8,1:m),'m:'); +t1=title('Maximum tracer concentration'); +x1=xlabel('time step'); y1=ylabel('maximum'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(9,1:m),'r-',step,RAW2(9,1:m),'b--',step,RAW3(9,1:m),'co-',step,RAW4(9,1:m),'y*-',step,RAW5(9,1:m),'gd-',step,RAW6(9,1:m),'m:'); +t1=title('Ratio of First Moments'); +x1=xlabel('time step'); y1=ylabel('rfm'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(10,1:m),'r-',step,RAW2(10,1:m),'b--',step,RAW3(10,1:m),'co-',step,RAW4(10,1:m),'y*-',step,RAW5(10,1:m),'gd-',step,RAW6(10,1:m),'m:'); +t1=title('Ratio of Second Moments'); +x1=xlabel('time step'); y1=ylabel('rsm'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +pause + +p1=plot(step,RAW1(12,1:m),'r-',step,RAW2(12,1:m),'b--',step,RAW3(12,1:m),'co-',step,RAW4(12,1:m),'y*-',step,RAW5(12,1:m),'gd-',step,RAW6(12,1:m),'m:'); +t1=title('L2-Norm'); +x1=xlabel('time step'); y1=ylabel('l2'); +legend('Clipping ','Dual Mesh ','Stani.Gravel','Quadrature ','Quadrature 7','Machenhauer ',0) +set(p1,'LineWidth',LW) +set(t1,'FontSize',TF) +set(x1,'FontSize',AF) +set(y1,'FontSize',AF) +%pause + +return diff --git a/flash2d/eval/diagprint.gnu b/flash2d/eval/diagprint.gnu new file mode 100644 index 0000000000000000000000000000000000000000..3eff639a65f1de2c024f46d5a0e4c70449ba55b7 --- /dev/null +++ b/flash2d/eval/diagprint.gnu @@ -0,0 +1,112 @@ +# script for visualizing diagnostic output +# for gnuplot 3.5 (linux version) +# j. behrens 7/94, 5/97 +# +# no. of elements +set term post eps +set autoscale; +set title "Flash90 total No. of Elements"; +set xlabel "timestep no."; +set ylabel "no. of elements"; +set output "elements.eps" +plot 'Flash90_diag.0000' us 1:2 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of elements +set title "Flash90 No. of Elements (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of elmnts"; +set output "fine-elements.eps" +plot 'Flash90_diag.0000' us 1:3 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 total No. of Edges"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +set output "edges.eps" +plot 'Flash90_diag.0000' us 1:4 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 No. of Edges (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +set output "fine-edges.eps" +plot 'Flash90_diag.0000' us 1:5 wi lines; +# pause -1 "ENTER to continue"; +# +# no. of nodes +set title "Flash90 No. of Nodes"; +set xlabel "timestep no."; +set ylabel "no. of nodes"; +set output "nodes.eps" +plot 'Flash90_diag.0000' us 1:6 wi lines; +# pause -1 "ENTER to continue"; +# +# Min +set title "Flash90 Minimum of u"; +set xlabel "timestep no."; +set ylabel "Min."; +set output "minimum.eps" +plot 'Flash90_diag.0000' us 1:7 wi lines; +# pause -1 "ENTER to continue"; +# +# Max +set title "Flash90 Maximum of u"; +set xlabel "timestep no."; +set ylabel "Max."; +set output "maximum.eps" +plot 'Flash90_diag.0000' us 1:8 wi lines; +# pause -1 "ENTER to continue"; +# +# rfm +set title "Flash90 RFM"; +set xlabel "timestep no."; +set ylabel "rfm"; +#set noautoscale y; +#set yrange [0.95:1.05]; +set output "rfm.eps" +plot 'Flash90_diag.0000' us 1:9 wi lines; +# pause -1 "ENTER to continue"; +# +# rsm +set title "Flash90 RSM"; +set xlabel "timestep no."; +set ylabel "rsm"; +#set autoscale; +set output "rsm.eps" +plot 'Flash90_diag.0000' us 1:10 wi lines; +# pause -1 "ENTER to continue"; +# +# Max Norm Error +set title "Flash90 Error (Max-Norm)"; +set xlabel "timestep no."; +set ylabel "maximum norm"; +set output "maxnorm.eps" +plot 'Flash90_diag.0000' us 1:11 wi lines; +# pause -1 "ENTER to continue"; +# +# L2 Norm Error +set title "Flash90 Error (L2-Norm)"; +set xlabel "timestep no."; +set ylabel "L2 norm"; +set output "l2norm.eps" +plot 'Flash90_diag.0000' us 1:12 wi lines; +# pause -1 "ENTER to continue"; +# +# Diffusion Error +set title "Flash90 Diffusion Error"; +set xlabel "timestep no."; +set ylabel "diff. error"; +set output "diffusion.eps" +plot 'Flash90_diag.0000' us 1:13 wi lines; +# pause -1 "ENTER to continue"; +# +# Dispersion Error +set title "Flash90 Dispersion Error"; +set xlabel "timestep no."; +set ylabel "disp. error"; +set output "dispersion.eps" +plot 'Flash90_diag.0000' us 1:14 wi lines; +# pause -1 "ENTER to continue"; diff --git a/flash2d/eval/diags.gnu b/flash2d/eval/diags.gnu new file mode 100644 index 0000000000000000000000000000000000000000..c3b6571b697d66a058f2f76008edbdfd0994faf4 --- /dev/null +++ b/flash2d/eval/diags.gnu @@ -0,0 +1,98 @@ +# script for visualizing diagnostic output +# for gnuplot 3.5 (linux version) +# j. behrens 7/94, 5/97 +# +# no. of elements +set autoscale; +set title "Flash90 total No. of Elements"; +set xlabel "timestep no."; +set ylabel "no. of elements"; +plot 'Flash90_diag.0000' us 1:2 wi lines; +pause -1 "ENTER to continue"; +# +# no. of elements +set title "Flash90 No. of Elements (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of elmnts"; +plot 'Flash90_diag.0000' us 1:3 wi lines; +pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 total No. of Edges"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +plot 'Flash90_diag.0000' us 1:4 wi lines; +pause -1 "ENTER to continue"; +# +# no. of edges +set title "Flash90 No. of Edges (fine grid)"; +set xlabel "timestep no."; +set ylabel "no. of edges"; +plot 'Flash90_diag.0000' us 1:5 wi lines; +pause -1 "ENTER to continue"; +# +# no. of nodes +set title "Flash90 No. of Nodes"; +set xlabel "timestep no."; +set ylabel "no. of nodes"; +plot 'Flash90_diag.0000' us 1:6 wi lines; +pause -1 "ENTER to continue"; +# +# Min +set title "Flash90 Minimum of u"; +set xlabel "timestep no."; +set ylabel "Min."; +plot 'Flash90_diag.0000' us 1:7 wi lines; +pause -1 "ENTER to continue"; +# +# Max +set title "Flash90 Maximum of u"; +set xlabel "timestep no."; +set ylabel "Max."; +plot 'Flash90_diag.0000' us 1:8 wi lines; +pause -1 "ENTER to continue"; +# +# rfm +set title "Flash90 RFM"; +set xlabel "timestep no."; +set ylabel "rfm"; +#set noautoscale y; +#set yrange [0.95:1.05]; +plot 'Flash90_diag.0000' us 1:9 wi lines; +pause -1 "ENTER to continue"; +# +# rsm +set title "Flash90 RSM"; +set xlabel "timestep no."; +set ylabel "rsm"; +#set autoscale; +plot 'Flash90_diag.0000' us 1:10 wi lines; +pause -1 "ENTER to continue"; +# +# Max Norm Error +set title "Flash90 Error (Max-Norm)"; +set xlabel "timestep no."; +set ylabel "maximum norm"; +plot 'Flash90_diag.0000' us 1:11 wi lines; +pause -1 "ENTER to continue"; +# +# L2 Norm Error +set title "Flash90 Error (L2-Norm)"; +set xlabel "timestep no."; +set ylabel "L2 norm"; +plot 'Flash90_diag.0000' us 1:12 wi lines; +pause -1 "ENTER to continue"; +# +# Diffusion Error +set title "Flash90 Diffusion Error"; +set xlabel "timestep no."; +set ylabel "diff. error"; +plot 'Flash90_diag.0000' us 1:13 wi lines; +pause -1 "ENTER to continue"; +# +# Dispersion Error +set title "Flash90 Dispersion Error"; +set xlabel "timestep no."; +set ylabel "disp. error"; +plot 'Flash90_diag.0000' us 1:14 wi lines; +pause -1 "ENTER to continue"; diff --git a/flash2d/eval/diags.m b/flash2d/eval/diags.m new file mode 100644 index 0000000000000000000000000000000000000000..ee2fa12333cfbccc5d7e83679fad7d0fe51829b7 --- /dev/null +++ b/flash2d/eval/diags.m @@ -0,0 +1,79 @@ +function diags(file) +% An M-File to postprocess data written by Flash90 +% j. behrens 03/2002 +% +% clear old data structures and initialize +%clear; +% +% open file and read data +disp('reading data ...'); +iou = fopen(file); +RAW = fscanf(iou,'%d %d %d %d %d %d %f %f %f %f %f %f %f %f %f',[15,inf]); +stat = fclose(iou); +disp('... done, now processing grid ...'); +% +% determine sizes +[n,m]= size(RAW); +step=RAW(1,1:m); +elements=RAW(2,1:m); +plot(step,elements) +title('No. of total elements') +xlabel('time step'); ylabel('elements') +pause + +felements=RAW(3,1:m); +plot(step,felements) +title('No. of fine grid elements') +xlabel('time step'); ylabel('elements') +pause + +edges=RAW(4,1:m); +plot(step,edges) +title('No. of total edges') +xlabel('time step'); ylabel('edges') +pause + +fedges=RAW(5,1:m); +plot(step,fedges) +title('No. of fine grid edges') +xlabel('time step'); ylabel('edges') +pause + +nodes=RAW(6,1:m); +plot(step,nodes) +title('No. of nodes') +xlabel('time step'); ylabel('nodes') +pause + +mini=RAW(7,1:m); +plot(step,mini) +title('Minimum tracer concentration') +xlabel('time step'); ylabel('minimum') +pause + +maxi=RAW(8,1:m); +plot(step,maxi) +title('Maximum tracer concentration') +xlabel('time step'); ylabel('maximum') +pause + +rfm=RAW(9,1:m); +plot(step,rfm) +title('Ration of First Moments') +xlabel('time step'); ylabel('rfm') +pause + +rsm=RAW(10,1:m); +plot(step,rsm) +title('Ration of Second Moments') +xlabel('time step'); ylabel('rsm') +pause + +l2=RAW(12,1:m); +plot(step,l2) +title('L2-Norm') +xlabel('time step'); ylabel('l2') +pause + + +return diff --git a/flash2d/eval/gmv_default.attr b/flash2d/eval/gmv_default.attr new file mode 100644 index 0000000000000000000000000000000000000000..1fdb67b344fcedc2741142fce4472f6fccbb3ea2 --- /dev/null +++ b/flash2d/eval/gmv_default.attr @@ -0,0 +1,246 @@ +gmv_attributes + +filename /home/bornemann/mentrup/dev/flash2d/irix/Flash90_gmv.0000 + +matrgba 4 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 + +active_mat 1 0 + +angles -9.000000e+01 9.000000e+01 0.000000e+00 + +magnify 1.122018e+00 + +range 1.020000e+00 1.020000e+00 1.020000e+00 + +span 1.766692e+00 + +aspect 1.201884e+00 + +pan 0.000000e+00 0.000000e+00 + +translate 0.000000e+00 0.000000e+00 -5.000000e-01 + +glob_icmin -5.100000e-01 -5.100000e-01 -1.000000e-02 + +glob_icmax 5.100000e-01 5.100000e-01 1.010000e+00 + +explodefact 0.000000e+00 0.000000e+00 + +velscale 1.000000e+00 + +velarrowsize 1.000000e+00 + +axisflag 1 + +nodesflag 0 + +linesflag 0 + +polysflag 0 + +cellsflag 1 + +celledgesflag 1 + +cellexpflag -1 + +timeflag 0 + +cycleflag 0 + +distscaleflag 0 + +textureflag 0 + +tracerflag 0 + +nodefieldactive -1 + +cellfieldactive 4 + +tracefieldactive 0 + +isosurf_on 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +isosurf_val 1020 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +isosurf_field 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +backgroundcolor 16777215 + +globfieldmin 16 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +globfieldmax 16 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.000000e+00 + +nfld_nice_min 16 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +nfld_nice_max 16 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.000000e+00 + +nfieldlimauto 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_nice 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_log 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +light 0.000000e+00 0.000000e+00 + +glob_icmino -5.100000e-01 -5.100000e-01 -1.000000e-02 + +glob_icmaxo 5.100000e-01 5.100000e-01 1.010000e+00 + +xscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +yscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +zscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponbox 0 + +nrefl_loops 1 + +reflect 0 0 0 + +clipvalue 0.000000e+00 1.000000e+00 + +_minbdval -5.100000e-01 -5.100000e-01 -1.000000e-02 + +_maxbdval 5.100000e-01 5.100000e-01 1.010000e+00 + +_minfdval -5.100000e-01 -5.100000e-01 -1.000000e-02 + +_maxfdval 5.100000e-01 5.100000e-01 1.010000e+00 + +mat_order 0 + +scaleaxiso 1.000000e+00 1.000000e+00 1.000000e+00 + +scaleaxis 1.000000e+00 1.000000e+00 1.000000e+00 + +nodeselflag 11 1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + +cellandorflag 10 0 0 0 0 0 0 0 0 0 0 + +colorbarflag 1 + +colorbarpref 0 + +boundingboxflag 0 + +_minbbval -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbval 5.000000e-01 5.000000e-01 1.000000e+00 + +_minbbvalo -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbvalo 5.000000e-01 5.000000e-01 1.000000e+00 + +viewflag 0 + +flypos 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponcellsel 0 + +vectfld_ -1 -1 -1 + +speedfld 7 + +maxspeed 0.000000e+00 + +vectorflag 0 + +vectorarrow 1 + +cvectfld_ -1 -1 -1 + +cspeedfld 2 + +cmaxspeed 0.000000e+00 + +cvectorflag 0 + +titleflag 1 + +titlestr + +titlestr2 + +cellcontflag 0 + +nodeselmat_on 0 + +cellselmat_on 0 + +fieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +cfieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +bboxcoordflag 1 + +nodenumflag 0 + +cellnumflag 0 + +globfieldcmax 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +globfieldcmin 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_min 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_max 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfieldlimauto 8 0 0 0 0 0 0 0 0 + +cfld_nice 8 0 0 0 0 0 0 0 0 + +cfld_log 8 0 0 0 0 0 0 0 0 + +pnt_size 2 0 + +line_size 1 0 + +node0matflag 0 + +cell0matflag 0 + +tracehistflag 0 + +tracehiststop 0 + +tracehiststride 1 + +tracehistpoints 1 + +cellshadeflag 0 + +fieldcolortype 0 + +nset_contours 10 + +facerefineflag 0 + +cellnormflag 0 + +cellmedianedgeflag 0 + +cellnodenumflag 0 + +cellfacenumflag 0 + +polystiplflag 0 + +end_attributes + diff --git a/flash2d/eval/gmv_wind.attr b/flash2d/eval/gmv_wind.attr new file mode 100644 index 0000000000000000000000000000000000000000..69bb94ef30af95effcbbae8ed15a2ea0d18b5055 --- /dev/null +++ b/flash2d/eval/gmv_wind.attr @@ -0,0 +1,246 @@ +gmv_attributes + +filename /home/bornemann/mentrup/dev/flash2d/irix/Flash90_gmv.0001 + +matrgba 4 0.000000e+00 0.000000e+00 0.000000e+00 1.000000e+00 + +active_mat 1 0 + +angles -9.000000e+01 9.000000e+01 0.000000e+00 + +magnify 1.122018e+00 + +range 1.020000e+00 1.020000e+00 1.027721e+00 + +span 1.771161e+00 + +aspect 1.201884e+00 + +pan 0.000000e+00 0.000000e+00 + +translate 0.000000e+00 0.000000e+00 -5.037850e-01 + +glob_icmin -5.100000e-01 -5.100000e-01 -1.007570e-02 + +glob_icmax 5.100000e-01 5.100000e-01 1.017646e+00 + +explodefact 0.000000e+00 0.000000e+00 + +velscale 2.200000e+00 + +velarrowsize 6.000000e-01 + +axisflag 1 + +nodesflag 1 + +linesflag 0 + +polysflag 0 + +cellsflag 0 + +celledgesflag 0 + +cellexpflag -1 + +timeflag 0 + +cycleflag 0 + +distscaleflag 0 + +textureflag 0 + +tracerflag 0 + +nodefieldactive 4 + +cellfieldactive -1 + +tracefieldactive 0 + +isosurf_on 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +isosurf_val 1020 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +isosurf_field 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +backgroundcolor 16777215 + +globfieldmin 16 -7.965000e-02 -1.271300e-01 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 -8.175000e-02 -3.376000e-02 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +globfieldmax 16 8.175000e-02 3.376000e-02 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.328779e-01 7.965000e-02 1.271300e-01 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.007570e+00 + +nfld_nice_min 16 -7.965000e-02 -1.271300e-01 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 -8.175000e-02 -3.376000e-02 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +nfld_nice_max 16 8.175000e-02 3.376000e-02 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.000000e-05 7.965000e-02 1.271300e-01 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.007570e+00 + +nfieldlimauto 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_nice 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_log 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +light 0.000000e+00 0.000000e+00 + +glob_icmino -5.100000e-01 -5.100000e-01 -1.007570e-02 + +glob_icmaxo 5.100000e-01 5.100000e-01 1.017646e+00 + +xscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +yscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +zscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponbox 0 + +nrefl_loops 1 + +reflect 0 0 0 + +clipvalue 0.000000e+00 1.000000e+00 + +_minbdval -5.100000e-01 -5.100000e-01 -1.007570e-02 + +_maxbdval 5.100000e-01 5.100000e-01 1.017646e+00 + +_minfdval -5.100000e-01 -5.100000e-01 -1.007570e-02 + +_maxfdval 5.100000e-01 5.100000e-01 1.017646e+00 + +mat_order 0 + +scaleaxiso 1.000000e+00 1.000000e+00 1.000000e+00 + +scaleaxis 1.000000e+00 1.000000e+00 1.000000e+00 + +nodeselflag 11 1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + +cellandorflag 10 0 0 0 0 0 0 0 0 0 0 + +colorbarflag 1 + +colorbarpref 0 + +boundingboxflag 0 + +_minbbval -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbval 5.000000e-01 5.000000e-01 1.007570e+00 + +_minbbvalo -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbvalo 5.000000e-01 5.000000e-01 1.007570e+00 + +viewflag 0 + +flypos 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponcellsel 0 + +vectfld_ 8 9 -1 + +speedfld 7 + +maxspeed 1.328779e-01 + +vectorflag 1 + +vectorarrow 1 + +cvectfld_ -1 -1 -1 + +cspeedfld 2 + +cmaxspeed 0.000000e+00 + +cvectorflag 0 + +titleflag 1 + +titlestr + +titlestr2 + +cellcontflag 0 + +nodeselmat_on 0 + +cellselmat_on 0 + +fieldcalc 5 + 4 0 0 8 -1.000000e+00 -X + 4 1 0 8 -1.000000e+00 -Y + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +cfieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +bboxcoordflag 1 + +nodenumflag 0 + +cellnumflag 0 + +globfieldcmax 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +globfieldcmin 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_min 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_max 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfieldlimauto 8 0 0 0 0 0 0 0 0 + +cfld_nice 8 0 0 0 0 0 0 0 0 + +cfld_log 8 0 0 0 0 0 0 0 0 + +pnt_size 2 0 + +line_size 1 0 + +node0matflag 0 + +cell0matflag 0 + +tracehistflag 0 + +tracehiststop 0 + +tracehiststride 1 + +tracehistpoints 1 + +cellshadeflag 0 + +fieldcolortype 0 + +nset_contours 10 + +facerefineflag 0 + +cellnormflag 0 + +cellmedianedgeflag 0 + +cellnodenumflag 0 + +cellfacenumflag 0 + +polystiplflag 0 + +end_attributes + diff --git a/flash2d/eval/gmvlevel.attr b/flash2d/eval/gmvlevel.attr new file mode 100644 index 0000000000000000000000000000000000000000..1f2c4283a3663c561ee5f120cb2497cd64ddb36c --- /dev/null +++ b/flash2d/eval/gmvlevel.attr @@ -0,0 +1,244 @@ +gmv_attributes + +filename /home/behrens/Development/flash2d/linux/Flash90_gmv.0005 + +matrgba 4 0.000000e+00 1.000000e+00 0.000000e+00 1.000000e+00 + +active_mat 1 0 + +angles -9.000000e+01 9.000000e+01 0.000000e+00 + +magnify 4.998045e+00 + +range 1.020000e+00 1.020000e+00 6.016807e+00 + +span 6.187306e+00 + +aspect 1.285714e+00 + +pan 0.000000e+00 0.000000e+00 + +translate -0.000000e+00 -0.000000e+00 -2.102625e+00 + +glob_icmin -5.100000e-01 -5.100000e-01 -9.057783e-01 + +glob_icmax 5.100000e-01 5.100000e-01 5.111028e+00 + +explodefact 0.000000e+00 0.000000e+00 + +velscale 1.000000e+00 + +velarrowsize 1.000000e+00 + +axisflag 1 + +nodesflag 0 + +linesflag 0 + +polysflag 0 + +cellsflag 1 + +celledgesflag 1 + +cellexpflag -1 + +timeflag 0 + +cycleflag 0 + +distscaleflag 0 + +textureflag 1 + +tracerflag 0 + +nodefieldactive -1 + +cellfieldactive 16 + +tracefieldactive 0 + +isosurf_on 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +isosurf_val 1020 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +isosurf_field 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +backgroundcolor 4294967295 + +globfieldmin 16 -3.376000e-02 -3.376000e-02 0.000000e+00 0.000000e+00 -8.467900e-01 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 -8.467900e-01 + +globfieldmax 16 3.376000e-02 3.376000e-02 1.000000e-05 1.000000e-05 5.052040e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 5.052040e+00 + +nfld_nice_min 16 -3.376000e-02 -3.376000e-02 0.000000e+00 0.000000e+00 -8.467900e-01 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 -8.467900e-01 + +nfld_nice_max 16 3.376000e-02 3.376000e-02 1.000000e-05 1.000000e-05 5.052040e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 5.052040e+00 + +nfieldlimauto 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_nice 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_log 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +light -7.400000e-01 3.200000e-01 + +glob_icmino -5.100000e-01 -5.100000e-01 -9.057783e-01 + +glob_icmaxo 5.100000e-01 5.100000e-01 5.111028e+00 + +xscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +yscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +zscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponbox 0 + +nrefl_loops 1 + +reflect 0 0 0 + +clipvalue 0.000000e+00 1.000000e+00 + +_minbdval -5.100000e-01 -5.100000e-01 -9.057783e-01 + +_maxbdval 5.100000e-01 5.100000e-01 5.111028e+00 + +_minfdval -5.100000e-01 -5.100000e-01 -9.057783e-01 + +_maxfdval 5.100000e-01 5.100000e-01 5.111028e+00 + +mat_order 0 + +scaleaxiso 1.000000e+00 1.000000e+00 1.000000e+00 + +scaleaxis 1.000000e+00 1.000000e+00 1.000000e+00 + +nodeselflag 11 1000 1 1 1 1 1 1 1 1 1 1 1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 10 0 0 0 0 0 0 0 0 0 0 + +colorbarflag 1 + +colorbarpref 0 + +boundingboxflag 0 + +_minbbval -5.000000e-01 -5.000000e-01 -8.467900e-01 + +_maxbbval 5.000000e-01 5.000000e-01 5.052040e+00 + +_minbbvalo -5.000000e-01 -5.000000e-01 -8.467900e-01 + +_maxbbvalo 5.000000e-01 5.000000e-01 5.052040e+00 + +viewflag 0 + +flypos 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponcellsel 0 + +vectfld_ -1 -1 -1 + +speedfld 7 + +maxspeed 0.000000e+00 + +vectorflag 0 + +vectorarrow 1 + +vectorlog 0 + +cvectfld_ -1 -1 -1 + +cspeedfld 2 + +cmaxspeed 0.000000e+00 + +cvectorflag 0 + +titleflag 0 + +cellcontflag 0 + +nodeselmat_on 0 + +cellselmat_on 0 + +fieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +cfieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +bboxcoordflag 1 + +nodenumflag 0 + +cellnumflag 0 + +globfieldcmax 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +globfieldcmin 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_min 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_max 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfieldlimauto 8 0 0 0 0 0 0 0 0 + +cfld_nice 8 0 0 0 0 0 0 0 0 + +cfld_log 8 0 0 0 0 0 0 0 0 + +pnt_size 2 0 + +line_size 1 0 + +node0matflag 0 + +cell0matflag 0 + +tracehistflag 0 + +tracehiststop 0 + +tracehiststride 1 + +tracehistpoints 1 + +cellshadeflag 0 + +fieldcolortype 0 + +nset_contours 10 + +facerefineflag 0 + +cellnormflag 0 + +cellmedianedgeflag 0 + +cellnodenumflag 0 + +cellfacenumflag 0 + +polystiplflag 0 + +end_attributes + diff --git a/flash2d/eval/gmvtracer.attr b/flash2d/eval/gmvtracer.attr new file mode 100644 index 0000000000000000000000000000000000000000..e0bca08fb2334dbfc624014c5eab96f62dffe041 --- /dev/null +++ b/flash2d/eval/gmvtracer.attr @@ -0,0 +1,244 @@ +gmv_attributes + +filename /home/behrens/Development/flash2d/linux/Flash90_gmv.0004 + +matrgba 4 0.000000e+00 1.000000e+00 0.000000e+00 1.000000e+00 + +active_mat 1 0 + +angles -9.000000e+01 4.850000e+01 0.000000e+00 + +magnify 1.357688e+00 + +range 1.020000e+00 1.020000e+00 6.040124e-01 + +span 1.563851e+00 + +aspect 1.285714e+00 + +pan 0.000000e+00 0.000000e+00 + +translate 4.336809e-18 -0.000000e+00 -2.039515e-01 + +glob_icmin -5.100000e-01 -5.100000e-01 -9.805469e-02 + +glob_icmax 5.100000e-01 5.100000e-01 5.059577e-01 + +explodefact 0.000000e+00 0.000000e+00 + +velscale 1.000000e+00 + +velarrowsize 1.000000e+00 + +axisflag 1 + +nodesflag 0 + +linesflag 0 + +polysflag 0 + +cellsflag 1 + +celledgesflag 1 + +cellexpflag -1 + +timeflag 0 + +cycleflag 0 + +distscaleflag 0 + +textureflag 1 + +tracerflag 0 + +nodefieldactive -1 + +cellfieldactive 4 + +tracefieldactive 0 + +isosurf_on 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 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00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +isosurf_field 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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00 0.000000e+00 -9.213300e-01 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 -9.213300e-01 + +globfieldmax 16 3.376000e-02 3.376000e-02 1.000000e-05 1.000000e-05 5.000360e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 5.000360e+00 + +nfld_nice_min 16 -3.376000e-02 -3.376000e-02 0.000000e+00 0.000000e+00 -9.213300e-01 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 -9.213300e-01 + +nfld_nice_max 16 3.376000e-02 3.376000e-02 1.000000e-05 1.000000e-05 5.000360e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 5.000360e+00 + +nfieldlimauto 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_nice 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_log 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +light -7.400000e-01 3.200000e-01 + +glob_icmino -5.100000e-01 -5.100000e-01 -9.805469e-02 + +glob_icmaxo 5.100000e-01 5.100000e-01 5.059577e-01 + +xscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +yscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +zscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponbox 0 + +nrefl_loops 1 + +reflect 0 0 0 + +clipvalue 0.000000e+00 1.000000e+00 + +_minbdval -5.100000e-01 -5.100000e-01 -9.805469e-02 + +_maxbdval 5.100000e-01 5.100000e-01 5.059577e-01 + +_minfdval -5.100000e-01 -5.100000e-01 -9.805469e-02 + +_maxfdval 5.100000e-01 5.100000e-01 5.059577e-01 + +mat_order 0 + +scaleaxiso 1.000000e+00 1.000000e+00 1.000000e+00 + +scaleaxis 1.000000e+00 1.000000e+00 1.000000e-01 + +nodeselflag 11 1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + +cellandorflag 10 0 0 0 0 0 0 0 0 0 0 + +colorbarflag 1 + +colorbarpref 0 + +boundingboxflag 0 + +_minbbval -5.000000e-01 -5.000000e-01 -9.213300e-02 + +_maxbbval 5.000000e-01 5.000000e-01 5.000360e-01 + +_minbbvalo -5.000000e-01 -5.000000e-01 -9.213300e-02 + +_maxbbvalo 5.000000e-01 5.000000e-01 5.000360e-01 + +viewflag 1 + +flypos 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponcellsel 0 + +vectfld_ -1 -1 -1 + +speedfld 7 + +maxspeed 0.000000e+00 + +vectorflag 0 + +vectorarrow 1 + +vectorlog 0 + +cvectfld_ -1 -1 -1 + +cspeedfld 2 + +cmaxspeed 0.000000e+00 + +cvectorflag 0 + +titleflag 0 + +cellcontflag 0 + +nodeselmat_on 0 + +cellselmat_on 0 + +fieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +cfieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +bboxcoordflag 1 + +nodenumflag 0 + +cellnumflag 0 + +globfieldcmax 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +globfieldcmin 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_min 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_max 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfieldlimauto 8 0 0 0 0 0 0 0 0 + +cfld_nice 8 0 0 0 0 0 0 0 0 + +cfld_log 8 0 0 0 0 0 0 0 0 + +pnt_size 2 0 + +line_size 1 0 + +node0matflag 0 + +cell0matflag 0 + +tracehistflag 0 + +tracehiststop 0 + +tracehiststride 1 + +tracehistpoints 1 + +cellshadeflag 1 + +fieldcolortype 0 + +nset_contours 10 + +facerefineflag 0 + +cellnormflag 0 + +cellmedianedgeflag 0 + +cellnodenumflag 0 + +cellfacenumflag 0 + +polystiplflag 0 + +end_attributes + diff --git a/flash2d/eval/gmvtracer1.attr b/flash2d/eval/gmvtracer1.attr new file mode 100644 index 0000000000000000000000000000000000000000..99291471eba2396dc84d087c8414bd71db2ddfe0 --- /dev/null +++ b/flash2d/eval/gmvtracer1.attr @@ -0,0 +1,244 @@ +gmv_attributes + +filename /home/behrens/Development/flash2d/linux/Flash90_gmv.0000 + +matrgba 4 0.000000e+00 1.000000e+00 0.000000e+00 1.000000e+00 + +active_mat 1 0 + +angles -9.000000e+01 4.500000e+01 0.000000e+00 + +magnify 1.357688e+00 + +range 1.020000e+00 1.020000e+00 5.100000e-01 + +span 1.530000e+00 + +aspect 1.285714e+00 + +pan 0.000000e+00 0.000000e+00 + +translate 4.336809e-18 -0.000000e+00 -2.500000e-01 + +glob_icmin -5.100000e-01 -5.100000e-01 -5.000000e-03 + +glob_icmax 5.100000e-01 5.100000e-01 5.050000e-01 + +explodefact 0.000000e+00 0.000000e+00 + +velscale 1.000000e+00 + +velarrowsize 1.000000e+00 + +axisflag 1 + +nodesflag 0 + +linesflag 0 + +polysflag 0 + +cellsflag 1 + +celledgesflag 1 + +cellexpflag -1 + +timeflag 0 + +cycleflag 0 + +distscaleflag 0 + +textureflag 1 + +tracerflag 0 + +nodefieldactive -1 + +cellfieldactive 4 + +tracefieldactive 0 + +isosurf_on 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +isosurf_val 1020 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +isosurf_field 1020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +backgroundcolor 4294967295 + +globfieldmin 16 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +globfieldmax 16 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.000000e+00 + +nfld_nice_min 16 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 -5.000000e-01 -5.000000e-01 0.000000e+00 + +nfld_nice_max 16 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e+00 1.500000e+01 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 1.000000e-05 5.000000e-01 5.000000e-01 1.000000e+00 + +nfieldlimauto 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_nice 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +nfld_log 16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + +light -7.400000e-01 3.200000e-01 + +glob_icmino -5.100000e-01 -5.100000e-01 -5.000000e-03 + +glob_icmaxo 5.100000e-01 5.100000e-01 5.050000e-01 + +xscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +yscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +zscale 1.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponbox 0 + +nrefl_loops 1 + +reflect 0 0 0 + +clipvalue 0.000000e+00 1.000000e+00 + +_minbdval -5.100000e-01 -5.100000e-01 -5.000000e-03 + +_maxbdval 5.100000e-01 5.100000e-01 5.050000e-01 + +_minfdval -5.100000e-01 -5.100000e-01 -5.000000e-03 + +_maxfdval 5.100000e-01 5.100000e-01 5.050000e-01 + +mat_order 0 + +scaleaxiso 1.000000e+00 1.000000e+00 1.000000e+00 + +scaleaxis 1.000000e+00 1.000000e+00 5.000000e-01 + +nodeselflag 11 1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 + +cellandorflag 10 0 0 0 0 0 0 0 0 0 0 + +colorbarflag 1 + +colorbarpref 0 + +boundingboxflag 0 + +_minbbval -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbval 5.000000e-01 5.000000e-01 5.000000e-01 + +_minbbvalo -5.000000e-01 -5.000000e-01 0.000000e+00 + +_maxbbvalo 5.000000e-01 5.000000e-01 5.000000e-01 + +viewflag 1 + +flypos 0.000000e+00 0.000000e+00 0.000000e+00 + +cliponcellsel 0 + +vectfld_ -1 -1 -1 + +speedfld 7 + +maxspeed 0.000000e+00 + +vectorflag 0 + +vectorarrow 1 + +vectorlog 0 + +cvectfld_ -1 -1 -1 + +cspeedfld 2 + +cmaxspeed 0.000000e+00 + +cvectorflag 0 + +titleflag 0 + +cellcontflag 0 + +nodeselmat_on 0 + +cellselmat_on 0 + +fieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +cfieldcalc 5 + 4 -1 -1 -1 0.000000e+00 FldCalc1 + 4 -1 -1 -1 0.000000e+00 FldCalc2 + 4 -1 -1 -1 0.000000e+00 FldCalc3 + 4 -1 -1 -1 0.000000e+00 FldCalc4 + 4 -1 -1 -1 0.000000e+00 FldCalc5 + +bboxcoordflag 1 + +nodenumflag 0 + +cellnumflag 0 + +globfieldcmax 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +globfieldcmin 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_min 8 4.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfld_nice_max 8 1.500000e+01 1.000000e-05 1.000000e-05 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 + +cfieldlimauto 8 0 0 0 0 0 0 0 0 + +cfld_nice 8 0 0 0 0 0 0 0 0 + +cfld_log 8 0 0 0 0 0 0 0 0 + +pnt_size 2 0 + +line_size 1 0 + +node0matflag 0 + +cell0matflag 0 + +tracehistflag 0 + +tracehiststop 0 + +tracehiststride 1 + +tracehistpoints 1 + +cellshadeflag 0 + +fieldcolortype 0 + +nset_contours 10 + +facerefineflag 0 + +cellnormflag 0 + +cellmedianedgeflag 0 + +cellnodenumflag 0 + +cellfacenumflag 0 + +polystiplflag 0 + +end_attributes + diff --git a/flash2d/eval/gpc2matlab.m b/flash2d/eval/gpc2matlab.m new file mode 100644 index 0000000000000000000000000000000000000000..13bbb1294c9637aec260dfe4f9525a5f8a774df0 --- /dev/null +++ b/flash2d/eval/gpc2matlab.m @@ -0,0 +1,50 @@ +% An M-File to postprocess data written by gpc DEBUG option +% Visualization in 2D +% j. behrens 12/2001 +% +% clear old data structures and initialize +clear; +imax = 3000; +% colormap(hsv) +% brighten(0.8) +% +% pre loop file opening +hold on +iou = fopen('GPC_DEBUG_polyisec.dat'); + +% main loop, first read line +icnt=0; +while icnt<imax +%while 1 + tline = fgetl(iou); + if ~ischar(tline) + break + else + ipoly=sscanf(tline,'%d'); + for i=1:ipoly + tline = fgetl(iou); + if ~ischar(tline) + break + else + ivert=sscanf(tline,'%d'); + xcoo=zeros(1,ivert); ycoo=zeros(1,ivert); zcoo=zeros(1,ivert); + for j=1:ivert + tline = fgetl(iou); + if ~ischar(tline) + break + else +% [xcoo(j) ycoo(j)]=sscanf(tline,'%f %f'); + a=sscanf(tline,'%f %f'); + xcoo(j)=a(1); ycoo(j)=a(2); + end + end + patch(xcoo,ycoo,zcoo,'w'); + end +% disp(tline) + icnt= icnt+1; + end + end +end + +stat = fclose(iou); +hold off diff --git a/flash2d/eval/grid_dat.m b/flash2d/eval/grid_dat.m new file mode 100644 index 0000000000000000000000000000000000000000..2c5dcc29a92c0efe61131c953751d975bc06ea9e --- /dev/null +++ b/flash2d/eval/grid_dat.m @@ -0,0 +1,19 @@ +% An M-File to postprocess data written by STASL +% Visualization in 3D +% j. behrens 6/94 +% +% open file and read data +disp('reading data ...'); +iou = fopen('Flash90_matlab.0000'); +LEN = fscanf(iou,'%d',1) +LAV = fscanf(iou,'%f',[LEN,LEN]); +stat = fclose(iou); +disp('... done, now processing grid ...'); +% +% transpose +VAL= LAV.'; +% +% plot contours +contourf(VAL); +disp('... finished'); + diff --git a/flash2d/eval/gridded.gnu b/flash2d/eval/gridded.gnu new file mode 100644 index 0000000000000000000000000000000000000000..9a542ea9a8b5bf02b54f50b578ec8f511a974181 --- /dev/null +++ b/flash2d/eval/gridded.gnu @@ -0,0 +1,18 @@ +################################################################## +# SPLASH/fe # +# Semi-Lagrangian Parallel and Locally Adaptive # +# SHallow-water model/ with Finite Elements # +################################################################## +# script for visualizing stasl output # +# for gnuplot 3.5 (linux version) # +# j. behrens 7/94, 3/96 # +################################################################## +#set noparametric; +set hidden3d; +set view 30,322.5,1,2; +set title "FLASH Data Plot"; +splot 'Flash90_matlab.0001' with lines; +pause -1 "ENTER to continue"; +#----------------------------------------------------------------# +# END # +#----------------------------------------------------------------# diff --git a/flash2d/eval/poly.m b/flash2d/eval/poly.m new file mode 100644 index 0000000000000000000000000000000000000000..1af232044ce50d90ebd9efde5af95efdcad38468 --- /dev/null +++ b/flash2d/eval/poly.m @@ -0,0 +1,38 @@ +% An M-File to postprocess data written by STASL +% Visualization in 3D +% j. behrens 10/96 +% +% clear old data structures and initialize +clear; + colormap(hsv) + brighten(0.8) +% +% open file and read data +disp('reading data ...'); +iou = fopen('../compile/macosx_intel/Flash90_matlab.0001'); +RAW = fscanf(iou,'%f %f %f %f %f %f %d',[7,inf]); +stat = fclose(iou); +disp('... done, now processing grid ...'); +% +% determine sizes +m= size(RAW,2); +% +% loop through elements +for i=1:m, + for j=1:3, + XX(j,i)= RAW(j,i); + YY(j,i)= RAW(j+3,i); + end + XX(4,i)= RAW(1,i); + YY(4,i)= RAW(4,i); + COLOR(i)= RAW(7,i); +end +% +% plot +if COLOR(1)<0 + plot(XX,YY,'w'); +else + fill(XX,YY,COLOR); +end +disp('... finished'); + diff --git a/flash2d/eval/poly.sci b/flash2d/eval/poly.sci new file mode 100644 index 0000000000000000000000000000000000000000..7ddeacdd967e46bc622afb695938836aaf72c219 --- /dev/null +++ b/flash2d/eval/poly.sci @@ -0,0 +1,39 @@ +// An M-File to postprocess data written by STASL +// Visualization in 3D +// j. behrens 10/96 +// +// clear old data structures +clear; +// +// open file and read data +disp('reading data ...'); +//iou = file('open','fort.20'); +RAW = read('fort.20',-1,7); +//stat = fclose(iou); +disp('... done, now processing grid ...'); +// +// determine sizes +[m,n]= size(RAW); +// +// loop through elements +for i=1:m, + for j=1:3, + XX(j,i)= RAW(i,j); + YY(j,i)= RAW(i,j+3); + end + XX(4,i)= RAW(i,1); + YY(4,i)= RAW(i,4); + COLOR(i)= RAW(i,7); +end +// +// plot +if COLOR(1)<0. + plot2d(0,0,-1,"010"," ",[-0.5,-0.5,0.5,0.5]) + xfpolys(XX,YY); +else + plot2d(0,0,-1,"010"," ",[-0.5,-0.5,0.5,0.5]) + xfpolys(XX,YY,COLOR); + xfpolys(XX,YY); +end +disp('... finished'); + diff --git a/flash2d/eval/triang.m b/flash2d/eval/triang.m new file mode 100644 index 0000000000000000000000000000000000000000..2e293753c1be5e9cd188db4cff045ba2dcbcf041 --- /dev/null +++ b/flash2d/eval/triang.m @@ -0,0 +1,53 @@ +%% An M-File to postprocess data +%% +%% Aufruf z.B. triang(5) : visualisiert das ergebnis des 5.ten +%% zeitschritts (vorausgesetzt nat"urlich, die files Flash90_matval.0005 +%% und Flash90_mattri.0005 wurden mit matlab_tri_plot (im modul IO_plot) +%% erzeugt). +%% +%% N. Rakowsky 5/99 +% +% +function triang(zeitschritt) +% +%% knoten-koordinaten und tracer-konzentration +file_laden = ['load Flash90_matval.',sprintf('%04i',zeitschritt)]; +eval(file_laden) +%% triangulierung: per element die 3 zugeh"origen knoten +%% (zeiger auf zeilen in Flash90_matval) +file_laden = ['load Flash90_mattri.',sprintf('%04i',zeitschritt)]; +eval(file_laden) +% +tri = Flash90_mattri; +[d,hilf]=size(Flash90_matval); +x=Flash90_matval(1:d,1); +y=Flash90_matval(1:d,2); +z=Flash90_matval(1:d,3); +% +%% und 3D-plot +trisurf(tri,x,y,z) +% +%% J"orns colormap: +cj(1:64,1) = linspace(0,1,64)'; +cj(1:64,2) = zeros(64,1); +cj(1:64,3) = linspace(1,0,64)'; +colormap(cj) +% +% +%% grid off: +%shading interp +% +%% 2D-plot +%view(2) +%axis equal +%axis([-.5 .5 -.5 .5]) +% +%% zoomen, ausschnitt x1<x<x2, y1<y<y2 +%% axis([x1 x2 y1 y2]) +%axis([-.4 0 -.4 0]) +% +% +%% interpolieren auf regelm"assiges gitter, z.b. f"ur schnitte +%[xi,yi]=meshgrid(-.5:.01:.5); +%zi=griddata(x,y,z,xi,yi); +%mesh(xi,yi,zi) diff --git a/flash2d/lib/visnet4flash/FlashData.C b/flash2d/lib/visnet4flash/FlashData.C new file mode 100644 index 0000000000000000000000000000000000000000..ff45dfccf13861d3cfa84d5e875d93f1860c521d --- /dev/null +++ b/flash2d/lib/visnet4flash/FlashData.C @@ -0,0 +1,418 @@ +#include "fortify.h" +#include "FlashData.h" +#include "3dutil.h" +#include <stdio.h> + +int FlashData::WCOMP; +int FlashData::NORM; + +FlashData::FlashData(int dim): + dim_(dim), + grid_(NULL), iso_(NULL), + gridDS_(NULL), vec_(NULL), + coords_(NULL), vals_(NULL), + showGrid_(1), showVecs_(1), + //autoMinMax_(0), + vecHeight_(0.0), + nVal_(TRACER){ + init(); +} +FlashData::FlashData(int dim, + int nn, int ne, int nt, + float *coords, + float *vals, + int *edges, int *triangles): + dim_(dim), + grid_(NULL), iso_(NULL), + gridDS_(NULL), vec_(NULL), + coords_(NULL), vals_(NULL), + showGrid_(1), showVecs_(1), + //autoMinMax_(0), + vecHeight_(0.0), + nVal_(TRACER){ + init(); + setData(nn, ne, nt, + coords, + vals, + edges, triangles); +} +void FlashData::init(){ + // set Parameters + if(dim_ == 2){ + WCOMP = -1; + NORM = 3; + }else{ + WCOMP = 3; + NORM = 4; + } + + // create gridDS + grid_ = new M3TV_ArrayTriangleList(); + if(dim_ == 2){ + gridDS_ = grid_; + }else{ + iso_ = new M3TV_IsoSurfaceDataSource(); + iso_->setDataSource(grid_); + gridDS_ = iso_; + } + + zVal_ = dim_==2?TRACER:ZCOORD; + + // create vector list + vec_ = new VectorList(); +} + +FlashData::~FlashData(){ + if(grid_ != NULL){ + delete grid_; + } + if(iso_ != NULL){ + delete iso_; + } + if(vec_ != NULL){ + delete vec_; + } +} + +/* +void FlashData::setAutoMinMax(int b){ + autoMinMax_ = b; +} + +int FlashData::getAutoMinMax(){ + return autoMinMax_; +} +*/ + +void FlashData::setData(int nn, int ne, int nt, + float *coords, + float *vals, + int *edges, int *triangles){ + + //printf("locking ... changed = %d\n", hasChanged()); + nn_ = nn; + ne_ = ne; + nt_ = nt; + coords_ = coords; + vals_ = vals; + e_ = edges; + t_ = triangles; + + // vals[5*i+0] == tracer + // vals[5*i+1] == ucomp + // vals[5*i+2] == vcomp + // vals[5*i+3] == 3d:wcomp / 2d:uv_norm + // vals[5*i+4] == 3d:uvw_norm + + // calc norm / find extrema + if(dim_ == 2){ + // first node + vals_[3] = sqrt(vals_[1]*vals_[1] + vals_[2]*vals_[2]); + for(int vg = 0; vg < 4; ++vg){ + valmin_[vg] = vals_[vg]; + valmax_[vg] = vals_[vg]; + } + for(int i = 1; i < nn_; i++){ + vals_[5*i+3] = sqrt(vals_[5*i+1]*vals_[5*i+1] + vals_[5*i+2]*vals_[5*i+2]); + for(int vg = 0; vg < 4; ++vg){ + if(valmin_[vg] > vals_[vg]) valmin_[vg] = vals_[vg]; + if(valmax_[vg] < vals_[vg]) valmax_[vg] = vals_[vg]; + } + } + }else{ + // first node + vals_[3] = sqrt(vals_[1]*vals_[1] + vals_[2]*vals_[2] + vals_[3]*vals_[3]); + for(int vg = 0; vg < 5; ++vg){ + valmin_[vg] = vals_[vg]; + valmax_[vg] = vals_[vg]; + } + for(int i = 0; i < nn_; i++){ + vals_[5*i+4] = sqrt(vals_[5*i+1]*vals_[5*i+1] + vals_[5*i+2]*vals_[5*i+2] + vals_[5*i+3]*vals_[5*i+3]); + for(int vg = 0; vg < 4; ++vg){ + if(valmin_[vg] > vals_[vg]) valmin_[vg] = vals_[vg]; + if(valmax_[vg] < vals_[vg]) valmax_[vg] = vals_[vg]; + } + } + } + + lock(); + + grid_->setNodes(new M3TV_ArrayWrapper<float>(3, coords_, nn_)); + grid_->setNodeValues(new M3TV_ArrayWrapper<float>(5, vals_, nn_), dim_==2?4:5); + grid_->setEdges(new M3TV_ArrayWrapper<int>(2, e_, ne_)); + grid_->setTriangles(new M3TV_ArrayWrapper<int>(3, t_, nt_)); + grid_->setIndexCorrection(-1); + grid_->setChanged(1); + + vec_->setData(nn_, dim_, coords_, vals_); + //vec_->setHeight(vecHeight_); + + chooseZValues(zVal_); + chooseNodeValueGroup(nVal_); + + /* + if(iso_ != NULL){ + iso_->regenerateIsoSurface(); + } + */ + + // find minimal and maximal coordinates and nodeal values + + /* + if(autoMinMax_){ + printf("finding minimal and maximal coords and nodal values\n"); + + double vg, vv; + setMinMaxCoords(((vg=grid_->getMinX()) < (vv=vec_->getMinX())) ? vg : vv, + ((vg=grid_->getMaxX()) > (vv=vec_->getMaxX())) ? vg : vv, + ((vg=grid_->getMinY()) < (vv=vec_->getMinY())) ? vg : vv, + ((vg=grid_->getMaxY()) > (vv=vec_->getMaxY())) ? vg : vv, + ((vg=grid_->getMinZ()) < (vv=vec_->getMinZ())) ? vg : vv, + ((vg=grid_->getMaxZ()) > (vv=vec_->getMaxZ())) ? vg : vv); + setMinMaxNodeValues(((vg=grid_->getMinNodeValue()) < (vv=vec_->getMinNodeValue())) ? vg : vv, + ((vg=grid_->getMaxNodeValue()) > (vv=vec_->getMaxNodeValue())) ? vg : vv); + } + */ + setChanged(1); + unlock(); +} + +/** + * Choose which of the nodal values (tracer, ucomp or vcomp) to use as z-values + */ +void FlashData::chooseZValues(int z){ + int src; + float val; + + zVal_ = z; // save + if(z == ZCOORD){ + return; + } + + src = z; + + //lock(); + + // min_ and max_ inherited from M3TV_NodeList + Z(min_) = Z(max_) = vals_[src]; // [0*5+src] + for(int i = 0; i < nn_; i++){ + val = vals_[i*5+src]; + coords_[i*3+2] = val; + if(val < Z(min_)) Z(min_) = val; + if(val > Z(max_)) Z(max_) = val; + } + setChanged(1); + + //unlock(); +} + +void FlashData::setGridVisibility(int b){ + showGrid_ = b; + setChanged(1); +} +int FlashData::getGridVisibility(){ + return showGrid_; +} +void FlashData::setVectorsVisibility(int b){ + showVecs_ = b; + setChanged(1); +} +int FlashData::getVectorsVisibility(){ + return showVecs_; +} +void FlashData::setVectorsHeight(double h){ + vecHeight_ = h; + vec_->setHeight(h); + setChanged(1); +} +double FlashData::getVectorsHeight(){ + return vecHeight_; +} + +int FlashData::getNodeValueGroupCount(){ + return dim_==2?4:5; +} +int FlashData::chooseNodeValueGroup(int index){ + float *src = NULL; + + if(index < 0 || (dim_ == 2 && index >= 4) || index >= 5){ + return 0; + } + + nVal_ = index; + + grid_->chooseNodeValueGroup(index); + + minnv_ = valmin_[index]; + maxnv_ = valmax_[index]; + + setChanged(1); + + return 1; +} +int FlashData::getNodeValueGroupName(int index, char *name, int len){ + switch(index){ + case 0: + strncpy(name, (char*)"Tracer", len); + break; + case 1: + strncpy(name, (char*)"UComp", len); + break; + case 2: + strncpy(name, (char*)"VComp", len); + break; + case 3: + if(dim_ == 2){ + strncpy(name, (char*)"|(U,V)|", len); + }else{ + strncpy(name, (char*)"WComp", len); + } + case 4: + if(dim_ != 2){ + strncpy(name, (char*)"|(U,V,W)|", len); + }else{ + return 0; + } + break; + default: + return 0; + } + return 1; +} + +int FlashData::hasChanged(){ + return M3TV_TriangleList::hasChanged() || gridDS_->hasChanged(); +} +void FlashData::setChanged(int b){ + M3TV_TriangleList::setChanged(b); + gridDS_->setChanged(b); +} + +void FlashData::firstNode(){ + if(gridDS_ != NULL && showGrid_ == 1){ + gridDS_->firstNode(); + } + if(vec_ != NULL && showVecs_ == 1){ + vec_->firstNode(); + } + +} +M3TV_Node* FlashData::nextNode(){ + M3TV_Node* ret = NULL; + if(gridDS_ != NULL && showGrid_ == 1){ + ret = gridDS_->nextNode(); + } + if(ret == NULL){ + if(vec_ != NULL && showVecs_ == 1){ + ret = vec_->nextNode(); + } + } + return ret; +} + +void FlashData::firstEdge(){ + if(gridDS_ != NULL && showGrid_ == 1){ + gridDS_->firstEdge(); + } + if(vec_ != NULL && showVecs_ == 1){ + vec_->firstEdge(); + } +} +M3TV_Edge* FlashData::nextEdge(){ + M3TV_Edge* ret = NULL; + if(gridDS_ != NULL && showGrid_ == 1){ + ret = gridDS_->nextEdge(); + } + if(ret == NULL){ + if(vec_ != NULL && showVecs_ == 1){ + ret = vec_->nextEdge(); + } + } + return ret; +} + +void FlashData::firstTriangle(){ + if(gridDS_ != NULL && showGrid_ == 1){ + gridDS_->firstTriangle(); + } +} +M3TV_Triangle* FlashData::nextTriangle(){ + if(gridDS_ != NULL && showGrid_ == 1){ + return gridDS_->nextTriangle(); + } + return NULL; +} + +void FlashData::setTriangleVisibility(int b){ + if(iso_ != NULL){ + iso_->setTriangleVisibility(b); + setChanged(1); + } +} +int FlashData::getTriangleVisibility(){ + if(iso_ != NULL){ + return iso_->getTriangleVisibility(); + } + return 1; +} + +void FlashData::setEdgeVisibility(int b){ + if(iso_ != NULL){ + iso_->setEdgeVisibility(b); + setChanged(1); + } +} +int FlashData::getEdgeVisibility(){ + if(iso_ != NULL){ + return iso_->getEdgeVisibility(); + } + return 1; +} + +void FlashData::setNodeVisibility(int b){ + if(iso_ != NULL){ + iso_->setNodeVisibility(b); + setChanged(1); + } +} +int FlashData::getNodeVisibility(){ + if(iso_ != NULL){ + return iso_->getNodeVisibility(); + } + return 1; +} + +void FlashData::setIsoEdgeVisibility(int b){ + if(iso_ != NULL){ + iso_->setIsoEdgeVisibility(b); + setChanged(1); + } +} +int FlashData::getIsoEdgeVisibility(){ + if(iso_ != NULL){ + return iso_->getIsoEdgeVisibility(); + } + return 1; +} + +void FlashData::setIsoTriangleVisibility(int b){ + if(iso_ != NULL){ + iso_->setIsoTriangleVisibility(b); + setChanged(1); + } +} +int FlashData::getIsoTriangleVisibility(){ + if(iso_ != NULL){ + return iso_->getIsoTriangleVisibility(); + } + return 1; +} + +void FlashData::setIsoValue(double iso){ + if(iso_ != NULL){ + printf("generating isosurface ...\n"); + iso_->generateIsoSurface(iso); + printf("isosurface done.\n"); + setChanged(1); + } +} diff --git a/flash2d/lib/visnet4flash/FlashData.h b/flash2d/lib/visnet4flash/FlashData.h new file mode 100644 index 0000000000000000000000000000000000000000..7e254ce9005a534f943988985cf269b65c472c6d --- /dev/null +++ b/flash2d/lib/visnet4flash/FlashData.h @@ -0,0 +1,109 @@ +#ifndef FLASHDATA_H +#define FLASHDATA_H + +#include "M3TV_StdDataSource.h" +//#include "M3TV_Menu.h" +#include "VectorList.h" + +class FlashData : public M3TV_TriangleList{ +public: + //enum NODE_VALUES {TRACER = 0, UCOMP = 1, VCOMP = 2, WCOMP = 3, NORM=4, ZCOORD=5}; + const static int TRACER = 0; + const static int UCOMP = 1; + const static int VCOMP = 2; + static int WCOMP; + static int NORM; + const static int ZCOORD = 5; + + FlashData(int dim); + FlashData(int dim, + int nn, int ne, int nt, + float *coords, + float *vals, + int *edges, int *triangles); + ~FlashData(); + /* + void setAutoMinMax(int b); + int getAutoMinMax(); + */ + void setData(int nn, int ne, int nt, + float *coords, + float *vals, + int *edges, int *triangles); + + /** + * Choose which of the nodal values (tracer, ucomp or vcomp) to use as z-values + */ + void chooseZValues(int z); + + void setGridVisibility(int b); + int getGridVisibility(); + + void setVectorsVisibility(int b); + int getVectorsVisibility(); + + void setVectorsHeight(double h); + double getVectorsHeight(); + + int getNodeValueGroupCount(); + int chooseNodeValueGroup(int index); + int getEdgeValueGroupCount(){return 1;} + int chooseEdgeValueGroup(int index){return index == 0;} + int getTriangleValueGroupCount(){return 1;} + int chooseTriangleValueGroup(int index){return index == 0;} + + int getNodeValueGroupName(int index, char *name, int len); + int getEdgeValueGroupName(int index, char *name, int len){return 0;} + int getTriangleValueGroupName(int index, char *name, int len){return 0;} + + int hasChanged(); + void setChanged(int b); + + void firstNode(); + M3TV_Node* nextNode(); + + void firstEdge(); + M3TV_Edge* nextEdge(); + + void firstTriangle(); + M3TV_Triangle* nextTriangle(); + + void setTriangleVisibility(int b); + int getTriangleVisibility(); + + void setEdgeVisibility(int b); + int getEdgeVisibility(); + + void setNodeVisibility(int b); + int getNodeVisibility(); + + void setIsoEdgeVisibility(int b); + int getIsoEdgeVisibility(); + + void setIsoTriangleVisibility(int b); + int getIsoTriangleVisibility(); + + void setIsoValue(double iso); +private: + void init(); + int dim_; + M3TV_ArrayTriangleList *grid_; + M3TV_IsoSurfaceDataSource *iso_; + M3TV_TriangleList *gridDS_; + VectorList *vec_; + int nn_, ne_, nt_; + int *e_, *t_; + float *coords_, *vals_; + float valmin_[5], valmax_[5]; + int showGrid_, showVecs_; //, autoMinMax_; + double vecHeight_; + int zVal_; + int nVal_; +}; + +#endif + + + + + diff --git a/flash2d/lib/visnet4flash/FlashMenu.C b/flash2d/lib/visnet4flash/FlashMenu.C new file mode 100644 index 0000000000000000000000000000000000000000..24b5d7ceb1976237dc67b0df37d102a600d55a31 --- /dev/null +++ b/flash2d/lib/visnet4flash/FlashMenu.C @@ -0,0 +1,325 @@ +#include "fortify.h" +#include "FlashMenu.h" + +FlashMenu::FlashMenu(M3VisNETView *view, int dimension, + FlashData *fd1, FlashData *fd2, + M3TV_DoubleTriangleList *dtl): + view_(view), dim_(dimension), fd1_(fd1), fd2_(fd2), dtl_(dtl), + isoValue_(0), generateIso_(0), + flashMenu_(NULL), isoMenu_(NULL), + startstop_(NULL), step_(NULL), shGrid_(NULL), shVecs_(NULL), + miT_(NULL), miE_(NULL), miN_(NULL), + miIsoT_(NULL), miIsoE_(NULL), miSetValue_(NULL), + paused_(-1) +{ + sem_init(&wait_, 0, 0); +} + +FlashMenu::~FlashMenu(){ +} + +void FlashMenu::buildMenu(M3TV_Menu* menuRoot){ + M3TV_Menu* menu; + + // FlashMenu + flashMenu_ = new M3TV_Menu("FLASH"); + menuRoot->insert(flashMenu_, 1); + startstop_ = new M3TV_MenuItem("Start", 0, this); + flashMenu_->append(startstop_); + + step_ = new M3TV_MenuItem("Step", 1, this); + flashMenu_->append(step_); + + shGrid_ = new M3TV_MenuItem("hide Grid", 10, this); + flashMenu_->append(shGrid_); + shVecs_ = new M3TV_MenuItem("hide Vectors", 11, this); + flashMenu_->append(shVecs_); + + flashMenu_->append(new M3TV_MenuItem("set Vector Height", 20, this)); + + if(dim_ == 2){ + menu = new M3TV_Menu((char*)"choose Z values"); + flashMenu_->append(menu); + menu->append(new M3TV_MenuItem("Tracer", 31, this)); + menu->append(new M3TV_MenuItem("UComp", 32, this)); + menu->append(new M3TV_MenuItem("VComp", 33, this)); + menu->append(new M3TV_MenuItem("|(U,V)|", 34, this)); + } + + menu = new M3TV_Menu((char*)"choose nodal values"); + flashMenu_->append(menu); + menu->append(new M3TV_MenuItem("Tracer", 41, this)); + menu->append(new M3TV_MenuItem("UComp", 42, this)); + menu->append(new M3TV_MenuItem("VComp", 43, this)); + if(dim_ == 3){ + menu->append(new M3TV_MenuItem("WComp", 44, this)); + menu->append(new M3TV_MenuItem("|(U,V,W)|", 45, this)); + }else{ + menu->append(new M3TV_MenuItem("|(U,V)|", 45, this)); + } + + + // IsoSurface Menu + if(dim_ == 3){ + isoMenu_ = new M3TV_Menu("IsoSurface"); + menuRoot->insert(isoMenu_, 2); + int showT = fd1_->getTriangleVisibility(); + miT_ = new M3TV_MenuItem((showT?"hide Triangles":"show Triangles"), + 51, this); + isoMenu_->append(miT_); + int showE = fd1_->getEdgeVisibility(); + miE_ = new M3TV_MenuItem((showE?"hide Edges":"show Edges"), + 52, this); + isoMenu_->append(miE_); + int showN = fd1_->getNodeVisibility(); + miN_ = new M3TV_MenuItem((showN?"hide Nodes":"show Nodes"), + 53, this); + isoMenu_->append(miN_); + int showIsoT = fd1_->getIsoTriangleVisibility(); + miIsoT_ = new M3TV_MenuItem( + showIsoT?"hide Isosurface Triangles":"show Isosurface Triangles", + 54, this); + isoMenu_->append(miIsoT_); + int showIsoE = fd1_->getIsoEdgeVisibility(); + miIsoE_ = new M3TV_MenuItem( + showIsoE?"hide Isosurface Edges":"show Isosurface Edges", + 55, this); + isoMenu_->append(miIsoE_); +#ifdef DEBUG_ + //miTriang_ = new M3TV_MenuItem( + // showTriang_?"hide Triangulation":"show Triangulation", 56, this); + //isoMenu_->append(miTriang_); +#endif + miSetValue_ = new M3TV_MenuItem("set Isosurface Value", 57, this); + isoMenu_->append(miSetValue_); + } + + M3TV_MenuItem *close = menuRoot->find("Close"); + menuRoot->remove(close); + +} +void FlashMenu::removeMenu(M3TV_Menu* menuRoot){ + menuRoot->remove(flashMenu_); + delete flashMenu_; + menuRoot->remove(isoMenu_); + delete isoMenu_; +} + +/* + paused: state: caption: step: + -1 stopped Start y + 0 running Pause n + 1 stopped Resume y + 2 step Resume y + */ +void FlashMenu::menuCalled(int command){ + switch(command){ + case 0: // Start/Pause/Resume + switch(paused_){ + case -1: + //printf("-1\n"); + startstop_->setCaption("Pause"); + paused_ = 0; + flashMenu_->remove(step_); + sem_post(&wait_); + break; + case 0: + //printf("0\n"); + startstop_->setCaption("Resume"); + flashMenu_->insert(step_, 2); + while(sem_trywait(&wait_)==0){} + paused_ = 1; + break; + case 1: + //printf("1\n"); + flashMenu_->remove(step_); + startstop_->setCaption("Pause"); + paused_ = 0; + sem_post(&wait_); + break; + case 2: + //printf("2\n"); + flashMenu_->remove(step_); + startstop_->setCaption("Pause"); + paused_ = 0; + sem_post(&wait_); + break; + } + break; + case 1: // step + paused_ = 2; + startstop_->setCaption("Resume"); + sem_post(&wait_); + break; + + case 10: // show, hide Grid + if(fd1_->getGridVisibility()){ + fd1_->setGridVisibility(0); + fd2_->setGridVisibility(0); + shGrid_->setCaption("show Grid"); + }else{ + fd1_->setGridVisibility(1); + fd2_->setGridVisibility(1); + shGrid_->setCaption("hide Grid"); + } + dtl_->setChanged(1); + break; + case 11: // show, hide Vectors + if(fd1_->getVectorsVisibility()){ + fd1_->setVectorsVisibility(0); + fd2_->setVectorsVisibility(0); + shVecs_->setCaption("show Vectors"); + }else{ + fd1_->setVectorsVisibility(1); + fd2_->setVectorsVisibility(1); + shVecs_->setCaption("hide Vectors"); + } + dtl_->setChanged(1); + break; + case 20: // set Vector Height + double h; + cout<<"Enter new Height for Vectors: "; + cin>>h; + fd1_->setVectorsHeight(h); + fd2_->setVectorsHeight(h); + dtl_->setChanged(1); + break; + + case 31: + fd1_->chooseZValues(FlashData::TRACER); + fd2_->chooseZValues(FlashData::TRACER); + break; + case 32: + fd1_->chooseZValues(FlashData::UCOMP); + fd2_->chooseZValues(FlashData::UCOMP); + break; + case 33: + fd1_->chooseZValues(FlashData::VCOMP); + fd2_->chooseZValues(FlashData::VCOMP); + break; + case 34: + fd1_->chooseZValues(FlashData::NORM); + fd2_->chooseZValues(FlashData::NORM); + break; + + case 41: + fd1_->chooseNodeValueGroup(FlashData::TRACER); + fd2_->chooseNodeValueGroup(FlashData::TRACER); + break; + case 42: + fd1_->chooseNodeValueGroup(FlashData::UCOMP); + fd2_->chooseNodeValueGroup(FlashData::UCOMP); + break; + case 43: + fd1_->chooseNodeValueGroup(FlashData::VCOMP); + fd2_->chooseNodeValueGroup(FlashData::VCOMP); + break; + case 44: + fd1_->chooseNodeValueGroup(FlashData::WCOMP); + fd2_->chooseNodeValueGroup(FlashData::WCOMP); + break; + case 45: + fd1_->chooseNodeValueGroup(FlashData::NORM); + fd2_->chooseNodeValueGroup(FlashData::NORM); + break; + + // isosurface + case 51: + if(fd1_->getTriangleVisibility()){ + fd1_->setTriangleVisibility(0); + fd2_->setTriangleVisibility(0); + miT_->setCaption((char*)"show Triangles"); + }else{ + fd1_->setTriangleVisibility(1); + fd2_->setTriangleVisibility(2); + miT_->setCaption((char*)"hide Triangles"); + } + dtl_->setChanged(1); + break; + case 52: + if(fd1_->getEdgeVisibility()){ + fd1_->setEdgeVisibility(0); + fd2_->setEdgeVisibility(0); + miE_->setCaption((char*)"show Edges"); + }else{ + fd1_->setEdgeVisibility(1); + fd2_->setEdgeVisibility(2); + miE_->setCaption((char*)"hide Edges"); + } + dtl_->setChanged(1); + break; + case 53: + if(fd1_->getNodeVisibility()){ + fd1_->setNodeVisibility(0); + fd2_->setNodeVisibility(0); + miN_->setCaption((char*)"show Nodes"); + }else{ + fd1_->setNodeVisibility(1); + fd2_->setNodeVisibility(2); + miN_->setCaption((char*)"hide Node"); + } + dtl_->setChanged(1); + break; + case 54: + if(fd1_->getIsoTriangleVisibility()){ + fd1_->setIsoTriangleVisibility(0); + fd2_->setIsoTriangleVisibility(0); + miIsoT_->setCaption((char*)"show Isosurface Triangles"); + }else{ + fd1_->setIsoTriangleVisibility(1); + fd2_->setIsoTriangleVisibility(2); + miIsoT_->setCaption((char*)"hide Isosurface Triangles"); + } + dtl_->setChanged(1); + break; + case 55: + if(fd1_->getIsoEdgeVisibility()){ + fd1_->setIsoEdgeVisibility(0); + fd2_->setIsoEdgeVisibility(0); + miIsoE_->setCaption((char*)"show Isosurface Edges"); + }else{ + fd1_->setIsoEdgeVisibility(1); + fd2_->setIsoEdgeVisibility(2); + miIsoE_->setCaption((char*)"hide Isosurface Edges"); + } + dtl_->setChanged(1); + break; + case 57: + cout<<"Enter Isosurface Value: "; + cin>>isoValue_; + generateIso_ = 1; + FlashData *fd = (FlashData*)dtl_->getGraphics(); + dtl_->lock(); + fd->setIsoValue(isoValue_); + dtl_->setChanged(1); + dtl_->unlock(); + break; + } +} + +void FlashMenu::wait(){ + switch(paused_){ + case -1: + //startstop_->setCaption("Start"); + //printf("------------------------------------------waiting ...\n"); + sem_wait(&wait_); + //printf("------------------------------------------waited\n"); + break; + case 0: + break; + case 1: + //startstop_->setCaption("Resume"); + sem_wait(&wait_); + //startstop_->setCaption("Pause"); + break; + case 2: + sem_wait(&wait_); + break; + } +} + + +int FlashMenu::getIsoValue(double &value){ + value = isoValue_; + return generateIso_; +} diff --git a/flash2d/lib/visnet4flash/FlashMenu.h b/flash2d/lib/visnet4flash/FlashMenu.h new file mode 100644 index 0000000000000000000000000000000000000000..a937e00707ba6e67125aa02cf5534947856acf5f --- /dev/null +++ b/flash2d/lib/visnet4flash/FlashMenu.h @@ -0,0 +1,39 @@ +#ifndef FLASHMENU_H +#define FLASHMENU_H + +#include "M3VisNETView.h" +#include "FlashData.h" +//#include "M3TV_Menu.h" +#include <semaphore.h> +#include <stdio.h> + +class FlashMenu: public M3TV_MenuProvider{ +public: + FlashMenu(M3VisNETView *view, int dimension, + FlashData *fd1, FlashData *fd2, + M3TV_DoubleTriangleList *dtl); + virtual ~FlashMenu(); + + void buildMenu(M3TV_Menu* menuRoot); + void removeMenu(M3TV_Menu* menuRoot); + void menuCalled(int command); + + void wait(); + + int getIsoValue(double &value); +private: + M3VisNETView *view_; + int dim_; + FlashData *fd1_, *fd2_; + M3TV_DoubleTriangleList *dtl_; + double isoValue_; + int generateIso_; + + M3TV_Menu *flashMenu_, *isoMenu_; + M3TV_MenuItem *startstop_, *step_, *shGrid_, *shVecs_, + *miT_, *miE_, *miN_, *miIsoT_, *miIsoE_, *miSetValue_; + int paused_; + sem_t wait_; +}; + +#endif diff --git a/flash2d/lib/visnet4flash/Makefile b/flash2d/lib/visnet4flash/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..7b266db48b95f152c6a34c16545c6e980bb53ef3 --- /dev/null +++ b/flash2d/lib/visnet4flash/Makefile @@ -0,0 +1,85 @@ +# Set standart Settings +include ./Makefile.Settings + +# SET TARGET NAME +LIBTARGET := libvisnet4flash.a + +# SET MAIN DIRECTORY PATH +# !! This has to be alterd by user !! +ROOTDIR = $(HOME)/Development + +#SET TARGET DIRECTORY +# !! This has to be alterd by user !! +LIBDIR = $(ROOTDIR)/lib/SINGLE + +# SET VISNET DIRECTORY +# !! This has to be alterd by user !! +VISNETDIR = $(ROOTDIR)/visnet + +#LIBPATH := ../lib +#LIBS := -lm3tv -ldelaunay -ldetri -llia -lsos -lbasic \ +# $(VISNETDIR)/src/fortify/fortify.o -lglut -lGLU -lGL $(LIBS) -ltiff +VPATH := $(VISNETDIR)/include/tv \ + $(VISNETDIR)/include/delaunay \ + $(VISNETDIR)/include/fortify \ + $(VISNETDIR)/include/delaunay3d/detri \ + $(VISNETDIR)/include/delaunay3d/basic \ + $(VISNETDIR)/include/delaunay3d/sos \ + $(VISNETDIR)/include/delaunay3d/lia \ + /usr/include \ + /home/bornemann/m3/include \ + $(HOME)/include +INCLUDING := $(foreach dir,$(VPATH),-I$(dir)) +DEFS := $(foreach def,$(MACROS),-D$(def)) -D__EXTENSIONS__ +CFLAGS := $(OPTIONS) $(DEFS) $(INCLUDING) +#LDFLAGS := $(LIBPATH) $(LIBS) + +OBJS := FlashData.o FlashMenu.o VectorList.o VisNET4Flash.o + +export MODE +export MACROS +export CC + +.C.o: + @echo =============================================================== + $(CC) -c $(CFLAGS) $< + +all: visnet visnetinstall lib install + +lib: $(OBJS) + @echo =============================================================== + $(AR) $(ARFLAGS) $(LIBTARGET) $(OBJS) + +visnet: + cd $(VISNETDIR)/src; $(MAKE) + +visnetclean: + cd $(VISNETDIR)/src; $(MAKE) clean + +visnetinstall: + cp $(VISNETDIR)/src/delaunay/libdelaunay.a $(LIBDIR) + cp $(VISNETDIR)/src/delaunay3d/libbasic.a $(LIBDIR) + cp $(VISNETDIR)/src/delaunay3d/libdetri.a $(LIBDIR) + cp $(VISNETDIR)/src/delaunay3d/liblia.a $(LIBDIR) + cp $(VISNETDIR)/src/delaunay3d/libsos.a $(LIBDIR) + cp $(VISNETDIR)/src/fortify/fortify.o $(LIBDIR) + cp $(VISNETDIR)/src/tv/libm3tv.a $(LIBDIR) + +visnetuninstall: + rm -rf $(LIBDIR)/libdelaunay.a \ + $(LIBDIR)/libbasic.a \ + $(LIBDIR)/libdetri.a \ + $(LIBDIR)/liblia.a \ + $(LIBDIR)/libsos.a \ + $(LIBDIR)/fortify.o \ + $(LIBDIR)/libm3tv.a + + +install: + cp libvisnet4flash.a $(LIBDIR) + +uninstall: + rm -rf $(LIBDIR)/libvisnet4flash.a + +clean: + rm -rf *.o app core a.out *.a *.C~ *.h~ SunWS_cache diff --git a/flash2d/lib/visnet4flash/Makefile.Settings b/flash2d/lib/visnet4flash/Makefile.Settings new file mode 100644 index 0000000000000000000000000000000000000000..f41d4db75bb8e38220e766f46804b8b47d09643b --- /dev/null +++ b/flash2d/lib/visnet4flash/Makefile.Settings @@ -0,0 +1,186 @@ +TARGETOS := $(shell uname) +MODE := norm +AR := ar +ARFLAGS := -cr + +# ==================================== +# ===== Linux ======================== +# ==================================== +ifeq ($(strip $(TARGETOS)),Linux) + CC := g++ + LD := $(CC) + OPTIONS := -D__LINUX__ + LIBS := -lglut -lGLU -lGL -ltiff $(LIBS) + # ---------------------------------- + # ===== g++ ======================== + # ---------------------------------- + ifeq ($(CC),g++) + OPTIONS := $(OPTIONS) -Wall -fno-rtti -D__GNU__ + LIBS := -lpthread $(LIBS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -O0 -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O2 $(OPTIONS) + endif + endif + # ---------------------------------- + # ===== CC ========================= + # ---------------------------------- + ifeq ($(CC),CC) + OPTIONS := +w -DHRTIMER -D__CC__ $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O5 $(OPTIONS) + endif + endif +endif + +# ==================================== +# ===== SunOS ======================== +# ==================================== +ifeq ($(strip $(TARGETOS)),SunOS) + CC := CC + LD := $(CC) + OPTIONS := -D__SUN__ + LIBS := -lglut -lGLU -lGL -ltiff -lXmu -lXext -lX11 -mt -lrt -lsocket $(LIBS) + # ------------------------------------ + # --===== g++ ======================== + # ------------------------------------ + ifeq ($(CC),g++) + OPTIONS := $(OPTIONS) -Wall -fno-rtti -D__GNU__ + LIBS := -lpthread $(LIBS) $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -O0 -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O2 $(OPTIONS) + endif + endif + # ---------------------------------- + # ===== CC ========================= + # ---------------------------------- + ifeq ($(CC),CC) + OPTIONS := +w -DHRTIMER -D__CC__ $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O5 $(OPTIONS) + endif + endif +endif + +# =============================== +# ===== Irix ==================== +# =============================== +ifeq ($(strip $(TARGETOS)),IRIX64) + CC := CC + LD := $(CC) + OPTIONS := -D__IRIX__ + LIBS := -lglut -lGLU -lGL -lXmu -lXext -lX11 -lrt -ltiff -lm -lpthread $(LIBS) + # ------------------------------------ + # --===== g++ ======================== + # ------------------------------------ + ifeq ($(CC),g++) + OPTIONS := $(OPTIONS) -Wall -fno-rtti -D__GNU__ + LIBS := -lpthread $(LIBS) $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -O0 -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O2 $(OPTIONS) + endif + endif + # ---------------------------------- + # ===== CC ========================= + # ---------------------------------- + ifeq ($(CC),CC) + OPTIONS := -fullwarn -DHRTIMER -D__CC__ $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O2 $(OPTIONS) + endif + endif +endif + +# =============================== +# ===== CygWin ==================== +# =============================== +ifeq ($(strip $(TARGETOS)),CYGWIN_NT-5.1) + OPTIONS := -Wno-deprecated -D__CYGWIN__ + CC := g++ + LD := $(CC) + LIBS := -lglut32 -lGLU -lGL -ltiff $(LIBS) + # ---------------------------------- + # ===== g++ ======================== + # ---------------------------------- + ifeq ($(CC),g++) + OPTIONS := $(OPTIONS) -Wall -fno-rtti -D__GNU__ + LIBS := -lpthread $(LIBS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -O0 -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O2 $(OPTIONS) + endif + endif + # ---------------------------------- + # ===== CC ========================= + # ---------------------------------- + ifeq ($(CC),CC) + OPTIONS := +w -DHRTIMER -D__CC__ $(OPTIONS) + # ===== debug ==================== + ifeq ($(strip $(MODE)),debug) + OPTIONS := -g -DDEBUG_ $(OPTIONS) + endif + # ===== norm ===================== + ifeq ($(strip $(MODE)),norm) + endif + # ===== opt ====================== + ifeq ($(strip $(MODE)),opt) + OPTIONS := -O5 $(OPTIONS) + endif + endif +endif + + diff --git a/flash2d/lib/visnet4flash/README b/flash2d/lib/visnet4flash/README new file mode 100644 index 0000000000000000000000000000000000000000..3074dc9e8495c69c76d56faf921c2ec4e6c781a0 --- /dev/null +++ b/flash2d/lib/visnet4flash/README @@ -0,0 +1,9 @@ +WHATTODO: + - Get VisNET + - Copy VisNET to any Directory + - Open the Makefile + - Set variable VISNETDIR to your VisNET directory + - Set variables ROOTDIR and TARGETDIR to whatever you need + (should be the same as in flashs Makefile) + - Save Makefile + - Calling make should do the trick now diff --git a/flash2d/lib/visnet4flash/VectorList.C b/flash2d/lib/visnet4flash/VectorList.C new file mode 100644 index 0000000000000000000000000000000000000000..d19db06abbb4bc1b257cf0622e1a2fb1c4fea35c --- /dev/null +++ b/flash2d/lib/visnet4flash/VectorList.C @@ -0,0 +1,121 @@ +#include "fortify.h" +#include "VectorList.h" +//#include "M3TV_DataSource.h" +#include "3dutil.h" +#include "stdio.h" + +VectorList::VectorList(): + nn_(0), coords_(NULL), vals_(NULL) +{ + n_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + n1_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + n2_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + e_ = new M3TV_SimpleEdge(n1_, n2_); +} +VectorList::VectorList(int nn, int dim, + float *coords, + float *vals, + double height): + nn_(0), coords_(NULL), vals_(NULL) +{ + n_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + n1_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + n2_ = new M3TV_SimpleNode(0,0,0,0,M3TV_Data::REUSABLE); + e_ = new M3TV_SimpleEdge(n1_, n2_); + + setData(nn, dim, coords, vals); + setHeight(height); +} + +VectorList::~VectorList(){ + delete n_; + delete e_; + delete n1_; + delete n2_; +} + +void VectorList::setData(int nn, int dim, float *coords, float *vals){ + nn_ = nn; + dim_ = dim; + coords_ = coords; + vals_ = vals; + setChanged(1); +} + +void VectorList::setHeight(double h){ + height_ = h; + setChanged(1); +} + +double VectorList::getHeight(){ + return height_; +} + +void VectorList::firstNode(){ + ni_ = -1; +} + +M3TV_Node *VectorList::nextNode(){ + if(++ni_ >= nn_){ + return NULL; + } + n_->setCoords(coords_[ni_*3], coords_[ni_*3+1], dim_==2?height_:coords_[ni_*3+2]); + return n_; +} + +void VectorList::firstEdge(){ + ei_ = -1; + //e_ = new M3TV_SimpleEdge(NULL, NULL); +} + +M3TV_Edge *VectorList::nextEdge(){ + if(++ei_ >= nn_){ + return NULL; + } + // vals[5*ei_+1] == ucomp + // vals[5*ei_+2] == vcomp + // vals[5*ei_+3] == 3d:wcomp + n1_->setCoords(coords_[ei_*3], + coords_[ei_*3+1], + dim_==2?height_:coords_[ei_*3+2]); + n2_->setCoords(coords_[ei_*3]+vals_[5*ei_+1], + coords_[ei_*3+1]+vals_[5*ei_+2], + dim_==2?height_:coords_[ei_*3+2]+vals_[5*ei_+3]); + return e_; +} + +void VectorList::initMinMax(){ + M3TV_Edge *e; + double *c; + + firstEdge(); + e = nextEdge(); + if(e != NULL){ + c = e->getNode1()->getCoordsD(); + X(min_) = X(max_) = X(c); + Y(min_) = Y(max_) = Y(c); + } + firstEdge(); + while((e = nextEdge()) != NULL){ + c = e->getNode1()->getCoordsD(); + if(X(c) < X(min_)) X(min_) = X(c); + if(X(c) > X(max_)) X(max_) = X(c); + if(Y(c) < Y(min_)) Y(min_) = Y(c); + if(Y(c) > Y(max_)) Y(max_) = Y(c); + + c = e->getNode2()->getCoordsD(); + if(X(c) < X(min_)) X(min_) = X(c); + if(X(c) > X(max_)) X(max_) = X(c); + if(Y(c) < Y(min_)) Y(min_) = Y(c); + if(Y(c) > Y(max_)) Y(max_) = Y(c); + } + + Z(min_) = Z(max_) = height_; + + minnv_ = maxnv_ = 0; + minev_ = maxev_ = 0; + + minMaxCoordsSet_ = 1; + minMaxNodeValuesSet_ = 1; + minMaxEdgeValuesSet_ = 1; +} diff --git a/flash2d/lib/visnet4flash/VectorList.h b/flash2d/lib/visnet4flash/VectorList.h new file mode 100644 index 0000000000000000000000000000000000000000..b3cbaa5039984e52eac641758180b146da766418 --- /dev/null +++ b/flash2d/lib/visnet4flash/VectorList.h @@ -0,0 +1,47 @@ +#ifndef VECTROLIST_H +#define VECTROLIST_H + +#include "M3TV_StdDataSource.h" + +class VectorList : public M3TV_EdgeList{ + public: + VectorList(); + VectorList(int nn, int dim, + float *coords, + float *vals, + double height = 0.0); + ~VectorList(); + + void setData(int nn, int dim, float *coords, float *vals); + + void setHeight(double h); + double getHeight(); + + int getNodeValueGroupCount(){return 1;} + int chooseNodeValueGroup(int index){return index ==0;} + int getEdgeValueGroupCount(){return 1;} + int chooseEdgeValueGroup(int index){return index == 0;} + + int getNodeValueGroupName(int index, char *name, int len){return 0;} + int getEdgeValueGroupName(int index, char *name, int len){return 0;} + + void firstNode(); + M3TV_Node *nextNode(); + + void firstEdge(); + M3TV_Edge *nextEdge(); + + protected: + void initMinMax(); + + private: + int nn_, ni_, ei_; + int dim_; + float *coords_, *vals_; + M3TV_SimpleEdge* e_; + + M3TV_SimpleNode *n_, *n1_, *n2_; + double height_; +}; + +#endif diff --git a/flash2d/lib/visnet4flash/VisNET4Flash.C b/flash2d/lib/visnet4flash/VisNET4Flash.C new file mode 100644 index 0000000000000000000000000000000000000000..822543bb39c518d5d72ef709153351f5bb2648ce --- /dev/null +++ b/flash2d/lib/visnet4flash/VisNET4Flash.C @@ -0,0 +1,193 @@ +// Source file for the VisNET-Flash Interface (C++ part) + +#include <semaphore.h> +#include <stdio.h> +#include <string.h> +#include "M3VisNETView.h" +#include "FlashData.h" +#include "FlashMenu.h" + +//#include "M3TV_DataSource.h" +//#include "M3TV_StdDataSource.h" +//#include "3dutil.h" +//#include "M3TV_Menu.h" + + + +#ifdef __cplusplus +extern "C" { +#endif + +M3VisNETView *view; +M3TV_DoubleTriangleList *dtl; +FlashData *fd1, *fd2; +FlashMenu *fm; +int capture = 0; + +int visnet_graphicsinit_(int *nn, // number of boundary nodes + float *xx, float *yy, // x- and y-coordinates of bounds + int *wtl, char *wtext, // window description text + int *mtl, char *mskfile, // land data file name + int *tiff, // screenshot? + int *initial_dimension, // dimension + int *i_extremes, // use extremes? + float *extremes){ // minimal and maximal nodal coordinates and values + // [[minX,maxX],[minY,maxY],[minZ,maxZ],[minValue,maxValue]] + char *wtext_, *mskfile_; + + // copy window description text + wtext_ = new char[*wtl+1]; + strncpy(wtext_, wtext, *wtl); + wtext_[*wtl] = 0; + + // copy land data fine name + mskfile_ = new char[*mtl+5]; + strncpy(mskfile_, mskfile, *mtl); + mskfile_[*mtl] = 0; + + /*/ + printf("VisNET_GraphicsInit_ called ...\n"); + printf("Boundary:\n"); + for(int i = 0; i < *nn; i++){ + printf("(%f, %f)\n", xx[i], yy[i]); + } + + printf("Window Description Text:\n"); + printf("string length: %d\n", *wtl); + printf("\"%s\"\n", wtext_); + + printf("Land Data File Name:\n"); + printf("string length: %d\n", *mtl); + printf("\"%s\"\n", mskfile_); + + printf("Capture to TIFF:\n%d\n", *tiff); + printf("Dimension:\n%d\n", *initial_dimension); + printf("use extremes?: %d\n", *i_extremes); + printf("extremes-pointer: %p\n", extremes); + /**/ + + // tiff ? + if((*tiff) != 0){ + capture = 1; + } + + //bound = new Boundary(*nn, xx, yy); + fd1 = new FlashData(*initial_dimension); + fd2 = new FlashData(*initial_dimension); + dtl = new M3TV_DoubleTriangleList(fd1, fd2); + + if(*i_extremes != 0){ + fd1->setMinMaxCoords(extremes[0], extremes[1], + extremes[2], extremes[3], + extremes[4], extremes[5]); + fd1->setMinMaxNodeValues(extremes[6], + extremes[7]); + fd2->setMinMaxCoords(extremes[0], extremes[1], + extremes[2], extremes[3], + extremes[4], extremes[5]); + fd2->setMinMaxNodeValues(extremes[6], + extremes[7]); + }else{ + //fd1->setAutoMinMax(1); + //fd2->setAutoMinMax(1); + } + + //printf("creating view ...\n"); + view = new M3VisNETView(dtl); + fm = new FlashMenu(view, *initial_dimension, fd1, fd2, dtl); + //view->addMenu(fd); + view->addMenu(fm); + + view->show(0); + + delete[] wtext_; + delete[] mskfile_; + + return 0; +} + +int visnet_graphicsdraw_(int *nn, // number of nodes + int *ne, // number of edges + int *nt, // number of elements + float *coords, // x,y-coordinates of nodes + float *cvals, // nodes value tracer + int *e, // edges node indices + int *t, // triangles node indices + + int *tiffnl, char *tiffname){ // tiff file name + + static int init = 1; + + //printf("VisNET_GraphicsDraw_ called ...\n"); + //printf("# of nodes: %d\n", *nn); + //printf("# of edges: %d\n", *ne); + //printf("# of elements: %d\n", *nt); + //printf("node coords pointer: %p\n", coords); + //printf("node values array pointer: %p\n", cvals); + //printf("node values array : %p\n", *cvals); + //printf("edges: %p\n", e); + //printf("triangles: %p\n", t); + //printf("TIFF file name length: %d\n", *tiffnl); + //printf("TIFF file name:\n"); + + char *s = new char[*tiffnl+1]; + strncpy(s, tiffname, *tiffnl); + s[*tiffnl]=0; + char *tiffname_ = new char[*tiffnl+5]; + sprintf(tiffname_, "%s.tif", s); + delete[] s; + //printf("%s\n", tiffname_); + + if(init){ + fd1->setData(*nn, *ne, *nt, + coords, + cvals, + e, t); + init = 0; + } + + FlashData *fd = (FlashData*)dtl->getWork(); + fd->setData(*nn, *ne, *nt, + coords, + cvals, + e, t); + + double iso; + if(fm->getIsoValue(iso)){ + fd->setIsoValue(iso); + } + + + dtl->toggle(); + + int ok = view->repaint(capture); + + //printf("return from repaint: %d\n", ok); + + if(ok){ + if(capture){ + view->captureTiffLZW(tiffname_); + } + + fm->wait(); + + } + + delete[] tiffname_; + + return !ok; +} + +void visnet_graphicsquit_(){ + //printf("VisNET_GraphicsQuit_ called ...\n"); + //delete fd1; + //delete fd2; + //delete dtl; + //delete fm; + //delete view; + //printf("VisNET_GraphicsQuit_ done\n"); +} + +#ifdef __cplusplus +} //extern "C" +#endif diff --git a/flash2d/lib/visnet4flash/main.C b/flash2d/lib/visnet4flash/main.C new file mode 100644 index 0000000000000000000000000000000000000000..0d4d87652493bb0632da20e6811fa950dced3cca --- /dev/null +++ b/flash2d/lib/visnet4flash/main.C @@ -0,0 +1,91 @@ +#include "fortify.h" + +#ifdef __cplusplus +extern "C" { +#endif + +int visnet_graphicsinit_(int *nn, // number of boundary nodes + float *xx, float *yy, // x- and y-coordinates of bounds + int *wtl, char *wtext, // window description text + int *mtl, char *mskfile, // land data file name + int *drwtyp, // drawing type + int *initial_drawmode, // drawmode + int *initial_dimension, // dimension + float *extremes); // minimal and maximal nodal coordinates and values +int visnet_graphicsdraw_(int *nn, // number of nodes + int *ne, // number of edges + int *nt, // number of elements + float *coords, // x,y-coordinates of nodes + float *cval_tracer, // nodes value tracer + float *cval_ucomp, // nodes value ucomp + float *cval_vcomp, // nodes value vcomp + int *e, // edges node indices + int *t, // triangles node indices + + int *tiffnl, char *tiffname, // tiff file name + struct destext *dtext); // tiff file description +void visnet_graphicsquit_(); + + +int main(int argc, char *argv){ + float h = 1; + float coords[5][3] = {{0,0,0},{1,1,0},{-1,1,0},{-1,-1,0},{1,-1,0}} ; +// float coords[10] = {0,1,-1,-1,1, 0,2,1,-1,-1}; + float tracer[5] = {h,0,0,0,0}; + float ucomp[5] = {0,0,0,0,0}; + float vcomp[5] = {0,0,0,0,0}; + int e[8][2] = {{1,2},{1,3},{1,4},{1,5},{2,3},{3,4},{4,5},{5,2}} ; + int t[4][3] = {{1,2,3},{1,3,4},{1,4,5},{1,5,2}}; + int quit = 0; + + int nn = 0; + int wtl = 35; + int mtl = 1; + int drwtyp = 9; + int initial_drawmode = 1; + int initial_dimension = 3; + + int ne; + int nt; + int tiffnl; + + Fortify_EnterScope(); + + visnet_graphicsinit_(&nn, + NULL, NULL, + &wtl, (char*)"VisNET4Flash Interface Test Driver", + &mtl, (char*)"x", + &drwtyp, + &initial_drawmode, + &initial_dimension, + NULL); + + nn = 5; + ne = 8; + nt = 4; + tiffnl = 12; + + while(!quit){ + quit = visnet_graphicsdraw_(&nn, + &ne, + &nt, + (float*)coords, + (float*)tracer, + (float*)ucomp, + (float*)vcomp, + (int*)e, + (int*)t, + &tiffnl,(char*)"filename.tif", + NULL); + } + + + visnet_graphicsquit_(); + + Fortify_LeaveScope(); + +} + +#ifdef __cplusplus +} //extern "C" +#endif diff --git a/flash2d/src/README b/flash2d/src/README new file mode 100644 index 0000000000000000000000000000000000000000..2cd3ce1b357da248f4e0ff3c264a54d8113b2705 --- /dev/null +++ b/flash2d/src/README @@ -0,0 +1,17 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/src" + +README - this file +flash - directory for the FLASH sources +system - directory for system dependent routines +utils - directory for utility programs + +************************************************************************** + j. behrens, 5/01 +************************************************************************** diff --git a/flash2d/src/flash-sphere/ADV_rhs.f90 b/flash2d/src/flash-sphere/ADV_rhs.f90 new file mode 100644 index 0000000000000000000000000000000000000000..546b4cd9e0a79628da4db651ecb8fc404b0bf077 --- /dev/null +++ b/flash2d/src/flash-sphere/ADV_rhs.f90 @@ -0,0 +1,76 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_rhs +! FUNCTION: +! calculate the (nonhomogeneous) right hand side +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_righthand +! FUNCTION: +! calculate the rhs of the advection equation +! SYNTAX: +! real= slm_righthand(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_rhs: right hand side value real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! this is the homogeneous case! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 2/98 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_rhs + USE GRID_api + PRIVATE + PUBLIC :: slm_righthand + CONTAINS +!***************************************************************** + FUNCTION slm_righthand(r_coord, r_time) RESULT (r_rhs) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR) :: r_rhs + REAL (KIND = GRID_SR) :: r_tim + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_rhs= 0.0 + + RETURN + END FUNCTION slm_righthand + +!***************************************************************** + END MODULE ADV_rhs diff --git a/flash2d/src/flash-sphere/ADV_semilagrange.F90 b/flash2d/src/flash-sphere/ADV_semilagrange.F90 new file mode 100644 index 0000000000000000000000000000000000000000..eaf4620832280ed441407dd4d9be110d2c97e414 --- /dev/null +++ b/flash2d/src/flash-sphere/ADV_semilagrange.F90 @@ -0,0 +1,850 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/flash-sphere/ADV_wind.f90 b/flash2d/src/flash-sphere/ADV_wind.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b6000ca920e7721afc3829ea930c59b0c506dc58 --- /dev/null +++ b/flash2d/src/flash-sphere/ADV_wind.f90 @@ -0,0 +1,156 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! 4. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + REAL (KIND = GRID_SR) :: r_u0 + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time, r_lamphi) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical), OPTIONAL :: r_lamphi + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_angl=0.0 + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lp, r_zetet, r_gup +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kup + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate spherical coordinates + + IF(present(r_lamphi)) THEN + r_lp= r_lamphi + ELSE + r_lp= grid_kartgeo(r_coord) + END IF + +!---------- calculate wind vector in spherical coordinates + + r_tmp= sin(r_angl) + r_zetet(1)= r_u0* (cos(r_lp(2))* cos(r_angl) + & + sin(r_lp(2))* cos(r_lp(1))* r_tmp) + r_zetet(2)= -r_u0* sin(r_lp(1))* r_tmp + +!---------- calculate wind vector in kartesian coordinates + +! r_gup= r_lp- r_zetet +! r_kup=grid_geokart(r_gup) +! r_field= r_kup- r_coord + r_field= kartwind(r_zetet,r_lp) + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + +!---------- calculate velocity factor (one revolution after 12 days/ +! 576 time steps of half an hour) + + r_u0= (2.0* GRID_PI* GRID_RADIUS)/1.0368e6 + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION kartwind(r_lamphi, r_lpcoor) RESULT (r_kart) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lamphi, r_lpcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kart + REAL (KIND = GRID_SR) :: r_sl, r_cl, r_sp, r_cp + +!---------- calculate constants + + r_sl= sin(r_lpcoor(1)) + r_cl= cos(r_lpcoor(1)) + r_sp= sin(r_lpcoor(2)) + r_cp= cos(r_lpcoor(2)) + +!---------- calculate 3D kartesian components + + r_kart(1)= -r_sl* r_lamphi(1)- r_sp* r_cl* r_lamphi(2) + r_kart(2)= r_cl* r_lamphi(1)- r_sp* r_sl* r_lamphi(2) + r_kart(3)= r_cp* r_lamphi(2) + + RETURN + END FUNCTION kartwind + +!***************************************************************** + END MODULE ADV_wind + + diff --git a/flash2d/src/flash-sphere/FLASH_metadata.f90 b/flash2d/src/flash-sphere/FLASH_metadata.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1a01a382be10817a255717eb23b2fb5261eaae0a --- /dev/null +++ b/flash2d/src/flash-sphere/FLASH_metadata.f90 @@ -0,0 +1,63 @@ +!******************************************************************************* +! +!> @file FLASH_metadata.f90 +!> @brief contains metadata definitions for FLASH_parameters +! +!******************************************************************************* +! MODULE DESCRIPTION: +!> @brief This is a meta data structure that contains info for the +!> FLASH_parameters physical parameters, related to different +!> Test cases. +!> @author J. Behrens +!> @version 1.0 +!> @date 5/2016 +!***************************************************************** + MODULE FLASH_metadata + + IMPLICIT NONE + +!---------- character length for comparison + + INTEGER, PARAMETER :: i_comparlen=12 + +!---------- meta data for logical parameters + + LOGICAL, PARAMETER :: l_logused= .FALSE. + INTEGER, PARAMETER :: i_lognum=1 + CHARACTER (len=i_comparlen), DIMENSION(i_lognum) :: c_logkeywds= & + (/ ' ' /) + +!---------- meta data for integer parameters + + LOGICAL, PARAMETER :: l_intused= .FALSE. + INTEGER, PARAMETER :: i_intnum=1 + INTEGER, DIMENSION(i_intnum) :: i_intsizes= (/ 0 /) + CHARACTER (len=i_comparlen), DIMENSION(i_intnum) :: c_intkeywds= & + (/ ' ' /) + +!---------- meta data for character parameters + + LOGICAL, PARAMETER :: l_charused= .TRUE. + INTEGER, PARAMETER :: i_charnum=1 + INTEGER, PARAMETER :: i_charlength= 64 + CHARACTER (len=i_comparlen), DIMENSION(i_charnum) :: c_charkeywds= & + (/ 'WIND_FILE_NA' /) + +!---------- meta data for real parameters + + LOGICAL, PARAMETER :: l_realused= .TRUE. + INTEGER, PARAMETER :: i_realnum=3 + INTEGER, DIMENSION(i_realnum) :: i_realsizes= (/ 1, 1, 1 /) + CHARACTER (len=i_comparlen), DIMENSION(i_realnum) :: c_realkeywds= & + (/ 'DIFFUSION_CO', & + 'WIND_COEFFIC', & + 'TOTAL_MASS_P' /) + +!---------- convenience pointers + + INTEGER, PARAMETER :: PARAM_DIFFCOEF= 1 + INTEGER, PARAMETER :: PARAM_WINDCOEF= 2 + INTEGER, PARAMETER :: PARAM_TOTALMASS= 3 + INTEGER, PARAMETER :: PARAM_WINDFILE= 1 + + END MODULE FLASH_metadata diff --git a/flash2d/src/flash-sphere/FLASH_parameters.f90 b/flash2d/src/flash-sphere/FLASH_parameters.f90 new file mode 100644 index 0000000000000000000000000000000000000000..397d737e0f162d25e80557c1f182adf31ea09030 --- /dev/null +++ b/flash2d/src/flash-sphere/FLASH_parameters.f90 @@ -0,0 +1,111 @@ +!***************************************************************** +! +! MODULE NAME: +! FLASH_parameters +! FUNCTION: +! defines global control structure +! CONTAINS: +! +! PUBLIC: +! all +! COMMENTS: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/2000 +! +!***************************************************************** + MODULE FLASH_parameters + + USE FLASH_metadata + + IMPLICIT NONE + INTEGER, PARAMETER :: io_fillen=128 + INTEGER, PARAMETER :: i_redirout=8 + INTEGER, PARAMETER :: i_redirlog=7 + +!---------- structure for the command line + + TYPE cmdline_param + SEQUENCE + CHARACTER (len=io_fillen) :: c_infile ! input file name + CHARACTER (len=io_fillen) :: c_directory ! input file name + LOGICAL :: l_output ! redirect std output + LOGICAL :: l_logging ! enable logging (verbose) + END TYPE cmdline_param + +!---------- structure for the i/o behaviour + + TYPE io_param + SEQUENCE + LOGICAL :: l_diagnostics ! switch on diagnostics + LOGICAL :: l_vtu ! switch on vtu output + LOGICAL :: l_netcdf ! switch on NetCDF output + INTEGER :: i_plotoffset ! timesteps between plots + INTEGER :: i_saveoffset ! timesteps between savesets + INTEGER :: i_savelast ! indicator for last step saving +! LOGICAL :: l_matlab ! write matlab (offline) output +! LOGICAL :: l_gmv ! write gmv (offline) output + !-- BEGIN added for visnetplot [flo]: +! LOGICAL :: l_visnet ! plot visnet (online) output +! LOGICAL :: l_visnet_tiff ! enable visnet screenshots + !-- END +! CHARACTER (len=io_fillen) :: c_polygonfile ! file with polygonal lines + CHARACTER (len=io_fillen) :: c_domainfile ! file with definitions for domain + CHARACTER (len=io_fillen) :: c_triangfile ! file with initial triangulation +! CHARACTER (len=io_fillen) :: c_windfile ! file with wind information + END TYPE io_param + +!---------- structure for global physical and steering parameters + + TYPE num_param + SEQUENCE + REAL :: r_deltatime ! timestep length [s] + REAL :: r_reftolerance ! tolerance for refinement + REAL :: r_crstolerance ! tolerance for coarsening + REAL :: r_refwatermark ! watermark for refinement + REAL :: r_crswatermark ! watermark for coarsening + REAL :: r_starttime ! first time (overwrites i_frsttimestep) + REAL :: r_finaltime ! last time (overwrites i_lasttimestep) + INTEGER :: i_experiment ! current experiment identification + INTEGER :: i_crslevel ! coarsest requested level + INTEGER :: i_reflevel ! finest requested level + INTEGER :: i_frsttimestep ! first timestep of experiment + INTEGER :: i_lasttimestep ! last timestep of experiment + INTEGER :: i_adviterations ! iterations in trajectory estimation + END TYPE num_param + +!---------- structure for global physical and steering parameters + + TYPE phys_param + LOGICAL, DIMENSION(:), POINTER :: phy_log + CHARACTER (len=i_charlength), DIMENSION(:), POINTER :: phy_char + INTEGER, DIMENSION(:,:), POINTER :: phy_int + REAL, DIMENSION(:,:), POINTER :: phy_real + END TYPE phys_param + +!---------- global control structure + + TYPE control_struct + TYPE (num_param) :: num + TYPE (cmdline_param) :: cmd + TYPE (io_param) :: io + TYPE (phys_param) :: phy + END TYPE control_struct + TYPE (control_struct) :: p_contr + +!---------- structure for runtime information + + TYPE rt_info + REAL :: r_modeltime + INTEGER :: i_step + INTEGER :: i_adapit + LOGICAL :: l_saved + LOGICAL :: l_ploted + END TYPE rt_info + TYPE (rt_info) :: p_timestepinfo + + END MODULE FLASH_parameters diff --git a/flash2d/src/flash-sphere/Flash90.F90 b/flash2d/src/flash-sphere/Flash90.F90 new file mode 100644 index 0000000000000000000000000000000000000000..a493384d87e2ca3165192ac24a3efbcac1024f16 --- /dev/null +++ b/flash2d/src/flash-sphere/Flash90.F90 @@ -0,0 +1,106 @@ +!***************************************************************** +! +! PROJECT: +! FLASH90 means +! FLexible Adaptive Semi-Lagrangian Hack +! written in Fortran 90 +! NAME: +! Flash90 +! FUNCTION: +! main program (driver routine for the adaptive SLM) +! SYNTAX: +! flash90 [options] +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +! LIBRARIES: +! USEs several fortran 90 modules +! REFERENCES: +! this is a complete reimplementation of STASL +! VERSION(S): +! 1. original version j. behrens 11/96 +! 2. tidied up a little j. behrens 7/97 +! 3. new control struct j. behrens 12/97 +! 4. compliant to amatos 1.0 j. behrens 12/2000 +! 5. compliant to amatos 1.2 j. behrens 3/2002 +! 6. added visnetplot f. klaschka 12/2003 +! 7. refactured a bit... j. behrens 5/2016 +! +!***************************************************************** + PROGRAM flash90 + +!---------- modules + + USE FLASH_parameters + USE IO_utils + !-- added for visnetplot [flo]: + USE GRID_api + USE ADV_semilagrange + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_dummy + +!---------- set FLASH description in global datastruct + + GRID_parameters%program_name= 'Flash90 ' + GRID_parameters%version= 0 + GRID_parameters%subversion= 9 + GRID_parameters%patchversion= 0 + GRID_parameters%datemonth= 5 + GRID_parameters%dateyear= 2016 + +!---------- read command line options + + CALL io_getcmdline(p_contr) + +!---------- initialize grid generator + + IF(p_contr%cmd%l_output) THEN + IF(p_contr%cmd%l_logging) THEN + CALL grid_initialize(i_output=i_redirout, i_logging=i_redirlog) + ELSE + CALL grid_initialize(i_output=i_redirout) + END IF + ELSE + IF(p_contr%cmd%l_logging) THEN + CALL grid_initialize(i_logging=i_redirlog) + ELSE + CALL grid_initialize + END IF + END IF + +!---------- read parameter input from file + + CALL io_initparams(p_contr) + CALL io_getbatchinput(p_contr) + +!---------- print global parameters + + CALL io_putparameters(p_contr) + +!---------- set up advection starting conditions, initialize grid, etc. + + CALL slm_initialize(p_grid, p_contr) + +!---------- call the (major) routine for timestepping + + CALL slm_timestepping(p_grid, p_contr) + +!---------- terminate the SLM (gracefully free memory, terminate grid, etc.) + + CALL slm_finish(p_grid, p_contr) + +!---------- terminate grid generator + + CALL grid_terminate + + STOP + END PROGRAM flash90 diff --git a/flash2d/src/flash-sphere/IO_gmvplot.F90 b/flash2d/src/flash-sphere/IO_gmvplot.F90 new file mode 100644 index 0000000000000000000000000000000000000000..ab08bd239c9550ea4aaf50aede7630961d04d684 --- /dev/null +++ b/flash2d/src/flash-sphere/IO_gmvplot.F90 @@ -0,0 +1,314 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_gmvplot +! FUNCTION: +! print data in GMV compatible file format +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! plot_netcdf +! FUNCTION: +! create output fin netcdf file format +! SYNTAX: +! call plot_netcdf(handle, char.string) +! ON INPUT: +! p_handle: grid handle for the linked lists (required) type (grid_handle) +! c_filename: file name for plot file (optional) character +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! plot_gmv +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2000 +! 2. amatos-1.0 and 2D compliant j. behrens 11/2000 +! 7. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE IO_gmvplot + USE GRID_api + USE FLASH_parameters + PRIVATE + INTEGER, SAVE :: i_timecounter= 0 + PUBLIC :: plot_gmv + CONTAINS +!***************************************************************** + SUBROUTINE gmv_knotenvel(i_iogmv, iiosum, rnuvw) + INTEGER, INTENT(in) :: i_iogmv + INTEGER, INTENT(inout) :: iiosum + REAL (KIND=GRID_SR), DIMENSION(:,:), INTENT(in) :: rnuvw + + INTEGER :: i_iostat, incou, iline, inzahl + CHARACTER(512) :: ciolist + CHARACTER(512) :: cnzahl1, cnzahl2 + + inzahl = SIZE(rnuvw,2) + +!!!************** write u,v,w- fielddata nodewise + + ! write line with: velocity 1 + WRITE(i_iogmv,'(a10)', iostat= i_iostat) 'velocity 1' + iiosum= iiosum+ ABS(i_iostat) + + ! line with pval%inzahl(ifut) numbers + ! 1st line: u- compunent + ! 2nd line: v- component + ! 3rd line: w- component + WRITE(cnzahl1,'(I)') inzahl + ciolist = '(' // TRIM(cnzahl1) // 'es11.3)' + + DO iline= 1, 3 + ! i th line + WRITE(i_iogmv, ciolist, iostat= i_iostat) & + (rnuvw(iline, incou), incou= 1, inzahl) + iiosum= iiosum+ ABS(i_iostat) + END DO + END SUBROUTINE gmv_knotenvel +!***************************************************************** + SUBROUTINE plot_gmv(p_handle, i_time, i_newslevel) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER, OPTIONAL, INTENT(in) :: i_time + INTEGER, OPTIONAL, INTENT(in) :: i_newslevel + INTEGER :: i_io1 + INTEGER :: i_cnt, j_cnt, & + i_alct, i_nnum, i_tnum, i_dim, i_tcnt, i_fst + INTEGER :: i_nwl, i_elen, i_glen, i_nlen + REAL, DIMENSION(:), ALLOCATABLE :: r_ttmp + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_cox, r_val + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_tets + INTEGER, DIMENSION(:), ALLOCATABLE :: i_ids, i_sta + CHARACTER (len=32) :: c_mfile + CHARACTER (len=28) :: c_tmp + LOGICAL :: l_news + INTEGER, PARAMETER :: i_vallen=6 + INTEGER, DIMENSION(i_vallen) :: i_valind + +!!!DBG BGN + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_distort + REAL (KIND = GRID_SR) :: r_minval, r_maxval, r_scal +!!!DBG END + + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name(1:23)), '_gmv.' + write(c_mfile,10101) trim(c_tmp), i_tcnt + c_mfile= adjustl(c_mfile) + i_io1= 15 + OPEN(i_io1, file= c_mfile, form= 'formatted', iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + +!---------- handle news level + + IF(present(i_newslevel)) THEN + l_news=.TRUE. + i_nwl= i_newslevel + ELSE + l_news=.FALSE. + END IF + +!---------- write header + + WRITE(i_io1,1000) + WRITE(i_io1,1001) + WRITE(i_io1,1002) c_mfile + WRITE(i_io1,1003) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, GRID_parameters%patchversion + WRITE(i_io1,1004) GRID_parameters%author_name, GRID_parameters%author_email + WRITE(i_io1,1005) + +!---------- the nodes + + i_nnum = p_handle%i_nnumber + + + +!---------- extract nodal grid data and nodal values + + ALLOCATE(r_cox(GRID_dimension, i_nnum), r_val(i_vallen, i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_gmv]: could not allocate coordinate aux. array') + END IF + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_wcomp, GRID_phi, GRID_zeta, GRID_tracer/) + CALL grid_getinfo(p_handle, r_nodecoordinates= r_cox, & + r_nodevalues= r_val, i_arraypoint=i_valind) +!!!DBG BGN + r_minval = MINVAL(r_val(i_vallen,:)) + r_maxval = MAXVAL(r_val(i_vallen,:)) + r_scal = 1.0/10.0/(r_maxval-r_minval) + ALLOCATE(r_distort(i_nnum)) + DO i_cnt = 1,i_nnum + r_distort(i_cnt) = 1.0 + r_scal * (r_val(i_vallen,i_cnt)-r_minval) + END DO +!!!DBG END + WRITE(i_io1,1010) i_nnum + DO i_dim=1,GRID_dimension + WRITE(i_io1,1011) (r_cox(i_dim,i_cnt), i_cnt=1,i_nnum) +!!$ WRITE(i_io1,1011) (r_cox(i_dim,i_cnt)*r_distort(i_cnt), i_cnt=1,i_nnum) + END DO + DEALLOCATE(r_cox) + +!!!DBG BGN + DEALLOCATE(r_distort) +!!!DBG END + +!---------- extract cells grid data + + i_tnum= p_handle%i_enumfine + ALLOCATE(i_tets(GRID_elementnodes,i_tnum), & + i_ids(i_tnum), i_sta(i_tnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_gmv]: could not allocate integer aux. arrays') + END IF + IF(l_news) THEN + CALL grid_getinfo(p_handle, i_newsdepth= i_nwl, i_elength= i_elen, & + i_elementnodes= i_tets, i_elementlevel= i_ids, i_elementstatus= i_sta) + i_tnum= i_elen + ELSE + CALL grid_getinfo(p_handle, i_elementnodes= i_tets, & + i_elementlevel= i_ids, i_elementstatus= i_sta) + END IF + WRITE(i_io1,1020) i_tnum + tetra_loop: DO j_cnt=1,i_tnum + WRITE(i_io1,1021) + WRITE(i_io1,1022) (i_tets(i_cnt,j_cnt), i_cnt=1,GRID_elementnodes) + END DO tetra_loop + +!!!DBG BGN + CALL gmv_knotenvel(i_io1, i_tnum, r_val(1:3,:)) +!!!DBG END + + +!---------- write modeltime + + WRITE(i_io1,1009) p_timestepinfo%r_modeltime + +!---------- + + WRITE(i_io1,1040) + WRITE(i_io1,1041) + WRITE(i_io1,1022) (i_ids(i_cnt), i_cnt=1,i_tnum) + WRITE(i_io1,1043) + WRITE(i_io1,1022) (i_sta(i_cnt), i_cnt=1,i_tnum) + +!---------- show those elements that contain even a tiny proportion of mass, +! reuse i_sta array + + i_sta= 0 + DO j_cnt=1,i_tnum + DO i_dim=1,GRID_elementnodes + IF(ABS(r_val(i_vallen,i_tets(i_dim,j_cnt))) > GRID_EPS) & + i_sta(j_cnt)= i_sta(j_cnt)+ 1 + END DO + END DO + WRITE(i_io1,10431) + WRITE(i_io1,1022) (i_sta(i_cnt), i_cnt=1,i_tnum) + DEALLOCATE(i_tets, i_ids, i_sta) + +!---------- the element processor + +#ifdef _OPENMP + ALLOCATE(i_ids(i_tnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_gmv]: could not allocate aux. proc. array') + END IF + + IF(l_news) THEN + CALL grid_getinfo(p_handle, i_newsdepth= i_nwl, i_elength= i_elen, & + i_elementproc= i_ids) + i_tnum= i_elen + ELSE + CALL grid_getinfo(p_handle, i_elementproc= i_ids) + END IF + WRITE(i_io1,1044) + WRITE(i_io1,1022) (i_ids(i_cnt), i_cnt=1,i_tnum) + DEALLOCATE(i_ids) +#endif + +!---------- write the tracer concentration, and velocity + + WRITE(i_io1,1045) + WRITE(i_io1,1011) (r_val(1,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,1046) + WRITE(i_io1,1011) (r_val(2,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,10461) + WRITE(i_io1,1011) (r_val(3,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,1047) + WRITE(i_io1,1011) (r_val(4,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,1048) + WRITE(i_io1,1011) (r_val(5,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,1042) + WRITE(i_io1,1011) (r_val(i_vallen,i_cnt), i_cnt=1,i_nnum) + WRITE(i_io1,1049) + DEALLOCATE(r_val) + +!---------- close file + + WRITE(i_io1,1100) + CLOSE(i_io1) + + RETURN + 1000 FORMAT('gmvinput ascii') + 1001 FORMAT('comments') + 1002 FORMAT(' File: ',a48) + 1003 FORMAT(' Written by: ',a15,' Version ',i1,'.',i1,'.',i1) + 1004 FORMAT(' Author: ',a48,' <',a48,'>') + 1005 FORMAT('endcomm') + 1009 FORMAT('probtime ',f15.1) + 1010 FORMAT('nodes ',i8) +! 1011 FORMAT(10f15.5) + 1011 FORMAT(10es15.5) + 1020 FORMAT('cells ',i8) + 1021 FORMAT('tri 3') + 1022 FORMAT(10i8) + 1031 FORMAT('cellids') + 1040 FORMAT('variable') + 1041 FORMAT('level 0') + 1043 FORMAT('status 0') + 10431 FORMAT('num-diff 0') +#ifdef _OPENMP + 1044 FORMAT('proc 0') +#endif + 1042 FORMAT('tracr 1') + 1045 FORMAT('u-comp 1') + 1046 FORMAT('v-comp 1') + 10461 FORMAT('w-comp 1') + 1047 FORMAT('phi 1') + 1048 FORMAT('zeta 1') + 1049 FORMAT('endvars') + 1100 FORMAT('endgmv') + 10101 FORMAT(a28,i4.4) + END SUBROUTINE plot_gmv + + END MODULE IO_gmvplot + + + + diff --git a/flash2d/src/flash-sphere/IO_griddedplot.f90 b/flash2d/src/flash-sphere/IO_griddedplot.f90 new file mode 100644 index 0000000000000000000000000000000000000000..195b21a560460f9da3a0815d0ca870910ddc8818 --- /dev/null +++ b/flash2d/src/flash-sphere/IO_griddedplot.f90 @@ -0,0 +1,142 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_griddedplot +! FUNCTION: +! perform rendering into file +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! plot_gridded +! FUNCTION: +! create output for visualization by gnuplot and other grid oriented +! mapping tools +! SYNTAX: +! call plot_gridded(grid, int, int, char) +! ON INPUT: +! p_handle:grid handle for the linked lists (required) type (grid_handle) +! i_time: time stamp for file naming (optional) integer +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! plot_gridded +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, IO_plotdefine, GRID_api +! LIBRARIES: +! +! REFERENCES: +! this module is based on the original implementations in the +! splash/fe project (fortran 77 version), but wildly modified! +! VERSION(S): +! 1. original version j. behrens 1/2000 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE IO_griddedplot + USE FLASH_parameters + USE GRID_api + PRIVATE + INTEGER, SAVE :: i_timecounter=0 + PUBLIC :: plot_gridded + CONTAINS +!***************************************************************** + SUBROUTINE plot_gridded(p_handle, i_time) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER, OPTIONAL, INTENT(in) :: i_time + INTEGER :: i_io1, i_cnt, j_cnt, i_out, & + i_tim, i_alct, i_gridpoints, i_tcnt, i_fst + REAL, DIMENSION(:,:), ALLOCATABLE :: r_xytmp + REAL, DIMENSION(GRID_dimension) :: r_sw, r_ne, r_coo + REAL :: r_tmp, r_xstep, r_ystep + CHARACTER (len=32) :: c_matfile + CHARACTER (len=28) :: c_tmp + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name), '_gridded.' + write(c_matfile,1020) trim(c_tmp), i_tcnt + c_matfile= adjustl(c_matfile) + i_io1= 15 + OPEN(i_io1, file= c_matfile, form= 'formatted', iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + +!---------- deternime maximum extent of domain, allocate temporary array + + i_cnt= p_handle%i_nnumber + allocate(r_xytmp(GRID_dimension,i_cnt), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(45) + END IF not_alloc1 + +!---------- get array with boundary polygonal line + + CALL grid_getpolyline(p_handle, GRID_boundary, i_cnt, j_cnt, r_xytmp) + +!---------- determine minimum/maximum + + r_sw= minval(r_xytmp(:,1:j_cnt), dim=2) + r_ne= maxval(r_xytmp(:,1:j_cnt), dim=2) + deallocate(r_xytmp) + +!---------- determine number of required grid-points + + r_tmp= (1.+ p_handle%i_maxlvl)* 0.5 + i_cnt= ceiling(r_tmp) + i_gridpoints= 2**i_cnt + write(i_io1,1010) i_gridpoints + +!---------- determine coordinate step size (only 2D!) + + r_xstep= (r_ne(1)- r_sw(1))/(i_gridpoints- 1) + r_ystep= (r_ne(2)- r_sw(2))/(i_gridpoints- 1) + +!---------- now the nested loop (only 2D!) + + outer_loop: DO j_cnt=0,i_gridpoints-1 + r_coo(2)= r_sw(2)+ j_cnt* r_ystep + inner_loop: DO i_cnt=0,i_gridpoints-1 + r_coo(1)= r_sw(1)+ i_cnt* r_xstep + r_tmp= grid_coordvalue(p_handle, r_coo, & + i_interpolorder=GRID_loworder, i_valpoint=GRID_tracer) + write(i_io1,1000) r_tmp +!gnupl write(i_io1,1000) r_tmp + END DO inner_loop +!gnupl write(i_io1,1010) + END DO outer_loop + +!---------- close file + + CLOSE(i_io1) + + RETURN + 1000 FORMAT(e16.6) + 1010 FORMAT(i8) +!gnupl 1000 FORMAT(e12.5) +!gnupl 1010 FORMAT(O012) + 1020 FORMAT(a28,i4.4) + END SUBROUTINE plot_gridded + + END MODULE IO_griddedplot diff --git a/flash2d/src/flash-sphere/IO_matlabplot.F90 b/flash2d/src/flash-sphere/IO_matlabplot.F90 new file mode 100644 index 0000000000000000000000000000000000000000..2858f129ab01f5bd1b62a39379d43e94c17e66ff --- /dev/null +++ b/flash2d/src/flash-sphere/IO_matlabplot.F90 @@ -0,0 +1,216 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_matlabplot +! FUNCTION: +! perform rendering into a matlab compatible file +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! plot_matlab +! FUNCTION: +! create output for visualization by matlab +! SYNTAX: +! call plot_matlab(grid, int, int, char) +! ON INPUT: +! p_handle:grid handle for the linked lists (required) type (grid_handle) +! i_time: time stamp for file naming (optional) integer +! c_attrib: plot attribute into element (optional) character +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! the following attributes are supported: +! 'flag': plot flag of triangle +! 'levl': plot refinement level as color +! 'vals': plot values as color +! +!----------------------------------------------------------------- +! +! PUBLIC: +! plot_matlab +! COMMENTS: +! +! USES: +! MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! this module is based on the original implementations in the +! splash/fe project (fortran 77 version), but wildly modified! +! VERSION(S): +! 1. original version j. behrens 1/2000 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! 4. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE IO_matlabplot + USE GRID_api + PRIVATE + INTEGER, SAVE :: i_timecounter= 0 + PUBLIC :: plot_matlab + CONTAINS +!***************************************************************** + SUBROUTINE plot_matlab(p_handle, i_time, c_action) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER, OPTIONAL, INTENT(in) :: i_time + CHARACTER (len=4), OPTIONAL :: c_action + INTEGER :: i_io1, i_cnt, i_opt, i_tim, i_alct, i_enum + INTEGER :: i_tcnt, i_fst, i_ftyp, i_unknow + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_xytmp + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_val + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_edofs + INTEGER, DIMENSION(:), ALLOCATABLE :: i_val + INTEGER, DIMENSION(1) :: i_valpoint +#ifdef _OPENMP + INTEGER, DIMENSION(:), ALLOCATABLE :: i_prc +#endif + REAL, PARAMETER :: r_1o3=(1./3.) + REAL :: r_tmp + CHARACTER (len=32) :: c_matfile + CHARACTER (len=28) :: c_tmp + LOGICAL :: l_flag, l_levl, l_vals + INTEGER :: i_dofnum + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name(1:23)), '_matlab.' + write(c_matfile,1010) trim(c_tmp), i_tcnt + c_matfile= adjustl(c_matfile) + i_io1= 15 + OPEN(i_io1, file= c_matfile, form= 'formatted', iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + +!---------- set time tag + + i_tim= p_handle%i_timetag + i_enum= p_handle%i_enumfine + +!---------- check input for optional parameters + + l_flag= .FALSE. + l_levl= .FALSE. + l_vals= .FALSE. + action_present: IF (present(c_action)) THEN + flag: IF(c_action == 'flag') THEN + l_flag= .TRUE. + i_ftyp= 1 + END IF flag + levl: IF(c_action == 'levl') THEN + l_levl= .TRUE. + i_ftyp= 1 + END IF levl + vals: IF(c_action == 'vals') THEN + l_vals= .TRUE. + i_ftyp= grid_femvarquery(GRID_tracer) + IF(i_ftyp /= 1) CALL grid_error(c_error='[plot_matlab]: invalid FEM type!') + END IF vals + END IF action_present + CALL grid_femtypequery(i_ftyp, i_unknowns=i_unknow) + i_dofnum= p_handle%i_unknowns(i_ftyp) + +!---------- allocate arrays and extract data + + i_valpoint= (/ GRID_tracer /) + allocate(r_xytmp(GRID_dimension,i_dofnum), i_edofs(i_unknow,i_enum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_matlab]: could not allocate aux. arrays r_xytmp...') + END IF + + CALL grid_getinfo(p_handle, r_dofcoordinates= r_xytmp, & + i_femtype=i_ftyp, i_elementdofs=i_edofs) + +#ifdef _OPENMP + allocate(i_prc(i_enum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_matlab]: could not allocate aux. array i_prc') + END IF + + CALL grid_getinfo(p_handle, l_finelevel=.TRUE., & + i_elementproc= i_prc) +#endif + + IF(l_flag) THEN + allocate(i_val(i_enum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_matlab]: could not allocate aux. array i_val') + END IF + CALL grid_getinfo(p_handle, l_finelevel=.TRUE., & + i_elementstatus= i_val) + ELSE IF(l_levl) THEN + allocate(i_val(i_enum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_matlab]: could not allocate aux. array i_val') + END IF + CALL grid_getinfo(p_handle, l_finelevel=.TRUE., & + i_elementlevel= i_val) + ELSE IF(l_vals) THEN + allocate(r_val(1,i_dofnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[plot_matlab]: could not allocate aux. array i_val') + END IF + CALL grid_getinfo(p_handle, i_arraypoint=i_valpoint, & + r_dofvalues= r_val) + END IF + +!---------- print values + + poly_loop: DO i_cnt=1,i_enum + IF(l_flag .OR. l_levl) THEN + i_opt= i_val(i_cnt) + ELSE IF (l_vals) THEN + r_tmp= sum(r_val(1,i_edofs(:,i_enum))) + r_tmp= r_tmp/ i_unknow + i_opt= anint(r_tmp) + ELSE + i_opt= -99999 + END IF +#ifdef _OPENMP + write(i_io1,1000) r_xytmp(1,i_edofs(1,i_cnt)), r_xytmp(1,i_edofs(2,i_cnt)), r_xytmp(1,i_edofs(3,i_cnt)), & + r_xytmp(2,i_edofs(1,i_cnt)), r_xytmp(2,i_edofs(2,i_cnt)), r_xytmp(2,i_edofs(3,i_cnt)), & + i_opt, i_prc(i_cnt) +#else + write(i_io1,1000) r_xytmp(1,i_edofs(1,i_cnt)), r_xytmp(1,i_edofs(2,i_cnt)), r_xytmp(1,i_edofs(3,i_cnt)), & + r_xytmp(2,i_edofs(1,i_cnt)), r_xytmp(2,i_edofs(2,i_cnt)), r_xytmp(2,i_edofs(3,i_cnt)), & + i_opt +#endif + END DO poly_loop + +!---------- close file + + CLOSE(i_io1) +#ifdef _OPENMP + DEALLOCATE(i_prc) +#endif + DEALLOCATE(r_xytmp,i_edofs) + IF(ALLOCATED(i_val)) DEALLOCATE(i_val) + IF(ALLOCATED(r_val)) DEALLOCATE(r_val) + + RETURN +#ifdef _OPENMP + 1000 FORMAT(6f15.6,2i8) +#else + 1000 FORMAT(6f15.6,i8) +#endif + 1010 FORMAT(a28,i4.4) + END SUBROUTINE plot_matlab + + + END MODULE IO_matlabplot diff --git a/flash2d/src/flash-sphere/IO_netcdfplot.f90 b/flash2d/src/flash-sphere/IO_netcdfplot.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bbc02c1610e8a534d49a6deafa9aea50ce3ec65f --- /dev/null +++ b/flash2d/src/flash-sphere/IO_netcdfplot.f90 @@ -0,0 +1,197 @@ +!******************************************************************************* +! +!> @file IO_netcdfplot.f90 +!> @brief contains module IO_netcdfplot +! +!******************************************************************************* +! +! REFERENCES: +! this module is based on the original implementations in the +! splash/fe project (fortran 77 version), but wildly modified! +! +! VERSION(S): +! 1. original version j. behrens 01/2000 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 03/2002 +! 3. compliant to amatos 2.0 j. behrens 07/2003 +! 4. rewritten to get more data s. vater 05/2012 +! 5. rewritten to use IO_ncugrid module s. vater 03/2014 +! +!******************************************************************************* +! MODULE DESCRIPTION: +!> creates output in NetCDF file format +! +MODULE IO_netcdfplot + USE IO_ncugrid + USE FLASH_parameters + USE GRID_api + + PRIVATE + PUBLIC :: plot_netcdf + + CONTAINS +!******************************************************************************* +! DESCRIPTION of [SUBROUTINE plot_netcdf]: +!> @brief creates output in netcdf file format +!> +!> @param[in] p_ghand grid handle for the linked lists +!> @param[in] i_time time stamp for file naming (opt.) +! + SUBROUTINE plot_netcdf(p_ghand, i_time) + + IMPLICIT NONE + +!---------- local declarations + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER, OPTIONAL, INTENT(in) :: i_time + INTEGER :: i_cnt, & + i_numelmt, i_numnode, i_alct, i_tcnt, i_dimvel, i_unkvel + INTEGER, SAVE :: i_timecount = 0 + CHARACTER (len=32) :: c_file, c_mesh + CHARACTER (len=64) :: c_title, c_tmp + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodexy + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE, TARGET :: r_val, r_aux + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_elmtnodes, i_eltdofs + INTEGER (KIND = GRID_SI), PARAMETER :: i_vallen = 5 + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE, TARGET :: i_eltlev, i_eltsta + INTEGER (KIND = GRID_SI), DIMENSION(i_vallen) :: i_valind + INTEGER (KIND = GRID_SI), DIMENSION(GRID_dimension) :: i_valuv + INTEGER (KIND = GRID_SI) :: i_fetyp + TYPE (ncugrid_vardatatype), DIMENSION(i_vallen+1) :: p_vdataarr + +!---------- check input for optional parameter + + IF(PRESENT(i_time)) THEN + i_tcnt = i_time + ELSE + i_tcnt = i_timecount + END IF + i_timecount = i_timecount + 1 + +!---------- check for FEM types + + i_fetyp = grid_femvarquery(1_GRID_SI) + +!---------- create the title + + WRITE(c_title,*) 'netCDF output from ',TRIM(GRID_parameters%program_name) + c_title = ADJUSTL(c_title) + +!---------- create generic file name + + c_mesh = 'Mesh2' + + WRITE(c_file, '(A, A1, I4.4, A3)') TRIM(GRID_parameters%program_name), '_', i_tcnt, '.nc' + +!---------- get array with node coordinates, and variable values + + i_numnode = p_ghand%i_nnumber + i_numelmt = p_ghand%i_enumfine + i_dimvel = GRID_femtypes%p_type(i_fetyp)%sig%i_unknowns + i_unkvel = p_ghand%i_unknowns(i_fetyp) + + ALLOCATE(r_nodexy(GRID_dimension, i_numnode), & + i_elmtnodes(GRID_elementnodes, i_numelmt), i_eltdofs(i_dimvel, i_numelmt), & + r_val(i_vallen, i_unkvel), r_aux(i_vallen, i_numelmt), & + i_eltlev(i_numelmt), i_eltsta(i_numelmt), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[plot_netcdf]: could not allocate aux. arrays') + + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_phi, GRID_zeta, GRID_tracer/) + + CALL grid_getinfo(p_ghand, l_finelevel=.TRUE., l_relative=.TRUE., & + i_femtype=i_fetyp, i_arraypoint=i_valind, r_nodecoordinates=r_nodexy, & + i_elementnodes=i_elmtnodes, r_dofvalues=r_val, i_elementdofs=i_eltdofs, & + i_elementlevel=i_eltlev, i_elementstatus=i_eltsta) + +!---------- create the file for timestep data + + CALL ncugrid_createmesh(c_file, c_mesh, i_numnode, i_numelmt, & + i_elmtnodes, r_nodexy, c_title, TRIM(GRID_parameters%author_affil2), & + c_contact=TRIM(GRID_parameters%author_email)) + +!---------- define variables (data) + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_v_x' + p_vdataarr(1)%c_varname = TRIM(c_tmp) + p_vdataarr(1)%c_long_name = 'velocity in x-direction' + p_vdataarr(1)%c_standard_name = 'velocity_in_x_direction' ! not CF conform! + p_vdataarr(1)%c_units = 'm/s' + p_vdataarr(1)%c_location = 'node' + p_vdataarr(1)%i_datatype = 1 + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_v_y' + p_vdataarr(2)%c_varname = TRIM(c_tmp) + p_vdataarr(2)%c_long_name = 'velocity in y-direction' + p_vdataarr(2)%c_standard_name = 'velocity_in_y_direction' ! not CF conform! + p_vdataarr(2)%c_units = 'm/s' + p_vdataarr(2)%c_location = 'node' + p_vdataarr(2)%i_datatype = 1 + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_phi' + p_vdataarr(3)%c_varname = TRIM(c_tmp) + p_vdataarr(3)%c_long_name = 'geopotential height (arbitrary variable)' + p_vdataarr(3)%c_standard_name = 'geopotential_height' ! not CF conform! + p_vdataarr(3)%c_units = 'none' + p_vdataarr(3)%c_location = 'node' + p_vdataarr(3)%i_datatype = 1 + + WRITE(c_tmp, '(A, A5)') TRIM(c_mesh), '_zeta' + p_vdataarr(4)%c_varname = TRIM(c_tmp) + p_vdataarr(4)%c_long_name = 'vorticity (arbitrary variable)' + p_vdataarr(4)%c_standard_name = 'absolute_vorticity' ! not CF conform! + p_vdataarr(4)%c_units = 'none' + p_vdataarr(4)%c_location = 'node' + p_vdataarr(4)%i_datatype = 1 + + WRITE(c_tmp, '(A, A7)') TRIM(c_mesh), '_tracer' + p_vdataarr(5)%c_varname = TRIM(c_tmp) + p_vdataarr(5)%c_long_name = 'tracer density distribution' + p_vdataarr(5)%c_standard_name = 'tracer_density' ! not CF conform! + p_vdataarr(5)%c_units = 'none' + p_vdataarr(5)%c_location = 'node' + p_vdataarr(5)%i_datatype = 1 + + WRITE(c_tmp, '(A, A6)') TRIM(c_mesh), '_level' + p_vdataarr(6)%c_varname = TRIM(c_tmp) + p_vdataarr(6)%c_long_name = 'grid level' + p_vdataarr(6)%c_standard_name = 'grid_level' ! not CF conform! + p_vdataarr(6)%c_units = 'none' + p_vdataarr(6)%c_location = 'face' + p_vdataarr(6)%i_datatype = 0 +! +!!---------- average over each cell and write into netCDF file +! +! DO i_cnt=1,i_numelmt +! r_aux(1, i_cnt) = SUM(r_val(1, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(2, i_cnt) = SUM(r_val(2, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(3, i_cnt) = SUM(r_val(3, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(4, i_cnt) = SUM(r_val(4, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! END DO + +!---------- write the nodal grid data + + p_vdataarr(1)%p_rvardata => r_val(1,:) + p_vdataarr(2)%p_rvardata => r_val(2,:) + p_vdataarr(3)%p_rvardata => r_val(3,:) + p_vdataarr(4)%p_rvardata => r_val(4,:) + p_vdataarr(5)%p_rvardata => r_val(5,:) + p_vdataarr(6)%p_ivardata => i_eltlev + +!--- write variables + + CALL ncugrid_putvariablearray(c_file, c_mesh, p_vdataarr, REAL(i_tcnt, GRID_SR)) + +!--- deallocate data arrays + + DO i_cnt=1,SIZE(p_vdataarr) + NULLIFY(p_vdataarr(i_cnt)%p_ivardata) + NULLIFY(p_vdataarr(i_cnt)%p_rvardata) + END DO + DEALLOCATE(r_nodexy, i_elmtnodes, r_val, r_aux, i_eltdofs, & + i_eltlev, i_eltsta) + + END SUBROUTINE plot_netcdf + +!******************************************************************************* +END MODULE IO_netcdfplot diff --git a/flash2d/src/flash-sphere/IO_plotdefine.f90 b/flash2d/src/flash-sphere/IO_plotdefine.f90 new file mode 100644 index 0000000000000000000000000000000000000000..214b4417b3f917de578966b120f2fa472f9622ba --- /dev/null +++ b/flash2d/src/flash-sphere/IO_plotdefine.f90 @@ -0,0 +1,40 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_plotdefine +! FUNCTION: +! define common variables for the plotting routines +! CONTAINS: +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 9/96 +! 2. added tracergrid j. behrens 12/97 +! +!***************************************************************** + MODULE IO_plotdefine + +!---------- some common definitions + + INTEGER, PARAMETER :: i_plotuplain= 1 ! plot u as scalar field + INTEGER, PARAMETER :: i_plotvplain= 2 ! plot v as scalar field + INTEGER, PARAMETER :: i_plotphiplain= 3 ! plot phi as scalar + INTEGER, PARAMETER :: i_plotugrid = 4 ! plot u as scalar field + INTEGER, PARAMETER :: i_plotvgrid = 5 ! plot v as scalar field + INTEGER, PARAMETER :: i_plotphigrid= 6 ! plot phi as scalar + INTEGER, PARAMETER :: i_plotgrid= 7 ! plot grid + INTEGER, PARAMETER :: i_plotuvvector= 8 ! plot (u,v)-vectors + INTEGER, PARAMETER :: i_plotvorticity= 9 ! plot vorticity as scalar + INTEGER, PARAMETER :: i_plottracer= 10 ! plot tracer as scalar + INTEGER, PARAMETER :: i_plottracergrid= 11 ! plot tracer plus grid + + END MODULE IO_plotdefine diff --git a/flash2d/src/flash-sphere/IO_utils.f90 b/flash2d/src/flash-sphere/IO_utils.f90 new file mode 100644 index 0000000000000000000000000000000000000000..96a6d6c1b8446e790f1bd227957fd30f02ea48f7 --- /dev/null +++ b/flash2d/src/flash-sphere/IO_utils.f90 @@ -0,0 +1,1064 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_utils +! FUNCTION: +! input/output routines (io_get...something, io_put...something) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! io_getcmdline +! FUNCTION: +! read options from command line +! SYNTAX: +! call io_getcmdline(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_getinterinput +! FUNCTION: +! get user input interactively +! SYNTAX: +! call io_getinterinput(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_getbatchinput +! FUNCTION: +! read user input from file +! SYNTAX: +! call io_getbatchinput(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putparameters +! FUNCTION: +! write out parameters in a nice way +! SYNTAX: +! call io_putparameters(param) +! ON INPUT: +! p_param: data structure containing parameters TYPE(control_struct) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putruntimeinfo +! FUNCTION: +! print some information on the current run time status +! SYNTAX: +! call io_putruntimeinfo(grid, info) +! ON INPUT: +! p_ghand: grid handle for no. of elements... TYPE(grid_handle) +! p_info: structure containing other info TYPE(rt_info) +! ON OUTPUT: +! p_info: structure reseted TYPE(rt_info) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putinputfile +! FUNCTION: +! print an input file conforming to io_getbatchinput +! SYNTAX: +! call io_putinputfile(param) +! ON INPUT: +! p_param: global parameter data structure TYPE(control_struct) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! io_getcmdline, io_getinterinput, io_getbatchinput, +! io_putparameters, io_putruntimeinfo, io_putinputfile +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, MISC_timing, IO_plotdefine, +! FEM_handle +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/96 +! 2. largely extended j. behrens 11/96 +! 3. changed command line io j. behrens 1/97 +! 4. changed runtime output (adaptations) j. behrens 1/97 +! 5. control data struct, less command io j. behrens 12/97 +! 6. tiff file plotting included j. behrens 1/98 +! 7. adapted to BJuGL j. behrens 1/2000 +! 8. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE IO_utils + USE FLASH_metadata + USE FLASH_parameters + USE MISC_timing + USE MISC_system + USE GRID_api + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + PUBLIC :: io_getcmdline, io_getinterinput, io_getbatchinput, & + io_putparameters, io_putruntimeinfo, io_putinputfile, io_initparams + CONTAINS +!***************************************************************** + SUBROUTINE io_getcmdline(p_cmd) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_cmd + + LOGICAL :: l_ict + LOGICAL :: l_bat + LOGICAL :: l_mtl + LOGICAL :: l_dia + CHARACTER (len=io_fillen) :: a_infln + CHARACTER (len=io_fillen) :: a_outfln + INTEGER :: numargs + INTEGER :: i= 1 + INTEGER :: i_fst + LOGICAL :: help= .true. + LOGICAL :: shoversion= .false. + CHARACTER (len=2) :: option + CHARACTER (len=15) :: comdnam + CHARACTER (len=io_fillen) :: c_dummy + +!---------- initialize output variables + + a_infln = adjustl(trim('Parameters.in')) + a_outfln= adjustl(trim('./')) + l_ict= .false. + l_bat= .false. + l_mtl= .false. + l_dia= .false. + +!---------- read number commandline arguments +! this is possibly non standard f90, but definitely quasi standard + + numargs= sys_numcmdargs() + CALL sys_getcmdargs(0,c_dummy,i_len=len(c_dummy)) + comdnam= c_dummy(1:15) + check_args: IF(numargs < 1) THEN + GOTO 100 ! print_help + ELSE check_args + +!---------- read command line arguments one by one + + DO WHILE (i <= numargs) + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + option= c_dummy(1:2) + +!---------- select the CASEs for command line options + + eval_option: SELECT CASE (option) + CASE('-h') eval_option !--- request for help --- + help= .true. + i= i+1 + CASE('-?') eval_option !--- request for help --- + help= .true. + i= i+1 + CASE('-r') eval_option !--- print release information --- + shoversion= .true. + i= i+1 +! CASE('-i') eval_option !--- select interactive input mode --- +! help= .false. +! l_ict= .true. +! i= i+1 +! CASE('-d') eval_option !--- switch on diagnostics --- +! help= .false. +! l_dia= .true. +! i= i+1 + CASE('-l') eval_option !--- switch on logging --- + help= .false. + p_cmd%cmd%l_logging= .true. + i= i+1 + CASE('-o') eval_option !--- redirect output into file --- + help= .false. + p_cmd%cmd%l_output= .true. + i= i+1 +! CASE('-b') eval_option !--- select batch input mode --- +! help= .false. +! l_bat= .true. +! IF(a_infln == 'xxxxxxxxxxxxxxxxxxxx') & +! a_infln= 'Parameters.in' !--- default input file name --- +! i= i+1 + CASE('-f') eval_option !--- supply input file name --- + help= .false. + i= i+1 + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + a_infln= c_dummy(1:io_fillen) + IF(a_infln(1:1) == '-') THEN !--- check correctnes of file name --- + help= .true. + GOTO 100 ! print_help + ELSE + i= i+1 + END IF + CASE('-d') eval_option !--- directory path in which to find and write data --- + help= .false. + i= i+1 + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + a_outfln= c_dummy(1:io_fillen) + IF(a_outfln(1:1) == '-') THEN !--- check correctnes of file name --- + help= .true. + GOTO 100 ! print_help + ELSE + i= i+1 + END IF + CASE DEFAULT eval_option !--- default CASE: show help --- + help= .true. + GOTO 100 ! print_help + END SELECT eval_option + END DO + END IF check_args + +!---------- update output structure + + p_cmd%cmd%c_infile = a_infln + p_cmd%cmd%c_directory = a_outfln +! p_cmd%cmd%l_interactive= l_ict +! p_cmd%cmd%l_diagnostics= l_dia +! p_cmd%cmd%l_batchmode= l_bat + +!---------- print help information + + 100 print_help: IF(help) THEN + IF(shoversion) THEN + write(GRID_parameters%ioout,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + write(GRID_parameters%ioout,1002) comdnam + write(i_ioerr,*) 'STOPPED ... this is all I can say' + STOP + ELSE + write(GRID_parameters%ioout,1010) comdnam + write(GRID_parameters%ioout,1011) GRID_parameters%author_name + write(i_ioerr,*) 'STOPPED ... hope this made it clear' + STOP + END IF + END IF print_help + +!---------- print version information + + print_version: IF(shoversion) THEN + write(GRID_parameters%ioout,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + END IF print_version + + RETURN + + 1001 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** PROGRAM: ',a15,24x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,31x,'*****',/ & + 1x,'***** DATE: ',i2.2,'/',i4.4,32x,'*****',/ & + 1x,'***** AUTHOR: ',a12,27x,'*****',/ & + 1x,'***** E-MAIL: ',a39,'*****',/ & + 1x,'***** ADDRESS: ',a39,'*****',/ & + 1x,'***** ',a39,'*****',/ & + 1x,'***** ',a39,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****') + 1002 FORMAT(1x,'***** TYPE ',a15,' -h, to get help',12x,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****') + 1010 FORMAT(1x,'USAGE: ',a15,' {-d dir} {-f file} {-h} {-l} {-o} {-r}',/ & + 1x,' -d: determine input/output file directory path << dir >>, default ./',/ & + 1x,' -f: input filename is << name >>, default Parameters.in',/ & + 1x,' -h: help information (this output)',/ & + 1x,' -l: switch on log file output',/ & + 1x,' -o: redirect standard output to a file',/ & + 1x,' -r: release information') + 1011 FORMAT(1x,'Copyright (c) 2016',a13) + END SUBROUTINE io_getcmdline +!***************************************************************** + SUBROUTINE io_initparams(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_param + INTEGER :: i_maxsize, i_alct + +!---------- initialize + + p_param%num%r_deltatime = -1.0 + p_param%num%r_reftolerance = -1.0 + p_param%num%r_crstolerance = -1.0 + p_param%num%r_refwatermark = -1.0 + p_param%num%r_crswatermark = -1.0 + p_param%num%i_experiment = -1 + p_param%num%i_crslevel = -1 + p_param%num%i_reflevel = -1 + p_param%num%i_frsttimestep = -1 + p_param%num%i_lasttimestep = -1 + p_param%num%r_starttime = -1.0 + p_param%num%r_finaltime = -1.0 + p_param%num%i_adviterations = -1 + p_param%io%i_plotoffset = -1 + p_param%io%i_saveoffset = -1 + p_param%io%i_savelast = -1 + p_param%io%l_diagnostics = .FALSE. + p_param%io%l_vtu = .FALSE. + p_param%io%l_netcdf = .FALSE. + p_param%io%c_domainfile = 'Domain.dat' + p_param%io%c_triangfile = 'Triang.dat' + +!---------- allocate from meta data structure + + log_init: IF(l_logused) THEN + ALLOCATE(p_param%phy%phy_log(i_lognum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_initparams]: could not allocate log pointers') + END IF log_init + + char_init: IF(l_charused) THEN + ALLOCATE(p_param%phy%phy_char(i_charnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_initparams]: could not allocate char pointers') + END IF char_init + + int_init: IF(l_intused) THEN + i_maxsize= maxval(i_intsizes) + ALLOCATE(p_param%phy%phy_int(i_maxsize,i_intnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_initparams]: could not allocate int pointers') + END IF int_init + + real_init: IF(l_realused) THEN + i_maxsize= maxval(i_realsizes) + ALLOCATE(p_param%phy%phy_real(i_maxsize,i_realnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_initparams]: could not allocate real pointers') + END IF real_init + + END SUBROUTINE io_initparams +! ***************************************************************** +! SUBROUTINE io_getinterinput(p_param) +! +! ---------- local declarations +! +! IMPLICIT NONE +! +! TYPE (control_struct), INTENT(out) :: p_param +! INTEGER :: i_iost, i_tmp, i_cln +! CHARACTER (len=io_fillen) :: c_tmp +! +! ---------- initialize +! +! CALL io_initparams(p_param) +! i_cln= MAX(GRID_parameters%i_stringlength,io_fillen) +! +! ---------- prompt user for input (loop in case of wrong input) +! +! write(GRID_parameters%ioout,1000) GRID_parameters%program_name, GRID_parameters%version, & +! GRID_parameters%subversion, GRID_parameters%patchversion +! +! ---------- Experiment Control +! +! write(GRID_parameters%ioout,1001) +! write(GRID_parameters%ioout,1010) +! write(GRID_parameters%ioout,1011,advance='NO') +! read(*,*) p_param%phy%i_experiment +! +! ---------- Adaptivity Control +! +! write(GRID_parameters%ioout,1001) +! write(GRID_parameters%ioout,1020) +! write(GRID_parameters%ioout,1021,advance='NO') +! read(*,*) p_param%phy%i_reflevel +! write(GRID_parameters%ioout,1022,advance='NO') +! read(*,*) p_param%phy%i_crslevel +! write(GRID_parameters%ioout,1023,advance='NO') +! read(*,*) p_param%phy%r_reftolerance +! write(GRID_parameters%ioout,1024,advance='NO') +! read(*,*) p_param%phy%r_crstolerance +! write(GRID_parameters%ioout,1025,advance='NO') +! read(*,*) p_param%phy%r_refwatermark +! write(GRID_parameters%ioout,1026,advance='NO') +! read(*,*) p_param%phy%r_crswatermark +! +! ---------- Time Step Control +! +! write(GRID_parameters%ioout,1001) +! write(GRID_parameters%ioout,1030) +! write(GRID_parameters%ioout,1031,advance='NO') +! read(*,*) p_param%phy%r_deltatime +! write(GRID_parameters%ioout,1032,advance='NO') +! read(*,*) p_param%phy%i_frsttimestep +! write(GRID_parameters%ioout,1033,advance='NO') +! read(*,*) p_param%phy%i_lasttimestep +! +! ---------- Output Control +! +! write(GRID_parameters%ioout,1001) +! write(GRID_parameters%ioout,1040) +! write(GRID_parameters%ioout,1041,advance='NO') +! read(*,*) p_param%io%i_saveoffset +! write(GRID_parameters%ioout,1043,advance='NO') +! read(*,*) p_param%io%i_savelast +! write(GRID_parameters%ioout,1042,advance='NO') +! read(*,*) p_param%io%i_plotoffset +! write(GRID_parameters%ioout,1049,advance='NO') +! read(*,*) i_tmp +! IF(i_tmp /= 0) THEN +! p_param%io%l_matlab= .True. +! END IF +! write(GRID_parameters%ioout,10491,advance='NO') +! read(*,*) i_tmp +! IF(i_tmp /= 0) THEN +! p_param%io%l_gmv= .True. +! END IF +! -- BEGIN added for visnetplot [flo] +! write(GRID_parameters%ioout,10492,advance='NO') +! read(*,*) i_tmp +! IF(i_tmp /= 0) THEN +! p_param%io%l_visnet= .True. +! END IF +! write(GRID_parameters%ioout,10493,advance='NO') +! read(*,*) i_tmp +! IF(i_tmp /= 0) THEN +! p_param%io%l_visnet_tiff= .True. +! END IF +! -- END +! write(GRID_parameters%ioout,1047,advance='NO') +! read(*,2000,iostat=i_iost) c_tmp +! IF(i_iost == 0) THEN +! p_param%io%c_triangfile(1:i_cln)= c_tmp(1:i_cln) +! END IF +! +! ---------- Iteration Control +! +! write(GRID_parameters%ioout,1001) +! write(GRID_parameters%ioout,1050) +! write(GRID_parameters%ioout,1051,advance='NO') +! read(*,*) p_param%phy%i_adviterations +! write(GRID_parameters%ioout,1002) +! +! ---------- error handling +! +! no_value: IF((p_param%phy%r_deltatime < 0.0) .OR. & +! (p_param%phy%r_reftolerance < 0.0) .OR. & +! (p_param%phy%r_crstolerance < 0.0) .OR. & +! (p_param%phy%r_refwatermark < 0.0) .OR. & +! (p_param%phy%r_crswatermark < 0.0) .OR. & +! (p_param%phy%i_experiment < 0) .OR. & +! (p_param%phy%i_crslevel < 0) .OR. & +! (p_param%phy%i_reflevel < 0) .OR. & +! (p_param%phy%i_frsttimestep < 0) .OR. & +! (p_param%phy%i_lasttimestep < 0) .OR. & +! (p_param%io%i_plotoffset < 0) .OR. & +! (p_param%io%i_saveoffset < 0) .OR. & +! (p_param%phy%i_adviterations < 0)) THEN +! CALL grid_error(20) +! END IF no_value +! RETURN +! +! 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & +! 1x,'***** PROGRAM: ',a15,24x,'*****',/ & +! 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,31x,'*****',/ & +! 1x,'***** Started in INTERACTIVE input mode *****',/ & +! 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) +! 1001 FORMAT(1x,'-----------------------------------------------------------',/) +! 1002 FORMAT(1x,'---------------------- end of input -----------------------',/) +! 1010 FORMAT(1x,' Experiment') +! 1020 FORMAT(1x,' Adaptivity Control') +! 1030 FORMAT(1x,' Timestep Control') +! 1040 FORMAT(1x,' Input/Output Control') +! 1050 FORMAT(1x,' Iteration Control') +! 1011 FORMAT(1x,'INPUT: Experiment No. (first exp. = 0) > ') +! 1021 FORMAT(1x,'INPUT: Finest level of refinement > ') +! 1022 FORMAT(1x,'INPUT: Coarsest level of refinement > ') +! 1023 FORMAT(1x,'INPUT: Tolerance for refinement (|t_r| < 1) > ') +! 1024 FORMAT(1x,'INPUT: Tolerance for Coarsening (t_c < t_r) > ') +! 1025 FORMAT(1x,'INPUT: Watermark for refinement (|w_r| < 1) > ') +! 1026 FORMAT(1x,'INPUT: Watermark for coarsening (|w_c| < 1) > ') +! 1031 FORMAT(1x,'INPUT: Timestep length (delta t) > ') +! 1032 FORMAT(1x,'INPUT: First timestep number > ') +! 1033 FORMAT(1x,'INPUT: Last timestep number > ') +! 1041 FORMAT(1x,'INPUT: Number of timesteps between saves > ') +! 1042 FORMAT(1x,'INPUT: Number of timesteps between plots > ') +! 1043 FORMAT(1x,'INPUT: Save last step for next experiment (no = 0) > ') +! 1045 FORMAT(1x,'INPUT: Plot polygonal outline (no = 0) > ') +! 10451 FORMAT(1x,'INPUT: Filename for polygon data (Polyline.dat) > ') +! 1046 FORMAT(1x,'INPUT: Read wind data from file (no = 0) > ') +! 10461 FORMAT(1x,'INPUT: Filename for wind data (Flow.dat) > ') +! 1047 FORMAT(1x,'INPUT: Filename for triangulation (Triang.dat) > ') +! 1049 FORMAT(1x,'INPUT: Write matlab compatible output file (no = 0) > ') +! 10491 FORMAT(1x,'INPUT: Write gmv compatible output file (no = 0) > ') +! -- BEGIN added for visnetplot [flo]: +! 10492 FORMAT(1x,'INPUT: Plot to visnet window (no = 0) > ') +! 10493 FORMAT(1x,'INPUT: Make visnet screenshots (no = 0) > ') +! -- END +! 1051 FORMAT(1x,'INPUT: Iterations in trajectory estimation > ') +! +! 2000 FORMAT(a32) +! +! END SUBROUTINE io_getinterinput +!***************************************************************** + SUBROUTINE io_getbatchinput(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_param + INTEGER, PARAMETER :: i_iofil= 10 + CHARACTER (len=80) :: a_filrow + CHARACTER (LEN=GRID_parameters%i_stringlength) :: c_tmp + INTEGER :: i_iost, i_ioend, & + i_tmp, i_cln, i_cnt, i_len + CHARACTER (LEN=2*io_fillen) :: c_inputfile, ctest +! CHARACTER (LEN=io_fillen) :: c_inputfile + INTEGER, PARAMETER :: i_filstrlen=2*io_fillen + +!---------- initialize + + i_cln= MIN(GRID_parameters%i_stringlength,io_fillen) + i_iost= 0 + +!---------- input file + + WRITE(c_inputfile,*) trim(p_param%cmd%c_directory),p_param%cmd%c_infile + c_inputfile= adjustl(trim(c_inputfile)) + +!---------- open input file + + OPEN(unit= i_iofil, file= c_inputfile, status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + WRITE(i_ioerr,*) 'ERROR: Filename: ', c_inputfile + IF(GRID_parameters%iolog > 0) & + WRITE(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_inputfile + CALL grid_error(c_error='[io_getbatchinput]: Could not open parameters file') + ELSE file_notopen + WRITE(GRID_parameters%ioout,1000) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, c_inputfile + IF(GRID_parameters%iolog > 0) THEN + WRITE(GRID_parameters%iolog,*) 'INFO: Filename: ', c_inputfile, ' opened on unit: ', i_iofil + WRITE(GRID_parameters%iolog,1000) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, c_inputfile + END IF + END IF file_notopen + +!---------- read line by line + + read_loop: DO + READ(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + CLOSE(i_iofil) + IF(GRID_parameters%iolog > 0) & + WRITE(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CYCLE read_loop + ELSE IF(a_filrow(1:14) == 'EXPERIMENT_NUM') THEN comment_line + read(i_iofil,*) p_param%num%i_experiment + ELSE IF(a_filrow(1:14) == 'FINE_GRID_LEVE') THEN comment_line + read(i_iofil,*) p_param%num%i_reflevel + ELSE IF(a_filrow(1:14) == 'COARSE_GRID_LE') THEN comment_line + read(i_iofil,*) p_param%num%i_crslevel + ELSE IF(a_filrow(1:14) == 'TOLERANCE_OF_R') THEN comment_line + read(i_iofil,*) p_param%num%r_reftolerance + ELSE IF(a_filrow(1:14) == 'TOLERANCE_OF_C') THEN comment_line + read(i_iofil,*) p_param%num%r_crstolerance + ELSE IF(a_filrow(1:14) == 'WATERMARK_OF_R') THEN comment_line + read(i_iofil,*) p_param%num%r_refwatermark + ELSE IF(a_filrow(1:14) == 'WATERMARK_OF_C') THEN comment_line + read(i_iofil,*) p_param%num%r_crswatermark + ELSE IF(a_filrow(1:14) == 'TIMESTEP_LENGT') THEN comment_line + read(i_iofil,*) p_param%num%r_deltatime + ELSE IF(a_filrow(1:14) == 'BEGINNING_TIME') THEN comment_line + read(i_iofil,*) p_param%num%i_frsttimestep + ELSE IF(a_filrow(1:14) == 'FINISHING_TIME') THEN comment_line + read(i_iofil,*) p_param%num%i_lasttimestep + ELSE IF(a_filrow(1:14) == 'TIMESTEPPING_S') THEN comment_line + read(i_iofil,*) p_param%num%r_starttime + ELSE IF(a_filrow(1:14) == 'TIMESTEPPING_E') THEN comment_line + read(i_iofil,*) p_param%num%r_finaltime + ELSE IF(a_filrow(1:14) == 'SLM_ITERATION_') THEN comment_line + read(i_iofil,*) p_param%num%i_adviterations + ELSE IF(a_filrow(1:14) == 'STEPS_BTW_PLOT') THEN comment_line + read(i_iofil,*) p_param%io%i_plotoffset + ELSE IF(a_filrow(1:14) == 'SWITCH_ON_DIAG') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_diagnostics= .TRUE. + ELSE IF(a_filrow(1:14) == 'NETCDF_FILE_PL') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_netcdf= .TRUE. + ELSE IF(a_filrow(1:14) == 'VTU_FILE_PLOTT') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_vtu= .TRUE. + ELSE IF(a_filrow(1:14) == 'STEPS_BTW_SAVE') THEN comment_line + read(i_iofil,*) p_param%io%i_saveoffset + ELSE IF(a_filrow(1:14) == 'SAVE_FINISH_CO') THEN comment_line + read(i_iofil,*) p_param%io%i_savelast + ELSE IF(a_filrow(1:14) == 'DOMAIN_FILE_NA') THEN comment_line + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(i_tmp == 0) p_param%io%c_domainfile(1:i_cln)= c_tmp(1:i_cln) + ELSE IF(a_filrow(1:14) == 'TRIANG_FILE_NA') THEN comment_line + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(i_tmp == 0) p_param%io%c_triangfile(1:i_cln)= c_tmp(1:i_cln) +!---------- look for additional parameters in the physical parameter set + ELSE comment_line + IF(l_logused) THEN + log_loop: DO i_cnt=1,i_lognum + IF(a_filrow(1:i_comparlen) == c_logkeywds(i_cnt)) THEN + read(i_iofil,*) p_param%phy%phy_log(i_cnt) + END IF + END DO log_loop + END IF + IF(l_charused) THEN + char_loop: DO i_cnt=1,i_charnum + IF(a_filrow(1:i_comparlen) == c_charkeywds(i_cnt)) THEN + read(i_iofil,*) p_param%phy%phy_char(i_cnt) + END IF + END DO char_loop + END IF + IF(l_intused) THEN + int_loop: DO i_cnt=1,i_intnum + IF(a_filrow(1:i_comparlen) == c_intkeywds(i_cnt)) THEN + DO i_len=1,i_intsizes(i_cnt) + read(i_iofil,*) p_param%phy%phy_int(i_len,i_cnt) + END DO + END IF + END DO int_loop + END IF + IF(l_realused) THEN + real_loop: DO i_cnt=1,i_realnum + IF(a_filrow(1:i_comparlen) == c_realkeywds(i_cnt)) THEN + DO i_len=1,i_realsizes(i_cnt) + read(i_iofil,*) p_param%phy%phy_real(i_len,i_cnt) + END DO + END IF + END DO real_loop + END IF + END IF comment_line + END IF file_end + END DO read_loop + +!---------- for backward compatibility we accept time step input, but +! it is necessary to compute the initial and final time... + no_inittime: IF((p_param%num%r_starttime < 0.0) .OR. & + (p_param%num%r_finaltime < 0.0)) THEN + +!---------- check if at least first and last timestep are given + no_step: IF((p_param%num%i_frsttimestep < 0) .OR. & + (p_param%num%i_lasttimestep < 0)) THEN + CALL grid_error(c_error='[io_getbatchinput]: incomplete time stepping info') + END IF no_step + +!---------- check if delta time is given + no_delta: IF((p_param%num%r_deltatime < 0.0)) THEN + CALL grid_error(c_error='[io_getbatchinput]: incomplete delta t') + END IF no_delta + +!---------- now compute initial and final time from time stepping info + + p_param%num%r_starttime = p_param%num%r_deltatime * p_param%num%i_frsttimestep + p_param%num%r_finaltime = p_param%num%r_deltatime * p_param%num%i_lasttimestep + + END IF no_inittime + +!---------- error handling + + no_value: IF((p_param%num%r_deltatime < 0.0) .OR. & + (p_param%num%r_starttime < 0.0) .OR. & + (p_param%num%r_finaltime < 0.0) .OR. & + (p_param%num%r_reftolerance < 0.0) .OR. & + (p_param%num%r_crstolerance < 0.0) .OR. & + (p_param%num%r_refwatermark < 0.0) .OR. & + (p_param%num%r_crswatermark < 0.0) .OR. & + (p_param%num%i_experiment < 0) .OR. & + (p_param%num%i_crslevel < 0) .OR. & + (p_param%num%i_reflevel < 0) .OR. & + (p_param%io%i_plotoffset < 0) .OR. & + (p_param%io%i_saveoffset < 0) .OR. & + (p_param%num%i_adviterations < 0)) THEN + CALL grid_error(c_error='[io_getbatchinput]: Insufficient input parameters') + END IF no_value + + RETURN + + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** PROGRAM: ',a15,22x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,29x,'*****',/ & + 1x,'***** Started in BATCH input mode',10x,'*****',/ & + 1x,'***** INPUTFILE: ',a20,17x,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 2000 FORMAT(a80) + 2010 FORMAT(a32) + + END SUBROUTINE io_getbatchinput +!***************************************************************** + SUBROUTINE io_putparameters(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER :: i1, i2, i3, i9, i10, i11, i12, i13, i14 + REAL (KIND = GRID_SR) :: r4, r5, r6, r7, r8, r9, r10 + CHARACTER (len=3) :: c_diag, c_netc, c_vtup + +!---------- temporary store + + i1 = p_param%num%i_experiment + i2 = p_param%num%i_reflevel + i3 = p_param%num%i_crslevel + r4 = p_param%num%r_reftolerance + r5 = p_param%num%r_crstolerance + r6 = p_param%num%r_refwatermark + r7 = p_param%num%r_crswatermark + r8 = p_param%num%r_deltatime + r9 = p_param%num%r_starttime + r10= p_param%num%r_finaltime + i11= p_param%io%i_saveoffset + i12= p_param%io%i_plotoffset + i13= p_param%io%i_savelast + i14= p_param%num%i_adviterations + + IF(p_param%io%l_diagnostics) THEN + c_diag= ' ON' + ELSE + c_diag= 'OFF' + END IF + IF(p_param%io%l_netcdf) THEN + c_netc= ' ON' + ELSE + c_netc= 'OFF' + END IF + IF(p_param%io%l_vtu) THEN + c_vtup= ' ON' + ELSE + c_vtup= 'OFF' + END IF + +!---------- write satement + + write(GRID_parameters%ioout,1000) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10, i11, i12, & + i13, i14, c_diag, c_netc, c_vtup + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1000) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10, i11, i12, & + i13, i14, c_diag, c_netc, c_vtup + + RETURN + + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Global Parameters',16x,'*****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Experiment No.',25x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Finest grid level',22x,i8,' *****',/ & + 1x,'***** Coarsest grid level',20x,i8,' *****',/ & + 1x,'***** Refinement tolerance',15x,e12.4,' *****',/ & + 1x,'***** Coarsening tolerance',15x,e12.4,' *****',/ & + 1x,'***** Refinement watermark',15x,e12.4,' *****',/ & + 1x,'***** Coarsening watermark',15x,e12.4,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Timestep length',20x,e12.4,' *****',/ & + 1x,'***** Start time',25x,e12.4,' *****',/ & + 1x,'***** Final time',25x,e12.4,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Timesteps between save',17x,i8,' *****',/ & + 1x,'***** Timesteps between plot',17x,i8,' *****',/ & + 1x,'***** Flag for last save',21x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Iterations for trajectories',12x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Diagnostics switched',24x,a3,' *****',/ & + 1x,'***** NetCDF plotting switched',20x,a3,' *****',/ & + 1x,'***** VTU plotting switched',23x,a3,' *****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + + END SUBROUTINE io_putparameters +!***************************************************************** + SUBROUTINE io_putruntimeinfo(p_ghand, p_info, p_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (rt_info), INTENT(inout) :: p_info + TYPE (sw_info), INTENT(inout) :: p_time + INTEGER :: i_cnt + +!---------- output + + write(GRID_parameters%ioout,1000) p_info%i_step, p_info%r_modeltime, p_info%i_adapit, & + p_ghand%i_enumber, p_ghand%i_enumfine, & + p_ghand%i_gnumber, p_ghand%i_gnumfine, & + p_ghand%i_nnumber + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1000) p_info%i_step, p_info%r_modeltime, p_info%i_adapit, & + p_ghand%i_enumber, p_ghand%i_enumfine, & + p_ghand%i_gnumber, p_ghand%i_gnumfine, & + p_ghand%i_nnumber + times_loop: DO i_cnt=1,p_time%i_num + write(GRID_parameters%ioout,1003) p_time%p_tim(i_cnt)%c_tim, p_time%p_tim(i_cnt)%r_tim + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1003) p_time%p_tim(i_cnt)%c_tim, p_time%p_tim(i_cnt)%r_tim + END DO times_loop + save_perf: IF(p_info%l_saved) THEN + write(GRID_parameters%ioout,1002) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1002) + also_plot: IF(p_info%l_ploted) THEN + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1006) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1005) + write(GRID_parameters%iolog,1006) + END IF + ELSE also_plot + write(GRID_parameters%ioout,1005) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1005) + END IF also_plot + ELSE save_perf + but_plot: IF(p_info%l_ploted) THEN + write(GRID_parameters%ioout,1002) + write(GRID_parameters%ioout,1006) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1002) + write(GRID_parameters%iolog,1006) + END IF + END IF but_plot + END IF save_perf + write(GRID_parameters%ioout,1010) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1010) + +!---------- reset info structure + + p_info%i_step = 0 + p_info%i_adapit= 0 + p_info%l_saved = .FALSE. + p_info%l_ploted= .FALSE. + + RETURN + + 1000 FORMAT(1x,'+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++',/ & + 1x,'+++++ Runtime Information Output +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Timestep Number',24x,i8,' +++++',/ & + 1x,'+++++ Model time',25x,e12.4,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Inner iterations (for adaptation)',6x,i8,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Number of elements',21x,i8,' +++++',/ & + 1x,'+++++ Number of elements (fine grid)',9x,i8,' +++++',/ & + 1x,'+++++ Number of edges',24x,i8,' +++++',/ & + 1x,'+++++ Number of edges (fine grid)',12x,i8,' +++++',/ & + 1x,'+++++ Number of nodes',24x,i8,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++') + 1002 FORMAT(1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++') + 1003 FORMAT(1x,'+++++ Time spent in ',a16,5x,e12.4,' +++++') + 1005 FORMAT(1x,'+++++ Saveset transferred to disk in this step +++++') + 1006 FORMAT(1x,'+++++ Plotting performed in this step +++++') + 1010 FORMAT(1x,'+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++',/) + + END SUBROUTINE io_putruntimeinfo +!***************************************************************** + SUBROUTINE io_putinputfile(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER :: i1, i2, i3, i9, i10, i11, & + i12, i13, i14, i15, i16, i17, i18, i19, i20, i31 + INTEGER :: i_cnt, i_true, i_false, i_len + REAL (KIND = GRID_SR) :: r4, r5, r6, r7, r8, r9, r10 + INTEGER :: i_unit=15, i_fst + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + +!---------- temporary store + + i1 = p_param%num%i_experiment+ 1 + i2 = p_param%num%i_reflevel + i3 = p_param%num%i_crslevel + r4 = p_param%num%r_reftolerance + r5 = p_param%num%r_crstolerance + r6 = p_param%num%r_refwatermark + r7 = p_param%num%r_crswatermark + r8 = p_param%num%r_deltatime + r9 = p_param%num%r_finaltime + r10= p_param%num%r_finaltime + (p_param%num%r_finaltime- p_param%num%r_starttime) + i12= 0 + IF(p_param%io%l_netcdf) i12= 1 + i11= 0 + IF(p_param%io%l_vtu) i11= 1 + i31= 0 + IF(p_param%io%l_diagnostics) i31= 1 + i13= p_param%io%i_plotoffset + i14= p_param%io%i_saveoffset + i15= p_param%io%i_savelast + i16= p_param%num%i_adviterations + + i_true= 1 + i_false= 0 + +!---------- open file + + write(c_tmp,*) trim(GRID_parameters%program_name), '_input.' + write(c_file,1010) trim(c_tmp), i1 + c_file= adjustl(c_file) + open(i_unit, file= c_file, action= 'write', form= 'formatted', & + status='replace', iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(c_error='[io_putinputfile]: Could not open parameters file for output') + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_unit + +!---------- write statement + + write(i_unit,1001) c_file, GRID_parameters%program_name + write(i_unit,1002) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10 + write(i_unit,1003) i12, i11, i31, i13, i14, & + i15, p_param%io%c_domainfile, p_param%io%c_triangfile, i16 + +!---------- write statements for the generic phy part + + IF(l_logused) THEN + log_loop: DO i_cnt=1,i_lognum + write(i_unit,1011) c_logkeywds(i_cnt) + IF(p_param%phy%phy_log(i_cnt)) THEN + write(i_unit,*) i_true + ELSE + write(i_unit,*) i_false + END IF + END DO log_loop + END IF + IF(l_charused) THEN + char_loop: DO i_cnt=1,i_charnum + write(i_unit,1011) c_charkeywds(i_cnt) + write(i_unit,*) p_param%phy%phy_char(i_cnt) + END DO char_loop + END IF + IF(l_intused) THEN + int_loop: DO i_cnt=1,i_intnum + write(i_unit,1011) c_intkeywds(i_cnt) + DO i_len=1,i_intsizes(i_cnt) + write(i_unit,*) p_param%phy%phy_int(i_len,i_cnt) + END DO + END DO int_loop + END IF + IF(l_realused) THEN + real_loop: DO i_cnt=1,i_realnum + write(i_unit,1011) c_realkeywds(i_cnt) + DO i_len=1,i_realsizes(i_cnt) + write(i_unit,*) p_param%phy%phy_real(i_len,i_cnt) + END DO + END DO real_loop + END IF + write(i_unit,1004) + +!---------- close file + + close(i_unit) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_unit + + RETURN + + 1001 FORMAT('# --- --- --- --- --- --- --- --- --- --- --- --- ---',/ & + '# Parameter file ',a32,/ & + '# created automatically by program ',a15,/ & + '# --- --- --- --- --- --- --- --- --- --- --- --- ---') + 1002 FORMAT('EXPERIMENT_NUMBER',/ & + i8,/ & + 'FINE_GRID_LEVEL',/ & + i8,/ & + 'COARSE_GRID_LEVEL',/ & + i8,/ & + 'TOLERANCE_OF_REFINEMENT',/ & + e12.4,/ & + 'TOLERANCE_OF_COARSENING',/ & + e12.4,/ & + 'WATERMARK_OF_REFINEMENT',/ & + e12.4,/ & + 'WATERMARK_OF_COARSENING',/ & + e12.4,/ & + 'TIMESTEP_LENGTH',/ & + e12.4,/ & + 'TIMESTEPPING_START_TIME',/ & + e12.4,/ & + 'TIMESTEPPING_END_TIME',/ & + e12.4) + 1003 FORMAT('NETCDF_FILE_PLOTTING',/ & + i8,/ & + 'VTU_FILE_PLOTTING',/ & + i8,/ & + 'SWITCH_ON_DIAGNOSTICS',/ & + i8,/ & + 'STEPS_BTW_PLOTS',/ & + i8,/ & + 'STEPS_BTW_SAVES',/ & + i8,/ & + 'SAVE_FINISH_CONFIGURATION',/ & + i8,/ & + 'DOMAIN_FILE_NAME',/ & + a32,/ & + 'TRIANG_FILE_NAME',/ & + a32,/ & + 'SLM_ITERATION_NUMBER',/ & + i8) + 1004 FORMAT('# --- --- End of parameter file --- --- --- --- ---') + 1010 FORMAT(a28,i4.4) + 1011 FORMAT(a12) ! CAUTION: Make sure this is exactly as long as i_comparlen in FLASH_metadata + + END SUBROUTINE io_putinputfile + END MODULE IO_utils diff --git a/flash2d/src/flash-sphere/IO_vtu.F90 b/flash2d/src/flash-sphere/IO_vtu.F90 new file mode 100644 index 0000000000000000000000000000000000000000..b024189cdca3e184695b012d06cfe0d71b0c1a18 --- /dev/null +++ b/flash2d/src/flash-sphere/IO_vtu.F90 @@ -0,0 +1,554 @@ +!----------------------------------------------------------------------- +!> \file IO_vtu.F90 +!> \brief Contains the module IO_vtu +!----------------------------------------------------------------------- +!> The MODULE IO_vtu create a vtu file, unstructered grid, readable by +!! paraview +! +!> Actually, amatos' structure denies a unified handling for +!! 2d, 3d and spherical case. Therefore the corresponding definition +!! has to be uncommented +!----------------------------------------------------------------------- + +!#define VTU_OUTPUT2D +!#define VTU_OUTPUT3D +#define VTU_OUTPUTSPH + +MODULE IO_vtu + +USE GRID_api + +PUBLIC :: plot_vtu, t_vtu_data + +#if defined VTU_OUTPUT2D || defined VTU_OUTPUTSPH + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodespercell = GRID_elementnodes + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodesperface = GRID_edgenodes + + ! This defines a triangle in VTK format + INTEGER(KIND=GRID_SI), PARAMETER :: i_vtucelltype = 5 +#elif defined VTU_OUTPUT3D + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodespercell = GRID_tetranodes + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodesperface = GRID_elementnodes + + ! This defines a tetrahedron in VTK format + INTEGER(KIND=GRID_SI), PARAMETER :: i_vtucelltype = 10 +#endif + + +!> Structure for variable information +TYPE t_vtu_data + CHARACTER(LEN=32) :: c_name !< VTU variable name + INTEGER(KIND=GRID_SI) :: i_size !< data dimension + REAL(KIND=GRID_SR),POINTER, DIMENSION(:,:) :: p_vdata !< pointer to data +END TYPE t_vtu_data + +!> Very small values can cause errors when read in paraview. +!! This is the threshold for filtering. +REAL(KIND = GRID_SR), PARAMETER :: r_vtueps = 1e-12 +CONTAINS + +!--------------------------------------------------------------------- +!> \brief Writes a VTU file +!> Use this routine to plot continuous or discontinuous data. +!> \param[in] p_mesh The mesh +!> \param[in] c_filename The name of the file to write to +!> \param[in] i_nodedata Size of the array p_nodedata +!> \param[in] p_nodedata Array of type t_vtu_data for node +!! data. For each node one entry has to exist in +!! p_vdata. +!> \param[in] i_celldata Size of the array p_celldata +!> \param[in] p_nodedata Array of type t_vtu_data for cell +!! data. For each tetrahedron one entry has to +!! exist in p_vdata. +#ifdef VTU_OUTPUT2D +!> \param[in] r_zcoordinate The z-coordinate values +!> \param[in] i_zcoordinate Use the i_zcoordinate component of p_nodedata +!! also as z-coordinate +#endif +!> \param[in] l_continuous Write continuous node data. +!! This needs less space than discontinuous. +!! default: .true. +!> \param[in] l_grid_info Write grid numbering information +!! default: .false. +!--------------------------------------------------------------------- +SUBROUTINE plot_vtu(p_mesh, c_filename, & + i_nodedata, p_nodedata, i_celldata, p_celldata, & +#ifdef VTU_OUTPUT2D + r_zcoordinate, i_zcoordinate, & +#endif + l_continuous, l_grid_info) + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_mesh + CHARACTER (len=*), INTENT(IN) :: c_filename + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_nodedata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_nodedata + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_celldata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_celldata +#ifdef VTU_OUTPUT2D + REAL(KIND=GRID_SR), POINTER, DIMENSION(:,:), OPTIONAL & + :: r_zcoordinate + INTEGER(KIND=GRID_SI), OPTIONAL, INTENT(IN) :: i_zcoordinate +#endif + + LOGICAL, INTENT(IN), OPTIONAL :: l_grid_info + LOGICAL, INTENT(IN), OPTIONAL :: l_continuous + + INTEGER( KIND = GRID_SI) :: i_alct + INTEGER( KIND = GRID_SI) :: i_cnt + INTEGER( KIND = GRID_SI) :: i_fst + INTEGER( KIND = GRID_SI) :: i_ncnt + INTEGER( KIND = GRID_SI), PARAMETER :: i_fhandle = 89 + + ! this variables result from different naming conventions in two and + ! three dimensions + INTEGER( KIND = GRID_SI) :: i_numberofcells + INTEGER( KIND = GRID_SI) :: i_numberoffaces + INTEGER( KIND = GRID_SI) :: i_numberofpoints + + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_cellnodes + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE :: i_nodes + + LOGICAL :: l_write_grid_info + LOGICAL :: l_continuous_data + + +#ifdef VTU_OUTPUT2D + IF(PRESENT(i_zcoordinate) .AND. PRESENT(r_zcoordinate)) THEN + CALL GRID_error(c_error='[plot_vtu] z-coordinate is defined twice') + END IF +#endif + + ! set the value of l_continuous. The default is .true. + IF(PRESENT(l_continuous)) THEN + l_continuous_data = l_continuous + ELSE + l_continuous_data = .TRUE. + END IF + + ! set the value of l_grid_info. The default is .false.. + IF(PRESENT(l_grid_info)) THEN + l_write_grid_info = l_grid_info + ELSE + l_write_grid_info = .FALSE. + END IF + + ! Set dimension depending types +#if defined VTU_OUTPUT2D || defined VTU_OUTPUTSPH + i_numberofcells = p_mesh%i_enumfine + i_numberoffaces = p_mesh%i_gnumfine +#elif defined VTU_OUTPUT3D + i_numberofcells = p_mesh%i_tnumfine + i_numberoffaces = p_mesh%i_enumfine +#endif + + IF(l_continuous_data) THEN + i_numberofpoints = p_mesh%i_nnumber + ELSE + i_numberofpoints = i_numberofcells * i_nodespercell + END IF + + ! We only need the node coordinates and the nodes per tetra + ! as additional information. + ALLOCATE(r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_cellnodes(i_nodespercell, i_numberofcells), & + stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate data arrays') + END IF + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & +#if defined VTU_OUTPUT2D || defined VTU_OUTPUTSPH + i_elementnodes = i_cellnodes) +#elif defined VTU_OUTPUT3D + i_tetranodes = i_cellnodes) +#endif + + ! open the file and write header information + OPEN(i_fhandle, file = c_filename, iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + + WRITE(i_fhandle, "(A)") '<?xml version="1.0"?>' + WRITE(i_fhandle, "(A)") '<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">' + WRITE(i_fhandle, *) '<UnstructuredGrid>' + WRITE(i_fhandle, "(A,I8,A,I8,A)") '<Piece NumberOfPoints="', & + i_numberofpoints, & + '" NumberOfCells="', & + i_numberofcells, & + '">' + + ! write the node coordinates to VTU file + WRITE(i_fhandle, *) '<Points>' + WRITE(i_fhandle, "(A,I1,A)") '<DataArray type="Float32" NumberOfComponents="', & + 3, '" format="ascii">' + + ! Distunguish between continuous and discontinuous case + IF(l_continuous_data) THEN + !> The continuous case is represented by amatos' grid topology. + DO i_cnt = 1, p_mesh%i_nnumber +#if defined VTU_OUTPUT3D || defined VTU_OUTPUTSPH + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt) +#elif defined VTU_OUTPUT2D + IF(PRESENT(r_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), r_zcoordinate(1, i_cnt) + ELSE IF(PRESENT(i_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), & + p_nodedata(i_zcoordinate)%p_vdata(1, i_cnt) + ELSE + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), 0.0 + END IF +#endif + END DO + + ELSE + ! Write the node coordinates. In this discontinuous case one node in + ! paraview belongs only to one cell. + DO i_cnt = 1, i_numberofcells + DO i_ncnt = 1, i_nodespercell +#if defined VTU_OUTPUT2D || defined VTU_OUTPUTSPH + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)) +#elif defined VTU_OUTPUT2D + IF(PRESENT(r_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), & + r_zcoordinate(1, i_cellnodes(i_ncnt, i_cnt)) + ELSE IF(PRESENT(i_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), & + p_nodedata(i_zcoordinate)%p_vdata(1, i_cellnodes(i_ncnt, i_cnt)) + ELSE + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), 0.0 + END IF +#endif + END DO + END DO + END IF + + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Points>' + + ! Write the node connectivity + WRITE(i_fhandle, *) '<Cells>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="connectivity" format="ascii">' + + ! check wether continuous data is written + IF(l_continuous_data) THEN + ! The indexing in paraview starts with 0. Therefore we subtract one from + ! the node connectivity information. +#if defined VTU_OUTPUT2D || defined VTU_OUTPUTSPH + DO i_cnt = 1, p_mesh%i_enumfine +#elif defined VTU_OUTPUT3D + DO i_cnt = 1, p_mesh%i_tnumfine +#endif + WRITE(i_fhandle, *) i_cellnodes(:, i_cnt) - 1 + END DO + ELSE + ! Write element nodes (indexing starts by 0!) + ! In the discontinuous case each tetrahedron has its own nodes + ALLOCATE(i_nodes(i_nodespercell), stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate node array for VTU output') + END IF + + DO i_cnt = 1, i_numberofcells * i_nodespercell, i_nodespercell + + DO i_ncnt = 1, i_nodespercell + i_nodes(i_ncnt) = i_ncnt + i_cnt - 2 + END DO + + WRITE(i_fhandle, *) i_nodes + END DO + + DEALLOCATE(i_nodes) + END IF + + WRITE(i_fhandle, *) '</DataArray>' + + ! write the cell type. Tetrahedra are represented by 10 and triangles by 5 + WRITE(i_fhandle, *) '<DataArray type="UInt8" Name="types" format="ascii">' + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_vtucelltype + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="offsets" format="ascii">' + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_cnt * i_nodespercell + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Cells>' + + ! Write the point data / node data + ! If the grid information is requested save the node numbering of amatos. + ! Since every node number in paraview is decreased by one, this option is + ! in continuous plotting not too useful. + WRITE(i_fhandle, *) '<PointData>' + + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Nodenumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + ! When variables for the node data are present, save them. + IF(PRESENT(i_nodedata) .AND. PRESENT(p_nodedata)) THEN + DO i_cnt = 1, i_nodedata + CALL write_vtu_data(i_fhandle, p_nodedata(i_cnt)) + END DO + END IF + + WRITE(i_fhandle, *) '</PointData>' + + + + ! write the cell data. + WRITE(i_fhandle, *) '<CellData>' + + ! Write the element numbers when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Elementnumber" format="ascii">' + + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + ! Write the variable belonging to the tetradra. + IF(PRESENT(i_celldata) .AND. PRESENT(p_celldata)) THEN + DO i_cnt = 1, i_celldata + CALL write_vtu_data(i_fhandle, p_celldata(i_cnt)) + END DO + END IF + + ! write the end of cell data and the footer. + WRITE(i_fhandle, *) '</CellData>' + WRITE(i_fhandle, *) '</Piece>' + WRITE(i_fhandle, *) '</UnstructuredGrid>' + WRITE(i_fhandle, *) '</VTKFile>' + + ! tidy up + CLOSE(i_fhandle) + DEALLOCATE(r_nodecoor, i_cellnodes) +END SUBROUTINE plot_vtu + + +#ifdef VTU_OUTPUT3D +!--------------------------------------------------------------------- +!> Use this routine to plot the mesh consisting of face and +!! continuous data on it. +!> \param p_mesh - the mesh +!> \param c_filename - the name of the file to write to +!> \param i_nodedata - (optional) size of the array p_nodedata +!> \param p_nodedata - (optional) array of type t_vtu_data for node +!! data. For each node one entry has to exist in +!! p_vdata. +!> \param i_celldata - (optional) size of the array p_celldata +!> \param p_nodedata - (optional) array of type t_vtu_data for cell +!! data. For each face one entry has to +!! exist in p_vdata. +!> \param l_grid_info - (optional) Write grid numbering information +!! default: .false. +!--------------------------------------------------------------------- +SUBROUTINE plot_vtu_elements(p_mesh, c_filename, i_nodedata, & + p_nodedata, i_celldata, p_celldata, & + l_grid_info) + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_mesh + CHARACTER (len=*), INTENT(IN) :: c_filename + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_nodedata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_nodedata + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_celldata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_celldata + + LOGICAL, INTENT(IN), OPTIONAL :: l_grid_info + + LOGICAL :: l_write_grid_info + + INTEGER( KIND = GRID_SI) :: i_alct, i_cnt, i_fst + INTEGER( KIND = GRID_SI) :: i_fhandle = 89 + + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + + !> set the optional data + IF(PRESENT(l_grid_info)) THEN + l_write_grid_info = l_grid_info + ELSE + l_write_grid_info = .FALSE. + END IF + + ALLOCATE(r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine), & + stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate data arrays') + END IF + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_elementnodes = i_enodes) + + + OPEN(i_fhandle, file = c_filename, iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + + !> Write the VTK header + WRITE(i_fhandle, "(A)") '<?xml version="1.0"?>' + WRITE(i_fhandle, "(A)") '<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">' + WRITE(i_fhandle, *) '<UnstructuredGrid>' + WRITE(i_fhandle, "(A,I8,A,I8,A)") '<Piece NumberOfPoints="', & + p_mesh%i_nnumber, & + '" NumberOfCells="', & + p_mesh%i_enumfine, & + '">' + + !> Save the coordinates of all nodes + WRITE(i_fhandle, *) '<Points>' + WRITE(i_fhandle, "(A,I1,A)") '<DataArray type="Float32" NumberOfComponents="', & + 3 , '" format="ascii">' + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt) + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Points>' + + !> Write the cell (element) information + WRITE(i_fhandle, *) '<Cells>' + + !> Save the node connectivity + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="connectivity" format="ascii">' + + + !> write element nodes. Write connectivity (indexing starts by 0!) + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_enodes(:, i_cnt) - 1 + END DO + WRITE(i_fhandle, *) '</DataArray>' + + !> Write the cell type (triangle = 5, tetrahedron = 10). + WRITE(i_fhandle, *) '<DataArray type="UInt8" Name="types" format="ascii">' + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) '5' + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="offsets" format="ascii">' + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_cnt * GRID_elementnodes + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Cells>' + + !> write point data + WRITE(i_fhandle, *) '<PointData>' + + !> Save the node numbers, when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Nodenumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + !> Write the nodal variables, when present. + IF(PRESENT(i_nodedata) .AND. PRESENT(p_nodedata)) THEN + DO i_cnt = 1, i_nodedata + CALL write_vtu_data(i_fhandle, p_nodedata(i_cnt)) + END DO + END IF + + WRITE(i_fhandle, *) '</PointData>' + + + + !> write cell data + WRITE(i_fhandle, *) '<CellData>' + + !> save the element numbers, when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Elementnumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + !> Write the cell variables (when present) + IF(PRESENT(i_celldata) .AND. PRESENT(p_celldata)) THEN + DO i_cnt = 1, i_celldata + CALL write_vtu_data(i_fhandle, p_celldata(i_cnt)) + END DO + END IF + + !> write the footer. + WRITE(i_fhandle, *) '</CellData>' + WRITE(i_fhandle, *) '</Piece>' + WRITE(i_fhandle, *) '</UnstructuredGrid>' + WRITE(i_fhandle, *) '</VTKFile>' + + !> finally close the file and deallocate the data + CLOSE(i_fhandle) + DEALLOCATE(r_nodecoor, i_enodes) +END SUBROUTINE plot_vtu_elements +#endif !----3D output only + +!--------------------------------------------------------------------- +!> write_vtu_data writes a single variable (node or cell) to the +!! VTK file. +!> \param i_fhandle - the file handle +!> \param p_data - the variable +!--------------------------------------------------------------------- +SUBROUTINE write_vtu_data(i_fhandle, p_data) + IMPLICIT NONE + + INTEGER(KIND=GRID_SI), INTENT(IN) :: i_fhandle + TYPE(t_vtu_data) :: p_data + INTEGER(KIND=GRID_SI) :: i_size + INTEGER(KIND=GRID_SI) :: i_cnt + INTEGER(KIND=GRID_SI) :: i_cnt2 + + !> Special treatment for vector valued data + IF(p_data%i_size > 1) THEN + WRITE(i_fhandle, "(A,A,A,I1, A)") & + '<DataArray type="Float32" Name="', & + TRIM(p_data%c_name), '" NumberOfComponents="', & + p_data%i_size, '" format="ascii">' + ELSE + WRITE(i_fhandle, "(A,A,A)") '<DataArray type="Float32" Name="', & + TRIM(p_data%c_name), '" format="ascii">' + END IF + i_size = SIZE(p_data%p_vdata, 2) + + !> Write the data to file with respect to the threshold value + DO i_cnt = 1, i_size + DO i_cnt2 = 1, p_data%i_size + IF(ABS(p_data%p_vdata(i_cnt2, i_cnt)) < r_vtueps) & + p_data%p_vdata(i_cnt2, i_cnt) = 0 + END DO + + WRITE(i_fhandle, "(10e15.7)") p_data%p_vdata(1:p_data%i_size, i_cnt) + END DO + WRITE(i_fhandle, *) '</DataArray>' + +END SUBROUTINE write_vtu_data + +END MODULE IO_vtu diff --git a/flash2d/src/flash-sphere/IO_vtuplot.F90 b/flash2d/src/flash-sphere/IO_vtuplot.F90 new file mode 100644 index 0000000000000000000000000000000000000000..af944249e097afc619690cbc7337f7b32cca8aa3 --- /dev/null +++ b/flash2d/src/flash-sphere/IO_vtuplot.F90 @@ -0,0 +1,166 @@ +!***************************************************************** +! +!> @file IO_vtuplot.F90 +!> @brief includes module IO_vtuplot +! +!***************************************************************** +! +! VERSION(S): +! 1. original version j. behrens 04/2000 +! 2. amatos-1.0 and 2D compliant j. behrens 11/2000 +! 3. adapted to flash2d j. behrens 12/2014 +! +!***************************************************************** +! MODULE DESCRIPTION: +!> prints data in VTU compatible file format +! +MODULE IO_vtuplot + USE FLASH_parameters + USE MISC_outputdata + USE GRID_api + USE IO_vtu + PRIVATE + INTEGER, SAVE :: i_timecounter= 0 + PUBLIC :: generate_vtu + CONTAINS + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE generate_vtu]: +!> @brief creates output in GMV compatible file format +!> +!> @param[in] p_handle grid handle for the linked lists +!> @param[in] i_time time step number +!> @param[in] i_newslevel the time level +!> +!> @note ON OUTPUT: a number of VTU compatible ascii files for each plotted time step +! + SUBROUTINE generate_vtu(p_handle, i_time, i_newslevel) + + IMPLICIT NONE + +!---------- local declarations + + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_time + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_newslevel + INTEGER (KIND = GRID_SI) :: i_alct, i_nnum, i_tnum + INTEGER (KIND = GRID_SI) :: i_nwl, i_elen, i_tcnt + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_val + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_velo + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_sta, r_lvl + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE :: i_ids, i_sta + CHARACTER (len=32) :: c_mfile + CHARACTER (len=26) :: c_tmp + LOGICAL :: l_news + INTEGER, PARAMETER :: i_vallen=5 + INTEGER, DIMENSION(i_vallen) :: i_valind + + TYPE(t_vtu_data), DIMENSION(2) :: celldata + TYPE(t_vtu_data), DIMENSION(4) :: nodedata + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name(1:20)) + write(c_mfile,10101) trim(c_tmp), '_', i_tcnt + c_tmp = adjustl(c_mfile) + write(c_mfile,*) TRIM(c_tmp), '.vtu' + c_mfile= adjustl(c_mfile) + +!---------- handle news level + + IF(present(i_newslevel)) THEN + l_news=.TRUE. + i_nwl= i_newslevel + ELSE + l_news=.FALSE. + END IF + +!---------- the nodes + + i_nnum = p_handle%i_nnumber + +!---------- extract nodal grid data and nodal values + + ALLOCATE(r_val(i_vallen, i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate values array') + END IF + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_phi, GRID_zeta, GRID_tracer/) + CALL grid_getinfo(p_handle, r_nodevalues= r_val, i_arraypoint=i_valind) + +!---------- assign nodal values, but before allocate aux. arrays + + ALLOCATE(r_velo(2,i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate aux. velo arrays') + END IF + +!---------- generate 2D velocity field + + r_velo(1:2,:)= r_val(1:2,:) + + nodedata(1)%c_name = 'velocity' + nodedata(1)%i_size = 2 + nodedata(1)%p_vdata => r_velo + + nodedata(2)%c_name = 'height' + nodedata(2)%i_size = 1 + nodedata(2)%p_vdata => r_val(3:3,:) + + nodedata(3)%c_name = 'vorticity' + nodedata(3)%i_size = 1 + nodedata(3)%p_vdata => r_val(4:4,:) + + nodedata(4)%c_name = 'tracer' + nodedata(4)%i_size = 1 + nodedata(4)%p_vdata => r_val(5:5,:) + +!---------- extract cells grid data + + i_tnum= p_handle%i_enumfine + ALLOCATE(i_ids(i_tnum), i_sta(i_tnum), r_sta(1,i_tnum), r_lvl(1,i_tnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate cell value arrays') + END IF + IF(l_news) THEN + CALL grid_getinfo(p_handle, i_newsdepth= i_nwl, i_elength= i_elen, & + i_elementlevel= i_ids, i_elementstatus= i_sta) + i_tnum= i_elen + ELSE + CALL grid_getinfo(p_handle, i_elementlevel= i_ids, i_elementstatus= i_sta) + END IF + + r_sta(1, :) = REAL(i_sta, GRID_SR) + r_lvl(1, :) = REAL(i_ids, GRID_SR) + + ! Assign all values to driver + celldata(1)%c_name = 'status' + celldata(1)%i_size = 1 + celldata(1)%p_vdata => r_sta + + celldata(2)%c_name = 'level' + celldata(2)%i_size = 1 + celldata(2)%p_vdata => r_lvl + + ! plot the vtu data + CALL plot_vtu(p_handle, c_mfile, i_nodedata = 4, p_nodedata = nodedata, & + i_celldata = 2, p_celldata = celldata) !, i_zcoordinate = 4) + + DEALLOCATE(i_ids, i_sta, r_sta, r_lvl, & + r_val, r_velo) + + RETURN + +!---------- FORMAT + 10101 FORMAT(a19,a1,i6.6) + + END SUBROUTINE generate_vtu + +END MODULE IO_vtuplot diff --git a/flash2d/src/flash-sphere/MISC_outputdata.F90 b/flash2d/src/flash-sphere/MISC_outputdata.F90 new file mode 100644 index 0000000000000000000000000000000000000000..8f924c00adccf4c72f308a55a083d69cc7d80099 --- /dev/null +++ b/flash2d/src/flash-sphere/MISC_outputdata.F90 @@ -0,0 +1,155 @@ +!***************************************************************** +! +!> @file MISC_outputdata.F90 +!> @brief includes module MISC_outputdata +! +!***************************************************************** +! +! VERSION(S): +! +!***************************************************************** +! MODULE DESCRIPTION: +!> This module contains routines for retrieving some additional data +!> for plotting from standard grids (no grid variables required) +! +MODULE MISC_outputdata + + USE GRID_api + + PUBLIC :: data_markededgevector, data_sfcvector + + PRIVATE + + CONTAINS +!***************************************************************** +! DESCRIPTION of [SUBROUTINE ]: +!> @brief short description +!> +!> @param p_mesh +!> @param r_sfc +! + SUBROUTINE DATA_sfcvector(p_mesh, r_sfc) + + IMPLICIT NONE + + TYPE(GRID_handle), INTENT(IN) :: p_mesh + REAL(KIND=GRID_SR), INTENT(OUT), DIMENSION(:,:) :: r_sfc + + REAL(KIND=GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint1 + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint2 + + INTEGER(KIND=GRID_SI) :: i_ecnt, i_ncnt +!- allocate the needed memory + ALLOCATE( r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine)) + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_elementnodes = i_enodes) + +! initialize data + r_midpoint2 = 0_GRID_SR + + DO i_ncnt = 1, GRID_elementnodes + r_midpoint2 = r_midpoint2 + r_nodecoor(:,i_enodes(i_ncnt, 1)) + END DO + + r_midpoint2 = 1_GRID_SR / REAL(GRID_elementnodes, GRID_SR) * r_midpoint2 + + DO i_ecnt = 1, p_mesh%i_enumfine - 1 + r_midpoint1 = r_midpoint2 + + r_midpoint2 = 0_GRID_SR + DO i_ncnt = 1, GRID_elementnodes + r_midpoint2 = r_midpoint2 + r_nodecoor(:,i_enodes(i_ncnt, i_ecnt+1)) + END DO + + r_midpoint2 = 1_GRID_SR / REAL(GRID_elementnodes, GRID_SR) * r_midpoint2 + + r_sfc(1:GRID_dimension, i_ecnt)=r_midpoint2 - r_midpoint1 + + r_sfc((GRID_dimension+1), i_ecnt) = 0.0 + + END DO + + r_sfc(:, p_mesh%i_enumfine) = 0_GRID_SR + + DEALLOCATE( r_nodecoor, i_enodes ) + END SUBROUTINE DATA_sfcvector + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE ]: +!> @brief short description +!> +!> @param p_mesh +!> @param r_mvec +! + SUBROUTINE DATA_markededgevector(p_mesh, r_mvec) + + IMPLICIT NONE + + TYPE(GRID_handle), INTENT(IN) :: p_mesh + REAL(KIND=GRID_SR), INTENT(OUT), DIMENSION(:, :) :: r_mvec + + REAL(KIND=GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_gnodes + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + INTEGER(KIND=GRID_SI), DIMENSION(:), ALLOCATABLE :: i_emark + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_eedges + + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_egpoint + + INTEGER(KIND=GRID_SI) :: i_ncnt, i_ecnt + INTEGER(KIND=GRID_SI) :: i_markededge + +!- allocate the needed memory + ALLOCATE( r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_gnodes(GRID_edgenodes, p_mesh%i_gnumfine), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine), & + i_emark(p_mesh%i_enumfine), & + i_eedges(GRID_elementedges, p_mesh%i_enumfine)) + +!- get the needed information from mesh + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_edgenodes = i_gnodes, & + i_elementnodes = i_enodes, & + i_elementmark = i_emark, & + i_elementedges = i_eedges, & + l_finelevel = .TRUE.) + + DO i_ecnt = 1, p_mesh%i_enumfine + r_midpoint = 0_GRID_SR + + DO i_ncnt = 1, GRID_elementnodes + r_midpoint = r_midpoint + r_nodecoor(:,i_enodes(i_ncnt, i_ecnt)) + END DO + + r_midpoint = 1._GRID_SR/REAL(GRID_elementnodes, GRID_SR) * r_midpoint + + i_markededge = i_eedges(i_emark(i_ecnt), i_ecnt) + + r_egpoint = 0_GRID_SR + DO i_ncnt = 1, GRID_edgenodes + r_egpoint = r_egpoint + r_nodecoor(:,i_gnodes(i_ncnt, i_markededge)) + END DO + + r_egpoint = 1._GRID_SR/REAL(GRID_edgenodes, GRID_SR) * r_egpoint + + r_mvec(1:GRID_dimension, i_ecnt) = r_egpoint - r_midpoint + r_mvec((GRID_dimension+1), i_ecnt) = 0.0 + END DO + +!- deallocate + DEALLOCATE( r_nodecoor, & + i_gnodes, & + i_enodes, & + i_emark, & + i_eedges) + + END SUBROUTINE DATA_markededgevector + +!***************************************************************** +END MODULE MISC_outputdata diff --git a/flash2d/src/flash-sphere/README b/flash2d/src/flash-sphere/README new file mode 100644 index 0000000000000000000000000000000000000000..2990304b681fe9493d5d31c52e238b0eca957b09 --- /dev/null +++ b/flash2d/src/flash-sphere/README @@ -0,0 +1,48 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/lib" + +ADV_rhs.f - Module for calculating Right Hand Side +ADV_rhs.gerrit - Module for Right Hand Side (Aerosol Exper.) +ADV_rhs.hom - Module for Right Hand Side (homogeneous RHS) +ADV_semilagrange.dual - Module for SLM with dual grid approach +ADV_semilagrange.f - Module for SLM +ADV_wind.bar - Module for wind field (shear stress example) +ADV_wind.constant - Module for wind field (constant wind for Slotted Cyl.) +ADV_wind.f - Module for wind field +ADV_wind.file - Module for wind field (read wind field from file) +Flash90.f - Main program +gridgen - directory for the grid generator +IO_plot.f - Module for the plotting routines +IO_plotdefine.f - Module for definitions in plotting routines +IO_utils.f - Module for IO utility routines +MISC_globalparam.f - Module for global parameter definitions +MISC_timing.f - Module for the timing routines +README - this file +SLM_errorestimate.f - Module for the error estimation calculation +SLM_initial.bar - Module for the initial values (shear stress example) +SLM_initial.f - Module for the initial values +SLM_initial.file - Module for the initial values (read from file) +SLM_initial.gerrit - Module for the initial values (Aerosol Exper.) +SLM_initial.slot - Module for the initial values (Slotted Cyl.) +SLM_interpolation.clip - Module for SLM interpolation (clipping) +SLM_interpolation.cons - Module for SLM interpolation (quasi conservative) +SLM_interpolation.f - Module for SLM interpolation +SLM_interpolation.plain - Module for SLM interpolation (plain bicubic) +system - directory for system dependent routines +utils - directory for utility programs + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +just look around, find better ways... + +************************************************************************** + j. behrens, 8/98 +************************************************************************** diff --git a/flash2d/src/flash-sphere/SLM_advanced.f90 b/flash2d/src/flash-sphere/SLM_advanced.f90 new file mode 100644 index 0000000000000000000000000000000000000000..140723efac0ff4c1781a3d22a166a94f4292c60b --- /dev/null +++ b/flash2d/src/flash-sphere/SLM_advanced.f90 @@ -0,0 +1,423 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc, r_sxy + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_coord(:,i_cnt1),r_sxy) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + FUNCTION sphere_correct(r_coord, r_displ) RESULT (r_corct) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord, r_displ + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_corct + + REAL (KIND = GRID_SR) :: r_e, r_rat + REAL (KIND = GRID_SR) :: r_c + +!---------- calculate Euklidean norm + + r_e = eukl_norm(r_displ) + r_rat= r_e/ GRID_RADIUS + +!---------- calculate correction + + r_c = tan(r_rat)/r_rat + r_corct= r_displ* r_c + + RETURN + END FUNCTION sphere_correct + +!***************************************************************** + FUNCTION eukl_norm(r_vec) RESULT(r_rst) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vec + REAL (KIND = GRID_SR) :: r_rst, r_tmp + +!---------- calculate vector crossproduct, 3D only + + r_tmp= dot_product(r_vec, r_vec) + r_rst= sqrt(r_tmp) + + END FUNCTION eukl_norm + + END MODULE SLM_advanced diff --git a/flash2d/src/flash-sphere/SLM_errorestimate.f90 b/flash2d/src/flash-sphere/SLM_errorestimate.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a29f62eb38454f08a32521736cbf1bb1faeec24d --- /dev/null +++ b/flash2d/src/flash-sphere/SLM_errorestimate.f90 @@ -0,0 +1,144 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_errorestimate +! FUNCTION: +! provide an error estimator for the adaptive SLM scheme +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_error +! FUNCTION: +! estimate the error elementwise +! SYNTAX: +! real= slm_error(real.arr) +! ON INPUT: +! r_v: values at element nodes REAL +! ON OUTPUT: +! r_esterr: estimated error REAL +! CALLS: +! +! COMMENTS: +! this is only a simple estimator based on local gradients +!----------------------------------------------------------------- +! +! NAME: +! slm_errorest +! FUNCTION: +! this hides the loop structure from the advection part +! SYNTAX: +! CALL slm_errorest(grid, int, real.arr) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! i_siz: size of array for local errors INTEGER +! ON OUTPUT: +! i_siz: size of array for local errors INTEGER +! r_arr: estimated error REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_errorest +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 11/96 +! 2. nodal values time depend. j. behrens 1/97 +! 3. FEM_handle added j. behrens 7/97 +! 4. version with hashing j. behrens 7/97 +! 5. changed to use GRID_api j. behrens 11/97 +! 6. compliant to amatos 1.0 j. behrens 12/2000 +! 7. compliant to amatos 1.2 j. behrens 3/2002 +! 8. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_errorestimate + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_errorest + CONTAINS +!***************************************************************** + FUNCTION slm_error(r_v) RESULT (r_esterr) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_v + REAL (KIND = GRID_SR) :: r_esterr + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1.0/3.0) + REAL (KIND = GRID_SR) :: r_d1, r_d2, r_d3 + +!---------- calculate differences + + r_d1 = abs(r_v(1)- r_v(2)) + r_d2 = abs(r_v(2)- r_v(3)) + r_d3 = abs(r_v(3)- r_v(1)) + +!---------- this is the estimated error + + r_esterr= (r_d1+ r_d2+ r_d3)* r_1o3 + + RETURN + END FUNCTION slm_error + +!***************************************************************** + SUBROUTINE slm_errorest(p_ghand, i_siz, r_arr) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER, INTENT(in) :: i_siz + REAL (KIND = GRID_SR), DIMENSION(:), INTENT(out) :: r_arr + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enods + INTEGER :: i_cnt, i_size, i_alct, i_nnum + INTEGER, DIMENSION(1) :: i_valind + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_tmp + +!---------- allocate auxilliary array + + i_size= p_ghand%i_enumfine + i_nnum= p_ghand%i_nnumber + IF(i_siz /= i_size) THEN + CALL grid_error(48) + END IF + + ALLOCATE(r_aux(1,i_nnum), & + i_enods(GRID_elementnodes,i_size), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(49) + END IF + +!---------- get values + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_arraypoint=i_valind, & + r_nodevalues= r_aux, i_elementnodes=i_enods) + +!---------- loop through all elements of finest loop + + elmt_loop: DO i_cnt=1,i_siz + r_tmp(1:GRID_elementnodes)= r_aux(1,i_enods(1:GRID_elementnodes,i_cnt)) + r_arr(i_cnt)= slm_error(r_tmp) + END DO elmt_loop + +!---------- deallocate and exit + + DEALLOCATE(r_aux, i_enods) + + RETURN + END SUBROUTINE slm_errorest + + END MODULE SLM_errorestimate diff --git a/flash2d/src/flash-sphere/SLM_initial.f90 b/flash2d/src/flash-sphere/SLM_initial.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2814fa43ef832c6a85c06d312f6d2653dd1aaf55 --- /dev/null +++ b/flash2d/src/flash-sphere/SLM_initial.f90 @@ -0,0 +1,337 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution +! REAL, DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) +! REAL :: r_hgt=4.0 +! REAL :: r_srd=0.15 +! REAL :: r_sln=0.22 +! REAL :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initcoshill(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + +!---------- calculate center ! CAUTION: THIS IS NOT IMPLEMENTED YET !!! + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- check array length + + IF(i_arlen < i_num) THEN + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,*) '[slm_analyticsolution]: Array sizes did not match, adjusting to the smaller size!' + END IF + i_num= i_arlen + END IF + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initcoshill(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER (KIND = GRID_SI), DIMENSION(1) :: i_valind + +!---------- get center + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcoshill + +!***************************************************************** + FUNCTION coshill(r_coor, r_centr) RESULT (r_hill) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_hill + REAL (KIND = GRID_SR) :: r_maxheight=1.0 + REAL (KIND = GRID_SR) :: r_maxrad + REAL (KIND = GRID_SR) :: r_dist, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_xy + +!---------- initialize r_hill + + r_maxrad= GRID_RADIUS/ 6.0 + r_hill= 0.0 + +!---------- calculate distance to center + + r_xy= r_centr- r_coor + r_dist= DOT_PRODUCT(r_xy,r_xy) + +!---------- calculate inner values + + IF(r_dist < r_maxrad) THEN + r_tmp = (GRID_PI* r_dist)/r_maxrad + r_hill= r_maxheight *(1.0+ cos(r_tmp)) + END IF + + RETURN + END FUNCTION coshill + +!***************************************************************** + + END MODULE SLM_initial + + + + diff --git a/flash2d/src/flash-sphere/SLM_simple.f90 b/flash2d/src/flash-sphere/SLM_simple.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f0bb380c84ac5e2fb9f92cfeb43df6d0e3fd5007 --- /dev/null +++ b/flash2d/src/flash-sphere/SLM_simple.f90 @@ -0,0 +1,424 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide simple semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS + +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc, r_sxy + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5* p_param%num%r_deltatime + r_dt2= 1.5* p_param%num%r_deltatime + r_fac= 0.5 + r_caf= 2.0 + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0 + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_coord(:,i_cnt1),r_sxy) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0 + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0 + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + +!***************************************************************** + FUNCTION sphere_correct(r_coord, r_displ) RESULT (r_corct) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord, r_displ + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_corct + + REAL (KIND = GRID_SR) :: r_e, r_rat + REAL (KIND = GRID_SR) :: r_c + +!---------- calculate Euklidean norm + + r_e = eukl_norm(r_displ) + r_rat= r_e/ GRID_RADIUS + +!---------- calculate correction + + r_c = tan(r_rat)/r_rat + r_corct= r_displ* r_c + + RETURN + END FUNCTION sphere_correct + +!***************************************************************** + FUNCTION eukl_norm(r_vec) RESULT(r_rst) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vec + REAL (KIND = GRID_SR) :: r_rst, r_tmp + +!---------- calculate vector crossproduct, 3D only + + r_tmp= dot_product(r_vec, r_vec) + r_rst= sqrt(r_tmp) + + END FUNCTION eukl_norm + + END MODULE SLM_simple diff --git a/flash2d/src/flash/ADV_rhs.f90 b/flash2d/src/flash/ADV_rhs.f90 new file mode 100644 index 0000000000000000000000000000000000000000..546b4cd9e0a79628da4db651ecb8fc404b0bf077 --- /dev/null +++ b/flash2d/src/flash/ADV_rhs.f90 @@ -0,0 +1,76 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_rhs +! FUNCTION: +! calculate the (nonhomogeneous) right hand side +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_righthand +! FUNCTION: +! calculate the rhs of the advection equation +! SYNTAX: +! real= slm_righthand(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_rhs: right hand side value real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! this is the homogeneous case! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 2/98 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_rhs + USE GRID_api + PRIVATE + PUBLIC :: slm_righthand + CONTAINS +!***************************************************************** + FUNCTION slm_righthand(r_coord, r_time) RESULT (r_rhs) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR) :: r_rhs + REAL (KIND = GRID_SR) :: r_tim + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_rhs= 0.0 + + RETURN + END FUNCTION slm_righthand + +!***************************************************************** + END MODULE ADV_rhs diff --git a/flash2d/src/flash/ADV_semilagrange.F90 b/flash2d/src/flash/ADV_semilagrange.F90 new file mode 100644 index 0000000000000000000000000000000000000000..eaf4620832280ed441407dd4d9be110d2c97e414 --- /dev/null +++ b/flash2d/src/flash/ADV_semilagrange.F90 @@ -0,0 +1,850 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/flash/ADV_wind.f90 b/flash2d/src/flash/ADV_wind.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3da9ab1fa82a4d78dcaea0958647db25b383ad6c --- /dev/null +++ b/flash2d/src/flash/ADV_wind.f90 @@ -0,0 +1,107 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_dis + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_dif + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate distance from center (0,0) + + r_dif= (/0.5,0.5/)- abs(r_coord) + r_dis= dot_product(r_dif, r_dif)* 4. + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_field(1)= r_coord(2)* r_dis* r_fac + r_field(2)= -r_coord(1)* r_dis* r_fac + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/flash/FLASH_metadata.f90 b/flash2d/src/flash/FLASH_metadata.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1a01a382be10817a255717eb23b2fb5261eaae0a --- /dev/null +++ b/flash2d/src/flash/FLASH_metadata.f90 @@ -0,0 +1,63 @@ +!******************************************************************************* +! +!> @file FLASH_metadata.f90 +!> @brief contains metadata definitions for FLASH_parameters +! +!******************************************************************************* +! MODULE DESCRIPTION: +!> @brief This is a meta data structure that contains info for the +!> FLASH_parameters physical parameters, related to different +!> Test cases. +!> @author J. Behrens +!> @version 1.0 +!> @date 5/2016 +!***************************************************************** + MODULE FLASH_metadata + + IMPLICIT NONE + +!---------- character length for comparison + + INTEGER, PARAMETER :: i_comparlen=12 + +!---------- meta data for logical parameters + + LOGICAL, PARAMETER :: l_logused= .FALSE. + INTEGER, PARAMETER :: i_lognum=1 + CHARACTER (len=i_comparlen), DIMENSION(i_lognum) :: c_logkeywds= & + (/ ' ' /) + +!---------- meta data for integer parameters + + LOGICAL, PARAMETER :: l_intused= .FALSE. + INTEGER, PARAMETER :: i_intnum=1 + INTEGER, DIMENSION(i_intnum) :: i_intsizes= (/ 0 /) + CHARACTER (len=i_comparlen), DIMENSION(i_intnum) :: c_intkeywds= & + (/ ' ' /) + +!---------- meta data for character parameters + + LOGICAL, PARAMETER :: l_charused= .TRUE. + INTEGER, PARAMETER :: i_charnum=1 + INTEGER, PARAMETER :: i_charlength= 64 + CHARACTER (len=i_comparlen), DIMENSION(i_charnum) :: c_charkeywds= & + (/ 'WIND_FILE_NA' /) + +!---------- meta data for real parameters + + LOGICAL, PARAMETER :: l_realused= .TRUE. + INTEGER, PARAMETER :: i_realnum=3 + INTEGER, DIMENSION(i_realnum) :: i_realsizes= (/ 1, 1, 1 /) + CHARACTER (len=i_comparlen), DIMENSION(i_realnum) :: c_realkeywds= & + (/ 'DIFFUSION_CO', & + 'WIND_COEFFIC', & + 'TOTAL_MASS_P' /) + +!---------- convenience pointers + + INTEGER, PARAMETER :: PARAM_DIFFCOEF= 1 + INTEGER, PARAMETER :: PARAM_WINDCOEF= 2 + INTEGER, PARAMETER :: PARAM_TOTALMASS= 3 + INTEGER, PARAMETER :: PARAM_WINDFILE= 1 + + END MODULE FLASH_metadata diff --git a/flash2d/src/flash/FLASH_parameters.f90 b/flash2d/src/flash/FLASH_parameters.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3aa23ca066dc2b7ad3686eb609ca12a6edbb672c --- /dev/null +++ b/flash2d/src/flash/FLASH_parameters.f90 @@ -0,0 +1,112 @@ +!***************************************************************** +! +! MODULE NAME: +! FLASH_parameters +! FUNCTION: +! defines global control structure +! CONTAINS: +! +! PUBLIC: +! all +! COMMENTS: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/2000 +! +!***************************************************************** + MODULE FLASH_parameters + + IMPLICIT NONE + INTEGER, PARAMETER :: io_fillen=128 + INTEGER, PARAMETER :: i_redirout=8 + INTEGER, PARAMETER :: i_redirlog=7 + INTEGER, PARAMETER :: i_comparlen=14 + +!---------- structure for the command line + + TYPE cmdline_param + SEQUENCE + CHARACTER (len=io_fillen) :: c_infile ! input file name + CHARACTER (len=io_fillen) :: c_directory ! input file name + LOGICAL :: l_output ! redirect std output + LOGICAL :: l_logging ! enable logging (verbose) + END TYPE cmdline_param + +!---------- structure for the i/o behaviour + + TYPE io_param + SEQUENCE + LOGICAL :: l_diagnostics ! switch on diagnostics + LOGICAL :: l_vtu ! switch on vtu output + LOGICAL :: l_netcdf ! switch on NetCDF output + INTEGER :: i_plotoffset ! timesteps between plots + INTEGER :: i_saveoffset ! timesteps between savesets + INTEGER :: i_savelast ! indicator for last step saving + CHARACTER (len=io_fillen) :: c_domainfile ! file with definitions for domain + CHARACTER (len=io_fillen) :: c_triangfile ! file with initial triangulation + END TYPE io_param + +!---------- structure for global physical and steering parameters + + TYPE num_param + SEQUENCE + REAL :: r_deltatime ! timestep length [s] + REAL :: r_reftolerance ! tolerance for refinement + REAL :: r_crstolerance ! tolerance for coarsening + REAL :: r_refwatermark ! watermark for refinement + REAL :: r_crswatermark ! watermark for coarsening + REAL :: r_starttime ! first time (overwrites i_frsttimestep) + REAL :: r_finaltime ! last time (overwrites i_lasttimestep) + INTEGER :: i_experiment ! current experiment identification + INTEGER :: i_crslevel ! coarsest requested level + INTEGER :: i_reflevel ! finest requested level + INTEGER :: i_frsttimestep ! first timestep of experiment + INTEGER :: i_lasttimestep ! last timestep of experiment + INTEGER :: i_adviterations ! iterations in trajectory estimation + END TYPE num_param + +!---------- structure for global physical and steering parameters + + TYPE test_param + INTEGER :: i_lognum + INTEGER :: i_intnum + INTEGER :: i_realnum + INTEGER :: i_charnum + INTEGER, DIMENSION(:), POINTER :: i_intsizes + INTEGER, DIMENSION(:), POINTER :: i_realsizes + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_logkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_intkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_realkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_charkeywds + LOGICAL, DIMENSION(:), POINTER :: tst_log + CHARACTER (len=io_fillen), DIMENSION(:), POINTER :: tst_char + INTEGER, DIMENSION(:,:), POINTER :: tst_int + REAL, DIMENSION(:,:), POINTER :: tst_real + END TYPE test_param + +!---------- global control structure + + TYPE control_struct + TYPE (num_param) :: num + TYPE (cmdline_param) :: cmd + TYPE (io_param) :: io + TYPE (test_param) :: tst + END TYPE control_struct + TYPE (control_struct) :: p_contr + +!---------- structure for runtime information + + TYPE rt_info + REAL :: r_modeltime + INTEGER :: i_step + INTEGER :: i_adapit + LOGICAL :: l_saved + LOGICAL :: l_ploted + END TYPE rt_info + TYPE (rt_info) :: p_timestepinfo + + END MODULE FLASH_parameters diff --git a/flash2d/src/flash/Flash90.F90 b/flash2d/src/flash/Flash90.F90 new file mode 100644 index 0000000000000000000000000000000000000000..a493384d87e2ca3165192ac24a3efbcac1024f16 --- /dev/null +++ b/flash2d/src/flash/Flash90.F90 @@ -0,0 +1,106 @@ +!***************************************************************** +! +! PROJECT: +! FLASH90 means +! FLexible Adaptive Semi-Lagrangian Hack +! written in Fortran 90 +! NAME: +! Flash90 +! FUNCTION: +! main program (driver routine for the adaptive SLM) +! SYNTAX: +! flash90 [options] +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +! LIBRARIES: +! USEs several fortran 90 modules +! REFERENCES: +! this is a complete reimplementation of STASL +! VERSION(S): +! 1. original version j. behrens 11/96 +! 2. tidied up a little j. behrens 7/97 +! 3. new control struct j. behrens 12/97 +! 4. compliant to amatos 1.0 j. behrens 12/2000 +! 5. compliant to amatos 1.2 j. behrens 3/2002 +! 6. added visnetplot f. klaschka 12/2003 +! 7. refactured a bit... j. behrens 5/2016 +! +!***************************************************************** + PROGRAM flash90 + +!---------- modules + + USE FLASH_parameters + USE IO_utils + !-- added for visnetplot [flo]: + USE GRID_api + USE ADV_semilagrange + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_dummy + +!---------- set FLASH description in global datastruct + + GRID_parameters%program_name= 'Flash90 ' + GRID_parameters%version= 0 + GRID_parameters%subversion= 9 + GRID_parameters%patchversion= 0 + GRID_parameters%datemonth= 5 + GRID_parameters%dateyear= 2016 + +!---------- read command line options + + CALL io_getcmdline(p_contr) + +!---------- initialize grid generator + + IF(p_contr%cmd%l_output) THEN + IF(p_contr%cmd%l_logging) THEN + CALL grid_initialize(i_output=i_redirout, i_logging=i_redirlog) + ELSE + CALL grid_initialize(i_output=i_redirout) + END IF + ELSE + IF(p_contr%cmd%l_logging) THEN + CALL grid_initialize(i_logging=i_redirlog) + ELSE + CALL grid_initialize + END IF + END IF + +!---------- read parameter input from file + + CALL io_initparams(p_contr) + CALL io_getbatchinput(p_contr) + +!---------- print global parameters + + CALL io_putparameters(p_contr) + +!---------- set up advection starting conditions, initialize grid, etc. + + CALL slm_initialize(p_grid, p_contr) + +!---------- call the (major) routine for timestepping + + CALL slm_timestepping(p_grid, p_contr) + +!---------- terminate the SLM (gracefully free memory, terminate grid, etc.) + + CALL slm_finish(p_grid, p_contr) + +!---------- terminate grid generator + + CALL grid_terminate + + STOP + END PROGRAM flash90 diff --git a/flash2d/src/flash/IO_netcdfplot.f90 b/flash2d/src/flash/IO_netcdfplot.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bbc02c1610e8a534d49a6deafa9aea50ce3ec65f --- /dev/null +++ b/flash2d/src/flash/IO_netcdfplot.f90 @@ -0,0 +1,197 @@ +!******************************************************************************* +! +!> @file IO_netcdfplot.f90 +!> @brief contains module IO_netcdfplot +! +!******************************************************************************* +! +! REFERENCES: +! this module is based on the original implementations in the +! splash/fe project (fortran 77 version), but wildly modified! +! +! VERSION(S): +! 1. original version j. behrens 01/2000 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 03/2002 +! 3. compliant to amatos 2.0 j. behrens 07/2003 +! 4. rewritten to get more data s. vater 05/2012 +! 5. rewritten to use IO_ncugrid module s. vater 03/2014 +! +!******************************************************************************* +! MODULE DESCRIPTION: +!> creates output in NetCDF file format +! +MODULE IO_netcdfplot + USE IO_ncugrid + USE FLASH_parameters + USE GRID_api + + PRIVATE + PUBLIC :: plot_netcdf + + CONTAINS +!******************************************************************************* +! DESCRIPTION of [SUBROUTINE plot_netcdf]: +!> @brief creates output in netcdf file format +!> +!> @param[in] p_ghand grid handle for the linked lists +!> @param[in] i_time time stamp for file naming (opt.) +! + SUBROUTINE plot_netcdf(p_ghand, i_time) + + IMPLICIT NONE + +!---------- local declarations + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER, OPTIONAL, INTENT(in) :: i_time + INTEGER :: i_cnt, & + i_numelmt, i_numnode, i_alct, i_tcnt, i_dimvel, i_unkvel + INTEGER, SAVE :: i_timecount = 0 + CHARACTER (len=32) :: c_file, c_mesh + CHARACTER (len=64) :: c_title, c_tmp + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodexy + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE, TARGET :: r_val, r_aux + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_elmtnodes, i_eltdofs + INTEGER (KIND = GRID_SI), PARAMETER :: i_vallen = 5 + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE, TARGET :: i_eltlev, i_eltsta + INTEGER (KIND = GRID_SI), DIMENSION(i_vallen) :: i_valind + INTEGER (KIND = GRID_SI), DIMENSION(GRID_dimension) :: i_valuv + INTEGER (KIND = GRID_SI) :: i_fetyp + TYPE (ncugrid_vardatatype), DIMENSION(i_vallen+1) :: p_vdataarr + +!---------- check input for optional parameter + + IF(PRESENT(i_time)) THEN + i_tcnt = i_time + ELSE + i_tcnt = i_timecount + END IF + i_timecount = i_timecount + 1 + +!---------- check for FEM types + + i_fetyp = grid_femvarquery(1_GRID_SI) + +!---------- create the title + + WRITE(c_title,*) 'netCDF output from ',TRIM(GRID_parameters%program_name) + c_title = ADJUSTL(c_title) + +!---------- create generic file name + + c_mesh = 'Mesh2' + + WRITE(c_file, '(A, A1, I4.4, A3)') TRIM(GRID_parameters%program_name), '_', i_tcnt, '.nc' + +!---------- get array with node coordinates, and variable values + + i_numnode = p_ghand%i_nnumber + i_numelmt = p_ghand%i_enumfine + i_dimvel = GRID_femtypes%p_type(i_fetyp)%sig%i_unknowns + i_unkvel = p_ghand%i_unknowns(i_fetyp) + + ALLOCATE(r_nodexy(GRID_dimension, i_numnode), & + i_elmtnodes(GRID_elementnodes, i_numelmt), i_eltdofs(i_dimvel, i_numelmt), & + r_val(i_vallen, i_unkvel), r_aux(i_vallen, i_numelmt), & + i_eltlev(i_numelmt), i_eltsta(i_numelmt), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[plot_netcdf]: could not allocate aux. arrays') + + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_phi, GRID_zeta, GRID_tracer/) + + CALL grid_getinfo(p_ghand, l_finelevel=.TRUE., l_relative=.TRUE., & + i_femtype=i_fetyp, i_arraypoint=i_valind, r_nodecoordinates=r_nodexy, & + i_elementnodes=i_elmtnodes, r_dofvalues=r_val, i_elementdofs=i_eltdofs, & + i_elementlevel=i_eltlev, i_elementstatus=i_eltsta) + +!---------- create the file for timestep data + + CALL ncugrid_createmesh(c_file, c_mesh, i_numnode, i_numelmt, & + i_elmtnodes, r_nodexy, c_title, TRIM(GRID_parameters%author_affil2), & + c_contact=TRIM(GRID_parameters%author_email)) + +!---------- define variables (data) + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_v_x' + p_vdataarr(1)%c_varname = TRIM(c_tmp) + p_vdataarr(1)%c_long_name = 'velocity in x-direction' + p_vdataarr(1)%c_standard_name = 'velocity_in_x_direction' ! not CF conform! + p_vdataarr(1)%c_units = 'm/s' + p_vdataarr(1)%c_location = 'node' + p_vdataarr(1)%i_datatype = 1 + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_v_y' + p_vdataarr(2)%c_varname = TRIM(c_tmp) + p_vdataarr(2)%c_long_name = 'velocity in y-direction' + p_vdataarr(2)%c_standard_name = 'velocity_in_y_direction' ! not CF conform! + p_vdataarr(2)%c_units = 'm/s' + p_vdataarr(2)%c_location = 'node' + p_vdataarr(2)%i_datatype = 1 + + WRITE(c_tmp, '(A, A4)') TRIM(c_mesh), '_phi' + p_vdataarr(3)%c_varname = TRIM(c_tmp) + p_vdataarr(3)%c_long_name = 'geopotential height (arbitrary variable)' + p_vdataarr(3)%c_standard_name = 'geopotential_height' ! not CF conform! + p_vdataarr(3)%c_units = 'none' + p_vdataarr(3)%c_location = 'node' + p_vdataarr(3)%i_datatype = 1 + + WRITE(c_tmp, '(A, A5)') TRIM(c_mesh), '_zeta' + p_vdataarr(4)%c_varname = TRIM(c_tmp) + p_vdataarr(4)%c_long_name = 'vorticity (arbitrary variable)' + p_vdataarr(4)%c_standard_name = 'absolute_vorticity' ! not CF conform! + p_vdataarr(4)%c_units = 'none' + p_vdataarr(4)%c_location = 'node' + p_vdataarr(4)%i_datatype = 1 + + WRITE(c_tmp, '(A, A7)') TRIM(c_mesh), '_tracer' + p_vdataarr(5)%c_varname = TRIM(c_tmp) + p_vdataarr(5)%c_long_name = 'tracer density distribution' + p_vdataarr(5)%c_standard_name = 'tracer_density' ! not CF conform! + p_vdataarr(5)%c_units = 'none' + p_vdataarr(5)%c_location = 'node' + p_vdataarr(5)%i_datatype = 1 + + WRITE(c_tmp, '(A, A6)') TRIM(c_mesh), '_level' + p_vdataarr(6)%c_varname = TRIM(c_tmp) + p_vdataarr(6)%c_long_name = 'grid level' + p_vdataarr(6)%c_standard_name = 'grid_level' ! not CF conform! + p_vdataarr(6)%c_units = 'none' + p_vdataarr(6)%c_location = 'face' + p_vdataarr(6)%i_datatype = 0 +! +!!---------- average over each cell and write into netCDF file +! +! DO i_cnt=1,i_numelmt +! r_aux(1, i_cnt) = SUM(r_val(1, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(2, i_cnt) = SUM(r_val(2, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(3, i_cnt) = SUM(r_val(3, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! r_aux(4, i_cnt) = SUM(r_val(4, i_eltdofs(:, i_cnt))) / REAL(i_dimvel, GRID_SR) +! END DO + +!---------- write the nodal grid data + + p_vdataarr(1)%p_rvardata => r_val(1,:) + p_vdataarr(2)%p_rvardata => r_val(2,:) + p_vdataarr(3)%p_rvardata => r_val(3,:) + p_vdataarr(4)%p_rvardata => r_val(4,:) + p_vdataarr(5)%p_rvardata => r_val(5,:) + p_vdataarr(6)%p_ivardata => i_eltlev + +!--- write variables + + CALL ncugrid_putvariablearray(c_file, c_mesh, p_vdataarr, REAL(i_tcnt, GRID_SR)) + +!--- deallocate data arrays + + DO i_cnt=1,SIZE(p_vdataarr) + NULLIFY(p_vdataarr(i_cnt)%p_ivardata) + NULLIFY(p_vdataarr(i_cnt)%p_rvardata) + END DO + DEALLOCATE(r_nodexy, i_elmtnodes, r_val, r_aux, i_eltdofs, & + i_eltlev, i_eltsta) + + END SUBROUTINE plot_netcdf + +!******************************************************************************* +END MODULE IO_netcdfplot diff --git a/flash2d/src/flash/IO_utils.f90 b/flash2d/src/flash/IO_utils.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e783a65afb6ce87f99e93d97dcc5ddd936c86c8f --- /dev/null +++ b/flash2d/src/flash/IO_utils.f90 @@ -0,0 +1,915 @@ +!***************************************************************** +! +! MODULE NAME: +! IO_utils +! FUNCTION: +! input/output routines (io_get...something, io_put...something) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! io_getcmdline +! FUNCTION: +! read options from command line +! SYNTAX: +! call io_getcmdline(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_getinterinput +! FUNCTION: +! get user input interactively +! SYNTAX: +! call io_getinterinput(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_getbatchinput +! FUNCTION: +! read user input from file +! SYNTAX: +! call io_getbatchinput(param) +! ON INPUT: +! +! ON OUTPUT: +! p_param: control parameters TYPE(control_struct) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putparameters +! FUNCTION: +! write out parameters in a nice way +! SYNTAX: +! call io_putparameters(param) +! ON INPUT: +! p_param: data structure containing parameters TYPE(control_struct) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putruntimeinfo +! FUNCTION: +! print some information on the current run time status +! SYNTAX: +! call io_putruntimeinfo(grid, info) +! ON INPUT: +! p_ghand: grid handle for no. of elements... TYPE(grid_handle) +! p_info: structure containing other info TYPE(rt_info) +! ON OUTPUT: +! p_info: structure reseted TYPE(rt_info) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! io_putinputfile +! FUNCTION: +! print an input file conforming to io_getbatchinput +! SYNTAX: +! call io_putinputfile(param) +! ON INPUT: +! p_param: global parameter data structure TYPE(control_struct) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! io_getcmdline, io_getinterinput, io_getbatchinput, +! io_putparameters, io_putruntimeinfo, io_putinputfile +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, MISC_timing, IO_plotdefine, +! FEM_handle +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/96 +! 2. largely extended j. behrens 11/96 +! 3. changed command line io j. behrens 1/97 +! 4. changed runtime output (adaptations) j. behrens 1/97 +! 5. control data struct, less command io j. behrens 12/97 +! 6. tiff file plotting included j. behrens 1/98 +! 7. adapted to BJuGL j. behrens 1/2000 +! 8. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE IO_utils + USE FLASH_parameters + USE MISC_timing + USE MISC_system + USE GRID_api + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + PUBLIC :: io_getcmdline, io_getinterinput, io_getbatchinput, & + io_putparameters, io_putruntimeinfo, io_putinputfile, io_initparams + CONTAINS +!***************************************************************** + SUBROUTINE io_getcmdline(p_cmd) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_cmd + + LOGICAL :: l_ict + LOGICAL :: l_bat + LOGICAL :: l_mtl + LOGICAL :: l_dia + CHARACTER (len=io_fillen) :: a_infln + CHARACTER (len=io_fillen) :: a_outfln + INTEGER :: numargs + INTEGER :: i= 1 + INTEGER :: i_fst + LOGICAL :: help= .true. + LOGICAL :: shoversion= .false. + CHARACTER (len=2) :: option + CHARACTER (len=15) :: comdnam + CHARACTER (len=32) :: c_file + CHARACTER (len=io_fillen) :: c_dummy + +!---------- initialize output variables + + a_infln = 'Parameters.in' + a_outfln= './' + l_ict= .false. + l_bat= .false. + l_mtl= .false. + l_dia= .false. + +!---------- read number commandline arguments +! this is possibly non standard f90, but definitely quasi standard + + numargs= sys_numcmdargs() + CALL sys_getcmdargs(0,c_dummy,i_len=len(c_dummy)) + comdnam= c_dummy(1:15) + check_args: IF(numargs < 1) THEN + GOTO 100 ! print_help + ELSE check_args + +!---------- read command line arguments one by one + + DO WHILE (i <= numargs) + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + option= c_dummy(1:2) + +!---------- select the CASEs for command line options + + eval_option: SELECT CASE (option) + CASE('-h') eval_option !--- request for help --- + help= .true. + i= i+1 + CASE('-?') eval_option !--- request for help --- + help= .true. + i= i+1 + CASE('-r') eval_option !--- print release information --- + shoversion= .true. + i= i+1 + CASE('-l') eval_option !--- switch on logging --- + help= .false. + p_cmd%cmd%l_logging= .true. + i= i+1 + CASE('-o') eval_option !--- redirect output into file --- + help= .false. + p_cmd%cmd%l_output= .true. + i= i+1 + CASE('-f') eval_option !--- supply input file name --- + help= .false. + i= i+1 + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + a_infln= c_dummy(1:io_fillen) + IF(a_infln(1:1) == '-') THEN !--- check correctnes of file name --- + help= .true. + GOTO 100 ! print_help + ELSE + i= i+1 + END IF + CASE('-d') eval_option !--- directory path in which to find and write data --- + help= .false. + i= i+1 + CALL sys_getcmdargs(i,c_dummy,i_len=len(c_dummy)) + a_outfln= c_dummy(1:io_fillen) + IF(a_outfln(1:1) == '-') THEN !--- check correctnes of file name --- + help= .true. + GOTO 100 ! print_help + ELSE + i= i+1 + END IF + CASE DEFAULT eval_option !--- default CASE: show help --- + help= .true. + GOTO 100 ! print_help + END SELECT eval_option + END DO + END IF check_args + +!---------- update output structure + + p_cmd%cmd%c_infile = a_infln + p_cmd%cmd%c_directory = a_outfln + +!---------- print help information + + 100 print_help: IF(help) THEN + IF(shoversion) THEN + write(GRID_parameters%ioout,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + write(GRID_parameters%ioout,1002) comdnam + write(i_ioerr,*) 'STOPPED ... this is all I can say' + STOP + ELSE + write(GRID_parameters%ioout,1010) comdnam + write(GRID_parameters%ioout,1011) GRID_parameters%author_name + write(i_ioerr,*) 'STOPPED ... hope this made it clear' + STOP + END IF + END IF print_help + +!---------- print version information + + print_version: IF(shoversion) THEN + write(GRID_parameters%ioout,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1001) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, GRID_parameters%datemonth, GRID_parameters%dateyear, & + GRID_parameters%author_name, GRID_parameters%author_email, GRID_parameters%author_affil1, & + GRID_parameters%author_affil2, GRID_parameters%author_affil3 + END IF print_version + + RETURN + + 1001 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** PROGRAM: ',a15,24x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,31x,'*****',/ & + 1x,'***** DATE: ',i2.2,'/',i4.4,32x,'*****',/ & + 1x,'***** AUTHOR: ',a12,27x,'*****',/ & + 1x,'***** E-MAIL: ',a39,'*****',/ & + 1x,'***** ADDRESS: ',a39,'*****',/ & + 1x,'***** ',a39,'*****',/ & + 1x,'***** ',a39,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****') + 1002 FORMAT(1x,'***** TYPE ',a15,' -h, to get help',12x,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****') + 1010 FORMAT(1x,'USAGE: ',a15,' {-d dir} {-f file} {-h} {-l} {-o} {-r}',/ & + 1x,' -d: determine input/output file directory path << dir >>, default ./',/ & + 1x,' -f: input filename is << name >>, default Parameters.in',/ & + 1x,' -h: help information (this output)',/ & + 1x,' -l: switch on log file output',/ & + 1x,' -o: redirect standard output to a file',/ & + 1x,' -r: release information') + 1011 FORMAT(1x,'Copyright (c) 2016',a13) + END SUBROUTINE io_getcmdline +!***************************************************************** + SUBROUTINE io_initparams(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_param + INTEGER :: i_maxsize, i_alct + +!---------- initialize + + p_param%num%r_deltatime = -1.0 + p_param%num%r_reftolerance = -1.0 + p_param%num%r_crstolerance = -1.0 + p_param%num%r_refwatermark = -1.0 + p_param%num%r_crswatermark = -1.0 + p_param%num%i_experiment = -1 + p_param%num%i_crslevel = -1 + p_param%num%i_reflevel = -1 + p_param%num%i_frsttimestep = -1 + p_param%num%i_lasttimestep = -1 + p_param%num%r_starttime = -1.0 + p_param%num%r_finaltime = -1.0 + p_param%num%i_adviterations = -1 + p_param%io%i_plotoffset = -1 + p_param%io%i_saveoffset = -1 + p_param%io%i_savelast = -1 + p_param%io%l_diagnostics = .FALSE. + p_param%io%l_vtu = .FALSE. + p_param%io%l_netcdf = .FALSE. + p_param%io%c_domainfile = 'Domain.dat' + p_param%io%c_triangfile = 'Triang.dat' + +!---------- initialize meta data + + p_param%tst%i_lognum = 0 + p_param%tst%i_intnum = 0 + p_param%tst%i_charnum = 0 + p_param%tst%i_realnum = 0 + + END SUBROUTINE io_initparams +!***************************************************************** + SUBROUTINE io_getbatchinput(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(out) :: p_param + INTEGER, PARAMETER :: i_iofil= 10 + CHARACTER (len=80) :: a_filrow + CHARACTER (LEN=GRID_parameters%i_stringlength) :: c_tmp + INTEGER :: i_iost, i_ioend, & + i_tmp, i_cln, i_cnt, i_len, i_alct, i_maxsize + CHARACTER (LEN=2*io_fillen) :: c_inputfile + +!---------- initialize + + i_cln= MIN(GRID_parameters%i_stringlength,io_fillen) + +!---------- input file + + WRITE(c_inputfile,*) trim(p_param%cmd%c_directory),p_param%cmd%c_infile + c_inputfile= adjustl(c_inputfile) + +!---------- open input file + + OPEN(unit= i_iofil, file= c_inputfile, status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + WRITE(i_ioerr,*) 'ERROR: Filename: ', c_inputfile + IF(GRID_parameters%iolog > 0) & + WRITE(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_inputfile + CALL grid_error(21) + ELSE file_notopen + WRITE(GRID_parameters%ioout,1000) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, c_inputfile + IF(GRID_parameters%iolog > 0) THEN + WRITE(GRID_parameters%iolog,*) 'INFO: Filename: ', c_inputfile, ' opened on unit: ', i_iofil + WRITE(GRID_parameters%iolog,1000) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion, c_inputfile + END IF + END IF file_notopen + +!---------- read line by line + + read_loop: DO + READ(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + CLOSE(i_iofil) + IF(GRID_parameters%iolog > 0) & + WRITE(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CYCLE read_loop + ELSE IF(a_filrow(1:14) == 'EXPERIMENT_NUM') THEN comment_line + read(i_iofil,*) p_param%num%i_experiment + ELSE IF(a_filrow(1:14) == 'FINE_GRID_LEVE') THEN comment_line + read(i_iofil,*) p_param%num%i_reflevel + ELSE IF(a_filrow(1:14) == 'COARSE_GRID_LE') THEN comment_line + read(i_iofil,*) p_param%num%i_crslevel + ELSE IF(a_filrow(1:14) == 'TOLERANCE_OF_R') THEN comment_line + read(i_iofil,*) p_param%num%r_reftolerance + ELSE IF(a_filrow(1:14) == 'TOLERANCE_OF_C') THEN comment_line + read(i_iofil,*) p_param%num%r_crstolerance + ELSE IF(a_filrow(1:14) == 'WATERMARK_OF_R') THEN comment_line + read(i_iofil,*) p_param%num%r_refwatermark + ELSE IF(a_filrow(1:14) == 'WATERMARK_OF_C') THEN comment_line + read(i_iofil,*) p_param%num%r_crswatermark + ELSE IF(a_filrow(1:14) == 'TIMESTEP_LENGT') THEN comment_line + read(i_iofil,*) p_param%num%r_deltatime + ELSE IF(a_filrow(1:14) == 'BEGINNING_TIME') THEN comment_line + read(i_iofil,*) p_param%num%i_frsttimestep + ELSE IF(a_filrow(1:14) == 'FINISHING_TIME') THEN comment_line + read(i_iofil,*) p_param%num%i_lasttimestep + ELSE IF(a_filrow(1:14) == 'TIMESTEPPING_S') THEN comment_line + read(i_iofil,*) p_param%num%r_starttime + ELSE IF(a_filrow(1:14) == 'TIMESTEPPING_E') THEN comment_line + read(i_iofil,*) p_param%num%r_finaltime + ELSE IF(a_filrow(1:14) == 'SLM_ITERATION_') THEN comment_line + read(i_iofil,*) p_param%num%i_adviterations + ELSE IF(a_filrow(1:14) == 'STEPS_BTW_PLOT') THEN comment_line + read(i_iofil,*) p_param%io%i_plotoffset + ELSE IF(a_filrow(1:14) == 'SWITCH_ON_DIAG') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_diagnostics= .TRUE. + ELSE IF(a_filrow(1:14) == 'NETCDF_FILE_PL') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_netcdf= .TRUE. + ELSE IF(a_filrow(1:14) == 'VTU_FILE_PLOTT') THEN comment_line + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%io%l_vtu= .TRUE. + ELSE IF(a_filrow(1:14) == 'STEPS_BTW_SAVE') THEN comment_line + read(i_iofil,*) p_param%io%i_saveoffset + ELSE IF(a_filrow(1:14) == 'SAVE_FINISH_CO') THEN comment_line + read(i_iofil,*) p_param%io%i_savelast + ELSE IF(a_filrow(1:14) == 'DOMAIN_FILE_NA') THEN comment_line + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(i_tmp == 0) p_param%io%c_domainfile(1:i_cln)= c_tmp(1:i_cln) + ELSE IF(a_filrow(1:14) == 'TRIANG_FILE_NA') THEN comment_line + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(i_tmp == 0) p_param%io%c_triangfile(1:i_cln)= c_tmp(1:i_cln) +!---------- look for additional parameters in the physical parameter set + ELSE IF(a_filrow(1:14) == 'TST_INT_PARAME') THEN comment_line + read(i_iofil,*) p_param%tst%i_intnum + IF (p_param%tst%i_intnum > 0) THEN +!---------- allocate integer data structure for parameters and read the structure + ALLOCATE(p_param%tst%i_intsizes(p_param%tst%i_intnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: intsizes parameter not allocated') + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(c_tmp(1:14) .NE. 'TST_INT_STRUCT') CALL grid_error(c_error='[io_getbatchinput]: inconsistent integer params') + read(i_iofil,*) p_param%tst%i_intsizes +!---------- allocate space for keywords + ALLOCATE(p_param%tst%c_intkeywds(p_param%tst%i_intnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: intkeywds parameter not allocated') +!---------- allocate space for parameters + i_maxsize= maxval(p_param%tst%i_intsizes) + ALLOCATE(p_param%tst%tst_int(i_maxsize,p_param%tst%i_intnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: could not allocate int pointers') +!---------- read keywords and parameters + int_loop: DO i_cnt=1,p_param%tst%i_intnum + read(i_iofil,2010,iostat=i_tmp) c_tmp + p_param%tst%c_intkeywds(i_cnt)=c_tmp(1:i_comparlen) + read(i_iofil,*) p_param%tst%tst_int(1:p_param%tst%i_intsizes(i_cnt),i_cnt) + END DO int_loop + END IF + ELSE IF(a_filrow(1:14) == 'TST_REAL_PARAM') THEN comment_line + read(i_iofil,*) p_param%tst%i_realnum + IF (p_param%tst%i_realnum > 0) THEN +!---------- allocate real data structure for parameters and read the structure + ALLOCATE(p_param%tst%i_realsizes(p_param%tst%i_realnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: realsizes parameter not allocated') + read(i_iofil,2010,iostat=i_tmp) c_tmp + IF(c_tmp(1:14) .NE. 'TST_REAL_STRUC') CALL grid_error(c_error='[io_getbatchinput]: inconsistent real params') + read(i_iofil,*) p_param%tst%i_realsizes +!---------- allocate space for keywords + ALLOCATE(p_param%tst%c_realkeywds(p_param%tst%i_realnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: realkeywds parameter not allocated') +!---------- allocate space for parameters + i_maxsize= maxval(p_param%tst%i_realsizes) + ALLOCATE(p_param%tst%tst_real(i_maxsize,p_param%tst%i_realnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: could not allocate real pointers') +!---------- read keywords and parameters + real_loop: DO i_cnt=1,p_param%tst%i_realnum + read(i_iofil,2010,iostat=i_tmp) c_tmp + p_param%tst%c_realkeywds(i_cnt)=c_tmp(1:i_comparlen) + read(i_iofil,*) p_param%tst%tst_real(1:p_param%tst%i_realsizes(i_cnt),i_cnt) + END DO real_loop + END IF + ELSE IF(a_filrow(1:14) == 'TST_LOG_PARAME') THEN comment_line + read(i_iofil,*) p_param%tst%i_lognum + IF (p_param%tst%i_lognum > 0) THEN +!---------- allocate space for keywords + ALLOCATE(p_param%tst%c_logkeywds(p_param%tst%i_lognum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: logkeywds parameter not allocated') +!---------- allocate space for parameters + ALLOCATE(p_param%tst%tst_log(p_param%tst%i_lognum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: could not allocate logical pointers') +!---------- read keywords and parameters + log_loop: DO i_cnt=1,p_param%tst%i_lognum + read(i_iofil,2010,iostat=i_tmp) c_tmp + p_param%tst%c_logkeywds(i_cnt)=c_tmp(1:i_comparlen) + p_param%tst%tst_log(i_cnt)= .FALSE. ! default value! + read(i_iofil,*) i_tmp + IF(i_tmp /= 0) p_param%tst%tst_log(i_cnt)= .TRUE. + END DO log_loop + END IF + ELSE IF(a_filrow(1:14) == 'TST_CHAR_PARAM') THEN comment_line + read(i_iofil,*) p_param%tst%i_charnum + IF (p_param%tst%i_charnum > 0) THEN +!---------- allocate space for keywords + ALLOCATE(p_param%tst%c_charkeywds(p_param%tst%i_charnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: charkeywds parameter not allocated') +!---------- allocate space for parameters + ALLOCATE(p_param%tst%tst_char(p_param%tst%i_charnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[io_getbatchinput]: could not allocate char pointers') +!---------- read keywords and parameters + char_loop: DO i_cnt=1,p_param%tst%i_charnum + read(i_iofil,2010,iostat=i_tmp) c_tmp + p_param%tst%c_charkeywds(i_cnt)=c_tmp(1:i_comparlen) + read(i_iofil,2020,iostat=i_tmp) p_param%tst%tst_char(i_cnt) + END DO char_loop + END IF + END IF comment_line + END IF file_end + END DO read_loop + +!---------- for backward compatibility we accept time step input, but +! it is necessary to compute the initial and final time... + no_inittime: IF((p_param%num%r_starttime < 0.0) .OR. & + (p_param%num%r_finaltime < 0.0)) THEN + +!---------- check if at least first and last timestep are given + no_step: IF((p_param%num%i_frsttimestep < 0) .OR. & + (p_param%num%i_lasttimestep < 0)) THEN + CALL grid_error(c_error='[io_getbatchinput]: incomplete time stepping info') + END IF no_step + +!---------- check if delta time is given + no_delta: IF((p_param%num%r_deltatime < 0.0)) THEN + CALL grid_error(c_error='[io_getbatchinput]: incomplete delta t') + END IF no_delta + +!---------- now compute initial and final time from time stepping info + + p_param%num%r_starttime = p_param%num%r_deltatime * p_param%num%i_frsttimestep + p_param%num%r_finaltime = p_param%num%r_deltatime * p_param%num%i_lasttimestep + + END IF no_inittime + +!---------- error handling + + no_value: IF((p_param%num%r_deltatime < 0.0) .OR. & + (p_param%num%r_starttime < 0.0) .OR. & + (p_param%num%r_finaltime < 0.0) .OR. & + (p_param%num%r_reftolerance < 0.0) .OR. & + (p_param%num%r_crstolerance < 0.0) .OR. & + (p_param%num%r_refwatermark < 0.0) .OR. & + (p_param%num%r_crswatermark < 0.0) .OR. & + (p_param%num%i_experiment < 0) .OR. & + (p_param%num%i_crslevel < 0) .OR. & + (p_param%num%i_reflevel < 0) .OR. & + (p_param%io%i_plotoffset < 0) .OR. & + (p_param%io%i_saveoffset < 0) .OR. & + (p_param%num%i_adviterations < 0)) THEN + CALL grid_error(22) + END IF no_value + + RETURN + + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** PROGRAM: ',a15,22x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,29x,'*****',/ & + 1x,'***** Started in BATCH input mode',10x,'*****',/ & + 1x,'***** INPUTFILE: ',a20,17x,'*****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 2000 FORMAT(a80) + 2010 FORMAT(a32) + 2020 FORMAT(a) + + END SUBROUTINE io_getbatchinput +!***************************************************************** + SUBROUTINE io_putparameters(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER :: i1, i2, i3, i9, i10, i11, i12, i13, i14 + REAL (KIND = GRID_SR) :: r4, r5, r6, r7, r8, r9, r10 + CHARACTER (len=3) :: c_diag, c_netc, c_vtup + +!---------- temporary store + + i1 = p_param%num%i_experiment + i2 = p_param%num%i_reflevel + i3 = p_param%num%i_crslevel + r4 = p_param%num%r_reftolerance + r5 = p_param%num%r_crstolerance + r6 = p_param%num%r_refwatermark + r7 = p_param%num%r_crswatermark + r8 = p_param%num%r_deltatime + r9 = p_param%num%r_starttime + r10= p_param%num%r_finaltime + i11= p_param%io%i_saveoffset + i12= p_param%io%i_plotoffset + i13= p_param%io%i_savelast + i14= p_param%num%i_adviterations + + IF(p_param%io%l_diagnostics) THEN + c_diag= ' ON' + ELSE + c_diag= 'OFF' + END IF + IF(p_param%io%l_netcdf) THEN + c_netc= ' ON' + ELSE + c_netc= 'OFF' + END IF + IF(p_param%io%l_vtu) THEN + c_vtup= ' ON' + ELSE + c_vtup= 'OFF' + END IF + +!---------- write satement + + write(GRID_parameters%ioout,1000) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10, i11, i12, & + i13, i14, c_diag, c_netc, c_vtup + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1000) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10, i11, i12, & + i13, i14, c_diag, c_netc, c_vtup + + RETURN + + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Global Parameters',16x,'*****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Experiment No.',25x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Finest grid level',22x,i8,' *****',/ & + 1x,'***** Coarsest grid level',20x,i8,' *****',/ & + 1x,'***** Refinement tolerance',15x,e12.4,' *****',/ & + 1x,'***** Coarsening tolerance',15x,e12.4,' *****',/ & + 1x,'***** Refinement watermark',15x,e12.4,' *****',/ & + 1x,'***** Coarsening watermark',15x,e12.4,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Timestep length',20x,e12.4,' *****',/ & + 1x,'***** Start time',25x,e12.4,' *****',/ & + 1x,'***** Final time',25x,e12.4,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Timesteps between save',17x,i8,' *****',/ & + 1x,'***** Timesteps between plot',17x,i8,' *****',/ & + 1x,'***** Flag for last save',21x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Iterations for trajectories',12x,i8,' *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****',/ & + 1x,'***** Diagnostics switched',24x,a3,' *****',/ & + 1x,'***** NetCDF plotting switched',20x,a3,' *****',/ & + 1x,'***** VTU plotting switched',23x,a3,' *****',/ & + 1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + + END SUBROUTINE io_putparameters +!***************************************************************** + SUBROUTINE io_putruntimeinfo(p_ghand, p_info, p_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (rt_info), INTENT(inout) :: p_info + TYPE (sw_info), INTENT(inout) :: p_time + INTEGER :: i_cnt + +!---------- output + + write(GRID_parameters%ioout,1000) p_info%i_step, p_info%r_modeltime, p_info%i_adapit, & + p_ghand%i_enumber, p_ghand%i_enumfine, & + p_ghand%i_gnumber, p_ghand%i_gnumfine, & + p_ghand%i_nnumber + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1000) p_info%i_step, p_info%r_modeltime, p_info%i_adapit, & + p_ghand%i_enumber, p_ghand%i_enumfine, & + p_ghand%i_gnumber, p_ghand%i_gnumfine, & + p_ghand%i_nnumber + times_loop: DO i_cnt=1,p_time%i_num + write(GRID_parameters%ioout,1003) p_time%p_tim(i_cnt)%c_tim, p_time%p_tim(i_cnt)%r_tim + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1003) p_time%p_tim(i_cnt)%c_tim, p_time%p_tim(i_cnt)%r_tim + END DO times_loop + save_perf: IF(p_info%l_saved) THEN + write(GRID_parameters%ioout,1002) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1002) + also_plot: IF(p_info%l_ploted) THEN + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1006) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1005) + write(GRID_parameters%iolog,1006) + END IF + ELSE also_plot + write(GRID_parameters%ioout,1005) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1005) + END IF also_plot + ELSE save_perf + but_plot: IF(p_info%l_ploted) THEN + write(GRID_parameters%ioout,1002) + write(GRID_parameters%ioout,1006) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1002) + write(GRID_parameters%iolog,1006) + END IF + END IF but_plot + END IF save_perf + write(GRID_parameters%ioout,1010) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,1010) + +!---------- reset info structure + + p_info%i_step = 0 + p_info%i_adapit= 0 + p_info%l_saved = .FALSE. + p_info%l_ploted= .FALSE. + + RETURN + + 1000 FORMAT(1x,'+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++',/ & + 1x,'+++++ Runtime Information Output +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Timestep Number',24x,i8,' +++++',/ & + 1x,'+++++ Model time',25x,e12.4,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Inner iterations (for adaptation)',6x,i8,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++',/ & + 1x,'+++++ Number of elements',21x,i8,' +++++',/ & + 1x,'+++++ Number of elements (fine grid)',9x,i8,' +++++',/ & + 1x,'+++++ Number of edges',24x,i8,' +++++',/ & + 1x,'+++++ Number of edges (fine grid)',12x,i8,' +++++',/ & + 1x,'+++++ Number of nodes',24x,i8,' +++++',/ & + 1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++') + 1002 FORMAT(1x,'+++++ ----- ----- ----- ----- ----- ----- ----- ----- +++++') + 1003 FORMAT(1x,'+++++ Time spent in ',a16,5x,e12.4,' +++++') + 1005 FORMAT(1x,'+++++ Saveset transferred to disk in this step +++++') + 1006 FORMAT(1x,'+++++ Plotting performed in this step +++++') + 1010 FORMAT(1x,'+++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++ +++++',/) + + END SUBROUTINE io_putruntimeinfo +!***************************************************************** + SUBROUTINE io_putinputfile(p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER :: i1, i2, i3, i9, i10, i11, & + i12, i13, i14, i15, i16, i17, i18, i19, i20, i31 + INTEGER :: i_cnt, i_true, i_false, i_len + REAL (KIND = GRID_SR) :: r4, r5, r6, r7, r8, r9, r10 + INTEGER :: i_unit=15, i_fst + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + +!---------- temporary store + + i1 = p_param%num%i_experiment+ 1 + i2 = p_param%num%i_reflevel + i3 = p_param%num%i_crslevel + r4 = p_param%num%r_reftolerance + r5 = p_param%num%r_crstolerance + r6 = p_param%num%r_refwatermark + r7 = p_param%num%r_crswatermark + r8 = p_param%num%r_deltatime + r9 = p_param%num%r_finaltime + r10= p_param%num%r_finaltime + (p_param%num%r_finaltime- p_param%num%r_starttime) + i12= 0 + IF(p_param%io%l_netcdf) i12= 1 + i11= 0 + IF(p_param%io%l_vtu) i11= 1 + i31= 0 + IF(p_param%io%l_diagnostics) i31= 1 + i13= p_param%io%i_plotoffset + i14= p_param%io%i_saveoffset + i15= p_param%io%i_savelast + i16= p_param%num%i_adviterations + + i_true= 1 + i_false= 0 + +!---------- open file + + write(c_tmp,*) trim(GRID_parameters%program_name), '_input.' + write(c_file,1010) trim(c_tmp), i1 + c_file= adjustl(c_file) + open(i_unit, file= c_file, action= 'write', form= 'formatted', & + status='replace', iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(23) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_unit + +!---------- write statement + + write(i_unit,1001) c_file, GRID_parameters%program_name + write(i_unit,1002) i1, i2, i3, r4, r5, r6, r7, r8, r9, r10 + write(i_unit,1003) i12, i11, i31, i13, i14, & + i15, p_param%io%c_domainfile, p_param%io%c_triangfile, i16 + +!---------- write statements for the generic phy part + + IF(p_param%tst%i_lognum > 0) THEN + log_loop: DO i_cnt=1,p_param%tst%i_lognum + write(i_unit,1011) p_param%tst%c_logkeywds(i_cnt) + IF(p_param%tst%tst_log(i_cnt)) THEN + write(i_unit,*) i_true + ELSE + write(i_unit,*) i_false + END IF + END DO log_loop + END IF + IF(p_param%tst%i_charnum > 0) THEN + char_loop: DO i_cnt=1,p_param%tst%i_charnum + write(i_unit,1011) p_param%tst%c_charkeywds(i_cnt) + write(i_unit,*) p_param%tst%tst_char(i_cnt) + END DO char_loop + END IF + IF(p_param%tst%i_intnum > 0) THEN + write(i_unit,1011) 'TST_INT_STRUCT' + write(i_unit,*) p_param%tst%i_intsizes + int_loop: DO i_cnt=1,p_param%tst%i_intnum + write(i_unit,1011) p_param%tst%c_intkeywds(i_cnt) + i_len=p_param%tst%i_intsizes(i_cnt) + write(i_unit,*) p_param%tst%tst_int(1:i_len,i_cnt) + END DO int_loop + END IF + IF(p_param%tst%i_realnum > 0) THEN + write(i_unit,1011) 'TST_REAL_STRUC' + write(i_unit,*) p_param%tst%i_realsizes + real_loop: DO i_cnt=1,p_param%tst%i_realnum + write(i_unit,1011) p_param%tst%c_realkeywds(i_cnt) + i_len=p_param%tst%i_realsizes(i_cnt) + write(i_unit,*) p_param%tst%tst_real(1:i_len,i_cnt) + END DO real_loop + END IF + write(i_unit,1004) + +!---------- close file + + close(i_unit) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_unit + + RETURN + + 1001 FORMAT('# --- --- --- --- --- --- --- --- --- --- --- --- ---',/ & + '# Parameter file ',a32,/ & + '# created automatically by program ',a15,/ & + '# --- --- --- --- --- --- --- --- --- --- --- --- ---') + 1002 FORMAT('EXPERIMENT_NUMBER',/ & + i8,/ & + 'FINE_GRID_LEVEL',/ & + i8,/ & + 'COARSE_GRID_LEVEL',/ & + i8,/ & + 'TOLERANCE_OF_REFINEMENT',/ & + e12.4,/ & + 'TOLERANCE_OF_COARSENING',/ & + e12.4,/ & + 'WATERMARK_OF_REFINEMENT',/ & + e12.4,/ & + 'WATERMARK_OF_COARSENING',/ & + e12.4,/ & + 'TIMESTEP_LENGTH',/ & + e12.4,/ & + 'TIMESTEPPING_START_TIME',/ & + e12.4,/ & + 'TIMESTEPPING_END_TIME',/ & + e12.4) + 1003 FORMAT('NETCDF_FILE_PLOTTING',/ & + i8,/ & + 'VTU_FILE_PLOTTING',/ & + i8,/ & + 'SWITCH_ON_DIAGNOSTICS',/ & + i8,/ & + 'STEPS_BTW_PLOTS',/ & + i8,/ & + 'STEPS_BTW_SAVES',/ & + i8,/ & + 'SAVE_FINISH_CONFIGURATION',/ & + i8,/ & + 'DOMAIN_FILE_NAME',/ & + a32,/ & + 'TRIANG_FILE_NAME',/ & + a32,/ & + 'SLM_ITERATION_NUMBER',/ & + i8) + 1004 FORMAT('# --- --- End of parameter file --- --- --- --- ---') + 1010 FORMAT(a28,i4.4) + 1011 FORMAT(a14) ! CAUTION: Make sure this is exactly as long as i_comparlen in FLASH_metadata + + END SUBROUTINE io_putinputfile + END MODULE IO_utils diff --git a/flash2d/src/flash/IO_vtu.F90 b/flash2d/src/flash/IO_vtu.F90 new file mode 100644 index 0000000000000000000000000000000000000000..eb6a44c9f957833c7a373649a5a6724db611c958 --- /dev/null +++ b/flash2d/src/flash/IO_vtu.F90 @@ -0,0 +1,553 @@ +!----------------------------------------------------------------------- +!> \file IO_vtu.F90 +!> \brief Contains the module IO_vtu +!----------------------------------------------------------------------- +!> The MODULE IO_vtu create a vtu file, unstructered grid, readable by +!! paraview +! +!> Actually, amatos' structure denies a unified handling for +!! 2d, 3d and spherical case. Therefore the corresponding definition +!! has to be uncommented +!----------------------------------------------------------------------- + +#define VTU_OUTPUT2D +!#define VTU_OUTPUT3D + +MODULE IO_vtu + +USE GRID_api + +PUBLIC :: plot_vtu, t_vtu_data + +#ifdef VTU_OUTPUT2D + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodespercell = GRID_elementnodes + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodesperface = GRID_edgenodes + + ! This defines a triangle in VTK format + INTEGER(KIND=GRID_SI), PARAMETER :: i_vtucelltype = 5 +#elif defined VTU_OUTPUT3D + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodespercell = GRID_tetranodes + INTEGER(KIND=GRID_SI), PARAMETER :: i_nodesperface = GRID_elementnodes + + ! This defines a tetrahedron in VTK format + INTEGER(KIND=GRID_SI), PARAMETER :: i_vtucelltype = 10 +#endif + + +!> Structure for variable information +TYPE t_vtu_data + CHARACTER(LEN=32) :: c_name !< VTU variable name + INTEGER(KIND=GRID_SI) :: i_size !< data dimension + REAL(KIND=GRID_SR),POINTER, DIMENSION(:,:) :: p_vdata !< pointer to data +END TYPE t_vtu_data + +!> Very small values can cause errors when read in paraview. +!! This is the threshold for filtering. +REAL(KIND = GRID_SR), PARAMETER :: r_vtueps = 1e-12 +CONTAINS + +!--------------------------------------------------------------------- +!> \brief Writes a VTU file +!> Use this routine to plot continuous or discontinuous data. +!> \param[in] p_mesh The mesh +!> \param[in] c_filename The name of the file to write to +!> \param[in] i_nodedata Size of the array p_nodedata +!> \param[in] p_nodedata Array of type t_vtu_data for node +!! data. For each node one entry has to exist in +!! p_vdata. +!> \param[in] i_celldata Size of the array p_celldata +!> \param[in] p_nodedata Array of type t_vtu_data for cell +!! data. For each tetrahedron one entry has to +!! exist in p_vdata. +#ifdef VTU_OUTPUT2D +!> \param[in] r_zcoordinate The z-coordinate values +!> \param[in] i_zcoordinate Use the i_zcoordinate component of p_nodedata +!! also as z-coordinate +#endif +!> \param[in] l_continuous Write continuous node data. +!! This needs less space than discontinuous. +!! default: .true. +!> \param[in] l_grid_info Write grid numbering information +!! default: .false. +!--------------------------------------------------------------------- +SUBROUTINE plot_vtu(p_mesh, c_filename, & + i_nodedata, p_nodedata, i_celldata, p_celldata, & +#ifdef VTU_OUTPUT2D + r_zcoordinate, i_zcoordinate, & +#endif + l_continuous, l_grid_info) + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_mesh + CHARACTER (len=*), INTENT(IN) :: c_filename + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_nodedata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_nodedata + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_celldata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_celldata +#ifdef VTU_OUTPUT2D + REAL(KIND=GRID_SR), POINTER, DIMENSION(:,:), OPTIONAL & + :: r_zcoordinate + INTEGER(KIND=GRID_SI), OPTIONAL, INTENT(IN) :: i_zcoordinate +#endif + + LOGICAL, INTENT(IN), OPTIONAL :: l_grid_info + LOGICAL, INTENT(IN), OPTIONAL :: l_continuous + + INTEGER( KIND = GRID_SI) :: i_alct + INTEGER( KIND = GRID_SI) :: i_cnt + INTEGER( KIND = GRID_SI) :: i_fst + INTEGER( KIND = GRID_SI) :: i_ncnt + INTEGER( KIND = GRID_SI), PARAMETER :: i_fhandle = 89 + + ! this variables result from different naming conventions in two and + ! three dimensions + INTEGER( KIND = GRID_SI) :: i_numberofcells + INTEGER( KIND = GRID_SI) :: i_numberoffaces + INTEGER( KIND = GRID_SI) :: i_numberofpoints + + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_cellnodes + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE :: i_nodes + + LOGICAL :: l_write_grid_info + LOGICAL :: l_continuous_data + + +#ifdef VTU_OUTPUT2D + IF(PRESENT(i_zcoordinate) .AND. PRESENT(r_zcoordinate)) THEN + CALL GRID_error(c_error='[plot_vtu] z-coordinate is defined twice') + END IF +#endif + + ! set the value of l_continuous. The default is .true. + IF(PRESENT(l_continuous)) THEN + l_continuous_data = l_continuous + ELSE + l_continuous_data = .TRUE. + END IF + + ! set the value of l_grid_info. The default is .false.. + IF(PRESENT(l_grid_info)) THEN + l_write_grid_info = l_grid_info + ELSE + l_write_grid_info = .FALSE. + END IF + + ! Set dimension depending types +#ifdef VTU_OUTPUT2D + i_numberofcells = p_mesh%i_enumfine + i_numberoffaces = p_mesh%i_gnumfine +#elif defined VTU_OUTPUT3D + i_numberofcells = p_mesh%i_tnumfine + i_numberoffaces = p_mesh%i_enumfine +#endif + + IF(l_continuous_data) THEN + i_numberofpoints = p_mesh%i_nnumber + ELSE + i_numberofpoints = i_numberofcells * i_nodespercell + END IF + + ! We only need the node coordinates and the nodes per tetra + ! as additional information. + ALLOCATE(r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_cellnodes(i_nodespercell, i_numberofcells), & + stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate data arrays') + END IF + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & +#ifdef VTU_OUTPUT2D + i_elementnodes = i_cellnodes) +#elif defined VTU_OUTPUT3D + i_tetranodes = i_cellnodes) +#endif + + ! open the file and write header information + OPEN(i_fhandle, file = c_filename, iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + + WRITE(i_fhandle, "(A)") '<?xml version="1.0"?>' + WRITE(i_fhandle, "(A)") '<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">' + WRITE(i_fhandle, *) '<UnstructuredGrid>' + WRITE(i_fhandle, "(A,I8,A,I8,A)") '<Piece NumberOfPoints="', & + i_numberofpoints, & + '" NumberOfCells="', & + i_numberofcells, & + '">' + + ! write the node coordinates to VTU file + WRITE(i_fhandle, *) '<Points>' + WRITE(i_fhandle, "(A,I1,A)") '<DataArray type="Float32" NumberOfComponents="', & + 3, '" format="ascii">' + + ! Distunguish between continuous and discontinuous case + IF(l_continuous_data) THEN + !> The continuous case is represented by amatos' grid topology. + DO i_cnt = 1, p_mesh%i_nnumber +#ifdef VTU_OUTPUT3D + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt) +#elif defined VTU_OUTPUT2D + IF(PRESENT(r_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), r_zcoordinate(1, i_cnt) + ELSE IF(PRESENT(i_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), & + p_nodedata(i_zcoordinate)%p_vdata(1, i_cnt) + ELSE + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt), 0.0 + END IF +#endif + END DO + + ELSE + ! Write the node coordinates. In this discontinuous case one node in + ! paraview belongs only to one cell. + DO i_cnt = 1, i_numberofcells + DO i_ncnt = 1, i_nodespercell +#ifdef VTU_OUTPUT3D + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)) +#elif defined VTU_OUTPUT2D + IF(PRESENT(r_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), & + r_zcoordinate(1, i_cellnodes(i_ncnt, i_cnt)) + ELSE IF(PRESENT(i_zcoordinate)) THEN + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), & + p_nodedata(i_zcoordinate)%p_vdata(1, i_cellnodes(i_ncnt, i_cnt)) + ELSE + WRITE(i_fhandle, *) r_nodecoor(:, i_cellnodes(i_ncnt, i_cnt)), 0.0 + END IF +#endif + END DO + END DO + END IF + + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Points>' + + ! Write the node connectivity + WRITE(i_fhandle, *) '<Cells>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="connectivity" format="ascii">' + + ! check wether continuous data is written + IF(l_continuous_data) THEN + ! The indexing in paraview starts with 0. Therefore we subtract one from + ! the node connectivity information. +#ifdef VTU_OUTPUT2D + DO i_cnt = 1, p_mesh%i_enumfine +#elif defined VTU_OUTPUT3D + DO i_cnt = 1, p_mesh%i_tnumfine +#endif + WRITE(i_fhandle, *) i_cellnodes(:, i_cnt) - 1 + END DO + ELSE + ! Write element nodes (indexing starts by 0!) + ! In the discontinuous case each tetrahedron has its own nodes + ALLOCATE(i_nodes(i_nodespercell), stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate node array for VTU output') + END IF + + DO i_cnt = 1, i_numberofcells * i_nodespercell, i_nodespercell + + DO i_ncnt = 1, i_nodespercell + i_nodes(i_ncnt) = i_ncnt + i_cnt - 2 + END DO + + WRITE(i_fhandle, *) i_nodes + END DO + + DEALLOCATE(i_nodes) + END IF + + WRITE(i_fhandle, *) '</DataArray>' + + ! write the cell type. Tetrahedra are represented by 10 and triangles by 5 + WRITE(i_fhandle, *) '<DataArray type="UInt8" Name="types" format="ascii">' + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_vtucelltype + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="offsets" format="ascii">' + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_cnt * i_nodespercell + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Cells>' + + ! Write the point data / node data + ! If the grid information is requested save the node numbering of amatos. + ! Since every node number in paraview is decreased by one, this option is + ! in continuous plotting not too useful. + WRITE(i_fhandle, *) '<PointData>' + + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Nodenumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + ! When variables for the node data are present, save them. + IF(PRESENT(i_nodedata) .AND. PRESENT(p_nodedata)) THEN + DO i_cnt = 1, i_nodedata + CALL write_vtu_data(i_fhandle, p_nodedata(i_cnt)) + END DO + END IF + + WRITE(i_fhandle, *) '</PointData>' + + + + ! write the cell data. + WRITE(i_fhandle, *) '<CellData>' + + ! Write the element numbers when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Elementnumber" format="ascii">' + + DO i_cnt = 1, i_numberofcells + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + ! Write the variable belonging to the tetradra. + IF(PRESENT(i_celldata) .AND. PRESENT(p_celldata)) THEN + DO i_cnt = 1, i_celldata + CALL write_vtu_data(i_fhandle, p_celldata(i_cnt)) + END DO + END IF + + ! write the end of cell data and the footer. + WRITE(i_fhandle, *) '</CellData>' + WRITE(i_fhandle, *) '</Piece>' + WRITE(i_fhandle, *) '</UnstructuredGrid>' + WRITE(i_fhandle, *) '</VTKFile>' + + ! tidy up + CLOSE(i_fhandle) + DEALLOCATE(r_nodecoor, i_cellnodes) +END SUBROUTINE plot_vtu + + +#ifdef VTU_OUTPUT3D +!--------------------------------------------------------------------- +!> Use this routine to plot the mesh consisting of face and +!! continuous data on it. +!> \param p_mesh - the mesh +!> \param c_filename - the name of the file to write to +!> \param i_nodedata - (optional) size of the array p_nodedata +!> \param p_nodedata - (optional) array of type t_vtu_data for node +!! data. For each node one entry has to exist in +!! p_vdata. +!> \param i_celldata - (optional) size of the array p_celldata +!> \param p_nodedata - (optional) array of type t_vtu_data for cell +!! data. For each face one entry has to +!! exist in p_vdata. +!> \param l_grid_info - (optional) Write grid numbering information +!! default: .false. +!--------------------------------------------------------------------- +SUBROUTINE plot_vtu_elements(p_mesh, c_filename, i_nodedata, & + p_nodedata, i_celldata, p_celldata, & + l_grid_info) + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_mesh + CHARACTER (len=*), INTENT(IN) :: c_filename + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_nodedata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_nodedata + INTEGER(KIND=GRID_SI), INTENT(IN), OPTIONAL :: i_celldata + TYPE(t_vtu_data), INTENT(IN), DIMENSION(:), OPTIONAL & + :: p_celldata + + LOGICAL, INTENT(IN), OPTIONAL :: l_grid_info + + LOGICAL :: l_write_grid_info + + INTEGER( KIND = GRID_SI) :: i_alct, i_cnt, i_fst + INTEGER( KIND = GRID_SI) :: i_fhandle = 89 + + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + + !> set the optional data + IF(PRESENT(l_grid_info)) THEN + l_write_grid_info = l_grid_info + ELSE + l_write_grid_info = .FALSE. + END IF + + ALLOCATE(r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine), & + stat = i_alct) + + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[write_vtu]: could not allocate data arrays') + END IF + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_elementnodes = i_enodes) + + + OPEN(i_fhandle, file = c_filename, iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + + !> Write the VTK header + WRITE(i_fhandle, "(A)") '<?xml version="1.0"?>' + WRITE(i_fhandle, "(A)") '<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">' + WRITE(i_fhandle, *) '<UnstructuredGrid>' + WRITE(i_fhandle, "(A,I8,A,I8,A)") '<Piece NumberOfPoints="', & + p_mesh%i_nnumber, & + '" NumberOfCells="', & + p_mesh%i_enumfine, & + '">' + + !> Save the coordinates of all nodes + WRITE(i_fhandle, *) '<Points>' + WRITE(i_fhandle, "(A,I1,A)") '<DataArray type="Float32" NumberOfComponents="', & + 3 , '" format="ascii">' + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) r_nodecoor(:, i_cnt) + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Points>' + + !> Write the cell (element) information + WRITE(i_fhandle, *) '<Cells>' + + !> Save the node connectivity + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="connectivity" format="ascii">' + + + !> write element nodes. Write connectivity (indexing starts by 0!) + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_enodes(:, i_cnt) - 1 + END DO + WRITE(i_fhandle, *) '</DataArray>' + + !> Write the cell type (triangle = 5, tetrahedron = 10). + WRITE(i_fhandle, *) '<DataArray type="UInt8" Name="types" format="ascii">' + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) '5' + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="offsets" format="ascii">' + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_cnt * GRID_elementnodes + END DO + WRITE(i_fhandle, *) '</DataArray>' + WRITE(i_fhandle, *) '</Cells>' + + !> write point data + WRITE(i_fhandle, *) '<PointData>' + + !> Save the node numbers, when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Nodenumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_nnumber + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + !> Write the nodal variables, when present. + IF(PRESENT(i_nodedata) .AND. PRESENT(p_nodedata)) THEN + DO i_cnt = 1, i_nodedata + CALL write_vtu_data(i_fhandle, p_nodedata(i_cnt)) + END DO + END IF + + WRITE(i_fhandle, *) '</PointData>' + + + + !> write cell data + WRITE(i_fhandle, *) '<CellData>' + + !> save the element numbers, when requested. + IF(l_write_grid_info) THEN + WRITE(i_fhandle, *) '<DataArray type="Int32" Name="Elementnumber" format="ascii">' + + DO i_cnt = 1, p_mesh%i_enumfine + WRITE(i_fhandle, *) i_cnt + END DO + + WRITE(i_fhandle, *) '</DataArray>' + END IF + + !> Write the cell variables (when present) + IF(PRESENT(i_celldata) .AND. PRESENT(p_celldata)) THEN + DO i_cnt = 1, i_celldata + CALL write_vtu_data(i_fhandle, p_celldata(i_cnt)) + END DO + END IF + + !> write the footer. + WRITE(i_fhandle, *) '</CellData>' + WRITE(i_fhandle, *) '</Piece>' + WRITE(i_fhandle, *) '</UnstructuredGrid>' + WRITE(i_fhandle, *) '</VTKFile>' + + !> finally close the file and deallocate the data + CLOSE(i_fhandle) + DEALLOCATE(r_nodecoor, i_enodes) +END SUBROUTINE plot_vtu_elements +#endif !----3D output only + +!--------------------------------------------------------------------- +!> write_vtu_data writes a single variable (node or cell) to the +!! VTK file. +!> \param i_fhandle - the file handle +!> \param p_data - the variable +!--------------------------------------------------------------------- +SUBROUTINE write_vtu_data(i_fhandle, p_data) + IMPLICIT NONE + + INTEGER(KIND=GRID_SI), INTENT(IN) :: i_fhandle + TYPE(t_vtu_data) :: p_data + INTEGER(KIND=GRID_SI) :: i_size + INTEGER(KIND=GRID_SI) :: i_cnt + INTEGER(KIND=GRID_SI) :: i_cnt2 + + !> Special treatment for vector valued data + IF(p_data%i_size > 1) THEN + WRITE(i_fhandle, "(A,A,A,I1, A)") & + '<DataArray type="Float32" Name="', & + TRIM(p_data%c_name), '" NumberOfComponents="', & + p_data%i_size, '" format="ascii">' + ELSE + WRITE(i_fhandle, "(A,A,A)") '<DataArray type="Float32" Name="', & + TRIM(p_data%c_name), '" format="ascii">' + END IF + i_size = SIZE(p_data%p_vdata, 2) + + !> Write the data to file with respect to the threshold value + DO i_cnt = 1, i_size + DO i_cnt2 = 1, p_data%i_size + IF(ABS(p_data%p_vdata(i_cnt2, i_cnt)) < r_vtueps) & + p_data%p_vdata(i_cnt2, i_cnt) = 0 + END DO + + WRITE(i_fhandle, "(10e15.7)") p_data%p_vdata(1:p_data%i_size, i_cnt) + END DO + WRITE(i_fhandle, *) '</DataArray>' + +END SUBROUTINE write_vtu_data + +END MODULE IO_vtu diff --git a/flash2d/src/flash/IO_vtuplot.F90 b/flash2d/src/flash/IO_vtuplot.F90 new file mode 100644 index 0000000000000000000000000000000000000000..a3a2474bacdd90918a8689926bf21ed8f38fdd01 --- /dev/null +++ b/flash2d/src/flash/IO_vtuplot.F90 @@ -0,0 +1,166 @@ +!***************************************************************** +! +!> @file IO_vtuplot.F90 +!> @brief includes module IO_vtuplot +! +!***************************************************************** +! +! VERSION(S): +! 1. original version j. behrens 04/2000 +! 2. amatos-1.0 and 2D compliant j. behrens 11/2000 +! 3. adapted to flash2d j. behrens 12/2014 +! +!***************************************************************** +! MODULE DESCRIPTION: +!> prints data in VTU compatible file format +! +MODULE IO_vtuplot + USE FLASH_parameters + USE MISC_outputdata + USE GRID_api + USE IO_vtu + PRIVATE + INTEGER, SAVE :: i_timecounter= 0 + PUBLIC :: generate_vtu + CONTAINS + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE generate_vtu]: +!> @brief creates output in GMV compatible file format +!> +!> @param[in] p_handle grid handle for the linked lists +!> @param[in] i_time time step number +!> @param[in] i_newslevel the time level +!> +!> @note ON OUTPUT: a number of VTU compatible ascii files for each plotted time step +! + SUBROUTINE generate_vtu(p_handle, i_time, i_newslevel) + + IMPLICIT NONE + +!---------- local declarations + + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_time + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_newslevel + INTEGER (KIND = GRID_SI) :: i_alct, i_nnum, i_tnum + INTEGER (KIND = GRID_SI) :: i_nwl, i_elen, i_tcnt + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_val + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_velo + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_sta, r_lvl + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE :: i_ids, i_sta + CHARACTER (len=32) :: c_mfile + CHARACTER (len=26) :: c_tmp + LOGICAL :: l_news + INTEGER, PARAMETER :: i_vallen=5 + INTEGER, DIMENSION(i_vallen) :: i_valind + + TYPE(t_vtu_data), DIMENSION(2) :: celldata + TYPE(t_vtu_data), DIMENSION(4) :: nodedata + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name(1:20)) + write(c_mfile,10101) trim(c_tmp), '_', i_tcnt + c_tmp = adjustl(c_mfile) + write(c_mfile,*) TRIM(c_tmp), '.vtu' + c_mfile= adjustl(c_mfile) + +!---------- handle news level + + IF(present(i_newslevel)) THEN + l_news=.TRUE. + i_nwl= i_newslevel + ELSE + l_news=.FALSE. + END IF + +!---------- the nodes + + i_nnum = p_handle%i_nnumber + +!---------- extract nodal grid data and nodal values + + ALLOCATE(r_val(i_vallen, i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate values array') + END IF + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_phi, GRID_zeta, GRID_tracer/) + CALL grid_getinfo(p_handle, r_nodevalues= r_val, i_arraypoint=i_valind) + +!---------- assign nodal values, but before allocate aux. arrays + + ALLOCATE(r_velo(2,i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate aux. velo arrays') + END IF + +!---------- generate 2D velocity field + + r_velo(1:2,:)= r_val(1:2,:) + + nodedata(1)%c_name = 'velocity' + nodedata(1)%i_size = 2 + nodedata(1)%p_vdata => r_velo + + nodedata(2)%c_name = 'height' + nodedata(2)%i_size = 1 + nodedata(2)%p_vdata => r_val(3:3,:) + + nodedata(3)%c_name = 'vorticity' + nodedata(3)%i_size = 1 + nodedata(3)%p_vdata => r_val(4:4,:) + + nodedata(4)%c_name = 'tracer' + nodedata(4)%i_size = 1 + nodedata(4)%p_vdata => r_val(5:5,:) + +!---------- extract cells grid data + + i_tnum= p_handle%i_enumfine + ALLOCATE(i_ids(i_tnum), i_sta(i_tnum), r_sta(1,i_tnum), r_lvl(1,i_tnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate cell value arrays') + END IF + IF(l_news) THEN + CALL grid_getinfo(p_handle, i_newsdepth= i_nwl, i_elength= i_elen, & + i_elementlevel= i_ids, i_elementstatus= i_sta) + i_tnum= i_elen + ELSE + CALL grid_getinfo(p_handle, i_elementlevel= i_ids, i_elementstatus= i_sta) + END IF + + r_sta(1, :) = REAL(i_sta, GRID_SR) + r_lvl(1, :) = REAL(i_ids, GRID_SR) + + ! Assign all values to driver + celldata(1)%c_name = 'status' + celldata(1)%i_size = 1 + celldata(1)%p_vdata => r_sta + + celldata(2)%c_name = 'level' + celldata(2)%i_size = 1 + celldata(2)%p_vdata => r_lvl + + ! plot the vtu data + CALL plot_vtu(p_handle, c_mfile, i_nodedata = 4, p_nodedata = nodedata, & + i_celldata = 2, p_celldata = celldata, i_zcoordinate = 4) + + DEALLOCATE(i_ids, i_sta, r_sta, r_lvl, & + r_val, r_velo) + + RETURN + +!---------- FORMAT + 10101 FORMAT(a19,a1,i6.6) + + END SUBROUTINE generate_vtu + +END MODULE IO_vtuplot diff --git a/flash2d/src/flash/MISC_outputdata.F90 b/flash2d/src/flash/MISC_outputdata.F90 new file mode 100644 index 0000000000000000000000000000000000000000..5b4f09f68e2f7a5c7afecbf7f3902a17b8dc3ca8 --- /dev/null +++ b/flash2d/src/flash/MISC_outputdata.F90 @@ -0,0 +1,155 @@ +!***************************************************************** +! +!> @file MISC_outputdata.F90 +!> @brief includes module MISC_outputdata +! +!***************************************************************** +! +! VERSION(S): +! +!***************************************************************** +! MODULE DESCRIPTION: +!> This module contains routines for retrieving some additional data +!> for plotting from standard grids (no grid variables required) +! +MODULE MISC_outputdata + + USE GRID_api + + PUBLIC :: data_markededgevector, data_sfcvector + + PRIVATE + + CONTAINS +!***************************************************************** +! DESCRIPTION of [SUBROUTINE ]: +!> @brief short description +!> +!> @param p_mesh +!> @param r_sfc +! + SUBROUTINE DATA_sfcvector(p_mesh, r_sfc) + + IMPLICIT NONE + + TYPE(GRID_handle), INTENT(IN) :: p_mesh + REAL(KIND=GRID_SR), INTENT(OUT), DIMENSION(:,:) :: r_sfc + + REAL(KIND=GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint1 + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint2 + + INTEGER(KIND=GRID_SI) :: i_ecnt, i_ncnt +!- allocate the needed memory + ALLOCATE( r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine)) + + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_elementnodes = i_enodes) + +! initialize data + r_midpoint2 = 0_GRID_SR + + DO i_ncnt = 1, GRID_elementnodes + r_midpoint2 = r_midpoint2 + r_nodecoor(:,i_enodes(i_ncnt, 1)) + END DO + + r_midpoint2 = 1_GRID_SR / REAL(GRID_elementnodes, GRID_SR) * r_midpoint2 + + DO i_ecnt = 1, p_mesh%i_enumfine - 1 + r_midpoint1 = r_midpoint2 + + r_midpoint2 = 0_GRID_SR + DO i_ncnt = 1, GRID_elementnodes + r_midpoint2 = r_midpoint2 + r_nodecoor(:,i_enodes(i_ncnt, i_ecnt+1)) + END DO + + r_midpoint2 = 1_GRID_SR / REAL(GRID_elementnodes, GRID_SR) * r_midpoint2 + + r_sfc(1:2, i_ecnt)=r_midpoint2 - r_midpoint1 + + r_sfc(3, i_ecnt) = 0.0 + + END DO + + r_sfc(:, p_mesh%i_enumfine) = 0_GRID_SR + + DEALLOCATE( r_nodecoor, i_enodes ) + END SUBROUTINE DATA_sfcvector + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE ]: +!> @brief short description +!> +!> @param p_mesh +!> @param r_mvec +! + SUBROUTINE DATA_markededgevector(p_mesh, r_mvec) + + IMPLICIT NONE + + TYPE(GRID_handle), INTENT(IN) :: p_mesh + REAL(KIND=GRID_SR), INTENT(OUT), DIMENSION(:, :) :: r_mvec + + REAL(KIND=GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nodecoor + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_gnodes + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enodes + INTEGER(KIND=GRID_SI), DIMENSION(:), ALLOCATABLE :: i_emark + INTEGER(KIND=GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_eedges + + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_midpoint + REAL(KIND=GRID_SR), DIMENSION(GRID_dimension) :: r_egpoint + + INTEGER(KIND=GRID_SI) :: i_ncnt, i_ecnt + INTEGER(KIND=GRID_SI) :: i_markededge + +!- allocate the needed memory + ALLOCATE( r_nodecoor(GRID_dimension, p_mesh%i_nnumber), & + i_gnodes(GRID_edgenodes, p_mesh%i_gnumfine), & + i_enodes(GRID_elementnodes, p_mesh%i_enumfine), & + i_emark(p_mesh%i_enumfine), & + i_eedges(GRID_elementedges, p_mesh%i_enumfine)) + +!- get the needed information from mesh + CALL GRID_getinfo(p_mesh, r_nodecoordinates = r_nodecoor, & + i_edgenodes = i_gnodes, & + i_elementnodes = i_enodes, & + i_elementmark = i_emark, & + i_elementedges = i_eedges, & + l_finelevel = .TRUE.) + + DO i_ecnt = 1, p_mesh%i_enumfine + r_midpoint = 0_GRID_SR + + DO i_ncnt = 1, GRID_elementnodes + r_midpoint = r_midpoint + r_nodecoor(:,i_enodes(i_ncnt, i_ecnt)) + END DO + + r_midpoint = 1._GRID_SR/REAL(GRID_elementnodes, GRID_SR) * r_midpoint + + i_markededge = i_eedges(i_emark(i_ecnt), i_ecnt) + + r_egpoint = 0_GRID_SR + DO i_ncnt = 1, GRID_edgenodes + r_egpoint = r_egpoint + r_nodecoor(:,i_gnodes(i_ncnt, i_markededge)) + END DO + + r_egpoint = 1._GRID_SR/REAL(GRID_edgenodes, GRID_SR) * r_egpoint + + r_mvec(1:2, i_ecnt) = r_egpoint - r_midpoint + r_mvec(3, i_ecnt) = 0.0 + END DO + +!- deallocate + DEALLOCATE( r_nodecoor, & + i_gnodes, & + i_enodes, & + i_emark, & + i_eedges) + + END SUBROUTINE DATA_markededgevector + +!***************************************************************** +END MODULE MISC_outputdata diff --git a/flash2d/src/flash/README b/flash2d/src/flash/README new file mode 100644 index 0000000000000000000000000000000000000000..2990304b681fe9493d5d31c52e238b0eca957b09 --- /dev/null +++ b/flash2d/src/flash/README @@ -0,0 +1,48 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/lib" + +ADV_rhs.f - Module for calculating Right Hand Side +ADV_rhs.gerrit - Module for Right Hand Side (Aerosol Exper.) +ADV_rhs.hom - Module for Right Hand Side (homogeneous RHS) +ADV_semilagrange.dual - Module for SLM with dual grid approach +ADV_semilagrange.f - Module for SLM +ADV_wind.bar - Module for wind field (shear stress example) +ADV_wind.constant - Module for wind field (constant wind for Slotted Cyl.) +ADV_wind.f - Module for wind field +ADV_wind.file - Module for wind field (read wind field from file) +Flash90.f - Main program +gridgen - directory for the grid generator +IO_plot.f - Module for the plotting routines +IO_plotdefine.f - Module for definitions in plotting routines +IO_utils.f - Module for IO utility routines +MISC_globalparam.f - Module for global parameter definitions +MISC_timing.f - Module for the timing routines +README - this file +SLM_errorestimate.f - Module for the error estimation calculation +SLM_initial.bar - Module for the initial values (shear stress example) +SLM_initial.f - Module for the initial values +SLM_initial.file - Module for the initial values (read from file) +SLM_initial.gerrit - Module for the initial values (Aerosol Exper.) +SLM_initial.slot - Module for the initial values (Slotted Cyl.) +SLM_interpolation.clip - Module for SLM interpolation (clipping) +SLM_interpolation.cons - Module for SLM interpolation (quasi conservative) +SLM_interpolation.f - Module for SLM interpolation +SLM_interpolation.plain - Module for SLM interpolation (plain bicubic) +system - directory for system dependent routines +utils - directory for utility programs + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +just look around, find better ways... + +************************************************************************** + j. behrens, 8/98 +************************************************************************** diff --git a/flash2d/src/flash/SLM_advanced.f90 b/flash2d/src/flash/SLM_advanced.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ca6dfec9a3e032b7cbbd33b3c9a90706899d5107 --- /dev/null +++ b/flash2d/src/flash/SLM_advanced.f90 @@ -0,0 +1,381 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + + + END MODULE SLM_advanced diff --git a/flash2d/src/flash/SLM_errorestimate.f90 b/flash2d/src/flash/SLM_errorestimate.f90 new file mode 100644 index 0000000000000000000000000000000000000000..08463f44ae61b374ef6bd19034bd1b9b96cb609f --- /dev/null +++ b/flash2d/src/flash/SLM_errorestimate.f90 @@ -0,0 +1,144 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_errorestimate +! FUNCTION: +! provide an error estimator for the adaptive SLM scheme +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_error +! FUNCTION: +! estimate the error elementwise +! SYNTAX: +! real= slm_error(real.arr) +! ON INPUT: +! r_v: values at element nodes REAL +! ON OUTPUT: +! r_esterr: estimated error REAL +! CALLS: +! +! COMMENTS: +! this is only a simple estimator based on local gradients +!----------------------------------------------------------------- +! +! NAME: +! slm_errorest +! FUNCTION: +! this hides the loop structure from the advection part +! SYNTAX: +! CALL slm_errorest(grid, int, real.arr) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! i_siz: size of array for local errors INTEGER +! ON OUTPUT: +! i_siz: size of array for local errors INTEGER +! r_arr: estimated error REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_errorest +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 11/96 +! 2. nodal values time depend. j. behrens 1/97 +! 3. FEM_handle added j. behrens 7/97 +! 4. version with hashing j. behrens 7/97 +! 5. changed to use GRID_api j. behrens 11/97 +! 6. compliant to amatos 1.0 j. behrens 12/2000 +! 7. compliant to amatos 1.2 j. behrens 3/2002 +! 8. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_errorestimate + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_errorest + CONTAINS +!***************************************************************** + FUNCTION slm_error(r_v) RESULT (r_esterr) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_v + REAL (KIND = GRID_SR) :: r_esterr + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1.0/3.0) + REAL (KIND = GRID_SR) :: r_d1, r_d2, r_d3 + +!---------- calculate differences + + r_d1 = abs(r_v(1)- r_v(2)) + r_d2 = abs(r_v(2)- r_v(3)) + r_d3 = abs(r_v(3)- r_v(1)) + +!---------- this is the estimated error + + r_esterr= (r_d1+ r_d2+ r_d3)* r_1o3 + + RETURN + END FUNCTION slm_error + +!***************************************************************** + SUBROUTINE slm_errorest(p_ghand, i_siz, r_arr) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER, INTENT(in) :: i_siz + REAL (KIND = GRID_SR), DIMENSION(:), INTENT(out) :: r_arr + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enods + INTEGER :: i_cnt, i_size, i_alct, i_nnum + INTEGER, DIMENSION(1) :: i_valind + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_tmp + +!---------- allocate auxilliary array + + i_size= p_ghand%i_enumfine + i_nnum= p_ghand%i_nnumber + IF(i_siz /= i_size) THEN + CALL grid_error(48) + END IF + + ALLOCATE(r_aux(1,i_nnum), & + i_enods(GRID_elementnodes,i_size), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(49) + END IF + +!---------- get values + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_arraypoint=i_valind, & + r_nodevalues= r_aux, i_elementnodes=i_enods) + +!---------- loop through all elements of finest loop + + elmt_loop: DO i_cnt=1,i_siz + r_tmp(1:GRID_elementnodes)= r_aux(1,i_enods(1:GRID_elementnodes,i_cnt)) + r_arr(i_cnt)= slm_error(r_tmp) + END DO elmt_loop + +!---------- deallocate and exit + + DEALLOCATE(r_aux, i_enods) + + RETURN + END SUBROUTINE slm_errorest + + END MODULE SLM_errorestimate diff --git a/flash2d/src/flash/SLM_initial.f90 b/flash2d/src/flash/SLM_initial.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c3dd7ddf53a1f43a3c8da07845976e5ac70ad6ca --- /dev/null +++ b/flash2d/src/flash/SLM_initial.f90 @@ -0,0 +1,495 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=4.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + cyl_slot: IF(p_ghand%i_maxlvl < i_lev) THEN + CALL slm_initcylndr(p_ghand) + ELSE cyl_slot + CALL slm_initslot(p_ghand) + END IF cyl_slot + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.36361e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- initialize some constants for the slotted cylinder + + r_centr(1)= -cos(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + r_centr(2)= -sin(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + r_ads= r_swd* 0.5_GRID_SR + r_bds= r_srd- r_sln + r_cds= r_srd + r_f1 = (r_rad- r_ads)/ r_rad + r_f2 = (r_rad+ r_ads)/ r_rad + r_p1 = abs(r_centr) + r_xya= sum(r_p1) + IF(r_xya == 0.0_GRID_SR) THEN + r_fc= 0.0_GRID_SR + ELSE + r_fc(1)= -r_centr(2)/ r_xya + r_fc(2)= r_centr(1)/ r_xya + END IF + +!---------- calculate endpoints of the slot + + r_p1= r_f1* r_centr + r_p2= r_f2* r_centr + + r_pa= r_p1+ r_fc* r_bds + r_pb= r_p1+ r_fc* r_cds + r_pc= r_p2+ r_fc* r_cds + r_pd= r_p2+ r_fc* r_bds + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= 0.0 + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_array(i_count)= r_hgt + l_aux= in_side(r_coo(:,i_count), r_pa, r_pb, r_pc) + IF(l_aux) r_array(i_count)= 0.0 + l_aux= in_side(r_coo(:,i_count), r_pa, r_pc, r_pd) + IF(l_aux) r_array(i_count)= 0.0 + END IF inside + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initslot(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constants for the slotted cylinder + + r_centr= r_cntr + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + r_ads= r_swd* 0.5_GRID_SR + r_bds= r_srd- r_sln + r_cds= r_srd + r_f1 = (r_rad- r_ads)/ r_rad + r_f2 = (r_rad+ r_ads)/ r_rad + r_p1 = abs(r_centr) + r_xya= sum(r_p1) + IF(r_xya == 0.0_GRID_SR) THEN + r_fc= 0.0_GRID_SR + ELSE + r_fc(1)= -r_centr(2)/ r_xya + r_fc(2)= r_centr(1)/ r_xya + END IF + +!---------- calculate endpoints of the slot + + r_p1= r_f1* r_centr + r_p2= r_f2* r_centr + + r_pa= r_p1+ r_fc* r_bds + r_pb= r_p1+ r_fc* r_cds + r_pc= r_p2+ r_fc* r_cds + r_pd= r_p2+ r_fc* r_bds + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(1,i_count)= r_hgt + l_aux= in_side(r_coo(:,i_count), r_pa, r_pb, r_pc) + IF(l_aux) r_aux(1,i_count)= 0.0 + l_aux= in_side(r_coo(:,i_count), r_pa, r_pc, r_pd) + IF(l_aux) r_aux(1,i_count)= 0.0 + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslot + +!***************************************************************** + SUBROUTINE slm_initcylndr(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= r_srd* r_srd + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcylndr + + END MODULE SLM_initial diff --git a/flash2d/src/flash/SLM_simple.f90 b/flash2d/src/flash/SLM_simple.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a9e7808f36e6b2fea9755b65b4cf2fdc99dfb75d --- /dev/null +++ b/flash2d/src/flash/SLM_simple.f90 @@ -0,0 +1,388 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide simple semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS + +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants +!DEBUG: + write(*,*) 'DEGBUG: entering slm_displace' + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5* p_param%num%r_deltatime + r_dt2= 1.5* p_param%num%r_deltatime + r_fac= 0.5 + r_caf= 2.0 + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0 + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0 + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant +!DEBUG: + write(*,*) 'DEGBUG: entering slm_interpolate' + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain +!DEBUG: +! write(*,*) 'DEGBUG: calling grid_domaincheck with r_upstr, r_coord:', r_upstr(:,i_cnt), r_coord(:,i_cnt) + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0 + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + + END MODULE SLM_simple diff --git a/flash2d/src/options-sphere/ADV_semilagrange.adv.F90 b/flash2d/src/options-sphere/ADV_semilagrange.adv.F90 new file mode 100644 index 0000000000000000000000000000000000000000..874438e9980713bd9cb0bac846fc43e06fb484ce --- /dev/null +++ b/flash2d/src/options-sphere/ADV_semilagrange.adv.F90 @@ -0,0 +1,882 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!-SLM--------- insert a full advanced SLM step here, if required +!-SLM--------- retrieve coordinates of grid points + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_tracer(i_size), r_coord(GRID_dimension,i_size), stat=i_alct) + not_allocfinal: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_coord) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, r_coord, r_tracer) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_size), stat=i_alct) + not_allocfinal1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options-sphere/ADV_semilagrange.sim.F90 b/flash2d/src/options-sphere/ADV_semilagrange.sim.F90 new file mode 100644 index 0000000000000000000000000000000000000000..eaf4620832280ed441407dd4d9be110d2c97e414 --- /dev/null +++ b/flash2d/src/options-sphere/ADV_semilagrange.sim.F90 @@ -0,0 +1,850 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options-sphere/ADV_wind.div b/flash2d/src/options-sphere/ADV_wind.div new file mode 100644 index 0000000000000000000000000000000000000000..35998274aa9cac181456c64caa06faef7abe9b8d --- /dev/null +++ b/flash2d/src/options-sphere/ADV_wind.div @@ -0,0 +1,150 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! 4. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + REAL :: r_u0 + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time, r_lamphi) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical), OPTIONAL :: r_lamphi + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_angl=0.0 + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lp, r_zetet, r_gup +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kup + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate spherical coordinates + + IF(present(r_lamphi)) THEN + r_lp= r_lamphi + ELSE + r_lp= grid_kartgeo(r_coord) + END IF + +!---------- calculate wind vector in spherical coordinates + + r_zetet(1)= r_u0* cos(r_lp(2)) + r_zetet(2)= r_u0* sin(r_lp(2)) + +!---------- calculate wind vector in kartesian coordinates + + r_field= kartwind(r_zetet,r_lp) + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + +!---------- calculate velocity factor (one revolution after 12 days/ +! 576 time steps of half an hour) + + r_u0= (2.0* GRID_PI* GRID_RADIUS)/1.0368e6 + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION kartwind(r_lamphi, r_lpcoor) RESULT (r_kart) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lamphi, r_lpcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kart + REAL (KIND = GRID_SR) :: r_sl, r_cl, r_sp, r_cp + +!---------- calculate constants + + r_sl= sin(r_lpcoor(1)) + r_cl= cos(r_lpcoor(1)) + r_sp= sin(r_lpcoor(2)) + r_cp= cos(r_lpcoor(2)) + +!---------- calculate 3D kartesian components + + r_kart(1)= -r_sl* r_lamphi(1)- r_sp* r_cl* r_lamphi(2) + r_kart(2)= r_cl* r_lamphi(1)- r_sp* r_sl* r_lamphi(2) + r_kart(3)= r_cp* r_lamphi(2) + + RETURN + END FUNCTION kartwind + +!***************************************************************** + END MODULE ADV_wind + diff --git a/flash2d/src/options-sphere/ADV_wind.mvortex b/flash2d/src/options-sphere/ADV_wind.mvortex new file mode 100644 index 0000000000000000000000000000000000000000..187b297cb2177b94376355596fff0dc95077034a --- /dev/null +++ b/flash2d/src/options-sphere/ADV_wind.mvortex @@ -0,0 +1,321 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! 4. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + REAL (KIND = GRID_SR) :: r_u0 + REAL (KIND=GRID_SR) :: r_beta = 0._GRID_SR * 0.785398163397448279_GRID_SR ! Check SLM_initial when changing this value!!! + + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time, r_lamphi) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical), OPTIONAL :: r_lamphi + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_angl=0.0 + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lp, r_zetet, r_gup +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kup + +!---------- Nairs variables + + REAL (KIND = GRID_SR) :: r_scale, r_unot, r_vnot + + REAL (KIND = GRID_SR) :: r_lm0, r_th0 ! initial vortex center + REAL (KIND = GRID_SR) :: r_s_alpha, r_c_alpha + REAL (KIND = GRID_SR) :: r_lmc, r_thc ! north pole coordinates + REAL (KIND = GRID_SR) :: r_ldt, r_tdt + REAL (KIND = GRID_SR) :: r_pl, r_pt ! vortex position + REAL (KIND = GRID_SR) :: r_th, r_lm ! point of interest + REAL (KIND = GRID_SR) :: r_rl, r_rt + REAL (KIND = GRID_SR) :: r_rd, r_vmax + REAL (KIND = GRID_SR) :: r_rth, r_rlm ! rotated theta and lambda? + REAL (KIND = GRID_SR) :: r_rho ! density + REAL (KIND = GRID_SR) :: r_tt, r_tv + REAL (KIND = GRID_SR) :: r_omg, r_trm + REAL (KIND = GRID_SR) :: r_us, r_vs ! solid body tangential velocities + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate spherical coordinates + + IF(present(r_lamphi)) THEN + r_lp= r_lamphi + ELSE + r_lp= grid_kartgeo(r_coord) + END IF + +!---------- calculate wind vector in spherical coordinates + +!---------- Parameters for a unit sphere (see dynamic_vortex.f, Nair) + + r_scale = 2._GRID_SR*GRID_PI / float(1036800) !12 days scale + r_unot = 2._GRID_SR*GRID_PI / float(1036800) !12 dyas rate + r_vnot = 2._GRID_SR*GRID_PI / float(1036800) + + r_lm0 = 1.5_GRID_SR * GRID_PI !intial center position (3pi/2,0) + r_th0 = 0.0_GRID_SR + + r_c_alpha = cos(r_beta) + r_s_alpha = sin(r_beta) + +!*--------Note: +!* keep the vortex position (pl,pt) "fixed" and rotate the background +!* away by "unot*dtime*ditn" units from its initial position on +!* the latitudes of a rotated sphere. Transform back to the regular coordinates +!* and form the vortex with center at the "fixed" position (pl,pt). +!* + +!---------- To find the central position of the distribution as a function of alpha and time + + r_lmc = 0._GRID_SR + r_thc = 0.5_GRID_SR * GRID_PI - r_beta + r_ldt = r_lm0 + r_unot * r_time + r_tdt = r_th0 + 0._GRID_SR + CALL rotated_sphere(r_lmc,r_thc,r_ldt,r_tdt,r_rl,r_rt) + + r_pl = r_rl + r_pt = r_rt + + !vortex parameters (Nair & Machenhauer 2002) + + r_rd = 3.0_GRID_SR + r_vmax = 1.5_GRID_SR *sqrt(3.0_GRID_SR) + +!----------- Analytic Vortex field at any given time (iteration) +!----------- Smooth Vortex making parameters + + r_lm = r_lp(1) + r_th = r_lp(2) + + CALL rotated_sphere(r_pl,r_pt,r_lm,r_th,r_rlm, r_rth) + + r_rho = r_rd * cos(r_rth) + r_tt = tanh(r_rho) + r_tv = (1.0_GRID_SR - r_tt*r_tt) * r_tt * r_vmax + + if (r_rho == 0.0_GRID_SR ) then + r_omg = 0.0_GRID_SR + else + r_omg = r_tv / r_rho + endif + + + ! Solid body rotation flow + r_us = r_unot * (cos(r_th)*r_c_alpha + sin(r_th)*cos(r_lm)*r_s_alpha) + r_vs =-r_unot * sin(r_lm)*r_s_alpha + +! r_us = 0._GRID_SR ! for no solid body rotation flow +! r_vs = 0._GRID_SR + + ! tangential velocity ( solid body rotation + vortex) + r_zetet(1)= r_us + r_vnot * r_omg * (sin(r_pt)*cos(r_th) - & + cos(r_pt)*cos(r_lm - r_pl)*sin(r_th)) + r_zetet(2)= r_vs + r_vnot * r_omg * (cos(r_pt)*sin(r_lm - r_pl)) + + +!---------- calculate wind vector in kartesian coordinates + +! r_gup= r_lp- r_zetet +! r_kup=grid_geokart(r_gup) +! r_field= r_kup- r_coord + r_field= kartwind(r_zetet,r_lp) + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + +!---------- calculate velocity factor (one revolution after 12 days/ +! 576 time steps of half an hour) + + r_u0= (2.0_GRID_SR* GRID_PI* GRID_RADIUS)/1.0368e6_GRID_SR + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION kartwind(r_lamphi, r_lpcoor) RESULT (r_kart) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lamphi, r_lpcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_kart + REAL (KIND = GRID_SR) :: r_sl, r_cl, r_sp, r_cp + +!---------- calculate constants + + r_sl= sin(r_lpcoor(1)) + r_cl= cos(r_lpcoor(1)) + r_sp= sin(r_lpcoor(2)) + r_cp= cos(r_lpcoor(2)) + +!---------- calculate 3D kartesian components + + r_kart(1)= -r_sl* r_lamphi(1)- r_sp* r_cl* r_lamphi(2) + r_kart(2)= r_cl* r_lamphi(1)- r_sp* r_sl* r_lamphi(2) + r_kart(3)= r_cp* r_lamphi(2) + + RETURN + END FUNCTION kartwind + +!***************************************************************** + +!******************************************************************* +!* Ram Nair (Ncar/SCD) 08/06 +!* Rotate a sphere so that its NP is at (lc,tc). The rotated coordinates +!* (rol,rot) corresponding to (la,th) in the regular Sph. coordinates +!******************************************************************* + SUBROUTINE Rotated_Sphere(lc,tc,la,th,rol,rot) +!* +! include 'params.h' +! include 'const.h' +!* + + + IMPLICIT NONE + REAL (KIND = GRID_SR), INTENT(in) :: lc,tc,la,th !In + REAL (KIND = GRID_SR), INTENT(out) :: rol,rot !Out + + REAL (KIND = GRID_SR) :: cost,sint,sinc,cosc + REAL (KIND = GRID_SR) :: trm, trm1,trm2,trm3 + REAL (KIND = GRID_SR) :: twopi + + twopi=2._GRID_SR * GRID_PI + + sinc = sin(tc) + cosc = cos(tc) + cost = cos(th) + sint = sin(th) + + trm = cost * cos(la- lc) + trm1 = cost * sin(la- lc) + trm2 = sinc * trm - cosc * sint + trm3 = sinc * sint + cosc * trm + + rol = atan2(trm1,trm2) + if (rol > twopi) rol = rol - twopi + if (rol < 0.0_GRID_SR ) rol = rol + twopi + rot = asin(trm3) + + RETURN + END SUBROUTINE Rotated_Sphere + + +!******************************************************************* +!* Ram Nair (Ncar/SCD) 10/06 +!*Rotate a sphere back to the regular (rla,rth) coordinates from +!* a totated sphere whose NP is at (lmc,thc). The unrotated coordinates +!*(rla,rth) corresponds to the (lam,the) of the rotated Sphere +!******************************************************************* + SUBROUTINE Rotate_Back(lmc,thc,lam,the,rla,rth) +!* +! include 'params.h' +! include 'const.h' +!* + + IMPLICIT NONE + REAL (KIND = GRID_SR), INTENT(in) :: lmc,thc,lam,the !In + REAL (KIND = GRID_SR), INTENT(out) :: rla,rth !Out + + REAL (KIND = GRID_SR) :: cost,sint,cosp,sinp,clam,slam + REAL (KIND = GRID_SR) :: trm, t1,t2,t3 + REAL (KIND = GRID_SR) :: twopi + + + twopi=2._GRID_SR * GRID_PI + +!* Back to unrotated system + cost = cos(the) + sint = sin(the) + clam = cos(lam) + slam = sin(lam) + cosp = cos(thc) + sinp = sin(thc) + t1 = slam * cost + t2 = sint*cosp + cost*clam*sinp + t3 = sint*sinp - cost*clam*cosp + rla = lmc + atan2(t1,t2) + if (rla < 0.0 ) rla = rla + twopi + if (rla > twopi ) rla = rla - twopi + rth = asin(t3) + + RETURN + END SUBROUTINE Rotate_Back + + END MODULE ADV_wind + + diff --git a/flash2d/src/options-sphere/SLM_advanced.cellint.f90 b/flash2d/src/options-sphere/SLM_advanced.cellint.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bc137e2921e64e97f341317f47077cabfe579308 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_advanced.cellint.f90 @@ -0,0 +1,631 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER (KIND = GRID_SI), INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER (KIND = GRID_SI) :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER (KIND = GRID_SI), DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER (KIND = GRID_SI) :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- check newslevel (Not supported for Cell-integrated scheme due to dual) + + IF(present(i_newsdepth)) THEN + CALL grid_error(c_error='[slm_astep]: no newslevel in Cell-Integrated Scheme supported') + END IF + IF(i_size /= p_ghand(i_timeplus)%i_nnumber) THEN + CALL grid_error(c_error='[slm_astep]: incompatible array size') + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + CALL grid_createdual_donald(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER (KIND = GRID_SI), INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc, r_sxy + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER (KIND = GRID_SI) :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_coord(:,i_cnt1),r_sxy) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_dcoord(:,i_cnt1),r_sxy) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER (KIND = GRID_SI) :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER (KIND = GRID_SI), INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER (KIND = GRID_SI), DIMENSION(2,2*GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER (KIND = GRID_SI) :: i_alct, i_cnt, & + j_cnt, i_tnc, i_oarlen, i_fill, i_len, i_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux1 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux2 + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_conc + REAL (KIND = GRID_SR) :: r_onethird= 1._GRID_SR/3._GRID_SR + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_enods + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_part, r_isarea + REAL (KIND = GRID_SR), EXTERNAL :: triatria_isectar + REAL (KIND = GRID_SR) :: r_xmax, r_ymax, r_xmin, r_ymin + REAL (KIND = GRID_SR) :: r_maxx, r_maxy, r_minx, r_miny + REAL (KIND = GRID_SR) :: r_mass + INTEGER (KIND = GRID_SI), DIMENSION(:), POINTER :: i_triang + REAL (KIND = GRID_SR), DIMENSION(:), POINTER :: r_area + INTEGER (KIND = GRID_SI), DIMENSION(1) :: i_valind + + +!---------- allocate auxilliary arrays + + i_oarlen= p_mesh(i_time)%i_enumfine + allocate(r_aux1(GRID_dimension,i_oarlen), & + r_aux2(1,i_oarlen), i_enods(GRID_elementnodes,i_oarlen), & + r_conc(i_oarlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + i_valind= (/ GRID_tracer /) + +!---------- get info from old grid to calculate mass elements + + CALL grid_getinfo(p_mesh(i_time), r_nodecoordinates= r_aux1, & + i_elementnodes=i_enods, i_arraypoint=i_valind, & + r_nodevalues= r_aux2, l_finelevel=.TRUE.) + +!---------- calculate concentration in elements + + conc_calc: DO i_cnt=1,i_oarlen + r_conc(i_cnt)= r_onethird* (r_aux2(1,i_enods(1,i_cnt))+ & + r_aux2(1,i_enods(2,i_cnt))+ r_aux2(1,i_enods(3,i_cnt))) + END DO conc_calc + +!---------- now the main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_mass= 0.0_GRID_SR + r_narea= 0.0_GRID_SR + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(:,1)= grid_kartgeo(r_coord(:,i_cnt)- r_alpha(:,i_cnt)) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + dual_ptch_loop: DO i_tnc= 1, 2*GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT dual_ptch_loop + ELSE + +!---------- nullify pointer arrays + + NULLIFY(i_triang,r_area) + +!---------- the upstream dual element's outer nodes + + r_vertx(:,2)= grid_kartgeo(r_dcoord(:,i_dedge(1,i_tnc,i_cnt))- r_dalpha(:,i_dedge(1,i_tnc,i_cnt))) + r_vertx(:,3)= grid_kartgeo(r_dcoord(:,i_dedge(2,i_tnc,i_cnt))- r_dalpha(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- calculate downstream area around primal node + + r_narea= r_narea+ triang_area(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- calculate intersection + + CALL grid_polygridintersect(p_mesh(i_time),GRID_elementnodes,r_vertx,& + i_len, i_triang, r_area, .TRUE.) + + DO j_cnt=1,i_len + i_tmp= i_triang(j_cnt) + r_mass= r_mass + r_area(j_cnt)* r_conc(i_tmp) + END DO + + IF(ASSOCIATED(i_triang)) THEN + DEALLOCATE(i_triang) + NULLIFY(i_triang) + END IF + IF(ASSOCIATED(r_area)) THEN + DEALLOCATE(r_area) + NULLIFY(r_area) + END IF + END IF + END DO dual_ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_mass/r_narea + + END DO node_loop + +!---------- deallocate auxilliary arrays + + deallocate(r_aux1, r_aux2, r_conc, i_enods) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + + REAL (KIND = GRID_SR) :: r_sum, r_hav, & + r_a, r_b, r_c, r_s, r_t, r_e + REAL (KIND = GRID_SR) :: r_halfpi + REAL (KIND = GRID_SR), PARAMETER :: r_degree=57.295779513082320876798 ! degrees per radian + REAL (KIND = GRID_SR) :: r_cosb1, r_cosb2, r_cosb3 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lam1, r_lam2, r_lam3 + +!---------- initialization + + r_sum= 0.0_GRID_SR + r_halfpi=GRID_PI*0.5_GRID_SR + +!---------- calculate spherical coordinates + + r_lam1= grid_kartgeo(r_coord1) + r_lam2= grid_kartgeo(r_coord2) + r_lam3= grid_kartgeo(r_coord3) + +!---------- calculate cosines + + r_cosb1= cos(r_lam1(2)) + r_cosb2= cos(r_lam2(2)) + r_cosb3= cos(r_lam3(2)) + +!---------- for all three pairs do the excess calculation + + IF(r_lam1(1) /= r_lam2(1)) THEN + r_hav= hav(r_lam2(2)- r_lam1(2))+ r_cosb1*r_cosb2*hav(r_lam2(1)- r_lam1(1)) + r_a = 2.0_GRID_SR* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam2(2) + r_c = r_halfpi- r_lam1(2) + r_s = 0.5_GRID_SR* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5_GRID_SR)* tan((r_s-r_a)*0.5_GRID_SR)* tan((r_s-r_b)*0.5_GRID_SR)* tan((r_s-r_c)*0.5_GRID_SR) + r_e = abs(4.0_GRID_SR* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam1(1) > r_lam2(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam2(1) /= r_lam3(1)) THEN + r_hav= hav(r_lam3(2)- r_lam2(2))+ r_cosb2*r_cosb3*hav(r_lam3(1)- r_lam2(1)) + r_a = 2.0_GRID_SR* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam3(2) + r_c = r_halfpi- r_lam2(2) + r_s = 0.5_GRID_SR* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5_GRID_SR)* tan((r_s-r_a)*0.5_GRID_SR)* tan((r_s-r_b)*0.5_GRID_SR)* tan((r_s-r_c)*0.5_GRID_SR) + r_e = abs(4.0_GRID_SR* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam2(1) > r_lam3(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam3(1) /= r_lam1(1)) THEN + r_hav= hav(r_lam1(2)- r_lam3(2))+ r_cosb3*r_cosb1*hav(r_lam1(1)- r_lam3(1)) + r_a = 2.0_GRID_SR* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam1(2) + r_c = r_halfpi- r_lam3(2) + r_s = 0.5_GRID_SR* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5_GRID_SR)* tan((r_s-r_a)*0.5_GRID_SR)* tan((r_s-r_b)*0.5_GRID_SR)* tan((r_s-r_c)*0.5_GRID_SR) + r_e = abs(4.0_GRID_SR* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam3(1) > r_lam1(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + r_area= abs(r_sum) + + RETURN + END FUNCTION triang_area + +!***************************************************************** + FUNCTION hav(r_in) RESULT (r_out) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), INTENT(in) :: r_in + REAL (KIND = GRID_SR) :: r_out + +!---------- calculate haversine function + + r_out= (1.0_GRID_SR - cos(r_in))* 0.5_GRID_SR + + RETURN + END FUNCTION hav + +!***************************************************************** + FUNCTION sphere_correct(r_coord, r_displ) RESULT (r_corct) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord, r_displ + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_corct + + REAL (KIND = GRID_SR) :: r_e, r_rat + REAL (KIND = GRID_SR) :: r_c + +!---------- calculate Euklidean norm + + r_e = eukl_norm(r_displ) + r_rat= r_e/ GRID_RADIUS + +!---------- calculate correction + + r_c = tan(r_rat)/r_rat + r_corct= r_displ* r_c + + RETURN + END FUNCTION sphere_correct + +!***************************************************************** + FUNCTION eukl_norm(r_vec) RESULT(r_rst) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vec + REAL (KIND = GRID_SR) :: r_rst, r_tmp + +!---------- calculate vector crossproduct, 3D only + + r_tmp= dot_product(r_vec, r_vec) + r_rst= sqrt(r_tmp) + + END FUNCTION eukl_norm + + END MODULE SLM_advanced + diff --git a/flash2d/src/options-sphere/SLM_advanced.dual.f90 b/flash2d/src/options-sphere/SLM_advanced.dual.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a14432d75602f6cc70da753889f61b1cf3c84a46 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_advanced.dual.f90 @@ -0,0 +1,667 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_area +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER (KIND = GRID_SI), INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER (KIND = GRID_SI) :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER (KIND = GRID_SI), DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER (KIND = GRID_SI) :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_astep]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp, GRID_wcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp, GRID_wcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER (KIND = GRID_SI), INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc, r_sxy + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER (KIND = GRID_SI) :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_coord(:,i_cnt1),r_sxy) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_dcoord(:,i_cnt1),r_sxy) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER (KIND = GRID_SI) :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER (KIND = GRID_SI), INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER (KIND = GRID_SI),DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux, r_daux, & + r_uparea, r_dwarea + INTEGER (KIND = GRID_SI) :: i_alct, i_cnt, j_cnt, & + i_ind, i_dualplen + REAL (KIND = GRID_SR) :: r_oarea, r_narea + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_dual1, r_dual2, & + r_updual1, r_updual2 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_upcoord + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- allocate auxilliary arrays + + allocate(r_aux(i_arlen), r_daux(i_darlen), & + r_uparea(i_arlen), r_dwarea(i_arlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + +!---------- interpolation of node values + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_aux) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + r_upcoord= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + +!---------- first collect dual mesh nodes and do tangential projection + + clct_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT clct_loop + ELSE + r_dual1 = r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_dual2 = r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_updual1 = r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_updual2 = r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + +!---------- the upstream dual element + + r_oarea= r_oarea+ triang_area(r_coord(:,i_cnt), r_dual1, r_dual2) + +!---------- the downstream dual element + + r_narea= r_narea+ triang_area(r_upcoord, r_updual1, r_updual2) + + END IF + END DO clct_loop + + r_uparea(i_cnt)= r_oarea + IF(r_narea /= 0._GRID_SR) THEN + r_dwarea(i_cnt)= 1._GRID_SR/ r_narea + ELSE + r_dwarea(i_cnt)= 0._GRID_SR + END IF + END DO node_loop + +!---------- now calculate new values using a (nonexact) interpolation formula + + r_rside= r_aux* r_uparea* r_dwarea + +!---------- deallocate auxilliary arrays + + deallocate(r_aux, r_daux, r_uparea, r_dwarea) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER (KIND = GRID_SI), DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER (KIND = GRID_SI) :: i_cnt, i_alct, i_val + INTEGER (KIND = GRID_SI) :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0_GRID_SI) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + + REAL (KIND = GRID_SR) :: r_sum, r_hav, & + r_a, r_b, r_c, r_s, r_t, r_e + REAL (KIND = GRID_SR) :: r_halfpi + REAL (KIND = GRID_SR), PARAMETER :: r_degree=57.295779513082320876798 ! degrees per radian + REAL (KIND = GRID_SR) :: r_cosb1, r_cosb2, r_cosb3 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lam1, r_lam2, r_lam3 + +!---------- initialization + + r_sum= 0.0 + r_halfpi=GRID_PI*0.5 + +!---------- calculate spherical coordinates + + r_lam1= grid_kartgeo(r_coord1) + r_lam2= grid_kartgeo(r_coord2) + r_lam3= grid_kartgeo(r_coord3) + +!---------- calculate cosines + + r_cosb1= cos(r_lam1(2)) + r_cosb2= cos(r_lam2(2)) + r_cosb3= cos(r_lam3(2)) + +!---------- for all three pairs do the excess calculation + + IF(r_lam1(1) /= r_lam2(1)) THEN + r_hav= hav(r_lam2(2)- r_lam1(2))+ r_cosb1*r_cosb2*hav(r_lam2(1)- r_lam1(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam2(2) + r_c = r_halfpi- r_lam1(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam1(1) > r_lam2(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam2(1) /= r_lam3(1)) THEN + r_hav= hav(r_lam3(2)- r_lam2(2))+ r_cosb2*r_cosb3*hav(r_lam3(1)- r_lam2(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam3(2) + r_c = r_halfpi- r_lam2(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam2(1) > r_lam3(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam3(1) /= r_lam1(1)) THEN + r_hav= hav(r_lam1(2)- r_lam3(2))+ r_cosb3*r_cosb1*hav(r_lam1(1)- r_lam3(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam1(2) + r_c = r_halfpi- r_lam3(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam3(1) > r_lam1(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + !r_area= abs(r_sum) + r_area= r_sum + + RETURN + END FUNCTION triang_area + +!***************************************************************** + FUNCTION hav(r_in) RESULT (r_out) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), INTENT(in) :: r_in + REAL (KIND = GRID_SR) :: r_out + +!---------- calculate haversine function + + r_out= (1.0 - cos(r_in))* 0.5 + + RETURN + END FUNCTION hav + +!***************************************************************** + FUNCTION sphere_correct(r_coord, r_displ) RESULT (r_corct) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord, r_displ + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_corct + + REAL (KIND = GRID_SR) :: r_e, r_rat + REAL (KIND = GRID_SR) :: r_c + +!---------- calculate Euklidean norm + + r_e = eukl_norm(r_displ) + r_rat= r_e/ GRID_RADIUS + +!---------- calculate correction + + r_c = tan(r_rat)/r_rat + r_corct= r_displ* r_c + + RETURN + END FUNCTION sphere_correct + +!***************************************************************** + FUNCTION eukl_norm(r_vec) RESULT(r_rst) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vec + REAL (KIND = GRID_SR) :: r_rst, r_tmp + +!---------- calculate vector crossproduct, 3D only + + r_tmp= dot_product(r_vec, r_vec) + r_rst= sqrt(r_tmp) + + END FUNCTION eukl_norm + + END MODULE SLM_advanced diff --git a/flash2d/src/options-sphere/SLM_advanced.dual2 b/flash2d/src/options-sphere/SLM_advanced.dual2 new file mode 100644 index 0000000000000000000000000000000000000000..052b710ffab46bfe146111d056fbc370e16f0c5e --- /dev/null +++ b/flash2d/src/options-sphere/SLM_advanced.dual2 @@ -0,0 +1,625 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_newdualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_newdualcoor + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + nullify(r_newdualcoor) + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- calculate dual triangle positions + + CALL create_newdualpoints(i_size, r_coord, & + i_dual, r_dualcoordinates, i_dualedges, & + r_newdualcoor) + +!---------- allocate arrays for dual displacements + + allocate(r_newdualalpha(GRID_dimension,GRID_patchelements,i_size), & + r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + r_newdualcoor, r_newdualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newdualcoor, r_newdualalpha, & + r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl, r_newdualcoor, r_newdualalpha) + nullify(r_newdualcoor) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + r_ndcoord, r_ndalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(out) :: r_ndalpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2, i_cnt3 + +!---------- set constants + + r_dt0= p_param%phy%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%phy%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%phy%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + +!---------- the same for the dual triangle positions + + ndual_loop: DO i_cnt3=1,GRID_patchelements + r_axy= 0.0_GRID_SR + + nditer_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_ndcoord(:,i_cnt3,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO nditer_loop + + r_ndalpha(:,i_cnt3,i_cnt1)= r_axy + END DO ndual_loop + END DO unknown_loop + +!---------- the same for the dual nodes + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%phy%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_ndcoor, r_ndalpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndalpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_cnt, i_tnc, & + i_out, i_stat, j_cnt, i_ind, i_dualplen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_val, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,2*GRID_patchelements) :: r_dual3, r_updual3 + REAL (KIND = GRID_SR), DIMENSION(2,2*GRID_patchelements) :: r_dual2, r_updual2 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_foot, r_upfoot + REAL (KIND = GRID_SR), DIMENSION(2) :: r_orig + + i_stat= 0 + r_orig=(/0.0, 0.0/) + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_val= 0.0 + r_narea= 0.0 + r_vertx= 0.0 + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + + r_foot = r_coord(:,i_cnt) + r_upfoot= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + +!---------- first collect dual mesh nodes and do tangential projection + + clct_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT clct_loop + ELSE + i_ind= (j_cnt-1)*2 + 1 + r_dual3(:,i_ind) = r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_dual3(:,i_ind+1)= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_updual3(:,i_ind) = r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_updual3(:,i_ind+1)= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + END IF + END DO clct_loop + i_dualplen= j_cnt-1 + +!---------- projection to corresponding tangential planes + + CALL grid_tangentproject(r_foot,i_dualplen,r_dual3,r_dual2) + CALL grid_tangentproject(r_upfoot,i_dualplen,r_updual3,r_updual2) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO j_cnt= 1, i_dualplen + i_ind= (j_cnt-1)*2 + 1 + +!---------- calculate area + + r_narea= r_narea+ triang_ar2(r_orig, r_updual2(:,i_ind), r_updual2(:,i_ind+1)) + +!---------- calculate area of upstream dual triangle + + r_oarea= triang_ar2(r_orig, r_dual2(:,i_ind), r_dual2(:,i_ind+1)) + +!---------- check if upstream value is outside of the domain + + r_1= r_ndcoor(:,j_cnt,i_cnt)- r_ndalpha(:,j_cnt,i_cnt) + i_out= grid_domaincheck(p_mesh(i_time), r_1) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_1= grid_boundintersect(p_mesh(i_time), & + r_ndcoor(:,j_cnt,i_cnt), r_1, i_info=i_stat) + END IF out_domain + +!---------- interpolate + + no_intersect: IF(i_stat /= 0) THEN + r_tmp= 0.0_GRID_SR + ELSE no_intersect + r_tmp= grid_coordvalue(p_mesh(i_time), r_1, i_interpolorder=GRID_highorder) + IF(abs(r_tmp) < GRID_EPS) THEN + r_tmp= 0.0_GRID_SR + END IF + END IF no_intersect + +!---------- interpolate upstream concentration and calculate integral with quadrature rule + + r_val= r_val+ r_oarea* r_tmp + + END DO ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_val/r_narea + + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + FUNCTION triang_ar(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_ar +!***************************************************************** + FUNCTION triang_ar2(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(2), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(2) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5 + + RETURN + END FUNCTION triang_ar2 + +!***************************************************************** + SUBROUTINE create_newdualpoints(i_arlen, r_coord, & + i_darlen, r_dcoord, i_dedge, r_ndcoor) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoor + + REAL (KIND = GRID_SR) :: r_onethird=1./3. + INTEGER :: i_alct, i_cnt, i_tnc + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + +!---------- allocate array for dual coordinates + + allocate(r_ndcoor(GRID_dimension,GRID_patchelements,i_arlen), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(c_error='[create_newdualpoints]: dual points array not allocated!') + END IF not_allocdual + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(:,1)= r_coord(:,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element's outer nodes + + r_vertx(:,2)= r_dcoord(:,i_dedge(1,i_tnc,i_cnt)) + r_vertx(:,3)= r_dcoord(:,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate dual triangles center point + + r_ndcoor(:, i_tnc, i_cnt)= r_onethird* & + (r_vertx(:,1)+ r_vertx(:,2)+ r_vertx(:,3)) + END IF + END DO ptch_loop + END DO node_loop + + RETURN + END SUBROUTINE create_newdualpoints + + END MODULE SLM_advanced diff --git a/flash2d/src/options-sphere/SLM_advanced.dual2s b/flash2d/src/options-sphere/SLM_advanced.dual2s new file mode 100644 index 0000000000000000000000000000000000000000..93e2d2c83f47ff085f39af11564070d034368924 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_advanced.dual2s @@ -0,0 +1,662 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_newdualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_newdualcoor + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + nullify(r_newdualcoor) + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- calculate dual triangle positions + + CALL create_newdualpoints(i_size, r_coord, & + i_dual, r_dualcoordinates, i_dualedges, & + r_newdualcoor) + +!---------- allocate arrays for dual displacements + + allocate(r_newdualalpha(GRID_dimension,GRID_patchelements,i_size), & + r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + r_newdualcoor, r_newdualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newdualcoor, r_newdualalpha, & + r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl, r_newdualcoor, r_newdualalpha) + nullify(r_newdualcoor) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + r_ndcoord, r_ndalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(out) :: r_ndalpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2, i_cnt3 + +!---------- set constants + + r_dt0= p_param%phy%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%phy%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%phy%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + +!---------- the same for the dual triangle positions + + ndual_loop: DO i_cnt3=1,GRID_patchelements + r_axy= 0.0_GRID_SR + + nditer_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_ndcoord(:,i_cnt3,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO nditer_loop + + r_ndalpha(:,i_cnt3,i_cnt1)= r_axy + END DO ndual_loop + END DO unknown_loop + +!---------- the same for the dual nodes + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%phy%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%phy%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_ndcoor, r_ndalpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndalpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_cnt, i_tnc, & + i_out, i_stat, j_cnt, i_ind, i_dualplen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_val, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,2*GRID_patchelements) :: r_dual3, r_updual3 + REAL (KIND = GRID_SR), DIMENSION(2,2*GRID_patchelements) :: r_dual2, r_updual2 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_foot, r_upfoot + REAL (KIND = GRID_SR), DIMENSION(2) :: r_orig + + i_stat= 0 + r_orig=(/0.0, 0.0/) + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_val= 0.0 + r_narea= 0.0 + r_vertx= 0.0 + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + + r_foot = r_coord(:,i_cnt) + r_upfoot= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + +!---------- first collect dual mesh nodes and do tangential projection + + clct_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT clct_loop + ELSE + i_ind= (j_cnt-1)*2 + 1 + r_dual3(:,i_ind) = r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_dual3(:,i_ind+1)= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_updual3(:,i_ind) = r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_updual3(:,i_ind+1)= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + END IF + END DO clct_loop + i_dualplen= j_cnt-1 + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO j_cnt= 1, i_dualplen + i_ind= (j_cnt-1)*2 + 1 + +!---------- calculate area + + r_narea= r_narea+ triang_sph(r_upfoot, r_updual3(:,i_ind), r_updual3(:,i_ind+1)) + +!---------- calculate area of upstream dual triangle + + r_oarea= triang_sph(r_foot, r_dual3(:,i_ind), r_dual3(:,i_ind+1)) + +!---------- check if upstream value is outside of the domain + + r_1= r_ndcoor(:,j_cnt,i_cnt)- r_ndalpha(:,j_cnt,i_cnt) + i_out= grid_domaincheck(p_mesh(i_time), r_1) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_1= grid_boundintersect(p_mesh(i_time), & + r_ndcoor(:,j_cnt,i_cnt), r_1, i_info=i_stat) + END IF out_domain + +!---------- interpolate + + no_intersect: IF(i_stat /= 0) THEN + r_tmp= 0.0_GRID_SR + ELSE no_intersect + r_tmp= grid_coordvalue(p_mesh(i_time), r_1, i_interpolorder=GRID_highorder) + IF(abs(r_tmp) < GRID_EPS) THEN + r_tmp= 0.0_GRID_SR + END IF + END IF no_intersect + +!---------- interpolate upstream concentration and calculate integral with quadrature rule + + r_val= r_val+ r_oarea* r_tmp + + END DO ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_val/r_narea + + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + SUBROUTINE create_newdualpoints(i_arlen, r_coord, & + i_darlen, r_dcoord, i_dedge, r_ndcoor) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoor + + REAL (KIND = GRID_SR) :: r_onethird=1./3. + INTEGER :: i_alct, i_cnt, i_tnc + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + +!---------- allocate array for dual coordinates + + allocate(r_ndcoor(GRID_dimension,GRID_patchelements,i_arlen), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(c_error='[create_newdualpoints]: dual points array not allocated!') + END IF not_allocdual + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(:,1)= r_coord(:,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element's outer nodes + + r_vertx(:,2)= r_dcoord(:,i_dedge(1,i_tnc,i_cnt)) + r_vertx(:,3)= r_dcoord(:,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate dual triangles center point + + r_ndcoor(:, i_tnc, i_cnt)= r_onethird* & + (r_vertx(:,1)+ r_vertx(:,2)+ r_vertx(:,3)) + END IF + END DO ptch_loop + END DO node_loop + + RETURN + END SUBROUTINE create_newdualpoints + +!***************************************************************** + FUNCTION triang_sph(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + + REAL (KIND = GRID_SR) :: r_sum, r_hav, & + r_a, r_b, r_c, r_s, r_t, r_e + REAL (KIND = GRID_SR) :: r_halfpi + REAL (KIND = GRID_SR), PARAMETER :: r_degree=57.295779513082320876798 ! degrees per radian + REAL (KIND = GRID_SR) :: r_cosb1, r_cosb2, r_cosb3 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_lam1, r_lam2, r_lam3 + +!---------- initialization + + r_sum= 0.0 + r_halfpi=GRID_PI*0.5 + +!---------- calculate spherical coordinates + + r_lam1= grid_kartgeo(r_coord1) + r_lam2= grid_kartgeo(r_coord2) + r_lam3= grid_kartgeo(r_coord3) + +!---------- calculate cosines + + r_cosb1= cos(r_lam1(2)) + r_cosb2= cos(r_lam2(2)) + r_cosb3= cos(r_lam3(2)) + +!---------- for all three pairs do the excess calculation + + IF(r_lam1(1) /= r_lam2(1)) THEN + r_hav= hav(r_lam2(2)- r_lam1(2))+ r_cosb1*r_cosb2*hav(r_lam2(1)- r_lam1(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam2(2) + r_c = r_halfpi- r_lam1(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam1(1) > r_lam2(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam2(1) /= r_lam3(1)) THEN + r_hav= hav(r_lam3(2)- r_lam2(2))+ r_cosb2*r_cosb3*hav(r_lam3(1)- r_lam2(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam3(2) + r_c = r_halfpi- r_lam2(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam2(1) > r_lam3(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + IF(r_lam3(1) /= r_lam1(1)) THEN + r_hav= hav(r_lam1(2)- r_lam3(2))+ r_cosb3*r_cosb1*hav(r_lam1(1)- r_lam3(1)) + r_a = 2.0* asin(sqrt(r_hav)) + r_b = r_halfpi- r_lam1(2) + r_c = r_halfpi- r_lam3(2) + r_s = 0.5* (r_a+ r_b+ r_c); + r_t = tan(r_s* 0.5)* tan((r_s-r_a)*0.5)* tan((r_s-r_b)*0.5)* tan((r_s-r_c)*0.5) + r_e = abs(4.0* atan(sqrt(abs(r_t))))* r_degree + IF(r_lam3(1) > r_lam1(1)) r_e= -r_e + + r_sum= r_sum+ r_e + END IF + + r_area= abs(r_sum) + + RETURN + END FUNCTION triang_sph + +!***************************************************************** + FUNCTION hav(r_in) RESULT (r_out) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), INTENT(in) :: r_in + REAL (KIND = GRID_SR) :: r_out + +!---------- calculate haversine function + + r_out= (1.0 - cos(r_in))* 0.5 + + RETURN + END FUNCTION hav + + END MODULE SLM_advanced diff --git a/flash2d/src/options-sphere/SLM_initial.gaia b/flash2d/src/options-sphere/SLM_initial.gaia new file mode 100644 index 0000000000000000000000000000000000000000..6065729bc55a6fea04799521ed113d6461bba596 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_initial.gaia @@ -0,0 +1,344 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution +! REAL, DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) +! REAL :: r_hgt=4.0 +! REAL :: r_srd=0.15 +! REAL :: r_sln=0.22 +! REAL :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initcoshill(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + +!---------- calculate center ! CAUTION: THIS IS NOT IMPLEMENTED YET !!! + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- check array length + + IF(i_arlen < i_num) THEN + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,*) '[slm_analyticsolution]: Array sizes did not match, adjusting to the smaller size!' + END IF + i_num= i_arlen + END IF + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initcoshill(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER (KIND = GRID_SI), DIMENSION(1) :: i_valind + +!---------- get center + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcoshill + +!***************************************************************** + FUNCTION coshill(r_coor, r_centr) RESULT (r_hill) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_hill + REAL (KIND = GRID_SR) :: r_maxheight=1.0 + REAL (KIND = GRID_SR) :: r_maxrad + REAL (KIND = GRID_SR) :: r_minrad + REAL (KIND = GRID_SR) :: r_linwid + REAL (KIND = GRID_SR) :: r_dist, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_xy + +!---------- initialize r_hill + + r_maxrad= GRID_RADIUS/ 6.0 + r_minrad= r_maxrad* 0.6 + r_linwid= r_maxrad* 0.25 + r_hill= 0.0 + +!---------- calculate distance to center + + r_xy= r_centr- r_coor + r_dist= DOT_PRODUCT(r_xy,r_xy) + +!---------- calculate inner values + + IF(r_dist < r_maxrad) THEN + r_hill= r_maxheight + IF(r_dist < r_minrad) THEN + r_hill= 0.0 + IF((r_xy(3) < r_centr(3)+ r_linwid) .AND. & + (r_xy(3) > r_centr(3)- r_linwid)) THEN + r_hill= r_maxheight + END IF + END IF + END IF + + RETURN + END FUNCTION coshill + +!***************************************************************** + + END MODULE SLM_initial + diff --git a/flash2d/src/options-sphere/SLM_initial.mvortex b/flash2d/src/options-sphere/SLM_initial.mvortex new file mode 100644 index 0000000000000000000000000000000000000000..4d666aaf92eea5d897d5534d8c416b40f79f3597 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_initial.mvortex @@ -0,0 +1,515 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize moving vortex for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution +! REAL, DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) +! REAL :: r_hgt=4.0 +! REAL :: r_srd=0.15 +! REAL :: r_sln=0.22 +! REAL :: r_swd=0.06 + REAL (KIND=GRID_SR) :: r_beta = 0._GRID_SR * 0.785398163397448279_GRID_SR ! Check ADV_wind when changing this value!!! + ! angle between north pole of unrotated sphere and vortices axis + ! in Nair paper: alpha. To get no trouble with trajectory nomenclatura + ! called r_beta here + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize for the moving vortex + + CALL slm_mvortex(p_ghand, r_beta, 0._GRID_SR, 0) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + +!---------- check array length + + IF(i_arlen < i_num) THEN + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,*) '[slm_analyticsolution]: Array sizes did not match, adjusting to the smaller size!' + END IF + i_num= i_arlen + END IF + +!---------- loop over the node + + CALL slm_mvortex(p_ghand, r_beta, r_time, i_arlen, r_array) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_mvortex(p_ghand, r_beta, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_beta ! angle between north pole of the unrotated sphere and vortices axis + ! in Nair paper: alpha. To get no trouble with trajectory nomenclatura + ! called r_beta here + REAL (KIND = GRID_SR), INTENT(in) :: r_time + + REAL (KIND = GRID_SR), DIMENSION(i_arlen), OPTIONAL :: r_array + INTEGER (KIND = GRID_SI) :: i_arlen + + + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_scoo ! sperical coordinates + INTEGER (KIND = GRID_SI), DIMENSION(1) :: i_valind + +!---------- Nairs variables + + REAL (KIND = GRID_SR) :: r_scale, r_unot + REAL (KIND = GRID_SR) :: r_tow + + REAL (KIND = GRID_SR) :: r_lm0, r_th0 + REAL (KIND = GRID_SR) :: r_lmc, r_thc ! north pole coordinates + REAL (KIND = GRID_SR) :: r_pl, r_pt ! vortex position + REAL (KIND = GRID_SR) :: r_ct, r_st + REAL (KIND = GRID_SR) :: r_th, r_lm + REAL (KIND = GRID_SR) :: r_lam, r_the + REAL (KIND = GRID_SR) :: r_rl, r_rt + REAL (KIND = GRID_SR) :: r_dd, r_rd, r_vmax + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_rthe, r_rlam ! rotated theta and lambda? + REAL (KIND = GRID_SR) :: r_rho ! density + REAL (KIND = GRID_SR) :: r_tt, r_tv + REAL (KIND = GRID_SR) :: r_omg, r_trm + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + + ALLOCATE(r_scoo(GRID_dimspherical, i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + + ALLOCATE(r_rlam(i_num), r_rthe(i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + DO i_count = 1, i_num + r_scoo(:,i_count) = grid_kartgeo(r_coo(:,i_count)) + END DO + +!---------- Parameters for a unit sphere (see dynamic_vortex.f, Nair) + + + r_scale = 2._GRID_SR*GRID_PI / float(1036800) !12 days scale + r_unot = 2._GRID_SR*GRID_PI / float(1036800) !12 dyas rate + + r_tow = r_time * r_scale ! r_time = dtt * itn in original code + + r_lm0 = 1.5_GRID_SR * GRID_PI !intial center position (3pi/2,0) + r_th0 = 0.0_GRID_SR + + !Following 2 lines commented out by Nair + !r_lmc = r_lm0 !center of the vortex + !r_thc = r_th0 + + r_pl = r_lm0 + r_pt = r_th0 + r_ct = cos(r_pt) + r_st = sin(r_pt) + +!*--------Note: +!* keep the vortex position (pl,pt) "fixed" and rotate the background +!* away by "unot*dtime*ditn" units from its initial position on +!* the latitudes of a rotated sphere. Transform back to the regular coordinates +!* and form the vortex with center at the "fixed" position (pl,pt). +!* + +!---------- Solid-body rotation part (without vortex) + + node_loop1: DO i_count= 1, i_num + r_lm = r_scoo(1,i_count) + r_th = r_scoo(2,i_count) + + r_lmc = GRID_PI !vortex center position + r_thc = 0.5_GRID_SR * GRID_PI - r_beta !vortex center position + + ! Go to the rotated system + CALL rotated_sphere(r_lmc,r_thc,r_lm,r_th,r_rl,r_rt) + r_lam = r_rl - r_unot*r_time ! commented out -> no rotation + r_the = r_rt + + !Following 3 lines commented out by Nair + !r_lmc = 0.0_GRID_SR !another option + !r_thc = -0.5_GRID_SR * GRID_PI + r_beta + !with r_lam = r_rl + r_unot*r_time + + ! Back to unrotated system + CALL rotate_back(r_lmc,r_thc,r_lam,r_the,r_rl,r_rt) + r_rlam(i_count) = r_rl + r_rthe(i_count) = r_rt + END DO node_loop1 + + + +!----------- Analytic Vortex field at any given time (iteration) +!----------- Smooth Vortex making parameters + r_dd = 5.0_GRID_SR + r_rd = 3.0_GRID_SR + r_vmax = 1.5_GRID_SR *sqrt(3.0_GRID_SR) + +!---------- loop over the nodes + + node_loop2: DO i_count= 1, i_num + r_th = r_rthe(i_count) + r_lm = r_rlam(i_count) + + CALL rotated_sphere(r_pl,r_pt,r_lm,r_th,r_rl,r_rt) + + r_rho = r_rd * cos(r_rt) + r_tt = tanh(r_rho) + r_tv = (1.0_GRID_SR - r_tt*r_tt) * r_tt * r_vmax + + if (r_rho == 0.0_GRID_SR ) then + r_omg = 0.0_GRID_SR + else + r_omg = r_tv / r_rho ! this is not exactly the same omega as in the paper. the scaling factor misses, but is included in r_tow + endif + + ! Exact sln. + r_trm = r_rho* sin(r_rl - r_tow*r_omg) / r_dd + r_aux(1,i_count)= (1.0_GRID_SR - tanh(r_trm) ) + END DO node_loop2 + +!---------- update grid information or give analytical solution back + + IF (.NOT. present(r_array)) THEN + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + ELSE + r_array = r_aux(1,:) + END IF + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo, r_scoo, r_rlam, r_rthe) + + RETURN + END SUBROUTINE slm_mvortex + +!***************************************************************** + FUNCTION coshill(r_coor, r_centr) RESULT (r_hill) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_hill + REAL (KIND = GRID_SR) :: r_maxheight=1.0 + REAL (KIND = GRID_SR) :: r_maxrad + REAL (KIND = GRID_SR) :: r_dist, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_xy + +!---------- initialize r_hill + + r_maxrad= GRID_RADIUS/ 6.0 + r_hill= 0.0 + +!---------- calculate distance to center + + r_xy= r_centr- r_coor + r_dist= DOT_PRODUCT(r_xy,r_xy) + +!---------- calculate inner values + + IF(r_dist < r_maxrad) THEN + r_tmp = (GRID_PI* r_dist)/r_maxrad + r_hill= r_maxheight *(1.0+ cos(r_tmp)) + END IF + + RETURN + END FUNCTION coshill + +!***************************************************************** + +!******************************************************************* +!* Ram Nair (Ncar/SCD) 08/06 +!* Rotate a sphere so that its NP is at (lc,tc). The rotated coordinates +!* (rol,rot) corresponding to (la,th) in the regular Sph. coordinates +!******************************************************************* + SUBROUTINE Rotated_Sphere(lc,tc,la,th,rol,rot) +!* +! include 'params.h' +! include 'const.h' +!* + + + IMPLICIT NONE + REAL (KIND = GRID_SR), INTENT(in) :: lc,tc,la,th !In + REAL (KIND = GRID_SR), INTENT(out) :: rol,rot !Out + + REAL (KIND = GRID_SR) :: cost,sint,sinc,cosc + REAL (KIND = GRID_SR) :: trm, trm1,trm2,trm3 + REAL (KIND = GRID_SR) :: twopi + + twopi=2._GRID_SR * GRID_PI + + sinc = sin(tc) + cosc = cos(tc) + cost = cos(th) + sint = sin(th) + + trm = cost * cos(la- lc) + trm1 = cost * sin(la- lc) + trm2 = sinc * trm - cosc * sint + trm3 = sinc * sint + cosc * trm + + rol = atan2(trm1,trm2) + if (rol > twopi) rol = rol - twopi + if (rol < 0.0_GRID_SR ) rol = rol + twopi + rot = asin(trm3) + + RETURN + END SUBROUTINE Rotated_Sphere + + +!******************************************************************* +!* Ram Nair (Ncar/SCD) 10/06 +!*Rotate a sphere back to the regular (rla,rth) coordinates from +!* a totated sphere whose NP is at (lmc,thc). The unrotated coordinates +!*(rla,rth) corresponds to the (lam,the) of the rotated Sphere +!******************************************************************* + SUBROUTINE Rotate_Back(lmc,thc,lam,the,rla,rth) +!* +! include 'params.h' +! include 'const.h' +!* + + IMPLICIT NONE + REAL (KIND = GRID_SR), INTENT(in) :: lmc,thc,lam,the !In + REAL (KIND = GRID_SR), INTENT(out) :: rla,rth !Out + + REAL (KIND = GRID_SR) :: cost,sint,cosp,sinp,clam,slam + REAL (KIND = GRID_SR) :: trm, t1,t2,t3 + REAL (KIND = GRID_SR) :: twopi + + twopi=2._GRID_SR * GRID_PI + +!* Back to unrotated system + cost = cos(the) + sint = sin(the) + clam = cos(lam) + slam = sin(lam) + cosp = cos(thc) + sinp = sin(thc) + t1 = slam * cost + t2 = sint*cosp + cost*clam*sinp + t3 = sint*sinp - cost*clam*cosp + rla = lmc + atan2(t1,t2) + if (rla < 0.0 ) rla = rla + twopi + if (rla > twopi ) rla = rla - twopi + rth = asin(t3) + + RETURN + END SUBROUTINE Rotate_Back + +END MODULE SLM_initial + + + + diff --git a/flash2d/src/options-sphere/SLM_initial.sharp b/flash2d/src/options-sphere/SLM_initial.sharp new file mode 100644 index 0000000000000000000000000000000000000000..548679c09f8bf29fac8dca84755bd8cfd569dbf6 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_initial.sharp @@ -0,0 +1,334 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 f. klaschka 8/2006 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution +! REAL, DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) +! REAL :: r_hgt=4.0 +! REAL :: r_srd=0.15 +! REAL :: r_sln=0.22 +! REAL :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initcoshill(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + +!---------- calculate center ! CAUTION: THIS IS NOT IMPLEMENTED YET !!! + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- check array length + + IF(i_arlen < i_num) THEN + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,*) '[slm_analyticsolution]: Array sizes did not match, adjusting to the smaller size!' + END IF + i_num= i_arlen + END IF + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initcoshill(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimspherical) :: r_sentr=(/ 0.0, 0.0 /) + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER (KIND = GRID_SI), DIMENSION(1) :: i_valind + +!---------- get center + + r_centr= grid_geokart(r_sentr) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= coshill(r_coo(:,i_count),r_centr) + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcoshill + +!***************************************************************** + FUNCTION coshill(r_coor, r_centr) RESULT (r_hill) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_hill + REAL (KIND = GRID_SR) :: r_maxheight=1.0 + REAL (KIND = GRID_SR) :: r_maxrad + REAL (KIND = GRID_SR) :: r_dist, r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_xy + +!---------- initialize r_hill + + r_maxrad= GRID_RADIUS/ 6.0 + r_hill= 0.0 + +!---------- calculate distance to center + + r_xy= r_centr- r_coor + r_dist= DOT_PRODUCT(r_xy,r_xy) + +!---------- calculate inner values + + IF(r_dist < r_maxrad) THEN +! r_tmp = (GRID_PI* r_dist)/r_maxrad +! r_hill= r_maxheight *(1.0+ cos(r_tmp)) + r_hill= r_maxheight + END IF + + RETURN + END FUNCTION coshill + +!***************************************************************** + + END MODULE SLM_initial diff --git a/flash2d/src/options-sphere/SLM_simple.clip.f90 b/flash2d/src/options-sphere/SLM_simple.clip.f90 new file mode 100644 index 0000000000000000000000000000000000000000..059499e7d455e6ef2b095af9db8c7400086a42c9 --- /dev/null +++ b/flash2d/src/options-sphere/SLM_simple.clip.f90 @@ -0,0 +1,459 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc, r_sxy + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_sxy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + r_axy= sphere_correct(r_coord(:,i_cnt1),r_sxy) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val, & + l_relative=.FALSE., l_sfcorder=.FALSE., & + i_index=i_ind, i_domaincheck=0) + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + +!***************************************************************** + FUNCTION sphere_correct(r_coord, r_displ) RESULT (r_corct) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord, r_displ + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_corct + + REAL (KIND = GRID_SR) :: r_e, r_rat + REAL (KIND = GRID_SR) :: r_c + +!---------- calculate Euklidean norm + + r_e = eukl_norm(r_displ) + r_rat= r_e/ GRID_RADIUS + +!---------- calculate correction + + r_c = tan(r_rat)/r_rat + r_corct= r_displ* r_c + + RETURN + END FUNCTION sphere_correct + +!***************************************************************** + FUNCTION eukl_norm(r_vec) RESULT(r_rst) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vec + REAL (KIND = GRID_SR) :: r_rst, r_tmp + +!---------- calculate vector crossproduct, 3D only + + r_tmp= dot_product(r_vec, r_vec) + r_rst= sqrt(r_tmp) + + END FUNCTION eukl_norm + + END MODULE SLM_simple diff --git a/flash2d/src/options/ADV_rhs.algae.f90 b/flash2d/src/options/ADV_rhs.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3387f3f6fc36045543dc27a741f8a1243911dde6 --- /dev/null +++ b/flash2d/src/options/ADV_rhs.algae.f90 @@ -0,0 +1,94 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_rhs +! FUNCTION: +! calculate the (nonhomogeneous) right hand side +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_righthand +! FUNCTION: +! calculate the rhs of the advection equation +! SYNTAX: +! real= slm_righthand(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_rhs: right hand side value real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! this is the homogeneous case! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 2/98 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_rhs + USE GRID_api + PRIVATE + PUBLIC :: slm_righthand + CONTAINS +!***************************************************************** + FUNCTION slm_righthand(r_coord, r_values, r_time) RESULT (r_rhs) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2), INTENT(in), OPTIONAL :: r_values + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(2) :: r_rhs + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_secondsperday + + REAL (KIND = GRID_SR) :: r_mumax, r_Topt, r_Tslope, r_Cmort, r_mu, r_tmp + +!---------- set constants + + r_secondsperday = 86400._GRID_SR + r_mumax = 0.5_GRID_SR/r_secondsperday ! [per day] + r_Topt = 22._GRID_SR ! [°C] + r_Tslope = 5._GRID_SR ! [°C] + r_Cmort = 0.05_GRID_SR/r_secondsperday ! [per day] + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- compute growth + + r_tmp= r_values(2)-r_Topt + r_mu = r_mumax* exp(-((r_tmp * r_tmp)/(r_Tslope * r_Tslope))) + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_rhs= 0.0 + r_rhs(1)= r_mu* r_values(1)- r_Cmort* r_values(1) + + RETURN + END FUNCTION slm_righthand + +!***************************************************************** + END MODULE ADV_rhs diff --git a/flash2d/src/options/ADV_rhs.hom.f90 b/flash2d/src/options/ADV_rhs.hom.f90 new file mode 100644 index 0000000000000000000000000000000000000000..546b4cd9e0a79628da4db651ecb8fc404b0bf077 --- /dev/null +++ b/flash2d/src/options/ADV_rhs.hom.f90 @@ -0,0 +1,76 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_rhs +! FUNCTION: +! calculate the (nonhomogeneous) right hand side +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_righthand +! FUNCTION: +! calculate the rhs of the advection equation +! SYNTAX: +! real= slm_righthand(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_rhs: right hand side value real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! this is the homogeneous case! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 2/98 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_rhs + USE GRID_api + PRIVATE + PUBLIC :: slm_righthand + CONTAINS +!***************************************************************** + FUNCTION slm_righthand(r_coord, r_time) RESULT (r_rhs) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR) :: r_rhs + REAL (KIND = GRID_SR) :: r_tim + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_rhs= 0.0 + + RETURN + END FUNCTION slm_righthand + +!***************************************************************** + END MODULE ADV_rhs diff --git a/flash2d/src/options/ADV_semilagrange.SW.F90 b/flash2d/src/options/ADV_semilagrange.SW.F90 new file mode 100644 index 0000000000000000000000000000000000000000..568620c0e491016eab5a59d7962b905ecc6734da --- /dev/null +++ b/flash2d/src/options/ADV_semilagrange.SW.F90 @@ -0,0 +1,904 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian for shallow water equations +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: NOT USED OR TESTED +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/200 +! 13. modified for shallow water equations s.paruszewski 10/2014 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_hAll + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_hAll(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_hAll) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_hAll(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_hAll(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_hAll(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_hAll, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_4, i_6, i_cnt + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln, r_huglobal, r_hglobal, r_minHu, r_maxHu, r_minHv, r_maxHv + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_hAll, r_aux2, & + r_aux3, r_aux4, r_aux6 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx,r_huAll, r_momaux, r_veloAux + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_hAll(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_aux6(i_size), r_huAll(GRID_dimension, i_size),& + r_veloAux(GRID_dimension,i_size),r_momaux(GRID_dimension, i_size),& + r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_hAll= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + +!---------- H ------ + i_valind= (/ GRID_h/) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + + r_hAll(:)= r_auxx(1,:) + + DEALLOCATE(r_auxx) + +!---------- H global r_hAll------ + r_hglobal=0.0_GRID_SR + + + DO i_cnt=1,i_size + r_hglobal=r_hglobal+r_hAll(i_cnt) + END DO + r_hglobal=r_hglobal/i_size + + +!---------- HU global (HU) r_huAll ------ + r_huglobal=0.0_GRID_SR + CALL grid_getinfo(p_ghand, i_arraypoint=(/ GRID_hu, GRID_hv /), & + r_nodevalues= r_huAll) + + DO i_cnt=1,i_size + r_aux6(i_cnt)=sqrt(r_huAll(1,i_cnt)*r_huAll(1,i_cnt)+r_huAll(2,i_cnt)*r_huAll(2,i_cnt)) + END DO + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution r_aux3 = h + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3, r_momaux, r_veloAux) + + + r_huglobal= dot_product(r_aux6, r_aux2) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_hAll, r_aux2) + r_rfm0 = r_calci + + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_hAll* r_hAll + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_hAll- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_hAll) + r_min = minval(r_hAll) + + r_minHu = minval(r_huAll(1,:)) + r_minHv = minval(r_huAll(2,:)) + + r_maxHu = maxval(r_huAll(1,:)) + r_maxHv = maxval(r_huAll(2,:)) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_4= p_ghand%i_gnumber + i_6= p_ghand%i_nnumber + write(i_iodiag,1101) r_medln + write(i_iodiag,1102) i_2 + write(i_iodiag,1103) i_4 + write(i_iodiag,1104) i_6 + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + write(i_iodiag,1000) i_1, r_min, r_max, r_minHu, r_minHv, r_maxHu,& + r_maxHv, r_rfm, r_rsm,& + r_mxnrm, r_l2nrm, r_hglobal,r_huglobal + +!---------- deallocate workspace + + deallocate(r_hAll, r_aux2, r_aux3, r_aux4, r_huAll, r_aux6) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_hAll(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size),r_aux6(i_size), r_auxx(1,i_size), r_huAll(GRID_dimension,i_size),& + r_veloAux(GRID_dimension,i_size), r_momaux(GRID_dimension,i_size),& + stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_hAll= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0; r_huAll=0.0 + + +!---------- calculate reference values, ... extract actual calculated concentration + +!---------- get the height and calculate the global height (mass) + i_valind= (/ GRID_h /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_hAll(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + + + r_hglobal=0.0_GRID_SR + r_huglobal=0.0_GRID_SR + + DO i_cnt=1,i_size + r_hglobal=r_hglobal+r_hAll(i_cnt) + END DO + r_hglobal=r_hglobal/i_size + + + + + + CALL grid_getinfo(p_ghand, i_arraypoint=(/ GRID_hu, GRID_hv /), & + r_nodevalues= r_huAll) + + DO i_cnt=1,i_size + r_aux6(i_cnt)=sqrt(r_huAll(1,i_cnt)*r_huAll(1,i_cnt)+r_huAll(2,i_cnt)*r_huAll(2,i_cnt)) + END DO + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3, r_momaux, r_veloAux) + r_huglobal= dot_product(r_aux6, r_aux2) + + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_hAll, r_aux2) + ! r_rfm0 = r_calci + + + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_hAll* r_hAll + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_hAll- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_hAll) + r_min = minval(r_hAll) + + r_minHu = minval(r_huAll(1,:)) + r_minHv = minval(r_huAll(2,:)) + + r_maxHu = maxval(r_huAll(1,:)) + r_maxHv = maxval(r_huAll(2,:)) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + + write(i_iodiag,1000) i_1, r_min, r_max, r_minHu, r_minHv, r_maxHu,& + r_maxHv, r_rfm, r_rsm,& + r_mxnrm, r_l2nrm, r_hglobal,r_huglobal + +!---------- deallocate workspace + + deallocate(r_hAll, r_aux2, r_aux3, r_aux4, r_huAll, r_aux6, r_veloAux) + + RETURN + 1000 FORMAT(1x, i10, 1x, e15.8, 1x, e15.8 , 1x, e15.8, 1x, e15.8, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/& + 1x,'* timestep ', ' minimum h ', & + ' maximum h ',' minimum hu ', ' minimum hv ',& + ' maximum hu ',' maximum hv ',& + ' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',& + ' h_global ',' hu_global*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + 1101 FORMAT('Length Edge of Grid', e15.8) + 1102 FORMAT('Number of elements', i10) + 1103 FORMAT('Number of edges', i10) + 1104 FORMAT('Number of nodes', i10) + + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!-----my own problem-specific-variables (those names need to be added in FLASH_parameters.F90) + + CALL add_grid_params() + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + +!--------- Adaptivity is not considered! + l_refined= .TRUE. +! adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) +! p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 +! END DO adap_loop + + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_coord(GRID_dimension,i_size), stat=i_alct) + not_allocfinal: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), l_sfcorder=.TRUE. ,r_nodecoordinates=r_coord) + + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, r_coord) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + deallocate(r_coord) + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + +!***************************************************************** + + + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options/ADV_semilagrange.adv.F90 b/flash2d/src/options/ADV_semilagrange.adv.F90 new file mode 100644 index 0000000000000000000000000000000000000000..918bb60fba8d1df880c717b4eb0308393591d129 --- /dev/null +++ b/flash2d/src/options/ADV_semilagrange.adv.F90 @@ -0,0 +1,883 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!-SLM--------- insert a full advanced SLM step here, if required +!-SLM--------- retrieve coordinates of grid points + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_tracer(i_size), r_coord(GRID_dimension,i_size), stat=i_alct) + not_allocfinal: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_coord) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, r_coord, r_tracer) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_size), stat=i_alct) + not_allocfinal1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options/ADV_semilagrange.algae.F90 b/flash2d/src/options/ADV_semilagrange.algae.F90 new file mode 100644 index 0000000000000000000000000000000000000000..4e08df4c4ff5c31c669a80db5c1b2fbf086ddf4c --- /dev/null +++ b/flash2d/src/options/ADV_semilagrange.algae.F90 @@ -0,0 +1,882 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(2) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(2,i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + + i_valind= (/ GRID_tracer, GRID_phi /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_tracer) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!-SLM--------- insert a full advanced SLM step here, if required +!-SLM--------- retrieve coordinates of grid points + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_tracer(2,i_size), r_coord(GRID_dimension,i_size), stat=i_alct) + not_allocfinal: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_coord) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, r_coord, r_tracer) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_size), stat=i_alct) + not_allocfinal1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_allocfinal1 + + i_valind= (/ GRID_tracer, GRID_phi /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + r_nodevalues= r_tracer) + + deallocate(r_coord, r_tracer, r_aux) + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options/ADV_semilagrange.sim.F90 b/flash2d/src/options/ADV_semilagrange.sim.F90 new file mode 100644 index 0000000000000000000000000000000000000000..b76fed74081ec65d0936c49b337eba044faa0369 --- /dev/null +++ b/flash2d/src/options/ADV_semilagrange.sim.F90 @@ -0,0 +1,850 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_semilagrange +! FUNCTION: +! perform semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_adapt +! FUNCTION: +! adapt the grid according to an error estimate +! SYNTAX: +! CALL slm_adapt(grid, param, logical) +! ON INPUT: +! p_ghand: handle for the grid TYPE (grid_handle) +! p_param: global parameter structure TYPE (global_param) +! ON OUTPUT: +! l_changed: flag for changed grid LOGICAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initialize +! FUNCTION: +! initialize the advection problem +! SYNTAX: +! CALL slm_initialize(grid, param) +! ON INPUT: +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_finish +! FUNCTION: +! terminate slm (free dynamically alloc. memory, ...) +! SYNTAX: +! CALL slm_finish(grid, param) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_timestepping +! FUNCTION: +! perform the timestepping in the slm +! SYNTAX: +! CALL slm_timestepping(grid, param, cmd) +! ON INPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! p_param: parameter data structure TYPE (global_param) +! p_cmdln: command line argument struct. TYPE (cmdline) +! ON OUTPUT: +! p_ghand: grid handling data structure TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! slm_initialize, slm_finish, slm_timestepping +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, FEM_handle +! FEM_errorestimate, FEM_param +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 10/96 +! 2. several improvements/fixes j. behrens 11/96-1/97 +! 3. nodal values time depend. j. behrens 1/97 +! 4. stop_watch removed, plot j. behrens 1/97 +! (position) changed, inner +! iteration counter added +! 5. slm_adapt changed j. behrens 2/97 +! 6. slm_adapt changed to hide +! grid data structures j. behrens 7/97 +! 7. control data structure j. behrens 12/97 +! 8. non-homog. rhs added j. behrens 2/98 +! 9. compliant to amatos 1.0 j. behrens 12/2000 +! 10. compliant to amatos 1.2 j. behrens 3/2002 +! 11. compliant to amatos 2.0 j. behrens 7/2003 +! 12. added visnetplot f. klaschka 12/2003 +! +!***************************************************************** + MODULE ADV_semilagrange + USE FLASH_parameters + USE MISC_timing + USE IO_vtuplot +#ifndef NO_NETCDF + USE IO_netcdfplot +#endif + USE IO_utils + USE GRID_api + USE SLM_errorestimate + USE SLM_initial + USE SLM_simple + USE SLM_advanced + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_initialize, slm_finish, slm_timestepping + CONTAINS +!***************************************************************** + SUBROUTINE slm_adapt(p_ghand, p_param, l_changed, l_water) + + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + LOGICAL, INTENT(out) :: l_changed + LOGICAL, OPTIONAL, INTENT(in) :: l_water + LOGICAL :: l_switch + REAL (KIND = GRID_SR) :: r_errmx, & + r_refcrit, r_crscrit, r_fac + INTEGER :: i_size, & + i_manyc, i_manyr, i_alct, i_cnt + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1 + INTEGER, DIMENSION(:), ALLOCATABLE :: i_aux1, i_aux2, i_aux3 + LOGICAL :: l_ref, l_crs + +!---------- initialize refinement flag + + l_changed= .FALSE. + +!---------- handle watermark switch + + wat_present: IF(present(l_water)) THEN + l_switch= l_water + ELSE wat_present + l_switch= .TRUE. + END IF wat_present + +!---------- allocate work arrays + + i_size= p_ghand%i_enumfine + allocate(r_aux1(i_size), i_aux1(i_size), i_aux2(i_size), & + i_aux3(i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(35) + END IF not_alloc + +!---------- estimate the local error + + CALL slm_errorest(p_ghand, i_size, r_aux1) + +!---------- set coarsening/refinement criterion + + r_errmx= maxval(r_aux1(1:i_size)) + r_crscrit= r_errmx* p_param%num%r_crstolerance + r_refcrit= r_errmx* p_param%num%r_reftolerance + +!---------- get level information and set up flags for refinement/coarsening + + CALL grid_getinfo(p_ghand, l_finelevel= .TRUE., i_elementlevel= i_aux1, & + i_elementstatus= i_aux3) + DO i_cnt=1,i_size + i_aux2(i_cnt)= 0 + IF((i_aux1(i_cnt) > p_param%num%i_crslevel) .AND. & + (r_aux1(i_cnt) < r_crscrit)) i_aux2(i_cnt)= GRID_pleasecoarse + IF((i_aux1(i_cnt) < p_param%num%i_reflevel) .AND. & + (r_aux1(i_cnt) > r_refcrit)) i_aux2(i_cnt)= GRID_pleaserefine + END DO + +!---------- determine if there is enough to be done (this can be +! switched off by l_water=.FALSE.) + + IF(l_switch) THEN + i_manyr= count(i_aux2 == GRID_pleaserefine) + r_fac= real(i_manyr,GRID_SR)/ real(i_size,GRID_SR) + enough_ref: IF(r_fac > p_param%num%r_refwatermark) THEN + l_ref= .TRUE. + ELSE + l_ref= .FALSE. + END IF enough_ref + + i_manyc= count(i_aux2 == GRID_pleasecoarse) + r_fac= real(i_manyc,GRID_SR)/ real(i_size,GRID_SR) + enough_crs: IF(r_fac > p_param%num%r_crswatermark) THEN + l_crs= .TRUE. + ELSE + l_crs= .FALSE. + END IF enough_crs + ELSE + l_ref= .TRUE. + l_crs= .TRUE. + END IF + +!---------- update grid flags + + update: IF(l_ref .OR. l_crs) THEN + IF(l_ref) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleaserefine) + IF(l_crs) i_aux3= merge(i_aux2, i_aux3, i_aux2==GRID_pleasecoarse) + CALL grid_putinfo(p_ghand, l_finelevel= .TRUE., i_elementstatus= i_aux3) + END IF update + +!---------- deallocate work arrays + + deallocate(r_aux1, i_aux1, i_aux2, i_aux3) + +!---------- adapt the grid + + CALL grid_adapt(p_ghand, l_changed) + + RETURN + END SUBROUTINE slm_adapt + +!***************************************************************** + SUBROUTINE slm_diagnostics(p_ghand, p_param, p_tinfo, c_action) + +!---------- local declarations + + IMPLICIT NONE + TYPE (grid_handle), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + TYPE (rt_info), INTENT(in) :: p_tinfo + CHARACTER (len=4), INTENT(in), OPTIONAL :: c_action + INTEGER, SAVE :: i_iodiag + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + REAL (KIND = GRID_SR), PARAMETER :: r_1o3= (1./3.) + INTEGER :: i_fst, i_tmp, & + i_size, i_alct, i_1, i_2, i_3, i_4, i_5, i_6 + REAL (KIND = GRID_SR), SAVE :: r_rfm0, r_rsm0 + REAL (KIND = GRID_SR) :: r_dispn, r_rfm, r_rsm, & + r_ts, r_calci, r_calcs, r_mxnrm, r_l2nrm, r_max, r_min, r_diffn, & + r_medln + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2, & + r_aux3, r_aux4 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_auxx + INTEGER, DIMENSION(1) :: i_valind + +!---------- action init + + present_act: IF(present(c_action)) THEN + action_type: IF(c_action == 'init') THEN + +!---------- open file for diagnostic output + + i_iodiag= 9 + i_tmp = p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_diag.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + open(i_iodiag, file= c_file, action= 'write', form= 'formatted', & + iostat= i_fst) + not_opened: IF(i_fst /= 0) THEN + CALL grid_error(36) + END IF not_opened + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Filename: ', c_file, ' opened on unit: ', i_iodiag + +!---------- allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_alloc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + r_rfm0 = r_calci + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + r_rsm0 = r_calcs + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + write(i_iodiag,1100) GRID_parameters%program_name, GRID_parameters%version, & + GRID_parameters%subversion, GRID_parameters%patchversion + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + +!---------- initialization done + + RETURN + +!---------- action quit + + ELSE IF(c_action == 'quit') THEN action_type + +!---------- close diagnostic output file + + close(i_iodiag) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iodiag + +!---------- action quit done + + RETURN + END IF action_type + END IF present_act + +!---------- action diag (default): allocate workspace + + i_size= p_ghand%i_nnumber + allocate(r_aux1(i_size), r_aux2(i_size), r_aux3(i_size), & + r_aux4(i_size), r_auxx(1,i_size), stat=i_alct) + not_allc: IF(i_alct /= 0) THEN + CALL grid_error(37) + END IF not_allc + r_aux1= 0.0; r_aux2= 0.0; r_aux3= 0.0; r_aux4= 0.0 + +!---------- get minimum edge length + + CALL grid_edgelength(p_ghand, r_min=r_medln) + +!---------- calculate reference values, ... extract actual calculated concentration + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, & + r_nodevalues= r_auxx) + r_aux1(:)= r_auxx(1,:) + DEALLOCATE(r_auxx) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ghand, i_size, r_aux2) + +!---------- calculate analytical solution + + r_ts= p_param%num%r_deltatime* float(p_tinfo%i_step) + CALL slm_analyticsolution(p_ghand, r_ts, i_size, r_aux3) + +!---------- now the integral of the concentration (mass) is + + r_calci= dot_product(r_aux1, r_aux2) + +!---------- the integral of the squared concentration ("entropy"(?)) is + + r_aux4 = r_aux1* r_aux1 + r_calcs= dot_product(r_aux4, r_aux2) + +!---------- the maximum-norm of the error is + + r_aux4 = abs(r_aux1- r_aux3) + r_mxnrm= maxval(r_aux4) + +!---------- the l2-norm of the error is + + r_aux4 = r_aux4* r_aux4 + r_l2nrm= dot_product(r_aux4, r_aux2) + +!---------- maximum and minimum + + r_max = maxval(r_aux1) + r_min = minval(r_aux1) + +!---------- diffusion and dispersion (not yet implemented) + + r_diffn= 0.0 + r_dispn= 0.0 + +!---------- print it + + r_rfm= r_calci/r_rfm0 + r_rsm= r_calcs/r_rsm0 + i_1= p_tinfo%i_step + i_2= p_ghand%i_enumber + i_3= p_ghand%i_enumfine + i_4= p_ghand%i_gnumber + i_5= p_ghand%i_gnumfine + i_6= p_ghand%i_nnumber + write(i_iodiag,1000) i_1, i_2, i_3, i_4, i_5, i_6, r_min, r_max, & + r_rfm, r_rsm, r_mxnrm, r_l2nrm, r_diffn, & + r_dispn, r_medln + +!---------- deallocate workspace + + deallocate(r_aux1, r_aux2, r_aux3, r_aux4) + + RETURN + 1000 FORMAT(1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, 1x, i10, & + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8, 1x, e15.8, 1x, e15.8, 1x, e15.8,& + 1x, e15.8) + 1010 FORMAT(a28,i4.4) + 1100 FORMAT(1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'***** PROGRAM: ',a15,174x,'*****',/ & + 1x,'***** VERSION: ',i2.2,'.',i2.2,'.',i2.2,181x,'*****',/ & + 1x,'***** Diagnostic output ',180x,'*****',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '*******************************************', & + '*************************************',/ & + 1x,'* timestep ',' elements ',' fine el. ',' edges ', & + ' fine ed. ',' nodes ',' minimum ', & + ' maximum ',' RFM ',' RSM ', & + ' max-norm ',' l2-norm ',' diffusion ', & + ' dispersion ',' min.edge len.*',/ & + 1x,'*******************************************', & + '*******************************************', & + '*******************************************', & + '******************************************', & + '**************************************') + END SUBROUTINE slm_diagnostics + +!***************************************************************** + SUBROUTINE slm_initialize(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(out) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + + INTEGER :: i_steps + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, i_cnt + LOGICAL :: l_refined + INTEGER :: i_vertnum + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_vertinit + +!---------- decide whether a new experiment is startet or an old one is continued + + new_experiment: IF(p_param%num%i_experiment <= 0) THEN + +!---------- reset timesteps (start with 1 in any case) + + time_one: IF(p_param%num%i_frsttimestep /= 1) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'WARNING : Timestep counters reset due to new experiment' + i_steps= p_param%num%i_lasttimestep- p_param%num%i_frsttimestep + p_param%num%i_frsttimestep= 1 + p_param%num%i_lasttimestep= p_param%num%i_frsttimestep+ i_steps + END IF time_one + +!---------- initialize grid parameters + + CALL grid_setparameter(p_ghand, i_coarselevel= p_param%num%i_crslevel, & + i_finelevel= p_param%num%i_reflevel) + +!---------- define domain, first read data from file (compiled here) + + CALL grid_readdomain(i_vertnum, r_vertinit, c_readfile=p_param%io%c_domainfile) + CALL grid_definegeometry(i_vertnum, r_vertexarr= r_vertinit) + +!---------- create initial triangulation + + CALL grid_createinitial(p_ghand, c_filename=p_param%io%c_triangfile) + +!---------- initialize grid and adapt at steep gradients + + i_cnt= 0 + l_refined= .TRUE. + refine_loop: DO WHILE (l_refined) + CALL slm_initialvalues(p_ghand(i_timeplus)) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined, & + l_water=.FALSE.) + END DO refine_loop + +!---------- duplicate grid (old time) + + CALL grid_timeduplicate(p_ghand(i_timeplus), p_ghand(i_time)) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + +!---------- if an old experiment is to be continued from stored data: + + ELSE new_experiment + +!---------- create grid from saveset, first compile filename + + i_tmp= p_param%num%i_experiment- 1 + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + + CALL grid_readinitial(p_ghand, c_file) + +!---------- initialize wind field calculation + + CALL slm_windinit(p_param) + + END IF new_experiment + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_initialize + +!***************************************************************** + SUBROUTINE slm_finish(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + CHARACTER (len=32) :: c_file + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp + +!---------- open and write saveset, if required + + save_req: IF(p_param%io%i_savelast /= 0) THEN + + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file, p_ghand) + +!---------- write parameter file for next experiment + + CALL io_putinputfile(p_param) + END IF save_req + +!---------- gracefully terminate wind field calculations + + CALL slm_windquit + + RETURN + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_finish + +!***************************************************************** + SUBROUTINE slm_timestepping(p_ghand, p_param) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, PARAMETER :: i_innermax=15 + TYPE (grid_handle), DIMENSION(GRID_timesteps), & + INTENT(inout) :: p_ghand + TYPE (control_struct), INTENT(inout) :: p_param + INTEGER :: i_timecount + TYPE (sw_info) :: p_time, p_timeaux + LOGICAL :: l_refined + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_tracer + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coord, r_aux + CHARACTER (len=32) :: c_file, c_matfile + CHARACTER (len=28) :: c_tmp + INTEGER :: i_tmp, & + i_size, i_alct, i_tst, i_fst + INTEGER :: i_iomatl=21 + REAL (KIND = GRID_SR) :: r_modtime + INTEGER :: i_loopquit + INTEGER :: i_newlen + INTEGER, DIMENSION(1) :: i_valind + +!---------- VISNET variable init + + i_loopquit = 0 + +!---------- initialize timestep info structure + + p_timestepinfo%i_step = 0 + p_timestepinfo%i_adapit = 0 + p_timestepinfo%l_ploted = .FALSE. + p_timestepinfo%l_saved = .FALSE. + p_timestepinfo%r_modeltime = 0.0 + +!---------- initialize timing structure + + p_time%p_tim%r_tim = 0.0 + p_time%p_tim%r_lap = 0.0 + p_time%p_tim%c_tim = ' ' + p_timeaux%p_tim%r_tim= 0.0 + p_timeaux%p_tim%r_lap= 0.0 + p_timeaux%p_tim%c_tim= ' ' + +!---------- initialize stop watches + + CALL stop_watch_init(1,(/'total time '/),p_timeaux) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + +!---------- if diagnostics are demanded, initialize diagnostical output + + IF(p_param%io%l_diagnostics) THEN + p_timestepinfo%i_step= 0 + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='init') + END IF + +!---------- plot initial data + + i_timecount= 0 +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF +!---------- put out initial information + + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + +!---------- timestep loop + + CALL stop_watch('start',1,p_timeaux) + CALL stop_watch('start',8,p_time) + i_timecount = 0_GRID_SI + p_timestepinfo%r_modeltime = p_param%num%r_starttime + time_loop: DO WHILE (p_timestepinfo%r_modeltime < p_param%num%r_finaltime - p_param%num%r_deltatime) + i_timecount = i_timecount+ 1_GRID_SI + p_timestepinfo%i_step = i_timecount + p_timestepinfo%r_modeltime = p_timestepinfo%r_modeltime + p_param%num%r_deltatime + p_timestepinfo%i_adapit = 0_GRID_SI + +!---------- duplicate old grid, use it as first guess for new grid + + CALL stop_watch('start',2,p_time) + CALL grid_timeduplicate(p_ghand(i_time), p_ghand(i_timeplus)) + CALL stop_watch('stop ',2,p_time) + +!---------- adaptive (inner) loop + + l_refined= .TRUE. + adap_loop: DO WHILE(l_refined .AND. p_timestepinfo%i_adapit < i_innermax) + p_timestepinfo%i_adapit= p_timestepinfo%i_adapit+ 1 + +!---------- allocate and extract working arrays +!---------- use amatos 1.2 functionality to calculate only new nodes + + i_size= p_ghand(i_timeplus)%i_nnumber + allocate(r_aux(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- do the following SLM calculations in arrays (grid-point-wise) + + CALL grid_getinfo(p_ghand(i_timeplus), r_nodecoordinates=r_aux, & + i_newsdepth= 1, i_nlength= i_newlen) + allocate(r_tracer(i_newlen), r_coord(GRID_dimension,i_newlen), stat=i_alct) + not_alloc0: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc0 + r_coord(:,1:i_newlen)= r_aux(:,1:i_newlen) + deallocate(r_aux) + +!-SLM--------- call the SLM step + + r_modtime= p_timestepinfo%r_modeltime- p_param%num%r_deltatime + CALL slm_step(p_ghand, p_param, p_time, r_modtime, i_newlen, & + r_coord, r_tracer, i_newsdepth=1) + +!-SLM--------- update grid data structure and deallocate work arrays +!-SLM--------- change back from (grid-point)arrays to grid data structure + + allocate(r_aux(1,i_newlen), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc1 + r_aux(1,:)= r_tracer(:) + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_aux) + + deallocate(r_coord, r_tracer, r_aux) + +!-SLM--------- adapt the grid corresponding to an error estimate + + CALL stop_watch('start',6,p_time) + CALL slm_adapt(p_ghand(i_timeplus), p_param, l_refined) + CALL stop_watch('stop ',6,p_time) + + END DO adap_loop + +!---------- diagnostics, if requested + + IF(p_param%io%l_diagnostics) THEN + CALL stop_watch('start',7,p_time) + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='diag') + CALL stop_watch('stop ',7,p_time) + END IF + +!---------- plot data (every [i_plotoffset]th timestep) + + CALL stop_watch('start',1,p_time) + plot_step: IF(mod(i_timecount, p_param%io%i_plotoffset) == 0) THEN + IF((p_param%io%l_netcdf) .OR. (p_param%io%l_vtu)) & + p_timestepinfo%l_ploted= .TRUE. + +#ifndef NO_NETCDF + IF(p_param%io%l_netcdf) THEN + CALL plot_netcdf(p_ghand(i_timeplus), i_time=i_timecount) + END IF +#endif + IF(p_param%io%l_vtu) THEN + CALL generate_vtu(p_ghand(i_timeplus), i_time=i_timecount) + END IF + END IF plot_step + CALL stop_watch('stop ',1,p_time) + +!---------- put a saveset to disc every ... timesteps + + save_step: IF((mod(i_timecount, p_param%io%i_saveoffset) == 0) .AND. & + (i_timecount > 1)) THEN + i_tmp= p_param%num%i_experiment + write(c_tmp,*) trim(GRID_parameters%program_name), '_save.' + write(c_file,1010) trim(c_tmp), i_tmp + c_file= adjustl(c_file) + CALL grid_writesaveset(c_file,p_ghand) + p_timestepinfo%l_saved= .TRUE. + END IF save_step + +!---------- runtime information output + + CALL stop_watch('stop ',8,p_time) + CALL io_putruntimeinfo(p_ghand(i_timeplus), p_timestepinfo, p_time) + CALL stop_watch_init(8,(/'plotting ', 'grid duplication', & + 'trajectory calc.', 'right hand side ', & + 'grid value updt.', 'grid adaption ', & + 'diagnostics ', 'whole timestep '/), p_time) + CALL stop_watch('start',8,p_time) + +!---------- remove obsolecent grid items + + CALL grid_sweep + +!---------- toggle time handles for next step if gfx-proces has not exited + + CALL grid_timetoggle + +!---------- exit loop if graphics process has been terminated + + IF (i_loopquit /= 0) EXIT time_loop + + END DO time_loop + CALL stop_watch('stop ',1,p_timeaux) + +!---------- print total time + + write(GRID_parameters%ioout,1005) + write(GRID_parameters%ioout,1003) p_timeaux%p_tim(1)%r_tim + write(GRID_parameters%ioout,1004) + IF(GRID_parameters%iolog > 0) THEN + write(GRID_parameters%iolog,1003) p_timeaux%p_tim(1)%r_tim + END IF + +!---------- terminate diagnostics + + IF(p_param%io%l_diagnostics) THEN + CALL slm_diagnostics(p_grid(i_timeplus), p_param, p_timestepinfo, c_action='quit') + END IF + + RETURN + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Runtime Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1003 FORMAT(1x,'***** Total time for timesteps ',10x,e12.4,' *****') + 1004 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/) + 1005 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****',/ & + 1x,'***** Final Information Output *****',/ & + 1x,'***** ----- ----- ----- ----- ----- ----- ----- ----- *****') + 1010 FORMAT(a28,i4.4) + END SUBROUTINE slm_timestepping + + END MODULE ADV_semilagrange diff --git a/flash2d/src/options/ADV_wind.algae.f90 b/flash2d/src/options/ADV_wind.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b2bebfab86e6c7a68c1e2a18682a55237c00df9e --- /dev/null +++ b/flash2d/src/options/ADV_wind.algae.f90 @@ -0,0 +1,808 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. bug fix concerning interp. j. behrens 2/98 +! 3. compliant to amatos 1.0 j. behrens 12/2000 +! 4. compliant to amatos 1.2 j. behrens 3/2002 +! 5. new version for course tracer transport j. behrens 01/2012 +! +!***************************************************************** + MODULE ADV_wind + USE GRID_api + USE FLASH_parameters + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + REAL (KIND = GRID_SR) :: r_intervallen, r_readlast + REAL (KIND = GRID_SR) :: r_ncupdatelast, r_secperstep + CHARACTER (LEN=io_fillen) :: c_windpath + CHARACTER (LEN=io_fillen), DIMENSION(:), ALLOCATABLE :: c_windfile + CHARACTER (LEN=io_fillen) :: c_tempfile + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowx + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowy + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_inittemp + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lat, r_vlat + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lon, r_ulon + INTEGER (KIND = GRID_SI) :: i_lon, i_lat, i_timesteps, i_level, i_numfiles + INTEGER (KIND = GRID_SI) :: i_pointsx, i_pointsy + INTEGER (KIND = GRID_SI) :: i_timeinterval, i_intervalnum, i_stepcounter + LOGICAL :: l_lonlatread + + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + PUBLIC :: slm_tempfield + + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_tim + CHARACTER (LEN=2*io_fillen) :: c_ncfile + INTEGER (KIND = GRID_SI) :: i_iost, i_cnt, j_cnt + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- decide, if data has to be read + + data_read: IF(r_readlast <= r_tim) THEN + +!---------- update values for next open + + r_readlast = r_readlast+ r_intervallen + i_timeinterval= i_timeinterval+ 1 + IF(i_timeinterval > i_numfiles) THEN + CALL grid_error(i_error=1,c_error='[slm_windfield]: no more current files in list, fixing last one') + i_timeinterval = i_numfiles + END IF + i_stepcounter = 0_GRID_SI + +!---------- create filenames + + write(c_ncfile,*) trim(c_windpath),c_windfile(i_timeinterval) + c_ncfile= adjustl(c_ncfile) + +!---------- read current data from NetCDF file + + CALL read_netcdf_currents(c_ncfile) + + END IF data_read + +!---------- decide, if counter needs to be updated + + update_nccount: IF(r_ncupdatelast <= r_tim) THEN + i_stepcounter= i_stepcounter+1 + IF(i_stepcounter > i_timesteps) & + CALL grid_error(c_error='[slm_windfield]: step counter overflow!') + r_ncupdatelast= r_ncupdatelast+ r_secperstep + END IF update_nccount + +!---------- interpolate to coordinate + + r_field= wind_interpol(r_coord,i_timeinterval) + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + FUNCTION slm_tempfield(r_coord) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR) :: r_field + + INTEGER (KIND = GRID_SI) :: i_lox, i_hix, i_loy, i_hiy + INTEGER (KIND = GRID_SI) :: i_cnt + REAL (KIND = GRID_SR) :: r_dx, r_dy, r_dxi, r_dyi + REAL (KIND = GRID_SR) :: r_lx, r_hx, r_ly, r_hy + REAL (KIND = GRID_SR) :: r_l1, r_h1 + REAL (KIND = GRID_SR) :: r_scalx, r_scaly + REAL (KIND = GRID_SR) :: r_deg, r_radians + REAL (KIND = GRID_SR), PARAMETER :: r_earth=6.371e6_GRID_SR ! earth's radius + +!---------- initialize radians + + r_radians= GRID_PI/180._GRID_SR + r_deg= r_radians* r_earth + +!---------- find u-component wind box corresponding to coordinate + + i_lox=1_GRID_SI + i_hix=2_GRID_SI + i_loy=1_GRID_SI + i_hiy=2_GRID_SI + + determine_lon: DO i_cnt=1, i_lon-1 + IF(r_lon(i_cnt) .LT. r_coord(1)) THEN + IF(r_lon(i_cnt +1) .GE. r_coord(1)) THEN + i_lox= i_cnt + i_hix= i_cnt+1 + exit determine_lon + END IF + END IF + END DO determine_lon + IF(r_lon(i_lon) .LT. r_coord(1)) THEN + i_lox = i_lon-1 + i_hix = i_lon + END IF + + determine_lat: DO i_cnt=1, i_lat-1 + IF(r_lat(i_cnt) .GE. r_coord(2)) THEN + IF(r_lat(i_cnt +1) .LT. r_coord(2)) THEN + i_loy= i_cnt + i_hiy= i_cnt+1 + exit determine_lat + END IF + END IF + END DO determine_lat + IF(r_lat(i_lat) .GE. r_coord(2)) THEN + i_loy = i_lat-1 + i_hiy = i_lat + END IF + +!---------- calculate weights for bilinear interpolation + + r_dx= r_lon(i_hix)- r_lon(i_lox) + r_dy= r_lat(i_loy)- r_lat(i_hiy) ! note that the coordinate direction is inverted + r_lx= r_coord(1) - r_lon(i_lox) + r_ly= r_coord(2) - r_lat(i_hiy) + r_hx= r_lon(i_hix) - r_coord(1) + r_hy= r_lat(i_loy) - r_coord(2) + r_scalx=1._GRID_SR/(r_deg*cos(r_radians*r_lat(i_hiy))) !r_coord(2))) + r_scaly=1._GRID_SR/(r_deg) + +!---------- linear interpolation in x-direction + + IF(r_dx /= 0.0_GRID_SR) THEN + r_dxi= 1._GRID_SR/r_dx + r_l1= (r_hx* r_inittemp(i_lox, i_loy)+ & + r_lx* r_inittemp(i_hix, i_loy))* r_dxi + r_h1= (r_hx* r_inittemp(i_lox, i_hiy)+ & + r_lx* r_inittemp(i_hix, i_hiy))* r_dxi + ELSE + r_l1= r_inittemp(i_lox, i_loy) + r_h1= r_inittemp(i_lox, i_hiy) + END IF + +!---------- linear interpolation in y-direction + + IF(r_dy /= 0.0_GRID_SR) THEN + r_dyi= 1._GRID_SR/r_dy + r_field= (r_hy* r_l1+ r_ly* r_h1)* r_dyi !* r_scalx + ELSE + r_field= r_l1 !* r_scalx + END IF + + RETURN + END FUNCTION slm_tempfield + +!***************************************************************** + SUBROUTINE read_netcdf_currents(c_filename) + +!---------- local declarations + + IMPLICIT NONE + INCLUDE "netcdf.inc" + +!---------- input parameters + CHARACTER (LEN=2*io_fillen), INTENT(in) :: c_filename + +!---------- local variables + INTEGER (KIND = GRID_SI) :: i_alct, i_ncstat + INTEGER (KIND = GRID_SI) :: i_fileuvid + INTEGER (KIND = GRID_SI) :: i_dimid, i_varid + INTEGER (KIND = GRID_SI) :: i_tm, i_ln, i_lt + INTEGER (KIND = GRID_SI) :: i_vlat, i_ulon, i_windlon, i_windlat, & + i_windlevel + INTEGER, DIMENSION(:,:,:,:), ALLOCATABLE :: i_uwind, i_vwind + +!---------- initialize diagnostic variable + + i_alct= 0_GRID_SI + +!---------- open current file + + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opening NetCDF file ',c_filename + i_ncstat= nf_open(c_filename,NF_NOWRITE,i_fileuvid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not open currents data file') + +!---------- determine lon/lat/time dimension sizes (grid size of currents field) + + i_ncstat= nf_inq_dimid(i_fileuvid, 'xtno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lon dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_windlon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'ytno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lat dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_windlat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'time', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify time dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_timesteps) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read time dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'zlevno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify level dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_windlevel) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read level dimension') + +!---------- check for the staggered dimensions + + lonlatfirstread: IF(l_lonlatread) THEN + IF((i_lat /= i_windlat) .OR. (i_lon /= i_windlon) .OR. & + (i_level /= i_windlevel)) & + CALL grid_error(c_error='[read_netcdf_currents]: dimensions incompatible to temperature data') + ELSE lonlatfirstread + i_lat= i_windlat + i_lon= i_windlon + i_level= i_windlevel + +!---------- allocate latitude and longitude coordinate arrays + + IF((.NOT. allocated(r_lat)) .AND. (.NOT. allocated(r_lon))) & + ALLOCATE(r_lat(i_lat), r_lon(i_lon), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate lat/lon field') + +!---------- read latitude and longitude coordinate values + + i_ncstat= nf_inq_varid(i_fileuvid, 'xtno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lon varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_lon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon data') + + i_ncstat= nf_inq_varid(i_fileuvid, 'ytno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lat varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_lat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat data') + + l_lonlatread= .TRUE. + + END IF lonlatfirstread + +!---------- check for the staggered dimensions + + i_ncstat= nf_inq_dimid(i_fileuvid, 'xuno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify staggered lon dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_ulon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read staggered lon dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'yvno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify staggered lat dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_vlat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read staggered lat dimension') + + IF((i_lat /= i_vlat) .OR. (i_lon /= i_ulon)) & + CALL grid_error(c_error='[read_netcdf_currents]: staggered dimensions not matching') + +!---------- allocate latitude and longitude coordinate arrays + + IF ((.NOT. allocated(r_vlat)) .AND. (.NOT. allocated(r_ulon))) & + ALLOCATE(r_vlat(i_lat), r_ulon(i_lon), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate lat/lon field') + +!---------- read staggered latitude and longitude coordinate values + + i_ncstat= nf_inq_varid(i_fileuvid, 'xuno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine staggered lon varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_ulon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read staggered lon data') + + i_ncstat= nf_inq_varid(i_fileuvid, 'yvno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine staggered lat varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_vlat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read staggered lat data') + +!---------- allocate current data arrays - take r_flowx as indicator for allocated state of all arrays... + + IF(.NOT. allocated(r_flowx)) & + ALLOCATE(r_flowx(i_lon, i_lat, i_timesteps), r_flowy(i_lon, i_lat, i_timesteps), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate currents fields') + IF((.NOT. allocated(i_uwind)) .AND. (.NOT. allocated(i_vwind))) & + ALLOCATE(i_uwind(i_lon, i_lat, i_level, i_timesteps), i_vwind(i_lon, i_lat, i_level, i_timesteps), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate auxiliary currents fields') + +!---------- read x-/y-direction data of currents + + i_ncstat= nf_inq_varid(i_fileuvid, 'uno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of uno') + i_ncstat= nf_get_var_int(i_fileuvid, i_varid, i_uwind) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read uno data') + + i_ncstat= nf_inq_varid(i_fileuvid, 'vno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of vno') + i_ncstat= nf_get_var_int(i_fileuvid, i_varid, i_vwind) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read vno data') + +!---------- Convert data and fix mask values + + DO i_tm=1,i_timesteps + DO i_lt= 1,i_lat + DO i_ln= 1,i_lon + r_flowx(i_ln, i_lt, i_tm)= 0.001_GRID_SR* REAL(i_uwind(i_ln, i_lt, 1, i_tm), GRID_SR) + IF(i_uwind(i_ln, i_lt, 1, i_tm) <= -11111) r_flowx(i_ln, i_lt, i_tm)= 0._GRID_SR + r_flowy(i_ln, i_lt, i_tm)= 0.001_GRID_SR* REAL(i_vwind(i_ln, i_lt, 1, i_tm), GRID_SR) + IF(i_vwind(i_ln, i_lt, 1, i_tm) <= -11111) r_flowy(i_ln, i_lt, i_tm)= 0._GRID_SR + END DO + END DO + END DO + +!---------- close currents file + + i_ncstat= nf_close(i_fileuvid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not close currents data file') + +!---------- deallocate aux arrays + + DEALLOCATE(i_uwind, i_vwind) + + END SUBROUTINE read_netcdf_currents + +!***************************************************************** + SUBROUTINE read_netcdf_temperature(c_filename) + +!---------- local declarations + + IMPLICIT NONE + INCLUDE "netcdf.inc" + +!---------- input parameters + CHARACTER (LEN=2*io_fillen), INTENT(in) :: c_filename + +!---------- local variables + INTEGER (KIND = GRID_SI) :: i_alct, i_ncstat + INTEGER (KIND = GRID_SI) :: i_fileuvid + INTEGER (KIND = GRID_SI) :: i_dimid, i_varid + INTEGER (KIND = GRID_SI) :: i_tm, i_ln, i_lt + INTEGER (KIND = GRID_SI) :: i_templat, i_templon, i_templevel, i_temptime + INTEGER, DIMENSION(:,:,:,:), ALLOCATABLE :: i_itemp + +!---------- open current file + + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opening NetCDF file ',c_filename + i_ncstat= nf_open(c_filename,NF_NOWRITE,i_fileuvid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not open temperature data file') + +!---------- determine lon/lat/time dimension sizes (grid size of temperature field) + + i_ncstat= nf_inq_dimid(i_fileuvid, 'xtno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not identify lon dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_templon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read lon dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'ytno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not identify lat dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_templat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read lat dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'time', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not identify time dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_temptime) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read time dimension') + + i_ncstat= nf_inq_dimid(i_fileuvid, 'zlevno', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not identify level dimension') + i_ncstat= nf_inq_dimlen(i_fileuvid, i_dimid, i_templevel) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read level dimension') + +!---------- check for consistency with currents file + + lonlatfirstread: IF(l_lonlatread) THEN + IF((i_lat /= i_templat) .OR. (i_lon /= i_templon) .OR. & + (i_level /= i_templevel)) & + CALL grid_error(c_error='[read_netcdf_temperature]: dimensions incompatible to currents data') + ELSE lonlatfirstread + i_lat= i_templat + i_lon= i_templon + i_level= i_templevel + +!---------- allocate latitude and longitude coordinate arrays + + ALLOCATE(r_lat(i_lat), r_lon(i_lon), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not allocate lat/lon field') + +!---------- read latitude and longitude coordinate values + + i_ncstat= nf_inq_varid(i_fileuvid, 'xtno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not determine lon varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_lon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read lon data') + + i_ncstat= nf_inq_varid(i_fileuvid, 'ytno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not determine lat varid') + i_ncstat= nf_get_var_double(i_fileuvid, i_varid, r_lat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read lat data') + + l_lonlatread= .TRUE. + + END IF lonlatfirstread + +!---------- allocate current data arrays + + ALLOCATE(r_inittemp(i_lon, i_lat), i_itemp(i_lon, i_lat, i_level, i_temptime), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not allocate temperature fields') + +!---------- read x-/y-direction data of currents + + i_ncstat= nf_inq_varid(i_fileuvid, 'tno', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not determine varid of tno') + i_ncstat= nf_get_var_int(i_fileuvid, i_varid, i_itemp) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not read tno data') + +!---------- Convert data and fix mask values + + DO i_lt= 1,i_lat + DO i_ln= 1,i_lon + r_inittemp(i_ln, i_lt)= 0.01_GRID_SR* REAL(i_itemp(i_ln, i_lt, 1, 1), GRID_SR) + IF(i_itemp(i_ln, i_lt, 1, 1) <= -11111) r_inittemp(i_ln, i_lt)= 0._GRID_SR + END DO + END DO + +!---------- close currents file + + i_ncstat= nf_close(i_fileuvid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_temperature]: could not close currents data file') + +!---------- deallocate aux arrays + + DEALLOCATE(i_itemp) + + END SUBROUTINE read_netcdf_temperature + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct) :: p_control + INTEGER :: i_iofil= 19 + CHARACTER (len=i_charlength+io_fillen) :: c_name + CHARACTER (len=128) :: a_filrow + INTEGER :: i_iost, i_ioend, i_alct, i_cnt + CHARACTER (LEN=2*io_fillen) :: c_ncfile + +!---------- initialize + + WRITE(c_name,*) trim(p_control%cmd%c_directory),p_control%tst%tst_char(1) + c_name= adjustl(c_name) + c_windpath= p_control%cmd%c_directory + i_numfiles= -1 + +!---------- open wind parameter file + + open(unit= i_iofil, file= c_name, status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: ', c_name + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_name + CALL grid_error(c_error='[slm_windinit]: could not open wind parameters file') + END IF file_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opened file on unit: ', i_iofil + +!---------- read wind parameter file + + read_loop: DO + read(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + close(i_iofil) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT read_loop + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CONTINUE + ELSE IF(a_filrow(1:8) == 'ABS_PATH') THEN comment_line + read(i_iofil,2000) c_windpath + ELSE IF(a_filrow(1:8) == 'SEC_PER_') THEN comment_line + read(i_iofil,*) r_secperstep + ELSE IF(a_filrow(1:8) == 'STEPS_PE') THEN comment_line + read(i_iofil,*) i_timesteps + ELSE IF(a_filrow(1:8) == 'INFILE_N') THEN comment_line + read(i_iofil,*) i_numfiles + ALLOCATE(c_windfile(i_numfiles), stat=i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[slm_windinit]: could not allocate windname array') + ELSE IF(a_filrow(1:8) == 'WIND_FIL') THEN comment_line + IF(i_numfiles < 1) & + CALL grid_error(c_error='[slm_windinit]: number of wind files unknown') + DO i_cnt=1,i_numfiles + c_windfile(i_cnt)= ' ' + read(i_iofil,2010) c_windfile(i_cnt) + END DO + ELSE IF(a_filrow(1:8) == 'TEMP_FIL') THEN comment_line + c_tempfile= ' ' + read(i_iofil,2010) c_tempfile + END IF comment_line + + END IF file_end + END DO read_loop + +!---------- initialize some values + + r_readlast = 0.0_GRID_SR + r_ncupdatelast = 0.0_GRID_SR + i_timeinterval = 0_GRID_SI + i_stepcounter = 0_GRID_SI + r_intervallen = r_secperstep* i_timesteps + l_lonlatread = .FALSE. + +!---------- read temperature data (wind data are read in slm_windfield) + + write(c_ncfile,*) trim(c_windpath),c_tempfile + c_ncfile= adjustl(c_ncfile) + + CALL read_netcdf_temperature(c_ncfile) + + RETURN + 2000 FORMAT(a128) + 2010 FORMAT(a64) + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + +!---------- deallocate wind data arrays + + DEALLOCATE(r_flowx, r_flowy, r_inittemp) + DEALLOCATE(r_lon, r_lat, r_ulon, r_vlat) + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION wind_interpol(r_coord, i_tim) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + INTEGER (KIND = GRID_SI) :: i_tim + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + + INTEGER (KIND = GRID_SI) :: i_ulox, i_uhix, i_uloy, i_uhiy + INTEGER (KIND = GRID_SI) :: i_vlox, i_vhix, i_vloy, i_vhiy + INTEGER (KIND = GRID_SI) :: i_cnt + REAL (KIND = GRID_SR) :: r_dx, r_dy, r_dxi, r_dyi + REAL (KIND = GRID_SR) :: r_ulx, r_uhx, r_uly, r_uhy + REAL (KIND = GRID_SR) :: r_vlx, r_vhx, r_vly, r_vhy + REAL (KIND = GRID_SR) :: r_l1, r_h1, r_l2, r_h2 + REAL (KIND = GRID_SR) :: r_scalx, r_scaly + REAL (KIND = GRID_SR) :: r_deg, r_radians + REAL (KIND = GRID_SR), PARAMETER :: r_earth=6.371e6_GRID_SR ! earth's radius + +!---------- initialize radians + + r_radians= GRID_PI/180._GRID_SR + r_deg= r_radians* r_earth + +!---------- find u-component wind box corresponding to coordinate + + i_ulox=1_GRID_SI + i_uhix=2_GRID_SI + i_uloy=1_GRID_SI + i_uhiy=2_GRID_SI + + determine_ulon: DO i_cnt=1, i_lon-1 ! r_lon goes from small to large values... + IF(r_ulon(i_cnt) .LT. r_coord(1)) THEN + IF(r_ulon(i_cnt +1) .GE. r_coord(1)) THEN + i_ulox= i_cnt + i_uhix= i_cnt+1 + exit determine_ulon + END IF + END IF + END DO determine_ulon + IF(r_ulon(i_lon) .LT. r_coord(1)) THEN + i_ulox = i_lon-1 + i_uhix = i_lon + END IF + + determine_ulat: DO i_cnt=1, i_lat-1 ! r_lat goes from large to small values... + IF(r_lat(i_cnt) .GE. r_coord(2)) THEN + IF(r_lat(i_cnt +1) .LT. r_coord(2)) THEN + i_uloy= i_cnt + i_uhiy= i_cnt+1 + exit determine_ulat + END IF + END IF + END DO determine_ulat + IF(r_lat(i_lat) .GT. r_coord(2)) THEN + i_uloy = i_lat-1 + i_uhiy = i_lat + END IF + +!---------- find v-component wind box corresponding to coordinate + + i_vlox=1_GRID_SI + i_vhix=2_GRID_SI + i_vloy=1_GRID_SI + i_vhiy=2_GRID_SI + + determine_vlon: DO i_cnt=1, i_lon-1 + IF(r_lon(i_cnt) .LT. r_coord(1)) THEN + IF(r_lon(i_cnt +1) .GE. r_coord(1)) THEN + i_vlox= i_cnt + i_vhix= i_cnt+1 + exit determine_vlon + END IF + END IF + END DO determine_vlon + IF(r_lon(i_lon) .LT. r_coord(1)) THEN + i_vlox = i_lon-1 + i_vhix = i_lon + END IF + + determine_vlat: DO i_cnt=1, i_lat-1 + IF(r_vlat(i_cnt) .GE. r_coord(2)) THEN + IF(r_vlat(i_cnt +1) .LT. r_coord(2)) THEN + i_vloy= i_cnt + i_vhiy= i_cnt+1 + exit determine_vlat + END IF + END IF + END DO determine_vlat + IF(r_vlat(i_lat) .GE. r_coord(2)) THEN + i_vloy = i_lat-1 + i_vhiy = i_lat + END IF + +!---------- calculate weights for bilinear interpolation + + r_dx= r_lon(i_vhix)- r_lon(i_vlox) + r_dy= r_lat(i_uhiy)- r_lat(i_uloy) + r_ulx= r_coord(1) - r_ulon(i_ulox) + r_uly= r_coord(2) - r_lat(i_uloy) + r_uhx= r_ulon(i_uhix) - r_coord(1) + r_uhy= r_lat(i_uhiy) - r_coord(2) + r_vlx= r_coord(1) - r_lon(i_vlox) + r_vly= r_coord(2) - r_vlat(i_vloy) + r_vhx= r_lon(i_vhix) - r_coord(1) + r_vhy= r_vlat(i_vhiy) - r_coord(2) + r_scalx=1._GRID_SR/(r_deg*cos(r_radians*r_lat(i_uhiy))) !r_coord(2))) + r_scaly=1._GRID_SR/(r_deg) + +!---------- linear interpolation in x-direction + + IF(r_dx /= 0.0_GRID_SR) THEN + r_dxi= 1._GRID_SR/r_dx + r_l1= (r_uhx* r_flowx(i_ulox, i_uloy, i_tim)+ & + r_ulx* r_flowx(i_uhix, i_uloy, i_tim))* r_dxi + r_h1= (r_uhx* r_flowx(i_ulox, i_uhiy, i_tim)+ & + r_ulx* r_flowx(i_uhix, i_uhiy, i_tim))* r_dxi + r_l2= (r_vhx* r_flowy(i_vlox, i_vloy, i_tim)+ & + r_vlx* r_flowy(i_vhix, i_vloy, i_tim))* r_dxi + r_h2= (r_vhx* r_flowy(i_vlox, i_vhiy, i_tim)+ & + r_vlx* r_flowy(i_vhix, i_vhiy, i_tim))* r_dxi + ELSE + r_l1= r_flowx(i_ulox, i_uloy, i_tim) + r_h1= r_flowx(i_ulox, i_uhiy, i_tim) + r_l2= r_flowy(i_vlox, i_vloy, i_tim) + r_h2= r_flowy(i_vlox, i_vhiy, i_tim) + END IF + +!---------- linear interpolation in y-direction + + IF(r_dy /= 0.0_GRID_SR) THEN + r_dyi= 1._GRID_SR/r_dy + r_inter(1)= (r_uhy* r_l1+ r_uly* r_h1)* r_dyi* r_scalx + r_inter(2)= (r_vhy* r_l2+ r_vly* r_h2)* r_dyi* r_scaly + ELSE + r_inter(1)= r_l1* r_scalx + r_inter(2)= r_l2* r_scaly + END IF + + RETURN + END FUNCTION wind_interpol +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.bar.f90 b/flash2d/src/options/ADV_wind.bar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..655a61cbf6c260489ba9cdbde12e5cb08cc80a26 --- /dev/null +++ b/flash2d/src/options/ADV_wind.bar.f90 @@ -0,0 +1,107 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_dis + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_dif + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate distance from center (0,0) + + r_dif= (/0.5,0.5/)- abs(r_coord) + r_dis= dot_product(r_dif, r_dif)* 4. + +!---------- calculate the advection at (x,y) (velocity increasing) + + r_field(1)= -r_coord(2)* r_dis* r_fac + r_field(2)= r_coord(1)* r_dis* r_fac + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.circ.f90 b/flash2d/src/options/ADV_wind.circ.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f37abfdebe8646ef0c73a7c03e252f7a094c07e7 --- /dev/null +++ b/flash2d/src/options/ADV_wind.circ.f90 @@ -0,0 +1,109 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. done some work for 2d l. mentrup 2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4_GRID_SR + REAL (KIND = GRID_SR) :: r_diag= .1e-3_GRID_SR + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_dist + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), PARAMETER :: r_cntr=(/ 0._GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate the advection at (x,y,z) +!---------- circulating wind in x,y-plane with increasing velocity +!---------- wrt. the distance to r_cntr + + r_tmp= r_coord- r_cntr + r_field(1)= -r_tmp(2)* r_fac + r_field(2)= r_tmp(1)* r_fac + + + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.conv.f90 b/flash2d/src/options/ADV_wind.conv.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5c01dcb30ca790ee20956d5836fb7a511a0e2809 --- /dev/null +++ b/flash2d/src/options/ADV_wind.conv.f90 @@ -0,0 +1,112 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. done some work for 2d l. mentrup 2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4_GRID_SR + REAL (KIND = GRID_SR) :: r_diag= .1e-3_GRID_SR + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_dist + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), PARAMETER :: r_convpoint=(/ 0.75_GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate the advection at (x,y,z) +!---------- point-convergent wind + + r_tmp = r_convpoint - r_coord + r_dist = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + IF (r_dist <= 0.01_GRID_SR) THEN + r_field = 0._GRID_SR + ELSE + r_field = r_tmp * 0.5_GRID_SR*r_fac + ENDIF + + + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.diag.f90 b/flash2d/src/options/ADV_wind.diag.f90 new file mode 100644 index 0000000000000000000000000000000000000000..02d7b1a124315d5755d70ec44262630795a2b3b4 --- /dev/null +++ b/flash2d/src/options/ADV_wind.diag.f90 @@ -0,0 +1,103 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. done some work for 2d l. mentrup 2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4_GRID_SR + REAL (KIND = GRID_SR) :: r_diag= .1e-3_GRID_SR + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate the advection at (x,y) (velocity increasing) +!---------- diagonal wind without shearing in the x,y-plane + + r_field(1)= 0.1_GRID_SR*r_fac + r_field(2)= 0.1_GRID_SR*r_fac + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.file.f90 b/flash2d/src/options/ADV_wind.file.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3f3d59cf9cf9350ccfe420d064091a4916b013c8 --- /dev/null +++ b/flash2d/src/options/ADV_wind.file.f90 @@ -0,0 +1,749 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. bug fix concerning interp. j. behrens 2/98 +! 3. compliant to amatos 1.0 j. behrens 12/2000 +! 4. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_wind + USE GRID_api + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + REAL (KIND = GRID_SR) :: r_intervalfac, r_scalfacx, r_scalfacy, & + r_readlast, r_scalinvx, r_scalinvy + CHARACTER (LEN=32) :: c_prfixx, c_prfixy, c_pofixx, c_pofixy + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_flowx + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_flowy + INTEGER :: i_pointsx, i_pointsy, i_intervallen, & + i_intervalups, i_intervalnum + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_tim + CHARACTER (LEN=67) :: c_xfile, c_yfile + CHARACTER (LEN=35) :: c_tmp + CHARACTER (LEN=3) :: c_num + INTEGER,PARAMETER :: i_iowx=21 + INTEGER,PARAMETER :: i_iowy=23 + INTEGER :: i_iost, i_cnt, j_cnt + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- decide, if data has to be read + + data_read: IF(r_readlast <= r_tim) THEN + +!---------- create filenames + + write(c_num,1000) i_intervalnum + write(c_tmp,*) trim(c_prfixx),c_num + write(c_xfile,*) trim(c_tmp), c_pofixx + c_xfile= adjustl(c_xfile) + write(c_tmp,*) trim(c_prfixy),c_num + write(c_yfile,*) trim(c_tmp), c_pofixy + c_yfile= adjustl(c_yfile) + +!---------- open files + + open(unit= i_iowx, file= c_xfile, status= 'OLD', action= 'READ', iostat= i_iost) + xfile_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: ', c_xfile + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_xfile + CALL grid_error(30) + END IF xfile_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) '[slm_windfield]: opened Filename: ', c_xfile, ' on unit: ', i_iowx + + open(unit= i_iowy, file= c_yfile, status= 'OLD', action= 'READ', iostat= i_iost) + yfile_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: ', c_yfile + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_yfile + CALL grid_error(30) + END IF yfile_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) '[slm_windfield]: opened Filename: ', c_yfile, ' on unit: ', i_iowy + +!---------- read wind data + + read(i_iowx,*) ((r_flowx(i_cnt, j_cnt), i_cnt=1,i_pointsx), j_cnt=1,i_pointsy) + read(i_iowy,*) ((r_flowy(i_cnt, j_cnt), i_cnt=1,i_pointsx), j_cnt=1,i_pointsy) + +!---------- close files + + close(i_iowx) + close(i_iowy) + +!---------- update values for next open + + r_readlast = r_readlast+ r_intervalfac* i_intervallen + i_intervalnum= i_intervalnum+ i_intervallen + END IF data_read + +!---------- interpolate to coordinate + + r_field= data_interpol(r_coord) +! r_field= data_qinterpol(r_coord) +! r_field= data_qlinterpol(r_coord) + + RETURN + 1000 FORMAT(i3.3) + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct) :: p_control + INTEGER :: i_iofil= 19 + CHARACTER (len=io_fillen+i_charlength) :: c_name + CHARACTER (len=80) :: a_filrow + INTEGER :: i_iost, i_ioend, i_alct + +!---------- initialize + + WRITE(c_name,*) trim(p_param%cmd%c_directory),p_control%tst%tst_char(1) + c_name= adjustl(c_name) + c_prfixx= ' ' + c_pofixx= ' ' + c_prfixy= ' ' + c_pofixy= ' ' + +!---------- open wind parameter file + + open(unit= i_iofil, file= c_name, status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: ', c_name + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_name + CALL grid_error(31) + END IF file_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opened file on unit: ', i_iofil + +!---------- read wind parameter file + + read_loop: DO + read(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + close(i_iofil) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT read_loop + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CONTINUE + ELSE IF(a_filrow(1:8) == 'X_PREFIX') THEN comment_line + read(i_iofil,2010) c_prfixx + ELSE IF(a_filrow(1:8) == 'Y_PREFIX') THEN comment_line + read(i_iofil,2010) c_prfixy + ELSE IF(a_filrow(1:8) == 'X_POSTFI') THEN comment_line + read(i_iofil,2010) c_pofixx + ELSE IF(a_filrow(1:8) == 'Y_POSTFI') THEN comment_line + read(i_iofil,2010) c_pofixy + ELSE IF(a_filrow(1:8) == 'X_NUMBER') THEN comment_line + read(i_iofil,*) i_pointsx + ELSE IF(a_filrow(1:8) == 'Y_NUMBER') THEN comment_line + read(i_iofil,*) i_pointsy + ELSE IF(a_filrow(1:8) == 'X_SCALE_') THEN comment_line + read(i_iofil,*) r_scalfacx + ELSE IF(a_filrow(1:8) == 'Y_SCALE_') THEN comment_line + read(i_iofil,*) r_scalfacy + ELSE IF(a_filrow(1:8) == 'NUMBER_O') THEN comment_line + read(i_iofil,*) i_intervallen + ELSE IF(a_filrow(1:8) == 'UPSET_OF') THEN comment_line + read(i_iofil,*) i_intervalups + ELSE IF(a_filrow(1:8) == 'TIME_FAC') THEN comment_line + read(i_iofil,*) r_intervalfac + END IF comment_line + + END IF file_end + END DO read_loop + +!---------- allocate wind data arrays + + IF(allocated(r_flowx)) deallocate(r_flowx) + IF(allocated(r_flowy)) deallocate(r_flowy) + allocate(r_flowy(i_pointsx, i_pointsy), & + r_flowx(i_pointsx, i_pointsy), & + stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(32) + END IF + +!---------- initialize some values + + r_readlast= 0.0_GRID_SR + i_intervalnum= i_intervalups + r_scalinvx= 1.0_GRID_SR/ r_scalfacx + r_scalinvy= 1.0_GRID_SR/ r_scalfacy + + RETURN + 2000 FORMAT(a80) + 2010 FORMAT(a32) + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + +!---------- deallocate wind data arrays + + DEALLOCATE(r_flowx, r_flowy) + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION data_interpol(r_coord) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + INTEGER :: i_lox, i_hix, i_loy, i_hiy + REAL (KIND = GRID_SR) :: r_dx, r_dy, r_lx, r_hx, & + r_ly, r_hy, r_l1, r_h1, r_l2, r_h2, r_dxi, r_dyi + +!---------- find wind box corresponding to coordinate + + i_lox= FLOOR(r_coord(1)) + i_loy= FLOOR(r_coord(2)) +!-- preliminary bug fix + IF(i_lox < 1) i_lox=1 + IF(i_lox >= i_pointsx) i_lox= i_pointsx-1 + IF(i_loy < 1) i_loy=1 + IF(i_loy >= i_pointsy) i_loy= i_pointsy-1 +!-- end of preliminary bug fix + i_hix= i_lox+ 1 + i_hiy= i_loy+ 1 + +!---------- calculate weights for bilinear interpolation + + r_dx= REAL(i_hix- i_lox, GRID_SR) + r_dy= REAL(i_hiy- i_loy, GRID_SR) + r_lx= r_coord(1) - REAL(i_lox, GRID_SR) + r_ly= r_coord(2) - REAL(i_loy, GRID_SR) + r_hx= REAL(i_hix, GRID_SR) - r_coord(1) + r_hy= REAL(i_hiy, GRID_SR) - r_coord(2) + +!---------- linear interpolation in x-direction + + IF(r_dx /= 0.0_GRID_SR) THEN + r_dxi= 1._GRID_SR/r_dx + r_l1= (r_hx* r_flowx(i_lox, i_loy)+ & + r_lx* r_flowx(i_hix, i_loy))* r_dxi + r_h1= (r_hx* r_flowx(i_lox, i_hiy)+ & + r_lx* r_flowx(i_hix, i_hiy))* r_dxi + r_l2= (r_hx* r_flowy(i_lox, i_loy)+ & + r_lx* r_flowy(i_hix, i_loy))* r_dxi + r_h2= (r_hx* r_flowy(i_lox, i_hiy)+ & + r_lx* r_flowy(i_hix, i_hiy))* r_dxi + ELSE + r_l1= r_flowx(i_lox, i_loy) + r_h1= r_flowx(i_lox, i_hiy) + r_l2= r_flowy(i_lox, i_loy) + r_h2= r_flowy(i_lox, i_hiy) + END IF + +!---------- linear interpolation in y-direction + + IF(r_dy /= 0.0_GRID_SR) THEN + r_dyi= 1._GRID_SR/r_dy + r_inter(1)= (r_hy* r_l1+ r_ly* r_h1)* r_dyi* r_scalinvx + r_inter(2)= (r_hy* r_l2+ r_ly* r_h2)* r_dyi* r_scalinvy + ELSE + r_inter(1)= r_l1* r_scalinvx + r_inter(2)= r_l2* r_scalinvy + END IF + + RETURN + END FUNCTION data_interpol + +!***************************************************************** + FUNCTION data_qinterpol(r_coord) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + INTEGER :: i_lox, i_hix, i_loy, i_hiy, i_mdx, i_mdy + REAL (KIND = GRID_SR) :: r_cx, r_cy + REAL (KIND = GRID_SR), DIMENSION(3) :: r_u, r_v, r_x, r_y + REAL (KIND = GRID_SR) :: r_err + REAL (KIND = GRID_SR) :: r_ep, r_eps + +!---------- determine machine precision + + r_ep= 1.0_GRID_SR + r_eps= epsilon(r_ep) + +!---------- find wind box corresponding to coordinate + + i_lox= FLOOR(r_coord(1)) + i_loy= FLOOR(r_coord(2)) +!-- preliminary bug fix + IF(i_lox < 1) i_lox=1 + IF(i_lox >= i_pointsx) i_lox= i_pointsx-2 + IF(i_loy < 1) i_loy=1 + IF(i_loy >= i_pointsy) i_loy= i_pointsy-2 +!-- end of preliminary bug fix + i_mdx= i_lox+ 1 + i_mdy= i_loy+ 1 + i_hix= i_lox+ 2 + i_hiy= i_loy+ 2 + +!---------- near the domain boundary, do a linear interpolation (only for square) + + IF(i_lox < 2 .OR. i_loy < 2 .OR. i_hix > i_pointsx-1 .OR. i_hiy > i_pointsy-1) THEN + r_inter= data_interpol(r_coord) + RETURN + END IF + +!---------- coefficients for quadratic interpolation in x + + r_cx= r_coord(1) + r_cy= r_coord(2) + + r_x= (/ REAL(i_lox, GRID_SR), REAL(i_mdx, GRID_SR), REAL(i_hix, GRID_SR) /) + r_y= (/ REAL(i_loy, GRID_SR), REAL(i_mdy, GRID_SR), REAL(i_hiy, GRID_SR) /) + +!---------- check for coordinate identity in x + + IF(abs(r_cx- r_x(1)) < r_eps) THEN + r_u= (/ r_flowx(i_lox, i_loy), r_flowx(i_lox, i_mdy), r_flowx(i_lox, i_hiy) /) + r_v= (/ r_flowy(i_lox, i_loy), r_flowy(i_lox, i_mdy), r_flowy(i_lox, i_hiy) /) + ELSE IF(abs(r_cx- r_x(2)) < r_eps) THEN + r_u= (/ r_flowx(i_mdx, i_loy), r_flowx(i_mdx, i_mdy), r_flowx(i_mdx, i_hiy) /) + r_v= (/ r_flowy(i_mdx, i_loy), r_flowy(i_mdx, i_mdy), r_flowy(i_mdx, i_hiy) /) + ELSE IF(abs(r_cx- r_x(3)) < r_eps) THEN + r_u= (/ r_flowx(i_hix, i_loy), r_flowx(i_hix, i_mdy), r_flowx(i_hix, i_hiy) /) + r_v= (/ r_flowy(i_hix, i_loy), r_flowy(i_hix, i_mdy), r_flowy(i_hix, i_hiy) /) + ELSE + +!---------- quadratic interpolation in x + + r_u(1)= poly_1d(2, r_x, & + (/ r_flowx(i_lox, i_loy), r_flowx(i_mdx, i_loy), r_flowx(i_hix, i_loy) /), & + r_cx, r_err) + r_u(2)= poly_1d(2, r_x, & + (/ r_flowx(i_lox, i_mdy), r_flowx(i_mdx, i_mdy), r_flowx(i_hix, i_mdy) /), & + r_cx, r_err) + r_u(3)= poly_1d(2, r_x, & + (/ r_flowx(i_lox, i_hiy), r_flowx(i_mdx, i_hiy), r_flowx(i_hix, i_hiy) /), & + r_cx, r_err) + + r_v(1)= poly_1d(2, r_x, & + (/ r_flowy(i_lox, i_loy), r_flowy(i_mdx, i_loy), r_flowy(i_hix, i_loy) /), & + r_cx, r_err) + r_v(2)= poly_1d(2, r_x, & + (/ r_flowy(i_lox, i_mdy), r_flowy(i_mdx, i_mdy), r_flowy(i_hix, i_mdy) /), & + r_cx, r_err) + r_v(3)= poly_1d(2, r_x, & + (/ r_flowy(i_lox, i_hiy), r_flowy(i_mdx, i_hiy), r_flowy(i_hix, i_hiy) /), & + r_cx, r_err) + END IF + +!---------- check for coordinate identity in y + + IF(abs(r_cy- r_y(1)) < r_eps) THEN + r_inter(1)= r_u(1)* r_scalinvx + r_inter(2)= r_v(1)* r_scalinvy + ELSE IF(abs(r_cy- r_y(2)) < r_eps) THEN + r_inter(1)= r_u(2)* r_scalinvx + r_inter(2)= r_v(2)* r_scalinvy + ELSE IF(abs(r_cy- r_y(3)) < r_eps) THEN + r_inter(1)= r_u(3)* r_scalinvx + r_inter(2)= r_v(3)* r_scalinvy + ELSE + +!---------- quadratic interpolation in y + + r_inter(1)= poly_1d(2, r_y, r_u, r_cy, r_err)* r_scalinvx + r_inter(2)= poly_1d(2, r_y, r_v, r_cy, r_err)* r_scalinvy + END IF + + RETURN + END FUNCTION data_qinterpol + +!***************************************************************** + FUNCTION data_qlinterpol(r_coord) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + INTEGER :: i_lox, i_hix, i_loy, i_hiy, i_mdx, i_mdy + REAL (KIND = GRID_SR) :: r_x, r_y, r_x1, r_x2, r_x3, & + r_y1, r_y2, r_y3, r_u1, r_u2, r_u3, r_v1, r_v2, r_v3 + REAL (KIND = GRID_SR) :: r_ep, r_eps + +!---------- determine machine precision + + r_ep= 1.0_GRID_SR + r_eps= epsilon(r_ep) + +!---------- find wind box corresponding to coordinate + + i_lox= FLOOR(r_coord(1)) + i_loy= FLOOR(r_coord(2)) +!-- preliminary bug fix + IF(i_lox < 1) i_lox=1 + IF(i_lox >= i_pointsx) i_lox= i_pointsx-2 + IF(i_loy < 1) i_loy=1 + IF(i_loy >= i_pointsy) i_loy= i_pointsy-2 +!-- end of preliminary bug fix + i_mdx= i_lox+ 1 + i_mdy= i_loy+ 1 + i_hix= i_lox+ 2 + i_hiy= i_loy+ 2 + +!---------- near the domain boundary, do a linear interpolation (only for square) + + IF(i_lox < 2 .OR. i_loy < 2 .OR. i_hix > i_pointsx-1 .OR. i_hiy > i_pointsy-1) THEN + r_inter= data_interpol(r_coord) + RETURN + END IF + +!---------- coefficients for quadratic interpolation in x + + r_x= r_coord(1) + r_y= r_coord(2) + + r_x1= REAL(i_lox, GRID_SR) + r_x2= REAL(i_mdx, GRID_SR) + r_x3= REAL(i_hix, GRID_SR) + + r_y1= REAL(i_loy, GRID_SR) + r_y2= REAL(i_mdy, GRID_SR) + r_y3= REAL(i_hiy, GRID_SR) + +!---------- check for coordinate identity in x + + IF(abs(r_x- r_x1) < r_eps) THEN + r_u1= r_flowx(i_lox, i_loy) + r_u2= r_flowx(i_lox, i_mdy) + r_u3= r_flowx(i_lox, i_hiy) + r_v1= r_flowy(i_lox, i_loy) + r_v2= r_flowy(i_lox, i_mdy) + r_v3= r_flowy(i_lox, i_hiy) + ELSE IF(abs(r_x- r_x2) < r_eps) THEN + r_u1= r_flowx(i_mdx, i_loy) + r_u2= r_flowx(i_mdx, i_mdy) + r_u3= r_flowx(i_mdx, i_hiy) + r_v1= r_flowy(i_mdx, i_loy) + r_v2= r_flowy(i_mdx, i_mdy) + r_v3= r_flowy(i_mdx, i_hiy) + ELSE IF(abs(r_x- r_x3) < r_eps) THEN + r_u1= r_flowx(i_hix, i_loy) + r_u2= r_flowx(i_hix, i_mdy) + r_u3= r_flowx(i_hix, i_hiy) + r_v1= r_flowy(i_hix, i_loy) + r_v2= r_flowy(i_hix, i_mdy) + r_v3= r_flowy(i_hix, i_hiy) + ELSE + +!---------- quadratic interpolation in x + + r_u1= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowx(i_lox, i_loy), r_flowx(i_mdx, i_loy), r_flowx(i_hix, i_loy)) + r_u2= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowx(i_lox, i_mdy), r_flowx(i_mdx, i_mdy), r_flowx(i_hix, i_mdy)) + r_u3= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowx(i_lox, i_hiy), r_flowx(i_mdx, i_hiy), r_flowx(i_hix, i_hiy)) + + r_v1= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowy(i_lox, i_loy), r_flowy(i_mdx, i_loy), r_flowy(i_hix, i_loy)) + r_v2= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowy(i_lox, i_mdy), r_flowy(i_mdx, i_mdy), r_flowy(i_hix, i_mdy)) + r_v3= lagrange(r_x, r_x1, r_x2, r_x3, & + r_flowy(i_lox, i_hiy), r_flowy(i_mdx, i_hiy), r_flowy(i_hix, i_hiy)) + END IF + +!---------- check for coordinate identity in y + + IF(abs(r_y- r_y1) < r_eps) THEN + r_inter(1)= r_u1* r_scalinvx + r_inter(2)= r_v1* r_scalinvy + ELSE IF(abs(r_y- r_y2) < r_eps) THEN + r_inter(1)= r_u2* r_scalinvx + r_inter(2)= r_v2* r_scalinvy + ELSE IF(abs(r_y- r_y3) < r_eps) THEN + r_inter(1)= r_u3* r_scalinvx + r_inter(2)= r_v3* r_scalinvy + ELSE + +!---------- quadratic interpolation in y + + r_inter(1)= lagrange(r_y, r_y1, r_y2, r_y3, r_u1, r_u2, r_u3)* r_scalinvx + r_inter(2)= lagrange(r_y, r_y1, r_y2, r_y3, r_v1, r_v2, r_v3)* r_scalinvy + END IF + + RETURN + END FUNCTION data_qlinterpol + +!***************************************************************** + FUNCTION lagrange(r_x, r_x1, r_x2, r_x3, r_y1, r_y2, r_y3) RESULT (r_y) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR) :: r_x, r_x1, r_x2, r_x3, r_y, r_y1, r_y2, r_y3 + REAL (KIND = GRID_SR) :: r_d12, r_d23, r_d13, r_dx1, r_dx2, r_dx3 + +!---------- calculate differences + + r_d12= r_x1- r_x2 + r_d13= r_x1- r_x3 + r_d23= r_x2- r_x3 + + r_dx1= r_x- r_x1 + r_dx2= r_x- r_x2 + r_dx3= r_x- r_x3 + +!---------- calculate lagrangian + + r_y= (r_dx2* r_dx3)/( r_d12* r_d13)* r_y1+ & + (r_dx1* r_dx3)/(-r_d12* r_d23)* r_y2+ & + (r_dx1* r_dx2)/(-r_d13* (-r_d23))* r_y3 + + RETURN + END FUNCTION lagrange + +!***************************************************************** + FUNCTION solv_3x3(r_mat, r_rhs, i_err) RESULT (r_sol) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(3,3) :: r_mat + REAL (KIND = GRID_SR), DIMENSION(3) :: r_rhs, r_sol + INTEGER :: i_err + INTEGER :: i_cnt, j_cnt, l_cnt, i_ind + REAL (KIND = GRID_SR) :: r_tmp, r_fac, r_caf + +!---------- set error flag + + i_err= 0 + +!---------- do the lr decomposition + + lr_outer: DO i_cnt=1,2 + +!---------- perform pivoting + + pivot: IF(r_mat(i_cnt,i_cnt) == 0.0_GRID_SR) THEN + i_ind= i_cnt+ 1 + IF(r_mat(i_ind,i_cnt) == 0.0_GRID_SR) i_ind= MIN(i_cnt+2,3) + IF(r_mat(i_ind,i_cnt) == 0.0_GRID_SR) THEN + i_err= -1 + r_sol= 0.0_GRID_SR + RETURN + END IF + pivot_inner: DO j_cnt=1,3 + r_tmp = r_mat(i_cnt,j_cnt) + r_mat(i_cnt,j_cnt)= r_mat(i_ind,j_cnt) + r_mat(i_ind,j_cnt)= r_tmp + END DO pivot_inner + r_tmp = r_rhs(i_cnt) + r_rhs(i_cnt)= r_rhs(i_ind) + r_rhs(i_ind)= r_tmp + END IF pivot + +!---------- now the elimination + + r_fac= 1.0_GRID_SR/ r_mat(i_cnt,i_cnt) + lr_middle: DO j_cnt= i_cnt+1,3 + r_caf= r_mat(j_cnt,i_cnt)* r_fac + r_rhs(j_cnt)= r_rhs(j_cnt)- r_rhs(i_cnt)* r_caf + lr_inner: DO l_cnt= i_cnt+1,3 + r_mat(j_cnt,l_cnt)= r_mat(j_cnt,l_cnt)- r_mat(i_cnt,l_cnt)* r_caf + END DO lr_inner + END DO lr_middle + END DO lr_outer + +!---------- do the backward substitution + + r_sol(3)= r_sol(3)/ r_mat(3,3) + subst_outer: DO i_cnt=2,1,-1 + r_fac= 1.0/ r_mat(i_cnt,i_cnt) + r_sol(i_cnt)= r_rhs(i_cnt)* r_fac + subst_inner: DO j_cnt=i_cnt+1,3 + r_sol(i_cnt)= r_sol(i_cnt)- r_sol(j_cnt)* r_mat(i_cnt,j_cnt)* r_fac + END DO subst_inner + END DO subst_outer + + RETURN + END FUNCTION solv_3x3 + +!***************************************************************** + FUNCTION qfunc(r_coo, r_coe) RESULT (r_val) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR) :: r_coo, r_val + REAL (KIND = GRID_SR), DIMENSION(3) :: r_coe + +!---------- evaluate quadratic function + + r_val= r_coo* r_coo* r_coe(1)+ r_coo* r_coe(2)+ r_coe(3) + + RETURN + END FUNCTION qfunc +!***************************************************************** + FUNCTION poly_1d(i_ord, r_xi, r_yi, r_coo, r_dy) RESULT (r_val) + +!---------- local declarations + + IMPLICIT NONE + INTEGER :: i_ord + REAL (KIND = GRID_SR), DIMENSION(:) :: r_xi, r_yi + REAL (KIND = GRID_SR) :: r_coo, r_dy, r_val + REAL (KIND = GRID_SR) :: r_dif, r_dift, r_ho, r_hp, r_w, r_den, r_eps, r_ep + INTEGER :: i_ns, i_cnt, j_cnt + INTEGER, PARAMETER :: i_mxord=5 + REAL (KIND = GRID_SR), DIMENSION(i_mxord) :: r_c, r_d + +!---------- + + IF(i_ord >= i_mxord) THEN + CALL grid_error(33) + END IF + +! r_ep= 1.0 +! r_eps= epsilon(r_ep) + + i_ns= 1 + r_dif= abs(r_coo- r_xi(1)) + + DO i_cnt= 1, i_ord+ 1 + r_dift= abs(r_coo- r_xi(i_cnt)) + IF(r_dift < r_eps) THEN + r_val= r_yi(i_cnt) + RETURN + END IF + IF(r_dift < r_dif) THEN + i_ns= i_cnt + r_dif= r_dift + END IF + r_c(i_cnt)= r_yi(i_cnt) + r_d(i_cnt)= r_yi(i_cnt) + END DO + + r_val= r_yi(i_ns) + i_ns= i_ns- 1 + + DO j_cnt= 1, i_ord + DO i_cnt= 1, i_ord+1-j_cnt + r_ho= r_xi(i_cnt)- r_coo + r_hp= r_xi(i_cnt+j_cnt)- r_coo + r_w= r_c(i_cnt+1)- r_d(i_cnt) + r_den= r_ho- r_hp + IF(r_den == 0.0) THEN + CALL grid_error(34) + END IF + r_den= r_w/ r_den + r_d(i_cnt)= r_hp* r_den + r_c(i_cnt)= r_ho* r_den + END DO + + IF(2*i_ns < i_ord+1-j_cnt) THEN + r_dy= r_c(i_ns+1) + ELSE + r_dy= r_d(i_ns) + i_ns= i_ns- 1 + END IF + r_val= r_val+ r_dy + END DO + + RETURN + END FUNCTION poly_1d +!***************************************************************** +! FUNCTION dist(r_coo1, r_coo2) RESULT (r_dist) + +!---------- local declarations + +! IMPLICIT NONE +! REAL, DIMENSION(2) :: r_coo1, r_coo2 +! REAL :: r_dist +! REAL :: r_d1, r_d2 + +!---------- calculate distance between the two + +! r_d1= (r_coo1(1)- r_coo2(1)) +! r_d2= (r_coo1(2)- r_coo2(2)) +! r_dist= sqrt((r_d1*r_d1+ r_d2*r_d2)) + +! RETURN +! END FUNCTION dist + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.kaeser.f90 b/flash2d/src/options/ADV_wind.kaeser.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d7cb8f7dfeff4994fb6e01dd5f1df7f4c9dfff89 --- /dev/null +++ b/flash2d/src/options/ADV_wind.kaeser.f90 @@ -0,0 +1,128 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! according to kaeser test case (cf. phd thesis of M. Kaeser) +! but with modified coefficients (l. mentrup) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. kaeser test case implemented l. mentrup 12/2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4_GRID_SR + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_dist + REAL (KIND = GRID_SR) :: r_phi, r_sin + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), PARAMETER :: r_cntr=(/ 0._GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate the advection at (x,y) +!---------- circulating wind in x,y-plane with increasing velocity +!---------- wrt. the distance to r_cntr +!---------- this test case corresponds to the kaeser test case with slightly other +!---------- wind data, so that the tracer is circulated in 0,75 days + + r_tmp= r_coord- r_cntr + IF (r_tmp(1) > 0._GRID_SR) THEN + IF (r_tmp(2) >= 0._GRID_SR) THEN + r_phi = ATAN(r_tmp(2)/r_tmp(1)) + r_sin = 1.5_GRID_SR*COS(2_GRID_SR*r_phi) + 2.5_GRID_SR + + r_field(1) = -r_tmp(2)* r_sin * r_fac + r_field(2) = r_tmp(1)* r_sin * r_fac + ELSE + r_phi = ATAN(-1*r_tmp(2)/r_tmp(1)) + r_sin = 1.5_GRID_SR*COS(2_GRID_SR*r_phi) + 2.5_GRID_SR + + r_field(1) = -r_tmp(2)* r_sin * r_fac + r_field(2) = r_tmp(1)* r_sin * r_fac + END IF + ELSE + r_field(1)= -r_tmp(2)* r_fac + r_field(2)= r_tmp(1)* r_fac + END IF + + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.leveque.f90 b/flash2d/src/options/ADV_wind.leveque.f90 new file mode 100644 index 0000000000000000000000000000000000000000..52af12a9afaeb4ae60838531bb6d282ba06da08f --- /dev/null +++ b/flash2d/src/options/ADV_wind.leveque.f90 @@ -0,0 +1,115 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. done some work for 2d l. mentrup 2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4_GRID_SR + REAL (KIND = GRID_SR) :: r_end=1.5_GRID_SR + REAL (KIND = GRID_SR) :: r_diag= .1e-3_GRID_SR + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), PARAMETER :: r_cntr=(/ 0._GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR) :: r_px, r_py, r_pt, & + r_2px, r_2py + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate the advection at (x,y,z) +!---------- circulating wind in x,y-plane with increasing velocity +!---------- wrt. the distance to r_cntr + + r_px= GRID_PI* r_coord(1) + r_py= GRID_PI* r_coord(2) + r_2px= 2_GRID_SR* GRID_PI* r_coord(1) + r_2py= 2_GRID_SR* GRID_PI* r_coord(2) + r_pt= (GRID_PI* r_tim)/ r_end + r_tmp= sin(r_px)* sin(r_px)* sin(r_2py)* cos(r_pt) + r_field(1)= r_tmp + r_tmp= -(sin(r_py)* sin(r_py))* sin(r_2px)* cos(r_pt) + r_field(2)= r_tmp + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.nowind.f90 b/flash2d/src/options/ADV_wind.nowind.f90 new file mode 100644 index 0000000000000000000000000000000000000000..c3ea6c143579c15034bb5fb174fbed2db22c9779 --- /dev/null +++ b/flash2d/src/options/ADV_wind.nowind.f90 @@ -0,0 +1,91 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. done some work for 2d l. mentrup 2003 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + +!---------- no wind! + + + r_field(:)= 0. + + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.vortex.f90 b/flash2d/src/options/ADV_wind.vortex.f90 new file mode 100644 index 0000000000000000000000000000000000000000..04adb4ecbf4e6bb4ae4d1356626a0824955c19ad --- /dev/null +++ b/flash2d/src/options/ADV_wind.vortex.f90 @@ -0,0 +1,139 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! according to vortex test case (cf. Nair 2006) +! but with modified coefficients (l. mentrup) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force field for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version l. mentrup 12/2006 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coo, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coo + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_rvec, r_vvec, r_field + + REAL (KIND = GRID_SR) :: r_dlt = 0.05_GRID_SR ! controls the width of the decay from value 2 to value 0 + REAL (KIND = GRID_SR) :: r_vnot = 2.598_GRID_SR ! tangential velocity such that omega < 1. + REAL (KIND = GRID_SR) :: r_scale = 86400._GRID_SR ! scale on one day + REAL (KIND = GRID_SR) :: r_eps = 1.E-6_GRID_SR + + REAL (KIND = GRID_SR) :: r_t + REAL (KIND = GRID_SR) :: r_r + + REAL (KIND = GRID_SR) :: r_vt, r_tanh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), PARAMETER :: r_ctr=(/ 0._GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + +!---------- initialize + +!---------- set time + + IF(present(r_time)) THEN + r_t= r_time + ELSE + r_t= 0.0_GRID_SR + END IF + +!---------- compute the windfield at (x,y) +!---------- vortex wind in x,y-plane + + r_rvec = (r_coo - r_ctr) + r_r = twonorm(r_rvec) * GRID_PI * 2._GRID_SR ! scale the domain from [-0.5,0,5]to [-Pi, Pi] + + IF (r_r <= r_eps) THEN + r_field = 0._GRID_SR + ELSE + r_tanh = tanh(r_r) + r_vt = (1._GRID_SR - r_tanh*r_tanh) * r_tanh * r_vnot * GRID_PI / r_scale + r_vvec = (/ -r_rvec(2), r_rvec(1) /) / r_r + r_field = r_vt * r_vvec + END IF + + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION twonorm(r_vector) RESULT(r_nrm) + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vector + REAL (KIND = GRID_SR) :: r_nrm + + INTEGER :: i_cnt + + r_nrm = 0._GRID_SR + r_nrm = dot_product(r_vector, r_vector) + r_nrm = sqrt(r_nrm) + + END FUNCTION twonorm + + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind.zonal.f90 b/flash2d/src/options/ADV_wind.zonal.f90 new file mode 100644 index 0000000000000000000000000000000000000000..529ca48ba3c28bd90310e561685b5c31c4b11393 --- /dev/null +++ b/flash2d/src/options/ADV_wind.zonal.f90 @@ -0,0 +1,104 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. compliant to amatos 1.0 j. behrens 12/2000 +! 3. compliant to amatos 1.2 j. behrens 3/2002 +! +!***************************************************************** + MODULE ADV_wind + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + REAL (KIND = GRID_SR), SAVE :: r_fac + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_tim + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate the advection at (x,y) (velocity increasing) +! this is for the shifted unit sqare! + + r_field(1)= r_fac + r_field(2)= 0._GRID_SR + + RETURN + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + TYPE (control_struct) :: p_control + + r_fac=1._GRID_SR/(p_control%num%r_deltatime*20._GRID_SR) + p_control%tst%tst_real(1,2)= r_fac + + RETURN + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind_aviso.file.f90 b/flash2d/src/options/ADV_wind_aviso.file.f90 new file mode 100644 index 0000000000000000000000000000000000000000..47bc0e5bc30c61e364d3a2aefdf6a3f2b6f90627 --- /dev/null +++ b/flash2d/src/options/ADV_wind_aviso.file.f90 @@ -0,0 +1,469 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. bug fix concerning interp. j. behrens 2/98 +! 3. compliant to amatos 1.0 j. behrens 12/2000 +! 4. compliant to amatos 1.2 j. behrens 3/2002 +! 5. new version for course tracer transport j. behrens 01/2012 +! +!***************************************************************** + MODULE ADV_wind + USE GRID_api + USE FLASH_parameters + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + REAL (KIND = GRID_SR) :: r_intervallen, r_readlast + REAL (KIND = GRID_SR) :: r_ncupdatelast, r_secperstep + CHARACTER (LEN=128) :: c_windpath + CHARACTER (LEN=64), DIMENSION(:), ALLOCATABLE :: c_windfile + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowx + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowy + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lat + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lon + INTEGER (KIND = GRID_SI) :: i_lon, i_lat, i_timesteps, i_numfiles + INTEGER (KIND = GRID_SI) :: i_pointsx, i_pointsy + INTEGER (KIND = GRID_SI) :: i_timeinterval, i_intervalnum, i_stepcounter + + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_tim + CHARACTER (LEN=192) :: c_ncfile + INTEGER (KIND = GRID_SI) :: i_iost, i_cnt, j_cnt + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- decide, if data has to be read + + data_read: IF(r_readlast <= r_tim) THEN + +!---------- update values for next open + + r_readlast = r_readlast+ r_intervallen + i_timeinterval= i_timeinterval+ 1 + IF(i_timeinterval > i_numfiles) THEN + CALL grid_error(i_error=1,c_error='[slm_windfield]: no more current files in list, fixing last one') + i_timeinterval = i_numfiles + END IF + i_stepcounter = 0_GRID_SI + +!---------- create filenames + + write(c_ncfile,*) trim(c_windpath),c_windfile(i_timeinterval) + c_ncfile= adjustl(c_ncfile) + +!---------- read current data from NetCDF file + + CALL read_netcdf_currents(c_ncfile) + + END IF data_read + +!---------- decide, if counter needs to be updated + + update_nccount: IF(r_ncupdatelast <= r_tim) THEN + i_stepcounter= i_stepcounter+1 + IF(i_stepcounter > i_timesteps) & + CALL grid_error(c_error='[slm_windfield]: step counter overflow!') + r_ncupdatelast= r_ncupdatelast+ r_secperstep + END IF update_nccount + +!---------- interpolate to coordinate + + r_field= data_interpol(r_coord,i_stepcounter) + + RETURN + 1000 FORMAT(i3.3) + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE read_netcdf_currents(c_filename) + +!---------- local declarations + + IMPLICIT NONE + INCLUDE "netcdf.inc" + +!---------- input parameters + CHARACTER (LEN=192), INTENT(in) :: c_filename + +!---------- local variables + INTEGER (KIND = GRID_SI) :: i_alct, i_ncstat + INTEGER (KIND = GRID_SI) :: i_fileid + INTEGER (KIND = GRID_SI) :: i_dimid, i_varid + INTEGER (KIND = GRID_SI) :: i_tm, i_ln, i_lt, i_tmaux + INTEGER*4, DIMENSION(:,:,:), ALLOCATABLE :: i_u, i_v + REAL, DIMENSION(:), ALLOCATABLE :: r_auxlat + REAL, DIMENSION(:), ALLOCATABLE :: r_auxlon + +!---------- open current file + + i_ncstat= nf_open(trim(c_filename),NF_NOWRITE,i_fileid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not open currents data file') + +!---------- determine lon/lat/time dimension sizes (grid size of currents field) + + i_ncstat= nf_inq_dimid(i_fileid, 'lon', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lon dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_lon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon dimension') + + i_ncstat= nf_inq_dimid(i_fileid, 'lat', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lat dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_lat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat dimension') + + i_ncstat= nf_inq_dimid(i_fileid, 'time', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify time dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_tmaux) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read time dimension') + IF(i_tmaux .NE. i_timesteps) & + CALL grid_error(c_error='[read_netcdf_currents]: incompatible time step count') + +!---------- allocate latitude and longitude coordinate arrays +! NOTE: if lat or lon are allocated, we do not need to read +! them again, since we expect to have same sized data files! + + latlon: IF((.NOT. ALLOCATED(r_lat)) .OR. (.NOT. ALLOCATED(r_lon))) THEN + ALLOCATE(r_lat(i_lat), r_lon(i_lon), r_auxlat(i_lat), r_auxlon(i_lon), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate lat/lon field') + +!---------- read latitude and longitude coordinate values + + i_ncstat= nf_inq_varid(i_fileid, 'lon', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lon varid') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_auxlon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon data') + r_lon= REAL(r_auxlon, GRID_SR) + + i_ncstat= nf_inq_varid(i_fileid, 'lat', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lat varid') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_auxlat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat data') + r_lat= REAL(r_auxlat, GRID_SR) + DEALLOCATE(r_auxlat, r_auxlon) + END IF latlon + +!---------- allocate current data arrays + IF((.NOT. ALLOCATED(r_flowx)) .OR. (.NOT. ALLOCATED(r_flowy))) THEN + ALLOCATE(r_flowx(i_lon, i_lat, i_timesteps), r_flowy(i_lon, i_lat, i_timesteps), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate currents fields') + END IF + ALLOCATE(i_u(i_lon, i_lat, i_timesteps), i_v(i_lon, i_lat, i_timesteps), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate local currents fields') + +!---------- read x-/y-direction data of currents + + i_ncstat= nf_inq_varid(i_fileid, 'u', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of var49') + i_ncstat= nf_get_var_int(i_fileid, i_varid, i_u) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read var49 data') + + i_ncstat= nf_inq_varid(i_fileid, 'v', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of var50') + i_ncstat= nf_get_var_int(i_fileid, i_varid, i_v) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read var50 data') + +!---------- Fix mask values + + DO i_tm=1,i_timesteps + DO i_lt= 1,i_lat + DO i_ln= 1,i_lon + IF(i_u(i_ln,i_lt,i_tm) == -2147483647) THEN + r_flowx(i_ln,i_lt,i_tm)= 0._GRID_SR + ELSE + r_flowx(i_ln,i_lt,i_tm)= REAL(i_u(i_ln,i_lt,i_tm),GRID_SR)* 0.0001_GRID_SR + END IF + IF(i_v(i_ln,i_lt,i_tm) == -2147483647) THEN + r_flowy(i_ln,i_lt,i_tm)= 0._GRID_SR + ELSE + r_flowy(i_ln,i_lt,i_tm)= REAL(i_v(i_ln,i_lt,i_tm),GRID_SR)* 0.0001_GRID_SR + END IF + END DO + END DO + END DO + +!---------- deallocate local arrays + + DEALLOCATE(i_u,i_v) + +!---------- close currents file + + i_ncstat= nf_close(i_fileid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not close currents data file') + + END SUBROUTINE read_netcdf_currents + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct) :: p_control + INTEGER :: i_iofil= 19 + CHARACTER (len=io_fillen+i_charlength) :: c_name + CHARACTER (len=128) :: a_filrow + INTEGER :: i_iost, i_ioend, i_alct, i_cnt + +!---------- initialize + + WRITE(c_name,*) trim(p_param%cmd%c_directory),p_control%tst%tst_char(1) + c_name= adjustl(c_name) + c_windpath= p_param%cmd%c_directory + i_numfiles= -1 + +!---------- open wind parameter file + + open(unit= i_iofil, file= c_name, status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: ', c_name + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: ', c_name + CALL grid_error(c_error='[slm_windinit]: could not open wind parameters file') + END IF file_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opened file on unit: ', i_iofil + +!---------- read wind parameter file + + read_loop: DO + read(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + close(i_iofil) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT read_loop + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CONTINUE + ELSE IF(a_filrow(1:8) == 'ABS_PATH') THEN comment_line + read(i_iofil,2000) c_windpath + ELSE IF(a_filrow(1:8) == 'SEC_PER_') THEN comment_line + read(i_iofil,*) r_secperstep + ELSE IF(a_filrow(1:8) == 'STEPS_PE') THEN comment_line + read(i_iofil,*) i_timesteps + ELSE IF(a_filrow(1:8) == 'INFILE_N') THEN comment_line + read(i_iofil,*) i_numfiles + ALLOCATE(c_windfile(i_numfiles), stat=i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[slm_windinit]: could not allocate windname array') + ELSE IF(a_filrow(1:8) == 'FILE_LIS') THEN comment_line + IF(i_numfiles < 1) & + CALL grid_error(c_error='[slm_windinit]: number of wind files unknown') + DO i_cnt=1,i_numfiles + c_windfile(i_cnt)= ' ' + read(i_iofil,2010) c_windfile(i_cnt) + END DO + END IF comment_line + + END IF file_end + END DO read_loop + +!---------- initialize some values + + r_readlast = 0.0_GRID_SR + r_ncupdatelast = 0.0_GRID_SR + i_timeinterval = 0_GRID_SI + i_stepcounter = 0_GRID_SI + r_intervallen = r_secperstep* i_timesteps + + RETURN + 2000 FORMAT(a128) + 2010 FORMAT(a64) + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + +!---------- deallocate wind data arrays + + DEALLOCATE(r_flowx, r_flowy) + DEALLOCATE(r_lon, r_lat) + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION data_interpol(r_coord, i_tim) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + INTEGER (KIND = GRID_SI) :: i_tim + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + INTEGER (KIND = GRID_SI) :: i_lox, i_hix, i_loy, i_hiy, i_cnt + REAL (KIND = GRID_SR) :: r_dx, r_dy, r_lx, r_hx, & + r_ly, r_hy, r_l1, r_h1, r_l2, r_h2, r_dxi, r_dyi + REAL (KIND = GRID_SR) :: r_scalx, r_scaly + REAL (KIND = GRID_SR) :: r_deg, r_radians + REAL (KIND = GRID_SR), PARAMETER :: r_earth=6.371e6_GRID_SR ! earth's radius + +!---------- initialize radians + + r_radians= GRID_PI/180._GRID_SR + r_deg= r_radians* r_earth + +!---------- find wind box corresponding to coordinate + + i_lox=1_GRID_SI + i_hix=2_GRID_SI + i_loy=1_GRID_SI + i_hiy=2_GRID_SI + + determine_lon: DO i_cnt=1, i_lon-1 + IF(r_lon(i_cnt) .LT. r_coord(1)) THEN + IF(r_lon(i_cnt +1) .GE. r_coord(1)) THEN + i_lox= i_cnt + i_hix= i_cnt+1 + exit determine_lon + END IF + END IF + END DO determine_lon + IF(r_lon(i_lon) .LT. r_coord(1)) THEN + i_lox = i_lon-1 + i_hix = i_lon + END IF + + determine_lat: DO i_cnt=1, i_lat-1 + IF(r_lat(i_cnt) .LT. r_coord(2)) THEN + IF(r_lat(i_cnt +1) .GE. r_coord(2)) THEN + i_loy= i_cnt + i_hiy= i_cnt+1 + exit determine_lat + END IF + END IF + END DO determine_lat + IF(r_lat(i_lat) .LT. r_coord(2)) THEN + i_loy = i_lat-1 + i_hiy = i_lat + END IF + + +!---------- calculate weights for bilinear interpolation + + r_dx= r_lon(i_hix)- r_lon(i_lox) + r_dy= r_lat(i_hiy)- r_lat(i_loy) + r_lx= r_coord(1) - r_lon(i_lox) + r_ly= r_coord(2) - r_lat(i_loy) + r_hx= r_lon(i_hix) - r_coord(1) + r_hy= r_lat(i_hiy) - r_coord(2) + r_scalx=1._GRID_SR/(r_deg*cos(r_radians*r_lat(i_hiy))) !r_coord(2))) + r_scaly=1._GRID_SR/(r_deg) + +!---------- linear interpolation in x-direction + + IF(r_dx /= 0.0_GRID_SR) THEN + r_dxi= 1._GRID_SR/r_dx + r_l1= (r_hx* r_flowx(i_lox, i_loy, i_tim)+ & + r_lx* r_flowx(i_hix, i_loy, i_tim))* r_dxi + r_h1= (r_hx* r_flowx(i_lox, i_hiy, i_tim)+ & + r_lx* r_flowx(i_hix, i_hiy, i_tim))* r_dxi + r_l2= (r_hx* r_flowy(i_lox, i_loy, i_tim)+ & + r_lx* r_flowy(i_hix, i_loy, i_tim))* r_dxi + r_h2= (r_hx* r_flowy(i_lox, i_hiy, i_tim)+ & + r_lx* r_flowy(i_hix, i_hiy, i_tim))* r_dxi + ELSE + r_l1= r_flowx(i_lox, i_loy, i_tim) + r_h1= r_flowx(i_lox, i_hiy, i_tim) + r_l2= r_flowy(i_lox, i_loy, i_tim) + r_h2= r_flowy(i_lox, i_hiy, i_tim) + END IF + +!---------- linear interpolation in y-direction + + IF(r_dy /= 0.0_GRID_SR) THEN + r_dyi= 1._GRID_SR/r_dy + r_inter(1)= (r_hy* r_l1+ r_ly* r_h1)* r_dyi* r_scalx + r_inter(2)= (r_hy* r_l2+ r_ly* r_h2)* r_dyi* r_scaly + ELSE + r_inter(1)= r_l1* r_scalx + r_inter(2)= r_l2* r_scaly + END IF + + RETURN + END FUNCTION data_interpol + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/ADV_wind_netcdf.file.f90 b/flash2d/src/options/ADV_wind_netcdf.file.f90 new file mode 100644 index 0000000000000000000000000000000000000000..5110adfa6f14ffe0730bdc10d3cf33c0aeed5da6 --- /dev/null +++ b/flash2d/src/options/ADV_wind_netcdf.file.f90 @@ -0,0 +1,363 @@ +!***************************************************************** +! +! MODULE NAME: +! ADV_wind +! FUNCTION: +! calculate the windfield for the advection problem +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_windfield +! FUNCTION: +! calculate the advecting force for simple advection +! SYNTAX: +! real.arr= slm_windfield(real.arr, real) +! ON INPUT: +! r_coord: coordinates of point real +! r_time: time coordinate (optional) real +! ON OUTPUT: +! r_field: windfield real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/97 +! 2. bug fix concerning interp. j. behrens 2/98 +! 3. compliant to amatos 1.0 j. behrens 12/2000 +! 4. compliant to amatos 1.2 j. behrens 3/2002 +! 5. new version for course tracer transport j. behrens 01/2012 +! +!***************************************************************** + MODULE ADV_wind + USE GRID_api + USE FLASH_parameters + PRIVATE + INTEGER, PARAMETER :: i_ioerr=0 + REAL (KIND = GRID_SR) :: r_intervallen, r_scalfacx, r_scalfacy, & + r_readlast, r_scalinvx, r_scalinvy + CHARACTER (LEN=32) :: c_prfixx, c_prfixy, c_pofixx, c_pofixy + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowx + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_flowy + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lat + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_lon + INTEGER (KIND = GRID_SI) :: i_lon, i_lat, i_timesteps + INTEGER (KIND = GRID_SI) :: i_pointsx, i_pointsy, i_timeinterval, i_intervalnum + + PUBLIC :: slm_windfield, slm_windinit, slm_windquit + + CONTAINS +!***************************************************************** + FUNCTION slm_windfield(r_coord, r_time) RESULT (r_field) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_field + REAL (KIND = GRID_SR) :: r_tim + CHARACTER (LEN=67) :: c_xfile, c_yfile + CHARACTER (LEN=35) :: c_tmp + CHARACTER (LEN=3) :: c_num + INTEGER (KIND = GRID_SI) :: i_iost, i_cnt, j_cnt + +!---------- set time + + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- decide, if data has to be read + + data_read: IF(r_readlast <= r_tim) THEN + +!---------- update values for next open + + r_readlast = r_readlast+ r_intervallen + i_timeinterval= i_timeinterval+ 1 + END IF data_read + +!---------- interpolate to coordinate + + r_field= data_interpol(r_coord,i_timeinterval) + + RETURN + 1000 FORMAT(i3.3) + END FUNCTION slm_windfield + +!***************************************************************** + SUBROUTINE read_netcdf_currents(c_filename) + +!---------- local declarations + + IMPLICIT NONE + INCLUDE "netcdf.inc" + +!---------- input parameters + CHARACTER (LEN=i_charlength+io_fillen), INTENT(in) :: c_filename + +!---------- local variables + INTEGER (KIND = GRID_SI) :: i_alct, i_ncstat + INTEGER (KIND = GRID_SI) :: i_fileid + INTEGER (KIND = GRID_SI) :: i_dimid, i_varid + INTEGER (KIND = GRID_SI) :: i_tm, i_ln, i_lt + +!---------- open current file + + i_ncstat= nf_open(c_filename,NF_NOWRITE,i_fileid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not open currents data file') + +!---------- determine lon/lat/time dimension sizes (grid size of currents field) + + i_ncstat= nf_inq_dimid(i_fileid, 'lon', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lon dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_lon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon dimension') + + i_ncstat= nf_inq_dimid(i_fileid, 'lat', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify lat dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_lat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat dimension') + + i_ncstat= nf_inq_dimid(i_fileid, 'time', i_dimid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not identify time dimension') + i_ncstat= nf_inq_dimlen(i_fileid, i_dimid, i_timesteps) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read time dimension') + +!---------- allocate latitude and longitude coordinate arrays + + ALLOCATE(r_lat(i_lat), r_lon(i_lon), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate lat/lon field') + +!---------- read latitude and longitude coordinate values + + i_ncstat= nf_inq_varid(i_fileid, 'lon', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lon varid') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_lon) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lon data') + + i_ncstat= nf_inq_varid(i_fileid, 'lat', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine lat varid') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_lat) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read lat data') + +!---------- allocate current data arrays + + ALLOCATE(r_flowx(i_lon, i_lat, i_timesteps), r_flowy(i_lon, i_lat, i_timesteps), stat= i_alct) + IF(i_alct /= 0) & + CALL grid_error(c_error='[read_netcdf_currents]: could not allocate currents fields') + +!---------- read x-/y-direction data of currents + + i_ncstat= nf_inq_varid(i_fileid, 'var49', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of var49') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_flowx) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read var49 data') + + i_ncstat= nf_inq_varid(i_fileid, 'var50', i_varid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not determine varid of var50') + i_ncstat= nf_get_var_real(i_fileid, i_varid, r_flowy) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not read var50 data') + +!---------- Fix mask values + + DO i_tm=1,i_timesteps + DO i_lt= 1,i_lat + DO i_ln= 1,i_lon + IF(r_flowx(i_ln,i_lt,i_tm) <= -8.99E+33) r_flowx(i_ln,i_lt,i_tm)= 0._GRID_SR + IF(r_flowy(i_ln,i_lt,i_tm) <= -8.99E+33) r_flowy(i_ln,i_lt,i_tm)= 0._GRID_SR + END DO + END DO + END DO + +!---------- close currents file + + i_ncstat= nf_close(i_fileid) + IF(i_ncstat /= NF_NOERR) & + CALL grid_error(c_error='[read_netcdf_currents]: could not close currents data file') + + END SUBROUTINE read_netcdf_currents + +!***************************************************************** + SUBROUTINE slm_windinit(p_control) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct) :: p_control + INTEGER :: i_iofil= 19 + CHARACTER (len=i_charlength+io_fillen) :: c_name + CHARACTER (len=80) :: a_filrow + INTEGER :: i_iost, i_ioend, i_alct + +!---------- initialize + + WRITE(c_name,*) trim(p_param%cmd%c_directory),p_control%tst%tst_char(1) + c_name= adjustl(c_name) + +!---------- read current data from NetCDF file + + CALL read_netcdf_currents(c_name) + +!---------- initialize some values + + r_readlast= 0.0_GRID_SR + i_timeinterval= 0_GRID_SI + r_intervallen= 3600._GRID_SR + + RETURN + 2000 FORMAT(a80) + 2010 FORMAT(a32) + END SUBROUTINE slm_windinit + +!***************************************************************** + SUBROUTINE slm_windquit + +!---------- local declarations + + IMPLICIT NONE + +!---------- deallocate wind data arrays + + DEALLOCATE(r_flowx, r_flowy) + DEALLOCATE(r_lon, r_lat) + + RETURN + END SUBROUTINE slm_windquit + +!***************************************************************** + FUNCTION data_interpol(r_coord, i_tim) RESULT (r_inter) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_coord + INTEGER (KIND = GRID_SI) :: i_tim + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_inter + INTEGER (KIND = GRID_SI) :: i_lox, i_hix, i_loy, i_hiy, i_cnt + REAL (KIND = GRID_SR) :: r_dx, r_dy, r_lx, r_hx, & + r_ly, r_hy, r_l1, r_h1, r_l2, r_h2, r_dxi, r_dyi + REAL (KIND = GRID_SR) :: r_scalx, r_scaly + REAL (KIND = GRID_SR) :: r_deg + REAL (KIND = GRID_SR), PARAMETER :: r_earth=4011436.8_GRID_SR ! earth circumference + +!---------- initialize radians + + r_deg= 360._GRID_SR/r_earth + +!---------- find wind box corresponding to coordinate + + i_lox=1_GRID_SI + i_hix=2_GRID_SI + i_loy=1_GRID_SI + i_hiy=2_GRID_SI + + determine_lon: DO i_cnt=1, i_lon-1 + IF(r_lon(i_cnt) .LT. r_coord(1)) THEN + IF(r_lon(i_cnt +1) .GE. r_coord(1)) THEN + i_lox= i_cnt + i_hix= i_cnt+1 + exit determine_lon + END IF + END IF + END DO determine_lon + IF(r_lon(i_lon) .LT. r_coord(1)) THEN + i_lox = i_lon-1 + i_hix = i_lon + END IF + + determine_lat: DO i_cnt=1, i_lat-1 + IF(r_lat(i_cnt) .LT. r_coord(2)) THEN + IF(r_lat(i_cnt +1) .GE. r_coord(2)) THEN + i_loy= i_cnt + i_hiy= i_cnt+1 + exit determine_lat + END IF + END IF + END DO determine_lat + IF(r_lat(i_lat) .LT. r_coord(2)) THEN + i_loy = i_lat-1 + i_hiy = i_lat + END IF + + +!---------- calculate weights for bilinear interpolation + + r_dx= r_lon(i_hix)- r_lon(i_lox) + r_dy= r_lat(i_hiy)- r_lat(i_loy) + r_lx= r_coord(1) - r_lon(i_lox) + r_ly= r_coord(2) - r_lat(i_loy) + r_hx= r_lon(i_hix) - r_coord(1) + r_hy= r_lat(i_hiy) - r_coord(2) + r_scalx=r_deg + r_scaly=r_deg*cos(r_coord(2)) + +!---------- linear interpolation in x-direction + + IF(r_dx /= 0.0_GRID_SR) THEN + r_dxi= 1._GRID_SR/r_dx + r_l1= (r_hx* r_flowx(i_lox, i_loy, i_tim)+ & + r_lx* r_flowx(i_hix, i_loy, i_tim))* r_dxi + r_h1= (r_hx* r_flowx(i_lox, i_hiy, i_tim)+ & + r_lx* r_flowx(i_hix, i_hiy, i_tim))* r_dxi + r_l2= (r_hx* r_flowy(i_lox, i_loy, i_tim)+ & + r_lx* r_flowy(i_hix, i_loy, i_tim))* r_dxi + r_h2= (r_hx* r_flowy(i_lox, i_hiy, i_tim)+ & + r_lx* r_flowy(i_hix, i_hiy, i_tim))* r_dxi + ELSE + r_l1= r_flowx(i_lox, i_loy, i_tim) + r_h1= r_flowx(i_lox, i_hiy, i_tim) + r_l2= r_flowy(i_lox, i_loy, i_tim) + r_h2= r_flowy(i_lox, i_hiy, i_tim) + END IF + +!---------- linear interpolation in y-direction + + IF(r_dy /= 0.0_GRID_SR) THEN + r_dyi= 1._GRID_SR/r_dy + r_inter(1)= (r_hy* r_l1+ r_ly* r_h1)* r_dyi* r_scalx + r_inter(2)= (r_hy* r_l2+ r_ly* r_h2)* r_dyi* r_scaly + ELSE + r_inter(1)= r_l1* r_scalx + r_inter(2)= r_l2* r_scaly + END IF + + RETURN + END FUNCTION data_interpol + +!***************************************************************** + END MODULE ADV_wind diff --git a/flash2d/src/options/FLASH_parameters.SW.f90 b/flash2d/src/options/FLASH_parameters.SW.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fb41820e93d8023c4583688ec95e582d765d4c4c --- /dev/null +++ b/flash2d/src/options/FLASH_parameters.SW.f90 @@ -0,0 +1,117 @@ +!***************************************************************** +! +! MODULE NAME: +! FLASH_parameters +! FUNCTION: +! defines global control structure +! CONTAINS: +! +! PUBLIC: +! all +! COMMENTS: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 12/2000 +! +!***************************************************************** + MODULE FLASH_parameters + + USE GRID_api + IMPLICIT NONE + INTEGER, PARAMETER :: io_fillen=128 + INTEGER, PARAMETER :: i_redirout=8 + INTEGER, PARAMETER :: i_redirlog=7 + INTEGER, PARAMETER :: i_comparlen=14 + +!----additional grid variables + + INTEGER (KIND = GRID_SI) :: GRID_hu, GRID_hv, GRID_h + +!---------- structure for the command line + + TYPE cmdline_param + SEQUENCE + CHARACTER (len=io_fillen) :: c_infile ! input file name + CHARACTER (len=io_fillen) :: c_directory ! input file name + LOGICAL :: l_output ! redirect std output + LOGICAL :: l_logging ! enable logging (verbose) + END TYPE cmdline_param + +!---------- structure for the i/o behaviour + + TYPE io_param + SEQUENCE + LOGICAL :: l_diagnostics ! switch on diagnostics + LOGICAL :: l_vtu ! switch on vtu output + LOGICAL :: l_netcdf ! switch on NetCDF output + INTEGER :: i_plotoffset ! timesteps between plots + INTEGER :: i_saveoffset ! timesteps between savesets + INTEGER :: i_savelast ! indicator for last step saving + CHARACTER (len=io_fillen) :: c_domainfile ! file with definitions for domain + CHARACTER (len=io_fillen) :: c_triangfile ! file with initial triangulation + END TYPE io_param + +!---------- structure for global physical and steering parameters + + TYPE num_param + SEQUENCE + REAL :: r_deltatime ! timestep length [s] + REAL :: r_reftolerance ! tolerance for refinement + REAL :: r_crstolerance ! tolerance for coarsening + REAL :: r_refwatermark ! watermark for refinement + REAL :: r_crswatermark ! watermark for coarsening + REAL :: r_starttime ! first time (overwrites i_frsttimestep) + REAL :: r_finaltime ! last time (overwrites i_lasttimestep) + INTEGER :: i_experiment ! current experiment identification + INTEGER :: i_crslevel ! coarsest requested level + INTEGER :: i_reflevel ! finest requested level + INTEGER :: i_frsttimestep ! first timestep of experiment + INTEGER :: i_lasttimestep ! last timestep of experiment + INTEGER :: i_adviterations ! iterations in trajectory estimation + END TYPE num_param + +!---------- structure for global physical and steering parameters + + TYPE test_param + INTEGER :: i_lognum + INTEGER :: i_intnum + INTEGER :: i_realnum + INTEGER :: i_charnum + INTEGER, DIMENSION(:), POINTER :: i_intsizes + INTEGER, DIMENSION(:), POINTER :: i_realsizes + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_logkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_intkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_realkeywds + CHARACTER (len=i_comparlen), DIMENSION(:), POINTER :: c_charkeywds + LOGICAL, DIMENSION(:), POINTER :: tst_log + CHARACTER (len=io_fillen), DIMENSION(:), POINTER :: tst_char + INTEGER, DIMENSION(:,:), POINTER :: tst_int + REAL, DIMENSION(:,:), POINTER :: tst_real + END TYPE test_param + +!---------- global control structure + + TYPE control_struct + TYPE (num_param) :: num + TYPE (cmdline_param) :: cmd + TYPE (io_param) :: io + TYPE (test_param) :: tst + END TYPE control_struct + TYPE (control_struct) :: p_contr + +!---------- structure for runtime information + + TYPE rt_info + REAL :: r_modeltime + INTEGER :: i_step + INTEGER :: i_adapit + LOGICAL :: l_saved + LOGICAL :: l_ploted + END TYPE rt_info + TYPE (rt_info) :: p_timestepinfo + + END MODULE FLASH_parameters diff --git a/flash2d/src/options/IO_vtuplot.SW.F90 b/flash2d/src/options/IO_vtuplot.SW.F90 new file mode 100644 index 0000000000000000000000000000000000000000..4162203d7b7b92c493fe00c57f16215437c6fb9e --- /dev/null +++ b/flash2d/src/options/IO_vtuplot.SW.F90 @@ -0,0 +1,177 @@ +!***************************************************************** +! +!> @file IO_vtuplot.F90 +!> @brief includes module IO_vtuplot +! +!***************************************************************** +! +! VERSION(S): +! 1. original version j. behrens 04/2000 +! 2. amatos-1.0 and 2D compliant j. behrens 11/2000 +! 3. adapted to flash2d j. behrens 12/2014 +! +!***************************************************************** +! MODULE DESCRIPTION: +!> prints data in VTU compatible file format +! +MODULE IO_vtuplot + USE FLASH_parameters + USE MISC_outputdata + USE GRID_api + USE IO_vtu + PRIVATE + INTEGER, SAVE :: i_timecounter= 0 + PUBLIC :: generate_vtu + CONTAINS + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE generate_vtu]: +!> @brief creates output in GMV compatible file format +!> +!> @param[in] p_handle grid handle for the linked lists +!> @param[in] i_time time step number +!> @param[in] i_newslevel the time level +!> +!> @note ON OUTPUT: a number of VTU compatible ascii files for each plotted time step +! + SUBROUTINE generate_vtu(p_handle, i_time, i_newslevel) + + IMPLICIT NONE + +!---------- local declarations + + TYPE (grid_handle), INTENT(in) :: p_handle + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_time + INTEGER (KIND = GRID_SI), OPTIONAL, INTENT(in) :: i_newslevel + INTEGER (KIND = GRID_SI) :: i_alct, i_nnum, i_tnum + INTEGER (KIND = GRID_SI) :: i_nwl, i_elen, i_tcnt + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_val + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_velo + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_moment + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_sta, r_lvl + INTEGER (KIND = GRID_SI), DIMENSION(:), ALLOCATABLE :: i_ids, i_sta + CHARACTER (len=32) :: c_mfile + CHARACTER (len=26) :: c_tmp + LOGICAL :: l_news + INTEGER, PARAMETER :: i_vallen=8 + INTEGER, DIMENSION(i_vallen) :: i_valind + + TYPE(t_vtu_data), DIMENSION(2) :: celldata + TYPE(t_vtu_data), DIMENSION(6) :: nodedata + +!---------- file handling (open) + + IF(present(i_time)) THEN + i_tcnt= i_time + i_timecounter= i_timecounter+1 + ELSE + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + END IF + write(c_tmp,*) trim(GRID_parameters%program_name(1:20)) + write(c_mfile,10101) trim(c_tmp), '_', i_tcnt + c_tmp = adjustl(c_mfile) + write(c_mfile,*) TRIM(c_tmp), '.vtu' + c_mfile= adjustl(c_mfile) + +!---------- handle news level + + IF(present(i_newslevel)) THEN + l_news=.TRUE. + i_nwl= i_newslevel + ELSE + l_news=.FALSE. + END IF + +!---------- the nodes + + i_nnum = p_handle%i_nnumber + +!---------- extract nodal grid data and nodal values + + ALLOCATE(r_val(i_vallen, i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate values array') + END IF + i_valind= (/GRID_ucomp, GRID_vcomp, GRID_hu, GRID_hv, GRID_h, GRID_phi, GRID_zeta, GRID_tracer/) + CALL grid_getinfo(p_handle, r_nodevalues= r_val, i_arraypoint=i_valind) + +!---------- assign nodal values, but before allocate aux. arrays + + ALLOCATE(r_velo(GRID_dimension,i_nnum), r_moment(GRID_dimension,i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate aux. velo arrays') + END IF + +!---------- generate 2D velocity field + + r_velo(1:2,:)= r_val(1:2,:) + + nodedata(1)%c_name = 'velocity' + nodedata(1)%i_size = 2 + nodedata(1)%p_vdata => r_velo + + r_moment(1:2,:)= r_val(3:4,:) + + nodedata(2)%c_name = 'momentum' + nodedata(2)%i_size = 2 + nodedata(2)%p_vdata => r_moment + + nodedata(3)%c_name = 'height' + nodedata(3)%i_size = 1 + nodedata(3)%p_vdata => r_val(5:5,:) + + nodedata(4)%c_name = 'pot. height' + nodedata(4)%i_size = 1 + nodedata(4)%p_vdata => r_val(6:6,:) + + nodedata(5)%c_name = 'vorticity' + nodedata(5)%i_size = 1 + nodedata(5)%p_vdata => r_val(7:7,:) + + nodedata(6)%c_name = 'tracer' + nodedata(6)%i_size = 1 + nodedata(6)%p_vdata => r_val(8:8,:) + +!---------- extract cells grid data + + i_tnum= p_handle%i_enumfine + ALLOCATE(i_ids(i_tnum), i_sta(i_tnum), r_sta(1,i_tnum), r_lvl(1,i_tnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[generate_vtu]: could not allocate cell value arrays') + END IF + IF(l_news) THEN + CALL grid_getinfo(p_handle, i_newsdepth= i_nwl, i_elength= i_elen, & + i_elementlevel= i_ids, i_elementstatus= i_sta) + i_tnum= i_elen + ELSE + CALL grid_getinfo(p_handle, i_elementlevel= i_ids, i_elementstatus= i_sta) + END IF + + r_sta(1, :) = REAL(i_sta, GRID_SR) + r_lvl(1, :) = REAL(i_ids, GRID_SR) + + ! Assign all values to driver + celldata(1)%c_name = 'status' + celldata(1)%i_size = 1 + celldata(1)%p_vdata => r_sta + + celldata(2)%c_name = 'level' + celldata(2)%i_size = 1 + celldata(2)%p_vdata => r_lvl + + ! plot the vtu data + CALL plot_vtu(p_handle, c_mfile, i_nodedata = 6, p_nodedata = nodedata, & + i_celldata = 2, p_celldata = celldata, i_zcoordinate = 4) + + DEALLOCATE(i_ids, i_sta, r_sta, r_lvl, & + r_val, r_velo) + + RETURN + +!---------- FORMAT + 10101 FORMAT(a19,a1,i6.6) + + END SUBROUTINE generate_vtu + +END MODULE IO_vtuplot diff --git a/flash2d/src/options/SLM_advanced.algae.f90 b/flash2d/src/options/SLM_advanced.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4c4bfda91fe7226667cd1e3852c8e88a3209ee9e --- /dev/null +++ b/flash2d/src/options/SLM_advanced.algae.f90 @@ -0,0 +1,551 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_area +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2,i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(2,i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(:,i_cnt)= r_rside(:,i_cnt)+ & + r_dt* slm_righthand(r_coord(:,i_cnt),r_rside(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_uparea, r_dwarea + INTEGER :: i_alct, i_cnt, j_cnt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- allocate auxilliary arrays + + allocate(r_aux(2,i_arlen), & + r_uparea(i_arlen), r_dwarea(i_arlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + +!---------- interpolation of node values + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_aux) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + ptch_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element + + r_1= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + r_oarea= r_oarea+ triang_area(r_1, r_2, r_3) + +!---------- the downstream dual element + + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_narea= r_narea+ triang_area(r_1, r_2, r_3) + END IF + END DO ptch_loop + r_uparea(i_cnt)= r_oarea + IF(r_narea /= 0._GRID_SR) THEN + r_dwarea(i_cnt)= 1._GRID_SR/ r_narea + ELSE + r_dwarea(i_cnt)= 0._GRID_SR + END IF + END DO node_loop + +!---------- now calculate new values using a (nonexact) interpolation formula + + r_rside(1,:)= r_aux(1,:)* r_uparea* r_dwarea + r_rside(2,:)= r_aux(2,:)* r_uparea* r_dwarea + +!---------- deallocate auxilliary arrays + + deallocate(r_aux, r_uparea, r_dwarea) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min + REAL (KIND = GRID_SR), DIMENSION(2) :: r_tmp + INTEGER :: i_cnt, i_alct + INTEGER, DIMENSION(2) :: i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat, i_trc + +!---------- initialize constant + + i_val(1)= GRID_tracer + i_val(2)= GRID_phi + r_eps = GRID_EPS + i_tim = p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(:,i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + tracer_loop: DO i_trc=1,2 + r_tmp(i_trc)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val(i_trc), & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val(i_trc))) + r_max= MAX(r_max, r_tval(i_val(i_trc))) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp(i_trc) > r_max) THEN + r_tmp(i_trc)= r_max + ELSE IF(r_tmp(i_trc) < r_min) THEN + r_tmp(i_trc)= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_trc,i_cnt)= r_tmp(i_trc) + + small_val: IF((abs(r_rside(i_trc,i_cnt)) < r_eps) .OR. (r_rside(i_trc,i_cnt) < 0.0_GRID_SR)) THEN + r_rside(i_trc,i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO tracer_loop + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.analytic.f90 b/flash2d/src/options/SLM_advanced.analytic.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9d8fcb2cd60bf5f284b5702532b169bccb57a934 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.analytic.f90 @@ -0,0 +1,341 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + USE SLM_initial + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5* p_param%num%r_deltatime + r_dt2= 1.5* p_param%num%r_deltatime + r_fac= 0.5 + r_caf= 2.0 + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0 + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0 + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + + REAL (KIND = GRID_SR) :: r_ts, r_deltatime + INTEGER :: i_step + +!---------- initialize constant + + i_step = p_timestepinfo%i_step + r_deltatime = p_contr%num%r_deltatime + r_ts = REAL(i_step)*r_deltatime + +!---------- get analytic solution + + CALL slm_analyticsolution(p_mesh(i_timeplus), r_ts, i_arlen, r_rside) + + + RETURN + END SUBROUTINE slm_ainterpolate + + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.cellint.algae.f90 b/flash2d/src/options/SLM_advanced.cellint.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..97a51cfff06c6baa9b74ca1d1f2e9d5b53d3e6cd --- /dev/null +++ b/flash2d/src/options/SLM_advanced.cellint.algae.f90 @@ -0,0 +1,489 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2,i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- check newslevel (Not supported for Cell-integrated scheme due to dual) + + IF(present(i_newsdepth)) THEN + CALL grid_error(c_error='[slm_step]: no newslevel in Cell-Integrated Scheme supported') + END IF + IF(i_size /= p_ghand(i_timeplus)%i_nnumber) THEN + CALL grid_error(c_error='[slm_step]: incompatible array size') + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(2,i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + CALL grid_createdual_donald(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(:,i_cnt)= r_rside(:,i_cnt)+ & + r_dt* slm_righthand(r_coord(:,i_cnt),r_rside(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,2*GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_rside + INTEGER :: i_alct, i_cnt, & + j_cnt, i_tnc, i_oarlen, i_fill, i_len, i_tmp, i_trc + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux1 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux2 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_conc + REAL (KIND = GRID_SR) :: r_onethird= 1._GRID_SR/3._GRID_SR + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enods + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_part, r_isarea + REAL (KIND = GRID_SR), EXTERNAL :: triatria_isectar + REAL (KIND = GRID_SR) :: r_xmax, r_ymax, r_xmin, r_ymin + REAL (KIND = GRID_SR) :: r_maxx, r_maxy, r_minx, r_miny + REAL (KIND = GRID_SR), DIMENSION(2) :: r_mass + INTEGER, DIMENSION(:), POINTER :: i_triang + REAL (KIND = GRID_SR), DIMENSION(:), POINTER :: r_area + INTEGER, DIMENSION(2) :: i_valind + + +!---------- allocate auxilliary arrays + + i_oarlen= p_mesh(i_time)%i_enumfine + allocate(r_aux1(GRID_dimension,i_oarlen), & + r_aux2(2,i_oarlen), i_enods(GRID_elementnodes,i_oarlen), & + r_conc(2,i_oarlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + i_valind= (/ GRID_tracer, GRID_phi /) + +!---------- get info from old grid to calculate mass elements + + CALL grid_getinfo(p_mesh(i_time), r_nodecoordinates= r_aux1, & + i_elementnodes=i_enods, i_arraypoint=i_valind, & + r_nodevalues= r_aux2, l_finelevel=.TRUE.) + +!---------- calculate concentration in elements + + conc_calc: DO i_cnt=1,i_oarlen + r_conc(:,i_cnt)= r_onethird* (r_aux2(:,i_enods(1,i_cnt))+ & + r_aux2(:,i_enods(2,i_cnt))+ r_aux2(:,i_enods(3,i_cnt))) + END DO conc_calc + +!---------- now the main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_mass= 0.0 + r_narea= 0.0 + r_vertx= 0.0 + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + dual_ptch_loop: DO i_tnc= 1, 2*GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT dual_ptch_loop + ELSE + +!---------- nullify pointer arrays + + NULLIFY(i_triang,r_area) + +!---------- the upstream dual element's outer nodes + + r_vertx(1,2)= r_dcoord(1,i_dedge(1,i_tnc,i_cnt))- r_dalpha(1,i_dedge(1,i_tnc,i_cnt)) + r_vertx(2,2)= r_dcoord(2,i_dedge(1,i_tnc,i_cnt))- r_dalpha(2,i_dedge(1,i_tnc,i_cnt)) + r_vertx(1,3)= r_dcoord(1,i_dedge(2,i_tnc,i_cnt))- r_dalpha(1,i_dedge(2,i_tnc,i_cnt)) + r_vertx(2,3)= r_dcoord(2,i_dedge(2,i_tnc,i_cnt))- r_dalpha(2,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate downstream area around primal node + + r_narea= r_narea+ triang_area(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- calculate intersection + + CALL grid_polygridintersect(p_mesh(i_time),GRID_elementnodes,r_vertx,& + i_len, i_triang, r_area, .TRUE.) + + DO j_cnt=1,i_len + i_tmp= i_triang(j_cnt) + r_mass(:)= r_mass(:) + r_area(j_cnt)* r_conc(:,i_tmp) + END DO + + IF(ASSOCIATED(i_triang)) THEN + DEALLOCATE(i_triang) + NULLIFY(i_triang) + END IF + IF(ASSOCIATED(r_area)) THEN + DEALLOCATE(r_area) + NULLIFY(r_area) + END IF + END IF + END DO dual_ptch_loop + +!---------- now calculate concentration + + r_rside(:,i_cnt)= r_mass(:)/r_narea + +!---------- check for negative or too small values and clip them + + tracer_loop: DO i_trc=1,2 + small_val: IF((abs(r_rside(i_trc,i_cnt)) < GRID_EPS) .OR. (r_rside(i_trc,i_cnt) < 0.0_GRID_SR)) THEN + r_rside(i_trc,i_cnt)= 0.0_GRID_SR + END IF small_val + END DO tracer_loop + + END DO node_loop + +!---------- deallocate auxilliary arrays + + deallocate(r_aux1, r_aux2, r_conc, i_enods) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.cellint.f90 b/flash2d/src/options/SLM_advanced.cellint.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2087da3925f9f85b7c05a5a222a88089366bfa56 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.cellint.f90 @@ -0,0 +1,480 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- check newslevel (Not supported for Cell-integrated scheme due to dual) + + IF(present(i_newsdepth)) THEN + CALL grid_error(c_error='[slm_astep]: no newslevel in Cell-Integrated Scheme supported') + END IF + IF(i_size /= p_ghand(i_timeplus)%i_nnumber) THEN + CALL grid_error(c_error='[slm_astep]: incompatible array size') + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + CALL grid_createdual_donald(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,2*GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_alct, i_cnt, & + j_cnt, i_tnc, i_oarlen, i_fill, i_len, i_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux1 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux2 + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_conc + REAL (KIND = GRID_SR) :: r_onethird= 1._GRID_SR/3._GRID_SR + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enods + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_part, r_isarea + REAL (KIND = GRID_SR), EXTERNAL :: triatria_isectar + REAL (KIND = GRID_SR) :: r_xmax, r_ymax, r_xmin, r_ymin + REAL (KIND = GRID_SR) :: r_maxx, r_maxy, r_minx, r_miny + REAL (KIND = GRID_SR) :: r_mass + INTEGER, DIMENSION(:), POINTER :: i_triang + REAL (KIND = GRID_SR), DIMENSION(:), POINTER :: r_area + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate auxilliary arrays + + i_oarlen= p_mesh(i_time)%i_enumfine + allocate(r_aux1(GRID_dimension,i_oarlen), & + r_aux2(1,i_oarlen), i_enods(GRID_elementnodes,i_oarlen), & + r_conc(i_oarlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + i_valind= (/ GRID_tracer /) + +!---------- get info from old grid to calculate mass elements + + CALL grid_getinfo(p_mesh(i_time), r_nodecoordinates= r_aux1, & + i_elementnodes=i_enods, i_arraypoint=i_valind, & + r_nodevalues= r_aux2, l_finelevel=.TRUE.) + +!---------- calculate concentration in elements + + conc_calc: DO i_cnt=1,i_oarlen + r_conc(i_cnt)= r_onethird* (r_aux2(1,i_enods(1,i_cnt))+ & + r_aux2(1,i_enods(2,i_cnt))+ r_aux2(1,i_enods(3,i_cnt))) + END DO conc_calc + +!---------- now the main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_mass= 0.0 + r_narea= 0.0 + r_vertx= 0.0 + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + dual_ptch_loop: DO i_tnc= 1, 2*GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT dual_ptch_loop + ELSE + +!---------- nullify pointer arrays + + NULLIFY(i_triang,r_area) + +!---------- the upstream dual element's outer nodes + + r_vertx(1,2)= r_dcoord(1,i_dedge(1,i_tnc,i_cnt))- r_dalpha(1,i_dedge(1,i_tnc,i_cnt)) + r_vertx(2,2)= r_dcoord(2,i_dedge(1,i_tnc,i_cnt))- r_dalpha(2,i_dedge(1,i_tnc,i_cnt)) + r_vertx(1,3)= r_dcoord(1,i_dedge(2,i_tnc,i_cnt))- r_dalpha(1,i_dedge(2,i_tnc,i_cnt)) + r_vertx(2,3)= r_dcoord(2,i_dedge(2,i_tnc,i_cnt))- r_dalpha(2,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate downstream area around primal node + + r_narea= r_narea+ triang_area(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- calculate intersection + + CALL grid_polygridintersect(p_mesh(i_time),GRID_elementnodes,r_vertx,& + i_len, i_triang, r_area, .TRUE.) + + DO j_cnt=1,i_len + i_tmp= i_triang(j_cnt) + r_mass= r_mass + r_area(j_cnt)* r_conc(i_tmp) + END DO + + IF(ASSOCIATED(i_triang)) THEN + DEALLOCATE(i_triang) + NULLIFY(i_triang) + END IF + IF(ASSOCIATED(r_area)) THEN + DEALLOCATE(r_area) + NULLIFY(r_area) + END IF + END IF + END DO dual_ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_mass/r_narea + + END DO node_loop + +!---------- deallocate auxilliary arrays + + deallocate(r_aux1, r_aux2, r_conc, i_enods) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.clip.f90 b/flash2d/src/options/SLM_advanced.clip.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d88b9fc1a79c0983e87fa2d3f52cb5a4efc1115b --- /dev/null +++ b/flash2d/src/options/SLM_advanced.clip.f90 @@ -0,0 +1,416 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.cons.f90 b/flash2d/src/options/SLM_advanced.cons.f90 new file mode 100644 index 0000000000000000000000000000000000000000..705edfc9d6415b4223f6d7709c994c8dbb79b27b --- /dev/null +++ b/flash2d/src/options/SLM_advanced.cons.f90 @@ -0,0 +1,592 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + REAL :: r_conservation + LOGICAL :: l_interpolinitialized=.FALSE. + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- Initialize, if not yet done + + IF(.NOT. l_interpolinitialized) THEN + CALL slm_interpolinit(p_ghand(i_time)) + l_interpolinitialized= .TRUE. + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, & + r_tmp, r_avg, r_sp, r_sp1, r_sb, r_plus, r_minus, r_cs, r_sm, r_ccs + INTEGER :: i_cnt, i_alct, i_val, & + i_ind, i_tim, j_cnt, i_points, i_out, i_stat, i_tmp + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_low, r_hig, & + r_nar, r_bfc, r_mfc, r_cfc + INTEGER, DIMENSION(:), ALLOCATABLE :: i_fil + LOGICAL :: l_changed + INTEGER :: i_newlen +! INTEGER, DIMENSION(:), POINTER :: i_newind + +!---------- initialize pointer + +! NULLIFY(i_newind) + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_timeplus)%i_timetag +! i_points= p_mesh(i_timeplus)%i_nnumber + i_points= i_arlen + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_points), stat=i_alct) + not_alloc1: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_alloc1 + + ALLOCATE(r_low(i_points), r_hig(i_points), & + r_bfc(i_points), r_mfc(i_points), & + r_nar(i_points), r_cfc(i_points), & + i_fil(i_points), stat= i_alct) + not_alloc2: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_alloc2 + r_low=0.0_GRID_SR + r_hig=0.0_GRID_SR + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_points + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_bfc(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_low(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val, i_index=i_ind, l_relative=.FALSE., l_sfcorder=.FALSE.) + r_hig(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, l_relative=.FALSE., l_sfcorder=.FALSE.) + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=p_mesh(i_time)%i_timetag) + IF(j_cnt == 1) THEN + r_min= r_tval(i_val) + r_max= r_tval(i_val) + ELSE + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END IF + END DO elmt_loop + +!---------- factor for the low and high order blending + + r_tmp = r_hig(i_cnt)- r_low(i_cnt) + r_plus = r_max- r_low(i_cnt) + r_minus= r_min- r_low(i_cnt) + + IF(r_tmp > 0.0_GRID_SR) THEN + r_bfc(i_cnt)= MIN(1.0_GRID_SR, r_plus/r_tmp) + ELSE IF(r_tmp < 0.0_GRID_SR) THEN + r_bfc(i_cnt)= MIN(1.0_GRID_SR, r_minus/r_tmp) + ELSE + r_bfc(i_cnt)= 0.0_GRID_SR + END IF + ELSE index_valid + r_bfc(i_cnt)= 0.0_GRID_SR + END IF index_valid + END DO node_loop + +!---------- get nodal area for integration + +! CALL grid_newitems(p_mesh(i_timeplus), i_newnodes=i_newlen, & +! i_newnodeindex=i_newind) +! IF(i_newlen > i_points) THEN +! CALL grid_error(i_error=2,c_error='[slm_interpolate]: index array length mismatch encountered') +! END IF +! CALL grid_nodearea(p_mesh(i_timeplus), i_tmp, r_nar, & +! i_selectlength=i_newlen, i_selectindex=i_newind) + CALL grid_nodearea(p_mesh(i_timeplus), i_tmp, r_nar) + +!---------- calculate an auxiliary weighted factor for convenience + + r_cfc= (r_hig- r_low)* r_nar + +!---------- check for conservation + + r_cs= DOT_PRODUCT(r_low, r_nar) + r_sm= DOT_PRODUCT(r_bfc, r_cfc) + r_ccs= r_conservation- r_cs + IF(r_sm < r_ccs) THEN + r_ccs= -r_ccs + r_cfc= -r_cfc + END IF + +!---------- check local underestimation + + DO i_cnt=1,i_points + IF(r_cfc(i_cnt) <= 0.0_GRID_SR) THEN + r_mfc(i_cnt)= r_bfc(i_cnt) + i_fil(i_cnt)= 1 + ELSE + r_mfc(i_cnt)= 0.0_GRID_SR + i_fil(i_cnt)= 0 + END IF + END DO + +!---------- the modification loop + + l_changed= .TRUE. + mod_loop: DO WHILE(l_changed) + l_changed= .FALSE. + +!---------- calculate surplus and average alpha + + r_sp1= 0.0_GRID_SR + r_sb = 0.0_GRID_SR + DO i_cnt= 1, i_points + IF(i_fil(i_cnt) == 1) THEN + r_sp1= r_sp1+ r_mfc(i_cnt)* r_cfc(i_cnt) + ELSE + r_sb= r_sb+ r_cfc(i_cnt) + END IF + END DO + r_sp= r_ccs- r_sp1 + +!---------- if surplus is negative, use the quasi-monotone factors + + IF(r_sp <= 0.0_GRID_SR) THEN + r_mfc= r_bfc + EXIT mod_loop + END IF + +!---------- if surplus is zero, we're done + + IF(r_sb == 0.0_GRID_SR) EXIT mod_loop + +!---------- calculate an average weight + + r_avg= r_sp/ r_sb + +!---------- else put average weights to the factors + + DO i_cnt=1, i_points + IF(i_fil(i_cnt) == 0) THEN + IF(r_avg <= r_bfc(i_cnt)) THEN + r_mfc(i_cnt)= r_avg + ELSE + r_mfc(i_cnt)= r_bfc(i_cnt) + i_fil(i_cnt)= 1 + l_changed= .TRUE. + END IF + END IF + END DO + + END DO mod_loop + +!---------- blend the final values of the interpolation + + r_rside= r_mfc* r_hig+ (1.-r_mfc)* r_low + +!---------- remove small oscillations + + r_rside= MERGE(r_rside, 0.0_GRID_SR, ABS(r_rside)>=r_eps) + +!---------- deallocate work arrays + + DEALLOCATE(r_upstr, r_low, r_hig, r_bfc, r_mfc, & + r_nar, r_cfc, i_fil) !, i_newind) +! NULLIFY(i_newind) + + RETURN + END SUBROUTINE slm_ainterpolate +!***************************************************************** + SUBROUTINE slm_interpolinit(p_ogrid) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle) :: p_ogrid + INTEGER :: i_points, i_alct + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_area + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_values + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize constants + + i_valind= (/ GRID_tracer /) + i_points= p_ogrid%i_nnumber + +!---------- allocate work arrays + + ALLOCATE(r_area(i_points), r_values(1,i_points), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(61) + END IF not_alloc + +!---------- get values + + CALL grid_getinfo(p_ogrid, i_arraypoint=i_valind, & + r_nodevalues= r_values) + +!---------- calculate area pieces for each node + + CALL grid_nodearea(p_ogrid, i_points, r_area) + +!---------- calculate integral + + r_conservation= dot_product(r_area, r_values(1,:)) + +!---------- deallocate work arrays + + DEALLOCATE(r_area, r_values) + + RETURN + END SUBROUTINE slm_interpolinit + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.dual.f90 b/flash2d/src/options/SLM_advanced.dual.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a74c242876f6d54e9d4a105e0a0f8d71a0805597 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.dual.f90 @@ -0,0 +1,544 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_area +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_astep]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux, & + r_uparea, r_dwarea + INTEGER :: i_alct, i_cnt, j_cnt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- allocate auxilliary arrays + + allocate(r_aux(i_arlen), & + r_uparea(i_arlen), r_dwarea(i_arlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + +!---------- interpolation of node values + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_aux) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + ptch_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element + + r_1= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + r_oarea= r_oarea+ triang_area(r_1, r_2, r_3) + +!---------- the downstream dual element + + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_narea= r_narea+ triang_area(r_1, r_2, r_3) + END IF + END DO ptch_loop + r_uparea(i_cnt)= r_oarea + IF(r_narea /= 0._GRID_SR) THEN + r_dwarea(i_cnt)= 1._GRID_SR/ r_narea + ELSE + r_dwarea(i_cnt)= 0._GRID_SR + END IF + END DO node_loop + +!---------- now calculate new values using a (nonexact) interpolation formula + + r_rside= r_aux* r_uparea* r_dwarea + +!---------- deallocate auxilliary arrays + + deallocate(r_aux, r_uparea, r_dwarea) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.dual1.f90 b/flash2d/src/options/SLM_advanced.dual1.f90 new file mode 100644 index 0000000000000000000000000000000000000000..935ec3d7d72e06b179820e7513904ef8f61c1973 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.dual1.f90 @@ -0,0 +1,518 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! triang_area +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux, r_daux, & + r_uparea, r_dwarea + INTEGER :: i_alct, i_cnt, j_cnt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- allocate auxilliary arrays + + allocate(r_aux(i_arlen), r_daux(i_darlen), & + r_uparea(i_arlen), r_dwarea(i_arlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + +!---------- interpolation of node values + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_aux) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + ptch_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element + + r_1= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + r_oarea= r_oarea+ triang_area(r_1, r_2, r_3) + +!---------- the downstream dual element + + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_narea= r_narea+ triang_area(r_1, r_2, r_3) + END IF + END DO ptch_loop + r_uparea(i_cnt)= r_oarea + IF(r_narea /= 0._GRID_SR) THEN + r_dwarea(i_cnt)= 1._GRID_SR/ r_narea + ELSE + r_dwarea(i_cnt)= 0._GRID_SR + END IF + END DO node_loop + +!---------- now calculate new values using a (nonexact) interpolation formula + + r_rside= r_aux* r_uparea* r_dwarea + +!---------- deallocate auxilliary arrays + + deallocate(r_aux, r_daux, r_uparea, r_dwarea) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0) + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.dual2.f90 b/flash2d/src/options/SLM_advanced.dual2.f90 new file mode 100644 index 0000000000000000000000000000000000000000..8edc728b96dff3079d8a38b76ddf6e3bdde5ae0f --- /dev/null +++ b/flash2d/src/options/SLM_advanced.dual2.f90 @@ -0,0 +1,580 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_newdualalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_newdualcoor + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + nullify(r_newdualcoor) + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- calculate dual triangle positions + + CALL create_newdualpoints(i_size, r_coord, & + i_dual, r_dualcoordinates, i_dualedges, & + r_newdualcoor) + +!---------- allocate arrays for dual displacements + + allocate(r_newdualalpha(GRID_dimension,GRID_patchelements,i_size), & + r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + r_newdualcoor, r_newdualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newdualcoor, r_newdualalpha, & + r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl, r_newdualcoor, r_newdualalpha) + nullify(r_newdualcoor) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + r_ndcoord, r_ndalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(out) :: r_ndalpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2, i_cnt3 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + +!---------- the same for the dual triangle positions + + ndual_loop: DO i_cnt3=1,GRID_patchelements + r_axy= 0.0_GRID_SR + + nditer_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_ndcoord(:,i_cnt3,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO nditer_loop + + r_ndalpha(:,i_cnt3,i_cnt1)= r_axy + END DO ndual_loop + END DO unknown_loop + +!---------- the same for the dual nodes + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_ndcoor, r_ndalpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndcoor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_patchelements,i_arlen), INTENT(in) :: r_ndalpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_cnt, i_tnc, i_out, i_stat + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_val, r_tmp + + i_stat= 0 + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_val= 0.0_GRID_SR + r_narea= 0.0_GRID_SR + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- calculate area + + r_narea= r_narea+ triang_ar(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- the upstream dual element's outer nodes + + r_vertx(1,2)= r_dcoord(1,i_dedge(1,i_tnc,i_cnt))- r_dalpha(1,i_dedge(1,i_tnc,i_cnt)) + r_vertx(2,2)= r_dcoord(2,i_dedge(1,i_tnc,i_cnt))- r_dalpha(2,i_dedge(1,i_tnc,i_cnt)) + r_vertx(1,3)= r_dcoord(1,i_dedge(2,i_tnc,i_cnt))- r_dalpha(1,i_dedge(2,i_tnc,i_cnt)) + r_vertx(2,3)= r_dcoord(2,i_dedge(2,i_tnc,i_cnt))- r_dalpha(2,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate area of upstream dual triangle + + r_oarea= triang_ar(r_vertx(:,1),r_vertx(:,2),r_vertx(:,3)) + +!---------- check if upstream value is outside of the domain + + r_1= r_ndcoor(:,i_tnc,i_cnt)- r_ndalpha(:,i_tnc,i_cnt) + i_out= grid_domaincheck(p_mesh(i_time), r_1) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_1= grid_boundintersect(p_mesh(i_time), & + r_ndcoor(:,i_tnc,i_cnt), r_1, i_info=i_stat) + END IF out_domain + +!---------- interpolate + + no_intersect: IF(i_stat /= 0) THEN + r_tmp= 0.0_GRID_SR + ELSE no_intersect + r_tmp= grid_coordvalue(p_mesh(i_time), r_1, i_interpolorder=GRID_highorder) + IF(abs(r_tmp) < GRID_EPS) THEN + r_tmp= 0.0_GRID_SR + END IF + END IF no_intersect + +!---------- interpolate upstream concentration and calculate integral with quadrature rule + + r_val= r_val+ r_oarea* r_tmp + + END IF + END DO ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_val/r_narea + + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + FUNCTION triang_ar(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_ar + +!***************************************************************** + SUBROUTINE create_newdualpoints(i_arlen, r_coord, & + i_darlen, r_dcoord, i_dedge, r_ndcoor) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(:,:,:), POINTER :: r_ndcoor + + REAL (KIND = GRID_SR) :: r_onethird=1./3. + INTEGER :: i_alct, i_cnt, i_tnc + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + +!---------- allocate array for dual coordinates + + allocate(r_ndcoor(GRID_dimension,GRID_patchelements,i_arlen), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(c_error='[create_newdualpoints]: dual points array not allocated!') + END IF not_allocdual + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(:,1)= r_coord(:,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element's outer nodes + + r_vertx(:,2)= r_dcoord(:,i_dedge(1,i_tnc,i_cnt)) + r_vertx(:,3)= r_dcoord(:,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate dual triangles center point + + r_ndcoor(:, i_tnc, i_cnt)= r_onethird* & + (r_vertx(:,1)+ r_vertx(:,2)+ r_vertx(:,3)) + END IF + END DO ptch_loop + END DO node_loop + + RETURN + END SUBROUTINE create_newdualpoints + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.dualSWCosine.f90 b/flash2d/src/options/SLM_advanced.dualSWCosine.f90 new file mode 100644 index 0000000000000000000000000000000000000000..88758c09008faaba709c0f68d1647c6f1b8cf180 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.dualSWCosine.f90 @@ -0,0 +1,1227 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_astep +! FUNCTION: +! one step of the cell-integrated SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! 3. adapted to quasi-conservative SL s.paruszewski 03/2015 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + USE SLM_initial +! USE IO_plot_vtu +! USE F95_LAPACK, ONLY:la_gels + PRIVATE + PUBLIC :: slm_astep + !---------- Which type of boundary condition? +!---------- 0 - dirichlet 1 - periodic 2 - reflecting + + INTEGER ::i_boundMod = 2 + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + + INTEGER :: i_alct, i_dual + REAL (KIND = GRID_SR), DIMENSION(i_size) :: r_newArea, r_oldArea, r_upHeight, r_height, r_iniHeight + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha, r_dualvelocity, r_dualhtmp + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_dualalph, r_dualh + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size) :: r_upMomentum, r_putHeight, r_alpha, r_iniGrad, r_oldHeight + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size) :: r_momentum, r_updatedvl, r_newdHeight + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size) :: r_velocity, r_iniVelo, r_iniMom, r_upHeightTemp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + INTEGER (KIND = GRID_SI) :: i_valPoint, i_count, i_timecnt=0, i_cnt, j_cnt + INTEGER (KIND = GRID_SI), DIMENSION(GRID_patchelements, i_size) :: i_nodepatch + REAL (KIND = GRID_SR) :: r_deltaT + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + + + r_deltaT=p_param%num%r_deltatime + r_fac = 1.0_GRID_SR + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + + +!---------- allocate arrays for dual displacements + allocate(r_dualalpha(GRID_dimension,i_dual),r_dualhtmp(GRID_dimension,i_dual),& + r_dualh(i_dual), r_dualvelocity(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!---------- get old velocities of grid points + CALL grid_getinfo(p_ghand(i_timeplus), r_nodevalues = r_velocity,& + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + + +!--- just for debugging + ! CALL grid_getinfo(p_ghand(i_timeplus), i_nodepatch = i_nodepatch) + ! DO i_cnt= 1, i_size + ! DO j_cnt=1, GRID_patchelements + ! WRITE(*,*) r_coord(:,i_cnt), 'Patchelement', i_nodepatch(j_cnt, i_cnt) + ! END DO + ! END DO + +!-SLM--------- calculate (interpolate) old (->OLD TIME) velocities of dual points +!---TODO--- Check for a better way to test if it is initial time + IF(r_modtime/=0.0_GRID_SR) THEN + CALL slm_ainterpolate(p_ghand, r_fac, i_time, i_dual, i_size, GRID_ucomp, & + r_coord, r_dualcoordinates, r_dualvelocity(1,:)) + CALL slm_ainterpolate(p_ghand, r_fac, i_time, i_dual, i_size, GRID_vcomp, & + r_coord, r_dualcoordinates, r_dualvelocity(2,:)) + + ELSE + CALL slm_initvelo(r_dualcoordinates, i_dual, r_dualvelocity) + END IF + + +!-SLM--------- calculate trajectory pieces (displacements) alphas + CALL slm_adisplace(p_param, i_size, r_coord, r_velocity, r_alpha, & + i_dual, r_dualcoordinates,r_dualvelocity, r_dualalpha, & + r_time=r_modtime) + +!-SLM--------- calculate upstream values for velocity, momentum and height (also area calculations) + CALL slm_aupstream(p_ghand, i_time, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_upHeight, r_upMomentum, r_oldArea, r_newArea) + + +!-SLM--------Solving the 2D shallow water equations in conservativ form + +!-SLM--------- calculate new grid values for h + + ! Classic version + CALL slm_calculateH(i_size, r_oldArea, r_newArea, r_upHeight, r_height) + +!-SLM--------- interpolate h values in the dual cell (for derivative calculations) + CALL slm_ainterpolate(p_ghand, r_fac, i_time, i_dual, i_size, GRID_h, & + r_coord, r_dualcoordinates, r_dualhtmp(1,:)) + r_dualh=r_dualhtmp(1,:) + +!-SLM--------- calculate derivative in space of h (needed in the momentum eq) + CALL calcDrvtMeanPatch(i_size, r_coord, i_dual, r_dualcoordinates, i_dualedges,r_height, & + r_dualh, r_newdHeight) + + + ! For debugging using the initial analytical gradient + ! CALL slm_initGrad(r_coord,i_size, r_iniGrad) + ! r_newdHeight=r_iniGrad + + +!-SLM--------- calculate new grid values for momentum + ! Classic version + CALL slm_calculateMom(i_size, r_oldArea, r_newArea, r_upMomentum, r_upHeight, r_deltaT, r_height,& + r_newdHeight, r_momentum) + +!-SLM--------- recalculate velocity with hu/h + CALL slm_recalculateVelocity(i_size, r_height, r_momentum, r_updatedvl) + + + r_putHeight(1,:)=r_height + + +!---------- destroy dual mesh + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- write new values for velocity, momentum and height in grid-variables + + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_updatedvl, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_momentum, & + i_arraypoint=(/ GRID_hu, GRID_hv /)) + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_putHeight, & + i_arraypoint=(/ GRID_h /)) + + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_dualhtmp, r_dualh, r_dualvelocity) + + i_timecnt=i_timecnt+1 + + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_velocity, r_alpha, & + i_darlen, r_dcoord,r_dvelocity, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord, r_velocity + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord, r_dvelocity + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_axy + REAL (KIND = GRID_SR) :: r_dt0 + INTEGER :: i_cnt1 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + +!---------- instead windfield, we use the updated velocities by hv/v + r_axy= r_dt0* r_velocity(:, i_cnt1) + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + +!---------- calculate the displacements for the dual nodes + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + r_axy= r_dt0* r_dvelocity(:, i_cnt1) + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_time, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_upHeight, r_upMomentum, r_uparea, r_dwarea) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen, i_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_uparea, r_dwarea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_upMomentum + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_upHeight + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER :: i_cnt, j_cnt, i_tnc, i_out + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3, r_fac + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_val, r_tmp + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- interpolation of node values on upstream position + + CALL slm_ainterpolateUpstrm(p_mesh, r_fac, i_time, i_arlen, GRID_hu, r_coord, & + r_alpha, r_upMomentum(1,:)) + CALL slm_ainterpolateUpstrm(p_mesh, r_fac, i_time, i_arlen, GRID_hv, r_coord, & + r_alpha, r_upMomentum(2,:)) + CALL slm_ainterpolateUpstrm(p_mesh, r_fac, i_time, i_arlen, GRID_h, r_coord, & + r_alpha, r_upHeight) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + ptch_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element + + r_1= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + r_oarea= r_oarea+ triang_ar(r_1, r_2, r_3) + + ! WRITE(*,*) i_cnt, r_1(1), r_1(2), r_2(1), r_2(2), r_3(1), r_3(2), r_oarea +!---------- the downstream dual element + + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_narea= r_narea+ triang_ar(r_1, r_2, r_3) + + ! WRITE(*,*) 'Downstream: ', r_narea , 'Upstream:', r_oarea, 'Verhältnis', (r_narea/r_oarea) + + + + END IF + END DO ptch_loop + + IF(abs((r_narea/r_oarea)-1.0)>0.1) THEN + ! WRITE(*,*) 'kritisches Flächenverhältnis: ', (r_narea/r_oarea), 'zu Knoten Nummer: ' , i_cnt + END IF +!--------- sum up the total area for each dualcell + r_uparea(i_cnt)= r_oarea + r_dwarea(i_cnt)= r_narea + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + SUBROUTINE slm_ainterpolateUpstrm(p_mesh, r_fac, i_timept, i_arlen, i_val, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER (KIND = GRID_SI), INTENT(in) :: i_timept + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + INTEGER (KIND = GRID_SI), INTENT(in) :: i_val + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen) :: r_reflectHackX, r_reflectHackY + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen) :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp, & + r_areaHeight, r_areaWidth, r_boundCoordRight, r_boundCoordLeft, r_boundCoordTop, r_boundCoordBottom + INTEGER :: i_cnt, i_alct + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + r_eps= GRID_EPS + i_tim= p_mesh(i_timept)%i_timetag + + + + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + + IF( i_boundMod > 0) THEN +!-------- calculation area is an envelope rectangular + r_boundCoordRight = 25000.0_GRID_SR + r_boundCoordTop = r_boundCoordRight + r_boundCoordLeft= 0000000.0_GRID_SR + r_boundCoordBottom = r_boundCoordLeft + r_areaHeight = r_boundCoordTop - r_boundCoordBottom + r_areaWidth = r_boundCoordRight - r_boundCoordLeft + END IF + + IF(i_boundMod == 1) THEN +!---------- P E R I O D I C B O U N D A R I E S !!! THIS IS A DIRTY HACK! + DO i_cnt=1, i_arlen + + IF(r_upstr(1,i_cnt) >= r_boundCoordRight) THEN + r_upstr(1,i_cnt)= r_upstr(1,i_cnt)- r_areaWidth + END IF + IF(r_upstr(1,i_cnt) < r_boundCoordLeft) THEN + r_upstr(1,i_cnt)= r_upstr(1,i_cnt)+ r_areaWidth + END IF + IF(r_upstr(2,i_cnt) >= r_boundCoordTop) THEN + r_upstr(2,i_cnt)= r_upstr(2,i_cnt)- r_areaHeight + END IF + IF(r_upstr(2,i_cnt) < r_boundCoordBottom) THEN + r_upstr(2,i_cnt)= r_upstr(2,i_cnt)+ r_areaHeight + END IF + END DO + + ELSE IF (i_boundMod == 2) THEN +!---------- R E F L E C T I N G B O U N D A R I E S !!! THIS IS A DIRTY HACK! + DO i_cnt=1, i_arlen + + r_reflectHackX(i_cnt)=1.0 + r_reflectHackY(i_cnt)=1.0 + IF(r_upstr(1,i_cnt) > r_boundCoordRight) THEN + r_upstr(1,i_cnt)= r_boundCoordRight-abs(r_upstr(1,i_cnt)-r_boundCoordRight) + r_reflectHackX(i_cnt)=-1.0 + END IF + IF(r_upstr(1,i_cnt) < r_boundCoordLeft) THEN + r_upstr(1,i_cnt)= r_boundCoordLeft+abs(r_boundCoordLeft-r_upstr(1,i_cnt)) + r_reflectHackX(i_cnt)=-1.0 + END IF + IF(r_upstr(2,i_cnt) > r_boundCoordRight) THEN + r_upstr(2,i_cnt)=r_boundCoordRight-abs(r_upstr(2,i_cnt)-r_boundCoordRight) + r_reflectHackY(i_cnt)=-1.0 + END IF + IF(r_upstr(2,i_cnt) < r_boundCoordLeft) THEN + r_upstr(2,i_cnt)= r_boundCoordLeft+abs(r_boundCoordLeft-r_upstr(2,i_cnt)) + r_reflectHackY(i_cnt)=-1.0 + END IF + END DO + + END IF + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + + + + IF(i_boundMod == 0) THEN + +!---------- check if upstream value is outside of the domain (-1) or inside (0) + + i_out= grid_domaincheck(p_mesh(i_timept), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_timept), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +! ELSE + ! r_rside(i_cnt)= 0.0 + END IF + + +!---------- interpolate + r_tmp= grid_coordvalue(p_mesh(i_timept), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + + + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!--- Tausche Vorzeichen bei der Geschwindigkeit und dem Impuls + IF(i_boundMod == 2)THEN + + IF (i_val.EQ.GRID_hv) THEN + r_rside(:)=r_reflectHackY(:)*r_rside(:) + END IF + + IF (i_val.EQ.GRID_hu )THEN + r_rside(:)=r_reflectHackX(:)*r_rside(:) + END IF + + END IF + + RETURN + END SUBROUTINE slm_ainterpolateUpstrm + + + +!***************************************************************** + + +SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_timept, i_arlen, i_length, i_val, & + r_coord, r_nodeOriginal, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER (KIND = GRID_SI), INTENT(in) :: i_timept + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen, i_length + INTEGER (KIND = GRID_SI), INTENT(in) :: i_val + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_nodeOriginal + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_length), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen) :: r_node + REAL (KIND = GRID_SR), DIMENSION(i_arlen) :: r_reflectHackX, r_reflectHackY + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp, & + r_boundCoordRight, r_boundCoordLeft, r_areaHeight, r_areaWidth, r_boundCoordBottom, r_boundCoordTop + INTEGER :: i_cnt, i_alct + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + r_eps= GRID_EPS + i_tim= p_mesh(i_timept)%i_timetag + +!---------- loop over nodes: find element containing point + + + IF(i_boundMod > 0) THEN + !-------- calculation area is an envelope rectangular + ! r_boundCoordRight = 2000000.0_GRID_SR + ! r_boundCoordRight = 6.283185_GRID_SR + r_boundCoordRight = 25000.0_GRID_SR + r_boundCoordTop = r_boundCoordRight + r_boundCoordLeft= 0000000.0_GRID_SR + r_boundCoordBottom = r_boundCoordLeft + r_areaHeight = r_boundCoordTop - r_boundCoordBottom + r_areaWidth = r_boundCoordRight - r_boundCoordLeft + END IF + + node_loop: DO i_cnt=1, i_arlen + + r_node(:,i_cnt)=r_nodeOriginal(:,i_cnt) + + IF(i_boundMod == 1) THEN + + !---------- P E R I O D I C B O U N D A R I E S !!! THIS IS A DIRTY HACK! + IF(r_node(1,i_cnt) >= r_boundCoordRight) THEN + r_node(1,i_cnt)= r_node(1,i_cnt)- r_areaWidth + !WRITE(*,*) r_node(1,i_cnt) + END IF + IF(r_node(1,i_cnt) < r_boundCoordLeft) THEN + r_node(1,i_cnt)= r_node(1,i_cnt)+ r_areaWidth + !WRITE(*,*) r_node(1,i_cnt) + END IF + IF(r_node(2,i_cnt) >= r_boundCoordTop) THEN + r_node(2,i_cnt)= r_node(2,i_cnt)- r_areaHeight + END IF + IF(r_node(2,i_cnt) < r_boundCoordBottom) THEN + r_node(2,i_cnt)= r_node(2,i_cnt)+ r_areaHeight + END IF + + END IF + + IF(i_boundMod == 2) THEN +!---------- R E F L E C T I N G B O U N D A R I E S !!! THIS IS A DIRTY HACK! + r_reflectHackX(i_cnt)=1.0 + r_reflectHackY(i_cnt)=1.0 + IF(r_node(1,i_cnt) > r_boundCoordRight) THEN + r_node(1,i_cnt)= r_boundCoordRight-abs(r_node(1,i_cnt)-r_boundCoordRight) + r_reflectHackX(i_cnt)=-1.0 + END IF + IF(r_node(1,i_cnt) < r_boundCoordLeft) THEN + r_node(1,i_cnt)= r_boundCoordLeft+abs(r_boundCoordLeft-r_node(1,i_cnt)) + r_reflectHackX(i_cnt)=-1.0 + END IF + IF(r_node(2,i_cnt) > r_boundCoordRight) THEN + r_node(2,i_cnt)=r_boundCoordRight-abs(r_node(2,i_cnt)-r_boundCoordRight) + r_reflectHackY(i_cnt)=-1.0 + END IF + IF(r_node(2,i_cnt) < r_boundCoordLeft) THEN + r_node(2,i_cnt)= r_boundCoordLeft+abs(r_boundCoordLeft-r_node(2,i_cnt)) + r_reflectHackY(i_cnt)=-1.0 + END IF + END IF + + + + IF(i_boundMod == 0) THEN +!---------- check if upstream value is outside of the domain + i_out= grid_domaincheck(p_mesh(i_timept), r_node(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_node(:,i_cnt)= grid_boundintersect(p_mesh(i_timept), & + r_coord(:,i_cnt), r_node(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + ! ELSE + + ! r_rside(i_cnt)= 0.0_GRID_SR + + END IF + +!---------- interpolate + + + + r_tmp= grid_coordvalue(p_mesh(i_timept), r_node(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_node + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_node, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + + IF((i_boundMod == 2))THEN + IF (i_val.EQ.GRID_vcomp ) THEN + r_rside(:)=r_reflectHackY(:)*r_rside(:) + END IF + + IF (i_val.EQ.GRID_ucomp )THEN + r_rside(:)=r_reflectHackX(:)*r_rside(:) + END IF + + END IF + + RETURN + END SUBROUTINE slm_ainterpolate + + + + +!***************************************************************** + + + FUNCTION triang_ar(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_ar + + +!***************************************************************** + SUBROUTINE slm_recalculateVelocity(i_arlen, r_height, r_momentum, r_updatedvl) + + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_momentum + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_height + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_updatedvl + INTEGER :: i_count, i_countDim + REAL (KIND = GRID_SR), DIMENSION(i_arlen) :: r_corrHeight + + DO i_count=1, i_arlen + DO i_countDim=1, GRID_dimension + + IF(abs(r_height(i_count))< GRID_eps) THEN + WRITE(*,*) 'Warning in slm_recalculateVelocity: Height goes to zero for element' + WRITE(*,*) i_count + r_updatedvl(i_countDim,i_count)=0.0_GRID_SR + ELSE + r_corrHeight(i_count)=r_height(i_count) + r_updatedvl(i_countDim,i_count)=r_momentum(i_countDim,i_count)/r_corrHeight(i_count) + END IF + + + IF(abs(r_updatedvl(i_countDim,i_count))<GRID_eps) THEN + r_updatedvl(i_countDim,i_count)=0.0_GRID_SR + END IF + + + END DO + END DO + + END SUBROUTINE slm_recalculateVelocity + +!***************************************************************** + SUBROUTINE slm_calculateH(i_arlen, r_oldArea, r_newArea, r_upHeight, r_newHeight) + + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_upHeight, r_oldArea, r_newArea + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_newHeight + INTEGER :: i_count + + DO i_count=1, i_arlen + + IF(abs(r_newArea(i_count)).lt.GRID_eps)THEN + ! WRITE(*,*) (r_newArea(i_count)) + WRITE(*,*) 'Warning your initial mesh is too fine for the machine precision' + END IF + + + r_newHeight(i_count)= abs(r_oldArea(i_count))/abs(r_newArea(i_count)) * r_upHeight(i_count) + + IF(abs(r_newHeight(i_count))<GRID_eps) THEN + r_newHeight(i_count)=0.0_GRID_SR + END IF + + END DO + + END SUBROUTINE slm_calculateH + + +!***************************************************************** + SUBROUTINE slm_calculateMom(i_arlen, r_oldArea, r_newArea, r_upMomentum, r_upHeight, & + r_deltaT, r_newHeight, r_newHeightDvt, r_momentum) + + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_newHeightDvt, r_upMomentum + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_upHeight, r_newHeight + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_momentum + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_oldArea, r_newArea + INTEGER :: i_count, i_countDim + REAL (KIND= GRID_SR), INTENT(in) :: r_deltaT + + + DO i_count=1, i_arlen + Do i_countDim=1, GRID_dimension + + IF(abs(r_newArea(i_count)).lt.GRID_eps)THEN + WRITE(*,*) 'Warning your initial mesh is to fine for the machine precision' + END IF + + + r_momentum(i_countDim,i_count) = abs(r_oldArea(i_count))/abs(r_newArea(i_count)) * & + r_upMomentum(i_countDim,i_count)- r_deltaT*GRID_grav*r_newHeight(i_count)*& + r_newHeightDvt(i_countDim, i_count) + + + IF(abs(r_momentum(i_countDim,i_count))<GRID_eps) THEN + r_momentum(i_countDim,i_count)=0.0_GRID_SR + END IF + END DO + END DO + + + END SUBROUTINE slm_calculateMom + + +!***************************************************************** +!2 try mit der Methode der kleinsten Quadrate LAPACK95 needed +! SUBROUTINE calculateDerivative(i_arlen, r_coord, i_darlen, r_dcoord, i_dedge, r_dwnHeight, & +! r_dHeight, r_newHeightDvt) +!---------- local declarations +! +! IMPLICIT NONE +! INTEGER, INTENT(in) :: i_arlen, i_darlen +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_newHeightDvt +! REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_dwnHeight +! REAL (KIND = GRID_SR), DIMENSION(i_darlen), INTENT(in) :: r_dHeight +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord +! REAL (KIND = GRID_SR) :: r_hxtmp, r_hytmp, r_leftH, r_rightH, & +! r_area, r_globalarea +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 , r_centr +! REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,2*GRID_patchelements) :: r_dualnod +! REAL (KIND = GRID_SR), DIMENSION(2*GRID_patchelements) :: r_vals +! INTEGER, DIMENSION(:,:,:), POINTER, INTENT(in) :: i_dedge +! INTEGER, DIMENSION(2*GRID_patchelements) :: i_dualnodNe +! INTEGER :: i_cnt, j_cnt, i_cntt, i_nneigb +! LOGICAL :: l_inside1, l_inside2 +! +! +!---------- loop over nodes (and their dual cells) +! node_loop: DO i_cnt= 1, i_arlen +! i_nneigb=0 +! r_dualnod=0.0 +! r_vals=0.0 +! i_dualnodNe=0 +! r_centr=0.0 +! l_inside1=.false. +! l_inside2=.false. +! r_area=0.0 +! r_globalarea=0.0 +! +!---------- loop over ther patches of the node's dual cell +! ptch_loop: DO j_cnt= 1, GRID_patchelements +!---------- if there is no edge entry, there is no further patch for that dualcell +! IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN +! EXIT ptch_loop +! ELSE +!---------- the coordinates of the points that form the dual cell (+ r_coord(i_cnt)) +! r_1= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) +! r_2= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) +! r_3= r_coord(:,i_cnt) +! r_area= triang_ar(r_3, r_1, r_2) +! r_globalarea=r_globalarea+r_area +! +!---------- have a look if the node is already known and if not, put it into the list of neighbnodes +! +! IF(i_nneigb==0)THEN +! i_nneigb = i_nneigb + 1_GRID_SI +! i_dualnodNe(i_nneigb) = i_dedge(1,j_cnt,i_cnt) +! r_dualnod(:,i_nneigb) = r_1 +! i_nneigb = i_nneigb + 1_GRID_SI +! i_dualnodNe(i_nneigb) = i_dedge(1,j_cnt,i_cnt) +! r_dualnod(:,i_nneigb) = r_2 +! ELSE +! +! +! knownneigb: DO i_cntt=1, i_nneigb +! IF (.NOT. l_inside1) THEN +! IF (.NOT.(( r_dualnod(1,i_cntt).eq.r_1(1)).AND.( r_dualnod(2,i_cntt).eq.r_1(2)) ))THEN +! i_nneigb = i_nneigb + 1_GRID_SI +! i_dualnodNe(i_nneigb) = i_dedge(1,j_cnt,i_cnt) +! r_dualnod(:,i_nneigb) = r_1 +! l_inside1=.true. +! END IF +! END IF +! IF(.NOT.l_inside2)THEN +! IF(.NOT.(( r_dualnod(1,i_cntt).eq.r_2(1)).AND.( r_dualnod(2,i_cntt).eq.r_2(2)) ))THEN +! i_nneigb = i_nneigb + 1_GRID_SI +! i_dualnodNe(i_nneigb) = i_dedge(1,j_cnt,i_cnt) +! r_dualnod(:,i_nneigb) = r_2 +! l_inside2=.true. +! END IF +! END IF +! END DO knownneigb +! END IF +! +! +! END IF +! END DO ptch_loop +! +! +! r_centr = SUM(r_dualnod,DIM=2)/i_nneigb +! DO i_cntt=1,i_nneigb +! r_dualnod(:,i_cntt)= r_dualnod(:,i_cntt) - r_centr(:) +! r_vals(i_cntt) = r_dHeight(i_dualnodNe(i_cntt)) +! END DO +! +! +! ! r_newHeightDvt(:,i_cnt)= solve_lsq_problem(i_nneigb, r_dualnod, r_vals) +! +! r_newHeightDvt(1,i_cnt)= r_newHeightDvt(1,i_cnt)/r_globalarea +! r_newHeightDvt(2,i_cnt)= r_newHeightDvt(2,i_cnt)/r_globalarea +! IF(abs(r_newHeightDvt(1,i_cnt))<GRID_eps) THEN +! r_newHeightDvt(1,i_cnt)=0.0_GRID_SR +! END IF +! IF(abs(r_newHeightDvt(2,i_cnt))<GRID_eps) THEN +! r_newHeightDvt(2,i_cnt)=0.0_GRID_SR +! END IF +! +! +! END DO node_loop +! +! +! +! +! END SUBROUTINE calculateDerivative + + +!***************************************************************** +! hx der einzelnen patches bilden und mitteln + SUBROUTINE calcDrvtMeanPatch(i_arlen, r_coord, i_darlen, r_dcoord, i_dedge, r_dwnHeight, & + r_dHeight, r_newHeightDvt) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_arlen, i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_newHeightDvt + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_dwnHeight + REAL (KIND = GRID_SR), DIMENSION(i_darlen), INTENT(in) :: r_dHeight + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR) :: r_hxtmp, r_hytmp, r_leftH, r_rightH, & + r_h1, r_h2, r_h3, r_area, r_globalarea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 , r_centr, r_a, r_b, r_c, & + r_tmpGradSingle + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,2*GRID_patchelements) :: r_dualnod + REAL (KIND = GRID_SR), DIMENSION(2*GRID_patchelements) :: r_vals + INTEGER, DIMENSION(:,:,:), POINTER, INTENT(in) :: i_dedge + INTEGER, DIMENSION(2*GRID_patchelements) :: i_dualnodNe + INTEGER :: i_cnt, j_cnt, i_cntt, i_nneigb + LOGICAl :: l_isOnBound + +!--- Strategie: Benutze die Dualen Koordinaten und suche dort (rechtsoben rechtsunten) (linksoebn linksunten)-( + + + !---------- loop over nodes (und somit dualen Elementen + + node_loop: DO i_cnt= 1, i_arlen + i_nneigb=0 + r_dualnod=0.0 + r_vals=0.0 + i_dualnodNe=0 + r_centr=0.0 + r_area=0.0 + r_hxtmp=0.0 + r_hytmp=0.0 + r_globalarea=0.0 + + !---- HACK Setze an den Raendern die initialen Gradienten + + CALL isOnBoundary(r_coord(:,i_cnt),l_isOnBound) + +! IF(l_isOnBound) THEN +! CALL slm_getGradForCoordinate(r_coord(:,i_cnt),r_tmpGradSingle) +! r_newHeightDvt(:,i_cnt) = r_tmpGradSingle(:) +! ELSE + + ptch_loop: DO j_cnt= 1, GRID_patchelements + + + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + ! WRITE(*,*) 'Node: ', r_coord(:,i_cnt), 'Number of Neighbours', j_cnt + EXIT ptch_loop + ELSE + +!---------- the downstream dual element + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_area= triang_ar(r_1, r_2, r_3) + r_globalarea=r_globalarea+r_area +!---------- calculate the hx at echt triangle of the patch element of dual element + + + r_a= r_2- r_1 + r_b= r_3- r_1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= r_a(1)* r_b(2)- r_a(2)* r_b(1) + r_h1=r_dwnHeight(i_cnt) + r_h3=r_dHeight(i_dedge(2,j_cnt,i_cnt)) + r_h2=r_dHeight(i_dedge(1,j_cnt,i_cnt)) +!---------- calculate area + + + + r_hxtmp= r_hxtmp + r_area* & + ( ( (r_h2-r_h3) *(r_1(2)-r_3(2)) - (r_h1-r_h3)*(r_2(2)-r_3(2)) ) /& + ( (r_2(1)-r_3(1))*(r_1(2)-r_3(2)) - (r_1(1)-r_3(1))*(r_2(2)-r_3(2))) ) + + + + r_hytmp=r_hytmp+r_area* ( ( (r_h2-r_h3)*(r_1(1)-r_3(1)) - (r_h1-r_h3)*(r_2(1)-r_3(1)) ) /& + ((r_2(2)-r_3(2))*(r_1(1)-r_3(1)) - (r_1(2)-r_3(2))*(r_2(1)-r_3(1)))) +!--------- mean values of the patch elements to build the + + + + END IF + END DO ptch_loop + r_newHeightDvt(1,i_cnt)= r_hxtmp/r_globalarea + + r_newHeightDvt(2,i_cnt)= r_hytmp/r_globalarea + ! END IF + + + IF(abs(r_newHeightDvt(1,i_cnt))<GRID_eps) THEN + r_newHeightDvt(1,i_cnt)=0.0_GRID_SR + END IF + IF(abs(r_newHeightDvt(2,i_cnt))<GRID_eps) THEN + r_newHeightDvt(2,i_cnt)=0.0_GRID_SR + END IF + + + END DO node_loop + + END SUBROUTINE calcDrvtMeanPatch + + !***************************************************************** + + SUBROUTINE isOnBoundary(r_coordSingle, l_isOnBoundary) + + LOGICAL, INTENT(out) :: l_isOnBoundary + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) , INTENT(in) :: r_coordSingle + + + l_isOnBoundary = .FALSE. + + IF ((r_coordSingle(1) == 0.0_GRID_SR ).OR.(r_coordSingle(2) == 0.0_GRID_SR ).OR.& + (r_coordSingle(1) == 25000.0_GRID_SR ).OR.(r_coordSingle(2) == 25000.0_GRID_SR )) THEN + + l_isOnBoundary = .TRUE. + + END IF + + + END SUBROUTINE + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.dualdiffusion.F90 b/flash2d/src/options/SLM_advanced.dualdiffusion.F90 new file mode 100644 index 0000000000000000000000000000000000000000..d7fbcbfea38bd75c9f18bf2fd1963c98e307aacb --- /dev/null +++ b/flash2d/src/options/SLM_advanced.dualdiffusion.F90 @@ -0,0 +1,971 @@ +!******************************************************************************* +! +!> @file SLM_advanced.dualdiffusion +!> @brief includes module SLM_advanced +! +!******************************************************************************* +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!******************************************************************************* +! MODULE DESCRIPTION: +!> contains the essential time stepping for a semi-Lagrangian scheme. +!> The main routine slm_step/slm_astep provides the propagation of a +!> constituent from time t --> t+Dt. +! + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + USE lapack95, only:gels + PRIVATE + INTEGER (KIND = GRID_SI), PARAMETER :: i_locpatchlen=32_GRID_SI + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** +! DESCRIPTION of [SUBROUTINE slm_astep]: +!> @brief compute semi-Lagrangian time step +! +!> @description This version uses a dual mesh (dual cells corresponding to +!> each grid point) in order to come up with a quasi-conservative scheme. +!> A proper description is given in Behrens (2006): Adaptive Atmospheric Modeling, Springer. +! +!> @param[in] p_ghand grid handling data structure +!> @param[in] p_param parameter data structure +!> @param[in] p_time timing data structure +!> @param[in] r_modtime model time point +!> @param[in] i_size length of array with grid points +!> @param[in] r_coord the coordinate array (grid points) +!> @param[out] r_tracer the computed new grid values +!> @param[in] i_newsdepth otional indicator for a subset of values to be computed + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates, i_newsdepth= i_newsdepth, i_newlength=i_size) + IF(i_alct /= i_size) CALL grid_error(c_error='[slm_step]: incompatible new lengths...') + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE slm_adisplace]: +!> @brief compute displacements (trajectories) for each grid point (and dual points) +!> +!> @param[in] p_param parameter data structure +!> @param[in] i_arlen length of array with grid points +!> @param[in] r_coord the coordinate array (grid points) +!> @param[out] r_alpha upstream deviation for grid points +!> @param[in] r_rside interpolated upstream values (RHS in SLM) +!> @param[in] i_darlen length of array with dual points +!> @param[in] r_dcoord the coordinate array (dual grid points) +!> @param[out] r_dalpha upstream deviation for dual points +!> @param[in] r_time a time value, in case wind field needs it (optional) + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE slm_aupdate]: +!> @brief compute upstream values in the semi-Lagrangian method +!> +!> @param[in] p_param parameter data structure +!> @param[in] i_arlen length of array with grid points +!> @param[in] r_coord the coordinate array (grid points) +!> @param[in] r_rside interpolated upstream values +!> @param[out] r_update updated values (new time step) +!> @param[in] r_time a time value, in case source function needs it (optional) + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE slm_aupstream]: +!> @brief compute upstream values in the semi-Lagrangian method +!> +!> @param[in] p_mesh grid handling data structure +!> @param[in] p_param parameter data structure +!> @param[in] i_arlen length of array with grid points +!> @param[in] r_coord the coordinate array (grid points) +!> @param[in] r_alpha upstream deviation for grid points +!> @param[in] r_rside interpolated upstream values (RHS in SLM) +!> @param[in] i_darlen length of array with dual points +!> @param[in] r_dcoord the coordinate array (dual grid points) +!> @param[in] r_dalpha upstream deviation for dual points +!> @param[in] i_dedge list of indices for dual edges +!> @param[out] r_rside interpolated upstream values (RHS in SLM) + SUBROUTINE slm_aupstream(p_mesh, p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_aux, & + r_uparea, r_dwarea, r_dwdiff, r_updiff + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_intermed + INTEGER :: i_alct, i_cnt, j_cnt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + INTEGER, DIMENSION(1) :: i_valind + REAL (KIND = GRID_SR) :: r_dt + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + r_dt= p_param%num%r_deltatime + +!---------- allocate auxilliary arrays + + allocate(r_aux(i_arlen), r_intermed(1,i_arlen), & + r_uparea(i_arlen), r_dwarea(i_arlen), & + r_dwdiff(i_arlen), r_updiff(i_arlen), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(39) + END IF not_alloc + +!---------- interpolation of node values + + CALL slm_ainterpolate(p_mesh, r_fac, i_time, i_arlen, GRID_tracer, r_coord, & + r_alpha, r_aux) + +!---------- loop over nodes + + node_loop: DO i_cnt= 1, i_arlen + r_oarea= 0. + r_narea= 0. + ptch_loop: DO j_cnt= 1, GRID_patchelements + IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- the upstream dual element + + r_1= r_coord(:,i_cnt)- r_alpha(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dalpha(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dalpha(:,i_dedge(2,j_cnt,i_cnt)) + r_oarea= r_oarea+ triang_area(r_1, r_2, r_3) + +!---------- the downstream dual element + + r_1= r_coord(:,i_cnt) + r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) + r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) + r_narea= r_narea+ triang_area(r_1, r_2, r_3) + END IF + END DO ptch_loop + r_uparea(i_cnt)= r_oarea + IF(r_narea /= 0._GRID_SR) THEN + r_dwarea(i_cnt)= 1._GRID_SR/ r_narea + ELSE + r_dwarea(i_cnt)= 0._GRID_SR + END IF + END DO node_loop + +!---------- now calculate new values using a (nonexact) interpolation formula + + r_rside= r_aux* r_uparea* r_dwarea + + +!---------- we store this (being the advected new value provided no sources nor sinks) +! in an intermediate storage in amatos, to benefit from amatos' interpolation + + r_intermed(1,:) = r_rside(:) + i_valind= (/ GRID_zeta /) + CALL grid_putinfo(p_mesh(i_timeplus), i_arraypoint= i_valind, & + i_newsdepth= 1, r_nodevalues= r_intermed) + +!---------- we will now compute a diffusion operator +! first: compute the downstream values + + CALL compute_diffop(p_mesh, i_timeplus, GRID_zeta, i_arlen, i_darlen, & + r_dwdiff, i_dedge, r_coord, r_dcoord) + +!---------- second: the upstream diffusion values + + CALL compute_diffop(p_mesh, i_time, GRID_tracer, i_arlen, i_darlen, & + r_updiff, i_dedge, r_coord, r_dcoord, & + r_upstream=r_alpha, r_dupstream=r_dalpha) + +!---------- now we can compose the advection diffusion result: + + r_rside= r_rside+ (r_dt* r_dt)/2._GRID_SR* & + (r_dwdiff + r_uparea* r_dwarea* r_updiff) + +!---------- deallocate auxilliary arrays + + deallocate(r_aux, r_intermed, r_uparea, r_dwarea, r_dwdiff, r_updiff) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** +! DESCRIPTION of [SUBROUTINE slm_ainterpolate]: +!> @brief interpolate upstream values at positions coord - fac* alpha. +!> +!> @param[in] p_mesh grid handling data structure +!> @param[in] r_fac factor for controlling upstream deviation length +!> @param[in] i_arlen length of array with grid points +!> @param[in] r_coord the coordinate array (grid points) +!> @param[in] r_alpha upstream deviation for grid points +!> @param[out] r_rside interpolated upstream values (RHS in SLM) + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_timept, i_arlen, i_val, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER (KIND = GRID_SI), INTENT(in) :: i_timept + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + INTEGER (KIND = GRID_SI), INTENT(in) :: i_val + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + r_eps= GRID_EPS + i_tim= p_mesh(i_timept)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_timept), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_timept), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_timept), r_upstr(:,i_cnt), & + i_interpolorder=GRID_loworder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE compute_diffop]: +!> @brief compute the diffusion operator for a cell (either upstream or downstream) +! +!> @description we compute the diffusion operator by a least squares approximation +!> with a quadratic polynomial function. Then we differentiate the quadratic polynomial +!> analytically to obtain the Laplace operator (aka diffusion operator). We need the +!> specification of the diffusion coefficient. If it is space-dependent, we also need +!> the gradient of the diffusion coefficient. +! +!> @param[in] p_mesh grid handling data structure +!> @param[in] i_tim time point (corresponding to mesh) +!> @param[in] i_valuepointer the value for which the diffusion is to applied +!> @param[in] i_arlen length of array with grid points +!> @param[in] i_darlen length of array with dual points +!> @param[out] r_diffop diffusion operator array (for each grid point) +!> @param[in] i_dedge list of indices for dual edges +!> @param[in] r_coord the coordinate array (grid points) +!> @param[in] r_dcoord the coordinate array (dual grid points) +!> @param[in] r_alpha upstream deviation for grid points +!> @param[in] r_dalpha upstream deviation for dual points +! + SUBROUTINE compute_diffop(p_mesh, i_tim, i_valuepointer, i_arlen, i_darlen, & + r_diffop, i_dedge, r_coord, r_dcoord, r_upstream, & + r_dupstream) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER (KIND = GRID_SI), INTENT(in) :: i_tim + INTEGER (KIND = GRID_SI), INTENT(in) :: i_valuepointer + INTEGER (KIND = GRID_SI), INTENT(in) :: i_arlen + INTEGER (KIND = GRID_SI), INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_diffop + INTEGER (KIND = GRID_SI), DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), OPTIONAL :: r_upstream + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), OPTIONAL :: r_dupstream + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_locpatchlen) :: r_loccoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_locpatchlen) :: r_glocoord + REAL (KIND = GRID_SR), DIMENSION(i_locpatchlen) :: r_locvals + + INTEGER (KIND = GRID_SI) :: i_cnt, j_cnt, i_ptc, i_cnt2 + LOGICAL :: l_upstream, l_exist2, l_exist3 + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3, r_4, r_fac, r_1alt + REAL (KIND = GRID_SR) :: r_stencrad + +!---------- initializations + + l_upstream = .FALSE. + +!---------- check input + + upstr_present: IF(PRESENT(r_upstream)) THEN + IF(.NOT. PRESENT(r_dupstream)) & + CALL grid_error(c_error='[compute_diffop]: incompatible dual upstream values...') + IF(i_tim /= i_time) & + CALL grid_error(c_error='[compute_diffop]: upstream values at t/=i_time?') + l_upstream =.TRUE. + END IF upstr_present + +!---------- loop over nodes to set up local coordinates and values + + node_loop: DO i_cnt=1, i_arlen + + IF(l_upstream) THEN ! this is the center point at which diffop is evaluated + r_1= r_coord(:,i_cnt)- r_upstream(:,i_cnt) + ELSE + r_1= r_coord(:,i_cnt) + END IF + +!---------- walk through the patch of the node +! +! i_ptc = 0_GRID_SI +! r_loccoord = 0._GRID_SR +! ptch_loop: DO j_cnt= 1, GRID_patchelements +! ptch_exist: IF(i_dedge(1,j_cnt,i_cnt) == 0) THEN +! EXIT ptch_loop +! ELSE ptch_exist +! +!---------- distinguish between the upstream and downstream computations +! +! upstream: IF(l_upstream) THEN +! r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt))- r_dupstream(:,i_dedge(1,j_cnt,i_cnt)) +! r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt))- r_dupstream(:,i_dedge(2,j_cnt,i_cnt)) +! r_4= (1._GRID_SR/3._GRID_SR)* (r_1+ r_2+ r_3) +! ELSE upstream +! r_2= r_dcoord(:,i_dedge(1,j_cnt,i_cnt)) ! this is dual edge point 1 +! r_3= r_dcoord(:,i_dedge(2,j_cnt,i_cnt)) ! this is dual edge point 2 +! r_4= (1._GRID_SR/3._GRID_SR)* (r_1+ r_2+ r_3) ! this is the dual triangle center +! END IF upstream +! +!---------- collect unique coordinates, we omit the coordinate of the point at which +! we evaluate the diffusion operator! I'm not sure if this is useful... +! +! IF(i_ptc == 0_GRID_SI) THEN +! i_ptc= i_ptc+ 1_GRID_SI +! r_loccoord(:,i_ptc) = r_1 - r_2 ! we set up a local coordinate system +! r_glocoord(:,i_ptc) = r_2 ! for the interpolation we need the true coord. +! ELSE +! l_exist2 = .FALSE. +! l_exist3 = .FALSE. +! +!---------- check if coordinate has already been registered +! DO i_cnt2 = 1, i_ptc +! IF (coord_dist(r_2,r_loccoord(:,i_cnt2))<GRID_EPS) l_exist2= .TRUE. +! IF (coord_dist(r_3,r_loccoord(:,i_cnt2))<GRID_EPS) l_exist3= .TRUE. +! END DO +! IF(.NOT. l_exist2) THEN +! IF(i_ptc >= i_locpatchlen) EXIT ptch_loop +! i_ptc = i_ptc+ 1_GRID_SI +! r_loccoord(:,i_ptc) = r_1 - r_2 +! r_glocoord(:,i_ptc) = r_2 +! END IF +! IF(.NOT. l_exist3) THEN +! IF(i_ptc >= i_locpatchlen) EXIT ptch_loop +! i_ptc = i_ptc+ 1_GRID_SI +! r_loccoord(:,i_ptc) = r_1 - r_3 +! r_glocoord(:,i_ptc) = r_3 +! END IF +! IF(i_ptc >= i_locpatchlen) EXIT ptch_loop +! i_ptc = i_ptc+ 1_GRID_SI +! r_loccoord(:,i_ptc) = r_1 - r_4 +! r_glocoord(:,i_ptc) = r_4 +! END IF +! +! END IF ptch_exist +! END DO ptch_loop + +!---------- create stencil + + i_ptc = 10_GRID_SI + r_glocoord = 0._GRID_SI + CALL grid_edgelength(p_mesh(i_tim), r_min= r_stencrad) + r_stencrad = r_stencrad* 0.5_GRID_SR + +!---------- make sure whole stencil lies within domain! + + r_2= r_1 + r_1alt=r_1 + r_1alt(1)= r_1alt(1)+r_stencrad + IF(grid_domaincheck(p_mesh(i_tim), r_1alt) /= 0) THEN + r_2(1)= r_2(1)- r_stencrad + END IF + r_1alt=r_1 + r_1alt(1)= r_1alt(1)-r_stencrad + IF(grid_domaincheck(p_mesh(i_tim), r_1alt) /= 0) THEN + r_2(1)= r_2(1)+ r_stencrad + END IF + r_1alt=r_1 + r_1alt(2)= r_1alt(2)+r_stencrad + IF(grid_domaincheck(p_mesh(i_tim), r_1alt) /= 0) THEN + r_2(2)= r_2(2)- r_stencrad + END IF + r_1alt=r_1 + r_1alt(2)= r_1alt(2)-r_stencrad + IF(grid_domaincheck(p_mesh(i_tim), r_1alt) /= 0) THEN + r_2(2)= r_2(2)+ r_stencrad + END IF + r_1= r_2 + +!---------- now really create stencil + + CALL createstencil(i_ptc, r_1, r_stencrad, r_glocoord) + +!---------- check if we have enough points, otherwise we set diffusion operator to zero +! i.e. we compute pure advection... + + sys_underdetmd: IF(i_ptc < 7_GRID_SI) THEN + WRITE(*,*) 'DEBUG: [compute_diffop] underdetermined system at grid point: ',i_cnt + r_diffop(i_cnt) = 0._GRID_SR + ELSE sys_underdetmd + +!---------- interpolate values at points - we use an existing upstream interpolation +! function and tweak the input (setting the factor with which to include the +! upstream position to zero (thus we only interpolate at r_loccoord positions) + + r_fac = 0._GRID_SR + r_locvals = 0._GRID_SR + CALL slm_ainterpolate(p_mesh, r_fac, i_tim, i_ptc, i_valuepointer, r_glocoord, & + r_glocoord, r_locvals) + +!---------- now set up LSQ problem + +! r_1= 0._GRID_SR ! this is the center of the local coordinate system! + r_diffop(i_cnt) = solve_lsq_problem(i_ptc, r_1, r_glocoord, r_locvals) + END IF sys_underdetmd + END DO node_loop + + RETURN + END SUBROUTINE compute_diffop + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE solve_lsq_problem]: +!> @brief solve a least squared problem for fitting a quadratic polynomial to +!> given values in order to derive the Laplacian (diffusion operator), requires LAPACK95! +!> +!> @param[in] i_numnodes number of nodes in coordinate array (array length) +!> @param[in] r_cntrcoo center coordinate at which to evaluate diffusion coeff. +!> @param[in] r_nodecoo coordinates +!> @param[in] r_vals function values at coordinates +!> @param[out] r_laplace computed diffusion operator +! + FUNCTION solve_lsq_problem(i_numnodes, r_cntrcoo, r_nodecoo, r_vals) RESULT(r_laplace) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER (KIND = GRID_SI), INTENT(in) :: i_numnodes + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION) :: r_cntrcoo + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION,i_numnodes) :: r_nodecoo + REAL (KIND = GRID_SR), DIMENSION(i_numnodes) :: r_vals + + REAL (KIND = GRID_SR) :: r_laplace + +! REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION,i_locpatchlen) :: r_matrix +! REAL (KIND = GRID_SR), DIMENSION(i_locpatchlen) :: r_rhs + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_matrix + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_rhs + INTEGER (KIND = GRID_SI) :: i_cn0, i_alct, i_info + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION) :: r_diffcoeffgrad + REAL (KIND = GRID_SR) :: r_diffcoeff, r_lplx, r_lply + +!---------- allocate working matrix + + ALLOCATE(r_matrix(i_numnodes,6), r_rhs(i_numnodes), STAT=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[solve_lsq_problem]: could not allocate matrix') + +!---------- initialize + + r_matrix= 0.0 + r_rhs= 0.0 + +!---------- set up coefficients in (Vandermonde) matrix and rhs + + DO i_cn0=1,i_numnodes + r_matrix(i_cn0, 1)= r_nodecoo(1,i_cn0)* r_nodecoo(1,i_cn0) + r_matrix(i_cn0, 2)= r_nodecoo(2,i_cn0)* r_nodecoo(2,i_cn0) + r_matrix(i_cn0, 3)= r_nodecoo(1,i_cn0)* r_nodecoo(2,i_cn0) + r_matrix(i_cn0, 4)= r_nodecoo(1,i_cn0) + r_matrix(i_cn0, 5)= r_nodecoo(2,i_cn0) + r_matrix(i_cn0, 6)= 1.0_GRID_SR + r_rhs(i_cn0) = r_vals(i_cn0) + END DO + +!---------- LAPACK 95 least squares solution + +#ifdef USE_MKL + CALL gels(r_matrix, r_rhs, 'N', i_info); +#else + CALL la_gels(r_matrix, r_rhs, 'N', i_info); +#endif + IF (i_info < 0) THEN + CALL grid_error(c_error='[solve_lsq_problem]: could not complete LAPACK routine gels successfully') + END IF + +!---------- evaluate diffusion coefficient (function, if dependent) + + CALL diffcoeff(r_cntrcoo, r_diffcoeff, r_diffcoeffgrad) + +!---------- result the first dim parameters are just the gradient values! + + r_lplx = r_diffcoeffgrad(1)* & + (2._GRID_SR* r_rhs(1)* r_cntrcoo(1)+ r_rhs(3)* r_cntrcoo(2) + r_rhs(4)) + & + r_diffcoeff* 2._GRID_SR* r_rhs(1) + r_lply = r_diffcoeffgrad(2)* & + (2._GRID_SR* r_rhs(2)* r_cntrcoo(2)+ r_rhs(3)* r_cntrcoo(1) + r_rhs(5)) + & + r_diffcoeff* 2._GRID_SR* r_rhs(2) + r_laplace= r_lplx+ r_lply + +!---------- deallocate temporary arrays + + DEALLOCATE(r_matrix, r_rhs) + + RETURN + END FUNCTION solve_lsq_problem + +!***************************************************************** +! DESCRIPTION of [FUNCTION triang_area]: +!> @brief compute area of a triangle given by three coordinates +!> +!> @param[in] r_coord1 first coordinate of triangle +!> @param[in] r_coord2 2nd coordinate of triangle +!> @param[in] r_coord3 3rd coordinate of triangle +!> @param[out] r_area area of triangle +! + FUNCTION triang_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_area +!***************************************************************** +! DESCRIPTION of [FUNCTION coord_dist]: +!> @brief compute distance (Eukledian) between two coordinates +!> +!> @param[in] r_coord1 first coordinate of triangle +!> @param[in] r_coord2 2nd coordinate of triangle +!> @param[out] r_dist area of triangle + FUNCTION coord_dist(r_coord1, r_coord2) RESULT (r_dist) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2 + REAL (KIND = GRID_SR) :: r_dist + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate Eulkidean distance of two coordinates + + r_a= r_coord2- r_coord1 + r_dist= sqrt(dot_product(r_a,r_a)) + + RETURN + END FUNCTION coord_dist + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE diffcoeff]: +!> @brief compute the diffusion operator (can be selected) +!> +!> @param[in] r_coo coordinate at which to evaluate diffusion coefficient +!> @param[out] r_coef diffusion coefficient, evaluated at r_coo +!> @param[out] r_coefgrad gradient of diffusion coefficient, evaluated at r_coo + SUBROUTINE diffcoeff(r_coo, r_coef, r_coefgrad) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION), INTENT(in) :: r_coo + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION), INTENT(out) :: r_coefgrad + REAL (KIND = GRID_SR), INTENT(out) :: r_coef + +!---------- compute diffusion coefficient and its gradient, depending on coordinate +! this is very simple, with a constant, time-independent coefficient (thus +! gradient = 0) + + r_coef= p_contr%tst%tst_real(1,1) !-0.005_GRID_SR ! should (or must?) be negative - otherwise anti-diffusion... +! r_coef= 0._GRID_SR ! should (or must?) be negative - otherwise anti-diffusion... + r_coefgrad= 0._GRID_SR + + RETURN + END SUBROUTINE diffcoeff + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE createstencil]: +!> @brief create a stencil of points for Least Squares approx. +!> +!> @param[in] i_size number of stencil coordinates +!> @param[in] r_coo center coordinate of the stencil +!> @param[out] r_radius radius of the stencil +!> @param[out] r_stencilcoo coordinate of the stencil + SUBROUTINE createstencil(i_size, r_coo, r_radius, r_stencilcoo) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER (KIND = GRID_SI), INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION), INTENT(in) :: r_coo + REAL (KIND = GRID_SR), INTENT(in) :: r_radius + REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION,i_size), INTENT(out) :: r_stencilcoo + + REAL (KIND = GRID_SR) :: r_dx, r_tmp, r_half + INTEGER (KIND = GRID_SI) :: i_cnt, i_half + +!---------- check for minimum size + + IF(i_size < 1_GRID_SI) CALL grid_error(c_error='[createstencil]: illegal size < 1!') + +!---------- if size small: only one ring + + small_stencil: IF (i_size < 4_GRID_SI) THEN + +!---------- compute step size + + r_dx = (GRID_PI* 2._GRID_SR)/REAL(i_size,GRID_SR) + + DO i_cnt=1,i_size + r_tmp= r_dx* (i_cnt-1) + r_stencilcoo(1,i_cnt)= r_coo(1)+ (cos(r_tmp)* r_radius) + r_stencilcoo(2,i_cnt)= r_coo(2)+ (sin(r_tmp)* r_radius) + END DO + ELSE small_stencil + r_half= REAL(i_size/2,GRID_SR) + i_half= floor(r_half) + +!---------- compute step size + + r_dx = (GRID_PI* 2._GRID_SR)/REAL(ceiling(r_half),GRID_SR) + + DO i_cnt=1,i_half + r_tmp= r_dx* (i_cnt-1) + r_stencilcoo(1,i_cnt)= r_coo(1)+ (cos(r_tmp)* r_radius) + r_stencilcoo(2,i_cnt)= r_coo(2)+ (sin(r_tmp)* r_radius) + END DO + DO i_cnt=i_half+1,i_size + r_tmp= r_dx* (2*(i_cnt-1)+1)/2 + r_stencilcoo(1,i_cnt)= r_coo(1)+ (cos(r_tmp)* 0.5* r_radius) + r_stencilcoo(2,i_cnt)= r_coo(2)+ (sin(r_tmp)* 0.5* r_radius) + END DO + END IF small_stencil + + RETURN + END SUBROUTINE createstencil + +!***************************************************************** +! DESCRIPTION of [SUBROUTINE fillstencil]: +!> @brief Takes a number of coordinates in a stencil previously defined +!> and looks up/interpolates corresponding values for the Least Squares +!> approximation. +!> +!> @param[in] i_size number of stencil coordinates +!> @param[in] r_stencilcoo coordinates of the stencil +!> @param[out] r_stencilval values at stencil coordinates +! SUBROUTINE fillstencil(i_size, r_stencilcoo, r_stencilval) +! +!!---------- local declarations +! +! IMPLICIT NONE +! +! INTEGER (KIND = GRID_SI), INTENT(in) :: i_size +! REAL (KIND = GRID_SR), DIMENSION(GRID_DIMENSION,i_size), INTENT(in) :: r_stencilcoo +! REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_stencilval +! +! +! RETURN +! END SUBROUTINE fillstencil + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.mpslm.f90 b/flash2d/src/options/SLM_advanced.mpslm.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b7e1bbc4c19bef62846a94146d6d8f0f01f56222 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.mpslm.f90 @@ -0,0 +1,2235 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_astep +! FUNCTION: +! one step of the advanced SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_adisplace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_adisplace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_aupdate +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_aupdate(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_aupstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_aupstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_ainterpolate +! FUNCTION: +! do the MPSLM scheme (no interpolation is done!) +! SYNTAX: +! CALL slm_MPscheme(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this is the 2D implementation of Mass Packet SLM +! +!----------------------------------------------------------------- +! +! NAME: +! generate_MP_coeff +! FUNCTION: +! generate mass packet coefficients to divide a single +! triangle in parts +! SYNTAX: +! CALL generate_MP_coeff() +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +! +!----------------------------------------------------------------- +! +! NAME: +! remove_MP_coeff +! FUNCTION: +! remove the MP_coeff from memory +! SYNTAX: +! CALL generate_MP_coeff() +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +! +!----------------------------------------------------------------- +! +! +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! +!***************************************************************** +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 04/2002 +! 2. original MPSLM version l. mentrup 02/2003 +! 3. compliant to amatos 2.0 j. behrens 07/2003 +! 4. adapted 2D version l. mentrup 11/2003 +! 5. bugs fixed j. behrens 12/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + + +!***************************************************************** + + IMPLICIT NONE + + INTEGER, SAVE :: MAX_REFLVL + +!---------- Begin Triangle table + + TYPE conservation_entry + INTEGER :: i_MPperTri + INTEGER, POINTER :: i_MPindex(:) ! index array of the MP evoked by a triangle + INTEGER :: i_refinelvl ! refinement level + LOGICAL :: l_massassigned + LOGICAL :: l_searchtri + LOGICAL :: l_refine + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_mass ! mass per corner point of the triangle + END TYPE conservation_entry + + + TYPE conservation_entry_ptr + TYPE(conservation_entry), POINTER :: cp + END TYPE conservation_entry_ptr + + + TYPE (conservation_entry_ptr), DIMENSION(:,:), ALLOCATABLE, SAVE :: p_ttable + +!---------- End Triangle table + + +!---------- Begin Mass Packet Coefficient table + + !------ coefficient container to generate one mass packet + TYPE MP_coeff + INTEGER :: i_origin ! index of the originating triangle node + INTEGER, DIMENSION(GRID_dimension) :: i_prvdir ! prev direction of the tree + INTEGER :: i_celltype ! 1: @corner, 2: @edge, 3: in triangle + REAL (KIND = GRID_SR) :: r_area ! ratio of the mass packets area to the area of the triangle + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_coeff ! coefficients to compute the coordinates of the mass packet (dimensionless) + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_mass ! defines how much mass per node will be assigned (ratio) + LOGICAL :: l_end ! end of tree? if TRUE, then create new branches in next refinement level + END TYPE MP_coeff + + + ! array of MassPacket coefficients, to generate Mass Packets of a triangle for a certain reflvl + TYPE MP_coeff_arr + TYPE (MP_coeff), POINTER :: mpc(:) ! + END TYPE MP_coeff_arr + + + TYPE MP_coeff_arr_ptr + INTEGER :: i_cnum ! number of cells/mass packets, each cell is a mass packet + TYPE (MP_coeff_arr), POINTER :: p_mpc ! pointer to the mass packet coefficient array + END TYPE MP_coeff_arr_ptr + + + TYPE (MP_coeff_arr_ptr), DIMENSION(:), ALLOCATABLE, SAVE :: p_MPCtable ! pointer to the coefficient array of each reflvl + + +!---------- + + + +!---------- Begin Mass packet table + + TYPE MP_entry + INTEGER :: i_MPinTri + INTEGER :: i_MPbyTri + REAL (KIND = GRID_SR) :: r_mass + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR), DIMENSION (GRID_dimension) :: r_coord + LOGICAL :: l_searchMP + LOGICAL :: l_assignmass + END TYPE MP_entry + + + TYPE MP_entry_ptr + TYPE (MP_entry), POINTER :: MP + END TYPE MP_entry_ptr + +!---------- End Mass packet table + + +!***************************************************************** + + PRIVATE + PUBLIC :: slm_astep, slm_interpolinit, slm_interpolquit + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream + +!***************************************************************** + + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, GRID_edgenodes) :: r_gn_coor + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_en_coor_old + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ref + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_elmtarea_up + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_totalarea + + REAL (KIND = GRID_SR), DIMENSION(i_arlen) :: r_nmass, r_narea + + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_mass_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, GRID_elementnodes) :: r_en_coor ! elementnodes coordinates + + !------- vars. for a priori determination of inner refinement level + REAL (KIND = GRID_SR) :: r_beta ! see info below + REAL (KIND = GRID_SR) :: r_elmtmass ! current tetra mass + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_elmtconc ! triangle (elmt) concentration array + REAL (KIND = GRID_SR) :: r_elmtconc_max, r_elmtconc_min ! extrema of concentration in triangle (elmt) + REAL (KIND = GRID_SR) :: r_relconc, r_relreflvl ! relative conc w.r.t. extrema (0..1) + + !------- control mass conservation + REAL (KIND = GRID_SR) :: r_mass_before, r_mass_inside, r_mass_outside + + !------- control inner adaptivity + INTEGER :: MAX_LOOPS + REAL (KIND = GRID_SR) :: r_gamma, r_eps + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_arearatio + REAL (KIND = GRID_SR) :: r_arearatio_max, r_arearatio_min, r_arearatio_mean + + INTEGER :: i_loopnum + + + INTEGER, DIMENSION(:), ALLOCATABLE :: i_mps_in_tri + INTEGER :: i_mpInTri + INTEGER :: i_MPidx +! INTEGER :: i_elmtindex + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_gnodes + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_elmtedges + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enodes, i_enodes_old + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_eneighbours + INTEGER, DIMENSION(:), ALLOCATABLE :: i_elmtlevel ! level of refinement for each triangle (finite element of triangular form) + INTEGER, DIMENSION(:), ALLOCATABLE :: i_maxlvl + INTEGER :: i_alct, i_siz + INTEGER :: i_enum_f, i_enum_f_old, i_gnum, i_nnum, i_nnum_old, i_MPnum, i_enum_mass + INTEGER :: i_elmt_cnt, i_node_cnt, j_cnt, i_triangle_cnt, i_MP_cnt, i_cnt, i_dim + INTEGER :: i_tim, i_timplus + INTEGER :: i_massassigned, i_areaoverload, i_savedMP, i_totalMP + + INTEGER :: i_reflvl_startincr, i_reflvl_incr, i_clvlbnd, i_rlvlbnd + + + + TYPE (MP_entry_ptr), DIMENSION(:), ALLOCATABLE :: p_MPtable ! Mass packet table + TYPE (MP_entry_ptr), DIMENSION(:), ALLOCATABLE :: p_MPtable_tmp ! temp. mass packet table, for initialization and reallocation purposes + TYPE (MP_entry), POINTER :: p_MP ! temp. single mass packet entry + + TYPE (conservation_entry_ptr), DIMENSION(:), ALLOCATABLE :: p_ttable_tmp ! temp. triangle table, for initialization and reallocation purposes + TYPE (conservation_entry), POINTER :: p_ce ! temp. single conservation entry + INTEGER, POINTER :: i_MPidx_tmp(:) ! temp. mass packet index array to reallocate mass packets per triangle dynamically +!----------- + + + +!----------- initialize + i_enum_f = p_mesh(i_timeplus)%i_enumfine + i_enum_f_old = p_mesh(i_time)%i_enumfine + i_gnum = p_mesh(i_timeplus)%i_gnumber + i_nnum_old = p_mesh(i_time)%i_nnumber + i_nnum = p_mesh(i_timeplus)%i_nnumber + i_tim = p_mesh(i_time)%i_timetag + i_timplus = p_mesh(i_timeplus)%i_timetag + i_clvlbnd = p_mesh(i_tim)%i_crslvlbnd ! coarsest refinement level + i_rlvlbnd = p_mesh(i_tim)%i_reflvlbnd ! finest refinement level + + +!----------- a priori refinement control + r_beta = 0.5 ! this controls how much the concentration is weighted against the reflvl of the triangle for + ! the a priori choice of refinement level + +!----------- a posteriori controls for inner adaptivity + MAX_LOOPS = 1 ! set maximum inner iterations + i_reflvl_startincr = 5 ! starting increment for inner refinement + i_reflvl_incr = 3 ! increment for inner refinement + + r_gamma = 1.1 +!----------- r_gamma controls the mass assignment +!----------- if the total volume of all triangle which, via the barycenter, assigned mass to a triangle in the new mesh is greater than r_gamma*area(triangle), +!----------- the old mesh is coarse (w.r.t. volume) to be downstreamed without refining locally. Danger of mass concentration! + + r_eps = 1.e-5 ! epsilon greather than zero... +!----------- + + +!---------- allocate work array +!-------------- 'old mesh' arrays + + ALLOCATE(i_elmtlevel(i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_maxlvl(i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_enodes_old(GRID_elementnodes,i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(r_en_coor_old(GRID_dimension, i_nnum_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(r_elmtconc(i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + +!-------------- 'new mesh' arrays + + ALLOCATE(r_upstr(GRID_dimension, i_nnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(r_elmtarea_up(i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(r_totalarea(i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(r_arearatio(i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_mps_in_tri(i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_gnodes(GRID_edgenodes,i_gnum), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_enodes(GRID_elementnodes,i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_elmtedges(GRID_elementedges,i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + ALLOCATE(i_eneighbours(GRID_elementedges, i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + +!---------- + + +!---------- preinitialize + + i_elmtlevel= 0. + i_enodes_old= 0 + r_en_coor_old= 0. + r_elmtconc=0. + + r_upstr= 0. + r_elmtarea_up= 0. + r_totalarea= 0. + i_mps_in_tri= 0 + i_gnodes= 0 + i_enodes= 0 + i_elmtedges= 0 + i_eneighbours= 0 + + r_nmass= 0. + r_narea= 0. + r_rside= 0. + +!---------- + + +!---------- initialize Tetra table +!---------- ATTENTION> values of i_timeplus and i_time are alternating after each timestep. thus i_timeplus(new_timestep) == i_time(old_timestep) etc. +!---------- Did the length of the conservation table grow due to more nodes/tetrahedra in the new mesh? Then re-initialize the conservation table + + IF (.NOT. ALLOCATED(p_ttable)) THEN + CALL slm_interpolinit(p_mesh) + END IF + + IF (size(p_ttable(i_timplus,:)) < i_enum_f) THEN + ALLOCATE(p_ttable_tmp(i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + DO i_cnt=1, i_enum_f_old + p_ttable_tmp(i_cnt)%cp => p_ttable(i_tim, i_cnt)%cp + DEALLOCATE(p_ttable(i_timplus, i_cnt)%cp) + END DO + + DO i_cnt= i_enum_f_old+1, size(p_ttable(i_tim,:)) + DEALLOCATE(p_ttable(i_tim, i_cnt)%cp) + DEALLOCATE(p_ttable(i_timplus, i_cnt)%cp) + END DO + + DEALLOCATE(p_ttable) + + ALLOCATE(p_ttable(GRID_timesteps, i_enum_f), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + DO i_cnt=1, i_enum_f_old + p_ttable(i_tim, i_cnt)%cp => p_ttable_tmp(i_cnt)%cp + END DO + + DEALLOCATE(p_ttable_tmp) + + DO i_cnt=i_enum_f_old+1, i_enum_f + ALLOCATE(p_ce, stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + p_ce%i_MPperTri = 3 + p_ce%i_refinelvl = 1 + p_ce%r_mass = 0. + p_ce%r_area = 0. + p_ce%l_massassigned = .FALSE. + p_ce%l_searchtri = .FALSE. + p_ce%l_refine = .FALSE. + p_ttable(i_tim, i_cnt)%cp => p_ce + END DO + + DO i_cnt=1, i_enum_f + ALLOCATE(p_ce, stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + p_ce%i_MPperTri = 3 + p_ce%i_refinelvl = 1 + p_ce%r_mass = 0. + p_ce%r_area = 0. + p_ce%l_massassigned = .FALSE. + p_ce%l_searchtri = .FALSE. + p_ce%l_refine = .FALSE. + p_ttable(i_timplus, i_cnt)%cp => p_ce + END DO + + ELSE ! no array size adjustment necessary, reset i_timplus array to zero + + DO i_cnt=1, i_enum_f + p_ttable(i_timplus, i_cnt)%cp%i_MPperTri = 3 + p_ttable(i_timplus, i_cnt)%cp%i_refinelvl = 1 + p_ttable(i_timplus, i_cnt)%cp%r_mass = 0. + p_ttable(i_timplus, i_cnt)%cp%r_area = 0. + p_ttable(i_timplus, i_cnt)%cp%l_massassigned = .FALSE. + p_ttable(i_timplus, i_cnt)%cp%l_searchtri = .FALSE. + p_ttable(i_timplus, i_cnt)%cp%l_refine = .FALSE. + END DO + + END IF + +!---------- + + +!---------- calculate upstream coordinates of the new mesh + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- + + +!---------- collect necessary infos of the new mesh to assign the later generated mass points to the tetrahedra in the new mesh + + CALL grid_getinfo(p_mesh(i_timeplus), l_finelevel=.TRUE., l_relative=.TRUE., i_elementnodes= i_enodes) + CALL grid_getinfo(p_mesh(i_timeplus), l_finelevel=.TRUE., l_relative=.TRUE., i_elementedges= i_elmtedges) + CALL grid_getinfo(p_mesh(i_timeplus), l_finelevel=.TRUE., l_relative=.TRUE., i_edgenodes= i_gnodes) + CALL grid_getinfo(p_mesh(i_timeplus), l_finelevel=.TRUE., l_relative=.TRUE., i_elementneighbors= i_eneighbours) + + +!---------- + + +!----------- calculate area of upstreamed elements (trisngles) to control assignment of mass to the new mesh later + + DO i_cnt= 1, i_enum_f + r_elmtarea_up(i_cnt) = calc_triangarea(r_upstr(:, i_enodes(1, i_cnt)), r_upstr(:, i_enodes(2, i_cnt)),& + r_upstr(:, i_enodes(3, i_cnt))) + END DO + +!---------- + + +!---------- collect necessary infos of the old mesh to generate mass packets + + CALL grid_getinfo(p_mesh(i_time), r_nodecoordinates = r_en_coor_old) + CALL grid_getinfo(p_mesh(i_time), l_finelevel=.TRUE., l_relative=.TRUE., i_elementnodes= i_enodes_old) + CALL grid_getinfo(p_mesh(i_time), l_finelevel=.TRUE., i_elementlevel= i_elmtlevel) + +!---------- + + +!---------- determine concentration max/min to compute refinement level of triangle later +!---------- (only non zero min/max since there are only mass packets for triangles with nonzero mass) + + r_elmtconc_max = 0. + + !------ fill triangle concentration table + DO i_triangle_cnt= 1, i_enum_f_old + r_elmtmass = SUM(p_ttable(i_tim, i_triangle_cnt)%cp%r_mass) + IF (r_elmtmass > 0.) THEN + r_elmtconc(i_triangle_cnt) = r_elmtmass / p_ttable(i_tim, i_triangle_cnt)%cp%r_area ! r_area > 0 for all triangles + r_elmtconc_min = r_elmtconc(i_triangle_cnt) !choose any non-zero start for minimum search + ELSE + r_elmtconc(i_triangle_cnt) = 0. + END IF + END DO + + !------ get the max/min + DO i_cnt=1,i_enum_f_old + IF (r_elmtconc(i_cnt) > 0.) THEN + IF (r_elmtconc(i_cnt) < r_elmtconc_min) THEN + r_elmtconc_min = r_elmtconc(i_cnt) + END IF + IF (r_elmtconc(i_cnt) > r_elmtconc_max) THEN + r_elmtconc_max = r_elmtconc(i_cnt) + END IF + END IF + END DO + +!---------- + +!---------- initialize all triangles with mass to be searched (a priori refinement level determination) + + i_enum_mass = 0 + + DO i_triangle_cnt= 1, i_enum_f_old + IF (p_ttable(i_tim, i_triangle_cnt)%cp%l_massassigned) THEN + i_enum_mass = i_enum_mass + 1 + p_ttable(i_tim, i_triangle_cnt)%cp%l_searchtri = .TRUE. + + r_relconc = (r_elmtconc(i_triangle_cnt) - r_elmtconc_min + r_eps) / & ! beware of zero-valued terms --> r_eps + (r_elmtconc_max - r_elmtconc_min + r_eps) + r_relreflvl = (REAL((i_elmtlevel(i_triangle_cnt) - i_clvlbnd),GRID_SR) + r_eps) / & + (REAL((i_rlvlbnd - i_clvlbnd),GRID_SR) + r_eps) + + p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl = CEILING(r_relconc * r_relreflvl * REAL(MAX_REFLVL,GRID_SR)) ! - i_reflvl_incr)) + + IF (p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl > MAX_REFLVL) THEN + p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl = MAX_REFLVL + ELSE + IF (p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl < 7) THEN + p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl = 7 + END IF + END IF + + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri = p_MPCtable(p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl)%i_cnum + ELSE + p_ttable(i_tim, i_triangle_cnt)%cp%l_searchtri = .FALSE. + p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl = 1 + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri = 3 + END IF + + ALLOCATE(i_MPidx_tmp(p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + i_MPidx_tmp = 0 + p_ttable(i_tim,i_triangle_cnt)%cp%i_MPindex => i_MPidx_tmp + NULLIFY(i_MPidx_tmp) + + END DO + +!----------- + + +!----------- initialize Mass Point table + + i_MPnum = 0 + + !------ determine total number of Mass points + DO i_triangle_cnt= 1, i_enum_f_old + IF (p_ttable(i_tim, i_triangle_cnt)%cp%l_massassigned) THEN + i_MPnum = i_MPnum + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri + END IF + END DO + !------ + + !------ Allocate and initialize new mass point table + ALLOCATE(p_MPtable(i_MPnum), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + DO i_cnt = 1, i_MPnum + ALLOCATE(p_MP, stat=i_alct) + IF (i_alct/=0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + p_MP%i_MPinTri = 0 + p_MP%i_MPbyTri = 0 + p_MP%r_mass = 0. + p_MP%r_area = 0. + p_MP%r_coord = 0. + p_MP%l_searchMP = .FALSE. + p_MP%l_assignmass = .FALSE. + p_MPtable(i_cnt)%MP => p_MP + NULLIFY(p_MP) + END DO + !------ + +!---------- + + +!---------- start iterating loop here-------------------- + + i_loopnum = 0 + i_savedMP = 0 + i_totalMP = 0 + + iterating_loop:DO + i_loopnum = i_loopnum + 1 + + !------ create mass point table from triangle table + + !------ determine total number of Mass packets + i_MPnum = 0 + + DO i_triangle_cnt= 1, i_enum_f_old + IF (p_ttable(i_tim, i_triangle_cnt)%cp%l_massassigned) THEN + i_MPnum = i_MPnum + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri + END IF + END DO + !------ + + !------ Create new mass points which still have to be searched (save old already found ones, if existent) + !------ temporary array is not nice, but necessary here, no dynamic memory allocation on p_MPtable in other module possible + ALLOCATE(p_MPtable_tmp(i_MPnum), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + CALL createMPs(p_MPtable,p_MPtable_tmp,i_MPnum, i_tim, r_en_coor_old, i_nnum, i_enodes_old, i_enum_f_old) + + i_siz = size(p_MPtable) + DO i_cnt=1,i_siz + DEALLOCATE(p_MPtable(i_cnt)%MP) + END DO + DEALLOCATE(p_MPtable) + ALLOCATE(p_MPtable(i_MPnum), stat=i_alct) + IF (i_alct/=0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + + DO i_cnt = 1, i_MPnum + p_MPtable(i_cnt)%MP => p_MPtable_tmp(i_cnt)%MP + END DO + + i_siz = size(p_MPtable_tmp) + DO i_cnt = i_MPnum+1, i_siz + DEALLOCATE(p_MPtable_tmp(i_cnt)%MP) + END DO + DEALLOCATE(p_MPtable_tmp) + !------ + + !------ + + + !------ Now we have the coordinates of the barycenter and the mass of the mass packetsts. Lets look, in which 'new mesh' triangle they lie + !------ find triangle of the upstreamed mesh in which each mass packet lies + + masspacket_loop: DO i_cnt=1, i_MPnum + + IF (p_MPtable(i_cnt)%MP%l_searchMP) THEN ! if the position of MP is already known, why search again? + i_totalMP = i_totalMP + 1 + CALL searchMP(p_MPtable, i_MPnum, i_cnt, i_enum_f, i_gnum, & ! this subroutine is very time consuming! + i_nnum, i_gnodes, i_enodes, i_elmtedges, i_eneighbours, r_upstr) + END IF + + END DO masspacket_loop + + !------ + + + !------------ What about mass packets lying outside the mesh? masses will NOT be assigned to any nodes + + + !------ generate area stats: How much area does the triangles of the new get of the old mesh; for a posteriori adaption control mechanism + + r_totalarea(:) = 0. + i_mps_in_tri(:) = 0 + + DO i_cnt=1, i_MPnum + IF (p_MPtable(i_cnt)%MP%l_assignmass) THEN + i_mpInTri = p_MPtable(i_cnt)%MP%i_MPinTri + r_totalarea(i_mpInTri) = r_totalarea(i_mpInTri) + p_MPtable(i_cnt)%MP%r_area + i_mps_in_tri(i_mpInTri) = i_mps_in_tri(i_mpInTri) + 1 + END IF + END DO + + !------- + + + !------ generate stats how many tetras in the new mesh will get mass assigned + + i_massassigned = 0 + + DO i_cnt=1,i_enum_f + IF (i_mps_in_tri(i_cnt) > 0) THEN + i_massassigned = i_massassigned +1 + END IF + END DO + + IF (i_massassigned == 0) THEN + CALL grid_error(c_error='[SLM_interpolation] No mass to assign.') + END IF + + !------ + + + !------- calculate ratio of assigned area w.r.t. upstream area of triangle; get min, max and mean value + + r_arearatio_max = 1.0 + r_arearatio_min = 1.0 + r_arearatio_mean = 1.0 + j_cnt = 0 + + DO i_cnt=1, i_enum_f + IF (r_totalarea(i_cnt) > 0. .AND. r_elmtarea_up(i_cnt) > 0.) THEN + r_arearatio(i_cnt) = r_totalarea(i_cnt) / r_elmtarea_up(i_cnt) + IF (r_arearatio(i_cnt) > r_arearatio_max) THEN + r_arearatio_max = r_arearatio(i_cnt) + END IF + IF (r_arearatio(i_cnt) < r_arearatio_min) THEN + r_arearatio_min = r_arearatio(i_cnt) + END IF + j_cnt = j_cnt +1 + r_arearatio_mean = r_arearatio_mean + r_arearatio(i_cnt) + END IF + END DO + + r_arearatio_mean = r_arearatio_mean / REAL(j_cnt,GRID_SR) !without zero-valued tetras + + !------- + + + !------- check the volume condition and refine in case of "area overload" + + i_areaoverload = 0 + + mp_loop: DO i_cnt=1, i_MPnum + i_mpInTri = p_MPtable(i_cnt)%MP%i_MPinTri + + !------ + IF ((.NOT. p_MPtable(i_cnt)%MP%l_assignmass) .OR. & + (i_MPinTri == 0) .OR. & + (p_MPtable(i_cnt)%MP%r_mass == 0.)) THEN + + CYCLE mp_loop + END IF + !------ + + !------ if the total volume of mass packets landed in the upstreamed triangle is greater than r_gamma*area(upstreamed triangle), refine! + IF (r_gamma < r_arearatio(i_MPinTri)) THEN + + !------ dont assign mass of this tetra to the nodes of the new mesh; refine first + p_ttable(i_tim, p_MPtable(i_cnt)%MP%i_MPbyTri)%cp%l_refine = .TRUE. + + !------ for the stats: note the number of tetra in new mesh with too much volume assigned + IF (i_mps_in_tri(i_MPinTri) > 0) THEN + i_areaoverload = i_areaoverload + 1 + i_mps_in_tri(i_MPinTri) = 0 + END IF + + END IF + !------ + + END DO mp_loop + + !---------- + + !---------- leave refinement loop if MAX_LOOPS is arrived ! or no area overload is determined + + IF ((i_loopnum == MAX_LOOPS) ) THEN !.OR. (i_areaoverload == 0) + EXIT + ELSE + !------ rise refinement_lvl and mark triangles for re-search + DO i_cnt= 1, i_enum_f_old + + IF ((p_ttable(i_tim, i_cnt)%cp%l_refine) .AND. (p_ttable(i_tim, i_cnt)%cp%i_refinelvl < MAX_REFLVL)) THEN + + !------ all MPs by one triangle must be recalculated, reset all MPs of the concerned triangle + DO j_cnt=1, p_ttable(i_tim, i_cnt)%cp%i_MPperTri + i_MPidx = p_ttable(i_tim, i_cnt)%cp%i_MPindex(j_cnt) + p_MPtable(i_MPidx)%MP%l_assignmass = .FALSE. + END DO + !------ + + !------ set new inner refinement level of triangle + p_ttable(i_tim, i_cnt)%cp%i_refinelvl = p_ttable(i_tim, i_cnt)%cp%i_refinelvl + i_reflvl_incr + IF (p_ttable(i_tim, i_cnt)%cp%i_refinelvl > MAX_REFLVL) p_ttable(i_tim, i_cnt)%cp%i_refinelvl = MAX_REFLVL + p_ttable(i_tim, i_cnt)%cp%i_MPperTri = p_MPCtable(p_ttable(i_tim, i_cnt)%cp%i_refinelvl)%i_cnum + !------ + + !------ prolongue the dynamically administered Mass packet index array + DEALLOCATE(p_ttable(i_tim, i_cnt)%cp%i_MPindex) + ALLOCATE(i_MPidx_tmp(p_ttable(i_tim, i_cnt)%cp%i_MPperTri), stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolate] Allocation error.') + i_MPidx_tmp = 0 + p_ttable(i_tim, i_cnt)%cp%i_MPindex => i_MPidx_tmp + NULLIFY(i_MPidx_tmp) + !------ + + !------ set logical values for re-search + p_ttable(i_tim, i_cnt)%cp%l_refine = .FALSE. + p_ttable(i_tim, i_cnt)%cp%l_searchtri = .TRUE. + !------ + + ELSE ! triangle not to be refined or already on maximum refinement level + p_ttable(i_tim, i_cnt)%cp%l_searchtri = .FALSE. + END IF + + END DO + !------ + + END IF + + !---------- + + + END DO iterating_loop + +!---------- end iterating loop here-------------------- + + +!---------- assign mass of the mass packets to the nodes of the triangle in which the mass packet landed; save mass and volume for next step + + mass_assignment_mp_loop: DO i_cnt=1, i_MPnum + + IF (.NOT. p_MPtable(i_cnt)%MP%l_assignmass .OR. & + p_MPtable(i_cnt)%MP%i_MPinTri == 0 .OR. & + p_MPtable(i_cnt)%MP%r_mass == 0.) THEN + + CYCLE mass_assignment_mp_loop + + END IF + + r_mass_tmp = 0 + i_mpInTri = p_MPtable(i_cnt)%MP%i_MPinTri + + DO i_node_cnt=1, GRID_elementnodes + r_en_coor(:,i_node_cnt) = r_upstr(:,i_enodes(i_node_cnt, i_mpInTri)) + END DO + + r_mass_tmp = assign_mass(r_en_coor, p_MPtable(i_cnt)%MP%r_coord, p_MPtable(i_cnt)%MP%r_mass) + + r_nmass(i_enodes(1,i_mpInTri)) = r_nmass(i_enodes(1,i_mpInTri)) + r_mass_tmp(1) + r_nmass(i_enodes(2,i_mpInTri)) = r_nmass(i_enodes(2,i_mpInTri)) + r_mass_tmp(2) + r_nmass(i_enodes(3,i_mpInTri)) = r_nmass(i_enodes(3,i_mpInTri)) + r_mass_tmp(3) + + p_ttable(i_timplus,i_mpInTri)%cp%r_mass = p_ttable(i_timplus,i_mpInTri)%cp%r_mass + r_mass_tmp + p_ttable(i_timplus,i_mpInTri)%cp%l_massassigned = .TRUE. + p_ttable(i_timplus,i_mpInTri)%cp%l_searchtri = .TRUE. + + END DO mass_assignment_mp_loop + +!---------- + + +!---------- calculate area of triangles of the new mesh to assign to the mass packets + + DO i_cnt= 1, i_enum_f + IF (p_ttable(i_timplus,i_mpInTri)%cp%l_massassigned) THEN + p_ttable(i_timplus, i_cnt)%cp%r_area = & + calc_triangarea(r_coord(:, i_enodes(1, i_cnt)), r_coord(:, i_enodes(2, i_cnt)), & + r_coord(:, i_enodes(3, i_cnt))) + END IF + END DO + +!---------- + + +!---------- write assignment stats + + write(GRID_parameters%ioout, 1000) + write(GRID_parameters%ioout, 1400) i_enum_f + write(GRID_parameters%ioout, 1401) i_massassigned + write(GRID_parameters%ioout, 1402) i_areaoverload + write(GRID_parameters%ioout, 1403) r_arearatio_max, r_arearatio_min, r_arearatio_mean + write(GRID_parameters%ioout, 1404) i_totalMP - i_savedMP, i_loopnum + +!---------- + + +!---------- generate and write mass statistics + + r_mass_before = 0. + r_mass_outside = 0. + r_mass_inside = 0. + + DO i_cnt=1, i_enum_f_old + r_mass_before = r_mass_before + SUM(p_ttable(i_tim, i_cnt)%cp%r_mass) + END DO + + DO i_cnt= 1, i_MPnum + IF (p_MPtable(i_cnt)%MP%i_MPinTri == 0) THEN + r_mass_outside = r_mass_outside + p_MPtable(i_cnt)%MP%r_mass + END IF + END DO + + DO i_cnt=1,i_enum_f + r_mass_inside = r_mass_inside + SUM(p_ttable(i_timplus, i_cnt)%cp%r_mass) + END DO + + write(GRID_parameters%ioout, 1000) + write(GRID_parameters%ioout, 1001) r_mass_before + write(GRID_parameters%ioout, 1002) r_mass_inside + write(GRID_parameters%ioout, 1003) r_mass_outside + write(GRID_parameters%ioout, 1004) r_mass_inside+r_mass_outside + +!---------- + + +!---------- calculate the "influenced" area ( grid_nodearea() ) of each node and, by knowing the summarized mass, the concentration at the upstream node of the mesh + + CALL grid_nodearea(p_mesh(i_timeplus), i_nnum, r_narea) + + r_rside = r_nmass / r_narea + +!---------- + + +!---------- generate and write concentration stats + + write(GRID_parameters%ioout, 1000) + write(GRID_parameters%ioout, 1300) MAXVAL(r_rside), MINVAL(r_rside) + write(GRID_parameters%ioout, 1000) + +!---------- + + +!---------- this is it! deallocate all temporal variables + + DEALLOCATE(i_elmtlevel) + DEALLOCATE(i_maxlvl) + DEALLOCATE(i_enodes_old) + DEALLOCATE(r_en_coor_old) + DEALLOCATE(r_elmtconc) + + DEALLOCATE(r_upstr) + DEALLOCATE(r_elmtarea_up) + DEALLOCATE(r_totalarea) + DEALLOCATE(r_arearatio) + DEALLOCATE(i_mps_in_tri) + DEALLOCATE(i_gnodes) + DEALLOCATE(i_enodes) + DEALLOCATE(i_elmtedges) + DEALLOCATE(i_eneighbours) + + DO i_cnt=1, i_enum_f_old + DEALLOCATE(p_ttable(i_tim, i_cnt)%cp%i_MPindex) + END DO + + DO i_cnt=1, i_MPnum + DEALLOCATE(p_MPtable(i_cnt)%MP) + END DO + DEALLOCATE(p_MPtable) + +!--------- + + + RETURN + + 1000 FORMAT(1x,'***** ***** ***** ***** ***** ***** ***** ***** ***** *****') + 1001 FORMAT(1x,'***** Total mass in last step:',11x,e12.4,' *****') + 1002 FORMAT(1x,'***** Total mass in new mesh :',11x,e12.4,' *****') + 1003 FORMAT(1x,'***** Total mass outside new mesh (lost):',e12.4,' *****') + 1004 FORMAT(1x,'***** Total mass in this step:',11x,e12.4,' *****') + + 1100 FORMAT(1x,'----- Warning, windless field! more than one barycenter in: ',i12,' -----') + 1200 FORMAT(1x,'----- Warning, mass assignment critical in: ',i12,' -----') + 1300 FORMAT(1x,'***** Max conc.:',1x,e12.4,' Min conc.:',1x,e12.4,' *****') + 1400 FORMAT(1x,'***** Total triang in new mesh:',10x,i12,' *****') + 1401 FORMAT(1x,'***** --- with mass:',21x,i12,' *****') + 1402 FORMAT(1x,'***** --- with too much area assigned:',3x,i12,' *****') + 1403 FORMAT(1x,'***** Max vol.:',1x,e10.4,' Min vol.:',1x,e10.4,' Mean vol.:',1x,e10.4,' *****') + 1404 FORMAT(1x,'***** No. of mass points:',1x,i9,' in loops ',i8,' *****') + + + + END SUBROUTINE slm_ainterpolate + +!***************************************************************** + + SUBROUTINE slm_interpolinit(p_mesh) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + + + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enodes + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_nval + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_elmtarea + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_nmass_tmp + + TYPE (conservation_entry), POINTER :: p_ce1, p_ce2 + + INTEGER :: i_alct, i_cnt, i_enode_cnt, i_MP_cnt, i_ecnt + INTEGER :: i_enum_f_old, i_nnum_old, i_tim, i_timplus + +!---------- preinitialize + + i_enum_f_old = p_mesh(i_time)%i_enumfine + i_nnum_old = p_mesh(i_time)%i_nnumber + i_tim = p_mesh(i_time)%i_timetag + i_timplus = p_mesh(i_timeplus)%i_timetag + + +!---------- allocate work array +!-------------- 'old mesh' arrays + + ALLOCATE(i_enodes(GRID_elementnodes, i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolinit] Allocation error.') + + ALLOCATE(r_nval(1,i_nnum_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolinit] Allocation error.') + + ALLOCATE(r_elmtarea(i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolinit] Allocation error.') + +!--------------- allocate the table, which saves the mass to be conserved throughout all computation steps + ALLOCATE(p_ttable(GRID_timesteps, i_enum_f_old), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolinit] Allocation error.') + + +!--------------- preinitialize + i_enodes = 0. + r_nval = 0. + r_elmtarea = 0. + +!---------- initialize conservation table with the values to be conserved + CALL grid_getinfo(p_mesh(i_time), l_finelevel=.TRUE., l_relative=.TRUE., i_elementnodes = i_enodes) + CALL grid_getinfo(p_mesh(i_time), i_arraypoint= (/ GRID_tracer /), r_nodevalues = r_nval) + CALL calc_alltriarea(p_mesh(i_time), i_enum_f_old, r_elmtarea) + +!---------- initialize coefficient table + CALL generate_MP_coeff(p_mesh) + +!---------- initialize p_ttable with values where mass is present + elmt_loop: DO i_ecnt= 1, i_enum_f_old + ALLOCATE (p_ce1, p_ce2, stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:slm_interpolinit] Allocation error.') + + IF(r_nval(1,i_enodes(1,i_ecnt))/=0. .OR. r_nval(1,i_enodes(2,i_ecnt))/=0. .OR. & + r_nval(1,i_enodes(3,i_ecnt))/=0.) THEN + !---- create new triangle entry with mass + p_ce1%i_MPperTri = 3 + p_ce1%l_massassigned = .TRUE. + p_ce1%l_searchtri = .TRUE. + p_ce1%l_refine = .FALSE. + p_ce1%i_refinelvl = 1 + p_ce1%r_area = r_elmtarea(i_ecnt) + DO i_enode_cnt= 1, GRID_elementnodes + p_ce1%r_mass(i_enode_cnt) = r_nval(1,i_enodes(i_enode_cnt, i_ecnt)) * (1./3.*p_ce1%r_area) + END DO + p_ttable(i_tim, i_ecnt)%cp => p_ce1 + NULLIFY(p_ce1) + ELSE + p_ce1%i_MPperTri = 3 + p_ce1%l_massassigned = .FALSE. + p_ce1%l_searchtri = .FALSE. + p_ce1%l_refine = .FALSE. + p_ce1%i_refinelvl = 1 + p_ce1%r_area = 0. + p_ce1%r_mass = 0. + p_ttable(i_tim, i_ecnt)%cp => p_ce1 + NULLIFY(p_ce1) + END IF + + p_ce2%i_MPperTri = 3 + p_ce2%l_massassigned = .FALSE. + p_ce2%l_searchtri = .FALSE. + p_ce2%l_refine = .FALSE. + p_ce2%i_refinelvl = 1 + p_ce2%r_area = 0. + p_ce2%r_mass = 0. + p_ttable(i_timplus, i_ecnt)%cp => p_ce2 + NULLIFY(p_ce2) + END DO elmt_loop + +!--------- deallocation + + DEALLOCATE(r_nval) + DEALLOCATE(i_enodes) + DEALLOCATE(r_elmtarea) + + RETURN + + END SUBROUTINE slm_interpolinit + +!***************************************************************** + + SUBROUTINE slm_interpolquit + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_cnt, i_siz + + + CALL remove_MP_coeff + + i_siz = size(p_ttable(1,:)) + DO i_cnt= 1, i_siz + DEALLOCATE(p_ttable(1,i_cnt)%cp) + DEALLOCATE(p_ttable(2,i_cnt)%cp) + END DO + + + DEALLOCATE(p_ttable) + + RETURN + + END SUBROUTINE slm_interpolquit + +!***************************************************************** + + SUBROUTINE searchMP(p_MPtable, i_MPnum, i_MPcnt, i_enum_f, i_gnum, & + i_nnum, i_gnodes, i_enodes, i_elmtedges, i_eneighbours, r_upstr) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (MP_entry_ptr), DIMENSION(i_MPnum) :: p_MPtable + INTEGER :: i_MPnum + INTEGER :: i_MPcnt + + + INTEGER, DIMENSION(GRID_edgenodes, i_gnum) :: i_gnodes + INTEGER, DIMENSION(GRID_elementnodes, i_enum_f) :: i_enodes + INTEGER, DIMENSION(GRID_elementedges, i_enum_f) :: i_elmtedges + INTEGER, DIMENSION(3, i_enum_f) :: i_eneighbours + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, i_nnum) :: r_upstr + + + + INTEGER :: i_enum_f, i_gnum, i_nnum, i_enum_f_old, i_enum + + INTEGER :: i_cnt, j_cnt, i_node_cnt, i_gcnt, i_elmt_cnt, i_loopcnt + INTEGER :: i_elmtindex + INTEGER :: i_gnode_loc, i_elmtnode_loc, i_elmtedge_loc + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ref + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, GRID_edgenodes) :: r_gn_coor + + LOGICAL :: l_elmtfound, l_sameside, l_circled + + + + +! i_elmtindex = 1 + i_loopcnt=0 + + !------ set starting triangle + IF (p_MPtable(i_MPcnt)%MP%i_MPbyTri < i_enum_f) THEN + i_elmtindex = p_MPtable(i_MPcnt)%MP%i_MPbyTri + ELSE + i_elmtindex = i_enum_f + END IF + !------ + + + + !------ in which triangle of the new upstreamed mesh does the mass packet of the old mesh lie? + search_loop: DO + l_elmtfound = .TRUE. + i_loopcnt = i_loopcnt +1 + !------ check whether mass packet is in triangle + edge_loop: DO i_gcnt=1, GRID_elementedges + i_elmtedge_loc = i_elmtedges(i_gcnt,i_elmtindex) + + !------ get the upstream coords for the two edge nodes + node_loop: DO i_node_cnt=1, GRID_edgenodes + i_gnode_loc = i_gnodes(i_node_cnt,i_elmtedge_loc) + r_gn_coor(:,i_node_cnt) = r_upstr(:,i_gnode_loc) + END DO node_loop + !------ + + !------ each edge has two nodes, get the upstrean coordinates of the third trianglenode (called r_ref) + trianglenode_loop: DO i_node_cnt=1,GRID_elementnodes + i_elmtnode_loc = i_enodes(i_node_cnt,i_elmtindex) + IF (i_gnodes(1,i_elmtedge_loc) /= i_elmtnode_loc) THEN + IF (i_gnodes(2,i_elmtedge_loc) /= i_elmtnode_loc) THEN + r_ref = r_upstr(:,i_elmtnode_loc) + EXIT + END IF + END IF + END DO trianglenode_loop + !------ + + !------ is the barycenter of the mass packet on the same side of the triangle edge as the reference point? + l_sameside= sameside_2d(r_gn_coor(:,1), r_gn_coor(:,2), r_ref, p_MPtable(i_MPcnt)%MP%r_coord) + + !------ if not, mass packet is not in the currently observed triangle, get triangle next to the current triangle via edge which resulted "packet outside" + IF (.NOT. l_sameside) THEN + i_elmtindex = i_eneighbours(i_gcnt, i_elmtindex) + l_elmtfound = .FALSE. + END IF + !------ + + END DO edge_loop + !------ + + !------ neighbour triangle does not exist, mass packet outside the mesh, mass lost; check next mass packet + IF (i_elmtindex==0) THEN + p_MPtable(i_MPcnt)%MP%i_MPinTri = 0 + p_MPtable(i_MPcnt)%MP%l_searchMP = .FALSE. + p_MPtable(i_MPcnt)%MP%l_assignmass = .FALSE. + EXIT + END IF + !------ + + !------ triangle found! remember triangle for assigning the mass packet's mass to the triangle nodes later, check next mass packet + IF (l_elmtfound) THEN + p_MPtable(i_MPcnt)%MP%i_MPinTri = i_elmtindex + p_MPtable(i_MPcnt)%MP%l_searchMP = .FALSE. + p_MPtable(i_MPcnt)%MP%l_assignmass = .TRUE. + EXIT + END IF + !------ + + !------ triangle not found: stay in search_loop and search on with next triangle (no EXIT command) + END DO search_loop + + RETURN + + END SUBROUTINE searchMP + +!***************************************************************** + + FUNCTION assign_mass(r_en_coor, r_mp_coor, r_mp_mass) RESULT(r_nmass_tmp) + + +!---------- compute partial mass of mass packet which will be assigned to the nodes of the triangle +!---------- the mass packet landed in. + + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, GRID_elementnodes), INTENT(in) :: r_en_coor + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_mp_coor + REAL (KIND = GRID_SR), INTENT(in) :: r_mp_mass + + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_nmass_tmp + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, GRID_elementnodes-1) :: r_A + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_b + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_x, r_y + REAL (KIND = GRID_SR) :: r_det, r_det1, r_det2 + + INTEGER :: i_node_cnt + + +!--------- assign coordinates to local variables + + DO i_node_cnt=1, GRID_elementnodes + r_x(i_node_cnt) = r_en_coor(1,i_node_cnt) + r_y(i_node_cnt) = r_en_coor(2,i_node_cnt) + END DO + +!--------- normalize triangle and mass packet coordinates + r_A(1,1) = r_x(2) - r_x(1) + r_A(1,2) = r_x(3) - r_x(1) + r_A(2,1) = r_y(2) - r_y(1) + r_A(2,2) = r_y(3) - r_y(1) + + r_b(1) = r_mp_coor(1) - r_x(1) + r_b(2) = r_mp_coor(2) - r_y(1) + +!--------- solve linear equation system (dim2x2)(dim2)=(dim2) + r_det = r_A(1,1)*r_A(2,2) - r_A(2,1)*r_A(1,2) + IF (r_det == 0.) CALL grid_error(c_error='SLM: assign_mass(): Determinant zero. Triangle is degenerated.') + + r_det1 = r_A(1,1)*r_b(2) - r_A(2,1)*r_b(1) + r_det2 = r_b(1)*r_A(2,2) - r_b(2)*r_A(1,2) + + r_nmass_tmp(3) = r_det1 / r_det *r_mp_mass + r_nmass_tmp(2) = r_det2 / r_det *r_mp_mass + r_nmass_tmp(1) = r_mp_mass - r_nmass_tmp(3) - r_nmass_tmp(2) + + RETURN + + END FUNCTION assign_mass + +!***************************************************************************** + + FUNCTION sameside_2d(r_vtx_a, r_vtx_b, r_vtx_ref, r_vtx_check) RESULT (l_same) + + +!---------- Check if a given 2d-point r_vtx_check is on the same side of a line (defined by two points r_vtx_a, r_vtx_b) +!---------- as a known reference point r_vtx_ref (the third point of the triangle + + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_vtx_a, r_vtx_b, r_vtx_ref, r_vtx_check + LOGICAL :: l_same + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b, r_tmp1, r_tmp2, r_tmp3 + REAL (KIND = GRID_SR) :: r_sign, r_dot1, r_dot2 + + +!---------- initialize + + l_same = .FALSE. + + +!---------- r_tmp1 is the direction vector which one edge of the triangle has. It cuts the plane in two halfs + + r_tmp1 = r_vtx_b - r_vtx_a + +!---------- r_tmp2 and r_tmp3 are the vectors to the reference point and to the point to be checked respectively + r_tmp2 = 1.e+6*(r_vtx_check - r_vtx_a) + r_tmp3 = 1.e+6*(r_vtx_ref - r_vtx_a) + +!---------- if the dot product (projection onto the normal of r_tmp1) has the same sign for both r_tmp2 and r_tmp3 +!---------- then the points are on the same side + r_dot1 = (r_tmp1(1)*r_tmp2(2) - r_tmp1(2)*r_tmp2(1)) + r_dot2 = (r_tmp1(1)*r_tmp3(2) - r_tmp1(2)*r_tmp3(1)) + + r_sign = (r_dot1*r_dot2) + + IF (r_sign >= 0.) l_same = .TRUE. + + RETURN + + END FUNCTION sameside_2d + +!***************************************************************** + + FUNCTION calc_triangarea(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b, r_tmp + REAL (KIND = GRID_SR) :: r_area + + + +!---------- calculate triangle vectors + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + + +!---------- calculate area of a triangle (point c in the origin) + + r_area = 0.5 * ABS( r_b(2)*r_a(1) - r_a(2)*r_b(1) ) + + RETURN + + END FUNCTION calc_triangarea + +!***************************************************************** + + SUBROUTINE generate_MP_coeff(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_ghand + + INTEGER :: i_reflvl_max ! maximum refinement level + INTEGER :: i_celltot ! total number of mass packets in triangle; + ! reflvl 1: 3MPs, 2: 6MPs, 3: 10 MPs, 4: 15MPs, etc. + + INTEGER :: i_cnt, j_cnt, k_cnt, i_loop ! loop counter + INTEGER :: i_mpcnt ! mass packet counter + INTEGER :: i_cindex ! coefficient index + INTEGER :: i_alct ! allocated flag, error if nonzero + + INTEGER :: i_origin ! local + INTEGER, DIMENSION(GRID_dimension) :: i_prvdir ! local + + REAL (KIND = GRID_SR) :: r_projfac ! projection factor + REAL (KIND = GRID_SR) :: r_fac ! factor + + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_mpc_sum ! checksum; check if the mass coefficients sum up to 1 + + REAL (KIND = GRID_SR) :: r_vol_sum ! checksum; check if the volume coefficient sums up to 1 + + REAL (KIND = GRID_SR) :: r_eps ! epsilon; very small number greater than 0 + + TYPE (MP_coeff), POINTER :: p_MPC_tmp(:) + TYPE (MP_coeff_arr), POINTER :: p_MPCarray_tmp + + +!---------- initializations +! i_reflvl_max = p_ghand(i_timeplus)%i_reflvlbnd - p_ghand(i_timeplus)%i_crslvlbnd + 5 +! IF (i_reflvl_max > 27) THEN + i_reflvl_max = 7 +! END IF + + MAX_REFLVL = i_reflvl_max + + r_eps = 1.E-5 + + +!---------- allocate arrays + ALLOCATE (p_MPCtable(i_reflvl_max), stat = i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:generate_MP_coeff] Allocation error.') + + + i_celltot = 1 + DO i_cnt = 1, i_reflvl_max + i_celltot = i_celltot + (i_cnt+1) + + ALLOCATE (p_MPC_tmp(i_celltot), stat = i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:generate_MP_coeff] Allocation error.') + + ALLOCATE (p_MPCarray_tmp, stat = i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:generate_MP_coeff] Allocation error.') + + p_MPCarray_tmp%mpc => p_MPC_tmp + + p_MPCtable(i_cnt)%i_cnum = i_celltot + p_MPCtable(i_cnt)%p_mpc => p_MPCarray_tmp + + END DO + NULLIFY(p_MPC_tmp) + NULLIFY(p_MPCarray_tmp) +!---------- + + +!---------- set refinement level 1; 3 MPs + DO i_mpcnt= 1, 3 + + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%i_origin = i_mpcnt + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%i_prvdir = i_mpcnt + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%i_celltype = 1 + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%r_area = 1./3. + + DO j_cnt=1,3 + IF (j_cnt == i_mpcnt) THEN + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%r_coeff(j_cnt) = 1. + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%r_mass(j_cnt) = 1. + ELSE + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%r_coeff(j_cnt) = 0. + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%r_mass(j_cnt) = 0. + END IF + END DO + + p_MPCtable(1)%p_mpc%mpc(i_mpcnt)%l_end = .FALSE. + + END DO +!----------- + + +!----------- generate mass packets of higher refinement levels + DO i_cnt = 2, i_reflvl_max + i_mpcnt = 0 + r_projfac = REAL((i_cnt-1),GRID_SR) / REAL(i_cnt,GRID_SR) + + DO j_cnt=1 , p_MPCtable(i_cnt-1)%i_cnum + ! project old mass packet in direction of his origin (only if MP is not generator of new packets (l_end==.TRUE.)); set l_end = .FALSE. + i_mpcnt = i_mpcnt + 1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt) + + + !projection here (area, coeff, mass changes) + + !area proj. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area = r_projfac*r_projfac *& + p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_area + + !projection in direction of the origin + i_origin = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_origin + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_origin) = & + (1.-r_projfac) + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_origin) + DO i_loop = 1, 2 + i_cindex = MODULO((i_origin+i_loop-1),3) + 1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_cindex) = & + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_cindex) + END DO + + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .FALSE. + + IF (p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%l_end) THEN + ! create new mass packets via projecting the old packets which are at the end of the tree + + SELECT CASE(p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype) + CASE(1) ! corner packets are not to be reproduced + CALL grid_error(c_error='[SLM_advanced.mpslm:generate_MP_coeff] This should never happen. L. Mentrup') + + CASE(2) ! edge packets are to be projected versus the origin and additionally one packet to the other edgecorner + i_mpcnt = i_mpcnt +1 + !area + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area = r_projfac*r_projfac *& + p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_area + + !projection in direction of the other edge corner + i_prvdir = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_prvdir(1)) = & + (1.-r_projfac) + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_prvdir(1)) + DO i_loop = 1, 2 + i_cindex = MODULO((i_prvdir(1)+i_loop-1),3)+1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_cindex) = & + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_cindex) + END DO + + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_origin + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_celltype + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + CASE(3) ! area packets are to be projected versus the origin and additionally one or two packet to the other areacorners + i_mpcnt = i_mpcnt +1 + + !projection in direction of the other area corner + i_prvdir = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_prvdir(1)) = & + (1.-r_projfac) + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_prvdir(1)) + DO i_loop = 1, 2 + i_cindex = MODULO((i_prvdir(1)+i_loop-1),3)+1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_cindex) = & + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_cindex) + END DO + + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_origin + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_celltype + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + IF (p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) /= p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(2)) THEN + i_mpcnt = i_mpcnt +1 + + !projection in direction of the other area corner + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_prvdir(2)) = & + (1.-r_projfac) + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_prvdir(2)) + DO i_loop = 1, 2 + i_cindex = MODULO((i_prvdir(2)+i_loop-1),3)+1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(i_cindex) = & + r_projfac* p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%r_coeff(i_cindex) + END DO + + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_origin + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(2) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_prvdir(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = p_MPCtable(i_cnt-1)%p_mpc%mpc(j_cnt)%i_celltype + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + END IF + + END SELECT + END IF + END DO + + + !---------- generate new MPs of refinement level 2; 3 additional MPs + IF (i_cnt == 2) THEN + !new packet nr. 1 + i_mpcnt = i_mpcnt +1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(1) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(2) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(3) = 0. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = 1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + !new packet nr. 2 + i_mpcnt = i_mpcnt +1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(1) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(2) = 0. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(3) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = 1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + !new packet nr. 3 + i_mpcnt = i_mpcnt +1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(1) = 0. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(2) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(3) = 0.5 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + END IF + !----------- + + !---------- generate new MPs of refinement level 3; 1 additional MPs + IF (i_cnt == 3) THEN + !new packet nr. 1 + i_mpcnt = i_mpcnt +1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(1) = 1./3. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(2) = 1./3. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff(3) = 1./3. + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_origin = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(1) = 2 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_prvdir(2) = 1 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype = 3 + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%l_end = .TRUE. + + END IF + !----------- + + + !assign area coefficients + r_fac = REAL(i_cnt,GRID_SR)*REAL(i_cnt,GRID_SR) + DO i_mpcnt=1, p_MPCtable(i_cnt)%i_cnum + SELECT CASE(p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%i_celltype) + CASE(1) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area = 1./3. / r_fac + CASE(2) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area = 1. / r_fac + CASE(3) + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area = 2. / r_fac + END SELECT + END DO + + ! assign mass coefficients; + r_mpc_sum = 0 + DO i_mpcnt=1, p_MPCtable(i_cnt)%i_cnum + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_mass = & + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_coeff * & + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area + r_mpc_sum = r_mpc_sum + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_mass + END DO + + DO i_mpcnt=1, p_MPCtable(i_cnt)%i_cnum + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_mass = p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_mass / r_mpc_sum + END DO + +!----------- check if mass/volume coefficients sum up to 1 + r_mpc_sum = 0 + r_vol_sum = 0 + DO i_mpcnt=1, p_MPCtable(i_cnt)%i_cnum + r_mpc_sum = r_mpc_sum + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_mass + r_vol_sum = r_vol_sum + p_MPCtable(i_cnt)%p_mpc%mpc(i_mpcnt)%r_area + END DO + + IF ((r_mpc_sum(1) < (1.-r_eps)) .OR. (r_mpc_sum(1) > (1.+r_eps))) THEN + CALL grid_error(c_error='[SLM_advanced.mpslm:generate_MP_coeff] Mass packet coefficient r_mass(1) doesnt sum up to 1.') + END IF + IF ((r_mpc_sum(2) < (1.-r_eps)) .OR. (r_mpc_sum(2) > (1.+r_eps))) THEN + CALL grid_error(c_error='[SLM_advanced.mpslm:generate_MP_coeff] Mass packet coefficient r_mass(2) doesnt sum up to 1.') + END IF + IF ((r_mpc_sum(3) < (1.-r_eps)) .OR. (r_mpc_sum(3) > (1.+r_eps))) THEN + CALL grid_error(c_error='[SLM_advanced.mpslm:generate_MP_coeff] Mass packet coefficient r_mass(3) doesnt sum up to 1.') + END IF + IF ((r_vol_sum < (1.-r_eps)) .OR. (r_vol_sum > (1.+r_eps))) THEN + CALL grid_error(c_error='[SLM_advanced.mpslm:generate_MP_coeff] Mass packet coefficient r_area doesnt sum up to 1.') + END IF +!----------- + + END DO + + CALL io_MP_coeff(p_MPCtable) + + RETURN + + END SUBROUTINE generate_MP_coeff + +!***************************************************************** + + SUBROUTINE createMPs(p_MPtable,p_MPtable_tmp,i_MPnum, i_tim, r_coor, i_nnum_old, i_enodes_old, i_enum_f_old) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (MP_entry_ptr), DIMENSION(i_MPnum), INTENT(in) :: p_MPtable + TYPE (MP_entry_ptr), DIMENSION(i_MPnum), INTENT(inout) :: p_MPtable_tmp + INTEGER, INTENT(inout) :: i_MPnum ! Number of mass packets + INTEGER, INTENT(in) :: i_tim + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension, i_nnum_old), INTENT(in) :: r_coor ! coordinates array of triangle nodes (old mesh) + INTEGER, INTENT(in) :: i_nnum_old ! number of nodes in mesh (old mesh) + + INTEGER, DIMENSION(GRID_elementnodes, i_enum_f_old), INTENT(in) :: i_enodes_old ! index array of triangles nodes (old mesh) + INTEGER, INTENT(in) :: i_enum_f_old ! Number of triangles (finite elements e) in this step + INTEGER :: i_treflvl ! refinement level of a triangle + + REAL (KIND = GRID_SR), DIMENSION(GRID_elementnodes) :: r_nmass_tmp ! mass at the nodes of the triangle + REAL (KIND = GRID_SR) :: r_mass_tot, r_mass_in_tri + + INTEGER :: i_MPnum_new + INTEGER :: i_MPidx + INTEGER :: i_cnt, i_triangle_cnt, i_MP_cnt, i_node_cnt, i_dim ! loop counter + INTEGER :: i_alct + + + TYPE (MP_entry), POINTER :: p_MP + + + +!----------- preinitialize + + i_MPnum_new = 0 + + +!----------- allocate memory for new mass packets + DO i_MP_cnt=1, i_MPnum + ALLOCATE(p_MP, stat=i_alct) + IF (i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:create_MPs] Allocation error.') + p_MP%i_MPbyTri = 0 + p_MP%i_MPinTri = 0 + p_MP%r_mass = 0. + p_MP%r_area = 0. + p_MP%r_coord = 0. + p_MP%l_searchMP = .FALSE. + p_MP%l_assignmass = .FALSE. + p_MPtable_tmp(i_MP_cnt)%MP => p_MP + NULLIFY(p_MP) + END DO + + +!----------- if already searched for mass packets, save mass packets which are already found and that can be assigned to the nodes later + DO i_triangle_cnt=1, i_enum_f_old + IF ((.NOT. p_ttable(i_tim, i_triangle_cnt)%cp%l_searchtri) & + .AND. (p_ttable(i_tim, i_triangle_cnt)%cp%i_MPindex(1) /= 0)) THEN + DO i_MP_cnt = 1, p_ttable(i_tim, i_triangle_cnt)%cp%i_MPperTri + i_MPidx = p_ttable(i_tim, i_triangle_cnt)%cp%i_MPindex(i_MP_cnt) + i_MPnum_new = i_MPnum_new + 1 + + p_MPtable_tmp(i_MPnum_new)%MP%i_MPinTri = p_MPtable(i_MPidx)%MP%i_MPinTri + p_MPtable_tmp(i_MPnum_new)%MP%i_MPbyTri = p_MPtable(i_MPidx)%MP%i_MPbyTri + p_MPtable_tmp(i_MPnum_new)%MP%r_mass = p_MPtable(i_MPidx)%MP%r_mass + p_MPtable_tmp(i_MPnum_new)%MP%r_coord = p_MPtable(i_MPidx)%MP%r_coord + p_MPtable_tmp(i_MPnum_new)%MP%r_area = p_MPtable(i_MPidx)%MP%r_area + p_MPtable_tmp(i_MPnum_new)%MP%l_searchMP = p_MPtable(i_MPidx)%MP%l_searchMP + p_MPtable_tmp(i_MPnum_new)%MP%l_assignmass = p_MPtable(i_MPidx)%MP%l_assignmass + + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPindex(i_MP_cnt) = i_MPnum_new + END DO + END IF + END DO + + +!----------- set values for mass packets; + DO i_triangle_cnt= 1, i_enum_f_old + IF (p_ttable(i_tim, i_triangle_cnt)%cp%l_searchtri) THEN + r_nmass_tmp = p_ttable(i_tim, i_triangle_cnt)%cp%r_mass + r_mass_in_tri = SUM(r_nmass_tmp) + i_treflvl = p_ttable(i_tim, i_triangle_cnt)%cp%i_refinelvl + + IF (r_mass_in_tri > 0.) THEN + DO i_MP_cnt = 1, p_MPCtable(i_treflvl)%i_cnum + i_MPnum_new = i_MPnum_new + 1 + p_MPtable_tmp(i_MPnum_new)%MP%i_MPbyTri = i_triangle_cnt +!------------------ stepfct assignment + DO i_node_cnt= 1, GRID_elementnodes + p_MPtable_tmp(i_MPnum_new)%MP%r_coord = p_MPtable_tmp(i_MPnum_new)%MP%r_coord + & + (p_MPCtable(i_treflvl)%p_mpc%mpc(i_MP_cnt)%r_coeff(i_node_cnt)& + *r_coor(:,i_enodes_old(i_node_cnt, i_triangle_cnt))) + END DO + p_MPtable_tmp(i_MPnum_new)%MP%r_mass = & + SUM(p_MPCtable(i_treflvl)%p_mpc%mpc(i_MP_cnt)%r_mass * r_nmass_tmp) +!------------------ + p_MPtable_tmp(i_MPnum_new)%MP%r_area = & + p_MPCtable(i_treflvl)%p_mpc%mpc(i_MP_cnt)%r_area * & + p_ttable(i_tim, i_triangle_cnt)%cp%r_area + p_MPtable_tmp(i_MPnum_new)%MP%l_searchMP = .TRUE. + p_MPtable_tmp(i_MPnum_new)%MP%l_assignmass = .FALSE. + + p_ttable(i_tim, i_triangle_cnt)%cp%i_MPindex(i_MP_cnt) = i_MPnum_new + END DO + END IF + END IF + END DO + + i_MPnum = i_MPnum_new + + RETURN + + END SUBROUTINE createMPs + +!***************************************************************** + + SUBROUTINE remove_MP_coeff + +!---------- local declarations + IMPLICIT NONE + + TYPE(grid_handle), DIMENSION(GRID_timesteps) :: p_ghand + INTEGER :: i_reflvl_max ! maximum refinement level + INTEGER :: i_cnt + +!---------- initializations + i_reflvl_max = size(p_MPCtable) + +!---------- + DO i_cnt = 1, i_reflvl_max + DEALLOCATE(p_MPCtable(i_cnt)%p_mpc%mpc) + DEALLOCATE(p_MPCtable(i_cnt)%p_mpc) + END DO + + DEALLOCATE(p_MPCtable) + + RETURN + + END SUBROUTINE remove_MP_coeff + +!***************************************************************** + + SUBROUTINE io_MP_coeff(p_MPCtable) + +!---------- local declarations + IMPLICIT NONE + + TYPE (MP_coeff_arr_ptr), DIMENSION(MAX_REFLVL) :: p_MPCtable + + INTEGER :: i_reflvl_max ! maximum refinement level + + INTEGER :: i_io1, i_io2, i_fst + INTEGER :: i_cnt, j_cnt, i_tcnt, i_mpcnt, i_filecnt + INTEGER :: i_alct, i_nnum, i_tnum, i_dim + INTEGER :: i_timecounter + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_cox + CHARACTER (len=11) :: c_mfile + CHARACTER (len=32) :: c_matfile + CHARACTER (len=8) :: c_tmp + + REAL (KIND = GRID_SR), DIMENSION(3) :: r_a = (/0.,0.,0./) + REAL (KIND = GRID_SR), DIMENSION(3) :: r_b = (/1.,0.,0./) + REAL (KIND = GRID_SR), DIMENSION(3) :: r_c = (/0.,1.,0./) + + +!---------- initializations + i_reflvl_max = MAX_REFLVL + i_timecounter = 0 + + + DO i_filecnt=1, i_reflvl_max +!---------- file handling (open) + + i_tcnt= i_timecounter + i_timecounter= i_timecounter+1 + write(c_mfile,10101) 'MP_gmv.', i_tcnt + write(c_matfile,10102) 'MP_matlab.', i_tcnt + c_mfile= adjustl(c_mfile) + c_matfile= adjustl(c_matfile) + i_io1= 15 + OPEN(i_io1, file= c_mfile, form= 'formatted', iostat= i_fst) + IF(i_fst /= 0) THEN + RETURN + END IF + + i_io2 = 16 + OPEN(i_io2, file= c_matfile, form= 'formatted', iostat= i_fst) + IF (i_fst/=0) THEN + RETURN + END IF + +!---------- write header + + WRITE(i_io1,1000) + WRITE(i_io1,1001) + WRITE(i_io1,1002) c_mfile + WRITE(i_io1,1003) GRID_parameters%program_name, GRID_parameters%version, GRID_parameters%subversion, & + GRID_parameters%patchversion + WRITE(i_io1,1004) GRID_parameters%author_name, GRID_parameters%author_email + WRITE(i_io1,1005) + +!---------- the nodes + + i_nnum = p_MPCtable(i_filecnt)%i_cnum + WRITE(i_io1,1010) i_nnum+3 + +!---------- extract nodal grid data + + ALLOCATE(r_cox(3, i_nnum+3), stat=i_alct) + IF(i_alct /= 0) CALL grid_error(c_error='[SLM_simple.mpslm:io_MP_coeff] Allocation error.') + + r_cox(:,1) = r_a + r_cox(:,2) = r_b + r_cox(:,3) = r_c + + DO i_mpcnt = 1, i_nnum + r_cox(:,i_mpcnt+3) = p_MPCtable(i_filecnt)%p_mpc%mpc(i_mpcnt)%r_coeff(1)*r_a + & + p_MPCtable(i_filecnt)%p_mpc%mpc(i_mpcnt)%r_coeff(2)*r_b + & + p_MPCtable(i_filecnt)%p_mpc%mpc(i_mpcnt)%r_coeff(3)*r_c + END DO + + DO i_dim=1,GRID_dimension + WRITE(i_io1,1011) (r_cox(i_dim,i_cnt), i_cnt=1,i_nnum+3) + END DO + + DO i_cnt = 1, i_nnum+3 + WRITE(i_io2,1012) r_cox(1, i_cnt), r_cox(2, i_cnt) + END DO + + DEALLOCATE(r_cox) + +!---------- the elements + + i_tnum = 1 + WRITE(i_io1,1020) i_tnum + WRITE(i_io1,1021) + WRITE(i_io1, *) '1 2 3' + + +!---------- close file + + WRITE(i_io1,1100) + CLOSE(i_io1) + + CLOSE(i_io2) + + END DO + + RETURN + + 1000 FORMAT('gmvinput ascii') + 1001 FORMAT('comments') + 1002 FORMAT(' File: ',a48) + 1003 FORMAT(' Written by: ',a15,' Version ',i1,'.',i1,'.',i1) + 1004 FORMAT(' Author: ',a48,' <',a48,'>') + 1005 FORMAT('endcomm') + 1010 FORMAT('nodes ',i8) + 1011 FORMAT(10f15.5) + 1012 FORMAT(3f15.5) + 1020 FORMAT('cells ',i8) + 1021 FORMAT('tri 3') + 1022 FORMAT(10i8) + 1031 FORMAT('cellids') + 1040 FORMAT('variable') + 1041 FORMAT('level 0') + 1043 FORMAT('status 0') + 1042 FORMAT('tracr 1') + 1049 FORMAT('endvars') + 1100 FORMAT('endgmv') + 10101 FORMAT(a7,i4.4) + 10102 FORMAT(a10,i4.4) + + END SUBROUTINE io_MP_coeff + +!***************************************************************** + + SUBROUTINE calc_alltriarea(p_handle, i_len, r_elmtarea) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle) :: p_handle + INTEGER, INTENT(in) :: i_len + REAL (KIND = GRID_SR), DIMENSION(:) :: r_elmtarea + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_xy + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_enods + INTEGER :: i_enum, i_alct, i_nnum, i_cnt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + +!---------- check array sizes + + i_enum= p_handle%i_enumfine + i_nnum= p_handle%i_nnumber + IF(i_len /= i_enum) CALL grid_error(c_error='[calc_alltriarea]: array sizes do not match!') + +!---------- get coordinates for each element + + allocate(r_xy(GRID_dimension,i_nnum), i_enods(GRID_elementnodes,i_enum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[calc_alltriarea]: could not allocate aux. arrays r_xy...') + END IF + CALL grid_getinfo(p_handle, r_nodecoordinates= r_xy, i_elementnodes=i_enods) + +!---------- now calculate element's areas + + DO i_cnt=1,i_enum + r_1(:)= r_xy(:,i_enods(1,i_cnt)) + r_2(:)= r_xy(:,i_enods(2,i_cnt)) + r_3(:)= r_xy(:,i_enods(3,i_cnt)) + r_elmtarea(i_cnt)= calc_triangarea(r_1, r_2, r_3) + END DO + + DEALLOCATE(r_xy, i_enods) + RETURN + + END SUBROUTINE calc_alltriarea + +!***************************************************************** + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.plain.f90 b/flash2d/src/options/SLM_advanced.plain.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ca6dfec9a3e032b7cbbd33b3c9a90706899d5107 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.plain.f90 @@ -0,0 +1,381 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.quadrature.f90 b/flash2d/src/options/SLM_advanced.quadrature.f90 new file mode 100644 index 0000000000000000000000000000000000000000..42ad5a023b68f021d102e18df294afeaa4b2839d --- /dev/null +++ b/flash2d/src/options/SLM_advanced.quadrature.f90 @@ -0,0 +1,522 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN +! CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & +! r_dualcoordinates, i_selectlength=i_size, i_selectindex=i_index) + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_alct, i_cnt, & + j_cnt, i_tnc, i_oarlen, i_fill, i_len, i_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_aux1 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux2 + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_mass + REAL (KIND = GRID_SR) :: r_onethird=1._GRID_SR/3._GRID_SR + INTEGER, DIMENSION(GRID_patchelements) :: i_polynod + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_part, r_isarea + REAL (KIND = GRID_SR), EXTERNAL :: triatria_isectar + REAL (KIND = GRID_SR) :: r_xmax, r_ymax, r_xmin, r_ymin + REAL (KIND = GRID_SR) :: r_maxx, r_maxy, r_minx, r_miny + REAL (KIND = GRID_SR) :: r_val, r_intgrl + INTEGER, DIMENSION(:), POINTER :: i_triang + REAL (KIND = GRID_SR), DIMENSION(:), POINTER :: r_area + + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_val= 0.0_GRID_SR + r_narea= 0.0_GRID_SR + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- calculate area + + r_narea= r_narea+ triang_ar(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- the upstream dual element's outer nodes + + r_vertx(1,2)= r_dcoord(1,i_dedge(1,i_tnc,i_cnt))- r_dalpha(1,i_dedge(1,i_tnc,i_cnt)) + r_vertx(2,2)= r_dcoord(2,i_dedge(1,i_tnc,i_cnt))- r_dalpha(2,i_dedge(1,i_tnc,i_cnt)) + r_vertx(1,3)= r_dcoord(1,i_dedge(2,i_tnc,i_cnt))- r_dalpha(1,i_dedge(2,i_tnc,i_cnt)) + r_vertx(2,3)= r_dcoord(2,i_dedge(2,i_tnc,i_cnt))- r_dalpha(2,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate integral with quadrature rule + + CALL triang_quadrature(p_mesh(i_time), r_vertx, r_intgrl) + r_val= r_val+ r_intgrl + + END IF + END DO ptch_loop + +!---------- now calculate concentration + + IF(ABS(r_narea) > GRID_EPS) THEN + IF(ABS(r_val) > GRID_EPS) THEN + r_rside(i_cnt)= r_val/r_narea + ELSE + r_rside(i_cnt)= 0.0_GRID_SR + END IF + ELSE + r_rside(i_cnt)= 0.0_GRID_SR + END IF + + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + FUNCTION triang_ar(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_ar + +!***************************************************************** + SUBROUTINE triang_quadrature(p_mesh, r_vertcoo, r_intgrl) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,3), INTENT(in) :: r_vertcoo + REAL (KIND = GRID_SR), INTENT(out) :: r_intgrl + + REAL (KIND = GRID_SR) :: r_onethird=1._GRID_SR/3._GRID_SR + REAL (KIND = GRID_SR) :: r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_quadpoint + REAL (KIND = GRID_SR), DIMENSION(3) :: r_vals + +!---------- calculate area + + r_narea= triang_ar(r_vertcoo(:,1), r_vertcoo(:,2), r_vertcoo(:,3)) + +!---------- calculate interpolation values at quadpoints + + r_quadpoint=(r_vertcoo(:,1)+ r_vertcoo(:,2))* 0.5_GRID_SR + r_vals(1)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=(r_vertcoo(:,2)+ r_vertcoo(:,3))* 0.5_GRID_SR + r_vals(2)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=(r_vertcoo(:,3)+ r_vertcoo(:,1))* 0.5_GRID_SR + r_vals(3)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + +!---------- calculate integral + + r_intgrl= SUM(r_vals)* r_onethird * r_narea + IF(ABS(r_intgrl) < GRID_EPS) r_intgrl= 0.0_GRID_SR + + RETURN + END SUBROUTINE triang_quadrature + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.quadrature7.f90 b/flash2d/src/options/SLM_advanced.quadrature7.f90 new file mode 100644 index 0000000000000000000000000000000000000000..68d351f048001feb2bac1f101a701c0b1dbb9e73 --- /dev/null +++ b/flash2d/src/options/SLM_advanced.quadrature7.f90 @@ -0,0 +1,537 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolinit +! FUNCTION: +! initialize the interpolation (conservative interpolation) +! SYNTAX: +! CALL slm_interpolate(grid) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! we set a global value present in this module: +! r_conservation: conservation value REAL +! +!----------------------------------------------------------------- +! +! NAME: +! triang_ar +! FUNCTION: +! calculate triangle area given by three coordinates +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_displace, slm_update, slm_upstream +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, SLM_interpolation, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), POINTER :: r_dualcoordinates + INTEGER, DIMENSION(:,:,:), POINTER :: i_dualedges + INTEGER :: i_dual + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_dualalpha + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!---------- create dual mesh + + IF(present(i_newsdepth)) THEN +! CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & +! r_dualcoordinates, i_selectlength=i_size, i_selectindex=i_index) + ELSE + CALL grid_createdual(p_ghand(i_timeplus), i_dual, i_dualedges, & + r_dualcoordinates) + END IF + +!---------- allocate array for dual displacements + + allocate(r_dualalpha(GRID_dimension,i_dual), stat=i_alct) + not_allocdual: IF(i_alct /= 0) THEN + CALL grid_error(40) + END IF not_allocdual + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, & + i_dual, r_dualcoordinates, r_dualalpha, & + i_dualedges, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!---------- destroy dual mesh + + CALL grid_destroydual(i_dual, i_dualedges, r_dualcoordinates) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_dualalpha, r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(out) :: r_dalpha + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + +!---------- the same for the dual grid + + dual_loop: DO i_cnt1=1,i_darlen + r_axy= 0.0_GRID_SR + + diter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_dcoord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO diter_loop + + r_dalpha(:,i_cnt1)= r_axy + END DO dual_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, r_alpha, & + i_darlen, r_dcoord, r_dalpha, & + i_dedge, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + INTEGER, INTENT(in) :: i_darlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dcoord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_darlen), INTENT(in) :: r_dalpha + INTEGER, DIMENSION(2,GRID_patchelements,i_arlen), INTENT(in) :: i_dedge + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + INTEGER :: i_alct, i_cnt, & + j_cnt, i_tnc, i_oarlen, i_fill, i_len, i_tmp + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_1, r_2, r_3 + REAL (KIND = GRID_SR) :: r_oarea, r_narea + REAL (KIND = GRID_SR), DIMENSION(:,:,:), ALLOCATABLE :: r_aux1 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux2 + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_mass + REAL (KIND = GRID_SR) :: r_onethird=1._GRID_SR/3._GRID_SR + INTEGER, DIMENSION(GRID_patchelements) :: i_polynod + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,GRID_elementnodes) :: r_vertx + REAL (KIND = GRID_SR) :: r_part, r_isarea + REAL (KIND = GRID_SR), EXTERNAL :: triatria_isectar + REAL (KIND = GRID_SR) :: r_xmax, r_ymax, r_xmin, r_ymin + REAL (KIND = GRID_SR) :: r_maxx, r_maxy, r_minx, r_miny + REAL (KIND = GRID_SR) :: r_val, r_intgrl + INTEGER, DIMENSION(:), POINTER :: i_triang + REAL (KIND = GRID_SR), DIMENSION(:), POINTER :: r_area + + +!---------- main loop over the nodes of the new grid + + node_loop: DO i_cnt=1,i_arlen + + r_val= 0.0_GRID_SR + r_narea= 0.0_GRID_SR + r_vertx= 0.0_GRID_SR + +!---------- the upstream dual element's center node + + r_vertx(1,1)= r_coord(1,i_cnt)- r_alpha(1,i_cnt) + r_vertx(2,1)= r_coord(2,i_cnt)- r_alpha(2,i_cnt) + +!---------- now calculate the interference of the voronoi thing with elements from old mesh + + ptch_loop: DO i_tnc= 1, GRID_patchelements + IF(i_dedge(1,i_tnc,i_cnt) == 0) THEN + EXIT ptch_loop + ELSE + +!---------- calculate area + + r_narea= r_narea+ triang_ar(r_coord(:,i_cnt), & + r_dcoord(:,i_dedge(1,i_tnc,i_cnt)), & + r_dcoord(:,i_dedge(2,i_tnc,i_cnt))) + +!---------- the upstream dual element's outer nodes + + r_vertx(1,2)= r_dcoord(1,i_dedge(1,i_tnc,i_cnt))- r_dalpha(1,i_dedge(1,i_tnc,i_cnt)) + r_vertx(2,2)= r_dcoord(2,i_dedge(1,i_tnc,i_cnt))- r_dalpha(2,i_dedge(1,i_tnc,i_cnt)) + r_vertx(1,3)= r_dcoord(1,i_dedge(2,i_tnc,i_cnt))- r_dalpha(1,i_dedge(2,i_tnc,i_cnt)) + r_vertx(2,3)= r_dcoord(2,i_dedge(2,i_tnc,i_cnt))- r_dalpha(2,i_dedge(2,i_tnc,i_cnt)) + +!---------- calculate integral with quadrature rule + + CALL triang_quadrature(p_mesh(i_time), r_vertx, r_intgrl) + r_val= r_val+ r_intgrl + + END IF + END DO ptch_loop + +!---------- now calculate concentration + + r_rside(i_cnt)= r_val/r_narea + + END DO node_loop + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + FUNCTION triang_ar(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_SR) :: r_area + REAL (KIND = GRID_SR) :: r_c + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_a, r_b + +!---------- calculate vector components + + r_a= r_coord2- r_coord1 + r_b= r_coord3- r_coord1 + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_SR + + RETURN + END FUNCTION triang_ar + +!***************************************************************** + SUBROUTINE triang_quadrature(p_mesh, r_vertcoo, r_intgrl) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,3), INTENT(in) :: r_vertcoo + REAL (KIND = GRID_SR), INTENT(out) :: r_intgrl + + REAL (KIND = GRID_SR), PARAMETER :: r_onethird=1._GRID_SR/3._GRID_SR + REAL (KIND = GRID_SR), PARAMETER :: r_one20=1._GRID_SR/20._GRID_SR + REAL (KIND = GRID_SR), PARAMETER :: r_two15=2._GRID_SR/15._GRID_SR + REAL (KIND = GRID_SR), PARAMETER :: r_nine20=9._GRID_SR/20._GRID_SR + REAL (KIND = GRID_SR) :: r_narea + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_quadpoint + REAL (KIND = GRID_SR), DIMENSION(7) :: r_vals + REAL (KIND = GRID_SR), DIMENSION(3) :: r_weight + +!---------- calculate area and weights + + r_narea= triang_ar(r_vertcoo(:,1), r_vertcoo(:,2), r_vertcoo(:,3)) + r_weight(1)= r_narea* r_one20 + r_weight(2)= r_narea* r_two15 + r_weight(3)= r_narea* r_nine20 + + +!---------- calculate interpolation values at quadpoints + + r_quadpoint=r_vertcoo(:,1) + r_vals(1)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=r_vertcoo(:,2) + r_vals(2)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=r_vertcoo(:,3) + r_vals(3)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + + r_quadpoint=(r_vertcoo(:,1)+ r_vertcoo(:,2))* 0.5_GRID_SR + r_vals(4)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=(r_vertcoo(:,2)+ r_vertcoo(:,3))* 0.5_GRID_SR + r_vals(5)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + r_quadpoint=(r_vertcoo(:,3)+ r_vertcoo(:,1))* 0.5_GRID_SR + r_vals(6)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + + r_quadpoint=(r_vertcoo(:,1)+ r_vertcoo(:,2)+ r_vertcoo(:,3))* r_onethird + r_vals(7)= grid_coordvalue(p_mesh, r_quadpoint, & + i_interpolorder=GRID_highorder) + +!---------- calculate integral + + r_intgrl= SUM(r_vals(1:3))* r_weight(1)+ & + SUM(r_vals(4:6))* r_weight(2)+ & + r_vals(7)* r_weight(3) + + RETURN + END SUBROUTINE triang_quadrature + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_advanced.tps.f90 b/flash2d/src/options/SLM_advanced.tps.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ac0889b12214e7c1ddf1fcc6e2688ff468b212dd --- /dev/null +++ b/flash2d/src/options/SLM_advanced.tps.f90 @@ -0,0 +1,381 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_advanced +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_astep +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_advanced + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_astep + CONTAINS +!***************************************************************** + SUBROUTINE slm_astep(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_astep]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_adisplace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_aupstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_aupdate(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_astep + +!***************************************************************** + SUBROUTINE slm_adisplace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_adisplace + +!***************************************************************** + SUBROUTINE slm_aupdate(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_aupdate + +!***************************************************************** + SUBROUTINE slm_aupstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_ainterpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_aupstream +!***************************************************************** + SUBROUTINE slm_ainterpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_thinplate, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_ainterpolate + + + END MODULE SLM_advanced diff --git a/flash2d/src/options/SLM_initial.3humps.f90 b/flash2d/src/options/SLM_initial.3humps.f90 new file mode 100644 index 0000000000000000000000000000000000000000..37206e1a6e9c26f655c75aacaae34283259e7ec9 --- /dev/null +++ b/flash2d/src/options/SLM_initial.3humps.f90 @@ -0,0 +1,407 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=1.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + cyl_slot: IF(p_ghand%i_maxlvl < i_lev) THEN + CALL slm_inithump(p_ghand) + ELSE cyl_slot + CALL slm_inithump(p_ghand) + END IF cyl_slot + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for Gaussian hump + + CALL compute_hump(i_num, r_coo, r_array) + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_inithump(p_ghand, l_initialize) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + LOGICAL, OPTIONAL :: l_initialize + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux, & + r_nodecoordinates= r_coo) + +!---------- initialize values to zero if requested + + IF(present(l_initialize) .AND. l_initialize) r_aux= 0._GRID_SR + +!---------- compute values for Gaussian humps + + CALL compute_hump(i_num, r_coo, r_aux(1,:), r_center=r_hcntr) + CALL compute_hump(i_num, r_coo, r_aux(1,:), r_center=r_cntr, r_radius=(r_srd*1.5)) + CALL compute_hump(i_num, r_coo, r_aux(1,:), r_center=r_ccntr, r_radius=(r_srd*.8)) + +!---------- update grid information + + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_inithump +!***************************************************************** + SUBROUTINE compute_hump(i_num, r_coo, r_aux, r_center, r_radius) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + REAL (KIND = GRID_SR), DIMENSION(:), OPTIONAL :: r_center + REAL (KIND = GRID_SR), OPTIONAL :: r_radius + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_dpt, r_rad, r_pr, r_lsrd + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr, r_tmp + +!---------- initialize some constant for the slotted cylinder + + IF (PRESENT(r_center)) THEN + r_centr= r_center + ELSE + r_centr= r_hcntr + END IF + IF (PRESENT(r_radius)) THEN + r_lsrd = r_radius + ELSE + r_lsrd= r_srd + END IF + r_rds= r_lsrd* r_lsrd + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_rad= min(sqrt(r_dpt),r_lsrd)/r_lsrd + r_pr= GRID_PI* r_rad + r_aux(i_count)= 0.25_GRID_SR* (1+ cos(r_pr)) + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_hump + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.SWCosine.f90 b/flash2d/src/options/SLM_initial.SWCosine.f90 new file mode 100644 index 0000000000000000000000000000000000000000..4024df1239d6c08dc6465ed7d868ee0c455dd676 --- /dev/null +++ b/flash2d/src/options/SLM_initial.SWCosine.f90 @@ -0,0 +1,379 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize a cosinus hill with zero base velocity in the center of the area +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initwaves +! FUNCTION: +! initialize the gridpoint values with the initial values for +! (u,v), h and (hu, hv) +! SYNTAX: +! CALL slm_initbar(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only. It calculates the analytical solution for h and u +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initvelo +! FUNCTION: +! calculates the initival velocity +! SYNTAX: +! CALL slm_initvelo(real.arr, int, real.arr) +! ON INPUT: +! r_coord: coordinates of gridpoints REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_initialV: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only. It calculates just the u at the moment +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initheight +! FUNCTION: +! calculates the initival height +! SYNTAX: +! CALL slm_initvelo(real.arr, int, real.arr) +! ON INPUT: +! r_coord: coordinates of gridpoints REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_initialH: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only. It calculates the initial height +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution, slm_initvelo +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api, FLASH_Parameters +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! 8. adjusted to Cosinus Hill s.paruszewski 1/2015 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters +! USE IO_plot_vtu + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution, slm_initvelo, slm_initGrad, add_grid_params, getAvrgH + REAL (KIND = GRID_SR) :: r_avrgH=8.0 + REAL (KIND = GRID_SR) :: r_varH=8.0 + REAL (KIND = GRID_SR) :: r_centerPoint=12500.0 + REAL (KIND = GRID_SR) :: r_radius=6000.0 + + CONTAINS +!***************************************************************** + + SUBROUTINE getAvrgH(r_Height) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), INTENT(out) :: r_Height + + r_Height= r_avrgH + + RETURN + END SUBROUTINE getAvrgH + +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + + CALL slm_initwaves(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_num, r_iniOutHeight, r_iniMom, r_iniVelo) +!---- A T T E N T I O N T H I S I S N O T A N A N A L Y T I C A L S O L U T I O N !!!!!!!!!!!!! +!---- THAT MEANS ALSO: NOT EVERY VALUE IN THE DIAGNOSTIC FILE IS USEFUL +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_num + REAL (KIND = GRID_SR), DIMENSION(i_num), INTENT(out) :: r_iniOutHeight + INTEGER :: i_count , i_alct + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_num), INTENT(out) :: r_iniVelo, r_iniMom + REAL (KIND = GRID_SR), DIMENSION(1,i_num):: r_iniHeight + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_SR) :: r_x, r_y +!---------- allocate workspace + + ALLOCATE( r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get coordinate information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- calculate initial velocity + CALL slm_initVelo(r_coo, i_num, r_iniVelo) +!---------- calculate initial height + CALL slm_initHeight(r_coo, i_num, r_iniHeight) + r_iniOutHeight=r_iniHeight(1,:) +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + +!----------- Calculate momentum (hu) by using h*u + + r_iniMom(1,i_count)= r_iniVelo(1,i_count)*r_iniHeight(1,i_count) + r_iniMom(2,i_count)= r_iniVelo(2,i_count)*r_iniHeight(1,i_count) + + IF(abs(r_iniMom(1,i_count))<GRID_eps) THEN + r_iniMom(1,i_count)=0.0_GRID_SR + END IF + IF(abs(r_iniMom(2,i_count))<GRID_eps) THEN + r_iniMom(2,i_count)=0.0_GRID_SR + END IF + + + END DO node_loop + + DEALLOCATE( r_coo) + + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initwaves(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_iniVelo, r_iniMom, r_iniHeight + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_iniHeight(1,i_num),r_iniMom(GRID_dimension,i_num),r_iniVelo(GRID_dimension,i_num), & + r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get coordinate information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- calculate initial velocity + CALL slm_initVelo(r_coo, i_num, r_iniVelo) +!---------- calculate initial height + CALL slm_initHeight(r_coo, i_num, r_iniHeight) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + +!----------- Calculate momentum (hu) by using h*u + + r_iniMom(1,i_count)=r_iniVelo(1,i_count)*r_iniHeight(1,i_count) + r_iniMom(2,i_count)=r_iniVelo(2,i_count)*r_iniHeight(1,i_count) + + IF(abs(r_iniMom(1,i_count))<GRID_eps) THEN + r_iniMom(1,i_count)=0.0_GRID_SR + END IF + IF(abs(r_iniMom(2,i_count))<GRID_eps) THEN + r_iniMom(2,i_count)=0.0_GRID_SR + END IF + + + END DO node_loop + + CALL grid_putinfo(p_ghand, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /), r_nodevalues= r_iniVelo) + CALL grid_putinfo(p_ghand, i_arraypoint=(/ GRID_h /), r_nodevalues= r_iniHeight) + CALL grid_putinfo(p_ghand, i_arraypoint=(/ GRID_hu, GRID_hv /), r_nodevalues= r_iniMom) + + +!---------- deallocate workspace + + DEALLOCATE(r_iniHeight,r_iniMom,r_iniVelo, r_coo) + + RETURN + END SUBROUTINE slm_initwaves + +!***************************************************************** + SUBROUTINE slm_initvelo(r_coord, i_arlen, r_initialV) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_initialV + INTEGER :: i_count + LOGICAL :: l_isOutside + + node_loop: DO i_count= 1, i_arlen + + CALL isOutsideCalculationArea(r_coord(:, i_count), l_isOutside) + + IF(l_isOutside) THEN + + r_initialV(1,i_count)=0.0_GRID_SR + r_initialV(2,i_count)=0.0_GRID_SR + + ELSE + + r_initialV(1,i_count)=0.0_GRID_SR + r_initialV(2,i_count)=0.0_GRID_SR + + END IF + END DO node_loop + + RETURN + END SUBROUTINE slm_initvelo +!***************************************************************** + SUBROUTINE slm_initHeight(r_coord,i_arlen, r_iniH) + + !---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(1,i_arlen), INTENT(out) :: r_iniH + INTEGER :: i_cnt + LOGICAL :: l_isOutside + + DO i_cnt=1, i_arlen + + CALL isOutsideCalculationArea(r_coord(:, i_cnt), l_isOutside) + + IF(l_isOutside) THEN + r_iniH(1,i_cnt)=r_avrgH + ELSE + + r_iniH(1,i_cnt)= r_avrgH+r_varH/r_radius*sqrt(r_radius*r_radius-(r_coord(1,i_cnt)- r_centerPoint)*(r_coord(1,i_cnt)& + - r_centerPoint)-(r_coord(2,i_cnt)- r_centerPoint)*(r_coord(2,i_cnt)- r_centerPoint)) + + IF(abs(r_iniH(1,i_cnt))<GRID_eps) THEN + r_iniH(1,i_cnt)=0.0_GRID_SR + END IF + END IF + END DO + + + END SUBROUTINE slm_initHeight + + +!***************************************************************** + + SUBROUTINE isOutsideCalculationArea(r_coordPoint ,l_isOutside) + + LOGICAL, INTENT(out) :: l_isOutside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,1), INTENT(in) :: r_coordPoint + REAL (KIND = GRID_SR) :: r_distToCenterPoint + + + r_distToCenterPoint =sqrt( (r_centerPoint-r_coordPoint(1,1))*(r_centerPoint-r_coordPoint(1,1)) + & + (r_centerPoint-r_coordPoint(2,1))*(r_centerPoint-r_coordPoint(2,1))) + + IF( r_distToCenterPoint >= r_radius) THEN + l_isOutside= .true. + ELSE + l_isOutside= .false. + END IF + + + END SUBROUTINE + +!******************************************************************* + + SUBROUTINE add_grid_params() + + + GRID_h= grid_registerfemvar(1) + GRID_hu= grid_registerfemvar(1,i_length=2) + GRID_hv= GRID_hu+1 + + END SUBROUTINE add_grid_params + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.UoR.f90 b/flash2d/src/options/SLM_initial.UoR.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2f1218a1d9e23ab6128b9184a79dc3ce6bdf2350 --- /dev/null +++ b/flash2d/src/options/SLM_initial.UoR.f90 @@ -0,0 +1,436 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=0.70 + REAL (KIND = GRID_SR) :: r_hgt2=0.68 + REAL (KIND = GRID_SR) :: r_srd=0.027 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_inituor(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- compute initial values for a christmas tree + + CALL compute_uor(i_num, r_coo, r_array) + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_inituor(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero + + r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + CALL compute_uor(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_inituor + +!***************************************************************** + SUBROUTINE compute_uor(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count, j_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 3, 40) :: r_uor + +!---------- initialize coordinates of xmas tree triangles + + r_uor(:,:,1) = RESHAPE( (/-0.425, -0.05, -0.375, -0.25, -0.375, -0.05 /), (/GRID_dimension, 3 /)) + r_uor(:,:,2) = RESHAPE( (/-0.425, -0.05, -0.425, -0.275, -0.375, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,3) = RESHAPE( (/-0.435, -0.275, -0.35, -0.35, -0.375, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,4) = RESHAPE( (/-0.35, -0.35, -0.325, -0.3, -0.375, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,5) = RESHAPE( (/-0.35, -0.35, -0.3, -0.35, -0.325, -0.3 /), (/GRID_dimension, 3 /)) + r_uor(:,:,6) = RESHAPE( (/-0.3, -0.35, -0.275, -0.25, -0.325, -0.3 /), (/GRID_dimension, 3 /)) + r_uor(:,:,7) = RESHAPE( (/-0.3, -0.35, -0.225, -0.275, -0.275, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,8) = RESHAPE( (/-0.225, -0.275, -0.225, -0.05, -0.275, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,9) = RESHAPE( (/-0.275, -0.25, -0.225, -0.05, -0.275, -0.05 /), (/GRID_dimension, 3 /)) + + r_uor(:,:,10) = RESHAPE( (/-0.125, -0.125, -0.2, -0.2, -0.1, -0.175 /), (/GRID_dimension, 3 /)) + r_uor(:,:,11) = RESHAPE( (/-0.1, -0.175, -0.2, -0.2, -0.15, -0.225 /), (/GRID_dimension, 3 /)) + r_uor(:,:,12) = RESHAPE( (/-0.2, -0.2, -0.2, -0.275, -0.15, -0.225 /), (/GRID_dimension, 3 /)) + r_uor(:,:,13) = RESHAPE( (/-0.15, -0.225, -0.2, -0.275, -0.15, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,14) = RESHAPE( (/-0.15, -0.25, -0.2, -0.275, -0.125, -0.35 /), (/GRID_dimension, 3 /)) + r_uor(:,:,15) = RESHAPE( (/-0.15, -0.25, -0.125, -0.35, -0.1, -0.3 /), (/GRID_dimension, 3 /)) + r_uor(:,:,16) = RESHAPE( (/-0.1, -0.3, -0.125, -0.35, -0.05, -0.35 /), (/GRID_dimension, 3 /)) + r_uor(:,:,17) = RESHAPE( (/-0.1, -0.3, -0.05, -0.35, -0.075, -0.3 /), (/GRID_dimension, 3 /)) + r_uor(:,:,18) = RESHAPE( (/-0.075, -0.3, -0.05, -0.35, 0.025, -0.275 /), (/GRID_dimension, 3 /)) + r_uor(:,:,19) = RESHAPE( (/-0.025, -0.25, -0.075, -0.3, 0.025, -0.275 /), (/GRID_dimension, 3 /)) + r_uor(:,:,20) = RESHAPE( (/0.025, -0.2, -0.025, -0.25, 0.025, -0.275 /), (/GRID_dimension, 3 /)) + r_uor(:,:,21) = RESHAPE( (/-0.025, -0.225, -0.025, -0.25, 0.025, -0.2 /), (/GRID_dimension, 3 /)) + r_uor(:,:,22) = RESHAPE( (/-0.05, -0.125, -0.025, -0.225, 0.025, -0.2 /), (/GRID_dimension, 3 /)) + r_uor(:,:,23) = RESHAPE( (/-0.05, -0.125, -0.075, -0.175, -0.025, -0.225 /), (/GRID_dimension, 3 /)) + r_uor(:,:,24) = RESHAPE( (/-0.125, -0.125, -0.075, -0.175, -0.05, -0.125 /), (/GRID_dimension, 3 /)) + r_uor(:,:,25) = RESHAPE( (/-0.125, -0.125, -0.1, -0.175, -0.075, -0.175 /), (/GRID_dimension, 3 /)) + + r_uor(:,:,26) = RESHAPE( (/0.05, -0.05, 0.05, -0.1, 0.15, -0.05 /), (/GRID_dimension, 3 /)) + r_uor(:,:,27) = RESHAPE( (/0.15, -0.05, 0.05, -0.1, 0.125, -0.1 /), (/GRID_dimension, 3 /)) + r_uor(:,:,28) = RESHAPE( (/0.05, -0.1, 0.05, -0.2, 0.1, -0.1 /), (/GRID_dimension, 3 /)) + r_uor(:,:,29) = RESHAPE( (/0.1, -0.1, 0.05, -0.2, 0.1, -0.2 /), (/GRID_dimension, 3 /)) + r_uor(:,:,30) = RESHAPE( (/0.05, -0.2, 0.05, -0.25, 0.15, -0.2 /), (/GRID_dimension, 3 /)) + r_uor(:,:,31) = RESHAPE( (/0.05, -0.25, 0.15, -0.25, 0.15, -0.2 /), (/GRID_dimension, 3 /)) + r_uor(:,:,32) = RESHAPE( (/0.05, -0.25, 0.1, -0.35, 0.1, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,33) = RESHAPE( (/0.05, -0.25, 0.05, -0.35, 0.1, -0.35 /), (/GRID_dimension, 3 /)) + r_uor(:,:,34) = RESHAPE( (/0.1, -0.25, 0.2, -0.35, 0.15, -0.25 /), (/GRID_dimension, 3 /)) + r_uor(:,:,35) = RESHAPE( (/0.15, -0.25, 0.2, -0.35, 0.25, -0.35 /), (/GRID_dimension, 3 /)) + r_uor(:,:,36) = RESHAPE( (/0.15, -0.2, 0.15, -0.25, 0.225, -0.175 /), (/GRID_dimension, 3 /)) + r_uor(:,:,37) = RESHAPE( (/0.175, -0.15, 0.15, -0.2, 0.225, -0.175 /), (/GRID_dimension, 3 /)) + r_uor(:,:,38) = RESHAPE( (/0.225, -0.125, 0.175, -0.15, 0.225, -0.175 /), (/GRID_dimension, 3 /)) + r_uor(:,:,39) = RESHAPE( (/0.125, -0.1, 0.175, -0.15, 0.225, -0.125 /), (/GRID_dimension, 3 /)) + r_uor(:,:,40) = RESHAPE( (/0.15, -0.05, 0.125, -0.1, 0.225, -0.125 /), (/GRID_dimension, 3 /)) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + DO j_count= 1, 40 + inside: IF(in_side(r_coo(:,i_count), r_uor(:,1,j_count), & + r_uor(:,2,j_count), r_uor(:,3,j_count))) THEN + r_aux(i_count)= r_hgt2 + END IF inside + END DO + END DO node_loop + + RETURN + END SUBROUTINE compute_uor + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.advdiff.f90 b/flash2d/src/options/SLM_initial.advdiff.f90 new file mode 100644 index 0000000000000000000000000000000000000000..49e41fec71a939230697528afe8ed2171dee9a61 --- /dev/null +++ b/flash2d/src/options/SLM_initial.advdiff.f90 @@ -0,0 +1,350 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api +! USE mkl_vml + include "mkl_vml.f90" + +!#ifdef USE_MKL +! INTERFACE erf ! define universal interface for error function +! MODULE PROCEDURE vserf, vderf +! END INTERFACE +!#endif + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 4., 1. /) + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize diffusion coefficient + + p_contr%tst%tst_real(1,1)= 0.01_GRID_SR + + CALL initerf(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array, l_advective) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + LOGICAL, OPTIONAL :: l_advective + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt, r_diffuse + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- if advective part is included then we need to correct the position + + advect_true: IF(present(l_advective)) THEN + l_aux= l_advective + ELSE advect_true + l_aux= .TRUE. + END IF advect_true + IF (l_aux) & + r_coo(1,:)= r_coo(1,:)-p_contr%tst%tst_real(1,2)*(r_time) !-3._GRID_SR) + +!---------- compute values for for error function + + r_diffuse= p_contr%tst%tst_real(1,1) + CALL compute_erf(i_num, r_time, r_diffuse, r_coo, r_array) + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE initerf(p_ghand, l_initialize) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + LOGICAL, OPTIONAL :: l_initialize + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_SR) :: r_time, r_diffuse + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero if requested + + IF(present(l_initialize) .AND. l_initialize) r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + r_time = 0._GRID_SR + r_diffuse = p_contr%tst%tst_real(1,1) + CALL compute_erf(i_num, r_time, r_diffuse, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE initerf + +!***************************************************************** + SUBROUTINE compute_erf(i_num, r_time, r_diff, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR) :: r_time + REAL (KIND = GRID_SR) :: r_diff + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + DOUBLE PRECISION, DIMENSION(:), ALLOCATABLE :: r_aux1, r_aux2 + INTEGER :: i_alct + REAL (KIND = GRID_SR) :: r_denom + +!---------- allocate additional memory + + ALLOCATE(r_aux1(i_num), r_aux2(i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[compute_erf] could not allocate aux mem.') + END IF + +!---------- compute auxiliary values... + + r_denom= 1._GRID_SR/SQRT(4._GRID_SR*r_diff* (1._GRID_SR+ r_time)) + +!---------- compute a hump from error function + + r_aux1(1:i_num)= DBLE((.75_GRID_SR- ABS(r_cntr(1)-r_coo(1,1:i_num)))* r_denom) + CALL vderf(i_num, r_aux1, r_aux2) + r_aux= REAL(r_aux2,GRID_SR) + r_aux1(1:i_num)= DBLE((.75_GRID_SR+ ABS(r_cntr(1)-r_coo(1,1:i_num)))* r_denom) + CALL vderf(i_num, r_aux1, r_aux2) + r_aux= (r_aux+ REAL(r_aux2,GRID_SR))* 0.5_GRID_SR + +!---------- deallocate auxiliary arrays + + DEALLOCATE(r_aux1, r_aux2) + + RETURN + END SUBROUTINE compute_erf + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.algae.f90 b/flash2d/src/options/SLM_initial.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..3108355ffa048642290430b55c39dfef35145801 --- /dev/null +++ b/flash2d/src/options/SLM_initial.algae.f90 @@ -0,0 +1,355 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize algae test case for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initalgae +! FUNCTION: +! initialize a grid with values of a algae concentration +! SYNTAX: +! CALL slm_initalgae(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initaltemp +! FUNCTION: +! initialize a grid with values of a temperature distribution +! SYNTAX: +! CALL slm_initaltemp(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=0.1 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initalgae(p_ghand) + CALL slm_inittemp(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- dummy routine + + r_array= 0.0_GRID_SR + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initalgae(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- initial values + +! CALL compute_hump(i_num, r_coo, r_aux(1,:)) + CALL compute_cylndr(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initalgae + +!***************************************************************** + SUBROUTINE compute_hump(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_dpt, r_rad, r_pr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr, r_tmp + +!---------- initialize some constant for the slotted cylinder + + r_srd= 0.25_GRID_SR + r_rds= r_srd*r_srd + r_centr= (/ 0.0_GRID_SR, 0.0_GRID_SR /) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + r_aux(i_count)= 0.0_GRID_SR + inside: IF(r_dpt < r_rds) THEN + r_rad= min(sqrt(r_dpt),r_srd)/r_srd + r_pr= GRID_PI* r_rad + r_aux(i_count)= 0.25_GRID_SR* (1+ cos(r_pr)) + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_hump + +!***************************************************************** + SUBROUTINE compute_cylndr(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt, r_a, r_fac + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + +!---------- initialize some constants for the slotted cylinder + + r_srd= 0.25_GRID_SR + r_rds= r_srd*r_srd + r_centr= (/ 0.0_GRID_SR, 0.0_GRID_SR /) + r_a= r_srd + r_fac= 2._GRID_SR + + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(i_count)= (r_hgt-0.025_GRID_SR) + ((r_coo(1,i_count)- r_a)*r_fac)* (0.05_GRID_SR) +! r_aux(i_count)= r_hgt + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_cylndr + + +!***************************************************************** + SUBROUTINE slm_inittemp(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR) :: r_meantemp, r_deltatemp, r_maxtemp, r_mintemp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_diff, r_centr + + REAL (KIND = GRID_SR) :: r_mumax, r_Topt, r_Tslope, r_Cmort, r_mu, r_tmp, r_T2, r_a, r_b, r_fac, r_dpt + +!---------- set constants CAUTION: Make sure that these are consistent with ADV_rhs! + + ! r_mumax = 0.5_GRID_SR ! [per day] + r_mumax = 0.5_GRID_SR/86400._GRID_SR ! [per s] + r_Topt = 22.0_GRID_SR ! [°C] + r_Tslope = 5.0_GRID_SR ! [°C] +! r_Cmort = 0.05_GRID_SR ! [per day] + r_Cmort = 0.05_GRID_SR/86400._GRID_SR ! [per s] + +!---------- initialize some constants for the circular algae distribution + + r_T2 = r_Tslope*r_Tslope + r_meantemp = r_Topt - sqrt((r_T2* (log(r_mumax)-log(r_Cmort)))) + r_deltatemp= 0.002_GRID_SR + r_maxtemp = r_meantemp+ r_deltatemp + r_mintemp = r_meantemp- r_deltatemp + + r_a= 0.5_GRID_SR*0.5_GRID_SR + r_centr= (/ 0.0_GRID_SR, 0.0_GRID_SR /) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- determine min/max x-coordinates + +! r_a= minval(r_coo(1,:)) +! r_b= maxval(r_coo(1,:)) +! r_fac= 1._GRID_SR/(r_b-r_a) + +!---------- initial values + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_diff(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_diff, r_diff) + inside: IF(r_dpt < r_a) THEN +! r_aux(1,i_count)= (r_hgt-0.025_GRID_SR) + ((r_coo(1,i_count)- r_a)*r_fac)* (0.05_GRID_SR) + r_aux(1,i_count)= r_meantemp + END IF inside + END DO node_loop + +! node_loop: DO i_count= 1, i_num +! r_aux(1,i_count)= r_mintemp + ((r_coo(1,i_count)- r_a)*r_fac)* (r_maxtemp-r_mintemp) +! END DO node_loop +! r_aux= r_meantemp + +!---------- update grid information + + i_valind= (/ GRID_phi /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_inittemp + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.algaeBaltic.f90 b/flash2d/src/options/SLM_initial.algaeBaltic.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f268923d7e7289c5c03e1702ca446ece7eeb95dc --- /dev/null +++ b/flash2d/src/options/SLM_initial.algaeBaltic.f90 @@ -0,0 +1,344 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize algae test case for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initalgae +! FUNCTION: +! initialize a grid with values of a algae concentration +! SYNTAX: +! CALL slm_initalgae(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initaltemp +! FUNCTION: +! initialize a grid with values of a temperature distribution +! SYNTAX: +! CALL slm_initaltemp(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + USE ADV_wind + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=0.1 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initalgae(p_ghand) + CALL slm_inittemp(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- dummy routine + + r_array= 0.0_GRID_SR + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initalgae(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- initial values + +! CALL compute_hump(i_num, r_coo, r_aux(1,:)) + CALL compute_cylndr(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initalgae + +!***************************************************************** + SUBROUTINE compute_hump(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_dpt, r_rad, r_pr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr, r_tmp + +!---------- initialize some constant for the slotted cylinder + + r_srd= 0.25_GRID_SR + r_rds= r_srd*r_srd + r_centr= (/ 0.0_GRID_SR, 0.0_GRID_SR /) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + r_aux(i_count)= 0.0_GRID_SR + inside: IF(r_dpt < r_rds) THEN + r_rad= min(sqrt(r_dpt),r_srd)/r_srd + r_pr= GRID_PI* r_rad + r_aux(i_count)= 0.25_GRID_SR* (1+ cos(r_pr)) + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_hump + +!***************************************************************** + SUBROUTINE compute_cylndr(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt, r_a, r_fac + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + +!---------- initialize some constants for the slotted cylinder + + r_srd= 0.5_GRID_SR + r_rds= r_srd*r_srd + r_centr= (/ 20.3_GRID_SR, 58.8_GRID_SR /) + r_a= r_srd + r_fac= 2._GRID_SR + + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside1: IF(r_dpt < r_rds) THEN +! r_aux(i_count)= (r_hgt-0.025_GRID_SR) + ((r_coo(1,i_count)- r_a)*r_fac)* (0.05_GRID_SR) + r_aux(i_count)= r_hgt + END IF inside1 + r_tmp(:) = r_coo(:,i_count)- (/ 7.5_GRID_SR, 57.3_GRID_SR /) + r_dpt= dot_product(r_tmp, r_tmp) + inside2: IF(r_dpt < r_rds) THEN + r_aux(i_count)= r_hgt + END IF inside2 + END DO node_loop + + RETURN + END SUBROUTINE compute_cylndr + + +!***************************************************************** + SUBROUTINE slm_inittemp(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR) :: r_meantemp, r_deltatemp, r_maxtemp, r_mintemp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_diff, r_centr + + REAL (KIND = GRID_SR) :: r_mumax, r_Topt, r_Tslope, r_Cmort, r_mu, r_tmp, r_T2, r_a, r_b, r_fac, r_dpt + +!---------- set constants CAUTION: Make sure that these are consistent with ADV_rhs! + + ! r_mumax = 0.5_GRID_SR ! [per day] + r_mumax = 0.5_GRID_SR/86400._GRID_SR ! [per s] + r_Topt = 22.0_GRID_SR ! [°C] + r_Tslope = 5.0_GRID_SR ! [°C] +! r_Cmort = 0.05_GRID_SR ! [per day] + r_Cmort = 0.05_GRID_SR/86400._GRID_SR ! [per s] + +!---------- initialize some constants for the circular algae distribution + + r_T2 = r_Tslope*r_Tslope + r_meantemp = r_Topt - sqrt((r_T2* (log(r_mumax)-log(r_Cmort)))) + r_deltatemp= 0.002_GRID_SR + r_maxtemp = r_meantemp+ r_deltatemp + r_mintemp = r_meantemp- r_deltatemp + + r_a= 0.5_GRID_SR*0.5_GRID_SR + r_centr= (/ 0.0_GRID_SR, 0.0_GRID_SR /) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- initial values + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= slm_tempfield(r_coo(:,i_count)) + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_phi /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_inittemp + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.aviso.f90 b/flash2d/src/options/SLM_initial.aviso.f90 new file mode 100644 index 0000000000000000000000000000000000000000..941521fab61090ed7faae0f8fd20454aa5c4ebbc --- /dev/null +++ b/flash2d/src/options/SLM_initial.aviso.f90 @@ -0,0 +1,551 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslottedcylinder +! FUNCTION: +! initialize a grid with values of sliced sphere test case +! SYNTAX: +! CALL slm_initslottedcylinder(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcosinebell +! FUNCTION: +! initialize a grid with values of a cosine bell +! (convergence test case) +! SYNTAX: +! CALL slm_initcosinebell(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for three dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_slottedcylinder +! FUNCTION: +! calculates the 'analytic solution' for the slotted cylinder with +! a circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_slottedcylinder(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_cosinebell +! FUNCTION: +! calculates the 'analytic solution' for a cosine bell with +! circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_cosinebell(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. slotted cylinder test case l. mentrup 12/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=& + (/ 142.0_GRID_SR, 38.0_GRID_SR /) + REAL (KIND = GRID_SR) :: r_hgt=1.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=1.5_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + +! CALL slm_initslottedcylinder(p_ghand) + +!---------- initialize some constant for the cosine bell test case + + CALL slm_initcosinebell(p_ghand) + +!---------- initialize concentration one everywhere + +! CALL slm_initoneforall(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy + r_array= 0.0_GRID_SR + +!---------- analyticsolution: cosinebell +! CALL slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: ball +! CALL slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: concentration one everywhere +! CALL slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR) :: r_rds_kreisbahn + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim, r_time_one_turn + REAL (KIND = GRID_SR) :: r_PI, r_phi + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time + r_time_one_turn = 1800._GRID_SR * 96_GRID_SR ! Time which the ball needs for one turn around the center + r_PI = GRID_PI + r_phi = r_PI ! Phasenwinkel um die Anfangskonstellation zu beruecksichtigen + r_centr = r_cntr + r_rds_kreisbahn = 0.25_GRID_SR + + r_centr(1) = r_rds_kreisbahn * COS(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + r_centr(2) = r_rds_kreisbahn * SIN(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + +! r_centr(1) = r_centr(1) + 0.5_GRID_SR ! Ins richtige Koordinatensystem +! r_centr(2) = r_centr(2) + 0.5_GRID_SR ! Ins richtige Koordsys verschieben + + IF (r_tim == 0.0_GRID_SR) THEN + r_centr= r_cntr + ENDIF + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + i_step=INT(r_tim) / 1800 + i_step=MODULO(i_step,96) + SELECT CASE (i_step) + CASE(0) + start_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)<=0.03_GRID_SR .AND. r_tmp(1)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF start_pos + CASE(24) + quarter_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(1) >= -0.07_GRID_SR .AND. (r_tmp(2)<=0.03_GRID_SR .AND. r_tmp(2)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF quarter_pos + CASE(48) + half_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) >= -0.07_GRID_SR .AND. (r_tmp(1)<=0.03_GRID_SR .AND. r_tmp(1)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF half_pos + CASE(72) + third_quarter_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(1) <= 0.07_GRID_SR .AND. (r_tmp(2)<=0.03_GRID_SR .AND. r_tmp(2)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF third_quarter_pos + END SELECT + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_slottedcylinder + +!***************************************************************** + SUBROUTINE slm_initslottedcylinder(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)>=-0.03_GRID_SR .AND. r_tmp(1)<=0.03_GRID_SR))) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslottedcylinder +!***************************************************************** + SUBROUTINE slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR) :: r_rds_kreisbahn + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim, r_time_one_turn + REAL (KIND = GRID_SR) :: r_PI, r_phi + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time + r_time_one_turn = 1800._GRID_SR * 96_GRID_SR ! Time which the ball needs for one turn around the center + r_PI = GRID_PI + r_phi = r_PI ! Phasenwinkel um die Anfangskonstellation zu beruecksichtigen + r_centr = r_cntr + r_rds_kreisbahn = 0.25_GRID_SR + + r_centr(1) = r_rds_kreisbahn * COS(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + r_centr(2) = r_rds_kreisbahn * SIN(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + +! r_centr(1) = r_centr(1) + 0.5_GRID_SR ! Ins richtige Koordinatensystem +! r_centr(2) = r_centr(2) + 0.5_GRID_SR ! Ins richtige Koordsys verschieben + + IF (r_tim == 0.0_GRID_SR) THEN + r_centr= r_cntr + ENDIF + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + IF (r_dpt <= r_srd) THEN + r_array(i_count) = r_hgt* cos(r_dpt*(r_PI/(2*r_srd))) + END IF + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_cosinebell + +!***************************************************************** + SUBROUTINE slm_initcosinebell(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= r_srd + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds) THEN + r_aux(1,i_count)= r_hgt * cos(r_dpt*(GRID_PI/(2*r_rds))) + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcosinebell +!***************************************************************** + SUBROUTINE slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 1.0 + + + RETURN + END SUBROUTINE slm_analyticsol_oneforall + +!***************************************************************** + SUBROUTINE slm_initoneforall(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- + + r_aux= 1.0_GRID_SR + + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux) + + RETURN + END SUBROUTINE slm_initoneforall + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.bar.f90 b/flash2d/src/options/SLM_initial.bar.f90 new file mode 100644 index 0000000000000000000000000000000000000000..eb16af99539a6fa7d331bd7707a3fb905db57768 --- /dev/null +++ b/flash2d/src/options/SLM_initial.bar.f90 @@ -0,0 +1,184 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initbar +! FUNCTION: +! initialize a grid with values of a bar +! SYNTAX: +! CALL slm_initbar(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=4.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initbar(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- dummy routine + + r_array= 0.0_GRID_SR + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initbar(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR) :: r_xsw, r_ysw, r_xne, r_yne + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constants for the bar + + r_xsw= -0.375_GRID_SR + r_xne= -0.125_GRID_SR + r_ysw= -0.05_GRID_SR + r_yne= 0.05_GRID_SR + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + inside: IF((r_coo(1,i_count)>r_xsw .AND. r_coo(1,i_count)<r_xne) .AND. & + (r_coo(2,i_count)>r_ysw .AND. r_coo(2,i_count)<r_yne)) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initbar + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.circ.f90 b/flash2d/src/options/SLM_initial.circ.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6ce7741a674f72f4173a0ccfb8f5a188c88cee9d --- /dev/null +++ b/flash2d/src/options/SLM_initial.circ.f90 @@ -0,0 +1,551 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslottedcylinder +! FUNCTION: +! initialize a grid with values of sliced sphere test case +! SYNTAX: +! CALL slm_initslottedcylinder(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcosinebell +! FUNCTION: +! initialize a grid with values of a cosine bell +! (convergence test case) +! SYNTAX: +! CALL slm_initcosinebell(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for three dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_slottedcylinder +! FUNCTION: +! calculates the 'analytic solution' for the slotted cylinder with +! a circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_slottedcylinder(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_cosinebell +! FUNCTION: +! calculates the 'analytic solution' for a cosine bell with +! circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_cosinebell(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. slotted cylinder test case l. mentrup 12/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=& + (/ -0.25_GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR) :: r_hgt=4.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=0.15_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initslottedcylinder(p_ghand) + +!---------- initialize some constant for the cosine bell test case + +! CALL slm_initcosinebell(p_ghand) + +!---------- initialize concentration one everywhere + +! CALL slm_initoneforall(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0_GRID_SR + +!---------- analyticsolution: cosinebell +! CALL slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: ball +! CALL slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: concentration one everywhere + CALL slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR) :: r_rds_kreisbahn + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim, r_time_one_turn + REAL (KIND = GRID_SR) :: r_PI, r_phi + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time + r_time_one_turn = 1800._GRID_SR * 96_GRID_SR ! Time which the ball needs for one turn around the center + r_PI = GRID_PI + r_phi = r_PI ! Phasenwinkel um die Anfangskonstellation zu beruecksichtigen + r_centr = r_cntr + r_rds_kreisbahn = 0.25_GRID_SR + + r_centr(1) = r_rds_kreisbahn * COS(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + r_centr(2) = r_rds_kreisbahn * SIN(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + +! r_centr(1) = r_centr(1) + 0.5_GRID_SR ! Ins richtige Koordinatensystem +! r_centr(2) = r_centr(2) + 0.5_GRID_SR ! Ins richtige Koordsys verschieben + + IF (r_tim == 0.0_GRID_SR) THEN + r_centr= r_cntr + ENDIF + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + i_step=INT(r_tim) / 1800 + i_step=MODULO(i_step,96) + SELECT CASE (i_step) + CASE(0) + start_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)<=0.03_GRID_SR .AND. r_tmp(1)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF start_pos + CASE(24) + quarter_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(1) >= -0.07_GRID_SR .AND. (r_tmp(2)<=0.03_GRID_SR .AND. r_tmp(2)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF quarter_pos + CASE(48) + half_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) >= -0.07_GRID_SR .AND. (r_tmp(1)<=0.03_GRID_SR .AND. r_tmp(1)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF half_pos + CASE(72) + third_quarter_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(1) <= 0.07_GRID_SR .AND. (r_tmp(2)<=0.03_GRID_SR .AND. r_tmp(2)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF third_quarter_pos + END SELECT + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_slottedcylinder + +!***************************************************************** + SUBROUTINE slm_initslottedcylinder(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)>=-0.03_GRID_SR .AND. r_tmp(1)<=0.03_GRID_SR))) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslottedcylinder +!***************************************************************** + SUBROUTINE slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR) :: r_rds_kreisbahn + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim, r_time_one_turn + REAL (KIND = GRID_SR) :: r_PI, r_phi + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time + r_time_one_turn = 1800._GRID_SR * 96_GRID_SR ! Time which the ball needs for one turn around the center + r_PI = GRID_PI + r_phi = r_PI ! Phasenwinkel um die Anfangskonstellation zu beruecksichtigen + r_centr = r_cntr + r_rds_kreisbahn = 0.25_GRID_SR + + r_centr(1) = r_rds_kreisbahn * COS(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + r_centr(2) = r_rds_kreisbahn * SIN(2_GRID_SR*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung + +! r_centr(1) = r_centr(1) + 0.5_GRID_SR ! Ins richtige Koordinatensystem +! r_centr(2) = r_centr(2) + 0.5_GRID_SR ! Ins richtige Koordsys verschieben + + IF (r_tim == 0.0_GRID_SR) THEN + r_centr= r_cntr + ENDIF + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + IF (r_dpt <= r_srd) THEN + r_array(i_count) = r_hgt* cos(r_dpt*(r_PI/(2*r_srd))) + END IF + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_cosinebell + +!***************************************************************** + SUBROUTINE slm_initcosinebell(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds) THEN + r_aux(1,i_count)= r_hgt * cos(r_dpt*(GRID_PI/(2*r_rds))) + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcosinebell +!***************************************************************** + SUBROUTINE slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 1.0 + + + RETURN + END SUBROUTINE slm_analyticsol_oneforall + +!***************************************************************** + SUBROUTINE slm_initoneforall(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- + + r_aux= 1.0_GRID_SR + + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux) + + RETURN + END SUBROUTINE slm_initoneforall + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.conv.f90 b/flash2d/src/options/SLM_initial.conv.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1655da973f7bb00f9417b9778359120c7eacd459 --- /dev/null +++ b/flash2d/src/options/SLM_initial.conv.f90 @@ -0,0 +1,299 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylinder +! FUNCTION: +! initialize a grid with values of cylinder test case with +! convergent windfield +! SYNTAX: +! CALL slm_initcylinder(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsol_cylinder +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! for cylinder and convergent windfield +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +!!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. done some work for 2D l. mentrup 2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25_GRID_SR, 0._GRID_SR/) + REAL (KIND = GRID_SR) :: r_hgt=1.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=0.15_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initcylinder(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0_GRID_SR + +!---------- analyticsolution: cylinder + CALL slm_analyticsol_cylinder(p_ghand, r_time, i_arlen, r_array) + + + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + + SUBROUTINE slm_analyticsol_cylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), SAVE :: r_centr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_convpoint + REAL (KIND = GRID_SR), SAVE :: r_rds + REAL (KIND = GRID_SR) :: r_dpt, r_rds_start + REAL (KIND = GRID_SR), SAVE :: r_conc + REAL (KIND = GRID_SR) :: r_dist_new, r_dist_old + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_fac + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- get the variables for the tracer ball + + r_tim = r_time + i_step = p_timestepinfo%i_step + r_convpoint = (/ 0.75_GRID_SR, 0._GRID_SR /) + r_fac = 0.5_GRID_SR*0.363610260832151995e-4_GRID_SR + r_rds_start = 0.15_GRID_SR + + + IF (i_step == 0) THEN + r_centr = r_cntr + r_rds = r_rds_start + r_conc = r_hgt + END IF + + r_conc = r_conc *(r_rds**2) + + r_tmp = r_convpoint - r_centr + r_dist_old = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + + r_centr(1) = r_convpoint(1) - exp(-1*r_fac*(r_tim)) + r_centr(2) = 0. + + r_tmp = r_convpoint - r_centr + r_dist_new = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_rds = r_rds * r_dist_new/r_dist_old + + r_conc = r_conc / (r_rds**2) + + + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- test if is node is in or out of the ball and set r_array + r_array = 0.0 + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + inside: IF(r_dpt <= r_rds) THEN + r_array(i_count)= r_conc + END IF inside + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_cylinder + +!***************************************************************** + SUBROUTINE slm_initcylinder(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5_GRID_SR + inside: IF(r_dpt <= r_rds) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind = (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcylinder + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.diag.f90 b/flash2d/src/options/SLM_initial.diag.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e35eca4dcf257a5dd7344f688ccf850089e9bb46 --- /dev/null +++ b/flash2d/src/options/SLM_initial.diag.f90 @@ -0,0 +1,327 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize ball for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initball +! FUNCTION: +! initialize a grid with values of ball test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. done some work for 2D l. mentrup 2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=& + (/ -0.25_GRID_SR, -0.25_GRID_SR /) + REAL (KIND = GRID_SR) :: r_hgt=1.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=0.15_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initball(p_ghand) + +!---------- initialize concentration one everywhere + +! CALL slm_initoneforall(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0 + +!---------- analyticsolution: ball + CALL slm_analyticsolution_BALL_diag(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: concentration one everywhere +! CALL slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + + RETURN + END SUBROUTINE slm_analyticsolution + +!******************************************************************************* + + SUBROUTINE slm_analyticsolution_BALL_diag(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_fac + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_nnum, i_alct + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time + r_fac = .363610260832151995e-4_GRID_SR + r_centr = r_cntr + + r_centr(1) = r_centr(1) + (0.1_GRID_SR*r_fac * r_time) + r_centr(2) = r_centr(2) + (0.1_GRID_SR*r_fac * r_time) + + IF (r_tim == 0.0_GRID_SR) THEN + r_centr= r_cntr + ENDIF + + +!---------- allocate workspace + + i_nnum= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_nnum), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- test if is node is in or out of the ball and set r_array + r_array = 0.0_GRID_SR + node_loop: DO i_count= 1, i_nnum + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + inside: IF(r_dpt <= r_rds) THEN + r_array(i_count)= r_hgt + END IF inside + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsolution_BALL_diag + +!***************************************************************** + + SUBROUTINE slm_initball(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_nnum, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_nnum= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_nnum), r_coo(GRID_dimension,i_nnum), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_nnum + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5_GRID_SR + inside: IF(r_dpt <= r_rds) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind = (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint= i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initball + +!***************************************************************** + SUBROUTINE slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 1.0 + + + RETURN + END SUBROUTINE slm_analyticsol_oneforall + +!***************************************************************** + SUBROUTINE slm_initoneforall(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- + + r_aux= 1.0_GRID_SR + + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux) + + RETURN + END SUBROUTINE slm_initoneforall + + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.file.f90 b/flash2d/src/options/SLM_initial.file.f90 new file mode 100644 index 0000000000000000000000000000000000000000..bcb20d872c630c1c65c6618a5b6e3d7900a3286a --- /dev/null +++ b/flash2d/src/options/SLM_initial.file.f90 @@ -0,0 +1,507 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR) :: r_hgt=4.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + LOGICAL :: l_circlinput + INTEGER, PARAMETER :: i_ioerr=0 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_iofil= 11 + CHARACTER (len=80) :: a_filrow + INTEGER :: i_iost, i_ioend, i_alct, i_cnt + INTEGER :: i_numcircl, i_tmp + INTEGER, DIMENSION(3) :: i_cntcircl + INTEGER, PARAMETER :: i_coor=1 + INTEGER, PARAMETER :: i_diam=2 + INTEGER, PARAMETER :: i_conc=3 + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coocircl + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_concircl, r_diacircl + +!---------- open file + + open(unit= i_iofil, file= 'Initial.dat', status= 'OLD', action= 'READ', iostat= i_iost) + file_notopen: IF(i_iost /= 0) THEN + write(i_ioerr,*) 'ERROR: Filename: Initial.dat' + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'ERROR: Filename: Initial.dat' + CALL grid_error(56) + END IF file_notopen + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Opened file on unit: ', i_iofil + +!---------- read file entries in a loop + + read_loop: DO + read(i_iofil,2000,iostat=i_ioend) a_filrow + +!---------- if file ended + + file_end: IF(i_ioend /= 0) THEN + close(i_iofil) + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO: Closed file on unit: ', i_iofil + EXIT read_loop + ELSE file_end + +!---------- decide what to DO with line according to first character + + comment_line: IF(a_filrow(1:1) == '#' .or. a_filrow(1:1) == '!') THEN + CYCLE read_loop + ELSE IF(a_filrow(1:11) == 'CIRCLES_INP') THEN comment_line + l_circlinput= .TRUE. + i_cntcircl= 0 + ELSE IF(a_filrow(1:11) == 'FILES_INPUT') THEN comment_line + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_initialvalue]: File input not yet supported' + l_circlinput= .FALSE. + ELSE IF(a_filrow(1:11) == 'NUMBER_OF_C') THEN comment_line + IF(.NOT. l_circlinput) CALL grid_error(57) + read(i_iofil,*) i_numcircl + IF(ALLOCATED(r_coocircl)) DEALLOCATE(r_coocircl) + IF(ALLOCATED(r_concircl)) DEALLOCATE(r_concircl) + IF(ALLOCATED(r_diacircl)) DEALLOCATE(r_diacircl) + ALLOCATE(r_coocircl(GRID_dimension,i_numcircl), stat= i_alct) + IF(i_alct /= 0) CALL grid_error(58) + ALLOCATE(r_concircl(i_numcircl), r_diacircl(i_numcircl), stat= i_alct) + IF(i_alct /= 0) CALL grid_error(58) + ELSE IF(a_filrow(1:11) == 'NUMBER_OF_W') THEN comment_line + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_initialvalue]: File input not yet supported' + IF(l_circlinput) CALL grid_error(57) + ELSE IF(a_filrow(1:11) == 'CIRCLE_COOR') THEN comment_line + IF(.NOT. l_circlinput) CALL grid_error(57) + i_cntcircl(i_coor)= i_cntcircl(i_coor)+ 1 + i_tmp= i_cntcircl(i_coor) + IF(i_tmp > i_numcircl) CALL grid_error(57) + dim_loop: DO i_cnt=1,GRID_dimension + read(i_iofil,*) r_coocircl(i_cnt,i_cntcircl(i_coor)) + END DO dim_loop + ELSE IF(a_filrow(1:11) == 'CIRCLE_DIAM') THEN comment_line + IF(.NOT. l_circlinput) CALL grid_error(57) + i_cntcircl(i_diam)= i_cntcircl(i_diam)+ 1 + i_tmp= i_cntcircl(i_diam) + IF(i_tmp > i_numcircl) CALL grid_error(57) + read(i_iofil,*) r_diacircl(i_cntcircl(i_diam)) + ELSE IF(a_filrow(1:11) == 'CIRCLE_CONC') THEN comment_line + IF(.NOT. l_circlinput) CALL grid_error(57) + i_cntcircl(i_conc)= i_cntcircl(i_conc)+ 1 + i_tmp= i_cntcircl(i_conc) + IF(i_tmp > i_numcircl) CALL grid_error(57) + read(i_iofil,*) r_concircl(i_cntcircl(i_conc)) + ELSE IF(a_filrow(1:11) == 'INPUT_FILE_') THEN comment_line + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_initialvalue]: File input not yet supported' + IF(l_circlinput) CALL grid_error(57) + ELSE IF(a_filrow(1:11) == 'WATERMARK_L') THEN comment_line + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_initialvalue]: File input not yet supported' + IF(l_circlinput) CALL grid_error(57) + ELSE IF(a_filrow(1:11) == 'WATERMARK_C') THEN comment_line + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_initialvalue]: File input not yet supported' + IF(l_circlinput) CALL grid_error(57) + END IF comment_line + + END IF file_end + END DO read_loop + +!---------- initialize cylinders + + CALL initcylndr(p_ghand, i_numcircl, r_coocircl, r_diacircl, r_concircl) + + RETURN + 2000 FORMAT(a80) + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_ino + +!---------- initialize some constants for the slotted cylinder + + r_centr(1)= -cos(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + r_centr(2)= -sin(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + r_ads= r_swd* 0.5_GRID_SR + r_bds= r_srd- r_sln + r_cds= r_srd + r_f1 = (r_rad- r_ads)/ r_rad + r_f2 = (r_rad+ r_ads)/ r_rad + r_p1 = abs(r_centr) + r_xya= sum(r_p1) + IF(r_xya == 0.0_GRID_SR) THEN + r_fc= 0.0_GRID_SR + ELSE + r_fc(1)= -r_centr(2)/ r_xya + r_fc(2)= r_centr(1)/ r_xya + END IF + +!---------- calculate endpoints of the slot + + r_p1= r_f1* r_centr + r_p2= r_f2* r_centr + + r_pa= r_p1+ r_fc* r_bds + r_pb= r_p1+ r_fc* r_cds + r_pc= r_p2+ r_fc* r_cds + r_pd= r_p2+ r_fc* r_bds + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_array(i_count)= r_hgt + l_ino= in_side(r_coo(:,i_count), r_pa, r_pb, r_pc) + IF(l_ino) r_array(i_count)= 0.0_GRID_SR + l_ino= in_side(r_coo(:,i_count), r_pa, r_pc, r_pd) + IF(l_ino) r_array(i_count)= 0.0_GRID_SR + END IF inside + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE initcylndr(p_ghand, i_numcircl, r_coocircl, r_diacircl, r_concircl) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_numcircl + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_numcircl) :: r_coocircl + REAL (KIND = GRID_SR), DIMENSION(i_numcircl) :: r_diacircl, r_concircl + REAL (KIND = GRID_SR) :: r_radsq, r_heigt, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct, i_circ + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + r_aux= 0.0_GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the circles + + circl_loop: DO i_circ= 1, i_numcircl + + r_radsq= r_diacircl(i_circ)* r_diacircl(i_circ) + r_centr= r_coocircl(:,i_circ) + r_heigt= r_concircl(i_circ) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_radsq) THEN + r_aux(1,i_count)= r_aux(1,i_count)+ r_heigt + END IF inside + END DO node_loop + END DO circl_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE initcylndr + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.kaeser.f90 b/flash2d/src/options/SLM_initial.kaeser.f90 new file mode 100644 index 0000000000000000000000000000000000000000..a9bf0805ab29db97a27397f51298b7a1541d8bf4 --- /dev/null +++ b/flash2d/src/options/SLM_initial.kaeser.f90 @@ -0,0 +1,272 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation (when kaeser test case is applied) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslottedcylinder +! FUNCTION: +! initialize a grid with values of sliced sphere test case +! SYNTAX: +! CALL slm_initball(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. kaeser test case implemented l. mentrup 12/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=& + (/ -0.25_GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR) :: r_hgt=1.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=0.15_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initslottedcylinder(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0_GRID_SR + +!---------- analyticsolution: slotted cylinder + CALL slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + + + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR) :: r_rds_kreisbahn + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim, r_time_one_turn + REAL (KIND = GRID_SR) :: r_PI, r_phi + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + + r_tim = r_time +! r_time_one_turn = 1800. * 72 ! Time which the ball needs for one turn around the center +! r_PI = GRID_PI +! r_phi = r_PI ! Phasenwinkel um die Anfangskonstellation zu beruecksichtigen +! r_centr = r_cntr +! r_rds_kreisbahn = 0.25 +! +! r_centr(1) = r_rds_kreisbahn * COS(2*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung +! r_centr(2) = r_rds_kreisbahn * SIN(2*r_PI * r_tim/r_time_one_turn + r_phi) !Beschreibung der Kreisbahn um den Ursprung +! +! r_centr(1) = r_centr(1) + 0.5 ! Ins richtige Koordinatensystem +! r_centr(2) = r_centr(2) + 0.5 ! Ins richtige Koordsys verschieben +! +! IF (r_tim == 0.0) THEN + + r_centr= r_cntr + +! ENDIF + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0_GRID_SR + IF(MODULO(INT(r_tim)/1800,72) == 0) THEN + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + start_pos:IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) < 0.07_GRID_SR .AND. r_tmp(1)< 0.03_GRID_SR .AND. r_tmp(1)>-0.03_GRID_SR)) THEN + r_array(i_count)= r_hgt + END IF start_pos + END DO node_loop + END IF + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_slottedcylinder + +!***************************************************************** + SUBROUTINE slm_initslottedcylinder(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5_GRID_SR + inside: IF(r_dpt <= r_rds .AND. & + .NOT. (r_tmp(2) < 0.07_GRID_SR .AND. r_tmp(1)< 0.03_GRID_SR .AND. r_tmp(1)>-0.03_GRID_SR)) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind = (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint= i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslottedcylinder + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.leveque.f90 b/flash2d/src/options/SLM_initial.leveque.f90 new file mode 100644 index 0000000000000000000000000000000000000000..2f00fa108f26ef55d7864e07eff8ed34edd5fe04 --- /dev/null +++ b/flash2d/src/options/SLM_initial.leveque.f90 @@ -0,0 +1,638 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=1.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + cyl_slot: IF(p_ghand%i_maxlvl < i_lev) THEN + CALL slm_initcylndr(p_ghand) + CALL slm_inithump(p_ghand) + CALL slm_initcone(p_ghand) + ELSE cyl_slot + CALL slm_initslot(p_ghand) + CALL slm_inithump(p_ghand) + CALL slm_initcone(p_ghand) + END IF cyl_slot + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- compute values for slotted cylinder + + CALL compute_slot(i_num, r_coo, r_array) + +!---------- compute values for Gaussian hump + + CALL compute_hump(i_num, r_coo, r_array) + +!---------- compute values for cone + + CALL compute_cone(i_num, r_coo, r_array) + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initslot(p_ghand, l_initialize) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + LOGICAL, OPTIONAL :: l_initialize + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero if requested + + IF(present(l_initialize) .AND. l_initialize) r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + CALL compute_slot(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslot + +!***************************************************************** + SUBROUTINE compute_slot(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + +!---------- initialize some constants for the slotted cylinder + + r_centr= r_cntr + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + + r_nw= r_centr + (/ -r_srd*r_onethird , r_srd*r_twothird /) + r_se= r_centr + (/ r_srd*r_onethird , -r_srd*2 /) + r_ne= r_centr + (/ r_srd*r_onethird , r_srd*r_twothird /) + r_sw= r_centr + (/ -r_srd*r_onethird , -r_srd*2 /) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(i_count)= r_hgt + l_aux= in_side(r_coo(:,i_count), r_nw, r_sw, r_se) + IF(l_aux) r_aux(i_count)= 0.0 + l_aux= in_side(r_coo(:,i_count), r_nw, r_se, r_ne) + IF(l_aux) r_aux(i_count)= 0.0 + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_slot + +!***************************************************************** + SUBROUTINE slm_initcylndr(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= r_srd* r_srd + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcylndr +!***************************************************************** + SUBROUTINE slm_inithump(p_ghand, l_initialize) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + LOGICAL, OPTIONAL :: l_initialize + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux, & + r_nodecoordinates= r_coo) + +!---------- initialize values to zero if requested + + IF(present(l_initialize) .AND. l_initialize) r_aux= 0._GRID_SR + +!---------- compute values for Gaussian hump + + CALL compute_hump(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_inithump +!***************************************************************** + SUBROUTINE compute_hump(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_dpt, r_rad, r_pr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr, r_tmp + +!---------- initialize some constant for the slotted cylinder + + r_rds= r_srd* r_srd + r_centr= r_hcntr + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_rad= min(sqrt(r_dpt),r_srd)/r_srd + r_pr= GRID_PI* r_rad + r_aux(i_count)= 0.25_GRID_SR* (1+ cos(r_pr)) + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_hump + +!***************************************************************** + SUBROUTINE slm_initcone(p_ghand, l_initialize) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + LOGICAL, OPTIONAL :: l_initialize + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + i_valind= (/ GRID_tracer /) + CALL grid_getinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux, & + r_nodecoordinates= r_coo) + +!---------- initialize values to zero if requested + + IF(present(l_initialize) .AND. l_initialize) r_aux= 0._GRID_SR + +!---------- compute values for cone + + CALL compute_cone(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcone +!***************************************************************** + SUBROUTINE compute_cone(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count + REAL (KIND = GRID_SR) :: r_rds, r_dpt, r_rad, r_pr + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr, r_tmp + +!---------- initialize some constant for the slotted cylinder + + r_rds= r_srd* r_srd + r_centr= r_ccntr + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_rad= min(sqrt(r_dpt),r_srd) + r_aux(i_count)= -(r_hgt/r_srd)* r_rad + r_hgt + END IF inside + END DO node_loop + + RETURN + END SUBROUTINE compute_cone + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.m3.f90 b/flash2d/src/options/SLM_initial.m3.f90 new file mode 100644 index 0000000000000000000000000000000000000000..36b70bb77e337a3797d7aa1bfd49d121e76ba074 --- /dev/null +++ b/flash2d/src/options/SLM_initial.m3.f90 @@ -0,0 +1,363 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initm3 +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initm3(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR) :: r_hgt=1.0 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initm3(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- loop over the nodes + + r_array(1:i_arlen)= 0.0_GRID_SR + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initm3(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_DR) :: r_rds1, r_rds2 + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_p1, r_p2, r_p3, & + r_pa, r_pb, r_pc, r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_DR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_DR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_DR), PARAMETER :: r_dia1=0.18 + REAL (KIND = GRID_DR), PARAMETER :: r_dia2=0.08 + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constants for the slotted cylinder + + r_centr= (/ 0.3_GRID_SR, -0.1_GRID_SR /) + r_rds1= r_dia1* r_dia1 + r_rds2= r_dia2* r_dia2 + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(59) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0 + +!---------- the M + + r_pa= (/ -0.45_GRID_SR, 0.25_GRID_SR /); r_pb= (/ -0.45_GRID_SR, -0.25_GRID_SR /); r_pc= (/ -0.35_GRID_SR, 0.15_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ -0.45_GRID_SR, -0.25_GRID_SR /); r_pb= (/ -0.35_GRID_SR, -0.25_GRID_SR /); r_pc= (/ -0.35_GRID_SR, 0.15_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ -0.45_GRID_SR, 0.25_GRID_SR /); r_pb= (/ -0.2_GRID_SR, 0.0_GRID_SR /); r_pc= (/ 0.05_GRID_SR, 0.25_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_p1= (/ -0.45_GRID_SR, 0.35_GRID_SR /); r_p2= (/ -0.2_GRID_SR, 0.1_GRID_SR /); r_p3= (/ 0.05_GRID_SR, 0.35_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_p1, r_p2, r_p3)) r_aux(1,i_count)= 0.0 + r_pa= (/ 0.05_GRID_SR, 0.25_GRID_SR /); r_pb= (/ -0.05_GRID_SR, 0.15_GRID_SR /); r_pc= (/ 0.05_GRID_SR, -0.25_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ -0.05_GRID_SR, -0.25_GRID_SR /); r_pb= (/ 0.05_GRID_SR, -0.25_GRID_SR /); r_pc= (/ -0.05_GRID_SR, 0.15_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + +!---------- the 3 + + r_pa= (/ 0.15_GRID_SR, 0.15_GRID_SR /); r_pb= (/ 0.45_GRID_SR, 0.15_GRID_SR /); r_pc= (/ 0.15_GRID_SR, 0.25_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ 0.15_GRID_SR, 0.25_GRID_SR /); r_pb= (/ 0.45_GRID_SR, 0.15_GRID_SR /); r_pc= (/ 0.45_GRID_SR, 0.25_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ 0.25_GRID_SR, 0.05_GRID_SR /); r_pb= (/ 0.35_GRID_SR, 0.05_GRID_SR /); r_pc= (/ 0.35_GRID_SR, 0.15_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_pa= (/ 0.35_GRID_SR, 0.05_GRID_SR /); r_pb= (/ 0.45_GRID_SR, 0.15_GRID_SR /); r_pc= (/ 0.35_GRID_SR, 0.15_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_pa, r_pb, r_pc)) r_aux(1,i_count)= r_hgt + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + inside: IF(dot_product(r_tmp, r_tmp) < r_rds1) THEN + r_aux(1,i_count)= r_hgt + IF(dot_product(r_tmp, r_tmp) < r_rds2) r_aux(1,i_count)= 0.0_GRID_SR + r_p1= (/ 0.06_GRID_SR, -0.25_GRID_SR /); r_p2= (/ 0.3_GRID_SR, -0.1_GRID_SR /); r_p3= (/ 0.06_GRID_SR, 0.05_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_p1, r_p2, r_p3)) r_aux(1,i_count)= 0.0_GRID_SR + r_p1= (/ 0.28_GRID_SR, -0.1_GRID_SR /); r_p2= (/ 0.28_GRID_SR, 0.14_GRID_SR /); r_p3= (/ 0.06_GRID_SR, 0.05_GRID_SR /) + IF(in_side(r_coo(:,i_count), r_p1, r_p2, r_p3)) r_aux(1,i_count)= 0.0_GRID_SR + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initm3 + + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.nowind.f90 b/flash2d/src/options/SLM_initial.nowind.f90 new file mode 100644 index 0000000000000000000000000000000000000000..6d3b90b8ec5ac226e5a23b89db64aa28e2943acf --- /dev/null +++ b/flash2d/src/options/SLM_initial.nowind.f90 @@ -0,0 +1,496 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslottedcylinder +! FUNCTION: +! initialize a grid with values of sliced sphere test case +! SYNTAX: +! CALL slm_initslottedcylinder(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcosinebell +! FUNCTION: +! initialize a grid with values of a cosine bell +! (convergence test case) +! SYNTAX: +! CALL slm_initcosinebell(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for three dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_slottedcylinder +! FUNCTION: +! calculates the 'analytic solution' for the slotted cylinder with +! a circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_slottedcylinder(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsol_cosinebell +! FUNCTION: +! calculates the 'analytic solution' for a cosine bell with +! circular windfield 1 revolution/day +! SYNTAX: +! CALL slm_analyticsol_cosinebell(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. slotted cylinder test case l. mentrup 12/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=& + (/ -0.25_GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR) :: r_hgt=4.0_GRID_SR + REAL (KIND = GRID_SR) :: r_srd=0.15_GRID_SR + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initslottedcylinder(p_ghand) + +!---------- initialize some constant for the cosine bell test case + +! CALL slm_initcosinebell(p_ghand) + +!---------- initialize concentration one everywhere + +! CALL slm_initoneforall(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0_GRID_SR + +!---------- analyticsolution: cosinebell +! CALL slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: ball + CALL slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- analyticsolution: concentration one everywhere + +! CALL slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_analyticsol_slottedcylinder(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_PI + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + r_centr = r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- nowind testcase! + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + IF(r_dpt <= r_rds .AND. .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)<=0.03_GRID_SR .AND. r_tmp(1)>=-0.03_GRID_SR))) THEN + r_array(i_count)= r_hgt + END IF + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_slottedcylinder + +!***************************************************************** + SUBROUTINE slm_initslottedcylinder(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds .AND. & + .NOT.(r_tmp(2) <= 0.07_GRID_SR .AND. (r_tmp(1)>=-0.03_GRID_SR .AND. r_tmp(1)<=0.03_GRID_SR))) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslottedcylinder +!***************************************************************** + SUBROUTINE slm_analyticsol_cosinebell(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + REAL (KIND = GRID_SR), INTENT(in) :: r_time + REAL (KIND = GRID_SR) :: r_tim + REAL (KIND = GRID_SR) :: r_PI + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + + + +!---------- initialize some constant for the tracer ball + + r_rds = 0.15_GRID_SR + +!---------- here is the crux: where is the center of the ball at time r_time + + r_PI = GRID_PI + r_centr= r_cntr + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 0.0 + node_loop: DO i_count= 1, i_num + r_tmp(:) = r_coo(:,i_count) - r_centr(:) + r_dpt = dot_product(r_tmp, r_tmp)**0.5_GRID_SR + r_array(i_count) = 0. + IF (r_dpt <= r_srd) THEN + r_array(i_count) = r_hgt* cos(r_dpt*(r_PI/(2*r_srd))) + END IF + END DO node_loop + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_cosinebell + +!***************************************************************** + SUBROUTINE slm_initcosinebell(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the sliced sphere + + r_rds= 0.15_GRID_SR + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp)**0.5 + inside: IF(r_dpt <= r_rds) THEN + r_aux(1,i_count)= r_hgt * cos(r_dpt*(GRID_PI/(2*r_rds))) + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcosinebell +!***************************************************************** + SUBROUTINE slm_analyticsol_oneforall(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + INTEGER :: i_count, i_num, i_alct, i_step + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + + + +!---------- for every quarter revolt: test if is node in or out of the sliced sphere and set r_array + r_array = 1.0 + + + RETURN + END SUBROUTINE slm_analyticsol_oneforall + +!***************************************************************** + SUBROUTINE slm_initoneforall(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + INTEGER, DIMENSION(1) :: i_valind + + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- + + r_aux= 1.0_GRID_SR + + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux) + + RETURN + END SUBROUTINE slm_initoneforall + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.slot.f90 b/flash2d/src/options/SLM_initial.slot.f90 new file mode 100644 index 0000000000000000000000000000000000000000..241865294c8d61ae270048e2192165c6de81df08 --- /dev/null +++ b/flash2d/src/options/SLM_initial.slot.f90 @@ -0,0 +1,495 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=4.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + cyl_slot: IF(p_ghand%i_maxlvl < i_lev) THEN + CALL slm_initcylndr(p_ghand) + ELSE cyl_slot + CALL slm_initslot(p_ghand) + END IF cyl_slot + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- initialize some constants for the slotted cylinder + + r_centr(1)= -cos(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + r_centr(2)= -sin(r_fac* r_time)* 0.25_GRID_SR ! <--- based on 2D + + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + r_ads= r_swd* 0.5_GRID_SR + r_bds= r_srd- r_sln + r_cds= r_srd + r_f1 = (r_rad- r_ads)/ r_rad + r_f2 = (r_rad+ r_ads)/ r_rad + r_p1 = abs(r_centr) + r_xya= sum(r_p1) + IF(r_xya == 0.0_GRID_SR) THEN + r_fc= 0.0_GRID_SR + ELSE + r_fc(1)= -r_centr(2)/ r_xya + r_fc(2)= r_centr(1)/ r_xya + END IF + +!---------- calculate endpoints of the slot + + r_p1= r_f1* r_centr + r_p2= r_f2* r_centr + + r_pa= r_p1+ r_fc* r_bds + r_pb= r_p1+ r_fc* r_cds + r_pc= r_p2+ r_fc* r_cds + r_pd= r_p2+ r_fc* r_bds + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_array(i_count)= 0.0 + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_array(i_count)= r_hgt + l_aux= in_side(r_coo(:,i_count), r_pa, r_pb, r_pc) + IF(l_aux) r_array(i_count)= 0.0 + l_aux= in_side(r_coo(:,i_count), r_pa, r_pc, r_pd) + IF(l_aux) r_array(i_count)= 0.0 + END IF inside + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initslot(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constants for the slotted cylinder + + r_centr= r_cntr + r_rds= r_srd* r_srd + r_ras= dot_product(r_centr, r_centr) + r_rad= sqrt(r_ras) + r_ads= r_swd* 0.5_GRID_SR + r_bds= r_srd- r_sln + r_cds= r_srd + r_f1 = (r_rad- r_ads)/ r_rad + r_f2 = (r_rad+ r_ads)/ r_rad + r_p1 = abs(r_centr) + r_xya= sum(r_p1) + IF(r_xya == 0.0_GRID_SR) THEN + r_fc= 0.0_GRID_SR + ELSE + r_fc(1)= -r_centr(2)/ r_xya + r_fc(2)= r_centr(1)/ r_xya + END IF + +!---------- calculate endpoints of the slot + + r_p1= r_f1* r_centr + r_p2= r_f2* r_centr + + r_pa= r_p1+ r_fc* r_bds + r_pb= r_p1+ r_fc* r_cds + r_pc= r_p2+ r_fc* r_cds + r_pd= r_p2+ r_fc* r_bds + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(1,i_count)= r_hgt + l_aux= in_side(r_coo(:,i_count), r_pa, r_pb, r_pc) + IF(l_aux) r_aux(1,i_count)= 0.0 + l_aux= in_side(r_coo(:,i_count), r_pa, r_pc, r_pd) + IF(l_aux) r_aux(1,i_count)= 0.0 + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initslot + +!***************************************************************** + SUBROUTINE slm_initcylndr(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_centr + REAL (KIND = GRID_SR) :: r_rds, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + r_rds= r_srd* r_srd + r_centr= r_cntr + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + r_tmp(:) = r_coo(:,i_count)- r_centr(:) + r_dpt= dot_product(r_tmp, r_tmp) + inside: IF(r_dpt < r_rds) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initcylndr + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.tum.f90 b/flash2d/src/options/SLM_initial.tum.f90 new file mode 100644 index 0000000000000000000000000000000000000000..7d816a61e0e1f56e19979d4e488f5f97a301bd87 --- /dev/null +++ b/flash2d/src/options/SLM_initial.tum.f90 @@ -0,0 +1,223 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initbar +! FUNCTION: +! initialize a grid with values of a bar +! SYNTAX: +! CALL slm_initbar(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ -0.25, 0.0 /) + REAL (KIND = GRID_SR) :: r_hgt=4.0 + REAL (KIND = GRID_SR) :: r_srd=0.15 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initbar(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- dummy routine + + r_array= 0.0_GRID_SR + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_initbar(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_DR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_DR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: p_1, p_2, p_3, p_4, & + p_5, p_6, p_7, p_8, p_9, p_10, p_11, p_12, p_13, p_14, p_15, p_16 + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constants for the Logo + + p_1= (/ -0.375_GRID_SR, 0.0375_GRID_SR /) + p_2= (/ -0.35_GRID_SR, -0.0625_GRID_SR /) + p_3= (/ -0.325_GRID_SR, 0.0375_GRID_SR /) + p_4= (/ -0.3_GRID_SR, -0.0375_GRID_SR /) + p_5= (/ -0.3_GRID_SR, -0.0625_GRID_SR /) + p_6= (/ -0.275_GRID_SR, 0.0375_GRID_SR /) + p_7= (/ -0.275_GRID_SR, 0.0625_GRID_SR /) + p_8= (/ -0.25_GRID_SR, 0.0375_GRID_SR /) + p_9= (/ -0.25_GRID_SR, -0.0375_GRID_SR /) + p_10= (/ -0.225_GRID_SR, -0.0375_GRID_SR /) + p_11= (/ -0.225_GRID_SR, 0.0375_GRID_SR /) + p_12= (/ -0.2_GRID_SR, -0.0625_GRID_SR /) + p_13= (/ -0.175_GRID_SR, 0.0375_GRID_SR /) + p_14= (/ -0.15_GRID_SR, -0.0625_GRID_SR /) + p_15= (/ -0.125_GRID_SR, 0.0375_GRID_SR /) + p_16= (/ -0.125_GRID_SR, 0.0625_GRID_SR /) + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(51) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(1,i_count)= 0.0_GRID_SR + inside: IF(inoutrect(r_coo(:,i_count),p_1,p_7) .OR. & + inoutrect(r_coo(:,i_count),p_2,p_3) .OR. & + inoutrect(r_coo(:,i_count),p_4,p_6) .OR. & + inoutrect(r_coo(:,i_count),p_5,p_10) .OR. & + inoutrect(r_coo(:,i_count),p_9,p_11) .OR. & + inoutrect(r_coo(:,i_count),p_8,p_16) .OR. & + inoutrect(r_coo(:,i_count),p_12,p_13) .OR. & + inoutrect(r_coo(:,i_count),p_14,p_15)) THEN + r_aux(1,i_count)= r_hgt + END IF inside + END DO node_loop + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initbar + +!***************************************************************** + FUNCTION inoutrect(r_coo, r_sw, r_ne) RESULT (l_inout) + +!---------- local declarations + + IMPLICIT NONE + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension), INTENT(in) :: r_coo, r_sw, r_ne + LOGICAL :: l_inout + +!---------- initialize output + + l_inout= .FALSE. + + inside: IF((r_coo(1)>r_sw(1) .AND. r_coo(1)<r_ne(1)) .AND. & + (r_coo(2)>r_sw(2) .AND. r_coo(2)<r_ne(2))) THEN !! CAUTION 2D ONLY !! + l_inout= .TRUE. + END IF inside + + END FUNCTION inoutrect + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.vortex.f90 b/flash2d/src/options/SLM_initial.vortex.f90 new file mode 100644 index 0000000000000000000000000000000000000000..24f889ff61fd4a51557fcf049e126796aee8900b --- /dev/null +++ b/flash2d/src/options/SLM_initial.vortex.f90 @@ -0,0 +1,272 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize values for semi-Lagrangian advection +! provides slm_analyticsolution to evaluate error and mass +! conservation (when vortex test case is applied) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initvortex +! FUNCTION: +! initialize a grid with values of initial vortex conditions +! see: Doswell 1984, Nair 2006 +! SYNTAX: +! CALL slm_initvortex(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the analytic solution to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version l.mentrup 12/06 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_center = (/ 0._GRID_SR, 0._GRID_SR /) + REAL (KIND = GRID_SR) :: r_delta = 0.05_GRID_SR ! controls the width of the decay from value 2 to value 0 + REAL (KIND = GRID_SR) :: r_vnot = 2.598_GRID_SR ! tangential velocity such that omega < 1. + REAL (KIND = GRID_SR) :: r_scale = 86400._GRID_SR ! scale on one day + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize vortex + CALL slm_initvortex(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + +!---------- this is a dummy +! r_array= 0.0_GRID_SR + +!---------- analyticsolution: vortex + CALL slm_analyticsol_vortex(p_ghand, r_time, i_arlen, r_array) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + SUBROUTINE slm_analyticsol_vortex(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_array + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + REAL (KIND = GRID_SR) :: r_x, r_y, r_xc, r_yc + REAL (KIND = GRID_SR) :: r_r + REAL (KIND = GRID_SR) :: r_dlt ! controls the width of the decay from value 2 to value 0 + REAL (KIND = GRID_SR) :: r_t + REAL (KIND = GRID_SR) :: r_tanh + REAL (KIND = GRID_SR) :: r_vt, r_omg + REAL (KIND = GRID_SR) :: r_eps = 1.E-6_GRID_SR + REAL (KIND = GRID_SR) :: r_twopi ! scale the domain from [-0.5,0,5]to [-Pi, Pi] + + INTEGER :: i_count, i_num, i_alct + +!---------- initialize some values + r_twopi = GRID_PI * 2._GRID_SR + + + r_xc = r_center(1) * r_twopi + r_yc = r_center(2) * r_twopi + r_dlt = r_delta + +!---------- here is the crux: what is the distribution at time r_time + + r_t = r_time + write(*,*) r_t + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_coo(GRID_dimension,i_num), stat=i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute analytic solution (ref. to Nair 2006, Appl. Num. Math.) + + node_loop: DO i_count= 1, i_num + r_x = r_coo(1,i_count) * r_twopi + r_y = r_coo(2,i_count) * r_twopi + + r_r = twonorm((/r_x - r_xc, r_y - r_yc/)) + + IF (r_r <= r_eps) THEN + r_array(i_count) = 1._GRID_SR + ELSE + r_tanh = tanh(r_r) + r_vt = (1._GRID_SR - r_tanh*r_tanh) * r_tanh * r_vnot * GRID_PI / r_scale + r_omg = r_vt / r_r + r_array(i_count) = tanh( ((r_y - r_yc)/r_dlt * cos(r_omg * r_t)) - & + ((r_x - r_xc)/r_dlt * sin(r_omg * r_t)) ) + 1._GRID_SR + END IF + END DO node_loop + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + + RETURN + END SUBROUTINE slm_analyticsol_vortex +!***************************************************************** + SUBROUTINE slm_initvortex(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + REAL (KIND = GRID_SR) :: r_y + REAL (KIND = GRID_SR) :: r_dlt ! controls the width of the decay from value 2 to value 0 + REAL (KIND = GRID_SR) :: r_twopi ! scale the domain from [-0.5,0,5]to [-Pi, Pi] + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- initialize some constant for the slotted cylinder + + + r_dlt = r_delta + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(55) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- loop over the nodes + + r_twopi = GRID_PI * 2._GRID_SR + + node_loop: DO i_count= 1, i_num + r_y = r_coo(2, i_count) * r_twopi + r_aux(1,i_count)= tanh((r_y - r_center(2)) / r_dlt) + 1._GRID_SR + END DO node_loop + +!---------- update grid information + + i_valind = (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint= i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initvortex +!***************************************************************** + FUNCTION twonorm(r_vector) RESULT(r_nrm) + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_vector + REAL (KIND = GRID_SR) :: r_nrm + + INTEGER :: i_cnt + + r_nrm = 0._GRID_SR + r_nrm = dot_product(r_vector,r_vector) + r_nrm = sqrt(r_nrm) + + END FUNCTION twonorm + + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.xmas.f90 b/flash2d/src/options/SLM_initial.xmas.f90 new file mode 100644 index 0000000000000000000000000000000000000000..09b4819e7b6e9ee4d9f5e7a611565ada17320a81 --- /dev/null +++ b/flash2d/src/options/SLM_initial.xmas.f90 @@ -0,0 +1,415 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=0.70 + REAL (KIND = GRID_SR) :: r_hgt2=0.68 + REAL (KIND = GRID_SR) :: r_srd=0.027 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initxmas(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- compute initial values for a christmas tree + + CALL compute_xmas(i_num, r_coo, r_array) + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initxmas(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero + + r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + CALL compute_xmas(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initxmas + +!***************************************************************** + SUBROUTINE compute_xmas(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count, j_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 3, 6) :: r_xmastree + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 6) :: r_xmasball + +!---------- initialize coordinates of xmas tree triangles + + r_xmastree(:,:,1) = RESHAPE( (/-0.1, 0.3, 0.1, 0.3, 0.0, 0.4 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,2) = RESHAPE( (/-0.2, 0.15, 0.2, 0.15, 0.0, 0.35 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,3) = RESHAPE( (/-0.3, -0.05, 0.3, -0.05, 0.0, 0.25 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,4) = RESHAPE( (/-0.4, -0.3, 0.4, -0.3, 0.0, 0.1 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,5) = RESHAPE( (/-0.05, -0.3, -0.05, -0.4, 0.05, -0.4 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,6) = RESHAPE( (/-0.05, -0.3, 0.05, -0.4, 0.05, -0.3 /), (/GRID_dimension, 3 /)) + r_xmasball(:,1) = (/ 0.02, 0.25 /) + r_xmasball(:,2) = (/-0.11, 0.06 /) + r_xmasball(:,3) = (/ 0.1, 0.055 /) + r_xmasball(:,4) = (/-0.18, -0.21 /) + r_xmasball(:,5) = (/ 0.2, -0.17 /) + r_xmasball(:,6) = (/ -0.015, -0.125 /) + r_rds= r_srd*r_srd + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + DO j_count= 1, 6 + inside: IF(in_side(r_coo(:,i_count), r_xmastree(:,1,j_count), & + r_xmastree(:,2,j_count), r_xmastree(:,3,j_count))) THEN + r_aux(i_count)= r_hgt2 + END IF inside + END DO + DO j_count= 1, 6 + r_tmp= r_coo(:,i_count)- r_xmasball(:,j_count) + inball: IF(dot_product(r_tmp,r_tmp)<r_rds) THEN + r_aux(i_count)= r_hgt + END IF inball + END DO + END DO node_loop + + RETURN + END SUBROUTINE compute_xmas + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.xmasElk.f90 b/flash2d/src/options/SLM_initial.xmasElk.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d33ece370063df22ad1a04527620c76709aaf636 --- /dev/null +++ b/flash2d/src/options/SLM_initial.xmasElk.f90 @@ -0,0 +1,457 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=0.70 + REAL (KIND = GRID_SR) :: r_hgt2=0.68 + REAL (KIND = GRID_SR) :: r_srd=0.027 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + + INTEGER (KIND = GRID_SI), DIMENSION(:,:), ALLOCATABLE :: i_elch + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initxmas(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- compute initial values for a christmas tree + +! CALL compute_xmas(i_num, r_coo, r_array) + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initxmas(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + INTEGER :: i_num, i_alct, & + i_iofil, i_iost, i_ioend, i_cols, i_rows, i_c, i_r, i_charcnt + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + CHARACTER (len=80) :: a_filrow + CHARACTER (len=70) :: c_tmp + +!---------- open input file and read data + +! IF(.NOT. allocated(i_elch)) THEN + ! write(*,*) 'DEBUG: entering' + i_iofil=13 + open(unit= i_iofil, file= 'elch.pbm', status= 'OLD', & + action= 'READ', iostat= i_iost) +!---------- first two lines contain meta-data... + read(i_iofil,2000,iostat=i_ioend) a_filrow +! write(*,*) a_filrow, i_ioend + read(i_iofil,2000,iostat=i_ioend) a_filrow + ! write(*,*) a_filrow, i_ioend + file_end: IF(i_ioend /= 0) THEN + close(i_iofil) + CALL grid_error(c_error='[slm_initxmas]: Elch file seems empty or corrupted...') + ENDIF file_end + read(i_iofil,*) i_cols, i_rows +!---------- allocate elch array + allocate(i_elch(i_rows,i_cols), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(c_error='[slm_initxmas]: Elch array not allocated...') + END IF + read(i_iofil,2010,iostat=i_ioend) c_tmp + i_charcnt = 0 + DO i_r=1,i_rows + DO i_c=1,i_cols + i_charcnt= i_charcnt+1 + IF(i_charcnt > 70) THEN + read(i_iofil,2010,iostat=i_ioend) c_tmp + i_charcnt= 1 + END IF + read(c_tmp(i_charcnt:i_charcnt),*) i_elch(i_r, i_c) + i_elch(i_r,i_c)= 1 - i_elch(i_r, i_c) + END DO + END DO +! write(19,1000) ((i_elch(i_r, i_c), i_r=1,i_rows), i_c=1,i_cols) +! read(i_iofil,*) ((i_elch(i_r, i_c), i_r=1,i_rows), i_c=1,i_cols) + 1000 FORMAT(70i1) + CLOSE(i_iofil) +! END IF !allocated i_elch + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero + + r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + CALL compute_xmas(i_num, i_cols, i_rows, i_elch, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo, i_elch) + 2000 FORMAT(a80) + 2010 FORMAT(a70) + + RETURN + END SUBROUTINE slm_initxmas + +!***************************************************************** + SUBROUTINE compute_xmas(i_num, i_cols, i_rows, i_elk, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER (KIND = GRID_SI) :: i_num + INTEGER (KIND = GRID_SI) :: i_cols + INTEGER (KIND = GRID_SI) :: i_rows + INTEGER (KIND = GRID_SI), DIMENSION(:,:) :: i_elk + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count, j_count, i_i, i_j + REAL (KIND = GRID_SR) :: r_dx, r_dy, & + r_left, r_rigt, r_up, r_down, r_rds + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr + LOGICAL :: l_aux + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 3, 6) :: r_xmastree + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension) :: r_xmasball + +!---------- initialize coordinates of xmas tree triangles + + r_left= minval(r_coo(1,:)) + r_rigt= maxval(r_coo(1,:)) + r_up= maxval(r_coo(2,:)) + r_down= minval(r_coo(2,:)) + r_dx= real((i_cols-1),GRID_SR)/(r_rigt-r_left) + r_dy= real((i_rows-1),GRID_SR)/(r_up- r_down) + r_xmasball = (/ 0.0, 0.0 /) + r_rds= r_srd*r_srd + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + i_i= int(((r_coo(1,i_count)+0.5)* r_dx)) + 1 + i_j= int(((r_coo(2,i_count)+0.5)* r_dy)) + 1 + r_aux(i_count) = real((i_elk(i_j, i_i)), GRID_SR) + r_tmp= r_coo(:,i_count)- r_xmasball + IF(dot_product(r_tmp,r_tmp)<r_rds) THEN + IF(r_aux(i_count) < 1.0) & + r_aux(i_count)= 1.25 + END IF + END DO node_loop + + RETURN + END SUBROUTINE compute_xmas + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_initial.xmasanim.f90 b/flash2d/src/options/SLM_initial.xmasanim.f90 new file mode 100644 index 0000000000000000000000000000000000000000..e6590cc27a7faf8f81d7220035a6767f5dbcae98 --- /dev/null +++ b/flash2d/src/options/SLM_initial.xmasanim.f90 @@ -0,0 +1,428 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_initial +! FUNCTION: +! initialize slotted cylinder for semi-Lagrangian advection +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_initialvalues +! FUNCTION: +! initialize a grid with values +! SYNTAX: +! CALL slm_initialvalues(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initslot +! FUNCTION: +! initialize a grid with values of slotted cylinder test case +! SYNTAX: +! CALL slm_initslot(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_analyticsolution +! FUNCTION: +! calculates the 'analytic solution' to compare with in diagnostics +! SYNTAX: +! CALL slm_analyticsolution(grid, real, int, real.arr) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_time: model time REAL +! i_arlen: array length for values array INTEGER +! ON OUTPUT: +! r_array: values at gridpoints REAL +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! slm_initcylndr +! FUNCTION: +! initialize a grid with values of a cylinder test case +! SYNTAX: +! CALL slm_initcylndr(grid) +! ON INPUT: +! p_ghand: grid handle TYPE (grid_handle) +! r_centr: coordinates of cyl. centre REAL +! ON OUTPUT: +! p_ghand: grid handle TYPE (grid_handle) +! CALLS: +! +! COMMENTS: +! the routine is made for two dimensions only +! +!----------------------------------------------------------------- +! +! NAME: +! in_side +! FUNCTION: +! checks, if a given point (x,y) lies within a given triangle +! SYNTAX: +! logical= in_side(real.arr, real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord: coordinate array REAL +! r_node1: node1 of triangle REAL +! r_node2: node2 of triangle REAL +! r_node3: node3 of triangle REAL +! ON OUTPUT: +! l_in: .true. if r_coord \in p_elem logical +! CALLS: +! +! COMMENTS: +! this routine decides whether a point lies in or out of a +! triangle. this is done with the following approach: +! calculate the area for the given triangle and for the +! three triangles resulting from drawing lines from the given +! point to all three triangle nodes. +! if the sum of the areas of those three trianlges exceeds +! the area of the given trianlge, the the point lies outside +! of it. +! for calculation of the areas following formula is used: +! (Herons formula(?)) +! +! A = sqrt(s* (s- a)* (s- b)* (s- c)), +! +! where s= 1/2* (a+ b+ c) +! a, b, c sides. +! +! in order to calculate the sidelengths |x-y|= sqrt(x**2-y**2) +! the complex absolute value intrinsic function is used. +! hopefully this fuction is faster than using sqrt and +! power-of-two instead. +! +! internally double precision is used in this function, because +! machine precision is crucial when a coordinate pair appears +! near the edge or corner of an element. +! +!----------------------------------------------------------------- +! +! NAME: +! dc_area +! FUNCTION: +! calculate area of a triangle (in a plain) in double precision +! SYNTAX: +! real= dc_area(real.arr, real.arr, real.arr) +! ON INPUT: +! r_coord1: node1 of triangle REAL +! r_coord2: node2 of triangle REAL +! r_coord3: node3 of triangle REAL +! ON OUTPUT: +! r_area: area of triangle REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_initialvalues, slm_analyticsolution +! COMMENTS: +! +! USES: +! MISC_globalparam, MISC_error, GRID_api +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/97 +! 2. names changed j. behrens 7/97 +! 3. changed to use GRID_api j. behrens 11/97 +! 4. changed interfaces j. behrens 12/97 +! 5. compliant to amatos 1.0 j. behrens 12/2000 +! 6. compliant to amatos 1.2 j. behrens 3/2002 +! 7. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_initial + USE FLASH_parameters + USE GRID_api + PRIVATE + PUBLIC slm_initialvalues, slm_analyticsolution + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_cntr=(/ 0.5, 0.75 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_hcntr=(/ 0.25, 0.5 /) + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_ccntr=(/ 0.5, 0.25 /) + REAL (KIND = GRID_SR) :: r_hgt=0.70 + REAL (KIND = GRID_SR) :: r_hgt2=0.68 + REAL (KIND = GRID_SR) :: r_srd=0.016 + REAL (KIND = GRID_SR) :: r_sln=0.22 + REAL (KIND = GRID_SR) :: r_swd=0.06 + REAL (KIND = GRID_SR) :: r_onethird=1./3. + REAL (KIND = GRID_SR) :: r_twothird=2./3. + CONTAINS +!***************************************************************** + SUBROUTINE slm_initialvalues(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + INTEGER :: i_lev= 6 + +!---------- initialize some constant for the slotted cylinder + + CALL slm_initxmas(p_ghand) + + RETURN + END SUBROUTINE slm_initialvalues +!***************************************************************** + SUBROUTINE slm_analyticsolution(p_ghand, r_time, i_arlen, r_array) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + REAL (KIND = GRID_SR), INTENT(in) :: r_time + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(inout) :: r_array + REAL (KIND = GRID_SR) :: r_fac=.363610260832151995e-4 + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_ads, r_bds, r_cds, r_f1, r_f2, r_xya, r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fc, r_p1, r_p2, & + r_pa, r_pb, r_pc, r_pd, r_tmp, r_centr + INTEGER :: i_count, i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + LOGICAL :: l_aux + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + IF(i_arlen /= i_num) THEN + CALL grid_error(52) + END IF + + ALLOCATE(r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(53) + END IF + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + + +!---------- compute initial values for a christmas tree + + CALL compute_xmas(i_num, r_coo, r_array) + + +!---------- deallocate workspace + + DEALLOCATE(r_coo) + + RETURN + END SUBROUTINE slm_analyticsolution + +!***************************************************************** + FUNCTION dc_area(r_coord1, r_coord2, r_coord3) RESULT (r_area) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord1, r_coord2, r_coord3 + REAL (KIND = GRID_DR) :: r_area + REAL (KIND = GRID_DR) :: r_c + REAL (KIND = GRID_DR), DIMENSION(GRID_dimension) :: r_a, r_b + INTEGER :: i_cnt + +!---------- calculate vector components + + dim_loop: DO i_cnt=1, GRID_dimension + r_a(i_cnt)= REAL((r_coord2(i_cnt)- r_coord1(i_cnt)),GRID_DR) + r_b(i_cnt)= REAL((r_coord3(i_cnt)- r_coord1(i_cnt)),GRID_DR) + END DO dim_loop + +!---------- calculate components (a,b,c) of cross product vector + + r_c= (r_a(1)* r_b(2)- r_a(2)* r_b(1)) + +!---------- calculate area + + r_area= abs(r_c)* 0.5_GRID_DR + + RETURN + END FUNCTION dc_area + +!***************************************************************** + FUNCTION in_side(r_coord, r_node1, r_node2, r_node3) RESULT (l_in) + +!---------- local declarations + + IMPLICIT NONE + + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_node1, r_node2, r_node3 + LOGICAL :: l_in + REAL (KIND = GRID_DR) :: r_sum, r_f, r_f1, r_f2, r_f3 + REAL (KIND = GRID_DR) :: r_eps + +!---------- set in_side value to out + + l_in= .FALSE. + +!---------- set epsilon (machine precision) + + r_eps= GRID_eps + +!---------- calculate areas (f, f1, f2, f3) + + r_f = dc_area(r_node1, r_node2, r_node3) + r_f1= dc_area(r_coord, r_node2, r_node3) + r_f2= dc_area(r_coord, r_node1, r_node2) + r_f3= dc_area(r_coord, r_node1, r_node3) + +!---------- check if summed area is bigger than triangle area + + r_sum= r_f1+ r_f2+ r_f3 + if((r_sum- r_f) < r_eps) l_in= .TRUE. + + RETURN + END FUNCTION in_side + +!***************************************************************** + SUBROUTINE slm_initxmas(p_ghand) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), INTENT(in) :: p_ghand + + INTEGER :: i_num, i_alct + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_coo + INTEGER, DIMENSION(1) :: i_valind + +!---------- allocate workspace + + i_num= p_ghand%i_nnumber + ALLOCATE(r_aux(1,i_num), r_coo(GRID_dimension,i_num), stat= i_alct) + IF(i_alct /= 0) THEN + CALL grid_error(54) + END IF + +!---------- initialize values to zero + + r_aux= 0._GRID_SR + +!---------- get information + + CALL grid_getinfo(p_ghand, r_nodecoordinates= r_coo) + +!---------- compute values for slotted cylinder + + CALL compute_xmas(i_num, r_coo, r_aux(1,:)) + +!---------- update grid information + + i_valind= (/ GRID_tracer /) + CALL grid_putinfo(p_ghand, i_arraypoint=i_valind, r_nodevalues= r_aux) + +!---------- deallocate workspace + + DEALLOCATE(r_aux, r_coo) + + RETURN + END SUBROUTINE slm_initxmas + +!***************************************************************** + SUBROUTINE compute_xmas(i_num, r_coo, r_aux) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_num + REAL (KIND = GRID_SR), DIMENSION(:) :: r_aux + REAL (KIND = GRID_SR), DIMENSION(:,:) :: r_coo + + INTEGER :: i_count, j_count + REAL (KIND = GRID_SR) :: r_rds, r_ras, r_rad, & + r_dpt + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_tmp, & + r_nw, r_sw, r_ne, r_se, r_centr, r_off + LOGICAL :: l_aux + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 3, 6) :: r_xmastree + REAL (KIND = GRID_SR), & + DIMENSION(GRID_dimension, 6) :: r_xmasball + +!---------- initialize coordinates of xmas tree triangles + + r_xmastree(:,:,1) = RESHAPE( (/0.2, 0.65, 0.3, 0.65, 0.25, 0.7 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,2) = RESHAPE( (/0.15, 0.575, 0.35, 0.575, 0.25, 0.675 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,3) = RESHAPE( (/0.1, 0.475, 0.4, 0.475, 0.25, 0.625 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,4) = RESHAPE( (/0.05, 0.35, 0.45, 0.35, 0.25, 0.55 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,5) = RESHAPE( (/ 0.225, 0.35, 0.225, 0.3, 0.275, 0.3 /), (/GRID_dimension, 3 /)) + r_xmastree(:,:,6) = RESHAPE( (/ 0.225, 0.35, 0.275, 0.3, 0.275, 0.35 /), (/GRID_dimension, 3 /)) + r_xmasball(:,1) = (/ 0.252, 0.65 /) + r_xmasball(:,2) = (/ 0.205, 0.53 /) + r_xmasball(:,3) = (/ 0.3, 0.525 /) + r_xmasball(:,4) = (/ 0.145, 0.39 /) + r_xmasball(:,5) = (/ 0.35, 0.41 /) + r_xmasball(:,6) = (/ 0.247, 0.425 /) + r_rds= r_srd*r_srd + +!---------- compute offset for unit squares [0,1]^2 or [-0.5,0.5]^2 + + r_off= (/ 0.0, 0.0 /) ! [0,1] unit square +! r_off= (/ -0.5, -0.5 /) ! [-0.5,0.5] unit square + DO i_count=1,6 + DO j_count=1,3 + r_xmastree(:,j_count,i_count)= r_xmastree(:,j_count,i_count)+ r_off(:) + END DO + END DO + DO i_count=1,6 + r_xmasball(:,i_count)= r_xmasball(:,i_count)+ r_off(:) + END DO + +!---------- loop over the nodes + + node_loop: DO i_count= 1, i_num + r_aux(i_count)= 0.0_GRID_SR + DO j_count= 1, 6 + inside: IF(in_side(r_coo(:,i_count), r_xmastree(:,1,j_count), & + r_xmastree(:,2,j_count), r_xmastree(:,3,j_count))) THEN + r_aux(i_count)= r_hgt2 + END IF inside + END DO + DO j_count= 1, 6 + r_tmp= r_coo(:,i_count)- r_xmasball(:,j_count) + inball: IF(dot_product(r_tmp,r_tmp)<r_rds) THEN + r_aux(i_count)= r_hgt + END IF inball + END DO + END DO node_loop + + RETURN + END SUBROUTINE compute_xmas + + END MODULE SLM_initial diff --git a/flash2d/src/options/SLM_simple.algae.f90 b/flash2d/src/options/SLM_simple.algae.f90 new file mode 100644 index 0000000000000000000000000000000000000000..fb16e62da8178b2d810fffe90243470b0a84dc1c --- /dev/null +++ b/flash2d/src/options/SLM_simple.algae.f90 @@ -0,0 +1,395 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide simple semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS + +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(2,i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(2,i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants +!DEBUG: + !write(*,*) 'DEGBUG: entering slm_displace' + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5* p_param%num%r_deltatime + r_dt2= 1.5* p_param%num%r_deltatime + r_fac= 0.5 + r_caf= 2.0 + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0 + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(:,:), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0 + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(:,i_cnt)= r_rside(:,i_cnt)+ & + r_dt* slm_righthand(r_coord(:,i_cnt),r_rside(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0 + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(2,i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val1, i_val2, i_out, i_stat + +!---------- initialize constant +!DEBUG: +! write(*,*) 'DEGBUG: entering slm_interpolate' + + i_val1= GRID_tracer + i_val2= GRID_phi + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain +!DEBUG: +! write(*,*) 'DEGBUG: calling grid_domaincheck with r_upstr, r_coord:', r_upstr(:,i_cnt), r_coord(:,i_cnt) + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(:,i_cnt)= 0.0 + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(1,i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val1) + small_val1: IF(abs(r_rside(1,i_cnt)) < r_eps) THEN + r_rside(1,i_cnt)= 0.0 + END IF small_val1 + r_rside(2,i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val2) + small_val2: IF(abs(r_rside(2,i_cnt)) < r_eps) THEN + r_rside(2,i_cnt)= 0.0 + END IF small_val2 + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + + END MODULE SLM_simple diff --git a/flash2d/src/options/SLM_simple.clip.f90 b/flash2d/src/options/SLM_simple.clip.f90 new file mode 100644 index 0000000000000000000000000000000000000000..b4bb4b34bb5e9f24ea7e74b341f87a2535876443 --- /dev/null +++ b/flash2d/src/options/SLM_simple.clip.f90 @@ -0,0 +1,415 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + i_index=i_ind, i_domaincheck=0, l_relative=.FALSE., l_sfcorder=.FALSE.) + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0_GRID_SR; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + END MODULE SLM_simple diff --git a/flash2d/src/options/SLM_simple.periodic.f90 b/flash2d/src/options/SLM_simple.periodic.f90 new file mode 100644 index 0000000000000000000000000000000000000000..1137fdbb244592fa15a9c120995985f2a71ae700 --- /dev/null +++ b/flash2d/src/options/SLM_simple.periodic.f90 @@ -0,0 +1,425 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide advanced semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR), DIMENSION(GRID_nodevalues) :: r_tval + INTEGER, DIMENSION(GRID_elementnodes) :: i_ttmp + REAL (KIND = GRID_SR) :: r_eps, r_max, r_min, r_tmp + INTEGER :: i_cnt, i_alct, i_val + INTEGER :: i_ind, i_tim, & + j_cnt, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + i_tim= p_mesh(i_time)%i_timetag + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- we want to check for periodic boundaries !!! THIS IS A DIRTY HACK! + + DO i_cnt=1, i_arlen + IF(r_upstr(1,i_cnt) > 0.5_GRID_SR) r_upstr(1,i_cnt)= r_upstr(1,i_cnt)- 1.0_GRID_SR + IF(r_upstr(1,i_cnt) < -0.5_GRID_SR) r_upstr(1,i_cnt)= r_upstr(1,i_cnt)+ 1.0_GRID_SR + IF(r_upstr(2,i_cnt) > 0.5_GRID_SR) r_upstr(2,i_cnt)= r_upstr(2,i_cnt)- 1.0_GRID_SR + IF(r_upstr(2,i_cnt) < -0.5_GRID_SR) r_upstr(2,i_cnt)= r_upstr(2,i_cnt)+ 1.0_GRID_SR + END DO + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_tmp= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + i_interpolorder=GRID_highorder, i_valpoint=i_val, & + l_relative=.FALSE., l_sfcorder=.FALSE., i_index=i_ind, i_domaincheck=0) + + + index_valid: IF(i_ind > 0) THEN + +!---------- get nodes of element surrounding r_upstr + + CALL grid_getiteminfo(i_ind, 'elmt', i_arrlen=GRID_elementnodes, i_nodes=i_ttmp) + +!---------- get values at nodes of element surrounding r_upstr, and obtain min/max + + r_min= 0.0; r_max= 0.0_GRID_SR + elmt_loop: DO j_cnt=1,GRID_elementnodes + CALL grid_getiteminfo(i_ttmp(j_cnt), 'node', i_arrlen=GRID_nodevalues, & + r_values= r_tval, i_time=i_tim) + r_min= MIN(r_min, r_tval(i_val)) + r_max= MAX(r_max, r_tval(i_val)) + END DO elmt_loop + +!---------- clip value + + IF(r_tmp > r_max) THEN + r_tmp= r_max + ELSE IF(r_tmp < r_min) THEN + r_tmp= r_min + END IF + END IF index_valid + +!---------- set interpolation value + + r_rside(i_cnt)= r_tmp + + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + END MODULE SLM_simple diff --git a/flash2d/src/options/SLM_simple.plain.f90 b/flash2d/src/options/SLM_simple.plain.f90 new file mode 100644 index 0000000000000000000000000000000000000000..9bbfde755dc6536d76b32433d676c97246be4488 --- /dev/null +++ b/flash2d/src/options/SLM_simple.plain.f90 @@ -0,0 +1,382 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide simple semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS + +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + l_relative=.FALSE., l_sfcorder=.FALSE., i_interpolorder=GRID_highorder, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + + END MODULE SLM_simple diff --git a/flash2d/src/options/SLM_simple.tps.f90 b/flash2d/src/options/SLM_simple.tps.f90 new file mode 100644 index 0000000000000000000000000000000000000000..53eea2e26ac3faa4ce0e8f5c147004d1656c6fce --- /dev/null +++ b/flash2d/src/options/SLM_simple.tps.f90 @@ -0,0 +1,382 @@ +!***************************************************************** +! +! MODULE NAME: +! SLM_simple +! FUNCTION: +! provide simple semi-Lagrangian routines +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! slm_step +! FUNCTION: +! one step of the basic SLM algorithm +! SYNTAX: +! CALL slm_step(int, real.arr, real.arr) +! ON INPUT: +! ... +! ON OUTPUT: +! r_tracer: array with tracer values real +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_displace +! FUNCTION: +! extrapolate the alpha, values for the displacements of the upstream +! points from the gridpoints +! SYNTAX: +! CALL slm_displace(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_coord: real array of xy-coordinates real +! ON OUTPUT: +! r_alpha: displacement vectors to each point real +! CALLS: +! wind_field +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! slm_update +! FUNCTION: +! calculate the update to the velocity +! SYNTAX: +! CALL slm_update(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_rside: array with right hand side values real +! ON OUTPUT: +! r_udate: array with new (updated) gid values real +! CALLS: +! +! COMMENTS: +! this routine is trivial for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_upstream +! FUNCTION: +! calculate right hand side of the equation (upstream values) +! SYNTAX: +! CALL slm_upstream(int, real.arr, real.arr) +! ON INPUT: +! i_arlen: array length for the real arrays integer +! r_alpha: displacement vectors to each point real +! ON OUTPUT: +! r_rside: array with right hand side values real +! CALLS: +! +! COMMENTS: +! this routine is just interpolation for linear advection +! +!----------------------------------------------------------------- +! +! NAME: +! slm_interpolate +! FUNCTION: +! do the interpolation +! SYNTAX: +! CALL slm_interpolate(grid, int, real, real.arr, real.arr, real.arr) +! ON INPUT: +! p_ogrid: grid handle to old grid (with data) TYPE (grid_handle) +! r_fac: factor at which point to interpolate REAL +! i_arlen: array length for the following arrays INTEGER +! r_coord: coordinate array (new grid) REAL +! r_alpha: displacement array (corr. to r_coord) REAL +! r_value: values on the old grid (array) REAL +! ON OUTPUT: +! r_rside: right hand side (interpolated) REAL +! CALLS: +! +! COMMENTS: +! this one is plain bi-cubic spline interpolation +! +!----------------------------------------------------------------- +! +! PUBLIC: +! slm_step +! COMMENTS: +! +! USES: +! FLASH_parameters, GRID_api, ADV_wind, ADV_rhs +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/2002 +! 2. compliant to amatos 2.0 j. behrens 7/2003 +! +!***************************************************************** + MODULE SLM_simple + USE FLASH_parameters + USE MISC_timing + USE GRID_api + USE ADV_wind + USE ADV_rhs + PRIVATE + PUBLIC :: slm_step + CONTAINS + +!***************************************************************** + SUBROUTINE slm_step(p_ghand, p_param, p_time, r_modtime, i_size, & + r_coord, r_tracer, i_newsdepth) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps), INTENT(in) :: p_ghand + TYPE (control_struct), INTENT(in) :: p_param + TYPE (sw_info), INTENT(inout) :: p_time + REAL (KIND = GRID_SR), INTENT(in) :: r_modtime + INTEGER, INTENT(in) :: i_size + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_size), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_size), INTENT(out) :: r_tracer + INTEGER, OPTIONAL, INTENT(in) :: i_newsdepth + + REAL (KIND = GRID_SR), DIMENSION(:), ALLOCATABLE :: r_newvl + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_alpha + INTEGER :: i_alct + +!---------- check size! + + IF(i_size <= 0) THEN + IF(GRID_parameters%iolog > 0) & + write(GRID_parameters%iolog,*) 'INFO [slm_step]: Zero step size, returning to calling routine' + RETURN + END IF + +!---------- allocate auxiliary arrays + + allocate(r_newvl(i_size), r_alpha(GRID_dimension,i_size), stat=i_alct) + not_alloc: IF(i_alct /= 0) THEN + CALL grid_error(38) + END IF not_alloc + +!-SLM--------- calculate trajectory pieces (displacements) + + CALL stop_watch('start',3,p_time) + CALL slm_displace(p_param, i_size, r_coord, r_alpha, r_time=r_modtime) + CALL stop_watch('stop ',3,p_time) + +!-SLM--------- calculate right hand side + + CALL stop_watch('start',4,p_time) + CALL slm_upstream(p_ghand, i_size, r_coord, r_alpha, r_newvl) + CALL stop_watch('stop ',4,p_time) + +!-SLM--------- calculate new grid values + + CALL stop_watch('start',5,p_time) + CALL slm_update(p_param, i_size, r_coord, r_newvl, r_tracer, r_time=r_modtime) + CALL stop_watch('stop ',5,p_time) + +!-SLM--------- put alpha values to u and v field entries + + r_alpha= -r_alpha + IF(present(i_newsdepth)) THEN + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_newsdepth=i_newsdepth, i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + ELSE + CALL grid_putinfo(p_ghand(i_timeplus), r_nodevalues=r_alpha, & + i_arraypoint=(/ GRID_ucomp, GRID_vcomp /)) + END IF + +!-SLM--------- deallocate work arrays + + deallocate(r_alpha, r_newvl) + + RETURN + END SUBROUTINE slm_step + +!***************************************************************** + SUBROUTINE slm_displace(p_param, i_arlen, r_coord, r_alpha, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(out) :: r_alpha + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac, r_caf, & + r_axy, r_xyc + REAL (KIND = GRID_SR) :: r_dt0, r_dt1, & + r_dt2, r_tim + INTEGER :: i_cnt1, i_cnt2 + +!---------- set constants + + r_dt0= p_param%num%r_deltatime + r_dt1= 0.5_GRID_SR* p_param%num%r_deltatime + r_dt2= 1.5_GRID_SR* p_param%num%r_deltatime + r_fac= 0.5_GRID_SR + r_caf= 2.0_GRID_SR + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + +!---------- calculate in an iteration process the displacements + + unknown_loop: DO i_cnt1=1,i_arlen + r_axy= 0.0_GRID_SR + + iter_loop: DO i_cnt2=1, p_param%num%i_adviterations + r_xyc= r_coord(:,i_cnt1)- r_fac* r_axy + r_axy= r_dt0* slm_windfield(r_xyc, r_time=r_tim) + END DO iter_loop + + r_alpha(:,i_cnt1)= r_axy + END DO unknown_loop + + RETURN + END SUBROUTINE slm_displace + +!***************************************************************** + SUBROUTINE slm_update(p_param, i_arlen, r_coord, r_rside, r_udate, r_time) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (control_struct), INTENT(in) :: p_param + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(in) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_udate + REAL (KIND = GRID_SR), INTENT(in), OPTIONAL :: r_time + INTEGER :: i_cnt + REAL (KIND = GRID_SR) :: r_dt, r_tim + +!---------- in the linear advection case and with f90 this is just + +! r_udate= r_rside + +!---------- including a non-zero right hand side, we have + + r_dt= p_param%num%r_deltatime + IF(present(r_time)) THEN + r_tim= r_time + ELSE + r_tim= 0.0_GRID_SR + END IF + + main_loop: DO i_cnt=1, i_arlen + r_udate(i_cnt)= r_rside(i_cnt)+ r_dt* slm_righthand(r_coord(:,i_cnt)) + END DO main_loop + + RETURN + END SUBROUTINE slm_update + +!***************************************************************** + SUBROUTINE slm_upstream(p_mesh, i_arlen, r_coord, & + r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension) :: r_fac + +!---------- set factor (at which point of trajectory shall i interpolate) + + r_fac= 1.0_GRID_SR + +!---------- in the linear advection case this is just interpolation + + CALL slm_interpolate(p_mesh, r_fac, i_arlen, r_coord, & + r_alpha, r_rside) + + RETURN + END SUBROUTINE slm_upstream +!***************************************************************** + SUBROUTINE slm_interpolate(p_mesh, r_fac, i_arlen, & + r_coord, r_alpha, r_rside) + +!---------- local declarations + + IMPLICIT NONE + + TYPE (grid_handle), DIMENSION(GRID_timesteps) :: p_mesh + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension), INTENT(in) :: r_fac + INTEGER, INTENT(in) :: i_arlen + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_coord + REAL (KIND = GRID_SR), DIMENSION(GRID_dimension,i_arlen), INTENT(in) :: r_alpha + REAL (KIND = GRID_SR), DIMENSION(i_arlen), INTENT(out) :: r_rside + REAL (KIND = GRID_SR), DIMENSION(:,:), ALLOCATABLE :: r_upstr + REAL (KIND = GRID_SR) :: r_eps + INTEGER :: i_cnt, i_alct, & + i_val, i_out, i_stat + +!---------- initialize constant + + i_val= GRID_tracer + r_eps= GRID_EPS + +!---------- allocate work array + + ALLOCATE(r_upstr(GRID_dimension,i_arlen), stat=i_alct) + not_allocated: IF(i_alct /= 0) THEN + CALL grid_error(60) + END IF not_allocated + +!---------- calculate upstream coordinates + + dim_loop: DO i_cnt=1, GRID_dimension + r_upstr(i_cnt,:) = r_coord(i_cnt,:)- r_fac(i_cnt)* r_alpha(i_cnt,:) + END DO dim_loop + +!---------- loop over nodes: find element containing upstream point + + node_loop: DO i_cnt=1, i_arlen + +!---------- check if upstream value is outside of the domain + + i_out= grid_domaincheck(p_mesh(i_time), r_upstr(:,i_cnt)) + +!---------- take the intersection of the trajectory with the boundary as new upstream point + + out_domain: IF(i_out /= 0) then + r_upstr(:,i_cnt)= grid_boundintersect(p_mesh(i_time), & + r_coord(:,i_cnt), r_upstr(:,i_cnt), i_info=i_stat) + no_intersect: IF(i_stat /= 0) THEN + r_rside(i_cnt)= 0.0_GRID_SR + CYCLE node_loop + END IF no_intersect + END IF out_domain + +!---------- interpolate + + r_rside(i_cnt)= grid_coordvalue(p_mesh(i_time), r_upstr(:,i_cnt), & + l_relative=.FALSE., l_sfcorder=.FALSE., i_interpolorder=GRID_thinplate, i_valpoint=i_val) + small_val: IF(abs(r_rside(i_cnt)) < r_eps) THEN + r_rside(i_cnt)= 0.0_GRID_SR + END IF small_val + + END DO node_loop + +!---------- deallocate work array + + DEALLOCATE(r_upstr) + + RETURN + END SUBROUTINE slm_interpolate + + + END MODULE SLM_simple diff --git a/flash2d/src/petsc/Makefile.t3e b/flash2d/src/petsc/Makefile.t3e new file mode 100644 index 0000000000000000000000000000000000000000..83ac19fff9035706c34e099d1ee24533e7c19392 --- /dev/null +++ b/flash2d/src/petsc/Makefile.t3e @@ -0,0 +1,48 @@ +################################################################## +# FLASH90 # +# FLexible Adaptive Semi-Lagrangian Hack # +# written in Fortran 90 # +################################################################## +# Makefile for creating the graphics library (j.b. 1/94) # +# j. behrens 1/94, 3/96, 9/96, 3/98 # +# n.rakowsky 9/99 # +# --- this is for cray t3e - # +################################################################## + +MAKETHING= libuGL.a +LIBDIR= ./.. +PETSC_DIR = /fserv/userm/sfricken/petsc-2.0.24 +INCS = -I$(PETSC_DIR) -I$(PETSC_DIR)/include -I$(PETSC_DIR)/bmake/t3e + +F90 = f90 +AR = ar + +FFLAGS = -dp -F -O2 -O unroll2 +ARFLAGS = vru + +################################################################## +# AFTER THIS LINE, NO CHANGES SHOULD BE NECESSARY # +################################################################## + +OBJ = graphics.o + +.F90.o: + @echo "make: Building object module from "$< + @$(F90) $(FFLAGS) $(INCS) -c $< + +$(MAKETHING): $(OBJ) + @echo "make: Creating an archive from object modules" + @$(AR) $(ARFLAGS) $(MAKETHING) $(OBJ) + +clean:: + @echo "make: Clearing directory from trash files" + @rm -f core a.out *.trace *.o + +install:: + @echo "make: Installing library" + @mv $(MAKETHING) $(LIBDIR) + +all:: + @make $(MAKETHING) + @make install + @make clean diff --git a/flash2d/src/petsc/README b/flash2d/src/petsc/README new file mode 100644 index 0000000000000000000000000000000000000000..8dad89614952929685a49e7a61cbe011577e6da7 --- /dev/null +++ b/flash2d/src/petsc/README @@ -0,0 +1,44 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/lib/nogl" + +Makefile - Makefile for creating the archive file libuGL.a +Makefile.xxx - Makefiles taylored for specific machines +README - this file +graphics.F90 - f90 source file containing graphics interface for petsc + (sorry, no parallel routines yet) + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +If there is no petsc library on your machine, obtain a copy from +http://www.mcs.anl.gov/petsc/. Edit the PETSC_DIR entry in the Makefile. + +In order to create the library to be used in FLASH type + make all +The library is then created, installed, and remaining *.o files are +removed to save disk space. +'make all' consists of the three commands + make libuGL.a + make install + make clean + + +This library has to be linked together with libpetscfortran, libpetsc, libX11. +E.g., on the Cray T3E at AWI add the library path + -L/fserv/userm/sfricken/petsc-2.0.24/lib/libO/t3e +(on other machines, change path accordingly) and the libraries + -lpetscfortran -lpetsc -lX11 +when linking the FLASH program. + +************************************************************************** + j. behrens, 1/94, 3/96, 8/98 + n. rakowsy, 9/99 +************************************************************************** + diff --git a/flash2d/src/petsc/graphics.F90 b/flash2d/src/petsc/graphics.F90 new file mode 100644 index 0000000000000000000000000000000000000000..6a3b7349f4d0d0f154b0b37fd3eb323ac3836e9f --- /dev/null +++ b/flash2d/src/petsc/graphics.F90 @@ -0,0 +1,591 @@ + + module graphics_parameters + +! FUNCTION: provides global parameters, variables and error handling for +! the routines graphics_init, graphics_draw, graphics_quit + +! COMMENTS: + +! LIBRARIES: Petsc + +! REFERENCES: + +! VERSION(S): +! 1. original version (serial) n. rakowsky 9/99 + +#include "include/finclude/petsc.h" +#include "include/finclude/viewer.h" +#include "include/finclude/draw.h" + +! Parameters determining window geometry (sorry, it's all static... +! no resize during execution of the program) + integer, parameter :: n_pixel(2)= (/ 360,360 /) ! size of X-window + + real, parameter :: r_border_width =.05 ! minimum width of border around computational + ! domain (relative to window size) + + real, parameter :: r_max_vec_comp = .1 ! maxmimal length of wind vector components + ! (relative to window size) + +! real, parameter :: r_point_size = .01 ! size of single points (rel. to window size) +! not enabled... DrawPointSetSize does not work (yet). + +! colormap: 0:31 basic colors, see (petsc-dir)/include/draw.h +! 32:255 uniform colormap red -> yellow -> green -> blue) + integer, parameter :: i_col_min=95 ! from yellow + integer, parameter :: i_col_max=32 ! to red + integer, parameter :: i_col_range = (i_col_max-i_col_min) + + +! Coordinate range covered by X-window, equals size of comp. domain + border +! and is determined in graphics_init. + real :: x_min, y_min, x_max, y_max + +! Size of font used for strings (relative to window size). Determined in graphics_init. + real :: r_font_height, r_font_width + +! and some parameters concerning text output + real, parameter :: x_offset=.01, y_offset=.01 ! relativ to window size + real, parameter :: r_baselineskip = 1.1 ! in terms of font height + +! boundary of the domain + integer :: n_bound_nodes + real, allocatable :: r_bound_nodes(:,:) ! dim (2,n_bound), Coord of bound. nodes + + integer :: i_plotflag ! flag: what to plot (tracer, wind vector, grid) + + Draw :: drw ! petsc-internal: identifier for plot + + + public + + contains + + subroutine graphics_error(c_error_text) + + ! prints c_error_text to standard out and exits the program + + character(len=45), intent(in) :: c_error_text + + print *,'graphics_error: ',adjustl(c_error_text) + + stop + + end subroutine graphics_error + + + subroutine graphics_print_centered(n_length,c_text) + + ! prints c_text in the center of the graphics window + + integer, intent(in) :: n_length + character (len=n_length), intent(in) :: c_text + + real :: x_coord, y_coord + integer :: n_len + + n_len = n_length + if (n_len*r_font_width > 1) then ! string to large for window => clip + n_len = 1./r_font_width - 1 + end if + ! centered output: calculate lower left corner + y_coord = .5*(1. - r_font_height)*(y_max - y_min) + y_min + x_coord = .5*(1. - n_length*r_font_width)*(x_max - x_min) + x_min + if (x_coord < x_min) x_coord = x_min + + call DrawString(drw,x_coord,y_coord,DRAW_BLACK,c_text(1:n_len),i_error) + + end subroutine graphics_print_centered + + + + end module graphics_parameters + + + + subroutine setparams(p_param) +! FUNCTION: dummy routine (if openGL graphic routines were invoked, the routine +! setparams would allow the user to set parameters with an openGL interface) + +! VERSION(S): +! 1. original version n. rakowsky 9/99 + end subroutine setparams + +!--------------------------------------------------------------------------------- + + + + subroutine graphics_init(n_bound, x_bound, y_bound, n_wl, c_wintext, & + n_ml, c_polygonfile, i_plotflag_input) + +! FUNCTION: initializes graphic output with petsc-routines + + use graphics_parameters + implicit none + +! ON INPUT: +! polygon defining the boundary: n_bound nodes with coordinates x_bound, y_bound + integer, intent(in) :: n_bound + real, intent(in) :: x_bound(n_bound), y_bound(n_bound) + + + integer, intent(in) :: n_wl, n_ml ! size of foolowing strings + character (len=n_wl), intent(in) :: c_wintext ! window title + character (len=n_ml), intent(in) :: c_polygonfile ! file containing landmask (ignored) + +! flag: what to plot + integer, intent(in) :: i_plotflag_input ! = 7: grid +! = 8: wind vector field +! = 10: tracer +! = 11: tracer + grid +! other values: not supported + +! ON OUTPUT: + +! CALLS: +! graphics_error external: module graphics_parameters +! PetscInitialize external: petsc +! DrawOpenX " +! DrawStringGetSize " +! DrawSetCoordinates " +! DrawSetDoubleBuffer " + +! COMMENTS: Plotting parameters like window size are set statically in +! the module graphics_parameters + +! LIBRARIES: Petsc + +! REFERENCES: + +! VERSION(S): +! 1. original version (serial) n. rakowsky 9/99 + + +! auxiliary variables + real :: x_range, y_range, x_domain_fraction, y_domain_fraction + real :: x_left_border, x_right_border, y_lower_border, y_upper_border + real :: x_min_d, x_max_d, y_min_d, y_max_d + real :: r_rescale, y_3_lines, r_det + integer :: i_error + + + +! determine coordinate range of the comp domain + x_min_d = minval(x_bound) + x_max_d = maxval(x_bound) + x_range = x_max_d - x_min_d + + y_min_d = minval(y_bound) + y_max_d = maxval(y_bound) + y_range = y_max_d - y_min_d + if (x_range <= epsilon(x_min) .or. y_range <= epsilon(y_min)) then + call graphics_error('domain to small for machine precision') + endif + + +! initialize petsc, X-window + call PetscInitialize(PETSC_NULL_CHARACTER,i_error) + call DrawOpenX(PETSC_COMM_SELF, PETSC_NULL_CHARACTER, c_wintext, & + & 0, 0, n_pixel(1), n_pixel(2), drw, i_error) +! get font size + call DrawStringGetSize(drw,r_font_width,r_font_height,i_error) + + +! Add a small border around the computational domain, +! allow for three lines of text below the comp. domain. + +! the following auxiliary variables are relative to window height/width +! (Can the computation be simplified ?!) + + y_3_lines = 3.*r_baselineskip*r_font_height + 3.*y_offset + y_lower_border = max( y_3_lines , r_border_width) + y_upper_border = r_border_width +! this remains for the vertical expansion of the comp domain + y_domain_fraction = 1. - y_lower_border - y_upper_border + if (y_domain_fraction <= epsilon(1.)) then + call graphics_error('window too small, adjust parameters+recompile') + endif + +! keep aspect ratio + x_domain_fraction = (x_range/y_range) * y_domain_fraction + +! does this still fit into the window ? If not => rescale + if (x_domain_fraction > 1.-2.*r_border_width) then + r_rescale = (1.-2.*r_border_width) / x_domain_fraction + x_domain_fraction = 1.-2.*r_border_width + y_domain_fraction = y_domain_fraction * r_rescale + y_lower_border = max( y_3_lines, .5*(1.-y_domain_fraction)) + y_upper_border = 1. - y_lower_border - y_domain_fraction + endif +! center comp domain horizontally + x_left_border = .5*(1.-x_domain_fraction) + x_right_border = x_left_border + + print *,x_left_border, x_right_border ,y_lower_border, y_upper_border + +! determine coordiante system of the X window including computational domain, +! border and space for description text. +! Sorry, this looks a little ugly... includes inverse 2x2-matrices. + r_det = 1./(1. - y_lower_border - y_upper_border) + y_min = r_det*((1.-y_upper_border) * y_min_d - y_lower_border*y_max_d ) + y_max = r_det*( - y_upper_border * y_min_d + (1.-y_lower_border)*y_max_d ) + + r_det = 1./(1. - x_left_border - x_right_border) + x_min = r_det*((1.-x_right_border) * x_min_d - x_left_border*x_max_d ) + x_max = r_det*( - x_right_border * x_min_d + (1.-x_left_border)*x_max_d ) + + print *, x_min, x_max, y_min, y_max + + call DrawSetCoordinates(drw, x_min, y_min, x_max, y_max, i_error) + call DrawSetDoubleBuffer(drw,i_error) + + +! save geometrie of the boundary + n_bound_nodes = n_bound + allocate(r_bound_nodes(2,n_bound_nodes), stat=i_error) + if (i_error/=0) call graphics_error('not enough memory') + + r_bound_nodes(1,1:n_bound_nodes) = x_bound(1:n_bound_nodes) + r_bound_nodes(2,1:n_bound_nodes) = y_bound(1:n_bound_nodes) + + +! initialize plotflag + i_plotflag = i_plotflag_input + + + end subroutine graphics_init + +!--------------------------------------------------------------------------------- + + subroutine graphics_quit + +! FUNCTION: frees memory, deletes the draw context and finishes petsc + + use graphics_parameters + implicit none + +! ON INPUT: + +! ON OUTPUT: + +! CALLS: DrawDestroy +! PetscFinalize + +! COMMENTS: + +! LIBRARIES: Petsc + +! REFERENCES: + +! VERSION(S): +! 1. original version (serial) n. rakowsky 9/99 + + integer :: i_error + + call DrawDestroy(drw, i_error) + call PetscFinalize(i_error) + deallocate(r_bound_nodes) + + end subroutine graphics_quit + +!--------------------------------------------------------------------------------- + + + + function graphics_draw(n_nodes_per_element, n_efine, n_nnum, & + x_elmt, y_elmt, x_node, y_node, z_elmt, u_node, v_node, & + n_fl, c_fratext, n_tl, c_tiffile, c_desc) & + result (i_plotquit) + +! FUNCTION: frees memory, deletes the draw context and finishes petsc + + use graphics_parameters + implicit none + +! ON INPUT: + + integer, intent(in) :: n_nodes_per_element + integer, intent(in) :: n_efine ! number of elements + integer, intent(in) :: n_nnum ! number of nodes + + real, dimension(n_nodes_per_element,n_efine), intent(in) :: & + & x_elmt, y_elmt, & ! elements: node coordinates + & z_elmt ! and (tracer) value at nodes +! belonging to the element + + real, dimension(n_nnum),intent(in) :: x_node, y_node, & ! nodes: coordinates and + & u_node, v_node ! velocity components at nodes + + integer, intent(in) :: n_fl, n_tl ! length of following strings + character (len=n_fl), intent(in) :: c_fratext ! (ignored) + character (len=n_tl), intent(in) :: c_tiffile ! (ignored) + + TYPE descr + INTEGER :: l1,l2,l3 + CHARACTER (LEN=32) :: s1,s2,s3 + END TYPE descr + + type(descr), intent(in) :: c_desc ! description text ( 3 lines that will + ! be placed in the lower left corner) + +! ON OUTPUT: + integer :: i_plotquit ! 0 plotting succesful, -1 on error + +! CALLS: print_descriptor internal +! plot_grid � +! plot_boundary � +! plot_wind_vector � +! plot_tracer � +! graphics_print_centered external: module graphics_parameters +! DrawBOP external: petsc +! DrawClear � +! DrawEOP � +! DrawFlush � +! +! CALLS BY INTERNAL ROUTINES: +! DrawPoint external: petsc +! DrawLine " +! DrawTriangle " +! DrawString " + +! COMMENTS: + +! LIBRARIES: Petsc + +! REFERENCES: + +! VERSION(S): +! 1. original version (serial) n. rakowsky 9/99 + + +! auxiliary variables + + integer :: i_col(n_nodes_per_element) ! colour corresponding to + ! value at element node + + real :: z_max, z_min, z_range_inv ! value range + character (len=50) :: c_text ! text f"ur evtl. ausgaben + +! auxiliary variables + integer :: i,n, n_length + integer :: i_error + + + + i_plotquit = -1 + + call DrawBOP(drw,i_error) + if (i_error /= 0) return + call DrawClear(drw) + + call print_descriptor + + + select case (i_plotflag) + + case (7) ! plotting grid + + call plot_grid + + case (8) ! plotting wind vector + + call plot_boundary + call plot_wind_vector + + case (10) ! plotting tracer + + call plot_boundary + call plot_tracer + + case (11) ! plotting tracer + grid + + call plot_tracer + call plot_grid + + case default + + write(c_text,*) 'TYPE_OF_PLOTTING',i_plotflag,'not supported' + c_text = adjustl(c_text) + n_length = len_trim(c_text) + call graphics_print_centered(n_length,c_text) + + end select + + + call DrawEOP(drw,i_error) + if (i_error /= 0) return + + call DrawFlush(drw,i_error) + if (i_error /= 0) return + + i_plotquit = 0 + + contains + + + subroutine print_descriptor + + real :: x_coord, y_coord + integer :: n_max_length, n_length + integer :: i_box_width + real :: x_box, y_box + character(len=32) :: c_text + + +! max number of characters fitting into a line + if (r_font_width == 0) then + return + endif + n_max_length = 1./r_font_width - 1 + +! position of left margin + x_coord = x_min + x_offset*(x_max-x_min) + +! 1. line + c_text = adjustl(c_desc%s1) + n_length = len_trim(c_text) + if (n_length > n_max_length) c_text = c_text(1:n_max_length) + i_box_width = n_length + + y_coord = y_min + (y_offset + 2*r_baselineskip*r_font_height)*(y_max-y_min) + call DrawString(drw,x_coord,y_coord,DRAW_BLACK,c_text,i_error) + +! 2. line + c_text = adjustl(c_desc%s2) + n_length = len_trim(c_text) + if (n_length > n_max_length) c_text = c_text(1:n_max_length) + i_box_width = max(n_length,i_box_width) + + y_coord = y_min + (y_offset + r_baselineskip*r_font_height)*(y_max-y_min) + call DrawString(drw,x_coord,y_coord,DRAW_BLACK,c_text,i_error) + +! 3. line + c_text = adjustl(c_desc%s3) + n_length = len_trim(c_text) + if (n_length > n_max_length) c_text = c_text(1:n_max_length) + i_box_width = max(n_length,i_box_width) + + y_coord = y_min + y_offset*(y_max-y_min) + call DrawString(drw,x_coord,y_coord,DRAW_BLACK,c_text,i_error) + + +! and a rectangular box (lower left corner (x_min, y_min), +! upper right corner (x_box, y_box) + + i_box_width = min(n_max_length,i_box_width) ! number of char in box + + x_box = x_min + (i_box_width*r_font_width + 2*x_offset)*(x_max-x_min) + + y_box = y_min + (3*r_baselineskip*r_font_height + 2*y_offset)*(y_max-y_min) + + call DrawLine(drw, x_min,y_box, x_box,y_box, DRAW_BLACK,i_error) + call DrawLine(drw, x_box,y_min, x_box,y_box, DRAW_BLACK,i_error) + + end subroutine print_descriptor + + + subroutine plot_boundary + + do n=1,n_bound_nodes-1 + call DrawLine(drw, r_bound_nodes(1,n), r_bound_nodes(2,n), & + r_bound_nodes(1,n+1), r_bound_nodes(2,n+1), & + DRAW_BLACK, i_error) + enddo + call DrawLine(drw, r_bound_nodes(1,n_bound_nodes),r_bound_nodes(2,n_bound_nodes), & + r_bound_nodes(1,1), r_bound_nodes(2,1), & + DRAW_BLACK, i_error) + + end subroutine plot_boundary + + + subroutine plot_grid + + ! plot grid lines element wise + do n=1,n_efine + do i=1,n_nodes_per_element-1 + call DrawLine(drw, x_elmt(i,n), y_elmt(i,n), x_elmt(i+1,n), y_elmt(i+1,n), & + & DRAW_BLACK, i_error) + enddo + i = n_nodes_per_element + call DrawLine(drw, x_elmt(i,n), y_elmt(i,n), x_elmt(1,n), y_elmt(1,n), & + & DRAW_BLACK, i_error) + enddo + + end subroutine plot_grid + + + + subroutine plot_wind_vector + + real :: u_max, v_max ! maximal velocity values (absolute) + real :: r_scale ! scaling factor + real :: x_end, y_end ! end point of wind vector + + real :: u_scale, v_scale + + ! determine maximal velocity value + u_max = maxval(abs(u_node)) + v_max = maxval(abs(v_node)) + + ! determine scale factor + if (u_max > 0) then + u_scale = (x_max - x_min)/u_max + else + u_scale = 1 + endif + if (v_max > 0) then + v_scale = (y_max - y_min)/v_max + else + v_scale = 1 + endif + r_scale = r_max_vec_comp * min(u_scale,v_scale) + +! enlarge the vector starting point -- sorry, doesn't work (yet ?!) +! call DrawPointSetSize(drw,r_point_size,i_error) + + ! plot a velocity vector at each node + do i=1,n_nnum + x_end = x_node(i) + r_scale*u_node(i) + x_end = min(x_max, max(x_end, x_min)) ! outside window ? => clip + + y_end = y_node(i) + r_scale*v_node(i) + y_end = min(y_max, max(y_end, y_min)) ! outside window ? => clip + + call DrawLine(drw,x_node(i),y_node(i), x_end, y_end,DRAW_RED,i_error) + call DrawPoint(drw,x_node(i),y_node(i),DRAW_BLACK,i_error) + enddo + + end subroutine plot_wind_vector + + + subroutine plot_tracer + + ! determining value range + z_min = minval(z_elmt) + z_max = maxval(z_elmt) + z_range_inv = 1. / (z_max - z_min) + + + if (n_nodes_per_element == 3) then + do n=1,n_efine + i_col(1) = i_col_min + i_col_range * (z_elmt(1,n) - z_min)*z_range_inv + i_col(2) = i_col_min + i_col_range * (z_elmt(2,n) - z_min)*z_range_inv + i_col(3) = i_col_min + i_col_range * (z_elmt(3,n) - z_min)*z_range_inv + + call DrawTriangle(drw, x_elmt(1,n),y_elmt(1,n), x_elmt(2,n),y_elmt(2,n), & + x_elmt(3,n),y_elmt(3,n), i_col(1), i_col(2), i_col(3), i_error) + enddo + else + write(c_text,*) 'TYPE_OF_PLOTTING',i_plotflag,'for triangular grid only' + c_text = adjustl(c_text) + n_length = len_trim(c_text) + call graphics_print_centered(n_length,c_text) + endif + + end subroutine plot_tracer + + + end function graphics_draw + + + diff --git a/flash2d/src/system/cray-f90/MISC_system.f90 b/flash2d/src/system/cray-f90/MISC_system.f90 new file mode 100644 index 0000000000000000000000000000000000000000..532999cd1a7508aa89e65fc81eeb4b04feb1b488 --- /dev/null +++ b/flash2d/src/system/cray-f90/MISC_system.f90 @@ -0,0 +1,97 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_system +! FUNCTION: +! contains system dependent functions (e.g. command line io) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! sys_getcmdargs +! FUNCTION: +! same as getarg (read command line option) +! SYNTAX: +! call sys_getcmdargs(int, char) +! ON INPUT: +! i_pos: position of command line option integer +! ON OUTPUT: +! c_opt: option read from command line character string +! CALLS: +! +! COMMENTS: +! i_pos=0 returns the command itself +!----------------------------------------------------------------- +! +! NAME: +! sys_numcmdargs +! FUNCTION: +! same as iargc (tell number of command line options) +! SYNTAX: +! int= sys_numcmdargs +! ON INPUT: +! +! ON OUTPUT: +! i_argnum: number of command line items integer +! CALLS: +! +! COMMENTS: +! i_argnum excludes the command itself, thus i_argnum=0 +! indicates that there are no command line options given. +!----------------------------------------------------------------- +! +! PUBLIC: +! sys_getcmdargs, sys_numcmdargs +! COMMENTS: +! this is for the CRAY CF90 compiler, +! supporting POSIX ipxfargc and pxfgetarg +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 1/97 +! +!***************************************************************** + MODULE MISC_system + PRIVATE + PUBLIC :: sys_getcmdargs, sys_numcmdargs + CONTAINS +!***************************************************************** + SUBROUTINE sys_getcmdargs(i_pos, c_opt, i_len) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_pos + CHARACTER (len=*), INTENT(out) :: c_opt + INTEGER, OPTIONAL :: i_len + INTEGER :: i_err + EXTERNAL pxfgetarg + +!---------- this uses a POSIX routine. no error code is checked, no matching +!---------- of length is checked!!! + + CALL pxfgetarg(i_pos, c_opt, i_len, i_err) + + RETURN + END SUBROUTINE sys_getcmdargs +!***************************************************************** + FUNCTION sys_numcmdargs() RESULT(i_argnum) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_argnum + EXTERNAL ipxfargc + INTEGER :: ipxfargc + + i_argnum= ipxfargc() + + RETURN + END FUNCTION sys_numcmdargs + END MODULE MISC_system diff --git a/flash2d/src/system/gfortran/MISC_system.f90 b/flash2d/src/system/gfortran/MISC_system.f90 new file mode 100644 index 0000000000000000000000000000000000000000..906c838cb2a41838b54dd6cab2d1d8350131d153 --- /dev/null +++ b/flash2d/src/system/gfortran/MISC_system.f90 @@ -0,0 +1,96 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_system +! FUNCTION: +! contains system dependent functions (e.g. command line io) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! sys_getcmdargs +! FUNCTION: +! same as getarg (read command line option) +! SYNTAX: +! call sys_getcmdargs(int, char) +! ON INPUT: +! i_pos: position of command line option integer +! ON OUTPUT: +! c_opt: option read from command line character string +! CALLS: +! +! COMMENTS: +! i_pos=0 returns the command itself +!----------------------------------------------------------------- +! +! NAME: +! sys_numcmdargs +! FUNCTION: +! same as iargc (tell number of command line options) +! SYNTAX: +! int = sys_numcmdargs +! ON INPUT: +! +! ON OUTPUT: +! i_argnum: number of command line items integer +! CALLS: +! +! COMMENTS: +! i_argnum excludes the command itself, thus i_argnum=0 +! indicates that there are no command line options given. +!----------------------------------------------------------------- +! +! PUBLIC: +! sys_getcmdargs, sys_numcmdargs +! COMMENTS: +! this is for "standard" compilers, supporting iargc and getarg +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 01/97 +! +!***************************************************************** +MODULE MISC_system + + PRIVATE + PUBLIC :: sys_getcmdargs, sys_numcmdargs + + CONTAINS +!***************************************************************** + SUBROUTINE sys_getcmdargs(i_pos, c_opt, i_len) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_pos + CHARACTER (len=*), INTENT(out) :: c_opt + INTEGER, OPTIONAL :: i_len + +!---------- read command line argument + + CALL GET_COMMAND_ARGUMENT(i_pos, VALUE=c_opt) + + RETURN + END SUBROUTINE sys_getcmdargs + +!***************************************************************** + FUNCTION sys_numcmdargs() RESULT(i_argnum) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_argnum + + i_argnum= COMMAND_ARGUMENT_COUNT() + + RETURN + END FUNCTION sys_numcmdargs + +!***************************************************************** +END MODULE MISC_system diff --git a/flash2d/src/system/gfortran/MISC_wrapper.c b/flash2d/src/system/gfortran/MISC_wrapper.c new file mode 100644 index 0000000000000000000000000000000000000000..afaba06ed23126bdbe33d95912423494557f0436 --- /dev/null +++ b/flash2d/src/system/gfortran/MISC_wrapper.c @@ -0,0 +1,15 @@ +/*************************************************** +* wrapqsort.c +* this is a hack to link gfortran programs to qsort +***************************************************/ + +#include <stdlib.h> + +#ifdef macosx_gfortran +void qsort_(void* data, int* c, int* s, int* fn) +#else +void qsort_(void* data, int* c, int* s, __compar_fn_t fn) +#endif +{ + qsort(data, (size_t)*c, (size_t)*s, fn); +} diff --git a/flash2d/src/system/mpi/PAR_datatype.f b/flash2d/src/system/mpi/PAR_datatype.f new file mode 100644 index 0000000000000000000000000000000000000000..2bf5a8993ece530aba58976151ee842ee355ead5 --- /dev/null +++ b/flash2d/src/system/mpi/PAR_datatype.f @@ -0,0 +1,470 @@ +!***************************************************************** +! +! MODULE NAME: +! PAR_datatype +! FUNCTION: +! define the data structures for communication +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! parsys_makeinttype +! FUNCTION: +! create integer data type for communication (of derived types) +! SYNTAX: +! CALL parsys_makeinttype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_makerealtype +! FUNCTION: +! create real data type for communication (of derived types) +! SYNTAX: +! CALL parsys_makerealtype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_makeelmttype +! FUNCTION: +! create element derived data type for communication +! SYNTAX: +! CALL parsys_makeelmttype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error, mpi_address, mpi_type_struct, mpi_type_commit +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_makeedgetype +! FUNCTION: +! create edge derived data type for communication +! SYNTAX: +! CALL parsys_makeedgetype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error, mpi_address, mpi_type_struct, mpi_type_commit +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_makeinttype +! FUNCTION: +! create node derived data type for communication +! SYNTAX: +! CALL parsys_makenodetype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error, mpi_address, mpi_type_struct, mpi_type_commit +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_makeinfotype +! FUNCTION: +! create info derived data type for communication +! SYNTAX: +! CALL parsys_makeinfotype(int, int, int.arr) +! ON INPUT: +! i_mpipnt: pointer to type in array i_mpitypes INTEGER +! i_mpilen: length of array i_mpitypes INTEGER +! ON OUTPUT: +! i_mpitypes: array containig data type def.s INTEGER +! CALLS: +! print_error, mpi_address, mpi_type_struct, mpi_type_commit +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! CAUTION: when changing the type definition in FEM_define, +! the definitions have to be changed here as well! +! +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 4/98 +! +!***************************************************************** + MODULE PAR_datatype + + USE MISC_globalparam + USE MISC_error + USE FEM_define + USE PAR_define + +!---------- include the mpi definitions + + INCLUDE "mpif.h" + + CONTAINS +!***************************************************************** + SUBROUTINE parsys_makeinttype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(DEF_numtypes) :: i_mpitypes + INTEGER :: i_err + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the normal integer type + + IF(i_mpipnt == DEF_inttype) THEN + i_mpitypes(i_mpipnt) = MPI_INTEGER + ELSE + CALL print_error(199) + END IF + + RETURN + END SUBROUTINE parsys_makeinttype +!***************************************************************** + SUBROUTINE parsys_makerealtype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(DEF_numtypes) :: i_mpitypes + INTEGER :: i_err + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the normal integer type + + IF(i_mpipnt == DEF_realtype) THEN + i_mpitypes(i_mpipnt) = MPI_REAL + ELSE + CALL print_error(199) + END IF + + RETURN + END SUBROUTINE parsys_makerealtype +!***************************************************************** + SUBROUTINE parsys_makeelmttype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(i_mpilen) :: i_mpitypes + INTEGER :: i_err + INTEGER :: i_mpitmp, i_cnt + INTEGER, PARAMETER :: i_mpie= 13 + INTEGER, DIMENSION(i_mpie) :: i_mpiecnt, i_mpietyp, i_mpiedis + TYPE (elmt) :: p_etmp + +!---------- behave differently according to the different data types + + i_err= MPI_SUCCESS + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the element type + + elmt_typ: IF(i_mpipnt == DEF_elmttype) THEN + +!---------- conter array + + i_mpiecnt= (/ 1, DEF_elnodes, DEF_eledges, 3, DEF_timesteps, DEF_timesteps, & + DEF_evalsize, DEF_timesteps, DEF_elchild* DEF_timesteps, & + 3, 1, DEF_timesteps, DEF_elchild* DEF_timesteps /) +!----------- types array + + i_mpietyp= (/ MPI_INTEGER, MPI_INTEGER, MPI_INTEGER, MPI_INTEGER, & + MPI_INTEGER, MPI_INTEGER, MPI_REAL, MPI_INTEGER, MPI_INTEGER, & + MPI_INTEGER, MPI_REAL, MPI_INTEGER, MPI_INTEGER /) + +!---------- address displacements array + + CALL mpi_address(p_etmp%def%i_indx, i_mpiedis(1), i_err) + CALL mpi_address(p_etmp%def%p_node(1), i_mpiedis(2), i_err) + CALL mpi_address(p_etmp%def%p_edge(1), i_mpiedis(3), i_err) + CALL mpi_address(p_etmp%att%i_time, i_mpiedis(4), i_err) + CALL mpi_address(p_etmp%att%i_edge(1), i_mpiedis(5), i_err) + CALL mpi_address(p_etmp%att%i_stat(1), i_mpiedis(6), i_err) + CALL mpi_address(p_etmp%att%r_vals(1), i_mpiedis(7), i_err) + CALL mpi_address(p_etmp%lnk%p_prnt(1), i_mpiedis(8), i_err) + CALL mpi_address(p_etmp%lnk%p_chil(1,1), i_mpiedis(9), i_err) + CALL mpi_address(p_etmp%par%i_proc, i_mpiedis(10), i_err) + CALL mpi_address(p_etmp%par%r_load, i_mpiedis(11), i_err) + CALL mpi_address(p_etmp%par%i_prnt(1), i_mpiedis(12), i_err) + CALL mpi_address(p_etmp%par%i_chil(1,1), i_mpiedis(13), i_err) + i_mpitmp= i_mpiedis(1) + i_mpiedis= i_mpiedis- i_mpitmp + +!---------- type definition + + CALL mpi_type_struct(i_mpie, i_mpiecnt, i_mpiedis, i_mpietyp, i_mpitmp, i_err) + CALL mpi_type_commit(i_mpitmp, i_err) + i_mpitypes(i_mpipnt) = i_mpitmp + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + END IF elmt_typ + + RETURN + END SUBROUTINE parsys_makeelmttype +!***************************************************************** + SUBROUTINE parsys_makeedgetype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(i_mpilen) :: i_mpitypes + INTEGER :: i_err + INTEGER :: i_mpitmp, i_cnt + INTEGER, PARAMETER :: i_mpig= 16 + INTEGER, DIMENSION(i_mpig) :: i_mpigcnt, i_mpigtyp, i_mpigdis + TYPE (edge) :: p_gtmp + +!---------- behave differently according to the different data types + + i_err= MPI_SUCCESS + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the element type + + edge_typ: IF(i_mpipnt == DEF_edgetype) THEN + +!---------- conter array + + i_mpigcnt= (/ 1, DEF_egnodes, 1, DEF_egelems, DEF_timesteps, 1, DEF_timesteps, & + DEF_egchild* DEF_timesteps, 1, 3, DEF_egparcopy, DEF_egparcopy, & + DEF_timesteps, DEF_egelems, DEF_egchild*DEF_timesteps, 1 /) + +!---------- types array + + i_mpigtyp= MPI_INTEGER + +!---------- address displacements array + + CALL mpi_address(p_gtmp%def%i_indx, i_mpigdis(1), i_err) + CALL mpi_address(p_gtmp%def%p_node(1), i_mpigdis(2), i_err) + CALL mpi_address(p_gtmp%att%i_time, i_mpigdis(3), i_err) + CALL mpi_address(p_gtmp%att%p_elem(1), i_mpigdis(4), i_err) + CALL mpi_address(p_gtmp%att%i_node(1), i_mpigdis(5), i_err) + CALL mpi_address(p_gtmp%att%i_boun, i_mpigdis(6), i_err) + CALL mpi_address(p_gtmp%att%i_stat(1), i_mpigdis(7), i_err) + CALL mpi_address(p_gtmp%lnk%p_chil(1,1), i_mpigdis(8), i_err) + CALL mpi_address(p_gtmp%lnk%p_peri, i_mpigdis(9), i_err) + CALL mpi_address(p_gtmp%par%i_proc, i_mpigdis(10), i_err) + CALL mpi_address(p_gtmp%par%i_cppr(1), i_mpigdis(11), i_err) + CALL mpi_address(p_gtmp%par%i_cpid(1), i_mpigdis(12), i_err) + CALL mpi_address(p_gtmp%par%i_node(1), i_mpigdis(13), i_err) + CALL mpi_address(p_gtmp%par%i_elem(1), i_mpigdis(14), i_err) + CALL mpi_address(p_gtmp%par%i_chil(1,1), i_mpigdis(15), i_err) + CALL mpi_address(p_gtmp%par%i_peri, i_mpigdis(16), i_err) + i_mpitmp= i_mpigdis(1) + i_mpigdis= i_mpigdis- i_mpitmp + +!---------- type definition + + CALL mpi_type_struct(i_mpig, i_mpigcnt, i_mpigdis, i_mpigtyp, i_mpitmp, i_err) + CALL mpi_type_commit(i_mpitmp, i_err) + i_mpitypes(i_mpipnt) = i_mpitmp + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + END IF edge_typ + + RETURN + END SUBROUTINE parsys_makeedgetype +!***************************************************************** + SUBROUTINE parsys_makenodetype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(i_mpilen) :: i_mpitypes + INTEGER :: i_err + INTEGER :: i_mpitmp, i_cnt + INTEGER, PARAMETER :: i_mpin= 14 + INTEGER, DIMENSION(i_mpin) :: i_mpincnt, i_mpintyp, i_mpindis + TYPE (node) :: p_ntmp + +!---------- behave differently according to the different data types + + i_err= MPI_SUCCESS + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the element type + + node_typ: IF(i_mpipnt == DEF_nodetype) THEN + +!---------- conter array + + i_mpincnt= (/ 1, DEF_dimension, 2, DEF_timesteps, DEF_timesteps, & + DEF_ndpatch* DEF_timesteps, DEF_nvalsize* DEF_timesteps, & + 1, 3, DEF_ndparcopy, DEF_ndparcopy, 1, & + DEF_ndpatch* DEF_timesteps, 1 /) + +!---------- types array + + i_mpintyp= (/ MPI_INTEGER, MPI_REAL, MPI_INTEGER, MPI_INTEGER, & + MPI_INTEGER, MPI_INTEGER, MPI_REAL, MPI_INTEGER, & + MPI_INTEGER, MPI_INTEGER, MPI_INTEGER, MPI_INTEGER, & + MPI_INTEGER, MPI_INTEGER /) + +!---------- address displacements array + + CALL mpi_address(p_ntmp%def%i_indx, i_mpindis(1), i_err) + CALL mpi_address(p_ntmp%def%r_coor(1), i_mpindis(2), i_err) + CALL mpi_address(p_ntmp%att%i_time, i_mpindis(3), i_err) + CALL mpi_address(p_ntmp%att%i_ptch(1), i_mpindis(4), i_err) + CALL mpi_address(p_ntmp%att%i_stat(1), i_mpindis(5), i_err) + CALL mpi_address(p_ntmp%att%p_ptch(1,1), i_mpindis(6), i_err) + CALL mpi_address(p_ntmp%att%r_vals(1,1), i_mpindis(7), i_err) + CALL mpi_address(p_ntmp%lnk%p_peri, i_mpindis(8), i_err) + CALL mpi_address(p_ntmp%par%i_proc, i_mpindis(9), i_err) + CALL mpi_address(p_ntmp%par%i_cppr(1), i_mpindis(10), i_err) + CALL mpi_address(p_ntmp%par%i_cpid(1), i_mpindis(11), i_err) + CALL mpi_address(p_ntmp%par%i_edge, i_mpindis(12), i_err) + CALL mpi_address(p_ntmp%par%i_ptcp(1,1), i_mpindis(13), i_err) + CALL mpi_address(p_ntmp%par%i_peri, i_mpindis(14), i_err) + i_mpitmp= i_mpindis(1) + i_mpindis= i_mpindis- i_mpitmp + +!---------- type definition + + CALL mpi_type_struct(i_mpin, i_mpincnt, i_mpindis, i_mpintyp, i_mpitmp, i_err) + CALL mpi_type_commit(i_mpitmp, i_err) + i_mpitypes(i_mpipnt) = i_mpitmp + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + END IF node_typ + + RETURN + END SUBROUTINE parsys_makenodetype +!***************************************************************** + SUBROUTINE parsys_makeinfotype(i_mpipnt, i_mpilen, i_mpitypes) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_mpipnt, i_mpilen + INTEGER, DIMENSION(i_mpilen) :: i_mpitypes + INTEGER :: i_err + INTEGER :: i_mpitmp, i_cnt + INTEGER, PARAMETER :: i_mpii= 5 + INTEGER, DIMENSION(i_mpii) :: i_mpiicnt, i_mpiityp, i_mpiidis + TYPE (grid_glob) :: p_itmp + +!---------- behave differently according to the different data types + + i_err= MPI_SUCCESS + +!---------- check length + + IF(i_mpipnt > DEF_numtypes) CALL print_error(199) + +!---------- this is the element type + + info_typ: IF(i_mpipnt == DEF_infotype) THEN + +!---------- conter array + + i_mpiicnt= (/ 1, 1, 1, 1, 1 /) + +!---------- types array + + i_mpiityp= MPI_INTEGER + +!---------- address displacements array + + CALL mpi_address(p_itmp%i_totalelements, i_mpiidis(1), i_err) + CALL mpi_address(p_itmp%i_fineelements, i_mpiidis(2), i_err) + CALL mpi_address(p_itmp%i_totaledges, i_mpiidis(3), i_err) + CALL mpi_address(p_itmp%i_fineedges, i_mpiidis(4), i_err) + CALL mpi_address(p_itmp%i_totalnodes, i_mpiidis(5), i_err) + i_mpitmp= i_mpiidis(1) + i_mpiidis= i_mpiidis- i_mpitmp + +!---------- type definition + + CALL mpi_type_struct(i_mpii, i_mpiicnt, i_mpiidis, i_mpiityp, i_mpitmp, i_err) + CALL mpi_type_commit(i_mpitmp, i_err) + i_mpitypes(i_mpipnt) = i_mpitmp + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + END IF info_typ + + RETURN + END SUBROUTINE parsys_makeinfotype + + END MODULE PAR_datatype diff --git a/flash2d/src/system/mpi/PAR_sysstop.f b/flash2d/src/system/mpi/PAR_sysstop.f new file mode 100644 index 0000000000000000000000000000000000000000..9664c5f5ceb1431bfc27fdaea217cd136ed3d80f --- /dev/null +++ b/flash2d/src/system/mpi/PAR_sysstop.f @@ -0,0 +1,74 @@ +!***************************************************************** +! +! MODULE NAME: +! PAR_sysstop +! FUNCTION: +! implementation specific part of the parallelization +! system stop for error handling +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! parsys_stop +! FUNCTION: +! gracefully finish parallelization +! SYNTAX: +! CALL parsys_stop +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! parsys_stop +! COMMENTS: +! this is for the MPI-1 standard +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 1/98 +! +!***************************************************************** + MODULE PAR_sysstop + + USE MISC_globalparam + +!---------- include the mpi definitions + + INCLUDE "mpif.h" + + PRIVATE + PUBLIC :: parsys_stop + + CONTAINS +!***************************************************************** + SUBROUTINE parsys_stop + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_err + +!---------- this is the implementation dependent finalize command + + CALL mpi_finalize(i_err) + + IF(i_err /= MPI_SUCCESS) THEN + WRITE(0,*) 'ERROR: [parsys_stop] Finalize routine has been executad unsuccessfully' + WRITE(0,*) 'ERROR: [parsys_stop] parallel error code:',i_err + END IF + + RETURN + END SUBROUTINE parsys_stop + + END MODULE PAR_sysstop diff --git a/flash2d/src/system/mpi/PAR_system.f b/flash2d/src/system/mpi/PAR_system.f new file mode 100644 index 0000000000000000000000000000000000000000..d625661fc2b7aeb89a5d98e2513dac7f677f1e15 --- /dev/null +++ b/flash2d/src/system/mpi/PAR_system.f @@ -0,0 +1,1085 @@ +!***************************************************************** +! +! MODULE NAME: +! PAR_system +! FUNCTION: +! implementation specific part of the parallelization +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! parsys_singlesided +! FUNCTION: +! test if singlesided communication is available +! SYNTAX: +! logical= parsys_singlesided() +! ON INPUT: +! +! ON OUTPUT: +! l_sing: true if single sided comm. available LOGICAL +! CALLS: +! +! COMMENTS: +! this has to be set by hand +!----------------------------------------------------------------- +! +! NAME: +! parsys_usertypes +! FUNCTION: +! test if user defined (derived) types are supported +! SYNTAX: +! logical= parsys_usertypes() +! ON INPUT: +! +! ON OUTPUT: +! l_types: true if user types are supported LOGICAL +! CALLS: +! +! COMMENTS: +! this has to be set by hand +!----------------------------------------------------------------- +! +! NAME: +! parsys_init +! FUNCTION: +! initialize the parallelization library +! SYNTAX: +! CALL parsys_init +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_totprocs +! FUNCTION: +! total number of processors +! SYNTAX: +! CALL parsys_totprocs(int) +! ON INPUT: +! +! ON OUTPUT: +! i_num: total number of procs INTEGER +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_mynumber +! FUNCTION: +! the local processor id +! SYNTAX: +! CALL parsys_mynumber(int) +! ON INPUT: +! +! ON OUTPUT: +! i_num: my local process id INTEGER +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_quit +! FUNCTION: +! gracefully finish parallelization +! SYNTAX: +! CALL parsys_quit +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_barrier +! FUNCTION: +! calling interface to barrier routine +! SYNTAX: +! CALL parsys_barrier +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_bcast +! FUNCTION: +! broadcast data items to all other processes +! SYNTAX: +! CALL parsys_bcast(int, int, int, *.arr) +! ON INPUT: +! i_rootid: sender's process id INTEGER +! i_length: length of array INTEGER +! i_type: data type handle INTEGER +! i_arr: integer array (optional) INTEGER +! r_arr: real array (optional) REAL +! e_arr: element array (optional) TYPE (elmt) +! g_arr: edge array (optional) TYPE (edge) +! n_arr: node array (optional) TYPE (node) +! t_arr: info array (optional) TYPE (grid_glob) +! ON OUTPUT: +! i_arr: integer array (optional) INTEGER +! r_arr: real array (optional) REAL +! e_arr: element array (optional) TYPE (elmt) +! g_arr: edge array (optional) TYPE (edge) +! n_arr: node array (optional) TYPE (node) +! t_arr: info array (optional) TYPE (grid_glob) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_send +! FUNCTION: +! send data items to a remote process +! SYNTAX: +! CALL parsys_send(int, int, int, int, *.arr) +! ON INPUT: +! i_local: local process id (sender) INTEGER +! i_remot: remote process id (recipient) INTEGER +! i_length: length of array INTEGER +! i_type: data type handle INTEGER +! i_arr: integer array (optional) INTEGER +! r_arr: real array (optional) REAL +! e_arr: element array (optional) TYPE (elmt) +! g_arr: edge array (optional) TYPE (edge) +! n_arr: node array (optional) TYPE (node) +! t_arr: info array (optional) TYPE (grid_glob) +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! it is (in this release) assumed that we can use non-blocking +! send/recieve constructs +!----------------------------------------------------------------- +! +! NAME: +! parsys_recv +! FUNCTION: +! recieve data items from a remote process +! SYNTAX: +! CALL parsys_recv(int, int, int, int, *.arr) +! ON INPUT: +! i_local: local process id (sender) INTEGER +! i_remot: remote process id (recipient) INTEGER +! i_length: length of array INTEGER +! i_type: data type handle INTEGER +! ON OUTPUT: +! i_arr: integer array (optional) INTEGER +! r_arr: real array (optional) REAL +! e_arr: element array (optional) TYPE (elmt) +! g_arr: edge array (optional) TYPE (edge) +! n_arr: node array (optional) TYPE (node) +! t_arr: info array (optional) TYPE (grid_glob) +! CALLS: +! +! COMMENTS: +! it is (in this release) assumed that we can use non-blocking +! send/recieve constructs +!----------------------------------------------------------------- +! +! NAME: +! parsys_waitallrecv +! FUNCTION: +! wait until all nonblocking recieves are finished +! SYNTAX: +! CALL parsys_waitallrecv +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! uses a globally defined (but private in this module) array +! +! CAUTION: the counter for request counting is a buggy thing: +! when not waiting after each series of non-blocking recieves, +! it will potentially produce deadlocks, because it is set to +! a wrong number ... +!----------------------------------------------------------------- +! +! NAME: +! parsys_waitallrecvinit +! FUNCTION: +! initialize waiting after nonblocking recieves +! SYNTAX: +! CALL parsys_waitallrecvinit +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_procsum +! FUNCTION: +! sum up a scalar over all processors and distribute results to all +! SYNTAX: +! CALL parsys_procsum(int, int, real, real) +! ON INPUT: +! i_local: local variable (optional) INTEGER +! r_local: local variable (optional) REAL +! ON OUTPUT: +! i_global: global variable (optional) INTEGER +! r_global: global variable (optional) REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_procmin +! FUNCTION: +! global minimum local scalars of over all processors +! SYNTAX: +! CALL parsys_procmin(int, int, real, real) +! ON INPUT: +! i_local: local variable (optional) INTEGER +! r_local: local variable (optional) REAL +! ON OUTPUT: +! i_global: global variable (optional) INTEGER +! r_global: global variable (optional) REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_procmax +! FUNCTION: +! global maximum local scalars of over all processors +! SYNTAX: +! CALL parsys_procmax(int, int, real, real) +! ON INPUT: +! i_local: local variable (optional) INTEGER +! r_local: local variable (optional) REAL +! ON OUTPUT: +! i_global: global variable (optional) INTEGER +! r_global: global variable (optional) REAL +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! parsys_maketypes +! FUNCTION: +! create data types for communication of derived types +! SYNTAX: +! CALL parsys_maketypes +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! there is an array i_mpitypes, that holds data type info +! +!----------------------------------------------------------------- +! +! NAME: +! +! FUNCTION: +! +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! parsys_singlesided, parsys_usertypes, parsys_init, +! parsys_totprocs, parsys_mynumber, parsys_quit, parsys_bcast, +! parsys_barrier, parsys_send, parsys_recv, parsys_waitallrecv, +! parsys_maketypes +! COMMENTS: +! this is for the MPI-1 standard +! +! most of the routines in this module are just translations of the +! mpi naming into a local library-independent naming. however, there +! are a few more complex routines, which concern the derived data +! types used in the mesh generation and finite-element-packages, this +! set of routines is made for. +! USES: +! MISC_globalparam, MISC_error, PAR_define +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 8/97 +! +!***************************************************************** + MODULE PAR_system + + USE MISC_globalparam + USE MISC_error + USE PAR_define + USE PAR_datatype + +!---------- include the mpi definitions + + INCLUDE "mpif.h" + + PRIVATE + PUBLIC :: parsys_singlesided, parsys_usertypes, parsys_init, & + parsys_totprocs, parsys_mynumber, parsys_quit, parsys_bcast, & + parsys_maketypes, parsys_barrier, parsys_send, parsys_recv, & + parsys_waitallrecv + +!---------- this is for user defined data types + INTEGER, DIMENSION(DEF_numtypes) :: i_mpitypes +!---------- these are the tag and status array for sending/recieving + INTEGER :: i_mpitag=17 + INTEGER, DIMENSION(MPI_STATUS_SIZE) :: i_mpistat +!---------- this is for non-blocking recieves (used in wait) + INTEGER, DIMENSION(:), ALLOCATABLE :: i_mpirecvreq, i_mpisendreq + INTEGER, DIMENSION(:,:), ALLOCATABLE :: i_mpistats + INTEGER :: i_mpirecvreqcount, i_mpisendreqcount + CONTAINS +!***************************************************************** + FUNCTION parsys_singlesided() RESULT (l_side) + + IMPLICIT NONE + +!---------- local declarations + + LOGICAL :: l_side + +!---------- this value is set manually (false for MPI) + + l_side= .FALSE. + + RETURN + END FUNCTION parsys_singlesided + +!***************************************************************** + FUNCTION parsys_usertypes() RESULT (l_types) + + IMPLICIT NONE + +!---------- local declarations + + LOGICAL :: l_types + +!---------- this value is set manually (true for MPI) + + l_types= .TRUE. + + RETURN + END FUNCTION parsys_usertypes + +!***************************************************************** + SUBROUTINE parsys_init + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_err, i_proc + LOGICAL :: l_ini + +!---------- check if initialization has already been performed + + CALL mpi_initialized(i_ini, i_err) + IF(i_ini) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'WARNING: [parsys_init] Parallel execution environment already initialized!' + RETURN + END IF + +!---------- this is the implementation dependent initialization + + CALL mpi_init(i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + +!---------- allocate data for nonblocking communications + + CALL mpi_comm_size(MPI_COMM_WORLD, i_proc, i_err) + ALLOCATE(i_mpirecvreq(i_proc), i_mpisendreq(i_proc), stat= i_err) + IF(i_err /= 0) THEN + CALL print_error(159) + END IF + i_mpisendreqcount= 0 + i_mpirecvreqcount= 0 + ALLOCATE(i_mpistats(MPI_STATUS_SIZE,i_proc), stat= i_err) + IF(i_err /= 0) THEN + CALL print_error(159) + END IF + + RETURN + END SUBROUTINE parsys_init + +!***************************************************************** + SUBROUTINE parsys_totprocs(i_num) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(out) :: i_num + INTEGER :: i_err + +!---------- this is the implementation dependent processor number + + CALL mpi_comm_size(MPI_COMM_WORLD, i_num, i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_totprocs + +!***************************************************************** + SUBROUTINE parsys_mynumber(i_num) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(out) :: i_num + INTEGER :: i_err + +!---------- this is the implementation dependent processor id + + CALL mpi_comm_rank(MPI_COMM_WORLD, i_num, i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + +!---------- first process id is 1 (for fortran array compatibility) + + i_num= i_num+ 1 + + RETURN + END SUBROUTINE parsys_mynumber + +!***************************************************************** + SUBROUTINE parsys_quit + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_err + LOGICAL :: l_ini + +!---------- check if parallel exec. environment is active + + CALL mpi_initialized(l_ini, i_err) + IF(.NOT. l_ini) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'WARNING: [parsys_quit] Parallel execution environment not active!' + RETURN + END IF + +!---------- this is the implementation dependent finalize command + + CALL mpi_finalize(i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + WRITE(i_ioerr,*) 'ERROR: [parsys_quit] Finalize routine has been executad unsuccessfully' + END IF + +!---------- deallocate data for nonblocking communications + + IF(allocated(i_mpirecvreq)) DEALLOCATE(i_mpirecvreq) + IF(allocated(i_mpisendreq)) DEALLOCATE(i_mpisendreq) + IF(allocated(i_mpistats)) DEALLOCATE(i_mpistats) + + RETURN + END SUBROUTINE parsys_quit + +!***************************************************************** + SUBROUTINE parsys_bcast(i_rootid, i_length, i_type, i_arr, r_arr, e_arr, & + g_arr, n_arr, t_arr) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_rootid, i_length, i_type + INTEGER, DIMENSION(i_length), OPTIONAL :: i_arr + REAL, DIMENSION(i_length), OPTIONAL :: r_arr + TYPE (elmt), DIMENSION(i_length), OPTIONAL :: e_arr + TYPE (edge), DIMENSION(i_length), OPTIONAL :: g_arr + TYPE (node), DIMENSION(i_length), OPTIONAL :: n_arr + TYPE (grid_glob), DIMENSION(i_length), OPTIONAL :: t_arr + INTEGER :: i_err + INTEGER :: i_mpitmp, i_mpiroot + + +!---------- do the broadcasting using the type identifier given + + i_mpitmp= i_mpitypes(i_type) + i_mpiroot= i_rootid- 1 + i_err = MPI_SUCCESS + +!---------- select type + + type_case: SELECT CASE (i_type) + CASE(DEF_inttype) type_case + IF(.NOT. present(i_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(i_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE(DEF_realtype) type_case + IF(.NOT. present(r_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(r_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE(DEF_elmttype) type_case + IF(.NOT. present(e_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(e_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE(DEF_edgetype) type_case + IF(.NOT. present(g_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(g_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE(DEF_nodetype) type_case + IF(.NOT. present(n_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(n_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE(DEF_infotype) type_case + IF(.NOT. present(t_arr)) THEN + CALL print_error(155) + END IF + CALL mpi_bcast(t_arr, i_length, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + CASE DEFAULT type_case + CALL print_error(154) + END SELECT type_case + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_bcast + +!***************************************************************** + SUBROUTINE parsys_gather(i_rootid, i_length, i_type, i_scl, i_arr, r_scl, r_arr) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_rootid, i_length, i_type + INTEGER :: i_scl + INTEGER, DIMENSION(i_length), OPTIONAL :: i_arr + REAL :: r_scl + REAL, DIMENSION(i_length), OPTIONAL :: r_arr + INTEGER :: i_err + INTEGER :: i_mpitmp, i_mpiroot + + +!---------- do the broadcasting using the type identifier given + + i_mpitmp= i_mpitypes(i_type) + i_mpiroot= i_rootid- 1 + i_err = MPI_SUCCESS + +!---------- select type + + type_case: SELECT CASE (i_type) + CASE(DEF_inttype) type_case + IF(present(i_arr) .AND. present(i_scl)) THEN + CALL mpi_gather(i_scl, 1, i_mpitmp, i_arr, 1, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + ELSE + CALL print_error(155) + END IF + CASE(DEF_realtype) type_case + IF(present(r_arr) .AND. present(r_scl)) THEN + CALL mpi_gather(r_scl, 1, i_mpitmp, r_arr, 1, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + ELSE + CALL print_error(155) + END IF + CASE DEFAULT type_case + CALL print_error(154) + END SELECT type_case + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_gather + +!***************************************************************** + SUBROUTINE parsys_scatter(i_rootid, i_length, i_type, i_scl, i_arr, r_scl, r_arr) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_rootid, i_length, i_type + INTEGER, OPTIONAL :: i_scl + INTEGER, DIMENSION(i_length), OPTIONAL :: i_arr + REAL, OPTIONAL :: r_scl + REAL, DIMENSION(i_length), OPTIONAL :: r_arr + INTEGER :: i_err + INTEGER :: i_mpitmp, i_mpiroot + + +!---------- do the broadcasting using the type identifier given + + i_mpitmp= i_mpitypes(i_type) + i_mpiroot= i_rootid- 1 + i_err = MPI_SUCCESS + +!---------- select type + + type_case: SELECT CASE (i_type) + CASE(DEF_inttype) type_case + IF(present(i_arr) .AND. present(i_scl)) THEN + CALL mpi_scatter(i_arr, 1, i_mpitmp, i_scl, 1, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + ELSE + CALL print_error(155) + END IF + CASE(DEF_realtype) type_case + IF(present(r_arr) .AND. present(r_scl)) THEN + CALL mpi_scatter(r_arr, 1, i_mpitmp, r_scl, 1, i_mpitmp, i_mpiroot, MPI_COMM_WORLD, i_err) + ELSE + CALL print_error(155) + END IF + CASE DEFAULT type_case + CALL print_error(154) + END SELECT type_case + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_scatter + +!***************************************************************** + SUBROUTINE parsys_barrier + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_err + +!---------- this is the implementation dependent processor number + + CALL mpi_barrier(MPI_COMM_WORLD, i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_barrier + +!***************************************************************** + SUBROUTINE parsys_send(i_local, i_remot, i_length, i_type, i_arr, & + r_arr, e_arr, g_arr, n_arr, t_arr) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_local, i_remot, i_length, i_type + INTEGER, DIMENSION(i_length), OPTIONAL :: i_arr + REAL, DIMENSION(i_length), OPTIONAL :: r_arr + TYPE (elmt), DIMENSION(i_length), OPTIONAL :: e_arr + TYPE (edge), DIMENSION(i_length), OPTIONAL :: g_arr + TYPE (node), DIMENSION(i_length), OPTIONAL :: n_arr + TYPE (grid_glob), DIMENSION(i_length), OPTIONAL :: t_arr + INTEGER :: i_err + INTEGER :: i_mpitmp, i_mpiremot, i_mpilocal + + +!---------- do the broadcasting using the type identifier given + + i_mpitmp= i_mpitypes(i_type) + i_err = MPI_SUCCESS + i_mpisendreqcount= i_mpisendreqcount+ 1 + i_mpilocal= i_local- 1 + i_mpiremot= i_remot- 1 + +!---------- select type + + type_case: SELECT CASE (i_type) + CASE(DEF_inttype) type_case + IF(.NOT. present(i_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(i_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE(DEF_realtype) type_case + IF(.NOT. present(r_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(r_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE(DEF_elmttype) type_case + IF(.NOT. present(e_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(e_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE(DEF_edgetype) type_case + IF(.NOT. present(g_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(g_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE(DEF_nodetype) type_case + IF(.NOT. present(n_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(n_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE(DEF_infotype) type_case + IF(.NOT. present(t_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_isend(t_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpisendreq(i_mpisendreqcount), i_err) + CASE DEFAULT type_case + CALL print_error(154) + END SELECT type_case + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_send + +!***************************************************************** + SUBROUTINE parsys_recv(i_local, i_remot, i_length, i_type, i_arr, & + r_arr, e_arr, g_arr, n_arr, t_arr) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in) :: i_local, i_remot, i_type, i_length + INTEGER, DIMENSION(i_length), OPTIONAL :: i_arr + REAL, DIMENSION(i_length), OPTIONAL :: r_arr + TYPE (elmt), DIMENSION(i_length), OPTIONAL :: e_arr + TYPE (edge), DIMENSION(i_length), OPTIONAL :: g_arr + TYPE (node), DIMENSION(i_length), OPTIONAL :: n_arr + TYPE (grid_glob), DIMENSION(i_length), OPTIONAL :: t_arr + INTEGER :: i_err + INTEGER :: i_mpitmp, i_mpiremot, i_mpilocal + + +!---------- do the broadcasting using the type identifier given + + i_mpitmp= i_mpitypes(i_type) + i_err = MPI_SUCCESS + i_mpirecvreqcount= i_mpirecvreqcount+ 1 + i_mpilocal= i_local- 1 + i_mpiremot= i_remot- 1 + +!---------- select type + + type_case: SELECT CASE (i_type) + CASE(DEF_inttype) type_case + IF(.NOT. present(i_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(i_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE(DEF_realtype) type_case + IF(.NOT. present(r_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(r_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE(DEF_elmttype) type_case + IF(.NOT. present(e_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(e_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE(DEF_edgetype) type_case + IF(.NOT. present(g_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(g_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE(DEF_nodetype) type_case + IF(.NOT. present(n_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(n_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE(DEF_infotype) type_case + IF(.NOT. present(t_arr)) THEN + CALL print_error(157) + END IF + CALL mpi_irecv(t_arr, i_length, i_mpitmp, i_mpiremot, i_mpitag, & + MPI_COMM_WORLD, i_mpirecvreq(i_mpirecvreqcount), i_err) + CASE DEFAULT type_case + CALL print_error(154) + END SELECT type_case + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_recv + +!***************************************************************** + SUBROUTINE parsys_waitallrecv + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_mpimaxcount, i_err + +!---------- derive the number of requests + + i_mpimaxcount= i_mpirecvreqcount + +!---------- call wait + + CALL mpi_waitall(i_mpimaxcount, i_mpirecvreq, i_mpistats, i_err) + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_waitallrecv + +!***************************************************************** + SUBROUTINE parsys_waitallrecvinit + + IMPLICIT NONE + +!---------- local declarations + + i_mpirecvreqcount= 0 + i_mpirecvreq = 0 + + RETURN + END SUBROUTINE parsys_waitallrecvinit + +!***************************************************************** + SUBROUTINE parsys_procsum(i_local, i_global, r_local, r_global) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in), OPTIONAL :: i_local + INTEGER, INTENT(out), OPTIONAL :: i_global + REAL, INTENT(in), OPTIONAL :: r_local + REAL, INTENT(out), OPTIONAL :: r_global + INTEGER :: i_err + +!---------- act accordint to input + + in_type: IF(present(i_local)) THEN + IF(.NOT. present(i_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(i_local, i_global, 1, MPI_INTEGER, MPI_SUM, MPI_COMM_WORLD, i_err) + ELSE IF((present(r_local)) THEN in_type + IF(.NOT. present(r_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(r_local, r_global, 1, MPI_REAL, MPI_SUM, MPI_COMM_WORLD, i_err) + ELSE in_type + CALL print_error(161) + END IF in_type + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_procsum + +!***************************************************************** + SUBROUTINE parsys_procmin(i_local, i_global, r_local, r_global) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in), OPTIONAL :: i_local + INTEGER, INTENT(out), OPTIONAL :: i_global + REAL, INTENT(in), OPTIONAL :: r_local + REAL, INTENT(out), OPTIONAL :: r_global + INTEGER :: i_err + +!---------- act accordint to input + + in_type: IF(present(i_local)) THEN + IF(.NOT. present(i_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(i_local, i_global, 1, MPI_INTEGER, MPI_MIN, MPI_COMM_WORLD, i_err) + ELSE IF((present(r_local)) THEN in_type + IF(.NOT. present(r_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(r_local, r_global, 1, MPI_REAL, MPI_MIN, MPI_COMM_WORLD, i_err) + ELSE in_type + CALL print_error(161) + END IF in_type + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_procmin + +!***************************************************************** + SUBROUTINE parsys_procmax(i_local, i_global, r_local, r_global) + + IMPLICIT NONE + +!---------- local declarations + + INTEGER, INTENT(in), OPTIONAL :: i_local + INTEGER, INTENT(out), OPTIONAL :: i_global + REAL, INTENT(in), OPTIONAL :: r_local + REAL, INTENT(out), OPTIONAL :: r_global + INTEGER :: i_err + +!---------- act accordint to input + + in_type: IF(present(i_local)) THEN + IF(.NOT. present(i_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(i_local, i_global, 1, MPI_INTEGER, MPI_MAX, MPI_COMM_WORLD, i_err) + ELSE IF((present(r_local)) THEN in_type + IF(.NOT. present(r_global)) THEN + CALL print_error(161) + END IF + CALL mpi_allreduce(r_local, r_global, 1, MPI_REAL, MPI_MAX, MPI_COMM_WORLD, i_err) + ELSE in_type + CALL print_error(161) + END IF in_type + + IF(i_err /= MPI_SUCCESS) THEN + IF(i_iolog > 0) WRITE(i_iolog,*) 'ERROR: parallel error code:',i_err + CALL print_error(160) + END IF + + RETURN + END SUBROUTINE parsys_procmax + +!***************************************************************** + SUBROUTINE parsys_maketypes + + IMPLICIT NONE + +!---------- local declarations + + INTEGER :: i_cnt + +!---------- behave differently according to the different data types + + all_types: DO i_cnt= 1, DEF_numtypes + +!---------- tis is the normal integer type + + IF(i_cnt == DEF_inttype) THEN + + CALL parsys_makeintype(i_cnt, DEF_numtypes, i_mpitypes) + +!---------- tis is the normal real type + + ELSE IF(i_cnt == DEF_realtype) THEN + + CALL parsys_makerealype(i_cnt, DEF_numtypes, i_mpitypes) + +!---------- here we define the element type + + ELSE IF(i_cnt == DEF_elmttype) THEN + + CALL parsys_makeelmtype(i_cnt, DEF_numtypes, i_mpitypes) + +!---------- here we define the edge type + + ELSE IF(i_cnt == DEF_edgetype) THEN + + CALL parsys_makeedgetype(i_cnt, DEF_numtypes, i_mpitypes) + +!---------- here we define the node type + + ELSE IF(i_cnt == DEF_nodetype) THEN + + CALL parsys_makenodetype(i_cnt, DEF_numtypes, i_mpitypes) + +!---------- here we define the info type + + ELSE IF(i_cnt == DEF_infotype) THEN + + CALL parsys_makeinfotype(i_cnt, DEF_numtypes, i_mpitypes) + + END IF + END DO all_types + + RETURN + END SUBROUTINE parsys_maketypes + + END MODULE PAR_system diff --git a/flash2d/src/system/nag-f90/MISC_system.f90 b/flash2d/src/system/nag-f90/MISC_system.f90 new file mode 100644 index 0000000000000000000000000000000000000000..0f13dbf6951c27b9728b3af84a0d77b57ae20ef5 --- /dev/null +++ b/flash2d/src/system/nag-f90/MISC_system.f90 @@ -0,0 +1,93 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_system +! FUNCTION: +! contains system dependent functions (e.g. command line io) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! sys_getcmdargs +! FUNCTION: +! same as getarg (read command line option) +! SYNTAX: +! call sys_getcmdargs(int, char) +! ON INPUT: +! i_pos: position of command line option integer +! ON OUTPUT: +! c_opt: option read from command line character string +! CALLS: +! +! COMMENTS: +! i_pos=0 returns the command itself +!----------------------------------------------------------------- +! +! NAME: +! sys_numcmdargs +! FUNCTION: +! same as iargc (tell number of command line options) +! SYNTAX: +! int= sys_numcmdargs +! ON INPUT: +! +! ON OUTPUT: +! i_argnum: number of command line items integer +! CALLS: +! +! COMMENTS: +! i_argnum excludes the command itself, thus i_argnum=0 +! indicates that there are no command line options given. +!----------------------------------------------------------------- +! +! PUBLIC: +! sys_getcmdargs, sys_numcmdargs +! COMMENTS: +! this is for the NAG NAGWare f90 compiler, +! supporting iargc and getarg when USEing f90_unix module +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 1/97 +! +!***************************************************************** + MODULE MISC_system + USE f90_unix + PRIVATE + PUBLIC :: sys_getcmdargs, sys_numcmdargs + CONTAINS +!***************************************************************** + SUBROUTINE sys_getcmdargs(i_pos, c_opt, i_len) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_pos + CHARACTER (len=*), INTENT(out) :: c_opt + INTEGER, OPTIONAL :: i_len + +!---------- read command line argument + + CALL getarg(i_pos, c_opt) + + RETURN + END SUBROUTINE sys_getcmdargs +!***************************************************************** + FUNCTION sys_numcmdargs() RESULT(i_argnum) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_argnum + + i_argnum= iargc() + + RETURN + END FUNCTION sys_numcmdargs + END MODULE MISC_system diff --git a/flash2d/src/system/posix-f90/MISC_system.f90 b/flash2d/src/system/posix-f90/MISC_system.f90 new file mode 100644 index 0000000000000000000000000000000000000000..f0fa082be70a442576f1302d5d2a395da1e32d53 --- /dev/null +++ b/flash2d/src/system/posix-f90/MISC_system.f90 @@ -0,0 +1,97 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_system +! FUNCTION: +! contains system dependent functions (e.g. command line io) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! sys_getcmdargs +! FUNCTION: +! same as getarg (read command line option) +! SYNTAX: +! call sys_getcmdargs(int, char) +! ON INPUT: +! i_pos: position of command line option integer +! ON OUTPUT: +! c_opt: option read from command line character string +! CALLS: +! +! COMMENTS: +! i_pos=0 returns the command itself +!----------------------------------------------------------------- +! +! NAME: +! sys_numcmdargs +! FUNCTION: +! same as iargc (tell number of command line options) +! SYNTAX: +! int= sys_numcmdargs +! ON INPUT: +! +! ON OUTPUT: +! i_argnum: number of command line items integer +! CALLS: +! +! COMMENTS: +! i_argnum excludes the command itself, thus i_argnum=0 +! indicates that there are no command line options given. +!----------------------------------------------------------------- +! +! PUBLIC: +! sys_getcmdargs, sys_numcmdargs +! COMMENTS: +! this is for the CRAY CF90 compiler, +! supporting POSIX ipxfargc and pxfgetarg +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 1/97 +! +!***************************************************************** + MODULE MISC_system + PRIVATE + PUBLIC :: sys_getcmdargs, sys_numcmdargs + CONTAINS +!***************************************************************** + SUBROUTINE sys_getcmdargs(i_pos, c_opt, i_len) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_pos + CHARACTER (len=128), INTENT(out) :: c_opt + INTEGER, OPTIONAL :: i_len + INTEGER :: i_err + EXTERNAL pxfgetarg + +!---------- this uses a POSIX routine. no error code is checked, no matching +!---------- of length is checked!!! + + CALL pxfgetarg(i_pos, c_opt, i_len, i_err) + + RETURN + END SUBROUTINE sys_getcmdargs +!***************************************************************** + FUNCTION sys_numcmdargs() RESULT(i_argnum) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_argnum + EXTERNAL ipxfargc + INTEGER :: ipxfargc + + i_argnum= ipxfargc() + + RETURN + END FUNCTION sys_numcmdargs + END MODULE MISC_system diff --git a/flash2d/src/system/std-f90/MISC_system.f90 b/flash2d/src/system/std-f90/MISC_system.f90 new file mode 100644 index 0000000000000000000000000000000000000000..ff04e7a0ebf48fc760d7d02df9ca9761e8c3e231 --- /dev/null +++ b/flash2d/src/system/std-f90/MISC_system.f90 @@ -0,0 +1,94 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_system +! FUNCTION: +! contains system dependent functions (e.g. command line io) +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! sys_getcmdargs +! FUNCTION: +! same as getarg (read command line option) +! SYNTAX: +! call sys_getcmdargs(int, char) +! ON INPUT: +! i_pos: position of command line option integer +! ON OUTPUT: +! c_opt: option read from command line character string +! CALLS: +! +! COMMENTS: +! i_pos=0 returns the command itself +!----------------------------------------------------------------- +! +! NAME: +! sys_numcmdargs +! FUNCTION: +! same as iargc (tell number of command line options) +! SYNTAX: +! int= sys_numcmdargs +! ON INPUT: +! +! ON OUTPUT: +! i_argnum: number of command line items integer +! CALLS: +! +! COMMENTS: +! i_argnum excludes the command itself, thus i_argnum=0 +! indicates that there are no command line options given. +!----------------------------------------------------------------- +! +! PUBLIC: +! sys_getcmdargs, sys_numcmdargs +! COMMENTS: +! this is for "standard" compilers, supporting iargc and getarg +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 1/97 +! +!***************************************************************** + MODULE MISC_system + PRIVATE + PUBLIC :: sys_getcmdargs, sys_numcmdargs + CONTAINS +!***************************************************************** + SUBROUTINE sys_getcmdargs(i_pos, c_opt, i_len) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER, INTENT(in) :: i_pos + CHARACTER (len=*), INTENT(out) :: c_opt + INTEGER, OPTIONAL :: i_len + EXTERNAL getarg + +!---------- read command line argument + + CALL getarg(i_pos, c_opt) + + RETURN + END SUBROUTINE sys_getcmdargs +!***************************************************************** + FUNCTION sys_numcmdargs() RESULT(i_argnum) + +!---------- local declarations + + IMPLICIT NONE + + INTEGER :: i_argnum + EXTERNAL iargc + INTEGER :: iargc + + i_argnum= iargc() + + RETURN + END FUNCTION sys_numcmdargs + END MODULE MISC_system diff --git a/flash2d/src/timing/MISC_timing.f90 b/flash2d/src/timing/MISC_timing.f90 new file mode 100644 index 0000000000000000000000000000000000000000..d1d5bbb64805c804084909c166da9be2b4677bf2 --- /dev/null +++ b/flash2d/src/timing/MISC_timing.f90 @@ -0,0 +1,324 @@ +!***************************************************************** +! +! MODULE NAME: +! MISC_timing +! FUNCTION: +! miscellaneaus utility routines +! CONTAINS: +! second, ticktock, stop_watch +!----------------------------------------------------------------- +! +! NAME: +! stop_watch_init +! FUNCTION: +! initialize time measurement +! SYNTAX: +! CALL stop_watch_init(int, char, rtinfo) +! ON INPUT: +! i_number: number of timers in timer structure INTEGER +! c_strings: strings describing the code segments CHARACTER*16 +! p_tsinfo: runtime info data structure TYPE (rt_info) +! ON OUTPUT: +! p_tsinfo: runtime info data structure (updated) TYPE (rt_info) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! NAME: +! stop_watch +! FUNCTION: +! measure time for a code segment and put info in runtime structure +! SYNTAX: +! CALL stop_watch(char, int, rtinfo) +! ON INPUT: +! c_action: start or stop the watch CHARACTER*5 +! i_ident: identification for the timer INTEGER +! p_tsinfo: runtime info data structure TYPE (rt_info) +! ON OUTPUT: +! p_tsinfo: runtime info data structure (updated) TYPE (rt_info) +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! NAME: +! second +! FUNCTION: +! calculate actual second for timing +! SYNTAX: +! real= second() +! ON INPUT: +! +! ON OUTPUT: +! second: actual second measured from 1/1/1996 real +! CALLS: +! +! COMMENTS: +! if no system clock is available, result is negative +! +!----------------------------------------------------------------- +! NAME: +! ticktock +! FUNCTION: +! fortran 90 portable timing routine +! SYNTAX: +! real= ticktock(overhead= real, start= real) +! ON INPUT: +! overhead: if present, overhead is subtracted real +! start: first call to tick real +! ON OUTPUT: +! overhead: if present, overhead is computed real +! ticktock: time of program segment real +! CALLS: +! +! COMMENTS: +! this routine has different functionalities: +! on 1st call: +! r_sta = ticktock(overhead= r_ovh) +! or +! r_sta = ticktock() +! gives back the starting tick mark for timing in r_sta and, if +! requested, the overhead for calling the timing routine in r_ovh +! on second call: +! r_tim= ticktock(start=r_sta) +! or +! r_tim= ticktock(start=r_sta, overhead= r_ovh) +! gives back the time in [s] for the program segment in r_tim, +! additionally, the overhead given by r_ovh is subtracted from total +! time +! +! the convention is: +! noting is given: first call +! only overhead is given: first call +! only start is given following call +! overhead and start are given: following call +! +!----------------------------------------------------------------- +! PUBLIC: +! stop_watch, stop_watch_init +! COMMENTS: +! +! USES: +! MISC_globalparam +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens 7/96 +! 2. stop_watch changed j. behrens 1/97 +! stop_watch_init added +! 3. changed for self consistency j. behrens 1/97 +! 4. fixed ticktock j. behrens 3/98 +! 5. changed to be completely +! self-consistent j. behrens 12/2000 +! +!***************************************************************** + MODULE MISC_timing + INTEGER, PARAMETER :: i_ioerr= 0 + PRIVATE + +!---------- structure for timing + + INTEGER, PARAMETER :: DEF_timings= 10 ! number of different timers + + TYPE time_info + CHARACTER (len=16) :: c_tim + REAL :: r_tim + REAL :: r_lap + END TYPE time_info + TYPE sw_info + INTEGER :: i_num + TYPE (time_info), DIMENSION(DEF_timings) :: p_tim + END TYPE sw_info + + PUBLIC :: stop_watch, stop_watch_init, time_info, sw_info, DEF_timings + CONTAINS +!***************************************************************** + SUBROUTINE stop_watch_init(i_number, c_strings, p_tsinfo) + +!---------- local declarations + + IMPLICIT NONE + INTEGER, INTENT(in) :: i_number + CHARACTER (len=16), INTENT(in), DIMENSION(i_number) :: c_strings + TYPE (sw_info), INTENT(inout) :: p_tsinfo + INTEGER :: i_cnt + +!---------- initialize + + p_tsinfo%i_num = 0 + +!---------- consistency check + + check_con: IF(i_number > DEF_timings) THEN + write(i_ioerr,*) 'TIMING: Initialization of timers omitted several' + RETURN + ELSE check_con + +!---------- set number of timers in this structure + + p_tsinfo%i_num = min(DEF_timings, i_number) + +!---------- initialize info structure + + main_loop: DO i_cnt=1, p_tsinfo%i_num + p_tsinfo%p_tim(i_cnt)%c_tim= c_strings(i_cnt) + p_tsinfo%p_tim(i_cnt)%r_tim= 0.0 + p_tsinfo%p_tim(i_cnt)%r_lap= 0.0 + END DO main_loop + END IF check_con + + RETURN + END SUBROUTINE stop_watch_init + +!***************************************************************** + SUBROUTINE stop_watch(c_action, i_ident, p_tsinfo) + +!---------- local declarations + + IMPLICIT NONE + CHARACTER (len= 5), INTENT(in) :: c_action + INTEGER, INTENT(in) :: i_ident + TYPE (sw_info), INTENT(inout) :: p_tsinfo + REAL :: r_tmp + +!---------- consistency check + + check_con: IF(i_ident > p_tsinfo%i_num) THEN + write(i_ioerr,*) 'TIMING: Identification not correct, nothing done' + RETURN + END IF check_con + +!---------- action start: + + start_stop: IF(c_action(1:4) == 'star') THEN + p_tsinfo%p_tim(i_ident)%r_lap= ticktock() + +!---------- action stop: + + ELSE IF(c_action(1:4) == 'stop') THEN start_stop + r_tmp= ticktock(start= p_tsinfo%p_tim(i_ident)%r_lap) + p_tsinfo%p_tim(i_ident)%r_tim= p_tsinfo%p_tim(i_ident)%r_tim+ r_tmp + +!---------- not supported + + ELSE start_stop + write(i_ioerr,*) 'TIMING: No supported action given: ', c_action + END IF start_stop + + RETURN + END SUBROUTINE stop_watch + +!***************************************************************** + FUNCTION second() RESULT (times) + +!---------- local declarations + + IMPLICIT NONE + + REAL :: times +! CHARACTER (len=8) :: a_date + INTEGER, PARAMETER :: i_start= 19960101 + INTEGER, PARAMETER :: i_dsecs= 86400 + INTEGER, DIMENSION(10) :: i_time + REAL, PARAMETER :: r_mil=1/1000. + REAL, PARAMETER :: r_sec=1. + REAL, PARAMETER :: r_min=60.*r_sec + REAL, PARAMETER :: r_hor=60.*r_min + REAL, PARAMETER :: r_day=24.*r_hor +! REAL, PARAMETER :: r_yea=365.*r_day +! INTEGER :: i_day, i_mult + INTEGER :: i_cnt, i_rte + INTEGER :: i_total + +!---------- CALL date_and_time for day info + +! CALL date_and_time(date= a_date) +! date_ok: IF(a_date /= ' ') THEN +! read(a_date,*) i_day +! i_mult= abs(i_day- i_start) +! ELSE date_ok +! i_mult= 1 +! END IF date_ok + +!---------- CALL date_and_time for easy time access + + CALL date_and_time(values=i_time) + date_ok: IF(i_time(1) /= -HUGE(0)) THEN + times= r_day* i_time(3)+ & + r_hor* i_time(5)+ & + r_min* i_time(6)+ & + r_sec* i_time(7)+ & + r_mil* i_time(8) + ELSE date_ok + times= -1.0 + END IF date_ok + +!---------- CALL system_clock for maximum precision clock + +! CALL system_clock(count= i_cnt, count_rate= i_rte) +! clock_ok: IF(i_rte /= 0) THEN +! i_total= i_cnt+ i_mult* i_dsecs +! i_total= i_cnt +! times= float(i_total)/ float(i_rte) +! ELSE clock_ok +! times= -1.0 +! END IF clock_ok + + RETURN + + END FUNCTION second +!***************************************************************** + FUNCTION ticktock(start, overhead) RESULT (timing) + +!---------- local declarations + + IMPLICIT NONE + + REAL, OPTIONAL, INTENT(inout) :: overhead + REAL, OPTIONAL, INTENT(in) :: start + REAL :: timing + INTEGER, PARAMETER :: i_loop= 10 + INTEGER :: i + REAL :: r_tm, r_t1, r_tsum + +!---------- initialize + + timing=0.0 + +!---------- check presence of input variables and act accordingly + +!---------- second call to ticktock + start_present: IF(present(start)) THEN + overhead_present: IF(present(overhead)) THEN + r_tm= second()- start- overhead + ELSE overhead_present + r_tm= second()- start + END IF overhead_present + +!---------- first call to ticktock + ELSE start_present + overhead_requested: IF(present(overhead)) THEN + r_tsum= 0.0 + DO i=2, i_loop + r_t1= second() + r_tm= second() + r_tsum= r_tsum+ (r_tm- r_t1) + END DO + overhead= r_tsum/float(i_loop) + r_tm= second() + ELSE overhead_requested + r_tm= second() + END IF overhead_requested + END IF start_present + +!---------- result + + timing= r_tm + + RETURN + END FUNCTION ticktock + END MODULE MISC_timing diff --git a/flash2d/templates/header.f b/flash2d/templates/header.f new file mode 100644 index 0000000000000000000000000000000000000000..24ed1d1f840486de76a025119cf08ea4ad5b93b4 --- /dev/null +++ b/flash2d/templates/header.f @@ -0,0 +1,24 @@ +!***************************************************************** +! +! NAME: +! +! FUNCTION: +! +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens /96 +! +!***************************************************************** diff --git a/flash2d/templates/header.h b/flash2d/templates/header.h new file mode 100644 index 0000000000000000000000000000000000000000..210dfc63b56c55e8d0cd6852bd3d397d168122f4 --- /dev/null +++ b/flash2d/templates/header.h @@ -0,0 +1,17 @@ +!***************************************************************** +! +! NAME: +! +! FUNCTION: +! +! VERSION(S): +! 1. original version j. behrens /96 +! +!***************************************************************** + + +!***************************************************************** +! +! END of include file '' +! +!***************************************************************** diff --git a/flash2d/templates/module_header.f b/flash2d/templates/module_header.f new file mode 100644 index 0000000000000000000000000000000000000000..251402ea2fda9b55730f7f79475e6bb7feeac96c --- /dev/null +++ b/flash2d/templates/module_header.f @@ -0,0 +1,42 @@ +!***************************************************************** +! +! MODULE NAME: +! +! FUNCTION: +! +! CONTAINS: +!----------------------------------------------------------------- +! +! NAME: +! +! FUNCTION: +! +! SYNTAX: +! +! ON INPUT: +! +! ON OUTPUT: +! +! CALLS: +! +! COMMENTS: +! +!----------------------------------------------------------------- +! +! PUBLIC: +! +! COMMENTS: +! +! USES: +! +! LIBRARIES: +! +! REFERENCES: +! +! VERSION(S): +! 1. original version j. behrens /96 +! +!***************************************************************** + MODULE + CONTAINS + END MODULE diff --git a/flash2d/templates/readtemplate b/flash2d/templates/readtemplate new file mode 100644 index 0000000000000000000000000000000000000000..858de488be05dbec2e75099032495544b3d6e75a --- /dev/null +++ b/flash2d/templates/readtemplate @@ -0,0 +1,16 @@ +************************************************************************** + FLASH90 + FLexible Adaptive Semi-Lagrangian Hack + written in Fortran 90 + +************************************************************************** + + CONTENTS OF THIS DIRECTORY "$(FLASHDIR)/lib" + +-------------------------------------------------------------------------- + + WHAT TO DO HERE: + +************************************************************************** + j. behrens, 8/98 +************************************************************************** diff --git a/flash2d/tools/runFLASH b/flash2d/tools/runFLASH new file mode 100644 index 0000000000000000000000000000000000000000..107c0cf4c945bc049b578a4f161367d443ec3b32 --- /dev/null +++ b/flash2d/tools/runFLASH @@ -0,0 +1,329 @@ +#!/bin/sh + + +#Basic settings and initialization + +paramfile="./param.dat" + +grid_coarse="" +grid_fine="" +method="" +timestep_finish="" +wind="" + +diagnostics="" +output_file="" +gmv_plot="0" +help="" + +# read existing Parameters.dat and set values +# to be done in a later version + + +# set parameters given at prompt +# values like wind and method depend on the settings in the Makefile for FLASH +if (test -n "$1"); then + while (test -n "$1"); do + case "$1" in + -gc) + if (test -n "$2"); then + grid_coarse="$2" + shift + else + help="1" + fi;; + -gf) + if (test -n "$2"); then + grid_fine="$2" + shift + else + help="1" + fi;; + -m) + if (test -n "$2"); then + case "$2" in + Plain) + method="Plain";; + CI) + method="Cellintegrated";; + CW) + method="Dual";; + MPSLM) + method="$2";; + Priestley) + method="Conservative";; + Quad) + method="Quadrature";; + Analytic) + method="$2";; + *) + help="1";; + esac + shift + else + help="1" + fi;; + -t) + if (test -n "$2"); then + timestep_finish="$2" + shift + else + help="1" + fi;; + -w) + if (test -n "$2"); then + case "$2" in + CircWind) + wind="$2";; + ConvWind) + wind="$2";; + DiagWind) + wind="$2";; + Kaeser) + wind="$2";; + *) + help="1";; + esac + shift + else + help="1" + fi;; + -d) + diagnostics="1";; + -gmv) + gmv_plot="1";; + -o) + output_file="1";; + "-?"|"--help"|"-help") + help="1";; + *) + echo "unknown option: "$1 + exit ;; + esac + shift + done +else + help="1" +fi + +# for debugging only +#echo "gc:"$grid_coarse +#echo "gf:"$grid_fine +#echo "t:"$timestep_finish +#echo "m:"$method +#echo "w:"$wind + +if (test -z "$grid_coarse") || (test -z "$grid_fine") || (test -z "$timestep_finish") || (test -z "$method") || (test -z "$wind"); then + help="1" +fi + +#Some help wanted? + +if (test -n "$help"); then + echo "-------------------------------------" + echo " runFLASH Version 0.1" + echo " by Lars Mentrup 2004" + echo "-------------------------------------" + echo + echo "Script to run FLASH automatically." + echo "1. Creates user defined Parameters file corresponding to given Parameters." + echo "2. Compiles the given method and wind into FLASH executable." + echo "3. Runs FLASH with the created Parameters file." + echo "4. Renames the outputfiles (gmv,matlab,diagnosis,out) to a [method_wind_coarse-grid_fine-grid]" + echo " specific name." + echo + echo "Specify the following options:" + echo + echo " Essential parameters:" + echo -e " -gc # \t\t Coarse grid level" + echo -e " -gf # \t\t Fine grid level" + echo -e " -m [method] \t\t Method used (Possible: Plain, CI, CW, MPSLM, Priestley, Quad, Analytic)" + echo -e " -t # \t\t Number of timesteps " + echo -e " -w [windfield] \t\t What kind of wind (Possible: CircWind, ConvWind, DiagWind, Kaeser)" + echo + echo -e " Optional parameters:" + echo -e " -d \t\t turn diagnostics on (default: off)" + echo -e " -gmv \t\t turn GMV plot on (default: off)" + echo -e " -o \t\t save output into File (default: off)" + echo + exit +fi + + + + +#Create Parameters.dat according to given options + +echo "#-----------------------------------------------------------" > $paramfile +echo "# Input file for batch mode input">>$paramfile +echo "# input is controlled via keywords">>$paramfile +echo "#">>$paramfile +echo "# j. behrens 12/96">>$paramfile +echo "#-----------------------------------------------------------">>$paramfile + +echo "# the experiment no. (0 for a new experiment) [integer]">>$paramfile +echo "EXPERIMENT_NUMBER">>$paramfile +echo "0">>$paramfile + +echo "# desired maximum level of refinements [integer]">>$paramfile +echo "FINE_GRID_LEVEL">>$paramfile +echo $grid_fine>>$paramfile + +echo "# minimum level of refinements [integer]">>$paramfile +echo "COARSE_GRID_LEVEL">>$paramfile +echo $grid_coarse>>$paramfile + +echo "# tolerance for refinement [real]">>$paramfile +echo "TOLERANCE_OF_REFINEMENT">>$paramfile +echo "0.2">>$paramfile + +echo "# tolerance for coarsening [real]">>$paramfile +echo "TOLERANCE_OF_COARSENING">>$paramfile +echo "0.1">>$paramfile + +echo "# watermark for refinement [real]">>$paramfile +echo "WATERMARK_OF_REFINEMENT">>$paramfile +echo "0.01">>$paramfile + +echo "# watermark for coarsening [real]">>$paramfile +echo "WATERMARK_OF_COARSENING">>$paramfile +echo "0.01">>$paramfile + +echo "# timestep length [real]">>$paramfile +echo "TIMESTEP_LENGTH">>$paramfile +echo "1800.">>$paramfile + +echo "# first timestep [integer]">>$paramfile +echo "BEGINNING_TIMESTEP">>$paramfile +echo "1">>$paramfile + +echo "# last timestep [integer]">>$paramfile +echo "FINISHING_TIMESTEP">>$paramfile +echo $timestep_finish>>$paramfile + +echo "# plot in matlab style to file (no plot = 0) [integer]">>$paramfile +echo "MATLAB_PLOTTING">>$paramfile +echo $gmv_plot>>$paramfile + +echo "# plot in gmv style to file (no plot = 0) [integer]">>$paramfile +echo "GMV_FILE_PLOTTING">>$paramfile +echo $gmv_plot>>$paramfile + +echo "# timesteps between plots [integer]">>$paramfile +echo "STEPS_BTW_PLOTS">>$paramfile +echo "1">>$paramfile + +echo "# timesteps between saves [integer]">>$paramfile +echo "STEPS_BTW_SAVES">>$paramfile +echo "500">>$paramfile + +echo "# save last timestep for next experiment (no = 0) [integer]">>$paramfile +echo "SAVE_FINISH_CONFIGURATION">>$paramfile +echo "0">>$paramfile + +echo "# plot a polygonal line from file (if given) [character]">>$paramfile +echo "POLYGON_FILE_NAME">>$paramfile +echo "Land.dat">>$paramfile + +echo "# take advecting wind from file (if given) [character]">>$paramfile +echo "WIND_FILE_NAME">>$paramfile +echo "Windparam.dat">>$paramfile + +echo "# file defining the domain [character]">>$paramfile +echo "DOMAIN_FILE_NAME">>$paramfile +echo "Domain.dat">>$paramfile + +echo "# file defining the initial triangulation [character]">>$paramfile +echo "TRIANG_FILE_NAME">>$paramfile +echo "Triang.dat">>$paramfile + +echo "# number of iterations in trajectory estimation [integer]">>$paramfile +echo "SLM_ITERATION_NUMBER">>$paramfile +echo "4">>$paramfile +echo "#-----------------------------------------------------------">>$paramfile +echo "# END OF FILE">>$paramfile +echo "#-----------------------------------------------------------">>$paramfile + +# Empty directory of earlier outputs + +if (test -r "./Flash90_diag.0000"); then + rm ./Flash90_diag.0000 +fi +if (test -r "./Flash90.out"); then + rm ./Flash90.out +fi +if (test -r "./Flash90_gmv.0000"); then + rm ./Flash90_gmv.* +fi +if (test -r "./Flash90_matlab.0000"); then + rm ./Flash90_matlab.* +fi +rm ./matlab_* + + +# Compile the right FLASH version; incorporate method and windfield +if (test ! -r "./FLASH"); then + echo "No compiled version of FLASH found. Trying to make one." + make FLASH > /dev/null + if (test ! -r "./FLASH"); then + echo "Failed." + exit + fi +fi + +# Get input files for FLASH +if (test ! -r "./Triang.dat"); then + echo "Copying initial data." + make datacopy +fi + +#Compile method and wind +if (test $method = "Plain"); then + make FLASH +else + make $method +fi + +echo make $wind +make $wind +make executable + + +# Put the command string together according to options +execute="./FLASH -b " +if (test -n "$diagnostics"); then + execute=$execute"-d " +fi +if (test -n "$output_file"); then + execute=$execute"-o " +fi +execute=$execute"-f "$paramfile + + + +echo Using these parameters: Method: $method Windfield: $wind Coarse grid: $grid_coarse Fine grid:$grid_fine Last timestep:$timestep_finish +echo $execute + +# Start FLASH +$execute + + +# Rename produced files according to method, wind and grid +if (test -n "$diagnostics"); then + mv Flash90_diag.0000 "diagnosis_"$method"_"$wind"_"$grid_coarse"_"$grid_fine".txt" +fi + +if (test -n "$output_file"); then + mv Flash90.out "out_"$method"_"$wind"_"$grid_coarse"_"$grid_fine".txt" +fi + +if (test $gmv_plot = "1"); then + if (test -r "gmv_"$method"_"$wind"_"$grid_coarse"_"$grid_fine".0000"); then + rm "gmv_"$method"_"$wind"_"$grid_coarse"_"$grid_fine"."* + fi +# rename Flash90_gmv. "gmv_"$method"_"$wind"_"$grid_coarse"_"$grid_fine"." * +# + for file in Flash90_gmv.*; do mv $file `echo $file | sed 's/\(Flash90_gmv.\)/gmv_'$method'_'$wind'_'$grid_coarse'_'$grid_fine'.'/` ; done + for file in Flash90_matlab.*; do mv $file `echo $file | sed 's/\(Flash90_matlab.\)/matlab_'$method'_'$wind'_'$grid_coarse'_'$grid_fine'.'/` ; done + for file in Flash90_netcdf.*; do mv $file `echo $file | sed 's/\(Flash90_netcdf.\)/netcdf_'$method'_'$wind'_'$grid_coarse'_'$grid_fine'.'/` ; done +fi diff --git a/flash2d/tools/testreihe b/flash2d/tools/testreihe new file mode 100644 index 0000000000000000000000000000000000000000..7f5a0fed88a9d77bcf582c4c1804eceb0186cc50 --- /dev/null +++ b/flash2d/tools/testreihe @@ -0,0 +1,175 @@ +#!/bin/sh + +grid_coarse="" +grid_fine="" +timesteps="" +help="0" + +circ="0" +conv="0" +diag="0" +kaeser="0" + +Plain="0" +Analytic="0" +CW="0" +CI="0" +MPSLM="0" +Priestley="0" +Quad="0" + +execute="runFLASH " + +if (test -n "$1"); then + while (test -n "$1"); do + case "$1" in + -gc) + if (test -n "$2"); then + grid_coarse="$2" + shift + else + help="1" + fi ;; + -gf) + if (test -n "$2"); then + grid_fine="$2" + shift + else + help="1" + fi ;; + -t) + if (test -n "$2"); then + timesteps=$2 + shift + else + help="1" + fi ;; + -d) + execute=$execute"-d ";; + -gmv) + execute=$execute"-gmv ";; + -o) + execute=$execute"-o ";; + CircWind) + circ="1";; + ConvWind) + conv="1";; + DiagWind) + diag="1";; + Kaeser) + kaeser="1";; + Plain) + Plain="1";; + Analytic) + Analytic="1";; + CW) + CW="1";; + CI) + CI="1";; + MPSLM) + MPSLM="1";; + Priestley) + Priestley="1";; + Quad) + Quad="1";; + all) + Plain="1" + Analytic="1" + CW="1" + CI="1" + MPSLM="1" + Priestley="1" + Quad="1";; + "-?") + help="1";; + "-help") + help="1";; + "--help") + help="1";; + *) + echo "option unknown: "$1 + echo "Try testreihe -help" + exit;; + esac + shift + done +else + help="1" +fi + +if (test -z "$grid_coarse") || (test -z "$grid_fine") || (test -z "$timesteps") || (test ! -x ./runFLASH); then + help="1" +fi + +if test $help = "1"; then + echo "-------------------------------------" + echo " testreihe Version 0.2" + echo " by Lars Mentrup 2004" + echo "-------------------------------------" + echo + echo "Usage: testreihe -gc # -gf # -t # [Analytic][CI][CW][MPSLM][Priestley][Quad] [CircWind][ConvWind][DiagWind][Kaeser]" + echo + echo "Script to run multiple FLASH tests automatically." + echo "Runs runFLASH corresponding to given Parameters." + echo "You can give multiple methods/winds on prompt." + echo + echo "Specify the following options:" + echo + echo " Essential parameters:" + echo " -gc # \t\tCoarse grid level" + echo " -gf # \t\tFine grid level" + + echo " -t # \t\tNumber of timesteps " + + echo + echo " Optional parameters:" + echo " [method] \t\tMethods to use (At least one of: Plain, CI, CW, MPSLM, Priestley, Quad, Analytic)" + echo " [windfield] \t\tWhat kind of winds to use (At least one of: CircWind, ConvWind, DiagWind, Kaeser)" + echo " -d \t\tturn diagnostics on (default: off)" + echo " -gmv \t\tturn GMV plot on (default: off)" + echo " -o \t\tsave output into File (default: off)" + echo + exit +fi + +if test $circ = "1"; then + if test $Plain = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m Plain; fi + if test $Analytic = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m Analytic; fi + if test $CW = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m CW; fi + if test $CI = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m CI; fi + if test $MPSLM = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m MPSLM; fi + if test $Priestley = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m Priestley; fi + if test $Quad = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w CircWind -t $timesteps -m Quad; fi +fi + + +if test $conv = "1"; then + if test $Plain = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m Plain; fi + if test $Analytic = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m Analytic; fi + if test $CW = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m CW; fi + if test $CI = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m CI; fi + if test $MPSLM = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m MPSLM; fi + if test $Priestley = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m Priestley; fi + if test $Quad = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w ConvWind -t $timesteps -m Quad; fi +fi + + +if test "$diag" = "1";then + if test $Plain = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m Plain; fi + if test $Analytic = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m Analytic; fi + if test $CW = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m CW; fi + if test $CI = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m CI; fi + if test $MPSLM = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m MPSLM; fi + if test $Priestley = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m Priestley; fi + if test $Quad = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w DiagWind -t $timesteps -m Quad; fi +fi + +if test "$kaeser" = "1";then + if test $Plain = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m Plain; fi + if test $Analytic = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m Analytic; fi + if test $CW = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m CW; fi + if test $CI = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m CI; fi + if test $MPSLM = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m MPSLM; fi + if test $Priestley = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m Priestley; fi + if test $Quad = "1"; then $execute -gf $grid_fine -gc $grid_coarse -w Kaeser -t $timesteps -m Quad; fi +fi