diff --git a/test_fms/mosaic/test_grid2.F90 b/test_fms/mosaic/test_grid2.F90 index 2fbaa0ad06..7cb4bfc995 100644 --- a/test_fms/mosaic/test_grid2.F90 +++ b/test_fms/mosaic/test_grid2.F90 @@ -78,11 +78,11 @@ subroutine test_get_cell_vertices !---- 2d ---! !> answers. Only testing for tile 1 - answer_lon_2d(1,1)=305.0 ; answer_lon_2d(2,1)=35.0 - answer_lon_2d(1,2)=305.0 ; answer_lon_2d(2,2)=35.0 + answer_lon_2d(1,1)=x(1,1) ; answer_lon_2d(2,1)=x(3,1) + answer_lon_2d(1,2)=x(1,3) ; answer_lon_2d(2,2)=x(3,3) - answer_lat_2d(1,1)=-35.2643896827547 ; answer_lat_2d(2,1)=-35.2643896827547 - answer_lat_2d(1,2)=35.2643896827547 ; answer_lat_2d(2,2)=35.2643896827547 + answer_lat_2d(1,1)=y(1,1) ; answer_lat_2d(2,1)=y(3,1) + answer_lat_2d(1,2)=y(1,3) ; answer_lat_2d(2,2)=y(3,3) call get_grid_cell_vertices('ATM',1,lonb_2d,latb_2d) !> check @@ -123,8 +123,8 @@ subroutine test_get_cell_centers !--- 2d ---! !> assign answers for 2d - answer_glon_2d(1,1)=350.0 - answer_glat_2d(1,1)=0.0 + answer_glon_2d(1,1)=x(2,2) + answer_glat_2d(1,1)=y(2,2) call get_grid_cell_centers('ATM', 1, glon_2d, glat_2d) do i=1, npt_x diff --git a/test_fms/mosaic/test_mosaic.F90 b/test_fms/mosaic/test_mosaic.F90 index 79508052af..a3283ffacd 100644 --- a/test_fms/mosaic/test_mosaic.F90 +++ b/test_fms/mosaic/test_mosaic.F90 @@ -42,11 +42,22 @@ program test_mosaic !! In this case, the grid_version is VERSION_OCN_MOSAIC_FILE. call fms_init() +write(*,*) 'TEST GET_MOSAIC_GRID_SIZES' call test_get_mosaic_grid_sizes() + +write(*,*) 'TEST GET_MOSAIC_CONTACT' call test_get_mosaic_contact() + +write(*,*) 'TEST GET_GRID_GREAT_CIRCLE_AREA' call test_get_grid_great_circle_area() + +write(*,*) 'TEST GET_GRID_AREA' call test_get_grid_area() + +write(*,*) 'TEST GET_MOSAIC_XGRID' call test_get_mosaic_xgrid() + +write(*,*) 'TEST IS_INSIDE_POLYGON' call test_is_inside_polygon() call fms_end() @@ -62,15 +73,11 @@ subroutine test_get_mosaic_grid_sizes integer, allocatable :: nx_out(:), ny_out(:) type(FmsNetcdfFile_t):: fileobj - integer, allocatable :: pes(:) !-- ocean --! - allocate(pes(mpp_npes())) - call mpp_get_current_pelist(pes) - if( .not. open_file(fileobj, 'INPUT/'//trim(ocn_mosaic_file), 'read', pelist=pes) ) & + if( .not. open_file(fileobj, 'INPUT/'//trim(ocn_mosaic_file), 'read') ) & call mpp_error(FATAL, 'test_mosaic: error in opening file '//'INPUT/'//trim(ocn_mosaic_file)) - allocate( nx_out(ocn_ntiles), ny_out(ocn_ntiles) ) !> get_mosaic_grid_sizes reads in the grid file call get_mosaic_grid_sizes(fileobj, nx_out, ny_out ) @@ -82,7 +89,7 @@ subroutine test_get_mosaic_grid_sizes call close_file(fileobj) !-- atm --! - if( .not. open_file(fileobj, 'INPUT/'//trim(c1_mosaic_file), 'read', pelist=pes) ) & + if( .not. open_file(fileobj, 'INPUT/'//trim(c1_mosaic_file), 'read') ) & call mpp_error(FATAL, 'test_mosaic: error in opening file '//'INPUT/'//trim(c1_mosaic_file)) allocate( nx_out(c1_ntiles), ny_out(c1_ntiles) ) @@ -112,11 +119,8 @@ subroutine test_get_mosaic_contact integer :: answers(2, 8) !< Expected results type(FmsNetcdfFile_t):: ocn_fileobj - integer, allocatable :: pes(:) - allocate(pes(mpp_npes())) - call mpp_get_current_pelist(pes) - if( .not. open_file(ocn_fileobj, 'INPUT/'//trim(ocn_mosaic_file), 'read', pelist=pes) ) & + if( .not. open_file(ocn_fileobj, 'INPUT/'//trim(ocn_mosaic_file), 'read') ) & call mpp_error(FATAL, 'test_mosaic: error in opening file '//'INPUT/'//trim(ocn_mosaic_file)) answers(1,:) = (/1440, 1440, 1, 1080, 1, 1, 1, 1080 /) @@ -172,76 +176,18 @@ subroutine test_get_grid_area implicit none type(FmsNetcdfFile_t):: c1_fileobj - integer, allocatable :: pes(:) - real :: x_rad(c1_nxp, c1_nyp), y_rad(c1_nxp, c1_nyp) - real :: area_out(c1_nx,c1_ny), area_answer(c1_nx, c1_ny), area_w_pole_answer(c1_nx, c1_ny) + real :: x_rad(c1_nx, c1_ny), y_rad(c1_nx, c1_ny) + real :: area_out(1,1) integer :: i,j !> get answers. Tile 1 will be the reference/benchmark data - x_rad = x1 * DEG_TO_RAD - y_rad = y1 * DEG_TO_RAD - call calc_mosaic_grid_area(x_rad, y_rad, area_answer) - write(*,*) area_answer - write(*,*)'***' - - !> Tile 2 area should be the same as tile 1 area - x_rad = x2 * DEG_TO_RAD - y_rad = y2 * DEG_TO_RAD - call calc_mosaic_grid_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 2 ') - end do - end do - write(*,*) area_out - write(*,*)'***' - - !> Tile 3 area should be the same as tile 1 area - x_rad = x3 * DEG_TO_RAD - y_rad = y3 * DEG_TO_RAD - call calc_mosaic_grid_area(x_rad, y_rad, area_w_pole_answer) - write(*,*) area_w_pole_answer - write(*,*)'***' - - !> Tile 4 area should be the same as tile 1 area - x_rad = x4 * DEG_TO_RAD - y_rad = y4 * DEG_TO_RAD - call calc_mosaic_grid_area(x_rad, y_rad, area_out) - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 4') - end do - end do - write(*,*) area_out - write(*,*)'***' - - !> Tile 5 area should be the same as tile 1 area - x_rad = x5 * DEG_TO_RAD - y_rad = y5 * DEG_TO_RAD - call calc_mosaic_grid_area(x_rad, y_rad, area_out) - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 5') - end do - end do - write(*,*) area_out - write(*,*)'***' + x_rad = x(1:2, 1:2) * DEG_TO_RAD + y_rad = y(1:2, 1:2) * DEG_TO_RAD - !> Tile 6 area should be the same as tile 3 area - x_rad = x6 * DEG_TO_RAD - y_rad = y6 * DEG_TO_RAD call calc_mosaic_grid_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_w_pole_answer(i,j), area_out(i,j), 'test_grid_area tile 6') - end do - end do - write(*,*) area_out - write(*,*)'***' + call check_answer(area_out(1,1), area(1,1), 'TEST_GET_GRID_AREA') end subroutine test_get_grid_area !------------------------------------------------------! @@ -259,70 +205,16 @@ subroutine test_get_grid_great_circle_area type(FmsNetcdfFile_t):: c1_fileobj integer, allocatable :: pes(:) - real :: x_rad(c1_nxp, c1_nyp), y_rad(c1_nxp, c1_nyp) - real :: area_out(c1_nx,c1_ny), area_answer(c1_nx, c1_ny) + real :: x_rad(c1_nx, c1_ny), y_rad(c1_nx, c1_ny) + real :: area_out(1,1) integer :: i,j !> get answers. Tile 1 will be the reference/benchmark data - x_rad = x1 * DEG_TO_RAD - y_rad = y1 * DEG_TO_RAD - call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_answer) - - !> Tile 2 areas should be the same as tile 1 area - x_rad = x2 * DEG_TO_RAD - y_rad = y2 * DEG_TO_RAD - call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 2 ') - end do - end do - - !> Tile 3 area should be the same as tile 1 area - x_rad = x3 * DEG_TO_RAD - y_rad = y3 * DEG_TO_RAD - call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 3') - end do - end do - - !> Tile 4 area should be the same as tile 1 area - x_rad = x4 * DEG_TO_RAD - y_rad = y4 * DEG_TO_RAD + x_rad = x(1:2, 1:2) * DEG_TO_RAD + y_rad = y(1:2, 1:2) * DEG_TO_RAD call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 4') - end do - end do - - !> Tile 5 area should be the same as tile 1 area - x_rad = x5 * DEG_TO_RAD - y_rad = y5 * DEG_TO_RAD - call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 5') - end do - end do - - !> Tile 6 area should be the same as tile 1 area - x_rad = x6 * DEG_TO_RAD - y_rad = y6 * DEG_TO_RAD - call calc_mosaic_grid_great_circle_area(x_rad, y_rad, area_out) - !> check answers - do j=1, c1_ny - do i=1, c1_nx - call check_answer_w_tol(area_answer(i,j), area_out(i,j), 'test_grid_area tile 6') - end do - end do + call check_answer(area_out(1,1), area(1,1), 'TEST_GET_GRID_AREA') end subroutine test_get_grid_great_circle_area !------------------------------------------------------! diff --git a/test_fms/mosaic/test_mosaic2.sh b/test_fms/mosaic/test_mosaic2.sh index 0cd7b5c2ab..2089a39b2c 100755 --- a/test_fms/mosaic/test_mosaic2.sh +++ b/test_fms/mosaic/test_mosaic2.sh @@ -31,13 +31,9 @@ touch input.nml rm -rf INPUT mkdir INPUT -#test_expect_success "test mosaic" ' -# mpirun -n 2 ./test_mosaic -#' +test_expect_success "test mosaic" 'mpirun -n 1 ./test_mosaic' -test_expect_success "test grid2" ' - mpirun -n 1 ./test_grid2 -' +test_expect_success "test grid2" 'mpirun -n 1 ./test_grid2' #rm -rf INPUT test_done diff --git a/test_fms/mosaic/write_files.F90 b/test_fms/mosaic/write_files.F90 index b50b4c80c9..2a488f37d8 100644 --- a/test_fms/mosaic/write_files.F90 +++ b/test_fms/mosaic/write_files.F90 @@ -4,7 +4,7 @@ module write_files use fms2_io_mod, only: register_axis, register_field, write_data use mpp_mod, only: mpp_init, mpp_sync, mpp_npes, mpp_get_current_pelist use fms_mod, only: fms_init - use constants_mod, only: PI + use constants_mod, only: PI, RADIUS implicit none @@ -39,13 +39,9 @@ module write_files ! variables for tile1 character(5) :: tile - real, dimension(c1_nxp,c1_nyp) :: x1, x2, x3, x4, x5, x6 - real, dimension(c1_nxp,c1_nyp) :: y1, y2, y3, y4, y5, y6 - real, dimension(c1_nxp,c1_nyp) :: angle_dx1, angle_dx2, angle_dx3, angle_dx4, angle_dx5, angle_dx6 - real, dimension(c1_nxp,c1_nyp) :: angle_dy1, angle_dy2, angle_dy3, angle_dy4, angle_dy5, angle_dy6 - real, dimension(c1_nx,c1_ny) :: area1, area2, area3, area4, area5, area6 - real, dimension(c1_nx,c1_nyp) :: dx1, dx2, dx3, dx4, dx5, dx6 - real, dimension(c1_nxp,c1_ny) :: dy1, dy2, dy3, dy4, dy5, dy6 + real, dimension(c1_nxp,c1_nyp) :: x + real, dimension(c1_nxp,c1_nyp) :: y + real, dimension(c1_nx,c1_ny) :: area !variables for exchange grid cells real, dimension(2,ncells) :: tile1_cell, tile2_cell @@ -156,246 +152,44 @@ subroutine write_c1_mosaic end subroutine write_c1_mosaic !---------------------------------! - subroutine write_c1_tile1 + subroutine write_c1_tiles implicit none character(5) :: tile - tile='tile1' + x(1,1)=0.0 ; x(2,1)=90.0 ; x(3,1)=180.0 + x(1,2)=0.0 ; x(2,2)=90.0 ; x(3,2)=180.0 + x(1,3)=0.0 ; x(2,3)=90.0 ; x(3,3)=180.0 - x1(1,1)=305.0 ; x1(2,1)=350.0 ; x1(3,1)=35.0 - x1(1,2)=305.0 ; x1(2,2)=350.0 ; x1(3,2)=35.0 - x1(1,3)=305.0 ; x1(2,3)=350.0 ; x1(3,3)=35.0 + y(1,1)=0.0 ; y(2,1)=0.0 ; y(3,1)=0.0 + y(1,2)=90.0 ; y(2,2)=90.0 ; y(3,2)=90.0 + y(1,3)=180.0 ; y(2,3)=180.0 ; y(3,3)=180.0 - y1(1,1)=-35.2643896827547 ; y1(2,1)=-45.0 ; y1(3,1)=-35.2643896827547 - y1(1,2)= 0.0000000000000 ; y1(2,2)= 0.0 ; y1(3,2)= 0.0000000000000 - y1(1,3)= 35.2643896827547 ; y1(2,3)= 45.0 ; y1(3,3)= 35.2643896827547 + area(1,1)=PI*RADIUS*RADIUS/2.0 ; area(2,1)=PI*RADIUS*RADIUS/2.0 + area(1,2)=PI*RADIUS*RADIUS/2.0 ; area(2,2)=PI*RADIUS*RADIUS/2.0 - dx1(1,1)=3921221.22393904 ; dx1(2,1)=3921221.22393904 - dx1(1,2)=5003771.69900514 ; dx1(2,2)=5003771.69900514 - dx1(1,3)=3921221.22393904 ; dx1(2,3)=3921221.22393904 + tile='tile1' ; call call_fms2_io(tile1_file, tile, x, y, area) + tile='tile2' ; call call_fms2_io(tile2_file, tile, x, y, area) + tile='tile3' ; call call_fms2_io(tile3_file, tile, x, y, area) + tile='tile4' ; call call_fms2_io(tile4_file, tile, x, y, area) + tile='tile5' ; call call_fms2_io(tile5_file, tile, x, y, area) + tile='tile6' ; call call_fms2_io(tile6_file, tile, x, y, area) - dy1(1,1)=3921221.22393904 ; dy1(2,1)=5003771.69900514 ; dy1(3,1)=3921221.22393904 - dy1(1,2)=3921221.22393904 ; dy1(2,2)=5003771.69900514 ; dy1(3,2)=3921221.22393904 - - area1(1,1)=21252686329574.5 ; area1(2,1)=21252686329574.5 - area1(1,2)=21252686329574.6 ; area1(2,2)=21252686329574.5 - - angle_dx1(1,1)=-12.2083047812356 ; angle_dx1(2,1)=180.0 ; angle_dx1(3,1)= 178.229638007655 - angle_dx1(1,2)= 0.0 ; angle_dx1(2,2)=180.0 ; angle_dx1(3,2)= 180.0 - angle_dx1(1,3)= 12.2083047812356 ; angle_dx1(2,3)=180.0 ; angle_dx1(3,3)=-178.229638007655 - - angle_dy1 = 90.0 - - call call_fms2_io(tile1_file, tile, x1, y1, dx1, dy1, area1, angle_dx1, angle_dy1) - - end subroutine write_c1_tile1 - !-----------------------------------! - subroutine write_c1_tile2 - - implicit none - - character(5) :: tile - - tile='tile2' - - x2(1,1)=35.0 ; x2(2,1)=80.0 ; x2(3,1)=125.0 - x2(1,2)=35.0 ; x2(2,2)=80.0 ; x2(3,2)=125.0 - x2(1,3)=35.0 ; x2(2,3)=80.0 ; x2(3,3)=125.0 - - y2(1,1)=-35.2643896827547 ; y2(2,1)=-45.0 ; ; y2(3,1)=-35.2643896827547 - y2(1,2)= 0.0 ; y2(2,2)= 2.75444115227293e-15 ; y2(3,2)= 3.89536803430295e-15 - y2(1,3)= 35.2643896827547 ; y2(2,3)= 45.0 ; y2(3,3)= 35.2643896827547 - - dx2(1,1)=3921221.22393904 ; dx2(2,1)=3921221.22393904 - dx2(1,2)=5003771.69900514 ; dx2(2,2)=5003771.69900514 - dx2(1,3)=3921221.22393904 ; dx2(2,3)=3921221.22393904 - - dy2(1,1)=3921221.22393904 ; dy2(2,1)=5003771.69900514 ; dy2(3,1)=3921221.22393904 - dy2(1,2)=3921221.22393904 ; dy2(2,2)=5003771.69900514 ; dy2(3,2)=3921221.22393904 - - area2(1,1)=21252686329574.5 ; area2(2,1)=21252686329574.5 - area2(1,2)=21252686329574.6 ; area2(2,2)= 21252686329574.5 - - angle_dx2(1,1)=-12.2083047812356 ; angle_dx2(2,1)=0.000000000000000000 ; angle_dx2(3,1)=45.0016529252264 - angle_dx2(1,2)= 3.50706339871978e-15 ; angle_dx2(2,2)=2.4798683112859e-15 ; angle_dx2(3,2)=38.0841344663695 - angle_dx2(1,3)= 12.2083047812356 ; angle_dx2(2,3)=4.04998849185443e-15 ; angle_dx2(3,3)=-4.12501788256499 - - angle_dy2 = 90.0 - - call call_fms2_io(tile2_file, tile, x2, y2, dx2, dy2, area2, angle_dx2, angle_dy2) - - end subroutine write_c1_tile2 - !-----------------------------------! - subroutine write_c1_tile3 - - implicit none - - character(5) :: tile - - tile='tile3' - - x3(1,1)= 35.0 ; x3(2,1)=80.0 ; x3(3,1)=125.0 - x3(1,2)=350.0 ; x3(2,2)=0.0 ; x3(3,2)=170.0 - x3(1,3)=305.0 ; x3(2,3)=260.0 ; x3(3,3)=215.0 - - y3(1,1)=35.2643896827547 ; y3(2,1)=45.0 ; y3(3,1)=35.2643896827547 - y3(1,2)=45.0 ; y3(2,2)=90.0 ; y3(3,2)=45.0 - y3(1,3)=35.2643896827547 ; y3(2,3)=45.0 ; y3(3,3)=35.2643896827547 - - dx3(1,1)=3921221.22393904 ; dx3(2,1)=3921221.22393904 - dx3(1,2)=5003771.69900514 ; dx3(2,2)=5003771.69900514 - dx3(1,3)=3921221.22393904 ; dx3(2,3)=3921221.22393904 - - dy3(1,1)=3921221.22393904 ; dy3(2,1)=5003771.69900514 ; dy3(3,1)=3921221.22393904 - dy3(1,2)=3921221.22393904 ; dy3(2,2)=5003771.69900514 ; dy3(3,2)=3921221.22393904 - - area3(1,1)=21252686329574.5 ; area3(2,1)=21252686329574.5 - area3(1,2)=21252686329574.6 ; area3(2,2)=21252686329574.5 - - angle_dx3(1,1)=12.2083047812356 ; angle_dx3(2,1)=4.04998849185443e-15 ; angle_dx3(3,1)=-12.2083047812356 - angle_dx3(1,2)=172.67291243803 ; angle_dx3(2,2)=180.000000000000 ; angle_dx3(3,2)=-14.827811681987 - angle_dx3(1,3)=167.791695218764 ; angle_dx3(2,3)=-180.00000000000 ; angle_dx3(3,3)=-167.791695218764 - - angle_dy3(1,1)=1.77036199234526 ; angle_dy3(2,1)=150.639946160165 ; angle_dy3(3,1)=12.2083047812356 - angle_dy3(1,2)=0 ; angle_dy3(2,2)=-4.05113034111413e-15; angle_dy3(3,2)=-1.61999539674177e-14 - angle_dy3(1,3)=-167.791695218764; angle_dy3(2,3)=-9.82020528879405; angle_dy3(3,3)=-12.2083047812356 - - call call_fms2_io(tile3_file, tile, x3, y3, dx3, dy3, area3, angle_dx3, angle_dy3) - - end subroutine write_c1_tile3 - !-----------------------------------! - subroutine write_c1_tile4 - - implicit none - - character(5) :: tile - - tile='tile4' - - x4(1,1)=125.0 ; x4(2,1)=125.0 ; x4(3,1)=125.0 - x4(1,2)=170.0 ; x4(2,2)=170.0 ; x4(3,2)=170.0 - x4(1,3)=215.0 ; x4(2,3)=215.0 ; x4(3,3)=215.0 - - y4(1,1)=35.2643896827547 ; y4(2,1)=3.89536803430295e-15 ; y4(3,1)=-35.2643896827547 - y4(1,2)=45.0000000000000 ; y4(2,2)=8.26332345681879e-15 ; y4(3,2)=-45.0000000000000 - y4(1,3)=35.2643896827547 ; y4(2,3)=7.7907360686059e-15 ; y4(3,3)=-35.2643896827546 - - dx4(1,1)=3921221.22393904 ; dx4(2,1)=3921221.22393904 - dx4(1,2)=5003771.69900515 ; dx4(2,2)=5003771.69900515 - dx4(1,3)=3921221.22393904 ; dx4(2,3)=3921221.22393904 - - dy4(1,1)=3921221.22393904 ; dy4(2,1)=5003771.69900515 ; dy4(3,1)=3921221.22393904 - dy4(1,2)=3921221.22393904 ; dy4(2,2)=5003771.69900515 ; dy4(3,2)=3921221.22393904 - - area4(1,1)=21252686329574.5 ; area4(2,1)=21252686329574.5 - area4(1,2)=21252686329574.6 ; area4(2,2)=21252686329574.5 - - angle_dx4(1,1)=-90.0 ; angle_dx4(2,1)=-90.0 ; angle_dx4(3,1)=-45.0016529252264 - angle_dx4(1,2)=-90.0 ; angle_dx4(2,2)=-90.0 ; angle_dx4(3,2)=-38.0867480461066 - angle_dx4(1,3)=-90.0 ; angle_dx4(2,3)=-90.0 ; angle_dx4(3,3)=-21.3976877148648 - - angle_dy4(1,1)=12.2083047812356 ; angle_dy4(2,1)=5.56145357358754e-15 ; angle_dy4(3,1)=-12.2083047812356 - angle_dy4(1,2)=-1.61999539674177e-14 ; angle_dy4(2,2)=2.4798683112859e-15 ; angle_dy4(3,2)=2.02499424592721e-14 - angle_dy4(1,3)=-12.2083047812356 ; angle_dy4(2,3)=-6.01716951015755e-16 ; angle_dy4(3,3)=12.2083047812356 - - call call_fms2_io(tile4_file, tile, x4, y4, dx4, dy4, area4, angle_dx4, angle_dy4) - - end subroutine write_c1_tile4 - !-----------------------------------! - subroutine write_c1_tile5 - - implicit none - - character(5) :: tile - - tile='tile5' - - x5(1,1)=215.0 ; x5(2,1)=215.0 ; x5(3,1)=215.0 - x5(1,2)=260.0 ; x5(2,2)=260.0 ; x5(3,2)=260.0 - x5(1,3)=305.0 ; x5(2,3)=305.0 ; x5(3,3)=305.0 - - y5(1,1)=35.2643896827547 ; y5(2,1)=7.7907360686059e-15 ; y5(3,1)=-35.2643896827546 - y5(1,2)=45.0000000000000 ; y5(2,2)=5.50888230454586e-15 ; y5(3,2)=-45.0000000000000 - y5(1,3)=35.2643896827547 ; y5(2,3)=0.00000000000000 ; y5(3,3)=-35.2643896827547 - - dx5(1,1)=3921221.22393904 ; dx5(2,1)=3921221.22393904 - dx5(1,2)=5003771.69900514 ; dx5(2,2)=5003771.69900514 - dx5(1,3)=3921221.22393904 ; dx5(2,3)=3921221.22393904 - - dy5(1,1)=3921221.22393904 ; dy5(2,1)=5003771.69900514 ; dy5(3,1)=3921221.22393904 - dy5(1,2)=3921221.22393904 ; dy5(2,2)=5003771.69900514 ; dy5(3,2)=3921221.22393904 - - area5(1,1)=21252686329574.5 ; area5(2,1)=21252686329574.5 - area5(1,2)=21252686329574.6 ; area5(2,2)=21252686329574.5 - - angle_dx5 = -90.0 - - angle_dy5(1,1)=12.2083047812356 ; angle_dy5(2,1)=-2.90534644770403e-15 ; angle_dy5(3,1)=-12.2083047812356 - angle_dy5(1,2)=1.21499654755633e-14 ; angle_dy5(2,2)=-4.95973662257179e-15 ; angle_dy5(3,2)=-2.02499424592721e-14 - angle_dy5(1,3)=-12.2083047812356 ; angle_dy5(2,3)=-7.01412679743956e-15 ; angle_dy5(3,3)=12.2083047812355 - - call call_fms2_io(tile5_file, tile, x5, y5, dx5, dy5, area5, angle_dx5, angle_dy5) - - end subroutine write_c1_tile5 + end subroutine write_c1_tiles !-----------------------------------! - subroutine write_c1_tile6 - - implicit none - - character(5) :: tile - - tile='tile6' - - x6(1,1)=215.0 ; x6(2,1)=170.0 ; x6(3,1)=125.0 - x6(1,2)=260.0 ; x6(2,2)=0.0 ; x6(3,2)=80.0 - x6(1,3)=305.0 ; x6(2,3)=350.0 ; x6(3,3)=35.0 - - y6(1,1)=-35.2643896827546 ; y6(2,1)=-45.0 ; y6(3,1)=-35.2643896827547 - y6(1,2)=-45.0000000000000 ; y6(2,2)=-90.0 ; y6(3,2)=-45.0000000000000 - y6(1,3)=-35.2643896827547 ; y6(2,3)=-45.0 ; y6(3,3)=-35.2643896827547 - - dx6(1,1)=3921221.22393904 ; dx6(2,1)=3921221.22393904 - dx6(1,2)=5003771.69900514 ; dx6(2,2)=5003771.69900514 - dx6(1,3)=3921221.22393904 ; dx6(2,3)=3921221.22393904 - - dy6(1,1)=3921221.22393904 ; dy6(2,1)=5003771.69900514 ; dy6(3,1)=3921221.22393904 - dy6(1,2)=3921221.22393904 ; dy6(2,2)=5003771.69900514 ; dy6(3,2)=3921221.22393904 - - area6(1,1)=21252686329574.5 ; area6(2,1)=21252686329574.5 - area6(1,2)=21252686329574.6 ; area6(2,2)=21252686329574.5 - - angle_dx6(1,1)=-167.791695218764 ; angle_dx6(2,1)=-180.0 ; angle_dx6(3,1)=-180.0 - angle_dx6(1,2)=-170.179794711206 ; angle_dx6(2,2)=-180.0 ; angle_dx6(3,2)=57.4060711511999 - angle_dx6(1,3)=-12.2083047812356 ; angle_dx6(2,3)=180.0 ; angle_dx6(3,3)=165.704009005321 - - angle_dy6(1,1)=-12.2083047812356 ; angle_dy6(2,1)=-165.172188318013 ; angle_dy6(3,1)=-167.791695218764 - angle_dy6(1,2)=-2.02499424592721e-14 ; angle_dy6(2,2)=-4.05113034111413e-15 ; angle_dy6(3,2)=180.0 - angle_dy6(1,3)=12.2083047812355 ; angle_dy6(2,3)=7.32708756196959 ; angle_dy6(3,3)=167.791695218764 - - call call_fms2_io(tile6_file, tile, x6, y6, dx6, dy6, area6, angle_dx6, angle_dy6) - - end subroutine write_c1_tile6 - !-----------------------------------! - subroutine call_fms2_io(filename, tile, x, y, dx, dy, area, angle_dx, angle_dy) + subroutine call_fms2_io(filename, tile, x_in, y_in, area_in) implicit none character(*) :: filename character(*) :: tile - real, dimension(c1_nxp,c1_nyp), intent(in) :: x, y, angle_dx, angle_dy - real, dimension(c1_nx,c1_ny), intent(in) :: area - real, dimension(c1_nx,c1_nyp), intent(in) :: dx - real, dimension(C1_nxp,C1_ny), intent(in) :: dy + real, dimension(c1_nxp,c1_nyp), intent(in) :: x_in, y_in + real, dimension(c1_nx,c1_ny), intent(in) :: area_in type(FmsNetcdfFile_t) :: fileobj - integer, allocatable :: pes(:) - - allocate(pes(mpp_npes())) - call mpp_get_current_pelist(pes) - if( open_file(fileobj, 'INPUT/'//trim(filename), 'overwrite', pelist=pes) ) then + if( open_file(fileobj, 'INPUT/'//trim(filename), 'overwrite') ) then call register_axis(fileobj, "nx", c1_nx) call register_axis(fileobj, "ny", c1_ny) @@ -406,20 +200,12 @@ subroutine call_fms2_io(filename, tile, x, y, dx, dy, area, angle_dx, angle_dy) call register_field(fileobj, 'tile', 'char', dimensions=(/'string'/)) call register_field(fileobj, 'x', 'double', dimensions=(/'nxp', 'nyp'/)) call register_field(fileobj, 'y', 'double', dimensions=(/'nxp', 'nyp'/)) - call register_field(fileobj, 'dx', 'double', dimensions=(/'nx','nyp'/)) - call register_field(fileobj, 'dy', 'double', dimensions=(/'nxp','ny'/)) call register_field(fileobj, 'area', 'double', dimensions=(/'nx','ny'/)) - call register_field(fileobj, 'angle_dx','double',dimensions=(/'nxp','nyp'/)) - call register_field(fileobj, 'angle_dy','double',dimensions=(/'nxp','nyp'/)) call write_data(fileobj, 'tile', trim(tile)) - call write_data(fileobj, 'x', x) - call write_data(fileobj, 'y', y) - call write_data(fileobj, 'dx', dx) - call write_data(fileobj, 'dy', dy) - call write_data(fileobj, 'area', area) - call write_data(fileobj, 'angle_dx', angle_dx) - call write_data(fileobj, 'angle_dy', angle_dy) + call write_data(fileobj, 'x', x_in) + call write_data(fileobj, 'y', y_in) + call write_data(fileobj, 'area', area_in) call close_file(fileobj) @@ -538,12 +324,7 @@ subroutine write_all call write_grid_spec() call write_c1_mosaic() call write_ocean_mosaic() - call write_c1_tile1() - call write_c1_tile2() - call write_c1_tile3() - call write_c1_tile4() - call write_c1_tile5() - call write_c1_tile6() + call write_c1_tiles() call write_hgrid() call write_exchange()