Skip to content

Commit

Permalink
Update CICE for E3SM Icepack modifications (CICE-Consortium#879)
Browse files Browse the repository at this point in the history
* Update CICE to run with eclare108213/Icepack branch snicar (#100)

* Update CICE to run with eclare108213/Icepack branch snicar

- including eclare108213/Icepack#13, Sept 11, 2022
- Passes full CICE test suite on cheyenne with 3 compilers except alt04 changes
  answers for all compilers and all tests.  CICE #fea412a55f was baseline.
- Icepack submodule still points to standard version on main, need to be
  swapped manually to appropriate development version.

* Remove faero_optics

* update ciceexe string to account for USE_SNICARHC CPP

* Update documentation

* Update test suite to add modal testing

* Point Icepack submodule to cice-consortium/E3SM-icepack-initial-integration

Update to snicar branch merge, #8aef3f785ce

* Add E3SM namelists for CICE. (#101)

* New e3sm and e3smbgc namelist options

* Update E3SM test options

* Add a simple e3sm test suite

* atmbndy is not actually different

* Additional changes

* add Tliquidus_max namelist parameter to CICE

* Add Tf argument to icepack interfaces

* Add constant option for tfrz_option

* Fix some diagnostic prints and add to additional drivers

* Update messages and change option in alt01

* Update implementation for latest version of Icepack

- Update tfrz_option, add _old options for backwards bit-for-bit
- Fix unittests
- Add hi_min to namelist and tests

* Update Icepack

* Update to E3SM-Project/Icepack/cice-consortium/E3SM-icepack-initial-integration including Icepack1.3.3 release, Dec 15, 2022.

* Update Icepack to E3SM-Project/Icepack #87db73ba6d93747a9, current head of cice-consortium/E3SM-icepack-initial-integration Feb 3, 2023

* Update boxchan1e and boxchan1n tests to tfrz_option = 'mushy_old' to recover Consortium main results

Update Icepack to the latest hash on E3SM-Project Icepack cice-consortium/E3SM-icepack-initial-integration, #96f2fc707fc743d7

Prior commit was a merge from CICE Consortium Main, #d466031001cf447bcd64220c842dcd2707f61e9, Sept 29, 2023

* remove icepack

* update icepack

---------

Co-authored-by: David A. Bailey <[email protected]>
Co-authored-by: Elizabeth Hunke <[email protected]>
  • Loading branch information
3 people authored Oct 5, 2023
1 parent d466031 commit deb247b
Show file tree
Hide file tree
Showing 47 changed files with 305 additions and 445 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
9 changes: 6 additions & 3 deletions cicecore/cicedyn/dynamics/ice_transport_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ subroutine transport_upwind (dt)
use ice_state, only: aice0, aicen, vicen, vsnon, trcrn, &
uvel, vvel, trcr_depend, bound_state, trcr_base, &
n_trcr_strata, nt_strata, uvelE, vvelN
use ice_flux, only: Tf
use ice_grid, only: HTE, HTN, tarea, tmask, grid_ice
use ice_timers, only: ice_timer_start, ice_timer_stop, &
timer_bound, timer_advect
Expand Down Expand Up @@ -838,7 +839,7 @@ subroutine transport_upwind (dt)
ntrcr, narr, &
trcr_depend(:), trcr_base(:,:), &
n_trcr_strata(:), nt_strata(:,:), &
tmask(:,:, iblk), &
tmask(:,:, iblk), Tf (:,:,iblk), &
aicen(:,:, :,iblk), trcrn (:,:,:,:,iblk), &
vicen(:,:, :,iblk), vsnon (:,:, :,iblk), &
aice0(:,:, iblk), works (:,:, :,iblk))
Expand Down Expand Up @@ -1643,7 +1644,7 @@ subroutine work_to_state (nx_block, ny_block, &
trcr_base, &
n_trcr_strata, &
nt_strata, &
tmask, &
tmask, Tf, &
aicen, trcrn, &
vicen, vsnon, &
aice0, works)
Expand All @@ -1670,6 +1671,7 @@ subroutine work_to_state (nx_block, ny_block, &
tmask (nx_block,ny_block)

real (kind=dbl_kind), intent (in) :: &
Tf (nx_block,ny_block), &
works (nx_block,ny_block,narr)

real (kind=dbl_kind), dimension (nx_block,ny_block,ncat), intent(out) :: &
Expand Down Expand Up @@ -1746,7 +1748,8 @@ subroutine work_to_state (nx_block, ny_block, &
trcr_base = trcr_base(:,:), &
n_trcr_strata = n_trcr_strata(:), &
nt_strata = nt_strata(:,:), &
trcrn = trcrn(i,j,:,n))
trcrn = trcrn(i,j,:,n), &
Tf = Tf(i,j))

! tcraig, don't let land points get non-zero Tsfc
if (.not.tmask(i,j)) then
Expand Down
215 changes: 3 additions & 212 deletions cicecore/cicedyn/general/ice_forcing_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ module ice_forcing_bgc
use ice_calendar, only: dt, istep, msec, mday, mmonth
use ice_fileunits, only: nu_diag
use ice_arrays_column, only: restore_bgc, &
bgc_data_dir, fe_data_type, optics_file, optics_file_fieldname
bgc_data_dir, fe_data_type
use ice_constants, only: c0, p1
use ice_constants, only: field_loc_center, field_type_scalar
use ice_exit, only: abort_ice
use ice_forcing, only: bgc_data_type
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_nspint, icepack_max_aero, &
use icepack_intfc, only: icepack_nspint_3bd, icepack_max_aero, &
icepack_max_algae, icepack_max_doc, icepack_max_dic
use icepack_intfc, only: icepack_query_tracer_flags, &
icepack_query_parameters, icepack_query_parameters, &
Expand All @@ -32,8 +32,7 @@ module ice_forcing_bgc
implicit none
private
public :: get_forcing_bgc, get_atm_bgc, fzaero_data, alloc_forcing_bgc, &
init_bgc_data, faero_data, faero_default, faero_optics, &
fiso_default
init_bgc_data, faero_data, faero_default, fiso_default

integer (kind=int_kind) :: &
bgcrecnum = 0 ! old record number (save between steps)
Expand Down Expand Up @@ -840,214 +839,6 @@ subroutine init_bgc_data (fed1,fep1)

end subroutine init_bgc_data

!=======================================================================
!
! Aerosol optical properties for bulk and modal aerosol formulation
! X_bc_tab properties are from snicar_optics_5bnd_mam_c140303 (Mark Flanner 2009)
! ==> "Mie optical parameters for CLM snowpack treatment" Includes
! ice (effective radii from 30-1500um), black carbon, organic carbon and dust
!
! authors: Elizabeth Hunke, LANL

subroutine faero_optics

use ice_broadcast, only: broadcast_array
use ice_read_write, only: ice_open_nc, ice_close_nc
use ice_communicate, only: my_task, master_task
use ice_arrays_column, only: &
kaer_tab, & ! aerosol mass extinction cross section (m2/kg)
waer_tab, & ! aerosol single scatter albedo (fraction)
gaer_tab, & ! aerosol asymmetry parameter (cos(theta))
kaer_bc_tab, & ! BC mass extinction cross section (m2/kg)
waer_bc_tab, & ! BC single scatter albedo (fraction)
gaer_bc_tab, & ! BC aerosol asymmetry parameter (cos(theta))
bcenh ! BC absorption enhancement factor

#ifdef USE_NETCDF
use netcdf
#endif

! local parameters

logical (kind=log_kind) :: modal_aero

integer (kind=int_kind) :: &
varid , & ! variable id
status , & ! status output from netcdf routines
n, k ! index

real (kind=dbl_kind) :: &
amin, amax, asum ! min, max values and sum of input array

integer (kind=int_kind) :: &
fid ! file id for netCDF file

character (char_len_long) :: &
fieldname ! field name in netcdf file

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

! this data is used in bulk aerosol treatment in dEdd radiation
kaer_tab = reshape((/ & ! aerosol mass extinction cross section (m2/kg)
! 11580.61872, 5535.41835, 2793.79690, &
! 25798.96479, 11536.03871, 4688.24207, &
! 196.49772, 204.14078, 214.42287, &
! 2665.85867, 2256.71027, 820.36024, &
! 840.78295, 1028.24656, 1163.03298, &
! 387.51211, 414.68808, 450.29814/), &
11580.61872_dbl_kind, 5535.41835_dbl_kind, 2793.79690_dbl_kind, &
25798.96479_dbl_kind, 11536.03871_dbl_kind, 4688.24207_dbl_kind, &
196.49772_dbl_kind, 204.14078_dbl_kind, 214.42287_dbl_kind, &
2665.85867_dbl_kind, 2256.71027_dbl_kind, 820.36024_dbl_kind, &
840.78295_dbl_kind, 1028.24656_dbl_kind, 1163.03298_dbl_kind, &
387.51211_dbl_kind, 414.68808_dbl_kind, 450.29814_dbl_kind/), &
(/icepack_nspint,icepack_max_aero/))
waer_tab = reshape((/ & ! aerosol single scatter albedo (fraction)
! 0.29003, 0.17349, 0.06613, &
! 0.51731, 0.41609, 0.21324, &
! 0.84467, 0.94216, 0.95666, &
! 0.97764, 0.99402, 0.98552, &
! 0.94146, 0.98527, 0.99093, &
! 0.90034, 0.96543, 0.97678/), &
0.29003_dbl_kind, 0.17349_dbl_kind, 0.06613_dbl_kind, &
0.51731_dbl_kind, 0.41609_dbl_kind, 0.21324_dbl_kind, &
0.84467_dbl_kind, 0.94216_dbl_kind, 0.95666_dbl_kind, &
0.97764_dbl_kind, 0.99402_dbl_kind, 0.98552_dbl_kind, &
0.94146_dbl_kind, 0.98527_dbl_kind, 0.99093_dbl_kind, &
0.90034_dbl_kind, 0.96543_dbl_kind, 0.97678_dbl_kind/), &
(/icepack_nspint,icepack_max_aero/))
gaer_tab = reshape((/ & ! aerosol asymmetry parameter (cos(theta))
! 0.35445, 0.19838, 0.08857, &
! 0.52581, 0.32384, 0.14970, &
! 0.83162, 0.78306, 0.74375, &
! 0.68861, 0.70836, 0.54171, &
! 0.70239, 0.66115, 0.71983, &
! 0.78734, 0.73580, 0.64411/), &
0.35445_dbl_kind, 0.19838_dbl_kind, 0.08857_dbl_kind, &
0.52581_dbl_kind, 0.32384_dbl_kind, 0.14970_dbl_kind, &
0.83162_dbl_kind, 0.78306_dbl_kind, 0.74375_dbl_kind, &
0.68861_dbl_kind, 0.70836_dbl_kind, 0.54171_dbl_kind, &
0.70239_dbl_kind, 0.66115_dbl_kind, 0.71983_dbl_kind, &
0.78734_dbl_kind, 0.73580_dbl_kind, 0.64411_dbl_kind/), &
(/icepack_nspint,icepack_max_aero/))

