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

UFS-dev PR#118 #113

Merged
merged 13 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
[submodule "FV3"]
path = FV3
url = https://github.com/NCAR/fv3atm
branch = main
#url = https://github.com/NCAR/fv3atm
#branch = main
url = https://github.com/grantfirl/fv3atm
branch = ufs-dev-PR118
[submodule "WW3"]
path = WW3
url = https://github.com/NOAA-EMC/WW3
Expand Down
2 changes: 1 addition & 1 deletion CICE-interface/CICE
2 changes: 1 addition & 1 deletion FV3
2 changes: 1 addition & 1 deletion tests/bl_date.conf
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export BL_DATE=20231002
export BL_DATE=20231013
58 changes: 56 additions & 2 deletions tests/ci/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
def commentMessage

void setBuildStatus(String message, String state) {
step([
$class: "GitHubCommitStatusSetter",
reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/ufs-community/ufs-weather-model"],
contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "Jenkins-ci ORTs"],
errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]],
statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ]
]);
}

def postGitHubCommentWithLogFile(commentMessage) {
script {
withCredentials([string(credentialsId: 'GithubJenkinsNew', variable: 'ACCESS_TOKEN')]) {
def apiUrl = "https://api.github.com/repos/ufs-community/ufs-weather-model/issues/${env.CHANGE_ID}/comments"

def curlCommand = "curl -s -H \"Authorization: token " + ACCESS_TOKEN + "\" \\\n" +
"-X POST -d '{\"body\": \"" + commentMessage + "\"}' \\\n" +
"\"" + apiUrl + "\""

def response = sh(script: curlCommand, returnStatus: true)

if (response == 0) {
echo "Comment added successfully to PR #${env.CHANGE_ID}"
} else {
error "Failed to add comment to PR #${env.CHANGE_ID}"
}
}
}
}

pipeline {
agent none

Expand All @@ -12,7 +44,8 @@ pipeline {
steps {
script {
build job: '/ufs-weather-model/ufs-wm-sonarqube', parameters: [
string(name: 'BRANCH_NAME', value: env.CHANGE_BRANCH ?: 'develop')
string(name: 'BRANCH_NAME', value: env.CHANGE_BRANCH ?: 'develop'),
string(name: 'FORK_NAME', value: env.CHANGE_FORK ?: '')
], wait: false
}
}
Expand Down Expand Up @@ -87,7 +120,7 @@ pipeline {

stage('Test') {
steps {
sh 'docker run --rm --env test_name="${TEST_NAME}" --env run_case="${TEST_CASE}" --workdir /home/builder/ufs-weather-model/tests --volume DataVolume:/home/builder/data/NEMSfv3gfs --interactive --shm-size=16gb "${IMG_NAME}"'
sh 'docker run --rm --env test_name="${TEST_NAME}" --env run_case="${TEST_CASE}" --workdir /home/builder/ufs-weather-model/tests --volume DataVolume:/home/builder/data/NEMSfv3gfs --interactive --shm-size=32gb "${IMG_NAME}"'
}
}
}
Expand All @@ -104,4 +137,25 @@ pipeline {
}
}
}
post {
success {
node('built-in') {
setBuildStatus("Build succeeded", "SUCCESS");
}
}
failure {
node('built-in') {
setBuildStatus("Build failed", "FAILURE");
}
}
always {
node('built-in') {
script {
def buildResult = currentBuild.resultIsBetterOrEqualTo("SUCCESS") ? "passed" : "failed"
commentMessage = "Jenkins-ci ORTs ${buildResult}"
postGitHubCommentWithLogFile(commentMessage)
}
}
}
}
}
26 changes: 19 additions & 7 deletions tests/default_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ export OUTPUT_FH="12 -1"
export NFHOUT=12
export NFHMAX_HF=12
export NFHOUT_HF=6
export IAU_OFFSET=0
export FHZERO=6
export FNALBC="'global_snowfree_albedo.bosu.t126.384.190.rg.grb'"
export FNVETC="'global_vegtype.igbp.t126.384.190.rg.grb'"
Expand Down Expand Up @@ -581,6 +580,9 @@ export LNDP_MODEL_TYPE=0

#IAU
export IAU_INC_FILES="''"
export IAU_DELTHRS=0
export IAUFHRS=-1
export IAU_OFFSET=0

