Skip to content

Commit

Permalink
Merge pull request #2 from DeniseWorthen/pr-duplicate
Browse files Browse the repository at this point in the history
Updates to Consortium/main include the following.

More accurate calculation of areafact in remapping CICE-Consortium#849. This PR implements improvements to the areafact calculation for remapping. This PR will change baselines (as expected). As noted in the 6.5 release notes, this improves C-grid solutions
Update Icepack, add snicar and snicartest tests CICE-Consortium#902. This PR includes an update to Icepack to use -puny when limiting fluxes (use -puny in denominator of scaling ratio for flux limiting  CICE-Consortium/Icepack#474). This PR will change baselines (as expected).
Update update_ocn_f implementation, Add cpl_frazil namelist CICE-Consortium#889. This PR adds a new name list configuration cpl_frazil to address an issue first noted in update_ocn_f problem CICE-Consortium/Icepack#390. In UWM the default configuration when coupled to FV3atm is ktherm=2 and update_ocn_f=true, meaning the salt and freshwater fluxes are computed in CICE and passed to MOM6. For this configuration, the default of cpl_frazil will be fresh_ice_corr. Testing has shown this PR alone does not change answers in UWM for either the ktherm=1 or ktherm=2 cases.
  • Loading branch information
DeniseWorthen authored Dec 20, 2023
2 parents 50aa2c9 + cefa7cd commit c675280
Show file tree
Hide file tree
Showing 104 changed files with 4,333 additions and 4,237 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "icepack"]
path = icepack
url = https://github.com/cice-consortium/Icepack
url = https://github.com/cice-consortium/icepack
2 changes: 1 addition & 1 deletion cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -1189,7 +1189,7 @@ source ./cice.settings
set bldstat = 0
if (\${dobuild} == true) then
if (\${doreuse} == true) then
set ciceexe = "../ciceexe.\${ICE_TARGET}.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}"
set ciceexe = "../ciceexe.\${ICE_TARGET}.\${ICE_ENVNAME}.\${ICE_COMMDIR}.\${ICE_BLDDEBUG}.\${ICE_THREADED}.\${ICE_IOTYPE}.\${ICE_SNICARHC}"
./cice.build --exe \${ciceexe}
set bldstat = \${status}
if !(-e \${ciceexe}) cp -p \${ICE_RUNDIR}/cice \${ciceexe}
Expand Down
5 changes: 3 additions & 2 deletions cicecore/cicedyn/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ subroutine runtime_diags (dt)
use ice_flux, only: alvdr, alidr, alvdf, alidf, evap, fsnow, frazil, &
fswabs, fswthru, flw, flwout, fsens, fsurf, flat, frzmlt_init, frain, fpond, &
fhocn_ai, fsalt_ai, fresh_ai, frazil_diag, &
update_ocn_f, Tair, Qa, fsw, fcondtop, meltt, meltb, meltl, snoice, &
update_ocn_f, cpl_frazil, Tair, Qa, fsw, fcondtop, meltt, meltb, meltl, snoice, &
dsnow, congel, sst, sss, Tf, fhocn, &
swvdr, swvdf, swidr, swidf, &
alvdr_init, alvdf_init, alidr_init, alidf_init
Expand Down Expand Up @@ -722,8 +722,9 @@ subroutine runtime_diags (dt)
! frazil ice growth !! should not be multiplied by aice
! m/step->kg/m^2/s
work1(:,:,:) = frazil(:,:,:)*rhoi/dt
if (ktherm == 2 .and. .not.update_ocn_f) &
if (.not. update_ocn_f .and. ktherm == 2 .and. cpl_frazil == 'fresh_ice_correction') then
work1(:,:,:) = (frazil(:,:,:)-frazil_diag(:,:,:))*rhoi/dt
endif
frzn = c0
frzs = c0
frzn = global_sum(work1, distrb_info, &
Expand Down
660 changes: 85 additions & 575 deletions cicecore/cicedyn/analysis/ice_history.F90

Large diffs are not rendered by default.

31 changes: 27 additions & 4 deletions cicecore/cicedyn/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ module ice_history_shared
character (len=char_len), public :: &
history_format

character (len=char_len), public :: &
hist_suffix(max_nstrm) ! appended to 'h' in filename when not 'x'

!---------------------------------------------------------------
! Instructions for adding a field: (search for 'example')
! Here or in ice_history_[process].F90:
Expand All @@ -81,6 +84,8 @@ module ice_history_shared
real (kind=dbl_kind) :: conb ! additive conversion factor
character (len=1) :: vhistfreq ! frequency of history output
integer (kind=int_kind) :: vhistfreq_n ! number of vhistfreq intervals
logical (kind=log_kind) :: avg_ice_present ! only average where ice is present
logical (kind=log_kind) :: mask_ice_free_points ! mask ice-free points
end type

integer (kind=int_kind), parameter, public :: &
Expand Down Expand Up @@ -761,9 +766,7 @@ subroutine construct_filename(ncfile,suffix,ns)
endif

cstream = ''
!echmod ! this was implemented for CESM but it breaks post-processing software
!echmod ! of other groups (including RASM which uses CESMCOUPLED)
!echmod if (ns > 1) write(cstream,'(i1.1)') ns-1
if (hist_suffix(ns) /= 'x') cstream = hist_suffix(ns)

if (hist_avg(ns)) then ! write averaged data
if (histfreq(ns) == '1' .and. histfreq_n(ns) == 1) then ! timestep
Expand Down Expand Up @@ -811,7 +814,7 @@ end subroutine construct_filename

subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
vdesc, vcomment, cona, conb, &
ns, vhistfreq)
ns, vhistfreq, avg_ice_present, mask_ice_free_points)

