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

Add fswthru as four components. #320

Merged
merged 22 commits into from
Jun 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
158b443
Fix nt_zbgc_frac
dabail10 Feb 18, 2020
93c6ab4
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 Feb 20, 2020
8f3263d
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 Feb 24, 2020
776316e
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 Apr 2, 2020
a2219bf
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 Apr 6, 2020
2abbfa7
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 Apr 22, 2020
9bb6df7
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 Apr 22, 2020
b72c0bc
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 May 15, 2020
1f0195e
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 May 15, 2020
78c0aef
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack
dabail10 May 29, 2020
6a603cd
Merge branch 'master' of https://github.com/ESCOMP/Icepack
dabail10 May 29, 2020
dc9ffdf
Add components of fswthru
dabail10 May 29, 2020
779d9fa
Add documentation for fswthru components
dabail10 May 29, 2020
d151e77
making optional arguments
dabail10 Jun 4, 2020
f438701
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Jun 10, 2020
d701ac5
Add shortwave components as optional arguments in icepack_step_therm1
dabail10 Jun 10, 2020
a63298b
continued fswthru
dabail10 Jun 18, 2020
55ca5da
continue fswthru
dabail10 Jun 18, 2020
77e398d
fixes for fswthru by components
dabail10 Jun 18, 2020
407b883
Add an underscore to fswthru components
dabail10 Jun 23, 2020
f9cfc10
fix l_fsw arrays
dabail10 Jun 23, 2020
8046306
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Jun 24, 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
22 changes: 22 additions & 0 deletions columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ subroutine merge_fluxes (aicen, &
Trefn, Qrefn, &
freshn, fsaltn, &
fhocnn, fswthrun, &
fswthrun_vdr, fswthrun_vdf,&
fswthrun_idr, fswthrun_idf,&
strairxT, strairyT, &
Cdn_atm_ratio, &
fsurf, fcondtop, &
Expand All @@ -52,6 +54,8 @@ subroutine merge_fluxes (aicen, &
Tref, Qref, &
fresh, fsalt, &
fhocn, fswthru, &
fswthru_vdr, fswthru_vdf,&
fswthru_idr, fswthru_idf,&
melttn, meltsn, meltbn, congeln, snoicen, &
meltt, melts, &
meltb, &
Expand Down Expand Up @@ -84,6 +88,10 @@ subroutine merge_fluxes (aicen, &
fsaltn , & ! salt flux to ocean (kg/m2/s)
fhocnn , & ! actual ocn/ice heat flx (W/m**2)
fswthrun, & ! sw radiation through ice bot (W/m**2)
fswthrun_vdr, & ! vis dir sw radiation through ice bot (W/m**2)
fswthrun_vdf, & ! vis dif sw radiation through ice bot (W/m**2)
fswthrun_idr, & ! nir dir sw radiation through ice bot (W/m**2)
fswthrun_idf, & ! nir dif sw radiation through ice bot (W/m**2)
melttn , & ! top ice melt (m)
meltbn , & ! bottom ice melt (m)
meltsn , & ! snow melt (m)
Expand Down Expand Up @@ -120,6 +128,12 @@ subroutine merge_fluxes (aicen, &
congel , & ! congelation ice growth (m)
snoice ! snow-ice growth (m)

real (kind=dbl_kind), intent(inout), optional :: &
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)

real (kind=dbl_kind), optional, intent(inout):: &
Uref ! air speed reference level (m/s)

Expand Down Expand Up @@ -184,6 +198,14 @@ subroutine merge_fluxes (aicen, &
fsalt = fsalt + fsaltn * aicen
fhocn = fhocn + fhocnn * aicen
fswthru = fswthru + fswthrun * aicen
if (present(fswthru_vdr)) &
fswthru_vdr = fswthru_vdr + fswthrun_vdr * aicen
if (present(fswthru_vdf)) &
fswthru_vdf = fswthru_vdf + fswthrun_vdf * aicen
if (present(fswthru_idr)) &
fswthru_idr = fswthru_idr + fswthrun_idr * aicen
if (present(fswthru_idf)) &
fswthru_idf = fswthru_idf + fswthrun_idf * aicen

! ice/snow thickness

Expand Down
289 changes: 249 additions & 40 deletions columnphysics/icepack_shortwave.F90

Large diffs are not rendered by default.

149 changes: 117 additions & 32 deletions columnphysics/icepack_therm_vertical.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2074,7 +2074,12 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
fcondtop , fcondtopn , &
fcondbot , fcondbotn , &
fswsfcn , fswintn , &
fswthrun , fswabs , &
fswthrun , &
fswthrun_vdr, &
fswthrun_vdf, &
fswthrun_idr, &
fswthrun_idf, &
fswabs , &
flwout , &
Sswabsn , Iswabsn , &
flw , &
Expand All @@ -2083,7 +2088,12 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
evap , &
evaps , evapi , &
fresh , fsalt , &
fhocn , fswthru , &
fhocn , &
fswthru , &
fswthru_vdr , &
fswthru_vdf , &
fswthru_idr , &
fswthru_idf , &
flatn_f , fsensn_f , &
fsurfn_f , fcondtopn_f , &
faero_atm , faero_ocn , &
Expand Down Expand Up @@ -2194,6 +2204,12 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
mlt_onset , & ! day of year that sfc melting begins
frz_onset ! day of year that freezing begins (congel or frazil)

real (kind=dbl_kind), intent(inout), optional :: &
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)

real (kind=dbl_kind), dimension(:), optional, intent(inout) :: &
Qa_iso , & ! isotope specific humidity (kg/kg)
Qref_iso , & ! isotope 2m atm reference spec humidity (kg/kg)
Expand Down Expand Up @@ -2244,6 +2260,12 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
snoicen , & ! snow-ice growth (m)
dsnown ! change in snow thickness (m/step-->cm/day)

real (kind=dbl_kind), optional, dimension(:), intent(inout) :: &
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)

real (kind=dbl_kind), dimension(:,:), intent(inout) :: &
zqsn , & ! snow layer enthalpy (J m-3)
zqin , & ! ice layer enthalpy (J m-3)
Expand Down Expand Up @@ -2309,6 +2331,18 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
l_H2_16O_ocn, & ! local ocean concentration of H2_16O (kg/kg)
l_H2_18O_ocn ! local ocean concentration of H2_18O (kg/kg)

real (kind=dbl_kind) :: &
l_fswthru_vdr , & ! vis dir SW through ice to ocean (W/m^2)
l_fswthru_vdf , & ! vis dif SW through ice to ocean (W/m^2)
l_fswthru_idr , & ! nir dir SW through ice to ocean (W/m^2)
l_fswthru_idf ! nir dif SW through ice to ocean (W/m^2)

real (kind=dbl_kind), dimension(:), allocatable :: &
l_fswthrun_vdr , & ! vis dir SW through ice to ocean (W/m^2)
l_fswthrun_vdf , & ! vis dif SW through ice to ocean (W/m^2)
l_fswthrun_idr , & ! nir dir SW through ice to ocean (W/m^2)
l_fswthrun_idf ! nir dif SW through ice to ocean (W/m^2)

real (kind=dbl_kind) :: &
pond ! water retained in ponds (m)

Expand Down Expand Up @@ -2383,6 +2417,35 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
l_H2_18O_ocn = c0
if (present(H2_18O_ocn)) l_H2_18O_ocn = H2_18O_ocn

l_fswthru_vdr = c0
if (present(fswthru_vdr) ) l_fswthru_vdr = fswthru_vdr

l_fswthru_vdf = c0
if (present(fswthru_vdf) ) l_fswthru_vdf = fswthru_vdf

l_fswthru_idr = c0
if (present(fswthru_idr) ) l_fswthru_idr = fswthru_idr

l_fswthru_idf = c0
if (present(fswthru_idf) ) l_fswthru_idf = fswthru_idf

allocate(l_fswthrun_vdr(ncat))
allocate(l_fswthrun_vdf(ncat))
allocate(l_fswthrun_idr(ncat))
allocate(l_fswthrun_idf(ncat))

l_fswthrun_vdr = c0
if (present(fswthrun_vdr) ) l_fswthrun_vdr = fswthrun_vdr

l_fswthrun_vdf = c0
if (present(fswthrun_vdf) ) l_fswthrun_vdf = fswthrun_vdf

l_fswthrun_idr = c0
if (present(fswthrun_idr) ) l_fswthrun_idr = fswthrun_idr

l_fswthrun_idf = c0
if (present(fswthrun_idf) ) l_fswthrun_idf = fswthrun_idf

!-----------------------------------------------------------------
! Adjust frzmlt to account for ice-ocean heat fluxes since last
! call to coupler.
Expand Down Expand Up @@ -2678,36 +2741,46 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
!-----------------------------------------------------------------

if (aicen_init(n) > puny) &
call merge_fluxes (aicen_init(n), &
flw, &
strairxn, strairyn, &
Cdn_atm_ratio_n, &
fsurfn(n), fcondtopn(n), &
fcondbotn(n), &
fsensn(n), flatn(n), &
fswabsn, flwoutn, &
evapn, &
evapsn, evapin, &
Trefn, Qrefn, &
freshn, fsaltn, &
fhocnn, fswthrun(n), &
strairxT, strairyT, &
Cdn_atm_ratio, &
fsurf, fcondtop, &
fcondbot, &
fsens, flat, &
fswabs, flwout, &
evap, &
evaps, evapi, &
Tref, Qref, &
fresh, fsalt, &
fhocn, fswthru, &
melttn (n), meltsn(n), &
meltbn (n), congeln(n), &
snoicen(n), &
meltt, melts, &
meltb, congel, &
snoice, &
call merge_fluxes (aicen=aicen_init(n), &
flw=flw, &
strairxn=strairxn, strairyn=strairyn,&
Cdn_atm_ratio_n=Cdn_atm_ratio_n, &
fsurfn=fsurfn(n), fcondtopn=fcondtopn(n),&
fcondbotn=fcondbotn(n), &
fsensn=fsensn(n), flatn=flatn(n), &
fswabsn=fswabsn, flwoutn=flwoutn, &
evapn=evapn, &
evapsn=evapsn, evapin=evapin, &
Trefn=Trefn, Qrefn=Qrefn, &
freshn=freshn, fsaltn=fsaltn, &
fhocnn=fhocnn, &
fswthrun=fswthrun(n), &
fswthrun_vdr=l_fswthrun_vdr(n), &
fswthrun_vdf=l_fswthrun_vdf(n), &
fswthrun_idr=l_fswthrun_idr(n), &
fswthrun_idf=l_fswthrun_idf(n), &
strairxT=strairxT, strairyT=strairyT,&
Cdn_atm_ratio=Cdn_atm_ratio, &
fsurf=fsurf, fcondtop=fcondtop,&
fcondbot=fcondbot, &
fsens=fsens, flat=flat, &
fswabs=fswabs, flwout=flwout, &
evap=evap, &
evaps=evaps, evapi=evapi, &
Tref=Tref, Qref=Qref, &
fresh=fresh, fsalt=fsalt, &
fhocn=fhocn, &
fswthru=fswthru, &
fswthru_vdr=l_fswthru_vdr, &
fswthru_vdf=l_fswthru_vdf, &
fswthru_idr=l_fswthru_idr, &
fswthru_idf=l_fswthru_idf, &
melttn=melttn (n), meltsn=meltsn(n), &
meltbn=meltbn (n), congeln=congeln(n),&
snoicen=snoicen(n), &
meltt=meltt, melts=melts, &
meltb=meltb, congel=congel, &
snoice=snoice, &
Uref=Uref, Urefn=Urefn, &
Qref_iso=l_Qref_iso, &
Qrefn_iso=Qrefn_iso, &
Expand All @@ -2727,13 +2800,25 @@ subroutine icepack_step_therm1(dt, ncat, nilyr, nslyr, &
if (present(fiso_atm) ) fiso_atm = l_fiso_atm
if (present(fiso_ocn) ) fiso_ocn = l_fiso_ocn
if (present(fiso_evap)) fiso_evap= l_fiso_evap
if (present(fswthrun_vdr)) fswthrun_vdr= l_fswthrun_vdr
if (present(fswthrun_vdf)) fswthrun_vdf= l_fswthrun_vdf
if (present(fswthrun_idr)) fswthrun_idr= l_fswthrun_idr
if (present(fswthrun_idf)) fswthrun_idf= l_fswthrun_idf
if (present(fswthru_vdr)) fswthru_vdr= l_fswthru_vdr
if (present(fswthru_vdf)) fswthru_vdf= l_fswthru_vdf
if (present(fswthru_idr)) fswthru_idr= l_fswthru_idr
if (present(fswthru_idf)) fswthru_idf= l_fswthru_idf
deallocate(l_isosno)
deallocate(l_isoice)
deallocate(l_Qa_iso)
deallocate(l_Qref_iso)
deallocate(l_fiso_atm)
deallocate(l_fiso_ocn)
deallocate(l_fiso_evap)
deallocate(l_fswthrun_vdr)
deallocate(l_fswthrun_vdf)
deallocate(l_fswthrun_idr)
deallocate(l_fswthrun_idf)

!-----------------------------------------------------------------
! Calculate ponds from the topographic scheme
Expand Down
4 changes: 4 additions & 0 deletions configuration/driver/icedrv_arrays_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ module icedrv_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, & ! dir 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 (nx,nilyr+1,ncat), &
Expand Down
14 changes: 13 additions & 1 deletion configuration/driver/icedrv_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ module icedrv_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 @@ -538,6 +542,10 @@ subroutine init_coupler_flux
fsalt (:) = c0
fhocn (:) = c0
fswthru (:) = c0
fswthru_vdr (:) = c0
fswthru_vdf (:) = c0
fswthru_idr (:) = c0
fswthru_idf (:) = c0
flux_bio(:,:) = c0 ! bgc
fnit (:) = c0
fsil (:) = c0
Expand Down Expand Up @@ -602,6 +610,10 @@ subroutine init_flux_atm_ocn
fsalt (:) = c0
fhocn (:) = c0
fswthru (:) = c0
fswthru_vdr (:) = c0
fswthru_vdf (:) = c0
fswthru_idr (:) = c0
fswthru_idf (:) = c0
fiso_ocn (:,:) = c0
faero_ocn(:,:) = c0

Expand Down
14 changes: 12 additions & 2 deletions configuration/driver/icedrv_init_column.F90
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ subroutine init_shortwave

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

enddo
Expand Down Expand Up @@ -260,7 +265,12 @@ subroutine init_shortwave
alvdrn=alvdrn(i,:), alvdfn=alvdfn(i,:), &
alidrn=alidrn(i,:), alidfn=alidfn(i,:), &
fswsfcn=fswsfcn(i,:), fswintn=fswintn(i,:), &
fswthrun=fswthrun(i,:), fswpenln=fswpenln(i,:,:), &
fswthrun=fswthrun(i,:), &
fswthrun_vdr=fswthrun_vdr(i,:), &
fswthrun_vdf=fswthrun_vdf(i,:), &
fswthrun_idr=fswthrun_idr(i,:), &
fswthrun_idf=fswthrun_idf(i,:), &
fswpenln=fswpenln(i,:,:), &
Sswabsn=Sswabsn(i,:,:), Iswabsn=Iswabsn(i,:,:), &
albicen=albicen(i,:), albsnon=albsnon(i,:), &
albpndn=albpndn(i,:), apeffn=apeffn(i,:), &
Expand Down
Loading