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

Bug fixes in (1) running with frac_grid=T and GFDL MP and (2) restarting with frac_grid=T #204

Merged
merged 2 commits into from
Dec 2, 2020
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions atmos_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1764,7 +1764,6 @@ subroutine assign_importdata(rc)
nb = Atm_block%blkno(i,j)
ix = Atm_block%ixp(i,j)

IPD_Data(nb)%Sfcprop%fice(ix) = zero
junwang-noaa marked this conversation as resolved.
Show resolved Hide resolved
IPD_Data(nb)%Coupling%slimskin_cpl(ix) = IPD_Data(nb)%Sfcprop%slmsk(ix)
ofrac = IPD_Data(nb)%Sfcprop%oceanfrac(ix)
if (ofrac > zero) then
Expand All @@ -1779,7 +1778,7 @@ subroutine assign_importdata(rc)
if (abs(one-ofrac) < epsln) then
IPD_Data(nb)%Sfcprop%slmsk(ix) = zero
IPD_Data(nb)%Coupling%slimskin_cpl(ix) = zero
end if
endif
endif
endif
enddo
Expand Down
2 changes: 1 addition & 1 deletion ccpp/physics
45 changes: 27 additions & 18 deletions io/FV3GFS_io.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1066,14 +1066,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
endif

if(Model%frac_grid) then ! obtain slmsk from landfrac
!! next 5 lines are temporary till lake model is available
if (Sfcprop(nb)%lakefrac(ix) > zero) then
! Sfcprop(nb)%lakefrac(ix) = nint(Sfcprop(nb)%lakefrac(ix))
Sfcprop(nb)%landfrac(ix) = one - Sfcprop(nb)%lakefrac(ix)
if (Sfcprop(nb)%lakefrac(ix) == zero) Sfcprop(nb)%fice(ix) = zero
endif
Sfcprop(nb)%slmsk(ix) = ceiling(Sfcprop(nb)%landfrac(ix))
if (Sfcprop(nb)%fice(ix) > Model%min_lakeice .and. Sfcprop(nb)%landfrac(ix) == zero) Sfcprop(nb)%slmsk(ix) = 2 ! land dominates ice if co-exist
Sfcprop(nb)%slmsk(ix) = ceiling(Sfcprop(nb)%landfrac(ix)) !nint/floor are options
else ! obtain landfrac from slmsk
if (Sfcprop(nb)%slmsk(ix) > 1.9_r8) then
Sfcprop(nb)%landfrac(ix) = zero
Expand All @@ -1084,16 +1077,32 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)

if (Sfcprop(nb)%lakefrac(ix) > zero) then
Sfcprop(nb)%oceanfrac(ix) = zero ! lake & ocean don't coexist in a cell
! if (Sfcprop(nb)%fice(ix) < Model%min_lakeice) then
! Sfcprop(nb)%fice(ix) = zero
! if (Sfcprop(nb)%slmsk(ix) == 2) Sfcprop(nb)%slmsk(ix) = 0
! endif
if (Sfcprop(nb)%slmsk(ix) /= one) then
if (Sfcprop(nb)%fice(ix) >= Model%min_lakeice) then
if (Sfcprop(nb)%slmsk(ix) < 1.9_r8) &
write(*,'(a,2i3,3f6.2)') 'reset lake slmsk=2 at nb,ix=' &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious how many print lines we will get from the write statement here? Do we need them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I have confirmed in my own experiments that ice fractionas over lakes are maintained after this fix.
The motivation that lead to finding this bug was to understand why ice concentration over lakes vanished in the coupled runs while the initial conditon had non zero values.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong place, please ignore the above comment.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may need to consider commenting these print lines in future commit as there might be too many lines in the log file.

,nb,ix,Sfcprop(nb)%fice(ix),Sfcprop(nb)%slmsk(ix),Sfcprop(nb)%lakefrac(ix)
Sfcprop(nb)%slmsk(ix) = 2.
else if (Sfcprop(nb)%slmsk(ix) > 1.e-7) then
write(*,'(a,2i3,3f6.2)') 'reset lake slmsk=0 at nb,ix=' &
,nb,ix,Sfcprop(nb)%fice(ix),Sfcprop(nb)%slmsk(ix),Sfcprop(nb)%lakefrac(ix)
Sfcprop(nb)%slmsk(ix) = zero
end if
end if
else
Sfcprop(nb)%oceanfrac(ix) = one - Sfcprop(nb)%landfrac(ix)
! if (Sfcprop(nb)%fice(ix) < Model%min_seaice) then
! Sfcprop(nb)%fice(ix) = zero
! if (Sfcprop(nb)%slmsk(ix) == 2) Sfcprop(nb)%slmsk(ix) = 0
! endif
if (Sfcprop(nb)%slmsk(ix) /= one) then
if (Sfcprop(nb)%fice(ix) >= Model%min_seaice) then
if (Sfcprop(nb)%slmsk(ix) < 1.9_r8) &
write(*,'(a,2i3,3f6.2)') 'reset sea slmsk=2 at nb,ix=' &
,nb,ix,Sfcprop(nb)%fice(ix),Sfcprop(nb)%slmsk(ix),Sfcprop(nb)%landfrac(ix)
Sfcprop(nb)%slmsk(ix) = 2.
else if (Sfcprop(nb)%slmsk(ix) > 1.e-7) then
write(*,'(a,2i3,4f6.2)') 'reset sea slmsk=0 at nb,ix=' &
,nb,ix,Sfcprop(nb)%fice(ix),Sfcprop(nb)%slmsk(ix),Sfcprop(nb)%landfrac(ix)
Sfcprop(nb)%slmsk(ix) = zero
end if
end if
endif
!
!--- NSSTM variables
Expand Down Expand Up @@ -1336,7 +1345,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
endif

if (sfc_var2(i,j,nvar_s2m) < -9990.0_r8) then
if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing zorli')
if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing zorlw')
!$omp parallel do default(shared) private(nb, ix)
do nb = 1, Atm_block%nblks
do ix = 1, Atm_block%blksz(nb)
Expand All @@ -1351,7 +1360,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
!$omp parallel do default(shared) private(nb, ix, tem, tem1)
do nb = 1, Atm_block%nblks
do ix = 1, Atm_block%blksz(nb)
Sfcprop(nb)%tsfco(ix) = max(con_tice, Sfcprop(nb)%tsfco(ix))
if( Model%phour < 1.e-7) Sfcprop(nb)%tsfco(ix) = max(con_tice, Sfcprop(nb)%tsfco(ix)) ! this may break restart reproducibility
junwang-noaa marked this conversation as resolved.
Show resolved Hide resolved
tem1 = one - Sfcprop(nb)%landfrac(ix)
tem = tem1 * Sfcprop(nb)%fice(ix) ! tem = ice fraction wrt whole cell
Sfcprop(nb)%zorl(ix) = Sfcprop(nb)%zorll(ix) * Sfcprop(nb)%landfrac(ix) &
Expand Down