Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CICE to latest Consortium/main #45

Merged
merged 6 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cicecore/cicedynB/analysis/ice_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ subroutine print_state(plabel,i,j,iblk)
! dynamics (transport and/or ridging) causes the floe size distribution to become non-normal
! if (tr_fsd) then
! if (abs(sum(trcrn(i,j,nt_fsd:nt_fsd+nfsd-1,n,iblk))-c1) > puny) &
! print*,'afsdn not normal', &
! write(nu_diag,*) 'afsdn not normal', &
! sum(trcrn(i,j,nt_fsd:nt_fsd+nfsd-1,n,iblk)), &
! trcrn(i,j,nt_fsd:nt_fsd+nfsd-1,n,iblk)
! endif
Expand Down
29 changes: 16 additions & 13 deletions cicecore/cicedynB/analysis/ice_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ subroutine init_hist (dt)
integer (kind=int_kind), dimension(max_nstrm) :: &
ntmp
integer (kind=int_kind) :: nml_error ! namelist i/o error flag

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

!-----------------------------------------------------------------
Expand Down Expand Up @@ -121,25 +122,27 @@ subroutine init_hist (dt)
if (icepack_warnings_aborted()) call abort_ice(error_message=subname, &
file=__FILE__, line=__LINE__)

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

! histfreq options ('1','h','d','m','y')
Expand Down
31 changes: 17 additions & 14 deletions cicecore/cicedynB/analysis/ice_history_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ subroutine init_hist_bgc_2D
tr_bgc_N, tr_bgc_C, tr_bgc_chl, &
tr_bgc_DON, tr_bgc_Fe, tr_bgc_hum, &
skl_bgc, solve_zsal, z_tracers
character(len=*), parameter :: subname = '(init_hist_bgc_2D)'

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

call icepack_query_parameters(skl_bgc_out=skl_bgc, &
solve_zsal_out=solve_zsal, z_tracers_out=z_tracers)
Expand All @@ -303,25 +304,27 @@ subroutine init_hist_bgc_2D
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_bgc_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_bgc_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_bgc_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_bgc_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_bgc_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

if (.not. tr_iso) then
Expand Down
30 changes: 16 additions & 14 deletions cicecore/cicedynB/analysis/ice_history_drag.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ subroutine init_hist_drag_2D
integer (kind=int_kind) :: ns
integer (kind=int_kind) :: nml_error ! namelist i/o error flag
logical (kind=log_kind) :: formdrag

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

call icepack_query_parameters(formdrag_out=formdrag)
Expand All @@ -79,26 +80,27 @@ subroutine init_hist_drag_2D
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_drag_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_drag_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_drag_nml,iostat=nml_error)
if (nml_error > 0) read(nu_nml,*) ! for Nagware compiler
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_drag_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_drag_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

call broadcast_scalar (f_Cdn_atm, master_task)
Expand Down
29 changes: 16 additions & 13 deletions cicecore/cicedynB/analysis/ice_history_fsd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ subroutine init_hist_fsd_2D
integer (kind=int_kind) :: nml_error ! namelist i/o error flag
real (kind=dbl_kind) :: secday
logical (kind=log_kind) :: tr_fsd, wave_spec

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

call icepack_query_tracer_flags(tr_fsd_out=tr_fsd)
Expand All @@ -95,25 +96,27 @@ subroutine init_hist_fsd_2D
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_fsd_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_fsd_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_fsd_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_fsd_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_fsd_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

call broadcast_scalar (f_afsd, master_task)
Expand Down
29 changes: 16 additions & 13 deletions cicecore/cicedynB/analysis/ice_history_mechred.F90
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ subroutine init_hist_mechred_2D
integer (kind=int_kind) :: nml_error ! namelist i/o error flag
real (kind=dbl_kind) :: secday
logical (kind=log_kind) :: tr_lvl

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

call icepack_query_parameters(secday_out=secday)
Expand All @@ -101,25 +102,27 @@ subroutine init_hist_mechred_2D
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_mechred_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_mechred_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_mechred_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_mechred_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_mechred_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

if (.not. tr_lvl) then
Expand Down
29 changes: 16 additions & 13 deletions cicecore/cicedynB/analysis/ice_history_pond.F90
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ subroutine init_hist_pond_2D
integer (kind=int_kind) :: ns
integer (kind=int_kind) :: nml_error ! namelist i/o error flag
logical (kind=log_kind) :: tr_pond

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

call icepack_query_tracer_flags(tr_pond_out=tr_pond)
Expand All @@ -84,25 +85,27 @@ subroutine init_hist_pond_2D
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
write(nu_diag,*) subname,' Reading icefields_pond_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
nml_error = 1
call abort_ice(subname//'ERROR: icefields_pond_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_pond_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice(subname//'ERROR: reading icefields_pond_nml')
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_pond_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif

if (.not. tr_pond) then
Expand Down
46 changes: 24 additions & 22 deletions cicecore/cicedynB/analysis/ice_history_snow.F90
Original file line number Diff line number Diff line change
Expand Up @@ -87,30 +87,32 @@ subroutine init_hist_snow_2D (dt)

if (tr_snow) then

!-----------------------------------------------------------------
! read namelist
!-----------------------------------------------------------------

call get_fileunit(nu_nml)
if (my_task == master_task) then
open (nu_nml, file=nml_filename, status='old',iostat=nml_error)
if (nml_error /= 0) then
nml_error = -1
else
!-----------------------------------------------------------------
! read namelist
!-----------------------------------------------------------------

if (my_task == master_task) then
write(nu_diag,*) subname,' Reading icefields_snow_nml'

call get_fileunit(nu_nml)
open (nu_nml, file=trim(nml_filename), status='old',iostat=nml_error)
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_snow_nml open file '// &
trim(nml_filename), &
file=__FILE__, line=__LINE__)
endif

nml_error = 1
do while (nml_error > 0)
read(nu_nml, nml=icefields_snow_nml,iostat=nml_error)
end do
if (nml_error /= 0) then
call abort_ice(subname//'ERROR: icefields_snow_nml reading ', &
file=__FILE__, line=__LINE__)
endif
close(nu_nml)
call release_fileunit(nu_nml)
endif
do while (nml_error > 0)
read(nu_nml, nml=icefields_snow_nml,iostat=nml_error)
end do
if (nml_error == 0) close(nu_nml)
endif
call release_fileunit(nu_nml)

call broadcast_scalar(nml_error, master_task)
if (nml_error /= 0) then
close (nu_nml)
call abort_ice('ice: error reading icefields_snow_nml')
endif

else ! .not. tr_snow
f_smassice = 'x'
Expand Down
Loading