Skip to content

Commit

Permalink
GitHub Issue #566 A quick enhancement for clipping negative moisture …
Browse files Browse the repository at this point in the history
…values in the analysis of EnKF for FV3-LAM

also remove the condition of l_use_enkf_directZDA=.true. for clipping of negative values for hydrometeors when cliptracers=.true.
  • Loading branch information
TingLei-daprediction committed May 5, 2023
1 parent 243d01c commit 2a82e40
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
26 changes: 13 additions & 13 deletions src/enkf/gridio_fv3reg.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module gridio
use params, only: nlevs, cliptracers, datapath, arw, nmm, datestring
use params, only: nx_res,ny_res,nlevs,ntiles,l_fv3reg_filecombined,&
fv3_io_layout_nx,fv3_io_layout_ny,nanals
use params, only: pseudo_rh, l_use_enkf_directZDA
use params, only: pseudo_rh
use mpeu_util, only: getindex
use read_fv3regional_restarts,only:read_fv3_restart_data1d,read_fv3_restart_data2d
use read_fv3regional_restarts,only:read_fv3_restart_data3d,read_fv3_restart_data4d
Expand Down Expand Up @@ -940,7 +940,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand All @@ -963,7 +963,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand All @@ -986,7 +986,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand All @@ -1009,7 +1009,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand All @@ -1032,7 +1032,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand All @@ -1054,7 +1054,7 @@ subroutine writegriddata(nanal1,nanal2,vars3d,vars2d,n3d,n2d,levels,ndim,vargrid
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2297,7 +2297,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2331,7 +2331,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2365,7 +2365,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2399,7 +2399,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2433,7 +2433,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down Expand Up @@ -2466,7 +2466,7 @@ subroutine writegriddata_pnc(vars3d,vars2d,n3d,n2d,levels,ndim,vargrid,no_inflat
enddo
enddo
workvar3d=workvar3d+workinc3d
if ( l_use_enkf_directZDA .and. cliptracers ) then ! set cliptracers to remove negative hydrometers
if ( cliptracers ) then ! set cliptracers to remove negative hydrometers
clip = tiny(workvar3d(1,1,1))
where (workvar3d < clip) workvar3d = clip
end if
Expand Down
3 changes: 1 addition & 2 deletions ush/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ COMPILER=${COMPILER:-"intel"}
BUILD_DIR=${BUILD_DIR:-"${DIR_ROOT}/build"}
INSTALL_PREFIX=${INSTALL_PREFIX:-"${DIR_ROOT}/install"}
GSI_MODE=${GSI_MODE:-"Regional"} # By default build Regional GSI (for regression testing)
#clt ENKF_MODE=${ENKF_MODE:-"GFS"} # By default build Global EnKF (for regression testing)
ENKF_MODE=${ENKF_MODE:-"FV3REG"} # By default build Global EnKF (for regression testing)
ENKF_MODE=${ENKF_MODE:-"GFS"} # By default build Global EnKF (for regression testing)
REGRESSION_TESTS=${REGRESSION_TESTS:-"YES"} # Build regression test suite

#==============================================================================#
Expand Down

0 comments on commit 2a82e40

Please sign in to comment.