◆ scrip()
| subroutine scrip_interface::scrip |
( |
integer (scrip_i4), intent(in) |
src_num, |
|
|
integer (scrip_i4), intent(in) |
dst_num, |
|
|
logical (scrip_logical), intent(in) |
l_master, |
|
|
logical( scrip_logical), intent(in) |
l_read, |
|
|
logical(scrip_logical), intent(in) |
l_test |
|
) |
| |
Definition at line 330 of file scrip_interface.F90.
356 character (SCRIP_charLength) :: &
365 integer (SCRIP_i4) :: &
374 integer (SCRIP_i4),
intent(in) :: dst_num
375 integer (SCRIP_i4),
intent(in) :: src_num
376 logical (SCRIP_Logical),
intent(in) :: l_master
377 logical( SCRIP_Logical),
intent(in) :: l_read
378 logical(SCRIP_Logical),
intent(in) :: l_test
387 integer (SCRIP_i4) :: n, &
390 integer (SCRIP_i4) :: &
393 character (12),
parameter :: &
394 rtnName =
'SCRIP_driver'
397 character (LEN=3) :: cdst
398 character (LEN=3) :: csrc
401 CHARACTER (LEN=10) :: CDATE_TIME(3)
402 INTEGER :: DATE_TIME(8)
403 INTEGER :: ELAPSED_TIME, BEG_TIME, END_TIME
433 interp_file1 =
"rmp_src_to_dst_conserv_XXX_XXX.nc"
434 interp_file2 =
'not_used.nc'
435 map1_name =
'source to destination Conservative Mapping'
436 map2_name =
'map not used'
437 write(cdst,
"(i3.3)") dst_num
438 write(csrc,
"(i3.3)") src_num
439 interp_file1(24:26) = csrc
440 interp_file1(28:30) = cdst
443 map_method =
'conservative'
444 normalize_opt =
'fracarea'
455 select case(map_method)
456 case (
'conservative')
473 call scrip_driverexit(errorcode,
'unknown mapping method')
476 select case(normalize_opt(1:4))
484 call scrip_errorset(errorcode, rtnname,
'unknown normalization option')
485 call scrip_driverexit(errorcode,
'unknown normalization option')
498 call grid_init( errorcode,l_master,l_test)
524 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
525 beg_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
530 if(l_master)
write(
scrip_stdout, *)
'Reading remapping data from ', interp_file1
534 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
535 end_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
536 elapsed_time = end_time - beg_time
537 write(0,*)
"SCRIP: READING ", elapsed_time,
" MSEC"
545 if(l_master)
write(
scrip_stdout,*)
'calling remap_conserv'
549 if(l_master)
write(
scrip_stdout,*)
'back from remap_conserv'
550 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
551 end_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
552 elapsed_time = end_time - beg_time
553 write(0,*)
"SCRIP: CALCULATING ", elapsed_time,
" MSEC"
557 call scrip_driverexit(errorcode,
'Invalid Map Type')
567 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
568 beg_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
590 write(
scrip_stdout, *)
'Writing remapping data to ', interp_file1
595 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
596 end_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
597 elapsed_time = end_time - beg_time
598 write(0,*)
"SCRIP: RESIZING ", elapsed_time,
" MSEC"
599 call date_and_time (cdate_time(1), cdate_time(2), cdate_time(3), date_time)
600 beg_time = ((date_time(5)*60 + date_time(6))*60 +date_time(7))*1000 + date_time(8)
608 call write_remap(map1_name, map2_name, interp_file1, interp_file2, &
609 output_opt, l_master, errorcode)
References scrip_remap_vars::grid1_add_map1, scrip_grids::grid1_name, scrip_remap_vars::grid2_add_map1, scrip_grids::grid2_name, scrip_grids::grid_init(), scrip_remap_vars::init_remap_vars(), scrip_grids::luse_grid1_area, scrip_grids::luse_grid2_area, scrip_grids::luse_grid_centers, scrip_remap_vars::map_type, scrip_remap_vars::map_type_bicubic, scrip_remap_vars::map_type_bilinear, scrip_remap_vars::map_type_conserv, scrip_remap_vars::map_type_distwgt, scrip_remap_vars::map_type_particle, scrip_remap_vars::max_links_map1, scrip_remap_vars::max_links_map2, scrip_timers::max_timers, scrip_remap_vars::norm_opt, scrip_remap_vars::norm_opt_dstarea, scrip_remap_vars::norm_opt_frcarea, scrip_remap_vars::norm_opt_none, scrip_grids::north_thresh, scrip_grids::npseg, scrip_remap_conservative::nthreads, scrip_remap_vars::num_links_map1, scrip_remap_vars::num_links_map2, scrip_remap_vars::num_maps, scrip_grids::num_srch_bins, scrip_remap_read::read_remap_ww3(), scrip_remap_conservative::remap_conserv(), scrip_remap_vars::resize_remap_vars(), scrip_grids::restrict_type, scrip_driverexit(), scrip_errormod::scrip_errorset(), scrip_iounitsmod::scrip_stdout, scrip_errormod::scrip_success, sort_add_v2(), scrip_grids::south_thresh, scrip_timers::timer_clear(), scrip_timers::timers_init(), scrip_remap_write::write_remap(), scrip_remap_write::write_remap_ww3(), and scrip_remap_vars::wts_map1.
Referenced by wmscrpmd::scrip_wrapper().
◆ scrip_clear()
| subroutine scrip_interface::scrip_clear |
Definition at line 82 of file scrip_interface.F90.
References scrip_remap_conservative::avoid_pole_count, scrip_remap_conservative::avoid_pole_offset, scrip_grids::bin_addr1, scrip_grids::bin_addr2, scrip_grids::bin_lats, scrip_grids::bin_lons, scrip_remap_conservative::first_call_find_adj_cell, scrip_remap_conservative::first_call_get_srch_cells, scrip_remap_conservative::first_call_locate_point, scrip_remap_conservative::first_call_locate_segstart, scrip_remap_conservative::first_call_store_link_cnsrv, scrip_remap_vars::grid1_add_map1, scrip_remap_vars::grid1_add_map2, scrip_grids::grid1_area, scrip_grids::grid1_area_in, scrip_grids::grid1_bound_box, scrip_grids::grid1_center_lat, scrip_grids::grid1_center_lon, scrip_grids::grid1_centroid_lat, scrip_grids::grid1_centroid_lon, scrip_grids::grid1_corner_lat, scrip_grids::grid1_corner_lon, scrip_grids::grid1_corners, scrip_grids::grid1_dims, scrip_grids::grid1_frac, scrip_grids::grid1_mask, scrip_grids::grid1_name, scrip_grids::grid1_rank, scrip_grids::grid1_size, scrip_grids::grid1_units, scrip_remap_vars::grid2_add_map1, scrip_remap_vars::grid2_add_map2, scrip_grids::grid2_area, scrip_grids::grid2_area_in, scrip_grids::grid2_bound_box, scrip_grids::grid2_center_lat, scrip_grids::grid2_center_lon, scrip_grids::grid2_centroid_lat, scrip_grids::grid2_centroid_lon, scrip_grids::grid2_corner_lat, scrip_grids::grid2_corner_lon, scrip_grids::grid2_corners, scrip_grids::grid2_dims, scrip_grids::grid2_frac, scrip_grids::grid2_mask, scrip_grids::grid2_name, scrip_grids::grid2_rank, scrip_grids::grid2_size, scrip_grids::grid2_units, scrip_remap_conservative::last_cell_add_get_srch_cells, scrip_remap_conservative::last_cell_find_adj_cell, scrip_remap_conservative::last_cell_grid_num_find_adj_cell, scrip_remap_conservative::last_cell_grid_num_get_srch_cells, scrip_remap_conservative::last_cell_grid_num_locate_point, scrip_remap_conservative::last_cell_grid_num_locate_segstart, scrip_remap_conservative::last_cell_locate_point, scrip_remap_conservative::last_cell_locate_segstart, scrip_remap_conservative::last_srch_grid_num_get_srch_cells, scrip_remap_conservative::last_srch_grid_num_locate_point, scrip_remap_conservative::last_srch_grid_num_locate_segstart, scrip_remap_conservative::link_add1, scrip_remap_conservative::link_add2, scrip_grids::luse_grid1_area, scrip_grids::luse_grid2_area, scrip_grids::luse_grid_centers, scrip_remap_vars::map_type, scrip_remap_vars::max_links_map1, scrip_remap_vars::max_links_map2, scrip_remap_vars::norm_opt, scrip_remap_vars::num_links_map1, scrip_remap_vars::num_links_map2, scrip_remap_vars::num_maps, scrip_grids::num_srch_bins, scrip_remap_conservative::num_srch_cell_locate_points, scrip_remap_conservative::num_srch_cells_find_adj_cell, scrip_remap_conservative::num_srch_cells_loc_get_srch_cells, scrip_remap_conservative::num_srch_cells_locate_segstart, scrip_remap_vars::num_wts, scrip_remap_vars::resize_increment, scrip_grids::restrict_type, scrip_grids::special_polar_cell1, scrip_grids::special_polar_cell2, scrip_remap_conservative::srch_add_find_adj_cell, scrip_remap_conservative::srch_add_loc_get_srch_cells, scrip_remap_conservative::srch_add_locate_point, scrip_remap_conservative::srch_add_locate_segstart, scrip_remap_conservative::srch_center_lat_find_adj_cell, scrip_remap_conservative::srch_center_lat_loc_get_srch_cells, scrip_remap_conservative::srch_center_lat_locate_point, scrip_remap_conservative::srch_center_lat_locate_segstart, scrip_remap_conservative::srch_center_lon_find_adj_cell, scrip_remap_conservative::srch_center_lon_loc_get_srch_cells, scrip_remap_conservative::srch_center_lon_locate_point, scrip_remap_conservative::srch_center_lon_locate_segstart, scrip_remap_conservative::srch_corner_lat_find_adj_cell, scrip_remap_conservative::srch_corner_lat_loc_get_srch_cells, scrip_remap_conservative::srch_corner_lat_locate_point, scrip_remap_conservative::srch_corner_lat_locate_segstart, scrip_remap_conservative::srch_corner_lon_find_adj_cell, scrip_remap_conservative::srch_corner_lon_loc_get_srch_cells, scrip_remap_conservative::srch_corner_lon_locate_point, scrip_remap_conservative::srch_corner_lon_locate_segstart, scrip_remap_conservative::srch_corners_find_adj_cell, scrip_remap_conservative::srch_corners_loc_get_srch_cells, scrip_remap_conservative::srch_corners_locate_point, scrip_remap_conservative::srch_corners_locate_segstart, scrip_timers::timers_init(), scrip_remap_vars::wts_map1, and scrip_remap_vars::wts_map2.
Referenced by wmscrpmd::scrip_wrapper().
◆ scrip_driverexit()
| subroutine scrip_interface::scrip_driverexit |
( |
integer (scrip_i4), intent(in) |
errorCode, |
|
|
character*(*), intent(in) |
errormsg |
|
) |
| |
Definition at line 626 of file scrip_interface.F90.
638 integer (SCRIP_i4),
intent(in) :: &
641 CHARACTER*(*),
INTENT(IN) :: errormsg
649 write(*,*)
'error encountered : ',errorcode
Referenced by scrip().
◆ sort_add_v2()
| subroutine scrip_interface::sort_add_v2 |
( |
integer (scrip_i4), dimension(:), intent(inout) |
add1, |
|
|
integer (scrip_i4), dimension(:), intent(inout) |
add2, |
|
|
real (scrip_r8), dimension(:,:), intent(inout) |
weights |
|
) |
| |
Definition at line 660 of file scrip_interface.F90.
681 integer (SCRIP_i4),
intent(inout),
dimension(:) :: &
685 real (SCRIP_r8),
intent(inout),
dimension(:,:) :: &
694 integer (SCRIP_i4) :: &
699 chk_lvl1, chk_lvl2, max_lvl
701 real (SCRIP_r8),
dimension(SIZE(weights,DIM=1)) :: &
710 num_links =
SIZE(add1)
720 do lvl=num_links/2,1,-1
725 wgttmp(:) = weights(:,lvl)
738 chk_lvl1 = 2*final_lvl
739 chk_lvl2 = 2*final_lvl+1
740 if (chk_lvl1 .EQ. num_links) chk_lvl2 = chk_lvl1
742 if ((add1(chk_lvl1) > add1(chk_lvl2)) .OR. &
743 ((add1(chk_lvl1) == add1(chk_lvl2)) .AND. &
744 (add2(chk_lvl1) > add2(chk_lvl2))))
then
755 if ((add1_tmp .GT. add1(max_lvl)) .OR. &
756 ((add1_tmp .EQ. add1(max_lvl)) .AND. &
757 (add2_tmp .GT. add2(max_lvl))))
then
758 add1(final_lvl) = add1_tmp
759 add2(final_lvl) = add2_tmp
760 weights(:,final_lvl) = wgttmp(:)
771 add1(final_lvl) = add1(max_lvl)
772 add2(final_lvl) = add2(max_lvl)
773 weights(:,final_lvl) = weights(:,max_lvl)
776 if (2*final_lvl > num_links)
then
777 add1(final_lvl) = add1_tmp
778 add2(final_lvl) = add2_tmp
779 weights(:,final_lvl) = wgttmp(:)
793 do lvl=num_links,3,-1
805 wgttmp(:) = weights(:,lvl)
806 weights(:,lvl) = weights(:,1)
821 chk_lvl1 = 2*final_lvl
822 chk_lvl2 = 2*final_lvl+1
823 if (chk_lvl2 >= lvl) chk_lvl2 = chk_lvl1
825 if ((add1(chk_lvl1) > add1(chk_lvl2)) .OR. &
826 ((add1(chk_lvl1) == add1(chk_lvl2)) .AND. &
827 (add2(chk_lvl1) > add2(chk_lvl2))))
then
838 if ((add1_tmp > add1(max_lvl)) .OR. &
839 ((add1_tmp == add1(max_lvl)) .AND. &
840 (add2_tmp > add2(max_lvl))))
then
841 add1(final_lvl) = add1_tmp
842 add2(final_lvl) = add2_tmp
843 weights(:,final_lvl) = wgttmp(:)
854 add1(final_lvl) = add1(max_lvl)
855 add2(final_lvl) = add2(max_lvl)
856 weights(:,final_lvl) = weights(:,max_lvl)
859 if (2*final_lvl >= lvl)
then
860 add1(final_lvl) = add1_tmp
861 add2(final_lvl) = add2_tmp
862 weights(:,final_lvl) = wgttmp(:)
882 wgttmp(:) = weights(:,2)
883 weights(:,2) = weights(:,1)
884 weights(:,1) = wgttmp(:)
Referenced by scrip().
◆ wgtdata
| type(weight_data), dimension(:), allocatable scrip_interface::wgtdata |
integer(scrip_i4), save srch_corners_locate_point
real(scrip_r8), save avoid_pole_offset
real(scrip_r8), dimension(:), allocatable, target, save grid2_centroid_lat
integer(scrip_i4), parameter norm_opt_none
integer(scrip_i4), save grid1_corners
integer(scrip_i4), dimension(:), allocatable, save grid1_add_map1
logical(scrip_logical), dimension(:), allocatable, target, save grid1_mask
integer(scrip_i4), save srch_corners_locate_segstart
real(scrip_r8), dimension(:), allocatable, save srch_center_lat_locate_point
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lon_locate_segstart
real(scrip_r8), dimension(:), allocatable, save srch_center_lon_locate_segstart
integer(scrip_i4), save last_cell_grid_num_get_srch_cells
integer(scrip_i4), parameter map_type_bilinear
real(scrip_r8), dimension(:), allocatable, target, save grid1_centroid_lat
integer(scrip_i4), save num_maps
integer(scrip_i4), save last_cell_locate_segstart
character(scrip_charlength), save grid2_units
logical(scrip_logical), save luse_grid2_area
logical(scrip_logical), save first_call_locate_point
integer(scrip_i4), dimension(:,:), allocatable, save link_add2
real(scrip_r8), dimension(:), allocatable, target, save grid2_centroid_lon
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lon_loc_get_srch_cells
integer(scrip_i4), save num_srch_bins
integer(scrip_i4), save last_srch_grid_num_locate_segstart
integer(scrip_i4), save last_cell_grid_num_locate_point
integer(scrip_i4), save num_links_map1
integer(scrip_i4), parameter max_timers
integer(scrip_i4), save grid2_rank
subroutine remap_conserv(l_master, l_test)
logical(scrip_logical), dimension(:), allocatable, target, save grid2_mask
integer(scrip_i4), save norm_opt
real(scrip_r8), dimension(:), allocatable, target, save grid2_center_lat
integer(scrip_i4), dimension(:), allocatable, save srch_add_find_adj_cell
real(scrip_r8), dimension(:,:), allocatable, save bin_lats
integer(scrip_i4), save max_links_map2
integer(scrip_i4), save last_cell_locate_point
logical(scrip_logical), save first_call_locate_segstart
real(scrip_r8), dimension(:), allocatable, save srch_center_lon_locate_point
integer(scrip_i4), save grid1_rank
integer(scrip_i4), save num_links_map2
real(scrip_r8), dimension(:), allocatable, target, save grid1_area
real(scrip_r8), save north_thresh
integer(scrip_i4), save map_type
logical(scrip_logical), save luse_grid_centers
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lat_locate_point
real(kind=scrip_r8), parameter tiny
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lon_find_adj_cell
logical(scrip_logical), dimension(:), allocatable, target, save special_polar_cell2
character(scrip_charlength), save restrict_type
integer(scrip_i4), save last_srch_grid_num_get_srch_cells
integer(scrip_i4), save grid2_corners
real(scrip_r8), dimension(:), allocatable, target, save grid1_area_in
integer(scrip_i4), save num_srch_cell_locate_points
integer(scrip_i4), parameter map_type_particle
subroutine, public scrip_errorset(errorCode, rtnName, errorMsg)
integer(scrip_i4), save last_cell_find_adj_cell
real(scrip_r8), dimension(:), allocatable, target, save grid1_centroid_lon
real(scrip_r8), dimension(:,:), allocatable, target, save grid1_bound_box
real(scrip_r8), dimension(:,:), allocatable, save bin_lons
integer(scrip_i4), dimension(:), allocatable, save grid2_add_map2
real(scrip_r8), dimension(:,:), allocatable, target, save grid2_corner_lat
integer(scrip_i4), parameter norm_opt_frcarea
integer(scrip_i4), dimension(:), allocatable, save grid1_dims
integer(scrip_i4), save max_links_map1
integer(scrip_i4), save num_srch_cells_locate_segstart
real(scrip_r8), dimension(:), allocatable, save srch_center_lat_find_adj_cell
logical(scrip_logical), save luse_grid1_area
real(scrip_r8), dimension(:), allocatable, target, save grid1_center_lon
real(scrip_r8), dimension(:), allocatable, target, save grid2_area
subroutine timer_clear(timer)
integer(scrip_i4), parameter, public scrip_success
real(scrip_r8), dimension(:,:), allocatable, target, save grid1_corner_lat
real(scrip_r8), dimension(:), allocatable, save srch_center_lon_loc_get_srch_cells
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lat_find_adj_cell
integer(scrip_i4), save grid2_size
character(scrip_charlength), save grid1_name
integer(scrip_i4), dimension(:,:), allocatable, save bin_addr2
character(scrip_charlength), save grid2_name
integer(scrip_i4), save last_cell_grid_num_locate_segstart
integer(scrip_i4) nthreads
integer(scrip_i4), save last_cell_add_get_srch_cells
subroutine write_remap_ww3(map1_name, interp_file1, output_opt, l_master, errorCode)
subroutine grid_init(errorCode, l_master, l_test)
real(scrip_r8), dimension(:,:), allocatable, save wts_map1
integer(scrip_i4), dimension(:,:), allocatable, save link_add1
integer(scrip_i4), dimension(:), allocatable, save srch_add_locate_point
subroutine resize_remap_vars(nmap, increment)
integer(scrip_i4), save last_cell_grid_num_find_adj_cell
real(scrip_r8), dimension(:), allocatable, target, save grid2_area_in
integer(scrip_i4), parameter map_type_distwgt
integer(scrip_i4), save num_srch_cells_loc_get_srch_cells
integer(scrip_i4), dimension(:), allocatable, save grid2_dims
subroutine read_remap_ww3(map_name, interp_file, errorCode)
real(scrip_r8), dimension(:), allocatable, target, save grid1_center_lat
subroutine init_remap_vars
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lat_loc_get_srch_cells
integer(scrip_i4), save num_srch_cells_find_adj_cell
real(scrip_r8), dimension(:,:), allocatable, target, save grid1_corner_lon
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lon_locate_point
integer(scrip_i4), save npseg
integer(scrip_i4), parameter map_type_conserv
integer(scrip_i4), dimension(:), allocatable, save grid1_add_map2
integer(scrip_i4), dimension(:), allocatable, save grid2_add_map1
real(scrip_r8), save south_thresh
real(scrip_r8), dimension(:,:), allocatable, save srch_corner_lat_locate_segstart
integer(scrip_i4), save grid1_size
logical(scrip_logical), save first_call_find_adj_cell
real(scrip_r8), dimension(:), allocatable, save srch_center_lon_find_adj_cell
integer(scrip_i4), parameter map_type_bicubic
real(scrip_r8), dimension(:,:), allocatable, save wts_map2
real(scrip_r8), dimension(:,:), allocatable, target, save grid2_bound_box
real(scrip_r8), dimension(:,:), allocatable, target, save grid2_corner_lon
real(scrip_r8), dimension(:), allocatable, target, save grid1_frac
integer(scrip_i4), save srch_corners_find_adj_cell
real(scrip_r8), dimension(:), allocatable, save srch_center_lat_loc_get_srch_cells
subroutine write_remap(map1_name, map2_name, interp_file1, interp_file2, output_opt, l_master, errorCode)
integer(scrip_i4), save srch_corners_loc_get_srch_cells
integer(scrip_i4), dimension(:), allocatable, save srch_add_loc_get_srch_cells
character(scrip_charlength), save grid1_units
integer(scrip_i4), parameter norm_opt_dstarea
integer(scrip_i4), dimension(:), allocatable, save srch_add_locate_segstart
integer(scrip_i4), save avoid_pole_count
integer(scrip_i4), save last_srch_grid_num_locate_point
integer(scrip_i4), parameter, public scrip_stdout
logical(scrip_logical), save first_call_store_link_cnsrv
logical(scrip_logical), dimension(:), allocatable, target, save special_polar_cell1
integer(scrip_i4), save num_wts
logical(scrip_logical), save first_call_get_srch_cells
real(scrip_r8), dimension(:), allocatable, target, save grid2_frac
integer(scrip_i4), dimension(:,:), allocatable, save bin_addr1
real(scrip_r8), dimension(:), allocatable, target, save grid2_center_lon
real(scrip_r8), dimension(:), allocatable, save srch_center_lat_locate_segstart
integer(scrip_i4), save resize_increment