Skip to content

Commit

Permalink
changes for consistency w/ current emc-cice5 (NOAA-EMC#13)
Browse files Browse the repository at this point in the history
Update to emc/develop fork to current CICE consortium

Co-authored-by: David A. Bailey <dbailey@ucar.edu>
Co-authored-by: Tony Craig <apcraig@users.noreply.github.com>
Co-authored-by: Elizabeth Hunke <eclare@lanl.gov>
Co-authored-by: Mariana Vertenstein <mvertens@ucar.edu>
Co-authored-by: apcraig <anthony.p.craig@gmail.com>
Co-authored-by: Philippe Blain <levraiphilippeblain@gmail.com>
  • Loading branch information
7 people committed Sep 22, 2023
1 parent 457ebaa commit 70c74d4
Show file tree
Hide file tree
Showing 38 changed files with 4,800 additions and 126 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,23 @@ CICE is a computationally efficient model for simulating the growth, melting, an
This repository contains the files and code needed to run the CICE sea ice numerical model starting with version 6. CICE is maintained by the CICE Consortium.
Versions prior to v6 are found in the [CICE-svn-trunk repository](https://github.com/CICE-Consortium/CICE-svn-trunk).

CICE consists of a top level driver and dynamical core plus the [Icepack column physics code][icepack], which is included in CICE as a Git submodule. Because Icepack is a submodule of CICE, Icepack and CICE development are handled independently with respect to the GitHub repositories even though development and testing may be done together.
CICE consists of a top level driver and dynamical core plus the [Icepack][icepack] column physics code], which is included in CICE as a Git submodule. Because Icepack is a submodule of CICE, Icepack and CICE development are handled independently with respect to the GitHub repositories even though development and testing may be done together.

[icepack]: https://github.com/CICE-Consortium/Icepack

<<<<<<< HEAD
If you need help getting started using the model afer reviewing the [model documentation][doc-resources], the first point of contact with the CICE Consortium is the [Consortium Community Forum][forum].
=======
The first point of contact with the CICE Consortium is the Consortium Community [Forum][forum].
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13))
This forum is monitored by Consortium members and also opened to the whole community.
Please do not use our issue tracker for general support questions.

[doc-resources]: https://github.com/CICE-Consortium/About-Us/wiki/Resource-Index#model-documentation
[doc-running]: https://cice-consortium-cice.readthedocs.io/en/master/user_guide/ug_running.html
[forum]: https://xenforo.cgd.ucar.edu/cesm/forums/cice-consortium.146/

If you expect to make any changes to the code, we recommend that you first fork both the CICE and Icepack repositories.
In order to incorporate your developments into the Consortium code it is imperative you follow the guidance for Pull Requests and requisite testing.
Head over to our [Contribution guide][contributing] to learn more about how you can help improve CICE.
Head over to our [Contributing][contributing] guide to learn more about how you can help improve CICE.

[contributing]: https://github.com/CICE-Consortium/About-Us/wiki/Contributing

Expand All @@ -32,7 +34,7 @@ Head over to our [Contribution guide][contributing] to learn more about how you

Information about the CICE model

* **CICE Version Index**: https://github.com/CICE-Consortium/CICE/wiki/CICE-Version-Index
* **CICE Release Table**: https://github.com/CICE-Consortium/CICE/wiki/CICE-Release-Table

Numbered CICE releases since version 6 with associated documentation and DOIs.

Expand Down
22 changes: 22 additions & 0 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set suitebuild = true
set suitereuse = true
set suiterun = false
set suitesubmit = true
set ignoreuserset = false

if ($#argv < 1) then
set helpheader = 1
Expand Down Expand Up @@ -98,6 +99,7 @@ DESCRIPTION
--acct : account number for the batch submission
--grid, -g : grid, grid (default = ${grid})
--set, -s : case option setting(s), comma separated (default = " ")
--ignore-user-set: ignore ~/.cice_set if it exists
--queue : queue for the batch submission
For testing
Expand All @@ -111,8 +113,13 @@ DESCRIPTION
--testid : test ID, user-defined id for testing (REQUIRED with --test or --suite)
--diff : generate comparison against another case
--report : automatically post results when tests are complete
<<<<<<< HEAD
--codecov : generate and report test coverage metrics when tests are complete,
requires GNU compiler (--env gnu)
=======
--coverage : generate and report test coverage metrics when tests are complete,
requires GNU compiler (ie. normally --env gnu)
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13))
--setup-only : for suite, setup testcases, no build, no submission
--setup-build : for suite, setup and build testcases, no submission
--setup-build-run : for suite, setup, build, and run interactively
Expand Down Expand Up @@ -263,6 +270,10 @@ while (1)
set suitesubmit = true
shift argv

