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

BGC update #497

Merged
merged 169 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
169 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
4ff4e28
Merge pull request #5 from CICE-Consortium/main
eclare108213 Aug 17, 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
8aef3f7
Merge pull request #7 from eclare108213/snicar
eclare108213 Sep 30, 2022
20d4a94
mpassi options files
eclare108213 Oct 6, 2022
6704225
remove namelist entries that are the same as the defaults to avoid po…
eclare108213 Oct 6, 2022
d86c54e
Merge pull request #8 from eclare108213/testconfig1
apcraig Oct 7, 2022
90dbfe6
Minor updates consistent with E3SM columnphysics modifications
apcraig Oct 8, 2022
5efe8b7
Update spacing and documentation
apcraig Oct 8, 2022
6b7b63a
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Oct 8, 2022
86d414c
First step in adding Tf
dabail10 Oct 7, 2022
ef314e2
Fix some spacing and logic
dabail10 Oct 7, 2022
1b84132
Fix some documentation
dabail10 Oct 7, 2022
cf64956
Fix documentation formatting
dabail10 Oct 10, 2022
19d61e6
Merge pull request #12 from dabail10/tfrz2
apcraig Oct 11, 2022
125b40b
Merge pull request #10 from apcraig/e3smfix1
apcraig Oct 11, 2022
635f1c4
Merge branch 'cice-consortium/E3SM-icepack-initial-integration' into …
apcraig Oct 11, 2022
881db9a
Merge pull request #11 from apcraig/upd01a
apcraig Oct 11, 2022
1c502fa
namelist parameter to set maximum liquidus temperature
eclare108213 Oct 24, 2022
7cdacdb
Merge branch 'cice-consortium/E3SM-icepack-initial-integration' into …
eclare108213 Oct 24, 2022
93ada33
Merge pull request #13 from E3SM-Project/Tliquidus_limit
eclare108213 Oct 24, 2022
e4d987e
Modifications for bit-for-bit with current main in CICE
apcraig Oct 25, 2022
6a4533b
Merge pull request #14 from apcraig/Tffix
eclare108213 Oct 25, 2022
1429164
update aerosol code for vertical bgc
eclare108213 Nov 11, 2022
5a12967
add init/query/write for hs_ssl_min
eclare108213 Nov 11, 2022
6211458
merge Icepack main to #5bf584f6b7f Nov 17, 2022
apcraig Nov 18, 2022
5a1b9e3
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 18, 2022
64a27d3
Remove redundancy in public declaration
apcraig Nov 18, 2022
8944646
recover main bit-for-bit
apcraig Nov 18, 2022
ae5a4ef
update tfrz_option
apcraig Nov 19, 2022
0899390
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 20, 2022
4d131da
Merge pull request #16 from apcraig/e3smup1
apcraig Nov 21, 2022
bec84e4
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 29, 2022
941e3c5
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Nov 30, 2022
9d08355
Merge pull request #17 from apcraig/snowbrinebugs
eclare108213 Nov 30, 2022
8be0af0
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Dec 15, 2022
a9fc4fa
Merge pull request #18 from apcraig/e3sm_upd133
eclare108213 Dec 15, 2022
c9abc27
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Jan 25, 2023
ef7491f
Merge pull request #19 from apcraig/e3smicep230125
eclare108213 Jan 25, 2023
47e1791
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Feb 2, 2023
87db73b
Merge pull request #20 from apcraig/icep230202
apcraig Feb 3, 2023
7d42edb
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Mar 20, 2023
5f4cd19
Merge pull request #21 from apcraig/icep230317
eclare108213 Mar 24, 2023
dd24d9f
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Apr 14, 2023
6ca316f
Merge pull request #22 from E3SM-Project/ibranch3
eclare108213 Apr 14, 2023
e5a95e4
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Apr 18, 2023
e3e36a7
Merge pull request #23 from apcraig/icep230418
eclare108213 Apr 21, 2023
c0719d8
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig May 24, 2023
2fc81b4
Merge pull request #24 from apcraig/icep230524
eclare108213 May 26, 2023
dfb8e2c
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
eclare108213 Jul 6, 2023
b2b8066
Merge pull request #25 from E3SM-Project/ibranch4
eclare108213 Jul 7, 2023
d3b0ecc
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Jul 18, 2023
e8e7d7d
Merge pull request #26 from apcraig/main230718
eclare108213 Jul 19, 2023
a5804b0
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Aug 19, 2023
dd48a38
clean up merge
apcraig Aug 20, 2023
e751022
Merge pull request #27 from apcraig/main230819
eclare108213 Aug 21, 2023
5789cb5
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Aug 30, 2023
393b072
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Sep 14, 2023
586b5e5
Merge pull request #28 from apcraig/e3sm230830
eclare108213 Sep 14, 2023
cb0d946
Merge pull request #29 from apcraig/e3sm230914
eclare108213 Sep 14, 2023
b7b68b9
Merge remote-tracking branch 'remotes/eclare/aero1' into current inte…
njeffery Sep 20, 2023
baaa3f4
bring some mushy functions into icepack interface
eclare108213 Sep 25, 2023
1f0b307
elevate snow/mush enthalpy and salinity profile to interface
eclare108213 Sep 25, 2023
78286bf
Merge pull request #31 from E3SM-Project/E3SMrefactor
eclare108213 Sep 26, 2023
636fcbf
Update documentation
apcraig Sep 27, 2023
adcf436
Update documentation
apcraig Sep 28, 2023
e33cc75
Merge pull request #32 from apcraig/e3smdocs1
eclare108213 Sep 29, 2023
6a64845
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Sep 30, 2023
96f2fc7
Merge pull request #33 from apcraig/upd230930
eclare108213 Sep 30, 2023
c1edf6d
Adds changes to Icepack for bgc and zaerosols
njeffery Oct 11, 2023
f4550c1
Merge remote-tracking branch 'origin/njeffery/update-zaerosols-icepac…
njeffery Oct 11, 2023
ddf6e6f
Merge branch 'njeffery/merge-bgc' of https://github.com/njeffery/icep…
apcraig Oct 25, 2023
37a6f97
Remove deprecated field from zbgc
njeffery Oct 31, 2023
1b6bd93
Updates icepack zbgc initialization for optional arguments
njeffery Nov 16, 2023
abdd3d4
Correct initialization of DIC sources and sinks
njeffery Dec 11, 2023
b1e15e9
Fixes to conserve carbon in icepack
njeffery Mar 12, 2024
8934f44
Bug fix in step therm2 for BGC
njeffery Mar 25, 2024
c090b4b
Fix to icepack warning strings
njeffery Mar 28, 2024
c1099ac
Update icepack for new bgc
apcraig Apr 18, 2024
d747f23
Move bgc tracer index initialization to driver, implemented with temp…
apcraig Apr 22, 2024
c03e8ef
Split init_zbgc into three calls
njeffery May 6, 2024
ba46d23
Added flag to remove write statements
njeffery May 6, 2024
03ba5ab
fixes a debug compile seg fault in bgc
njeffery May 6, 2024
3a759e2
Adds icepack parameter use_atm_dust_iron
njeffery May 23, 2024
bc3fcff
Removes indexing of bgc tracers
njeffery May 27, 2024
ecd2550
Clean up icepack_intfc
njeffery May 29, 2024
2e5d5a2
Clean up init_zbgc
njeffery May 29, 2024
845b585
Initial modifications for standalone Icepack bgc capability
apcraig Jun 4, 2024
f459b0c
Add definitions for missing zbgc parameter arrays
njeffery Jun 10, 2024
c63f9e5
Merge 'acraig/fix_tc10' into njeffery/fixes-to-bgc
njeffery Jun 12, 2024
6ca4c6b
Remove redundant Icepack interface arguments set in parameters and tr…
apcraig Jun 17, 2024
b3aa664
Migrate bgrid, cgrid, igrid, icgrid, swgrid to Icepack variables,
apcraig Jun 17, 2024
31ce422
Update icepack_warnings to make it more thread safe
apcraig Jun 20, 2024
b9514dc
Merge branch 'njeffery/fixes-to-bgc' of https://github.com/e3sm-proje…
apcraig Jul 25, 2024
eab632b
Update bgc setup in driver and namelist
apcraig Aug 1, 2024
6b756b5
Merge branch 'main' of https://github.com/cice-consortium/icepack int…
apcraig Aug 15, 2024
b4f5c66
Update bgc namelist, revert some coupled settings
apcraig Aug 15, 2024
3a8b2f9
Merge branch 'bgcpr1' of https://github.com/apcraig/icepack into bgcpr1
apcraig Aug 15, 2024
a1cae32
Deprecate skl BGC option without removing skl code yet
apcraig Aug 26, 2024
446ce00
Update BGC namelist defaults and documentation
apcraig Aug 28, 2024
996ba39
Update flush implementation, fix unit number bug and check that
apcraig Aug 28, 2024
7abc335
Updates to icepack bgc documentation
njeffery Sep 9, 2024
81cdd98
Merge pull request #1 from njeffery/update-bgc-doc
apcraig Sep 10, 2024
a72c11d
Corrections to bgc documentation
njeffery Sep 10, 2024
88cc351
Merge pull request #2 from njeffery/update-bgc-doc
apcraig Sep 10, 2024
763bef2
Updates bgc case settings documentation
njeffery Sep 11, 2024
894e289
Removed redundancy in bgc documentation
njeffery Sep 11, 2024
6ad5b0d
Corrected removal of redundancy
njeffery Sep 11, 2024
492cb27
Removed extra space.
njeffery Sep 11, 2024
43c81a0
Merge pull request #4 from njeffery/bgcpr1-nj
apcraig Sep 11, 2024
9971d2d
Merge branch 'bgcpr1' of https://github.com/apcraig/icepack into bgcpr1
apcraig Sep 11, 2024
e06d076
update documentation and update 3 bgc parameter defaults
apcraig Sep 12, 2024
af708e1
Add zaero tests
apcraig Sep 13, 2024
4ae7b62
Update Documentation
apcraig Sep 13, 2024
4046323
Update zaero test, using nblyr=7. Fixes conservation errors in zaero…
apcraig Sep 13, 2024
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
243 changes: 151 additions & 92 deletions columnphysics/icepack_aerosol.F90

