From 5f7fbe49d5414013fd36d3f0a3ce0b653d4102a6 Mon Sep 17 00:00:00 2001 From: Peter Thornton Date: Thu, 23 May 2024 19:16:56 -0400 Subject: [PATCH 01/56] Adds a lower limit to stem allocation to avoid negative states The stem:leaf allocation variable can go negative without this limiter, which can cause negative stem carbon pools. --- components/elm/src/biogeochem/AllocationMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/elm/src/biogeochem/AllocationMod.F90 b/components/elm/src/biogeochem/AllocationMod.F90 index 2795fd42c8ed..001ad75d42cc 100644 --- a/components/elm/src/biogeochem/AllocationMod.F90 +++ b/components/elm/src/biogeochem/AllocationMod.F90 @@ -645,7 +645,7 @@ subroutine Allocation1_PlantNPDemand (bounds, num_soilc, filter_soilc, num_soilp if (stem_leaf(ivt(p)) < 0._r8) then if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 + f3 = max((2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4_r8, 0.2_r8) else f3 = max((-1.0_r8*stem_leaf(ivt(p))*2.7_r8)/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - & 300.0_r8))) - 0.4_r8, 0.2_r8) @@ -2118,7 +2118,7 @@ subroutine Allocation3_PlantCNPAlloc (bounds , & if (stem_leaf(ivt(p)) < 0._r8) then if (stem_leaf(ivt(p)) == -1._r8) then - f3 = (2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4 + f3 = max((2.7/(1.0+exp(-0.004*(annsum_npp(p) - 300.0)))) - 0.4_r8, 0.2_r8) else f3 = max((-1.0_r8*stem_leaf(ivt(p))*2.7_r8)/(1.0_r8+exp(-0.004_r8*(annsum_npp(p) - & 300.0_r8))) - 0.4_r8, 0.2_r8) From 00f42a77df75eb2c7f5e6b46934f12c8f9e7cdae Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 11 Sep 2024 13:29:47 -0500 Subject: [PATCH 02/56] Add ICOS30 Wave Mesh. --- cime_config/config_grids.xml | 27 +++++++++++++++++++ .../namelist_defaults_ww3_grid.xml | 6 ++--- .../namelist_defaults_ww3_grid_nml.xml | 4 +-- components/ww3/cime_config/buildnml | 3 ++- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index ddb1df949ac3..715db0fb7049 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -2405,6 +2405,16 @@ EC30to60E2r2 + + ne30np4.pg2 + r05 + IcoswISC30E3r5 + r05 + null + wQU225Icos30E3r5 + IcoswISC30E3r5 + + ne30np4.pg2 ne30np4.pg2 @@ -3476,6 +3486,13 @@ $DIN_LOC_ROOT/share/domains/domain.ocn.wQU225EC30to60E2r2.220224.nc WW3 unstructured QU 225km global grid with EC30to60E2r2 coastlines + + + 97988 + 1 + $DIN_LOC_ROOT/share/domains/domain.ocn.wQU225Icos30E3r5.240910.nc + WW3 unstructured QU 225km global grid with ICOS30 coastlines + @@ -5042,6 +5059,10 @@ cpl/gridmaps/wQU225EC30to60E2r2/map_ne30pg2_TO_wQU225EC30to60E2r2_blin.20220222.nc + + cpl/gridmaps/wQU225Icos30E3r5/map_ne30pg2_to_wQU225Icos30E3r5_esmfbilin.20240910.nc + + cpl/gridmaps/wQU225EC30to60E2r2/map_TL319_TO_wQU225EC30to60E2r2_blin.20220602.nc @@ -5058,6 +5079,12 @@ cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc + + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc + cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc + cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc + + cpl/gridmaps/wQU225EC60to30/map_CFSv2_TO_wQU225EC60to30_blin.20210412.nc diff --git a/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid.xml b/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid.xml index e8bb1d42b243..0e4d46740870 100644 --- a/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid.xml +++ b/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid.xml @@ -11,9 +11,9 @@ variables. Values that depend on the model configuration use attributes to express the dependency. --> -1.07 +1.1 0.035 -50 +36 36 0.5 @@ -30,7 +30,7 @@ attributes to express the dependency. 450.0 30.0 -wQU225EC30to60E2r2 +wQU225Icos30E3r5 ww3_grid_namelists.nml UNST SPHE diff --git a/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid_nml.xml b/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid_nml.xml index 9573b482a45e..9ebe2b4e5059 100644 --- a/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid_nml.xml +++ b/components/ww3/bld/namelist_files/namelist_defaults_ww3_grid_nml.xml @@ -158,8 +158,8 @@ attributes to express the dependency. -obstructions_local.glo_unst.in -obstructions_shadow.glo_unst.in +obstructions_local.rtd.in +obstructions_shadow.rtd.in 1.00 1.00 diff --git a/components/ww3/cime_config/buildnml b/components/ww3/cime_config/buildnml index 3fe5d79d3f8e..c43a521c29cc 100755 --- a/components/ww3/cime_config/buildnml +++ b/components/ww3/cime_config/buildnml @@ -55,7 +55,8 @@ def buildnml(case, caseroot, compname): "wQU225EC60to30sp50x36", "wQU225EC30to60E2r2sp50x36", "wQU225EC30to60E2r2sp36x36", - "wQU225EC30to60E2r2sp25x36") + "wQU225EC30to60E2r2sp25x36", + "wQU225Icos30E3r5sp36x36") expect((wav_grid+wav_spec) in wav_grid_supported, "Combination of WAV_GRID {} and WAV_SPEC {} is not supported in ww3. Choose from: '{}'".format(wav_grid,wav_spec,wav_grid_supported) ) #-------------------------------------------------------------------- From 158d9cec3008839b2733a77b04aebebbacc82586 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 25 Sep 2024 12:44:26 -0500 Subject: [PATCH 03/56] mask out sotkes drift under ice shelves for icos mesh. --- components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F b/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F index 87fb36f2145f..d1fdc41167c4 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F @@ -141,6 +141,8 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim integer, dimension(:), pointer :: & maxLevelCell, minLevelCell, nEdgesOnCell, maxLevelEdgeTop, minLevelEdgeBot + integer, dimension(:), pointer :: landIceMask + real (kind=RKIND), dimension(:), pointer :: & latCell, lonCell, bottomDepth, fCell, & ssh, dcEdge, dvEdge, areaCell, iceFraction, & @@ -241,6 +243,7 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim ! set pointers for fields related to ocean forcing state ! call mpas_pool_get_array(forcingPool, 'iceFraction', iceFraction) + call mpas_pool_get_array(forcingPool, 'landIceMask', landIceMask) call mpas_pool_get_array(forcingPool, 'windSpeed10m', windSpeed10m) call mpas_pool_get_array(forcingPool, 'windStressZonal', windStressZonal) call mpas_pool_get_array(forcingPool, 'windStressMeridional', windStressMeridional) @@ -489,7 +492,8 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim surfaceFrictionVelocity(iCell), & boundaryLayerDepth(iCell), & cvmix_global_params) - else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND) then + else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND & + .and. landIceMask(iCell) .eq. 0) then call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & windStressMeridional(iCell), & surfaceFrictionVelocity(iCell), & @@ -684,7 +688,8 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim surfaceFrictionVelocity(iCell), & boundaryLayerDepth(iCell), & cvmix_global_params) - else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND) then + else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND & + .and. landIceMask(iCell) .eq. 0) then call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & windStressMeridional(iCell), & surfaceFrictionVelocity(iCell), & From 8cbd06e8e16a4970e8159771f0329ddb1b2ac38e Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 12 Sep 2024 11:34:04 -0500 Subject: [PATCH 04/56] add wave-ice remapping files for wQU225Icos30 --- cime_config/config_grids.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 715db0fb7049..2f2c7ff2647f 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -3653,8 +3653,12 @@ ATM2ROF_FMAPNAME ATM2ROF_SMAPNAME ATM2WAV_SMAPNAME + WAV2ATM_SMAPNAME OCN2WAV_SMAPNAME + WAV2OCN_SMAPNAME + WAV2OCN_FMAPNAME ICE2WAV_SMAPNAME + WAV2ICE_SMAPNAME ROF2OCN_LIQ_RMAPNAME ROF2OCN_ICE_RMAPNAME @@ -5061,6 +5065,7 @@ cpl/gridmaps/wQU225Icos30E3r5/map_ne30pg2_to_wQU225Icos30E3r5_esmfbilin.20240910.nc + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_ne30pg2_esmfbilin.20240910.nc @@ -5074,13 +5079,17 @@ + cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_aave.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc + cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfaave.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc From b9a8485674b3639b11568b72afa57de1058b6a26 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 12 Sep 2024 11:45:31 -0500 Subject: [PATCH 05/56] add wav-ocean flux,wav-ice remapping file definitions for ICOS wave mesh --- driver-mct/cime_config/config_component.xml | 34 +++++++ .../cime_config/namelist_definition_drv.xml | 92 ++++++++++++++++++- 2 files changed, 125 insertions(+), 1 deletion(-) diff --git a/driver-mct/cime_config/config_component.xml b/driver-mct/cime_config/config_component.xml index 8cddad0abf89..22383ce6003b 100644 --- a/driver-mct/cime_config/config_component.xml +++ b/driver-mct/cime_config/config_component.xml @@ -1518,6 +1518,23 @@ atm2wav state mapping file decomp type + + char + idmap + run_domain + env_run.xml + wav2atm state mapping file + + + + char + X,Y + Y + run_domain + env_run.xml + wav2atm state mapping file decomp type + + char idmap @@ -2002,6 +2019,23 @@ wav2ocn state mapping file decomp type + + char + idmap + run_domain + env_run.xml + wav2ocn flux mapping file + + + + char + X,Y + X + run_domain + env_run.xml + wav2ocn flux mapping file decomp type + + char idmap diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 982acabe64d8..933a75bceac8 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -4891,7 +4891,7 @@ X - + char mapping @@ -4952,6 +4952,36 @@ + + char + mapping + abs + seq_maps + + atm to wav state mapping file for states + + + $WAV2ATM_SMAPNAME + + + + + char + mapping + seq_maps + + The type of mapping desired, either "source" or "destination" mapping. + X is associated with rearrangement of the source grid to the + destination grid and then local mapping. Y is associated with mapping + on the source grid and then rearrangement and sum to the destination + grid. + + + $WAV2ATM_SMAPTYPE + X + + + char mapping @@ -4982,6 +5012,66 @@ + + char + mapping + abs + seq_maps + + wav to ocn flux mapping file for fluxes + + + $WAV2OCN_FMAPNAME + + + + + char + mapping + seq_maps + + The type of mapping desired, either "source" or "destination" mapping. + X is associated with rearrangement of the source grid to the + destination grid and then local mapping. Y is associated with mapping + on the source grid and then rearrangement and sum to the destination + grid. + + + $WAV2OCN_FMAPTYPE + X + + + + + char + mapping + abs + seq_maps + + wav to ice state mapping file for states + + + $WAV2ICE_SMAPNAME + + + + + char + mapping + seq_maps + + The type of mapping desired, either "source" or "destination" mapping. + X is associated with rearrangement of the source grid to the + destination grid and then local mapping. Y is associated with mapping + on the source grid and then rearrangement and sum to the destination + grid. + + + $WAV2ICE_SMAPTYPE + X + + + char(10) drv_physics From c8b9aa516b68aed97b45173f85050b42939a0f92 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 25 Sep 2024 12:52:09 -0500 Subject: [PATCH 06/56] add wave to ocean FLUX remapper --- driver-mct/main/prep_ocn_mod.F90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index b726b1516b2e..f87b566c6f82 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -66,6 +66,7 @@ module prep_ocn_mod public :: prep_ocn_get_mapper_Sg2o public :: prep_ocn_get_mapper_Fg2o public :: prep_ocn_get_mapper_Sw2o + public :: prep_ocn_get_mapper_Fw2o !-------------------------------------------------------------------------- ! Private interfaces @@ -90,6 +91,7 @@ module prep_ocn_mod type(seq_map), pointer :: mapper_Fg2o type(seq_map), pointer :: mapper_Sg2o type(seq_map), pointer :: mapper_Sw2o + type(seq_map), pointer :: mapper_Fw2o ! attribute vectors type(mct_aVect), pointer :: a2x_ox(:) ! Atm export, ocn grid, cpl pes @@ -190,6 +192,7 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc allocate(mapper_Sg2o) allocate(mapper_Fg2o) allocate(mapper_Sw2o) + allocate(mapper_Fw2o) if (ocn_present) then @@ -382,6 +385,13 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc call seq_map_init_rcfile(mapper_Sw2o, wav(1), ocn(1), & 'seq_maps.rc', 'wav2ocn_smapname:', 'wav2ocn_smaptype:',samegrid_ow, & 'mapper_Sw2o initialization') + if (iamroot_CPLID) then + write(logunit,*) ' ' + write(logunit,F00) 'Initializing mapper_Fw2o' + end if + call seq_map_init_rcfile(mapper_Fw2o, wav(1), ocn(1), & + 'seq_maps.rc', 'wav2ocn_fmapname:', 'wav2ocn_fmaptype:',samegrid_ow, & + 'mapper_Fw2o initialization') endif call shr_sys_flush(logunit) @@ -1446,7 +1456,8 @@ subroutine prep_ocn_calc_w2x_ox(timer) call t_drvstartf (trim(timer),barrier=mpicom_CPLID) do ewi = 1,num_inst_wav w2x_wx => component_get_c2x_cx(wav(ewi)) - call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi), norm=.true.) + call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_states, norm=.true.) + call seq_map_map(mapper_Fw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_fluxes, norm=.true.) enddo call t_drvstopf (trim(timer)) end subroutine prep_ocn_calc_w2x_ox @@ -1547,5 +1558,10 @@ function prep_ocn_get_mapper_Sw2o() type(seq_map), pointer :: prep_ocn_get_mapper_Sw2o prep_ocn_get_mapper_Sw2o => mapper_Sw2o end function prep_ocn_get_mapper_Sw2o + + function prep_ocn_get_mapper_Fw2o() + type(seq_map), pointer :: prep_ocn_get_mapper_Fw2o + prep_ocn_get_mapper_Fw2o => mapper_Fw2o + end function prep_ocn_get_mapper_Fw2o end module prep_ocn_mod From a8e5d2d81bc9ac2db3446f57e7c8ce0c834c147e Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Mon, 30 Sep 2024 16:19:38 -0500 Subject: [PATCH 07/56] remove wav-atm, wav-ice coupling (for future PR) --- cime_config/config_grids.xml | 5 -- driver-mct/cime_config/config_component.xml | 17 ------ .../cime_config/namelist_definition_drv.xml | 60 ------------------- 3 files changed, 82 deletions(-) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 2f2c7ff2647f..13fff49e8232 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -3653,12 +3653,10 @@ ATM2ROF_FMAPNAME ATM2ROF_SMAPNAME ATM2WAV_SMAPNAME - WAV2ATM_SMAPNAME OCN2WAV_SMAPNAME WAV2OCN_SMAPNAME WAV2OCN_FMAPNAME ICE2WAV_SMAPNAME - WAV2ICE_SMAPNAME ROF2OCN_LIQ_RMAPNAME ROF2OCN_ICE_RMAPNAME @@ -5065,7 +5063,6 @@ cpl/gridmaps/wQU225Icos30E3r5/map_ne30pg2_to_wQU225Icos30E3r5_esmfbilin.20240910.nc - cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_ne30pg2_esmfbilin.20240910.nc @@ -5081,7 +5078,6 @@ cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_aave.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc - cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc @@ -5089,7 +5085,6 @@ cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfaave.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc - cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc diff --git a/driver-mct/cime_config/config_component.xml b/driver-mct/cime_config/config_component.xml index 22383ce6003b..b917809f6fab 100644 --- a/driver-mct/cime_config/config_component.xml +++ b/driver-mct/cime_config/config_component.xml @@ -1518,23 +1518,6 @@ atm2wav state mapping file decomp type - - char - idmap - run_domain - env_run.xml - wav2atm state mapping file - - - - char - X,Y - Y - run_domain - env_run.xml - wav2atm state mapping file decomp type - - char idmap diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 933a75bceac8..efb24402e789 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -4952,36 +4952,6 @@ - - char - mapping - abs - seq_maps - - atm to wav state mapping file for states - - - $WAV2ATM_SMAPNAME - - - - - char - mapping - seq_maps - - The type of mapping desired, either "source" or "destination" mapping. - X is associated with rearrangement of the source grid to the - destination grid and then local mapping. Y is associated with mapping - on the source grid and then rearrangement and sum to the destination - grid. - - - $WAV2ATM_SMAPTYPE - X - - - char mapping @@ -5042,36 +5012,6 @@ - - char - mapping - abs - seq_maps - - wav to ice state mapping file for states - - - $WAV2ICE_SMAPNAME - - - - - char - mapping - seq_maps - - The type of mapping desired, either "source" or "destination" mapping. - X is associated with rearrangement of the source grid to the - destination grid and then local mapping. Y is associated with mapping - on the source grid and then rearrangement and sum to the destination - grid. - - - $WAV2ICE_SMAPTYPE - X - - - char(10) drv_physics From 2b820160aaeb0cc927600b2b0df5e0f7b514ceb9 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 1 Oct 2024 10:51:36 -0500 Subject: [PATCH 08/56] remove seq_map_map call for wave to ocn fluxes (no fluxes coupled yet) --- driver-mct/main/prep_ocn_mod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index f87b566c6f82..6577f1c60346 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -1457,7 +1457,6 @@ subroutine prep_ocn_calc_w2x_ox(timer) do ewi = 1,num_inst_wav w2x_wx => component_get_c2x_cx(wav(ewi)) call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_states, norm=.true.) - call seq_map_map(mapper_Fw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_fluxes, norm=.true.) enddo call t_drvstopf (trim(timer)) end subroutine prep_ocn_calc_w2x_ox From f346119098588ad6e895aa4fe01aa5f83ce27a13 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 1 Oct 2024 11:16:43 -0500 Subject: [PATCH 09/56] add B case ICOS test to wav_developer test suite --- cime_config/tests.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cime_config/tests.py b/cime_config/tests.py index 37812cf51ea0..eeeef1454078 100644 --- a/cime_config/tests.py +++ b/cime_config/tests.py @@ -826,6 +826,10 @@ "PEM.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", "PET.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", "SMS_D_Ln3.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", + "ERS.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", + "PEM.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", + "PET.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", + "SMS_D_Ln3.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", ) }, From b1a35ff19682eca0fb2e54528e5778dc49285881 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 22 Oct 2024 10:46:03 -0500 Subject: [PATCH 10/56] trim down wav dev test suite --- cime_config/tests.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/cime_config/tests.py b/cime_config/tests.py index eeeef1454078..a72c4376f0b7 100644 --- a/cime_config/tests.py +++ b/cime_config/tests.py @@ -822,9 +822,6 @@ "e3sm_wav_developer" : { "time" : "0:45:00", "tests" : ( - "ERS.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", - "PEM.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", - "PET.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", "SMS_D_Ln3.TL319_EC30to60E2r2_wQU225EC30to60E2r2.GMPAS-JRA1p5-WW3.ww3-jra_1958", "ERS.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", "PEM.ne30pg2_IcoswISC30E3r5_wQU225Icos30E3r5.WCYCL1850-WW3", From 0404047801048cae81beb9e7d7d52fcd7c1c64ed Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Mon, 28 Oct 2024 11:06:55 -0500 Subject: [PATCH 11/56] correction to langmuir mixing logic for LandIce Mask. --- .../src/shared/mpas_ocn_vmix_cvmix.F | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F b/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F index d1fdc41167c4..c059fd5e9ca4 100644 --- a/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F +++ b/components/mpas-ocean/src/shared/mpas_ocn_vmix_cvmix.F @@ -142,6 +142,7 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim maxLevelCell, minLevelCell, nEdgesOnCell, maxLevelEdgeTop, minLevelEdgeBot integer, dimension(:), pointer :: landIceMask + integer :: landIceMaskValue real (kind=RKIND), dimension(:), pointer :: & latCell, lonCell, bottomDepth, fCell, & @@ -482,19 +483,25 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim Nsqr_iface(k:maxLevelCell(iCell)+1) = Nsqr_iface(k-1) ! compute Langmuir number and Langmuir enhancement factor - if (config_cvmix_kpp_use_theory_wave .and. iceFraction(iCell) .lt. 0.05_RKIND) then - langmuirNumber(iCell) = sqrt(surfaceFrictionVelocity(iCell) / ( & + if (associated(landIceMask)) then + landIceMaskValue = landIceMask(iCell) + else + landIceMaskValue = 0 + endif + + if ( landIceMaskValue .eq. 0 .and. iceFraction(iCell) .lt. 0.05_RKIND) then + if (config_cvmix_kpp_use_theory_wave) then + langmuirNumber(iCell) = sqrt(surfaceFrictionVelocity(iCell) / ( & cvmix_kpp_ustokes_SL_model(windSpeed10m(iCell), & boundaryLayerDepth(iCell), & cvmix_global_params)+1e-15_RKIND) ) - langmuirEnhancementFactor = & + langmuirEnhancementFactor = & cvmix_kpp_EFactor_model(windSpeed10m(iCell), & surfaceFrictionVelocity(iCell), & boundaryLayerDepth(iCell), & cvmix_global_params) - else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND & - .and. landIceMask(iCell) .eq. 0) then - call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & + else if (config_cvmix_kpp_use_active_wave) then + call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & windStressMeridional(iCell), & surfaceFrictionVelocity(iCell), & significantWaveHeight(iCell), & @@ -503,9 +510,10 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim stokesDriftMeridionalWavenumber(:,iCell), & alphaAngle, & langmuirNumber(iCell)) - call ocn_stokes_drift_kpp_enhancement_factor(alphaAngle, & + call ocn_stokes_drift_kpp_enhancement_factor(alphaAngle, & langmuirNumber(iCell), & langmuirEnhancementFactor) + endif else ! arbitrarily large Langmuir number langmuirNumber(iCell) = 1.e10_RKIND @@ -682,15 +690,21 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim OBL_depth = boundaryLayerDepth(iCell) ) ! update Langmuir enhancement factor - if (config_cvmix_kpp_use_theory_wave .and. iceFraction(iCell) .lt. 0.05_RKIND) then - langmuirEnhancementFactor = & + if (associated(landIceMask)) then + landIceMaskValue = landIceMask(iCell) + else + landIceMaskValue = 0 + endif + + if (landIceMaskValue .eq. 0 .and. iceFraction(iCell) .lt. 0.05_RKIND) then + if (config_cvmix_kpp_use_theory_wave) then + langmuirEnhancementFactor = & cvmix_kpp_EFactor_model(windSpeed10m(iCell), & surfaceFrictionVelocity(iCell), & boundaryLayerDepth(iCell), & cvmix_global_params) - else if (config_cvmix_kpp_use_active_wave .and. iceFraction(iCell) .lt. 0.05_RKIND & - .and. landIceMask(iCell) .eq. 0) then - call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & + else if (config_cvmix_kpp_use_active_wave) then + call ocn_stokes_drift_langmuir_number(windStressZonal(iCell), & windStressMeridional(iCell), & surfaceFrictionVelocity(iCell), & significantWaveHeight(iCell), & @@ -699,13 +713,13 @@ subroutine ocn_vmix_coefs_cvmix_build(meshPool, statePool, forcingPool, err, tim stokesDriftMeridionalWavenumber(:,iCell), & alphaAngle, & langmuirNumber(iCell)) - call ocn_stokes_drift_kpp_enhancement_factor(alphaAngle, & - langmuirNumber(iCell), & - langmuirEnhancementFactor) + call ocn_stokes_drift_kpp_enhancement_factor(alphaAngle, & + langmuirNumber(iCell), & + langmuirEnhancementFactor) + endif else langmuirEnhancementFactor = 1.0_RKIND - end if - + endif ! call mpas_timer_start('cvmix coeffs kpp', .false.) call cvmix_coeffs_kpp( & Mdiff_out = cvmix_variables % Mdiff_iface(minLevelCell(iCell):maxLevelCell(iCell)+1), & From d9ced4307dfc19dcb295f2ad988bc800e4c30eda Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 10:10:51 -0600 Subject: [PATCH 12/56] cleanup whitespace --- driver-mct/cime_config/namelist_definition_drv.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index efb24402e789..da823f1a8392 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -4891,7 +4891,7 @@ X - + char mapping From 0a87f8badf9f66a309f76240dea20700c579fdf1 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 10:19:32 -0600 Subject: [PATCH 13/56] remove flux wave to ocean remapping (will be done in later PR) --- driver-mct/main/prep_ocn_mod.F90 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index 6577f1c60346..605e0019c869 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -66,7 +66,6 @@ module prep_ocn_mod public :: prep_ocn_get_mapper_Sg2o public :: prep_ocn_get_mapper_Fg2o public :: prep_ocn_get_mapper_Sw2o - public :: prep_ocn_get_mapper_Fw2o !-------------------------------------------------------------------------- ! Private interfaces @@ -91,7 +90,6 @@ module prep_ocn_mod type(seq_map), pointer :: mapper_Fg2o type(seq_map), pointer :: mapper_Sg2o type(seq_map), pointer :: mapper_Sw2o - type(seq_map), pointer :: mapper_Fw2o ! attribute vectors type(mct_aVect), pointer :: a2x_ox(:) ! Atm export, ocn grid, cpl pes @@ -192,7 +190,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc allocate(mapper_Sg2o) allocate(mapper_Fg2o) allocate(mapper_Sw2o) - allocate(mapper_Fw2o) if (ocn_present) then @@ -385,13 +382,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc call seq_map_init_rcfile(mapper_Sw2o, wav(1), ocn(1), & 'seq_maps.rc', 'wav2ocn_smapname:', 'wav2ocn_smaptype:',samegrid_ow, & 'mapper_Sw2o initialization') - if (iamroot_CPLID) then - write(logunit,*) ' ' - write(logunit,F00) 'Initializing mapper_Fw2o' - end if - call seq_map_init_rcfile(mapper_Fw2o, wav(1), ocn(1), & - 'seq_maps.rc', 'wav2ocn_fmapname:', 'wav2ocn_fmaptype:',samegrid_ow, & - 'mapper_Fw2o initialization') endif call shr_sys_flush(logunit) @@ -1558,9 +1548,4 @@ function prep_ocn_get_mapper_Sw2o() prep_ocn_get_mapper_Sw2o => mapper_Sw2o end function prep_ocn_get_mapper_Sw2o - function prep_ocn_get_mapper_Fw2o() - type(seq_map), pointer :: prep_ocn_get_mapper_Fw2o - prep_ocn_get_mapper_Fw2o => mapper_Fw2o - end function prep_ocn_get_mapper_Fw2o - end module prep_ocn_mod From 15a544b8ca6e7ab102b1198a2d42b7af4f23bdde Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 10:23:40 -0600 Subject: [PATCH 14/56] remove white space --- driver-mct/main/prep_ocn_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index 605e0019c869..12f36380c838 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -1547,5 +1547,5 @@ function prep_ocn_get_mapper_Sw2o() type(seq_map), pointer :: prep_ocn_get_mapper_Sw2o prep_ocn_get_mapper_Sw2o => mapper_Sw2o end function prep_ocn_get_mapper_Sw2o - + end module prep_ocn_mod From 492554f9140ac90704a34391a0b3548ffb0b9120 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 10:39:18 -0600 Subject: [PATCH 15/56] remove WAV2OCN_FMAPNAME --- cime_config/config_grids.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 13fff49e8232..9ef7dc519923 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -3655,7 +3655,6 @@ ATM2WAV_SMAPNAME OCN2WAV_SMAPNAME WAV2OCN_SMAPNAME - WAV2OCN_FMAPNAME ICE2WAV_SMAPNAME ROF2OCN_LIQ_RMAPNAME @@ -5076,14 +5075,12 @@ - cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_aave.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc - cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfaave.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc From ed5d04fe2797205141dbb69747aa8a5213d01653 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 10:44:51 -0600 Subject: [PATCH 16/56] remove wav to ocean flux remapping --- driver-mct/cime_config/config_component.xml | 17 ----------- .../cime_config/namelist_definition_drv.xml | 30 ------------------- 2 files changed, 47 deletions(-) diff --git a/driver-mct/cime_config/config_component.xml b/driver-mct/cime_config/config_component.xml index b917809f6fab..8cddad0abf89 100644 --- a/driver-mct/cime_config/config_component.xml +++ b/driver-mct/cime_config/config_component.xml @@ -2002,23 +2002,6 @@ wav2ocn state mapping file decomp type - - char - idmap - run_domain - env_run.xml - wav2ocn flux mapping file - - - - char - X,Y - X - run_domain - env_run.xml - wav2ocn flux mapping file decomp type - - char idmap diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index da823f1a8392..982acabe64d8 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -4982,36 +4982,6 @@ - - char - mapping - abs - seq_maps - - wav to ocn flux mapping file for fluxes - - - $WAV2OCN_FMAPNAME - - - - - char - mapping - seq_maps - - The type of mapping desired, either "source" or "destination" mapping. - X is associated with rearrangement of the source grid to the - destination grid and then local mapping. Y is associated with mapping - on the source grid and then rearrangement and sum to the destination - grid. - - - $WAV2OCN_FMAPTYPE - X - - - char(10) drv_physics From abfd3757b68b6e566f67a3dc2e74c24b7c69bca1 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 13:23:49 -0600 Subject: [PATCH 17/56] clean up seq_map_map line for Sw2o --- driver-mct/main/prep_ocn_mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index 12f36380c838..b726b1516b2e 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -1446,7 +1446,7 @@ subroutine prep_ocn_calc_w2x_ox(timer) call t_drvstartf (trim(timer),barrier=mpicom_CPLID) do ewi = 1,num_inst_wav w2x_wx => component_get_c2x_cx(wav(ewi)) - call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_states, norm=.true.) + call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi), norm=.true.) enddo call t_drvstopf (trim(timer)) end subroutine prep_ocn_calc_w2x_ox From 7e7c437a18349f34fcd50cc559205a1c9dfc7561 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 12:49:01 -0600 Subject: [PATCH 18/56] Add wind stress variables for wave momentum coupling to output streams. --- components/mpas-ocean/cime_config/buildnml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index d45d94344fe7..ba70541f2e46 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -974,6 +974,8 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + lines.append(' ') + lines.append(' ') if ocn_bgc in ['eco_only', 'eco_and_dms', 'eco_and_macromolecules', 'eco_and_dms_and_macromolecules']: lines.append(' ') lines.append(' ') @@ -1012,6 +1014,40 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append('') + lines.append('') + lines.append('') + lines.append('') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') lines.append('') lines.append('') lines.append(' Date: Tue, 20 Feb 2024 12:58:16 -0600 Subject: [PATCH 19/56] Add Momentum coupling variables passed from driver to MPAS-O --- components/mpas-ocean/driver/mpaso_cpl_indices.F | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index f099cf8ea46a..9e4822bde2f3 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -132,6 +132,13 @@ module mpaso_cpl_indices integer :: index_x2o_Sw_Hs ! Significant wave height integer :: index_x2o_Sw_Fp ! Peak wave frequency integer :: index_x2o_Sw_Dp ! Peak wave direction + integer :: index_x2o_Sw_Charn !Charnock coefficient accounting for the wave stress + integer :: index_x2o_Faww_Tawx !Wave supported stress + integer :: index_x2o_Faww_Tawy !Wave supported stress + integer :: index_x2o_Fwow_Twox !Wave to Ocean momentum flux + integer :: index_x2o_Fwow_Twoy !Wave to Ocean momentum flux + integer :: index_x2o_Faow_Tocx !Wave Net Ocean momentum flux + integer :: index_x2o_Faow_Tocy !Wave Net Ocean momentum flux ! drv -> glc and internal drv fields @@ -331,6 +338,13 @@ subroutine mpaso_cpl_indices_set( ) index_x2o_Sw_Hs = mct_avect_indexra(x2o,'Sw_Hs') index_x2o_Sw_Fp = mct_avect_indexra(x2o,'Sw_Fp') index_x2o_Sw_Dp = mct_avect_indexra(x2o,'Sw_Dp') + index_x2o_Sw_Charn = mct_avect_indexra(x2o,'Sw_Charn') + index_x2o_Faww_Tawx = mct_avect_indexra(x2o,'Faww_Tawx') + index_x2o_Faww_Tawy = mct_avect_indexra(x2o,'Faww_Tawy') + index_x2o_Fwow_Twox = mct_avect_indexra(x2o,'Fwow_Twox') + index_x2o_Fwow_Twoy = mct_avect_indexra(x2o,'Fwow_Twoy') + index_x2o_Faow_Tocx = mct_avect_indexra(x2o,'Faow_Tocx') + index_x2o_Faow_Tocy = mct_avect_indexra(x2o,'Faow_Tocy') call mct_aVect_clean(x2o) call mct_aVect_clean(o2x) From 90d2f18b536561045d2a25f4d1f13c984354a235 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 13:33:36 -0600 Subject: [PATCH 20/56] Add wave momentum coupling variablesfrom drivert to ocn_comp_mct --- components/mpas-ocean/driver/ocn_comp_mct.F | 83 ++++++++++++++++++++- 1 file changed, 80 insertions(+), 3 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index d1b140563bb7..56a5920a950b 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -1789,9 +1789,16 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ landIceHeatFluxField, & landIceFractionField, & windSpeed10mField, & - significantWaveHeightField, & + significantWaveHeightField, & peakWaveFrequencyField, & - peakWaveDirectionField + peakWaveDirectionField, & + charnockSeaStateField, & + waveSupportedZonalWindStressField, & + waveSupportedMeridionalWindStressField, & + waveToOceanZonalWindStressField, & + waveToOceanMeridionalWindStressField, & + waveNetOceanZonalWindStressField, & + waveNetOceanMeridionalWindStressField !landIcePressureField type (field2DReal), pointer :: iceFluxPhytoCField, & @@ -1843,7 +1850,14 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ windSpeed10m, & significantWaveHeight, & peakWaveFrequency, & - peakWaveDirection + peakWaveDirection, & + charnockSeaState, & + waveSupportedZonalWindStress, & + waveSupportedMeridionalWindStress, & + waveToOceanZonalWindStress, & + waveToOceanMeridionalWindStress, & + waveNetOceanZonalWindStress, & + waveNetOceanMeridionalWindStress !landIcePressure real (kind=RKIND), dimension(:), pointer :: latCell @@ -1930,6 +1944,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ call mpas_pool_get_field(forcingPool, 'significantWaveHeight', significantWaveHeightField) call mpas_pool_get_field(forcingPool, 'peakWaveFrequency', peakWaveFrequencyField) call mpas_pool_get_field(forcingPool, 'peakWaveDirection', peakWaveDirectionField) + call mpas_pool_get_field(forcingPool, 'charnockSeaState', charnockSeaStateField) + call mpas_pool_get_field(forcingPool, 'waveSupportedZonalWindStress', waveSupportedZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveSupportedMeridionalWindStress', waveSupportedMeridionalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveToOceanZonalWindStress', waveToOceanZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveToOceanMeridionalWindStress', waveToOceanMeridionalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveNetOceanZonalWindStress', waveNetOceanZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveNetOceanMeridionalWindStress', waveNetOceanMeridionalWindStressField) call mpas_pool_get_field(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFluxField) call mpas_pool_get_field(forcingPool, 'landIceHeatFlux', landIceHeatFluxField) @@ -1976,6 +1997,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ significantWaveHeight => significantWaveHeightField % array peakWaveFrequency => peakWaveFrequencyField % array peakWaveDirection => peakWaveDirectionField % array + charnockSeaState => charnockSeaStateField % array + waveSupportedZonalWindStress => waveSupportedZonalWindStressField % array + waveSupportedMeridionalWindStress => waveSupportedMeridionalWindStressField % array + waveToOceanZonalWindStress => waveToOceanZonalWindStressField % array + waveToOceanMeridionalWindStress => waveToOceanMeridionalWindStressField % array + waveNetOceanZonalWindStress => waveNetOceanZonalWindStressField % array + waveNetOceanMeridionalWindStress => waveNetOceanMeridionalWindStressField % array !landIcePressure => landIcePressureField % array call mpas_pool_get_array(meshPool, 'latCell', latCell) @@ -2188,6 +2216,27 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ if ( peakWaveDirectionField % isActive ) then peakWaveDirection(i) = x2o_o % rAttr(index_x2o_Sw_Dp, n) end if + if ( charnockSeaStateField % isActive ) then + charnockSeaState(i) = x2o_o % rAttr(index_x2o_Sw_Charn, n) + end if + if ( waveSupportedZonalWindStressField % isActive ) then + waveSupportedZonalWindStress(i) = x2o_o % rAttr(index_x2o_Faww_Tawx, n) + end if + if ( waveSupportedMeridionalWindStressField % isActive ) then + waveSupportedMeridionalWindStress(i) = x2o_o % rAttr(index_x2o_Faww_Tawy, n) + end if + if ( waveToOceanZonalWindStressField % isActive ) then + waveToOceanZonalWindStress(i) = x2o_o % rAttr(index_x2o_Fwow_Twox, n) + end if + if ( waveToOceanMeridionalWindStressField % isActive ) then + waveToOceanMeridionalWindStress(i) = x2o_o % rAttr(index_x2o_Fwow_Twoy, n) + End if + if ( waveNetOceanZonalWindStressField % isActive ) then + waveNetOceanZonalWindStress(i) = x2o_o % rAttr(index_x2o_Faow_Tocx, n) + end if + if ( waveNetOceanMeridionalWindStressField % isActive ) then + waveNetOceanMeridionalWindStress(i) = x2o_o % rAttr(index_x2o_Faow_Tocy, n) + end if if (config_cvmix_kpp_use_theory_wave) then if ( windSpeed10mField% isActive ) then @@ -2365,6 +2414,13 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ call mpas_pool_get_field(forcingPool, 'significantWaveHeight', significantWaveHeightField) call mpas_pool_get_field(forcingPool, 'peakWaveFrequency', peakWaveFrequencyField) call mpas_pool_get_field(forcingPool, 'peakWaveDirection', peakWaveDirectionField) + call mpas_pool_get_field(forcingPool, 'charnockSeaState', charnockSeaStateField) + call mpas_pool_get_field(forcingPool, 'waveSupportedZonalWindStress', waveSupportedZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveSupportedMeridionalWindStress', waveSupportedMeridionalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveToOceanZonalWindStress', waveToOceanZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveToOceanMeridionalWindStress', waveToOceanMeridionalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveNetOceanZonalWindStress', waveNetOceanZonalWindStressField) + call mpas_pool_get_field(forcingPool, 'waveNetOceanMeridionalWindStress', waveNetOceanMeridionalWindStressField) call mpas_pool_get_field(forcingPool, 'landIceFreshwaterFlux', landIceFreshwaterFluxField) call mpas_pool_get_field(forcingPool, 'landIceHeatFlux', landIceHeatFluxField) @@ -2501,6 +2557,27 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ if ( peakWaveDirectionField % isActive ) then call mpas_dmpar_exch_halo_field(peakWaveDirectionField) end if + if ( charnockSeaStateField % isActive ) then + call mpas_dmpar_exch_halo_field(charnockSeaStateField) + end if + if ( waveSupportedZonalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveSupportedZonalWindStressField) + end if + if ( waveSupportedMeridionalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveSupportedMeridionalWindStressField) + end if + if ( waveToOceanZonalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveToOceanZonalWindStressField) + end if + if ( waveToOceanMeridionalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveToOceanMeridionalWindStressField) + end if + if ( waveNetOceanZonalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveNetOceanZonalWindStressField) + end if + if ( waveNetOceanMeridionalWindStressField % isActive ) then + call mpas_dmpar_exch_halo_field(waveNetOceanMeridionalWindStressField) + end if if ( landIceFreshwaterFluxField % isActive ) then call mpas_dmpar_exch_halo_field(landIceFreshwaterFluxField) From bcc07ba481869b2a72262c63f459e57bd7f9e20a Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 13:36:39 -0600 Subject: [PATCH 21/56] add Wave momentum coupling variable to MPAS-O Registry --- components/mpas-ocean/src/Registry.xml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index 2a21e22f40d2..a5e31814f81f 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -3872,6 +3872,34 @@ + + + + + + + Date: Tue, 20 Feb 2024 13:52:19 -0600 Subject: [PATCH 22/56] Add wave to driver momentum coupling variables --- components/ww3/src/cpl/wav_comp_mct.F90 | 29 +++++++++++++++++++--- components/ww3/src/cpl/ww3_cpl_indices.f90 | 14 +++++++++++ 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/components/ww3/src/cpl/wav_comp_mct.F90 b/components/ww3/src/cpl/wav_comp_mct.F90 index d3e6fea347e6..654a7d6407db 100644 --- a/components/ww3/src/cpl/wav_comp_mct.F90 +++ b/components/ww3/src/cpl/wav_comp_mct.F90 @@ -136,7 +136,8 @@ MODULE WAV_COMP_MCT sig, nk, zb, dmin, & usspf use w3wdatmd, only: time, w3ndat, w3setw, wlv, va, ust, ice - use w3adatmd, only: ussp, w3naux, w3seta, sxx, sxy, syy, fliwnd, flcold, dw, cg, wn, hs, fp0, thp0 + use w3adatmd, only: ussp, w3naux, w3seta, sxx, sxy, syy, fliwnd, flcold, dw, cg, wn, hs, fp0, thp0, & + charn, tauwix, tauwiy, tauox, tauoy, tauocx, tauocy use w3idatmd, only: inflags1, inflags2,w3seti, w3ninp USE W3IDATMD, ONLY: TC0, CX0, CY0, TCN, CXN, CYN, ICEP1, ICEP5, TI1, TI5 USE W3IDATMD, ONLY: TW0, WX0, WY0, DT0, TWN, WXN, WYN, DTN @@ -175,7 +176,9 @@ MODULE WAV_COMP_MCT index_w2x_Sw_ustokes_wavenumber_4, index_w2x_Sw_vstokes_wavenumber_4, & index_w2x_Sw_ustokes_wavenumber_5, index_w2x_Sw_vstokes_wavenumber_5, & index_w2x_Sw_ustokes_wavenumber_6, index_w2x_Sw_vstokes_wavenumber_6, & - index_w2x_Sw_Hs, index_w2x_Sw_Fp, index_w2x_Sw_Dp + index_w2x_Sw_Hs, index_w2x_Sw_Fp, index_w2x_Sw_Dp, index_w2x_Sw_Charn, & + index_w2x_Faww_Tawx, index_w2x_Faww_Tawy, index_w2x_Fwow_Twox, & + index_w2x_Fwow_Twoy, index_w2x_Faow_Tocx, index_w2x_Faow_Tocy use shr_sys_mod , only : shr_sys_flush, shr_sys_abort @@ -723,6 +726,7 @@ SUBROUTINE WAV_INIT_MCT( EClock, cdata, x2w_w, w2x_w, NLFilename ) ! F F 6 10 TAUICE TWI Wave to sea ice stress ! F F 6 11 PHICE FIC Wave to sea ice energy flux ! F F 6 12 USSP USP Partitioned surface Stokes drift + ! F F 6 13 TAUOC[X,Y] TOC Total momentum to the ocean ! ------------------------------------------------- ! 7 Wave-bottom layer ! ------------------------------------------------- @@ -1192,6 +1196,10 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) do i = 1,usspf(2) call w3xyrtn(nseal,USSP(1:nseal,i),USSP(1:nseal,nk+i),AnglDL) enddo + ! rotate surface stress variables for momentum coupling + call w3xyrtn(nseal, TAUWIX(1:nseal), TAUWIY(1:nseal), AnglDL) + call w3xyrtn(nseal, TAUOX(1:nseal), TAUOY(1:nseal), AnglDL) + call w3xyrtn(nseal, TAUOCX(1:nseal), TAUOCY(1:nseal), AnglDL) ! copy ww3 data to coupling datatype do jsea=1, nseal @@ -1203,7 +1211,13 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea) w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea) w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea) - + w2x_w%rattr(index_w2x_Sw_Charn,jsea) = CHARN(jsea) + w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 1000*TAUWIX(jsea) !Conversion to N m^{-2} by multiplying by density of water (See eqn 2.99 WW3 Manual) + w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 1000*TAUWIY(jsea) + w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 1000*TAUOX(jsea) + w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 1000*TAUOY(jsea) + w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = TAUOCX(jsea) + w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = TAUOCY(jsea) w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = USSP(jsea,1) w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = USSP(jsea,nk+1) @@ -1225,7 +1239,14 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) else w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0 - + w2x_w%rattr(index_w2x_Sw_Charn,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 0.0 + w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 0.0 + w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 diff --git a/components/ww3/src/cpl/ww3_cpl_indices.f90 b/components/ww3/src/cpl/ww3_cpl_indices.f90 index b40e923d3c83..903a6bda91c6 100644 --- a/components/ww3/src/cpl/ww3_cpl_indices.f90 +++ b/components/ww3/src/cpl/ww3_cpl_indices.f90 @@ -36,6 +36,13 @@ module ww3_cpl_indices integer :: index_w2x_Sw_Hs integer :: index_w2x_Sw_Fp integer :: index_w2x_Sw_Dp + integer :: index_w2x_Sw_Charn + integer :: index_w2x_Faww_Tawx + integer :: index_w2x_Faww_Tawy + integer :: index_w2x_Fwow_Twox + integer :: index_w2x_Fwow_Twoy + integer :: index_w2x_Faow_Tocx + integer :: index_w2x_Faow_Tocy contains @@ -65,6 +72,13 @@ subroutine ww3_cpl_indices_set( ) index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction + index_w2x_Sw_Charn = mct_avect_indexra(w2x,'Sw_Charn') ! Charnock coeff accounting for the wave stress (Janssen 1989, 1991) + index_w2x_Faww_Tawx = mct_avect_indexra(w2x,'Faww_Tawx') ! Zonal Wave supported stress (Stress from atmosphere to waves) + index_w2x_Faww_Tawy = mct_avect_indexra(w2x,'Faww_Tawy') ! Meridional Wave supported stress (Stress from atmosphere to waves) + index_w2x_Fwow_Twox = mct_avect_indexra(w2x,'Fwow_Twox') ! Zonal Wave to ocean stress (Not total ocean momentum stress ) + index_w2x_Fwow_Twoy = mct_avect_indexra(w2x,'Fwow_Twoy') ! MeridionalWave to ocean stress (Not total ocean momentum stress) + index_w2x_Faow_Tocx = mct_avect_indexra(w2x,'Faow_Tocx') ! Zonal Net ocean stress (total ocean momentum stress ) + index_w2x_Faow_Tocy = mct_avect_indexra(w2x,'Faow_Tocy') !Meridional Net ocean stress (total ocean momentum stress) index_w2x_Sw_ustokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_1') ! partitioned Stokes drift u 1 index_w2x_Sw_vstokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_1') ! partitioned Stokes drift v 1 From 5c80426cce6e116028bf9876b6c1a1496b942d57 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 14:00:33 -0600 Subject: [PATCH 23/56] Add wave momentum coupling stress variables to seq_flds_mod --- driver-mct/shr/seq_flds_mod.F90 | 56 +++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index dbfba0889d0c..a3ccdbff3afc 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -2634,6 +2634,62 @@ subroutine seq_flds_set(nmlfile, ID, infodata) attname = 'Sw_Dp' call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_Charn') + call seq_flds_add(x2o_states,'Sw_Charn') + longname = 'Charnock coefficent based on sea state' + stdname = 'Charnock_coefficent_based_on_sea_state' + units = '' + attname = 'Sw_Charn' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Faww_Tawx') + call seq_flds_add(x2o_fluxes,'Faww_Tawx') + longname = 'Zonal wave supported stress' + stdname = 'Zonal_wave_supported_stress' + units = 'N m-2' + attname = 'Faww_Tawx' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Faww_Tawy') + call seq_flds_add(x2o_fluxes,'Faww_Tawy') + longname = 'Meridional wave supported wind stress' + stdname = 'Meridional_wave_supported_wind_stress' + units = 'N m-2' + attname = 'Faww_Tawy' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Fwow_Twox') + call seq_flds_add(x2o_fluxes,'Fwow_Twox') + longname = 'Zonal wave to ocean wind stress' + stdname = 'Zonal_wave_to_ocean_wind_stress' + units = 'N m-2' + attname = 'Fwow_Twox' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Fwow_Twoy') + call seq_flds_add(x2o_fluxes,'Fwow_Twoy') + longname = 'Meridional wave to ocean wind stress' + stdname = 'Meridional_wave_to_ocean_wind_stress' + units = 'N m-2' + attname = 'Fwow_Twoy' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Faow_Tocx') + call seq_flds_add(x2o_fluxes,'Faow_Tocx') + longname = 'Zonal Net ocean wind stress by wave model' + stdname = 'Zonal_net_ocean_wind_stress_wavemodel' + units = 'N m-2' + attname = 'Faow_Tocx' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_fluxes,'Faow_Tocy') + call seq_flds_add(x2o_fluxes,'Faow_Tocy') + longname = 'Meridional Net ocean wind stress by wave model' + stdname = 'Meridional_net_ocean_wind_stress_wavemodel' + units = 'N m-2' + attname = 'Faow_Tocy' + call metadata_set(attname, longname, stdname, units) + !----------------------------- ! New xao_states diagnostic ! fields for history output only From ad013a70087d8368bd8975fa04e6e7e7294c8519 Mon Sep 17 00:00:00 2001 From: Olawale Ikuyajolu Date: Sat, 23 Apr 2022 10:44:40 -0500 Subject: [PATCH 24/56] Add charnock SeaState to shr_flux_mod --- share/util/shr_flux_mod.F90 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/share/util/shr_flux_mod.F90 b/share/util/shr_flux_mod.F90 index cb62a489fde3..7046909ec54b 100644 --- a/share/util/shr_flux_mod.F90 +++ b/share/util/shr_flux_mod.F90 @@ -150,7 +150,7 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & & taux ,tauy ,tref ,qref , & & ocn_surface_flux_scheme, & & duu10n, u10res, ustar_sv ,re_sv ,ssq_sv, & - & missval, wsresp, tau_est, ugust) + & missval, wsresp, tau_est, ugust, charnockSeaState) ! !USES: @@ -205,6 +205,7 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & real(R8),intent(in) ,optional :: wsresp(nMax) ! boundary layer wind response to stress (m/s/Pa) real(R8),intent(in) ,optional :: tau_est(nMax) ! stress in equilibrium with boundary layer (Pa) real(R8),intent(in) ,optional :: ugust(nMax) ! extra wind speed from gustiness (m/s) + real(R8),intent(in) ,optional :: charnockSeaState(nMax) !Charnock coeff accounting for the wave stress (Janssen 1989, 1991) ! !EOP @@ -547,9 +548,9 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & & ,zo,zot,zoq,hol,ustar,tstar,qstar & ! out: ss scales & ,rd,rh,re & ! out: exch. coeffs & ,trf,qrf,urf,vrf & ! out: reference-height params - & ,wsresp(n),tau_est(n)) ! in: optional stress params + & ,wsresp(n),tau_est(n) & ! in: optional stress params for the sake of maintaining same defs + & ,charnockSeaState(n)) ! in: optional charnock sea state -! for the sake of maintaining same defs hol=zbot(n)/hol rd=sqrt(rd) rh=sqrt(rh) @@ -2513,9 +2514,10 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params & ,zo,zot,zoq,L,usr,tsr,qsr & ! out: ss scales & ,Cd,Ch,Ce & ! out: exch. coeffs & ,trf,qrf,urf,vrf & ! out: reference-height params - & ,wsresp,tau_est) ! in: optional stress params + & ,wsresp,tau_est & ! in: optional stress params + & ,charnsea) ! in: optional charnock sea state -! !USES: +!USES: IMPLICIT NONE @@ -2526,6 +2528,8 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params real(R8),intent(out):: tau,hsb,hlb,zo,zot,zoq,L,usr,tsr,qsr,Cd,Ch,Ce & & ,trf,qrf,urf,vrf real(R8),intent(in),optional:: wsresp,tau_est +real(R8),intent(in) ,optional :: charnsea !Charnock coeff accounting for the wave stress (Janssen 1989, 1991) + ! !EOP real(R8) ua,va,ta,q,rb,us,vs,ts,qs,zi,zu,zt,zq,zru,zrq,zrt ! internal vars @@ -2633,13 +2637,14 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params qsr = (dq-dqer*jcool)*von/(log(zq/zot10)-psit_30(zq/L10)) ! parametrisation for Charney parameter (section 3c of Fairall et al. 2003) - charn=0.011_R8 + !charn=0.011_R8 if (ut .GT. 10.0_R8) then - charn=0.011_R8+(ut-10.0_R8)/(18.0_R8-10.0_R8)*(0.018_R8-0.011_R8) + !charn=0.011_R8+(ut-10.0_R8)/(18.0_R8-10.0_R8)*(0.018_R8-0.011_R8) endif if (ut .GT. 18.0_R8) then - charn=0.018_R8 + !charn=0.018_R8 endif + charn = charnsea !use Charnock coefficient accounting for the wave stress (Janssen 1989, 1991) if (present(wsresp) .and. present(tau_est)) prev_tau = tau_est tau_diff = 1.e100_R8 From 6f46f58611fe2293fe0c0729d695a7eac78142b0 Mon Sep 17 00:00:00 2001 From: Olawale Ikuyajolu Date: Sun, 24 Apr 2022 15:42:12 -0500 Subject: [PATCH 25/56] Couple atm and wave through charnock sea state --- driver-mct/main/cime_comp_mod.F90 | 15 +++-- driver-mct/main/prep_atm_mod.F90 | 104 ++++++++++++++++++++++++++++-- driver-mct/main/seq_flux_mct.F90 | 18 +++++- 3 files changed, 124 insertions(+), 13 deletions(-) diff --git a/driver-mct/main/cime_comp_mod.F90 b/driver-mct/main/cime_comp_mod.F90 index 7cf442b9413d..75683e0f3599 100644 --- a/driver-mct/main/cime_comp_mod.F90 +++ b/driver-mct/main/cime_comp_mod.F90 @@ -70,7 +70,7 @@ module cime_comp_mod use seq_comm_mct, only: CPLATMID,CPLLNDID,CPLOCNID,CPLICEID,CPLGLCID,CPLROFID,CPLWAVID,CPLESPID use seq_comm_mct, only: IACID, ALLIACID, CPLALLIACID, CPLIACID use seq_comm_mct, only: num_inst_atm, num_inst_lnd, num_inst_rof - use seq_comm_mct, only: num_inst_ocn, num_inst_ice, num_inst_glc + use seq_comm_mct, only: num_inst_ocn, num_inst_ice, num_inst_glc, num_inst_wav use seq_comm_mct, only: num_inst_wav, num_inst_esp use seq_comm_mct, only: num_inst_iac use seq_comm_mct, only: num_inst_xao, num_inst_frc, num_inst_phys @@ -254,11 +254,13 @@ module cime_comp_mod !- from prep routines (arrays of instances) type(mct_aVect) , pointer :: a2x_ox(:) => null() type(mct_aVect) , pointer :: o2x_ax(:) => null() + type(mct_aVect) , pointer :: w2x_ax(:) => null() type(mct_aVect) , pointer :: xao_ox(:) => null() type(mct_aVect) , pointer :: xao_ax(:) => null() !- from component type (single instance inside array of components) type(mct_aVect) , pointer :: o2x_ox => null() + type(mct_aVect) , pointer :: w2x_ox(:) => null() type(mct_aVect) , pointer :: a2x_ax => null() character(len=CL) :: inst_suffix @@ -433,6 +435,7 @@ module cime_comp_mod logical :: lnd_c2_rof ! .true. => lnd to rof coupling on logical :: lnd_c2_glc ! .true. => lnd to glc coupling on logical :: ocn_c2_atm ! .true. => ocn to atm coupling on + logical :: wav_c2_atm ! .true. => wav to atm coupling on logical :: ocn_c2_ice ! .true. => ocn to ice coupling on logical :: ocn_c2_glcshelf ! .true. => ocn to glc ice shelf coupling on logical :: ocn_c2_wav ! .true. => ocn to wav coupling on @@ -2018,7 +2021,7 @@ subroutine cime_init() call t_adj_detailf(+2) if (drv_threading) call seq_comm_setnthreads(nthreads_CPLID) - call prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_lnd) + call prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_lnd, wav_c2_atm) call prep_lnd_init(infodata, atm_c2_lnd, rof_c2_lnd, glc_c2_lnd, iac_c2_lnd) @@ -3820,11 +3823,13 @@ subroutine cime_run_atmocn_fluxes(hashint) do exi = 1,num_inst_xao eai = mod((exi-1),num_inst_atm) + 1 eoi = mod((exi-1),num_inst_ocn) + 1 + ewi = mod((exi-1),num_inst_wav) + 1 efi = mod((exi-1),num_inst_frc) + 1 a2x_ax => component_get_c2x_cx(atm(eai)) o2x_ax => prep_atm_get_o2x_ax() ! array over all instances + w2x_ax => prep_atm_get_w2x_ax() ! array over all instances xao_ax => prep_aoflux_get_xao_ax() ! array over all instances - call seq_flux_atmocn_mct(infodata, tod, dtime, a2x_ax, o2x_ax(eoi), xao_ax(exi)) + call seq_flux_atmocn_mct(infodata, tod, dtime, a2x_ax, o2x_ax(eoi), xao_ax(exi), w2x_ax(ewi)) enddo call t_drvstopf ('CPL:atmocna_fluxa',hashint=hashint(6)) @@ -3840,10 +3845,12 @@ subroutine cime_run_atmocn_fluxes(hashint) eai = mod((exi-1),num_inst_atm) + 1 eoi = mod((exi-1),num_inst_ocn) + 1 efi = mod((exi-1),num_inst_frc) + 1 + ewi = mod((exi-1),num_inst_wav) + 1 a2x_ox => prep_ocn_get_a2x_ox() + w2x_ox => prep_ocn_get_w2x_ox() o2x_ox => component_get_c2x_cx(ocn(eoi)) xao_ox => prep_aoflux_get_xao_ox() - call seq_flux_atmocn_mct(infodata, tod, dtime, a2x_ox(eai), o2x_ox, xao_ox(exi)) + call seq_flux_atmocn_mct(infodata, tod, dtime, a2x_ox(eai), o2x_ox, xao_ox(exi), w2x_ox(ewi)) enddo call t_drvstopf ('CPL:atmocnp_fluxo',hashint=hashint(6)) endif ! aoflux_grid diff --git a/driver-mct/main/prep_atm_mod.F90 b/driver-mct/main/prep_atm_mod.F90 index c509c9e22b30..f25c7a6a3757 100644 --- a/driver-mct/main/prep_atm_mod.F90 +++ b/driver-mct/main/prep_atm_mod.F90 @@ -4,8 +4,8 @@ module prep_atm_mod use shr_kind_mod, only: cs => SHR_KIND_CS use shr_kind_mod, only: cl => SHR_KIND_CL use shr_sys_mod, only: shr_sys_abort, shr_sys_flush - use seq_comm_mct, only: num_inst_atm, num_inst_ocn, num_inst_ice, num_inst_lnd, num_inst_xao, & - num_inst_frc, num_inst_max, CPLID, ATMID, logunit + use seq_comm_mct, only: num_inst_atm, num_inst_ocn, num_inst_ice, num_inst_lnd, num_inst_wav, & + num_inst_xao, num_inst_frc, num_inst_max, CPLID, ATMID, logunit use seq_comm_mct, only: seq_comm_getData=>seq_comm_setptrs use seq_infodata_mod, only: seq_infodata_type, seq_infodata_getdata use seq_map_type_mod @@ -15,7 +15,7 @@ module prep_atm_mod use mct_mod use perf_mod use component_type_mod, only: component_get_x2c_cx, component_get_c2x_cx - use component_type_mod, only: atm, lnd, ocn, ice + use component_type_mod, only: atm, lnd, ocn, ice, wav implicit none save @@ -31,15 +31,18 @@ module prep_atm_mod public :: prep_atm_get_l2x_ax public :: prep_atm_get_i2x_ax public :: prep_atm_get_o2x_ax + public :: prep_atm_get_w2x_ax public :: prep_atm_get_z2x_ax public :: prep_atm_calc_l2x_ax public :: prep_atm_calc_i2x_ax public :: prep_atm_calc_o2x_ax + public :: prep_atm_calc_w2x_ax public :: prep_atm_calc_z2x_ax public :: prep_atm_get_mapper_So2a public :: prep_atm_get_mapper_Fo2a + public :: prep_atm_get_mapper_Sw2a public :: prep_atm_get_mapper_Sl2a public :: prep_atm_get_mapper_Fl2a public :: prep_atm_get_mapper_Si2a @@ -57,6 +60,7 @@ module prep_atm_mod ! mappers type(seq_map), pointer :: mapper_So2a + type(seq_map), pointer :: mapper_Sw2a type(seq_map), pointer :: mapper_Sl2a type(seq_map), pointer :: mapper_Si2a type(seq_map), pointer :: mapper_Fo2a ! needed for seq_frac_init @@ -67,6 +71,7 @@ module prep_atm_mod type(mct_aVect), pointer :: l2x_ax(:) ! Lnd export, atm grid, cpl pes - allocated in driver type(mct_aVect), pointer :: i2x_ax(:) ! Ice export, atm grid, cpl pes - allocated in driver type(mct_aVect), pointer :: o2x_ax(:) ! Ocn export, atm grid, cpl pes - allocated in driver + type(mct_aVect), pointer :: w2x_ax(:) ! Wav export, atm grid, cpl pes -allocated in driver type(mct_aVect), pointer :: z2x_ax(:) ! Iac export, atm grid, cpl pes - allocated in driver ! other module variables @@ -79,7 +84,7 @@ module prep_atm_mod !================================================================================================ - subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_atm) + subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_atm, wav_c2_atm) !--------------------------------------------------------------- ! Description @@ -91,19 +96,25 @@ subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_at logical , intent(in) :: ice_c2_atm ! .true. => ice to atm coupling on logical , intent(in) :: lnd_c2_atm ! .true. => lnd to atm coupling on logical , intent(in) :: iac_c2_atm ! .true. => iac to atm coupling on + logical , intent(in) :: wav_c2_atm ! .true. => wav to atm coupling on + ! ! Local Variables integer :: lsize_a - integer :: eli, eii, emi + integer :: eli, eii, emi, ewi logical :: samegrid_ao ! samegrid atm and ocean + logical :: samegrid_al ! samegrid atm and land + logical :: samegrid_aw ! samegrid atm and wave logical :: esmf_map_flag ! .true. => use esmf for mapping logical :: atm_present ! .true. => atm is present logical :: ocn_present ! .true. => ocn is present logical :: ice_present ! .true. => ice is present logical :: lnd_present ! .true. => lnd is prsent + logical :: wav_present ! .true. => wav is prsent character(CL) :: ocn_gnam ! ocn grid character(CL) :: atm_gnam ! atm grid character(CL) :: lnd_gnam ! lnd grid + character(CL) :: wav_gnam ! wav grid type(mct_avect), pointer :: a2x_ax character(*), parameter :: subname = '(prep_atm_init)' character(*), parameter :: F00 = "('"//subname//" : ', 4A )" @@ -114,12 +125,15 @@ subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_at ocn_present=ocn_present, & ice_present=ice_present, & lnd_present=lnd_present, & + wav_present=wav_present, & atm_gnam=atm_gnam, & ocn_gnam=ocn_gnam, & lnd_gnam=lnd_gnam, & + wav_gnam=wav_gnam, & esmf_map_flag=esmf_map_flag) allocate(mapper_So2a) + allocate(mapper_Sw2a) allocate(mapper_Sl2a) allocate(mapper_Si2a) allocate(mapper_Fo2a) @@ -144,6 +158,13 @@ subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_at call mct_aVect_init(o2x_ax(emi), rList=seq_flds_o2x_fields, lsize=lsize_a) call mct_aVect_zero(o2x_ax(emi)) enddo + + allocate(w2x_ax(num_inst_wav)) + do ewi = 1,num_inst_wav + call mct_aVect_init(w2x_ax(ewi), rList=seq_flds_w2x_fields,lsize=lsize_a) + call mct_aVect_zero(w2x_ax(ewi)) + end do + allocate(i2x_ax(num_inst_ice)) do eii = 1,num_inst_ice call mct_aVect_init(i2x_ax(eii), rList=seq_flds_i2x_fields, lsize=lsize_a) @@ -152,8 +173,26 @@ subroutine prep_atm_init(infodata, ocn_c2_atm, ice_c2_atm, lnd_c2_atm, iac_c2_at samegrid_al = .true. samegrid_ao = .true. + samegrid_aw = .true. + if (trim(atm_gnam) /= trim(lnd_gnam)) samegrid_al = .false. if (trim(atm_gnam) /= trim(ocn_gnam)) samegrid_ao = .false. + if (trim(atm_gnam) /= trim(wav_gnam)) samegrid_aw = .false. + + + if (wav_c2_atm) then + if (iamroot_CPLID) then + write(logunit,*) ' ' + write(logunit,F00) 'Initializing mapper_Sw2a' + end if + call seq_map_init_rcfile(mapper_Sw2a, wav(1), atm(1), & + 'seq_maps.rc','wav2atm_smapname:','wav2atm_smaptype:',samegrid_aw, & + 'mapper_Sw2a initialization',esmf_map_flag) + end if + + ! needed for domain checking + call shr_sys_flush(logunit) + if (ocn_c2_atm) then if (iamroot_CPLID) then @@ -241,7 +280,7 @@ subroutine prep_atm_mrg(infodata, fractions_ax, xao_ax, timer_mrg) character(len=*) , intent(in) :: timer_mrg ! ! Local Variables - integer :: eli, eoi, eii, exi, efi, eai, emi + integer :: eli, eoi, eii, exi, efi, eai, emi, ewi type(mct_avect), pointer :: x2a_ax character(*), parameter :: subname = '(prep_atm_mrg)' character(*), parameter :: F00 = "('"//subname//" : ', 4A )" @@ -256,6 +295,7 @@ subroutine prep_atm_mrg(infodata, fractions_ax, xao_ax, timer_mrg) exi = mod((eai-1),num_inst_xao) + 1 efi = mod((eai-1),num_inst_frc) + 1 emi = mod((eai-1),num_inst_max) + 1 + ewi = mod((eai-1),num_inst_wav) + 1 x2a_ax => component_get_x2c_cx(atm(eai)) ! This is actually modifying x2a_ax call prep_atm_merge(l2x_ax(eli), o2x_ax(emi), xao_ax(exi), i2x_ax(eii), & @@ -286,6 +326,7 @@ subroutine prep_atm_merge( l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2a_a ) integer :: index_x2a_Sf_lfrac integer :: index_x2a_Sf_ifrac integer :: index_x2a_Sf_ofrac + character(CL),allocatable :: field_atm(:) ! string converted to char character(CL),allocatable :: field_lnd(:) ! string converted to char character(CL),allocatable :: field_ice(:) ! string converted to char @@ -442,6 +483,7 @@ subroutine prep_atm_merge( l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2a_a ) end if end do + ! --- add some checks --- ! --- make sure all terms agree on merge or non-merge aspect --- @@ -463,6 +505,7 @@ subroutine prep_atm_merge( l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2a_a ) write(logunit,*) subname,' ERROR: lindx and oindx merge logic error ',trim(itemc_atm(ka)) call shr_sys_abort(subname//' ERROR lindx and oindx merge logic error') endif + if (xindx(ka) > 0 .and. iindx(ka) > 0 .and. (xmerge(ka) .neqv. imerge(ka))) then write(logunit,*) subname,' ERROR: xindx and iindx merge logic error ',trim(itemc_atm(ka)) call shr_sys_abort(subname//' ERROR xindx and iindx merge logic error') @@ -476,6 +519,7 @@ subroutine prep_atm_merge( l2x_a, o2x_a, xao_a, i2x_a, fractions_a, x2a_a ) call shr_sys_abort(subname//' ERROR iindx and oindx merge logic error') endif + end do end if @@ -706,6 +750,44 @@ subroutine prep_atm_calc_o2x_ax(fractions_ox, timer) end subroutine prep_atm_calc_o2x_ax + + !================================================================================================ + + subroutine prep_atm_calc_w2x_ax(fractions_wx, timer) + !--------------------------------------------------------------- + ! Description + ! Create w2x_ax (note that w2x_ax is a local module variable) + ! + ! Arguments + type(mct_aVect) , optional, intent(in) :: fractions_wx(:) + character(len=*), optional, intent(in) :: timer + ! + ! Local Variables + integer :: eoi, efi, emi, ewi + type(mct_aVect) , pointer :: w2x_ox + character(*), parameter :: subname = '(prep_atm_calc_w2x_ax)' + character(*), parameter :: F00 = "('"//subname//" : ', 4A )" + !--------------------------------------------------------------- + + call t_drvstartf (trim(timer),barrier=mpicom_CPLID) + do emi = 1,num_inst_wav + ewi = mod((emi-1),num_inst_wav) + 1 + efi = mod((emi-1),num_inst_frc) + 1 + + w2x_ox => component_get_c2x_cx(wav(ewi)) + if (present(fractions_wx)) then + call seq_map_map(mapper_Sw2a, w2x_ox, w2x_ax(ewi),& + fldlist=seq_flds_w2x_states,norm=.true., & + avwts_s=fractions_wx(efi),avwtsfld_s='wfrac') + else + call seq_map_map(mapper_Sw2a, w2x_ox, w2x_ax(ewi),& + fldlist=seq_flds_w2x_states,norm=.true.) + endif + enddo + call t_drvstopf (trim(timer)) + + end subroutine prep_atm_calc_w2x_ax + !================================================================================================ subroutine prep_atm_calc_i2x_ax(fractions_ix, timer) @@ -806,6 +888,11 @@ function prep_atm_get_o2x_ax() prep_atm_get_o2x_ax => o2x_ax(:) end function prep_atm_get_o2x_ax + function prep_atm_get_w2x_ax() + type(mct_aVect), pointer :: prep_atm_get_w2x_ax(:) + prep_atm_get_w2x_ax => w2x_ax(:) + end function prep_atm_get_w2x_ax + function prep_atm_get_z2x_ax() type(mct_aVect), pointer :: prep_atm_get_z2x_ax(:) prep_atm_get_z2x_ax => z2x_ax(:) @@ -816,6 +903,11 @@ function prep_atm_get_mapper_So2a() prep_atm_get_mapper_So2a => mapper_So2a end function prep_atm_get_mapper_So2a + function prep_atm_get_mapper_Sw2a() + type(seq_map), pointer :: prep_atm_get_mapper_Sw2a + prep_atm_get_mapper_Sw2a => mapper_Sw2a + end function prep_atm_get_mapper_Sw2a + function prep_atm_get_mapper_Fo2a() type(seq_map), pointer :: prep_atm_get_mapper_Fo2a prep_atm_get_mapper_Fo2a => mapper_Fo2a diff --git a/driver-mct/main/seq_flux_mct.F90 b/driver-mct/main/seq_flux_mct.F90 index 92782264faae..5835e7688dde 100644 --- a/driver-mct/main/seq_flux_mct.F90 +++ b/driver-mct/main/seq_flux_mct.F90 @@ -46,6 +46,7 @@ module seq_flux_mct real(r8), allocatable :: ubot (:) ! atm velocity, zonal real(r8), allocatable :: vbot (:) ! atm velocity, meridional real(r8), allocatable :: wsresp(:) ! atm response to surface stress + real(r8), allocatable :: charnsea(:) ! Charnock coeff accounting for the wave stress real(r8), allocatable :: tau_est(:)! estimation of tau in equilibrium with wind real(r8), allocatable :: ugust_atm(:) ! atm gustiness real(r8), allocatable :: thbot(:) ! atm potential T @@ -145,6 +146,7 @@ module seq_flux_mct integer :: index_o2x_So_t integer :: index_o2x_So_u integer :: index_o2x_So_v + integer :: index_w2x_Sw_Charn integer :: index_o2x_So_fswpen integer :: index_o2x_So_s integer :: index_o2x_So_roce_16O @@ -295,6 +297,11 @@ subroutine seq_flux_init_mct(comp, fractions) allocate( vocn(nloc),stat=ier) if(ier/=0) call mct_die(subName,'allocate vocn',ier) vocn = 0.0_r8 + + allocate( charnsea(nloc),stat=ier) + if(ier/=0) call mct_die(subName,'allocate charnsea',ier) + charnsea = 0.0_r8 + allocate( tocn(nloc),stat=ier) if(ier/=0) call mct_die(subName,'allocate tocn',ier) tocn = 0.0_r8 @@ -1313,7 +1320,7 @@ end subroutine seq_flux_atmocnexch_mct !=============================================================================== - subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) + subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) !----------------------------------------------------------------------- ! @@ -1323,6 +1330,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) integer(in) , intent(in) :: tod,dt ! NEW type(mct_aVect) , intent(in) :: a2x ! a2x_ax or a2x_ox type(mct_aVect) , intent(in) :: o2x ! o2x_ax or o2x_ox + type(mct_aVect), optional, intent(in) :: w2x ! w2x_wx type(mct_aVect) , intent(inout) :: xao ! ! Local variables @@ -1330,7 +1338,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) logical :: flux_albav ! flux avg option logical :: dead_comps ! .true. => dead components are used integer(in) :: n ! indices - integer(in) :: nloc, nloca, nloco ! number of gridcells + integer(in) :: nloc, nloca, nloco, nlocw ! number of gridcells logical,save:: first_call = .true. logical :: cold_start ! .true. to initialize internal fields in shr_flux diurnal logical :: read_restart ! .true. => continue run @@ -1445,6 +1453,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) index_o2x_So_roce_16O = mct_aVect_indexRA(o2x,'So_roce_16O', perrWith='quiet') index_o2x_So_roce_HDO = mct_aVect_indexRA(o2x,'So_roce_HDO', perrWith='quiet') index_o2x_So_roce_18O = mct_aVect_indexRA(o2x,'So_roce_18O', perrWith='quiet') + index_w2x_Sw_Charn = mct_aVect_indexRA(w2x,'Sw_Charn') call shr_flux_adjust_constants(flux_convergence_tolerance=flux_convergence, & flux_convergence_max_iteration=flux_max_iteration, & coldair_outbreak_mod=coldair_outbreak_mod) @@ -1458,6 +1467,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) nloc = mct_aVect_lsize(xao) nloca = mct_aVect_lsize(a2x) nloco = mct_aVect_lsize(o2x) + nlocw = mct_aVect_lsize(w2x) if (nloc /= nloca .or. nloc /= nloco) then call shr_sys_abort(trim(subname)//' ERROR nloc sizes do not match') @@ -1548,6 +1558,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) tocn(n) = o2x%rAttr(index_o2x_So_t ,n) uocn(n) = o2x%rAttr(index_o2x_So_u ,n) vocn(n) = o2x%rAttr(index_o2x_So_v ,n) + charnsea(n) = w2x%rAttr(index_w2x_Sw_Charn ,n) if ( index_o2x_So_roce_16O /= 0 ) roce_16O(n) = o2x%rAttr(index_o2x_So_roce_16O, n) if ( index_o2x_So_roce_HDO /= 0 ) roce_HDO(n) = o2x%rAttr(index_o2x_So_roce_HDO, n) if ( index_o2x_So_roce_18O /= 0 ) roce_18O(n) = o2x%rAttr(index_o2x_So_roce_18O, n) @@ -1634,7 +1645,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao) evap , evap_16O, evap_HDO, evap_18O, taux , tauy, tref, qref , & ocn_surface_flux_scheme, & duu10n, u10res, ustar, re , ssq, & - wsresp=wsresp, tau_est=tau_est, ugust=ugust_atm) + wsresp=wsresp, tau_est=tau_est, ugust=ugust_atm, & + charnockSeaState=charnsea) !missval should not be needed if flux calc !consistent with mrgx2a fraction !duu10n,ustar, re , ssq, missval = 0.0_r8 ) From 59ccb7c84cfcc408d7618de1bc02800b68f4ab3c Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 15:26:46 -0600 Subject: [PATCH 26/56] add xtime to wave output --- components/mpas-ocean/cime_config/buildnml | 1 + 1 file changed, 1 insertion(+) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index ba70541f2e46..575b16999371 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -1008,6 +1008,7 @@ def buildnml(case, caseroot, compname): lines.append(' packages="highFrequencyOutputAMPKG">') lines.append('') lines.append(' ') + lines.append(' ') lines.append(' ') lines.append(' ') lines.append(' ') From 8d7f0897f733086f2b99a55223bafe5295abf8eb Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 20 Feb 2024 15:31:45 -0600 Subject: [PATCH 27/56] modify ocean stress by wave effect (components/mpas-ocean/driver/ocn_comp_mct.F) --- components/mpas-ocean/driver/ocn_comp_mct.F | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 56a5920a950b..9a392a868283 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2111,10 +2111,10 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ do i = 1, nCellsSolve n = n + 1 if ( windStressZonalField % isActive ) then - windStressZonal(i) = x2o_o % rAttr(index_x2o_Foxx_taux, n) + windStressZonal(i) = x2o_o % rAttr(index_x2o_Foxx_taux, n) - (x2o_o % rAttr(index_x2o_Faww_Tawx, n) - x2o_o % rAttr(index_x2o_Fwow_Twox, n)) end if if ( windStressMeridionalField % isActive ) then - windStressMeridional(i) = x2o_o % rAttr(index_x2o_Foxx_tauy, n) + windStressMeridional(i) = x2o_o % rAttr(index_x2o_Foxx_tauy, n) - (x2o_o % rAttr(index_x2o_Faww_Tawy, n) - x2o_o % rAttr(index_x2o_Fwow_Twoy, n)) end if if ( latentHeatFluxField % isActive ) then From cbcedb30f93242dd36d0c3b611c90805492425b8 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 2 May 2024 11:50:21 -0500 Subject: [PATCH 28/56] add config namelist for momentum coupling --- components/mpas-ocean/bld/build-namelist | 2 ++ components/mpas-ocean/bld/build-namelist-section | 1 + .../bld/namelist_files/namelist_defaults_mpaso.xml | 1 + .../bld/namelist_files/namelist_definition_mpaso.xml | 8 ++++++++ components/mpas-ocean/driver/ocn_comp_mct.F | 12 ++++++++++-- components/mpas-ocean/src/Registry.xml | 4 ++++ 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/components/mpas-ocean/bld/build-namelist b/components/mpas-ocean/bld/build-namelist index 460b9ecda428..83f203a5bafc 100755 --- a/components/mpas-ocean/bld/build-namelist +++ b/components/mpas-ocean/bld/build-namelist @@ -684,8 +684,10 @@ if ($ocn_wave eq 'true' ) { if ($ocn_wave eq 'true' ) { add_default($nl, 'config_use_active_wave', 'val'=>'.true.'); + add_default($nl, 'config_momentum_use_active_wave', 'val'=>'.true.'); } else { add_default($nl, 'config_use_active_wave', 'val'=>'.false.'); + add_default($nl, 'config_momentum_use_active_wave', 'val'=>'.false.'); } add_default($nl, 'config_n_stokes_drift_wavenumber_partitions'); diff --git a/components/mpas-ocean/bld/build-namelist-section b/components/mpas-ocean/bld/build-namelist-section index c5dad5d935a9..5e24d7617858 100644 --- a/components/mpas-ocean/bld/build-namelist-section +++ b/components/mpas-ocean/bld/build-namelist-section @@ -203,6 +203,7 @@ add_default($nl, 'config_cvmix_kpp_use_active_wave'); ################################# add_default($nl, 'config_use_active_wave'); +add_default($nl, 'config_momentum_use_active_wave'); add_default($nl, 'config_n_stokes_drift_wavenumber_partitions'); ######################## diff --git a/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml b/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml index 3b93400f4e87..bae39a80250a 100644 --- a/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml +++ b/components/mpas-ocean/bld/namelist_files/namelist_defaults_mpaso.xml @@ -337,6 +337,7 @@ .false. +.false. 6 diff --git a/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml b/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml index bea1e98d9de8..ec2944657ee6 100644 --- a/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml +++ b/components/mpas-ocean/bld/namelist_files/namelist_definition_mpaso.xml @@ -1094,6 +1094,14 @@ Valid values: .true. or .false. Default: Defined in namelist_defaults.xml + +Flag for correcting momentum in ocean due waves. Requires config_use_active_wave = .true. + +Valid values: .true. or .false. +Default: Defined in namelist_defaults.xml + + Number of wavenumber partitions to be used in reconstructing wave-induced Stokes drift profile diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 9a392a868283..dd4b5875d3d4 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2111,10 +2111,18 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ do i = 1, nCellsSolve n = n + 1 if ( windStressZonalField % isActive ) then - windStressZonal(i) = x2o_o % rAttr(index_x2o_Foxx_taux, n) - (x2o_o % rAttr(index_x2o_Faww_Tawx, n) - x2o_o % rAttr(index_x2o_Fwow_Twox, n)) + if (config_momentum_use_active_wave) then + windStressZonal(i) = x2o_o % rAttr(index_x2o_Foxx_taux, n) - (x2o_o % rAttr(index_x2o_Faww_Tawx, n) - x2o_o % rAttr(index_x2o_Fwow_Twox, n)) + else + windStressZonal(i) = x2o_o % rAttr(index_x2o_Foxx_taux, n) + endif end if if ( windStressMeridionalField % isActive ) then - windStressMeridional(i) = x2o_o % rAttr(index_x2o_Foxx_tauy, n) - (x2o_o % rAttr(index_x2o_Faww_Tawy, n) - x2o_o % rAttr(index_x2o_Fwow_Twoy, n)) + if (config_momentum_use_active_wave) then + windStressMeridional(i) = x2o_o % rAttr(index_x2o_Foxx_tauy, n) - (x2o_o % rAttr(index_x2o_Faww_Tawy, n) - x2o_o % rAttr(index_x2o_Fwow_Twoy, n)) + else + windStressMeridional(i) = x2o_o % rAttr(index_x2o_Foxx_tauy, n) + endif end if if ( latentHeatFluxField % isActive ) then diff --git a/components/mpas-ocean/src/Registry.xml b/components/mpas-ocean/src/Registry.xml index a5e31814f81f..1da773a25579 100644 --- a/components/mpas-ocean/src/Registry.xml +++ b/components/mpas-ocean/src/Registry.xml @@ -654,6 +654,10 @@ description="Flag for using prognostic waves. Controls the allocation of wave arrays and computation of Stokes drift profiles." possible_values=".true. or .false." /> + Date: Thu, 30 May 2024 12:30:41 -0500 Subject: [PATCH 29/56] adding wav_atm_coup and wav_ocn_coup flags --- components/mpas-ocean/cime_config/buildnml | 27 -- components/mpas-ocean/driver/ocn_comp_mct.F | 94 ++--- .../ww3/cime_config/config_component.xml | 25 +- components/ww3/src/cpl/wav_comp_mct.F90 | 116 ++++--- components/ww3/src/cpl/ww3_cpl_indices.f90 | 52 +-- driver-mct/cime_config/buildnml | 3 + .../cime_config/namelist_definition_drv.xml | 22 ++ driver-mct/main/seq_flux_mct.F90 | 16 +- driver-mct/shr/seq_flds_mod.F90 | 325 +++++++++--------- share/util/shr_flux_mod.F90 | 37 +- 10 files changed, 394 insertions(+), 323 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 575b16999371..ab79aa90bb09 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -1024,33 +1024,6 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append('') lines.append('') - lines.append('') - lines.append('') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append('') - lines.append('') lines.append('env_case.xml Option to set WW3 Spectral Resolution. - + + + logical + TRUE,FALSE + FALSE + + TRUE + + run_component_wav + env_run.xml + WW3-OCN Coupling mode + + + + logical + TRUE,FALSE + FALSE + + TRUE + + run_component_wav + env_run.xml + WW3-ATM Coupling mode + diff --git a/components/ww3/src/cpl/wav_comp_mct.F90 b/components/ww3/src/cpl/wav_comp_mct.F90 index 654a7d6407db..fbbcb12556ce 100644 --- a/components/ww3/src/cpl/wav_comp_mct.F90 +++ b/components/ww3/src/cpl/wav_comp_mct.F90 @@ -1209,61 +1209,71 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) if (MAPSTA(IY,IX) .eq. 1) then w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea) - w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea) - w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea) - w2x_w%rattr(index_w2x_Sw_Charn,jsea) = CHARN(jsea) - w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 1000*TAUWIX(jsea) !Conversion to N m^{-2} by multiplying by density of water (See eqn 2.99 WW3 Manual) - w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 1000*TAUWIY(jsea) - w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 1000*TAUOX(jsea) - w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 1000*TAUOY(jsea) - w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = TAUOCX(jsea) - w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = TAUOCY(jsea) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = USSP(jsea,1) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = USSP(jsea,nk+1) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = USSP(jsea,2) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = USSP(jsea,nk+2) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = USSP(jsea,3) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = USSP(jsea,nk+3) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = USSP(jsea,4) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = USSP(jsea,nk+4) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = USSP(jsea,5) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = USSP(jsea,nk+5) - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = USSP(jsea,6) - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = USSP(jsea,nk+6) + if (wav_atm_coup .or. wav_ocn_coup) then + w2x_w%rattr(index_w2x_Sw_Charn,jsea) = CHARN(jsea) + endif + if (wav_ocn_coup) then + w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea) + w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea) + w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 1000*TAUWIX(jsea) !Conversion to N m^{-2} by multiplying by density of water (See eqn 2.99 WW3 Manual) + w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 1000*TAUWIY(jsea) + w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 1000*TAUOX(jsea) + w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 1000*TAUOY(jsea) + w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = TAUOCX(jsea) + w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = TAUOCY(jsea) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = USSP(jsea,1) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = USSP(jsea,nk+1) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = USSP(jsea,2) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = USSP(jsea,nk+2) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = USSP(jsea,3) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = USSP(jsea,nk+3) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = USSP(jsea,4) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = USSP(jsea,nk+4) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = USSP(jsea,5) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = USSP(jsea,nk+5) + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = USSP(jsea,6) + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = USSP(jsea,nk+6) + endif else - w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_Charn,jsea) = 0.0 - w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 0.0 - w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 0.0 - w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 0.0 - w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 0.0 - w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = 0.0 - w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0 - - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0 + + if (wav_atm_coup .or. wav_ocn_coup) then + w2x_w%rattr(index_w2x_Sw_Charn,jsea) = 0.0 + endif + if (wav_ocn_coup) then + w2x_w%rattr(index_w2x_Sw_Fp,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_Dp,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faww_Tawy,jsea) = 0.0 + w2x_w%rattr(index_w2x_Fwow_Twox,jsea) = 0.0 + w2x_w%rattr(index_w2x_Fwow_Twoy,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faow_Tocx,jsea) = 0.0 + w2x_w%rattr(index_w2x_Faow_Tocy,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0 + + w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0 + w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0 + endif endif enddo diff --git a/components/ww3/src/cpl/ww3_cpl_indices.f90 b/components/ww3/src/cpl/ww3_cpl_indices.f90 index 903a6bda91c6..28e4f3ecd69f 100644 --- a/components/ww3/src/cpl/ww3_cpl_indices.f90 +++ b/components/ww3/src/cpl/ww3_cpl_indices.f90 @@ -47,7 +47,8 @@ module ww3_cpl_indices contains subroutine ww3_cpl_indices_set( ) - + + use seq_flds_mod, only : wav_atm_coup, wav_ocn_coup type(mct_aVect) :: w2x ! temporary type(mct_aVect) :: x2w ! temporary @@ -70,29 +71,32 @@ subroutine ww3_cpl_indices_set( ) index_x2w_So_ssh = mct_avect_indexra(x2w,'So_ssh') ! Sea surface height index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height - index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency - index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction - index_w2x_Sw_Charn = mct_avect_indexra(w2x,'Sw_Charn') ! Charnock coeff accounting for the wave stress (Janssen 1989, 1991) - index_w2x_Faww_Tawx = mct_avect_indexra(w2x,'Faww_Tawx') ! Zonal Wave supported stress (Stress from atmosphere to waves) - index_w2x_Faww_Tawy = mct_avect_indexra(w2x,'Faww_Tawy') ! Meridional Wave supported stress (Stress from atmosphere to waves) - index_w2x_Fwow_Twox = mct_avect_indexra(w2x,'Fwow_Twox') ! Zonal Wave to ocean stress (Not total ocean momentum stress ) - index_w2x_Fwow_Twoy = mct_avect_indexra(w2x,'Fwow_Twoy') ! MeridionalWave to ocean stress (Not total ocean momentum stress) - index_w2x_Faow_Tocx = mct_avect_indexra(w2x,'Faow_Tocx') ! Zonal Net ocean stress (total ocean momentum stress ) - index_w2x_Faow_Tocy = mct_avect_indexra(w2x,'Faow_Tocy') !Meridional Net ocean stress (total ocean momentum stress) - - index_w2x_Sw_ustokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_1') ! partitioned Stokes drift u 1 - index_w2x_Sw_vstokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_1') ! partitioned Stokes drift v 1 - index_w2x_Sw_ustokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_2') ! partitioned Stokes drift u 2 - index_w2x_Sw_vstokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_2') ! partitioned Stokes drift v 2 - index_w2x_Sw_ustokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_3') ! partitioned Stokes drift u 3 - index_w2x_Sw_vstokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_3') ! partitioned Stokes drift v 3 - index_w2x_Sw_ustokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_4') ! partitioned Stokes drift u 4 - index_w2x_Sw_vstokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_4') ! partitioned Stokes drift v 4 - index_w2x_Sw_ustokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_5') ! partitioned Stokes drift u 5 - index_w2x_Sw_vstokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_5') ! partitioned Stokes drift v 5 - index_w2x_Sw_ustokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_6') ! partitioned Stokes drift u 6 - index_w2x_Sw_vstokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_6') ! partitioned Stokes drift v 6 - + if (wav_ocn_coup .or. wav_atm_coup) then + index_w2x_Sw_Charn = mct_avect_indexra(w2x,'Sw_Charn') ! Charnock coeff accounting for the wave stress (Janssen 1989, 1991) + endif + if (wav_ocn_coup) then + index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency + index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction + index_w2x_Faww_Tawx = mct_avect_indexra(w2x,'Faww_Tawx') ! Zonal Wave supported stress (Stress from atmosphere to waves) + index_w2x_Faww_Tawy = mct_avect_indexra(w2x,'Faww_Tawy') ! Meridional Wave supported stress (Stress from atmosphere to waves) + index_w2x_Fwow_Twox = mct_avect_indexra(w2x,'Fwow_Twox') ! Zonal Wave to ocean stress (Not total ocean momentum stress ) + index_w2x_Fwow_Twoy = mct_avect_indexra(w2x,'Fwow_Twoy') ! MeridionalWave to ocean stress (Not total ocean momentum stress) + index_w2x_Faow_Tocx = mct_avect_indexra(w2x,'Faow_Tocx') ! Zonal Net ocean stress (total ocean momentum stress ) + index_w2x_Faow_Tocy = mct_avect_indexra(w2x,'Faow_Tocy') !Meridional Net ocean stress (total ocean momentum stress) + + index_w2x_Sw_ustokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_1') ! partitioned Stokes drift u 1 + index_w2x_Sw_vstokes_wavenumber_1 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_1') ! partitioned Stokes drift v 1 + index_w2x_Sw_ustokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_2') ! partitioned Stokes drift u 2 + index_w2x_Sw_vstokes_wavenumber_2 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_2') ! partitioned Stokes drift v 2 + index_w2x_Sw_ustokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_3') ! partitioned Stokes drift u 3 + index_w2x_Sw_vstokes_wavenumber_3 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_3') ! partitioned Stokes drift v 3 + index_w2x_Sw_ustokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_4') ! partitioned Stokes drift u 4 + index_w2x_Sw_vstokes_wavenumber_4 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_4') ! partitioned Stokes drift v 4 + index_w2x_Sw_ustokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_5') ! partitioned Stokes drift u 5 + index_w2x_Sw_vstokes_wavenumber_5 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_5') ! partitioned Stokes drift v 5 + index_w2x_Sw_ustokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_ustokes_wavenumber_6') ! partitioned Stokes drift u 6 + index_w2x_Sw_vstokes_wavenumber_6 = mct_avect_indexra(w2x,'Sw_vstokes_wavenumber_6') ! partitioned Stokes drift v 6 + endif call mct_aVect_clean(x2w) call mct_aVect_clean(w2x) diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index 4938e9da0b18..e8aeebfd6885 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -55,6 +55,9 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['lnd_grid'] = case.get_value('LND_GRID') config['compocn'] = case.get_value('COMP_OCN') + config['wav_atm_coup'] = case.get_value('WAV_ATM_COUP') + config['wav_ocn_coup'] = case.get_value('WAV_OCN_COUP') + docn_mode = case.get_value("DOCN_MODE") if docn_mode and 'aqua' in docn_mode: config['aqua_planet_sst_type'] = docn_mode diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 982acabe64d8..f739d396e5ac 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -193,6 +193,28 @@ + + logical + seq_flds + seq_cplflds_inparm + TRUE if wave atm coupling turned on. default is TRUE if WW3 used in compset + + $WAV_ATM_COUP + .false. + + + + + logical + seq_flds + seq_cplflds_inparm + TRUE if wave ocean coupling turned on. default is TRUE if WW3 used in compset + + $WAV_OCN_COUP + .false. + + + integer seq_flds diff --git a/driver-mct/main/seq_flux_mct.F90 b/driver-mct/main/seq_flux_mct.F90 index 5835e7688dde..acbde5a5b8de 100644 --- a/driver-mct/main/seq_flux_mct.F90 +++ b/driver-mct/main/seq_flux_mct.F90 @@ -1558,7 +1558,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) tocn(n) = o2x%rAttr(index_o2x_So_t ,n) uocn(n) = o2x%rAttr(index_o2x_So_u ,n) vocn(n) = o2x%rAttr(index_o2x_So_v ,n) - charnsea(n) = w2x%rAttr(index_w2x_Sw_Charn ,n) + if (wav_atm_coup) charnsea(n) = w2x%rAttr(index_w2x_Sw_Charn ,n) if ( index_o2x_So_roce_16O /= 0 ) roce_16O(n) = o2x%rAttr(index_o2x_So_roce_16O, n) if ( index_o2x_So_roce_HDO /= 0 ) roce_HDO(n) = o2x%rAttr(index_o2x_So_roce_HDO, n) if ( index_o2x_So_roce_18O /= 0 ) roce_18O(n) = o2x%rAttr(index_o2x_So_roce_18O, n) @@ -1637,7 +1637,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) duu10n,ustar, re , ssq, wsresp=wsresp, tau_est=tau_est) u10res = sqrt(duu10n) ! atm-supplied gustiness not implemented for UA else - call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, & + if (wav_atm_coup) then + call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, & shum , shum_16O , shum_HDO, shum_18O, dens , tbot, uocn, vocn , & tocn , emask, seq_flux_atmocn_minwind, & sen , lat , lwup , & @@ -1647,6 +1648,17 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) duu10n, u10res, ustar, re , ssq, & wsresp=wsresp, tau_est=tau_est, ugust=ugust_atm, & charnockSeaState=charnsea) + else + call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, & + shum , shum_16O , shum_HDO, shum_18O, dens , tbot, uocn, vocn , & + tocn , emask, seq_flux_atmocn_minwind, & + sen , lat , lwup , & + roce_16O, roce_HDO, roce_18O, & + evap , evap_16O, evap_HDO, evap_18O, taux , tauy, tref, qref , & + ocn_surface_flux_scheme, & + duu10n, u10res, ustar, re , ssq, & + wsresp=wsresp, tau_est=tau_est, ugust=ugust_atm) + endif !missval should not be needed if flux calc !consistent with mrgx2a fraction !duu10n,ustar, re , ssq, missval = 0.0_r8 ) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index a3ccdbff3afc..f047039c6bec 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -162,6 +162,8 @@ module seq_flds_mod logical :: ocn_rof_two_way ! .true. if river-ocean two-way coupling turned on logical :: rof_sed ! .true. if river model includes sediment + logical :: wav_ocn_coup ! .true. if wave-atm two-way coupling turned on + logical :: wav_atm_coup ! .true. if wave-atm two-way coupling turned on !---------------------------------------------------------------------------- ! metadata !---------------------------------------------------------------------------- @@ -386,7 +388,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata) flds_co2a, flds_co2b, flds_co2c, flds_co2_dmsa, flds_wiso, flds_polar, glc_nec, & ice_ncat, seq_flds_i2o_per_cat, flds_bgc_oi, & nan_check_component_fields, rof_heat, atm_flux_method, atm_gustiness, & - rof2ocn_nutrients, lnd_rof_two_way, ocn_rof_two_way, rof_sed + rof2ocn_nutrients, lnd_rof_two_way, ocn_rof_two_way, rof_sed, & + wav_ocn_coup, wav_atm_coup ! user specified new fields integer, parameter :: nfldmax = 200 @@ -429,6 +432,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata) lnd_rof_two_way = .false. ocn_rof_two_way = .false. rof_sed = .false. + wav_ocn_coup = .false. + wav_atm_coup = .false. unitn = shr_file_getUnit() write(logunit,"(A)") subname//': read seq_cplflds_inparm namelist from: '& @@ -463,6 +468,8 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call shr_mpi_bcast(lnd_rof_two_way, mpicom) call shr_mpi_bcast(ocn_rof_two_way, mpicom) call shr_mpi_bcast(rof_sed, mpicom) + call shr_mpi_bcast(wav_ocn_coup, mpicom) + call shr_mpi_bcast(wav_atm_coup, mpicom) call glc_elevclass_init(glc_nec) @@ -2513,183 +2520,185 @@ subroutine seq_flds_set(nmlfile, ID, infodata) !----------------------------- ! wav->ocn and ocn->wav !----------------------------- - - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_1') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_1') - longname = 'Partitioned Stokes drift u component, wavenumber 1' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_1' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_1' - call metadata_set(attname, longname, stdname, units) - - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_1') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_1') - longname = 'Partitioned Stokes drift v component, wavenumber 1' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_1' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_1' - call metadata_set(attname, longname, stdname, units) - - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_2') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_2') - longname = 'Partitioned Stokes drift u component, wavenumber 2' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_2' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_2' - call metadata_set(attname, longname, stdname, units) - - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_2') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_2') - longname = 'Partitioned Stokes drift v component, wavenumber 2' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_2' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_2' + call seq_flds_add(w2x_states,'Sw_Hs') + call seq_flds_add(x2o_states,'Sw_Hs') + longname = 'Significant wave height' + stdname = 'significant_wave_height' + units = 'm' + attname = 'Sw_Hs' call metadata_set(attname, longname, stdname, units) + + if (wav_ocn_coup) then + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_1') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_1') + longname = 'Partitioned Stokes drift u component, wavenumber 1' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_1' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_1' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_3') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_3') - longname = 'Partitioned Stokes drift u component, wavenumber 3' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_3' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_3' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_1') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_1') + longname = 'Partitioned Stokes drift v component, wavenumber 1' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_1' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_1' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_3') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_3') - longname = 'Partitioned Stokes drift v component, wavenumber 3' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_3' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_3' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_2') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_2') + longname = 'Partitioned Stokes drift u component, wavenumber 2' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_2' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_2' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_4') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_4') - longname = 'Partitioned Stokes drift u component, wavenumber 4' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_4' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_4' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_2') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_2') + longname = 'Partitioned Stokes drift v component, wavenumber 2' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_2' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_2' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_4') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_4') - longname = 'Partitioned Stokes drift v component, wavenumber 4' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_4' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_4' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_3') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_3') + longname = 'Partitioned Stokes drift u component, wavenumber 3' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_3' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_3' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_5') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_5') - longname = 'Partitioned Stokes drift u component, wavenumber 5' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_5' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_5' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_3') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_3') + longname = 'Partitioned Stokes drift v component, wavenumber 3' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_3' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_3' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_5') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_5') - longname = 'Partitioned Stokes drift v component, wavenumber 5' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_5' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_5' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_4') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_4') + longname = 'Partitioned Stokes drift u component, wavenumber 4' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_4' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_4' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_6') - call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_6') - longname = 'Partitioned Stokes drift u component, wavenumber 6' - stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_6' - units = 'm/s' - attname = 'Sw_ustokes_wavenumber_6' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_4') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_4') + longname = 'Partitioned Stokes drift v component, wavenumber 4' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_4' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_4' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_6') - call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_6') - longname = 'Partitioned Stokes drift v component, wavenumber 6' - stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_6' - units = 'm/s' - attname = 'Sw_vstokes_wavenumber_6' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_5') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_5') + longname = 'Partitioned Stokes drift u component, wavenumber 5' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_5' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_5' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_Hs') - call seq_flds_add(x2o_states,'Sw_Hs') - longname = 'Significant wave height' - stdname = 'significant_wave_height' - units = 'm' - attname = 'Sw_Hs' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_5') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_5') + longname = 'Partitioned Stokes drift v component, wavenumber 5' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_5' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_5' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_Fp') - call seq_flds_add(x2o_states,'Sw_Fp') - longname = 'Peak wave frequency' - stdname = 'peak_wave_frequency' - units = 's-1' - attname = 'Sw_Fp' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_6') + call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_6') + longname = 'Partitioned Stokes drift u component, wavenumber 6' + stdname = 'wave_model_partitioned_stokes_drift_u_wavenumber_6' + units = 'm/s' + attname = 'Sw_ustokes_wavenumber_6' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_Dp') - call seq_flds_add(x2o_states,'Sw_Dp') - longname = 'Peak wave direction' - stdname = 'peak_wave_direction' - units = 'deg' - attname = 'Sw_Dp' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_vstokes_wavenumber_6') + call seq_flds_add(x2o_states,'Sw_vstokes_wavenumber_6') + longname = 'Partitioned Stokes drift v component, wavenumber 6' + stdname = 'wave_model_partitioned_stokes_drift_v_wavenumber_6' + units = 'm/s' + attname = 'Sw_vstokes_wavenumber_6' + call metadata_set(attname, longname, stdname, units) + + call seq_flds_add(w2x_states,'Sw_Fp') + call seq_flds_add(x2o_states,'Sw_Fp') + longname = 'Peak wave frequency' + stdname = 'peak_wave_frequency' + units = 's-1' + attname = 'Sw_Fp' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_states,'Sw_Charn') - call seq_flds_add(x2o_states,'Sw_Charn') - longname = 'Charnock coefficent based on sea state' - stdname = 'Charnock_coefficent_based_on_sea_state' - units = '' - attname = 'Sw_Charn' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_states,'Sw_Dp') + call seq_flds_add(x2o_states,'Sw_Dp') + longname = 'Peak wave direction' + stdname = 'peak_wave_direction' + units = 'deg' + attname = 'Sw_Dp' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Faww_Tawx') - call seq_flds_add(x2o_fluxes,'Faww_Tawx') - longname = 'Zonal wave supported stress' - stdname = 'Zonal_wave_supported_stress' - units = 'N m-2' - attname = 'Faww_Tawx' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Faww_Tawx') + call seq_flds_add(x2o_fluxes,'Faww_Tawx') + longname = 'Zonal wave supported stress' + stdname = 'Zonal_wave_supported_stress' + units = 'N m-2' + attname = 'Faww_Tawx' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Faww_Tawy') - call seq_flds_add(x2o_fluxes,'Faww_Tawy') - longname = 'Meridional wave supported wind stress' - stdname = 'Meridional_wave_supported_wind_stress' - units = 'N m-2' - attname = 'Faww_Tawy' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Faww_Tawy') + call seq_flds_add(x2o_fluxes,'Faww_Tawy') + longname = 'Meridional wave supported wind stress' + stdname = 'Meridional_wave_supported_wind_stress' + units = 'N m-2' + attname = 'Faww_Tawy' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Fwow_Twox') - call seq_flds_add(x2o_fluxes,'Fwow_Twox') - longname = 'Zonal wave to ocean wind stress' - stdname = 'Zonal_wave_to_ocean_wind_stress' - units = 'N m-2' - attname = 'Fwow_Twox' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Fwow_Twox') + call seq_flds_add(x2o_fluxes,'Fwow_Twox') + longname = 'Zonal wave to ocean wind stress' + stdname = 'Zonal_wave_to_ocean_wind_stress' + units = 'N m-2' + attname = 'Fwow_Twox' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Fwow_Twoy') - call seq_flds_add(x2o_fluxes,'Fwow_Twoy') - longname = 'Meridional wave to ocean wind stress' - stdname = 'Meridional_wave_to_ocean_wind_stress' - units = 'N m-2' - attname = 'Fwow_Twoy' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Fwow_Twoy') + call seq_flds_add(x2o_fluxes,'Fwow_Twoy') + longname = 'Meridional wave to ocean wind stress' + stdname = 'Meridional_wave_to_ocean_wind_stress' + units = 'N m-2' + attname = 'Fwow_Twoy' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Faow_Tocx') - call seq_flds_add(x2o_fluxes,'Faow_Tocx') - longname = 'Zonal Net ocean wind stress by wave model' - stdname = 'Zonal_net_ocean_wind_stress_wavemodel' - units = 'N m-2' - attname = 'Faow_Tocx' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Faow_Tocx') + call seq_flds_add(x2o_fluxes,'Faow_Tocx') + longname = 'Zonal Net ocean wind stress by wave model' + stdname = 'Zonal_net_ocean_wind_stress_wavemodel' + units = 'N m-2' + attname = 'Faow_Tocx' + call metadata_set(attname, longname, stdname, units) - call seq_flds_add(w2x_fluxes,'Faow_Tocy') - call seq_flds_add(x2o_fluxes,'Faow_Tocy') - longname = 'Meridional Net ocean wind stress by wave model' - stdname = 'Meridional_net_ocean_wind_stress_wavemodel' - units = 'N m-2' - attname = 'Faow_Tocy' - call metadata_set(attname, longname, stdname, units) + call seq_flds_add(w2x_fluxes,'Faow_Tocy') + call seq_flds_add(x2o_fluxes,'Faow_Tocy') + longname = 'Meridional Net ocean wind stress by wave model' + stdname = 'Meridional_net_ocean_wind_stress_wavemodel' + units = 'N m-2' + attname = 'Faow_Tocy' + call metadata_set(attname, longname, stdname, units) + endif + if (wav_atm_coup .or. wav_ocn_coup) then + call seq_flds_add(w2x_states,'Sw_Charn') + call seq_flds_add(x2o_states,'Sw_Charn') + longname = 'Charnock coefficent based on sea state' + stdname = 'Charnock_coefficent_based_on_sea_state' + units = '' + attname = 'Sw_Charn' + call metadata_set(attname, longname, stdname, units) + endif !----------------------------- ! New xao_states diagnostic ! fields for history output only diff --git a/share/util/shr_flux_mod.F90 b/share/util/shr_flux_mod.F90 index 7046909ec54b..8fe9bbe8c86f 100644 --- a/share/util/shr_flux_mod.F90 +++ b/share/util/shr_flux_mod.F90 @@ -155,6 +155,7 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & ! !USES: use water_isotopes, only: wiso_flxoce !subroutine used to calculate water isotope fluxes. + use seq_flds_mod, only : wav_atm_coup implicit none ! !INPUT/OUTPUT PARAMETERS: @@ -540,8 +541,8 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & endif endif ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg) - - call cor30a(ubot(n),vbot(n),tbot(n),qbot(n),rbot(n) & ! in atm params + if (wav_atm_coup) then + call cor30a(ubot(n),vbot(n),tbot(n),qbot(n),rbot(n) & ! in atm params & ,us(n),vs(n),ts(n),ssq & ! in surf params & ,zpbl,zbot(n),zbot(n),zref,ztref,ztref & ! in heights & ,tau,hsb,hlb & ! out: fluxes @@ -550,7 +551,16 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & & ,trf,qrf,urf,vrf & ! out: reference-height params & ,wsresp(n),tau_est(n) & ! in: optional stress params for the sake of maintaining same defs & ,charnockSeaState(n)) ! in: optional charnock sea state - + else + call cor30a(ubot(n),vbot(n),tbot(n),qbot(n),rbot(n) & ! in atm params + & ,us(n),vs(n),ts(n),ssq & ! in surf params + & ,zpbl,zbot(n),zbot(n),zref,ztref,ztref & ! in heights + & ,tau,hsb,hlb & ! out: fluxes + & ,zo,zot,zoq,hol,ustar,tstar,qstar & ! out: ss scales + & ,rd,rh,re & ! out: exch. coeffs + & ,trf,qrf,urf,vrf & ! out: reference-height params + & ,wsresp(n),tau_est(n) ) ! in: optional stress params for the sake of maintaining same defs + endif hol=zbot(n)/hol rd=sqrt(rd) rh=sqrt(rh) @@ -2518,7 +2528,7 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params & ,charnsea) ! in: optional charnock sea state !USES: - +use seq_flds_mod, only : wav_atm_coup IMPLICIT NONE ! !INPUT/OUTPUT PARAMETERS: @@ -2636,15 +2646,18 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params tsr = (dt-dter*jcool)*von/(log(zt/zot10)-psit_30(zt/L10)) qsr = (dq-dqer*jcool)*von/(log(zq/zot10)-psit_30(zq/L10)) -! parametrisation for Charney parameter (section 3c of Fairall et al. 2003) - !charn=0.011_R8 - if (ut .GT. 10.0_R8) then - !charn=0.011_R8+(ut-10.0_R8)/(18.0_R8-10.0_R8)*(0.018_R8-0.011_R8) - endif - if (ut .GT. 18.0_R8) then - !charn=0.018_R8 + if (wav_atm_coup) then + charn = charnsea !use Charnock coefficient from active wave model (Janssen 1989, 1991) + else + ! parametrisation for Charney parameter (section 3c of Fairall et al. 2003) + charn=0.011_R8 + if (ut .GT. 10.0_R8) then + charn=0.011_R8+(ut-10.0_R8)/(18.0_R8-10.0_R8)*(0.018_R8-0.011_R8) + endif + if (ut .GT. 18.0_R8) then + charn=0.018_R8 + endif endif - charn = charnsea !use Charnock coefficient accounting for the wave stress (Janssen 1989, 1991) if (present(wsresp) .and. present(tau_est)) prev_tau = tau_est tau_diff = 1.e100_R8 From 7ef793f5e1a4c2a4bb02cec02418dd56b6ffcda0 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 31 May 2024 11:41:55 -0500 Subject: [PATCH 30/56] replace ocn_wave flag with new wav_ocn_coup flag --- components/mpas-ocean/bld/build-namelist | 10 ++++------ components/mpas-ocean/cime_config/buildnml | 7 +++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/components/mpas-ocean/bld/build-namelist b/components/mpas-ocean/bld/build-namelist index 83f203a5bafc..6c477e581f83 100755 --- a/components/mpas-ocean/bld/build-namelist +++ b/components/mpas-ocean/bld/build-namelist @@ -64,7 +64,6 @@ OPTIONS (Needed to run build-namelist from SourceMods dir) -inst_string inst_string variable -ocn_bgc ocean BGC configuration - -ocn_wave ocean wave coupling flag -ocn_co2_type how atm co2 is set within MPASO -atm_co2_const_val value of atm co2 if ocn_co2_type = constant -ice_bgc check for coupling with sea ice BGC @@ -118,7 +117,6 @@ my %opts = ( help => 0, decomp_prefix => undef, date_stamp => undef, ocn_bgc => undef, - ocn_wave => undef, ocn_co2_type => undef, atm_co2_const_val => undef, ice_bgc => undef, @@ -145,7 +143,6 @@ GetOptions( "decomp_prefix=s" => \$opts{'decomp_prefix'}, "date_stamp=s" => \$opts{'date_stamp'}, "ocn_bgc=s" => \$opts{'ocn_bgc'}, - "ocn_wave=s" => \$opts{'ocn_wave'}, "ocn_co2_type=s" => \$opts{'ocn_co2_type'}, "atm_co2_const_val=s" => \$opts{'atm_co2_const_val'}, "ice_bgc=s" => \$opts{'ice_bgc'}, @@ -189,7 +186,6 @@ my $OCN_SGR = $opts{'ocn_sgr'}; my $decomp_prefix = $opts{'decomp_prefix'}; my $date_stamp = $opts{'date_stamp'}; my $ocn_bgc = $opts{'ocn_bgc'}; -my $ocn_wave = $opts{'ocn_wave'}; my $ocn_co2_type = $opts{'ocn_co2_type'}; my $atm_co2_const_val = $opts{'atm_co2_const_val'}; my $ice_bgc = $opts{'ice_bgc'}; @@ -445,6 +441,8 @@ my $START_TOD = "$xmlvars{'START_TOD'}"; my $RUN_REFDATE = "$xmlvars{'RUN_REFDATE'}"; my $CONTINUE_RUN = "$xmlvars{'CONTINUE_RUN'}"; +my $wav_ocn_coup = "$xmlvars{'WAV_OCN_COUP'}"; + my $output_r = "./${CASE}.mpaso.r"; my $output_h = "./${CASE}.mpaso.h"; my $output_d = "./${CASE}.mpaso.d"; @@ -667,7 +665,7 @@ add_default($nl, 'configure_cvmix_kpp_minimum_OBL_under_sea_ice'); add_default($nl, 'config_cvmix_kpp_stop_OBL_search'); add_default($nl, 'config_cvmix_kpp_use_enhanced_diff'); add_default($nl, 'config_cvmix_kpp_nonlocal_with_implicit_mix'); -if ($ocn_wave eq 'true' ) { +if ($wav_ocn_coup eq 'true' ) { add_default($nl, 'config_cvmix_kpp_use_theory_wave', 'val'=>'.false.'); add_default($nl, 'config_cvmix_kpp_use_active_wave', 'val'=>'.true.'); add_default($nl, 'config_cvmix_kpp_langmuir_mixing_opt', 'val'=>'LWF16'); @@ -682,7 +680,7 @@ if ($ocn_wave eq 'true' ) { # Namelist group: wave_coupling # ################################# -if ($ocn_wave eq 'true' ) { +if ($wav_ocn_coup eq 'true' ) { add_default($nl, 'config_use_active_wave', 'val'=>'.true.'); add_default($nl, 'config_momentum_use_active_wave', 'val'=>'.true.'); } else { diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index ab79aa90bb09..89aea1ff92aa 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -37,8 +37,8 @@ def buildnml(case, caseroot, compname): ocn_ismf = case.get_value("MPASO_ISMF") ocn_sgr = case.get_value("MPASO_SGR") ocn_bgc = case.get_value("MPASO_BGC") - ocn_wave = case.get_value("MPASO_WAVE") ocn_tidal_mixing = case.get_value("MPASO_TIDAL_MIXING") + wav_ocn_coup = case.get_value("WAV_OCN_COUP") ocn_co2_type = case.get_value("OCN_CO2_TYPE") atm_co2_const_val = case.get_value("CCSM_CO2_PPMV") ice_bgc = case.get_value("MPASI_BGC") @@ -523,7 +523,6 @@ def buildnml(case, caseroot, compname): sysmod += " -ocn_ismf '{}'".format(ocn_ismf) sysmod += " -ocn_sgr '{}'".format(ocn_sgr) sysmod += " -ocn_bgc '{}'".format(ocn_bgc) - sysmod += " -ocn_wave '{}'".format(ocn_wave) sysmod += " -ocn_tidal_mixing '{}'".format(ocn_tidal_mixing) sysmod += " -ocn_co2_type '{}'".format(ocn_co2_type) sysmod += " -atm_co2_const_val '{}'".format(atm_co2_const_val) @@ -995,7 +994,7 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append('') lines.append('') - if ocn_wave == 'true': + if wav_ocn_coup == 'true': lines.append('') lines.append(' ') lines.append(' ') - if ocn_wave == 'true': + if wav_ocn_coup == 'true': lines.append(' ') lines.append(' ') lines.append(' ') From 65e40390bf60e9a7f965349cfae0338ceeae03ea Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 31 May 2024 13:17:04 -0500 Subject: [PATCH 31/56] fix to wav_ocn_coup flag --- .../mpas-ocean/driver/mpaso_cpl_indices.F | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 9e4822bde2f3..76b5b2562435 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -178,7 +178,7 @@ module mpaso_cpl_indices contains subroutine mpaso_cpl_indices_set( ) - + use seq_flds_mod, only : wav_ocn_coup type(mct_aVect) :: o2x ! temporary type(mct_aVect) :: x2o ! temporary @@ -323,28 +323,30 @@ subroutine mpaso_cpl_indices_set( ) index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_grounded') index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_floating') - index_x2o_Sw_ustokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_1') - index_x2o_Sw_vstokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_1') - index_x2o_Sw_ustokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_2') - index_x2o_Sw_vstokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_2') - index_x2o_Sw_ustokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_3') - index_x2o_Sw_vstokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_3') - index_x2o_Sw_ustokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_4') - index_x2o_Sw_vstokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_4') - index_x2o_Sw_ustokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_5') - index_x2o_Sw_vstokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_5') - index_x2o_Sw_ustokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_6') - index_x2o_Sw_vstokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_6') - index_x2o_Sw_Hs = mct_avect_indexra(x2o,'Sw_Hs') - index_x2o_Sw_Fp = mct_avect_indexra(x2o,'Sw_Fp') - index_x2o_Sw_Dp = mct_avect_indexra(x2o,'Sw_Dp') - index_x2o_Sw_Charn = mct_avect_indexra(x2o,'Sw_Charn') - index_x2o_Faww_Tawx = mct_avect_indexra(x2o,'Faww_Tawx') - index_x2o_Faww_Tawy = mct_avect_indexra(x2o,'Faww_Tawy') - index_x2o_Fwow_Twox = mct_avect_indexra(x2o,'Fwow_Twox') - index_x2o_Fwow_Twoy = mct_avect_indexra(x2o,'Fwow_Twoy') - index_x2o_Faow_Tocx = mct_avect_indexra(x2o,'Faow_Tocx') - index_x2o_Faow_Tocy = mct_avect_indexra(x2o,'Faow_Tocy') + if (wav_ocn_coup) then + index_x2o_Sw_ustokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_1') + index_x2o_Sw_vstokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_1') + index_x2o_Sw_ustokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_2') + index_x2o_Sw_vstokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_2') + index_x2o_Sw_ustokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_3') + index_x2o_Sw_vstokes_wavenumber_3 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_3') + index_x2o_Sw_ustokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_4') + index_x2o_Sw_vstokes_wavenumber_4 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_4') + index_x2o_Sw_ustokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_5') + index_x2o_Sw_vstokes_wavenumber_5 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_5') + index_x2o_Sw_ustokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_6') + index_x2o_Sw_vstokes_wavenumber_6 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_6') + index_x2o_Sw_Hs = mct_avect_indexra(x2o,'Sw_Hs') + index_x2o_Sw_Fp = mct_avect_indexra(x2o,'Sw_Fp') + index_x2o_Sw_Dp = mct_avect_indexra(x2o,'Sw_Dp') + index_x2o_Sw_Charn = mct_avect_indexra(x2o,'Sw_Charn') + index_x2o_Faww_Tawx = mct_avect_indexra(x2o,'Faww_Tawx') + index_x2o_Faww_Tawy = mct_avect_indexra(x2o,'Faww_Tawy') + index_x2o_Fwow_Twox = mct_avect_indexra(x2o,'Fwow_Twox') + index_x2o_Fwow_Twoy = mct_avect_indexra(x2o,'Fwow_Twoy') + index_x2o_Faow_Tocx = mct_avect_indexra(x2o,'Faow_Tocx') + index_x2o_Faow_Tocy = mct_avect_indexra(x2o,'Faow_Tocy') + endif call mct_aVect_clean(x2o) call mct_aVect_clean(o2x) From 24de407a24ddefa5ae1d7b89182bff251790d2dd Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 31 May 2024 17:51:45 -0500 Subject: [PATCH 32/56] bug fix to wav_ocn_coup --- .../ww3/cime_config/config_component.xml | 25 ------------------- driver-mct/cime_config/buildnml | 15 +++++++++-- .../cime_config/namelist_definition_drv.xml | 10 +++----- 3 files changed, 17 insertions(+), 33 deletions(-) diff --git a/components/ww3/cime_config/config_component.xml b/components/ww3/cime_config/config_component.xml index a9e77849384e..63032eda31f1 100644 --- a/components/ww3/cime_config/config_component.xml +++ b/components/ww3/cime_config/config_component.xml @@ -43,31 +43,6 @@ Option to set WW3 Spectral Resolution. - - logical - TRUE,FALSE - FALSE - - TRUE - - run_component_wav - env_run.xml - WW3-OCN Coupling mode - - - - logical - TRUE,FALSE - FALSE - - TRUE - - run_component_wav - env_run.xml - WW3-ATM Coupling mode - - - ========================================= WW3 naming conventions diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index e8aeebfd6885..cf532e9750d7 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -54,9 +54,20 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['atm_grid'] = case.get_value('ATM_GRID') config['lnd_grid'] = case.get_value('LND_GRID') config['compocn'] = case.get_value('COMP_OCN') + + if 'ww3' in case.get_value('COMP_WAV'): + config['WAVSPEC'] = case.get_value('WAV_SPEC') + config['wav_atm_coup'] = '.true.' if case.get_value('COMP_ATM') == 'eam' else '.false.' + config['wav_ocn_coup'] = '.true.' if case.get_value('COMP_OCN') == 'mpaso' else '.false.' + elif 'dwav' in case.get_value('COMP_WAV'): + config['WAVSPEC'] = 'sp36x36' + config['wav_atm_coup'] = '.false.' + config['wav_ocn_coup'] = '.false.' + else: + config['WAVSPEC'] = 'none' + config['wav_atm_coup'] = '.false.' + config['wav_ocn_coup'] = '.false.' - config['wav_atm_coup'] = case.get_value('WAV_ATM_COUP') - config['wav_ocn_coup'] = case.get_value('WAV_OCN_COUP') docn_mode = case.get_value("DOCN_MODE") if docn_mode and 'aqua' in docn_mode: diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index f739d396e5ac..7b08c3c1ec04 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -193,25 +193,23 @@ - + logical seq_flds seq_cplflds_inparm TRUE if wave atm coupling turned on. default is TRUE if WW3 used in compset - $WAV_ATM_COUP - .false. + .false. - + logical seq_flds seq_cplflds_inparm TRUE if wave ocean coupling turned on. default is TRUE if WW3 used in compset - $WAV_OCN_COUP - .false. + .false. From 182ad3e4a63b2799447823c0228d26caba1e4189 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 4 Jun 2024 12:38:23 -0500 Subject: [PATCH 33/56] testing wav_ocn_coup settings --- components/ww3/src/cpl/wav_comp_mct.F90 | 28 +++++++++---------- driver-mct/cime_config/buildnml | 11 ++++---- .../cime_config/namelist_definition_drv.xml | 4 +-- driver-mct/main/seq_flux_mct.F90 | 4 ++- driver-mct/shr/seq_flds_mod.F90 | 17 +++++------ 5 files changed, 33 insertions(+), 31 deletions(-) diff --git a/components/ww3/src/cpl/wav_comp_mct.F90 b/components/ww3/src/cpl/wav_comp_mct.F90 index fbbcb12556ce..6fd330fc29b5 100644 --- a/components/ww3/src/cpl/wav_comp_mct.F90 +++ b/components/ww3/src/cpl/wav_comp_mct.F90 @@ -855,25 +855,25 @@ SUBROUTINE WAV_INIT_MCT( EClock, cdata, x2w_w, w2x_w, NLFilename ) ! add call to gptl timer ! send initial state to driver - do jsea=1, nseal - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 + !do jsea=1, nseal + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0 - w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0 - enddo + ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0 + ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0 + !enddo ! end redirection of share output to wav log diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index cf532e9750d7..aa97d5489f8e 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -57,16 +57,15 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): if 'ww3' in case.get_value('COMP_WAV'): config['WAVSPEC'] = case.get_value('WAV_SPEC') - config['wav_atm_coup'] = '.true.' if case.get_value('COMP_ATM') == 'eam' else '.false.' - config['wav_ocn_coup'] = '.true.' if case.get_value('COMP_OCN') == 'mpaso' else '.false.' + if 'eam' in case.get_value('COMP_ATM'): + config['wav_atm_coup'] = '.true.' + if 'mpaso' in case.get_value('COMP_OCN'): + config['wav_ocn_coup'] = '.true.' + elif 'dwav' in case.get_value('COMP_WAV'): config['WAVSPEC'] = 'sp36x36' - config['wav_atm_coup'] = '.false.' - config['wav_ocn_coup'] = '.false.' else: config['WAVSPEC'] = 'none' - config['wav_atm_coup'] = '.false.' - config['wav_ocn_coup'] = '.false.' docn_mode = case.get_value("DOCN_MODE") diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 7b08c3c1ec04..0156f3a36d9c 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -197,7 +197,7 @@ logical seq_flds seq_cplflds_inparm - TRUE if wave atm coupling turned on. default is TRUE if WW3 used in compset + TRUE if wave atm coupling turned on. .false. @@ -207,7 +207,7 @@ logical seq_flds seq_cplflds_inparm - TRUE if wave ocean coupling turned on. default is TRUE if WW3 used in compset + TRUE if wave ocean coupling turned on. .false. diff --git a/driver-mct/main/seq_flux_mct.F90 b/driver-mct/main/seq_flux_mct.F90 index acbde5a5b8de..cfc9f12ad3f9 100644 --- a/driver-mct/main/seq_flux_mct.F90 +++ b/driver-mct/main/seq_flux_mct.F90 @@ -1453,7 +1453,9 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) index_o2x_So_roce_16O = mct_aVect_indexRA(o2x,'So_roce_16O', perrWith='quiet') index_o2x_So_roce_HDO = mct_aVect_indexRA(o2x,'So_roce_HDO', perrWith='quiet') index_o2x_So_roce_18O = mct_aVect_indexRA(o2x,'So_roce_18O', perrWith='quiet') - index_w2x_Sw_Charn = mct_aVect_indexRA(w2x,'Sw_Charn') + if (wav_ocn_coup .or. wav_atm_coup) then + index_w2x_Sw_Charn = mct_aVect_indexRA(w2x,'Sw_Charn') + endif call shr_flux_adjust_constants(flux_convergence_tolerance=flux_convergence, & flux_convergence_max_iteration=flux_max_iteration, & coldair_outbreak_mod=coldair_outbreak_mod) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index f047039c6bec..1904b3278c27 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -2520,14 +2520,15 @@ subroutine seq_flds_set(nmlfile, ID, infodata) !----------------------------- ! wav->ocn and ocn->wav !----------------------------- - call seq_flds_add(w2x_states,'Sw_Hs') - call seq_flds_add(x2o_states,'Sw_Hs') - longname = 'Significant wave height' - stdname = 'significant_wave_height' - units = 'm' - attname = 'Sw_Hs' - call metadata_set(attname, longname, stdname, units) - + if (wav_ocn_coup) then + call seq_flds_add(w2x_states,'Sw_Hs') + call seq_flds_add(x2o_states,'Sw_Hs') + longname = 'Significant wave height' + stdname = 'significant_wave_height' + units = 'm' + attname = 'Sw_Hs' + call metadata_set(attname, longname, stdname, units) + endif if (wav_ocn_coup) then call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_1') call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_1') From 99e5dc74378335c50d28854a4e9399e822db4cc7 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 6 Jun 2024 14:24:58 -0500 Subject: [PATCH 34/56] syntax fix the buildnml for drv_in for wav_coupling variables --- driver-mct/cime_config/buildnml | 23 ++++++++----------- .../cime_config/namelist_definition_drv.xml | 2 ++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index aa97d5489f8e..a0b116aadd40 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -54,19 +54,6 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['atm_grid'] = case.get_value('ATM_GRID') config['lnd_grid'] = case.get_value('LND_GRID') config['compocn'] = case.get_value('COMP_OCN') - - if 'ww3' in case.get_value('COMP_WAV'): - config['WAVSPEC'] = case.get_value('WAV_SPEC') - if 'eam' in case.get_value('COMP_ATM'): - config['wav_atm_coup'] = '.true.' - if 'mpaso' in case.get_value('COMP_OCN'): - config['wav_ocn_coup'] = '.true.' - - elif 'dwav' in case.get_value('COMP_WAV'): - config['WAVSPEC'] = 'sp36x36' - else: - config['WAVSPEC'] = 'none' - docn_mode = case.get_value("DOCN_MODE") if docn_mode and 'aqua' in docn_mode: @@ -81,6 +68,16 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): elif case.get_value('RUN_TYPE') == 'branch': config['run_type'] = 'branch' + # change wave coupling setttings based on compset + if case.get_value('COMP_WAV') == 'ww3': + config['WAVSPEC'] = case.get_value('WAV_SPEC') + config['WAV_ATM_COUP'] = '.true.' if case.get_value('COMP_ATM') == 'eam' else '.false.' + config['WAV_OCN_COUP'] = '.true.' if case.get_value('COMP_OCN') == 'mpaso' else '.false.' + elif case.get_value('COMP_WAV') == 'dwav': + config['WAVSPEC'] = 'sp36x36' + else: + config['WAVSPEC'] = 'none' + #---------------------------------------------------- # Initialize namelist defaults #---------------------------------------------------- diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 0156f3a36d9c..f21e57f1aea5 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -200,6 +200,7 @@ TRUE if wave atm coupling turned on. .false. + .true. @@ -210,6 +211,7 @@ TRUE if wave ocean coupling turned on. .false. + .true. From 1659784919beebedb4ed6da3712444f57ea7438b Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 7 Jun 2024 12:55:38 -0500 Subject: [PATCH 35/56] change all wave coupling namelists from boolean to char. i.e. wav_ocn_coup = 'none', 'one', or 'two' for no coupling, one way coupling (ocn to wav), or full two way coupling --- components/mpas-ocean/bld/build-namelist | 8 ++-- components/mpas-ocean/cime_config/buildnml | 5 +-- .../mpas-ocean/driver/mpaso_cpl_indices.F | 2 +- components/mpas-ocean/driver/ocn_comp_mct.F | 2 +- components/ww3/src/cpl/wav_comp_mct.F90 | 12 +++--- components/ww3/src/cpl/ww3_cpl_indices.f90 | 6 +-- driver-mct/cime_config/buildnml | 5 ++- .../cime_config/namelist_definition_drv.xml | 32 ++++++++++---- driver-mct/main/seq_flux_mct.F90 | 8 ++-- driver-mct/shr/seq_flds_mod.F90 | 42 ++++++++++--------- share/util/shr_flux_mod.F90 | 4 +- 11 files changed, 71 insertions(+), 55 deletions(-) diff --git a/components/mpas-ocean/bld/build-namelist b/components/mpas-ocean/bld/build-namelist index 6c477e581f83..3c44d8960266 100755 --- a/components/mpas-ocean/bld/build-namelist +++ b/components/mpas-ocean/bld/build-namelist @@ -440,8 +440,8 @@ my $RUN_STARTDATE = "$xmlvars{'RUN_STARTDATE'}"; my $START_TOD = "$xmlvars{'START_TOD'}"; my $RUN_REFDATE = "$xmlvars{'RUN_REFDATE'}"; my $CONTINUE_RUN = "$xmlvars{'CONTINUE_RUN'}"; - -my $wav_ocn_coup = "$xmlvars{'WAV_OCN_COUP'}"; +my $COMP_OCN = "$xmlvars{'COMP_OCN'}"; +my $COMP_WAV = "$xmlvars{'COMP_WAV'}"; my $output_r = "./${CASE}.mpaso.r"; my $output_h = "./${CASE}.mpaso.h"; @@ -665,7 +665,7 @@ add_default($nl, 'configure_cvmix_kpp_minimum_OBL_under_sea_ice'); add_default($nl, 'config_cvmix_kpp_stop_OBL_search'); add_default($nl, 'config_cvmix_kpp_use_enhanced_diff'); add_default($nl, 'config_cvmix_kpp_nonlocal_with_implicit_mix'); -if ($wav_ocn_coup eq 'true' ) { +if ($COMP_WAV eq 'ww3' and $COMP_OCN eq 'mpaso' ) { add_default($nl, 'config_cvmix_kpp_use_theory_wave', 'val'=>'.false.'); add_default($nl, 'config_cvmix_kpp_use_active_wave', 'val'=>'.true.'); add_default($nl, 'config_cvmix_kpp_langmuir_mixing_opt', 'val'=>'LWF16'); @@ -680,7 +680,7 @@ if ($wav_ocn_coup eq 'true' ) { # Namelist group: wave_coupling # ################################# -if ($wav_ocn_coup eq 'true' ) { +if ($COMP_WAV eq 'ww3' and $COMP_OCN eq 'mpaso' ) { add_default($nl, 'config_use_active_wave', 'val'=>'.true.'); add_default($nl, 'config_momentum_use_active_wave', 'val'=>'.true.'); } else { diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 89aea1ff92aa..9fe8bebb459b 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -38,7 +38,6 @@ def buildnml(case, caseroot, compname): ocn_sgr = case.get_value("MPASO_SGR") ocn_bgc = case.get_value("MPASO_BGC") ocn_tidal_mixing = case.get_value("MPASO_TIDAL_MIXING") - wav_ocn_coup = case.get_value("WAV_OCN_COUP") ocn_co2_type = case.get_value("OCN_CO2_TYPE") atm_co2_const_val = case.get_value("CCSM_CO2_PPMV") ice_bgc = case.get_value("MPASI_BGC") @@ -994,7 +993,7 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append('') lines.append('') - if wav_ocn_coup == 'true': + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': lines.append('') lines.append(' ') lines.append(' ') - if wav_ocn_coup == 'true': + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': lines.append(' ') lines.append(' ') lines.append(' ') diff --git a/components/mpas-ocean/driver/mpaso_cpl_indices.F b/components/mpas-ocean/driver/mpaso_cpl_indices.F index 76b5b2562435..64e37c510a02 100644 --- a/components/mpas-ocean/driver/mpaso_cpl_indices.F +++ b/components/mpas-ocean/driver/mpaso_cpl_indices.F @@ -323,7 +323,7 @@ subroutine mpaso_cpl_indices_set( ) index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_grounded') index_x2o_Sg_icemask = mct_avect_indexra(x2o,'Sg_icemask_floating') - if (wav_ocn_coup) then + if (wav_ocn_coup == 'two') then index_x2o_Sw_ustokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_1') index_x2o_Sw_vstokes_wavenumber_1 = mct_avect_indexra(x2o,'Sw_vstokes_wavenumber_1') index_x2o_Sw_ustokes_wavenumber_2 = mct_avect_indexra(x2o,'Sw_ustokes_wavenumber_2') diff --git a/components/mpas-ocean/driver/ocn_comp_mct.F b/components/mpas-ocean/driver/ocn_comp_mct.F index 840a65d6f10f..ccf627f55f55 100644 --- a/components/mpas-ocean/driver/ocn_comp_mct.F +++ b/components/mpas-ocean/driver/ocn_comp_mct.F @@ -2199,7 +2199,7 @@ subroutine ocn_import_mct(x2o_o, errorCode)!{{{ iceFraction(i) = x2o_o % rAttr(index_x2o_Si_ifrac, n) end if - if (wav_ocn_coup) then + if (wav_ocn_coup == 'two') then if ( stokesDriftZonalWavenumberField % isActive ) then stokesDriftZonalWavenumber(1,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_1, n) stokesDriftZonalWavenumber(2,i) = x2o_o % rAttr(index_x2o_Sw_ustokes_wavenumber_2, n) diff --git a/components/ww3/src/cpl/wav_comp_mct.F90 b/components/ww3/src/cpl/wav_comp_mct.F90 index 6fd330fc29b5..911c0b98108b 100644 --- a/components/ww3/src/cpl/wav_comp_mct.F90 +++ b/components/ww3/src/cpl/wav_comp_mct.F90 @@ -1208,11 +1208,11 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) IY = MAPSF(ISEA,2) if (MAPSTA(IY,IX) .eq. 1) then - w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea) - if (wav_atm_coup .or. wav_ocn_coup) then + if (wav_atm_coup .eq. 'two' .or. wav_ocn_coup .eq. 'two') then w2x_w%rattr(index_w2x_Sw_Charn,jsea) = CHARN(jsea) endif - if (wav_ocn_coup) then + if (wav_ocn_coup .eq. 'two') then + w2x_w%rattr(index_w2x_Sw_Hs,jsea) = HS(jsea) w2x_w%rattr(index_w2x_Sw_Fp,jsea) = FP0(jsea) w2x_w%rattr(index_w2x_Sw_Dp,jsea) = THP0(jsea) w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 1000*TAUWIX(jsea) !Conversion to N m^{-2} by multiplying by density of water (See eqn 2.99 WW3 Manual) @@ -1241,12 +1241,12 @@ SUBROUTINE WAV_RUN_MCT(EClock, cdata_w, x2w_w, w2x_w) w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = USSP(jsea,nk+6) endif else - w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0 - if (wav_atm_coup .or. wav_ocn_coup) then + if (wav_atm_coup .eq. 'two' .or. wav_ocn_coup .eq. 'two') then w2x_w%rattr(index_w2x_Sw_Charn,jsea) = 0.0 endif - if (wav_ocn_coup) then + if (wav_ocn_coup .eq. 'two') then + w2x_w%rattr(index_w2x_Sw_Hs,jsea) = 0.0 w2x_w%rattr(index_w2x_Sw_Fp,jsea) = 0.0 w2x_w%rattr(index_w2x_Sw_Dp,jsea) = 0.0 w2x_w%rattr(index_w2x_Faww_Tawx,jsea) = 0.0 diff --git a/components/ww3/src/cpl/ww3_cpl_indices.f90 b/components/ww3/src/cpl/ww3_cpl_indices.f90 index 28e4f3ecd69f..5613a68799e2 100644 --- a/components/ww3/src/cpl/ww3_cpl_indices.f90 +++ b/components/ww3/src/cpl/ww3_cpl_indices.f90 @@ -70,11 +70,11 @@ subroutine ww3_cpl_indices_set( ) index_x2w_So_bldepth = mct_avect_indexra(x2w,'So_bldepth') ! Boundary layer depth index_x2w_So_ssh = mct_avect_indexra(x2w,'So_ssh') ! Sea surface height - index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height - if (wav_ocn_coup .or. wav_atm_coup) then + if (wav_ocn_coup .eq. 'two' .or. wav_atm_coup .eq. 'two') then index_w2x_Sw_Charn = mct_avect_indexra(w2x,'Sw_Charn') ! Charnock coeff accounting for the wave stress (Janssen 1989, 1991) endif - if (wav_ocn_coup) then + if (wav_ocn_coup .eq. 'two') then + index_w2x_Sw_Hs = mct_avect_indexra(w2x,'Sw_Hs') ! Significant wave height index_w2x_Sw_Fp = mct_avect_indexra(w2x,'Sw_Fp') ! Peak wave freqency index_w2x_Sw_Dp = mct_avect_indexra(w2x,'Sw_Dp') ! Peak wave direction index_w2x_Faww_Tawx = mct_avect_indexra(w2x,'Faww_Tawx') ! Zonal Wave supported stress (Stress from atmosphere to waves) diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index a0b116aadd40..9c6c7ccfeba0 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -71,8 +71,9 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): # change wave coupling setttings based on compset if case.get_value('COMP_WAV') == 'ww3': config['WAVSPEC'] = case.get_value('WAV_SPEC') - config['WAV_ATM_COUP'] = '.true.' if case.get_value('COMP_ATM') == 'eam' else '.false.' - config['WAV_OCN_COUP'] = '.true.' if case.get_value('COMP_OCN') == 'mpaso' else '.false.' + config['WAV_ATM_COUP'] = 'two' if case.get_value('COMP_ATM') == 'eam' else 'one' + config['WAV_OCN_COUP'] = 'two' if case.get_value('COMP_OCN') == 'mpaso' else 'one' + config['WAV_ICE_COUP'] = 'two' if case.get_value('COMP_ICE') == 'mpassi' else 'one' elif case.get_value('COMP_WAV') == 'dwav': config['WAVSPEC'] = 'sp36x36' else: diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index f21e57f1aea5..416c06f96086 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -194,24 +194,38 @@ - logical + char seq_flds seq_cplflds_inparm - TRUE if wave atm coupling turned on. + One- or Two-way coupling between Wave and Atm. - .false. - .true. + none + one + two - - logical + + char seq_flds seq_cplflds_inparm - TRUE if wave ocean coupling turned on. + One- or Two-way coupling between Wave and Ocn. - .false. - .true. + none + one + two + + + + + char + seq_flds + seq_cplflds_inparm + One- or Two-way coupling between Wave and Sea Ice. + + none + one + two diff --git a/driver-mct/main/seq_flux_mct.F90 b/driver-mct/main/seq_flux_mct.F90 index cfc9f12ad3f9..e4ceabbdd17e 100644 --- a/driver-mct/main/seq_flux_mct.F90 +++ b/driver-mct/main/seq_flux_mct.F90 @@ -1453,8 +1453,8 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) index_o2x_So_roce_16O = mct_aVect_indexRA(o2x,'So_roce_16O', perrWith='quiet') index_o2x_So_roce_HDO = mct_aVect_indexRA(o2x,'So_roce_HDO', perrWith='quiet') index_o2x_So_roce_18O = mct_aVect_indexRA(o2x,'So_roce_18O', perrWith='quiet') - if (wav_ocn_coup .or. wav_atm_coup) then - index_w2x_Sw_Charn = mct_aVect_indexRA(w2x,'Sw_Charn') + if (wav_ocn_coup == 'two' .or. wav_atm_coup == 'two') then + index_w2x_Sw_Charn = mct_aVect_indexRA(w2x,'Sw_Charn') endif call shr_flux_adjust_constants(flux_convergence_tolerance=flux_convergence, & flux_convergence_max_iteration=flux_max_iteration, & @@ -1560,7 +1560,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) tocn(n) = o2x%rAttr(index_o2x_So_t ,n) uocn(n) = o2x%rAttr(index_o2x_So_u ,n) vocn(n) = o2x%rAttr(index_o2x_So_v ,n) - if (wav_atm_coup) charnsea(n) = w2x%rAttr(index_w2x_Sw_Charn ,n) + if (wav_atm_coup == 'two') charnsea(n) = w2x%rAttr(index_w2x_Sw_Charn ,n) if ( index_o2x_So_roce_16O /= 0 ) roce_16O(n) = o2x%rAttr(index_o2x_So_roce_16O, n) if ( index_o2x_So_roce_HDO /= 0 ) roce_HDO(n) = o2x%rAttr(index_o2x_So_roce_HDO, n) if ( index_o2x_So_roce_18O /= 0 ) roce_18O(n) = o2x%rAttr(index_o2x_So_roce_18O, n) @@ -1639,7 +1639,7 @@ subroutine seq_flux_atmocn_mct(infodata, tod, dt, a2x, o2x, xao, w2x) duu10n,ustar, re , ssq, wsresp=wsresp, tau_est=tau_est) u10res = sqrt(duu10n) ! atm-supplied gustiness not implemented for UA else - if (wav_atm_coup) then + if (wav_atm_coup == 'two') then call shr_flux_atmocn (nloc , zbot , ubot, vbot, thbot, & shum , shum_16O , shum_HDO, shum_18O, dens , tbot, uocn, vocn , & tocn , emask, seq_flux_atmocn_minwind, & diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index 1904b3278c27..a36e60ee6499 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -162,8 +162,9 @@ module seq_flds_mod logical :: ocn_rof_two_way ! .true. if river-ocean two-way coupling turned on logical :: rof_sed ! .true. if river model includes sediment - logical :: wav_ocn_coup ! .true. if wave-atm two-way coupling turned on - logical :: wav_atm_coup ! .true. if wave-atm two-way coupling turned on + character(len=CS) :: wav_ocn_coup ! 'two' if wave-ocean two-way coupling turned on + character(len=CS) :: wav_atm_coup ! 'two' if wave-atm two-way coupling turned on + character(len=CS) :: wav_ice_coup ! 'two' if wave-ice two-way coupling turned on !---------------------------------------------------------------------------- ! metadata !---------------------------------------------------------------------------- @@ -389,7 +390,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ice_ncat, seq_flds_i2o_per_cat, flds_bgc_oi, & nan_check_component_fields, rof_heat, atm_flux_method, atm_gustiness, & rof2ocn_nutrients, lnd_rof_two_way, ocn_rof_two_way, rof_sed, & - wav_ocn_coup, wav_atm_coup + wav_ocn_coup, wav_atm_coup, wav_ice_coup ! user specified new fields integer, parameter :: nfldmax = 200 @@ -432,8 +433,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata) lnd_rof_two_way = .false. ocn_rof_two_way = .false. rof_sed = .false. - wav_ocn_coup = .false. - wav_atm_coup = .false. + wav_ocn_coup = 'none' + wav_atm_coup = 'none' + wav_ice_coup = 'none' unitn = shr_file_getUnit() write(logunit,"(A)") subname//': read seq_cplflds_inparm namelist from: '& @@ -470,6 +472,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call shr_mpi_bcast(rof_sed, mpicom) call shr_mpi_bcast(wav_ocn_coup, mpicom) call shr_mpi_bcast(wav_atm_coup, mpicom) + call shr_mpi_bcast(wav_ice_coup, mpicom) call glc_elevclass_init(glc_nec) @@ -655,7 +658,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2r_states,"Sa_u") call seq_flds_add(a2x_states_to_rof,"Sa_u") endif - call seq_flds_add(x2w_states,"Sa_u") + if (wav_atm_coup .ne. 'none') call seq_flds_add(x2w_states,"Sa_u") longname = 'Zonal wind at the lowest model level' stdname = 'eastward_wind' units = 'm s-1' @@ -670,7 +673,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2r_states,"Sa_v") call seq_flds_add(a2x_states_to_rof,"Sa_v") endif - call seq_flds_add(x2w_states,"Sa_v") + if (wav_atm_coup .ne. 'none') call seq_flds_add(x2w_states,"Sa_v") longname = 'Meridional wind at the lowest model level' stdname = 'northward_wind' units = 'm s-1' @@ -719,7 +722,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(x2r_states,"Sa_tbot") call seq_flds_add(a2x_states_to_rof,"Sa_tbot") endif - call seq_flds_add(x2w_states,"Sa_tbot") + if (wav_atm_coup .ne. 'none') call seq_flds_add(x2w_states,"Sa_tbot") longname = 'Temperature at the lowest model level' stdname = 'air_temperature' units = 'K' @@ -1519,7 +1522,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Fractional ice coverage wrt ocean call seq_flds_add(i2x_states,"Si_ifrac") call seq_flds_add(x2o_states,"Si_ifrac") - call seq_flds_add(x2w_states,"Si_ifrac") + if (wav_ice_coup .ne. 'none') call seq_flds_add(x2w_states,"Si_ifrac") longname = 'Fractional ice coverage wrt ocean' stdname = 'sea_ice_area_fraction' units = '1' @@ -1696,7 +1699,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Sea surface temperature call seq_flds_add(o2x_states,"So_t") call seq_flds_add(x2i_states,"So_t") - call seq_flds_add(x2w_states,"So_t") + if (wav_ocn_coup .ne. 'none') call seq_flds_add(x2w_states,"So_t") ! Sea surface salinity call seq_flds_add(o2x_states,"So_s") @@ -1710,7 +1713,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Zonal sea water velocity call seq_flds_add(o2x_states,"So_u") call seq_flds_add(x2i_states,"So_u") - call seq_flds_add(x2w_states,"So_u") + if (wav_ocn_coup .ne. 'none') call seq_flds_add(x2w_states,"So_u") longname = 'Zonal sea water velocity' stdname = 'eastward_sea_water_velocity' units = 'm s-1' @@ -1720,7 +1723,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Meridional sea water velocity call seq_flds_add(o2x_states,"So_v") call seq_flds_add(x2i_states,"So_v") - call seq_flds_add(x2w_states,"So_v") + if (wav_ocn_coup .ne. 'none') call seq_flds_add(x2w_states,"So_v") longname = 'Meridional sea water velocity' stdname = 'northward_sea_water_velocity' units = 'm s-1' @@ -1739,7 +1742,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call seq_flds_add(o2x_states,"So_ssh") call seq_flds_add(x2r_states,"So_ssh") call seq_flds_add(o2x_states_to_rof,"So_ssh") - call seq_flds_add(x2w_states,'So_ssh') + if (wav_ocn_coup .ne. 'none') call seq_flds_add(x2w_states,'So_ssh') longname = 'Sea surface height' stdname = 'sea_surface_height' units = 'm' @@ -1757,7 +1760,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Boundary Layer Depth call seq_flds_add(o2x_states,"So_bldepth") - call seq_flds_add(x2w_states,"So_bldepth") + if (wav_ocn_coup .ne. 'none') call seq_flds_add(x2w_states,"So_bldepth") longname = 'Ocean Boundary Layer Depth' stdname = 'ocean_boundary_layer_depth' units = 'm' @@ -2181,7 +2184,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) ! Sea ice thickness call seq_flds_add(i2x_states,"Si_ithick") - call seq_flds_add(x2w_states,"Si_ithick") + if (wav_ice_coup .ne. 'none') call seq_flds_add(x2w_states,"Si_ithick") longname = 'Sea ice thickness' stdname = 'sea_ice_thickness' units = 'm' @@ -2520,7 +2523,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) !----------------------------- ! wav->ocn and ocn->wav !----------------------------- - if (wav_ocn_coup) then + if (wav_ocn_coup == 'two') then call seq_flds_add(w2x_states,'Sw_Hs') call seq_flds_add(x2o_states,'Sw_Hs') longname = 'Significant wave height' @@ -2528,8 +2531,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) units = 'm' attname = 'Sw_Hs' call metadata_set(attname, longname, stdname, units) - endif - if (wav_ocn_coup) then + call seq_flds_add(w2x_states,'Sw_ustokes_wavenumber_1') call seq_flds_add(x2o_states,'Sw_ustokes_wavenumber_1') longname = 'Partitioned Stokes drift u component, wavenumber 1' @@ -2691,9 +2693,9 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) endif - if (wav_atm_coup .or. wav_ocn_coup) then + if (wav_atm_coup == 'two' or wav_ocn_coup == 'two') then call seq_flds_add(w2x_states,'Sw_Charn') - call seq_flds_add(x2o_states,'Sw_Charn') + if (wav_ocn_coup == 'two') call seq_flds_add(x2o_states,'Sw_Charn') longname = 'Charnock coefficent based on sea state' stdname = 'Charnock_coefficent_based_on_sea_state' units = '' diff --git a/share/util/shr_flux_mod.F90 b/share/util/shr_flux_mod.F90 index 8fe9bbe8c86f..ef4d151aeb70 100644 --- a/share/util/shr_flux_mod.F90 +++ b/share/util/shr_flux_mod.F90 @@ -541,7 +541,7 @@ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & endif endif ssq = 0.98_R8 * qsat(ts(n)) / rbot(n) ! sea surf hum (kg/kg) - if (wav_atm_coup) then + if (wav_atm_coup .eq. 'two') then call cor30a(ubot(n),vbot(n),tbot(n),qbot(n),rbot(n) & ! in atm params & ,us(n),vs(n),ts(n),ssq & ! in surf params & ,zpbl,zbot(n),zbot(n),zref,ztref,ztref & ! in heights @@ -2646,7 +2646,7 @@ subroutine cor30a(ubt,vbt,tbt,qbt,rbt & ! in atm params tsr = (dt-dter*jcool)*von/(log(zt/zot10)-psit_30(zt/L10)) qsr = (dq-dqer*jcool)*von/(log(zq/zot10)-psit_30(zq/L10)) - if (wav_atm_coup) then + if (wav_atm_coup .eq. 'two') then charn = charnsea !use Charnock coefficient from active wave model (Janssen 1989, 1991) else ! parametrisation for Charney parameter (section 3c of Fairall et al. 2003) From bb6c0b287971801241686802d48f8121fb5797cb Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 11 Jun 2024 14:55:15 -0500 Subject: [PATCH 36/56] add wav_ocn_coup to prep_ocn_mod --- driver-mct/main/prep_ocn_mod.F90 | 4 ++-- driver-mct/shr/seq_flds_mod.F90 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index b726b1516b2e..845e9ded6825 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -534,7 +534,7 @@ subroutine prep_ocn_merge( flux_epbalfact, a2x_o, i2x_o, r2x_o, w2x_o, g2x_o, xa fractions_o, x2o_o ) use prep_glc_mod, only: prep_glc_calculate_subshelf_boundary_fluxes - + use seq_flds_mod, only: wav_ocn_coup !----------------------------------------------------------------------- ! ! Arguments @@ -977,7 +977,7 @@ subroutine prep_ocn_merge( flux_epbalfact, a2x_o, i2x_o, r2x_o, w2x_o, g2x_o, xa call mct_aVect_copy(aVin=a2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=a2x_SharedIndices) call mct_aVect_copy(aVin=i2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=i2x_SharedIndices) call mct_aVect_copy(aVin=r2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=r2x_SharedIndices) - call mct_aVect_copy(aVin=w2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=w2x_SharedIndices) + if(wav_ocn_coup == 'two') call mct_aVect_copy(aVin=w2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=w2x_SharedIndices) call mct_aVect_copy(aVin=xao_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=xao_SharedIndices) call mct_aVect_copy(aVin=g2x_o, aVout=x2o_o, vector=mct_usevector, sharedIndices=g2x_SharedIndices) diff --git a/driver-mct/shr/seq_flds_mod.F90 b/driver-mct/shr/seq_flds_mod.F90 index a36e60ee6499..e14d40ea1f35 100644 --- a/driver-mct/shr/seq_flds_mod.F90 +++ b/driver-mct/shr/seq_flds_mod.F90 @@ -2693,7 +2693,7 @@ subroutine seq_flds_set(nmlfile, ID, infodata) call metadata_set(attname, longname, stdname, units) endif - if (wav_atm_coup == 'two' or wav_ocn_coup == 'two') then + if (wav_atm_coup == 'two' .or. wav_ocn_coup == 'two') then call seq_flds_add(w2x_states,'Sw_Charn') if (wav_ocn_coup == 'two') call seq_flds_add(x2o_states,'Sw_Charn') longname = 'Charnock coefficent based on sea state' From 815b05f5461f53de8c39e6c25f47f1dcd74426bd Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 11 Jun 2024 16:38:13 -0500 Subject: [PATCH 37/56] add F+WW3 compset --- components/ww3/cime_config/config_compsets.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/ww3/cime_config/config_compsets.xml b/components/ww3/cime_config/config_compsets.xml index 1fb44c188a63..e06a77d35761 100644 --- a/components/ww3/cime_config/config_compsets.xml +++ b/components/ww3/cime_config/config_compsets.xml @@ -24,6 +24,11 @@ 2000_DATM%CFSR_SLND_SICE_SOCN_SROF_SGLC_WW3%sp36x36 + + F1850-WW3 + 1850_EAM%CMIP6_ELM%CNPRDCTCBCTOP_MPASSI%PRES_DOCN%DOM_MOSART_SGLC_WW3%sp36x36 + + DTESTM-JRA1p5-WW3 2000_DATM%JRA-1p5_SLND_MPASSI_DOCN%SOM_DROF%JRA-1p5_SGLC_WW3%sp36x36_TEST From ed670c10533bc78f865d07a10d1f6877939314cc Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 13 Jun 2024 15:55:49 -0500 Subject: [PATCH 38/56] modify F+WW3 compset --- components/ww3/cime_config/config_compsets.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ww3/cime_config/config_compsets.xml b/components/ww3/cime_config/config_compsets.xml index e06a77d35761..e54003b8d1d8 100644 --- a/components/ww3/cime_config/config_compsets.xml +++ b/components/ww3/cime_config/config_compsets.xml @@ -25,8 +25,8 @@ - F1850-WW3 - 1850_EAM%CMIP6_ELM%CNPRDCTCBCTOP_MPASSI%PRES_DOCN%DOM_MOSART_SGLC_WW3%sp36x36 + F2010-WW3 + 2010_EAM%CMIP6_ELM%CNPRDCTCBCTOP_MPASSI%PRES_DOCN%DOM_MOSART_SGLC_WW3%sp36x36 From fc8782af369fdb8d40cbd6960f0d805770698560 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 28 Jun 2024 14:05:59 -0500 Subject: [PATCH 39/56] preliminary pe config for anvil and chrys for B compsets with WW3. --- cime_config/allactive/config_pesall.xml | 118 +++++++++++++----------- 1 file changed, 62 insertions(+), 56 deletions(-) diff --git a/cime_config/allactive/config_pesall.xml b/cime_config/allactive/config_pesall.xml index 0d5f24565966..53275c9bac0f 100644 --- a/cime_config/allactive/config_pesall.xml +++ b/cime_config/allactive/config_pesall.xml @@ -624,6 +624,36 @@ 0 + + anvil --compset WCYCL+ww3 --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 + + 2700 + 90 + 90 + 2610 + 504 + 2700 + 1080 + + + 0 + 2610 + 2610 + 0 + 2700 + 0 + 3204 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + anvil: --compset BGC* --res ne30pg2_r05_EC30to60E2r2 on 30 nodes pure-MPI, ~3 sypd @@ -644,6 +674,38 @@ + + + chrysalis --compset WCYCL+ww3 --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 + + 1350 + 72 + 72 + 1296 + 1296 + 216 + 612 + + + 0 + 1080 + 1080 + 0 + 1368 + 0 + 1728 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + + + crusher: --compset BGC* --res ne30pg2_r05_EC30to60E2r2 on 2 nodes pure-MPI @@ -2202,62 +2264,6 @@ - - - - none - - 1350 - 72 - 72 - 1296 - 1296 - 216 - 612 - - - 1296 - 1296 - 1368 - 1584 - - - - - - - - --compset WCYCL* --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 on 48 nodes pure-MPI, ~8.8 sypd - - 1350 - 288 - 288 - 1080 - 360 - 1080 - 612 - - - 1 - 1 - 1 - 1 - 1 - 1 - 1 - - - 0 - 1080 - 1080 - 0 - 1368 - 0 - 1728 - - - - From 0294558cf7956500408044d5d1d133d77cb067cb Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 28 Jun 2024 14:42:17 -0500 Subject: [PATCH 40/56] edit PE layout for anvil --- cime_config/allactive/config_pesall.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cime_config/allactive/config_pesall.xml b/cime_config/allactive/config_pesall.xml index 53275c9bac0f..d6437b8a7964 100644 --- a/cime_config/allactive/config_pesall.xml +++ b/cime_config/allactive/config_pesall.xml @@ -628,21 +628,21 @@ anvil --compset WCYCL+ww3 --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 2700 - 90 - 90 - 2610 - 504 + 140 + 140 + 2560 + 480 2700 1080 0 - 2610 - 2610 + 2560 + 2560 0 2700 0 - 3204 + 3180 1 From 0c4fd2e9f0d0d5b82a552a641630f1dc3be301b6 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Mon, 8 Jul 2024 14:44:09 -0500 Subject: [PATCH 41/56] final PE layout for B+WW3 on ANVIL --- cime_config/allactive/config_pesall.xml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cime_config/allactive/config_pesall.xml b/cime_config/allactive/config_pesall.xml index d6437b8a7964..76eeb942a912 100644 --- a/cime_config/allactive/config_pesall.xml +++ b/cime_config/allactive/config_pesall.xml @@ -627,22 +627,22 @@ anvil --compset WCYCL+ww3 --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 - 2700 - 140 - 140 - 2560 - 480 - 2700 - 1080 + 1350 + 72 + 72 + 1296 + 180 + 1368 + 540 0 - 2560 - 2560 + 1296 + 1296 0 - 2700 + 1368 0 - 3180 + 1548 1 From 2fb69867d81d6b04c45acfe9a12c19b2331a6fd8 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 10 Jul 2024 15:40:38 -0500 Subject: [PATCH 42/56] add comment to shr_flux_mod about coare3.0 w/ wave coupling. update anvil Pe layout for B case with waves --- cime_config/allactive/config_pesall.xml | 6 +++--- share/util/shr_flux_mod.F90 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/allactive/config_pesall.xml b/cime_config/allactive/config_pesall.xml index 76eeb942a912..382b0ac79556 100644 --- a/cime_config/allactive/config_pesall.xml +++ b/cime_config/allactive/config_pesall.xml @@ -631,9 +631,9 @@ 72 72 1296 - 180 + 216 1368 - 540 + 288 0 @@ -642,7 +642,7 @@ 0 1368 0 - 1548 + 1584 1 diff --git a/share/util/shr_flux_mod.F90 b/share/util/shr_flux_mod.F90 index ef4d151aeb70..7f8a776a2c87 100644 --- a/share/util/shr_flux_mod.F90 +++ b/share/util/shr_flux_mod.F90 @@ -137,7 +137,7 @@ end subroutine shr_flux_adjust_constants ! ! 2011-Mar-13 - J. Nusbaumer - Water Isotope ocean flux added. ! 2019-May-16 - Jack Reeves Eyre (UA) and Kai Zhang (PNNL) - Added COARE/Fairall surface flux scheme option (ocn_surface_flux_scheme .eq. 1) based on code from Thomas Toniazzo (Bjerknes Centre, Bergen) ” -! +! 2024-Jul-10 - E. Thomas ethomas@lanl.gov - implementing Coare3.0 w/ Wave coupling (uses charnock paramter from WW3) ! !INTERFACE: ------------------------------------------------------------------ SUBROUTINE shr_flux_atmOcn(nMax ,zbot ,ubot ,vbot ,thbot , & From 7b79a5e340607718f55b46769087092645b439f1 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Fri, 26 Jul 2024 16:12:00 -0500 Subject: [PATCH 43/56] add monthly and daily wave output streams --- components/mpas-ocean/cime_config/buildnml | 43 +++++++++++++++++----- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 9fe8bebb459b..5559cb5d8764 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -994,16 +994,16 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': - lines.append('') + lines.append(' packages="timeSeriesStatsMonthlyAMPKG">') lines.append('') lines.append(' ') lines.append(' ') @@ -1020,8 +1020,38 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + lines.append(' ') lines.append('') lines.append('') + lines.append('') + lines.append('') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append('') + lines.append('') + lines.append('') lines.append(' ') lines.append(' ') - if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') lines.append('') lines.append('') From 4f6eefa33f976d0c8d617f99a76036a650d4cbfb Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 8 Aug 2024 10:31:21 -0500 Subject: [PATCH 44/56] bug fix (remove duplicate line) and update pio format. --- components/mpas-ocean/cime_config/buildnml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 5559cb5d8764..9da7b8f5daa2 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -997,7 +997,7 @@ def buildnml(case, caseroot, compname): lines.append('') lines.append('') lines.append(' Date: Mon, 12 Aug 2024 11:23:14 -0500 Subject: [PATCH 45/56] update PE layout for fully coupled wave compsets, clean up namelist scripts --- cime_config/allactive/config_pesall.xml | 28 +++++++++---------- components/ww3/bld/build-namelist | 7 +---- .../ww3/cime_config/config_compsets.xml | 9 ++---- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/cime_config/allactive/config_pesall.xml b/cime_config/allactive/config_pesall.xml index 382b0ac79556..5953504dd521 100644 --- a/cime_config/allactive/config_pesall.xml +++ b/cime_config/allactive/config_pesall.xml @@ -631,9 +631,9 @@ 72 72 1296 - 216 + 180 1368 - 288 + 252 0 @@ -642,7 +642,7 @@ 0 1368 0 - 1584 + 1548 1 @@ -678,22 +678,22 @@ chrysalis --compset WCYCL+ww3 --res ne30pg2_EC30to60E2r2_wQU225EC30to60E2r2 - 1350 - 72 - 72 - 1296 - 1296 - 216 - 612 + 1024 + 384 + 384 + 640 + 1024 + 256 + 640 0 - 1080 - 1080 + 640 + 640 0 - 1368 + 1024 0 - 1728 + 1280 1 diff --git a/components/ww3/bld/build-namelist b/components/ww3/bld/build-namelist index 092dab3ffba5..df2ac2c63186 100755 --- a/components/ww3/bld/build-namelist +++ b/components/ww3/bld/build-namelist @@ -354,7 +354,7 @@ if ($NML_TYPE eq "ww3_grid") { add_default($nl, 'timesteps%dtkth'); add_default($nl, 'timesteps%dtmin'); - add_default($nl, 'grid%name'); + add_default($nl, 'grid%name', 'val'=>"'${WAV_GRID}'"); add_default($nl, 'grid%nml'); add_default($nl, 'grid%type'); add_default($nl, 'grid%coord'); @@ -387,11 +387,6 @@ if ($NML_TYPE eq "ww3_grid_nml") { add_default($nl, 'unrot'); add_default($nl, 'ussp', 'val'=>"1"); - #add_default($nl, 'iussp', 'val'=>"3"); - #add_default($nl, 'stk_wn', 'val'=>"0.04,0.11,0.3305"); - #add_default($nl, 'stk_wn', 'val'=>"0.025,0.08,0.16,0.35"); - #add_default($nl, 'iussp', 'val'=>"4"); - #add_default($nl, 'stk_wn', 'val'=>"0.025,0.08,0.16,0.35"); add_default($nl, 'iussp', 'val'=>"6"); add_default($nl, 'stk_wn', 'val'=>"0.01,0.03,0.06,0.1,0.2,0.35"); diff --git a/components/ww3/cime_config/config_compsets.xml b/components/ww3/cime_config/config_compsets.xml index e54003b8d1d8..01de245a23b2 100644 --- a/components/ww3/cime_config/config_compsets.xml +++ b/components/ww3/cime_config/config_compsets.xml @@ -15,13 +15,8 @@ - VWW3-CFSv2 - 2000_DATM%CFSv2_SLND_SICE_SOCN_SROF_SGLC_WW3%sp36x36 - - - - VWW3-CFSR - 2000_DATM%CFSR_SLND_SICE_SOCN_SROF_SGLC_WW3%sp36x36 + VWW3-JRA1p5 + 2000_DATM%JRA-1p5_SLND_SICE_SOCN_SROF_SGLC_WW3%sp36x36 From 758443fb0ad7e64fa7cf84201a1165b5ce5e6d2f Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 26 Sep 2024 10:15:11 -0500 Subject: [PATCH 46/56] fix wav coupling flags --- driver-mct/cime_config/buildnml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index 9c6c7ccfeba0..4158b4672791 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -72,8 +72,13 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): if case.get_value('COMP_WAV') == 'ww3': config['WAVSPEC'] = case.get_value('WAV_SPEC') config['WAV_ATM_COUP'] = 'two' if case.get_value('COMP_ATM') == 'eam' else 'one' - config['WAV_OCN_COUP'] = 'two' if case.get_value('COMP_OCN') == 'mpaso' else 'one' - config['WAV_ICE_COUP'] = 'two' if case.get_value('COMP_ICE') == 'mpassi' else 'one' + if case.get_value('COMP_OCN') == 'mpaso': + config['WAV_OCN_COUP'] = 'two' + elif case.get_value('COMP_OCN') == 'docn': + config['WAV_OCN_COUP'] = 'one' + #if case.get_value("DOCN_MODE") == 'som' + if case.get_value('COMP_ICE') == 'mpassi': + config['WAV_ICE_COUP'] = 'two' elif case.get_value('COMP_WAV') == 'dwav': config['WAVSPEC'] = 'sp36x36' else: From d2cc42c0a5b301e0e9ff46147c8f78f3e68559c5 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 26 Sep 2024 12:08:50 -0500 Subject: [PATCH 47/56] put wave output in default MPAS-O files (to ensure correct time series analysis member calculations) --- components/mpas-ocean/cime_config/buildnml | 90 ++++++++-------------- 1 file changed, 32 insertions(+), 58 deletions(-) diff --git a/components/mpas-ocean/cime_config/buildnml b/components/mpas-ocean/cime_config/buildnml index 9da7b8f5daa2..4e5eb54478e9 100755 --- a/components/mpas-ocean/cime_config/buildnml +++ b/components/mpas-ocean/cime_config/buildnml @@ -993,64 +993,6 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append('') lines.append('') - if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': - lines.append('') - lines.append('') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append('') - lines.append('') - lines.append('') - lines.append('') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append(' ') - lines.append('') - lines.append('') lines.append('') lines.append(' ') lines.append(' ') + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') if ocn_bgc in ['eco_only', 'eco_and_dms', 'eco_and_macromolecules', 'eco_and_dms_and_macromolecules']: lines.append(' ') lines.append(' ') @@ -1387,6 +1334,15 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') if not (ocn_grid.startswith("oRRS1") or ocn_grid.startswith("RRSwISC6")): lines.append(' ') lines.append(' ') @@ -1599,6 +1555,15 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') if ocn_iceberg == 'true': lines.append(' ') @@ -1665,6 +1630,15 @@ def buildnml(case, caseroot, compname): lines.append(' ') lines.append(' ') lines.append(' ') + if case.get_value('COMP_WAV') == 'ww3' and case.get_value('COMP_OCN') == 'mpaso': + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') + lines.append(' ') if ocn_iceberg == 'true': lines.append(' ') From ea91ea247475fdeebef30f61c371abeb1eb51e4e Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 12:09:17 -0600 Subject: [PATCH 48/56] add wave to ocn flux cime_config/config_grids.xml --- cime_config/config_grids.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 9ef7dc519923..88da9699996f 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -3653,8 +3653,10 @@ ATM2ROF_FMAPNAME ATM2ROF_SMAPNAME ATM2WAV_SMAPNAME + WAV2ATM_SMAPNAME OCN2WAV_SMAPNAME WAV2OCN_SMAPNAME + WAV2OCN_FMAPNAME ICE2WAV_SMAPNAME ROF2OCN_LIQ_RMAPNAME @@ -5062,6 +5064,10 @@ cpl/gridmaps/wQU225Icos30E3r5/map_ne30pg2_to_wQU225Icos30E3r5_esmfbilin.20240910.nc +<<<<<<< HEAD +======= + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_ne30pg2_esmfbilin.20240910.nc +>>>>>>> cd6a57fcd5 (add wave to ocn flux cime_config/config_grids.xml) @@ -5076,12 +5082,17 @@ cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_blin.20220222.nc + cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_EC30to60E2r2_aave.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225EC30to60E2r2/map_EC30to60E2r2_TO_wQU225EC30to60E2r2_blin.20220222.nc cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc +<<<<<<< HEAD +======= + cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfaave.20240910.nc +>>>>>>> cd6a57fcd5 (add wave to ocn flux cime_config/config_grids.xml) cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc From a9a077cf79cbd36ac6622892dd1dcdc87727df58 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 12:09:56 -0600 Subject: [PATCH 49/56] wave to ocn flux driver-mct/cime_config/config_component.xml --- driver-mct/cime_config/config_component.xml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/driver-mct/cime_config/config_component.xml b/driver-mct/cime_config/config_component.xml index 8cddad0abf89..b917809f6fab 100644 --- a/driver-mct/cime_config/config_component.xml +++ b/driver-mct/cime_config/config_component.xml @@ -2002,6 +2002,23 @@ wav2ocn state mapping file decomp type + + char + idmap + run_domain + env_run.xml + wav2ocn flux mapping file + + + + char + X,Y + X + run_domain + env_run.xml + wav2ocn flux mapping file decomp type + + char idmap From 606c549f886bf4c0bb89e5109eb6abdd9228b052 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 12:10:19 -0600 Subject: [PATCH 50/56] wave to ocn flux driver-mct/cime_config/namelist_definition_drv.xml --- .../cime_config/namelist_definition_drv.xml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index 416c06f96086..b45bfaed75df 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -5018,6 +5018,36 @@ + + char + mapping + abs + seq_maps + + wav to ocn flux mapping file for fluxes + + + $WAV2OCN_FMAPNAME + + + + + char + mapping + seq_maps + + The type of mapping desired, either "source" or "destination" mapping. + X is associated with rearrangement of the source grid to the + destination grid and then local mapping. Y is associated with mapping + on the source grid and then rearrangement and sum to the destination + grid. + + + $WAV2OCN_FMAPTYPE + X + + + char(10) drv_physics From 3325462c981894f5925e77f7a493acbc50a6b898 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 12:15:29 -0600 Subject: [PATCH 51/56] flux wave to ocn prep_ocn_mod.F90 --- driver-mct/main/prep_ocn_mod.F90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/driver-mct/main/prep_ocn_mod.F90 b/driver-mct/main/prep_ocn_mod.F90 index 845e9ded6825..2edf5c2bdedb 100644 --- a/driver-mct/main/prep_ocn_mod.F90 +++ b/driver-mct/main/prep_ocn_mod.F90 @@ -66,6 +66,7 @@ module prep_ocn_mod public :: prep_ocn_get_mapper_Sg2o public :: prep_ocn_get_mapper_Fg2o public :: prep_ocn_get_mapper_Sw2o + public :: prep_ocn_get_mapper_Fw2o !-------------------------------------------------------------------------- ! Private interfaces @@ -90,6 +91,7 @@ module prep_ocn_mod type(seq_map), pointer :: mapper_Fg2o type(seq_map), pointer :: mapper_Sg2o type(seq_map), pointer :: mapper_Sw2o + type(seq_map), pointer :: mapper_Fw2o ! attribute vectors type(mct_aVect), pointer :: a2x_ox(:) ! Atm export, ocn grid, cpl pes @@ -190,6 +192,7 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc allocate(mapper_Sg2o) allocate(mapper_Fg2o) allocate(mapper_Sw2o) + allocate(mapper_Fw2o) if (ocn_present) then @@ -382,6 +385,13 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc call seq_map_init_rcfile(mapper_Sw2o, wav(1), ocn(1), & 'seq_maps.rc', 'wav2ocn_smapname:', 'wav2ocn_smaptype:',samegrid_ow, & 'mapper_Sw2o initialization') + if (iamroot_CPLID) then + write(logunit,*) ' ' + write(logunit,F00) 'Initializing mapper_Fw2o' + end if + call seq_map_init_rcfile(mapper_Fw2o, wav(1), ocn(1), & + 'seq_maps.rc', 'wav2ocn_fmapname:', 'wav2ocn_fmaptype:',samegrid_ow, & + 'mapper_Fw2o initialization') endif call shr_sys_flush(logunit) @@ -1446,7 +1456,8 @@ subroutine prep_ocn_calc_w2x_ox(timer) call t_drvstartf (trim(timer),barrier=mpicom_CPLID) do ewi = 1,num_inst_wav w2x_wx => component_get_c2x_cx(wav(ewi)) - call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi), norm=.true.) + call seq_map_map(mapper_Sw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_states, norm=.true.) + call seq_map_map(mapper_Fw2o, w2x_wx, w2x_ox(ewi),fldlist=seq_flds_w2x_fluxes, norm=.true.) enddo call t_drvstopf (trim(timer)) end subroutine prep_ocn_calc_w2x_ox @@ -1548,4 +1559,9 @@ function prep_ocn_get_mapper_Sw2o() prep_ocn_get_mapper_Sw2o => mapper_Sw2o end function prep_ocn_get_mapper_Sw2o + function prep_ocn_get_mapper_Fw2o() + type(seq_map), pointer :: prep_ocn_get_mapper_Fw2o + prep_ocn_get_mapper_Fw2o => mapper_Fw2o + end function prep_ocn_get_mapper_Fw2o + end module prep_ocn_mod From 52e755d057faebfaa08401c0fb656e15979f821a Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Tue, 5 Nov 2024 14:29:14 -0600 Subject: [PATCH 52/56] remove lines that were commented out --- components/ww3/src/cpl/wav_comp_mct.F90 | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/components/ww3/src/cpl/wav_comp_mct.F90 b/components/ww3/src/cpl/wav_comp_mct.F90 index 911c0b98108b..1397ed9cfaef 100644 --- a/components/ww3/src/cpl/wav_comp_mct.F90 +++ b/components/ww3/src/cpl/wav_comp_mct.F90 @@ -854,27 +854,6 @@ SUBROUTINE WAV_INIT_MCT( EClock, cdata, x2w_w, w2x_w, NLFilename ) ! add call to gptl timer - ! send initial state to driver - !do jsea=1, nseal - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_1,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_1,jsea) = 0.0 - - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_2,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_2,jsea) = 0.0 - - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_3,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_3,jsea) = 0.0 - - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_4,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_4,jsea) = 0.0 - - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_5,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_5,jsea) = 0.0 - - ! w2x_w%rattr(index_w2x_Sw_ustokes_wavenumber_6,jsea) = 0.0 - ! w2x_w%rattr(index_w2x_Sw_vstokes_wavenumber_6,jsea) = 0.0 - !enddo - ! end redirection of share output to wav log if ( iaproc .eq. napout ) then From f0538883f402e2438a547f7f8c777e5b0379a720 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 6 Nov 2024 14:53:48 -0600 Subject: [PATCH 53/56] fix rebase on ICOS mesh --- cime_config/config_grids.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 88da9699996f..9fd8a3a97d9e 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -5064,10 +5064,7 @@ cpl/gridmaps/wQU225Icos30E3r5/map_ne30pg2_to_wQU225Icos30E3r5_esmfbilin.20240910.nc -<<<<<<< HEAD -======= cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_ne30pg2_esmfbilin.20240910.nc ->>>>>>> cd6a57fcd5 (add wave to ocn flux cime_config/config_grids.xml) @@ -5089,10 +5086,7 @@ cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfbilin.20240910.nc -<<<<<<< HEAD -======= cpl/gridmaps/wQU225Icos30E3r5/map_wQU225Icos30E3r5_to_IcoswISC30E3r5_esmfaave.20240910.nc ->>>>>>> cd6a57fcd5 (add wave to ocn flux cime_config/config_grids.xml) cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc cpl/gridmaps/wQU225Icos30E3r5/map_IcoswISC30E3r5_to_wQU225Icos30E3r5_esmfbilin.20240910.nc From 1d22ac1819821e4de32457595500f2284974f622 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 6 Nov 2024 15:13:44 -0600 Subject: [PATCH 54/56] add wav2atm smap --- driver-mct/cime_config/config_component.xml | 17 ++++++++++ .../cime_config/namelist_definition_drv.xml | 31 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/driver-mct/cime_config/config_component.xml b/driver-mct/cime_config/config_component.xml index b917809f6fab..22383ce6003b 100644 --- a/driver-mct/cime_config/config_component.xml +++ b/driver-mct/cime_config/config_component.xml @@ -1518,6 +1518,23 @@ atm2wav state mapping file decomp type + + char + idmap + run_domain + env_run.xml + wav2atm state mapping file + + + + char + X,Y + Y + run_domain + env_run.xml + wav2atm state mapping file decomp type + + char idmap diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index b45bfaed75df..a9e28d9a80a7 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -4928,6 +4928,37 @@ + + char + mapping + abs + seq_maps + + atm to wav state mapping file for states + + + $WAV2ATM_SMAPNAME + + + + + char + mapping + seq_maps + + The type of mapping desired, either "source" or "destination" mapping. + X is associated with rearrangement of the source grid to the + destination grid and then local mapping. Y is associated with mapping + on the source grid and then rearrangement and sum to the destination + grid. + + + $WAV2ATM_SMAPTYPE + X + + + + char mapping From 4c99f2aed275f296dd30acc4a18c3e6b53146ddc Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Wed, 6 Nov 2024 16:29:27 -0600 Subject: [PATCH 55/56] remove 'two' way coupling option from wav_ic_coup --- driver-mct/cime_config/buildnml | 2 +- driver-mct/cime_config/namelist_definition_drv.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/driver-mct/cime_config/buildnml b/driver-mct/cime_config/buildnml index 4158b4672791..e20cc49803ac 100755 --- a/driver-mct/cime_config/buildnml +++ b/driver-mct/cime_config/buildnml @@ -78,7 +78,7 @@ def _create_drv_namelists(case, infile, confdir, nmlgen, files): config['WAV_OCN_COUP'] = 'one' #if case.get_value("DOCN_MODE") == 'som' if case.get_value('COMP_ICE') == 'mpassi': - config['WAV_ICE_COUP'] = 'two' + config['WAV_ICE_COUP'] = 'one' elif case.get_value('COMP_WAV') == 'dwav': config['WAVSPEC'] = 'sp36x36' else: diff --git a/driver-mct/cime_config/namelist_definition_drv.xml b/driver-mct/cime_config/namelist_definition_drv.xml index a9e28d9a80a7..f9f920c98ec6 100644 --- a/driver-mct/cime_config/namelist_definition_drv.xml +++ b/driver-mct/cime_config/namelist_definition_drv.xml @@ -225,7 +225,6 @@ none one - two From a1747298e1586ca558cce608e94a1c3da085cd61 Mon Sep 17 00:00:00 2001 From: Erin Thomas Date: Thu, 7 Nov 2024 14:52:49 -0600 Subject: [PATCH 56/56] add WAV2ATM remap file for EC30to60 grid --- cime_config/config_grids.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/config_grids.xml b/cime_config/config_grids.xml index 9fd8a3a97d9e..a1c805bcb37d 100755 --- a/cime_config/config_grids.xml +++ b/cime_config/config_grids.xml @@ -5060,6 +5060,7 @@ cpl/gridmaps/wQU225EC30to60E2r2/map_ne30pg2_TO_wQU225EC30to60E2r2_blin.20220222.nc + cpl/gridmaps/wQU225EC30to60E2r2/map_wQU225EC30to60E2r2_TO_ne30pg2_blin.20220222.nc