Skip to content

Commit 2c8161a

Browse files
Add control flag for processing category percentages.
Add the new logic for the processing of soil type. Fixes ufs-community#709.
1 parent cae15a1 commit 2c8161a

File tree

4 files changed

+15
-11
lines changed

4 files changed

+15
-11
lines changed

sorc/sfc_climo_gen.fd/driver.F90

+12-4
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,12 @@ program driver
8080
!-------------------------------------------------------------------------
8181

8282
call define_source_grid(localpet, npets, input_vegetation_type_file)
83-
method=ESMF_REGRIDMETHOD_NEAREST_STOD
84-
call interp2(localpet, input_vegetation_type_file)
83+
if (fract_vegsoil_type) then
84+
call interp2(localpet, input_vegetation_type_file)
85+
else
86+
method=ESMF_REGRIDMETHOD_NEAREST_STOD
87+
call interp(localpet, method, input_vegetation_type_file)
88+
endif
8589
call source_grid_cleanup
8690

8791
! Snow free albedo
@@ -136,8 +140,12 @@ program driver
136140

137141
if (trim(input_soil_type_file) /= "NULL") then
138142
call define_source_grid(localpet, npets, input_soil_type_file)
139-
method=ESMF_REGRIDMETHOD_NEAREST_STOD
140-
call interp(localpet, method, input_soil_type_file)
143+
if (fract_vegsoil_type) then
144+
call interp2(localpet, input_soil_type_file)
145+
else
146+
method=ESMF_REGRIDMETHOD_NEAREST_STOD
147+
call interp(localpet, method, input_soil_type_file)
148+
endif
141149
call source_grid_cleanup
142150
endif
143151

sorc/sfc_climo_gen.fd/interp2.F90

-4
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,4 @@ subroutine interp2(localpet, input_file)
205205
print*,"- CALL FieldDestroy."
206206
call ESMF_FieldDestroy(data_field_src, rc=rc)
207207

208-
print*,'after output ', localpet
209-
call mpi_barrier(mpi_comm_world, rc)
210-
stop
211-
212208
end subroutine interp2

sorc/sfc_climo_gen.fd/output2.f90

-3
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,6 @@ subroutine output2(data_one_tile, lat_one_tile, lon_one_tile, i_mdl, j_mdl, &
225225

226226
error = nf90_close(ncid_with_halo)
227227

228-
call mpi_barrier(mpi_comm_world, error)
229-
stop
230-
231228
return
232229

233230
end subroutine output2

sorc/sfc_climo_gen.fd/program_setup.f90

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ module program_setup
4343
integer, public :: halo = 0 !< Number of row/cols defining the lateral
4444
!! boundary halo. Used for regional nests.
4545

46+
logical, public :: fract_vegsoil_type = .true. !< When true, output the percentage of each soil
47+
!! and vegetation type category.
48+
4649
public :: read_setup_namelist
4750

4851
contains

0 commit comments

Comments
 (0)