SCALE-RM
Functions/Subroutines
scale_ocean_dyn_offline Module Reference

module ocean / dynamics / offline More...

Functions/Subroutines

subroutine, public ocean_dyn_offline_setup
 Setup. More...
 
subroutine, public ocean_dyn_offline (OKMAX, OKS, OKE, OIA, OIS, OIE, OJA, OJS, OJE, calc_flag, dt, NOWDAYSEC, OCEAN_TEMP)
 Slab ocean model. More...
 

Detailed Description

module ocean / dynamics / offline

Description
ocean offline model
Author
Team SCALE
NAMELIST
  • PARAM_OCEAN_DYN_OFFLINE
    nametypedefault valuecomment
    OCEAN_DYN_OFFLINE_BASENAME character(len=H_LONG) ''
    OCEAN_DYN_OFFLINE_BASENAME_ADD_NUM logical .false.
    OCEAN_DYN_OFFLINE_NUMBER_OF_FILES integer 1
    OCEAN_DYN_OFFLINE_ENABLE_PERIODIC_YEAR logical .false.
    OCEAN_DYN_OFFLINE_ENABLE_PERIODIC_MONTH logical .false.
    OCEAN_DYN_OFFLINE_ENABLE_PERIODIC_DAY logical .false.
    OCEAN_DYN_OFFLINE_STEP_FIXED integer 0
    OCEAN_DYN_OFFLINE_DEFVAL real(RP) = UNDEF
    OCEAN_DYN_OFFLINE_CHECK_COORDINATES logical .true.
    OCEAN_DYN_OFFLINE_STEP_LIMIT integer 0

History Output
No history output

Function/Subroutine Documentation

◆ ocean_dyn_offline_setup()

subroutine, public scale_ocean_dyn_offline::ocean_dyn_offline_setup

Setup.

Definition at line 48 of file scale_ocean_dyn_offline.F90.

48  use scale_prc, only: &
49  prc_abort
50  use scale_const, only: &
51  undef => const_undef
52  use scale_file_external_input, only: &
53  file_external_input_regist
54  implicit none
55 
56  character(len=H_LONG) :: OCEAN_DYN_OFFLINE_basename = ''
57  logical :: OCEAN_DYN_OFFLINE_basename_add_num = .false.
58  integer :: OCEAN_DYN_OFFLINE_number_of_files = 1
59  logical :: OCEAN_DYN_OFFLINE_enable_periodic_year = .false.
60  logical :: OCEAN_DYN_OFFLINE_enable_periodic_month = .false.
61  logical :: OCEAN_DYN_OFFLINE_enable_periodic_day = .false.
62  integer :: OCEAN_DYN_OFFLINE_step_fixed = 0
63  real(RP) :: OCEAN_DYN_OFFLINE_defval != UNDEF
64  logical :: OCEAN_DYN_OFFLINE_check_coordinates = .true.
65  integer :: OCEAN_DYN_OFFLINE_step_limit = 0
66 
67  namelist / param_ocean_dyn_offline / &
68  ocean_dyn_offline_basename, &
69  ocean_dyn_offline_basename_add_num, &
70  ocean_dyn_offline_number_of_files, &
71  ocean_dyn_offline_enable_periodic_year, &
72  ocean_dyn_offline_enable_periodic_month, &
73  ocean_dyn_offline_enable_periodic_day, &
74  ocean_dyn_offline_step_fixed, &
75  ocean_dyn_offline_defval, &
76  ocean_dyn_offline_check_coordinates, &
77  ocean_dyn_offline_step_limit
78 
79  integer :: ierr
80  !---------------------------------------------------------------------------
81 
82  log_newline
83  log_info("OCEAN_DYN_OFFLINE_setup",*) 'Setup'
84 
85  ocean_dyn_offline_defval = undef
86 
87  !--- read namelist
88  rewind(io_fid_conf)
89  read(io_fid_conf,nml=param_ocean_dyn_offline,iostat=ierr)
90  if( ierr < 0 ) then !--- missing
91  log_info("OCEAN_DYN_OFFLINE_setup",*) 'Not found namelist. Default used.'
92  elseif( ierr > 0 ) then !--- fatal error
93  log_error("OCEAN_DYN_OFFLINE_setup",*) 'Not appropriate names in namelist PARAM_OCEAN_DYN_OFFLINE. Check!'
94  call prc_abort
95  endif
96  log_nml(param_ocean_dyn_offline)
97 
98  log_info("OCEAN_DYN_OFFLINE_setup",*) 'Use offline ocean'
99 
100  if ( ocean_dyn_offline_basename == '' ) then
101  log_error("OCEAN_DYN_OFFLINE_setup",*) 'OCEAN_DYN_OFFLINE_basename is necessary !!'
102  call prc_abort
103  endif
104 
105  call file_external_input_regist( ocean_dyn_offline_basename, & ! [IN]
106  ocean_dyn_offline_basename_add_num, & ! [IN]
107  ocean_dyn_offline_number_of_files, & ! [IN]
108  'OCEAN_TEMP', & ! [IN]
109  'OXY', & ! [IN]
110  ocean_dyn_offline_enable_periodic_year, & ! [IN]
111  ocean_dyn_offline_enable_periodic_month, & ! [IN]
112  ocean_dyn_offline_enable_periodic_day, & ! [IN]
113  ocean_dyn_offline_step_fixed, & ! [IN]
114  ocean_dyn_offline_defval, & ! [IN]
115  check_coordinates = ocean_dyn_offline_check_coordinates, & ! [IN]
116  step_limit = ocean_dyn_offline_step_limit ) ! [IN]
117 
118  return

