Skip to content

Added routines for Preprocessing forcing on WCOSS2 t forecast peri… - #64

Open
kestonsmith-noaa wants to merge 37 commits into
NOAA-EMC:developfrom
kestonsmith-noaa:AddPreProcessRoutines
Open

Added routines for Preprocessing forcing on WCOSS2 t forecast peri…#64
kestonsmith-noaa wants to merge 37 commits into
NOAA-EMC:developfrom
kestonsmith-noaa:AddPreProcessRoutines

Conversation

@kestonsmith-noaa

Copy link
Copy Markdown
Collaborator

Added routines for pre-processing forcing [wind water level currents ice], on WCOSS2 (for recent forecast periods). These routines
(A) retrieve the necessary forecast files
(B) interpolate fields to an RWPS mesh
(C) interpolate disparate forecasts to a common time frame
(D) Combine disparate forecasts in a bayesian manner.
Note: I will mark this as draft while we discuss code organization

…ods), interpolating fields to RWPS mesh, interpolating to common time frame, and blending forcing in bayesian manner
@kestonsmith-noaa
kestonsmith-noaa marked this pull request as draft July 30, 2026 13:55

@JessicaMeixner-NOAA JessicaMeixner-NOAA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure where you are in the process of things but wanted to make comments on some things I saw and noticed.

@@ -0,0 +1,102 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jobs names should follow the JRWPS_JOBNAME where JOBNAME is something specific.

Also, would we create interpolation weights each forecast cycle? If not, this should move to dev/jobs/ and then the name is not as important.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kestonsmith-noaa - This will need to be addressed. Also I believe this should be moved to dev/

Comment thread sorc/build_ww3.sh
set -x

ww3switch=model/bin/switch_NCEP_rwps
ww3switch=model/bin/switch_NWS_rwps

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to say this change was made in another PR, perhaps your branch needs to have the develop merged into it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kestonsmith-noaa - Your branch needs the develop branch merged into it still.

@@ -0,0 +1,97 @@
#!/bin/sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Job cards do not belong in ush.

Comment thread ush/PreProcess/GetAllFocing.jobcard.sh Outdated
@@ -0,0 +1,80 @@
#!/bin/sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

job cards do not belong in ush

Comment thread ush/PreProcess/rwpsenv Outdated
@@ -0,0 +1,11 @@
date=20260803

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sure this file has an extension (.sh, .py, etc).

Comment thread ush/PreProcess/rwpsenv Outdated
date=20260803
cycl=00
rootdir=$(pwd)
mesh="$rootdir/../../fix/rwps.oc_1500m_30km.msh"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the fix file directory would be ${FIXrwps}

So mesh would be:
mesh="${FIXrwps}/rwps.oc_1500m_30km.msh"

Also, you can use the path ${FIXrwps} within other scripts.

Also I think with the reorg of the fix, there's another folder inbetween fix and the mesh file?

Comment thread ush/PreProcess/rwpsenv Outdated
cycl=00
rootdir=$(pwd)
mesh="$rootdir/../../fix/rwps.oc_1500m_30km.msh"
fix="$rootdir/../../fix"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread ush/PreProcess/rwpsenv Outdated
rootdir=$(pwd)
mesh="$rootdir/../../fix/rwps.oc_1500m_30km.msh"
fix="$rootdir/../../fix"
prep="$rootdir/../../PrepInputs"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about this folder because it seems like it would be ${HOMErwps}/PrepInputs with HOMErwps being your clone and the same level as fix, and I'm not sure that we should have a "PrepInputs" there.

Comment thread ush/PreProcess/rwpsenv Outdated
@@ -0,0 +1,11 @@
date=20260803
cycl=00
rootdir=$(pwd)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be ${HOMErwps}? Ie where your git clone is?

Comment thread ush/PreProcess/SpdDir2UVnbm.py Outdated
import math
flin=sys.argv[1]
flout=sys.argv[2]
#fld="wdir10m.nc"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out code.

@kestonsmith-noaa

Copy link
Copy Markdown
Collaborator Author

will do

Comment thread ecf/GenerateInterpolationWeights.ecf Outdated
@@ -0,0 +1,102 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kestonsmith-noaa - Will interpolation weights be calculated for every cycle or just once and stored as fix files?

If for every cycle, then let's move this to a jrwps_*.ecf file.
If not, then let's move this to dev/ecf.

Comment thread ecf/jrwps_prep_currents.ecf Outdated
#cycl=00
#mesh=../../fix/rwps.oc_1500m_30km.msh

source /lfs/h2/emc/couple/noscrub/keston.smith/TestRWPS/RWPS/ush/PreProcess/rwpsenv

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stuff below this line, particularly the sh .sh files should be all contained in jobs/JRWPS_prep_currents.job

@JessicaMeixner-NOAA

Copy link
Copy Markdown
Collaborator

FYI - All scripts and ush files need to be all lowercase names: https://nws-hpc-standards.readthedocs.io/en/stable/standards.html#c-interpreted-code-bash-ksh-perl-or-python-scripts

Comment thread ecf/jrwps_prep_currents.ecf Outdated

