Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
173 changes: 102 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,5 @@
# Scripts CD-CT (Continuos Deployment & Continuous Testing) for MONAN (Model for Ocean-laNd-Atmosphere PredictioN)

## History

**1.4.0**
- Compatibility with MONAN 1.4.3-rc.
- Support for multi-environment: 'Jaci' supercomputer (intel and gnu compilers and PBS scheduler) and 'Egeon' cluster (gnu compiler and SLURM scheduler).

**1.3.0**
- This version was created to work in operational runs.
- Adjusted to run using 16 nodes and 1024 cores.
- Operational vars (cldfrac_tot_UPP, ter, landmask, and omega) table is also in this version.
- Add flags for ~10Km mesh resolution.

**1.2.0**
- This version should work only with MONAN-Model 1.3.1/ (3D native model variables)
- Was added some warnings to users regarding the choice of MONAN-Model versions versus scripts_CD-CT versions:
- scripts_CD-CT versions up to 1.1.0 run MONAN-Model only versions up to 1.3.0
- scripts_CD-CT versions 1.2.0 onwards run MONAN-Model only versions 1.3.1 onwards
-
**1.1.0**
- Fixed `model.bash` script to check generated files with flexible output_interval field (no longer with constant 3h).
- Now it is possible to run all 4 phases with 00z, 06z, 12z and 18z.
- Namelist `namelist.atmosphere.TEMPLATE` was updated to work with MONAN-Model version 1.3.0/, especific `convection_permitting_monan` phisic suite.

**1.0.1**
- Fixing nIsobaricLev(22) in convert_mpas.nml and config_dt(15000) in run_model script.

**1.0.0**
- Changing integration method (3rd Rung-Kutta), time step (150s), nlat and nlon for post processing at 15km and minor adjustments.
- adding configurations for 15km.
- correction on logic of how many submiting will be computed if nfiles were little then maxpostpernodes.
- new parallel post.
- Target_domain values have been fixed.
- Add copy configs files from convert_mpas to dataout/YYYYMMDDHH/Post/logs (MODEL config files and VERSION.txt also).
- fix in config_len_disp in script 3.run_model.bash .
- modifications in datain/namelists/namelist.atmosphere.TEMPLATE and 3.run_model.bash from Saulo's PR 8 .

**0.2.2**
- Fixed the value of config_bucket_update in namelist.atmosphere.
- Fixed module load in opengrads in setenv.

**0.2.1**
- Switch of configs (CONFIG_DT, CONFIG_LEN_DISP, target_domain, etc.) 120 and 24 km.
- Clean temporary outputs files option add in the 3.run_model.bash script.
- Verification if all the output files were created ok from model phase.

**0.2.0**
- Including copy of the GF_ConvPar_nml from model source to scripts folder.
- Changing physics suite to mesoscale_reference_monan.
- Changing the output model interval to 3h adjusting the post processing.
- Changing the radtlw and radtsw interval to 30m, and conv interval to 15m.

**0.1.1**
- Fixing bug on pressure levels description in post files
- Fixing variables name in post files

**0.1.0**
- Used parameterization to select the date for execution.
- Created cron script for daily executions.
- Post-processing is with the new version of convert_mpas, enabling the use of grads.
- Grouping all variables with one pressure level to only one variable with all levels.
- Defined default version of MONAN-Model (0.5.0) and convert_mpas (0.1.0) in the installation step.
# Scripts CD-CT
Continuos Deployment & Continuous Testing for MONAN (Model for Ocean-laNd-Atmosphere PredictioN).

## Get Started

Expand All @@ -69,18 +8,19 @@
Cloning this repo: `git clone https://github.com/monanadmin/scripts_CD-CT.git`
you will get this directories:
~~~
datain/namelists
scripts
scripts/namelists
scripts/stools
~~~

- The `datain/namelists` directory contains all versioned namelists needded for run and compile all phases of model;
- The `scripts` directory is the most important folder that contains all the scripts that you will need to install, compile, run, and produce produtcs of the A-MONAN model.
- The `scripts/namelists` directory contains all versioned namelists needded for run and compile all phases of model;
- The `scripts/stools` directory contains template scripts for execution on SLURM and PBS, and scripts for the operation of the PBS_Intel, PBS_GNU, and PBS_Cray environments.


