Skip to content

Commit a214a72

Browse files
authored
Fix some bugs with the last CMIP7 PR (#1088)
Bug fix for lwout in CESM driver Also some FSD stuff for coupling Fix define for sitimefrac Add the CESM3 namelist changes
1 parent 7c59f23 commit a214a72

3 files changed

Lines changed: 44 additions & 19 deletions

File tree

cicecore/cicedyn/analysis/ice_history.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ subroutine init_hist (dt)
18231823
"fraction of time steps with sea ice", &
18241824
"averaging period during which sea ice is present (siconc > 0) in a grid cell", &
18251825
c1, c0, &
1826-
ns1, f_icepresent, avg_ice_present='none', mask_ice_free_points=.false.)
1826+
ns1, f_sitimefrac, avg_ice_present='none', mask_ice_free_points=.false.)
18271827

18281828
call define_hist_field(n_sivol,"sivol","m",tstr2D, tcstr, &
18291829
"sea-ice volume per area", &

cicecore/drivers/nuopc/cmeps/ice_import_export.F90

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ module ice_import_export
9494
type (fld_list_type) :: fldsToIce(fldsMax)
9595
type (fld_list_type) :: fldsFrIce(fldsMax)
9696

97+
logical :: flds_wave ! wave ice coupling
9798
integer , parameter :: io_dbug = 10 ! i/o debug messages
9899
character(*), parameter :: u_FILE_u = &
99100
__FILE__
@@ -116,7 +117,6 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
116117
character(char_len) :: stdname
117118
character(char_len) :: cvalue
118119
logical :: flds_wiso ! use case
119-
logical :: flds_wave ! use case
120120
logical :: isPresent, isSet
121121
character(len=*), parameter :: subname='(ice_import_export:ice_advertise_fields)'
122122
!-------------------------------------------------------------------------------
@@ -266,10 +266,13 @@ subroutine ice_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
266266
! ice/ocn fluxes computed by ice
267267
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_melth' )
268268
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen' )
269-
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_vdr' )
270-
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_vdf' )
271-
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_idr' )
272-
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_idf' )
269+
270+
if (.not.prescribed_ice) then
271+
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_vdr' )
272+
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_vdf' )
273+
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_idr' )
274+
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_idf' )
275+
endif
273276

274277
if (send_i2x_per_cat) then
275278
call fldlist_add(fldsFrIce_num, fldsFrIce, 'Fioi_swpen_ifrac_n', &
@@ -926,7 +929,7 @@ subroutine ice_export( exportState, rc )
926929
real (kind=dbl_kind) :: floethick(nx_block,ny_block,max_blocks) ! ice thickness
927930
logical (kind=log_kind) :: tr_fsd
928931
integer (kind=int_kind) :: nt_fsd
929-
real (kind=dbl_kind) :: Tffresh
932+
real (kind=dbl_kind) :: Tffresh, stefan_boltzmann
930933
real (kind=dbl_kind), allocatable :: tempfld(:,:,:)
931934
real (kind=dbl_kind), pointer :: dataptr_ifrac_n(:,:)
932935
real (kind=dbl_kind), pointer :: dataptr_swpen_n(:,:)
@@ -938,6 +941,7 @@ subroutine ice_export( exportState, rc )
938941
if (io_dbug > 5) call ESMF_LogWrite(subname//' called', ESMF_LOGMSG_INFO)
939942

940943
call icepack_query_parameters(Tffresh_out=Tffresh)
944+
call icepack_query_parameters(stefan_boltzmann_out=stefan_boltzmann)
941945
! call icepack_query_parameters(tfrz_option_out=tfrz_option, &
942946
! modal_aero_out=modal_aero, z_tracers_out=z_tracers, skl_bgc_out=skl_bgc, &
943947
! Tffresh_out=Tffresh)
@@ -980,25 +984,30 @@ subroutine ice_export( exportState, rc )
980984
! surface temperature
981985
Tsrf(i,j,iblk) = Tffresh + trcr(i,j,1,iblk) !Kelvin (original ???)
982986

983-
if (tr_fsd) then
987+
if (flds_wave) then
984988
! floe thickness (m)
985989
if (aice(i,j,iblk) > puny) then
986990
floethick(i,j,iblk) = vice(i,j,iblk) / aice(i,j,iblk)
987991
else
988992
floethick(i,j,iblk) = c0
989993
end if
990994

991-
! floe diameter (m)
992-
workx = c0
993-
worky = c0
994-
do n = 1, ncat
995-
do k = 1, nfsd
996-
workx = workx + floe_rad_c(k) * aicen_init(i,j,n,iblk) * trcrn(i,j,nt_fsd+k-1,n,iblk)
997-
worky = worky + aicen_init(i,j,n,iblk) * trcrn(i,j,nt_fsd+k-1,n,iblk)
995+
if (tr_fsd) then
996+
! floe diameter (m)
997+
workx = c0
998+
worky = c0
999+
do n = 1, ncat
1000+
do k = 1, nfsd
1001+
workx = workx + floe_rad_c(k) * aicen_init(i,j,n,iblk) * trcrn(i,j,nt_fsd+k-1,n,iblk)
1002+
worky = worky + aicen_init(i,j,n,iblk) * trcrn(i,j,nt_fsd+k-1,n,iblk)
1003+
end do
9981004
end do
999-
end do
1000-
if (worky > c0) workx = c2*workx / worky
1001-
floediam(i,j,iblk) = MAX(c2*floe_rad_c(1),workx)
1005+
if (worky > c0) workx = c2*workx / worky
1006+
floediam(i,j,iblk) = MAX(c2*floe_rad_c(1),workx)
1007+
else ! with FSD off
1008+
! floe diameter (m)
1009+
floediam(i,j,iblk) = 50.0_dbl_kind
1010+
endif
10021011
endif
10031012

10041013
! wind stress (on POP T-grid: convert to lat-lon)
@@ -1204,7 +1213,7 @@ subroutine ice_export( exportState, rc )
12041213
do j = jlo, jhi
12051214
do i = ilo, ihi
12061215
if ( tmask(i,j,iblk) .and. ailohi(i,j,iblk) > c0 .and. flwout(i,j,iblk) > -puny) then
1207-
tempfld(i,j,iblk) = (-stefan_boltzmann *(Tf(i,j) + Tffresh)**4) / ailohi(i,j,iblk)
1216+
tempfld(i,j,iblk) = (-stefan_boltzmann *(Tf(i,j,iblk) + Tffresh)**4) / ailohi(i,j,iblk)
12081217
end if
12091218
end do
12101219
end do
@@ -1235,6 +1244,8 @@ subroutine ice_export( exportState, rc )
12351244
areacor=mod2med_areacor, rc=rc)
12361245
if (ChkErr(rc,__LINE__,u_FILE_u)) return
12371246

1247+
if (.not.prescribed_ice) then
1248+
12381249
! flux of vis dir shortwave through ice to ocean
12391250
call state_setexport(exportState, 'Fioi_swpen_vdr' , input=fswthru_vdr, lmask=tmask, ifrac=ailohi, &
12401251
areacor=mod2med_areacor, rc=rc)
@@ -1255,6 +1266,8 @@ subroutine ice_export( exportState, rc )
12551266
areacor=mod2med_areacor, rc=rc)
12561267
if (ChkErr(rc,__LINE__,u_FILE_u)) return
12571268

1269+
endif
1270+
12581271
! flux of heat exchange with ocean
12591272
call state_setexport(exportState, 'Fioi_melth' , input=fhocn, lmask=tmask, ifrac=ailohi, &
12601273
areacor=mod2med_areacor, rc=rc)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
congel_freeze = 'one-step'
3+
hist_time_axis = 'middle'
4+
nfsd = 12
5+
nfreq = 25
6+
snwredist = "snwITDrdg"
7+
tr_fsd = .true.
8+
tr_ponds_lvl = .false.
9+
tr_ponds_sealvl = .true.
10+
tr_snow = .true.
11+
tscale_pnd_drain = 0.5d0
12+
wave_frac_spec = 'alt'

0 commit comments

Comments
 (0)