Skip to content

Commit 7a62b7a

Browse files
fangjianfangjian
authored andcommitted
remaster test module, implement cmp-ld
1 parent 25beed2 commit 7a62b7a

File tree

8 files changed

+985
-839
lines changed

8 files changed

+985
-839
lines changed

src/astr.F90

Lines changed: 78 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,104 @@
1-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2-
! This Program is a DNS solver for compressible flow
3-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4-
! re-mastered at 2021-02-06, by Fang Jian
5-
! fangjian19@gmail.com
6-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1+
!=======================================================================
2+
! DNS Solver for Compressible Flow - ASTR
3+
!=======================================================================
4+
! Re-mastered on: 2021-02-06
5+
! Author : Fang Jian
6+
! Contact : fangjian19@gmail.com
7+
!=======================================================================
78
program astr
8-
!
9-
use parallel
10-
use readwrite
11-
use commarray
12-
use solver
13-
use initialisation
14-
use mainloop
15-
use gridgeneration
16-
use cmdefne
17-
use pp
18-
use geom
19-
use ibmethod
20-
use test
21-
use comsolver
22-
!
9+
10+
!---------------------------------------------------------------------
11+
! Module usage
12+
!---------------------------------------------------------------------
13+
use parallel, only: mpiinitial,mpistop,mpisizedis,lio, &
14+
parallelini,parapp
15+
use readwrite, only: statement,readinput,fileini,infodisp
16+
use commarray, only: allocommarray
17+
use solver, only: refcal
18+
use initialisation,only: spongelayerini,flowinit
19+
use mainloop, only: steploop
20+
use gridgeneration,only: gridgen
21+
use cmdefne, only: getcmd,listcmd
22+
use pp, only: ppentrance
23+
use geom, only: geomcal
24+
use ibmethod, only: ibprocess
25+
use test, only: codetest
26+
use comsolver, only: solvrinit
27+
2328
implicit none
24-
!
29+
30+
!---------------------------------------------------------------------
31+
! Local variables
32+
!---------------------------------------------------------------------
2533
character(len=16) :: cmd
26-
!
34+
35+
!---------------------------------------------------------------------
36+
! MPI Initialization and Command Processing
37+
!---------------------------------------------------------------------
2738
call mpiinitial
28-
!
39+
2940
call statement
30-
!
31-
call getcmd(cmd)
32-
!
41+
3342
call listcmd
34-
!
35-
if(trim(cmd)=='pp') then
36-
!
37-
! do the pre/post-process
38-
!
43+
44+
call getcmd(cmd)
45+
46+
!---------------------------------------------------------------------
47+
! Select operation based on command
48+
!---------------------------------------------------------------------
49+
if (trim(cmd) == 'pp') then
50+
51+
! Pre/Post-processing
3952
call ppentrance
40-
!
41-
elseif(trim(cmd)=='run') then
42-
!
43-
! computational loop
44-
!
53+
54+
elseif (trim(cmd) == 'test') then
55+
56+
! code tests
57+
call codetest
58+
59+
elseif (trim(cmd) == 'run') then
60+
61+
! Main simulation run
4562
call readinput
46-
!
63+
4764
call mpisizedis
48-
!
65+
4966
call parapp
50-
!
67+
5168
call parallelini
52-
!
69+
5370
call refcal
54-
!
71+
5572
call fileini
56-
!
73+
5774
call infodisp
58-
!
75+
5976
call allocommarray
60-
!
77+
6178
call ibprocess
62-
!
79+
6380
call gridgen
64-
!
81+
6582
call solvrinit
66-
!
83+
6784
call geomcal
68-
!
85+
6986
call spongelayerini
70-
!
87+
7188
call flowinit
72-
!
73-
call codetest
74-
!
89+
7590
call steploop
76-
!
91+
7792
call mpistop
78-
!
93+
7994
else
80-
if(mpirank==0) print*,' ** all jobs done. **'
95+
96+
if (lio) print *, ' ** All jobs (nothing) done. **'
8197
stop
82-
endif
83-
!
98+
99+
end if
100+
84101
end program astr
85-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
86-
! End of the program main
87-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
102+
!=======================================================================
103+
! End of program ASTR
104+
!=======================================================================

