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

Snicar-ad port to Icepack from MPAS-SI #7

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
604d0ad
initial implementation of SNICAR-AD in Icepack, not tested but BFB in…
eclare108213 Aug 4, 2022
60fc58d
adding use_snicar flag (true if shortwave=dEdd_snicar)
eclare108213 Aug 4, 2022
e264065
initializing use_snicar based on shortwave namelist value
eclare108213 Aug 4, 2022
8109ebf
adding a few more arguments to the calling tree
eclare108213 Aug 5, 2022
49d1294
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Aug 22, 2022
3c65376
remove repeat ridging warnings for niter=1
eclare108213 Aug 22, 2022
2bd3504
use 5-band wghtns for snicar
eclare108213 Aug 22, 2022
56a2ccd
basic initialization for snicar tables
eclare108213 Aug 23, 2022
d2f3870
clean up trailing blanks
apcraig Aug 24, 2022
f03e228
Merge pull request #4 from apcraig/snicar-clean01
eclare108213 Aug 24, 2022
cd31ec2
interim commit with some snicar initialization, unconnected and not t…
eclare108213 Aug 25, 2022
a2bbd1d
Add data_dEdd_3band to icepack_init_radiation
apcraig Aug 24, 2022
d2ea5ed
Add ability to set SNICAR SSP data via icepack_parameters
apcraig Aug 24, 2022
4bf19c6
Add reading of SNICAR SSP file in Icepack driver including
apcraig Aug 25, 2022
8cb547a
rebase, update, and test
apcraig Aug 25, 2022
258f623
Merge pull request #5 from apcraig/snwtable
eclare108213 Aug 25, 2022
4e2d90b
Update ssp output
apcraig Aug 25, 2022
e569c4c
Reorder SNICAR SSP test data arrays to be consistent with source code
apcraig Aug 26, 2022
1d6eaa6
Merge pull request #6 from apcraig/sspoutput
eclare108213 Aug 26, 2022
f88b03c
move 5band data to subroutine; enable snicar testing on 1 no-ice grid…
eclare108213 Aug 26, 2022
6d68ee9
move more data to 3- and 5-band initialization routines, use module d…
eclare108213 Aug 26, 2022
b3ca79c
change snicar coefficient names and use module data for them
eclare108213 Aug 26, 2022
8ad73dd
cleaning up argument lists
eclare108213 Aug 26, 2022
89e0d9a
Add additional SNICAR SSP fields
apcraig Aug 27, 2022
93f9f3c
Merge pull request #7 from apcraig/moresspio
eclare108213 Aug 29, 2022
ef37585
set tmask=0 only for land cell
eclare108213 Aug 31, 2022
3e636b2
interim compute_dEdd_5bd subroutine (runs)
eclare108213 Sep 1, 2022
914130b
separate 3-band and 5-band compute_dEdd routines
eclare108213 Sep 1, 2022
0fabd24
Fix errors in calls to compute_dEdd. Some cleanup.
eclare108213 Sep 1, 2022
20d7e03
Remove duplicate Iabs calculation. More cleanup.
eclare108213 Sep 1, 2022
fe21d1f
- Add icepack_shortwave_data
apcraig Sep 1, 2022
a0f0e49
- Add USE_SNICARHC (snicar ssp hard coded tables) to reduce compile time
apcraig Sep 2, 2022
247a8ce
- Remove ssp_bcerad, ssp_bcgrerad from implementation
apcraig Sep 2, 2022
147201a
remove trailing blanks
apcraig Sep 2, 2022
2274b8e
Merge pull request #9 from apcraig/swdata
eclare108213 Sep 6, 2022
f270c73
Cleanup icepack_shortwave_data
apcraig Sep 6, 2022
631816e
update test suite and icepack_in
apcraig Sep 6, 2022
1395476
update scripts if md5sum not available
apcraig Sep 6, 2022
9766cff
Merge pull request #10 from apcraig/swdata1
eclare108213 Sep 6, 2022
0a9d6e7
Clean up shortwave data variable names
apcraig Sep 7, 2022
8f74768
Merge pull request #11 from apcraig/swaero
eclare108213 Sep 7, 2022
045e353
Clean up icepack_shortwave
apcraig Sep 7, 2022
69ed788
- Remove ncat, nilyr, nslyr, nblyr from interface arguments
apcraig Sep 8, 2022
6a46237
Merge pull request #12 from apcraig/swclean
eclare108213 Sep 8, 2022
44d377b
Update implementation of g(k), w0(k) in icepack_shortwave
apcraig Sep 11, 2022
6f8f21b
Get rid of use_snicar flag, redundant with shortwave setting
apcraig Sep 12, 2022
4256d9b
update documentation
eclare108213 Sep 18, 2022
34e5555
updating documentation
eclare108213 Sep 18, 2022
95fb567
use module data rather than hardcoded rhoi
eclare108213 Sep 18, 2022
9178ede
cleanup
apcraig Sep 18, 2022
e0b3292
update namelist and settings documentation
eclare108213 Sep 18, 2022
ee97eab
Merge pull request #13 from apcraig/aerclean
eclare108213 Sep 18, 2022
1a089e8
make icepack_warnings_getall public, snw_ssp_table=unknown, update us…
eclare108213 Sep 23, 2022
b7d7c16
add icepack_warnings_getall to interface module
eclare108213 Sep 23, 2022
64ab4a1
Major cleanup of dEdd module, mainly white space and standard alignme…
eclare108213 Sep 24, 2022
9ae618c
bug fixes for ice/snow layer reciprocal, missing lines as in consorti…
eclare108213 Sep 24, 2022
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
Prev Previous commit
Next Next commit
Add ability to set SNICAR SSP data via icepack_parameters
Add some SNICAR SSP table checks, aborts, etc
  • Loading branch information
