Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into emc/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Aug 5, 2020
2 parents c084de4 + 003aae0 commit 88cc2fd
Show file tree
Hide file tree
Showing 50 changed files with 617 additions and 483 deletions.
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
14 changes: 14 additions & 0 deletions cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -311,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 @@ -713,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 @@ -806,6 +816,10 @@ subroutine init_flux_ocn
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
Loading

0 comments on commit 88cc2fd

Please sign in to comment.