Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task to allow use of GMAO_perllib for BufrToIoda #507

Draft
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

mranst
Copy link
Contributor

@mranst mranst commented Feb 14, 2025

Description

@cohen-seth Are you able to change your PR to be a branch of the main swell repository? If so, I will change this PR to merge with your branch to make it easier

This PR adds a task CloneGmaoPerllib, which allows the upcoming convert_bufr suite to use the perl commands acquire and acquire_obsys. It also adds the infrastructure to allow convert_bufr to be created and launched as a swell suite.

Use of the acquire commands through swell will be made possible by extending the PATH of subprocess to include GMAO_perllib in the experiment directory. CloneGmaoPerllib handles placing GMAO_perllib in the experiment directory. On discover, by default this is done by linking to a existing location, /discover/nobackup/projects/gmao/advda/perllib_opt/GMAO_perllib/g1.0.1. If no existing location is specified, it will clone it from github.

I have included a dummy task UseAcquire to demonstrate how acquire can be called from within python using the subprocess.run method. I included a version of the example in (#378), which shows what it would look like translated to python (I'm not sure if it works).

"""
Translated c-shell to python:
satbfrdb = os.path.join(swell_exp_path, "GEOS_mksi", "ObsClass")
my_exp = "/gpfsm/dnb05/projes/p139/rtodling/TEST/GETBUFR/"
work = os.path.join(my_exp, "work")
spool = os.path.join(my_exp, "spool")
obs_class = "disc_airs_bufr,disc_amsua_bufr,gmao_amsr2_bufr,gmao_gmi_bufr,mls_nrt_nc,ncep_1bamua_bufr,ncep_acftpfl_bufr,ncep_atms_bufr,ncep_aura_omi_bufr,ncep_avcsam_bufr,ncep_avcspm_bufr,ncep_crisfsr_bufr,ncep_goesfv_bufr,ncep_gpsro_bufr,ncep_mhs_bufr,ncep_mtiasi_bufr,ncep_prep_bufr,ncep_satwnd_bufr,ncep_ssmis_bufr,ncep_tcvitals,npp_ompsnm_bufr,r21c_npp_ompslp_nc,m2scr_n21_ompslp_nc,gmao_mlst_bufr"
nymd = "20231010"
nhms = "120000"
nfreq = "060000"
nstep = "1"
subprocess.run(["acquire_obsys", "-v", "-d", work, "-s", spool, "strict", "-ssh", nymd, nhms, nfreq, nstep, obs_class])
"""

To test:

Your experiment.yaml should include the following lines:

# What is the path to where the GMAO_perllib executables, acquire_obsys and acquire, are located?
gmao_perllib_path: /discover/nobackup/projects/gmao/advda/perllib_opt/GMAO_perllib/g1.0.1/

# What is the target tag for GMAO_perllib?
gmao_perllib_tag: g1.0.1

So that running:

swell task CloneGmaoPerllib <your experiment.yaml>
swell task UseAcquire <your experiment.yaml>

will show the help message

Convert_bufr as suite

Running swell create convert_bufr will now automatically create an experiment with the two lines added. (other questions will need to be added). Defaults are populated from src/swell/test/suite_tests/convert_bufr-tier1.yaml. I copied this file from convert_ncdiags, just to see if it works. @cohen-seth Feel free to update the values with the ones you're testing with, but we don't necessarily have to worry about it until after you're done testing your tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant