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

Langmuir turbulence induced entrainment #31

Merged
merged 9 commits into from
Jul 8, 2020
2 changes: 1 addition & 1 deletion Externals_POP.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[CVMix]
tag = v0.93-beta
tag = v0.97b-beta
protocol = git
repo_url = https://github.com/CVMix/CVMix-src
local_path = externals/CVMix
Expand Down
28 changes: 13 additions & 15 deletions drivers/mct/POP_CplIndices.F90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module POP_CplIndices
use seq_flds_mod, only : seq_flds_x2o_fields, seq_flds_o2x_fields
use seq_flds_mod, only : seq_flds_i2o_per_cat, ice_ncat

use seq_flds_mod, only : seq_flds_x2o_fields, seq_flds_o2x_fields
use seq_flds_mod, only : seq_flds_i2o_per_cat, ice_ncat
use mcog, only : mcog_ncols, lmcog_flds_sent
use mct_mod

Expand All @@ -12,13 +12,12 @@ module POP_CplIndices

! ocn -> drv

integer :: index_o2x_So_t
integer :: index_o2x_So_t
integer :: index_o2x_So_u
integer :: index_o2x_So_v
integer :: index_o2x_So_s
integer :: index_o2x_So_dhdx
integer :: index_o2x_So_dhdy
! QL, 150526, to wav, boundary layer depth
integer :: index_o2x_So_bldepth
integer :: index_o2x_Fioo_q
integer :: index_o2x_Faoo_fco2_ocn
Expand All @@ -34,15 +33,15 @@ module POP_CplIndices
integer :: index_x2o_Faxa_nhx ! nitrogen deposition (nhx) flux from atm (kgNm2/sec)
integer :: index_x2o_Faxa_noy ! nitrogen deposition (noy) flux from atm (kgNm2/sec)

! QL, 150526, from wav
integer :: index_x2o_Sw_lamult ! wave model langmuir multiplier
integer :: index_x2o_Sw_ustokes ! surface Stokes drift, x-component
integer :: index_x2o_Sw_vstokes ! surface Stokes drift, y-component
integer :: index_x2o_Sw_hstokes ! surface layer Langmuir number for now
integer :: index_x2o_Foxx_taux ! zonal wind stress (taux) (W/m2 )
integer :: index_x2o_Foxx_tauy ! meridonal wind stress (tauy) (W/m2 )
integer :: index_x2o_Foxx_swnet ! net short-wave heat flux (W/m2 )
integer :: index_x2o_Foxx_sen ! sensible heat flux (W/m2 )
integer :: index_x2o_Foxx_lat
integer :: index_x2o_Foxx_lat
integer :: index_x2o_Foxx_lwup ! longwave radiation (up) (W/m2 )
integer :: index_x2o_Faxa_lwdn ! longwave radiation (down) (W/m2 )
integer :: index_x2o_Fioi_melth ! heat flux from snow & ice melt (W/m2 )
Expand All @@ -52,7 +51,7 @@ module POP_CplIndices
integer :: index_x2o_Fioi_flxdst ! flux: dust release from sea ice component
integer :: index_x2o_Fioi_salt ! salt (kg(salt)/m2/s)
integer :: index_x2o_Foxx_evap ! evaporation flux (kg/m2/s)
integer :: index_x2o_Faxa_prec
integer :: index_x2o_Faxa_prec
integer :: index_x2o_Faxa_snow ! water flux due to snow (kg/m2/s)
integer :: index_x2o_Faxa_rain ! water flux due to rain (kg/m2/s)
integer :: index_x2o_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition
Expand Down Expand Up @@ -101,18 +100,17 @@ subroutine POP_CplIndicesSet( )
index_o2x_So_s = mct_avect_indexra(o2x,'So_s')
index_o2x_So_dhdx = mct_avect_indexra(o2x,'So_dhdx')
index_o2x_So_dhdy = mct_avect_indexra(o2x,'So_dhdy')
! QL, 150526, to wav, boundary layer depth
index_o2x_So_bldepth = mct_avect_indexra(o2x,'So_bldepth')
index_o2x_Fioo_q = mct_avect_indexra(o2x,'Fioo_q')
index_o2x_Faoo_fco2_ocn = mct_avect_indexra(o2x,'Faoo_fco2_ocn',perrWith='quiet')
index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet')
index_x2o_Si_ifrac = mct_avect_indexra(x2o,'Si_ifrac')
index_x2o_Sa_pslv = mct_avect_indexra(x2o,'Sa_pslv')
index_x2o_So_duu10n = mct_avect_indexra(x2o,'So_duu10n')
! QL, 150526, from wav
index_x2o_Sw_lamult = mct_avect_indexra(x2o,'Sw_lamult')
index_x2o_Sw_ustokes = mct_avect_indexra(x2o,'Sw_ustokes')
index_x2o_Sw_vstokes = mct_avect_indexra(x2o,'Sw_vstokes')
index_x2o_Sw_hstokes = mct_avect_indexra(x2o,'Sw_hstokes')

