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

Sea ice in RUC LSM #54

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 1 addition & 1 deletion ccpp/physics
101 changes: 86 additions & 15 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction
real (kind=kind_phys), pointer :: tiice(:,:) => null() !< internal ice temperature
real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph
real (kind=kind_phys), pointer :: snowd_land (:) => null() !< snow depth water equivalent in mm ; same as snwdph
real (kind=kind_phys), pointer :: snowd_ice (:) => null() !< snow depth water equivalent in mm ; same as snwdph
real (kind=kind_phys), pointer :: zorl (:) => null() !< composite surface roughness in cm
real (kind=kind_phys), pointer :: zorlo (:) => null() !< ocean surface roughness in cm
real (kind=kind_phys), pointer :: zorll (:) => null() !< land surface roughness in cm
Expand All @@ -253,6 +255,7 @@ module GFS_typedefs

!--- In (radiation only)
real (kind=kind_phys), pointer :: sncovr (:) => null() !< snow cover in fraction
real (kind=kind_phys), pointer :: sncovr_ice (:) => null() !< snow cover in fraction
real (kind=kind_phys), pointer :: snoalb (:) => null() !< maximum snow albedo in fraction
real (kind=kind_phys), pointer :: alvsf (:) => null() !< mean vis albedo with strong cosz dependency
real (kind=kind_phys), pointer :: alnsf (:) => null() !< mean nir albedo with strong cosz dependency
Expand Down Expand Up @@ -369,12 +372,22 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: flag_frsoil(:,:) => null() !< RUC LSM: flag for frozen soil physics
!
real (kind=kind_phys), pointer :: clw_surf(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface
real (kind=kind_phys), pointer :: clw_surf_land(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface over land
real (kind=kind_phys), pointer :: clw_surf_ice(:) => null() !< RUC LSM: moist cloud water mixing ratio at surface over ice
real (kind=kind_phys), pointer :: qwv_surf(:) => null() !< RUC LSM: water vapor mixing ratio at surface
real (kind=kind_phys), pointer :: qwv_surf_land(:) => null() !< RUC LSM: water vapor mixing ratio at surface
real (kind=kind_phys), pointer :: qwv_surf_ice(:) => null() !< RUC LSM: water vapor mixing ratio at surface
real (kind=kind_phys), pointer :: cndm_surf(:) => null() !< RUC LSM: surface condensation mass
real (kind=kind_phys), pointer :: cndm_surf_land(:)=> null() !< RUC LSM: surface condensation mass over land
real (kind=kind_phys), pointer :: cndm_surf_ice(:) => null() !< RUC LSM: surface condensation mass over ice
real (kind=kind_phys), pointer :: rhofr(:) => null() !< RUC LSM: density of frozen precipitation
real (kind=kind_phys), pointer :: tsnow(:) => null() !< RUC LSM: snow temperature at the bottom of the first soil layer
real (kind=kind_phys), pointer :: snowfallac(:) => null() !< ruc lsm diagnostics
real (kind=kind_phys), pointer :: tsnow(:) => null() !< RUC LSM: snow temperature at the bottom of the first snow layer
real (kind=kind_phys), pointer :: tsnow_land(:) => null() !< RUC LSM: snow temperature at the bottom of the first snow layer over land
real (kind=kind_phys), pointer :: tsnow_ice(:) => null() !< RUC LSM: snow temperature at the bottom of the first snow layer over ice
real (kind=kind_phys), pointer :: acsnow(:) => null() !< ruc lsm diagnostics
real (kind=kind_phys), pointer :: snowfallac(:) => null() !< ruc lsm diagnostics
real (kind=kind_phys), pointer :: snowfallac_land(:) => null() !< ruc lsm diagnostics over land
real (kind=kind_phys), pointer :: snowfallac_ice(:) => null() !< ruc lsm diagnostics over ice

! MYNN surface layer
real (kind=kind_phys), pointer :: ustm (:) => null() !u* including drag
Expand Down Expand Up @@ -775,13 +788,15 @@ module GFS_typedefs
integer :: lsm_noahmp=2 !< flag for NOAH land surface model
integer :: lsm_ruc=3 !< flag for RUC land surface model
integer :: lsoil !< number of soil layers
integer :: kice=2 !< number of layers in sice
#ifdef CCPP
integer :: lsoil_lsm !< number of soil layers internal to land surface model
integer :: lsnow_lsm !< maximum number of snow layers internal to land surface model
integer :: lsnow_lsm_lbound!< lower bound for snow arrays, depending on lsnow_lsm
real(kind=kind_phys), pointer :: zs(:) => null() !< depth of soil levels for land surface model
logical :: rdlai
integer :: kice !< number of layers in ice model
#else
integer :: kice=2 !< number of layers in sice
#endif
integer :: ivegsrc !< ivegsrc = 0 => USGS,
!< ivegsrc = 1 => IGBP (20 category)
Expand Down Expand Up @@ -1359,7 +1374,9 @@ module GFS_typedefs
!--- Out (radiation only)
real (kind=kind_phys), pointer :: htrsw (:,:) => null() !< swh total sky sw heating rate in k/sec
real (kind=kind_phys), pointer :: htrlw (:,:) => null() !< hlw total sky lw heating rate in k/sec
real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo
real (kind=kind_phys), pointer :: sfalb (:) => null() !< mean surface diffused sw albedo
real (kind=kind_phys), pointer :: sfalb_land (:) => null() !< mean surface diffused sw albedo
real (kind=kind_phys), pointer :: sfalb_ice (:) => null() !< mean surface diffused sw albedo

real (kind=kind_phys), pointer :: coszen(:) => null() !< mean cos of zenith angle over rad call period
real (kind=kind_phys), pointer :: tsflw (:) => null() !< surface air temp during lw calculation in k
Expand Down Expand Up @@ -1705,11 +1722,18 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: clouds(:,:,:) => null() !<
real (kind=kind_phys), pointer :: clw(:,:,:) => null() !<
real (kind=kind_phys), pointer :: clw_surf(:) => null() !<
real (kind=kind_phys), pointer :: clw_surf_land(:) => null() !<

Choose a reason for hiding this comment

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

There seem to be many variables that are added to both the Sfcprop and Interstitial DDT. Is this necessary? The interstitial variables aren't even allocated as far as I can see.

Choose a reason for hiding this comment

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

Or, asking the other way round, could we use the Interstitial DDT as much as possible to reduce the memory footprint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, we could. All RUC-specific variables are doubled now: for land and ice. I agree that we should do it the most efficient way.

Choose a reason for hiding this comment

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

Let's try to use the interstitial type then. We should make this switch a controlled experiment. After finalizing the ccpp-physics PR, run all the tests to create a new baseline and make sure we still get b4b reproducible results for warmstart runs. Then switch the variables only, nothing else, and verify against the baseline from before.

real (kind=kind_phys), pointer :: clw_surf_ice(:) => null() !<
real (kind=kind_phys), pointer :: qwv_surf(:) => null() !<
real (kind=kind_phys), pointer :: qwv_surf_land(:) => null() !<
real (kind=kind_phys), pointer :: qwv_surf_ice(:) => null() !<
real (kind=kind_phys), pointer :: clx(:,:) => null() !<
real (kind=kind_phys), pointer :: cmm_ice(:) => null() !<
real (kind=kind_phys), pointer :: cmm_land(:) => null() !<
real (kind=kind_phys), pointer :: cmm_ocean(:) => null() !<
real (kind=kind_phys), pointer :: cndm_surf(:) => null() !<
real (kind=kind_phys), pointer :: cndm_surf_land(:) => null() !<
real (kind=kind_phys), pointer :: cndm_surf_ice(:) => null() !<
real (kind=kind_phys), pointer :: cnv_dqldt(:,:) => null() !<
real (kind=kind_phys), pointer :: cnv_fice(:,:) => null() !<
real (kind=kind_phys), pointer :: cnv_mfd(:,:) => null() !<
Expand Down Expand Up @@ -1939,6 +1963,11 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: tsfc_ocean(:) => null() !<
real (kind=kind_phys), pointer :: tsfg(:) => null() !<
real (kind=kind_phys), pointer :: tsnow(:) => null() !<
real (kind=kind_phys), pointer :: tsnow_land(:) => null() !<
real (kind=kind_phys), pointer :: tsnow_ice(:) => null() !<
real (kind=kind_phys), pointer :: snowfallac(:) => null() !<
real (kind=kind_phys), pointer :: snowfallac_land(:) => null() !<
real (kind=kind_phys), pointer :: snowfallac_ice(:) => null() !<
real (kind=kind_phys), pointer :: tsurf(:) => null() !<
real (kind=kind_phys), pointer :: tsurf_ice(:) => null() !<
real (kind=kind_phys), pointer :: tsurf_land(:) => null() !<
Expand Down Expand Up @@ -2231,6 +2260,8 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%tisfc (IM))
allocate (Sfcprop%tiice (IM,Model%kice))
allocate (Sfcprop%snowd (IM))
allocate (Sfcprop%snowd_land (IM))
allocate (Sfcprop%snowd_ice (IM))
allocate (Sfcprop%zorl (IM))
allocate (Sfcprop%zorlo (IM))
allocate (Sfcprop%zorll (IM))
Expand All @@ -2251,6 +2282,8 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
Sfcprop%tisfc = clear_val
Sfcprop%tiice = clear_val
Sfcprop%snowd = clear_val
Sfcprop%snowd_land = clear_val
Sfcprop%snowd_ice = clear_val
Sfcprop%zorl = clear_val
Sfcprop%zorlo = clear_val
Sfcprop%zorll = clear_val
Expand All @@ -2262,6 +2295,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)