src/cmdefne.F90

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -71,41 +71,50 @@ end subroutine getcmd
7171
!+-------------------------------------------------------------------+
7272
!| The end of the subroutine getcmd. |
7373
!+-------------------------------------------------------------------+
74-
!
75-
!+-------------------------------------------------------------------+
76-
!| This subroutine is to list all command that is predefined. |
77-
!+-------------------------------------------------------------------+
74+
!!+-------------------------------------------------------------------+
75+
!| Subroutine: listcmd |
76+
!| |
77+
!| Purpose: |
78+
!| This subroutine prints out a list of all predefined |
79+
!| command-line options available in the ASTR code. |
80+
!| Only the root MPI rank (rank 0) performs the output. |
81+
!| |
82+
!| Commands supported: |
83+
!| - list / help : list all available functionalities |
84+
!| - run : run a computation using a given input file |
85+
!| (usage: mpirun -np 8 ./astr run datin/input) |
86+
!| - test : run internal code tests |
87+
!| - pp : enter pre/post-processing mode |
88+
!| |
7889
!| CHANGE RECORD |
7990
!| ------------- |
8091
!| 28-05-2021 | Created by J. Fang @ Warrington |
92+
!| 03-07-2025 | Prettify by J. Fang @ IMech, Beijing, using ChatGPT |
8193
!+-------------------------------------------------------------------+
8294
subroutine listcmd
83-
!
84-
use parallel, only: mpirank
85-
!
86-
if(mpirank==0) then
87-
!
88-
write(*,*)' +------------------------------------------------------------+'
89-
write(*,*)' | command line |'
90-
write(*,*)' +----------------+-------------------------------------------+'
91-
write(*,*)' | command | |'
92-
write(*,*)' +----------------+-------------------------------------------+'
93-
write(*,*)' | list / help | to list all functionalities |'
94-
write(*,*)' +----------------+-------------------------------------------+'
95-
write(*,*)' | run | to run a computation |'
96-
write(*,*)' | | inputfile |'
97-
write(*,*)' +----------------+-------------------------------------------+'
98-
write(*,*)' | pp | pre/post-process |'
99-
write(*,*)' | | init casename generate a example case |'
100-
write(*,*)' +----------------+-------------------------------------------+'
101-
!
102-
endif
103-
!
95+
96+
use parallel, only : mpirank
97+
98+
if (mpirank == 0) then
99+
write(*,*) ' +------------------------------------------------------------+'
100+
write(*,*) ' | Command Line Help |'
101+
write(*,*) ' +----------------+-------------------------------------------+'
102+
write(*,*) ' | Command | Description |'
103+
write(*,*) ' +----------------+-------------------------------------------+'
104+
write(*,*) ' | list / help | List all functionalities |'
105+
write(*,*) ' | run | Run a computation with an input file |'
106+
write(*,*) ' | usage: mpirun -np 8 ./astr run datin/input |'
107+
write(*,*) ' | test | Run code test routines |'
108+
write(*,*) ' | usage: mpirun -np 8 ./astr test grad |'
109+
write(*,*) ' | pp | Pre/Post-processing |'
110+
write(*,*) ' +----------------+-------------------------------------------+'
111+
end if
112+
104113
end subroutine listcmd
105114
!+-------------------------------------------------------------------+
106-
!| The end of the subroutine listcmd. |
115+
!| End of subroutine listcmd |
107116
!+-------------------------------------------------------------------+
108-
!
117+
109118
end module cmdefne
110119
!+---------------------------------------------------------------------+
111120
!| The end of the module cmdefne |

0 commit comments

Comments
 (0)