! this data is used in MODAL AEROSOL treatment in dEdd radiation
kaer_bc_tab = reshape((/ & ! aerosol mass extinction cross section (m2/kg)
! 12955.44732, 5946.89461, 2772.33366, &
! 12085.30664, 7438.83131, 3657.13084, &
! 9753.99698, 7342.87139, 4187.79304, &
! 7815.74879, 6659.65096, 4337.98863, &
! 6381.28194, 5876.78408, 4254.65054, &
! 5326.93163, 5156.74532, 4053.66581, &
! 4538.09763, 4538.60875, 3804.10884, &
! 3934.17604, 4020.20799, 3543.27199, &
! 3461.20656, 3587.80962, 3289.98060, &
! 3083.03396, 3226.27231, 3052.91441/), &
12955.4473151973_dbl_kind, 5946.89461205564_dbl_kind, 2772.33366387720_dbl_kind, &
12085.3066388712_dbl_kind, 7438.83131367992_dbl_kind, 3657.13084442081_dbl_kind, &
9753.99697536893_dbl_kind, 7342.87139082553_dbl_kind, 4187.79303607928_dbl_kind, &
7815.74879345131_dbl_kind, 6659.65096365965_dbl_kind, 4337.98863414228_dbl_kind, &
6381.28194381772_dbl_kind, 5876.78408231865_dbl_kind, 4254.65053724305_dbl_kind, &
5326.93163497508_dbl_kind, 5156.74531505734_dbl_kind, 4053.66581550147_dbl_kind, &
4538.09762614960_dbl_kind, 4538.60874501597_dbl_kind, 3804.10884202567_dbl_kind, &
3934.17604000777_dbl_kind, 4020.20798667897_dbl_kind, 3543.27199302277_dbl_kind, &
3461.20655708248_dbl_kind, 3587.80961820605_dbl_kind, 3289.98060303894_dbl_kind, &
3083.03396032095_dbl_kind, 3226.27231329114_dbl_kind, 3052.91440681137_dbl_kind/), &
(/icepack_nspint,10/))