export FH_DFI_RADAR='-2e10'

Expand All @@ -589,8 +591,6 @@ export DO_CA=.false.
export CA_SGS=.false.
export CA_GLOBAL=.false.

export IAU_DRYMASSFIXER=.false.

#waves
export WW3RSTDTHR=12
export DT_2_RST="$(printf "%02d" $(( ${WW3RSTDTHR}*3600 )))"
Expand Down Expand Up @@ -868,8 +868,14 @@ export MOM6_THERMO_SPAN=False
export MOM6_USE_WAVES=True
export MOM6_ALLOW_LANDMASK_CHANGES=False
# MOM6 IAU
export MOM_IAU=False
export MOM_IAU_HRS=6
export ODA_INCUPD=False
export ODA_INCUPD_NHOURS=6
export ODA_TEMPINC_VAR="'pt_inc'"
export ODA_SALTINC_VAR="'s_inc'"
export ODA_THK_VAR="'h_fg'"
export ODA_INCUPD_UV=False
export ODA_UINC_VAR="'u_inc'"
export ODA_VINC_VAR="'v_inc'"
# MOM6 stochastics
export DO_OCN_SPPT=False
export PERT_EPBL=False
Expand Down Expand Up @@ -1026,8 +1032,14 @@ export MOM6_RIVER_RUNOFF=False
export FRUNOFF=''
export CHLCLIM=seawifs_1998-2006_smoothed_2X.nc
# MOM6 IAU
export MOM_IAU=False
export MOM_IAU_HRS=6
export ODA_INCUPD=False
export ODA_INCUPD_NHOURS=6
export ODA_TEMPINC_VAR="'pt_inc'"
export ODA_SALTINC_VAR="'s_inc'"
export ODA_THK_VAR="'h_fg'"
export ODA_INCUPD_UV=False
export ODA_UINC_VAR="'u_inc'"
export ODA_VINC_VAR="'v_inc'"
export MOM6_USE_LI2016=False
# MOM6 stochastics
export DO_OCN_SPPT=False
Expand Down
6 changes: 6 additions & 0 deletions tests/fv3_conf/cpld_control_run.IN
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ else
RFILE_OLD=$(basename $RFILE)
mv -f $RFILE INPUT/"${RFILE_OLD//${RESTART_FILE_PREFIX}./}"
done
if [[ $IAU_OFFSET == 6 ]] && [[ $FHROT -le 6 ]]; then
cp @[INPUTDATA_ROOT]/${FV3_DIR}/INPUT_L127_mx${OCNRES}/fv_increment*.nc ./INPUT/.
fi

#if not mx025, then mom6 restart is a single file
if [[ $OCNRES == 025 ]]; then
Expand All @@ -105,6 +108,9 @@ else
cp ../${DEP_RUN}${SUFFIX}/RESTART/${RESTART_FILE_PREFIX}.MOM.res_3.nc ./INPUT/MOM.res_3.nc
else
cp ../${DEP_RUN}${SUFFIX}/RESTART/${RESTART_FILE_PREFIX}.MOM.res.nc ./INPUT/MOM.res.nc
if [[ $ODA_INCUPD == 'True' ]] && [[ $FHROT -le 6 ]]; then
cp @[INPUTDATA_ROOT]/MOM6_IC/mom6_increment.nc ./INPUT/mom6_increment.nc
fi
fi

# CMEPS restart and pointer files
Expand Down
2 changes: 1 addition & 1 deletion tests/fv3_conf/cpld_datm_cdeps.IN
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if [ $WARM_START = .false. ]; then
else
cp @[INPUTDATA_ROOT]/MOM6_IC/@[OCNRES]/2011100100/MOM6_IC_TS*.nc ./INPUT/MOM6_IC_TS.nc
cp @[INPUTDATA_ROOT]/CICE_IC/@[OCNRES]/cice_model_@[ICERES].cpc.res_2011100100.nc cice_model.res.nc
if [[ $MOM_IAU == 'True' ]];then
if [[ $ODA_INCUPD == 'True' ]];then
cp @[INPUTDATA_ROOT]/MOM6_IC/@[OCNRES]/2011100100/mom6_increment.nc ./INPUT/mom6_increment.nc
fi
fi
Expand Down
Loading