Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dmi drivers according to standalone #383

Merged
merged 5 commits into from
Dec 7, 2019
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cicecore/cicedynB/general/ice_forcing.F90
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ subroutine init_forcing_atmo

if (use_leap_years .and. (trim(atm_data_type) /= 'JRA55' .and. &
trim(atm_data_type) /= 'default' .and. &
trim(atm_data_type) /= 'hycom' .and. &
trim(atm_data_type) /= 'box2001')) then
write(nu_diag,*) 'use_leap_years option is currently only supported for'
write(nu_diag,*) 'JRA55, default , and box2001 atmospheric data'
Expand Down Expand Up @@ -2319,7 +2320,7 @@ subroutine JRA55_data (yr)
sec3hr = secday/c8 ! seconds in 3 hours
!maxrec = 2920 ! 365*8; for leap years = 366*8

if(use_leap_years) days_per_year = 366 !overrides setting of 365 in ice_calendar
if (use_leap_years) days_per_year = 366 !overrides setting of 365 in ice_calendar
maxrec = days_per_year*8

if(days_per_year == 365 .and. (mod(yr, 4) == 0)) then
Expand Down
13 changes: 0 additions & 13 deletions cicecore/cicedynB/infrastructure/ice_grid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -499,21 +499,8 @@ subroutine init_grid2
cos(angle_w)+ &
cos(angle_s)+ &
cos(angle_sw)))
! if ( angle_0 < c0 ) then
! if ( abs(angle_w - angle_0) > pi) &
! angle_w = angle_w - pi2
! if ( abs(angle_s - angle_0) > pi) &
! angle_s = angle_s - pi2
! if ( abs(angle_sw - angle_0) > pi) &
! angle_sw = angle_sw - pi2
! endif

! ANGLET_dum = angle_0 * p25 + angle_w * p25 &
! + angle_s * p25 + angle_sw* p25
! write(my_task+700,*) ANGLET_dum, ANGLET(i,j,iblk)
enddo
enddo
! call flush(my_task+700)
enddo
!$OMP END PARALLEL DO
endif ! cpom_grid
Expand Down
12 changes: 6 additions & 6 deletions cicecore/drivers/nuopc/dmi/CICE_FinalMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ subroutine CICE_Finalize
!echmod if (nu_diag /= 6) close (nu_diag) ! diagnostic output
call release_all_fileunits

!-------------------------------------------------------------------
! write 'finished' file if needed
!-------------------------------------------------------------------
!-------------------------------------------------------------------
! write 'finished' file if needed
!-------------------------------------------------------------------

if (runid == 'bering') call writeout_finished_file()

!-------------------------------------------------------------------
! quit MPI
!-------------------------------------------------------------------
!-------------------------------------------------------------------
! quit MPI
!-------------------------------------------------------------------

#ifndef coupled
#ifndef CICE_DMI
Expand Down
53 changes: 28 additions & 25 deletions cicecore/drivers/nuopc/dmi/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ subroutine CICE_Initialize(mpi_comm)

integer (kind=int_kind), optional, intent(in) :: mpi_comm ! communicator from nuopc
character(len=*), parameter :: subname='(CICE_Initialize)'
!--------------------------------------------------------------------
! model initialization
!--------------------------------------------------------------------
!--------------------------------------------------------------------
! model initialization
!--------------------------------------------------------------------
if (present(mpi_comm)) then
call cice_init(mpi_comm)
else
Expand Down Expand Up @@ -76,12 +76,12 @@ subroutine cice_init(mpi_comm)
use ice_flux, only: init_coupler_flux, init_history_therm, &
init_history_dyn, init_flux_atm, init_flux_ocn, alloc_flux
use ice_forcing, only: init_forcing_ocn, init_forcing_atmo, &
get_forcing_atmo, get_forcing_ocn, alloc_forcing
get_forcing_atmo, get_forcing_ocn
use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, &
faero_default, faero_optics, alloc_forcing_bgc
use ice_grid, only: init_grid1, init_grid2, alloc_grid
use ice_history, only: init_hist, accum_hist
use ice_restart_shared, only: restart, runid, runtype
use ice_restart_shared, only: restart, runtype
use ice_init, only: input_data, init_state
use ice_init_column, only: init_thermo_vertical, init_shortwave, init_zbgc, input_zbgc, count_tracers
use ice_kinds_mod
Expand All @@ -102,6 +102,9 @@ subroutine cice_init(mpi_comm)
endif
call init_fileunits ! unit numbers

