SCALE-RM
scale_ocean_phy_file.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
12  !-----------------------------------------------------------------------------
13  !
14  !++ used modules
15  !
16  use scale_precision
17  use scale_stdio
18  use scale_prof
19  use scale_debug
21  !-----------------------------------------------------------------------------
22  implicit none
23  private
24  !-----------------------------------------------------------------------------
25  !
26  !++ Public procedure
27  !
28  public :: ocean_phy_file_setup
29  public :: ocean_phy_file
30 
31  !-----------------------------------------------------------------------------
32  !
33  !++ Public parameters & variables
34  !
35  !-----------------------------------------------------------------------------
36  !
37  !++ Private procedure
38  !
39  !-----------------------------------------------------------------------------
40  !
41  !++ Private parameters & variables
42  !
43  logical, allocatable, private :: is_ocn(:,:)
44 
45  !-----------------------------------------------------------------------------
46 contains
47  !-----------------------------------------------------------------------------
49  subroutine ocean_phy_file_setup( OCEAN_TYPE )
50  use scale_process, only: &
52  use scale_landuse, only: &
54  implicit none
55 
56  character(len=*), intent(in) :: OCEAN_TYPE
57 
58  integer :: i, j
59  integer :: ierr
60  !---------------------------------------------------------------------------
61 
62  if( io_l ) write(io_fid_log,*)
63  if( io_l ) write(io_fid_log,*) '++++++ Module[FILE] / Categ[OCEAN PHY] / Origin[SCALElib]'
64 
65  if( ocean_type /= 'FILE' ) then
66  write(*,*) 'xxx wrong OCEAN_TYPE. Check!'
67  call prc_mpistop
68  end if
69 
70  ! judge to run slab ocean model
71  allocate( is_ocn(ia,ja) )
72 
73  do j = js, je
74  do i = is, ie
75  if( landuse_fact_ocean(i,j) > 0.0_rp ) then
76  is_ocn(i,j) = .true.
77  else
78  is_ocn(i,j) = .false.
79  end if
80  end do
81  end do
82 
83  return
84  end subroutine ocean_phy_file_setup
85 
86  !-----------------------------------------------------------------------------
88  subroutine ocean_phy_file( &
89  OCEAN_TEMP_t, &
90  OCEAN_TEMP, &
91  OCEAN_SFLX_WH, &
92  OCEAN_SFLX_prec, &
93  OCEAN_SFLX_evap, &
94  dt )
96  use scale_time, only: &
97  nowdaysec => time_nowdaysec
98  use scale_process, only: &
100  use scale_external_input, only: &
101  extin_update
102  implicit none
103 
104  real(RP), intent(out) :: OCEAN_TEMP_t (ia,ja)
105  real(RP), intent(in) :: OCEAN_TEMP (ia,ja)
106  real(RP), intent(in) :: OCEAN_SFLX_WH (ia,ja)
107  real(RP), intent(in) :: OCEAN_SFLX_prec(ia,ja)
108  real(RP), intent(in) :: OCEAN_SFLX_evap(ia,ja)
109  real(DP), intent(in) :: dt
110 
111  real(RP) :: OCEAN_TEMP_new(ia,ja)
112 
113  logical :: error
114 
115  integer :: i, j
116  !---------------------------------------------------------------------------
117 
118  if( io_l ) write(io_fid_log,*) '*** Ocean step: File'
119 
120  call extin_update( &
121  ocean_temp_new, & ! (out)
122  'OCEAN_TEMP', & ! (in)
123  'XY', & ! (in)
124  nowdaysec, & ! (in)
125  error ) ! (out)
126  if ( error ) then
127  write(*,*) 'xxx Failed to read "OCEAN_TEMP" data from file!'
128  write(*,*) 'xxx set namelist EXTITEM, for example'
129  write(*,*) ' &EXTITEM'
130  write(*,*) ' basename = "filename",'
131  write(*,*) ' varname = "OCEAN_TEMP",'
132  write(*,*) ' /'
133  call prc_mpistop
134  end if
135 
136  do j = js, je
137  do i = is, ie
138  if( is_ocn(i,j) ) then
139  ocean_temp_t(i,j) = ( ocean_temp_new(i,j) - ocean_temp(i,j) ) / dt
140  else
141  ocean_temp_t(i,j) = 0.0_rp
142  endif
143  enddo
144  enddo
145 
146  return
147  end subroutine ocean_phy_file
148 
149 end module scale_ocean_phy_file
integer, public is
start point of inner domain: x, local
module DEBUG
Definition: scale_debug.F90:13
integer, public je
end point of inner domain: y, local
subroutine, public prc_mpistop
Abort MPI.
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
real(dp), public time_nowdaysec
second of current time [sec]
Definition: scale_time.F90:69
module STDIO
Definition: scale_stdio.F90:12
module grid index
integer, public ia
of x whole cells (local, with HALO)
module LANDUSE
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
integer, public js
start point of inner domain: y, local
module TIME
Definition: scale_time.F90:15
module PROCESS
module EXTERNAL INPUT
subroutine, public ocean_phy_file(OCEAN_TEMP_t, OCEAN_TEMP, OCEAN_SFLX_WH, OCEAN_SFLX_prec, OCEAN_SFLX_evap, dt)
Slab ocean model.
module OCEAN / Physics File
module profiler
Definition: scale_prof.F90:10
integer, public ie
end point of inner domain: x, local
module PRECISION
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
subroutine, public ocean_phy_file_setup(OCEAN_TYPE)
Setup.
integer, public ja
of y whole cells (local, with HALO)