References scale_const::const_undef, scale_io::io_fid_conf, and scale_prc::prc_abort().

Referenced by mod_ocean_driver::ocean_driver_setup().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_dyn_offline()

subroutine, public scale_ocean_dyn_offline::ocean_dyn_offline ( integer, intent(in)  OKMAX,
integer, intent(in)  OKS,
integer, intent(in)  OKE,
integer, intent(in)  OIA,
integer, intent(in)  OIS,
integer, intent(in)  OIE,
integer, intent(in)  OJA,
integer, intent(in)  OJS,
integer, intent(in)  OJE,
logical, dimension (oia,oja), intent(in)  calc_flag,
real(dp), intent(in)  dt,
real(dp), intent(in)  NOWDAYSEC,
real(rp), dimension(okmax,oia,oja), intent(inout)  OCEAN_TEMP 
)

Slab ocean model.

Definition at line 130 of file scale_ocean_dyn_offline.F90.

130  use scale_prc, only: &
131  prc_abort
132  use scale_file_external_input, only: &
133  file_external_input_update
134  implicit none
135 
136  integer, intent(in) :: OKMAX, OKS, OKE
137  integer, intent(in) :: OIA, OIS, OIE
138  integer, intent(in) :: OJA, OJS, OJE
139  logical, intent(in) :: calc_flag (OIA,OJA) ! to decide calculate or not
140  real(DP), intent(in) :: dt
141  real(DP), intent(in) :: NOWDAYSEC
142  real(RP), intent(inout) :: OCEAN_TEMP(OKMAX,OIA,OJA)
143 
144  real(RP) :: OCEAN_TEMP_ref(OKMAX,OIA,OJA)
145 
146  logical :: error
147  integer :: i, j
148  !---------------------------------------------------------------------------
149  !$acc data copyin(calc_flag) copy(OCEAN_TEMP) create(OCEAN_TEMP_ref)
150 
151  log_progress(*) 'ocean / dynamics / offline'
152 
153  call file_external_input_update( 'OCEAN_TEMP', nowdaysec, ocean_temp_ref(:,:,:), error )
154 
155  if ( error ) then
156  log_error("OCEAN_DYN_OFFLINE",*) 'Requested data is not found!'
157  call prc_abort
158  endif
159 
160  !$acc kernels
161  do j = ojs, oje
162  do i = ois, oie
163  if ( calc_flag(i,j) ) then
164  ocean_temp(oks,i,j) = ocean_temp_ref(oks,i,j)
165  endif
166  enddo
167  enddo
168  !$acc end kernels
169 
170  !$acc end data
171  return

References scale_prc::prc_abort().

Referenced by mod_ocean_driver::ocean_driver_update().

Here is the call graph for this function:
Here is the caller graph for this function:
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_const
module CONSTANT
Definition: scale_const.F90:11
scale_file_external_input
module file / external_input
Definition: scale_file_external_input.F90:12
scale_const::const_undef
real(rp), public const_undef
Definition: scale_const.F90:43