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

Get rid of REPLAY_ANA_LOCATION in AGCM.rc #654

Open
AgilentGCMS opened this issue Oct 18, 2024 · 0 comments
Open

Get rid of REPLAY_ANA_LOCATION in AGCM.rc #654

AgilentGCMS opened this issue Oct 18, 2024 · 0 comments

Comments

@AgilentGCMS
Copy link

Problem description

GEOS5 replay currently requires two keys in AGCM.rc, such as

REPLAY_ANA_LOCATION: /discover/nobackup/projects/gmao/share/gmao_ops/verification/MERRA2_MEANS
REPLAY_FILE: tavg3_3d_asm_Nv/Y%y4/M%m2/MERRA-2.tavg3_3d_asm_Nv.%y4%m2%d2.nc4

gcm_run.j assumes that the first path component in REPLAY_FILE is a folder, and makes a symlink of that name in scratch pointing to REPLAY_ANA_LOCATION. So e.g. the above keys would result in the symlink

scratch/tavg3_3d_asm_Nv -> /discover/nobackup/projects/gmao/share/gmao_ops/verification/MERRA2_MEANS/tavg3_3d_asm_Nv

This is problematic because it goes against user expectation that REPLAY_FILE is simply the pattern of file names that are searched for inside REPLAY_ANA_LOCATION, i.e., the setting below

REPLAY_ANA_LOCATION: /discover/nobackup/projects/gmao/share/gmao_ops/verification/MERRA2_MEANS/tavg3_3d_asm_Nv
REPLAY_FILE: Y%y4/M%m2/MERRA-2.tavg3_3d_asm_Nv.%y4%m2%d2.nc4

is not equivalent to the setting above and does not work. Moreover, it is not necessary to separate the replay file pattern into two components as above, since the GEOS5 fortran code only reads REPLAY_FILE and is perfectly capable of handling long path names.

Proposed fix

Put the entire replay path in REPLAY_FILE as follows

REPLAY_FILE: /discover/nobackup/projects/gmao/share/gmao_ops/verification/MERRA2_MEANS/tavg3_3d_asm_Nv/Y%y4/M%m2/MERRA-2.tavg3_3d_asm_Nv.%y4%m2%d2.nc4

and get rid of the logic in gcm_run.j that creates the REPLAY_ANA_LOCATION symlink. See below for the lines that need to be commented.

if( $REPLAY_MODE == 'Exact' | $REPLAY_MODE == 'Regular' ) then

     set ANA_EXPID    = `grep '^\s*REPLAY_ANA_EXPID:'    AGCM.rc | cut -d: -f2`
#     set ANA_LOCATION = `grep '^\s*REPLAY_ANA_LOCATION:' AGCM.rc | cut -d: -f2` # comment out

#     set REPLAY_FILE        = `grep '^\s*REPLAY_FILE:'   AGCM.rc | cut -d: -f2` # comment out
#     set REPLAY_FILE09      = `grep '^\s*REPLAY_FILE09:' AGCM.rc | cut -d: -f2` # comment out
#     set REPLAY_FILE_TYPE   = `echo $REPLAY_FILE           | cut -d"/" -f1 | grep -v %` # comment out
#     set REPLAY_FILE09_TYPE = `echo $REPLAY_FILE09         | cut -d"/" -f1 | grep -v %` # comment out

     # Modify GAAS_GridComp_ExtData and Link REPLAY files
     # ---------------------------------------------
     /bin/mv -f GAAS_GridComp_ExtData.yaml GAAS_GridComp_ExtData.yaml.tmpl
     cat GAAS_GridComp_ExtData.yaml.tmpl | sed -e "s?das.aod_?chem/Y%y4/M%m2/${ANA_EXPID}.aod_?g" > GAAS_GridComp_ExtData.yaml

     /bin/mv -f GAAS_GridComp_ExtData.rc GAAS_GridComp_ExtData.rc.tmpl
     cat GAAS_GridComp_ExtData.rc.tmpl | sed -e "s?das.aod_?chem/Y%y4/M%m2/${ANA_EXPID}.aod_?g" > GAAS_GridComp_ExtData.rc

#     /bin/ln -sf ${ANA_LOCATION}/chem . # comment out
#     /bin/ln -sf ${ANA_LOCATION}/${REPLAY_FILE_TYPE} . # comment out
#     /bin/ln -sf ${ANA_LOCATION}/${REPLAY_FILE09_TYPE} . # comment out

endif

I am not 100% sure what the /bin/ln -sf ${ANA_LOCATION}/chem . does or if it's still needed.

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

No branches or pull requests

1 participant