SCALE-RM
mod_user.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
13 !-------------------------------------------------------------------------------
14 module mod_user
15  !-----------------------------------------------------------------------------
16  !
17  !++ used modules
18  !
19  use scale_precision
20  use scale_stdio
21  use scale_prof
23  use scale_tracer
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedure
30  !
31  public :: user_setup
32  public :: user_resume0
33  public :: user_resume
34  public :: user_step
35 
36  !-----------------------------------------------------------------------------
37  !
38  !++ Public parameters & variables
39  !
40  !-----------------------------------------------------------------------------
41  !
42  !++ Private procedure
43  !
44  !-----------------------------------------------------------------------------
45  !
46  !++ Private parameters & variables
47  !
48  logical, private :: user_do = .false.
49 
50  !-----------------------------------------------------------------------------
51 contains
52  !-----------------------------------------------------------------------------
54  subroutine user_setup
55  use scale_process, only: &
57  implicit none
58 
59  namelist / param_user / &
60  user_do
61 
62  integer :: ierr
63  !---------------------------------------------------------------------------
64 
65  if( io_l ) write(io_fid_log,*)
66  if( io_l ) write(io_fid_log,*) '+++ Module[USER]/Categ[MAIN]'
67 
68  !--- read namelist
69  rewind(io_fid_conf)
70  read(io_fid_conf,nml=param_user,iostat=ierr)
71 
72  if( ierr < 0 ) then !--- missing
73  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
74  elseif( ierr > 0 ) then !--- fatal error
75  write(*,*) 'xxx Not appropriate names in namelist PARAM_USER. Check!'
76  call prc_mpistop
77  endif
78  if( io_lnml ) write(io_fid_log,nml=param_user)
79 
80  if( io_l ) write(io_fid_log,*) '*** This module is dummy.'
81 
82  return
83  end subroutine user_setup
84 
85  !-----------------------------------------------------------------------------
87  subroutine user_resume0
88  implicit none
89  !---------------------------------------------------------------------------
90 
91  return
92  end subroutine user_resume0
93 
94  !-----------------------------------------------------------------------------
96  subroutine user_resume
97  implicit none
98  !---------------------------------------------------------------------------
99 
100  return
101  end subroutine user_resume
102 
103  !-----------------------------------------------------------------------------
105  subroutine user_step
106  use scale_process, only: &
108  implicit none
109  !---------------------------------------------------------------------------
110 
111  if ( user_do ) then
112  call prc_mpistop
113  endif
114 
115  return
116  end subroutine user_step
117 
118 end module mod_user
subroutine, public prc_mpistop
Abort MPI.
subroutine, public user_step
User step.
Definition: mod_user.f90:106
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
module USER
Definition: mod_user.f90:14
module STDIO
Definition: scale_stdio.F90:12
module grid index
module TRACER
module PROCESS
module profiler
Definition: scale_prof.F90:10
subroutine, public user_resume
Resuming operation.
Definition: mod_user.f90:97
logical, public io_lnml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:60
module PRECISION
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
subroutine, public user_setup
Setup before setup of other components.
Definition: mod_user.f90:55
subroutine, public user_resume0
Resuming operation, before calculating tendency.
Definition: mod_user.f90:88
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56