You will need to execute only 6 steps scripts, so you can run the Atmospheric MONAN Model:
You only need to execute the following four scripts to run the MONAN Atmospheric Model.


**1. Install the model:**
**1. Install the model and configuring the execution mode (Global or Regional):**

- First you need to get a **fork repository** in your github account of a MONAN oficial repo: `https://github.com/monanadmin/MONAN-Model`. Attention! Uncheck "Copy the main branch only" in the fork creation step to copy all branches.
- The you can install the model in your work directory by running:
Expand Down Expand Up @@ -117,6 +57,29 @@ Where:

After running the first step, it will clone the MONAN model from your fork repo in a `source` diretory.

**Configuring the execution mode (Global or Regional):**

Default execution mode is "Global", to set to Regional mode follows:

```
$ vi scripts/setenv.bash
(...)
MODERUN=R | Option: R=Regional and G=Global.
LBCINT=21600 | Option: Integer value for the lateral boundary condition update interval.
```
After this change, you must specify the regional grid in the RESOLUTION parameter during the subsequent steps (2, 3, and 4) listed below.

Currently, the available regional options are:

```
"655362.REG.AMS_CAR" = 30km for South America and the Caribbean
"5898242.REG.AMS_CAR" = 10km for South America and the Caribbean
"23592962.REG.AMS_CAR" = 5km for South America and the Caribbean
```

**Note 1:** For regional runs, it is necessary to have the initial condition files available, in addition to the first forecast or analysis based on the interval provided by LBCINT for generating the LBC files.

**Note 2:** If you wish to use your own regional mesh, you must copy the "x1.your_mesh.grid.nc" and "x1.your_mesh.graph.info" files to the "datain/fixed" folder and create an if-block for the automatic configuration of CONFIG_DT in script 3, as well as for the LAT and LON settings used by Convert_MPAS in script 4.

**2. Prepare the Initial Conditions for the model:**

Expand All @@ -125,7 +88,7 @@ After running the first step, it will clone the MONAN model from your fork repo
~~~
2.pre_processing.bash EXP_NAME RESOLUTION LABELI FCST

EXP_NAME :: Forcing: GFS
EXP_NAME :: Forcing: GFS or ERA
:: Others options to be added later...
RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)
LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100
Expand All @@ -142,7 +105,7 @@ FCST :: Forecast hours, e.g.: 24 or 36, etc.
~~~
3.run_model.bash EXP_NAME RESOLUTION LABELI FCST

EXP_NAME :: Forcing: GFS
EXP_NAME :: Forcing: GFS or ERA
:: Others options to be added later...
RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)
LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100
Expand All @@ -159,7 +122,7 @@ FCST :: Forecast hours, e.g.: 24 or 36, etc.
~~~
4.run_post.bash EXP_NAME RESOLUTION LABELI FCST

EXP_NAME :: Forcing: GFS
EXP_NAME :: Forcing: GFS or ERA
:: Others options to be added later...
RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)
LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100
Expand All @@ -168,3 +131,71 @@ FCST :: Forecast hours, e.g.: 24 or 36, etc.
24 hour forcast example:
./4.run_post.bash GFS 1024002 2024010100 24
~~~

## History

**Develop**

- New functionality for Regional simulations.
- Option to use ERA5 data as an initial condition.

**1.4.0**
- Compatibility with MONAN 1.4.3-rc.
- Support for multi-environment: 'Jaci' supercomputer (intel and gnu compilers and PBS scheduler) and 'Egeon' cluster (gnu compiler and SLURM scheduler).

**1.3.0**
- This version was created to work in operational runs.
- Adjusted to run using 16 nodes and 1024 cores.
- Operational vars (cldfrac_tot_UPP, ter, landmask, and omega) table is also in this version.
- Add flags for ~10Km mesh resolution.

