diff --git a/cice.setup b/cice.setup index 6901dfbb1..e7ddc90b5 100755 --- a/cice.setup +++ b/cice.setup @@ -499,6 +499,13 @@ foreach compiler ( $ncompilers ) set casescr = "${casedir}/casescripts" if !( -d ${casescr}) mkdir ${casescr} + # set default test output as failure + if (${docase} == 0) then + echo "#---" >! test_output + echo "FAIL ${testname_noid} build" >> test_output + echo "FAIL ${testname_noid} run" >> test_output + endif + # from basic script dir to case foreach file (cice.build cice.settings Makefile ice_in makdep.c setup_run_dirs.csh) if !(-e ${ICE_SCRIPTS}/$file) then @@ -703,6 +710,7 @@ EOF1 # from test options to casescr in case any test time changes are applied if (-e ${ICE_SCRIPTS}/tests/test_${test}.files) then cp -f -p ${ICE_SCRIPTS}/tests/test_${test}.files ${casescr} + cp -f -p ${ICE_SCRIPTS}/tests/comparebfb.csh ${casescr} foreach file (`cat ${casescr}/test_${test}.files`) if (-e ${ICE_SCRIPTS}/options/$file) then cp -f -p ${ICE_SCRIPTS}/options/$file ${casescr} @@ -758,6 +766,10 @@ EOF2 ${casescr}/parse_settings.sh cice.settings ${fsmods} ${casescr}/parse_namelist.sh ice_in ${fimods} + if ($status != 0) then + echo "${0}: ERROR, parse_namelist.sh aborted" + exit -1 + endif source ./cice.settings source ./env.${machcomp} -nomodules || exit 2 ${casescr}/parse_namelist_from_env.sh ice_in @@ -785,9 +797,9 @@ EOF2 exit -1 endif - # Initial test_output file - echo "#---" >! test_output - echo "PEND ${testname_noid} " >> test_output +# # Initial test_output file +# echo "#---" >! test_output +# echo "PEND ${testname_noid} " >> test_output endif #------------------------------------------------------------ @@ -837,7 +849,7 @@ cat >> ./${tsdir}/results.csh << EOF cat ./results.log set pends = \`cat ./results.log | grep PEND | wc -l\` set failures = \`cat ./results.log | grep FAIL | wc -l\` -set success = \`cat ./results.log | grep PASS | wc -l\` +set success = \`cat ./results.log | grep 'PASS\|COPY' | wc -l\` set comments = \`cat ./results.log | grep "#" | wc -l\` set alltotal = \`cat ./results.log | wc -l\` @ total = \$alltotal - \$comments diff --git a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 index b2202369d..5ee0c8ba9 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_eap.F90 @@ -19,6 +19,7 @@ module ice_dyn_eap use ice_kinds_mod use ice_blocks, only: nx_block, ny_block + use ice_communicate, only: my_task, master_task use ice_domain_size, only: max_blocks, ncat use ice_constants, only: c0, c1, c2, c3, c12, p1, p2, p5, & p001, p027, p055, p111, p166, p222, p25, p333 @@ -27,9 +28,6 @@ module ice_dyn_eap use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_query_parameters use icepack_intfc, only: icepack_ice_strength -#ifdef CICE_IN_NEMO - use icepack_intfc, only: calc_strair -#endif implicit none private @@ -133,9 +131,6 @@ 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, to_ugrid, t2ugrid_vector, u2tgrid_vector use ice_state, only: aice, vice, vsno, uvel, vvel, divu, shear, & @@ -182,6 +177,8 @@ subroutine eap (dt) real (kind=dbl_kind), dimension(nx_block,ny_block,8):: & strtmp ! stress combinations for momentum equation + logical (kind=log_kind) :: calc_strair + integer (kind=int_kind), dimension (nx_block,ny_block,max_blocks) :: & icetmask, & ! ice extent mask (T-cell) halomask ! ice mask for halo update @@ -258,21 +255,22 @@ subroutine eap (dt) call to_ugrid(tmass,umass) call to_ugrid(aice_init, aiu) -#ifdef CICE_IN_NEMO !---------------------------------------------------------------- - ! Set wind stress to values supplied via NEMO + ! Set wind stress to values supplied via NEMO or other forcing ! This wind stress is rotated on u grid and multiplied by aice !---------------------------------------------------------------- + call icepack_query_parameters(calc_strair_out=calc_strair) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + if (.not. calc_strair) then strairx(:,:,:) = strax(:,:,:) strairy(:,:,:) = stray(:,:,:) else -#endif call t2ugrid_vector(strairx) call t2ugrid_vector(strairy) -#ifdef CICE_IN_NEMO endif -#endif ! tcraig, tcx, turned off this threaded region, in evp, this block and ! the icepack_ice_strength call seems to not be thread safe. more @@ -416,7 +414,7 @@ subroutine eap (dt) ! stress tensor equation, total surface stress !----------------------------------------------------------------- - !$OMP PARALLEL DO PRIVATE(iblk,strtmp) + !$TCXOMP PARALLEL DO PRIVATE(iblk,strtmp) do iblk = 1, nblocks ! call ice_timer_start(timer_tmp1) ! dynamics @@ -502,7 +500,7 @@ subroutine eap (dt) endif ! call ice_timer_stop(timer_tmp3) ! dynamics enddo - !$OMP END PARALLEL DO + !$TCXOMP END PARALLEL DO call ice_timer_start(timer_bound) if (maskhalo_dyn) then @@ -1624,7 +1622,7 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & gamma, alpha, x, y, dx, dy, da, & invdx, invdy, invda, invsin, & invleng, dtemp1, dtemp2, atempprime, & - puny, pi, pi2, piq + puny, pi, pi2, piq, pih real (kind=dbl_kind), parameter :: & kfriction = 0.45_dbl_kind @@ -1632,7 +1630,7 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & character(len=*), parameter :: subname = '(update_stress_rdg)' call icepack_query_parameters(puny_out=puny, & - pi_out=pi, pi2_out=pi2, piq_out=piq) + pi_out=pi, pi2_out=pi2, piq_out=piq, pih_out=pih) call icepack_warnings_flush(nu_diag) if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & file=__FILE__, line=__LINE__) @@ -1649,8 +1647,12 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & a22 = c1-a11 -! gamma: angle between general coordiantes and principal axis - gamma = p5*atan2((c2*a12),(a11 - a22)) +! gamma: angle between general coordiantes and principal axis + if ((a11-a22) == c0) then + gamma = p5*(pih) + else + gamma = p5*atan2((c2*a12),(a11 - a22)) + endif ! rotational tensor from general coordinates into principal axis Q11 = cos(gamma) @@ -1673,7 +1675,11 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & dtemp22 = p5*(divu - tension) ! alpha: angle between general coordiantes and principal axis - alpha = p5*atan2((c2*dtemp12),(dtemp11 - dtemp22)) + if ((dtemp11-dtemp22) == c0) then + alpha = p5*(pih) + else + alpha = p5*atan2((c2*dtemp12),(dtemp11 - dtemp22)) + endif ! y: angle between major principal axis of strain rate and structure tensor ! to make sure y between 0 and pi/2 @@ -1699,7 +1705,11 @@ subroutine update_stress_rdg (ksub, ndte, divu, tension, & invleng = c1/sqrt(dtemp1*dtemp1 + dtemp2*dtemp2) dtemp1 = dtemp1*invleng dtemp2 = dtemp2*invleng - x = atan2(dtemp2,dtemp1) + if ((dtemp1) == c0) then + x = (pih) + else + x = atan2(dtemp2,dtemp1) + endif endif !echmod to ensure the angle lies between pi/4 and 9 pi/4 @@ -1928,7 +1938,7 @@ subroutine calc_ffrac (blockno, stressp, stressm, & real (kind=dbl_kind) :: & sigma11, sigma12, sigma22, & - gamma, sigma_1, sigma_2, & + gamma, sigma_1, sigma_2, pih, & Q11, Q12, Q11Q11, Q11Q12, Q12Q12 real (kind=dbl_kind), parameter :: & @@ -1937,11 +1947,20 @@ subroutine calc_ffrac (blockno, stressp, stressm, & character(len=*), parameter :: subname = '(calc_ffrac)' + call icepack_query_parameters(pih_out=pih) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + sigma11 = p5*(stressp+stressm) sigma12 = stress12 sigma22 = p5*(stressp-stressm) - gamma = p5*atan2((c2*sigma12),(sigma11-sigma22)) + if ((sigma11-sigma22) == c0) then + gamma = p5*(pih) + else + gamma = p5*atan2((c2*sigma12),(sigma11-sigma22)) + endif ! rotate tensor to get into sigma principal axis @@ -2023,7 +2042,6 @@ subroutine read_restart_eap() use ice_blocks, only: nghost use ice_boundary, only: ice_HaloUpdate_stress - use ice_communicate, only: my_task, master_task use ice_constants, only: & field_loc_center, field_type_scalar use ice_domain, only: nblocks, halo_info diff --git a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 index b8994b768..8ffa5aaad 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_evp.F90 @@ -45,9 +45,6 @@ module ice_dyn_evp use ice_exit, only: abort_ice use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted use icepack_intfc, only: icepack_ice_strength, icepack_query_parameters -#ifdef CICE_IN_NEMO - use icepack_intfc, only: calc_strair -#endif implicit none private @@ -87,9 +84,6 @@ 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 @@ -134,6 +128,8 @@ subroutine evp (dt) real (kind=dbl_kind), dimension(nx_block,ny_block,8):: & strtmp ! stress combinations for momentum equation + logical (kind=log_kind) :: calc_strair + integer (kind=int_kind), dimension (nx_block,ny_block,max_blocks) :: & icetmask, & ! ice extent mask (T-cell) halomask ! generic halo mask @@ -217,21 +213,22 @@ subroutine evp (dt) call to_ugrid(tmass,umass) call to_ugrid(aice_init, aiu) -#ifdef CICE_IN_NEMO !---------------------------------------------------------------- - ! Set wind stress to values supplied via NEMO + ! Set wind stress to values supplied via NEMO or other forcing ! This wind stress is rotated on u grid and multiplied by aice !---------------------------------------------------------------- + call icepack_query_parameters(calc_strair_out=calc_strair) + call icepack_warnings_flush(nu_diag) + if (icepack_warnings_aborted()) call abort_ice(error_message=subname, & + file=__FILE__, line=__LINE__) + if (.not. calc_strair) then strairx(:,:,:) = strax(:,:,:) strairy(:,:,:) = stray(:,:,:) else -#endif - call t2ugrid_vector(strairx) - call t2ugrid_vector(strairy) -#ifdef CICE_IN_NEMO + call t2ugrid_vector(strairx) + call t2ugrid_vector(strairy) endif -#endif ! tcraig, tcx, threading here leads to some non-reproducbile results and failures in icepack_ice_strength ! need to do more debugging @@ -353,7 +350,7 @@ subroutine evp (dt) ! stress tensor equation, total surface stress !----------------------------------------------------------------- - !$OMP PARALLEL DO PRIVATE(iblk,strtmp) + !$TCXOMP PARALLEL DO PRIVATE(iblk,strtmp) do iblk = 1, nblocks ! if (trim(yield_curve) == 'ellipse') then @@ -403,7 +400,7 @@ subroutine evp (dt) fld2(:,:,1,iblk) = uvel(:,:,iblk) fld2(:,:,2,iblk) = vvel(:,:,iblk) enddo - !$OMP END PARALLEL DO + !$TCXOMP END PARALLEL DO call ice_timer_start(timer_bound) if (maskhalo_dyn) then diff --git a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 index 01adcee79..aa0285869 100644 --- a/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 +++ b/cicecore/cicedynB/dynamics/ice_dyn_shared.F90 @@ -28,9 +28,14 @@ module ice_dyn_shared ! namelist parameters integer (kind=int_kind), public :: & - kdyn , & ! type of dynamics ( 1 = evp, 2 = eap ) + kdyn , & ! type of dynamics ( -1, 0 = off, 1 = evp, 2 = eap ) + kridge , & ! set to "-1" to turn off ridging + ktransport , & ! set to "-1" to turn off transport ndte ! number of subcycles: ndte=dt/dte + character (len=char_len), public :: & + coriolis ! 'constant', 'zero', or 'latitude' + logical (kind=log_kind), public :: & revised_evp ! if true, use revised evp procedure @@ -148,8 +153,13 @@ subroutine init_evp (dt) rdg_shear(i,j,iblk) = c0 ! Coriolis parameter -!! fcor_blk(i,j,iblk) = 1.46e-4_dbl_kind ! Hibler 1979, N. Hem; 1/s - fcor_blk(i,j,iblk) = c2*omega*sin(ULAT(i,j,iblk)) ! 1/s + if (trim(coriolis) == 'constant') then + fcor_blk(i,j,iblk) = 1.46e-4_dbl_kind ! Hibler 1979, N. Hem; 1/s + else if (trim(coriolis) == 'zero') then + fcor_blk(i,j,iblk) = 0.0 + else + fcor_blk(i,j,iblk) = c2*omega*sin(ULAT(i,j,iblk)) ! 1/s + endif ! stress tensor, kg/s^2 stressp_1 (i,j,iblk) = c0 diff --git a/cicecore/cicedynB/general/ice_flux.F90 b/cicecore/cicedynB/general/ice_flux.F90 index 2d0797ef6..be06417d1 100644 --- a/cicecore/cicedynB/general/ice_flux.F90 +++ b/cicecore/cicedynB/general/ice_flux.F90 @@ -28,6 +28,9 @@ module ice_flux public :: init_coupler_flux, init_history_therm, init_history_dyn, & init_flux_ocn, init_flux_atm, scale_fluxes, alloc_flux + character (char_len), public :: & + default_season ! seasonal default values for forcing + !----------------------------------------------------------------- ! Dynamics component !----------------------------------------------------------------- @@ -529,22 +532,9 @@ subroutine init_coupler_flux integer (kind=int_kind) :: n -#ifdef CESMCOUPLED - logical (kind=log_kind), parameter :: & - l_winter = .false. , & ! winter/summer default switch - l_spring = .false. ! spring example -#else - logical (kind=log_kind), parameter :: & - l_winter = .true. , & ! winter/summer default switch - l_spring = .false. ! spring example -#endif - - real (kind=dbl_kind) :: fcondtopn_d(6), fsurfn_d(6), & - stefan_boltzmann, & - Tffresh, & - vonkar, & - zref, & - iceruf + real (kind=dbl_kind) :: fcondtopn_d(6), fsurfn_d(6) + real (kind=dbl_kind) :: stefan_boltzmann, Tffresh + real (kind=dbl_kind) :: vonkar, zref, iceruf integer :: i, j, iblk @@ -572,24 +562,8 @@ subroutine init_coupler_flux stray (:,:,:) = 0.05_dbl_kind fsnow (:,:,:) = c0 ! snowfall rate (kg/m2/s) ! fsnow must be 0 for exact restarts - if (l_spring) then - !typical spring values - potT (:,:,:) = 263.15_dbl_kind ! air potential temp (K) - Tair (:,:,:) = 263.15_dbl_kind ! air temperature (K) - Qa (:,:,:) = 0.001_dbl_kind ! specific humidity (kg/kg) - swvdr (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) - swvdf (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) - swidr (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) - swidf (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) - flw (:,:,:) = 230.0_dbl_kind ! incoming longwave rad (W/m^2) - do n = 1, ncat ! surface heat flux (W/m^2) - fsurfn_f(:,:,n,:) = fsurfn_d(n) - enddo - fcondtopn_f(:,:,:,:) = 0.0_dbl_kind ! conductive heat flux (W/m^2) - flatn_f(:,:,:,:) = -1.0_dbl_kind ! latent heat flux (W/m^2) - fsensn_f(:,:,:,:) = c0 ! sensible heat flux (W/m^2) - elseif (l_winter) then - !typical winter values + if (trim(default_season) == 'winter') then + ! typical winter values potT (:,:,:) = 253.0_dbl_kind ! air potential temp (K) Tair (:,:,:) = 253.0_dbl_kind ! air temperature (K) Qa (:,:,:) = 0.0006_dbl_kind ! specific humidity (kg/kg) @@ -599,14 +573,14 @@ subroutine init_coupler_flux swidf (:,:,:) = c0 ! shortwave radiation (W/m^2) flw (:,:,:) = c180 ! incoming longwave rad (W/m^2) frain (:,:,:) = c0 ! rainfall rate (kg/m2/s) - do n = 1, ncat ! conductive heat flux (W/m^2) + do n = 1, ncat ! conductive heat flux (W/m^2) fcondtopn_f(:,:,n,:) = fcondtopn_d(n) enddo - fsurfn_f = fcondtopn_f ! surface heat flux (W/m^2) - flatn_f(:,:,:,:) = c0 ! latent heat flux (kg/m2/s) - fsensn_f(:,:,:,:) = c0 ! sensible heat flux (W/m^2) - else - !typical summer values + fsurfn_f = fcondtopn_f ! surface heat flux (W/m^2) + flatn_f (:,:,:,:) = c0 ! latent heat flux (kg/m2/s) + fsensn_f(:,:,:,:) = c0 ! sensible heat flux (W/m^2) + elseif (trim(default_season) == 'summer') then + ! typical summer values potT (:,:,:) = 273.0_dbl_kind ! air potential temp (K) Tair (:,:,:) = 273.0_dbl_kind ! air temperature (K) Qa (:,:,:) = 0.0035_dbl_kind ! specific humidity (kg/kg) @@ -616,13 +590,30 @@ subroutine init_coupler_flux swidf (:,:,:) = 50._dbl_kind ! shortwave radiation (W/m^2) flw (:,:,:) = 280.0_dbl_kind ! incoming longwave rad (W/m^2) frain (:,:,:) = c0 ! rainfall rate (kg/m2/s) - do n = 1, ncat ! surface heat flux (W/m^2) + do n = 1, ncat ! surface heat flux (W/m^2) + fsurfn_f(:,:,n,:) = fsurfn_d(n) + enddo + fcondtopn_f(:,:,:,:) = 0.0_dbl_kind ! conductive heat flux (W/m^2) + flatn_f (:,:,:,:) = -2.0_dbl_kind ! latent heat flux (W/m^2) + fsensn_f (:,:,:,:) = c0 ! sensible heat flux (W/m^2) + else + ! typical spring values + potT (:,:,:) = 263.15_dbl_kind ! air potential temp (K) + Tair (:,:,:) = 263.15_dbl_kind ! air temperature (K) + Qa (:,:,:) = 0.001_dbl_kind ! specific humidity (kg/kg) + swvdr (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) + swvdf (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) + swidr (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) + swidf (:,:,:) = 25._dbl_kind ! shortwave radiation (W/m^2) + flw (:,:,:) = 230.0_dbl_kind ! incoming longwave rad (W/m^2) + frain (:,:,:) = c0 ! rainfall rate (kg/m2/s) + do n = 1, ncat ! surface heat flux (W/m^2) fsurfn_f(:,:,n,:) = fsurfn_d(n) enddo - fcondtopn_f(:,:,:,:) = 0.0_dbl_kind ! conductive heat flux (W/m^2) - flatn_f(:,:,:,:) = -2.0_dbl_kind ! latent heat flux (W/m^2) - fsensn_f(:,:,:,:) = c0 ! sensible heat flux (W/m^2) - endif ! l_winter + fcondtopn_f(:,:,:,:) = c0 ! conductive heat flux (W/m^2) + flatn_f (:,:,:,:) = -1.0_dbl_kind ! latent heat flux (W/m^2) + fsensn_f (:,:,:,:) = c0 ! sensible heat flux (W/m^2) + endif ! faero_atm (:,:,:,:) = c0 ! aerosol deposition rate (kg/m2/s) flux_bio_atm (:,:,:,:) = c0 ! zaero and bio deposition rate (kg/m2/s) diff --git a/cicecore/cicedynB/general/ice_forcing.F90 b/cicecore/cicedynB/general/ice_forcing.F90 index 41bcf967e..6eaf4151b 100644 --- a/cicecore/cicedynB/general/ice_forcing.F90 +++ b/cicecore/cicedynB/general/ice_forcing.F90 @@ -29,7 +29,7 @@ module ice_forcing use ice_timers, only: ice_timer_start, ice_timer_stop, timer_readwrite, & timer_bound use ice_arrays_column, only: oceanmixed_ice, restore_bgc - use ice_constants, only: c0, c1, c2, c4, c10, c12, c20, & + use ice_constants, only: c0, c1, c2, c3, c4, c5, c10, c12, c20, & c180, c365, c1000, c3600 use ice_constants, only: p001, p01, p1, p25, p5, p6 use ice_constants, only: cm_to_m @@ -115,8 +115,8 @@ module ice_forcing ocn_data_format, & ! 'bin'=binary or 'nc'=netcdf atm_data_type, & ! 'default', 'monthly', 'ncar', ! 'LYq' or 'hadgem' or 'oned' - sss_data_type, & ! 'default', 'clim', 'ncar', 'oned' - sst_data_type, & ! 'default', 'clim', 'ncar', 'oned', + bgc_data_type, & ! 'default', 'clim', 'ncar', 'oned' + ocn_data_type, & ! 'default', 'clim', 'ncar', 'oned', ! 'hadgem_sst' or 'hadgem_sst_uvocn' precip_units ! 'mm_per_month', 'mm_per_sec', 'mks' @@ -140,7 +140,7 @@ module ice_forcing ocn_frc_m ! ocn data for 12 months logical (kind=log_kind), public :: & - restore_sst ! restore sst if true + restore_ocn ! restore sst if true integer (kind=int_kind), public :: & trestore ! restoring time scale (days) @@ -240,6 +240,8 @@ subroutine init_forcing_atmo call oned_files elseif (trim(atm_data_type) == 'ISPOL') then call ISPOL_files + elseif (trim(atm_data_type) == 'box') then + call box_data endif end subroutine init_forcing_atmo @@ -253,9 +255,9 @@ subroutine init_forcing_ocn(dt) ! Read sst data for current month, and adjust sst based on freezing ! temperature. No interpolation in time. -! Note: SST is subsequently prognosed if CICE is run with a mixed layer -! ocean (oceanmixed_ice = T), and can be restored to data -! (restore_sst = T). SSS is not prognosed by CICE. +! Note: SST is subsequently prognosed if CICE is run +! with a mixed layer ocean (oceanmixed_ice = T), and can be +! restored to data (restore_ocn = T). use ice_blocks, only: nx_block, ny_block use ice_domain, only: nblocks @@ -300,7 +302,7 @@ subroutine init_forcing_ocn(dt) nbits = 64 ! double precision data - if (restore_sst .or. restore_bgc) then + if (restore_ocn .or. restore_bgc) then if (trestore == 0) then trest = dt ! use data instantaneously else @@ -313,7 +315,7 @@ subroutine init_forcing_ocn(dt) ! initialize to annual climatology created from monthly data !------------------------------------------------------------------- - if (trim(sss_data_type) == 'clim') then + if (trim(bgc_data_type) == 'clim') then sss_file = trim(ocn_data_dir)//'/sss.mm.100x116.da' ! gx3 only @@ -357,14 +359,14 @@ subroutine init_forcing_ocn(dt) if (my_task == master_task) close(nu_forcing) - endif ! sss_data_type + endif ! bgc_data_type !------------------------------------------------------------------- ! Sea surface temperature (SST) ! initialize to data for current month !------------------------------------------------------------------- - if (trim(sst_data_type) == 'clim') then + if (trim(ocn_data_type) == 'clim') then if (nx_global == 320) then ! gx1 sst_file = trim(ocn_data_dir)//'/sst_clim_hurrell.dat' @@ -399,8 +401,8 @@ subroutine init_forcing_ocn(dt) endif ! init_sst_data - if (trim(sst_data_type) == 'hadgem_sst' .or. & - trim(sst_data_type) == 'hadgem_sst_uvocn') then + if (trim(ocn_data_type) == 'hadgem_sst' .or. & + trim(ocn_data_type) == 'hadgem_sst_uvocn') then diag = .true. ! write diagnostic information @@ -431,10 +433,10 @@ subroutine init_forcing_ocn(dt) enddo !$OMP END PARALLEL DO - endif ! sst_data_type + endif ! ocn_data_type - if (trim(sst_data_type) == 'ncar' .or. & - trim(sss_data_type) == 'ncar') then + if (trim(ocn_data_type) == 'ncar' .or. & + trim(bgc_data_type) == 'ncar') then ! call ocn_data_ncar_init call ocn_data_ncar_init_3D endif @@ -530,6 +532,8 @@ subroutine get_forcing_atmo call monthly_data elseif (trim(atm_data_type) == 'oned') then call oned_data + elseif (trim(atm_data_type) == 'box') then + call box_data else ! default values set in init_flux return endif @@ -603,19 +607,19 @@ subroutine get_forcing_ocn (dt) character(len=*), parameter :: subname = '(get_forcing_ocn)' - if (trim(sst_data_type) == 'clim' .or. & - trim(sss_data_type) == 'clim') then + if (trim(ocn_data_type) == 'clim' .or. & + trim(bgc_data_type) == 'clim') then call ocn_data_clim(dt) - elseif (trim(sst_data_type) == 'ncar' .or. & - trim(sss_data_type) == 'ncar'.or. & - trim(sst_data_type) == 'ISPOL' .or. & - trim(sss_data_type) == 'ISPOL') then + elseif (trim(ocn_data_type) == 'ncar' .or. & + trim(bgc_data_type) == 'ncar'.or. & + trim(ocn_data_type) == 'ISPOL' .or. & + trim(bgc_data_type) == 'ISPOL') then call ocn_data_ncar(dt) - elseif (trim(sst_data_type) == 'hadgem_sst' .or. & - trim(sst_data_type) == 'hadgem_sst_uvocn') then + elseif (trim(ocn_data_type) == 'hadgem_sst' .or. & + trim(ocn_data_type) == 'hadgem_sst_uvocn') then call ocn_data_hadgem(dt) - elseif (trim(sst_data_type) == 'oned' .or. & - trim(sss_data_type) == 'oned') then + elseif (trim(ocn_data_type) == 'oned' .or. & + trim(bgc_data_type) == 'oned') then call ocn_data_oned endif @@ -3080,16 +3084,16 @@ subroutine ocn_data_clim (dt) character(len=*), parameter :: subname = '(ocn_data_clim)' if (my_task == master_task .and. istep == 1) then - if (trim(sss_data_type)=='clim') then + if (trim(bgc_data_type)=='clim') then write (nu_diag,*) ' ' write (nu_diag,*) 'SSS data interpolated to timestep:' write (nu_diag,*) trim(sss_file) endif - if (trim(sst_data_type)=='clim') then + if (trim(ocn_data_type)=='clim') then write (nu_diag,*) ' ' write (nu_diag,*) 'SST data interpolated to timestep:' write (nu_diag,*) trim(sst_file) - if (restore_sst) write (nu_diag,*) & + if (restore_ocn) write (nu_diag,*) & 'SST restoring timescale (days) =', trestore endif endif ! my_task, istep @@ -3101,8 +3105,8 @@ subroutine ocn_data_clim (dt) ! month. !------------------------------------------------------------------- - if (trim(sss_data_type)=='clim' .or. & - trim(sst_data_type)=='clim') then + if (trim(bgc_data_type)=='clim' .or. & + trim(ocn_data_type)=='clim') then midmonth = 15 ! data is given on 15th of every month !!! midmonth = fix(p5 * real(daymo(month))) ! exact middle @@ -3128,14 +3132,14 @@ subroutine ocn_data_clim (dt) readm = .false. if (istep==1 .or. (mday==midmonth .and. sec==0)) readm = .true. - endif ! sss/sst_data_type + endif ! bgc/ocn_data_type !------------------------------------------------------------------- ! Read two monthly SSS values and interpolate. ! Note: SSS is restored instantaneously to data. !------------------------------------------------------------------- - if (trim(sss_data_type)=='clim') then + if (trim(bgc_data_type)=='clim') then call read_clim_data (readm, 0, ixm, month, ixp, & sss_file, sss_data, & field_loc_center, field_type_scalar) @@ -3159,13 +3163,13 @@ subroutine ocn_data_clim (dt) ! Restore toward interpolated value. !------------------------------------------------------------------- - if (trim(sst_data_type)=='clim') then + if (trim(ocn_data_type)=='clim') then call read_clim_data (readm, 0, ixm, month, ixp, & sst_file, sst_data, & field_loc_center, field_type_scalar) call interpolate_data (sst_data, sstdat) - if (restore_sst) then + if (restore_ocn) then !$OMP PARALLEL DO PRIVATE(iblk,i,j) do iblk = 1, nblocks do j = 1, ny_block @@ -3248,7 +3252,7 @@ subroutine ocn_data_ncar_init write (nu_diag,*) 'WARNING: not data from ocean forcing file.' write (nu_diag,*) 'WARNING: Alter ice_dyn_evp.F90 if desired.' - if (restore_sst) write (nu_diag,*) & + if (restore_ocn) write (nu_diag,*) & 'SST restoring timescale = ',trestore,' days' sst_file = trim(ocn_data_dir)//'/'//trim(oceanmixed_file) ! not just sst @@ -3400,7 +3404,7 @@ subroutine ocn_data_ncar_init_3D write (nu_diag,*) 'WARNING: not data from ocean forcing file.' write (nu_diag,*) 'WARNING: Alter ice_dyn_evp.F if desired.' - if (restore_sst) write (nu_diag,*) & + if (restore_ocn) write (nu_diag,*) & 'SST restoring timescale = ',trestore,' days' sst_file = trim(ocn_data_dir)//'/'//trim(oceanmixed_file) ! not just sst @@ -3604,7 +3608,7 @@ subroutine ocn_data_ncar(dt) call ocn_freezing_temperature - if (restore_sst) then + if (restore_ocn) then do j = 1, ny_block do i = 1, nx_block sst(i,j,:) = sst(i,j,:) + (work1(i,j,:)-sst(i,j,:))*dt/trest @@ -3705,7 +3709,7 @@ end subroutine ocn_data_oned subroutine ocn_data_hadgem(dt) ! Reads in HadGEM ocean forcing data as required from netCDF files -! Current options (selected by sst_data_type) +! Current options (selected by ocn_data_type) ! hadgem_sst: read in sst only ! hadgem_sst_uvocn: read in sst plus uocn and vocn @@ -3776,9 +3780,9 @@ subroutine ocn_data_hadgem(dt) write (nu_diag,*) ' ' write (nu_diag,*) 'SST data interpolated to timestep:' write (nu_diag,*) trim(ocn_data_dir)//'/MONTHLY/sst.1997.nc' - if (restore_sst) write (nu_diag,*) & + if (restore_ocn) write (nu_diag,*) & 'SST restoring timescale (days) =', trestore - if (trim(sst_data_type)=='hadgem_sst_uvocn') then + if (trim(ocn_data_type)=='hadgem_sst_uvocn') then write (nu_diag,*) ' ' write (nu_diag,*) 'uocn and vocn interpolated to timestep:' write (nu_diag,*) trim(ocn_data_dir)//'/MONTHLY/uocn.1997.nc' @@ -3799,7 +3803,7 @@ subroutine ocn_data_hadgem(dt) call interpolate_data (sst_data, sstdat) ! Restore SSTs if required - if (restore_sst) then + if (restore_ocn) then !$OMP PARALLEL DO PRIVATE(iblk,i,j) do iblk = 1, nblocks do j = 1, ny_block @@ -3821,7 +3825,7 @@ subroutine ocn_data_hadgem(dt) ! Also need to be converted from cm s-1 (UM) to m s-1 (CICE) ! ----------------------------------------------------------- - if (trim(sst_data_type)=='hadgem_sst_uvocn') then + if (trim(ocn_data_type)=='hadgem_sst_uvocn') then filename = trim(ocn_data_dir)//'/MONTHLY/uocn.1997.nc' fieldname='uocn' @@ -3873,7 +3877,7 @@ subroutine ocn_data_hadgem(dt) call t2ugrid_vector(uocn) call t2ugrid_vector(vocn) - endif ! sst_data_type = hadgem_sst_uvocn + endif ! ocn_data_type = hadgem_sst_uvocn end subroutine ocn_data_hadgem @@ -4356,7 +4360,7 @@ subroutine ocn_data_ispol_init if (my_task == master_task) then - if (restore_sst) write (nu_diag,*) & + if (restore_ocn) write (nu_diag,*) & 'SST restoring timescale = ',trestore,' days' sst_file = trim(ocn_data_dir)//'/'//trim(oceanmixed_file) ! not just sst @@ -4405,8 +4409,96 @@ subroutine ocn_data_ispol_init end subroutine ocn_data_ispol_init +!======================================================================= +! + subroutine box_data + +! wind and current fields as in Hunke, JCP 2001 +! authors: Elizabeth Hunke, LANL + + use ice_domain, only: nblocks + use ice_constants, only: c0, c1, c2, c3, c4, c5, p2 + use ice_blocks, only: nx_block, ny_block, nghost + use ice_flux, only: uocn, vocn, uatm, vatm, wind, rhoa, strax, stray + use ice_fileunits, only: nu_diag, nu_forcing + use ice_grid, only: uvm + + ! local parameters + + integer (kind=int_kind) :: & + iblk, i,j ! loop indices + + real (kind=dbl_kind) :: & + secday, pi , c10, c12, c20, puny, period, pi2, tau + call icepack_query_parameters(pi_out=pi, pi2_out=pi2, puny_out=puny) + call icepack_query_parameters(secday_out=secday) + + period = c4*secday + + do iblk = 1, nblocks + do j = 1, ny_block + do i = 1, nx_block + + ! ocean current + ! constant in time, could be initialized in ice_flux.F90 + uocn(i,j,iblk) = p2*real(j-nghost, kind=dbl_kind) & + / real(nx_global,kind=dbl_kind) - p1 + vocn(i,j,iblk) = -p2*real(i-nghost, kind=dbl_kind) & + / real(ny_global,kind=dbl_kind) + p1 + + uocn(i,j,iblk) = uocn(i,j,iblk) * uvm(i,j,iblk) + vocn(i,j,iblk) = vocn(i,j,iblk) * uvm(i,j,iblk) + + ! wind components + uatm(i,j,iblk) = c5 + (sin(pi2*time/period)-c3) & + * sin(pi2*real(i-nghost, kind=dbl_kind) & + /real(nx_global,kind=dbl_kind)) & + * sin(pi *real(j-nghost, kind=dbl_kind) & + /real(ny_global,kind=dbl_kind)) + vatm(i,j,iblk) = c5 + (sin(pi2*time/period)-c3) & + * sin(pi *real(i-nghost, kind=dbl_kind) & + /real(nx_global,kind=dbl_kind)) & + * sin(pi2*real(j-nghost, kind=dbl_kind) & + /real(ny_global,kind=dbl_kind)) + ! wind stress + wind(i,j,iblk) = sqrt(uatm(i,j,iblk)**2 + vatm(i,j,iblk)**2) + tau = rhoa(i,j,iblk) * 0.0012_dbl_kind * wind(i,j,iblk) + strax(i,j,iblk) = tau * uatm(i,j,iblk) + stray(i,j,iblk) = tau * vatm(i,j,iblk) + +! initialization test + ! Diagonal wind vectors 1 + !uatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) & + ! / real(ny_global,kind=dbl_kind) + !vatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) & + ! / real(ny_global,kind=dbl_kind) + + ! Diagonal wind vectors 2 + !uatm(i,j,iblk) = c1 *real(i-nghost, kind=dbl_kind) & + ! / real(nx_global,kind=dbl_kind) + !vatm(i,j,iblk) = -c1 *real(i-nghost, kind=dbl_kind) & + ! / real(nx_global,kind=dbl_kind) + + ! Wind in x direction + ! uatm(i,j,iblk) = c1 *real(i-nghost, kind=dbl_kind) & + ! / real(nx_global,kind=dbl_kind) + ! vatm(i,j,iblk) = c0 + + ! Wind in y direction + ! uatm(i,j,iblk) = c0 + ! vatm(i,j,iblk) = c1 *real(j-nghost, kind=dbl_kind) & + ! / real(ny_global,kind=dbl_kind) +! initialization test + + enddo + enddo + enddo ! nblocks + + end subroutine box_data + !======================================================================= end module ice_forcing !======================================================================= + diff --git a/cicecore/cicedynB/general/ice_init.F90 b/cicecore/cicedynB/general/ice_init.F90 index 75406aed9..e1cc540b7 100644 --- a/cicecore/cicedynB/general/ice_init.F90 +++ b/cicecore/cicedynB/general/ice_init.F90 @@ -55,6 +55,7 @@ subroutine input_data use ice_broadcast, only: broadcast_scalar, broadcast_array use ice_diagnostics, only: diag_file, print_global, print_points, latpnt, lonpnt + use ice_domain, only: close_boundaries use ice_domain_size, only: ncat, nilyr, nslyr, nblyr, & n_aero, n_zaero, n_algae, & n_doc, n_dic, n_don, n_fed, n_fep, & @@ -74,16 +75,22 @@ subroutine input_data use ice_history_shared, only: hist_avg, history_dir, history_file, & incond_dir, incond_file, version_name use ice_flux, only: update_ocn_f, l_mpond_fresh + use ice_flux, only: default_season use ice_flux_bgc, only: cpl_bgc use ice_forcing, only: & ycycle, fyear_init, dbug, & atm_data_type, atm_data_dir, precip_units, & atm_data_format, ocn_data_format, & - sss_data_type, sst_data_type, ocn_data_dir, & - oceanmixed_file, restore_sst, trestore - use ice_grid, only: grid_file, gridcpl_file, kmt_file, grid_type, grid_format + bgc_data_type, & + ocn_data_type, ocn_data_dir, & + oceanmixed_file, restore_ocn, trestore + use ice_arrays_column, only: bgc_data_dir, & + sil_data_type, nit_data_type, fe_data_type + use ice_grid, only: grid_file, gridcpl_file, kmt_file, grid_type, grid_format, & + dxrect, dyrect use ice_dyn_shared, only: ndte, kdyn, revised_evp, yield_curve, & - basalstress, Ktens, e_ratio + basalstress, Ktens, e_ratio, coriolis, & + kridge, ktransport use ice_transport_driver, only: advection use ice_restoring, only: restore_ice #ifdef CESMCOUPLED @@ -104,7 +111,7 @@ subroutine input_data ahmax, R_ice, R_pnd, R_snw, dT_mlt, rsnw_mlt, emissivity, & mu_rdg, hs0, dpscale, rfracmin, rfracmax, pndaspect, hs1, hp1, & a_rapid_mode, Rac_rapid_mode, aspect_rapid_mode, dSdt_slow_mode, & - phi_c_slow_mode, phi_i_mushy, kalg + phi_c_slow_mode, phi_i_mushy, kalg integer (kind=int_kind) :: ktherm, kstrength, krdg_partic, krdg_redist, natmiter, & kitd, kcatbound @@ -147,7 +154,8 @@ subroutine input_data namelist /grid_nml/ & grid_format, grid_type, grid_file, kmt_file, & ncat, nilyr, nslyr, nblyr, & - kcatbound, gridcpl_file + kcatbound, gridcpl_file, dxrect, dyrect, & + close_boundaries namelist /thermo_nml/ & kitd, ktherm, conduct, & @@ -156,7 +164,7 @@ subroutine input_data namelist /dynamics_nml/ & kdyn, ndte, revised_evp, yield_curve, & - advection, & + advection, coriolis, kridge, ktransport, & kstrength, krdg_partic, krdg_redist, mu_rdg, & e_ratio, Ktens, Cf, basalstress @@ -172,14 +180,17 @@ subroutine input_data hp1 namelist /forcing_nml/ & - atmbndy, fyear_init, ycycle, atm_data_format,& - atm_data_type, atm_data_dir, calc_strair, calc_Tsfc, & - precip_units, update_ocn_f, l_mpond_fresh, ustar_min, & - fbot_xfer_type, emissivity, & - oceanmixed_ice, ocn_data_format, sss_data_type, sst_data_type, & - ocn_data_dir, oceanmixed_file, restore_sst, trestore, & - restore_ice, formdrag, highfreq, natmiter, & - tfrz_option + formdrag, atmbndy, calc_strair, calc_Tsfc, & + highfreq, natmiter, ustar_min, emissivity, & + fbot_xfer_type, update_ocn_f, l_mpond_fresh, tfrz_option, & + oceanmixed_ice, restore_ice, restore_ocn, trestore, & + precip_units, default_season, & + atm_data_type, ocn_data_type, bgc_data_type, & + sil_data_type, nit_data_type, fe_data_type, & + fyear_init, ycycle, & + atm_data_dir, ocn_data_dir, bgc_data_dir, & + atm_data_format, ocn_data_format, & + oceanmixed_file namelist /tracer_nml/ & tr_iage, restart_age, & @@ -261,7 +272,7 @@ subroutine input_data kitd = 1 ! type of itd conversions (0 = delta, 1 = linear) kcatbound = 1 ! category boundary formula (0 = old, 1 = new, etc) - kdyn = 1 ! type of dynamics (1 = evp, 2 = eap) + kdyn = 1 ! type of dynamics (-1, 0 = off, 1 = evp, 2 = eap) ndtd = 1 ! dynamic time steps per thermodynamic time step ndte = 120 ! subcycles per dynamics timestep: ndte=dt_dyn/dte revised_evp = .false. ! if true, use revised procedure for evp dynamics @@ -271,14 +282,18 @@ subroutine input_data krdg_redist = 1 ! 1 = new redistribution, 0 = Hibler 80 mu_rdg = 3 ! e-folding scale of ridged ice, krdg_partic=1 (m^0.5) Cf = 17.0_dbl_kind ! ratio of ridging work to PE change in ridging + close_boundaries = .false. ! true = set land on edges of grid basalstress= .false. ! if true, basal stress for landfast is on Ktens = 0.0_dbl_kind ! T=Ktens*P (tensile strength: see Konig and Holland, 2010) e_ratio = 2.0_dbl_kind ! EVP ellipse aspect ratio advection = 'remap' ! incremental remapping transport scheme - shortwave = 'default' ! 'default' or 'dEdd' (delta-Eddington) - albedo_type = 'default'! or 'constant' - ktherm = 1 ! 0 = 0-layer, 1 = BL99, 2 = mushy thermo + shortwave = 'ccsm3' ! 'ccsm3' or 'dEdd' (delta-Eddington) + albedo_type = 'ccsm3' ! 'ccsm3' or 'constant' + ktherm = 1 ! -1 = OFF, 0 = 0-layer, 1 = BL99, 2 = mushy thermo conduct = 'bubbly' ! 'MU71' or 'bubbly' (Pringle et al 2007) + coriolis = 'latitude' ! latitude dependent, or 'constant' + kridge = 1 ! -1 = off, 1 = on + ktransport = 1 ! -1 = off, 1 = on calc_Tsfc = .true. ! calculate surface temperature update_ocn_f = .false. ! include fresh water and salt fluxes for frazil ustar_min = 0.005 ! minimum friction velocity for ocean heat flux (m/s) @@ -308,7 +323,7 @@ subroutine input_data albsnowi = 0.70_dbl_kind ! cold snow albedo, near IR ahmax = 0.3_dbl_kind ! thickness above which ice albedo is constant (m) atmbndy = 'default' ! or 'constant' - + default_season = 'winter' ! default forcing data, if data is not read in fyear_init = 1900 ! first year of forcing cycle ycycle = 1 ! number of years in forcing cycle atm_data_format = 'bin' ! file format ('bin'=binary or 'nc'=netcdf) @@ -323,11 +338,15 @@ subroutine input_data tfrz_option = 'mushy' ! freezing temp formulation oceanmixed_ice = .false. ! if true, use internal ocean mixed layer ocn_data_format = 'bin' ! file format ('bin'=binary or 'nc'=netcdf) - sss_data_type = 'default' - sst_data_type = 'default' - ocn_data_dir = ' ' + bgc_data_type = 'default' + sil_data_type = 'default' + nit_data_type = 'default' + fe_data_type = 'default' + bgc_data_dir = 'unknown_bgc_data_dir' + ocn_data_type = 'default' + ocn_data_dir = 'unknown_ocn_data_dir' oceanmixed_file = 'unknown_oceanmixed_file' ! ocean forcing data - restore_sst = .false. ! restore sst if true + restore_ocn = .false. ! restore sst if true trestore = 90 ! restoring timescale, days (0 instantaneous) restore_ice = .false. ! restore ice state on grid edges if true dbug = .false. ! true writes diagnostics for input forcing @@ -511,6 +530,9 @@ subroutine input_data call broadcast_scalar(pointer_file, master_task) call broadcast_scalar(ice_ic, master_task) call broadcast_scalar(grid_format, master_task) + call broadcast_scalar(dxrect, master_task) + call broadcast_scalar(dyrect, master_task) + call broadcast_scalar(close_boundaries, master_task) call broadcast_scalar(grid_type, master_task) call broadcast_scalar(grid_file, master_task) call broadcast_scalar(gridcpl_file, master_task) @@ -534,6 +556,9 @@ subroutine input_data call broadcast_scalar(shortwave, master_task) call broadcast_scalar(albedo_type, master_task) call broadcast_scalar(ktherm, master_task) + call broadcast_scalar(coriolis, master_task) + call broadcast_scalar(kridge, master_task) + call broadcast_scalar(ktransport, master_task) call broadcast_scalar(conduct, master_task) call broadcast_scalar(R_ice, master_task) call broadcast_scalar(R_pnd, master_task) @@ -574,11 +599,15 @@ subroutine input_data call broadcast_scalar(oceanmixed_ice, master_task) call broadcast_scalar(tfrz_option, master_task) call broadcast_scalar(ocn_data_format, master_task) - call broadcast_scalar(sss_data_type, master_task) - call broadcast_scalar(sst_data_type, master_task) + call broadcast_scalar(bgc_data_type, master_task) + call broadcast_scalar(sil_data_type, master_task) + call broadcast_scalar(nit_data_type, master_task) + call broadcast_scalar(fe_data_type, master_task) + call broadcast_scalar(bgc_data_dir, master_task) + call broadcast_scalar(ocn_data_type, master_task) call broadcast_scalar(ocn_data_dir, master_task) call broadcast_scalar(oceanmixed_file, master_task) - call broadcast_scalar(restore_sst, master_task) + call broadcast_scalar(restore_ocn, master_task) call broadcast_scalar(trestore, master_task) call broadcast_scalar(restore_ice, master_task) call broadcast_scalar(dbug, master_task) @@ -940,6 +969,8 @@ subroutine input_data write(nu_diag,1020) ' kitd = ', kitd write(nu_diag,1020) ' kcatbound = ', & kcatbound + write(nu_diag,1010) ' close_boundaries = ', & + close_boundaries if (kdyn == 1) then write(nu_diag,1021) ' kdyn = ','evp ', kdyn elseif (kdyn == 2) then @@ -955,6 +986,9 @@ subroutine input_data write(nu_diag,*) ' yield_curve = ', & trim(yield_curve) write(nu_diag,1020) ' kstrength = ', kstrength + write(nu_diag,1030) ' coriolis = ', coriolis + write(nu_diag,1020) ' kridge = ', kridge + write(nu_diag,1020) ' ktransport = ', ktransport write(nu_diag,1020) ' krdg_partic = ', & krdg_partic write(nu_diag,1020) ' krdg_redist = ', & @@ -1035,7 +1069,9 @@ subroutine input_data trim(atm_data_dir) write(nu_diag,*) ' precip_units = ', & trim(precip_units) - endif + elseif (trim(atm_data_type)=='default') then + write(nu_diag,*) ' default_season = ', trim(default_season) + endif write(nu_diag,1010) ' update_ocn_f = ', update_ocn_f write(nu_diag,1010) ' l_mpond_fresh = ', l_mpond_fresh @@ -1047,25 +1083,33 @@ subroutine input_data oceanmixed_ice write(nu_diag,*) ' tfrz_option = ', & trim(tfrz_option) - if (trim(sss_data_type) == 'ncar' .or. & - trim(sst_data_type) == 'ncar') then + if (trim(bgc_data_type) == 'ncar' .or. & + trim(ocn_data_type) == 'ncar') then write(nu_diag,*) ' oceanmixed_file = ', & trim(oceanmixed_file) endif - write(nu_diag,*) ' sss_data_type = ', & - trim(sss_data_type) - write(nu_diag,*) ' sst_data_type = ', & - trim(sst_data_type) - if (trim(sss_data_type) /= 'default' .or. & - trim(sst_data_type) /= 'default') then + write(nu_diag,*) ' bgc_data_type = ', & + trim(bgc_data_type) + write(nu_diag,*) ' sil_data_type = ', & + trim(sil_data_type) + write(nu_diag,*) ' nit_data_type = ', & + trim(nit_data_type) + write(nu_diag,*) ' fe_data_type = ', & + trim(fe_data_type) + write(nu_diag,*) ' bgc_data_dir = ', & + trim(bgc_data_dir) + write(nu_diag,*) ' ocn_data_type = ', & + trim(ocn_data_type) + if (trim(bgc_data_type) /= 'default' .or. & + trim(ocn_data_type) /= 'default') then write(nu_diag,*) ' ocn_data_dir = ', & trim(ocn_data_dir) - write(nu_diag,1010) ' restore_sst = ', & - restore_sst + write(nu_diag,1010) ' restore_ocn = ', & + restore_ocn endif write(nu_diag,1010) ' restore_ice = ', & restore_ice - if (restore_ice .or. restore_sst) & + if (restore_ice .or. restore_ocn) & write(nu_diag,1020) ' trestore = ', trestore #ifdef coupled @@ -1826,8 +1870,8 @@ subroutine set_state_var (nx_block, ny_block, & if (trim(atm_data_type) == 'box') then if (hinit(n) > c0) then ! ! constant slope from 0 to 1 in x direction -! aicen(i,j,n) = (real(iglob(i), kind=dbl_kind)-p5) & -! / (real(nx_global,kind=dbl_kind)) + aicen(i,j,n) = (real(iglob(i), kind=dbl_kind)-p5) & + / (real(nx_global,kind=dbl_kind)) ! ! constant slope from 0 to 0.5 in x direction ! aicen(i,j,n) = (real(iglob(i), kind=dbl_kind)-p5) & ! / (real(nx_global,kind=dbl_kind)) * p5 @@ -1836,12 +1880,12 @@ subroutine set_state_var (nx_block, ny_block, & ! / (real(nx_global,kind=dbl_kind)) & ! * (real(jglob(j), kind=dbl_kind)-p5) & ! / (real(ny_global,kind=dbl_kind)) * p5) - aicen(i,j,n) = max(c0,(real(nx_global, kind=dbl_kind) & - - real(iglob(i), kind=dbl_kind)-p5) & - / (real(nx_global,kind=dbl_kind)) & - * (real(ny_global, kind=dbl_kind) & - - real(jglob(j), kind=dbl_kind)-p5) & - / (real(ny_global,kind=dbl_kind)) * p5) +! aicen(i,j,n) = max(c0,(real(nx_global, kind=dbl_kind) & +! - real(iglob(i), kind=dbl_kind)-p5) & +! / (real(nx_global,kind=dbl_kind)) & +! * (real(ny_global, kind=dbl_kind) & +! - real(jglob(j), kind=dbl_kind)-p5) & +! / (real(ny_global,kind=dbl_kind)) * p5) endif vicen(i,j,n) = hinit(n) * aicen(i,j,n) ! m else diff --git a/cicecore/cicedynB/general/ice_step_mod.F90 b/cicecore/cicedynB/general/ice_step_mod.F90 index e35290263..a78d4ed66 100644 --- a/cicecore/cicedynB/general/ice_step_mod.F90 +++ b/cicecore/cicedynB/general/ice_step_mod.F90 @@ -36,12 +36,33 @@ module ice_step_mod public :: step_therm1, step_therm2, step_dyn_horiz, step_dyn_ridge, & prep_radiation, step_radiation, ocean_mixed_layer, & - update_state, biogeochemistry + update_state, biogeochemistry, save_init !======================================================================= contains +!======================================================================= + + subroutine save_init +! saves initial values for aice, aicen, vicen, vsnon + + use ice_state, only: aice, aicen, aice_init, aicen_init, & + vicen, vicen_init, vsnon, vsnon_init + + !----------------------------------------------------------------- + ! Save the ice area passed to the coupler (so that history fields + ! can be made consistent with coupler fields). + ! Save the initial ice area and volume in each category. + !----------------------------------------------------------------- + + aice_init = aice + aicen_init = aicen + vicen_init = vicen + vsnon_init = vsnon + + end subroutine save_init + !======================================================================= ! ! Scales radiation fields computed on the previous time step. @@ -217,24 +238,10 @@ subroutine step_therm1 (dt, iblk) aerosno(:,:,:) = c0 aeroice(:,:,:) = c0 +#ifdef CICE_IN_NEMO do j = 1, ny_block do i = 1, nx_block - !----------------------------------------------------------------- - ! Save the ice area passed to the coupler (so that history fields - ! can be made consistent with coupler fields). - ! Save the initial ice area and volume in each category. - !----------------------------------------------------------------- - - aice_init (i,j, iblk) = aice (i,j, iblk) - - do n = 1, ncat - aicen_init(i,j,n,iblk) = aicen(i,j,n,iblk) - vicen_init(i,j,n,iblk) = vicen(i,j,n,iblk) - vsnon_init(i,j,n,iblk) = vsnon(i,j,n,iblk) - enddo - -#ifdef CICE_IN_NEMO !--------------------------------------------------------------- ! Scale frain and fsnow by ice concentration as these fields ! are supplied by NEMO multiplied by ice concentration @@ -248,10 +255,10 @@ subroutine step_therm1 (dt, iblk) frain(i,j,iblk) = c0 fsnow(i,j,iblk) = c0 endif -#endif enddo ! i enddo ! j +#endif this_block = get_block(blocks_ice(iblk),iblk) ilo = this_block%ilo @@ -588,7 +595,7 @@ subroutine step_dyn_horiz (dt) use ice_dyn_evp, only: evp use ice_dyn_eap, only: eap - use ice_dyn_shared, only: kdyn + use ice_dyn_shared, only: kdyn, ktransport use ice_flux, only: init_history_dyn use ice_transport_driver, only: advection, transport_upwind, transport_remap @@ -610,11 +617,13 @@ subroutine step_dyn_horiz (dt) ! Horizontal ice transport !----------------------------------------------------------------- + if (ktransport > 0) then if (advection == 'upwind') then call transport_upwind (dt) ! upwind else call transport_remap (dt) ! incremental remapping endif + endif end subroutine step_dyn_horiz diff --git a/cicecore/cicedynB/infrastructure/ice_domain.F90 b/cicecore/cicedynB/infrastructure/ice_domain.F90 index 58acd9735..622e425b3 100644 --- a/cicecore/cicedynB/infrastructure/ice_domain.F90 +++ b/cicecore/cicedynB/infrastructure/ice_domain.F90 @@ -37,7 +37,10 @@ module ice_domain init_domain_distribution integer (int_kind), public :: & - nblocks ! actual number of blocks on this processor + nblocks ! actual number of blocks on this processor + + logical (kind=log_kind), public :: & + close_boundaries integer (int_kind), dimension(:), pointer, public :: & blocks_ice => null() ! block ids for local blocks diff --git a/cicecore/cicedynB/infrastructure/ice_grid.F90 b/cicecore/cicedynB/infrastructure/ice_grid.F90 index 2ff313473..6baddd63f 100644 --- a/cicecore/cicedynB/infrastructure/ice_grid.F90 +++ b/cicecore/cicedynB/infrastructure/ice_grid.F90 @@ -41,6 +41,7 @@ module ice_grid gridcpl_file , & ! input file for POP coupling grid info grid_file , & ! input file for POP grid info kmt_file , & ! input file for POP grid info + grid_spacing , & ! default of 30.e3m or set by user in namelist grid_type ! current options are rectangular (default), ! displaced_pole, tripole, regional @@ -75,6 +76,9 @@ module ice_grid cxm , & ! 0.5*HTN - 1.5*HTN dxhy , & ! 0.5*(HTE - HTE) dyhx ! 0.5*(HTN - HTN) + real (kind=dbl_kind), public :: & + dxrect, & ! user_specified spacing (m) in x-direction + dyrect ! user_specified spacing (m) in y-direction ! Corners of grid boxes for history output real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: & @@ -118,9 +122,11 @@ module ice_grid lmask_s ! southern hemisphere mask ! grid dimensions for rectangular grid - real (kind=dbl_kind), parameter :: & - dxrect = 30.e5_dbl_kind ,&! uniform HTN (cm) - dyrect = 30.e5_dbl_kind ! uniform HTE (cm) +! real (kind=dbl_kind), public :: & +! dxrect = 30.e5_dbl_kind ,&! uniform HTN (cm) +! dyrect = 30.e5_dbl_kind ! uniform HTE (cm) +! dxrect = 16.e5_dbl_kind ,&! uniform HTN (cm) +! dyrect = 16.e5_dbl_kind ! uniform HTE (cm) real (kind=dbl_kind), dimension (:,:,:), allocatable, public :: & rndex_global ! global index for local subdomain (dbl) @@ -1114,6 +1120,7 @@ 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, only: close_boundaries integer (kind=int_kind) :: & i, j, iblk, & @@ -1256,6 +1263,13 @@ subroutine rectgrid endif + if (close_boundaries) then + work_g1(:, 1:2) = c0 + work_g1(:, ny_global-1:ny_global) = c0 + work_g1(1:2, :) = c0 + work_g1(nx_global-1:nx_global, :) = c0 + endif + elseif (trim(ew_boundary_type) == 'closed') then call abort_ice(subname//'ERROR: closed boundaries not available') diff --git a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 index 86bc598a0..f0ddaaadd 100644 --- a/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 +++ b/cicecore/cicedynB/infrastructure/ice_restart_driver.F90 @@ -481,7 +481,7 @@ subroutine restartfile (ice_ic) ! compute aggregate ice state and open water area !----------------------------------------------------------------- - !$OMP PARALLEL DO PRIVATE(iblk) + !$OMP PARALLEL DO PRIVATE(iblk,i,j) do iblk = 1, nblocks do j = 1, ny_block diff --git a/cicecore/drivers/cice/CICE_RunMod.F90 b/cicecore/drivers/cice/CICE_RunMod.F90 index fe1aa14c4..ca7a5bd82 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90 +++ b/cicecore/drivers/cice/CICE_RunMod.F90 @@ -44,8 +44,8 @@ module CICE_RunMod subroutine CICE_Run use ice_calendar, only: istep, istep1, time, dt, stop_now, calendar - use ice_forcing, only: get_forcing_atmo, get_forcing_ocn - use ice_forcing_bgc, only: get_forcing_bgc, get_atm_bgc, & + use ice_forcing, only: get_forcing_atmo, get_forcing_ocn, atm_data_type + 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, & @@ -103,8 +103,8 @@ subroutine CICE_Run #endif if (z_tracers) call get_atm_bgc ! biogeochemistry - call init_flux_atm ! initialize atmosphere fluxes sent to coupler - call init_flux_ocn ! initialize ocean fluxes sent to coupler + call init_flux_atm ! Initialize atmosphere fluxes sent to coupler + call init_flux_ocn ! initialize ocean fluxes sent to coupler call ice_timer_stop(timer_couple) ! atm/ocn coupling @@ -135,7 +135,7 @@ subroutine ice_step use ice_diagnostics_bgc, only: hbrine_diags, zsal_diags, bgc_diags use ice_domain, only: halo_info, nblocks use ice_dyn_eap, only: write_restart_eap - use ice_dyn_shared, only: kdyn + use ice_dyn_shared, only: kdyn, kridge use ice_flux, only: scale_factor, init_history_therm, & daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd use ice_history, only: accum_hist @@ -149,14 +149,15 @@ subroutine ice_step use ice_restoring, only: restore_ice, ice_HaloRestore use ice_step_mod, only: prep_radiation, step_therm1, step_therm2, & update_state, step_dyn_horiz, step_dyn_ridge, step_radiation, & - biogeochemistry + biogeochemistry, save_init use ice_timers, only: ice_timer_start, ice_timer_stop, & timer_diags, timer_column, timer_thermo, timer_bound, & timer_hist, timer_readwrite integer (kind=int_kind) :: & iblk , & ! block index - k ! dynamics supercycling index + k , & ! dynamics supercycling index + ktherm ! thermodynamics is off when ktherm = -1 real (kind=dbl_kind) :: & offset ! d(age)/dt time offset @@ -169,7 +170,7 @@ subroutine ice_step character(len=*), parameter :: subname = '(ice_step)' call icepack_query_parameters(calc_Tsfc_out=calc_Tsfc, skl_bgc_out=skl_bgc, & - solve_zsal_out=solve_zsal, z_tracers_out=z_tracers) + solve_zsal_out=solve_zsal, z_tracers_out=z_tracers, ktherm_out=ktherm) call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, & tr_lvl_out=tr_lvl, tr_pond_cesm_out=tr_pond_cesm, tr_pond_lvl_out=tr_pond_lvl, & tr_pond_topo_out=tr_pond_topo, tr_brine_out=tr_brine, tr_aero_out=tr_aero) @@ -184,7 +185,7 @@ subroutine ice_step if (restore_ice) call ice_HaloRestore !----------------------------------------------------------------- - ! initialize diagnostics + ! initialize diagnostics and save initial state values !----------------------------------------------------------------- call ice_timer_start(timer_diags) ! diagnostics/history @@ -196,22 +197,28 @@ subroutine ice_step call ice_timer_start(timer_column) ! column physics call ice_timer_start(timer_thermo) ! thermodynamics + call save_init + !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks + if (ktherm >= 0) then + !----------------------------------------------------------------- - ! Scale radiation fields + ! scale radiation fields !----------------------------------------------------------------- - if (calc_Tsfc) call prep_radiation (iblk) + if (calc_Tsfc) call prep_radiation (iblk) !----------------------------------------------------------------- ! thermodynamics and biogeochemistry !----------------------------------------------------------------- - call step_therm1 (dt, iblk) ! vertical thermodynamics - call biogeochemistry (dt, iblk) ! biogeochemistry - call step_therm2 (dt, iblk) ! ice thickness distribution thermo + call step_therm1 (dt, iblk) ! vertical thermodynamics + call biogeochemistry (dt, iblk) ! biogeochemistry + call step_therm2 (dt, iblk) ! ice thickness distribution thermo + + endif enddo ! iblk !$OMP END PARALLEL DO @@ -235,7 +242,7 @@ subroutine ice_step ! ridging !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks - call step_dyn_ridge (dt_dyn, ndtd, iblk) + if (kridge > 0) call step_dyn_ridge (dt_dyn, ndtd, iblk) enddo !$OMP END PARALLEL DO @@ -255,7 +262,7 @@ subroutine ice_step !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks - call step_radiation (dt, iblk) + if (ktherm >= 0) call step_radiation (dt, iblk) !----------------------------------------------------------------- ! get ready for coupling and the next time step @@ -281,7 +288,7 @@ 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 + if (solve_zsal) call zsal_diags if (skl_bgc .or. z_tracers) call bgc_diags if (tr_brine) call hbrine_diags endif @@ -331,7 +338,7 @@ subroutine coupling_prep (iblk) 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, & + swvdr, swidr, swvdf, swidf, Tf, Tair, Qa, strairxT, strairyT, & fsens, flat, fswabs, flwout, evap, Tref, Qref, & scale_fluxes, frzmlt_init, frzmlt use ice_flux_bgc, only: faero_ocn, fzsal_ai, fzsal_g_ai, flux_bio, flux_bio_ai @@ -425,12 +432,12 @@ subroutine coupling_prep (iblk) ihi = this_block%ihi jlo = this_block%jlo jhi = this_block%jhi - + do n = 1, ncat do j = jlo, jhi do i = ilo, ihi if (aicen(i,j,n,iblk) > puny) then - + alvdf(i,j,iblk) = alvdf(i,j,iblk) & + alvdfn(i,j,n,iblk)*aicen(i,j,n,iblk) alidf(i,j,iblk) = alidf(i,j,iblk) & @@ -455,7 +462,7 @@ subroutine coupling_prep (iblk) + apeffn(i,j,n,iblk)*aicen(i,j,n,iblk) snowfrac(i,j,iblk) = snowfrac(i,j,iblk) & ! for history + snowfracn(i,j,n,iblk)*aicen(i,j,n,iblk) - + endif ! aicen > puny enddo enddo @@ -624,7 +631,7 @@ subroutine sfcflux_to_ocn(nx_block, ny_block, & end subroutine sfcflux_to_ocn -#endif +#endif !======================================================================= diff --git a/cicecore/drivers/cice/CICE_RunMod.F90_debug b/cicecore/drivers/cice/CICE_RunMod.F90_debug index 72e8f86df..9ffe0094a 100644 --- a/cicecore/drivers/cice/CICE_RunMod.F90_debug +++ b/cicecore/drivers/cice/CICE_RunMod.F90_debug @@ -44,8 +44,8 @@ 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, only: get_forcing_atmo, get_forcing_ocn, atm_data_type + 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, & @@ -103,8 +103,8 @@ #endif if (z_tracers) call get_atm_bgc ! biogeochemistry - call init_flux_atm ! initialize atmosphere fluxes sent to coupler - call init_flux_ocn ! initialize ocean fluxes sent to coupler + call init_flux_atm ! Initialize atmosphere fluxes sent to coupler + call init_flux_ocn ! initialize ocean fluxes sent to coupler call ice_timer_stop(timer_couple) ! atm/ocn coupling @@ -134,9 +134,8 @@ 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_dyn_shared, only: kdyn, kridge use ice_flux, only: scale_factor, init_history_therm, & daidtt, daidtd, dvidtt, dvidtd, dagedtt, dagedtd use ice_history, only: accum_hist @@ -148,17 +147,17 @@ 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 + biogeochemistry, save_init use ice_timers, only: ice_timer_start, ice_timer_stop, & timer_diags, timer_column, timer_thermo, timer_bound, & timer_hist, timer_readwrite integer (kind=int_kind) :: & iblk , & ! block index - k ! dynamics supercycling index + k , & ! dynamics supercycling index + ktherm ! thermodynamics is off when ktherm = -1 real (kind=dbl_kind) :: & offset ! d(age)/dt time offset @@ -168,17 +167,17 @@ tr_pond_cesm, tr_pond_lvl, tr_pond_topo, tr_brine, tr_aero, & calc_Tsfc, skl_bgc, solve_zsal, z_tracers - character (len=char_len) :: plabeld - character(len=*), parameter :: subname = '(ice_step)' + character (len=char_len) :: plabeld + plabeld = 'beginning time step' do iblk = 1, nblocks call debug_ice (iblk, plabeld) enddo call icepack_query_parameters(calc_Tsfc_out=calc_Tsfc, skl_bgc_out=skl_bgc, & - solve_zsal_out=solve_zsal, z_tracers_out=z_tracers) + solve_zsal_out=solve_zsal, z_tracers_out=z_tracers, ktherm_out=ktherm) call icepack_query_tracer_flags(tr_iage_out=tr_iage, tr_FY_out=tr_FY, & tr_lvl_out=tr_lvl, tr_pond_cesm_out=tr_pond_cesm, tr_pond_lvl_out=tr_pond_lvl, & tr_pond_topo_out=tr_pond_topo, tr_brine_out=tr_brine, tr_aero_out=tr_aero) @@ -193,7 +192,7 @@ if (restore_ice) call ice_HaloRestore !----------------------------------------------------------------- - ! initialize diagnostics + ! initialize diagnostics and save initial state values !----------------------------------------------------------------- call ice_timer_start(timer_diags) ! diagnostics/history @@ -205,36 +204,42 @@ call ice_timer_start(timer_column) ! column physics call ice_timer_start(timer_thermo) ! thermodynamics + call save_init + !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks + if (ktherm >= 0) then + !----------------------------------------------------------------- - ! Scale radiation fields + ! scale radiation fields !----------------------------------------------------------------- - if (calc_Tsfc) call prep_radiation (dt, iblk) + if (calc_Tsfc) call prep_radiation (iblk) - plabeld = 'post prep_radiation' - call debug_ice (iblk, plabeld) + plabeld = 'post prep_radiation' + call debug_ice (iblk, plabeld) !----------------------------------------------------------------- ! thermodynamics and biogeochemistry !----------------------------------------------------------------- - call step_therm1 (dt, iblk) ! vertical thermodynamics + call step_therm1 (dt, iblk) ! vertical thermodynamics - plabeld = 'post step_therm1' - call debug_ice (iblk, plabeld) + plabeld = 'post step_therm1' + call debug_ice (iblk, plabeld) - call biogeochemistry (dt, iblk) ! biogeochemistry + call biogeochemistry (dt, iblk) ! biogeochemistry - plabeld = 'post biogeochemistry' - call debug_ice (iblk, plabeld) + plabeld = 'post biogeochemistry' + call debug_ice (iblk, plabeld) - call step_therm2 (dt, iblk) ! ice thickness distribution thermo + call step_therm2 (dt, iblk) ! ice thickness distribution thermo - plabeld = 'post step_therm2' - call debug_ice (iblk, plabeld) + plabeld = 'post step_therm2' + call debug_ice (iblk, plabeld) + + endif enddo ! iblk !$OMP END PARALLEL DO @@ -258,7 +263,7 @@ ! ridging !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks - call step_dyn_ridge (dt_dyn, ndtd, iblk) + if (kridge > 0) call step_dyn_ridge (dt_dyn, ndtd, iblk) enddo !$OMP END PARALLEL DO @@ -283,7 +288,7 @@ !$OMP PARALLEL DO PRIVATE(iblk) do iblk = 1, nblocks - call step_radiation (dt, iblk) + if (ktherm >= 0) call step_radiation (dt, iblk) plabeld = 'post step_radiation' call debug_ice (iblk, plabeld) @@ -315,9 +320,9 @@ 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 @@ -356,20 +361,25 @@ 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, & + 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 @@ -379,11 +389,15 @@ ! 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 ! @@ -444,9 +458,16 @@ enddo enddo enddo + + this_block = get_block(blocks_ice(iblk),iblk) + ilo = this_block%ilo + ihi = this_block%ihi + jlo = this_block%jlo + jhi = this_block%jhi + do n = 1, ncat - do j = 1, ny_block - do i = 1, nx_block + do j = jlo, jhi + do i = ilo, ihi if (aicen(i,j,n,iblk) > puny) then alvdf(i,j,iblk) = alvdf(i,j,iblk) & @@ -547,6 +568,7 @@ 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 @@ -562,11 +584,13 @@ 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 @@ -606,7 +630,6 @@ 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) :: & @@ -637,10 +660,11 @@ enddo ! j enddo ! n -#endif end subroutine sfcflux_to_ocn +#endif + !======================================================================= end module CICE_RunMod diff --git a/cicecore/shared/ice_distribution.F90 b/cicecore/shared/ice_distribution.F90 index fa49adbc9..4af95ae1f 100644 --- a/cicecore/shared/ice_distribution.F90 +++ b/cicecore/shared/ice_distribution.F90 @@ -698,6 +698,14 @@ function create_distrb_cart(nprocs, workPerBlock) result(newDistrb) end do end do + else + allocate (newDistrb%blockGlobalID(newDistrb%numLocalBlocks), & + stat=istat) + if (istat > 0) then + call abort_ice( & + 'create_distrb_cart: error allocating blockGlobalID') + return + endif endif !---------------------------------------------------------------------- diff --git a/cicecore/shared/ice_init_column.F90 b/cicecore/shared/ice_init_column.F90 index 0941704a3..2ee9da12a 100644 --- a/cicecore/shared/ice_init_column.F90 +++ b/cicecore/shared/ice_init_column.F90 @@ -1031,7 +1031,6 @@ subroutine init_zbgc tr_brine, restart_hbrine, tr_zaero, modal_aero, skl_bgc, & z_tracers, dEdd_algae, solve_zbgc, bgc_flux_type, & restore_bgc, restart_bgc, scale_bgc, solve_zsal, restart_zsal, & - bgc_data_dir, sil_data_type, nit_data_type, fe_data_type, & tr_bgc_Nit, tr_bgc_C, tr_bgc_chl, tr_bgc_Am, tr_bgc_Sil, & tr_bgc_DMS, tr_bgc_PON, tr_bgc_hum, tr_bgc_DON, tr_bgc_Fe, & grid_o, grid_o_t, l_sk, grid_oS, & @@ -1090,10 +1089,6 @@ subroutine init_zbgc modal_aero = .false. ! use modal aerosol treatment of aerosols restore_bgc = .false. ! restore bgc if true solve_zsal = .false. ! update salinity tracer profile from solve_S_dt - bgc_data_dir = 'unknown_bgc_data_dir' - sil_data_type = 'default' - nit_data_type = 'default' - fe_data_type = 'default' restart_bgc = .false. ! biogeochemistry restart restart_zsal = .false. ! salinity restart restart_hbrine = .false. ! hbrine restart @@ -1431,10 +1426,6 @@ subroutine init_zbgc call broadcast_scalar(restart_bgc, master_task) call broadcast_scalar(bgc_flux_type, master_task) call broadcast_scalar(restore_bgc, master_task) - call broadcast_scalar(bgc_data_dir, master_task) - call broadcast_scalar(sil_data_type, master_task) - call broadcast_scalar(nit_data_type, master_task) - call broadcast_scalar(fe_data_type, master_task) call broadcast_scalar(tr_bgc_N, master_task) call broadcast_scalar(tr_bgc_C, master_task) call broadcast_scalar(tr_bgc_chl, master_task) @@ -2229,14 +2220,6 @@ subroutine init_zbgc write(nu_diag,1030) ' bgc_flux_type = ', bgc_flux_type write(nu_diag,1010) ' restart_bgc = ', restart_bgc write(nu_diag,1010) ' restore_bgc = ', restore_bgc - write(nu_diag,*) ' bgc_data_dir = ', & - trim(bgc_data_dir) - write(nu_diag,*) ' sil_data_type = ', & - trim(sil_data_type) - write(nu_diag,*) ' nit_data_type = ', & - trim(nit_data_type) - write(nu_diag,*) ' fe_data_type = ', & - trim(fe_data_type) write(nu_diag,1020) ' number of bio tracers = ', nbtrcr write(nu_diag,1020) ' number of Isw tracers = ', nbtrcr_sw write(nu_diag,1020) ' number of autotrophs = ', n_algae @@ -2258,15 +2241,7 @@ subroutine init_zbgc write(nu_diag,1010) ' tr_bgc_Fe = ', tr_bgc_Fe elseif (z_tracers) then - - write(nu_diag,*) ' sil_data_type = ', & - trim(sil_data_type) - write(nu_diag,*) ' nit_data_type = ', & - trim(nit_data_type) - write(nu_diag,*) ' fe_data_type = ', & - trim(fe_data_type) - write(nu_diag,*) ' bgc_data_dir = ', & - trim(bgc_data_dir) + write(nu_diag,1010) ' restart_bgc = ', restart_bgc write(nu_diag,1010) ' dEdd_algae = ', dEdd_algae write(nu_diag,1010) ' modal_aero = ', modal_aero diff --git a/configuration/scripts/cice.build b/configuration/scripts/cice.build index 7414a6bf7..e7a9e42a9 100755 --- a/configuration/scripts/cice.build +++ b/configuration/scripts/cice.build @@ -7,7 +7,7 @@ set ciceexe = "UnDEFineD" if ($#argv == 1) then set ciceexe = $1 - echo "${0}: tcx ciceexe = ${ciceexe}" + echo "${0}: ciceexe = ${ciceexe}" if (-e ${ciceexe}) then source ./cice.settings diff --git a/configuration/scripts/cice_decomp.csh b/configuration/scripts/cice_decomp.csh index 81a8fd326..9bf377c0a 100755 --- a/configuration/scripts/cice_decomp.csh +++ b/configuration/scripts/cice_decomp.csh @@ -44,6 +44,17 @@ else if (${grid} == 'gbox128') then set blckx = 8; set blcky = 8 endif +else if (${grid} == 'gbox80') then + set nxglob = 80 + set nyglob = 80 + if (${cicepes} <= 1) then + set blckx = 80; set blcky = 80 + else if (${cicepes} <= 8) then + set blckx = 20; set blcky = 20 + else + set blckx = 8; set blcky = 8 + endif + else if (${grid} == 'gx3') then set nxglob = 100 set nyglob = 116 diff --git a/configuration/scripts/ice_in b/configuration/scripts/ice_in index 0c555fec7..d4ce68a63 100644 --- a/configuration/scripts/ice_in +++ b/configuration/scripts/ice_in @@ -50,6 +50,9 @@ kmt_file = 'kmt' gridcpl_file = 'unknown_gridcpl_file' kcatbound = 0 + dxrect = 30.e5 + dyrect = 30.e5 + close_boundaries = .false. ncat = 5 nilyr = 7 nslyr = 1 @@ -115,11 +118,14 @@ Ktens = 0. e_ratio = 2. basalstress = .false. + coriolis = 'latitude' + kridge = 1 + ktransport = 1 / &shortwave_nml shortwave = 'dEdd' - albedo_type = 'default' + albedo_type = 'ccsm3' albicev = 0.78 albicei = 0.36 albsnowv = 0.98 @@ -147,16 +153,10 @@ &forcing_nml formdrag = .false. atmbndy = 'default' - fyear_init = 1997 - ycycle = 1 - atm_data_format = 'bin' - atm_data_type = 'ncar' - atm_data_dir = '/glade/u/home/tcraig/cice_data/' calc_strair = .true. + calc_Tsfc = .true. highfreq = .false. natmiter = 5 - calc_Tsfc = .true. - precip_units = 'mm_per_month' ustar_min = 0.0005 emissivity = 0.95 fbot_xfer_type = 'constant' @@ -164,14 +164,25 @@ l_mpond_fresh = .false. tfrz_option = 'mushy' oceanmixed_ice = .true. + restore_ice = .false. + restore_ocn = .false. + trestore = 90 + precip_units = 'mm_per_month' + default_season = 'winter' + atm_data_type = 'ncar' + ocn_data_type = 'default' + bgc_data_type = 'default' + sil_data_type = 'default' + nit_data_type = 'default' + fe_data_type = 'default' + fyear_init = 1997 + ycycle = 1 + atm_data_format = 'bin' + atm_data_dir = '/glade/u/home/tcraig/cice_data/' + bgc_data_dir = 'unknown_bgc_data_dir' ocn_data_format = 'bin' - sss_data_type = 'default' - sst_data_type = 'default' - ocn_data_dir = 'unknown_ocn_data_dir' + ocn_data_dir = '/unknown_ocn_data_dir' oceanmixed_file = 'unknown_oceanmixed_file' - restore_sst = .false. - trestore = 90 - restore_ice = .false. / &domain_nml @@ -206,10 +217,6 @@ scale_bgc = .false. solve_zsal = .false. restart_zsal = .false. - bgc_data_dir = 'unknown_bgc_data_dir' - sil_data_type = 'default' - nit_data_type = 'default' - fe_data_type = 'default' tr_bgc_Nit = .true. tr_bgc_C = .true. tr_bgc_chl = .false. diff --git a/configuration/scripts/machines/env.hobart_intel b/configuration/scripts/machines/env.hobart_intel index 577a7ca93..76f4e5e55 100755 --- a/configuration/scripts/machines/env.hobart_intel +++ b/configuration/scripts/machines/env.hobart_intel @@ -21,6 +21,7 @@ setenv ICE_MACHINE_WKDIR /scratch/cluster/$user/CICE_RUNS setenv ICE_MACHINE_INPUTDATA /fs/cgd/csm/inputdata setenv ICE_MACHINE_BASELINE /scratch/cluster/$user/CICE_BASELINE setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_QSTAT "qstat " setenv ICE_MACHINE_QUEUE "short" setenv ICE_MACHINE_ACCT P00000000 setenv ICE_MACHINE_TPNODE 24 diff --git a/configuration/scripts/machines/env.hobart_nag b/configuration/scripts/machines/env.hobart_nag index 5dbe80fb9..cc3fc2e67 100755 --- a/configuration/scripts/machines/env.hobart_nag +++ b/configuration/scripts/machines/env.hobart_nag @@ -21,6 +21,7 @@ setenv ICE_MACHINE_WKDIR /scratch/cluster/$user/CICE_RUNS setenv ICE_MACHINE_INPUTDATA /fs/cgd/csm/inputdata setenv ICE_MACHINE_BASELINE /scratch/cluster/$user/CICE_BASELINE setenv ICE_MACHINE_SUBMIT "qsub" +setenv ICE_MACHINE_QSTAT "qstat " setenv ICE_MACHINE_QUEUE "short" setenv ICE_MACHINE_ACCT P00000000 setenv ICE_MACHINE_TPNODE 24 diff --git a/configuration/scripts/options/set_env.box2001 b/configuration/scripts/options/set_env.box2001 new file mode 100755 index 000000000..a3f7c10f5 --- /dev/null +++ b/configuration/scripts/options/set_env.box2001 @@ -0,0 +1 @@ +setenv NICELYR 1 diff --git a/configuration/scripts/options/set_nml.alt01 b/configuration/scripts/options/set_nml.alt01 index e9b0632b1..8585d51d9 100644 --- a/configuration/scripts/options/set_nml.alt01 +++ b/configuration/scripts/options/set_nml.alt01 @@ -19,7 +19,7 @@ basalstress = .true. shortwave = 'ccsm3' albedo_type = 'constant' formdrag = .true. -calc_tsfc = .true. +calc_Tsfc = .true. atm_data_type = 'default' highfreq = .true. fbot_xfer_type = 'Cdn_ocn' diff --git a/configuration/scripts/options/set_nml.alt02 b/configuration/scripts/options/set_nml.alt02 index b8177689f..9e1baf388 100644 --- a/configuration/scripts/options/set_nml.alt02 +++ b/configuration/scripts/options/set_nml.alt02 @@ -18,6 +18,6 @@ krdg_partic = 0 krdg_redist = 0 shortwave = 'ccsm3' albedo_type = 'ccsm3' -calc_tsfc = .true. +calc_Tsfc = .true. diff --git a/configuration/scripts/options/set_nml.box2001 b/configuration/scripts/options/set_nml.box2001 new file mode 100755 index 000000000..5bb9a93c1 --- /dev/null +++ b/configuration/scripts/options/set_nml.box2001 @@ -0,0 +1,44 @@ +days_per_year = 360 +npt = 240 +ice_ic = 'default' +restart = .false. +restart_ext = .true. +restart_format = 'bin' +histfreq = 'd','x','x','x','x' +grid_type = 'rectangular' +dxrect = 16.e5 +dyrect = 16.e5 +close_boundaries = .true. +ew_boundary_type = 'open' +ns_boundary_type = 'open' +tr_iage = .false. +tr_FY = .false. +tr_lvl = .false. +tr_pond_lvl = .false. +ktherm = -1 +kstrength = 0 +kdyn = 1 +kridge = -1 +ktransport = -1 +coriolis = 'constant' +atmbndy = 'constant' +atm_data_type = 'box' +calc_strair = .false. +restore_ice = .true. +f_aice = 'd' +f_hi = 'd' +f_hs = 'd' +f_Tsfc = 'd' +f_uvel = 'd' +f_vvel = 'd' +f_uatm = 'd' +f_vatm = 'd' +f_uocn = 'd' +f_vocn = 'd' +f_strairx = 'd' +f_strairy = 'd' +f_strocnx = 'd' +f_strocny = 'd' +f_divu = 'd' +f_sig1 = 'd' +f_sig2 = 'd' diff --git a/configuration/scripts/options/set_nml.gbox80 b/configuration/scripts/options/set_nml.gbox80 new file mode 100755 index 000000000..bdbbd9337 --- /dev/null +++ b/configuration/scripts/options/set_nml.gbox80 @@ -0,0 +1,3 @@ +ice_ic = 'default' +grid_type = 'rectangular' +atm_data_type = 'box' diff --git a/configuration/scripts/options/set_nml.gx1 b/configuration/scripts/options/set_nml.gx1 index d4ab3b398..af5ba1e75 100644 --- a/configuration/scripts/options/set_nml.gx1 +++ b/configuration/scripts/options/set_nml.gx1 @@ -13,11 +13,7 @@ ycycle = 1 atm_data_format = 'bin' atm_data_type = 'LYq' atm_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/COREII' -precip_unit = 'mm_per_sec' -ocn_data_format = 'nc' -ocn_data_type = 'ncar' +precip_units = 'mm_per_sec' ocn_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/COREII' -ocn_data_file = 'oceanmixed_ice_depth.nc' -bgc_data_format = 'nc' bgc_data_dir = 'ICE_MACHINE_INPUTDATA/CICE_data/forcing/gx1/WOA/MONTHLY' diff --git a/configuration/scripts/parse_namelist.sh b/configuration/scripts/parse_namelist.sh index 4658081dd..ffdc9bacf 100755 --- a/configuration/scripts/parse_namelist.sh +++ b/configuration/scripts/parse_namelist.sh @@ -10,6 +10,7 @@ filemods=$2 #echo "$0 $1 $2" echo "running parse_namelist.sh" +foundstring="FoundSTRING" while read -r line do @@ -24,10 +25,20 @@ do # echo "$line $vname $value" #sed -i 's|\(^\s*'"$vname"'\s*\=\s*\)\(.*$\)|\1'"$value"'|g' $filename - sed -i.sedbak -e 's|\(^[[:space:]]*'"$vname"'[[:space:]]*=[[:space:]]*\)\(.*$\)|\1'"$value"'|g' $filename - if [[ -e "${filename}.sedbak" ]]; then - rm ${filename}.sedbak + cp ${filename} ${filename}.check + sed -i -e 's|\(^[[:space:]]*'"$vname"'[[:space:]]*=[[:space:]]*\)\(.*$\)|\1'"$foundstring"'|g' ${filename}.check + grep -q ${foundstring} ${filename}.check + if [ $? -eq 0 ]; then + sed -i.sedbak -e 's|\(^[[:space:]]*'"$vname"'[[:space:]]*=[[:space:]]*\)\(.*$\)|\1'"$value"'|g' ${filename} + if [[ -e "${filename}.sedbak" ]]; then + rm ${filename}.sedbak + fi + else + echo "$0 ERROR: parsing error for ${vname}" + exit -99 fi + rm ${filename}.check + fi done < "$filemods" diff --git a/configuration/scripts/tests/base_suite.ts b/configuration/scripts/tests/base_suite.ts index cdd35a417..6426ae928 100644 --- a/configuration/scripts/tests/base_suite.ts +++ b/configuration/scripts/tests/base_suite.ts @@ -8,8 +8,8 @@ smoke gx3 8x2 diag24,run1year,medium decomp gx3 4x2x25x29x5 smoke gx3 4x2 diag1,run5day smoke_gx3_8x2_diag1_run5day smoke gx3 4x1 diag1,run5day,thread smoke_gx3_8x2_diag1_run5day -restart gx1 40x4 droundrobin,short -restart tx1 40x4 dsectrobin,short +restart gx1 40x4 droundrobin,medium +restart tx1 40x4 dsectrobin,medium restart gx3 4x4 none restart gx3 4x4 iobinary restart gx3 6x2 alt01 @@ -19,8 +19,9 @@ restart gx3 4x4 alt04 restart gx3 4x4 alt05 restart gbox128 4x2 none restart gbox128 4x2 boxdyn -restart gbox128 2x2 boxadv +restart gbox128 2x2 boxadv,short restart gbox128 4x4 boxrestore +restart gbox80 1x1 box2001 smoke gx3 8x2 bgcz smoke gx3 8x2 bgcz,debug smoke gx3 8x1 bgcskl,debug diff --git a/configuration/scripts/tests/baseline.script b/configuration/scripts/tests/baseline.script index 6a9fed371..f9bec5e4d 100644 --- a/configuration/scripts/tests/baseline.script +++ b/configuration/scripts/tests/baseline.script @@ -77,19 +77,8 @@ if (${ICE_BFBCOMP} != ${ICE_SPVAL}) then set comp_data = "NoThInG__Here" endif - echo "" - echo "BFB Compare Mode:" - echo "Performing binary comparison between files" - echo "comp_data: ${comp_data}" - echo "test_data: ${test_data}" if (-e ${comp_data} && -e ${test_data}) then - if ( { cmp -s ${test_data} ${comp_data} } ) then - echo "PASS ${ICE_TESTNAME} bfbcomp ${ICE_BFBCOMP}" >> ${ICE_CASEDIR}/test_output - echo "bfbcomp and test dataset are identical" - else - echo "FAIL ${ICE_TESTNAME} bfbcomp ${ICE_BFBCOMP} different-data" >> ${ICE_CASEDIR}/test_output - echo "bfbcomp and test dataset are different" - endif + ${ICE_CASEDIR}/casescripts/comparebfb.csh $test_data $comp_data else echo "MISS ${ICE_TESTNAME} bfbcomp missing-data" >> ${ICE_CASEDIR}/test_output echo "Missing data" diff --git a/configuration/scripts/tests/comparebfb.csh b/configuration/scripts/tests/comparebfb.csh new file mode 100755 index 000000000..44e701fd1 --- /dev/null +++ b/configuration/scripts/tests/comparebfb.csh @@ -0,0 +1,206 @@ +#!/bin/csh -f + +# Compare the restart files or log files between the 2 cases +#----------------------------------------------------------- + +# usage: comparebfb.script base_dir test_dir +# +# base_dir: directory of either restart files or log files for the base +# simulation. +# test_dir: directory of either restart files or log files for the test +# simulation. +# +# To run a `restart` test, only 1 directory is passed + +# Check to see if this is a restart case (i.e., only 1 directory is passed) +if ( $#argv == 1 ) then + set restart = 1 + set compare = 0 + set base_dir = $argv[1] +else if ( $#argv == 2 ) then + if ( -f $argv[1] ) then + # Files were passed + set compare = 1 + set restart = 0 + set base_file = $argv[1] + set test_file = $argv[2] + else + # Directories were passed + set compare = 0 + set restart = 0 + set base_dir = $argv[1] + set test_dir = $argv[2] + endif +else + echo "Error in ${0}" + echo "Usage: ${0} " + echo " only included for non-restart tests" +endif + +if ( $compare == 0 ) then + # Check to see if the base directory includes runlogs, or restart files + set numfiles = `find $base_dir -maxdepth 1 -name 'cice.runlog*' | wc -l` + if ( $numfiles > 0 ) then + # Compare log files + set logcmp = 1 + else + # Compare restart files + set numfiles = `find $base_dir -maxdepth 1 -name '*.nc' | wc -l` + if ( $numfiles > 0 ) then + # Compare netcdf files + set binary = 0 + else + # Compare binary files + set binary = 1 + endif + set logcmp = 0 + endif +else + set logcmp = 0 + set binary = 0 +endif + +if ( $logcmp == 1 ) then + # Compare the diagnostic output in the log files + # --------------------- + echo "Performing comparison between log files:" + echo "" + echo "" + + if ( $restart == 1 ) then + # This is a restart test. Grab the base and test log files from the same directory + set base_log = `ls -t1 $base_dir/cice.runlog* | head -2 | tail -1` + set test_log = `ls -t1 $base_dir/cice.runlog* | head -1` + else + # This is a test comparing 2 separate directories + set base_log = `ls -t1 $base_dir/cice.runlog* | head -1` + set test_log = `ls -t1 $test_dir/cice.runlog* | head -1` + endif + echo "base: $base_log" + echo "test: $test_log" + + set base_out = `tac $base_log | awk 'BEGIN{found=1;} /istep1:/ {found=0} {if (found) print}' | tac | grep '= ' | grep -v 'min, max, sum' | tr '\n' ','` + set test_out = `tac $test_log | awk 'BEGIN{found=1;} /istep1:/ {found=0} {if (found) print}' | tac | grep '= ' | grep -v 'min, max, sum'` + + # Ensure that there is diagnostic output + if ( ${#base_out} < 10 || ${#test_out} < 10 ) then + echo "No diagnostic output for comparison" + exit 1 + endif + + # Replace all asterisks (*) with a period (!) as workaround for errors + # encountered looping through words with asterisks in csh + set base_out = `echo "$base_out" | sed 's/\*/./g'` + set test_out = `echo "$test_out" | sed 's/\*/./g'` + + set failure = 0 + # Loop through each line of diagnostic output and check for differences + foreach line ( "`echo '$base_out' | tr ',' '\n'`" ) + foreach word ( $line ) + if ( "$word" != "$test_out[1]" ) then + # Print the difference to the log + echo "Difference in:" + echo "$line" + echo "Base value: $word" + echo "Test value: $test_out[1]" + set failure = 1 + endif + shift test_out + end + end + + if ( $failure == 0 ) then + exit 0 + #echo "PASS ${ICE_TESTNAME} log " >> ${ICE_CASEDIR}/test_output + else + exit 1 + #echo "FAIL ${ICE_TESTNAME} log " >> ${ICE_CASEDIR}/test_output + endif +else if ( $compare == 0 ) then + echo "Exact Restart Comparison Mode:" + if ( $binary == 1 ) then + if ( $restart == 1 ) then + # Restart case. Compare restart files (iced.*) to base files (base_iced.*) + set end_date = `ls -t1 $base_dir | head -1 | awk -F'.' '{print $NF}'` + set failure = 0 + foreach file (${base_dir}/base_*${end_date}) + echo "Performing binary comparison between files:" + set base_data = `echo $file | awk -F'/' '{print $NF}'` + set test_data = `echo $file | awk -F'/' '{print $NF}' | cut -c6-` + echo "base: $base_data" + echo "test: $test_data" + cmp -s $base_data $test_data + if ( $? == 1 ) then + set failure = 1 + echo "Failure in data comparison" + break + endif + end + else + # bfbcmp case. Compare restart files (iced.*) between the 2 directories + set end_date = `ls -t1 $base_dir | head -1 | awk -F'.' '{print $NF}'` + set failure = 0 + foreach file (${base_dir}/*${end_date}) + echo "Performing binary comparison between files:" + set base_data = $base_dir/`echo $file | awk -F'/' '{print $NF}'` + set test_data = $test_dir/`echo $file | awk -F'/' '{print $NF}'` + echo "base: $base_data" + echo "test: $test_data" + cmp -s $base_data $test_data + if ( $? == 1 ) then + set failure = 1 + echo "Failure in data comparison" + break + endif + end + endif + if ( $failure == 0 ) then + exit 0 + #echo "PASS ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output + else + exit 1 + #echo "FAIL ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output + endif + else + echo "Performing binary comparison between files:" + if ( $restart == 1 ) then + # This is a restart test. Grab the restart files from the same directory + set base_file = $base_dir/`ls -t1 $base_dir | head -2 | tail -1` + set test_file = $base_dir/`ls -t1 $base_dir | head -1` + else + # This is a test comparing 2 separate directories + set base_file = $base_dir/`ls -t1 $base_dir | head -1` + set test_file = $test_dir/`ls -t1 $test_dir | head -1` + endif + echo "base: $base_file" + echo "test: $test_file" + if ( { cmp -s $test_file $base_file } ) then + exit 0 + #echo "PASS ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output + else + exit 1 + #echo "FAIL ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output + endif + endif +else if ( $compare == 1 ) then + # Compare restart files for differing cases (bfbcomp) + echo "" + echo "BFB Compare Mode:" + if ( "$base_file" =~ *.nc && "$test_file" =~ *.nc ) then + echo "Comparing netcdf files" + else if ( "$base_file" !=~ *.nc && "$test_file" !=~ *.nc ) then + echo "Comparing binary files" + else + echo "${0}: A comparison cannot be performed between netcdf and binary files." + exit 1 + endif + echo "base: $base_file" + echo "test: $test_file" + if ( { cmp -s $test_file $base_file } ) then + exit 0 + else + exit 1 + endif +else + echo "${0}: script failure" +endif # if logcmp diff --git a/configuration/scripts/tests/decomp_suite.ts b/configuration/scripts/tests/decomp_suite.ts index 88f2bd5b1..a17ac0c3f 100644 --- a/configuration/scripts/tests/decomp_suite.ts +++ b/configuration/scripts/tests/decomp_suite.ts @@ -6,7 +6,7 @@ restart gx3 6x2x4x29x18 dspacecurve restart_gx3_4x2x25x29x4_ restart gx3 8x2x8x10x20 droundrobin restart_gx3_4x2x25x29x4_dslenderX2 restart gx3 6x2x50x58x1 droundrobin restart_gx3_4x2x25x29x4_dslenderX2 restart gx3 4x2x19x19x10 droundrobin restart_gx3_4x2x25x29x4_dslenderX2 -restart gx3 1x20x5x29x80 dsectrobin restart_gx3_4x2x25x29x4_dslenderX2 +restart gx3 1x20x5x29x80 dsectrobin,short restart_gx3_4x2x25x29x4_dslenderX2 restart gx3 16x2x5x10x20 drakeX2 restart_gx3_4x2x25x29x4_dslenderX2 restart gx3 8x2x8x10x20 droundrobin,maskhalo restart_gx3_4x2x25x29x4_dslenderX2 restart gx3 1x4x25x29x16 droundrobin restart_gx3_4x2x25x29x4_dslenderX2 diff --git a/configuration/scripts/tests/poll_queue.csh b/configuration/scripts/tests/poll_queue.csh index 3077326c6..6a9481645 100755 --- a/configuration/scripts/tests/poll_queue.csh +++ b/configuration/scripts/tests/poll_queue.csh @@ -16,6 +16,9 @@ foreach line ( "`cat suite.log`" ) if ( "$line" =~ *'COMPILE SUCCESSFUL'* ) then set job_id = 1 endif + if ( "$line" =~ *'ciceexe'* ) then + set job_id = 1 + endif endif end diff --git a/configuration/scripts/tests/report_results.csh b/configuration/scripts/tests/report_results.csh index dc501060c..e3d1cef44 100755 --- a/configuration/scripts/tests/report_results.csh +++ b/configuration/scripts/tests/report_results.csh @@ -99,6 +99,7 @@ EOF @ ttotl = 0 @ tpass = 0 @ tfail = 0 +@ tunkn = 0 @ rpass = 0 @ rfail = 0 @ rothr = 0 @@ -202,6 +203,10 @@ if ( $fbuild != "" || $frun != "" || $ftest != "" ) then if (${fcomp} == "MISS") set rcomp = ${gray} if (${ftime} == "MISS") set rtime = ${gray} + if (${rbuild} == ${yellow}) set tchkpass = 2 + if (${rrun} == ${yellow}) set tchkpass = 2 + if (${rtest} == ${yellow}) set tchkpass = 2 + if (${rbuild} == ${red}) set tchkpass = 0 if (${rrun} == ${red}) set tchkpass = 0 if (${rtest} == ${red}) set tchkpass = 0 @@ -209,7 +214,11 @@ if ( $fbuild != "" || $frun != "" || $ftest != "" ) then if (${tchkpass} == 1) then @ tpass = $tpass + 1 else - @ tfail = $tfail + 1 + if (${tchkpass} == 2) then + @ tunkn = $tunkn + 1 + else + @ tfail = $tfail + 1 + endif endif if (${rregr} == ${green}) then @@ -299,7 +308,7 @@ cat >! ${hashfile} << EOF | machine | compiler | version | date | test fail | comp fail | total | | ------ | ------ | ------ | ------ | ------ | ------ | ------ | -| ${mach} | ${compiler} | ${vers} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | +| ${mach} | ${compiler} | ${vers} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | EOF if (-e ${hashfile}.prev) cat ${hashfile}.prev >> ${hashfile} @@ -307,7 +316,7 @@ if (-e ${hashfile}.prev) cat ${hashfile}.prev >> ${hashfile} else set oline = `grep -n "\*\*${hash}" ${hashfile} | head -1 | cut -d : -f 1` @ nline = ${oline} + 3 - sed -i "$nline a | ${mach} | ${compiler} | ${vers} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${hashfile} + sed -i "$nline a | ${mach} | ${compiler} | ${vers} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${hashfile} endif #===================== @@ -322,7 +331,7 @@ cat >! ${versfile} << EOF | machine | compiler | hash | date | test fail | comp fail | total | | ------ | ------ | ------ | ------ | ------ | ------ | ------ | -| ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | +| ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | EOF if (-e ${versfile}.prev) cat ${versfile}.prev >> ${versfile} @@ -330,7 +339,7 @@ if (-e ${versfile}.prev) cat ${versfile}.prev >> ${versfile} else set oline = `grep -n "\*\*${vers}" ${versfile} | head -1 | cut -d : -f 1` @ nline = ${oline} + 3 - sed -i "$nline a | ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${versfile} + sed -i "$nline a | ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${versfile} endif #===================== @@ -345,7 +354,7 @@ cat >! ${machfile} << EOF | version | hash | compiler | date | test fail | comp fail | total | | ------ | ------ | ------ | ------ | ------ | ------ | ------ | -| ${vers} | ${shhash} | ${compiler} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | +| ${vers} | ${shhash} | ${compiler} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | EOF if (-e ${machfile}.prev) cat ${machfile}.prev >> ${machfile} @@ -353,7 +362,7 @@ if (-e ${machfile}.prev) cat ${machfile}.prev >> ${machfile} else set oline = `grep -n "\*\*${mach}" ${machfile} | head -1 | cut -d : -f 1` @ nline = ${oline} + 3 - sed -i "$nline a | ${vers} | ${shhash} | ${compiler} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${machfile} + sed -i "$nline a | ${vers} | ${shhash} | ${compiler} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${machfile} endif #===================== @@ -368,7 +377,7 @@ cat >! ${branfile} << EOF | machine | compiler | hash | date | test fail | comp fail | total | | ------ | ------ | ------ | ------ | ------ | ------ | ------ | -| ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | +| ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | EOF if (-e ${branfile}.prev) cat ${branfile}.prev >> ${branfile} @@ -376,7 +385,7 @@ if (-e ${branfile}.prev) cat ${branfile}.prev >> ${branfile} else set oline = `grep -n "\*\*${bran}" ${branfile} | head -1 | cut -d : -f 1` @ nline = ${oline} + 3 - sed -i "$nline a | ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${branfile} + sed -i "$nline a | ${mach} | ${compiler} | ${shhash} | ${cdat} | ${tcolor} ${tfail}, ${tunkn} | ${rcolor} ${rfail}, ${rothr} | [${ttotl}](${ofile}) | " ${branfile} endif #foreach compiler diff --git a/configuration/scripts/tests/test_restart.script b/configuration/scripts/tests/test_restart.script index 712ab3f75..98bd10447 100644 --- a/configuration/scripts/tests/test_restart.script +++ b/configuration/scripts/tests/test_restart.script @@ -31,11 +31,19 @@ else echo "PASS ${ICE_TESTNAME} initialrun" >> ${ICE_CASEDIR}/test_output endif -# Prepend 'baseline_' to the final restart file to save for comparison -set test_file = `ls -t1 ${ICE_RUNDIR}/restart | head -1` -set test_data = ${ICE_RUNDIR}/restart/${test_file} -set base_data = ${ICE_RUNDIR}/restart/base_${test_file} -mv ${test_data} ${base_data} +# Prepend 'base_' to the final restart file to save for comparison +if ( "${ICE_IOTYPE}" == "binary" ) then + set end_date = `ls -t1 ${ICE_RUNDIR}/restart | head -1 | awk -F'.' '{print $NF}'` + foreach file (${ICE_RUNDIR}/restart/*${end_date}) + set surname = `echo $file | awk -F'/' '{print $NF}'` + mv $file ${ICE_RUNDIR}/restart/base_$surname + end +else + set test_file = `ls -t1 ${ICE_RUNDIR}/restart | head -1` + set test_data = ${ICE_RUNDIR}/restart/${test_file} + set base_data = ${ICE_RUNDIR}/restart/base_${test_file} + mv ${test_data} ${base_data} +endif #----------------------------------------------------------- # Run the CICE model for the restart simulation @@ -71,15 +79,18 @@ else if (${tcolumn} == "") set tcolumn = -1 echo "PASS ${ICE_TESTNAME} run ${ttimeloop} ${tdynamics} ${tcolumn}" >> ${ICE_CASEDIR}/test_output - echo "Exact Restart Comparison Mode:" - echo "Performing binary comparison between files:" - echo "base: $base_data" - echo "test: $test_data" - if ( { cmp -s $test_data $base_data } ) then + ${ICE_CASEDIR}/casescripts/comparebfb.csh ${ICE_RUNDIR}/restart + if ( $? == 0 ) then echo "PASS ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output else echo "FAIL ${ICE_TESTNAME} test " >> ${ICE_CASEDIR}/test_output endif + #${ICE_CASEDIR}/casescripts/comparebfb.csh ${ICE_RUNDIR}/ + #if ( $? == 0 ) then + # echo "PASS ${ICE_TESTNAME} log " >> ${ICE_CASEDIR}/test_output + #else + # echo "FAIL ${ICE_TESTNAME} log " >> ${ICE_CASEDIR}/test_output + #endif endif #----------------------------------------------------------- diff --git a/doc/source/cice_index.rst b/doc/source/cice_index.rst index be5e3bc70..c82c3c94a 100644 --- a/doc/source/cice_index.rst +++ b/doc/source/cice_index.rst @@ -33,7 +33,7 @@ either Celsius or Kelvin units). "aice_init", "concentration of ice at beginning of timestep", "" "aice0", "fractional open water area", "" "aice(n)", "total concentration of ice in grid cell (in category n)", "" - "albedo_type", ":math:`\bullet` type of albedo parameterization (‘default’ or ‘constant’)", "" + "albedo_type", ":math:`\bullet` type of albedo parameterization (‘ccsm3’ or ‘constant’)", "" "albcnt", "counter for averaging albedo", "" "albice", "bare ice albedo", "" "albicei", ":math:`\bullet` near infrared ice albedo for thicker ice", "" @@ -70,6 +70,7 @@ either Celsius or Kelvin units). "**B**", "", "" "bfb_flag", ":math:`\bullet` for bit-for-bit reproducible diagnostics", "" "bgc_data_dir", ":math:`\bullet` data directory for bgc", "" + "bgc_data_type", ":math:`\bullet` source of surface salinity data", "" "bgc_flux_type", ":math:`\bullet` ice–ocean flux velocity", "" "bgc_tracer_type", "tracer_type for bgc tracers", "" "bgrid", "nondimensional vertical grid points for bio grid", "" @@ -133,6 +134,7 @@ either Celsius or Kelvin units). "dbl_kind", "definition of double precision", "selected_real_kind(13)" "dbug", ":math:`\bullet` write extra diagnostics", ".false." "Delta", "function of strain rates (see Section :ref:`dynam`)", "1/s" + "default_season", "Season from which initial values of forcing are set.", "winter" "denom1", "combination of constants for stress equation", "" "depressT", "ratio of freezing temperature to salinity of brine", "0.054 deg/ppt" "dhbr_bt", "change in brine height at the bottom of the column", "" @@ -430,6 +432,7 @@ either Celsius or Kelvin units). "oceanmixed_ice", ":math:`\bullet` if true, use internal ocean mixed layer", "" "ocn_data_dir", ":math:`\bullet` directory for ocean forcing data", "" "ocn_data_format", ":math:`\bullet` format of ocean forcing files", "" + "ocn_data_type", ":math:`\bullet` source of surface temperature data", "" "omega", "angular velocity of Earth", "7.292\ :math:`\times`\ 10\ :math:`^{-5}` rad/s" "opening", "rate of ice opening due to divergence and shear", "1/s" "**P**", "", "" @@ -509,7 +512,7 @@ either Celsius or Kelvin units). "restart_ext", ":math:`\bullet` if true, read/write halo cells in restart file", "" "restore_bgc", ":math:`\bullet` if true, restore nitrate/silicate to data", "" "restore_ice", ":math:`\bullet` if true, restore ice state along lateral boundaries", "" - "restore_sst", ":math:`\bullet` restore sst to data", "" + "restore_ocn", ":math:`\bullet` restore sst to data", "" "revised_evp", ":math:`\bullet` if true, use revised EVP parameters and approach", "" "rfracmin", ":math:`\bullet` minimum melt water fraction added to ponds", "0.15" "rfracmax", ":math:`\bullet` maximum melt water fraction added to ponds", "1.0" @@ -537,7 +540,7 @@ either Celsius or Kelvin units). "shcoef", "transfer coefficient for sensible heat", "" "shear", "strain rate II component", "1/s" "shlat", "southern latitude of artificial mask edge", "30\ :math:`^\circ`\ N" - "shortwave", ":math:`\bullet` flag for shortwave parameterization (‘default’ or ‘dEdd’)", "" + "shortwave", ":math:`\bullet` flag for shortwave parameterization (‘ccsm3’ or ‘dEdd’)", "" "sig1(2)", "principal stress components (diagnostic)", "" "sil", "silicate concentration", "mmol/m\ :math:`^3`" "sil_data_type", ":math:`\bullet` forcing type for silicate", "" @@ -550,9 +553,7 @@ either Celsius or Kelvin units). "spval_dbl", "special value (double precision)", ":math:`10^{30}`", "" "ss_tltx(y)", "sea surface in the x(y) direction", "m/m" "sss", "sea surface salinity", "ppt" - "sss_data_type", ":math:`\bullet` source of surface salinity data", "" "sst", "sea surface temperature", "C" - "sst_data_type", ":math:`\bullet` source of surface temperature data", "" "Sswabs", "shortwave radiation absorbed in snow layers", "W/m\ :math:`^2`" "stefan-boltzmann", "Stefan-Boltzmann constant", "5.67\ :math:`\times`\ 10\ :math:`^{-8}` W/m\ :math:`^2`\ K\ :math:`^4`" "stop_now", "if 1, end program execution", "" diff --git a/doc/source/master_list.bib b/doc/source/master_list.bib index f2258b0cc..5ea79f7a0 100644 --- a/doc/source/master_list.bib +++ b/doc/source/master_list.bib @@ -55,6 +55,7 @@ @string{EFM @string{GMD = {Geosci. Model Dev.}} @string{CRST = {Cold Reg. Sci. Technol.}} @string{IJHPCA={Int. J High Perform. Comput. Appl}} +@string{PTRSA={Philos. Trans. Royal Soc. A}} % **************************************** @@ -826,16 +827,6 @@ @Article{Craig14 pages = {154-165}, url = {http://dx.doi.org/10.1177/1094342014548771} } -% Irving2015 is not cited in the rst files. Should it be? -@Article{Irving2015, - author = "D. Irving", - title = "{A minimum standard for publishing computational results in the weather and climate sciences}", - year = "2015", - journal = BAMS, - number = {97}, - pages = {1149-1158}, - url = {http://dx.doi.org/10.1175/BAMS-D-15-00010.1} -} @Article{Tsamados14 author = "M. Tsamados and D.L. Feltham and D. Schroeder and D. Flocco and S.L. Farrell and N.T. Kurtz and S.W. Laxon and S. Bacon", title = "{Impact of variable atmospheric and oceanic form drag on simulations of Arctic sea ice}", @@ -880,13 +871,13 @@ @Article{Hunke18 year = {2018 - In Prep.}, url = {http://dx.doi.org/} } -% Roberts2018 is not cited in the rst files. Should it be? -@Article{Roberts2018, - author = "A. Roberts and W. Maslowski and E.C. Hunke and R. Osinski and J.J. Cassano and A.K. DuVivier and M. Hughes and M. Seefeldt and B. Nijssen and J. Hamman and J. Hutchings and M. Tsamados and D. Feltham", - title = "{Inter-comparison of isotropic and anisotropic sea-ice mechanics in a high-resolution fully coupled climate model}", - journal = {In Prep.}, - year = {2018 - In Prep.}, - url = {http://dx.doi.org/} +@Article{Roberts18, + author = "A. Roberts and E.C. Hunke and R. Allard and D.A. Bailey and A.P. Craig and J. Lemieux and M.D. Turner", + title = "{Quality control for community-based sea-ice model development}", + journal = {PTRSA}, + year = "2018", + volume = {376} + url = {http://dx.doi.org/10.1098/rsta.2017.0344} } % ** example template ** diff --git a/doc/source/user_guide/ug_case_settings.rst b/doc/source/user_guide/ug_case_settings.rst index f1c237fa5..9b07f8525 100755 --- a/doc/source/user_guide/ug_case_settings.rst +++ b/doc/source/user_guide/ug_case_settings.rst @@ -157,6 +157,8 @@ Table of namelist options "", "``1``", "new formula with round numbers", "" "", "``2``", "WMO standard categories", "" "", "``-1``", "one category", "" + "``dxrect``", "real", "x-direction grid spacing (meters) for rectangular grid", "" + "``dyrect``", "real", "y-direction grid spacing (meters) for rectangular grid", "" "``ncat``", "integer", "number of ice thickness categories", "5" "``nilyr``", "integer", "number of vertical layers in ice", "7" "``nslyr``", "integer", "number of vertical layers in snow", "1" @@ -235,6 +237,7 @@ Table of namelist options "``ktherm``", "``0``", "zero-layer thermodynamic model", "" "", "``1``", "Bitz and Lipscomb thermodynamic model", "" "", "``2``", "mushy-layer thermodynamic model", "" + "", "``-1``", "thermodynamics disabled", "" "``conduct``", "``Maykut71``", "conductivity :cite:`Maykut71`", "" "", "``bubbly``", "conductivity :cite:`Pringle07`", "" "``a_rapid_mode``", "real", "brine channel diameter", "0.5x10 :math:`^{-3}` m" @@ -246,9 +249,11 @@ Table of namelist options "", "", "", "" "*dynamics_nml*", "", "", "" "", "", "*Dynamics*", "" - "``kdyn``", "``0``", "dynamics OFF", "1" + "``kdyn``", "``-1``", "dynamics OFF", "1" + "", "``0``", "dynamics OFF", "" "", "``1``", "EVP dynamics", "" "", "``2``", "EAP dynamics", "" + "", "``1``", "dynamics ON", "" "``revised_evp``", "true/false", "use revised EVP formulation", "" "``ndte``", "integer", "number of EVP subcycles", "120" "``advection``", "``remap``", "linear remapping advection", "‘remap’" @@ -261,12 +266,19 @@ Table of namelist options "", "``1``", "new ridging redistribution function", "" "``mu_rdg``", "real", "e-folding scale of ridged ice", "" "``Cf``", "real", "ratio of ridging work to PE change in ridging", "17." + "``coriolis``", "``latitude``", "Coriolis variable by latitude", "'latitude'" + "", "``constant``", "Constant coriolis value = 1.46e-4", "" + "", "``zero``", "Zero coriolis", "" + "``kridge``", "``1``", "Ridging Enabled", "1" + "", "``-1``", "Ridging Disabled", "" + "``ktransport``", "``1``", "Transport Enabled", "1" + "", "``-1``", "Transport Disabled", "" "", "", "", "" "*shortwave_nml*", "", "", "" "", "", "*Shortwave*", "" - "``shortwave``", "``default``", "NCAR CCSM3 distribution method", "" + "``shortwave``", "``ccsm3``", "NCAR CCSM3 distribution method", "" "", "``dEdd``", "Delta-Eddington method", "" - "``albedo_type``", "``default``", "NCAR CCSM3 albedos", "‘default’" + "``albedo_type``", "``ccsm3``", "NCAR CCSM3 albedos", "‘default’" "", "``constant``", "four constant albedos", "" "``albicev``", ":math:`0<\alpha <1`", "visible ice albedo for thicker ice", "" "``albicei``", ":math:`0<\alpha <1`", "near infrared ice albedo for thicker ice", "" @@ -299,15 +311,7 @@ Table of namelist options "``modal_aero``", "true/false", "modal aersols", "" "``restore_bgc``", "true/false", "restore bgc to data", "" "``solve_zsal`", "true/false", "update salinity tracer profile", "" - "``bgc_data_dir``", "path/", "data directory for bgc", "" "``skl_bgc``", "true/false", "biogeochemistry", "" - "``sil_data_type``", "``default``", "default forcing value for silicate", "" - "", "``clim``", "silicate forcing from ocean climatology :cite:`Garcia06`", "" - "``nit_data_type``", "``default``", "default forcing value for nitrate", "" - "", "``clim``", "nitrate forcing from ocean climatology :cite:`Garcia06`", "" - "", "``sss``", "nitrate forcing equals salinity", "" - "``fe_data_type``", "``default``", "default forcing value for iron", "" - "", "``clim``", "iron forcing from ocean climatology", "" "``bgc_flux_type``", "``Jin2006``", "ice–ocean flux velocity of :cite:`Jin06`", "" "", "``constant``", "constant ice–ocean flux velocity", "" "``restart_bgc``", "true/false", "restart tracer values from file", "" @@ -327,19 +331,12 @@ Table of namelist options "", "``constant``", "bulk transfer coefficients", "" "``fyear_init``", "yyyy", "first year of atmospheric forcing data", "" "``ycycle``", "integer", "number of years in forcing data cycle", "" - "``atm_data_format``", "``nc``", "read  atmo forcing files", "" - "", "``bin``", "read direct access, binary files", "" - "``atm_data_type``", "``default``", "constant values defined in the code", "" - "", "``LYq``", "AOMIP/Large-Yeager forcing data", "" - "", "``monthly``", "monthly forcing data", "" - "", "``ncar``", "NCAR bulk forcing data", "" - "", "``oned``", "column forcing data", "" - "``atm_data_dir``", "path/", "path to atmospheric forcing data directory", "" "``calc_strair``", "true", "calculate wind stress and speed", "" "", "false", "read wind stress and speed from files", "" "``highfreq``", "true/false", "high-frequency atmo coupling", "" "``natmiter``", "integer", "number of atmo boundary layer iterations", "" "``calc_Tsfc``", "true/false", "calculate surface temperature", "``.true.``" + "``default_season``","``winter``", "Sets initial values of forcing and is overwritten if forcing is read in.", "" "``precip_units``", "``mks``", "liquid precipitation data units", "" "", "``mm_per_month``", "", "" "", "``mm_per_sec``", "(same as MKS units)", "" @@ -355,19 +352,35 @@ Table of namelist options "``l_mpond_fresh``", "true", "retain (topo) pond water until ponds drain", "" "", "false", "release (topo) pond water immediately to ocean", "" "``oceanmixed_ice``", "true/false", "active ocean mixed layer calculation", "``.true.`` (if uncoupled)" - "``ocn_data_format``", "``nc``", "read  ocean forcing files", "" - "", "``bin``", "read direct access, binary files", "" - "``sss_data_type``", "``default``", "constant values defined in the code", "" - "", "``clim``", "climatological data", "" - "", "``near``", "POP ocean forcing data", "" - "``sst_data_type``", "``default``", "constant values defined in the code", "" + "``restore_ocn``", "true/false", "restore sst to data", "" + "``trestore``", "integer", "sst restoring time scale (days)", "" + "``restore_ice``", "true/false", "restore ice state along lateral boundaries", "" + "``atm_data_type``", "``default``", "constant values defined in the code", "" + "", "``LYq``", "AOMIP/Large-Yeager forcing data", "" + "", "``monthly``", "monthly forcing data", "" + "", "``ncar``", "NCAR bulk forcing data", "" + "", "``oned``", "column forcing data", "" + "``ocn_data_type``", "``default``", "constant values defined in the code", "" "", "``clim``", "climatological data", "" "", "``ncar``", "POP ocean forcing data", "" - "``ocn_data_dir``", "path/", "path to oceanic forcing data directory", "" + "``bgc_data_type``", "``default``", "constant values defined in the code", "" + "", "``clim``", "climatological data", "" + "", "``near``", "POP ocean forcing data", "" + "``sil_data_type``", "``default``", "default forcing value for silicate", "" + "", "``clim``", "silicate forcing from ocean climatology :cite:`Garcia06`", "" + "``nit_data_type``", "``default``", "default forcing value for nitrate", "" + "", "``clim``", "nitrate forcing from ocean climatology :cite:`Garcia06`", "" + "", "``sss``", "nitrate forcing equals salinity", "" + "``fe_data_type``", "``default``", "default forcing value for iron", "" + "", "``clim``", "iron forcing from ocean climatology", "" + "``atm_data_format``", "``nc``", "read  atmo forcing files", "" + "", "``bin``", "read direct access, binary files", "" + "``ocn_data_format``", "``nc``", "read  ocean forcing files", "" + "", "``bin``", "read direct access, binary files", "" "``oceanmixed_file``", "filename", "data file containing ocean forcing data", "" - "``restore_sst``", "true/false", "restore sst to data", "" - "``trestore``", "integer", "sst restoring time scale (days)", "" - "``restore_ice``", "true/false", "restore ice state along lateral boundaries", "" + "``atm_data_dir``", "path/", "path to atmospheric forcing data directory", "" + "``ocn_data_dir``", "path/", "path to oceanic forcing data directory", "" + "``bgc_data_dir``", "path/", "path to oceanic forcing data directory", "" "", "", "", "" "*icefields_nml*", "", "", "" "", "", "*History Fields*", "" diff --git a/doc/source/user_guide/ug_testing.rst b/doc/source/user_guide/ug_testing.rst index f3cf92dac..20414a08c 100644 --- a/doc/source/user_guide/ug_testing.rst +++ b/doc/source/user_guide/ug_testing.rst @@ -202,6 +202,34 @@ Individual Test Examples argument and the same testid to the end of the diff argument. Then the runs will be compared for bit-for-bit and a result will be produced in test_output. +Specific Test Cases +~~~~~~~~~~~~~~~~~~~ + +In addition to the test implemented in the general testing framework, specific +tests have been developed to validate specific portions of the model. These +specific tests are detailed in this section. + +``box2001`` +^^^^^^^^^^^^ + +The ``box2001`` test case is configured to perform the rectangular-grid box test +detailed in :cite:`Hunke01`. It is configured to run a 72-hour simulation with +thermodynamics disabled in a rectangular domain (80 x 80 grid cells) with a land +boundary around the entire domain. It includes the following namelist modifications: + +- ``dxrect``: ``16.e5`` meters +- ``dyrect``: ``16.e5`` meters +- ``thermo``: ``0`` (disables thermodynamics) +- ``coriolis``: ``zero`` (zero coriolis force) + +Ocean stresses are computed as in :cite:`Hunke01` where they are circular and centered +in the square domain. The ice distribution is fixed, with a constant 2 meter ice +thickness and a concentration field that varies linearly in the x-direction from ``0`` +to ``1`` and is constant in the y-direction. No islands are included in this +configuration. The test is configured to run on a single processor. + +To run the test: ``./cice.setup -m --test smoke -s box2001 --testid +--grid gbox80 --acct -p 1x1`` .. _testsuites: @@ -523,7 +551,7 @@ and CICE have not significantly altered simulated ice volume using previous mode configurations. Here we describe the CICE testing tools, which are applies to output from five-year gx-1 simulations that use the standard CICE atmospheric forcing. A scientific justification of the testing is provided in -:cite:`Hunke18`. +:cite:`Hunke18`. The following sections follow :cite:`Roberts18`. .. _paired: