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

CICE addition of fswthru by components. #479

Merged
merged 8 commits into from
Jul 9, 2020
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
32 changes: 31 additions & 1 deletion cicecore/cicedynB/general/ice_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ module ice_flux
fresh , & ! fresh water flux to ocean (kg/m^2/s)
fsalt , & ! salt flux to ocean (kg/m^2/s)
fhocn , & ! net heat flux to ocean (W/m^2)
fswthru ! shortwave penetrating to ocean (W/m^2)
fswthru , & ! shortwave penetrating to ocean (W/m^2)
fswthru_vdr , & ! vis dir shortwave penetrating to ocean (W/m^2)
fswthru_vdf , & ! vis dif shortwave penetrating to ocean (W/m^2)
fswthru_idr , & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthru_idf ! nir dif shortwave penetrating to ocean (W/m^2)

! internal

Expand Down Expand Up @@ -438,6 +442,10 @@ subroutine alloc_flux
fsalt (nx_block,ny_block,max_blocks), & ! salt flux to ocean (kg/m^2/s)
fhocn (nx_block,ny_block,max_blocks), & ! net heat flux to ocean (W/m^2)
fswthru (nx_block,ny_block,max_blocks), & ! shortwave penetrating to ocean (W/m^2)
fswthru_vdr (nx_block,ny_block,max_blocks), & ! vis dir shortwave penetrating to ocean (W/m^2)
fswthru_vdf (nx_block,ny_block,max_blocks), & ! vis dif shortwave penetrating to ocean (W/m^2)
fswthru_idr (nx_block,ny_block,max_blocks), & ! nir dir shortwave penetrating to ocean (W/m^2)
fswthru_idf (nx_block,ny_block,max_blocks), & ! nir dif shortwave penetrating to ocean (W/m^2)
scale_factor (nx_block,ny_block,max_blocks), & ! scaling factor for shortwave components
strairx_ocn(nx_block,ny_block,max_blocks), & ! stress on ocean by air, x-direction
strairy_ocn(nx_block,ny_block,max_blocks), & ! stress on ocean by air, y-direction
Expand Down Expand Up @@ -684,6 +692,10 @@ subroutine init_coupler_flux
fpond (:,:,:) = c0
fhocn (:,:,:) = c0
fswthru (:,:,:) = c0
fswthru_vdr (:,:,:) = c0
fswthru_vdf (:,:,:) = c0
fswthru_idr (:,:,:) = c0
fswthru_idf (:,:,:) = c0
fresh_da(:,:,:) = c0 ! data assimilation
fsalt_da(:,:,:) = c0
flux_bio (:,:,:,:) = c0 ! bgc
Expand Down Expand Up @@ -783,6 +795,10 @@ subroutine init_flux_ocn
fpond (:,:,:) = c0
fhocn (:,:,:) = c0
fswthru (:,:,:) = c0
fswthru_vdr (:,:,:) = c0
fswthru_vdf (:,:,:) = c0
fswthru_idr (:,:,:) = c0
fswthru_idf (:,:,:) = c0