apcraig committed Aug 25, 2022
commit d2ea5ed8f9422984f9c4b6d45a11a9e029b3c13f
120 changes: 110 additions & 10 deletions columnphysics/icepack_parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@ module icepack_parameters
character (len=char_len), public :: &
snw_ssp_table = 'test' ! lookup table: 'snicar' or 'test' or 'file'

integer (kind=int_kind), public :: &
nsnw_radius ! maximum snow radius index

real (kind=dbl_kind), allocatable, public :: &
ssp_snwextdr(:,:), & ! snow mass extinction cross section (m2/kg), direct
ssp_snwextdf(:,:), & ! snow mass extinction cross section (m2/kg), diffuse
Expand Down Expand Up @@ -506,7 +503,10 @@ subroutine icepack_init_parameters( &
snwlvlfac_in, isnw_T_in, isnw_Tgrd_in, isnw_rhos_in, &
snowage_rhos_in, snowage_Tgrd_in, snowage_T_in, &
snowage_tau_in, snowage_kappa_in, snowage_drdt0_in, &
snw_aging_table_in)
snw_aging_table_in, snw_ssp_table_in, &
ssp_snwextdr_in, ssp_snwextdf_in, &
ssp_snwalbdr_in, ssp_snwalbdf_in, &
ssp_sasymmdr_in, ssp_sasymmdf_in )

