Skip to content

Commit 9868550

Browse files
authored
Initialize ice fluxes and add "tiice" array (NCAR#119)
(1) Introducing a separate array "tiice" to store internal ice temperature. "tiice" will be added to phyf*nc output only when frac_grid=T. (2) When cplflx=T, initializing ice fluxes by PBL calculated values when fluxes from CICE are unavailable. (3) Adding frac_grid to namelist and no longer modifying it inside FV3GFS_io.F90. frac_grid=F by default.
1 parent 6590d4b commit 9868550

File tree

5 files changed

+84
-39
lines changed

5 files changed

+84
-39
lines changed

gfsphysics/GFS_layer/GFS_diagnostics.F90

+17-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ module GFS_diagnostics
1313
GFS_stateout_type, GFS_sfcprop_type, &
1414
GFS_coupling_type, GFS_grid_type, &
1515
GFS_tbd_type, GFS_cldprop_type, &
16-
GFS_radtend_type, GFS_diag_type, &
16+
GFS_radtend_type, GFS_diag_type, &
1717
GFS_init_type
1818
implicit none
1919
private
@@ -2778,6 +2778,22 @@ subroutine GFS_externaldiag_populate (ExtDiag, Model, Statein, Stateout, Sfcprop
27782778
ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tsfc(:)
27792779
enddo
27802780

2781+
if (Model%frac_grid) then
2782+
do num = 1,Model%kice
2783+
write (xtra,'(i1)') num
2784+
idx = idx + 1
2785+
ExtDiag(idx)%axes = 2
2786+
ExtDiag(idx)%name = 'tiice'//trim(xtra)
2787+
ExtDiag(idx)%desc = 'internal ice temperature layer ' // trim(xtra)
2788+
ExtDiag(idx)%unit = 'K'
2789+
ExtDiag(idx)%mod_name = 'gfs_sfc'
2790+
allocate (ExtDiag(idx)%data(nblks))
2791+
do nb = 1,nblks
2792+
ExtDiag(idx)%data(nb)%var2 => Sfcprop(nb)%tiice(:,num)
2793+
enddo
2794+
enddo
2795+
end if
2796+
27812797
idx = idx + 1
27822798
ExtDiag(idx)%axes = 2
27832799
ExtDiag(idx)%name = 'tg3'

gfsphysics/GFS_layer/GFS_typedefs.F90

+6-11
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ module GFS_typedefs
236236
real (kind=kind_phys), pointer :: tsfco (:) => null() !< sst in K
237237
real (kind=kind_phys), pointer :: tsfcl (:) => null() !< surface land temperature in K
238238
real (kind=kind_phys), pointer :: tisfc (:) => null() !< surface temperature over ice fraction
239+
real (kind=kind_phys), pointer :: tiice(:,:) => null() !< internal ice temperature
239240
real (kind=kind_phys), pointer :: snowd (:) => null() !< snow depth water equivalent in mm ; same as snwdph
240241
real (kind=kind_phys), pointer :: zorl (:) => null() !< composite surface roughness in cm
241242
real (kind=kind_phys), pointer :: zorlo (:) => null() !< ocean surface roughness in cm
@@ -751,6 +752,7 @@ module GFS_typedefs
751752
integer :: lsm_noahmp=2 !< flag for NOAH land surface model
752753
integer :: lsm_ruc=3 !< flag for RUC land surface model
753754
integer :: lsoil !< number of soil layers
755+
integer :: kice=2 !< number of layers in sice
754756
#ifdef CCPP
755757
integer :: lsoil_lsm !< number of soil layers internal to land surface model
756758
integer :: lsnow_lsm !< maximum number of snow layers internal to land surface model
@@ -955,7 +957,6 @@ module GFS_typedefs
955957
!< nstf_name(5) : zsea2 in mm
956958
!--- fractional grid
957959
logical :: frac_grid !< flag for fractional grid
958-
logical :: frac_grid_off !< flag for using fractional grid
959960
logical :: ignore_lake !< flag for ignoring lakes
960961
real(kind=kind_phys) :: min_lakeice !< minimum lake ice value
961962
real(kind=kind_phys) :: min_seaice !< minimum sea ice value
@@ -2169,6 +2170,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
21692170
allocate (Sfcprop%tsfco (IM))
21702171
allocate (Sfcprop%tsfcl (IM))
21712172
allocate (Sfcprop%tisfc (IM))
2173+
allocate (Sfcprop%tiice (IM,Model%kice))
21722174
allocate (Sfcprop%snowd (IM))
21732175
allocate (Sfcprop%zorl (IM))
21742176
allocate (Sfcprop%zorlo (IM))
@@ -2185,6 +2187,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
21852187
Sfcprop%tsfco = clear_val
21862188
Sfcprop%tsfcl = clear_val
21872189
Sfcprop%tisfc = clear_val
2190+
Sfcprop%tiice = clear_val
21882191
Sfcprop%snowd = clear_val
21892192
Sfcprop%zorl = clear_val
21902193
Sfcprop%zorlo = clear_val
@@ -3152,7 +3155,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
31523155
!< nstf_name(5) : zsea2 in mm
31533156
!--- fractional grid
31543157
logical :: frac_grid = .false. !< flag for fractional grid
3155-
logical :: frac_grid_off = .true. !< flag for using fractional grid
31563158
logical :: ignore_lake = .true. !< flag for ignoring lakes
31573159
real(kind=kind_phys) :: min_lakeice = 0.15d0 !< minimum lake ice value
31583160
real(kind=kind_phys) :: min_seaice = 1.0d-11 !< minimum sea ice value
@@ -3316,7 +3318,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
33163318
!--- near surface sea temperature model
33173319
nst_anl, lsea, nstf_name, &
33183320
frac_grid, min_lakeice, min_seaice, min_lake_height, &
3319-
frac_grid_off, ignore_lake, &
3321+
ignore_lake, &
33203322
!--- surface layer
33213323
sfc_z0_type, &
33223324
! vertical diffusion
@@ -3773,14 +3775,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
37733775

37743776
!--- fractional grid
37753777
Model%frac_grid = frac_grid
3776-
Model%frac_grid_off = frac_grid_off
37773778
Model%ignore_lake = ignore_lake
3778-
#ifdef CCPP
3779-
if (Model%frac_grid) then
3780-
write(0,*) "ERROR: CCPP has not been tested with fractional landmask turned on"
3781-
! stop
3782-
end if
3783-
#endif
37843779
Model%min_lakeice = min_lakeice
37853780
Model%min_seaice = min_seaice
37863781
Model%min_lake_height = min_lake_height
@@ -4167,7 +4162,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
41674162
endif
41684163

41694164
print *,' nst_anl=',Model%nst_anl,' use_ufo=',Model%use_ufo,' frac_grid=',Model%frac_grid,&
4170-
' frac_grid_off=',frac_grid_off,' ignore_lake=',ignore_lake
4165+
' ignore_lake=',ignore_lake
41714166
print *,' min_lakeice=',Model%min_lakeice,' min_seaice=',Model%min_seaice, &
41724167
'min_lake_height=',Model%min_lake_height
41734168
if (Model%nstf_name(1) > 0 ) then

gfsphysics/GFS_layer/GFS_typedefs.meta

+13
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,13 @@
492492
dimensions = (horizontal_dimension)
493493
type = real
494494
kind = kind_phys
495+
[tiice]
496+
standard_name = internal_ice_temperature
497+
long_name = sea ice internal temperature
498+
units = K
499+
dimensions = (horizontal_dimension,ice_vertical_dimension)
500+
type = real
501+
kind = kind_phys
495502
[snowd]
496503
standard_name = surface_snow_thickness_water_equivalent
497504
long_name = water equivalent snow depth
@@ -2752,6 +2759,12 @@
27522759
units = flag
27532760
dimensions = ()
27542761
type = integer
2762+
[kice]
2763+
standard_name = ice_vertical_dimension
2764+
long_name = vertical loop extent for ice levels, start at 1
2765+
units = count
2766+
dimensions = ()
2767+
type = integer
27552768
[lsoil]
27562769
standard_name = soil_vertical_dimension
27572770
long_name = number of soil layers

io/FV3GFS_io.F90

+47-26
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module FV3GFS_io_mod
7979

8080
!--- GFDL FMS restart containers
8181
character(len=32), allocatable, dimension(:) :: oro_name2, sfc_name2, sfc_name3
82-
real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_var2, sfc_var2, phy_var2
82+
real(kind=kind_phys), allocatable, target, dimension(:,:,:) :: oro_var2, sfc_var2, phy_var2, sfc_var3ice
8383
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: sfc_var3, phy_var3
8484
!--- Noah MP restart containers
8585
real(kind=kind_phys), allocatable, target, dimension(:,:,:,:) :: sfc_var3sn,sfc_var3eq,sfc_var3zn
@@ -89,7 +89,7 @@ module FV3GFS_io_mod
8989
integer :: tot_diag_idx = 0
9090
integer :: total_outputlevel = 0
9191
integer :: isco,ieco,jsco,jeco,levo,num_axes_phys
92-
integer :: fhzero, ncld, nsoil, imp_physics, landsfcmdl
92+
integer :: fhzero, ncld, nsoil, imp_physics, landsfcmdl, k
9393
real(4) :: dtp
9494
logical :: lprecip_accu
9595
character(len=64) :: Sprecip_accu
@@ -193,9 +193,9 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block)
193193
ntr = size(IPD_Data(1)%Statein%qgrs,3)
194194

195195
if(Model%lsm == Model%lsm_noahmp) then
196-
nsfcprop2d = 149
196+
nsfcprop2d = 151
197197
else
198-
nsfcprop2d = 100
198+
nsfcprop2d = 102
199199
endif
200200

201201
allocate (temp2d(isc:iec,jsc:jec,nsfcprop2d+Model%ntot3d+Model%nctp))
@@ -321,8 +321,10 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block)
321321
temp2d(i,j,82) = IPD_Data(nb)%Radtend%sfcflw(ix)%upfx0
322322
temp2d(i,j,83) = IPD_Data(nb)%Radtend%sfcflw(ix)%dnfxc
323323
temp2d(i,j,84) = IPD_Data(nb)%Radtend%sfcflw(ix)%dnfx0
324+
temp2d(i,j,85) = IPD_Data(nb)%Sfcprop%tiice(ix,1)
325+
temp2d(i,j,86) = IPD_Data(nb)%Sfcprop%tiice(ix,2)
324326