**1.2.0**
- This version should work only with MONAN-Model 1.3.1/ (3D native model variables)
- Was added some warnings to users regarding the choice of MONAN-Model versions versus scripts_CD-CT versions:
- scripts_CD-CT versions up to 1.1.0 run MONAN-Model only versions up to 1.3.0
- scripts_CD-CT versions 1.2.0 onwards run MONAN-Model only versions 1.3.1 onwards
-
**1.1.0**
- Fixed `model.bash` script to check generated files with flexible output_interval field (no longer with constant 3h).
- Now it is possible to run all 4 phases with 00z, 06z, 12z and 18z.
- Namelist `namelist.atmosphere.TEMPLATE` was updated to work with MONAN-Model version 1.3.0/, especific `convection_permitting_monan` phisic suite.

**1.0.1**
- Fixing nIsobaricLev(22) in convert_mpas.nml and config_dt(15000) in run_model script.

**1.0.0**
- Changing integration method (3rd Rung-Kutta), time step (150s), nlat and nlon for post processing at 15km and minor adjustments.
- adding configurations for 15km.
- correction on logic of how many submiting will be computed if nfiles were little then maxpostpernodes.
- new parallel post.
- Target_domain values have been fixed.
- Add copy configs files from convert_mpas to dataout/YYYYMMDDHH/Post/logs (MODEL config files and VERSION.txt also).
- fix in config_len_disp in script 3.run_model.bash .
- modifications in datain/namelists/namelist.atmosphere.TEMPLATE and 3.run_model.bash from Saulo's PR 8 .

**0.2.2**
- Fixed the value of config_bucket_update in namelist.atmosphere.
- Fixed module load in opengrads in setenv.

**0.2.1**
- Switch of configs (CONFIG_DT, CONFIG_LEN_DISP, target_domain, etc.) 120 and 24 km.
- Clean temporary outputs files option add in the 3.run_model.bash script.
- Verification if all the output files were created ok from model phase.

**0.2.0**
- Including copy of the GF_ConvPar_nml from model source to scripts folder.
- Changing physics suite to mesoscale_reference_monan.
- Changing the output model interval to 3h adjusting the post processing.
- Changing the radtlw and radtsw interval to 30m, and conv interval to 15m.

**0.1.1**
- Fixing bug on pressure levels description in post files
- Fixing variables name in post files

**0.1.0**
- Used parameterization to select the date for execution.
- Created cron script for daily executions.
- Post-processing is with the new version of convert_mpas, enabling the use of grads.
- Grouping all variables with one pressure level to only one variable with all levels.
- Defined default version of MONAN-Model (0.5.0) and convert_mpas (0.1.0) in the installation step.

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.4.0->develop
7 changes: 4 additions & 3 deletions scripts/0.run_all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS}
github_link="https://github.com/monanadmin/MONAN-Model.git"
monan_branch=1.4.3-rc
convertmpas_branch=1.2.0
EXP=GFS
RES=1024002 #Options: 40962=120km;163842=60km;655362=30Km;1024002=24km;2621442=15Km;5898242=10Km
YYYYMMDDHHi=2026012000
EXP=GFS #Options - GFS or ERA
RES=1024002 #Options - Global: 40962=120km; 163842=60km; 655362=30Km; 1024002=24km; 2621442=15Km; 5898242=10Km
#Options - Regional: 655362.REG.AMS_CAR=30km; 5898242.REG.AMS_CAR=10km; 23592962.REG.AMS_CAR=5km
YYYYMMDDHHi=2026070100 #Check dates disponible for the initial condition (CI) using ERA
FCST=24
#----------------------------------------------------------------------

