SCALE-RM
mod_ocean_admin.f90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
9 !-------------------------------------------------------------------------------
11  !-----------------------------------------------------------------------------
12  !
13  !++ used modules
14  !
15  use scale_precision
16  use scale_stdio
17  use scale_prof
18  use scale_debug
19  !-----------------------------------------------------------------------------
20  implicit none
21  private
22  !-----------------------------------------------------------------------------
23  !
24  !++ Public procedure
25  !
26  public :: ocean_admin_setup
27  public :: ocean_admin_getscheme
28 
29  !-----------------------------------------------------------------------------
30  !
31  !++ Public parameters & variables
32  !
33  logical, public :: ocean_do = .true. ! main switch for the model
34 
35  character(len=H_SHORT), public :: ocean_type = 'NONE'
36 
37  logical, public :: ocean_sw
38 
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private procedure
42  !
43  !-----------------------------------------------------------------------------
44  !
45  !++ Private parameters & variables
46  !
47  !-----------------------------------------------------------------------------
48 contains
49  !-----------------------------------------------------------------------------
51  subroutine ocean_admin_setup
52  use scale_process, only: &
54  implicit none
55 
56  namelist / param_ocean / &
57  ocean_do, &
59 
60  integer :: ierr
61  !---------------------------------------------------------------------------
62 
63  if( io_l ) write(io_fid_log,*)
64  if( io_l ) write(io_fid_log,*) '++++++ Module[ADMIN] / Categ[OCEAN] / Origin[SCALE-RM]'
65 
66  !--- read namelist
67  rewind(io_fid_conf)
68  read(io_fid_conf,nml=param_ocean,iostat=ierr)
69  if( ierr < 0 ) then !--- missing
70  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
71  elseif( ierr > 0 ) then !--- fatal error
72  write(*,*) 'xxx Not appropriate names in namelist PARAM_OCEAN. Check!'
73  call prc_mpistop
74  endif
75  if( io_nml ) write(io_fid_nml,nml=param_ocean)
76 
77  !-----< module component check >-----
78 
79  if( io_l ) write(io_fid_log,*)
80  if( io_l ) write(io_fid_log,*) '*** Ocean model components ***'
81 
82  if ( ocean_type == 'OFF' .OR. ocean_type == 'NONE' ) then
83  ocean_do = .false. ! force off
84  endif
85 
86  if ( ocean_do ) then
87  if( io_l ) write(io_fid_log,*) '*** Ocean model : ON'
88  else
89  if( io_l ) write(io_fid_log,*) '*** Ocean model : OFF'
90  endif
91 
92  if ( ocean_type /= 'OFF' .AND. ocean_type /= 'NONE' ) then
93  if( io_l ) write(io_fid_log,*) '*** + Ocean physics : ON, ', trim(ocean_type)
94  ocean_sw = .true.
95  else
96  if( io_l ) write(io_fid_log,*) '*** + Ocean physics : OFF'
97  ocean_sw = .false.
98  endif
99 
100  return
101  end subroutine ocean_admin_setup
102 
103  !-----------------------------------------------------------------------------
105  subroutine ocean_admin_getscheme( &
106  scheme_name )
107  use scale_process, only: &
109  implicit none
110 
111  character(len=H_SHORT), intent(out) :: scheme_name
112  !---------------------------------------------------------------------------
113 
114  scheme_name = ocean_type
115 
116  return
117  end subroutine ocean_admin_getscheme
118 
119 end module mod_ocean_admin
module DEBUG
Definition: scale_debug.F90:13
logical, public ocean_sw
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:61
logical, public ocean_do
module STDIO
Definition: scale_stdio.F90:12
logical, public io_nml
output log or not? (for namelist, this process)
Definition: scale_stdio.F90:62
subroutine, public ocean_admin_getscheme(scheme_name)
Get name of scheme for each component.
module PROCESS
module Ocean admin
subroutine, public ocean_admin_setup
Setup.
module profiler
Definition: scale_prof.F90:10
module PRECISION
character(len=h_short), public ocean_type
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
integer, public io_fid_nml
Log file ID (only for output namelist)
Definition: scale_stdio.F90:57