SCALE-RM
Functions/Subroutines | Variables
scale_spnudge Module Reference

Functions/Subroutines

subroutine, public spnudge_setup (KA, KS, KE, IA, IS, IE, JA, JS, JE)
 

Variables

logical, public spnudge_uv = .false.
 
logical, public spnudge_uv_divfree = .false.
 
integer, public spnudge_uv_lm = 3
 
integer, public spnudge_uv_mm = 3
 
logical, public spnudge_pt = .false.
 
integer, public spnudge_pt_lm = 3
 
integer, public spnudge_pt_mm = 3
 
logical, public spnudge_qv = .false.
 
integer, public spnudge_qv_lm = 3
 
integer, public spnudge_qv_mm = 3
 
real(rp), dimension(:,:,:), allocatable, public spnudge_u_alpha
 
real(rp), dimension(:,:,:), allocatable, public spnudge_v_alpha
 
real(rp), dimension(:,:,:), allocatable, public spnudge_pt_alpha
 
real(rp), dimension(:,:,:), allocatable, public spnudge_qv_alpha
 

Detailed Description

NAMELIST
  • PARAM_SPNUDGE
    nametypedefault valuecomment
    SPNUDGE_UV logical .false.
    SPNUDGE_UV_DIVFREE logical .false.
    SPNUDGE_UV_LM integer 3
    SPNUDGE_UV_MM integer 3
    SPNUDGE_UV_TAU real(RP) 0.0_RP
    SPNUDGE_PT logical .false.
    SPNUDGE_PT_LM integer 3
    SPNUDGE_PT_MM integer 3
    SPNUDGE_PT_TAU real(RP) 0.0_RP
    SPNUDGE_QV logical .false.
    SPNUDGE_QV_LM integer 3
    SPNUDGE_QV_MM integer 3
    SPNUDGE_QV_TAU real(RP) 0.0_RP
    SPNUDGE_LEVEL1 real(RP) 0.0_RP > alpha = 0 for z < SPNUDGE_level1
    SPNUDGE_LEVEL2 real(RP) 0.0_RP
    SPNUDGE_LEVEL3 real(RP) 1E10_RP > alpha = alpha for SPNUDGE_level2 <= z < SPNUDGE_level3
    SPNUDGE_LEVEL4 real(RP) 1E10_RP > alpha = 0 for z => SPNUDGE_level4

History Output
No history output

Function/Subroutine Documentation

◆ spnudge_setup()

subroutine, public scale_spnudge::spnudge_setup ( integer, intent(in)  KA,
integer, intent(in)  KS,
integer, intent(in)  KE,
integer, intent(in)  IA,
integer, intent(in)  IS,
integer, intent(in)  IE,
integer, intent(in)  JA,
integer, intent(in)  JS,
integer, intent(in)  JE 
)

Definition at line 50 of file scale_spnudge.F90.

