SCALE-RM
Functions/Subroutines
scale_ocean_phy_file Module Reference

module OCEAN / Physics File More...

Functions/Subroutines

subroutine, public ocean_phy_file_setup (OCEAN_TYPE)
 Setup. More...
 
subroutine, public ocean_phy_file (OCEAN_TEMP_t, OCEAN_TEMP, OCEAN_SFLX_WH, OCEAN_SFLX_prec, OCEAN_SFLX_evap, dt)
 Slab ocean model. More...
 

Detailed Description

module OCEAN / Physics File

Description
ocean physics module, external file input
Author
Team SCALE
NAMELIST
  • PARAM_OCEAN_PHY_FILE
    nametypedefault valuecomment
    OCEAN_PHY_FILE_BASENAME character(len=H_LONG) ''
    OCEAN_PHY_FILE_ENABLE_PERIODIC_YEAR logical .false.
    OCEAN_PHY_FILE_ENABLE_PERIODIC_MONTH logical .false.
    OCEAN_PHY_FILE_ENABLE_PERIODIC_DAY logical .false.
    OCEAN_PHY_FILE_STEP_FIXED integer 0
    OCEAN_PHY_FILE_OFFSET real(RP) 0.0_RP
    OCEAN_PHY_FILE_DEFVAL real(RP) = UNDEF
    OCEAN_PHY_FILE_CHECK_COORDINATES logical .true.
    OCEAN_PHY_FILE_STEP_LIMIT integer 0

History Output
No history output

Function/Subroutine Documentation

◆ ocean_phy_file_setup()

subroutine, public scale_ocean_phy_file::ocean_phy_file_setup ( character(len=*), intent(in)  OCEAN_TYPE)

Setup.

Definition at line 50 of file scale_ocean_phy_file.F90.

References scale_const::const_undef, scale_external_input::extin_regist(), scale_grid_index::ia, scale_grid_index::ie, scale_stdio::io_fid_conf, scale_stdio::io_fid_log, scale_stdio::io_fid_nml, scale_stdio::io_l, scale_stdio::io_nml, scale_grid_index::is, scale_grid_index::ja, scale_grid_index::je, scale_grid_index::js, scale_landuse::landuse_fact_ocean, and scale_process::prc_mpistop().

Referenced by scale_ocean_phy::ocean_phy_setup().

50  use scale_process, only: &
52  use scale_landuse, only: &
53  landuse_fact_ocean
54  use scale_external_input, only: &
56  use scale_const, only: &
57  undef => const_undef
58  implicit none
59 
60  character(len=*), intent(in) :: OCEAN_TYPE
61 
62  character(len=H_LONG) :: OCEAN_PHY_FILE_basename = ''
63  logical :: OCEAN_PHY_FILE_enable_periodic_year = .false.
64  logical :: OCEAN_PHY_FILE_enable_periodic_month = .false.
65  logical :: OCEAN_PHY_FILE_enable_periodic_day = .false.
66  integer :: OCEAN_PHY_FILE_step_fixed = 0
67  real(RP) :: OCEAN_PHY_FILE_offset = 0.0_rp
68  real(RP) :: OCEAN_PHY_FILE_defval ! = UNDEF
69  logical :: OCEAN_PHY_FILE_check_coordinates = .true.
70  integer :: OCEAN_PHY_FILE_step_limit = 0
71 
72  namelist / param_ocean_phy_file / &
73  ocean_phy_file_basename, &
74  ocean_phy_file_enable_periodic_year, &
75  ocean_phy_file_enable_periodic_month, &
76  ocean_phy_file_enable_periodic_day, &
77  ocean_phy_file_step_fixed, &
78  ocean_phy_file_offset, &
79  ocean_phy_file_defval, &
80  ocean_phy_file_check_coordinates, &
81  ocean_phy_file_step_limit
82 
83  integer :: i, j
84  integer :: ierr
85  !---------------------------------------------------------------------------
86 
87  if( io_l ) write(io_fid_log,*)
88  if( io_l ) write(io_fid_log,*) '++++++ Module[FILE] / Categ[OCEAN PHY] / Origin[SCALElib]'
89 
90  if ( ocean_type /= 'FILE' ) then
91  write(*,*) 'xxx wrong OCEAN_TYPE. Check!'
92  call prc_mpistop
93  end if
94 
95  ocean_phy_file_defval = undef
96 
97  !--- read namelist
98  rewind(io_fid_conf)
99  read(io_fid_conf,nml=param_ocean_phy_file,iostat=ierr)
100  if( ierr < 0 ) then !--- missing
101  if( io_l ) write(io_fid_log,*) '*** Not found namelist. Default used.'
102  elseif( ierr > 0 ) then !--- fatal error
103  write(*,*) 'xxx Not appropriate names in namelist PARAM_OCEAN_PHY_FILE. Check!'
104  call prc_mpistop
105  endif
106  if( io_nml ) write(io_fid_nml,nml=param_ocean_phy_file)
107 
108  if ( ocean_phy_file_basename == '' ) then
109  write(*,*) 'xxx OCEAN_PHY_FILE_basename is necessary'
110  call prc_mpistop
111  end if
112 
113  call extin_regist( ocean_phy_file_basename, & ! [IN]
114  'OCEAN_TEMP', & ! [IN]
115  'XY', & ! [IN]
116  ocean_phy_file_enable_periodic_year, & ! [IN]
117  ocean_phy_file_enable_periodic_month, & ! [IN]
118  ocean_phy_file_enable_periodic_day, & ! [IN]
119  ocean_phy_file_step_fixed, & ! [IN]
120  ocean_phy_file_offset, & ! [IN]
121  ocean_phy_file_defval, & ! [IN]
122  ocean_phy_file_check_coordinates, & ! [IN]
123  ocean_phy_file_step_limit ) ! [IN]
124 
125  ! judge to run slab ocean model
126  allocate( is_ocn(ia,ja) )
127 
128  do j = js, je
129  do i = is, ie
130  if ( landuse_fact_ocean(i,j) > 0.0_rp ) then
131  is_ocn(i,j) = .true.
132  else
133  is_ocn(i,j) = .false.
134  end if
135  end do
136  end do
137 
138  return
subroutine, public prc_mpistop
Abort MPI.
module LANDUSE
module PROCESS
subroutine, public extin_regist(basename, varname, axistype, enable_periodic_year, enable_periodic_month, enable_periodic_day, step_fixed, offset, defval, check_coordinates, step_limit, exist)
Regist data.
module CONSTANT
Definition: scale_const.F90:14
module EXTERNAL INPUT
integer, public io_fid_conf
Config file ID.
Definition: scale_stdio.F90:55
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ocean_phy_file()