!--- In (radiation only)
allocate (Sfcprop%sncovr (IM))
allocate (Sfcprop%sncovr_ice (IM))
allocate (Sfcprop%snoalb (IM))
allocate (Sfcprop%alvsf (IM))
allocate (Sfcprop%alnsf (IM))
Expand All @@ -2271,6 +2305,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%facwf (IM))

Sfcprop%sncovr = clear_val
Sfcprop%sncovr_ice = clear_val
Sfcprop%snoalb = clear_val
Sfcprop%alvsf = clear_val
Sfcprop%alnsf = clear_val
Expand Down Expand Up @@ -2315,6 +2350,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%hice (IM))
allocate (Sfcprop%weasd (IM))
allocate (Sfcprop%sncovr (IM))
allocate (Sfcprop%sncovr_ice (IM))
allocate (Sfcprop%canopy (IM))
allocate (Sfcprop%ffmm (IM))
allocate (Sfcprop%ffhh (IM))
Expand All @@ -2328,6 +2364,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
Sfcprop%hice = clear_val
Sfcprop%weasd = clear_val
Sfcprop%sncovr = clear_val
Sfcprop%sncovr_ice = clear_val
Sfcprop%canopy = clear_val
Sfcprop%ffmm = clear_val
Sfcprop%ffhh = clear_val
Expand Down Expand Up @@ -2508,26 +2545,47 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
allocate (Sfcprop%smois (IM,Model%lsoil_lsm))
allocate (Sfcprop%tslb (IM,Model%lsoil_lsm))
allocate (Sfcprop%flag_frsoil (IM,Model%lsoil_lsm))
allocate (Sfcprop%clw_surf (IM))
allocate (Sfcprop%qwv_surf (IM))
allocate (Sfcprop%cndm_surf (IM))
allocate (Sfcprop%rhofr (IM))
allocate (Sfcprop%tsnow (IM))
allocate (Sfcprop%snowfallac (IM))
allocate (Sfcprop%acsnow (IM))
allocate (Sfcprop%clw_surf (IM))
allocate (Sfcprop%clw_surf_land (IM))
allocate (Sfcprop%clw_surf_ice (IM))
allocate (Sfcprop%qwv_surf (IM))
allocate (Sfcprop%qwv_surf_land (IM))
allocate (Sfcprop%qwv_surf_ice (IM))
allocate (Sfcprop%cndm_surf (IM))
allocate (Sfcprop%cndm_surf_land(IM))
allocate (Sfcprop%cndm_surf_ice (IM))
allocate (Sfcprop%rhofr (IM))
allocate (Sfcprop%tsnow (IM))
allocate (Sfcprop%tsnow_land (IM))
allocate (Sfcprop%tsnow_ice (IM))
allocate (Sfcprop%snowfallac (IM))
allocate (Sfcprop%snowfallac_land (IM))
allocate (Sfcprop%snowfallac_ice (IM))
allocate (Sfcprop%acsnow (IM))

