diff --git a/cicecore/cicedynB/analysis/ice_diagnostics.F90 b/cicecore/cicedynB/analysis/ice_diagnostics.F90 index 37f2c2fc8..a7f92e944 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 @@ -1216,7 +1215,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 @@ -1595,7 +1594,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 @@ -1675,41 +1674,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 b020aaf86..fa965dfe0 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 @@ -14,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 @@ -42,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) :: & @@ -161,25 +155,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, & @@ -870,24 +860,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) :: & @@ -897,16 +883,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 221aa43b5..f06559608 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 @@ -69,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 @@ -1208,9 +1207,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 @@ -1240,9 +1239,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 @@ -1331,7 +1328,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 a0cc6baf2..6106ca016 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 ! @@ -21,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 @@ -1730,8 +1729,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 @@ -1816,14 +1813,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 1b4e13721..605de2307 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 @@ -8,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 @@ -230,8 +228,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_mechred.F90 b/cicecore/cicedynB/analysis/ice_history_mechred.F90 index c990e3487..78edd7a31 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 3fe8ae35a..02844dbea 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 43f9b79c0..97ad37a1b 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 @@ -25,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 @@ -466,7 +464,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 @@ -560,7 +558,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 537c7e408..e7b5bacbc 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 @@ -22,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 @@ -93,7 +92,7 @@ subroutine eap (dt) cosw, sinw, denom1, uvel_init, vvel_init, arlx1i, & dyn_prep1, dyn_prep2, stepu, dyn_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, taubx, tauby, & strocnxT, strocnyT, strax, stray, & @@ -101,8 +100,11 @@ subroutine eap (dt) 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 + 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, & @@ -175,7 +177,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 @@ -396,7 +398,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), & @@ -415,7 +416,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 @@ -529,10 +531,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 @@ -540,21 +540,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 character(len=*), parameter :: subname = '(init_eap)' @@ -716,10 +716,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 character(len=*), parameter :: subname = '(s11kr)' @@ -739,14 +740,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)) @@ -754,7 +755,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 @@ -786,10 +787,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 character(len=*), parameter :: subname = '(s12kr)' @@ -809,20 +811,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 @@ -856,10 +858,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 character(len=*), parameter :: subname = '(s22kr)' @@ -879,20 +882,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 @@ -924,8 +927,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, & @@ -952,9 +957,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)) @@ -993,7 +998,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, & @@ -1019,10 +1025,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)) @@ -1063,7 +1069,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, & @@ -1089,9 +1096,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)) @@ -1135,7 +1142,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, & @@ -1152,7 +1158,8 @@ subroutine stress_eap (nx_block, ny_block, & yieldstress11, & yieldstress12, & yieldstress22, & - rdg_conv, rdg_shear, & +! rdg_conv, rdg_shear, & + rdg_conv, & strtmp) !echmod tmp @@ -1197,7 +1204,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), & @@ -1213,8 +1220,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) :: & @@ -1576,9 +1583,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, & @@ -1586,7 +1590,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 :: & @@ -1956,11 +1960,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 character(len=*), parameter :: subname = '(write_restart_eap)' diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 index 11313ef6f..1b64ff966 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 @@ -88,6 +87,9 @@ subroutine evp (dt) 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_dyn_shared.F90 b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 index c9331844c..f4ea9d7c2 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 @@ -171,10 +170,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 628aef1c5..5a5414f14 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 @@ -16,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 @@ -230,7 +229,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 @@ -1000,7 +999,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 @@ -1758,20 +1757,11 @@ 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 character(len=*), parameter :: subname = '(upwind_field)' - !------------------------------------------------------------------- - ! Define upwind function - !------------------------------------------------------------------- - - upwind(y1,y2,a,h) = p5*dt*h*((a+abs(a))*y1+(a-abs(a))*y2) - !------------------------------------------------------------------- ! upwind transport !------------------------------------------------------------------- @@ -1781,9 +1771,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 @@ -1799,6 +1789,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 9aacdcbe7..efa5a2e51 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 @@ -31,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, & @@ -327,7 +326,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 @@ -1118,7 +1117,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 character(len=*), parameter :: subname = '(construct_fields)' @@ -1279,10 +1278,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_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index 195db2807..51e453d43 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 @@ -330,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 @@ -445,6 +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) sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) do iblk = 1, size(Tf,3) @@ -473,6 +472,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 @@ -492,6 +492,7 @@ subroutine init_coupler_flux strocnyT(:,:,:) = c0 ! ice-ocean stress, y-direction (T-cell) fresh (:,:,:) = c0 fsalt (:,:,:) = c0 +! fpiond (:,:,:) = c0 fhocn (:,:,:) = c0 fswthru (:,:,:) = c0 fresh_da(:,:,:) = c0 ! data assimilation @@ -517,6 +518,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) @@ -579,6 +581,7 @@ subroutine init_flux_ocn fresh (:,:,:) = c0 fsalt (:,:,:) = c0 +! fpond (:,:,:) = c0 fhocn (:,:,:) = c0 fswthru (:,:,:) = c0 faero_ocn(:,:,:,:) = c0 @@ -628,6 +631,7 @@ subroutine init_history_therm fsurf (:,:,:) = c0 fcondtop(:,:,:)= c0 congel (:,:,:) = c0 +! fbot (:,:,:) = c0 frazil (:,:,:) = c0 snoice (:,:,:) = c0 dsnow (:,:,:) = c0 @@ -663,6 +667,7 @@ 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 if (formdrag) then Cdn_atm_rdg (:,:,:) = c0 @@ -694,7 +699,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 @@ -714,6 +719,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_flux_bgc.F90 b/cicecore/cicedynB/general/ice_flux_bgc.F90 index 203780264..0254a6df3 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 07c8d3177..45500791d 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. @@ -20,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 @@ -37,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 @@ -56,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, & @@ -71,7 +67,6 @@ module ice_forcing rain_file, & sst_file, & sss_file, & - pslv_file, & sublim_file, & snow_file @@ -102,8 +97,6 @@ module ice_forcing stray_data, & Qa_data, & rhoa_data, & - potT_data, & - zlvl_data, & flw_data, & sst_data, & sss_data, & @@ -171,6 +164,21 @@ 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 + fyear = fyear_init + mod(nyr-1,ycycle) ! current year fyear_final = fyear_init + ycycle - 1 ! last year in forcing cycle @@ -204,9 +212,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 @@ -260,6 +268,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 @@ -578,7 +591,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 @@ -617,7 +630,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) :: & @@ -916,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 @@ -1008,7 +1021,6 @@ 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 @@ -1017,8 +1029,6 @@ subroutine read_clim_data_nc (readflag, recd, ixm, ixx, ixp, & 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)) & @@ -1267,7 +1277,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 @@ -1280,6 +1289,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) @@ -1301,13 +1311,13 @@ 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 character(len=*), parameter :: subname = '(prepare_forcing)' - 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) @@ -1328,6 +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 enddo ! i enddo ! j @@ -2388,7 +2401,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 @@ -2860,8 +2872,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 @@ -2884,13 +2894,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 (%) @@ -2911,11 +2914,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 @@ -2981,18 +2979,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 character(len=*), parameter :: subname = '(oned_files)' @@ -3040,7 +3033,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 @@ -3660,16 +3653,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 - character(len=*), parameter :: subname = '(ocn_data_oned)' sss (:,:,:) = 34.0_dbl_kind ! sea surface salinity (ppt) @@ -3704,10 +3692,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 @@ -3834,7 +3821,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 @@ -3909,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)' @@ -3924,6 +3911,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 @@ -4031,10 +4020,7 @@ end subroutine read_data_nc_point !======================================================================= - subroutine ISPOL_files(yr) - - integer (kind=int_kind), intent(in) :: & - yr ! current forcing year + subroutine ISPOL_files character(len=*), parameter :: subname = '(ISPOL_files)' @@ -4081,12 +4067,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 @@ -4097,29 +4079,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, & @@ -4139,38 +4101,24 @@ 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 character(len=*), parameter :: subname = '(ISPOL_data)' - 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, & @@ -4354,7 +4302,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 @@ -4363,9 +4310,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 @@ -4377,13 +4322,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 character(len=*), parameter :: subname = '(ocn_data_ispol_init)' diff --git a/cicecore/cicedynB/general/ice_forcing_bgc.F90 b/cicecore/cicedynB/general/ice_forcing_bgc.F90 index 308654a42..b5041412c 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 @@ -12,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 @@ -58,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 @@ -66,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) :: & @@ -392,8 +390,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 @@ -576,7 +574,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 @@ -681,8 +678,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 @@ -692,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 @@ -750,7 +744,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) @@ -772,16 +766,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 @@ -864,7 +855,6 @@ subroutine faero_optics #ifdef ncdf 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 f3a654330..48a4926dc 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 @@ -57,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 @@ -92,7 +91,6 @@ subroutine input_data n ! loop index character (len=6) :: chartmp - character (len=32) :: str logical :: exists @@ -1214,7 +1212,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 @@ -1335,6 +1333,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 @@ -1397,8 +1397,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), & @@ -1474,8 +1474,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, & @@ -1504,8 +1504,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_state.F90 b/cicecore/cicedynB/general/ice_state.F90 index d5dafece1..a9c8b1541 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 45d9fe3e3..083cbd5eb 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. @@ -49,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 @@ -74,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 @@ -83,6 +77,11 @@ subroutine prep_radiation (dt, 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 @@ -138,9 +137,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, & @@ -149,10 +146,10 @@ 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 + 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 @@ -279,6 +276,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), & @@ -385,9 +383,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, & @@ -534,7 +530,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), & @@ -629,10 +625,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, & @@ -642,7 +636,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 @@ -930,6 +924,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, & @@ -945,15 +941,13 @@ 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) integer (kind=int_kind) :: & + ilo,ihi,jlo,jhi, & ! beginning and end of physical domain i, j , & ! horizontal indices ij ! combined ij index @@ -969,6 +963,9 @@ 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)' !----------------------------------------------------------------- @@ -986,8 +983,18 @@ subroutine ocean_mixed_layer (dt, iblk) icells = 0 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 + +! do j = jlo, jhi +! do i = ilo, ihi do j = 1, ny_block do i = 1, nx_block + if (tmask(i,j,iblk)) then icells = icells + 1 indxi(icells) = i @@ -1083,7 +1090,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, & @@ -1091,8 +1098,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 @@ -1114,9 +1119,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/comm/mpi/ice_boundary.F90 b/cicecore/cicedynB/infrastructure/comm/mpi/ice_boundary.F90 index f34487900..24222e3f0 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 @@ -225,7 +222,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 @@ -244,7 +240,6 @@ function ice_HaloCreate(dist, nsBoundaryType, ewBoundaryType, & endif else - tripoleFlag = .false. tripoleTFlag = .false. endif halo%tripoleTFlag = tripoleTFlag @@ -5131,7 +5126,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 @@ -5150,8 +5145,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 @@ -5508,7 +5502,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 @@ -6734,6 +6727,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 e1461b5d7..9ae56f60c 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 bf522dce7..6483f2a99 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 15ca05fd0..92bb1c0e7 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 963e47034..af520d999 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 c27ec2f19..c315d99b9 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 387935bcf..8edd0e281 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 9ab0c7513..9775a9dad 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 @@ -178,7 +175,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 @@ -198,7 +194,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 0c778a300..8532f23b7 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 31e221460..76c84395e 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 0f7c7bf31..eb1b331af 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 b8a9c6c35..e08496a17 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 65201d603..6768d67bf 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 e1f414146..9a8e20a83 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 326dbebf8..0b0b45dc7 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 259ba985d..f10631aa3 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, broadcast_array use ice_blocks, only: block, get_block, create_blocks, nghost, & @@ -41,7 +40,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 diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 1ea454d45..8f41d8360 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 @@ -293,9 +291,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 @@ -306,6 +306,8 @@ subroutine init_grid2 ! T-grid cell and U-grid cell quantities !----------------------------------------------------------------- +! tarea(:,:,:) = 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) @@ -641,7 +643,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 @@ -764,6 +766,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 @@ -776,9 +779,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 @@ -829,7 +830,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, puny_out=puny) call icepack_warnings_flush(nu_diag) @@ -1036,10 +1036,10 @@ subroutine latlongrid !$OMP END PARALLEL DO call makemask -#endif #endif end subroutine latlongrid +#endif !======================================================================= @@ -1052,7 +1052,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, & @@ -1331,11 +1330,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 @@ -1403,11 +1400,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 @@ -1514,6 +1509,8 @@ subroutine makemask !----------------------------------------------------------------- bm = c0 +! uvm = 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 +1945,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) @@ -1985,6 +1985,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 @@ -2289,17 +2291,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 diff --git a/cicecore/cicedynB/infrastructure/ice_read_write.F90 b/cicecore/cicedynB/infrastructure/ice_read_write.F90 index 4ca2f6360..20eff9765 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 @@ -560,7 +559,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 @@ -580,10 +578,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 @@ -1082,16 +1076,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 @@ -1254,18 +1248,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 @@ -1399,8 +1393,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 @@ -1412,14 +1406,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 character(len=*), parameter :: subname = '(ice_read_nc_point)' @@ -1492,7 +1486,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 @@ -1506,14 +1500,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 :: & @@ -1617,10 +1611,10 @@ 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 @@ -1737,11 +1731,11 @@ 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 @@ -1865,16 +1859,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 :: & @@ -2017,16 +2011,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 6f36087dc..86bc598a0 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 @@ -23,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 @@ -53,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 @@ -71,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 @@ -204,21 +198,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 @@ -228,15 +222,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 @@ -244,9 +231,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 character(len=*), parameter :: subname = '(restartfile)' diff --git a/cicecore/cicedynB/infrastructure/ice_restoring.F90 b/cicecore/cicedynB/infrastructure/ice_restoring.F90 index 27de6ab05..5ac3253a8 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. @@ -9,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 @@ -126,7 +124,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), & @@ -290,7 +288,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, & @@ -315,8 +313,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_binary/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_binary/ice_history_write.F90 index 9e83da25b..e72f050ce 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 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/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_history_write.F90 index eb090cfac..855e607a3 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 @@ -79,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) @@ -126,7 +125,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/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 index 9b888fa25..7e9e93e01 100644 --- a/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 +++ b/cicecore/cicedynB/infrastructure/io/io_netcdf/ice_restart.F90 @@ -10,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 @@ -38,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 @@ -178,8 +177,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)), & @@ -621,7 +618,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) @@ -706,7 +703,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 @@ -729,7 +726,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 80567fb64..4372ab213 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 ddd5c0ecd..64a6bea86 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 42b3f4794..05e3da174 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 e4af39753..1efffec96 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 43870e1bb..9a41ac707 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 1475e0f56..d6bf2a3fc 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 f46e97dc1..689cf80d5 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. @@ -73,7 +72,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_FinalMod.F90 b/cicecore/drivers/cice/CICE_FinalMod.F90 index 7ce8c907c..c76be767f 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 07043693e..482c9085e 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 @@ -59,8 +58,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 @@ -68,13 +66,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 @@ -96,7 +94,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 @@ -133,7 +131,7 @@ subroutine cice_init if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) - call calendar(time) ! determine the initial date +! call calendar(time) ! determine the initial date call init_forcing_ocn(dt) ! initialize sss and sst from data call init_state ! initialize the ice state @@ -149,7 +147,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 @@ -209,7 +207,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, & @@ -223,7 +220,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 @@ -296,7 +293,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/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index 4515b6f43..05cb998da 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. @@ -46,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, & @@ -135,7 +134,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, & @@ -149,7 +147,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 @@ -206,7 +203,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 @@ -284,9 +281,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 @@ -325,20 +322,25 @@ 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, 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, & - 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 @@ -348,11 +350,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 ! @@ -413,7 +419,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 = jlo, jhi +! do i = ilo, ihi do j = 1, ny_block do i = 1, nx_block if (aicen(i,j,n,iblk) > puny) then @@ -516,6 +531,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 @@ -531,11 +547,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 @@ -575,7 +593,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) :: & @@ -606,10 +623,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/drivers/cice/CICE_RunMod.F90_debug b/cicecore/drivers/cice/CICE_RunMod.F90_debug index 4ce48bcd9..72e8f86df 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 1228 2017-05-23 21:33:34Z tcraig $ !======================================================================= ! ! 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 70a2ea707..811c5d0d1 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 789c0ba9d..6741521b9 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/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 d0e36d99f..c721281ba 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_constants.F90 b/cicecore/shared/ice_constants.F90 index 40d186783..7b59f3dee 100644 --- a/cicecore/shared/ice_constants.F90 +++ b/cicecore/shared/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_distribution.F90 b/cicecore/shared/ice_distribution.F90 index 5a7facdaf..fa49adbc9 100644 --- a/cicecore/shared/ice_distribution.F90 +++ b/cicecore/shared/ice_distribution.F90 @@ -1,4 +1,3 @@ -! SVN:$Id: ice_distribution.F90 732 2013-09-19 18:19:31Z eclare $ !||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| module ice_distribution @@ -606,6 +605,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 @@ -659,6 +664,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 @@ -760,6 +770,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 @@ -775,6 +790,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 @@ -790,6 +810,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 !---------------------------------------------------------------------- ! @@ -808,6 +833,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 @@ -826,6 +856,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 @@ -845,6 +880,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 !---------------------------------------------------------------------- ! @@ -867,6 +907,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 @@ -887,6 +932,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 @@ -902,8 +952,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 @@ -1016,6 +1076,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)) @@ -1075,6 +1140,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 @@ -1546,6 +1616,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)) @@ -1763,6 +1838,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 @@ -1839,6 +1919,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)) !---------------------------------------------------------------------- @@ -1922,6 +2007,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 @@ -2263,7 +2353,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 character(len=*),parameter :: subname='(ice_distributionRake)' @@ -2281,7 +2371,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 aec762d33..45d3193c2 100644 --- a/cicecore/shared/ice_fileunits.F90 +++ b/cicecore/shared/ice_fileunits.F90 @@ -278,11 +278,10 @@ 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) +#ifndef NO_F2003 + flush(iunit) +#else +! Place holder for old call. #endif #endif diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 5418661d9..17500c81b 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. @@ -115,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 @@ -136,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) :: & @@ -148,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) :: & @@ -187,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 @@ -426,17 +422,22 @@ 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 character(len=*),parameter :: subname='(init_lvl)' alvl(:,:,:) = c1 ! level ice area fraction vlvl(:,:,:) = c1 ! level ice volume + ffracn(:,:,:,iblk) = c0 + dhsn(:,:,:,iblk) = c0 end subroutine init_lvl @@ -518,11 +519,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, & @@ -530,28 +527,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 @@ -963,11 +955,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) @@ -980,13 +972,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) @@ -1000,7 +992,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) @@ -1732,9 +1724,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 @@ -1767,33 +1759,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 @@ -1856,7 +1848,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=kn_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 1e0ac2f16..63d095f11 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. @@ -13,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 @@ -729,7 +728,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 @@ -747,8 +746,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 diff --git a/cicecore/shared/ice_restart_shared.F90 b/cicecore/shared/ice_restart_shared.F90 index d0943a604..82b82c5ce 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 6b5662274..ed108e1c7 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 @@ -124,6 +123,7 @@ recursive function Cinco(l,type,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 @@ -638,6 +638,7 @@ recursive function PeanoM(l,type,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 !-------------------------------------------------------------- @@ -862,6 +863,7 @@ recursive function Hilbert(l,type,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 !-------------------------------------------------------------- diff --git a/configuration/scripts/machines/Macros.hobart_intel b/configuration/scripts/machines/Macros.hobart_intel index a01582f86..f4176eaf1 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) @@ -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 9d2dd6cf0..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/default +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 diff --git a/doc/source/master_list.bib b/doc/source/master_list.bib index d3be30f54..0e2f96cb5 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 * % ****************************************