50  use scale_dft, only: &
51  dft_setup
53  real_cz => atmos_grid_cartesc_real_cz, &
54  real_czuy => atmos_grid_cartesc_real_czuy, &
55  real_czxv => atmos_grid_cartesc_real_czxv
56  implicit none
57  integer, intent(in) :: KA, KS, KE
58  integer, intent(in) :: IA, IS, IE
59  integer, intent(in) :: JA, JS, JE
60 
61  real(RP) :: SPNUDGE_uv_tau = 0.0_rp
62  real(RP) :: SPNUDGE_pt_tau = 0.0_rp
63  real(RP) :: SPNUDGE_qv_tau = 0.0_rp
64 
65  real(RP) :: SPNUDGE_level1 = 0.0_rp
66  real(RP) :: SPNUDGE_level2 = 0.0_rp
67  real(RP) :: SPNUDGE_level3 = 1e10_rp
68  real(RP) :: SPNUDGE_level4 = 1e10_rp
69 
70  namelist /param_spnudge/ &
71  spnudge_uv, &
73  spnudge_uv_lm, &
74  spnudge_uv_mm, &
75  spnudge_uv_tau, &
76  spnudge_pt, &
77  spnudge_pt_lm, &
78  spnudge_pt_mm, &
79  spnudge_pt_tau, &
80  spnudge_qv, &
81  spnudge_qv_lm, &
82  spnudge_qv_mm, &
83  spnudge_qv_tau, &
84  spnudge_level1, &
85  spnudge_level2, &
86  spnudge_level3, &
87  spnudge_level4
88 
89  real(RP) :: uv_alpha, pt_alpha, qv_alpha
90 
91 
92  integer :: k, i, j
93  integer :: ierr
94  !---------------------------------------------------------------------------
95 
96  log_newline
97  log_info("SPNUDGE_setup",*) 'Setup'
98 
99  !--- read namelist
100  rewind(io_fid_conf)
101  read(io_fid_conf,nml=param_spnudge,iostat=ierr)
102  if( ierr < 0 ) then !--- missing
103  log_info("SPNUDGE_setup",*) 'Not found namelist. Default used.'
104  elseif( ierr > 0 ) then !--- fatal error
105  log_error("SPNUDGE_setup",*) 'Not appropriate names in namelist PARAM_SPNUDGE. Check!'
106  call prc_abort
107  endif
108  log_nml(param_spnudge)
109 
110  if ( spnudge_level1 > spnudge_level2 ) then
111  log_error("SPNUDGE_setup",*) 'SPNUDGE_level1 must be lowere or equal to SPNUDGE_level2'
112  call prc_abort
113  end if
114  if ( spnudge_level2 > spnudge_level3 ) then
115  log_error("SPNUDGE_setup",*) 'SPNUDGE_level2 must be lowere or equal to SPNUDGE_level3'
116  call prc_abort
117  end if
118  if ( spnudge_level3 > spnudge_level4 ) then
119  log_error("SPNUDGE_setup",*) 'SPNUDGE_level3 must be lowere or equal to SPNUDGE_level4'
120  call prc_abort
121  end if
122 
123  if ( spnudge_uv .or. spnudge_pt .or. spnudge_qv ) then
124  log_warn("SPNUDGE_setup",*) 'Spectrul nudging is still experimental'
125  end if
126 
127  allocate( spnudge_u_alpha(ka,ia,ja) )
128  allocate( spnudge_v_alpha(ka,ia,ja) )
129  allocate( spnudge_pt_alpha(ka,ia,ja) )
130  allocate( spnudge_qv_alpha(ka,ia,ja) )
131 
132  if ( spnudge_uv .and. spnudge_uv_tau > 0.0_rp ) then
133  uv_alpha = 1.0_rp / spnudge_uv_tau
134 
135  !$omp parallel do
136  do j = js, je
137  do i = is, ie
138  do k = ks, ke
139  if ( real_czuy(k,i,j) < spnudge_level1 ) then
140  spnudge_u_alpha(k,i,j) = 0.0_rp
141  elseif ( real_czuy(k,i,j) < spnudge_level2 ) then
142  spnudge_u_alpha(k,i,j) = ( real_czuy(k,i,j) - spnudge_level1 ) / ( spnudge_level2 - spnudge_level1 ) * uv_alpha
143  elseif ( real_czuy(k,i,j) < spnudge_level3 ) then
144  spnudge_u_alpha(k,i,j) = uv_alpha
145  elseif ( real_czuy(k,i,j) < spnudge_level4 ) then
146  spnudge_u_alpha(k,i,j) = ( real_czuy(k,i,j) - spnudge_level3 ) / ( spnudge_level4 - spnudge_level3 ) * uv_alpha
147  else
148  spnudge_u_alpha(k,i,j) = 0.0_rp
149  endif
150  enddo
151  enddo
152  enddo
153 
154  !$omp parallel do
155  do j = js, je
156  do i = is, ie
157  do k = ks, ke
158  if ( real_czxv(k,i,j) < spnudge_level1 ) then
159  spnudge_v_alpha(k,i,j) = 0.0_rp
160  elseif ( real_czxv(k,i,j) < spnudge_level2 ) then
161  spnudge_v_alpha(k,i,j) = ( real_czxv(k,i,j) - spnudge_level1 ) / ( spnudge_level2 - spnudge_level1 ) * uv_alpha
162  elseif ( real_czxv(k,i,j) < spnudge_level3 ) then
163  spnudge_v_alpha(k,i,j) = uv_alpha
164  elseif ( real_czxv(k,i,j) < spnudge_level4 ) then
165  spnudge_v_alpha(k,i,j) = ( real_czxv(k,i,j) - spnudge_level3 ) / ( spnudge_level4 - spnudge_level3 ) * uv_alpha
166  else
167  spnudge_v_alpha(k,i,j) = 0.0_rp
168  endif
169  enddo
170  enddo
171  enddo
172 
173  else
174 
175  !$omp parallel do
176  do j = js, je
177  do i = is, ie
178  do k = ks, ke
179  spnudge_u_alpha(k,i,j) = 0.0_rp
180  spnudge_v_alpha(k,i,j) = 0.0_rp
181  end do
182  end do
183  end do
184 
185  endif
186 
187  if ( spnudge_pt .and. spnudge_pt_tau > 0.0_rp ) then
188  pt_alpha = 1.0_rp / spnudge_pt_tau
189 
190  !$omp parallel do
191  do j = js, je
192  do i = is, ie
193  do k = ks, ke
194  if ( real_cz(k,i,j) < spnudge_level1 ) then
195  spnudge_pt_alpha(k,i,j) = 0.0_rp
196  elseif ( real_cz(k,i,j) < spnudge_level2 ) then
197  spnudge_pt_alpha(k,i,j) = ( real_cz(k,i,j) - spnudge_level1 ) / ( spnudge_level2 - spnudge_level1 ) * pt_alpha
198  elseif ( real_cz(k,i,j) < spnudge_level3 ) then
199  spnudge_pt_alpha(k,i,j) = pt_alpha
200  elseif ( real_cz(k,i,j) < spnudge_level4 ) then
201  spnudge_pt_alpha(k,i,j) = ( real_cz(k,i,j) - spnudge_level3 ) / ( spnudge_level4 - spnudge_level3 ) * pt_alpha
202  else
203  spnudge_pt_alpha(k,i,j) = 0.0_rp
204  endif
205  enddo
206  enddo
207  enddo
208 
209  else
210 
211  !$omp parallel do
212  do j = js, je
213  do i = is, ie
214  do k = ks, ke
215  spnudge_pt_alpha(k,i,j) = 0.0_rp
216  end do
217  end do
218  end do
219 
220  endif
221 
222  if ( spnudge_qv .and. spnudge_qv_tau > 0.0_rp ) then
223  qv_alpha = 1.0_rp / spnudge_qv_tau
224 
225  !$omp parallel do
226  do j = js, je
227  do i = is, ie
228  do k = ks, ke
229  if ( real_cz(k,i,j) < spnudge_level1 ) then
230  spnudge_qv_alpha(k,i,j) = 0.0_rp
231  elseif ( real_cz(k,i,j) < spnudge_level2 ) then
232  spnudge_qv_alpha(k,i,j) = ( real_cz(k,i,j) - spnudge_level1 ) / ( spnudge_level2 - spnudge_level1 ) * qv_alpha
233  elseif ( real_cz(k,i,j) < spnudge_level3 ) then
234  spnudge_qv_alpha(k,i,j) = qv_alpha
235  elseif ( real_cz(k,i,j) < spnudge_level4 ) then
236  spnudge_qv_alpha(k,i,j) = ( real_cz(k,i,j) - spnudge_level3 ) / ( spnudge_level4 - spnudge_level3 ) * qv_alpha
237  else
238  spnudge_qv_alpha(k,i,j) = 0.0_rp
239  endif
240  enddo
241  enddo
242  enddo
243 
244  else
245 
246  !$omp parallel do
247  do j = js, je
248  do i = is, ie
249  do k = ks, ke
250  spnudge_qv_alpha(k,i,j) = 0.0_rp
251  end do
252  end do
253  end do
254 
255  end if
256 
257  call dft_setup( ka, ks, ke, ia, is, ie, ja, js, je, &
260 
261  return

References scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czuy, scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czxv, scale_dft::dft_setup(), scale_io::io_fid_conf, scale_prc::prc_abort(), spnudge_pt, spnudge_pt_alpha, spnudge_pt_lm, spnudge_pt_mm, spnudge_qv, spnudge_qv_alpha, spnudge_qv_lm, spnudge_qv_mm, spnudge_u_alpha, spnudge_uv, spnudge_uv_divfree, spnudge_uv_lm, spnudge_uv_mm, and spnudge_v_alpha.

Referenced by scale_atmos_dyn::atmos_dyn_setup().

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

Variable Documentation

◆ spnudge_uv

logical, public scale_spnudge::spnudge_uv = .false.

Definition at line 24 of file scale_spnudge.F90.

24  logical, public :: SPNUDGE_uv = .false.

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_uv_divfree

logical, public scale_spnudge::spnudge_uv_divfree = .false.

Definition at line 25 of file scale_spnudge.F90.

25  logical, public :: SPNUDGE_uv_divfree = .false.

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_uv_lm

integer, public scale_spnudge::spnudge_uv_lm = 3

Definition at line 26 of file scale_spnudge.F90.

26  integer, public :: SPNUDGE_uv_lm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_uv_mm

integer, public scale_spnudge::spnudge_uv_mm = 3

Definition at line 27 of file scale_spnudge.F90.

27  integer, public :: SPNUDGE_uv_mm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_pt

logical, public scale_spnudge::spnudge_pt = .false.

Definition at line 29 of file scale_spnudge.F90.

29  logical, public :: SPNUDGE_pt = .false.

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_pt_lm

integer, public scale_spnudge::spnudge_pt_lm = 3

Definition at line 30 of file scale_spnudge.F90.

30  integer, public :: SPNUDGE_pt_lm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_pt_mm

integer, public scale_spnudge::spnudge_pt_mm = 3

Definition at line 31 of file scale_spnudge.F90.

31  integer, public :: SPNUDGE_pt_mm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_qv

logical, public scale_spnudge::spnudge_qv = .false.

Definition at line 33 of file scale_spnudge.F90.

33  logical, public :: SPNUDGE_qv = .false.

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_qv_lm

integer, public scale_spnudge::spnudge_qv_lm = 3

Definition at line 34 of file scale_spnudge.F90.

34  integer, public :: SPNUDGE_qv_lm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_qv_mm

integer, public scale_spnudge::spnudge_qv_mm = 3

Definition at line 35 of file scale_spnudge.F90.

35  integer, public :: SPNUDGE_qv_mm = 3

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_u_alpha

real(rp), dimension(:,:,:), allocatable, public scale_spnudge::spnudge_u_alpha

Definition at line 37 of file scale_spnudge.F90.

37  real(RP), allocatable, public :: SPNUDGE_u_alpha(:,:,:)

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_v_alpha

real(rp), dimension(:,:,:), allocatable, public scale_spnudge::spnudge_v_alpha

Definition at line 38 of file scale_spnudge.F90.

38  real(RP), allocatable, public :: SPNUDGE_v_alpha(:,:,:)

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_pt_alpha

real(rp), dimension(:,:,:), allocatable, public scale_spnudge::spnudge_pt_alpha

Definition at line 39 of file scale_spnudge.F90.

39  real(RP), allocatable, public :: SPNUDGE_pt_alpha(:,:,:)

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

◆ spnudge_qv_alpha

real(rp), dimension(:,:,:), allocatable, public scale_spnudge::spnudge_qv_alpha

Definition at line 40 of file scale_spnudge.F90.

40  real(RP), allocatable, public :: SPNUDGE_qv_alpha(:,:,:)

Referenced by scale_atmos_dyn_tstep_large_fvm_heve::atmos_dyn_tstep_large_fvm_heve(), and spnudge_setup().

scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:342
scale_spnudge::spnudge_uv_lm
integer, public spnudge_uv_lm
Definition: scale_spnudge.F90:26
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_cz
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_cz
geopotential height [m] (zxy)
Definition: scale_atmos_grid_cartesC_real.F90:38
scale_spnudge::spnudge_pt_lm
integer, public spnudge_pt_lm
Definition: scale_spnudge.F90:30
scale_spnudge::spnudge_pt
logical, public spnudge_pt
Definition: scale_spnudge.F90:29
scale_spnudge::spnudge_pt_alpha
real(rp), dimension(:,:,:), allocatable, public spnudge_pt_alpha
Definition: scale_spnudge.F90:39
scale_spnudge::spnudge_uv_divfree
logical, public spnudge_uv_divfree
Definition: scale_spnudge.F90:25
scale_atmos_grid_cartesc_real
module Atmosphere GRID CartesC Real(real space)
Definition: scale_atmos_grid_cartesC_real.F90:11
scale_spnudge::spnudge_qv_lm
integer, public spnudge_qv_lm
Definition: scale_spnudge.F90:34
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czxv
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_czxv
geopotential height [m] (zxv)
Definition: scale_atmos_grid_cartesC_real.F90:40
scale_spnudge::spnudge_qv
logical, public spnudge_qv
Definition: scale_spnudge.F90:33
scale_dft
Definition: scale_dft.F90:3
scale_spnudge::spnudge_pt_mm
integer, public spnudge_pt_mm
Definition: scale_spnudge.F90:31
scale_spnudge::spnudge_u_alpha
real(rp), dimension(:,:,:), allocatable, public spnudge_u_alpha
Definition: scale_spnudge.F90:37
scale_dft::dft_setup
subroutine, public dft_setup(KA, KS, KE, IA, IS, IE, JA, JS, JE, LM, MM)
Definition: scale_dft.F90:36
scale_spnudge::spnudge_qv_mm
integer, public spnudge_qv_mm
Definition: scale_spnudge.F90:35
scale_spnudge::spnudge_uv_mm
integer, public spnudge_uv_mm
Definition: scale_spnudge.F90:27
scale_spnudge::spnudge_qv_alpha
real(rp), dimension(:,:,:), allocatable, public spnudge_qv_alpha
Definition: scale_spnudge.F90:40
scale_spnudge::spnudge_uv
logical, public spnudge_uv
Definition: scale_spnudge.F90:24
scale_spnudge::spnudge_v_alpha
real(rp), dimension(:,:,:), allocatable, public spnudge_v_alpha
Definition: scale_spnudge.F90:38
scale_atmos_grid_cartesc_real::atmos_grid_cartesc_real_czuy
real(rp), dimension(:,:,:), allocatable, public atmos_grid_cartesc_real_czuy
geopotential height [m] (zuy)
Definition: scale_atmos_grid_cartesC_real.F90:39