SCALE-RM
scale_file_external_input_cartesC.F90
Go to the documentation of this file.
1 !-------------------------------------------------------------------------------
10 !-------------------------------------------------------------------------------
11 #include "scalelib.h"
13  !-----------------------------------------------------------------------------
14  !
15  !++ Used modules
16  !
17  use scale_precision
18  use scale_io
19  use scale_prof
24  !-----------------------------------------------------------------------------
25  implicit none
26  private
27  !-----------------------------------------------------------------------------
28  !
29  !++ Public procedures
30  !
33 
34  !-----------------------------------------------------------------------------
35  !
36  !++ Public parameters & variables
37  !
38  private :: file_external_input_cartesc_get_dims1d
39  private :: file_external_input_cartesc_get_dims2d
40  private :: file_external_input_cartesc_get_dims3d
41 
42  !-----------------------------------------------------------------------------
43  !
44  !++ Private procedures
45  !
46  !-----------------------------------------------------------------------------
47  !
48  !++ Private parameters & variables
49  !
50  !-----------------------------------------------------------------------------
51 contains
52  !-----------------------------------------------------------------------------
63 
65 
66  file_external_input_get_dims1d => file_external_input_cartesc_get_dims1d
67  file_external_input_get_dims2d => file_external_input_cartesc_get_dims2d
68  file_external_input_get_dims3d => file_external_input_cartesc_get_dims3d
69 
73 
74  return
76 
77  !-----------------------------------------------------------------------------
82 
84 
85  return
87 
88  !-----------------------------------------------------------------------------
90  subroutine file_external_input_cartesc_get_dims1d( &
91  dim1_size, &
92  dim1_max, &
93  dim1_S, &
94  varname, &
95  axistype )
96  use scale_prc, only: &
97  prc_abort
98  implicit none
99  integer, intent(out) :: dim1_size
100  integer, intent(out) :: dim1_max
101  integer, intent(out) :: dim1_s
102  character(len=*), intent(in) :: varname
103  character(len=*), intent(in) :: axistype ! axis type (Z/X/Y)
104 
105  select case ( axistype )
106  case ( 'Z' )
107  dim1_size = ka
108  dim1_max = kmax
109  dim1_s = ks
110  case ( 'X' )
111  dim1_size = ia
112  dim1_max = imaxb
113  dim1_s = isb
114  case ( 'Y' )
115  dim1_size = ja
116  dim1_max = jmaxb
117  dim1_s = jsb
118  case ( 'OZ' )
119  dim1_size = oka
120  dim1_max = okmax
121  dim1_s = oks
122  case default
123  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims1D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
124  call prc_abort
125  end select
126 
127  return
128  end subroutine file_external_input_cartesc_get_dims1d
129 
130  subroutine file_external_input_cartesc_get_dims2d( &
131  dim1_size, &
132  dim1_max, &
133  dim1_S, &
134  dim2_size, &
135  dim2_max, &
136  dim2_S, &
137  transpose, &
138  varname, &
139  axistype )
140  use scale_prc, only: &
141  prc_abort
142  implicit none
143  integer, intent(out) :: dim1_size
144  integer, intent(out) :: dim1_max
145  integer, intent(out) :: dim1_s
146  integer, intent(out) :: dim2_size
147  integer, intent(out) :: dim2_max
148  integer, intent(out) :: dim2_s
149  logical, intent(out) :: transpose
150  character(len=*), intent(in) :: varname
151  character(len=*), intent(in) :: axistype ! axis type (XY/XZ/ZX)
152 
153  select case ( axistype )
154  case ( 'XY' )
155  dim1_size = ia
156  dim1_max = imaxb
157  dim1_s = isb
158  dim2_size = ja
159  dim2_max = jmaxb
160  dim2_s = jsb
161  transpose = .false.
162  case ( 'ZX' )
163  dim1_size = ka
164  dim1_max = kmax
165  dim1_s = ks
166  dim2_size = ia
167  dim2_max = imaxb
168  dim2_s = isb
169  transpose = .false.
170  case ( 'XZ' )
171  dim1_size = ia
172  dim1_max = imaxb
173  dim1_s = isb
174  dim2_size = ka
175  dim2_max = kmax
176  dim2_s = ks
177  transpose = .true.
178  case default
179  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims2D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
180  call prc_abort
181  end select
182 
183  return
184  end subroutine file_external_input_cartesc_get_dims2d
185 
186  subroutine file_external_input_cartesc_get_dims3d( &
187  dim1_size, &
188  dim1_max, &
189  dim1_S, &
190  dim2_size, &
191  dim2_max, &
192  dim2_S, &
193  dim3_size, &
194  dim3_max, &
195  dim3_S, &
196  transpose, &
197  varname, &
198  axistype )
199  use scale_prc, only: &
200  prc_abort
201  implicit none
202  integer, intent(out) :: dim1_size
203  integer, intent(out) :: dim1_max
204  integer, intent(out) :: dim1_s
205  integer, intent(out) :: dim2_size
206  integer, intent(out) :: dim2_max
207  integer, intent(out) :: dim2_s
208  integer, intent(out) :: dim3_size
209  integer, intent(out) :: dim3_max
210  integer, intent(out) :: dim3_s
211  logical, intent(out) :: transpose
212  character(len=*), intent(in) :: varname
213  character(len=*), intent(in) :: axistype ! axis type (ZXY/XYZ/LXY/XYL/UXY/XYU)
214 
215  select case ( axistype )
216  case ( 'ZXY' )
217  dim1_size = ka
218  dim1_max = kmax
219  dim1_s = ks
220  dim2_size = ia
221  dim2_max = imaxb
222  dim2_s = isb
223  dim3_size = ja
224  dim3_max = jmaxb
225  dim3_s = jsb
226  transpose = .false.
227  case ( 'XYZ' )
228  dim1_size = ia
229  dim1_max = imaxb
230  dim1_s = isb
231  dim2_size = ja
232  dim2_max = jmaxb
233  dim2_s = jsb
234  dim3_size = ka
235  dim3_max = kmax
236  dim3_s = ks
237  transpose = .true.
238  case ( 'OXY' ) ! OCEAN
239  dim1_size = oka
240  dim1_max = okmax
241  dim1_s = oks
242  dim2_size = ia
243  dim2_max = imaxb
244  dim2_s = isb
245  dim3_size = ja
246  dim3_max = jmaxb
247  dim3_s = jsb
248  transpose = .false.
249  case ( 'XYO' ) ! OCEAN
250  dim1_size = ia
251  dim1_max = imaxb
252  dim1_s = isb
253  dim2_size = ja
254  dim2_max = jmaxb
255  dim2_s = jsb
256  dim3_size = oka
257  dim3_max = okmax
258  dim3_s = oks
259  transpose = .true.
260  case ( 'LXY' ) ! LAND
261  dim1_size = lka
262  dim1_max = lkmax
263  dim1_s = lks
264  dim2_size = ia
265  dim2_max = imaxb
266  dim2_s = isb
267  dim3_size = ja
268  dim3_max = jmaxb
269  dim3_s = jsb
270  transpose = .false.
271  case ( 'XYL' ) ! LAND
272  dim1_size = ia
273  dim1_max = imaxb
274  dim1_s = isb
275  dim2_size = ja
276  dim2_max = jmaxb
277  dim2_s = jsb
278  dim3_size = lka
279  dim3_max = lkmax
280  dim3_s = lks
281  transpose = .true.
282  case ( 'UXY' )
283  dim1_size = uka
284  dim1_max = ukmax
285  dim1_s = uks
286  dim2_size = ia
287  dim2_max = imaxb
288  dim2_s = isb
289  dim3_size = ja
290  dim3_max = jmaxb
291  dim3_s = jsb
292  transpose = .false.
293  case ( 'XYU' )
294  dim1_size = ia
295  dim1_max = imaxb
296  dim1_s = isb
297  dim2_size = ja
298  dim2_max = jmaxb
299  dim2_s = jsb
300  dim3_size = uka
301  dim3_max = ukmax
302  dim3_s = uks
303  transpose = .true.
304  case default
305  log_error("FILE_EXTERNAL_INPUT_CARTESC_get_dims3D",*) 'unsupported axis type. Check! axistype:', trim(axistype), ', item:',trim(varname)
306  call prc_abort
307  end select
308 
309  return
310  end subroutine file_external_input_cartesc_get_dims3d
311 
312 
314  fid, varname, &
315  dim_type, &
316  var, &
317  step )
318  use scale_file_cartesc, only: &
319  file_cartesc_read, &
321  implicit none
322  integer, intent(in) :: fid
323  character(len=*), intent(in) :: varname
324  character(len=*), intent(in) :: dim_type
325  real(RP), intent(out) :: var(:)
326  integer, intent(in), optional :: step
327 
328  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
329  var(:), & ! [OUT]
330  step = step ) ! [IN]
331 
332  call file_cartesc_flush( fid )
333 
334  return
336 
338  fid, varname, &
339  dim_type, &
340  var, &
341  step )
342  use scale_file_cartesc, only: &
343  file_cartesc_read, &
345  implicit none
346  integer, intent(in) :: fid
347  character(len=*), intent(in) :: varname
348  character(len=*), intent(in) :: dim_type
349  real(RP), intent(out) :: var(:,:)
350  integer, intent(in), optional :: step
351 
352  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
353  var(:,:), & ! [OUT]
354  step = step ) ! [IN]
355 
356  call file_cartesc_flush( fid )
357 
358  return
360 
362  fid, varname, &
363  dim_type, &
364  var, &
365  step )
366  use scale_file_cartesc, only: &
367  file_cartesc_read, &
369  implicit none
370  integer, intent(in) :: fid
371  character(len=*), intent(in) :: varname
372  character(len=*), intent(in) :: dim_type
373  real(RP), intent(out) :: var(:,:,:)
374  integer, intent(in), optional :: step
375 
376  call file_cartesc_read( fid, varname, dim_type, & ! [IN]
377  var(:,:,:), & ! [OUT]
378  step = step ) ! [IN]
379 
380  call file_cartesc_flush( fid )
381 
382  return
384 
scale_atmos_grid_cartesc_index::isb
integer, public isb
Definition: scale_atmos_grid_cartesC_index.F90:64
scale_file_external_input::file_external_input_read_3d
procedure(read3d), pointer, public file_external_input_read_3d
Definition: scale_file_external_input.F90:166
scale_prc::prc_abort
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:350
scale_atmos_grid_cartesc_index::jmaxb
integer, public jmaxb
Definition: scale_atmos_grid_cartesC_index.F90:63
scale_precision
module PRECISION
Definition: scale_precision.F90:14
scale_atmos_grid_cartesc_index::ka
integer, public ka
Definition: scale_atmos_grid_cartesC_index.F90:47
scale_file_external_input::file_external_input_finalize
subroutine, public file_external_input_finalize
finalize
Definition: scale_file_external_input.F90:335
scale_land_grid_cartesc_index::lkmax
integer, public lkmax
Definition: scale_land_grid_cartesC_index.F90:32
scale_file_external_input_cartesc
module file / external_input_cartesC
Definition: scale_file_external_input_cartesC.F90:12
scale_ocean_grid_cartesc_index::oka
integer, public oka
Definition: scale_ocean_grid_cartesC_index.F90:37
scale_file_external_input::file_external_input_setup
subroutine, public file_external_input_setup
Setup.
Definition: scale_file_external_input.F90:236
scale_ocean_grid_cartesc_index::okmax
integer, public okmax
Definition: scale_ocean_grid_cartesC_index.F90:32
scale_file_external_input::file_external_input_get_dims3d
procedure(get_dims3d), pointer, public file_external_input_get_dims3d
Definition: scale_file_external_input.F90:159
scale_file_external_input_cartesc::file_external_input_cartesc_finalize
subroutine, public file_external_input_cartesc_finalize
Finalize.
Definition: scale_file_external_input_cartesC.F90:80
scale_urban_grid_cartesc_index
module urban / grid / icosahedralA / index
Definition: scale_urban_grid_cartesC_index.F90:11
scale_land_grid_cartesc_index
module land / grid / cartesianC / index
Definition: scale_land_grid_cartesC_index.F90:11
scale_urban_grid_cartesc_index::ukmax
integer, public ukmax
Definition: scale_urban_grid_cartesC_index.F90:32
scale_file_external_input_cartesc::file_external_input_cartesc_read_3d
subroutine file_external_input_cartesc_read_3d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:366
scale_prc
module PROCESS
Definition: scale_prc.F90:11
scale_file_external_input_cartesc::file_external_input_cartesc_setup
subroutine, public file_external_input_cartesc_setup
Setup.
Definition: scale_file_external_input_cartesC.F90:55
scale_io
module STDIO
Definition: scale_io.F90:10
scale_atmos_grid_cartesc_index
module atmosphere / grid / cartesC index
Definition: scale_atmos_grid_cartesC_index.F90:12
scale_atmos_grid_cartesc_index::ia
integer, public ia
Definition: scale_atmos_grid_cartesC_index.F90:48
scale_atmos_grid_cartesc_index::kmax
integer, public kmax
Definition: scale_atmos_grid_cartesC_index.F90:36
scale_file_external_input::file_external_input_read_2d
procedure(read2d), pointer, public file_external_input_read_2d
Definition: scale_file_external_input.F90:165
scale_prof
module profiler
Definition: scale_prof.F90:11
scale_ocean_grid_cartesc_index
module ocean / grid / cartesianC / index
Definition: scale_ocean_grid_cartesC_index.F90:11
scale_atmos_grid_cartesc_index::ja
integer, public ja
Definition: scale_atmos_grid_cartesC_index.F90:49
scale_file_external_input::file_external_input_get_dims2d
procedure(get_dims2d), pointer, public file_external_input_get_dims2d
Definition: scale_file_external_input.F90:158
scale_file_external_input::file_external_input_read_1d
procedure(read1d), pointer, public file_external_input_read_1d
Definition: scale_file_external_input.F90:164
scale_urban_grid_cartesc_index::uks
integer, public uks
Definition: scale_urban_grid_cartesC_index.F90:38
scale_atmos_grid_cartesc_index::ks
integer, public ks
start point of inner domain: z, local
Definition: scale_atmos_grid_cartesC_index.F90:51
scale_atmos_grid_cartesc_index::imaxb
integer, public imaxb
Definition: scale_atmos_grid_cartesC_index.F90:62
scale_file_cartesc::file_cartesc_flush
subroutine, public file_cartesc_flush(fid)
Flush all pending requests to a netCDF file (PnetCDF only)
Definition: scale_file_cartesC.F90:1018
scale_urban_grid_cartesc_index::uka
integer, public uka
Definition: scale_urban_grid_cartesC_index.F90:37
scale_file_external_input_cartesc::file_external_input_cartesc_read_2d
subroutine file_external_input_cartesc_read_2d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:342
scale_file_external_input
module file / external_input
Definition: scale_file_external_input.F90:12
scale_atmos_grid_cartesc_index::jsb
integer, public jsb
Definition: scale_atmos_grid_cartesC_index.F90:66
scale_file_external_input_cartesc::file_external_input_cartesc_read_1d
subroutine file_external_input_cartesc_read_1d(fid, varname, dim_type, var, step)
Definition: scale_file_external_input_cartesC.F90:318
scale_file_external_input::file_external_input_get_dims1d
procedure(get_dims1d), pointer, public file_external_input_get_dims1d
Definition: scale_file_external_input.F90:157
scale_land_grid_cartesc_index::lks
integer, public lks
Definition: scale_land_grid_cartesC_index.F90:38
scale_file_cartesc
module file / cartesianC
Definition: scale_file_cartesC.F90:11
scale_land_grid_cartesc_index::lka
integer, public lka
Definition: scale_land_grid_cartesC_index.F90:37
scale_ocean_grid_cartesc_index::oks
integer, public oks
Definition: scale_ocean_grid_cartesC_index.F90:38