325-
idx_opt = 85
327+
idx_opt = 87
326328
if (Model%lsm == Model%lsm_noahmp) then
327329
temp2d(i,j,idx_opt) = IPD_Data(nb)%Sfcprop%snowxy(ix)
328330
temp2d(i,j,idx_opt+1) = IPD_Data(nb)%Sfcprop%tvxy(ix)
@@ -374,7 +376,7 @@ subroutine FV3GFS_IPD_checksum (Model, IPD_Data, Atm_block)
374376
temp2d(i,j,idx_opt+46) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,2)
375377
temp2d(i,j,idx_opt+47) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,3)
376378
temp2d(i,j,idx_opt+48) = IPD_Data(nb)%Sfcprop%zsnsoxy(ix,4)
377-
idx_opt = 134
379+
idx_opt = 136
378380
endif
379381

380382
if (Model%nstf_name(1) > 0) then
@@ -602,7 +604,6 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
602604
call mpp_error(NOTE,'reading topographic/orographic information from INPUT/oro_data.tile*.nc')
603605
call restore_state(Oro_restart)
604606

605-
Model%frac_grid = .false.
606607
!--- copy data into GFS containers
607608
do nb = 1, Atm_block%nblks
608609
!--- 2D variables
@@ -635,17 +636,6 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
635636
enddo
636637
enddo
637638

638-
if (nint(oro_var2(1,1,18)) == -9999._kind_phys) then ! lakefrac doesn't exist in the restart, need to create it
639-
if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - will computing lakefrac')
640-
Model%frac_grid = .false.
641-
elseif (Model%frac_grid_off) then
642-
Model%frac_grid = .false.
643-
else
644-
Model%frac_grid = .true.
645-
endif
646-
647-
if (Model%me == Model%master ) write(0,*)' resetting Model%frac_grid=',Model%frac_grid
648-
649639
!--- deallocate containers and free restart container
650640
deallocate(oro_name2, oro_var2)
651641
call free_restart_type(Oro_restart)
@@ -655,23 +645,24 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
655645
!--- allocate the various containers needed for restarts
656646
#ifdef CCPP
657647
allocate(sfc_name2(nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r))
658-
allocate(sfc_name3(nvar_s3+nvar_s3mp))
648+
allocate(sfc_name3(0:nvar_s3+nvar_s3mp))
659649

660-
allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r))
650+
allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp+nvar_s2r),sfc_var3ice(nx,ny,Model%kice))
661651
if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp .or. (.not.warm_start)) then
662652
allocate(sfc_var3(nx,ny,Model%lsoil,nvar_s3))
663653
else if (Model%lsm == Model%lsm_ruc) then
664654
allocate(sfc_var3(nx,ny,Model%lsoil_lsm,nvar_s3))
665655
end if
666656
#else
667657
allocate(sfc_name2(nvar_s2m+nvar_s2o+nvar_s2mp))
668-
allocate(sfc_name3(nvar_s3+nvar_s3mp))
658+
allocate(sfc_name3(0:nvar_s3+nvar_s3mp))
669659

