1
1
! > @file
2
- ! ! @brief Read the input source data and interpolate it to the
3
- ! ! model grid.
4
- ! ! @author George Gayno @date 2018
2
+ ! ! @brief Read the input cateogorical source data and
3
+ ! ! interpolate it to the model grid.
4
+ ! ! @author George Gayno @date 2022
5
5
6
6
! > Read the input source data and interpolate it to the
7
- ! ! model grid.
7
+ ! ! model grid. Outputs the percentage of each category
8
+ ! ! within a model grid box and the dominate category.
8
9
! !
9
10
! ! @param[in] localpet this mpi task
10
11
! ! @param[in] input_file filename of input source data.
11
- ! ! @author George Gayno @date 2018
12
- subroutine interp2 (localpet , input_file )
12
+ ! ! @author George Gayno @date 2022
13
+ subroutine interp_frac_cats (localpet , input_file )
13
14
14
15
use esmf
15
16
use netcdf
@@ -26,11 +27,12 @@ subroutine interp2(localpet, input_file)
26
27
27
28
character (len=* ), intent (in ) :: input_file
28
29
29
- integer :: rc, localpet
30
- integer :: i, j, tile, ncid, status
30
+ integer , intent (in ) :: localpet
31
+
32
+ integer :: i, j, tile, ncid, status, rc
31
33
integer :: varid, water_category
32
34
integer :: isrctermprocessing
33
- integer :: category, num_categories
35
+ integer :: category, num_categories
34
36
35
37
integer (esmf_kind_i4), allocatable :: mask_mdl_one_tile(:,:)
36
38
integer (esmf_kind_i4), pointer :: unmapped_ptr(:)
@@ -44,12 +46,11 @@ subroutine interp2(localpet, input_file)
44
46
real (esmf_kind_r4 ), allocatable :: lon_mdl_one_tile(:,:)
45
47
real (esmf_kind_r4 ), allocatable :: land_frac_mdl_one_tile(:,:)
46
48
47
- type (esmf_regridmethod_flag) :: method
49
+ type (esmf_regridmethod_flag) :: method
48
50
type (esmf_field) :: data_field_src
49
51
type (esmf_field) :: data_field_mdl
50
52
type (esmf_routehandle) :: regrid_data
51
53
type (esmf_polemethod_flag) :: pole
52
-
53
54
54
55
if (localpet == 0 ) then
55
56
allocate (data_src_global(i_src,j_src))
@@ -264,4 +265,4 @@ subroutine interp2(localpet, input_file)
264
265
265
266
call mpi_barrier(mpi_comm_world, rc)
266
267
267
- end subroutine interp2
268
+ end subroutine interp_frac_cats
0 commit comments