Expand Down
6 changes: 0 additions & 6 deletions scripts/1.install_monan.bash
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere"
make clean CORE=atmosphere
make -j 8 ${MAKE_TARG} CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE}
#make -j 8 ${MAKE_TARG} CORE=atmosphere OPENMP=true USE_PIO2=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE}
#make -j 8 intel-xd2000 CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single OPTIMIZATION_LEVEL=O1 FFLAGS_OPT=-O1 CFLAGS_OPT=-O1 CXXFLAGS_OPT=-O1 2>&1 | tee \${MAKE_OUT_FILE}
#CR: TODO: put verify here if executable was created ok
Expand All @@ -235,9 +232,6 @@ MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere"
make clean CORE=init_atmosphere
make -j 8 ${MAKE_TARG2} CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE}
#make -j 8 ${MAKE_TARG2} CORE=init_atmosphere OPENMP=true USE_PIO2=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE}
#make -j 8 intel-xd2000 CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single OPTIMIZATION_LEVEL=O1 FFLAGS_OPT=-O1 CFLAGS_OPT=-O1 CXXFLAGS_OPT=-O1 2>&1 | tee \${MAKE_OUT_FILE}
mv ${MONANDIR}/init_atmosphere_model ${EXECS}
Expand Down
72 changes: 52 additions & 20 deletions scripts/2.pre_processing.bash
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ then
echo ""
echo "${0} EXP_NAME/OP RESOLUTION LABELI FCST"
echo ""
echo "EXP_NAME :: Forcing: GFS"
echo "EXP_NAME :: Forcing: GFS or ERA"
echo " :: Others options to be added later..."
echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)"
echo " 40962 (120 km)"
Expand All @@ -52,7 +52,7 @@ echo "---- Pre Processing ----"
echo ""


# Standart directories variables:---------------------------------------
# Standard directories variables:---------------------------------------
DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES}
DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED}
SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS}
Expand Down Expand Up @@ -80,8 +80,6 @@ final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhh
export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN}
#-------------------------------------------------------



echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n"
git log | head -1

Expand All @@ -94,32 +92,66 @@ then
rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED}
ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN}
fi

#----------------------------------------------------------------------------------

# Creating the x1.${RES}.static.nc file once, if does not exist yet:---------------
if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ]
then
echo -e "${GREEN}==>${NC} Creating static.bash for submiting init_atmosphere to create x1.${RES}.static.nc...\n"
time ./make_static.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
if [[ ${EXP} == "GFS" || ${EXP} == "ERA" ]]; then
if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ]
then
echo -e "${GREEN}==>${NC} Creating static.bash for submiting init_atmosphere to create x1.${RES}.static.nc...\n"
time ./make_static.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
else
echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n"
fi
else
echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n"
echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n"
echo -e "${RED}==>${NC} Static phase fails! Please select EXP=GFS or EXP=ERA.\n"
echo -e "${RED}==>${NC} Exiting script. \n"
exit -1
fi
#----------------------------------------------------------------------------------

#----------------------------------------------------------------------------------

# Degrib phase:---------------------------------------------------------------------
echo -e "${GREEN}==>${NC} Running Degrib:\n"
time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
if [[ ${EXP} == "GFS" ]]
then
echo -e "${GREEN}==>${NC} Submitting Degrib for GFS data...\n"
time ./make_degrib_GFS.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
elif [[ ${EXP} == "ERA" ]]
then
echo -e "${GREEN}==>${NC} Submitting Degrib for ERA data...\n"
time ./make_degrib_ERA5.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
else
echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n"
echo -e "${RED}==>${NC} Degrib phase fails! Please select EXP=GFS or EXP=ERA.\n"
echo -e "${RED}==>${NC} Exiting script. \n"
exit -1
fi
#----------------------------------------------------------------------------------




# Init Atmosphere phase:------------------------------------------------------------
echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n"
time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
if [[ ${EXP} == "GFS" || ${EXP} == "ERA" ]]; then
echo -e "${GREEN}==>${NC} Submitting Init Atmosphere for real case...\n"
time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
else
echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n"
echo -e "${RED}==>${NC} Init Atmosphere phase fails! Please select EXP=GFS or EXP=ERA.\n"
echo -e "${RED}==>${NC} Exiting script. \n"
exit -1
fi
#----------------------------------------------------------------------------------



# LBCs phase:------------------------------------------------------------
if [[ $MODERUN == "R" ]]; then
echo -e "${GREEN}==>${NC} Regional simulation: submitting Init Atmosphere to generate lateral boundary conditions...\n"
time ./make_lbcs.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST}
elif [[ $MODERUN == "G" ]]; then
echo -e "${GREEN}==>${NC} Global simulation: no need for lateral boundary conditions.\n"
else
echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n"
echo -e "${RED}==>${NC} LBCs phase fails! Please select MODERUN=R or G.\n"
echo -e "${RED}==>${NC} Exiting script. \n"
exit -1
fi
#----------------------------------------------------------------------------------

Loading