mirror_grid_local_new Subroutine

private subroutine mirror_grid_local_new(local_tile, tileno)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(inout) :: local_tile(:,:,:)
integer, intent(in) :: tileno

Calls

proc~~mirror_grid_local_new~~CallsGraph proc~mirror_grid_local_new mirror_grid_local_new proc~rot_3d_new rot_3d_new proc~mirror_grid_local_new->proc~rot_3d_new proc~cartesian_to_spherical cartesian_to_spherical proc~rot_3d_new->proc~cartesian_to_spherical proc~spherical_to_cartesian spherical_to_cartesian proc~rot_3d_new->proc~spherical_to_cartesian

Called by

proc~~mirror_grid_local_new~~CalledByGraph proc~mirror_grid_local_new mirror_grid_local_new proc~esmf_utilcreatecscoordspar ESMF_UtilCreateCSCoordsPar proc~esmf_utilcreatecscoordspar->proc~mirror_grid_local_new proc~esmf_gridcreatecubedsphereireg ESMF_GridCreateCubedSphereIReg proc~esmf_gridcreatecubedsphereireg->proc~esmf_utilcreatecscoordspar proc~esmf_gridcreatecubedspherereg ESMF_GridCreateCubedSphereReg proc~esmf_gridcreatecubedspherereg->proc~esmf_utilcreatecscoordspar interface~esmf_gridcreatecubedsphere ESMF_GridCreateCubedSphere interface~esmf_gridcreatecubedsphere->proc~esmf_gridcreatecubedsphereireg interface~esmf_gridcreatecubedsphere->proc~esmf_gridcreatecubedspherereg proc~createfields createFields proc~createfields->interface~esmf_gridcreatecubedsphere proc~f_esmf_gridcreatecubedsphere f_esmf_gridcreatecubedsphere proc~f_esmf_gridcreatecubedsphere->interface~esmf_gridcreatecubedsphere proc~iocomputestsetup IOCompUTestSetup proc~iocomputestsetup->interface~esmf_gridcreatecubedsphere proc~test_bilinear_regrid_csgrid test_bilinear_regrid_csgrid proc~test_bilinear_regrid_csgrid->interface~esmf_gridcreatecubedsphere proc~test_bilinear_regrid_csgrid_sph_rad test_bilinear_regrid_csgrid_sph_rad proc~test_bilinear_regrid_csgrid_sph_rad->interface~esmf_gridcreatecubedsphere proc~test_conserve_regrid_csgrid test_conserve_regrid_csgrid proc~test_conserve_regrid_csgrid->interface~esmf_gridcreatecubedsphere proc~test_csgridtogrid test_CSGridToGrid proc~test_csgridtogrid->interface~esmf_gridcreatecubedsphere proc~test_csgridtogrid_2nd test_CSGridToGrid_2nd proc~test_csgridtogrid_2nd->interface~esmf_gridcreatecubedsphere proc~test_csgridtogridwmasks test_CSGridToGridWMasks proc~test_csgridtogridwmasks->interface~esmf_gridcreatecubedsphere proc~test_mesh_dual_w_bilinear test_mesh_dual_w_bilinear proc~test_mesh_dual_w_bilinear->interface~esmf_gridcreatecubedsphere proc~test_nearest_regrid_csgrid test_nearest_regrid_csgrid proc~test_nearest_regrid_csgrid->interface~esmf_gridcreatecubedsphere proc~test_nearest_regrid_csmesh test_nearest_regrid_csmesh proc~test_nearest_regrid_csmesh->interface~esmf_gridcreatecubedsphere proc~test_patch_regrid_csgrid test_patch_regrid_csgrid proc~test_patch_regrid_csgrid->interface~esmf_gridcreatecubedsphere proc~test_sph_vec_blnr_csg_to_llg test_sph_vec_blnr_csG_to_llG proc~test_sph_vec_blnr_csg_to_llg->interface~esmf_gridcreatecubedsphere proc~test_sph_vec_blnr_csg_to_llg_p test_sph_vec_blnr_csG_to_llG_p proc~test_sph_vec_blnr_csg_to_llg_p->interface~esmf_gridcreatecubedsphere program~esmf_gridcreateex ESMF_GridCreateEx program~esmf_gridcreateex->interface~esmf_gridcreatecubedsphere program~esmf_gridcreateutest ESMF_GridCreateUTest program~esmf_gridcreateutest->interface~esmf_gridcreatecubedsphere

Source Code

  subroutine mirror_grid_local_new(local_tile, tileno)
     real(ESMF_KIND_R8)   , intent(INOUT) :: local_tile(:,:,:)
     integer, intent(IN)    :: tileno

     integer :: i,j,n,n1,n2,nreg, npx, npy
     real(ESMF_KIND_R8) :: x1,y1,z1, x2,y2,z2, ang, sa, ca

     if (tileno == 1) then
        ! no op
     else
        do j = 1, size(local_tile,2)
           do i = 1, size(local_tile,1)

              x1 = local_tile(i,j,1)
              y1 = local_tile(i,j,2)
              z1 = radius

              select case (tileno)
              case (2)
                 ang = -90.
                 sa = -1
                 ca = 0
                 call rot_3d_new( 3, x1, y1, z1, sa, ca, x2, y2, z2, 1)  ! rotate about the z-axis

              case (3)
                 ang = -90.
                 sa = -1
                 ca = 0
                 call rot_3d_new( 3, x1, y1, z1, sa, ca, x2, y2, z2, 1)  ! rotate about the z-axis
                 ang = 90.
                 sa = +1
                 ca = 0
                 call rot_3d_new( 1, x2, y2, z2, sa, ca, x1, y1, z1, 1)  ! rotate about the x-axis
                 x2=x1
                 y2=y1
                 z2=z1

              case (4)
                 ang = -180.
                 sa = 0
                 ca = -1
                 call rot_3d_new( 3, x1, y1, z1, sa, ca, x2, y2, z2, 1)  ! rotate about the z-axis
                 ang = 90.
                 sa = 1
                 ca = 0
                 call rot_3d_new( 1, x2, y2, z2, sa, ca, x1, y1, z1, 1)  ! rotate about the x-axis
                 x2=x1
                 y2=y1
                 z2=z1

              case (5)
                 ang = 90.
                 sa = 1
                 ca = 0
                 call rot_3d_new( 3, x1, y1, z1, sa, ca, x2, y2, z2, 1)  ! rotate about the z-axis
                 ang = 90.
                 sa = 1
                 ca = 0
                 call rot_3d_new( 2, x2, y2, z2, sa, ca, x1, y1, z1, 1)  ! rotate about the y-axis
                 x2=x1
                 y2=y1
                 z2=z1

              case (6)
                 ang = 90.
                 sa = 1
                 ca = 0
                 call rot_3d_new( 2, x1, y1, z1, sa, ca, x2, y2, z2, 1)  ! rotate about the y-axis
                 ang = 0.
                 sa = 0
                 ca = 1
                 call rot_3d_new( 3, x2, y2, z2, sa, ca, x1, y1, z1, 1)  ! rotate about the z-axis
                 x2=x1
                 y2=y1
                 z2=z1

              end select

              local_tile(i,j,1) = x2
              local_tile(i,j,2) = y2

           enddo
        enddo
     endif
  end subroutine mirror_grid_local_new