From 3da2797097dba332ae60707097d037794dda8267 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Mon, 21 Jul 2025 19:10:35 +0000 Subject: [PATCH 01/22] add method to process aerosol analysis to grib2 --- ush/python/pygfs/task/aero_analysis.py | 144 ++++++++++++++++++++++++- 1 file changed, 140 insertions(+), 4 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 5ed904811f8..92b3496b972 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -11,13 +11,14 @@ from wxflow import (AttrDict, FileHandler, - add_to_datetime, to_fv3time, to_timedelta, + add_to_datetime, to_timedelta, to_fv3time, - Task, + Task, Jinja, YAMLFile, parse_j2yaml, - logit) + logit, cast_strdict_as_dtypedict) from pygfs.jedi import Jedi import numpy as np +from pygfs.task.upp import UPP logger = getLogger(__name__.split('.')[-1]) @@ -68,7 +69,8 @@ def __init__(self, config): 'GPREFIX': f"gcdas.t{self.task_config.previous_cycle.hour:02d}z.", 'aero_obsdatain_path': f"{self.task_config.DATA}/obs/", 'aero_obsdataout_path': f"{self.task_config.DATA}/diags/", - 'BKG_TSTEP': "PT3H" # FGAT + 'BKG_TSTEP': "PT3H", # FGAT + # 'UPP_RUN': "analysis" } ) @@ -140,6 +142,12 @@ def initialize(self) -> None: logger.info(f"Initializing JEDI variational DA application") self.jedi_dict['aeroanlvar'].initialize(self.task_config, clean_empty_obsspaces=True) + # stage upp files + #logger.info(f"Staging UPP files from {self.task_config.AERO_STAGE_UPP_TMPL}") + #upp_stage_dict = parse_j2yaml(self.task_config.AERO_STAGE_UPP_TMPL, self.task_config) + #FileHandler(upp_stage_dict).sync() + #logger.debug(f"UPP files:\n{pformat(upp_stage_dict)}") + @logit(logger) def execute(self, jedi_dict_key: str) -> None: """Execute JEDI application of aero analysis @@ -263,3 +271,131 @@ def add_fv3_increments(self, inc_file_tmpl: str, bkg_file_tmpl: str, incvars: Li rstfile.variables[vname].delncattr('checksum') # remove the checksum so fv3 does not complain except (AttributeError, RuntimeError): pass # checksum is missing, move on + + @logit(logger) + def upp_anlproc(self)-> None: + """Process aerosol analysis to GRIB2 + + This method processes aerosol AOD analysis from tracer fields using UPP. + This includes: + - Creating a UPP object + - Staging UPP fix files + - Creating the 'upp_dict' for UPP object + - Generating the upp namelist + - Adding atmos and aerosol increments to the background + - Execute upp.x + """ + + local_dict = AttrDict( + { + 'UPP_RUN': "analysis", + 'FORECAST_HOUR': 0 + } + ) + self.task_config = AttrDict(**self.task_config, **local_dict) + self.task_config.UPP_CONFIG = self.task_config.UPP_CONFIG_YAML + upp = UPP(self.task_config) + + #upp_yaml = parse_j2yaml(self.task_config.UPP_CONFIG, self.task_config) + upp_yaml = upp.task_config.upp_yaml + upp.initialize(upp_yaml) + + upp_dict = AttrDict() + keys = [ 'APRUN_AEROANLFINAL', 'forecast_hour', + 'atmos_filename', 'flux_filename'] + + upp_dict = AttrDict() + for key in keys: + upp_dict[key] = upp.task_config[key] + + upp_dict['NET'] = 'gfs' # set to 'gfs' temperally because upp didn't work with 'gcafs'. + upp_dict['valid_datetime'] = self.task_config.current_cycle + upp_dict['DATA'] = os.path.join(self.task_config.DATA, 'upp') + upp_dict.update(upp_yaml['upp']['config']) + + # Configure the namelist and write to file + logger.info("Create namelist for upp.x") + nml_template = os.path.join(upp_dict.DATA, "itag.jinja") + nml_data = Jinja(nml_template, upp_dict).render + logger.debug(f"itag:\n{nml_data}") + nml_file = os.path.join(upp_dict.DATA, 'itag') + with open(nml_file, "w") as fho: + fho.write(nml_data) + + # ---- add aero increments to atmf000 files + logger.info('Adding aero increments to RESTART files') + bkg_file = os.path.join(upp_dict.DATA, f"{upp_dict.atmos_filename}") + inc_file = os.path.join(self.task_config.DATA, 'anl', f"aeroinc_gauss.{self.task_config.current_cycle.strftime('%Y-%m-%dT%H:%M:%S')}Z.gaussian.modelLevels.nc") + incvars_list_path = os.path.join(self.task_config['PARMgfs'], 'gdas', 'aeroanl_upp_config.yaml.j2') + allvars = YAMLFile(path=incvars_list_path)['aeroincvars'][:] + bkgvars = [var[0] for var in allvars] + incvars = [var[1] for var in allvars] + self.add_aero_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) + + # ---- add atmo increments to atmf000 files + logger.info('Adding atmo increments to RESTART files') + inc_file = os.path.join(upp_dict.DATA, f"{self.task_config.APREFIX}atminc.nc") + allvars = YAMLFile(path=incvars_list_path)['atmincvars'][:] + bkgvars = [var[0] for var in allvars] + incvars = [var[1] for var in allvars] + self.add_atm_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) + + upp.execute(upp_dict.DATA, upp_dict.APRUN_AEROANLFINAL, upp_dict.forecast_hour) + + + @logit(logger) + def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: + """Add aero gaussian increments to gaussian backgrounds + + Parameters + ---------- + inc_file : str + increment file + bkg_file : str + background file + incvars : List + List of increment variables to add to the background + bkgvars : List + List of background variables to which the increment variables will be added. + """ + with Dataset(inc_file, mode='r') as incfile, Dataset(bkg_file, mode='a') as rstfile: + for incname, bkgname in zip(incvars, bkgvars): + increment = incfile.variables[incname][:] + # round to 7th decimal due to JEDI reproducibility issues when changing PE count + increment = np.round(increment, 7) + # reordering the dimensions of increment to macth background + increment_reshape = np.transpose(increment, (2, 0, 1)) + + bkg = rstfile.variables[bkgname][:] + anl = bkg + increment_reshape[np.newaxis, :, :, :] + rstfile.variables[bkgname][:] = anl[:] + try: + rstfile.variables[bkgname].delncattr('checksum') # remove the checksum so fv3 does not complain + except (AttributeError, RuntimeError): + pass # checksum is missing, move on + + @logit(logger) + def add_atm_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: + """Add atm gaussian increments to gaussian backgrounds + + Parameters + ---------- + inc_file : str + increment file + bkg_file : str + background file + incvars : List + List of increment variables to add to the background + bkgvars : List + List of background variables to which the increment variables will be added. + """ + with Dataset(inc_file, mode='r') as incfile, Dataset(bkg_file, mode='a') as rstfile: + for incname, bkgname in zip(incvars, bkgvars): + increment = incfile.variables[incname][:] + # handel latitude inversion in atminc + lat_axis_index = 1 + increment_lat_inversion = np.flip(increment, axis=lat_axis_index) + + bkg = rstfile.variables[bkgname][:] + anl = bkg + increment_lat_inversion[np.newaxis, :, :, :] + rstfile.variables[bkgname][:] = anl[:] From 3333a7effaafbb0fc6d3397b37719398c0c87e57 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Mon, 21 Jul 2025 21:39:02 +0000 Subject: [PATCH 02/22] fix coding norms --- ush/python/pygfs/task/aero_analysis.py | 30 ++++++++++---------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 92b3496b972..22a6f81de9a 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -15,7 +15,7 @@ to_fv3time, Task, Jinja, YAMLFile, parse_j2yaml, - logit, cast_strdict_as_dtypedict) + logit) from pygfs.jedi import Jedi import numpy as np from pygfs.task.upp import UPP @@ -70,7 +70,6 @@ def __init__(self, config): 'aero_obsdatain_path': f"{self.task_config.DATA}/obs/", 'aero_obsdataout_path': f"{self.task_config.DATA}/diags/", 'BKG_TSTEP': "PT3H", # FGAT - # 'UPP_RUN': "analysis" } ) @@ -142,12 +141,6 @@ def initialize(self) -> None: logger.info(f"Initializing JEDI variational DA application") self.jedi_dict['aeroanlvar'].initialize(self.task_config, clean_empty_obsspaces=True) - # stage upp files - #logger.info(f"Staging UPP files from {self.task_config.AERO_STAGE_UPP_TMPL}") - #upp_stage_dict = parse_j2yaml(self.task_config.AERO_STAGE_UPP_TMPL, self.task_config) - #FileHandler(upp_stage_dict).sync() - #logger.debug(f"UPP files:\n{pformat(upp_stage_dict)}") - @logit(logger) def execute(self, jedi_dict_key: str) -> None: """Execute JEDI application of aero analysis @@ -273,13 +266,13 @@ def add_fv3_increments(self, inc_file_tmpl: str, bkg_file_tmpl: str, incvars: Li pass # checksum is missing, move on @logit(logger) - def upp_anlproc(self)-> None: + def upp_anlproc(self) -> None: """Process aerosol analysis to GRIB2 This method processes aerosol AOD analysis from tracer fields using UPP. - This includes: + This includes: - Creating a UPP object - - Staging UPP fix files + - Staging UPP fix files - Creating the 'upp_dict' for UPP object - Generating the upp namelist - Adding atmos and aerosol increments to the background @@ -296,36 +289,36 @@ def upp_anlproc(self)-> None: self.task_config.UPP_CONFIG = self.task_config.UPP_CONFIG_YAML upp = UPP(self.task_config) - #upp_yaml = parse_j2yaml(self.task_config.UPP_CONFIG, self.task_config) upp_yaml = upp.task_config.upp_yaml upp.initialize(upp_yaml) upp_dict = AttrDict() - keys = [ 'APRUN_AEROANLFINAL', 'forecast_hour', - 'atmos_filename', 'flux_filename'] + keys = ['APRUN_AEROANLFINAL', 'forecast_hour', + 'atmos_filename', 'flux_filename'] upp_dict = AttrDict() for key in keys: - upp_dict[key] = upp.task_config[key] + upp_dict[key] = upp.task_config[key] upp_dict['NET'] = 'gfs' # set to 'gfs' temperally because upp didn't work with 'gcafs'. upp_dict['valid_datetime'] = self.task_config.current_cycle upp_dict['DATA'] = os.path.join(self.task_config.DATA, 'upp') upp_dict.update(upp_yaml['upp']['config']) - # Configure the namelist and write to file + # Configure the namelist and write to file logger.info("Create namelist for upp.x") nml_template = os.path.join(upp_dict.DATA, "itag.jinja") nml_data = Jinja(nml_template, upp_dict).render logger.debug(f"itag:\n{nml_data}") nml_file = os.path.join(upp_dict.DATA, 'itag') with open(nml_file, "w") as fho: - fho.write(nml_data) + fho.write(nml_data) # ---- add aero increments to atmf000 files logger.info('Adding aero increments to RESTART files') bkg_file = os.path.join(upp_dict.DATA, f"{upp_dict.atmos_filename}") - inc_file = os.path.join(self.task_config.DATA, 'anl', f"aeroinc_gauss.{self.task_config.current_cycle.strftime('%Y-%m-%dT%H:%M:%S')}Z.gaussian.modelLevels.nc") + inc_file = os.path.join(self.task_config.DATA, 'anl', + f"aeroinc_gauss.{self.task_config.current_cycle.strftime('%Y-%m-%dT%H:%M:%S')}Z.gaussian.modelLevels.nc") incvars_list_path = os.path.join(self.task_config['PARMgfs'], 'gdas', 'aeroanl_upp_config.yaml.j2') allvars = YAMLFile(path=incvars_list_path)['aeroincvars'][:] bkgvars = [var[0] for var in allvars] @@ -341,7 +334,6 @@ def upp_anlproc(self)-> None: self.add_atm_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) upp.execute(upp_dict.DATA, upp_dict.APRUN_AEROANLFINAL, upp_dict.forecast_hour) - @logit(logger) def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: From 63e323394e3acad8f5983a8847ac7489b23cd305 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Mon, 21 Jul 2025 21:41:48 +0000 Subject: [PATCH 03/22] add upp processing to job script --- scripts/exglobal_aero_analysis_finalize.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/exglobal_aero_analysis_finalize.py b/scripts/exglobal_aero_analysis_finalize.py index 19adcc4c385..d2a6ddc4f21 100755 --- a/scripts/exglobal_aero_analysis_finalize.py +++ b/scripts/exglobal_aero_analysis_finalize.py @@ -8,6 +8,7 @@ from wxflow import Logger, cast_strdict_as_dtypedict from pygfs.task.aero_analysis import AerosolAnalysis +from pygfs.task.upp import UPP # Initialize root logger @@ -22,5 +23,11 @@ # Instantiate the aerosol analysis task AeroAnl = AerosolAnalysis(config) + # Process aerosal products through UPP + AeroAnl.upp_anlproc() + # Finalize JEDI aerosol variational analysis AeroAnl.finalize() + + + From 6c67cf18b637ca394fb5a48e796814c7fb78f9a0 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Mon, 21 Jul 2025 21:44:37 +0000 Subject: [PATCH 04/22] add atmos history path --- jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE index dd6cadd18d0..5640c0884b9 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_INITIALIZE @@ -24,10 +24,12 @@ GDUMP="${GDUMP/gcafs/gcdas}" # Generate COM variables from templates YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ COMIN_OBS:COM_OBS_TMPL \ + COMIN_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL \ COMOUT_CHEM_ANALYSIS:COM_CHEM_ANALYSIS_TMPL RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ COMIN_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL \ + COMIN_ATMOS_HISTORY_PREV:COM_ATMOS_HISTORY_TMPL \ COMIN_CHEM_BMAT_PREV:COM_CHEM_BMAT_TMPL \ COMIN_CHEM_ANALYSIS_PREV:COM_CHEM_ANALYSIS_TMPL From 5e4a341eca68fa141ad22d2d6de8186de6b82ea0 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Mon, 21 Jul 2025 21:46:15 +0000 Subject: [PATCH 05/22] stage files to run UPP --- parm/gdas/aero_stage_variational.yaml.j2 | 9 ++++ parm/gdas/aeroanl_upp_config.yaml.j2 | 61 ++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 parm/gdas/aeroanl_upp_config.yaml.j2 diff --git a/parm/gdas/aero_stage_variational.yaml.j2 b/parm/gdas/aero_stage_variational.yaml.j2 index 839d7fd74a9..490ec00dc19 100644 --- a/parm/gdas/aero_stage_variational.yaml.j2 +++ b/parm/gdas/aero_stage_variational.yaml.j2 @@ -20,6 +20,7 @@ mkdir: - "{{ DATA }}/diags" - "{{ DATA }}/berror" - "{{ DATA }}/bkg" +- "{{ DATA }}/upp" copy: ###################################### ## copy backgrounds @@ -48,3 +49,11 @@ copy: ### copy diffusion files - ["{{ COMIN_CHEM_BMAT_PREV }}/{{ GPREFIX }}aero_diffusion_hz.nc", "{{ DATA }}/berror/diffusion_hz.nc"] - ["{{ COMIN_CHEM_BMAT_PREV }}/{{ GPREFIX }}aero_diffusion_vt.nc", "{{ DATA }}/berror/diffusion_vt.nc"] + +###################################### +### copy backgrounds from COMIN_ATMOS_HISTORY_PREV +- ["{{ COMIN_ATMOS_HISTORY_PREV }}/{{ GPREFIX }}atmf006.nc", "{{ DATA }}/upp/atm_{{ current_cycle | to_YMDH }}0000.nc"] +- ["{{ COMIN_ATMOS_HISTORY_PREV }}/{{ GPREFIX }}sfcf006.nc", "{{ DATA }}/upp/sfc_{{ current_cycle | to_YMDH }}0000.nc"] +### copy atmos increment from COMIN_ATMOS_ANALYSIS +- ["{{ COMIN_ATMOS_ANALYSIS }}/{{ APREFIX }}atminc.nc", "{{ DATA }}/upp/{{ APREFIX }}atminc.nc"] + diff --git a/parm/gdas/aeroanl_upp_config.yaml.j2 b/parm/gdas/aeroanl_upp_config.yaml.j2 new file mode 100644 index 00000000000..db3fa5223f9 --- /dev/null +++ b/parm/gdas/aeroanl_upp_config.yaml.j2 @@ -0,0 +1,61 @@ +upp: + rundir: '{{ DATA }}/upp' + exe_src: '{{ EXECgfs }}/upp.x' + mpi_cmd: '{{ APRUN_AEROANLFINAL }}' + jcb_base_yaml: '{{ PARMgfs }}/gdas/aero/jcb-base.yaml.j2' + config: + grib_version: "grib2" + ioform: "netcdfpara" + po: [1000.,975.,950.,925.,900.,875.,850.,825.,800.,775.,750.,725.,700.,675.,650.,625.,600.,575.,550.,525.,500.,475.,450.,425.,400.,375.,350.,325.,300.,275.,250.,225.,200.,175.,150.,125.,100.,70.,50.,40.,30.,20.,15.,10.,7.,5.,3.,2.,1.,0.7,0.4,0.2,0.1,0.07,0.04,0.02,0.01] + rdaod: False + nasa_on: True + fix_data: + mkdir: + - "{{ DATA }}/upp" + copy: + - ["{{ PARMgfs }}/post/gefs/postxconfig-NT-gefs-gcafs.txt", "{{ DATA }}/upp/postxconfig-NT.txt"] + #- ["{{ PARMgfs }}/post/postxconfig-NT-gfs-chem.txt", "{{ DATA }}/upp/postxconfig-NT.txt"] + - ["{{ PARMgfs }}/post/params_grib2_tbl_new", "{{ DATA }}/upp/params_grib2_tbl_new"] + - ["{{ PARMgfs }}/post/nam_micro_lookup.dat", "{{ DATA }}/upp/eta_micro_lookup.dat"] + - ["{{ EXECgfs }}/upp.x", "{{ DATA }}/upp/"] + - ["{{ PARMgfs }}/post/itag.jinja", "{{ DATA }}/upp/"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_DUST_nasa.dat", "{{ DATA }}/upp/optics_luts_DUST_nasa.dat"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_NITR_nasa.dat", "{{ DATA }}/upp/optics_luts_NITR_nasa.dat"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_SALT_nasa.dat", "{{ DATA }}/upp/optics_luts_SALT_nasa.dat"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_SOOT_nasa.dat", "{{ DATA }}/upp/optics_luts_SOOT_nasa.dat"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_SUSO_nasa.dat", "{{ DATA }}/upp/optics_luts_SUSO_nasa.dat"] + - ["{{ HOMEgfs }}/sorc/upp.fd/fix/chem/optics_luts_WASO_nasa.dat", "{{ DATA }}/upp/optics_luts_WASO_nasa.dat"] + +analysis: + config: + nasa_on: True + data_in: + none: + +atmincvars: [ + ['ugrd', 'u_inc'], + ['vgrd', 'v_inc'], + ['dpres', 'delp_inc'], + ['delz', 'delz_inc'], + ['tmp', 'T_inc'], + ['spfh', 'sphum_inc'], + ['rwmr', 'liq_wat_inc'], + ['o3mr', 'o3mr_inc'], + ['icmr', 'icmr_inc']] + +aeroincvars: [ + ['dust1', 'mass_fraction_of_dust001_in_air'], + ['dust2', 'mass_fraction_of_dust002_in_air'], + ['dust3', 'mass_fraction_of_dust003_in_air'], + ['dust4', 'mass_fraction_of_dust004_in_air'], + ['dust5', 'mass_fraction_of_dust005_in_air'], + ['seas1', 'mass_fraction_of_sea_salt001_in_air'], + ['seas2', 'mass_fraction_of_sea_salt002_in_air'], + ['seas3', 'mass_fraction_of_sea_salt003_in_air'], + ['seas4', 'mass_fraction_of_sea_salt004_in_air'], + ['so4', 'mass_fraction_of_sulfate_in_air'], + ['oc1', 'mass_fraction_of_hydrophobic_organic_carbon_in_air'], + ['oc2', 'mass_fraction_of_hydrophilic_organic_carbon_in_air'], + ['bc1', 'mass_fraction_of_hydrophobic_black_carbon_in_air'], + ['bc2', 'mass_fraction_of_hydrophilic_black_carbon_in_air']] + From 33daaf251165b5236bb428397bd0a9f74fefee72 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Tue, 22 Jul 2025 15:48:45 +0000 Subject: [PATCH 06/22] update job resource --- dev/parm/config/gcafs/config.aeroanl.j2 | 1 + dev/parm/config/gcafs/config.resources | 4 ++-- ush/python/pygfs/task/aero_analysis.py | 17 +++++++---------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index 4d78d975336..e18bd5ec2cf 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -27,6 +27,7 @@ export CRTM_FIX_YAML="${PARMgfs}/gdas/aero_crtm_coeff.yaml.j2" export JEDI_FIX_YAML="${PARMgfs}/gdas/aero_jedi_fix.yaml.j2" export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_jedi_config.yaml.j2" +export UPP_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_upp_config.yaml.j2" export AERO_STAGE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_stage_variational.yaml.j2" export AERO_FINALIZE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_finalize_variational.yaml.j2" diff --git a/dev/parm/config/gcafs/config.resources b/dev/parm/config/gcafs/config.resources index dc8c7820a3a..fbe6f362107 100644 --- a/dev/parm/config/gcafs/config.resources +++ b/dev/parm/config/gcafs/config.resources @@ -532,10 +532,10 @@ case ${step} in echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 esac - ntasks=1 + ntasks=120 threads_per_task=1 tasks_per_node=$(( max_tasks_per_node / threads_per_task )) - memory="13072M" + memory=${mem_node_max} ;; "marineanlinit") diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 22a6f81de9a..2dc7c1e7d03 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -69,7 +69,7 @@ def __init__(self, config): 'GPREFIX': f"gcdas.t{self.task_config.previous_cycle.hour:02d}z.", 'aero_obsdatain_path': f"{self.task_config.DATA}/obs/", 'aero_obsdataout_path': f"{self.task_config.DATA}/diags/", - 'BKG_TSTEP': "PT3H", # FGAT + 'BKG_TSTEP': "PT3H" # FGAT } ) @@ -280,10 +280,8 @@ def upp_anlproc(self) -> None: """ local_dict = AttrDict( - { - 'UPP_RUN': "analysis", - 'FORECAST_HOUR': 0 - } + { 'UPP_RUN': "analysis", + 'FORECAST_HOUR': 0 } ) self.task_config = AttrDict(**self.task_config, **local_dict) self.task_config.UPP_CONFIG = self.task_config.UPP_CONFIG_YAML @@ -317,10 +315,9 @@ def upp_anlproc(self) -> None: # ---- add aero increments to atmf000 files logger.info('Adding aero increments to RESTART files') bkg_file = os.path.join(upp_dict.DATA, f"{upp_dict.atmos_filename}") - inc_file = os.path.join(self.task_config.DATA, 'anl', - f"aeroinc_gauss.{self.task_config.current_cycle.strftime('%Y-%m-%dT%H:%M:%S')}Z.gaussian.modelLevels.nc") - incvars_list_path = os.path.join(self.task_config['PARMgfs'], 'gdas', 'aeroanl_upp_config.yaml.j2') - allvars = YAMLFile(path=incvars_list_path)['aeroincvars'][:] + inc_filename = f"aeroinc_gauss.{self.task_config.current_cycle.strftime('%Y-%m-%dT%H:%M:%S')}Z.gaussian.modelLevels.nc" + inc_file = os.path.join(self.task_config.DATA, 'anl', inc_filename) + allvars = upp_yaml['aeroincvars'][:] bkgvars = [var[0] for var in allvars] incvars = [var[1] for var in allvars] self.add_aero_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) @@ -328,7 +325,7 @@ def upp_anlproc(self) -> None: # ---- add atmo increments to atmf000 files logger.info('Adding atmo increments to RESTART files') inc_file = os.path.join(upp_dict.DATA, f"{self.task_config.APREFIX}atminc.nc") - allvars = YAMLFile(path=incvars_list_path)['atmincvars'][:] + allvars = upp_yaml['atmincvars'][:] bkgvars = [var[0] for var in allvars] incvars = [var[1] for var in allvars] self.add_atm_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) From 6e6ea86b20b0f3c011ae1aed0796deb1156480a6 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Tue, 22 Jul 2025 15:59:07 +0000 Subject: [PATCH 07/22] update namelist template with 'nasa_on' parameter --- parm/post/itag.jinja | 1 + parm/post/upp.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/parm/post/itag.jinja b/parm/post/itag.jinja index 07aa41f8da3..1cf40c0e639 100644 --- a/parm/post/itag.jinja +++ b/parm/post/itag.jinja @@ -12,5 +12,6 @@ kpo = {{ po | length }}, po = {{ po | join(', ') }}, rdaod = {{ rdaod | to_f90bool }} + nasa_on = {{ nasa_on | to_f90bool }} / diff --git a/parm/post/upp.yaml b/parm/post/upp.yaml index dd9aed3358e..4874f672c93 100644 --- a/parm/post/upp.yaml +++ b/parm/post/upp.yaml @@ -4,6 +4,7 @@ upp: ioform: "netcdfpara" po: [1000.,975.,950.,925.,900.,875.,850.,825.,800.,775.,750.,725.,700.,675.,650.,625.,600.,575.,550.,525.,500.,475.,450.,425.,400.,375.,350.,325.,300.,275.,250.,225.,200.,175.,150.,125.,100.,70.,50.,40.,30.,20.,15.,10.,7.,5.,3.,2.,1.,0.7,0.4,0.2,0.1,0.07,0.04,0.02,0.01] rdaod: False + nasa_on: False fix_data: mkdir: - "{{ DATA }}" From 3757474ec0eb151679f19bae4d24291aee757a70 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Tue, 22 Jul 2025 16:18:22 +0000 Subject: [PATCH 08/22] set running environment --- env/GAEAC5.env | 7 +++++++ env/GAEAC6.env | 7 +++++++ env/HERA.env | 7 +++++++ env/HERCULES.env | 7 +++++++ env/ORION.env | 7 +++++++ env/WCOSS2.env | 7 +++++++ 6 files changed, 42 insertions(+) diff --git a/env/GAEAC5.env b/env/GAEAC5.env index ab27864848a..fd454ebfef6 100755 --- a/env/GAEAC5.env +++ b/env/GAEAC5.env @@ -97,6 +97,13 @@ case ${step} in export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}" ;; + "aeroanlfinal") + + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLFINAL}" + ;; "aeroanlgenb") export NTHREADS_AEROANLGENB=${NTHREADSmax} diff --git a/env/GAEAC6.env b/env/GAEAC6.env index 2a5b93d7ee9..e2e6702626e 100755 --- a/env/GAEAC6.env +++ b/env/GAEAC6.env @@ -97,6 +97,13 @@ case ${step} in export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}" ;; + "aeroanlfinal") + + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLFINAL}" + ;; "aeroanlgenb") export NTHREADS_AEROANLGENB=${NTHREADSmax} diff --git a/env/HERA.env b/env/HERA.env index 065f5dbc469..71f2cf75b63 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -99,6 +99,13 @@ elif [[ "${step}" = "aeroanlvar" ]]; then export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}" +elif [[ "${step}" = "aeroanlfinal" ]]; then + + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLFINAL}" + elif [[ "${step}" = "aeroanlgenb" ]]; then export NTHREADS_AEROANLGENB=${NTHREADSmax} diff --git a/env/HERCULES.env b/env/HERCULES.env index 65d18b0cc39..af85eab7fdb 100755 --- a/env/HERCULES.env +++ b/env/HERCULES.env @@ -102,6 +102,13 @@ case ${step} in export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}" + ;; + "aeroanlfinal") + + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLFINAL}" ;; "aeroanlgenb") diff --git a/env/ORION.env b/env/ORION.env index 8da8d43b338..6b22c593da4 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -94,6 +94,13 @@ elif [[ "${step}" = "aeroanlvar" ]]; then export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}" +elif [[ "${step}" = "aeroanlfinal" ]]; then + + export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLFINAL}" + elif [[ "${step}" = "aeroanlgenb" ]]; then export NTHREADS_AEROANLGENB=${NTHREADSmax} diff --git a/env/WCOSS2.env b/env/WCOSS2.env index 35d3fdfc889..636a2b8a19f 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -80,6 +80,13 @@ elif [[ "${step}" = "aeroanlvar" ]]; then export NTHREADS_AEROANL=${NTHREADSmax} export APRUN_AEROANL="${APRUN_default}" +elif [[ "${step}" = "aeroanlfinal" ]]; then + + export APRUNCFP="${launcher} -np \$ncmd ${mpmd_opt}" + + export NTHREADS_AEROANLFINAL=${NTHREADSmax} + export APRUN_AEROANLFINAL="${APRUN_default}" + elif [[ "${step}" = "aeroanlgenb" ]]; then export NTHREADS_AEROANLGENB=${NTHREADSmax} From 2f232936aba192801ffa937b350755c6f081e8d9 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Tue, 22 Jul 2025 16:23:42 +0000 Subject: [PATCH 09/22] save the output grib2 file to COMOUT_CHEM_ANALYSIS --- parm/gdas/aero_finalize_variational.yaml.j2 | 3 +++ parm/gdas/aeroanl_upp_config.yaml.j2 | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/parm/gdas/aero_finalize_variational.yaml.j2 b/parm/gdas/aero_finalize_variational.yaml.j2 index 45674cc615f..f950f26a9ac 100644 --- a/parm/gdas/aero_finalize_variational.yaml.j2 +++ b/parm/gdas/aero_finalize_variational.yaml.j2 @@ -23,3 +23,6 @@ copy: {% for tile in range(1,ntiles+1) %} - ["{{ DATA }}/anl/{{ bkgtime | to_fv3time }}.fv_tracer.res.tile{{ tile }}.nc", "{{ COMOUT_ATMOS_RESTART }}/{{ bkgtime | to_fv3time }}.aeroanl_fv_tracer.res.tile{{ tile }}.nc"] {% endfor %} +## copy grib2 analysis +- ["{{ DATA }}/upp/GFSPRS.GrbF06", "{{ COMOUT_CHEM_ANALYSIS }}/{{ APREFIX }}aeroanl.grib2"] + diff --git a/parm/gdas/aeroanl_upp_config.yaml.j2 b/parm/gdas/aeroanl_upp_config.yaml.j2 index db3fa5223f9..f1983d7d48c 100644 --- a/parm/gdas/aeroanl_upp_config.yaml.j2 +++ b/parm/gdas/aeroanl_upp_config.yaml.j2 @@ -58,4 +58,3 @@ aeroincvars: [ ['oc2', 'mass_fraction_of_hydrophilic_organic_carbon_in_air'], ['bc1', 'mass_fraction_of_hydrophobic_black_carbon_in_air'], ['bc2', 'mass_fraction_of_hydrophilic_black_carbon_in_air']] - From 8b26fb8d731cde24c8c1d63252964aace0e7cf15 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Tue, 22 Jul 2025 16:59:18 +0000 Subject: [PATCH 10/22] norm fix --- scripts/exglobal_aero_analysis_finalize.py | 3 --- ush/python/pygfs/task/aero_analysis.py | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/exglobal_aero_analysis_finalize.py b/scripts/exglobal_aero_analysis_finalize.py index d2a6ddc4f21..55437bd2573 100755 --- a/scripts/exglobal_aero_analysis_finalize.py +++ b/scripts/exglobal_aero_analysis_finalize.py @@ -28,6 +28,3 @@ # Finalize JEDI aerosol variational analysis AeroAnl.finalize() - - - diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 2dc7c1e7d03..2099818535c 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -280,8 +280,10 @@ def upp_anlproc(self) -> None: """ local_dict = AttrDict( - { 'UPP_RUN': "analysis", - 'FORECAST_HOUR': 0 } + { + 'UPP_RUN': "analysis", + 'FORECAST_HOUR': 0 + } ) self.task_config = AttrDict(**self.task_config, **local_dict) self.task_config.UPP_CONFIG = self.task_config.UPP_CONFIG_YAML @@ -331,7 +333,7 @@ def upp_anlproc(self) -> None: self.add_atm_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) upp.execute(upp_dict.DATA, upp_dict.APRUN_AEROANLFINAL, upp_dict.forecast_hour) - + @logit(logger) def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: """Add aero gaussian increments to gaussian backgrounds @@ -352,7 +354,7 @@ def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: Li increment = incfile.variables[incname][:] # round to 7th decimal due to JEDI reproducibility issues when changing PE count increment = np.round(increment, 7) - # reordering the dimensions of increment to macth background + # reordering the dimensions of increment to macth background increment_reshape = np.transpose(increment, (2, 0, 1)) bkg = rstfile.variables[bkgname][:] From 0323953963847c3a53f7b30088882986b4e3bbe3 Mon Sep 17 00:00:00 2001 From: Yaping Wang Date: Wed, 23 Jul 2025 13:00:12 -0400 Subject: [PATCH 11/22] remove unnecessary lines --- ush/python/pygfs/task/aero_analysis.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index 2099818535c..d76284cad7c 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -352,18 +352,12 @@ def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: Li with Dataset(inc_file, mode='r') as incfile, Dataset(bkg_file, mode='a') as rstfile: for incname, bkgname in zip(incvars, bkgvars): increment = incfile.variables[incname][:] - # round to 7th decimal due to JEDI reproducibility issues when changing PE count - increment = np.round(increment, 7) # reordering the dimensions of increment to macth background increment_reshape = np.transpose(increment, (2, 0, 1)) bkg = rstfile.variables[bkgname][:] anl = bkg + increment_reshape[np.newaxis, :, :, :] rstfile.variables[bkgname][:] = anl[:] - try: - rstfile.variables[bkgname].delncattr('checksum') # remove the checksum so fv3 does not complain - except (AttributeError, RuntimeError): - pass # checksum is missing, move on @logit(logger) def add_atm_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: From 51fd3b3ed0cb23c5326a5792c55857be2d54d6ad Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Wed, 30 Jul 2025 14:03:42 +0000 Subject: [PATCH 12/22] reset to analysis time in input file, and save output to ROTDIR --- dev/parm/config/gfs/config.com | 1 + jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE | 3 ++- ush/python/pygfs/task/aero_analysis.py | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dev/parm/config/gfs/config.com b/dev/parm/config/gfs/config.com index bba449b0db3..9f16be183ca 100644 --- a/dev/parm/config/gfs/config.com +++ b/dev/parm/config/gfs/config.com @@ -110,5 +110,6 @@ declare -rx COM_CHEM_HISTORY_TMPL=${COM_BASE}'/model/chem/history' declare -rx COM_CHEM_ANALYSIS_TMPL=${COM_BASE}'/analysis/chem' declare -rx COM_CHEM_BMAT_TMPL=${COM_CHEM_ANALYSIS_TMPL}'/bmatrix' declare -rx COM_CHEM_ANLMON_TMPL=${COM_BASE}'/products/chem/anlmon' +declare -rx COM_CHEM_GRIB_TMPL=${COM_BASE}'/products/chem/grib2' declare -rx COM_MED_RESTART_TMPL=${COM_BASE}'/model/med/restart' diff --git a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE index a0f1a04a45b..8d0cee1d919 100755 --- a/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE +++ b/jobs/JGLOBAL_AERO_ANALYSIS_FINALIZE @@ -16,7 +16,8 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "aeroanlfinal" -c "base aeroanl aeroan YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ COMOUT_CHEM_ANALYSIS:COM_CHEM_ANALYSIS_TMPL \ COMOUT_CONF:COM_CONF_TMPL \ - COMOUT_ATMOS_RESTART:COM_ATMOS_RESTART_TMPL + COMOUT_ATMOS_RESTART:COM_ATMOS_RESTART_TMPL \ + COMOUT_CHEM_GRIB:COM_CHEM_GRIB_TMPL ############################################################### # Run relevant script diff --git a/ush/python/pygfs/task/aero_analysis.py b/ush/python/pygfs/task/aero_analysis.py index d76284cad7c..b28ee44d87b 100644 --- a/ush/python/pygfs/task/aero_analysis.py +++ b/ush/python/pygfs/task/aero_analysis.py @@ -269,7 +269,7 @@ def add_fv3_increments(self, inc_file_tmpl: str, bkg_file_tmpl: str, incvars: Li def upp_anlproc(self) -> None: """Process aerosol analysis to GRIB2 - This method processes aerosol AOD analysis from tracer fields using UPP. + This method processes aerosol analysis products from tracer fields using UPP. This includes: - Creating a UPP object - Staging UPP fix files @@ -300,13 +300,13 @@ def upp_anlproc(self) -> None: for key in keys: upp_dict[key] = upp.task_config[key] - upp_dict['NET'] = 'gfs' # set to 'gfs' temperally because upp didn't work with 'gcafs'. + upp_dict['NET'] = 'gfs' # set to 'gfs' so upp can recognize upp_dict['valid_datetime'] = self.task_config.current_cycle upp_dict['DATA'] = os.path.join(self.task_config.DATA, 'upp') upp_dict.update(upp_yaml['upp']['config']) # Configure the namelist and write to file - logger.info("Create namelist for upp.x") + logger.info("Creating namelist for upp.x") nml_template = os.path.join(upp_dict.DATA, "itag.jinja") nml_data = Jinja(nml_template, upp_dict).render logger.debug(f"itag:\n{nml_data}") @@ -332,6 +332,13 @@ def upp_anlproc(self) -> None: incvars = [var[1] for var in allvars] self.add_atm_gaussian_increments(inc_file, bkg_file, incvars, bkgvars) + # reset time to 0 (analysis time) + flux_file = os.path.join(upp_dict.DATA, f"{upp_dict.flux_filename}") + with Dataset(flux_file, mode='a') as rstfile: + time = rstfile.variables['time'] + time[:] = 0.0 + time.setncattr("units", f"hours since {self.task_config.current_cycle.strftime('%Y-%m-%d %H:%M:%S')}") + upp.execute(upp_dict.DATA, upp_dict.APRUN_AEROANLFINAL, upp_dict.forecast_hour) @logit(logger) @@ -358,6 +365,9 @@ def add_aero_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: Li bkg = rstfile.variables[bkgname][:] anl = bkg + increment_reshape[np.newaxis, :, :, :] rstfile.variables[bkgname][:] = anl[:] + time = rstfile.variables['time'] + time[:] = 0.0 + time.setncattr("units", f"hours since {self.task_config.current_cycle.strftime('%Y-%m-%d %H:%M:%S')}") @logit(logger) def add_atm_gaussian_increments(self, inc_file: str, bkg_file: str, incvars: List, bkgvars: List) -> None: From 91c333837fbd1ff29f6a5fee81888f0fedcedbab Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Wed, 30 Jul 2025 14:09:27 +0000 Subject: [PATCH 13/22] save grib2 file to ROTDIR --- parm/gdas/aero_finalize_variational.yaml.j2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parm/gdas/aero_finalize_variational.yaml.j2 b/parm/gdas/aero_finalize_variational.yaml.j2 index f950f26a9ac..e4faa8f348e 100644 --- a/parm/gdas/aero_finalize_variational.yaml.j2 +++ b/parm/gdas/aero_finalize_variational.yaml.j2 @@ -11,6 +11,7 @@ mkdir: - "{{ COMOUT_CHEM_ANALYSIS }}" - "{{ COMOUT_ATMOS_RESTART }}" - "{{ COMOUT_CONF }}" +- "{{ COMOUT_CHEM_GRIB }}" copy: ## copy variational YAML to ROTDIR - ["{{ DATA }}/aeroanlvar.yaml", "{{ COMOUT_CONF }}/{{ APREFIX }}aerovar.yaml"] @@ -24,5 +25,6 @@ copy: - ["{{ DATA }}/anl/{{ bkgtime | to_fv3time }}.fv_tracer.res.tile{{ tile }}.nc", "{{ COMOUT_ATMOS_RESTART }}/{{ bkgtime | to_fv3time }}.aeroanl_fv_tracer.res.tile{{ tile }}.nc"] {% endfor %} ## copy grib2 analysis -- ["{{ DATA }}/upp/GFSPRS.GrbF06", "{{ COMOUT_CHEM_ANALYSIS }}/{{ APREFIX }}aeroanl.grib2"] +- ["{{ DATA }}/upp/GFSPRS.GrbF00", "{{ COMOUT_CHEM_GRIB }}/{{ APREFIX }}aeroanl.grib2"] +- ["{{ DATA }}/upp/GFSPRS.GrbF00.idx", "{{ COMOUT_CHEM_GRIB }}/{{ APREFIX }}aeroanl.grib2.idx"] From 4332bf59d868153c72826ce42946dee09e1ee074 Mon Sep 17 00:00:00 2001 From: ypwang19 Date: Wed, 30 Jul 2025 21:31:30 +0000 Subject: [PATCH 14/22] update gdasapp hash --- sorc/gdas.cd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/gdas.cd b/sorc/gdas.cd index 65466562499..0e9024e665a 160000 --- a/sorc/gdas.cd +++ b/sorc/gdas.cd @@ -1 +1 @@ -Subproject commit 65466562499d9d2d640559bd1148b21435274128 +Subproject commit 0e9024e665ac0dab097192a9330dcd059a51c859 From bcda9403741d227e3598e36cb4b1ea1055f8bec4 Mon Sep 17 00:00:00 2001 From: wangyap Date: Tue, 16 Sep 2025 18:32:44 +0000 Subject: [PATCH 15/22] fix conflict --- dev/parm/config/gcafs/config.aeroanl.j2 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index d22efa528d9..e97b6d088a6 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -29,16 +29,7 @@ export STAGE_JEDI_FIX_YAML="${PARMgfs}/gdas/aero/aero_stage_jedi_fix.yaml.j2" export STAGE_YAML="${PARMgfs}/gdas/aero/aero_det_stage.yaml.j2" export SAVE_YAML="${PARMgfs}/gdas/aero/aero_det_save.yaml.j2" -<<<<<<< HEAD -export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_jedi_config.yaml.j2" -export UPP_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_upp_config.yaml.j2" - -export AERO_STAGE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_stage_variational.yaml.j2" -export AERO_FINALIZE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_finalize_variational.yaml.j2" -export AERO_BMATRIX_RESCALE_TMPL="aero_gen_bmatrix_rescale_default.yaml.j2" -======= export AERO_BMATRIX_RESCALE_YAML="aero_gen_bmatrix_rescale_default.yaml.j2" ->>>>>>> upstream/develop export io_layout_x="{{ IO_LAYOUT_X }}" export io_layout_y="{{ IO_LAYOUT_Y }}" From 8a8cee6f99418c466d6d4f4deb865ba1cf629557 Mon Sep 17 00:00:00 2001 From: wangyap Date: Tue, 16 Sep 2025 18:35:07 +0000 Subject: [PATCH 16/22] Revert "fix conflict" This reverts commit bcda9403741d227e3598e36cb4b1ea1055f8bec4. --- dev/parm/config/gcafs/config.aeroanl.j2 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index e97b6d088a6..d22efa528d9 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -29,7 +29,16 @@ export STAGE_JEDI_FIX_YAML="${PARMgfs}/gdas/aero/aero_stage_jedi_fix.yaml.j2" export STAGE_YAML="${PARMgfs}/gdas/aero/aero_det_stage.yaml.j2" export SAVE_YAML="${PARMgfs}/gdas/aero/aero_det_save.yaml.j2" +<<<<<<< HEAD +export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_jedi_config.yaml.j2" +export UPP_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_upp_config.yaml.j2" + +export AERO_STAGE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_stage_variational.yaml.j2" +export AERO_FINALIZE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_finalize_variational.yaml.j2" +export AERO_BMATRIX_RESCALE_TMPL="aero_gen_bmatrix_rescale_default.yaml.j2" +======= export AERO_BMATRIX_RESCALE_YAML="aero_gen_bmatrix_rescale_default.yaml.j2" +>>>>>>> upstream/develop export io_layout_x="{{ IO_LAYOUT_X }}" export io_layout_y="{{ IO_LAYOUT_Y }}" From 63879afb0e1c1beaab1694a4de8670c78489f354 Mon Sep 17 00:00:00 2001 From: wangyap Date: Tue, 16 Sep 2025 18:53:18 +0000 Subject: [PATCH 17/22] update submodule --- sorc/gsi_enkf.fd | 2 +- sorc/gsi_monitor.fd | 2 +- sorc/gsi_utils.fd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sorc/gsi_enkf.fd b/sorc/gsi_enkf.fd index b806a99515d..9ae40630481 160000 --- a/sorc/gsi_enkf.fd +++ b/sorc/gsi_enkf.fd @@ -1 +1 @@ -Subproject commit b806a99515d02de3fbfa80bb6336a454eabf8d8b +Subproject commit 9ae40630481f678c36461868877cd141f2f630f7 diff --git a/sorc/gsi_monitor.fd b/sorc/gsi_monitor.fd index 74df9c1b954..d5380b7a81a 160000 --- a/sorc/gsi_monitor.fd +++ b/sorc/gsi_monitor.fd @@ -1 +1 @@ -Subproject commit 74df9c1b954f52c170c61ac8d4f9836804bc091b +Subproject commit d5380b7a81a51d60afae88e0ea4fb2e074d95d74 diff --git a/sorc/gsi_utils.fd b/sorc/gsi_utils.fd index 4e855b6cc78..c5d3a513cfb 160000 --- a/sorc/gsi_utils.fd +++ b/sorc/gsi_utils.fd @@ -1 +1 @@ -Subproject commit 4e855b6cc789a134a5d759c2f937e7fd52d50c77 +Subproject commit c5d3a513cfb3cf0c9878a83c2b4af017cceac5cf From 41561d6c65a021364af0fc5a24a91c446b4d928b Mon Sep 17 00:00:00 2001 From: wangyap Date: Tue, 16 Sep 2025 18:59:31 +0000 Subject: [PATCH 18/22] fix conflict --- dev/parm/config/gcafs/config.aeroanl.j2 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index d22efa528d9..e97b6d088a6 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -29,16 +29,7 @@ export STAGE_JEDI_FIX_YAML="${PARMgfs}/gdas/aero/aero_stage_jedi_fix.yaml.j2" export STAGE_YAML="${PARMgfs}/gdas/aero/aero_det_stage.yaml.j2" export SAVE_YAML="${PARMgfs}/gdas/aero/aero_det_save.yaml.j2" -<<<<<<< HEAD -export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_jedi_config.yaml.j2" -export UPP_CONFIG_YAML="${PARMgfs}/gdas/aeroanl_upp_config.yaml.j2" - -export AERO_STAGE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_stage_variational.yaml.j2" -export AERO_FINALIZE_VARIATIONAL_TMPL="${PARMgfs}/gdas/aero_finalize_variational.yaml.j2" -export AERO_BMATRIX_RESCALE_TMPL="aero_gen_bmatrix_rescale_default.yaml.j2" -======= export AERO_BMATRIX_RESCALE_YAML="aero_gen_bmatrix_rescale_default.yaml.j2" ->>>>>>> upstream/develop export io_layout_x="{{ IO_LAYOUT_X }}" export io_layout_y="{{ IO_LAYOUT_Y }}" From a8ff6edec78f1a62e10bcd92201c93a3b3d3e8d4 Mon Sep 17 00:00:00 2001 From: Yaping Wang Date: Thu, 18 Sep 2025 16:35:49 -0400 Subject: [PATCH 19/22] add upp config file --- dev/parm/config/gcafs/config.aeroanl.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index e97b6d088a6..2352c52722e 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -24,6 +24,7 @@ export BERROR_YAML="aero_background_error_static_${STATICB_TYPE}" export BERROR_DATA_DIR="${FIXgfs}/gdas/aero/clim_b" export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aero/aero_det_jedi_config.yaml.j2" +export UPP_CONFIG_YAML="${PARMgfs}/gdas/aero_upp_config.yaml.j2" export STAGE_CRTM_COEFF_YAML="${PARMgfs}/gdas/aero/aero_stage_crtm_coeff.yaml.j2" export STAGE_JEDI_FIX_YAML="${PARMgfs}/gdas/aero/aero_stage_jedi_fix.yaml.j2" export STAGE_YAML="${PARMgfs}/gdas/aero/aero_det_stage.yaml.j2" From b34ef7232fac8230422ab029cdf38ef8d27f8e24 Mon Sep 17 00:00:00 2001 From: Yaping Wang Date: Thu, 18 Sep 2025 17:52:11 -0400 Subject: [PATCH 20/22] use task number of 96 for aeroanlfinal --- dev/parm/config/gcafs/config.aeroanl.j2 | 2 +- dev/parm/config/gcafs/config.resources | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/parm/config/gcafs/config.aeroanl.j2 b/dev/parm/config/gcafs/config.aeroanl.j2 index 2352c52722e..8fef9bafe66 100644 --- a/dev/parm/config/gcafs/config.aeroanl.j2 +++ b/dev/parm/config/gcafs/config.aeroanl.j2 @@ -24,7 +24,7 @@ export BERROR_YAML="aero_background_error_static_${STATICB_TYPE}" export BERROR_DATA_DIR="${FIXgfs}/gdas/aero/clim_b" export JEDI_CONFIG_YAML="${PARMgfs}/gdas/aero/aero_det_jedi_config.yaml.j2" -export UPP_CONFIG_YAML="${PARMgfs}/gdas/aero_upp_config.yaml.j2" +export UPP_CONFIG_YAML="${PARMgfs}/gdas/aero/aero_upp_config.yaml.j2" export STAGE_CRTM_COEFF_YAML="${PARMgfs}/gdas/aero/aero_stage_crtm_coeff.yaml.j2" export STAGE_JEDI_FIX_YAML="${PARMgfs}/gdas/aero/aero_stage_jedi_fix.yaml.j2" export STAGE_YAML="${PARMgfs}/gdas/aero/aero_det_stage.yaml.j2" diff --git a/dev/parm/config/gcafs/config.resources b/dev/parm/config/gcafs/config.resources index 023ebc9ecfb..a0373492578 100644 --- a/dev/parm/config/gcafs/config.resources +++ b/dev/parm/config/gcafs/config.resources @@ -520,7 +520,7 @@ case ${step} in echo "FATAL ERROR: Resources not defined for job ${step} at resolution ${CASE}" exit 4 esac - ntasks=120 + ntasks=96 threads_per_task=1 tasks_per_node=$(( max_tasks_per_node / threads_per_task )) memory=${mem_node_max} From 25ac018a2bd7370cc08e715bc76843172d27c7d8 Mon Sep 17 00:00:00 2001 From: Yaping Wang Date: Fri, 19 Sep 2025 11:53:04 -0400 Subject: [PATCH 21/22] link upp/parm/gcafs to workflow ./post --- sorc/link_workflow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sorc/link_workflow.sh b/sorc/link_workflow.sh index f57ea472dde..ed0ab824b2c 100755 --- a/sorc/link_workflow.sh +++ b/sorc/link_workflow.sh @@ -150,7 +150,7 @@ ${LINK_OR_COPY} "${HOMEgfs}/sorc/ufs_model.fd/tests/parm/noahmptable.tbl" . cd "${HOMEgfs}/parm/post" || exit 1 ${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/parm/params_grib2_tbl_new" . ${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/fix/nam_micro_lookup.dat" . -for dir in gfs gefs sfs +for dir in gfs gefs sfs gcafs do ${LINK_OR_COPY} "${HOMEgfs}/sorc/upp.fd/parm/${dir}" . done From 6551e4fc8d1483c8c418b7fb0df7879121320e7e Mon Sep 17 00:00:00 2001 From: Yaping Wang Date: Fri, 19 Sep 2025 18:01:17 -0400 Subject: [PATCH 22/22] archive aeroanl.grib2 --- jobs/JGLOBAL_ARCHIVE_TARS | 1 + jobs/JGLOBAL_ARCHIVE_VRFY | 1 + parm/archive/gcafs_arcdir.yaml.j2 | 4 ++++ parm/archive/master_gcdas.yaml.j2 | 2 ++ 4 files changed, 8 insertions(+) diff --git a/jobs/JGLOBAL_ARCHIVE_TARS b/jobs/JGLOBAL_ARCHIVE_TARS index 712fe6667a3..c38c6634395 100755 --- a/jobs/JGLOBAL_ARCHIVE_TARS +++ b/jobs/JGLOBAL_ARCHIVE_TARS @@ -22,6 +22,7 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ COMIN_ATMOS_WMO:COM_ATMOS_WMO_TMPL \ COMIN_CHEM_HISTORY:COM_CHEM_HISTORY_TMPL \ COMIN_CHEM_ANALYSIS:COM_CHEM_ANALYSIS_TMPL \ + COMIN_CHEM_GRIB:COM_CHEM_GRIB_TMPL \ COMIN_MED_RESTART:COM_MED_RESTART_TMPL \ COMIN_SNOW_ANALYSIS:COM_SNOW_ANALYSIS_TMPL \ COMIN_SNOW_ANLMON:COM_SNOW_ANLMON_TMPL \ diff --git a/jobs/JGLOBAL_ARCHIVE_VRFY b/jobs/JGLOBAL_ARCHIVE_VRFY index d3bc3ba70cd..0d55036ae29 100755 --- a/jobs/JGLOBAL_ARCHIVE_VRFY +++ b/jobs/JGLOBAL_ARCHIVE_VRFY @@ -12,6 +12,7 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \ COMIN_ATMOS_HISTORY:COM_ATMOS_HISTORY_TMPL \ COMIN_ATMOS_TRACK:COM_ATMOS_TRACK_TMPL \ COMIN_CHEM_ANALYSIS:COM_CHEM_ANALYSIS_TMPL \ + COMIN_CHEM_GRIB:COM_CHEM_GRIB_TMPL \ COMIN_SNOW_ANALYSIS:COM_SNOW_ANALYSIS_TMPL \ COMIN_OBS:COM_OBS_TMPL \ COMOUT_ATMOS_TRACK:COM_ATMOS_TRACK_TMPL diff --git a/parm/archive/gcafs_arcdir.yaml.j2 b/parm/archive/gcafs_arcdir.yaml.j2 index 20509794dd5..691513e4755 100644 --- a/parm/archive/gcafs_arcdir.yaml.j2 +++ b/parm/archive/gcafs_arcdir.yaml.j2 @@ -21,6 +21,10 @@ {% if DO_AERO_ANL %} {% do det_anl_files.append([COMIN_CHEM_ANALYSIS ~ "/" ~ head ~ "aerostat.tgz", ARCDIR ~ "/aerostat." ~ RUN ~ "." ~ cycle_YMDH ~ ".tgz"]) %} + {% do det_anl_files.append([COMIN_CHEM_GRIB ~ "/" ~ head ~ "aeroanl.grib2", + ARCDIR ~ "/aeroanl." ~ RUN ~ "." ~ cycle_YMDH ~ ".grib2"]) %} + {% do det_anl_files.append([COMIN_CHEM_GRIB ~ "/" ~ head ~ "aeroanl.grib2.idx", + ARCDIR ~ "/aeroanl." ~ RUN ~ "." ~ cycle_YMDH ~ ".grib2.idx"]) %} {% endif %} {% if DO_PREP_OBS_AERO == True %} diff --git a/parm/archive/master_gcdas.yaml.j2 b/parm/archive/master_gcdas.yaml.j2 index bcfd585f3de..9fee2e03322 100644 --- a/parm/archive/master_gcdas.yaml.j2 +++ b/parm/archive/master_gcdas.yaml.j2 @@ -15,6 +15,8 @@ datasets: - "logs/{{ cycle_YMDH }}/{{ RUN }}_aeroanlvar.log" - "logs/{{ cycle_YMDH }}/{{ RUN }}_aeroanlfinal.log" - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/{{ head }}aerostat.tgz" + - "{{ COMIN_CHEM_GRIB | relpath(ROTDIR) }}/{{ head }}aeroanl.grib2" + - "{{ COMIN_CHEM_GRIB | relpath(ROTDIR) }}/{{ head }}aeroanl.grib2.idx" - "{{ COMIN_CONF | relpath(ROTDIR) }}/{{ head }}aerovar.yaml" {% for itile in range(1,7) %} - "{{ COMIN_CHEM_ANALYSIS | relpath(ROTDIR) }}/aeroinc.{{ cycle_YMD }}.{{ cycle_HH }}0000.fv_tracer.res.tile{{ itile }}.nc"