670660
allocate(sfc_var2(nx,ny,nvar_s2m+nvar_s2o+nvar_s2mp))
671661
allocate(sfc_var3(nx,ny,Model%lsoil,nvar_s3))
672662
#endif
673663
sfc_var2 = -9999._kind_phys
674664
sfc_var3 = -9999._kind_phys
665+
sfc_var3ice= -9999._kind_phys
675666
!
676667
if (Model%lsm == Model%lsm_noahmp) then
677668
allocate(sfc_var3sn(nx,ny,-2:0,4:6))
@@ -717,8 +708,8 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
717708
!--- variables below here are optional
718709
sfc_name2(32) = 'sncovr'
719710
if(Model%cplflx) then
720-
sfc_name2(33) = 'tsfcl' !temp on land portion of a cell
721-
sfc_name2(34) = 'zorll' !zorl on land portion of a cell
711+
sfc_name2(33) = 'tsfcl' !temp on land portion of a cell
712+
sfc_name2(34) = 'zorll' !zorl on land portion of a cell
722713
end if
723714

724715
!--- NSSTM inputs only needed when (nstf_name(1) > 0) .and. (nstf_name(2)) == 0)
@@ -865,6 +856,12 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
865856
endif
866857
#endif
867858
!--- register the 3D fields
859+
if (Model%frac_grid) then
860+
sfc_name3(0) = 'tiice'
861+
var3_p => sfc_var3ice(:,:,:)
862+
id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(0), var3_p, domain=fv_domain, mandatory=.false.)
863+
end if
864+
868865
do num = 1,nvar_s3
869866
var3_p => sfc_var3(:,:,:,num)
870867
id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(num), var3_p, domain=fv_domain)
@@ -1087,6 +1084,10 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
10871084
Sfcprop(nb)%flag_frsoil(ix,lsoil) = sfc_var3(i,j,lsoil,5) !--- flag_frsoil
10881085
enddo
10891086
end if
1087+
1088+
do k = 1,Model%kice
1089+
Sfcprop(nb)%tiice(ix,k)= sfc_var3ice(i,j,k) !--- internal ice temp
1090+
enddo
10901091
#else
10911092
!--- 3D variables
10921093
do lsoil = 1,Model%lsoil
@@ -1155,7 +1156,7 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
11551156
enddo
11561157
endif
11571158

