@@ -62,14 +62,13 @@ subroutine CICE_Run
6262 use ice_timers, only: ice_timer_start, &
6363 ice_timer_stop, timer_couple, timer_step, &
6464 timer_from_atm, timer_into_atm, timer_from_ocn, timer_into_ocn
65- use ice_grid, only: t2ugrid_vector, u2tgrid_vector
65+ use ice_grid, only: t2ugrid_vector
6666 integer (kind= int_kind) :: time_sec, itap, icpl_ai, tmp_time
6767 integer (kind= int_kind) :: rtimestamp_ai, stimestamp_ai
6868 integer (kind= int_kind) :: rtimestamp_io, stimestamp_io
6969 ! receive and send timestamps (seconds)
7070 integer (kind= int_kind) :: imon
7171
72- logical :: write_tmp_dump = .true.
7372#endif
7473
7574 !- -------------------------------------------------------------------
@@ -83,9 +82,12 @@ subroutine CICE_Run
8382 !- -------------------------------------------------------------------
8483
8584#ifdef ACCESS
86- write (il_out,* )' A <==> I coupling num_cpl_ai = ' ,num_cpl_ai
87- write (il_out,* )' ice steps per ai interval num_ice_ai = ' ,num_ice_ai
88- write (il_out,* )' runtime, runtime0 = ' ,runtime, runtime0
85+
86+ if (my_task == master_task) then
87+ write (il_out,* )' A <==> I coupling num_cpl_ai = ' ,num_cpl_ai
88+ write (il_out,* )' ice steps per ai interval num_ice_ai = ' ,num_ice_ai
89+ write (il_out,* )' runtime, runtime0 = ' ,runtime, runtime0
90+ endif
8991
9092 time_sec = 0
9193
@@ -94,7 +96,7 @@ subroutine CICE_Run
9496 ! receive a2i fields
9597 rtimestamp_ai = time_sec
9698 ! call ice_timer_start(timer_from_atm) ! atm/ice coupling
97- write (il_out,* )' calling from_atm at icpl_ai, time_sec = ' , icpl_ai, time_sec
99+ ! write(il_out,*)' calling from_atm at icpl_ai, time_sec = ', icpl_ai, time_sec
98100 ! ===========================
99101 call from_atm(rtimestamp_ai)
100102 ! ===========================
@@ -116,8 +118,8 @@ subroutine CICE_Run
116118 call t2ugrid_vector(io_strsu)
117119 call t2ugrid_vector(io_strsv)
118120
119- write (il_out,' (a,3i10)' ) &
120- ' calling into_ocn at icpl_ai, itap, time_sec = ' , icpl_ai, itap, time_sec
121+ ! write(il_out,'(a,3i10)') &
122+ ! ' calling into_ocn at icpl_ai, itap, time_sec = ', icpl_ai, itap, time_sec
121123 ! call ice_timer_start(timer_into_ocn) ! atm/ocn coupling
122124 ! ===========================
123125 ! call check_iceberg_fields('chk_iceberg_i2o.nc')
@@ -161,8 +163,8 @@ subroutine CICE_Run
161163
162164 stimestamp_ai = time_sec
163165
164- write (il_out,' (a,3i10)' ) &
165- ' calling into_atm at icpl_ai, itap, time_sec = ' ,icpl_ai, itap, time_sec
166+ ! write(il_out,'(a,3i10)') &
167+ ! ' calling into_atm at icpl_ai, itap, time_sec = ',icpl_ai, itap, time_sec
166168 ! ===========================
167169 call into_atm(stimestamp_ai)
168170 ! ===========================
@@ -292,6 +294,10 @@ subroutine ice_step
292294 use ice_algae, only: bgc_diags, write_restart_bgc
293295 use ice_zbgc, only: init_history_bgc, biogeochemistry
294296 use ice_zbgc_shared, only: skl_bgc
297+ #ifdef ACCESS
298+ use ice_state, only: vsno, aice, tr_pond
299+ use ice_flux, only: snowfrac
300+ #endif
295301
296302 integer (kind= int_kind) :: &
297303 iblk , & ! block index
@@ -428,20 +434,12 @@ subroutine coupling_prep (iblk)
428434 use ice_constants, only: c0, c1, puny, rhofresh
429435 use ice_coupling, only: top_layer_Tandk_run, sfcflux_to_ocn
430436 use ice_domain_size, only: ncat
431- use ice_flux, only: alvdf, alidf, alvdr, alidr, albice, albsno, &
432- albpnd, albcnt, apeff_ai, coszen, fpond, fresh, &
433- alvdf_ai, alidf_ai, alvdr_ai, alidr_ai, fhocn_ai, &
434- fresh_ai, fsalt_ai, fsalt, &
435- fswthru_ai, fhocn, fswthru, scale_factor, &
436- swvdr, swidr, swvdf, swidf, Tf, Tair, Qa, strairxT, strairyt, &
437- fsens, flat, fswabs, flwout, evap, Tref, Qref, faero_ocn, &
438- fsurfn_f, flatn_f, scale_fluxes, frzmlt_init, frzmlt, &
439- snowfrac, snowfracn, evap_ice, evap_snow
437+ use ice_flux
440438 use ice_grid, only: tmask
441439 use ice_ocean, only: oceanmixed_ice, ocean_mixed_layer
442440 use ice_shortwave, only: alvdfn, alidfn, alvdrn, alidrn, &
443441 albicen, albsnon, albpndn, apeffn
444- use ice_state, only: aicen, aice, aice_init, nbtrcr
442+ use ice_state, only: aicen, aice, aice_init, nbtrcr, tr_pond, vsno
445443 use ice_therm_shared, only: calc_Tsfc, heat_capacity
446444 use ice_timers, only: timer_couple, ice_timer_start, ice_timer_stop
447445 use ice_zbgc_shared, only: flux_bio, flux_bio_ai
@@ -527,8 +525,19 @@ subroutine coupling_prep (iblk)
527525
528526 apeff_ai(i,j,iblk) = apeff_ai(i,j,iblk) & ! for history
529527 + apeffn(i,j,n,iblk)* aicen(i,j,n,iblk)
530- snowfrac(i,j,iblk) = snowfrac(i,j,iblk) & ! for history
531- + snowfracn(i,j,n,iblk)* aicen(i,j,n,iblk)
528+
529+ if ( .not. tr_pond .and. .not. calc_Tsfc ) then
530+ ! calculate a snowfrac diagnostic in the same way the UM does
531+ ! set snow fraction using JULES empirical formula based
532+ ! on snow volume
533+ ! ref: https://github.com/ACCESS-NRI/UM7/blob/6602dadd15c190ee37c6644190f52d428bc66917/umbase_hg3/src/atmosphere/short_wave_radiation/ftsa.F90#L201-L202
534+ if (aice(i,j,iblk) > 2e-4 ) &
535+ snowfrac(i,j,iblk) = c1 - exp (- p2* rhos* (vsno(i,j,iblk) / aice(i,j,iblk)))
536+ else
537+ snowfrac(i,j,iblk) = snowfrac(i,j,iblk) & ! for history
538+ + snowfracn(i,j,n,iblk)* aicen(i,j,n,iblk)
539+ endif
540+
532541 enddo
533542 enddo
534543 enddo
@@ -555,6 +564,15 @@ subroutine coupling_prep (iblk)
555564 fsalt_ai (i,j,iblk) = fsalt (i,j,iblk)
556565 fhocn_ai (i,j,iblk) = fhocn (i,j,iblk)
557566 fswthru_ai(i,j,iblk) = fswthru(i,j,iblk)
567+ fsens_ai (i,j,iblk) = fsens(i,j,iblk)
568+ flat_ai (i,j,iblk) = flat(i,j,iblk)
569+ fswabs_ai (i,j,iblk) = fswabs(i,j,iblk)
570+ flwout_ai (i,j,iblk) = flwout(i,j,iblk)
571+ evap_ai (i,j,iblk) = evap(i,j,iblk)
572+ evap_ice_ai(i,j,iblk) = evap_ice(i,j,iblk)
573+ evap_snow_ai(i,j,iblk) = evap_snow(i,j,iblk)
574+ fcondtop_ai(i,j,iblk) = fcondtop(i,j,iblk)
575+ fsurf_ai(i,j,iblk) = fsurf(i,j,iblk)
558576
559577 if (nbtrcr > 0 ) then
560578 do k = 1 , nbtrcr
0 commit comments