FE-Project
Loading...
Searching...
No Matches
scale_coriolis_param.F90
Go to the documentation of this file.
1!-------------------------------------------------------------------------------
2!> Module common / Coriolis parameter
3!!
4!! @par Description
5!! Setup coriolis parameter (for regional model)
6!!
7!!
8!! @par Reference
9!!
10!! @author Yuta Kawai, Team SCALE
11!!
12#include "scaleFElib.h"
14 !-----------------------------------------------------------------------------
15 !
16 !++ used modules
17 !
18 use scale_precision
19 use scale_const, only: &
20 pi => const_pi, &
21 ohm => const_ohm
22
23 use scale_io
24 use scale_prc
25
26 !-----------------------------------------------------------------------------
27 implicit none
28 private
29 !-----------------------------------------------------------------------------
30 !
31 !++ Public procedure
32 !
34
35contains
36
37!> Get Coriolis parameter
38!OCL SERIAL
40 coriolis, &
41 COLIORIS_type, Np, &
42 y, f0, beta, y0, &
43 lat )
44
45 implicit none
46
47 integer, intent(in) :: np !< Array size
48 real(rp), intent(out) :: coriolis(np) !< Array storing Coriolis parameter
49 character(*), intent(in) :: colioris_type !< Type of Coriolis parameter [PLANE / SPHERE / NONE]
50 real(rp), intent(in), optional :: y(np) !< y-coordinate which is used when COLIORIS_type=PLANE
51 real(rp), intent(in), optional :: f0 !< Value of Coriolis parameter at reference latitude which is used when COLIORIS_type=PLANE
52 real(rp), intent(in), optional :: beta !< Rossby parameter at reference latitude which is used when COLIORIS_type=PLANE
53 real(rp), intent(in), optional :: y0 !< Distance from reference latitude
54 real(rp), intent(in), optional :: lat(np) !< Latitude
55
56 integer :: i
57 !------------------------------------------
58
59 if ( trim(colioris_type) == 'PLANE' ) then
60 if ( ( .not. present(f0) ) .or. ( .not. present(beta) ) &
61 .or. ( .not. present(y) ) .or. ( .not. present(y0) ) ) then
62 log_error('get_coriolis_parameter',*) 'If COLIORIS_type is set to PLANE, f0 and beta must be passed. Check!'
63 call prc_abort
64 end if
65 !$omp parallel do
66 do i=1, np
67 coriolis(i) = f0 + beta * ( y(i) - y0 )
68 end do
69 else if ( trim(colioris_type) == 'SPHERE' ) then
70 if ( .not. present(lat) ) then
71 log_error('get_coriolis_parameter',*) 'If COLIORIS_type is set to SPHERE, lat must be passed. Check!'
72 call prc_abort
73 end if
74 !$omp parallel do
75 do i=1, np
76 coriolis(i) = 2.0_rp * ohm * sin( lat(i) )
77 end do
78 else if ( trim(colioris_type) == 'NONE' ) then
79 !$omp parallel do
80 do i=1, np
81 coriolis(i) = 0.0_rp
82 end do
83 else
84 log_error('get_coriolis_parameter',*) 'Unexpected COLIORIS_type is specified. Check! COLIORIS_type=', colioris_type
85 call prc_abort
86 end if
87
88 return
89 end subroutine get_coriolis_parameter
90
91end module scale_coriolis_param
Module common / Coriolis parameter.
subroutine, public get_coriolis_parameter(coriolis, colioris_type, np, y, f0, beta, y0, lat)
Get Coriolis parameter.