Add interpolation weight calc - #68
Conversation
…ods), interpolating fields to RWPS mesh, interpolating to common time frame, and blending forcing in bayesian manner
…eight and distance files to cl inputs of ComputeGriddedToRWPSInterpWeights.py
…RWPS into AddPreProcessRoutines
…XXX.sh and GetXXX.sh. Moved working program to ush/PreProcess
…). fixed paths for some variables and simplified envvar names
…preprocessing on wcoss2. Added scripts to dev for computing interpolation weights
…les for preparing forcing and generating interpolation weights.
…outside of rtofs coverage. occurs only for coarse test meshes. cleaned up weight generation ecf file for clarity
…s now done in dev/compute_interpolation_weights
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
…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
…ights.sh to dev/compute_interpolation_weights/ush/
…. Quieted mkdir statements where missing in preprocessing routines
…rapolation index issue in gridded weight calculation
…unstructuerd interpolation weight generation
JessicaMeixner-NOAA
left a comment
There was a problem hiding this comment.
Are any of the files outside of dev/compute_interpolation_weights needed for the interpolation weight calculation?
|
Not the way I reconfigured this. The only external file needed here is the linked mesh file. |
|
Okay - Can the extra files be removed from this PR that are not in the dev/ folder then? |
| @@ -0,0 +1,12 @@ | |||
| #! /usr/bin/env bash | |||
There was a problem hiding this comment.
I don't see where this file is currently being used in this PR:
> grep preproc -r *
fix/waveprnc.gfs_rwps.tmpl:$ WAVEWATCH-III wind preprocessor input file
fix/waveprnc.ndfd_rwps.tmpl:$ WAVEWATCH-III wind preprocessor input file
fix/waveprep.ice.tmpl:$ WAVEWATCH-III wind preprocessor input file
fix/waveprnc.hrrr_rwps.tmpl:$ WAVEWATCH-III wind preprocessor input file
parm/ww3_prnc_wind.inp.tmpl:$ Template for WAVEWATCH III Grid preprocessor input file
parm/ww3_prnc_wind.inp.tmpl:$ WAVEWATCH III Field preprocessor input file $
parm/ww3_grid.inp.tmpl:$ Template for WAVEWATCH III Grid preprocessor input file
parm/ww3_grid.inp.tmpl:$ WAVEWATCH III Grid preprocessor input file $
scripts/exrwps_forecast.sh:# Make sure nback is set identically in the preprocessor !!!
scripts/exrwps_prep.sh:# This script is the preprocessor for the GRL multi-grid wave model that runs #
scripts/exrwps_prep.sh:# files to the work directory. After this the actual preprocessing is #
scripts/exrwps_prep.sh:# waveice_rwps.sh : preprocess ice fields #
scripts/exrwps_prep.sh:# 1.b Wind preprocessor template file
scripts/exrwps_prep.sh:# 1.c Ice preprocessor template file
scripts/exrwps_prep.sh:# 2.b Ice preprocessing
scripts/exrwps_prep.sh: echo "Ice preprocessing"
scripts/exrwps_prep.sh: echo ' Running ice field through preprocessor.'
scripts/exrwps_prep.sh: echo ' *** End of GLWU preprocessor ***'
scripts/exrwps_prep.sh:# End of GLW preprocessor script -------- ----------------------------------- #
ush/wavendfd_rwps_inc.sh:# the WW3 netcdf preprocessor only works with regular grids)
ush/wavendfd_rwps.sh:# the WW3 netcdf preprocessor only works with regular grids)
| # --------------------------------------------------------------------------- # | ||
|
|
||
| echo 'Fetching externals...' | ||
| cp -p /lfs/h2/emc/couple/noscrub/keston.smith/meshes/RWPS.v0.msh ../fix/ |
There was a problem hiding this comment.
get_externals was not removed but I have moved grabbing fix files to: https://github.com/NOAA-EMC/RWPS/blob/develop/sorc/link_workflow.sh
is there something here that is not in https://github.com/NOAA-EMC/RWPS/blob/develop/sorc/link_workflow.sh that is needed?
When I grep in dev/compute_interpolation_weights I do not see get_externals.sh as being used? Is this file needed?
| python compute_unstr_to_rwps_interp_weights.py $stofs_glo $mesh $Nprocs | ||
|
|
||
| # Now run the parallel job script | ||
| qsub -W block=true jobcardcompute_unstr_to_rwps_interp_weightsPBS |
There was a problem hiding this comment.
Note, qsub from a JJOB is not something that we would do in operations. Since this is dev, we can leave it as is, but I'll be honest, it's not my favorite. It means this just is very hard to port to multiple machines, etc.
| mv InterpWeights.$meshname.stofs.nc $out/InterpolationWeights.$meshname.stofs.nc | ||
| mv DistToBndy.$meshname.stofs.nc $out/DistToBndy.$meshname.stofs.nc | ||
|
|
||
| # clean up temporary directory and files |
There was a problem hiding this comment.
In the future, creating a working directory for the temporary files would be ideal. I watched as the job went and we had tons of files in the package directory that were then deleted. For future dev jobs, please think about using a temporary working directory instead.
| # by nearest node while currents are not extrapolated into coastal | ||
| # regions outside of rtofs marine domain. | ||
| # | ||
| # Files are created in local RWPS/fix directory. |
There was a problem hiding this comment.
Files are now in an output directory, correct?
| mkdir -p $out | ||
|
|
||
| #machine dependend path to RWPS fix files | ||
| export RWPSfix=/lfs/h2/emc/couple/noscrub/keston.smith/RWPS |
There was a problem hiding this comment.
The RWPSfix should not have to be defined, since this only works on WCOSS2 and I am not seeing where this needs to be defined, it at minimum should be the official fix location.
| export RWPSfix=/lfs/h2/emc/couple/noscrub/keston.smith/RWPS | ||
|
|
||
| # link mesh corresponding to meshID to local fix directory | ||
| $HOMErwps/sorc/link_workflow.sh |
There was a problem hiding this comment.
| $HOMErwps/sorc/link_workflow.sh | |
| ${HOMErwps}/sorc/link_workflow.sh |
| export meshname="${meshname: 0: -4}" | ||
|
|
||
| #Retrieve current and process for forecast cycle | ||
| qsub -V $HOMErwps/dev/compute_interpolation_weights/ecf/compute_interpolation_weights.ecf |
There was a problem hiding this comment.
| qsub -V $HOMErwps/dev/compute_interpolation_weights/ecf/compute_interpolation_weights.ecf | |
| qsub -V ${HOMErwps}/dev/compute_interpolation_weights/ecf/compute_interpolation_weights.ecf |
| A = f.readline() | ||
| B=A.lstrip() | ||
| values = B.split(" ") | ||
| # print(values) |
There was a problem hiding this comment.
| # print(values) |
| import compute_interpolation_weights_utilities as iutil | ||
| import scipy.sparse as sp | ||
|
|
||
| nargin = len(sys.argv) - 1 |
There was a problem hiding this comment.
Please add a description of the expected input.
|
I was able to run the code and my spot check generated the same file you did except I had a full path of the mesh and yours was relative. |
This branch contains routines for computing interpolation weights used for computing WW3 forcing in RWPS. To run
see file RWPS/dev/compute_interpolation_weights/README.txt. The routines for retrieving and carrying out pre-processing are not in this branch.