Skip to content

Commit

Permalink
minor corr in monitor write
Browse files Browse the repository at this point in the history
  • Loading branch information
fangjian authored and fangjian committed Apr 25, 2024
1 parent 6e4784f commit 6dce2af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 23 deletions.
21 changes: 4 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand All @@ -19,26 +16,16 @@ jobs:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Build openmpi
- name: Install openmpi
run: |
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.4.tar.gz
tar -xf openmpi-4.1.4.tar.gz
cd openmpi-4.1.4/ && mkdir installed
./configure --prefix=$(pwd)/installed
make all install
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Build HDF5
- name: Install HDF5
run: |
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.bz2
tar -xf hdf5-1.12.0.tar.bz2
cd hdf5-1.12.0/ && mkdir installed
./configure --prefix=$(pwd)/installed --enable-fortran --disable-shared --enable-parallel CC=mpicc FC=mpif90
make all install
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Build ASTR
run: |
export PATH=$(pwd)/hdf5-1.12.0/installed/bin/:$PATH
export FC=h5pfc
cmake -S . -B build
cmake --build build -j 2
cmake --install build
Expand Down
10 changes: 6 additions & 4 deletions src/readwrite.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,10 @@ end subroutine readmonc
subroutine writemon
!
use commvar, only: nmonitor,imon,nstep,time,pinf,deltat
use commarray, only : x,rho,vel,prs,tmp,dvel
use commarray, only : x,rho,vel,prs,tmp,dvel,dtmp
!
! local data
integer :: n,i,j,k,ios,ns
integer :: n,i,j,k,ios,ns,recl_size
integer,allocatable,save :: fh(:),record(:)
logical,save :: firstcall = .true.
logical :: lexist
Expand Down Expand Up @@ -1051,7 +1051,8 @@ subroutine writemon
fh(n)=get_unit()
!
inquire(file=trim(filename), exist=lexist)
open(fh(n),file=trim(filename),access='direct',recl=8*4)
recl_size=8*8
open(fh(n),file=trim(filename),access='direct',recl=recl_size)
!
if(nstep==0 .or. (.not.lexist)) then
! create new monitor files
Expand Down Expand Up @@ -1107,7 +1108,8 @@ subroutine writemon
! vel(i,j,k,1:3),rho(i,j,k),prs(i,j,k)/pinf,tmp(i,j,k), &
! dvel(i,j,k,1,:),dvel(i,j,k,2,:),dvel(i,j,k,3,:)
record(n)=record(n)+1
write(fh(n),rec=record(n))nstep,time,prs(i,j,k),dvel(i,j,k,1,2)
write(fh(n),rec=record(n))nstep,time,prs(i,j,k),tmp(i,j,k),dvel(i,j,k,1,2), &
dvel(i,j,k,2,1),dtmp(i,j,k,1),dtmp(i,j,k,2)
! write(fh(n),rec=record(n))nstep,time,vel(i,j,k,:),rho(i,j,k),prs(i,j,k), &
! tmp(i,j,k),dvel(i,j,k,:,:)
! write(*,*)nstep,time,vel(i,j,k,:),rho(i,j,k),prs(i,j,k), &
Expand Down
2 changes: 0 additions & 2 deletions src/utility.F90
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,6 @@ subroutine listinit(filename,handle,firstline)
!
write(txtformat,'(A,I0,A)')'(',nargs,'(1X,A20))'
!
print*,nargs,txtformat
!
write(handle,txtformat)(trim(args(n)),n=1,nargs)
!
endif
Expand Down

0 comments on commit 6dce2af

Please sign in to comment.