Skip to content

Commit

Permalink
Update gx3 and gx1 input filenames
Browse files Browse the repository at this point in the history
Update CI wget implementation CICE-Consortium#588
Create variable in ice_forcing.F90 called mixed_layer_depth_default and use it instead of c20
Fix bug in hourly output, created in time manager update CICE-Consortium#589
Set start year for all runs to 2005 and turn leap years on by default
Update documentation in history output section to add information about hist_avg namelist, noted in CICE-Consortium#566
  • Loading branch information
apcraig committed Apr 1, 2021
1 parent 270d2bb commit 4dc3bf1
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test-cice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:

defaults:
run:
shell: /bin/csh {0}
shell: /bin/csh -e {0}

jobs:
build:
Expand Down Expand Up @@ -104,9 +104,9 @@ jobs:
- name: download input data
run: |
cd $HOME/cice-dirs/input
wget 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 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 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/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
pwd
ls -alR
# - name: run case
Expand Down
9 changes: 6 additions & 3 deletions cicecore/cicedynB/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ module ice_forcing

! PRIVATE:

real (dbl_kind), parameter :: &
mixed_layer_depth_default = c20 ! default mixed layer depth in m

logical (kind=log_kind), parameter :: &
forcing_debug = .false. ! local debug flag

Expand Down Expand Up @@ -4153,7 +4156,7 @@ subroutine ocn_data_ncar(dt)
do j = 1, ny_block
do i = 1, nx_block
if (n == 2) sss (i,j,:) = c0
if (n == 3) hmix (i,j,:) = c20
if (n == 3) hmix (i,j,:) = mixed_layer_depth_default
if (n == 4) uocn (i,j,:) = c0
if (n == 5) vocn (i,j,:) = c0
if (n == 6) ss_tltx(i,j,:) = c0
Expand All @@ -4162,7 +4165,7 @@ subroutine ocn_data_ncar(dt)
do iblk = 1, nblocks
if (hm(i,j,iblk) == c1) then
if (n == 2) sss (i,j,iblk) = work1(i,j,iblk)
if (n == 3) hmix (i,j,iblk) = max(c20,work1(i,j,iblk))
if (n == 3) hmix (i,j,iblk) = max(mixed_layer_depth_default,work1(i,j,iblk))
if (n == 4) uocn (i,j,iblk) = work1(i,j,iblk)
if (n == 5) vocn (i,j,iblk) = work1(i,j,iblk)
if (n == 6) ss_tltx(i,j,iblk) = work1(i,j,iblk)
Expand Down Expand Up @@ -4277,7 +4280,7 @@ subroutine ocn_data_oned
ss_tlty(:,:,:) = c0
frzmlt (:,:,:) = c0 ! freezing/melting potential (W/m^2)
qdp (:,:,:) = c0 ! deep ocean heat flux (W/m^2)
hmix (:,:,:) = c20 ! ocean mixed layer depth
hmix (:,:,:) = mixed_layer_depth_default ! ocean mixed layer depth

end subroutine ocn_data_oned

Expand Down
8 changes: 8 additions & 0 deletions cicecore/shared/ice_calendar.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ module ice_calendar

integer (kind=int_kind), public :: &
seconds_per_day , & ! seconds per day
seconds_per_hour , & ! seconds per hour
days_per_year , & ! number of days in one year
daymo(months_per_year), & ! number of days in each month
daycal(months_per_year+1) ! accumulated days in year to end of prior month
Expand Down Expand Up @@ -169,12 +170,18 @@ subroutine init_calendar
write(nu_diag,*) trim(subname),' ERROR secday should basically be an integer',secday
call abort_ice(subname//'ERROR: improper secday')
endif
seconds_per_hour = nint(secday/real(hours_per_day,kind=dbl_kind))
if (abs(seconds_per_hour*hours_per_day - seconds_per_day) > 0) then
write(nu_diag,*) trim(subname),' ERROR seconds per day and hours per day inconsistent'
call abort_ice(subname//'ERROR: improper seconds_per_hour')
endif

istep = 0 ! local timestep number
myear=year_init ! year
mmonth=month_init ! month
mday=day_init ! day of the month
msec=sec_init ! seconds into date
hour=0 ! computed in calendar, but needs some reasonable initial value
istep1 = istep0 ! number of steps at current timestep
! real (dumped) or imagined (use to set calendar)
idate0 = (myear)*10000 + mmonth*100 + mday ! date (yyyymmdd)
Expand Down Expand Up @@ -343,6 +350,7 @@ subroutine calendar()

idate = (myear)*10000 + mmonth*100 + mday ! date (yyyymmdd)
yday = daycal(mmonth) + mday ! day of the year
hour = (msec+1)/(seconds_per_hour)
elapsed_months = (myear - year_init)*months_per_year + mmonth - month_init
elapsed_days = compute_days_between(year_init,month_init,day_init,myear,mmonth,mday)
elapsed_hours = elapsed_days * hours_per_day
Expand Down
6 changes: 3 additions & 3 deletions configuration/scripts/ice_in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
&setup_nml
days_per_year = 365
use_leap_years = .false.
year_init = 1997
use_leap_years = .true.
year_init = 2005
month_init = 1
day_init = 1
sec_init = 0
Expand Down Expand Up @@ -220,7 +220,7 @@
bgc_data_type = 'default'
fe_data_type = 'default'
ice_data_type = 'default'
fyear_init = 1997
fyear_init = 2005
ycycle = 1
atm_data_format = 'bin'
atm_data_dir = '/glade/u/home/tcraig/cice_data/'
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.box2001
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
days_per_year = 360
use_leap_years = .false.
npt = 240
ice_ic = 'default'
restart = .false.
Expand Down
1 change: 1 addition & 0 deletions configuration/scripts/options/set_nml.boxdyn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ nilyr = 1
ice_ic = 'default'
restart = .false.
days_per_year = 360
use_leap_years = .false.
npt = 72
dumpfreq = 'd'
dumpfreq_n = 2
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/options/set_nml.gx1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ runtype = 'initial'
year_init = 2005
use_leap_years = .true.
use_restart_time = .false.
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx1/iced.2005-01-01-00000.nc'
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx1/iced.gx1.2005-01-01-00000.210331.nc'
grid_format = 'bin'
grid_type = 'displaced_pole'
grid_file = 'ICE_MACHINE_INPUTDATA/CICE_data/grid/gx1/grid_gx1.bin'
Expand Down
2 changes: 1 addition & 1 deletion configuration/scripts/options/set_nml.gx1apr
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ year_init = 2005
month_init = 4
day_init = 1
sec_init = 0
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx1/iced.2005-04-01-00000.nc'
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx1/iced.gx1.2005-04-01-00000.210331.nc'
4 changes: 3 additions & 1 deletion configuration/scripts/options/set_nml.gx1prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
year_init = 2005
use_leap_years = .true.
npt_unit = 'y'
npt = 1
dumpfreq = 'm'
Expand All @@ -10,7 +11,8 @@ seabed_stress = .true.
seabed_stress_method = 'LKD'
ocn_data_type = 'ncar'
ocn_data_format = 'nc'
oceanmixed_file = 'ocean_forcing_clim_2D_gx1.nc'
oceanmixed_ice = .true.
oceanmixed_file = 'ocean_forcing_clim_2D_gx1.20210330.nc'
tr_brine = .true.
f_taubx = 'm'
f_tauby = 'm'
6 changes: 6 additions & 0 deletions configuration/scripts/options/set_nml.gx3sep
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
year_init = 2005
month_init = 9
day_init = 2
sec_init = 7200
use_leap_years = .true.
ice_ic = 'ICE_MACHINE_INPUTDATA/CICE_data/ic/gx3/iced.2005-09-01-00000.nc'
2 changes: 1 addition & 1 deletion configuration/scripts/options/set_nml.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ oceanmixed_ice = .true.
ocn_data_type = 'ncar'
ocn_data_format = 'nc'
ocn_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/CESM/MONTHLY'
oceanmixed_file = 'ocean_forcing_clim_2D_gx1.nc'
oceanmixed_file = 'ocean_forcing_clim_2D_gx1.20210330.nc'

2 changes: 1 addition & 1 deletion configuration/scripts/tests/base_suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ restart gx3 8x2 alt02,debug,short
restart gx3 4x2 alt03,debug,short
smoke gx3 4x4 alt04,debug,short
smoke gx3 4x4 alt05,debug,short
smoke gx3 10x2 debug,diag1,run5day,gx3sep
restart gbox128 4x2 short
restart gbox128 4x2 boxdyn,short
restart gbox128 4x2 boxdyn,short,debug
Expand All @@ -40,7 +41,6 @@ smoke gx1 24x1 medium,run90day,yi2008
smoke gx3 8x1 medium,run90day,yi2008
restart gx1 24x1 short
restart gx1 16x2 seabedLKD,gx1apr,medium,debug
restart gx1 16x2 seabedLKD,gx1apr,medium
restart gx1 15x2 seabedprob,medium
restart gx1 32x1 gx1prod,medium
smoke gx3 4x2 fsd1,diag24,run5day,debug
Expand Down
10 changes: 6 additions & 4 deletions doc/source/user_guide/ug_implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,8 @@ for history and restart files, and history and restart file must use the same
io package. The namelist variable ``history_format`` further refines the
format approach or style for some io packages.

Model output data is averaged over the period(s) given by ``histfreq`` and
Model output data can be written as instantaneous or average data as specified
by the ``hist_avg`` namelist flag. The data is written at the period(s) given by ``histfreq`` and
``histfreq_n``, and written to binary or netCDF files prepended by ``history_file``
in **ice_in**. These settings for history files are set in the
**setup_nml** section of **ice_in** (see :ref:`tabnamelist`).
Expand Down Expand Up @@ -821,15 +822,16 @@ is now a character string corresponding to ``histfreq`` or ‘x’ for none.
files, no matter what the frequency is.) If there are no namelist flags
with a given ``histfreq`` value, or if an element of ``histfreq_n`` is 0, then
no file will be written at that frequency. The output period can be
discerned from the filenames. Because all history is average output, it's
not possible to write instananeous output at any frequency except every timestep.
discerned from the filenames. All history streams will be either instantaneous
or averaged as specified by the ``hist_avg`` namelist setting.

For example, in the namelist:

::

``histfreq`` = ’1’, ’h’, ’d’, ’m’, ’y’
``histfreq_n`` = 1, 6, 0, 1, 1
``hist_avg`` = .true.
``f_hi`` = ’1’
``f_hs`` = ’h’
``f_Tsfc`` = ’d’
Expand Down Expand Up @@ -870,7 +872,7 @@ every 3 months, for example.
If ``write_ic`` is set to true in **ice\_in**, a snapshot of the same set
of history fields at the start of the run will be written to the history
directory in **iceh\_ic.[timeID].nc(da)**. Several history variables are
hard-coded for instantaneous output regardless of the averaging flag, at
hard-coded for instantaneous output regardless of the ``hist_avg`` averaging flag, at
the frequency given by their namelist flag.

The normalized principal components of internal ice stress are computed
Expand Down

0 comments on commit 4dc3bf1

Please sign in to comment.