Skip to content

Commit

Permalink
Update NUOPC/CMEPS driver (#607)
Browse files Browse the repository at this point in the history
Update NUOPC/CMEPS driver

Update hera port
  • Loading branch information
DeniseWorthen authored Jun 17, 2021
1 parent d6eb125 commit ff88891
Show file tree
Hide file tree
Showing 16 changed files with 2,271 additions and 1,899 deletions.
7 changes: 4 additions & 3 deletions cicecore/cicedynB/general/ice_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,10 @@ subroutine input_data
dumpfreq='y' ! restart frequency option
dumpfreq_n = 1 ! restart frequency
dump_last = .false. ! write restart on last time step
restart = .false. ! if true, read restart files for initialization
restart_dir = './' ! write to executable dir for default
restart_file = 'iced' ! restart file name prefix
restart_ext = .false. ! if true, read/write ghost cells
restart_coszen = .false. ! if true, read/write coszen
use_restart_time = .true. ! if true, use time info written in file
pointer_file = 'ice.restart_file'
restart_format = 'default' ! restart file format
lcdf64 = .false. ! 64 bit offset for netCDF
Expand Down Expand Up @@ -452,6 +450,8 @@ subroutine input_data
#ifndef CESMCOUPLED
runid = 'unknown' ! run ID used in CESM and for machine 'bering'
runtype = 'initial' ! run type: 'initial', 'continue'
restart = .false. ! if true, read restart files for initialization
use_restart_time = .true. ! if true, use time info written in file
#endif

! extra tracers
Expand Down Expand Up @@ -1775,7 +1775,8 @@ subroutine input_data
grid_type /= 'rectangular' .and. &
grid_type /= 'cpom_grid' .and. &
grid_type /= 'regional' .and. &
grid_type /= 'latlon' ) then
grid_type /= 'latlon' .and. &
grid_type /= 'setmask' ) then
if (my_task == master_task) write(nu_diag,*) subname//' ERROR: unknown grid_type=',trim(grid_type)
abort_list = trim(abort_list)//":20"
endif
Expand Down
2 changes: 1 addition & 1 deletion cicecore/cicedynB/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module ice_grid
private
public :: init_grid1, init_grid2, &
t2ugrid_vector, u2tgrid_vector, &
to_ugrid, to_tgrid, alloc_grid
to_ugrid, to_tgrid, alloc_grid, makemask

character (len=char_len_long), public :: &
grid_format , & ! file format ('bin'=binary or 'nc'=netcdf)
Expand Down
850 changes: 428 additions & 422 deletions cicecore/drivers/nuopc/cmeps/CICE_InitMod.F90

Large diffs are not rendered by default.

42 changes: 19 additions & 23 deletions cicecore/drivers/nuopc/cmeps/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
! William H. Lipscomb, LANL
!
! 2006 ECH: moved exit timeLoop to prevent execution of unnecessary timestep
! 2006 ECH: Streamlined for efficiency
! 2006 ECH: Streamlined for efficiency
! 2006 ECH: Converted to free source form (F90)
! 2007 BPB: Modified Delta-Eddington shortwave interface
! 2008 ECH: moved ESMF code to its own driver
Expand Down Expand Up @@ -44,7 +44,7 @@ module CICE_RunMod

subroutine CICE_Run

use ice_calendar, only: istep, istep1, time, dt, calendar
use ice_calendar, only: istep, istep1, dt, calendar, advance_timestep
use ice_forcing, only: get_forcing_atmo, get_forcing_ocn, &
get_wave_spec
use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, &
Expand Down Expand Up @@ -77,19 +77,15 @@ subroutine CICE_Run
! timestep loop
!--------------------------------------------------------------------

istep = istep + 1 ! update time step counters
istep1 = istep1 + 1
time = time + dt ! determine the time and date

call ice_timer_start(timer_couple) ! atm/ocn coupling

call advance_timestep() ! advance timestep and update calendar data

if (z_tracers) call get_atm_bgc ! biogeochemistry

call init_flux_atm ! Initialize atmosphere fluxes sent to coupler
call init_flux_ocn ! initialize ocean fluxes sent to coupler

call calendar(time) ! at the end of the timestep

call ice_timer_stop(timer_couple) ! atm/ocn coupling

