Skip to content

Commit fcd980c

Browse files
committed
Moved tracer restart routines into main tracer modules (the circular dependencies disappeared with the advent if ice_restart_shared.F90).
Added fsnow to level-ice pond restarts. Replaced gx3 restart file (gx1 file will be replaced soon).
1 parent eeec6ef commit fcd980c

22 files changed

+447
-736
lines changed

drivers/cice/CICE_InitMod.F90

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ subroutine cice_init
6161
use ice_dyn_eap, only: init_eap
6262
use ice_dyn_shared, only: kdyn, init_evp
6363
use ice_fileunits, only: init_fileunits
64-
use ice_firstyear, only: init_FY
6564
use ice_flux, only: init_coupler_flux, init_history_therm, &
6665
init_history_dyn, init_flux_atm, init_flux_ocn
6766
use ice_forcing, only: init_forcing_ocn, init_forcing_atmo, &
@@ -164,29 +163,26 @@ end subroutine cice_init
164163
subroutine init_restart
165164

166165
use ice_aerosol, only: init_aerosol
167-
use ice_age, only: init_age
166+
use ice_age, only: init_age, restart_age, read_restart_age
168167
use ice_blocks, only: nx_block, ny_block
169168
use ice_brine, only: init_hbrine
170169
use ice_calendar, only: time, calendar
171170
use ice_domain, only: nblocks
172171
use ice_domain_size, only: ncat
173172
use ice_dyn_eap, only: read_restart_eap
174173
use ice_dyn_shared, only: kdyn
175-
use ice_firstyear, only: init_fy
174+
use ice_firstyear, only: init_fy, restart_FY, read_restart_FY
176175
use ice_flux, only: sss
177176
use ice_init, only: ice_ic
178-
use ice_lvl, only: init_lvl
179-
use ice_meltpond_cesm, only: init_meltponds_cesm
180-
use ice_meltpond_lvl, only: init_meltponds_lvl
181-
use ice_meltpond_topo, only: init_meltponds_topo
177+
use ice_lvl, only: init_lvl, restart_lvl, read_restart_lvl
178+
use ice_meltpond_cesm, only: init_meltponds_cesm, &
179+
restart_pond_cesm, read_restart_pond_cesm
180+
use ice_meltpond_lvl, only: init_meltponds_lvl, &
181+
restart_pond_lvl, read_restart_pond_lvl, dhsn
182+
use ice_meltpond_topo, only: init_meltponds_topo, &
183+
restart_pond_topo, read_restart_pond_topo
182184
use ice_restart_shared, only: runtype, restart
183185
use ice_restart_driver, only: restartfile, restartfile_v4
184-
use ice_restart_age, only: restart_age, read_restart_age
185-
use ice_restart_firstyear, only: restart_FY, read_restart_FY
186-
use ice_restart_lvl, only: restart_lvl, read_restart_lvl
187-
use ice_restart_meltpond_cesm, only: restart_pond_cesm, read_restart_pond_cesm
188-
use ice_restart_meltpond_lvl, only: restart_pond_lvl, read_restart_pond_lvl, dhsn
189-
use ice_restart_meltpond_topo, only: restart_pond_topo, read_restart_pond_topo
190186
use ice_state, only: tr_iage, tr_FY, tr_lvl, tr_pond_cesm, &
191187
tr_pond_lvl, tr_pond_topo, tr_aero, trcrn, &
192188
nt_iage, nt_FY, nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, tr_brine

drivers/cice/CICE_RunMod.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ end subroutine CICE_Run
100100

101101
subroutine ice_step
102102

103+
use ice_age, only: write_restart_age
103104
use ice_aerosol, only: write_restart_aero
104105
use ice_boundary, only: ice_HaloUpdate
105106
use ice_brine, only: hbrine_diags, write_restart_hbrine
@@ -110,16 +111,15 @@ subroutine ice_step
110111
use ice_domain_size, only: nslyr
111112
use ice_dyn_eap, only: write_restart_eap
112113
use ice_dyn_shared, only: kdyn
114+
use ice_firstyear, only: write_restart_FY
113115
use ice_flux, only: scale_factor, init_history_therm
114116
use ice_history, only: accum_hist
117+
use ice_lvl, only: write_restart_lvl
115118
use ice_restart, only: final_restart
116119
use ice_restart_driver, only: dumpfile
117-
use ice_restart_age, only: write_restart_age
118-
use ice_restart_firstyear, only: write_restart_FY
119-
use ice_restart_lvl, only: write_restart_lvl
120-
use ice_restart_meltpond_cesm, only: write_restart_pond_cesm
121-
use ice_restart_meltpond_lvl, only: write_restart_pond_lvl
122-
use ice_restart_meltpond_topo, only: write_restart_pond_topo
120+
use ice_meltpond_cesm, only: write_restart_pond_cesm
121+
use ice_meltpond_lvl, only: write_restart_pond_lvl
122+
use ice_meltpond_topo, only: write_restart_pond_topo
123123
use ice_restoring, only: restore_ice, ice_HaloRestore
124124
use ice_state, only: nt_qsno, trcrn, tr_iage, tr_FY, tr_lvl, &
125125
tr_pond_cesm, tr_pond_lvl, tr_pond_topo, tr_brine, tr_aero

input_templates/col/ice_in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
, restart_lvl = .false.
6969
, tr_pond_cesm = .false.
7070
, restart_pond_cesm = .false.
71-
, tr_pond_topo = .false.
71+
, tr_pond_topo = .true.
7272
, restart_pond_topo = .false.
7373
, tr_pond_lvl = .false.
7474
, restart_pond_lvl = .false.

input_templates/gx3/ice_in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
, ocn_data_dir = 'unknown_ocn_data_dir'
167167
, oceanmixed_file = 'unknown_oceanmixed_file'
168168
, restore_sst = .false.
169-
, trestore = 180
169+
, trestore = 90
170170
, restore_ice = .false.
171171
/
172172

@@ -270,7 +270,7 @@
270270
, f_aisnap = 'x'
271271
, f_trsig = 'm'
272272
, f_icepresent = 'm'
273-
, f_iage = 'x'
273+
, f_iage = 'm'
274274
, f_FY = 'x'
275275
, f_aicen = 'x'
276276
, f_vicen = 'x'

input_templates/gx3/iced_gx3_v5.nc

90.7 KB
Binary file not shown.

io_netcdf/ice_restart.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,10 @@ subroutine init_restart_write(filename_spec)
244244
call define_rest_field(ncid,'a12_4',dims)
245245
endif
246246

247+
if (tr_pond_lvl) then
248+
call define_rest_field(ncid,'fsnow',dims)
249+
endif
250+
247251
if (skl_bgc) then
248252
call define_rest_field(ncid,'algalN',dims)
249253
call define_rest_field(ncid,'nit' ,dims)

io_pio/ice_restart.F90

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,10 @@ subroutine init_restart_write(filename_spec)
251251
call define_rest_field(File,'a12_4',dims)
252252
endif
253253

254+
if (tr_pond_lvl) then
255+
call define_rest_field(ncid,'fsnow',dims)
256+
endif
257+
254258
if (skl_bgc) then
255259
call define_rest_field(File,'algalN',dims)
256260
call define_rest_field(File,'nit' ,dims)

source/ice_age.F90

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ module ice_age
1111
implicit none
1212

1313
private
14-
public :: init_age, increment_age
14+
public :: init_age, increment_age, write_restart_age, read_restart_age
15+
16+
logical (kind=log_kind), public :: &
17+
restart_age ! if .true., read age tracer restart file
1518

1619
!=======================================================================
1720

@@ -71,6 +74,59 @@ subroutine increment_age (nx_block, ny_block, &
7174

7275
end subroutine increment_age
7376

77+
!=======================================================================
78+
79+
! Dumps all values needed for restarting
80+
! author Elizabeth C. Hunke, LANL
81+
82+
subroutine write_restart_age()
83+
84+
use ice_communicate, only: my_task, master_task
85+
use ice_domain_size, only: ncat
86+
use ice_fileunits, only: nu_diag, nu_dump_age
87+
use ice_state, only: trcrn, nt_iage
88+
use ice_restart,only: write_restart_field
89+
90+
! local variables
91+
92+
logical (kind=log_kind) :: diag
93+
94+
diag = .true.
95+
96+
!-----------------------------------------------------------------
97+
98+
call write_restart_field(nu_dump_age,0,trcrn(:,:,nt_iage,:,:),'ruf8', &
99+
'iage',ncat,diag)
100+
101+
end subroutine write_restart_age
102+
103+
!=======================================================================
104+
105+
! Reads all values needed for an ice age restart
106+
! author Elizabeth C. Hunke, LANL
107+
108+
subroutine read_restart_age()
109+
110+
use ice_communicate, only: my_task, master_task
111+
use ice_domain_size, only: ncat
112+
use ice_fileunits, only: nu_diag, nu_restart_age
113+
use ice_state, only: trcrn, nt_iage
114+
use ice_restart,only: read_restart_field
115+
116+
! local variables
117+
118+
logical (kind=log_kind) :: &
119+
diag
120+
121+
diag = .true.
122+
123+
if (my_task == master_task) write(nu_diag,*) 'min/max age (s)'
124+
125+
call read_restart_field(nu_restart_age,0,trcrn(:,:,nt_iage,:,:),'ruf8', &
126+
'iage',ncat,diag)
127+
128+
end subroutine read_restart_age
129+
74130
!=======================================================================
75131

76132
end module ice_age

source/ice_firstyear.F90

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ module ice_firstyear
2020
implicit none
2121

2222
private
23-
public :: init_FY, update_FYarea
23+
public :: init_FY, update_FYarea, write_restart_FY, read_restart_FY
24+
25+
logical (kind=log_kind), public :: &
26+
restart_FY ! if .true., read FY tracer restart file
2427

2528
!=======================================================================
2629

@@ -101,6 +104,68 @@ subroutine update_FYarea (nx_block, ny_block, &
101104

102105
end subroutine update_FYarea
103106

107+
!=======================================================================
108+
109+
! Dumps all values needed for restarting
110+
! author Elizabeth C. Hunke, LANL
111+
112+
subroutine write_restart_FY()
113+
114+
use ice_communicate, only: my_task, master_task
115+
use ice_domain_size, only: ncat
116+
use ice_fileunits, only: nu_diag, nu_dump_FY
117+
use ice_flux, only: frz_onset
118+
use ice_state, only: trcrn, nt_FY
119+
use ice_restart, only: write_restart_field
120+
121+
! local variables
122+
123+
logical (kind=log_kind) :: diag
124+
125+
diag = .true.
126+
127+
!-----------------------------------------------------------------
128+
129+
call write_restart_field(nu_dump_FY,0,trcrn(:,:,nt_FY,:,:),'ruf8', &
130+
'FY',ncat,diag)
131+
call write_restart_field(nu_dump_FY,0,frz_onset,'ruf8', &
132+
'frz_onset',1,diag)
133+
134+
end subroutine write_restart_FY
135+
136+
!=======================================================================
137+
138+
! Reads all values needed for an ice FY restart
139+
! author Elizabeth C. Hunke, LANL
140+
141+
subroutine read_restart_FY()
142+
143+
use ice_communicate, only: my_task, master_task
144+
use ice_domain_size, only: ncat
145+
use ice_fileunits, only: nu_diag, nu_restart_FY
146+
use ice_flux, only: frz_onset
147+
use ice_state, only: trcrn, nt_FY
148+
use ice_restart, only: read_restart_field
149+
150+
! local variables
151+
152+
logical (kind=log_kind) :: &
153+
diag
154+
155+
diag = .true.
156+
157+
if (my_task == master_task) write(nu_diag,*) 'min/max first-year ice area'
158+
159+
call read_restart_field(nu_restart_FY,0,trcrn(:,:,nt_FY,:,:),'ruf8', &
160+
'FY',ncat,diag)
161+
162+
if (my_task == master_task) write(nu_diag,*) 'min/max frz_onset'
163+
164+
call read_restart_field(nu_restart_FY,0,frz_onset,'ruf8', &
165+
'frz_onset',1,diag)
166+
167+
end subroutine read_restart_FY
168+
104169
!=======================================================================
105170

106171
end module ice_firstyear

source/ice_init.F90

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module ice_init
3838

3939
subroutine input_data
4040

41+
use ice_age, only: restart_age
4142
use ice_broadcast, only: broadcast_scalar, broadcast_array
4243
use ice_constants, only: c0, c1, puny
4344
use ice_diagnostics, only: diag_file, print_global, print_points, latpnt, lonpnt
@@ -56,6 +57,7 @@ subroutine input_data
5657
use ice_exit, only: abort_ice
5758
use ice_itd, only: kitd, kcatbound
5859
use ice_ocean, only: oceanmixed_ice
60+
use ice_firstyear, only: restart_FY
5961
use ice_flux, only: update_ocn_f
6062
use ice_forcing, only: &
6163
ycycle, fyear_init, dbug, &
@@ -64,6 +66,7 @@ subroutine input_data
6466
sss_data_type, sst_data_type, ocn_data_dir, &
6567
oceanmixed_file, restore_sst, trestore
6668
use ice_grid, only: grid_file, kmt_file, grid_type, grid_format
69+
use ice_lvl, only: restart_lvl
6770
use ice_mechred, only: kstrength, krdg_partic, krdg_redist, mu_rdg
6871
use ice_dyn_shared, only: ndte, kdyn, revised_evp, yield_curve
6972
use ice_shortwave, only: albicev, albicei, albsnowv, albsnowi, ahmax, &
@@ -76,14 +79,10 @@ subroutine input_data
7679
nt_Tsfc, nt_qice, nt_qsno, nt_sice, nt_iage, nt_FY, &
7780
nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, nt_aero, &
7881
ntrcr
79-
use ice_restart_age, only: restart_age
80-
use ice_restart_firstyear, only: restart_FY
81-
use ice_restart_lvl, only: restart_lvl
82-
use ice_restart_meltpond_cesm, only: restart_pond_cesm, hs0
83-
use ice_restart_meltpond_topo, only: hp1
84-
use ice_restart_meltpond_lvl, only: restart_pond_lvl, dpscale, frzpnd, snowinfil, &
82+
use ice_meltpond_cesm, only: restart_pond_cesm, hs0
83+
use ice_meltpond_topo, only: hp1, restart_pond_topo
84+
use ice_meltpond_lvl, only: restart_pond_lvl, dpscale, frzpnd, snowinfil, &
8585
rfracmin, rfracmax, pndaspect, hs1
86-
use ice_restart_meltpond_topo, only: restart_pond_topo
8786
use ice_aerosol, only: restart_aero
8887
use ice_therm_shared, only: ktherm, calc_Tsfc, conduct
8988
use ice_therm_vertical, only: ustar_min

0 commit comments

Comments
 (0)