faero_ocn (:,:,:,:) = c0
fiso_ocn (:,:,:,:) = c0
Expand Down Expand Up @@ -978,6 +994,8 @@ subroutine scale_fluxes (nx_block, ny_block, &
Tref, Qref, &
fresh, fsalt, &
fhocn, fswthru, &
fswthru_vdr, fswthru_vdf, &
fswthru_idr, fswthru_idf, &
faero_ocn, &
alvdr, alidr, &
alvdf, alidf, &
Expand Down Expand Up @@ -1022,6 +1040,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt , & ! salt flux to ocean (kg/m2/s)
fhocn , & ! actual ocn/ice heat flx (W/m**2)
fswthru , & ! sw radiation through ice bot (W/m**2)
fswthru_vdr , & ! vis dir sw radiation through ice bot (W/m**2)
fswthru_vdf , & ! vis dif sw radiation through ice bot (W/m**2)
fswthru_idr , & ! nir dir sw radiation through ice bot (W/m**2)
fswthru_idf , & ! nir dif sw radiation through ice bot (W/m**2)
alvdr , & ! visible, direct (fraction)
alidr , & ! near-ir, direct (fraction)
alvdf , & ! visible, diffuse (fraction)
Expand Down Expand Up @@ -1090,6 +1112,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt (i,j) = fsalt (i,j) * ar
fhocn (i,j) = fhocn (i,j) * ar
fswthru (i,j) = fswthru (i,j) * ar
fswthru_vdr (i,j) = fswthru_vdr (i,j) * ar
fswthru_vdf (i,j) = fswthru_vdf (i,j) * ar
fswthru_idr (i,j) = fswthru_idr (i,j) * ar
fswthru_idf (i,j) = fswthru_idf (i,j) * ar
alvdr (i,j) = alvdr (i,j) * ar
alidr (i,j) = alidr (i,j) * ar
alvdf (i,j) = alvdf (i,j) * ar
Expand Down Expand Up @@ -1118,6 +1144,10 @@ subroutine scale_fluxes (nx_block, ny_block, &
fsalt (i,j) = c0
fhocn (i,j) = c0
fswthru (i,j) = c0
fswthru_vdr (i,j) = c0
fswthru_vdf (i,j) = c0
fswthru_idr (i,j) = c0
fswthru_idf (i,j) = c0
alvdr (i,j) = c0 ! zero out albedo where ice is absent
alidr (i,j) = c0
alvdf (i,j) = c0
Expand Down
34 changes: 28 additions & 6 deletions cicecore/cicedynB/general/ice_step_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ subroutine prep_radiation (iblk)
use ice_flux, only: scale_factor, swvdr, swvdf, swidr, swidf, &
alvdr_ai, alvdf_ai, alidr_ai, alidf_ai, &
alvdr_init, alvdf_init, alidr_init, alidf_init
use ice_arrays_column, only: fswsfcn, fswintn, fswthrun, &
use ice_arrays_column, only: fswsfcn, fswintn, &
fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf, &
fswpenln, Sswabsn, Iswabsn
use ice_state, only: aice, aicen
use ice_timers, only: ice_timer_start, ice_timer_stop, timer_sw
Expand Down Expand Up @@ -130,7 +131,12 @@ subroutine prep_radiation (iblk)
alvdr_ai = alvdr_ai(i,j, iblk), alvdf_ai = alvdf_ai(i,j, iblk), &
alidr_ai = alidr_ai(i,j, iblk), alidf_ai = alidf_ai(i,j, iblk), &
fswsfcn = fswsfcn (i,j, :,iblk), fswintn = fswintn (i,j, :,iblk), &
fswthrun = fswthrun(i,j, :,iblk), fswpenln = fswpenln(i,j,:,:,iblk), &
fswthrun = fswthrun(i,j, :,iblk), &
fswthrun_vdr = fswthrun_vdr(i,j, :,iblk), &
fswthrun_vdf = fswthrun_vdf(i,j, :,iblk), &
fswthrun_idr = fswthrun_idr(i,j, :,iblk), &
fswthrun_idf = fswthrun_idf(i,j, :,iblk), &
fswpenln = fswpenln(i,j,:,:,iblk), &
Sswabsn = Sswabsn (i,j,:,:,iblk), Iswabsn = Iswabsn (i,j,:,:,iblk))

enddo ! i
Expand All @@ -157,7 +163,8 @@ subroutine step_therm1 (dt, iblk)
Cdn_ocn, Cdn_ocn_skin, Cdn_ocn_floe, Cdn_ocn_keel, Cdn_atm_ratio, &
Cdn_atm, Cdn_atm_skin, Cdn_atm_floe, Cdn_atm_rdg, Cdn_atm_pond, &
hfreebd, hdraft, hridge, distrdg, hkeel, dkeel, lfloe, dfloe, &
fswsfcn, fswintn, fswthrun, Sswabsn, Iswabsn
fswsfcn, fswintn, Sswabsn, Iswabsn, &
fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf
use ice_blocks, only: block, get_block, nx_block, ny_block
use ice_calendar, only: yday
use ice_domain, only: blocks_ice
Expand All @@ -168,7 +175,8 @@ subroutine step_therm1 (dt, iblk)
flw, fsnow, fpond, sss, mlt_onset, frz_onset, fcondbotn, fcondbot, &
frain, Tair, strairxT, strairyT, fsurf, fcondtop, fsens, &
flat, fswabs, flwout, evap, evaps, evapi, Tref, Qref, Uref, fresh, fsalt, fhocn, &
fswthru, meltt, melts, meltb, congel, snoice, &
fswthru, fswthru_vdr, fswthru_vdf, fswthru_idr, fswthru_idf, &
meltt, melts, meltb, congel, snoice, &
flatn_f, fsensn_f, fsurfn_f, fcondtopn_f
use ice_flux_bgc, only: dsnown, faero_atm, faero_ocn, fiso_atm, fiso_ocn, &
Qa_iso, Qref_iso, fiso_evap, HDO_ocn, H2_16O_ocn, H2_18O_ocn
Expand Down Expand Up @@ -389,6 +397,10 @@ subroutine step_therm1 (dt, iblk)
fswsfcn = fswsfcn (i,j,:,iblk), &
fswintn = fswintn (i,j,:,iblk), &
fswthrun = fswthrun (i,j,:,iblk), &
fswthrun_vdr = fswthrun_vdr (i,j,:,iblk),&
fswthrun_vdf = fswthrun_vdf (i,j,:,iblk),&
fswthrun_idr = fswthrun_idr (i,j,:,iblk),&
fswthrun_idf = fswthrun_idf (i,j,:,iblk),&
fswabs = fswabs (i,j, iblk), &
flwout = flwout (i,j, iblk), &
Sswabsn = Sswabsn (i,j,:,:,iblk), &
Expand All @@ -405,6 +417,10 @@ subroutine step_therm1 (dt, iblk)
fsalt = fsalt (i,j, iblk), &
fhocn = fhocn (i,j, iblk), &
fswthru = fswthru (i,j, iblk), &
fswthru_vdr = fswthru_vdr (i,j, iblk),&
fswthru_vdf = fswthru_vdf (i,j, iblk),&
fswthru_idr = fswthru_idr (i,j, iblk),&
fswthru_idf = fswthru_idf (i,j, iblk),&
flatn_f = flatn_f (i,j,:,iblk), &
fsensn_f = fsensn_f (i,j,:,iblk), &
fsurfn_f = fsurfn_f (i,j,:,iblk), &
Expand Down Expand Up @@ -985,7 +1001,8 @@ end subroutine step_dyn_ridge
subroutine step_radiation (dt, iblk)

use ice_arrays_column, only: ffracn, dhsn, &
fswsfcn, fswintn, fswthrun, fswpenln, Sswabsn, Iswabsn, &
fswsfcn, fswintn, fswpenln, Sswabsn, Iswabsn, &
fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf, &
albicen, albsnon, albpndn, &
alvdrn, alidrn, alvdfn, alidfn, apeffn, trcrn_sw, snowfracn, &
kaer_tab, waer_tab, gaer_tab, kaer_bc_tab, waer_bc_tab, &
Expand Down Expand Up @@ -1122,7 +1139,12 @@ subroutine step_radiation (dt, iblk)
alvdrn =alvdrn (i,j,: ,iblk), alvdfn =alvdfn (i,j,: ,iblk), &
alidrn =alidrn (i,j,: ,iblk), alidfn =alidfn (i,j,: ,iblk), &
fswsfcn =fswsfcn (i,j,: ,iblk), fswintn =fswintn (i,j,: ,iblk), &
fswthrun =fswthrun (i,j,: ,iblk), fswpenln=fswpenln(i,j,:,:,iblk), &
fswthrun =fswthrun (i,j,: ,iblk), &
fswthrun_vdr =fswthrun_vdr (i,j,: ,iblk), &
fswthrun_vdf =fswthrun_vdf (i,j,: ,iblk), &
fswthrun_idr =fswthrun_idr (i,j,: ,iblk), &
fswthrun_idf =fswthrun_idf (i,j,: ,iblk), &
fswpenln=fswpenln(i,j,:,:,iblk), &
Sswabsn =Sswabsn (i,j,:,:,iblk), Iswabsn =Iswabsn (i,j,:,:,iblk), &
albicen =albicen (i,j,: ,iblk), albsnon =albsnon (i,j,: ,iblk), &
albpndn =albpndn (i,j,: ,iblk), apeffn =apeffn (i,j,: ,iblk), &
Expand Down
10 changes: 5 additions & 5 deletions cicecore/drivers/nuopc/cmeps/ice_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module ice_import_export
use ice_flux , only : alvdr, alidr, alvdf, alidf, Tref, Qref, Uref
use ice_flux , only : flat, fsens, flwout, evap, fswabs, fhocn, fswthru
#if (defined NEWCODE)
use ice_flux , only : fswthruvdr, fswthruvdf, fswthruidr, fswthruidf
use ice_flux , only : fswthru_vdr, fswthru_vdf, fswthru_idr, fswthru_idf
use ice_flux , only : send_i2x_per_cat, fswthrun_ai
use ice_flux , only : faero_atm, faero_ocn
use ice_flux , only : fiso_atm, fiso_ocn, fiso_rain, fiso_evap
Expand Down Expand Up @@ -1007,19 +1007,19 @@ subroutine ice_export( exportState, rc )

#if (defined NEWCODE)
! flux of vis dir shortwave through ice to ocean
call state_setexport(exportState, 'mean_sw_pen_to_ocn_vis_dir_flx' , input=fswthruvdr, lmask=tmask, ifrac=ailohi, rc=rc)
call state_setexport(exportState, 'mean_sw_pen_to_ocn_vis_dir_flx' , input=fswthru_vdr, lmask=tmask, ifrac=ailohi, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! flux of vis dif shortwave through ice to ocean
call state_setexport(exportState, 'mean_sw_pen_to_ocn_vis_dif_flx' , input=fswthruvdf, lmask=tmask, ifrac=ailohi, rc=rc)
call state_setexport(exportState, 'mean_sw_pen_to_ocn_vis_dif_flx' , input=fswthru_vdf, lmask=tmask, ifrac=ailohi, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! flux of ir dir shortwave through ice to ocean
call state_setexport(exportState, 'mean_sw_pen_to_ocn_ir_dir_flx' , input=fswthruidr, lmask=tmask, ifrac=ailohi, rc=rc)
call state_setexport(exportState, 'mean_sw_pen_to_ocn_ir_dir_flx' , input=fswthru_idr, lmask=tmask, ifrac=ailohi, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

! flux of ir dif shortwave through ice to ocean
call state_setexport(exportState, 'mean_sw_pen_to_ocn_ir_dif_flx' , input=fswthruidf, lmask=tmask, ifrac=ailohi, rc=rc)
call state_setexport(exportState, 'mean_sw_pen_to_ocn_ir_dif_flx' , input=fswthru_idf, lmask=tmask, ifrac=ailohi, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
#endif

Expand Down
11 changes: 9 additions & 2 deletions cicecore/drivers/standalone/cice/CICE_RunMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ subroutine coupling_prep (iblk)
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, &
fswthru_ai, fhocn, &
fswthru, fswthru_vdr, fswthru_vdf, fswthru_idr, fswthru_idf, &
scale_factor, snowfrac, &
swvdr, swidr, swvdf, swidf, Tf, Tair, Qa, strairxT, strairyT, &
fsens, flat, fswabs, flwout, evap, Tref, Qref, &
scale_fluxes, frzmlt_init, frzmlt
Expand Down Expand Up @@ -550,7 +552,12 @@ subroutine coupling_prep (iblk)
evap (:,:,iblk), &
Tref (:,:,iblk), Qref (:,:,iblk), &
fresh (:,:,iblk), fsalt (:,:,iblk), &
fhocn (:,:,iblk), fswthru (:,:,iblk), &
fhocn (:,:,iblk), &
fswthru (:,:,iblk), &
fswthru_vdr (:,:,iblk), &
fswthru_vdf (:,:,iblk), &
fswthru_idr (:,:,iblk), &
fswthru_idf (:,:,iblk), &
faero_ocn(:,:,:,iblk), &
alvdr (:,:,iblk), alidr (:,:,iblk), &
alvdf (:,:,iblk), alidf (:,:,iblk), &
Expand Down
8 changes: 8 additions & 0 deletions cicecore/shared/ice_arrays_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ module ice_arrays_column
public :: &
fswsfcn , & ! SW absorbed at ice/snow surface (W m-2)
fswthrun , & ! SW through ice to ocean (W/m^2)
fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2)
fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2)
fswthrun_idr , & ! nir dir SW through ice to ocean (W/m^2)
fswthrun_idf , & ! nir dif SW through ice to ocean (W/m^2)
fswintn ! SW absorbed in ice interior, below surface (W m-2)

real (kind=dbl_kind), dimension (:,:,:,:,:), allocatable, &
Expand Down Expand Up @@ -359,6 +363,10 @@ subroutine alloc_arrays_column
snowfracn (nx_block,ny_block,ncat,max_blocks), & ! Category snow fraction used in radiation
fswsfcn (nx_block,ny_block,ncat,max_blocks), & ! SW absorbed at ice/snow surface (W m-2)
fswthrun (nx_block,ny_block,ncat,max_blocks), & ! SW through ice to ocean (W/m^2)
fswthrun_vdr (nx_block,ny_block,ncat,max_blocks), & ! vis dir SW through ice to ocean (W/m^2)
fswthrun_vdf (nx_block,ny_block,ncat,max_blocks), & ! vis dif SW through ice to ocean (W/m^2)
fswthrun_idr (nx_block,ny_block,ncat,max_blocks), & ! nir dir SW through ice to ocean (W/m^2)
fswthrun_idf (nx_block,ny_block,ncat,max_blocks), & ! nir dif SW through ice to ocean (W/m^2)
fswintn (nx_block,ny_block,ncat,max_blocks), & ! SW absorbed in ice interior, below surface (W m-2)
first_ice_real &
(nx_block,ny_block,ncat,max_blocks), & ! .true. = c1, .false. = c0
Expand Down
14 changes: 12 additions & 2 deletions cicecore/shared/ice_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,8 @@ end subroutine init_thermo_vertical
subroutine init_shortwave

use ice_arrays_column, only: fswpenln, Iswabsn, Sswabsn, albicen, &
albsnon, alvdrn, alidrn, alvdfn, alidfn, fswsfcn, fswthrun, &
albsnon, alvdrn, alidrn, alvdfn, alidfn, fswsfcn, &
fswthrun, fswthrun_vdr, fswthrun_vdf, fswthrun_idr, fswthrun_idf, &
fswintn, albpndn, apeffn, trcrn_sw, dhsn, ffracn, snowfracn, &
kaer_tab, waer_tab, gaer_tab, kaer_bc_tab, waer_bc_tab, gaer_bc_tab, bcenh, &
swgrid, igrid
Expand Down Expand Up @@ -304,6 +305,10 @@ subroutine init_shortwave
fswsfcn(i,j,n,iblk) = c0
fswintn(i,j,n,iblk) = c0
fswthrun(i,j,n,iblk) = c0
fswthrun_vdr(i,j,n,iblk) = c0
fswthrun_vdf(i,j,n,iblk) = c0
fswthrun_idr(i,j,n,iblk) = c0
fswthrun_idf(i,j,n,iblk) = c0
enddo ! ncat

enddo
Expand Down Expand Up @@ -363,7 +368,12 @@ subroutine init_shortwave
alvdrn=alvdrn(i,j,:,iblk), alvdfn=alvdfn(i,j,:,iblk), &
alidrn=alidrn(i,j,:,iblk), alidfn=alidfn(i,j,:,iblk), &
fswsfcn=fswsfcn(i,j,:,iblk), fswintn=fswintn(i,j,:,iblk), &
fswthrun=fswthrun(i,j,:,iblk), fswpenln=fswpenln(i,j,:,:,iblk), &
fswthrun=fswthrun(i,j,:,iblk), &
fswthrun_vdr=fswthrun_vdr(i,j,:,iblk), &
fswthrun_vdf=fswthrun_vdf(i,j,:,iblk), &
fswthrun_idr=fswthrun_idr(i,j,:,iblk), &
fswthrun_idf=fswthrun_idf(i,j,:,iblk), &
fswpenln=fswpenln(i,j,:,:,iblk), &
Sswabsn=Sswabsn(i,j,:,:,iblk), Iswabsn=Iswabsn(i,j,:,:,iblk), &
albicen=albicen(i,j,:,iblk), albsnon=albsnon(i,j,:,iblk), &
albpndn=albpndn(i,j,:,iblk), apeffn=apeffn(i,j,:,iblk), &
Expand Down
4 changes: 4 additions & 0 deletions doc/source/cice_index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ either Celsius or Kelvin units).
"fswint", "shortwave absorbed in ice interior", "W/m\ :math:`^2`"
"fswpenl", "shortwave penetrating through ice layers", "W/m\ :math:`^2`"
"fswthru", "shortwave penetrating to ocean", "W/m\ :math:`^2`"
"fswthru_vdr", "visible direct shortwave penetrating to ocean", "W/m\ :math:`^2`"
"fswthru_vdf", "visible diffuse shortwave penetrating to ocean", "W/m\ :math:`^2`"
"fswthru_idr", "near IR direct shortwave penetrating to ocean", "W/m\ :math:`^2`"
"fswthru_idf", "near IR diffuse shortwave penetrating to ocean", "W/m\ :math:`^2`"
"fswthru_ai", "grid-box-mean shortwave penetrating to ocean (fswthru)", "W/m\ :math:`^2`"
"fyear", "current data year", ""
"fyear_final", "last data year", ""
Expand Down