call ice_step
Expand All @@ -98,7 +94,7 @@ subroutine CICE_Run
! end of timestep loop
!--------------------------------------------------------------------

call ice_timer_stop(timer_step) ! end timestepping loop timer
call ice_timer_stop(timer_step) ! end timestepping loop timer

end subroutine CICE_Run

Expand Down Expand Up @@ -140,7 +136,7 @@ subroutine ice_step
use ice_prescribed_mod

integer (kind=int_kind) :: &
iblk , & ! block index
iblk , & ! block index
k , & ! dynamics supercycling index
ktherm ! thermodynamics is off when ktherm = -1

Expand Down Expand Up @@ -317,7 +313,7 @@ subroutine ice_step
if (tr_iso) call write_restart_iso
if (tr_aero) call write_restart_aero
if (solve_zsal .or. skl_bgc .or. z_tracers) &
call write_restart_bgc
call write_restart_bgc
if (tr_brine) call write_restart_hbrine
if (kdyn == 2) call write_restart_eap
call final_restart
Expand Down Expand Up @@ -361,12 +357,12 @@ subroutine coupling_prep (iblk)
use ice_step_mod, only: ocean_mixed_layer
use ice_timers, only: timer_couple, ice_timer_start, ice_timer_stop

integer (kind=int_kind), intent(in) :: &
iblk ! block index
integer (kind=int_kind), intent(in) :: &
iblk ! block index

! local variables

integer (kind=int_kind) :: &
integer (kind=int_kind) :: &
ilo,ihi,jlo,jhi, & ! beginning and end of physical domain
n , & ! thickness category index
i,j , & ! horizontal indices
Expand Down Expand Up @@ -506,8 +502,8 @@ subroutine coupling_prep (iblk)
fsalt_ai (i,j,iblk) = fsalt (i,j,iblk)
fhocn_ai (i,j,iblk) = fhocn (i,j,iblk)
fswthru_ai(i,j,iblk) = fswthru(i,j,iblk)
fzsal_ai (i,j,iblk) = fzsal (i,j,iblk)
fzsal_g_ai(i,j,iblk) = fzsal_g(i,j,iblk)
fzsal_ai (i,j,iblk) = fzsal (i,j,iblk)
fzsal_g_ai(i,j,iblk) = fzsal_g(i,j,iblk)

if (nbtrcr > 0) then
do k = 1, nbtrcr
Expand All @@ -528,7 +524,7 @@ subroutine coupling_prep (iblk)
enddo

!-----------------------------------------------------------------
! Divide fluxes by ice area
! Divide fluxes by ice area
! - the CESM coupler assumes fluxes are per unit ice area
! - also needed for global budget in diagnostics
!-----------------------------------------------------------------
Expand Down Expand Up @@ -580,16 +576,16 @@ subroutine coupling_prep (iblk)
if (.not. calc_Tsfc) then

!---------------------------------------------------------------
! If surface fluxes were provided, conserve these fluxes at ice
! free points by passing to ocean.
! If surface fluxes were provided, conserve these fluxes at ice
! free points by passing to ocean.
!---------------------------------------------------------------

call sfcflux_to_ocn &
call sfcflux_to_ocn &
(nx_block, ny_block, &
tmask (:,:,iblk), aice_init(:,:,iblk), &
fsurfn_f (:,:,:,iblk), flatn_f(:,:,:,iblk), &
fresh (:,:,iblk), fhocn (:,:,iblk))
endif
endif
!echmod
call ice_timer_stop(timer_couple,iblk) ! atm/ocn coupling

Expand All @@ -598,10 +594,10 @@ end subroutine coupling_prep
!=======================================================================
!
! If surface heat fluxes are provided to CICE instead of CICE calculating
! them internally (i.e. .not. calc_Tsfc), then these heat fluxes can
! them internally (i.e. .not. calc_Tsfc), then these heat fluxes can
! be provided at points which do not have ice. (This is could be due to
! the heat fluxes being calculated on a lower resolution grid or the
! heat fluxes not recalculated at every CICE timestep.) At ice free points,
! heat fluxes not recalculated at every CICE timestep.) At ice free points,
! conserve energy and water by passing these fluxes to the ocean.
!
! author: A. McLaren, Met Office
Expand Down
Loading

0 comments on commit ff88891

Please sign in to comment.