Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Jun 2, 2020
2 parents d46d691 + 2054d09 commit 397e588
Show file tree
Hide file tree
Showing 148 changed files with 2,042 additions and 3,287 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ doc/build
# Ignore macOS cache files
.DS_Store


# Ignore testsuite file/directories
testsuite*
caselist*
20 changes: 11 additions & 9 deletions cice.setup
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,18 @@ EOF0
cat >! ${tsdir}/report_codecov.csh << EOF0
#!/bin/csh -f
#setenv CODECOV_TOKEN "1d09241f-ed9e-47d8-847c-038bab024b53" # consortium cice
#setenv CODECOV_TOKEN "f3236008-0b92-4707-9ad5-ad906f5d2ba7" # apcraig cice
setenv CODECOV_TOKEN "0dcc6066-fdce-47b6-b84a-c55e2a0af4c0" # apcraig test_cice_icepack
set report_name = "${shhash}:${branch}:${machine} ${testsuite}"
# define CODECOV_TOKEN env variable
if !(\$?CODECOV_TOKEN) then
if (-e ~/.codecov_cice_token) then
source ~/.codecov_cice_token
endif
if !(\$?CODECOV_TOKEN) then
echo "\${0}: ERROR, CODECOV_TOKEN env variable not defined"
exit 2
endif
endif
set report_name = "${shhash}:${branch}:${machine} ${testsuite}"
set use_curl = 1
EOF0
Expand Down Expand Up @@ -871,13 +878,8 @@ setenv ICE_COMPILER ${compiler}
setenv ICE_MACHCOMP ${machcomp}
setenv ICE_RUNDIR ${rundir}
setenv ICE_GRID ${grid}
#setenv ICE_NXGLOB ${ICE_DECOMP_NXGLOB} # moved to namelist
#setenv ICE_NYGLOB ${ICE_DECOMP_NYGLOB} # moved to namelist
setenv ICE_NTASKS ${task}
setenv ICE_NTHRDS ${thrd}
#setenv ICE_MXBLCKS ${ICE_DECOMP_MXBLCKS} # moved to namelist
#setenv ICE_BLCKX ${ICE_DECOMP_BLCKX} # moved to namelist
#setenv ICE_BLCKY ${ICE_DECOMP_BLCKY} # moved to namelist
setenv ICE_BASELINE ${basedir_tmp}
setenv ICE_BASEGEN ${baseGen}
setenv ICE_BASECOM ${baseCom}
Expand Down
20 changes: 9 additions & 11 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@
module ice_history

use ice_kinds_mod
use ice_communicate, only: my_task, master_task
use ice_constants, only: c0, c1, c2, c100, c360, c180, &
p001, p25, p5, mps_to_cmpdy, kg_to_g, spval
use ice_fileunits, only: nu_nml, nml_filename, nu_diag, &
get_fileunit, release_fileunit
get_fileunit, release_fileunit, flush_fileunit
use ice_exit, only: abort_ice
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted
use icepack_intfc, only: icepack_snow_temperature, icepack_ice_temperature
Expand Down Expand Up @@ -62,7 +63,6 @@ subroutine init_hist (dt)

use ice_blocks, only: nx_block, ny_block
use ice_broadcast, only: broadcast_scalar, broadcast_array
use ice_communicate, only: my_task, master_task
use ice_calendar, only: yday, days_per_year, histfreq, &
histfreq_n, nstreams
use ice_domain_size, only: max_blocks, max_nstrm, nilyr, nslyr, nblyr, ncat, nfsd
Expand Down Expand Up @@ -1570,10 +1570,6 @@ subroutine init_hist (dt)
if (allocated(Tsnz4d)) deallocate(Tsnz4d)
allocate(Tsnz4d(nx_block,ny_block,nzslyr,ncat_hist))
endif
if (f_Sinz (1:1) /= 'x') then
if (allocated(Sinz4d)) deallocate(Sinz4d)
allocate(Sinz4d(nx_block,ny_block,nzilyr,ncat_hist))
endif

