Skip to content

Commit

Permalink
changes for consistency w/ current emc-cice5 (#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 authored Aug 12, 2020
1 parent 8f37bfc commit bdf1a1f
Show file tree
Hide file tree
Showing 58 changed files with 827 additions and 561 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ 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

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].
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 @@ -34,7 +32,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
19 changes: 18 additions & 1 deletion 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 @@ -112,7 +114,7 @@ DESCRIPTION
--diff : generate comparison against another case
--report : automatically post results when tests are complete
--coverage : generate and report test coverage metrics when tests are complete,
requires GNU compiler (ie. normally ``--env gnu``)
requires GNU compiler (ie. normally --env gnu)
--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 +265,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 @@ -412,6 +418,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
39 changes: 21 additions & 18 deletions cicecore/cicedynB/dynamics/ice_dyn_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ module ice_dyn_shared
ndte ! number of subcycles: ndte=dt/dte

character (len=char_len), public :: &
coriolis ! 'constant', 'zero', or 'latitude'
coriolis , & ! 'constant', 'zero', or 'latitude'
ssh_stress ! 'geostrophic' or 'coupled'

logical (kind=log_kind), public :: &
revised_evp ! if true, use revised evp procedure
revised_evp ! if true, use revised evp procedure

integer (kind=int_kind), public :: &
kevp_kernel ! 0 = 2D org version
Expand Down Expand Up @@ -475,9 +476,7 @@ subroutine dyn_prep2 (nx_block, ny_block, &
integer (kind=int_kind) :: &
i, j, ij

#ifdef coupled
real (kind=dbl_kind) :: gravit
#endif

logical (kind=log_kind), dimension(nx_block,ny_block) :: &
iceumask_old ! old-time iceumask
Expand Down Expand Up @@ -577,12 +576,12 @@ subroutine dyn_prep2 (nx_block, ny_block, &
! Define variables for momentum equation
!-----------------------------------------------------------------

#ifdef coupled
call icepack_query_parameters(gravit_out=gravit)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)
#endif
if (trim(ssh_stress) == 'coupled') then
call icepack_query_parameters(gravit_out=gravit)
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)
endif

do ij = 1, icellu
i = indxui(ij)
Expand All @@ -597,14 +596,18 @@ subroutine dyn_prep2 (nx_block, ny_block, &
watery(i,j) = vocn(i,j)*cosw + uocn(i,j)*sinw*sign(c1,fm(i,j))

! combine tilt with wind stress
#ifndef coupled
! calculate tilt from geostrophic currents if needed
strtltx(i,j) = -fm(i,j)*vocn(i,j)
strtlty(i,j) = fm(i,j)*uocn(i,j)
#else
strtltx(i,j) = -gravit*umass(i,j)*ss_tltx(i,j)
strtlty(i,j) = -gravit*umass(i,j)*ss_tlty(i,j)
#endif
if (trim(ssh_stress) == 'geostrophic') then
! calculate tilt from geostrophic currents if needed
strtltx(i,j) = -fm(i,j)*vocn(i,j)
strtlty(i,j) = fm(i,j)*uocn(i,j)
elseif (trim(ssh_stress) == 'coupled') then
strtltx(i,j) = -gravit*umass(i,j)*ss_tltx(i,j)
strtlty(i,j) = -gravit*umass(i,j)*ss_tlty(i,j)
else
call abort_ice(subname//' ERROR: unknown ssh_stress='//trim(ssh_stress), &
file=__FILE__, line=__LINE__)
endif

forcex(i,j) = strairx(i,j) + strtltx(i,j)
forcey(i,j) = strairy(i,j) + strtlty(i,j)
enddo
Expand Down
46 changes: 45 additions & 1 deletion cicecore/cicedynB/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 @@ -1090,6 +1126,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 @@ -1118,6 +1158,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
Loading

0 comments on commit bdf1a1f

Please sign in to comment.