diff --git a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 index 22bbcf7ee..56b9d3fe4 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_vp.F90 @@ -99,6 +99,9 @@ module ice_dyn_vp indxtj(:,:) , & ! compressed index in j-direction indxui(:,:) , & ! compressed index in i-direction indxuj(:,:) ! compressed index in j-direction + + real (kind=dbl_kind), allocatable :: & + fld2(:,:,:,:) ! work array for boundary updates !======================================================================= @@ -143,6 +146,7 @@ subroutine init_vp (dt) indxtj(nx_block*ny_block, max_blocks), & indxui(nx_block*ny_block, max_blocks), & indxuj(nx_block*ny_block, max_blocks)) + allocate(fld2(nx_block,ny_block,2,max_blocks)) ! Redefine tinyarea using a different puny value @@ -229,8 +233,6 @@ subroutine imp_solver (dt) aiu , & ! ice fraction on u-grid umass , & ! total mass of ice and snow (u grid) umassdti ! mass of U-cell/dte (kg/m^2 s) - - real (kind=dbl_kind), allocatable :: fld2(:,:,:,:) logical (kind=log_kind) :: calc_strair @@ -256,8 +258,6 @@ subroutine imp_solver (dt) !----------------------------------------------------------------- ! Initialize !----------------------------------------------------------------- - - allocate(fld2(nx_block,ny_block,2,max_blocks)) ! This call is needed only if dt changes during runtime. ! call set_evp_parameters (dt) @@ -480,7 +480,6 @@ subroutine imp_solver (dt) call picard_solver (icellt, icellu, & indxti, indxtj, & indxui, indxuj, & - fld2, & aiu, ntot, & waterx, watery, & bxfix, byfix, & @@ -492,7 +491,6 @@ subroutine imp_solver (dt) call anderson_solver (icellt, icellu, & indxti, indxtj, & indxui, indxuj, & - fld2, & aiu, ntot, & waterx, watery, & bxfix, byfix, & @@ -507,7 +505,6 @@ subroutine imp_solver (dt) deallocate(bvec, sol, diagvec) - deallocate(fld2) if (maskhalo_dyn) call ice_HaloDestroy(halo_info_mask) !----------------------------------------------------------------- @@ -636,7 +633,6 @@ end subroutine imp_solver subroutine picard_solver (icellt, icellu, & indxti, indxtj, & indxui, indxuj, & - fld2, & aiu, ntot, & waterx, watery, & bxfix, byfix, & @@ -669,9 +665,6 @@ subroutine picard_solver (icellt, icellu, & indxui , & ! compressed index in i-direction indxuj ! compressed index in j-direction - real (kind=dbl_kind), dimension (nx_block,ny_block,2,max_blocks), intent(inout) :: & - fld2 ! work array for boundary updates - real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks), intent(in) :: & aiu , & ! ice fraction on u-grid waterx , & ! for ocean stress calculation, x (m/s) @@ -1066,7 +1059,6 @@ end subroutine picard_solver subroutine anderson_solver (icellt, icellu, & indxti, indxtj, & indxui, indxuj, & - fld2, & aiu, ntot, & waterx, watery, & bxfix, byfix, & @@ -1100,9 +1092,6 @@ subroutine anderson_solver (icellt, icellu, & indxui , & ! compressed index in i-direction indxuj ! compressed index in j-direction - real (kind=dbl_kind), dimension (nx_block,ny_block,2,max_blocks), intent(inout) :: & - fld2 ! work array for boundary updates - real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks), intent(in) :: & aiu , & ! ice fraction on u-grid waterx , & ! for ocean stress calculation, x (m/s) @@ -1349,8 +1338,7 @@ subroutine anderson_solver (icellt, icellu, & ! indxui, indxuj, & ! zetaD, & ! Cb, vrel, & - ! aiu, umassdti, & - ! fld2) + ! aiu, umassdti) elseif (fpfunc_andacc == 2) then ! g_2(x) = x - A(x)x + b(x) = x - F(x) @@ -1530,8 +1518,7 @@ subroutine fgmres_solver (ntot, bvec, & indxui, indxuj, & zetaD, & Cb, vrel, & - aiu, umassdti, & - fld2) + aiu, umassdti ) use ice_blocks, only: nx_block, ny_block use ice_boundary, only: ice_HaloUpdate @@ -1570,10 +1557,7 @@ subroutine fgmres_solver (ntot, bvec, & real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks,4), intent(in) :: & zetaD ! zetaD = 2zeta (viscous coeff) - - real (kind=dbl_kind), dimension (nx_block,ny_block,2,max_blocks), intent(inout) :: & - fld2 ! work array for boundary updates - + ! local variables integer (kind=int_kind) :: & @@ -4810,7 +4794,7 @@ end function almost_zero ! Perform a halo update for the velocity field ! author: Philippe Blain, ECCC - subroutine ice_HaloUpdate_vel(uvel, vvel, fld2, halo_info_mask) + subroutine ice_HaloUpdate_vel(uvel, vvel, halo_info_mask) use ice_boundary, only: ice_halo, ice_HaloUpdate use ice_constants, only: field_loc_NEcorner, field_type_vector @@ -4821,9 +4805,6 @@ subroutine ice_HaloUpdate_vel(uvel, vvel, fld2, halo_info_mask) uvel , & ! u components of velocity vector vvel ! v components of velocity vector - real (kind=dbl_kind), dimension (nx_block,ny_block,2,max_blocks), intent(inout) :: & - fld2 ! work array to perform halo update - type (ice_halo), intent(in) :: & halo_info_mask ! ghost cell update info for masked halo