Skip to content

Commit

Permalink
Langmuir mixing parametrisation resubmitted PR (mom-ocean#239)
Browse files Browse the repository at this point in the history
* Langmuir turbulence enhance factor via cvmix method based on Van Roekel 2012 (from Russ) (mom-ocean#229)

* Harmonisation effort for ACCESS.

include Langmuir wave mixing (cvmix like) and diagnostics
allow 10m winds to be passed to model (incomplete but usable for standard mom, ok for access)
make aice allocatable and local to ocean_sbc module
enable calculation of u10 from ustar

* Allow 10m winds to be passed in a pure ocean run

* Fix u_10 initialisation in ocean_sbc (mom-ocean#232)

10m winds  Velocity%u10 now obtained unconditionally

* remove ACCESS_CM definitions and allow for ACCESS not passing 10m wind

* Change permissions on template file
  • Loading branch information
aidanheerdegen authored Aug 16, 2018
1 parent ee8e534 commit 08266af
Show file tree
Hide file tree
Showing 13 changed files with 300 additions and 279 deletions.
173 changes: 0 additions & 173 deletions bin/mkmf.template.access-cm2

This file was deleted.

1 change: 1 addition & 0 deletions bin/mkmf.template.access-cm2
31 changes: 7 additions & 24 deletions src/accessom_coupler/mom_oasis3_interface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ module mom_oasis3_interface_mod
integer iisc,iiec,jjsc,jjec
integer iisd,iied,jjsd,jjed

#if defined(ACCESS_CM)
integer, parameter :: max_fields_in=22
integer, parameter :: max_fields_out=10
#if defined(ACCESS_WND)
integer, parameter :: max_fields_in=21
#else
integer, parameter :: max_fields_in=20
integer, parameter :: max_fields_out=8
#endif

integer, parameter :: max_fields_out=8

integer, dimension(max_fields_in) :: id_var_in ! ID for fields to be rcvd
integer, dimension(max_fields_out) :: id_var_out ! ID for fields to be sent

Expand Down Expand Up @@ -358,9 +358,8 @@ subroutine coupler_init(Dom, Time, Time_step_coupled, dt_cpld, Run_len, &
mom_name_read(18)='mh_flux' ! Heat flux due to melting
mom_name_read(19)='wfimelt' !Water flux due to ice melting
mom_name_read(20)='wfiform' !Water flux due to ice forming
#if defined(ACCESS_CM)
mom_name_read(21)='co2_io' !
mom_name_read(22)='wnd_io' !
#if defined(ACCESS_WND)
mom_name_read(21)='wnd_io' !
#endif

!ocn ==> ice
Expand All @@ -374,10 +373,6 @@ subroutine coupler_init(Dom, Time, Time_step_coupled, dt_cpld, Run_len, &
mom_name_write(6)='frazil'
mom_name_write(7)='dssldx'
mom_name_write(8)='dssldy'
#if defined(ACCESS_CM)
mom_name_write(9)='co2_o'
mom_name_write(10)='co2fx_o'
#endif


fmatch = .false.
Expand Down Expand Up @@ -588,12 +583,6 @@ subroutine into_coupler(step, Ocean_sfc, Time, before_ocean_update)
vtmp(iisd:iied,jjsd:jjed) = Ocean_sfc%gradient(iisd:iied,jjsd:jjed,1)
case('dssldy')
vtmp(iisd:iied,jjsd:jjed) = Ocean_sfc%gradient(iisd:iied,jjsd:jjed,2)
#if defined(ACCESS_CM)
case('co2_o')
vtmp(iisd:iied,jjsd:jjed) = Ocean_sfc%co2(iisd:iied,jjsd:jjed)
case('co2fx_o')
vtmp(iisd:iied,jjsd:jjed) = Ocean_sfc%co2flux(iisd:iied,jjsd:jjed)
#endif
case DEFAULT
call mpp_error(FATAL,&
'==>Error from into_coupler: Unknown quantity.')
Expand Down Expand Up @@ -752,9 +741,7 @@ subroutine from_coupler(step,Ocean_sfc,Ice_ocean_boundary, Time)
Ice_ocean_boundary%wfimelt(iisc:iiec,jjsc:jjec) = vwork(iisc:iiec,jjsc:jjec)
case('wfiform')
Ice_ocean_boundary%wfiform(iisc:iiec,jjsc:jjec) = vwork(iisc:iiec,jjsc:jjec)
#if defined(ACCESS_CM)
case('co2_io')
Ice_ocean_boundary%co2(iisc:iiec,jjsc:jjec) = vwork(iisc:iiec,jjsc:jjec)
#if defined(ACCESS_WND)
case('wnd_io')
Ice_ocean_boundary%wnd(iisc:iiec,jjsc:jjec) = vwork(iisc:iiec,jjsc:jjec)
#endif
Expand Down Expand Up @@ -820,10 +807,6 @@ subroutine write_coupler_restart(step,Ocean_sfc,write_restart)
case('dssldx'); vtmp = Ocean_sfc%gradient(iisd:iied,jjsd:jjed,1); fld_ice='sslx_i'
case('dssldy'); vtmp = Ocean_sfc%gradient(iisd:iied,jjsd:jjed,2); fld_ice='ssly_i'
case('frazil'); vtmp = Ocean_sfc%frazil(iisd:iied,jjsd:jjed); fld_ice='pfmice_i'
#if defined(ACCESS_CM)
case('co2_o'); vtmp = Ocean_sfc%co2(iisd:iied,jjsd:jjed); fld_ice='co2_oi'
case('co2fx_o'); vtmp = Ocean_sfc%co2flux(iisd:iied,jjsd:jjed); fld_ice='co2fx_oi'
#endif
end select

if (parallel_coupling) then
Expand Down
11 changes: 1 addition & 10 deletions src/accessom_coupler/ocean_solo.F90
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,8 @@ program main
Ice_ocean_boundary% aice(isc:iec,jsc:jec), &
Ice_ocean_boundary% mh_flux(isc:iec,jsc:jec), &
Ice_ocean_boundary% wfimelt(isc:iec,jsc:jec), &
Ice_ocean_boundary% wfiform(isc:iec,jsc:jec))
#if defined ACCESS_CM
allocate(Ice_ocean_boundary%co2(isc:iec,jsc:jec), &
Ice_ocean_boundary% wfiform(isc:iec,jsc:jec), &
Ice_ocean_boundary%wnd(isc:iec,jsc:jec))
#endif

Ice_ocean_boundary%u_flux = 0.0
Ice_ocean_boundary%v_flux = 0.0
Expand All @@ -400,10 +397,7 @@ program main
Ice_ocean_boundary%mh_flux = 0.0
Ice_ocean_boundary% wfimelt = 0.0
Ice_ocean_boundary% wfiform = 0.0
#if defined ACCESS_CM
Ice_ocean_boundary%co2 = 0.0
Ice_ocean_boundary%wnd = 0.0
#endif

coupler_init_clock = mpp_clock_id('OASIS init', grain=CLOCK_COMPONENT)
call mpp_clock_begin(coupler_init_clock)
Expand Down Expand Up @@ -661,10 +655,7 @@ subroutine write_boundary_chksums(Ice_ocean_boundary)
call write_chksum_2d('Ice_ocean_boundary%mh_flux', Ice_ocean_boundary%mh_flux)
call write_chksum_2d('Ice_ocean_boundary%wfimelt', Ice_ocean_boundary%wfimelt)
call write_chksum_2d('Ice_ocean_boundary%wfiform', Ice_ocean_boundary%wfiform)
#if defined ACCESS_CM
call write_chksum_2d('Ice_ocean_boundary%co2', Ice_ocean_boundary%co2)
call write_chksum_2d('Ice_ocean_boundary%wnd', Ice_ocean_boundary%wnd)
#endif

end subroutine write_boundary_chksums

Expand Down
15 changes: 15 additions & 0 deletions src/coupler/flux_exchange.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,7 @@ subroutine flux_exchange_init ( Time, Atm, Land, Ice, Ocean, Ocean_state,&
allocate( ice_ocean_boundary%calving_hflx (is:ie,js:je) ) ; ice_ocean_boundary%calving_hflx = 0.0
allocate( ice_ocean_boundary%p (is:ie,js:je) ) ; ice_ocean_boundary%p = 0.0
allocate( ice_ocean_boundary%mi (is:ie,js:je) ) ; ice_ocean_boundary%mi = 0.0
allocate( ice_ocean_boundary%wnd (is:ie,js:je) ) ; ice_ocean_boundary%wnd = 0.0

!
! allocate fields for extra tracers
Expand Down Expand Up @@ -1785,6 +1786,8 @@ subroutine sfc_boundary_layer ( dt, Time, Atm, Land, Ice, Land_Ice_Atmos_Boundar
endif
#endif

! place the wind value onto the ice data type. mac ! Check RASF
call get_from_xgrid (Ice%wnd, 'OCN', ex_u10, xmap_sfc)
!=======================================================================
! [7] diagnostics section

Expand Down Expand Up @@ -2775,6 +2778,7 @@ subroutine flux_ice_to_ocean ( Time, Ice, Ocean, Ice_Ocean_Boundary )
! runoff_ocean, calving_ocean, &
! flux_salt_ocean, p_surf_ocean
type(ice_ocean_boundary_type), intent(inout) :: Ice_Ocean_Boundary
real, dimension(:,:), pointer :: dummy_null_pointer => NULL() ! RASF hack to get around pointer association.

integer :: m
integer :: n
Expand Down Expand Up @@ -2850,13 +2854,24 @@ subroutine flux_ice_to_ocean ( Time, Ice, Ocean, Ice_Ocean_Boundary )
if(ASSOCIATED(Ice_Ocean_Boundary%q_flux) ) call flux_ice_to_ocean_redistribute( Ice, Ocean, &
Ice%flux_q, Ice_Ocean_Boundary%q_flux, Ice_Ocean_Boundary%xtype, do_area_weighted_flux )

if(ASSOCIATED(Ice_Ocean_Boundary%wnd) ) then
if(ASSOCIATED(Ice%wnd)) then
call flux_ice_to_ocean_redistribute( Ice, Ocean, &
Ice%wnd(:,:,1), Ice_Ocean_Boundary%wnd, Ice_Ocean_Boundary%xtype, do_area_weighted_flux )
else
call flux_ice_to_ocean_redistribute( Ice, Ocean, &
dummy_null_pointer, Ice_Ocean_Boundary%wnd, Ice_Ocean_Boundary%xtype, do_area_weighted_flux ) !Put dummy array here.
endif
endif

!Balaji: moved data_override calls here from coupler_main
if( ocn_pe )then
call mpp_set_current_pelist(ocn_pelist)
call data_override('OCN', 'u_flux', Ice_Ocean_Boundary%u_flux , Time )
call data_override('OCN', 'v_flux', Ice_Ocean_Boundary%v_flux , Time )
call data_override('OCN', 't_flux', Ice_Ocean_Boundary%t_flux , Time )
call data_override('OCN', 'q_flux', Ice_Ocean_Boundary%q_flux , Time )
call data_override('OCN', 'wnd', Ice_Ocean_Boundary%wnd , Time )
call data_override('OCN', 'salt_flux', Ice_Ocean_Boundary%salt_flux, Time )
call data_override('OCN', 'lw_flux', Ice_Ocean_Boundary%lw_flux , Time )
call data_override('OCN', 'sw_flux_nir_dir', Ice_Ocean_Boundary%sw_flux_nir_dir , Time )
Expand Down
4 changes: 3 additions & 1 deletion src/ice_sis/ice_model.F90
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module ice_model_mod
add_diurnal_sw, id_mib, ice_data_type_chksum, &
id_ustar, id_vstar, channel_viscosity, smag_ocn, &
ssh_gravity, chan_cfl_limit, id_vocean, id_uocean, &
id_vchan, id_uchan
id_vchan, id_uchan, id_wnd
use ice_type_mod, only: do_sun_angle_for_alb, &
id_alb_vis_dir, id_alb_vis_dif, &
id_alb_nir_dir, id_alb_nir_dif
Expand Down Expand Up @@ -1456,6 +1456,8 @@ subroutine update_ice_model_slow (Ice, runoff, calving, &
! mask=Ice%mask )

if (id_ext>0) sent = send_data(id_ext, ext(Ice%part_size(isc:iec,jsc:jec,1)), Ice%Time, mask=Ice%mask)
if (id_wnd>0) sent = send_data(id_wnd, Ice%wnd(isc:iec,jsc:jec,1), Ice%Time, mask=Ice%mask)

if (id_hs>0) sent = send_data(id_hs, ice_avg(Ice%h_snow(isc:iec,jsc:jec,:),Ice%part_size(isc:iec,jsc:jec,:)), &
Ice%Time, mask=Ice%mask)
if (id_hi>0) sent = send_data(id_hi, ice_avg(Ice%h_ice(isc:iec,jsc:jec,:) ,Ice%part_size(isc:iec,jsc:jec,:)), &
Expand Down
Loading

0 comments on commit 08266af

Please sign in to comment.