!
Sfcprop%wetness = clear_val
Sfcprop%sh2o = clear_val
Sfcprop%keepsmfr = clear_val
Sfcprop%smois = clear_val
Sfcprop%tslb = clear_val
Sfcprop%clw_surf = clear_val
Sfcprop%qwv_surf = clear_val
Sfcprop%cndm_surf = clear_val
Sfcprop%clw_surf = clear_val
Sfcprop%clw_surf_land = clear_val
Sfcprop%clw_surf_ice = clear_val
Sfcprop%qwv_surf = clear_val
Sfcprop%qwv_surf_land = clear_val
Sfcprop%qwv_surf_ice = clear_val
Sfcprop%cndm_surf = clear_val
Sfcprop%cndm_surf_land = clear_val
Sfcprop%cndm_surf_ice = clear_val
Sfcprop%flag_frsoil = clear_val
Sfcprop%rhofr = clear_val
Sfcprop%tsnow = clear_val
Sfcprop%tsnow_land = clear_val
Sfcprop%tsnow_ice = clear_val
Sfcprop%snowfallac = clear_val
Sfcprop%snowfallac_land = clear_val
Sfcprop%snowfallac_ice = clear_val
Sfcprop%acsnow = clear_val
!
if (Model%rdlai) then
Expand Down Expand Up @@ -3053,6 +3111,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: lsoil_lsm = -1 !< number of soil layers internal to land surface model; -1 use lsoil
integer :: lsnow_lsm = 3 !< maximum number of snow layers internal to land surface model
logical :: rdlai = .false.
integer :: kice = -1 !< number of layers in ice; -1 use 2
#endif
integer :: ivegsrc = 2 !< ivegsrc = 0 => USGS,
!< ivegsrc = 1 => IGBP (20 category)
Expand Down Expand Up @@ -3361,7 +3420,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
avg_max_length, &
!--- land/surface model control
#ifdef CCPP
lsm, lsoil, lsoil_lsm, lsnow_lsm, rdlai, &
lsm, lsoil, lsoil_lsm, lsnow_lsm, kice, rdlai, &
nmtvr, ivegsrc, use_ufo, &
#else
lsm, lsoil, nmtvr, ivegsrc, use_ufo, &
Expand Down Expand Up @@ -3807,6 +3866,13 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
if (Model%lsm==Model%lsm_ruc) then
allocate (Model%zs(Model%lsoil_lsm))
Model%zs = clear_val
endif
!
! Set number of ice model layers
if (kice==-1) then
Model%kice = 2
else
Model%kice = kice
end if
!
if (lsnow_lsm /= 3) then
Expand Down Expand Up @@ -4927,6 +4993,7 @@ subroutine control_print(Model)
print *, ' rdlai : ', Model%rdlai
print *, ' lsoil_lsm : ', Model%lsoil_lsm
print *, ' lsnow_lsm : ', Model%lsnow_lsm
print *, ' kice : ', Model%kice
#endif
print *, ' ivegsrc : ', Model%ivegsrc
print *, ' isot : ', Model%isot
Expand Down Expand Up @@ -5465,13 +5532,17 @@ subroutine radtend_create (Radtend, IM, Model)
allocate (Radtend%htrsw (IM,Model%levs))
allocate (Radtend%htrlw (IM,Model%levs))
allocate (Radtend%sfalb (IM))
allocate (Radtend%sfalb_land (IM))
allocate (Radtend%sfalb_ice (IM))
allocate (Radtend%coszen (IM))
allocate (Radtend%tsflw (IM))
allocate (Radtend%semis (IM))

Radtend%htrsw = clear_val
Radtend%htrlw = clear_val
Radtend%sfalb = clear_val
Radtend%sfalb_land = clear_val
Radtend%sfalb_ice = clear_val
Radtend%coszen = clear_val
Radtend%tsflw = clear_val
Radtend%semis = clear_val
Expand Down
Loading