Skip to content

Commit

Permalink
Update orography code so it can call either v4 or v3.3.3 of iplib.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeGayno-NOAA committed Sep 9, 2022
1 parent 7d4d516 commit c70851d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions sorc/orog_mask_tools.fd/orog.fd/mtnlm7_oclsm.f
Original file line number Diff line number Diff line change
Expand Up @@ -3596,11 +3596,11 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
integer ij, ijmdl_output, iret, num_mismatch_land, num
integer ibo(1), ibi(1)
logical*1, allocatable :: bitmap_input(:,:)
logical*1, allocatable :: bitmap_output(:)
logical*1, allocatable :: bitmap_output(:,:)
integer, allocatable :: ijsav_land_output(:)
real, allocatable :: lats_land_output(:)
real, allocatable :: lons_land_output(:)
real, allocatable :: output_data_land(:)
real, allocatable :: output_data_land(:,:)
real, allocatable :: lons_mismatch_output(:)
real, allocatable :: lats_mismatch_output(:)
real, allocatable :: data_mismatch_output(:)
Expand Down Expand Up @@ -3737,8 +3737,8 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
where(slm_in > 0.0) bitmap_input=.true.
print*, "count(bitmap_input)", count(bitmap_input)
allocate(bitmap_output(count_land_output))
allocate(output_data_land(count_land_output))
allocate(bitmap_output(count_land_output,1))
allocate(output_data_land(count_land_output,1))
allocate(ijsav_land_output(count_land_output))
allocate(lats_land_output(count_land_output))
allocate(lons_land_output(count_land_output))
Expand All @@ -3764,7 +3764,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
do KWD=1,4
bitmap_output = .false.
output_data_land = 0.0
call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output,
call ipolates(int_opt, ipopt, kgds_input, kgds_output,
& (IMI*JMI), count_land_output,
& 1, ibi, bitmap_input, oa_in(:,:,KWD),
& count_land_output, lats_land_output,
Expand All @@ -3777,10 +3777,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
num_mismatch_land = 0
do ij = 1, count_land_output
if (bitmap_output(ij)) then
if (bitmap_output(ij,1)) then
j = (ijsav_land_output(ij)-1)/IM + 1
i = mod(ijsav_land_output(ij)-1,IM) + 1
oa4(i,j,KWD)=output_data_land(ij)
oa4(i,j,KWD)=output_data_land(ij,1)
else ! default value
num_mismatch_land = num_mismatch_land + 1
endif
Expand All @@ -3796,7 +3796,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
num = 0
do ij = 1, count_land_output
if (.not. bitmap_output(ij)) then
if (.not. bitmap_output(ij,1)) then
num = num+1
lons_mismatch_output(num) = lons_land_output(ij)
lats_mismatch_output(num) = lats_land_output(ij)
Expand All @@ -3818,7 +3818,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
num = 0
do ij = 1, count_land_output
if (.not. bitmap_output(ij)) then
if (.not. bitmap_output(ij,1)) then
num = num+1
j = (ijsav_land_output(ij)-1)/IM + 1
i = mod(ijsav_land_output(ij)-1,IM) + 1
Expand All @@ -3836,7 +3836,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
do KWD=1,4
bitmap_output = .false.
output_data_land = 0.0
call ipolates_grib1(int_opt, ipopt, kgds_input, kgds_output,
call ipolates(int_opt, ipopt, kgds_input, kgds_output,
& (IMI*JMI), count_land_output,
& 1, ibi, bitmap_input, ol_in(:,:,KWD),
& count_land_output, lats_land_output,
Expand All @@ -3849,10 +3849,10 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
num_mismatch_land = 0
do ij = 1, count_land_output
if (bitmap_output(ij)) then
if (bitmap_output(ij,1)) then
j = (ijsav_land_output(ij)-1)/IM + 1
i = mod(ijsav_land_output(ij)-1,IM) + 1
ol(i,j,KWD)=output_data_land(ij)
ol(i,j,KWD)=output_data_land(ij,1)
else ! default value
num_mismatch_land = num_mismatch_land + 1
endif
Expand All @@ -3865,7 +3865,7 @@ SUBROUTINE MAKEOA3(ZAVG,zslm,VAR,GLAT,OA4,OL,IOA4,ELVMAX,
num = 0
do ij = 1, count_land_output
if (.not. bitmap_output(ij)) then
if (.not. bitmap_output(ij,1)) then
num = num+1
j = (ijsav_land_output(ij)-1)/IM + 1
i = mod(ijsav_land_output(ij)-1,IM) + 1
Expand Down

0 comments on commit c70851d

Please sign in to comment.