!-----------------------------------------------------------------
! control settings
Expand Down Expand Up @@ -860,8 +860,25 @@ subroutine icepack_init_parameters( &
snowage_kappa_in, &!
snowage_drdt0_in ! (10^-6 m/hr)

! Parameters for dEdd_snicar
character (len=char_len), intent(in), optional :: &
snw_ssp_table_in ! lookup table: 'snicar' or 'test' or 'file'

real (kind=dbl_kind), dimension(:,:), intent(in), optional :: &
ssp_snwextdr_in, & ! snow mass extinction cross section (m2/kg), direct
ssp_snwextdf_in, & ! snow mass extinction cross section (m2/kg), diffuse
ssp_snwalbdr_in, & ! snow single scatter albedo (fraction), direct
ssp_snwalbdf_in, & ! snow single scatter albedo (fraction), diffuse
ssp_sasymmdr_in, & ! snow asymmetry factor (cos(theta)), direct
ssp_sasymmdf_in ! snow asymmetry factor (cos(theta)), diffuse

!autodocument_end

! local data

integer (kind=int_kind) :: &
dim1, dim2 ! array dimension sizes

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

if (present(argcheck_in) ) argcheck = argcheck_in
Expand Down Expand Up @@ -997,6 +1014,10 @@ subroutine icepack_init_parameters( &
if (present(windmin_in) ) windmin = windmin_in
if (present(drhosdwind_in) ) drhosdwind = drhosdwind_in
if (present(snwlvlfac_in) ) snwlvlfac = snwlvlfac_in

!-------------------
! SNOW table
!-------------------
if (present(isnw_T_in) ) isnw_T = isnw_T_in
if (present(isnw_Tgrd_in) ) isnw_Tgrd = isnw_Tgrd_in
if (present(isnw_rhos_in) ) isnw_rhos = isnw_rhos_in
Expand All @@ -1018,7 +1039,6 @@ subroutine icepack_init_parameters( &
endif
endif

! check array sizes and re/allocate if necessary
if (present(snowage_Tgrd_in) ) then
if (size(snowage_Tgrd_in) /= isnw_Tgrd) then
call icepack_warnings_add(subname//' incorrect size of snowage_Tgrd_in')
Expand All @@ -1035,7 +1055,6 @@ subroutine icepack_init_parameters( &
endif
endif

! check array sizes and re/allocate if necessary
if (present(snowage_T_in) ) then
if (size(snowage_T_in) /= isnw_T) then
call icepack_warnings_add(subname//' incorrect size of snowage_T_in')
Expand All @@ -1052,7 +1071,6 @@ subroutine icepack_init_parameters( &
endif
endif

! check array sizes and re/allocate if necessary
if (present(snowage_tau_in) ) then
if (size(snowage_tau_in) /= isnw_T*isnw_Tgrd*isnw_rhos) then
call icepack_warnings_add(subname//' incorrect size of snowage_tau_in')
Expand All @@ -1069,7 +1087,6 @@ subroutine icepack_init_parameters( &
endif
endif

! check array sizes and re/allocate if necessary
if (present(snowage_kappa_in) ) then
if (size(snowage_kappa_in) /= isnw_T*isnw_Tgrd*isnw_rhos) then
call icepack_warnings_add(subname//' incorrect size of snowage_kappa_in')
Expand All @@ -1086,7 +1103,6 @@ subroutine icepack_init_parameters( &
endif
endif

! check array sizes and re/allocate if necessary
if (present(snowage_drdt0_in) ) then
if (size(snowage_drdt0_in) /= isnw_T*isnw_Tgrd*isnw_rhos) then
call icepack_warnings_add(subname//' incorrect size of snowage_drdt0_in')
Expand All @@ -1103,6 +1119,60 @@ subroutine icepack_init_parameters( &
endif
endif

!-------------------
! SNICAR SSP table
!-------------------
if (present(snw_ssp_table_in) ) snw_ssp_table = snw_ssp_table_in

! allocate and copy SNICAR SSP table data
if (present(ssp_snwextdr_in) ) then
if (allocated(ssp_snwextdr)) deallocate(ssp_snwextdr)
dim1 = size(ssp_snwextdr_in,dim=1)
dim2 = size(ssp_snwextdr_in,dim=2)
allocate(ssp_snwextdr(dim1,dim2))
ssp_snwextdr = ssp_snwextdr_in
endif

if (present(ssp_snwextdf_in) ) then
if (allocated(ssp_snwextdf)) deallocate(ssp_snwextdf)
dim1 = size(ssp_snwextdf_in,dim=1)
dim2 = size(ssp_snwextdf_in,dim=2)
allocate(ssp_snwextdf(dim1,dim2))
ssp_snwextdf = ssp_snwextdf_in
endif

if (present(ssp_snwalbdr_in) ) then
if (allocated(ssp_snwalbdr)) deallocate(ssp_snwalbdr)
dim1 = size(ssp_snwalbdr_in,dim=1)
dim2 = size(ssp_snwalbdr_in,dim=2)
allocate(ssp_snwalbdr(dim1,dim2))
ssp_snwalbdr = ssp_snwalbdr_in
endif

if (present(ssp_snwalbdf_in) ) then
if (allocated(ssp_snwalbdf)) deallocate(ssp_snwalbdf)
dim1 = size(ssp_snwalbdf_in,dim=1)
dim2 = size(ssp_snwalbdf_in,dim=2)
allocate(ssp_snwalbdf(dim1,dim2))
ssp_snwalbdf = ssp_snwalbdf_in
endif

if (present(ssp_sasymmdr_in) ) then
if (allocated(ssp_sasymmdr)) deallocate(ssp_sasymmdr)
dim1 = size(ssp_sasymmdr_in,dim=1)
dim2 = size(ssp_sasymmdr_in,dim=2)
allocate(ssp_sasymmdr(dim1,dim2))
ssp_sasymmdr = ssp_sasymmdr_in
endif

if (present(ssp_sasymmdf_in) ) then
if (allocated(ssp_sasymmdf)) deallocate(ssp_sasymmdf)
dim1 = size(ssp_sasymmdf_in,dim=1)
dim2 = size(ssp_sasymmdf_in,dim=2)
allocate(ssp_sasymmdf(dim1,dim2))
ssp_sasymmdf = ssp_sasymmdf_in
endif

if (present(bgc_flux_type_in) ) bgc_flux_type = bgc_flux_type_in
if (present(z_tracers_in) ) z_tracers = z_tracers_in
if (present(scale_bgc_in) ) scale_bgc = scale_bgc_in
Expand Down Expand Up @@ -1215,7 +1285,10 @@ subroutine icepack_query_parameters( &
snwlvlfac_out, isnw_T_out, isnw_Tgrd_out, isnw_rhos_out, &
snowage_rhos_out, snowage_Tgrd_out, snowage_T_out, &
snowage_tau_out, snowage_kappa_out, snowage_drdt0_out, &
snw_aging_table_out)
snw_aging_table_out, snw_ssp_table_out, &
ssp_snwextdr_out, ssp_snwextdf_out, &
ssp_snwalbdr_out, ssp_snwalbdf_out, &
ssp_sasymmdr_out, ssp_sasymmdf_out )

!-----------------------------------------------------------------
! control settings
Expand Down Expand Up @@ -1577,6 +1650,19 @@ subroutine icepack_query_parameters( &
snowage_tau_out, & ! (10^-6 m)
snowage_kappa_out, &!
snowage_drdt0_out ! (10^-6 m/hr)

! Parameters for dEdd_snicar
character (len=char_len), intent(out), optional :: &
snw_ssp_table_out ! lookup table: 'snicar' or 'test' or 'file'

real (kind=dbl_kind), dimension(:,:), intent(out), optional :: &
ssp_snwextdr_out, & ! snow mass extinction cross section (m2/kg), direct
ssp_snwextdf_out, & ! snow mass extinction cross section (m2/kg), diffuse
ssp_snwalbdr_out, & ! snow single scatter albedo (fraction), direct
ssp_snwalbdf_out, & ! snow single scatter albedo (fraction), diffuse
ssp_sasymmdr_out, & ! snow asymmetry factor (cos(theta)), direct
ssp_sasymmdf_out ! snow asymmetry factor (cos(theta)), diffuse

!autodocument_end

character(len=*),parameter :: subname='(icepack_query_parameters)'
Expand Down Expand Up @@ -1760,6 +1846,13 @@ subroutine icepack_query_parameters( &
if (present(snowage_tau_out) ) snowage_tau_out = snowage_tau
if (present(snowage_kappa_out) ) snowage_kappa_out= snowage_kappa
if (present(snowage_drdt0_out) ) snowage_drdt0_out= snowage_drdt0
if (present(snw_ssp_table_out) ) snw_ssp_table_out= snw_ssp_table
if (present(ssp_snwextdr_out) ) ssp_snwextdr_out = ssp_snwextdr
if (present(ssp_snwextdf_out) ) ssp_snwextdf_out = ssp_snwextdf
if (present(ssp_snwalbdr_out) ) ssp_snwalbdr_out = ssp_snwalbdr
if (present(ssp_snwalbdf_out) ) ssp_snwalbdf_out = ssp_snwalbdf
if (present(ssp_sasymmdr_out) ) ssp_sasymmdr_out = ssp_sasymmdr
if (present(ssp_sasymmdf_out) ) ssp_sasymmdf_out = ssp_sasymmdf
if (present(bgc_flux_type_out) ) bgc_flux_type_out= bgc_flux_type
if (present(z_tracers_out) ) z_tracers_out = z_tracers
if (present(scale_bgc_out) ) scale_bgc_out = scale_bgc
Expand Down Expand Up @@ -1970,6 +2063,13 @@ subroutine icepack_write_parameters(iounit)
write(iounit,*) " snowage_tau = ", snowage_tau(1,1,1)
write(iounit,*) " snowage_kappa = ", snowage_kappa(1,1,1)
write(iounit,*) " snowage_drdt0 = ", snowage_drdt0(1,1,1)
write(iounit,*) " snw_ssp_table = ", trim(snw_ssp_table)
write(iounit,*) " ssp_snwextdr = ", ssp_snwextdr(1,1)
write(iounit,*) " ssp_snwextdf = ", ssp_snwextdf(1,1)
write(iounit,*) " ssp_snwalbdr = ", ssp_snwalbdr(1,1)
write(iounit,*) " ssp_snwalbdf = ", ssp_snwalbdf(1,1)
write(iounit,*) " ssp_sasymmdr = ", ssp_sasymmdr(1,1)
write(iounit,*) " ssp_sasymmdf = ", ssp_sasymmdf(1,1)
write(iounit,*) " bgc_flux_type = ", bgc_flux_type
write(iounit,*) " z_tracers = ", z_tracers
write(iounit,*) " scale_bgc = ", scale_bgc
Expand Down
Loading