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

Feature/punyswrad #19

Merged
merged 21 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f18f839
Merge pull request #1 from NOAA-EMC/develop
DeniseWorthen Dec 2, 2019
be784ad
Merge pull request #2 from NOAA-EMC/develop
DeniseWorthen Dec 11, 2019
daefadd
remove divide by zero in cap
DeniseWorthen Dec 31, 2019
4b95d00
Merge pull request #3 from NOAA-EMC/develop
DeniseWorthen Jan 16, 2020
4b07e32
Merge pull request #4 from NOAA-EMC/develop
DeniseWorthen Jan 30, 2020
1187e44
Update Macros.Linux.NEMS.cheyenne
DeniseWorthen Feb 3, 2020
6d0e6b9
Merge pull request #6 from NOAA-EMC/develop
DeniseWorthen Feb 25, 2020
569ccf1
Explicitly label each field dump with timestamp
DeniseWorthen Mar 6, 2020
5e53299
set filename only once
DeniseWorthen Mar 7, 2020
fc0b929
found copy/paste errors and fixed
DeniseWorthen Mar 7, 2020
0f14869
new branch from timestamps with coszen and restart_ext
DeniseWorthen Mar 7, 2020
84c434c
fix constants to double precision or use defined
DeniseWorthen Mar 29, 2020
54dada9
add call to aggregate in CICE_InitMod to mimic
DeniseWorthen Apr 1, 2020
e32d8cd
fix editing error when added kind_r8 to constants
DeniseWorthen Apr 2, 2020
4283aef
update shortwave w/ cesm's routine
DeniseWorthen Apr 4, 2020
ea83a19
fix compile errors
DeniseWorthen Apr 5, 2020
5319928
Merge pull request #8 from NOAA-EMC/develop
DeniseWorthen Apr 23, 2020
a4987a6
Merge pull request #9 from DeniseWorthen/develop
DeniseWorthen Apr 23, 2020
bc1ab58
explicitly declare needed variables in CICE_InitMod
DeniseWorthen May 9, 2020
b39563f
calculate air density in cice5 cap rather than use copy sent
DeniseWorthen May 18, 2020
a6084ac
Merge pull request #10 from DeniseWorthen/feature/calc_rhoa
DeniseWorthen May 21, 2020
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
36 changes: 32 additions & 4 deletions lanl_cice/drivers/cice/CICE_InitMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@ subroutine init_restart
use ice_brine, only: init_hbrine
use ice_calendar, only: time, calendar
use ice_domain, only: nblocks
use ice_domain_size, only: ncat
use ice_domain_size, only: ncat, max_ntrcr
use ice_dyn_eap, only: read_restart_eap
use ice_dyn_shared, only: kdyn
use ice_firstyear, only: init_fy, restart_FY, read_restart_FY
use ice_flux, only: sss
use ice_grid, only: tmask
use ice_init, only: ice_ic
use ice_itd, only: aggregate
use ice_lvl, only: init_lvl, restart_lvl, read_restart_lvl
use ice_meltpond_cesm, only: init_meltponds_cesm, &
restart_pond_cesm, read_restart_pond_cesm
Expand All @@ -187,9 +189,12 @@ subroutine init_restart
restart_pond_topo, read_restart_pond_topo
use ice_restart_shared, only: runtype, restart
use ice_restart_driver, only: restartfile, restartfile_v4
use ice_state, only: tr_iage, tr_FY, tr_lvl, tr_pond_cesm, &
tr_pond_lvl, tr_pond_topo, tr_aero, trcrn, &
nt_iage, nt_FY, nt_alvl, nt_vlvl, nt_apnd, nt_hpnd, nt_ipnd, tr_brine
use ice_state, only: aicen, vicen, vsnon, aice, trcr, &
vice, vsno, aice0, tr_iage, trcrn, trcr_depend, &
tr_brine, tr_aero, tr_pond_topo, tr_pond_lvl, tr_pond_cesm, &
tr_lvl, nt_alvl, nt_vlvl, tr_fy, nt_iage, nt_fy, &
nt_hpnd, nt_apnd, nt_ipnd

use ice_zbgc, only: init_bgc
use ice_zbgc_shared, only: skl_bgc

Expand Down Expand Up @@ -289,6 +294,29 @@ subroutine init_restart
if (tr_brine) call init_hbrine ! brine height tracer
if (skl_bgc) call init_bgc ! biogeochemistry

!-----------------------------------------------------------------
! aggregate tracers
!-----------------------------------------------------------------

!$OMP PARALLEL DO PRIVATE(iblk)
do iblk = 1, nblocks

call aggregate (nx_block, ny_block, &
aicen(:,:,:,iblk), &
trcrn(:,:,:,:,iblk),&
vicen(:,:,:,iblk), &
vsnon(:,:,:,iblk), &
aice (:,:, iblk), &
trcr (:,:,:,iblk), &
vice (:,:, iblk), &
vsno (:,:, iblk), &
aice0(:,:, iblk), &
tmask(:,:, iblk), &
max_ntrcr, &
trcr_depend)

enddo
!$OMP END PARALLEL DO
end subroutine init_restart

!=======================================================================
Expand Down
33 changes: 25 additions & 8 deletions lanl_cice/io_netcdf/ice_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ subroutine init_restart_write(filename_spec)

call define_rest_field(ncid,'uvel',dims)
call define_rest_field(ncid,'vvel',dims)
call define_rest_field(ncid,'coszen',dims)

call define_rest_field(ncid,'scale_factor',dims)
call define_rest_field(ncid,'swvdr',dims)
Expand Down Expand Up @@ -395,6 +396,7 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, &
use ice_domain_size, only: max_blocks, ncat
use ice_fileunits, only: nu_diag
use ice_read_write, only: ice_read, ice_read_nc
use ice_communicate, only: my_task, master_task

