Skip to content

Commit

Permalink
Add namelist control of PIO options (NOAA-EMC#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen authored Apr 11, 2024
1 parent 7d4e5de commit c9e4679
Show file tree
Hide file tree
Showing 70 changed files with 4,466 additions and 3,734 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ please refer to: <https://github.com/CICE-Consortium/About-Us/wiki/Resource-Inde
- [ ] No, does the documentation need to be updated at a later time?
- [ ] Yes
- [ ] No
- [ ] Please provide any additional information or relevant details below:
- [ ] Please document the changes in detail, including _why_ the changes are made. This will become part of the PR commit log.
6 changes: 4 additions & 2 deletions .github/workflows/test-cice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,11 @@ jobs:
run: |
cd $HOME/cice-dirs/input
wget --progress=dot:giga https://zenodo.org/record/3728358/files/CICE_data_gx3_grid_ic-20200320.tar.gz && tar xvfz CICE_data_gx3_grid_ic-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/record/3728362/files/CICE_data_gx3_forcing_NCAR_bulk-20200320.tar.gz && tar xvfz CICE_data_gx3_forcing_NCAR_bulk-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/record/3728364/files/CICE_data_gx3_forcing_JRA55-20200320.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55-20200320.tar.gz
wget --progress=dot:giga https://zenodo.org/records/10419929/files/CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz && tar xvfz CICE_data_gx3_forcing_JRA55_200501_20231220.tar.gz
pwd
cd CICE_data/forcing/gx3/JRA55/8XDAILY
ln -s JRA55_gx3_03hr_forcing_200501.nc JRA55_gx3_03hr_forcing_2005.nc
cd $HOME/cice-dirs/input
ls -alR
# - name: run case
# run: |
Expand Down
20 changes: 16 additions & 4 deletions cicecore/cicedyn/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
!
! The following variables are currently hard-wired as snapshots
! (instantaneous rather than time-averages):
! divu, shear, sig1, sig2, sigP, trsig, mlt_onset, frz_onset, hisnap, aisnap
! divu, shear, vort, sig1, sig2, sigP, trsig, mlt_onset,
! frz_onset, hisnap, aisnap
!
! Options for histfreq: '1','h','d','m','y','x', where x means that
! output stream will not be used (recommended for efficiency).
Expand Down Expand Up @@ -597,6 +598,7 @@ subroutine init_hist (dt)
call broadcast_scalar (f_strength, master_task)
call broadcast_scalar (f_divu, master_task)
call broadcast_scalar (f_shear, master_task)
call broadcast_scalar (f_vort, master_task)
call broadcast_scalar (f_sig1, master_task)
call broadcast_scalar (f_sig2, master_task)
call broadcast_scalar (f_sigP, master_task)
Expand Down Expand Up @@ -1312,14 +1314,19 @@ subroutine init_hist (dt)

call define_hist_field(n_divu,"divu","%/day",tstr2D, tcstr, &
"strain rate (divergence)", &
"none", secday*c100, c0, &
"divu is instantaneous, on T grid", secday*c100, c0, &
ns1, f_divu)

call define_hist_field(n_shear,"shear","%/day",tstr2D, tcstr, &
"strain rate (shear)", &
"none", secday*c100, c0, &
"shear is instantaneous, on T grid", secday*c100, c0, &
ns1, f_shear)

call define_hist_field(n_vort,"vort","%/day",tstr2D, tcstr, &
"strain rate (vorticity)", &
"vort is instantaneous, on T grid", secday*c100, c0, &
ns1, f_vort)

select case (grid_ice)
case('B')
description = ", on U grid (NE corner values)"
Expand Down Expand Up @@ -2623,14 +2630,16 @@ subroutine accum_hist (dt)
if (f_strength(1:1)/= 'x') &
call accum_hist_field(n_strength,iblk, strength(:,:,iblk), a2D)

! The following fields (divu, shear, sig1, and sig2) will be smeared
! The following fields (divu, shear, vort, sig1, and sig2) will be smeared
! if averaged over more than a few days.
! Snapshots may be more useful (see below).

! if (f_divu (1:1) /= 'x') &
! call accum_hist_field(n_divu, iblk, divu(:,:,iblk), a2D)
! if (f_shear (1:1) /= 'x') &
! call accum_hist_field(n_shear, iblk, shear(:,:,iblk), a2D)
! if (f_vort (1:1) /= 'x') &
! call accum_hist_field(n_vort, iblk, vort(:,:,iblk), a2D)
! if (f_sig1 (1:1) /= 'x') &
! call accum_hist_field(n_sig1, iblk, sig1(:,:,iblk), a2D)
! if (f_sig2 (1:1) /= 'x') &
Expand Down Expand Up @@ -3967,6 +3976,7 @@ subroutine accum_hist (dt)
if (.not. tmask(i,j,iblk)) then ! mask out land points
if (n_divu (ns) /= 0) a2D(i,j,n_divu(ns), iblk) = spval_dbl
if (n_shear (ns) /= 0) a2D(i,j,n_shear(ns), iblk) = spval_dbl
if (n_vort (ns) /= 0) a2D(i,j,n_vort(ns), iblk) = spval_dbl
if (n_sig1 (ns) /= 0) a2D(i,j,n_sig1(ns), iblk) = spval_dbl
if (n_sig2 (ns) /= 0) a2D(i,j,n_sig2(ns), iblk) = spval_dbl
if (n_sigP (ns) /= 0) a2D(i,j,n_sigP(ns), iblk) = spval_dbl
Expand Down Expand Up @@ -3996,6 +4006,8 @@ subroutine accum_hist (dt)
divu (i,j,iblk)*avail_hist_fields(n_divu(ns))%cona
if (n_shear (ns) /= 0) a2D(i,j,n_shear(ns),iblk) = &
shear(i,j,iblk)*avail_hist_fields(n_shear(ns))%cona
if (n_vort (ns) /= 0) a2D(i,j,n_vort(ns),iblk) = &
vort(i,j,iblk)*avail_hist_fields(n_vort(ns))%cona
if (n_sig1 (ns) /= 0) a2D(i,j,n_sig1(ns),iblk) = &
sig1 (i,j,iblk)*avail_hist_fields(n_sig1(ns))%cona
if (n_sig2 (ns) /= 0) a2D(i,j,n_sig2(ns),iblk) = &
Expand Down
22 changes: 14 additions & 8 deletions cicecore/cicedyn/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
!
! The following variables are currently hard-wired as snapshots
! (instantaneous rather than time-averages):
! divu, shear, sig1, sig2, sigP, trsig, mlt_onset, frz_onset, hisnap, aisnap
! divu, shear, vort, sig1, sig2, sigP, trsig, mlt_onset,
! frz_onset, hisnap, aisnap
!
! Options for histfreq: '1','h','d','m','y','x', where x means that
! output stream will not be used (recommended for efficiency).
Expand Down Expand Up @@ -48,18 +49,23 @@ module ice_history_shared
history_dir , & ! directory name for history file
incond_dir ! directory for snapshot initial conditions

character (len=char_len_long), public :: &
pointer_file ! input pointer file for restarts

character (len=char_len), public :: &
version_name

character (len=char_len), public :: &
history_format
history_format , & ! history format, cdf1, cdf2, cdf5, etc
history_rearranger ! history file rearranger, box or subset for pio

character (len=char_len), public :: &
hist_suffix(max_nstrm) ! appended to 'h' in filename when not 'x'

integer (kind=int_kind), public :: &
history_iotasks , & ! iotasks, root, stride defines io pes for pio
history_root , & ! iotasks, root, stride defines io pes for pio
history_stride , & ! iotasks, root, stride defines io pes for pio
history_deflate , & ! compression level for hdf5/netcdf4
history_chunksize(2) ! chunksize for hdf5/netcdf4

!---------------------------------------------------------------
! Instructions for adding a field: (search for 'example')
! Here or in ice_history_[process].F90:
Expand Down Expand Up @@ -267,7 +273,7 @@ module ice_history_shared
f_strocnxE = 'x', f_strocnyE = 'x', &
f_strintxE = 'x', f_strintyE = 'x', &
f_taubxE = 'x', f_taubyE = 'x', &
f_strength = 'm', &
f_strength = 'm', f_vort = 'm', &
f_divu = 'm', f_shear = 'm', &
f_sig1 = 'm', f_sig2 = 'm', &
f_sigP = 'm', &
Expand Down Expand Up @@ -434,7 +440,7 @@ module ice_history_shared
! f_strocnxE, f_strocnyE , &
! f_strintxE, f_strintyE , &
! f_taubxE, f_taubyE , &
f_strength, &
f_strength, f_vort , &
f_divu, f_shear , &
f_sig1, f_sig2 , &
f_sigP, &
Expand Down Expand Up @@ -626,7 +632,7 @@ module ice_history_shared
n_strocnxE , n_strocnyE , &
n_strintxE , n_strintyE , &
n_taubxE , n_taubyE , &
n_strength , &
n_strength , n_vort , &
n_divu , n_shear , &
n_sig1 , n_sig2 , &
n_sigP , &
Expand Down
22 changes: 19 additions & 3 deletions cicecore/cicedyn/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ subroutine eap (dt)
seabed_stress_factor_LKD, seabed_stress_factor_prob, &
seabed_stress_method, seabed_stress, &
stack_fields, unstack_fields, iceTmask, iceUmask, &
fld2, fld3, fld4
fld2, fld3, fld4, dxhy, dyhx, cxp, cyp, cxm, cym
use ice_flux, only: rdg_conv, strairxT, strairyT, &
strairxU, strairyU, uocn, vocn, ss_tltx, ss_tlty, fmU, &
strtltxU, strtltyU, strocnxU, strocnyU, strintxU, strintyU, taubxU, taubyU, &
Expand All @@ -118,10 +118,10 @@ subroutine eap (dt)
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
use ice_grid, only: tmask, umask, dxT, dyT, dxhy, dyhx, cxp, cyp, cxm, cym, &
use ice_grid, only: tmask, umask, dxT, dyT, dxU, dyU, &
tarear, uarear, grid_average_X2Y, &
grid_atm_dynu, grid_atm_dynv, grid_ocn_dynu, grid_ocn_dynv
use ice_state, only: aice, aiU, vice, vsno, uvel, vvel, divu, shear, &
use ice_state, only: aice, aiU, vice, vsno, uvel, vvel, divu, shear, vort, &
aice_init, aice0, aicen, vicen, strength
use ice_timers, only: timer_dynamics, timer_bound, &
ice_timer_start, ice_timer_stop
Expand Down Expand Up @@ -195,6 +195,7 @@ subroutine eap (dt)
rdg_shear(i,j,iblk) = c0 ! always zero. Could be moved
divu (i,j,iblk) = c0
shear(i,j,iblk) = c0
vort(i,j,iblk) = c0
e11(i,j,iblk) = c0
e12(i,j,iblk) = c0
e22(i,j,iblk) = c0
Expand Down Expand Up @@ -433,6 +434,7 @@ subroutine eap (dt)
arlx1i, denom1, &
uvel (:,:,iblk), vvel (:,:,iblk), &
dxT (:,:,iblk), dyT (:,:,iblk), &
dxU (:,:,iblk), dyU (:,:,iblk), &
dxhy (:,:,iblk), dyhx (:,:,iblk), &
cxp (:,:,iblk), cyp (:,:,iblk), &
cxm (:,:,iblk), cym (:,:,iblk), &
Expand All @@ -448,6 +450,7 @@ subroutine eap (dt)
stress12_1(:,:,iblk), stress12_2(:,:,iblk), &
stress12_3(:,:,iblk), stress12_4(:,:,iblk), &
shear (:,:,iblk), divu (:,:,iblk), &
vort (:,:,iblk), &
e11 (:,:,iblk), e12 (:,:,iblk), &
e22 (:,:,iblk), &
s11 (:,:,iblk), s12 (:,:,iblk), &
Expand Down Expand Up @@ -1162,6 +1165,7 @@ subroutine stress_eap (nx_block, ny_block, &
arlx1i, denom1, &
uvel, vvel, &
dxT, dyT, &
dxU, dyU, &
dxhy, dyhx, &
cxp, cyp, &
cxm, cym, &
Expand All @@ -1175,6 +1179,7 @@ subroutine stress_eap (nx_block, ny_block, &
stress12_1, stress12_2, &
stress12_3, stress12_4, &
shear, divu, &
vort, &
e11, e12, &
e22, &
s11, s12, &
Expand Down Expand Up @@ -1206,6 +1211,8 @@ subroutine stress_eap (nx_block, ny_block, &
vvel , & ! y-component of velocity (m/s)
dxT , & ! width of T-cell through the middle (m)
dyT , & ! height of T-cell through the middle (m)
dxU , & ! width of U-cell through the middle (m)
dyU , & ! height of U-cell through the middle (m)
dxhy , & ! 0.5*(HTE - HTW)
dyhx , & ! 0.5*(HTN - HTS)
cyp , & ! 1.5*HTE - 0.5*HTW
Expand All @@ -1226,6 +1233,7 @@ subroutine stress_eap (nx_block, ny_block, &
real (kind=dbl_kind), dimension (nx_block,ny_block), intent(inout) :: &
shear , & ! strain rate II component (1/s)
divu , & ! strain rate I component, velocity divergence (1/s)
vort , & ! vorticity (1/s)
e11 , & ! components of strain rate tensor (1/s)
e12 , & !
e22 , & !
Expand Down Expand Up @@ -1255,6 +1263,7 @@ subroutine stress_eap (nx_block, ny_block, &
divune, divunw, divuse, divusw , & ! divergence
tensionne, tensionnw, tensionse, tensionsw, & ! tension
shearne, shearnw, shearse, shearsw , & ! shearing
dvdxn, dvdxs, dudye, dudyw , & ! for vorticity calc
ssigpn, ssigps, ssigpe, ssigpw , &
ssigmn, ssigms, ssigme, ssigmw , &
ssig12n, ssig12s, ssig12e, ssig12w , &
Expand Down Expand Up @@ -1357,6 +1366,13 @@ subroutine stress_eap (nx_block, ny_block, &
(tensionne + tensionnw + tensionse + tensionsw)**2 &
+ (shearne + shearnw + shearse + shearsw)**2)

! vorticity
dvdxn = dyU(i,j)*vvel(i,j) - dyU(i-1,j)*vvel(i-1,j)
dvdxs = dyU(i,j-1)*vvel(i,j-1) - dyU(i-1,j-1)*vvel(i-1,j-1)
dudye = dxU(i,j)*uvel(i,j) - dxU(i,j-1)*uvel(i,j-1)
dudyw = dxU(i-1,j)*uvel(i-1,j) - dxU(i-1,j-1)*uvel(i-1,j-1)
vort(i,j) = p5*tarear(i,j)*(dvdxn + dvdxs - dudye - dudyw)

divu(i,j) = p25*(divune + divunw + divuse + divusw) * tarear(i,j)
rdg_conv(i,j) = -min(p25*(alpharne + alpharnw &
+ alpharsw + alpharse),c0) * tarear(i,j)
Expand Down
Loading

0 comments on commit c9e4679

Please sign in to comment.