Skip to content

Commit 4cfe72e

Browse files
Read water flag from file.
Fixes ufs-community#709.
1 parent cc929a8 commit 4cfe72e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sorc/sfc_climo_gen.fd/interp2.F90

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,10 @@ subroutine interp2(localpet, input_file)
2727

2828
integer :: rc, localpet
2929
integer :: i, j, tile, ncid, status
30-
integer :: varid
30+
integer :: varid, water_category
3131
integer :: isrctermprocessing
3232
integer :: category, num_categories
3333

34-
!cggg need to read this from file.
35-
integer, parameter :: water_category = 17
36-
3734
integer(esmf_kind_i4), allocatable :: mask_mdl_one_tile(:,:)
3835
integer(esmf_kind_i4), pointer :: unmapped_ptr(:)
3936

@@ -52,6 +49,7 @@ subroutine interp2(localpet, input_file)
5249
type(esmf_routehandle) :: regrid_data
5350
type(esmf_polemethod_flag) :: pole
5451

52+
5553
if (localpet == 0) then
5654
allocate(data_src_global(i_src,j_src))
5755
else
@@ -68,6 +66,9 @@ subroutine interp2(localpet, input_file)
6866
call netcdf_err(status, "IN ROUTINE INTERP READING FIELD")
6967
print*,'number of cats ',maxval(data_src_global)
7068
num_categories = nint(maxval(data_src_global))
69+
status = nf90_get_att(ncid, varid, 'water_category', water_category)
70+
call netcdf_err(status, "IN ROUTINE INTERP READING water_category")
71+
print*,'water cat ',water_category
7172
endif
7273

7374
call mpi_bcast(num_categories,1,MPI_INTEGER,0,MPI_COMM_WORLD,status)

0 commit comments

Comments
 (0)