diff --git a/cime_config/config_component_cesm.xml b/cime_config/config_component_cesm.xml index dbf3b11e3..a19814827 100644 --- a/cime_config/config_component_cesm.xml +++ b/cime_config/config_component_cesm.xml @@ -299,6 +299,7 @@ 1 1 + 1 $ATM_NCPL $ATM_NCPL 1 @@ -537,6 +538,7 @@ FALSE TRUE + TRUE TRUE diff --git a/cime_config/namelist_definition_drv.xml b/cime_config/namelist_definition_drv.xml index 8cf085b9e..ca1e68fba 100644 --- a/cime_config/namelist_definition_drv.xml +++ b/cime_config/namelist_definition_drv.xml @@ -2087,6 +2087,80 @@ + + + + + + logical + aux_hist + ALLCOMP_attributes + + .false. + + Auxiliary mediator wav2med average history output every day. + Note that ww3dev will use this configuration variable and send + the fields needed for wav2med auxiliary file + + + char + aux_hist + MED_attributes + + Sw_hs_avg:Sw_Tm1_avg:Sw_thm_avg:Sw_u_avg:Sw_v_avg:Sw_ustokes_avg:Sw_vstokes_avg:Sw_tusx_avg:Sw_tusy_avg:Sw_thp0_avg:Sw_fp0_avg:Sw_phs0_avg:Sw_phs1_avg:Sw_pdir0_avg:Sw_pdir1_avg:Sw_pTm10_avg:Sw_pTm11_avg + + Auxiliary mediator wav2med file1 colon delimited output + fields. NOTE: these are assumed to be time averaged over a day in + the WW3 cap - so the settings of histaux_wav2med_file1_history_n + and histaux_wav2med_file1_history_option should be 1 and ndays, + respectively. + + + char + aux_hist + MED_attributes + + ndays + + Auxiliary mediator wav2med file1 output option + + + integer + aux_hist + MED_attributes + + 1 + + Auxiliary mediator wav2med file1 output frequency (used for option type) + + + logical + aux_hist + MED_attributes + + .false. + + Auxiliary mediator wav2med file1 time averaged flag for file output. + If this flag is set to .false. only instantaneous output will be created in the auxiliary file. + + + char + aux_hist + MED_attributes + + wav.24h.avg + + + + integer + aux_hist + MED_attributes + Number of time samples per file. + + 30 + + + @@ -2636,24 +2710,6 @@ - - - - - - - - - - - - - - - - - - char time @@ -2875,137 +2931,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/cime_config/runseq/driver_config.py b/cime_config/runseq/driver_config.py index 9694c7503..7b8756e10 100644 --- a/cime_config/runseq/driver_config.py +++ b/cime_config/runseq/driver_config.py @@ -58,7 +58,7 @@ def __compute_glc(self, case, coupling_times): med_to_glc = False elif (comp_glc == 'cism'): if not case.get_value("CISM_EVOLVE"): - med_to_glc = False + run_glc = False # If CISM is not evolving only get data back from cism at the initial time # However will still need to call the exchange at the end if the stop_option @@ -77,6 +77,12 @@ def __compute_glc(self, case, coupling_times): glc_coupling_time = stop_n * 86400 else: glc_coupling_time = 86400 + elif (comp_glc == 'dglc'): + glc_coupling_time = coupling_times["glc_cpl_dt"] + stop_option = case.get_value('STOP_OPTION') + stop_n = case.get_value('STOP_N') + if stop_option == 'nsteps': + glc_coupling_time = stop_n*coupling_times["atm_cpl_dt"] elif (comp_glc == 'xglc'): glc_coupling_time = coupling_times["glc_cpl_dt"] else: diff --git a/cime_config/runseq/runseq_TG.py b/cime_config/runseq/runseq_TG.py index dea8aede5..acf56a87b 100644 --- a/cime_config/runseq/runseq_TG.py +++ b/cime_config/runseq/runseq_TG.py @@ -34,8 +34,10 @@ def gen_runseq(case, coupling_times): runseq.add_action ("MED med_phases_post_lnd" , run_lnd) runseq.add_action ("MED med_phases_prep_glc" , med_to_glc) runseq.add_action ("MED -> GLC :remapMethod=redist" , med_to_glc) - runseq.add_action ("GLC" , run_glc and med_to_glc) - runseq.add_action ("GLC -> MED :remapMethod=redist" , run_glc) + runseq.add_action ("GLC" , run_glc) + # Need to do GLC -> MED even if not running GLC; otherwise, we get a + # failure in InitializeRealize ("Object being used before creation") + runseq.add_action ("GLC -> MED :remapMethod=redist" , med_to_glc) runseq.add_action ("MED med_phases_history_write" , True) runseq.leave_time_loop(True) diff --git a/cime_config/runseq/runseq_general.py b/cime_config/runseq/runseq_general.py index ddbfca598..04a0d6f4f 100644 --- a/cime_config/runseq/runseq_general.py +++ b/cime_config/runseq/runseq_general.py @@ -20,7 +20,7 @@ def gen_runseq(case, coupling_times): cpl_seq_option = case.get_value('CPL_SEQ_OPTION') coupling_mode = case.get_value('COUPLING_MODE') diag_mode = case.get_value('BUDGETS') - xcompset = case.get_value("COMP_ATM") == 'xatm' + xcompset = case.get_value("COMP_ATM") == 'xatm' cpl_add_aoflux = not xcompset and case.get_value('ADD_AOFLUX_TO_RUNSEQ') # It is assumed that if a component will be run it will send information to the mediator @@ -35,19 +35,6 @@ def gen_runseq(case, coupling_times): run_rof, med_to_rof, rof_cpl_time = driver_config['rof'] run_wav, med_to_wav, wav_cpl_time = driver_config['wav'] - comp_glc = case.get_value("COMP_GLC") - run_glc = False - post_glc = False - if (comp_glc == 'cism'): - run_glc = True - if case.get_value("CISM_EVOLVE"): - post_glc = True - else: - post_glc = False - elif (comp_glc == 'xglc'): - run_glc = True - post_glc = True - # Note: assume that atm_cpl_dt, lnd_cpl_dt, ice_cpl_dt and wav_cpl_dt are the same if lnd_cpl_time != atm_cpl_time: @@ -59,18 +46,32 @@ def gen_runseq(case, coupling_times): if rof_cpl_time < ocn_cpl_time: expect(False, "assume that rof_cpl_time is always greater than or equal to ocn_cpl_time") + if run_glc: + # It wouldn't make sense to run GLC unless we also do MED -> GLC to transfer fields to GLC, + # and some of the below logic controlling what appears in the run sequence depends on this + # (i.e., depends on the fact that, if run_glc is True, then med_to_glc is also True). + expect(med_to_glc, "if run_glc is True, then med_to_glc must also be True") + rof_outer_loop = run_rof and rof_cpl_time > atm_cpl_time ocn_outer_loop = run_ocn and ocn_cpl_time > atm_cpl_time + # Note that we do some aspects of the GLC outer loop even if run_glc is False + # (as long as med_to_glc is True). + # + # Note that, in contrast to the other outer_loop variables, this doesn't check glc_cpl_time. + # This is for consistency with the logic that was in place before adding this variable; + # this seems to implicitly assume that glc_cpl_time > atm_cpl_time. + glc_outer_loop = med_to_glc + inner_loop = ((atm_cpl_time < ocn_cpl_time) or (atm_cpl_time < rof_cpl_time) or - (run_glc and atm_cpl_time < glc_cpl_time) or + (glc_outer_loop and atm_cpl_time < glc_cpl_time) or atm_cpl_time == ocn_cpl_time) with RunSeq(os.path.join(caseroot, "CaseDocs", "nuopc.runseq")) as runseq: #------------------ - runseq.enter_time_loop(glc_cpl_time, newtime=run_glc, active=med_to_glc) + runseq.enter_time_loop(glc_cpl_time, newtime=glc_outer_loop) #------------------ #------------------ @@ -199,8 +200,10 @@ def gen_runseq(case, coupling_times): runseq.add_action("MED med_phases_prep_glc" , med_to_glc) runseq.add_action("MED -> GLC :remapMethod=redist" , med_to_glc) - runseq.add_action("GLC" , run_glc and med_to_glc) - runseq.add_action("GLC -> MED :remapMethod=redist" , run_glc) - runseq.add_action("MED med_phases_post_glc" , run_glc and post_glc) + runseq.add_action("GLC" , run_glc) + # Need to do GLC -> MED even if not running GLC; otherwise, we get a + # failure in InitializeRealize ("Object being used before creation") + runseq.add_action("GLC -> MED :remapMethod=redist" , med_to_glc) + runseq.add_action("MED med_phases_post_glc" , run_glc) shutil.copy(os.path.join(caseroot, "CaseDocs", "nuopc.runseq"), rundir) diff --git a/mediator/esmFldsExchange_cesm_mod.F90 b/mediator/esmFldsExchange_cesm_mod.F90 index a7d7627f5..b68e4d13f 100644 --- a/mediator/esmFldsExchange_cesm_mod.F90 +++ b/mediator/esmFldsExchange_cesm_mod.F90 @@ -1368,7 +1368,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) end if ! --------------------------------------------------------------------- - ! to atm: unmerged ugust_out from ocn + ! to atm: unmerged ugust_out from ocn ! --------------------------------------------------------------------- if (phase == 'advertise') then call addfld_aoflux('So_ugustOut') @@ -1386,7 +1386,7 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) end if ! --------------------------------------------------------------------- - ! to atm: 10 m winds including/excluding gust component + ! to atm: 10 m winds including/excluding gust component ! --------------------------------------------------------------------- if (phase == 'advertise') then call addfld_aoflux('So_u10withGust') @@ -2317,6 +2317,30 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) end if end if + !----------------------------- + ! from wav: for daily averaged fields for + ! output to auxiliary file only + !----------------------------- + if (phase == 'advertise') then + call addfld_from(compwav, 'Sw_ustokes_avg') + call addfld_from(compwav, 'Sw_vstokes_avg') + call addfld_from(compwav, 'Sw_hs_avg') + call addfld_from(compwav, 'Sw_phs0_avg') + call addfld_from(compwav, 'Sw_phs1_avg') + call addfld_from(compwav, 'Sw_pdir0_avg') + call addfld_from(compwav, 'Sw_pdir1_avg') + call addfld_from(compwav, 'Sw_pTm10_avg') + call addfld_from(compwav, 'Sw_pTm11_avg') + call addfld_from(compwav, 'Sw_Tm1_avg') + call addfld_from(compwav, 'Sw_thm_avg') + call addfld_from(compwav, 'Sw_thp0_avg') + call addfld_from(compwav, 'Sw_fp0_avg') + call addfld_from(compwav, 'Sw_u_avg') + call addfld_from(compwav, 'Sw_v_avg') + call addfld_from(compwav, 'Sw_tusx_avg') + call addfld_from(compwav, 'Sw_tusy_avg') + end if + !----------------------------- ! to ocn: Langmuir multiplier from wave !----------------------------- @@ -3008,22 +3032,36 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) if (phase == 'advertise') then call addfld_from(compatm, 'Sa_u') call addfld_to(compwav, 'Sa_u') + call addfld_from(compatm, 'Sa_u10m') + call addfld_to(compwav, 'Sa_u10m') else if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_u', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_u', rc=rc)) then call addmap_from(compatm, 'Sa_u', compwav, mapbilnr, 'one', atm2wav_map) call addmrg_to(compwav, 'Sa_u', mrg_from=compatm, mrg_fld='Sa_u', mrg_type='copy') end if + if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_u10m', rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_u10m', rc=rc)) then + call addmap_from(compatm, 'Sa_u10m', compwav, mapbilnr, 'one', atm2wav_map) + call addmrg_to(compwav, 'Sa_u10m', mrg_from=compatm, mrg_fld='Sa_u10m', mrg_type='copy') + end if end if if (phase == 'advertise') then call addfld_from(compatm, 'Sa_v') call addfld_to(compwav, 'Sa_v') + call addfld_from(compatm, 'Sa_v10m') + call addfld_to(compwav, 'Sa_v10m') else if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_v', rc=rc) .and. & fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_v', rc=rc)) then call addmap_from(compatm, 'Sa_v', compwav, mapbilnr, 'one', atm2wav_map) call addmrg_to(compwav, 'Sa_v', mrg_from=compatm, mrg_fld='Sa_v', mrg_type='copy') end if + if ( fldchk(is_local%wrap%FBexp(compwav) , 'Sa_v10m', rc=rc) .and. & + fldchk(is_local%wrap%FBImp(compatm,compatm ), 'Sa_v10m', rc=rc)) then + call addmap_from(compatm, 'Sa_v10m', compwav, mapbilnr, 'one', atm2wav_map) + call addmrg_to(compwav, 'Sa_v10m', mrg_from=compatm, mrg_fld='Sa_v10m', mrg_type='copy') + end if end if ! --------------------------------------------------------------------- @@ -3342,6 +3380,25 @@ subroutine esmFldsExchange_cesm(gcomp, phase, rc) end if endif + !===================================================================== + ! DMS EXCHANGE + !===================================================================== + + ! Get dms flux from ocn and send to atm + if (phase == 'advertise') then + call addfld_from(compocn, 'Faoo_dms_ocn') + call addfld_to(compatm, 'Faoo_dms_ocn') + else + ! Note that Faoo_dmds should not be weighted by ifrac - since + ! it will be weighted by ifrac in the merge to the atm + if ( fldchk(is_local%wrap%FBImp(compocn,compocn), 'Faoo_dms_ocn', rc=rc) .and. & + fldchk(is_local%wrap%FBexp(compatm) , 'Faoo_dms_ocn', rc=rc)) then + call addmap_from(complnd, 'Faoo_dms_ocn', compocn, mapconsf, 'lfrac', ocn2atm_map) + call addmrg_to(compatm , 'Faoo_dms_ocn', & + mrg_from=compmed, mrg_fld='Faoo_dms_ocn', mrg_type='merge', mrg_fracname='ofrac') + end if + end if + end subroutine esmFldsExchange_cesm end module esmFldsExchange_cesm_mod diff --git a/mediator/med_phases_profile_mod.F90 b/mediator/med_phases_profile_mod.F90 index 1fb13d6f5..75d7f4d91 100644 --- a/mediator/med_phases_profile_mod.F90 +++ b/mediator/med_phases_profile_mod.F90 @@ -177,7 +177,6 @@ subroutine med_phases_profile(gcomp, rc) call ESMF_TimeGet(nexttime, timestring=nexttimestr, rc=rc) if (med_utils_ChkErr(rc,__LINE__,u_FILE_u)) return ! get current wall clock time - call ESMF_TimeSyncToRealTime(wallclockTime, rc=rc) if (med_utils_chkerr(rc,__LINE__,u_FILE_u)) return