else if ("$option" == "--ignore-user-set") then
set ignoreuserset = true
shift argv

# arguments with settings
else
shift argv
Expand Down Expand Up @@ -409,6 +420,17 @@ set vers = ${ICE_VERSION}
set shhash = `echo ${hash} | cut -c 1-10`
if ( ${dosuite} == 0 ) then
# grab user defined default sets
if ("${ignoreuserset}" == "false" && -e ~/.cice_set) then
set setsu1 = `cat ~/.cice_set`
# get rid of spaces if they exist!
set setsuser = `echo ${setsu1} | sed 's/ //g'`
if ( ${sets} == "" ) then
set sets = "${setsuser}"
else
set sets = "${setsuser},${sets}"
endif
endif
set teststring = "${test} ${grid} ${pesx} ${sets}"
if ( $bfbcomp != ${spval} ) then
if ( ${sets} == "" ) then
Expand Down
46 changes: 45 additions & 1 deletion cicecore/cicedyn/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ module ice_flux
fresh , & ! fresh water flux to ocean (kg/m^2/s)
fsalt , & ! salt flux to ocean (kg/m^2/s)
fhocn , & ! net heat flux to ocean (W/m^2)
fswthru ! shortwave penetrating to ocean (W/m^2)
fswthru , & ! shortwave penetrating to ocean (W/m^2)
fswthru_vdr , & ! vis dir shortwave penetrating to ocean (W/m^2)
fswthru_vdf , & ! vis dif shortwave penetrating to ocean (W/m^2)
fswthru_idr , & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthru_idf ! nir dif shortwave penetrating to ocean (W/m^2)

! internal

Expand Down Expand Up @@ -307,6 +311,11 @@ module ice_flux
fresh_da, & ! fresh water flux to ocean due to data assim (kg/m^2/s)
fsalt_da ! salt flux to ocean due to data assimilation(kg/m^2/s)

real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: &
fswthrun_ai ! per-category fswthru * ai (W/m^2)

logical (kind=log_kind), public :: send_i2x_per_cat = .false.

!-----------------------------------------------------------------
! internal
!-----------------------------------------------------------------
Expand Down Expand Up @@ -438,6 +447,10 @@ subroutine alloc_flux
fsalt (nx_block,ny_block,max_blocks), & ! salt flux to ocean (kg/m^2/s)
fhocn (nx_block,ny_block,max_blocks), & ! net heat flux to ocean (W/m^2)
fswthru (nx_block,ny_block,max_blocks), & ! shortwave penetrating to ocean (W/m^2)
fswthru_vdr (nx_block,ny_block,max_blocks), & ! vis dir shortwave penetrating to ocean (W/m^2)
fswthru_vdf (nx_block,ny_block,max_blocks), & ! vis dif shortwave penetrating to ocean (W/m^2)
fswthru_idr (nx_block,ny_block,max_blocks), & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthru_idf (nx_block,ny_block,max_blocks), & ! nir dif shortwave penetrating to ocean (W/m^2)
scale_factor (nx_block,ny_block,max_blocks), & ! scaling factor for shortwave components
strairx_ocn(nx_block,ny_block,max_blocks), & ! stress on ocean by air, x-direction
strairy_ocn(nx_block,ny_block,max_blocks), & ! stress on ocean by air, y-direction
Expand Down Expand Up @@ -684,6 +697,10 @@ subroutine init_coupler_flux
fpond (:,:,:) = c0
fhocn (:,:,:) = c0
fswthru (:,:,:) = c0
fswthru_vdr (:,:,:) = c0
fswthru_vdf (:,:,:) = c0
fswthru_idr (:,:,:) = c0
fswthru_idf (:,:,:) = c0
fresh_da(:,:,:) = c0 ! data assimilation
fsalt_da(:,:,:) = c0
flux_bio (:,:,:,:) = c0 ! bgc
Expand All @@ -701,6 +718,11 @@ subroutine init_coupler_flux
ffep (:,:,:,:)= c0
ffed (:,:,:,:)= c0

if (send_i2x_per_cat) then
allocate(fswthrun_ai(nx_block,ny_block,ncat,max_blocks))
fswthrun_ai(:,:,:,:) = c0
endif

