From 267e8f8bb9b7e07b0faae9b98fc648b8ad4a60b2 Mon Sep 17 00:00:00 2001 From: fangjian19 Date: Tue, 19 Mar 2024 11:37:30 +0000 Subject: [PATCH] modi cmakelist in src and add post_vtk to ensure everything works --- post_vtk/CMakeLists.txt | 13 ++ post_vtk/Makefile | 242 ++++++++++++++++++++++++ post_vtk/cmake_install.cmake | 60 ++++++ post_vtk/paraview_incompact3d_vtk.f90 | 255 ++++++++++++++++++++++++++ src/CMakeLists.txt | 3 +- 5 files changed, 571 insertions(+), 2 deletions(-) create mode 100644 post_vtk/CMakeLists.txt create mode 100644 post_vtk/Makefile create mode 100644 post_vtk/cmake_install.cmake create mode 100644 post_vtk/paraview_incompact3d_vtk.f90 diff --git a/post_vtk/CMakeLists.txt b/post_vtk/CMakeLists.txt new file mode 100644 index 000000000..f805a2ef4 --- /dev/null +++ b/post_vtk/CMakeLists.txt @@ -0,0 +1,13 @@ +include_directories(${CMAKE_SOURCE_DIR}/post_vtk) + +message(STATUS "CMAKE_SOURCE_DIR: ${CMAKE_SOURCE_DIR}") +message(STATUS "PROJECT_BINARY_DIR: ${PROJECT_BINARY_DIR}") + +add_executable(xcompact3d_paraview_vtk + paraview_incompact3d_vtk.f90) + +install(TARGETS xcompact3d_paraview_vtk + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +) diff --git a/post_vtk/Makefile b/post_vtk/Makefile new file mode 100644 index 000000000..d51c58e20 --- /dev/null +++ b/post_vtk/Makefile @@ -0,0 +1,242 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 3.22 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +# Allow only one "make -f Makefile2" at a time, but pass parallelism. +.NOTPARALLEL: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /mnt/d/WORK/W51_MHD/Incompact3d + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /mnt/d/WORK/W51_MHD/Incompact3d + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target test +test: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..." + /usr/bin/ctest --force-new-ctest-process $(ARGS) +.PHONY : test + +# Special rule for the target test +test/fast: test +.PHONY : test/fast + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." + /usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip/fast + +# The main all target +all: cmake_check_build_system + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(CMAKE_COMMAND) -E cmake_progress_start /mnt/d/WORK/W51_MHD/Incompact3d/CMakeFiles /mnt/d/WORK/W51_MHD/Incompact3d/post_vtk//CMakeFiles/progress.marks + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 post_vtk/all + $(CMAKE_COMMAND) -E cmake_progress_start /mnt/d/WORK/W51_MHD/Incompact3d/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 post_vtk/clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 post_vtk/preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 post_vtk/preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +# Convenience name for target. +post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/rule: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/rule +.PHONY : post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/rule + +# Convenience name for target. +xcompact3d_paraview_vtk: post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/rule +.PHONY : xcompact3d_paraview_vtk + +# fast build rule for target. +xcompact3d_paraview_vtk/fast: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/build.make post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/build +.PHONY : xcompact3d_paraview_vtk/fast + +paraview_incompact3d_vtk.o: paraview_incompact3d_vtk.f90.o +.PHONY : paraview_incompact3d_vtk.o + +# target to build an object file +paraview_incompact3d_vtk.f90.o: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/build.make post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/paraview_incompact3d_vtk.f90.o +.PHONY : paraview_incompact3d_vtk.f90.o + +paraview_incompact3d_vtk.i: paraview_incompact3d_vtk.f90.i +.PHONY : paraview_incompact3d_vtk.i + +# target to preprocess a source file +paraview_incompact3d_vtk.f90.i: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/build.make post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/paraview_incompact3d_vtk.f90.i +.PHONY : paraview_incompact3d_vtk.f90.i + +paraview_incompact3d_vtk.s: paraview_incompact3d_vtk.f90.s +.PHONY : paraview_incompact3d_vtk.s + +# target to generate assembly for a file +paraview_incompact3d_vtk.f90.s: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(MAKE) $(MAKESILENT) -f post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/build.make post_vtk/CMakeFiles/xcompact3d_paraview_vtk.dir/paraview_incompact3d_vtk.f90.s +.PHONY : paraview_incompact3d_vtk.f90.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... rebuild_cache" + @echo "... test" + @echo "... xcompact3d_paraview_vtk" + @echo "... paraview_incompact3d_vtk.o" + @echo "... paraview_incompact3d_vtk.i" + @echo "... paraview_incompact3d_vtk.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + cd /mnt/d/WORK/W51_MHD/Incompact3d && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/post_vtk/cmake_install.cmake b/post_vtk/cmake_install.cmake new file mode 100644 index 000000000..5824a3b9f --- /dev/null +++ b/post_vtk/cmake_install.cmake @@ -0,0 +1,60 @@ +# Install script for directory: /mnt/d/WORK/W51_MHD/Incompact3d/post_vtk + +# Set the install prefix +if(NOT DEFINED CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_PREFIX "/mnt/d/WORK/W51_MHD/Incompact3d/opt") +endif() +string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + +# Set the install configuration name. +if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME) + if(BUILD_TYPE) + string(REGEX REPLACE "^[^A-Za-z0-9_]+" "" + CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}") + else() + set(CMAKE_INSTALL_CONFIG_NAME "RELEASE") + endif() + message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"") +endif() + +# Set the component getting installed. +if(NOT CMAKE_INSTALL_COMPONENT) + if(COMPONENT) + message(STATUS "Install component: \"${COMPONENT}\"") + set(CMAKE_INSTALL_COMPONENT "${COMPONENT}") + else() + set(CMAKE_INSTALL_COMPONENT) + endif() +endif() + +# Install shared libraries without execute permission? +if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE) + set(CMAKE_INSTALL_SO_NO_EXE "1") +endif() + +# Is this installation the result of a crosscompile? +if(NOT DEFINED CMAKE_CROSSCOMPILING) + set(CMAKE_CROSSCOMPILING "FALSE") +endif() + +# Set default install directory permissions. +if(NOT DEFINED CMAKE_OBJDUMP) + set(CMAKE_OBJDUMP "/usr/bin/objdump") +endif() + +if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT) + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk") + file(RPATH_CHECK + FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk" + RPATH "") + endif() + file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/mnt/d/WORK/W51_MHD/Incompact3d/bin/xcompact3d_paraview_vtk") + if(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk" AND + NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk") + if(CMAKE_INSTALL_DO_STRIP) + execute_process(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/xcompact3d_paraview_vtk") + endif() + endif() +endif() + diff --git a/post_vtk/paraview_incompact3d_vtk.f90 b/post_vtk/paraview_incompact3d_vtk.f90 new file mode 100644 index 000000000..102bf6037 --- /dev/null +++ b/post_vtk/paraview_incompact3d_vtk.f90 @@ -0,0 +1,255 @@ +!Copyright (c) 2012-2022, Xcompact3d +!This file is part of Xcompact3d (xcompact3d.com) +!SPDX-License-Identifier: BSD 3-Clause + +!############################################################################## + !! + !! PROGRAM: visu_vtk + !! DESCRIPTION: Create vtk/vtr files from XC3D output. Output file is txt + !! always with Float32 precision regardless of the precision used + !! to write Xc3d output + !! + !! AUTHOR: + !! MODIFIED: Stefano Rolfo + !! +!############################################################################## + + +program visu_vtk + + implicit none + + integer(4) :: nx,ny,nz + real(4) :: xlx,yly,zlz,dt,dx,dy,dz + real(8),dimension(:,:,:),allocatable :: input_var_64 + real(4),dimension(:,:,:),allocatable :: input_var_32 + real(4),dimension(:,:,:),allocatable :: output_var_32 + integer :: i,j,k,count,nfil, ivar + integer(4) :: istret,nclx, ncly, nclz, nvar + integer(4) :: nfiles, icrfile, file1, filen, ifile + integer(4) :: dig1, dig2, dig3, dig4, dig5, dig6, dig7 + integer(4) :: step + real(4),dimension(:),allocatable :: y1 + real(4),dimension(:),allocatable :: y2 + real(4),dimension(:),allocatable :: y3 + real(4) :: pi,xa + character(len=128) :: input_file + character(len=128) :: output_file + integer(4) :: idigits, iprec + integer :: length_input_file + integer(4) :: iparaview + character(len=128), dimension(:), allocatable :: var_name + !IF THE DATA ARE STORED WITH 3 DIGITS, IE UX001,UX002,ETC. + character(3) :: chits3 + !IF THE DATA ARE STORED WITH 4 DIGITS, IE UX0001,UX0002,ETC. + character(4) :: chits4 + !IF THE DATA ARE STORED WITH 5 DIGITS, IE UX00001,UX00002,ETC. + character(5) :: chits5 + !IF THE DATA ARE STORED WITH 5 DIGITS, IE UX00001,UX00002,ETC. + character(6) :: chits6 + !IF THE DATA ARE STORED WITH 5 DIGITS, IE UX00001,UX00002,ETC. + character(7) :: chits7 + + write (*,*) 'nx, ny, nz - Incompact3D' + read (*,*) nx, ny, nz + write (*,*) 'xlx, yly, zlz - Incompact3D' + read (*,*) xlx, yly, zlz + write (*,*) 'nclx, ncly, nclz - Incompact3D' + read (*,*) nclx, ncly, nclz + write (*,*) 'n files, first file, last file' + read (*,*) nfiles,file1, filen + write (*,*) 'Stretching in the y direction (Y=1/N=0)?' + read (*,*) istret + write (*,*) 'Number of digits in the file name (Allowed 3, 4, 5, 6, 7)?' + read (*,*) idigits + if (idigits < 3 .or. idigits > 7) then + write(*,*) 'Numbers of digits has to be between 3 and 7 ' + stop + endif + write (*,*) 'Writing precision for the XC3D postprocessing (Single = 4, Double = 8)?' + read (*,*) iprec + write (*,*) 'Paraview version target (i.e. 5.8 => 58)' + read (*,*) iparaview + write (*,*) 'How many variables you would like to export' + read (*,*) nvar + allocate(var_name(nvar)) + do ivar = 1, nvar + write(*,*) 'XC3D variable name (i.e. ux)' + read(*,*) var_name(ivar) + enddo + + do ivar = 1, nvar + write(*,*) 'Var list ', trim(var_name(ivar)) + enddo + + ! Allocate of the in/out variables + allocate(input_var_64(nx,ny,nz)) + allocate(input_var_32(nx,ny,nz)) + allocate(output_var_32(nx,ny,nz)) + + if (nclx==0) dx=xlx/real(nx,4) + if (nclx==1 .or. nclx==2) dx=xlx/real(nx-1.,4) + if (ncly==0) dy=yly/real(ny,4) + if (ncly==1.or.ncly==2) dy=yly/real(ny-1.,4) + if (nclz==0) dz=zlz/nz + if (nclz==1.or.nclz==2) dz=zlz/real(nz-1.,4) + + allocate(y1(nx)) + allocate(y2(ny)) + allocate(y3(nz)) + do i=1,nx + y1(i)=(i-1)*dx + enddo + if (istret==1) then + print *,'We need to read the yp.dat file' + open(12,file='yp.dat',form='formatted',status='unknown') + do j=1,ny + read(12,*) y2(j) + enddo + close(12) + else + do j=1,ny + y2(j)=(j-1)*dy + enddo + endif + do k=1,nz + y3(k)=(k-1)*dz + enddo + + step = int(filen/nfiles) + + ! Time loop to write the variables + do ifile = file1, filen, step + ! Get the digits for the file name + if (idigits == 3) then + dig1 = ifile/100 + 48 + dig2 = ( ifile - 100*( ifile/100 ) )/10 + 48 + dig3 = ( ifile - 10*( ifile/10 ) )/1 + 48 + chits3(1:3) = char(dig1)//char(dig2)//char(dig3) + write(*,*) 'File name has structure var_name'//chits3 + output_file = 'XC3D'//chits3 + elseif (idigits == 4) then + dig1 = ifile/1000 + 48 + dig2 = ( ifile - 1000*( ifile/1000 ) )/100 + 48 + dig3 = ( ifile - 100*( ifile/100 ) )/10 + 48 + dig4 = ( ifile - 10*( ifile/10 ) )/1 + 48 + chits4(1:4) = char(dig1)//char(dig2)//char(dig3)//char(dig4) + write(*,*) 'File name has structure var_name'//chits4 + output_file = 'XC3D'//chits4 + elseif (idigits == 5) then + dig1 = ifile/10000 + 48 + dig2 = ( ifile - 10000*( ifile/10000 ) )/1000 + 48 + dig3 = ( ifile - 1000*( ifile/1000 ) )/100 + 48 + dig4 = ( ifile - 100*( ifile/100 ) )/10 + 48 + dig5 = ( ifile - 10*( ifile/10 ) )/1 + 48 + chits5(1:5) = char(dig1)//char(dig2)//char(dig3)//char(dig4)//& + char(dig5) + write(*,*) 'File name has structure var_name'//chits5 + output_file = 'XC3D'//chits5 + elseif (idigits == 6) then + dig1 = ifile/100000 + 48 + dig2 = ( ifile - 100000*( ifile/100000 ) )/10000 + 48 + dig3 = ( ifile - 10000*( ifile/10000 ) )/1000 + 48 + dig4 = ( ifile - 1000*( ifile/1000 ) )/100 + 48 + dig5 = ( ifile - 100*( ifile/100 ) )/10 + 48 + dig6 = ( ifile - 10*( ifile/10 ) )/1 + 48 + chits6(1:6) = char(dig1)//char(dig2)//char(dig3)//char(dig4)//& + char(dig5)//char(dig6) + write(*,*) 'File name has structure var_name'//chits6 + output_file = 'XC3D'//chits6 + else + dig1 = ifile/1000000 + 48 + dig2 = ( ifile - 1000000*( ifile/1000000 ) )/100000 + 48 + dig3 = ( ifile - 100000*( ifile/100000 ) )/10000 + 48 + dig4 = ( ifile - 10000*( ifile/10000 ) )/1000 + 48 + dig5 = ( ifile - 1000*( ifile/1000 ) )/100 + 48 + dig6 = ( ifile - 100*( ifile/100 ) )/10 + 48 + dig7 = ( ifile - 10*( ifile/10 ) )/1 + 48 + chits7(1:7) = char(dig1)//char(dig2)//char(dig3)//char(dig4)//& + char(dig5)//char(dig6)//char(dig7) + write(*,*) 'File name has structure var_name'//chits7 + output_file = 'XC3D'//chits7 + endif + ! Creation of the file output for the time step + write(*,*) 'output_file ',output_file + nfil=41 + if (iparaview >= 58 ) then + output_file=trim(output_file)//'.vtr' + else + output_file=trim(output_file)//'.vtk' + endif + write(*,*) 'output_file ',output_file + open(nfil,file=output_file) + write(nfil,*)'' + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*) (y1(i),i=1,nx) + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*) (y2(j),j=1,ny) + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*) (y3(k),k=1,nz) + write(nfil,*)' ' + write(nfil,*)' ' + ! Now we can add the variables + write(nfil,*)' ' + do ivar = 1, nvar + if (idigits == 3) then + input_file = trim(var_name(ivar))//'-'//chits3//'.bin' + elseif (idigits == 3) then + input_file = trim(var_name(ivar))//'-'//chits4//'.bin' + else + input_file = trim(var_name(ivar))//'-'//chits5//'.bin' + endif + length_input_file=len_trim(input_file) + + write(*,*) 'length_input_file',length_input_file + write(*,*) 'File to open ', input_file + open(10,file=input_file,form='unformatted',& + access='direct', recl=8, status='old') + count = 1 + do k=1,nz + do j=1,ny + do i=1,nx + if (iprec == 8) then + read(10,rec=count) input_var_64(i,j,k) + else + read(10,rec=count) input_var_32(i,j,k) + endif + count = count + 1 + enddo + enddo + enddo + close(10) + + output_var_32=0. + if (iprec == 8) then + output_var_32=real(input_var_64,4) + else + output_var_32=input_var_32 + endif + + write(nfil,*)' ' + write(nfil,*) (((output_var_32(i,j,k),i=1,nx),j=1,ny),k=1,nz) + write(nfil,*)' ' + enddo + ! End of writing data + write(nfil,*)' ' + ! Write the end of the file + write(nfil,*)' ' + write(nfil,*)' ' + write(nfil,*)'' + close(nfil) + enddo + deallocate(y1) + deallocate(y2) + deallocate(y3) + deallocate(input_var_64) + deallocate(input_var_32) + deallocate(output_var_32) + +end program visu_vtk diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e945010c9..66c9e64d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,12 +19,11 @@ add_executable(xcompact3d BC-Cavity.f90 BC-Channel-flow.f90 BC-Cylinder.f90 - BC-dbg-schemes.f90 BC-Lock-exchange.f90 BC-Mixing-layer.f90 BC-Periodic-hill.f90 BC-Pipe-flow.f90 - BC-Sandbox.f90 + BC-Sandbox.f90 BC-TBL.f90 BC-TGV.f90 BC-Uniform.f90