use ice_calendar, only: histfreq, histfreq_n

Expand All @@ -837,14 +840,28 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
integer (kind=int_kind), intent(in) :: &
ns ! history file stream index

logical (kind=log_kind), optional, intent(in) :: &
avg_ice_present , & ! compute average only when ice is present
mask_ice_free_points ! mask ice-free points

integer (kind=int_kind) :: &
ns1 , & ! variable stream loop index
lenf ! length of namelist string

character (len=40) :: stmp

logical (kind=log_kind) :: &
l_avg_ice_present , & ! compute average only when ice is present
l_mask_ice_free_points ! mask ice-free points

character(len=*), parameter :: subname = '(define_hist_field)'

l_avg_ice_present = .false.
l_mask_ice_free_points = .false.

if(present(avg_ice_present)) l_avg_ice_present = avg_ice_present
if(present(mask_ice_free_points)) l_mask_ice_free_points = mask_ice_free_points

if (histfreq(ns) == 'x') then
call abort_ice(subname//'ERROR: define_hist_fields has histfreq x')
endif
Expand All @@ -855,6 +872,10 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
do ns1 = 1, lenf
if (vhistfreq(ns1:ns1) == histfreq(ns)) then

if (ns1 > 1 .and. index(vhistfreq(1:ns1-1),'x') /= 0) then
call abort_ice(subname//'ERROR: history frequency variable f_' // vname // ' can''t contain ''x'' along with active frequencies')
endif

num_avail_hist_fields_tot = num_avail_hist_fields_tot + 1

if (vcoord(11:14) == 'time') then
Expand Down Expand Up @@ -917,6 +938,8 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
avail_hist_fields(id(ns))%conb = conb
avail_hist_fields(id(ns))%vhistfreq = vhistfreq(ns1:ns1)
avail_hist_fields(id(ns))%vhistfreq_n = histfreq_n(ns)
avail_hist_fields(id(ns))%avg_ice_present = l_avg_ice_present
avail_hist_fields(id(ns))%mask_ice_free_points = l_mask_ice_free_points

endif
enddo
Expand Down
Loading

0 comments on commit c675280

Please sign in to comment.