Large diffs are not rendered by default.

1,065 changes: 674 additions & 391 deletions columnphysics/icepack_algae.F90

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions columnphysics/icepack_atmo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module icepack_atmo
use icepack_parameters, only: pih, dragio, rhoi, rhos, rhow
use icepack_parameters, only: atmbndy, calc_strair, formdrag
use icepack_parameters, only: icepack_chkoptargflag
use icepack_tracers, only: n_iso
use icepack_tracers, only: ncat, n_iso
use icepack_tracers, only: tr_iso
use icepack_warnings, only: warnstr, icepack_warnings_add
use icepack_warnings, only: icepack_warnings_setabort, icepack_warnings_aborted
Expand Down Expand Up @@ -521,13 +521,10 @@ subroutine neutral_drag_coeffs (apnd, hpnd, &
hdraft, hridge, &
distrdg, hkeel, &
dkeel, lfloe, &
dfloe, ncat)
dfloe)

use icepack_tracers, only: tr_pond

integer (kind=int_kind), intent(in) :: &
ncat

real (kind=dbl_kind), dimension (:), intent(in) :: &
apnd ,& ! melt pond fraction of sea ice
hpnd ,& ! mean melt pond depth over sea ice
Expand Down
211 changes: 90 additions & 121 deletions columnphysics/icepack_brine.F90

