Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GRAMSES_semi_public
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Cristian Barrera-Hinojosa
GRAMSES_semi_public
Commits
99e1cb06
Commit
99e1cb06
authored
4 years ago
by
Cristian Barrera-Hinojosa
Browse files
Options
Downloads
Patches
Plain Diff
compatible read_grav script including cell positions
parent
2858352e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bin/write_makefile.f90
+123
-75
123 additions, 75 deletions
bin/write_makefile.f90
poisson/output_poisson.f90
+6
-6
6 additions, 6 deletions
poisson/output_poisson.f90
readgrav_gr.py
+115
-0
115 additions, 0 deletions
readgrav_gr.py
submit.sh
+0
-28
0 additions, 28 deletions
submit.sh
with
244 additions
and
109 deletions
bin/write_makefile.f90
+
123
−
75
View file @
99e1cb06
...
...
@@ -10,102 +10,139 @@ subroutine output_makefile(filename)
format
=
"(A)"
open
(
unit
=
ilun
,
file
=
fileloc
,
form
=
'formatted'
)
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"#
If you have problems with this makefile, contact Romain.Teyssier
@gmail.com"
write
(
ilun
,
format
)
"#
Contact: cbarrera.hinojosa
@gmail.com
"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"# Compilation time parameters"
write
(
ilun
,
format
)
"NVECTOR = 64"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Do we want a debug build? 1=Yes, 0=No"
write
(
ilun
,
format
)
"DEBUG = 0"
write
(
ilun
,
format
)
"# Compiler flavor: GNU or INTEL"
write
(
ilun
,
format
)
"COMPILER = GNU"
write
(
ilun
,
format
)
"# Size of vector cache"
write
(
ilun
,
format
)
"NVECTOR = 32"
write
(
ilun
,
format
)
"# Number of dimensions"
write
(
ilun
,
format
)
"NDIM = 3"
write
(
ilun
,
format
)
"# Float precision size"
write
(
ilun
,
format
)
"NPRE = 8"
write
(
ilun
,
format
)
"NVAR = 5"
write
(
ilun
,
format
)
"NENER = 0"
write
(
ilun
,
format
)
"# hydro/mhd solver"
write
(
ilun
,
format
)
"SOLVER = hydro"
write
(
ilun
,
format
)
"PATCH = "
write
(
ilun
,
format
)
"# Patch"
write
(
ilun
,
format
)
"PATCH ="
write
(
ilun
,
format
)
"# Use RT? 1=Yes, 0=No"
write
(
ilun
,
format
)
"RT = 0"
write
(
ilun
,
format
)
"# Use MPI? 1=Yes, 0=No"
write
(
ilun
,
format
)
"MPI = 1"
write
(
ilun
,
format
)
"MPIF90 = mpif90"
write
(
ilun
,
format
)
"# Root name of executable"
write
(
ilun
,
format
)
"EXEC = gramses"
write
(
ilun
,
format
)
"# Number of additional energies"
write
(
ilun
,
format
)
"NENER = 0"
write
(
ilun
,
format
)
"# Use Grackle cooling? 1=Yes, 0=No"
write
(
ilun
,
format
)
"GRACKLE = 0"
write
(
ilun
,
format
)
"EXEC = ramses"
write
(
ilun
,
format
)
"# Number of metal species"
write
(
ilun
,
format
)
"NMETALS = 0"
write
(
ilun
,
format
)
"# ATON flages: Uncomment to enable ATON"
write
(
ilun
,
format
)
"ATON_FLAGS = #-DATON"
write
(
ilun
,
format
)
"# Number of ions for RT"
write
(
ilun
,
format
)
"NIONS = 0"
write
(
ilun
,
format
)
"# Number of photon groups for RT"
write
(
ilun
,
format
)
"NGROUPS = 0"
write
(
ilun
,
format
)
"# Number of passive scalars"
write
(
ilun
,
format
)
"NPSCAL = 0"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Compute NVAR"
write
(
ilun
,
format
)
"NVAR = 2+$(NDIM)"
write
(
ilun
,
format
)
"ifeq ($(SOLVER),mhd)"
write
(
ilun
,
format
)
" NVAR = 8"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"NVAR := $(NVAR)+$(NENER)+$(NPSCAL)+$(NMETALS)"
write
(
ilun
,
format
)
"ifeq ($(RT),1)"
write
(
ilun
,
format
)
" NVAR := $(NVAR)+$(NIONS)"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Set to one to use 'include
""
mpif.h
""
' instead of more recent
""
use mpi
""
"
write
(
ilun
,
format
)
"OLD_MPI_SUPPORT = 1"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"GITBRANCH = $(shell git rev-parse --abbrev-ref HEAD)"
write
(
ilun
,
format
)
"GITHASH = $(shell git log --pretty=format:'%H' -n 1)"
write
(
ilun
,
format
)
"GITREPO = $(shell git config --get remote.origin.url)"
write
(
ilun
,
format
)
"GITREMOTE = $(shell git config --get branch.$(GITBRANCH).remote)"
write
(
ilun
,
format
)
"GITREPO = $(shell git config --get remote.$(GITREMOTE).url)"
write
(
ilun
,
format
)
"BUILDDATE = $(shell date +
""
%D-%T
""
)"
write
(
ilun
,
format
)
"DEFINES = -DNVECTOR=$(NVECTOR) -DNDIM=$(NDIM) -DNPRE=$(NPRE) -DNENER=$(NENER)
-DNVAR=$(NVAR)
\"
write
(
ilun
,
format
)
" -D
SOLVER$(SOLVER
)"
write
(
ilun
,
format
)
"DEFINES = -DNVECTOR=$(NVECTOR) -DNDIM=$(NDIM) -DNPRE=$(NPRE) -DNENER=$(NENER) \"
write
(
ilun
,
format
)
" -D
NVAR=$(NVAR) -DSOLVER$(SOLVER) $(ATON_FLAGS
)"
write
(
ilun
,
format
)
"ifeq ($(GRACKLE),1)"
write
(
ilun
,
format
)
"DEFINES += -Dgrackle"
write
(
ilun
,
format
)
" DEFINES += -Dgrackle"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"ifeq ($(OLD_MPI_SUPPORT),1)"
write
(
ilun
,
format
)
" DEFINES += -DMPI_OLD"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"ifeq ($(RT),1)"
write
(
ilun
,
format
)
" DEFINES += -DRT -DNIONS=$(NIONS) -DNGROUPS=$(NGROUPS)"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"# Fortran compiler options and directives"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, gfortran -------------------------------"
write
(
ilun
,
format
)
"F90 = gfortran -O3 -frecord-marker=4 -fbacktrace -ffree-line-length-none -g"
write
(
ilun
,
format
)
"FFLAGS = -x f95-cpp-input $(DEFINES) -DWITHOUTMPI"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, tau ----------------------------------"
write
(
ilun
,
format
)
"#F90 = tau_f90.sh -optKeepFiles -optPreProcess -optCPPOpts=$(DEFINES) -DWITHOUTMPI"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, pgf90 ----------------------------------"
write
(
ilun
,
format
)
"#F90 = pgf90"
write
(
ilun
,
format
)
"#FFLAGS = -Mpreprocess $(DEFINES) -DWITHOUTMPI"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, xlf ------------------------------------"
write
(
ilun
,
format
)
"#F90 = xlf"
write
(
ilun
,
format
)
"#FFLAGS = -WF,-DNDIM=$(NDIM),-DNPRE=$(NPRE),-DNVAR=$(NVAR),-DSOLVER$(SOLVER),-DWITHOUTMPI -qfree=f90 -qsuffix=f=f90 -qsuffix=cpp=f90"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, f90 ------------------------------------"
write
(
ilun
,
format
)
"#F90 = f90"
write
(
ilun
,
format
)
"#FFLAGS = -cpp $(DEFINES) -DWITHOUTMPI"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- No MPI, ifort ----------------------------------"
write
(
ilun
,
format
)
"#F90 = ifort"
write
(
ilun
,
format
)
"#FFLAGS = -cpp $(DEFINES) -DWITHOUTMPI"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, gfortran syntax ------------------------------"
write
(
ilun
,
format
)
"#F90 = mpif90 -frecord-marker=4 -O3 -ffree-line-length-none -g -fbacktrace "
write
(
ilun
,
format
)
"#FFLAGS = -x f95-cpp-input $(DEFINES)"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, gfortran DEBUG syntax ------------------------------ "
write
(
ilun
,
format
)
"#F90 = mpif90 -frecord-marker=4 -ffree-line-length-none -fbacktrace -g -O -fbounds-check -Wuninitialized -Wall"
write
(
ilun
,
format
)
"#FFLAGS = -x f95-cpp-input -ffpe-trap=zero,underflow,overflow,invalid -finit-real=nan $(DEFINES) "
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, pgf90 syntax ------------------------------"
write
(
ilun
,
format
)
"#F90 = mpif90 -O3"
write
(
ilun
,
format
)
"#FFLAGS = -Mpreprocess $(DEFINES)"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, ifort syntax ------------------------------"
write
(
ilun
,
format
)
"#F90 = mpif90"
write
(
ilun
,
format
)
"#FFLAGS = -cpp -fast $(DEFINES) -DNOSYSTEM"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, ifort syntax, additional checks -----------"
write
(
ilun
,
format
)
"#F90 = mpif90"
write
(
ilun
,
format
)
"#FFLAGS = -warn all -O0 -g -traceback -fpe0 -ftrapuv -check bounds -cpp $(DEFINES) -DNOSYSTEM"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, ifort syntax ------------------------------"
write
(
ilun
,
format
)
"#F90 = ftn"
write
(
ilun
,
format
)
"#FFLAGS = -xAVX -g -traceback -fpp -fast $(DEFINES) -DNOSYSTEM #-DRT "
write
(
ilun
,
format
)
"# GNU compiler (gfortran)"
write
(
ilun
,
format
)
"ifeq ($(COMPILER),GNU)"
write
(
ilun
,
format
)
" FFLAGS = -x f95-cpp-input $(DEFINES) -std=legacy"
write
(
ilun
,
format
)
" ifeq ($(MPI),1)"
write
(
ilun
,
format
)
" F90 = $(MPIF90)"
write
(
ilun
,
format
)
" else"
write
(
ilun
,
format
)
" F90 = gfortran"
write
(
ilun
,
format
)
" FFLAGS += -DWITHOUTMPI"
write
(
ilun
,
format
)
" endif"
write
(
ilun
,
format
)
" F90 += -frecord-marker=4 -fbacktrace -ffree-line-length-none -g -fimplicit-none"
write
(
ilun
,
format
)
" ifeq ($(DEBUG),1)"
write
(
ilun
,
format
)
" F90 += -O0 -fbounds-check -Wuninitialized -Wall"
write
(
ilun
,
format
)
" FFLAGS += -ffpe-trap=zero,underflow,overflow,invalid -finit-real=nan"
write
(
ilun
,
format
)
" else"
write
(
ilun
,
format
)
" F90 += -O3"
write
(
ilun
,
format
)
" endif"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- MPI, ifort syntax, additional checks -----------"
write
(
ilun
,
format
)
"#F90 = ftn"
write
(
ilun
,
format
)
"#FFLAGS = -O3 -g -traceback -fpe0 -ftrapuv -cpp $(DEFINES) -DNOSYSTEM #-DRT"
write
(
ilun
,
format
)
"# Intel compiler"
write
(
ilun
,
format
)
"ifeq ($(COMPILER),INTEL)"
write
(
ilun
,
format
)
" FFLAGS = -cpp $(DEFINES)"
write
(
ilun
,
format
)
" ifeq ($(MPI),1)"
write
(
ilun
,
format
)
" F90 = $(MPIF90)"
write
(
ilun
,
format
)
" FFLAGS += -DNOSYSTEM"
write
(
ilun
,
format
)
" else"
write
(
ilun
,
format
)
" F90 = ifort"
write
(
ilun
,
format
)
" FFLAGS += -DWITHOUTMPI"
write
(
ilun
,
format
)
" endif"
write
(
ilun
,
format
)
" F90 += -fp-model source"
write
(
ilun
,
format
)
" ifeq ($(DEBUG),1)"
write
(
ilun
,
format
)
" F90 += -warn all -O0 -g -traceback -check bounds"
write
(
ilun
,
format
)
" FFLAGS += -fpe0 -ftrapuv -init=zero -init=snan -init=arrays"
write
(
ilun
,
format
)
" else"
write
(
ilun
,
format
)
" F90 += -O3"
write
(
ilun
,
format
)
" endif"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"MOD = mod"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"# MPI librairies"
write
(
ilun
,
format
)
"LIBMPI =
"
write
(
ilun
,
format
)
"LIBMPI ="
write
(
ilun
,
format
)
"#LIBMPI = -lfmpi -lmpi -lelan"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# --- CUDA libraries, for Titane ---"
write
(
ilun
,
format
)
"LIBCUDA = -L/opt/cuda/lib -lm -lcuda -lcudart"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"ifeq ($(GRACKLE),1)"
write
(
ilun
,
format
)
"# Add include and library install path for grackle and hdf5 here"
write
(
ilun
,
format
)
"LIBS_GRACKLE = -L$(HOME)/local/lib -lgrackle -lhdf5 -lz -lgfortran -ldl"
write
(
ilun
,
format
)
"LIBS_OBJ = -I$(HOME)/local/include -DCONFIG_BFLOAT_8 -DH5_USE_16_API -fPIC"
write
(
ilun
,
format
)
"
# Add include and library install path for grackle and hdf5 here"
write
(
ilun
,
format
)
"
LIBS_GRACKLE = -L$(HOME)/local/lib -lgrackle -lhdf5 -lz -lgfortran -ldl"
write
(
ilun
,
format
)
"
LIBS_OBJ = -I$(HOME)/local/include -DCONFIG_BFLOAT_8 -DH5_USE_16_API -fPIC"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"LIBS = $(LIBMPI) $(LIBS_GRACKLE)"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"# Sources directories are searched in this exact order"
write
(
ilun
,
format
)
"VPATH = $(shell [ -z $(PATCH) ] || find $(PATCH) -type d):../$(SOLVER):../aton:../hydro:../pm:../poisson:../amr"
write
(
ilun
,
format
)
"VPATH = $(shell [ -z $(PATCH) ] || find $(PATCH) -type d):../$(SOLVER):../aton:"
write
(
ilun
,
format
)
"ifeq ($(RT),1)"
write
(
ilun
,
format
)
" VPATH += ../rt:"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"VPATH += ../hydro:../pm:../poisson:../amr:../io"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"# All objects"
write
(
ilun
,
format
)
"MODOBJ = amr_parameters.o amr_commons.o random.o pm_parameters.o pm_commons.o poisson_parameters.o gr_parameters.o gr_commons.o"
...
...
@@ -122,49 +159,60 @@ subroutine output_makefile(filename)
write
(
ilun
,
format
)
"PMOBJ = init_part.o output_part.o rho_fine.o synchro_fine.o move_fine.o newdt_fine.o particle_tree.o \"
write
(
ilun
,
format
)
" add_list.o remove_list.o star_formation.o sink_particle.o feedback.o clump_finder.o clump_merger.o \"
write
(
ilun
,
format
)
" flag_formation_sites.o init_sink.o output_sink.o"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# GR extra files for GR simulations"
write
(
ilun
,
format
)
"PMOBJ += move_fine_gr.o synchro_fine_gr.o"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Poisson solver objects"
write
(
ilun
,
format
)
"POISSONOBJ = init_poisson.o phi_fine_cg.o interpol_phi.o force_fine.o multigrid_coarse.o multigrid_fine_commons.o \"
write
(
ilun
,
format
)
" multigrid_fine_fine.o multigrid_fine_coarse.o gravana.o boundary_potential.o rho_ana.o output_poisson.o"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# GR extra files for GR simulations"
write
(
ilun
,
format
)
"POISSONOBJ += comp_gr_aij.o force_fine_gr.o init_poisson_gr.o interpol_gr_mat.o interpol_gr_pot.o \"
write
(
ilun
,
format
)
"
multigrid_fine_commons_gr.o multigrid_fine_fine_gr_ln.o multigrid_fine_fine_gr_nl.o\"
write
(
ilun
,
format
)
"
multigrid_fine_coarse_gr_nl.o
multigrid_fine_commons_gr.o multigrid_fine_fine_gr_ln.o multigrid_fine_fine_gr_nl.o
\"
write
(
ilun
,
format
)
" source_fine_gr_aij_aij.o source_fine_gr_scalar.o source_fine_gr_vector.o"
write
(
ilun
,
format
)
"# force_fine_gr.o "
write
(
ilun
,
format
)
"# multigrid_fine_coarse_gr_nl.o "
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Hydro objects"
write
(
ilun
,
format
)
"HYDROOBJ = init_hydro.o init_flow_fine.o write_screen.o output_hydro.o courant_fine.o godunov_fine.o \"
write
(
ilun
,
format
)
" uplmde.o umuscl.o interpol_hydro.o godunov_utils.o condinit.o hydro_flag.o hydro_boundary.o \"
write
(
ilun
,
format
)
" boundana.o read_hydro_params.o synchro_hydro_fine.o"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# Patch objects"
write
(
ilun
,
format
)
"sinclude $(PATCH)/Makefile"
write
(
ilun
,
format
)
""
write
(
ilun
,
format
)
"# All objects"
write
(
ilun
,
format
)
"AMRLIB = $(AMROBJ) $(HYDROOBJ) $(PMOBJ) $(POISSONOBJ)"
write
(
ilun
,
format
)
"ifeq ($(RT),1)"
write
(
ilun
,
format
)
" AMRLIB += $(RTOBJ)"
write
(
ilun
,
format
)
"endif"
write
(
ilun
,
format
)
"# ATON objects"
write
(
ilun
,
format
)
"ATON_MODOBJ = timing.o radiation_commons.o rad_step.o"
write
(
ilun
,
format
)
"ATON_OBJ = observe.o init_radiation.o rad_init.o rad_boundary.o rad_stars.o rad_backup.o ../aton/atonlib/libaton.a"
write
(
ilun
,
format
)
"ATON_OBJ = observe.o init_radiation.o rad_init.o rad_boundary.o rad_stars.o \"
write
(
ilun
,
format
)
" rad_backup.o ../aton/atonlib/libaton.a"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"ramses: $(MODOBJ) $(AMRLIB) ramses.o"
write
(
ilun
,
format
)
" $(F90) $(MODOBJ) $(AMRLIB) ramses.o -o $(EXEC)$(NDIM)d $(LIBS)"
write
(
ilun
,
format
)
" rm write_makefile.f90"
write
(
ilun
,
format
)
" rm write_patch.f90"
write
(
ilun
,
format
)
"ramses_aton: $(MODOBJ) $(ATON_MODOBJ) $(AMRLIB) $(ATON_OBJ) ramses.o"
write
(
ilun
,
format
)
" $(F90) $(MODOBJ) $(ATON_MODOBJ) $(AMRLIB) $(ATON_OBJ) ramses.o -o $(EXEC)$(NDIM)d $(LIBS) $(LIBCUDA)"
write
(
ilun
,
format
)
" $(F90) $(MODOBJ) $(ATON_MODOBJ) $(AMRLIB) $(ATON_OBJ) ramses.o \"
write
(
ilun
,
format
)
" -o $(EXEC)$(NDIM)d $(LIBS) $(LIBCUDA)"
write
(
ilun
,
format
)
" rm write_makefile.f90"
write
(
ilun
,
format
)
" rm write_patch.f90"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"write_gitinfo.o: FORCE"
write
(
ilun
,
format
)
" $(F90) $(FFLAGS) -DPATCH=\'$(PATCH)\' -DGITBRANCH=\'$(GITBRANCH)\' -DGITHASH=\'
""
$(GITHASH)
""
\' \"
write
(
ilun
,
format
)
" -DGITREPO=\'$(GITREPO)\' -DBUILDDATE=\'
""
$(BUILDDATE)
""
\' -c ../amr/write_gitinfo.f90 -o $@ "
write
(
ilun
,
format
)
" $(F90) $(FFLAGS) -DPATCH=\'$(PATCH)\' -DGITBRANCH=\'$(GITBRANCH)\' \"
write
(
ilun
,
format
)
" -DGITHASH=\'
""
$(GITHASH)
""
\' -DGITREPO=\'$(GITREPO)\' \"
write
(
ilun
,
format
)
" -DBUILDDATE=\'
""
$(BUILDDATE)
""
\' -c ../amr/write_gitinfo.f90 -o $@"
write
(
ilun
,
format
)
"write_makefile.o: FORCE"
write
(
ilun
,
format
)
" ../utils/scripts/cr_write_makefile.sh $(MAKEFILE_LIST)"
write
(
ilun
,
format
)
" $(F90) $(FFLAGS) -c write_makefile.f90 -o $@"
write
(
ilun
,
format
)
"write_patch.o: FORCE"
write
(
ilun
,
format
)
" ../utils/scripts/cr_write_patch.sh $(PATCH)"
write
(
ilun
,
format
)
" $(F90)
$(FFLAGS)
-c write_patch.f90 -o $@"
write
(
ilun
,
format
)
" $(F90)
-O0
-c write_patch.f90 -o $@"
write
(
ilun
,
format
)
"%.o:%.F"
write
(
ilun
,
format
)
" $(F90) $(FFLAGS) -c $^ -o $@ $(LIBS_OBJ)"
write
(
ilun
,
format
)
"%.o:%.f90"
...
...
@@ -172,7 +220,7 @@ subroutine output_makefile(filename)
write
(
ilun
,
format
)
"FORCE:"
write
(
ilun
,
format
)
"#############################################################################"
write
(
ilun
,
format
)
"clean:"
write
(
ilun
,
format
)
" rm -f *.o *.$(MOD)"
write
(
ilun
,
format
)
" rm -f *.o *.$(MOD)
*.i
"
write
(
ilun
,
format
)
"#############################################################################"
close
(
ilun
)
...
...
This diff is collapsed.
Click to expand it.
poisson/output_poisson.f90
+
6
−
6
View file @
99e1cb06
...
...
@@ -115,12 +115,12 @@ subroutine backup_poisson(filename)
end
do
! Write positions ! Pos data in .amr files!
!
do ivar=1,ndim
!
do i=1,ncache
!
xdp(i)=xg(ind_grid(i),ivar)+xc(ind,ivar)
!
end do
!
write(ilun)xdp
!
end do
do
ivar
=
1
,
ndim
do
i
=
1
,
ncache
xdp
(
i
)
=
xg
(
ind_grid
(
i
),
ivar
)
+
xc
(
ind
,
ivar
)
end
do
write
(
ilun
)
xdp
end
do
end
if
end
do
...
...
This diff is collapsed.
Click to expand it.
readgrav_gr.py
0 → 100644
+
115
−
0
View file @
99e1cb06
# This script read data from grav_ files and save to .npy
# Fortran unformatted files seem to be composed with several blocks of different datatype.
# Each block looks like this:
# |(int) Size of DATA || (dtype) DATA ||(int) Size of DATA |
import
numpy
as
np
from
struct
import
*
import
time
import
sys
t1
=
time
.
clock
()
#simulation details
levelmin
=
int
(
sys
.
argv
[
3
])
levelmax
=
levelmin
twotondim
=
8
G
=
int
(
sys
.
argv
[
4
])
#files to be read
path
=
sys
.
argv
[
1
]
#outpath=sys.argv[2]
fileroot
=
'
grav_
'
+
sys
.
argv
[
1
][
-
6
:
-
1
]
+
'
.out
'
numfiles
=
int
(
sys
.
argv
[
2
])
firstcount
=
1
outfile
=
fileroot
#internal variable
datlis
=
[
phi
,
f1
,
f2
,
f3
,
gr5
,
gr6
,
gr7
,
gr8
,
gr9
,
gr10
,
rho
,
gr_m1
,
gr_m2
,
gr_m3
,
gr_m4
,
x
,
y
,
z
]
=
[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]
Ngrid
=
0
for
i
in
range
(
firstcount
,
firstcount
+
numfiles
):
infile
=
fileroot
+
str
(
i
).
zfill
(
5
)
with
open
(
path
+
infile
,
'
rb
'
)
as
f
:
content
=
f
.
read
()
print
(
'
Reading
'
+
path
+
infile
+
'
:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
pmin
=
0
pmax
=
48
############ 'header info'############
info
=
unpack
(
'
i
'
*
3
*
4
,
content
[
pmin
:
pmax
])
[
ncpu
,
ndim
,
nlevelmax
,
nboundary
]
=
[
info
[
1
],
info
[
4
],
info
[
7
],
info
[
10
]]
############ levels ############
for
ilevel
in
range
(
levelmin
,
levelmax
+
1
):
############ nboundary+ncpu ############
for
ibound
in
range
(
1
,
nboundary
+
ncpu
+
1
):
pmin0
=
pmax
pmax0
=
pmin0
+
4
*
3
*
2
info
=
unpack
(
'
i
'
*
3
*
2
,
content
[
pmin0
:
pmax0
])
[
currlevel
,
ncache
]
=
[
info
[
1
],
info
[
4
]]
Ngrid
+=
ncache
*
twotondim
#print pmin0, pmax0, currlevel, ncache
if
ncache
==
0
:
pmax
=
pmax0
continue
############ twotondim ############
for
ind
in
range
(
1
,
twotondim
+
1
):
j
=
0
############ parameters ############
for
N
in
([
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
]):
ipar
=
datlis
[
j
]
pmin
=
pmax0
+
(
8
*
N
-
4
)
+
(
N
-
1
)
*
8
*
ncache
pmax
=
pmin
+
ncache
*
8
#print(pmin,pmax,ncache)
info
=
unpack
(
'
d
'
*
ncache
,
content
[
pmin
:
pmax
])
for
floatelem
in
info
:
ipar
.
append
(
floatelem
)
j
=
j
+
1
#pmax=pmax+4
#print ind, pmin, pmax, ncache
pmax0
=
pmax
+
4
pmax
=
pmax0
f
.
close
()
print
(
'
Transposing:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
datlis
=
np
.
transpose
(
datlis
)
#print('Deleting repeating elements: '+str(time.clock()-t1)+' s')
#datlis=np.vstack({tuple(row) for row in datlis})
#print('Saving to '+path+outfile+' : '+str(time.clock()-t1)+' s')
#np.save(path+outfile,datlis)
print
(
'
Mapping to tuple:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
datlis
=
map
(
tuple
,
datlis
)
print
(
'
Finding set of values:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
datlis
=
set
(
datlis
)
print
(
'
Mapping back to array:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
datlis
=
map
(
tuple
,
datlis
)
data
=
np
.
zeros
((
G
**
3
,
18
))
for
i
in
range
(
len
(
data
)):
print
(
i
)
data
[
i
][
0
]
=
datlis
[
i
][
0
]
data
[
i
][
1
]
=
datlis
[
i
][
1
]
data
[
i
][
2
]
=
datlis
[
i
][
2
]
data
[
i
][
3
]
=
datlis
[
i
][
3
]
data
[
i
][
4
]
=
datlis
[
i
][
4
]
data
[
i
][
5
]
=
datlis
[
i
][
5
]
data
[
i
][
6
]
=
datlis
[
i
][
6
]
data
[
i
][
7
]
=
datlis
[
i
][
7
]
data
[
i
][
8
]
=
datlis
[
i
][
8
]
data
[
i
][
9
]
=
datlis
[
i
][
9
]
data
[
i
][
10
]
=
datlis
[
i
][
10
]
data
[
i
][
11
]
=
datlis
[
i
][
11
]
data
[
i
][
12
]
=
datlis
[
i
][
12
]
data
[
i
][
13
]
=
datlis
[
i
][
13
]
data
[
i
][
14
]
=
datlis
[
i
][
14
]
data
[
i
][
15
]
=
datlis
[
i
][
15
]
data
[
i
][
16
]
=
datlis
[
i
][
16
]
data
[
i
][
17
]
=
datlis
[
i
][
17
]
print
(
'
Saving to
'
+
path
+
outfile
+
'
:
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s
'
)
np
.
save
(
path
+
outfile
,
data
)
print
(
'
Done :
'
+
str
(
time
.
clock
()
-
t1
)
+
'
s, N = %d
'
%
(
len
(
datlis
)))
sys
.
exit
()
This diff is collapsed.
Click to expand it.
submit.sh
deleted
100644 → 0
+
0
−
28
View file @
2858352e
#!/bin/sh
#SBATCH -n 16
#SBATCH -t 00:05:00
#SBATCH -J gramses
#SBATCH -o ./logs/%j.log
#SBATCH -e ./logs/%j.err
#SBATCH -p cosma
#SBATCH -A durham
#SBATCH --exclusive
# prepare
module purge
module load intel_comp
module load intel_mpi
# module load hdfview
unset
I_MPI_HYDRA_BOOTSTRAP
# compile
#make clean && make
# run
mpirun
-np
$SLURM_NTASKS
./bin/ramses3d ./namelist/gr_test.nml
# report
echo
""
sacct
-j
$SLURM_JOBID
--format
=
JobID,JobName,Partition,AllocCPUS,Elapsed,ExitCode
exit
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment