Skip to content

Commit

Permalink
Moved tracer restart routines into main tracer modules (the circular …
Browse files Browse the repository at this point in the history
…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).
  • Loading branch information
eclare108213 committed Sep 28, 2013
1 parent eeec6ef commit fcd980c
Show file tree
Hide file tree
Showing 22 changed files with 447 additions and 736 deletions.
22 changes: 9 additions & 13 deletions drivers/cice/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ subroutine cice_init
use ice_dyn_eap, only: init_eap
use ice_dyn_shared, only: kdyn, init_evp
use ice_fileunits, only: init_fileunits
use ice_firstyear, only: init_FY
use ice_flux, only: init_coupler_flux, init_history_therm, &
init_history_dyn, init_flux_atm, init_flux_ocn
use ice_forcing, only: init_forcing_ocn, init_forcing_atmo, &
Expand Down Expand Up @@ -164,29 +163,26 @@ end subroutine cice_init
subroutine init_restart

use ice_aerosol, only: init_aerosol
use ice_age, only: init_age
use ice_age, only: init_age, restart_age, read_restart_age
use ice_blocks, only: nx_block, ny_block
use ice_brine, only: init_hbrine
use ice_calendar, only: time, calendar
use ice_domain, only: nblocks
use ice_domain_size, only: ncat
use ice_dyn_eap, only: read_restart_eap
use ice_dyn_shared, only: kdyn
use ice_firstyear, only: init_fy
use ice_firstyear, only: init_fy, restart_FY, read_restart_FY
use ice_flux, only: sss
use ice_init, only: ice_ic
use ice_lvl, only: init_lvl
use ice_meltpond_cesm, only: init_meltponds_cesm
use ice_meltpond_lvl, only: init_meltponds_lvl
use ice_meltpond_topo, only: init_meltponds_topo
use ice_lvl, only: init_lvl, restart_lvl, read_restart_lvl
use ice_meltpond_cesm, only: init_meltponds_cesm, &
restart_pond_cesm, read_restart_pond_cesm
use ice_meltpond_lvl, only: init_meltponds_lvl, &
restart_pond_lvl, read_restart_pond_lvl, dhsn
use ice_meltpond_topo, only: init_meltponds_topo, &
restart_pond_topo, read_restart_pond_topo
use ice_restart_shared, only: runtype, restart
use ice_restart_driver, only: restartfile, restartfile_v4
use ice_restart_age, only: restart_age, read_restart_age
use ice_restart_firstyear, only: restart_FY, read_restart_FY
use ice_restart_lvl, only: restart_lvl, read_restart_lvl
use ice_restart_meltpond_cesm, only: restart_pond_cesm, read_restart_pond_cesm
use ice_restart_meltpond_lvl, only: restart_pond_lvl, read_restart_pond_lvl, dhsn
use ice_restart_meltpond_topo, only: restart_pond_topo, read_restart_pond_topo
use ice_state, only: tr_iage, tr_FY, tr_lvl, tr_pond_cesm, &
tr_pond_lvl, tr_pond_topo, tr_aero, trcrn, &
nt_iage, nt_FY, nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, tr_brine
Expand Down
12 changes: 6 additions & 6 deletions drivers/cice/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ end subroutine CICE_Run

subroutine ice_step

use ice_age, only: write_restart_age
use ice_aerosol, only: write_restart_aero
use ice_boundary, only: ice_HaloUpdate
use ice_brine, only: hbrine_diags, write_restart_hbrine
Expand All @@ -110,16 +111,15 @@ subroutine ice_step
use ice_domain_size, only: nslyr
use ice_dyn_eap, only: write_restart_eap
use ice_dyn_shared, only: kdyn
use ice_firstyear, only: write_restart_FY
use ice_flux, only: scale_factor, init_history_therm
use ice_history, only: accum_hist
use ice_lvl, only: write_restart_lvl
use ice_restart, only: final_restart
use ice_restart_driver, only: dumpfile
use ice_restart_age, only: write_restart_age
use ice_restart_firstyear, only: write_restart_FY
use ice_restart_lvl, only: write_restart_lvl
use ice_restart_meltpond_cesm, only: write_restart_pond_cesm
use ice_restart_meltpond_lvl, only: write_restart_pond_lvl
use ice_restart_meltpond_topo, only: write_restart_pond_topo
use ice_meltpond_cesm, only: write_restart_pond_cesm
use ice_meltpond_lvl, only: write_restart_pond_lvl
use ice_meltpond_topo, only: write_restart_pond_topo
use ice_restoring, only: restore_ice, ice_HaloRestore
use ice_state, only: nt_qsno, trcrn, tr_iage, tr_FY, tr_lvl, &
tr_pond_cesm, tr_pond_lvl, tr_pond_topo, tr_brine, tr_aero
Expand Down
2 changes: 1 addition & 1 deletion input_templates/col/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
, restart_lvl = .false.
, tr_pond_cesm = .false.
, restart_pond_cesm = .false.
, tr_pond_topo = .false.
, tr_pond_topo = .true.
, restart_pond_topo = .false.
, tr_pond_lvl = .false.
, restart_pond_lvl = .false.
Expand Down
4 changes: 2 additions & 2 deletions input_templates/gx3/ice_in
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
, ocn_data_dir = 'unknown_ocn_data_dir'
, oceanmixed_file = 'unknown_oceanmixed_file'
, restore_sst = .false.
, trestore = 180
, trestore = 90
, restore_ice = .false.
/

Expand Down Expand Up @@ -270,7 +270,7 @@
, f_aisnap = 'x'
, f_trsig = 'm'
, f_icepresent = 'm'
, f_iage = 'x'
, f_iage = 'm'
, f_FY = 'x'
, f_aicen = 'x'
, f_vicen = 'x'
Expand Down
Binary file modified input_templates/gx3/iced_gx3_v5.nc
Binary file not shown.
4 changes: 4 additions & 0 deletions io_netcdf/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ subroutine init_restart_write(filename_spec)
call define_rest_field(ncid,'a12_4',dims)
endif

if (tr_pond_lvl) then
call define_rest_field(ncid,'fsnow',dims)
endif

if (skl_bgc) then
call define_rest_field(ncid,'algalN',dims)
call define_rest_field(ncid,'nit' ,dims)
Expand Down
4 changes: 4 additions & 0 deletions io_pio/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ subroutine init_restart_write(filename_spec)
call define_rest_field(File,'a12_4',dims)
endif

if (tr_pond_lvl) then
call define_rest_field(ncid,'fsnow',dims)
endif

if (skl_bgc) then
call define_rest_field(File,'algalN',dims)
call define_rest_field(File,'nit' ,dims)
Expand Down
58 changes: 57 additions & 1 deletion source/ice_age.F90
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ module ice_age
implicit none

private
public :: init_age, increment_age
public :: init_age, increment_age, write_restart_age, read_restart_age

logical (kind=log_kind), public :: &
restart_age ! if .true., read age tracer restart file

!=======================================================================

