From 329318baa63ef6645f6dcae095eb2de5572099ff Mon Sep 17 00:00:00 2001 From: Anthony Craig Date: Thu, 5 Sep 2019 18:44:08 -0600 Subject: [PATCH] update icepack, nag cleanup, remove tabs --- .../cicedynB/analysis/ice_history_bgc.F90 | 12 +-- .../cicedynB/analysis/ice_history_shared.F90 | 16 ++-- cicecore/cicedynB/dynamics/ice_dyn_eap.F90 | 8 +- cicecore/cicedynB/dynamics/ice_dyn_evp.F90 | 6 +- cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 | 14 +-- cicecore/cicedynB/dynamics/ice_dyn_shared.F90 | 18 +--- .../cicedynB/dynamics/ice_transport_remap.F90 | 2 +- cicecore/cicedynB/general/ice_forcing.F90 | 86 ++++++++++--------- cicecore/cicedynB/general/ice_forcing_bgc.F90 | 60 ++++++------- cicecore/cicedynB/general/ice_init.F90 | 10 +-- cicecore/cicedynB/general/ice_step_mod.F90 | 6 -- .../comm/mpi/ice_gather_scatter.F90 | 1 - .../comm/serial/ice_boundary.F90 | 3 +- .../cicedynB/infrastructure/ice_domain.F90 | 2 + .../infrastructure/ice_read_write.F90 | 30 ++++--- .../cicedynB/infrastructure/ice_restoring.F90 | 2 +- .../io/io_binary/ice_history_write.F90 | 2 +- .../io/io_binary/ice_restart.F90 | 15 ++-- .../io/io_netcdf/ice_restart.F90 | 9 +- .../io/io_pio/ice_history_write.F90 | 8 +- cicecore/drivers/cesm/ice_comp_esmf.F90 | 12 +-- cicecore/drivers/cesm/ice_comp_mct.F90 | 14 +-- cicecore/drivers/cesm/ice_prescribed_mod.F90 | 2 +- cicecore/drivers/cesm/ice_scam.F90 | 1 - cicecore/drivers/cice/CICE_InitMod.F90 | 4 +- cicecore/drivers/cice/CICE_RunMod.F90 | 2 +- cicecore/shared/ice_arrays_column.F90 | 3 +- cicecore/shared/ice_calendar.F90 | 8 +- cicecore/shared/ice_init_column.F90 | 17 ++-- cicecore/shared/ice_restart_column.F90 | 3 - icepack | 2 +- 31 files changed, 170 insertions(+), 208 deletions(-) diff --git a/cicecore/cicedynB/analysis/ice_history_bgc.F90 b/cicecore/cicedynB/analysis/ice_history_bgc.F90 index ae5bccb2f..c27683423 100644 --- a/cicecore/cicedynB/analysis/ice_history_bgc.F90 +++ b/cicecore/cicedynB/analysis/ice_history_bgc.F90 @@ -112,10 +112,10 @@ module ice_history_bgc f_peakval = 'x', f_bgc_Fed_ml = 'x', & f_bgc_Fep_ml = 'x', f_bgc_hum_ml = 'x', & f_bgc_N_cat1 = 'x', f_bgc_DOC_cat1 = 'x', & - f_bgc_DIC_cat1 = 'x', f_bgc_Nit_cat1 = 'x', & + f_bgc_DIC_cat1 = 'x', f_bgc_Nit_cat1 = 'x', & f_bgc_Am_cat1 = 'x', f_bgc_Sil_cat1 = 'x', & f_bgc_DMSPd_cat1= 'x', f_bgc_DMS_cat1 = 'x', & - f_bgc_DON_cat1 = 'x', f_bgc_Fed_cat1 = 'x', & + f_bgc_DON_cat1 = 'x', f_bgc_Fed_cat1 = 'x', & f_bgc_hum_cat1 = 'x', f_bgc_Fep_cat1 = 'x', & f_bgc_PON_cat1 = 'x' @@ -226,11 +226,11 @@ module ice_history_bgc n_upNO , n_upNH , & n_bTin , n_bphi , & n_iDi , n_iki , & - n_bgc_PON , n_bgc_PON_ml , & + n_bgc_PON , & n_fbri , n_hbri , & n_zfswin , n_Nitnet , & n_Amnet , n_Silnet , & - n_humnet , & + n_humnet , & n_DMSPpnet , n_DMSPdnet , & n_DMSnet , n_PONnet , & n_Nitsnow , n_Amsnow , & @@ -238,8 +238,8 @@ module ice_history_bgc n_DMSPpsnow , n_DMSPdsnow , & n_DMSsnow , n_PONsnow , & n_Nitfrac , n_Amfrac , & - n_Silfrac , n_zbgc_frac , & - n_humfrac , & + n_Silfrac , & + n_humfrac , & n_DMSPpfrac , n_DMSPdfrac , & n_DMSfrac , n_PONfrac , & n_grownet , n_PPnet , & diff --git a/cicecore/cicedynB/analysis/ice_history_shared.F90 b/cicecore/cicedynB/analysis/ice_history_shared.F90 index d8335e1f7..64a82e9ae 100644 --- a/cicecore/cicedynB/analysis/ice_history_shared.F90 +++ b/cicecore/cicedynB/analysis/ice_history_shared.F90 @@ -452,7 +452,7 @@ module ice_history_shared f_e22, & f_s11, f_s12, & f_s22, & - f_yieldstress11, & + f_yieldstress11, & f_yieldstress12, & f_yieldstress22 @@ -608,13 +608,13 @@ module ice_history_shared n_keffn_top , & n_Tinz , n_Sinz , & n_Tsnz , & - n_a11 , n_a12 , & - n_e11 , n_e12 , & - n_e22 , & - n_s11 , n_s12 , & - n_s22 , & - n_yieldstress11, n_yieldstress12, & - n_yieldstress22 + n_a11 , n_a12 , & + n_e11 , n_e12 , & + n_e22 , & + n_s11 , n_s12 , & + n_s22 , & + n_yieldstress11, n_yieldstress12, & + n_yieldstress22 interface accum_hist_field ! generic interface module procedure accum_hist_field_2D, & diff --git a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 index 944d80607..bc42e4855 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 @@ -119,8 +119,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, & dyn_prep1, dyn_prep2, stepu, dyn_finish, & basal_stress_coeff, basalstress use ice_flux, only: rdg_conv, strairxT, strairyT, & @@ -1615,9 +1615,9 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & invstressconviso, & Angle_denom_gamma, Angle_denom_alpha, & Tany_1, Tany_2, & - gamma, alpha, x, y, dx, dy, da, & + x, y, dx, dy, da, & invdx, invdy, invda, invsin, & - invleng, dtemp1, dtemp2, atempprime, & + dtemp1, dtemp2, atempprime, & kxw, kyw, kaw, & puny, pi, pi2, piq, pih diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 index c1371db7a..34ba5b002 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 @@ -37,8 +37,8 @@ module ice_dyn_evp use ice_communicate, only: my_task 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, dyn_prep1, dyn_prep2, dyn_finish, & ndte, yield_curve, ecci, denom1, arlx1i, fcor_blk, uvel_init, & vvel_init, basal_stress_coeff, basalstress, Ktens, revp @@ -641,7 +641,7 @@ subroutine stress (nx_block, ny_block, & tensionne, tensionnw, tensionse, tensionsw, & ! tension shearne, shearnw, shearse, shearsw , & ! shearing Deltane, Deltanw, Deltase, Deltasw , & ! Delt - puny , & ! puny +! puny , & ! puny c0ne, c0nw, c0se, c0sw , & ! useful combinations c1ne, c1nw, c1se, c1sw , & ssigpn, ssigps, ssigpe, ssigpw , & diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 index b7092fc95..e82b12fd1 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_evp_1d.F90 @@ -111,8 +111,8 @@ subroutine domp_get_domain_rlu(lower,upper,d_lower,d_upper) #if defined (_OPENMP) use omp_lib, only : omp_in_parallel -#endif use ice_constants, only: p5 +#endif integer(KIND=JPIM), intent(in) :: lower,upper integer(KIND=JPIM), intent(out) :: d_lower,d_upper @@ -120,7 +120,6 @@ subroutine domp_get_domain_rlu(lower,upper,d_lower,d_upper) #if defined (_OPENMP) !-- local variables real(kind=dbl_kind) :: dlen - integer(int_kind) :: lr, ur #endif character(len=*), parameter :: subname = '(domp_get_domain_rlu)' @@ -969,9 +968,6 @@ module ice_dyn_evp_1d use ice_kinds_mod use ice_fileunits, only: nu_diag use ice_exit, only: abort_ice - !-- BEGIN: specific for the KERNEL - use ice_dyn_shared, only: revp, ecci, denom1, arlx1i, brlx - !-- END: specific for the KERNEL implicit none private @@ -1150,7 +1146,6 @@ subroutine evp_copyin_v2(nx,ny,nblk,nx_glob,ny_glob, use ice_gather_scatter, only: gather_global_ext use ice_domain, only: distrb_info use ice_communicate, only: my_task, master_task - use ice_constants, only: c0,c1,p5 implicit none @@ -1286,9 +1281,8 @@ subroutine evp_copyout(nx,ny,nblk,nx_glob,ny_glob, & I_stress12_1,I_stress12_2,I_stress12_3,I_stress12_4, & I_divu,I_rdg_conv,I_rdg_shear,I_shear,I_taubx,I_tauby ) - use ice_constants, only : c0, field_loc_center, field_loc_NEcorner, & - field_type_scalar, field_type_vector - use ice_gather_scatter, only: scatter_global_ext, scatter_global + use ice_constants, only : c0 + use ice_gather_scatter, only: scatter_global_ext use ice_domain, only: distrb_info use ice_communicate, only: my_task, master_task @@ -1420,7 +1414,7 @@ subroutine evp_kernel_v2 implicit none real(kind=dbl_kind) :: rhow - integer (kind=int_kind) :: ierr, lun, i, nthreads + integer (kind=int_kind) :: i, nthreads integer (kind=int_kind) :: na,nb,navel character(len=*), parameter :: subname = '(evp_kernel_v2)' diff --git a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 index c26e36d96..fec4c6823 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 @@ -11,7 +11,8 @@ module ice_dyn_shared use ice_kinds_mod use ice_communicate, only: my_task, master_task - use ice_constants, only: c0, c1, p01, p001 + use ice_constants, only: c0, c1, c2, p01, p001 + use ice_constants, only: omega, spval_dbl, p5, c4 use ice_blocks, only: nx_block, ny_block use ice_domain_size, only: max_blocks use ice_fileunits, only: nu_diag @@ -115,7 +116,6 @@ end subroutine alloc_dyn_shared subroutine init_evp (dt) use ice_blocks, only: nx_block, ny_block - 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, & @@ -205,12 +205,6 @@ end subroutine init_evp subroutine set_evp_parameters (dt) - use ice_communicate, only: my_task, master_task - use ice_constants, only: p25, c1, c2, p5 - use ice_domain, only: distrb_info - use ice_global_reductions, only: global_minval - use ice_grid, only: dxt, dyt, tmask - real (kind=dbl_kind), intent(in) :: & dt ! time step @@ -275,8 +269,6 @@ subroutine dyn_prep1 (nx_block, ny_block, & strairx, strairy, & tmass, icetmask) - use ice_constants, only: c0 - integer (kind=int_kind), intent(in) :: & nx_block, ny_block, & ! block dimensions ilo,ihi,jlo,jhi ! beginning and end of physical domain @@ -409,8 +401,6 @@ subroutine dyn_prep2 (nx_block, ny_block, & uvel, vvel, & Tbu) - use ice_constants, only: c0, c1 - integer (kind=int_kind), intent(in) :: & nx_block, ny_block, & ! block dimensions ilo,ihi,jlo,jhi ! beginning and end of physical domain @@ -877,8 +867,6 @@ subroutine basal_stress_coeff (nx_block, ny_block, & vice, aice, & hwater, Tbu) - use ice_constants, only: c0, c1 - integer (kind=int_kind), intent(in) :: & nx_block, ny_block, & ! block dimensions icellu ! no. of cells where icetmask = 1 @@ -948,8 +936,6 @@ subroutine principal_stress(nx_block, ny_block, & sig1, sig2, & sigP) - use ice_constants, only: spval_dbl, p5, c4 - integer (kind=int_kind), intent(in) :: & nx_block, ny_block ! block dimensions diff --git a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 index bf9d0f373..b641104ed 100644 --- a/cicecore/cicedynB/dynamics/ice_transport_remap.F90 +++ b/cicecore/cicedynB/dynamics/ice_transport_remap.F90 @@ -260,7 +260,7 @@ subroutine init_remap ! xxxav, xxyav, xyyav, yyyav integer (kind=int_kind) :: & - i, j, iblk ! standard indices + i, j, iblk ! standard indices character(len=*), parameter :: subname = '(init_remap)' diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 2a529c2fe..f1a307ae0 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -32,7 +32,7 @@ module ice_forcing use ice_arrays_column, only: oceanmixed_ice, restore_bgc use ice_constants, only: c0, c1, c2, c3, c4, c5, c10, c12, c15, c20, & c180, c360, c365, c1000, c3600 - use ice_constants, only: p001, p01, p1, p25, p5, p6 + use ice_constants, only: p001, p01, p1, p2, p25, p5, p6 use ice_constants, only: cm_to_m use ice_constants, only: field_loc_center, field_type_scalar, & field_type_vector, field_loc_NEcorner @@ -414,11 +414,11 @@ subroutine init_forcing_ocn(dt) if (trim(ocn_data_type) == 'hadgem_sst' .or. & trim(ocn_data_type) == 'hadgem_sst_uvocn') then - diag = .true. ! write diagnostic information + diag = .true. ! write diagnostic information sst_file = trim (ocn_data_dir)//'/MONTHLY/sst.1997.nc' - if (my_task == master_task) then + if (my_task == master_task) then write (nu_diag,*) ' ' write (nu_diag,*) 'Initial SST file:', trim(sst_file) @@ -3336,6 +3336,7 @@ subroutine ocn_data_ncar_init 'T', 'S', 'hblt', 'U', 'V', & 'dhdx', 'dhdy', 'qdp' / +#ifdef ncdf integer (kind=int_kind) :: & fid , & ! file id dimid ! dimension id @@ -3344,6 +3345,7 @@ subroutine ocn_data_ncar_init status , & ! status flag nlat , & ! number of longitudes of data nlon ! number of latitudes of data +#endif real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: & work1 @@ -3477,6 +3479,7 @@ subroutine ocn_data_ncar_init_3D use netcdf #endif +#ifdef ncdf integer (kind=int_kind) :: & n , & ! field index m , & ! month index @@ -3499,6 +3502,7 @@ subroutine ocn_data_ncar_init_3D real (kind=dbl_kind), dimension (nx_block,ny_block,max_blocks) :: & work1, work2 +#endif character(len=*), parameter :: subname = '(ocn_data_ncar_init_3D)' @@ -3815,8 +3819,8 @@ subroutine ocn_data_hadgem(dt) ! Reads in HadGEM ocean forcing data as required from netCDF files ! Current options (selected by ocn_data_type) -! hadgem_sst: read in sst only -! hadgem_sst_uvocn: read in sst plus uocn and vocn +! hadgem_sst: read in sst only +! hadgem_sst_uvocn: read in sst plus uocn and vocn ! authors: Ann Keen, Met Office @@ -3842,10 +3846,10 @@ subroutine ocn_data_hadgem(dt) logical (kind=log_kind) :: readm character (char_len) :: & - fieldname ! field name in netcdf file + fieldname ! field name in netcdf file character (char_len_long) :: & - filename ! name of netCDF file + filename ! name of netCDF file character(len=*), parameter :: subname = '(ocn_data_hadgem)' @@ -3898,7 +3902,7 @@ subroutine ocn_data_hadgem(dt) ! ----------------------------------------------------------- ! SST ! ----------------------------------------------------------- - sst_file = trim(ocn_data_dir)//'/MONTHLY/sst.1997.nc' + sst_file = trim(ocn_data_dir)//'/MONTHLY/sst.1997.nc' fieldname='sst' call read_data_nc (readm, 0, fyear, ixm, month, ixp, & maxrec, sst_file, fieldname, sst_data, & @@ -3932,23 +3936,23 @@ subroutine ocn_data_hadgem(dt) if (trim(ocn_data_type)=='hadgem_sst_uvocn') then - filename = trim(ocn_data_dir)//'/MONTHLY/uocn.1997.nc' - fieldname='uocn' - call read_data_nc (readm, 0, fyear, ixm, month, ixp, & + filename = trim(ocn_data_dir)//'/MONTHLY/uocn.1997.nc' + fieldname='uocn' + call read_data_nc (readm, 0, fyear, ixm, month, ixp, & maxrec, filename, fieldname, uocn_data, & field_loc_center, field_type_vector) - ! Interpolate to current time step - call interpolate_data (uocn_data, uocn) + ! Interpolate to current time step + call interpolate_data (uocn_data, uocn) - filename = trim(ocn_data_dir)//'/MONTHLY/vocn.1997.nc' - fieldname='vocn' - call read_data_nc (readm, 0, fyear, ixm, month, ixp, & + filename = trim(ocn_data_dir)//'/MONTHLY/vocn.1997.nc' + fieldname='vocn' + call read_data_nc (readm, 0, fyear, ixm, month, ixp, & maxrec, filename, fieldname, vocn_data, & field_loc_center, field_type_vector) - ! Interpolate to current time step - call interpolate_data (vocn_data, vocn) + ! Interpolate to current time step + call interpolate_data (vocn_data, vocn) !----------------------------------------------------------------- ! Rotate zonal/meridional vectors to local coordinates, @@ -3970,9 +3974,9 @@ subroutine ocn_data_hadgem(dt) uocn(i,j,iblk) = uocn(i,j,iblk) * cm_to_m vocn(i,j,iblk) = vocn(i,j,iblk) * cm_to_m - enddo ! i - enddo ! j - enddo ! nblocks + enddo ! i + enddo ! j + enddo ! nblocks !$OMP END PARALLEL DO !----------------------------------------------------------------- @@ -3994,7 +3998,6 @@ subroutine ocn_data_hycom_init ! + rename/link file use ice_blocks, only: nx_block, ny_block use ice_domain, only: nblocks - use ice_domain_size, only: max_blocks use ice_flux, only: sss, sst, Tf #ifdef ncdf use netcdf @@ -4453,13 +4456,11 @@ subroutine ISPOL_data !local parameters +#ifdef ncdf character (char_len_long) :: & met_file, & ! netcdf filename fieldname ! field name in netcdf file - integer (kind=int_kind) :: & - status ! status flag - real (kind=dbl_kind), dimension(2), save :: & Tair_data_p , & ! air temperature (K) for interpolation Qa_data_p, fsnow_data_p, & @@ -4479,30 +4480,33 @@ subroutine ISPOL_data ! for interpolation of hourly data integer (kind=int_kind) :: & - 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 + ixm,ixx,ixp , & ! record numbers for neighboring months + maxrec , & ! maximum record number + recslot , & ! spline slot for current record + dataloc ! = 1 for data located in middle of time interval ! = 2 for date located at end of time interval - real (kind=dbl_kind) :: & + real (kind=dbl_kind) :: & secday , & Qa_pnt real (kind=dbl_kind) :: & - sec1hr ! number of seconds in 1 hour + sec1hr ! number of seconds in 1 hour logical (kind=log_kind) :: read1 +#endif + + integer (kind=int_kind) :: & + recnum , & ! record number + recnum4X ! record number character(len=*), parameter :: subname = '(ISPOL_data)' +#ifdef ncdf call icepack_query_parameters(secday_out=secday) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) -#ifdef ncdf if (trim(atm_data_format) == 'nc') then ! read nc file !------------------------------------------------------------------- @@ -4647,9 +4651,9 @@ subroutine ISPOL_data ! fixed data ! May not be needed !----------------------------- - rhoa (:,:,:) = 1.3_dbl_kind ! air density (kg/m^3) - cldf(:,:,:) = c1 !0.25_dbl_kind ! cloud fraction - frain(:,:,:) = c0 ! this is available in hourlymet_rh file + rhoa (:,:,:) = 1.3_dbl_kind ! air density (kg/m^3) + cldf(:,:,:) = c1 !0.25_dbl_kind ! cloud fraction + frain(:,:,:) = c0 ! this is available in hourlymet_rh file ! Save record number for next time step oldrecnum = recnum @@ -4686,6 +4690,7 @@ subroutine ocn_data_ispol_init use netcdf #endif +#ifdef ncdf integer (kind=int_kind) :: & n , & ! field index m ! month index @@ -4697,13 +4702,14 @@ subroutine ocn_data_ispol_init 'dhdx', 'dhdy', 'qdp' / real (kind=dbl_kind) :: & - work + work integer (kind=int_kind) :: & fid ! file id integer (kind=int_kind) :: & status ! status flag +#endif character(len=*), parameter :: subname = '(ocn_data_ispol_init)' @@ -4766,10 +4772,8 @@ subroutine box2001_data ! authors: Elizabeth Hunke, LANL use ice_domain, only: nblocks - use ice_constants, only: c0, c1, c2, c3, c4, c5, p2 use ice_blocks, only: nx_block, ny_block, nghost use ice_flux, only: uocn, vocn, uatm, vatm, wind, rhoa, strax, stray - use ice_fileunits, only: nu_diag, nu_forcing use ice_grid, only: uvm ! local parameters @@ -4778,7 +4782,7 @@ subroutine box2001_data iblk, i,j ! loop indices real (kind=dbl_kind) :: & - secday, pi , c10, c12, c20, puny, period, pi2, tau + secday, pi , puny, period, pi2, tau call icepack_query_parameters(pi_out=pi, pi2_out=pi2, puny_out=puny) call icepack_query_parameters(secday_out=secday) diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index 0b34accb1..6e543a056 100644 --- a/cicecore/cicedynB/general/ice_forcing_bgc.F90 +++ b/cicecore/cicedynB/general/ice_forcing_bgc.F90 @@ -77,7 +77,7 @@ subroutine get_forcing_bgc use ice_domain, only: nblocks, blocks_ice use ice_arrays_column, only: ocean_bio_all use ice_calendar, only: yday - use ice_flux, only: sss +! use ice_flux, only: sss use ice_flux_bgc, only: sil, nit use ice_forcing, only: trestore, trest, fyear, & read_clim_data_nc, interpolate_data, & @@ -202,7 +202,7 @@ subroutine get_forcing_bgc if (istep == 1 .or. .NOT. restore_bgc) then !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -210,8 +210,8 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi sil(i,j,iblk) = sildat(i,j,iblk) ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic @@ -224,7 +224,7 @@ subroutine get_forcing_bgc elseif (restore_bgc) then !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -232,8 +232,8 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi sil(i,j,iblk) = sil(i,j,iblk) & + (sildat(i,j,iblk)-sil(i,j,iblk))*dt/trest @@ -246,7 +246,7 @@ subroutine get_forcing_bgc endif !restore elseif (tr_bgc_Sil) then ! bgc_data_type /= 'clim' !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -254,10 +254,10 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi - sil(i,j,iblk) = 25.0_dbl_kind + sil(i,j,iblk) = 25.0_dbl_kind ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil enddo @@ -283,7 +283,7 @@ subroutine get_forcing_bgc if (istep == 1 .or. .NOT. restore_bgc) then !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -291,10 +291,10 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi - nit(i,j,iblk) = nitdat(i,j,iblk) + nit(i,j,iblk) = nitdat(i,j,iblk) ks = icepack_max_algae + 1 ocean_bio_all(i,j,ks,iblk) = nit(i,j,iblk) !nit ks = 2*icepack_max_algae + icepack_max_doc + 7 + icepack_max_dic @@ -305,7 +305,7 @@ subroutine get_forcing_bgc !$OMP END PARALLEL DO elseif (restore_bgc ) then !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -313,8 +313,8 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi nit(i,j,iblk) = nit(i,j,iblk) & + (nitdat(i,j,iblk)-nit(i,j,iblk))*dt/trest @@ -330,7 +330,7 @@ subroutine get_forcing_bgc ! elseif (trim(nit_data_type) == 'sss' .AND. tr_bgc_Nit) then ! !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) -! do iblk = 1, nblocks +! do iblk = 1, nblocks ! this_block = get_block(blocks_ice(iblk),iblk) ! ilo = this_block%ilo @@ -353,7 +353,7 @@ subroutine get_forcing_bgc elseif (tr_bgc_Nit) then ! bgc_data_type /= 'clim' !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -361,8 +361,8 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi nit(i,j,iblk) = 12.0_dbl_kind ks = icepack_max_algae + 1 @@ -444,7 +444,7 @@ subroutine get_forcing_bgc endif !$OMP PARALLEL DO PRIVATE(iblk,ilo,ihi,jlo,jhi,this_block) - do iblk = 1, nblocks + do iblk = 1, nblocks this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -452,8 +452,8 @@ subroutine get_forcing_bgc jlo = this_block%jlo jhi = this_block%jhi - do j = jlo, jhi - do i = ilo, ihi + do j = jlo, jhi + do i = ilo, ihi ks = 2*icepack_max_algae + icepack_max_doc + 3 + icepack_max_dic ocean_bio_all(i,j,ks,iblk) = sil(i,j,iblk) !Sil @@ -791,7 +791,7 @@ subroutine init_bgc_data (fed1,fep1) !------------------------------------------------------------------- if (trim(fe_data_type) == 'clim') then - diag = .true. ! write diagnostic information + diag = .true. ! write diagnostic information iron_file = trim(bgc_data_dir)//'dFe_50m_annual_Tagliabue_gx1.nc' if (my_task == master_task) then @@ -808,7 +808,7 @@ subroutine init_bgc_data (fed1,fep1) if (my_task == master_task) call ice_close_nc(fid) - diag = .true. ! write diagnostic information + diag = .true. ! write diagnostic information iron_file = trim(bgc_data_dir)//'pFe_bathy_gx1.nc' if (my_task == master_task) then @@ -858,6 +858,9 @@ subroutine faero_optics ! local parameters + logical (kind=log_kind) :: modal_aero + +#ifdef ncdf integer (kind=int_kind) :: & varid , & ! variable id status , & ! status output from netcdf routines @@ -869,11 +872,10 @@ subroutine faero_optics integer (kind=int_kind) :: & fid ! file id for netCDF file - logical (kind=log_kind) :: modal_aero - character (char_len_long) :: & optics_file, & ! netcdf filename fieldname ! field name in netcdf file +#endif character(len=*), parameter :: subname = '(faero_optics)' diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index bce9d7352..00f721119 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -19,14 +19,14 @@ module ice_init use ice_fileunits, only: nu_nml, nu_diag, nml_filename, diag_type, & ice_stdout, get_fileunit, release_fileunit, bfbflag, flush_fileunit, & ice_IOUnitsMinUnit, ice_IOUnitsMaxUnit +#ifdef CESMCOUPLED use ice_fileunits, only: inst_suffix +#endif use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_aggregate use icepack_intfc, only: icepack_init_trcr use icepack_intfc, only: icepack_init_parameters use icepack_intfc, only: icepack_init_tracer_flags - use icepack_intfc, only: icepack_init_tracer_numbers - use icepack_intfc, only: icepack_init_tracer_indices use icepack_intfc, only: icepack_query_tracer_flags use icepack_intfc, only: icepack_query_tracer_numbers use icepack_intfc, only: icepack_query_tracer_indices @@ -107,8 +107,6 @@ subroutine input_data nml_error, & ! namelist i/o error flag n ! loop index - character (len=6) :: chartmp - logical :: exists real (kind=dbl_kind) :: ustar_min, albicev, albicei, albsnowv, albsnowi, & @@ -127,8 +125,6 @@ subroutine input_data logical (kind=log_kind) :: tr_iage, tr_FY, tr_lvl, tr_pond, tr_aero logical (kind=log_kind) :: tr_pond_cesm, tr_pond_lvl, tr_pond_topo - integer (kind=int_kind) :: nt_Tsfc, nt_sice, nt_qice, nt_qsno, nt_iage, nt_FY - integer (kind=int_kind) :: nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, nt_aero integer (kind=int_kind) :: numin, numax ! unit number limits integer (kind=int_kind) :: rpcesm, rplvl, rptopo @@ -1850,7 +1846,7 @@ subroutine boxslotcyl_data_aice(aicen, i, j, & use ice_constants, only: c0, c2, c5, p3, p166, p75, p5 use ice_domain_size, only: nx_global, ny_global, ncat - use ice_grid, only: dxrect, dyrect + use ice_grid, only: dxrect integer (kind=int_kind), intent(in) :: & i, j , & ! local indices diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index fb759cb27..4bbf0aa3b 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -947,8 +947,6 @@ 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, & @@ -970,7 +968,6 @@ 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 @@ -986,9 +983,6 @@ 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 - character(len=*), parameter :: subname = '(ocn_mixed_layer)' !----------------------------------------------------------------- diff --git a/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 index afdfa2dfd..e9eb49db0 100644 --- a/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 +++ b/cicecore/cicedynB/infrastructure/comm/mpi/ice_gather_scatter.F90 @@ -2820,7 +2820,6 @@ subroutine scatter_global_ext(ARRAY, ARRAY_G, src_task, dst_dist) iblk, jblk, &! block indices iglb, jglb, &! global indices nrecvs, &! actual number of messages received - isrc, jsrc, &! source addresses dst_block, &! location of block in dst array ierr ! MPI error flag diff --git a/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 b/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 index 9775a9dad..9c2cfd9fc 100644 --- a/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 +++ b/cicecore/cicedynB/infrastructure/comm/serial/ice_boundary.F90 @@ -3434,8 +3434,7 @@ subroutine ice_HaloUpdate_stress(array1, array2, halo, & ! local variables integer (int_kind) :: & - i,j,n,nmsg, &! dummy loop indices - ierr, &! error or status flag for MPI,alloc + nmsg, &! dummy loop indices nxGlobal, &! global domain size in x (tripole) iSrc,jSrc, &! source addresses for message iDst,jDst, &! dest addresses for message diff --git a/cicecore/cicedynB/infrastructure/ice_domain.F90 b/cicecore/cicedynB/infrastructure/ice_domain.F90 index b4b4c4ab2..1776ff906 100644 --- a/cicecore/cicedynB/infrastructure/ice_domain.F90 +++ b/cicecore/cicedynB/infrastructure/ice_domain.F90 @@ -300,9 +300,11 @@ subroutine init_domain_distribution(KMTG,ULATG) i,j,n ,&! dummy loop indices ig,jg ,&! global indices work_unit ,&! size of quantized work unit +#ifdef ncdf fid ,&! file id varid ,&! var id status ,&! netcdf return code +#endif tblocks_tmp ,&! total number of blocks nblocks_tmp ,&! temporary value of nblocks nblocks_max ! max blocks on proc diff --git a/cicecore/cicedynB/infrastructure/ice_read_write.F90 b/cicecore/cicedynB/infrastructure/ice_read_write.F90 index ff05f4fe3..22d3f8260 100644 --- a/cicecore/cicedynB/infrastructure/ice_read_write.F90 +++ b/cicecore/cicedynB/infrastructure/ice_read_write.F90 @@ -1516,12 +1516,10 @@ subroutine ice_read_nc_z(fid, nrec, varname, work, diag, & ! local variables +#ifdef ncdf real (kind=dbl_kind), dimension(:), allocatable :: & - work_z - - character(len=*), parameter :: subname = '(ice_read_nc_z)' + work_z -#ifdef ncdf ! netCDF file diagnostics: integer (kind=int_kind) :: & varid, & ! netcdf id for field @@ -1532,6 +1530,11 @@ subroutine ice_read_nc_z(fid, nrec, varname, work, diag, & character (char_len) :: & dimname ! dimension name +#endif + + character(len=*), parameter :: subname = '(ice_read_nc_z)' + +#ifdef ncdf allocate(work_z(nilyr)) @@ -1625,8 +1628,8 @@ subroutine ice_write_nc_xy(fid, nrec, varid, work, diag, & amin, amax, asum ! min, max values and sum of input array character (char_len) :: & - lvarname, & ! variable name - dimname ! dimension name + lvarname ! variable name +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:), allocatable :: & work_g1 @@ -1745,8 +1748,8 @@ subroutine ice_write_nc_xyz(fid, nrec, varid, work, diag, & amin, amax, asum ! min, max values and sum of input array character (char_len) :: & - lvarname, & ! variable name - dimname ! dimension name + lvarname ! variable name +! dimname ! dimension name real (kind=dbl_kind), dimension(:,:,:), allocatable :: & work_g1 @@ -2136,15 +2139,11 @@ subroutine ice_read_vec_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 - nvar ! sizes of netcdf vector + status ! status output from netcdf routines real (kind=dbl_kind) :: & amin, amax ! min, max values of input vector - character (char_len) :: & - dimname ! dimension name -! work_g(:) = c0 if (my_task == master_task) then @@ -2194,10 +2193,15 @@ subroutine ice_get_ncvarsize(fid,varname,recsize) varname ! field name in netcdf file integer (kind=int_kind), intent(out) :: & recsize ! Number of records in file + + ! local variables + +#ifdef ncdf integer (kind=int_kind) :: & ndims, i, status character (char_len) :: & cvar +#endif character(len=*), parameter :: subname = '(ice_get_ncvarsize)' #ifdef ncdf diff --git a/cicecore/cicedynB/infrastructure/ice_restoring.F90 b/cicecore/cicedynB/infrastructure/ice_restoring.F90 index 799b263d6..a7851ef07 100644 --- a/cicecore/cicedynB/infrastructure/ice_restoring.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restoring.F90 @@ -57,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, hm - 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) :: & 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 73540f5a9..d1564fab4 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 @@ -56,7 +56,7 @@ subroutine ice_write_hist(ns) ! local variables - integer (kind=int_kind) :: i,k,n,nn,nrec,nbits + integer (kind=int_kind) :: k,n,nn,nrec,nbits character (char_len) :: title character (char_len_long) :: ncfile(max_nstrm), hdrfile diff --git a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 index a9aaef525..4d13540e5 100644 --- a/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_binary/ice_restart.F90 @@ -636,12 +636,10 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, & ! local variables integer (kind=int_kind) :: & - n, & ! number of dimensions for variable - varid, & ! variable id - status ! status variable from netCDF routine + n ! number of dimensions for variable real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: & - work2 ! input array (real, 8-byte) + work2 ! input array (real, 8-byte) character(len=*), parameter :: subname = '(read_restart_field)' @@ -699,12 +697,10 @@ 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 + n ! dimension counter real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: & - work2 ! input array (real, 8-byte) + work2 ! input array (real, 8-byte) character(len=*), parameter :: subname = '(write_restart_field)' @@ -735,8 +731,7 @@ subroutine final_restart() tr_pond_topo, tr_pond_lvl, tr_brine integer (kind=int_kind) :: & - nbtrcr, & ! number of bgc tracers - status + nbtrcr ! number of bgc tracers character(len=*), parameter :: subname = '(final_restart)' diff --git a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 index 83f9bee1a..29efa67f9 100644 --- a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 @@ -134,9 +134,9 @@ subroutine init_restart_write(filename_spec) tr_bgc_hum integer (kind=int_kind) :: & - k, n, & ! index + k, n, & ! index nx, ny, & ! global array size - iyear, imonth, iday, & ! year, month, day + iyear, & ! year nbtrcr ! number of bgc tracers character(len=char_len_long) :: filename @@ -643,11 +643,6 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, & ! local variables - integer (kind=int_kind) :: & - n, & ! number of dimensions for variable - varid, & ! variable id - status ! status variable from netCDF routine - real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: & work2 ! input array (real, 8-byte) 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 ff3d2d6fd..43e5dab74 100644 --- a/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_pio/ice_history_write.F90 @@ -57,7 +57,7 @@ subroutine ice_write_hist (ns) use ice_restart_shared, only: runid, lcdf64 use netcdf #endif - use ice_pio + use ice_pio use pio integer (kind=int_kind), intent(in) :: ns @@ -161,7 +161,7 @@ subroutine ice_write_hist (ns) File%fh=-1 call ice_pio_init(mode='write', filename=trim(filename), File=File, & - clobber=.true., cdf64=lcdf64) + clobber=.true., cdf64=lcdf64) call ice_pio_initdecomp(iodesc=iodesc2d) call ice_pio_initdecomp(ndim3=ncat_hist, iodesc=iodesc3dc) @@ -349,7 +349,7 @@ subroutine ice_write_hist (ns) dimidex(4)=kmtidb dimidex(5)=kmtida - do i = 1, nvarz + do i = 1, nvarz if (igrdz(i)) then status = pio_def_var(File, trim(var_nz(i)%short_name), pio_real, & (/dimidex(i)/), varid) @@ -782,7 +782,7 @@ subroutine ice_write_hist (ns) ! Extra dimensions (NCAT, VGRD*) - do i = 1, nvarz + do i = 1, nvarz if (igrdz(i)) then status = pio_inq_varid(File, var_nz(i)%short_name, varid) SELECT CASE (var_nz(i)%short_name) diff --git a/cicecore/drivers/cesm/ice_comp_esmf.F90 b/cicecore/drivers/cesm/ice_comp_esmf.F90 index 8f682ebe5..8ae80abdc 100644 --- a/cicecore/drivers/cesm/ice_comp_esmf.F90 +++ b/cicecore/drivers/cesm/ice_comp_esmf.F90 @@ -16,7 +16,7 @@ module ice_comp_esmf use shr_sys_mod, only : shr_sys_abort, shr_sys_flush ! use shr_mem_mod, only : shr_get_memusage, shr_init_memusage use shr_file_mod, only : shr_file_getlogunit, shr_file_getloglevel, & - shr_file_setloglevel, shr_file_setlogunit + shr_file_setloglevel, shr_file_setlogunit use mct_mod #ifdef USE_ESMF_LIB use esmf @@ -26,10 +26,10 @@ module ice_comp_esmf use seq_flds_mod use seq_infodata_mod,only : seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch, seq_infodata_start_type_start + seq_infodata_start_type_brnch, seq_infodata_start_type_start use seq_timemgr_mod, only : seq_timemgr_eclockgetdata, & seq_timemgr_restartalarmison, & - seq_timemgr_eclockdateinsync, & + seq_timemgr_eclockdateinsync, & seq_timemgr_stopalarmison use seq_comm_mct, only : seq_comm_suffix, seq_comm_inst, seq_comm_name use perf_mod, only : t_startf, t_stopf, t_barrierf @@ -44,12 +44,12 @@ module ice_comp_esmf use ice_domain, only : nblocks, blocks_ice, halo_info, distrb_info use ice_blocks, only : block, get_block, nx_block, ny_block use ice_grid, only : tlon, tlat, tarea, tmask, anglet, hm, & - grid_type, t2ugrid_vector, gridcpl_file, ocn_gridcell_frac + grid_type, t2ugrid_vector, gridcpl_file, ocn_gridcell_frac use ice_constants, only : c0, c1, spval_dbl, rad_to_deg, radius, secday use ice_communicate, only : my_task, master_task, MPI_COMM_ICE use ice_calendar, only : istep, istep1, force_restart_now, write_ic,& idate, idate0, mday, time, month, daycal, & - sec, dt, dt_dyn, calendar, & + sec, dt, dt_dyn, calendar, & calendar_type, nextsw_cday, days_per_year, & nyr, new_year, time2sec, year_init use icepack_orbital, only : eccen, obliqr, lambm0, mvelpp @@ -694,7 +694,7 @@ subroutine ice_run_esmf(comp, import_state, export_state, EClock, rc) force_restart_now = seq_timemgr_RestartAlarmIsOn(EClock) - if (calendar_type .eq. "GREGORIAN") then + if (calendar_type .eq. "GREGORIAN") then nyrp = nyr nyr = (curr_ymd/10000)+1 ! integer year of basedate if (nyr /= nyrp) then diff --git a/cicecore/drivers/cesm/ice_comp_mct.F90 b/cicecore/drivers/cesm/ice_comp_mct.F90 index da86f91be..7162d6397 100644 --- a/cicecore/drivers/cesm/ice_comp_mct.F90 +++ b/cicecore/drivers/cesm/ice_comp_mct.F90 @@ -14,7 +14,7 @@ module ice_comp_mct use shr_sys_mod, only : shr_sys_abort, shr_sys_flush ! use shr_mem_mod, only : shr_get_memusage, shr_init_memusage use shr_file_mod, only : shr_file_getlogunit, shr_file_getloglevel, & - shr_file_setloglevel, shr_file_setlogunit + shr_file_setloglevel, shr_file_setlogunit use shr_const_mod use mct_mod #ifdef USE_ESMF_LIB @@ -26,11 +26,11 @@ module ice_comp_mct use seq_flds_mod use seq_cdata_mod, only : seq_cdata, seq_cdata_setptrs use seq_infodata_mod,only : seq_infodata_type, seq_infodata_getdata, & - seq_infodata_putdata, seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch, seq_infodata_start_type_start + seq_infodata_putdata, seq_infodata_start_type_cont, & + seq_infodata_start_type_brnch, seq_infodata_start_type_start use seq_timemgr_mod, only : seq_timemgr_eclockgetdata, & seq_timemgr_restartalarmison, & - seq_timemgr_eclockdateinsync, & + seq_timemgr_eclockdateinsync, & seq_timemgr_stopalarmison use seq_comm_mct, only : seq_comm_suffix, seq_comm_inst, seq_comm_name use perf_mod, only : t_startf, t_stopf, t_barrierf @@ -42,13 +42,13 @@ module ice_comp_mct use ice_domain, only : nblocks, blocks_ice, halo_info, distrb_info use ice_blocks, only : block, get_block, nx_block, ny_block use ice_grid, only : tlon, tlat, tarea, tmask, anglet, hm, & - grid_type, t2ugrid_vector, gridcpl_file, ocn_gridcell_frac + grid_type, t2ugrid_vector, gridcpl_file, ocn_gridcell_frac use ice_constants, only : c0, c1, spval_dbl, radius use ice_constants, only : ice_init_constants use ice_communicate, only : my_task, master_task, MPI_COMM_ICE use ice_calendar, only : istep, istep1, force_restart_now, write_ic,& idate, idate0, mday, time, month, daycal, & - sec, dt, dt_dyn, calendar, & + sec, dt, dt_dyn, calendar, & calendar_type, nextsw_cday, days_per_year, & nyr, new_year, time2sec, year_init use ice_timers @@ -579,7 +579,7 @@ subroutine ice_run_mct( EClock, cdata_i, x2i_i, i2x_i ) force_restart_now = seq_timemgr_RestartAlarmIsOn(EClock) -! if (calendar_type .eq. "GREGORIAN") then +! if (calendar_type .eq. "GREGORIAN") then ! nyrp = nyr ! nyr = (curr_ymd/10000)+1 ! integer year of basedate ! if (nyr /= nyrp) then diff --git a/cicecore/drivers/cesm/ice_prescribed_mod.F90 b/cicecore/drivers/cesm/ice_prescribed_mod.F90 index 10c71cc84..eeb217577 100644 --- a/cicecore/drivers/cesm/ice_prescribed_mod.F90 +++ b/cicecore/drivers/cesm/ice_prescribed_mod.F90 @@ -138,7 +138,7 @@ subroutine ice_prescribed_init(compid, gsmap, dom) namelist /ice_prescribed_nml/ & prescribed_ice, & model_year_align, & - stream_year_first , & + stream_year_first , & stream_year_last , & stream_fldVarName , & stream_fldFileName, & diff --git a/cicecore/drivers/cesm/ice_scam.F90 b/cicecore/drivers/cesm/ice_scam.F90 index 86a56d19c..f5280b259 100644 --- a/cicecore/drivers/cesm/ice_scam.F90 +++ b/cicecore/drivers/cesm/ice_scam.F90 @@ -12,4 +12,3 @@ module ice_scam end module ice_scam - diff --git a/cicecore/drivers/cice/CICE_InitMod.F90 b/cicecore/drivers/cice/CICE_InitMod.F90 index 1acbcb873..ddc966b55 100644 --- a/cicecore/drivers/cice/CICE_InitMod.F90 +++ b/cicecore/drivers/cice/CICE_InitMod.F90 @@ -72,12 +72,12 @@ subroutine cice_init use ice_flux, only: init_coupler_flux, init_history_therm, & init_history_dyn, init_flux_atm, init_flux_ocn, alloc_flux use ice_forcing, only: init_forcing_ocn, init_forcing_atmo, & - get_forcing_atmo, get_forcing_ocn, alloc_forcing + get_forcing_atmo, get_forcing_ocn use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, & faero_default, faero_optics, alloc_forcing_bgc use ice_grid, only: init_grid1, init_grid2, alloc_grid use ice_history, only: init_hist, accum_hist - use ice_restart_shared, only: restart, runid, runtype + use ice_restart_shared, only: restart, runtype use ice_init, only: input_data, init_state use ice_init_column, only: init_thermo_vertical, init_shortwave, init_zbgc, input_zbgc, count_tracers use ice_kinds_mod diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index a9f5a9707..af3e681b9 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -44,7 +44,7 @@ module CICE_RunMod subroutine CICE_Run use ice_calendar, only: istep, istep1, time, dt, stop_now, calendar - use ice_forcing, only: get_forcing_atmo, get_forcing_ocn, atm_data_type + use ice_forcing, only: get_forcing_atmo, get_forcing_ocn use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, & faero_default use ice_flux, only: init_flux_atm, init_flux_ocn diff --git a/cicecore/shared/ice_arrays_column.F90 b/cicecore/shared/ice_arrays_column.F90 index 71d03ed94..2ccd2d754 100644 --- a/cicecore/shared/ice_arrays_column.F90 +++ b/cicecore/shared/ice_arrays_column.F90 @@ -279,13 +279,12 @@ module ice_arrays_column subroutine alloc_arrays_column ! Allocate column arrays use ice_exit, only: abort_ice - integer (int_kind) :: nspint, max_nbtrcr, max_algae, max_aero, & + integer (int_kind) :: max_nbtrcr, max_algae, max_aero, & nmodal1, nmodal2, max_don integer (int_kind) :: ierr, ntrcr character(len=*),parameter :: subname='(alloc_arrays_column)' -! call icepack_query_parameters(nspint_out=nspint) call icepack_query_tracer_numbers(ntrcr_out=ntrcr) call icepack_query_tracer_sizes( max_nbtrcr_out=max_nbtrcr, & max_algae_out=max_algae, max_aero_out=max_aero, & diff --git a/cicecore/shared/ice_calendar.F90 b/cicecore/shared/ice_calendar.F90 index a767bdfd7..e7107f42a 100644 --- a/cicecore/shared/ice_calendar.F90 +++ b/cicecore/shared/ice_calendar.F90 @@ -54,10 +54,10 @@ module ice_calendar data daycal366/ 0,31, 60, 91,121,152,182,213,244,274,305,335,366/ real (kind=dbl_kind), parameter :: & - days_per_4c = 146097.0_dbl_kind, & - days_per_c = 36524.0_dbl_kind, & - days_per_4y = 1461.0_dbl_kind, & - days_per_y = 365.0_dbl_kind + days_per_4c = 146097.0_dbl_kind, & + days_per_c = 36524.0_dbl_kind, & + days_per_4y = 1461.0_dbl_kind, & + days_per_y = 365.0_dbl_kind integer (kind=int_kind), public :: & istep , & ! local step counter for time loop diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 3f3a5bfe6..f86984195 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -444,11 +444,11 @@ subroutine init_shortwave !---------------------------------------------------------------- if (runtype == 'initial' .and. .not. restart) then scale_factor(i,j,iblk) = & - swvdr(i,j,iblk)*(c1 - alvdr_ai(i,j,iblk)) & - + swvdf(i,j,iblk)*(c1 - alvdf_ai(i,j,iblk)) & - + swidr(i,j,iblk)*(c1 - alidr_ai(i,j,iblk)) & - + swidf(i,j,iblk)*(c1 - alidf_ai(i,j,iblk)) - endif + swvdr(i,j,iblk)*(c1 - alvdr_ai(i,j,iblk)) & + + swvdf(i,j,iblk)*(c1 - alvdf_ai(i,j,iblk)) & + + swidr(i,j,iblk)*(c1 - alidr_ai(i,j,iblk)) & + + swidf(i,j,iblk)*(c1 - alidf_ai(i,j,iblk)) + endif enddo ! i enddo ! j @@ -895,8 +895,7 @@ subroutine input_zbgc integer (kind=int_kind) :: & nml_error, & ! namelist i/o error flag - k, mm , & ! loop index - ierr, abort_flag + abort_flag character(len=*), parameter :: subname='(input_zbgc)' @@ -1626,7 +1625,6 @@ subroutine count_tracers ! local variables integer (kind=int_kind) :: & - n , & ! loop index k, mm , & ! loop index nk , & ! layer index nk_bgc ! layer index @@ -2116,7 +2114,6 @@ end subroutine count_tracers subroutine init_zbgc - use ice_broadcast, only: broadcast_scalar use ice_state, only: trcr_base, trcr_depend, n_trcr_strata, & nt_strata use ice_arrays_column, only: R_C2N, R_chl2N, R_C2N_DON, R_Si2N @@ -2186,7 +2183,7 @@ subroutine init_zbgc tr_bgc_DMS, tr_bgc_PON, & tr_bgc_N, tr_bgc_C, tr_bgc_chl, & tr_bgc_DON, tr_bgc_Fe, tr_zaero, & - tr_bgc_hum, tr_aero + tr_bgc_hum real (kind=dbl_kind) :: & initbio_frac, & diff --git a/cicecore/shared/ice_restart_column.F90 b/cicecore/shared/ice_restart_column.F90 index 63d095f11..b46e6fdcd 100644 --- a/cicecore/shared/ice_restart_column.F90 +++ b/cicecore/shared/ice_restart_column.F90 @@ -786,9 +786,6 @@ subroutine write_restart_bgc() type (block) :: & this_block ! block information for current block - integer (kind=int_kind) :: & - ipoint - character(len=*),parameter :: subname='(write_restart_bgc)' call icepack_query_parameters(skl_bgc_out=skl_bgc, solve_zsal_out=solve_zsal) diff --git a/icepack b/icepack index 0b442b3fe..423c81679 160000 --- a/icepack +++ b/icepack @@ -1 +1 @@ -Subproject commit 0b442b3fe96d65b3c54c5facbc69653e1b87b740 +Subproject commit 423c81679147ede18b6ae9645ba3bdb74e492552