index_x2o_Foxx_tauy = mct_avect_indexra(x2o,'Foxx_tauy')
index_x2o_Foxx_taux = mct_avect_indexra(x2o,'Foxx_taux')
Expand All @@ -121,15 +119,15 @@ subroutine POP_CplIndicesSet( )
index_x2o_Foxx_sen = mct_avect_indexra(x2o,'Foxx_sen')
index_x2o_Foxx_lwup = mct_avect_indexra(x2o,'Foxx_lwup')
index_x2o_Faxa_lwdn = mct_avect_indexra(x2o,'Faxa_lwdn')
index_x2o_Fioi_melth = mct_avect_indexra(x2o,'Fioi_melth')
index_x2o_Fioi_melth = mct_avect_indexra(x2o,'Fioi_melth')
index_x2o_Fioi_meltw = mct_avect_indexra(x2o,'Fioi_meltw')
index_x2o_Fioi_salt = mct_avect_indexra(x2o,'Fioi_salt')
index_x2o_Fioi_salt = mct_avect_indexra(x2o,'Fioi_salt')
index_x2o_Fioi_bcpho = mct_avect_indexra(x2o,'Fioi_bcpho')
index_x2o_Fioi_bcphi = mct_avect_indexra(x2o,'Fioi_bcphi')
index_x2o_Fioi_flxdst = mct_avect_indexra(x2o,'Fioi_flxdst')
index_x2o_Faxa_prec = mct_avect_indexra(x2o,'Faxa_prec')
index_x2o_Faxa_snow = mct_avect_indexra(x2o,'Faxa_snow')
index_x2o_Faxa_rain = mct_avect_indexra(x2o,'Faxa_rain')
index_x2o_Faxa_prec = mct_avect_indexra(x2o,'Faxa_prec')
index_x2o_Faxa_snow = mct_avect_indexra(x2o,'Faxa_snow')
index_x2o_Faxa_rain = mct_avect_indexra(x2o,'Faxa_rain')
index_x2o_Foxx_evap = mct_avect_indexra(x2o,'Foxx_evap')
index_x2o_Foxx_rofl = mct_avect_indexra(x2o,'Foxx_rofl')
index_x2o_Foxx_rofi = mct_avect_indexra(x2o,'Foxx_rofi')
Expand Down
65 changes: 34 additions & 31 deletions drivers/mct/ocn_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module ocn_import_export

use seq_flds_mod
use seq_timemgr_mod
use shr_file_mod
use shr_file_mod
use shr_cal_mod, only : shr_cal_date2ymd
use shr_sys_mod

Expand All @@ -31,7 +31,7 @@ module ocn_import_export
use forcing_fields, only: ATM_CO2_PROG_nf_ind, ATM_CO2_DIAG_nf_ind
use forcing_fields, only: ATM_NHx_nf_ind, ATM_NOy_nf_ind
use forcing_fields, only: IFRAC, U10_SQR, ATM_PRESS
use forcing_fields, only: LAMULT, USTOKES, VSTOKES
use forcing_fields, only: LAMULT, USTOKES, VSTOKES, LASL
use forcing_fields, only: ATM_FINE_DUST_FLUX, ATM_COARSE_DUST_FLUX, SEAICE_DUST_FLUX
use forcing_fields, only: ATM_BLACK_CARBON_FLUX, SEAICE_BLACK_CARBON_FLUX
use mcog, only: lmcog, mcog_ncols, import_mcog
Expand All @@ -49,17 +49,17 @@ module ocn_import_export
use prognostic
use time_management
use registry
! QL, 150526, ocn<->wav
! ocn<->wav
use vmix_kpp, only: KPP_HBLT ! ocn -> wav, bounadry layer depth

implicit none
public
save

! accumulated sum of send buffer quantities for averaging before being sent
real (r8), dimension(:,:,:,:), allocatable :: SBUFF_SUM
real (r8), dimension(:,:,:,:), allocatable :: SBUFF_SUM

real (r8) :: tlast_coupled
real (r8) :: tlast_coupled

contains

