Skip to content

Commit

Permalink
Applied config changes to false bay model (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachsa committed Apr 17, 2023
1 parent ac2da60 commit 7894a93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/run_false-bay-forecast.yml
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ jobs:
-v $WORKDIR:/false-bay-forecast/current \
-v $(pwd)/models/false-bay-forecast/lib/grd.nc:/false-bay-forecast/current/croco/forcing/grd.nc \
-v $(pwd)/models/false-bay-forecast/lib/grd.nc.1:/false-bay-forecast/current/croco/forcing/grd.nc.1 \
--cpus 12 \
-e NP_XI=2 \
-e NP_ETA=4 \
--cpus 8 \
${{ needs.compile-croco.outputs.image }} \
./run_croco.bash \
/false-bay-forecast/current \
Expand All @@ -310,7 +312,7 @@ jobs:
mv ${{ env.WORKDIR }}/croco/scratch/avg.nc ${{ env.WORKDIR }}/croco/forecast/hourly-avg-${{ env.RUN_DATE }}.nc
mv ${{ env.WORKDIR }}/croco/scratch/avg.nc.1 ${{ env.WORKDIR }}/croco/forecast/hourly-avg-${{ env.RUN_DATE }}.nc.1
# Updates CROCO output vars to be centered
# Updates CROCO output vars to be centred
# and work out depth levels in meters
normalize-output:
needs: [branch-ref, croco, toolkit, envs, workdir]
Expand Down
5 changes: 5 additions & 0 deletions models/false-bay-forecast/croco.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ARG NP_ETA=2
ARG NP_XI=2

ENV NP_ETA=$NP_ETA
ENV NP_XI=$NP_XI

RUN apt-get update \
&& apt-get install -y \
Expand Down
14 changes: 7 additions & 7 deletions models/false-bay-forecast/croco/run-model/run_croco.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ TIME_prev=$3 # i.e. 20220606 set as env variable called RESTART_FILE_DATE in .y
HDAYS=5 # Fixed value in this context
FDAYS=5
NH_AVG=1 # The temporal average of the output file in hours edited to save every hour
NH_AVGSURF=1 # The temporal average of the output file (only surface variables) in hours
NDAYS=$((HDAYS + FDAYS))
INDIR=$(pwd) # where the croco_frcst.in file is stored, in the current setup it is in the same directory
MPI_NUM_PROCS=8 # TODO - can this be done dynamically? What about parallel computing?
NH_AVGSURF=1 # The temporal average of the output file (only surface variables) in hours
NDAYS=$((HDAYS + FDAYS))
INDIR=$(pwd) # where the croco_frcst.in file is stored, in the current setup it is in the same directory
MPI_NUM_PROCS=$(( ${NP_ETA:-2} * ${NP_XI:-2} ))
EXEDIR=$(pwd)
INPUTDIR=$RUNDIR/croco/forcing
AGRIF_FILE=$INDIR/AGRIF_FixedGrids.in #The nested run needs the AGRIF.in file
Expand Down Expand Up @@ -55,7 +55,7 @@ chmod u+x croco
rm -f $SCRATCHDIR/*.in
rm -f $SCRATCHDIR/*.out

#Added AGRIF_FILE to scratch directory Matt
#Added AGRIF_FILE to scratch directory Matt
cp -f $AGRIF_FILE $SCRATCHDIR

LEVEL=0
Expand Down Expand Up @@ -103,7 +103,7 @@ if [[ ${CLIMATOLOGY_FILES} == 1 ]]; then
ln -sf ${INPUTDIR}/${CLMFILE}_${OGCM}_${TIME}.nc ${CLMFILE}.nc
fi

# False bay doesnot use bry
# False bay doesnot use bry
if [[ ${BOUNDARY_FILES} == 1 ]]; then
ln -sf ${INPUTDIR}/${BRYFILE}_${OGCM}_${TIME}.nc ${BRYFILE}.nc
fi
Expand Down Expand Up @@ -158,7 +158,7 @@ done
# Run the model
mpirun -np $MPI_NUM_PROCS ./croco croco_${TIME}.in > croco_${TIME}.out

# Check that the model run correctly
# Check that the model run correctly

status=`tail -2 croco_${TIME}.out | grep DONE | wc -l`
if [[ $status == 1 ]]; then
Expand Down

0 comments on commit 7894a93

Please sign in to comment.