subroutine, public scale_ocean_phy_file::ocean_phy_file ( real(rp), dimension (ia,ja), intent(out)  OCEAN_TEMP_t,
real(rp), dimension (ia,ja), intent(in)  OCEAN_TEMP,
real(rp), dimension (ia,ja), intent(in)  OCEAN_SFLX_WH,
real(rp), dimension(ia,ja), intent(in)  OCEAN_SFLX_prec,
real(rp), dimension(ia,ja), intent(in)  OCEAN_SFLX_evap,
real(dp), intent(in)  dt 
)

Slab ocean model.

Definition at line 150 of file scale_ocean_phy_file.F90.

References scale_grid_index::ie, scale_stdio::io_fid_log, scale_stdio::io_l, scale_grid_index::is, scale_grid_index::je, scale_grid_index::js, scale_process::prc_mpistop(), and scale_time::time_nowdaysec.

Referenced by scale_ocean_phy::ocean_phy_setup().

150  use scale_grid_index
151  use scale_time, only: &
152  nowdaysec => time_nowdaysec
153  use scale_process, only: &
155  use scale_external_input, only: &
156  extin_update
157  implicit none
158 
159  real(RP), intent(out) :: OCEAN_TEMP_t (IA,JA)
160  real(RP), intent(in) :: OCEAN_TEMP (IA,JA)
161  real(RP), intent(in) :: OCEAN_SFLX_WH (IA,JA)
162  real(RP), intent(in) :: OCEAN_SFLX_prec(IA,JA)
163  real(RP), intent(in) :: OCEAN_SFLX_evap(IA,JA)
164  real(DP), intent(in) :: dt
165 
166  real(RP) :: OCEAN_TEMP_new(IA,JA)
167 
168  logical :: error
169 
170  integer :: i, j
171  !---------------------------------------------------------------------------
172 
173  if( io_l ) write(io_fid_log,*) '*** Ocean physics step: File'
174 
175  call extin_update( &
176  ocean_temp_new, & ! (out)
177  'OCEAN_TEMP', & ! (in)
178  nowdaysec, & ! (in)
179  error ) ! (out)
180  if ( error ) then
181  write(*,*) 'xxx Requested data is not found!'
182  call prc_mpistop
183  end if
184 
185  do j = js, je
186  do i = is, ie
187  if( is_ocn(i,j) ) then
188  ocean_temp_t(i,j) = ( ocean_temp_new(i,j) - ocean_temp(i,j) ) / dt
189  else
190  ocean_temp_t(i,j) = 0.0_rp
191  endif
192  enddo
193  enddo
194 
195  return
subroutine, public prc_mpistop
Abort MPI.
real(dp), public time_nowdaysec
second of current time [sec]
Definition: scale_time.F90:69
module grid index
module TIME
Definition: scale_time.F90:15
module PROCESS
module EXTERNAL INPUT
Here is the call graph for this function:
Here is the caller graph for this function: