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

Isotope #275

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3ec0251
Water isotope branch
dabail10 Jul 8, 2019
1337d77
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Jul 8, 2019
b5da658
Water isotopes
dabail10 Jul 19, 2019
b812402
Revert aerosol bug fix for another commit
dabail10 Jul 19, 2019
63984ae
water isotopes
dabail10 Jul 19, 2019
04c87e5
isotopes
dabail10 Jul 26, 2019
7646460
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Aug 27, 2019
4825eff
Updates to the isotopes
dabail10 Aug 28, 2019
3d0b962
Latest isotope changes
dabail10 Sep 4, 2019
64a2cee
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Sep 4, 2019
a5449f5
Another isotope fix
dabail10 Sep 5, 2019
b2925cb
One more isotope fix
dabail10 Sep 5, 2019
36cf729
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Sep 20, 2019
b834498
Update isotope branch
dabail10 Sep 20, 2019
0e8b66d
Fix some bugs when Qref_iso is zero
dabail10 Sep 27, 2019
d5abaf5
Merge branch 'isotope' of https://github.com/ESCOMP/Icepack into isotope
dabail10 Sep 27, 2019
6febc5a
Bring in new icepack interfaces
dabail10 Dec 11, 2019
0b47734
Merge branch 'isotope' of https://github.com/ESCOMP/Icepack into isotope
dabail10 Dec 11, 2019
a76e0c4
Update istope
dabail10 Feb 11, 2020
1866666
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Feb 11, 2020
d95397d
Update from master
dabail10 Feb 11, 2020
210ab2b
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Feb 18, 2020
a091a62
Update from master
dabail10 Feb 18, 2020
ef157d9
Merge branch 'master' of https://github.com/CICE-Consortium/Icepack i…
dabail10 Feb 20, 2020
4892559
Update from master and isotope bug fixes
dabail10 Feb 20, 2020
b9b803e
Remove print statements
dabail10 Feb 20, 2020
dbc1499
Remove print statements
dabail10 Feb 20, 2020
925997e
Update from master
dabail10 Feb 24, 2020
70a4dfd
Add test settings for isotopes
dabail10 Feb 26, 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
77 changes: 73 additions & 4 deletions columnphysics/icepack_atmo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,17 @@ subroutine atmo_boundary_layer (sfctype, &
lhcoef, shcoef, &
Cdn_atm, &
Cdn_atm_ratio_n, &
n_iso, tr_iso, &
Qa_iso, Qref_iso, &
uvel, vvel, &
Uref )

character (len=3), intent(in) :: &
sfctype ! ice or ocean

logical (kind=log_kind), optional, intent(in) :: &
tr_iso

logical (kind=log_kind), intent(in) :: &
calc_strair, & ! if true, calculate wind stress components
formdrag, & ! if true, calculate form drag
Expand All @@ -75,6 +80,9 @@ subroutine atmo_boundary_layer (sfctype, &
integer (kind=int_kind), intent(in) :: &
natmiter ! number of iterations for boundary layer calculations

integer (kind=int_kind), optional, intent(in) :: &
n_iso ! number of isotopes

real (kind=dbl_kind), intent(in) :: &
Tsf , & ! surface temperature of ice or ocean
potT , & ! air potential temperature (K)
Expand Down Expand Up @@ -104,6 +112,12 @@ subroutine atmo_boundary_layer (sfctype, &
shcoef , & ! transfer coefficient for sensible heat
lhcoef ! transfer coefficient for latent heat

real (kind=dbl_kind), intent(in), optional, dimension(:) :: &
Qa_iso ! specific isotopic humidity (kg/kg)

real (kind=dbl_kind), intent(inout), optional, dimension(:) :: &
Qref_iso ! reference specific isotopic humidity (kg/kg)

real (kind=dbl_kind), intent(in) :: &
uvel , & ! x-direction ice speed (m/s)
vvel ! y-direction ice speed (m/s)
Expand All @@ -114,7 +128,7 @@ subroutine atmo_boundary_layer (sfctype, &
! local variables

integer (kind=int_kind) :: &
k ! iteration index
k,n ! iteration index

real (kind=dbl_kind) :: &
TsfK , & ! surface temperature in Kelvin (K)
Expand All @@ -136,6 +150,7 @@ subroutine atmo_boundary_layer (sfctype, &
ustar , & ! ustar (m/s)
tstar , & ! tstar
qstar , & ! qstar
ratio , & ! ratio
rdn , & ! sqrt of neutral exchange coefficient (momentum)
rhn , & ! sqrt of neutral exchange coefficient (heat)
ren , & ! sqrt of neutral exchange coefficient (water)
Expand Down Expand Up @@ -356,6 +371,19 @@ subroutine atmo_boundary_layer (sfctype, &
Uref = vmag * rd / rdn
endif

if (present(tr_iso) .and. present(Qref_iso) .and. &
present(Qa_iso) .and. present(n_iso)) then
if (tr_iso) then
Qref_iso(:) = c0
do n = 1, n_iso
ratio = c0
if (Qa_iso(2) > puny) &
ratio = Qa_iso(n)/Qa_iso(2)
Qref_iso(n) = Qa_iso(n) - ratio*delq*fac
enddo
endif
endif

end subroutine atmo_boundary_layer

!=======================================================================
Expand Down Expand Up @@ -800,7 +828,7 @@ end subroutine neutral_drag_coeffs
!autodocument_start icepack_atm_boundary
!

subroutine icepack_atm_boundary(sfctype, &
subroutine icepack_atm_boundary(sfctype, &
Tsf, potT, &
uatm, vatm, &
wind, zlvl, &
Expand All @@ -811,6 +839,8 @@ subroutine icepack_atm_boundary(sfctype, &
lhcoef, shcoef, &
Cdn_atm, &
Cdn_atm_ratio_n, &
n_iso, tr_iso, &
Qa_iso, Qref_iso, &
uvel, vvel, &
Uref)

Expand All @@ -827,6 +857,12 @@ subroutine icepack_atm_boundary(sfctype, &
Qa , & ! specific humidity (kg/kg)
rhoa ! air density (kg/m^3)

integer (kind=int_kind), optional, intent(in) :: &
n_iso ! number of isotopes

logical (kind=log_kind), optional, intent(in) :: &
tr_iso

real (kind=dbl_kind), intent(inout) :: &
Cdn_atm , & ! neutral drag coefficient
Cdn_atm_ratio_n ! ratio drag coeff / neutral drag coeff
Expand All @@ -844,6 +880,12 @@ subroutine icepack_atm_boundary(sfctype, &
shcoef , & ! transfer coefficient for sensible heat
lhcoef ! transfer coefficient for latent heat

real (kind=dbl_kind), intent(in), optional, dimension(:) :: &
Qa_iso ! specific isotopic humidity (kg/kg)

real (kind=dbl_kind), intent(inout), optional, dimension(:) :: &
Qref_iso ! reference specific isotopic humidity (kg/kg)

real (kind=dbl_kind), optional, intent(in) :: &
uvel , & ! x-direction ice speed (m/s)
vvel ! y-direction ice speed (m/s)
Expand All @@ -858,6 +900,15 @@ subroutine icepack_atm_boundary(sfctype, &
real (kind=dbl_kind) :: &
worku, workv, workr

integer (kind=int_kind) :: &
niso

logical (kind=log_kind) :: &
triso

real (kind=dbl_kind), dimension(:), allocatable :: &
Qaiso, Qriso

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

worku = c0
Expand All @@ -869,6 +920,16 @@ subroutine icepack_atm_boundary(sfctype, &
if (present(vvel)) then
workv = vvel
endif
if (present(n_iso) .and. present(Qa_iso) .and. &
present(Qref_iso) .and. present(tr_iso)) then
allocate(Qaiso(n_iso),Qriso(n_iso))
Qaiso = Qa_iso
Qriso = Qref_iso
niso = n_iso
triso = tr_iso
else
allocate(Qaiso(1),Qriso(1))
endif

Cdn_atm_ratio_n = c1

Expand Down Expand Up @@ -896,15 +957,23 @@ subroutine icepack_atm_boundary(sfctype, &
lhcoef, shcoef, &
Cdn_atm, &
Cdn_atm_ratio_n, &
worku, workv, &
workr)
n_iso=niso, tr_iso=triso, &
Qa_iso=Qaiso, Qref_iso=Qriso,&
uvel=worku, vvel=workv, &
Uref=workr)
if (icepack_warnings_aborted(subname)) return
endif ! atmbndy

if (present(Uref)) then
Uref = workr
endif

if (present(Qref_iso)) then
Qref_iso = Qriso
endif

deallocate(Qaiso,Qriso)

end subroutine icepack_atm_boundary

!------------------------------------------------------------
Expand Down
27 changes: 26 additions & 1 deletion columnphysics/icepack_flux.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ subroutine merge_fluxes (aicen, &
meltt, melts, &
meltb, &
congel, snoice, &
Uref, Urefn )
Uref, Urefn, &
Qref_iso, Qrefn_iso, &
fiso_ocn, fiso_ocnn, &
fiso_evap, fiso_evapn )


! single category fluxes
real (kind=dbl_kind), intent(in) :: &
Expand Down Expand Up @@ -119,6 +123,16 @@ subroutine merge_fluxes (aicen, &
real (kind=dbl_kind), optional, intent(inout):: &
Uref ! air speed reference level (m/s)

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

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

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

!-----------------------------------------------------------------
Expand Down Expand Up @@ -148,6 +162,17 @@ subroutine merge_fluxes (aicen, &
Tref = Tref + Trefn * aicen
Qref = Qref + Qrefn * aicen

! Isotopes
if (present(Qrefn_iso) .and. present(Qref_iso)) then
Qref_iso(:) = Qref_iso(:) + Qrefn_iso(:) * aicen
endif
if (present(fiso_ocnn) .and. present(fiso_ocn)) then
fiso_ocn(:) = fiso_ocn(:) + fiso_ocnn(:) * aicen
endif
if (present(fiso_evapn) .and. present(fiso_evap)) then
fiso_evap(:) = fiso_evap(:) + fiso_evapn(:) * aicen
endif

! ocean fluxes
if (present(Urefn) .and. present(Uref)) then
Uref = Uref + Urefn * aicen
Expand Down
1 change: 1 addition & 0 deletions columnphysics/icepack_intfc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module icepack_intfc
use icepack_tracers, only: icepack_max_don => max_don
use icepack_tracers, only: icepack_max_fe => max_fe
use icepack_tracers, only: icepack_max_aero => max_aero
use icepack_tracers, only: icepack_max_iso => max_iso
use icepack_tracers, only: icepack_nmodal1 => nmodal1
use icepack_tracers, only: icepack_nmodal2 => nmodal2
use icepack_parameters, only: icepack_nspint => nspint
Expand Down
Loading