SCALE-RM
scale_mapprojection.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
20  !-----------------------------------------------------------------------------
21  implicit none
22  private
23  !-----------------------------------------------------------------------------
24  !
25  !++ Public procedure
26  !
27  public :: mapprojection_setup
28  public :: mapprojection_xy2lonlat
29  public :: mapprojection_lonlat2xy
30  public :: mapprojection_mapfactor
31  public :: mapprojection_rotcoef
33 
34  interface mapprojection_xy2lonlat
35  module procedure mapprojection_xy2lonlat_0d
36  module procedure mapprojection_xy2lonlat_2d
37  end interface
38  interface mapprojection_lonlat2xy
39  module procedure mapprojection_lonlat2xy_0d
40  module procedure mapprojection_lonlat2xy_2d
41  end interface
42  !-----------------------------------------------------------------------------
43  !
44  !++ Public parameters & variables
45  !
46  real(RP), public :: mapprojection_basepoint_lon = 135.221_rp ! position of base point (domain center) in real world [deg]
47  real(RP), public :: mapprojection_basepoint_lat = 34.653_rp ! position of base point (domain center) in real world [deg]
48 
49  !-----------------------------------------------------------------------------
50  !
51  !++ Private procedure
52  !
53  private :: mapprojection_none_setup
54  private :: mapprojection_lambertconformal_setup
55  private :: mapprojection_polarstereographic_setup
56  private :: mapprojection_mercator_setup
57  private :: mapprojection_equidistantcylindrical_setup
58 
59  private :: mapprojection_none_xy2lonlat
60  private :: mapprojection_lambertconformal_xy2lonlat
61  private :: mapprojection_polarstereographic_xy2lonlat
62  private :: mapprojection_mercator_xy2lonlat
63  private :: mapprojection_equidistantcylindrical_xy2lonlat
64 
65  private :: mapprojection_none_lonlat2xy
66  private :: mapprojection_lambertconformal_lonlat2xy
67  private :: mapprojection_polarstereographic_lonlat2xy
68  private :: mapprojection_mercator_lonlat2xy
69  private :: mapprojection_equidistantcylindrical_lonlat2xy
70 
71  private :: mapprojection_none_mapfactor
72  private :: mapprojection_lambertconformal_mapfactor
73  private :: mapprojection_polarstereographic_mapfactor
74  private :: mapprojection_mercator_mapfactor
75  private :: mapprojection_equidistantcylindrical_mapfactor
76 
77  private :: mapprojection_none_rotcoef
78  private :: mapprojection_lambertconformal_rotcoef
79  private :: mapprojection_polarstereographic_rotcoef
80  private :: mapprojection_mercator_rotcoef
81  private :: mapprojection_equidistantcylindrical_rotcoef
82 
83  !-----------------------------------------------------------------------------
84  !
85  !++ Private parameters & variables
86  !
87  character(len=H_SHORT), private :: mapprojection_type = 'NONE'
88  ! 'NONE'
89  ! 'LC'
90  ! 'PS'
91  ! 'MER'
92  ! 'EC'
93 
94  real(DP), private :: mapprojection_hemisphere ! hemisphere flag: 1=north, -1=south
95 
96  real(DP), private :: mapprojection_basepoint_x ! position of base point in the model [m]
97  real(DP), private :: mapprojection_basepoint_y ! position of base point in the model [m]
98 
99  real(DP), private :: mapprojection_pole_x ! position of north/south pole in the model [m]
100  real(DP), private :: mapprojection_pole_y ! position of north/south pole in the model [m]
101  real(DP), private :: mapprojection_eq_x ! position of equator at the base lon. in the model [m]
102  real(DP), private :: mapprojection_eq_y ! position of equator at the base lon. in the model [m]
103 
104  real(DP), private :: mapprojection_rotation = 0.0_dp ! rotation factor
105  real(DP), private :: mapprojection_rot_fact_sin
106  real(DP), private :: mapprojection_rot_fact_cos
107 
108  real(DP), private :: mapprojection_lc_lat1 = 30.0_dp ! standard latitude1 for L.C. projection [deg]
109  real(DP), private :: mapprojection_lc_lat2 = 60.0_dp ! standard latitude2 for L.C. projection [deg]
110  real(DP), private :: mapprojection_lc_c ! conformal factor
111  real(DP), private :: mapprojection_lc_fact ! pre-calc factor
112 
113  real(DP), private :: mapprojection_ps_lat ! standard latitude1 for P.S. projection [deg]
114  real(DP), private :: mapprojection_ps_fact ! pre-calc factor
115 
116  real(DP), private :: mapprojection_m_lat = 0.0_dp ! standard latitude1 for Mer. projection [deg]
117  real(DP), private :: mapprojection_m_fact ! pre-calc factor
118 
119  real(DP), private :: mapprojection_ec_lat = 0.0_dp ! standard latitude1 for E.C. projection [deg]
120  real(DP), private :: mapprojection_ec_fact ! pre-calc factor
121 
122  real(DP), private :: pi
123  real(DP), private :: d2r
124  real(DP), private :: radius
125 
126  character(len=H_SHORT) :: mapprojection_mapping = ""
127  real(DP), private :: mapprojection_false_easting
128  real(DP), private :: mapprojection_false_northing
129  real(DP), private :: mapprojection_longitude_of_central_meridian
130  real(DP), private :: mapprojection_longitude_of_projection_origin
131  real(DP), private :: mapprojection_latitude_of_projection_origin
132  real(DP), private :: mapprojection_straight_vertical_longitude_from_pole
133  real(DP), private :: mapprojection_standard_parallel(2)
134 
135  interface
136  subroutine xy2lonlat_s( x, y, lon, lat )
137  use scale_precision
138  real(DP), intent(in) :: x, y
139  real(RP), intent(out) :: lon, lat
140  end subroutine xy2lonlat_s
141  subroutine lonlat2xy_s( lon, lat, x, y )
142  use scale_precision
143  real(RP), intent(in) :: lon, lat
144  real(DP), intent(out) :: x, y
145  end subroutine lonlat2xy_s
146  subroutine mapfactor_s( lat, m1, m2 )
147  use scale_precision
148  real(RP), intent(in) :: lat
149  real(RP), intent(out) :: m1, m2
150  end subroutine mapfactor_s
151  subroutine rotcoef_s( lon, lat, rotc_cos, rotc_sin )
152  use scale_precision
153  real(RP), intent(in) :: lon, lat
154  real(RP), intent(out) :: rotc_cos, rotc_sin
155  end subroutine rotcoef_s
156  end interface
157  procedure(xy2lonlat_s), pointer :: xy2lonlat => null()
158  procedure(lonlat2xy_s), pointer :: lonlat2xy => null()
159  procedure(mapfactor_s), pointer :: mapfactor => null()
160  procedure(rotcoef_s), pointer :: rotcoef => null()
161 
162  !-----------------------------------------------------------------------------
163 contains
164  !-----------------------------------------------------------------------------
166  subroutine mapprojection_setup( DOMAIN_CENTER_X, DOMAIN_CENTER_Y )
167  use scale_prc, only: &
168  prc_abort
169  use scale_const, only: &
170  undef => const_undef, &
171  pi_rp => const_pi, &
172  d2r_rp => const_d2r, &
173  radius_rp => const_radius
174  implicit none
175 
176  real(RP), intent(in) :: DOMAIN_CENTER_X
177  real(RP), intent(in) :: DOMAIN_CENTER_Y
178 
179  namelist / param_mapprojection / &
182  mapprojection_basepoint_x, &
183  mapprojection_basepoint_y, &
184  mapprojection_type, &
185  mapprojection_rotation, &
186  mapprojection_lc_lat1, &
187  mapprojection_lc_lat2, &
188  mapprojection_ps_lat, &
189  mapprojection_m_lat, &
190  mapprojection_ec_lat
191 
192  integer :: ierr
193  !---------------------------------------------------------------------------
194 
195  log_newline
196  log_info("MAPPROJECTION_setup",*) 'Setup'
197 
198  pi = real(pi_rp, kind=dp)
199  d2r = real(d2r_rp, kind=dp)
200  radius = real(radius_rp, kind=dp)
201 
202  mapprojection_basepoint_x = undef
203  mapprojection_basepoint_y = undef
204  mapprojection_ps_lat = undef
205 
206  mapprojection_basepoint_x = domain_center_x
207  mapprojection_basepoint_y = domain_center_y
208 
209  !--- read namelist
210  rewind(io_fid_conf)
211  read(io_fid_conf,nml=param_mapprojection,iostat=ierr)
212 
213  if( ierr < 0 ) then !--- missing
214  log_info("MAPPROJECTION_setup",*) 'Not found namelist. Default used.'
215  elseif( ierr > 0 ) then !--- fatal error
216  log_error("MAPPROJECTION_setup",*) 'Not appropriate names in namelist PARAM_MAPPROJECTION. Check!'
217  call prc_abort
218  endif
219  log_nml(param_mapprojection)
220 
221  log_newline
222  log_info("MAPPROJECTION_setup",*) 'Map projection information'
223  log_info_cont('(1x,A,F15.3)') 'Basepoint(x) [m] : ', mapprojection_basepoint_x
224  log_info_cont('(1x,A,F15.3)') 'Basepoint(y) [m] : ', mapprojection_basepoint_y
225  log_info_cont(*) 'Map projection type : ', trim(mapprojection_type)
226 
227  mapprojection_mapping = ""
228  mapprojection_false_easting = undef
229  mapprojection_false_northing = undef
230  mapprojection_longitude_of_central_meridian = undef
231  mapprojection_longitude_of_projection_origin = undef
232  mapprojection_latitude_of_projection_origin = undef
233  mapprojection_straight_vertical_longitude_from_pole = undef
234  mapprojection_standard_parallel(:) = undef
235 
236  if( mapprojection_ps_lat == undef ) mapprojection_ps_lat = mapprojection_basepoint_lat
237 
238  select case(trim(mapprojection_type))
239  case('NONE')
240  log_info_cont(*) '=> NO map projection'
241  call mapprojection_none_setup
242  xy2lonlat => mapprojection_none_xy2lonlat
243  lonlat2xy => mapprojection_none_lonlat2xy
244  mapfactor => mapprojection_none_mapfactor
245  rotcoef => mapprojection_none_rotcoef
246  case('LC')
247  log_info_cont(*) '=> Lambert Conformal projection'
248  call mapprojection_lambertconformal_setup
249  xy2lonlat => mapprojection_lambertconformal_xy2lonlat
250  lonlat2xy => mapprojection_lambertconformal_lonlat2xy
251  mapfactor => mapprojection_lambertconformal_mapfactor
252  rotcoef => mapprojection_lambertconformal_rotcoef
253  case('PS')
254  log_info_cont(*) '=> Polar Stereographic projection'
255  call mapprojection_polarstereographic_setup
256  xy2lonlat => mapprojection_polarstereographic_xy2lonlat
257  lonlat2xy => mapprojection_polarstereographic_lonlat2xy
258  mapfactor => mapprojection_polarstereographic_mapfactor
259  rotcoef => mapprojection_polarstereographic_rotcoef
260  case('MER')
261  log_info_cont(*) '=> Mercator projection'
262  call mapprojection_mercator_setup
263  xy2lonlat => mapprojection_mercator_xy2lonlat
264  lonlat2xy => mapprojection_mercator_lonlat2xy
265  mapfactor => mapprojection_mercator_mapfactor
266  rotcoef => mapprojection_mercator_rotcoef
267  case('EC')
268  log_info_cont(*) '=> Equidistant Cylindrical projection'
269  call mapprojection_equidistantcylindrical_setup
270  xy2lonlat => mapprojection_equidistantcylindrical_xy2lonlat
271  lonlat2xy => mapprojection_equidistantcylindrical_lonlat2xy
272  mapfactor => mapprojection_equidistantcylindrical_mapfactor
273  rotcoef => mapprojection_equidistantcylindrical_rotcoef
274  case default
275  log_error("MAPPROJECTION_setup",*) 'Unsupported MAPPROJECTION_type. STOP'
276  call prc_abort
277  endselect
278 
279  mapprojection_rotation = mapprojection_rotation * d2r
280  mapprojection_rot_fact_sin = sin(mapprojection_rotation)
281  mapprojection_rot_fact_cos = cos(mapprojection_rotation)
282 
283  return
284  end subroutine mapprojection_setup
285 
286  !-----------------------------------------------------------------------------
288  subroutine mapprojection_xy2lonlat_0d( &
289  x, y, &
290  lon, lat )
291  implicit none
292  real(RP), intent(in) :: x
293  real(RP), intent(in) :: y
294  real(RP), intent(out) :: lon ! [rad]
295  real(RP), intent(out) :: lat ! [rad]
296 
297  real(DP) :: xx, yy
298  !---------------------------------------------------------------------------
299 
300  xx = mapprojection_basepoint_x &
301  + ( x - mapprojection_basepoint_x ) * mapprojection_rot_fact_cos &
302  - ( y - mapprojection_basepoint_y ) * mapprojection_rot_fact_sin
303  yy = mapprojection_basepoint_y &
304  + ( y - mapprojection_basepoint_y ) * mapprojection_rot_fact_cos &
305  + ( x - mapprojection_basepoint_x ) * mapprojection_rot_fact_sin
306 
307  call xy2lonlat( xx, yy, lon, lat )
308 
309  return
310  end subroutine mapprojection_xy2lonlat_0d
311 
312  subroutine mapprojection_xy2lonlat_2d( &
313  IA, IS, IE, JA, JS, JE, &
314  x, y, &
315  lon, lat )
316  implicit none
317  integer, intent(in) :: IA, IS, IE
318  integer, intent(in) :: JA, JS, JE
319 
320  real(RP), intent(in) :: x(ia,ja)
321  real(RP), intent(in) :: y(ia,ja)
322  real(RP), intent(out) :: lon(ia,ja) ! [rad]
323  real(RP), intent(out) :: lat(ia,ja) ! [rad]
324 
325  integer :: i, j
326  !---------------------------------------------------------------------------
327 
328  !$omp parallel do
329  do j = js, je
330  do i = is, ie
331  call mapprojection_xy2lonlat_0d( x(i,j), y(i,j), lon(i,j), lat(i,j) )
332  end do
333  end do
334 
335  return
336  end subroutine mapprojection_xy2lonlat_2d
337 
338  !-----------------------------------------------------------------------------
340  subroutine mapprojection_lonlat2xy_0d( &
341  lon, lat, &
342  x, y )
343  implicit none
344  real(RP), intent(in) :: lon ! [rad]
345  real(RP), intent(in) :: lat ! [rad]
346  real(RP), intent(out) :: x
347  real(RP), intent(out) :: y
348 
349  real(DP) :: xx, yy
350  !---------------------------------------------------------------------------
351 
352  call lonlat2xy( lon, lat, xx, yy )
353 
354  xx = xx - mapprojection_basepoint_x
355  yy = yy - mapprojection_basepoint_y
356 
357  x = mapprojection_basepoint_x + ( xx * mapprojection_rot_fact_cos &
358  + yy * mapprojection_rot_fact_sin )
359  y = mapprojection_basepoint_y + ( yy * mapprojection_rot_fact_cos &
360  - xx * mapprojection_rot_fact_sin )
361 
362  return
363  end subroutine mapprojection_lonlat2xy_0d
364 
365  subroutine mapprojection_lonlat2xy_2d( &
366  IA, IS, IE, JA, JS, JE, &
367  lon, lat, &
368  x, y )
369  implicit none
370  integer, intent(in) :: IA, IS, IE
371  integer, intent(in) :: JA, JS, JE
372 
373  real(RP), intent(in) :: lon(ia,ja) ! [rad]
374  real(RP), intent(in) :: lat(ia,ja) ! [rad]
375  real(RP), intent(out) :: x(ia,ja)
376  real(RP), intent(out) :: y(ia,ja)
377 
378  integer :: i, j
379  !---------------------------------------------------------------------------
380 
381  !$omp parallel do
382  do j = js, je
383  do i = is, ie
384  call mapprojection_lonlat2xy_0d( lon(i,j), lat(i,j), x(i,j), y(i,j) )
385  end do
386  end do
387 
388  return
389  end subroutine mapprojection_lonlat2xy_2d
390 
391  !-----------------------------------------------------------------------------
393  subroutine mapprojection_mapfactor( &
394  IA, IS, IE, JA, JS, JE, &
395  lat, &
396  m1, m2 )
397  implicit none
398  integer, intent(in) :: IA, IS, IE
399  integer, intent(in) :: JA, JS, JE
400 
401  real(RP), intent(in) :: lat(ia,ja) ! [rad]
402  real(RP), intent(out) :: m1 (ia,ja)
403  real(RP), intent(out) :: m2 (ia,ja)
404 
405  !real(RP) :: mm1, mm2
406  integer :: i, j
407  !---------------------------------------------------------------------------
408 
409  !$omp parallel do
410  do j = js, je
411  do i = is, ie
412  call mapfactor( lat(i,j), m1(i,j), m2(i,j) )
413 !!$ call mapfactor( lat(i,j), mm1, mm2 )
414 !!$ m1(i,j) = sqrt( (MAPPROJECTION_rot_fact_cos * mm1)**2 + (MAPPROJECTION_rot_fact_sin * mm2)**2 )
415 !!$ m2(i,j) = sqrt( (MAPPROJECTION_rot_fact_cos * mm2)**2 + (MAPPROJECTION_rot_fact_sin * mm1)**2 )
416  end do
417  end do
418 
419  return
420  end subroutine mapprojection_mapfactor
421 
422  !-----------------------------------------------------------------------------
425  subroutine mapprojection_rotcoef( &
426  IA, IS, IE, JA, JS, JE, &
427  lon, lat, &
428  rotc )
429  implicit none
430  integer, intent(in) :: IA, IS, IE
431  integer, intent(in) :: JA, JS, JE
432 
433  real(RP), intent(in) :: lon(ia,ja) ! [rad]
434  real(RP), intent(in) :: lat(ia,ja) ! [rad]
435  real(RP), intent(out) :: rotc(ia,ja,2)
436 
437  integer :: i, j
438  !---------------------------------------------------------------------------
439 
440  !$omp parallel do
441  do j = js, je
442  do i = is, ie
443  call rotcoef( lon(i,j), lat(i,j), rotc(i,j,1), rotc(i,j,2) )
444  end do
445  end do
446 
447  return
448  end subroutine mapprojection_rotcoef
449 
450  !-----------------------------------------------------------------------------
452  subroutine mapprojection_get_attributes( &
453  mapping, &
454  false_easting, &
455  false_northing, &
456  longitude_of_central_meridian, &
457  longitude_of_projection_origin, &
458  latitude_of_projection_origin, &
459  straight_vertical_longitude_from_pole, &
460  standard_parallel )
461  implicit none
462 
463  character(len=*), intent(out) :: mapping
464 
465  real(DP), intent(out), optional :: false_easting
466  real(DP), intent(out), optional :: false_northing
467  real(DP), intent(out), optional :: longitude_of_central_meridian
468  real(DP), intent(out), optional :: longitude_of_projection_origin
469  real(DP), intent(out), optional :: latitude_of_projection_origin
470  real(DP), intent(out), optional :: straight_vertical_longitude_from_pole
471  real(DP), intent(out), optional :: standard_parallel(2)
472  !---------------------------------------------------------------------------
473 
474  mapping = mapprojection_mapping
475 
476  if ( present(false_easting) ) &
477  false_easting = mapprojection_false_easting
478  if ( present(false_northing) ) &
479  false_northing = mapprojection_false_northing
480  if ( present(longitude_of_central_meridian) ) &
481  longitude_of_central_meridian = mapprojection_longitude_of_central_meridian
482  if ( present(longitude_of_projection_origin) ) &
483  longitude_of_projection_origin = mapprojection_longitude_of_projection_origin
484  if ( present(latitude_of_projection_origin) ) &
485  latitude_of_projection_origin = mapprojection_latitude_of_projection_origin
486  if ( present(straight_vertical_longitude_from_pole) ) &
487  straight_vertical_longitude_from_pole = mapprojection_straight_vertical_longitude_from_pole
488  if ( present(standard_parallel) ) &
489  standard_parallel(:) = mapprojection_standard_parallel(:)
490 
491  return
492  end subroutine mapprojection_get_attributes
493 
494  !-----------------------------------------------------------------------------
496  subroutine mapprojection_none_setup
497  implicit none
498  !---------------------------------------------------------------------------
499 
500  log_newline
501  log_info("MAPPROJECTION_None_setup",*) 'MAPPROJECTION_rotation = ', mapprojection_rotation
502 
503  mapprojection_mapping = ""
504 
505  return
506  end subroutine mapprojection_none_setup
507 
508  !-----------------------------------------------------------------------------
510  subroutine mapprojection_none_xy2lonlat( &
511  x, &
512  y, &
513  lon, &
514  lat )
515  implicit none
516 
517  real(DP), intent(in) :: x
518  real(DP), intent(in) :: y
519  real(RP), intent(out) :: lon ! [rad]
520  real(RP), intent(out) :: lat ! [rad]
521 
522  real(DP) :: gno(2)
523  real(DP) :: rho, gmm
524  !---------------------------------------------------------------------------
525 
526  gno(1) = ( x - mapprojection_basepoint_x ) / radius
527  gno(2) = ( y - mapprojection_basepoint_y ) / radius
528 
529  rho = sqrt( gno(1) * gno(1) + gno(2) * gno(2) )
530  gmm = atan( rho )
531 
532  if ( rho == 0.0_dp ) then
533  lon = mapprojection_basepoint_lon * d2r
534  lat = mapprojection_basepoint_lat * d2r
535  else
536  lon = mapprojection_basepoint_lon * d2r &
537  + atan( gno(1)*sin(gmm) / ( rho *cos(mapprojection_basepoint_lat*d2r)*cos(gmm) &
538  - gno(2)*sin(mapprojection_basepoint_lat*d2r)*sin(gmm) ) )
539  lat = asin( sin(mapprojection_basepoint_lat*d2r)*cos(gmm) &
540  + gno(2)*cos(mapprojection_basepoint_lat*d2r)*sin(gmm) / rho )
541  endif
542 
543  return
544  end subroutine mapprojection_none_xy2lonlat
545 
546  !-----------------------------------------------------------------------------
548  subroutine mapprojection_none_lonlat2xy( &
549  lon, &
550  lat, &
551  x, &
552  y )
553  use scale_prc, only: &
554  prc_abort
555  implicit none
556 
557  real(RP), intent(in) :: lon ! [rad]
558  real(RP), intent(in) :: lat ! [rad]
559  real(DP), intent(out) :: x
560  real(DP), intent(out) :: y
561 
562  real(DP) :: lat_d, lat0_d, dlon
563  real(DP) :: gno(2)
564  real(DP) :: cos_gmm
565  !---------------------------------------------------------------------------
566  ! http://mathworld.wolfram.com/GnomonicProjection.html
567 
568  lat_d = real(lat,kind=dp)
569  lat0_d = real(mapprojection_basepoint_lat*d2r,kind=dp)
570 
571  dlon = lon - mapprojection_basepoint_lon * d2r
572 
573  cos_gmm = sin(lat0_d) * sin(lat_d) &
574  + cos(lat0_d) * cos(lat_d) * cos(dlon)
575 
576  gno(1) = ( cos(lat_d) * sin(dlon) ) / cos_gmm
577  gno(2) = ( cos(lat0_d) * sin(lat_d) &
578  - sin(lat0_d) * cos(lat_d) * cos(dlon) ) / cos_gmm
579 
580  x = gno(1) * radius + mapprojection_basepoint_x
581  y = gno(2) * radius + mapprojection_basepoint_y
582 
583  return
584  end subroutine mapprojection_none_lonlat2xy
585 
586  !-----------------------------------------------------------------------------
588  subroutine mapprojection_none_mapfactor( &
589  lat, &
590  m1, m2 )
591  implicit none
592 
593  real(RP), intent(in) :: lat ! [rad]
594  real(RP), intent(out) :: m1
595  real(RP), intent(out) :: m2
596  !---------------------------------------------------------------------------
597 
598  m1 = 1.0_rp
599  m2 = m1
600 
601  return
602  end subroutine mapprojection_none_mapfactor
603 
604  !-----------------------------------------------------------------------------
606  subroutine mapprojection_none_rotcoef( &
607  lon, lat, &
608  rotc_cos, rotc_sin )
609  implicit none
610  real(RP), intent(in) :: lon, lat
611  real(RP), intent(out) :: rotc_cos, rotc_sin
612  !---------------------------------------------------------------------------
613 
614  rotc_cos = mapprojection_rot_fact_cos
615  rotc_sin = mapprojection_rot_fact_sin
616 
617  return
618  end subroutine mapprojection_none_rotcoef
619 
620  !-----------------------------------------------------------------------------
622  subroutine mapprojection_lambertconformal_setup
623  use scale_prc, only: &
624  prc_abort
625  implicit none
626 
627  real(DP) :: lat1rot, lat2rot
628  real(DP) :: dlon, latrot, dist
629  !---------------------------------------------------------------------------
630 
631  if ( mapprojection_lc_lat1 >= mapprojection_lc_lat2 ) then
632  log_error("MAPPROJECTION_LambertConformal_setup",*) 'Please set MAPPROJECTION_LC_lat1 < MAPPROJECTION_LC_lat2 in degree. STOP'
633  call prc_abort
634  endif
635 
636  ! check hemisphere: 1=north, -1=south
637  mapprojection_hemisphere = sign(1.0_dp,mapprojection_lc_lat1+mapprojection_lc_lat2)
638 
639  lat1rot = 0.5_dp*pi - mapprojection_hemisphere * mapprojection_lc_lat1 * d2r
640  lat2rot = 0.5_dp*pi - mapprojection_hemisphere * mapprojection_lc_lat2 * d2r
641 
642  ! calc conformal factor c
643  mapprojection_lc_c = ( log( sin(lat1rot) ) - log( sin(lat2rot) ) ) &
644  / ( log( tan(0.5_dp*lat1rot) ) - log( tan(0.5_dp*lat2rot) ) )
645 
646  ! pre-calc factor
647  mapprojection_lc_fact = sin(lat1rot) / mapprojection_lc_c / tan(0.5_dp*lat1rot)**mapprojection_lc_c
648 
649  ! calc (x,y) at pole point
650  dlon = 0.0_dp
651 
652  latrot = 0.5_dp*pi - mapprojection_hemisphere * mapprojection_basepoint_lat * d2r
653 
654  dist = mapprojection_lc_fact * radius * tan(0.5_dp*latrot)**mapprojection_lc_c
655 
656  mapprojection_pole_x = mapprojection_basepoint_x - dist * sin(mapprojection_lc_c*dlon)
657  mapprojection_pole_y = mapprojection_basepoint_y + mapprojection_hemisphere * dist * cos(mapprojection_lc_c*dlon)
658 
659  log_newline
660  log_info("MAPPROJECTION_LambertConformal_setup",*) 'Input parameters'
661  log_info_cont(*) 'MAPPROJECTION_LC_lat1 = ', mapprojection_lc_lat1
662  log_info_cont(*) 'MAPPROJECTION_LC_lat2 = ', mapprojection_lc_lat2
663  log_info_cont(*) 'MAPPROJECTION_hemisphere = ', mapprojection_hemisphere
664  log_info_cont(*) 'MAPPROJECTION_LC_c = ', mapprojection_lc_c
665  log_info_cont(*) 'MAPPROJECTION_LC_fact = ', mapprojection_lc_fact
666  log_info_cont(*) 'MAPPROJECTION_pole_x = ', mapprojection_pole_x
667  log_info_cont(*) 'MAPPROJECTION_pole_y = ', mapprojection_pole_y
668  log_info_cont(*) 'MAPPROJECTION_pole_y = ', mapprojection_pole_y
669  log_info_cont(*) 'MAPPROJECTION_rotation = ', mapprojection_rotation
670 
671  mapprojection_mapping = "lambert_conformal_conic"
672  mapprojection_standard_parallel(:) = (/ mapprojection_lc_lat1, mapprojection_lc_lat2 /)
673  mapprojection_longitude_of_central_meridian = mapprojection_basepoint_lon
674  mapprojection_latitude_of_projection_origin = mapprojection_basepoint_lat
675  mapprojection_false_easting = mapprojection_basepoint_x
676  mapprojection_false_northing = mapprojection_basepoint_y
677 
678  return
679  end subroutine mapprojection_lambertconformal_setup
680 
681  !-----------------------------------------------------------------------------
683  subroutine mapprojection_lambertconformal_xy2lonlat( &
684  x, &
685  y, &
686  lon, &
687  lat )
688  implicit none
689 
690  real(DP), intent(in) :: x
691  real(DP), intent(in) :: y
692  real(RP), intent(out) :: lon ! [rad]
693  real(RP), intent(out) :: lat ! [rad]
694 
695  real(DP) :: xx, yy, dist
696  !---------------------------------------------------------------------------
697 
698  xx = ( x - mapprojection_pole_x ) / radius / mapprojection_lc_fact
699  yy = -mapprojection_hemisphere * ( y - mapprojection_pole_y ) / radius / mapprojection_lc_fact
700 
701  dist = sqrt( xx*xx + yy*yy )
702 
703  lon = mapprojection_basepoint_lon * d2r + atan2(xx,yy) / mapprojection_lc_c
704 
705  ! check hemisphere: 1=north, -1=south
706  lat = mapprojection_hemisphere * ( 0.5_dp*pi - 2.0_dp*atan( dist**(1.0_dp/mapprojection_lc_c) ) )
707 
708  return
709  end subroutine mapprojection_lambertconformal_xy2lonlat
710 
711  !-----------------------------------------------------------------------------
713  subroutine mapprojection_lambertconformal_lonlat2xy( &
714  lon, &
715  lat, &
716  x, &
717  y )
718  implicit none
719 
720  real(RP), intent(in) :: lon ! [rad]
721  real(RP), intent(in) :: lat ! [rad]
722  real(DP), intent(out) :: x
723  real(DP), intent(out) :: y
724 
725  real(DP) :: dlon, latrot, dist
726  !---------------------------------------------------------------------------
727 
728  dlon = lon - mapprojection_basepoint_lon * d2r
729  if ( dlon > pi ) dlon = dlon - pi*2.0_dp
730  if ( dlon < -pi ) dlon = dlon + pi*2.0_dp
731 
732  latrot = 0.5_dp*pi - mapprojection_hemisphere * lat
733 
734  dist = mapprojection_lc_fact * radius * tan(0.5_dp*latrot)**mapprojection_lc_c
735 
736  x = mapprojection_pole_x + dist * sin(mapprojection_lc_c*dlon)
737  y = mapprojection_pole_y - mapprojection_hemisphere * dist * cos(mapprojection_lc_c*dlon)
738 
739  return
740  end subroutine mapprojection_lambertconformal_lonlat2xy
741 
742  !-----------------------------------------------------------------------------
744  subroutine mapprojection_lambertconformal_mapfactor( &
745  lat, &
746  m1, m2 )
747  implicit none
748 
749  real(RP), intent(in) :: lat ! [rad]
750  real(RP), intent(out) :: m1
751  real(RP), intent(out) :: m2
752 
753  real(DP) :: latrot
754  !---------------------------------------------------------------------------
755 
756  latrot = 0.5_dp*pi - mapprojection_hemisphere * lat
757 
758  m1 = mapprojection_lc_fact / sin(latrot) * mapprojection_lc_c * tan(0.5_dp*latrot)**mapprojection_lc_c
759  m2 = m1
760 
761  return
762  end subroutine mapprojection_lambertconformal_mapfactor
763 
764  !-----------------------------------------------------------------------------
765  subroutine mapprojection_lambertconformal_rotcoef( &
766  lon, lat, &
767  rotc_cos, rotc_sin )
768  implicit none
769  real(RP), intent(in) :: lon, lat
770  real(RP), intent(out) :: rotc_cos, rotc_sin
771 
772  real(DP) :: dlon
773  real(DP) :: alpha
774  !---------------------------------------------------------------------------
775 
776  dlon = lon - mapprojection_basepoint_lon * d2r
777  if ( dlon > pi ) dlon = dlon - pi*2.0_dp
778  if ( dlon < -pi ) dlon = dlon + pi*2.0_dp
779 
780  alpha = - mapprojection_lc_c * dlon * mapprojection_hemisphere &
781  + mapprojection_rotation
782 
783  rotc_cos = cos( alpha )
784  rotc_sin = sin( alpha )
785 
786  return
787  end subroutine mapprojection_lambertconformal_rotcoef
788 
789  !-----------------------------------------------------------------------------
791  subroutine mapprojection_polarstereographic_setup
792  implicit none
793 
794  real(DP) :: lat0
795  real(DP) :: dlon, latrot, dist
796  !---------------------------------------------------------------------------
797 
798  ! check hemisphere: 1=north, -1=south
799  mapprojection_hemisphere = sign(1.0_dp,mapprojection_ps_lat)
800 
801  lat0 = mapprojection_hemisphere * mapprojection_ps_lat * d2r
802 
803  ! pre-calc factor
804  mapprojection_ps_fact = 1.0_dp + sin(lat0)
805 
806  ! calc (x,y) at pole point
807  dlon = 0.0_dp
808 
809  latrot = 0.5_dp*pi - mapprojection_hemisphere * mapprojection_basepoint_lat * d2r
810 
811  dist = mapprojection_ps_fact * radius * tan(0.5_dp*latrot)
812 
813  mapprojection_pole_x = mapprojection_basepoint_x - dist * sin(dlon)
814  mapprojection_pole_y = mapprojection_basepoint_y + mapprojection_hemisphere * dist * cos(dlon)
815 
816  log_newline
817  log_info("MAPPROJECTION_PolarStereographic_setup",*) 'MAPPROJECTION_PS_lat1 = ', mapprojection_ps_lat
818  log_info("MAPPROJECTION_PolarStereographic_setup",*) 'MAPPROJECTION_hemisphere = ', mapprojection_hemisphere
819  log_info("MAPPROJECTION_PolarStereographic_setup",*) 'MAPPROJECTION_PS_fact = ', mapprojection_ps_fact
820  log_info("MAPPROJECTION_PolarStereographic_setup",*) 'MAPPROJECTION_pole_x = ', mapprojection_pole_x
821  log_info("MAPPROJECTION_PolarStereographic_setup",*) 'MAPPROJECTION_pole_y = ', mapprojection_pole_y
822 
823  mapprojection_mapping = "polar_stereographic"
824  mapprojection_straight_vertical_longitude_from_pole = mapprojection_basepoint_lon
825  mapprojection_latitude_of_projection_origin = mapprojection_basepoint_lat
826  mapprojection_standard_parallel(1) = mapprojection_ps_lat
827  mapprojection_false_easting = mapprojection_basepoint_x
828  mapprojection_false_northing = mapprojection_basepoint_y
829 
830  return
831  end subroutine mapprojection_polarstereographic_setup
832 
833  !-----------------------------------------------------------------------------
835  subroutine mapprojection_polarstereographic_xy2lonlat( &
836  x, &
837  y, &
838  lon, &
839  lat )
840  implicit none
841 
842  real(DP), intent(in) :: x
843  real(DP), intent(in) :: y
844  real(RP), intent(out) :: lon ! [rad]
845  real(RP), intent(out) :: lat ! [rad]
846 
847  real(DP) :: xx, yy, dist
848  !---------------------------------------------------------------------------
849 
850  xx = ( x - mapprojection_pole_x ) / radius / mapprojection_ps_fact
851  yy = -mapprojection_hemisphere * ( y - mapprojection_pole_y ) / radius / mapprojection_ps_fact
852 
853  dist = sqrt( xx*xx + yy*yy )
854 
855  lon = mapprojection_basepoint_lon * d2r + atan2(xx,yy)
856 
857  lat = mapprojection_hemisphere * ( 0.5_dp*pi - 2.0_dp*atan(dist) )
858 
859  return
860  end subroutine mapprojection_polarstereographic_xy2lonlat
861 
862  !-----------------------------------------------------------------------------
864  subroutine mapprojection_polarstereographic_lonlat2xy( &
865  lon, &
866  lat, &
867  x, &
868  y )
869  implicit none
870 
871  real(RP), intent(in) :: lon ! [rad]
872  real(RP), intent(in) :: lat ! [rad]
873  real(DP), intent(out) :: x
874  real(DP), intent(out) :: y
875 
876  real(DP) :: dlon, latrot, dist
877  !---------------------------------------------------------------------------
878 
879  dlon = lon - mapprojection_basepoint_lon * d2r
880 
881  latrot = 0.5_dp*pi - mapprojection_hemisphere * lat
882 
883  dist = mapprojection_ps_fact * radius * tan(0.5_dp*latrot)
884 
885  x = mapprojection_pole_x + dist * sin(dlon)
886  y = mapprojection_pole_y - mapprojection_hemisphere * dist * cos(dlon)
887 
888  return
889  end subroutine mapprojection_polarstereographic_lonlat2xy
890 
891  !-----------------------------------------------------------------------------
893  subroutine mapprojection_polarstereographic_mapfactor( &
894  lat, &
895  m1, m2 )
896  implicit none
897 
898  real(RP), intent(in) :: lat ! [rad]
899  real(RP), intent(out) :: m1
900  real(RP), intent(out) :: m2
901  !---------------------------------------------------------------------------
902 
903  m1 = mapprojection_ps_fact / ( 1.0_dp + sin(mapprojection_hemisphere*lat) )
904  m2 = m1
905 
906  return
907  end subroutine mapprojection_polarstereographic_mapfactor
908 
909  !-----------------------------------------------------------------------------
910  subroutine mapprojection_polarstereographic_rotcoef( &
911  lon, lat, &
912  rotc_cos, rotc_sin )
913  implicit none
914  real(RP), intent(in) :: lon, lat
915  real(RP), intent(out) :: rotc_cos, rotc_sin
916 
917  real(DP) :: dlon
918  real(DP) :: alpha
919  !---------------------------------------------------------------------------
920 
921  dlon = lon - mapprojection_basepoint_lon * d2r
922  if ( dlon > pi ) dlon = dlon - pi*2.0_dp
923  if ( dlon < -pi ) dlon = dlon + pi*2.0_dp
924 
925  alpha = - dlon * mapprojection_hemisphere &
926  + mapprojection_rotation
927 
928  rotc_cos = cos( alpha )
929  rotc_sin = sin( alpha )
930 
931  return
932  end subroutine mapprojection_polarstereographic_rotcoef
933 
934  !-----------------------------------------------------------------------------
936  subroutine mapprojection_mercator_setup
937  use scale_prc, only: &
938  prc_abort
939  implicit none
940 
941  real(DP) :: lat0
942  real(DP) :: latrot, dist
943  !---------------------------------------------------------------------------
944 
945  lat0 = mapprojection_m_lat * d2r
946 
947  ! pre-calc factor
948  mapprojection_m_fact = cos(lat0)
949 
950  if ( mapprojection_m_fact == 0.0_dp ) then
951  log_error("MAPPROJECTION_Mercator_setup",*) 'MAPPROJECTION_M_lat cannot be set to pole point! value=', mapprojection_m_lat
952  call prc_abort
953  endif
954 
955  ! calc (x,y) at (lon,lat) = (base,0)
956  latrot = 0.5_dp*pi - mapprojection_basepoint_lat * d2r
957 
958  dist = 1.0_dp / tan(0.5_dp*latrot)
959 
960  mapprojection_eq_x = mapprojection_basepoint_x
961  mapprojection_eq_y = mapprojection_basepoint_y - radius * mapprojection_m_fact * log(dist)
962 
963  log_newline
964  log_info("MAPPROJECTION_Mercator_setup",*) 'MAPPROJECTION_M_lat = ', mapprojection_m_lat
965  log_info("MAPPROJECTION_Mercator_setup",*) 'MAPPROJECTION_M_fact = ', mapprojection_m_fact
966  log_info("MAPPROJECTION_Mercator_setup",*) 'MAPPROJECTION_eq_x = ', mapprojection_eq_x
967  log_info("MAPPROJECTION_Mercator_setup",*) 'MAPPROJECTION_eq_y = ', mapprojection_eq_y
968 
969  mapprojection_mapping = "mercator"
970  mapprojection_longitude_of_projection_origin = mapprojection_basepoint_lon
971  mapprojection_standard_parallel(1) = mapprojection_m_lat
972  mapprojection_false_easting = mapprojection_basepoint_x
973  mapprojection_false_northing = mapprojection_basepoint_y
974 
975  return
976  end subroutine mapprojection_mercator_setup
977 
978  !-----------------------------------------------------------------------------
980  subroutine mapprojection_mercator_xy2lonlat( &
981  x, &
982  y, &
983  lon, &
984  lat )
985  implicit none
986 
987  real(DP), intent(in) :: x
988  real(DP), intent(in) :: y
989  real(RP), intent(out) :: lon ! [rad]
990  real(RP), intent(out) :: lat ! [rad]
991 
992  real(DP) :: xx, yy
993  !---------------------------------------------------------------------------
994 
995  xx = ( x - mapprojection_eq_x ) / radius / mapprojection_m_fact
996  yy = ( y - mapprojection_eq_y ) / radius / mapprojection_m_fact
997 
998  lon = xx + mapprojection_basepoint_lon * d2r
999 
1000  lat = 0.5_dp*pi - 2.0_dp*atan( 1.0_dp/exp(yy) )
1001 
1002  return
1003  end subroutine mapprojection_mercator_xy2lonlat
1004 
1005  !-----------------------------------------------------------------------------
1007  subroutine mapprojection_mercator_lonlat2xy( &
1008  lon, &
1009  lat, &
1010  x, &
1011  y )
1012  implicit none
1013 
1014  real(RP), intent(in) :: lon ! [rad]
1015  real(RP), intent(in) :: lat ! [rad]
1016  real(DP), intent(out) :: x
1017  real(DP), intent(out) :: y
1018 
1019  real(DP) :: dlon, latrot, dist
1020  !---------------------------------------------------------------------------
1021 
1022  dlon = lon - mapprojection_basepoint_lon * d2r
1023 
1024  latrot = 0.5_dp*pi - lat
1025 
1026  dist = 1.0_dp / tan(0.5_dp*latrot)
1027 
1028  x = mapprojection_eq_x + radius * mapprojection_m_fact * dlon
1029  y = mapprojection_eq_y + radius * mapprojection_m_fact * log(dist)
1030 
1031  return
1032  end subroutine mapprojection_mercator_lonlat2xy
1033 
1034  !-----------------------------------------------------------------------------
1036  subroutine mapprojection_mercator_mapfactor( &
1037  lat, &
1038  m1, m2 )
1039  implicit none
1040 
1041  real(RP), intent(in) :: lat ! [rad]
1042  real(RP), intent(out) :: m1
1043  real(RP), intent(out) :: m2
1044  !---------------------------------------------------------------------------
1045 
1046  m1 = mapprojection_m_fact / cos(real(lat,kind=dp))
1047  m2 = m1
1048 
1049  return
1050  end subroutine mapprojection_mercator_mapfactor
1051 
1052  !-----------------------------------------------------------------------------
1053  subroutine mapprojection_mercator_rotcoef( &
1054  lon, lat, &
1055  rotc_cos, rotc_sin )
1056  implicit none
1057  real(RP), intent(in) :: lon, lat
1058  real(RP), intent(out) :: rotc_cos, rotc_sin
1059  !---------------------------------------------------------------------------
1060 
1061  rotc_cos = mapprojection_rot_fact_cos
1062  rotc_sin = mapprojection_rot_fact_sin
1063 
1064  return
1065  end subroutine mapprojection_mercator_rotcoef
1066 
1067  !-----------------------------------------------------------------------------
1069  subroutine mapprojection_equidistantcylindrical_setup
1070  use scale_prc, only: &
1071  prc_abort
1072  implicit none
1073 
1074  real(DP) :: lat0
1075  !---------------------------------------------------------------------------
1076 
1077  lat0 = mapprojection_ec_lat * d2r
1078 
1079  ! pre-calc factor
1080  mapprojection_ec_fact = cos(lat0)
1081 
1082  if ( mapprojection_ec_fact == 0.0_dp ) then
1083  log_error("MAPPROJECTION_EquidistantCylindrical_setup",*) 'MAPPROJECTION_EC_lat cannot be set to pole point! value=', mapprojection_ec_lat
1084  call prc_abort
1085  endif
1086 
1087  mapprojection_eq_x = mapprojection_basepoint_x
1088  mapprojection_eq_y = mapprojection_basepoint_y - radius * mapprojection_basepoint_lat * d2r
1089 
1090  log_newline
1091  log_info("MAPPROJECTION_EquidistantCylindrical_setup",*) 'MAPPROJECTION_EC_lat = ', mapprojection_ec_lat
1092  log_info("MAPPROJECTION_EquidistantCylindrical_setup",*) 'MAPPROJECTION_EC_fact = ', mapprojection_ec_fact
1093  log_info("MAPPROJECTION_EquidistantCylindrical_setup",*) 'MAPPROJECTION_eq_x = ', mapprojection_eq_x
1094  log_info("MAPPROJECTION_EquidistantCylindrical_setup",*) 'MAPPROJECTION_eq_y = ', mapprojection_eq_y
1095 
1096  mapprojection_mapping = "equirectangular"
1097  mapprojection_standard_parallel(1) = mapprojection_ec_lat
1098  mapprojection_longitude_of_central_meridian = mapprojection_basepoint_lon
1099  mapprojection_false_easting = mapprojection_basepoint_x
1100  mapprojection_false_northing = mapprojection_basepoint_y
1101 
1102  return
1103  end subroutine mapprojection_equidistantcylindrical_setup
1104 
1105  !-----------------------------------------------------------------------------
1107  subroutine mapprojection_equidistantcylindrical_xy2lonlat( &
1108  x, &
1109  y, &
1110  lon, &
1111  lat )
1112  use scale_prc, only: &
1113  prc_abort
1114  implicit none
1115 
1116  real(DP), intent(in) :: x
1117  real(DP), intent(in) :: y
1118  real(RP), intent(out) :: lon ! [rad]
1119  real(RP), intent(out) :: lat ! [rad]
1120 
1121  real(DP) :: xx, yy
1122  !---------------------------------------------------------------------------
1123 
1124  xx = ( x - mapprojection_eq_x ) / radius / mapprojection_ec_fact
1125  yy = ( y - mapprojection_eq_y ) / radius
1126 
1127  lon = xx + mapprojection_basepoint_lon * d2r
1128 
1129  lat = yy
1130 
1131  if ( abs(lat) > 0.5_dp*pi ) then
1132  log_error("MAPPROJECTION_EquidistantCylindrical_xy2lonlat",*) 'Invalid latitude range! value=', lat
1133  call prc_abort
1134  endif
1135 
1136  return
1137  end subroutine mapprojection_equidistantcylindrical_xy2lonlat
1138 
1139  !-----------------------------------------------------------------------------
1141  subroutine mapprojection_equidistantcylindrical_lonlat2xy( &
1142  lon, &
1143  lat, &
1144  x, &
1145  y )
1146  implicit none
1147 
1148  real(RP), intent(in) :: lon ! [rad]
1149  real(RP), intent(in) :: lat ! [rad]
1150  real(DP), intent(out) :: x
1151  real(DP), intent(out) :: y
1152 
1153  real(DP) :: dlon
1154  !---------------------------------------------------------------------------
1155 
1156  dlon = lon - mapprojection_basepoint_lon * d2r
1157 
1158  x = mapprojection_eq_x + radius * mapprojection_ec_fact * dlon
1159  y = mapprojection_eq_y + radius * lat
1160 
1161  return
1162  end subroutine mapprojection_equidistantcylindrical_lonlat2xy
1163 
1164  !-----------------------------------------------------------------------------
1166  subroutine mapprojection_equidistantcylindrical_mapfactor( &
1167  lat, &
1168  m1, m2 )
1169  implicit none
1170 
1171  real(RP), intent(in) :: lat ! [rad]
1172  real(RP), intent(out) :: m1
1173  real(RP), intent(out) :: m2
1174  real(DP) :: mm1, mm2
1175  !---------------------------------------------------------------------------
1176 
1177  mm1 = mapprojection_ec_fact / cos(real(lat,kind=dp))
1178  mm2 = 1.0_rp
1179 
1180  m1 = sqrt( (mapprojection_rot_fact_cos * mm1)**2 + (mapprojection_rot_fact_sin * mm2)**2 )
1181  m2 = sqrt( (mapprojection_rot_fact_cos * mm2)**2 + (mapprojection_rot_fact_sin * mm1)**2 )
1182 
1183  return
1184  end subroutine mapprojection_equidistantcylindrical_mapfactor
1185 
1186  !-----------------------------------------------------------------------------
1187  subroutine mapprojection_equidistantcylindrical_rotcoef( &
1188  lon, lat, &
1189  rotc_cos, rotc_sin )
1190  implicit none
1191  real(RP), intent(in) :: lon, lat
1192  real(RP), intent(out) :: rotc_cos, rotc_sin
1193  !---------------------------------------------------------------------------
1194 
1195  rotc_cos = mapprojection_rot_fact_cos
1196  rotc_sin = mapprojection_rot_fact_sin
1197 
1198  return
1199  end subroutine mapprojection_equidistantcylindrical_rotcoef
1200 
1201 end module scale_mapprojection
subroutine, public mapprojection_get_attributes(mapping, false_easting, false_northing, longitude_of_central_meridian, longitude_of_projection_origin, latitude_of_projection_origin, straight_vertical_longitude_from_pole, standard_parallel)
Get mapping attributes.
subroutine, public mapprojection_setup(DOMAIN_CENTER_X, DOMAIN_CENTER_Y)
Setup.
subroutine, public mapprojection_rotcoef(IA, IS, IE, JA, JS, JE, lon, lat, rotc)
u(lat,lon) = cos u(x,y) - sin v(x,y) v(lat,lon) = sin u(x,y) + cos v(x,y)
real(rp), public const_radius
radius of the planet [m]
Definition: scale_const.F90:44
integer, public io_fid_conf
Config file ID.
Definition: scale_io.F90:55
real(rp), public const_d2r
degree to radian
Definition: scale_const.F90:32
real(rp), public const_undef
Definition: scale_const.F90:41
module PROCESS
Definition: scale_prc.F90:11
subroutine, public prc_abort
Abort Process.
Definition: scale_prc.F90:338
subroutine, public mapprojection_mapfactor(IA, IS, IE, JA, JS, JE, lat, m1, m2)
(x,y) -> (lon,lat)
module CONSTANT
Definition: scale_const.F90:11
real(rp), public mapprojection_basepoint_lon
module profiler
Definition: scale_prof.F90:11
procedure(xy2lonlat_s), pointer xy2lonlat
module Map projection
module PRECISION
real(rp), public const_pi
pi
Definition: scale_const.F90:31
subroutine mapprojection_xy2lonlat_0d(x, y, lon, lat)
(x,y) -> (lon,lat)
module STDIO
Definition: scale_io.F90:10
real(rp), public mapprojection_basepoint_lat
integer, parameter, public dp