Large diffs are not rendered by default.

134 changes: 78 additions & 56 deletions columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ subroutine merge_fluxes (aicen, &

! single category fluxes
real (kind=dbl_kind), intent(in) :: &
aicen , & ! concentration of ice
aicen ! concentration of ice

real (kind=dbl_kind), optional, intent(in) :: &
flw , & ! downward longwave flux (W/m**2)
strairxn, & ! air/ice zonal strss, (N/m**2)
strairyn, & ! air/ice merdnl strss, (N/m**2)
Expand All @@ -95,17 +97,15 @@ subroutine merge_fluxes (aicen, &
meltsliqn,& ! mass of snow melt (kg/m^2)
dsnown , & ! change in snow depth (m)
congeln , & ! congelation ice growth (m)
snoicen ! snow-ice growth (m)

real (kind=dbl_kind), optional, intent(in):: &
snoicen , & ! snow-ice growth (m)
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)
Urefn ! air speed reference level (m/s)

! cumulative fluxes
real (kind=dbl_kind), intent(inout) :: &
real (kind=dbl_kind), optional, intent(inout) :: &
strairxT, & ! air/ice zonal strss, (N/m**2)
strairyT, & ! air/ice merdnl strss, (N/m**2)
Cdn_atm_ratio, & ! ratio of total drag over neutral drag
Expand All @@ -130,28 +130,24 @@ subroutine merge_fluxes (aicen, &
melts , & ! snow melt (m)
meltsliq, & ! mass of snow melt (kg/m^2)
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), intent(inout), optional :: &
snoice , & ! snow-ice growth (m)
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)
dsnow, & ! change in snow depth (m)
Uref ! air speed reference level (m/s)

