Skip to content

Commit

Permalink
Merge pull request #300 from laurenchilutti/gitlab1020
Browse files Browse the repository at this point in the history
Update for AM5: turns off saturation adjustment in 2dz filter
  • Loading branch information
laurenchilutti authored Oct 20, 2023
2 parents 5084f57 + a66a6ab commit e94dc4b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
5 changes: 3 additions & 2 deletions model/fv_sg.F90
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ subroutine fv_subgrid_z( isd, ied, jsd, jed, is, ie, js, je, km, nq, dt, &
real, parameter:: ustar2 = 1.E-4
real:: cv_air, xvir
integer :: sphum, liq_wat, rainwat, snowwat, graupel, ice_wat, cld_amt
logical:: sat_adj = .false.

cv_air = cp_air - rdgas ! = rdgas * (7/2-1) = 2.5*rdgas=717.68
rk = cp_air/rdgas + 1.
Expand Down Expand Up @@ -570,7 +571,7 @@ subroutine fv_subgrid_z( isd, ied, jsd, jed, is, ie, js, je, km, nq, dt, &
!$OMP parallel do default(none) shared(im,is,ie,js,je,nq,kbot,qa,ta,sphum,ua,va,delp,peln, &
!$OMP hydrostatic,pe,delz,g2,w,liq_wat,rainwat,ice_wat, &
!$OMP snowwat,cv_air,m,graupel,pkz,rk,rz,fra,cld_amt, &
!$OMP u_dt,rdt,v_dt,xvir,nwat) &
!$OMP u_dt,rdt,v_dt,xvir,nwat,sat_adj) &
!$OMP private(kk,lcp2,icp2,tcp3,dh,dq,den,qs,qsw,dqsdt,qcon,q0, &
!$OMP t0,u0,v0,w0,h0,pm,gzh,tvm,tmp,cpm,cvm, q_liq,q_sol,&
!$OMP tv,gz,hd,te,ratio,pt1,pt2,tv1,tv2,ri_ref, ri,mc,km1)
Expand Down Expand Up @@ -876,7 +877,7 @@ subroutine fv_subgrid_z( isd, ied, jsd, jed, is, ie, js, je, km, nq, dt, &
!----------------------
! Saturation adjustment
!----------------------
if ( nwat > 5 ) then
if ( nwat > 5 .and. sat_adj) then
do k=1, kbot
if ( hydrostatic ) then
do i=is, ie
Expand Down
42 changes: 21 additions & 21 deletions model/gfdl_mp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -657,16 +657,16 @@ subroutine gfdl_mp_end
! free up memory
! -----------------------------------------------------------------------

deallocate (table0)
deallocate (table1)
deallocate (table2)
deallocate (table3)
deallocate (table4)
deallocate (des0)
deallocate (des1)
deallocate (des2)
deallocate (des3)
deallocate (des4)
if (allocated (table0)) deallocate (table0)
if (allocated (table1)) deallocate (table1)
if (allocated (table2)) deallocate (table2)
if (allocated (table3)) deallocate (table3)
if (allocated (table4)) deallocate (table4)
if (allocated (des0)) deallocate (des0)
if (allocated (des1)) deallocate (des1)
if (allocated (des2)) deallocate (des2)
if (allocated (des3)) deallocate (des3)
if (allocated (des4)) deallocate (des4)

tables_are_initialized = .false.

Expand Down Expand Up @@ -6940,17 +6940,17 @@ subroutine qs_init

if (.not. tables_are_initialized) then

allocate (table0 (length))
allocate (table1 (length))
allocate (table2 (length))
allocate (table3 (length))
allocate (table4 (length))

allocate (des0 (length))
allocate (des1 (length))
allocate (des2 (length))
allocate (des3 (length))
allocate (des4 (length))
if (.not. allocated (table0)) allocate (table0 (length))
if (.not. allocated (table1)) allocate (table1 (length))
if (.not. allocated (table2)) allocate (table2 (length))
if (.not. allocated (table3)) allocate (table3 (length))
if (.not. allocated (table4)) allocate (table4 (length))

if (.not. allocated (des0)) allocate (des0 (length))
if (.not. allocated (des1)) allocate (des1 (length))
if (.not. allocated (des2)) allocate (des2 (length))
if (.not. allocated (des3)) allocate (des3 (length))
if (.not. allocated (des4)) allocate (des4 (length))

call qs_table0 (length)
call qs_table1 (length)
Expand Down

0 comments on commit e94dc4b

Please sign in to comment.