Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add clipping treatment for negative values of non-negative tracers #682

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/gsi/gsi_rfv3io_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ module gsi_rfv3io_mod
vgsiname = [character(len=max_varname_length) :: &
'u','v','w','tsen','delp','q','oz','ql','qi','qr','qs','qg','qnr','dbz','fed','ps','delzinc', &
aeronames_cmaq_fv3,'pm25at','pm25ac','pm25co','pm2_5','amassi','amassj','amassk',aeronames_smoke_fv3]

integer(i_kind) ,parameter:: nnonnegtracer=7
ShunLiu-NOAA marked this conversation as resolved.
Show resolved Hide resolved
character(len=max_varname_length), dimension(nnonnegtracer), parameter :: &
vnames_nonnegativetracers = [character(len=max_varname_length) :: &
"sphum","o3mr","liq_wat","ice_wat","rainwat","snowwat","graupel"]
character(len=max_varname_length),dimension(:),allocatable:: name_metvars2d
character(len=max_varname_length),dimension(:),allocatable:: name_metvars3d
character(len=max_varname_length),dimension(:),allocatable:: name_chemvars3d
Expand Down Expand Up @@ -4676,6 +4681,9 @@ subroutine gsi_fv3ncdf_write(grd_ionouv,cstate_nouv,add_saved,filenamein,fv3file
call fv3_ll_to_h(work_a(:,:),work_b(:,:),nloncase,nlatcase,nlon_regional,nlat_regional,grid_reverse_flag)
endif
endif
if (ifindstrloc(vnames_nonnegativetracers,trim(varname))> 0) then
where (work_b <0.0_r_kind) work_b=0.0_r_kind
endif
if(fv3_io_layout_y > 1) then
do nio=0,fv3_io_layout_y-1
countloc=(/nxcase,ny_layout_len(nio),1/)
Expand Down Expand Up @@ -4835,6 +4843,9 @@ subroutine gsi_fv3ncdf_write_v1(grd_ionouv,cstate_nouv,add_saved,filenamein,fv3f
else
call fv3_ll_to_h(work_a(:,:),work_b(:,:),nloncase,nlatcase,nlon_regional,nlat_regional,grid_reverse_flag)
endif
if (ifindstrloc(vnames_nonnegativetracers,trim(varname))> 0) then
where (work_b <0.0_r_kind) work_b=0.0_r_kind
RussTreadon-NOAA marked this conversation as resolved.
Show resolved Hide resolved
endif
call check( nf90_put_var(gfile_loc,VarId,work_b,start=startloc,count=countloc) )
enddo !ilevtot
call check(nf90_close(gfile_loc))
Expand Down