SCALE-RM
mod_user.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
12 module mod_user
13  !-----------------------------------------------------------------------------
14  !
15  !++ used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
21  use scale_tracer
22  !-----------------------------------------------------------------------------
23  implicit none
24  private
25  !-----------------------------------------------------------------------------
26  !
27  !++ Public procedure
28  !
29  public :: user_tracer_setup
30  public :: user_setup
31  public :: user_mkinit
32  public :: user_calc_tendency
33  public :: user_update
34 
35  !-----------------------------------------------------------------------------
36  !
37  !++ Public parameters & variables
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private procedure
42  !
43  !-----------------------------------------------------------------------------
44  !
45  !++ Private parameters & variables
46  !
47  logical, private :: USER_do = .false.
48 
49  !-----------------------------------------------------------------------------
50 contains
51  !-----------------------------------------------------------------------------
53  subroutine user_tracer_setup
54  use scale_tracer, only: &
56  implicit none
57 
58  ! if you want to add tracers, call the TRACER_regist subroutine.
59  ! e.g.,
60 ! integer, parameter :: NQ = 1
61 ! integer :: QS
62 ! character(len=H_SHORT) :: NAME(NQ)
63 ! character(len=H_MID) :: DESC(NQ)
64 ! character(len=H_SHORT) :: UNIT(NQ)
65 !
66 ! data NAME (/ 'name' /)
67 ! data DESC (/ 'tracer name' /)
68 ! data UNIT (/ 'kg/kg' /)
69  !---------------------------------------------------------------------------
70 
71 ! call TRACER_regist( QS, & ! [OUT]
72 ! NQ, & ! [IN]
73 ! NAME, & ! [IN]
74 ! DESC, & ! [IN]
75 ! UNIT ) ! [IN]
76 
77  return
78  end subroutine user_tracer_setup
79 
80  !-----------------------------------------------------------------------------
82  subroutine user_setup
83  use scale_prc, only: &
84  prc_abort
85  implicit none
86 
87  namelist / param_user / &
88  user_do
89 
90  integer :: ierr
91  !---------------------------------------------------------------------------
92 
93  log_newline
94  log_info("USER_setup",*) 'Setup'
95 
96  !--- read namelist
97  rewind(io_fid_conf)
98  read(io_fid_conf,nml=param_user,iostat=ierr)
99  if( ierr < 0 ) then !--- missing
100  log_info("USER_setup",*) 'Not found namelist. Default used.'
101  elseif( ierr > 0 ) then !--- fatal error
102  log_error("USER_setup",*) 'Not appropriate names in namelist PARAM_USER. Check!'
103  call prc_abort
104  endif
105  log_nml(param_user)
106 
107  log_newline
108  log_info("USER_setup",*) 'This module is dummy.'
109 
110  return
111  end subroutine user_setup
112 
113  !-----------------------------------------------------------------------------
115  subroutine user_mkinit
116  implicit none
117  !---------------------------------------------------------------------------
118 
119  return
120  end subroutine user_mkinit
121 
122  !-----------------------------------------------------------------------------
124  subroutine user_calc_tendency
125  implicit none
126  !---------------------------------------------------------------------------
127 
128  return
129  end subroutine user_calc_tendency
130 
131  !-----------------------------------------------------------------------------
133  subroutine user_update
134  use scale_prc, only: &
135  prc_abort
136  implicit none
137  !---------------------------------------------------------------------------
138 
139  if ( user_do ) then
140  call prc_abort
141  endif
142 
143  return
144  end subroutine user_update
145 
146 end module mod_user
mod_user
module USER
Definition: mod_user.F90:12
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
mod_user::user_setup
subroutine, public user_setup
Setup before setup of other components.
Definition: mod_user.F90:83
mod_user::user_mkinit
subroutine, public user_mkinit
Make initial state.
Definition: mod_user.F90:116
mod_user::user_tracer_setup
subroutine, public user_tracer_setup
Config before setup of tracers.
Definition: mod_user.F90:54
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_io
module STDIO
Definition: scale_io.F90:10
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_prof
module profiler
Definition: scale_prof.F90:11
mod_user::user_calc_tendency
subroutine, public user_calc_tendency
Calculation tendency.
Definition: mod_user.F90:125
scale_tracer::tracer_regist
subroutine, public tracer_regist(QS, NQ, NAME, DESC, UNIT, CV, CP, R, ENGI0, ADVC, MASS)
Regist tracer.
Definition: scale_tracer.F90:65
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_user::user_update
subroutine, public user_update
User step.
Definition: mod_user.F90:134
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:56