Expand All @@ -75,7 +75,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
! This routine receives message from cpl7 driver
!
! The following fields are always received from the coupler:
!
!
! o taux -- zonal wind stress (taux) (W/m2 )
! o tauy -- meridonal wind stress (tauy) (W/m2 )
! o snow -- water flux due to snow (kg/m2/s)
Expand All @@ -91,15 +91,15 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
! o ifrac -- ice fraction
! o rofl -- river runoff flux (kg/m2/s)
! o rofi -- ice runoff flux (kg/m2/s)
!
!
! The following fields are sometimes received from the coupler,
! depending on model options:
!
!
! o pslv -- sea-level pressure (Pa)
! o duu10n -- 10m wind speed squared (m^2/s^2)
! o co2prog-- bottom atm level prognostic co2
! o co2diag-- bottom atm level diagnostic co2
!
!
!-----------------------------------------------------------------------
!
! !REVISION HISTORY:
Expand All @@ -122,7 +122,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
character (char_len) :: &
label, &
message

integer (int_kind) :: &
i,j,k,n,ncol,iblock

Expand All @@ -145,7 +145,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)

!-----------------------------------------------------------------------
!
! zero out padded cells
! zero out padded cells
!
!-----------------------------------------------------------------------

Expand Down Expand Up @@ -184,7 +184,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
! rotate true zonal/meridional wind stress into local coordinates,
! convert to dyne/cm**2, and shift SMFT to U grid
!
! halo updates are performed in subroutine rotate_wind_stress,
! halo updates are performed in subroutine rotate_wind_stress,
! following the rotation
!
!-----------------------------------------------------------------------
Expand Down Expand Up @@ -237,26 +237,29 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
!*** converting from m**2/s**2 to cm**2/s**2
WORKB(i,j ) = x2o(index_x2o_So_duu10n,n)
U10_SQR(i,j,iblock) = cmperm * cmperm * WORKB(i,j) * RCALCT(i,j,iblock)
! QL, 150526, langmuir mixing variables
! QL, 150908, only apply enhancement factor to ice-free region

! langmuir mixing variables
! apply enhancement factor to ice-free region
if (IFRAC(i,j,iblock) <= 0.05_r8) then
! import enhancement factor (unitless)
WORKB(i,j ) = x2o(index_x2o_Sw_lamult,n)
LAMULT(i,j,iblock) = WORKB(i,j)*RCALCT(i,j,iblock)
else
LAMULT(i,j,iblock) = c1
endif
! QL, 150706, DEBUG
!print*, "LAMULT = ", LAMULT(i,j,iblock)
!print*, "RCALCT = ", RCALCT(i,j,iblock)
!print*, "WORKB = ", WORKB(i,j)
!! DEBUG
! import surface Stokes drift (m/s)
WORKB(i,j ) = x2o(index_x2o_Sw_ustokes,n)
USTOKES(i,j,iblock) = WORKB(i,j)*RCALCT(i,j,iblock)
WORKB(i,j ) = x2o(index_x2o_Sw_vstokes,n)
VSTOKES(i,j,iblock) = WORKB(i,j)*RCALCT(i,j,iblock)
! apply surface layer Langmuir number to ice-free region
if (IFRAC(i,j,iblock) <= 0.05_r8) then
! import surface layer Langmuir number (unitless)
WORKB(i,j ) = x2o(index_x2o_Sw_hstokes,n)
LASL(i,j,iblock) = WORKB(i,j)*RCALCT(i,j,iblock)
else
LASL(i,j,iblock) = c10000 ! a big number
endif

! convert dust flux from MKS (kg/m^2/s) to CGS (g/cm^2/s)
ATM_FINE_DUST_FLUX(i,j,iblock) = 0.1_r8 * RCALCT(i,j,iblock) * ( &
Expand Down Expand Up @@ -415,7 +418,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)

call named_field_set(ATM_CO2_DIAG_nf_ind, WORK1)
endif

if (index_x2o_Faxa_nhx > 0) then
n = 0
do iblock = 1, nblocks_clinic
Expand All @@ -427,7 +430,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
do j=this_block%jb,this_block%je
do i=this_block%ib,this_block%ie
n = n + 1
WORK1(i,j,iblock) = x2o(index_x2o_Faxa_nhx,n) * (1.0e-1_r8 * (c1/14.0_r8) * 1.0e9_r8)
WORK1(i,j,iblock) = x2o(index_x2o_Faxa_nhx,n) * (1.0e-1_r8 * (c1/14.0_r8) * 1.0e9_r8)
enddo
enddo
enddo
Expand Down Expand Up @@ -489,7 +492,7 @@ subroutine ocn_import(x2o, ldiag_cpl, errorCode)
' Global averages of fluxes received from cpl at ', &
cyear,'/',cmonth ,'/',cday, chour,':',cminute,':',csecond
call document ('pop_recv_from_coupler', trim(message))

