SCALE-RM
mod_cpl_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  !-----------------------------------------------------------------------------
19  implicit none
20  private
21  !-----------------------------------------------------------------------------
22  !
23  !++ Public procedure
24  !
25  public :: cpl_admin_setup
26  public :: cpl_admin_getscheme
27 
28  !-----------------------------------------------------------------------------
29  !
30  !++ Public parameters & variables
31  !
32  logical, public :: cpl_sw ! do coupler calculation?
33 
34  !-----------------------------------------------------------------------------
35  !
36  !++ Private procedure
37  !
38  !-----------------------------------------------------------------------------
39  !
40  !++ Private parameters & variables
41  !
42  !-----------------------------------------------------------------------------
43 contains
44  !-----------------------------------------------------------------------------
46  subroutine cpl_admin_setup
47  use scale_process, only: &
49  use mod_atmos_admin, only: &
52  use mod_ocean_admin, only: &
53  ocean_sw
54  use mod_land_admin, only: &
55  land_sw
56  use mod_urban_admin, only: &
57  urban_sw
58  use scale_landuse, only: &
62  implicit none
63 
64  real(RP) :: checkfact
65  !---------------------------------------------------------------------------
66 
67  if( io_l ) write(io_fid_log,*)
68  if( io_l ) write(io_fid_log,*) '++++++ Module[ADMIN] / Categ[CPL] / Origin[SCALE-RM]'
69 
70  !-----< module component check >-----
71 
72  if( io_l ) write(io_fid_log,*)
73  if( io_l ) write(io_fid_log,*) '*** Coupler components ***'
74 
75  ! Atoms-Ocean/Land/Urban Switch
76  if ( ocean_sw .OR. land_sw .OR. urban_sw ) then
77  cpl_sw = .true.
78  else
79  cpl_sw = .false.
80  endif
81 
82  ! Check consistency of OCEAN_sw and LANDUSE_fact_ocean
83  checkfact = maxval( landuse_fact_ocean(:,:) )
84  if ( .NOT. ocean_sw .AND. checkfact > 0.0_rp ) then
85  if( io_l ) write(io_fid_log,*) 'xxx Ocean fraction exists, but ocean components never called. STOP.', checkfact
86  write(*,*) 'xxx Ocean fraction exists, but ocean components never called. STOP.', checkfact
87  call prc_mpistop
88  endif
89 
90  ! Check consistency of LAND_sw and LANDUSE_fact_land
91  checkfact = maxval( landuse_fact_land(:,:) )
92  if ( .NOT. land_sw .AND. checkfact > 0.0_rp ) then
93  if( io_l ) write(io_fid_log,*) 'xxx Land fraction exists, but land components never called. STOP.', checkfact
94  write(*,*) 'xxx Land fraction exists, but land components never called. STOP.', checkfact
95  call prc_mpistop
96  endif
97 
98  ! Check consistency of URBAN_sw and LANDUSE_fact_urban
99  checkfact = maxval( landuse_fact_urban(:,:) )
100  if ( .NOT. urban_sw .AND. checkfact > 0.0_rp ) then
101  if( io_l ) write(io_fid_log,*) 'xxx URBAN fraction exists, but urban components never called. STOP.', checkfact
102  write(*,*) 'xxx URBAN fraction exists, but urban components never called. STOP.', checkfact
103  call prc_mpistop
104  endif
105 
106  ! Check Atmos_Surface setting
107  if ( cpl_sw ) then
108  if( io_l ) write(io_fid_log,*) '*** Coupler : ON'
109 
110  if ( atmos_phy_sf_type == 'COUPLE' ) then
111  ! do nothing
112  elseif( atmos_phy_sf_type == 'NONE' ) then
113  if( io_l ) write(io_fid_log,*) '*** -> Surface Flux Type is forced to change from NONE to COUPLE.'
114  ! overwrite
115  atmos_phy_sf_type = 'COUPLE'
116  atmos_sw_phy_sf = .true.
117  else
118  if( io_l ) write(io_fid_log,*) '*** Surface Flux : ', trim(atmos_phy_sf_type)
119  if( io_l ) write(io_fid_log,*) 'xxx Setting conflicts between coupler and surface flux! STOP.'
120  write(*,*) 'xxx Setting conflicts between coupler and surface flux! STOP.'
121  call prc_mpistop
122  endif
123  else
124  if( io_l ) write(io_fid_log,*) '*** Coupler : OFF'
125  endif
126 
127  return
128  end subroutine cpl_admin_setup
129 
130  !-----------------------------------------------------------------------------
132  subroutine cpl_admin_getscheme
133  implicit none
134  !---------------------------------------------------------------------------
135 
136  return
137  end subroutine cpl_admin_getscheme
138 
139 end module mod_cpl_admin
module ATMOS admin
module Land admin
logical, public ocean_sw
logical, public urban_sw
subroutine, public prc_mpistop
Abort MPI.
real(rp), dimension(:,:), allocatable, public landuse_fact_urban
urban factor
logical, public io_l
output log or not? (this process)
Definition: scale_stdio.F90:59
module STDIO
Definition: scale_stdio.F90:12
character(len=h_short), public atmos_phy_sf_type
module LANDUSE
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
module PROCESS
module Ocean admin
logical, public atmos_sw_phy_sf
subroutine, public cpl_admin_getscheme
Get name of scheme for each component.
logical, public cpl_sw
module profiler
Definition: scale_prof.F90:10
subroutine, public cpl_admin_setup
Setup.
module PRECISION
logical, public land_sw
real(rp), dimension(:,:), allocatable, public landuse_fact_land
land factor
integer, public io_fid_log
Log file ID.
Definition: scale_stdio.F90:56
module Coupler admin
module Urban admin