Skip to content

Commit 46db839

Browse files
More interp2 cleanup.
Fixes ufs-community#709.
1 parent 6b2834a commit 46db839

File tree

2 files changed

+5
-40
lines changed

2 files changed

+5
-40
lines changed

sorc/sfc_climo_gen.fd/driver.F90

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ program driver
8181

8282
call define_source_grid(localpet, npets, input_vegetation_type_file)
8383
method=ESMF_REGRIDMETHOD_NEAREST_STOD
84-
call interp2(localpet, method, input_vegetation_type_file)
84+
call interp2(localpet, input_vegetation_type_file)
8585
call source_grid_cleanup
8686

8787
! Snow free albedo

sorc/sfc_climo_gen.fd/interp2.F90

+4-39
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@
77
!! model grid.
88
!!
99
!! @param[in] localpet this mpi task
10-
!! @param[in] method interpolation method.defined where mask=1
1110
!! @param[in] input_file filename of input source data.
1211
!! @author George Gayno @date 2018
13-
subroutine interp2(localpet, method, input_file)
12+
subroutine interp2(localpet, input_file)
1413

1514
use esmf
1615
use netcdf
@@ -24,11 +23,10 @@ subroutine interp2(localpet, method, input_file)
2423
character(len=*), intent(in) :: input_file
2524

2625
integer :: rc, localpet
27-
integer :: i, j, ij, tile, n, ncid, status
28-
integer :: l(1), u(1), t
26+
integer :: i, j, tile, n, ncid, status
27+
integer :: t
2928
integer :: clb_mdl(3), cub_mdl(3)
3029
integer :: varid, record
31-
integer :: tile_num, pt_loc_this_tile
3230
integer :: isrctermprocessing
3331
integer :: category, num_categories
3432

@@ -44,7 +42,6 @@ subroutine interp2(localpet, method, input_file)
4442
real(esmf_kind_r4), allocatable :: sum_mdl_one_tile(:,:)
4543
real(esmf_kind_r4), allocatable :: lon_mdl_one_tile(:,:)
4644

47-
!type(esmf_regridmethod_flag),intent(in) :: method
4845
type(esmf_regridmethod_flag) :: method
4946
type(esmf_field) :: data_field_src
5047
type(esmf_field) :: data_field_mdl2
@@ -151,13 +148,7 @@ subroutine interp2(localpet, method, input_file)
151148
if (record == 1) then
152149

153150
method = ESMF_REGRIDMETHOD_CONSERVE
154-
155-
if (method == ESMF_REGRIDMETHOD_BILINEAR) then
156-
pole = ESMF_POLEMETHOD_ALLAVG
157-
else
158-
pole = ESMF_POLEMETHOD_NONE
159-
endif
160-
151+
pole = ESMF_POLEMETHOD_NONE
161152

162153
print*,"- CALL FieldRegridStore."
163154
nullify(unmapped_ptr)
@@ -202,32 +193,6 @@ subroutine interp2(localpet, method, input_file)
202193
! will be replaced in routine "search".
203194
!-----------------------------------------------------------------------
204195

205-
l = lbound(unmapped_ptr)
206-
u = ubound(unmapped_ptr)
207-
! do ij = l(1), u(1)
208-
209-
! tile_num = ((unmapped_ptr(ij)-1) / (i_mdl*j_mdl)) ! tile number minus 1
210-
! pt_loc_this_tile = unmapped_ptr(ij) - (tile_num * i_mdl * j_mdl)
211-
! "ij" location of point within tile.
212-
213-
! j = (pt_loc_this_tile - 1) / i_mdl + 1
214-
! i = mod(pt_loc_this_tile, i_mdl)
215-
! if (i==0) i = i_mdl
216-
! data_mdl_ptr(i,j,:) = -9999.9
217-
218-
! enddo
219-
220-
! These fields are adjusted at landice.
221-
222-
! select case (trim(field_names(n)))
223-
! case ('substrate_temperature','vegetation_greenness','leaf_area_index','slope_type','soil_type')
224-
! if (localpet == 0) then
225-
! allocate(vegt_mdl_one_tile(i_mdl,j_mdl))
226-
! else
227-
! allocate(vegt_mdl_one_tile(0,0))
228-
! endif
229-
! end select
230-
231196
OUTPUT_LOOP : do tile = 1, num_tiles
232197

233198
print*,"- CALL FieldGather FOR MODEL LATITUDE."

0 commit comments

Comments
 (0)