rm $prep/FetchCurrents.out $prep/ProcCurrents.out

sh GetCurrents.sh $prep > $tmp/FetchCurrents.out

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ecf scripts should call a JJOB

Comment thread sorc/build_ww3.sh
set -x

ww3switch=model/bin/switch_NCEP_rwps
ww3switch=model/bin/switch_NWS_rwps

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kestonsmith-noaa - Your branch needs the develop branch merged into it still.

@kestonsmith-noaa
kestonsmith-noaa marked this pull request as ready for review August 25, 2026 18:22
@kestonsmith-noaa

Copy link
Copy Markdown
Collaborator Author

Pre-processing routines have been changed to more closely follow global workflow. Currently only set to work on wcoss2. Weights are confirmed in a mirror fix location under my noscrub directory for mesh oc_1500m_30km. Others should be added shortly and then will be copied to the group RWPS fix location when these are all prepared and tested.

…outside of rtofs coverage. occurs only for coarse test meshes. cleaned up weight generation ecf file for clarity
Comment thread sorc/get_externals.sh


# copy mesh to local fix directory
cp -p $RWPSfix/fix/$meshname/20260722/rwps.$meshname.msh ../fix/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meshname or RWPSfix are not defined.

I believe this is actually done in link_workflow.sh -

I have not removed get_externals.sh but we should move things to link_workflow.sh if possible.

…s now done in dev/compute_interpolation_weights
Comment thread versions/preproc.wcoss2.ver
Comment thread ush/preprocess/spd_dir_to_uv_nbm.py
Comment thread ush/preprocess/spd_dir_to_uv_nbm.py Outdated

time_var=ncout.createVariable('time', 'f8', ('time',))
time_var.units = 'seconds since 1970-01-01 00:00:00.0 0:00'
time_var.long_name = 'verification time generated by wgrib2 function verftime()'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a verification time or valid time?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This is unnecessarily specific. I am going to copy time attributes from the input file rather than explicitly re-specifying. Will update shortly

Comment thread ecf/jrwps_prep_current.ecf Outdated
Comment thread ecf/jrwps_prep_current.ecf Outdated

rm $tmp/FetchCurrent.out $tmp/ProcCurrent.out

sh get_current.sh > $tmp/FetchCurrent.out

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each ecf script should be calling a JJOB, so for example, at this point of the script, I would expect:

${HOMErwps}/jobs/JRWPS_PREP_CURRENT

Then the
${HOMErwps}/jobs/JRWPS_PREP_CURRENT
would call a script:

${SCRrwps}/exrwps_prep_current.sh , which is either what process_current.sh should be renamed to, or then it would be calling the ush/process_current script.

Comment thread ecf/jrwps_prep_current.ecf Outdated
Comment thread ecf/jrwps_prep_ice.ecf Outdated

module list

rm $tmp/FetchIce.out $tmp/ProcIce.out

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the comments from the above ecf script are valid here.



# Consolidate u,v surface currents from global RTOFS into a single NetCDF file.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment about what the two sys argument inputs are?

kestonsmith-noaa and others added 4 commits September 3, 2026 16:18
Added description of command line arguments
Co-authored-by: Jessica Meixner <jessica.meixner@noaa.gov>
remove unnecessary specific piped output files

Co-authored-by: Jessica Meixner <jessica.meixner@noaa.gov>
…bm.py. seperated prep tasks from ecf to ecf(load modules) and jobs/JRWPS_PREP_ to execute task
@@ -0,0 +1,64 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file supposed to be here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unused file

@@ -0,0 +1,29 @@
#!/bin/bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an ush script, should this move somewhere else?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed unused file

Comment thread dev/compute_interpolation_weights/README.txt Outdated
!/bin/bash
# --------------------------------------------------------------------------- #
# #
# Copy external fix files that are too large to store in repository #

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this description needs updated//removed along with the "last changed" date.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed- I will go through the rest to make sure there aren't other bad headers

…process to dev/compute_interpolation_weights/ush. split dev/compute_interpolation_weights/ecf/compute_interpolation_weights.ecf into module loading portion and dev/compute_interpolation_weights/jobs/COMPUTE_INTERPOLATION_WEIGHTS
fixed typo's in README

cd RWPS/dev/compute_interpolation_weights/sorc

dev/compute_interpolation_weights/sorc/compute_interpolation_weights.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does the ecf script play in this?

If I wanted to run this would I try to run

qsub compute_interpolation_weights.ecf

are there things I should change or update when I do?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clarified in README

$ cd RWPS/dev/compute_interpolation_weights/sorc
$ sh compute_interpolation_weights.sh oc_1500m_30km

...


#machine dependend path to rtofs, nbm, rrfs, and stofs forecast files
export COMINrtofs="/lfs/h1/ops/prod/com/rtofs/v2.5/rtofs.$PDY/"
export COMINnbm="/lfs/h3/mdl/ptmp/mdl.nbm/blend/v5.2/blend.$PDY/$cyc/grib2"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove variables that are not used or 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

Successfully merging this pull request may close these issues.

2 participants