real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
Qref_iso, & ! isotope air sp hum ref level (kg/kg)
fiso_ocn, & ! isotope fluxes to ocean (kg/m2/s)
fiso_evap ! isotope evaporation (kg/m2/s)

real (kind=dbl_kind), dimension(:), intent(in), optional :: &
Qrefn_iso, & ! isotope air sp hum ref level (kg/kg)
fiso_ocnn, & ! isotope fluxes to ocean (kg/m2/s)
fiso_evapn ! isotope evaporation (kg/m2/s)

real (kind=dbl_kind), dimension(:), intent(inout), optional :: &
Qref_iso, & ! isotope air sp hum ref level (kg/kg)
fiso_ocn, & ! isotope fluxes to ocean (kg/m2/s)
fiso_evap ! isotope evaporation (kg/m2/s)

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

!-----------------------------------------------------------------
Expand All @@ -163,23 +159,38 @@ subroutine merge_fluxes (aicen, &

! atmo fluxes

strairxT = strairxT + strairxn * aicen
strairyT = strairyT + strairyn * aicen
Cdn_atm_ratio = Cdn_atm_ratio + &
Cdn_atm_ratio_n * aicen
fsurf = fsurf + fsurfn * aicen
fcondtop = fcondtop + fcondtopn * aicen
fcondbot = fcondbot + fcondbotn * aicen
fsens = fsens + fsensn * aicen
flat = flat + flatn * aicen
fswabs = fswabs + fswabsn * aicen
flwout = flwout &
+ (flwoutn - (c1-emissivity)*flw) * aicen
evap = evap + evapn * aicen
evaps = evaps + evapsn * aicen
evapi = evapi + evapin * aicen
Tref = Tref + Trefn * aicen
Qref = Qref + Qrefn * aicen
if (present(strairxn) .and. present(strairxT)) &
strairxT = strairxT + strairxn * aicen
if (present(strairyn) .and. present(strairyT)) &
strairyT = strairyT + strairyn * aicen
if (present(Cdn_atm_ratio_n) .and. present(Cdn_atm_ratio)) &
Cdn_atm_ratio = Cdn_atm_ratio + &
Cdn_atm_ratio_n * aicen
if (present(fsurfn) .and. present(fsurf)) &
fsurf = fsurf + fsurfn * aicen
if (present(fcondtopn) .and. present(fcondtop)) &
fcondtop = fcondtop + fcondtopn * aicen
if (present(fcondbotn) .and. present(fcondbot)) &
fcondbot = fcondbot + fcondbotn * aicen
if (present(fsensn) .and. present(fsens)) &
fsens = fsens + fsensn * aicen
if (present(flatn) .and. present(flat)) &
flat = flat + flatn * aicen
if (present(fswabsn) .and. present(fswabs)) &
fswabs = fswabs + fswabsn * aicen
if (present(flwoutn) .and. present(flwout) .and. present(flw)) &
flwout = flwout &
+ (flwoutn - (c1-emissivity)*flw) * aicen
if (present(evapn) .and. present(evap)) &
evap = evap + evapn * aicen
if (present(evapsn) .and. present(evaps)) &
evaps = evaps + evapsn * aicen
if (present(evapin) .and. present(evapi)) &
evapi = evapi + evapin * aicen
if (present(Trefn) .and. present(Tref)) &
Tref = Tref + Trefn * aicen
if (present(Qrefn) .and. present(Qref)) &
Qref = Qref + Qrefn * aicen

! Isotopes
if (tr_iso) then
Expand All @@ -196,35 +207,46 @@ subroutine merge_fluxes (aicen, &

! ocean fluxes
if (present(Urefn) .and. present(Uref)) then
Uref = Uref + Urefn * aicen
Uref = Uref + Urefn * aicen
endif

fresh = fresh + freshn * 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
if (present(freshn) .and. present(fresh)) &
fresh = fresh + freshn * aicen
if (present(fsaltn) .and. present(fsalt)) &
fsalt = fsalt + fsaltn * aicen
if (present(fhocnn) .and. present(fhocn)) &
fhocn = fhocn + fhocnn * aicen
if (present(fswthrun) .and. present(fswthru)) &
fswthru = fswthru + fswthrun * aicen

if (present(fswthrun_vdr) .and. present(fswthru_vdr)) &
fswthru_vdr = fswthru_vdr + fswthrun_vdr * aicen
if (present(fswthrun_vdf) .and. present(fswthru_vdf)) &
fswthru_vdf = fswthru_vdf + fswthrun_vdf * aicen
if (present(fswthrun_idr) .and. present(fswthru_idr)) &
fswthru_idr = fswthru_idr + fswthrun_idr * aicen
if (present(fswthrun_idf) .and. present(fswthru_idf)) &
fswthru_idf = fswthru_idf + fswthrun_idf * aicen

! ice/snow thickness

meltt = meltt + melttn * aicen
meltb = meltb + meltbn * aicen
melts = melts + meltsn * aicen
if (present(melttn) .and. present(meltt)) &
meltt = meltt + melttn * aicen
if (present(meltbn) .and. present(meltb)) &
meltb = meltb + meltbn * aicen
if (present(meltsn) .and. present(melts)) &
melts = melts + meltsn * aicen
if (snwgrain) then
meltsliq = meltsliq + meltsliqn * aicen
if (present(meltsliqn) .and. present(meltsliq)) &
meltsliq = meltsliq + meltsliqn * aicen
endif
if (present(dsnow)) then
if (present(dsnown) .and. present(dsnow)) then
dsnow = dsnow + dsnown * aicen
endif
congel = congel + congeln * aicen
snoice = snoice + snoicen * aicen
if (present(congeln) .and. present(congel)) &
congel = congel + congeln * aicen
if (present(snoicen) .and. present(snoice)) &
snoice = snoice + snoicen * aicen

end subroutine merge_fluxes

Expand Down
Loading
Loading