From ab28b451b4634ed9686f40f988f7ccc9db7aef61 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Tue, 20 Mar 2018 14:28:10 -0600 Subject: [PATCH 01/21] Remove some dummy arguments and unused variables. --- .../cicedynB/analysis/ice_diagnostics.F90 | 81 +++++++------ .../cicedynB/analysis/ice_diagnostics_bgc.F90 | 1 - cicecore/cicedynB/analysis/ice_history.F90 | 1 - .../cicedynB/analysis/ice_history_bgc.F90 | 1 - .../cicedynB/analysis/ice_history_drag.F90 | 1 - .../cicedynB/analysis/ice_history_mechred.F90 | 1 - .../cicedynB/analysis/ice_history_pond.F90 | 1 - .../cicedynB/analysis/ice_history_shared.F90 | 1 - cicecore/cicedynB/dynamics/ice_dyn_eap.F90 | 108 ++++++++--------- cicecore/cicedynB/dynamics/ice_dyn_evp.F90 | 1 - cicecore/cicedynB/dynamics/ice_dyn_shared.F90 | 11 +- .../dynamics/ice_transport_driver.F90 | 1 - .../cicedynB/dynamics/ice_transport_remap.F90 | 1 - cicecore/cicedynB/general/ice_flux.F90 | 1 - cicecore/cicedynB/general/ice_flux_bgc.F90 | 1 - cicecore/cicedynB/general/ice_forcing.F90 | 1 - cicecore/cicedynB/general/ice_forcing_bgc.F90 | 1 - cicecore/cicedynB/general/ice_init.F90 | 1 - cicecore/cicedynB/general/ice_state.F90 | 6 +- cicecore/cicedynB/general/ice_step_mod.F90 | 1 - .../infrastructure/comm/mpi/ice_boundary.F90 | 16 ++- .../infrastructure/comm/mpi/ice_broadcast.F90 | 2 - .../comm/mpi/ice_communicate.F90 | 2 - .../infrastructure/comm/mpi/ice_exit.F90 | 1 - .../comm/mpi/ice_gather_scatter.F90 | 2 - .../comm/mpi/ice_global_reductions.F90 | 8 +- .../infrastructure/comm/mpi/ice_timers.F90 | 1 - .../comm/serial/ice_boundary.F90 | 5 - .../comm/serial/ice_broadcast.F90 | 2 - .../comm/serial/ice_communicate.F90 | 2 - .../infrastructure/comm/serial/ice_exit.F90 | 1 - .../comm/serial/ice_gather_scatter.F90 | 2 - .../comm/serial/ice_global_reductions.F90 | 2 - .../infrastructure/comm/serial/ice_timers.F90 | 1 - .../cicedynB/infrastructure/ice_blocks.F90 | 1 - .../cicedynB/infrastructure/ice_domain.F90 | 7 +- cicecore/cicedynB/infrastructure/ice_grid.F90 | 28 ++--- .../infrastructure/ice_read_write.F90 | 102 ++++++++-------- .../infrastructure/ice_restart_driver.F90 | 1 - .../cicedynB/infrastructure/ice_restoring.F90 | 1 - .../io/io_binary/ice_history_write.F90 | 1 - .../io/io_binary/ice_restart.F90 | 1 - .../io/io_netcdf/ice_history_write.F90 | 1 - .../io/io_netcdf/ice_restart.F90 | 17 +-- .../io/io_pio/ice_history_write.F90 | 1 - .../infrastructure/io/io_pio/ice_restart.F90 | 2 - cicecore/drivers/cesm/CICE_FinalMod.F90 | 1 - cicecore/drivers/cesm/CICE_InitMod.F90 | 1 - cicecore/drivers/cesm/CICE_RunMod.F90 | 1 - cicecore/drivers/cesm/CICE_RunMod.F90_debug | 1 - cicecore/drivers/cesm/ice_prescribed_mod.F90 | 1 - cicecore/drivers/cice/CICE.F90 | 1 - cicecore/drivers/cice/CICE_FinalMod.F90 | 1 - cicecore/drivers/cice/CICE_InitMod.F90 | 1 - cicecore/drivers/cice/CICE_RunMod.F90 | 1 - cicecore/drivers/cice/CICE_RunMod.F90_debug | 1 - cicecore/drivers/hadgem3/CICE.F90 | 1 - cicecore/drivers/hadgem3/CICE_FinalMod.F90 | 1 - cicecore/drivers/hadgem3/CICE_InitMod.F90 | 1 - cicecore/drivers/hadgem3/CICE_RunMod.F90 | 1 - .../shared/constants/cesm/ice_constants.F90 | 1 - .../shared/constants/cice/ice_constants.F90 | 1 - .../constants/hadgem3/ice_constants.F90 | 1 - cicecore/shared/ice_arrays_column.F90 | 1 - cicecore/shared/ice_calendar.F90 | 1 - cicecore/shared/ice_distribution.F90 | 112 +++++++++++++++++- cicecore/shared/ice_domain_size.F90 | 1 - cicecore/shared/ice_fileunits.F90 | 5 +- cicecore/shared/ice_init_column.F90 | 3 +- cicecore/shared/ice_kinds_mod.F90 | 1 - cicecore/shared/ice_restart_column.F90 | 1 - cicecore/shared/ice_restart_shared.F90 | 4 - cicecore/shared/ice_spacecurve.F90 | 24 ++-- configuration/scripts/cice.batch.csh | 10 ++ configuration/scripts/cice.launch.csh | 5 + .../scripts/machines/Macros.hobart_intel | 65 ++++++++++ doc/source/master_list.bib | 2 - 77 files changed, 378 insertions(+), 306 deletions(-) create mode 100755 configuration/scripts/machines/Macros.hobart_intel diff --git a/cicecore/cicedynB/analysis/ice_diagnostics.F90 b/cicecore/cicedynB/analysis/ice_diagnostics.F90 index 25cbdb544..5c2275e48 100644 --- a/cicecore/cicedynB/analysis/ice_diagnostics.F90 +++ b/cicecore/cicedynB/analysis/ice_diagnostics.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_diagnostics.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Diagnostic information output during run @@ -14,7 +13,7 @@ module ice_diagnostics use ice_kinds_mod use ice_communicate, only: my_task, master_task use ice_constants, only: c0 - use ice_calendar, only: diagfreq, istep1, istep + use ice_calendar, only: istep1 use ice_fileunits, only: nu_diag use ice_fileunits, only: flush_fileunit use ice_exit, only: abort_ice @@ -86,7 +85,7 @@ module ice_diagnostics ! printing info for routine print_state ! iblkp, ip, jp, mtask identify the grid cell to print - character (char_len) :: plabel +! character (char_len) :: plabel integer (kind=int_kind), parameter, public :: & check_step = 999999999, & ! begin printing at istep1=check_step iblkp = 1, & ! block number @@ -116,14 +115,14 @@ subroutine runtime_diags (dt) use ice_domain_size, only: ncat, n_aero, max_blocks use ice_flux, only: alvdr, alidr, alvdf, alidf, evap, fsnow, frazil, & fswabs, fswthru, flw, flwout, fsens, fsurf, flat, frzmlt_init, frain, fpond, & - coszen, fhocn_ai, fsalt_ai, fresh_ai, frazil_diag, & + fhocn_ai, fsalt_ai, fresh_ai, frazil_diag, & update_ocn_f, Tair, Qa, fsw, fcondtop, meltt, meltb, meltl, snoice, & dsnow, congel, sst, sss, Tf, fhocn, & swvdr, swvdf, swidr, swidf, & alvdr_init, alvdf_init, alidr_init, alidf_init use ice_flux_bgc, only: faero_atm, faero_ocn use ice_global_reductions, only: global_sum, global_sum_prod, global_maxval - use ice_grid, only: lmask_n, lmask_s, tarean, tareas, grid_type + use ice_grid, only: lmask_n, lmask_s, tarean, tareas use ice_state ! everything #ifdef CESMCOUPLED use ice_prescribed_mod, only: prescribed_ice @@ -1210,7 +1209,7 @@ subroutine total_salt (work) use ice_blocks, only: nx_block, ny_block use ice_domain, only: nblocks - use ice_domain_size, only: ncat, nilyr, nslyr, max_blocks + use ice_domain_size, only: ncat, nilyr, max_blocks use ice_grid, only: tmask use ice_state, only: vicen, trcrn @@ -1662,41 +1661,41 @@ subroutine print_points_state(plabel,ilabel) write(nu_diag,*) trim(llabel),'uvel=',uvel(i,j,iblk) write(nu_diag,*) trim(llabel),'vvel=',vvel(i,j,iblk) - ! write(nu_diag,*) ' ' - ! write(nu_diag,*) 'atm states and fluxes' - ! write(nu_diag,*) ' uatm = ',uatm (i,j,iblk) - ! write(nu_diag,*) ' vatm = ',vatm (i,j,iblk) - ! write(nu_diag,*) ' potT = ',potT (i,j,iblk) - ! write(nu_diag,*) ' Tair = ',Tair (i,j,iblk) - ! write(nu_diag,*) ' Qa = ',Qa (i,j,iblk) - ! write(nu_diag,*) ' rhoa = ',rhoa (i,j,iblk) - ! write(nu_diag,*) ' swvdr = ',swvdr(i,j,iblk) - ! write(nu_diag,*) ' swvdf = ',swvdf(i,j,iblk) - ! write(nu_diag,*) ' swidr = ',swidr(i,j,iblk) - ! write(nu_diag,*) ' swidf = ',swidf(i,j,iblk) - ! write(nu_diag,*) ' flw = ',flw (i,j,iblk) - ! write(nu_diag,*) ' frain = ',frain(i,j,iblk) - ! write(nu_diag,*) ' fsnow = ',fsnow(i,j,iblk) - ! write(nu_diag,*) ' ' - ! write(nu_diag,*) 'ocn states and fluxes' - ! write(nu_diag,*) ' frzmlt = ',frzmlt (i,j,iblk) - ! write(nu_diag,*) ' sst = ',sst (i,j,iblk) - ! write(nu_diag,*) ' sss = ',sss (i,j,iblk) - ! write(nu_diag,*) ' Tf = ',Tf (i,j,iblk) - ! write(nu_diag,*) ' uocn = ',uocn (i,j,iblk) - ! write(nu_diag,*) ' vocn = ',vocn (i,j,iblk) - ! write(nu_diag,*) ' strtltx = ',strtltx(i,j,iblk) - ! write(nu_diag,*) ' strtlty = ',strtlty(i,j,iblk) - ! write(nu_diag,*) ' ' - ! write(nu_diag,*) 'srf states and fluxes' - ! write(nu_diag,*) ' Tref = ',Tref (i,j,iblk) - ! write(nu_diag,*) ' Qref = ',Qref (i,j,iblk) - ! write(nu_diag,*) ' Uref = ',Uref (i,j,iblk) - ! write(nu_diag,*) ' fsens = ',fsens (i,j,iblk) - ! write(nu_diag,*) ' flat = ',flat (i,j,iblk) - ! write(nu_diag,*) ' evap = ',evap (i,j,iblk) - ! write(nu_diag,*) ' flwout = ',flwout(i,j,iblk) - ! write(nu_diag,*) ' ' + write(nu_diag,*) ' ' + write(nu_diag,*) 'atm states and fluxes' + write(nu_diag,*) ' uatm = ',uatm (i,j,iblk) + write(nu_diag,*) ' vatm = ',vatm (i,j,iblk) + write(nu_diag,*) ' potT = ',potT (i,j,iblk) + write(nu_diag,*) ' Tair = ',Tair (i,j,iblk) + write(nu_diag,*) ' Qa = ',Qa (i,j,iblk) + write(nu_diag,*) ' rhoa = ',rhoa (i,j,iblk) + write(nu_diag,*) ' swvdr = ',swvdr(i,j,iblk) + write(nu_diag,*) ' swvdf = ',swvdf(i,j,iblk) + write(nu_diag,*) ' swidr = ',swidr(i,j,iblk) + write(nu_diag,*) ' swidf = ',swidf(i,j,iblk) + write(nu_diag,*) ' flw = ',flw (i,j,iblk) + write(nu_diag,*) ' frain = ',frain(i,j,iblk) + write(nu_diag,*) ' fsnow = ',fsnow(i,j,iblk) + write(nu_diag,*) ' ' + write(nu_diag,*) 'ocn states and fluxes' + write(nu_diag,*) ' frzmlt = ',frzmlt (i,j,iblk) + write(nu_diag,*) ' sst = ',sst (i,j,iblk) + write(nu_diag,*) ' sss = ',sss (i,j,iblk) + write(nu_diag,*) ' Tf = ',Tf (i,j,iblk) + write(nu_diag,*) ' uocn = ',uocn (i,j,iblk) + write(nu_diag,*) ' vocn = ',vocn (i,j,iblk) + write(nu_diag,*) ' strtltx = ',strtltx(i,j,iblk) + write(nu_diag,*) ' strtlty = ',strtlty(i,j,iblk) + write(nu_diag,*) ' ' + write(nu_diag,*) 'srf states and fluxes' + write(nu_diag,*) ' Tref = ',Tref (i,j,iblk) + write(nu_diag,*) ' Qref = ',Qref (i,j,iblk) + write(nu_diag,*) ' Uref = ',Uref (i,j,iblk) + write(nu_diag,*) ' fsens = ',fsens (i,j,iblk) + write(nu_diag,*) ' flat = ',flat (i,j,iblk) + write(nu_diag,*) ' evap = ',evap (i,j,iblk) + write(nu_diag,*) ' flwout = ',flwout(i,j,iblk) + write(nu_diag,*) ' ' endif ! my_task enddo ! ncnt diff --git a/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 b/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 index 3154cffc5..46ceead4f 100644 --- a/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_diagnostics_bgc.F90 1447 2016-04-28 18:09:53Z afrobert@nps.edu $ !======================================================================= ! Diagnostic information output during run diff --git a/cicecore/cicedynB/analysis/ice_history.F90 b/cicecore/cicedynB/analysis/ice_history.F90 index 32dbe5823..8c810a7a6 100644 --- a/cicecore/cicedynB/analysis/ice_history.F90 +++ b/cicecore/cicedynB/analysis/ice_history.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Driver for core history output diff --git a/cicecore/cicedynB/analysis/ice_history_bgc.F90 b/cicecore/cicedynB/analysis/ice_history_bgc.F90 index f31445150..6e52fa180 100644 --- a/cicecore/cicedynB/analysis/ice_history_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_history_bgc.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_bgc.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Biogeochemistry history output ! diff --git a/cicecore/cicedynB/analysis/ice_history_drag.F90 b/cicecore/cicedynB/analysis/ice_history_drag.F90 index 4575c92b4..0cf176de4 100644 --- a/cicecore/cicedynB/analysis/ice_history_drag.F90 +++ b/cicecore/cicedynB/analysis/ice_history_drag.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_drag.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! 2013 module for form drag parameters diff --git a/cicecore/cicedynB/analysis/ice_history_mechred.F90 b/cicecore/cicedynB/analysis/ice_history_mechred.F90 index 6e3cddd7e..0bb378b45 100644 --- a/cicecore/cicedynB/analysis/ice_history_mechred.F90 +++ b/cicecore/cicedynB/analysis/ice_history_mechred.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_mechred.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Mechanical redistribution history output diff --git a/cicecore/cicedynB/analysis/ice_history_pond.F90 b/cicecore/cicedynB/analysis/ice_history_pond.F90 index 6a0d7a34d..7825a7e0c 100644 --- a/cicecore/cicedynB/analysis/ice_history_pond.F90 +++ b/cicecore/cicedynB/analysis/ice_history_pond.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_pond.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Melt pond history output diff --git a/cicecore/cicedynB/analysis/ice_history_shared.F90 b/cicecore/cicedynB/analysis/ice_history_shared.F90 index f98f10044..3b1cb2f57 100644 --- a/cicecore/cicedynB/analysis/ice_history_shared.F90 +++ b/cicecore/cicedynB/analysis/ice_history_shared.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_shared.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Output files: netCDF or binary data, Fortran unformatted dumps diff --git a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 index b2a528b9d..4629d902a 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_dyn_eap.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Elastic-anisotropic sea ice dynamics model @@ -89,8 +88,8 @@ subroutine eap (dt) use ice_constants, only: field_loc_center, field_loc_NEcorner, & field_type_scalar, field_type_vector use ice_domain, only: nblocks, blocks_ice, halo_info, maskhalo_dyn - use ice_dyn_shared, only: fcor_blk, ndte, dtei, a_min, m_min, & - cosw, sinw, denom1, uvel_init, vvel_init, arlx1i, & + use ice_dyn_shared, only: fcor_blk, ndte, dtei, & + denom1, uvel_init, vvel_init, arlx1i, & evp_prep1, evp_prep2, stepu, evp_finish, & basal_stress_coeff, basalstress use ice_flux, only: rdg_conv, rdg_shear, prs_sig, strairxT, strairyT, & @@ -102,7 +101,7 @@ subroutine eap (dt) stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, & - tarear, uarear, tinyarea, to_ugrid, t2ugrid_vector, u2tgrid_vector + tarear, uarear, to_ugrid, t2ugrid_vector, u2tgrid_vector use ice_state, only: aice, vice, vsno, uvel, vvel, divu, shear, & aice_init, aice0, aicen, vicen, strength ! use ice_timers, only: timer_dynamics, timer_bound, & @@ -375,7 +374,6 @@ subroutine eap (dt) cxp (:,:,iblk), cyp (:,:,iblk), & cxm (:,:,iblk), cym (:,:,iblk), & tarear (:,:,iblk), strength (:,:,iblk), & - a11 (:,:,iblk), a12 (:,:,iblk), & a11_1 (:,:,iblk), a11_2 (:,:,iblk), & a11_3 (:,:,iblk), a11_4 (:,:,iblk), & a12_1 (:,:,iblk), a12_2 (:,:,iblk), & @@ -532,10 +530,8 @@ end subroutine eap subroutine init_eap (dt) use ice_blocks, only: nx_block, ny_block - use ice_communicate, only: my_task, master_task use ice_domain, only: nblocks use ice_dyn_shared, only: init_evp - use ice_restart_shared, only: runtype real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -543,21 +539,21 @@ subroutine init_eap (dt) ! local variables integer (kind=int_kind) :: & - i, j, k, & + i, j, & iblk ! block index real (kind=dbl_kind), parameter :: & eps6 = 1.0e-6_dbl_kind integer (kind=int_kind) :: & - ix, iy, ip, iz, n, ia + ix, iy, iz, ia integer (kind=int_kind), parameter :: & nz = 100 real (kind=dbl_kind) :: & - ainit, xinit, yinit, pinit, zinit, & - da, dx, dy, dp, dz, a1, & + ainit, xinit, yinit, zinit, & + da, dx, dy, dz, & pi, pih, piq, phi call icepack_query_parameters(pi_out=pi, pih_out=pih, piq_out=piq) @@ -715,10 +711,11 @@ FUNCTION s11kr(x,y,z,phi) real (kind=dbl_kind) :: & n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & - t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & +! t1t2i11, t1t2i12, t1t2i21, t1t2i22, & +! t2t1i11, t2t1i12, t2t1i21, t2t1i22, & d11, d12, d22, & - IIn1t2, IIn2t1, IIt1t2, & + IIn1t2, IIn2t1, & +! IIt1t2, & Hen1t2, Hen2t1, & pih, puny @@ -737,14 +734,14 @@ FUNCTION s11kr(x,y,z,phi) n2t1i12 = cos(z-pih+p) * sin(z-p) n2t1i21 = sin(z-pih+p) * cos(z-p) n2t1i22 = sin(z-pih+p) * sin(z-p) - t1t2i11 = cos(z-p) * cos(z+p) - t1t2i12 = cos(z-p) * sin(z+p) - t1t2i21 = sin(z-p) * cos(z+p) - t1t2i22 = sin(z-p) * sin(z+p) - t2t1i11 = cos(z+p) * cos(z-p) - t2t1i12 = cos(z+p) * sin(z-p) - t2t1i21 = sin(z+p) * cos(z-p) - t2t1i22 = sin(z+p) * sin(z-p) +! t1t2i11 = cos(z-p) * cos(z+p) +! t1t2i12 = cos(z-p) * sin(z+p) +! t1t2i21 = sin(z-p) * cos(z+p) +! t1t2i22 = sin(z-p) * sin(z+p) +! t2t1i11 = cos(z+p) * cos(z-p) +! t2t1i12 = cos(z+p) * sin(z-p) +! t2t1i21 = sin(z+p) * cos(z-p) +! t2t1i22 = sin(z+p) * sin(z-p) ! In expression of tensor d, with this formulatin d(x)=-d(x+pi) ! Solution, when diagonalizing always check sgn(a11-a22) if > then keep x else x=x-pi/2 d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) @@ -752,7 +749,7 @@ FUNCTION s11kr(x,y,z,phi) d22 = cos(y)*cos(y)*(sin(x)+cos(x)*tan(y)*tan(y)) IIn1t2 = n1t2i11 * d11 + (n1t2i12 + n1t2i21) * d12 + n1t2i22 * d22 IIn2t1 = n2t1i11 * d11 + (n2t1i12 + n2t1i21) * d12 + n2t1i22 * d22 - IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 +! IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 if (-IIn1t2>=puny) then Hen1t2 = c1 @@ -784,10 +781,11 @@ FUNCTION s12kr(x,y,z,phi) real (kind=dbl_kind) :: & n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & - t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & +! t1t2i11, t1t2i12, t1t2i21, t1t2i22, & +! t2t1i11, t2t1i12, t2t1i21, t2t1i22, & d11, d12, d22, & - IIn1t2, IIn2t1, IIt1t2, & + IIn1t2, IIn2t1, & +! IIt1t2, & Hen1t2, Hen2t1, & pih, puny @@ -806,20 +804,20 @@ FUNCTION s12kr(x,y,z,phi) n2t1i12 = cos(z-pih+p) * sin(z-p) n2t1i21 = sin(z-pih+p) * cos(z-p) n2t1i22 = sin(z-pih+p) * sin(z-p) - t1t2i11 = cos(z-p) * cos(z+p) - t1t2i12 = cos(z-p) * sin(z+p) - t1t2i21 = sin(z-p) * cos(z+p) - t1t2i22 = sin(z-p) * sin(z+p) - t2t1i11 = cos(z+p) * cos(z-p) - t2t1i12 = cos(z+p) * sin(z-p) - t2t1i21 = sin(z+p) * cos(z-p) - t2t1i22 = sin(z+p) * sin(z-p) +! t1t2i11 = cos(z-p) * cos(z+p) +! t1t2i12 = cos(z-p) * sin(z+p) +! t1t2i21 = sin(z-p) * cos(z+p) +! t1t2i22 = sin(z-p) * sin(z+p) +! t2t1i11 = cos(z+p) * cos(z-p) +! t2t1i12 = cos(z+p) * sin(z-p) +! t2t1i21 = sin(z+p) * cos(z-p) +! t2t1i22 = sin(z+p) * sin(z-p) d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) d12 = cos(y)*cos(y)*tan(y)*(-cos(x)+sin(x)) d22 = cos(y)*cos(y)*(sin(x)+cos(x)*tan(y)*tan(y)) IIn1t2 = n1t2i11 * d11 + (n1t2i12 + n1t2i21) * d12 + n1t2i22 * d22 IIn2t1 = n2t1i11 * d11 + (n2t1i12 + n2t1i21) * d12 + n2t1i22 * d22 - IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 +! IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 if (-IIn1t2>=puny) then Hen1t2 = c1 @@ -853,10 +851,11 @@ FUNCTION s22kr(x,y,z,phi) real (kind=dbl_kind) :: & n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & - t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & +! t1t2i11, t1t2i12, t1t2i21, t1t2i22, & +! t2t1i11, t2t1i12, t2t1i21, t2t1i22, & d11, d12, d22, & - IIn1t2, IIn2t1, IIt1t2, & + IIn1t2, IIn2t1, & +! IIt1t2, & Hen1t2, Hen2t1, & pih, puny @@ -875,20 +874,20 @@ FUNCTION s22kr(x,y,z,phi) n2t1i12 = cos(z-pih+p) * sin(z-p) n2t1i21 = sin(z-pih+p) * cos(z-p) n2t1i22 = sin(z-pih+p) * sin(z-p) - t1t2i11 = cos(z-p) * cos(z+p) - t1t2i12 = cos(z-p) * sin(z+p) - t1t2i21 = sin(z-p) * cos(z+p) - t1t2i22 = sin(z-p) * sin(z+p) - t2t1i11 = cos(z+p) * cos(z-p) - t2t1i12 = cos(z+p) * sin(z-p) - t2t1i21 = sin(z+p) * cos(z-p) - t2t1i22 = sin(z+p) * sin(z-p) +! t1t2i11 = cos(z-p) * cos(z+p) +! t1t2i12 = cos(z-p) * sin(z+p) +! t1t2i21 = sin(z-p) * cos(z+p) +! t1t2i22 = sin(z-p) * sin(z+p) +! t2t1i11 = cos(z+p) * cos(z-p) +! t2t1i12 = cos(z+p) * sin(z-p) +! t2t1i21 = sin(z+p) * cos(z-p) +! t2t1i22 = sin(z+p) * sin(z-p) d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) d12 = cos(y)*cos(y)*tan(y)*(-cos(x)+sin(x)) d22 = cos(y)*cos(y)*(sin(x)+cos(x)*tan(y)*tan(y)) IIn1t2 = n1t2i11 * d11 + (n1t2i12 + n1t2i21) * d12 + n1t2i22 * d22 IIn2t1 = n2t1i11 * d11 + (n2t1i12 + n2t1i21) * d12 + n2t1i22 * d22 - IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 +! IIt1t2 = t1t2i11 * d11 + (t1t2i12 + t1t2i21) * d12 + t1t2i22 * d22 if (-IIn1t2>=puny) then Hen1t2 = c1 @@ -920,8 +919,10 @@ FUNCTION s11ks(x,y,z,phi) real (kind=dbl_kind) :: & n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & - t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & + t1t2i11, & + t1t2i12, t1t2i21, t1t2i22, & + t2t1i11, & +! t2t1i12, t2t1i21, t2t1i22, & d11, d12, d22, & IIn1t2, IIn2t1, IIt1t2, & Hen1t2, Hen2t1, & @@ -947,9 +948,9 @@ FUNCTION s11ks(x,y,z,phi) t1t2i21 = sin(z-p) * cos(z+p) t1t2i22 = sin(z-p) * sin(z+p) t2t1i11 = cos(z+p) * cos(z-p) - t2t1i12 = cos(z+p) * sin(z-p) - t2t1i21 = sin(z+p) * cos(z-p) - t2t1i22 = sin(z+p) * sin(z-p) +! t2t1i12 = cos(z+p) * sin(z-p) +! t2t1i21 = sin(z+p) * cos(z-p) +! t2t1i22 = sin(z+p) * sin(z-p) d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) d12 = cos(y)*cos(y)*tan(y)*(-cos(x)+sin(x)) d22 = cos(y)*cos(y)*(sin(x)+cos(x)*tan(y)*tan(y)) @@ -1128,7 +1129,6 @@ subroutine stress_eap (nx_block, ny_block, & cxp, cyp, & cxm, cym, & tarear, strength, & - a11, a12, & a11_1, a11_2, a11_3, a11_4, & a12_1, a12_2, a12_3, a12_4, & stressp_1, stressp_2, & @@ -1191,7 +1191,7 @@ subroutine stress_eap (nx_block, ny_block, & real (kind=dbl_kind), dimension (nx_block,ny_block), & intent(inout) :: & - a11, a12, a11_1, a11_2, a11_3, a11_4, & ! structure tensor + a11_1, a11_2, a11_3, a11_4, & ! structure tensor a12_1, a12_2, a12_3, a12_4 ! structure tensor real (kind=dbl_kind), dimension (nx_block,ny_block), & diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 index 18abfb04f..37997258c 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_dyn_evp.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Elastic-viscous-plastic sea ice dynamics model diff --git a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 index 44185ec8c..8606d242a 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_dyn_shared.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Elastic-viscous-plastic sea ice dynamics model code shared with other @@ -88,12 +87,12 @@ subroutine init_evp (dt) use ice_constants, only: c0, c2, omega use ice_domain, only: nblocks use ice_domain_size, only: max_blocks - use ice_flux, only: rdg_conv, rdg_shear, iceumask, fm, & + use ice_flux, only: rdg_conv, rdg_shear, iceumask, & stressp_1, stressp_2, stressp_3, stressp_4, & stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 use ice_state, only: uvel, vvel, divu, shear - use ice_grid, only: ULAT, ULON + use ice_grid, only: ULAT real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -169,10 +168,10 @@ end subroutine init_evp subroutine set_evp_parameters (dt) use ice_communicate, only: my_task, master_task - use ice_constants, only: p25, c1, c2, c4, p5 + use ice_constants, only: p25, c1, c2, p5 use ice_domain, only: distrb_info - use ice_global_reductions, only: global_minval, global_maxval - use ice_grid, only: dxt, dyt, tmask, tarea + use ice_global_reductions, only: global_minval + use ice_grid, only: dxt, dyt, tmask real (kind=dbl_kind), intent(in) :: & dt ! time step diff --git a/cicecore/cicedynB/dynamics/ice_transport_driver.F90 b/cicecore/cicedynB/dynamics/ice_transport_driver.F90 index efe6e5c19..6d816db11 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_driver.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_driver.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_transport_driver.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Drivers for remapping and upwind ice transport diff --git a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 index bafaece16..34c2bfefe 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_transport_remap.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Transports quantities using the second-order conservative remapping diff --git a/cicecore/cicedynB/general/ice_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index 15324491c..de04324f8 100644 --- a/cicecore/cicedynB/general/ice_flux.F90 +++ b/cicecore/cicedynB/general/ice_flux.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_flux.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Flux variable declarations; these include fields sent from the coupler diff --git a/cicecore/cicedynB/general/ice_flux_bgc.F90 b/cicecore/cicedynB/general/ice_flux_bgc.F90 index 3bce3d9aa..8aedb30bb 100644 --- a/cicecore/cicedynB/general/ice_flux_bgc.F90 +++ b/cicecore/cicedynB/general/ice_flux_bgc.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: $ !======================================================================= ! Flux variable declarations for biogeochemistry diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 78417d2ef..e545bcc00 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_forcing.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Reads and interpolates forcing data for atmosphere and ocean quantities. diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index 10c978eae..2609905d2 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_forcing.F90 973 2015-04-15 21:07:21Z akt $ !======================================================================= ! ! Reads and interpolates forcing data for biogeochemistry diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index be8c76d15..1d6c0dfc4 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_init.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! parameter and variable initializations diff --git a/cicecore/cicedynB/general/ice_state.F90 b/cicecore/cicedynB/general/ice_state.F90 index 295299c31..ebc93906a 100644 --- a/cicecore/cicedynB/general/ice_state.F90 +++ b/cicecore/cicedynB/general/ice_state.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_state.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Primary state variables in various configurations @@ -37,11 +36,8 @@ module ice_state use ice_kinds_mod - use ice_domain_size, only: max_blocks, ncat, max_ntrcr, n_aero + use ice_domain_size, only: max_blocks, ncat, max_ntrcr use ice_blocks, only: nx_block, ny_block - use ice_fileunits, only: nu_diag - use ice_exit, only: abort_ice - use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted implicit none private diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index 406789975..12c9510f5 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_step_mod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Contains CICE component driver routines common to all drivers. diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 index 3153f4c29..05933ffbe 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_boundary.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_boundary @@ -21,7 +20,6 @@ module ice_boundary field_loc_center, field_loc_NEcorner, & field_loc_Nface, field_loc_Eface use ice_global_reductions, only: global_maxval - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -194,7 +192,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & logical (log_kind) :: & resize, &! flag for resizing buffers - tripoleFlag, &! flag for allocating tripole buffers tripoleBlock, &! flag for identifying north tripole blocks tripoleTFlag ! flag for processing tripole buffer as T-fold @@ -223,7 +220,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & tripoleRows = nghost+1 if (nsBoundaryType == 'tripole' .or. nsBoundaryType == 'tripoleT') then - tripoleFlag = .true. tripoleTFlag = (nsBoundaryType == 'tripoleT') if (tripoleTflag) tripoleRows = tripoleRows+1 @@ -243,7 +239,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & endif else - tripoleFlag = .false. tripoleTFlag = .false. endif halo%tripoleTFlag = tripoleTFlag @@ -5175,7 +5170,7 @@ subroutine ice_HaloUpdate_stress(array1, array2, halo, & ! local variables integer (int_kind) :: & - i,j,n,nmsg, &! dummy loop indices + n,nmsg, &! dummy loop indices ierr, &! error or status flag for MPI,alloc nxGlobal, &! global domain size in x (tripole) iSrc,jSrc, &! source addresses for message @@ -5194,8 +5189,7 @@ subroutine ice_HaloUpdate_stress(array1, array2, halo, & rcvStatus ! MPI status flags real (dbl_kind) :: & - fill, &! value to use for unknown points - x1,x2,xavg ! scalars for enforcing symmetry at U pts + fill ! value to use for unknown points integer (int_kind) :: len ! length of messages @@ -5554,7 +5548,6 @@ subroutine ice_HaloMsgCreate(halo, srcBlock, srcProc, srcLocalID, & integer (int_kind) :: & msgIndx, &! message counter and index into msg array - blockIndx, &! block counter and index into msg array bufSize, &! size of message buffer ibSrc, ieSrc, jbSrc, jeSrc, &! phys domain info for source block ibDst, ieDst, jbDst, jeDst, &! phys domain info for dest block @@ -6783,6 +6776,11 @@ subroutine ice_HaloDestroy(halo) deallocate(halo%sendAddr, stat=istat) deallocate(halo%recvAddr, stat=istat) + if (istat > 0) then + call abort_ice( & + 'ice_HaloDestroy: error deallocating') + return + endif end subroutine ice_HaloDestroy !*********************************************************************** diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_broadcast.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_broadcast.F90 index 97d659659..e6fd34484 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_broadcast.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_broadcast.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_broadcast.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_broadcast @@ -11,7 +10,6 @@ module ice_broadcast use ice_kinds_mod use ice_communicate, only: mpiR8, mpir4, MPI_COMM_ICE - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 index d64e93658..ad02cb771 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_communicate.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_communicate.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_communicate @@ -10,7 +9,6 @@ module ice_communicate ! Oct. 2004: Adapted from POP version by William H. Lipscomb, LANL use ice_kinds_mod - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_exit.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_exit.F90 index 330602e91..c53d16901 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_exit.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_exit.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_exit.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Exit the model. diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 index b8758c06f..879b41037 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_gather_scatter.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_gather_scatter @@ -26,7 +25,6 @@ module ice_gather_scatter nblocks_x, nblocks_y, nghost use ice_distribution, only: distrb use ice_domain_size, only: nx_global, ny_global - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_global_reductions.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_global_reductions.F90 index d7c28e9e9..27426b8ae 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_global_reductions.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_global_reductions.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_global_reductions.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_global_reductions @@ -13,10 +12,13 @@ module ice_global_reductions ! and global_sum_prod_dbl by T Craig NCAR use ice_kinds_mod - use ice_blocks, only: block, get_block, nblocks_tot, nx_block, ny_block + use ice_blocks, only: block, get_block, nx_block, ny_block +#ifdef REPRODUCIBLE + use ice_blocks, only: nblocks_tot +#endif use ice_communicate, only: my_task, mpiR8, mpiR4, master_task use ice_constants, only: field_loc_Nface, field_loc_NEcorner - use ice_fileunits, only: bfbflag, nu_diag + use ice_fileunits, only: bfbflag use ice_exit, only: abort_ice use ice_distribution, only: distrb, ice_distributionGet, & ice_distributionGetBlockID diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_timers.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_timers.F90 index c02172fed..11039ab55 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_timers.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_timers.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_timers.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_timers diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 index ff8685763..3a54aecb8 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_boundary.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_boundary @@ -21,7 +20,6 @@ module ice_boundary field_loc_center, field_loc_NEcorner, & field_loc_Nface, field_loc_Eface use ice_global_reductions, only: global_maxval - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -148,7 +146,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & sendCount, recvCount ! count number of words to each proc logical (log_kind) :: & - tripoleFlag, &! flag for allocating tripole buffers tripoleBlock, &! flag for identifying north tripole blocks tripoleTFlag ! flag for processing tripole buffer as T-fold @@ -176,7 +173,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & tripoleRows = nghost+1 if (nsBoundaryType == 'tripole' .or. nsBoundaryType == 'tripoleT') then - tripoleFlag = .true. tripoleTFlag = (nsBoundaryType == 'tripoleT') if (tripoleTflag) tripoleRows = tripoleRows+1 northMsgSize = tripoleRows*blockSizeX @@ -197,7 +193,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & endif else - tripoleFlag = .false. tripoleTFlag = .false. northMsgSize = nghost*blockSizeX endif diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_broadcast.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_broadcast.F90 index 03d295f1d..797610ef6 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_broadcast.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_broadcast.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_broadcast.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_broadcast @@ -12,7 +11,6 @@ module ice_broadcast ! Oct. 2004: Adapted from POP version by William H. Lipscomb, LANL use ice_kinds_mod - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_communicate.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_communicate.F90 index e4837d61b..86fb3a015 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_communicate.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_communicate.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_communicate.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_communicate @@ -11,7 +10,6 @@ module ice_communicate ! Oct. 2004: Adapted from POP version by William H. Lipscomb, LANL use ice_kinds_mod - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_exit.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_exit.F90 index 3abc6fd13..a79170863 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_exit.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_exit.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_exit.F90 700 2013-08-15 19:17:39Z eclare $ !======================================================================= ! ! Exit the model. diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_gather_scatter.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_gather_scatter.F90 index c6e09d190..ca7ddaba5 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_gather_scatter.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_gather_scatter.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_gather_scatter.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_gather_scatter @@ -19,7 +18,6 @@ module ice_gather_scatter nblocks_x, nblocks_y, nblocks_tot use ice_distribution, only: distrb use ice_domain_size, only: nx_global, ny_global - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_global_reductions.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_global_reductions.F90 index 298e3321b..cc86a95ac 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_global_reductions.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_global_reductions.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_global_reductions.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_global_reductions @@ -16,7 +15,6 @@ module ice_global_reductions use ice_distribution, only: distrb, ice_distributionGet, & ice_distributionGetBlockID use ice_domain_size, only: nx_global - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_timers.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_timers.F90 index e32ceb41e..93f268ad2 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_timers.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_timers.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_timers.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_timers diff --git a/cicecore/cicedynB/infrastructure/ice_blocks.F90 b/cicecore/cicedynB/infrastructure/ice_blocks.F90 index 5070b5f17..2b654d278 100644 --- a/cicecore/cicedynB/infrastructure/ice_blocks.F90 +++ b/cicecore/cicedynB/infrastructure/ice_blocks.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_blocks.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_blocks diff --git a/cicecore/cicedynB/infrastructure/ice_domain.F90 b/cicecore/cicedynB/infrastructure/ice_domain.F90 index 7be2d19f4..8bd7c2d18 100644 --- a/cicecore/cicedynB/infrastructure/ice_domain.F90 +++ b/cicecore/cicedynB/infrastructure/ice_domain.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_domain.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_domain @@ -14,7 +13,7 @@ module ice_domain ! and not used anyhow). use ice_kinds_mod - use ice_constants, only: shlat, nhlat, c180 + use ice_constants, only: shlat, nhlat use ice_communicate, only: my_task, master_task, get_num_procs use ice_broadcast, only: broadcast_scalar use ice_blocks, only: block, get_block, create_blocks, nghost, & @@ -37,7 +36,7 @@ module ice_domain nblocks ! actual number of blocks on this processor integer (int_kind), dimension(:), pointer, public :: & - blocks_ice ! block ids for local blocks + blocks_ice => null() ! block ids for local blocks type (distrb), public :: & distrb_info ! block distribution info @@ -382,7 +381,7 @@ subroutine init_domain_distribution(KMTG,ULATG) !---------------------------------------------------------------------- if (distribution_wght == 'latitude') then - flat = NINT(abs(ULATG*rad_to_deg), int_kind) + 1 ! linear function + flat = NINT(abs(ULATG*rad_to_deg), kind=int_kind) + 1 ! linear function else flat = 1 endif diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 72f875c68..058b551fc 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_grid.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Spatial grids, masks, and boundary conditions @@ -142,7 +141,6 @@ subroutine init_grid1 use ice_blocks, only: nx_block, ny_block use ice_broadcast, only: broadcast_array use ice_constants, only: c1 - use ice_domain_size, only: max_blocks integer (kind=int_kind) :: & fid_grid, & ! file id for netCDF grid file @@ -289,9 +287,11 @@ subroutine init_grid2 else call popgrid ! read POP grid lengths directly endif +#ifdef CESMCOUPLED elseif (trim(grid_type) == 'latlon') then call latlongrid ! lat lon grid for sequential CESM (CAM mode) return +#endif elseif (trim(grid_type) == 'cpom_grid') then call cpomgrid ! cpom model orca1 type grid else @@ -635,7 +635,7 @@ subroutine popgrid_nc #ifdef ncdf use ice_blocks, only: nx_block, ny_block - use ice_constants, only: c0, c1, p5, p25, & + use ice_constants, only: c0, c1, & field_loc_center, field_loc_NEcorner, & field_type_scalar, field_type_angle use ice_domain_size, only: max_blocks @@ -756,6 +756,7 @@ subroutine popgrid_nc #endif end subroutine popgrid_nc +#ifdef CESMCOUPLED !======================================================================= ! Read in kmt file that matches CAM lat-lon grid and has single column @@ -768,9 +769,7 @@ subroutine latlongrid #ifdef ncdf ! use ice_boundary use ice_domain_size -#ifdef CESMCOUPLED use ice_scam, only : scmlat, scmlon, single_column -#endif use ice_constants, only: c0, c1, p5, p25, & field_loc_center, field_type_scalar, radius use netcdf @@ -821,7 +820,6 @@ subroutine latlongrid ! - Read in lon/lat centers in degrees from kmt file ! - Read in ocean from "kmt" file (1 for ocean, 0 for land) !----------------------------------------------------------------- -#ifdef CESMCOUPLED call icepack_query_parameters(pi_out=pi) call icepack_warnings_flush(nu_diag) @@ -1028,10 +1026,10 @@ subroutine latlongrid !$OMP END PARALLEL DO call makemask -#endif #endif end subroutine latlongrid +#endif !======================================================================= @@ -1044,7 +1042,6 @@ subroutine rectgrid use ice_blocks, only: nx_block, ny_block use ice_constants, only: c0, c1, c2, radius, cm_to_m, & field_loc_center, field_loc_NEcorner, field_type_scalar - use ice_domain_size, only: max_blocks integer (kind=int_kind) :: & i, j, iblk, & @@ -1319,11 +1316,9 @@ end subroutine cpomgrid subroutine primary_grid_lengths_HTN(work_g) - use ice_blocks, only: nx_block, ny_block use ice_constants, only: p5, c2, cm_to_m, & field_loc_center, field_loc_NEcorner, & field_loc_Nface, field_type_scalar - use ice_domain_size, only: max_blocks real (kind=dbl_kind), dimension(:,:) :: work_g ! global array holding HTN @@ -1389,11 +1384,9 @@ end subroutine primary_grid_lengths_HTN subroutine primary_grid_lengths_HTE(work_g) - use ice_blocks, only: nx_block, ny_block use ice_constants, only: p5, c2, cm_to_m, & field_loc_center, field_loc_NEcorner, & field_loc_Eface, field_type_scalar - use ice_domain_size, only: max_blocks real (kind=dbl_kind), dimension(:,:) :: work_g ! global array holding HTE @@ -2255,17 +2248,12 @@ end subroutine get_bathymetry subroutine read_basalstress_bathy ! use module - use ice_blocks, only: block, get_block, nx_block, ny_block - use ice_domain, only: nblocks, blocks_ice, halo_info, maskhalo_dyn - use ice_domain_size, only: max_blocks use ice_read_write use ice_communicate, only: my_task, master_task use ice_constants, only: field_loc_center, field_type_scalar ! local variables integer (kind=int_kind) :: & - i, j, & ! index inside block - iblk, & ! block index fid_init ! file id for netCDF init file character (char_len_long) :: & ! input data file names @@ -2281,7 +2269,7 @@ subroutine read_basalstress_bathy write (nu_diag,*) ' ' write (nu_diag,*) 'Initial ice file: ', trim(init_file) write (*,*) 'Initial ice file: ', trim(init_file) - call flush(nu_diag) +! call flush(nu_diag) endif @@ -2292,7 +2280,7 @@ subroutine read_basalstress_bathy if (my_task == master_task) then write(nu_diag,*) 'reading ',TRIM(fieldname) write(*,*) 'reading ',TRIM(fieldname) - call flush(nu_diag) +! call flush(nu_diag) endif call ice_read_nc(fid_init,1,fieldname,bathymetry,diag, & field_loc=field_loc_center, & @@ -2302,7 +2290,7 @@ subroutine read_basalstress_bathy if (my_task == master_task) then write(nu_diag,*) 'closing file ',TRIM(init_file) - call flush(nu_diag) +! call flush(nu_diag) endif end subroutine read_basalstress_bathy diff --git a/cicecore/cicedynB/infrastructure/ice_read_write.F90 b/cicecore/cicedynB/infrastructure/ice_read_write.F90 index ac0ca5f73..c58ad4a38 100644 --- a/cicecore/cicedynB/infrastructure/ice_read_write.F90 +++ b/cicecore/cicedynB/infrastructure/ice_read_write.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_read_write.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Routines for opening, reading and writing external files @@ -550,7 +549,6 @@ end subroutine ice_read_global ! (subroutine ice_HaloUpdate need not be called). subroutine ice_read_ext(nu, nrec, work, atype, diag, & - field_loc, field_type, & ignore_eof, hit_eof) use ice_gather_scatter, only: scatter_global_ext @@ -570,10 +568,6 @@ subroutine ice_read_ext(nu, nrec, work, atype, diag, & logical (kind=log_kind), intent(in) :: & diag ! if true, write diagnostic output - integer (kind=int_kind), optional, intent(in) :: & - field_loc, & ! location of field on staggered grid - field_type ! type of field (scalar, vector, angle) - logical (kind=log_kind), optional, intent(in) :: ignore_eof logical (kind=log_kind), optional, intent(out) :: hit_eof @@ -1061,16 +1055,16 @@ subroutine ice_read_nc_xy(fid, nrec, varname, work, diag, & ! netCDF file diagnostics: integer (kind=int_kind) :: & varid , & ! variable id - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index - dimlen ! size of dimension + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! dimension size real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:), allocatable :: & work_g1 @@ -1232,18 +1226,18 @@ subroutine ice_read_nc_xyz(fid, nrec, varname, work, diag, & #ifdef ncdf ! netCDF file diagnostics: integer (kind=int_kind) :: & - varid , & ! variable id - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index n, & ! ncat index - dimlen ! size of dimension + varid , & ! variable id + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! size of dimension real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:,:), allocatable :: & work_g1 @@ -1378,8 +1372,8 @@ end subroutine ice_read_nc_xyz ! Read a netCDF file ! Adapted by Alison McLaren, Met Office from ice_read - subroutine ice_read_nc_point(fid, nrec, varname, work, diag, & - field_loc, field_type) + subroutine ice_read_nc_point(fid, nrec, varname, work, diag, & + field_loc, field_type) integer (kind=int_kind), intent(in) :: & fid , & ! file id @@ -1391,14 +1385,14 @@ subroutine ice_read_nc_point(fid, nrec, varname, work, diag, & character (char_len), intent(in) :: & varname ! field name in netcdf file - real (kind=dbl_kind), & - intent(out) :: & - work ! output variable (real, 8-byte) - integer (kind=int_kind), optional, intent(in) :: & field_loc, & ! location of field on staggered grid field_type ! type of field (scalar, vector, angle) + real (kind=dbl_kind), & + intent(out) :: & + work ! output variable (real, 8-byte) + ! local variables #ifdef ncdf @@ -1471,7 +1465,7 @@ end subroutine ice_read_nc_point ! Adapted by Nicole Jeffery, LANL subroutine ice_read_nc_z(fid, nrec, varname, work, diag, & - field_loc, field_type) + field_loc, field_type) use ice_domain_size, only: nilyr @@ -1485,14 +1479,14 @@ subroutine ice_read_nc_z(fid, nrec, varname, work, diag, & character (char_len), intent(in) :: & varname ! field name in netcdf file - real (kind=dbl_kind), dimension(nilyr), & - intent(out) :: & - work ! output array (real, 8-byte) - integer (kind=int_kind), optional, intent(in) :: & field_loc, & ! location of field on staggered grid field_type ! type of field (scalar, vector, angle) + real (kind=dbl_kind), dimension(nilyr), & + intent(out) :: & + work ! output array (real, 8-byte) + ! local variables real (kind=dbl_kind), dimension(:), allocatable :: & @@ -1590,16 +1584,16 @@ subroutine ice_write_nc_xy(fid, nrec, varid, work, diag, & #ifdef ncdf ! netCDF file diagnostics: integer (kind=int_kind) :: & - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index - dimlen ! size of dimension + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! size of dimension real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:), allocatable :: & work_g1 @@ -1698,17 +1692,17 @@ subroutine ice_write_nc_xyz(fid, nrec, varid, work, diag, & #ifdef ncdf ! netCDF file diagnostics: integer (kind=int_kind) :: & - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index n, & ! ncat index - dimlen ! size of dimension + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! size of dimension real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:,:), allocatable :: & work_g1 @@ -1817,16 +1811,16 @@ subroutine ice_read_global_nc (fid, nrec, varname, work_g, diag) ! netCDF file diagnostics: integer (kind=int_kind) :: & varid, & ! netcdf id for field - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index - dimlen ! size of dimension + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! size of dimension real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name ! #ifdef ORCA_GRID real (kind=dbl_kind), dimension(:,:), allocatable :: & @@ -1966,16 +1960,16 @@ subroutine ice_read_nc_uv(fid, nrec, nzlev, varname, work, diag, & ! netCDF file diagnostics: integer (kind=int_kind) :: & varid , & ! variable id - status, & ! status output from netcdf routines - ndim, nvar, & ! sizes of netcdf file - id, & ! dimension index - dimlen ! size of dimension + status ! status output from netcdf routines +! ndim, nvar, & ! sizes of netcdf file +! id, & ! dimension index +! dimlen ! size of dimension real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array - character (char_len) :: & - dimname ! dimension name +! character (char_len) :: & +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:), allocatable :: & work_g1 diff --git a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 index 903e325a2..7d614e6c3 100644 --- a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_restart_driver.F90 607 2013-03-29 15:49:42Z eclare $ !======================================================================= ! Read and write ice model restart files diff --git a/cicecore/cicedynB/infrastructure/ice_restoring.F90 b/cicecore/cicedynB/infrastructure/ice_restoring.F90 index 5b22e49fe..4989a4966 100644 --- a/cicecore/cicedynB/infrastructure/ice_restoring.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restoring.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_restoring.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Reads and interpolates forcing data for atmosphere and ocean quantities. diff --git a/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 index 863d7314c..c3b0ca820 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_write.F90 567 2013-01-07 02:57:36Z eclare $ !======================================================================= ! ! Writes history in binary format diff --git a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 index 9e62ecb18..71e3dbada 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_restart.F90 806 2014-07-31 19:00:00Z tcraig $ !======================================================================= ! Read and write ice model restart files using netCDF or binary diff --git a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 index 899302b6f..95be0e6f3 100644 --- a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_write.F90 567 2013-01-07 02:57:36Z eclare $ !======================================================================= ! ! Writes history in netCDF format diff --git a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 index 98b383b28..8dd4de296 100644 --- a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_restart.F90 607 2013-03-29 15:49:42Z eclare $ !======================================================================= ! Read and write ice model restart files using netCDF or binary @@ -11,8 +10,8 @@ module ice_restart use ice_kinds_mod use netcdf use ice_restart_shared, only: & - restart, restart_ext, restart_dir, restart_file, pointer_file, & - runid, runtype, use_restart_time, restart_format, lcdf64, lenstr + restart_ext, restart_dir, restart_file, pointer_file, & + runid, use_restart_time, lcdf64, lenstr use ice_fileunits, only: nu_diag, nu_rst_pointer use ice_exit, only: abort_ice use icepack_intfc, only: icepack_query_parameters @@ -39,9 +38,8 @@ module ice_restart subroutine init_restart_read(ice_ic) use ice_calendar, only: sec, month, mday, nyr, istep0, istep1, & - time, time_forc, year_init, npt + time, time_forc, npt use ice_communicate, only: my_task, master_task - use ice_domain, only: nblocks character(len=char_len_long), intent(in), optional :: ice_ic @@ -135,7 +133,7 @@ subroutine init_restart_write(filename_spec) integer (kind=int_kind) :: & k, n, & ! index nx, ny, & ! global array size - iyear, imonth, iday, & ! year, month, day + iyear, & ! year nbtrcr character(len=char_len_long) :: filename @@ -174,8 +172,6 @@ subroutine init_restart_write(filename_spec) filename = trim(filename_spec) else iyear = nyr + year_init - 1 - imonth = month - iday = mday write(filename,'(a,a,a,i4.4,a,i2.2,a,i2.2,a,i5.5)') & restart_dir(1:lenstr(restart_dir)), & @@ -617,7 +613,7 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, & use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: max_blocks, ncat - use ice_read_write, only: ice_read, ice_read_nc + use ice_read_write, only: ice_read_nc integer (kind=int_kind), intent(in) :: & nu , & ! unit number (not used for netcdf) @@ -700,7 +696,7 @@ subroutine write_restart_field(nu,nrec,work,atype,vname,ndim3,diag) use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: max_blocks, ncat - use ice_read_write, only: ice_write, ice_write_nc + use ice_read_write, only: ice_write_nc integer (kind=int_kind), intent(in) :: & nu , & ! unit number @@ -723,7 +719,6 @@ subroutine write_restart_field(nu,nrec,work,atype,vname,ndim3,diag) ! local variables integer (kind=int_kind) :: & - n, & ! dimension counter varid, & ! variable id status ! status variable from netCDF routine diff --git a/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 index 5c2e8b7d0..2aa48a2da 100644 --- a/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_history_write.F90 567 2013-01-07 02:57:36Z eclare $ !======================================================================= ! ! Writes history in netCDF format diff --git a/cicecore/cicedynB/infrastructure/io/io_pio/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_pio/ice_restart.F90 index 8f25435bf..41657e2c5 100644 --- a/cicecore/cicedynB/infrastructure/io/io_pio/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_pio/ice_restart.F90 @@ -1,5 +1,3 @@ - -! SVN:$Id: ice_restart.F90 607 2013-03-29 15:49:42Z eclare $ !======================================================================= ! ! Read and write ice model restart files using pio interfaces. diff --git a/cicecore/drivers/cesm/CICE_FinalMod.F90 b/cicecore/drivers/cesm/CICE_FinalMod.F90 index 69479c1b1..3fbeade3f 100644 --- a/cicecore/drivers/cesm/CICE_FinalMod.F90 +++ b/cicecore/drivers/cesm/CICE_FinalMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_FinalMod.F90 744 2013-09-27 22:53:24Z eclare $ !======================================================================= ! ! This module contains routines for the final exit of the CICE model, diff --git a/cicecore/drivers/cesm/CICE_InitMod.F90 b/cicecore/drivers/cesm/CICE_InitMod.F90 index 6fda919d2..ce3344cea 100644 --- a/cicecore/drivers/cesm/CICE_InitMod.F90 +++ b/cicecore/drivers/cesm/CICE_InitMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_InitMod.F90 960 2015-04-01 23:11:41Z eclare $ !======================================================================= ! ! This module contains the CICE initialization routine that sets model diff --git a/cicecore/drivers/cesm/CICE_RunMod.F90 b/cicecore/drivers/cesm/CICE_RunMod.F90 index 46f36cb8d..303acacd4 100644 --- a/cicecore/drivers/cesm/CICE_RunMod.F90 +++ b/cicecore/drivers/cesm/CICE_RunMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_RunMod.F90 960 2015-04-01 23:11:41Z eclare $ !======================================================================= ! ! Main driver for time stepping of CICE. diff --git a/cicecore/drivers/cesm/CICE_RunMod.F90_debug b/cicecore/drivers/cesm/CICE_RunMod.F90_debug index f7fd521aa..c055a8cf5 100644 --- a/cicecore/drivers/cesm/CICE_RunMod.F90_debug +++ b/cicecore/drivers/cesm/CICE_RunMod.F90_debug @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_RunMod.F90 960 2015-04-01 23:11:41Z eclare $ !======================================================================= ! ! Main driver for time stepping of CICE. diff --git a/cicecore/drivers/cesm/ice_prescribed_mod.F90 b/cicecore/drivers/cesm/ice_prescribed_mod.F90 index 3e16abf79..31a19218e 100644 --- a/cicecore/drivers/cesm/ice_prescribed_mod.F90 +++ b/cicecore/drivers/cesm/ice_prescribed_mod.F90 @@ -12,7 +12,6 @@ ! Regridding and data cycling capabilities are included. ! ! !REVISION HISTORY: -! SVN:$Id: ice_prescribed_mod.F90 40 2006-12-01 19:09:30Z eclare $ ! ! 2010-May-15 - Tony Craig and Mariana Vertenstein - updated to latest streams ! 2006-Aug-22 - D. Bailey, E. Hunke, modified to fit with CICE diff --git a/cicecore/drivers/cice/CICE.F90 b/cicecore/drivers/cice/CICE.F90 index 5e8a1f197..4f22c7f9c 100644 --- a/cicecore/drivers/cice/CICE.F90 +++ b/cicecore/drivers/cice/CICE.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE.F90 1229 2017-05-24 02:22:58Z eclare $ !======================================================================= ! Copyright (c) 2017, Los Alamos National Security, LLC ! All rights reserved. diff --git a/cicecore/drivers/cice/CICE_FinalMod.F90 b/cicecore/drivers/cice/CICE_FinalMod.F90 index ec95efbd1..7815b1b9b 100644 --- a/cicecore/drivers/cice/CICE_FinalMod.F90 +++ b/cicecore/drivers/cice/CICE_FinalMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_FinalMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains routines for the final exit of the CICE model, diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 21e6b556b..467cbc384 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_InitMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains the CICE initialization routine that sets model diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index bdc8061a8..b2e95c234 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_RunMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Main driver for time stepping of CICE. diff --git a/cicecore/drivers/cice/CICE_RunMod.F90_debug b/cicecore/drivers/cice/CICE_RunMod.F90_debug index 0a965efe3..e55cc3412 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90_debug +++ b/cicecore/drivers/cice/CICE_RunMod.F90_debug @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_RunMod.F90 746 2013-09-28 22:47:56Z eclare $ !======================================================================= ! ! Main driver for time stepping of CICE. diff --git a/cicecore/drivers/hadgem3/CICE.F90 b/cicecore/drivers/hadgem3/CICE.F90 index 00112c784..1cad5bcfa 100644 --- a/cicecore/drivers/hadgem3/CICE.F90 +++ b/cicecore/drivers/hadgem3/CICE.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE.F90 1229 2017-05-24 02:22:58Z eclare $ !======================================================================= ! Copyright (c) 2017, Los Alamos National Security, LLC ! All rights reserved. diff --git a/cicecore/drivers/hadgem3/CICE_FinalMod.F90 b/cicecore/drivers/hadgem3/CICE_FinalMod.F90 index facec4498..6b5a53abe 100644 --- a/cicecore/drivers/hadgem3/CICE_FinalMod.F90 +++ b/cicecore/drivers/hadgem3/CICE_FinalMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_FinalMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains routines for the final exit of the CICE model, diff --git a/cicecore/drivers/hadgem3/CICE_InitMod.F90 b/cicecore/drivers/hadgem3/CICE_InitMod.F90 index 0fac20d71..ab25f3f3d 100644 --- a/cicecore/drivers/hadgem3/CICE_InitMod.F90 +++ b/cicecore/drivers/hadgem3/CICE_InitMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_InitMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains the CICE initialization routine that sets model diff --git a/cicecore/drivers/hadgem3/CICE_RunMod.F90 b/cicecore/drivers/hadgem3/CICE_RunMod.F90 index 117236a51..994417bd6 100644 --- a/cicecore/drivers/hadgem3/CICE_RunMod.F90 +++ b/cicecore/drivers/hadgem3/CICE_RunMod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: CICE_RunMod.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! Main driver for time stepping of CICE. diff --git a/cicecore/shared/constants/cesm/ice_constants.F90 b/cicecore/shared/constants/cesm/ice_constants.F90 index 1d029d0db..7f7b9f440 100644 --- a/cicecore/shared/constants/cesm/ice_constants.F90 +++ b/cicecore/shared/constants/cesm/ice_constants.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_constants.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module defines a variety of physical and numerical constants diff --git a/cicecore/shared/constants/cice/ice_constants.F90 b/cicecore/shared/constants/cice/ice_constants.F90 index faf5b217a..d9959f634 100644 --- a/cicecore/shared/constants/cice/ice_constants.F90 +++ b/cicecore/shared/constants/cice/ice_constants.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_constants.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module defines a variety of physical and numerical constants diff --git a/cicecore/shared/constants/hadgem3/ice_constants.F90 b/cicecore/shared/constants/hadgem3/ice_constants.F90 index cd29394a7..9a632c2a0 100644 --- a/cicecore/shared/constants/hadgem3/ice_constants.F90 +++ b/cicecore/shared/constants/hadgem3/ice_constants.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_constants.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module defines a variety of physical and numerical constants diff --git a/cicecore/shared/ice_arrays_column.F90 b/cicecore/shared/ice_arrays_column.F90 index 64f5df00b..5c483d41d 100644 --- a/cicecore/shared/ice_arrays_column.F90 +++ b/cicecore/shared/ice_arrays_column.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_arrays_column.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Grid-dependent arrays needed for column package diff --git a/cicecore/shared/ice_calendar.F90 b/cicecore/shared/ice_calendar.F90 index 9e5a1c327..88e220c87 100644 --- a/cicecore/shared/ice_calendar.F90 +++ b/cicecore/shared/ice_calendar.F90 @@ -1,4 +1,3 @@ -! $Id: ice_calendar.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Calendar routines for managing time diff --git a/cicecore/shared/ice_distribution.F90 b/cicecore/shared/ice_distribution.F90 index 3b05835d1..be8366883 100644 --- a/cicecore/shared/ice_distribution.F90 +++ b/cicecore/shared/ice_distribution.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_distribution.F90 1228 2017-05-23 21:33:34Z tcraig $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_distribution @@ -359,8 +358,24 @@ subroutine ice_distributionDestroy(distribution) !---------------------------------------------------------------------- deallocate(distribution%blockLocation, stat=istat) + if (istat > 0) then + call abort_ice( & + 'ice_distributionDestroy: error deallocating blockLocation') + return + endif + deallocate(distribution%blockLocalID , stat=istat) + if (istat > 0) then + call abort_ice( & + 'ice_distributionDestroy: error deallocating blockLocalID') + return + endif deallocate(distribution%blockGlobalID, stat=istat) + if (istat > 0) then + call abort_ice( & + 'ice_distributionDestroy: error deallocating blockGlobalID') + return + endif !----------------------------------------------------------------------- @@ -586,6 +601,12 @@ function create_distrb_cart(nprocs, workPerBlock) result(newDistrb) allocate (newDistrb%blockLocation(nblocks_tot), & newDistrb%blockLocalID (nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_cart: error allocating blockLocation or blockLocalID') + return + endif + !---------------------------------------------------------------------- ! ! distribute blocks linearly across processors in each direction @@ -639,6 +660,11 @@ function create_distrb_cart(nprocs, workPerBlock) result(newDistrb) if (newDistrb%numLocalBlocks > 0) then allocate (newDistrb%blockGlobalID(newDistrb%numLocalBlocks), & stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_cart: error allocating blockGlobalID') + return + endif do j=1,nprocsY do i=1,nprocsX @@ -738,6 +764,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) if (numOcnBlocks <= 2*nprocs) then allocate(priority(nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating priority') + return + endif !*** initialize priority array @@ -753,6 +784,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do allocate(workTmp(nblocks_tot), procTmp(nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating procTmp') + return + endif workTmp(:) = 0 do i=1,nprocs @@ -768,6 +804,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) priority, dist) deallocate(workTmp, procTmp, stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error deallocating procTmp') + return + endif !---------------------------------------------------------------------- ! @@ -786,6 +827,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) !---------------------------------------------------------------------- allocate(priority(nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating priority') + return + endif !*** set highest priority such that eastern-most blocks !*** and blocks with the least amount of work are @@ -804,6 +850,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do allocate(workTmp(nprocsX), procTmp(nprocsX), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating procTmp') + return + endif do j=1,nprocsY @@ -823,6 +874,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do deallocate(workTmp, procTmp, stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error deallocating procTmp') + return + endif !---------------------------------------------------------------------- ! @@ -845,6 +901,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do allocate(workTmp(nprocsY), procTmp(nprocsY), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating procTmp') + return + endif do i=1,nprocsX @@ -865,6 +926,11 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) end do deallocate(workTmp, procTmp, priority, stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error deallocating procTmp') + return + endif endif ! 1d or 2d rake @@ -880,8 +946,18 @@ function create_distrb_rake(nprocs, workPerBlock) result(newDistrb) allocate(newDistrb%blockLocation(nblocks_tot), & newDistrb%blockLocalID(nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating blockLocation or blockLocalID') + return + endif allocate(procTmp(nprocs), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_rake: error allocating procTmp') + return + endif procTmp = 0 do n=1,nblocks_tot @@ -995,6 +1071,11 @@ function create_distrb_roundrobin(nprocs, workPerBlock) result(newDistrb) allocate (newDistrb%blockLocation(nblocks_tot), & newDistrb%blockLocalID (nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_roundrobin: error allocating blockLocation or blockLocalID') + return + endif allocate (newDistrb%blockCnt(nprocs)) @@ -1054,6 +1135,11 @@ function create_distrb_roundrobin(nprocs, workPerBlock) result(newDistrb) if (newDistrb%numLocalBlocks > 0) then allocate (newDistrb%blockGlobalID(newDistrb%numLocalBlocks), & stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_roundrobin: error allocating numLocalBlocks') + return + endif processor = my_task + 1 do localID = 1,newDistrb%numLocalBlocks @@ -1132,6 +1218,11 @@ function create_distrb_sectrobin(nprocs, workPerBlock) result(newDistrb) allocate (newDistrb%blockLocation(nblocks_tot), & newDistrb%blockLocalID (nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_sectrobin: error allocating blockLocation or blockLocalID') + return + endif allocate (newDistrb%blockCnt(nprocs)) @@ -1349,6 +1440,11 @@ function create_distrb_sectrobin(nprocs, workPerBlock) result(newDistrb) if (newDistrb%numLocalBlocks > 0) then allocate (newDistrb%blockGlobalID(newDistrb%numLocalBlocks), & stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_sectrobin: error allocating numLocalBlocks') + return + endif processor = my_task + 1 do localID = 1,newDistrb%numLocalBlocks @@ -1423,6 +1519,11 @@ function create_distrb_sectcart(nprocs, workPerBlock) result(newDistrb) allocate (newDistrb%blockLocation(nblocks_tot), & newDistrb%blockLocalID (nblocks_tot), stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_sectcart: error allocating blockLocation or blockLocalID') + return + endif allocate (newDistrb%blockCnt(nprocs)) !---------------------------------------------------------------------- @@ -1507,6 +1608,11 @@ function create_distrb_sectcart(nprocs, workPerBlock) result(newDistrb) if (newDistrb%numLocalBlocks > 0) then allocate (newDistrb%blockGlobalID(newDistrb%numLocalBlocks), & stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_sectcart: error allocating numLocalBlocks') + return + endif processor = my_task + 1 do localID = 1,newDistrb%numLocalBlocks @@ -1846,7 +1952,7 @@ subroutine ice_distributionRake (procWork, procID, blockWork, & minPriority, &! minimum priority lastLoc, &! location for most recent block meanWork, maxWork, &! mean,max work per processor - diffWork, residual, &! work differences and residual work + diffWork, &! work differences numTransfers ! counter for number of block transfers !---------------------------------------------------------------------- @@ -1862,7 +1968,7 @@ subroutine ice_distributionRake (procWork, procID, blockWork, & meanWork = sum(procWork)/nprocs + 1 maxWork = maxval(procWork) - residual = mod(meanWork,nprocs) +! residual = mod(meanWork,nprocs) minPriority = 1000000 do n=1,nprocs diff --git a/cicecore/shared/ice_domain_size.F90 b/cicecore/shared/ice_domain_size.F90 index 77d0692f1..b394194d5 100644 --- a/cicecore/shared/ice_domain_size.F90 +++ b/cicecore/shared/ice_domain_size.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_domain_size.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! Defines the global domain size and number of categories and layers. diff --git a/cicecore/shared/ice_fileunits.F90 b/cicecore/shared/ice_fileunits.F90 index 3f38b071f..a92a8403b 100644 --- a/cicecore/shared/ice_fileunits.F90 +++ b/cicecore/shared/ice_fileunits.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_fileunits.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains an I/O unit manager for tracking, assigning @@ -268,9 +267,7 @@ subroutine flush_fileunit(iunit) #ifdef CESMCOUPLED call shr_sys_flush(iunit) #else -#if (defined IRIX64 || defined CRAY || defined OSF1 || defined SUNOS || defined LINUX || defined NEC_SX | defined UNICOSMP) - call flush(iunit) -#endif + flush(iunit) #if (defined AIX) call flush_(iunit) #endif diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 9e05b7834..7279987e9 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_init_column.F90 1228 2017-05-23 21:33:34Z tcraig $ !========================================================================= ! ! Initialization routines for the column package. @@ -1850,7 +1849,7 @@ subroutine init_zbgc R_chl2N_in=R_chl2N, F_abs_chl_in=F_abs_chl, R_Fe2DON_in=R_Fe2DON, R_Fe2DOC_in=R_Fe2DOC, & mort_Tdep_in=mort_Tdep, k_exude_in=k_exude, & K_Nit_in=K_Nit, K_Am_in=K_Am, K_sil_in=K_Sil, K_Fe_in=K_Fe, & - f_don_in=f_don, kn_bac_in=k_bac, f_don_Am_in=f_don, f_exude_in=f_exude, k_bac_in=k_bac, & + f_don_in=f_don, kn_bac_in=kn_bac, f_don_Am_in=f_don_Am, f_exude_in=f_exude, k_bac_in=k_bac, & fr_resp_in=fr_resp, algal_vel_in=algal_vel, R_dFe2dust_in=R_dFe2dust, & dustFe_sol_in=dustFe_sol, T_max_in=T_max, fr_mort2min_in=fr_mort2min, fr_dFe_in=fr_dFe, & op_dep_min_in=op_dep_min, fr_graze_s_in=fr_graze_s, fr_graze_e_in=fr_graze_e, & diff --git a/cicecore/shared/ice_kinds_mod.F90 b/cicecore/shared/ice_kinds_mod.F90 index ae416be70..4124f2594 100644 --- a/cicecore/shared/ice_kinds_mod.F90 +++ b/cicecore/shared/ice_kinds_mod.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_kinds_mod.F90 1226 2017-05-22 22:45:03Z tcraig $ !======================================================================= ! Defines variable precision for all common data types diff --git a/cicecore/shared/ice_restart_column.F90 b/cicecore/shared/ice_restart_column.F90 index 3021999b9..8a52475e9 100644 --- a/cicecore/shared/ice_restart_column.F90 +++ b/cicecore/shared/ice_restart_column.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_restart_column.F90 1228 2017-05-23 21:33:34Z tcraig $ !========================================================================= ! ! Restart routines for the column package. diff --git a/cicecore/shared/ice_restart_shared.F90 b/cicecore/shared/ice_restart_shared.F90 index 1d0ad4263..e2c7b7fee 100644 --- a/cicecore/shared/ice_restart_shared.F90 +++ b/cicecore/shared/ice_restart_shared.F90 @@ -1,12 +1,8 @@ -! SVN:$Id: ice_restart_shared.F90 607 2013-03-29 15:49:42Z eclare $ !======================================================================= module ice_restart_shared use ice_kinds_mod - use ice_fileunits, only: nu_diag - use ice_exit, only: abort_ice - use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted implicit none private diff --git a/cicecore/shared/ice_spacecurve.F90 b/cicecore/shared/ice_spacecurve.F90 index 73f93e919..c4e967706 100644 --- a/cicecore/shared/ice_spacecurve.F90 +++ b/cicecore/shared/ice_spacecurve.F90 @@ -8,7 +8,6 @@ module ice_spacecurve ! create space-filling curves. ! ! !REVISION HISTORY: -! SVN:$Id: ice_spacecurve.F90 1228 2017-05-23 21:33:34Z tcraig $ ! ! author: John Dennis, NCAR @@ -76,7 +75,7 @@ module ice_spacecurve ! !IROUTINE: Cinco ! !INTERFACE: - recursive function Cinco(l,type,ma,md,ja,jd) result(ierr) + recursive function Cinco(l,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This subroutine implements a Cinco space-filling curve. @@ -93,7 +92,6 @@ recursive function Cinco(l,type,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve - type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -586,7 +584,7 @@ end function Cinco ! !IROUTINE: PeanoM ! !INTERFACE: - recursive function PeanoM(l,type,ma,md,ja,jd) result(ierr) + recursive function PeanoM(l,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This function implements a meandering Peano @@ -603,7 +601,6 @@ recursive function PeanoM(l,type,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve - type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -809,7 +806,7 @@ end function PeanoM ! !IROUTINE: Hilbert ! !INTERFACE: - recursive function Hilbert(l,type,ma,md,ja,jd) result(ierr) + recursive function Hilbert(l,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This function implements a Hilbert space-filling curve. @@ -826,7 +823,6 @@ recursive function Hilbert(l,type,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve - type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -1101,7 +1097,7 @@ function GenCurve(l,type,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve - type, & ! type of SFC curve + type, & ! type of space-filling curve to start off ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -1120,11 +1116,11 @@ function GenCurve(l,type,ma,md,ja,jd) result(ierr) !------------------------------------------------- if(type == 2) then - ierr = Hilbert(l,type,ma,md,ja,jd) + ierr = Hilbert(l,ma,md,ja,jd) elseif ( type == 3) then - ierr = PeanoM(l,type,ma,md,ja,jd) + ierr = PeanoM(l,ma,md,ja,jd) elseif ( type == 5) then - ierr = Cinco(l,type,ma,md,ja,jd) + ierr = Cinco(l,ma,md,ja,jd) endif !EOP @@ -1185,14 +1181,14 @@ subroutine MatchFactor(fac1,fac2,val,found) integer :: val integer :: val1 logical :: found - logical :: tmp +! logical :: tmp found = .false. val1 = FirstFactor(fac1) !JMD print *,'Matchfactor: found value: ',val1 found = FindandMark(fac2,val1,.true.) - tmp = FindandMark(fac1,val1,found) +! tmp = FindandMark(fac1,val1,found) if (found) then val = val1 else @@ -1425,7 +1421,7 @@ subroutine map(l) type = fact%factors(l) ierr = GenCurve(l,type,0,1,0,1) - + if (ierr .ne. 0) print *,'GenCurve ierr',ierr !EOP !----------------------------------------------------------------------- diff --git a/configuration/scripts/cice.batch.csh b/configuration/scripts/cice.batch.csh index ce2471fe5..da4902771 100755 --- a/configuration/scripts/cice.batch.csh +++ b/configuration/scripts/cice.batch.csh @@ -56,6 +56,16 @@ cat >> ${jobfile} << EOFB #PBS -l walltime=${batchtime} EOFB +else if (${ICE_MACHINE} =~ hobart*) then +cat >> ${jobfile} << EOFB +#PBS -j oe +#PBS -m ae +#PBS -V +#PBS -q short +#PBS -N ${ICE_CASENAME} +#PBS -l nodes=1:ppn=24 +EOFB + else if (${ICE_MACHINE} =~ thunder* || ${ICE_MACHINE} =~ gordon* || ${ICE_MACHINE} =~ conrad*) then set queue = "debug" if (${ICE_RUNLENGTH} > 1) set queue = "frontier" diff --git a/configuration/scripts/cice.launch.csh b/configuration/scripts/cice.launch.csh index 52e5806aa..cdd262024 100755 --- a/configuration/scripts/cice.launch.csh +++ b/configuration/scripts/cice.launch.csh @@ -17,6 +17,11 @@ cat >> ${jobfile} << EOFR mpiexec_mpt -n ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE EOFR +else if (${ICE_MACHINE} =~ hobart*) then +cat >> ${jobfile} << EOFR +mpiexec -n ${ntasks} ./cice >&! \$ICE_RUNLOG_FILE +EOFR + else if (${ICE_MACHINE} =~ thunder*) then cat >> ${jobfile} << EOFR mpiexec_mpt -np ${ntasks} omplace ./cice >&! \$ICE_RUNLOG_FILE diff --git a/configuration/scripts/machines/Macros.hobart_intel b/configuration/scripts/machines/Macros.hobart_intel new file mode 100755 index 000000000..a01582f86 --- /dev/null +++ b/configuration/scripts/machines/Macros.hobart_intel @@ -0,0 +1,65 @@ +#============================================================================== +# Makefile macros for NCAR hobart, NAG compiler +#============================================================================== + +CPP := /usr/bin/cpp +CPPFLAGS := $(CFLAGS) -lifcore +CPPDEFS := $(CPPDEFS) -DFORTRANUNDERSCORE -DCPRINTEL +CFLAGS := -qno-opt-dynamic-align -fp-model precise -std=gnu99 + +FIXEDFLAGS := -fixed -132 +FREEFLAGS := -free +FFLAGS := -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source -O2 -debug minimal +FC_AUTO_R8 := -r8 + +FFLAGS_NOOPT:= + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS := -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created +endif + +ifeq ($(ICE_COMMDIR), mpi) + FC := mpif90 +else + FC := ifort +endif + +MPICC:= mpicc + +MPIFC:= mpif90 +LD:= $(MPIFC) + +NETCDF_PATH := /usr/local/netcdf-intel-cluster + +INCLDIR := -I/usr/local/netcdf-intel-cluster/include -I/usr/mpi/intel/mvapich2-2.1-qlc/include + +LIB_NETCDF := $(NETCDF_PATH)/lib +LIB_PNETCDF := $(PNETCDF_PATH)/lib +LIB_MPI := $(IMPILIBDIR) + +SLIBS := -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L/usr/lib64 -llapack -mkl=cluster + +SCC:= icc + +SFC:= ifort + +ifeq ($(DITTO), yes) + CPPDEFS := $(CPPDEFS) -DREPRODUCIBLE +endif + +ifeq ($(IO_TYPE), netcdf) + CPPDEFS := $(CPPDEFS) -Dncdf +endif + +## if using parallel I/O, load all 3 libraries. PIO must be first! +ifeq ($(IO_TYPE), pio) + PIO_PATH:= + INCLDIR += -I + SLIBS := $(SLIB) -L$(PIO_PATH) -lpiofS + + CPPDEFS := $(CPPDEFS) -Dncdf +endif + +ifeq ($(IO_TYPE), netcdf) + CPPDEFS := $(CPPDEFS) -Dncdf +endif diff --git a/doc/source/master_list.bib b/doc/source/master_list.bib index 118234ea7..5ce71f703 100644 --- a/doc/source/master_list.bib +++ b/doc/source/master_list.bib @@ -1,6 +1,4 @@ %======================================================================= -% SVN: $Id: master_list.bib 5 2005-12-12 17:41:05Z mvr $ -%======================================================================= % **************************************** % * File: SAMPLE.BIB * % **************************************** From 38ee675d9e3f9f80eddef30c8f72e51c9142578c Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 23 Mar 2018 11:24:51 -0600 Subject: [PATCH 02/21] Dummy variable cleanup --- .../cicedynB/analysis/ice_diagnostics.F90 | 2 +- .../cicedynB/analysis/ice_diagnostics_bgc.F90 | 44 +++---- cicecore/cicedynB/analysis/ice_history.F90 | 14 +-- .../cicedynB/analysis/ice_history_bgc.F90 | 12 +- .../cicedynB/analysis/ice_history_drag.F90 | 6 +- .../cicedynB/analysis/ice_history_shared.F90 | 5 +- cicecore/cicedynB/dynamics/ice_dyn_eap.F90 | 47 ++++--- cicecore/cicedynB/dynamics/ice_dyn_evp.F90 | 11 +- .../dynamics/ice_transport_driver.F90 | 33 ++--- .../cicedynB/dynamics/ice_transport_remap.F90 | 14 +-- cicecore/cicedynB/general/ice_forcing.F90 | 116 +++--------------- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 25 ++-- cicecore/cicedynB/general/ice_init.F90 | 15 +-- cicecore/cicedynB/general/ice_step_mod.F90 | 39 ++---- cicecore/cicedynB/infrastructure/ice_grid.F90 | 5 + .../infrastructure/ice_restart_driver.F90 | 49 +++----- .../cicedynB/infrastructure/ice_restoring.F90 | 16 ++- .../io/io_netcdf/ice_history_write.F90 | 4 +- cicecore/drivers/cice/CICE.F90 | 1 - cicecore/drivers/cice/CICE_InitMod.F90 | 14 +-- cicecore/drivers/cice/CICE_RunMod.F90 | 33 ++--- cicecore/shared/ice_init_column.F90 | 98 +++++++-------- cicecore/shared/ice_restart_column.F90 | 9 +- .../scripts/machines/Macros.hobart_nag | 51 ++++++++ .../scripts/machines/env.hobart_intel | 17 +++ configuration/scripts/machines/env.hobart_nag | 17 +++ icepack | 2 +- 27 files changed, 315 insertions(+), 384 deletions(-) create mode 100755 configuration/scripts/machines/Macros.hobart_nag create mode 100755 configuration/scripts/machines/env.hobart_intel create mode 100755 configuration/scripts/machines/env.hobart_nag diff --git a/cicecore/cicedynB/analysis/ice_diagnostics.F90 b/cicecore/cicedynB/analysis/ice_diagnostics.F90 index 5c2275e48..a8a18e8ae 100644 --- a/cicecore/cicedynB/analysis/ice_diagnostics.F90 +++ b/cicecore/cicedynB/analysis/ice_diagnostics.F90 @@ -1582,7 +1582,7 @@ subroutine print_points_state(plabel,ilabel) real (kind=dbl_kind) :: & eidebug, esdebug, & - qi, qs, Tsnow, & + qi, qs, & puny integer (kind=int_kind) :: m, n, k, i, j, iblk, nt_Tsfc, nt_qice, nt_qsno diff --git a/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 b/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 index 46ceead4f..81426c507 100644 --- a/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_diagnostics_bgc.F90 @@ -13,12 +13,11 @@ module ice_diagnostics_bgc use ice_kinds_mod use ice_communicate, only: my_task, master_task use ice_constants, only: c0, mps_to_cmpdy, c100, p5, c1 - use ice_calendar, only: diagfreq, istep1, istep use ice_fileunits, only: nu_diag use ice_fileunits, only: flush_fileunit use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted - use icepack_intfc, only: icepack_max_algae, icepack_max_aero, icepack_max_dic + use icepack_intfc, only: icepack_max_algae, icepack_max_aero use icepack_intfc, only: icepack_max_doc, icepack_max_don, icepack_max_fe use icepack_intfc, only: icepack_query_parameters, icepack_query_tracer_flags use icepack_intfc, only: icepack_query_tracer_indices @@ -41,18 +40,14 @@ module ice_diagnostics_bgc ! Cecilia M. Bitz, UW ! Nicole Jeffery, LANL - subroutine hbrine_diags (dt) + subroutine hbrine_diags use ice_arrays_column, only: darcy_V use ice_broadcast, only: broadcast_scalar, broadcast_array - use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, pbloc, & - plat, plon - use ice_domain_size, only: ncat, nltrcr, nilyr + use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, pbloc + use ice_domain_size, only: nilyr use ice_state, only: aice, aicen, vicen, vice, trcr, trcrn - real (kind=dbl_kind), intent(in) :: & - dt ! time step - ! local variables integer (kind=int_kind) :: & @@ -159,25 +154,21 @@ end subroutine hbrine_diags ! authors: Elizabeth C. Hunke, LANL ! Nicole Jeffery, LANL - subroutine bgc_diags (dt) + subroutine bgc_diags use ice_arrays_column, only: ocean_bio, zfswin, fbio_atmice, fbio_snoice, & Zoo, grow_net, ice_bio_net, trcrn_sw use ice_broadcast, only: broadcast_scalar, broadcast_array use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, pbloc - use ice_domain_size, only: ncat, nltrcr, nblyr, n_algae, n_zaero, & - n_dic, n_doc, n_don, n_fed, n_fep, nilyr, nslyr + use ice_domain_size, only: ncat, nblyr, n_algae, n_zaero, & + n_doc, n_don, n_fed, n_fep, nilyr, nslyr use ice_flux_bgc, only: flux_bio, flux_bio_atm - use ice_state, only:aice, vicen, vice, trcr - use ice_timers, only: timer_bgc, ice_timer_start, ice_timer_stop - - real (kind=dbl_kind), intent(in) :: & - dt ! time step + use ice_state, only: vicen, vice, trcr ! local variables integer (kind=int_kind) :: & - i, j, k, n, nn, ii,jj, iblk,kk, klev + i, j, k, n, nn, iblk,kk, klev ! fields at diagnostic points real (kind=dbl_kind), dimension(npnt) :: & pNit_sk, pAm_sk, pSil_sk, phum_sk, & @@ -867,24 +858,20 @@ end subroutine bgc_diags ! Cecilia M. Bitz, UW ! Nicole Jeffery, LANL - subroutine zsal_diags (dt) + subroutine zsal_diags use ice_arrays_column, only: fzsal, fzsal_g, sice_rho, bTiz, & iDi, bphi, dhbr_top, dhbr_bot, darcy_V - use ice_blocks, only: nx_block, ny_block use ice_broadcast, only: broadcast_scalar, broadcast_array use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, & - pbloc, plat, plon - use ice_domain_size, only: max_blocks, nblyr, ncat, nilyr + pbloc + use ice_domain_size, only: nblyr, ncat, nilyr use ice_state, only: aicen, aice, vice, trcr, trcrn, vicen, vsno - real (kind=dbl_kind), intent(in) :: & - dt ! time step - ! local variables integer (kind=int_kind) :: & - i, j, k, n, nn, ii,jj, iblk + i, j, k, n, nn, iblk ! fields at diagnostic points real (kind=dbl_kind), dimension(npnt) :: & @@ -894,16 +881,13 @@ subroutine zsal_diags (dt) ! vertical fields of category 1 at diagnostic points for bgc layer model real (kind=dbl_kind), dimension(npnt,nblyr+2) :: & - pphin, pgrid, pphin1 + pphin, pphin1 real (kind=dbl_kind), dimension(npnt,nblyr) :: & pSin, pSice, pSin1 real (kind=dbl_kind), dimension(npnt,nblyr+1) :: & pbTiz, piDin - real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: & - work1, work2 - real (kind=dbl_kind) :: & rhosi, rhow, rhos diff --git a/cicecore/cicedynB/analysis/ice_history.F90 b/cicecore/cicedynB/analysis/ice_history.F90 index 490b92318..6ee5e71de 100644 --- a/cicecore/cicedynB/analysis/ice_history.F90 +++ b/cicecore/cicedynB/analysis/ice_history.F90 @@ -68,7 +68,7 @@ subroutine init_hist (dt) histfreq_n, nstreams use ice_domain_size, only: max_blocks, max_nstrm use ice_dyn_shared, only: kdyn - use ice_flux, only: mlt_onset, frz_onset, albcnt, taubx, tauby + use ice_flux, only: mlt_onset, frz_onset, albcnt use ice_history_shared ! everything use ice_history_mechred, only: init_hist_mechred_2D, init_hist_mechred_3Dc use ice_history_pond, only: init_hist_pond_2D, init_hist_pond_3Dc @@ -1206,9 +1206,9 @@ subroutine accum_hist (dt) taubx, tauby, strocnx, strocny, fm, daidtt, dvidtt, daidtd, dvidtd, fsurf, & fcondtop, fsurfn, fcondtopn, flatn, fsensn, albcnt, & stressp_1, stressm_1, stress12_1, & - stressp_2, stressm_2, stress12_2, & - stressp_3, stressm_3, stress12_3, & - stressp_4, stressm_4, stress12_4, sig1, sig2, sigP, & + stressp_2, & + stressp_3, & + stressp_4, sig1, sig2, sigP, & mlt_onset, frz_onset, dagedtt, dagedtd, fswint_ai, keffn_top, & snowfrac, alvdr_ai, alvdf_ai, alidr_ai, alidf_ai use ice_arrays_column, only: snowfracn @@ -1238,9 +1238,7 @@ subroutine accum_hist (dt) real (kind=dbl_kind) :: & qn , & ! temporary variable for enthalpy - sn , & ! temporary variable for salinity - Tmlts , & ! temporary variable for melting temperature - Tn ! temporary variable for ice temperature + sn ! temporary variable for salinity real (kind=dbl_kind), dimension (nx_block,ny_block) :: & worka, workb @@ -1328,7 +1326,7 @@ subroutine accum_hist (dt) !--------------------------------------------------------------- !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block, & - !$OMP k,n,qn,ns,worka,workb,Tinz4d,Sinz4d,Tsnz4d) + !$OMP k,n,qn,ns,sn,worka,workb,Tinz4d,Sinz4d,Tsnz4d) do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo diff --git a/cicecore/cicedynB/analysis/ice_history_bgc.F90 b/cicecore/cicedynB/analysis/ice_history_bgc.F90 index 6e52fa180..36f1d8ba8 100644 --- a/cicecore/cicedynB/analysis/ice_history_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_history_bgc.F90 @@ -20,7 +20,7 @@ module ice_history_bgc use icepack_intfc, only: icepack_query_tracer_flags, & icepack_query_tracer_indices, icepack_query_parameters, & icepack_query_parameters - use ice_domain_size, only: max_nstrm, n_aero, nblyr, & + use ice_domain_size, only: max_nstrm, n_aero, & n_algae, n_dic, n_doc, n_don, n_zaero, n_fed, n_fep implicit none @@ -1728,8 +1728,6 @@ end subroutine init_hist_bgc_2D subroutine init_hist_bgc_3Dc - use ice_broadcast, only: broadcast_scalar - use ice_broadcast, only: broadcast_scalar use ice_calendar, only: nstreams use ice_history_shared, only: tstr3Dc, tcstr, define_hist_field @@ -1812,14 +1810,14 @@ subroutine accum_hist_bgc (iblk) R_C2N, R_chl2N use ice_blocks, only: block, get_block, nx_block, ny_block use ice_domain, only: blocks_ice - use ice_domain_size, only: ncat, nblyr + use ice_domain_size, only: nblyr use ice_flux, only: sss use ice_flux_bgc, only: faero_atm, faero_ocn, flux_bio, flux_bio_ai, & fzsal_ai, fzsal_g_ai - use ice_history_shared, only: n2D, a2D, a3Dc, n3Dccum, & - n3Dzcum, n3Dbcum, n3Dacum, a3Db, a3Da, & + use ice_history_shared, only: n2D, a2D, a3Dc, & + n3Dzcum, n3Dbcum, a3Db, a3Da, & ncat_hist, accum_hist_field, nzblyr, nzalyr - use ice_state, only: trcrn, trcr, aicen, aice, vice, vicen + use ice_state, only: trcrn, trcr, aicen, aice, vicen integer (kind=int_kind), intent(in) :: & iblk ! block index diff --git a/cicecore/cicedynB/analysis/ice_history_drag.F90 b/cicecore/cicedynB/analysis/ice_history_drag.F90 index 0cf176de4..632b49207 100644 --- a/cicecore/cicedynB/analysis/ice_history_drag.F90 +++ b/cicecore/cicedynB/analysis/ice_history_drag.F90 @@ -7,10 +7,9 @@ module ice_history_drag use ice_kinds_mod use ice_domain_size, only: max_nstrm - use ice_constants, only: c0, c1, c100, mps_to_cmpdy + use ice_constants, only: c0, c1 use ice_fileunits, only: nu_nml, nml_filename, & get_fileunit, release_fileunit - use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -228,8 +227,7 @@ end subroutine init_hist_drag_2D subroutine accum_hist_drag (iblk) - use ice_history_shared, only: n2D, a2D, a3Dc, ncat_hist, & - accum_hist_field + use ice_history_shared, only: a2D, accum_hist_field use ice_arrays_column, only: hfreebd, hdraft, hridge, distrdg, hkeel, & dkeel, lfloe, dfloe, Cdn_atm, Cdn_atm_skin, Cdn_atm_floe, & Cdn_atm_pond, Cdn_atm_rdg, Cdn_atm_ratio, Cdn_ocn_skin, & diff --git a/cicecore/cicedynB/analysis/ice_history_shared.F90 b/cicecore/cicedynB/analysis/ice_history_shared.F90 index 718966284..8089be6cc 100644 --- a/cicecore/cicedynB/analysis/ice_history_shared.F90 +++ b/cicecore/cicedynB/analysis/ice_history_shared.F90 @@ -24,7 +24,6 @@ module ice_history_shared use ice_kinds_mod - use ice_fileunits, only: nu_diag,ice_stderr use ice_domain_size, only: ncat, nilyr, nslyr, nblyr, max_nstrm use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -462,7 +461,7 @@ module ice_history_shared subroutine construct_filename(ncfile,suffix,ns) - use ice_calendar, only: time, sec, nyr, month, daymo, & + use ice_calendar, only: sec, nyr, month, daymo, & mday, write_ic, histfreq, histfreq_n, & year_init, new_year, new_month, new_day, & dt @@ -555,7 +554,7 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, & vdesc, vcomment, cona, conb, & ns, vhistfreq) - use ice_calendar, only: histfreq, histfreq_n, nstreams + use ice_calendar, only: histfreq, histfreq_n use ice_domain_size, only: max_nstrm integer (int_kind), dimension(max_nstrm), intent(out) :: & diff --git a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 index 5affe3b05..0079d2066 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 @@ -21,7 +21,7 @@ module ice_dyn_eap use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: max_blocks, ncat use ice_constants, only: c0, c1, c2, c3, c12, p1, p2, p5, & - p001, p025, p027, p05, p055, p111, p166, p222, p25, p333 + p001, p027, p055, p111, p166, p222, p25, p333 use ice_fileunits, only: nu_diag, nu_dump_eap, nu_restart_eap use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -92,14 +92,17 @@ subroutine eap (dt) denom1, uvel_init, vvel_init, arlx1i, & evp_prep1, evp_prep2, stepu, evp_finish, & basal_stress_coeff, basalstress - use ice_flux, only: rdg_conv, rdg_shear, strairxT, strairyT, & + use ice_flux, only: rdg_conv, strairxT, strairyT, & strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, & strtltx, strtlty, strocnx, strocny, strintx, strinty, & - strocnxT, strocnyT, strax, stray, & + strocnxT, strocnyT, & Cbu, taubx, tauby, hwater, & stressp_1, stressp_2, stressp_3, stressp_4, & stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 +#ifdef CICE_IN_NEMO + use ice_flux, only: strax, stray +#endif use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, & tarear, uarear, to_ugrid, t2ugrid_vector, u2tgrid_vector use ice_state, only: aice, vice, vsno, uvel, vvel, divu, shear, & @@ -172,7 +175,7 @@ subroutine eap (dt) do j = 1, ny_block do i = 1, nx_block rdg_conv (i,j,iblk) = c0 - rdg_shear(i,j,iblk) = c0 +! rdg_shear(i,j,iblk) = c0 divu (i,j,iblk) = c0 shear(i,j,iblk) = c0 e11(i,j,iblk) = c0 @@ -391,7 +394,8 @@ subroutine eap (dt) yieldstress11 (:,:,iblk), & yieldstress12 (:,:,iblk), & yieldstress22 (:,:,iblk), & - rdg_conv (:,:,iblk), rdg_shear (:,:,iblk), & +! rdg_conv (:,:,iblk), rdg_shear (:,:,iblk), & + rdg_conv (:,:,iblk), & strtmp (:,:,:)) ! call ice_timer_stop(timer_tmp1) ! dynamics @@ -987,7 +991,8 @@ FUNCTION s12ks(x,y,z,phi) n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & +! t2t1i11, t2t1i22, & + t2t1i12, t2t1i21, & d11, d12, d22, & IIn1t2, IIn2t1, IIt1t2, & Hen1t2, Hen2t1, & @@ -1012,10 +1017,10 @@ FUNCTION s12ks(x,y,z,phi) t1t2i12 = cos(z-p) * sin(z+p) t1t2i21 = sin(z-p) * cos(z+p) t1t2i22 = sin(z-p) * sin(z+p) - t2t1i11 = cos(z+p) * cos(z-p) +! t2t1i11 = cos(z+p) * cos(z-p) t2t1i12 = cos(z+p) * sin(z-p) t2t1i21 = sin(z+p) * cos(z-p) - t2t1i22 = sin(z+p) * sin(z-p) +! t2t1i22 = sin(z+p) * sin(z-p) d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) d12 = cos(y)*cos(y)*tan(y)*(-cos(x)+sin(x)) d22 = cos(y)*cos(y)*(sin(x)+cos(x)*tan(y)*tan(y)) @@ -1056,7 +1061,8 @@ FUNCTION s22ks(x,y,z,phi) n1t2i11, n1t2i12, n1t2i21, n1t2i22, & n2t1i11, n2t1i12, n2t1i21, n2t1i22, & t1t2i11, t1t2i12, t1t2i21, t1t2i22, & - t2t1i11, t2t1i12, t2t1i21, t2t1i22, & +! t2t1i11, t2t1i12, t2t1i21, & + t2t1i22, & d11, d12, d22, & IIn1t2, IIn2t1, IIt1t2, & Hen1t2, Hen2t1, & @@ -1081,9 +1087,9 @@ FUNCTION s22ks(x,y,z,phi) t1t2i12 = cos(z-p) * sin(z+p) t1t2i21 = sin(z-p) * cos(z+p) t1t2i22 = sin(z-p) * sin(z+p) - t2t1i11 = cos(z+p) * cos(z-p) - t2t1i12 = cos(z+p) * sin(z-p) - t2t1i21 = sin(z+p) * cos(z-p) +! t2t1i11 = cos(z+p) * cos(z-p) +! t2t1i12 = cos(z+p) * sin(z-p) +! t2t1i21 = sin(z+p) * cos(z-p) t2t1i22 = sin(z+p) * sin(z-p) d11 = cos(y)*cos(y)*(cos(x)+sin(x)*tan(y)*tan(y)) d12 = cos(y)*cos(y)*tan(y)*(-cos(x)+sin(x)) @@ -1143,7 +1149,8 @@ subroutine stress_eap (nx_block, ny_block, & yieldstress11, & yieldstress12, & yieldstress22, & - rdg_conv, rdg_shear, & +! rdg_conv, rdg_shear, & + rdg_conv, & strtmp) !echmod tmp @@ -1204,8 +1211,8 @@ subroutine stress_eap (nx_block, ny_block, & yieldstress11, & ! components of yield stress tensor (kg/s^2) yieldstress12, & yieldstress22, & - rdg_conv , & ! convergence term for ridging (1/s) - rdg_shear ! shear term for ridging (1/s) + rdg_conv ! convergence term for ridging (1/s) +! rdg_shear ! shear term for ridging (1/s) real (kind=dbl_kind), dimension(nx_block,ny_block,8), & intent(out) :: & @@ -1565,9 +1572,6 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & a22, Q11, Q12, Qd11, Qd12, & Q11Q11, Q11Q12, Q12Q12, & dtemp11, dtemp12, dtemp22, & - fxinvdx, fyinvdy, fainvda, & - mfxinvdx, mfyinvdy, mfainvda, & - fff, ffm, fmm, mmm, mmf, mff, fmf, mfm, & rotstemp11r, rotstemp12r, rotstemp22r, & rotstemp11s, rotstemp12s, rotstemp22s, & sig11, sig12, sig22, & @@ -1575,7 +1579,7 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & invstressconviso, & gamma, alpha, x, y, dx, dy, da, & invdx, invdy, invda, invsin, & - invleng, dtemp1, dtemp2, atempprime, a, & + invleng, dtemp1, dtemp2, atempprime, & puny, pi, pi2, piq real (kind=dbl_kind), parameter :: & @@ -1939,11 +1943,6 @@ subroutine write_restart_eap () ! local variables - integer (kind=int_kind) :: & - iyear, imonth, iday ! year, month, day - - character(len=char_len_long) :: filename - logical (kind=log_kind) :: diag diag = .true. diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 index 39fb0cd96..adbb40d31 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 @@ -36,10 +36,10 @@ module ice_dyn_evp use ice_kinds_mod use ice_constants, only: field_loc_center, field_loc_NEcorner, & field_type_scalar, field_type_vector - use ice_constants, only: c0, c4, p027, p055, p111, p166, & - p2, p222, p25, p333, p5, c1 + use ice_constants, only: c0, p027, p055, p111, p166, & + p222, p25, p333, p5, c1 use ice_dyn_shared, only: stepu, evp_prep1, evp_prep2, evp_finish, & - ndte, yield_curve, ecci, denom1, arlx1i, fcor_blk, uvel_init, & + ndte, ecci, denom1, arlx1i, fcor_blk, uvel_init, & vvel_init, basal_stress_coeff, basalstress, Ktens use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice @@ -82,11 +82,14 @@ subroutine evp (dt) use ice_flux, only: rdg_conv, rdg_shear, strairxT, strairyT, & strairx, strairy, uocn, vocn, ss_tltx, ss_tlty, iceumask, fm, & strtltx, strtlty, strocnx, strocny, strintx, strinty, & - strocnxT, strocnyT, strax, stray, & + strocnxT, strocnyT, & Cbu, taubx, tauby, hwater, & stressp_1, stressp_2, stressp_3, stressp_4, & stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 +#ifdef CICE_IN_NEMO + use ice_flux, only: strax, stray +#endif use ice_grid, only: tmask, umask, dxt, dyt, dxhy, dyhx, cxp, cyp, cxm, cym, & tarear, uarear, tinyarea, to_ugrid, t2ugrid_vector, u2tgrid_vector, & grid_type diff --git a/cicecore/cicedynB/dynamics/ice_transport_driver.F90 b/cicecore/cicedynB/dynamics/ice_transport_driver.F90 index 6d816db11..59355c6a9 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_driver.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_driver.F90 @@ -15,7 +15,7 @@ module ice_transport_driver use ice_kinds_mod use ice_communicate, only: my_task, master_task use ice_constants, only: c0, c1, p5, & - field_loc_center, field_loc_NEcorner, & + field_loc_center, & field_type_scalar, field_type_vector, & field_loc_Nface, field_loc_Eface use ice_fileunits, only: nu_diag @@ -227,7 +227,7 @@ subroutine transport_remap (dt) use ice_blocks, only: nx_block, ny_block, block, get_block, nghost use ice_state, only: aice0, aicen, vicen, vsnon, trcrn, & uvel, vvel, bound_state - use ice_grid, only: tarea, HTE, HTN + use ice_grid, only: tarea use ice_calendar, only: istep1 use ice_timers, only: ice_timer_start, ice_timer_stop, & timer_advect, timer_bound @@ -992,7 +992,7 @@ subroutine tracers_to_state (nx_block, ny_block, & integer (kind=int_kind) :: & nt_qsno ,&! - i, j, k, n ,&! standard indices + i, j, n ,&! standard indices it, kt ,&! tracer indices icells ,&! number of cells with ice ij @@ -1736,18 +1736,9 @@ subroutine upwind_field (nx_block, ny_block, & integer (kind=int_kind) :: & i, j, n ! standard indices - real (kind=dbl_kind) :: & - upwind, y1, y2, a, h ! function - real (kind=dbl_kind), dimension (nx_block,ny_block) :: & worka, workb - !------------------------------------------------------------------- - ! Define upwind function - !------------------------------------------------------------------- - - upwind(y1,y2,a,h) = p5*dt*h*((a+abs(a))*y1+(a-abs(a))*y2) - !------------------------------------------------------------------- ! upwind transport !------------------------------------------------------------------- @@ -1757,9 +1748,9 @@ subroutine upwind_field (nx_block, ny_block, & do j = 1, jhi do i = 1, ihi worka(i,j)= & - upwind(phi(i,j,n),phi(i+1,j,n),uee(i,j),HTE(i,j)) + upwind(phi(i,j,n),phi(i+1,j,n),uee(i,j),HTE(i,j),dt) workb(i,j)= & - upwind(phi(i,j,n),phi(i,j+1,n),vnn(i,j),HTN(i,j)) + upwind(phi(i,j,n),phi(i,j+1,n),vnn(i,j),HTN(i,j),dt) enddo enddo @@ -1775,6 +1766,20 @@ subroutine upwind_field (nx_block, ny_block, & end subroutine upwind_field +!======================================================================= + + !------------------------------------------------------------------- + ! Define upwind function + !------------------------------------------------------------------- + + real(kind=dbl_kind) function upwind(y1,y2,a,h,dt) + + real(kind=dbl_kind), intent(in) :: y1,y2,a,h,dt + + upwind = p5*dt*h*((a+abs(a))*y1+(a-abs(a))*y2) + + end function upwind + !======================================================================= end module ice_transport_driver diff --git a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 index 34c2bfefe..c9c488652 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 @@ -30,7 +30,7 @@ module ice_transport_remap use ice_kinds_mod - use ice_communicate, only: my_task, master_task + use ice_communicate, only: my_task use ice_constants, only: c0, c1, c2, c12, p333, p4, p5, p6, & eps13, eps16, & field_loc_center, field_type_scalar, & @@ -324,7 +324,7 @@ subroutine horizontal_remap (dt, ntrace, & use ice_domain, only: nblocks, blocks_ice, halo_info, maskhalo_remap use ice_blocks, only: block, get_block, nghost, nx_block, ny_block use ice_grid, only: HTE, HTN, dxu, dyu, & - tarea, tarear, hm, & + tarear, hm, & xav, yav, xxav, yyav ! xyav, xxxav, xxyav, xyyav, yyyav use ice_calendar, only: istep1 @@ -1109,7 +1109,7 @@ subroutine construct_fields (nx_block, ny_block, & real (kind=dbl_kind) :: & puny, & - w1, w2, w3, w4, w5, w6, w7 ! work variables + w1, w2, w3, w7 ! work variables !------------------------------------------------------------------- ! Compute field values at the geometric center of each grid cell, @@ -1268,10 +1268,10 @@ subroutine construct_fields (nx_block, ny_block, & + mx(i,j)*tc(i,j,nt) w3 = mc(i,j)*ty(i,j,nt) & + my(i,j)*tc(i,j,nt) - w4 = mx(i,j)*tx(i,j,nt) - w5 = mx(i,j)*ty(i,j,nt) & - + my(i,j)*tx(i,j,nt) - w6 = my(i,j)*ty(i,j,nt) +! w4 = mx(i,j)*tx(i,j,nt) +! w5 = mx(i,j)*ty(i,j,nt) & +! + my(i,j)*tx(i,j,nt) +! w6 = my(i,j)*ty(i,j,nt) w7 = c1 / (mm(i,j)*tm(i,j,nt)) !echmod: grid arrays = 0 mtxav(i,j,nt) = (w1*xav (i,j) + w2*xxav (i,j)) & diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index e545bcc00..29f2607d7 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -19,7 +19,7 @@ module ice_forcing use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: ncat, max_blocks, nx_global, ny_global use ice_communicate, only: my_task, master_task - use ice_calendar, only: istep, istep1, time, time_forc, year_init, & + use ice_calendar, only: istep, istep1, time, time_forc, & sec, mday, month, nyr, yday, daycal, dayyr, & daymo, days_per_year use ice_fileunits, only: nu_diag, nu_forcing @@ -36,7 +36,6 @@ module ice_forcing use ice_constants, only: field_loc_center, field_type_scalar, & field_type_vector, field_loc_NEcorner use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted - use icepack_intfc, only: icepack_liquidus_temperature use icepack_intfc, only: icepack_sea_freezing_temperature use icepack_intfc, only: icepack_query_tracer_indices, icepack_query_parameters @@ -55,13 +54,11 @@ module ice_forcing fyear_final ! last year in cycle character (char_len_long) :: & ! input data file names - height_file, & uwind_file, & vwind_file, & wind_file, & strax_file, & stray_file, & - potT_file, & tair_file, & humid_file, & rhoa_file, & @@ -70,7 +67,6 @@ module ice_forcing rain_file, & sst_file, & sss_file, & - pslv_file, & sublim_file, & snow_file @@ -101,8 +97,6 @@ module ice_forcing stray_data, & Qa_data, & rhoa_data, & - potT_data, & - zlvl_data, & flw_data, & sst_data, & sss_data, & @@ -191,9 +185,9 @@ subroutine init_forcing_atmo elseif (trim(atm_data_type) == 'monthly') then call monthly_files(fyear) elseif (trim(atm_data_type) == 'oned') then - call oned_files(fyear) + call oned_files elseif (trim(atm_data_type) == 'ISPOL') then - call ISPOL_files(fyear) + call ISPOL_files endif end subroutine init_forcing_atmo @@ -557,7 +551,7 @@ subroutine get_forcing_ocn (dt) call ocn_data_hadgem(dt) elseif (trim(sst_data_type) == 'oned' .or. & trim(sss_data_type) == 'oned') then - call ocn_data_oned(dt) + call ocn_data_oned endif end subroutine get_forcing_ocn @@ -981,15 +975,12 @@ subroutine read_clim_data_nc (readflag, recd, ixm, ixx, ixp, & ! local variables integer (kind=int_kind) :: & - nbits , & ! = 32 for single precision, 64 for double nrec , & ! record number to read arg , & ! value of time argument in field_data fid ! file id for netCDF routines call ice_timer_start(timer_readwrite) ! reading/writing - nbits = 64 ! double precision data - if (istep1 > check_step) dbug = .true. !! debugging if (my_task==master_task .and. (dbug)) & @@ -2328,7 +2319,6 @@ subroutine hadgem_data use ice_domain, only: nblocks use ice_flux, only: fsnow, frain, uatm, vatm, strax, stray, wind, & fsw, flw, Tair, rhoa, Qa, fcondtopn_f, fsurfn_f, flatn_f - use ice_state, only: aice, aicen integer (kind=int_kind) :: & i, j , & ! horizontal indices @@ -2794,8 +2784,6 @@ end subroutine monthly_data subroutine oned_data - use ice_blocks, only: block, get_block - use ice_domain, only: nblocks, blocks_ice use ice_flux, only: uatm, vatm, Tair, fsw, fsnow, Qa, rhoa, frain #ifdef ncdf @@ -2818,13 +2806,6 @@ subroutine oned_data integer (kind=int_kind) :: & status ! status flag - integer (kind=int_kind) :: & - iblk, & ! block index - ilo,jlo ! beginning of physical domain - - type (block) :: & - this_block ! block information for current block - real (kind=dbl_kind) :: & ! used to determine specific humidity Temp , & ! air temperature (K) rh , & ! relative humidity (%) @@ -2843,11 +2824,6 @@ subroutine oned_data diag = .false. ! write diagnostic information - do iblk = 1, nblocks - this_block = get_block(blocks_ice(iblk),iblk) - ilo = this_block%ilo - jlo = this_block%jlo - if (trim(atm_data_format) == 'nc') then ! read nc file ! hourly data beginning Jan 1, 1989, 01:00 @@ -2913,18 +2889,13 @@ subroutine oned_data cldf (:,:,:) = p25 ! cloud fraction frain(:,:,:) = c0 ! this is available in hourlymet_rh file - enddo ! nblocks - #endif end subroutine oned_data !======================================================================= - subroutine oned_files(yr) - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year + subroutine oned_files fsw_file = & trim(atm_data_dir)//'/hourlysolar_brw1989_5yr.nc' @@ -2970,7 +2941,7 @@ subroutine ocn_data_clim (dt) ! author: Elizabeth C. Hunke and William H. Lipscomb, LANL use ice_domain, only: nblocks - use ice_flux, only: Tf, sss, sst, uocn, vocn, ss_tltx, ss_tlty + use ice_flux, only: sss, sst real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -3577,16 +3548,11 @@ end subroutine ocn_data_ncar ! ocean data for oned configuration ! Current (released) values are the same as the defaults (ice_flux.F90) - subroutine ocn_data_oned(dt) + subroutine ocn_data_oned use ice_flux, only: sss, sst, Tf, uocn, vocn, ss_tltx, ss_tlty, & qdp, hmix, frzmlt - real (kind=dbl_kind), intent(in) :: & - dt ! time step - - integer :: i, j, iblk - sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) call ocn_freezing_temperature @@ -3619,10 +3585,9 @@ subroutine ocn_data_hadgem(dt) real (kind=dbl_kind), intent(in) :: & dt ! time step - - integer (kind=int_kind) :: & - i, j , & ! horizontal indices - iblk , & ! block index + + integer (kind=int_kind) :: & + i, j, iblk , & ixm,ixp , & ! record numbers for neighboring months maxrec , & ! maximum record number recslot , & ! spline slot for current record @@ -3941,10 +3906,7 @@ end subroutine read_data_nc_point !======================================================================= - subroutine ISPOL_files(yr) - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year + subroutine ISPOL_files fsw_file = & trim(atm_data_dir)//'/fsw_sfc_4Xdaily.nc' @@ -3989,12 +3951,8 @@ subroutine ISPOL_data ! authors: Nicole Jeffery, LANL ! - use ice_global_reductions, only: global_minval, global_maxval - use ice_domain, only: nblocks, distrb_info, blocks_ice - use ice_flux, only: uatm, vatm, Tair, fsw, Qa, qdp, rhoa, & + use ice_flux, only: uatm, vatm, Tair, fsw, Qa, rhoa, & frain, fsnow, flw - use ice_grid, only: tmask - use ice_diagnostics, only: latpnt, lonpnt #ifdef ncdf use netcdf #endif @@ -4005,29 +3963,9 @@ subroutine ISPOL_data met_file, & ! netcdf filename fieldname ! field name in netcdf file - integer (kind=int_kind) :: & - fid ! file id for netCDF file - - real (kind=dbl_kind):: & - work ! temporary variable - - real (kind=dbl_kind) :: & - vmin, vmax - - logical (kind=log_kind) :: diag - integer (kind=int_kind) :: & status ! status flag - integer (kind=int_kind) :: & - iblk ! block index - - real (kind=dbl_kind) :: & ! used to determine specific humidity - Temp , & ! air temperature (K) - rh , & ! relative humidity (%) - Psat , & ! saturation vapour pressure (hPa) - ws ! saturation mixing ratio - real (kind=dbl_kind), dimension(2), save :: & Tair_data_p , & ! air temperature (K) for interpolation Qa_data_p, fsnow_data_p, & @@ -4047,36 +3985,22 @@ subroutine ISPOL_data ! for interpolation of hourly data integer (kind=int_kind) :: & - i, j, k , & ixm,ixx,ixp , & ! record numbers for neighboring months recnum , & ! record number recnum4X , & ! record number maxrec , & ! maximum record number recslot , & ! spline slot for current record - dataloc , & ! = 1 for data located in middle of time interval + dataloc ! = 1 for data located in middle of time interval ! = 2 for date located at end of time interval - sec_day ! fix time to noon - real (kind=dbl_kind) :: & - hour_angle, & - solar_time, & - declin , & - cosZ , & - year_day , & - e, d , & - sw0 , & - deg2rad , & - fsw_pnt , & - sumsw0 , & secday , & Qa_pnt real (kind=dbl_kind) :: & sec1hr ! number of seconds in 1 hour - logical (kind=log_kind) :: readm, read1 + logical (kind=log_kind) :: read1 - diag = .false. ! write diagnostic information call icepack_query_parameters(secday_out=secday) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & @@ -4260,7 +4184,6 @@ subroutine ocn_data_ispol_init ! ! authors: Nicole Jeffery, LANL ! - use ice_domain, only: nblocks, distrb_info use ice_gather_scatter use ice_read_write #ifdef ncdf @@ -4269,9 +4192,7 @@ subroutine ocn_data_ispol_init integer (kind=int_kind) :: & n , & ! field index - m , & ! month index - nrec, & ! record number for direct access - nbits + m ! month index character(char_len) :: & vname(nfld) ! variable names to search for in file @@ -4283,13 +4204,10 @@ subroutine ocn_data_ispol_init work integer (kind=int_kind) :: & - fid , & ! file id - dimid ! dimension id + fid ! file id integer (kind=int_kind) :: & - status , & ! status flag - nlat , & ! number of longitudes of data - nlon ! number of latitudes of data + status ! status flag if (my_task == master_task) then diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index 2609905d2..34b4d97f8 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -11,11 +11,11 @@ module ice_forcing_bgc use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: max_blocks use ice_communicate, only: my_task, master_task - use ice_calendar, only: dt, istep, sec, mday, month, daymo + use ice_calendar, only: dt, istep, sec, mday, month use ice_fileunits, only: nu_diag use ice_arrays_column, only: restore_bgc, & bgc_data_dir, sil_data_type, nit_data_type, fe_data_type - use ice_constants, only: c0, p01, p1 + use ice_constants, only: c0, p1 use ice_constants, only: field_loc_center, field_type_scalar use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted @@ -57,7 +57,7 @@ subroutine get_forcing_bgc read_data_nc_point, c1intp, c2intp integer (kind=int_kind) :: & - i, j, k,iblk, & ! horizontal indices + i, j, iblk, & ! horizontal indices ixm,ixp, ixx, & ! record numbers for neighboring months maxrec , & ! maximum record number recslot , & ! spline slot for current record @@ -65,7 +65,6 @@ subroutine get_forcing_bgc recnum , & ! record number dataloc , & ! = 1 for data located in middle of time interval ! = 2 for date located at end of time interval - sec_day , & ! fix time to noon ks ! bgc tracer index (bio_index_o) character (char_len_long) :: & @@ -389,8 +388,8 @@ end subroutine get_forcing_bgc subroutine get_atm_bgc - use ice_blocks, only: nx_block, ny_block, block, get_block - use ice_domain, only: nblocks, distrb_info, blocks_ice + use ice_blocks, only: block, get_block + use ice_domain, only: nblocks, blocks_ice use ice_domain_size, only: n_zaero use ice_flux_bgc, only: flux_bio_atm, faero_atm @@ -567,7 +566,6 @@ end subroutine faero_data subroutine fzaero_data - use ice_domain_size, only: n_zaero use ice_blocks, only: nx_block, ny_block use ice_flux_bgc, only: faero_atm use ice_forcing, only: interp_coeff_monthly, read_clim_data_nc, interpolate_data @@ -670,8 +668,7 @@ subroutine init_bgc_data (fed1,fep1) ! local parameters integer (kind=int_kind) :: & - fid , & ! file id for netCDF file - nbits + fid ! file id for netCDF file logical (kind=log_kind) :: diag @@ -679,8 +676,6 @@ subroutine init_bgc_data (fed1,fep1) iron_file, & ! netcdf filename fieldname ! field name in netcdf file - nbits = 64 ! double precision data - !------------------------------------------------------------------- ! Annual average data from Tagliabue, 2012 (top 50 m average ! poisson grid filled on gx1v6 @@ -737,7 +732,7 @@ end subroutine init_bgc_data subroutine faero_optics use ice_broadcast, only: broadcast_array - use ice_read_write, only: ice_open_nc, ice_read_nc, ice_close_nc + use ice_read_write, only: ice_open_nc, ice_close_nc use ice_communicate, only: my_task, master_task use ice_arrays_column, only: & kaer_tab, & ! aerosol mass extinction cross section (m2/kg) @@ -759,16 +754,13 @@ subroutine faero_optics status , & ! status output from netcdf routines n, k ! index - integer (kind=int_kind), dimension(4):: & - start, count - real (kind=dbl_kind) :: & amin, amax, asum ! min, max values and sum of input array integer (kind=int_kind) :: & fid ! file id for netCDF file - logical (kind=log_kind) :: diag, modal_aero + logical (kind=log_kind) :: modal_aero character (char_len_long) :: & optics_file, & ! netcdf filename @@ -848,7 +840,6 @@ subroutine faero_optics file=__FILE__, line=__LINE__) if (modal_aero) then - diag = .true. ! write diagnostic information optics_file = & '/usr/projects/climate/njeffery/DATA/CAM/snicar/snicar_optics_5bnd_mam_c140303.nc' diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index 1d6c0dfc4..ade3b2261 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -56,7 +56,7 @@ subroutine input_data use ice_diagnostics, only: diag_file, print_global, print_points, latpnt, lonpnt use ice_domain_size, only: max_nstrm, nilyr, nslyr, max_ntrcr, ncat, n_aero use ice_calendar, only: year_init, istep0, histfreq, histfreq_n, & - dumpfreq, dumpfreq_n, diagfreq, nstreams, & + dumpfreq, dumpfreq_n, diagfreq, & npt, dt, ndtd, days_per_year, use_leap_years, & write_ic, dump_last use ice_arrays_column, only: oceanmixed_ice @@ -91,7 +91,6 @@ subroutine input_data n ! loop index character (len=6) :: chartmp - character (len=32) :: str logical :: exists @@ -1195,7 +1194,7 @@ subroutine init_state use ice_domain, only: nblocks, blocks_ice use ice_domain_size, only: ncat, nilyr, nslyr, max_ntrcr, n_aero use ice_flux, only: sst, Tf, Tair, salinz, Tmltz - use ice_grid, only: tmask, ULON, ULAT, TLON, TLAT + use ice_grid, only: tmask, ULON, TLAT use ice_state, only: trcr_depend, aicen, trcrn, vicen, vsnon, & aice0, aice, vice, vsno, trcr, aice_init, bound_state, & n_trcr_strata, nt_strata, trcr_base @@ -1378,8 +1377,8 @@ subroutine init_state ilo, ihi, jlo, jhi, & iglob, jglob, & ice_ic, tmask(:,:, iblk), & - ULON (:,:, iblk), ULAT (:,:, iblk), & - TLON (:,:, iblk), TLAT (:,:, iblk), & + ULON (:,:, iblk), & + TLAT (:,:, iblk), & Tair (:,:, iblk), sst (:,:, iblk), & Tf (:,:, iblk), & salinz(:,:,:, iblk), Tmltz(:,:,:, iblk), & @@ -1455,8 +1454,8 @@ subroutine set_state_var (nx_block, ny_block, & ilo, ihi, jlo, jhi, & iglob, jglob, & ice_ic, tmask, & - ULON, ULAT, & - TLON, TLAT, & + ULON, & + TLAT, & Tair, sst, & Tf, & salinz, Tmltz, & @@ -1485,8 +1484,6 @@ subroutine set_state_var (nx_block, ny_block, & real (kind=dbl_kind), dimension (nx_block,ny_block), & intent(in) :: & ULON , & ! longitude of velocity pts (radians) - ULAT , & ! latitude of velocity pts (radians) - TLON , & ! longitude of temperature pts (radians) TLAT ! latitude of temperature pts (radians) real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: & diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index a55f26901..9ab8aa149 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -48,22 +48,19 @@ module ice_step_mod ! ! authors: Elizabeth Hunke, LANL - subroutine prep_radiation (dt, iblk) + subroutine prep_radiation (iblk) use ice_blocks, only: block, get_block use ice_domain, only: blocks_ice use ice_domain_size, only: ncat, nilyr, nslyr use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, & - alvdr_ai, alvdf_ai, alidr_ai, alidf_ai, fswfac, & + alvdr_ai, alvdf_ai, alidr_ai, alidf_ai, & alvdr_init, alvdf_init, alidr_init, alidf_init use ice_arrays_column, only: fswsfcn, fswintn, fswthrun, & fswpenln, Sswabsn, Iswabsn use ice_state, only: aice, aicen use ice_timers, only: ice_timer_start, ice_timer_stop, timer_sw - real (kind=dbl_kind), intent(in) :: & - dt ! time step - integer (kind=int_kind), intent(in) :: & iblk ! block index @@ -73,8 +70,6 @@ subroutine prep_radiation (dt, iblk) ilo,ihi,jlo,jhi, & ! beginning and end of physical domain i, j ! horizontal indices - real (kind=dbl_kind) :: netsw - type (block) :: & this_block ! block information for current block @@ -135,9 +130,7 @@ subroutine step_therm1 (dt, iblk) hfreebd, hdraft, hridge, distrdg, hkeel, dkeel, lfloe, dfloe, & fswsfcn, fswintn, fswthrun, Sswabsn, Iswabsn use ice_blocks, only: block, get_block, nx_block, ny_block - use ice_calendar, only: yday, istep1 - use ice_communicate, only: my_task - use ice_diagnostics, only: diagnostic_abort + use ice_calendar, only: yday use ice_domain, only: blocks_ice use ice_domain_size, only: ncat, nilyr, nslyr, n_aero use ice_flux, only: frzmlt, sst, Tf, strocnxT, strocnyT, rside, fbot, & @@ -146,7 +139,7 @@ subroutine step_therm1 (dt, iblk) flw, fsnow, fpond, sss, mlt_onset, frz_onset, & frain, Tair, strairxT, strairyT, fsurf, fcondtop, fsens, & flat, fswabs, flwout, evap, Tref, Qref, Uref, fresh, fsalt, fhocn, & - fswthru, meltt, melts, meltb, meltl, congel, snoice, & + fswthru, meltt, melts, meltb, congel, snoice, & flatn_f, fsensn_f, fsurfn_f, fcondtopn_f use ice_flux_bgc, only: dsnown, faero_atm, faero_ocn use ice_grid, only: lmask_n, lmask_s @@ -380,9 +373,7 @@ subroutine step_therm2 (dt, iblk) use ice_arrays_column, only: hin_max, fzsal, ocean_bio, & first_ice, bgrid, cgrid, igrid use ice_blocks, only: block, get_block - use ice_calendar, only: istep1, yday - use ice_communicate, only: my_task - use ice_diagnostics, only: diagnostic_abort + use ice_calendar, only: yday use ice_domain, only: blocks_ice use ice_domain_size, only: ncat, nilyr, nslyr, n_aero, nblyr, nltrcr use ice_flux, only: fresh, frain, fpond, frzmlt, frazil, frz_onset, & @@ -620,10 +611,8 @@ end subroutine step_dyn_horiz subroutine step_dyn_ridge (dt, ndtd, iblk) use ice_arrays_column, only: hin_max, fzsal, first_ice - use ice_blocks, only: block, get_block, nx_block, ny_block - use ice_calendar, only: istep1 - use ice_diagnostics, only: diagnostic_abort - use ice_domain, only: blocks_ice, nblocks + use ice_blocks, only: block, get_block + use ice_domain, only: blocks_ice use ice_domain_size, only: ncat, nilyr, nslyr, n_aero, nblyr use ice_flux, only: & rdg_conv, rdg_shear, dardg1dt, dardg2dt, & @@ -633,7 +622,7 @@ subroutine step_dyn_ridge (dt, ndtd, iblk) use ice_flux_bgc, only: flux_bio, faero_ocn use ice_grid, only: tmask use ice_state, only: trcrn, vsnon, aicen, vicen, & - aice, trcr, vice, vsno, aice0, trcr_depend, n_trcr_strata, & + aice, aice0, trcr_depend, n_trcr_strata, & trcr_base, nt_strata use ice_timers, only: ice_timer_start, ice_timer_stop, timer_column, & timer_ridge @@ -932,10 +921,7 @@ subroutine ocean_mixed_layer (dt, iblk) ! local variables - real (kind=dbl_kind) :: & - albocn,& ! - TsfK , & ! surface temperature (K) - swabs ! surface absorbed shortwave heat flux (W/m^2) + real (kind=dbl_kind) :: albocn real (kind=dbl_kind), parameter :: & frzmlt_max = c1000 ! max magnitude of frzmlt (W/m^2) @@ -1069,7 +1055,7 @@ end subroutine ocean_mixed_layer subroutine biogeochemistry (dt, iblk) use ice_arrays_column, only: upNO, upNH, iDi, iki, zfswin, & - trcrn_sw, zsal_tot, darcy_V, grow_net, & + zsal_tot, darcy_V, grow_net, & PP_net, hbri,dhbr_bot, dhbr_top, Zoo,& fbio_snoice, fbio_atmice, ocean_bio, & first_ice, fswpenln, bphi, bTiz, ice_bio_net, & @@ -1077,8 +1063,6 @@ subroutine biogeochemistry (dt, iblk) ocean_bio_all, sice_rho, fzsal, fzsal_g, & bgrid, igrid, icgrid, cgrid use ice_blocks, only: block, get_block - use ice_calendar, only: istep1 - use ice_diagnostics, only: diagnostic_abort use ice_domain, only: blocks_ice use ice_domain_size, only: nblyr, nilyr, nslyr, n_algae, n_zaero, ncat, & n_doc, n_dic, n_don, n_fed, n_fep @@ -1100,9 +1084,8 @@ subroutine biogeochemistry (dt, iblk) integer (kind=int_kind) :: & i, j , & ! horizontal indices - k , & ! vertical index ilo,ihi,jlo,jhi, & ! beginning and end of physical domain - n, mm ! tracer index + mm ! tracer index type (block) :: & this_block ! block information for current block diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 058b551fc..1e4299b7d 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -1911,6 +1911,9 @@ subroutine gridbox_corners ! (1) SW corner, (2) SE corner, (3) NE corner, (4) NW corner !------------------------------------------------------------- + latu_bounds(:,:,:,:) = c0 + lonu_bounds(:,:,:,:) = c0 + !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) @@ -1948,6 +1951,8 @@ subroutine gridbox_corners endif work1(:,:,:) = latu_bounds(2,:,:,:) + work_g2 = c0 + call gather_global(work_g2, work1, master_task, distrb_info) if (my_task == master_task) then do j = 1, ny_global diff --git a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 index 7d614e6c3..ae1fa8c54 100644 --- a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 @@ -22,9 +22,8 @@ module ice_restart_driver use ice_constants, only: c0, c1, p5, & field_loc_center, field_loc_NEcorner, & field_type_scalar, field_type_vector - use ice_restart_shared, only: & - restart, restart_ext, restart_dir, restart_file, pointer_file, & - runid, runtype, use_restart_time, restart_format, lcdf64, lenstr + use ice_restart_shared, only: restart_dir, pointer_file, & + runid, use_restart_time, lenstr use ice_restart use ice_exit, only: abort_ice use ice_fileunits, only: nu_diag, nu_rst_pointer, nu_restart, nu_dump @@ -52,17 +51,16 @@ module ice_restart_driver subroutine dumpfile(filename_spec) use ice_blocks, only: nx_block, ny_block - use ice_calendar, only: sec, month, mday, nyr, istep1, & - time, time_forc, year_init - use ice_communicate, only: my_task, master_task use ice_domain, only: nblocks use ice_domain_size, only: nilyr, nslyr, ncat, max_blocks use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, & - strocnxT, strocnyT, sst, frzmlt, iceumask, coszen, & + strocnxT, strocnyT, sst, frzmlt, iceumask, & stressp_1, stressp_2, stressp_3, stressp_4, & stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 - use ice_read_write, only: ice_open, ice_write +#ifdef CESMCOUPLED + use ice_flux, only: coszen +#endif use ice_state, only: aicen, vicen, vsnon, trcrn, uvel, vvel character(len=char_len_long), intent(in), optional :: filename_spec @@ -70,11 +68,8 @@ subroutine dumpfile(filename_spec) ! local variables integer (kind=int_kind) :: & - i, j, k, n, iblk, & ! counting indices - nt_Tsfc, nt_sice, nt_qice, nt_qsno, & - iyear, imonth, iday ! year, month, day - - character(len=char_len_long) :: filename + i, j, k, iblk, & ! counting indices + nt_Tsfc, nt_sice, nt_qice, nt_qsno logical (kind=log_kind) :: diag @@ -201,21 +196,21 @@ end subroutine dumpfile subroutine restartfile (ice_ic) use ice_boundary, only: ice_HaloUpdate_stress - use ice_broadcast, only: broadcast_scalar use ice_blocks, only: nghost, nx_block, ny_block - use ice_calendar, only: istep0, istep1, time, time_forc, calendar, npt + use ice_calendar, only: istep0, npt use ice_communicate, only: my_task, master_task - use ice_domain, only: nblocks, distrb_info, halo_info - use ice_domain_size, only: nilyr, nslyr, ncat, nx_global, ny_global, & + use ice_domain, only: nblocks, halo_info + use ice_domain_size, only: nilyr, nslyr, ncat, & max_ntrcr, max_blocks use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, & - strocnxT, strocnyT, sst, frzmlt, iceumask, coszen, & + strocnxT, strocnyT, sst, frzmlt, iceumask, & stressp_1, stressp_2, stressp_3, stressp_4, & stressm_1, stressm_2, stressm_3, stressm_4, & stress12_1, stress12_2, stress12_3, stress12_4 - use ice_gather_scatter, only: scatter_global_stress +#ifdef CESMCOUPLED + use ice_flux, only: coszen +#endif use ice_grid, only: tmask, grid_type - use ice_read_write, only: ice_open, ice_read, ice_read_global use ice_state, only: trcr_depend, aice, vice, vsno, trcr, & aice0, aicen, vicen, vsnon, trcrn, aice_init, uvel, vvel, & trcr_base, nt_strata, n_trcr_strata @@ -225,15 +220,8 @@ subroutine restartfile (ice_ic) ! local variables integer (kind=int_kind) :: & - i, j, k, n, iblk, & ! counting indices - nt_Tsfc, nt_sice, nt_qice, nt_qsno, & - iignore ! dummy variable - - real (kind=real_kind) :: & - rignore ! dummy variable - - character(len=char_len_long) :: & - filename, filename0 + i, j, k, iblk, & ! counting indices + nt_Tsfc, nt_sice, nt_qice, nt_qsno logical (kind=log_kind) :: & diag @@ -241,9 +229,6 @@ subroutine restartfile (ice_ic) real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: & work1 - real (kind=dbl_kind), dimension(:,:), allocatable :: & - work_g1, work_g2 - character (len=3) :: nchar call icepack_query_tracer_indices(nt_Tsfc_out=nt_Tsfc, nt_sice_out=nt_sice, & diff --git a/cicecore/cicedynB/infrastructure/ice_restoring.F90 b/cicecore/cicedynB/infrastructure/ice_restoring.F90 index 4989a4966..517902dcb 100644 --- a/cicecore/cicedynB/infrastructure/ice_restoring.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restoring.F90 @@ -8,11 +8,10 @@ module ice_restoring use ice_kinds_mod use ice_blocks, only: nx_block, ny_block - use ice_constants, only: c0, c1, c2, p2, p5 - use ice_domain_size, only: ncat, max_blocks, max_ntrcr + use ice_constants, only: c0, c1, c2, p2 + use ice_domain_size, only: ncat, max_blocks use ice_forcing, only: trestore, trest - use ice_state, only: aicen, vicen, vsnon, trcrn, bound_state, & - aice_init, aice0, aice, vice, vsno, trcr, trcr_depend + use ice_state, only: aicen, vicen, vsnon, trcrn use ice_timers, only: ice_timer_start, ice_timer_stop, timer_bound use ice_exit, only: abort_ice use ice_fileunits, only: nu_diag @@ -58,7 +57,7 @@ subroutine ice_HaloRestore_init use ice_domain, only: ew_boundary_type, ns_boundary_type, & nblocks, blocks_ice use ice_grid, only: tmask - use ice_flux, only: sst, Tf, Tair, salinz, Tmltz + use ice_flux, only: Tf, Tair, salinz, Tmltz use ice_restart_shared, only: restart_ext integer (int_kind) :: & @@ -123,7 +122,7 @@ subroutine ice_HaloRestore_init ilo, ihi, jlo, jhi, & iglob, jglob, & iblock, jblock, & - Tair (:,:, iblk), sst (:,:, iblk), & + Tair (:,:, iblk), & Tf (:,:, iblk), & salinz(:,:,:, iblk), Tmltz(:,:,:, iblk), & tmask(:,:, iblk), & @@ -267,7 +266,7 @@ subroutine set_restore_var (nx_block, ny_block, & ilo, ihi, jlo, jhi, & iglob, jglob, & iblock, jblock, & - Tair, sst, & + Tair, & Tf, & salinz, Tmltz, & tmask, aicen, & @@ -292,8 +291,7 @@ subroutine set_restore_var (nx_block, ny_block, & real (kind=dbl_kind), dimension (nx_block,ny_block), intent(in) :: & Tair , & ! air temperature (K) - Tf , & ! freezing temperature (C) - sst ! sea surface temperature (C) ! currently not used + Tf ! freezing temperature (C) real (kind=dbl_kind), dimension (nx_block,ny_block,nilyr), & intent(in) :: & diff --git a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 index faae0d9ad..3050454bf 100644 --- a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 @@ -78,7 +78,7 @@ subroutine ice_write_hist (ns) integer (kind=int_kind), dimension(5) :: dimidcz integer (kind=int_kind), dimension(3) :: dimid_nverts integer (kind=int_kind), dimension(5) :: dimidex - real (kind=real_kind) :: ltime +! real (kind=real_kind) :: ltime real (kind=dbl_kind) :: ltime2 character (char_len) :: title character (char_len_long) :: ncfile(max_nstrm) @@ -123,7 +123,7 @@ subroutine ice_write_hist (ns) if (my_task == master_task) then - ltime=time/int(secday) +! ltime=time/int(secday) ltime2=time/int(secday) call construct_filename(ncfile(ns),'nc',ns) diff --git a/cicecore/drivers/cice/CICE.F90 b/cicecore/drivers/cice/CICE.F90 index 4f22c7f9c..b62eaa14a 100644 --- a/cicecore/drivers/cice/CICE.F90 +++ b/cicecore/drivers/cice/CICE.F90 @@ -71,7 +71,6 @@ subroutine debug_ice(iblk, plabeld) use ice_calendar, only: istep1 use ice_communicate, only: my_task use ice_diagnostics, only: check_step, iblkp, ip, jp, mtask, print_state - use ice_domain, only: nblocks use ice_blocks, only: nx_block, ny_block character (char_len), intent(in) :: plabeld diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 467cbc384..c8c4a618d 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -57,8 +57,7 @@ end subroutine CICE_Initialize subroutine cice_init - use ice_arrays_column, only: hin_max, c_hi_range, zfswin, trcrn_sw, & - ocean_bio_all, ice_bio_net, snow_bio_net + use ice_arrays_column, only: hin_max, c_hi_range use ice_calendar, only: dt, dt_dyn, time, istep, istep1, write_ic, & init_calendar, calendar use ice_communicate, only: init_communicate, my_task, master_task @@ -66,13 +65,13 @@ subroutine cice_init use ice_domain, only: init_domain_blocks use ice_domain_size, only: ncat use ice_dyn_eap, only: init_eap - use ice_dyn_shared, only: kdyn, init_evp, basalstress + use ice_dyn_shared, only: kdyn, init_evp 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, & get_forcing_atmo, get_forcing_ocn use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, & - faero_data, faero_default, faero_optics + faero_default, faero_optics use ice_grid, only: init_grid1, init_grid2 use ice_history, only: init_hist, accum_hist use ice_restart_shared, only: restart, runid, runtype @@ -124,9 +123,9 @@ subroutine cice_init call init_thermo_vertical ! initialize vertical thermodynamics call icepack_init_itd(ncat, hin_max) ! ice thickness distribution - if (my_task == master_task) then +! if (my_task == master_task) then call icepack_init_itd_hist(ncat, hin_max, c_hi_range) ! output - endif +! endif call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & file=__FILE__, line=__LINE__) @@ -207,7 +206,6 @@ subroutine init_restart use ice_domain_size, only: ncat, max_ntrcr, n_aero use ice_dyn_eap, only: read_restart_eap use ice_dyn_shared, only: kdyn - use ice_flux, only: sss use ice_grid, only: tmask use ice_init, only: ice_ic use ice_init_column, only: init_age, init_FY, init_lvl, & @@ -221,7 +219,7 @@ subroutine init_restart restart_aero, read_restart_aero, & restart_hbrine, read_restart_hbrine, & restart_zsal, restart_bgc - use ice_restart_driver, only: restartfile, restartfile_v4 + use ice_restart_driver, only: restartfile use ice_restart_shared, only: runtype, restart use ice_state ! almost everything diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index b2e95c234..15727d761 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -45,7 +45,7 @@ subroutine CICE_Run use ice_calendar, only: istep, istep1, time, dt, stop_now, calendar use ice_forcing, only: get_forcing_atmo, get_forcing_ocn - use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, fzaero_data, & + use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, & faero_default use ice_flux, only: init_flux_atm, init_flux_ocn use ice_timers, only: ice_timer_start, ice_timer_stop, & @@ -133,7 +133,6 @@ subroutine ice_step use ice_diagnostics, only: init_mass_diags, runtime_diags use ice_diagnostics_bgc, only: hbrine_diags, zsal_diags, bgc_diags use ice_domain, only: halo_info, nblocks - use ice_domain_size, only: nslyr use ice_dyn_eap, only: write_restart_eap use ice_dyn_shared, only: kdyn use ice_flux, only: scale_factor, init_history_therm, & @@ -147,7 +146,6 @@ subroutine ice_step write_restart_bgc, write_restart_hbrine use ice_restart_driver, only: dumpfile use ice_restoring, only: restore_ice, ice_HaloRestore - use ice_state, only: trcrn use ice_step_mod, only: prep_radiation, step_therm1, step_therm2, & update_state, step_dyn_horiz, step_dyn_ridge, step_radiation, & biogeochemistry @@ -202,7 +200,7 @@ subroutine ice_step ! Scale radiation fields !----------------------------------------------------------------- - if (calc_Tsfc) call prep_radiation (dt, iblk) + if (calc_Tsfc) call prep_radiation (iblk) !----------------------------------------------------------------- ! thermodynamics and biogeochemistry @@ -280,9 +278,9 @@ subroutine ice_step call ice_timer_start(timer_diags) ! diagnostics if (mod(istep,diagfreq) == 0) then call runtime_diags(dt) ! log file - if (solve_zsal) call zsal_diags(dt) - if (skl_bgc .or. z_tracers) call bgc_diags (dt) - if (tr_brine) call hbrine_diags(dt) + if (solve_zsal) call zsal_diags + if (skl_bgc .or. z_tracers) call bgc_diags + if (tr_brine) call hbrine_diags endif call ice_timer_stop(timer_diags) ! diagnostics @@ -321,20 +319,24 @@ subroutine coupling_prep (iblk) use ice_arrays_column, only: alvdfn, alidfn, alvdrn, alidrn, & albicen, albsnon, albpndn, apeffn, fzsal_g, fzsal, snowfracn - use ice_blocks, only: block, nx_block, ny_block + use ice_blocks, only: nx_block, ny_block use ice_calendar, only: dt, nstreams use ice_domain_size, only: ncat use ice_flux, only: alvdf, alidf, alvdr, alidr, albice, albsno, & - albpnd, albcnt, apeff_ai, coszen, fpond, fresh, l_mpond_fresh, & + albpnd, albcnt, apeff_ai, fpond, fresh, l_mpond_fresh, & alvdf_ai, alidf_ai, alvdr_ai, alidr_ai, fhocn_ai, & fresh_ai, fsalt_ai, fsalt, & fswthru_ai, fhocn, fswthru, scale_factor, snowfrac, & swvdr, swidr, swvdf, swidf, Tf, Tair, Qa, strairxT, strairyt, & fsens, flat, fswabs, flwout, evap, Tref, Qref, & - fsurfn_f, flatn_f, scale_fluxes, frzmlt_init, frzmlt + scale_fluxes, frzmlt_init, frzmlt use ice_flux_bgc, only: faero_ocn, fzsal_ai, fzsal_g_ai, flux_bio, flux_bio_ai use ice_grid, only: tmask - use ice_state, only: aicen, aice, aice_init + use ice_state, only: aicen, aice +#ifdef CICE_IN_NEMO + use ice_state, only: aice_init + use ice_flux, only: flatn_f, fsurfn_f +#endif use ice_step_mod, only: ocean_mixed_layer use ice_timers, only: timer_couple, ice_timer_start, ice_timer_stop @@ -510,6 +512,7 @@ subroutine coupling_prep (iblk) fzsal (:,:,iblk), fzsal_g (:,:,iblk), & flux_bio(:,:,1:nbtrcr,iblk)) +#ifdef CICE_IN_NEMO !echmod - comment this out for efficiency, if .not. calc_Tsfc if (.not. calc_Tsfc) then @@ -525,11 +528,13 @@ subroutine coupling_prep (iblk) fresh (:,:,iblk), fhocn (:,:,iblk)) endif !echmod - +#endif call ice_timer_stop(timer_couple) ! atm/ocn coupling end subroutine coupling_prep +#ifdef CICE_IN_NEMO + !======================================================================= ! ! If surface heat fluxes are provided to CICE instead of CICE calculating @@ -569,7 +574,6 @@ subroutine sfcflux_to_ocn(nx_block, ny_block, & fresh , & ! fresh water flux to ocean (kg/m2/s) fhocn ! actual ocn/ice heat flx (W/m**2) -#ifdef CICE_IN_NEMO ! local variables integer (kind=int_kind) :: & @@ -598,10 +602,11 @@ subroutine sfcflux_to_ocn(nx_block, ny_block, & enddo ! j enddo ! n -#endif end subroutine sfcflux_to_ocn +#endif + !======================================================================= end module CICE_RunMod diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 7279987e9..1bf76f722 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -114,16 +114,16 @@ subroutine init_shortwave kaer_tab, waer_tab, gaer_tab, kaer_bc_tab, waer_bc_tab, gaer_bc_tab, bcenh, & swgrid, igrid use ice_blocks, only: block, get_block, nx_block, ny_block - use ice_calendar, only: nstreams, istep1, dt, calendar_type, & + use ice_calendar, only: dt, calendar_type, & days_per_year, nextsw_cday, yday, sec - use ice_communicate, only: my_task, master_task + use ice_communicate, only: my_task use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, & diagnostic_abort use ice_domain, only: nblocks, blocks_ice use ice_flux, only: alvdf, alidf, alvdr, alidr, & alvdr_ai, alidr_ai, alvdf_ai, alidf_ai, & swvdr, swvdf, swidr, swidf, scale_factor, snowfrac, & - albice, albsno, albpnd, apeff_ai, albcnt, coszen, fsnow + albice, albsno, albpnd, apeff_ai, coszen, fsnow use ice_grid, only: tlat, tlon, tmask use ice_restart_shared, only: restart, runtype use ice_state, only: aicen, vicen, vsnon, trcrn @@ -135,7 +135,6 @@ subroutine init_shortwave n ! thickness category index real (kind=dbl_kind) :: & - cszn , & ! counter for history averaging netsw ! flag for shortwave radiation presence type (block) :: & @@ -147,8 +146,6 @@ subroutine init_shortwave dEdd_algae, & ! from icepack modal_aero ! from icepack - character (char_len) :: stop_label - character (char_len) :: shortwave integer (kind=int_kind) :: & @@ -186,7 +183,7 @@ subroutine init_shortwave file=__FILE__,line= __LINE__) !!$OMP PARALLEL DO PRIVATE(iblk,i,j,n,ilo,ihi,jlo,jhi,this_block, & - !!$OMP cszn,l_print_point,debug,ipoint) + !!$OMP l_print_point,debug,ipoint) do iblk=1,nblocks ! Initialize @@ -510,11 +507,7 @@ subroutine init_bgc() ocean_bio_all, ice_bio_net, snow_bio_net, & cgrid, igrid, bphi, iDi, bTiz, iki, & Rayleigh_criteria, Rayleigh_real - use ice_blocks, only: block, get_block, nx_block, ny_block - use ice_calendar, only: dt, istep1 - use ice_communicate, only: my_task - use ice_diagnostics, only: npnt, print_points, pmloc, piloc, pjloc, & - diagnostic_abort + use ice_blocks, only: block, get_block use ice_domain, only: nblocks, blocks_ice use ice_flux, only: sss use ice_flux_bgc, only: nit, amm, sil, dmsp, dms, algalN, & @@ -522,28 +515,23 @@ subroutine init_bgc() use ice_forcing_bgc, only: init_bgc_data, get_forcing_bgc use ice_restart_column, only: restart_zsal, & read_restart_bgc, restart_bgc - use ice_state, only: trcrn, aicen, vicen, vsnon + use ice_state, only: trcrn ! local variables integer (kind=int_kind) :: & i, j, iblk , & ! horizontal indices ilo,ihi,jlo,jhi , & ! beginning and end of physical domain - k,m , & ! vertical index - n , & ! category index - ipoint + k , & ! vertical index + n ! category index integer (kind=int_kind) :: & max_nbtrcr, max_algae, max_don, max_doc, max_dic, max_aero, max_fe logical (kind=log_kind) :: & - l_print_point, & ! flag to print designated grid point diagnostics - debug , & ! prints debugging output if true RayleighC , & solve_zsal - character (char_len) :: stop_label - type (block) :: & this_block ! block information for current block @@ -955,11 +943,11 @@ subroutine init_zbgc ! R_chl2N , & ! 3 algal chlorophyll to N (mg/mmol) F_abs_chl ! to scale absorption in Dedd - real (kind=dbl_kind), dimension(icepack_max_don) :: & ! increase compare to algal R_Fe2C - R_C2N_DON +! real (kind=dbl_kind), dimension(icepack_max_don) :: & ! increase compare to algal R_Fe2C +! R_C2N_DON real (kind=dbl_kind), dimension(icepack_max_algae) :: & - R_Si2N , & ! algal Sil to N (mole/mole) +! R_Si2N , & ! algal Sil to N (mole/mole) R_S2N , & ! algal S to N (mole/mole) ! Marchetti et al 2006, 3 umol Fe/mol C for iron limited Pseudo-nitzschia R_Fe2C , & ! algal Fe to carbon (umol/mmol) @@ -972,13 +960,13 @@ subroutine init_zbgc R_Fe2DOC ! Fe to C of DOC (nmol/umol) real (kind=dbl_kind), dimension(icepack_max_algae) :: & - chlabs , & ! chla absorption 1/m/(mg/m^3) - alpha2max_low , & ! light limitation (1/(W/m^2)) - beta2max , & ! light inhibition (1/(W/m^2)) - mu_max , & ! maximum growth rate (1/d) - grow_Tdep , & ! T dependence of growth (1/C) - fr_graze , & ! fraction of algae grazed - mort_pre , & ! mortality (1/day) +! chlabs , & ! chla absorption 1/m/(mg/m^3) +! alpha2max_low , & ! light limitation (1/(W/m^2)) +! beta2max , & ! light inhibition (1/(W/m^2)) +! mu_max , & ! maximum growth rate (1/d) +! grow_Tdep , & ! T dependence of growth (1/C) +! fr_graze , & ! fraction of algae grazed +! mort_pre , & ! mortality (1/day) mort_Tdep , & ! T dependence of mortality (1/C) k_exude , & ! algal carbon exudation rate (1/d) K_Nit , & ! nitrate half saturation (mmol/m^3) @@ -992,7 +980,7 @@ subroutine init_zbgc f_don_Am ! fraction of remineralized DON to Am real (kind=dbl_kind), dimension(icepack_max_DOC) :: & - f_doc , & ! fraction of mort_N that goes to each doc pool +! f_doc , & ! fraction of mort_N that goes to each doc pool f_exude , & ! fraction of exuded carbon to each DOC pool k_bac ! Bacterial degredation of DOC (1/d) @@ -1725,9 +1713,9 @@ subroutine init_zbgc !----------------------------------------------------------------- ! Define array parameters !----------------------------------------------------------------- - R_Si2N(1) = ratio_Si2N_diatoms - R_Si2N(2) = ratio_Si2N_sp - R_Si2N(3) = ratio_Si2N_phaeo +! R_Si2N(1) = ratio_Si2N_diatoms +! R_Si2N(2) = ratio_Si2N_sp +! R_Si2N(3) = ratio_Si2N_phaeo R_S2N(1) = ratio_S2N_diatoms R_S2N(2) = ratio_S2N_sp @@ -1760,33 +1748,33 @@ subroutine init_zbgc R_Fe2DOC(2) = ratio_Fe2DOC_l R_Fe2DOC(3) = c0 - chlabs(1) = chlabs_diatoms - chlabs(2) = chlabs_sp - chlabs(3) = chlabs_phaeo +! chlabs(1) = chlabs_diatoms +! chlabs(2) = chlabs_sp +! chlabs(3) = chlabs_phaeo - alpha2max_low(1) = alpha2max_low_diatoms - alpha2max_low(2) = alpha2max_low_sp - alpha2max_low(3) = alpha2max_low_phaeo +! alpha2max_low(1) = alpha2max_low_diatoms +! alpha2max_low(2) = alpha2max_low_sp +! alpha2max_low(3) = alpha2max_low_phaeo - beta2max(1) = beta2max_diatoms - beta2max(2) = beta2max_sp - beta2max(3) = beta2max_phaeo +! beta2max(1) = beta2max_diatoms +! beta2max(2) = beta2max_sp +! beta2max(3) = beta2max_phaeo - mu_max(1) = mu_max_diatoms - mu_max(2) = mu_max_sp - mu_max(3) = mu_max_phaeo +! mu_max(1) = mu_max_diatoms +! mu_max(2) = mu_max_sp +! mu_max(3) = mu_max_phaeo - grow_Tdep(1) = grow_Tdep_diatoms - grow_Tdep(2) = grow_Tdep_sp - grow_Tdep(3) = grow_Tdep_phaeo +! grow_Tdep(1) = grow_Tdep_diatoms +! grow_Tdep(2) = grow_Tdep_sp +! grow_Tdep(3) = grow_Tdep_phaeo - fr_graze(1) = fr_graze_diatoms - fr_graze(2) = fr_graze_sp - fr_graze(3) = fr_graze_phaeo +! fr_graze(1) = fr_graze_diatoms +! fr_graze(2) = fr_graze_sp +! fr_graze(3) = fr_graze_phaeo - mort_pre(1) = mort_pre_diatoms - mort_pre(2) = mort_pre_sp - mort_pre(3) = mort_pre_phaeo +! mort_pre(1) = mort_pre_diatoms +! mort_pre(2) = mort_pre_sp +! mort_pre(3) = mort_pre_phaeo mort_Tdep(1) = mort_Tdep_diatoms mort_Tdep(2) = mort_Tdep_sp diff --git a/cicecore/shared/ice_restart_column.F90 b/cicecore/shared/ice_restart_column.F90 index 8a52475e9..2f133b204 100644 --- a/cicecore/shared/ice_restart_column.F90 +++ b/cicecore/shared/ice_restart_column.F90 @@ -12,7 +12,7 @@ module ice_restart_column use ice_communicate, only: my_task, master_task use ice_constants, only: c0, c1, p5 use ice_constants, only: field_loc_center, field_type_scalar - use ice_domain_size, only: ncat, nilyr, nslyr, max_blocks, nblyr + use ice_domain_size, only: ncat, nblyr use ice_restart,only: read_restart_field, write_restart_field use ice_exit, only: abort_ice use ice_fileunits, only: nu_diag @@ -711,7 +711,7 @@ end subroutine write_restart_hbrine subroutine write_restart_bgc() use ice_arrays_column, only: Rayleigh_criteria, Rayleigh_real - use ice_blocks, only: block, get_block, nx_block, ny_block + use ice_blocks, only: block, get_block use ice_domain, only: nblocks, blocks_ice use ice_domain_size, only: ncat, n_algae, n_doc, n_dic, & n_don, n_zaero, n_fed, n_fep @@ -729,8 +729,6 @@ subroutine write_restart_bgc() mm , & ! n_algae ilo,ihi,jlo,jhi ! beginning and end of physical domain - real (kind=dbl_kind) :: cszn ! counter for history averaging - logical (kind=log_kind) :: diag character (len=3) :: nchar, ncharb @@ -771,9 +769,6 @@ subroutine write_restart_bgc() type (block) :: & this_block ! block information for current block - integer (kind=int_kind) :: & - ipoint - call icepack_query_parameters(skl_bgc_out=skl_bgc, solve_zsal_out=solve_zsal) call icepack_query_tracer_numbers(nbtrcr_out=nbtrcr) call icepack_query_tracer_flags(tr_bgc_Nit_out=tr_bgc_Nit, & diff --git a/configuration/scripts/machines/Macros.hobart_nag b/configuration/scripts/machines/Macros.hobart_nag new file mode 100755 index 000000000..89aff4016 --- /dev/null +++ b/configuration/scripts/machines/Macros.hobart_nag @@ -0,0 +1,51 @@ +#============================================================================== +# Makefile macros for NCAR hobart, NAG compiler +#============================================================================== + +CPP := /usr/bin/cpp +CPPFLAGS := -P -traditional +CPPDEFS := -DFORTRANUNDERSCORE -DNO_CRAY_POINTERS -DNO_SHR_VMATH -DCPRNAG $(ICE_CPPDEFS) +CFLAGS := -std=gnu99 + +FIXEDFLAGS := -fixed +FREEFLAGS := -free +FFLAGS := -Wp,-macro=no_com -convert=BIG_ENDIAN -ieee=full -O2 -wmismatch=mpi_bcast,mpi_isend,mpi_irecv,mpi_send,mpi_recv,mpi_allreduce -gline + +FFLAGS_NOOPT:= -Wp,-macro=no_com -convert=BIG_ENDIAN -ieee=full -wmismatch=mpi_bcast,mpi_isend,mpi_irecv,mpi_send,mpi_recv,mpi_allreduce -gline +FC_AUTO_R8 := -r8 + +ifeq ($(ICE_BLDDEBUG), true) + FFLAGS := -Wp,-macro=no_com -convert=BIG_ENDIAN -wmismatch=mpi_bcast,mpi_isend,mpi_irecv,mpi_send,mpi_recv,mpi_allreduce -gline -C=all -nan -g -time -f2003 -ieee=stop +endif + +ifeq ($(ICE_COMMDIR), mpi) + FC := mpif90 +else + FC := nagfor +endif + +MPICC:= mpicc + +MPIFC:= mpif90 +LD:= $(MPIFC) + +NETCDF_PATH := /usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0 + +INCLDIR := -I/usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0/include -I/cluster/mvapich2-2.2rc1-gcc-g++-4.8.5-nag-6.1/include + +LIB_NETCDF := $(NETCDF_PATH)/lib +LIB_PNETCDF := $(PNETCDF_PATH)/lib +LIB_MPI := $(IMPILIBDIR) + +SLIBS := -L/usr/local/nag-6.2/lib/NAG_Fortran -L$(LIB_NETCDF) -lnetcdf -lnetcdff -L/usr/lib64 -llapack -lblas + +SCC:= nagcc + +SFC:= nagfor + +## if using parallel I/O, load all 3 libraries. PIO must be first! +ifeq ($(IO_TYPE), pio) + PIO_PATH:= + INCLDIR += -I + SLIBS := $(SLIB) -L$(PIO_PATH) -lpiof +endif diff --git a/configuration/scripts/machines/env.hobart_intel b/configuration/scripts/machines/env.hobart_intel new file mode 100755 index 000000000..bce3924fe --- /dev/null +++ b/configuration/scripts/machines/env.hobart_intel @@ -0,0 +1,17 @@ +#!/bin/csh -f + +source /usr/share/Modules/init/csh + +module purge +module load compiler/intel/default + +setenv ICE_MACHINE_ENVNAME hobart +setenv ICE_MACHINE_COMPILER ifort +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /scratch/cluster/$user/CICE_RUNS +setenv ICE_MACHINE_INPUTDATA /fs/cgd/csm/inputdata +setenv ICE_MACHINE_BASELINE /scratch/cluster/$user/CICE_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_TPNODE 24 +setenv ICE_MACHINE_BLDTHRDS 1 diff --git a/configuration/scripts/machines/env.hobart_nag b/configuration/scripts/machines/env.hobart_nag new file mode 100755 index 000000000..1014d0636 --- /dev/null +++ b/configuration/scripts/machines/env.hobart_nag @@ -0,0 +1,17 @@ +#!/bin/csh -f + +source /usr/share/Modules/init/csh + +module purge +module load compiler/nag/6.1 + +setenv ICE_MACHINE_ENVNAME hobart +setenv ICE_MACHINE_COMPILER nag +setenv ICE_MACHINE_MAKE gmake +setenv ICE_MACHINE_WKDIR /scratch/cluster/$user/CICE_RUNS +setenv ICE_MACHINE_INPUTDATA /fs/cgd/csm/inputdata +setenv ICE_MACHINE_BASELINE /scratch/cluster/$user/CICE_BASELINE +setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_TPNODE 24 +setenv ICE_MACHINE_BLDTHRDS 1 diff --git a/icepack b/icepack index 0fcee3aa2..dbc3ce8b0 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit 0fcee3aa27e44111cabd2488074806eda5db7edd +Subproject commit dbc3ce8b01c878d50f531ce84869fb2f2634228f From 8864f0e906b3e5522a911b186d60a46b09347dd6 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 10:27:55 -0600 Subject: [PATCH 03/21] Cleanup --- cicecore/cicedynB/general/ice_init.F90 | 2 ++ cicecore/drivers/cice/CICE_InitMod.F90 | 16 +++++++++------- icepack | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index ade3b2261..78ba62596 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -1315,6 +1315,8 @@ subroutine init_state enddo endif + trcr_base = c0 + do it = 1, ntrcr ! mask for base quantity on which tracers are carried if (trcr_depend(it) == 0) then ! area diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index c8c4a618d..b20caef17 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -93,7 +93,7 @@ subroutine cice_init call icepack_configure() ! initialize icepack call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(subname, & + if (icepack_warnings_aborted()) call abort_ice(trim(subname), & file=__FILE__,line= __LINE__) call input_data ! namelist variables @@ -123,11 +123,11 @@ subroutine cice_init call init_thermo_vertical ! initialize vertical thermodynamics call icepack_init_itd(ncat, hin_max) ! ice thickness distribution -! if (my_task == master_task) then + if (my_task == master_task) then call icepack_init_itd_hist(ncat, hin_max, c_hi_range) ! output -! endif + endif call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & + if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & file=__FILE__, line=__LINE__) call calendar(time) ! determine the initial date @@ -146,7 +146,7 @@ subroutine cice_init call icepack_query_parameters(skl_bgc_out=skl_bgc, z_tracers_out=z_tracers) call icepack_query_tracer_flags(tr_aero_out=tr_aero, tr_zaero_out=tr_zaero) call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(subname, & + if (icepack_warnings_aborted()) call abort_ice(trim(subname), & file=__FILE__,line= __LINE__) if (tr_aero .or. tr_zaero) call faero_optics !initialize aerosol optical @@ -234,6 +234,8 @@ subroutine init_restart nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, & nt_iage, nt_FY, nt_aero + character(len=*),parameter :: subname = '(init_restart)' + call icepack_query_parameters(skl_bgc_out=skl_bgc, & z_tracers_out=z_tracers, solve_zsal_out=solve_zsal) call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, & @@ -243,7 +245,7 @@ subroutine init_restart nt_apnd_out=nt_apnd, nt_hpnd_out=nt_hpnd, nt_ipnd_out=nt_ipnd, & nt_iage_out=nt_iage, nt_FY_out=nt_FY, nt_aero_out=nt_aero) call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & + if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & file=__FILE__, line=__LINE__) if (trim(runtype) == 'continue') then @@ -398,7 +400,7 @@ subroutine init_restart !$OMP END PARALLEL DO call icepack_warnings_flush(nu_diag) - if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & + if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & file=__FILE__, line=__LINE__) end subroutine init_restart diff --git a/icepack b/icepack index dbc3ce8b0..bc13d5274 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit dbc3ce8b01c878d50f531ce84869fb2f2634228f +Subproject commit bc13d52749f98757a9f013bf7bcf6fdddbb4a19d From 894f85c4ce08d987639d088c22a9fbf99e08346a Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 11:02:29 -0600 Subject: [PATCH 04/21] Remove icepack from commit --- icepack | 1 - 1 file changed, 1 deletion(-) delete mode 160000 icepack diff --git a/icepack b/icepack deleted file mode 160000 index bc13d5274..000000000 --- a/icepack +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bc13d52749f98757a9f013bf7bcf6fdddbb4a19d From 25b603c9004a8efab02cfe3b97f5179c323f287d Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 11:24:46 -0600 Subject: [PATCH 05/21] Reset icepack master --- .gitmodules | 3 +-- icepack | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) create mode 160000 icepack diff --git a/.gitmodules b/.gitmodules index 9e463fcec..712129547 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,3 @@ [submodule "icepack"] path = icepack - url = https://github.com/cice-consortium/icepack.git - branch = master + url = https://github.com/CICE-Consortium/Icepack diff --git a/icepack b/icepack new file mode 160000 index 000000000..bc13d5274 --- /dev/null +++ b/icepack @@ -0,0 +1 @@ +Subproject commit bc13d52749f98757a9f013bf7bcf6fdddbb4a19d From 93e470a042f2179595608ea22efc86501f659331 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 11:26:21 -0600 Subject: [PATCH 06/21] Fix --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 712129547..29d97c6a6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "icepack"] path = icepack - url = https://github.com/CICE-Consortium/Icepack + url = https://github.com/cice-consortium/icepack.git From 7021d1338dde6320f23ccdc9e5401a6e16580a52 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 11:27:06 -0600 Subject: [PATCH 07/21] Fix --- .gitmodules | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitmodules b/.gitmodules index 29d97c6a6..9e463fcec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "icepack"] path = icepack url = https://github.com/cice-consortium/icepack.git + branch = master From c738e5e459890ff5f5a62ca508d30498143edc3d Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 12:36:08 -0600 Subject: [PATCH 08/21] Update icepack --- icepack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepack b/icepack index bc13d5274..24e1e4de1 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit bc13d52749f98757a9f013bf7bcf6fdddbb4a19d +Subproject commit 24e1e4de15abc4453997642877f29506d2f702f9 From 60bffa8b24cfd7d858f627778cb5e4292318ffba Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 12:55:47 -0600 Subject: [PATCH 09/21] fix --- icepack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepack b/icepack index 24e1e4de1..0fcee3aa2 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit 24e1e4de15abc4453997642877f29506d2f702f9 +Subproject commit 0fcee3aa27e44111cabd2488074806eda5db7edd From 4979014d22f44086b11b8cc71b35adc2bcfd001d Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 2 Apr 2018 13:35:45 -0600 Subject: [PATCH 10/21] Fix flush ifdef logic --- cicecore/shared/ice_fileunits.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cicecore/shared/ice_fileunits.F90 b/cicecore/shared/ice_fileunits.F90 index a92a8403b..57b32c97d 100644 --- a/cicecore/shared/ice_fileunits.F90 +++ b/cicecore/shared/ice_fileunits.F90 @@ -267,9 +267,10 @@ subroutine flush_fileunit(iunit) #ifdef CESMCOUPLED call shr_sys_flush(iunit) #else - flush(iunit) #if (defined AIX) call flush_(iunit) +#else + flush(iunit) #endif #endif From fe28cec492344972eec2109b264ec9b2bd62f4b6 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Tue, 1 May 2018 14:49:43 -0600 Subject: [PATCH 11/21] Uninitialized variables. --- cicecore/cicedynB/general/ice_flux.F90 | 8 ++++-- cicecore/cicedynB/general/ice_forcing.F90 | 15 ++++++++--- cicecore/cicedynB/general/ice_step_mod.F90 | 26 ++++++++++++++++--- cicecore/drivers/cice/CICE_InitMod.F90 | 4 +-- cicecore/drivers/cice/CICE_RunMod.F90 | 18 ++++++++++--- .../scripts/machines/Macros.hobart_nag | 7 ++--- icepack | 2 +- 7 files changed, 61 insertions(+), 19 deletions(-) diff --git a/cicecore/cicedynB/general/ice_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index de04972d6..1e7d2ccfb 100644 --- a/cicecore/cicedynB/general/ice_flux.F90 +++ b/cicecore/cicedynB/general/ice_flux.F90 @@ -329,7 +329,6 @@ module ice_flux subroutine init_coupler_flux use ice_arrays_column, only: Cdn_atm - use ice_constants, only: p001 use ice_flux_bgc, only: flux_bio_atm, flux_bio, faero_atm, & fnit, famm, fsil, fdmsp, fdms, fhum, fdust, falgalN, & fdoc, fdon, fdic, ffed, ffep @@ -442,6 +441,7 @@ subroutine init_coupler_flux uocn (:,:,:) = c0 ! surface ocean currents (m/s) vocn (:,:,:) = c0 frzmlt(:,:,:) = c0 ! freezing/melting potential (W/m^2) + frzmlt_init(:,:,:) = c0 ! freezing/melting potential (W/m^2) sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) do iblk = 1, size(Tf,3) @@ -470,6 +470,7 @@ subroutine init_coupler_flux fsens (:,:,:) = c0 flat (:,:,:) = c0 fswabs (:,:,:) = c0 + fswint_ai(:,:,:) = c0 flwout (:,:,:) = -stefan_boltzmann*Tffresh**4 ! in case atm model diagnoses Tsfc from flwout evap (:,:,:) = c0 @@ -515,6 +516,7 @@ subroutine init_coupler_flux coszen (:,:,:) = c0 ! Cosine of the zenith angle fsw (:,:,:) = c0 ! shortwave radiation (W/m^2) + fswfac (:,:,:) = c0 scale_factor(:,:,:) = c1 ! shortwave scaling factor wind (:,:,:) = sqrt(uatm(:,:,:)**2 & + vatm(:,:,:)**2) ! wind speed, (m/s) @@ -620,6 +622,7 @@ subroutine init_history_therm fsurf (:,:,:) = c0 fcondtop(:,:,:)= c0 congel (:,:,:) = c0 + fbot (:,:,:) = c0 frazil (:,:,:) = c0 snoice (:,:,:) = c0 dsnow (:,:,:) = c0 @@ -685,7 +688,7 @@ end subroutine init_history_therm subroutine init_history_dyn - use ice_state, only: aice, vice, trcr + use ice_state, only: aice, vice, trcr, strength logical (kind=log_kind) :: & tr_iage @@ -703,6 +706,7 @@ subroutine init_history_dyn sig2 (:,:,:) = c0 taubx (:,:,:) = c0 tauby (:,:,:) = c0 + strength (:,:,:) = c0 strocnx (:,:,:) = c0 strocny (:,:,:) = c0 strairx (:,:,:) = c0 diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 29f2607d7..28f4cebff 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -611,6 +611,8 @@ subroutine read_data (flag, recd, yr, ixm, ixx, ixp, & call ice_timer_start(timer_readwrite) ! reading/writing + field_data(:,:,:,:) = c0 + nbits = 64 ! double precision data if (istep1 > check_step) dbug = .true. !! debugging @@ -1221,7 +1223,6 @@ subroutine prepare_forcing (nx_block, ny_block, & ilo,ihi,jlo,jhi ! beginning and end of physical domain real (kind=dbl_kind), dimension(nx_block,ny_block), intent(in) :: & - Tair , & ! air temperature (K) ANGLET , & ! ANGLE converted to T-cells Tsfc , & ! ice skin temperature sst , & ! sea surface temperature @@ -1234,6 +1235,7 @@ subroutine prepare_forcing (nx_block, ny_block, & cldf , & ! cloud fraction frain , & ! rainfall rate (kg/m^2 s) fsnow , & ! snowfall rate (kg/m^2 s) + Tair , & ! air temperature (K) Qa , & ! specific humidity (kg/kg) rhoa , & ! air density (kg/m^3) uatm , & ! wind velocity components (m/s) @@ -1255,11 +1257,11 @@ subroutine prepare_forcing (nx_block, ny_block, & i, j real (kind=dbl_kind) :: workx, worky, & - precip_factor, zlvl0, secday, Tffresh + precip_factor, zlvl0, secday, Tffresh, puny logical (kind=log_kind) :: calc_strair - call icepack_query_parameters(Tffresh_out=Tffresh) + call icepack_query_parameters(Tffresh_out=Tffresh, puny_out=puny) call icepack_query_parameters(secday_out=secday) call icepack_query_parameters(calc_strair_out=calc_strair) call icepack_warnings_flush(nu_diag) @@ -1280,6 +1282,9 @@ subroutine prepare_forcing (nx_block, ny_block, & rhoa (i,j) = max(rhoa(i,j),c0) Qa (i,j) = max(Qa(i,j),c0) + if (rhoa(i,j) .lt. puny) rhoa(i,j) = 1.3_dbl_kind + if (Tair(i,j) .lt. puny) Tair(i,j) = Tffresh + if (Qa(i,j) .lt. puny) Qa(i,j) = 0.0035_dbl_kind enddo ! i enddo ! j @@ -3712,7 +3717,7 @@ subroutine ocn_data_hadgem(dt) ! and change units !----------------------------------------------------------------- - !$OMP PARALLEL DO PRIVATE(iblk,i,j) + !$OMP PARALLEL DO PRIVATE(iblk,i,j,workx,worky) do iblk = 1, nblocks do j = 1, ny_block do i = 1, nx_block @@ -3799,6 +3804,8 @@ subroutine read_data_nc_point (flag, recd, yr, ixm, ixx, ixp, & call ice_timer_start(timer_readwrite) ! reading/writing + field_data = c0 ! to satisfy intent(out) attribute + if (istep1 > check_step) dbug = .true. !! debugging if (my_task==master_task .and. (dbug)) then diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index 9ab8aa149..eb79924c9 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -75,6 +75,11 @@ subroutine prep_radiation (iblk) call ice_timer_start(timer_sw) ! shortwave + alvdr_init(:,:,:) = c0 + alvdf_init(:,:,:) = c0 + alidr_init(:,:,:) = c0 + alidf_init(:,:,:) = c0 + this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo ihi = this_block%ihi @@ -142,7 +147,7 @@ subroutine step_therm1 (dt, iblk) fswthru, meltt, melts, meltb, congel, snoice, & flatn_f, fsensn_f, fsurfn_f, fcondtopn_f use ice_flux_bgc, only: dsnown, faero_atm, faero_ocn - use ice_grid, only: lmask_n, lmask_s + use ice_grid, only: lmask_n, lmask_s, tmask use ice_state, only: aice, aicen, aice_init, aicen_init, vicen_init, & vice, vicen, vsno, vsnon, trcrn, uvel, vvel, vsnon_init @@ -267,6 +272,7 @@ subroutine step_therm1 (dt, iblk) enddo endif ! tr_aero + if (tmask(i,j,iblk)) & call icepack_step_therm1(dt, ncat, nilyr, nslyr, n_aero, & aicen_init (i,j,:,iblk), & vicen_init (i,j,:,iblk), vsnon_init (i,j,:,iblk), & @@ -518,7 +524,7 @@ subroutine update_state (dt, daidt, dvidt, dagedt, offset) ! Aggregate the updated state variables (includes ghost cells). !----------------------------------------------------------------- - if (tmask(i,j,iblk)) & +! if (tmask(i,j,iblk)) & call icepack_aggregate (ncat, aicen(i,j,:,iblk), & trcrn(i,j,1:ntrcr,:,iblk), & vicen(i,j,:,iblk), vsnon(i,j, :,iblk), & @@ -906,6 +912,8 @@ subroutine ocean_mixed_layer (dt, iblk) use ice_arrays_column, only: Cdn_atm, Cdn_atm_ratio use ice_blocks, only: nx_block, ny_block + use ice_blocks, only: block, get_block + use ice_domain, only: blocks_ice use ice_flux, only: sst, Tf, Qa, uatm, vatm, wind, potT, rhoa, zlvl, & frzmlt, fhocn, fswthru, flw, flwout_ocn, fsens_ocn, flat_ocn, evap_ocn, & alvdr_ocn, alidr_ocn, alvdf_ocn, alidf_ocn, swidf, swvdf, swidr, swvdr, & @@ -927,6 +935,7 @@ subroutine ocean_mixed_layer (dt, iblk) frzmlt_max = c1000 ! max magnitude of frzmlt (W/m^2) integer (kind=int_kind) :: & + ilo,ihi,jlo,jhi, & ! beginning and end of physical domain i, j , & ! horizontal indices ij ! combined ij index @@ -942,6 +951,8 @@ subroutine ocean_mixed_layer (dt, iblk) integer (kind=int_kind), dimension(nx_block*ny_block) :: & indxi, indxj ! compressed indices for ocean cells + type (block) :: & + this_block ! block information for current block !----------------------------------------------------------------- @@ -958,8 +969,15 @@ subroutine ocean_mixed_layer (dt, iblk) icells = 0 indxi(:) = 0 indxj(:) = 0 - do j = 1, ny_block - do i = 1, nx_block + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + + do j = jlo, jhi + do i = ilo, ihi if (tmask(i,j,iblk)) then icells = icells + 1 indxi(icells) = i diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index c3dfbeaf2..95fe717f6 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -123,9 +123,9 @@ subroutine cice_init call init_thermo_vertical ! initialize vertical thermodynamics call icepack_init_itd(ncat, hin_max) ! ice thickness distribution - if (my_task == master_task) then +! if (my_task == master_task) then call icepack_init_itd_hist(ncat, hin_max, c_hi_range) ! output - endif +! endif call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & file=__FILE__, line=__LINE__) diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index 15727d761..4b6418b16 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -319,7 +319,8 @@ subroutine coupling_prep (iblk) use ice_arrays_column, only: alvdfn, alidfn, alvdrn, alidrn, & albicen, albsnon, albpndn, apeffn, fzsal_g, fzsal, snowfracn - use ice_blocks, only: nx_block, ny_block + use ice_blocks, only: nx_block, ny_block, get_block, block + use ice_domain, only: blocks_ice use ice_calendar, only: dt, nstreams use ice_domain_size, only: ncat use ice_flux, only: alvdf, alidf, alvdr, alidr, albice, albsno, & @@ -346,11 +347,15 @@ subroutine coupling_prep (iblk) ! local variables integer (kind=int_kind) :: & + ilo,ihi,jlo,jhi, & ! beginning and end of physical domain n , & ! thickness category index i,j , & ! horizontal indices k , & ! tracer index nbtrcr ! + type (block) :: & + this_block ! block information for current block + logical (kind=log_kind) :: & calc_Tsfc ! @@ -409,9 +414,16 @@ subroutine coupling_prep (iblk) enddo enddo enddo + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + do n = 1, ncat - do j = 1, ny_block - do i = 1, nx_block + do j = jlo, jhi + do i = ilo, ihi if (aicen(i,j,n,iblk) > puny) then alvdf(i,j,iblk) = alvdf(i,j,iblk) & diff --git a/configuration/scripts/machines/Macros.hobart_nag b/configuration/scripts/machines/Macros.hobart_nag index 89aff4016..92240457c 100755 --- a/configuration/scripts/machines/Macros.hobart_nag +++ b/configuration/scripts/machines/Macros.hobart_nag @@ -20,13 +20,14 @@ endif ifeq ($(ICE_COMMDIR), mpi) FC := mpif90 + MPIFC := mpif90 + MPICC := mpicc else FC := nagfor + MPIFC := nagfor + MPICC := cc endif -MPICC:= mpicc - -MPIFC:= mpif90 LD:= $(MPIFC) NETCDF_PATH := /usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0 diff --git a/icepack b/icepack index 2c042ac42..005df7de8 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit 2c042ac4213768e55791098110d2ef2ef845881a +Subproject commit 005df7de8e1b351a1c911de63012f19d153a7f15 From bd9bdd1e88fdbd9ce16adcd92f65edfdfb981494 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 4 May 2018 14:16:13 -0600 Subject: [PATCH 12/21] Additional initialization --- cicecore/drivers/cice/CICE_InitMod.F90 | 6 +++--- cicecore/shared/ice_init_column.F90 | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 95fe717f6..969a76718 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -123,9 +123,9 @@ subroutine cice_init call init_thermo_vertical ! initialize vertical thermodynamics call icepack_init_itd(ncat, hin_max) ! ice thickness distribution -! if (my_task == master_task) then + if (my_task == master_task) then call icepack_init_itd_hist(ncat, hin_max, c_hi_range) ! output -! endif + endif call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & file=__FILE__, line=__LINE__) @@ -292,7 +292,7 @@ subroutine init_restart call read_restart_lvl else do iblk = 1, nblocks - call init_lvl(trcrn(:,:,nt_alvl,:,iblk), & + call init_lvl(iblk,trcrn(:,:,nt_alvl,:,iblk), & trcrn(:,:,nt_vlvl,:,iblk)) enddo ! iblk endif diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 1bf76f722..ee15c4694 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -420,16 +420,21 @@ end subroutine init_FY ! Initialize ice lvl tracers (call prior to reading restart data) - subroutine init_lvl(alvl, vlvl) + subroutine init_lvl(iblk, alvl, vlvl) - use ice_constants, only: c1 + use ice_constants, only: c0, c1 + use ice_arrays_column, only: ffracn, dhsn - real(kind=dbl_kind), dimension(:,:,:), intent(out) :: & + integer (kind=int_kind), intent(in) :: iblk + + real (kind=dbl_kind), dimension(:,:,:), intent(out) :: & alvl , & ! level ice area fraction vlvl ! level ice volume alvl(:,:,:) = c1 ! level ice area fraction vlvl(:,:,:) = c1 ! level ice volume + ffracn(:,:,:,iblk) = c0 + dhsn(:,:,:,iblk) = c0 end subroutine init_lvl From 3c6305ddd81ba05e133df7c48f91101710d95892 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 16 May 2018 10:21:04 -0600 Subject: [PATCH 13/21] Update dummy --- cicecore/cicedynB/general/ice_forcing.F90 | 24 ++++++- configuration/scripts/ice_in | 82 +++++++++++------------ 2 files changed, 62 insertions(+), 44 deletions(-) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 28f4cebff..79f932cb5 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -162,6 +162,21 @@ subroutine init_forcing_atmo ! Determine the current and final year of the forcing cycle based on ! namelist input; initialize the atmospheric forcing data filenames. + fsw_data(:,:,:,:) = c0 + cldf_data(:,:,:,:) = c0 + fsnow_data(:,:,:,:) = c0 + Tair_data(:,:,:,:) = c0 + uatm_data(:,:,:,:) = c0 + vatm_data(:,:,:,:) = c0 + wind_data(:,:,:,:) = c0 + strax_data(:,:,:,:) = c0 + stray_data(:,:,:,:) = c0 + Qa_data(:,:,:,:) = c0 + rhoa_data(:,:,:,:) = c0 + flw_data(:,:,:,:) = c0 + sublim_data(:,:,:,:) = c0 + frain_data(:,:,:,:) = c0 + fyear = fyear_init + mod(nyr-1,ycycle) ! current year fyear_final = fyear_init + ycycle - 1 ! last year in forcing cycle @@ -239,6 +254,11 @@ subroutine init_forcing_ocn(dt) if (icepack_warnings_aborted()) call abort_ice(error_message="subname", & file=__FILE__, line=__LINE__) + sst_data(:,:,:,:) = c0 + sss_data(:,:,:,:) = c0 + uocn_data(:,:,:,:) = c0 + vocn_data(:,:,:,:) = c0 + nbits = 64 ! double precision data if (restore_sst .or. restore_bgc) then @@ -590,7 +610,7 @@ subroutine read_data (flag, recd, yr, ixm, ixx, ixp, & maxrec ! maximum record value real (kind=dbl_kind), dimension(nx_block,ny_block,2,max_blocks), & - intent(out) :: & + intent(inout) :: & field_data ! 2 values needed for interpolation integer (kind=int_kind), intent(in) :: & @@ -611,8 +631,6 @@ subroutine read_data (flag, recd, yr, ixm, ixx, ixp, & call ice_timer_start(timer_readwrite) ! reading/writing - field_data(:,:,:,:) = c0 - nbits = 64 ! double precision data if (istep1 > check_step) dbug = .true. !! debugging diff --git a/configuration/scripts/ice_in b/configuration/scripts/ice_in index b03107ed9..47c9b1c8c 100644 --- a/configuration/scripts/ice_in +++ b/configuration/scripts/ice_in @@ -50,18 +50,6 @@ kcatbound = 0 / -&domain_nml - nprocs = 4 - processor_shape = 'slenderX2' - distribution_type = 'cartesian' - distribution_wght = 'latitude' - ew_boundary_type = 'cyclic' - ns_boundary_type = 'open' - maskhalo_dyn = .false. - maskhalo_remap = .false. - maskhalo_bound = .false. -/ - &tracer_nml tr_iage = .true. restart_age = .false. @@ -133,6 +121,47 @@ pndaspect = 0.8 / +&forcing_nml + formdrag = .false. + atmbndy = 'default' + fyear_init = 1997 + ycycle = 1 + atm_data_format = 'bin' + atm_data_type = 'ncar' + atm_data_dir = '/glade/u/home/tcraig/cice_data/' + calc_strair = .true. + highfreq = .false. + natmiter = 5 + calc_Tsfc = .true. + precip_units = 'mm_per_month' + ustar_min = 0.0005 + fbot_xfer_type = 'constant' + update_ocn_f = .false. + l_mpond_fresh = .false. + tfrz_option = 'mushy' + oceanmixed_ice = .true. + ocn_data_format = 'bin' + sss_data_type = 'default' + sst_data_type = 'default' + ocn_data_dir = 'unknown_ocn_data_dir' + oceanmixed_file = 'unknown_oceanmixed_file' + restore_sst = .false. + trestore = 90 + restore_ice = .false. +/ + +&domain_nml + nprocs = 4 + processor_shape = 'slenderX2' + distribution_type = 'cartesian' + distribution_wght = 'latitude' + ew_boundary_type = 'cyclic' + ns_boundary_type = 'open' + maskhalo_dyn = .false. + maskhalo_remap = .false. + maskhalo_bound = .false. +/ + &zbgc_nml tr_brine = .false. restart_hbrine = .false. @@ -286,35 +315,6 @@ ratio_C2N_proteins = 7.0 / -&forcing_nml - formdrag = .false. - atmbndy = 'default' - fyear_init = 1997 - ycycle = 1 - atm_data_format = 'bin' - atm_data_type = 'ncar' - atm_data_dir = '/glade/u/home/tcraig/cice_data/' - calc_strair = .true. - highfreq = .false. - natmiter = 5 - calc_Tsfc = .true. - precip_units = 'mm_per_month' - ustar_min = 0.0005 - fbot_xfer_type = 'constant' - update_ocn_f = .false. - l_mpond_fresh = .false. - tfrz_option = 'mushy' - oceanmixed_ice = .true. - ocn_data_format = 'bin' - sss_data_type = 'default' - sst_data_type = 'default' - ocn_data_dir = 'unknown_ocn_data_dir' - oceanmixed_file = 'unknown_oceanmixed_file' - restore_sst = .false. - trestore = 90 - restore_ice = .false. -/ - &icefields_nml f_tmask = .true. f_blkmask = .true. From cb9e3c9bd8e11c54f2eee4baca6a23a36a59da22 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Mon, 4 Jun 2018 10:41:10 -0600 Subject: [PATCH 14/21] more dummy fixes --- cicecore/cicedynB/general/ice_forcing.F90 | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 20a5f7feb..04d4dfbbd 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -929,7 +929,7 @@ subroutine read_clim_data (readflag, recd, ixm, ixx, ixp, & field_type ! type of field (scalar, vector, angle) real (kind=dbl_kind), dimension(nx_block,ny_block,2,max_blocks), & - intent(out) :: & + intent(inout) :: & field_data ! 2 values needed for interpolation ! local variables @@ -3658,16 +3658,8 @@ subroutine ocn_data_oned use ice_flux, only: sss, sst, Tf, uocn, vocn, ss_tltx, ss_tlty, & qdp, hmix, frzmlt -<<<<<<< HEAD -======= - real (kind=dbl_kind), intent(in) :: & - dt ! time step - - integer :: i, j, iblk - character(len=*), parameter :: subname = '(ocn_data_oned)' ->>>>>>> 3c30e23f9da072174974ecf4eb7b8d46a6cf8473 sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) call ocn_freezing_temperature @@ -3904,7 +3896,7 @@ subroutine read_data_nc_point (flag, recd, yr, ixm, ixx, ixp, & field_type ! type of field (scalar, vector, angle) real (kind=dbl_kind), dimension(2), & - intent(out) :: & + intent(inout) :: & field_data ! 2 values needed for interpolation character(len=*), parameter :: subname = '(read_data_nc_point)' @@ -4125,12 +4117,8 @@ subroutine ISPOL_data logical (kind=log_kind) :: read1 -<<<<<<< HEAD -======= character(len=*), parameter :: subname = '(ISPOL_data)' - diag = .false. ! write diagnostic information ->>>>>>> 3c30e23f9da072174974ecf4eb7b8d46a6cf8473 call icepack_query_parameters(secday_out=secday) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & From 77aee28234b6b47cf775d68bcfe85b5d73a5ec8e Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 27 Jun 2018 15:37:46 -0600 Subject: [PATCH 15/21] More hobart changes --- configuration/scripts/machines/env.hobart_nag | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration/scripts/machines/env.hobart_nag b/configuration/scripts/machines/env.hobart_nag index 1014d0636..415a2e3d1 100755 --- a/configuration/scripts/machines/env.hobart_nag +++ b/configuration/scripts/machines/env.hobart_nag @@ -13,5 +13,6 @@ setenv ICE_MACHINE_INPUTDATA /fs/cgd/csm/inputdata setenv ICE_MACHINE_BASELINE /scratch/cluster/$user/CICE_BASELINE setenv ICE_MACHINE_SUBMIT "qsub" setenv ICE_MACHINE_ACCT P00000000 +setenv ICE_MACHINE_QUEUE "short" setenv ICE_MACHINE_TPNODE 24 setenv ICE_MACHINE_BLDTHRDS 1 From 25f6da3d67afbe20faeec641578c3f62d529d025 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 27 Jun 2018 15:54:57 -0600 Subject: [PATCH 16/21] Update Hobart Intel settings --- configuration/scripts/machines/Macros.hobart_intel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/scripts/machines/Macros.hobart_intel b/configuration/scripts/machines/Macros.hobart_intel index a01582f86..b81f38f04 100755 --- a/configuration/scripts/machines/Macros.hobart_intel +++ b/configuration/scripts/machines/Macros.hobart_intel @@ -15,7 +15,7 @@ FC_AUTO_R8 := -r8 FFLAGS_NOOPT:= ifeq ($(ICE_BLDDEBUG), true) - FFLAGS := -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created + FFLAGS := -qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source -O0 -g -check uninit -check bounds -check pointers -fpe0 -check noarg_temp_created endif ifeq ($(ICE_COMMDIR), mpi) From ef78774b4e76dc682718b1ad85d3f42bd01b0488 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 27 Jun 2018 15:58:01 -0600 Subject: [PATCH 17/21] Additional Hobart Intel changes --- configuration/scripts/machines/Macros.hobart_nag | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/configuration/scripts/machines/Macros.hobart_nag b/configuration/scripts/machines/Macros.hobart_nag index 6bf44b187..feb4b45f0 100755 --- a/configuration/scripts/machines/Macros.hobart_nag +++ b/configuration/scripts/machines/Macros.hobart_nag @@ -20,16 +20,6 @@ endif ifeq ($(ICE_COMMDIR), mpi) FC := mpif90 -<<<<<<< HEAD - MPIFC := mpif90 - MPICC := mpicc -else - FC := nagfor - MPIFC := nagfor - MPICC := cc -endif - -======= else FC := nagfor endif @@ -37,7 +27,6 @@ endif MPICC:= mpicc MPIFC:= mpif90 ->>>>>>> 360c4742223eebc65410489f3fc4b2d09f336a37 LD:= $(MPIFC) NETCDF_PATH := /usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0 From 263496a4c3911a5e7594017fcdfaa7d0be49cd35 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Wed, 22 Aug 2018 16:23:43 -0600 Subject: [PATCH 18/21] Update icepack --- icepack | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/icepack b/icepack index 0fcee3aa2..34224289a 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit 0fcee3aa27e44111cabd2488074806eda5db7edd +Subproject commit 34224289affc597bd49cdbc03465dadf90f65659 From c7942e259a43fc0095b303f21587afdde391fa12 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 24 Aug 2018 16:26:57 -0600 Subject: [PATCH 19/21] Some tweaks to dummy variables --- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 2 -- .../io/io_binary/ice_restart.F90 | 2 +- cicecore/drivers/cice/CICE_InitMod.F90 | 12 ---------- cicecore/shared/ice_fileunits.F90 | 8 ++----- cicecore/shared/ice_spacecurve.F90 | 24 ++++++++++++------- 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index 6f43bc2b7..b5041412c 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -688,8 +688,6 @@ subroutine init_bgc_data (fed1,fep1) character(len=*), parameter :: subname = '(init_bgc_data)' - nbits = 64 ! double precision data - !------------------------------------------------------------------- ! Annual average data from Tagliabue, 2012 (top 50 m average ! poisson grid filled on gx1v6 diff --git a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 index 7cc566c26..eaa513e91 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 @@ -650,7 +650,7 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, & if (present(field_loc)) then do n=1,ndim3 if (restart_ext) then - call ice_read_ext(nu,nrec,work2,atype,diag,field_loc,field_type) + call ice_read_ext(nu,nrec,work2,atype,diag) else call ice_read(nu,nrec,work2,atype,diag,field_loc,field_type) endif diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 5bfa2ba66..482c9085e 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -235,11 +235,7 @@ subroutine init_restart nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, & nt_iage, nt_FY, nt_aero -<<<<<<< HEAD - character(len=*),parameter :: subname = '(init_restart)' -======= character(len=*), parameter :: subname = '(init_restart)' ->>>>>>> ab22e48640be8a2bebc16dd973471378634b665e call icepack_query_parameters(skl_bgc_out=skl_bgc, & z_tracers_out=z_tracers, solve_zsal_out=solve_zsal) @@ -250,11 +246,7 @@ subroutine init_restart nt_apnd_out=nt_apnd, nt_hpnd_out=nt_hpnd, nt_ipnd_out=nt_ipnd, & nt_iage_out=nt_iage, nt_FY_out=nt_FY, nt_aero_out=nt_aero) call icepack_warnings_flush(nu_diag) -<<<<<<< HEAD - if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & -======= if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & ->>>>>>> ab22e48640be8a2bebc16dd973471378634b665e file=__FILE__, line=__LINE__) if (trim(runtype) == 'continue') then @@ -409,11 +401,7 @@ subroutine init_restart !$OMP END PARALLEL DO call icepack_warnings_flush(nu_diag) -<<<<<<< HEAD - if (icepack_warnings_aborted()) call abort_ice(error_message=trim(subname), & -======= if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & ->>>>>>> ab22e48640be8a2bebc16dd973471378634b665e file=__FILE__, line=__LINE__) end subroutine init_restart diff --git a/cicecore/shared/ice_fileunits.F90 b/cicecore/shared/ice_fileunits.F90 index 4a011e03c..b6cb8c2b0 100644 --- a/cicecore/shared/ice_fileunits.F90 +++ b/cicecore/shared/ice_fileunits.F90 @@ -1,3 +1,4 @@ +! SVN:$Id: ice_fileunits.F90 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! This module contains an I/O unit manager for tracking, assigning @@ -277,12 +278,7 @@ subroutine flush_fileunit(iunit) #ifdef CESMCOUPLED call shr_sys_flush(iunit) #else -#if (defined IRIX64 || defined CRAY || defined OSF1 || defined SUNOS || defined LINUX || defined NEC_SX | defined UNICOSMP) - call flush(iunit) -#endif -#if (defined AIX) - call flush_(iunit) -#endif + flush(iunit) #endif end subroutine flush_fileunit diff --git a/cicecore/shared/ice_spacecurve.F90 b/cicecore/shared/ice_spacecurve.F90 index a9071a749..ed108e1c7 100644 --- a/cicecore/shared/ice_spacecurve.F90 +++ b/cicecore/shared/ice_spacecurve.F90 @@ -75,7 +75,7 @@ module ice_spacecurve ! !IROUTINE: Cinco ! !INTERFACE: - recursive function Cinco(l,ma,md,ja,jd) result(ierr) + recursive function Cinco(l,type,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This subroutine implements a Cinco space-filling curve. @@ -92,6 +92,7 @@ recursive function Cinco(l,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve + type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -122,6 +123,7 @@ recursive function Cinco(l,ma,md,ja,jd) result(ierr) character(len=*),parameter :: subname='(Cinco)' !----------------------------------------------------------------------- + ltype = type ll = l if(ll .gt. 1) ltype = fact%factors(ll-1) ! Set the next type of space curve @@ -586,7 +588,7 @@ end function Cinco ! !IROUTINE: PeanoM ! !INTERFACE: - recursive function PeanoM(l,ma,md,ja,jd) result(ierr) + recursive function PeanoM(l,type,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This function implements a meandering Peano @@ -603,6 +605,7 @@ recursive function PeanoM(l,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve + type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -635,6 +638,7 @@ recursive function PeanoM(l,ma,md,ja,jd) result(ierr) !----------------------------------------------------------------------- + ltype = type ll = l if(ll .gt. 1) ltype = fact%factors(ll-1) ! Set the next type of space curve !-------------------------------------------------------------- @@ -810,7 +814,7 @@ end function PeanoM ! !IROUTINE: Hilbert ! !INTERFACE: - recursive function Hilbert(l,ma,md,ja,jd) result(ierr) + recursive function Hilbert(l,type,ma,md,ja,jd) result(ierr) ! !DESCRIPTION: ! This function implements a Hilbert space-filling curve. @@ -827,6 +831,7 @@ recursive function Hilbert(l,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve + type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -858,6 +863,7 @@ recursive function Hilbert(l,ma,md,ja,jd) result(ierr) character(len=*),parameter :: subname='(Hilbert)' !----------------------------------------------------------------------- + ltype = type ll = l if(ll .gt. 1) ltype = fact%factors(ll-1) ! Set the next type of space curve !-------------------------------------------------------------- @@ -1109,7 +1115,7 @@ function GenCurve(l,type,ma,md,ja,jd) result(ierr) integer(int_kind), intent(in) :: & l, & ! level of the space-filling curve - type, & ! type of space-filling curve to start off + type, & ! type of SFC curve ma, & ! Major axis [0,1] md, & ! direction of major axis [-1,1] ja, & ! joiner axis [0,1] @@ -1131,11 +1137,11 @@ function GenCurve(l,type,ma,md,ja,jd) result(ierr) !------------------------------------------------- if(type == 2) then - ierr = Hilbert(l,ma,md,ja,jd) + ierr = Hilbert(l,type,ma,md,ja,jd) elseif ( type == 3) then - ierr = PeanoM(l,ma,md,ja,jd) + ierr = PeanoM(l,type,ma,md,ja,jd) elseif ( type == 5) then - ierr = Cinco(l,ma,md,ja,jd) + ierr = Cinco(l,type,ma,md,ja,jd) endif !EOP @@ -1206,7 +1212,7 @@ subroutine MatchFactor(fac1,fac2,val,found) val1 = FirstFactor(fac1) !JMD print *,'Matchfactor: found value: ',val1 found = FindandMark(fac2,val1,.true.) -! tmp = FindandMark(fac1,val1,found) + tmp = FindandMark(fac1,val1,found) if (found) then val = val1 else @@ -1444,7 +1450,7 @@ subroutine map(l) type = fact%factors(l) ierr = GenCurve(l,type,0,1,0,1) - if (ierr .ne. 0) print *,'GenCurve ierr',ierr + !EOP !----------------------------------------------------------------------- From 51f832f2cb6bf0ff9517b26530835e3499eb479f Mon Sep 17 00:00:00 2001 From: David Bailey Date: Tue, 28 Aug 2018 14:04:42 -0600 Subject: [PATCH 20/21] Remove some initialization code. --- cicecore/cicedynB/general/ice_flux.F90 | 17 ++++---- cicecore/cicedynB/general/ice_forcing.F90 | 42 +++++++++---------- cicecore/cicedynB/general/ice_step_mod.F90 | 25 ++++++----- cicecore/cicedynB/infrastructure/ice_grid.F90 | 10 ++--- cicecore/drivers/cice/CICE_RunMod.F90 | 16 +++---- cicecore/shared/ice_fileunits.F90 | 4 ++ .../scripts/machines/Macros.hobart_intel | 4 +- .../scripts/machines/Macros.hobart_nag | 4 +- .../scripts/machines/env.hobart_intel | 2 +- configuration/scripts/machines/env.hobart_nag | 2 +- 10 files changed, 67 insertions(+), 59 deletions(-) diff --git a/cicecore/cicedynB/general/ice_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index 4027c355c..51e453d43 100644 --- a/cicecore/cicedynB/general/ice_flux.F90 +++ b/cicecore/cicedynB/general/ice_flux.F90 @@ -443,7 +443,7 @@ subroutine init_coupler_flux uocn (:,:,:) = c0 ! surface ocean currents (m/s) vocn (:,:,:) = c0 frzmlt(:,:,:) = c0 ! freezing/melting potential (W/m^2) - frzmlt_init(:,:,:) = c0 ! freezing/melting potential (W/m^2) +! frzmlt_init(:,:,:) = c0 ! freezing/melting potential (W/m^2) sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) do iblk = 1, size(Tf,3) @@ -472,7 +472,7 @@ subroutine init_coupler_flux fsens (:,:,:) = c0 flat (:,:,:) = c0 fswabs (:,:,:) = c0 - fswint_ai(:,:,:) = c0 +! fswint_ai(:,:,:) = c0 flwout (:,:,:) = -stefan_boltzmann*Tffresh**4 ! in case atm model diagnoses Tsfc from flwout evap (:,:,:) = c0 @@ -492,7 +492,7 @@ subroutine init_coupler_flux strocnyT(:,:,:) = c0 ! ice-ocean stress, y-direction (T-cell) fresh (:,:,:) = c0 fsalt (:,:,:) = c0 - fpond (:,:,:) = c0 +! fpiond (:,:,:) = c0 fhocn (:,:,:) = c0 fswthru (:,:,:) = c0 fresh_da(:,:,:) = c0 ! data assimilation @@ -518,7 +518,7 @@ subroutine init_coupler_flux coszen (:,:,:) = c0 ! Cosine of the zenith angle fsw (:,:,:) = c0 ! shortwave radiation (W/m^2) - fswfac (:,:,:) = c0 +! fswfac (:,:,:) = c0 scale_factor(:,:,:) = c1 ! shortwave scaling factor wind (:,:,:) = sqrt(uatm(:,:,:)**2 & + vatm(:,:,:)**2) ! wind speed, (m/s) @@ -581,6 +581,7 @@ subroutine init_flux_ocn fresh (:,:,:) = c0 fsalt (:,:,:) = c0 +! fpond (:,:,:) = c0 fhocn (:,:,:) = c0 fswthru (:,:,:) = c0 faero_ocn(:,:,:,:) = c0 @@ -630,7 +631,7 @@ subroutine init_history_therm fsurf (:,:,:) = c0 fcondtop(:,:,:)= c0 congel (:,:,:) = c0 - fbot (:,:,:) = c0 +! fbot (:,:,:) = c0 frazil (:,:,:) = c0 snoice (:,:,:) = c0 dsnow (:,:,:) = c0 @@ -649,6 +650,7 @@ subroutine init_history_therm fcondtopn (:,:,:,:) = c0 flatn (:,:,:,:) = c0 fsensn (:,:,:,:) = c0 + fpond (:,:,:) = c0 fresh_ai (:,:,:) = c0 fsalt_ai (:,:,:) = c0 fhocn_ai (:,:,:) = c0 @@ -665,10 +667,11 @@ subroutine init_history_therm Cdn_ocn(:,:,:) = dragio Cdn_atm(:,:,:) = (vonkar/log(zref/iceruf)) & * (vonkar/log(zref/iceruf)) ! atmo drag for RASM - Cdn_atm_ratio(:,:,:)= c0 +! Cdn_atm_ratio(:,:,:)= c0 if (formdrag) then Cdn_atm_rdg (:,:,:) = c0 + Cdn_atm_ratio(:,:,:)= c0 Cdn_atm_floe(:,:,:) = c0 Cdn_atm_pond(:,:,:) = c0 Cdn_atm_skin(:,:,:) = c0 @@ -716,7 +719,7 @@ subroutine init_history_dyn sig2 (:,:,:) = c0 taubx (:,:,:) = c0 tauby (:,:,:) = c0 - strength (:,:,:) = c0 +! strength (:,:,:) = c0 strocnx (:,:,:) = c0 strocny (:,:,:) = c0 strairx (:,:,:) = c0 diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 4dbeafaf7..45500791d 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -164,20 +164,20 @@ subroutine init_forcing_atmo character(len=*), parameter :: subname = '(init_forcing_atmo)' - fsw_data(:,:,:,:) = c0 - cldf_data(:,:,:,:) = c0 - fsnow_data(:,:,:,:) = c0 - Tair_data(:,:,:,:) = c0 - uatm_data(:,:,:,:) = c0 - vatm_data(:,:,:,:) = c0 - wind_data(:,:,:,:) = c0 - strax_data(:,:,:,:) = c0 - stray_data(:,:,:,:) = c0 - Qa_data(:,:,:,:) = c0 - rhoa_data(:,:,:,:) = c0 - flw_data(:,:,:,:) = c0 - sublim_data(:,:,:,:) = c0 - frain_data(:,:,:,:) = c0 +! fsw_data(:,:,:,:) = c0 +! cldf_data(:,:,:,:) = c0 +! fsnow_data(:,:,:,:) = c0 +! Tair_data(:,:,:,:) = c0 +! uatm_data(:,:,:,:) = c0 +! vatm_data(:,:,:,:) = c0 +! wind_data(:,:,:,:) = c0 +! strax_data(:,:,:,:) = c0 +! stray_data(:,:,:,:) = c0 +! Qa_data(:,:,:,:) = c0 +! rhoa_data(:,:,:,:) = c0 +! flw_data(:,:,:,:) = c0 +! sublim_data(:,:,:,:) = c0 +! frain_data(:,:,:,:) = c0 fyear = fyear_init + mod(nyr-1,ycycle) ! current year fyear_final = fyear_init + ycycle - 1 ! last year in forcing cycle @@ -268,10 +268,10 @@ subroutine init_forcing_ocn(dt) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) - sst_data(:,:,:,:) = c0 - sss_data(:,:,:,:) = c0 - uocn_data(:,:,:,:) = c0 - vocn_data(:,:,:,:) = c0 +! sst_data(:,:,:,:) = c0 +! sss_data(:,:,:,:) = c0 +! uocn_data(:,:,:,:) = c0 +! vocn_data(:,:,:,:) = c0 nbits = 64 ! double precision data @@ -1338,9 +1338,9 @@ subroutine prepare_forcing (nx_block, ny_block, & rhoa (i,j) = max(rhoa(i,j),c0) Qa (i,j) = max(Qa(i,j),c0) - if (rhoa(i,j) .lt. puny) rhoa(i,j) = 1.3_dbl_kind - if (Tair(i,j) .lt. puny) Tair(i,j) = Tffresh - if (Qa(i,j) .lt. puny) Qa(i,j) = 0.0035_dbl_kind +! if (rhoa(i,j) .lt. puny) rhoa(i,j) = 1.3_dbl_kind +! if (Tair(i,j) .lt. puny) Tair(i,j) = Tffresh +! if (Qa(i,j) .lt. puny) Qa(i,j) = 0.0035_dbl_kind enddo ! i enddo ! j diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index c1131d5e0..083cbd5eb 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -77,10 +77,10 @@ subroutine prep_radiation (iblk) call ice_timer_start(timer_sw) ! shortwave - alvdr_init(:,:,:) = c0 - alvdf_init(:,:,:) = c0 - alidr_init(:,:,:) = c0 - alidf_init(:,:,:) = c0 +! alvdr_init(:,:,:) = c0 +! alvdf_init(:,:,:) = c0 +! alidr_init(:,:,:) = c0 +! alidf_init(:,:,:) = c0 this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -984,14 +984,17 @@ subroutine ocean_mixed_layer (dt, iblk) indxi(:) = 0 indxj(:) = 0 - this_block = get_block(blocks_ice(iblk),iblk) - ilo = this_block%ilo - ihi = this_block%ihi - jlo = this_block%jlo - jhi = this_block%jhi +! this_block = get_block(blocks_ice(iblk),iblk) +! ilo = this_block%ilo +! ihi = this_block%ihi +! jlo = this_block%jlo +! jhi = this_block%jhi + +! do j = jlo, jhi +! do i = ilo, ihi + do j = 1, ny_block + do i = 1, nx_block - do j = jlo, jhi - do i = ilo, ihi if (tmask(i,j,iblk)) then icells = icells + 1 indxi(icells) = i diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 2da7c551b..8f41d8360 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -306,7 +306,7 @@ subroutine init_grid2 ! T-grid cell and U-grid cell quantities !----------------------------------------------------------------- - tarea(:,:,:) = c0 +! tarea(:,:,:) = c0 !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks @@ -1509,7 +1509,7 @@ subroutine makemask !----------------------------------------------------------------- bm = c0 - uvm = c0 +! uvm = c0 !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks @@ -1945,8 +1945,8 @@ subroutine gridbox_corners ! (1) SW corner, (2) SE corner, (3) NE corner, (4) NW corner !------------------------------------------------------------- - latu_bounds(:,:,:,:) = c0 - lonu_bounds(:,:,:,:) = c0 +! latu_bounds(:,:,:,:) = c0 +! lonu_bounds(:,:,:,:) = c0 !$OMP PARALLEL DO PRIVATE(iblk,i,j,ilo,ihi,jlo,jhi,this_block) do iblk = 1, nblocks @@ -1985,7 +1985,7 @@ subroutine gridbox_corners endif work1(:,:,:) = latu_bounds(2,:,:,:) - work_g2 = c0 +! work_g2 = c0 call gather_global(work_g2, work1, master_task, distrb_info) if (my_task == master_task) then diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index fe1aa14c4..05cb998da 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -420,15 +420,17 @@ subroutine coupling_prep (iblk) enddo enddo - this_block = get_block(blocks_ice(iblk),iblk) - ilo = this_block%ilo - ihi = this_block%ihi - jlo = this_block%jlo - jhi = this_block%jhi +! this_block = get_block(blocks_ice(iblk),iblk) +! ilo = this_block%ilo +! ihi = this_block%ihi +! jlo = this_block%jlo +! jhi = this_block%jhi do n = 1, ncat - do j = jlo, jhi - do i = ilo, ihi +! do j = jlo, jhi +! do i = ilo, ihi + do j = 1, ny_block + do i = 1, nx_block if (aicen(i,j,n,iblk) > puny) then alvdf(i,j,iblk) = alvdf(i,j,iblk) & diff --git a/cicecore/shared/ice_fileunits.F90 b/cicecore/shared/ice_fileunits.F90 index b6cb8c2b0..45d3193c2 100644 --- a/cicecore/shared/ice_fileunits.F90 +++ b/cicecore/shared/ice_fileunits.F90 @@ -278,7 +278,11 @@ subroutine flush_fileunit(iunit) #ifdef CESMCOUPLED call shr_sys_flush(iunit) #else +#ifndef NO_F2003 flush(iunit) +#else +! Place holder for old call. +#endif #endif end subroutine flush_fileunit diff --git a/configuration/scripts/machines/Macros.hobart_intel b/configuration/scripts/machines/Macros.hobart_intel index b81f38f04..f4176eaf1 100755 --- a/configuration/scripts/machines/Macros.hobart_intel +++ b/configuration/scripts/machines/Macros.hobart_intel @@ -29,9 +29,7 @@ MPICC:= mpicc MPIFC:= mpif90 LD:= $(MPIFC) -NETCDF_PATH := /usr/local/netcdf-intel-cluster - -INCLDIR := -I/usr/local/netcdf-intel-cluster/include -I/usr/mpi/intel/mvapich2-2.1-qlc/include +INCLDIR := -I$(NETCDF_PATH)/include -I$(MPI_PATH)/include LIB_NETCDF := $(NETCDF_PATH)/lib LIB_PNETCDF := $(PNETCDF_PATH)/lib diff --git a/configuration/scripts/machines/Macros.hobart_nag b/configuration/scripts/machines/Macros.hobart_nag index feb4b45f0..a7f973a69 100755 --- a/configuration/scripts/machines/Macros.hobart_nag +++ b/configuration/scripts/machines/Macros.hobart_nag @@ -29,9 +29,7 @@ MPICC:= mpicc MPIFC:= mpif90 LD:= $(MPIFC) -NETCDF_PATH := /usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0 - -INCLDIR := -I/usr/local/netcdf_c-4.3.2_f-4.4.1-nag-6.0/include -I/cluster/mvapich2-2.2rc1-gcc-g++-4.8.5-nag-6.1/include +INCLDIR := -I$(NETCDF_PATH)/include -I$(MPI_PATH)/include LIB_NETCDF := $(NETCDF_PATH)/lib LIB_PNETCDF := $(PNETCDF_PATH)/lib diff --git a/configuration/scripts/machines/env.hobart_intel b/configuration/scripts/machines/env.hobart_intel index a88921be7..fa06d9ec6 100755 --- a/configuration/scripts/machines/env.hobart_intel +++ b/configuration/scripts/machines/env.hobart_intel @@ -3,7 +3,7 @@ source /usr/share/Modules/init/csh module purge -module load compiler/intel/17.0.4.196 +module load compiler/intel/18.0.3 setenv ICE_MACHINE_ENVNAME hobart setenv ICE_MACHINE_COMPILER ifort diff --git a/configuration/scripts/machines/env.hobart_nag b/configuration/scripts/machines/env.hobart_nag index a1bb008ba..62dc6c69c 100755 --- a/configuration/scripts/machines/env.hobart_nag +++ b/configuration/scripts/machines/env.hobart_nag @@ -3,7 +3,7 @@ source /usr/share/Modules/init/csh module purge -module load compiler/nag/6.1 +module load compiler/nag/6.2 setenv ICE_MACHINE_ENVNAME hobart setenv ICE_MACHINE_COMPILER nag From 359c50d0036192f1400af818ccac48e9d4b48295 Mon Sep 17 00:00:00 2001 From: David Bailey Date: Fri, 21 Sep 2018 13:34:29 -0600 Subject: [PATCH 21/21] Only remove istat checks in one routine. --- cicecore/shared/ice_distribution.F90 | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cicecore/shared/ice_distribution.F90 b/cicecore/shared/ice_distribution.F90 index b80f0a5ad..fa49adbc9 100644 --- a/cicecore/shared/ice_distribution.F90 +++ b/cicecore/shared/ice_distribution.F90 @@ -375,24 +375,8 @@ subroutine ice_distributionDestroy(distribution) !---------------------------------------------------------------------- deallocate(distribution%blockLocation, stat=istat) - if (istat > 0) then - call abort_ice( & - 'ice_distributionDestroy: error deallocating blockLocation') - return - endif - deallocate(distribution%blockLocalID , stat=istat) - if (istat > 0) then - call abort_ice( & - 'ice_distributionDestroy: error deallocating blockLocalID') - return - endif deallocate(distribution%blockGlobalID, stat=istat) - if (istat > 0) then - call abort_ice( & - 'ice_distributionDestroy: error deallocating blockGlobalID') - return - endif !-----------------------------------------------------------------------