Skip to content

Commit

Permalink
Updated false bay model to use the same sed logic as algoa bay (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachsa committed Apr 17, 2023
1 parent 8f72269 commit 1506875
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,14 @@
"SAST",
"Segoe",
"Sinebow",
"SMFLUX",
"SOMISANA",
"subdataset",
"subdatasets",
"sustr",
"swcrc",
"Swipeable",
"swparam",
"Terrestris",
"tileserv",
"timestep",
Expand Down
8 changes: 4 additions & 4 deletions models/algoa-bay-forecast/croco.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:20.04

ARG DEBIAN_FRONTEND=noninteractive
ARG NP_ETA=2
ARG NP_XI=2
ARG NP_ETA=4
ARG NP_XI=3

ENV NP_ETA=$NP_ETA
ENV NP_XI=$NP_XI
Expand All @@ -26,8 +26,8 @@ COPY croco/overwrites/ .

# Configure param.h
# TODO - next, refactor this to be at container run time (along with compilication)
RUN sed -e "s/\$NP_XI/3/g" -e "s/\$NP_ETA/4/g" _param.h > croco-1.1/param.h
RUN sed -e "s/\$NP_XI/3/g" -e "s/\$NP_ETA/4/g" _param.h > param.h
RUN sed -e "s/\$NP_XI/${NP_XI:-3}/g" -e "s/\$NP_ETA/${NP_ETA:-4}/g" _param.h > croco-1.1/param.h
RUN sed -e "s/\$NP_XI/${NP_XI:-3}/g" -e "s/\$NP_ETA/${NP_ETA:-4}/g" _param.h > param.h
RUN rm _param.h
RUN rm croco-1.1/_param.h

Expand Down
2 changes: 1 addition & 1 deletion models/algoa-bay-forecast/croco/run-model/run_croco.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NH_AVG=1 # The temporal average of the output file in hours edited to save ever
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} ))
MPI_NUM_PROCS=$(( ${NP_ETA:-4} * ${NP_XI:-3} ))
EXEDIR=$(pwd)
INPUTDIR=$RUNDIR/croco/forcing
SCRATCHDIR=$RUNDIR/croco/scratch
Expand Down
9 changes: 8 additions & 1 deletion models/false-bay-forecast/croco.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:20.04

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

ENV NP_ETA=$NP_ETA
Expand All @@ -24,6 +24,13 @@ COPY croco/1.1/ croco-1.1/
COPY croco/overwrites/ croco-1.1/
COPY croco/overwrites/ .

# Configure param.h
# TODO - next, refactor this to be at container run time (along with compilication)
RUN sed -e "s/\$NP_XI/${NP_XI:-2}/g" -e "s/\$NP_ETA/${NP_ETA:-4}/g" _param.h > croco-1.1/param.h
RUN sed -e "s/\$NP_XI/${NP_XI:-2}/g" -e "s/\$NP_ETA/${NP_ETA:-4}/g" _param.h > param.h
RUN rm _param.h
RUN rm croco-1.1/_param.h

# Create the entrypoint to run the compiled model
COPY croco/run-model/ .

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
integer NSUB_X, NSUB_E, NPP
#ifdef MPI
integer NP_XI, NP_ETA, NNODES
parameter (NP_XI=2, NP_ETA=4, NNODES=NP_XI*NP_ETA)
parameter (NP_XI=$NP_XI, NP_ETA=$NP_ETA, NNODES=NP_XI*NP_ETA)
parameter (NPP=1)
parameter (NSUB_X=1, NSUB_E=1)
#elif defined OPENMP
Expand Down
2 changes: 1 addition & 1 deletion models/false-bay-forecast/croco/run-model/run_croco.bash
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ NH_AVG=1 # The temporal average of the output file in hours edited to save every
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} ))
MPI_NUM_PROCS=$(( ${NP_ETA:-4} * ${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

0 comments on commit 1506875

Please sign in to comment.