From bccdf19b851de73ee94fa5e83635c72bff08a3d1 Mon Sep 17 00:00:00 2001 From: Gustavo Marques Date: Fri, 4 Oct 2019 09:33:47 -0600 Subject: [PATCH 1/6] Restored comments documenting the dimensional rescaling of variables --- .../lateral/MOM_hor_visc.F90 | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/src/parameterizations/lateral/MOM_hor_visc.F90 b/src/parameterizations/lateral/MOM_hor_visc.F90 index b798fb4d86..4208bc1642 100644 --- a/src/parameterizations/lateral/MOM_hor_visc.F90 +++ b/src/parameterizations/lateral/MOM_hor_visc.F90 @@ -241,67 +241,67 @@ subroutine horizontal_viscosity(u, v, h, diffu, diffv, MEKE, VarMix, G, GV, US, div_xx_dy, & ! y-derivative of horizontal divergence (d/dy(du/dx + dv/dy)) [L-1 T-1 ~> m-1 s-1] vbtav ! meridional barotropic vel. ave. over baroclinic time-step [L T-1 ~> m s-1] real, dimension(SZI_(G),SZJ_(G)) :: & - dudx_bt, dvdy_bt, & ! components in the barotropic horizontal tension [s-1] - div_xx, & ! Estimate of horizontal divergence at h-points [s-1] - sh_xx, & ! horizontal tension (du/dx - dv/dy) including metric terms [s-1] - sh_xx_bt, & ! barotropic horizontal tension (du/dx - dv/dy) including metric terms [s-1] - str_xx,& ! str_xx is the diagonal term in the stress tensor [H m2 s-2 ~> m3 s-2 or kg s-2] - str_xx_GME,& ! smoothed diagonal term in the stress tensor from GME [H m2 s-2] - bhstr_xx,& ! A copy of str_xx that only contains the biharmonic contribution [H m2 s-2 ~> m3 s-2 or kg s-2] - FrictWorkIntz, & ! depth integrated energy dissipated by lateral friction [W m-2] - Leith_Kh_h, & ! Leith Laplacian viscosity at h-points [m2 s-1] - Leith_Ah_h, & ! Leith bi-harmonic viscosity at h-points [m4 s-1] - grad_vort_mag_h, & ! Magnitude of vorticity gradient at h-points [m-1 s-1] - grad_vort_mag_h_2d, & ! Magnitude of 2d vorticity gradient at h-points [m-1 s-1] - grad_div_mag_h, & ! Magnitude of divergence gradient at h-points [m-1 s-1] - dudx, dvdy, & ! components in the horizontal tension [s-1] - grad_vel_mag_h, & ! Magnitude of the velocity gradient tensor squared at h-points [s-2] - grad_vel_mag_bt_h, & ! Magnitude of the barotropic velocity gradient tensor squared at h-points [s-2] - grad_d2vel_mag_h, & ! Magnitude of the Laplacian of the velocity vector, squared [m-2 s-2] - boundary_mask_h ! A mask that zeroes out cells with at least one land edge + dudx_bt, dvdy_bt, & ! components in the barotropic horizontal tension [T-1 ~> s-1] + div_xx, & ! Estimate of horizontal divergence at h-points [T-1 ~> s-1] + sh_xx, & ! horizontal tension (du/dx - dv/dy) including metric terms [T-1 ~> s-1] + sh_xx_bt, & ! barotropic horizontal tension (du/dx - dv/dy) including metric terms [T-1 ~> s-1] + str_xx,& ! str_xx is the diagonal term in the stress tensor [H L2 T-2 ~> m3 s-2 or kg s-2] + str_xx_GME,& ! smoothed diagonal term in the stress tensor from GME [H L2 T-2 ~> m3 s-2 or kg s-2] + bhstr_xx,& ! A copy of str_xx that only contains the biharmonic contribution [H L2 T-2 ~> m3 s-2 or kg s-2] + FrictWorkIntz, & ! depth integrated energy dissipated by lateral friction [kg m-2 L2 T-3 ~> W m-2] + Leith_Kh_h, & ! Leith Laplacian viscosity at h-points [L2 T-1 ~> m2 s-1] + Leith_Ah_h, & ! Leith bi-harmonic viscosity at h-points [L4 T-1 ~> m4 s-1] + grad_vort_mag_h, & ! Magnitude of vorticity gradient at h-points [L-1 T-1 ~> m-1 s-1] + grad_vort_mag_h_2d, & ! Magnitude of 2d vorticity gradient at h-points [L-1 T-1 ~> m-1 s-1] + grad_div_mag_h, & ! Magnitude of divergence gradient at h-points [L-1 T-1 ~> m-1 s-1] + dudx, dvdy, & ! components in the horizontal tension [T-1 ~> s-1] + grad_vel_mag_h, & ! Magnitude of the velocity gradient tensor squared at h-points [T-2 ~> s-2] + grad_vel_mag_bt_h, & ! Magnitude of the barotropic velocity gradient tensor squared at h-points [T-2 ~> s-2] + grad_d2vel_mag_h, & ! Magnitude of the Laplacian of the velocity vector, squared [L-2 T-2 ~> m-2 s-2] + boundary_mask_h ! A mask that zeroes out cells with at least one land edge [nondim] real, dimension(SZIB_(G),SZJB_(G)) :: & - dvdx, dudy, & ! components in the shearing strain [s-1] + dvdx, dudy, & ! components in the shearing strain [T-1 ~> s-1] dDel2vdx, dDel2udy, & ! Components in the biharmonic equivalent of the shearing strain [L-2 T-1 ~> m-2 s-1] - dvdx_bt, dudy_bt, & ! components in the barotropic shearing strain [s-1] - sh_xy, & ! horizontal shearing strain (du/dy + dv/dx) including metric terms [s-1] - sh_xy_bt, & ! barotropic horizontal shearing strain (du/dy + dv/dx) inc. metric terms [s-1] - str_xy, & ! str_xy is the cross term in the stress tensor [H m2 s-2 ~> m3 s-2 or kg s-2] - str_xy_GME, & ! smoothed cross term in the stress tensor from GME [H m2 s-2] - bhstr_xy, & ! A copy of str_xy that only contains the biharmonic contribution [H m2 s-2 ~> m3 s-2 or kg s-2] - vort_xy, & ! Vertical vorticity (dv/dx - du/dy) including metric terms [s-1] - Leith_Kh_q, & ! Leith Laplacian viscosity at q-points [m2 s-1] - Leith_Ah_q, & ! Leith bi-harmonic viscosity at q-points [m4 s-1] - grad_vort_mag_q, & ! Magnitude of vorticity gradient at q-points [m-1 s-1] - grad_vort_mag_q_2d, & ! Magnitude of 2d vorticity gradient at q-points [m-1 s-1] - grad_div_mag_q, & ! Magnitude of divergence gradient at q-points [m-1 s-1] - grad_vel_mag_q, & ! Magnitude of the velocity gradient tensor squared at q-points [s-2] + dvdx_bt, dudy_bt, & ! components in the barotropic shearing strain [T-1 ~> s-1] + sh_xy, & ! horizontal shearing strain (du/dy + dv/dx) including metric terms [T-1 ~> s-1] + sh_xy_bt, & ! barotropic horizontal shearing strain (du/dy + dv/dx) inc. metric terms [T-1 ~> s-1] + str_xy, & ! str_xy is the cross term in the stress tensor [H L2 T-2 ~> m3 s-2 or kg s-2] + str_xy_GME, & ! smoothed cross term in the stress tensor from GME [H L2 T-2 ~> m3 s-2 or kg s-2] + bhstr_xy, & ! A copy of str_xy that only contains the biharmonic contribution [H L2 T-2 ~> m3 s-2 or kg s-2] + vort_xy, & ! Vertical vorticity (dv/dx - du/dy) including metric terms [T-1 ~> s-1] + Leith_Kh_q, & ! Leith Laplacian viscosity at q-points [L2 T-1 ~> m2 s-1] + Leith_Ah_q, & ! Leith bi-harmonic viscosity at q-points [L4 T-1 ~> m4 s-1] + grad_vort_mag_q, & ! Magnitude of vorticity gradient at q-points [L-1 T-1 ~> m-1 s-1] + grad_vort_mag_q_2d, & ! Magnitude of 2d vorticity gradient at q-points [L-1 T-1 ~> m-1 s-1] + grad_div_mag_q, & ! Magnitude of divergence gradient at q-points [L-1 T-1 ~> m-1 s-1] + grad_vel_mag_q, & ! Magnitude of the velocity gradient tensor squared at q-points [T-2 ~> s-2] hq, & ! harmonic mean of the harmonic means of the u- & v point thicknesses [H ~> m or kg m-2] ! This form guarantees that hq/hu < 4. - grad_vel_mag_bt_q, & ! Magnitude of the barotropic velocity gradient tensor squared at q-points [s-2] - boundary_mask_q ! A mask that zeroes out cells with at least one land edge + grad_vel_mag_bt_q, & ! Magnitude of the barotropic velocity gradient tensor squared at q-points [T-2 ~> s-2] + boundary_mask_q ! A mask that zeroes out cells with at least one land edge [nondim] real, dimension(SZIB_(G),SZJB_(G),SZK_(G)) :: & - Ah_q, & ! biharmonic viscosity at corner points [m4 s-1] - Kh_q, & ! Laplacian viscosity at corner points [m2 s-1] - vort_xy_q, & ! vertical vorticity at corner points [s-1] - GME_coeff_q, & !< GME coeff. at q-points [m2 s-1] - max_diss_rate_q ! maximum possible energy dissipated by lateral friction [m2 s-3] + Ah_q, & ! biharmonic viscosity at corner points [L4 T-1 ~> m4 s-1] + Kh_q, & ! Laplacian viscosity at corner points [L2 T-1 ~> m2 s-1] + vort_xy_q, & ! vertical vorticity at corner points [T-1 ~> s-1] + GME_coeff_q, & !< GME coeff. at q-points [L2 T-1 ~> m2 s-1] + max_diss_rate_q ! maximum possible energy dissipated by lateral friction [L2 T-3 ~> m2 s-3] real, dimension(SZIB_(G),SZJ_(G),SZK_(G)+1) :: & - KH_u_GME !< interface height diffusivities in u-columns [m2 s-1] + KH_u_GME !< interface height diffusivities in u-columns [L2 T-1 ~> m2 s-1] real, dimension(SZI_(G),SZJB_(G),SZK_(G)+1) :: & - KH_v_GME !< interface height diffusivities in v-columns [m2 s-1] + KH_v_GME !< interface height diffusivities in v-columns [L2 T-1 ~> m2 s-1] real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & - Ah_h, & ! biharmonic viscosity at thickness points [m4 s-1] - Kh_h, & ! Laplacian viscosity at thickness points [m2 s-1] - diss_rate, & ! MKE dissipated by parameterized shear production [m2 s-3] - max_diss_rate_h, & ! maximum possible energy dissipated by lateral friction [m2 s-3] + Ah_h, & ! biharmonic viscosity at thickness points [L4 T-1 ~> m4 s-1] + Kh_h, & ! Laplacian viscosity at thickness points [L2 T-1 ~> m2 s-1] + diss_rate, & ! MKE dissipated by parameterized shear production [L2 T-3 ~> m2 s-3] + max_diss_rate_h, & ! maximum possible energy dissipated by lateral friction [L2 T-3 ~> m2 s-3] target_diss_rate_GME, & ! the maximum theoretical dissipation plus the amount spuriously dissipated - ! by friction [m2 s-3] + ! by friction [L2 T-3 ~> m2 s-3] FrictWork, & ! work done by MKE dissipation mechanisms [W m-2] FrictWork_GME, & ! work done by GME [W m-2] - div_xx_h ! horizontal divergence [s-1] + div_xx_h ! horizontal divergence [T-1 ~> s-1] real, dimension(SZI_(G),SZJ_(G),SZK_(G)) :: & GME_coeff_h !< GME coeff. at h-points [L2 T-1 ~> m2 s-1] real :: Ah ! biharmonic viscosity [L4 T-1 ~> m4 s-1] From 80743e6cbbbe70092a65c87e833bd953dc30fe19 Mon Sep 17 00:00:00 2001 From: "jessica.meixner" Date: Fri, 25 Oct 2019 12:43:06 -0400 Subject: [PATCH 2/6] Adding river runoff (from Jiande) Squashed commit of the following: commit 8aa45c6a0cc8bbf98c0e823a8994a4d0383e3d0b Author: jiandewang Date: Mon Sep 23 22:45:46 2019 -0400 fix typo in cap commit ad85f5a9aefe57ff790ee9afe81624494c5dd987 Merge: 4f71b04 c7d2a71 Author: jiandewang Date: Mon Sep 23 13:48:07 2019 -0400 solve conflict in mom cap commit 4f71b04369a1be10b4f8ac9f446512ee108d63cb Author: jiandewang Date: Sat Aug 17 21:08:44 2019 -0400 add ifndef CESMCOUPLED in cap for EMC runoff commit 258a19c7e86a863979cc9e8feb1b789e6c1f6fce Author: jiandewang Date: Sun Aug 4 19:30:08 2019 -0400 add runoff in mom_cap.F90 --- config_src/nuopc_driver/mom_cap.F90 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index 1aeaaa7a3a..3b36628b9a 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -313,6 +313,7 @@ !> This module contains a set of subroutines that are required by NUOPC. module MOM_cap_mod use constants_mod, only: constants_init +use data_override_mod, only: data_override_init, data_override use diag_manager_mod, only: diag_manager_init, diag_manager_end use field_manager_mod, only: field_manager_init, field_manager_end use fms_mod, only: fms_init, fms_end, open_namelist_file, check_nml_error @@ -976,6 +977,11 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call ocean_model_init(ocean_public, ocean_state, Time, Time) endif +#ifndef CESMCOUPLED +! for runoff in EMC + call data_override_init(Ocean_domain_in = Ocean_public%domain) +#endif + call ocean_model_init_sfc(ocean_state, ocean_public) call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec) @@ -1922,6 +1928,8 @@ subroutine ModelAdvance(gcomp, rc) file=__FILE__)) & return ! bail out + call ice_ocn_bnd_from_data(Ice_ocean_boundary, Time, Time_step_coupled) ! for runoff + !--------------- ! Update MOM6 !--------------- @@ -2525,4 +2533,18 @@ subroutine shr_file_getLogUnit(nunit) end subroutine shr_file_getLogUnit #endif -end module MOM_cap_mod + subroutine ice_ocn_bnd_from_data(x, Time, Time_step_coupled) +! get forcing data from data_overide + type (ice_ocean_boundary_type) :: x + type(Time_type), intent(in) :: Time, Time_step_coupled + + type(Time_type) :: Time_next + character(len=*),parameter :: subname='(mom_cap:ice_ocn_bnd_from_data)' + + Time_next = Time + Time_step_coupled +! call data_override('OCN', 'runoff', x%runoff , Time_next) + call data_override('OCN', 'runoff', x%rofl_flux , Time_next) + + end subroutine ice_ocn_bnd_from_data + +end module mom_cap_mod From 07481e41d7ac400a5682b186da97670651ec09ba Mon Sep 17 00:00:00 2001 From: "Jessica.Meixner" Date: Fri, 8 Nov 2019 16:51:23 +0000 Subject: [PATCH 3/6] updating mom_cap to add data override which was deleted in merge --- config_src/nuopc_driver/mom_cap.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index ef3766d2ba..804dacce9e 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -41,6 +41,7 @@ module MOM_cap_mod use shr_file_mod, only: shr_file_setLogUnit, shr_file_getLogUnit #endif use time_utils_mod, only: esmf2fms_time +use data_override_mod, only: data_override_init, data_override use, intrinsic :: iso_fortran_env, only: output_unit From 419a021d90d1fcd4aba523c41605ce89f673db0c Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Sat, 16 Nov 2019 14:25:46 +0000 Subject: [PATCH 4/6] removes data_override and associated calls from mom_cap renames: iob%rofl_flux => iob%lrunoff iob%rofi_flux => iob%frunoff iob%runoff_hflx = > iob%lrunoff_hflx iob%calving_hflx => iob%frunoff_hflx makes changes in mom_cap_methods and mom_surface_forcing_nuopc consistent w/ new iob names temporarily comments out _hflx terms in mom_cap,mom_cap_methods adds flag in mom_surface_forcing_nuopc for adding liquid river runoff via data_override --- config_src/nuopc_driver/mom_cap.F90 | 42 +++--------- config_src/nuopc_driver/mom_cap_methods.F90 | 66 +++++++------------ .../mom_surface_forcing_nuopc.F90 | 50 ++++++++------ 3 files changed, 59 insertions(+), 99 deletions(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index 804dacce9e..50df123264 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -41,7 +41,6 @@ module MOM_cap_mod use shr_file_mod, only: shr_file_setLogUnit, shr_file_getLogUnit #endif use time_utils_mod, only: esmf2fms_time -use data_override_mod, only: data_override_init, data_override use, intrinsic :: iso_fortran_env, only: output_unit @@ -689,11 +688,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) ocean_public%is_ocean_pe = .true. call ocean_model_init(ocean_public, ocean_state, time0, time_start, input_restart_file=trim(restartfile)) -#ifndef CESMCOUPLED -! for runoff in EMC - call data_override_init(Ocean_domain_in = Ocean_public%domain) -#endif - call ocean_model_init_sfc(ocean_state, ocean_public) call mpp_get_compute_domain(ocean_public%domain, isc, iec, jsc, jec) @@ -714,12 +708,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) Ice_ocean_boundary% seaice_melt (isc:iec,jsc:jec), & Ice_ocean_boundary% mi (isc:iec,jsc:jec), & Ice_ocean_boundary% p (isc:iec,jsc:jec), & - Ice_ocean_boundary% runoff (isc:iec,jsc:jec), & - Ice_ocean_boundary% calving (isc:iec,jsc:jec), & - Ice_ocean_boundary% runoff_hflx (isc:iec,jsc:jec), & - Ice_ocean_boundary% calving_hflx (isc:iec,jsc:jec), & - Ice_ocean_boundary% rofl_flux (isc:iec,jsc:jec), & - Ice_ocean_boundary% rofi_flux (isc:iec,jsc:jec)) + !Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), & + !Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), & + Ice_ocean_boundary% lrunoff (isc:iec,jsc:jec), & + Ice_ocean_boundary% frunoff (isc:iec,jsc:jec)) Ice_ocean_boundary%u_flux = 0.0 Ice_ocean_boundary%v_flux = 0.0 @@ -737,12 +729,10 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) Ice_ocean_boundary%seaice_melt_heat= 0.0 Ice_ocean_boundary%mi = 0.0 Ice_ocean_boundary%p = 0.0 - Ice_ocean_boundary%runoff = 0.0 - Ice_ocean_boundary%calving = 0.0 - Ice_ocean_boundary%runoff_hflx = 0.0 - Ice_ocean_boundary%calving_hflx = 0.0 - Ice_ocean_boundary%rofl_flux = 0.0 - Ice_ocean_boundary%rofi_flux = 0.0 + !Ice_ocean_boundary%lrunoff_hflx = 0.0 + !Ice_ocean_boundary%frunoff_hflx = 0.0 + Ice_ocean_boundary%lrunoff = 0.0 + Ice_ocean_boundary%frunoff = 0.0 ocean_internalstate%ptr%ocean_state_type_ptr => ocean_state call ESMF_GridCompSetInternalState(gcomp, ocean_internalstate, rc) @@ -787,8 +777,6 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_fresh_water_to_ocean_rate", "will provide") call fld_list_add(fldsToOcn_num, fldsToOcn, "net_heat_flx_to_ocn" , "will provide") - !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_rate" , "will provide") - !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_rate" , "will provide") !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide") !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide") @@ -2332,20 +2320,6 @@ subroutine shr_file_getLogUnit(nunit) end subroutine shr_file_getLogUnit #endif - subroutine ice_ocn_bnd_from_data(x, Time, Time_step_coupled) -! get forcing data from data_overide - type (ice_ocean_boundary_type) :: x - type(Time_type), intent(in) :: Time, Time_step_coupled - - type(Time_type) :: Time_next - character(len=*),parameter :: subname='(mom_cap:ice_ocn_bnd_from_data)' - - Time_next = Time + Time_step_coupled -! call data_override('OCN', 'runoff', x%runoff , Time_next) - call data_override('OCN', 'runoff', x%rofl_flux , Time_next) - - end subroutine ice_ocn_bnd_from_data - !> !! @page nuopc_cap NUOPC Cap !! @author Fei Liu (fei.liu@gmail.com) diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index 2f872c7da5..9d1278f25d 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -214,68 +214,46 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, return ! bail out !---- - ! runoff and heat content of runoff + ! mass and heat content of liquid and frozen runoff !---- ! Note - preset values to 0, if field does not exist in importState, then will simply return ! and preset value will be used ! liquid runoff - ice_ocean_boundary%rofl_flux (:,:) = 0._ESMF_KIND_R8 + ice_ocean_boundary%lrunoff (:,:) = 0._ESMF_KIND_R8 call state_getimport(importState, 'Foxx_rofl', & - isc, iec, jsc, jec, ice_ocean_boundary%rofl_flux,rc=rc) + isc, iec, jsc, jec, ice_ocean_boundary%lrunoff,rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & return ! bail out ! ice runoff - ice_ocean_boundary%rofi_flux (:,:) = 0._ESMF_KIND_R8 + ice_ocean_boundary%frunoff (:,:) = 0._ESMF_KIND_R8 call state_getimport(importState, 'Foxx_rofi', & - isc, iec, jsc, jec, ice_ocean_boundary%rofi_flux,rc=rc) + isc, iec, jsc, jec, ice_ocean_boundary%frunoff,rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & file=__FILE__)) & return ! bail out - ! total runoff - ice_ocean_boundary%runoff (:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'mean_runoff_rate', & - isc, iec, jsc, jec, ice_ocean_boundary%runoff, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, & - file=__FILE__)) & - return ! bail out - - ! heat content of runoff - ice_ocean_boundary%runoff_hflx(:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'mean_runoff_heat_flux', & - isc, iec, jsc, jec, ice_ocean_boundary%runoff_hflx, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, & - file=__FILE__)) & - return ! bail out - - !---- - ! calving rate and heat flux - !---- - ! Note - preset values to 0, if field does not exist in importState, then will simply return - ! and preset value will be used - - ice_ocean_boundary%calving(:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'mean_calving_rate', & - isc, iec, jsc, jec, ice_ocean_boundary%calving, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, & - file=__FILE__)) & - return ! bail out - - ice_ocean_boundary%calving_hflx(:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'mean_calving_heat_flux', & - isc, iec, jsc, jec, ice_ocean_boundary%calving_hflx, rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, & - file=__FILE__)) & - return ! bail out + ! heat content of lrunoff + !ice_ocean_boundary%lrunoff_hflx(:,:) = 0._ESMF_KIND_R8 + !call state_getimport(importState, 'liquid_runoff_heat_flx', & + ! isc, iec, jsc, jec, ice_ocean_boundary%lrunoff_hflx, rc=rc) + !if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + ! line=__LINE__, & + ! file=__FILE__)) & + ! return ! bail out + + ! heat content of frunoff + !ice_ocean_boundary%frunoff_hflx(:,:) = 0._ESMF_KIND_R8 + !call state_getimport(importState, 'frozen_runoff_heat_flx', & + ! isc, iec, jsc, jec, ice_ocean_boundary%frunoff_hflx, rc=rc) + !if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + ! line=__LINE__, & + ! file=__FILE__)) & + ! return ! bail out !---- ! salt flux from ice diff --git a/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 index ba6760ffa4..4ad84b353c 100644 --- a/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 +++ b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 @@ -107,6 +107,7 @@ module MOM_surface_forcing_nuopc !! sea-ice viscosity becomes effective, in kg m-2, !! typically of order 1000 [kg m-2]. logical :: allow_flux_adjustments !< If true, use data_override to obtain flux adjustments + logical :: liquid_runoff_from_data !< If true, use data_override to obtain liquid runoff real :: Flux_const !< piston velocity for surface restoring [m/s] logical :: salt_restore_as_sflux !< If true, SSS restore as salt flux instead of water flux @@ -152,8 +153,8 @@ module MOM_surface_forcing_nuopc !> Structure corresponding to forcing, but with the elements, units, and conventions !! that exactly conform to the use for MOM-based coupled models. type, public :: ice_ocean_boundary_type - real, pointer, dimension(:,:) :: rofl_flux =>NULL() !< liquid runoff [kg/m2/s] - real, pointer, dimension(:,:) :: rofi_flux =>NULL() !< ice runoff [kg/m2/s] + real, pointer, dimension(:,:) :: lrunoff =>NULL() !< liquid runoff [kg/m2/s] + real, pointer, dimension(:,:) :: frunoff =>NULL() !< ice runoff [kg/m2/s] real, pointer, dimension(:,:) :: u_flux =>NULL() !< i-direction wind stress [Pa] real, pointer, dimension(:,:) :: v_flux =>NULL() !< j-direction wind stress [Pa] real, pointer, dimension(:,:) :: t_flux =>NULL() !< sensible heat flux [W/m2] @@ -168,13 +169,11 @@ module MOM_surface_forcing_nuopc real, pointer, dimension(:,:) :: sw_flux_nir_dif =>NULL() !< diffuse Near InfraRed sw radiation [W/m2] real, pointer, dimension(:,:) :: lprec =>NULL() !< mass flux of liquid precip [kg/m2/s] real, pointer, dimension(:,:) :: fprec =>NULL() !< mass flux of frozen precip [kg/m2/s] - real, pointer, dimension(:,:) :: runoff =>NULL() !< mass flux of liquid runoff [kg/m2/s] - real, pointer, dimension(:,:) :: calving =>NULL() !< mass flux of frozen runoff [kg/m2/s] real, pointer, dimension(:,:) :: ustar_berg =>NULL() !< frictional velocity beneath icebergs [m/s] real, pointer, dimension(:,:) :: area_berg =>NULL() !< area covered by icebergs[m2/m2] real, pointer, dimension(:,:) :: mass_berg =>NULL() !< mass of icebergs(kg/m2) - real, pointer, dimension(:,:) :: runoff_hflx =>NULL() !< heat content of liquid runoff [W/m2] - real, pointer, dimension(:,:) :: calving_hflx =>NULL() !< heat content of frozen runoff [W/m2] + !real, pointer, dimension(:,:) :: lrunoff_hflx =>NULL() !< heat content of liquid runoff [W/m2] + !real, pointer, dimension(:,:) :: frunoff_hflx =>NULL() !< heat content of frozen runoff [W/m2] real, pointer, dimension(:,:) :: p =>NULL() !< pressure of overlying ice and atmosphere !< on ocean surface [Pa] real, pointer, dimension(:,:) :: mi =>NULL() !< mass of ice [kg/m2] @@ -411,6 +410,13 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, & enddo ; enddo endif + ! Check that liquid runoff has a place to go + if (CS%liquid_runoff_from_data .and. .not. associated(IOB%lrunoff)) then + call MOM_error(FATAL, "liquid runoff is being added via data_override but "// & + "there is no associated runoff in the IOB%") + return + end if + ! obtain fluxes from IOB; note the staggering of indices i0 = is - isc_bnd ; j0 = js - jsc_bnd do j=js,je ; do i=is,ie @@ -425,17 +431,14 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, & fluxes%evap(i,j) = IOB%q_flux(i-i0,j-j0) * G%mask2dT(i,j) ! liquid runoff flux - if (associated(IOB%rofl_flux)) then - fluxes%lrunoff(i,j) = IOB%rofl_flux(i-i0,j-j0) * G%mask2dT(i,j) - else if (associated(IOB%runoff)) then - fluxes%lrunoff(i,j) = IOB%runoff(i-i0,j-j0) * G%mask2dT(i,j) + if (associated(IOB%lrunoff)) then + if(CS%liquid_runoff_from_data)call data_override('OCN', 'runoff', IOB%lrunoff, Time) + fluxes%lrunoff(i,j) = IOB%lrunoff(i-i0,j-j0) * G%mask2dT(i,j) endif ! ice runoff flux - if (associated(IOB%rofi_flux)) then - fluxes%frunoff(i,j) = IOB%rofi_flux(i-i0,j-j0) * G%mask2dT(i,j) - elseif (associated(IOB%calving)) then - fluxes%frunoff(i,j) = IOB%calving(i-i0,j-j0) * G%mask2dT(i,j) + if (associated(IOB%frunoff)) then + fluxes%frunoff(i,j) = IOB%frunoff(i-i0,j-j0) * G%mask2dT(i,j) endif if (associated(IOB%ustar_berg)) & @@ -447,11 +450,11 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, & if (associated(IOB%mass_berg)) & fluxes%mass_berg(i,j) = IOB%mass_berg(i-i0,j-j0) * G%mask2dT(i,j) - if (associated(IOB%runoff_hflx)) & - fluxes%heat_content_lrunoff(i,j) = IOB%runoff_hflx(i-i0,j-j0) * G%mask2dT(i,j) + if (associated(IOB%lrunoff_hflx)) & + fluxes%heat_content_lrunoff(i,j) = IOB%lrunoff_hflx(i-i0,j-j0) * G%mask2dT(i,j) - if (associated(IOB%calving_hflx)) & - fluxes%heat_content_frunoff(i,j) = IOB%calving_hflx(i-i0,j-j0) * G%mask2dT(i,j) + if (associated(IOB%frunoff_hflx)) & + fluxes%heat_content_frunoff(i,j) = IOB%frunoff_hflx(i-i0,j-j0) * G%mask2dT(i,j) if (associated(IOB%lw_flux)) & fluxes%LW(i,j) = IOB%lw_flux(i-i0,j-j0) * G%mask2dT(i,j) @@ -1262,7 +1265,12 @@ subroutine surface_forcing_init(Time, G, US, param_file, diag, CS, restore_salt, call get_param(param_file, mdl, "ALLOW_FLUX_ADJUSTMENTS", CS%allow_flux_adjustments, & "If true, allows flux adjustments to specified via the "//& "data_table using the component name 'OCN'.", default=.false.) - if (CS%allow_flux_adjustments) then + + call get_param(param_file, mdl, "LIQUID_RUNOFF_FROM_DATA", CS%liquid_runoff_from_data, & + "If true, allows liquid river runoff to be specified via the "//& + "data_table using the component name 'OCN'.", default=.false.) + + if (CS%allow_flux_adjustments .or. CS%liquid_runoff_from_data) then call data_override_init(Ocean_domain_in=G%Domain%mpp_domain) endif @@ -1352,8 +1360,8 @@ subroutine ice_ocn_bnd_type_chksum(id, timestep, iobt) write(outunit,100) 'iobt%sw_flux_nir_dif' , mpp_chksum( iobt%sw_flux_nir_dif) write(outunit,100) 'iobt%lprec ' , mpp_chksum( iobt%lprec ) write(outunit,100) 'iobt%fprec ' , mpp_chksum( iobt%fprec ) - write(outunit,100) 'iobt%runoff ' , mpp_chksum( iobt%runoff ) - write(outunit,100) 'iobt%calving ' , mpp_chksum( iobt%calving ) + write(outunit,100) 'iobt%lrunoff ' , mpp_chksum( iobt%lrunoff ) + write(outunit,100) 'iobt%frunoff ' , mpp_chksum( iobt%frunoff ) write(outunit,100) 'iobt%p ' , mpp_chksum( iobt%p ) if (associated(iobt%ustar_berg)) & write(outunit,100) 'iobt%ustar_berg ' , mpp_chksum( iobt%ustar_berg ) From 64be85f767ee073eedffa207e5766013a6bdd7a6 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Sun, 17 Nov 2019 13:30:03 +0000 Subject: [PATCH 5/6] minor text changes; uncomment runoff heat flux terms; required change made in feature/runoff_names branch of NEMS --- config_src/nuopc_driver/mom_cap.F90 | 16 +++++------ config_src/nuopc_driver/mom_cap_methods.F90 | 28 +++++++++---------- .../mom_surface_forcing_nuopc.F90 | 12 ++++---- 3 files changed, 27 insertions(+), 29 deletions(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index 50df123264..5eb7f2493c 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -708,8 +708,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) Ice_ocean_boundary% seaice_melt (isc:iec,jsc:jec), & Ice_ocean_boundary% mi (isc:iec,jsc:jec), & Ice_ocean_boundary% p (isc:iec,jsc:jec), & - !Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), & - !Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), & + Ice_ocean_boundary% lrunoff_hflx (isc:iec,jsc:jec), & + Ice_ocean_boundary% frunoff_hflx (isc:iec,jsc:jec), & Ice_ocean_boundary% lrunoff (isc:iec,jsc:jec), & Ice_ocean_boundary% frunoff (isc:iec,jsc:jec)) @@ -729,8 +729,8 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) Ice_ocean_boundary%seaice_melt_heat= 0.0 Ice_ocean_boundary%mi = 0.0 Ice_ocean_boundary%p = 0.0 - !Ice_ocean_boundary%lrunoff_hflx = 0.0 - !Ice_ocean_boundary%frunoff_hflx = 0.0 + Ice_ocean_boundary%lrunoff_hflx = 0.0 + Ice_ocean_boundary%frunoff_hflx = 0.0 Ice_ocean_boundary%lrunoff = 0.0 Ice_ocean_boundary%frunoff = 0.0 @@ -776,9 +776,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_rofi" , "will provide") !-> ice runoff call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_fresh_water_to_ocean_rate", "will provide") call fld_list_add(fldsToOcn_num, fldsToOcn, "net_heat_flx_to_ocn" , "will provide") - - !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide") - !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide") + !Requires nuopc dictionary change + call fld_list_add(fldsToOcn_num, fldsToOcn, "liquid_runoff_heat_flx" , "will provide") + call fld_list_add(fldsToOcn_num, fldsToOcn, "frozen_runoff_heat_flx" , "will provide") !--------- export fields ------------- call fld_list_add(fldsFrOcn_num, fldsFrOcn, "ocean_mask" , "will provide") @@ -1715,8 +1715,6 @@ subroutine ModelAdvance(gcomp, rc) file=__FILE__)) & return ! bail out - call ice_ocn_bnd_from_data(Ice_ocean_boundary, Time, Time_step_coupled) ! for runoff - !--------------- ! Update MOM6 !--------------- diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index 9d1278f25d..f8e4ba9d68 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -238,22 +238,22 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, return ! bail out ! heat content of lrunoff - !ice_ocean_boundary%lrunoff_hflx(:,:) = 0._ESMF_KIND_R8 - !call state_getimport(importState, 'liquid_runoff_heat_flx', & - ! isc, iec, jsc, jec, ice_ocean_boundary%lrunoff_hflx, rc=rc) - !if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - ! line=__LINE__, & - ! file=__FILE__)) & - ! return ! bail out + ice_ocean_boundary%lrunoff_hflx(:,:) = 0._ESMF_KIND_R8 + call state_getimport(importState, 'liquid_runoff_heat_flx', & + isc, iec, jsc, jec, ice_ocean_boundary%lrunoff_hflx, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, & + file=__FILE__)) & + return ! bail out ! heat content of frunoff - !ice_ocean_boundary%frunoff_hflx(:,:) = 0._ESMF_KIND_R8 - !call state_getimport(importState, 'frozen_runoff_heat_flx', & - ! isc, iec, jsc, jec, ice_ocean_boundary%frunoff_hflx, rc=rc) - !if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - ! line=__LINE__, & - ! file=__FILE__)) & - ! return ! bail out + ice_ocean_boundary%frunoff_hflx(:,:) = 0._ESMF_KIND_R8 + call state_getimport(importState, 'frozen_runoff_heat_flx', & + isc, iec, jsc, jec, ice_ocean_boundary%frunoff_hflx, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, & + file=__FILE__)) & + return ! bail out !---- ! salt flux from ice diff --git a/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 index 4ad84b353c..af59d7d6ea 100644 --- a/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 +++ b/config_src/nuopc_driver/mom_surface_forcing_nuopc.F90 @@ -172,8 +172,8 @@ module MOM_surface_forcing_nuopc real, pointer, dimension(:,:) :: ustar_berg =>NULL() !< frictional velocity beneath icebergs [m/s] real, pointer, dimension(:,:) :: area_berg =>NULL() !< area covered by icebergs[m2/m2] real, pointer, dimension(:,:) :: mass_berg =>NULL() !< mass of icebergs(kg/m2) - !real, pointer, dimension(:,:) :: lrunoff_hflx =>NULL() !< heat content of liquid runoff [W/m2] - !real, pointer, dimension(:,:) :: frunoff_hflx =>NULL() !< heat content of frozen runoff [W/m2] + real, pointer, dimension(:,:) :: lrunoff_hflx =>NULL() !< heat content of liquid runoff [W/m2] + real, pointer, dimension(:,:) :: frunoff_hflx =>NULL() !< heat content of frozen runoff [W/m2] real, pointer, dimension(:,:) :: p =>NULL() !< pressure of overlying ice and atmosphere !< on ocean surface [Pa] real, pointer, dimension(:,:) :: mi =>NULL() !< mass of ice [kg/m2] @@ -413,7 +413,7 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, & ! Check that liquid runoff has a place to go if (CS%liquid_runoff_from_data .and. .not. associated(IOB%lrunoff)) then call MOM_error(FATAL, "liquid runoff is being added via data_override but "// & - "there is no associated runoff in the IOB%") + "there is no associated runoff in the IOB") return end if @@ -475,9 +475,9 @@ subroutine convert_IOB_to_fluxes(IOB, fluxes, index_bounds, Time, G, US, CS, & fluxes%latent(i,j) = fluxes%latent(i,j) + IOB%fprec(i-i0,j-j0)*CS%latent_heat_fusion fluxes%latent_fprec_diag(i,j) = G%mask2dT(i,j) * IOB%fprec(i-i0,j-j0)*CS%latent_heat_fusion endif - if (associated(IOB%calving)) then - fluxes%latent(i,j) = fluxes%latent(i,j) + IOB%calving(i-i0,j-j0)*CS%latent_heat_fusion - fluxes%latent_frunoff_diag(i,j) = G%mask2dT(i,j) * IOB%calving(i-i0,j-j0)*CS%latent_heat_fusion + if (associated(IOB%frunoff)) then + fluxes%latent(i,j) = fluxes%latent(i,j) + IOB%frunoff(i-i0,j-j0)*CS%latent_heat_fusion + fluxes%latent_frunoff_diag(i,j) = G%mask2dT(i,j) * IOB%frunoff(i-i0,j-j0)*CS%latent_heat_fusion endif if (associated(IOB%q_flux)) then fluxes%latent(i,j) = fluxes%latent(i,j) + IOB%q_flux(i-i0,j-j0)*CS%latent_heat_vapor From b66eafe4e50a7067b607e85935e06a3af2ea06c2 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Wed, 20 Nov 2019 17:07:34 +0000 Subject: [PATCH 6/6] backs out change in standard name for liquid and frozen heat flux since this will require a change in the nuopc field_dictionary. The fields are not currently used. --- config_src/nuopc_driver/mom_cap.F90 | 6 +++--- config_src/nuopc_driver/mom_cap_methods.F90 | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config_src/nuopc_driver/mom_cap.F90 b/config_src/nuopc_driver/mom_cap.F90 index 5eb7f2493c..9d923bf8a3 100644 --- a/config_src/nuopc_driver/mom_cap.F90 +++ b/config_src/nuopc_driver/mom_cap.F90 @@ -776,9 +776,9 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) call fld_list_add(fldsToOcn_num, fldsToOcn, "Foxx_rofi" , "will provide") !-> ice runoff call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_fresh_water_to_ocean_rate", "will provide") call fld_list_add(fldsToOcn_num, fldsToOcn, "net_heat_flx_to_ocn" , "will provide") - !Requires nuopc dictionary change - call fld_list_add(fldsToOcn_num, fldsToOcn, "liquid_runoff_heat_flx" , "will provide") - call fld_list_add(fldsToOcn_num, fldsToOcn, "frozen_runoff_heat_flx" , "will provide") + !These are not currently used and changing requires a nuopc dictionary change + !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_runoff_heat_flx" , "will provide") + !call fld_list_add(fldsToOcn_num, fldsToOcn, "mean_calving_heat_flx" , "will provide") !--------- export fields ------------- call fld_list_add(fldsFrOcn_num, fldsFrOcn, "ocean_mask" , "will provide") diff --git a/config_src/nuopc_driver/mom_cap_methods.F90 b/config_src/nuopc_driver/mom_cap_methods.F90 index f8e4ba9d68..70915d0e95 100644 --- a/config_src/nuopc_driver/mom_cap_methods.F90 +++ b/config_src/nuopc_driver/mom_cap_methods.F90 @@ -239,7 +239,7 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, ! heat content of lrunoff ice_ocean_boundary%lrunoff_hflx(:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'liquid_runoff_heat_flx', & + call state_getimport(importState, 'mean_runoff_heat_flx', & isc, iec, jsc, jec, ice_ocean_boundary%lrunoff_hflx, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, & @@ -248,7 +248,7 @@ subroutine mom_import(ocean_public, ocean_grid, importState, ice_ocean_boundary, ! heat content of frunoff ice_ocean_boundary%frunoff_hflx(:,:) = 0._ESMF_KIND_R8 - call state_getimport(importState, 'frozen_runoff_heat_flx', & + call state_getimport(importState, 'mean_calving_heat_flx', & isc, iec, jsc, jec, ice_ocean_boundary%frunoff_hflx, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, &