Expand Down Expand Up @@ -71,6 +74,59 @@ subroutine increment_age (nx_block, ny_block, &

end subroutine increment_age

!=======================================================================

! Dumps all values needed for restarting
! author Elizabeth C. Hunke, LANL

subroutine write_restart_age()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_dump_age
use ice_state, only: trcrn, nt_iage
use ice_restart,only: write_restart_field

! local variables

logical (kind=log_kind) :: diag

diag = .true.

!-----------------------------------------------------------------

call write_restart_field(nu_dump_age,0,trcrn(:,:,nt_iage,:,:),'ruf8', &
'iage',ncat,diag)

end subroutine write_restart_age

!=======================================================================

! Reads all values needed for an ice age restart
! author Elizabeth C. Hunke, LANL

subroutine read_restart_age()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_restart_age
use ice_state, only: trcrn, nt_iage
use ice_restart,only: read_restart_field

! local variables

logical (kind=log_kind) :: &
diag

diag = .true.

if (my_task == master_task) write(nu_diag,*) 'min/max age (s)'

call read_restart_field(nu_restart_age,0,trcrn(:,:,nt_iage,:,:),'ruf8', &
'iage',ncat,diag)

end subroutine read_restart_age

!=======================================================================

end module ice_age
Expand Down
67 changes: 66 additions & 1 deletion source/ice_firstyear.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ module ice_firstyear
implicit none

private
public :: init_FY, update_FYarea
public :: init_FY, update_FYarea, write_restart_FY, read_restart_FY

logical (kind=log_kind), public :: &
restart_FY ! if .true., read FY tracer restart file

!=======================================================================

Expand Down Expand Up @@ -101,6 +104,68 @@ subroutine update_FYarea (nx_block, ny_block, &

end subroutine update_FYarea

!=======================================================================

! Dumps all values needed for restarting
! author Elizabeth C. Hunke, LANL

subroutine write_restart_FY()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_dump_FY
use ice_flux, only: frz_onset
use ice_state, only: trcrn, nt_FY
use ice_restart, only: write_restart_field

! local variables

logical (kind=log_kind) :: diag

diag = .true.

!-----------------------------------------------------------------

call write_restart_field(nu_dump_FY,0,trcrn(:,:,nt_FY,:,:),'ruf8', &
'FY',ncat,diag)
call write_restart_field(nu_dump_FY,0,frz_onset,'ruf8', &
'frz_onset',1,diag)

end subroutine write_restart_FY

!=======================================================================

! Reads all values needed for an ice FY restart
! author Elizabeth C. Hunke, LANL

subroutine read_restart_FY()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_restart_FY
use ice_flux, only: frz_onset
use ice_state, only: trcrn, nt_FY
use ice_restart, only: read_restart_field

! local variables

logical (kind=log_kind) :: &
diag

diag = .true.

if (my_task == master_task) write(nu_diag,*) 'min/max first-year ice area'

call read_restart_field(nu_restart_FY,0,trcrn(:,:,nt_FY,:,:),'ruf8', &
'FY',ncat,diag)

if (my_task == master_task) write(nu_diag,*) 'min/max frz_onset'

call read_restart_field(nu_restart_FY,0,frz_onset,'ruf8', &
'frz_onset',1,diag)

end subroutine read_restart_FY

!=======================================================================

end module ice_firstyear
Expand Down
13 changes: 6 additions & 7 deletions source/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ module ice_init

subroutine input_data

use ice_age, only: restart_age
use ice_broadcast, only: broadcast_scalar, broadcast_array
use ice_constants, only: c0, c1, puny
use ice_diagnostics, only: diag_file, print_global, print_points, latpnt, lonpnt
Expand All @@ -56,6 +57,7 @@ subroutine input_data
use ice_exit, only: abort_ice
use ice_itd, only: kitd, kcatbound
use ice_ocean, only: oceanmixed_ice
use ice_firstyear, only: restart_FY
use ice_flux, only: update_ocn_f
use ice_forcing, only: &
ycycle, fyear_init, dbug, &
Expand All @@ -64,6 +66,7 @@ subroutine input_data
sss_data_type, sst_data_type, ocn_data_dir, &
oceanmixed_file, restore_sst, trestore
use ice_grid, only: grid_file, kmt_file, grid_type, grid_format
use ice_lvl, only: restart_lvl
use ice_mechred, only: kstrength, krdg_partic, krdg_redist, mu_rdg
use ice_dyn_shared, only: ndte, kdyn, revised_evp, yield_curve
use ice_shortwave, only: albicev, albicei, albsnowv, albsnowi, ahmax, &
Expand All @@ -76,14 +79,10 @@ subroutine input_data
nt_Tsfc, nt_qice, nt_qsno, nt_sice, nt_iage, nt_FY, &
nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, nt_aero, &
ntrcr
use ice_restart_age, only: restart_age
use ice_restart_firstyear, only: restart_FY
use ice_restart_lvl, only: restart_lvl
use ice_restart_meltpond_cesm, only: restart_pond_cesm, hs0
use ice_restart_meltpond_topo, only: hp1
use ice_restart_meltpond_lvl, only: restart_pond_lvl, dpscale, frzpnd, snowinfil, &
use ice_meltpond_cesm, only: restart_pond_cesm, hs0
use ice_meltpond_topo, only: hp1, restart_pond_topo
use ice_meltpond_lvl, only: restart_pond_lvl, dpscale, frzpnd, snowinfil, &
rfracmin, rfracmax, pndaspect, hs1
use ice_restart_meltpond_topo, only: restart_pond_topo
use ice_aerosol, only: restart_aero
use ice_therm_shared, only: ktherm, calc_Tsfc, conduct
use ice_therm_vertical, only: ustar_min
Expand Down
63 changes: 62 additions & 1 deletion source/ice_lvl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ module ice_lvl
implicit none

private
public :: init_lvl
public :: init_lvl, write_restart_lvl, read_restart_lvl

logical (kind=log_kind), public :: &
restart_lvl ! if .true., read lvl tracer restart file

!=======================================================================

Expand Down Expand Up @@ -41,6 +44,64 @@ subroutine init_lvl(nx_block, ny_block, ncat, alvl, vlvl)

end subroutine init_lvl

!=======================================================================

! Dumps all values needed for restarting
!
! author Elizabeth C. Hunke, LANL

subroutine write_restart_lvl()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_dump_lvl
use ice_state, only: nt_alvl, nt_vlvl, trcrn
use ice_restart, only: write_restart_field

! local variables

logical (kind=log_kind) :: diag

diag = .true.

!-----------------------------------------------------------------

call write_restart_field(nu_dump_lvl,0,trcrn(:,:,nt_alvl,:,:),'ruf8', &
'alvl',ncat,diag)
call write_restart_field(nu_dump_lvl,0,trcrn(:,:,nt_vlvl,:,:),'ruf8', &
'vlvl',ncat,diag)

end subroutine write_restart_lvl

!=======================================================================
! Reads all values needed for an ice lvl restart
!
! author Elizabeth C. Hunke, LANL

subroutine read_restart_lvl()

use ice_communicate, only: my_task, master_task
use ice_domain_size, only: ncat
use ice_fileunits, only: nu_diag, nu_restart_lvl
use ice_state, only: nt_alvl, nt_vlvl, trcrn
use ice_restart, only: read_restart_field

! local variables

logical (kind=log_kind) :: &
diag

diag = .true.

if (my_task == master_task) write(nu_diag,*) 'min/max level ice area, volume'

call read_restart_field(nu_restart_lvl,0,trcrn(:,:,nt_alvl,:,:),'ruf8', &
'alvl',ncat,diag)
call read_restart_field(nu_restart_lvl,0,trcrn(:,:,nt_vlvl,:,:),'ruf8', &
'vlvl',ncat,diag)

end subroutine read_restart_lvl

!=======================================================================

end module ice_lvl
Expand Down
Loading

0 comments on commit fcd980c

Please sign in to comment.