waer_bc_tab = reshape((/ & ! aerosol single scatter albedo (fraction)
! 0.26107, 0.15861, 0.06535, &
! 0.37559, 0.30318, 0.19483, &
! 0.42224, 0.36913, 0.27875, &
! 0.44777, 0.40503, 0.33026, &
! 0.46444, 0.42744, 0.36426, &
! 0.47667, 0.44285, 0.38827, &
! 0.48635, 0.45428, 0.40617, &
! 0.49440, 0.46328, 0.42008, &
! 0.50131, 0.47070, 0.43128, &
! 0.50736, 0.47704, 0.44056/), &
0.261071919959011_dbl_kind, 0.158608047940651_dbl_kind, 0.0653546447770291_dbl_kind, &
0.375593873543050_dbl_kind, 0.303181671502553_dbl_kind, 0.194832290545495_dbl_kind, &
0.422240383488477_dbl_kind, 0.369134186611324_dbl_kind, 0.278752556671685_dbl_kind, &
0.447772153910671_dbl_kind, 0.405033725319593_dbl_kind, 0.330260831965086_dbl_kind, &
0.464443094570456_dbl_kind, 0.427439117980081_dbl_kind, 0.364256689383418_dbl_kind, &
0.476668995985241_dbl_kind, 0.442854173154887_dbl_kind, 0.388270470928338_dbl_kind, &
0.486347881475941_dbl_kind, 0.454284736567521_dbl_kind, 0.406167596922937_dbl_kind, &
0.494397834153785_dbl_kind, 0.463279526357470_dbl_kind, 0.420084410794128_dbl_kind, &
0.501307856563459_dbl_kind, 0.470696914968199_dbl_kind, 0.431284889617716_dbl_kind, &
0.507362336297419_dbl_kind, 0.477038272961243_dbl_kind, 0.440559363958571_dbl_kind/), &
(/icepack_nspint,10/))