m2percm2 = mpercm*mpercm
nrecv = size(x2o, dim=1)
do k = 1,nrecv
Expand Down Expand Up @@ -529,7 +532,7 @@ end subroutine ocn_import
! !IROUTINE: ocn_export_mct
! !INTERFACE:

subroutine ocn_export(o2x, ldiag_cpl, errorCode)
subroutine ocn_export(o2x, ldiag_cpl, errorCode)

! !DESCRIPTION:
! This routine calls the routines necessary to send pop fields to
Expand All @@ -553,9 +556,9 @@ subroutine ocn_export(o2x, ldiag_cpl, errorCode)
!-----------------------------------------------------------------------

integer (int_kind) :: n, iblock

character (char_len) :: label

integer (int_kind) :: &
i,j,k

Expand Down Expand Up @@ -676,7 +679,7 @@ subroutine ocn_export(o2x, ldiag_cpl, errorCode)
this_block = get_block(blocks_clinic(iblock),iblock)
call ugrid_to_tgrid(WORK3,SBUFF_SUM(:,:,iblock,index_o2x_So_dhdx),iblock)
call ugrid_to_tgrid(WORK4,SBUFF_SUM(:,:,iblock,index_o2x_So_dhdy),iblock)

WORK1 = (WORK3*cos(ANGLET(:,:,iblock)) + WORK4*sin(-ANGLET(:,:,iblock))) &
/grav/tlast_coupled
WORK2 = (WORK4*cos(ANGLET(:,:,iblock)) - WORK3*sin(-ANGLET(:,:,iblock))) &
Expand Down Expand Up @@ -765,7 +768,7 @@ subroutine ocn_export(o2x, ldiag_cpl, errorCode)
POP_gridHorzLocCenter, &
POP_fieldKindScalar, errorCode, &
fillValue = 0.0_POP_r8)

if (errorCode /= POP_Success) then
call POP_ErrorSet(errorCode, &
'ocn_export_mct: error updating halo for state')
Expand All @@ -783,7 +786,7 @@ subroutine ocn_export(o2x, ldiag_cpl, errorCode)
endif

1100 format ('comm_diag ', a3, 1x, a4, 1x, a8, 1x, es26.19:, 1x, a6)

tlast_coupled = c0

!-----------------------------------------------------------------------
Expand All @@ -805,7 +808,7 @@ subroutine POP_sum_buffer
!
! !REVISION HISTORY:
! same as module
!
!
!EOP
!BOC

Expand Down Expand Up @@ -933,7 +936,7 @@ subroutine POP_sum_buffer
!EOC

end subroutine POP_sum_buffer

!***********************************************************************

end module ocn_import_export
11 changes: 10 additions & 1 deletion drivers/nuopc/ocn_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module ocn_import_export
use forcing_fields, only: ATM_CO2_PROG_nf_ind, ATM_CO2_DIAG_nf_ind
use forcing_fields, only: ATM_NHx_nf_ind, ATM_NOy_nf_ind
use forcing_fields, only: IFRAC, U10_SQR, ATM_PRESS
use forcing_fields, only: LAMULT, USTOKES, VSTOKES
use forcing_fields, only: LAMULT, USTOKES, VSTOKES, LASL
use forcing_fields, only: ATM_FINE_DUST_FLUX, ATM_COARSE_DUST_FLUX, SEAICE_DUST_FLUX
use forcing_fields, only: ATM_BLACK_CARBON_FLUX, SEAICE_BLACK_CARBON_FLUX
use mcog, only: lmcog, mcog_ncols, lmcog_flds_sent, import_mcog
Expand Down Expand Up @@ -184,6 +184,7 @@ subroutine ocn_advertise_fields(gcomp, importState, exportState, flds_scalar_nam
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sw_lamult')
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sw_ustokes')
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sw_vstokes')
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sw_hstokes')

! from atmosphere
call fldlist_add(fldsToOcn_num, fldsToOcn, 'Sa_pslv')
Expand Down Expand Up @@ -581,6 +582,14 @@ subroutine ocn_import( importState, flds_scalar_name, ldiag_cpl, errorCode, rc )
if (ChkErr(rc,__LINE__,u_FILE_u)) return
VSTOKES(:,:,:) = work1(:,:,:) * RCALCT(:,:,:) ! Stokes drift (m/s)

call state_getimport(importState, 'Sw_hstokes', work1, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return
where (IFRAC <= 0.05_r8)
LASL(:,:,:) = work1 * RCALCT(:,:,:) ! surface layer Lanmguir number (unitless)
elsewhere
LASL(:,:,:) = c10000 ! a big number
end where

!-----------------------------------------------------------------------
! from river
!-----------------------------------------------------------------------
Expand Down
Loading