! tcx debug, this will create a different logfile for each pe
! if (my_task /= master_task) nu_diag = 100+my_task

call icepack_configure() ! initialize icepack
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(trim(subname), &
Expand Down Expand Up @@ -140,9 +143,9 @@ subroutine cice_init(mpi_comm)
#endif
call init_thermo_vertical ! initialize vertical thermodynamics

call icepack_init_itd(ncat, hin_max) ! ice thickness distribution
call icepack_init_itd(ncat=ncat, hin_max=hin_max) ! ice thickness distribution
if (my_task == master_task) then
call icepack_init_itd_hist(ncat, hin_max, c_hi_range) ! output
call icepack_init_itd_hist(ncat=ncat, hin_max=hin_max, c_hi_range=c_hi_range) ! output
endif
call icepack_warnings_flush(nu_diag)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
Expand Down Expand Up @@ -186,9 +189,9 @@ subroutine cice_init(mpi_comm)
time = time + dt ! determine the time and date
call calendar(time) ! at the end of the first timestep

!--------------------------------------------------------------------
! coupler communication or forcing data initialization
!--------------------------------------------------------------------
!--------------------------------------------------------------------
! coupler communication or forcing data initialization
!--------------------------------------------------------------------

call init_forcing_atmo ! initialize atmospheric forcing (standalone)

Expand Down Expand Up @@ -405,21 +408,21 @@ subroutine init_restart
do j = 1, ny_block
do i = 1, nx_block
if (tmask(i,j,iblk)) then
call icepack_aggregate (ncat, &
aicen(i,j,:,iblk), &
trcrn(i,j,:,:,iblk),&
vicen(i,j,:,iblk), &
vsnon(i,j,:,iblk), &
aice (i,j, iblk), &
trcr (i,j,:,iblk), &
vice (i,j, iblk), &
vsno (i,j, iblk), &
aice0(i,j, iblk), &
ntrcr, &
trcr_depend, &
trcr_base, &
n_trcr_strata, &
nt_strata)
call icepack_aggregate(ncat = ncat, &
aicen = aicen(i,j,:,iblk), &
trcrn = trcrn(i,j,:,:,iblk), &
vicen = vicen(i,j,:,iblk), &
vsnon = vsnon(i,j,:,iblk), &
aice = aice (i,j, iblk), &
trcr = trcr (i,j,:,iblk), &
vice = vice (i,j, iblk), &
vsno = vsno (i,j, iblk), &
aice0 = aice0(i,j, iblk), &
ntrcr = ntrcr, &
trcr_depend = trcr_depend, &
trcr_base = trcr_base, &
n_trcr_strata = n_trcr_strata, &
nt_strata = nt_strata)
else
! tcraig, reset all tracer values on land to zero
trcrn(i,j,:,:,iblk) = c0
Expand Down
22 changes: 11 additions & 11 deletions cicecore/drivers/nuopc/dmi/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module CICE_RunMod
subroutine CICE_Run

use ice_calendar, only: istep, istep1, time, dt, stop_now, calendar
use ice_forcing, only: get_forcing_atmo, get_forcing_ocn, atm_data_type
use ice_forcing, only: get_forcing_atmo, get_forcing_ocn
use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, &
faero_default
use ice_flux, only: init_flux_atm, init_flux_ocn
Expand All @@ -54,9 +54,9 @@ subroutine CICE_Run
tr_aero, tr_zaero, skl_bgc, z_tracers
character(len=*), parameter :: subname = '(CICE_Run)'

!--------------------------------------------------------------------
! initialize error code and step timer
!--------------------------------------------------------------------
!--------------------------------------------------------------------
! initialize error code and step timer
!--------------------------------------------------------------------

call ice_timer_start(timer_step) ! start timing entire run

Expand All @@ -67,11 +67,11 @@ subroutine CICE_Run
file=__FILE__, line=__LINE__)

#ifndef CICE_IN_NEMO
!--------------------------------------------------------------------
! timestep loop
!--------------------------------------------------------------------
!--------------------------------------------------------------------
! timestep loop
!--------------------------------------------------------------------
#ifndef CICE_DMI
timeLoop: do
timeLoop: do
#endif
#endif
call ice_step
Expand Down Expand Up @@ -116,9 +116,9 @@ subroutine CICE_Run
enddo timeLoop
#endif
#endif
!--------------------------------------------------------------------
! end of timestep loop
!--------------------------------------------------------------------
!--------------------------------------------------------------------
! end of timestep loop
!--------------------------------------------------------------------

call ice_timer_stop(timer_step) ! end timestepping loop timer

Expand Down