Skip to content

Commit

Permalink
Adding conidtionals to check debug value before printing lots of info…
Browse files Browse the repository at this point in the history
… from model_interpolate
  • Loading branch information
mjs2369 committed Oct 3, 2024
1 parent 5223c24 commit 584b8aa
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions models/icepack/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -389,11 +389,11 @@ subroutine model_interpolate(state_handle, ens_size, location, obs_type, expecte
temp = temp + expected_conc * expected_fy !sum(aicen*fyn) = FY % over ice
temp1= temp1+ expected_conc !sum(aicen) = aice

if (any(expected_conc<0.0) .or. any(expected_conc>1.0))then
if ((any(expected_conc<0.0) .or. any(expected_conc>1.0)) .and. (debug > 1)) then
print*,'obstype FY expected sicn:',expected_conc
print*,'FY sicn lat lon:',llat,llon
endif
if (any(expected_fy>1.0) .or. any(expected_fy<0.0)) then
if ((any(expected_fy>1.0) .or. any(expected_fy<0.0)) .and. (debug > 1)) then
print*,'obstype FY expected fyn:',expected_fy,llat,llon
print*,'FY fyn lat lon:',llat,llon
endif
Expand All @@ -414,19 +414,19 @@ subroutine model_interpolate(state_handle, ens_size, location, obs_type, expecte
base_offset = get_index_start(domain_id,get_varid_from_kind(QTY_SEAICE_SURFACETEMP))
base_offset = base_offset + (icat-1) * Nx
call lon_lat_interpolate(state_handle, ens_size, base_offset, llon, llat, set_obstype, cat_signal_interm, expected_tsfc, istatus)
if (any(expected_conc<0.0) .or. any(expected_conc>1.0))then
if ((any(expected_conc<0.0) .or. any(expected_conc>1.0)) .and. (debug > 1)) then
print*,'obstype TSFC expected sicn:',expected_conc
print*,'TSFC sicn lat lon:',llat,llon
endif
if (any(expected_tsfc>50.0) .or. any(expected_tsfc<-100.0)) then
if ((any(expected_tsfc>50.0) .or. any(expected_tsfc<-100.0)) .and. (debug > 1)) then
print*,'obstype TSFC expected tsfcn:',expected_tsfc
print*,'TSFC tsfcn lat lon:',llat,llon
endif
temp = temp + expected_conc * expected_tsfc !sum(aicen*Tsfcn)
temp1= temp1+ expected_conc !sum(aicen) = aice
end do
expected_obs = temp/max(temp1,1.0e-8) !sum(aicen*Tsfcn)/aice = Tsfc ;averaged temperature over sea-ice covered portion
if (any(expected_obs>50.0) .or. any(expected_obs<-100.0)) then
if ((any(expected_obs>50.0) .or. any(expected_obs<-100.0)) .and. (debug > 1)) then
print*,'obstype TSFC expected obs:',expected_obs
print*,'TSFC tsfc lat lon:' ,llat,llon
print*,'temp:',temp
Expand All @@ -435,11 +435,11 @@ subroutine model_interpolate(state_handle, ens_size, location, obs_type, expecte
else
call lon_lat_interpolate(state_handle, ens_size, base_offset, llon, llat, set_obstype, cat_signal, expected_obs, istatus)

if (any(expected_obs<0.0))then
if (any(expected_obs<0.0) .and. (debug > 1)) then
print*,'obstype SIC expected concs:',expected_obs
print*,'SIC sic negative lat lon:',llat,llon
endif
if (any(expected_obs>1.0))then
if (any(expected_obs>1.0) .and. (debug > 1)) then
print*,'obstype SIC expected concs:',expected_obs
print*,'SIC sic positive lat lon:',llat,llon
endif
Expand All @@ -452,7 +452,7 @@ subroutine model_interpolate(state_handle, ens_size, location, obs_type, expecte
call lon_lat_interpolate(state_handle, ens_size, base_offset, llon, llat, set_obstype, cat_signal, expected_aggr_conc, istatus)
expected_obs = expected_obs/max(expected_aggr_conc,1.0e-8) ! hope this is allowed so we never divide by zero

if (any(expected_aggr_conc<0.0) .or. any(expected_aggr_conc>1.0))then
if ((any(expected_aggr_conc<0.0) .or. any(expected_aggr_conc>1.0)) .and. (debug > 1)) then
print*,'obstype SIT expected conc:',expected_aggr_conc
print*,'SIT sic lat lon:',llat,llon
endif
Expand Down

0 comments on commit 584b8aa

Please sign in to comment.