1158-
if(Model%cplflx .or. Model%frac_grid) then
1159+
if (Model%cplflx .or. Model%frac_grid) then
11591160
if (nint(sfc_var2(1,1,33)) == -9999) then
11601161
if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing tsfcl')
11611162
do nb = 1, Atm_block%nblks
@@ -1175,6 +1176,16 @@ subroutine sfc_prop_restart_read (Sfcprop, Atm_block, Model, fv_domain)
11751176
endif
11761177
endif
11771178

1179+
if (nint(sfc_var3ice(1,1,1)) == -9999) then
1180+
if (Model%me == Model%master ) call mpp_error(NOTE, 'gfs_driver::surface_props_input - computing tiice')
1181+
do nb = 1, Atm_block%nblks
1182+
do ix = 1, Atm_block%blksz(nb)
1183+
Sfcprop(nb)%tiice(ix,1) = Sfcprop(nb)%stc(ix,1) !--- initialize internal ice temp from soil temp at layer 1
1184+
Sfcprop(nb)%tiice(ix,2) = Sfcprop(nb)%stc(ix,2) !--- initialize internal ice temp from soil temp at layer 2
1185+
enddo
1186+
enddo
1187+
endif
1188+
11781189
!#endif
11791190

11801191
if(Model%frac_grid) then ! 3-way composite
@@ -1561,7 +1572,7 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta
15611572
!--- allocate the various containers needed for restarts
15621573
#ifdef CCPP
15631574
allocate(sfc_name2(nvar2m+nvar2o+nvar2mp+nvar2r))
1564-
allocate(sfc_name3(nvar3+nvar3mp))
1575+
allocate(sfc_name3(0:nvar3+nvar3mp))
15651576
allocate(sfc_var2(nx,ny,nvar2m+nvar2o+nvar2mp+nvar2r))
15661577
if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then
15671578
allocate(sfc_var3(nx,ny,Model%lsoil,nvar3))
@@ -1570,7 +1581,7 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta
15701581
endif
15711582
#else
15721583
allocate(sfc_name2(nvar2m+nvar2o+nvar2mp))
1573-
allocate(sfc_name3(nvar3+nvar3mp))
1584+
allocate(sfc_name3(0:nvar3+nvar3mp))
15741585
allocate(sfc_var2(nx,ny,nvar2m+nvar2o+nvar2mp))
15751586
allocate(sfc_var3(nx,ny,Model%lsoil,nvar3))
15761587
#endif
@@ -1762,6 +1773,12 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta
17621773
#endif
17631774

17641775
!--- register the 3D fields
1776+
if (Model%frac_grid) then
1777+
sfc_name3(0) = 'tiice'
1778+
var3_p => sfc_var3ice(:,:,:)
1779+
id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(0), var3_p, domain=fv_domain)
1780+
end if
1781+
17651782
do num = 1,nvar3
17661783
var3_p => sfc_var3(:,:,:,num)
17671784
id_restart = register_restart_field(Sfc_restart, fn_srf, sfc_name3(num), var3_p, domain=fv_domain)
@@ -1901,6 +1918,10 @@ subroutine sfc_prop_restart_write (Sfcprop, Atm_block, Model, fv_domain, timesta
19011918
endif
19021919

19031920
#ifdef CCPP
1921+
do k = 1,Model%kice
1922+
sfc_var3ice(i,j,k) = Sfcprop(nb)%tiice(ix,k) !--- internal ice temperature
1923+
end do
1924+
19041925
if (Model%lsm == Model%lsm_noah .or. Model%lsm == Model%lsm_noahmp) then
19051926
!--- 3D variables
19061927
do lsoil = 1,Model%lsoil

0 commit comments

Comments
 (0)