!-----------------------------------------------------------------
! 4D (floe size, thickness categories) variables looped separately
Expand Down Expand Up @@ -1616,6 +1612,8 @@ subroutine init_hist (dt)
ntmp(:) = 0
if (my_task == master_task) then
write(nu_diag,*) ' '
write(nu_diag,*) 'total number of history fields = ',num_avail_hist_fields_tot
write(nu_diag,*) 'max number of history fields = ',max_avail_hist_fields
write(nu_diag,*) 'The following variables will be ', &
'written to the history tape: '
write(nu_diag,101) 'description','units','variable','frequency','x'
Expand Down Expand Up @@ -1687,7 +1685,7 @@ subroutine init_hist (dt)
if (allocated(a3Df)) a3Df(:,:,:,:,:) = c0
if (allocated(a4Di)) a4Di(:,:,:,:,:,:) = c0
if (allocated(a4Ds)) a4Ds(:,:,:,:,:,:) = c0
if (allocated(a4Ds)) a4Df(:,:,:,:,:,:) = c0
if (allocated(a4Df)) a4Df(:,:,:,:,:,:) = c0
avgct(:) = c0
albcnt(:,:,:,:) = c0

Expand Down Expand Up @@ -2970,7 +2968,7 @@ subroutine accum_hist (dt)
enddo
enddo
enddo
call accum_hist_field(n_Tinz-n3Dacum, iblk, nzilyr, ncat_hist, &
call accum_hist_field(n_Tinz-n3Dfcum, iblk, nzilyr, ncat_hist, &
Tinz4d(:,:,1:nzilyr,1:ncat_hist), a4Di)
endif
if (f_Sinz (1:1) /= 'x') then
Expand All @@ -2984,7 +2982,7 @@ subroutine accum_hist (dt)
enddo
enddo
enddo
call accum_hist_field(n_Sinz-n3Dacum, iblk, nzilyr, ncat_hist, &
call accum_hist_field(n_Sinz-n3Dfcum, iblk, nzilyr, ncat_hist, &
Sinz4d(:,:,1:nzilyr,1:ncat_hist), a4Di)
endif

Expand Down Expand Up @@ -3796,7 +3794,7 @@ subroutine accum_hist (dt)
enddo ! n

do n = 1, num_avail_hist_fields_4Di
nn = n3Dacum + n
nn = n3Dfcum + n
if (avail_hist_fields(nn)%vhistfreq == histfreq(ns)) then
do k = 1, nzilyr
do ic = 1, ncat_hist
Expand Down Expand Up @@ -4025,7 +4023,7 @@ subroutine accum_hist (dt)
if (avail_hist_fields(n)%vhistfreq == histfreq(ns)) a3Df(:,:,:,nn,:) = c0
enddo
do n = n3Dfcum + 1, n4Dicum
nn = n - n3Dacum
nn = n - n3Dfcum
if (avail_hist_fields(n)%vhistfreq == histfreq(ns)) a4Di(:,:,:,:,nn,:) = c0
enddo
do n = n4Dicum + 1, n4Dscum
Expand Down
58 changes: 27 additions & 31 deletions cicecore/cicedynB/analysis/ice_history_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,6 @@ subroutine init_hist_fsd_2D
call abort_ice(subname//'ERROR: reading icefields_fsd_nml')
endif

if (.not. tr_fsd) then
f_afsd = 'x'
f_afsdn = 'x'
f_dafsd_newi = 'x'
f_dafsd_latg = 'x'
f_dafsd_latm = 'x'
f_dafsd_wave = 'x'
f_dafsd_weld = 'x'
f_wave_sig_ht = 'x'
f_fsdrad = 'x'
f_fsdperim = 'x'
endif
if ((.not. tr_fsd) .or. (.not. wave_spec)) then
f_aice_ww = 'x'
f_diam_ww = 'x'
f_hice_ww = 'x'
endif

call broadcast_scalar (f_afsd, master_task)
call broadcast_scalar (f_afsdn, master_task)
call broadcast_scalar (f_dafsd_newi, master_task)
Expand Down Expand Up @@ -184,6 +166,24 @@ subroutine init_hist_fsd_2D

enddo ! nstreams

else ! tr_fsd

f_afsd = 'x'
f_afsdn = 'x'
f_dafsd_newi = 'x'
f_dafsd_latg = 'x'
f_dafsd_latm = 'x'
f_dafsd_wave = 'x'
f_dafsd_weld = 'x'
f_wave_sig_ht = 'x'
f_fsdrad = 'x'
f_fsdperim = 'x'
if (.not. wave_spec) then
f_aice_ww = 'x'
f_diam_ww = 'x'
f_hice_ww = 'x'
endif

endif ! tr_fsd

end subroutine init_hist_fsd_2D
Expand Down Expand Up @@ -428,11 +428,6 @@ subroutine accum_hist_fsd (iblk)
call accum_hist_field(n_fsdperim, iblk, worka, a2D)
endif






endif ! a2D allocated

! 3D category fields
Expand Down Expand Up @@ -474,19 +469,20 @@ subroutine accum_hist_fsd (iblk)
if (allocated(a4Df)) then

if (f_afsdn(1:1) /= 'x') then
do n = 1, ncat_hist
do k = 1, nfsd_hist
do j = 1, ny_block
do i = 1, nx_block
do n = 1, ncat_hist
do k = 1, nfsd_hist
workd(i,j,k,n) = trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k)
end do
end do
workd(i,j,k,n) = trcrn(i,j,nt_fsd+k-1,n,iblk) &
* aicen_init(i,j,n,iblk)/floe_binwidth(k)
end do
end do
end do
call accum_hist_field(n_afsdn-n4Dscum, iblk, &
nfsd_hist, ncat_hist, workd, a4Df)
end do
call accum_hist_field(n_afsdn-n4Dscum, iblk, nfsd_hist, ncat_hist, &
workd(:,:,1:nfsd_hist,1:ncat_hist), a4Df)
endif

endif ! a4Df allocated

endif ! tr_fsd
Expand Down
29 changes: 22 additions & 7 deletions cicecore/cicedynB/analysis/ice_history_shared.F90
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@
module ice_history_shared

use ice_kinds_mod
use ice_communicate, only: my_task, master_task
use ice_domain_size, only: max_nstrm
use ice_exit, only: abort_ice
use ice_fileunits, only: nu_diag
use icepack_intfc, only: icepack_warnings_flush, icepack_warnings_aborted

implicit none

private
public :: define_hist_field, accum_hist_field, icefields_nml, construct_filename

integer (kind=int_kind), public :: history_precision

logical (kind=log_kind), public :: &
hist_avg ! if true, write averaged data instead of snapshots

Expand All @@ -50,6 +54,9 @@ module ice_history_shared
character (len=char_len), public :: &
version_name

character (len=char_len), public :: &
history_format

!---------------------------------------------------------------
! Instructions for adding a field: (search for 'example')
! Here:
Expand Down Expand Up @@ -77,7 +84,7 @@ module ice_history_shared
end type

integer (kind=int_kind), parameter, public :: &
max_avail_hist_fields = 600 ! Max number of history fields
max_avail_hist_fields = 800 ! Max number of history fields

integer (kind=int_kind), public :: &
num_avail_hist_fields_tot = 0, & ! Current, total number of defined fields
Expand Down Expand Up @@ -109,8 +116,8 @@ module ice_history_shared
nzblyr , & ! bio grid
nzalyr ! aerosols (2 snow & nblyr+2 bio)

type (ice_hist_field), dimension(max_avail_hist_fields), public :: &
avail_hist_fields
type (ice_hist_field), public :: &
avail_hist_fields(max_avail_hist_fields)

integer (kind=int_kind), parameter, public :: &
nvar = 12 , & ! number of grid fields that can be written
Expand Down Expand Up @@ -804,8 +811,13 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
num_avail_hist_fields_4Df = num_avail_hist_fields_4Df + 1
endif

if (num_avail_hist_fields_tot > max_avail_hist_fields) &
call abort_ice(subname//'ERROR: Need to increase max_avail_hist_fields')
if (num_avail_hist_fields_tot > max_avail_hist_fields) then
if (my_task == master_task) then
write(nu_diag,*) subname,' num_avail_hist_fields_tot = ',num_avail_hist_fields_tot
write(nu_diag,*) subname,' max_avail_hist_fields = ',max_avail_hist_fields
endif
call abort_ice(subname//'ERROR: Need in computation of max_avail_hist_fields')
endif

if (num_avail_hist_fields_tot /= &
num_avail_hist_fields_2D + &
Expand All @@ -817,8 +829,11 @@ subroutine define_hist_field(id, vname, vunit, vcoord, vcellmeas, &
num_avail_hist_fields_4Di + &
num_avail_hist_fields_4Ds + &
num_avail_hist_fields_4Df) then
call abort_ice(subname//'ERROR: num_avail_hist_fields error')
endif
if (my_task == master_task) then
write(nu_diag,*) subname,' num_avail_hist_fields_tot = ',num_avail_hist_fields_tot
endif
call abort_ice(subname//'ERROR: in num_avail_hist_fields')
endif

id(ns) = num_avail_hist_fields_tot

Expand Down
6 changes: 1 addition & 5 deletions cicecore/cicedynB/dynamics/ice_dyn_eap.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1293,9 +1293,6 @@ subroutine stress_eap (nx_block, ny_block, &

strtmp(:,:,:) = c0

!DIR$ CONCURRENT !Cray
!cdir nodep !NEC
!ocl novrec !Fujitsu
do ij = 1, icellt
i = indxti(ij)
j = indxtj(ij)
Expand Down Expand Up @@ -2144,7 +2141,6 @@ subroutine read_restart_eap()
use ice_domain, only: nblocks, halo_info
use ice_grid, only: grid_type
use ice_restart, only: read_restart_field
use ice_restart_shared, only: restart_format

! local variables

Expand Down Expand Up @@ -2183,7 +2179,7 @@ subroutine read_restart_eap()
call read_restart_field(nu_restart_eap,0,a12_4,'ruf8', &
'a12_4',1,diag,field_loc_center,field_type_scalar) ! a12_4

if (trim(grid_type) == 'tripole' .and. trim(restart_format) == 'pio') then
if (trim(grid_type) == 'tripole') then

call ice_HaloUpdate_stress(a11_1, a11_3, halo_info, &
field_loc_center, field_type_scalar)
Expand Down
10 changes: 6 additions & 4 deletions cicecore/cicedynB/dynamics/ice_dyn_evp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ subroutine evp (dt)

type (block) :: &
this_block ! block information for current block

logical (kind=log_kind), save :: first_time = .true.

character(len=*), parameter :: subname = '(evp)'

Expand Down Expand Up @@ -349,7 +351,10 @@ subroutine evp (dt)
endif
call ice_timer_start(timer_evp_2d)
if (kevp_kernel > 0) then
! if (my_task == 0) write(nu_diag,*) subname,' Entering kevp_kernel version ',kevp_kernel
if (first_time .and. my_task == 0) then
write(nu_diag,'(2a,i6)') subname,' Entering kevp_kernel version ',kevp_kernel
first_time = .false.
endif
if (trim(grid_type) == 'tripole') then
call abort_ice(trim(subname)//' &
& Kernel not tested on tripole grid. Set kevp_kernel=0')
Expand Down Expand Up @@ -663,9 +668,6 @@ subroutine stress (nx_block, ny_block, &

str(:,:,:) = c0

!DIR$ CONCURRENT !Cray
!cdir nodep !NEC
!ocl novrec !Fujitsu
do ij = 1, icellt
i = indxti(ij)
j = indxtj(ij)
Expand Down
Loading

0 comments on commit 397e588

Please sign in to comment.