integer (kind=int_kind), intent(in) :: &
nu , & ! unit number (not used for netcdf)
Expand Down Expand Up @@ -425,22 +427,37 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, &
varid, & ! variable id
status ! status variable from netCDF routine

logical (kind=log_kind) :: &
restart_ext2 ! temporary value to allow restart_ext for writing
! but not reading if runtyp = initial

real (kind=dbl_kind), dimension(nx_block,ny_block,max_blocks) :: &
work2 ! input array (real, 8-byte)

! set temporary variable
restart_ext2 = restart_ext
if(runtype .eq. 'initial' .and. restart_ext)restart_ext2 = .false.
if (my_task == master_task)then
if(restart_ext2)then
write(nu_diag,*)'NOTE: will read ghost cells in restart'
else
write(nu_diag,*)'NOTE: will not read ghost cells in restart'
end if
end if

if (restart_format == 'nc') then
if (present(field_loc)) then
if (ndim3 == ncat) then
if (restart_ext) then
if (restart_ext2) then
call ice_read_nc(ncid,1,vname,work,diag, &
field_loc=field_loc,field_type=field_type,restart_ext=restart_ext)
field_loc=field_loc,field_type=field_type,restart_ext=restart_ext2)
else
call ice_read_nc(ncid,1,vname,work,diag,field_loc,field_type)
endif
elseif (ndim3 == 1) then
if (restart_ext) then
if (restart_ext2) then
call ice_read_nc(ncid,1,vname,work2,diag, &
field_loc=field_loc,field_type=field_type,restart_ext=restart_ext)
field_loc=field_loc,field_type=field_type,restart_ext=restart_ext2)
else
call ice_read_nc(ncid,1,vname,work2,diag,field_loc,field_type)
endif
Expand All @@ -450,14 +467,14 @@ subroutine read_restart_field(nu,nrec,work,atype,vname,ndim3, &
endif
else
if (ndim3 == ncat) then
if (restart_ext) then
call ice_read_nc(ncid, 1, vname, work, diag, restart_ext=restart_ext)
if (restart_ext2) then
call ice_read_nc(ncid, 1, vname, work, diag, restart_ext=restart_ext2)
else
call ice_read_nc(ncid, 1, vname, work, diag)
endif
elseif (ndim3 == 1) then
if (restart_ext) then
call ice_read_nc(ncid, 1, vname, work2, diag, restart_ext=restart_ext)
if (restart_ext2) then
call ice_read_nc(ncid, 1, vname, work2, diag, restart_ext=restart_ext2)
else
call ice_read_nc(ncid, 1, vname, work2, diag)
endif
Expand Down
6 changes: 5 additions & 1 deletion lanl_cice/source/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ module ice_flux
albice , & ! bare ice albedo
albsno , & ! snow albedo
albpnd , & ! melt pond albedo
apeff_ai ! effective pond area used for radiation calculation
apeff_ai , & ! effective pond area used for radiation calculation
snowfrac ! snow fraction used in radiation

real (kind=dbl_kind), &
dimension(nx_block,ny_block,max_blocks,max_nstrm), target, public :: &
Expand All @@ -210,6 +211,9 @@ module ice_flux
fswthruidr, & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthruidf ! nir dif shortwave penetrating to ocean (W/m^2)

real (kind=dbl_kind), dimension (:,:,:,:), allocatable, public :: &
fswthrun_ai ! per-category fswthru * ai (W/m^2)

real (kind=dbl_kind), &
dimension (nx_block,ny_block,max_aero,max_blocks), target, public :: &
faero_ocn ! aerosol flux to ocean (kg/m^2/s)
Expand Down
7 changes: 5 additions & 2 deletions lanl_cice/source/ice_restart_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ subroutine dumpfile(filename_spec)
use ice_domain_size, only: nilyr, nslyr, ncat, max_blocks
use ice_fileunits, only: nu_diag, nu_rst_pointer, nu_dump
use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, &
strocnxT, strocnyT, sst, frzmlt, iceumask, &
strocnxT, strocnyT, sst, frzmlt, iceumask, coszen, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
Expand Down Expand Up @@ -125,6 +125,7 @@ subroutine dumpfile(filename_spec)
!-----------------------------------------------------------------
! radiation fields
!-----------------------------------------------------------------
call write_restart_field(nu_dump,0,coszen,'ruf8','coszen',1,diag)
call write_restart_field(nu_dump,0,scale_factor,'ruf8','scale_factor',1,diag)

call write_restart_field(nu_dump,0,swvdr,'ruf8','swvdr',1,diag)
Expand Down Expand Up @@ -200,7 +201,7 @@ subroutine restartfile (ice_ic)
max_ntrcr, max_blocks
use ice_fileunits, only: nu_diag, nu_rst_pointer, nu_restart
use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, &
strocnxT, strocnyT, sst, frzmlt, iceumask, &
strocnxT, strocnyT, sst, frzmlt, iceumask, coszen, &
stressp_1, stressp_2, stressp_3, stressp_4, &
stressm_1, stressm_2, stressm_3, stressm_4, &
stress12_1, stress12_2, stress12_3, stress12_4
Expand Down Expand Up @@ -327,6 +328,8 @@ subroutine restartfile (ice_ic)
if (my_task == master_task) &
write(nu_diag,*) 'radiation fields'

call read_restart_field(nu_restart,0,coszen,'ruf8', &
'coszen',1,diag, field_loc_center, field_type_scalar)
call read_restart_field(nu_restart,0,scale_factor,'ruf8', &
'scale_factor',1,diag, field_loc_center, field_type_scalar)
call read_restart_field(nu_restart,0,swvdr,'ruf8', &
Expand Down
Loading