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_finalize
32  public :: user_mkinit
33  public :: user_calc_tendency
34  public :: user_update
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_tracer_setup
55  use scale_tracer, only: &
57  implicit none
58 
59  ! if you want to add tracers, call the TRACER_regist subroutine.
60  ! e.g.,
61 ! integer, parameter :: NQ = 1
62 ! integer :: QS
63 ! character(len=H_SHORT) :: NAME(NQ)
64 ! character(len=H_MID) :: DESC(NQ)
65 ! character(len=H_SHORT) :: UNIT(NQ)
66 !
67 ! data NAME (/ 'name' /)
68 ! data DESC (/ 'tracer name' /)
69 ! data UNIT (/ 'kg/kg' /)
70  !---------------------------------------------------------------------------
71 
72 ! call TRACER_regist( QS, & ! [OUT]
73 ! NQ, & ! [IN]
74 ! NAME, & ! [IN]
75 ! DESC, & ! [IN]
76 ! UNIT ) ! [IN]
77 
78  return
79  end subroutine user_tracer_setup
80 
81  !-----------------------------------------------------------------------------
83  subroutine user_setup
84  use scale_prc, only: &
85  prc_abort
86  implicit none
87 
88  namelist / param_user / &
89  user_do
90 
91  integer :: ierr
92  !---------------------------------------------------------------------------
93 
94  log_newline
95  log_info("USER_setup",*) 'Setup'
96 
97  !--- read namelist
98  rewind(io_fid_conf)
99  read(io_fid_conf,nml=param_user,iostat=ierr)
100  if( ierr < 0 ) then !--- missing
101  log_info("USER_setup",*) 'Not found namelist. Default used.'
102  elseif( ierr > 0 ) then !--- fatal error
103  log_error("USER_setup",*) 'Not appropriate names in namelist PARAM_USER. Check!'
104  call prc_abort
105  endif
106  log_nml(param_user)
107 
108  log_newline
109  log_info("USER_setup",*) 'This module is dummy.'
110 
111  return
112  end subroutine user_setup
113 
114  !-----------------------------------------------------------------------------
116  subroutine user_finalize
117  implicit none
118  !---------------------------------------------------------------------------
119 
120  return
121  end subroutine user_finalize
122 
123  !-----------------------------------------------------------------------------
125  subroutine user_mkinit
126  implicit none
127  !---------------------------------------------------------------------------
128 
129  return
130  end subroutine user_mkinit
131 
132  !-----------------------------------------------------------------------------
134  subroutine user_calc_tendency
135  implicit none
136  !---------------------------------------------------------------------------
137 
138  return
139  end subroutine user_calc_tendency
140 
141  !-----------------------------------------------------------------------------
143  subroutine user_update
144  use scale_prc, only: &
145  prc_abort
146  implicit none
147  !---------------------------------------------------------------------------
148 
149  if ( user_do ) then
150  call prc_abort
151  endif
152 
153  return
154  end subroutine user_update
155 
156 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:350
mod_user::user_setup
subroutine, public user_setup
Setup before setup of other components.
Definition: mod_user.F90:84
mod_user::user_mkinit
subroutine, public user_mkinit
Make initial state.
Definition: mod_user.F90:126
mod_user::user_tracer_setup
subroutine, public user_tracer_setup
Config before setup of tracers.
Definition: mod_user.F90:55
scale_precision
module PRECISION
Definition: scale_precision.F90:14
mod_user::user_finalize
subroutine, public user_finalize
Finalization.
Definition: mod_user.F90:117
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:135
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:68
scale_tracer
module TRACER
Definition: scale_tracer.F90:12
mod_user::user_update
subroutine, public user_update
User step.
Definition: mod_user.F90:144
scale_io::io_fid_conf
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:57