@@ -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)
0 commit comments