Skip to content

Commit

Permalink
Update BGC and Icepack interfaces (#968)
Browse files Browse the repository at this point in the history
Update Icepack to #05ac0ec3ea, CICE-Consortium/Icepack@05ac0ec which includes new BGC.

Deprecate skl BGC but leave code alone for now hoping we get help from the community to validate the latest code.

Update interfaces and bgc settings consistent with new version of Icepack BGC.

    icepack_aerosol.F90
        revised subroutine update_snow_bgc
    icepack_algae.F90
        revised subroutine zbio
        revised subroutine z_biogeochemistry
        revised subroutine algal_dyn
        add subroutine bgc_carbon_sum
    icepack_brine.F90
        revise subroutine prepare_hbrine
        revise subroutine update_hbrine
    icepack_mechred.F90
        add mbio calculation to subroutine ridge_shift
        add flux_bio calculation to subroutine ridge_ice
    icepack_therm_itd.F90
        update calculation of dvssl and dvint in subroutine lateral_melt
    icepack_zbgc.F90
        lots of stuff
    icepack_zbgc_shared.F90
        lots of stuff

Remove redundant arguments in non-BGC interfaces.

    icepack_atmo.F90
    icepack_fsd.F90
    icepack_isotope.F90
    icepack_itd.F90
    icepack_meltpond_topo.F90
    icepack_mushy_physics.F90
    icepack_snow.F90
    icepack_therm_bl99.F90
    icepack_therm_mushy.F90
    icepack_therm_shared.F90
    icepack_therm_vertical.F90
    icepack_tracers.F90
    icepack_wavefracspec.F90

Generalize merge_fluxes to make all arguments optional

Fix bug in subroutine snow_redist computation of hsn_new when nslyr=1

Update icepack_init_zbgc call.

Update bgc namelist defaults and settings in ice_in

Update testing, remove skl tests, add zaero tests.
  • Loading branch information
apcraig authored Sep 16, 2024
1 parent 1a89c78 commit d9d0176
Show file tree
Hide file tree
Showing 37 changed files with 923 additions and 1,035 deletions.
2 changes: 1 addition & 1 deletion cicecore/cicedyn/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ subroutine construct_filename(ncfile,suffix,ns)

! Check whether the filename is already in use.
! Same filename in multiple history streams leads to files being overwritten (not good).
! The current filename convention means we just have to check latest filename,
! The current filename convention means we just have to check latest filename,
! not all filenames ever generated because of use of current model date/time in filename.

! write(nu_diag,'(2a,i2,1x,a)') subname, 'debug ncfile= ',ns,trim(ncfile)
Expand Down
3 changes: 1 addition & 2 deletions cicecore/cicedyn/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,7 @@ subroutine eap (dt)
do ij = 1, icellT(iblk)
i = indxTi(ij, iblk)
j = indxTj(ij, iblk)
call icepack_ice_strength(ncat=ncat, &
aice = aice (i,j, iblk), &
call icepack_ice_strength(aice = aice (i,j, iblk), &
vice = vice (i,j, iblk), &
aice0 = aice0 (i,j, iblk), &
aicen = aicen (i,j,:,iblk), &
Expand Down
6 changes: 2 additions & 4 deletions cicecore/cicedyn/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,7 @@ subroutine evp (dt)
do ij = 1, icellT(iblk)
i = indxTi(ij, iblk)
j = indxTj(ij, iblk)
call icepack_ice_strength(ncat = ncat, &
aice = aice (i,j, iblk), &
call icepack_ice_strength(aice = aice (i,j, iblk), &
vice = vice (i,j, iblk), &
aice0 = aice0 (i,j, iblk), &
aicen = aicen (i,j,:,iblk), &
Expand Down Expand Up @@ -595,8 +594,7 @@ subroutine evp (dt)
do ij = 1, icellT(iblk)
i = indxTi(ij, iblk)
j = indxTj(ij, iblk)
call icepack_ice_strength(ncat = ncat, &
aice = aice (i,j, iblk), &
call icepack_ice_strength(aice = aice (i,j, iblk), &
vice = vice (i,j, iblk), &
aice0 = aice0 (i,j, iblk), &
aicen = aicen (i,j,:,iblk), &
Expand Down
13 changes: 6 additions & 7 deletions cicecore/cicedyn/dynamics/ice_dyn_vp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -386,13 +386,12 @@ subroutine implicit_solver (dt)
do ij = 1, icellT(iblk)
i = indxTi(ij, iblk)
j = indxTj(ij, iblk)
call icepack_ice_strength (ncat, &
aice (i,j, iblk), &
vice (i,j, iblk), &
aice0 (i,j, iblk), &
aicen (i,j,:,iblk), &
vicen (i,j,:,iblk), &
strength(i,j, iblk))
call icepack_ice_strength (aice = aice (i,j, iblk), &
vice = vice (i,j, iblk), &
aice0 = aice0 (i,j, iblk), &
aicen = aicen (i,j,:,iblk), &
vicen = vicen (i,j,:,iblk), &
strength = strength(i,j, iblk))
enddo ! ij

enddo ! iblk
Expand Down
3 changes: 1 addition & 2 deletions cicecore/cicedyn/dynamics/ice_transport_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1739,8 +1739,7 @@ subroutine work_to_state (nx_block, ny_block, &
i = indxi(ij)
j = indxj(ij)

call icepack_compute_tracers(ntrcr = ntrcr, &
trcr_depend = trcr_depend(:), &
call icepack_compute_tracers(trcr_depend = trcr_depend(:), &
atrcrn = work (ij,narrays+1:narrays+ntrcr), &
aicen = aicen(i,j,n), &
vicen = vicen(i,j,n), &
Expand Down
15 changes: 8 additions & 7 deletions cicecore/cicedyn/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5396,9 +5396,10 @@ subroutine get_wave_spec
if (wave_spec) then
! get hardwired frequency bin info and a dummy wave spectrum profile
! the latter is used if wave_spec_type == profile
call icepack_init_wave(nfreq, &
wave_spectrum_profile, &
wavefreq, dwavefreq)
call icepack_init_wave(nfreq = nfreq, &
wave_spectrum_profile = wave_spectrum_profile, &
wavefreq = wavefreq, &
dwavefreq = dwavefreq)

! read more realistic data from a file
if ((trim(wave_spec_type) == 'constant').OR.(trim(wave_spec_type) == 'random')) then
Expand Down Expand Up @@ -5481,10 +5482,10 @@ subroutine wave_spec_data
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

call icepack_init_wave(nfreq, &
wave_spectrum_profile, &
wavefreq, dwavefreq)

call icepack_init_wave(nfreq = nfreq, &
wave_spectrum_profile = wave_spectrum_profile, &
wavefreq = wavefreq, &
dwavefreq = dwavefreq)

!spec_file = trim(ocn_data_dir)//'/'//trim(wave_spec_file)
spec_file = trim(wave_spec_file)
Expand Down
5 changes: 1 addition & 4 deletions cicecore/cicedyn/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3024,8 +3024,7 @@ subroutine init_state
enddo

if (tmask(i,j,iblk)) &
call icepack_aggregate(ncat = ncat, &
aicen = aicen(i,j,:,iblk), &
call icepack_aggregate(aicen = aicen(i,j,:,iblk), &
trcrn = trcrn(i,j,:,:,iblk), &
vicen = vicen(i,j,:,iblk), &
vsnon = vsnon(i,j,:,iblk), &
Expand All @@ -3034,7 +3033,6 @@ subroutine init_state
vice = vice (i,j, iblk), &
vsno = vsno (i,j, iblk), &
aice0 = aice0(i,j, iblk), &
ntrcr = ntrcr, &
trcr_depend = trcr_depend(:), &
trcr_base = trcr_base(:,:), &
n_trcr_strata = n_trcr_strata(:), &
Expand Down Expand Up @@ -3513,7 +3511,6 @@ subroutine set_state_var (nx_block, ny_block, &
Sprofile = salinz(i,j,:), &
Tprofile = Tmltz(i,j,:), &
Tsfc = Tsfc, &
nilyr = nilyr, nslyr = nslyr, &
qin = qin(:), qsn = qsn(:))

! surface temperature
Expand Down
Loading

0 comments on commit d9d0176

Please sign in to comment.