45 private :: cnvtopo_gtopo30
46 private :: cnvtopo_gmted2010
47 private :: cnvtopo_dem50m
48 private :: cnvtopo_userfile
49 private :: cnvtopo_smooth
55 character(len=H_SHORT),
private :: cnvtopo_smooth_type =
'LAPLACIAN' 59 integer,
private :: cnvtopo_smooth_hypdiff_order = 4
60 integer,
private :: cnvtopo_smooth_hypdiff_niter = 20
61 logical,
private :: cnvtopo_smooth_local = .true.
62 integer,
private :: cnvtopo_smooth_itelim = 10000
63 logical,
private :: cnvtopo_smooth_trim_ocean = .true.
64 real(RP),
private :: cnvtopo_smooth_maxslope_ratio = 5.0_rp
65 real(RP),
private :: cnvtopo_smooth_maxslope = -1.0_rp
66 real(RP),
private :: cnvtopo_smooth_maxslope_limit
68 logical,
private :: cnvtopo_copy_parent = .false.
70 integer,
private :: cnvtopo_interp_level = 5
72 real(RP),
private :: domain_lats, domain_late
73 real(RP),
private :: domain_lons, domain_lone
86 statistics_horizontal_min
93 character(len=H_SHORT) :: CNVTOPO_name =
'NONE' 95 namelist / param_cnvtopo / &
101 cnvtopo_smooth_trim_ocean, &
102 cnvtopo_smooth_hypdiff_order, &
103 cnvtopo_smooth_hypdiff_niter, &
104 cnvtopo_smooth_maxslope_ratio, &
105 cnvtopo_smooth_maxslope, &
106 cnvtopo_smooth_local, &
107 cnvtopo_smooth_itelim, &
108 cnvtopo_smooth_type, &
109 cnvtopo_copy_parent, &
112 real(RP) :: minslope(
ia,
ja)
113 real(RP) :: DXL(
ia-1)
114 real(RP) :: DYL(
ja-1)
115 real(RP) :: DZDX, DZDY
122 log_info(
"CNVTOPO_setup",*)
'Setup' 131 log_info(
"CNVTOPO_setup",*)
'Not found namelist. Default used.' 132 elseif( ierr > 0 )
then 133 log_error(
"CNVTOPO_setup",*)
'Not appropriate names in namelist PARAM_CNVTOPO. Check!' 136 log_nml(param_cnvtopo)
138 select case(cnvtopo_name)
165 log_error(
"CNVTOPO_setup",*)
'Unsupported TYPE: ', trim(cnvtopo_name)
173 log_info(
"CNVTOPO_setup",*)
'Use GTOPO, global 30 arcsec. data' 175 log_info(
"CNVTOPO_setup",*)
'Use GMTED2010, new global 5 arcsec. data' 176 log_info(
"CNVTOPO_setup",*)
'Overwrite Existing region' 179 log_info(
"CNVTOPO_setup",*)
'Use DEM 50m data for Japan region' 180 log_info(
"CNVTOPO_setup",*)
'Overwrite Japan region' 184 log_info(
"CNVTOPO_setup",*)
'Use GMTED2010, new global 5 arcsec. data' 186 log_info(
"CNVTOPO_setup",*)
'Use DEM 50m data for Japan region' 187 log_info(
"CNVTOPO_setup",*)
'Overwrite Japan region' 191 log_info(
"CNVTOPO_setup",*)
'Use DEM 50m data, Japan region only' 194 log_info(
"CNVTOPO_setup",*)
'Use user-defined file' 198 log_info(
"CNVTOPO_setup",*)
'Do nothing for topography data' 201 if( cnvtopo_smooth_maxslope > 0.0_rp )
then 203 cnvtopo_smooth_maxslope_limit = cnvtopo_smooth_maxslope
211 dzdx = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dxl(i) ) / d2r
212 dzdy = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dyl(j) ) / d2r
213 minslope(
is,
js) = min( minslope(
is,
js), dzdx, dzdy )
219 dzdx = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dxl(i) ) / d2r
220 dzdy = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dyl(j) ) / d2r
221 minslope(i,
js) = min( minslope(i,
js), dzdx, dzdy )
230 dzdx = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dxl(i) ) / d2r
231 dzdy = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dyl(j) ) / d2r
232 minslope(
is,j) = min( minslope(
is,j), dzdx, dzdy )
241 dzdx = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dxl(i) ) / d2r
242 dzdy = atan2( cnvtopo_smooth_maxslope_ratio * cdz(k), dyl(j) ) / d2r
243 minslope(i,j) = min( minslope(i,j), dzdx, dzdy )
248 call statistics_horizontal_min(
ia,
is,
ie,
ja,
js,
je, &
249 minslope(:,:), cnvtopo_smooth_maxslope_limit )
279 log_progress(*)
'skip convert topography data' 282 log_progress(*)
'start convert topography data' 284 domain_lats = minval( latxv(:,:) )
285 domain_late = maxval( latxv(:,:) )
286 domain_lons = minval( lonuy(:,:) )
287 domain_lone = maxval( lonuy(:,:) )
289 log_info(
"CNVTOPO",*)
'Domain Information' 290 log_info_cont(*)
'Domain (LAT) :', domain_lats/d2r, domain_late/d2r
291 log_info_cont(*)
' (LON) :', domain_lons/d2r, domain_lone/d2r
322 log_progress(*)
'end convert topography data' 333 subroutine cnvtopo_gtopo30( TOPO_Zsfc )
344 file_tiledata_get_data
349 real(RP),
intent(inout) :: TOPO_Zsfc(
ia,
ja)
351 character(len=H_LONG) :: GTOPO30_IN_DIR =
'.' 352 character(len=H_LONG) :: GTOPO30_IN_CATALOGUE =
'' 354 namelist / param_cnvtopo_gtopo30 / &
359 real(RP),
parameter :: GTOPO30_DLAT = 30.0_rp / 60.0_rp / 60.0_rp
360 real(RP),
parameter :: GTOPO30_DLON = 30.0_rp / 60.0_rp / 60.0_rp
363 real(RP) :: Zsfc(
ia,
ja)
366 integer,
parameter :: TILE_nlim = 100
368 character(len=H_LONG) :: TILE_fname(tile_nlim)
369 logical :: TILE_hit (tile_nlim)
370 integer :: TILE_JS (tile_nlim)
371 integer :: TILE_JE (tile_nlim)
372 integer :: TILE_IS (tile_nlim)
373 integer :: TILE_IE (tile_nlim)
374 real(RP) :: TILE_DLAT, TILE_DLON
376 real(RP),
allocatable :: HEIGHT(:,:)
377 real(RP),
allocatable :: LATH (:,:)
378 real(RP),
allocatable :: LONH (:,:)
379 integer :: nLONH, nLATH
384 integer,
allocatable :: idx_i(:,:,:)
385 integer,
allocatable :: idx_j(:,:,:)
386 real(RP),
allocatable :: hfact(:,:,:)
388 character(len=H_LONG) :: fname
390 integer :: ish, ieh, jsh, jeh
397 read(
io_fid_conf,nml=param_cnvtopo_gtopo30,iostat=ierr)
399 log_info(
"CNVTOPO_GTOPO30",*)
'Not found namelist. Default used.' 400 elseif( ierr > 0 )
then 401 log_error(
"CNVTOPO_GTOPO30",*)
'Not appropriate names in namelist PARAM_CNVTOPO_GTOPO30. Check!' 404 log_nml(param_cnvtopo_gtopo30)
407 tile_dlat = gtopo30_dlat * d2r
408 tile_dlon = gtopo30_dlon * d2r
411 fname = trim(gtopo30_in_dir)//
'/'//trim(gtopo30_in_catalogue)
414 tile_dlat, tile_dlon, &
415 domain_lats, domain_late, domain_lons, domain_lone, &
419 tile_fname(:), tile_hit(:), &
420 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
421 nlath, nlonh, jsh, jeh, ish, ieh )
423 allocate( height(nlonh,nlath) )
424 allocate( lath(nlonh,nlath) )
425 allocate( lonh(nlonh,nlath) )
427 call file_tiledata_get_data( nlath, nlonh, &
431 tile_dlat, tile_dlon, &
432 tile_fname(:), tile_hit(:), &
433 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
434 jsh, jeh, ish, ieh, &
436 height(:,:), lath(:,:), lonh(:,:), &
437 min_value = -9000.0_rp, yrevers = .true. )
440 allocate( idx_i(
ia,
ja,cnvtopo_interp_level) )
441 allocate( idx_j(
ia,
ja,cnvtopo_interp_level) )
442 allocate( hfact(
ia,
ja,cnvtopo_interp_level) )
446 lonh(:,:), lath(:,:), &
448 lon(:,:), lat(:,:), &
449 idx_i(:,:,:), idx_j(:,:,:), &
455 idx_i(:,:,:), idx_j(:,:,:), &
461 deallocate( height, lath, lonh )
462 deallocate( idx_j, idx_i, hfact )
467 if ( zsfc(i,j) /= undef ) topo_zsfc(i,j) = zsfc(i,j)
472 end subroutine cnvtopo_gtopo30
476 subroutine cnvtopo_gmted2010( TOPO_Zsfc )
478 real(RP),
intent(inout) :: TOPO_Zsfc(
ia,
ja)
482 end subroutine cnvtopo_gmted2010
486 subroutine cnvtopo_dem50m( TOPO_Zsfc )
501 file_tiledata_get_data
506 real(RP),
intent(inout) :: TOPO_Zsfc(
ia,
ja)
508 character(len=H_LONG) :: DEM50M_IN_DIR =
'.' 509 character(len=H_LONG) :: DEM50M_IN_CATALOGUE =
'' 511 namelist / param_cnvtopo_dem50m / &
515 real(RP),
parameter :: DEM50M_DLAT = 5.0_rp / 60.0_rp / 200.0_rp
516 real(RP),
parameter :: DEM50M_DLON = 7.5_rp / 60.0_rp / 200.0_rp
519 real(RP) :: Zsfc(
ia,
ja)
522 integer,
parameter :: TILE_nlim = 1000
524 character(len=H_LONG) :: TILE_fname(tile_nlim)
525 logical :: TILE_hit (tile_nlim)
526 integer :: TILE_JS (tile_nlim)
527 integer :: TILE_JE (tile_nlim)
528 integer :: TILE_IS (tile_nlim)
529 integer :: TILE_IE (tile_nlim)
530 real(RP) :: TILE_DLAT, TILE_DLON
532 real(RP),
allocatable :: HEIGHT(:,:)
533 real(RP),
allocatable :: LATH (:,:)
534 real(RP),
allocatable :: LONH (:,:)
535 integer :: nLONH, nLATH
540 integer,
allocatable :: idx_i(:,:,:)
541 integer,
allocatable :: idx_j(:,:,:)
542 real(RP),
allocatable :: hfact(:,:,:)
543 real(RP) :: search_limit
545 character(len=H_LONG) :: fname
547 integer :: ish, ieh, jsh, jeh
555 read(
io_fid_conf,nml=param_cnvtopo_dem50m,iostat=ierr)
557 log_info(
"CNVTOPO_DEM50M",*)
'Not found namelist. Default used.' 558 elseif( ierr > 0 )
then 559 log_error(
"CNVTOPO_DEM50M",*)
'Not appropriate names in namelist PARAM_CNVTOPO_DEM50M. Check!' 562 log_nml(param_cnvtopo_dem50m)
564 tile_dlat = dem50m_dlat * d2r
565 tile_dlon = dem50m_dlon * d2r
568 fname = trim(dem50m_in_dir)//
'/'//trim(dem50m_in_catalogue)
571 tile_dlat, tile_dlon, &
572 domain_lats, domain_late, domain_lons, domain_lone, &
576 tile_fname(:), tile_hit(:), &
577 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
578 nlath, nlonh, jsh, jeh, ish, ieh )
580 if ( .not. any(tile_hit(1:tile_nmax) ) )
return 582 allocate( height(nlonh,nlath) )
583 allocate( lath(nlonh,nlath) )
584 allocate( lonh(nlonh,nlath) )
586 call file_tiledata_get_data( nlath, nlonh, &
590 tile_dlat, tile_dlon, &
591 tile_fname(:), tile_hit(:), &
592 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
593 jsh, jeh, ish, ieh, &
595 height(:,:), lath(:,:), lonh(:,:), &
596 min_value = -900.0_rp )
599 allocate( idx_i(
ia,
ja,cnvtopo_interp_level) )
600 allocate( idx_j(
ia,
ja,cnvtopo_interp_level) )
601 allocate( hfact(
ia,
ja,cnvtopo_interp_level) )
603 search_limit = max( sqrt(tile_dlon**2 + tile_dlat**2) * radius * 1.5_rp, sqrt(
dx**2 +
dy**2) )
606 lonh(:,:), lath(:,:), &
608 lon(:,:), lat(:,:), &
609 idx_i(:,:,:), idx_j(:,:,:), &
611 latlon_structure = .true., &
612 search_limit = search_limit )
617 idx_i(:,:,:), idx_j(:,:,:), &
623 deallocate( height, lath, lonh )
624 deallocate( idx_j, idx_i, hfact )
629 if ( zsfc(i,j) /= undef ) topo_zsfc(i,j) = zsfc(i,j)
634 end subroutine cnvtopo_dem50m
638 subroutine cnvtopo_userfile( TOPO_Zsfc )
653 file_tiledata_get_data
658 real(RP),
intent(inout) :: TOPO_Zsfc(
ia,
ja)
660 real(RP) :: USERFILE_DLAT = -1.0_rp
661 real(RP) :: USERFILE_DLON = -1.0_rp
662 character(len=H_LONG) :: USERFILE_IN_DIR =
'.' 663 character(len=H_LONG) :: USERFILE_IN_CATALOGUE =
'' 664 character(len=H_LONG) :: USERFILE_IN_FILENAME =
'' 665 character(len=H_LONG) :: USERFILE_IN_DATATYPE =
'REAL4' 666 logical :: USERFILE_LATORDER_N2S = .false.
667 real(RP) :: USERFILE_LAT_START = -90.0_rp
668 real(RP) :: USERFILE_LAT_END = 90.0_rp
669 real(RP) :: USERFILE_LON_START = 0.0_rp
670 real(RP) :: USERFILE_LON_END = 360.0_rp
672 namelist / param_cnvtopo_userfile / &
675 userfile_in_catalogue, &
677 userfile_in_filename, &
678 userfile_in_datatype, &
679 userfile_latorder_n2s, &
680 userfile_lat_start, &
682 userfile_lon_start, &
686 real(RP) :: Zsfc(
ia,
ja)
689 integer,
parameter :: TILE_nlim = 1000
691 character(len=H_LONG) :: TILE_fname(tile_nlim)
692 logical :: TILE_hit (tile_nlim)
693 integer :: TILE_JS (tile_nlim)
694 integer :: TILE_JE (tile_nlim)
695 integer :: TILE_IS (tile_nlim)
696 integer :: TILE_IE (tile_nlim)
697 real(RP) :: TILE_DLAT, TILE_DLON
699 real(RP),
allocatable :: HEIGHT(:,:)
700 real(RP),
allocatable :: LATH (:,:)
701 real(RP),
allocatable :: LONH (:,:)
702 integer :: nLONH, nLATH
707 integer,
allocatable :: idx_i(:,:,:)
708 integer,
allocatable :: idx_j(:,:,:)
709 real(RP),
allocatable :: hfact(:,:,:)
710 real(RP) :: search_limit
712 character(len=H_LONG) :: fname
714 real(RP) :: LATS, LATE, LONS, LONE
717 integer :: ish, ieh, jsh, jeh
726 read(
io_fid_conf,nml=param_cnvtopo_userfile,iostat=ierr)
728 log_info(
"CNVTOPO_USERFILE",*)
'Not found namelist. Default used.' 729 elseif( ierr > 0 )
then 730 log_error(
"CNVTOPO_USERFILE",*)
'Not appropriate names in namelist PARAM_CNVTOPO_USERFILE. Check!' 733 log_nml(param_cnvtopo_userfile)
735 if ( userfile_dlat <= 0.0_rp )
then 736 log_error(
"CNVTOPO_USERFILE",*)
'USERFILE_DLAT (width (deg.) of latitude tile) should be positive. Check! ', userfile_dlat
740 if ( userfile_dlon <= 0.0_rp )
then 741 log_error(
"CNVTOPO_USERFILE",*)
'USERFILE_DLON (width (deg.) of longitude tile) should be positive. Check! ', userfile_dlon
745 if ( userfile_in_catalogue ==
'' &
746 .AND. userfile_in_filename ==
'' )
then 747 log_error(
"CNVTOPO_USERFILE",*)
'Neither catalogue file nor single file specified. Check!' 751 if ( userfile_latorder_n2s )
then 752 log_info(
"CNVTOPO_USERFILE",*)
'data ordar of the latitude direction : North -> South' 755 log_info(
"CNVTOPO_USERFILE",*)
'data ordar of the latitude direction : South -> North' 761 tile_dlat = userfile_dlat * d2r
762 tile_dlon = userfile_dlon * d2r
764 if ( userfile_in_catalogue /=
"" )
then 766 fname = trim(userfile_in_dir)//
'/'//trim(userfile_in_catalogue)
769 tile_dlat, tile_dlon, &
770 domain_lats, domain_late, domain_lons, domain_lone, &
774 tile_fname(:), tile_hit(:), &
775 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
776 nlath, nlonh, jsh, jeh, ish, ieh )
778 lats = userfile_lat_start * d2r
779 late = userfile_lat_end * d2r
780 lons = userfile_lon_start * d2r
781 lone = userfile_lon_end * d2r
783 tile_dlat, tile_dlon, &
784 domain_lats, domain_late, domain_lons, domain_lone, &
788 tile_fname(:), tile_hit(:), &
789 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
790 nlath, nlonh, jsh, jeh, ish, ieh, &
791 single_fname = userfile_in_filename, &
792 lats = lats, late = late, lons = lons, lone = lone )
795 if ( .not. any(tile_hit(1:tile_nmax) ) )
return 797 allocate( height(nlonh,nlath) )
798 allocate( lath(nlonh,nlath) )
799 allocate( lonh(nlonh,nlath) )
801 call file_tiledata_get_data( nlath, nlonh, &
805 tile_dlat, tile_dlon, &
806 tile_fname(:), tile_hit(:), &
807 tile_js(:), tile_je(:), tile_is(:), tile_ie(:), &
808 jsh, jeh, ish, ieh, &
809 userfile_in_datatype, &
810 height(:,:), lath(:,:), lonh(:,:), &
811 min_value = 0.0_rp, yrevers = yrevers )
814 allocate( idx_i(
ia,
ja,cnvtopo_interp_level) )
815 allocate( idx_j(
ia,
ja,cnvtopo_interp_level) )
816 allocate( hfact(
ia,
ja,cnvtopo_interp_level) )
818 search_limit = max( sqrt(tile_dlon**2 + tile_dlat**2) * radius * 1.5_rp, sqrt(
dx**2 +
dy**2) )
821 lonh(:,:), lath(:,:), &
823 lon(:,:), lat(:,:), &
824 idx_i(:,:,:), idx_j(:,:,:), &
826 latlon_structure = .true., &
827 search_limit = search_limit )
832 idx_i(:,:,:), idx_j(:,:,:), &
837 deallocate( height, lath, lonh )
838 deallocate( idx_j, idx_i, hfact )
843 if ( zsfc(i,j) /= undef ) topo_zsfc(i,j) = zsfc(i,j)
848 end subroutine cnvtopo_userfile
852 subroutine cnvtopo_smooth( &
864 statistics_horizontal_max
873 real(RP),
intent(inout) :: Zsfc(
ia,
ja)
875 real(RP) :: DZsfc_DXY(
ia,
ja,2)
877 real(RP) :: DXL(
ia-1)
878 real(RP) :: DYL(
ja-1)
880 real(RP) :: FLX_X(
ia,
ja)
881 real(RP) :: FLX_Y(
ia,
ja)
883 real(RP) :: slope(
ia,
ja)
885 real(RP),
pointer :: TOPO_sign(:,:)
886 real(RP) :: flag, ocean_flag
888 character(len=8),
parameter :: varname(2) = (/
"DZsfc_DX",
"DZsfc_DY" /)
895 if ( cnvtopo_smooth_type ==
'OFF' )
then 897 log_info(
"CNVTOPO_smooth",*)
'Do not apply smoothing.' 902 log_info(
"CNVTOPO_smooth",*)
'Apply smoothing.' 903 log_info_cont(*)
'Slope limit = ', cnvtopo_smooth_maxslope_limit
904 log_info_cont(*)
'Smoothing type = ', cnvtopo_smooth_type
905 log_info_cont(*)
'Smoothing locally = ', cnvtopo_smooth_local
912 if ( cnvtopo_smooth_trim_ocean )
then 913 allocate( topo_sign(
ia,
ja) )
919 * ( 0.5_rp + sign( 0.5_rp, eps - abs(zsfc(i,j)) ) )
920 topo_sign(i,j) = sign( 1.0_rp, zsfc(i,j) ) * ( 1.0_rp - ocean_flag )
928 do ite = 1, cnvtopo_smooth_itelim+1
929 log_progress(*)
'smoothing itelation : ', ite
936 dzsfc_dxy(i,j,1) = atan2( ( zsfc(i+1,j)-zsfc(i,j) ), dxl(i) ) / d2r
939 dzsfc_dxy(
ia,:,1) = 0.0_rp
943 dzsfc_dxy(i,j,2) = atan2( ( zsfc(i,j+1)-zsfc(i,j) ), dyl(j) ) / d2r
946 dzsfc_dxy(:,
ja,2) = 0.0_rp
948 slope(:,:) = max( abs(dzsfc_dxy(:,:,1)), abs(dzsfc_dxy(:,:,2)) )
949 call statistics_horizontal_max(
ia,
is,
ie,
ja,
js,
je, &
950 slope(:,:), maxslope )
952 log_progress(*)
'maximum slope [deg] : ', maxslope
954 if( maxslope < cnvtopo_smooth_maxslope_limit )
exit 957 varname(:), dzsfc_dxy(:,:,:) )
959 select case( cnvtopo_smooth_type )
966 zsfc(i,j) = ( 0.2500_rp * zsfc(i ,j ) &
967 + 0.1250_rp * zsfc(i-1,j ) &
968 + 0.1250_rp * zsfc(i+1,j ) &
969 + 0.1250_rp * zsfc(i ,j-1) &
970 + 0.1250_rp * zsfc(i ,j+1) &
971 + 0.0625_rp * zsfc(i-1,j-1) &
972 + 0.0625_rp * zsfc(i+1,j-1) &
973 + 0.0625_rp * zsfc(i-1,j+1) &
974 + 0.0625_rp * zsfc(i+1,j+1) )
983 flx_x(i,j) = zsfc(i+1,j) - zsfc(i,j)
997 flx_y(i,j) = zsfc(i,j+1) - zsfc(i,j)
1009 if ( cnvtopo_smooth_local )
then 1015 + sign(0.5_rp, max( abs(dzsfc_dxy(i+1,j ,1)), &
1016 abs(dzsfc_dxy(i ,j ,1)), &
1017 abs(dzsfc_dxy(i-1,j ,1)), &
1018 abs(dzsfc_dxy(i+1,j ,2)), &
1019 abs(dzsfc_dxy(i+1,j-1,2)), &
1020 abs(dzsfc_dxy(i ,j ,2)), &
1021 abs(dzsfc_dxy(i ,j-1,2)) &
1022 ) - cnvtopo_smooth_maxslope_limit )
1023 flx_x(i,j) = flx_x(i,j) * flag
1031 + sign(0.5_rp, max( abs(dzsfc_dxy(i ,j+1,2)), &
1032 abs(dzsfc_dxy(i ,j ,2)), &
1033 abs(dzsfc_dxy(i ,j-1,2)), &
1034 abs(dzsfc_dxy(i ,j+1,1)), &
1035 abs(dzsfc_dxy(i-1,j+1,1)), &
1036 abs(dzsfc_dxy(i ,j ,1)), &
1037 abs(dzsfc_dxy(i-1,j ,1)) &
1038 ) - cnvtopo_smooth_maxslope_limit )
1039 flx_y(i,j) = flx_y(i,j) * flag
1047 zsfc(i,j) = zsfc(i,j) &
1048 + 0.1_rp * ( ( flx_x(i,j) - flx_x(i-1,j) ) &
1049 + ( flx_y(i,j) - flx_y(i,j-1) ) )
1054 log_error(
"CNVTOPO_smooth",*)
'Invalid smoothing type' 1058 if ( cnvtopo_smooth_trim_ocean )
then 1062 zsfc(i,j) = sign( max( zsfc(i,j) * topo_sign(i,j), 0.0_rp ), topo_sign(i,j) )
1069 if ( ite > cnvtopo_smooth_itelim )
then 1070 log_error(
"CNVTOPO_smooth",*)
'Smoothing did not converge until ', cnvtopo_smooth_itelim,
' times of iteration.' 1072 log_error_cont(*)
'Please try different parameters of PARAM_CNVTOPO.' 1073 log_error_cont(*)
'- Number limit of iteration (CNVTOPO_smooth_itelim) = ', cnvtopo_smooth_itelim
1074 log_error_cont(*)
'- Maximum ratio of slope dZ/dX, dZ/dY (CNVTOPO_smooth_maxslope_ratio) = ', cnvtopo_smooth_maxslope_ratio
1075 log_error_cont(*)
' Or, Maximum of slope with degree (CNVTOPO_smooth_maxslope) = ', cnvtopo_smooth_maxslope
1076 log_error_cont(*)
'- Smoothing type LAPLACIAN/GAUSSIAN/OFF (CNVTOPO_smooth_type) = ', trim(cnvtopo_smooth_type)
1077 log_error_cont(*)
'- Number of using points for interpolation (CNVTOPO_interp_level) = ', cnvtopo_interp_level
1081 log_info(
"CNVTOPO_smooth",*)
'smoothing complete.' 1086 if ( cnvtopo_smooth_hypdiff_niter > 0 )
then 1089 log_info(
"CNVTOPO_smooth",*)
'Apply hyperdiffusion.' 1093 cnvtopo_smooth_hypdiff_order, cnvtopo_smooth_hypdiff_niter, &
1094 limiter_sign = topo_sign(:,:) )
1099 dzsfc_dxy(i,j,1) = atan2( ( zsfc(i+1,j)-zsfc(i,j) ), dxl(i) ) / d2r
1102 dzsfc_dxy(
ia,:,1) = 0.0_rp
1106 dzsfc_dxy(i,j,2) = atan2( ( zsfc(i,j+1)-zsfc(i,j) ), dyl(j) ) / d2r
1109 dzsfc_dxy(:,
ja,2) = 0.0_rp
1111 slope(:,:) = max( abs(dzsfc_dxy(:,:,1)), abs(dzsfc_dxy(:,:,2)) )
1112 call statistics_horizontal_max(
ia,
is,
ie,
ja,
js,
je, &
1113 slope(:,:), maxslope )
1115 log_info(
"CNVTOPO_smooth",*)
'maximum slope [deg] : ', maxslope
1122 varname(:), dzsfc_dxy(:,:,:) )
1127 end subroutine cnvtopo_smooth
subroutine, public topo_write
Write topography.
logical, public cnvtopo_useuserfile
real(rp), public const_huge
huge number
subroutine, public topo_fillhalo(Zsfc, FILL_BND)
HALO Communication.
integer, public ia
of whole cells: x, local, with HALO
module Convert topography
logical, public cnvtopo_usedem50m
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lat
latitude [rad,-pi,pi]
real(rp), public const_radius
radius of the planet [m]
integer, public ja
of whole cells: y, local, with HALO
integer, public io_fid_conf
Config file ID.
real(rp), public const_d2r
degree to radian
subroutine, public copytopo(TOPO_child)
Setup and Main.
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdy
y-length of grid(j+1) to grid(j) [m]
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lon
longitude [rad,0-2pi]
real(rp), public const_undef
integer, public is
start point of inner domain: x, local
logical, public cnvtopo_donothing
integer, public ie
end point of inner domain: x, local
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_fdx
x-length of grid(i+1) to grid(i) [m]
module atmosphere / grid / cartesC index
integer, public ke
end point of inner domain: z, local
integer, public je
end point of inner domain: y, local
real(rp), dimension(:), allocatable, public atmos_grid_cartesc_cdz
z-length of control volume [m]
real(rp), dimension(:,:), allocatable, public landuse_fact_ocean
ocean factor
module atmosphere / grid / cartesC
integer, public ks
start point of inner domain: z, local
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_lonuy
longitude at staggered point (uy) [rad,0-2pi]
subroutine, public cnvtopo_setup
Setup.
subroutine, public interp_interp2d(npoints, IA_ref, JA_ref, IA, JA, idx_i, idx_j, hfact, val_ref, val)
subroutine, public prc_abort
Abort Process.
integer, public js
start point of inner domain: y, local
subroutine, public cnvtopo
Driver.
logical, public cnvtopo_usegtopo30
real(rp), public const_eps
small number
module Atmosphere GRID CartesC Real(real space)
subroutine, public file_tiledata_get_info(TILE_nlim, TILE_DLAT, TILE_DLON, DOMAIN_LATS, DOMAIN_LATE, DOMAIN_LONS, DOMAIN_LONE, catalog_fname, GLOBAL_IA, TILE_nmax, TILE_fname, TILE_hit, TILE_JS, TILE_JE, TILE_IS, TILE_IE, nLATH, nLONH, jsh, jeh, ish, ieh, single_fname, LATS, LATE, LONS, LONE)
get tile information
real(rp), dimension(:,:), allocatable, public topo_zsfc
absolute ground height [m]
real(rp), dimension(:,:), allocatable, public atmos_grid_cartesc_real_latxv
latitude at staggered point (xv) [rad,-pi,pi]
subroutine, public interp_factor2d(npoints, IA_ref, JA_ref, lon_ref, lat_ref, IA, JA, lon, lat, idx_i, idx_j, hfact, search_limit, latlon_structure, weight_order)
logical, public cnvtopo_usegmted2010