!-----------------------------------------------------------------
! derived or computed fields
!-----------------------------------------------------------------
Expand Down Expand Up @@ -783,13 +805,21 @@ subroutine init_flux_ocn
fpond (:,:,:) = c0
fhocn (:,:,:) = c0
fswthru (:,:,:) = c0
fswthru_vdr (:,:,:) = c0
fswthru_vdf (:,:,:) = c0
fswthru_idr (:,:,:) = c0
fswthru_idf (:,:,:) = c0

faero_ocn (:,:,:,:) = c0
fiso_ocn (:,:,:,:) = c0
HDO_ocn (:,:,:) = c0
H2_16O_ocn (:,:,:) = c0
H2_18O_ocn (:,:,:) = c0

if (send_i2x_per_cat) then
fswthrun_ai(:,:,:,:) = c0
endif

end subroutine init_flux_ocn

!=======================================================================
Expand Down Expand Up @@ -978,6 +1008,8 @@ subroutine scale_fluxes (nx_block, ny_block, &
Tref, Qref, &
fresh, fsalt, &
fhocn, fswthru, &
fswthru_vdr, fswthru_vdf, &
fswthru_idr, fswthru_idf, &
faero_ocn, &
alvdr, alidr, &
alvdf, alidf, &
Expand Down Expand Up @@ -1022,6 +1054,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt , & ! salt flux to ocean (kg/m2/s)
fhocn , & ! actual ocn/ice heat flx (W/m**2)
fswthru , & ! sw radiation through ice bot (W/m**2)
fswthru_vdr , & ! vis dir sw radiation through ice bot (W/m**2)
fswthru_vdf , & ! vis dif sw radiation through ice bot (W/m**2)
fswthru_idr , & ! nir dir sw radiation through ice bot (W/m**2)
fswthru_idf , & ! nir dif sw radiation through ice bot (W/m**2)
alvdr , & ! visible, direct (fraction)
alidr , & ! near-ir, direct (fraction)
alvdf , & ! visible, diffuse (fraction)
Expand Down Expand Up @@ -1093,6 +1129,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt (i,j) = fsalt (i,j) * ar
fhocn (i,j) = fhocn (i,j) * ar
fswthru (i,j) = fswthru (i,j) * ar
fswthru_vdr (i,j) = fswthru_vdr (i,j) * ar
fswthru_vdf (i,j) = fswthru_vdf (i,j) * ar
fswthru_idr (i,j) = fswthru_idr (i,j) * ar
fswthru_idf (i,j) = fswthru_idf (i,j) * ar
alvdr (i,j) = alvdr (i,j) * ar
alidr (i,j) = alidr (i,j) * ar
alvdf (i,j) = alvdf (i,j) * ar
Expand Down Expand Up @@ -1121,6 +1161,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt (i,j) = c0
fhocn (i,j) = c0
fswthru (i,j) = c0
fswthru_vdr (i,j) = c0
fswthru_vdf (i,j) = c0
fswthru_idr (i,j) = c0
fswthru_idf (i,j) = c0
alvdr (i,j) = c0 ! zero out albedo where ice is absent
alidr (i,j) = c0
alvdf (i,j) = c0
Expand Down
50 changes: 50 additions & 0 deletions cicecore/cicedyn/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -974,6 +974,11 @@ subroutine read_data_nc (flag, recd, yr, ixm, ixx, ixp, &

! local variables

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
=======
character(len=*), parameter :: subname = '(read_data_nc)'

>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
integer (kind=int_kind) :: &
nrec , & ! record number to read
n2, n4 , & ! like ixm and ixp, but
Expand Down Expand Up @@ -3429,7 +3434,11 @@ subroutine oned_data
rhoa (:,:,:) = 1.3_dbl_kind ! air density (kg/m^3)
cldf (:,:,:) = p25 ! cloud fraction
frain(:,:,:) = c0 ! this is available in hourlymet_rh file
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90

=======

>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
end subroutine oned_data

!=======================================================================
Expand Down Expand Up @@ -3649,6 +3658,13 @@ subroutine ocn_data_ncar_init
'T', 'S', 'hblt', 'U', 'V', &
'dhdx', 'dhdy', 'qdp' /

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
=======
integer (kind=int_kind) :: &
fid , & ! file id
dimid ! dimension id

>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
integer (kind=int_kind) :: &
status , & ! status flag
fid , & ! file id
Expand Down Expand Up @@ -3795,7 +3811,11 @@ subroutine ocn_data_ncar_init_3D
#endif

#ifdef USE_NETCDF
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
integer (kind=int_kind) :: &
=======
integer (kind=int_kind) :: &
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
n , & ! field index
m , & ! month index
nzlev ! z level of currents
Expand Down Expand Up @@ -4611,6 +4631,11 @@ subroutine read_data_nc_point (flag, recd, yr, ixm, ixx, ixp, &
real (kind=dbl_kind), dimension(2), intent(inout) :: &
field_data ! 2 values needed for interpolation

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
=======
character(len=*), parameter :: subname = '(read_data_nc_point)'

>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
integer (kind=int_kind) :: &
nrec , & ! record number to read
n2, n4 , & ! like ixm and ixp, but
Expand Down Expand Up @@ -4784,7 +4809,11 @@ subroutine ISPOL_data

!local parameters

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
character (char_len_long) :: &
=======
character (char_len_long) :: &
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
met_file, & ! netcdf filename
fieldname ! field name in netcdf file

Expand Down Expand Up @@ -4827,8 +4856,11 @@ subroutine ISPOL_data

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

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
if (local_debug .and. my_task == master_task) write(nu_diag,*) subname,'fdbg start'

=======
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
call icepack_query_parameters(secday_out=secday)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
Expand Down Expand Up @@ -5006,7 +5038,11 @@ subroutine ocn_data_ispol_init
use ice_gather_scatter
use ice_read_write

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
integer (kind=int_kind) :: &
=======
integer (kind=int_kind) :: &
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
n , & ! field index
m ! month index

Expand All @@ -5020,7 +5056,14 @@ subroutine ocn_data_ispol_init
work

integer (kind=int_kind) :: &
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
fid ! file id
=======
fid ! file id

integer (kind=int_kind) :: &
status ! status flag
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90

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

Expand Down Expand Up @@ -5385,7 +5428,14 @@ subroutine get_wave_spec
file=__FILE__, line=__LINE__)
else
#ifdef USE_NETCDF
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing.F90
call wave_spec_data
=======
call ice_open_nc(wave_spec_file,fid)
call ice_read_nc_xyf (fid, 1, 'efreq', wave_spectrum(:,:,:,:), dbug, &
field_loc_center, field_type_scalar)
call ice_close_nc(fid)
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing.F90
#else
write (nu_diag,*) "wave spectrum file not available, requires cpp USE_NETCDF"
write (nu_diag,*) "wave spectrum file not available, using default profile"
Expand Down
22 changes: 22 additions & 0 deletions cicecore/cicedyn/general/ice_forcing_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,11 @@ subroutine faero_optics

logical (kind=log_kind) :: modal_aero

<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing_bgc.F90
integer (kind=int_kind) :: &
=======
integer (kind=int_kind) :: &
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing_bgc.F90
varid , & ! variable id
status , & ! status output from netcdf routines
n, k ! index
Expand Down Expand Up @@ -1010,6 +1014,12 @@ subroutine faero_optics

if (modal_aero) then
#ifdef USE_NETCDF
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing_bgc.F90
=======
optics_file = &
'/usr/projects/climate/njeffery/DATA/CAM/snicar/snicar_optics_5bnd_mam_c140303.nc'

>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing_bgc.F90
if (my_task == master_task) then
write (nu_diag,*) ' '
write (nu_diag,*) 'Read optics for modal aerosol treament in'
Expand All @@ -1033,6 +1043,7 @@ subroutine faero_optics
asum = sum (bcenh(:,n,:))
write(nu_diag,*) ' min, max, sum =', amin, amax, asum
enddo
<<<<<<< HEAD:cicecore/cicedyn/general/ice_forcing_bgc.F90
call ice_close_nc(fid)
endif !master_task
do n=1,3
Expand All @@ -1042,6 +1053,17 @@ subroutine faero_optics
enddo
#else
call abort_ice(subname//'ERROR: USE_NETCDF cpp not defined', &
=======
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', &
>>>>>>> bdf1a1f6 (changes for consistency w/ current emc-cice5 (#13)):cicecore/cicedynB/general/ice_forcing_bgc.F90
file=__FILE__, line=__LINE__)
#endif
endif ! modal_aero
Expand Down
Loading

0 comments on commit 70c74d4

Please sign in to comment.