ufs-community / ufs-srweather-app

UFS Short-Range Weather Application
Other
55 stars 116 forks source link

[production/AQM.v7] Ex-scripts can not call any python scripts from ~/sorc #982

Closed JianpingHuang-NOAA closed 9 months ago

JianpingHuang-NOAA commented 9 months ago

NCO SPA team noticed that exaqm_nexus_post_split.sh and exaqm_nexus_emission.sh call python script from ~/sorc.

Here is an example.

python3 ${ARL_NEXUS_DIR}/utils/python/nexus_nei2016_linker.py --src_dir ${NEXUS_INPUT_BASE_DIR} --date ${yyyymmdd} --work_dir ${DATAinput} -v "v2022-07"

This is against the NCO implementation standards

Please move those python scripts from ~/sorc to ~/ush and then allow ex-scripts to call those python scripts from ~/ush

It seems there are a lot of scripts run from the sorc/ directory. Please correct all of them.

Thanks ! @bbakernoaa @chan-hoo

chan-hoo commented 9 months ago

@JianpingHuang-NOAA, you can add a copy command right before the above command line like:

cp {fp.py} {USHaqm}
{USHaqm}/python_script ...

Isn't this allowed either?

JianpingHuang-NOAA commented 9 months ago

@chan-hoo Let me bring Carlos to answer your questions @CarlosMDiaz-NCO

bbakernoaa commented 9 months ago

@chan-hoo @JianpingHuang-NOAA Would we also need to copy the ${ARL_NEXUS_DIR}/config to the parm location as well?

CarlosMDiaz-NCO commented 9 months ago

Files in sorc/ should not be referenced at all during run-time. The needed files can be copied into ush/, parm/, fix/, etc. as part of the build script and then the variables (e.g. PARMaqm_utils, ARL_NEXUS_DIR) updated.

What I've found so far that will need to be updated, either to scripts copied to ush/ or to config files copied to parm/ or fix/

ush/config_defaults.yaml:72:  ARL_NEXUS_DIR: '{{ [SORCdir, "arl_nexus"]|path_join }}
export PARMaqm_utils="${PARMaqm_utils:-${HOMEaqm}/sorc/AQM-utils/parm}"
scripts/exregional_fire_emission.sh:136:  python3 ${HOMEaqm}/sorc/AQM-utils/python_utils/RAVE_remake.allspecies.aqmna13km.g793.py --date "${yyyymmdd}" --cyc "${hh}" --input_fire "${input_fire}" --output_fire "${output_fire}"
scripts/exregional_aqm_ics.sh:119:python3 ${HOMEaqm}/sorc/AQM-utils/python_utils/add_aqm_ics.py --fv_tracer_file "${fv_tracer_file}" --wrk_ic_file "${wrk_ic_file}"
scripts/exregional_point_source.sh:80:  python3 ${HOMEaqm}/sorc/AQM-utils/python_utils/stack-pt-merge.py -s ${yyyymmddhh} -n ${nstep} -i ${PT_SRC_PRECOMB}
chan-hoo commented 9 months ago

@CarlosMDiaz-NCO, Thanks for the clarification. I'll add the copy commands for them to the build script app_build.sh.

JianpingHuang-NOAA commented 9 months ago

@chan-hoo Can I open a PR to merge my branch into production/AQM.v7? We have made a lot of changes to address EE2 compliance. Is it ok for you to merge my PR before you make further changes?

chan-hoo commented 9 months ago

@JianpingHuang-NOAA, yes, please open it ASAP.

JianpingHuang-NOAA commented 9 months ago

@chan-hoo I assume that you have received my PR 983

chan-hoo commented 9 months ago

@JianpingHuang-NOAA, your PR has a conflict. Once you resolve it, I'll merge it.

JianpingHuang-NOAA commented 9 months ago

@chan-hoo Where is the conflict message?

chan-hoo commented 9 months ago

On the bottom