gaer_bc_tab = reshape((/ & ! aerosol asymmetry parameter (cos(theta))
! 0.28328, 0.19644, 0.10498, &
! 0.44488, 0.32615, 0.19612, &
! 0.54724, 0.41611, 0.26390, &
! 0.61711, 0.48475, 0.31922, &
! 0.66673, 0.53923, 0.36632, &
! 0.70296, 0.58337, 0.40732, &
! 0.73002, 0.61960, 0.44344, &
! 0.75064, 0.64959, 0.47551, &
! 0.76663, 0.67461, 0.50415, &
! 0.77926, 0.69561, 0.52981/),&
0.283282988564031_dbl_kind, 0.196444209821980_dbl_kind, 0.104976473902976_dbl_kind, &
0.444877326083453_dbl_kind, 0.326147707342261_dbl_kind, 0.196121968923488_dbl_kind, &
0.547243414035631_dbl_kind, 0.416106187964493_dbl_kind, 0.263903486903711_dbl_kind, &
0.617111563012282_dbl_kind, 0.484745531707601_dbl_kind, 0.319218974395050_dbl_kind, &
0.666728525631754_dbl_kind, 0.539228555802301_dbl_kind, 0.366323180358996_dbl_kind, &
0.702956870835387_dbl_kind, 0.583372441336763_dbl_kind, 0.407316408184865_dbl_kind, &
0.730016668453191_dbl_kind, 0.619595539349710_dbl_kind, 0.443436944107423_dbl_kind, &
0.750635997128011_dbl_kind, 0.649589805870541_dbl_kind, 0.475512089138887_dbl_kind, &
0.766634959089444_dbl_kind, 0.674609076223658_dbl_kind, 0.504145461809103_dbl_kind, &
0.779256641759228_dbl_kind, 0.695614224933709_dbl_kind, 0.529805346632687_dbl_kind/), &
(/icepack_nspint,10/))

bcenh(:,:,:) = c0

call icepack_query_parameters(modal_aero_out=modal_aero)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

if (modal_aero) then
#ifdef USE_NETCDF
if (my_task == master_task) then
write (nu_diag,*) ' '
write (nu_diag,*) 'Read optics for modal aerosol treament in'
write (nu_diag,*) trim(optics_file)
write (nu_diag,*) 'Read optics file field name = ',trim(optics_file_fieldname)
call ice_open_nc(optics_file,fid)

fieldname=optics_file_fieldname

status = nf90_inq_varid(fid, trim(fieldname), varid)

if (status /= nf90_noerr) then
call abort_ice (subname//'ERROR: Cannot find variable '//trim(fieldname))
endif
status = nf90_get_var( fid, varid, bcenh, &
start=(/1,1,1,1/), &
count=(/3,10,8,1/) )
do n=1,10
amin = minval(bcenh(:,n,:))
amax = maxval(bcenh(:,n,:))
asum = sum (bcenh(:,n,:))
write(nu_diag,*) ' min, max, sum =', amin, amax, asum
enddo
call ice_close_nc(fid)
endif !master_task
do n=1,3
do k=1,8
call broadcast_array(bcenh(n,:,k), master_task)
enddo
enddo
#else
call abort_ice(subname//'ERROR: USE_NETCDF cpp not defined', &
file=__FILE__, line=__LINE__)
#endif
endif ! modal_aero

end subroutine faero_optics

!=======================================================================

end module ice_forcing_bgc
Expand Down
Loading

0 comments on commit deb247b

Please sign in to comment.